From 5f057d1d95d00294472edcbfbc17cfec4dfb561d Mon Sep 17 00:00:00 2001 From: root Date: Thu, 27 Dec 2012 05:35:44 -0500 Subject: fix /profile links with username.sj.com --- frontend/static/js/admin.js | 3 ++- frontend/static/js/chat.js | 6 ++++-- frontend/static/js/like.js | 3 ++- frontend/static/js/main.js | 3 ++- frontend/static/js/player.js | 3 ++- frontend/static/js/room.js | 3 ++- frontend/templates/directory.html | 3 ++- 7 files changed, 16 insertions(+), 8 deletions(-) diff --git a/frontend/static/js/admin.js b/frontend/static/js/admin.js index 92a0421..f9a75fb 100644 --- a/frontend/static/js/admin.js +++ b/frontend/static/js/admin.js @@ -66,7 +66,8 @@ var Admin = var li = "
  • " li += ""+thisDate+"" li += ""+makeClockTime(d)+"" - li += ""+row[4]+"" + var domain = window.location.hostname.split('.').slice(-2).join('.') + li += ""+row[4]+"" li += ""+type+"" li += ""+row[6]+"" li += "remove" diff --git a/frontend/static/js/chat.js b/frontend/static/js/chat.js index bdcd4d8..689dad6 100644 --- a/frontend/static/js/chat.js +++ b/frontend/static/js/chat.js @@ -12,7 +12,8 @@ var Chat = callback: false, parse: function (row) { - var s = '' + row[2] + " " + var domain = window.location.hostname.split('.').slice(-2).join('.') + var s = '' + row[2] + " " s += Chat.parseWords(row[3],row[0]) s += "
    " return s @@ -276,9 +277,10 @@ var Lastlog = Lastlog.old = lastlog var names = lastlog.split("\t") var s = "" + var domain = window.location.hostname.split('.').slice(-2).join('.') for (i in names.sort()) { - s += "
  • "+names[i]+"
  • " + s += "
  • "+names[i]+"
  • " } $("#lastlog").html(s) $("#lastlogbg").css("height", $("#lastlogbox").height()) diff --git a/frontend/static/js/like.js b/frontend/static/js/like.js index 2d43b7b..baf0be8 100644 --- a/frontend/static/js/like.js +++ b/frontend/static/js/like.js @@ -15,9 +15,10 @@ var Like = ], enqueue: function (username) { + var domain = window.location.hostname.split('.').slice(-2).join('.') d.joy("liked by "+username) $("#likereport").append( - $("").attr("href","/profile/"+username).html(username+" was "+d.choice(Like.favewords)+"!").attr("style","color:"+d.choice(Like.colors))) + $("").attr("href","http://"+username+"."+domain+"/").html(username+" was "+d.choice(Like.favewords)+"!").attr("style","color:"+d.choice(Like.colors))) if (Viewport.focused) Like.fire() else diff --git a/frontend/static/js/main.js b/frontend/static/js/main.js index 2f7439b..0b6db36 100644 --- a/frontend/static/js/main.js +++ b/frontend/static/js/main.js @@ -522,7 +522,8 @@ var Include = { Chat.previousName = row[2] var s = "
    " - s += '' + row[2] + "" + var domain = window.location.hostname.split('.').slice(-2).join('.') + s += '' + row[2] + "" s += "" s += Chat.parseWords(row[3]) s += "" diff --git a/frontend/static/js/player.js b/frontend/static/js/player.js index a64c003..1245029 100644 --- a/frontend/static/js/player.js +++ b/frontend/static/js/player.js @@ -481,7 +481,8 @@ var Playlist = s += ""+score+"" } s += "" - s += ""+video.username+"" + var domain = window.location.hostname.split('.').slice(-2).join('.') + s += ""+video.username+"" s += ""+video.title+"" s += "" return s diff --git a/frontend/static/js/room.js b/frontend/static/js/room.js index 2c7bbd8..8cd44d8 100644 --- a/frontend/static/js/room.js +++ b/frontend/static/js/room.js @@ -332,7 +332,8 @@ var About = loaded: false, init: function () { - $("#your-profile").attr('href', 'http://scannerjammer.com/profile/'+Auth.username) + var domain = window.location.hostname.split('.').slice(-2).join('.') + $("#your-profile").attr('href', 'http://'+Auth.username+"."+domain+"/") About.loaded = true } } diff --git a/frontend/templates/directory.html b/frontend/templates/directory.html index 1a29e31..89c9373 100644 --- a/frontend/templates/directory.html +++ b/frontend/templates/directory.html @@ -264,7 +264,8 @@ var Directory = users[i].score = ' ' } cl += count % 2 ? " on" : " off" - rows.push('
  • '+users[i].score+''+users[i].name+'
  • ') + var domain = window.location.hostname.split('.').slice(-2).join('.') + rows.push('
  • '+users[i].score+''+users[i].name+'
  • ') count += 1 } $("#directory").html(rows.join('')) -- cgit v1.2.3-70-g09d2