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 2012/03/29 13:52:57 UTC
svn commit: r1306794 - in
/myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl:
_util/_DomQuirks.js xhrCore/_AjaxResponse.js
Author: werpu
Date: Thu Mar 29 11:52:57 2012
New Revision: 1306794
URL: http://svn.apache.org/viewvc?rev=1306794&view=rev
Log:
https://issues.apache.org/jira/browse/MYFACES-3512
fixing firefox 3.6 issue, fixing smaller issue with a function for error handling not being called due to a typo
Modified:
myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js
myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js
Modified: myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js?rev=1306794&r1=1306793&r2=1306794&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js (original)
+++ myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js Thu Mar 29 11:52:57 2012
@@ -45,12 +45,19 @@ if (_MF_SINGLTN) {
var b = myfaces._impl.core._Runtime.browser;
- if (b.isIE <= 6 && b.isIEMobile) {
+ if (b.isIEMobile && b.isIE <= 6) {
//winmobile hates add onLoad, and checks on the construct
//it does not eval scripts anyway
myfaces.config = myfaces.config || {};
myfaces.config._autoeval = false;
return;
+ } else {
+ //for whatever reason autoeval is set here on Firefox 3.5 only
+ // could be a firebug problem, by setting setters
+ //and getters no assignment was revealed.
+ if('undefined' != typeof myfaces.config._autoeval) {
+ delete myfaces.config._autoeval;
+ }
}
this._callSuper("constructor_");
myfaces._impl._util._Dom = this;
@@ -550,7 +557,43 @@ if (_MF_SINGLTN) {
node[key] = null;
}
}
- }
+ },
+
+ isManualScriptEval: function() {
+
+ if (!this._Lang.exists(myfaces, "config._autoeval")) {
+
+ //now we rely on the document being processed if called for the first time
+ var evalDiv = document.createElement("div");
+ this._Lang.reserveNamespace("myfaces.config._autoeval");
+ //null not swallowed
+ myfaces.config._autoeval = false;
+
+ var markup = "<script type='text/javascript'> myfaces.config._autoeval = true; </script>";
+ //now we rely on the same replacement mechanisms as outerhtml because
+ //some browsers have different behavior of embedded scripts in the contextualfragment
+ //or innerhtml case (opera for instance), this way we make sure the
+ //eval detection is covered correctly
+ this.setAttribute(evalDiv, "style", "display:none");
+
+ //it is less critical in some browsers (old ie versions)
+ //to append as first element than as last
+ //it should not make any difference layoutwise since we are on display none anyway.
+ this.insertFirst(evalDiv);
+
+ //we remap it into a real boolean value
+ if (window.Range
+ && typeof Range.prototype.createContextualFragment == 'function') {
+ this._outerHTMLCompliant(evalDiv, markup);
+ } else {
+ //will not be called placeholder for quirks class
+ this._outerHTMLNonCompliant(evalDiv, markup);
+ }
+
+ }
+
+ return !myfaces.config._autoeval;
+ }
});
}
Modified: myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js?rev=1306794&r1=1306793&r2=1306794&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js (original)
+++ myfaces/core/branches/2.0.x/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxResponse.js Thu Mar 29 11:52:57 2012
@@ -588,7 +588,7 @@ _MF_SINGLTN(_PFX_XHR + "_AjaxResponse",
_Dom.byIdOrName(itemIdToReplace);
if (!item) {
- throw this._raisError(_Lang.getMessage("ERR_ITEM_ID_NOTFOUND", null, "_AjaxResponse.replaceHtmlItem", (itemIdToReplace) ? itemIdToReplace.toString() : "undefined"));
+ throw this._raiseError(_Lang.getMessage("ERR_ITEM_ID_NOTFOUND", null, "_AjaxResponse.replaceHtmlItem", (itemIdToReplace) ? itemIdToReplace.toString() : "undefined"));
}
return _Dom.outerHTML(item, markup);
},