[PE][SSE] Remove nativeApp flag

This commit is contained in:
Julia Radzhabova 2019-07-15 11:01:29 +03:00
parent bd6071ccd2
commit 15b584c235
8 changed files with 18 additions and 45 deletions

View file

@ -391,7 +391,6 @@ define([
docInfo.put_Token(data.doc.token);
docInfo.put_Permissions(_permissions);
// 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);
if (type && typeof type[1] === 'string') {

View file

@ -327,13 +327,8 @@ define([
},
onCreateNew: function(menu, type) {
if (this.mode.nativeApp === true) {
this.api.OpenNewDocument(type == 'blank' ? '' : type);
} else {
var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank");
if (newDocumentPage) newDocumentPage.focus();
}
if (menu) {
menu.hide();
}

View file

@ -298,10 +298,9 @@ define([
this.editorConfig.user =
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.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.recent = this.editorConfig.recent;
this.appOptions.createUrl = this.editorConfig.createUrl;
@ -314,7 +313,7 @@ define([
this.appOptions.customization = this.editorConfig.customization;
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object')
&& (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.canRequestUsers = this.editorConfig.canRequestUsers;
this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify;
@ -359,7 +358,6 @@ define([
docInfo.put_CallbackUrl(this.editorConfig.callbackUrl);
docInfo.put_Token(data.doc.token);
docInfo.put_Permissions(_permissions);
//docInfo.put_OfflineApp(this.editorConfig.nativeApp === true);
}
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.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.canDownload = !this.appOptions.nativeApp && this.permissions.download !== false;
this.appOptions.canDownload = this.permissions.download !== false;
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.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);

View file

@ -1242,16 +1242,6 @@ define([
this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]});
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) {

View file

@ -197,10 +197,9 @@ define([
me.editorConfig.user =
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.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.recent = me.editorConfig.recent;
me.appOptions.createUrl = me.editorConfig.createUrl;
@ -213,7 +212,7 @@ define([
me.appOptions.customization = me.editorConfig.customization;
me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object')
&& (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.plugins = me.editorConfig.plugins;
@ -670,8 +669,8 @@ define([
me.appOptions.canPrint = (me.permissions.print !== false);
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.canDownload = !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.permissions.download !== false && (!type || typeof type[1] !== 'string');
me.appOptions.canBranding = params.asc_getCustomization();
me.appOptions.canBrandingExt = params.asc_getCanBranding() && (typeof me.editorConfig.customization == 'object');

View file

@ -385,13 +385,8 @@ define([
},
onCreateNew: function(menu, type) {
if (this.mode.nativeApp === true) {
this.api.asc_openNewDocument(type == 'blank' ? '' : type);
} else {
var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank");
if (newDocumentPage) newDocumentPage.focus();
}
if (menu) {
menu.hide();
}

View file

@ -300,10 +300,9 @@ define([
this.editorConfig.user =
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.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.recent = this.editorConfig.recent;
this.appOptions.createUrl = this.editorConfig.createUrl;
@ -319,7 +318,7 @@ define([
this.appOptions.customization = this.editorConfig.customization;
this.appOptions.canBackToFolder = (this.editorConfig.canBackToFolder!==false) && (typeof (this.editorConfig.customization) == 'object')
&& (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.canRequestUsers = this.editorConfig.canRequestUsers;
this.appOptions.canRequestSendNotify = this.editorConfig.canRequestSendNotify;
@ -933,7 +932,7 @@ define([
this.appOptions.canEdit = this.permissions.edit !== false && // can edit
(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.canDownload = !this.appOptions.nativeApp && (this.permissions.download !== false);
this.appOptions.canDownload = (this.permissions.download !== false);
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge) &&
(typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
@ -973,8 +972,7 @@ define([
statusbarView = app.getController('Statusbar').getView('Statusbar');
if (this.headerView) {
this.headerView.setVisible(!this.appOptions.nativeApp && !this.appOptions.isEditMailMerge &&
!this.appOptions.isDesktopApp && !this.appOptions.isEditDiagram);
this.headerView.setVisible(!this.appOptions.isEditMailMerge && !this.appOptions.isDesktopApp && !this.appOptions.isEditDiagram);
}
viewport && viewport.setMode(this.appOptions, true);

View file

@ -202,10 +202,9 @@ define([
me.editorConfig.user =
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.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.recent = me.editorConfig.recent;
me.appOptions.createUrl = me.editorConfig.createUrl;
@ -218,7 +217,7 @@ define([
me.appOptions.customization = me.editorConfig.customization;
me.appOptions.canBackToFolder = (me.editorConfig.canBackToFolder!==false) && (typeof (me.editorConfig.customization) == 'object')
&& (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.plugins = me.editorConfig.plugins;
@ -694,7 +693,7 @@ define([
me.appOptions.canEdit = me.permissions.edit !== false && // can edit
(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.canDownload = !me.appOptions.nativeApp && (me.permissions.download !== false);
me.appOptions.canDownload = (me.permissions.download !== false);
me.appOptions.canPrint = (me.permissions.print !== false);
me.applyModeCommonElements();