[SSE] Add onClickNext, onClickPreview, show, loadLanguages in Spellcheck
This commit is contained in:
parent
5d97f2a9ec
commit
ba28157080
|
@ -683,7 +683,8 @@ define([
|
||||||
leftMenuView = leftmenuController.getView('LeftMenu'),
|
leftMenuView = leftmenuController.getView('LeftMenu'),
|
||||||
documentHolderView = documentHolderController.getView('DocumentHolder'),
|
documentHolderView = documentHolderController.getView('DocumentHolder'),
|
||||||
chatController = application.getController('Common.Controllers.Chat'),
|
chatController = application.getController('Common.Controllers.Chat'),
|
||||||
pluginsController = application.getController('Common.Controllers.Plugins');
|
pluginsController = application.getController('Common.Controllers.Plugins'),
|
||||||
|
spellcheckController = application.getController('Spellcheck');
|
||||||
|
|
||||||
leftMenuView.getMenu('file').loadDocument({doc:me.appOptions.spreadsheet});
|
leftMenuView.getMenu('file').loadDocument({doc:me.appOptions.spreadsheet});
|
||||||
leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api);
|
leftmenuController.setMode(me.appOptions).createDelayedElements().setApi(me.api);
|
||||||
|
@ -700,6 +701,7 @@ define([
|
||||||
|
|
||||||
documentHolderController.setApi(me.api).loadConfig({config:me.editorConfig});
|
documentHolderController.setApi(me.api).loadConfig({config:me.editorConfig});
|
||||||
chatController.setApi(this.api).setMode(this.appOptions);
|
chatController.setApi(this.api).setMode(this.appOptions);
|
||||||
|
spellcheckController.setApi(this.api).setMode(this.appOptions);
|
||||||
|
|
||||||
statusbarController.createDelayedElements();
|
statusbarController.createDelayedElements();
|
||||||
statusbarController.setApi(me.api);
|
statusbarController.setApi(me.api);
|
||||||
|
|
|
@ -54,6 +54,9 @@ define([
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'Spellcheck': {
|
'Spellcheck': {
|
||||||
'show': function() {
|
'show': function() {
|
||||||
|
if (me.api) {
|
||||||
|
me.api.asc_startSpellCheck();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
'hide': function() {
|
'hide': function() {
|
||||||
}
|
}
|
||||||
|
@ -73,7 +76,7 @@ define([
|
||||||
|
|
||||||
setApi: function(api) {
|
setApi: function(api) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
// this.api.asc_registerCallback('asc_onDocumentOutlineUpdate', _.bind(this.updateSpellcheck, this));
|
this.api.asc_registerCallback('asc_onSpellCheckInit',_.bind(this.loadLanguages, this));
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -83,10 +86,41 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onAfterRender: function(panelSpellcheck) {
|
onAfterRender: function(panelSpellcheck) {
|
||||||
|
panelSpellcheck.buttonPreview.on('click', _.bind(this.onClickPreview, this));
|
||||||
|
panelSpellcheck.buttonNext.on('click', _.bind(this.onClickNext, this));
|
||||||
|
},
|
||||||
|
|
||||||
|
onClickPreview: function() {
|
||||||
|
if (this.api) {
|
||||||
|
this.api.asc_previousWord();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onClickNext: function() {
|
||||||
|
if (this.api) {
|
||||||
|
this.api.asc_nextWord();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
SetDisabled: function(state) {
|
SetDisabled: function(state) {
|
||||||
this._isDisabled = state;
|
this._isDisabled = state;
|
||||||
|
},
|
||||||
|
|
||||||
|
loadLanguages: function (apiLangs) {
|
||||||
|
var langs = [], info,
|
||||||
|
allLangs = Common.util.LanguageInfo.getLanguages();
|
||||||
|
apiLangs.forEach(function (code) {
|
||||||
|
if (allLangs.hasOwnProperty(parseInt(code))) {
|
||||||
|
info = allLangs[parseInt(code)];
|
||||||
|
langs.push({
|
||||||
|
displayValue: info[1],
|
||||||
|
value: info[0],
|
||||||
|
code: parseInt(code),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.languages = langs;
|
||||||
|
this.panelSpellcheck.cmbDictionaryLanguage.setData(this.languages);
|
||||||
}
|
}
|
||||||
|
|
||||||
}, SSE.Controllers.Spellcheck || {}));
|
}, SSE.Controllers.Spellcheck || {}));
|
||||||
|
|
|
@ -153,10 +153,9 @@ define([
|
||||||
this.cmbDictionaryLanguage = new Common.UI.ComboBox({
|
this.cmbDictionaryLanguage = new Common.UI.ComboBox({
|
||||||
el : $('#spellcheck-dictionary-language'),
|
el : $('#spellcheck-dictionary-language'),
|
||||||
style : 'width: 230px',
|
style : 'width: 230px',
|
||||||
menuStyle : 'min-width: 230px;',
|
menuStyle : 'width: 230px;',
|
||||||
editable : false,
|
editable : false,
|
||||||
cls : 'input-group-nr',
|
cls : 'input-group-nr'
|
||||||
data : []
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue