Jump to content

User talk:AzaToth/morebits.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Akuvar (talk | contribs) at 04:16, 12 October 2010 (How do you report abuse?: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Downsized & slightly modded QueryString function

function QueryString(string) {
	string = string.replace(/\+/g, ' '); this.string = string;
	this.params = {}; if (string.length == 0) return;
	var args = string.split(arguments[1] || '&'); for (var i = 0; i < args.length; ++i) {
		var pair = args[i].split(arguments[2] || '='); var key = decodeURIComponent(pair.shift());
		var value = (pair.length > 0) ? decodeURIComponent(pair.join(arguments[2] || '=')) : key;
		this.params[key] = value}};

QueryString.prototype = (function(props) {
	for (var i in props) QueryString[i] = function() {
		return QueryString.static[i].apply(this, arguments)}; return props})({
	get: function(key) {return this.params[key] ? this.params[key] : null},
	exists: function(key) {return this.params[key] ? true : false},
	equals: function(key, value) {return this.params[key] == value ? true : false},
	toString: function() {return this.string || null}});

QueryString.prototype.create = QueryString.create = function(arr) {
	if (typeof arr != "object" || typeof a.length == "integer") arr = {value: arr};
	var resarr = Array(); var editToken; // KLUGE: this should always be the last item in the query string (bug TW-B-0013)
	for (var i in arr) {if (typeof arr[i] == 'undefined') continue; var res;
		if (arr[i] instanceof Array) {var v = Array();
			for (var j = 0; j < arr[i].length; ++j) v[j] = encodeURIComponent(arr[i][j]);
			res = v.join('|');} else res = encodeURIComponent(arr[i]);
		if (i == 'wpEditToken') editToken = res;
		else resarr.push(encodeURIComponent(i) + '=' + res)};
	if (typeof editToken != 'undefined') resarr.push('wpEditToken=' + editToken);
	return resarr.join(arguments[1] || '&')};

QueryString.static = new QueryString(location.search.substring(1));

--58.173.104.186 (talk) 06:15, 30 October 2008 (UTC)[reply]

What is this?

Really, it's in my monobook.js but I have no idea what it does. I think furme requires it. Is it a general library for other scripts? --Apoc2400 (talk) 23:28, 12 November 2008 (UTC)[reply]

Yeah, it's a library. People use it for stuff like Twinkle and Friendly. --[[ year2000prob ]] 05:42, 22 December 2008 (UTC)[reply]

What is the IE problem?

I understand that this library won't work in IE, but why?--Ipatrol (talk) 19:04, 26 March 2009 (UTC)[reply]

Blacklist request

Whenever I use FireFox for clearing out my e-mails, I think I've got rollback rights. Please blacklist my name so that I stop making that mistake.--Launchballer 15:15, 21 October 2009 (UTC)[reply]

If you don't want to use Twinkle, remove it from your gadgets. Amalthea 15:59, 21 October 2009 (UTC)[reply]

Request

{{editprotected}} Please replace img.src = "/media/wikipedia/commons/thumb/5/52/Nuvola_apps_error.png/18px-Nuvola_apps_error.png"; with img.src = "/media/wikipedia/commons/d/da/Crystal_button_cancel.png"; as the second image is a newer, nicer icon.--ℳøℕø 00:07, 25 April 2010 (UTC)[reply]

what is this used for? —Preceding unsigned comment added by Spitfire19 (talkcontribs) 00:45, 25 April 2010 (UTC)[reply]
It is the "close" button on the Twinkle window.--ℳøℕø 01:49, 25 April 2010 (UTC)[reply]
What's so bad with the current icon that you keep trying to replace it?
In any case, feel free to propose this one at WT:TW#Twinkle Close Button where you've previously asked for it to be changed.
Amalthea 09:11, 25 April 2010 (UTC)[reply]

How do you report abuse?

This looks like an interesting tool, however I am on an article where a user is using this and reverting good faith edits automatically. The instructions warn against this, but no where does it say what to do when it happens. Akuvar (talk) 04:16, 12 October 2010 (UTC)[reply]