luci-app-adblock: consolidate css 2283/head
authorDirk Brenken <dev@brenken.org>
Wed, 14 Nov 2018 09:45:18 +0000 (10:45 +0100)
committerDirk Brenken <dev@brenken.org>
Wed, 14 Nov 2018 09:45:18 +0000 (10:45 +0100)
* fix IE Edge rendering issues
* merge external styles in central css

Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-adblock/luasrc/model/cbi/adblock/blacklist_tab.lua
applications/luci-app-adblock/luasrc/model/cbi/adblock/configuration_tab.lua
applications/luci-app-adblock/luasrc/model/cbi/adblock/whitelist_tab.lua
applications/luci-app-adblock/luasrc/view/adblock/adblock_css.htm [new file with mode: 0644]
applications/luci-app-adblock/luasrc/view/adblock/blocklist.htm
applications/luci-app-adblock/luasrc/view/adblock/config_css.htm [deleted file]
applications/luci-app-adblock/luasrc/view/adblock/logread.htm
applications/luci-app-adblock/luasrc/view/adblock/runtime.htm

index b3b3f8d0eb87a3e6fb9f877be862e5d5eac36107..4d1a9f7e63db7ff49bbb53cf7a87fe7b4acd8516 100644 (file)
@@ -23,7 +23,7 @@ if fs.stat(input).size >= 102400 then
 end
 
 m = SimpleForm("input", nil)
-m:append(Template("adblock/config_css"))
+m:append(Template("adblock/adblock_css"))
 m.submit = translate("Save")
 m.reset = false
 
index 1e98f0204b24460f601ea76920ba0967d3e703c7..1e7eda903241d49f17bae0b47f7021367bf81655 100644 (file)
@@ -22,7 +22,7 @@ if fs.stat(input).size >= 102400 then
 end
 
 m = SimpleForm("input", nil)
-m:append(Template("adblock/config_css"))
+m:append(Template("adblock/adblock_css"))
 m.submit = translate("Save")
 m.reset = false
 
index a78d9af4ac0fa504460681f50b8f3cc7ff16b0cc..03dcecf1aa377939dc5953f45279e028651916d0 100644 (file)
@@ -23,7 +23,7 @@ if fs.stat(input).size >= 102400 then
 end
 
 m = SimpleForm("input", nil)
-m:append(Template("adblock/config_css"))
+m:append(Template("adblock/adblock_css"))
 m.submit = translate("Save")
 m.reset = false
 
diff --git a/applications/luci-app-adblock/luasrc/view/adblock/adblock_css.htm b/applications/luci-app-adblock/luasrc/view/adblock/adblock_css.htm
new file mode 100644 (file)
index 0000000..5d95d13
--- /dev/null
@@ -0,0 +1,108 @@
+<style type="text/css">
+       textarea
+       {
+               width: 100%;
+               height: 450px;
+               border: 1px solid #cccccc;
+               padding: 5px;
+               font-size: 12px;
+               font-family: monospace;
+               resize: none;
+               white-space: pre;
+               overflow-wrap: normal;
+               overflow-x: scroll;
+       }
+
+       select[readonly],
+       textarea[readonly]
+       {
+               width: 100%;
+               height: 450px;
+               border: 1px solid #cccccc;
+               padding: 5px;
+               font-size: 12px;
+               font-family: monospace;
+               resize: none;
+               pointer-events: auto;
+               cursor: auto;
+       }
+
+       .table.cbi-section-table .th,
+       .table.cbi-section-table .td,
+       .cbi-section-table-cell,
+       .cbi-section-table-row,
+       .tr[data-title]::before
+       {
+               text-align: left;
+               vertical-align: top;
+               margin-left: 0px;
+               padding-left: 2px;
+       }
+
+       .table.cbi-section-table .th
+       {
+               white-space: nowrap;
+       }
+
+       .cbi-section-table-row > .cbi-value-field .cbi-input-select,
+       .table.cbi-section-table select
+       {
+               width: 70px;
+       }
+
+       .cbi-section-table-row > .cbi-value-field [data-dynlist] > input,
+       .table.cbi-section-table input[type="text"],
+       .cbi-dynlist > .item,
+       .table.cbi-section-table input,
+       .cbi-dynlist
+       {
+               display: inline-block;
+               width: 7em;
+               margin: 1px;
+       }
+
+       .td.cbi-value-field .cbi-button
+       {
+               width: auto;
+               margin: 1px 0 1px -2px;
+       }
+
+       .btn,
+       .cbi-button,
+       .item::after
+       {
+               -webkit-appearance: menulist;
+       }
+
+       .cbi-input-checkbox
+       {
+               height: 1em;
+       }
+
+       .cbi-input-text
+       {
+               text-align: left;
+               padding-left: 2px;
+               outline: none;
+               box-shadow: none;
+               background: transparent;
+               width: 7em;
+       }
+
+       .runtime
+       {
+               color: #37c;
+               font-weight: bold;
+               display: inline-block;
+               width: 100%;
+               padding-top: 0.5rem;
+       }
+
+       .button_running
+       {
+               display: inline-block;
+               width: 16px;
+               height: 16px;
+               margin: 0 5px;
+       }
+</style>
index a6f2286513ed86df0cf85de7213ee3854e4b6ead..e145a3b4ef4f30b08b6ab4666288cf828cd6cb19 100644 (file)
@@ -7,42 +7,7 @@ This is free software, licensed under the Apache License, Version 2.0
 local anonclass  = (not self.anonymous or self.sectiontitle) and "named" or "anonymous"
 -%>
 
