mirror of https://github.com/calzoneman/sync.git
Allow renaming Custom Embed items (#255)
This commit is contained in:
parent
1294a7bd50
commit
36445bed6e
|
@ -1229,6 +1229,9 @@ Channel.prototype.tryQueue = function(user, data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(typeof data.title !== "string")
|
||||||
|
data.title = false;
|
||||||
|
|
||||||
var count = this.playlist.count(data.id);
|
var count = this.playlist.count(data.id);
|
||||||
|
|
||||||
if(user.rank < Rank.Moderator && count >= 5) {
|
if(user.rank < Rank.Moderator && count >= 5) {
|
||||||
|
@ -1277,6 +1280,8 @@ Channel.prototype.addMedia = function(data, user) {
|
||||||
: this.opts.maxlength;
|
: this.opts.maxlength;
|
||||||
|
|
||||||
var postAdd = function (item, cached) {
|
var postAdd = function (item, cached) {
|
||||||
|
if(item.media.type === "cu" && data.title)
|
||||||
|
item.media.title = data.title;
|
||||||
self.logger.log("### " + user.name + " queued " + item.media.title);
|
self.logger.log("### " + user.name + " queued " + item.media.title);
|
||||||
self.sendAll("queue", {
|
self.sendAll("queue", {
|
||||||
item: item.pack(),
|
item: item.pack(),
|
||||||
|
|
|
@ -279,12 +279,18 @@ $("#queue").disableSelection();
|
||||||
|
|
||||||
function queue(pos) {
|
function queue(pos) {
|
||||||
if($("#customembed_code").val()) {
|
if($("#customembed_code").val()) {
|
||||||
|
var title = false;
|
||||||
|
if($("#customembed_title").val()) {
|
||||||
|
title = $("#customembed_title").val();
|
||||||
|
}
|
||||||
socket.emit("queue", {
|
socket.emit("queue", {
|
||||||
id: $("#customembed_code").val(),
|
id: $("#customembed_code").val(),
|
||||||
|
title: title,
|
||||||
type: "cu",
|
type: "cu",
|
||||||
pos: pos
|
pos: pos
|
||||||
});
|
});
|
||||||
$("#customembed_code").val("");
|
$("#customembed_code").val("");
|
||||||
|
$("#customembed_title").val("");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var links = $("#mediaurl").val().split(",");
|
var links = $("#mediaurl").val().split(",");
|
||||||
|
|
|
@ -180,6 +180,7 @@
|
||||||
<div id="customembed_entry" style="display: none;">
|
<div id="customembed_entry" style="display: none;">
|
||||||
Paste the embed code below and hit Next or End. Acceptable embed codes are <code><iframe></code> and <code><object></code> tags.
|
Paste the embed code below and hit Next or End. Acceptable embed codes are <code><iframe></code> and <code><object></code> tags.
|
||||||
<textarea rows="3" class="input-block-level" id="customembed_code"></textarea>
|
<textarea rows="3" class="input-block-level" id="customembed_code"></textarea>
|
||||||
|
<input type="text" class="input-block-level" id="customembed_title" placeholder="(Optional) Title">
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue