Replace document.id by Jquery $

This commit is contained in:
Paulo Gustavo Veiga 2014-03-04 21:07:52 -03:00
parent d3087a6626
commit 4c2d335a2b
7 changed files with 39 additions and 39 deletions

View File

@ -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();

View File

@ -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'));
}
</script>
</head>

View File

@ -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'));
}
</script>
</head>

View File

@ -67,7 +67,7 @@
centralRect.setStroke(1, 'solid', "#878b8f");
workspace.append(centralRect);
workspace.addItAsChildTo(document.id("divWorkspace"));
workspace.addItAsChildTo($('#divWorkspace'));
}
function zoomIn() {

View File

@ -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);

View File

@ -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);
};

View File

@ -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;