don't show the help menu in embed mode

pull/1/head
ansuz 5 years ago
parent 0469f6b94b
commit 264f4950bd

@ -418,12 +418,9 @@ define([
var $content = $('#cp-app-code-preview-content'); var $content = $('#cp-app-code-preview-content');
mkPrintButton(framework, $content, $print); mkPrintButton(framework, $content, $print);
// XXX don't display the help menu in embed mode? if (!privateData.isEmbed) {
// metadataMgr.getPrivateData().isEmbed
// do the same in all other apps
// pad, code, oo, slide, poll, whiteboard, kanban
// OR do it in a more generic way...
mkHelpMenu(framework); mkHelpMenu(framework);
}
var evModeChange = Util.mkEvent(); var evModeChange = Util.mkEvent();
evModeChange.reg(previewPane.modeChange); evModeChange.reg(previewPane.modeChange);

@ -1557,7 +1557,9 @@ define([
}; };
config.onInit = function (info) { config.onInit = function (info) {
readOnly = metadataMgr.getPrivateData().readOnly; var privateData = metadataMgr.getPrivateData();
readOnly = privateData.readOnly;
Title = common.createTitle({}); Title = common.createTitle({});
@ -1594,7 +1596,7 @@ define([
var $exportXLSX = common.createButton('export', true, {}, exportXLSXFile); var $exportXLSX = common.createButton('export', true, {}, exportXLSXFile);
$exportXLSX.appendTo(toolbar.$drawer); $exportXLSX.appendTo(toolbar.$drawer);
var type = common.getMetadataMgr().getPrivateData().ooType; var type = privateData.ooType;
var accept = [".bin", ".ods", ".xlsx"]; var accept = [".bin", ".ods", ".xlsx"];
if (type === "ooslide") { if (type === "ooslide") {
accept = ['.bin', '.odp', '.pptx']; accept = ['.bin', '.odp', '.pptx'];
@ -1620,10 +1622,12 @@ define([
}); });
toolbar.$drawer.append($forget); toolbar.$drawer.append($forget);
if (!privateData.isEmbed) {
var helpMenu = APP.helpMenu = common.createHelpMenu(['beta', 'oo']); var helpMenu = APP.helpMenu = common.createHelpMenu(['beta', 'oo']);
$('#cp-app-oo-editor').prepend(common.getBurnAfterReadingWarning()); $('#cp-app-oo-editor').prepend(common.getBurnAfterReadingWarning());
$('#cp-app-oo-editor').prepend(helpMenu.menu); $('#cp-app-oo-editor').prepend(helpMenu.menu);
toolbar.$drawer.append(helpMenu.button); toolbar.$drawer.append(helpMenu.button);
}
var $properties = common.createButton('properties', true); var $properties = common.createButton('properties', true);
toolbar.$drawer.append($properties); toolbar.$drawer.append($properties);

@ -962,7 +962,10 @@ define([
var kanban; var kanban;
var $container = $('#cp-app-kanban-content'); var $container = $('#cp-app-kanban-content');
var privateData = framework._.cpNfInner.metadataMgr.getPrivateData();
if (!privateData.isEmbed) {
mkHelpMenu(framework); mkHelpMenu(framework);
}
if (framework.isReadOnly()) { if (framework.isReadOnly()) {
$container.addClass('cp-app-readonly'); $container.addClass('cp-app-readonly');

@ -533,7 +533,9 @@ define([
} }
}; };
if (!privateData.isEmbed) {
mkHelpMenu(framework); mkHelpMenu(framework);
}
framework._.sfCommon.getAttribute(['pad', 'width'], function(err, data) { framework._.sfCommon.getAttribute(['pad', 'width'], function(err, data) {
var active = data || typeof(data) === "undefined"; var active = data || typeof(data) === "undefined";

@ -1160,8 +1160,9 @@ define([
var $properties = common.createButton('properties', true); var $properties = common.createButton('properties', true);
$drawer.append($properties); $drawer.append($properties);
var privateData = metadataMgr.getPrivateData();
/* save as template */ /* save as template */
if (!metadataMgr.getPrivateData().isTemplate && common.isLoggedIn()) { if (!privateData.isTemplate && common.isLoggedIn()) {
var templateObj = { var templateObj = {
rt: info.realtime, rt: info.realtime,
getTitle: function () { return metadataMgr.getMetadata().title; } getTitle: function () { return metadataMgr.getMetadata().title; }
@ -1177,10 +1178,13 @@ define([
var $export = common.createButton('export', true, {}, exportFile); var $export = common.createButton('export', true, {}, exportFile);
$drawer.append($export); $drawer.append($export);
var helpMenu = common.createHelpMenu(['poll']);
$('#cp-app-poll-form').prepend(common.getBurnAfterReadingWarning()); $('#cp-app-poll-form').prepend(common.getBurnAfterReadingWarning());
if (!privateData.isEmbed) {
var helpMenu = common.createHelpMenu(['poll']);
$('#cp-app-poll-form').prepend(helpMenu.menu); $('#cp-app-poll-form').prepend(helpMenu.menu);
$drawer.append(helpMenu.button); $drawer.append(helpMenu.button);
}
if (APP.readOnly) { publish(true); return; } if (APP.readOnly) { publish(true); return; }
var $publish = common.createButton('', true, { var $publish = common.createButton('', true, {
@ -1283,6 +1287,7 @@ define([
}).nThen(function (/* waitFor */) { }).nThen(function (/* waitFor */) {
Test.registerInner(common.getSframeChannel()); Test.registerInner(common.getSframeChannel());
var metadataMgr = common.getMetadataMgr(); var metadataMgr = common.getMetadataMgr();
APP.locked = APP.readOnly = metadataMgr.getPrivateData().readOnly; APP.locked = APP.readOnly = metadataMgr.getPrivateData().readOnly;
APP.loggedIn = common.isLoggedIn(); APP.loggedIn = common.isLoggedIn();
APP.SFCommon = common; APP.SFCommon = common;

@ -499,7 +499,10 @@ define([
mkColorConfiguration(framework, $modal); mkColorConfiguration(framework, $modal);
mkFilePicker(framework, editor); mkFilePicker(framework, editor);
mkSlidePreviewPane(framework, $contentContainer); mkSlidePreviewPane(framework, $contentContainer);
if (!privateData.isEmbed) {
mkHelpMenu(framework); mkHelpMenu(framework);
}
CodeMirror.mkIndentSettings(framework._.cpNfInner.metadataMgr); CodeMirror.mkIndentSettings(framework._.cpNfInner.metadataMgr);
CodeMirror.init(framework.localChange, framework._.title, framework._.toolbar); CodeMirror.init(framework.localChange, framework._.title, framework._.toolbar);

@ -310,7 +310,10 @@ define([
$canvasContainer.find('canvas').css('border-color', bool? 'black': 'red'); $canvasContainer.find('canvas').css('border-color', bool? 'black': 'red');
}; };
var privateData = metadataMgr.getPrivateData();
if (!privateData.isEmbed) {
mkHelpMenu(framework); mkHelpMenu(framework);
}
mkControls(framework, canvas); mkControls(framework, canvas);

Loading…
Cancel
Save