diff --git a/apps/common/main/lib/component/InputField.js b/apps/common/main/lib/component/InputField.js index 069079566..75fe653ac 100644 --- a/apps/common/main/lib/component/InputField.js +++ b/apps/common/main/lib/component/InputField.js @@ -358,10 +358,10 @@ define([ return true; }, - showError: function(errors) { + showError: function(errors, isWarning) { var me = this; if (!_.isEmpty(errors)) { - me.cmpEl.addClass('error'); + me.cmpEl.addClass(isWarning ? 'warning' : 'error'); var errorBadge = me.cmpEl.find('.input-error'), modalParents = errorBadge.closest('.asc-window'), @@ -380,7 +380,12 @@ define([ } } else { me.cmpEl.removeClass('error'); + me.cmpEl.removeClass('warning'); } + }, + + showWarning: function(errors) { + this.showError(errors, true); } } })()); diff --git a/apps/common/main/resources/img/controls/common-controls.png b/apps/common/main/resources/img/controls/common-controls.png index 8694bd120..03fb0999d 100755 Binary files a/apps/common/main/resources/img/controls/common-controls.png and b/apps/common/main/resources/img/controls/common-controls.png differ diff --git a/apps/common/main/resources/img/controls/common-controls@1.5x.png b/apps/common/main/resources/img/controls/common-controls@1.5x.png index 1d29d593f..1fd7da019 100644 Binary files a/apps/common/main/resources/img/controls/common-controls@1.5x.png and b/apps/common/main/resources/img/controls/common-controls@1.5x.png differ diff --git a/apps/common/main/resources/img/controls/common-controls@2x.png b/apps/common/main/resources/img/controls/common-controls@2x.png index 1c1de5bcb..7d368d53e 100755 Binary files a/apps/common/main/resources/img/controls/common-controls@2x.png and b/apps/common/main/resources/img/controls/common-controls@2x.png differ diff --git a/apps/common/main/resources/less/asc-mixins.less b/apps/common/main/resources/less/asc-mixins.less index c7e8a6d22..5f3f0311e 100644 --- a/apps/common/main/resources/less/asc-mixins.less +++ b/apps/common/main/resources/less/asc-mixins.less @@ -200,7 +200,7 @@ @common-controls-width: 100px; .img-commonctrl, - .dropdown-menu li .checked:before, .input-error:before, + .dropdown-menu li .checked:before, .input-error:before, .input-warning:before, .btn-toolbar .icon.img-commonctrl, .list-item div.checked:before { background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/@{common-controls}')), ~"url(@{common-image-const-path}/@{common-controls})"); diff --git a/apps/common/main/resources/less/input.less b/apps/common/main/resources/less/input.less index ae0c3328a..4fcbd8755 100644 --- a/apps/common/main/resources/less/input.less +++ b/apps/common/main/resources/less/input.less @@ -61,6 +61,18 @@ display: block; } } + + &.warning { + input:not([disabled]) + .input-error { + display: block; + } + + .input-error { + &:before { + background-position: @input-warning-offset-x @input-warning-offset-y; + } + } + } } input:required:focus:invalid, diff --git a/apps/common/main/resources/less/variables.less b/apps/common/main/resources/less/variables.less index 044f6cbc4..04878d790 100644 --- a/apps/common/main/resources/less/variables.less +++ b/apps/common/main/resources/less/variables.less @@ -771,6 +771,10 @@ @input-error-offset-x: -73px; @input-error-offset-y: -170px; +// Input warning +@input-warning-offset-x: -57px; +@input-warning-offset-y: -170px; + // Spinner @spinner-offset-x: -41px; @spinner-offset-y: -187px; diff --git a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js index 169b2bb0c..bd3b54791 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js @@ -247,6 +247,10 @@ define([ me.codesList.deselectAll(); me.Format = me.api.asc_convertNumFormatLocal2NumFormat(value); me.lblExample.text(me.api.asc_getLocaleExample(me.Format)); + if (!me._state.warning) { + input.showWarning([me.txtCustomWarning]); + me._state.warning = true; + } }); this._decimalPanel = this.$window.find('.format-decimal'); @@ -423,6 +427,8 @@ define([ this.Format = record.get('format'); this.lblExample.text(this.api.asc_getLocaleExample(this.Format)); this.inputCustomFormat.setValue(record.get('value')); + this.inputCustomFormat.showWarning(); + this._state.warning = false; }, onFormatSelect: function(combo, record, e, initFormatInfo) { @@ -565,7 +571,8 @@ define([ txtAs10: 'As tenths (5/10)', txtAs100: 'As hundredths (50/100)', txtSample: 'Sample:', - txtNone: 'None' + txtNone: 'None', + txtCustomWarning: 'Custom format not validated' }, SSE.Views.FormatSettingsDialog || {})) }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index af2f76408..7a224ebd0 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1923,6 +1923,7 @@ "SSE.Views.FormatSettingsDialog.txtUpto1": "Up to one digit (1/3)", "SSE.Views.FormatSettingsDialog.txtUpto2": "Up to two digits (12/25)", "SSE.Views.FormatSettingsDialog.txtUpto3": "Up to three digits (131/135)", + "SSE.Views.FormatSettingsDialog.txtCustomWarning": "Custom format not validated", "SSE.Views.FormulaDialog.sDescription": "Description", "SSE.Views.FormulaDialog.textGroupDescription": "Select Function Group", "SSE.Views.FormulaDialog.textListDescription": "Select Function",