|
|
|
@ -32,7 +32,7 @@ function validateAndSave() {
|
|
|
|
|
console.log('Failed to save settings - form validation was not successful.')
|
|
|
|
|
saveButton.classList.replace('btn-primary', 'btn-danger');
|
|
|
|
|
saveButton.classList.replace('btn-success', 'btn-danger');
|
|
|
|
|
saveButton.textContent = getMessage('settingsSaveButtonCaptionFailure');
|
|
|
|
|
saveButton.textContent = chrome.i18n.getMessage('settingsSaveButtonCaptionFailure');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -46,7 +46,7 @@ function save() {
|
|
|
|
|
// Update form controls to let user know options were saved.
|
|
|
|
|
saveButton.classList.replace('btn-primary', 'btn-success');
|
|
|
|
|
saveButton.classList.replace('btn-danger', 'btn-success');
|
|
|
|
|
saveButton.textContent = getMessage('settingsSaveButtonCaptionSuccess');
|
|
|
|
|
saveButton.textContent = chrome.i18n.getMessage('settingsSaveButtonCaptionSuccess');
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
console.error('Unsupported browser or no access to localStorage')
|
|
|
|
@ -58,8 +58,8 @@ function save() {
|
|
|
|
|
function load(){
|
|
|
|
|
if (chrome && chrome.storage && chrome.storage.local) {
|
|
|
|
|
chrome.storage.local.get({
|
|
|
|
|
baseURL: getMessage("settingsFormInputRequired"),
|
|
|
|
|
wssURL: getMessage("settingsFormInputRequired")
|
|
|
|
|
baseURL: chrome.i18n.getMessage("settingsFormInputRequired"),
|
|
|
|
|
wssURL: chrome.i18n.getMessage("settingsFormInputRequired")
|
|
|
|
|
}, function (items) {
|
|
|
|
|
stammTVBaseUrl.value = items.baseURL;
|
|
|
|
|
stammTVWSSUrl.value = items.wssURL;
|
|
|
|
@ -70,7 +70,6 @@ function load(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function autofillWSSURL() {
|
|
|
|
|
console.log('here am i');
|
|
|
|
|
if (stammTVBaseUrl.value.startsWith('http')) {
|
|
|
|
|
let predictedWSSURL = stammTVBaseUrl.value.replace('https', 'wss').replace('http', 'wss');
|
|
|
|
|
if (predictedWSSURL.endsWith('/')) {
|
|
|
|
|