Skip to content

Commit

Permalink
Upd: some enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorporation committed Aug 10, 2023
1 parent ee95c7e commit 66abf1a
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 22 deletions.
24 changes: 12 additions & 12 deletions docs/references/translating_status.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
- es-AR: 111 missing phrases
- es-ES: 762 missing phrases
- es-VE: 766 missing phrases
- fi-FI: 763 missing phrases
- fr-FR: 111 missing phrases
- it-IT: 111 missing phrases
- ja-JP: 113 missing phrases
- ko-KR: 111 missing phrases
- nl-NL: 111 missing phrases
- pl-PL: 941 missing phrases
- ru-RU: 209 missing phrases
- zh-Hans: 111 missing phrases
- es-AR: 114 missing phrases
- es-ES: 765 missing phrases
- es-VE: 769 missing phrases
- fi-FI: 766 missing phrases
- fr-FR: 114 missing phrases
- it-IT: 114 missing phrases
- ja-JP: 116 missing phrases
- ko-KR: 114 missing phrases
- nl-NL: 114 missing phrases
- pl-PL: 944 missing phrases
- ru-RU: 212 missing phrases
- zh-Hans: 114 missing phrases
4 changes: 2 additions & 2 deletions htdocs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1585,7 +1585,7 @@ <h4 data-phrase="Cloud"></h4>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" data-phrase="Cancel"></button>
<div>
<button id="modalSettingsApplyBtn" type="button" class="btn btn-success me-2 protected" data-href='{"cmd": "saveSettings", "options": [false]}' data-phrase="Apply"></button>
<button type="button" class="btn btn-success protected" data-href='{"cmd": "saveSettings", "options": [true]}' data-phrase="Save"></button>
<button id="modalSettingsSaveBtn"type="button" class="btn btn-success protected" data-href='{"cmd": "saveSettings", "options": [true]}' data-phrase="Save"></button>
</div>
</div>
</div>
Expand Down Expand Up @@ -1753,7 +1753,7 @@ <h5 class="modal-title"><span class="mi title-icon">settings_ethernet</span> <sp
</div>
<div class="modal-footer justify-content-between">
<button type="button" class="btn btn-secondary alwaysEnabled" data-bs-dismiss="modal" data-phrase="Cancel"></button>
<button type="button" class="btn btn-success alwaysEnabled protected" data-href='{"cmd": "saveConnection", "options": []}' data-phrase="Save"></button>
<button id="modalConnectionApplyBtn" type="button" class="btn btn-success alwaysEnabled protected" data-href='{"cmd": "saveConnection", "options": []}' data-phrase="Save"></button>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion htdocs/js/globales.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,8 @@ const settingsWebuiFields = {
"validate": {
"cmd": "validateUintEl",
"options": []
}
},
"unit": "Pixel"
},
"bgColor": {
"defaultValue": "#060708",
Expand Down
2 changes: 2 additions & 0 deletions htdocs/js/modalConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ function saveConnection() {

settingsParams.mpdBinarylimit = settingsParams.mpdBinarylimit * 1024;
settingsParams.mpdTimeout = settingsParams.mpdTimeout * 1000;
btnWaitingId('modalConnectionApplyBtn', true);
sendAPIpartition('default', 'MYMPD_API_CONNECTION_SAVE', settingsParams, saveConnectionClose, true);
}
}
Expand All @@ -113,6 +114,7 @@ function saveConnection() {
* @returns {void}
*/
function saveConnectionClose(obj) {
btnWaitingId('modalConnectionApplyBtn', false);
if (obj.error) {
if (highlightInvalidInput('modalConnection', obj) === false) {
showModalAlert(obj);
Expand Down
7 changes: 6 additions & 1 deletion htdocs/js/modalSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,11 @@ function saveSettings(closeModal) {
settingsParams.tagListBrowse = getTagMultiSelectValues(document.getElementById('modalSettingsBrowseTagsList'), false);

if (closeModal === true) {
btnWaitingId('modalSettingsSaveBtn', true);
sendAPIpartition('default', 'MYMPD_API_SETTINGS_SET', settingsParams, saveSettingsClose, true);
}
else {
btnWaitingId('modalSettingsApplyBtn', true);
sendAPIpartition('default', 'MYMPD_API_SETTINGS_SET', settingsParams, saveSettingsApply, true);
}
}
Expand All @@ -307,6 +309,7 @@ function saveSettingsClose(obj) {
if (highlightInvalidInput('modalSettings', obj) === false) {
showModalAlert(obj);
}
btnWaitingId('modalSettingsSaveBtn', false);
}
else {
savePartitionSettings(true);
Expand All @@ -323,6 +326,7 @@ function saveSettingsApply(obj) {
if (highlightInvalidInput('modalSettings', obj) === false) {
showModalAlert(obj);
}
btnWaitingId('modalSettingsApplyBtn', false);
}
else {
savePartitionSettings(false);
Expand Down Expand Up @@ -358,9 +362,9 @@ function savePartitionSettingsApply(obj) {
}
}
else {
btnWaitingId('modalSettingsApplyBtn', true);
getSettings();
}
btnWaitingId('modalSettingsApplyBtn', false);
}

/**
Expand All @@ -378,6 +382,7 @@ function savePartitionSettingsClose(obj) {
getSettings();
uiElements.modalSettings.hide();
}
btnWaitingId('modalSettingsSaveBtn', false);
}

/**
Expand Down
5 changes: 1 addition & 4 deletions htdocs/js/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ function zeroPad(num, places) {
* @returns {number} the number or 0 on convert failure
*/
function parseNumber(str) {
const nr = Number(str);
return Number.isNaN(nr) === true
? 0
: nr;
return Number(str);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion htdocs/js/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ function setIsInvalidId(id) {
*/
function setIsInvalid(el) {
//set is-invalid also on parent node
el.classList.add('is-invalid');
el.parentNode.classList.add('is-invalid');
el.parentNode.parentNode.classList.add('is-invalid');
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/i18n/extra_phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,6 @@ Warning
wasapi
Web notifications
Work
Invalid json value type: MJSON_TOK_NULL
Invalid json value type: MJSON_TOK_INVALID
Invalid json value type: MJSON_TOK_UNKNOWN
6 changes: 5 additions & 1 deletion src/i18n/json/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1064,5 +1064,9 @@
"Only sort tags allowed": "Es sind nur Sort-Tags erlaubt",
"Preset loaded successfully": "Voreinstellung erfolgreich geladen",
"Allowed binary limit range is between 4kB and 256kB": "Binary Limit muss zwischen 4kB und 256KB sein",
"DB": "DB"
"DB": "DB",
"Pixel": "Pixel",
"Invalid json value type: MJSON_TOK_NULL": "Ungültiger Wertetyp",
"Invalid json value type: MJSON_TOK_INVALID": "Ungültiger Wertetyp",
"Invalid json value type: MJSON_TOK_UNKNOWN": "Ungültiger Wertetyp"
}

0 comments on commit 66abf1a

Please sign in to comment.