]> git.nbdom.net Git - nb.git/commitdiff
bin/color.pl
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 11 Apr 2017 21:17:53 +0000 (22:17 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 11 Apr 2017 21:17:53 +0000 (22:17 +0100)
bin/color.pl
bin/nb-install
www/dbq/html/default.min.css
www/dbq/html/default.min.js

index ea166dbfceb7b37b85bf1634285d855c541d524e..2b9c384e9fabacd37d26684bbee9ee5f5f77988c 100755 (executable)
@@ -100,6 +100,7 @@ if ($Opt{all}) {
   #exit 0;
 # NB 08.08.14   print map { "$BG{$_}\n"
 
+  print "Forgrounds\n";
   for my $fg (keys %FG) {
     my $fg_num = $FG{$fg};
 
@@ -111,7 +112,20 @@ if ($Opt{all}) {
       effect => $EFFECT,
       num => $PRINT_CODE,
     }),"\n";
+  }
+
+  print "\nBackgrounds\n";
+  for my $bg (keys %BG) {
+    my $bg_num = $BG{$bg};
 
+    printf "%15s", "$bg ($bg_num) | ";
+
+    print in_color($input,{
+      fg => $FG,
+      bg => $bg,
+      effect => $EFFECT,
+      num => $PRINT_CODE,
+    }),"\n";
   }
 
   exit 0;
index 965b913cbe52dc48a5b1b455591b0d6d4732f537..cc318ad830ab2b332bbee8152d094aec9e6a537b 100755 (executable)
@@ -4,11 +4,13 @@
 # Install - NB 18.11.14
 #
 ##############################################################################
+main() {
 # NB 13.12.16 . "${BASH_SOURCE%/*}/../etc/profile" || exit
 . $(dirname "$0")/../etc/profile || exit 1; [ -z "$NB_ROOT" ] && exit
 NAME="$(basename "${0}")"
 TMP=/tmp/$NAME.$$
 INSTALL="rsync --archive --checksum --force"
+BY="Generated by $0"
 
 if [ "$UID" != "0" ] ; then
   echo "$NAME: please login as root." 1>&2
@@ -99,8 +101,27 @@ chmod 755 $NB_ROOT/etc/vim/vim* $NB_ROOT/etc/vim/*.sh $NB_ROOT/etc/vim/*.pl $NB_
 NB_USER=`(ls -dl $NB_ROOT 2>/dev/null || printf '- 0 root') | awk '{print $3}'`
 verbose $(chown "$NB_USER" /var/log/nb.log 2> /dev/null)
 
+#
+# nb-commit
+#
+cd "$NB_ROOT" || exit
+rm -v .git/hooks/pre-push
+if [ ! -e .git/hooks/pre-push -a -w .git/hooks ]; then
+  echo "Create .git/hooks/pre-push"
+  cat <<EOF > .git/hooks/pre-push
+#!/bin/sh
+echo .git/hooks/pre-push $* 1>&2
+$([ -e www/dbq/update.sh ] && echo www/dbq/update.sh)
+EOF
+  chmod 755 .git/hooks/pre-push
+  chown "$NB_USER" .git/hooks/pre-push
+fi
+
 #
 # Bye
 #
 rm -f $TMP*
 exit 0
+
+}
+main
index 780e65f787ed8382648827f713aac3ceaaffb07a..52dd6b199da2950dca29e6d3eb0e0eddca43ea90 100644 (file)
@@ -1 +1 @@
-table,table.rows{border-collapse:collapse}.button,a,a:visited{text-decoration:none}html{font:90% 'Trebuchet MS',sans-serif;background-color:#EEE}body{display:table;margin-left:auto;margin-right:auto;padding-left:1em;padding-right:1em;color:#444}h1{margin:0 0 .5em;font-size:180%;padding-bottom:.3em;border-bottom:dashed 1px #444}a{color:inherit}.button,div>a,li a,p a,td a{color:#3572B0}.button:hover,a:hover{opacity:.8}ul{padding:0;margin:0}li{list-style:none;padding:0 0 0 .3em}td,th{padding:.2em .7em}th a.sort{padding:0 .3em}input:not([type]),input[type=text],input[type=password],input[type=date],input[type=email],input[type=url],input[type=''],select,textarea{border-radius:3px;border:1px solid #DDD;padding:.3em .4em;box-shadow:0 1px 1px #EEE}input[size]{max-width:70%}div.row div label:after,form label:after{content:':'}form input,form label,form select{vertical-align:middle;margin:.2em .4em .2em 0}.block,.menu,div.row,form.edit,iframe,object,pre,table.rows,ul.row{border-radius:4px;border-spacing:0;padding:.5em .2em;margin-bottom:.5em;border:1px solid #DDD;background-color:#FAFAFA;box-shadow:0 1px 2px #EEE}.rows{padding:0}table.rows{border-style:hidden;box-shadow:0 0 0 1px #DDD;table-layout:fixed}table.rows.fixed{width:100%}table.rows tr:nth-child(even) td{background-color:#FEFEFE}div.row div,table.rows td,table.rows th,ul.row li{border-bottom:solid 1px #DDD}div.row div,table.rows tr:last-child td,ul.row li{border-bottom:none}table.rows td,table.rows th{border-right:dashed 1px #DDD}table.rows th{text-align:left}table.rows td{padding:.3em}table.rows.fixed td{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}table.rows td.delete,table.rows td.view{width:1%;white-space:nowrap}table.rows.fixed th.view{width:2em}table.rows.fixed th.delete{width:2.7em}div.row div{margin:0}div.row div label,ul.row li label{padding:.1em .5em .1em 0;min-width:20%;display:inline-block}.button{font:inherit;display:inline-block;line-height:1.5em;border-radius:4px;white-space:nowrap;box-sizing:border-box;margin:0 .1em 0 0;cursor:pointer;padding:0 .3em;border:none;background-color:#EEE;background:linear-gradient(to bottom right,#EEE,#DDD);box-shadow:0 1px 1px #BBB}.buttons,.center,.menu,.nav,.rows,td.button{margin-left:auto;margin-right:auto;display:table}form.menu{padding:.5em;background-color:#FAFAFA}form.menu .button.add{float:right;margin-top:.3ex;display:inline}form.menu .criterias{border-top:dashed 1px #DDD;margin-top:.3em;padding-top:.3em}form.menu .criterias span.label{border-right:solid 1px #fff;padding:.2em .1em;margin:.2em .2em 0 0;border-radius:3px}form.menu .criterias span.label:last-child{border-right:none}form.menu select:focus{max-width:auto}form.menu select{max-width:20%}form.menu .criterias input[type=text]:focus{width:auto}form.menu .criterias input[type=text]{width:4em}form.edit .fields input,form.edit .fields select,form.edit .fields textarea{width:65%}form.edit .fields label{width:25%;text-align:right;display:inline-block;margin-right:1em;vertical-align:top}form.edit .fields .label span{width:54%;display:inline-block;text-align:left}
+html{font:90% 'Trebuchet MS',sans-serif;background-color:#EEE}body{display:table;margin-left:auto;margin-right:auto;padding-left:1em;padding-right:1em;color:#444}h1{margin:0 0 0.2em 0;font-size:180%;padding-bottom:0.3em;margin-bottom:0.5em;border-bottom:dashed 1px #444}a{color:inherit}p a,div > a,li a,td a{color:#3572B0}a,a:visited{text-decoration:none}a:hover,.button:hover{opacity:0.8}ul{padding:0;margin:0}li{list-style:none;padding:0 0 0 0.3em}table{border-collapse:collapse}td,th{padding:0.2em 0.7em}th a.sort{padding:0 0.3em}textarea,select,input:not([type]),input[type='text'],input[type='password'],input[type='date'],input[type='email'],input[type='url'],input[type='']{border-radius:3px;border:solid 1px #DDD;padding:0.3em 0.4em;box-shadow:0 1px 1px #EEE}input[size]{max-width:70%}div.row div label:after,form label:after{content:':'}form label,form input,form select{vertical-align:middle;margin:0.2em 0.4em 0.2em 0}table.rows,div.row,ul.row,form.edit,.menu,.block,object,iframe,pre{border-radius:4px;border-spacing:0;padding:0.5em 0.2em;margin-bottom:0.5em;border:solid 1px #DDD;background-color:#FAFAFA;box-shadow:0 1px 2px #EEE}.rows{padding:0}table.rows{border-style:hidden;border-collapse:collapse;box-shadow:0 0 0 1px #DDD;table-layout:fixed}table.rows.fixed{width:100%}table.rows tr:nth-child(even) td{background-color:#FEFEFE}ul.row li,div.row div,table.rows th,table.rows td{border-bottom:solid 1px #DDD}ul.row li,div.row div,table.rows tr:last-child td{border-bottom:none}table.rows th,table.rows td{border-right:dashed 1px #DDD}table.rows th{text-align:left}table.rows td{padding:0.3em 0.3em}table.rows.fixed td{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}table.rows td.view,table.rows td.delete{width:1%;white-space:nowrap}table.rows.fixed th.view{width:2em}table.rows.fixed th.delete{width:2.7em}div.row div{margin:0}ul.row li label,div.row div label{padding:0.1em 0.5em 0.1em 0;min-width:20%;display:inline-block}.button{font:inherit;display:inline-block;text-decoration:none;line-height:1.5em;cursor:pointer;border-radius:4px;white-space:nowrap;box-sizing:border-box;margin:0 0.1em 0 0;cursor:pointer;padding:0 0.3em;border:none;color:#3572B0;background-color:#EEE;background:linear-gradient(to bottom right,#EEE,#DDD);box-shadow:0 1px 1px #BBB}.menu,.nav,.rows,.buttons,td.button,.center{margin-left:auto;margin-right:auto;display:table}form.menu{padding:0.5em;background-color:#FAFAFA}form.menu .button.add{float:right;margin-top:0.3ex;display:inline}form.menu .criterias{border-top:dashed 1px #DDD;margin-top:0.3em;padding-top:0.3em}form.menu .criterias span.label{border-right:solid 1px #fff;padding:0.2em 0.1em;margin:0.2em 0.2em 0 0;border-radius:3px}form.menu .criterias span.label:last-child{border-right:none}form.menu select:focus{max-width:auto}form.menu select{max-width:20%}form.menu .criterias input[type=text]:focus{width:auto}form.menu .criterias input[type=text]{width:4em}form.edit .fields label{width:25%;text-align:right;display:inline-block;margin-right:1em;vertical-align:top}form.edit .fields .label span{width:54%;display:inline-block;text-align:left}form.edit .fields input,form.edit .fields textarea,form.edit .fields select{width:65%}form.edit .fields label{width:25%;text-align:right;display:inline-block;margin-right:1em;vertical-align:top}form.edit .fields .label span{width:54%;display:inline-block;text-align:left}
\ No newline at end of file
index d0633fd7e54535188fd450b5e8f7a4d12d703f6a..b3e079614ee0a719e2f120a075ff7fd3e0601cdc 100644 (file)
@@ -1 +1,6 @@
-function form_clean(e){var t;for(i=0;i<e.length;i++)t=e.elements[i],"none"!=t.style.display&&("text"==t.type?t.value="":!t.type.match(/^select/)||"limit"!=t.name&&"format"!=t.name||(t.selectedIndex=0))}function form_submit_clean(e){var t=0,n="",o=e.getAttribute("action");if("get"!=e.getAttribute("method"))return!0;for(t=0;t<e.length;t++){var r=e[t];r.name&&(""!=r.value&&"undefined"!=r.value&&(n+=(n?"&":"?")+encodeURI(r.name)+"="+encodeURI(r.value)))}return n=("?"==o?"":o)+n,e.reset(),window.location=n,!1}document.addEventListener("DOMContentLoaded",function(){NodeList.prototype.forEach=Array.prototype.forEach,document.querySelectorAll("form").forEach(function(e){e.onsubmit=function(){var e=this.elements.limit;return e.value==window._dbq.default_limit&&e.removeAttribute("value"),form_submit_clean(this)}}),document.querySelectorAll("form.menu").forEach(function(e){e.setAttribute("action",window.location.toString().replace(/\?.*$/,"")),e.querySelectorAll("form.menu select.format").forEach(function(e){e.removeAttribute("name"),e.onchange=function(){return this.form.setAttribute("action",window._dbq["table.base"]+"."+this.value),this.form.onsubmit()}}),e.querySelectorAll("form.menu select.tables").forEach(function(e){e.removeAttribute("name"),e.onchange=function(){return this.form.setAttribute("action",window._dbq["db.base"]+"/"+this.value+".html"),this.form.onsubmit()}}),e.querySelectorAll("form.menu select.limit").forEach(function(e){e.onchange=function(){return this.form.onsubmit()}})}),document.querySelector(".nav.bottom")&&document.querySelector("table.rows")&&document.querySelector("table.rows").insertAdjacentHTML("beforebegin",'<div class="nav top">'+document.querySelector(".nav.bottom").innerHTML+"</div>"),document.querySelectorAll("table").forEach(function(e){parseInt(e.offsetWidth)>parseInt(window.innerWidth)&&(e.className=e.className.replace(/(^| +)fixed($| )/,"")+" fixed",e.className=e.className.trim())}),window._dbq.perm<window._dbq.perms.write&&(document.querySelectorAll("form.edit").forEach(function(e){e.setAttribute("onsubmit","return false")}),document.querySelectorAll("form.edit input[type=submit],form.edit input[type=reset]").forEach(function(e){e.setAttribute("style","display:none")})),document.querySelectorAll("form.menu input[type=submit]").forEach(function(e){e.insertAdjacentHTML("afterend",'&nbsp;<input type="button" class="clear '+e.className+'" onclick="form_clean(this.form)" value="'+window._dbq["text.clear"]+'" />'+(window._dbq.perm>=window._dbq.perms.write?'&nbsp;<input type="button" class="add '+e.className+'" onclick="window.location=\''+window._dbq["table.base"]+'/add/\'" value="'+window._dbq["text.add"]+'"/>':""))})});
+function form_clean(e){var t
+for(i=0;i<e.length;i++)t=e.elements[i],"none"!=t.style.display&&("text"==t.type?t.value="":!t.type.match(/^select/)||"limit"!=t.name&&"format"!=t.name||(t.selectedIndex=0))}function form_submit_clean(e){var t=0,n="",o=e.getAttribute("action"),r=e.getAttribute("method")
+if("get"!=r)return!0
+for(t=0;t<e.length;t++){var i=e[t]
+i.name&&""!=i.value&&"undefined"!=i.value&&(n+=(n?"&":"?")+encodeURI(i.name)+"="+encodeURI(i.value))}return n=("?"==o?"":o)+n,e.reset(),window.location=n,!1}document.addEventListener("DOMContentLoaded",function(){NodeList.prototype.forEach=Array.prototype.forEach,document.querySelectorAll("form").forEach(function(e){e.onsubmit=function(){if(this.elements.limit){var e=this.elements.limit
+"undefined"!=window._dbq.default_limit&&e.value==window._dbq.default_limit&&e.removeAttribute("value")}return form_submit_clean(this)}}),document.querySelectorAll("form.menu").forEach(function(e){e.setAttribute("action",window.location.toString().replace(/\?.*$/,"")),e.querySelectorAll("form.menu select.format").forEach(function(e){e.removeAttribute("name"),e.onchange=function(){return this.form.setAttribute("action",window._dbq["table.base"]+"."+this.value),this.form.onsubmit()}}),e.querySelectorAll("form.menu select.tables").forEach(function(e){e.removeAttribute("name"),e.onchange=function(){return this.form.setAttribute("action",window._dbq["db.base"]+"/"+this.value+".html"),this.form.onsubmit()}}),e.querySelectorAll("form.menu select.limit").forEach(function(e){e.onchange=function(){return this.form.onsubmit()}})}),document.querySelector(".nav.bottom")&&document.querySelector("table.rows")&&document.querySelector("table.rows").insertAdjacentHTML("beforebegin",'<div class="nav top">'+document.querySelector(".nav.bottom").innerHTML+"</div>"),document.querySelectorAll("table").forEach(function(e){parseInt(e.offsetWidth)>parseInt(window.innerWidth)&&(e.className=e.className.replace(/(^| +)fixed($| )/,"")+" fixed",e.className=e.className.trim())}),window._dbq.perm<window._dbq.perms.write&&(document.querySelectorAll("form.edit").forEach(function(e){e.setAttribute("onsubmit","return false")}),document.querySelectorAll("form.edit input[type=submit],form.edit input[type=reset]").forEach(function(e){e.setAttribute("style","display:none")})),document.querySelectorAll("form.menu input[type=submit]").forEach(function(e){e.insertAdjacentHTML("afterend",'&nbsp;<input type="button" class="clear '+e.className+'" onclick="form_clean(this.form)" value="'+window._dbq["text.clear"]+'" />'+(window._dbq.perm>=window._dbq.perms.write?'&nbsp;<input type="button" class="add '+e.className+'" onclick="window.location=\''+window._dbq["table.base"]+'/add/\'" value="'+window._dbq["text.add"]+'"/>':""))})})