yWeb: move goUrl() and goPort() away from Y_NIlib.js

Origin commit data
------------------
Branch: ni/coolstream
Commit: bc15870197
Author: vanhofen <vanhofen@gmx.de>
Date: 2023-02-21 (Tue, 21 Feb 2023)

Origin message was:
------------------
- yWeb: move goUrl() and goPort() away from Y_NIlib.js

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2023-02-21 22:52:10 +01:00
parent b4d785c51a
commit 1f7890de40
14 changed files with 38 additions and 40 deletions

View File

@@ -528,3 +528,28 @@ function saveTextAsFile(content, filename, filetype)
}
downloadLink.click();
}
function goUrl(_url)
{
var res = trim(loadSyncURL(_url));
switch(res)
{
case "1": res = "on"; break;
case "0": res = "off"; break;
}
var out = document.getElementById("out");
if (out)
out.innerHTML = res;
}
function goPort(_port)
{
if (_port == "")
return;
var host = self.location.href;
var pos1 = host.indexOf('//');
var temp = host.substring(pos1 + 2, host.length);
var pos2 = temp.indexOf('/');
var host = host.substring(0, pos1 + 2 + pos2);
window.open(host + ":" + _port, "_blank");
}