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%; width: 100%;
} }
.card-action #del { .card-action .delete_button {
color:white; color:white !important;
} }
.card-action #del:hover{ .card-action .delete_button:hover{
color:grey; color:grey !important;
} }
.share, .shareface{ .share, .shareface{
@@ -1626,15 +1626,15 @@ nav ul li:hover, nav ul li.active {
background: transparent; background: transparent;
} }
#del, #del_suggested, #del_user_suggested{ .delete_button, .del_suggested, .del_user_suggested{
position: absolute; position: absolute;
text-align: right; text-align: right;
right: -35%; right: -35%;
/* top: 45%; */ /* top: 45%; */
height: 19px; height: 19px;
line-height: normal; line-height: normal;
padding: 2px 12px; padding: 2px 12px !important;
color: white; color: white !important;
background: transparent; background: transparent;
width: initial; width: initial;
border-top: 1px solid rgba(160,160,160,0.2); border-top: 1px solid rgba(160,160,160,0.2);
@@ -1971,16 +1971,18 @@ nav ul li:hover, nav ul li.active {
width: 57%; width: 57%;
} }
#del, #del_suggested, #del_user_suggested{ .delete_button, .del_suggested, .del_user_suggested{
bottom: -9px; bottom: -9px;
/* line-height: inherit; */ /* line-height: inherit; */
height:auto; height:auto;
display: flex; display: flex;
align-items: center; align-items: center;
border-top: none; 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; font-size: 2.5rem;
} }
@@ -2178,6 +2180,7 @@ nav ul li:hover, nav ul li.active {
width: calc(100vw - 170px); width: calc(100vw - 170px);
max-width: 100%; max-width: 100%;
font-size:2rem; font-size:2rem;
padding-right:0px;
} }
.control-list li a{ min-width: 0px; width: 37px; padding: 0 0 0 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;} 0% {background-position: 0px 0px, 0px 0px, 0px 0px;}
100% {background-position: 500px 500px, 400px 400px, 300px 300px;} 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!"; msg="Seems the song you want is already playing. No fooling the system!";
break; break;
} }
before_toast();
Materialize.toast(msg, 4000); Materialize.toast(msg, 4000);
}, },
@@ -167,6 +168,7 @@ var Admin = {
}, },
log_out: function(){ log_out: function(){
before_toast();
if(Crypt.get_pass(chan.toLowerCase())){ if(Crypt.get_pass(chan.toLowerCase())){
Crypt.remove_pass(chan.toLowerCase()); Crypt.remove_pass(chan.toLowerCase());
Admin.display_logged_out(); Admin.display_logged_out();

View File

@@ -423,8 +423,10 @@ function initfp(){
} }
//window.channel_list = channel_list; //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); 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; var pad = 0;
document.getElementById("zicon").addEventListener("click", function(){ document.getElementById("zicon").addEventListener("click", function(){

View File

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

View File

@@ -1140,6 +1140,7 @@ $(document).on("submit", "#listImport", function(e){
$("#import").addClass("hide"); $("#import").addClass("hide");
$("#playlist_loader").removeClass("hide"); $("#playlist_loader").removeClass("hide");
} else { } else {
before_toast();
Materialize.toast("It seems you've entered a invalid url.", 4000); Materialize.toast("It seems you've entered a invalid url.", 4000);
} }
document.getElementById("import").value = ""; 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'); Search.importSpotifyPlaylist('https://api.spotify.com/v1/users/' + user + '/playlists/' + playlist_id + '/tracks');
} else { } else {
before_toast();
Materialize.toast("It seems you've entered a invalid url.", 4000); 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"); List.vote(id, "pos");
}); });
$(document).on( "click", "#del", function(e){ $(document).on( "click", ".delete_button", function(e){
var id = $(this).attr("data-video-id"); var id = $(this).attr("data-video-id");
List.vote(id, "del"); List.vote(id, "del");
}); });
@@ -1418,13 +1420,13 @@ $(document).on( "click", ".add-suggested", function(e){
$("#suggested-" + id).remove(); $("#suggested-" + id).remove();
}); });
$(document).on( "click", "#del_suggested", function(e){ $(document).on( "click", ".del_suggested", function(e){
var id = $(this).attr("data-video-id"); var id = $(this).attr("data-video-id");
$("#suggested-" + id).remove(); $("#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"); var id = $(this).attr("data-video-id");
$("#suggested-" + id).remove(); $("#suggested-" + id).remove();
List.vote(id, "del"); 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"); $("#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(){ function onepage_load(){
var url_split = window.location.href.split("/"); var url_split = window.location.href.split("/");

View File

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

View File

@@ -231,8 +231,8 @@
</span> </span>
</div> </div>
<div class="card-action center-align list-remove hide"> <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" class="waves-effect btn-flat clickable hide-on-small-only delete_button">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-med-and-up delete_button"><i class="material-icons">close</i></a>
</div> </div>
</div> </div>
</div> </div>

View File

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

View File

@@ -1,8 +1,8 @@
<li class="no-padding"> <li class="no-padding">
<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"> <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>
<li> <li>
<a class="col s9 collapsible-header bold waves-effect admin-settings"> <a class="col s9 collapsible-header bold waves-effect admin-settings">
Channel Settings Channel Settings