From c8a9afb6c8a845c9793e4bccebd13c458e622e46 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Nov 2017 15:09:53 +0100 Subject: [PATCH 1/6] remove duplicate loading screen --- www/todo/inner.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/www/todo/inner.js b/www/todo/inner.js index e7391c50d..d9b0fca3e 100644 --- a/www/todo/inner.js +++ b/www/todo/inner.js @@ -186,8 +186,6 @@ define([ }; var onInit = function () { - UI.addLoadingScreen(); - $body.on('dragover', function (e) { e.preventDefault(); }); $body.on('drop', function (e) { e.preventDefault(); }); From d726c95f0b9390af98b63980dfe7952606f7493c Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Nov 2017 15:10:28 +0100 Subject: [PATCH 2/6] fix namespace collision --- www/contacts/inner.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/www/contacts/inner.js b/www/contacts/inner.js index 8298354ac..1606ff622 100644 --- a/www/contacts/inner.js +++ b/www/contacts/inner.js @@ -9,6 +9,7 @@ define([ '/contacts/messenger-ui.js', '/common/sframe-messenger-inner.js', '/customize/messages.js', + '/common/common-interface.js', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', @@ -21,9 +22,10 @@ define([ nThen, SFCommon, h, - UI, + MessengerUI, Messenger, - Messages + Messages, + UI ) { var APP = {}; @@ -73,7 +75,7 @@ define([ var messenger = Messenger.create(sFrameChan); - UI.create(messenger, $(friendList), $(messaging), common); + MessengerUI.create(messenger, $(friendList), $(messaging), common); UI.removeLoadingScreen(); From 9d662bd337c192720c1fc7654fda74383527ab1e Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Nov 2017 15:21:37 +0100 Subject: [PATCH 3/6] fix right-click pad creation in drive --- www/drive/inner.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/drive/inner.js b/www/drive/inner.js index 917ac22d2..957d44932 100644 --- a/www/drive/inner.js +++ b/www/drive/inner.js @@ -2695,8 +2695,10 @@ define([ } else if ($(this).hasClass("cp-app-drive-context-newdoc")) { var type = $(this).data('type') || 'pad'; - sessionStorage[Cryptpad.newPadPathKey] = filesOp.isPathIn(currentPath, [TRASH]) ? '' : currentPath; - window.open(APP.origin + '/' + type + '/'); + var path2 = filesOp.isPathIn(currentPath, [TRASH]) ? '' : currentPath; + common.sessionStorage.put(Cryptpad.newPadPathKey, path2, function () { + common.openURL('/' + type + '/'); + }); } APP.hideMenu(); }); From 4ffb59dce9bc17d281c643091de97e54b72d8e3d Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Nov 2017 15:47:06 +0100 Subject: [PATCH 4/6] bump to version 1.21.0 --- customize.dist/pages.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index d38f854a9..8b4a573c3 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -76,7 +76,7 @@ define([ ]) ]) ]), - h('div.cp-version-footer', "CryptPad v1.20.0 (Unicorn)") + h('div.cp-version-footer', "CryptPad v1.21.0 (Vampire)") ]); }; diff --git a/package.json b/package.json index 88b3b1f13..7365de287 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "cryptpad", "description": "realtime collaborative visual editor with zero knowlege server", - "version": "1.20.0", + "version": "1.21.0", "dependencies": { "chainpad-server": "^1.0.1", "express": "~4.10.1", From 8150abddbe539cb23aa594a1d210d3ab3bce1270 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Nov 2017 15:52:21 +0100 Subject: [PATCH 5/6] remove dead code from pages.js --- customize.dist/pages.js | 45 -------------------------------------- customize.dist/template.js | 3 +-- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 8b4a573c3..6868418cc 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -49,11 +49,6 @@ define([ h('p', Msg.main_footerText) ]) ], ''), - /* footerCol(null, [ - footLink('/about.html', 'about'), - footLink('/terms.html', 'terms'), - footLink('/privacy.html', 'privacy'), - ], 'CryptPad'),*/ footerCol('footer_applications', [ footLink('/drive/', 'main_drive'), footLink('/pad/', 'main_richText'), @@ -690,45 +685,5 @@ define([ ]; }; - Pages['/drive/'] = Pages['/drive/index.html'] = function () { - return loadingScreen(); - }; - - Pages['/file/'] = Pages['/file/index.html'] = function () { - return loadingScreen(); - }; - - Pages['/contacts/'] = Pages['/contacts/index.html'] = function () { - return loadingScreen(); - }; - - Pages['/pad/'] = Pages['/pad/index.html'] = function () { - return loadingScreen(); - }; - - Pages['/code/'] = Pages['/code/index.html'] = function () { - return loadingScreen(); - }; - - Pages['/slide/'] = Pages['/slide/index.html'] = function () { - return loadingScreen(); - }; - - Pages['/invite/'] = Pages['/invite/index.html'] = function () { - return loadingScreen(); - }; - - Pages['/settings/'] = Pages['/settings/index.html'] = function () { - return loadingScreen(); - }; - - Pages['/profile/'] = Pages['/profile/index.html'] = function () { - return loadingScreen(); - }; - - Pages['/todo/'] = Pages['/todo/index.html'] = function () { - return loadingScreen(); - }; - return Pages; }); diff --git a/customize.dist/template.js b/customize.dist/template.js index a6cf1797a..2aed683ce 100644 --- a/customize.dist/template.js +++ b/customize.dist/template.js @@ -1,11 +1,10 @@ define([ 'jquery', '/common/hyperscript.js', - '/common/cryptpad-common.js', '/customize/pages.js', 'less!/bower_components/components-font-awesome/css/font-awesome.min.css', -], function ($, h, Cryptpad, Pages) { +], function ($, h, Pages) { $(function () { var $body = $('body'); var isMainApp = function () { From 585f9d2e4e4a28baab5cfc1c2a755efac4acda96 Mon Sep 17 00:00:00 2001 From: ansuz Date: Tue, 21 Nov 2017 17:19:35 +0100 Subject: [PATCH 6/6] repair broken 'clear channel' button --- www/common/common-messenger.js | 7 +++++++ www/common/sframe-common-outer.js | 7 +++++++ www/common/sframe-messenger-inner.js | 6 ++++++ www/common/sframe-protocol.js | 1 + www/contacts/messenger-ui.js | 3 ++- 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/www/common/common-messenger.js b/www/common/common-messenger.js index 5e4a714a8..406b27482 100644 --- a/www/common/common-messenger.js +++ b/www/common/common-messenger.js @@ -633,6 +633,13 @@ define([ }); }; + messenger.clearOwnedChannel = function (channel, cb) { + common.clearOwnedChannel(channel, function (e) { + if (e) { return void cb(e); } + cb(); + }); + }; + // TODO listen for changes to your friend list // emit 'update' events for clients diff --git a/www/common/sframe-common-outer.js b/www/common/sframe-common-outer.js index 5d8fb5524..504f97f16 100644 --- a/www/common/sframe-common-outer.js +++ b/www/common/sframe-common-outer.js @@ -559,6 +559,13 @@ define([ }); }); }); + sframeChan.on('Q_CONTACTS_CLEAR_OWNED_CHANNEL', function (channel, cb) { + messenger.clearOwnedChannel(channel, function (e) { + cb({ + error: e, + }); + }); + }); messenger.on('message', function (message) { sframeChan.event('EV_CONTACTS_MESSAGE', message); diff --git a/www/common/sframe-messenger-inner.js b/www/common/sframe-messenger-inner.js index 9f2ed24a4..67532b015 100644 --- a/www/common/sframe-messenger-inner.js +++ b/www/common/sframe-messenger-inner.js @@ -108,6 +108,12 @@ define([], function () { }); }; + messenger.clearOwnedChannel = function (channel, cb) { + sFrameChan.query('Q_CONTACTS_CLEAR_OWNED_CHANNEL', channel, function (e) { + cb(e); + }); + }; + return messenger; }; diff --git a/www/common/sframe-protocol.js b/www/common/sframe-protocol.js index 0aedccde1..3f4e56b19 100644 --- a/www/common/sframe-protocol.js +++ b/www/common/sframe-protocol.js @@ -156,6 +156,7 @@ define({ 'Q_CONTACTS_GET_MORE_HISTORY': true, 'Q_CONTACTS_SEND_MESSAGE': true, 'Q_CONTACTS_SET_CHANNEL_HEAD': true, + 'Q_CONTACTS_CLEAR_OWNED_CHANNEL': true, // Put one or more entries to the localStore which will go in localStorage. 'EV_LOCALSTORE_PUT': true, diff --git a/www/contacts/messenger-ui.js b/www/contacts/messenger-ui.js index 0e698d8ce..988e74f43 100644 --- a/www/contacts/messenger-ui.js +++ b/www/contacts/messenger-ui.js @@ -176,7 +176,8 @@ define([ $(removeHistory).click(function () { UI.confirm(Messages.contacts_confirmRemoveHistory, function (yes) { if (!yes) { return; } - Cryptpad.clearOwnedChannel(data.channel, function (e) { + + messenger.clearOwnedChannel(data.channel, function (e) { if (e) { console.error(e); UI.alert(Messages.contacts_removeHistoryServerError);