diff --git a/json_config.js b/json_config.js index 46a525e..e8be00f 100644 --- a/json_config.js +++ b/json_config.js @@ -109,7 +109,7 @@ function edit_cancel() document.getElementById("dict_editor").className = "closed"; document.getElementById("edit_entries").value = ""; } -function edit_apply() +function edit_apply(and_then = undefined) { try { @@ -126,6 +126,8 @@ function edit_apply() save_dicts(); } + if(and_then) + and_then(); } catch(e) { @@ -134,8 +136,7 @@ function edit_apply() } function edit_okay() { - edit_apply(); - edit_cancel(); + edit_apply(edit_cancel); } function or_default(val, fallback) diff --git a/options.js b/options.js index 708c8f1..1cab3ac 100644 --- a/options.js +++ b/options.js @@ -589,6 +589,16 @@ function buildpage() optionsection.appendChild(document.createElement("hr")); + // import + + let jsonmanagebutton = document.createElement("button"); + jsonmanagebutton.type = "button"; + jsonmanagebutton.innerText = "Manage JSON Dictionaries"; + jsonmanagebutton.onclick = function(e){browser.windows.create({url:browser.extension.getURL('json_config.html'),type:'popup'}); e.preventDefault();}; + optionsection.appendChild(jsonmanagebutton); + + optionsection.appendChild(document.createElement("hr")); + // deconjugation rules let decon_file = document.createElement("input");