From: Nicolas Boisselier Date: Wed, 19 Aug 2015 22:35:44 +0000 (+0100) Subject: css X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=b610835cb70a28a520165fe8b7709cf4d4933e09;p=nb.git css --- diff --git a/lib/js/nb.js b/lib/js/nb.js index 8dc52110..6ec45081 100644 --- a/lib/js/nb.js +++ b/lib/js/nb.js @@ -4,16 +4,16 @@ * Date: 28.03.15 * See: http://www.w3schools.com/jquery/jquery_ref_selectors.asp */ -var nb = new NB(); function NB() { - this.ready = function(find) { + var that = this; + + this.ready = function() { // Behavior $('form').submit(function(e){ - //alert('nb.form_submit_clean'); //e.preventDefault(); - return nb.form_submit_clean(this); + return that.form_submit_clean(this); }); // Used in css to trigger a resize @@ -29,9 +29,9 @@ function NB() { $(t.find('thead')).each(function(){ $(this).find('th').each(function(){ - th.push(this.innerHTML); + //$(this).find('a').remove(); + th.push($(this).html()); }); - //$(this).css('display','none'); }); //console.log(th.length); @@ -43,7 +43,6 @@ function NB() { //$(this).css('display','block'); i++ }); - //$(this).css('display','block'); }); } @@ -110,7 +109,9 @@ function NB() { }; - this.str2a = function(elems,compact=true,class_exp_file='dir|path') { + this.str2a = function(elems,compact,class_exp_file) { + compact = (typeof compact === 'undefined') ? true : compact; + class_exp_file = (typeof class_exp_file === 'undefined') ? 'dir|path' : class_exp_file; $(elems).each(function(){ var text = $(this).text(); @@ -167,15 +168,15 @@ function NB() { if (typeof(data[0]) == 'object') { for (var i=0;i'+nb.data2html(data[i])+'' ); + //data[i] = that.data2html(data[i]); + items.push( '
  • '+that.data2html(data[i])+'
  • ' ); } else { items.push( '
  • '+data[i]+'
  • ' ); } @@ -188,7 +189,7 @@ function NB() { var val = ''; for (var key in data) { val = data[key]; - if (typeof(val) != 'string') { val = nb.data2html(val); } + if (typeof(val) != 'string') { val = that.data2html(val); } //items.push( '' + key + '' + val + '' ); items.push( '
    ' + key + '
    ' + val + '
    ' ); //items.push( '
    ' + key + '
    ' + val + '
    ' ); @@ -201,8 +202,8 @@ function NB() { this.json2html = function(url) { $.getJSON(url,function(data) { if ($.isArray(data) && data.length == 1) data = data[0]; - var html = nb.data2html(data); - //console.log(nb.data2html(data)); + var html = that.data2html(data); + //console.log(that.data2html(data)); if (html != '') $(html).prependTo( "#msg" ); //console.log(typeof(data)); }); diff --git a/lib/php/db/table.php b/lib/php/db/table.php index c31af228..92398ea8 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -265,6 +265,7 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. foreach ($this->fields() as $name => $field) { if ($add and !preg_match('/^(null)?$/',$field->default)) $row[$name] = $field->default; + elseif(!isset($row[$name])) $row[$name] = ''; echo $field->html_edit($row[$name] # NB 18.08.15 (! $add and array_key_exists($name,$row) ) ? $row[$name] : $field->default ); @@ -661,7 +662,10 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. -----------------------------------------------------------------*/ function rows_begin_json() { $this->_row_json = null; - return '['.PHP_EOL; + return '' + ."// database: $this->db->name\n" + ."// table: $this->name\n" + .'['.PHP_EOL; } function rows_rec_json(&$row) { @@ -703,14 +707,15 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. -----------------------------------------------------------------*/ function rows_begin_xml() { return '' - .''.PHP_EOL - .''.PHP_EOL + .''.PHP_EOL #db->name.'" table="'.$this->name.'" type="'.$this->db->type.'">'.PHP_EOL + .''.PHP_EOL ; } function rows_rec_xml(&$row) { $xml = ''; - $xml .= "\t".PHP_EOL; + $xml .= "\t".PHP_EOL; foreach ($row as $k=>$v) { if ($v !== '') $xml .= '' . "\t\t<".$k.">" @@ -718,12 +723,12 @@ FROM pg_catalog.pg_attribute a WHERE a.attrelid = (SELECT c.oid FROM pg_catalog. . '' .PHP_EOL; } - $xml .= "\t".PHP_EOL; + $xml .= "\t".PHP_EOL; return $xml; } function rows_end_xml() { - return ''.PHP_EOL; + return '
    '.PHP_EOL; } /*----------------------------------------------------------------- diff --git a/lib/php/page.php b/lib/php/page.php index 4ac65ee6..18ff5745 100644 --- a/lib/php/page.php +++ b/lib/php/page.php @@ -244,20 +244,20 @@ class Page extends nb { return $v ? $v[0] : ''; } - function header($name,$value=null) { - - if (empty($_SERVER['DOCUMENT_ROOT'])) return false; - if ($value === null) return $this->get_header($name); - header("$name: $value"); - - } +# NB 19.08.15 function header($name,$value=null) { +# NB 19.08.15 +# NB 19.08.15 if (empty($_SERVER['DOCUMENT_ROOT'])) return false; +# NB 19.08.15 if ($value === null) return $this->get_header($name); +# NB 19.08.15 header("$name: $value"); +# NB 19.08.15 +# NB 19.08.15 } function headers() { #header('Content-type: ' . $this->content_type); $c = strtoupper ( $this->charset ); - $this->header('Content-type: ',$this->content_type . ($c ? "; charset=$c" : "")); -// NB 22.07.15 header('Content-type: '.$this->content_type . ($c ? "; charset=$c" : "")); +# NB 19.08.15 $this->header('Content-type: ',$this->content_type . ($c ? "; charset=$c" : "")); + header('Content-type: '.$this->content_type . ($c ? "; charset=$c" : "")); return true; }