# HG changeset patch # User wycc # Date 1236706329 -28800 # Node ID 6fd8da22a5efae15d149f43db42343ec6c6f56e1 # Parent 3e84458968ec776fb83a673647fc4a7f8cf84b53 Implement scene file load function. diff -r 3e84458968ec -r 6fd8da22a5ef inkscape/firefox/content/inkscape.js --- a/inkscape/firefox/content/inkscape.js Mon Mar 09 23:05:57 2009 +0800 +++ b/inkscape/firefox/content/inkscape.js Wed Mar 11 01:32:09 2009 +0800 @@ -382,11 +382,39 @@ var currentScene = 0; var currentLayer = ''; -var last_select = null; -inkscape = new Inkscape("scene.mbsvg"); + +function dump(n) +{ + cmd = ""; + for(k in n) { + cmd = cmd + k+"="+n[k]+"\n"; + } + alert(cmd); +} - tree = $.tree_create(); +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() +{ + ele = $('#mbsvg'); + file = ele.attr('value'); + inkscape = new Inkscape("file://"+file); + + var tree = $.tree_create(); file1_animation = [ { attributes: {id:"an1-1"}, @@ -422,11 +450,38 @@ data: { type: "json", json : { - attributes: {id: "node0"}, state: "open", data: "Project", children: [ + attributes: {id: "prj"}, state: "open", data: "Project", + children: [ { attributes:{id:"scenes"}, data:"scene", children: scenes}, { attributes:{id:"sources"},data:"sources",children: sources} ] } - } + }, + ui : { + context : [ + { + id: "Open", + label: "Open", + icon: "open.png", + visible: function(NODE,TREE_OBJ) { if(NODE.length != 1) return false; return NODE[0].id == "prj";}, + action: function(NODE,TREE_OBJ) { openFile(TREE_OBJ);} + }, + { + id: "New", + label: "New", + icon: "create.png", + visible: function(NODE,TREE_OBJ) { if(NODE.length != 1) return false; return NODE[0].id == "prj";}, + action: function(NODE,TREE_OBJ) { alert("open is not support yet");} + }, + { + id: "Rename", + label: "Rename", + icon: "rename.png", + visible: function(NODE,TREE_OBJ) { if(NODE.length != 1) return false; return NODE[0].id == "prj";}, + action: function(NODE,TREE_OBJ) { alert("open is not support yet");} + }, + ] + }, + }); - +} diff -r 3e84458968ec -r 6fd8da22a5ef inkscape/firefox/content/madbuilder.html --- a/inkscape/firefox/content/madbuilder.html Mon Mar 09 23:05:57 2009 +0800 +++ b/inkscape/firefox/content/madbuilder.html Wed Mar 11 01:32:09 2009 +0800 @@ -7,6 +7,8 @@ + +