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 {
|
||||
|
||||
Reference in New Issue
Block a user