From 4c2d335a2bd04282b9eed3026476547019740b84 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 4 Mar 2014 21:07:52 -0300 Subject: [PATCH] Replace document.id by Jquery $ --- web2d/src/test/javascript/render/group.html | 22 ++++++++-------- web2d/src/test/javascript/render/line.html | 8 +++--- .../src/test/javascript/render/polyLine.html | 4 +-- .../src/test/javascript/render/prototype.html | 2 +- web2d/src/test/javascript/render/rect.html | 4 +-- web2d/src/test/javascript/render/shapes.html | 26 +++++++++---------- .../src/test/javascript/render/workspace.html | 12 ++++----- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/web2d/src/test/javascript/render/group.html b/web2d/src/test/javascript/render/group.html index 60d95b59..7f350d4d 100755 --- a/web2d/src/test/javascript/render/group.html +++ b/web2d/src/test/javascript/render/group.html @@ -79,7 +79,7 @@ line.setStroke("blue"); group.append(line); - workspace.addItAsChildTo(document.id("groupBasicContainer")); + workspace.addItAsChildTo($('#groupBasicContainer')); var xDir = 1; @@ -140,7 +140,7 @@ elipseLeft.addEvent("click", listener); elipseRight.addEvent("click", listener); - workspace.addItAsChildTo(document.id("groupEventsContainer")); + workspace.addItAsChildTo($('#groupEventsContainer')); } eventTest(); @@ -200,7 +200,7 @@ line.setStroke("blue"); groupInner.append(line); - workspace.addItAsChildTo(document.id("groupNestedContainer")); + workspace.addItAsChildTo($('#groupNestedContainer')); }; eventTest(); @@ -236,13 +236,13 @@ } var sample100x100 = groupSampleBuilder(100, 100); - sample100x100.addItAsChildTo(document.id("coordsizeExample100x100")); + sample100x100.addItAsChildTo($("#coordsizeExample100x100")); var sample100x200 = groupSampleBuilder(100, 200); - sample100x200.addItAsChildTo(document.id("coordsizeExample100x200")); + sample100x200.addItAsChildTo($("#coordsizeExample100x200")); var sample200x100 = groupSampleBuilder(200, 100); - sample200x100.addItAsChildTo(document.id("coordsizeExample200x100")); + sample200x100.addItAsChildTo($("#coordsizeExample200x100")); }; workspaceCoordSizeSample(); @@ -279,13 +279,13 @@ ; var sample0x0 = groupSampleBuilder(0, 0); - sample0x0.addItAsChildTo(document.id("coordOriginExample0x0")); + sample0x0.addItAsChildTo($("#coordOriginExample0x0")); var sample100x200 = groupSampleBuilder(0, 50); - sample100x200.addItAsChildTo(document.id("coordOriginExample0x50")); + sample100x200.addItAsChildTo($("#coordOriginExample0x50")); var sample200x100 = groupSampleBuilder(50, 0); - sample200x100.addItAsChildTo(document.id("coordOriginExample50x0")); + sample200x100.addItAsChildTo($("#coordOriginExample50x0")); } workspaceCoordOriginSample(); @@ -328,7 +328,7 @@ group.setVisibility(isVisible); }; executer.periodical(100); - workspace.addItAsChildTo(document.id("visibilityExample")); + workspace.addItAsChildTo($('#visibilityExample')); } groupVisibilitySample(); @@ -366,7 +366,7 @@ group.setCoordSize(width, height); }; executer.periodical(100); - workspace.addItAsChildTo(document.id("scaleStrokeExample")); + workspace.addItAsChildTo($('#scaleStrokeExample')); } groupVisibilitySample(); diff --git a/web2d/src/test/javascript/render/line.html b/web2d/src/test/javascript/render/line.html index 78a6e995..5f4db45e 100755 --- a/web2d/src/test/javascript/render/line.html +++ b/web2d/src/test/javascript/render/line.html @@ -66,7 +66,7 @@ } strokeWidthWorkspace.append(rect); - strokeWidthWorkspace.addItAsChildTo(document.id("strokeWidthSample")); + strokeWidthWorkspace.addItAsChildTo($('#strokeWidthSample')); var strokeOpacityWorkspace = new web2d.Workspace(workspaceAttributes); for (var i = 0; i < 10; i++) { @@ -78,7 +78,7 @@ line.setAttribute('strokeColor', 'red'); strokeOpacityWorkspace.append(line); } - strokeOpacityWorkspace.addItAsChildTo(document.id("strokeOpacitySample")); + strokeOpacityWorkspace.addItAsChildTo($('#strokeOpacitySample')); var strokeStyleWorkspace = new web2d.Workspace(workspaceAttributes); var styles = ['solid','dot','dash','dashdot','longdash']; @@ -91,7 +91,7 @@ line.setAttribute('strokeStyle', styles[i]); strokeStyleWorkspace.append(line); } - strokeStyleWorkspace.addItAsChildTo(document.id("strokeStyleSample")); + strokeStyleWorkspace.addItAsChildTo($('#strokeStyleSample')); var strokeArrowWorkspace = new web2d.Workspace(workspaceAttributes); var styles = ['none ','block ','classic','diamond ','oval','open','chevron','doublechevron']; @@ -104,7 +104,7 @@ line.setArrowStyle(styles[i]); strokeArrowWorkspace.append(line); } - strokeArrowWorkspace.addItAsChildTo(document.id("strokeArrowSample")); + strokeArrowWorkspace.addItAsChildTo($('#strokeArrowSample')); } diff --git a/web2d/src/test/javascript/render/polyLine.html b/web2d/src/test/javascript/render/polyLine.html index d4abf601..91954a52 100755 --- a/web2d/src/test/javascript/render/polyLine.html +++ b/web2d/src/test/javascript/render/polyLine.html @@ -128,7 +128,7 @@ // overflowWorkspace.append(refLine); // - overflowWorkspace.addItAsChildTo(document.id("overflowExample")); + overflowWorkspace.addItAsChildTo($('#overflowExample')); var overflowWorkspace = new web2d.Workspace(); @@ -177,7 +177,7 @@ line1.setTo(20, 135); overflowWorkspace.append(line1); - overflowWorkspace.addItAsChildTo(document.id("multipleLineExample")); + overflowWorkspace.addItAsChildTo($('#multipleLineExample')); } diff --git a/web2d/src/test/javascript/render/prototype.html b/web2d/src/test/javascript/render/prototype.html index 889590b3..2a1883c7 100755 --- a/web2d/src/test/javascript/render/prototype.html +++ b/web2d/src/test/javascript/render/prototype.html @@ -67,7 +67,7 @@ centralRect.setStroke(1, 'solid', "#878b8f"); workspace.append(centralRect); - workspace.addItAsChildTo(document.id("divWorkspace")); + workspace.addItAsChildTo($('#divWorkspace')); } function zoomIn() { diff --git a/web2d/src/test/javascript/render/rect.html b/web2d/src/test/javascript/render/rect.html index 7443a7c8..e506ab0c 100755 --- a/web2d/src/test/javascript/render/rect.html +++ b/web2d/src/test/javascript/render/rect.html @@ -60,7 +60,7 @@ rect.setPosition(20, 20); workspace.append(rect); - workspace.addItAsChildTo(document.id("rectExample")); + workspace.addItAsChildTo($('#rectExample')); } rectExampleTest(); @@ -79,7 +79,7 @@ workspace.setSize("500px", "550px"); workspace.setCoordOrigin(0, -4); workspace.setCoordSize(500, 550); - workspace.addItAsChildTo(document.id("roundRect")); + workspace.addItAsChildTo($('#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 b9cd1806..c64cd08e 100755 --- a/web2d/src/test/javascript/render/shapes.html +++ b/web2d/src/test/javascript/render/shapes.html @@ -129,11 +129,11 @@ function initialize() { workspace.setCoordSize(500, 100); workspace.setCoordOrigin(0, 0); - var rect = new web2d.Rect(0, {x:5,y:5,width:390,height:90,fillColor:'green', - strokeColor:'black',strokeStyle:'solid',strokeWidth:1}); + var rect = new web2d.Rect(0, {x: 5, y: 5, width: 390, height: 90, fillColor: 'green', + strokeColor: 'black', strokeStyle: 'solid', strokeWidth: 1}); workspace.append(rect); - var rectAttributes = {width:60,height:60,fillColor:'yellow',strokeColor:'black',strokeStyle:'solid',strokeWidth:10}; + var rectAttributes = {width: 60, height: 60, fillColor: 'yellow', strokeColor: 'black', strokeStyle: 'solid', strokeWidth: 10}; rect = new web2d.Rect(0, rectAttributes); rect.setPosition(20, 20); rect.setAttribute("strokeOpacity", 1); @@ -165,11 +165,11 @@ function initialize() { workspace.setCoordSize(500, 100); workspace.setCoordOrigin(0, 0); - var rect = new web2d.Rect(0, {x:5,y:5,width:390,height:90,fillColor:'green', - strokeColor:'black',strokeStyle:'solid',strokeWidth:4}); + var rect = new web2d.Rect(0, {x: 5, y: 5, width: 390, height: 90, fillColor: 'green', + strokeColor: 'black', strokeStyle: 'solid', strokeWidth: 4}); workspace.append(rect); - var rectAttributes = {width:60,height:60,fillColor:'yellow',strokeColor:'black',strokeStyle:'solid',strokeWidth:10}; + var rectAttributes = {width: 60, height: 60, fillColor: 'yellow', strokeColor: 'black', strokeStyle: 'solid', strokeWidth: 10}; rect = new web2d.Rect(0, rectAttributes); rect.setPosition(20, 20); rect.setAttribute("fillOpacity", 1); @@ -201,11 +201,11 @@ function initialize() { workspace.setCoordSize(500, 100); workspace.setCoordOrigin(0, 0); - var rect = new web2d.Rect(0, {x:5,y:5,width:390,height:90,fillColor:'green', - strokeColor:'black',strokeStyle:'solid',strokeWidth:4}); + var rect = new web2d.Rect(0, {x: 5, y: 5, width: 390, height: 90, fillColor: 'green', + strokeColor: 'black', strokeStyle: 'solid', strokeWidth: 4}); workspace.append(rect); - var rectAttributes = {width:60,height:60,fillColor:'yellow',strokeColor:'black',strokeStyle:'solid',strokeWidth:10}; + var rectAttributes = {width: 60, height: 60, fillColor: 'yellow', strokeColor: 'black', strokeStyle: 'solid', strokeWidth: 10}; rect = new web2d.Rect(0, rectAttributes); rect.setPosition(20, 20); rect.setOpacity(0.8); @@ -232,21 +232,21 @@ function initialize() { var visibilityTest = function () { - var workspace = new web2d.Workspace({fillColor:'yellow',strokeWidth:'2px'}); + var workspace = new web2d.Workspace({fillColor: 'yellow', strokeWidth: '2px'}); workspace.setSize("500px", "100px"); workspace.setCoordSize(500, 100); workspace.setCoordOrigin(0, 0); - var rectAttributes = {width:60,height:60,fillColor:'green',strokeColor:'black',strokeStyle:'solid',strokeWidth:10}; + var rectAttributes = {width: 60, height: 60, fillColor: 'green', strokeColor: 'black', strokeStyle: 'solid', strokeWidth: 10}; var rect = new web2d.Rect(0, rectAttributes); rect.setPosition(120, 20); workspace.append(rect); - rect.addEvent("mouseover", function() { + rect.addEvent("mouseover", function () { alert("Mouse Over"); }); var isVisible = true; - var executer = function() { + var executer = function () { isVisible = !isVisible; rect.setVisibility(isVisible); }; diff --git a/web2d/src/test/javascript/render/workspace.html b/web2d/src/test/javascript/render/workspace.html index 3b59aeb1..41dfb715 100755 --- a/web2d/src/test/javascript/render/workspace.html +++ b/web2d/src/test/javascript/render/workspace.html @@ -56,14 +56,14 @@ elipse1.setSize(200, 200); elipse1.setPosition(0, 0); overflowWorkspace.append(elipse1); - overflowWorkspace.addItAsChildTo(document.id("overflowExample")); + overflowWorkspace.addItAsChildTo($('#overflowExample')); var workspacePosition = function () { var elipseAttr = {width: 100, height: 100, x: 100, y: 100}; - var divElem = document.id("positionExample"); + var divElem = $('#positionExample'); var workPosition = new web2d.Workspace(); workPosition.setSize("100px", "100px"); elipse = new web2d.Elipse(elipseAttr); @@ -94,7 +94,7 @@ elipse.setPosition(100, 100); workspacePixel.append(elipse); - workspacePixel.addItAsChildTo(document.id("sizeExamplePixels")); + workspacePixel.addItAsChildTo($('#sizeExamplePixels')); var workspaceInchs = new web2d.Workspace(); workspaceInchs.setSize("1in", "1in"); @@ -103,7 +103,7 @@ elipse.setPosition(100, 100); workspaceInchs.append(elipse); - workspaceInchs.addItAsChildTo(document.id("sizeExampleInch")); + workspaceInchs.addItAsChildTo($('#sizeExampleInch')); var workspaceCoordSizeSample = function () { @@ -145,7 +145,7 @@ workspace200x100.addItAsChildTo(document.id("coordsizeExample200x100")); var dynamicWorkspace = coordSizeSampleBuilder(100, 100); - dynamicWorkspace.addItAsChildTo(document.id("coordsizeExampleDynamic")); + dynamicWorkspace.addItAsChildTo($('#coordsizeExampleDynamic')); var size = 100; var executer = function () { @@ -210,7 +210,7 @@ // Workspace animation changing the coordsize from (30,30) to (100,100) var dynamicWorkspace = coordOriginSampleBuilder(100, 100); - dynamicWorkspace.addItAsChildTo(document.id("coordoriginExampleDynamic")); + dynamicWorkspace.addItAsChildTo($('#coordoriginExampleDynamic')); var x = 50; var y = 50;