321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
}
}
}
catch (e) {
showError(e);
}
},
onWrite: function () {
if (document.getElementById("lemma").value.trim() !== "") {
showElement("editor");
this.update();
} else {
hideElement("editor");
|
>
>
>
>
>
>
>
>
>
|
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
}
}
}
catch (e) {
showError(e);
}
},
newEntry: function (sWord) {
if (typeof(sWord) !== "string" || !sWord) {
return;
}
oTabulations.showPage("add_page");
document.getElementById("lemma").value = sWord;
this.onWrite();
},
onWrite: function () {
if (document.getElementById("lemma").value.trim() !== "") {
showElement("editor");
this.update();
} else {
hideElement("editor");
|
842
843
844
845
846
847
848
|
oTagsInfo.load();
oSearch.load();
oDictHandler.loadDictionaries();
oBinaryDict.listen();
oGenerator.listen();
oTabulations.listen();
oSearch.listen();
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
|
oTagsInfo.load();
oSearch.load();
oDictHandler.loadDictionaries();
oBinaryDict.listen();
oGenerator.listen();
oTabulations.listen();
oSearch.listen();
/*
Messages received
*/
function handleMessage (oMessage, xSender, sendResponse) {
let {sActionRequest, oParam} = oMessage;
switch(sActionRequest) {
case "new_entry":
oGenerator.newEntry(oParam.sWord);
break;
default:
console.log("[Grammalecte] Lexicon editor. Unknown command: " + sActionRequest);
}
//sendResponse({sCommand: "none", result: "done"});
}
browser.runtime.onMessage.addListener(handleMessage);
|