');
+ $('animation_list').html(html.join("\n"));
+ dialog.show();
+}
+
+
Inkscape.prototype.loadSymbolScreen=function (mbsvg) {
// Swap the left side to be the SVG element tree.
var i,l;
@@ -352,6 +394,8 @@
function MBSVG_loadFromDoc(self,xmlDoc)
{
+ var top = xmlDoc.getElementsByTagNameNS("http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd","scenes")[0];
+ self.current = top.getAttribute("current");
var scenesNode = xmlDoc.getElementsByTagNameNS("http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd","scene");
if (scenesNode == null) {
alert('This is not a valid scene file');
@@ -465,6 +509,65 @@
}
+
+/**
+ * Return a new XML document that all objects which is not in the current scene are deleted.
+ *
+ * This function will traverse all scenes. For each scene which is not in the current scene, we will delete the reference group.
+ */
+
+function deepcopy(obj)
+{
+ var seenObjects = [];
+ var mappingArray = [];
+ var f = function(simpleObject) {
+ var indexOf = seenObjects.indexOf(simpleObject);
+ if (indexOf == -1) {
+ switch (Ext.type(simpleObject)) {
+ case 'object':
+ seenObjects.push(simpleObject);
+ var newObject = {};
+ mappingArray.push(newObject);
+ for (var p in simpleObject)
+ newObject[p] = f(simpleObject[p]);
+ newObject.constructor = simpleObject.constructor;
+ return newObject;
+
+ case 'array':
+ seenObjects.push(simpleObject);
+ var newArray = [];
+ mappingArray.push(newArray);
+ for(var i=0,len=simpleObject.length; i this.current || scenes[i].end < this.current) {
+ var obj = newcopy.find('#'+scenes[i].ref);
+ obj.remove();
+ }
+ }
+ return newcopy;
+}
+
+
/**
* UI for madbuilder.html to build the scene editor
*/
@@ -521,6 +624,19 @@
project_run();
} else {
}
+ } else if (id == 'Open') {
+ filedialog = jQuery('#filedialog');
+ filedialog.dialog({width:500,
+ modal: true,
+ autoOpen:false,
+ title:'Please select a file'});
+ filedialog.show();
+ filedialog.html('Please select the project file ');
+ filedialog.append('');
+ filedialog.append('');
+ filedialog.dialog("open");
+ } else if (id == 'EditAnimation') {
+ inkscape.editAnimation();
} else {
alert(id+' has not been implemented yet');
}
@@ -930,6 +1046,7 @@
function loadOldProject()
{
+ return -1;
var f = system_open_read("/tmp/madbuilder.ws");
if (f == null) return -1;
var s = f.read(f.available());
@@ -948,26 +1065,3 @@
}
-var last_select = null;
-var wizard = new Wizard();
-wizard.cb = onLoadProject;
-$('#filedialog').dialog({ width:500});
-jQuery(document).ready(function() {
- if (loadOldProject()) {
- filedialog = jQuery('#filedialog');
- filedialog.dialog({width:500,
- modal: true,
- autoOpen:false,
- title:'Please select a file'});
- filedialog.show();
- filedialog.html('Please select the project file ');
- filedialog.append('');
- filedialog.append('');
- filedialog.dialog("open");
- }
- });
-
-$('#frame').draggable();
-$('#btns').draggable({cursor:'crosshair'});
-$('#list').tabs();
-$('#display').tabs();
diff -r f3e6ac47752c -r 45e04408fc19 inkscape/firefox/content/madbuilder.html
--- a/inkscape/firefox/content/madbuilder.html Fri Apr 10 22:46:01 2009 +0800
+++ b/inkscape/firefox/content/madbuilder.html Sun Apr 12 11:58:53 2009 +0800
@@ -10,6 +10,9 @@
+
+
+
@@ -67,32 +73,37 @@
TestSaveWizard
+ Open