Added functionality to add songs from another channel

This commit is contained in:
Kasper Rynning-Tønnesen
2018-03-21 15:01:14 +01:00
parent 8d14b14c65
commit 859062204c
13 changed files with 230 additions and 34 deletions

View File

@@ -334,7 +334,7 @@ li.disabled span {
color: white !important;
}
.import-spotify-auth, .import-youtube, .export-spotify-auth, .export-youtube, .exported-playlist{
.import-spotify-auth, .import-youtube, .export-spotify-auth, .export-youtube, .exported-playlist, .import-zoff{
color:white !important;
height:40px !important;
line-height: 40px !important;
@@ -701,7 +701,7 @@ input[type=text]:focus:not([readonly]) + label, input[type=password]:focus:not([
background-color: #ff9800 !important;
}
#import, #import_spotify{
#import, #import_spotify, #import_zoff{
width: 65%;
padding-left: 35px;
color: rgb(68,68,68);
@@ -710,6 +710,10 @@ input[type=text]:focus:not([readonly]) + label, input[type=password]:focus:not([
height: 64px;
}
#import_zoff {
width: 100%;
}
#password{
width: 84%;
margin-left: 30px;
@@ -1194,6 +1198,14 @@ margin:-1px;
top:20px;
}
.zoff-image-import {
height: 36px;
}
.zoff-color {
background: #2d2d2d !important;
}
.side_away {
-webkit-transition: all .3s !important;
-moz-transition: all .3s !important;

View File

@@ -596,6 +596,12 @@ function change_offline(enabled, already_offline){
function toast(msg) {
switch(msg) {
case "other_list_pass":
msg = "The other list has a pass, can't import the songs..";
break;
case "nolist":
msg = "There is no list with that name";
break;
case "suggested_thumbnail":
if(embed) return;
msg = "The thumbnail has been suggested!";

View File

@@ -876,6 +876,22 @@ $(document).on("submit", "#listImport", function(e){
document.getElementById("import").value = "";
});
$(document).on("submit", "#listImportZoff", function(e) {
e.preventDefault();
var new_channel = $("#import_zoff").val();
if(new_channel == "") {
Materialize.toast("It seems you've entered a invalid channel-name.", 4000);
return;
}
socket.emit("import_zoff", {channel: chan.toLowerCase(), new_channel: new_channel.toLowerCase()});
});
$(document).on("click", ".import-zoff", function(e) {
e.preventDefault();
$(".import-zoff-container").addClass("hide");
$(".zoff_add_field").removeClass("hide");
});
$(document).on("submit", "#listImportSpotify", function(e){
e.preventDefault();
if(spotify_authenticated && $("#import_spotify").val() !== ""){

View File

@@ -332,6 +332,24 @@
</form>
</div>
</li>
<li class="white-bg">
<div class="input-field field-settings import-buttons import-zoff-container">
<a class="waves-effect zoff-color lighten btn import-zoff" title="Import Zoff playlist">
<img src="/assets/images/z.svg" class="left zoff-logo zoff-image-import" alt="Zoff Logo" />Zoff
</a>
</div>
<div class="input-field field-settings zoff_add_field hide">
<form action="#" id="listImportZoff">
<i class="material-icons import-icon">playlist_add</i>
<input title="Input Zoff-playlist name here!" placeholder="Enter Zoff-list" id="import_zoff" type="text" class="validate" autocomplete="off" />
<div id="playlist_loader_zoff" class="valign playlist_loader_padding hide">
<div class="preloader-wrapper small active">
{{> spinner}}
</div>
</div>
</form>
</div>
</li>
<li class="not-imported white-bg hide">
<div class="center-align">Not imported</div>
<ul class="input-field field-settings not-imported-container">