mirror of https://github.com/calzoneman/sync.git
Add an in-place MOTD editor
This commit is contained in:
parent
436df375c7
commit
d09d7ad64e
13
changelog
13
changelog
|
@ -1,3 +1,16 @@
|
||||||
|
Wed Nov 13 22:35 2013 CDT
|
||||||
|
* www/assets/js/util.js, www/assets/js/ui.js,
|
||||||
|
www/assets/js/callbacks.js, www/channel.html:
|
||||||
|
Add an in-place MOTD editor
|
||||||
|
|
||||||
|
Sun Nov 10 22:24 2013 CDT
|
||||||
|
* www/assets/js/util.js: Add queueMessage function for displaying
|
||||||
|
warnings/errors
|
||||||
|
* lib/get-info.js: Add warning for videos blocked in certain
|
||||||
|
countries (ytv2)
|
||||||
|
* lib/user.js: If channel search turns up no results, youtube search
|
||||||
|
instead
|
||||||
|
|
||||||
Fri Nov 08 20:44 2013 CDT
|
Fri Nov 08 20:44 2013 CDT
|
||||||
* lib/channel.js, lib/chatcommand.js: Implement basic shadow mute
|
* lib/channel.js, lib/chatcommand.js: Implement basic shadow mute
|
||||||
command
|
command
|
||||||
|
|
|
@ -171,7 +171,11 @@ Callbacks = {
|
||||||
setMotd: function(data) {
|
setMotd: function(data) {
|
||||||
CHANNEL.motd = data.html;
|
CHANNEL.motd = data.html;
|
||||||
CHANNEL.motd_text = data.motd;
|
CHANNEL.motd_text = data.motd;
|
||||||
$("#motd").html(data.html);
|
if ($("#motdwrap").find(".motdeditor").length > 0) {
|
||||||
|
$("#motdwrap .motdeditor").val(CHANNEL.motd_text);
|
||||||
|
} else {
|
||||||
|
$("#motd").html(CHANNEL.motd);
|
||||||
|
}
|
||||||
$("#motdtext").val(CHANNEL.motd_text);
|
$("#motdtext").val(CHANNEL.motd_text);
|
||||||
if(data.motd != "") {
|
if(data.motd != "") {
|
||||||
$("#motdwrap").show();
|
$("#motdwrap").show();
|
||||||
|
|
|
@ -45,6 +45,8 @@ generateToggle("#librarytoggle", "#librarywrap");
|
||||||
generateToggle("#userpltoggle", "#userplaylistwrap");
|
generateToggle("#userpltoggle", "#userplaylistwrap");
|
||||||
generateToggle("#playlisttoggle", "#playlist_controls");
|
generateToggle("#playlisttoggle", "#playlist_controls");
|
||||||
|
|
||||||
|
$("#editmotd").click(showMOTDEditor);
|
||||||
|
|
||||||
$("#togglemotd").click(function () {
|
$("#togglemotd").click(function () {
|
||||||
var hidden = $("#motd").css("display") === "none";
|
var hidden = $("#motd").css("display") === "none";
|
||||||
$("#motd").toggle();
|
$("#motd").toggle();
|
||||||
|
|
|
@ -1034,6 +1034,7 @@ function handleModPermissions() {
|
||||||
$("#csstext").val(CHANNEL.css);
|
$("#csstext").val(CHANNEL.css);
|
||||||
$("#jstext").val(CHANNEL.js);
|
$("#jstext").val(CHANNEL.js);
|
||||||
$("#motdtext").val(CHANNEL.motd_text);
|
$("#motdtext").val(CHANNEL.motd_text);
|
||||||
|
setVisible("#editmotd", hasPermission("motdedit"));
|
||||||
setVisible("#permedit_tab", CLIENT.rank >= 3);
|
setVisible("#permedit_tab", CLIENT.rank >= 3);
|
||||||
setVisible("#banlist_tab", hasPermission("ban"));
|
setVisible("#banlist_tab", hasPermission("ban"));
|
||||||
setVisible("#motdedit_tab", hasPermission("motdedit"));
|
setVisible("#motdedit_tab", hasPermission("motdedit"));
|
||||||
|
@ -1812,3 +1813,26 @@ function queueMessage(data, type) {
|
||||||
.addClass("span12 qfalert qf-" + type)
|
.addClass("span12 qfalert qf-" + type)
|
||||||
.appendTo($("#queuefail"));
|
.appendTo($("#queuefail"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showMOTDEditor() {
|
||||||
|
var motd = $("#motd");
|
||||||
|
motd.html("");
|
||||||
|
var text = $("<textarea/>")
|
||||||
|
.addClass("motdeditor input-block-level")
|
||||||
|
.attr("rows", "10")
|
||||||
|
.val(CHANNEL.motd_text)
|
||||||
|
.css("width", "100%")
|
||||||
|
.css("height", "100%")
|
||||||
|
.appendTo($("#motdwrap"))
|
||||||
|
.blur(function () {
|
||||||
|
socket.emit("setMotd", {
|
||||||
|
motd: text.val()
|
||||||
|
});
|
||||||
|
$("#motdwrap .motdeditor").remove();
|
||||||
|
$("#editmotd").show();
|
||||||
|
$("#togglemotd").show();
|
||||||
|
})
|
||||||
|
.focus();
|
||||||
|
$("#editmotd").hide();
|
||||||
|
$("#togglemotd").hide();
|
||||||
|
}
|
||||||
|
|
|
@ -55,7 +55,8 @@
|
||||||
<!-- top row (MOTD, drink count) -->
|
<!-- top row (MOTD, drink count) -->
|
||||||
<div class="row-fluid" id="toprow">
|
<div class="row-fluid" id="toprow">
|
||||||
<div class="well" id="motdwrap">
|
<div class="well" id="motdwrap">
|
||||||
<button class="close pull-right" id="togglemotd"><i class="icon-minus"></i></button>
|
<button class="close pull-right" id="togglemotd"><i class="icon-minus" title="Show/Hide MOTD"></i></button>
|
||||||
|
<button class="close pull-right" id="editmotd" style="display: none"><i class="icon-file" title="Edit MOTD"></i></button>
|
||||||
<div id="motd"></div>
|
<div id="motd"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="drinkbar">
|
<div id="drinkbar">
|
||||||
|
|
|
@ -110,6 +110,8 @@
|
||||||
<div id="permedit" class="span12">
|
<div id="permedit" class="span12">
|
||||||
</div>
|
</div>
|
||||||
<div id="motdedit" class="span12">
|
<div id="motdedit" class="span12">
|
||||||
|
<strong>Notice:</strong>
|
||||||
|
The MOTD can now be edited in-place by clicking the small page icon next to the minus/plus icon. This editor is left in place for legacy purposes.
|
||||||
<textarea rows="10" id="motdtext"></textarea>
|
<textarea rows="10" id="motdtext"></textarea>
|
||||||
<button class="btn btn-primary" id="save_motd">Save</button>
|
<button class="btn btn-primary" id="save_motd">Save</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue