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');
mkPrintButton(framework, $content, $print);
// XXX don't display the help menu in embed mode?
// 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);
if (!privateData.isEmbed) {
mkHelpMenu(framework);
}
var evModeChange = Util.mkEvent();
evModeChange.reg(previewPane.modeChange);

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

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

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

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

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

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

Loading…
Cancel
Save