KnowZero / tinymce4-languagetool

Attempt to port Language Tool Spelling and Grammar Check to TinyMCE 4 [ALPHA/EXPIREMENTAL]
Apache License 2.0
22 stars 11 forks source link

Cannot read property 'insert' of undefined when status bar disabled #2

Closed pderiy closed 7 years ago

pderiy commented 7 years ago

Hi,

When statusbar is disabled I have 2 errors:

Config:

tinymce.init({
        menubar:false,
        statusbar: false,
        selector: '#mytextarea',
        height: 300,
        lt_lang: 'pl',
        lt_mode: 'new_word',
        lt_highlight_click: 'right',

        plugins: ['code paste'],
        external_plugins: {
          languagetool: '/js/libs/languagetool/plugin.min.js'
        }
      });

Error 1:

Uncaught TypeError: Cannot read property 'insert' of undefined
    at plugin.min.js:197
    at LanguageTool.sgevent.init (languagetool.min.js:118)
    at Object.getEvent (languagetool.min.js:387)
    at Editor.<anonymous> (plugin.min.js:222)
    at Dispatcher.fire (tinymce.js:31460)
    at Editor.fire (tinymce.js:31700)
    at initEditor (tinymce.js:44882)
    at tinymce.js:45036
    at tinymce.js:7689
    at tinymce.js:7160
(anonymous) @ plugin.min.js:197
LanguageTool.sgevent.init @ languagetool.min.js:118
getEvent @ languagetool.min.js:387
(anonymous) @ plugin.min.js:222
fire @ tinymce.js:31460
fire @ tinymce.js:31700
initEditor @ tinymce.js:44882
(anonymous) @ tinymce.js:45036
(anonymous) @ tinymce.js:7689
(anonymous) @ tinymce.js:7160
setTimeout (async)
(anonymous) @ tinymce.js:7159
(anonymous) @ tinymce.js:7271
(anonymous) @ tinymce.js:7160
setTimeout (async)
(anonymous) @ tinymce.js:7159
(anonymous) @ tinymce.js:103
failed @ tinymce.js:7540

Error 2:

Uncaught TypeError: Cannot read property '$el' of undefined
    at plugin.min.js:191
    at lt_progress_bar (languagetool.min.js:1079)
    at languagetool.min.js:577
    at Function.grep (jquery.js:432)
    at Array.<anonymous> (languagetool.min.js:550)
    at Function.each (jquery.js:362)
    at lt_timer_func (languagetool.min.js:549)
(anonymous) @ plugin.min.js:191
lt_progress_bar @ languagetool.min.js:1079
(anonymous) @ languagetool.min.js:577
grep @ jquery.js:432
(anonymous) @ languagetool.min.js:550
each @ jquery.js:362
lt_timer_func @ languagetool.min.js:549
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
setTimeout (async)
lt_timer @ languagetool.min.js:915
lt_timer_func @ languagetool.min.js:756
KnowZero commented 7 years ago

I applied a fix in 0.31-Alpha, see if it works now.

pderiy commented 7 years ago

it works great, thx.