1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
|
const v = Chat.settings.toggle('images-inline');
F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+".");
}
}];
/** Set up selection list of notification sounds. */
if(1){
settingsOps.push({
label: "Audible alerts",
boolValue: ()=>Chat.settings.getBool('audible-alert'),
callback: function(){
const v = Chat.settings.toggle('audible-alert');
Chat.setNewMessageSound(v ? F.config.chat.alertSound : false);
if(v) setTimeout(()=>Chat.playNewMessageSound(), 50);
F.toast.message("Audio notifications "+(v ? "enabled" : "disabled")+".");
}
});
Chat.setNewMessageSound(
Chat.settings.getBool('audible-alert') ? F.config.chat.alertSound : false
);
}/*audio notification config*/
/**
Build list of options...
*/
settingsOps.forEach(function f(op){
const line = D.addClass(D.div(), 'menu-entry');
const btn = D.append(
|
>
>
|
|
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
|
|
|
<
|
>
|
<
|
<
<
|
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
|
const v = Chat.settings.toggle('images-inline');
F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+".");
}
}];
/** Set up selection list of notification sounds. */
if(1){
settingsOps.selectSound = D.addClass(D.div(), 'menu-entry');
const selectSound = D.select();
D.append(settingsOps.selectSound,
D.append(D.span(),"Audio alert"),
selectSound);
D.option(selectSound, "", "(no audio)");
const firstSoundIndex = selectSound.options.length;
F.config.chat.alerts.forEach(function(a){
D.option(selectSound, a);
});
if(true===Chat.settings.getBool('audible-alert')){
selectSound.selectedIndex = firstSoundIndex;
}else{
selectSound.value = Chat.settings.get('audible-alert','');
if(selectSound.selectedIndex<0){
/*Missing file - removed after this setting was applied. Fall back
to the first sound in the list. */
selectSound.selectedIndex = firstSoundIndex;
}
}
selectSound.addEventListener('change',function(){
const v = this.value;
Chat.setNewMessageSound(v);
F.toast.message("Audio notifications "+(v ? "enabled" : "disabled")+".");
if(v) setTimeout(()=>Chat.playNewMessageSound(), 0);
}, false);
Chat.setNewMessageSound(selectSound.value);
}/*audio notification config*/
/**
Build list of options...
*/
settingsOps.forEach(function f(op){
const line = D.addClass(D.div(), 'menu-entry');
const btn = D.append(
|