-<style type="text/css">
-.table.cbi-section-table .th,
-.table.cbi-section-table .td,
-.cbi-section-table-cell,
-.cbi-section-table-row,
-.tr[data-title]::before
-{
-       text-align: left;
-       vertical-align: top;
-       margin-left: 0px;
-       padding-left: 2px;
-}
-.table.cbi-section-table .th
-{
-       white-space: nowrap;
-}
-.table.cbi-section-table input
-{
-       width: 7em;
-}
-.cbi-section-table-row > .cbi-value-field [data-dynlist] > input,
-.table.cbi-section-table input
-{
-       width: 7em;
-}
-
-.cbi-input-text
-{
-       text-align: left;
-       padding-left: 2px;
-       outline: none;
-       box-shadow: none;
-       background: transparent;
-       width: 7em;
-}
-</style>
+<%+adblock/adblock_css%>
 
 <div class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
        <% if self.title then -%>
diff --git a/applications/luci-app-adblock/luasrc/view/adblock/config_css.htm b/applications/luci-app-adblock/luasrc/view/adblock/config_css.htm
deleted file mode 100644 (file)
index 2233a15..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<style type="text/css">
-       textarea
-       {
-               border: 1px solid #cccccc;
-               padding: 5px;
-               font-size: 12px;
-               font-family: monospace;
-               resize: none;
-               white-space: pre;
-               overflow-wrap: normal;
-               overflow-x: scroll;
-       }
-</style>
index b5052334909c42c48d710df93ad5623876749660..7fe254ae807e7cc2e743ba198fb246bdffeae328 100644 (file)
@@ -4,21 +4,7 @@ This is free software, licensed under the Apache License, Version 2.0
 -%>
 
 <%+header%>
-<style type="text/css">
-       select[readonly],
-       textarea[readonly]
-       {
-               width: 100%;
-               height: 450px;
-               border: 1px solid #cccccc;
-               padding: 5px;
-               font-size: 12px;
-               font-family: monospace;
-               resize: none;
-               pointer-events: auto;
-               cursor: auto;
-       }
-</style>
+<%+adblock/adblock_css%>
 
 <script type="text/javascript">
 //<![CDATA[
index 4f7cfbf8a1cf8cccc91ddd9759ba9d3b242de7a0..ee20133d5ae26174f1b21139c08fe9e78326800d 100644 (file)
@@ -3,17 +3,7 @@ Copyright 2017-2018 Dirk Brenken (dev@brenken.org)
 This is free software, licensed under the Apache License, Version 2.0
 -%>
 
-<style type="text/css">
-.runtime
-{
-       color: #37c;
-       font-weight: bold;
-       display: inline-block;
-       width: 100%;
-       padding-top: 0.5rem;
-}
-</style>
-
+<%+adblock/adblock_css%>
 <script type="text/javascript">
 //<![CDATA[
        function status_update(json)
@@ -188,7 +178,7 @@ This is free software, licensed under the Apache License, Version 2.0
        <label class="cbi-value-title" for="button_1"><%:Suspend / Resume Adblock%></label>
        <div class="cbi-value-field">
                <input class="cbi-button cbi-button-reset" id="btn1" type="button" value="" onclick="btn_action(this)" />
-               <span id="btn1_running" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>
+               <span id="btn1_running" class="btn_running"></span>
        </div>
 </div>
 <p />
@@ -196,6 +186,6 @@ This is free software, licensed under the Apache License, Version 2.0
        <label class="cbi-value-title" for="button_2"><%:Refresh Blocklist Sources%></label>
        <div class="cbi-value-field">
                <input class="cbi-button cbi-button-apply" id="btn2" type="button" value="" onclick="btn_action(this)" />
-               <span id="btn2_running" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>
+               <span id="btn2_running" class="btn_running"></span>
        </div>
 </div>