Fossil

Check-in [503395796e]
Login

Check-in [503395796e]

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

Overview
Comment:/chat: 1) force the cursor on the input element to always be 'text' (I-beam), even when it doesn't have focus (browser inconsistency) and 2) when the chat window regains visibility after having lost it, give focus to the input element to try to work around a problem where Pale Moon is giving focus to one of the pseudo-buttons. Change (2) comes with a couple of minor but annoying quirks and might have to be undone, but it's worth a try.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 503395796e5f9772fc519b3b0399c848a5fd6d5a85128d0e04fbf0e7fd1b3a0d
User & Date: stephan 2021-10-07 16:27:52
Context
2021-10-07
16:45
/chat: removed some debug output. Reformulated part of the previous checkin to only re-grab input focus if the input field is not document.activeElement. ... (check-in: 85a99733d5 user: stephan tags: trunk)
16:27
/chat: 1) force the cursor on the input element to always be 'text' (I-beam), even when it doesn't have focus (browser inconsistency) and 2) when the chat window regains visibility after having lost it, give focus to the input element to try to work around a problem where Pale Moon is giving focus to one of the pseudo-buttons. Change (2) comes with a couple of minor but annoying quirks and might have to be undone, but it's worth a try. ... (check-in: 503395796e user: stephan tags: trunk)
13:01
Fixed a copy/paste error in www/sync.wiki per [forum:/forumpost/3fd51c58d0 | an anonymous forum post]. ... (check-in: 3f736de986 user: wyoung tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/fossil.page.chat.js.

778
779
780
781
782
783
784









785
786
787
788
789
790
791
        this.deleteMessageElem(id);
      }
    };
    document.addEventListener('visibilitychange', function(ev){
      cs.pageIsActive = ('visible' === document.visibilityState);
      if(cs.pageIsActive){
        cs.e.pageTitle.innerText = cs.pageTitleOrig;









      }
    }, true);
    cs.setCurrentView(cs.e.viewMessages);

    cs.e.activeUserList.addEventListener('click', function f(ev){
      /* Filter messages on a user clicked in activeUserList */
      ev.stopPropagation();







>
>
>
>
>
>
>
>
>







778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
        this.deleteMessageElem(id);
      }
    };
    document.addEventListener('visibilitychange', function(ev){
      cs.pageIsActive = ('visible' === document.visibilityState);
      if(cs.pageIsActive){
        cs.e.pageTitle.innerText = cs.pageTitleOrig;
        console.debug("Taking back input focus.");
        cs.inputFocus(
          /* An attempt to resolve usability problem reported by Joe
             M. where the Pale Moon browser is giving input focus to
             the Preview button. The down-side of this is that it will
             deselect any text which was previously selected on this
             page. This also, unfortunately, places the focus at the
             start of the element, rather than the last cursor position
             (like a textarea would). */);
      }
    }, true);
    cs.setCurrentView(cs.e.viewMessages);

    cs.e.activeUserList.addEventListener('click', function f(ev){
      /* Filter messages on a user clicked in activeUserList */
      ev.stopPropagation();

Changes to src/style.chat.css.

189
190
191
192
193
194
195



196
197
198
199
200
201
202
  flex: 10 1 auto;
  background-color: rgba(156,156,156,0.3);
  overflow: auto;
  resize: vertical;
  white-space: pre-wrap;
  /* ^^^ Firefox, when pasting plain text into a contenteditable field,
     loses all newlines unless we explicitly set this. Chrome does not. */



}
#chat-input-field:empty::before {
  content: attr(data-placeholder);
  opacity: 0.6;
}
#chat-input-field:not(:focus){
  border-width: 1px;







>
>
>







189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
  flex: 10 1 auto;
  background-color: rgba(156,156,156,0.3);
  overflow: auto;
  resize: vertical;
  white-space: pre-wrap;
  /* ^^^ Firefox, when pasting plain text into a contenteditable field,
     loses all newlines unless we explicitly set this. Chrome does not. */
  cursor: text;
  /* ^^^ In some browsers the cursor may not change for a contenteditable
     element until it has focus, causing potential confusion. */
}
#chat-input-field:empty::before {
  content: attr(data-placeholder);
  opacity: 0.6;
}
#chat-input-field:not(:focus){
  border-width: 1px;