Add global helper function for debugging
This commit is contained in:
parent
6d2441e3e5
commit
ad31027561
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "interlanguage-checker",
|
||||
"version": "1.10.17",
|
||||
"version": "1.10.18",
|
||||
"description": "Check the consistency of MediaWiki interlanguage links in a simple overview.",
|
||||
"author": "Felix W. Dekker",
|
||||
"browser": "dist/bundle.js",
|
||||
|
|
|
@ -5,6 +5,10 @@ import {InterlangTable, MessageHandler, ValidatableInput} from "./DOM";
|
|||
import {discoverNetwork, InterlangNetwork, MediaWiki, MediaWikiManager} from "./MediaWiki";
|
||||
|
||||
|
||||
// Contains global functions for debugging
|
||||
window.ilc = {};
|
||||
|
||||
|
||||
doAfterLoad(() => {
|
||||
$("#nav").appendChild(nav("/Tools/Interlanguage Checker/"));
|
||||
$("#header").appendChild(header({
|
||||
|
@ -150,4 +154,10 @@ doAfterLoad(async () => {
|
|||
}
|
||||
if (currentParams.has("article")) articleInput.setValue(currentParams.get("article"));
|
||||
if (currentParams.has("api") && currentParams.has("article")) await submit();
|
||||
|
||||
// Set global debug function
|
||||
window.ilc.getCurrentInputAsUrl = () =>
|
||||
location.href.split("?")[0] +
|
||||
`?api=${encodeURI(urlInput.getValue())}` +
|
||||
`&article=${encodeURI(articleInput.getValue())}`;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue