Checklist

Check-in [9919c0d6f8]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix two minor issues: (1) Clear the prior content from the edit dialog when it pops up in case the AJAX request for content returns nothing. (2) Trim whitespace from both ends of comments before storing in the database.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9919c0d6f8edd1acd5880627463d98379cd128a0
User & Date: drh 2018-06-01 02:59:32
Context
2018-08-23
15:21
Include the meta-viewport element in the header for all pages. check-in: 296b042b26 user: drh tags: trunk
2018-06-01
02:59
Fix two minor issues: (1) Clear the prior content from the edit dialog when it pops up in case the AJAX request for content returns nothing. (2) Trim whitespace from both ends of comments before storing in the database. check-in: 9919c0d6f8 user: drh tags: trunk
2018-03-28
20:25
On the /env page, show the SQLite version. check-in: 0846561118 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to checklist.tcl.

395
396
397
398
399
400
401




402
403
404
405
406
407
408
...
455
456
457
458
459
460
461

462
463
464
465
466
467
468
...
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
        }
        if( editItem && editItem.id==name ){
          document.getElementById("editStatus").value = x.status;
          document.getElementById("editCom").value = x.comment;
        }
      }
    }




    cklistAjax('jstat',null,cklistApplyJstat);
    var userNode = document.getElementById("cklistUser");
    var userInfo = JSON.parse(userNode.textContent||userNode.innerText);
    if(userInfo.canWrite){
      var allItem = document.getElementsByClassName("ckitem");
      for(var i=0; i<allItem.length; i++){
        allItem[i].style.cursor = "pointer";
................................................................................
        editItem = null;
        return;
      }
      editBox.style.display = "block";
      editItem = e;
      historyOff(e.id.substr(5))
      editItem.appendChild(editBox);

      cklistAjax("jstat?itemid="+e.id.substr(5),null,cklistApplyJstat);
      document.getElementById("cancelBtn").onclick = function(event){
        event.stopPropagation();
        editItem.removeChild(editBox);
        editItem = null;
      }
      document.getElementById("applyBtn").onclick = function(event){
................................................................................
  sqlite3 db $dbfile
  db eval BEGIN
  set update [wapp-param update]
  if {$update!=""} {
    checklist-verify-login
    if {[wapp-param CKLIST_WRITE 0] && [scan $update %x update]==1} {
      set status [wapp-param status]
      set comment [wapp-param comment]
      set owner [wapp-param CKLIST_USER]
      db eval {
         REPLACE INTO ckitem(itemid,mtime,status,owner,comment)
          VALUES($update,julianday('now'),$status,$owner,$comment);
         INSERT INTO history(itemid,mtime,status,owner,comment)
          VALUES($update,julianday('now'),$status,$owner,$comment);
      }







>
>
>
>







 







>







 







|







395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
...
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
...
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
        }
        if( editItem && editItem.id==name ){
          document.getElementById("editStatus").value = x.status;
          document.getElementById("editCom").value = x.comment;
        }
      }
    }
    function clearEditBox(){
      document.getElementById("editStatus").value = 'ok';
      document.getElementById("editCom").value = '';
    }
    cklistAjax('jstat',null,cklistApplyJstat);
    var userNode = document.getElementById("cklistUser");
    var userInfo = JSON.parse(userNode.textContent||userNode.innerText);
    if(userInfo.canWrite){
      var allItem = document.getElementsByClassName("ckitem");
      for(var i=0; i<allItem.length; i++){
        allItem[i].style.cursor = "pointer";
................................................................................
        editItem = null;
        return;
      }
      editBox.style.display = "block";
      editItem = e;
      historyOff(e.id.substr(5))
      editItem.appendChild(editBox);
      clearEditBox();
      cklistAjax("jstat?itemid="+e.id.substr(5),null,cklistApplyJstat);
      document.getElementById("cancelBtn").onclick = function(event){
        event.stopPropagation();
        editItem.removeChild(editBox);
        editItem = null;
      }
      document.getElementById("applyBtn").onclick = function(event){
................................................................................
  sqlite3 db $dbfile
  db eval BEGIN
  set update [wapp-param update]
  if {$update!=""} {
    checklist-verify-login
    if {[wapp-param CKLIST_WRITE 0] && [scan $update %x update]==1} {
      set status [wapp-param status]
      set comment [string trim [wapp-param comment]]
      set owner [wapp-param CKLIST_USER]
      db eval {
         REPLACE INTO ckitem(itemid,mtime,status,owner,comment)
          VALUES($update,julianday('now'),$status,$owner,$comment);
         INSERT INTO history(itemid,mtime,status,owner,comment)
          VALUES($update,julianday('now'),$status,$owner,$comment);
      }