tazpanel diff hardware.cgi @ rev 558

Change icons presentation in code - free to use anywhere, simplify icons substitution, minify html, misc
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Dec 10 04:11:45 2015 +0200 (2015-12-10)
parents 3c251737e46b
children af9f79648680
line diff
     1.1 --- a/hardware.cgi	Wed Oct 14 01:55:48 2015 +0300
     1.2 +++ b/hardware.cgi	Thu Dec 10 04:11:45 2015 +0200
     1.3 @@ -167,7 +167,7 @@
     1.4  			do
     1.5  				name=$(basename $line)
     1.6  				mod=${name%.ko.xz}
     1.7 -				echo "<span data-icon=\"modules\">$(_ 'Module:')</span> <a href='?modinfo=$mod'>$mod</a>"
     1.8 +				echo "<span data-icon=\"@modules@\">$(_ 'Module:')</span> <a href='?modinfo=$mod'>$mod</a>"
     1.9  			done
    1.10  			echo '</pre></section>'
    1.11  		fi
    1.12 @@ -249,9 +249,9 @@
    1.13  <p>$(_ 'Manage your computer hardware')</p>
    1.14  
    1.15  <form><!--
    1.16 -	--><button name="modules" data-icon="modules">$(_ 'Kernel modules')</button><!--
    1.17 -	--><button name="detect"  data-icon="detect" data-root>$(_ 'Detect PCI/USB')</button><!--
    1.18 -	--><button name="tazx"    data-icon="tazx"   data-root>$(_ 'Auto-install Xorg video driver')</button><!--
    1.19 +	--><button name="modules" data-icon="@modules@">$(_ 'Kernel modules')</button><!--
    1.20 +	--><button name="detect"  data-icon="@detect@" data-root>$(_ 'Detect PCI/USB')</button><!--
    1.21 +	--><button name="tazx"    data-icon="@tazx@"   data-root>$(_ 'Auto-install Xorg video driver')</button><!--
    1.22  --></form>
    1.23  
    1.24  EOT
    1.25 @@ -278,7 +278,7 @@
    1.26  				rempct=$(( $remain * 100 / $full ))
    1.27  				cat <<EOT
    1.28  			<tr>
    1.29 -				<td><span data-icon="battery">$(_ 'Battery')</span>
    1.30 +				<td><span data-icon="@battery@">$(_ 'Battery')</span>
    1.31  					$(grep "^battery type" $dev/info | sed 's/.*: *//')
    1.32  					$(grep "^design capacity:" $dev/info | sed 's/.*: *//') </td>
    1.33  				<td>$(_ 'health') $(( (100*$full)/$design))%</td>
    1.34 @@ -315,7 +315,7 @@
    1.35  
    1.36  		# Thermal sensors
    1.37  		if [ -n "$(ls /sys/devices/virtual/thermal/*/temp 2>/dev/null)" ]; then
    1.38 -			echo "<p><span data-icon=\"temperature\">$(_ 'Temperature:')</span>"
    1.39 +			echo "<p><span data-icon=\"@temperature@\">$(_ 'Temperature:')</span>"
    1.40  			for temp in /sys/devices/virtual/thermal/*/temp; do
    1.41  				awk '{ print $1/1000 "℃" }' < $temp
    1.42  			done
    1.43 @@ -330,7 +330,7 @@
    1.44  				name=$(echo $dev | sed 's|.*/backlight/\([^/]*\).*|\1|')
    1.45  				cat <<EOT
    1.46  <input type="hidden" name="dev" value="$name"/>
    1.47 -<span data-icon="brightness">$(_ 'Brightness')</span> \
    1.48 +<span data-icon="@brightness@">$(_ 'Brightness')</span> \
    1.49  $(sed 's/.*\.//;s/_*$//' < /sys/devices/virtual/backlight/$name/device/path):
    1.50  <select name="brightness" onchange="submit();">
    1.51  EOT
    1.52 @@ -424,14 +424,14 @@
    1.53  			size="$(blk2h $(cat /sys/block/${fs#/dev/}/size /sys/block/*/${fs#/dev/}/size))"
    1.54  
    1.55  			# image
    1.56 -			disktype="hdd"
    1.57 +			disktype="@hdd@"
    1.58  			case "$(cat /sys/block/${fs#/dev/}/removable 2>/dev/null ||
    1.59  				cat /sys/block/${fs:5:3}/removable 2>/dev/null)" in
    1.60 -			1) disktype="removable" ;;
    1.61 +			1) disktype="@removable@" ;;
    1.62  			esac
    1.63  			case "$(cat /sys/block/${fs#/dev/}/ro 2>/dev/null ||
    1.64  				cat /sys/block/${fs:5:3}/ro 2>/dev/null)" in
    1.65 -			1) disktype="cd" ;;
    1.66 +			1) disktype="@cd@" ;;
    1.67  			esac
    1.68  
    1.69  			radio="<input type=\"radio\" name=\"device\" value=\"$action $fs\" id=\"${fs#/dev/}\"/>"
    1.70 @@ -551,7 +551,7 @@
    1.71  	set -- "${3:-$(cat $dir/loop/backing_file)}" "${2:-$(cat $dir/loop/offset)}" ${ro// /&nbsp;}
    1.72  	cat <<EOT
    1.73  				<tr><td><input type="radio" name="loopdev" value="$devloop" id="$loop"/><!--
    1.74 -					--><label for="$loop" data-icon="loopback">$loop</label></td>
    1.75 +					--><label for="$loop" data-icon="@loopback@">$loop</label></td>
    1.76  					<td>$1</td><td>$size</td><td align="center">$3</td><td align="right">$2</td>
    1.77  				</tr>
    1.78  EOT
    1.79 @@ -564,7 +564,7 @@
    1.80  $(lib crypto input)
    1.81  
    1.82  		<footer>
    1.83 -			<button type="submit" data-icon="ok">$(_ 'Setup')</button> -
    1.84 +			<button type="submit" data-icon="@ok@">$(_ 'Setup')</button> -
    1.85  			$(_ 'new backing file:') <input type="text" name="backingfile"/> -
    1.86  			$(_ 'offset in bytes:') <input type="text" name="offset" value="0" size="8"/> -
    1.87  			<input type="checkbox" name="readonly" id="ro"/><label for="ro">$(_ 'read only')</label>