diff --git a/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.js b/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.js deleted file mode 100644 index 6253b33dac..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.js +++ /dev/null @@ -1 +0,0 @@ -(function(){var c={lt:"<",gt:">",amp:"&",quot:'"'},f={};for(var b in c){f[c[b]]=b}function g(k){var i=k.indexOf("//");if(i>0){i=k.indexOf("/",i+2);if(i>0){return k.substring(i)}}}function a(o,m){o.push(m);for(var i=m.frames,n=0,k=i.length;n0||k>0?m>k?j:i:o}zUtl={isChar:function(j,i){return(i.digit&&j>="0"&&j<="9")||(i.upper&&j>="A"&&j<="Z")||(i.lower&&j>="a"&&j<="z")||(i.whitespace&&(j==" "||j=="\t"||j=="\n"||j=="\r"))||i[j]},parseMap:function(r,n,j){var k={};if(r){var i=r.split(n||",");if(j){var m=[],u=new RegExp(j,"g"),q="",s,l;while((s=i.shift())!==undefined){if((l=(q+=s).match(u))&&l.length!=1){if(q){m.push(q)}q=""}else{q+=n}}i=m}for(var p=i.length;p--;){var q=i[p].trim(),o=q.indexOf("=");if(o!=-1){k[q.substring(0,o)]=q.substring(o+1,q.length).trim()}}}return k},encodeXML:function(t,i){t=t!=null?String(t):"";var u=t.length,o=i&&i.pre,m=o||(i&&i.multiline),l=i?i.maxlength:0;if(!m&&l&&u>l){var r=l;while(r>0&&t.charAt(r-1)==" "){--r}i.maxlength=0;return zUtl.encodeXML(t.substring(0,r)+"...",i)}var s=[],p=0,q;if(m||o){for(var r=0;r\n");p=r+1}else{if(o&&(n==" "||n=="\t")){s.push(t.substring(p,r)," ");if(n=="\t"){s.push("   ")}p=r+1}}}}}else{for(var r=0;r=0){var r=i.charAt(p+1)=="#"?String.fromCharCode(i.charAt(p+2).toLowerCase()=="x"?parseInt(i.substring(p+3,m),16):parseInt(i.substring(p+2,m),10)):c[i.substring(p+1,m)];if(r){q+=i.substring(o,p)+r;o=(p=m)+1}}}}return !o?i:o',i0:'',now:jq.now,today:function(i){var o=new Date(),m=0,k=0,l=0,n=0;if(typeof i=="string"){var j=i.toLowerCase();if(j.indexOf("h")>=0||j.indexOf("k")>=0){m=o.getHours()}if(i.indexOf("m")>=0){k=o.getMinutes()}if(i.indexOf("s")>=0){l=o.getSeconds()}if(i.indexOf("S")>=0){n=o.getMilliseconds()}}else{if(i){return o}}return new Date(o.getFullYear(),o.getMonth(),o.getDate(),m,k,l,n)},isAncestor:function(i,j){if(!i){return true}for(;j;j=j.getParent?j.getParent():j.parent){if(i==j){return true}}return false},progressbox:function(z,l,D,G,i){if(D&&zk.Page.contained.length){for(var I=zk.Page.contained.length,H=zk.Page.contained[--I];H;H=zk.Page.contained[--I]){if(!H._applyMask){H._applyMask=new zk.eff.Mask({id:H.uuid+"-mask",message:l,anchor:H.$n()})}}return}if(i&&i.busy){zk.busy++;jq.focusOut()}var r=jq.innerX(),q=jq.innerY(),E=' style="left:'+r+"px;top:"+q+'px"',k=z+"-t",F=z+"-m",s='
'+l+"
";if(G){s+='
'}jq(document.body).append(s+"
");var J=jq(z,zk),B=J[0],K=jq(k,zk),t=K[0],C=t.style;if(D){var w=K.css("z-index");if(w=="auto"){w=1}B.z_mask=new zk.eff.FullMask({mask:jq(F,zk)[0],zIndex:w-1})}if(D&&K.length){C.left=jq.px((jq.innerWidth()-t.offsetWidth)/2+r);C.top=jq.px((jq.innerHeight()-t.offsetHeight)/2+q)}else{var o=zk.progPos;if(o){var j,u,A=jq.innerWidth(),v=jq.innerHeight(),L=A-zk(t).offsetWidth(),p=v-zk(t).offsetHeight();if(o.indexOf("mouse")>=0){var m=zk.currentPointer;j=m[0]+10;u=m[1]+10}else{if(o.indexOf("left")>=0){j=r}else{if(o.indexOf("right")>=0){j=r+L-1}else{if(o.indexOf("center")>=0){j=r+L/2}else{j=0}}}if(o.indexOf("top")>=0){u=q}else{if(o.indexOf("bottom")>=0){u=q+p-1}else{if(o.indexOf("center")>=0){u=q+p/2}else{u=0}}}j=j=0?m.substring(0,l):m,k=g(location.href);l=k.indexOf("#");if(l>=0){k=k.substring(0,l)}if(k!=i){return}}location.reload()}}},frames:function(i){var j=[];a(j,i);return j},intsToString:function(m){if(!m){return""}var n=[];for(var l=0,i=m.length;l=0?p.substring(m,l):p.substring(m)).trim();if(n.length==0){if(l<0){break}o.push(i)}else{o.push(zk.parseInt(n))}if(l<0){break}m=l+1}return o},mapToString:function(m,j,l){j=j||"=";l=l||" ";var k=[];for(var i in m){k.push(l,i,j,m[i])}k[0]="";return k.join("")},appendAttr:function(i,k,j){return k||j?" "+i+'="'+k+'"':""},fireSized:function(j,k){if(zUtl.isImageLoading()||zk.clientinfo){var i=arguments.callee;setTimeout(function(){return i(j,k)},20);return}j=h(j);if(!(k<0)){zWatch.fireDown("beforeSize",j,null,k>0)}zWatch.fireDown("onFitSize",j,{reverse:true});zWatch.fireDown("onSize",j)},fireShown:function(i,j){zWatch.fireDown("onShow",i);zUtl.fireSized(i,j)},loadImage:function(i){if(!e[i]){e[i]=true;d(i)}},isImageLoading:function(){for(var url in iMap){var img=iMap[url];if(img.complete){try{delete e[url];}catch(err){}try{delete iMap[url];}catch(err){}}}for(var i in e){return true}return false}};var e={};var iMap={};function d(j){var i=new Image(),k=function(){try{delete e[j];}catch(err){}try{delete iMap[j];}catch(err){}};i.onerror=i.onload=k;i.src=j}})(); \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.src.js b/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.src.js deleted file mode 100644 index 10dc460cf6..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/cwr/js/zk/utl.src.js +++ /dev/null @@ -1,654 +0,0 @@ -/* util.js - - Purpose: - - Description: - - History: - Tue Sep 30 09:02:06 2008, Created by tomyeh - -Copyright (C) 2008 Potix Corporation. All Rights Reserved. - -This program is distributed under LGPL Version 2.1 in the hope that -it will be useful, but WITHOUT ANY WARRANTY. -*/ -(function () { - var _decs = {lt: '<', gt: '>', amp: '&', quot: '"'}, - _encs = {}; - for (var v in _decs) - _encs[_decs[v]] = v; - - function _pathname(url) { - var j = url.indexOf('//'); - if (j > 0) { - j = url.indexOf('/', j + 2); - if (j > 0) return url.substring(j); - } - } - - function _frames(ary, w) { - //Note: the access of frames is allowed for any window (even if it connects other website) - ary.push(w); - for (var fs = w.frames, j = 0, l = fs.length; j < l; ++j) - _frames(ary, fs[j]); - } - /* Returns the onSize target of the given widget. - * The following code is dirty since it checks _hflexsz (which is implementation) - * FUTRE: consider to have zk.Widget.beforeSize to clean up _hflexsz and - * this method considers only if _hflex is min - */ - function _onSizeTarget(wgt) { - var r1 = wgt, p1 = r1, - j1 = -1; - for (; p1 && p1._hflex == 'min'; p1 = p1.parent) { - delete p1._hflexsz; - r1 = p1; - ++j1; - if (p1.ignoreFlexSize_('w')) //p1 will not affect its parent's flex size - break; - } - - var r2 = wgt, p2 = r2, - j2 = -1; - for (; p2 && p2._vflex == 'min'; p2 = p2.parent) { - delete p2._vflexsz; - r2 = p2; - ++j2; - if (p2.ignoreFlexSize_('h')) //p2 will not affect its parent's flex size - break; - } - return j1 > 0 || j2 > 0 ? j1 > j2 ? r1 : r2: wgt; - } - -/** @class zUtl - * @import zk.Widget - * @import zk.xml.Utl - * The basic utilties. - *

For more utilities, refer to {@link Utl}. - */ -zUtl = { //static methods - //Character - /** - * Returns whether the character is according to its opts. - * @param char cc the character - * @param Map opts the options. - - - - - - - - - - - - - - -
Allowed Options -
Name - Allowed Values - Description -
digit - true, false - Specifies the character is digit only. -
upper - true, false - Specifies the character is upper case only. -
lower - true, false - Specifies the character is lower case only. -
whitespace - true, false - Specifies the character is whitespace only. -
opts[cc] - true, false - Specifies the character is allowed only. -
- * @return boolean - */ - isChar: function (cc, opts) { - return (opts.digit && cc >= '0' && cc <= '9') - || (opts.upper && cc >= 'A' && cc <= 'Z') - || (opts.lower && cc >= 'a' && cc <= 'z') - || (opts.whitespace && (cc == ' ' || cc == '\t' || cc == '\n' || cc == '\r')) - || opts[cc]; - }, - - //HTML/XML - /** Parses the specifie text into a map. - * For example - *


-zUtl.parseMap("a=b,c=d");
-zUtl.parseMap("a='b c',c=de", ',', "'\"");
-
- * @param String text the text to parse - * @param String separator the separator. If omitted, ',' - * is assumed - * @param String quote the quote to handle. Ignored if omitted. - * @return Map the map - */ - parseMap: function (text, separator, quote) { - var map = {}; - if (text) { - var ps = text.split(separator || ','); - if (quote) { - var tmp = [], - re = new RegExp(quote, 'g'), - key = '', t, pair; - while((t = ps.shift()) !== undefined) { - if ((pair = (key += t).match(re)) && pair.length != 1) { - if (key) - tmp.push(key); - key = ''; - } else - key += separator; - } - ps = tmp; - } - for (var len = ps.length; len--;) { - var key = ps[len].trim(), - index = key.indexOf('='); - if (index != -1) - map[key.substring(0, index)] = key.substring(index + 1, key.length).trim(); - } - } - return map; - }, - - /** Encodes the string to a valid XML string. - * Refer to {@link Utl} for more XML utilities. - * @param String txt the text to encode - * @param Map opts [optional] the options. Allowd value: - *
    - *
  • pre - whether to replace whitespace with &nbsp;
  • - *
  • multiline - whether to replace linefeed with <br/>
  • - *
  • maxlength - the maximal allowed length of the text
  • - *
- * @return String the encoded text. - */ - encodeXML: function (txt, opts) { - txt = txt != null ? String(txt):''; - var tl = txt.length, - pre = opts && opts.pre, - multiline = pre || (opts && opts.multiline), - maxlength = opts ? opts.maxlength : 0; - - if (!multiline && maxlength && tl > maxlength) { - var j = maxlength; - while (j > 0 && txt.charAt(j - 1) == ' ') - --j; - opts.maxlength = 0; //no limit - return zUtl.encodeXML(txt.substring(0, j) + '...', opts); - } - - var out = [], k = 0, enc; - if (multiline || pre) - for (var j = 0; j < tl; ++j) { - var cc = txt.charAt(j); - if (enc = _encs[cc]) { - out.push(txt.substring(k, j), '&', enc, ';'); - k = j + 1; - } else if (multiline && cc == '\n') { - out.push(txt.substring(k, j), '
\n'); - k = j + 1; - } else if (pre && (cc == ' ' || cc == '\t')) { - out.push(txt.substring(k, j), ' '); - if (cc == '\t') - out.push('   '); - k = j + 1; - } - } - else - for (var j = 0; j < tl; ++j) - if (enc = _encs[txt.charAt(j)]) { - out.push(txt.substring(k, j), '&', enc, ';'); - k = j + 1; - } - - if (!k) return txt; - if (k < tl) - out.push(txt.substring(k)); - return out.join(''); - }, - /** Decodes the XML string into a normal string. - * For example, &lt; is convert to < - * @param String txt the text to decode - * @return String the decoded string - */ - decodeXML: function (txt) { - var out = ''; - if (!txt) return out; - - var k = 0, tl = txt.length; - for (var j = 0; j < tl; ++j) { - var cc = txt.charAt(j); - if (cc == '&') { - var l = txt.indexOf(';', j + 1); - if (l >= 0) { - var dec = txt.charAt(j + 1) == '#' ? - String.fromCharCode(txt.charAt(j + 2).toLowerCase() == 'x' ? - parseInt(txt.substring(j + 3, l), 16): - parseInt(txt.substring(j + 2, l), 10)): - _decs[txt.substring(j + 1, l)]; - if (dec) { - out += txt.substring(k, j) + dec; - k = (j = l) + 1; - } - } - } - } - return !k ? txt: - k < tl ? out + txt.substring(k): out; - }, - - /** A shortcut of ' cellpadding="0" cellspacing="0" border="0"'. - * @type String - */ - cellps0: ' cellpadding="0" cellspacing="0" border="0"', - /** A shortcut of '<img style="height:0;width:0"/>'. - * @type String - */ - img0: '', - /** A shortcut of '<i style="height:0;width:0"/>'. - * @type String - */ - i0: '', - - /** Returns a long value representing the current time (unit: miliseconds). - * @return long - * @deprecated As of release 5.0.6, replaced with jq.now(). - */ - now: jq.now, - /** Returns today. - * @param boolean full if true, returns the full time, - * else only returns year, month, and day. - * If omitted, false is assumed - * @return Date - */ - /** Returns today. - * @param String fmt the time format, such as HH:mm:ss.SSS - * If a time element such as seconds not specified in the format, it will - * be considered as 0. For example, if the format is "HH:mm", then - * the returned object will be today, this hour and this minute, but - * the second and milliseconds will be zero. - * @return Date - * @since 5.0.6 - */ - today: function (fmt) { - var d = new Date(), hr = 0, min = 0, sec = 0, msec = 0; - if (typeof fmt == 'string') { - var fmt0 = fmt.toLowerCase(); - if (fmt0.indexOf('h') >= 0 || fmt0.indexOf('k') >= 0) hr = d.getHours(); - if (fmt.indexOf('m') >= 0) min = d.getMinutes(); - if (fmt.indexOf('s') >= 0) sec = d.getSeconds(); - if (fmt.indexOf('S') >= 0) msec = d.getMilliseconds(); - } else if (fmt) - return d; - return new Date(d.getFullYear(), d.getMonth(), d.getDate(), - hr, min, sec, msec); - }, - - /** Returns if one is ancestor of the other. - * It assumes the object has either a method called getParent - * or a field called parent. - * A typical example is used to test the widgets ({@link Widget}). - * - *

Notice that, if you want to test DOM elements, please use - * {@link jq#isAncestor} instead. - * - * @param Object p the parent. This method return true if p is null - or p is the same as c - * @param Object c the child - * @return boolean - * @see jq#isAncestor - */ - isAncestor: function (p, c) { - if (!p) return true; - for (; c; c = c.getParent ? c.getParent(): c.parent) - if (p == c) - return true; - return false; - }, - - //progress// - /** Creates a message box to indicate something is being processed - * @param String id the ID of the DOM element being created - * @param String msg the message to shown - * @param boolean mask whether to show sem-transparent mask to prevent - * the user from accessing it. - * @param String icon the CSS class used to shown an icon in the box. - * Ignored if not specified. - * @see #destroyProgressbox - */ - progressbox: function (id, msg, mask, icon, _opts) { - if (mask && zk.Page.contained.length) { - for (var c = zk.Page.contained.length, e = zk.Page.contained[--c]; e; e = zk.Page.contained[--c]) { - if (!e._applyMask) - e._applyMask = new zk.eff.Mask({ - id: e.uuid + '-mask', - message: msg, - anchor: e.$n() - }); - } - return; - } - - if (_opts && _opts.busy) { - zk.busy++; - jq.focusOut(); //Bug 2912533 - } - - var x = jq.innerX(), y = jq.innerY(), - style = ' style="left:'+x+'px;top:'+y+'px"', - idtxt = id + '-t', - idmsk = id + '-m', - html = '

' - +msg+'
'; - if (icon) - html += '
'; - jq(document.body).append(html + ''); - - var $n = jq(id, zk), - n = $n[0], - $txt = jq(idtxt, zk), - txt = $txt[0], - st = txt.style; - if (mask) { - // old IE will get the auto value by default. - var zIndex = $txt.css('z-index'); - if (zIndex == 'auto') - zIndex = 1; - n.z_mask = new zk.eff.FullMask({ - mask: jq(idmsk, zk)[0], - zIndex: zIndex - 1 - }); - } - - if (mask && $txt.length) { //center - st.left = jq.px((jq.innerWidth() - txt.offsetWidth) / 2 + x); - st.top = jq.px((jq.innerHeight() - txt.offsetHeight) / 2 + y); - } else { - var pos = zk.progPos; - if (pos) { - var left, - top, - width = jq.innerWidth(), - height = jq.innerHeight(), - wdgap = width - zk(txt).offsetWidth(), - hghgap = height - zk(txt).offsetHeight(); - - if (pos.indexOf('mouse') >= 0) { - var offset = zk.currentPointer; - left = offset[0] + 10; - top = offset[1] + 10; - } else { - if (pos.indexOf('left') >= 0) left = x; - else if (pos.indexOf('right') >= 0) left = x + wdgap -1; - else if (pos.indexOf('center') >= 0) left = x + wdgap / 2; - else left = 0; - - if (pos.indexOf('top') >= 0) top = y; - else if (pos.indexOf('bottom') >= 0) top = y + hghgap - 1; - else if (pos.indexOf('center') >= 0) top = y + hghgap / 2; - else top = 0; - - left = left < x ? x : left; - top = top < y ? y : top; - } - st.left = jq.px(left); - st.top = jq.px(top); - } - } - - $n.zk.cleanVisibility(); - }, - /** Removes the message box created by {@link #progressbox}. - * @param String id the ID of the DOM element of the message box - */ - destroyProgressbox: function (id, _opts) { - if (_opts && _opts.busy && --zk.busy < 0) - zk.busy = 0; - var $n = jq(id, zk), n; - if ($n.length) { - if (n = $n[0].z_mask) n.destroy(); - $n.remove(); - } - - for (var c = zk.Page.contained.length, e = zk.Page.contained[--c]; e; e = zk.Page.contained[--c]) - if (e._applyMask) { - e._applyMask.destroy(); - e._applyMask = null; - } - }, - - //HTTP// - /** Navigates to the specified URL. - * @param String url the URL to go to - * @param Map opts [optional] the options. Allowed values: - *
    - *
  • target - the name of the target browser window. The same browswer - * window is assumed if omitted. You can use any value allowed in - * the target attribute of the HTML FORM tag, such as _self, _blank, - * _parent and _top.
  • - *
  • overwrite - whether load a new page in the current browser window. - * If true, the new page replaces the previous page's position in the history list.
  • - *
- */ - go: function (url, opts) { - opts = opts || {}; - if (opts.target) { - open(url, opts.target); - } else if (opts.overwrite) { - location.replace(url ? url: location.href); - } else { - if (url) { - location.href = url; - - var j = url.indexOf('#'); - //bug 3363687, only if '#" exist, has to reload() - if(j < 0) - return; - - var un = j >= 0 ? url.substring(0, j): url, - pn = _pathname(location.href); - - j = pn.indexOf('#'); - if (j >= 0) pn = pn.substring(0, j); - if (pn != un) - return; - //fall thru (bug 2882149) - } - location.reload(); - } - }, - - /** Returns all descendant frames of the given window. - *

To retrieve all, invoke zUtl.frames(top). - * Notice: w is included in the returned array. - * If you want to exclude it, invoke zUtl.frames(w).$remove(w). - * @param Window w the browser window - * @return Array - * @since 5.0.4 - */ - frames: function (w) { - var ary = []; - _frames(ary, w); - return ary; - }, - - /** Converts an integer array to a string (separated by comma). - * @param int[] ary the integer array to convert. - * If null, an empty string is returned. - * @return String - * @see #stringToInts - */ - intsToString: function (ary) { - if (!ary) return ''; - - var sb = []; - for (var j = 0, k = ary.length; j < k; ++j) - sb.push(ary[j]); - return sb.join(); - }, - /** Converts a string separated by comma to an array of integers. - * @see #intsToString - * @param String text the string to convert. - * If null, null is returned. - * @param int defaultValue the default value used if the value - * is not specified. For example, zUtl.stringToInts("1,,3", 2) returns [1, 2, 3]. - * @return int[] - */ - stringToInts: function (text, defaultValue) { - if (text == null) - return null; - - var list = []; - for (var j = 0;;) { - var k = text.indexOf(',', j), - s = (k >= 0 ? text.substring(j, k): text.substring(j)).trim(); - if (s.length == 0) { - if (k < 0) break; - list.push(defaultValue); - } else - list.push(zk.parseInt(s)); - - if (k < 0) break; - j = k + 1; - } - return list; - }, - /** Converts a map to a string - * @see #intsToString - * @param Map map the map to convert - * @param String assign the symbol for assignment. If omitted, '=' is assumed. - * @param String separator the symbol for separator. If omitted, ',' is assumed. - * @return String - */ - mapToString: function (map, assign, separator) { - assign = assign || '='; - separator = separator || ' '; - var out = []; - for (var v in map) - out.push(separator, v, assign, map[v]); - out[0] = ''; - return out.join(''); - }, - /** Appends an attribute. - * Notice that the attribute won't be appended if val is empty or false. - * In other words, it is equivalent to
- * val ? ' ' + nm + '="' + val + '"': "". - *

If you want to generate the attribute no matter what val is, use - * {@link #appendAttr(String, Object, boolean)}. - * @param String nm the name of the attribute - * @param Object val the value of the attribute - * @since 5.0.3 - */ - /** Appends an attribute. - * Notice that the attribute won't be appended. - * @param String nm the name of the attribute - * @param Object val the value of the attribute - * @param boolean force whether to append attribute no matter what value it is. - * If false (or omitted), it is the same as {@link #appendAttr(String, Object)}. - * @since 5.0.3 - */ - appendAttr: function (nm, val, force) { - return val || force ? ' ' + nm + '="' + val + '"': ''; - }, - /** Fires beforeSize, onFitSize and onSize - * @param Widget wgt the widget which the zWatch event will be fired against. - * @param int bfsz the beforeSize mode: - *

    - *
  • 0 (null/undefined/false): beforeSize sent normally.
  • - *
  • -1: beforeSize won't be sent.
  • - *
  • 1: beforeSize will be sent with an additional cleanup option, - * which will clean up the cached minimal size (if flex=min).
  • - *
- * @since 5.0.8 - */ - fireSized: function (wgt, bfsz) { - if (zUtl.isImageLoading() || zk.clientinfo) { - var f = arguments.callee; - setTimeout(function () { - return f(wgt, bfsz); - }, 20); - return; - } - wgt = _onSizeTarget(wgt); - if (!(bfsz < 0)) //don't use >= (because bfsz might be undefined) - zWatch.fireDown('beforeSize', wgt, null, bfsz > 0); - zWatch.fireDown('onFitSize', wgt, {reverse: true}); - zWatch.fireDown('onSize', wgt); - }, - /** Fires onBeforeSize, onShow, onFitSize, and onSize - * @param Widget wgt the widget which the zWatch event will be fired against. - * @param int bfsz the beforeSize mode: - *
    - *
  • 0 (null/undefined/false): beforeSize sent normally.
  • - *
  • -1: beforeSize won't be sent.
  • - *
  • 1: beforeSize will be sent with an additional cleanup option, - * which will clean up the cached minimal size (if flex=min).
  • - *
- * @since 5.0.8 - */ - fireShown: function (wgt, bfsz) { - zWatch.fireDown('onShow', wgt); - zUtl.fireSized(wgt, bfsz); - }, - /** - * Loads an image before ZK client engine to calculate the widget's layout. - * @param String url the loading image's localation - * @since 6.0.0 - */ - loadImage: function (url) { - if (!_imgMap[url]) { - _imgMap[url] = true; - _loadImage(url); - } - }, - /** - * Checks whether all the loading images are finish. - * @see #loadImage - * @since 6.0.0 - */ - isImageLoading: function () { - for (var url in _imgObjectMap) { - var img = _imgObjectMap[url]; - if (img.complete) { - try { - delete _imgMap[url]; - } catch (err) {} - try { - delete _imgObjectMap[url]; - } catch (err) {} - } - } - for (var n in _imgMap) { - return true; - } - return false; - } -}; - -var _imgMap = {}; -var _imgObjectMap = {}; -function _loadImage(url) { - var img = new Image(), - f = function () { - try { - delete _imgMap[url]; - } catch (err) {} - try { - delete _imgObjectMap[url]; - } catch (err) {} - }; - _imgObjectMap[url]=img; - img.onerror = img.onload = img.onabort = f; - img.src = url; -} -})(); diff --git a/org.adempiere.ui.zk/WEB-INF/tld/web/core.dsp.tld b/org.adempiere.ui.zk/WEB-INF/tld/web/core.dsp.tld deleted file mode 100755 index fb9d2979ae..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/tld/web/core.dsp.tld +++ /dev/null @@ -1,650 +0,0 @@ - - - - - - http://www.zkoss.org/dsp/web/core - - Core methods and tags for zweb in DSP - - - - - - - - Provides the context for mutually exclusive conditional execution. - - choose - org.zkoss.web.servlet.dsp.action.Choose - - - - Iterators thru a collection/array of items. - - forEach - org.zkoss.web.servlet.dsp.action.ForEach - - - - Tests whether an condition is true and render the child only - if the condition is true. - - if - org.zkoss.web.servlet.dsp.action.If - - - - Includes the specified page. - - include - org.zkoss.web.servlet.dsp.action.Include - - - - Represents the last alternative within a choose action. - - otherwise - org.zkoss.web.servlet.dsp.action.Otherwise - - - - Generates the specified value into a string. - - out - org.zkoss.web.servlet.dsp.action.Out - - - - Sets the page info, such as the content type. - - page - org.zkoss.web.servlet.dsp.action.Page - - - - Remove an attribute. - - remove - org.zkoss.web.servlet.dsp.action.Remove - - - - Sets an attribute. - - set - org.zkoss.web.servlet.dsp.action.Set - - - - Represents an alternative within a {@link Choose} action. - - when - org.zkoss.web.servlet.dsp.action.When - - - - - - - ServletFns - org.zkoss.web.fn.ServletFns - - - Labels - org.zkoss.util.resource.Labels - - - - - - - boolean - org.zkoss.xel.fn.CommonFns - boolean toBoolean(java.lang.Object) - - Converts the specified object to a boolean. - - - - number - org.zkoss.xel.fn.CommonFns - java.lang.Number toNumber(java.lang.Object) - - Converts the specified object to a number. - - - - int - org.zkoss.xel.fn.CommonFns - int toInt(java.lang.Object) - - Converts the specified object to an integer. - - - - decimal - org.zkoss.xel.fn.CommonFns - java.math.BigDecimal toDecimal(java.lang.Object) - - Converts the specified object to a (big) decimal. - - - - string - org.zkoss.xel.fn.CommonFns - java.lang.String toString(java.lang.Object) - - Converts the specified object to a string. - - - - char - org.zkoss.xel.fn.CommonFns - char toChar(java.lang.Object) - - Converts the specified object to a character. - - - - class - org.zkoss.lang.Classes - java.lang.Class forNameByThread(java.lang.String) - - Returns the class of the specified class name. - - - - isInstance - org.zkoss.xel.fn.CommonFns - boolean isInstance(java.lang.Object, java.lang.Object) - - Tests whether an object (the second argument) is an instance of a class (the first argument). - You could specify a class or the class name as the first argument. - - - - length - org.zkoss.xel.fn.CommonFns - int length(java.lang.Object) - - Returns the length of a string, array, collection or map. - - - - new - org.zkoss.xel.fn.CommonFns - java.lang.Object new_(java.lang.Object) - - Instantiates the specified class. - The parameter could be either a string (class name) or a Class instance. - - - - new1 - org.zkoss.xel.fn.CommonFns - java.lang.Object new_(java.lang.Object, java.lang.Object) - - Instantiates the specified class and argument. - The first parameter could be either a string (class name) or a Class instance. - The second parameter is the argument passed to the constructor. - - - - new2 - org.zkoss.xel.fn.CommonFns - java.lang.Object new_(java.lang.Object, java.lang.Object, java.lang.Object) - - Instantiates the specified class and two arguments. - The first parameter could be either a string (class name) or a Class instance. - The second parameter is the first argument passed to the constructor. - The third parameter is the second argument passed to the constructor. - - - - new3 - org.zkoss.xel.fn.CommonFns - java.lang.Object new_(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object) - - Instantiates the specified class and three arguments. - The first parameter could be either a string (class name) or a Class instance. - The second parameter is the first argument passed to the constructor. - The third parameter is the second argument passed to the constructor. - The fourth parameter is the third argument passed to the constructor. - - - - - property - org.zkoss.lang.Library - java.lang.String getProperty(java.lang.String) - - Returns the library property. - - - - - - - - eatQuot - org.zkoss.xel.fn.StringFns - - java.lang.String eatQuot(java.lang.String) - - - Eliminates single and double quotations to avoid JavaScript injection. - - - - cat - org.zkoss.xel.fn.StringFns - - java.lang.String cat(java.lang.String, java.lang.String) - - - Catenates two strings. Note: null is considered as empty. - - - - cat3 - org.zkoss.xel.fn.StringFns - - java.lang.String cat3(java.lang.String, java.lang.String, java.lang.String) - - - Catenates three strings. Note: null is considered as empty. - - - - cat4 - org.zkoss.xel.fn.StringFns - - java.lang.String cat4(java.lang.String, java.lang.String, java.lang.String, java.lang.String) - - - Catenates four strings. Note: null is considered as empty. - - - - cat5 - org.zkoss.xel.fn.StringFns - - java.lang.String cat5(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) - - - Catenates five strings. Note: null is considered as empty. - - - - replace - org.zkoss.xel.fn.StringFns - - java.lang.String replace(java.lang.String, java.lang.String, java.lang.String) - - - Replaces all occurenances of the second argument with the third argument. - - - - toLowerCase - org.zkoss.xel.fn.StringFns - - java.lang.String toLowerCase(java.lang.String) - - - Converts to the lower case. - - - - toUpperCase - org.zkoss.xel.fn.StringFns - - java.lang.String toUpperCase(java.lang.String) - - - Converts to the upper case. - - - - trim - org.zkoss.xel.fn.StringFns - - java.lang.String trim(java.lang.String) - - - Trims the whitespaces. - - - - split - org.zkoss.xel.fn.StringFns - - java.lang.String[] split(java.lang.String, java.lang.String) - - - Splits a string into an array of strings based on the given separator. - - - - join - org.zkoss.xel.fn.StringFns - - java.lang.String join(java.lang.Object[], java.lang.String) - - - Joins an array of strings into a single string based on the given separator. - - - - startsWith - org.zkoss.xel.fn.StringFns - - boolean startsWith(java.lang.String, java.lang.String) - - - Returns whether a string starts with another. - - - - endsWith - org.zkoss.xel.fn.StringFns - - boolean endsWith(java.lang.String, java.lang.String) - - - Returns whether a string starts with another. - - - - substring - org.zkoss.xel.fn.StringFns - - java.lang.String substring(java.lang.String, int from, int to) - - - Returns the substring. - - - - - indexOf - org.zkoss.xel.fn.CommonFns - - int indexOf(java.lang.Object, java.lang.Object) - - - Returns the index of the given element. - - - - lastIndexOf - org.zkoss.xel.fn.CommonFns - - int lastIndexOf(java.lang.Object, java.lang.Object) - - - Returns the index of the given element. - - - - - l - org.zkoss.xel.fn.CommonFns - java.lang.String getLabel(java.lang.String) - - Returns the label of the specified key. - - - - l2 - org.zkoss.xel.fn.CommonFns - java.lang.String getLabel(java.lang.String, java.lang.Object[]) - - Returns the label of the specified key, and formats with the specified - argument. - - - - - - - - formatDate - org.zkoss.xel.fn.CommonFns - java.lang.String formatDate(java.util.Date, java.lang.String) - - Returns the formatted time string. - - - - parseDate - org.zkoss.xel.fn.CommonFns - java.util.Date parseDate(java.lang.String, java.lang.String) - - Returns A Date parsed from the string. - - - - - - - - formatNumber - org.zkoss.xel.fn.CommonFns - java.lang.String formatNumber(java.lang.Object, java.lang.String) - - Returns the formatted number string. - - - - parseNumber - org.zkoss.xel.fn.CommonFns - java.lang.Number parseNumber(java.lang.String, java.lang.String) - - Returns A Number parsed from the string. - - - - - - - - attr - org.zkoss.xel.fn.XmlFns - - java.lang.String attr(java.lang.String, java.lang.Object) - - - Generates an attribute for HTML/XML, name="value". - If value is null or empty (if String), "" is generated. - - - - - - - - encodeURL - org.zkoss.web.fn.ServletFns - - java.lang.String encodeURL(java.lang.String) - - - Encoding URL to prefix the context path and to provide session info, - if necessary - If URI contains "*", it is resolved to the current Locale and - the browser code. - - - - encodeURIComponent - org.zkoss.web.servlet.http.Encodes - - java.lang.String encodeURIComponent(java.lang.String) - - - Encoding a string to be used as a query name or value. - - - - encodeThemeURL - org.zkoss.web.fn.ServletFns - - java.lang.String encodeThemeURL(java.lang.String) - - - Encoding URL to theme specific prefix the context path and to provide - session info, if necessary - If URL contains "*", it is resolved to the current Locale and - the browser code. - - - - resolveThemeURL - org.zkoss.web.fn.ServletFns - - java.lang.String resolveThemeURL(java.lang.String) - - - Resolves a URL to point to resource served by the current theme. - - - - - escapeXML - org.zkoss.xml.XMLs - - java.lang.String escapeXML(java.lang.String) - - - Encodes a string that special characters are quoted to be compatible - with HTML/XML. - - - - - browser - org.zkoss.web.fn.ServletFns - - boolean isBrowser(java.lang.String) - - <browser-name>[<version-number>];[-].
- For example, ie9, ios and ie6-. - And, ie9 means Internet Explorer 9 and later, while - ie6- means Internet Explorer 6 (not prior, nor later). - ]]>
-
- - isExplorer - org.zkoss.web.fn.ServletFns - - boolean isExplorer() - - - Whether the current request is coming from Internet Explorer. - - - - isExplorer7 - org.zkoss.web.fn.ServletFns - - boolean isExplorer7() - - - Whether the current request is coming from Internet Explorer 7 or later. - - - - isGecko - org.zkoss.web.fn.ServletFns - - boolean isGecko() - - - Whether the current request is coming from a Gecko-based browser, - such as Mozilla, Firefox and Camino. - - - - isGecko3 - org.zkoss.web.fn.ServletFns - - boolean isGecko3() - - - Whether the current request is coming from a Gecko 3-based browser, - such as Firefox 3. - - - - isSafari - org.zkoss.web.fn.ServletFns - - boolean isSafari() - - - Whether the current request is coming from Safari. - - - - isOpera - org.zkoss.web.fn.ServletFns - - boolean isOpera() - - - Whether the current request is coming from Opera. - - - - - render - org.zkoss.web.fn.ServletFns - - void render(org.zkoss.web.servlet.dsp.action.ActionContext) - - - Renders a DSP fragment. - - - - - getCurrentLocale - org.zkoss.util.Locales - - java.util.Locale getCurrent() - - - Returns the locale for the current request. - - - - testCurrentLocale - org.zkoss.util.Locales - - boolean testCurrent(java.lang.String, java.lang.String) - - - Returns whether the current locale belongs to the specified - language and/or country. - - @param lang the language code, e.g., en and zh. Ignored if null. - @param country the country code, e.g., US. Ignored if null. - If empty, it means no country code at all. - - -
diff --git a/org.adempiere.ui.zk/WEB-INF/tld/web/html.dsp.tld b/org.adempiere.ui.zk/WEB-INF/tld/web/html.dsp.tld deleted file mode 100755 index 2523c44dc6..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/tld/web/html.dsp.tld +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - http://www.zkoss.org/dsp/web/html - - Used to develop ZK components for XUL/HTML. - - - - - - - - Display a box that has a caption and a border enclosing other tags. - - box - org.zkoss.web.servlet.dsp.action.html.Box - - - - Generates the HTML's img tag. - - img - org.zkoss.web.servlet.dsp.action.html.Img - - diff --git a/org.adempiere.ui.zk/WEB-INF/tld/web/theme.dsp.tld b/org.adempiere.ui.zk/WEB-INF/tld/web/theme.dsp.tld deleted file mode 100755 index fb4dd561f5..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/tld/web/theme.dsp.tld +++ /dev/null @@ -1,196 +0,0 @@ - - - - - http://www.zkoss.org/dsp/web/theme - - Theme utility methods - - - - - - - - - - - - ThemeFns - org.zkoss.web.fn.ThemeFns - - - - - - - gradient - org.zkoss.web.fn.ThemeFns - - java.lang.String gradient(java.lang.String, java.lang.String) - - - - - gradValue - org.zkoss.web.fn.ThemeFns - - java.lang.String gradValue(java.lang.String, java.lang.String) - - - - - gradients - org.zkoss.web.fn.ThemeFns - - java.lang.String gradients(java.lang.String, java.lang.String) - - - - - box - org.zkoss.web.fn.ThemeFns - - java.lang.String box(java.lang.String, java.lang.String) - - box-orient, - box-pack - @param styleValue - the value according to the style name, like - horizontal, center - @return a specific browser CSS rule string, like - -moz-box-orient for firefox and - -webkit-box-orient for safari and chrome - ]]> - - - box2 - org.zkoss.web.fn.ThemeFns - - java.lang.String box2(java.lang.String, java.lang.String, java.lang.String, java.lang.String) - - - - - box3 - org.zkoss.web.fn.ThemeFns - - java.lang.String box3(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) - - - - - boxShadow - org.zkoss.web.fn.ThemeFns - - java.lang.String boxShadow(java.lang.String) - - - - - borderRadius - org.zkoss.web.fn.ThemeFns - - java.lang.String borderRadius(java.lang.String) - - - - - applyCSS3 - org.zkoss.web.fn.ThemeFns - - java.lang.String applyCSS3(java.lang.String, java.lang.String) - - - Note: the method is only applied with the browser prefix as the style - name, if the CSS3 style usage rule is different between browsers, please - use another method instead. - - @param styleName - the value of the style name, like box-sizing, - animation - @param styleValue - the value according to the style name, like - border-box, mymove 5s infinite - @return a specific browser CSS rule string, like - -moz-box-sizing for firefox and - -webkit-box-sizing for safari and chrome - ]]> - - - transform - org.zkoss.web.fn.ThemeFns - - java.lang.String transform(java.lang.String) - - - - - loadProperties - org.zkoss.web.fn.ThemeFns - - void loadProperties(java.lang.String path) - - - - - getCurrentTheme - org.zkoss.web.fn.ThemeFns - - java.lang.String getCurrentTheme() - - - - diff --git a/org.adempiere.ui.zk/WEB-INF/tld/zk/core.dsp.tld b/org.adempiere.ui.zk/WEB-INF/tld/zk/core.dsp.tld deleted file mode 100755 index 640ff0c061..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/tld/zk/core.dsp.tld +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - http://www.zkoss.org/dsp/zk/core - - Methods and actions of ZK utilities - - - - - - - - - - - - toAbsoluteURI - org.zkoss.zk.fn.ZkFns - - java.lang.String toAbsoluteURI(java.lang.String, boolean) - - - Converts the specified URI to abolute if necessary. - Note: it doesn't convert if this page is included by another page. - - - - - getBuild - org.zkoss.zk.fn.ZkFns - - java.lang.String getBuild() - - - Returns the build identifier, such as 2007121316. - - - - - getVersion - org.zkoss.zk.fn.ZkFns - - java.lang.String getVersion() - - - Returns the ZK version, such as "1.1.0" and "2.0.0". - - - - - getEdition - org.zkoss.zk.fn.ZkFns - - java.lang.String getEdition() - - - Returns the edition, such as EE, PE and CE. - - - - - - isEditionValid - org.zkoss.zk.fn.ZkFns - - boolean isEditionValid() - - - Returns the edition whether valid or invalid. - - - - - encodeWithZK - org.zkoss.zk.fn.ZkFns - - java.lang.String encodeWithZK(java.lang.String) - - - Returns the string encoded with ZK - - - - - outDeviceStyleSheets - org.zkoss.zk.fn.DspFns - - java.lang.String outDeviceStyleSheets(java.lang.String) - - - Returns HTML tags to include all style sheets used by the specified device. - This method is designed to use with DSP pages. - @param deviceType the device type. If null, ajax is assumed. - - - - outDeviceCSSContent - org.zkoss.zk.fn.DspFns - - java.lang.String outDeviceCSSContent(java.lang.String) - - - Generates and returns the complete CSS content of all components in the - specified device. - This method is designed to use with DSP pages. - @param deviceType the device type. If null, ajax is assumed. - - - - outZkHtmlTags - org.zkoss.zk.fn.DspFns - - java.lang.String outZkHtmlTags(java.lang.String) - - - Generates and returns the ZK specific HTML tags for the HTML output. - If you want to generate HTML HEAD and BODY tags by yourself, you - can invoke this method in the HTML HEAD tag. - This method is designed to use with DSP pages. - @param deviceType the device type. If null, ajax is assumed. - - - - - setCacheControl - org.zkoss.zk.fn.DspFns - - void setCacheControl(java.lang.String, int) - - - Sets the Cache-Control and Expires headers for the current request. - - - - setCSSCacheControl - org.zkoss.zk.fn.DspFns - - void setCSSCacheControl() - - - Sets the Cache-Control and Expires headers for the CSS file - from class Web resource for the current request. - - - - setCWRCacheControl - org.zkoss.zk.fn.DspFns - - void setCWRCacheControl() - - - Sets the Cache-Control and Expires headers for - class Web resource for the current request. - - - diff --git a/org.adempiere.ui.zk/WEB-INF/tld/zk/core.jsp.tld b/org.adempiere.ui.zk/WEB-INF/tld/zk/core.jsp.tld deleted file mode 100755 index d47d0af049..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/tld/zk/core.jsp.tld +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - 1.1 - 2.0 - core.jsp - http://www.zkoss.org/tld/core.jsp - - Methods for JSP pages - - - - outZkHtmlTags - org.zkoss.zk.fn.ZkFns - - java.lang.String outZkHtmlTags(ServletContext, - HttpServletRequest, HttpServletResponse, String) - - - Returns the desktop info to render a desktop. - It is required only if outPageAttrs might not be called - - - - - outDeviceStyleSheets - org.zkoss.zk.fn.JspFns - - java.lang.String outDeviceStyleSheets(ServletContext, - HttpServletRequest, HttpServletResponse, String) - - - Returns HTML tags to include all style sheets used by the specified device. - Note: unlike outLangStyleSheets, it can be called without current execution. - - - - - setCacheControl - org.zkoss.zk.fn.JspFns - - void setCacheControl(HttpServletResponse, java.lang.String, int) - - - Sets the Cache-Control and Expires headers for the current request. - - - - setCSSCacheControl - org.zkoss.zk.fn.JspFns - - void setCSSCacheControl(HttpServletResponse) - - - Sets the Cache-Control and Expires headers for the CSS file - from class Web resource for the current request. - - - - setCWRCacheControl - org.zkoss.zk.fn.JspFns - - void setCWRCacheControl(HttpServletResponse) - - - Sets the Cache-Control and Expires headers for - class Web resource for the current request. - - - diff --git a/org.adempiere.ui.zk/WEB-INF/web-2.5.xml b/org.adempiere.ui.zk/WEB-INF/web-2.5.xml deleted file mode 100644 index ce2e251ba3..0000000000 --- a/org.adempiere.ui.zk/WEB-INF/web-2.5.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - - - ADempiere WebUI - - - - - - - dspLoader - - org.zkoss.web.servlet.dsp.InterpreterServlet - - - - dspLoader - *.dsp - - - - - - - - Used to cleanup when a session is destroyed - - ZK Session Cleaner - - org.zkoss.zk.ui.http.HttpSessionListener - - - - - ZK loader for ZUML pages - zkLoader - - org.adempiere.webui.session.WebUIServlet - - - - update-uri - /zkau - - 1 - - - zkLoader - *.zul - - - zkLoader - *.zhtml - - - The asynchronous update engine for ZK - auEngine - - org.zkoss.zk.au.http.DHtmlUpdateServlet - - - - auEngine - /zkau/* - - - - servlet to provide timeline xml event feed - timelineFeed - - org.adempiere.webui.TimelineEventFeed - - - - timelineFeed - /timeline - - - - - - 120 - - - - - doc - application/vnd.ms-word - - - dsp - text/html - - - gif - image/gif - - - htm - text/html - - - html - text/html - - - jnlp - application/x-java-jnlp-file - - - jpeg - image/jpeg - - - jpg - image/jpeg - - - js - text/javascript - - - pdf - application/pdf - - - png - image/png - - - txt - text/plain - - - xls - application/vnd.ms-excel - - - xml - text/xml - - - xul - application/vnd.mozilla.xul-xml - - - zhtml - text/html - - - zip - application/x-zip - - - zul - text/html - - - index.zul - - - - - adempiere/Status - Session - org.compiere.interfaces.StatusLocal - - - - adempiere/Server - Session - org.compiere.interfaces.ServerLocal - - diff --git a/org.adempiere.ui.zk/WEB-INF/zk.xml b/org.adempiere.ui.zk/WEB-INF/zk.xml index c869186d25..67b65afc6a 100644 --- a/org.adempiere.ui.zk/WEB-INF/zk.xml +++ b/org.adempiere.ui.zk/WEB-INF/zk.xml @@ -24,7 +24,7 @@ - false + true 500 @@ -97,10 +97,6 @@ org.zkoss.zul.borderlayout.animation.disabed true - - org.zkoss.web.util.resource.dir - /WEB-INF/cwr - org.zkoss.zul.grid.DataLoader.class org.zkoss.zul.impl.CustomGridDataLoader