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) {
 | 
			
		||||
    var socketid = socket.zoff_id;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    if(!msg.hasOwnProperty("channel") || typeof(msg.channel) != "string") {
 | 
			
		||||
            var result = {
 | 
			
		||||
                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));
 | 
			
		||||
                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 !== 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){
 | 
			
		||||
                                if(!docs){
 | 
			
		||||
 
 | 
			
		||||
@@ -879,16 +879,19 @@ function before_toast(){
 | 
			
		||||
        var toastInstance = toastElement.M_Toast;
 | 
			
		||||
        toastInstance.remove();
 | 
			
		||||
    }*/
 | 
			
		||||
    var toasts = document.querySelectorAll(".toast");
 | 
			
		||||
    for(var i = 0; i < toasts.length; i++) {
 | 
			
		||||
        var instance = M.Toast.getInstance(toasts[i]);
 | 
			
		||||
    /*var toasts = document.querySelector(".toast");
 | 
			
		||||
    //for(var i = 0; i < toasts.length; i++) {
 | 
			
		||||
    //    var instance = M.Toast.getInstance(toasts[i]);
 | 
			
		||||
    if(toasts == null) return;
 | 
			
		||||
    var instance = M.Toast.getInstance(toasts);
 | 
			
		||||
        try {
 | 
			
		||||
            if(instance.timeRemaining > 10) {
 | 
			
		||||
            console.log(instance);
 | 
			
		||||
            if(instance.timeRemaining > 0) {
 | 
			
		||||
                instance.dismiss();
 | 
			
		||||
            }
 | 
			
		||||
        } catch(e) {
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    //}*/
 | 
			
		||||
    //M.Toast.dismissAll();
 | 
			
		||||
    //Materialize.Toast.removeAll();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -227,7 +227,12 @@ window.addEventListener("DOMContentLoaded", function() {
 | 
			
		||||
        $(".connect_error").remove();
 | 
			
		||||
        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);
 | 
			
		||||
});
 | 
			
		||||
@@ -1532,13 +1537,13 @@ addListener("click", "#close_find_form_button", function(event) {
 | 
			
		||||
 | 
			
		||||
addListener("submit", "#find_form", function(event){
 | 
			
		||||
    this.preventDefault();
 | 
			
		||||
    if(this.find_value.value != find_word) {
 | 
			
		||||
        find_word = this.find_value.value;
 | 
			
		||||
    if(this.target.find_value.value != find_word) {
 | 
			
		||||
        find_word = this.target.find_value.value;
 | 
			
		||||
        found_array = [];
 | 
			
		||||
        found_array_index = 0;
 | 
			
		||||
    }
 | 
			
		||||
    if(found_array.length == 0){
 | 
			
		||||
        var that = this;
 | 
			
		||||
        var that = this.target;
 | 
			
		||||
        found_array_index = 0;
 | 
			
		||||
        found_array = [];
 | 
			
		||||
        for(var i = 0; i < full_playlist.length; i++) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user