mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update translations
This commit is contained in:
parent
d65219f9f8
commit
dbf135beac
114 changed files with 3331 additions and 93 deletions
67
dashboard-ui/scripts/mysync.js
Normal file
67
dashboard-ui/scripts/mysync.js
Normal file
|
@ -0,0 +1,67 @@
|
|||
(function () {
|
||||
|
||||
function refreshSyncStatus(page) {
|
||||
|
||||
require(['localsync'], function () {
|
||||
|
||||
if (LocalSync.isSupported()) {
|
||||
|
||||
page.querySelector('.localSyncStatus').classList.remove('hide');
|
||||
|
||||
var status = LocalSync.getSyncStatus();
|
||||
|
||||
page.querySelector('.labelSyncStatus').innerHTML = Globalize.translate('LabelLocalSyncStatusValue', status);
|
||||
page.querySelector('.syncSpinner').active = status == "Active";
|
||||
|
||||
page.querySelector('.btnSyncNow').disabled = status == "Active";
|
||||
|
||||
} else {
|
||||
page.querySelector('.localSyncStatus').classList.add('hide');
|
||||
page.querySelector('.syncSpinner').active = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function syncNow(page) {
|
||||
|
||||
require(['localsync'], function () {
|
||||
|
||||
LocalSync.startSync();
|
||||
Dashboard.alert(Globalize.translate('MessageSyncStarted'));
|
||||
refreshSyncStatus(page);
|
||||
});
|
||||
}
|
||||
|
||||
var interval;
|
||||
|
||||
$(document).on('pageinitdepends', "#mySyncActivityPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('.btnSyncNow', page).on('click', function () {
|
||||
syncNow(page);
|
||||
});
|
||||
|
||||
}).on('pageshowready', "#mySyncActivityPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
refreshSyncStatus(page);
|
||||
|
||||
interval = setInterval(function () {
|
||||
refreshSyncStatus(page);
|
||||
}, 5000);
|
||||
|
||||
}).on('pagebeforehide', "#mySyncActivityPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
page.querySelector('.syncSpinner').active = false;
|
||||
|
||||
if (interval) {
|
||||
clearInterval(interval);
|
||||
interval = null;
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue