Bugfixes for last commit
- Fix race condition for login frame - Fix guest logins
This commit is contained in:
parent
3a7acd0526
commit
087f612b37
8 changed files with 30 additions and 10 deletions
|
|
@ -143,7 +143,7 @@ function initCallbacks() {
|
|||
$("#loginform").css("display", "none");
|
||||
$("#logoutform").css("display", "");
|
||||
$("#loggedin").css("display", "");
|
||||
session = data.session;
|
||||
session = data.session || "";
|
||||
createCookie("sync_uname", uname, 7);
|
||||
createCookie("sync_session", session, 7);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -863,7 +863,13 @@ function showLoginFrame() {
|
|||
.css("height", "300px")
|
||||
.css("margin", "0")
|
||||
.appendTo(body);
|
||||
var timer = setInterval(function() {
|
||||
frame[0].contentWindow.postMessage("cytube-syn", document.location);
|
||||
}, 1000);
|
||||
var respond = function(e) {
|
||||
if(e.data == "cytube-ack") {
|
||||
clearInterval(timer);
|
||||
}
|
||||
if(e.data.indexOf(":") == -1) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -874,8 +880,8 @@ function showLoginFrame() {
|
|||
alert(data.error);
|
||||
}
|
||||
else if(data.success) {
|
||||
session = data.session;
|
||||
uname = data.uname;
|
||||
session = data.session || "";
|
||||
uname = data.uname || "";
|
||||
socket.emit("login", {
|
||||
name: uname,
|
||||
session: session
|
||||
|
|
@ -900,9 +906,6 @@ function showLoginFrame() {
|
|||
// their shit together
|
||||
window.attachEvent("onmessage", respond);
|
||||
}
|
||||
setTimeout(function() {
|
||||
frame[0].contentWindow.postMessage("cytube-syn", document.location);
|
||||
}, 1000);
|
||||
var footer = $("<div/>").addClass("modal-footer").appendTo(modal);
|
||||
modal.on("hidden", function() {
|
||||
modal.remove();
|
||||
|
|
|
|||
|
|
@ -279,7 +279,6 @@ Media.prototype.initRTMP = function() {
|
|||
}
|
||||
|
||||
Media.prototype.update = function(data) {
|
||||
console.log(parseInt(data.currentTime / 60), parseInt(data.currentTime % 60));
|
||||
if(data.id != this.id) {
|
||||
if(data.currentTime < 0) {
|
||||
data.currentTime = 0;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
var respond = function(e) {
|
||||
if(e.data == "cytube-syn") {
|
||||
source = e.source;
|
||||
source.postMessage("cytube-ack", document.location);
|
||||
}
|
||||
}
|
||||
window.addEventListener("message", respond, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue