From 823e9bef33b29836efecbbddcc2a2105dfb591d5 Mon Sep 17 00:00:00 2001 From: calzoneman Date: Wed, 19 Jun 2013 17:56:52 -0400 Subject: [PATCH] Remove old files --- www/assets/js/acp.js | 135 --- www/assets/js/client.js | 756 --------------- www/assets/js/functions.js | 1388 ---------------------------- www/assets/js/media.js | 556 ----------- www/assets/js/webtoolkit.sha256.js | 127 --- 5 files changed, 2962 deletions(-) delete mode 100644 www/assets/js/acp.js delete mode 100644 www/assets/js/client.js delete mode 100644 www/assets/js/functions.js delete mode 100644 www/assets/js/media.js delete mode 100644 www/assets/js/webtoolkit.sha256.js diff --git a/www/assets/js/acp.js b/www/assets/js/acp.js deleted file mode 100644 index 4bcce38c..00000000 --- a/www/assets/js/acp.js +++ /dev/null @@ -1,135 +0,0 @@ -/* -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 RANK = 0; -var uname = readCookie("sync_uname"); -var pw = readCookie("sync_pw"); -var manageChannel = false; - -var Rank = { - Guest: 0, - Member: 1, - Moderator: 2, - Owner: 3, - Siteadmin: 255 -}; - -var socket = io.connect(IO_URL); -initCallbacks(); - -function initCallbacks() { - - socket.on("adm", function(data) { - console.log(data); - if(data.cmd == "listchannels") - handleChannelList(data); - }); - - socket.on("login", function(data) { - if(data.success && $("#password").val()) { - createCookie("sync_uname", uname, 1); - createCookie("sync_pw", pw, 1); - } - if(data.success) { - $("#loggedin").css("display", ""); - $("#logoutform").css("display", ""); - $("#loginform").css("display", "none"); - } - setInterval(function() { - socket.emit("adm", { - cmd: "listchannels" - }); - }, 10000); - socket.emit("adm", { - cmd: "listchannels" - }); - }); -} - -function handleChannelList(data) { - if($("#chanlist").children.length > 1) - $($("#chanlist").children()[1]).remove(); - for(var i = 0; i < data.chans.length; i++) { - var row = $("").appendTo($("#chanlist")); - var name = $("").appendTo(row).text(data.chans[i].name); - var usercount = $("").appendTo(row).text(data.chans[i].usercount); - var nowplaying = $("").appendTo(row).text(data.chans[i].nowplaying); - } -} - -var params = {}; -if(window.location.search) { - var parameters = window.location.search.substring(1).split("&"); - for(var i = 0; i < parameters.length; i++) { - var s = parameters[i].split("="); - if(s.length != 2) - continue; - params[s[0]] = s[1]; - } -} - -if(uname != null && pw != null && pw != "false") { - socket.emit("login", { - name: uname, - pw: pw - }); -} - -function loginClick() { - uname = $("#username").val(); - pw = $("#password").val(); - socket.emit("login", { - name: uname, - pw: pw - }); -}; - -$("#login").click(loginClick); -$("#username").keydown(function(ev) { - if(ev.key == 13) - loginClick(); -}); -$("#password").keydown(function(ev) { - if(ev.key == 13) - loginClick(); -}); - -$("#logout").click(function() { - eraseCookie("sync_uname"); - eraseCookie("sync_pw"); - document.location.reload(true); -}); - - -function createCookie(name,value,days) { - if (days) { - var date = new Date(); - date.setTime(date.getTime()+(days*24*60*60*1000)); - var expires = "; expires="+date.toGMTString(); - } - else var expires = ""; - document.cookie = name+"="+value+expires+"; path=/"; -} - -function readCookie(name) { - var nameEQ = name + "="; - var ca = document.cookie.split(";"); - for(var i=0;i < ca.length;i++) { - var c = ca[i]; - while (c.charAt(0)==" ") c = c.substring(1,c.length); - if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); - } - return null; -} - -function eraseCookie(name) { - createCookie(name,"",-1); -} diff --git a/www/assets/js/client.js b/www/assets/js/client.js deleted file mode 100644 index 9982be90..00000000 --- a/www/assets/js/client.js +++ /dev/null @@ -1,756 +0,0 @@ -/* -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 socket; -var LEADER = false; -var PLAYER = new Media(); -var MEDIATYPE = "null"; -var POSITION = -1; -var RANK = -1; -var OPENQUEUE = false; -var CHANNELOPTS = {}; -var CHANPERMS = {}; -var GRABBEDLI = null; -var OLDINDEX = -1; -var CHATHIST = []; -var CHATHISTIDX = 0; -var FOCUSED = true; -var SCROLLCHAT = true; -var LASTCHATNAME = ""; -var LASTCHATTIME = 0; -var PAGETITLE = "Sync"; -var TITLE_BLINK; -var VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", "");//670 -var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16); -$("#messagebuffer").css("height", (VHEIGHT - 31) + "px"); -$("#userlist").css("height", (VHEIGHT - 31) + "px"); -var IGNORED = []; -var KICKED = false; -var CHANNEL = ""; -var CUSTOMJS = ""; -var uname = readCookie("sync_uname"); -var session = readCookie("sync_session"); -var PROFILE = { - image: "", - text: "" -}; - -function parseBool(x) { - if(typeof x == "boolean") - return x; - else if(x == "true") - return true; - else if(x == "false") - return false; - else return Boolean(x); -} - -getOrDefault = function(k, def) { - var v = localStorage.getItem(k); - if(v === null) - return def; - if(v === "true") - 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 = { - theme : getOrDefault("theme", "default"), - css : getOrDefault("css", ""), - layout : getOrDefault("layout", "default"), - synch : getOrDefault("synch", true), - hidevid : getOrDefault("hidevid", false), - show_timestamps : getOrDefault("show_timestamps", true), - modhat : getOrDefault("modhat", false), - blink_title : getOrDefault("blink_title", false), - sync_accuracy : getOrDefault("sync_accuracy", 2), - chatbtn : getOrDefault("chatbtn", false), - altsocket : getOrDefault("altsocket", false) -}; -applyOpts(); -$("#optlink").click(showUserOpts); -$("#sitefooter").load("footer.html"); - -var Rank = { - Guest: 0, - Member: 1, - Moderator: 2, - Owner: 3, - Siteadmin: 255 -}; - - -$(window).focus(function() { - FOCUSED = true; - onWindowFocus(); -}) -.blur(function() { - FOCUSED = false; -}); - -$(window).resize(function() { - VWIDTH = $("#ytapiplayer").parent().css("width").replace("px", ""); - var VHEIGHT = ""+parseInt(parseInt(VWIDTH) * 9 / 16); - $("#messagebuffer").css("height", (VHEIGHT - 31) + "px"); - $("#userlist").css("height", (VHEIGHT - 31) + "px"); - $("#ytapiplayer").attr("width", VWIDTH); - $("#ytapiplayer").attr("height", VHEIGHT); -}); - -// 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) { - CHANNEL = m[1]; -} -else { - var main = $($(".container")[1]); - var container = $("
").addClass("container").insertBefore(main); - var row = $("
").addClass("row").appendTo(container); - var div = $("
").addClass("span6").appendTo(row); - main.css("display", "none"); - var label = $("