bug fix
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
this.api.asc_registerCallback("asc_onThumbnailsShow", _.bind(this.onThumbnailsShow, this));
|
||||
this.api.asc_registerCallback("asc_onСoAuthoringDisconnect", _.bind(this.onApiServerDisconnect, this));
|
||||
Common.NotificationCenter.on("api:disconnect", _.bind(this.onApiServerDisconnect, this));
|
||||
if (this.mode.canCoAuthoring) {
|
||||
if (this.mode.canCoAuthoring && this.mode.canChat) {
|
||||
this.api.asc_registerCallback("asc_onCoAuthoringChatReceiveMessage", _.bind(this.onApiChatMessage, this));
|
||||
}
|
||||
this.api.asc_registerCallback("asc_onCountPages", _.bind(this.onApiCountPages, this));
|
||||
@@ -110,10 +110,14 @@
|
||||
},
|
||||
createDelayedElements: function () {
|
||||
if (this.mode.canCoAuthoring) {
|
||||
this.leftMenu.btnComments[this.mode.isEdit ? "show" : "hide"]();
|
||||
this.leftMenu.btnChat.show();
|
||||
this.leftMenu.setOptionsPanel("chat", this.getApplication().getController("Common.Controllers.Chat").getView("Common.Views.Chat"));
|
||||
this.leftMenu.setOptionsPanel("comment", this.getApplication().getController("Common.Controllers.Comments").getView("Common.Views.Comments"));
|
||||
this.leftMenu.btnComments[this.mode.isEdit && this.mode.canComments ? "show" : "hide"]();
|
||||
if (this.mode.canComments) {
|
||||
this.leftMenu.setOptionsPanel("comment", this.getApplication().getController("Common.Controllers.Comments").getView("Common.Views.Comments"));
|
||||
}
|
||||
this.leftMenu.btnChat[this.mode.canChat ? "show" : "hide"]();
|
||||
if (this.mode.canChat) {
|
||||
this.leftMenu.setOptionsPanel("chat", this.getApplication().getController("Common.Controllers.Chat").getView("Common.Views.Chat"));
|
||||
}
|
||||
} else {
|
||||
this.leftMenu.btnChat.hide();
|
||||
this.leftMenu.btnComments.hide();
|
||||
@@ -214,7 +218,7 @@
|
||||
this.leftMenu.getMenu("file").disableMenu("save", status);
|
||||
},
|
||||
clickStatusbarUsers: function () {
|
||||
if (this.mode.canCoAuthoring) {
|
||||
if (this.mode.canCoAuthoring && this.mode.canChat) {
|
||||
if (this.leftMenu.btnChat.pressed) {
|
||||
this.leftMenu.close();
|
||||
} else {
|
||||
@@ -366,13 +370,13 @@
|
||||
}
|
||||
break;
|
||||
case "chat":
|
||||
if (this.mode.canCoAuthoring && (!previewPanel || !previewPanel.isVisible())) {
|
||||
if (this.mode.canCoAuthoring && this.mode.canChat && (!previewPanel || !previewPanel.isVisible())) {
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
this.leftMenu.showMenu("chat");
|
||||
}
|
||||
return false;
|
||||
case "comments":
|
||||
if (this.mode.canCoAuthoring && this.mode.isEdit && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) {
|
||||
if (this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments && (!previewPanel || !previewPanel.isVisible()) && !this._state.no_slides) {
|
||||
Common.UI.Menu.Manager.hideAll();
|
||||
this.leftMenu.showMenu("comments");
|
||||
this.getApplication().getController("Common.Controllers.Comments").focusOnInput();
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
PE.Controllers.Main = Backbone.Controller.extend(_.extend((function () {
|
||||
var ApplyEditRights = -255;
|
||||
var LoadingDocument = -256;
|
||||
var mapCustomizationElements = {
|
||||
about: "button#left-btn-about",
|
||||
feedback: "button#left-btn-support",
|
||||
goback: "#fm-btn-back > a, #header-back > div"
|
||||
};
|
||||
return {
|
||||
models: [],
|
||||
collections: ["ShapeGroups", "SlideLayouts"],
|
||||
@@ -148,14 +153,16 @@
|
||||
this.appOptions.user = this.editorConfig.user;
|
||||
this.appOptions.canBack = this.editorConfig.nativeApp !== true && this.editorConfig.canBackToFolder === true;
|
||||
this.appOptions.nativeApp = this.editorConfig.nativeApp === true;
|
||||
this.appOptions.canCreateNew = !_.isEmpty(this.editorConfig.createUrl);
|
||||
this.appOptions.canOpenRecent = this.editorConfig.nativeApp !== true && this.editorConfig.recent !== undefined;
|
||||
this.appOptions.isDesktopApp = this.editorConfig.targetApp == "desktop";
|
||||
this.appOptions.canCreateNew = !_.isEmpty(this.editorConfig.createUrl) && !this.appOptions.isDesktopApp;
|
||||
this.appOptions.canOpenRecent = this.editorConfig.nativeApp !== true && this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp;
|
||||
this.appOptions.templates = this.editorConfig.templates;
|
||||
this.appOptions.recent = this.editorConfig.recent;
|
||||
this.appOptions.createUrl = this.editorConfig.createUrl;
|
||||
this.appOptions.lang = this.editorConfig.lang;
|
||||
this.appOptions.sharingSettingsUrl = this.editorConfig.sharingSettingsUrl;
|
||||
this.appOptions.canAnalytics = false;
|
||||
this.appOptions.customization = this.editorConfig.customization;
|
||||
this.getApplication().getController("Viewport").getView("Common.Views.Header").setCanBack(this.editorConfig.canBackToFolder === true);
|
||||
if (this.editorConfig.lang) {
|
||||
this.api.asc_setLocale(this.editorConfig.lang);
|
||||
@@ -177,7 +184,6 @@
|
||||
docInfo.put_UserId(this.editorConfig.user.id);
|
||||
docInfo.put_UserName(this.editorConfig.user.name);
|
||||
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
|
||||
docInfo.put_OfflineApp(this.editorConfig.nativeApp === true);
|
||||
}
|
||||
this.api.asc_registerCallback("asc_onGetEditorPermissions", _.bind(this.onEditorPermissions, this));
|
||||
this.api.asc_setDocInfo(docInfo);
|
||||
@@ -198,7 +204,7 @@
|
||||
onProcessRightsChange: function (data) {
|
||||
if (data && data.enabled === false) {
|
||||
this.api.asc_coAuthoringDisconnect();
|
||||
this.getApplication().getController("LeftMenu").leftMenu.getMenu("file").panels["info"].onLostEditRights();
|
||||
this.getApplication().getController("LeftMenu").leftMenu.getMenu("file").panels["rights"].onLostEditRights();
|
||||
Common.UI.warning({
|
||||
title: this.notcriticalErrorTitle,
|
||||
msg: _.isEmpty(data.message) ? this.warnProcessRightsChange : data.message
|
||||
@@ -406,9 +412,11 @@
|
||||
value = window.localStorage.getItem("pe-settings-zoom");
|
||||
var zf = (value !== null) ? parseInt(value) : -1;
|
||||
(zf == -1) ? this.api.zoomFitToPage() : this.api.zoom(zf);
|
||||
Common.Utils.isIE9m && tips.push(me.warnBrowserIE9); ! Common.Utils.isGecko && (Math.abs(me.getBrowseZoomLevel() - 1) > 0.1) && tips.push(Common.Utils.String.platformKey(me.warnBrowserZoom, "{0}"));
|
||||
if (tips.length) {
|
||||
me.showTips(tips);
|
||||
if ( !! window["AscDesktopEditor"]) {
|
||||
Common.Utils.isIE9m && tips.push(me.warnBrowserIE9); ! Common.Utils.isGecko && (Math.abs(me.getBrowseZoomLevel() - 1) > 0.1) && tips.push(Common.Utils.String.platformKey(me.warnBrowserZoom, "{0}"));
|
||||
if (tips.length) {
|
||||
me.showTips(tips);
|
||||
}
|
||||
}
|
||||
me.api.asc_registerCallback("asc_onStartAction", _.bind(me.onLongActionBegin, me));
|
||||
me.api.asc_registerCallback("asc_onEndAction", _.bind(me.onLongActionEnd, me));
|
||||
@@ -441,7 +449,7 @@
|
||||
statusbarController.createDelayedElements();
|
||||
leftmenuController.getView("LeftMenu").disableMenu("all", false);
|
||||
if (me.appOptions.canBranding) {
|
||||
me.getApplication().getController("LeftMenu").leftMenu.getMenu("about").setLicInfo(me.editorConfig.branding);
|
||||
me.getApplication().getController("LeftMenu").leftMenu.getMenu("about").setLicInfo(me.editorConfig.customization);
|
||||
}
|
||||
documentHolderController.getView("DocumentHolder").setApi(me.api).on("editcomplete", _.bind(me.onEditComplete, me));
|
||||
application.getController("Viewport").getView("DocumentPreview").setApi(me.api).on("editcomplete", _.bind(me.onEditComplete, me));
|
||||
@@ -480,8 +488,9 @@
|
||||
}
|
||||
me.api.asc_setAutoSaveGap(value);
|
||||
if (this.appOptions.canAnalytics) {
|
||||
Common.Gateway.on("applyeditrights", _.bind(me.onApplyEditRights, me));
|
||||
Common.component.Analytics.initialize("UA-12442749-13", "Presentation Editor");
|
||||
}
|
||||
Common.Gateway.on("applyeditrights", _.bind(me.onApplyEditRights, me));
|
||||
Common.Gateway.on("processsaveresult", _.bind(me.onProcessSaveResult, me));
|
||||
Common.Gateway.on("processrightschange", _.bind(me.onProcessRightsChange, me));
|
||||
Common.Gateway.on("processmouse", _.bind(me.onProcessMouse, me));
|
||||
@@ -500,15 +509,18 @@
|
||||
onEditorPermissions: function (params) {
|
||||
this.permissions.edit !== false && (this.permissions.edit = params.asc_getCanEdit());
|
||||
this.permissions.download !== false && (this.permissions.download = params.asc_getCanDownload());
|
||||
this.appOptions.canCoAuthoring = params.asc_getCanCoAuthoring();
|
||||
this.appOptions.canCoAuthoring = true;
|
||||
this.appOptions.canEdit = this.permissions.edit === true;
|
||||
this.appOptions.isEdit = this.appOptions.canEdit && this.editorConfig.mode !== "view";
|
||||
this.appOptions.canDownload = !this.appOptions.nativeApp && this.permissions.download;
|
||||
this.appOptions.canAutosave = this.editorConfig.canAutosave !== false && params.asc_getIsAutosaveEnable();
|
||||
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
|
||||
this.appOptions.canBranding = params.asc_getCanBranding() && (typeof(this.editorConfig.branding) == "object");
|
||||
this.appOptions.canLicense = params.asc_getCanLicense ? params.asc_getCanLicense() : false;
|
||||
this.appOptions.canComments = this.appOptions.canLicense && !((typeof(this.editorConfig.customization) == "object") && this.editorConfig.customization.comments === false);
|
||||
this.appOptions.canChat = this.appOptions.canLicense && !((typeof(this.editorConfig.customization) == "object") && this.editorConfig.customization.chat === false);
|
||||
this.appOptions.canBranding = params.asc_getCanBranding() && (typeof(this.editorConfig.customization) == "object");
|
||||
if (this.appOptions.canBranding) {
|
||||
this.getApplication().getController("Viewport").getView("Common.Views.Header").setBranding(this.editorConfig.branding);
|
||||
this.getApplication().getController("Viewport").getView("Common.Views.Header").setBranding(this.editorConfig.customization);
|
||||
}
|
||||
this.applyModeCommonElements();
|
||||
this.applyModeEditorElements();
|
||||
@@ -530,7 +542,7 @@
|
||||
documentHolder = app.getController("DocumentHolder").getView("DocumentHolder");
|
||||
if (headerView) {
|
||||
headerView.setHeaderCaption(this.appOptions.isEdit ? "Presentation Editor" : "Presentation Viewer");
|
||||
headerView.setVisible(!this.appOptions.nativeApp && !value);
|
||||
headerView.setVisible(!this.appOptions.nativeApp && !value && !this.appOptions.isDesktopApp);
|
||||
}
|
||||
viewport && viewport.setMode(this.appOptions, true);
|
||||
statusbarView && statusbarView.setMode(this.appOptions);
|
||||
@@ -807,6 +819,10 @@
|
||||
}
|
||||
},
|
||||
hidePreloader: function () {
|
||||
if ( !! this.appOptions.customization && !this.appOptions.customization.done) {
|
||||
this.appOptions.customization.done = true;
|
||||
Common.Utils.applyCustomization(this.appOptions.customization, mapCustomizationElements);
|
||||
}
|
||||
Common.NotificationCenter.trigger("layout:changed", "main");
|
||||
$("#loading-mask").hide().remove();
|
||||
},
|
||||
|
||||
@@ -803,20 +803,25 @@
|
||||
onCopyPaste: function (copy, e) {
|
||||
var me = this;
|
||||
if (me.api) {
|
||||
var value = window.localStorage.getItem("pe-hide-copywarning");
|
||||
if (! (value && parseInt(value) == 1) && this._state.show_copywarning) {
|
||||
(new Common.Views.CopyWarningDialog({
|
||||
handler: function (dontshow) {
|
||||
copy ? me.api.Copy() : me.api.Paste();
|
||||
if (dontshow) {
|
||||
window.localStorage.setItem("pe-hide-copywarning", 1);
|
||||
}
|
||||
Common.NotificationCenter.trigger("edit:complete", me.toolbar);
|
||||
}
|
||||
})).show();
|
||||
} else {
|
||||
if (typeof window["AscDesktopEditor"] === "object") {
|
||||
copy ? me.api.Copy() : me.api.Paste();
|
||||
Common.NotificationCenter.trigger("edit:complete", me.toolbar);
|
||||
} else {
|
||||
var value = window.localStorage.getItem("pe-hide-copywarning");
|
||||
if (! (value && parseInt(value) == 1) && this._state.show_copywarning) {
|
||||
(new Common.Views.CopyWarningDialog({
|
||||
handler: function (dontshow) {
|
||||
copy ? me.api.Copy() : me.api.Paste();
|
||||
if (dontshow) {
|
||||
window.localStorage.setItem("pe-hide-copywarning", 1);
|
||||
}
|
||||
Common.NotificationCenter.trigger("edit:complete", me.toolbar);
|
||||
}
|
||||
})).show();
|
||||
} else {
|
||||
copy ? me.api.Copy() : me.api.Paste();
|
||||
Common.NotificationCenter.trigger("edit:complete", me.toolbar);
|
||||
}
|
||||
}
|
||||
Common.component.Analytics.trackEvent("ToolBar", "Copy Warning");
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<li id="fm-btn-create" class="fm-btn" />
|
||||
<li class="devider" />
|
||||
<li id="fm-btn-info" class="fm-btn" />
|
||||
<li id="fm-btn-rights" class="fm-btn" />
|
||||
<li class="devider" class="fm-btn" />
|
||||
<li id="fm-btn-settings" class="fm-btn" />
|
||||
<li class="devider" />
|
||||
@@ -23,6 +24,7 @@
|
||||
<div id="panel-recentfiles" class="content-box" />
|
||||
<div id="panel-createnew" class="content-box" />
|
||||
<div id="panel-info" class="content-box" />
|
||||
<div id="panel-rights" class="content-box" />
|
||||
<div id="panel-settings" class="content-box" />
|
||||
<div id="panel-help" class="content-box" />
|
||||
</div>
|
||||
@@ -581,7 +581,7 @@
|
||||
me.api.asc_registerCallback("asc_onDialogAddHyperlink", _.bind(onDialogAddHyperlink, me));
|
||||
me.api.asc_registerCallback("asc_doubleClickOnChart", onDoubleClickOnChart);
|
||||
}
|
||||
me.mode = mode; ! (me.mode.canCoAuthoring && me.mode.isEdit) ? Common.util.Shortcuts.suspendEvents(hkComments) : Common.util.Shortcuts.resumeEvents(hkComments);
|
||||
me.mode = mode; ! (me.mode.canCoAuthoring && me.mode.isEdit && me.mode.canComments) ? Common.util.Shortcuts.suspendEvents(hkComments) : Common.util.Shortcuts.resumeEvents(hkComments);
|
||||
me.editorConfig = {
|
||||
user: mode.user
|
||||
};
|
||||
@@ -650,7 +650,7 @@
|
||||
}
|
||||
},
|
||||
addComment: function (item, e, eOpt) {
|
||||
if (this.api && this.mode.canCoAuthoring && this.mode.isEdit) {
|
||||
if (this.api && this.mode.canCoAuthoring && this.mode.isEdit && this.mode.canComments) {
|
||||
this.suppressEditComplete = true;
|
||||
this.api.asc_enableKeyEvents(false);
|
||||
var controller = PE.getController("Common.Controllers.Comments");
|
||||
@@ -673,20 +673,24 @@
|
||||
onCutCopyPaste: function (item, e) {
|
||||
var me = this;
|
||||
if (me.api) {
|
||||
var value = window.localStorage.getItem("pe-hide-copywarning");
|
||||
if (! (value && parseInt(value) == 1) && me.show_copywarning) {
|
||||
(new Common.Views.CopyWarningDialog({
|
||||
handler: function (dontshow) {
|
||||
(item.value == "cut") ? me.api.Cut() : ((item.value == "copy") ? me.api.Copy() : me.api.Paste());
|
||||
if (dontshow) {
|
||||
window.localStorage.setItem("pe-hide-copywarning", 1);
|
||||
}
|
||||
me.fireEvent("editcomplete", me);
|
||||
}
|
||||
})).show();
|
||||
} else {
|
||||
if (typeof window["AscDesktopEditor"] === "object") {
|
||||
(item.value == "cut") ? me.api.Cut() : ((item.value == "copy") ? me.api.Copy() : me.api.Paste());
|
||||
me.fireEvent("editcomplete", me);
|
||||
} else {
|
||||
var value = window.localStorage.getItem("pe-hide-copywarning");
|
||||
if (! (value && parseInt(value) == 1) && me.show_copywarning) {
|
||||
(new Common.Views.CopyWarningDialog({
|
||||
handler: function (dontshow) {
|
||||
(item.value == "cut") ? me.api.Cut() : ((item.value == "copy") ? me.api.Copy() : me.api.Paste());
|
||||
if (dontshow) {
|
||||
window.localStorage.setItem("pe-hide-copywarning", 1);
|
||||
}
|
||||
me.fireEvent("editcomplete", me);
|
||||
}
|
||||
})).show();
|
||||
} else {
|
||||
(item.value == "cut") ? me.api.Cut() : ((item.value == "copy") ? me.api.Copy() : me.api.Paste());
|
||||
me.fireEvent("editcomplete", me);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
me.fireEvent("editcomplete", me);
|
||||
@@ -1330,7 +1334,7 @@
|
||||
menuAddHyperlinkPara.hyperProps.value = new CHyperlinkProperty();
|
||||
menuAddHyperlinkPara.hyperProps.value.put_Text(text);
|
||||
}
|
||||
menuAddCommentPara.setVisible(!isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring);
|
||||
menuAddCommentPara.setVisible(!isInChart && me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments);
|
||||
menuCommentParaSeparator.setVisible(menuAddCommentPara.isVisible() || menuAddHyperlinkPara.isVisible() || menuHyperlinkPara.isVisible());
|
||||
menuAddHyperlinkPara.setDisabled(disabled);
|
||||
menuHyperlinkPara.setDisabled(disabled);
|
||||
@@ -1386,7 +1390,7 @@
|
||||
menuAddHyperlinkTable.setDisabled(value.paraProps.locked || disabled);
|
||||
menuHyperlinkTable.setDisabled(value.paraProps.locked || disabled);
|
||||
}
|
||||
menuAddCommentTable.setVisible(me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring);
|
||||
menuAddCommentTable.setVisible(me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments);
|
||||
menuAddCommentTable.setDisabled(!_.isUndefined(value.paraProps) && value.paraProps.locked || disabled);
|
||||
menuHyperlinkSeparator.setVisible(menuAddHyperlinkTable.isVisible() || menuHyperlinkTable.isVisible() || menuAddCommentTable.isVisible());
|
||||
},
|
||||
@@ -1515,7 +1519,7 @@
|
||||
menuShapeAdvanced.setVisible(_.isUndefined(value.imgProps) && _.isUndefined(value.chartProps));
|
||||
menuChartEdit.setVisible(_.isUndefined(value.imgProps) && !_.isUndefined(value.chartProps) && (_.isUndefined(value.shapeProps) || value.shapeProps.isChart));
|
||||
menuImgShapeSeparator.setVisible(menuImageAdvanced.isVisible() || menuShapeAdvanced.isVisible() || menuChartEdit.isVisible());
|
||||
menuAddCommentImg.setVisible(me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring);
|
||||
menuAddCommentImg.setVisible(me.api.can_AddQuotedComment() !== false && me.mode.canCoAuthoring && me.mode.canComments);
|
||||
menuCommentSeparatorImg.setVisible(menuAddCommentImg.isVisible());
|
||||
menuAddCommentImg.setDisabled(disabled);
|
||||
menuImgShapeAlign.setDisabled(disabled);
|
||||
|
||||
@@ -106,6 +106,11 @@
|
||||
action: "info",
|
||||
caption: this.btnInfoCaption,
|
||||
canFocused: false
|
||||
}), new Common.UI.MenuItem({
|
||||
el: $("#fm-btn-rights", this.el),
|
||||
action: "rights",
|
||||
caption: this.btnRightsCaption,
|
||||
canFocused: false
|
||||
}), new Common.UI.MenuItem({
|
||||
el: $("#fm-btn-settings", this.el),
|
||||
action: "opts",
|
||||
@@ -135,6 +140,9 @@
|
||||
"info": (new PE.Views.FileMenuPanels.DocumentInfo({
|
||||
menu: me
|
||||
})).render(),
|
||||
"rights": (new PE.Views.FileMenuPanels.DocumentRights({
|
||||
menu: me
|
||||
})).render(),
|
||||
"help": (new PE.Views.FileMenuPanels.Help({
|
||||
menu: me
|
||||
})).render()
|
||||
@@ -166,16 +174,17 @@
|
||||
this.api.asc_enableKeyEvents(true);
|
||||
},
|
||||
applyMode: function () {
|
||||
this.items[0][this.mode.canBack ? "show" : "hide"]();
|
||||
this.items[0].$el.find("+.devider")[this.mode.canBack ? "show" : "hide"]();
|
||||
this.items[5][this.mode.canOpenRecent ? "show" : "hide"]();
|
||||
this.items[6][this.mode.canCreateNew ? "show" : "hide"]();
|
||||
this.items[6].$el.find("+.devider")[this.mode.canCreateNew ? "show" : "hide"]();
|
||||
this.items[3][this.mode.canDownload ? "show" : "hide"]();
|
||||
this.items[1][this.mode.isEdit ? "show" : "hide"]();
|
||||
this.items[2][!this.mode.isEdit && this.mode.canEdit ? "show" : "hide"]();
|
||||
this.mode.canBack ? this.$el.find("#fm-btn-back").show().prev().show() : this.$el.find("#fm-btn-back").hide().prev().hide();
|
||||
this.items[8][(this.document && this.document.info && (this.document.info.sharingSettings && this.document.info.sharingSettings.length > 0 || this.mode.sharingSettingsUrl && this.mode.sharingSettingsUrl.length)) ? "show" : "hide"]();
|
||||
this.panels["opts"].setMode(this.mode);
|
||||
this.panels["info"].setMode(this.mode).updateInfo(this.document);
|
||||
this.panels["rights"].setMode(this.mode).updateInfo(this.document);
|
||||
if (this.mode.canCreateNew) {
|
||||
if (this.mode.templates && this.mode.templates.length) {
|
||||
$("a", this.items[6].$el).text(this.btnCreateNewCaption + "...");
|
||||
@@ -193,6 +202,9 @@
|
||||
})).render();
|
||||
}
|
||||
}
|
||||
if (this.mode.targetApp == "desktop") {
|
||||
this.$el.find("#fm-btn-create, #fm-btn-back, #fm-btn-create+.devider").hide();
|
||||
}
|
||||
this.panels["help"].setLangConfig(this.mode.lang);
|
||||
},
|
||||
setMode: function (mode, delay) {
|
||||
@@ -241,6 +253,7 @@
|
||||
btnSaveCaption: "Save",
|
||||
btnDownloadCaption: "Download as...",
|
||||
btnInfoCaption: "Document Info...",
|
||||
btnRightsCaption: "Access Rights...",
|
||||
btnCreateNewCaption: "Create New",
|
||||
btnRecentFilesCaption: "Open Recent...",
|
||||
btnPrintCaption: "Print",
|
||||
|
||||
@@ -339,8 +339,7 @@
|
||||
initialize: function (options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this, arguments);
|
||||
this.rendered = false;
|
||||
this.template = _.template(['<table class="main">', "<tr>", '<td class="left"><label>' + this.txtTitle + "</label></td>", '<td class="right"><label id="id-info-title">-</label></td>', "</tr>", '<tr class="author">', '<td class="left"><label>' + this.txtAuthor + "</label></td>", '<td class="right"><span class="userLink" id="id-info-author">-</span></td>', "</tr>", '<tr class="placement">', '<td class="left"><label>' + this.txtPlacement + "</label></td>", '<td class="right"><label id="id-info-placement">-</label></td>', "</tr>", '<tr class="date">', '<td class="left"><label>' + this.txtDate + "</label></td>", '<td class="right"><label id="id-info-date">-</label></td>', "</tr>", '<tr class="divider date"></tr>', '<tr class="rights">', '<td class="left" style="vertical-align: top;"><label>' + this.txtRights + "</label></td>", '<td class="right"><div id="id-info-rights"></div></td>', "</tr>", '<tr class="edit-rights">', '<td class="left"></td><td class="right"><button id="id-info-btn-edit" class="btn normal dlg-btn primary" style="margin-right: 10px;width: auto;">' + this.txtBtnAccessRights + "</button></td>", "</tr>", "</table>"].join(""));
|
||||
this.templateRights = _.template(["<table>", "<% _.each(users, function(item) { %>", "<tr>", '<td><span class="userLink"><%= Common.Utils.String.htmlEncode(item.user) %></span></td>', "<td><%= Common.Utils.String.htmlEncode(item.permissions) %></td>", "</tr>", "<% }); %>", "</table>"].join(""));
|
||||
this.template = _.template(['<table class="main">', "<tr>", '<td class="left"><label>' + this.txtTitle + "</label></td>", '<td class="right"><label id="id-info-title">-</label></td>', "</tr>", '<tr class="author">', '<td class="left"><label>' + this.txtAuthor + "</label></td>", '<td class="right"><span class="userLink" id="id-info-author">-</span></td>', "</tr>", '<tr class="placement">', '<td class="left"><label>' + this.txtPlacement + "</label></td>", '<td class="right"><label id="id-info-placement">-</label></td>', "</tr>", '<tr class="date">', '<td class="left"><label>' + this.txtDate + "</label></td>", '<td class="right"><label id="id-info-date">-</label></td>', "</tr>", '<tr class="divider date"></tr>', "</table>"].join(""));
|
||||
this.menu = options.menu;
|
||||
},
|
||||
render: function () {
|
||||
@@ -349,11 +348,6 @@
|
||||
this.lblPlacement = $("#id-info-placement");
|
||||
this.lblDate = $("#id-info-date");
|
||||
this.lblAuthor = $("#id-info-author");
|
||||
this.cntRights = $("#id-info-rights");
|
||||
this.btnEditRights = new Common.UI.Button({
|
||||
el: "#id-info-btn-edit"
|
||||
});
|
||||
this.btnEditRights.on("click", _.bind(this.changeAccessRights, this));
|
||||
this.rendered = true;
|
||||
this.updateInfo(this.doc);
|
||||
if (_.isUndefined(this.scroller)) {
|
||||
@@ -390,13 +384,6 @@
|
||||
this.lblPlacement.text(doc.info.folder);
|
||||
}
|
||||
this._ShowHideInfoItem("placement", doc.info.folder !== undefined && doc.info.folder !== null);
|
||||
if (doc.info.sharingSettings) {
|
||||
this.cntRights.html(this.templateRights({
|
||||
users: doc.info.sharingSettings
|
||||
}));
|
||||
}
|
||||
this._ShowHideInfoItem("rights", doc.info.sharingSettings !== undefined && doc.info.sharingSettings !== null && this._readonlyRights !== true);
|
||||
this._ShowHideInfoItem("edit-rights", !!this.sharingSettingsUrl && this.sharingSettingsUrl.length && this._readonlyRights !== true);
|
||||
} else {
|
||||
this._ShowHideDocInfo(false);
|
||||
}
|
||||
@@ -408,6 +395,71 @@
|
||||
this._ShowHideInfoItem("date", visible);
|
||||
this._ShowHideInfoItem("placement", visible);
|
||||
this._ShowHideInfoItem("author", visible);
|
||||
},
|
||||
setMode: function (mode) {
|
||||
return this;
|
||||
},
|
||||
txtTitle: "Document Title",
|
||||
txtAuthor: "Author",
|
||||
txtPlacement: "Placement",
|
||||
txtDate: "Creation Date"
|
||||
},
|
||||
PE.Views.FileMenuPanels.DocumentInfo || {}));
|
||||
PE.Views.FileMenuPanels.DocumentRights = Common.UI.BaseView.extend(_.extend({
|
||||
el: "#panel-rights",
|
||||
menu: undefined,
|
||||
initialize: function (options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this, arguments);
|
||||
this.rendered = false;
|
||||
this.template = _.template(['<table class="main">', '<tr class="rights">', '<td class="left" style="vertical-align: top;"><label>' + this.txtRights + "</label></td>", '<td class="right"><div id="id-info-rights"></div></td>', "</tr>", '<tr class="edit-rights">', '<td class="left"></td><td class="right"><button id="id-info-btn-edit" class="btn normal dlg-btn primary" style="margin-right: 10px;width: auto;">' + this.txtBtnAccessRights + "</button></td>", "</tr>", "</table>"].join(""));
|
||||
this.templateRights = _.template(["<table>", "<% _.each(users, function(item) { %>", "<tr>", '<td><span class="userLink"><%= Common.Utils.String.htmlEncode(item.user) %></span></td>', "<td><%= Common.Utils.String.htmlEncode(item.permissions) %></td>", "</tr>", "<% }); %>", "</table>"].join(""));
|
||||
this.menu = options.menu;
|
||||
},
|
||||
render: function () {
|
||||
$(this.el).html(this.template());
|
||||
this.cntRights = $("#id-info-rights");
|
||||
this.btnEditRights = new Common.UI.Button({
|
||||
el: "#id-info-btn-edit"
|
||||
});
|
||||
this.btnEditRights.on("click", _.bind(this.changeAccessRights, this));
|
||||
this.rendered = true;
|
||||
this.updateInfo(this.doc);
|
||||
if (_.isUndefined(this.scroller)) {
|
||||
this.scroller = new Common.UI.Scroller({
|
||||
el: $(this.el),
|
||||
suppressScrollX: true
|
||||
});
|
||||
}
|
||||
return this;
|
||||
},
|
||||
show: function () {
|
||||
Common.UI.BaseView.prototype.show.call(this, arguments);
|
||||
},
|
||||
hide: function () {
|
||||
Common.UI.BaseView.prototype.hide.call(this, arguments);
|
||||
},
|
||||
updateInfo: function (doc) {
|
||||
this.doc = doc;
|
||||
if (!this.rendered) {
|
||||
return;
|
||||
}
|
||||
doc = doc || {};
|
||||
if (doc.info) {
|
||||
if (doc.info.sharingSettings) {
|
||||
this.cntRights.html(this.templateRights({
|
||||
users: doc.info.sharingSettings
|
||||
}));
|
||||
}
|
||||
this._ShowHideInfoItem("rights", doc.info.sharingSettings !== undefined && doc.info.sharingSettings !== null && doc.info.sharingSettings.length > 0);
|
||||
this._ShowHideInfoItem("edit-rights", !!this.sharingSettingsUrl && this.sharingSettingsUrl.length && this._readonlyRights !== true);
|
||||
} else {
|
||||
this._ShowHideDocInfo(false);
|
||||
}
|
||||
},
|
||||
_ShowHideInfoItem: function (cls, visible) {
|
||||
$("tr." + cls, this.el)[visible ? "show" : "hide"]();
|
||||
},
|
||||
_ShowHideDocInfo: function (visible) {
|
||||
this._ShowHideInfoItem("rights", visible);
|
||||
this._ShowHideInfoItem("edit-rights", visible);
|
||||
},
|
||||
@@ -416,34 +468,35 @@
|
||||
return this;
|
||||
},
|
||||
changeAccessRights: function (btn, event, opts) {
|
||||
if (this._docAccessDlg) {
|
||||
return;
|
||||
}
|
||||
var me = this;
|
||||
var win = new Common.Views.DocumentAccessDialog({
|
||||
me._docAccessDlg = new Common.Views.DocumentAccessDialog({
|
||||
settingsurl: this.sharingSettingsUrl
|
||||
});
|
||||
win.on("accessrights", function (obj, rights) {
|
||||
me._docAccessDlg.on("accessrights", function (obj, rights) {
|
||||
me.doc.info.sharingSettings = rights;
|
||||
me._ShowHideInfoItem("rights", me.doc.info.sharingSettings !== undefined && me.doc.info.sharingSettings !== null && me.doc.info.sharingSettings.length > 0);
|
||||
me.cntRights.html(me.templateRights({
|
||||
users: me.doc.info.sharingSettings
|
||||
}));
|
||||
}).on("close", function (obj) {
|
||||
me._docAccessDlg = undefined;
|
||||
});
|
||||
win.show();
|
||||
me._docAccessDlg.show();
|
||||
},
|
||||
onLostEditRights: function () {
|
||||
this._readonlyRights = true;
|
||||
if (!this.rendered) {
|
||||
return;
|
||||
}
|
||||
this._ShowHideInfoItem("rights", false);
|
||||
this._ShowHideInfoItem("edit-rights", false);
|
||||
},
|
||||
txtTitle: "Document Title",
|
||||
txtAuthor: "Author",
|
||||
txtPlacement: "Placement",
|
||||
txtDate: "Creation Date",
|
||||
txtRights: "Persons who have rights",
|
||||
txtBtnAccessRights: "Change access rights"
|
||||
},
|
||||
PE.Views.FileMenuPanels.DocumentInfo || {}));
|
||||
PE.Views.FileMenuPanels.DocumentRights || {}));
|
||||
PE.Views.FileMenuPanels.Help = Common.UI.BaseView.extend({
|
||||
el: "#panel-help",
|
||||
menu: undefined,
|
||||
|
||||
@@ -178,16 +178,20 @@
|
||||
},
|
||||
onCoauthOptions: function (e) {
|
||||
if (this.mode.canCoAuthoring) {
|
||||
this.panelComments[this.btnComments.pressed ? "show" : "hide"]();
|
||||
this.fireEvent((this.btnComments.pressed) ? "comments:show": "comments:hide", this);
|
||||
if (this.btnChat.pressed) {
|
||||
if (this.btnChat.$el.hasClass("notify")) {
|
||||
this.btnChat.$el.removeClass("notify");
|
||||
if (this.mode.canComments) {
|
||||
this.panelComments[this.btnComments.pressed ? "show" : "hide"]();
|
||||
this.fireEvent((this.btnComments.pressed) ? "comments:show": "comments:hide", this);
|
||||
}
|
||||
if (this.mode.canChat) {
|
||||
if (this.btnChat.pressed) {
|
||||
if (this.btnChat.$el.hasClass("notify")) {
|
||||
this.btnChat.$el.removeClass("notify");
|
||||
}
|
||||
this.panelChat.show();
|
||||
this.panelChat.focus();
|
||||
} else {
|
||||
this.panelChat["hide"]();
|
||||
}
|
||||
this.panelChat.show();
|
||||
this.panelChat.focus();
|
||||
} else {
|
||||
this.panelChat["hide"]();
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -211,13 +215,17 @@
|
||||
this.btnThumbs.toggle(false);
|
||||
this.$el.width(SCALE_MIN);
|
||||
if (this.mode.canCoAuthoring) {
|
||||
this.panelComments["hide"]();
|
||||
this.panelChat["hide"]();
|
||||
if (this.btnComments.pressed) {
|
||||
this.fireEvent("comments:hide", this);
|
||||
if (this.mode.canComments) {
|
||||
this.panelComments["hide"]();
|
||||
if (this.btnComments.pressed) {
|
||||
this.fireEvent("comments:hide", this);
|
||||
}
|
||||
this.btnComments.toggle(false, true);
|
||||
}
|
||||
if (this.mode.canChat) {
|
||||
this.panelChat["hide"]();
|
||||
this.btnChat.toggle(false, true);
|
||||
}
|
||||
this.btnComments.toggle(false, true);
|
||||
this.btnChat.toggle(false, true);
|
||||
}
|
||||
this.fireEvent("panel:show", [this, "", false]);
|
||||
},
|
||||
|
||||
@@ -1564,6 +1564,10 @@
|
||||
nativeBtnGroup.hide();
|
||||
}
|
||||
}
|
||||
if (mode.isDesktopApp) {
|
||||
$(".toolbar-group-native").hide();
|
||||
this.mnuitemHideTitleBar.hide();
|
||||
}
|
||||
},
|
||||
changeViewMode: function (item, compact) {
|
||||
var me = this,
|
||||
|
||||
Reference in New Issue
Block a user