tazpanel rev 75
Add SHell script colored sytax as seen in boot for /etc/init.d/local.sh
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Apr 12 03:52:19 2011 +0200 (2011-04-12) |
parents | e4a7503f7efd |
children | 7ac8e561d0a5 |
files | boot.cgi index.cgi lib/libtazpanel styles/default/style.css |
line diff
1.1 --- a/boot.cgi Tue Apr 12 03:36:52 2011 +0200 1.2 +++ b/boot.cgi Tue Apr 12 03:52:19 2011 +0200 1.3 @@ -166,7 +166,7 @@ 1.4 </pre> 1.5 <h3>`gettext "Local startup commands"`</h3> 1.6 <pre> 1.7 -`cat /etc/init.d/local.sh` 1.8 +$(cat /etc/init.d/local.sh | syntax_highlighter sh) 1.9 </pre> 1.10 EOT 1.11 ;;
2.1 --- a/index.cgi Tue Apr 12 03:36:52 2011 +0200 2.2 +++ b/index.cgi Tue Apr 12 03:52:19 2011 +0200 2.3 @@ -50,6 +50,8 @@ 2.4 case "$WANT" in 2.5 *.conf|*.lst) 2.6 cat $WANT | syntax_highlighter conf ;; 2.7 + *.sh|*.cgi) 2.8 + cat $WANT | syntax_highlighter sh ;; 2.9 *) 2.10 cat $WANT ;; 2.11 esac
3.1 --- a/lib/libtazpanel Tue Apr 12 03:36:52 2011 +0200 3.2 +++ b/lib/libtazpanel Tue Apr 12 03:52:19 2011 +0200 3.3 @@ -45,6 +45,9 @@ 3.4 -e s"#^[A-Z]\([^']*\)=#<span class='conf-var'>\0</span>#"g \ 3.5 -e s"#^[a-z]\([^']*\)#<span class='conf-var'>\0</span>#"g \ 3.6 -e s"#\"\([^']*\)\"#<span class='conf-val'>\0</span>#"g ;; 3.7 + sh) 3.8 + sed -e s"#^\#\([^']*\)#<span class='sh-comment'>\0</span>#"g \ 3.9 + -e s"#\"\([^']*\)\"#<span class='sh-val'>\0</span>#"g 3.10 esac 3.11 } 3.12
4.1 --- a/styles/default/style.css Tue Apr 12 03:36:52 2011 +0200 4.2 +++ b/styles/default/style.css Tue Apr 12 03:52:19 2011 +0200 4.3 @@ -183,8 +183,9 @@ 4.4 /* syntax_highlighter */ 4.5 4.6 span.conf-comment { color: #666; } 4.7 -span.conf-var { color: #1F1500; } 4.8 -span.conf-val { color: #F35A00; } 4.9 +span.conf-var { color: #1f1500; } 4.10 +span.conf-val, span.sh-val { color: #f35a00; } 4.11 +span.sh-comment { color: #b20000; } 4.12 4.13 /* Misc */ 4.14