summaryrefslogtreecommitdiff
path: root/frontend/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/static/js')
-rwxr-xr-xfrontend/static/js/profile.js27
-rw-r--r--frontend/static/js/src/api.js10
-rw-r--r--frontend/static/js/src/auth.js11
-rwxr-xr-xfrontend/static/js/src/soundmanager2.js (renamed from frontend/static/js/src/soundmanager.js)0
4 files changed, 40 insertions, 8 deletions
diff --git a/frontend/static/js/profile.js b/frontend/static/js/profile.js
index c4fb146..8cf63e2 100755
--- a/frontend/static/js/profile.js
+++ b/frontend/static/js/profile.js
@@ -159,21 +159,26 @@ var Room =
var Settings =
{
bio: "",
+ email: "",
data: {},
eventSet: false,
defaults:
{
avatar: "http://scannerjammer.com/static/img/runner.gif",
bg: "http://scannerjammer.com/static/bgz/scannerjammer_cyberspace.jpg",
+ email: "",
},
open: function ()
{
- if (parseInt(Auth.userid) !== userProfile[0])
- return
+ if (parseInt(Auth.userid) !== userProfile[0]){
+ return
+ }
$("#settings-hook").show()
$("#profile-avatar").val(Settings.data.avatar)
$("#profile-bg").val(Settings.data.bg)
$("#profile-bio").html(Settings.bio)
+ $("#profile-email").val(Settings.email) //ok only thing is that it's not saving through form submission trying to
+ //seems like it doesn't save in the Settings object, but does do the form submission...
if (! Profile.eventSet)
{
$("#profile-settings-save").bind("click", Settings.save)
@@ -189,6 +194,7 @@ var Settings =
Settings.data.bg = bg
var bio = d.sanitizeWithNewlines( $("#profile-bio").val() )
Settings.bio = bio
+ Settings.email = $('#profile-email').val();
Settings.load()
var s = "avatar\t"+avatar+"\n"
s += "bg\t"+bg+"\n"
@@ -197,6 +203,7 @@ var Settings =
settings: s,
bio: bio,
session: Auth.session,
+ email: Settings.email
}
$.post(API.URL.user.settings, data).success(Settings.saveCallback).error(Settings.errorCallback)
},
@@ -237,12 +244,12 @@ var Settings =
bio += "<p>"+s+"</p>"
}
$("#bio").html(bio)
- Settings.open()
+// Settings.open()
Viewport.standardResize()
},
init: function ()
{
- if (userProfile[6]) // bio
+ if (userProfile[6]) // bio
{
Settings.bio = userProfile[6]
}
@@ -254,6 +261,10 @@ var Settings =
Settings.data[i] = s[i]
}
}
+ if (userProfile[8]){ //email
+ Settings.email = userProfile[8]
+ console.log(Settings.email);
+ }
Settings.load()
}
}
@@ -340,7 +351,7 @@ var Profile =
var lines = API.parse("/user/load", raw)
if (! lines) return
if (lines[0].indexOf("0\t") === 0)
- return // console.log(lines.split("\t")[1])
+ return
queue = []
for (i in lines)
{
@@ -348,7 +359,7 @@ var Profile =
continue
if (lines[i].length < 2)
continue
- line = lines[i].split("\t").slice(1);
+ line = lines[i].split("\t");
queue.push(line)
}
Profile.page += 1
@@ -360,6 +371,9 @@ var Profile =
if (queue.length < 50)
$("#queue").append("<li id='queueDone'>That's all the videos!</li>")
},
+//one second ok I'm back... can we use a breakpoint here? I don't know how to find the right part
+//must be in one of these two scripts i found it, did you use a breakpoint? well just looked at thin profile.js for videos loadLess
+//through the browser? yes ok cool where is it?
loadLess: function ()
{
Profile.page -= 1
@@ -491,6 +505,7 @@ var Poll =
}
}
Poll.poll()
+
Settings.open()
},
poll: function ()
diff --git a/frontend/static/js/src/api.js b/frontend/static/js/src/api.js
index 797823e..3a0cd14 100644
--- a/frontend/static/js/src/api.js
+++ b/frontend/static/js/src/api.js
@@ -6,7 +6,7 @@ var API =
{
auth:
{
- login: "/api/auth/login",
+ login: "/api/auth/login",
logout: "/api/auth/logout",
checkin: "/api/auth/checkin",
sneakin: "/api/auth/sneakin",
@@ -64,6 +64,14 @@ var API =
}
}
// $.ajaxSetup({ timeout: 1000 })
+ $.ajaxSetup({
+ type: "POST",
+ xhrFields: {
+ withCredentials: true
+ },
+ });
+//API.js seems fairly global still no cookie looks good need to check database if it's was updated
+//for my user, right? yep
}
}
var Local =
diff --git a/frontend/static/js/src/auth.js b/frontend/static/js/src/auth.js
index 26da79d..42a92c5 100644
--- a/frontend/static/js/src/auth.js
+++ b/frontend/static/js/src/auth.js
@@ -36,15 +36,24 @@ var Auth =
document.cookie = "session="+Auth.session+";path=/;domain=.scannerjammer.com;max-age=1086400"
Auth.success()
},
+//http://i.imgur.com/kqpf9wX.png yes i see so do we just need to add cors headers? yes, what about nginx, did we restart it?
+//no good yet
checkin: function ()
{
d.warn("CHECK IN")
- $.post(API.URL.auth.checkin, {'session':Auth.session}, Auth.checkinCallback)
+ $.ajax(API.URL.auth.checkin, {
+ type: "POST",
+ data: { 'session':Auth.session, },
+ xhrFields: {
+ withCredentials: true
+ },
+ }).success(Auth.checkinCallback);
},
checkinCallback: function (raw)
{
var lines = API.parse("/auth/checkin", raw)
if (! lines.length) return
+ //so we should just return "OK" right? looks sso
if (lines[0] !== "OK")
{
alert(lines[0].split("\t")[1])
diff --git a/frontend/static/js/src/soundmanager.js b/frontend/static/js/src/soundmanager2.js
index 46528c9..46528c9 100755
--- a/frontend/static/js/src/soundmanager.js
+++ b/frontend/static/js/src/soundmanager2.js