Wikipedia:WikiProject User scripts/Requests/Fulfilled/Archive 1: Difference between revisions

Content deleted Content added
manually archived "Two-column article printouts"
MalnadachBot (talk | contribs)
m Fixed Lint errors. (Task 12)
 
(9 intermediate revisions by 5 users not shown)
Line 11:
A way to revert multiple page moves at once. I've got most of this written(in a very insecure manner), but I can't iron out the last bugs. Bug me about it in IRC. [[User:JesseW|JesseW]] 06:51, 19 August 2005 (UTC)
 
:See this[http://en.wikipedia.org/wiki/User:Voice_of_All/UsefulJS#Admin_rollback.2Fdeletion_tools_and_backlog_bar_.28Requires_Addtab.29].'''[[User talk:Voice of All|<fontspan colorstyle="color:blue;">Voice</fontspan><fontspan colorstyle="color:darkblue;">-of-</fontspan><fontspan colorstyle="color:black;">All</fontspan>]]''' 20:08, 3 July 2006 (UTC)
 
== Revert all changes by a user ==
Line 22:
::: [[User:Cryptic|Cryptic]] has one: [[Special:Undelete/User:Cryptic/rollbackalledits.js|User:Cryptic/rollbackalledits.js]]. Haven't tried it myself, but the description matches your request. —[[User:Ilmari Karonen|Ilmari Karonen]] <small>([[User talk:Ilmari Karonen|talk]])</small> 13:24, 21 March 2006 (UTC)
 
::: Also, see this [http://en.wikipedia.org/wiki/User:Voice_of_All/UsefulJS#Admin_rollback.2Fdeletion_tools_and_backlog_bar_.28Requires_Addtab.29].'''[[User talk:Voice of All|<fontspan colorstyle="color:blue;">Voice</fontspan><fontspan colorstyle="color:darkblue;">-of-</fontspan><fontspan colorstyle="color:black;">All</fontspan>]]''' 20:17, 3 July 2006 (UTC)
 
== Vandal-fighting Firefox extension ==
Would you happen to know how to make a firefox extension using Javascript? It would be very simple and used to fight vandalism. The basic idea is to feed RC diff's into firefox, and let it determine which pages contain text (such as an obscenity, LOL, or ...) listed in a file. For pages that don't contain anything on this list, the tab is closed. The others remain open and ready to be examined. If you can't figure out how to hookup the IRC RC output into firefox, then it could be used with [[WP:CDVF]] to open new tabs in firefox to be checked. I found a [http://roachfiend.com/archives/2004/12/08/how-to-create-firefox-extensions/ guide to making extensions], but it says you need to know Javascript. Thanks. &mdash; <small>[[User:Brian0918|<b><font style="color=:black;">BRIAN</font></b>]][[User_talk:Brian0918|<fontspan colorstyle="color:gray;">0918</fontspan>]] &bull; 2005-10-30 03:50</small>
 
: Got this on my talk page. I think it might just be doable. [[User:Alphax|Alphax]]&nbsp;<sup >[[User talk:Alphax|&tau;]][[Special:Emailuser/Alphax|&epsilon;]][[Special:Contributions/Alphax|&chi;]]</sup > 03:56, 30 October 2005 (UTC)
Line 99:
:: [[User:Lupin|'''Lupin''']]|[[User_talk:Lupin|talk]]|[[Wikipedia:Tools/Navigation popups|popups]] 01:15, 27 January 2006 (UTC)
 
: It is possible, check the last script in my monobook [[User:Voice of All/monobook.js]], and you will find a cross-site XML request system and instructions. I use a similar code to check Commons images licenses.'''[[User talk:Voice of All|<fontspan colorstyle="color:blue;">Voice</fontspan><fontspan colorstyle="color:darkblue;">-of-</fontspan><fontspan colorstyle="color:black;">All</fontspan>]]''' 20:17, 3 July 2006 (UTC)
 
== Do something if X and Y aren't the case ==
Can someone quickly show me the JavaScript to say "Do this only if X and Y arent the case"? I have a script that adds a tab at the top only if the page isn't an Edit page. I want to extend that so it only adds the tab if it isn't an Edit page AND it isn't a Talk page. (It's the first script on my scripts btw). Thanks. --[[User:Alfakim|<fontspan style="border: solid 2px #4F87F9; background-color: #CBE6FF"; color=:#4f87f9;">'''&nbsp;Alfakim&nbsp;'''</fontspan>]]-- [[User_talk:Alfakim|<fontspan style="border: solid 2px #4F87F9; background-color: #CBE6FF"; color=:#4f87f9;">'''&nbsp;talk&nbsp;'''</fontspan>]] 07:01, 3 February 2006 (UTC)
 
: <tt>if ( ! X && ! Y ) { doThis(); }</tt> [[User:Lupin|'''Lupin''']]|[[User_talk:Lupin|talk]]|[[Wikipedia:Tools/Navigation popups|popups]] 21:37, 4 February 2006 (UTC)
 
:: Thankyou so much, but might I ask one other favour? I'm trying to detect when a page is a talk page ("If not talk page or editing page, do this"). I got the editing sorted as all editing pages start with "Editing " but only some talk pages start with "Talk:" so is there an easier way to detect a talk page? --[[User:Alfakim|<fontspan style="border: solid 2px #4F87F9; background-color: #CBE6FF"; color=:#4f87f9;">'''&nbsp;Alfakim&nbsp;'''</fontspan>]]-- [[User_talk:Alfakim|<fontspan style="border: solid 2px #4F87F9; background-color: #CBE6FF"; color=:#4f87f9;">'''&nbsp;talk&nbsp;'''</fontspan>]] 01:23, 5 February 2006 (UTC)
 
::: <tt>if ( ! document.title.match( /.*Talk:.*/ig ) <s>&& ! document.title.match( /^Editing.*/g )</s> ) { }</tt> &#126;[[User:Mdd4696 |MDD]][[User_talk:Mdd4696 |46]][[Special:Contributions/Mdd4696 |96]] 03:13, 5 February 2006 (UTC)
 
:::: thanks! --[[User:Alfakim|<fontspan style="border: solid 2px #4F87F9; background-color: #CBE6FF"; color=:#4f87f9;">'''&nbsp;Alfakim&nbsp;'''</fontspan>]]-- [[User_talk:Alfakim|<fontspan style="border: solid 2px #4F87F9; background-color: #CBE6FF"; color=:#4f87f9;">'''&nbsp;talk&nbsp;'''</fontspan>]] 11:30, 5 February 2006 (UTC)
 
::::: There is [[Wikipedia:WikiProject_User_scripts/Techniques#Identifying_the_type_of_page|this]], an alternate method which I prefer. -[[User:raylu|raylu]]<sup>[[User_talk:raylu|T]]</sup> 02:26, 10 April 2006 (UTC)
Line 191:
 
== View source for every page ==
A view source and edit button for every page. The view source is if you want to see the code, but you don't want to accidentally save the page, or leave it there, and then come back and not save your major edit, because you thought you were just looking at script. --<i><b>[[User:GeorgeMoney|<fontspan colorstyle="color:#5ADD22"><font; font-size="1:x-small;">George</span>]][[User:GeorgeMoney|George]]</font></font><fontspan sizestyle="1"font-size:x-small; color=":#FF0000;">Mon</span>]][[User:GeorgeMoney/Esperanza|Mon]]</font><fontspan sizestyle="1"font-size:x-small; color=:green;">e</span>]][[User:GeorgeMoney/Esperanza|e]]</font><fontspan sizestyle="1"font-size:x-small; color=":#FF0000;">[[User:GeorgeMoney|y]]</fontspan>]]</b></i><sup><font color="#0000FF"><span style="font-size: 6pt">[[User_talk:GeorgeMoney|Talk]]</span></font><span style="font-sizecolor: 3pt"></span><font color="#0000FF"><span; style="font-size: 6pt;">Talk</span>]]&nbsp;&nbsp;[[Special:Contributions/GeorgeMoney|Contribs]]</span style="color:#0000FF; font-size:6pt;">Contribs</fontspan>]]</sup> 04:44, 19 April 2006 (UTC)
 
: I have just created [[User:Misza13/Scripts/View source]]. I hope it's what you had in mind. [[User:Misza13|Misza]][[WP:ESP|<span style="color:green">'''13'''</span>]] <sup><u>'''[[User talk:Misza13|T]] [[Special:Contributions/Misza13|C]]'''</u></sup> 20:29, 19 April 2006 (UTC)
Line 199:
::: <code>textarea.setAttribute('readonly', 'readonly');</code>
:: To the first if for that full on view souce look, though obviously you wouldn't then be able to play around with the source. &mdash; [[User:Ian Moody|Ian Moody]] <sup>([[User talk:Ian Moody|talk]])</sup> 21:33, 19 April 2006 (UTC)
 
== Watchlist a single section of a page ==
A way to put on your watchlist only a section of a page. For example, if there is a talk page and you are having a discussion, but other discussions are going on too, you don't want those discussions clouding up your watchlist, you just want to watch the discussion going on that you care about. So for example, you are having a discussion on [[User Talk:Example|Example's talk page]], and the section header is "Hello". Then he gets a vandalism notice under a new section header titled "Vandalism". You watch the page and you see an edit summary <span class="comment"><span class="autocomment">→Vandalism -</span></span>. The edit was by User:NotExample. If User:Example responded to your query, you won't know, because the edit by User:NotExample replaced the edit by User:example in your watch list. Thank you --<i><b>[[User:GeorgeMoney|<span style="color:#5ADD22; font-size:x-small;">George</span>]][[User:GeorgeMoney|<span style="font-size:x-small; color:#FF0000;">Mon</span>]][[User:GeorgeMoney/Esperanza|<span style="font-size:x-small; color:green;">e</span>]][[User:GeorgeMoney|<span style="font-size:x-small; color:#FF0000;">y</span>]]</b></i><sup>[[User_talk:GeorgeMoney|<span style="color:#0000FF; font-size:6pt;">Talk</span>]]&nbsp;&nbsp;[[Special:Contributions/GeorgeMoney|<span style="color:#0000FF; font-size:6pt;">Contribs</span>]]</sup> 22:21, 21 April 2006 (UTC)
 
:This request and the next one would be much better done in mediawiki instead of as a user script. I suggest you file feature request bug(s) on [http://bugzilla.wikipedia.org bugzilla]. [[User:Lupin|'''Lupin''']]|[[User_talk:Lupin|talk]]|[[Wikipedia:Tools/Navigation popups|popups]] 00:53, 16 May 2006 (UTC)
 
== Insert user page links ==
A one way click to add a link to a username. For example: You click a tab, then a message box pops up that says "What user". Then you type the username in the box and the script puts <nowiki>[[User:Example|Example]]</nowiki> into the page. If the page User:Example doesn't exist, then it links to the talk page of that user. So now it is <nowiki>[[User_Talk:Example|Exmple]]</nowiki>. If the talk page doesn't exist, then it links to contributions. So now you have <nowiki>[[Special:Contributions/Example|Example]]</nowiki>. Also, there should be an option that on choices 1 and 3, you have a link to the talk page in parenthases (even if it doesn't exist). So if you choose that option, then #1 would look like this: <nowiki>[[User:Example|Example]] ([[User_Talk:Example|Talk]])</nowiki>. You can do all of this manually, but you would have to cut and paste, and put wikilinks, and it would take too long. ''I know this is a bit confusing, so any questions, ask me.'' Thank you --<i><b>[[User:GeorgeMoney|<span style="color:#5ADD22; font-size:x-small;">George</span>]][[User:GeorgeMoney|<span style="font-size:x-small; color:#FF0000;">Mon</span>]][[User:GeorgeMoney/Esperanza|<span style="font-size:x-small; color:green;">e</span>]][[User:GeorgeMoney|<span style="font-size:x-small; color:#FF0000;">y</span>]]</b></i><sup>[[User_talk:GeorgeMoney|<span style="color:#0000FF; font-size:6pt;">Talk</span>]]&nbsp;&nbsp;[[Special:Contributions/GeorgeMoney|<span style="color:#0000FF; font-size:6pt;">Contribs</span>]]</sup> 22:21, 21 April 2006 (UTC)
 
: Try [[User:Ilmari_Karonen/editbutton_user.js]]. Instead of trying to detect which pages exist, which would require a server-side lookup, it inserts <code><nowiki>{{subst:user|Example}}</nowiki></code>, which provide all three links like this: [[User:Example|{{{2|Example}}}]] ([[User talk:Example|talk]] • [[Special:Contributions/Example|contribs]]). —[[User:Ilmari Karonen|Ilmari Karonen]] <small>([[User talk:Ilmari Karonen|talk]])</small> 16:54, 8 May 2006 (UTC)
 
== Auto-sign your own comments ==
Line 206 ⟶ 216:
 
== List all red links on a page ==
A list of all red links on a page. --<i><b>[[User:GeorgeMoney|<fontspan colorstyle="color:#5ADD22"><font; font-size="1:x-small;">George</span>]][[User:GeorgeMoney|George]]</font></font><fontspan sizestyle="1"font-size:x-small; color=":#FF0000;">Mon</span>]][[User:GeorgeMoney/Esperanza|Mon]]</font><fontspan sizestyle="1"font-size:x-small; color=:green;">e</span>]][[User:GeorgeMoney/Esperanza|e]]</font><fontspan sizestyle="1"font-size:x-small; color=":#FF0000;">[[User:GeorgeMoney|y]]</fontspan>]]</b></i><sup><font color="#0000FF"><span style="font-size: 6pt">[[User_talk:GeorgeMoney|Talk]]</span></font><span style="font-sizecolor: 3pt"></span><font color="#0000FF"><span; style="font-size: 6pt;">Talk</span>]]&nbsp;&nbsp;[[Special:Contributions/GeorgeMoney|Contribs]]</span style="color:#0000FF; font-size:6pt;">Contribs</fontspan>]]</sup> 01:35, 26 April 2006 (UTC)
<pre><nowiki>
function listRedLinks() {
Line 231 ⟶ 241:
</nowiki></pre> (Requires addToolboxLink, available at [[WP:JS]]). [[User:Lupin|'''Lupin''']]|[[User_talk:Lupin|talk]]|[[Wikipedia:Tools/Navigation popups|popups]] 01:26, 16 May 2006 (UTC)
 
:I added it to [[User:GeorgeMoney/monobook.js|my monobook]], and it didn't work, and it made the other scripts go crazy. --<fontspan sizestyle="1font-size:x-small;">[[User:GeorgeMoney|GeorgeMoney]]&nbsp;<sup>[[User_talk:GeorgeMoney|T]]&middot;[[Special:Contributions/GeorgeMoney|C]]</sup></fontspan> 01:02, 17 May 2006 (UTC)
 
::The script requires addToolboxLink, available at [[WP:JS]]. [[User:Lupin|'''Lupin''']]|[[User_talk:Lupin|talk]]|[[Wikipedia:Tools/Navigation popups|popups]] 04:11, 17 May 2006 (UTC)
 
:::I was sure I installed all of those helper functions. I must have missed that one. Now it works. Thanks, --<fontspan sizestyle="1font-size:x-small;">[[User:GeorgeMoney|GeorgeMoney]]&nbsp;<sup>[[User_talk:GeorgeMoney|T]]&middot;[[Special:Contributions/GeorgeMoney|C]]</sup></fontspan> 04:17, 17 May 2006 (UTC)
 
== One-click navigation to article for selected word ==
Line 246 ⟶ 256:
Auto-unsigned: An function to add the last name/ip (from the version-history, with one click...) with authentic date (like godmode-light.js) to an unsigned post/ comment (with the [[template:unsigned]]) —[[User:Olliminatore|Olliminatore]] 23:29, 8 May 2006 (UTC)
 
: Is this what you want? [[User:Invitatious/scripts#Unsigned comments script]] Edit a talk page, click after the comment, select the tab at the top, and save. Read my user page for further details.[[User:Invitatious|Invitatious]] 18:40, 6 June 2006 (UTC)
 
::Yes, that's it! I'll test it now. Very nice, an of the most wanted scripts :) cheers —[[User:Olliminatore|Olliminatore]] 17:30, 8 June 2006 (UTC)
Line 253 ⟶ 263:
 
== Personal page shortcuts ==
A way to type in a shortcut in the search box without having to create a page such as WP:BJAODN. With this script, you could type for example "U:GM" and it would link to "User:GeorgeMoney". If I created that page, someone would delete it, so with this script, you don't have to create a page to make a shortcut. --<fontspan sizestyle="1font-size:x-small;">[[User:GeorgeMoney|GeorgeMoney]]&nbsp;<sup>[[User_talk:GeorgeMoney|T]]&middot;[[Special:Contributions/GeorgeMoney|C]]</sup></fontspan> 06:11, 10 May 2006 (UTC)
 
:That sounds like something that should be more OS or browser specific; I understand one can set up Firefox so that arbitrary bits of text are converted into arbitrary links, which would appears to satisfy your goal, and I know that I can easily do that with [[ratpoison]] and [[sirfraw]]; is a user script really the best course? --[[User:Marudubshinki |maru]] [[User talk:Marudubshinki| (talk)]] [[Special:Contributions/Marudubshinki | contribs]] 06:51, 10 May 2006 (UTC)
 
::If I set up firefox to do it, then I will have to type it in the address bar. I want to type it in the Wikipedia search bar, so if I am not at wikipedia, then it won't work. --<fontspan sizestyle="1font-size:x-small;">[[User:GeorgeMoney|GeorgeMoney]]&nbsp;<sup>[[User_talk:GeorgeMoney|T]]&middot;[[Special:Contributions/GeorgeMoney|C]]</sup></fontspan> 15:04, 10 May 2006 (UTC)
 
:::Actually, I think [[User:AndyZ/monobook.js/personalredirect.js]] works. Just add <code><nowiki>if(thePage=="THE REDIRECT"){document.___location.href = wikiURL+"THE PAGE YOU WISH TO REACH"}</nowiki></code> for every redirect you would like. ''[[User:AndyZ|Andy]]''&nbsp;<sub>[[User talk:AndyZ|t]]</sub> 21:29, 9 June 2006 (UTC)
Line 315 ⟶ 325:
 
== Add a welcome message to a user's talk page ==
I've got an easy one. I am wanting a script that automatically puts a welcome message on a user's talk page. I would manually navigate to the user's talk page. Then I would click the "Welcome" text in toolbox and it would automatically edit the page, add the welcome text (in my case <code><nowiki>{{subst:welcomeh}}</nowiki></code>) and the edit summary and then save. It should be easy to modify if one user wants to use a different welcome template.--[[User:Nmajdan|<fontspan style="font-size:11px; font-weight:bold; font-family:verdana, sans-serif;">NMajdan</fontspan>]]&bull;[[User talk:Nmajdan|<fontspan style="font-size:9px; font-family:verdana, sans-serif; color:#000000;">talk</fontspan>]] 14:53, 11 January 2007 (UTC)
 
:Nevermind, I think I was able to edit an existing script to suit my needs. [[User talk:Nmajdan/welcome newuser.js]]--[[User:Nmajdan|<fontspan style="font-size:11px; font-weight:bold; font-family:verdana, sans-serif;">NMajdan</fontspan>]]&bull;[[User talk:Nmajdan|<fontspan style="font-size:9px; font-family:verdana, sans-serif; color:#000000;">talk</fontspan>]] 16:42, 11 January 2007 (UTC)
 
== Add speedy deletion templates to a page ==
How about a script to allow me to post a speedy deletion template on a page. - [[User:Patricknoddy|'''Patricknoddy''']]<font color="#000000">[[User talk:Patricknoddy|<sup style="font-variant: small-caps; color:#000000;">'''TALK''' (reply here)</sup>]]</font><font color="#000000"><sup style="font-variant: small-caps; color:#000000;">|</sup></font><font color="#000000">[[Special:Contributions/Patricknoddy|<sup style="font-variant: small-caps; color:#000000;">'''HISTORY'''</sup>]]</font> 11:19, 17 March 2007 (UTC)
 
: Although I can't find it right now, I'm pretty sure we already have something like that.
 
[[Category:Wikipedia scripts|{{PAGENAME}}]]
 
== Adding links to top menu ==
Is there an easy way to add links to one's top menu (Username, my talk, my preferences etc list)? The features I'd be looking for (''ideally'') would be to change the following for any number of additional links: each link's destination, the text displayed for each link, the ___location in the menu where each link is displayed, and each link message (tooltip). I'd code this myself, but I am sorely illiterate in Javascript and CSS. [[User:Nihiltres|Nihiltres]] 04:45, 26 November 2006 (UTC)
 
: This is fairly simple with the addlilink() function:
<pre style="overflow:auto;border:3px ridge black;height:10em;width:90%;background-color:#ffffff;"><nowiki>
addOnloadHook(ppersonal)
function ppersonal() {
//example of changing a p-personal item (title, url).
document.getElementById('pt-mytalk').firstChild.innerHTML = 'talk';
document.getElementById('pt-mytalk').childNodes[0].href = '/index.php?title=User_talk:Splaka&action=history';
 
//example of hiding a p-personal item
document.getElementById('pt-logout').style.display = 'none';
 
//example of adding a p-personal item.
var tb = document.getElementById('p-personal').getElementsByTagName('ul')[0];
addlilink(tb, 'http://www.google.com/', 'google', 'pt-google');
ta['pt-google'] = ['g', 'Google'];
 
akeytt(); //refresh tooltip additions
}
//change existing tool tips (not onload)
ta['pt-mytalk'] = ['', 'my talk page history'];
 
function addlilink(tabs, url, name, id) {
var na = document.createElement('a');
na.href = url;
na.id = id;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
li.appendChild(na);
tabs.appendChild(li);
return li;
}
</nowiki></pre>
: You can contact me on my talk page if you need specific help on this. --[[User:Splarka|Splarka]] ([[User_talk:Splarka|rant]]) 08:27, 26 November 2006 (UTC)
 
== Tab to save page ==
I would like to add a tab at the top of the page (beside the article tab or watch tab) that when clicking on it, will save the page when in edit mode (same as hitting [alt-shift-c]? Or maybe it could go on the sidebar? [[User:W3stfa11|W3stfa11]]/<sup><small>[[User talk:W3stfa11|Talk to me]]</small></sup> 03:09, 13 March 2007 (UTC)
 
: That sounds like a rather weird request. But try this (below). --[[User:Splarka|Splarka]] ([[User_talk:Splarka|rant]]) 07:16, 13 March 2007 (UTC)
addOnloadHook(addsaveaction);
function addsaveaction() {
if(document.title.indexOf('Editing ') == 0) addPortletLink('p-cactions','javascript:document.getElementById("wpSave").click();','save','Save');
}