You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2010/11/16 08:58:05 UTC

svn commit: r1035549 - /myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js

Author: werpu
Date: Tue Nov 16 07:58:05 2010
New Revision: 1035549

URL: http://svn.apache.org/viewvc?rev=1035549&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-2972

Modified:
    myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js

Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js?rev=1035549&r1=1035548&r2=1035549&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_Runtime.js Tue Nov 16 07:58:05 2010
@@ -102,7 +102,7 @@ if (!myfaces._impl.core._Runtime) {
                     if ('undefined' == typeof ret) return null;
                     return ret;
                 } else {
-                    //blackberry 5- only understands the flakey head method
+                    //blackberry 5- only understands the flaky head method
                     //which fails on literally all newer browsers one way or the other
                     return _T._globalEvalHeadAppendixMethod(code);
                 }
@@ -849,8 +849,8 @@ if (!myfaces._impl.core._Runtime) {
          * chain (note we cannot rely on return values here, hence jsf.util.chain will fail)
          */
         _T.addOnLoad = function(target, func) {
-            var oldonload = target.onload;
-            target.onload = (!_T.assertType(window.onload, "function")) ? func : function() {
+            var oldonload = (target)? target.onload: null;
+            target.onload = (!oldonload || !_T.assertType(oldonload, "function")) ? func : function() {
                 oldonload();
                 func();
             };
@@ -868,10 +868,10 @@ if (!myfaces._impl.core._Runtime) {
          * </ul>
          * null is returned if the browser fails to determine the language settings
          */
-        _T.getLanguage = function(languageOverride) {
+        _T.getLanguage = function(lOverride) {
             var deflt = {language: "en", variant: "UK"}; //default language and variant
             try {
-                var lang = languageOverride || navigator.language || navigator.browserLanguage;
+                var lang = lOverride || navigator.language || navigator.browserLanguage;
                 if(!lang || lang.length < 2) return deflt;
                 return {
                     language: lang.substr(0,2),