From a0c4058686cdf7c0a88b078c01a615d78d38fef2 Mon Sep 17 00:00:00 2001 From: JohnSmith-LT Date: Tue, 20 May 2014 13:42:51 +0100 Subject: [PATCH] REFACTOR: Code moved around into 'modules' to make it a bit more organised. Needs more comments. --- editor/js/application.js | 564 +++++++++++++------------------------ editor/js/data.js | 57 ++++ editor/js/layout.js | 129 +++++++++ editor/js/toolbox.js | 487 ++++++++++++++++++++++++++++++++ editor/js/tree.js | 370 ++++++++++++++++++++++++ modules/xerte/edithtml.php | 6 +- 6 files changed, 1248 insertions(+), 365 deletions(-) create mode 100644 editor/js/data.js create mode 100644 editor/js/layout.js create mode 100644 editor/js/toolbox.js create mode 100644 editor/js/tree.js diff --git a/editor/js/application.js b/editor/js/application.js index 10ac9c52b0..ccd42ea813 100755 --- a/editor/js/application.js +++ b/editor/js/application.js @@ -2,385 +2,223 @@ var wizard_data = {}; var lo_data = {}; var menu_data = []; -jQuery(document).ready(function($) { - - var init = function() { - - //top buttons - (function() { - $( "#insert-dialog" ).hide(); - $( "#insert-buttons" ).hide(); - - var insert_page = function() { - $( "#insert-dialog" ).dialog({ width: '60%' }); - }, - - delete_page = function() { - deleteSelectedNodes(); - }, - - duplicate_page = function() { - duplicateSelectedNodes(); - }, - - buttons = $('
').attr('id', 'top_buttons'); - $([ - {name:'Insert', icon:'editor/img/insert.png', id:'insert_button', click:insert_page}, - {name:'Copy', icon:'editor/img/copy.png', id:'copy_button', click:duplicate_page}, - {name:'Delete', icon:'editor/img/delete.gif', id:'delete_button', click:delete_page} - ]) - .each(function(index, value) { - var button = $('