diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 70476926e..885b392df 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -555,12 +555,6 @@ define([ var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : 100); (zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100)); - value = Common.localStorage.getItem("de-show-hiddenchars"); - me.api.put_ShowParaMarks((value!==null) ? eval(value) : false); - - value = Common.localStorage.getItem("de-show-tableline"); - me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true); - value = Common.localStorage.getBool("de-mobile-spellcheck", !(this.appOptions.customization && this.appOptions.customization.spellcheck===false)); Common.Utils.InternalSettings.set("de-mobile-spellcheck", value); me.api.asc_setSpellCheck(value); @@ -575,10 +569,10 @@ define([ me.api.SetTextBoxInputMode(Common.localStorage.getBool("de-settings-inputmode")); value = Common.localStorage.getItem("de-mobile-no-characters"); - me.api.put_ShowParaMarks((value!==null) ? eval(value) : false); + me.api.put_ShowParaMarks(value==='true'); value = Common.localStorage.getItem("de-mobile-hidden-borders"); - me.api.put_ShowTableEmptyLine((value!==null) ? eval(value) : true); + me.api.put_ShowTableEmptyLine(value===null || value==='true'); /** coauthoring begin **/ if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index feb6b6554..2c2d9a36c 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -236,9 +236,10 @@ define([ me.initPageAdvancedSettings(); $('#settings-spellcheck input:checkbox').attr('checked', Common.Utils.InternalSettings.get("de-mobile-spellcheck")); $('#settings-spellcheck input:checkbox').single('change', _.bind(me.onSpellcheck, me)); - $('#settings-no-characters input:checkbox').attr('checked', (Common.localStorage.getItem("de-mobile-no-characters") == 'true') ? true : false); + $('#settings-no-characters input:checkbox').attr('checked', Common.localStorage.getItem("de-mobile-no-characters") === 'true'); $('#settings-no-characters input:checkbox').single('change', _.bind(me.onNoCharacters, me)); - $('#settings-hidden-borders input:checkbox').attr('checked', (Common.localStorage.getItem("de-mobile-hidden-borders") == 'true') ? true : false); + var value = Common.localStorage.getItem("de-mobile-hidden-borders"); + $('#settings-hidden-borders input:checkbox').attr('checked', value===null || value==='true'); $('#settings-hidden-borders input:checkbox').single('change', _.bind(me.onShowTableEmptyLine, me)); $('#settings-orthography').single('click', _.bind(me.onOrthographyCheck, me)); var displayComments = Common.localStorage.getBool("de-mobile-settings-livecomment", true); diff --git a/apps/spreadsheeteditor/main/app/controller/DataTab.js b/apps/spreadsheeteditor/main/app/controller/DataTab.js index ec9ba878d..ff9de160d 100644 --- a/apps/spreadsheeteditor/main/app/controller/DataTab.js +++ b/apps/spreadsheeteditor/main/app/controller/DataTab.js @@ -323,9 +323,9 @@ define([ var config = { maxwidth: 500, title: this.txtDataValidation, - msg: res===Asc.c_oAscError.ID.MoreOneTypeDataValidate ? this.txtExtendDataValidation : this.txtRemoveDataValidation, - buttons: res===Asc.c_oAscError.ID.MoreOneTypeDataValidate ? ['yes', 'no', 'cancel'] : ['ok', 'cancel'], - primary: res===Asc.c_oAscError.ID.MoreOneTypeDataValidate ? ['yes', 'no'] : 'ok', + msg: res===Asc.c_oAscError.ID.MoreOneTypeDataValidate ? this.txtRemoveDataValidation : this.txtExtendDataValidation, + buttons: res===Asc.c_oAscError.ID.MoreOneTypeDataValidate ? ['ok', 'cancel'] : ['yes', 'no', 'cancel'], + primary: res===Asc.c_oAscError.ID.MoreOneTypeDataValidate ? 'ok' : ['yes', 'no'], callback: function(btn){ if (btn == 'yes' || btn == 'no' || btn == 'ok') { setTimeout(function(){ diff --git a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js index 0970a6e74..169b2bb0c 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js @@ -103,7 +103,7 @@ define([ '', '', '', - '', + '', '', '', '', @@ -139,7 +139,8 @@ define([ '', '', '', - '
', + '
', + '
', '', '', '', @@ -228,16 +229,25 @@ define([ }); this.cmbType.on('selected', _.bind(this.onTypeSelect, this)); - this.cmbCode = new Common.UI.ComboBox({ - el: $('#format-settings-combo-code'), - cls: 'input-group-nr', - menuStyle: 'min-width: 310px;max-height:235px;', - editable: false, - data: [], - scrollAlwaysVisible: true, - takeFocusOnClose: true + this.codesList = new Common.UI.ListView({ + el: $('#format-settings-list-code'), + store: new Common.UI.DataViewStore(), + tabindex: 1, + itemTemplate: _.template('
<%= value %>
') + }); + this.codesList.on('item:select', _.bind(this.onCodeSelect, this)); + this.codesList.on('entervalue', _.bind(this.onPrimary, this)); + + this.inputCustomFormat = new Common.UI.InputField({ + el : $('#format-settings-txt-code'), + allowBlank : true, + validateOnChange : true, + validation : function () { return true; } + }).on ('changing', function (input, value) { + me.codesList.deselectAll(); + me.Format = me.api.asc_convertNumFormatLocal2NumFormat(value); + me.lblExample.text(me.api.asc_getLocaleExample(me.Format)); }); - this.cmbCode.on('selected', _.bind(this.onCodeSelect, this)); this._decimalPanel = this.$window.find('.format-decimal'); this._negativePanel = this.$window.find('.format-negative'); @@ -245,6 +255,7 @@ define([ this._typePanel = this.$window.find('.format-type'); this._symbolsPanel = this.$window.find('.format-symbols'); this._codePanel = this.$window.find('.format-code'); + this._nocodePanel = this.$window.find('.format-no-code'); this.lblExample = this.$window.find('#format-settings-label-example'); @@ -252,7 +263,7 @@ define([ }, getFocusedComponents: function() { - return [this.cmbFormat, this.spnDecimal, this.cmbSymbols, this.cmbNegative, this.cmbType, this.cmbCode]; + return [this.cmbFormat, this.spnDecimal, this.cmbSymbols, this.cmbNegative, this.cmbType, this.inputCustomFormat, {cmp: this.codesList, selector: '.listview'}]; }, getDefaultFocusableComponent: function () { @@ -406,9 +417,12 @@ define([ this.lblExample.text(this.api.asc_getLocaleExample(this.Format)); }, - onCodeSelect: function(combo, record){ - this.Format = record.value; + onCodeSelect: function(listView, itemView, record){ + if (!record) return; + + this.Format = record.get('format'); this.lblExample.text(this.api.asc_getLocaleExample(this.Format)); + this.inputCustomFormat.setValue(record.get('value')); }, onFormatSelect: function(combo, record, e, initFormatInfo) { @@ -488,15 +502,28 @@ define([ data = [], isCustom = (this.CustomFormat) ? true : false; formatsarr.forEach(function(item) { - data.push({value: item, displayValue: item}); + var rec = new Common.UI.DataViewModel(); + rec.set({ + value: me.api.asc_convertNumFormat2NumFormatLocal(item), + format: item + }); + data.push(rec); if (me.CustomFormat == item) isCustom = false; }); if (isCustom) { - data.push({value: this.CustomFormat, displayValue: this.CustomFormat}); + var rec = new Common.UI.DataViewModel(); + rec.set({ + value: me.api.asc_convertNumFormat2NumFormatLocal(this.CustomFormat), + format: this.CustomFormat + }); + data.push(rec); } - this.cmbCode.setData(data); - this.cmbCode.setValue(this.Format); + this.codesList.store.reset(data, {silent: false}); + var rec = this.codesList.store.findWhere({value: this.Format}); + rec && this.codesList.selectRecord(rec); + rec && this.codesList.scrollToRecord(rec); + this.inputCustomFormat.setValue(me.api.asc_convertNumFormat2NumFormatLocal(this.Format)); } this.lblExample.text(this.api.asc_getLocaleExample(this.Format)); @@ -507,6 +534,7 @@ define([ this._typePanel.toggleClass('hidden', !hasType); this._symbolsPanel.toggleClass('hidden', !hasSymbols); this._codePanel.toggleClass('hidden', !hasCode); + this._nocodePanel.toggleClass('hidden', hasCode); this._state = { hasDecimal: hasDecimal, hasNegative: hasNegative, hasSeparator: hasSeparator, hasType: hasType, hasSymbols: hasSymbols, hasCode: hasCode}; }, diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/big/btn-data-validation.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/big/btn-data-validation.png new file mode 100644 index 000000000..af886dd3d Binary files /dev/null and b/apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/big/btn-data-validation.png differ diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/big/btn-data-validation.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/big/btn-data-validation.png new file mode 100644 index 000000000..c647ba111 Binary files /dev/null and b/apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/big/btn-data-validation.png differ diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.75x/big/btn-data-validation.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1.75x/big/btn-data-validation.png new file mode 100644 index 000000000..78ec3a51f Binary files /dev/null and b/apps/spreadsheeteditor/main/resources/img/toolbar/1.75x/big/btn-data-validation.png differ diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1x/big/btn-data-validation.png b/apps/spreadsheeteditor/main/resources/img/toolbar/1x/big/btn-data-validation.png new file mode 100644 index 000000000..6fae4726d Binary files /dev/null and b/apps/spreadsheeteditor/main/resources/img/toolbar/1x/big/btn-data-validation.png differ diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/2x/big/btn-data-validation.png b/apps/spreadsheeteditor/main/resources/img/toolbar/2x/big/btn-data-validation.png new file mode 100644 index 000000000..0984848d8 Binary files /dev/null and b/apps/spreadsheeteditor/main/resources/img/toolbar/2x/big/btn-data-validation.png differ