mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 23:13:00 +02:00
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:
@@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user