Webserver: Small ClientBugfixes

This commit is contained in:
lukeIam committed 2013-12-13 17:43:22 +01:00
1 parent 6f9a3b0138
commit 2142807ffc
1 file changed
+24 -21
+24 -21
View File
@@ -21,14 +21,14 @@ function replaceTransitionHandler() {
var promise = $to.data('promise'); var promise = $to.data('promise');
if (promise) { if (promise) {
$to.removeData('promise'); $to.removeData('promise');
$('#content').wrap('<div class="overlay" />'); $('div[data-role="content"]').wrap('<div class="overlay" />');
$.mobile.loading('show', { $.mobile.loading('show', {
text: 'Loading data...', text: 'Loading data...',
textVisible: true textVisible: true
}); });
return promise.then(function () { return promise.then(function () {
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
return oldDefaultTransitionHandler(name, reverse, $to, $from); return oldDefaultTransitionHandler(name, reverse, $to, $from);
}); });
} }
@@ -56,7 +56,7 @@ function initPageLoadHandler() {
dataToUpload["Avatar"] = $('#playerAvatar').data("changed") ? { "base64Data": $('#playerAvatar').prop("src") } : null; dataToUpload["Avatar"] = $('#playerAvatar').data("changed") ? { "base64Data": $('#playerAvatar').prop("src") } : null;
dataToUpload["Password"] = $('#playerPassword').prop("value") != "**oldPassword**" ? $('#playerPassword').prop("value") : null; dataToUpload["Password"] = $('#playerPassword').prop("value") != "**oldPassword**" ? $('#playerPassword').prop("value") : null;
$('#content').wrap('<div class="overlay" />'); $('div[data-role="content"]').wrap('<div class="overlay" />');
$.mobile.loading('show', { $.mobile.loading('show', {
text: 'Uploading profile...', text: 'Uploading profile...',
textVisible: true textVisible: true
@@ -74,7 +74,7 @@ function initPageLoadHandler() {
} }
}).always(function () { }).always(function () {
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
}); });
}); });
@@ -106,7 +106,7 @@ function initPageLoadHandler() {
dataToUpload["Avatar"] = $('#playerAvatar').data("changed") ? { "base64Data": $('#playerAvatar').prop("src") } : null; dataToUpload["Avatar"] = $('#playerAvatar').data("changed") ? { "base64Data": $('#playerAvatar').prop("src") } : null;
dataToUpload["Password"] = $('#playerPassword').prop("value") != "**oldPassword**" ? $('#playerPassword').prop("value") : null; dataToUpload["Password"] = $('#playerPassword').prop("value") != "**oldPassword**" ? $('#playerPassword').prop("value") : null;
$('#content').wrap('<div class="overlay" />'); $('div[data-role="content"]').wrap('<div class="overlay" />');
$.mobile.loading('show', { $.mobile.loading('show', {
text: 'Creating profile...', text: 'Creating profile...',
textVisible: true textVisible: true
@@ -124,7 +124,7 @@ function initPageLoadHandler() {
} }
}).always(function () { }).always(function () {
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
}); });
}); });
@@ -332,7 +332,7 @@ function initPageLoadHandler() {
$('#roleAdministrator').prop("checked", ((result & 0x01) != 0)).checkboxradio("refresh"); $('#roleAdministrator').prop("checked", ((result & 0x01) != 0)).checkboxradio("refresh");
$('#btnRoleSave').unbind('click').click(function () { $('#btnRoleSave').unbind('click').click(function () {
$('#content').wrap('<div class="overlay" />'); $('div[data-role="content"]').wrap('<div class="overlay" />');
$.mobile.loading('show', { $.mobile.loading('show', {
text: 'Save...', text: 'Save...',
textVisible: true textVisible: true
@@ -347,7 +347,7 @@ function initPageLoadHandler() {
headers: { "session": sessionId } headers: { "session": sessionId }
}).done(function (result) { }).done(function (result) {
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
history.back(); history.back();
}); });
}); });
@@ -375,7 +375,7 @@ function pagebeforeshowLogin() {
$.mobile.changePage("#main", { transition: "slidefade" }); $.mobile.changePage("#main", { transition: "slidefade" });
} }
else { else {
$('#content').wrap('<div class="overlay" />'); $('div[data-role="content"]').wrap('<div class="overlay" />');
$.mobile.loading('show', { $.mobile.loading('show', {
text: 'Login...', text: 'Login...',
textVisible: true textVisible: true
@@ -388,11 +388,11 @@ function pagebeforeshowLogin() {
ownProfileId = result; ownProfileId = result;
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
$.mobile.changePage("#main", { transition: "slidefade" }); $.mobile.changePage("#main", { transition: "slidefade" });
}).fail(function (result) { }).fail(function (result) {
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
}); });
} }
} }
@@ -409,7 +409,7 @@ function initLoginPageHandler() {
$('#loginPassword').keypress(keyPressed); $('#loginPassword').keypress(keyPressed);
$('#loginButton').click(function () { $('#loginButton').click(function () {
$('#content').wrap('<div class="overlay" />'); $('div[data-role="content"]').wrap('<div class="overlay" />');
$.mobile.loading('show', { $.mobile.loading('show', {
text: 'Login...', text: 'Login...',
textVisible: true textVisible: true
@@ -432,16 +432,16 @@ function initLoginPageHandler() {
ownProfileId = result; ownProfileId = result;
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
$.mobile.changePage("#main", { transition: "slidefade" }); $.mobile.changePage("#main", { transition: "slidefade" });
}).fail(function (result) { }).fail(function (result) {
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
}); });
}).fail(function (result) { }).fail(function (result) {
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
}); });
}); });
@@ -462,7 +462,7 @@ function initMainPageHandler() {
}); });
$('#currentSongLink').click(function () { $('#currentSongLink').click(function () {
$('#content').wrap('<div class="overlay" />'); $('div[data-role="content"]').wrap('<div class="overlay" />');
$.mobile.loading('show', { $.mobile.loading('show', {
text: 'Getting current song...', text: 'Getting current song...',
textVisible: true textVisible: true
@@ -474,11 +474,11 @@ function initMainPageHandler() {
}).done(function (result) { }).done(function (result) {
songIdRequest = parseInt(result); songIdRequest = parseInt(result);
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
$.mobile.changePage("#displaySong", { transition: "slidefade" }); $.mobile.changePage("#displaySong", { transition: "slidefade" });
}).fail(function (result) { }).fail(function (result) {
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
}); });
}); });
@@ -491,7 +491,7 @@ function initMainPageHandler() {
$('#capture').change(function (eventData) { $('#capture').change(function (eventData) {
if (eventData && eventData.target && eventData.target.files && eventData.target.files.length == 1) { if (eventData && eventData.target && eventData.target.files && eventData.target.files.length == 1) {
$('#content').wrap('<div class="overlay" />'); $('div[data-role="content"]').wrap('<div class="overlay" />');
$.mobile.loading('show', { $.mobile.loading('show', {
text: 'Uploading photo...', text: 'Uploading photo...',
textVisible: true textVisible: true
@@ -513,7 +513,7 @@ function initMainPageHandler() {
} }
}).always(function () { }).always(function () {
$.mobile.loading('hide'); $.mobile.loading('hide');
$('#content').unwrap(); $('div[data-role="content"]').unwrap();
}); });
}; };
@@ -639,8 +639,11 @@ function addImage(img, base64Image, defaultImg) {
function logout() { function logout() {
ownProfileId = -1; ownProfileId = -1;
profileIdRequest = -1; profileIdRequest = -1;
songIdRequest = -1 songIdRequest = -1;
sessionId = ""; sessionId = "";
if (window.localStorage) {
window.localStorage.setItem("VocaluxeSessionKey", "");
}
$.mobile.changePage("#login", { transition: "slidefade" }); $.mobile.changePage("#login", { transition: "slidefade" });
} }