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 2011/10/19 15:15:11 UTC
svn commit: r1186188 [2/3] - in /myfaces/core/trunk/api: ./ src/assembler/
src/main/javascript/META-INF/resources/myfaces/_impl/_util/
src/main/javascript/META-INF/resources/myfaces/_impl/core/
src/main/javascript/META-INF/resources/myfaces/_impl/i18n/...
Added: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js?rev=1186188&view=auto
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js (added)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_DomQuirks.js Wed Oct 19 13:15:10 2011
@@ -0,0 +1,512 @@
+if(!document.querySelectorAll) {
+/***
+ Dom.js version for non html5 browsers
+ */
+_MF_SINGLTN(_PFX_UTIL+"DomQuirks", myfaces._impl._util._Dom, /**
+ * @lends myfaces._impl._util._DomQuirks.prototype
+ */
+{
+ IE_QUIRKS_EVENTS : {
+ "onabort": true,
+ "onload":true,
+ "onunload":true,
+ "onchange": true,
+ "onsubmit": true,
+ "onreset": true,
+ "onselect": true,
+ "onblur": true,
+ "onfocus": true,
+ "onkeydown": true,
+ "onkeypress": true,
+ "onkeyup": true,
+ "onclick": true,
+ "ondblclick": true,
+ "onmousedown": true,
+ "onmousemove": true,
+ "onmouseout": true,
+ "onmouseover": true,
+ "onmouseup": true
+ },
+
+ constructor_: function() {
+
+ var b = myfaces._impl.core._Runtime.browser;
+
+ if (b.isIE <= 6 && b.isIEMobile) {
+ //winmobile hates add onLoad, and checks on the construct
+ //it does not eval scripts anyway
+ myfaces.config = myfaces.config || {};
+ myfaces.config._autoeval = false;
+ return;
+ }
+ this._callSuper("constructor_");
+ myfaces._impl._util._Dom = this;
+
+ //we register ourselves into the existing classes lazily
+ var _T = this;
+ if (myfaces._impl.core.Impl) {
+ this._RT.iterateClasses(function(proto) {
+ if(proto._Dom) proto._Dom = _T;
+ });
+ }
+ },
+
+ /**
+ * Checks whether the browser is dom compliant.
+ * Dom compliant means that it performs the basic dom operations safely
+ * without leaking and also is able to perform a native setAttribute
+ * operation without freaking out
+ *
+ *
+ * Not dom compliant browsers are all microsoft browsers in quirks mode
+ * and ie6 and ie7 to some degree in standards mode
+ * and pretty much every browser who cannot create ranges
+ * (older mobile browsers etc...)
+ *
+ * We dont do a full browser detection here because it probably is safer
+ * to test for existing features to make an assumption about the
+ * browsers capabilities
+ */
+ isDomCompliant: function() {
+ if('undefined' == typeof this._isCompliantBrowser) {
+ this._isCompliantBrowser = !! ((window.Range
+ && typeof Range.prototype.createContextualFragment == 'function') //createContextualFragment hints to a no quirks browser but we need more fallbacks
+ || document.querySelectoryAll //query selector all hints to html5 capabilities
+ || document.createTreeWalker); //treewalker is either firefox 3.5+ or ie9 standards mode
+ }
+ return this._isCompliantBrowser;
+ },
+
+ /**
+ * now to the evil browsers
+ * of what we are dealing with is various bugs
+ * first a simple replaceElement leaks memory
+ * secondly embedded scripts can be swallowed upon
+ * innerHTML, we probably could also use direct outerHTML
+ * but then we would run into the script swallow bug
+ *
+ * the entire mess is called IE6 and IE7
+ *
+ * @param item
+ * @param markup
+ */
+ _outerHTMLNonCompliant: function(item, markup) {
+
+ var b = this._RT.browser;
+ var evalNodes = null;
+
+ try {
+ //check for a subtable rendering case
+
+ var evalNodes = this._buildEvalNodes(item, markup);
+
+ if (evalNodes.length == 1) {
+ var ret = evalNodes[0];
+ this.replaceElement(item, evalNodes[0]);
+ return ret;
+ } else {
+ return this.replaceElements(item, evalNodes);
+ }
+
+ } finally {
+
+ var dummyPlaceHolder = this.getDummyPlaceHolder();
+ //now that Microsoft has finally given
+ //ie a working gc in 8 we can skip the costly operation
+ if (b.isIE && b.isIE < 8) {
+ this._removeChildNodes(dummyPlaceHolder, false);
+ }
+ dummyPlaceHolder.innerHTML = "";
+ }
+
+ },
+
+ /**
+ * builds the ie nodes properly in a placeholder
+ * and bypasses a non script insert bug that way
+ * @param markup the marku code
+ */
+ _buildNodesNonCompliant: function(markup) {
+
+ var evalNodes = null;
+
+ //now to the non w3c compliant browsers
+ //http://blogs.perl.org/users/clinton_gormley/2010/02/forcing-ie-to-accept-script-tags-in-innerhtml.html
+ //we have to cope with deficiencies between ie and its simulations in this case
+ var probe = this.getDummyPlaceHolder();//document.createElement("div");
+
+ probe.innerHTML = "<table><tbody><tr><td><div></div></td></tr></tbody></table>";
+
+ //we have customers using html unit, this has a bug in the table resolution
+ //hence we determine the depth dynamically
+ var depth = this._determineDepth(probe);
+
+ this._removeChildNodes(probe, false);
+ probe.innerHTML = "";
+
+ var dummyPlaceHolder = this.getDummyPlaceHolder();//document.createElement("div");
+
+ //fortunately a table element also works which is less critical than form elements regarding
+ //the inner content
+ dummyPlaceHolder.innerHTML = "<table><tbody><tr><td>" + markup + "</td></tr></tbody></table>";
+ evalNodes = dummyPlaceHolder;
+
+ for (var cnt = 0; cnt < depth; cnt++) {
+ evalNodes = evalNodes.childNodes[0];
+ }
+ var ret = (evalNodes.parentNode) ? this.detach(evalNodes.parentNode.childNodes) : null;
+
+ if ('undefined' == typeof evalNodes || null == evalNodes) {
+ //fallback for htmlunit which should be good enough
+ //to run the tests, maybe we have to wrap it as well
+ dummyPlaceHolder.innerHTML = "<div>" + markup + "</div>";
+ //note this is triggered only in htmlunit no other browser
+ //so we are save here
+ evalNodes = this.detach(dummyPlaceHolder.childNodes[0].childNodes);
+ }
+
+ this._removeChildNodes(dummyPlaceHolder, false);
+ //ie fix any version, ie does not return true javascript arrays so we have to perform
+ //a cross conversion
+ return ret;
+
+ },
+
+ //now to another nasty issue:
+ //for ie we have to walk recursively over all nodes:
+ //http://msdn.microsoft.com/en-us/library/bb250448%28VS.85%29.aspx
+ //http://weblogs.java.net/blog/driscoll/archive/2009/11/13/ie-memory-management-and-you
+ //http://home.orange.nl/jsrosman/
+ //http://www.quirksmode.org/blog/archives/2005/10/memory_leaks_li.html
+ //http://www.josh-davis.org/node/7
+ _removeNode: function(node, breakEventsOpen) {
+ if (!node) return;
+ var b = this._RT.browser;
+ if (this.isDomCompliant()) {
+ //recursive descension only needed for old ie versions
+ //all newer browsers cleanup the garbage just fine without it
+ //thank you
+ if ('undefined' != typeof node.parentNode && null != node.parentNode) //if the node has a parent
+ node.parentNode.removeChild(node);
+ return;
+ }
+
+ //now to the browsers with non working garbage collection
+ this._removeChildNodes(node, breakEventsOpen);
+
+ try {
+ //outer HTML setting is only possible in earlier IE versions all modern browsers throw an exception here
+ //again to speed things up we precheck first
+ if(!this._isTableElement(node)) {
+ //we do not do a table structure innnerhtml on table elements except td
+ //htmlunit rightfully complains that we should not do it
+ node.innerHTML = "";
+ }
+ if (b.isIE && 'undefined' != typeof node.outerHTML) {//ie8+ check done earlier we skip it here
+ node.outerHTML = '';
+ } else {
+ node = this.detach(node)[0];
+ }
+ if (!b.isIEMobile) {
+ delete node;
+ }
+ } catch (e) {
+ //on some elements we might not have covered by our table check on the outerHTML
+ // can fail we skip those in favor of stability
+ try {
+ // both innerHTML and outerHTML fails when <tr> is the node, but in that case
+ // we need to force node removal, otherwise it will be on the tree (IE 7 IE 6)
+ this.detach(node);
+ if (!b.isIEMobile) {
+ delete node;
+ }
+ } catch (e1) {
+ }
+ }
+ }
+ ,
+
+
+
+ /**
+ * recursive delete child nodes
+ * node, this method only makes sense in the context of IE6 + 7 hence
+ * it is not exposed to the public API, modern browsers
+ * can garbage collect the nodes just fine by doing the standard removeNode method
+ * from the dom API!
+ *
+ * @param node the node from which the childnodes have to be deletd
+ * @param breakEventsOpen if set to true a standard events breaking is performed
+ */
+ _removeChildNodes: function(node, breakEventsOpen) {
+ if (!node) return;
+
+ //node types which cannot be cleared up by normal means
+ var disallowedNodes = this.TABLE_ELEMS;
+
+ //for now we do not enable it due to speed reasons
+ //normally the framework has to do some event detection
+ //which we cannot do yet, I will dig for options
+ //to enable it in a speedly manner
+ //ie7 fixes this area anyway
+ //this.breakEvents(node);
+
+ var b = this._RT.browser;
+ if (breakEventsOpen) {
+ this.breakEvents(node);
+ }
+
+ for (var cnt = node.childNodes.length - 1; cnt >= 0; cnt -= 1) {
+ var childNode = node.childNodes[cnt];
+ //we cannot use our generic recursive tree walking due to the needed head recursion
+ //to clean it up bottom up, the tail recursion we were using in the search either would use more time
+ //because we had to walk and then clean bottom up, so we are going for a direct head recusion here
+ if ('undefined' != typeof childNode.childNodes && node.childNodes.length)
+ this._removeChildNodes(childNode);
+ try {
+ var nodeName = (childNode.nodeName || childNode.tagName) ? (childNode.nodeName || childNode.tagName).toLowerCase() : null;
+ //ie chokes on clearing out table inner elements, this is also covered by our empty
+ //catch block, but to speed things up it makes more sense to precheck that
+ if (!disallowedNodes[nodeName]) {
+ //outer HTML setting is only possible in earlier IE versions all modern browsers throw an exception here
+ //again to speed things up we precheck first
+ if(!this._isTableElement(childNode)) { //table elements cannot be deleted
+ childNode.innerHTML = "";
+ }
+ if (b.isIE && b.isIE < 8 && 'undefined' != childNode.outerHTML)
+ childNode.outerHTML = '';
+ else {
+ node.removeChild(childNode);
+ }
+ if (!b.isIEMobile) {
+ delete childNode;
+ }
+ }
+ } catch (e) {
+ //on some elements the outerHTML can fail we skip those in favor
+ //of stability
+
+ }
+ }
+ }
+ ,
+ /**
+ * cross ported from dojo
+ * fetches an attribute from a node
+ *
+ * @param {String} node the node
+ * @param {String} attr the attribute
+ * @return the attributes value or null
+ */
+ getAttribute : function(/* HTMLElement */node, /* string */attr) {
+ // summary
+ // Returns the value of attribute attr from node.
+ node = this.byId(node);
+ // FIXME: need to add support for attr-specific accessors
+ if ((!node) || (!node.getAttribute)) {
+ // if(attr !== 'nwType'){
+ // alert("getAttr of '" + attr + "' with bad node");
+ // }
+ return null;
+ }
+ var ta = typeof attr == 'string' ? attr : new String(attr);
+
+ // first try the approach most likely to succeed
+ var v = node.getAttribute(ta.toUpperCase());
+ if ((v) && (typeof v == 'string') && (v != "")) {
+ return v; // string
+ }
+
+ // try returning the attributes value, if we couldn't get it as a string
+ if (v && v.value) {
+ return v.value; // string
+ }
+
+ // this should work on Opera 7, but it's a little on the crashy side
+ if ((node.getAttributeNode) && (node.getAttributeNode(ta))) {
+ return (node.getAttributeNode(ta)).value; // string
+ } else if (node.getAttribute(ta)) {
+ return node.getAttribute(ta); // string
+ } else if (node.getAttribute(ta.toLowerCase())) {
+ return node.getAttribute(ta.toLowerCase()); // string
+ }
+ return null; // string
+ },
+
+ /**
+ * bugfixing for ie6 which does not cope properly with setAttribute
+ */
+ setAttribute : function(node, attr, val) {
+
+ this._assertStdParams(node, attr, "setAttribute");
+
+ //quirks mode and ie7 mode has the attributes problems ie8 standards mode behaves like
+ //a good citizen
+ var _Browser = this._RT.browser;
+ //in case of ie > ie7 we have to check for a quirks mode setting
+ if (!_Browser.isIE || _Browser.isIE > 7 && this.isDomCompliant()) {
+ this._callSuper("setAttribute", node, attr, val);
+ return;
+ }
+
+ /*
+ Now to the broken browsers IE6+.... ie7 and ie8 quirks mode
+
+ we deal mainly with three problems here
+ class and for are not handled correctly
+ styles are arrays and cannot be set directly
+ and javascript events cannot be set via setAttribute as well!
+
+ or in original words of quirksmode.org ... this is a mess!
+
+ Btw. thank you Microsoft for providing all necessary tools for free
+ for being able to debug this entire mess in the ie rendering engine out
+ (which is the Microsoft ie vms, developers toolbar, Visual Web Developer 2008 express
+ and the ie8 8 developers toolset!)
+
+ also thank you http://www.quirksmode.org/
+ dojotoolkit.org and //http://delete.me.uk/2004/09/ieproto.html
+ for additional information on this mess!
+
+ The lowest common denominator tested within this code
+ is IE6, older browsers for now are legacy!
+ */
+ attr = attr.toLowerCase();
+
+ if (attr === "class") {
+ //setAttribute does not work for winmobile browsers
+ //firect calls work
+ node.className = val;
+ } else if (attr === "name") {
+ //the ie debugger fails to assign the name via setAttr
+ //in quirks mode
+ node[attr] = val;
+ } else if (attr === "for") {
+ if (!_Browser.isIEMobile || _Browser.isIEMobile >= 7) {
+ node.setAttribute("htmlFor", val);
+ } else {
+ node.htmlFor = val;
+ }
+ } else if (attr === "style") {
+ //We have to split the styles here and assign them one by one
+ var styles = val.split(";");
+ var stylesLen = styles.length;
+ for (var loop = 0; loop < stylesLen; loop++) {
+ var keyVal = styles[loop].split(":");
+ if (keyVal[0] != "" && keyVal[0] == "opacity") {
+ //special ie quirks handling for opacity
+
+ var opacityVal = Math.max(100, Math.round(parseFloat(keyVal[1]) * 10));
+ //probably does not work in ie mobile anyway
+ if (!_Browser.isIEMobile || _Browser.isIEMobile >= 7) {
+ node.style.setAttribute("arrFilter", "alpha(opacity=" + opacityVal + ")");
+ }
+ //if you need more hacks I would recommend
+ //to use the class attribute and conditional ie includes!
+ } else if (keyVal[0] != "") {
+ if (!_Browser.isIEMobile || _Browser.isIEMobile >= 7) {
+ node.style.setAttribute(keyVal[0], keyVal[1]);
+ } else {
+ node.style[keyVal[0]] = keyVal[1];
+ }
+ }
+ }
+ } else {
+ //check if the attribute is an event, since this applies only
+ //to quirks mode of ie anyway we can live with the standard html4/xhtml
+ //ie supported events
+ if (this.IE_QUIRKS_EVENTS[attr]) {
+ if (this._Lang.isString(attr)) {
+ //event resolves to window.event in ie
+ node.setAttribute(attr, function() {
+ //event implicitly used
+ return this._Lang.globalEval(val);
+ });
+ }
+ } else {
+ //unknown cases we try to catch them via standard setAttributes
+ if (!_Browser.isIEMobile || _Browser.isIEMobile >= 7) {
+ node.setAttribute(attr, val);
+ } else {
+ node[attr] = val;
+ }
+ }
+ }
+ },
+
+
+
+ getDummyPlaceHolder: function() {
+ this._callSuper("getDummyPlaceHolder");
+
+ //ieMobile in its 6.1-- incarnation cannot handle innerHTML detached objects so we have
+ //to attach the dummy placeholder, we try to avoid it for
+ //better browsers so that we do not have unecessary dom operations
+ if (this._RT.browser.isIEMobile && created) {
+ this.insertFirst(this._dummyPlaceHolder);
+
+ this.setAttribute(this._dummyPlaceHolder, "style", "display: none");
+
+ }
+
+ return this._dummyPlaceHolder;
+ },
+
+ /**
+ * classical recursive way which definitely will work on all browsers
+ * including the IE6
+ *
+ * @param rootNode the root node
+ * @param filter the filter to be applied to
+ * @param deepScan if set to true a deep scan is performed
+ */
+ _recursionSearchAll: function(rootNode, filter, deepScan) {
+ var ret = [];
+ //fix the value to prevent undefined errors
+
+ if (filter(rootNode)) {
+ ret.push(rootNode);
+ if (!deepScan) return ret;
+ }
+
+ //
+ if (!rootNode.childNodes) {
+ return ret;
+ }
+
+ //subfragment usecases
+
+ var retLen = ret.length;
+ var childLen = rootNode.childNodes.length;
+ for (var cnt = 0; (deepScan || retLen == 0) && cnt < childLen; cnt++) {
+ ret = ret.concat(this._recursionSearchAll(rootNode.childNodes[cnt], filter, deepScan));
+ }
+ return ret;
+ },
+
+ /**
+ * break the standard events from an existing dom node
+ * (note this method is not yet used, but can be used
+ * by framework authors to get rid of ie circular event references)
+ *
+ * another way probably would be to check all attributes of a node
+ * for a function and if one is present break it by nulling it
+ * I have to do some further investigation on this.
+ *
+ * The final fix is to move away from ie6 at all which is the root cause of
+ * this.
+ *
+ * @param node the node which has to be broken off its events
+ */
+ breakEvents: function(node) {
+ if (!node) return;
+ var evtArr = this.IE_QUIRKS_EVENTS;
+ for (var key in evtArr) {
+ if (key != "onunload" && node[key]) {
+ node[key] = null;
+ }
+ }
+ }
+});
+
+}
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ExtDom.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ExtDom.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ExtDom.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ExtDom.js Wed Oct 19 13:15:10 2011
@@ -15,11 +15,28 @@
* limitations under the License.
*/
-myfaces._impl.core._Runtime.singletonDelegateObj("myfaces._impl._util._ExtDom", myfaces._impl._util._Dom, {
+/*only quirksmode browsers get the quirks part of the code*/
+_MF_SINGLTN(_PFX_UTIL + "_ExtDom", myfaces._impl._util._Dom, {
_Lang:myfaces._impl._util._Lang,
_RT:myfaces._impl.core._Runtime,
+ constructor_: function() {
+ this._callSuper("constructor_");
+ var _T = this;
+ //we only apply lazy if the jsf part is loaded already
+ //otherwise we are at the correct position
+ if (myfaces._impl.core.Impl) {
+ this._RT.iterateClasses(function (proto) {
+ if (proto._Dom) {
+ proto._Dom = _T;
+ }
+ });
+ }
+
+ myfaces._impl._util._Dom = _T;
+ },
+
/**
* finds the elements by an attached style class
*
@@ -69,7 +86,7 @@ myfaces._impl.core._Runtime.singletonDel
} else {
//fallback to the classical filter methods if we cannot use the
//html 5 selectors for whatever reason
- return this._callDelegate("findAll", fragment, filter, deepScan);
+ return this._callSuper("findAll", fragment, filter, deepScan);
}
} finally {
@@ -136,12 +153,8 @@ myfaces._impl.core._Runtime.singletonDel
* @returns the found node or null otherwise
*/
findFormElement : function(form, nameId) {
- if (!form) {
- throw Error("_Dom.findFormElement a form node must be given");
- }
- if (!nameId) {
- throw Error("_Dom.findFormElement an element or identifier must be given");
- }
+ this._assertStdParams(form, nameId, "findFormElement");
+
if (!form.elements) return null;
return form.elements[nameId] || this.findById(form, nameId);
},
@@ -261,7 +274,84 @@ myfaces._impl.core._Runtime.singletonDel
return treeWalker.currentNode;
}
return null;
+ },
+
+
+ /**
+ * a closure based child filtering routine
+ * which steps one level down the tree and
+ * applies the filter closure
+ *
+ * @param item the node which has to be investigates
+ * @param filter the filter closure
+ */
+ getFilteredChild: function(item, filter) {
+
+ this._assertStdParams(item, filter, "getFilteredChild");
+
+ var childs = item.childNodes;
+ if (!childs) {
+ return null;
+ }
+ for (var c = 0, cLen = childs.length; c < cLen; c++) {
+ if (filter(childs[c])) {
+ return childs[c];
+ }
+ }
+ return null;
}
+ ,
+
+ /**
+ * gets the child of an item with a given tag name
+ * @param {Node} item - parent element
+ * @param {String} childName - TagName of child element
+ * @param {String} itemName - name attribute the child can have (can be null)
+ * @Deprecated
+ */
+ getChild: function(item, childName, itemName) {
+ var _Lang = this._Lang;
+
+ function filter(node) {
+ return node.tagName
+ && _Lang.equalsIgnoreCase(node.tagName, childName)
+ && (!itemName || (itemName && itemName == node.getAttribute("name")));
+
+ }
+
+ return this.getFilteredChild(item, filter);
+ },
+ /**
+ * fetches the style class for the node
+ * cross ported from the dojo toolkit
+ * @param {String|Object} node the node to search
+ * @returns the className or ""
+ */
+ getClass : function(node) {
+ node = this.byId(node);
+ if (!node) {
+ return "";
+ }
+ var cs = "";
+ if (node.className) {
+ cs = node.className;
+ } else {
+ if (this.hasAttribute(node, "class")) {
+ cs = this.getAttribute(node, "class");
+ }
+ }
+ return cs.replace(/^\s+|\s+$/g, "");
+ },
+
+ /**
+ * fetches the class for the node,
+ * cross ported from the dojo toolkit
+ * @param {String|Object}node the node to search
+ */
+ getClasses : function(node) {
+ var c = this.getClass(node);
+ return (c == "") ? [] : c.split(/\s+/g);
+ }
+});
-});
\ No newline at end of file
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_HtmlStripper.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_HtmlStripper.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_HtmlStripper.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_HtmlStripper.js Wed Oct 19 13:15:10 2011
@@ -25,7 +25,7 @@
*/
/** @namespace myfaces._impl._util._HtmlStripper */
-_MF_CLS("myfaces._impl._util._HtmlStripper", Object,
+_MF_CLS(_PFX_UTIL+"_HtmlStripper", Object,
/** @lends myfaces._impl._util._HtmlStripper.prototype */
{
BEGIN_TAG: "html",
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Lang.js Wed Oct 19 13:15:10 2011
@@ -46,7 +46,7 @@
* decorates the namespace myfaces._impl.core._Runtime and adds a bunch of new methods to
* what _Runtime provided
* */
-var _Lang = _MF_SINGLTN("myfaces._impl._util._Lang", Object,
+_MF_SINGLTN(_PFX_UTIL+"_Lang", Object,
/**
* @lends myfaces._impl._util._Lang.prototype
*/
@@ -58,6 +58,8 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
_RT: myfaces._impl.core._Runtime,
+
+
/**
* returns a given localized message upon a given key
* basic java log like templating functionality is included
@@ -80,7 +82,7 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
var msg = this._installedLocale[key] || defaultMessage || key + " - undefined message";
for(var cnt = 2; cnt < arguments.length; cnt++) {
- msg = msg.replace(new RegExp(["\\{",cnt-2,"\\}"].join(""),"g"),new String(arguments[cnt]));
+ msg = msg.replace(new RegExp(["\\{",cnt-2,"\\}"].join(""),"g"),new String(arguments[cnt]));
}
return msg;
},
@@ -91,7 +93,7 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
* a new locale can be installed optionally
* to our i18n subsystem
*
- * @param newLocale locale override
+ * @param newLocale locale override
*/
initLocale: function(newLocale) {
if(newLocale) {
@@ -105,7 +107,7 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
var i18nRoot = myfaces._impl.i18n;
var i18nHolder = i18nRoot["Messages_"+variantStr] ||
i18nRoot["Messages_"+langStr] ||
- i18nRoot.Messages;
+ i18nRoot["Messages"];
this._installedLocale = new i18nHolder();
},
@@ -245,15 +247,6 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
},
/**
- @see this._RT.extendClass
- */
- /*extendClass : function(newClass, extendsClass, functionMap, inherited) {
- return this._RT.extendClass(newClass, extendsClass, functionMap, inherited);
- },*/
-
- //core namespacing and inheritance done, now to the language extensions
-
- /**
* Save document.getElementById (this code was ported over from dojo)
* the idea is that either a string or domNode can be passed
* @param {Object} reference the reference which has to be byIded
@@ -392,12 +385,7 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
throw Error(this.getMessage("ERR_MUST_BE_PROVIDED",null,"_Lang.contains", "arr {array}", "str {string}"));
}
- for (var cnt = 0; cnt < arr.length; cnt++) {
- if (arr[cnt] == str) {
- return true;
- }
- }
- return false;
+ return this.arrIndexOf(arr, str) != -1;
},
@@ -409,7 +397,6 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
for (var cnt = 0; cnt < len; cnt++) {
ret[arr[cnt]] = cnt + offset;
}
-
return ret;
},
@@ -433,15 +420,16 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
delimiter = delimiter || "\n";
return arr.join(delimiter);
- }
- ,
-
+ },
objToArray: function(obj, offset, pack) {
if (!obj) {
return null;
}
//since offset is numeric we cannot use the shortcut due to 0 being false
+ //special condition array delivered no offset no pack
+ if(obj instanceof Array && !offset && !pack) return obj;
+
var finalOffset = ('undefined' != typeof offset || null != offset) ? offset : 0;
var finalPack = pack || [];
try {
@@ -459,8 +447,7 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
return finalPack;
}
- }
- ,
+ },
/**
* foreach implementation utilizing the
@@ -480,32 +467,15 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
*/
arrForEach: function(arr, func /*startPos, scope*/) {
if(!arr || !arr.length ) return;
- try {
- var startPos = Number(arguments[2]) || 0;
- var thisObj = arguments[3];
- //check for an existing foreach mapping on array prototypes
- //IE9 still does not pass array objects as result for dom ops
- if (Array.prototype.forEach && arr.forEach) {
- (startPos) ? arr.slice(startPos).forEach(func, thisObj) : arr.forEach(func, thisObj);
- } else {
- startPos = (startPos < 0) ? Math.ceil(startPos) : Math.floor(startPos);
- if (typeof func != "function") {
- throw new TypeError();
- }
- for (var cnt = 0; cnt < arr.length; cnt++) {
- if (thisObj) {
- func.call(thisObj, arr[cnt], cnt, arr);
- } else {
- func(arr[cnt], cnt, arr);
- }
- }
- }
- } finally {
- func = null;
- }
- }
- ,
+ var startPos = Number(arguments[2]) || 0;
+ var thisObj = arguments[3];
+
+ //check for an existing foreach mapping on array prototypes
+ //IE9 still does not pass array objects as result for dom ops
+ arr = this.objToArray(arr);
+ (startPos) ? arr.slice(startPos).forEach(func, thisObj) : arr.forEach(func, thisObj);
+ },
/**
@@ -525,36 +495,9 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
*/
arrFilter: function(arr, func /*startPos, scope*/) {
if(!arr || !arr.length ) return [];
- try {
- var startPos = Number(arguments[2]) || 0;
- var thisObj = arguments[3];
-
- //check for an existing foreach mapping on array prototypes
- if (Array.prototype.filter) {
- return ((startPos) ? arr.slice(startPos).filter(func, thisObj) : arr.filter(func, thisObj));
- } else {
- if (typeof func != "function") {
- throw new TypeError();
- }
- var ret = [];
- startPos = (startPos < 0) ? Math.ceil(startPos) : Math.floor(startPos);
-
- for (var cnt = startPos; cnt < arr.length; cnt++) {
- var elem = null;
- if (thisObj) {
- elem = arr[cnt];
- if (func.call(thisObj, elem, cnt, arr)) ret.push(elem);
- } else {
- elem = arr[cnt];
- if (func(arr[cnt], cnt, arr)) ret.push(elem);
- }
- }
- }
- } finally {
- func = null;
- }
- }
- ,
+ arr = this.objToArray(arr);
+ return ((startPos) ? arr.slice(startPos).filter(func, thisObj) : arr.filter(func, thisObj));
+ },
/**
* adds a EcmaScript optimized indexOf to our mix,
@@ -568,24 +511,9 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
arrIndexOf: function(arr, element /*fromIndex*/) {
if (!arr || !arr.length) return -1;
var pos = Number(arguments[2]) || 0;
-
- if (Array.prototype.indexOf) {
- return arr.indexOf(element, pos);
- }
- //var cnt = this._space;
- var len = arr.length;
- pos = (pos < 0) ? Math.ceil(pos) : Math.floor(pos);
-
- //if negative then it is taken from as offset from the length of the array
- if (pos < 0) {
- pos += len;
- }
- while (pos < len && arr[pos] !== element) {
- pos++;
- }
- return (pos < len) ? pos : -1;
- }
- ,
+ arr = this.objToArray(arr);
+ return arr.indexOf(element, pos);
+ },
/**
@@ -630,18 +558,27 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
createErrorMsg: function(sourceClass, func, error) {
var ret = [];
- var keyValToStr = this.keyValToStr;
- ret.push(keyValToStr(this.getMessage("MSG_AFFECTED_CLASS"), sourceClass));
- ret.push(keyValToStr(this.getMessage("MSG_AFFECTED_METHOD"), func));
+ var keyValToStr = this.hitch(this, this.keyValToStr);
+ var getMsg = this.hitch(this, this.getMessage);
+
+ ret.push(keyValToStr(getMsg("MSG_AFFECTED_CLASS"), sourceClass));
+ ret.push(keyValToStr(getMsg("MSG_AFFECTED_METHOD"), func));
+
+ /*we push the values into separate vars to improve the compression*/
+ var errName = error.name;
+ var errMsg = error.message;
+ var errDesc = error.description;
+ var errNum = error.number;
+ var errLineNo = error.lineNumber;
if (error) {
var _UDEF = "undefined";
- ret.push(keyValToStr(this.getMessage("MSG_ERROR_NAME"), error.name ? error.name : _UDEF));
- ret.push(keyValToStr(this.getMessage("MSG_ERROR_MESSAGE"), error.message ? error.message : _UDEF));
- ret.push(keyValToStr(this.getMessage("MSG_ERROR_DESC"), error.description ? error.description : _UDEF));
- ret.push(keyValToStr(this.getMessage("MSG_ERROR_NO"), _UDEF != typeof error.number ? error.number : _UDEF));
- ret.push(keyValToStr(this.getMessage("MSG_ERROR_LINENO"), _UDEF != typeof error.lineNumber ? error.lineNumber : _UDEF));
+ ret.push(keyValToStr(getMsg("MSG_ERROR_NAME"), errName ? errName : _UDEF));
+ ret.push(keyValToStr(getMsg("MSG_ERROR_MESSAGE"), errMsg ? errMsg : _UDEF));
+ ret.push(keyValToStr(getMsg("MSG_ERROR_DESC"), errDesc ? errDesc : _UDEF));
+ ret.push(keyValToStr(getMsg("MSG_ERROR_NO"), _UDEF != typeof errNum ? errNum : _UDEF));
+ ret.push(keyValToStr(getMsg("MSG_ERROR_LINENO"), _UDEF != typeof errLineNo ? errLineNo : _UDEF));
}
return ret.join("");
}
@@ -668,27 +605,15 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
parseXML: function(txt) {
try {
- var parser = null, xmlDoc = null;
- if (window.DOMParser) {
- parser = new DOMParser();
- xmlDoc = parser.parseFromString(txt, "text/xml");
- }
- else // Internet Explorer
- {
- xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
- xmlDoc.async = "false";
- xmlDoc.loadXML(txt);
- }
- return xmlDoc;
+ var parser = new DOMParser();
+ return parser.parseFromString(txt, "text/xml");
} catch (e) {
//undefined internal parser error
return null;
}
- }
- ,
+ },
serializeXML: function(xmlNode, escape) {
- if (xmlNode.xml) return xmlNode.xml; //IE
if(!escape) {
if (xmlNode.data) return xmlNode.data; //CDATA block has raw data
if (xmlNode.textContent) return xmlNode.textContent; //textNode has textContent
@@ -703,10 +628,10 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
buffer.push(this.serializeXML(xmlNode.childNodes[cnt]));
}
return buffer.join("");
- }
- ,
- isXMLParseError: function(xmlContent) {
+ },
+ isXMLParseError: function(xmlContent) {
+ //TODO determine the ie specific part here
//no xml content
if (xmlContent == null) return true;
@@ -723,8 +648,8 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
findParseError(xmlContent);
- }
- ,
+ },
+
/**
* creates a neutral form data wrapper over an existing form Data element
* the wrapper delegates following methods, append
@@ -807,5 +732,57 @@ var _Lang = _MF_SINGLTN("myfaces._impl._
}
return bufInstance;
+ },
+
+ /**
+ * define a property mechanism which is browser neutral
+ * we cannot use the existing setter and getter mechanisms
+ * for now because old browsers do not support them
+ * in the long run we probably can switch over
+ * or make a code split between legacy and new
+ *
+ * TODO find a way to map this mechanism to the standard
+ * props mechanism modern browsers have
+ *
+ * @param obj
+ * @param name
+ * @param value
+ */
+ attr: function(obj, name, value) {
+ var findAccessor = function(theObj, theName) {
+ return (theObj["_" + theName]) ? "_" + theName : ( (theObj[theName]) ? theName : null)
+ };
+ var applyAttr = function(theObj, theName, value, isFunc) {
+ if (value) {
+ if(isFunc) {
+ theObj[theName](value);
+ } else {
+ theObj[theName] = value;
+ }
+ return null;
+ }
+ return (isFunc)?theObj[theName]() : theObj[theName];
+ };
+ try {
+ var finalAttr = findAccessor(obj, name);
+ //simple attibute no setter and getter overrides
+ if(finalAttr) {
+ return applyAttr(obj, finalAttr, value);
+ }
+ //lets check for setter and getter overrides
+ var found = false;
+
+ var prefix = (value)?"set":"get";
+ finalAttr = [prefix,name.substr(0,1).toUpperCase(),name.substr(1)].join("");
+ finalAttr = findAccessor(obj, finalAttr);
+ if(finalAttr) {
+ return applyAttr(obj, finalAttr, value, true);
+ }
+
+ throw Error("property "+name+" not found");
+ } finally {
+ findAccessor = null;
+ applyAttr = null;
+ }
}
});
Added: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_LangQuirks.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_LangQuirks.js?rev=1186188&view=auto
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_LangQuirks.js (added)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_LangQuirks.js Wed Oct 19 13:15:10 2011
@@ -0,0 +1,213 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/*
+ theoretically we could save some code
+ by
+ defining the parent object as
+ var parent = new Object();
+ parent.prototype = new myfaces._impl.core._Runtime();
+ extendClass(function () {
+ }, parent , {
+ But for now we are not doing it the little bit of saved
+ space is not worth the loss of readability
+ */
+
+//html5 ecmascript 3 compliant browser, no quirks mode needed
+if(!Array.prototype.indexOf) {
+/**
+ * @memberOf myfaces._impl
+ * @namespace
+ * @name _util
+ */
+
+/**
+ * @class
+ * @name _Lang
+ * @memberOf myfaces._impl._util
+ * @extends myfaces._impl.core._Runtime
+ * @namespace
+ * @description Object singleton for Language related methods, this object singleton
+ * decorates the namespace myfaces._impl.core._Runtime and adds a bunch of new methods to
+ * what _Runtime provided
+ * <p>This class provides the proper fallbacks for ie8- and Firefox 3.6-</p>
+ * */
+_MF_SINGLTN(_PFX_UTIL+"_LangQuirks", myfaces._impl._util._Lang, {
+
+ constructor_: function() {
+ this._callSuper("constructor_");
+ var _RT = this._RT;
+ var singletons = this.attr(_RT, "registeredSingletons");
+ var _T = this;
+ //we only apply lazy if the jsf part is loaded already
+ //otherwise we are at the correct position
+ if(myfaces._impl.core.Impl) {
+ _RT.iterateClasses(function(proto) {
+ if(proto._Lang) proto._Lang = _T;
+ });
+ }
+
+ myfaces._impl._util._Lang = _T;
+ },
+
+ /**
+ * foreach implementation utilizing the
+ * ECMAScript wherever possible
+ * with added functionality
+ *
+ * @param arr the array to filter
+ * @param func the closure to apply the function to, with the syntax defined by the ecmascript functionality
+ * function (element<,key, array>)
+ * <p />
+ * optional params
+ * <p />
+ * <ul>
+ * <li>param startPos (optional) the starting position </li>
+ * <li>param scope (optional) the scope to apply the closure to </li>
+ * </ul>
+ */
+ arrForEach: function(arr, func /*startPos, scope*/) {
+ if (!arr || !arr.length) return;
+ try {
+ var startPos = Number(arguments[2]) || 0;
+ var thisObj = arguments[3];
+
+ //check for an existing foreach mapping on array prototypes
+ //IE9 still does not pass array objects as result for dom ops
+ if (Array.prototype.forEach && arr.forEach) {
+ (startPos) ? arr.slice(startPos).forEach(func, thisObj) : arr.forEach(func, thisObj);
+ } else {
+ startPos = (startPos < 0) ? Math.ceil(startPos) : Math.floor(startPos);
+ if (typeof func != "function") {
+ throw new TypeError();
+ }
+ for (var cnt = 0; cnt < arr.length; cnt++) {
+ if (thisObj) {
+ func.call(thisObj, arr[cnt], cnt, arr);
+ } else {
+ func(arr[cnt], cnt, arr);
+ }
+ }
+ }
+ } finally {
+ func = null;
+ }
+ },
+
+ /**
+ * foreach implementation utilizing the
+ * ECMAScript wherever possible
+ * with added functionality
+ *
+ * @param arr the array to filter
+ * @param func the closure to apply the function to, with the syntax defined by the ecmascript functionality
+ * function (element<,key, array>)
+ * <p />
+ * additional params
+ * <ul>
+ * <li> startPos (optional) the starting position</li>
+ * <li> scope (optional) the scope to apply the closure to</li>
+ * </ul>
+ */
+ arrFilter: function(arr, func /*startPos, scope*/) {
+ if (!arr || !arr.length) return [];
+ try {
+ var startPos = Number(arguments[2]) || 0;
+ var thisObj = arguments[3];
+
+ //check for an existing foreach mapping on array prototypes
+ if (Array.prototype.filter) {
+ return ((startPos) ? arr.slice(startPos).filter(func, thisObj) : arr.filter(func, thisObj));
+ } else {
+ if (typeof func != "function") {
+ throw new TypeError();
+ }
+ var ret = [];
+ startPos = (startPos < 0) ? Math.ceil(startPos) : Math.floor(startPos);
+
+ for (var cnt = startPos; cnt < arr.length; cnt++) {
+ var elem = null;
+ if (thisObj) {
+ elem = arr[cnt];
+ if (func.call(thisObj, elem, cnt, arr)) ret.push(elem);
+ } else {
+ elem = arr[cnt];
+ if (func(arr[cnt], cnt, arr)) ret.push(elem);
+ }
+ }
+ }
+ } finally {
+ func = null;
+ }
+ },
+
+ /**
+ * adds a EcmaScript optimized indexOf to our mix,
+ * checks for the presence of an indexOf functionality
+ * and applies it, otherwise uses a fallback to the hold
+ * loop method to determine the index
+ *
+ * @param arr the array
+ * @param element the index to search for
+ */
+ arrIndexOf: function(arr, element /*fromIndex*/) {
+ if (!arr || !arr.length) return -1;
+ var pos = Number(arguments[2]) || 0;
+
+ if (Array.prototype.indexOf) {
+ return arr.indexOf(element, pos);
+ }
+ //var cnt = this._space;
+ var len = arr.length;
+ pos = (pos < 0) ? Math.ceil(pos) : Math.floor(pos);
+
+ //if negative then it is taken from as offset from the length of the array
+ if (pos < 0) {
+ pos += len;
+ }
+ while (pos < len && arr[pos] !== element) {
+ pos++;
+ }
+ return (pos < len) ? pos : -1;
+ },
+
+ parseXML: function(txt) {
+ try {
+ var xmlDoc = null;
+ if (window.DOMParser) {
+ xmlDoc = this._callSuper("parseXML", txt);
+ }
+ else // Internet Explorer
+ {
+ xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
+ xmlDoc.async = "false";
+ xmlDoc.loadXML(txt);
+ }
+ return xmlDoc;
+ } catch (e) {
+ //undefined internal parser error
+ return null;
+ }
+ },
+
+ serializeXML: function(xmlNode, escape) {
+ if (xmlNode.xml) return xmlNode.xml; //IE
+ return this._callSuper("serializeXML", xmlNode, escape);
+ }
+});
+
+}
\ No newline at end of file
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ListenerQueue.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ListenerQueue.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ListenerQueue.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_ListenerQueue.js Wed Oct 19 13:15:10 2011
@@ -29,17 +29,11 @@
* <p>It is based upon our high performance queue and adds dedicated
* methods for listener based closures to the mix </p>
* */
-_MF_CLS("myfaces._impl._util._ListenerQueue", myfaces._impl._util._Queue,
+_MF_CLS(_PFX_UTIL+"_ListenerQueue", myfaces._impl._util._Queue,
/**
* @lends myfaces._impl._util._ListenerQueue.prototype
*/
{
- /**
- * standard constructor
- */
- constructor_: function() {
- this._callSuper("constructor");
- },
/**
* listener type safety assertion function
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Logging.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Logging.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Logging.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Logging.js Wed Oct 19 13:15:10 2011
@@ -28,7 +28,7 @@
* and by unit tests
*/
/** @namespace myfaces._impl._util._Logging */
-_MF_SINGLTN("myfaces._impl._util._Logging",Object, {
+_MF_SINGLTN(_PFX_UTIL+"_Logging", _MF_OBJECT, {
/**
* we use a map switch instread of a log level
@@ -43,24 +43,22 @@ _MF_SINGLTN("myfaces._impl._util._Loggin
_Lang: myfaces._impl._util._Lang,
constructor_: function() {
+ this._callSuper("constructor_");
//due to the delegation pattern we do not have access to the browser
this._browser = myfaces._impl.core._Runtime.browser;
this.logLevels = {};
- this.logLevels[this._ERR] = true;
- this.logLevels[this._INF] = true;
- this.logLevels[this._DEB] = true;
- this.logLevels[this._LOG] = true;
- this.logLevels[this._WRN] = true;
-
- //printing of a stack trace if possible
this.stackTraceLevels = {};
- this.stackTraceLevels[this._ERR] = true;
- this.stackTraceLevels[this._INF] = false;
- this.stackTraceLevels[this._DEB] = false;
- this.stackTraceLevels[this._LOG] = false;
- this.stackTraceLevels[this._WRN] = false;
+ var logLevels = this.logLevels;
+ var traceLevels = this.stackTraceLevels;
+ var levels = [this._ERR, this._INF, this._DEB, this._LOG, this._WRN];
+ for(var cnt = 0; cnt < levels.length; cnt++) {
+ var elem = levels[cnt];
+ logLevels[elem] = true;
+ traceLevels[elem] = false;
+ }
+ traceLevels[this._ERR] = true;
},
/**
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Queue.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Queue.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Queue.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_Queue.js Wed Oct 19 13:15:10 2011
@@ -22,7 +22,7 @@
* improved version of
* @see <a href="http://safalra.com/web-design/javascript/queues/Queue.js">http://safalra.com/web-design/javascript/queues/Queue.js</a>
*/
-_MF_CLS("myfaces._impl._util._Queue", Object,
+_MF_CLS(_PFX_UTIL+"_Queue", _MF_OBJECT,
/**
* @lends myfaces._impl._util._Queue.prototype
*/
@@ -39,8 +39,8 @@ _MF_CLS("myfaces._impl._util._Queue", Ob
* Standard constructor
*/
constructor_: function() {
+ this._callSuper("constructor_");
this._q = [];
- this._Lang = myfaces._impl._util._Lang;
},
/**
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_UnitTest.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_UnitTest.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_UnitTest.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/_util/_UnitTest.js Wed Oct 19 13:15:10 2011
@@ -24,7 +24,9 @@
* which test the various functions of the framework
*/
/** @namespace myfaces._impl._util._UnitTest*/
-_MF_SINGLTN("myfaces._impl._util._UnitTest", Object, {
+_MF_SINGLTN(_PFX_UTIL+"_UnitTest", _MF_OBJECT, {
+
+
/**
* Simple assert true
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Impl.js Wed Oct 19 13:15:10 2011
@@ -21,14 +21,14 @@
* @description Implementation singleton which implements all interface method
* defined by our jsf.js API
* */
-_MF_SINGLTN("myfaces._impl.core.Impl", Object,
+_MF_SINGLTN(_PFX_CORE+"Impl", _MF_OBJECT,
/**
* @lends myfaces._impl.core.Impl.prototype
*/
{
//third option myfaces._impl.xhrCoreAjax which will be the new core impl for now
- _transport : new (myfaces._impl.core._Runtime.getGlobalConfig("transport", myfaces._impl.xhrCore._Transports))(),
+ _transport : myfaces._impl.core._Runtime.getGlobalConfig("transport", myfaces._impl.xhrCore._Transports),
/**
* external event listener queue!
@@ -76,8 +76,6 @@ _MF_SINGLTN("myfaces._impl.core.Impl", O
CLIENT_ERROR: "clientError",
TIMEOUT_EVENT: "timeout",
- _Lang: myfaces._impl._util._Lang,
- _Dom: myfaces._impl._util._Dom,
/*error reporting threshold*/
_threshold: "ERROR",
@@ -86,6 +84,8 @@ _MF_SINGLTN("myfaces._impl.core.Impl", O
* will not be transmitted from the options into the passthrough*/
_BLOCKFILTER: {onerror: true, onevent: true, render: true, execute: true, myfaces: true},
+
+
/**
* collect and encode data for a given form element (must be of type form)
* find the javax.faces.ViewState element and encode its value as well!
@@ -141,7 +141,7 @@ _MF_SINGLTN("myfaces._impl.core.Impl", O
* b) passThrough handling with a map copy with a filter map block map
*/
request : function(elem, event, options) {
-
+
/*namespace remap for our local function context we mix the entire function namespace into
*a local function variable so that we do not have to write the entire namespace
*all the time
@@ -520,7 +520,7 @@ _MF_SINGLTN("myfaces._impl.core.Impl", O
var impl = myfaces._impl.core._Runtime.getGlobalConfig("jsfAjaxImpl", myfaces._impl.core.Impl);
impl.sendError(request, context, this.CLIENT_ERROR, "ErrorRetrievingResponse",
_Lang.getMessage("ERR_CONSTRUCT", e.toString()));
-
+
//client errors are not swallowed
throw e;
}
@@ -559,7 +559,7 @@ _MF_SINGLTN("myfaces._impl.core.Impl", O
/* run through all script tags and try to find the one that includes jsf.js */
var scriptTags = document.getElementsByTagName("script");
var getConfig = myfaces._impl.core._Runtime.getGlobalConfig;
-
+
for (var i = 0; i < scriptTags.length; i++) {
if (scriptTags[i].src.search(/\/javax\.faces\.resource\/jsf\.js.*ln=javax\.faces/) != -1) {
var result = scriptTags[i].src.match(/stage=([^&;]*)/);
@@ -707,6 +707,6 @@ _MF_SINGLTN("myfaces._impl.core.Impl", O
throw exception;
}
}
-});
+});
Added: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Object.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Object.js?rev=1186188&view=auto
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Object.js (added)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/Object.js Wed Oct 19 13:15:10 2011
@@ -0,0 +1,87 @@
+/**
+ Base class which provides several helper functions over all objects
+ */
+_MF_CLS(_PFX_CORE+"Object", Object, {
+
+
+
+ constructor_: function() {
+ this._resettableContent = {};
+ //to make those singleton references
+ //overridable in the instance we have
+ //to load them into the prototype instead
+ //of the instance
+ var proto = this._mfClazz.prototype;
+ var impl = myfaces._impl;
+ if(!proto._RT) {
+ proto._RT = impl.core._Runtime;
+ proto._Lang = impl._util._Lang;
+ proto._Dom = impl._util._Dom;
+ }
+ },
+
+ /*optional functionality can be provided
+ * for ie6 but is turned off by default*/
+ _initDefaultFinalizableFields: function() {
+ for (var key in this) {
+ //per default we reset everything which is not preinitalized
+ if (null == this[key] && key != "_resettableContent" && key.indexOf("_mf") != 0 && key.indexOf("_") == 0) {
+ this._resettableContent[key] = true;
+ }
+ }
+ },
+
+ /**
+ * ie6 cleanup
+ * This method disposes all properties manually in case of ie6
+ * hence reduces the chance of running into a gc problem tremendously
+ * on other browsers this method does nothing
+ */
+ _finalize: function() {
+ try {
+ if (this._isGCed || !this._RT.browser.isIE || !this._resettableContent) {
+ //no ie, no broken garbage collector
+ return;
+ }
+
+ for (var key in this._resettableContent) {
+ if (this._RT.exists(this[key], "_finalize")) {
+ this[key]._finalize();
+ }
+ delete this[key];
+ }
+ } finally {
+ this._isGCed = true;
+ }
+ },
+
+ attr: function(name, value) {
+ return this._Lang.attr(this, name, value);
+ },
+
+ getImpl: function() {
+ this._Impl = this._Impl || this._RT.getGlobalConfig("jsfAjaxImpl", myfaces._impl.core.Impl);
+ return this._Impl;
+ },
+
+ applyArgs: function(args) {
+ this._Lang.applyArgs(this, args);
+ },
+
+ updateSingletons: function(key) {
+ var _T = this;
+ this._RT.iterateSingletons(function(namespace) {
+ if(namespace[key]) namespace[key] = _T;
+ });
+ }
+
+});
+
+(function() {
+ /*some mobile browsers do not have a window object*/
+ var target = window ||document;
+ var _RT = myfaces._impl.core._Runtime;
+ _RT._MF_OBJECT = target._MF_OBJECT;
+
+ target._MF_OBJECT = myfaces._impl.core.Object;
+})();
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EndImpl.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EndImpl.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EndImpl.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EndImpl.js Wed Oct 19 13:15:10 2011
@@ -1,12 +1,19 @@
/*last file loaded, must restore the state of affairs*/
(function() {
+ //some mobile browsers do not have a window object
+ var target = window || document;
var _RT = myfaces._impl.core._Runtime;
- if(_RT._oldExtends) {
- window._MF_CLS = _RT._oldExtends;
- }
- if(_RT._oldSingleton) {
- window._MF_SINGLTN = _RT._oldSingleton;
- }
+ var resetAbbreviation = function (name) {
+ (!!_RT[name]) ?
+ target[name] = _RT[name] : null;
+ };
+ myfaces._impl._util._Lang.arrForEach(["_MF_CLS",
+ "_MF_SINGLTN",
+ "_MF_OBJECT",
+ "_PFX_UTIL",
+ "_PFX_XHR",
+ "_PFX_CORE",
+ "_PFX_I18N"], resetAbbreviation);
})();
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EvalHandlers.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EvalHandlers.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EvalHandlers.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_EvalHandlers.js Wed Oct 19 13:15:10 2011
@@ -74,12 +74,13 @@ if (!myfaces._impl.core._EvalHandlers) {
* @borrows myfaces._impl.core._Runtime as _T
*/
_T._evalBBOld = function(code) {
- var location = document.getElementsByTagName("head")[0] || document.documentElement;
- var placeHolder = document.createElement("script");
- placeHolder.type = "text/javascript";
- placeHolder.text = code;
- location.insertBefore(placeHolder, location.firstChild);
- location.removeChild(placeHolder);
+ var loc = document.getElementsByTagName("head")[0] || document.documentElement;
+ //placeHolder
+ var pHldr = document.createElement("script");
+ pHldr.type = "text/javascript";
+ pHldr.text = code;
+ loc.insertBefore(pHldr, loc.firstChild);
+ loc.removeChild(pHldr);
return null;
};
@@ -108,26 +109,29 @@ if (!myfaces._impl.core._EvalHandlers) {
/**
* global eval on scripts
- * @param {String} code
+ * @param {String} c (code abbreviated since the compression does not work here)
* @name myfaces._impl.core._Runtime.globalEval
* @function
*/
- _T.globalEval = function(code) {
+ _T.globalEval = function(c) {
//TODO add a config param which allows to evaluate global scripts even if the call
//is embedded in an iframe
//We lazy init the eval type upon the browsers
- //capabilities
- if ('undefined' == typeof _T._evalType) {
- _T._evalType = window.execScript ? "_evalExecScript" : null;
- _T._evalType = !_T._evalType && window.eval && (!_T.browser.isBlackBerry || _T.browser.isBlackBerry >= 6) ? "_standardGlobalEval" : null;
- _T._evalType = (window.eval && !_T._evalType) ? "_evalBBOld" : null;
+ //capabilities
+ var _et = "_evalType";
+ var _w = window;
+ var _b = _T.browser;
+ if ('undefined' == typeof _T[_et]) {
+ _T[_et] = _w.execScript ? "_evalExecScript" : null;
+ _T[_et] = !_T[_et] && _w.eval && (!_b.isBlackBerry || _b.isBlackBerry >= 6) ? "_standardGlobalEval" : null;
+ _T[_et] = (_w.eval && !_T[_et]) ? "_evalBBOld" : null;
}
- if (_T._evalType) {
- return _T[_T._evalType](code);
+ if (_T[_et]) {
+ return _T[_T[_et]](c);
}
//we probably have covered all browsers, but this is a safety net which might be triggered
//by some foreign browser which is not covered by the above cases
- eval.call(window, code);
+ eval.call(window, c);
return null;
};
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=1186188&r1=1186187&r2=1186188&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 Wed Oct 19 13:15:10 2011
@@ -60,7 +60,8 @@ if (!myfaces._impl.core._Runtime) {
//namespace idx to speed things up by hitting eval way less
this._reservedNMS = {};
-
+ this._registeredSingletons = {};
+ this._registeredClasses = [];
/**
* replacement counter for plugin classes
*/
@@ -214,6 +215,30 @@ if (!myfaces._impl.core._Runtime) {
};
/**
+ * iterates over all registered singletons in the namespace
+ * @param operator a closure which applies a certain function
+ * on the namespace singleton
+ */
+ this.iterateSingletons = function(operator) {
+ var singletons = _T._registeredSingletons;
+ for(var key in singletons) {
+ var nms = _T.fetchNamespace(key);
+ operator(nms);
+ }
+ };
+ /**
+ * iterates over all registered singletons in the namespace
+ * @param operator a closure which applies a certain function
+ * on the namespace singleton
+ */
+ this.iterateClasses = function(operator) {
+ var classes = _T._registeredClasses;
+ for(var cnt = 0; cnt < classes.length; cnt++) {
+ operator(classes[cnt], cnt);
+ }
+ };
+
+ /**
* check if an element exists in the root
* also allows to check for subelements
* usage
@@ -515,10 +540,18 @@ if (!myfaces._impl.core._Runtime) {
if (!_T.isString(newCls)) {
throw Error("new class namespace must be of type String");
}
+ var className = newCls;
if (_T._reservedNMS[newCls]) {
return;
}
+ var constr = "constructor_";
+ var parClassRef = "_mfClazz";
+ if(!protoFuncs[constr]) {
+ protoFuncs[constr] = (extendCls[parClassRef] || (extendCls.prototype && extendCls.prototype[parClassRef])) ?
+ function() {this._callSuper("constructor_");}: function() {};
+ var assigned = true;
+ }
if ('function' != typeof newCls) {
newCls = _reserveClsNms(newCls, protoFuncs);
@@ -529,8 +562,8 @@ if (!myfaces._impl.core._Runtime) {
//instead of only from classes
//sort of like this.extendClass(newCls, extendObj._mfClazz...
- if (extendCls._mfClazz) {
- extendCls = extendCls._mfClazz;
+ if (extendCls[parClassRef]) {
+ extendCls = extendCls[parClassRef];
}
if ('undefined' != typeof extendCls && null != extendCls) {
@@ -550,15 +583,15 @@ if (!myfaces._impl.core._Runtime) {
*/
newClazz.prototype._callSuper = function(methodName) {
var passThrough = (arguments.length == 1) ? [] : Array.prototype.slice.call(arguments, 1);
-
+ var accDescLevel = "_mfClsDescLvl";
//we store the descension level of each method under a mapped
//name to avoid name clashes
//to avoid name clashes with internal methods of array
//if we don't do this we trap the callSuper in an endless
//loop after descending one level
var _mappedName = ["_",methodName,"_mf_r"].join("");
- this._mfClsDescLvl = this._mfClsDescLvl || new Array();
- var descLevel = this._mfClsDescLvl;
+ this[accDescLevel] = this[accDescLevel] || new Array();
+ var descLevel = this[accDescLevel];
//we have to detect the descension level
//we now check if we are in a super descension for the current method already
//if not we are on this level
@@ -570,6 +603,9 @@ if (!myfaces._impl.core._Runtime) {
//we now store the level position as new descension level for callSuper
descLevel[_mappedName] = _parentCls;
//and call the code on this
+ if(!_parentCls[methodName]) {
+ throw Error("Method _callSuper('"+ methodName+"') called from "+className+" Method does not exist ");
+ }
ret = _parentCls[methodName].apply(this, passThrough);
} finally {
descLevel[_mappedName] = _oldDescLevel;
@@ -579,7 +615,8 @@ if (!myfaces._impl.core._Runtime) {
}
};
//reference to its own type
- newClazz.prototype._mfClazz = newCls;
+ newClazz.prototype[parClassRef] = newCls;
+ _T._registeredClasses.push(newClazz.prototype);
}
//we now map the function map in
@@ -603,6 +640,7 @@ if (!myfaces._impl.core._Runtime) {
* @param {Object} protoFuncs (Map) an optional map of prototype functions which in case of overwriting a base function get an inherited method
*/
this.singletonExtendClass = function(newCls, extendsCls, protoFuncs, nmsFuncs) {
+ _T._registeredSingletons[newCls] = true;
return _T._makeSingleton(_T.extendClass, newCls, extendsCls, protoFuncs, nmsFuncs);
};
@@ -794,12 +832,3 @@ if (!myfaces._impl.core._Runtime) {
};
}
-/*we cannot privatize with a global function hence we store the values away for the init part*/
-(function() {
- var _RT = myfaces._impl.core._Runtime;
- _RT._oldExtends = window._MF_CLS;
- _RT._oldSingleton = window._MF_SINGLTN;
-
- window._MF_CLS = _RT.extendClass;
- window._MF_SINGLTN = _RT.singletonExtendClass;
-})();
Added: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_StartImpl.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_StartImpl.js?rev=1186188&view=auto
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_StartImpl.js (added)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/_StartImpl.js Wed Oct 19 13:15:10 2011
@@ -0,0 +1,18 @@
+/*we cannot privatize with a global function hence we store the values away for the init part*/
+(function() {
+ //some mobile browsers do not have a window object
+ var target = window || document.body;
+ var _RT = myfaces._impl.core._Runtime;
+ var impl = "myfaces._impl.";
+ var params = {_MF_CLS: _RT.extendClass,
+ _MF_SINGLTN: _RT.singletonExtendClass,
+ _PFX_UTIL: impl+"_util.",
+ _PFX_CORE:impl+"core.",
+ _PFX_XHR: impl+"xhrCore.",
+ _PFX_I18N: impl+"i18n."};
+
+ for (var key in params) {
+ _RT[key] = target[key];
+ target[key] = params[key];
+ }
+})();
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/jsf-uncompressed.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/jsf-uncompressed.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/jsf-uncompressed.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/core/jsf-uncompressed.js Wed Oct 19 13:15:10 2011
@@ -15,6 +15,7 @@
*/
if (!window.jsf) {
var _ls = myfaces._impl.core._Runtime.loadScript;
+ _ls("#{resource['org.apache.myfaces.core.impl.core:_StartImpl.js']}", null, null, "UTF-8", false);
_ls("#{resource['org.apache.myfaces.core.impl.i18n:Messages.js']}", null, null, "UTF-8", false);
_ls("#{resource['org.apache.myfaces.core.impl.i18n:Messages_de.js']}", null, null, "UTF-8", false);
@@ -29,12 +30,13 @@ if (!window.jsf) {
_ls("#{resource['org.apache.myfaces.core.impl.util:_Lang.js']}", null, null, "UTF-8", false);
-
- _ls("#{resource['org.apache.myfaces.core.impl.util:_Logging.js']}", null, null, "UTF-8", false);
- _ls("#{resource['org.apache.myfaces.core.impl.util:_UnitTest.js']}", null, null, "UTF-8", false);
+ _ls("#{resource['org.apache.myfaces.core.impl.util:_LangQuirks.js']}", null, null, "UTF-8", false);
+ _ls("#{resource['org.apache.myfaces.core.impl.core:Object.js']}", null, null, "UTF-8", false);
_ls("#{resource['org.apache.myfaces.core.impl.util:_Queue.js']}", null, null, "UTF-8", false);
_ls("#{resource['org.apache.myfaces.core.impl.util:_ListenerQueue.js']}", null, null, "UTF-8", false);
_ls("#{resource['org.apache.myfaces.core.impl.util:_Dom.js']}", null, null, "UTF-8", false);
+ _ls("#{resource['org.apache.myfaces.core.impl.util:_DomQuirks.js']}", null, null, "UTF-8", false);
+
_ls("#{resource['org.apache.myfaces.core.impl.util:_HtmlStripper.js']}", null, null, "UTF-8", false);
_ls("#{resource['org.apache.myfaces.core.impl.util:_OamSubmit.js']}", null, null, "UTF-8", false);
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages.js Wed Oct 19 13:15:10 2011
@@ -30,7 +30,7 @@
* @name Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages", Object,
+_MF_CLS(_PFX_I18N+"Messages", Object,
/**
* @lends myfaces._impl.i18n.Messages.prototype
*/
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_de.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_de.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_de.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_de.js Wed Oct 19 13:15:10 2011
@@ -34,7 +34,7 @@
* @extends myfaces._impl.i18n.Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages_de", myfaces._impl.i18n.Messages,
+_MF_CLS(_PFX_I18N+"Messages_de", myfaces._impl.i18n.Messages,
/** @lends myfaces._impl.i18n.Messages_de.prototype */
{
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_es.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_es.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_es.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_es.js Wed Oct 19 13:15:10 2011
@@ -24,7 +24,7 @@
* @extends myfaces._impl.i18n.Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages_es", myfaces._impl.i18n.Messages,
+_MF_CLS(_PFX_I18N+"Messages_es", myfaces._impl.i18n.Messages,
/** @lends myfaces._impl.i18n.Messages_es.prototype */
{
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_fr.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_fr.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_fr.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_fr.js Wed Oct 19 13:15:10 2011
@@ -25,7 +25,7 @@
* @extends myfaces._impl.i18n.Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages_fr", myfaces._impl.i18n.Messages,
+_MF_CLS(_PFX_I18N+"Messages_fr", myfaces._impl.i18n.Messages,
/** @lends myfaces._impl.i18n.Messages_fr.prototype */
{
MSG_TEST: "MessageTest FR",
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_it.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_it.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_it.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_it.js Wed Oct 19 13:15:10 2011
@@ -24,7 +24,7 @@
* @extends myfaces._impl.i18n.Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages_it", myfaces._impl.i18n.Messages,
+_MF_CLS(_PFX_I18N+"Messages_it", myfaces._impl.i18n.Messages,
/** @lends myfaces._impl.i18n.Messages_it.prototype */
{
/*Messages*/
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_nl.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_nl.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_nl.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_nl.js Wed Oct 19 13:15:10 2011
@@ -22,7 +22,7 @@
* @extends myfaces._impl.i18n.Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages_nl", myfaces._impl.i18n.Messages,
+_MF_CLS(_PFX_I18N+"Messages_nl", myfaces._impl.i18n.Messages,
/** @lends myfaces._impl.i18n.Messages_nl.prototype */
{
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_ru.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_ru.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_ru.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_ru.js Wed Oct 19 13:15:10 2011
@@ -22,7 +22,7 @@
* @extends myfaces._impl.i18n.Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages_ru", myfaces._impl.i18n.Messages,
+_MF_CLS(_PFX_I18N+"Messages_ru", myfaces._impl.i18n.Messages,
/** myfaces._impl.i18n.Messages_ru.prototype */
{
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_CN.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_CN.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_CN.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_CN.js Wed Oct 19 13:15:10 2011
@@ -22,7 +22,7 @@
* @extends myfaces._impl.i18n.Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages_zh_CN", myfaces._impl.i18n.Messages,
+_MF_CLS(_PFX_I18N+"Messages_zh_CN", myfaces._impl.i18n.Messages,
/** @lends myfaces._impl.i18n.Messages_zh_CN.prototype */
{
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_HK.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_HK.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_HK.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_HK.js Wed Oct 19 13:15:10 2011
@@ -22,7 +22,7 @@
* @extends myfaces._impl.i18n.Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages_zh_HK", myfaces._impl.i18n.Messages,
+_MF_CLS(_PFX_I18N+"Messages_zh_HK", myfaces._impl.i18n.Messages,
/** @lends myfaces._impl.i18n.Messages_zh_HK.prototype */
{
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_TW.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_TW.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_TW.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/i18n/Messages_zh_TW.js Wed Oct 19 13:15:10 2011
@@ -22,7 +22,7 @@
* @extends myfaces._impl.i18n.Messages
* @memberOf myfaces._impl.i18n
*/
-_MF_CLS("myfaces._impl.i18n.Messages_zh_TW", myfaces._impl.i18n.Messages,
+_MF_CLS(_PFX_I18N+"Messages_zh_TW", myfaces._impl.i18n.Messages,
/** @lends myfaces._impl.i18n.Messages_zh_TW.prototype */
{
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequest.js Wed Oct 19 13:15:10 2011
@@ -27,9 +27,9 @@
* @class
* @name _AjaxRequest
* @memberOf myfaces._impl.xhrCore
- * @extends myfaces._impl.xhrCore._FinalizeableObj
+ * @extends myfaces._impl.core.Object
*/
-_MF_CLS("myfaces._impl.xhrCore._AjaxRequest", myfaces._impl.xhrCore._FinalizeableObj,
+_MF_CLS(_PFX_XHR+"_AjaxRequest", _MF_OBJECT,
/** @lends myfaces._impl.xhrCore._AjaxRequest.prototype */
{
@@ -96,12 +96,14 @@ _MF_CLS("myfaces._impl.xhrCore._AjaxRequ
try {
this._callSuper("constructor_", args);
- this._initDefaultFinalizableFields();
+
this._onException = this._Lang.hitch(this, this._stdErrorHandler);
this._onWarn = this._Lang.hitch(this, this._stdErrorHandler);
+ this._initDefaultFinalizableFields();
+ delete this._resettableContent["_xhrQueue"];
- this._Lang.applyArgs(this, args);
+ this.applyArgs(args);
var mfInternal = this._context._mfInternal;
mfInternal._onException = this._onException;
mfInternal._onWarning = this._onWarn;
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestLevel2.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestLevel2.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestLevel2.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestLevel2.js Wed Oct 19 13:15:10 2011
@@ -19,7 +19,7 @@
* IT is a specialized request which uses the form data
* element for the handling of forms
*/
-_MF_CLS("myfaces._impl.xhrCore._AjaxRequestLevel2", myfaces._impl.xhrCore._AjaxRequest, {
+_MF_CLS(_PFX_XHR+"_AjaxRequestLevel2", myfaces._impl.xhrCore._AjaxRequest, {
_sourceForm: null,
Modified: myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestQueue.js
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestQueue.js?rev=1186188&r1=1186187&r2=1186188&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestQueue.js (original)
+++ myfaces/core/trunk/api/src/main/javascript/META-INF/resources/myfaces/_impl/xhrCore/_AjaxRequestQueue.js Wed Oct 19 13:15:10 2011
@@ -14,7 +14,7 @@
* limitations under the License.
*/
/** @namespace myfaces._impl.xhrCore._AjaxRequestQueue */
-_MF_CLS("myfaces._impl.xhrCore._AjaxRequestQueue", myfaces._impl._util._Queue,
+_MF_CLS(_PFX_XHR+"_AjaxRequestQueue", myfaces._impl._util._Queue,
/** @lends myfaces._impl.xhrCore._AjaxRequestQueue.prototype */
{
@@ -25,12 +25,7 @@ _MF_CLS("myfaces._impl.xhrCore._AjaxRequ
_curReq : null,
- /**
- * the standard constructur of our class
- */
- constructor_: function() {
- this._callSuper("constructor");
- },
+
/**
* delay request, then call enqueue