Add global helper function for debugging

This commit is contained in:
Florine W. Dekker 2020-11-13 19:07:45 +01:00
parent 6d2441e3e5
commit ad31027561
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
2 changed files with 11 additions and 1 deletions

View File

@ -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",

View File

@ -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())}`;
});