fixes #762 - Marking unwatched doesn't update display
This commit is contained in:
parent
5bec78f61f
commit
41825781d2
49 changed files with 443 additions and 505 deletions
|
@ -1,23 +1,13 @@
|
|||
var LoginPage = {
|
||||
|
||||
onPageInit: function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$("#popupLogin", page).popup({
|
||||
afteropen: function (event, ui) {
|
||||
$('#pw').focus();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onPageShow: function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
var isLocalhost = window.location.toString().toLowerCase().indexOf('localhost') != -1;
|
||||
var location = window.location.toString().toLowerCase();
|
||||
var isLocalhost = location.indexOf('localhost') != -1 || location.indexOf('127.0.0.1') != -1;
|
||||
|
||||
if (isLocalhost) {
|
||||
$('.localhostMessage', page).show();
|
||||
|
@ -27,31 +17,38 @@
|
|||
|
||||
// Show all users on localhost
|
||||
var promise1 = !isLocalhost ? ApiClient.getPublicUsers() : ApiClient.getUsers({ IsDisabled: false });
|
||||
var promise2 = ApiClient.getServerConfiguration();
|
||||
|
||||
$.when(promise1, promise2).done(function (response1, response2) {
|
||||
promise1.done(function (users) {
|
||||
|
||||
var users = response1[0];
|
||||
var config = response2[0];
|
||||
|
||||
var showManualForm = config.RequireMobileManualLogin || !users.length;
|
||||
var showManualForm = !users.length || !isLocalhost;
|
||||
|
||||
if (showManualForm) {
|
||||
|
||||
$('.visualLoginForm', page).hide();
|
||||
$('#manualLoginForm', page).show();
|
||||
$('#txtManualName', page).focus();
|
||||
LoginPage.showManualForm(page);
|
||||
|
||||
} else {
|
||||
|
||||
$('.visualLoginForm', page).show();
|
||||
$('#manualLoginForm', page).hide();
|
||||
|
||||
LoginPage.showVisualForm(page);
|
||||
LoginPage.loadUserList(users);
|
||||
}
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
ApiClient.getJSON(ApiClient.getUrl('Branding/Configuration')).done(function (options) {
|
||||
|
||||
$('.disclaimer', page).html(options.LoginDisclaimer || '');
|
||||
});
|
||||
},
|
||||
|
||||
showManualForm: function (page) {
|
||||
$('.visualLoginForm', page).hide();
|
||||
$('#manualLoginForm', page).show();
|
||||
$('#txtManualName', page).focus();
|
||||
},
|
||||
|
||||
showVisualForm: function (page) {
|
||||
$('.visualLoginForm', page).show();
|
||||
$('#manualLoginForm', page).hide();
|
||||
},
|
||||
|
||||
getLastSeenText: function (lastActivityDate) {
|
||||
|
@ -126,21 +123,12 @@
|
|||
loadUserList: function (users) {
|
||||
var html = "";
|
||||
|
||||
var isLocalhost = window.location.toString().toLowerCase().indexOf('localhost') != -1;
|
||||
|
||||
for (var i = 0, length = users.length; i < length; i++) {
|
||||
var user = users[i];
|
||||
|
||||
var linkId = "lnkUser" + i;
|
||||
|
||||
if (isLocalhost) {
|
||||
html += "<a class='posterItem squarePosterItem' id='" + linkId + "' data-userid='" + user.Id + "' href='index.html?u=" + user.Id + "' data-ajax='false' \">";
|
||||
}
|
||||
else if (user.HasPassword) {
|
||||
html += "<a class='posterItem squarePosterItem' id='" + linkId + "' data-userid='" + user.Id + "' href='#popupLogin' data-rel='popup' onclick='LoginPage.authenticatingLinkId=this.id;' \">";
|
||||
} else {
|
||||
html += "<a class='posterItem squarePosterItem' id='" + linkId + "' data-userid='" + user.Id + "' href='#' onclick='LoginPage.authenticateUserLink(this);' \">";
|
||||
}
|
||||
html += "<a class='posterItem squarePosterItem' id='" + linkId + "' data-userid='" + user.Id + "' href='index.html?u=" + user.Id + "' data-ajax='false' \">";
|
||||
|
||||
if (user.PrimaryImageTag) {
|
||||
|
||||
|
@ -178,18 +166,6 @@
|
|||
|
||||
},
|
||||
|
||||
onSubmit: function () {
|
||||
|
||||
$('#popupLogin', '#loginPage').popup('close');
|
||||
|
||||
var link = $('#' + LoginPage.authenticatingLinkId)[0];
|
||||
|
||||
LoginPage.authenticateUser(link.getAttribute('data-userid'), $('#pw', '#loginPage').val());
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
},
|
||||
|
||||
onManualSubmit: function () {
|
||||
|
||||
LoginPage.authenticateUserByName($('#txtManualName', '#loginPage').val(), $('#txtManualPassword', '#loginPage').val());
|
||||
|
@ -199,4 +175,4 @@
|
|||
}
|
||||
};
|
||||
|
||||
$(document).on('pageshow', "#loginPage", LoginPage.onPageShow).on('pageinit', "#loginPage", LoginPage.onPageInit);
|
||||
$(document).on('pagebeforeshow', "#loginPage", LoginPage.onPageShow);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue