# HG changeset patch # User Aleksej Bobylev # Date 1427459312 -7200 # Node ID 7488b357abd30f76b8f7f59b56bd27251d591051 # Parent d6586247420affd25d8f678c72ebeafa214b5856 Code cleaning; add icons for packages and "toggle" to tazpanel.ttf; merge checkbox.js with tazpanel.js. diff -r d6586247420a -r 7488b357abd3 boot.cgi --- a/boot.cgi Wed Mar 25 18:48:01 2015 +0100 +++ b/boot.cgi Fri Mar 27 14:28:32 2015 +0200 @@ -18,14 +18,13 @@ # Print last 40 lines of given file with "more" link -loghead() -{ +loghead() { case $2 in htmlize) tail -n40 $1 | htmlize;; - *) tail -n40;; + *) tail -n40;; esac [ $(wc -l < $1) -gt 40 ] && cat <$(gettext 'Show more...') +
$(gettext 'Show more...') EOT } @@ -365,23 +364,19 @@
$(gettext 'Kernel cmdline')
-
-
$(cat /proc/cmdline)
-
+
$(cat /proc/cmdline)
-
$(gettext 'Local startup commands')
-
-
$(cat /etc/init.d/local.sh | syntax_highlighter sh)
-
-
+
+ $(gettext 'Local startup commands')
- +
-
+ +
$(cat /etc/init.d/local.sh | syntax_highlighter sh)
EOT ;; diff -r d6586247420a -r 7488b357abd3 hardware.cgi --- a/hardware.cgi Wed Mar 25 18:48:01 2015 +0100 +++ b/hardware.cgi Fri Mar 27 14:28:32 2015 +0200 @@ -13,19 +13,24 @@ TITLE=$(gettext 'TazPanel - Hardware') # Call an optional module -lib() -{ +lib() { module=lib/$1 shift [ -s $module ] && . $module "$@" } -lsusb_table() -{ +lsusb_table() { cat < -BusDeviceIDName + + + $(gettext 'Bus') + $(gettext 'Device') + $(gettext 'ID') + $(gettext 'Name') + + EOT lsusb | sed 's|^Bus \([0-9]*\)|\1|; @@ -37,8 +42,7 @@ } -lspci_table() -{ +lspci_table() { cat < SlotDeviceName @@ -51,6 +55,7 @@ echo "" } + # # Commands # @@ -79,10 +84,8 @@

$(gettext 'Detect PCI and USB hardware')

-
-
$(tazhw detect-pci | sed 's|^>|\>|g')
-
$(tazhw detect-usb | sed 's|^>|\>|g')
-
+
$(tazhw detect-pci | sed 's|^>|\>|g')
+
$(tazhw detect-usb | sed 's|^>|\>|g')
EOT ;; @@ -137,7 +140,7 @@ fi cat < - +
@@ -173,11 +176,10 @@

$(gettext 'Detailed information about specified device.')

$(lsusb_table)
- +EOT + [ "$vidpid" != 'lsusb' ] && cat < -
-
$(lsusb -vd $vidpid | syntax_highlighter lsusb)
-
+
$(lsusb -vd $vidpid | syntax_highlighter lsusb)
EOT ;; @@ -192,11 +194,10 @@

$(gettext 'Detailed information about specified device.')

$(lspci_table)
- +EOT + [ "$slot" != 'lspci' ] && cat < -
-
$(lspci -vs $slot | syntax_highlighter lspci)
-
+
$(lspci -vs $slot | syntax_highlighter lspci)
EOT ;; @@ -204,7 +205,7 @@ *) [ -n "$(GET brightness)" ] && - echo -n $(GET brightness) > /sys/devices/virtual/backlight/$(GET dev)/brightness + echo -n $(GET brightness) > /sys/devices/virtual/backlight/$(GET dev)/brightness # # Default to summary with mounted filesystem, loaded modules @@ -360,8 +361,7 @@ EOT df_thead echo '
' - for fs in $(blkid | sort | sed 's/:.*//') - do + for fs in $(blkid | sort | sed 's/:.*//'); do set -- $(df -h | grep "^$fs ") size=$2 used=$3 @@ -448,7 +448,13 @@ # cat < -
$(gettext 'Filesystems table')
+
+ $(gettext 'Filesystems table') +
+ + + +
$(gettext 'Module')
@@ -470,12 +476,6 @@ END{print "
"}' cat < -
- - -
- EOT diff -r d6586247420a -r 7488b357abd3 index.cgi --- a/index.cgi Wed Mar 25 18:48:01 2015 +0100 +++ b/index.cgi Fri Mar 27 14:28:32 2015 +0200 @@ -161,8 +161,9 @@ cat < -
$file -
+
+ $file + $(file_is_modified $file button) diff -r d6586247420a -r 7488b357abd3 lib/checkbox.js --- a/lib/checkbox.js Wed Mar 25 18:48:01 2015 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -javascript:(function() { -function checkBoxes(w) { - try { - var inputs = w.document.getElementsByTagName('input'); - for (var i = 0; i < inputs.length; i++) { - if (inputs[i].type && inputs[i].type == 'checkbox') { - inputs[i].checked = !inputs[i].checked; - } - } - } catch (e){} - if (w.frames && w.frames.length>0) { - for (var i = 0; i < w.frames.length;i++) { - var fr = w.frames[i]; - checkFrames(fr); - } - } -} -checkBoxes(window); -})() diff -r d6586247420a -r 7488b357abd3 lib/tazpanel.js --- a/lib/tazpanel.js Wed Mar 25 18:48:01 2015 +0100 +++ b/lib/tazpanel.js Fri Mar 27 14:28:32 2015 +0200 @@ -162,7 +162,7 @@ } else { - document.getElementById('miscinfo1').innerText = '>'; + //document.getElementById('miscinfo1').innerText = '>'; document.getElementById('head1h').style.display = 'none'; } @@ -407,3 +407,27 @@ wifiSettingsChange(); } + + +// +// Toggle all checkboxes on a page +// + +function checkBoxes(w) { + try { + var inputs = w.document.getElementsByTagName('input'); + for (var i = 0; i < inputs.length; i++) { + if (inputs[i].type && inputs[i].type == 'checkbox') { + inputs[i].checked = !inputs[i].checked; + } + } + } catch (e){} + if (w.frames && w.frames.length>0) { + for (var i = 0; i < w.frames.length;i++) { + var fr = w.frames[i]; + checkFrames(fr); + } + } + return false +} + diff -r d6586247420a -r 7488b357abd3 styles/default/base.css --- a/styles/default/base.css Wed Mar 25 18:48:01 2015 +0100 +++ b/styles/default/base.css Fri Mar 27 14:28:32 2015 +0200 @@ -16,8 +16,7 @@ body > header { position: fixed; top: 0; left: 0; - /*height: 40px;*/ width: 100%; - /*background: #222 url(images/logo.png) no-repeat left; padding-left: 40px;*/ + width: 100%; background-color: #222; } @@ -115,9 +114,10 @@ #toolbarMenu a { display: block; color: inherit; text-decoration: none; } +/* Clicking this layer close menu */ #noMenu { position: fixed; - background-color: transparent; /*hsla(40, 100%, 60%, 0.5);*/ + background-color: transparent; display: none; height: 100%; width: 100%; } @@ -180,7 +180,7 @@ - fieldset { border: 1pt solid; border-radius: 0.3rem; margin-bottom: 0.2rem; } +fieldset { border: 1pt solid; border-radius: 0.3rem; margin-bottom: 0.2rem; } @@ -193,7 +193,6 @@ padding: 0.1rem 0.3rem; white-space: nowrap; width: 1rem; /* minimal width */ } -#icons img { vertical-align: middle; } @@ -673,7 +672,7 @@ * Inputs * **********/ -:default { outline: 1px dotted hsla(240, 100%, 50%, 0.5); outline-offset: -4px; } +/*:default { outline: 1px dotted hsla(240, 100%, 50%, 0.5); outline-offset: -4px; }*/ :required { outline: 1px solid hsla( 30, 100%, 50%, 0.7); outline-offset: -3px; } :invalid { outline: 2px solid hsla( 0, 100%, 50%, 0.7); outline-offset: -3px; } diff -r d6586247420a -r 7488b357abd3 styles/default/tazpanel.ttf Binary file styles/default/tazpanel.ttf has changed diff -r d6586247420a -r 7488b357abd3 styles/default/tweaks.css --- a/styles/default/tweaks.css Wed Mar 25 18:48:01 2015 +0100 +++ b/styles/default/tweaks.css Fri Mar 27 14:28:32 2015 +0200 @@ -184,24 +184,10 @@ * Buttons with icons * **********************/ -.light .icon:before, -.light .icon2:before, -.light [class|="icon"]:before { - text-shadow: 0 1px 0 hsla(0, 0%, 100%, 0.3), 0 0 3px hsla(0, 0%, 100%, 0.7); } -.dark .icon:before, -.dark .icon2:before { - text-shadow: 0 0 3px hsla(0, 0%, 0%, 0.7), 0 1px 0 hsla(0, 0%, 0%, 0.3); } +.light button[data-icon]::before { + text-shadow: 0 1px 0 hsla(0, 0%, 100%, 0.9); } -.dark.nowebkit [data-icon]::before { - text-shadow: - 0 1px 0 hsla(0, 0%, 0%, 0.7), 0 -1px 0 hsla(0, 0%, 0%, 0.4), - 1px 0 0 hsla(0, 0%, 0%, 0.4), -1px 0 0 hsla(0, 0%, 0%, 0.4); } -.light button[data-icon]::before, button { - text-shadow: - 0 1px 0 hsla(0, 0%, 100%, 0.9) /*, 0 -1px 0 hsla(0, 0%, 100%, 0.6), - 1px 0 0 hsla(0, 0%, 100%, 0.6), -1px 0 0 hsla(0, 0%, 100%, 0.6)*/; } - -.dark [data-icon]:before, .dark [data-img] { +.dark [data-icon]:not([disabled])::before, .dark [data-img] { /* Experimental webkit-only styles */ background-image: -webkit-radial-gradient(25% 25%, #fff, #777); -webkit-background-clip: text; @@ -211,21 +197,22 @@ a[data-icon] { white-space: pre-line; } [data-icon="cancel"]::before, [data-icon="delete"]::before, -[data-icon="remove"]::before, [data-icon="stop"]::before, +[data-icon="remove"]::before, [data-icon="stop"]:not([disabled])::before, [data-img="help"]::before, [data-img="man"]::before, [data-img="off"]::before, [data-img="remove"]::before, -[data-img="stop"]::before {color:#dc322f} /*red*/ +[data-img="stop"]::before, [data-icon="pkgib"]::before {color:#dc322f} /*red*/ -[data-icon="restart"]::before, [data-img="conf"]::before {color:#cb4b16} /*orange*/ +[data-icon="restart"]:not([disabled])::before, [data-img="conf"]::before {color:#cb4b16} /*orange*/ [data-icon="ok"]::before, [data-icon="run"]::before, -[data-icon="start"]::before, [data-img="on"]::before, -[data-img="opt"]::before, [data-img="run"]::before {color:#859900} /*green*/ +[data-icon="start"]:not([disabled])::before, [data-img="on"]::before, +[data-img="opt"]::before, [data-img="run"]::before, [data-icon="pkgi"]::before {color:#859900} /*green*/ -[data-img="web"]::before {color:#268bd2} /*blue*/ +[data-img="web"]::before {color:#268bd2}, [data-icon="pkg"]::before /*blue*/ /* disabled buttons with gray icons */ -[disabled][data-icon]:before { color: #888; } +/*.light [disabled][data-icon]::before {color:#888} +.dark [disabled][data-icon]::before {color:#222}*/