Commit eba4f24b authored by Julia Radzhabova's avatar Julia Radzhabova

Merge branch 'develop' into refactor

parents e0737d18 cbd1e0d8
...@@ -461,6 +461,8 @@ define([ ...@@ -461,6 +461,8 @@ define([
updateHint: function(hint) { updateHint: function(hint) {
this.options.hint = hint; this.options.hint = hint;
if (!this.rendered) return;
var cmpEl = this.cmpEl, var cmpEl = this.cmpEl,
modalParents = cmpEl.closest('.asc-window'); modalParents = cmpEl.closest('.asc-window');
......
...@@ -312,6 +312,8 @@ define([ ...@@ -312,6 +312,8 @@ define([
me._skipInputChange = true; me._skipInputChange = true;
me.cmpEl.find('ul li:first a').focus(); me.cmpEl.find('ul li:first a').focus();
}, 10); }, 10);
} else if (e.keyCode == Common.UI.Keys.RETURN && $(e.target).val() === me.lastValue){
this._input.trigger('change', { reapply: true });
} else } else
me._skipInputChange = false; me._skipInputChange = false;
}, },
...@@ -333,7 +335,7 @@ define([ ...@@ -333,7 +335,7 @@ define([
var val = $(e.target).val(), var val = $(e.target).val(),
record = {}; record = {};
if (this.lastValue === val) { if (this.lastValue === val && !(extra && extra.reapply)) {
if (extra && extra.onkeydown) if (extra && extra.onkeydown)
this.trigger('combo:blur', this, e); this.trigger('combo:blur', this, e);
return; return;
......
...@@ -154,7 +154,8 @@ define([ ...@@ -154,7 +154,8 @@ define([
maxwidth: undefined, maxwidth: undefined,
maxheight: undefined, maxheight: undefined,
minwidth: 0, minwidth: 0,
minheight: 0 minheight: 0,
enableKeyEvents: true
}; };
var template = '<div class="asc-window<%= modal?" modal":"" %><%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;">' + var template = '<div class="asc-window<%= modal?" modal":"" %><%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;">' +
...@@ -182,7 +183,7 @@ define([ ...@@ -182,7 +183,7 @@ define([
} }
function _keydown(event) { function _keydown(event) {
if (!this.isLocked() && this.isVisible()) { if (!this.isLocked() && this.isVisible() && this.initConfig.enableKeyEvents) {
switch (event.keyCode) { switch (event.keyCode) {
case Common.UI.Keys.ESC: case Common.UI.Keys.ESC:
if ( $('.asc-loadmask').length<1 ) { if ( $('.asc-loadmask').length<1 ) {
......
...@@ -198,7 +198,8 @@ define([ ...@@ -198,7 +198,8 @@ define([
var _options = {}; var _options = {};
_.extend(_options, { _.extend(_options, {
cls: 'advanced-settings-dlg', cls: 'advanced-settings-dlg',
header: true header: true,
enableKeyEvents: false
}, options); }, options);
var header_footer = (_options.buttons && _.size(_options.buttons)>0) ? 85 : 34; var header_footer = (_options.buttons && _.size(_options.buttons)>0) ? 85 : 34;
......
...@@ -274,7 +274,7 @@ define([ ...@@ -274,7 +274,7 @@ define([
this.api.SetTextBoxInputMode(parseInt(value) == 1); this.api.SetTextBoxInputMode(parseInt(value) == 1);
/** coauthoring begin **/ /** coauthoring begin **/
if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) {
value = Common.localStorage.getItem("de-settings-coauthmode"); value = Common.localStorage.getItem("de-settings-coauthmode");
var fast_coauth = (value===null || parseInt(value) == 1); var fast_coauth = (value===null || parseInt(value) == 1);
this.api.asc_SetFastCollaborative(fast_coauth); this.api.asc_SetFastCollaborative(fast_coauth);
......
...@@ -791,7 +791,7 @@ define([ ...@@ -791,7 +791,7 @@ define([
me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1); me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1);
/** coauthoring begin **/ /** coauthoring begin **/
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline) { if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("de-settings-coauthmode"); value = Common.localStorage.getItem("de-settings-coauthmode");
me._state.fastCoauth = (value===null || parseInt(value) == 1); me._state.fastCoauth = (value===null || parseInt(value) == 1);
me.api.asc_SetFastCollaborative(me._state.fastCoauth); me.api.asc_SetFastCollaborative(me._state.fastCoauth);
...@@ -842,7 +842,8 @@ define([ ...@@ -842,7 +842,8 @@ define([
if (me.appOptions.isEdit) { if (me.appOptions.isEdit) {
value = Common.localStorage.getItem("de-settings-autosave"); value = Common.localStorage.getItem("de-settings-autosave");
value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : 1; value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
me.api.asc_setAutoSaveGap(value); me.api.asc_setAutoSaveGap(value);
if (me.needToUpdateVersion) if (me.needToUpdateVersion)
...@@ -1662,7 +1663,7 @@ define([ ...@@ -1662,7 +1663,7 @@ define([
}, },
applySettings: function() { applySettings: function() {
if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline) { if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
var value = Common.localStorage.getItem("de-settings-coauthmode"), var value = Common.localStorage.getItem("de-settings-coauthmode"),
oldval = this._state.fastCoauth; oldval = this._state.fastCoauth;
this._state.fastCoauth = (value===null || parseInt(value) == 1); this._state.fastCoauth = (value===null || parseInt(value) == 1);
......
...@@ -2189,10 +2189,13 @@ define([ ...@@ -2189,10 +2189,13 @@ define([
}, },
fillEquations: function() { fillEquations: function() {
if (!this.toolbar.btnInsertEquation.rendered) return;
var me = this, equationsStore = this.getApplication().getCollection('EquationGroups'); var me = this, equationsStore = this.getApplication().getCollection('EquationGroups');
me.equationPickers = []; me.equationPickers = [];
me.toolbar.btnInsertEquation.menu.removeAll();
for (var i = 0; i < equationsStore.length; ++i) { for (var i = 0; i < equationsStore.length; ++i) {
var equationGroup = equationsStore.at(i); var equationGroup = equationsStore.at(i);
...@@ -2380,8 +2383,9 @@ define([ ...@@ -2380,8 +2383,9 @@ define([
}, },
fillTextArt: function() { fillTextArt: function() {
var me = this; if (!this.toolbar.btnInsertText.rendered) return;
var me = this;
if (this.toolbar.mnuTextArtPicker) { if (this.toolbar.mnuTextArtPicker) {
var models = this.getApplication().getCollection('Common.Collections.TextArt').models, var models = this.getApplication().getCollection('Common.Collections.TextArt').models,
count = this.toolbar.mnuTextArtPicker.store.length; count = this.toolbar.mnuTextArtPicker.store.length;
......
...@@ -312,7 +312,7 @@ define([ ...@@ -312,7 +312,7 @@ define([
} }
/** coauthoring begin **/ /** coauthoring begin **/
$('tr.coauth', this.el)[mode.isEdit && mode.canCoAuthoring ? 'show' : 'hide'](); $('tr.coauth', this.el)[mode.isEdit && mode.canCoAuthoring ? 'show' : 'hide']();
$('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline ? 'show' : 'hide'](); $('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide']();
/** coauthoring end **/ /** coauthoring end **/
}, },
...@@ -329,7 +329,7 @@ define([ ...@@ -329,7 +329,7 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0)); this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("de-settings-coauthmode"); value = Common.localStorage.getItem("de-settings-coauthmode");
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline); var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)}); item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
this.cmbCoAuthMode.setValue(item ? item.get('value') : 1); this.cmbCoAuthMode.setValue(item ? item.get('value') : 1);
...@@ -352,7 +352,7 @@ define([ ...@@ -352,7 +352,7 @@ define([
this._oldUnits = this.cmbUnit.getValue(); this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("de-settings-autosave"); value = Common.localStorage.getItem("de-settings-autosave");
this.chAutosave.setValue(fast_coauth || (value===null || parseInt(value) == 1)); this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("de-settings-spellcheck"); value = Common.localStorage.getItem("de-settings-spellcheck");
this.chSpell.setValue(value===null || parseInt(value) == 1); this.chSpell.setValue(value===null || parseInt(value) == 1);
...@@ -366,7 +366,7 @@ define([ ...@@ -366,7 +366,7 @@ define([
Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue()); Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue());
/** coauthoring begin **/ /** coauthoring begin **/
Common.localStorage.setItem("de-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0); Common.localStorage.setItem("de-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0);
if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) {
Common.localStorage.setItem("de-settings-coauthmode", this.cmbCoAuthMode.getValue()); Common.localStorage.setItem("de-settings-coauthmode", this.cmbCoAuthMode.getValue());
Common.localStorage.setItem(this.cmbCoAuthMode.getValue() ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", this.cmbShowChanges.getValue()); Common.localStorage.setItem(this.cmbCoAuthMode.getValue() ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", this.cmbShowChanges.getValue());
} }
......
...@@ -395,6 +395,7 @@ define([ ...@@ -395,6 +395,7 @@ define([
}, },
createDelayedElements: function() { createDelayedElements: function() {
this.UpdateThemeColors();
this.updateMetricUnit(); this.updateMetricUnit();
}, },
......
...@@ -583,7 +583,7 @@ define([ ...@@ -583,7 +583,7 @@ define([
data: this.options.languages data: this.options.languages
}); });
this.cmbLanguage.scroller.update({alwaysVisibleY: true}); if (this.cmbLanguage.scroller) this.cmbLanguage.scroller.update({alwaysVisibleY: true});
this.cmbLanguage.on('selected', _.bind(this.onLangSelect, this)); this.cmbLanguage.on('selected', _.bind(this.onLangSelect, this));
this.cmbLanguage.setValue(Common.util.LanguageInfo.getLocalLanguageName(this.options.current)[0]); this.cmbLanguage.setValue(Common.util.LanguageInfo.getLocalLanguageName(this.options.current)[0]);
this.onLangSelect(this.cmbLanguage, this.cmbLanguage.getSelectedRecord()); this.onLangSelect(this.cmbLanguage, this.cmbLanguage.getSelectedRecord());
......
...@@ -694,7 +694,37 @@ define([ ...@@ -694,7 +694,37 @@ define([
id : 'id-toolbar-btn-colorschemas', id : 'id-toolbar-btn-colorschemas',
cls : 'btn-toolbar', cls : 'btn-toolbar',
iconCls : 'btn-colorschemas', iconCls : 'btn-colorschemas',
menu : true menu : new Common.UI.Menu({
items: [],
maxHeight : 600,
restoreHeight: 600
}).on('show:before', function(mnu) {
if ( !this.scroller ) {
this.scroller = new Common.UI.Scroller({
el: $(this.el).find('.dropdown-menu '),
useKeyboard: this.enableKeyEvents && !this.handleSelect,
minScrollbarLength: 40,
alwaysVisibleY: true
});
}
}).on('show:after', function(btn, e) {
var mnu = $(this.el).find('.dropdown-menu '),
docH = $(document).height(),
menuH = mnu.outerHeight(),
top = parseInt(mnu.css('top'));
if (menuH > docH) {
mnu.css('max-height', (docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5) + 'px');
this.scroller.update({minScrollbarLength : 40});
} else if ( mnu.height() < this.options.restoreHeight ) {
mnu.css('max-height', (Math.min(docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5, this.options.restoreHeight)) + 'px');
menuH = mnu.outerHeight();
if (top+menuH > docH) {
mnu.css('top', 0);
}
this.scroller.update({minScrollbarLength : 40});
}
})
}); });
this.toolbarControls.push(this.btnColorSchemas); this.toolbarControls.push(this.btnColorSchemas);
...@@ -735,6 +765,7 @@ define([ ...@@ -735,6 +765,7 @@ define([
this.mnuInsertTable = this.btnInsertTable.menu; this.mnuInsertTable = this.btnInsertTable.menu;
this.mnuInsertImage = this.btnInsertImage.menu; this.mnuInsertImage = this.btnInsertImage.menu;
this.mnuPageSize = this.btnPageSize.menu; this.mnuPageSize = this.btnPageSize.menu;
this.mnuColorSchema = this.btnColorSchemas.menu;
// //
// DataView and pickers // DataView and pickers
...@@ -1095,6 +1126,7 @@ define([ ...@@ -1095,6 +1126,7 @@ define([
this.btnColumns.updateHint(this.tipColumns); this.btnColumns.updateHint(this.tipColumns);
this.btnPageOrient.updateHint(this.tipPageOrient); this.btnPageOrient.updateHint(this.tipPageOrient);
this.btnPageSize.updateHint(this.tipPageSize); this.btnPageSize.updateHint(this.tipPageSize);
this.btnPageMargins.updateHint(this.tipPageMargins);
this.btnClearStyle.updateHint(this.tipClearStyle); this.btnClearStyle.updateHint(this.tipClearStyle);
this.btnCopyStyle.updateHint(this.tipCopyStyle + Common.Utils.String.platformKey('Ctrl+Shift+C')); this.btnCopyStyle.updateHint(this.tipCopyStyle + Common.Utils.String.platformKey('Ctrl+Shift+C'));
this.btnColorSchemas.updateHint(this.tipColorSchemas); this.btnColorSchemas.updateHint(this.tipColorSchemas);
...@@ -1154,7 +1186,9 @@ define([ ...@@ -1154,7 +1186,9 @@ define([
] ]
}) })
); );
if (this.mode.isDesktopApp)
this.mnuitemHideTitleBar.hide();
this.btnMarkers.setMenu( this.btnMarkers.setMenu(
new Common.UI.Menu({ new Common.UI.Menu({
items: [ items: [
...@@ -1479,10 +1513,9 @@ define([ ...@@ -1479,10 +1513,9 @@ define([
} }
} }
if (mode.isDesktopApp) { if (mode.isDesktopApp)
$('.toolbar-group-native').hide(); $('.toolbar-group-native').hide();
this.mnuitemHideTitleBar.hide();
}
this.btnMailRecepients.setVisible(mode.canCoAuthoring==true && mode.canUseMailMerge); this.btnMailRecepients.setVisible(mode.canCoAuthoring==true && mode.canUseMailMerge);
this.listStylesAdditionalMenuItem.setVisible(mode.canEditStyles); this.listStylesAdditionalMenuItem.setVisible(mode.canEditStyles);
}, },
...@@ -1525,6 +1558,11 @@ define([ ...@@ -1525,6 +1558,11 @@ define([
if (me.listStyles.menuPicker.store.length > 0 && listStylesVisible){ if (me.listStyles.menuPicker.store.length > 0 && listStylesVisible){
me.listStyles.fillComboView(me.listStyles.menuPicker.getSelectedRec(), true); me.listStyles.fillComboView(me.listStyles.menuPicker.getSelectedRec(), true);
} }
if (me.btnInsertText.rendered)
DE.getController('Toolbar').fillTextArt();
if (me.btnInsertEquation.rendered)
DE.getController('Toolbar').fillEquations();
}, 100); }, 100);
} }
...@@ -1541,40 +1579,17 @@ define([ ...@@ -1541,40 +1579,17 @@ define([
}); });
} }
if (!this.mnuColorSchema) { if (this.mnuColorSchema == null) {
this.btnColorSchemas.setMenu(new Common.UI.Menu({ this.mnuColorSchema = new Common.UI.Menu({
items: [],
maxHeight : 600, maxHeight : 600,
restoreHeight: 600 restoreHeight: 600
})); }).on('show:before', function(mnu) {
this.mnuColorSchema = this.btnColorSchemas.menu; this.scroller = new Common.UI.Scroller({
this.mnuColorSchema.on('show:before', function(mnu) { el: $(this.el).find('.dropdown-menu '),
if ( !this.scroller ) { useKeyboard: this.enableKeyEvents && !this.handleSelect,
this.scroller = new Common.UI.Scroller({ minScrollbarLength : 40
el: $(this.el).find('.dropdown-menu '), });
useKeyboard: this.enableKeyEvents && !this.handleSelect, });
minScrollbarLength: 40,
alwaysVisibleY: true
});
}
}).on('show:after', function(btn, e) {
var mnu = $(this.el).find('.dropdown-menu '),
docH = Common.Utils.innerHeight(),
menuH = mnu.outerHeight(),
top = parseInt(mnu.css('top'));
if (menuH > docH) {
mnu.css('max-height', (docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5) + 'px');
this.scroller.update({minScrollbarLength : 40});
} else if ( mnu.height() < this.options.restoreHeight ) {
mnu.css('max-height', (Math.min(docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5, this.options.restoreHeight)) + 'px');
menuH = mnu.outerHeight();
if (top+menuH > docH) {
mnu.css('top', 0);
}
this.scroller.update({minScrollbarLength : 40});
}
})
} }
this.mnuColorSchema.items = []; this.mnuColorSchema.items = [];
......
...@@ -218,7 +218,7 @@ define([ ...@@ -218,7 +218,7 @@ define([
this.api.SetTextBoxInputMode(parseInt(value) == 1); this.api.SetTextBoxInputMode(parseInt(value) == 1);
/** coauthoring begin **/ /** coauthoring begin **/
if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) {
value = Common.localStorage.getItem("pe-settings-coauthmode"); value = Common.localStorage.getItem("pe-settings-coauthmode");
this.api.asc_SetFastCollaborative(value===null || parseInt(value) == 1); this.api.asc_SetFastCollaborative(value===null || parseInt(value) == 1);
} }
......
...@@ -591,7 +591,7 @@ define([ ...@@ -591,7 +591,7 @@ define([
me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1); me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1);
/** coauthoring begin **/ /** coauthoring begin **/
if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline) { if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("pe-settings-coauthmode"); value = Common.localStorage.getItem("pe-settings-coauthmode");
me._state.fastCoauth = (value===null || parseInt(value) == 1); me._state.fastCoauth = (value===null || parseInt(value) == 1);
} else } else
...@@ -635,7 +635,7 @@ define([ ...@@ -635,7 +635,7 @@ define([
if (me.appOptions.isEdit) { if (me.appOptions.isEdit) {
value = Common.localStorage.getItem("pe-settings-autosave"); value = Common.localStorage.getItem("pe-settings-autosave");
value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : 1; value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
me.api.asc_setAutoSaveGap(value); me.api.asc_setAutoSaveGap(value);
if (me.needToUpdateVersion) if (me.needToUpdateVersion)
...@@ -1437,7 +1437,7 @@ define([ ...@@ -1437,7 +1437,7 @@ define([
}, },
applySettings: function() { applySettings: function() {
if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline) { if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
var value = Common.localStorage.getItem("pe-settings-coauthmode"), var value = Common.localStorage.getItem("pe-settings-coauthmode"),
oldval = this._state.fastCoauth; oldval = this._state.fastCoauth;
this._state.fastCoauth = (value===null || parseInt(value) == 1); this._state.fastCoauth = (value===null || parseInt(value) == 1);
......
...@@ -258,7 +258,7 @@ define([ ...@@ -258,7 +258,7 @@ define([
this.lblAutosave.text(this.textAutoRecover); this.lblAutosave.text(this.textAutoRecover);
} }
/** coauthoring begin **/ /** coauthoring begin **/
$('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline ? 'show' : 'hide'](); $('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide']();
/** coauthoring end **/ /** coauthoring end **/
}, },
...@@ -273,7 +273,7 @@ define([ ...@@ -273,7 +273,7 @@ define([
/** coauthoring begin **/ /** coauthoring begin **/
value = Common.localStorage.getItem("pe-settings-coauthmode"); value = Common.localStorage.getItem("pe-settings-coauthmode");
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline); var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)}); item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
this.cmbCoAuthMode.setValue(item ? item.get('value') : 1); this.cmbCoAuthMode.setValue(item ? item.get('value') : 1);
...@@ -286,7 +286,7 @@ define([ ...@@ -286,7 +286,7 @@ define([
this._oldUnits = this.cmbUnit.getValue(); this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("pe-settings-autosave"); value = Common.localStorage.getItem("pe-settings-autosave");
this.chAutosave.setValue(fast_coauth || (value===null || parseInt(value) == 1)); this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("pe-settings-showsnaplines"); value = Common.localStorage.getItem("pe-settings-showsnaplines");
this.chAlignGuides.setValue(value===null || parseInt(value) == 1); this.chAlignGuides.setValue(value===null || parseInt(value) == 1);
...@@ -296,7 +296,7 @@ define([ ...@@ -296,7 +296,7 @@ define([
Common.localStorage.setItem("pe-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); Common.localStorage.setItem("pe-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0);
Common.localStorage.setItem("pe-settings-zoom", this.cmbZoom.getValue()); Common.localStorage.setItem("pe-settings-zoom", this.cmbZoom.getValue());
/** coauthoring begin **/ /** coauthoring begin **/
if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) {
Common.localStorage.setItem("pe-settings-coauthmode", this.cmbCoAuthMode.getValue()); Common.localStorage.setItem("pe-settings-coauthmode", this.cmbCoAuthMode.getValue());
} }
/** coauthoring end **/ /** coauthoring end **/
......
...@@ -244,7 +244,7 @@ define([ ...@@ -244,7 +244,7 @@ define([
(!(value!==null && parseInt(value) == 0)) ? this.api.asc_showComments() : this.api.asc_hideComments(); (!(value!==null && parseInt(value) == 0)) ? this.api.asc_showComments() : this.api.asc_hideComments();
// this.getApplication().getController('DocumentHolder').setLiveCommenting(!(value!==null && parseInt(value) == 0)); // this.getApplication().getController('DocumentHolder').setLiveCommenting(!(value!==null && parseInt(value) == 0));
if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) {
value = Common.localStorage.getItem("sse-settings-coauthmode"); value = Common.localStorage.getItem("sse-settings-coauthmode");
this.api.asc_SetFastCollaborative(value===null || parseInt(value) == 1); this.api.asc_SetFastCollaborative(value===null || parseInt(value) == 1);
} }
......
...@@ -563,7 +563,7 @@ define([ ...@@ -563,7 +563,7 @@ define([
this.isLiveCommenting = !(value!==null && parseInt(value) == 0); this.isLiveCommenting = !(value!==null && parseInt(value) == 0);
this.isLiveCommenting?this.api.asc_showComments():this.api.asc_hideComments(); this.isLiveCommenting?this.api.asc_showComments():this.api.asc_hideComments();
if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline) { if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
value = Common.localStorage.getItem("sse-settings-coauthmode"); value = Common.localStorage.getItem("sse-settings-coauthmode");
this._state.fastCoauth = (value===null || parseInt(value) == 1); this._state.fastCoauth = (value===null || parseInt(value) == 1);
} else } else
...@@ -623,7 +623,7 @@ define([ ...@@ -623,7 +623,7 @@ define([
if (me.appOptions.isEdit) { if (me.appOptions.isEdit) {
if (me.appOptions.canAutosave) { if (me.appOptions.canAutosave) {
value = Common.localStorage.getItem("sse-settings-autosave"); value = Common.localStorage.getItem("sse-settings-autosave");
value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : 1; value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0);
} else { } else {
value = 0; value = 0;
} }
...@@ -1668,7 +1668,7 @@ define([ ...@@ -1668,7 +1668,7 @@ define([
}, },
applySettings: function() { applySettings: function() {
if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline) { if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) {
var value = Common.localStorage.getItem("sse-settings-coauthmode"), var value = Common.localStorage.getItem("sse-settings-coauthmode"),
oldval = this._state.fastCoauth; oldval = this._state.fastCoauth;
this._state.fastCoauth = (value===null || parseInt(value) == 1); this._state.fastCoauth = (value===null || parseInt(value) == 1);
......
...@@ -68,20 +68,6 @@ define([ ...@@ -68,20 +68,6 @@ define([
'sheet:move': _.bind(this.moveWorksheet, this) 'sheet:move': _.bind(this.moveWorksheet, this)
} }
}); });
var me = this;
Common.util.Shortcuts.delegateShortcuts({shortcuts:{
'alt+pageup': function(e) {
me.moveCurrentTab(-1);
e.preventDefault();
e.stopPropagation();
},
'alt+pagedown': function(e) {
me.moveCurrentTab(1);
e.preventDefault();
e.stopPropagation();
}
}});
}, },
events: function() { events: function() {
......
...@@ -827,15 +827,8 @@ define([ ...@@ -827,15 +827,8 @@ define([
}, },
onNumberFormat: function(btn) { onNumberFormat: function(btn) {
if (this.api) { if (this.api)
var format = btn.options.formatId; this.api.asc_setCellStyle(btn.options.styleName);
if (btn.options.formatId == this.toolbar.ascFormatOptions.Accounting){
var value = Common.localStorage.getItem("sse-settings-reg-settings");
value = (value!==null) ? parseInt(value) : ((this.toolbar.mode.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(this.toolbar.mode.lang)) : 0x0409);
format = this.api.asc_getLocaleCurrency(value);
}
this.api.asc_setCellFormat(format);
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.NotificationCenter.trigger('edit:complete', this.toolbar);
Common.component.Analytics.trackEvent('ToolBar', 'Number Format'); Common.component.Analytics.trackEvent('ToolBar', 'Number Format');
...@@ -1256,6 +1249,9 @@ define([ ...@@ -1256,6 +1249,9 @@ define([
if (me.toolbar.listStyles.menuPicker.store.length > 0 && listStylesVisible){ if (me.toolbar.listStyles.menuPicker.store.length > 0 && listStylesVisible){
me.toolbar.listStyles.fillComboView(me.toolbar.listStyles.menuPicker.getSelectedRec(), true); me.toolbar.listStyles.fillComboView(me.toolbar.listStyles.menuPicker.getSelectedRec(), true);
} }
if (me.toolbar.btnInsertText.rendered)
SSE.getController('Toolbar').fillTextArt();
}, 100); }, 100);
} }
...@@ -2002,6 +1998,8 @@ define([ ...@@ -2002,6 +1998,8 @@ define([
}, },
fillTextArt: function() { fillTextArt: function() {
if (!this.toolbar.btnInsertText.rendered) return;
var me = this; var me = this;
if (this.toolbar.mnuTextArtPicker) { if (this.toolbar.mnuTextArtPicker) {
......
...@@ -651,7 +651,7 @@ define([ ...@@ -651,7 +651,7 @@ define([
this.lblAutosave.text(this.textAutoRecover); this.lblAutosave.text(this.textAutoRecover);
} }
$('tr.coauth', this.el)[mode.canCoAuthoring && mode.isEdit ? 'show' : 'hide'](); $('tr.coauth', this.el)[mode.canCoAuthoring && mode.isEdit ? 'show' : 'hide']();
$('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline ? 'show' : 'hide'](); $('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline && mode.canCoAuthoring? 'show' : 'hide']();
}, },
setApi: function(api) { setApi: function(api) {
...@@ -668,7 +668,7 @@ define([ ...@@ -668,7 +668,7 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0)); this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("sse-settings-coauthmode"); value = Common.localStorage.getItem("sse-settings-coauthmode");
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline); var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring;
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)}); item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
this.cmbCoAuthMode.setValue(item ? item.get('value') : 1); this.cmbCoAuthMode.setValue(item ? item.get('value') : 1);
...@@ -685,7 +685,7 @@ define([ ...@@ -685,7 +685,7 @@ define([
this._oldUnits = this.cmbUnit.getValue(); this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("sse-settings-autosave"); value = Common.localStorage.getItem("sse-settings-autosave");
this.chAutosave.setValue(fast_coauth || (value===null || parseInt(value) == 1)); this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1));
value = Common.localStorage.getItem("sse-settings-func-locale"); value = Common.localStorage.getItem("sse-settings-func-locale");
if (value===null) if (value===null)
...@@ -726,7 +726,7 @@ define([ ...@@ -726,7 +726,7 @@ define([
Common.localStorage.setItem("sse-settings-zoom", this.cmbZoom.getValue()); Common.localStorage.setItem("sse-settings-zoom", this.cmbZoom.getValue());
/** coauthoring begin **/ /** coauthoring begin **/
Common.localStorage.setItem("sse-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0); Common.localStorage.setItem("sse-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0);
if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring)
Common.localStorage.setItem("sse-settings-coauthmode", this.cmbCoAuthMode.getValue()); Common.localStorage.setItem("sse-settings-coauthmode", this.cmbCoAuthMode.getValue());
/** coauthoring end **/ /** coauthoring end **/
Common.localStorage.setItem("sse-settings-fontrender", this.cmbFontRender.getValue()); Common.localStorage.setItem("sse-settings-fontrender", this.cmbFontRender.getValue());
......
...@@ -979,7 +979,7 @@ define([ ...@@ -979,7 +979,7 @@ define([
iconCls : 'btn-percent-style', iconCls : 'btn-percent-style',
hint : me.tipDigStylePercent, hint : me.tipDigStylePercent,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth], lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
formatId : me.ascFormatOptions.Percent styleName : 'Percent'
}); });
me.btnCurrencyStyle = new Common.UI.Button({ me.btnCurrencyStyle = new Common.UI.Button({
...@@ -988,7 +988,7 @@ define([ ...@@ -988,7 +988,7 @@ define([
iconCls : 'btn-currency-style', iconCls : 'btn-currency-style',
hint : me.tipDigStyleAccounting, hint : me.tipDigStyleAccounting,
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth], lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
formatId : me.ascFormatOptions.Accounting, styleName : 'Currency',
split : true, split : true,
menu : new Common.UI.Menu({ menu : new Common.UI.Menu({
style: 'min-width: 120px;', style: 'min-width: 120px;',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment