jellyfin-web/dashboard-ui/scripts/mypreferencescommon.js

47 lines
1.6 KiB
JavaScript
Raw Normal View History

2015-09-24 22:15:29 -07:00
pageIdOn('pageinit', 'myPreferencesMenuPage', function () {
var page = this;
$('.btnLogout', page).on('click', function () {
Dashboard.logout();
});
});
pageIdOn('pageshow', 'myPreferencesMenuPage', function () {
2015-05-27 22:51:48 -07:00
var page = this;
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
$('.lnkDisplayPreferences', page).attr('href', 'mypreferencesdisplay.html?userId=' + userId);
$('.lnkLanguagePreferences', page).attr('href', 'mypreferenceslanguages.html?userId=' + userId);
2015-07-03 10:55:29 -07:00
$('.lnkHomeScreenPreferences', page).attr('href', 'mypreferenceshome.html?userId=' + userId);
2015-05-27 22:51:48 -07:00
$('.lnkMyProfile', page).attr('href', 'myprofile.html?userId=' + userId);
2015-07-29 19:35:11 -07:00
$('.lnkSync', page).attr('href', 'mysyncsettings.html?userId=' + userId);
2015-09-11 09:26:06 -07:00
if (Dashboard.capabilities().SupportsSync) {
2015-07-29 19:35:11 -07:00
page.querySelector('.lnkSync').classList.remove('hide');
} else {
page.querySelector('.lnkSync').classList.add('hide');
}
2015-09-24 10:08:10 -07:00
2015-09-24 22:15:29 -07:00
Dashboard.getCurrentUser().done(function (user) {
page.querySelector('.headerUser').innerHTML = user.Name;
if (AppInfo.isNativeApp && $.browser.safari && user.Policy.IsAdministrator) {
page.querySelector('.adminSection').classList.remove('hide');
} else {
page.querySelector('.adminSection').classList.add('hide');
}
});
2015-09-24 10:08:10 -07:00
if (AppInfo.isNativeApp && $.browser.safari) {
2015-09-24 22:15:29 -07:00
page.querySelector('.userSection').classList.remove('hide');
2015-09-24 10:08:10 -07:00
} else {
2015-09-24 22:15:29 -07:00
page.querySelector('.userSection').classList.add('hide');
2015-09-24 10:08:10 -07:00
}
2015-09-24 22:15:29 -07:00
2015-05-27 22:51:48 -07:00
});