SQLITE_NOTICE(283): recovered 2 frames from WAL file /home/hwaci/fossil/fossil.fossil-wal

Fossil: Check-in [7a95a0f1]

Fossil

Check-in [7a95a0f1]
Login

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

Overview
Comment:Internal commentary on the validity of the global UI enable/disable approach to XHR handling.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fileedit-ajaxify
Files: files | file ages | folders
SHA3-256: 7a95a0f178fdc1c49bd499b716849360f687334b706092ec9936bca3f8290750
User & Date: stephan 2020-05-18 06:05:58
Context
2020-05-21
06:32
Added a doc section about CSRF/HTTP Referrer. Other minor doc/message cleanups. check-in: 6de7e480 user: stephan tags: fileedit-ajaxify
2020-05-18
06:05
Internal commentary on the validity of the global UI enable/disable approach to XHR handling. check-in: 7a95a0f1 user: stephan tags: fileedit-ajaxify
05:19
Added optional fossil.fetch() beforesend/aftersend callbacks to allow us to... /efilepage now disables all input elements while AJAX requests are in-flight and updates the page with a 'wait' cursor. check-in: 7e197260 user: stephan tags: fileedit-ajaxify
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/fossil.page.fileedit.js.
562
563
564
565
566
567
568
569






















570
571
572
573
574
575
576
  };

  /**
     Keep track of how many in-flight AJAX requests there are so we
     can disable input elements while any are pending. For
     simplicity's sake we simply disable ALL OF IT while any AJAX is
     pending, rather than disabling operation-specific UI elements,
     which would be a huge maintenance hassle..






















  */
  const ajaxState = {
    count: 0 /* in-flight F.fetch() requests */,
    toDisable: undefined /* elements to disable during ajax activity */
  };
  F.fetch.beforesend = function f(){
    if(!ajaxState.toDisable){







|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
  };

  /**
     Keep track of how many in-flight AJAX requests there are so we
     can disable input elements while any are pending. For
     simplicity's sake we simply disable ALL OF IT while any AJAX is
     pending, rather than disabling operation-specific UI elements,
     which would be a huge maintenance hassle.

     Noting, however, that this global on/off is not *quite*
     pedantically correct. Pedantically speaking. If an element is
     disabled before an XHR starts, this code "should" notice that and
     not include it in the to-re-enable list. That would be annoying
     to do, and becomes impossible to do properly once multiple XHRs
     are in transit and an element is disabled seprately between two
     of those in-transit requests (that would be an unlikely, but
     possible, corner case). As of this writing, the only elements
     which are ever normally programmatically toggled between
     enabled/disabled...

     1) Belong to the file selection list and remain disabled until
     the list of leaves and files are loaded. i.e. they would be
     disabled *anyway* during their own XHR requests.

     2) The stashWidget's SELECT list when no local edits are
     stashed. Curiously, the all-or-nothing re-enabling implemented
     here does not re-enable that particular selection list. That's
     because of timing, though: that widget is "manually" disabled
     when the list is empty, and that list is normally emptied in
     conjunction with an XHR request.
  */
  const ajaxState = {
    count: 0 /* in-flight F.fetch() requests */,
    toDisable: undefined /* elements to disable during ajax activity */
  };
  F.fetch.beforesend = function f(){
    if(!ajaxState.toDisable){