From 1f7890de40938fdcc2e9b794506df83a044f6dc2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 21 Feb 2023 22:52:10 +0100 Subject: [PATCH] yWeb: move goUrl() and goPort() away from Y_NIlib.js Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/bc1587019750598e601285127f61124255eb89e5 Author: vanhofen 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 --- data/y-web/Y_Baselib.js | 25 +++++++++++++++++++++++++ data/y-web/Y_Blocks.txt | 1 - data/y-web/Y_NI_About.yhtm | 5 +++-- data/y-web/Y_NI_Camd-control.yhtm | 1 + data/y-web/Y_NI_Infoicons-control.yhtm | 2 ++ data/y-web/Y_NI_NetFS-control.yhtm | 1 + data/y-web/Y_NI_NetFS-edit.yhtm | 1 + data/y-web/Y_NI_NetFS-init.yhtm | 1 + data/y-web/Y_NI_PZapit-control.yhtm | 1 + data/y-web/Y_NI_Plugin-control.yhtm | 1 + data/y-web/Y_NIlib.js | 21 --------------------- data/y-web/Y_Tools_Boxcontrol.yhtm | 8 -------- data/y-web/Y_Tools_Info_Menue.yhtm | 6 ------ data/y-web/Y_Version.txt | 4 ++-- 14 files changed, 38 insertions(+), 40 deletions(-) diff --git a/data/y-web/Y_Baselib.js b/data/y-web/Y_Baselib.js index 4adddb64e..887e87a80 100644 --- a/data/y-web/Y_Baselib.js +++ b/data/y-web/Y_Baselib.js @@ -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"); +} diff --git a/data/y-web/Y_Blocks.txt b/data/y-web/Y_Blocks.txt index 692d4796b..df5d83bc3 100644 --- a/data/y-web/Y_Blocks.txt +++ b/data/y-web/Y_Blocks.txt @@ -299,7 +299,6 @@ start-block~head_ni {=include-block:Y_Blocks.txt;js_prototype=} {=include-block:Y_Blocks.txt;js_jquery=} {=include-block:Y_Blocks.txt;js_jquery_ui=} -