Removing toasts when new toasts appear, and added a small fix for w3cvalidator

This commit is contained in:
Kasper Rynning-Tønnesen
2017-02-22 22:55:30 +01:00
parent 4efa995599
commit 7f23474b6d
11 changed files with 50 additions and 32 deletions

View File

@@ -652,11 +652,11 @@ display: inline-flex;
width: 100%;
}
.card-action #del {
color:white;
.card-action .delete_button {
color:white !important;
}
.card-action #del:hover{
color:grey;
.card-action .delete_button:hover{
color:grey !important;
}
.share, .shareface{
@@ -1626,15 +1626,15 @@ nav ul li:hover, nav ul li.active {
background: transparent;
}
#del, #del_suggested, #del_user_suggested{
.delete_button, .del_suggested, .del_user_suggested{
position: absolute;
text-align: right;
right: -35%;
/* top: 45%; */
height: 19px;
line-height: normal;
padding: 2px 12px;
color: white;
padding: 2px 12px !important;
color: white !important;
background: transparent;
width: initial;
border-top: 1px solid rgba(160,160,160,0.2);
@@ -1971,16 +1971,18 @@ nav ul li:hover, nav ul li.active {
width: 57%;
}
#del, #del_suggested, #del_user_suggested{
.delete_button, .del_suggested, .del_user_suggested{
bottom: -9px;
/* line-height: inherit; */
height:auto;
display: flex;
align-items: center;
border-top: none;
padding: 0px !important;
margin: 0px !important;
}
#del .material-icons, #del_suggested .material-icons, #del_user_suggested .material-icons{
.delete_button .material-icons, .del_suggested .material-icons, .del_user_suggested .material-icons{
font-size: 2.5rem;
}
@@ -2178,6 +2180,7 @@ nav ul li:hover, nav ul li.active {
width: calc(100vw - 170px);
max-width: 100%;
font-size:2rem;
padding-right:0px;
}
.control-list li a{ min-width: 0px; width: 37px; padding: 0 0 0 0px;}
@@ -2556,3 +2559,8 @@ nav ul li:hover, nav ul li.active {
0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
100% {background-position: 500px 500px, 400px 400px, 300px 300px;}
}
* {
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-moz-tap-highlight-color: rgba(0, 0, 0, 0);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -91,6 +91,7 @@ var Admin = {
msg="Seems the song you want is already playing. No fooling the system!";
break;
}
before_toast();
Materialize.toast(msg, 4000);
},
@@ -167,6 +168,7 @@ var Admin = {
},
log_out: function(){
before_toast();
if(Crypt.get_pass(chan.toLowerCase())){
Crypt.remove_pass(chan.toLowerCase());
Admin.display_logged_out();

View File

@@ -423,8 +423,10 @@ function initfp(){
}
//window.channel_list = channel_list;
if(!localStorage.ok_cookie)
if(!localStorage.ok_cookie){
before_toast();
Materialize.toast("We're using cookies to enhance your experience! <a class='waves-effect waves-light btn light-green' href='#' id='cookieok' style='cursor:pointer;pointer-events:all;'> ok</a>", 10000);
}
var pad = 0;
document.getElementById("zicon").addEventListener("click", function(){

View File

@@ -265,8 +265,7 @@ var List = {
} else {
$("#wrapper").children().slice(List.page - List.can_fit, List.page).show();
$("#wrapper").children().slice(List.page, List.page + List.can_fit).hide();
List.page = List.page - List.can_fit;
//$("#wrapper").scrollTop(0);
List.page = List.page - List.can_fit < 0 ? 0 : List.page - List.can_fit;
if(List.page == 0 && $(".prev_page").css("display") != "none"){
$(".prev_page").css("display", "none");
$(".prev_page_hide").css("display", "inline-flex");
@@ -286,6 +285,7 @@ var List = {
$(".last_page_hide").css("display", "none");
$(".last_page").css("display", "inline-flex");
}
}
$("#pageNumber").html((List.page / List.can_fit) + 1);
},
@@ -847,7 +847,7 @@ var List = {
song.find(".card").css("display", "none");
}
attr = ".vote-container";
del_attr = "del";
del_attr = "delete_button";
var _temp_duration = Helper.secondsToOther(_song_info.duration);
song.find(".card-duration").text(Helper.pad(_temp_duration[0]) + ":" + Helper.pad(_temp_duration[1]));
@@ -864,7 +864,7 @@ var List = {
song.find(".vote-container").attr("class", "clickable add-suggested");
song.find(".add-suggested").attr("title", video_title);
song.find("#del").attr("id", del_attr);
song.find(".delete_button").addClass(del_attr);
song.find(attr).attr("data-video-title", video_title);
song.find(attr).attr("data-video-length", _song_info.length);
song.find("#list-song").attr("id", "suggested-" + video_id);
@@ -878,7 +878,7 @@ var List = {
song.find(attr).attr("data-video-id", video_id);
song.find(".list-image").attr(image_attr,video_thumb);
song.find(".list-suggested-image").attr(image_attr,video_thumb);
song.find("#"+del_attr).attr("data-video-id", video_id);
song.find("."+del_attr).attr("data-video-id", video_id);
//song.find("#del").attr("onclick", "vote('"+video_id+"', 'del')");
return song.html();

View File

@@ -1140,6 +1140,7 @@ $(document).on("submit", "#listImport", function(e){
$("#import").addClass("hide");
$("#playlist_loader").removeClass("hide");
} else {
before_toast();
Materialize.toast("It seems you've entered a invalid url.", 4000);
}
document.getElementById("import").value = "";
@@ -1161,6 +1162,7 @@ $(document).on("submit", "#listImportSpotify", function(e){
Search.importSpotifyPlaylist('https://api.spotify.com/v1/users/' + user + '/playlists/' + playlist_id + '/tracks');
} else {
before_toast();
Materialize.toast("It seems you've entered a invalid url.", 4000);
}
}
@@ -1403,7 +1405,7 @@ $(document).on( "click", ".vote-container", function(e){
List.vote(id, "pos");
});
$(document).on( "click", "#del", function(e){
$(document).on( "click", ".delete_button", function(e){
var id = $(this).attr("data-video-id");
List.vote(id, "del");
});
@@ -1418,13 +1420,13 @@ $(document).on( "click", ".add-suggested", function(e){
$("#suggested-" + id).remove();
});
$(document).on( "click", "#del_suggested", function(e){
$(document).on( "click", ".del_suggested", function(e){
var id = $(this).attr("data-video-id");
$("#suggested-" + id).remove();
});
$(document).on( "click", "#del_user_suggested", function(e){
$(document).on( "click", ".del_user_suggested", function(e){
var id = $(this).attr("data-video-id");
$("#suggested-" + id).remove();
List.vote(id, "del");
@@ -1550,6 +1552,10 @@ function share_link_modifier_channel(){
$("#qr-code-image-link").attr("src", "//chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://zoff.no/" + chan.toLowerCase() + "&choe=UTF-8&chld=L%7C1");
}
function before_toast(){
$("#toast-container").remove();
}
function onepage_load(){
var url_split = window.location.href.split("/");

View File

@@ -315,6 +315,7 @@ var Search = {
document.getElementById("import").disabled = false;
$("#playlist_loader").addClass("hide");
$("#import").removeClass("hide");
before_toast();
Materialize.toast("It seems you've entered a invalid url.", 4000);
}
@@ -356,6 +357,7 @@ var Search = {
document.getElementById("import_spotify").disabled = false;
$("#import_spotify").removeClass("hide");
$("#playlist_loader_spotify").addClass("hide");
before_toast();
Materialize.toast("It seems you've entered a invalid url.", 4000);
}
});

View File

@@ -231,8 +231,8 @@
</span>
</div>
<div class="card-action center-align list-remove hide">
<a title="Remove song" id="del" class="waves-effect btn-flat clickable hide-on-small-only">Delete</a>
<a title="Remove song" id="del" class="waves-effect btn-flat clickable hide-on-med-and-up"><i class="material-icons">close</i></a>
<a title="Remove song" class="waves-effect btn-flat clickable hide-on-small-only delete_button">Delete</a>
<a title="Remove song" class="waves-effect btn-flat clickable hide-on-med-and-up delete_button"><i class="material-icons">close</i></a>
</div>
</div>
</div>

View File

@@ -91,8 +91,7 @@ if(isset($_GET['chan'])){
placeholder="chill"
title="Type channel name here to create or listen to a channel. Only alphanumerical chars. [a-zA-Z0-9]+"
autocomplete="off"
autofocus="on"
list="searches"
autofocus
required
pattern="[a-zA-Z0-9]+"
spellcheck="false"
@@ -117,7 +116,6 @@ if(isset($_GET['chan'])){
name="chan"
title="Type channel name here to create or listen to a channel. Only alphanumerical chars. [a-zA-Z0-9]+"
autocomplete="off"
list="searches"
required pattern="[a-zA-Z0-9]+"
spellcheck="false"
maxlength="18"

View File

@@ -1,8 +1,8 @@
<li class="no-padding">
<ul class="collapsible collapsible-accordion">
<div class="nav-btn close-settings clickable" title="Close" id="closeSettings">
<i class="material-icons auto-margin">close</i>
</div>
<ul class="collapsible collapsible-accordion">
<li>
<a class="col s9 collapsible-header bold waves-effect admin-settings">
Channel Settings