Test button for sounds and new Audio() code #630

This commit is contained in:
Daniël van Noord
2021-03-16 13:27:21 +01:00
parent b201e15c8e
commit d35217b6d5
12 changed files with 32 additions and 12 deletions

View File

@@ -20,6 +20,7 @@ import Config from '../../Data/SettingsData';
import ConfigDefault from '../../Data/SettingsDefault';
import RefreshScale from '../HelperFunctions/RefreshScale';
import UpdateColors from '../HelperFunctions/UpdateColors';
import PlaySound from '../Notifications/Sound';
import { Colors } from '../VariablesAndData';
/**
@@ -110,6 +111,18 @@ function CreatePrefOption(config) {
};
volume.appendChild(slider);
div.appendChild(volume);
const a = document.createElement('a');
a.className = 'option';
a.onclick = function () {
PlaySound(
CMOptions[config.replace('Volume', 'SoundURL')],
config.replace('Volume', 'Sound'),
config,
true,
);
};
a.textContent = 'Test sound';
div.appendChild(a);
return div;
}
if (Config[config].type === 'url') {