Mercurial > MadButterfly
changeset 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 | b4f74753d125 |
children | 83cae12cf428 |
files | inkscape/firefox/content/inkscape.js inkscape/firefox/content/madbuilder.html |
diffstat | 2 files changed, 25 insertions(+), 1 deletions(-) [+] |
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)
--- a/inkscape/firefox/content/madbuilder.html Wed Mar 11 08:50:40 2009 +0800 +++ b/inkscape/firefox/content/madbuilder.html Wed Mar 11 08:51:11 2009 +0800 @@ -65,7 +65,7 @@ <br/> </div> <table> - <tr><td width=200 height=700 valign=top><div id='filelist' valign=top></div></td><td width=700 height=700 valign=top> <div id='inkscape'></div></td></tr> + <tr><td width=200 height=700 valign=top><div id='filelist' valign=top></div></td><td width=700 height=700 valign=top> <div id='inkscape'></div><div id='editor'></div></td></tr> </table> <script type="text/javascript" src="inkscape.js" > </script>