# HG changeset patch
# User wycc
# Date 1236729150 -28800
# Node ID 50d33c3987ba81c4aeaed89579773b3e82db7b8d
# Parent 6fd8da22a5efae15d149f43db42343ec6c6f56e1
Add loader for project file.
diff -r 6fd8da22a5ef -r 50d33c3987ba inkscape/firefox/content/inkscape.js
--- a/inkscape/firefox/content/inkscape.js Wed Mar 11 01:32:09 2009 +0800
+++ b/inkscape/firefox/content/inkscape.js Wed Mar 11 07:52:30 2009 +0800
@@ -393,28 +393,16 @@
}
-function openFile()
-{
- alert('bug');
- $.modal('
My data
');
- alert('done');
-}
+
-var last_select = null;
-$('#inkscape').html('Please select the project file
');
-$('#inkscape').append('');
-$('#inkscape').append('');
-
-
-function loadFile()
+function loadInkscapeFile()
{
ele = $('#mbsvg');
file = ele.attr('value');
inkscape = new Inkscape("file://"+file);
- var tree = $.tree_create();
file1_animation = [
{
attributes: {id:"an1-1"},
@@ -446,18 +434,68 @@
sources = [src1,src2,src3];
- tree.init($("#filelist"), {
- data: {
- type: "json",
- json : {
- attributes: {id: "prj"}, state: "open", data: "Project",
- children: [
- { attributes:{id:"scenes"}, data:"scene", children: scenes},
- { attributes:{id:"sources"},data:"sources",children: sources}
- ]
- }
- },
- ui : {
+}
+
+
+function project_parse(xml)
+{
+
+ var xmlParser = new DOMParser();
+ var xmlDoc = xmlParser.parseFromString( xml, 'text/xml');
+ var scenesNode = xmlDoc.getElementsByTagName("scene");
+ if (scenesNode == null) {
+ alert('This is not a valid scene file');
+ }
+ var len = scenesNode.length;
+ var i,j;
+ var max = 0;
+ var scenes = new Array();
+
+ // Get the length of scenes
+ for(i=0;i');
+$('#inkscape').append('');
+$('#inkscape').append('');
diff -r 6fd8da22a5ef -r 50d33c3987ba inkscape/firefox/helper_mb.py
--- a/inkscape/firefox/helper_mb.py Wed Mar 11 01:32:09 2009 +0800
+++ b/inkscape/firefox/helper_mb.py Wed Mar 11 07:52:30 2009 +0800
@@ -110,10 +110,15 @@
return d
except:
traceback.print_exc()
-
-
-
-
+ def soap_GETPRJ(self,prj):
+ try:
+ f = open(prj,"r")
+ l = f.read()
+ f.close()
+ return l
+ except:
+ traceback.print_exc()
+
class Client(object):
def __init__(self):
self.proxy = soap.Proxy('http://localhost:8080')