Grammalecte  Diff

Differences From Artifact [08d2b10057]:

To Artifact [b8d0b75897]:


294
295
296
297
298
299
300



























/*
    Start
*/
oGrammalecte.listenRightClick();
oGrammalecte.createMenus();
































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325


/*
    Start
*/
oGrammalecte.listenRightClick();
oGrammalecte.createMenus();

/*
    When a textarea is added via jascript we add the menu :)
*/
let observer = new MutationObserver(function(mutations) {
    mutations.forEach(function(mutation) {
        for(let i = 0; i < mutation.addedNodes.length; i++){
            if ( mutation.addedNodes[i].getElementsByTagName ){
                if ( mutation.addedNodes[i].tagName == "TEXTAREA" ) {
                    oGrammalecte.lMenu.push(new GrammalecteMenu(oGrammalecte.nMenu, mutation.addedNodes[i]));
                    oGrammalecte.nMenu += 1;
                } else {
                    for (let xNode of mutation.addedNodes[i].getElementsByTagName("textarea")) {
                        oGrammalecte.lMenu.push(new GrammalecteMenu(oGrammalecte.nMenu, xNode));
                        oGrammalecte.nMenu += 1;
                    }
                }
            }
        }
    });
});
observer.observe(document.body, {
    childList: true,
    subtree: true
});