Added add song to other list from one list button in the controls bar

This commit is contained in:
Kasper Rynning-Tønnesen
2019-01-19 16:58:42 +01:00
parent 5f3c7890a0
commit dd9a58f810
4 changed files with 43 additions and 4 deletions

View File

@@ -415,8 +415,9 @@ function add_function(arr, coll, guid, offline, socket) {
}
db.collection(coll + "_settings").find(function(err, docs){
if(docs.length > 0 && (docs[0].userpass == undefined || docs[0].userpass == "" || (arr.hasOwnProperty('pass') && docs[0].userpass == arr.pass))) {
if((arr.hasOwnProperty("offsiteAdd") && !arr.offsiteAdd) || !arr.hasOwnProperty("offsiteAdd")) {
Functions.check_inlist(coll, guid, socket, offline, undefined, "place 5");
}
var id = arr.id + "";
var title = arr.title;
var hash = arr.adminpass;

View File

@@ -2610,6 +2610,8 @@ nav ul li:hover, nav ul li.active {
line-height: 31px;
}
.ui-slider-vertical {
width: .8em;
height: 100px;
@@ -2842,7 +2844,7 @@ nav ul li:hover, nav ul li.active {
width: 100vw !important;
}
#seekToDuration{
#seekToDuration, #addToListInput{
position: absolute;
background: #2d2d2d;
color:white;
@@ -2858,6 +2860,23 @@ nav ul li:hover, nav ul li.active {
pointer-events: none;
}
#addToListInput {
top: -105px;
right: 10px;
z-index: 999999;
pointer-events: all;
}
#addToListInput .input-field {
margin-right: 25px;
margin-top: 0px;
margin-bottom: 0px;
}
#addToListInput .input-field input {
color: white;
}
.ewresize{
cursor: ew-resize;
}

View File

@@ -987,6 +987,18 @@ function addDynamicListeners() {
Player.playVideo();
});
addListener("click", "#addToOtherList", function(event) {
this.preventDefault();
Helper.toggleClass("#addToListInput", "hide");
});
addListener("submit", "#addToOtherListForm", function() {
this.preventDefault();
emit("add", {offsiteAdd: true, id: Player.np.id, start: Player.np.start, end: Player.np.end, title: Player.np.title, list: document.getElementById("other-list-name-add").value.toLowerCase(), duration: Player.np.duration, source: Player.np.source, thumbnail: Player.np.thumbnail});
Helper.toggleClass("#addToListInput", "hide");
document.getElementById("other-list-name-add").value = "";
});
addListener("click", "#listExport", function(event){
this.preventDefault();
if(!youtube_authenticated){

View File

@@ -66,10 +66,17 @@
<div id="volume"></div>
</div>
<div id="viewers" data-position="top"></div>
<div id="addToOtherList" class="playbar-btn">
<div id="addToOtherList" class="playbar-btn hide-on-small-only">
<i class="material-icons">playlist_add</i>
</div>
<div id="bar"></div>
</div>
<div id="addToListInput" class="hide">
<div class="input-field field-settings">
<form action="#" id="addToOtherListForm" onsubmit="return false;">
<input placeholder="List-name" id="other-list-name-add" type="text" autocomplete="off">
</form>
</div>
</div>
</div>
</div>