Show beta version label

This commit is contained in:
Julia Radzhabova 2020-11-02 23:26:17 +03:00
parent 131e2a8452
commit 92d4fec022
12 changed files with 98 additions and 36 deletions

View file

@ -206,7 +206,7 @@ define([
this.leftMenu.setOptionsPanel('navigation', this.getApplication().getController('Navigation').getView('Navigation'));
this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode);
(this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion);
Common.util.Shortcuts.resumeEvents();
return this;
@ -218,7 +218,7 @@ define([
this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins'));
} else
this.leftMenu.btnPlugins.hide();
this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode);
(this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion);
},
clickMenuFileItem: function(menu, action, isopts) {

View file

@ -1233,6 +1233,7 @@ define([
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.isBeta = params.asc_getIsBeta();
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isProtectionSupport();
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);

View file

@ -381,16 +381,29 @@ define([
Common.NotificationCenter.trigger('layout:changed', 'history');
},
setDeveloperMode: function(mode) {
setDeveloperMode: function(mode, beta, version) {
if ( !this.$el.is(':visible') ) return;
if (!this.developerHint) {
this.developerHint = $('<div id="developer-hint">' + ((mode == Asc.c_oLicenseMode.Trial) ? this.txtTrial.toLocaleUpperCase() : this.txtDeveloper.toLocaleUpperCase()) + '</div>').appendTo(this.$el);
this.devHeight = this.developerHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
if (mode) {
if (!this.developerHint) {
this.developerHint = $('<div id="developer-hint">' + ((mode == Asc.c_oLicenseMode.Trial) ? this.txtTrial.toLocaleUpperCase() : this.txtDeveloper.toLocaleUpperCase()) + '</div>').appendTo(this.$el);
this.devHeight = this.developerHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
}
this.developerHint.toggleClass('hidden', !mode);
}
if (beta) {
if (!this.betaHint) {
var style = (mode) ? 'style="margin-top: 4px;"' : '',
arr = (version || '').split('.'),
ver = '';
(arr.length>0) && (ver += ('v. ' + arr[0]));
(arr.length>1) && (ver += ('.' + arr[0]));
this.betaHint = $('<div id="beta-hint"' + style + '>' + (ver + ' (beta)' ) + '</div>').appendTo(this.$el);
this.betaHeight = this.betaHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
}
this.betaHint.toggleClass('hidden', !beta);
}
this.developerHint.toggleClass('hidden', !mode);
var btns = this.$el.find('button.btn-category:visible'),
lastbtn = (btns.length>0) ? $(btns[btns.length-1]) : null;
this.minDevPosition = (lastbtn) ? (lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20) : 20;
@ -398,7 +411,13 @@ define([
},
onWindowResize: function() {
this.developerHint.css('top', Math.max((this.$el.height()-this.devHeight)/2, this.minDevPosition));
var height = (this.devHeight || 0) + (this.betaHeight || 0);
var top = Math.max((this.$el.height()-height)/2, this.minDevPosition);
if (this.developerHint) {
this.developerHint.css('top', top);
top += this.devHeight;
}
this.betaHint && this.betaHint.css('top', top);
},
/** coauthoring begin **/
tipComments : 'Comments',

View file

@ -51,7 +51,7 @@
overflow: hidden;
}
#developer-hint {
#developer-hint, #beta-hint {
position: absolute;
left: 0;
padding: 12px 0;

View file

@ -192,7 +192,7 @@ define([
this.leftMenu.btnChat.hide();
this.leftMenu.btnComments.hide();
}
this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode);
(this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion);
/** coauthoring end **/
Common.util.Shortcuts.resumeEvents();
this.leftMenu.btnThumbs.toggle(true);
@ -205,7 +205,7 @@ define([
this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins'));
} else
this.leftMenu.btnPlugins.hide();
this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode);
(this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion);
},
clickMenuFileItem: function(menu, action, isopts) {

View file

@ -954,7 +954,9 @@ define([
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
this.appOptions.buildVersion = params.asc_getBuildVersion();
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.isBeta = params.asc_getIsBeta();
this.appOptions.isSignatureSupport= this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport();
this.appOptions.isPasswordSupport = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isProtectionSupport();
this.appOptions.canProtect = (this.appOptions.isSignatureSupport || this.appOptions.isPasswordSupport);

View file

@ -359,16 +359,29 @@ define([
return this;
},
setDeveloperMode: function(mode) {
setDeveloperMode: function(mode, beta, version) {
if ( !this.$el.is(':visible') ) return;
if (!this.developerHint) {
this.developerHint = $('<div id="developer-hint">' + ((mode == Asc.c_oLicenseMode.Trial) ? this.txtTrial.toLocaleUpperCase() : this.txtDeveloper.toLocaleUpperCase()) + '</div>').appendTo(this.$el);
this.devHeight = this.developerHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
if (mode) {
if (!this.developerHint) {
this.developerHint = $('<div id="developer-hint">' + ((mode == Asc.c_oLicenseMode.Trial) ? this.txtTrial.toLocaleUpperCase() : this.txtDeveloper.toLocaleUpperCase()) + '</div>').appendTo(this.$el);
this.devHeight = this.developerHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
}
this.developerHint.toggleClass('hidden', !mode);
}
if (beta) {
if (!this.betaHint) {
var style = (mode) ? 'style="margin-top: 4px;"' : '',
arr = (version || '').split('.'),
ver = '';
(arr.length>0) && (ver += ('v. ' + arr[0]));
(arr.length>1) && (ver += ('.' + arr[0]));
this.betaHint = $('<div id="beta-hint"' + style + '>' + (ver + ' (beta)' ) + '</div>').appendTo(this.$el);
this.betaHeight = this.betaHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
}
this.betaHint.toggleClass('hidden', !beta);
}
this.developerHint.toggleClass('hidden', !mode);
var btns = this.$el.find('button.btn-category:visible'),
lastbtn = (btns.length>0) ? $(btns[btns.length-1]) : null;
this.minDevPosition = (lastbtn) ? (lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20) : 20;
@ -376,7 +389,13 @@ define([
},
onWindowResize: function() {
this.developerHint.css('top', Math.max((this.$el.height()-this.devHeight)/2, this.minDevPosition));
var height = (this.devHeight || 0) + (this.betaHeight || 0);
var top = Math.max((this.$el.height()-height)/2, this.minDevPosition);
if (this.developerHint) {
this.developerHint.css('top', top);
top += this.devHeight;
}
this.betaHint && this.betaHint.css('top', top);
},
/** coauthoring begin **/

View file

@ -485,7 +485,7 @@
}
}
#developer-hint {
#developer-hint, #beta-hint {
position: absolute;
left: 0;
padding: 12px 0;

View file

@ -217,7 +217,7 @@ define([
this.leftMenu.setOptionsPanel('spellcheck', this.getApplication().getController('Spellcheck').getView('Spellcheck'));
}
this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode);
(this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion);
/** coauthoring end **/
Common.util.Shortcuts.resumeEvents();
if (!this.mode.isEditMailMerge && !this.mode.isEditDiagram)
@ -231,7 +231,7 @@ define([
this.leftMenu.setOptionsPanel('plugins', this.getApplication().getController('Common.Controllers.Plugins').getView('Common.Views.Plugins'));
} else
this.leftMenu.btnPlugins.hide();
this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode);
(this.mode.trialMode || this.mode.isBeta) && this.leftMenu.setDeveloperMode(this.mode.trialMode, this.mode.isBeta, this.mode.buildVersion);
},
clickMenuFileItem: function(menu, action, isopts) {

View file

@ -1015,7 +1015,9 @@ define([
this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canRename = this.editorConfig.canRename;
this.appOptions.buildVersion = params.asc_getBuildVersion();
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.isBeta = params.asc_getIsBeta();
this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false);
this.appOptions.canBranding = params.asc_getCustomization();
if (this.appOptions.canBranding)

View file

@ -349,16 +349,29 @@ define([
return this;
},
setDeveloperMode: function(mode) {
setDeveloperMode: function(mode, beta, version) {
if ( !this.$el.is(':visible') ) return;
if (!this.developerHint) {
this.developerHint = $('<div id="developer-hint">' + ((mode == Asc.c_oLicenseMode.Trial) ? this.txtTrial.toLocaleUpperCase() : this.txtDeveloper.toLocaleUpperCase()) + '</div>').appendTo(this.$el);
this.devHeight = this.developerHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
if (mode) {
if (!this.developerHint) {
this.developerHint = $('<div id="developer-hint">' + ((mode == Asc.c_oLicenseMode.Trial) ? this.txtTrial.toLocaleUpperCase() : this.txtDeveloper.toLocaleUpperCase()) + '</div>').appendTo(this.$el);
this.devHeight = this.developerHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
}
this.developerHint.toggleClass('hidden', !mode);
}
if (beta) {
if (!this.betaHint) {
var style = (mode) ? 'style="margin-top: 4px;"' : '',
arr = (version || '').split('.'),
ver = '';
(arr.length>0) && (ver += ('v. ' + arr[0]));
(arr.length>1) && (ver += ('.' + arr[0]));
this.betaHint = $('<div id="beta-hint"' + style + '>' + (ver + ' (beta)' ) + '</div>').appendTo(this.$el);
this.betaHeight = this.betaHint.outerHeight();
$(window).on('resize', _.bind(this.onWindowResize, this));
}
this.betaHint.toggleClass('hidden', !beta);
}
this.developerHint.toggleClass('hidden', !mode);
var btns = this.$el.find('button.btn-category:visible'),
lastbtn = (btns.length>0) ? $(btns[btns.length-1]) : null;
this.minDevPosition = (lastbtn) ? (lastbtn.offset().top - lastbtn.offsetParent().offset().top + lastbtn.height() + 20) : 20;
@ -366,7 +379,13 @@ define([
},
onWindowResize: function() {
this.developerHint.css('top', Math.max((this.$el.height()-this.devHeight)/2, this.minDevPosition));
var height = (this.devHeight || 0) + (this.betaHeight || 0);
var top = Math.max((this.$el.height()-height)/2, this.minDevPosition);
if (this.developerHint) {
this.developerHint.css('top', top);
top += this.devHeight;
}
this.betaHint && this.betaHint.css('top', top);
},
/** coauthoring begin **/

View file

@ -549,7 +549,7 @@
}
}
#developer-hint {
#developer-hint, #beta-hint {
position: absolute;
left: 0;
padding: 12px 0;