update to jquery mobile 1.4.4
|
@ -1,68 +1,6 @@
|
||||||
var UserProfilesPage = {
|
(function (document, window, $) {
|
||||||
onPageShow: function () {
|
|
||||||
|
|
||||||
UserProfilesPage.loadPageData();
|
function deleteUser(page, id, name) {
|
||||||
},
|
|
||||||
|
|
||||||
loadPageData: function () {
|
|
||||||
|
|
||||||
Dashboard.showLoadingMsg();
|
|
||||||
ApiClient.getUsers().done(UserProfilesPage.renderUsers);
|
|
||||||
},
|
|
||||||
|
|
||||||
renderUsers: function (users) {
|
|
||||||
|
|
||||||
var html = "";
|
|
||||||
|
|
||||||
html += '<li data-role="list-divider"><h3>' + Globalize.translate('Users') + '</h3></li>';
|
|
||||||
|
|
||||||
for (var i = 0, length = users.length; i < length; i++) {
|
|
||||||
|
|
||||||
var user = users[i];
|
|
||||||
|
|
||||||
html += "<li>";
|
|
||||||
|
|
||||||
html += "<a href='useredit.html?userId=" + user.Id + "'>";
|
|
||||||
|
|
||||||
if (user.PrimaryImageTag) {
|
|
||||||
|
|
||||||
var url = ApiClient.getUserImageUrl(user.Id, {
|
|
||||||
width: 80,
|
|
||||||
tag: user.PrimaryImageTag,
|
|
||||||
type: "Primary"
|
|
||||||
});
|
|
||||||
html += "<img src='" + url + "' />";
|
|
||||||
} else {
|
|
||||||
html += "<img src='css/images/userflyoutdefault.png' />";
|
|
||||||
}
|
|
||||||
|
|
||||||
html += "<h3>" + user.Name;
|
|
||||||
|
|
||||||
html += "</h3>";
|
|
||||||
|
|
||||||
html += "<p class='ui-li-aside'>";
|
|
||||||
if (user.HasConfiguredPassword) html += '<img src="css/images/userdata/password.png" alt="' + Globalize.translate('Password') + '" title="' + Globalize.translate('Password') + '" class="userProfileIcon" />';
|
|
||||||
if (user.Configuration.IsAdministrator) html += '<img src="css/images/userdata/administrator.png" alt="' + Globalize.translate('Administrator') + '" title="' + Globalize.translate('Administrator') + '" class="userProfileIcon" />';
|
|
||||||
|
|
||||||
html += "</p>";
|
|
||||||
|
|
||||||
html += "</a>";
|
|
||||||
|
|
||||||
|
|
||||||
html += "<a onclick='UserProfilesPage.deleteUser(this);' data-userid='" + user.Id + "' data-username='" + user.Name + "' href='#'>" + Globalize.translate('Delete') + "</a>";
|
|
||||||
|
|
||||||
html += "</li>";
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#ulUserProfiles', $('#userProfilesPage')).html(html).listview('refresh');
|
|
||||||
|
|
||||||
Dashboard.hideLoadingMsg();
|
|
||||||
},
|
|
||||||
|
|
||||||
deleteUser: function (link) {
|
|
||||||
|
|
||||||
var page = $.mobile.activePage;
|
|
||||||
var name = link.getAttribute('data-username');
|
|
||||||
|
|
||||||
var msg = Globalize.translate('DeleteUserConfirmation').replace('{0}', name);
|
var msg = Globalize.translate('DeleteUserConfirmation').replace('{0}', name);
|
||||||
|
|
||||||
|
@ -71,15 +9,137 @@
|
||||||
if (result) {
|
if (result) {
|
||||||
Dashboard.showLoadingMsg();
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
var id = link.getAttribute('data-userid');
|
|
||||||
|
|
||||||
ApiClient.deleteUser(id).done(function () {
|
ApiClient.deleteUser(id).done(function () {
|
||||||
|
|
||||||
UserProfilesPage.loadPageData();
|
loadUsers(page);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
$(document).on('pageshow', "#userProfilesPage", UserProfilesPage.onPageShow);
|
function getUserHtml(user) {
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
html += "<div class='card homePageSquareCard alternateHover bottomPaddedCard'>";
|
||||||
|
|
||||||
|
html += '<div class="cardBox visualCardBox">';
|
||||||
|
html += '<div class="cardScalable">';
|
||||||
|
|
||||||
|
html += '<div class="cardPadder"></div>';
|
||||||
|
|
||||||
|
var href = "useredit.html?userId=" + user.Id + "";
|
||||||
|
html += '<a class="cardContent" href="' + href + '">';
|
||||||
|
|
||||||
|
var imgUrl;
|
||||||
|
|
||||||
|
if (user.PrimaryImageTag) {
|
||||||
|
|
||||||
|
imgUrl = ApiClient.getUserImageUrl(user.Id, {
|
||||||
|
width: 200,
|
||||||
|
tag: user.PrimaryImageTag,
|
||||||
|
type: "Primary"
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
imgUrl = 'css/images/userflyoutdefault.png';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<div class="cardImage" style="background-image:url(\'' + imgUrl + '\');">';
|
||||||
|
|
||||||
|
//if (plugin.isPremium) {
|
||||||
|
// if (plugin.price > 0) {
|
||||||
|
// html += "<div class='premiumBanner'><img src='css/images/supporter/premiumflag.png' /></div>";
|
||||||
|
// } else {
|
||||||
|
// html += "<div class='premiumBanner'><img src='css/images/supporter/supporterflag.png' /></div>";
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
html += "</div>";
|
||||||
|
|
||||||
|
// cardContent
|
||||||
|
html += "</a>";
|
||||||
|
|
||||||
|
// cardScalable
|
||||||
|
html += "</div>";
|
||||||
|
|
||||||
|
html += '<div class="cardFooter">';
|
||||||
|
|
||||||
|
html += '<div class="cardText" style="text-align:right; float:right;">';
|
||||||
|
|
||||||
|
html += '<button type="button" data-inline="true" data-iconpos="notext" data-icon="ellipsis-v" style="margin: 2px 0 0;"></button>';
|
||||||
|
html += "</div>";
|
||||||
|
|
||||||
|
html += '<div class="cardText" style="margin-right: 30px; padding: 11px 0 10px;">';
|
||||||
|
html += user.Name;
|
||||||
|
html += "</div>";
|
||||||
|
|
||||||
|
// cardFooter
|
||||||
|
html += "</div>";
|
||||||
|
|
||||||
|
// cardBox
|
||||||
|
html += "</div>";
|
||||||
|
|
||||||
|
// card
|
||||||
|
html += "</div>";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//html += "<li>";
|
||||||
|
|
||||||
|
//html += "<a href='useredit.html?userId=" + user.Id + "'>";
|
||||||
|
|
||||||
|
//if (user.PrimaryImageTag) {
|
||||||
|
|
||||||
|
// var url = ApiClient.getUserImageUrl(user.Id, {
|
||||||
|
// width: 80,
|
||||||
|
// tag: user.PrimaryImageTag,
|
||||||
|
// type: "Primary"
|
||||||
|
// });
|
||||||
|
// html += "<img src='" + url + "' />";
|
||||||
|
//} else {
|
||||||
|
// html += "<img src='css/images/userflyoutdefault.png' />";
|
||||||
|
//}
|
||||||
|
|
||||||
|
//html += "<h3>" + user.Name;
|
||||||
|
|
||||||
|
//html += "</h3>";
|
||||||
|
|
||||||
|
//html += "<p class='ui-li-aside'>";
|
||||||
|
//if (user.HasConfiguredPassword) html += '<img src="css/images/userdata/password.png" alt="' + Globalize.translate('Password') + '" title="' + Globalize.translate('Password') + '" class="userProfileIcon" />';
|
||||||
|
//if (user.Configuration.IsAdministrator) html += '<img src="css/images/userdata/administrator.png" alt="' + Globalize.translate('Administrator') + '" title="' + Globalize.translate('Administrator') + '" class="userProfileIcon" />';
|
||||||
|
|
||||||
|
//html += "</p>";
|
||||||
|
|
||||||
|
//html += "</a>";
|
||||||
|
|
||||||
|
|
||||||
|
//html += "<a onclick='UserProfilesPage.deleteUser(this);' data-userid='" + user.Id + "' data-username='" + user.Name + "' href='#'>" + Globalize.translate('Delete') + "</a>";
|
||||||
|
|
||||||
|
//html += "</li>";
|
||||||
|
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadUsers(page) {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
ApiClient.getUsers().done(function (users) {
|
||||||
|
|
||||||
|
var html = users.map(getUserHtml).join('');
|
||||||
|
|
||||||
|
$('.users', page).html(html).trigger('create');
|
||||||
|
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).on('pagebeforeshow', "#userProfilesPage", function () {
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
loadUsers(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
})(document, window, jQuery);
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 219 B |
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 149 B |
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 149 B |
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 163 B |
Before Width: | Height: | Size: 169 B After Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 163 B |
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 314 B After Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 132 B After Width: | Height: | Size: 132 B |
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 135 B |
Before Width: | Height: | Size: 147 B After Width: | Height: | Size: 147 B |
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 146 B After Width: | Height: | Size: 146 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 143 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 174 B After Width: | Height: | Size: 174 B |
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 177 B |
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 194 B |
Before Width: | Height: | Size: 196 B After Width: | Height: | Size: 196 B |
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 169 B After Width: | Height: | Size: 169 B |
Before Width: | Height: | Size: 172 B After Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 310 B |
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 316 B |
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 171 B After Width: | Height: | Size: 171 B |
Before Width: | Height: | Size: 185 B After Width: | Height: | Size: 185 B |
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 163 B |
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
Before Width: | Height: | Size: 249 B After Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 299 B |
Before Width: | Height: | Size: 308 B After Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 233 B After Width: | Height: | Size: 233 B |
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 302 B After Width: | Height: | Size: 302 B |
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 160 B |
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 246 B |
Before Width: | Height: | Size: 150 B After Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 250 B |
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 116 B After Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 116 B After Width: | Height: | Size: 116 B |
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 270 B After Width: | Height: | Size: 270 B |
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 123 B After Width: | Height: | Size: 123 B |
Before Width: | Height: | Size: 124 B After Width: | Height: | Size: 124 B |
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
Before Width: | Height: | Size: 302 B After Width: | Height: | Size: 302 B |
Before Width: | Height: | Size: 243 B After Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 295 B |
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 321 B After Width: | Height: | Size: 321 B |
Before Width: | Height: | Size: 174 B After Width: | Height: | Size: 174 B |
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 231 B |
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |