From 6046ea2480d8efa069fcebb82478cd4e0124c8e4 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Tue, 20 May 2014 20:11:40 -0700 Subject: [PATCH] Fix the wrong files being merged --- www/js/callbacks.js | 29 ++++++++++++----------- www/js/player.js | 8 ++++--- www/js/ui.js | 2 +- www/js/util.js | 58 +++++++++++++++++++++++++++++---------------- 4 files changed, 59 insertions(+), 38 deletions(-) diff --git a/www/js/callbacks.js b/www/js/callbacks.js index caf2ae91..435812fa 100644 --- a/www/js/callbacks.js +++ b/www/js/callbacks.js @@ -132,7 +132,7 @@ Callbacks = { $("#needpw").remove(); }, - chatCooldown: function (time) { + cooldown: function (time) { time = time + 200; $("#chatline").css("color", "#ff0000"); if (CHATTHROTTLE && $("#chatline").data("throttle_timer")) { @@ -189,21 +189,17 @@ Callbacks = { setMotd: function(data) { CHANNEL.motd = data.html; CHANNEL.motd_text = data.motd; - if ($("#motdwrap").find(".motdeditor").length > 0) { - $("#motdwrap .motdeditor").val(CHANNEL.motd_text); - } else { - $("#motd").html(CHANNEL.motd); - } - $("#motdtext").val(CHANNEL.motd_text); - if(data.motd != "") { + $("#motd").html(CHANNEL.motd); + $("#cs-motdtext").val(CHANNEL.motd_text); + if (data.motd != "") { $("#motdwrap").show(); $("#motd").show(); $("#togglemotd").find(".glyphicon-plus") .removeClass("glyphicon-plus") .addClass("glyphicon-minus"); - } - else + } else { $("#motdwrap").hide(); + } }, chatFilters: function(entries) { @@ -360,9 +356,13 @@ Callbacks = { }, channelRankFail: function (data) { - makeAlert("Error", data.msg, "alert-danger") - .removeClass().addClass("vertical-spacer") - .insertAfter($("#cs-chanranks form")); + if ($("#cs-chanranks").is(":visible")) { + makeAlert("Error", data.msg, "alert-danger") + .removeClass().addClass("vertical-spacer") + .insertAfter($("#cs-chanranks form")); + } else { + Callbacks.noflood({ action: "/rank", msg: data.msg }); + } }, readChanLog: function (data) { @@ -1110,7 +1110,8 @@ try { io.transports.splice(i, 1); } } - if (ALLOW_SSL && (location.protocol === "https:" || USEROPTS.secure_connection)) { + + if (IO_URL === IO_URLS["ipv4-ssl"] || IO_URL === IO_URLS["ipv6-ssl"]) { socket = io.connect(IO_URL, { secure: true }); } else { socket = io.connect(IO_URL); diff --git a/www/js/player.js b/www/js/player.js index 0750d814..12271e9d 100644 --- a/www/js/player.js +++ b/www/js/player.js @@ -1094,15 +1094,17 @@ var GoogleDocsPlayer = function (data) { self.videoLength = data.seconds; self.paused = false; var wmode = USEROPTS.wmode_transparent ? "transparent" : "opaque"; - self.player = $("", data.object)[0]; - $(self.player).attr("data", data.object.data); + var meta = data.meta; + self.player = $("", meta.object)[0]; + $(self.player).attr("data", meta.object.data); $(self.player).attr("width", VWIDTH) .attr("height", VHEIGHT); - data.params.forEach(function (p) { + meta.params.forEach(function (p) { $("", p).appendTo(self.player); }); removeOld($(self.player)); self.setVolume(VOLUME); + resizeStuff(); }; self.load = function (data) { diff --git a/www/js/ui.js b/www/js/ui.js index 17d1d97c..9f68ba9a 100644 --- a/www/js/ui.js +++ b/www/js/ui.js @@ -493,7 +493,7 @@ if (location.protocol === "https:") { function chanrankSubmit(rank) { var name = $("#cs-chanranks-name").val(); socket.emit("setChannelRank", { - user: name, + name: name, rank: rank }); } diff --git a/www/js/util.js b/www/js/util.js index 822d1125..2522d513 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -238,7 +238,8 @@ function addUserDropdown(entry) { .click(function () { var reason = prompt("Enter kick reason (optional)"); socket.emit("chatMsg", { - msg: "/kick " + name + " " + reason + msg: "/kick " + name + " " + reason, + meta: {} }); }) .appendTo(btngroup); @@ -250,33 +251,27 @@ function addUserDropdown(entry) { .text("Mute") .click(function () { socket.emit("chatMsg", { - msg: "/mute " + name + msg: "/mute " + name, + meta: {} }); - mute.hide(); - smute.hide(); - unmute.show(); }) .appendTo(btngroup); var smute = $("