[PE][SSE] Remove nativeApp flag
This commit is contained in:
parent
bd6071ccd2
commit
15b584c235
|
@ -391,7 +391,6 @@ define([
|
||||||
docInfo.put_Token(data.doc.token);
|
docInfo.put_Token(data.doc.token);
|
||||||
docInfo.put_Permissions(_permissions);
|
docInfo.put_Permissions(_permissions);
|
||||||
// docInfo.put_Review(this.permissions.review);
|
// docInfo.put_Review(this.permissions.review);
|
||||||
// docInfo.put_OfflineApp(this.editorConfig.nativeApp === true); // used in sdk for testing
|
|
||||||
|
|
||||||
var type = /^(?:(pdf|djvu|xps))$/.exec(data.doc.fileType);
|
var type = /^(?:(pdf|djvu|xps))$/.exec(data.doc.fileType);
|
||||||
if (type && typeof type[1] === 'string') {
|
if (type && typeof type[1] === 'string') {
|
||||||
|
|
|
@ -327,13 +327,8 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onCreateNew: function(menu, type) {
|
onCreateNew: function(menu, type) {
|
||||||
if (this.mode.nativeApp === true) {
|
var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank");
|
||||||
this.api.OpenNewDocument(type == 'blank' ? '' : type);
|
if (newDocumentPage) newDocumentPage.focus();
|
||||||
} else {
|
|
||||||
var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank");
|
|
||||||
if (newDocumentPage) newDocumentPage.focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (menu) {
|
if (menu) {
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,10 +298,9 @@ define([
|
||||||
|
|
||||||
this.editorConfig.user =
|
this.editorConfig.user =
|
||||||
this.appOptions.user = Common.Utils.fillUserInfo(data.config.user, this.editorConfig.lang, this.textAnonymous);
|
this.appOptions.user = Common.Utils.fillUserInfo(data.config.user, this.editorConfig.lang, this.textAnonymous);
|
||||||
this.appOptions.nativeApp = this.editorConfig.nativeApp === true;
|
|
||||||
this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop';
|
this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop';
|
||||||
this.appOptions.canCreateNew = !_.isEmpty(this.editorConfig.createUrl) && !this.appOptions.isDesktopApp;
|
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.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp;
|
||||||
this.appOptions.templates = this.editorConfig.templates;
|
this.appOptions.templates = this.editorConfig.templates;
|
||||||
this.appOptions.recent = this.editorConfig.recent;
|
this.appOptions.recent = this.editorConfig.recent;
|
||||||
this.appOptions.createUrl = this.editorConfig.createUrl;
|
this.appOptions.createUrl = this.editorConfig.createUrl;
|
||||||
|
@ -314,7 +313,7 @@ define([
|
||||||
this.appOptions.customization = this.editorConfig.customization;
|
this.appOptions.customization = this.editorConfig.customization;
|
||||||
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object')
|
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object')
|
||||||
&& (typeof (this.editorConfig.customization.goback) == 'object') && !_.isEmpty(this.editorConfig.customization.goback.url);
|
&& (typeof (this.editorConfig.customization.goback) == 'object') && !_.isEmpty(this.editorConfig.customization.goback.url);
|
||||||
this.appOptions.canBack = this.editorConfig.nativeApp !== true && this.appOptions.canBackToFolder === true;
|
this.appOptions.canBack = this.appOptions.canBackToFolder === true;
|
||||||
this.appOptions.canPlugins = false;
|
this.appOptions.canPlugins = false;
|
||||||
this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers;
|
this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers;
|
||||||
this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify;
|
this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify;
|
||||||
|
@ -359,7 +358,6 @@ define([
|
||||||
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
|
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
|
||||||
docInfo.put_Token(data.doc.token);
|
docInfo.put_Token(data.doc.token);
|
||||||
docInfo.put_Permissions(_permissions);
|
docInfo.put_Permissions(_permissions);
|
||||||
//docInfo.put_OfflineApp(this.editorConfig.nativeApp === true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
|
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
|
||||||
|
@ -900,7 +898,7 @@ define([
|
||||||
this.appOptions.canEdit = this.permissions.edit !== false && // can edit
|
this.appOptions.canEdit = this.permissions.edit !== false && // can edit
|
||||||
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
|
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
|
||||||
this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
|
this.appOptions.isEdit = this.appOptions.canLicense && this.appOptions.canEdit && this.editorConfig.mode !== 'view';
|
||||||
this.appOptions.canDownload = !this.appOptions.nativeApp && this.permissions.download !== false;
|
this.appOptions.canDownload = this.permissions.download !== false;
|
||||||
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
|
this.appOptions.canAnalytics = params.asc_getIsAnalyticsEnable();
|
||||||
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
|
this.appOptions.canComments = this.appOptions.canLicense && (this.permissions.comment===undefined ? this.appOptions.isEdit : this.permissions.comment) && (this.editorConfig.mode !== 'view');
|
||||||
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
|
||||||
|
|
|
@ -1242,16 +1242,6 @@ define([
|
||||||
this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]});
|
this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]});
|
||||||
|
|
||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
if (!mode.nativeApp) {
|
|
||||||
var nativeBtnGroup = $('.toolbar-group-native');
|
|
||||||
|
|
||||||
if (nativeBtnGroup) {
|
|
||||||
nativeBtnGroup.hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode.isDesktopApp)
|
|
||||||
$('.toolbar-group-native').hide();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onSendThemeColorSchemes: function (schemas) {
|
onSendThemeColorSchemes: function (schemas) {
|
||||||
|
|
|
@ -197,10 +197,9 @@ define([
|
||||||
|
|
||||||
me.editorConfig.user =
|
me.editorConfig.user =
|
||||||
me.appOptions.user = Common.Utils.fillUserInfo(me.editorConfig.user, me.editorConfig.lang, me.textAnonymous);
|
me.appOptions.user = Common.Utils.fillUserInfo(me.editorConfig.user, me.editorConfig.lang, me.textAnonymous);
|
||||||
me.appOptions.nativeApp = me.editorConfig.nativeApp === true;
|
|
||||||
me.appOptions.isDesktopApp = me.editorConfig.targetApp == 'desktop';
|
me.appOptions.isDesktopApp = me.editorConfig.targetApp == 'desktop';
|
||||||
me.appOptions.canCreateNew = !_.isEmpty(me.editorConfig.createUrl) && !me.appOptions.isDesktopApp;
|
me.appOptions.canCreateNew = !_.isEmpty(me.editorConfig.createUrl) && !me.appOptions.isDesktopApp;
|
||||||
me.appOptions.canOpenRecent = me.editorConfig.nativeApp !== true && me.editorConfig.recent !== undefined && !me.appOptions.isDesktopApp;
|
me.appOptions.canOpenRecent = me.editorConfig.recent !== undefined && !me.appOptions.isDesktopApp;
|
||||||
me.appOptions.templates = me.editorConfig.templates;
|
me.appOptions.templates = me.editorConfig.templates;
|
||||||
me.appOptions.recent = me.editorConfig.recent;
|
me.appOptions.recent = me.editorConfig.recent;
|
||||||
me.appOptions.createUrl = me.editorConfig.createUrl;
|
me.appOptions.createUrl = me.editorConfig.createUrl;
|
||||||
|
@ -213,7 +212,7 @@ define([
|
||||||
me.appOptions.customization = me.editorConfig.customization;
|
me.appOptions.customization = me.editorConfig.customization;
|
||||||
me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object')
|
me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object')
|
||||||
&& (typeof (me.editorConfig.customization.goback) == 'object') && !_.isEmpty(me.editorConfig.customization.goback.url);
|
&& (typeof (me.editorConfig.customization.goback) == 'object') && !_.isEmpty(me.editorConfig.customization.goback.url);
|
||||||
me.appOptions.canBack = me.editorConfig.nativeApp !== true && me.appOptions.canBackToFolder === true;
|
me.appOptions.canBack = me.appOptions.canBackToFolder === true;
|
||||||
me.appOptions.canPlugins = false;
|
me.appOptions.canPlugins = false;
|
||||||
me.plugins = me.editorConfig.plugins;
|
me.plugins = me.editorConfig.plugins;
|
||||||
|
|
||||||
|
@ -670,8 +669,8 @@ define([
|
||||||
me.appOptions.canPrint = (me.permissions.print !== false);
|
me.appOptions.canPrint = (me.permissions.print !== false);
|
||||||
|
|
||||||
var type = /^(?:(pdf|djvu|xps))$/.exec(me.document.fileType);
|
var type = /^(?:(pdf|djvu|xps))$/.exec(me.document.fileType);
|
||||||
me.appOptions.canDownloadOrigin = !me.appOptions.nativeApp && me.permissions.download !== false && (type && typeof type[1] === 'string');
|
me.appOptions.canDownloadOrigin = me.permissions.download !== false && (type && typeof type[1] === 'string');
|
||||||
me.appOptions.canDownload = !me.appOptions.nativeApp && me.permissions.download !== false && (!type || typeof type[1] !== 'string');
|
me.appOptions.canDownload = me.permissions.download !== false && (!type || typeof type[1] !== 'string');
|
||||||
|
|
||||||
me.appOptions.canBranding = params.asc_getCustomization();
|
me.appOptions.canBranding = params.asc_getCustomization();
|
||||||
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
|
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');
|
||||||
|
|
|
@ -385,13 +385,8 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onCreateNew: function(menu, type) {
|
onCreateNew: function(menu, type) {
|
||||||
if (this.mode.nativeApp === true) {
|
var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank");
|
||||||
this.api.asc_openNewDocument(type == 'blank' ? '' : type);
|
if (newDocumentPage) newDocumentPage.focus();
|
||||||
} else {
|
|
||||||
var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank");
|
|
||||||
if (newDocumentPage) newDocumentPage.focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (menu) {
|
if (menu) {
|
||||||
menu.hide();
|
menu.hide();
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,10 +300,9 @@ define([
|
||||||
|
|
||||||
this.editorConfig.user =
|
this.editorConfig.user =
|
||||||
this.appOptions.user = Common.Utils.fillUserInfo(this.editorConfig.user, this.editorConfig.lang, this.textAnonymous);
|
this.appOptions.user = Common.Utils.fillUserInfo(this.editorConfig.user, this.editorConfig.lang, this.textAnonymous);
|
||||||
this.appOptions.nativeApp = this.editorConfig.nativeApp === true;
|
|
||||||
this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop';
|
this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop';
|
||||||
this.appOptions.canCreateNew = !_.isEmpty(this.editorConfig.createUrl) && !this.appOptions.isDesktopApp;
|
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.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp;
|
||||||
this.appOptions.templates = this.editorConfig.templates;
|
this.appOptions.templates = this.editorConfig.templates;
|
||||||
this.appOptions.recent = this.editorConfig.recent;
|
this.appOptions.recent = this.editorConfig.recent;
|
||||||
this.appOptions.createUrl = this.editorConfig.createUrl;
|
this.appOptions.createUrl = this.editorConfig.createUrl;
|
||||||
|
@ -319,7 +318,7 @@ define([
|
||||||
this.appOptions.customization = this.editorConfig.customization;
|
this.appOptions.customization = this.editorConfig.customization;
|
||||||
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object')
|
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object')
|
||||||
&& (typeof (this.editorConfig.customization.goback) == 'object') && !_.isEmpty(this.editorConfig.customization.goback.url);
|
&& (typeof (this.editorConfig.customization.goback) == 'object') && !_.isEmpty(this.editorConfig.customization.goback.url);
|
||||||
this.appOptions.canBack = this.editorConfig.nativeApp !== true && this.appOptions.canBackToFolder === true;
|
this.appOptions.canBack = this.appOptions.canBackToFolder === true;
|
||||||
this.appOptions.canPlugins = false;
|
this.appOptions.canPlugins = false;
|
||||||
this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers;
|
this.appOptions.canRequestUsers = this.editorConfig.canRequestUsers;
|
||||||
this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify;
|
this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify;
|
||||||
|
@ -933,7 +932,7 @@ define([
|
||||||
this.appOptions.canEdit = this.permissions.edit !== false && // can edit
|
this.appOptions.canEdit = this.permissions.edit !== false && // can edit
|
||||||
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
|
(this.editorConfig.canRequestEditRights || this.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
|
||||||
this.appOptions.isEdit = (this.appOptions.canLicense || this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && this.permissions.edit !== false && this.editorConfig.mode !== 'view';
|
this.appOptions.isEdit = (this.appOptions.canLicense || this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) && this.permissions.edit !== false && this.editorConfig.mode !== 'view';
|
||||||
this.appOptions.canDownload = !this.appOptions.nativeApp && (this.permissions.download !== false);
|
this.appOptions.canDownload = (this.permissions.download !== false);
|
||||||
this.appOptions.canPrint = (this.permissions.print !== false);
|
this.appOptions.canPrint = (this.permissions.print !== false);
|
||||||
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) &&
|
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) &&
|
||||||
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
|
||||||
|
@ -973,8 +972,7 @@ define([
|
||||||
statusbarView = app.getController('Statusbar').getView('Statusbar');
|
statusbarView = app.getController('Statusbar').getView('Statusbar');
|
||||||
|
|
||||||
if (this.headerView) {
|
if (this.headerView) {
|
||||||
this.headerView.setVisible(!this.appOptions.nativeApp && !this.appOptions.isEditMailMerge &&
|
this.headerView.setVisible(!this.appOptions.isEditMailMerge && !this.appOptions.isDesktopApp && !this.appOptions.isEditDiagram);
|
||||||
!this.appOptions.isDesktopApp && !this.appOptions.isEditDiagram);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
viewport && viewport.setMode(this.appOptions, true);
|
viewport && viewport.setMode(this.appOptions, true);
|
||||||
|
|
|
@ -202,10 +202,9 @@ define([
|
||||||
|
|
||||||
me.editorConfig.user =
|
me.editorConfig.user =
|
||||||
me.appOptions.user = Common.Utils.fillUserInfo(me.editorConfig.user, me.editorConfig.lang, me.textAnonymous);
|
me.appOptions.user = Common.Utils.fillUserInfo(me.editorConfig.user, me.editorConfig.lang, me.textAnonymous);
|
||||||
me.appOptions.nativeApp = me.editorConfig.nativeApp === true;
|
|
||||||
me.appOptions.isDesktopApp = me.editorConfig.targetApp == 'desktop';
|
me.appOptions.isDesktopApp = me.editorConfig.targetApp == 'desktop';
|
||||||
me.appOptions.canCreateNew = !_.isEmpty(me.editorConfig.createUrl) && !me.appOptions.isDesktopApp;
|
me.appOptions.canCreateNew = !_.isEmpty(me.editorConfig.createUrl) && !me.appOptions.isDesktopApp;
|
||||||
me.appOptions.canOpenRecent = me.editorConfig.nativeApp !== true && me.editorConfig.recent !== undefined && !me.appOptions.isDesktopApp;
|
me.appOptions.canOpenRecent = me.editorConfig.recent !== undefined && !me.appOptions.isDesktopApp;
|
||||||
me.appOptions.templates = me.editorConfig.templates;
|
me.appOptions.templates = me.editorConfig.templates;
|
||||||
me.appOptions.recent = me.editorConfig.recent;
|
me.appOptions.recent = me.editorConfig.recent;
|
||||||
me.appOptions.createUrl = me.editorConfig.createUrl;
|
me.appOptions.createUrl = me.editorConfig.createUrl;
|
||||||
|
@ -218,7 +217,7 @@ define([
|
||||||
me.appOptions.customization = me.editorConfig.customization;
|
me.appOptions.customization = me.editorConfig.customization;
|
||||||
me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object')
|
me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object')
|
||||||
&& (typeof (me.editorConfig.customization.goback) == 'object') && !_.isEmpty(me.editorConfig.customization.goback.url);
|
&& (typeof (me.editorConfig.customization.goback) == 'object') && !_.isEmpty(me.editorConfig.customization.goback.url);
|
||||||
me.appOptions.canBack = me.editorConfig.nativeApp !== true && me.appOptions.canBackToFolder === true;
|
me.appOptions.canBack = me.appOptions.canBackToFolder === true;
|
||||||
me.appOptions.canPlugins = false;
|
me.appOptions.canPlugins = false;
|
||||||
me.plugins = me.editorConfig.plugins;
|
me.plugins = me.editorConfig.plugins;
|
||||||
|
|
||||||
|
@ -694,7 +693,7 @@ define([
|
||||||
me.appOptions.canEdit = me.permissions.edit !== false && // can edit
|
me.appOptions.canEdit = me.permissions.edit !== false && // can edit
|
||||||
(me.editorConfig.canRequestEditRights || me.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
|
(me.editorConfig.canRequestEditRights || me.editorConfig.mode !== 'view'); // if mode=="view" -> canRequestEditRights must be defined
|
||||||
me.appOptions.isEdit = (me.appOptions.canLicense || me.appOptions.isEditDiagram || me.appOptions.isEditMailMerge) && me.permissions.edit !== false && me.editorConfig.mode !== 'view';
|
me.appOptions.isEdit = (me.appOptions.canLicense || me.appOptions.isEditDiagram || me.appOptions.isEditMailMerge) && me.permissions.edit !== false && me.editorConfig.mode !== 'view';
|
||||||
me.appOptions.canDownload = !me.appOptions.nativeApp && (me.permissions.download !== false);
|
me.appOptions.canDownload = (me.permissions.download !== false);
|
||||||
me.appOptions.canPrint = (me.permissions.print !== false);
|
me.appOptions.canPrint = (me.permissions.print !== false);
|
||||||
|
|
||||||
me.applyModeCommonElements();
|
me.applyModeCommonElements();
|
||||||
|
|
Loading…
Reference in a new issue