Diff
Not logged in

Differences From Artifact [9dce420810]:

To Artifact [14f579f4c8]:


379
380
381
382
383
384
385
386


387
388
389
390
391
392
393
379
380
381
382
383
384
385

386
387
388
389
390
391
392
393
394







-
+
+







          "images-inline": !!F.config.chat.imagesInline,
          "edit-ctrl-send": false,
          "edit-compact-mode": true,
          "monospace-messages": true,
          "chat-only-mode": false,
          "audible-alert": true,
          "active-user-list": false,
          "active-user-list-timestamps": false
          "active-user-list-timestamps": false,
          "hide-attachment-widget": false
        }
      },
      /** Plays a new-message notification sound IF the audible-alert
          setting is true, else this is a no-op. Returns this.
      */
      playNewMessageSound: function f(){
        if(f.uri){
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337


1338
1339
1340
1341
1342
1343
1344
1345
1329
1330
1331
1332
1333
1334
1335



1336
1337

1338
1339
1340
1341
1342
1343
1344







-
-
-
+
+
-







      optAu.theLegend.addEventListener('click',function(){
        D.toggleClass(Chat.e.activeUserListWrapper, 'collapsed');
        if(!Chat.e.activeUserListWrapper.classList.contains('collapsed')){
          Chat.animate(optAu.theList,'anim-flip-v');
        }
      }, false);
    }/*namedOptions.activeUsers additional setup*/
    /* Settings menu entries... Remember that they will be rendered in
       reverse order and the most frequently-needed ones "should"
       (arguably) be closer to the start of this list so that they
    /* Settings menu entries... the most frequently-needed ones "should"
       (arguably) be closer to the start of this list. */
       will be rendered within easier reach of the settings button. */
    /**
       Settings ops structure:

       label: string for the UI

       boolValue: string (name of Chat.settings setting) or a
       function which returns true or false.
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404














1405
1406
1407
1408
1409
1410
1411
1376
1377
1378
1379
1380
1381
1382









1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415







-
-
-
-
-
-
-
-
-












+
+
+
+
+
+
+
+
+
+
+
+
+
+







      boolValue: ()=>!document.body.classList.contains('my-messages-right'),
      callback: function f(){
        document.body.classList[
          this.checkbox.checked ? 'remove' : 'add'
        ]('my-messages-right');
      }
    },{
      label: "Show images inline",
      hint: "Whether to show images inline or as a hyperlink.",
      boolValue: 'images-inline'
    },{
      label: "Timestamps in active users list",
      hint: "Whether to show last-message timestamps.",
      boolValue: 'active-user-list-timestamps'
    },
    namedOptions.activeUsers,{
      label: "Monospace message font",
      hint: "Use monospace font for message text?",
      boolValue: 'monospace-messages',
      callback: function(setting){
        document.body.classList[
          setting.value ? 'add' : 'remove'
        ]('monospace-messages');
      }
    },{
      label: "Chat-only mode",
      hint: "Toggle the page between normal fossil view and chat-only view.",
      boolValue: 'chat-only-mode'
    },{
      label: "Show images inline",
      hint: "Whether to show images inline or as a hyperlink.",
      boolValue: 'images-inline'
    },{
      label: "Timestamps in active users list",
      hint: "Whether to show last-message timestamps.",
      boolValue: 'active-user-list-timestamps'
    },
    namedOptions.activeUsers,{
      label: "Hide file attachment widget",
      boolValue: "hide-attachment-widget",
      hint: "Hides the file attachment widget, gaining more "+
        "screen space for messages."
    }];

    /** Set up selection list of notification sounds. */
    if(1){
      const selectSound = D.select();
      D.option(selectSound, "", "(no audio)");
      const firstSoundIndex = selectSound.options.length;
1524
1525
1526
1527
1528
1529
1530





1531
1532
1533
1534
1535
1536
1537
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546







+
+
+
+
+







      Chat.chatOnlyMode(s.value);
    });
    Chat.settings.addListener('edit-compact-mode',function(s){
      Chat.e.inputLine.classList[
        s.value ? 'add' : 'remove'
      ]('compact');
    });
    Chat.settings.addListener('hide-attachment-widget',function(s){
      Chat.e.fileSelectWrapper.classList[
        s.value ? 'add' : 'remove'
      ]('hidden');
    });    
    Chat.settings.addListener('edit-ctrl-send',function(s){
      const label = (s.value ? "Ctrl-" : "")+"Enter submits messages.";
      const eInput = Chat.inputElement();
      eInput.dataset.placeholder = eInput.dataset.placeholder0 + " " +label;
      Chat.e.btnSubmit.title = label;
      F.toast.message(label);
    });