mirror of https://github.com/calzoneman/sync.git
commit
4ef059ddaa
113
channel.js
113
channel.js
|
@ -19,6 +19,7 @@ var Logger = require("./logger.js");
|
||||||
var InfoGetter = require("./get-info.js");
|
var InfoGetter = require("./get-info.js");
|
||||||
var Server = require("./server.js");
|
var Server = require("./server.js");
|
||||||
var io = Server.io;
|
var io = Server.io;
|
||||||
|
var NWS = require("./notwebsocket");
|
||||||
var Rank = require("./rank.js");
|
var Rank = require("./rank.js");
|
||||||
var Auth = require("./auth.js");
|
var Auth = require("./auth.js");
|
||||||
var ChatCommand = require("./chatcommand.js");
|
var ChatCommand = require("./chatcommand.js");
|
||||||
|
@ -54,7 +55,7 @@ var Channel = function(name) {
|
||||||
playlistdelete: 2,
|
playlistdelete: 2,
|
||||||
playlistjump: 1.5,
|
playlistjump: 1.5,
|
||||||
playlistaddlist: 1.5,
|
playlistaddlist: 1.5,
|
||||||
playlistadd: 1.5,
|
playlistaddlive: 1.5,
|
||||||
addnontemp: 2,
|
addnontemp: 2,
|
||||||
settemp: 2,
|
settemp: 2,
|
||||||
playlistgeturl: 1.5,
|
playlistgeturl: 1.5,
|
||||||
|
@ -75,7 +76,8 @@ var Channel = function(name) {
|
||||||
customcss: "",
|
customcss: "",
|
||||||
customjs: "",
|
customjs: "",
|
||||||
chat_antiflood: false,
|
chat_antiflood: false,
|
||||||
show_public: false
|
show_public: false,
|
||||||
|
enable_link_regex: true
|
||||||
};
|
};
|
||||||
this.filters = [
|
this.filters = [
|
||||||
new Filter("monospace", "`([^`]+)`", "g", "<code>$1</code>"),
|
new Filter("monospace", "`([^`]+)`", "g", "<code>$1</code>"),
|
||||||
|
@ -197,7 +199,9 @@ Channel.prototype.loadDump = function() {
|
||||||
}
|
}
|
||||||
data.logins = data.logins || {};
|
data.logins = data.logins || {};
|
||||||
for(var ip in data.logins) {
|
for(var ip in data.logins) {
|
||||||
this.logins[ip] = data.logins[ip];
|
for(var i = 0; i < data.logins.length; i++) {
|
||||||
|
this.logins[ip].push(data.logins[ip][i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.setLock(!(data.openqueue || false));
|
this.setLock(!(data.openqueue || false));
|
||||||
this.chatbuffer = data.chatbuffer || [];
|
this.chatbuffer = data.chatbuffer || [];
|
||||||
|
@ -536,12 +540,7 @@ Channel.prototype.userJoin = function(user) {
|
||||||
if(user.name != "") {
|
if(user.name != "") {
|
||||||
for(var i = 0; i < this.users.length; i++) {
|
for(var i = 0; i < this.users.length; i++) {
|
||||||
if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) {
|
if(this.users[i].name.toLowerCase() == user.name.toLowerCase()) {
|
||||||
user.name = "";
|
this.kick(this.users[i], "Duplicate login");
|
||||||
user.loggedIn = false;
|
|
||||||
user.socket.emit("login", {
|
|
||||||
success: false,
|
|
||||||
error: "The username " + user.name + " is already in use on this channel"
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -650,13 +649,12 @@ Channel.prototype.sendRankStuff = function(user) {
|
||||||
var ents = [];
|
var ents = [];
|
||||||
for(var ip in this.ipbans) {
|
for(var ip in this.ipbans) {
|
||||||
if(this.ipbans[ip] != null) {
|
if(this.ipbans[ip] != null) {
|
||||||
var name;
|
var name = [];
|
||||||
if(ip in this.logins) {
|
if(ip in this.logins) {
|
||||||
name = this.logins[ip].join(", ");
|
name = this.logins[ip];
|
||||||
}
|
|
||||||
else {
|
|
||||||
name = this.ipbans[ip][0];
|
|
||||||
}
|
}
|
||||||
|
name.push(this.ipbans[ip][0]);
|
||||||
|
name = name.join(", ");
|
||||||
var id = this.hideIP(ip);
|
var id = this.hideIP(ip);
|
||||||
var disp = ip;
|
var disp = ip;
|
||||||
if(user.rank < Rank.Siteadmin) {
|
if(user.rank < Rank.Siteadmin) {
|
||||||
|
@ -760,6 +758,15 @@ Channel.prototype.sendRecentChat = function(user) {
|
||||||
|
|
||||||
Channel.prototype.sendAll = function(message, data) {
|
Channel.prototype.sendAll = function(message, data) {
|
||||||
io.sockets.in(this.name).emit(message, data);
|
io.sockets.in(this.name).emit(message, data);
|
||||||
|
NWS.inRoom(this.name).emit(message, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
Channel.prototype.sendAllWithPermission = function(perm, msg, data) {
|
||||||
|
for(var i = 0; i < this.users.length; i++) {
|
||||||
|
if(Rank.hasPermission(this.users[i], perm)) {
|
||||||
|
this.users[i].socket.emit(msg, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Channel.prototype.broadcastPlaylistMeta = function() {
|
Channel.prototype.broadcastPlaylistMeta = function() {
|
||||||
|
@ -954,12 +961,13 @@ function mediaUpdate(chan, id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isLive(type) {
|
function isLive(type) {
|
||||||
return type == "li"
|
return type == "li" // Livestream.com
|
||||||
|| type == "tw"
|
|| type == "tw" // Twitch.tv
|
||||||
|| type == "jt"
|
|| type == "jt" // Justin.tv
|
||||||
|| type == "rt"
|
|| type == "rt" // RTMP
|
||||||
|| type == "jw"
|
|| type == "jw" // JWPlayer
|
||||||
|| type == "us";
|
|| type == "us" // Ustream.tv
|
||||||
|
|| type == "im";// Imgur album
|
||||||
}
|
}
|
||||||
|
|
||||||
Channel.prototype.queueAdd = function(media, idx) {
|
Channel.prototype.queueAdd = function(media, idx) {
|
||||||
|
@ -986,6 +994,11 @@ Channel.prototype.autoTemp = function(media, user) {
|
||||||
Channel.prototype.enqueue = function(data, user) {
|
Channel.prototype.enqueue = function(data, user) {
|
||||||
var idx = data.pos == "next" ? this.position + 1 : this.queue.length;
|
var idx = data.pos == "next" ? this.position + 1 : this.queue.length;
|
||||||
|
|
||||||
|
if(isLive(data.type) && !this.hasPermission(user, "playlistaddlive")) {
|
||||||
|
user.socket.emit("queueFail", "You don't have permission to queue livestreams");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Prefer cache over looking up new data
|
// Prefer cache over looking up new data
|
||||||
if(data.id in this.library) {
|
if(data.id in this.library) {
|
||||||
var media = this.library[data.id].dup();
|
var media = this.library[data.id].dup();
|
||||||
|
@ -1052,6 +1065,12 @@ Channel.prototype.enqueue = function(data, user) {
|
||||||
this.autoTemp(media, user);
|
this.autoTemp(media, user);
|
||||||
this.queueAdd(media, idx);
|
this.queueAdd(media, idx);
|
||||||
break;
|
break;
|
||||||
|
case "im":
|
||||||
|
var media = new Media(data.id, "Imgur Album", "--:--", "im");
|
||||||
|
media.queueby = user ? user.name : "";
|
||||||
|
this.autoTemp(media, user);
|
||||||
|
this.queueAdd(media, idx);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1448,8 +1467,12 @@ Channel.prototype.trySetLock = function(user, data) {
|
||||||
Channel.prototype.updateFilter = function(filter) {
|
Channel.prototype.updateFilter = function(filter) {
|
||||||
var found = false;
|
var found = false;
|
||||||
for(var i = 0; i < this.filters.length; i++) {
|
for(var i = 0; i < this.filters.length; i++) {
|
||||||
if(this.filters[i].name == filter.name
|
if(this.filters[i].name == "" && filter.name == ""
|
||||||
&& this.filters[i].source == filter.source) {
|
&& this.filters[i].source == filter.source) {
|
||||||
|
found = true;
|
||||||
|
this.filters[i] = filter;
|
||||||
|
}
|
||||||
|
else if(filter.name != "" && this.filters[i].name == filter.name) {
|
||||||
found = true;
|
found = true;
|
||||||
this.filters[i] = filter;
|
this.filters[i] = filter;
|
||||||
}
|
}
|
||||||
|
@ -1624,7 +1647,7 @@ Channel.prototype.filterMessage = function(msg) {
|
||||||
var subs = msg.split(link);
|
var subs = msg.split(link);
|
||||||
// Apply other filters
|
// Apply other filters
|
||||||
for(var j = 0; j < subs.length; j++) {
|
for(var j = 0; j < subs.length; j++) {
|
||||||
if(subs[j].match(link)) {
|
if(this.opts.enable_link_regex && subs[j].match(link)) {
|
||||||
subs[j] = subs[j].replace(link, "<a href=\"$1\" target=\"_blank\">$1</a>");
|
subs[j] = subs[j].replace(link, "<a href=\"$1\" target=\"_blank\">$1</a>");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1661,6 +1684,46 @@ Channel.prototype.sendMessage = function(username, msg, msgclass, data) {
|
||||||
|
|
||||||
/* REGION Rank stuff */
|
/* REGION Rank stuff */
|
||||||
|
|
||||||
|
Channel.prototype.trySetRank = function(user, data) {
|
||||||
|
if(!Rank.hasPermission(user, "promote"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(typeof data.user !== "string" || typeof data.rank !== "number")
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(data.rank >= user.rank)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(data.rank < 1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var receiver;
|
||||||
|
for(var i = 0; i < this.users.length; i++) {
|
||||||
|
if(this.users[i].name == data.user) {
|
||||||
|
receiver = this.users[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(receiver) {
|
||||||
|
if(receiver.rank >= user.rank)
|
||||||
|
return;
|
||||||
|
receiver.rank = data.rank;
|
||||||
|
if(receiver.loggedIn) {
|
||||||
|
this.saveRank(receiver);
|
||||||
|
}
|
||||||
|
this.broadcastUserUpdate(receiver);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var rrank = this.getRank(data.user);
|
||||||
|
if(rrank >= user.rank)
|
||||||
|
return;
|
||||||
|
Database.setChannelRank(this.name, data.user, data.rank);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sendAllWithPermission("acl", "setChannelRank", data);
|
||||||
|
}
|
||||||
|
|
||||||
Channel.prototype.tryPromoteUser = function(actor, data) {
|
Channel.prototype.tryPromoteUser = function(actor, data) {
|
||||||
if(!Rank.hasPermission(actor, "promote")) {
|
if(!Rank.hasPermission(actor, "promote")) {
|
||||||
return;
|
return;
|
||||||
|
@ -1695,7 +1758,7 @@ Channel.prototype.tryPromoteUser = function(actor, data) {
|
||||||
Database.setChannelRank(this.name, data.name, rank);
|
Database.setChannelRank(this.name, data.name, rank);
|
||||||
}
|
}
|
||||||
this.logger.log("*** " + actor.name + " promoted " + data.name + " from " + (rank - 1) + " to " + rank);
|
this.logger.log("*** " + actor.name + " promoted " + data.name + " from " + (rank - 1) + " to " + rank);
|
||||||
this.broadcastRankTable();
|
//this.broadcastRankTable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1732,7 +1795,7 @@ Channel.prototype.tryDemoteUser = function(actor, data) {
|
||||||
Database.setChannelRank(this.name, data.name, rank);
|
Database.setChannelRank(this.name, data.name, rank);
|
||||||
}
|
}
|
||||||
this.logger.log("*** " + actor.name + " demoted " + data.name + " from " + (rank + 1) + " to " + rank);
|
this.logger.log("*** " + actor.name + " demoted " + data.name + " from " + (rank + 1) + " to " + rank);
|
||||||
this.broadcastRankTable();
|
//this.broadcastRankTable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ function handle(chan, user, msg, data) {
|
||||||
handleBan(chan, user, msg.substring(5).split(" "));
|
handleBan(chan, user, msg.substring(5).split(" "));
|
||||||
}
|
}
|
||||||
else if(msg.indexOf("/ipban ") == 0) {
|
else if(msg.indexOf("/ipban ") == 0) {
|
||||||
handleIPBan(chan, user, msg.substring(5).split(" "));
|
handleIPBan(chan, user, msg.substring(7).split(" "));
|
||||||
}
|
}
|
||||||
else if(msg.indexOf("/unban ") == 0) {
|
else if(msg.indexOf("/unban ") == 0) {
|
||||||
handleUnban(chan, user, msg.substring(7).split(" "));
|
handleUnban(chan, user, msg.substring(7).split(" "));
|
||||||
|
@ -86,12 +86,11 @@ function handleIPBan(chan, user, args) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(kickee && kickee.rank < user.rank) {
|
if(kickee) {
|
||||||
chan.logger.log("*** " + user.name + " banned " + args[0]);
|
chan.tryIPBan(user, {
|
||||||
args[0] = "";
|
id: chan.hideIP(kickee.ip),
|
||||||
var reason = args.join(" ");
|
name: kickee.name
|
||||||
chan.kick(kickee, "(banned) " + reason);
|
});
|
||||||
chan.banIP(user, kickee);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
11
database.js
11
database.js
|
@ -1,3 +1,14 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2013 Calvin Montgomery
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
var mysql = require("mysql-libmysqlclient");
|
var mysql = require("mysql-libmysqlclient");
|
||||||
var Logger = require("./logger");
|
var Logger = require("./logger");
|
||||||
var Media = require("./media").Media;
|
var Media = require("./media").Media;
|
||||||
|
|
11
filter.js
11
filter.js
|
@ -1,3 +1,14 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2013 Calvin Montgomery
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
var Filter = function(name, regex, flags, replace) {
|
var Filter = function(name, regex, flags, replace) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.source = regex;
|
this.source = regex;
|
||||||
|
|
|
@ -0,0 +1,194 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2013 Calvin Montgomery
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var Logger = require("./logger");
|
||||||
|
|
||||||
|
const chars = "abcdefghijklmnopqsrtuvwxyz" +
|
||||||
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
|
||||||
|
"0123456789";
|
||||||
|
|
||||||
|
var NotWebsocket = function() {
|
||||||
|
this.hash = "";
|
||||||
|
for(var i = 0; i < 30; i++) {
|
||||||
|
this.hash += chars[parseInt(Math.random() * (chars.length - 1))];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.pktqueue = [];
|
||||||
|
this.handlers = {};
|
||||||
|
this.room = "";
|
||||||
|
this.lastpoll = Date.now();
|
||||||
|
this.noflood = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.checkFlood = function(id, rate) {
|
||||||
|
if(id in this.noflood) {
|
||||||
|
this.noflood[id].push(Date.now());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.noflood[id] = [Date.now()];
|
||||||
|
}
|
||||||
|
if(this.noflood[id].length > 10) {
|
||||||
|
this.noflood[id].shift();
|
||||||
|
var hz = 10000 / (this.noflood[id][9] - this.noflood[id][0]);
|
||||||
|
if(hz > rate) {
|
||||||
|
throw "Rate is too high: " + id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.emit = function(msg, data) {
|
||||||
|
var pkt = [msg, data];
|
||||||
|
this.pktqueue.push(pkt);
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.poll = function() {
|
||||||
|
this.checkFlood("poll", 100);
|
||||||
|
this.lastpoll = Date.now();
|
||||||
|
var q = [];
|
||||||
|
for(var i = 0; i < this.pktqueue.length; i++) {
|
||||||
|
q.push(this.pktqueue[i]);
|
||||||
|
}
|
||||||
|
this.pktqueue.length = 0;
|
||||||
|
return q;
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.on = function(msg, callback) {
|
||||||
|
if(!(msg in this.handlers))
|
||||||
|
this.handlers[msg] = [];
|
||||||
|
this.handlers[msg].push(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.recv = function(urlstr) {
|
||||||
|
this.checkFlood("recv", 100);
|
||||||
|
var msg, data;
|
||||||
|
try {
|
||||||
|
var js = JSON.parse(urlstr);
|
||||||
|
msg = js[0];
|
||||||
|
data = js[1];
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
Logger.errlog.log("Failed to parse NWS string");
|
||||||
|
Logger.errlog.log(urlstr);
|
||||||
|
}
|
||||||
|
if(!msg)
|
||||||
|
return;
|
||||||
|
if(!(msg in this.handlers))
|
||||||
|
return;
|
||||||
|
for(var i = 0; i < this.handlers[msg].length; i++) {
|
||||||
|
this.handlers[msg][i](data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.join = function(rm) {
|
||||||
|
if(!(rm in rooms)) {
|
||||||
|
rooms[rm] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
rooms[rm].push(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.leave = function(rm) {
|
||||||
|
if(rm in rooms) {
|
||||||
|
var idx = rooms[rm].indexOf(this);
|
||||||
|
if(idx >= 0) {
|
||||||
|
rooms[rm].splice(idx, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.disconnect = function() {
|
||||||
|
for(var rm in rooms) {
|
||||||
|
this.leave(rm);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.recv(JSON.stringify(["disconnect", undefined]));
|
||||||
|
this.emit("disconnect");
|
||||||
|
|
||||||
|
clients[this.hash] = null;
|
||||||
|
delete clients[this.hash];
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendJSON(res, obj) {
|
||||||
|
var response = JSON.stringify(obj, null, 4);
|
||||||
|
if(res.callback) {
|
||||||
|
response = res.callback + "(" + response + ")";
|
||||||
|
}
|
||||||
|
var len = unescape(encodeURIComponent(response)).length;
|
||||||
|
|
||||||
|
res.setHeader("Content-Type", "application/json");
|
||||||
|
res.setHeader("Content-Length", len);
|
||||||
|
res.end(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
var clients = {};
|
||||||
|
var rooms = {};
|
||||||
|
|
||||||
|
function newConnection(req, res) {
|
||||||
|
var nws = new NotWebsocket();
|
||||||
|
clients[nws.hash] = nws;
|
||||||
|
res.callback = req.query.callback;
|
||||||
|
sendJSON(res, nws.hash);
|
||||||
|
return nws;
|
||||||
|
}
|
||||||
|
exports.newConnection = newConnection;
|
||||||
|
|
||||||
|
function msgReceived(req, res) {
|
||||||
|
var h = req.params.hash;
|
||||||
|
if(h in clients && clients[h] != null) {
|
||||||
|
var str = req.params.str;
|
||||||
|
res.callback = req.query.callback;
|
||||||
|
try {
|
||||||
|
if(str == "poll") {
|
||||||
|
sendJSON(res, clients[h].poll());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
clients[h].recv(unescape(str));
|
||||||
|
sendJSON(res, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
res.send(429); // 429 Too Many Requests
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
res.send(404);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.msgReceived = msgReceived;
|
||||||
|
|
||||||
|
function inRoom(rm) {
|
||||||
|
var cl = [];
|
||||||
|
|
||||||
|
if(rm in rooms) {
|
||||||
|
for(var i = 0; i < rooms[rm].length; i++) {
|
||||||
|
cl.push(rooms[rm][i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cl.emit = function(msg, data) {
|
||||||
|
for(var i = 0; i < this.length; i++) {
|
||||||
|
this[i].emit(msg, data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return cl;
|
||||||
|
}
|
||||||
|
exports.inRoom = inRoom;
|
||||||
|
|
||||||
|
function checkDeadSockets() {
|
||||||
|
for(var h in clients) {
|
||||||
|
if(Date.now() - clients[h].lastpoll >= 2000) {
|
||||||
|
clients[h].disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setInterval(checkDeadSockets, 2000);
|
|
@ -2,7 +2,7 @@
|
||||||
"author": "Calvin Montgomery",
|
"author": "Calvin Montgomery",
|
||||||
"name": "CyTube",
|
"name": "CyTube",
|
||||||
"description": "Online media synchronizer and chat",
|
"description": "Online media synchronizer and chat",
|
||||||
"version": "1.9.3",
|
"version": "1.9.4",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
50
server.js
50
server.js
|
@ -9,7 +9,7 @@ The above copyright notice and this permission notice shall be included in all c
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const VERSION = "1.9.3";
|
const VERSION = "1.9.4";
|
||||||
|
|
||||||
var fs = require("fs");
|
var fs = require("fs");
|
||||||
var Logger = require("./logger.js");
|
var Logger = require("./logger.js");
|
||||||
|
@ -18,6 +18,7 @@ Logger.syslog.log("Starting CyTube v" + VERSION);
|
||||||
var Config = require("./config.js");
|
var Config = require("./config.js");
|
||||||
var express = require("express");
|
var express = require("express");
|
||||||
var API = require("./api.js");
|
var API = require("./api.js");
|
||||||
|
var NWS = require("./notwebsocket");
|
||||||
|
|
||||||
var app = express();
|
var app = express();
|
||||||
app.get("/r/:channel(*)", function(req, res, next) {
|
app.get("/r/:channel(*)", function(req, res, next) {
|
||||||
|
@ -34,6 +35,53 @@ app.get("/api/:apireq(*)", function(req, res, next) {
|
||||||
API.handle(req.url.substring(5), req, res);
|
API.handle(req.url.substring(5), req, res);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function getClientIP(req) {
|
||||||
|
var ip;
|
||||||
|
var forward = req.header("x-forwarded-for");
|
||||||
|
if(forward) {
|
||||||
|
ip = forward.split(",")[0];
|
||||||
|
}
|
||||||
|
if(!ip) {
|
||||||
|
ip = req.connection.remoteAddress;
|
||||||
|
}
|
||||||
|
return ip;
|
||||||
|
}
|
||||||
|
|
||||||
|
app.get("/nws/connect", function(req, res, next) {
|
||||||
|
var socket = NWS.newConnection(req, res);
|
||||||
|
var ip = getClientIP(req);
|
||||||
|
if(Database.checkGlobalBan(ip)) {
|
||||||
|
Logger.syslog.log("Disconnecting " + ip + " - bant");
|
||||||
|
socket.emit("kick", {
|
||||||
|
reason: "You're globally banned!"
|
||||||
|
});
|
||||||
|
socket.disconnect(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
socket.on("disconnect", function() {
|
||||||
|
exports.clients[ip]--;
|
||||||
|
});
|
||||||
|
if(!(ip in exports.clients)) {
|
||||||
|
exports.clients[ip] = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
exports.clients[ip]++;
|
||||||
|
}
|
||||||
|
if(exports.clients[ip] > Config.MAX_PER_IP) {
|
||||||
|
socket.emit("kick", {
|
||||||
|
reason: "Too many connections from your IP address"
|
||||||
|
});
|
||||||
|
socket.disconnect(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var user = new User(socket, ip);
|
||||||
|
Logger.syslog.log("Accepted connection from /" + user.ip);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get("/nws/:hash/:str", function(req, res, next) {
|
||||||
|
NWS.msgReceived(req, res);
|
||||||
|
});
|
||||||
|
|
||||||
app.get("/:thing(*)", function(req, res, next) {
|
app.get("/:thing(*)", function(req, res, next) {
|
||||||
res.sendfile(__dirname + "/www/" + req.params.thing);
|
res.sendfile(__dirname + "/www/" + req.params.thing);
|
||||||
});
|
});
|
||||||
|
|
12
user.js
12
user.js
|
@ -146,6 +146,12 @@ User.prototype.initCallbacks = function() {
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
this.socket.on("setChannelRank", function(data) {
|
||||||
|
if(this.channel != null) {
|
||||||
|
this.channel.trySetRank(this, data);
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
this.socket.on("banName", function(data) {
|
this.socket.on("banName", function(data) {
|
||||||
if(this.channel != null) {
|
if(this.channel != null) {
|
||||||
this.channel.banName(this, data.name || "");
|
this.channel.banName(this, data.name || "");
|
||||||
|
@ -521,11 +527,7 @@ User.prototype.login = function(name, pw, session) {
|
||||||
if(this.channel != null && name != "") {
|
if(this.channel != null && name != "") {
|
||||||
for(var i = 0; i < this.channel.users.length; i++) {
|
for(var i = 0; i < this.channel.users.length; i++) {
|
||||||
if(this.channel.users[i].name == name) {
|
if(this.channel.users[i].name == name) {
|
||||||
this.socket.emit("login", {
|
this.channel.kick(this.channel.users[i], "Duplicate login");
|
||||||
success: false,
|
|
||||||
error: "The username " + name + " is already in use on this channel"
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,12 +77,21 @@ html, body {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#usercount, #currenttitle {
|
#usercountcontainer, #currenttitle {
|
||||||
border: 1px solid #aaaaaa;
|
border: 1px solid #aaaaaa;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#usercount {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ulistchevron {
|
||||||
|
cursor: pointer;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
#plmeta {
|
#plmeta {
|
||||||
border: 1px solid #aaaaaa;
|
border: 1px solid #aaaaaa;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2013 Calvin Montgomery
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
var uname = readCookie("sync_uname") || "";
|
var uname = readCookie("sync_uname") || "";
|
||||||
var session = readCookie("sync_session") || "";
|
var session = readCookie("sync_session") || "";
|
||||||
var api = WEB_URL + "/api/json/";
|
var api = WEB_URL + "/api/json/";
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2013 Calvin Montgomery
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
Callbacks = {
|
Callbacks = {
|
||||||
|
|
||||||
connect: function() {
|
connect: function() {
|
||||||
|
@ -193,9 +204,9 @@ Callbacks = {
|
||||||
$("#opt_customjs").val(opts.customjs);
|
$("#opt_customjs").val(opts.customjs);
|
||||||
$("#opt_chat_antiflood").prop("checked", opts.chat_antiflood);
|
$("#opt_chat_antiflood").prop("checked", opts.chat_antiflood);
|
||||||
$("#opt_show_public").prop("checked", opts.show_public);
|
$("#opt_show_public").prop("checked", opts.show_public);
|
||||||
|
$("#opt_enable_link_regex").prop("checked", opts.enable_link_regex);
|
||||||
$("#customCss").remove();
|
$("#customCss").remove();
|
||||||
if(opts.customcss.trim() != "") {
|
if(opts.customcss.trim() != "") {
|
||||||
$("#usertheme").remove();
|
|
||||||
$("<link/>")
|
$("<link/>")
|
||||||
.attr("rel", "stylesheet")
|
.attr("rel", "stylesheet")
|
||||||
.attr("href", opts.customcss)
|
.attr("href", opts.customcss)
|
||||||
|
@ -242,7 +253,6 @@ Callbacks = {
|
||||||
$("#jstext").val(data.js);
|
$("#jstext").val(data.js);
|
||||||
|
|
||||||
if(data.css) {
|
if(data.css) {
|
||||||
$("#usertheme").remove();
|
|
||||||
$("<style/>").attr("type", "text/css")
|
$("<style/>").attr("type", "text/css")
|
||||||
.attr("id", "chancss")
|
.attr("id", "chancss")
|
||||||
.text(data.css)
|
.text(data.css)
|
||||||
|
@ -352,40 +362,18 @@ Callbacks = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loadACLPage(0);
|
loadACLPage(0);
|
||||||
return;
|
},
|
||||||
for(var i = 0; i < entries.length; i++) {
|
|
||||||
var tr = $("<tr/>").appendTo(tbl);
|
setChannelRank: function(data) {
|
||||||
var name = $("<td/>").text(entries[i].name).appendTo(tr);
|
var ents = $("#channelranks").data("entries");
|
||||||
name.addClass(getNameColor(entries[i].rank));
|
for(var i = 0; i < ents.length; i++) {
|
||||||
var rank = $("<td/>").text(entries[i].rank).appendTo(tr);
|
if(ents[i].name == data.user) {
|
||||||
var control = $("<td/>").appendTo(tr);
|
ents[i].rank = data.rank;
|
||||||
var up = $("<button/>").addClass("btn btn-mini btn-success")
|
break;
|
||||||
.appendTo(control);
|
|
||||||
$("<i/>").addClass("icon-plus").appendTo(up);
|
|
||||||
var down = $("<button/>").addClass("btn btn-mini btn-danger")
|
|
||||||
.appendTo(control);
|
|
||||||
$("<i/>").addClass("icon-minus").appendTo(down);
|
|
||||||
if(entries[i].rank + 1 >= RANK) {
|
|
||||||
up.attr("disabled", true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
up.click(function(name) { return function() {
|
|
||||||
socket.emit("promote", {
|
|
||||||
name: name
|
|
||||||
});
|
|
||||||
}}(entries[i].name));
|
|
||||||
}
|
|
||||||
if(entries[i].rank >= RANK) {
|
|
||||||
down.attr("disabled", true);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
down.click(function(name) { return function() {
|
|
||||||
socket.emit("demote", {
|
|
||||||
name: name
|
|
||||||
});
|
|
||||||
}}(entries[i].name));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$("#channelranks").data("entries", ents);
|
||||||
|
loadACLPage($("#channelranks").data("page"));
|
||||||
},
|
},
|
||||||
|
|
||||||
voteskip: function(data) {
|
voteskip: function(data) {
|
||||||
|
@ -506,6 +494,7 @@ Callbacks = {
|
||||||
formatUserlistItem(users[i], data);
|
formatUserlistItem(users[i], data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
userLeave: function(data) {
|
userLeave: function(data) {
|
||||||
|
@ -572,8 +561,11 @@ Callbacks = {
|
||||||
$(li).show("blind");
|
$(li).show("blind");
|
||||||
},
|
},
|
||||||
|
|
||||||
queueFail: function() {
|
queueFail: function(data) {
|
||||||
makeAlert("Error", "Queue failed. Check your link to make sure it is valid.", "alert-error")
|
if(!data) {
|
||||||
|
data = "Queue failed. Check your link to make sure it is valid.";
|
||||||
|
}
|
||||||
|
makeAlert("Error", data, "alert-error")
|
||||||
.insertAfter($("#playlist_controls"));
|
.insertAfter($("#playlist_controls"));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -846,3 +838,9 @@ $.getScript(IO_URL+"/socket.io/socket.io.js", function() {
|
||||||
Callbacks.disconnect();
|
Callbacks.disconnect();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.setupNewSocket = function() {
|
||||||
|
for(var key in Callbacks) {
|
||||||
|
socket.on(key, Callbacks[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -53,25 +53,33 @@ function parseBool(x) {
|
||||||
else return Boolean(x);
|
else return Boolean(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOrDefault(cookie, def) {
|
getOrDefault = function(k, def) {
|
||||||
var cook = readCookie(cookie);
|
var v = localStorage.getItem(k);
|
||||||
if(cook === null) {
|
if(v === null)
|
||||||
return def;
|
return def;
|
||||||
}
|
if(v === "true")
|
||||||
return cook;
|
return true;
|
||||||
|
if(v === "false")
|
||||||
|
return false;
|
||||||
|
if(v.match(/[0-9]+/))
|
||||||
|
return parseInt(v);
|
||||||
|
if(v.match(/[0-9\.]+/))
|
||||||
|
return parseFloat(v);
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
var USEROPTS = {
|
var USEROPTS = {
|
||||||
theme : getOrDefault("cytube_theme", "default"),
|
theme : getOrDefault("theme", "default"),
|
||||||
css : getOrDefault("cytube_css", ""),
|
css : getOrDefault("css", ""),
|
||||||
layout : getOrDefault("cytube_layout", "default"),
|
layout : getOrDefault("layout", "default"),
|
||||||
synch : parseBool(getOrDefault("cytube_synch", true)),
|
synch : getOrDefault("synch", true),
|
||||||
hidevid : parseBool(getOrDefault("cytube_hidevid", false)),
|
hidevid : getOrDefault("hidevid", false),
|
||||||
show_timestamps : parseBool(getOrDefault("cytube_show_timestamps", false)),
|
show_timestamps : getOrDefault("show_timestamps", true),
|
||||||
modhat : parseBool(getOrDefault("cytube_modhat", false)),
|
modhat : getOrDefault("modhat", false),
|
||||||
blink_title : parseBool(getOrDefault("cytube_blink_title", false)),
|
blink_title : getOrDefault("blink_title", false),
|
||||||
sync_accuracy : parseFloat(getOrDefault("cytube_sync_accuracy", 2)) || 2,
|
sync_accuracy : getOrDefault("sync_accuracy", 2),
|
||||||
chatbtn : parseBool(getOrDefault("cytube_chatbtn", false))
|
chatbtn : getOrDefault("chatbtn", false),
|
||||||
|
altsocket : getOrDefault("altsocket", false)
|
||||||
};
|
};
|
||||||
applyOpts();
|
applyOpts();
|
||||||
$("#optlink").click(showUserOpts);
|
$("#optlink").click(showUserOpts);
|
||||||
|
@ -141,6 +149,18 @@ if(!USEROPTS.hidevid) {
|
||||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#ulistchevron").click(function() {
|
||||||
|
var state = $("#userlist").css("display");
|
||||||
|
if(state == "none") {
|
||||||
|
$("#userlist").show();
|
||||||
|
$("#ulistchevron").removeClass().addClass("icon-chevron-up");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#userlist").hide();
|
||||||
|
$("#ulistchevron").removeClass().addClass("icon-chevron-down");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var sendVideoUpdate = function() { }
|
var sendVideoUpdate = function() { }
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
sendVideoUpdate();
|
sendVideoUpdate();
|
||||||
|
@ -365,7 +385,8 @@ $("#opt_submit").click(function() {
|
||||||
customcss: css,
|
customcss: css,
|
||||||
customjs: $("#opt_customjs").val(),
|
customjs: $("#opt_customjs").val(),
|
||||||
chat_antiflood: $("#opt_chat_antiflood").prop("checked"),
|
chat_antiflood: $("#opt_chat_antiflood").prop("checked"),
|
||||||
show_public: $("#opt_show_public").prop("checked")
|
show_public: $("#opt_show_public").prop("checked"),
|
||||||
|
enable_link_regex: $("#opt_enable_link_regex").prop("checked")
|
||||||
};
|
};
|
||||||
socket.emit("channelOpts", opts);
|
socket.emit("channelOpts", opts);
|
||||||
});
|
});
|
||||||
|
|
|
@ -130,7 +130,7 @@ function addUserDropdown(entry, name) {
|
||||||
a.text("IP Ban");
|
a.text("IP Ban");
|
||||||
a.click(function() {
|
a.click(function() {
|
||||||
socket.emit("chatMsg", {
|
socket.emit("chatMsg", {
|
||||||
msg: "/ban " + name
|
msg: "/ipban " + name
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -499,7 +499,6 @@ function loadLoginlogPage(page) {
|
||||||
.text("Ban IP Range")
|
.text("Ban IP Range")
|
||||||
.appendTo(bantd);
|
.appendTo(bantd);
|
||||||
var callback = (function(id, name) { return function() {
|
var callback = (function(id, name) { return function() {
|
||||||
console.log(id, name);
|
|
||||||
socket.emit("banIP", {
|
socket.emit("banIP", {
|
||||||
id: id,
|
id: id,
|
||||||
name: name,
|
name: name,
|
||||||
|
@ -509,7 +508,6 @@ function loadLoginlogPage(page) {
|
||||||
} })(entries[i].id, entries[i].names[0]);
|
} })(entries[i].id, entries[i].names[0]);
|
||||||
ban.click(callback);
|
ban.click(callback);
|
||||||
var callback2 = (function(id, name) { return function() {
|
var callback2 = (function(id, name) { return function() {
|
||||||
console.log(id, name);
|
|
||||||
socket.emit("banIP", {
|
socket.emit("banIP", {
|
||||||
id: id,
|
id: id,
|
||||||
name: name,
|
name: name,
|
||||||
|
@ -561,6 +559,7 @@ function loadLoginlogPage(page) {
|
||||||
|
|
||||||
function loadACLPage(page) {
|
function loadACLPage(page) {
|
||||||
var entries = $("#channelranks").data("entries");
|
var entries = $("#channelranks").data("entries");
|
||||||
|
$("#channelranks").data("page", page);
|
||||||
var start = page * 20;
|
var start = page * 20;
|
||||||
var tbl = $("#channelranks table");
|
var tbl = $("#channelranks table");
|
||||||
if(tbl.children().length > 1) {
|
if(tbl.children().length > 1) {
|
||||||
|
@ -570,34 +569,42 @@ function loadACLPage(page) {
|
||||||
var tr = $("<tr/>").appendTo(tbl);
|
var tr = $("<tr/>").appendTo(tbl);
|
||||||
var name = $("<td/>").text(entries[i].name).appendTo(tr);
|
var name = $("<td/>").text(entries[i].name).appendTo(tr);
|
||||||
name.addClass(getNameColor(entries[i].rank));
|
name.addClass(getNameColor(entries[i].rank));
|
||||||
var rank = $("<td/>").text(entries[i].rank).appendTo(tr);
|
var rank = $("<td/>").text(entries[i].rank)
|
||||||
var control = $("<td/>").appendTo(tr);
|
.css("min-width", "220px")
|
||||||
var up = $("<button/>").addClass("btn btn-mini btn-success")
|
.appendTo(tr);
|
||||||
.appendTo(control);
|
(function(name) {
|
||||||
$("<i/>").addClass("icon-plus").appendTo(up);
|
rank.click(function() {
|
||||||
var down = $("<button/>").addClass("btn btn-mini btn-danger")
|
if(this.find(".rank-edit").length > 0)
|
||||||
.appendTo(control);
|
return;
|
||||||
$("<i/>").addClass("icon-minus").appendTo(down);
|
var r = this.text();
|
||||||
if(entries[i].rank + 1 >= RANK) {
|
this.text("");
|
||||||
up.attr("disabled", true);
|
var edit = $("<input/>").attr("type", "text")
|
||||||
}
|
.attr("placeholder", r)
|
||||||
else {
|
.addClass("rank-edit")
|
||||||
up.click(function(name) { return function() {
|
.appendTo(this)
|
||||||
socket.emit("promote", {
|
.focus();
|
||||||
name: name
|
if(parseInt(r) >= RANK) {
|
||||||
|
edit.attr("disabled", true);
|
||||||
|
}
|
||||||
|
function save() {
|
||||||
|
var r = this.val();
|
||||||
|
var r2 = r;
|
||||||
|
if(r.trim() == "" || parseInt(r) >= RANK || parseInt(r) < 1)
|
||||||
|
r = this.attr("placeholder");
|
||||||
|
r = parseInt(r) + "";
|
||||||
|
this.parent().text(r);
|
||||||
|
socket.emit("setChannelRank", {
|
||||||
|
user: name,
|
||||||
|
rank: parseInt(r)
|
||||||
});
|
});
|
||||||
}}(entries[i].name));
|
}
|
||||||
}
|
edit.blur(save.bind(edit));
|
||||||
if(entries[i].rank >= RANK) {
|
edit.keydown(function(ev) {
|
||||||
down.attr("disabled", true);
|
if(ev.keyCode == 13)
|
||||||
}
|
save.bind(edit)();
|
||||||
else {
|
});
|
||||||
down.click(function(name) { return function() {
|
}.bind(rank));
|
||||||
socket.emit("demote", {
|
})(entries[i].name);
|
||||||
name: name
|
|
||||||
});
|
|
||||||
}}(entries[i].name));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if($("#acl_pagination").length > 0) {
|
if($("#acl_pagination").length > 0) {
|
||||||
$("#acl_pagination").find("li").each(function() {
|
$("#acl_pagination").find("li").each(function() {
|
||||||
|
@ -669,6 +676,8 @@ function parseVideoURL(url){
|
||||||
return [parseVimeo(url), "vi"];
|
return [parseVimeo(url), "vi"];
|
||||||
else if(url.indexOf("dailymotion.com") != -1)
|
else if(url.indexOf("dailymotion.com") != -1)
|
||||||
return [parseDailymotion(url), "dm"];
|
return [parseDailymotion(url), "dm"];
|
||||||
|
else if(url.indexOf("imgur.com") != -1)
|
||||||
|
return [parseImgur(url), "im"];
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseYTURL(url) {
|
function parseYTURL(url) {
|
||||||
|
@ -743,6 +752,14 @@ function parseDailymotion(url) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function parseImgur(url) {
|
||||||
|
var m = url.match(/imgur\.com\/a\/([a-zA-Z0-9]+)/);
|
||||||
|
if(m) {
|
||||||
|
return m[1];
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
function closePoll() {
|
function closePoll() {
|
||||||
if($("#pollcontainer .active").length != 0) {
|
if($("#pollcontainer .active").length != 0) {
|
||||||
var poll = $("#pollcontainer .active");
|
var poll = $("#pollcontainer .active");
|
||||||
|
@ -1070,6 +1087,13 @@ function showUserOpts() {
|
||||||
sendbtn.prop("checked", USEROPTS.chatbtn);
|
sendbtn.prop("checked", USEROPTS.chatbtn);
|
||||||
addOption("Send Button", sendbtncontainer);
|
addOption("Send Button", sendbtncontainer);
|
||||||
|
|
||||||
|
var altsocketcontainer = $("<label/>").addClass("checkbox")
|
||||||
|
.text("Use alternative socket connection");
|
||||||
|
var altsocket = $("<input/>").attr("type", "checkbox")
|
||||||
|
.appendTo(altsocketcontainer);
|
||||||
|
altsocket.prop("checked", USEROPTS.altsocket);
|
||||||
|
addOption("Alternate Socket", altsocketcontainer);
|
||||||
|
|
||||||
var profile = $("<a/>").attr("target", "_blank")
|
var profile = $("<a/>").attr("target", "_blank")
|
||||||
.addClass("btn")
|
.addClass("btn")
|
||||||
.attr("href", "./account.html")
|
.attr("href", "./account.html")
|
||||||
|
@ -1100,6 +1124,7 @@ function showUserOpts() {
|
||||||
USEROPTS.show_timestamps = showts.prop("checked");
|
USEROPTS.show_timestamps = showts.prop("checked");
|
||||||
USEROPTS.blink_title = blink.prop("checked");
|
USEROPTS.blink_title = blink.prop("checked");
|
||||||
USEROPTS.chatbtn = sendbtn.prop("checked");
|
USEROPTS.chatbtn = sendbtn.prop("checked");
|
||||||
|
USEROPTS.altsocket = altsocket.prop("checked");
|
||||||
if(RANK >= Rank.Moderator) {
|
if(RANK >= Rank.Moderator) {
|
||||||
USEROPTS.modhat = modhat.prop("checked");
|
USEROPTS.modhat = modhat.prop("checked");
|
||||||
}
|
}
|
||||||
|
@ -1117,10 +1142,13 @@ function showUserOpts() {
|
||||||
|
|
||||||
function saveOpts() {
|
function saveOpts() {
|
||||||
for(var key in USEROPTS) {
|
for(var key in USEROPTS) {
|
||||||
createCookie("cytube_"+key, USEROPTS[key], 100);
|
localStorage.setItem(key, USEROPTS[key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// To be overridden in callbacks.js
|
||||||
|
function setupNewSocket() { }
|
||||||
|
|
||||||
function applyOpts() {
|
function applyOpts() {
|
||||||
$("#usertheme").remove();
|
$("#usertheme").remove();
|
||||||
if(USEROPTS.theme != "default") {
|
if(USEROPTS.theme != "default") {
|
||||||
|
@ -1179,6 +1207,22 @@ function applyOpts() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(USEROPTS.altsocket) {
|
||||||
|
if(socket)
|
||||||
|
socket.disconnect();
|
||||||
|
socket = new NotWebsocket();
|
||||||
|
setupNewSocket();
|
||||||
|
}
|
||||||
|
// Switch from NotWebsocket => Socket.io
|
||||||
|
else if(socket && typeof socket.poll !== "undefined") {
|
||||||
|
try {
|
||||||
|
socket = io.connect(IO_URL);
|
||||||
|
setupNewSocket();
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function idToURL(data) {
|
function idToURL(data) {
|
||||||
|
@ -1277,6 +1321,7 @@ function genPermissionsEditor() {
|
||||||
makeOption("Delete playlist items", "playlistdelete", standard, CHANPERMS.playlistdelete+"");
|
makeOption("Delete playlist items", "playlistdelete", standard, CHANPERMS.playlistdelete+"");
|
||||||
makeOption("Jump to video", "playlistjump", standard, CHANPERMS.playlistjump+"");
|
makeOption("Jump to video", "playlistjump", standard, CHANPERMS.playlistjump+"");
|
||||||
makeOption("Queue playlist", "playlistaddlist", standard, CHANPERMS.playlistaddlist+"");
|
makeOption("Queue playlist", "playlistaddlist", standard, CHANPERMS.playlistaddlist+"");
|
||||||
|
makeOption("Queue livestream", "playlistaddlive", standard, CHANPERMS.playlistaddlive+"");
|
||||||
makeOption("Add nontemporary media", "addnontemp", standard, CHANPERMS.addnontemp+"");
|
makeOption("Add nontemporary media", "addnontemp", standard, CHANPERMS.addnontemp+"");
|
||||||
makeOption("Temp/untemp playlist item", "settemp", standard, CHANPERMS.settemp+"");
|
makeOption("Temp/untemp playlist item", "settemp", standard, CHANPERMS.settemp+"");
|
||||||
makeOption("Retrieve playlist URLs", "playlistgeturl", standard, CHANPERMS.playlistgeturl+"");
|
makeOption("Retrieve playlist URLs", "playlistgeturl", standard, CHANPERMS.playlistgeturl+"");
|
||||||
|
|
|
@ -1,3 +1,14 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2013 Calvin Montgomery
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
var Media = function(data) {
|
var Media = function(data) {
|
||||||
if(!data) {
|
if(!data) {
|
||||||
data = {
|
data = {
|
||||||
|
@ -40,6 +51,9 @@ var Media = function(data) {
|
||||||
case "us":
|
case "us":
|
||||||
this.initUstream();
|
this.initUstream();
|
||||||
break;
|
break;
|
||||||
|
case "im":
|
||||||
|
this.initImgur();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
this.nullPlayer();
|
this.nullPlayer();
|
||||||
break;
|
break;
|
||||||
|
@ -456,6 +470,31 @@ Media.prototype.initUstream = function() {
|
||||||
this.seek = function() { }
|
this.seek = function() { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Media.prototype.initImgur = function() {
|
||||||
|
var iframe = $("<iframe/>").insertBefore($("#ytapiplayer"));
|
||||||
|
$("#ytapiplayer").remove();
|
||||||
|
iframe.attr("id", "ytapiplayer");
|
||||||
|
iframe.attr("width", VWIDTH);
|
||||||
|
iframe.attr("height", VHEIGHT);
|
||||||
|
iframe.attr("src", "http://imgur.com/a/"+this.id+"/embed");
|
||||||
|
iframe.attr("frameborder", "0");
|
||||||
|
iframe.attr("scrolling", "no");
|
||||||
|
iframe.css("border", "none");
|
||||||
|
|
||||||
|
this.load = function(data) {
|
||||||
|
this.id = data.id;
|
||||||
|
this.initImgur()
|
||||||
|
}
|
||||||
|
|
||||||
|
this.pause = function() { }
|
||||||
|
|
||||||
|
this.play = function() { }
|
||||||
|
|
||||||
|
this.getTime = function() { }
|
||||||
|
|
||||||
|
this.seek = function() { }
|
||||||
|
}
|
||||||
|
|
||||||
Media.prototype.update = function(data) {
|
Media.prototype.update = function(data) {
|
||||||
if(data.id && data.id != this.id) {
|
if(data.id && data.id != this.id) {
|
||||||
if(data.currentTime < 0) {
|
if(data.currentTime < 0) {
|
||||||
|
|
|
@ -0,0 +1,132 @@
|
||||||
|
/*
|
||||||
|
The MIT License (MIT)
|
||||||
|
Copyright (c) 2013 Calvin Montgomery
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var NotWebsocket = function() {
|
||||||
|
this.connected = false;
|
||||||
|
this.polltmr = false;
|
||||||
|
$.getJSON(WEB_URL + "/nws/connect", function(data) {
|
||||||
|
this.hash = data;
|
||||||
|
this.connected = true;
|
||||||
|
this.recv(["connect", undefined]);
|
||||||
|
this.pollint = 100;
|
||||||
|
this.pollonce();
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
|
this.handlers = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.pollonce = function() {
|
||||||
|
if(this.polltmr !== false)
|
||||||
|
clearTimeout(this.polltmr);
|
||||||
|
if(!this.connected)
|
||||||
|
return;
|
||||||
|
this.poll();
|
||||||
|
this.polltmr = setTimeout(function() {
|
||||||
|
this.pollonce();
|
||||||
|
}.bind(this), this.pollint);
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.poll = function() {
|
||||||
|
if(!this.connected)
|
||||||
|
return;
|
||||||
|
if(this.polling)
|
||||||
|
return;
|
||||||
|
$.getJSON(WEB_URL+"/nws/"+this.hash+"/poll?callback=?", function(data) {
|
||||||
|
this.polling = true;
|
||||||
|
// Adaptive polling rate
|
||||||
|
// Poll every 1000ms if no activity
|
||||||
|
// every 500ms if minor activity
|
||||||
|
// every 100ms is very active
|
||||||
|
if(data.length == 0) {
|
||||||
|
this.pollint = 1000;
|
||||||
|
}
|
||||||
|
else if(data.length < 10 && this.pollint < 500) {
|
||||||
|
this.pollint += 100;
|
||||||
|
}
|
||||||
|
else if(data.length > 10) {
|
||||||
|
this.pollint = 100;
|
||||||
|
}
|
||||||
|
for(var i = 0; i < data.length; i++) {
|
||||||
|
try {
|
||||||
|
this.recv(data[i]);
|
||||||
|
}
|
||||||
|
catch(e) { }
|
||||||
|
}
|
||||||
|
this.polling = false;
|
||||||
|
}.bind(this))
|
||||||
|
.fail(function() {
|
||||||
|
this.disconnect();
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.emit = function(msg, data) {
|
||||||
|
if(!this.connected) {
|
||||||
|
setTimeout(function() {
|
||||||
|
this.emit(msg, data);
|
||||||
|
}.bind(this), 100);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var pkt = [msg, data];
|
||||||
|
var str = escape(JSON.stringify(pkt)).replace(/\//g, "%2F");
|
||||||
|
$.getJSON(WEB_URL+"/nws/"+this.hash+"/"+str, function() {
|
||||||
|
// Poll more quickly because sending a packet usually means
|
||||||
|
// expecting some data to come back
|
||||||
|
this.pollint = 100;
|
||||||
|
this.pollonce();
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.reconnect = function() {
|
||||||
|
$.getJSON(WEB_URL + "/nws/connect", function(data) {
|
||||||
|
this.hash = data;
|
||||||
|
this.connected = true;
|
||||||
|
this.recv(["connect", undefined]);
|
||||||
|
this.pollint = setInterval(function() {
|
||||||
|
this.poll();
|
||||||
|
}.bind(this), 100);
|
||||||
|
}.bind(this))
|
||||||
|
.fail(function() {
|
||||||
|
if(this.reconndelay < 10000)
|
||||||
|
this.reconndelay += 500;
|
||||||
|
setTimeout(function() {
|
||||||
|
this.reconnect();
|
||||||
|
}.bind(this), this.reconndelay);
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.on = function(msg, callback) {
|
||||||
|
if(!(msg in this.handlers))
|
||||||
|
this.handlers[msg] = [];
|
||||||
|
this.handlers[msg].push(callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.recv = function(pkt) {
|
||||||
|
var msg = pkt[0], data = pkt[1];
|
||||||
|
if(!(msg in this.handlers)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for(var i = 0; i < this.handlers[msg].length; i++) {
|
||||||
|
this.handlers[msg][i](data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NotWebsocket.prototype.disconnect = function() {
|
||||||
|
this.recv(["disconnect", undefined]);
|
||||||
|
if(this.polltmr !== false)
|
||||||
|
clearTimeout(this.polltmr);
|
||||||
|
this.polltmr = false;
|
||||||
|
this.connected = false;
|
||||||
|
this.reconndelay = 1000;
|
||||||
|
setTimeout(function() {
|
||||||
|
this.reconnect();
|
||||||
|
}.bind(this), this.reconndelay);
|
||||||
|
}
|
||||||
|
|
|
@ -58,7 +58,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row" id="main" style="margin-top: 20px;">
|
<div class="row" id="main" style="margin-top: 20px;">
|
||||||
<div class="span5" id="chatdiv">
|
<div class="span5" id="chatdiv">
|
||||||
<p id="usercount"></p>
|
<div id="usercountcontainer">
|
||||||
|
<i class="icon-chevron-up" id="ulistchevron" title="Show/Hide Userlist"></i>
|
||||||
|
<p id="usercount"></p>
|
||||||
|
</div>
|
||||||
<div id="userlist">
|
<div id="userlist">
|
||||||
</div>
|
</div>
|
||||||
<div id="messagebuffer">
|
<div id="messagebuffer">
|
||||||
|
@ -209,6 +212,11 @@
|
||||||
<input type="checkbox" id="opt_show_public">
|
<input type="checkbox" id="opt_show_public">
|
||||||
Show channel publicly
|
Show channel publicly
|
||||||
</label>
|
</label>
|
||||||
|
<br>
|
||||||
|
<label class="checkbox">
|
||||||
|
<input type="checkbox" id="opt_enable_link_regex">
|
||||||
|
Convert URLs to links in chat messages
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="span10">
|
<div class="span10">
|
||||||
|
@ -288,8 +296,7 @@
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Rank</th>
|
<th>Rank (Click to edit)</th>
|
||||||
<th>Control</th>
|
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -310,6 +317,7 @@
|
||||||
<script src="./assets/js/jquery.js"></script>
|
<script src="./assets/js/jquery.js"></script>
|
||||||
<!-- My Javascript -->
|
<!-- My Javascript -->
|
||||||
<script src="./assets/js/iourl.js"></script>
|
<script src="./assets/js/iourl.js"></script>
|
||||||
|
<script src="./assets/js/notwebsocket.js"></script>
|
||||||
<script src="./assets/js/media.js"></script>
|
<script src="./assets/js/media.js"></script>
|
||||||
<script src="./assets/js/functions.js"></script>
|
<script src="./assets/js/functions.js"></script>
|
||||||
<script src="./assets/js/client.js"></script>
|
<script src="./assets/js/client.js"></script>
|
||||||
|
|
Loading…
Reference in New Issue