JBoss Rich Faces SVN: r5655 - branches/3.1.x/framework/impl/src/main/javascript/jquery.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-25 19:37:14 -0500 (Fri, 25 Jan 2008)
New Revision: 5655
Modified:
branches/3.1.x/framework/impl/src/main/javascript/jquery/jquery-1.2.1.js
branches/3.1.x/framework/impl/src/main/javascript/jquery/jquery-1.2.1.min.js
branches/3.1.x/framework/impl/src/main/javascript/jquery/patches.js
Log:
JQuery memory cleaning code optimization
Modified: branches/3.1.x/framework/impl/src/main/javascript/jquery/jquery-1.2.1.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/jquery/jquery-1.2.1.js 2008-01-26 00:00:01 UTC (rev 5654)
+++ branches/3.1.x/framework/impl/src/main/javascript/jquery/jquery-1.2.1.js 2008-01-26 00:37:14 UTC (rev 5655)
@@ -464,7 +464,8 @@
return target;
};
-var expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
+//modified by nick - added global expando property
+var expando = jQuery.expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};
jQuery.extend({
noConflict: function(deep) {
Modified: branches/3.1.x/framework/impl/src/main/javascript/jquery/jquery-1.2.1.min.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/jquery/jquery-1.2.1.min.js 2008-01-26 00:00:01 UTC (rev 5654)
+++ branches/3.1.x/framework/impl/src/main/javascript/jquery/jquery-1.2.1.min.js 2008-01-26 00:37:14 UTC (rev 5655)
@@ -14,7 +14,7 @@
return this[0].value.replace(/\r/g,"");}}else
return this.each(function(){if(val.constructor==Array&&/radio|checkbox/.test(this.type))this.checked=(jQuery.inArray(this.value,val)>=0||jQuery.inArray(this.name,val)>=0);else if(jQuery.nodeName(this,"select")){var tmp=val.constructor==Array?val:[val];jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,tmp)>=0||jQuery.inArray(this.text,tmp)>=0);});if(!tmp.length)this.selectedIndex=-1;}else
this.value=val;});},html:function(val){return val==undefined?(this.length?this[0].innerHTML:null):this.empty().append(val);},replaceWith:function(val){return this.after(val).remove();},eq:function(i){return this.slice(i,i+1);},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));},map:function(fn){return this.pushStack(jQuery.map(this,function(elem,i){return fn.call(elem,i,elem);}));},andSelf:function(){return this.add(this.prevObject);},domManip:function(args,table,dir,fn){var clone=this.length>1,a;return this.each(function(){if(!a){a=jQuery.clean(args,this.ownerDocument);if(dir<0)a.reverse();}var obj=this;if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(a[0],"tr"))obj=this.getElementsByTagName("tbody")[0]||this.appendChild(document.createElement("tbody"));jQuery.each(a,function(){var elem=clone?this.cloneNode(true):this;if(!evalScript(0,elem))fn.call(obj,elem);});});}};function evalScript(i,elem){var script=jQuery.nodeName(elem,"scri!
pt");if(script){if(elem.src)jQuery.ajax({url:elem.src,async:false,dataType:"script"});else
-jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};var expando="jQuery"+(new Date()).getTime(),uuid=0,win={};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(fn+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.t!
agName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
+jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");if(elem.parentNode)elem.parentNode.removeChild(elem);}else if(elem.nodeType==1)jQuery("script",elem).each(evalScript);return script;}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},a=1,al=arguments.length,deep=false;if(target.constructor==Boolean){deep=target;target=arguments[1]||{};}if(al==1){target=this;a=0;}var prop;for(;a<al;a++)if((prop=arguments[a])!=null)for(var i in prop){if(target==prop[i])continue;if(deep&&typeof prop[i]=='object'&&target[i])jQuery.extend(target[i],prop[i]);else if(prop[i]!=undefined)target[i]=prop[i];}return target;};/*modified by nick - added global expando property*/var expando = jQuery.expando = "jQuery" + (new Date()).getTime(), uuid = 0, win = {};jQuery.extend({noConflict:function(deep){window.$=_$;if(deep)window.jQuery=_jQuery;return jQuery;},isFunction:function(fn){return!!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/function/i.test(f!
n+"");},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;},globalEval:function(data){data=jQuery.trim(data);if(data){if(window.execScript)window.execScript(data);else if(jQuery.browser.safari)window.setTimeout(data,0);else
eval.call(window,data);}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();},cache:{},data:function(elem,name,data){elem=elem==window?win:elem;var id=elem[expando];if(!id)id=elem[expando]=++uuid;if(name&&!jQuery.cache[id])jQuery.cache[id]={};if(data!=undefined)jQuery.cache[id][name]=data;return name?jQuery.cache[id][name]:id;},removeData:function(elem,name){elem=elem==window?win:elem;var id=elem[expando];if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];name="";for(name in jQuery.cache[id])break;if(!name)jQuery.removeData(elem);}}else{try{delete elem[expando];}catch(e){if(elem.removeAttribute)elem.removeAttribute(expando);}delete jQuery.cache[id];}},each:function(obj,fn,args){if(args){if(obj.length==undefined)for(var i in obj)fn.apply(obj[i],args);else
for(var i=0,ol=obj.length;i<ol;i++)if(fn.apply(obj[i],args)===false)break;}else{if(obj.length==undefined)for(var i in obj)fn.call(obj[i],i,obj[i]);else
for(var i=0,ol=obj.length,val=obj[0];i<ol&&fn.call(val,i,val)!==false;val=obj[++i]){}}return obj;},prop:function(elem,value,type,index,prop){if(jQuery.isFunction(value))value=value.call(elem,[index]);var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i;return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(prop)?value+"px":value;},className:{add:function(elem,c){jQuery.each((c||"").split(/\s+/),function(i,cur){if(!jQuery.className.has(elem.className,cur))elem.className+=(elem.className?" ":"")+cur;});},remove:function(elem,c){elem.className=c!=undefined?jQuery.grep(elem.className.split(/\s+/),function(cur){return!jQuery.className.has(c,cur);}).join(" "):"";},has:function(t,c){return jQuery.inArray(c,(t.className||t).toString().split(/\s+/))>-1;}},swap:function(e,o,f){for(var i in o){e.style["old"+i]=e.style[i];e.style[i]=o[i];}f.apply(e,[]);for(var i in o)e.style[i]=e.style["old"+i];},css:function(e,p){if(p=="height"||p=="width"){var old={},oHeight!
,oWidth,d=["Top","Bottom","Right","Left"];jQuery.each(d,function(){old["padding"+this]=0;old["border"+this+"Width"]=0;});jQuery.swap(e,old,function(){if(jQuery(e).is(':visible')){oHeight=e.offsetHeight;oWidth=e.offsetWidth;}else{e=jQuery(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({visibility:"hidden",position:"absolute",display:"block",right:"0",left:"0"}).appendTo(e.parentNode)[0];var parPos=jQuery.css(e.parentNode,"position")||"static";if(parPos=="static")e.parentNode.style.position="relative";oHeight=e.clientHeight;oWidth=e.clientWidth;if(parPos=="static")e.parentNode.style.position="static";e.parentNode.removeChild(e);}});return p=="height"?oHeight:oWidth;}return jQuery.curCSS(e,p);},curCSS:function(elem,prop,force){var ret,stack=[],swap=[];function color(a){if(!jQuery.browser.safari)return false;var ret=document.defaultView.getComputedStyle(a,null);return!ret||ret.getPropertyValue("color")=="";}if(prop=="opacity"&&jQuery.browser.msie){ret=jQuery.!
attr(elem.style,"opacity");return ret==""?"1":ret;}if(prop.match(/floa
t/i))prop=styleFloat;if(!force&&elem.style[prop])ret=elem.style[prop];else if(document.defaultView&&document.defaultView.getComputedStyle){if(prop.match(/float/i))prop="float";prop=prop.replace(/([A-Z])/g,"-$1").toLowerCase();var cur=document.defaultView.getComputedStyle(elem,null);if(cur&&!color(elem))ret=cur.getPropertyValue(prop);else{for(var a=elem;a&&color(a);a=a.parentNode)stack.unshift(a);for(a=0;a<stack.length;a++)if(color(stack[a])){swap[a]=stack[a].style.display;stack[a].style.display="block";}ret=prop=="display"&&swap[stack.length-1]!=null?"none":document.defaultView.getComputedStyle(elem,null).getPropertyValue(prop)||"";for(a=0;a<swap.length;a++)if(swap[a]!=null)stack[a].style.display=swap[a];}if(prop=="opacity"&&ret=="")ret="1";}else if(elem.currentStyle){var newProp=prop.replace(/\-(\w)/g,function(m,c){return c.toUpperCase();});ret=elem.currentStyle[prop]||elem.currentStyle[newProp];if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var style=elem.style.left;var run!
timeStyle=elem.runtimeStyle.left;elem.runtimeStyle.left=elem.currentStyle.left;elem.style.left=ret||0;ret=elem.style.pixelLeft+"px";elem.style.left=style;elem.runtimeStyle.left=runtimeStyle;}}return ret;},clean:function(a,doc){var r=[];doc=doc||document;jQuery.each(a,function(i,arg){if(!arg)return;if(arg.constructor==Number)arg=arg.toString();if(typeof arg=="string"){arg=arg.replace(/(<(\w+)[^>]*?)\/>/g,function(m,all,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i)?m:all+"></"+tag+">";});var s=jQuery.trim(arg).toLowerCase(),div=doc.createElement("div"),tb=[];var wrap=!s.indexOf("<opt")&&[1,"<select>","</select>"]||!s.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||s.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!s.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!s.indexOf("<td")||!s.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!s.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgro!
up></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""]
;div.innerHTML=wrap[1]+arg+wrap[2];while(wrap[0]--)div=div.lastChild;if(jQuery.browser.msie){if(!s.indexOf("<table")&&s.indexOf("<tbody")<0)tb=div.firstChild&&div.firstChild.childNodes;else if(wrap[1]=="<table>"&&s.indexOf("<tbody")<0)tb=div.childNodes;for(var n=tb.length-1;n>=0;--n)if(jQuery.nodeName(tb[n],"tbody")&&!tb[n].childNodes.length)tb[n].parentNode.removeChild(tb[n]);if(/^\s/.test(arg))div.insertBefore(doc.createTextNode(arg.match(/^\s*/)[0]),div.firstChild);}arg=jQuery.makeArray(div.childNodes);}if(0===arg.length&&(!jQuery.nodeName(arg,"form")&&!jQuery.nodeName(arg,"select")))return;if(arg[0]==undefined||jQuery.nodeName(arg,"form")||arg.options)r.push(arg);else
Modified: branches/3.1.x/framework/impl/src/main/javascript/jquery/patches.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/jquery/patches.js 2008-01-26 00:00:01 UTC (rev 5654)
+++ branches/3.1.x/framework/impl/src/main/javascript/jquery/patches.js 2008-01-26 00:37:14 UTC (rev 5655)
@@ -10,7 +10,9 @@
if (window.RichFaces && window.RichFaces.Memory) {
window.RichFaces.Memory.addCleaner("jquery", function(node) {
- oldJQuery.event.remove(node);
+ if (node && node[oldJQuery.expando]) {
+ oldJQuery.event.remove(node);
+ }
});
}
};
16 years, 11 months
JBoss Rich Faces SVN: r5654 - branches/3.1.x/framework/impl/src/main/java/org/ajax4jsf/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-25 19:00:01 -0500 (Fri, 25 Jan 2008)
New Revision: 5654
Modified:
branches/3.1.x/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
Log:
Changes from r5207 reverted
Modified: branches/3.1.x/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- branches/3.1.x/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-01-25 23:36:59 UTC (rev 5653)
+++ branches/3.1.x/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-01-26 00:00:01 UTC (rev 5654)
@@ -23,12 +23,10 @@
import java.io.IOException;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -808,11 +806,7 @@
* Saved values of {@link EditableValueHolder} fields per iterations.
*/
private Map childState;
-
- private List allDataChildren = null;
- private List editableDataChildren = null;
-
/**
* @param faces
* @return Saved values of {@link EditableValueHolder} fields per
@@ -832,30 +826,19 @@
}
/**
- * Save values of {@link EditableValueHolder} fields before change
- * current row.
+ * Save values of {@link EditableValueHolder} fields before change current
+ * row.
*
* @param faces
*/
- protected void saveChildState(FacesContext faces) {
- Map childState = this.getChildState(faces);
- if (null == editableDataChildren) {
- allDataChildren = new ArrayList();
- editableDataChildren = new ArrayList();
- Iterator itr = dataChildren();
- while (itr.hasNext()) {
- this
- .saveChildState(faces, (UIComponent) itr.next(),
- childState);
- }
+ protected void saveChildState(FacesContext faces) {
- } else {
- for (Iterator c = editableDataChildren.iterator(); c.hasNext();) {
- UIComponent child = (UIComponent) c.next();
- populateChildState(faces, child, childState);
- }
+ Iterator itr = dataChildren();
+ while (itr.hasNext()) {
+ Map childState = this.getChildState(faces);
+ this.saveChildState(faces, (UIComponent) itr.next(), childState);
+ }
}
- }
/**
* Recursive method for Iterate on children for save
@@ -867,10 +850,15 @@
*/
private void saveChildState(FacesContext faces, UIComponent c,
Map childState) {
- allDataChildren.add(c);
- if (c instanceof EditableValueHolder ) {
- populateChildState(faces, c, childState);
- editableDataChildren.add(c);
+
+ if (c instanceof EditableValueHolder && !c.isTransient()) {
+ String clientId = c.getClientId(faces);
+ SavedState ss = (SavedState) childState.get(clientId);
+ if (ss == null) {
+ ss = new SavedState();
+ childState.put(clientId, ss);
+ }
+ ss.populate((EditableValueHolder) c);
}
// continue hack
@@ -885,52 +873,19 @@
}
/**
- * @param faces
- * @param c
- * @param childState
- */
- private void populateChildState(FacesContext faces, UIComponent c,
- Map childState) {
- String clientId = c.getClientId(faces);
- SavedState ss = (SavedState) childState.get(clientId);
- if (ss == null) {
- ss = new SavedState();
- childState.put(clientId, ss);
- }
- ss.populate((EditableValueHolder) c);
- }
-
- /**
- * Restore values of {@link EditableValueHolder} fields after change
- * current row.
+ * Restore values of {@link EditableValueHolder} fields after change current
+ * row.
*
* @param faces
*/
- protected void restoreChildState(FacesContext faces) {
- Map childState = this.getChildState(faces);
+ protected void restoreChildState(FacesContext faces) {
- if (null == editableDataChildren) {
- allDataChildren = new ArrayList();
- editableDataChildren = new ArrayList();
- Iterator itr = dataChildren();
- while (itr.hasNext()) {
- this.restoreChildState(faces, (UIComponent) itr.next(),
- childState);
- }
-
- } else {
- for (Iterator c = allDataChildren.iterator(); c.hasNext();) {
- UIComponent child = (UIComponent) c.next();
- // reset id
- String id = child.getId();
- child.setId(id);
- }
- for (Iterator c = editableDataChildren.iterator(); c.hasNext();) {
- UIComponent child = (UIComponent) c.next();
- applyChildState(faces, child, childState);
- }
+ Iterator itr = dataChildren();
+ while (itr.hasNext()) {
+ Map childState = this.getChildState(faces);
+ this.restoreChildState(faces, (UIComponent) itr.next(), childState);
+ }
}
- }
/**
* Recursive part of
@@ -946,11 +901,17 @@
// reset id
String id = c.getId();
c.setId(id);
- allDataChildren.add(c);
+
// hack
if (c instanceof EditableValueHolder) {
- applyChildState(faces, c, childState);
- editableDataChildren.add(c);
+ EditableValueHolder evh = (EditableValueHolder) c;
+ String clientId = c.getClientId(faces);
+ SavedState ss = (SavedState) childState.get(clientId);
+ if (ss != null) {
+ ss.apply(evh);
+ } else {
+ NullState.apply(evh);
+ }
}
// continue hack
@@ -965,23 +926,6 @@
}
/**
- * @param faces
- * @param c
- * @param childState
- */
- private void applyChildState(FacesContext faces, UIComponent c,
- Map childState) {
- EditableValueHolder evh = (EditableValueHolder) c;
- String clientId = c.getClientId(faces);
- SavedState ss = (SavedState) childState.get(clientId);
- if (ss != null) {
- ss.apply(evh);
- } else {
- NullState.apply(evh);
- }
- }
-
- /**
* Check for validation errors on children components. If true, saved values
* must be keep on render phase
*
@@ -1112,8 +1056,6 @@
public void encodeBegin(FacesContext context) throws IOException {
resetDataModel();
- this.editableDataChildren = null;
- this.allDataChildren = null;
if (!keepSaved(context)) {
childState.remove(getBaseClientId(context));
}
16 years, 11 months
JBoss Rich Faces SVN: r5653 - branches/3.1.x/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-25 18:36:59 -0500 (Fri, 25 Jan 2008)
New Revision: 5653
Modified:
branches/3.1.x/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
http://jira.jboss.com/jira/browse/RF-2007
Modified: branches/3.1.x/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
--- branches/3.1.x/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2008-01-25 23:32:21 UTC (rev 5652)
+++ branches/3.1.x/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2008-01-25 23:36:59 UTC (rev 5653)
@@ -260,7 +260,7 @@
},
doHide: function(e){
- this.eventCopy = null;
+ //this.eventCopy = null;
var needToHide = true;
16 years, 11 months
JBoss Rich Faces SVN: r5652 - in branches/3.1.x: framework/impl/src/main/javascript and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-25 18:32:21 -0500 (Fri, 25 Jan 2008)
New Revision: 5652
Added:
branches/3.1.x/framework/impl/src/main/javascript/jquery/patches.js
branches/3.1.x/framework/impl/src/main/javascript/memory.js
Removed:
branches/3.1.x/framework/impl/src/main/javascript/jquery/identity.js
Modified:
branches/3.1.x/framework/impl/generatescript.xml
branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js
branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-1626
Modified: branches/3.1.x/framework/impl/generatescript.xml
===================================================================
--- branches/3.1.x/framework/impl/generatescript.xml 2008-01-25 20:09:30 UTC (rev 5651)
+++ branches/3.1.x/framework/impl/generatescript.xml 2008-01-25 23:32:21 UTC (rev 5652)
@@ -50,7 +50,7 @@
-->
<filelist id="jquery"
dir="${basedir}/src/main/javascript/jquery"
- files="jquery-1.2.1.js,noConflict.js,identity.js">
+ files="jquery-1.2.1.js,noConflict.js,../memory.js,patches.js">
</filelist>
@@ -60,14 +60,14 @@
</filelist>
- <filelist id="prototype"
+ <filelist id="prototype"
dir="${basedir}/src/main/javascript/prototype"
- files="prototype1.6.0.js,patches.js">
+ files="prototype1.6.0.js,../memory.js,patches.js">
</filelist>
<filelist id="prototype.extend"
dir="${basedir}/src/main/javascript/prototype"
- files="dom.js,form.js,event.js,position.js,patches.js">
+ files="dom.js,form.js,event.js,position.js,../memory.js,patches.js">
</filelist>
<filelist id="dnd"
@@ -75,7 +75,7 @@
files="prolog.js,dnd.js,epilog.js">
</filelist>
- <filelist id="ajaxjsf" dir="${basedir}/src/main/javascript/ajaxjsf" files="prolog.js,sarissa.js,JSFAJAX.js,log4ajax.js,epilog.js"></filelist>
+ <filelist id="ajaxjsf" dir="${basedir}/src/main/javascript/ajaxjsf" files="prolog.js,sarissa.js,JSFAJAX.js,log4ajax.js,epilog.js,../memory.js"></filelist>
<!-- =================================
target: assemble
================================= -->
Modified: branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-25 20:09:30 UTC (rev 5651)
+++ branches/3.1.x/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2008-01-25 23:32:21 UTC (rev 5652)
@@ -325,8 +325,8 @@
if ( oldnode ) {
// Remove unload prototype events for a removed elements.
- if ((typeof Event != "undefined") && (typeof Event.unloadElementsCache == "function")) {
- Event.unloadElementsCache(oldnode);
+ if (window.RichFaces && window.RichFaces.Memory) {
+ window.RichFaces.Memory.clean(oldnode);
}
var anchor = oldnode.parentNode;
@@ -917,8 +917,8 @@
}
}
//TODO - unloading cached observers?
- //if (typeof Event != "undefined" && typeof Event.unloadElementsCache == "function") {
- //Event.unloadElementsCache();
+ //if (window.RichFaces && window.RichFaces.Memory) {
+ // window.RichFaces.Memory.clean(oldnode);
//}
} else {
LOG.error("Error parsing response",Sarissa.getParseErrorText(oDomDoc));
Deleted: branches/3.1.x/framework/impl/src/main/javascript/jquery/identity.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/jquery/identity.js 2008-01-25 20:09:30 UTC (rev 5651)
+++ branches/3.1.x/framework/impl/src/main/javascript/jquery/identity.js 2008-01-25 23:32:21 UTC (rev 5652)
@@ -1,10 +0,0 @@
-if (jQuery(jQuery) != jQuery) {
- var oldJQuery = jQuery;
- jQuery = function() {
- if (arguments[0] == arguments.callee) {
- return arguments.callee;
- } else {
- return oldJQuery.apply(this, arguments);
- }
- };
-};
\ No newline at end of file
Added: branches/3.1.x/framework/impl/src/main/javascript/jquery/patches.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/jquery/patches.js (rev 0)
+++ branches/3.1.x/framework/impl/src/main/javascript/jquery/patches.js 2008-01-25 23:32:21 UTC (rev 5652)
@@ -0,0 +1,16 @@
+if (jQuery(jQuery) != jQuery) {
+ var oldJQuery = jQuery;
+ jQuery = function() {
+ if (arguments[0] == arguments.callee) {
+ return arguments.callee;
+ } else {
+ return oldJQuery.apply(this, arguments);
+ }
+ };
+
+ if (window.RichFaces && window.RichFaces.Memory) {
+ window.RichFaces.Memory.addCleaner("jquery", function(node) {
+ oldJQuery.event.remove(node);
+ });
+ }
+};
Added: branches/3.1.x/framework/impl/src/main/javascript/memory.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/memory.js (rev 0)
+++ branches/3.1.x/framework/impl/src/main/javascript/memory.js 2008-01-25 23:32:21 UTC (rev 5652)
@@ -0,0 +1,70 @@
+//memory-leaks sanitizing code
+if (!window.RichFaces) {
+ window.RichFaces = {};
+}
+
+if (!window.RichFaces.Memory) {
+ window.RichFaces.Memory = {
+
+ cleaners: {},
+
+ addCleaner: function (name, cleaner) {
+ this.cleaners[name] = cleaner;
+ },
+
+ applyCleaners: function (node) {
+ for (var name in this.cleaners) {
+ this.cleaners[name](node);
+ }
+ },
+
+ clean: function (oldNode) {
+ if (oldNode) {
+ this.applyCleaners(oldNode);
+
+ //node.all is quicker than recursive traversing
+ //window doesn't have "all" attribute
+ var all = oldNode.all;
+
+ if (all) {
+ var counter = 0;
+ var length = all.length;
+
+ for (var counter = 0; counter < length; counter++ ) {
+ this.applyCleaners(all[counter]);
+ }
+ } else {
+ var node = oldNode.firstChild;
+ while (node) {
+ this.clean(node);
+ node = node.nextSibling;
+ }
+ }
+ }
+ }
+ };
+
+ window.RichFaces.Memory.addCleaner("richfaces", function(node) {
+ var component = node.component;
+ if (component) {
+ var destructorName = component["rich:destructor"];
+ //destructor name is required to be back-compatible
+ if (destructorName) {
+ var destructor = component[destructorName];
+ if (destructor) {
+ destructor.call(component);
+ }
+ }
+ }
+ });
+
+ if (window.attachEvent) {
+ window.attachEvent("onunload", function() {
+ var memory = window.RichFaces.Memory;
+ memory.clean(document);
+ memory.clean(window);
+ });
+ }
+}
+
+//
\ No newline at end of file
Modified: branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js 2008-01-25 20:09:30 UTC (rev 5651)
+++ branches/3.1.x/framework/impl/src/main/javascript/prototype/patches.js 2008-01-25 23:32:21 UTC (rev 5652)
@@ -62,75 +62,30 @@
}
};
-//That's prototype version-dependent
-
-if (window.attachEvent) {
- window.attachEvent("onunload", function() {
- Event.unloadElementsCache(document);
- Event.unloadElementsCache(window);
- });
-}
-
-Event.destroyEventCache = function(node) {
- var eventID = node._eventID;
- if (eventID) {
- var cache = Event.cache[eventID];
-
- for (var eventName in cache) {
- var wrappers = cache[eventName];
- var domEventName = Event.getDOMEventName(eventName);
-
- wrappers.each(function(wrapper) {
- if (node.removeEventListener) {
- node.removeEventListener(domEventName, wrapper, false);
- } else {
- node.detachEvent("on" + domEventName, wrapper);
- }
- });
-
- cache[eventName] = null;
- }
-
- delete Event.cache[eventID];
- }
+if (window.RichFaces && window.RichFaces.Memory) {
+ window.RichFaces.Memory.addCleaner("prototype", function(node) {
+ var eventID = node._eventID;
+ if (eventID) {
+ var cache = Event.cache[eventID];
+
+ for (var eventName in cache) {
+ var wrappers = cache[eventName];
+ var domEventName = Event.getDOMEventName(eventName);
+
+ wrappers.each(function(wrapper) {
+ if (node.removeEventListener) {
+ node.removeEventListener(domEventName, wrapper, false);
+ } else {
+ node.detachEvent("on" + domEventName, wrapper);
+ }
+ });
+
+ cache[eventName] = null;
+ }
- var component = node.component;
- if (component) {
- var destructorName = component["rich:destructor"];
- //destructor name is required to be back-compatible
- if (destructorName) {
- var destructor = component[destructorName];
- if (destructor) {
- destructor.call(component);
- }
+ delete Event.cache[eventID];
}
- }
+ });
}
-Event.unloadElementsCache = function(oldNode) {
- if (oldNode) {
- Event.destroyEventCache(oldNode);
-
- //node.all is quicker than recursive traversing
- //window doesn't have "all" attribute
- var all = oldNode.all;
-
- if (all) {
- var counter = 0;
- var length = all.length;
-
- for (var counter = 0; counter < length; counter++ ) {
- Event.destroyEventCache(all[counter]);
- }
- } else {
- var node = oldNode.firstChild;
- while (node) {
- Event.unloadElementsCache(node);
- node = node.nextSibling;
- }
- }
- }
-
-};
-
//
Modified: branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js
===================================================================
--- branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2008-01-25 20:09:30 UTC (rev 5651)
+++ branches/3.1.x/ui/contextMenu/src/main/resources/org/richfaces/renderkit/html/scripts/context-menu.js 2008-01-25 23:32:21 UTC (rev 5652)
@@ -6,17 +6,27 @@
initialize: function(id, delay, evaluator, options) {
this.options = options || {};
this.id = id;
+ this.element = $(id);
+ this.menuContent = null;
this.evaluator = evaluator;
- $(id).component = this;
+ this.element.component = this;
+ this["rich:destructor"] = "destroy";
+
this.doShow = this.show;
this.doHide = this.hide;
this.delay = delay;
},
+ destroy: function() {
+ this.element.component = null;
+ this.element = null;
+ this.menuContent = null;
+ },
+
attachToParent : function(id, event, context) {
var element = $(id);
if (!element) {
- element = $(this.id);
+ element = this.element;
if (element) {
element = element.parentNode;
}
@@ -47,23 +57,25 @@
construct: function(context) {
if (this.isNewContext(context)) {
- this.destroy();
+ this.destroyMenu();
}
+
var div = document.createElement("div");
div.id = this.id + ":_auto_created";
- $(this.id).appendChild(div);
+ this.element.appendChild(div);
+
var html = this.evaluator.invoke('getContent', context||window).join('');
new Insertion.Top(div, html);
+ this.menuContent = div;
},
- destroy: function() {
- var div = $(this.id + ":_auto_created");
- Richfaces.infernalCachePurge(div);
- if (div) {
- div.parentNode.removeChild(div);
+ destroyMenu: function() {
+ if (this.menuContent) {
+ window.RichFaces.Memory.clean(this.menuContent);
+ this.menuContent.parentNode.removeChild(this.menuContent);
+ this.menuContent = null;
}
-
},
isNewContext: function(context) {
@@ -92,22 +104,8 @@
};
Richfaces.enableDefaultHandler = function(event) {
- if (event.startsWith('on')) {
+ if (event.startsWith('on')) {
event = event.substr(2);
}
Event.stopObserving(document, event, Event.stop);
-};
-
-
-Richfaces.infernalCachePurge = function(root) {
- if (root) {
- if (root._eventID) {
- Event.stopObserving(root);
- }
- var child = root.firstChild;
- while(child) {
- Richfaces.infernalCachePurge(child);
- child = child.nextSibling;
- }
- }
};
\ No newline at end of file
Modified: branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-01-25 20:09:30 UTC (rev 5651)
+++ branches/3.1.x/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-01-25 23:32:21 UTC (rev 5652)
@@ -18,7 +18,7 @@
document.body.appendChild(garbageBin);
}
- Event.unloadElementsCache(element);
+ window.RichFaces.Memory.clean(element);
// move the element to the garbage bin
garbageBin.appendChild(element);
garbageBin.innerHTML = '';
16 years, 11 months
JBoss Rich Faces SVN: r5651 - branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-01-25 15:09:30 -0500 (Fri, 25 Jan 2008)
New Revision: 5651
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
Log:
http://jira.jboss.com/jira/browse/RF-1985?page=all
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-01-25 20:04:48 UTC (rev 5650)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ShuttleUtils.js 2008-01-25 20:09:30 UTC (rev 5651)
@@ -11,9 +11,9 @@
clearInterval(Event._timer);
}
- if (document.removeEventListener) {
+ /*if (document.removeEventListener) {
document.removeEventListener("DOMContentLoaded", domReady, false);
- }
+ }*/
Event.stopObserving(window, 'load', domReady);
}
@@ -29,15 +29,15 @@
this._readyCallbacks = [];
- if (document.addEventListener) {
+ /*if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", domReady, false);
- }
+ }*/
- if (/WebKit/i.test(navigator.userAgent)) {
+ //if (/WebKit/i.test(navigator.userAgent)) {
this._timer = setInterval(function() {
if (/loaded|complete/.test(document.readyState)) domReady();
}, 10);
- }
+ //}
this.observe(window, 'load', domReady);
}
16 years, 11 months
JBoss Rich Faces SVN: r5650 - trunk/ui/orderingList/src/main/config/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-01-25 15:04:48 -0500 (Fri, 25 Jan 2008)
New Revision: 5650
Modified:
branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml
trunk/ui/orderingList/src/main/config/component/orderinglist.xml
Log:
http://jira.jboss.com/jira/browse/RF-2047
Modified: branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml 2008-01-25 19:21:11 UTC (rev 5649)
+++ branches/3.1.x/ui/orderingList/src/main/config/component/orderinglist.xml 2008-01-25 20:04:48 UTC (rev 5650)
@@ -195,7 +195,7 @@
<property hidden="true" el="false">
<name>localValueSet</name>
</property>
- <property hidden="true" el="false">
+ <property hidden="true" el="false" existintag="true">
<name>valid</name>
</property>
Modified: trunk/ui/orderingList/src/main/config/component/orderinglist.xml
===================================================================
--- trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-01-25 19:21:11 UTC (rev 5649)
+++ trunk/ui/orderingList/src/main/config/component/orderinglist.xml 2008-01-25 20:04:48 UTC (rev 5650)
@@ -195,7 +195,7 @@
<property hidden="true" el="false">
<name>localValueSet</name>
</property>
- <property hidden="true" el="false">
+ <property hidden="true" el="false" existintag="true">
<name>valid</name>
</property>
16 years, 11 months
JBoss Rich Faces SVN: r5649 - trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-01-25 14:21:11 -0500 (Fri, 25 Jan 2008)
New Revision: 5649
Modified:
branches/3.1.x/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-2067
Modified: branches/3.1.x/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
--- branches/3.1.x/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2008-01-25 18:46:14 UTC (rev 5648)
+++ branches/3.1.x/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2008-01-25 19:21:11 UTC (rev 5649)
@@ -71,6 +71,10 @@
align = panelMenu.getIconItemPosition();
}
+ if (null == align || "".equals(align)) {
+ align = "left";
+ }
+
if (align.equalsIgnoreCase(from)){
image(context,component, from);
} else {
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2008-01-25 18:46:14 UTC (rev 5648)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2008-01-25 19:21:11 UTC (rev 5649)
@@ -71,6 +71,10 @@
align = panelMenu.getIconItemPosition();
}
+ if (null == align || "".equals(align)) {
+ align = "left";
+ }
+
if (align.equalsIgnoreCase(from)){
image(context,component, from);
} else {
16 years, 11 months
JBoss Rich Faces SVN: r5648 - branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-01-25 13:46:14 -0500 (Fri, 25 Jan 2008)
New Revision: 5648
Modified:
branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx
Log:
RF-2062
Modified: branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx
===================================================================
--- branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx 2008-01-25 18:32:26 UTC (rev 5647)
+++ branches/3.1.x/ui/scrollableDataTable/src/main/templates/org/richfaces/scrollable-data-table.jspx 2008-01-25 18:46:14 UTC (rev 5648)
@@ -66,7 +66,7 @@
</jsp:scriptlet>
- <div id="#{clientId}" style="width: #{component.attributes['width']};height: #{component.attributes['height']};" class="dr-sdt rich-sdt #{component.attributes['styleClass']}" >
+ <div id="#{clientId}" style="#{component.attributes['style']};width: #{component.attributes['width']};height: #{component.attributes['height']};" class="dr-sdt rich-sdt #{component.attributes['styleClass']}" >
<div id="#{clientId}:cs" class="dr-sdt-hsplit" style="display:none;"/>
<div id="#{clientId}_GridHeaderTemplate" class="dr-sdt-inlinebox" style="#{hStyle}; width: #{component.attributes['width']};">
<iframe id="#{clientId}:hs" class="dr-sdt-substrate" src="javascript:\'\'" scrolling="no" frameborder="0" > <br/> </iframe>
16 years, 11 months
JBoss Rich Faces SVN: r5647 - trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-01-25 13:32:26 -0500 (Fri, 25 Jan 2008)
New Revision: 5647
Modified:
trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp
Log:
-//-
Modified: trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-01-25 18:32:21 UTC (rev 5646)
+++ trunk/sandbox/samples/progressBarDemo/src/main/webapp/pages/index.jsp 2008-01-25 18:32:26 UTC (rev 5647)
@@ -33,12 +33,10 @@
interval="700"
reRender="per1"
styleClass="main"
- permanent="#{bean.permanent}"
- determined="#{bean.determined}"
reRenderAfterComplete="per2"
mode="#{bean.modeString}"
progressVar="percent"
- parameters="p1:crack, p2: Process"
+ style="width: 300px; height: 14px"
>
<f:facet name="initial">
<h:outputText value="Process not started"></h:outputText>
@@ -46,7 +44,7 @@
<f:facet name="complete">
<h:outputText value="Process completed"></h:outputText>
</f:facet>
- <h:outputText value="{value}%"></h:outputText>
+ <h:outputText value="{value}%" style="font-size: 10px; color: brown"></h:outputText>
</progressBar:progressBar>
<br clear="all"/>
<table><tr>
@@ -61,16 +59,7 @@
<f:verbatim><br /></f:verbatim>
- Permanent: <h:selectBooleanCheckbox value="#{bean.permanent}" id="flag1">
- <a4j:support event="onclick" reRender="progrs"></a4j:support>
- </h:selectBooleanCheckbox>
- <f:verbatim><br /></f:verbatim>
- Determined: <h:selectBooleanCheckbox value="#{bean.determined}" id="flag2">
- <a4j:support event="onclick" reRender="progrs"></a4j:support>
- </h:selectBooleanCheckbox>
- <f:verbatim><br /></f:verbatim>
-
Ajax mode: <h:selectBooleanCheckbox value="#{bean.ajaxMode}" id="flag3">
<a4j:support event="onclick" reRender="progrs"></a4j:support>
</h:selectBooleanCheckbox>
16 years, 11 months
JBoss Rich Faces SVN: r5646 - trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-01-25 13:32:21 -0500 (Fri, 25 Jan 2008)
New Revision: 5646
Modified:
trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
Log:
-//-
Modified: trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js
===================================================================
--- trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-01-25 18:22:06 UTC (rev 5645)
+++ trunk/sandbox/ui/progressBAR/src/main/resources/org/richfaces/renderkit/html/js/progressBar.js 2008-01-25 18:32:21 UTC (rev 5646)
@@ -97,10 +97,13 @@
},
getContext: function () {
var context = ProgressBar.Pollers[this.id]['context'];
+ if (!context) { context = {}; }
context['minValue'] = ProgressBar.Pollers[this.id]['minValue'];
context['maxValue'] = ProgressBar.Pollers[this.id]['maxValue'];
context['value'] = (this.value ? this.value : this.getValue());
- context[ProgressBar.Pollers[this.id]['progressVar']] = context['value'];
+ if (ProgressBar.Pollers[this.id]['progressVar']) {
+ context[ProgressBar.Pollers[this.id]['progressVar']] = context['value'];
+ }
return context;
},
renderLabel: function () {
16 years, 11 months