From c78c8fcd988d72855525ee811e067ca8874dcbae Mon Sep 17 00:00:00 2001 From: Kevin Kwok Date: Mon, 4 Jan 2010 22:06:40 +0000 Subject: [PATCH] It turns out that now that svg-edit uses querySelector to get a shape that the old IDs have invalid characters so now i replaced getID with an overly complicated solution git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1147 eee81c28-f429-11dd-99c0-75d572ba1ddd --- wave/svg-edit.xml | 801 +++++++++++++++++++++++++++------------------- wave/wave.js | 14 +- 2 files changed, 483 insertions(+), 332 deletions(-) diff --git a/wave/svg-edit.xml b/wave/svg-edit.xml index fbc09cde..59bf1bc7 100644 --- a/wave/svg-edit.xml +++ b/wave/svg-edit.xml @@ -6,342 +6,481 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -
- -
- -
-
- - - - - -
+
+ +
+ +
+
+ +
+
+

Layers

+
+
+
+
+
+
+
+ + + + + + +
Layer 1
+ Move elements to: + +
+
L a y e r s
+
+ + + +
- -
- Clear - - Save - Source - -
- - -
-
-
-
-
+ +
+
+ +
+
+
+
+
+ + +
+
+
+
+
- -
- | - Copy - Delete - | - Top - Bottom - | - - angle: - -
- - -
- | - Clone - Delete - | -
-
-
-
-
-
- relative to: - - | - Group -
- -
- | - Ungroup -
- -
- | - - - - - - - - - - -
- -
- | - - - - - - - - - - -
- - -
- | - - - - - - -
- -
- | - - - - - - - - -
- -
- | - - - - - - - - -
- -
- | - - - - - Bold - Italic - - - -
-
- -
- Select
- Pencil
- Line
- Square - - Circle
- - Text - Poly - Image - Zoom -
- -
- - -
- zoom: - -
- -
    -
  • 100%
  • -
  • Fit to content
  • -
  • Fit to selection
  • -
  • Fit to canvas
  • -
  • 25%
  • -
  • 50%
  • -
  • 100%
  • -
  • 200%
  • -
  • 400%
  • -
  • 1000%
  • -
-
- | -
- -
- - - - - - - - - - - - -
fill:
100%
stroke:
100 %
- - - -
-
- -
-
- -
-
- - -
- -
-
-
-
-
- -
-
-
-
-
- -
- -
-
-
-
- - -
-
- -
-
-
- -
-
-
-
- - - -
- -
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ + + +
+
+ + +
+
+ + + + +
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+ relative to: + +
+ +
+ +
+
+
+
+ +
+
+ + + + +
+
+ + +
+
+ +
+
+ + + + +
+
+ + + +
+
+
+ +
+
+ + + + +
+
+ + +
+
+ +
+
+ + + + +
+
+ + + + +
+
+ +
+
+ + + + +
+
+ + + + +
+
+ +
+
B
+
i
+ +
+ + +
+ +
+ + +
+ +
+ +
+
+ +
+ + + + + +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ + +
+ zoom: + + +
+
+ +
+ + + + + + + + + + + + +
fill:
100%
stroke:
100 %
+ + + +
+
+ +
+
+
+ +
+ + +
+ +
+
+
+
+
+ +
+
+
+
+
+ +
+ +
+
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
+ + +
+ + +
+ Image Properties + + +
+ Canvas Dimensions + + + + + + +
+ +
+ Included Images + + +
+ + +
+ +
+ Editor Preferences + + + + + +
+ Editor Background +
+ +

Note: Background will not be saved with image.

+
-
- - -
-
-
-
- - + + +
+
+ +
+
+
+
+ Test message +
+
+
+
+ + ]]>
diff --git a/wave/wave.js b/wave/wave.js index 9c1d6525..46a9d262 100644 --- a/wave/wave.js +++ b/wave/wave.js @@ -56,7 +56,14 @@ function stateUpdated() { function getId(canvas, objnum) { - return "svg_"+wave.getViewer().getId()+"_"+objnum; + var id = wave.getViewer().getId().split("@")[0]; + var extra = SHA256(wave.getViewer().getId()); //in case the next step kills all the characters + for(var i = 0, l = id.length, n = ""; i < l; i++){ + if("abcdefghijklmnopqrstuvwxyz0123456789".indexOf(id[i]) != -1){ + n+=i; + } + } + return "svg_"+n+"_"+extra.substr(0,5)+"_"+objnum; } function main() { @@ -117,3 +124,8 @@ function main() { } gadgets.util.registerOnLoadHandler(main); + + +//and why not use my stuff? +function SHA256(b){function h(j,k){return(j>>e)+(k>>e)+((p=(j&o)+(k&o))>>e)<>>k|j<<32-k}var g=[],d,c=3,l=[2],p,i,q,a,m=[],n=[];i=b.length*8;for(var e=16,o=65535,r="";c<312;c++){for(d=l.length;d--&&c%l[d]!=0;);d<0&&l.push(c)}b+="\u0080";for(c=0;c<=i;c+=8)n[c>>5]|=(b.charCodeAt(c/8)&255)<<24-c%32;n[(i+64>>9<<4)+15]=i;for(c=8;c--;)m[c]=parseInt(Math.pow(l[c],0.5).toString(e).substr(2,8),e);for(c=0;c>>10,g[b-7]),f(g[b-15],7)^f(g[b-15],18)^g[b-15]>>>3),g[b-e]);i=h(h(h(h(a[7],f(a[4],6)^f(a[4],11)^f(a[4],25)),a[4]&a[5]^~a[4]&a[6]),parseInt(Math.pow(l[b],1/3).toString(e).substr(2,8),e)),g[b]);q=(f(a[0],2)^f(a[0],13)^f(a[0],22))+(a[0]&a[1]^a[0]&a[2]^a[1]&a[2]);for(d=8;--d;)a[d]=d==4?h(a[3],i):a[d-1];a[0]=h(i,q)}for(d=8;d--;)m[d]+=a[d]}for(c=0;c<8;c++)for(b=8;b--;)r+=(m[c]>>>b*4&15).toString(e);return r} +