mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Not removing toasts anymore until materializecss fixes issue that comes with it
This commit is contained in:
@@ -549,8 +549,6 @@ function voteUndecided(msg, coll, guid, offline, socket) {
|
|||||||
|
|
||||||
function shuffle(msg, coll, guid, offline, socket) {
|
function shuffle(msg, coll, guid, offline, socket) {
|
||||||
var socketid = socket.zoff_id;
|
var socketid = socket.zoff_id;
|
||||||
|
|
||||||
|
|
||||||
if(!msg.hasOwnProperty("channel") || typeof(msg.channel) != "string") {
|
if(!msg.hasOwnProperty("channel") || typeof(msg.channel) != "string") {
|
||||||
var result = {
|
var result = {
|
||||||
channel: {
|
channel: {
|
||||||
@@ -607,7 +605,7 @@ function shuffle(msg, coll, guid, offline, socket) {
|
|||||||
else hash = Functions.hash_pass(Functions.hash_pass(Functions.decrypt_string(msg.adminpass),true));
|
else hash = Functions.hash_pass(Functions.hash_pass(Functions.decrypt_string(msg.adminpass),true));
|
||||||
db.collection(coll + "_settings").find(function(err, docs){
|
db.collection(coll + "_settings").find(function(err, docs){
|
||||||
if(docs.length > 0 && (docs[0].userpass == undefined || docs[0].userpass == "" || (msg.hasOwnProperty('pass') && docs[0].userpass == crypto.createHash('sha256').update(Functions.decrypt_string(msg.pass)).digest("base64")))) {
|
if(docs.length > 0 && (docs[0].userpass == undefined || docs[0].userpass == "" || (msg.hasOwnProperty('pass') && docs[0].userpass == crypto.createHash('sha256').update(Functions.decrypt_string(msg.pass)).digest("base64")))) {
|
||||||
if(docs !== null && docs.length !== 0 && ((docs[0].adminpass == hash || docs[0].adminpass === "") || docs[0].shuffle === false))
|
if(docs !== null && docs.length !== 0 && ((docs[0].adminpass == hash && docs[0].adminpass != "") || docs[0].shuffle === false))
|
||||||
{
|
{
|
||||||
db.collection(coll).find({now_playing:false}).forEach(function(err, docs){
|
db.collection(coll).find({now_playing:false}).forEach(function(err, docs){
|
||||||
if(!docs){
|
if(!docs){
|
||||||
|
|||||||
@@ -879,16 +879,19 @@ function before_toast(){
|
|||||||
var toastInstance = toastElement.M_Toast;
|
var toastInstance = toastElement.M_Toast;
|
||||||
toastInstance.remove();
|
toastInstance.remove();
|
||||||
}*/
|
}*/
|
||||||
var toasts = document.querySelectorAll(".toast");
|
/*var toasts = document.querySelector(".toast");
|
||||||
for(var i = 0; i < toasts.length; i++) {
|
//for(var i = 0; i < toasts.length; i++) {
|
||||||
var instance = M.Toast.getInstance(toasts[i]);
|
// var instance = M.Toast.getInstance(toasts[i]);
|
||||||
|
if(toasts == null) return;
|
||||||
|
var instance = M.Toast.getInstance(toasts);
|
||||||
try {
|
try {
|
||||||
if(instance.timeRemaining > 10) {
|
console.log(instance);
|
||||||
|
if(instance.timeRemaining > 0) {
|
||||||
instance.dismiss();
|
instance.dismiss();
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
}
|
}
|
||||||
}
|
//}*/
|
||||||
//M.Toast.dismissAll();
|
//M.Toast.dismissAll();
|
||||||
//Materialize.Toast.removeAll();
|
//Materialize.Toast.removeAll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,7 +227,12 @@ window.addEventListener("DOMContentLoaded", function() {
|
|||||||
$(".connect_error").remove();
|
$(".connect_error").remove();
|
||||||
M.toast({ html: "Connected!", displayLength: 2000, classes: "green lighten"});
|
M.toast({ html: "Connected!", displayLength: 2000, classes: "green lighten"});
|
||||||
});*/
|
});*/
|
||||||
before_toast();
|
var to_remove = document.querySelector(".connect_error");
|
||||||
|
if(to_remove != null) {
|
||||||
|
var instance = M.Toast.getInstance(to_remove);
|
||||||
|
instancce.dismiss();
|
||||||
|
}
|
||||||
|
//before_toast();
|
||||||
}
|
}
|
||||||
Chat.namechange("", true, true);
|
Chat.namechange("", true, true);
|
||||||
});
|
});
|
||||||
@@ -1532,13 +1537,13 @@ addListener("click", "#close_find_form_button", function(event) {
|
|||||||
|
|
||||||
addListener("submit", "#find_form", function(event){
|
addListener("submit", "#find_form", function(event){
|
||||||
this.preventDefault();
|
this.preventDefault();
|
||||||
if(this.find_value.value != find_word) {
|
if(this.target.find_value.value != find_word) {
|
||||||
find_word = this.find_value.value;
|
find_word = this.target.find_value.value;
|
||||||
found_array = [];
|
found_array = [];
|
||||||
found_array_index = 0;
|
found_array_index = 0;
|
||||||
}
|
}
|
||||||
if(found_array.length == 0){
|
if(found_array.length == 0){
|
||||||
var that = this;
|
var that = this.target;
|
||||||
found_array_index = 0;
|
found_array_index = 0;
|
||||||
found_array = [];
|
found_array = [];
|
||||||
for(var i = 0; i < full_playlist.length; i++) {
|
for(var i = 0; i < full_playlist.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user