ഉപയോക്താവ്:Akhilan/Compare link.js
ശ്രദ്ധിക്കുക: സേവ് ചെയ്തശേഷം മാറ്റങ്ങൾ കാണാനായി താങ്കൾക്ക് ബ്രൗസറിന്റെ കാഷെ ഒഴിവാക്കേണ്ടി വന്നേക്കാം.
- ഫയർഫോക്സ് / സഫാരി: Reload ബട്ടൺ അമർത്തുമ്പോൾ Shift കീ അമർത്തി പിടിക്കുകയോ, Ctrl-F5 അല്ലെങ്കിൽ Ctrl-R (മാക്കിന്റോഷിൽ ⌘-R ) എന്ന് ഒരുമിച്ച് അമർത്തുകയോ ചെയ്യുക
- ഗൂഗിൾ ക്രോം: Ctrl-Shift-R (മാക്കിന്റോഷിൽ ⌘-Shift-R ) അമർത്തുക
- ഇന്റർനെറ്റ് എക്സ്പ്ലോറർ: Refresh ബട്ടൺ അമർത്തുമ്പോൾ Ctrl കീ അമർത്തിപിടിക്കുക. അല്ലെങ്കിൽ Ctrl-F5 അമർത്തുക
- ഓപ്പറ: Menu → Settings എടുക്കുക (മാക്കിൽ Opera → Preferences) എന്നിട്ട് Privacy & security → Clear browsing data → Cached images and files ചെയ്യുക.
//<pre>
// Compare link
/*
To install Compare link, put:
// [[User:Superm401/Compare link.js]]
importScript("User:Superm401/Compare link.js");
in Special:MyPage/skin.js.
Copyright 2006-2011 Matthew Flaschen (User:Superm401)
In addition to the GFDL:
This function (compare link) is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This function is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
A copy of the GPL is available at http://www.prism.gatech.edu/~mflaschen3/gpl.txt .
By modifying "User:Superm401/Compare link":
You agree to dual-license your contributions under both the GFDL (http://en.wikipedia.org/wiki/WP:GFDL)
and version 2 of the GPL (http://www.prism.gatech.edu/~mflaschen3/gpl.txt) or any later version
of the GPL published by the FSF.
*/
function fixCompare()
{
var histForm=document.getElementById("mw-history-compare");
var diffList=document.getElementById("pagehistory");
var histButtons=getElementsByClassName(histForm, "input", "historysubmit"); // wikibits
var firstButton=histButtons[0];
var finalButton=histButtons[1];
if(!finalButton)
return null;
finalButton.parentNode.removeChild(finalButton);
firstButton.parentNode.removeChild(firstButton);
var compareLink=document.createElement("a");
var genLink = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + histForm.title.value + "&diff=" + histForm.diff[0].value + "&oldid=" + histForm.oldid[1].value;
compareLink.setAttribute("href", genLink);
compareLink.setAttribute("class", "compare-link");
compareLink.appendChild(document.createTextNode("Compare selected versions"));
histForm.insertBefore(compareLink, diffList);
var endLink=compareLink.cloneNode(true);
histForm.appendChild(endLink);
addHandler(diffList, "change", updateCompare); // wikibits
function updateCompare()
{
var selectedRows = getElementsByClassName(histForm, "li", "selected");
var diffRow = selectedRows[0]; // reverse chronological, so diff row is first.
var diff = diffRow.getElementsByTagName("input")[1].value; // diff second radio
var oldidRow = selectedRows[1]; // old id row later
var oldid = oldidRow.getElementsByTagName("input")[0].value; // oldid first radio
var genLink = mw.config.get('wgServer') + mw.config.get('wgScript') + "?title=" + histForm.title.value + "&diff=" + diff + "&oldid=" + oldid;
compareLink.setAttribute("href", genLink);
endLink.setAttribute("href", genLink);
}
}
if(wgAction == "history")
{
importStylesheetURI('http://en.wikipedia.org/w/index.php?title=User:Superm401/Compare_link.css&action=raw&ctype=text/css');
addOnloadHook(fixCompare);
}
//</pre>