Every tool can now be accessed from URL
This commit is contained in:
@@ -1,17 +1,5 @@
|
|||||||
const tools = new Map();
|
const tools = new Map();
|
||||||
|
|
||||||
/**
|
|
||||||
* Get address of Mock Services
|
|
||||||
*
|
|
||||||
* @function
|
|
||||||
* @name getMockHost
|
|
||||||
* @kind function
|
|
||||||
* @returns {string}
|
|
||||||
*/
|
|
||||||
function getMockHost() {
|
|
||||||
return window.location.protocol + "//" + window.location.hostname + ":8097";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called after page is loaded
|
* Function called after page is loaded
|
||||||
*
|
*
|
||||||
@@ -30,7 +18,15 @@ function init() {
|
|||||||
tools.set("mock", "tools/mock.html");
|
tools.set("mock", "tools/mock.html");
|
||||||
|
|
||||||
changeActiveTools('XML');
|
changeActiveTools('XML');
|
||||||
loadLastPage();
|
var toolUrl = window.location.search.substring(1);
|
||||||
|
if (toolUrl == "") {
|
||||||
|
loadLastPage();
|
||||||
|
}
|
||||||
|
else if (tools.has(toolUrl)) {
|
||||||
|
changeTool(toolUrl);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,6 +77,7 @@ function changeTool(tool) {
|
|||||||
const url = tools.get(tool);
|
const url = tools.get(tool);
|
||||||
localStorage.setItem("lastPage", tool);
|
localStorage.setItem("lastPage", tool);
|
||||||
document.getElementById("iframe").src = url;
|
document.getElementById("iframe").src = url;
|
||||||
|
window.location.search = tool;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user