Merge branch 'develop' into feature/optimization

This commit is contained in:
Julia Radzhabova 2019-08-27 13:48:14 +03:00
commit 36e83f7cb3
22 changed files with 146 additions and 50 deletions

View file

@ -670,13 +670,13 @@ define([
}
});
} else if (config.canViewReview) {
config.canViewReview = me.api.asc_HaveRevisionsChanges(true); // check revisions from all users
config.canViewReview = (config.isEdit || me.api.asc_HaveRevisionsChanges(true)); // check revisions from all users
if (config.canViewReview) {
var val = Common.localStorage.getItem(me.view.appPrefix + "review-mode");
if (val===null)
val = me.appConfig.customization && /^(original|final|markup)$/i.test(me.appConfig.customization.reviewDisplay) ? me.appConfig.customization.reviewDisplay.toLocaleLowerCase() : 'original';
me.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val); // load display mode only in viewer
me.view.turnDisplayMode(config.isRestrictedEdit ? 'markup' : val);
me.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val); // load display mode only in viewer
me.view.turnDisplayMode((config.isEdit || config.isRestrictedEdit) ? 'markup' : val);
}
}

View file

@ -209,7 +209,10 @@ define([
Common.Utils.addScrollIfNeed('.page[data-page=comments-view]', '.page[data-page=comments-view] .page-content');
} else {
if(editor === 'DE' && !this.appConfig.canReview) {
$('#reviewing-settings').hide();
this.canViewReview = me.api.asc_HaveRevisionsChanges(true);
if (!this.canViewReview) {
$('#reviewing-settings').hide();
}
}
}
},
@ -282,6 +285,11 @@ define([
$('#settings-reject-all').removeClass('disabled');
$('#settings-review').removeClass('disabled');
}
if (!this.appConfig.canReview) {
$('#settings-review').hide();
$('#settings-accept-all').hide();
$('#settings-reject-all').hide();
}
},
onTrackChanges: function(e) {
@ -384,6 +392,10 @@ define([
$('#btn-prev-change').addClass('disabled');
$('#btn-next-change').addClass('disabled');
}
if (!this.appConfig.canReview) {
$('#btn-accept-change').addClass('disabled');
$('#btn-reject-change').addClass('disabled');
}
},
onPrevChange: function() {

View file

@ -134,11 +134,14 @@ define([
}
}, this));
diagramEditor.on('hide', _.bind(function(cmp, message) {
this.documentHolder.fireEvent('editcomplete', this.documentHolder);
if (this.api) {
this.api.asc_onCloseChartFrame();
this.api.asc_enableKeyEvents(true);
}
var me = this;
setTimeout(function(){
me.documentHolder.fireEvent('editcomplete', me.documentHolder);
}, 10);
}, this));
}
@ -151,10 +154,13 @@ define([
this.api.asc_setMailMergeData(data);
}, this));
mergeEditor.on('hide', _.bind(function(cmp, message) {
this.documentHolder.fireEvent('editcomplete', this.documentHolder);
if (this.api) {
this.api.asc_enableKeyEvents(true);
}
var me = this;
setTimeout(function(){
me.documentHolder.fireEvent('editcomplete', me.documentHolder);
}, 10);
}, this));
}
},

View file

