@@ -285,6 +285,13 @@ function textPromptInputHandle(elem) {
285
285
textPromptDoCount ( elem ) ;
286
286
}
287
287
288
+ function internalSiteJsGetUserSetting ( name , defaultValue ) {
289
+ if ( typeof getUserSetting == 'function' ) {
290
+ return getUserSetting ( name , defaultValue ) ;
291
+ }
292
+ return defaultValue ;
293
+ }
294
+
288
295
function textPromptAddKeydownHandler ( elem ) {
289
296
let shiftText = ( up ) => {
290
297
let selStart = elem . selectionStart ;
@@ -389,7 +396,7 @@ function textPromptAddKeydownHandler(elem) {
389
396
e . stopPropagation ( ) ;
390
397
return false ;
391
398
}
392
- if ( e . altKey && ( e . key == 'ArrowLeft' || e . key == 'ArrowRight' ) && getUserSetting ( 'ui.tagmovehotkeyenabled' , false ) ) {
399
+ if ( e . altKey && ( e . key == 'ArrowLeft' || e . key == 'ArrowRight' ) && internalSiteJsGetUserSetting ( 'ui.tagmovehotkeyenabled' , false ) ) {
393
400
moveCommaSeparatedElement ( e . key == 'ArrowLeft' ) ;
394
401
e . preventDefault ( ) ;
395
402
e . stopPropagation ( ) ;
@@ -667,7 +674,7 @@ function makeSecretInput(featureid, id, paramid, name, description, value, place
667
674
}
668
675
669
676
function dynamicSizeTextBox ( elem , min = 15 ) {
670
- let maxHeight = parseInt ( getUserSetting ( 'maxpromptlines' , '10' ) ) ;
677
+ let maxHeight = parseInt ( internalSiteJsGetUserSetting ( 'maxpromptlines' , '10' ) ) ;
671
678
elem . style . height = '0px' ;
672
679
let height = elem . scrollHeight ;
673
680
let fontSize = parseFloat ( window . getComputedStyle ( elem ) . fontSize ) ;
@@ -940,10 +947,10 @@ function specialDebug(message) {
940
947
}
941
948
942
949
function playCompletionAudio ( ) {
943
- let audioFile = getUserSetting ( 'audio.completionsound' ) ;
950
+ let audioFile = internalSiteJsGetUserSetting ( 'audio.completionsound' , null ) ;
944
951
if ( audioFile ) {
945
952
let audio = new Audio ( `/Audio/${ audioFile } ` ) ;
946
- audio . volume = parseFloat ( getUserSetting ( 'audio.volume' , '0.5' ) ) ;
953
+ audio . volume = parseFloat ( internalSiteJsGetUserSetting ( 'audio.volume' , '0.5' ) ) ;
947
954
audio . play ( ) ;
948
955
}
949
956
}
0 commit comments