diff --git a/www/common/sframe-app-framework.js b/www/common/sframe-app-framework.js index e99cc4187..869f079d3 100644 --- a/www/common/sframe-app-framework.js +++ b/www/common/sframe-app-framework.js @@ -572,7 +572,9 @@ define([ if (!readOnly) { onLocal(); } evOnReady.fire(newPad); - common.openPadChat(onLocal); + // In forms, only editors can see the chat + if (!readOnly || type !== 'form') { common.openPadChat(onLocal); } + if (!readOnly && cursorGetter) { common.openCursorChannel(onLocal); cursor = common.createCursor(onLocal); diff --git a/www/common/toolbar.js b/www/common/toolbar.js index 26ff870f6..785d1bc7e 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -166,6 +166,7 @@ MessengerUI, Messages, Pages) { var showColors = false; var updateUserList = function (toolbar, config, forceOffline) { if (!config.displayed || config.displayed.indexOf('userlist') === -1) { return; } + if (toolbar.isAlone) { return; } // Make sure the elements are displayed var $userButtons = toolbar.userlist; var $userlistContent = toolbar.userlistContent; @@ -1216,6 +1217,7 @@ MessengerUI, Messages, Pages) { if (!config.metadataMgr) { return; } var metadataMgr = config.metadataMgr; var notify = function(type, name, oldname) { + if (toolbar.isAlone) { return; } // type : 1 (+1 user), 0 (rename existing user), -1 (-1 user) if (typeof name === "undefined") { return; } name = name || Messages.anonymous; @@ -1515,6 +1517,15 @@ MessengerUI, Messages, Pages) { } }; + // disable notification, userlist and chat + toolbar.alone = function () { + toolbar.userlist.hide(); + toolbar.chat.hide(); + $('.cp-toolbar-userlist-drawer').remove(); + $('.cp-toolbar-chat-drawer').remove(); + toolbar.isAlone = true; + }; + // On log out, remove permanently the realtime elements of the toolbar Common.onLogout(function () { failed(); diff --git a/www/form/inner.js b/www/form/inner.js index 8940ce2a7..fa62de74b 100644 --- a/www/form/inner.js +++ b/www/form/inner.js @@ -2000,7 +2000,7 @@ define([ ]; $invalid.empty().append(content); }); - evOnChange.fire(); + evOnChange.fire(true); } return h('div.cp-form-send-container', [ @@ -2022,7 +2022,8 @@ define([ var _answers = Util.clone(answers || {}); delete _answers._proof; delete _answers._userdata; - evOnChange.reg(function () { + evOnChange.reg(function (noBeforeUnload) { + if (noBeforeUnload) { return; } var results = getFormResults(); if (!answers || Sortify(_answers) !== Sortify(results)) { window.onbeforeunload = function () { @@ -2397,6 +2398,9 @@ define([ var helpMenu = framework._.sfCommon.createHelpMenu(['text', 'pad']); $toolbarContainer.after(helpMenu.menu); + if (!APP.isEditor) { + framework._.toolbar.alone(); + } var makeFormSettings = function () { // Private / public status