diff options
author | Florian Hülsmann <fh@cbix.de> | 2012-03-31 00:05:36 +0400 |
---|---|---|
committer | Florian Hülsmann <fh@cbix.de> | 2012-03-31 00:05:36 +0400 |
commit | 25ac335cce6ef4eb858b9612860ef9eca7e0754b (patch) | |
tree | 50f88ee89eb642f2a09a547cd005de5e120b7c51 /files_svgedit | |
parent | ed92bca4ef8f4b6888e7ca69fcdb207e01856c99 (diff) |
partial revert
Diffstat (limited to 'files_svgedit')
-rw-r--r-- | files_svgedit/js/ocsvgEditor.js | 29 | ||||
-rw-r--r-- | files_svgedit/templates/editor.php | 2 |
2 files changed, 24 insertions, 7 deletions
diff --git a/files_svgedit/js/ocsvgEditor.js b/files_svgedit/js/ocsvgEditor.js index dca809e59..b99e9d7e6 100644 --- a/files_svgedit/js/ocsvgEditor.js +++ b/files_svgedit/js/ocsvgEditor.js @@ -86,12 +86,11 @@ var ocsvg = { }; $(document).ready(function() { - /* // set control buttons' onclick handlers: $('#ocsvgBtnSave').click(function() { svgCanvas.getSvgString()(ocsvg.save); }); - */ + // import file ocsvg.setFileContents(ocsvgFile.contents); ocsvg.setFilePath(ocsvgFile.path); @@ -110,10 +109,9 @@ $(document).ready(function() { svgCanvas = new embedded_svg_edit(frame); // hide main menu button, then shift the tool bar to the left border: - //ocsvg.frameDoc.find('#main_button').hide().next().css('left', 0).css('padding-left', 2).css('padding-top', 2); + ocsvg.frameDoc.find('#main_button').hide().next().css('left', 0).css('padding-left', 2).css('padding-top', 2); // fix broken color select field ocsvg.frameDoc.find('#fill_color,#stroke_color').find('svg').css('height', '100%'); - /* // set handler for show preferences button: //$('#ocsvgBtnPrefs').click(ocsvg.showPreferences); $('#ocsvgBtnPrefs').click(function() { @@ -123,7 +121,7 @@ $(document).ready(function() { ocsvg.frameDoc.find('#tool_prefs_cancel').click(function() { ocsvg.frameDoc.find('#svg_prefs').hide(); }); - */ + svgCanvas.setSvgString(ocsvg.currentFile.filecontents)(function(data, error) { if(error) { alert("Could not load file!\n\n" + error); @@ -131,3 +129,24 @@ $(document).ready(function() { }); }); }); +/* +$(document).ready(function() { + // Load specified file's contents into editor and set attributes: + ocsvg.fileContents = ocsvgFile.contents; + svgEditor.loadFromString(ocsvg.fileContents); + ocsvg.setFilePath(ocsvgFile.path); + ocsvg.setFileMTime(ocsvgFile.mtime); + ocsvg.setEditorSize(); + $(window).resize(function() { + ocsvg.setEditorSize(); + }); + // overwrite saveHandler: + /*svgEditor.setConfig({ + saveHandler: ocsvg.save + });*//* + svgEditor.addExtension("OCSVG Handlers", function() { + svgCanvas.bind('saved', ocsvg.save); + return {}; + }); +}); +*/ diff --git a/files_svgedit/templates/editor.php b/files_svgedit/templates/editor.php index 28517bec0..7f7c027b4 100644 --- a/files_svgedit/templates/editor.php +++ b/files_svgedit/templates/editor.php @@ -15,12 +15,10 @@ var ocsvgFile = { }; //--> </script> -<!-- <div id="controls"> <input type="button" id="ocsvgBtnSave" value="<?php echo $l->t('Save'); ?>" /> <input type="button" id="ocsvgBtnPrefs" value="<?php echo $l->t('Preferences'); ?>" /> </div> ---> <div id="editor"> <iframe src="<?php echo OC_Helper::linkTo('files_svgedit', 'svg-edit/svg-editor.html'); ?>" id="svgedit"></iframe> </div> |