Refined code
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
$(document).ready( function() {
|
||||
document.getElementById("rest-mock").href =
|
||||
window.location.protocol + "//" + window.location.hostname + ":8097";
|
||||
|
||||
});
|
||||
|
||||
|
||||
function getMockHost() {
|
||||
return window.location.protocol + "//" + window.location.hostname + ":8097";
|
||||
}
|
||||
@@ -15,6 +15,18 @@ function importScript(url) {
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
@@ -24,7 +36,6 @@ function importScript(url) {
|
||||
* @returns {void}
|
||||
*/
|
||||
function init() {
|
||||
importScript("/assets/scripts/dyn_host.js");
|
||||
|
||||
tools.set("xpath", "tools/xpath.html");
|
||||
tools.set("xsd", "tools/xsd.html");
|
||||
@@ -70,12 +81,29 @@ function changeActiveTools(activeClass, activeCategoryButton) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that changes active tool
|
||||
*
|
||||
* @function
|
||||
* @name changeTool
|
||||
* @kind function
|
||||
* @param {any} tool
|
||||
* @returns {void}
|
||||
*/
|
||||
function changeTool(tool) {
|
||||
const url = tools.get(tool);
|
||||
localStorage.setItem("lastPage", tool);
|
||||
document.getElementById("iframe").src = url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function that loads last used tool and sets active category accordingly
|
||||
*
|
||||
* @function
|
||||
* @name loadLastPage
|
||||
* @kind function
|
||||
* @returns {void}
|
||||
*/
|
||||
function loadLastPage() {
|
||||
const lastPage = localStorage.getItem("lastPage");
|
||||
switch (lastPage) {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<link rel="stylesheet" href="assets/css/frame.css">
|
||||
<script src="assets/scripts/common/jquery-3.6.0.slim.min.js"></script>
|
||||
<script src="assets/scripts/frame.js"></script>
|
||||
<script src="assets/scripts/dyn_host.js"></script>
|
||||
<!-- <link rel="stylesheet" href="common.css"> -->
|
||||
<link rel="shortcut icon" href="assets/images/favicon.ico" type="image/x-icon">
|
||||
<!-- Meta tags for SEO and SEM -->
|
||||
@@ -34,16 +33,12 @@
|
||||
<div id="content">
|
||||
<div id="leftBar">
|
||||
<ul id="toolList">
|
||||
<li class="dynamic restTool toolListRow" style="display: none;">
|
||||
<a id="rest-mock" href="#" onclick="changeTool('mock');">REST Mock</a>
|
||||
</li>
|
||||
<li class="toolListRow restTool"><a href="#" onclick="changeTool('mock');">REST Mock</a></li>
|
||||
<li class="toolListRow xmlTool"><a href="#" onclick="changeTool('xpath');">XPath</a></li>
|
||||
<li class="toolListRow xmlTool"><a href="#" onclick="changeTool('xslt');">XSLT</a></li>
|
||||
<li class="toolListRow xmlTool"><a href="#" onclick="changeTool('xsd');">XSD</a></li>
|
||||
<li class="toolListRow xmlTool"><a href="#" onclick="changeTool('xmlform');">XML Formatter</a></li>
|
||||
<li class="toolListRow jsonTool" style="display: none;">
|
||||
<a href="#" onclick="changeTool('jsonform');">JSON Formatter</a>
|
||||
</li>
|
||||
<li class="toolListRow jsonTool"><a href="#" onclick="changeTool('jsonform');">JSON Formatter</a></li>
|
||||
</ul>
|
||||
<div id="copyright">
|
||||
Build: [:VERSION:]<br>
|
||||
|
||||
Reference in New Issue
Block a user