From d844551fba0af7d2dd5d86b8e75eeef206aead49 Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 30 Jun 2016 17:24:25 +0200 Subject: [PATCH] add a forget button. clean up toolbar a bit --- www/code/main.js | 48 +++++++++++++++++++++++++++++++------------ www/common/toolbar.js | 39 ++++------------------------------- www/pad/main.js | 40 ++++++++++++++++++++++++++++-------- 3 files changed, 71 insertions(+), 56 deletions(-) diff --git a/www/code/main.js b/www/code/main.js index f8bec3387..08e7b2540 100644 --- a/www/code/main.js +++ b/www/code/main.js @@ -183,17 +183,23 @@ define([ var config = { userData: userList, changeNameID: 'cryptpad-changeName', - exportContentID: 'cryptpad-saveContent', - importContentID: 'cryptpad-loadContent', }; toolbar = info.realtime.toolbar = Toolbar.create($bar, info.myID, info.realtime, info.getLag, info.userList, config); createChangeName('cryptpad-changeName', $bar); - /* Let the user export their content with a click */ - $bar.find('#cryptpad-saveContent').click(exportText); + var $rightside = $bar.find('.rtwysiwyg-toolbar-rightside'); - /* Let the user import content with a click */ - $bar.find('#cryptpad-loadContent') + /* add an export button */ + var $export = $(''); - return $container.find('#'+id)[0]; - }; - - var createLoadElement = function (id, $container) { - $container.append(''); - return $container.find('#'+id)[0]; - }; - var checkLag = function (getLag, lagElement) { if(typeof getLag !== "function") { return; } var lag = getLag(); @@ -277,14 +254,6 @@ define([ userListElement = createChangeName($container, userListElement, changeNameID); } - if (saveContentID) { - saveElement = createSaveElement(saveContentID, toolbar.find('.rtwysiwyg-toolbar-rightside')); - } - - if (loadContentID) { - loadElement = createLoadElement(loadContentID, toolbar.find('.rtwysiwyg-toolbar-rightside')); - } - var connected = false; userList.onChange = function(newUserData) { diff --git a/www/pad/main.js b/www/pad/main.js index 4da176d2b..ad27345e4 100644 --- a/www/pad/main.js +++ b/www/pad/main.js @@ -354,27 +354,35 @@ define([ var config = { userData: userList, changeNameID: 'cryptpad-changeName', - exportContentID: 'cryptpad-saveContent', - importContentID: 'cryptpad-loadContent', }; toolbar = info.realtime.toolbar = Toolbar.create($bar, info.myID, info.realtime, info.getLag, info.userList, config); createChangeName('cryptpad-changeName', $bar); - var $saver = $bar.find('#cryptpad-saveContent').click(exportFile); + var $rightside = $bar.find('.rtwysiwyg-toolbar-rightside'); + + /* add an export button */ + var $export = $('