Support URLs of the form /r/channel for sites with a RewriteRule

This commit is contained in:
calzoneman 2013-04-19 14:21:51 -05:00
parent 9e8ca1ad3a
commit a36d0d022e
1 changed files with 10 additions and 0 deletions

View File

@ -77,6 +77,16 @@ if(params["novideo"] != undefined) {
}
if(params["channel"] == undefined) {
// Match URLs of the form http://site.tld/r/channel
var loc = document.location+"";
var m = loc.match(/\/r\/([a-zA-Z0-9]+)/);
if(m) {
socket.emit("joinChannel", {
name: m[1]
});
return;
}
var main = $($(".container")[1]);
var container = $("<div/>").addClass("container").insertBefore(main);
var row = $("<div/>").addClass("row").appendTo(container);