From: Metabox Date: Thu, 27 Jun 2019 13:22:38 +0000 (+1000) Subject: close min buttons. X-Git-Url: https://lifelog.hopto.org/gitweb/?a=commitdiff_plain;h=424803104be8c1b009edb113290095c005d26ad7;p=LifeLog.git close min buttons. --- diff --git a/htdocs/cgi-bin/login_ctr.cgi b/htdocs/cgi-bin/login_ctr.cgi index 7ff5758..b3b2599 100755 --- a/htdocs/cgi-bin/login_ctr.cgi +++ b/htdocs/cgi-bin/login_ctr.cgi @@ -418,6 +418,7 @@ sub insertDefCats { $st = $_[0]->prepare('INSERT INTO CAT VALUES (?,?,?)'); $_[0]->begin_work(); $st->execute(1, "Unspecified", "For quick uncategorised entries."); + $st->execute(2, "Document", "Large Protected RichText document log entry type."); $st->execute(3, "File", "Operating file system short log."); $st->execute(6, "System Log", "Operating system important log."); $st->execute(9, "Event", "Event that occured, meeting, historically important."); diff --git a/htdocs/cgi-bin/main.cgi b/htdocs/cgi-bin/main.cgi index 3c04c1f..01c8992 100755 --- a/htdocs/cgi-bin/main.cgi +++ b/htdocs/cgi-bin/main.cgi @@ -362,10 +362,10 @@ while ( my @row = $st->fetchrow_array() ) { my $ext = substr( $lnk, index( $lnk, '.' ) ); $lnk =~ s/_frm.png/$ext/; if ( not -e "./images/$lnk" ) { - $lnk =~ s/$ext/.jpg/; - if ( not -e "./images/$lnk" ) { - $lnk =~ s/.jpg/.gif/; - } + $lnk =~ s/$ext/.jpg/; + if ( not -e "./images/$lnk" ) { + $lnk =~ s/.jpg/.gif/; + } } $lnk = qq(\n @@ -380,6 +380,23 @@ while ( my @row = $st->fetchrow_array() ) { } $log =~ s/</$lnk/o; } + elsif ( $log =~ /<', $idx ) - 7; + my $lst = substr( $log, $idx + 7, $len - $idx ); + my $sub = ""; + my @arr = split(/\n/, $lst); + foreach my $ln (@arr) { + $ln =~ s/^\s*//g; + $sub .= "
  • $ln
  • " if length($ln)>0; + } + + $log = "
      $sub
    "; + #$log =~ s/</$lst/o; + # print $lst; + + } + #Replace with a full link an HTTP URI my @chnks = split( /($re_a_tag)/si, $log ); @@ -409,7 +426,7 @@ while ( my @row = $st->fetchrow_array() ) { my $sub = "

    " . substr( $log, $idx + 8, $len - $idx ) . "

    "; $log =~ s/</$sub/o; } - + #Decode escaped \\n $log =~ s/\r\n/
    /gs; $log =~ s/\n/
    /gs; @@ -507,13 +524,20 @@ $tbl .= '; +my $COLLAPSED_LOG = 's'; +my ($sp1,$sp2); +$sp1 = ''; +$sp2 = qq(); + my $frm = qq(
    - + $sp1 + $sp2 + + - + - + @@ -540,7 +564,7 @@ $cats - +
    * LOG ENTRY FORM * -
    Date:
    Log:
    Log:
     Ammount:
     Ammount:
    @@ -555,28 +579,32 @@ $cats my $srh = qq( - + ); $srh .= -qq( - - +qq( + + + - + ); if ( $rs_keys || $rs_cat_idx || $stmD ) { - $srh .= ''; + $srh .= ' + '; } $srh .= '
    Search/View By
    Search/View By + $sp1 + $sp2 + +
    View by Category:$cats_v - -
    View by Date:
    View by Category:$cats_v +
    View by Date: From:  To: 
    Keywords:
    Keywords:
    -

    '; diff --git a/htdocs/cgi-bin/wsrc/main.js b/htdocs/cgi-bin/wsrc/main.js index df2d9a9..055d922 100644 --- a/htdocs/cgi-bin/wsrc/main.js +++ b/htdocs/cgi-bin/wsrc/main.js @@ -116,6 +116,11 @@ function hideLog() { return false; } +function hideSrch() { + $("#div_srh").hide(); + return false; +} + function encodeText(el) { var el = $("#frm_entry"); var txt = el.log.value; @@ -229,7 +234,7 @@ function edit(row) { } document.getElementById("ed").value = ed_v.value + " " + et_v.innerText; document.getElementById("am").value = ea_v.innerText; - //Change selected catergory + //Change selected category for (var i = 0, j = ec.options.length; i < j; ++i) { if (ec.options[i].innerHTML === ec_v) { ec.selectedIndex = i; @@ -312,9 +317,10 @@ function toggleSearch() { } function resetView() { - - var f = document.getElementById("frm_srch"); + var f = $("#frm_srch"); f.keywords.value = ""; + $("#idx_cat").value(0); + $('#vc>option[value="0"]').prop('selected', true); } function updateSelCategory(sel) { @@ -331,6 +337,28 @@ function toggleVisibility(target, ensureOff) { $(target).hide(); } } +var _collpsd_toggle = false; +var _collpsd_toggle2 = false; + +function toggleLog() { + if (!_collpsd_toggle) { + $("#div_log .collpsd").hide(); + _collpsd_toggle = true; + } else { + $("#div_log .collpsd").show(); + _collpsd_toggle = false; + } +} + +function toggleSrch() { + if (!_collpsd_toggle2) { + $("#div_srh .collpsd").hide(); + _collpsd_toggle2 = true; + } else { + $("#div_srh .collpsd").show(); + _collpsd_toggle2 = false; + } +} function showCat() { $('#cat_desc').show();