From b2e6df1f9d17033532339c229f751acd33e3215a Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 21 Aug 2017 15:34:21 +0200 Subject: [PATCH] Add import & export in pad2 --- www/common/sframe-common.js | 2 +- www/pad2/main.js | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/www/common/sframe-common.js b/www/common/sframe-common.js index 113e6e733..a2677a4b7 100644 --- a/www/common/sframe-common.js +++ b/www/common/sframe-common.js @@ -112,7 +112,7 @@ define([ if (callback) { button .click(prepareFeedback(type)) - .click(UI.importContent('text/plain', function (content, file) { + .click(Cryptpad.importContent('text/plain', function (content, file) { callback(content, file); }, {accept: data ? data.accept : undefined})); } diff --git a/www/pad2/main.js b/www/pad2/main.js index 8a438d54e..44d17883f 100644 --- a/www/pad2/main.js +++ b/www/pad2/main.js @@ -528,6 +528,18 @@ define([ $('.cke_toolbox_main').hide(); } + /* add an export button */ + var $export = Cryptpad.createButton('export', true, {}, exportFile); + $drawer.append($export); + + if (!readOnly) { + /* add an import button */ + var $import = Cryptpad.createButton('import', true, { + accept: 'text/html' + }, importFile); + $drawer.append($import); + } + /* add a forget button */ var forgetCb = function (err) { if (err) { return; } @@ -640,16 +652,16 @@ define([ } /* add an export button */ - var $export = Cryptpad.createButton('export', true, {}, exportFile); + /*var $export = Cryptpad.createButton('export', true, {}, exportFile); $drawer.append($export); - - if (!readOnly) { +*/ + //if (!readOnly) { /* add an import button */ - var $import = Cryptpad.createButton('import', true, { + /* var $import = Cryptpad.createButton('import', true, { accept: 'text/html' }, importFile); $drawer.append($import); - } + }*/ /* add a forget button */ /* var forgetCb = function (err) {