diff --git a/web2d/src/main/javascript/peer/svg/ElementPeer.js b/web2d/src/main/javascript/peer/svg/ElementPeer.js index d16f0323..f44ab392 100644 --- a/web2d/src/main/javascript/peer/svg/ElementPeer.js +++ b/web2d/src/main/javascript/peer/svg/ElementPeer.js @@ -216,7 +216,7 @@ web2d.peer.svg.ElementPeer = new Class({ positionRelativeTo:function (elem, options) { options = !$defined(options) ? {} : options; - options['relativeTo'] = $(this._native); + options['relativeTo'] = document.id(this._native); elem.position(options); }, diff --git a/web2d/src/test/javascript/jsUnit/ElementsTestSuite.html b/web2d/src/test/javascript/jsUnit/ElementsTestSuite.html index 08289341..a4d4b339 100755 --- a/web2d/src/test/javascript/jsUnit/ElementsTestSuite.html +++ b/web2d/src/test/javascript/jsUnit/ElementsTestSuite.html @@ -31,7 +31,7 @@ function setUp() { debug("Setting up workspace"); workspace = new web2d.Workspace(); - workspace.addItAsChildTo($("divWorkspace")); + workspace.addItAsChildTo(document.id("divWorkspace")); group = new web2d.Group(); line = new web2d.Line(); diff --git a/web2d/src/test/javascript/jsUnit/WorkspaceTestSuite.html b/web2d/src/test/javascript/jsUnit/WorkspaceTestSuite.html index 120f996a..301d9542 100755 --- a/web2d/src/test/javascript/jsUnit/WorkspaceTestSuite.html +++ b/web2d/src/test/javascript/jsUnit/WorkspaceTestSuite.html @@ -32,7 +32,7 @@ function setUp() { debug("Setting up workspace"); workspace = new web2d.Workspace(); - workspace.addItAsChildTo($("divWorkspace")); + workspace.addItAsChildTo(document.id("divWorkspace")); } function testGettersTest() diff --git a/web2d/src/test/javascript/mootools-core-1.4.5.js b/web2d/src/test/javascript/mootools-core-1.4.5.js new file mode 100644 index 00000000..28e0da68 --- /dev/null +++ b/web2d/src/test/javascript/mootools-core-1.4.5.js @@ -0,0 +1,327 @@ +/* +--- +MooTools: the javascript framework + +web build: + - http://mootools.net/core/983efe70cd1e407f895b3d5278774602 + +packager build: + - packager build Core/Core Core/Class Core/Class.Extras Core/Element Core/Element.Event + +copyrights: + - [MooTools](http://mootools.net) + +licenses: + - [MIT License](http://mootools.net/license.txt) +... +*/ + +(function(){this.MooTools={version:"1.4.5",build:"ab8ea8824dc3b24b6666867a2c4ed58ebb762cf0"};var o=this.typeOf=function(i){if(i==null){return"null";}if(i.$family!=null){return i.$family(); +}if(i.nodeName){if(i.nodeType==1){return"element";}if(i.nodeType==3){return(/\S/).test(i.nodeValue)?"textnode":"whitespace";}}else{if(typeof i.length=="number"){if(i.callee){return"arguments"; +}if("item" in i){return"collection";}}}return typeof i;};var j=this.instanceOf=function(t,i){if(t==null){return false;}var s=t.$constructor||t.constructor; +while(s){if(s===i){return true;}s=s.parent;}if(!t.hasOwnProperty){return false;}return t instanceof i;};var f=this.Function;var p=true;for(var k in {toString:1}){p=null; +}if(p){p=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];}f.prototype.overloadSetter=function(s){var i=this; +return function(u,t){if(u==null){return this;}if(s||typeof u!="string"){for(var v in u){i.call(this,v,u[v]);}if(p){for(var w=p.length;w--;){v=p[w];if(u.hasOwnProperty(v)){i.call(this,v,u[v]); +}}}}else{i.call(this,u,t);}return this;};};f.prototype.overloadGetter=function(s){var i=this;return function(u){var v,t;if(typeof u!="string"){v=u;}else{if(arguments.length>1){v=arguments; +}else{if(s){v=[u];}}}if(v){t={};for(var w=0;w>>0; +b>>0;b>>0;for(var a=(d<0)?Math.max(0,b+d):d||0;a>>0,b=Array(d);for(var a=0;a>>0; +b-1:String(this).indexOf(a)>-1;},trim:function(){return String(this).replace(/^\s+|\s+$/g,""); +},clean:function(){return String(this).replace(/\s+/g," ").trim();},camelCase:function(){return String(this).replace(/-\D/g,function(a){return a.charAt(1).toUpperCase(); +});},hyphenate:function(){return String(this).replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());});},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(a){return a.toUpperCase(); +});},escapeRegExp:function(){return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this); +},hexToRgb:function(b){var a=String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=String(this).match(/\d{1,3}/g); +return(a)?a.rgbToHex(b):null;},substitute:function(a,b){return String(this).replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1); +}return(a[c]!=null)?a[c]:"";});}});Function.extend({attempt:function(){for(var b=0,a=arguments.length;b1?Array.slice(arguments,1):null,d=function(){}; +var c=function(){var g=e,h=arguments.length;if(this instanceof c){d.prototype=a.prototype;g=new d;}var f=(!b&&!h)?a.call(g):a.apply(g,b&&h?b.concat(Array.slice(arguments)):b||arguments); +return g==e?f:g;};return c;},pass:function(b,c){var a=this;if(b!=null){b=Array.from(b);}return function(){return a.apply(c,b||arguments);};},delay:function(b,c,a){return setTimeout(this.pass((a==null?[]:a),c),b); +},periodical:function(c,b,a){return setInterval(this.pass((a==null?[]:a),b),c);}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this)); +},round:function(a){a=Math.pow(10,a||0).toFixed(a<0?-a:0);return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a]*>([\s\S]*?)<\/script>/gi,function(q,r){e+=r+"\n"; +return"";});if(o===true){n.exec(e);}else{if(typeOf(o)=="function"){o(e,p);}}return p;});n.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}); +this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(e,o){g[e]=o;});this.Document=j.$constructor=new Type("Document",function(){}); +j.$family=Function.from("document").hide();Document.mirror(function(e,o){j[e]=o;});j.html=j.documentElement;if(!j.head){j.head=j.getElementsByTagName("head")[0]; +}if(j.execCommand){try{j.execCommand("BackgroundImageCache",false,true);}catch(f){}}if(this.attachEvent&&!this.addEventListener){var c=function(){this.detachEvent("onunload",c); +j.head=j.html=j.window=null;};this.attachEvent("onunload",c);}var l=Array.from;try{l(j.html.childNodes);}catch(f){Array.from=function(o){if(typeof o!="string"&&Type.isEnumerable(o)&&typeOf(o)!="array"){var e=o.length,p=new Array(e); +while(e--){p[e]=o[e];}return p;}return l(o);};var k=Array.prototype,m=k.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var o=k[e]; +Array[e]=function(p){return o.apply(Array.from(p),m.call(arguments,1));};});}})();(function(){var a=Object.prototype.hasOwnProperty;Object.extend({subset:function(d,g){var f={}; +for(var e=0,b=g.length;e+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//,"["+f(">+~`!@$%^&={}\\;/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); +function b(x,s,D,z,r,C,q,B,A,y,u,F,G,v,p,w){if(s||n===-1){k.expressions[++n]=[];l=-1;if(s){return"";}}if(D||z||l===-1){D=D||" ";var t=k.expressions[n]; +if(g&&t[l]){t[l].reverseCombinator=i(D);}t[++l]={combinator:D,tag:"*"};}var o=k.expressions[n][l];if(r){o.tag=r.replace(m,"");}else{if(C){o.id=C.replace(m,""); +}else{if(q){q=q.replace(m,"");if(!o.classList){o.classList=[];}if(!o.classes){o.classes=[];}o.classList.push(q);o.classes.push({value:q,regexp:new RegExp("(^|\\s)"+f(q)+"(\\s|$)")}); +}else{if(G){w=w||p;w=w?w.replace(m,""):null;if(!o.pseudos){o.pseudos=[];}o.pseudos.push({key:G.replace(m,""),value:w,type:F.length==1?"class":"element"}); +}else{if(B){B=B.replace(m,"");u=(u||"").replace(m,"");var E,H;switch(A){case"^=":H=new RegExp("^"+f(u));break;case"$=":H=new RegExp(f(u)+"$");break;case"~=":H=new RegExp("(^|\\s)"+f(u)+"(\\s|$)"); +break;case"|=":H=new RegExp("^"+f(u)+"(-|$)");break;case"=":E=function(I){return u==I;};break;case"*=":E=function(I){return I&&I.indexOf(u)>-1;};break; +case"!=":E=function(I){return u!=I;};break;default:E=function(I){return !!I;};}if(u==""&&(/^[*$^]=$/).test(A)){E=function(){return false;};}if(!E){E=function(I){return I&&H.test(I); +};}if(!o.attributes){o.attributes=[];}o.attributes.push({key:B,operator:A,value:u,test:E});}}}}}return"";}var d=(this.Slick||{});d.parse=function(o){return e(o); +};d.escapeRegExp=f;if(!this.Slick){this.Slick=d;}}).apply((typeof exports!="undefined")?exports:this);(function(){var k={},m={},d=Object.prototype.toString; +k.isNativeCode=function(c){return(/\{\s*\[native code\]\s*\}/).test(""+c);};k.isXML=function(c){return(!!c.xmlVersion)||(!!c.xml)||(d.call(c)=="[object XMLDocument]")||(c.nodeType==9&&c.documentElement.nodeName!="HTML"); +};k.setDocument=function(w){var p=w.nodeType;if(p==9){}else{if(p){w=w.ownerDocument;}else{if(w.navigator){w=w.document;}else{return;}}}if(this.document===w){return; +}this.document=w;var A=w.documentElement,o=this.getUIDXML(A),s=m[o],r;if(s){for(r in s){this[r]=s[r];}return;}s=m[o]={};s.root=A;s.isXMLDocument=this.isXML(w); +s.brokenStarGEBTN=s.starSelectsClosedQSA=s.idGetsName=s.brokenMixedCaseQSA=s.brokenGEBCN=s.brokenCheckedQSA=s.brokenEmptyAttributeQSA=s.isHTMLDocument=s.nativeMatchesSelector=false; +var q,u,y,z,t;var x,v="slick_uniqueid";var c=w.createElement("div");var n=w.body||w.getElementsByTagName("body")[0]||A;n.appendChild(c);try{c.innerHTML=''; +s.isHTMLDocument=!!w.getElementById(v);}catch(C){}if(s.isHTMLDocument){c.style.display="none";c.appendChild(w.createComment(""));u=(c.getElementsByTagName("*").length>1); +try{c.innerHTML="foo";x=c.getElementsByTagName("*");q=(x&&!!x.length&&x[0].nodeName.charAt(0)=="/");}catch(C){}s.brokenStarGEBTN=u||q;try{c.innerHTML=''; +s.idGetsName=w.getElementById(v)===c.firstChild;}catch(C){}if(c.getElementsByClassName){try{c.innerHTML='';c.getElementsByClassName("b").length; +c.firstChild.className="b";z=(c.getElementsByClassName("b").length!=2);}catch(C){}try{c.innerHTML='';y=(c.getElementsByClassName("a").length!=2); +}catch(C){}s.brokenGEBCN=z||y;}if(c.querySelectorAll){try{c.innerHTML="foo";x=c.querySelectorAll("*");s.starSelectsClosedQSA=(x&&!!x.length&&x[0].nodeName.charAt(0)=="/"); +}catch(C){}try{c.innerHTML='';s.brokenMixedCaseQSA=!c.querySelectorAll(".MiX").length;}catch(C){}try{c.innerHTML=''; +s.brokenCheckedQSA=(c.querySelectorAll(":checked").length==0);}catch(C){}try{c.innerHTML='';s.brokenEmptyAttributeQSA=(c.querySelectorAll('[class*=""]').length!=0); +}catch(C){}}try{c.innerHTML='
';t=(c.firstChild.getAttribute("action")!="s");}catch(C){}s.nativeMatchesSelector=A.matchesSelector||A.mozMatchesSelector||A.webkitMatchesSelector; +if(s.nativeMatchesSelector){try{s.nativeMatchesSelector.call(A,":slick");s.nativeMatchesSelector=null;}catch(C){}}}try{A.slick_expando=1;delete A.slick_expando; +s.getUID=this.getUIDHTML;}catch(C){s.getUID=this.getUIDXML;}n.removeChild(c);c=x=n=null;s.getAttribute=(s.isHTMLDocument&&t)?function(G,E){var H=this.attributeGetters[E]; +if(H){return H.call(G);}var F=G.getAttributeNode(E);return(F)?F.nodeValue:null;}:function(F,E){var G=this.attributeGetters[E];return(G)?G.call(F):F.getAttribute(E); +};s.hasAttribute=(A&&this.isNativeCode(A.hasAttribute))?function(F,E){return F.hasAttribute(E);}:function(F,E){F=F.getAttributeNode(E);return !!(F&&(F.specified||F.nodeValue)); +};var D=A&&this.isNativeCode(A.contains),B=w&&this.isNativeCode(w.contains);s.contains=(D&&B)?function(E,F){return E.contains(F);}:(D&&!B)?function(E,F){return E===F||((E===w)?w.documentElement:E).contains(F); +}:(A&&A.compareDocumentPosition)?function(E,F){return E===F||!!(E.compareDocumentPosition(F)&16);}:function(E,F){if(F){do{if(F===E){return true;}}while((F=F.parentNode)); +}return false;};s.documentSorter=(A.compareDocumentPosition)?function(F,E){if(!F.compareDocumentPosition||!E.compareDocumentPosition){return 0;}return F.compareDocumentPosition(E)&4?-1:F===E?0:1; +}:("sourceIndex" in A)?function(F,E){if(!F.sourceIndex||!E.sourceIndex){return 0;}return F.sourceIndex-E.sourceIndex;}:(w.createRange)?function(H,F){if(!H.ownerDocument||!F.ownerDocument){return 0; +}var G=H.ownerDocument.createRange(),E=F.ownerDocument.createRange();G.setStart(H,0);G.setEnd(H,0);E.setStart(F,0);E.setEnd(F,0);return G.compareBoundaryPoints(Range.START_TO_END,E); +}:null;A=null;for(r in s){this[r]=s[r];}};var f=/^([#.]?)((?:[\w-]+|\*))$/,h=/\[.+[*$^]=(?:""|'')?\]/,g={};k.search=function(U,z,H,s){var p=this.found=(s)?null:(H||[]); +if(!U){return p;}else{if(U.navigator){U=U.document;}else{if(!U.nodeType){return p;}}}var F,O,V=this.uniques={},I=!!(H&&H.length),y=(U.nodeType==9);if(this.document!==(y?U:U.ownerDocument)){this.setDocument(U); +}if(I){for(O=p.length;O--;){V[this.getUID(p[O])]=true;}}if(typeof z=="string"){var r=z.match(f);simpleSelectors:if(r){var u=r[1],v=r[2],A,E;if(!u){if(v=="*"&&this.brokenStarGEBTN){break simpleSelectors; +}E=U.getElementsByTagName(v);if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{if(u=="#"){if(!this.isHTMLDocument||!y){break simpleSelectors; +}A=U.getElementById(v);if(!A){return p;}if(this.idGetsName&&A.getAttributeNode("id").nodeValue!=v){break simpleSelectors;}if(s){return A||null;}if(!(I&&V[this.getUID(A)])){p.push(A); +}}else{if(u=="."){if(!this.isHTMLDocument||((!U.getElementsByClassName||this.brokenGEBCN)&&U.querySelectorAll)){break simpleSelectors;}if(U.getElementsByClassName&&!this.brokenGEBCN){E=U.getElementsByClassName(v); +if(s){return E[0]||null;}for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}else{var T=new RegExp("(^|\\s)"+e.escapeRegExp(v)+"(\\s|$)");E=U.getElementsByTagName("*"); +for(O=0;A=E[O++];){className=A.className;if(!(className&&T.test(className))){continue;}if(s){return A;}if(!(I&&V[this.getUID(A)])){p.push(A);}}}}}}if(I){this.sort(p); +}return(s)?null:p;}querySelector:if(U.querySelectorAll){if(!this.isHTMLDocument||g[z]||this.brokenMixedCaseQSA||(this.brokenCheckedQSA&&z.indexOf(":checked")>-1)||(this.brokenEmptyAttributeQSA&&h.test(z))||(!y&&z.indexOf(",")>-1)||e.disableQSA){break querySelector; +}var S=z,x=U;if(!y){var C=x.getAttribute("id"),t="slickid__";x.setAttribute("id",t);S="#"+t+" "+S;U=x.parentNode;}try{if(s){return U.querySelector(S)||null; +}else{E=U.querySelectorAll(S);}}catch(Q){g[z]=1;break querySelector;}finally{if(!y){if(C){x.setAttribute("id",C);}else{x.removeAttribute("id");}U=x;}}if(this.starSelectsClosedQSA){for(O=0; +A=E[O++];){if(A.nodeName>"@"&&!(I&&V[this.getUID(A)])){p.push(A);}}}else{for(O=0;A=E[O++];){if(!(I&&V[this.getUID(A)])){p.push(A);}}}if(I){this.sort(p); +}return p;}F=this.Slick.parse(z);if(!F.length){return p;}}else{if(z==null){return p;}else{if(z.Slick){F=z;}else{if(this.contains(U.documentElement||U,z)){(p)?p.push(z):p=z; +return p;}else{return p;}}}}this.posNTH={};this.posNTHLast={};this.posNTHType={};this.posNTHTypeLast={};this.push=(!I&&(s||(F.length==1&&F.expressions[0].length==1)))?this.pushArray:this.pushUID; +if(p==null){p=[];}var M,L,K;var B,J,D,c,q,G,W;var N,P,o,w,R=F.expressions;search:for(O=0;(P=R[O]);O++){for(M=0;(o=P[M]);M++){B="combinator:"+o.combinator; +if(!this[B]){continue search;}J=(this.isXMLDocument)?o.tag:o.tag.toUpperCase();D=o.id;c=o.classList;q=o.classes;G=o.attributes;W=o.pseudos;w=(M===(P.length-1)); +this.bitUniques={};if(w){this.uniques=V;this.found=p;}else{this.uniques={};this.found=[];}if(M===0){this[B](U,J,D,q,G,W,c);if(s&&w&&p.length){break search; +}}else{if(s&&w){for(L=0,K=N.length;L1)){this.sort(p);}return(s)?(p[0]||null):p;};k.uidx=1;k.uidk="slick-uniqueid";k.getUIDXML=function(n){var c=n.getAttribute(this.uidk); +if(!c){c=this.uidx++;n.setAttribute(this.uidk,c);}return c;};k.getUIDHTML=function(c){return c.uniqueNumber||(c.uniqueNumber=this.uidx++);};k.sort=function(c){if(!this.documentSorter){return c; +}c.sort(this.documentSorter);return c;};k.cacheNTH={};k.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/;k.parseNTHArgument=function(q){var o=q.match(this.matchNTH); +if(!o){return false;}var p=o[2]||false;var n=o[1]||1;if(n=="-"){n=-1;}var c=+o[3]||0;o=(p=="n")?{a:n,b:c}:(p=="odd")?{a:2,b:1}:(p=="even")?{a:2,b:0}:{a:0,b:n}; +return(this.cacheNTH[q]=o);};k.createNTHPseudo=function(p,n,c,o){return function(s,q){var u=this.getUID(s);if(!this[c][u]){var A=s.parentNode;if(!A){return false; +}var r=A[p],t=1;if(o){var z=s.nodeName;do{if(r.nodeName!=z){continue;}this[c][this.getUID(r)]=t++;}while((r=r[n]));}else{do{if(r.nodeType!=1){continue; +}this[c][this.getUID(r)]=t++;}while((r=r[n]));}}q=q||"n";var v=this.cacheNTH[q]||this.parseNTHArgument(q);if(!v){return false;}var y=v.a,x=v.b,w=this[c][u]; +if(y==0){return x==w;}if(y>0){if(w":function(p,c,r,o,n,q){if((p=p.firstChild)){do{if(p.nodeType==1){this.push(p,c,r,o,n,q); +}}while((p=p.nextSibling));}},"+":function(p,c,r,o,n,q){while((p=p.nextSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q);break;}}},"^":function(p,c,r,o,n,q){p=p.firstChild; +if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:+"](p,c,r,o,n,q);}}},"~":function(q,c,s,p,n,r){while((q=q.nextSibling)){if(q.nodeType!=1){continue; +}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}},"++":function(p,c,r,o,n,q){this["combinator:+"](p,c,r,o,n,q); +this["combinator:!+"](p,c,r,o,n,q);},"~~":function(p,c,r,o,n,q){this["combinator:~"](p,c,r,o,n,q);this["combinator:!~"](p,c,r,o,n,q);},"!":function(p,c,r,o,n,q){while((p=p.parentNode)){if(p!==this.document){this.push(p,c,r,o,n,q); +}}},"!>":function(p,c,r,o,n,q){p=p.parentNode;if(p!==this.document){this.push(p,c,r,o,n,q);}},"!+":function(p,c,r,o,n,q){while((p=p.previousSibling)){if(p.nodeType==1){this.push(p,c,r,o,n,q); +break;}}},"!^":function(p,c,r,o,n,q){p=p.lastChild;if(p){if(p.nodeType==1){this.push(p,c,r,o,n,q);}else{this["combinator:!+"](p,c,r,o,n,q);}}},"!~":function(q,c,s,p,n,r){while((q=q.previousSibling)){if(q.nodeType!=1){continue; +}var o=this.getUID(q);if(this.bitUniques[o]){break;}this.bitUniques[o]=true;this.push(q,c,s,p,n,r);}}};for(var i in j){k["combinator:"+i]=j[i];}var l={empty:function(c){var n=c.firstChild; +return !(n&&n.nodeType==1)&&!(c.innerText||c.textContent||"").length;},not:function(c,n){return !this.matchNode(c,n);},contains:function(c,n){return(c.innerText||c.textContent||"").indexOf(n)>-1; +},"first-child":function(c){while((c=c.previousSibling)){if(c.nodeType==1){return false;}}return true;},"last-child":function(c){while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"only-child":function(o){var n=o;while((n=n.previousSibling)){if(n.nodeType==1){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeType==1){return false; +}}return true;},"nth-child":k.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":k.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":k.createNTHPseudo("firstChild","nextSibling","posNTHType",true),"nth-last-of-type":k.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",true),index:function(n,c){return this["pseudo:nth-child"](n,""+(c+1)); +},even:function(c){return this["pseudo:nth-child"](c,"2n");},odd:function(c){return this["pseudo:nth-child"](c,"2n+1");},"first-of-type":function(c){var n=c.nodeName; +while((c=c.previousSibling)){if(c.nodeName==n){return false;}}return true;},"last-of-type":function(c){var n=c.nodeName;while((c=c.nextSibling)){if(c.nodeName==n){return false; +}}return true;},"only-of-type":function(o){var n=o,p=o.nodeName;while((n=n.previousSibling)){if(n.nodeName==p){return false;}}var c=o;while((c=c.nextSibling)){if(c.nodeName==p){return false; +}}return true;},enabled:function(c){return !c.disabled;},disabled:function(c){return c.disabled;},checked:function(c){return c.checked||c.selected;},focus:function(c){return this.isHTMLDocument&&this.document.activeElement===c&&(c.href||c.type||this.hasAttribute(c,"tabindex")); +},root:function(c){return(c===this.root);},selected:function(c){return c.selected;}};for(var b in l){k["pseudo:"+b]=l[b];}var a=k.attributeGetters={"for":function(){return("htmlFor" in this)?this.htmlFor:this.getAttribute("for"); +},href:function(){return("href" in this)?this.getAttribute("href",2):this.getAttribute("href");},style:function(){return(this.style)?this.style.cssText:this.getAttribute("style"); +},tabindex:function(){var c=this.getAttributeNode("tabindex");return(c&&c.specified)?c.nodeValue:null;},type:function(){return this.getAttribute("type"); +},maxlength:function(){var c=this.getAttributeNode("maxLength");return(c&&c.specified)?c.nodeValue:null;}};a.MAXLENGTH=a.maxLength=a.maxlength;var e=k.Slick=(this.Slick||{}); +e.version="1.1.7";e.search=function(n,o,c){return k.search(n,o,c);};e.find=function(c,n){return k.search(c,n,null,true);};e.contains=function(c,n){k.setDocument(c); +return k.contains(c,n);};e.getAttribute=function(n,c){k.setDocument(n);return k.getAttribute(n,c);};e.hasAttribute=function(n,c){k.setDocument(n);return k.hasAttribute(n,c); +};e.match=function(n,c){if(!(n&&c)){return false;}if(!c||c===n){return true;}k.setDocument(n);return k.matchNode(n,c);};e.defineAttributeGetter=function(c,n){k.attributeGetters[c]=n; +return this;};e.lookupAttributeGetter=function(c){return k.attributeGetters[c];};e.definePseudo=function(c,n){k["pseudo:"+c]=function(p,o){return n.call(p,o); +};return this;};e.lookupPseudo=function(c){var n=k["pseudo:"+c];if(n){return function(o){return n.call(this,o);};}return null;};e.override=function(n,c){k.override(n,c); +return this;};e.isXML=k.isXML;e.uidOf=function(c){return k.getUIDHTML(c);};if(!this.Slick){this.Slick=e;}}).apply((typeof exports!="undefined")?exports:this); +var Element=function(b,g){var h=Element.Constructors[b];if(h){return h(g);}if(typeof b!="string"){return document.id(b).set(g);}if(!g){g={};}if(!(/^[\w-]+$/).test(b)){var e=Slick.parse(b).expressions[0][0]; +b=(e.tag=="*")?"div":e.tag;if(e.id&&g.id==null){g.id=e.id;}var d=e.attributes;if(d){for(var a,f=0,c=d.length;f=this.length){delete this[g--]; +}return e;}.protect());}Array.forEachMethod(function(g,e){Elements.implement(e,g);});Array.mirror(Elements);var d;try{d=(document.createElement("").name=="x"); +}catch(b){}var c=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""");};Document.implement({newElement:function(e,g){if(g&&g.checked!=null){g.defaultChecked=g.checked; +}if(d&&g){e="<"+e;if(g.name){e+=' name="'+c(g.name)+'"';}if(g.type){e+=' type="'+c(g.type)+'"';}e+=">";delete g.name;delete g.type;}return this.id(this.createElement(e)).set(g); +}});})();(function(){Slick.uidOf(window);Slick.uidOf(document);Document.implement({newTextNode:function(e){return this.createTextNode(e);},getDocument:function(){return this; +},getWindow:function(){return this.window;},id:(function(){var e={string:function(E,D,l){E=Slick.find(l,"#"+E.replace(/(\W)/g,"\\$1"));return(E)?e.element(E,D):null; +},element:function(D,E){Slick.uidOf(D);if(!E&&!D.$family&&!(/^(?:object|embed)$/i).test(D.tagName)){var l=D.fireEvent;D._fireEvent=function(F,G){return l(F,G); +};Object.append(D,Element.Prototype);}return D;},object:function(D,E,l){if(D.toElement){return e.element(D.toElement(l),E);}return null;}};e.textnode=e.whitespace=e.window=e.document=function(l){return l; +};return function(D,F,E){if(D&&D.$family&&D.uniqueNumber){return D;}var l=typeOf(D);return(e[l])?e[l](D,F,E||document):null;};})()});if(window.$==null){Window.implement("$",function(e,l){return document.id(e,l,this.document); +});}Window.implement({getDocument:function(){return this.document;},getWindow:function(){return this;}});[Document,Element].invoke("implement",{getElements:function(e){return Slick.search(this,e,new Elements); +},getElement:function(e){return document.id(Slick.find(this,e));}});var m={contains:function(e){return Slick.contains(this,e);}};if(!document.contains){Document.implement(m); +}if(!document.createElement("div").contains){Element.implement(m);}var r=function(E,D){if(!E){return D;}E=Object.clone(Slick.parse(E));var l=E.expressions; +for(var e=l.length;e--;){l[e][0].combinator=D;}return E;};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(e,l){Element.implement(l,function(D){return this.getElement(r(D,e)); +});});Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(e,l){Element.implement(l,function(D){return this.getElements(r(D,e)); +});});Element.implement({getFirst:function(e){return document.id(Slick.search(this,r(e,">"))[0]);},getLast:function(e){return document.id(Slick.search(this,r(e,">")).getLast()); +},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(e){return document.id(Slick.find(this,"#"+(""+e).replace(/(\W)/g,"\\$1"))); +},match:function(e){return !e||Slick.match(this,e);}});if(window.$$==null){Window.implement("$$",function(e){if(arguments.length==1){if(typeof e=="string"){return Slick.search(this.document,e,new Elements); +}else{if(Type.isEnumerable(e)){return new Elements(e);}}}return new Elements(arguments);});}var w={before:function(l,e){var D=e.parentNode;if(D){D.insertBefore(l,e); +}},after:function(l,e){var D=e.parentNode;if(D){D.insertBefore(l,e.nextSibling);}},bottom:function(l,e){e.appendChild(l);},top:function(l,e){e.insertBefore(l,e.firstChild); +}};w.inside=w.bottom;var j={},d={};var k={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","rowSpan","tabIndex","useMap"],function(e){k[e.toLowerCase()]=e; +});k.html="innerHTML";k.text=(document.createElement("div").textContent==null)?"innerText":"textContent";Object.forEach(k,function(l,e){d[e]=function(D,E){D[l]=E; +};j[e]=function(D){return D[l];};});var x=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"]; +var h={};Array.forEach(x,function(e){var l=e.toLowerCase();h[l]=e;d[l]=function(D,E){D[e]=!!E;};j[l]=function(D){return !!D[e];};});Object.append(d,{"class":function(e,l){("className" in e)?e.className=(l||""):e.setAttribute("class",l); +},"for":function(e,l){("htmlFor" in e)?e.htmlFor=l:e.setAttribute("for",l);},style:function(e,l){(e.style)?e.style.cssText=l:e.setAttribute("style",l); +},value:function(e,l){e.value=(l!=null)?l:"";}});j["class"]=function(e){return("className" in e)?e.className||null:e.getAttribute("class");};var f=document.createElement("button"); +try{f.type="button";}catch(z){}if(f.type!="button"){d.type=function(e,l){e.setAttribute("type",l);};}f=null;var p=document.createElement("input");p.value="t"; +p.type="submit";if(p.value!="t"){d.type=function(l,e){var D=l.value;l.type=e;l.value=D;};}p=null;var q=(function(e){e.random="attribute";return(e.getAttribute("random")=="attribute"); +})(document.createElement("div"));Element.implement({setProperty:function(l,D){var E=d[l.toLowerCase()];if(E){E(this,D);}else{if(q){var e=this.retrieve("$attributeWhiteList",{}); +}if(D==null){this.removeAttribute(l);if(q){delete e[l];}}else{this.setAttribute(l,""+D);if(q){e[l]=true;}}}return this;},setProperties:function(e){for(var l in e){this.setProperty(l,e[l]); +}return this;},getProperty:function(F){var D=j[F.toLowerCase()];if(D){return D(this);}if(q){var l=this.getAttributeNode(F),E=this.retrieve("$attributeWhiteList",{}); +if(!l){return null;}if(l.expando&&!E[F]){var G=this.outerHTML;if(G.substr(0,G.search(/\/?['"]?>(?![^<]*<['"])/)).indexOf(F)<0){return null;}E[F]=true;}}var e=Slick.getAttribute(this,F); +return(!e&&!Slick.hasAttribute(this,F))?null:e;},getProperties:function(){var e=Array.from(arguments);return e.map(this.getProperty,this).associate(e); +},removeProperty:function(e){return this.setProperty(e,null);},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;},set:function(D,l){var e=Element.Properties[D]; +(e&&e.set)?e.set.call(this,l):this.setProperty(D,l);}.overloadSetter(),get:function(l){var e=Element.Properties[l];return(e&&e.get)?e.get.apply(this):this.getProperty(l); +}.overloadGetter(),erase:function(l){var e=Element.Properties[l];(e&&e.erase)?e.erase.apply(this):this.removeProperty(l);return this;},hasClass:function(e){return this.className.clean().contains(e," "); +},addClass:function(e){if(!this.hasClass(e)){this.className=(this.className+" "+e).clean();}return this;},removeClass:function(e){this.className=this.className.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)"),"$1"); +return this;},toggleClass:function(e,l){if(l==null){l=!this.hasClass(e);}return(l)?this.addClass(e):this.removeClass(e);},adopt:function(){var E=this,e,G=Array.flatten(arguments),F=G.length; +if(F>1){E=e=document.createDocumentFragment();}for(var D=0;D"; +var a=(t.childNodes.length==1);if(!a){var s="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),b=document.createDocumentFragment(),u=s.length; +while(u--){b.createElement(s[u]);}}t=null;var g=Function.attempt(function(){var e=document.createElement("table");e.innerHTML="";return true; +});var c=document.createElement("tr"),o="";c.innerHTML=o;var y=(c.innerHTML==o);c=null;if(!g||!y||!a){Element.Properties.html.set=(function(l){var e={table:[1,"","
"],select:[1,""],tbody:[2,"","
"],tr:[3,"","
"]}; +e.thead=e.tfoot=e.tbody;return function(D){var E=e[this.get("tag")];if(!E&&!a){E=[0,"",""];}if(!E){return l.call(this,D);}var H=E[0],G=document.createElement("div"),F=G; +if(!a){b.appendChild(G);}G.innerHTML=[E[1],D,E[2]].flatten().join("");while(H--){F=F.firstChild;}this.empty().adopt(F.childNodes);if(!a){b.removeChild(G); +}G=null;};})(Element.Properties.html.set);}var n=document.createElement("form");n.innerHTML="";if(n.firstChild.value!="s"){Element.Properties.value={set:function(G){var l=this.get("tag"); +if(l!="select"){return this.setProperty("value",G);}var D=this.getElements("option");for(var E=0;E111&&d<124){this.key="f"+(d-111);}else{if(d>95&&d<106){this.key=d-96;}}}if(this.key==null){this.key=String.fromCharCode(d).toLowerCase(); +}}else{if(i=="click"||i=="dblclick"||i=="contextmenu"||i=="DOMMouseScroll"||i.indexOf("mouse")==0){var j=g.document;j=(!j.compatMode||j.compatMode=="CSS1Compat")?j.html:j.body; +this.page={x:(c.pageX!=null)?c.pageX:c.clientX+j.scrollLeft,y:(c.pageY!=null)?c.pageY:c.clientY+j.scrollTop};this.client={x:(c.pageX!=null)?c.pageX-g.pageXOffset:c.clientX,y:(c.pageY!=null)?c.pageY-g.pageYOffset:c.clientY}; +if(i=="DOMMouseScroll"||i=="mousewheel"){this.wheel=(c.wheelDelta)?c.wheelDelta/120:-(c.detail||0)/3;}this.rightClick=(c.which==3||c.button==2);if(i=="mouseover"||i=="mouseout"){var k=c.relatedTarget||c[(i=="mouseover"?"from":"to")+"Element"]; +while(k&&k.nodeType==3){k=k.parentNode;}this.relatedTarget=document.id(k);}}else{if(i.indexOf("touch")==0||i.indexOf("gesture")==0){this.rotation=c.rotation; +this.scale=c.scale;this.targetTouches=c.targetTouches;this.changedTouches=c.changedTouches;var f=this.touches=c.touches;if(f&&f[0]){var e=f[0];this.page={x:e.pageX,y:e.pageY}; +this.client={x:e.clientX,y:e.clientY};}}}}if(!this.client){this.client={};}if(!this.page){this.page={};}});a.implement({stop:function(){return this.preventDefault().stopPropagation(); +},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); +}else{this.event.returnValue=false;}return this;}});a.defineKey=function(d,c){b[d]=c;return this;};a.defineKeys=a.defineKey.overloadSetter(true);a.defineKeys({"38":"up","40":"down","37":"left","39":"right","27":"esc","32":"space","8":"backspace","9":"tab","46":"delete","13":"enter"}); +})();(function(){Element.Properties.events={set:function(b){this.addEvents(b);}};[Element,Window,Document].invoke("implement",{addEvent:function(f,h){var i=this.retrieve("events",{}); +if(!i[f]){i[f]={keys:[],values:[]};}if(i[f].keys.contains(h)){return this;}i[f].keys.push(h);var g=f,b=Element.Events[f],d=h,j=this;if(b){if(b.onAdd){b.onAdd.call(this,h,f); +}if(b.condition){d=function(k){if(b.condition.call(this,k,f)){return h.call(this,k);}return true;};}if(b.base){g=Function.from(b.base).call(this,f);}}var e=function(){return h.call(j); +};var c=Element.NativeEvents[g];if(c){if(c==2){e=function(k){k=new DOMEvent(k,j.getWindow());if(d.call(j,k)===false){k.stop();}};}this.addListener(g,e,arguments[2]); +}i[f].values.push(e);return this;},removeEvent:function(e,d){var c=this.retrieve("events");if(!c||!c[e]){return this;}var h=c[e];var b=h.keys.indexOf(d); +if(b==-1){return this;}var g=h.values[b];delete h.keys[b];delete h.values[b];var f=Element.Events[e];if(f){if(f.onRemove){f.onRemove.call(this,d,e);}if(f.base){e=Function.from(f.base).call(this,e); +}}return(Element.NativeEvents[e])?this.removeListener(e,g,arguments[2]):this;},addEvents:function(b){for(var c in b){this.addEvent(c,b[c]);}return this; +},removeEvents:function(b){var d;if(typeOf(b)=="object"){for(d in b){this.removeEvent(d,b[d]);}return this;}var c=this.retrieve("events");if(!c){return this; +}if(!b){for(d in c){this.removeEvents(d);}this.eliminate("events");}else{if(c[b]){c[b].keys.each(function(e){this.removeEvent(b,e);},this);delete c[b]; +}}return this;},fireEvent:function(e,c,b){var d=this.retrieve("events");if(!d||!d[e]){return this;}c=Array.from(c);d[e].keys.each(function(f){if(b){f.delay(b,this,c); +}else{f.apply(this,c);}},this);return this;},cloneEvents:function(e,d){e=document.id(e);var c=e.retrieve("events");if(!c){return this;}if(!d){for(var b in c){this.cloneEvents(e,b); +}}else{if(c[d]){c[d].keys.each(function(f){this.addEvent(d,f);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,input:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +Element.Events={mousewheel:{base:(Browser.firefox)?"DOMMouseScroll":"mousewheel"}};if("onmouseenter" in document.documentElement){Element.NativeEvents.mouseenter=Element.NativeEvents.mouseleave=2; +}else{var a=function(b){var c=b.relatedTarget;if(c==null){return true;}if(!c){return false;}return(c!=this&&c.prefix!="xul"&&typeOf(this)!="document"&&!this.contains(c)); +};Element.Events.mouseenter={base:"mouseover",condition:a};Element.Events.mouseleave={base:"mouseout",condition:a};}if(!window.addEventListener){Element.NativeEvents.propertychange=2; +Element.Events.change={base:function(){var b=this.type;return(this.get("tag")=="input"&&(b=="radio"||b=="checkbox"))?"propertychange":"change";},condition:function(b){return this.type!="radio"||(b.event.propertyName=="checked"&&this.checked); +}};}})(); \ No newline at end of file diff --git a/web2d/src/test/javascript/render/arrow.html b/web2d/src/test/javascript/render/arrow.html index 0085e9ae..0b19a993 100644 --- a/web2d/src/test/javascript/render/arrow.html +++ b/web2d/src/test/javascript/render/arrow.html @@ -19,7 +19,7 @@ web2d.peer.utils = {}; - + @@ -69,7 +69,7 @@ overflowWorkspace.appendChild(arrow2); - overflowWorkspace.addItAsChildTo($("overflowExample")); + overflowWorkspace.addItAsChildTo(document.id("overflowExample")); } diff --git a/web2d/src/test/javascript/render/curvedLine.html b/web2d/src/test/javascript/render/curvedLine.html index cf1ad602..e61250bb 100644 --- a/web2d/src/test/javascript/render/curvedLine.html +++ b/web2d/src/test/javascript/render/curvedLine.html @@ -72,7 +72,7 @@ line2.setDestControlPoint(new core.Point(-100, 0)); overflowWorkspace.appendChild(line2); - overflowWorkspace.addItAsChildTo($("overflowExample")); + overflowWorkspace.addItAsChildTo(document.id("overflowExample")); } diff --git a/web2d/src/test/javascript/render/events.html b/web2d/src/test/javascript/render/events.html index d91f267e..1e134079 100755 --- a/web2d/src/test/javascript/render/events.html +++ b/web2d/src/test/javascript/render/events.html @@ -149,7 +149,7 @@ ebousemoveEventLogger = new EventLogger('mousemove', bigElipse); ebblCickEventLogger = new EventLogger('dblclick', bigElipse); - workspace.addItAsChildTo($("workspaceContainer")); + workspace.addItAsChildTo(document.id("workspaceContainer")); var mEventWorkspace = new web2d.Workspace(); mEventWorkspace.setSize("150px", "150px"); @@ -161,7 +161,7 @@ elipse.setFill('blue') mEventWorkspace.appendChild(elipse); - mEventWorkspace.addItAsChildTo($("workspaceMultipleEvents")); + mEventWorkspace.addItAsChildTo(document.id("workspaceMultipleEvents")); multipleHandler = new MultipleEventHandler('click', elipse); } @@ -291,9 +291,9 @@
+ onclick="multipleHandler.registerOneListener();document.id('listenerCounter').value=multipleHandler.listenerCount();"/> + onclick="multipleHandler.unRegisterOneListener();document.id('listenerCounter').value=multipleHandler.listenerCount();"/> diff --git a/web2d/src/test/javascript/render/font.html b/web2d/src/test/javascript/render/font.html index 44687fd7..0a2c6811 100644 --- a/web2d/src/test/javascript/render/font.html +++ b/web2d/src/test/javascript/render/font.html @@ -60,7 +60,7 @@ wText.setColor('red'); }); - overflowWorkspace.addItAsChildTo($(elemId)); + overflowWorkspace.addItAsChildTo(document.id(elemId)); } function alignments(text, family, elemId) { @@ -80,7 +80,7 @@ wText.setTextAlignment(align); }); - overflowWorkspace.addItAsChildTo($(elemId)); + overflowWorkspace.addItAsChildTo(document.id(elemId)); } function initialize() { diff --git a/web2d/src/test/javascript/render/group.html b/web2d/src/test/javascript/render/group.html index 505dd896..1097d184 100755 --- a/web2d/src/test/javascript/render/group.html +++ b/web2d/src/test/javascript/render/group.html @@ -77,7 +77,7 @@ line.setStroke("blue"); group.appendChild(line); - workspace.addItAsChildTo($("groupBasicContainer")); + workspace.addItAsChildTo(document.id("groupBasicContainer")); var xDir = 1; @@ -138,7 +138,7 @@ elipseLeft.addEvent("click", listener); elipseRight.addEvent("click", listener); - workspace.addItAsChildTo($("groupEventsContainer")); + workspace.addItAsChildTo(document.id("groupEventsContainer")); } eventTest(); @@ -198,7 +198,7 @@ line.setStroke("blue"); groupInner.appendChild(line); - workspace.addItAsChildTo($("groupNestedContainer")); + workspace.addItAsChildTo(document.id("groupNestedContainer")); }; eventTest(); @@ -234,13 +234,13 @@ } var sample100x100 = groupSampleBuilder(100, 100); - sample100x100.addItAsChildTo($("coordsizeExample100x100")); + sample100x100.addItAsChildTo(document.id("coordsizeExample100x100")); var sample100x200 = groupSampleBuilder(100, 200); - sample100x200.addItAsChildTo($("coordsizeExample100x200")); + sample100x200.addItAsChildTo(document.id("coordsizeExample100x200")); var sample200x100 = groupSampleBuilder(200, 100); - sample200x100.addItAsChildTo($("coordsizeExample200x100")); + sample200x100.addItAsChildTo(document.id("coordsizeExample200x100")); }; workspaceCoordSizeSample(); @@ -277,13 +277,13 @@ ; var sample0x0 = groupSampleBuilder(0, 0); - sample0x0.addItAsChildTo($("coordOriginExample0x0")); + sample0x0.addItAsChildTo(document.id("coordOriginExample0x0")); var sample100x200 = groupSampleBuilder(0, 50); - sample100x200.addItAsChildTo($("coordOriginExample0x50")); + sample100x200.addItAsChildTo(document.id("coordOriginExample0x50")); var sample200x100 = groupSampleBuilder(50, 0); - sample200x100.addItAsChildTo($("coordOriginExample50x0")); + sample200x100.addItAsChildTo(document.id("coordOriginExample50x0")); } workspaceCoordOriginSample(); @@ -326,7 +326,7 @@ group.setVisibility(isVisible); }; executer.periodical(100); - workspace.addItAsChildTo($("visibilityExample")); + workspace.addItAsChildTo(document.id("visibilityExample")); } groupVisibilitySample(); @@ -364,7 +364,7 @@ group.setCoordSize(width, height); }; executer.periodical(100); - workspace.addItAsChildTo($("scaleStrokeExample")); + workspace.addItAsChildTo(document.id("scaleStrokeExample")); } groupVisibilitySample(); diff --git a/web2d/src/test/javascript/render/line.html b/web2d/src/test/javascript/render/line.html index d9f1358b..647c3a46 100755 --- a/web2d/src/test/javascript/render/line.html +++ b/web2d/src/test/javascript/render/line.html @@ -64,7 +64,7 @@ } strokeWidthWorkspace.appendChild(rect); - strokeWidthWorkspace.addItAsChildTo($("strokeWidthSample")); + strokeWidthWorkspace.addItAsChildTo(document.id("strokeWidthSample")); var strokeOpacityWorkspace = new web2d.Workspace(workspaceAttributes); for (var i = 0; i < 10; i++) { @@ -76,7 +76,7 @@ line.setAttribute('strokeColor', 'red'); strokeOpacityWorkspace.appendChild(line); } - strokeOpacityWorkspace.addItAsChildTo($("strokeOpacitySample")); + strokeOpacityWorkspace.addItAsChildTo(document.id("strokeOpacitySample")); var strokeStyleWorkspace = new web2d.Workspace(workspaceAttributes); var styles = ['solid','dot','dash','dashdot','longdash']; @@ -89,7 +89,7 @@ line.setAttribute('strokeStyle', styles[i]); strokeStyleWorkspace.appendChild(line); } - strokeStyleWorkspace.addItAsChildTo($("strokeStyleSample")); + strokeStyleWorkspace.addItAsChildTo(document.id("strokeStyleSample")); var strokeArrowWorkspace = new web2d.Workspace(workspaceAttributes); var styles = ['none ','block ','classic','diamond ','oval','open','chevron','doublechevron']; @@ -102,7 +102,7 @@ line.setArrowStyle(styles[i]); strokeArrowWorkspace.appendChild(line); } - strokeArrowWorkspace.addItAsChildTo($("strokeArrowSample")); + strokeArrowWorkspace.addItAsChildTo(document.id("strokeArrowSample")); } diff --git a/web2d/src/test/javascript/render/polyLine.html b/web2d/src/test/javascript/render/polyLine.html index 1ef11d76..1b79f3c5 100755 --- a/web2d/src/test/javascript/render/polyLine.html +++ b/web2d/src/test/javascript/render/polyLine.html @@ -126,7 +126,7 @@ // overflowWorkspace.appendChild(refLine); // - overflowWorkspace.addItAsChildTo($("overflowExample")); + overflowWorkspace.addItAsChildTo(document.id("overflowExample")); var overflowWorkspace = new web2d.Workspace(); @@ -175,7 +175,7 @@ line1.setTo(20, 135); overflowWorkspace.appendChild(line1); - overflowWorkspace.addItAsChildTo($("multipleLineExample")); + overflowWorkspace.addItAsChildTo(document.id("multipleLineExample")); } diff --git a/web2d/src/test/javascript/render/prototype.html b/web2d/src/test/javascript/render/prototype.html index 27fbdbdc..616e766f 100755 --- a/web2d/src/test/javascript/render/prototype.html +++ b/web2d/src/test/javascript/render/prototype.html @@ -65,7 +65,7 @@ centralRect.setStroke(1, 'solid', "#878b8f"); workspace.appendChild(centralRect); - workspace.addItAsChildTo($("divWorkspace")); + workspace.addItAsChildTo(document.id("divWorkspace")); } function zoomIn() { diff --git a/web2d/src/test/javascript/render/rect.html b/web2d/src/test/javascript/render/rect.html index 1f3f7611..f5a19dd1 100755 --- a/web2d/src/test/javascript/render/rect.html +++ b/web2d/src/test/javascript/render/rect.html @@ -59,7 +59,7 @@ rect.setPosition(20, 20); workspace.appendChild(rect); - workspace.addItAsChildTo($("rectExample")); + workspace.addItAsChildTo(document.id("rectExample")); } rectExampleTest(); @@ -78,7 +78,7 @@ workspace.setSize("500px", "550px"); workspace.setCoordOrigin(0, -4); workspace.setCoordSize(500, 550); - workspace.addItAsChildTo($("roundRect")); + workspace.addItAsChildTo(document.id("roundRect")); builder(workspace, 10, 50, 50); diff --git a/web2d/src/test/javascript/render/shapes.html b/web2d/src/test/javascript/render/shapes.html index 75d51b43..1bdae0b2 100755 --- a/web2d/src/test/javascript/render/shapes.html +++ b/web2d/src/test/javascript/render/shapes.html @@ -15,8 +15,7 @@ web2d.peer.utils = {}; - + @@ -100,7 +99,7 @@ function initialize() { workspace.setCoordSize(500, 100); workspace.setCoordOrigin(0, 0); builder(workspace, 1, 1); - workspace.addItAsChildTo($("strokeStyle")); + workspace.addItAsChildTo(document.id("strokeStyle")); // Workspace with modified scale ... workspace = new web2d.Workspace(); @@ -108,7 +107,7 @@ function initialize() { workspace.setCoordSize(5000, 1000); workspace.setCoordOrigin(0, 0); builder(workspace, 10, 1); - workspace.addItAsChildTo($("strokeStyleGroup")); + workspace.addItAsChildTo(document.id("strokeStyleGroup")); // Workspace with default scale ... workspace = new web2d.Workspace(); @@ -116,7 +115,7 @@ function initialize() { workspace.setCoordSize(500, 100); workspace.setCoordOrigin(0, 0); builder(workspace, 1, 5); - workspace.addItAsChildTo($("strokeStyleWidth")); + workspace.addItAsChildTo(document.id("strokeStyleWidth")); }; @@ -153,7 +152,7 @@ function initialize() { rect.setAttribute("strokeOpacity", 0); workspace.appendChild(rect); - workspace.addItAsChildTo($("strokeOpacity")); + workspace.addItAsChildTo(document.id("strokeOpacity")); }; strokeOpacityTest(); @@ -189,7 +188,7 @@ function initialize() { rect.setAttribute("fillOpacity", 0); workspace.appendChild(rect); - workspace.addItAsChildTo($("fillOpacity")); + workspace.addItAsChildTo(document.id("fillOpacity")); }; fillOpacityTest(); @@ -225,7 +224,7 @@ function initialize() { rect.setOpacity(0); workspace.appendChild(rect); - workspace.addItAsChildTo($("opacity")); + workspace.addItAsChildTo(document.id("opacity")); }; opacityTest(); @@ -251,7 +250,7 @@ function initialize() { }; executer.periodical(100); - workspace.addItAsChildTo($("visibility")); + workspace.addItAsChildTo(document.id("visibility")); }; visibilityTest(); } diff --git a/web2d/src/test/javascript/render/text.html b/web2d/src/test/javascript/render/text.html index fa67be2b..49736f24 100755 --- a/web2d/src/test/javascript/render/text.html +++ b/web2d/src/test/javascript/render/text.html @@ -70,9 +70,9 @@ textot = text; - overflowWorkspace.addItAsChildTo($(owner)); + overflowWorkspace.addItAsChildTo(document.id(owner)); - var parent = $(owner); + var parent = document.id(owner); var span = document.createElement("span"); span.setAttribute("id", "textoHTML" + iesimo); var textsize = text.offsetWidth; @@ -129,7 +129,7 @@ Text to Inspect: + onclick="alert(document.getElementById('textoHTML'+document.id('iesimo').value).offsetWidth);"> diff --git a/web2d/src/test/javascript/render/workspace.html b/web2d/src/test/javascript/render/workspace.html index ef8c5a93..9e5383e6 100755 --- a/web2d/src/test/javascript/render/workspace.html +++ b/web2d/src/test/javascript/render/workspace.html @@ -17,7 +17,7 @@ + src="../mootools-core-1.4.5.js"> @@ -55,14 +55,14 @@ elipse1.setSize(200, 200); elipse1.setPosition(0, 0); overflowWorkspace.appendChild(elipse1); - overflowWorkspace.addItAsChildTo($("overflowExample")); + overflowWorkspace.addItAsChildTo(document.id("overflowExample")); var workspacePosition = function() { var elipseAttr = {width:100,height:100,x:100,y:100}; - var divElem = $("positionExample"); + var divElem = document.id("positionExample"); var workPosition = new web2d.Workspace(); workPosition.setSize("100px", "100px"); elipse = new web2d.Elipse(elipseAttr); @@ -93,7 +93,7 @@ elipse.setPosition(100, 100); workspacePixel.appendChild(elipse); - workspacePixel.addItAsChildTo($("sizeExamplePixels")); + workspacePixel.addItAsChildTo(document.id("sizeExamplePixels")); var workspaceInchs = new web2d.Workspace(); workspaceInchs.setSize("1in", "1in"); @@ -102,7 +102,7 @@ elipse.setPosition(100, 100); workspaceInchs.appendChild(elipse); - workspaceInchs.addItAsChildTo($("sizeExampleInch")); + workspaceInchs.addItAsChildTo(document.id("sizeExampleInch")); var workspaceCoordSizeSample = function() { @@ -135,16 +135,16 @@ }; var workspace100x100 = coordSizeSampleBuilder(100, 100); - workspace100x100.addItAsChildTo($("coordsizeExample100x100")); + workspace100x100.addItAsChildTo(document.id("coordsizeExample100x100")); var workspace100x200 = coordSizeSampleBuilder(100, 200); - workspace100x200.addItAsChildTo($("coordsizeExample100x200")); + workspace100x200.addItAsChildTo(document.id("coordsizeExample100x200")); var workspace200x100 = coordSizeSampleBuilder(200, 100); - workspace200x100.addItAsChildTo($("coordsizeExample200x100")); + workspace200x100.addItAsChildTo(document.id("coordsizeExample200x100")); var dynamicWorkspace = coordSizeSampleBuilder(100, 100); - dynamicWorkspace.addItAsChildTo($("coordsizeExampleDynamic")); + dynamicWorkspace.addItAsChildTo(document.id("coordsizeExampleDynamic")); var size = 100; var executer = function() { @@ -199,17 +199,17 @@ }; var workspace0x0 = coordOriginSampleBuilder(0, 0); - workspace0x0.addItAsChildTo($("coordorigin0x0")); + workspace0x0.addItAsChildTo(document.id("coordorigin0x0")); var workspace0x50 = coordOriginSampleBuilder(0, 50); - workspace0x50.addItAsChildTo($("coordorigin0x50")); + workspace0x50.addItAsChildTo(document.id("coordorigin0x50")); var workspace50x0 = coordOriginSampleBuilder(50, 0); - workspace50x0.addItAsChildTo($("coordorigin50x0")); + workspace50x0.addItAsChildTo(document.id("coordorigin50x0")); // Workspace animation changing the coordsize from (30,30) to (100,100) var dynamicWorkspace = coordOriginSampleBuilder(100, 100); - dynamicWorkspace.addItAsChildTo($("coordoriginExampleDynamic")); + dynamicWorkspace.addItAsChildTo(document.id("coordoriginExampleDynamic")); var x = 50; var y = 50;