annotate inkscape/firefox/inkscape.js @ 274:96aae15527c8

Port all basic scene editor from pyGtk to the firefox
author wycc
date Thu, 29 Jan 2009 22:30:46 +0800
parents
children 40c0c907c6dd
rev   line source
274
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
1 var isInProgress=0;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
2
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
3 var MAX_DUMP_DEPTH = 10;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
4 var mbsvg;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
5
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
6
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
7
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
8 function dumpObj(obj, name, indent, depth) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
9 if (depth > MAX_DUMP_DEPTH) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
10 return indent + name + ": <Maximum Depth Reached>\n";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
11 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
12 if (typeof obj == "object") {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
13 var child = null;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
14 var output = indent + name + "\n";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
15 indent += "\t";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
16 for (var item in obj)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
17 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
18 try {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
19 child = obj[item];
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
20 } catch (e) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
21 child = "<Unable to Evaluate>";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
22 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
23 if (typeof child == "object") {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
24 output += dumpObj(child, item, indent, depth + 1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
25 } else {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
26 output += indent + item + ": " + child + "\n";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
27 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
28 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
29 return output;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
30 } else {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
31 return obj;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
32 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
33 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
34 function dumpObjItem(obj, name, indent, depth) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
35 if (depth > MAX_DUMP_DEPTH) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
36 return indent + name + ": <Maximum Depth Reached>\n";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
37 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
38 if (typeof obj == "object") {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
39 var child = null;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
40 var output = indent + name + "\n";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
41 indent += "\t";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
42 for (var item in obj)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
43 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
44 try {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
45 child = obj[item];
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
46 } catch (e) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
47 child = "<Unable to Evaluate>";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
48 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
49 if (typeof child == "object") {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
50 output += dumpObjItem(child, item, indent, depth + 1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
51 } else {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
52 output += indent + item + ":\n";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
53 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
54 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
55 return output;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
56 } else {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
57 return obj;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
58 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
59 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
60
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
61 function inkscape_load(file)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
62 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
63 var inkscape = document.getElementById('inkscape');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
64 inkscape.innerHTML = "<embed src="+file+" width=1000 height=800 />";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
65 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
66
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
67 function MBSVG(file)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
68 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
69 var xmlDoc=document.implementation.createDocument("http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd","",null);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
70 xmlDoc.async=false;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
71 xmlDoc.load(file);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
72 MBSVG_loadFromDoc(this,xmlDoc);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
73
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
74 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
75 function MBSVGString(xml)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
76 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
77 var xmlParser = new DOMParser();
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
78 var xmlDoc = xmlParser.parseFromString( xml, 'text/xml');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
79 MBSVG_loadFromDoc(this,xmlDoc);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
80 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
81
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
82
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
83
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
84 function MBSVG_loadFromDoc(self,xmlDoc)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
85 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
86 var scenesNode = xmlDoc.getElementsByTagNameNS("http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd","scene");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
87 if (scenesNode == null) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
88 alert('This is not a valid scene file');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
89 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
90 var len = scenesNode.length;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
91 var i,j;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
92 var max = 0;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
93 var scenes = new Array();
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
94
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
95 // Get the length of scenes
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
96 for(i=0;i<len;i++) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
97 var s = scenesNode[i];
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
98 var start = s.getAttribute("start");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
99 var end = s.getAttribute("end");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
100 var ref = s.getAttribute("ref");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
101 var ss = new Object();
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
102
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
103 if (end == null) end = start
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
104 if (max <end) max = end;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
105 ss.node = s;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
106 ss.start = start;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
107 ss.end = end;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
108 ss.ref = ref;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
109 ss.layer = null;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
110 scenes.push(ss);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
111 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
112 if (max < 20) max = 20;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
113 // Collect all layers
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
114 var nodes = xmlDoc.getElementsByTagNameNS("http://www.w3.org/2000/svg","svg")[0].childNodes;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
115 var layers = new Array();
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
116 len = nodes.length;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
117 for(i=0;i<len;i++) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
118 if (nodes[i].localName == 'g') {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
119 var subnodes = nodes[i].childNodes;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
120 for(j=0;j<subnodes.length;j++) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
121 if (subnodes[j].localName == 'g') {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
122 for(var k=0;k<scenes.length;k++) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
123 if (scenes[k].ref == subnodes[j].getAttribute('id')) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
124 scenes[k].layer = nodes[i].getAttribute('id');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
125 break;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
126 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
127 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
128 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
129 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
130 layers.push(nodes[i]);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
131 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
132 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
133 self.layers = layers;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
134 self.scenes = scenes;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
135 self.maxframe = max;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
136 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
137
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
138 function renderUI(mbsvg)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
139 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
140 var layers = mbsvg.layers;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
141 var scenes = mbsvg.scenes;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
142 var max = mbsvg.maxframe;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
143 var cmd = "<table border=1>\n";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
144 cmd = cmd + "<tr><td></td>";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
145 for(var j=1;j<=max;j++)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
146 cmd = cmd + "<td>"+j+"</td>";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
147
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
148 for(var i=layers.length-1;i>=0;i--) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
149 var l = layers[i];
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
150 var id = l.getAttribute('id');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
151 var label = l.getAttribute('inkscape:label');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
152 cmd = cmd + "<tr><td>"+label+"</td>";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
153 for(j=0;j<max;j++) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
154 var empty = 1;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
155 var n = j +1;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
156 var id_str = id+"#"+n
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
157 for(var k=0;k<scenes.length;k++) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
158 if (id != scenes[k].layer) continue;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
159 if (n == scenes[k].start) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
160 cmd = cmd + "<td><img class='normal' src=start.png id='"+id_str+"' onClick='selectCell(this)' /></td>";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
161 empty = 0;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
162 break;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
163 } else if ((n>scenes[k].start)&&(n <= scenes[k].end)) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
164 cmd = cmd + "<td><img class='normal' src=fill.png id='"+id_str+"' onClick='selectCell(this)' /></td>";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
165 empty = 0;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
166 break;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
167 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
168 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
169 if (empty) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
170 cmd = cmd + "<td><img class='normal' src=empty.png id='"+id_str+"'onClick='selectCell(this)' /></td>";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
171 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
172
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
173 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
174 cmd = cmd + "</tr>\n";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
175 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
176 cmd = cmd + "</table>\n";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
177 var frame = document.getElementById('frame');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
178 frame.innerHTML=cmd;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
179 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
180
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
181 function selectCell(obj)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
182 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
183 var id = obj.getAttribute('id');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
184 var layer,n;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
185 var f = id.split('#');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
186 layer=f[0];
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
187 n = f[1];
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
188 var img = obj.getAttribute('src');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
189 var f = img.split('-');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
190
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
191 if (f[0] == 'active')
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
192 return;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
193 else {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
194 obj.setAttribute('src', 'active-'+img);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
195 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
196
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
197 if (last_select != null) {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
198 f = last_select.getAttribute('src').split('-');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
199 last_select.setAttribute('src', f[1]);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
200 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
201 last_select = obj;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
202 currentScene = n;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
203 currentLayer = layer;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
204 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
205
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
206
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
207 function onButtonClick(obj)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
208 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
209 if (isInProgress != 0) return;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
210 var id = obj.getAttribute('id');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
211 if (id == 'Jump') {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
212 if (currentScene != 0)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
213 gotoScene(currentScene);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
214 } else if (id == 'InsertKey') {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
215 InsertKey(currentScene);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
216 } else if (id == 'ExtendScene') {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
217 ExtendScene(currentScene);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
218 } else if (id == 'DeleteScene') {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
219 DeleteScene(currentScene);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
220 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
221 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
222
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
223 function gotoScene_cb(resObj)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
224 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
225
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
226 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
227 var nextScene;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
228 var currentScene = 0;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
229 var currentLayer = '';
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
230 function gotoScene(n)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
231 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
232 nextScene = n;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
233 var soapBody = new SOAPObject("START");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
234 var sr = new SOAPRequest("START", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
235 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
236 SOAPClient.SendRequest(sr, gotoScene1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
237 isInProgress++;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
238 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
239 function gotoScene1(resp,n)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
240 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
241 var soapBody = new SOAPObject("SCENE");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
242 var v1 = new SOAPObject("v1");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
243 v1.val(nextScene);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
244 soapBody.appendChild(v1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
245 var sr = new SOAPRequest("SCENE", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
246 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
247 SOAPClient.SendRequest(sr, gotoScene2);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
248 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
249 function gotoScene2(resp)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
250 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
251 var soapBody = new SOAPObject("PUBLISH");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
252 var sr = new SOAPRequest("PUBLISH", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
253 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
254 SOAPClient.SendRequest(sr, gotoScene3);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
255 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
256
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
257 function gotoScene3(resp)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
258 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
259 isInProgress--;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
260 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
261
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
262
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
263
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
264 function InsertKey(n)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
265 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
266 nextScene = n;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
267 var soapBody = new SOAPObject("START");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
268 var sr = new SOAPRequest("START", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
269 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
270 SOAPClient.SendRequest(sr, InsertKey1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
271 isInProgress++;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
272 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
273 function InsertKey1(resp)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
274 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
275 var soapBody = new SOAPObject("INSERTKEY");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
276 var v1 = new SOAPObject("v1");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
277 v1.attr('type','string');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
278 v1.val(currentLayer);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
279 soapBody.appendChild(v1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
280 var v2 = new SOAPObject("v2");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
281 v2.val(nextScene);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
282 soapBody.appendChild(v2);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
283 var sr = new SOAPRequest("INSERTKEY", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
284 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
285 SOAPClient.SendRequest(sr, RefreshDocument);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
286 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
287 function PublishDocument(resp)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
288 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
289 mbsvg = new MBSVGString(resp.Body[0].GETDOCResponse[0].Result[0].Text);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
290 renderUI(mbsvg);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
291
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
292 var soapBody = new SOAPObject("PUBLISH");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
293 var sr = new SOAPRequest("PUBLISH", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
294 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
295 SOAPClient.SendRequest(sr, OperationDone);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
296 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
297
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
298 function RefreshDocument(resp)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
299 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
300 var soapBody = new SOAPObject("GETDOC");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
301 var sr = new SOAPRequest("GETDOC", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
302 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
303 SOAPClient.SendRequest(sr, PublishDocument);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
304 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
305
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
306 function OperationDone(res)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
307 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
308 isInProgress--;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
309 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
310
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
311
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
312 function ExtendScene()
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
313 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
314 var soapBody = new SOAPObject("START");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
315 var sr = new SOAPRequest("START", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
316 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
317 SOAPClient.SendRequest(sr,ExtendScene1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
318 isInProgress++;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
319 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
320
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
321
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
322 function ExtendScene1(resp)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
323 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
324 var soapBody = new SOAPObject("EXTENDSCENE");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
325 var v1 = new SOAPObject("v1");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
326 v1.attr('type','string');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
327 v1.val(currentLayer);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
328 soapBody.appendChild(v1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
329 var v2 = new SOAPObject("v2");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
330 v2.val(currentScene);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
331 soapBody.appendChild(v2);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
332 var sr = new SOAPRequest("EXTENDSCENE", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
333 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
334 SOAPClient.SendRequest(sr, RefreshDocument);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
335 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
336
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
337
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
338 function DeleteScene()
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
339 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
340 var soapBody = new SOAPObject("START");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
341 var sr = new SOAPRequest("START", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
342 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
343 SOAPClient.SendRequest(sr,DeleteScene1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
344 isInProgress++;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
345 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
346
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
347 function DeleteScene1(resp)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
348 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
349 var soapBody = new SOAPObject("DELETESCENE");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
350 var v1 = new SOAPObject("v1");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
351 v1.attr('type','string');
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
352 v1.val(currentLayer);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
353 soapBody.appendChild(v1);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
354 var v2 = new SOAPObject("v2");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
355 v2.val(currentScene);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
356 soapBody.appendChild(v2);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
357 var sr = new SOAPRequest("EXTENDSCENE", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
358 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
359 SOAPClient.SendRequest(sr, RefreshDocument);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
360
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
361 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
362
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
363 function FetchDocument()
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
364 {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
365 var soapBody = new SOAPObject("START");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
366 var sr = new SOAPRequest("START", soapBody);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
367 SOAPClient.Proxy = "http://localhost:19192/";
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
368 SOAPClient.SendRequest(sr,RefreshDocument);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
369 isInProgress++;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
370 }
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
371
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
372 var last_select = null;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
373 inkscape_load("scene.mbsvg");
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
374 setTimeout("FetchDocument()",4000);
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
375
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
376 $('a.button').mouseover(function () {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
377 if (isInProgress==0)
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
378 this.style.MozOpacity = 0.1;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
379 }).mouseout(function () {
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
380 this.style.MozOpacity= 1;
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
381 });
96aae15527c8 Port all basic scene editor from pyGtk to the firefox
wycc
parents:
diff changeset
382