diff inkscape/firefox/content/inkscape.js @ 361:8c4456190d9a

Add text editor support to edit C source file inside the MadBuilder
author wycc
date Wed, 11 Mar 2009 08:51:11 +0800
parents b4bd4819091c
children 83cae12cf428
line wrap: on
line diff
--- a/inkscape/firefox/content/inkscape.js	Wed Mar 11 08:50:40 2009 +0800
+++ b/inkscape/firefox/content/inkscape.js	Wed Mar 11 08:51:11 2009 +0800
@@ -57,6 +57,19 @@
              return obj;
       }
 }
+
+/**
+ *   TextEditor class
+ *
+ */
+
+function Inkscape(file) 
+{
+	var editor = document.getElementById('editor');
+	editor.innerHTML = "<embed src="+file+" width=700 height=700 />";
+	this.isInProgress = 0;
+}
+
 /**
  *   Inkscape class
  *
@@ -441,6 +454,17 @@
 {
 	var file = node.textContent;
 	inkscape = new Inkscape("file://"+file);
+	$('#inkscape').show('slow');
+	$('#editor').hide('slow');
+}
+
+
+function project_loadEditor(node)
+{
+	var file = node.textContent;
+	editor = new TextEditor(file);
+	$('#inkscape').hide('slow');
+	$('#editor').show('slow');
 }
 
 function project_parse(xml)