diff --git a/js/stalk.js b/js/stalk.js
index 5b3a75e..3a60a5d 100644
--- a/js/stalk.js
+++ b/js/stalk.js
@@ -7,237 +7,238 @@ var showInactive = false;
var store = [];
var descriptions = {
- "year" : function(yr) {
- if(yr != 0) {
- return "class of " + (yr.length == 2 ? "20" + yr : yr);
- } else {
- return "";
- }
- },
- "major" : "studies ",
- "phone" : "phone: ",
- "room" : function(rm) {
- return (rm.match("^[N|C|M|K|A|B|C|D]{2}-[0-9]{3}$") ? "lives in " : "room: ") + rm
- },
- "country" : "from "
+ "year" : function(yr) {
+ if(yr != 0) {
+ return "class of " + (yr.length == 2 ? "20" + yr : yr);
+ } else {
+ return "";
+ }
+ },
+ "major" : "studies ",
+ "phone" : "phone: ",
+ "room" : function(rm) {
+ return (rm.match("^[N|C|M|K|A|B|C|D]{2}-[0-9]{3}$") ? "lives in " : "room: ") + rm
+ },
+ "country" : "from "
}
function loggedIn() {
- if(c.user && c.user != "") {
- $("#overlay").hide('slow');
- $('#search').focus();
- }
+ if(c.user && c.user != "") {
+ $("#overlay").hide('slow');
+ $('#search').focus();
+ }
}
function updateResults() {
- console.log("Updating results...");
+ console.log("Updating results...");
- timeout = null;
- var spinId = setTimeout(blankOut, 500);
- var query = $("#search").val();
+ timeout = null;
+ var spinId = setTimeout(blankOut, 500);
+ var query = $("#search").val();
- try{
- window.history.pushState( {} , window.title, '/?q='+escape(query) );
- } catch(e){}
+ try{
+ window.history.pushState( {} , window.title, '/?q='+escape(query) );
+ } catch(e){}
- if(!showInactive) {
- query += " active: true";
- }
+ if(!showInactive) {
+ query += " active: true";
+ }
- c.search(query, [], 7000, 0, function(error, data) {
- clearTimeout(spinId);
- hideSpinner();
- $("#frame").empty();
+ c.search(query, [], 7000, 0, function(error, data) {
+ clearTimeout(spinId);
+ hideSpinner();
+ $("#frame").empty();
- if(!error) {
- store = data.data;
+ if(!error) {
+ store = data.data;
- store.map(function(e, idx) {
- $("#frame")
- .append($("")
- .attr("src", e.picture)
- .attr("id", e.username)
+ store.map(function(e, idx) {
+ $("#frame")
+ .append($("
")
+ .attr("src", e.picture)
+ .attr("id", e.username)
.on("error", function(){
$(this).attr("src", "/imgs/duck.jpg").off("error");
})
- );
- });
-
- $("div#frame img").hover(
- function() { // Hover in
- makeHighlight(this.id);
- }
- );
- }
- });
+ );
+ });
+
+ $("div#frame img").hover(
+ function() { // Hover in
+ makeHighlight(this.id);
+ }
+ );
+ }
+ });
}
function getUserData(uid) {
- for (var i = store.length - 1; i >= 0; i--) {
- if(store[i].username == uid)
- return store[i];
- };
+ for (var i = store.length - 1; i >= 0; i--) {
+ if(store[i].username == uid)
+ return store[i];
+ };
}
function makeHighlight(uid) {
- // Kill the others
- $("div.highlight").remove();
+ // Kill the others
+ $("div.highlight").remove();
- var anchor = $(("img#" + uid));
+ var anchor = $(("img#" + uid));
- var usr = getUserData(uid);
+ var usr = getUserData(uid);
- var highlight = $("