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-12-14 08:43:03 -07:00
|
|
|
|
Dashboard.getCurrentUser().then(function (user) {
|
2015-09-24 22:15:29 -07:00
|
|
|
|
|
|
|
|
|
page.querySelector('.headerUser').innerHTML = user.Name;
|
|
|
|
|
|
2015-12-14 08:43:03 -07:00
|
|
|
|
if (AppInfo.isNativeApp && browserInfo.safari && user.Policy.IsAdministrator) {
|
2016-01-21 13:40:28 -07:00
|
|
|
|
page.querySelector('.adminSection').classList.add('hide');
|
2015-09-24 22:15:29 -07:00
|
|
|
|
} else {
|
|
|
|
|
page.querySelector('.adminSection').classList.add('hide');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2015-12-14 08:43:03 -07:00
|
|
|
|
if (AppInfo.isNativeApp && browserInfo.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
|
|
|
|
});
|