Fixed Setup Creator

Fixes the setup creator so you no longer have an infinite loading message.

Από την 07/09/2015. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Fixed Setup Creator
// @namespace    https://greasyfork.org/en/users/9694-croned
// @version      1.0
// @description  Fixes the setup creator so you no longer have an infinite loading message.
// @author       Croned
// @match        https://epicmafia.com/game/new
// @grant        none
// ==/UserScript==

window.creategame_update = function(data) {
	var button, o, status, str, redirect, msg;
	if ($.isArray(data)) {
		status = data[0], o = data[1];
		if (o.redirect) {
			window.location.reload(true);
		}
		if (!status) {
			if (o.redirect) {
				window.location.href = o.redirect;
			}
			poptog('#pop_warn');
			errordisplay('.error', o.msg);
			if (o.code) {
				button = $("<a href='/lobby/setup/" + o.id + "' class='button create'>Setup " + o.id + "</a>");
				$('#createbuttons').append(button);
			}
			return $('#setupsubmit').attr('disabled', false);
		}
		else {
			str = '/game/' + o.table;
			if (o.password) {
				str += '?password=' + o.password;
			}
			return window.location = str;
		}
	}
	else {
		status = data.status, redirect = data.redirect, msg = data.msg;
		if (redirect) {
			window.location.href = redirect;
		}
		poptog('#pop_warn');
		errordisplay('.error', msg);
		return $('#setupsubmit').attr('disabled', false);
	}
};