mod_devtools

mod_devtools of Rulesy's

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/31201/204643/mod_devtools.js

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

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;

	}
}