diff --git a/customize.dist/pages.js b/customize.dist/pages.js index d38f854a9..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'), @@ -76,7 +71,7 @@ define([ ]) ]) ]), - h('div.cp-version-footer', "CryptPad v1.20.0 (Unicorn)") + h('div.cp-version-footer', "CryptPad v1.21.0 (Vampire)") ]); }; @@ -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 () { 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", 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/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(); 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); 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(); });