משתמש:שמוליק/סקריפטים

מתוך ויקיפדיה, האנציקלופדיה החופשית

סקריפטים פשוטים שיצרתי:

/*



===================================================================
	@ Author: [[user:שמוליק]]
	@ Date: 10/06/2011
	@ Descrition: Add link to Talk Pages on WatchList
	@ Created for: Yoavr763W
=================================================================== */
if (wgPageName == 'מיוחד:רשימת_המעקב')
{
	$("a[href*='history']").each(function(){
		newLink = $(this).attr("href").match(/title=(.*?)\&/)[1];
		if (newLink.indexOf(":") < 0)
			newLink = "שיחה:"+newLink;
		else if (decodeURIComponent(newLink).indexOf("שיח")==0)
			newLink = "";
		else
			newLink = "שיחת "+newLink;

		if (newLink != "")
			$(this).after(" | <a href='http://he.wikipedia.org/wiki/"+newLink+"'>שיחה</a>");
	})
}

/*

===================================================================
	@ Author: [[user:שמוליק]]
	@ Date: 19/08/2011
	@ Descrition: use inline references
=================================================================== */
$(".reference a").each
(
	function()
	{
		$(this).parent().html
		(
			$( $(this).attr("href") ).html()
		).children("a:first").remove();
	}
)
$("ol.references").remove();

/*

===================================================================
	@ Author: [[user:שמוליק]]
	@ Descrition: highlight anon's edits in RecentChanges page
=================================================================== */
addOnloadHook(function highlightAnon() {
	if ((wgCanonicalSpecialPageName != 'Recentchanges') || (getParamValue('tagfilter') && getParamValue('tagfilter') != ""))
		return;
 
	var IP4AdressRegex = /(([0-1]?[0-9]{1,2}\.)|(2[0-4][0-9]\.)|(25[0-5]\.)){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))/;
	$(".mw-userlink").filter(function(){return $(this).html().match(IP4AdressRegex)}).parents("tr").css("background","#fc0");
});


/*
===================================================================
	@ Author: [[user:שמוליק]]
	@ Date: 24/10/2011
	@ Descrition: Remove the dashes from "Add Signture" button in the old edit toolbar
	@ Created for: אריה ה.
=================================================================== */
addOnloadHook(function () {
$("#mw-editbutton-signature").unbind("click").click(function(){mw.toolbar.insertTags("~~~~", "", "", "");return false;})
});