Fix #149 and a couple other issues

This commit is contained in:
calzoneman 2013-05-26 11:38:38 -04:00
parent a6af5a2440
commit 828b7e0381
3 changed files with 6 additions and 6 deletions

2
api.js
View File

@ -107,7 +107,7 @@ function handleChannelData(params, req, res) {
var data = [];
for(var j = 0; j < clist.length; j++) {
var cname = clist[j];
if(!cname.match(/^[a-zA-Z0-9]+$/)) {
if(!cname.match(/^[a-zA-Z0-9-_]+$/)) {
continue;
}
var d = {

View File

@ -60,7 +60,7 @@ Callbacks = {
channelNotRegistered: function() {
var div = $("<div/>").addClass("alert alert-info").attr("id", "chregnotice")
.insertAfter($(".row")[0]);
.insertBefore($("#main"));
$("<button/>").addClass("close pull-right").text("×")
.appendTo(div)
.click(function() { div.remove(); });

View File

@ -537,7 +537,7 @@ function parseYTPlaylist(url) {
}
function parseTwitch(url) {
var m = url.match(/twitch\.tv\/([a-zA-Z0-9]+)/);
var m = url.match(/twitch\.tv\/([^#\?\/]+)/);
if(m) {
return m[1];
}
@ -545,7 +545,7 @@ function parseTwitch(url) {
}
function parseJustinTV(url) {
var m = url.match(/justin\.tv\/([a-zA-Z0-9]+)/);
var m = url.match(/justin\.tv\/([^#\?\/]+)/);
if(m) {
return m[1];
}
@ -553,7 +553,7 @@ function parseJustinTV(url) {
}
function parseLivestream(url) {
var m = url.match(/livestream\.com\/([a-zA-Z0-9]+)/);
var m = url.match(/livestream\.com\/([^#\?\/]+)/);
if(m) {
return m[1];
}
@ -561,7 +561,7 @@ function parseLivestream(url) {
}
function parseUstream(url) {
var m = url.match(/ustream\.tv\/([a-zA-Z0-9-]+)/);
var m = url.match(/ustream\.tv\/([^#\?\/]+)/);
if(m) {
return m[1];
}