diff options
author | Stan Grishin <stangri@melmac.ca> | 2022-11-07 16:41:11 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 16:41:11 -0800 |
commit | 98842ccee86c6db191434484fb85126124844ab0 (patch) | |
tree | cc28ad22e769b0cf047cf115a62be457cb290f07 /applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm | |
parent | 740952373f21f066d8c49543b6f1cd81f9131191 (diff) | |
parent | 0b895b17940089f854221b340fafae83bcbb2a99 (diff) |
Merge pull request #6075 from stangri/master-luci-app-simple-adblock
luci-app-simple-adblock: convert to js
Diffstat (limited to 'applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm')
-rw-r--r-- | applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm b/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm deleted file mode 100644 index 51198293f5..0000000000 --- a/applications/luci-app-simple-adblock/luasrc/view/simple-adblock/js.htm +++ /dev/null @@ -1,59 +0,0 @@ -<script type="text/javascript"> -//<![CDATA[ - function button_action(action) { - var xhr = new XHR(false); - var btn_start = document.getElementById("btn_start"); - var btn_action = document.getElementById("btn_action"); - var btn_stop = document.getElementById("btn_stop"); - var btn_enable = document.getElementById("btn_enable"); - var btn_disable = document.getElementById("btn_disable"); - var btn_spinner; - switch (action.name) { - case "start": - btn_spinner = document.getElementById("btn_start_spinner"); - break; - case "action": - btn_spinner = document.getElementById("btn_action_spinner"); - break; - case "stop": - btn_spinner = document.getElementById("btn_stop_spinner"); - break; - case "enable": - btn_spinner = document.getElementById("btn_enable_spinner"); - break; - case "disable": - btn_spinner = document.getElementById("btn_disable_spinner"); - break; - } - btn_start.disabled = true; - btn_action.disabled = true; - btn_stop.disabled = true; - btn_enable.disabled = true; - btn_disable.disabled = true; - spinner(btn_spinner, 1); - xhr.get('<%=luci.dispatcher.build_url("admin", "services", "simple-adblock", "action")%>/' + action.name, null, - function (x) { - if (!x) { - return; - } - btn_start.disabled = false; - btn_action.disabled = false; - btn_stop.disabled = false; - btn_enable.disabled = false; - btn_disable.disabled = false; - spinner(btn_spinner, 0); - location.reload(); - }); -} -function spinner(element, state) { - if (state === 1) { - element.style.width = "16px"; - element.innerHTML = '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" width="16" height="16" style="vertical-align:middle" />'; - } - else { - element.style.width = "0px"; - element.innerHTML = ''; - } -} -//]]> -</script>
\ No newline at end of file |