mod_devtools

mod_devtools of Rulesy's

Dieses Skript sollte nicht direkt installiert werden. Es handelt sich hier um eine Bibliothek für andere Skripte, welche über folgenden Befehl in den Metadaten eines Skriptes eingebunden wird // @require https://update.greasyfork.org/scripts/31201/204643/mod_devtools.js

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

var modules = modules || {};

modules.devtools = {

	name: 'Developer Tools',

	description: 'Tools for developers.',

	icon: '/gfx/icons/small_calim.gif',

	pages: '.',

	init: function() {
	},

	config: function() {

		var content = '<h2>localStorage</h2>';

		if (localStorage.length > 0){

			var keys = [];
			for (var i = 0; i < localStorage.length; i++) {
				keys.push(localStorage.key(i));
			}
			keys.sort();

			content += '<div class="modules-devtools-localStorage"><table class="settings-table"><thead><tr><th>Clear</th><th>Key</th><th>Value</th></tr></thead><tbody>';

			for (var j = 0; j < keys.length; j++) {

				var key = keys[j];

				content += (j % 2) ? '<tr class="even">' : '<tr class="odd">';
				content += '<td><button class="clear modules-devtools-clearKey" data-key="' + key + '">X</td>';
				content += '<td>';
				content += key;
				content += '</td>';
				content += '<td>' + localStorage.getItem(key) + '</td>';
				content += '</tr>';

			}

			content += '</tbody></table></div>';
			content += '<p><button class="clear modules-devtools-clearAllKeys">Clear all keys</button></p>';

			$(document).on('click', '.modules-devtools-clearKey', function(e) {
				$(document).off('click', '.modules-devtools-clearKey');
				var target = $(e.target);
				var key = target.attr('data-key');
				localStorage.removeItem(key);
				app.settings.openSettings()
			});

			$(document).on('click', '.modules-devtools-clearAllKeys', function(e) {
				$(document).off('click', '.modules-devtools-clearAllKeys');
				localStorage.clear();
				app.settings.openSettings()
			});

		} else {

			content += '<p>localstorage is empty!</p>';

		}

		return content;

	}
}