summaryrefslogtreecommitdiff
path: root/frontend/static/js/profile.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/static/js/profile.js')
-rwxr-xr-xfrontend/static/js/profile.js27
1 files changed, 21 insertions, 6 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 ()