@ -2115,6 +2115,17 @@ define([
this.beforeShowDummyComment = true;
},
DisableMailMerge: function() {
this.appOptions.mergeFolderUrl = "";
var toolbarController = this.getApplication().getController('Toolbar');
toolbarController && toolbarController.DisableMailMerge();
},
DisableVersionHistory: function() {
this.editorConfig.canUseHistory = false;
this.appOptions.canUseHistory = false;
},
leavePageText: 'You have unsaved changes in this document. Click \'Stay on this Page\' then \'Save\' to save them. Click \'Leave this Page\' to discard all the unsaved changes.',
criticalErrorTitle: 'Error',
notcriticalErrorTitle: 'Warning',

View file

@ -2616,7 +2616,7 @@ define([
this.toolbar.btnRedo.setDisabled(this._state.can_redo!==true);
this.toolbar.btnCopy.setDisabled(this._state.can_copycut!==true);
this.toolbar.btnPrint.setDisabled(!this.toolbar.mode.canPrint);
if (this.toolbar.mode.fileChoiceUrl || this.toolbar.mode.canRequestMailMergeRecipients)
if (!this._state.mmdisable && (this.toolbar.mode.fileChoiceUrl || this.toolbar.mode.canRequestMailMergeRecipients))
this.toolbar.btnMailRecepients.setDisabled(false);
this._state.activated = true;
@ -2624,6 +2624,11 @@ define([
this.onApiPageSize(props.get_W(), props.get_H());
},
DisableMailMerge: function() {
this._state.mmdisable = true;
this.toolbar && this.toolbar.btnMailRecepients && this.toolbar.btnMailRecepients.setDisabled(true);
},
updateThemeColors: function() {
var updateColors = function(picker, defaultColorIndex) {
if (picker) {

View file

@ -71,6 +71,7 @@ define([
].join('');
this.options.tpl = _.template(this.template)(this.options);
this.options.formats = this.options.formats || [];
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@ -100,6 +101,7 @@ define([
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
this.options.formats.unshift({value: -1, displayValue: this.txtSameAs});
this.cmbNextStyle = new Common.UI.ComboBox({
el : $('#id-dlg-style-next-par'),
style : 'width: 100%;',
@ -109,8 +111,7 @@ define([
data : this.options.formats,
disabled : (this.options.formats.length==0)
});
if (this.options.formats.length>0)
this.cmbNextStyle.setValue(this.options.formats[0].value);
this.cmbNextStyle.setValue(-1);
},
show: function() {
@ -128,8 +129,8 @@ define([
},
getNextStyle: function () {
var me = this;
return (me.options.formats.length>0) ? me.cmbNextStyle.getValue() : null;
var val = this.cmbNextStyle.getValue();
return (val!=-1) ? val : null;
},
onBtnClick: function(event) {
@ -161,7 +162,8 @@ define([
textHeader: 'Create New Style',
txtEmpty: 'This field is required',
txtNotEmpty: 'Field must not be empty',
textNextStyle: 'Next paragraph style'
textNextStyle: 'Next paragraph style',
txtSameAs: 'Same as created new style'
}, DE.Views.StyleTitleDialog || {}))

View file

@ -1873,6 +1873,7 @@
"DE.Views.StyleTitleDialog.textTitle": "Title",
"DE.Views.StyleTitleDialog.txtEmpty": "This field is required",
"DE.Views.StyleTitleDialog.txtNotEmpty": "Field must not be empty",
"DE.Views.StyleTitleDialog.txtSameAs": "Same as created new style",
"DE.Views.TableFormulaDialog.cancelButtonText": "Cancel",
"DE.Views.TableFormulaDialog.okButtonText": "OK",
"DE.Views.TableFormulaDialog.textBookmark": "Paste Bookmark",

View file

@ -1873,6 +1873,7 @@
"DE.Views.StyleTitleDialog.textTitle": "Название",
"DE.Views.StyleTitleDialog.txtEmpty": "Это поле необходимо заполнить",
"DE.Views.StyleTitleDialog.txtNotEmpty": "Поле не может быть пустым",
"DE.Views.StyleTitleDialog.txtSameAs": "Такой же, как создаваемый стиль",
"DE.Views.TableFormulaDialog.cancelButtonText": "Отмена",
"DE.Views.TableFormulaDialog.okButtonText": "ОК",
"DE.Views.TableFormulaDialog.textBookmark": "Вставить закладку",

View file

@ -183,7 +183,7 @@ require([
//Store Framework7 initialized instance for easy access
window.uiApp = new Framework7({
// Default title for modals
modalTitle: '{{MOBILE_MODAL_TITLE}}',
modalTitle: '{{APP_TITLE_TEXT}}',
// Enable tap hold events
tapHold: true,

View file

@ -553,7 +553,18 @@ define([
},
onShowHelp: function () {
window.open('{{SUPPORT_URL}}', "_blank");
var url = '{{HELP_URL}}';
if (url.charAt(url.length-1) !== '/') {
url += '/';
}
if (Common.SharedSettings.get('sailfish')) {
url+='mobile-applications/documents/sailfish/index.aspx';
} else if (Common.SharedSettings.get('android')) {
url+='mobile-applications/documents/android/index.aspx';
} else {
url+='mobile-applications/documents/index.aspx';
}
window.open(url, "_blank");
this.hideModal();
},

View file

@ -633,21 +633,21 @@
</div>
<div class="content-block">
<h3>DOCUMENT EDITOR</h3>
<h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
<h3><%= scope.textVersion %> <%= prodversion %></h3>
</div>
<div class="content-block">
<h3 id="settings-about-name" class="vendor">{{PUBLISHER_NAME}}</h3>
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#">{{PUBLISHER_ADDRESS}}</a></p>
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:{{SUPPORT_EMAIL}}">{{SUPPORT_EMAIL}}</a></p>
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:{{PUBLISHER_PHONE}}">{{PUBLISHER_PHONE}}</a></p>
<p><a id="settings-about-url" class="external" target="_blank" href="{{PUBLISHER_URL}}"><% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %></a></p>
<h3 id="settings-about-name" class="vendor"><%= publishername %></h3>
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#"><%= publisheraddr %></a></p>
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:<%= supportemail %>"><%= supportemail %></a></p>
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:<%= phonenum %>"><%= phonenum %></a></p>
<p><a id="settings-about-url" class="external" target="_blank" href="<%= publisherurl %>"><%= printed_url %></a></p>
<p><label id="settings-about-info" style="display: none;"></label></p>
</div>
<div class="content-block" id="settings-about-licensor" style="display: none;">
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"/>
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"></div>
<p><label><%= scope.textPoweredBy %></label></p>
<h3 class="vendor">{{PUBLISHER_NAME}}</h3>
<p><a class="external" target="_blank" href="{{PUBLISHER_URL}}"><% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %></a></p>
<h3 class="vendor"><%= publishername %></h3>
<p><a class="external" target="_blank" href="<%= publisherurl %>"><%= printed_url %></a></p>
</div>
</div>
</div>

View file

@ -91,7 +91,14 @@ define([
phone : Common.SharedSettings.get('phone'),
orthography: Common.SharedSettings.get('sailfish'),
scope : this,
width : $(window).width()
width : $(window).width(),
prodversion: '{{PRODUCT_VERSION}}',
publishername: '{{PUBLISHER_NAME}}',
publisheraddr: '{{PUBLISHER_ADDRESS}}',
publisherurl: '{{PUBLISHER_URL}}',
printed_url: ("{{PUBLISHER_URL}}").replace(/https?:\/{2}/, "").replace(/\/$/,""),
supportemail: '{{SUPPORT_EMAIL}}',
phonenum: '{{PUBLISHER_PHONE}}'
}));
return this;

View file

@ -181,7 +181,7 @@ require([
//Store Framework7 initialized instance for easy access
window.uiApp = new Framework7({
// Default title for modals
modalTitle: '{{MOBILE_MODAL_TITLE}}',
modalTitle: '{{APP_TITLE_TEXT}}',
// If it is webapp, we can enable hash navigation:
// pushState: false,

View file

@ -386,21 +386,21 @@
</div>
<div class="content-block">
<h3>PRESENTATION EDITOR</h3>
<h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
<h3><%= scope.textVersion %> <%= prodversion %></h3>
</div>
<div class="content-block">
<h3 id="settings-about-name" class="vendor">Ascensio System SIA</h3>
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#">{{PUBLISHER_ADDRESS}}</a></p>
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:{{SUPPORT_EMAIL}}">{{SUPPORT_EMAIL}}</a></p>
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:{{PUBLISHER_PHONE}}">{{PUBLISHER_PHONE}}</a></p>
<p><a id="settings-about-url" class="external" target="_blank" href="{{PUBLISHER_URL}}"><% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %></a></p>
<h3 id="settings-about-name" class="vendor"><%= publishername %></h3>
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#"><%= publisheraddr %></a></p>
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:<%= supportemail %>"><%= supportemail %></a></p>
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:<%= phonenum %>"><%= phonenum %></a></p>
<p><a id="settings-about-url" class="external" target="_blank" href="<%= publisherurl %>"><%= printed_url %></a></p>
<p><label id="settings-about-info" style="display: none;"></label></p>
</div>
<div class="content-block" id="settings-about-licensor" style="display: none;">
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"></div >
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"></div>
<p><label><%= scope.textPoweredBy %></label></p>
<h3 class="vendor">{{PUBLISHER_NAME}}</h3>
<p><a class="external" target="_blank" href="{{PUBLISHER_URL}}"><% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %></a></p>
<h3 class="vendor"><%= publishername %></h3>
<p><a class="external" target="_blank" href="<%= publisherurl %>"><%= printed_url %></a></p>
</div>
</div>
</div>

View file

@ -92,7 +92,14 @@ define([
android: Common.SharedSettings.get('android'),
phone: Common.SharedSettings.get('phone'),
scope: this,
width: $(window).width()
width: $(window).width(),
prodversion: '{{PRODUCT_VERSION}}',
publishername: '{{PUBLISHER_NAME}}',
publisheraddr: '{{PUBLISHER_ADDRESS}}',
publisherurl: '{{PUBLISHER_URL}}',
printed_url: ("{{PUBLISHER_URL}}").replace(/https?:\/{2}/, "").replace(/\/$/,""),
supportemail: '{{SUPPORT_EMAIL}}',
phonenum: '{{PUBLISHER_PHONE}}'
}));
return this;
@ -180,7 +187,18 @@ define([
},
showHelp: function () {
window.open('{{SUPPORT_URL}}', "_blank");
var url = '{{HELP_URL}}';
if (url.charAt(url.length-1) !== '/') {
url += '/';
}
if (Common.SharedSettings.get('sailfish')) {
url+='mobile-applications/documents/sailfish/index.aspx';
} else if (Common.SharedSettings.get('android')) {
url+='mobile-applications/documents/android/index.aspx';
} else {
url+='mobile-applications/documents/index.aspx';
}
window.open(url, "_blank");
PE.getController('Settings').hideModal();
},

View file

@ -335,7 +335,7 @@ define([
allFunctions.push(func);
}
formulaGroup.set('functions', functions);
formulaGroup.set('functions', _.sortBy(functions, function (model) {return model.get('name'); }));
store.push(formulaGroup);
}

View file

@ -146,7 +146,8 @@ define([
cls : 'input-group-nr',
scroller : {
suppressScrollX: true
}
},
search: true
});
this.btnToDictionary = new Common.UI.Button({

View file

@ -167,7 +167,7 @@ require([
//Store Framework7 initialized instance for easy access
window.uiApp = new Framework7({
// Default title for modals
modalTitle: '{{MOBILE_MODAL_TITLE}}',
modalTitle: '{{APP_TITLE_TEXT}}',
// Enable tap hold events
tapHold: true,

View file

@ -112,7 +112,18 @@ define([
'Settings': {
'page:show' : this.onPageShow
, 'settings:showhelp': function(e) {
window.open('{{SUPPORT_URL}}', "_blank");
var url = '{{HELP_URL}}';
if (url.charAt(url.length-1) !== '/') {
url += '/';
}
if (Common.SharedSettings.get('sailfish')) {
url+='mobile-applications/documents/sailfish/index.aspx';
} else if (Common.SharedSettings.get('android')) {
url+='mobile-applications/documents/android/index.aspx';
} else {
url+='mobile-applications/documents/index.aspx';
}
window.open(url, "_blank");
this.hideModal();
}
}

View file

@ -436,21 +436,21 @@
</div>
<div class="content-block">
<h3>SPREADSHEET EDITOR</h3>
<h3><%= scope.textVersion %> {{PRODUCT_VERSION}}</h3>
<h3><%= scope.textVersion %> <%= prodversion %></h3>
</div>
<div class="content-block">
<h3 id="settings-about-name" class="vendor">{{PUBLISHER_NAME}}</h3>
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#">{{PUBLISHER_ADDRESS}}</a></p>
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:{{SUPPORT_EMAIL}}">{{SUPPORT_EMAIL}}</a></p>
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:{{PUBLISHER_PHONE}}">{{PUBLISHER_PHONE}}</a></p>
<p><a id="settings-about-url" class="external" target="_blank" href="{{PUBLISHER_URL}}"><% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %></a></p>
<h3 id="settings-about-name" class="vendor"><%= publishername %></h3>
<p><label><%= scope.textAddress %>:</label><a id="settings-about-address" class="external" href="#"><%= publisheraddr %></a></p>
<p><label><%= scope.textEmail %>:</label><a id="settings-about-email" class="external" target="_blank" href="mailto:<%= supportemail %>"><%= supportemail %></a></p>
<p><label><%= scope.textTel %>:</label><a id="settings-about-tel" class="external" target="_blank" href="tel:<%= phonenum %>"><%= phonenum %></a></p>
<p><a id="settings-about-url" class="external" target="_blank" href="<%= publisherurl %>"><%= printed_url %></a></p>
<p><label id="settings-about-info" style="display: none;"></label></p>
</div>
<div class="content-block" id="settings-about-licensor" style="display: none;">
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"/>
<div class="content-block-inner" style="padding-top:0; padding-bottom: 1px;"></div>
<p><label><%= scope.textPoweredBy %></label></p>
<h3 class="vendor">{{PUBLISHER_NAME}}</h3>
<p><a class="external" target="_blank" href="{{PUBLISHER_URL}}"><% print(/^(?:https?:\/{2})?(\S+)/.exec('{{PUBLISHER_URL}}')[1]); %></a></p>
<h3 class="vendor"><%= publishername %></h3>
<p><a class="external" target="_blank" href="<%= publisherurl %>"><%= printed_url %></a></p>
</div>
</div>
</div>

View file

@ -101,7 +101,14 @@ define([
xltx: Asc.c_oAscFileType.XLTX,
ots: Asc.c_oAscFileType.OTS
},
width : $(window).width()
width : $(window).width(),
prodversion: '{{PRODUCT_VERSION}}',
publishername: '{{PUBLISHER_NAME}}',
publisheraddr: '{{PUBLISHER_ADDRESS}}',
publisherurl: '{{PUBLISHER_URL}}',
printed_url: ("{{PUBLISHER_URL}}").replace(/https?:\/{2}/, "").replace(/\/$/,""),
supportemail: '{{SUPPORT_EMAIL}}',
phonenum: '{{PUBLISHER_PHONE}}'
}));
return this;

View file

@ -43,6 +43,9 @@ module.exports = function(grunt) {
}, {
from: /\{\{APP_TITLE_TEXT\}\}/g,
to: process.env['APP_TITLE_TEXT'] || 'ONLYOFFICE'
}, {
from: /\{\{HELP_URL\}\}/g,
to: process.env['HELP_URL'] || 'https://helpcenter.onlyoffice.com'
}];
var helpreplacements = [