diff --git a/apps/spreadsheeteditor/main/app.js b/apps/spreadsheeteditor/main/app.js index 18e1393c6..f68d2b4f7 100644 --- a/apps/spreadsheeteditor/main/app.js +++ b/apps/spreadsheeteditor/main/app.js @@ -152,6 +152,7 @@ require([ 'Print', 'Toolbar', 'Statusbar', + 'Spellcheck', 'RightMenu', 'LeftMenu', 'Main', @@ -174,6 +175,7 @@ require([ 'spreadsheeteditor/main/app/controller/CellEditor', 'spreadsheeteditor/main/app/controller/Toolbar', 'spreadsheeteditor/main/app/controller/Statusbar', + 'spreadsheeteditor/main/app/controller/Spellcheck', 'spreadsheeteditor/main/app/controller/RightMenu', 'spreadsheeteditor/main/app/controller/LeftMenu', 'spreadsheeteditor/main/app/controller/Main', diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 4667170d1..0498531af 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -202,6 +202,9 @@ define([ this.leftMenu.btnChat.hide(); this.leftMenu.btnComments.hide(); } + + this.leftMenu.setOptionsPanel('spellcheck', this.getApplication().getController('Spellcheck').getView('Spellcheck')); + this.mode.trialMode && this.leftMenu.setDeveloperMode(this.mode.trialMode); /** coauthoring end **/ Common.util.Shortcuts.resumeEvents(); @@ -646,6 +649,7 @@ define([ this.leftMenu.btnChat.setDisabled(true); /** coauthoring end **/ this.leftMenu.btnPlugins.setDisabled(true); + this.leftMenu.btnSpellcheck.setDisabled(true); this.leftMenu.getMenu('file').setMode({isDisconnected: true, enableDownload: !!enableDownload}); if ( this.dlgSearch ) { @@ -844,6 +848,7 @@ define([ this.leftMenu.btnAbout.setDisabled(isRangeSelection); this.leftMenu.btnSearch.setDisabled(isRangeSelection); + this.leftMenu.btnSpellcheck.setDisabled(isRangeSelection); if (this.mode.canPlugins && this.leftMenu.panelPlugins) { this.leftMenu.panelPlugins.setLocked(isRangeSelection); this.leftMenu.panelPlugins.disableControls(isRangeSelection); @@ -855,6 +860,7 @@ define([ this.leftMenu.btnAbout.setDisabled(isEditFormula); this.leftMenu.btnSearch.setDisabled(isEditFormula); + this.leftMenu.btnSpellcheck.setDisabled(isEditFormula); if (this.mode.canPlugins && this.leftMenu.panelPlugins) { this.leftMenu.panelPlugins.setLocked(isEditFormula); this.leftMenu.panelPlugins.disableControls(isEditFormula); diff --git a/apps/spreadsheeteditor/main/app/template/LeftMenu.template b/apps/spreadsheeteditor/main/app/template/LeftMenu.template index 95335821c..bc535469d 100644 --- a/apps/spreadsheeteditor/main/app/template/LeftMenu.template +++ b/apps/spreadsheeteditor/main/app/template/LeftMenu.template @@ -6,6 +6,7 @@ + @@ -13,6 +14,7 @@
+ diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index c88ea99fd..fbf55eeda 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -63,6 +63,7 @@ define([ 'click #left-btn-chat': _.bind(this.onCoauthOptions, this), /** coauthoring end **/ 'click #left-btn-plugins': _.bind(this.onCoauthOptions, this), + 'click #left-btn-spellcheck': _.bind(this.onCoauthOptions, this), 'click #left-btn-support': function() { var config = this.mode.customization; config && !!config.feedback && !!config.feedback.url ? @@ -141,6 +142,15 @@ define([ this.btnPlugins.hide(); this.btnPlugins.on('click', _.bind(this.onBtnMenuClick, this)); + this.btnSpellcheck = new Common.UI.Button({ + el: $('#left-btn-spellcheck'), + hint: this.tipSpellcheck, + enableToggle: true, + disabled: true, + toggleGroup: 'leftMenuGroup' + }); + this.btnSpellcheck.on('click', _.bind(this.onBtnMenuClick, this)); + this.btnSearch.on('click', _.bind(this.onBtnMenuClick, this)); this.btnAbout.on('toggle', _.bind(this.onBtnMenuToggle, this)); @@ -210,6 +220,12 @@ define([ this.panelChat['hide'](); } } + if (this.panelSpellcheck) { + if (this.btnSpellcheck.pressed) { + this.panelSpellcheck.show(); + } else + this.panelSpellcheck['hide'](); + } // if (this.mode.canPlugins && this.panelPlugins) { // if (this.btnPlugins.pressed) { // this.panelPlugins.show(); @@ -226,6 +242,9 @@ define([ } else if (name == 'plugins' && !this.panelPlugins) { this.panelPlugins = panel.render('#left-panel-plugins'); + } else + if (name == 'spellcheck' && !this.panelSpellcheck) { + this.panelSpellcheck = panel.render('#left-panel-spellcheck'); } }, @@ -263,6 +282,10 @@ define([ this.panelPlugins['hide'](); this.btnPlugins.toggle(false, true); } + if (this.panelSpellcheck) { + this.panelSpellcheck['hide'](); + this.btnSpellcheck.toggle(false, true); + } }, isOpened: function() { @@ -282,6 +305,7 @@ define([ this.btnChat.setDisabled(false); /** coauthoring end **/ this.btnPlugins.setDisabled(false); + this.btnSpellcheck.setDisabled(false); }, showMenu: function(menu) { @@ -356,6 +380,7 @@ define([ tipSearch : 'Search', tipPlugins : 'Plugins', txtDeveloper: 'DEVELOPER MODE', - txtTrial: 'TRIAL MODE' + txtTrial: 'TRIAL MODE', + tipSpellcheck: 'Spell Checking' }, SSE.Views.LeftMenu || {})); }); diff --git a/apps/spreadsheeteditor/main/app_dev.js b/apps/spreadsheeteditor/main/app_dev.js index 882239a0f..f2feab9a3 100644 --- a/apps/spreadsheeteditor/main/app_dev.js +++ b/apps/spreadsheeteditor/main/app_dev.js @@ -142,6 +142,7 @@ require([ 'Print', 'Toolbar', 'Statusbar', + 'Spellcheck', 'RightMenu', 'LeftMenu', 'Main', @@ -164,6 +165,7 @@ require([ 'spreadsheeteditor/main/app/controller/CellEditor', 'spreadsheeteditor/main/app/controller/Toolbar', 'spreadsheeteditor/main/app/controller/Statusbar', + 'spreadsheeteditor/main/app/controller/Spellcheck', 'spreadsheeteditor/main/app/controller/RightMenu', 'spreadsheeteditor/main/app/controller/LeftMenu', 'spreadsheeteditor/main/app/controller/Main', diff --git a/apps/spreadsheeteditor/main/resources/less/leftmenu.less b/apps/spreadsheeteditor/main/resources/less/leftmenu.less index 021ce8f9f..31c9a58eb 100644 --- a/apps/spreadsheeteditor/main/resources/less/leftmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/leftmenu.less @@ -15,6 +15,7 @@ .toolbar-btn-icon(btn-menu-about, 58, @toolbar-icon-size); .toolbar-btn-icon(btn-menu-support, 75, @toolbar-icon-size); .toolbar-btn-icon(btn-menu-plugin, 81, @toolbar-icon-size); + .toolbar-btn-icon(btn-menu-spellcheck, 81, @toolbar-icon-size); button.notify .btn-menu-chat, button.notify.over > .btn-menu-chat {background-position: -0*@toolbar-icon-size -60*@toolbar-icon-size;}