Wikipedia:WikiProject User scripts/Requests/Fulfilled/Archive 2

Add speedy deletion templates to a page
How about a script to allow me to post a speedy deletion template on a page. - PatricknoddyTALK (reply here) | HISTORY 11:19, 17 March 2007 (UTC)


 * Although I can't find it right now, I'm pretty sure we already have something like that.
 * WP:TWINKLE can do that. —Grim Revenant 09:59, 18 May 2007 (UTC)

Change all talk page links in a category to point to their main page
I'm not sure if this is possible. Here's what I would like. When browsing a category, such as Category:Unassessed-Class Environment articles, I want the script to point all the links in the category to point to the article and not the talk page of the article. So for example in the category, instead of pointing to Talk:Algae, it'll point to Algae. Is that possible? Right now when assessing articles, I have to click on the link which takes me to the talk page. Then I have to go to the article to review it. I want to skip that first step. MahangaTalk to me 02:36, 19 March 2007 (UTC)


 * Give this a try (adds an action button). --Splarka (rant) 07:32, 19 March 2007 (UTC)

function catSwapButton { if(document.title.indexOf('Category:' == 0)) { addPortletLink('p-cactions','javascript:catSwap;','De-Talkify','ca-catswap','change category links from talk pages to article pages'); } } addOnloadHook(catSwapButton)

function catSwap { var cat = document.getElementById('mw-pages'); cat.innerHTML = cat.innerHTML.replace(/Talk\:/g,'').replace(/[_\s]talk\:/g,':'); }


 * Thank you!

Highlight watchlist items by pattern
A script that allows a user to add a wildcard, and any items in his watchlist that contain that wildcard will be colored in a different color. This is especially useful for users who are monitoring things like many of the DYK templates. Yonatan talk 20:23, 19 March 2007 (UTC)


 * Here is a crude version (someone else could write it with regex support and a more compact array method I suppose). Note that this can be expanded to search the title="", by changing  to   below.

 var wstyle = []; // Watchlist styler, matches word or word fragments in the innerHTML of links on your watchlist page. // Accepts 'color' and 'bgcol' parameters (link color and background color), either or both. // Add as many as your browser can handle. wstyle[wstyle.length] = { 'match': 'Hydrogen', 'color': '#ffff00', 'bgcol': '#00ff00'} wstyle[wstyle.length] = { 'match': 'MediaWiki', 'color': '#ff0000'} wstyle[wstyle.length] = { 'match': 'Talk:', 'bgcol': '#000000'}

function watchlistStyle { if(document.title.indexOf('My watchlist -') != 0) return; var links = document.getElementById('bodyContent').getElementsByTagName('a'); for(var i=0;i < links.length;i++) { for(var k=0;k < wstyle.length;k++) { if(links[i].innerHTML.indexOf(wstyle[k].match)!= -1) { if(wstyle[k].color) links[i].style.color = wstyle[k].color if(wstyle[k].bgcol) links[i].style.backgroundColor = wstyle[k].bgcol }   }  } } addOnloadHook(watchlistStyle)
 * Note that this can also be done in just CSS if your browser supports 2.1 (any Firefox should work), eg:

body.page-Special_Watchlist a[title*="MediaWiki"] {color: #ff0000; background-color:#000000;}
 * --Splarka (rant) 23:22, 19 March 2007 (UTC)

Post a random smiley to a random user
Could someone make me a script that posts a random smiley to a random user all in one go? For more information on what I mean, see WP:BOTREQ, at the very bottom, specefically. ♠  TomasBat   ( @ )  ( Contribs )  ( Sign! ) 20:34, 17 April 2007 (UTC)


 * I'm dealing with this on the user's talk page (this is something of a niche request anyway, and it probably isn't appropriate for the scripts list due to the havoc this might cause if overused, and given its nature it'll probably spread by talkpage spam anyway). --ais523 14:51, 18 April 2007 (UTC)

"New pages" link in "interaction" portlet
Could someone make a script that would add a link to Special:NewPages to the "interaction" box on the side of the page? Mr.Z-man  talk ¢ 22:44, 22 April 2007 (UTC)


 * This should work:

addOnloadHook(function {    addPortletLink("p-interaction", wgArticlePath.replace(/\$1/, 'Special:Newpages'), "New pages", "n-newpages", "View a list of recently created pages"); });
 * Be aware that changes have been made in the recent past to MediaWiki:Sidebar that could break this in the future. Particularly, the id for p-interaction could change. I've attempted to get some interest in addressing this issue at MediaWiki talk:Sidebar and Village pump (technical), but there has been zero response to my dismay. Mike Dillon 23:34, 22 April 2007 (UTC)


 * Yep, that works great. Thanks! Mr.Z-man  talk ¢ 00:10, 23 April 2007 (UTC)

Pre-defined edit summary drop-down
I would be really glad about a script that creates a drop-down menu over the edit summary line. From that menu you should be able to choose some pre-defined edit summaries. Reason: Doing stupid tasks sometimes require extensive summaries in order to avoid confusion among others. Furthermore, it is simply nice to have kind of "standardized" summaries for always the same task. The summaries in the menu should be definable in the monobook. — Pill (talk) 18:22, 30 April 2007 (UTC)


 * IIRC wikEd (User:Cacycle/wikEd) does something like this (among many other things), but it's probably overkill for such a simple task. Maybe the relevant part of the code could be made into a separate script? --ais523 10:40, 1 May 2007 (UTC)
 * There's no more simple variant? — Pill (talk) 22:17, 5 May 2007 (UTC)
 * Well, I have a feeling that either me or Mike Dillon will eventually write this script. Remind me in a week if that doesn't happen. — Alex Smotrov 00:44, 6 May 2007 (UTC)

This might work for you. Mike Dillon 04:02, 8 May 2007 (UTC)

var predefinedSummaries = { "stuff": "Doing stuff", "things": "Doing things" }; addOnloadHook(function {    var summary = document.getElementById("wpSummary");    if (!summary) return;

var dropdown = document.createElement("select"); dropdown.style.width = "15%";

for (var label in predefinedSummaries) { var option = document.createElement("option"); option.setAttribute("value", predefinedSummaries[label]); option.appendChild(document.createTextNode(label)); dropdown.appendChild(option); }

dropdown.onchange = function { summary.value = summary.value.replace(/(\/\*.*?\*\/\s+)?.*/,           "$1" + dropdown.options[dropdown.selectedIndex].value); };

summary.parentNode.insertBefore(dropdown, summary.nextSibling); });

Voting script
It would be really usefull if there was a script that added three extra buttons to the toolbar, one for a support, oppose, and neutral vote respectively, maybe something like this:


 * [[Image:Symbol support vote.svg|15px]] Support. Comment (optional) ~
 * [[Image:Symbol oppose vote.svg|15px]] Oppose. Comment (optional) ~
 * [[Image:Symbol neutral vote.svg|15px]] Neutral. Comment (optional) ~

Seeing as voting is an essential part of Wikipedia, this could also standartise the procedure and save time. If someone doesn't want to leave a comment, he simply removes the Comment part. Thanks. — May the Edit be with you, always. (T-borg)  (drop me a line) 21:15, 13 May 2007 (UTC)

if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/ba/Button_conserver.png", "speedTip": "Support", "tagOpen": "* \'\'\'Support\'\'\'. ", "tagClose": " ~", "sampleText": "\'\'comment\'\'"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/commons/f/fc/Button_supp.png", "speedTip": "Oppose", "tagOpen": "* \'\'\'Oppose\'\'\'. ", "tagClose": " ~", "sampleText": "\'\'comment\'\'"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/commons/4/4e/Button_neutre.png", "speedTip": "Neutral", "tagOpen": "* \'\'\'Neutral\'\'\'. ", "tagClose": " ~", "sampleText": "\'\'comment\'\'"}; }
 * Hint: you can probably also put in some simple logic to only trigger it on voting pages (if it were established site-wide). --Splarka (rant) 07:25, 14 May 2007 (UTC)
 * A script such as this would run counter to guidelines here on the English Wikipedia: see WP:!VOTE. Generally speaking, decisions should be made via consensus rather than voting. Templates showing [[Image:Symbol support vote.svg|15px]] Support and similar have been deleted several times at TfD for such reasons (e.g. see Template:Support's deletion log, which dates back to June 2005). There was a standalone program to do something like this called 'WikiVoter', but there was a backlash against it (people assumed that the name implied that it did nothing but add votes), and it was renamed WikiDiscussion Manager. This script appears to be something that does simply add votes, so I would recommend not using it. --ais523 07:49, 14 May 2007 (UTC)

I see. Thanks for clearing things up. — May the Edit be with you, always. (T-borg)  (drop me a line) 07:52, 14 May 2007 (UTC)

"Add edit section 0" doesn't work on Safari 3
As the subject says, this script stopped working after an upgrade to Safari 3. Any way to fix it? --.anaconda 16:02, 3 July 2007 (UTC)
 * I don't have Safari to test it on, but here's a simplified version of the script I've just written that may avoid the problem:


 * Works, thank you :-) --.anaconda 22:50, 3 July 2007 (UTC)

Don't show articles in My Contributions where I'm the last contributor
I've looked and looked and can't find what I'm after. I'd like a script that, when I'm looking at My Contributions, only shows the articles where I'm not the most recent contributor. (Or, more specifically, a script that gives me the option to view the contributions that way.) ... disco spinster  talk  00:31, 25 September 2007 (UTC)
 * Should just be a trivial tweak to User:ais523/topcontrib.js (which colours the lines corresponding to articles where you aren't top, rather than hiding them). I'll look into it. --ais523 07:25, 25 September 2007 (UTC)
 * Here you go: User:ais523/hidetopcontrib.js puts a tab on Special:Contributions which hides (on all screens of results) all top edits and (on the first screen of results, and less reliably on later screens) all pages on which you have the top edit. --ais523 07:35, 25 September 2007 (UTC)
 * Wonderful, thanks! Could you add a way to toggle between "hide top" and "show top"?  ...  disco spinster   talk  12:52, 25 September 2007 (UTC)
 * Done, bypass your cache to see the changes. --ais523 13:19, 26 September 2007 (UTC)
 * Brilliant! Thanks so much. ...  disco spinster   talk  14:02, 26 September 2007 (UTC)

Highlight the character "g" in IPA tags
I'd like a script to search pages for IPA tags containing the character "g" [U+0067] and hilight it in red so that I know it's wrong and needs to be replaced with "ɡ" [U+0261] - they look identical in the font I use for IPA, but not so much in other fonts. Plus, such a script once written could be adapted to deal with other subtle textual errors. —Random832(tc) 04:30, 1 February 2007 (UTC)


 * I've had a go at this one: User:Mike Dillon/Scripts/highlightNonIPA.js. It highlights all non-IPA characters in an IPA block in a golden color. It also allows " [ ", "/", "<", ",", and a few other punctuation characters. It correctly highlights "g". It probably needs some tweaking to determine what should and shouldn't be highlighted, but I think it's a good start. One area I didn't look at too much was pre-combined characters with diacritics. In particular, I was hesitant to add vowels with macrons for pre-combined tone marks since I'd be afraid that they are incorrect transcriptions of long vowels more often than not. Mike Dillon 19:29, 5 May 2007 (UTC)

Determining canonical namespace names
How do I obtain the canonical name of the Category (or any other) namespace? I need this in order to modify some scripts for cross-project usage.--DStoykov 17:31, 15 February 2007 (UTC)


 * The namespace list for any wiki can be found at http://en.wikipedia.org/w/query.php?what=namespaces (obviously change the en.wikipedia.org part for other wikis). The Category namespace is 14 in the list. You can change the format as described in http://en.wikipedia.org/w/query.php to something useful for the script (such as XML); the main problem is trying to access that page. You might want to see a script like User:ais523/contribcalendar.js for a guide as to how to access query.php from a user script. (I copied the code for doing that off someone else, as it happens; it's hard to get it to work in both FireFox and IE without seeing how it's done first.) --ais523 17:48, 15 February 2007 (UTC)

Revert counter
I would like a counter somewhere that counts the number of reverts you have done in 24 hours, coz i've just been a bit revert happy, and nearly broken the 3RR reverting vandalism. If it wasn't for other users getting there first and partly User:Lupin's script, I would have broken a ten revert rule! The counter should just be visible, so i can just look and see how many reverts I have done, so I do not actually break the 3RR. Thanks in advance. Stwalkerster 21:36, 9 March 2007 (UTC)


 * 3RR only applies to legitimate edits. You can revert vandalism as many times as you like. Tra (Talk) 21:40, 9 March 2007 (UTC)

Alter tab names in quickbar
A little earlier someone posted a script to alter the linknames for the quickbar at the top. Is there an easy script to alter tab names too? - Mgm|(talk) 17:40, 15 April 2007 (UTC)


 * It's a one-liner; this example is for the ca-edit tab, changing what it says to 'edit'.

addOnloadHook(function {document.getElementById('ca-edit').firstChild.innerHTML = 'edit';});
 * Hope that helps! --ais523 16:34, 16 April 2007 (UTC)


 * There is absolutely no difference between "link" and "tabs" on the top and on the left. The same code can be used, only ids should be changed. As for one-liner, it will result in error on the pages without 'ca-edit' (like history or watchlist), possibly stopping some other scripts from working. — Alex Smotrov 19:43, 16 April 2007 (UTC)

Arabic script
I've been adding Arabic script to articles in Wikipedia for 9 months now, and have added thousands of 'em. I would really appreciate if someone can create this script for me.

Basically, this script will help me add Arabic script to articles with Arabic names (as in Jamal Suliman) and remove the request tags from the talk pages.

This is a description of what I would like the script to do: If it helps, I use Firefox 2.0.0.4 on Vista X86. I think this shouldn't be any difficult for the average script whizz. :-) Thanks,  An as  talk? 00:18, 13 July 2007 (UTC)
 * In article talk pages, a tab labeled "ar" is added. Clicking on this tab removes Arabic from the talk page. It uses an edit summary of "Removed Arabic".
 * In articles (main space), a tab labeled "ar" is added. Clicking on this tab launches a small box with one option, Arabic, with a box where the Arabic script is added. The proper way of formatting the script is by adding " (ARABIC SCRIPT) " immediately after the subject's name. The script uses an edit summary of "Added original Arabic script".
 * I'm not entirely sure what you mean by the mainspace part of the script. Do you want it to open a dialog box (or similar) prompting you for the Arabic text? Should the script just place in the template with one parameter, what you typed in the input box with triple-apostrophes around it? Or have I misunderstood the request? --ais523 17:51, 16 July 2007 (UTC)
 * Yes, it opens a dialog box prompting me for the Arabic script, which is placed between the triple-apostrophes (for bold text). It is placed after the subject's name in the lead, if possible. Thanks,  An as  talk? 13:13, 17 July 2007 (UTC)

I think this works: As I've written it at the moment, it sets off 'show changes' both on the talkpage and articlepage tagging. You can change wpDiff on the fourth line of the script to wpSave to cause the talkpage to save automatically, once you're happy that the script works; I think the risk that the script adds the lang-ar tag in the wrong place is too high, so that will always 'show changes' rather than saving immediately to give you a chance to check it's in the right place. Hope that helps; let me know if it works! --ais523 16:08, 17 July 2007 (UTC)
 * Cough, cough… not gonna works since  is not defined; what's wrong with using   which was added to [/skins-1.5/common/wikibits.js wikibits.js] ages ago? As for script behaviour, personally I would prefer the script to focus textarea and put the cursor in the correct position so the user could start typing directly into textarea ∴ Alex Smotrov 16:56, 17 July 2007 (UTC)
 * It didn't work. It also canceled the other scripts I have installed. I have an idea; is it possible to design this script to only remove the talk page tag? Maybe you could help me add a new button in my edit panel (see below) which adds the lang-ar template (as described above) where the cursor is placed? Thanks a lot! — An as  talk? 20:47, 17 July 2007 (UTC)
 * Forget about the extra button; I got that figured out. Could you just help me with the talk page script (first part of my request)? :-) Thanks,  An as  talk? 13:28, 18 July 2007 (UTC)
 * Alex Smotrov was right; I was using an obsolete function by mistake (which worked in my monobook because I have it installed to run some old code, but wouldn't work in yours...). Here's the corrected version, minus the article page script. (I've also edited the script above if you want the full thing.)


 * Hope that helps! --ais523 16:52, 24 July 2007 (UTC)
 * The (complete) first script won't work, but that's no problem. As for the second script, it will do everything I want it to except for actually removing the template. Maybe there's a small mistake that's interrupting it; can you revise it? Much appreciated, ais! — An as  talk? 17:40, 24 July 2007 (UTC)
 * The script doesn't do anything but remove the template, though; I've made a minor fix for the situation when a user added spaces around the name of the tag. What's the problem, exactly? If it's that it isn't saving after showing the diff, this is intentional when I write a new script (until you've used it a bit there's always the chance of some mistake I didn't notice), and you can change wpDiff to wpSave in the fourth line to make it save immediately. If it's that the script is making a null edit with the correct summary, then see if the fix I've made above works, and if not, let me know a page on which it fails and I'll look into it. Hope that helps! (Sorry for the late reply; I've been offline for a while.) --ais523 07:39, 27 July 2007 (UTC)
 * Thanks a lot for your time, ais. The script is working OK; it adds the script flawlessly now. However, it still won't remove the tag from talk pages; it will make a null edit with the correct summary, as it was doing before your fix. You can test it in Talk:Jamal Suliman. Thanks again! I really appreciate your help. — An as  talk? 11:51, 27 July 2007 (UTC)
 * Oh, I've spotted it now. I'd somehow forgotten to code for the case when the template didn't have a parameter; fixed above. --ais523 11:54, 27 July 2007 (UTC)
 * Brilliant! Works like a charm! Thanks a million. — An as  talk? 12:08, 27 July 2007 (UTC)

"Leave a comment"
I don't know if it's going to stay, but can someone write a script that changes the "Leave a comment" tab back to a "+"? I think it's a one-liner.

Also, I was wondering if there was a way to make tabs at the top a set distance apart, or at least add a pixel or two of margin between them. I have a few that are right next to each other, and it's bugging me. [/OCD] Thanks, — thesublime514  •  talk  • 20:32, July 13, 2007 (UTC)


 * One-liner for "+" was already mentioned on Village pump (technical), but here you go:


 * I started to enter the script for your 2nd request (similar to above, but with ), then realized it's better with CSS, e.g.

li#ca-history {margin-left: 20px !important}
 * in your monobook.css will make more empty space on the left from the "history" tab ∴ Alex Smotrov 21:32, 13 July 2007 (UTC)


 * Thanks, man — thesublime514  •  talk  • 22:37, July 13, 2007 (UTC)

Change the wikipedia search bar
I'd like a script that changes the behavior of the wikipedia search bar in the left pane of the screen. Wikipedia's search functionality isn't great. I'd like a script that changed the search button to do a search on google in the wikipedia.org domain. It may help to base off of User:Henrik/sandbox/google-search.

Thanks! St.isaac 17:02, 14 July 2007 (UTC)


 * Try this:


 * I made the second button the "I'm feeling lucky" (rather than the first, which is default on MediaWiki). --Splarka (rant) 08:16, 15 July 2007 (UTC)
 * It's very good. I like it a lot.   St.isaac 02:29, 16 July 2007 (UTC)

Monobook problems
OK Guys, this is a (rather) large request. I have a fairly clean monobook.js and it won't work. Period!. I don't know what's wrong with it, I've tried disabling things for debugging but nothing seems to work. Can somebody take a look and see if there's something obvious? It was taken from a larger monobook, so it's possible I've removed something vital....

Thanks! Isaac 17:08, 23 July 2007 (UTC)
 * There's a semicolon missing; it should be just after the last ) on the page. Apart from that, I don't see anything obviously wrong. (Some of the scripts there are seriously out of date, though they should still work.) --ais523 16:48, 24 July 2007 (UTC)
 * I think Isaac already fixed it by now. As for semicolon, I recently started writing my scripts almost without any. Please let me know if it's a problem for some particular browsers, then I'll stop doing that ;) ∴ Alex Smotrov 17:01, 24 July 2007 (UTC)
 * Firefox, at least, requires a semicolon at the end of a function call (such as to addOnloadHook) if it's immediately followed by another function call, or I suspect anything else. I'm not sure whether it's strictly required at the end of a block, though, like that one was, but it would cause problems if another script were added at the end. --ais523 17:09, 24 July 2007 (UTC)
 * I just looked it up, actually; in JavaScript, apparently a newline will add a semicolon if one's needed (I didn't use a newline when testing). This seems to allow for ambiguities, though; it might mean that the following code is ambiguous:


 * (because '+4' is a valid statement in its own right, which calculates the value of 4 and does nothing with it). I wonder how browsers interpret this sort of thing? (I get a messagebox saying test4 when I run this script in Firefox 2 and also in Internet Explorer 7.) --ais523 17:13, 24 July 2007 (UTC)
 * The plus sign is both unary and binary, though... when a browser looks ahead to see if it should place a semicolon, I assume it checks for binary operators (and possibly nothing else). Grace notes T § 03:10, 25 July 2007 (UTC)

Change image red links to not link to edit page
It would be really nice for people doing image work if the image redlinks were just normal links rather than the w/index.php?title=Image:example.jpg&action=edit style so we could see if there were previous versions, or if one exists on commons etc. (red links exist on logs even if they are on commons) - cohesion 02:07, 10 August 2007 (UTC)


 * The problem is, depending on what kind of link it is ( [[Image:...]] or Image:... or an entry in a log), sometimes it is an edit link, and sometimes it is an upload link. But give this a try:

For every red image it finds, it sets a class "newimage" and then proceeds to insert 3 links after it ("view edit logs" or "view logs upload" depending on what type of link it is). It only works in English as-is (would need to be customized for other content languages). You can style the red image links in your user css, for example:. Yes, this can be rewritten better and possibly doesn't need to be so complex. zocky ^_^. --Splarka (rant) 09:14, 10 August 2007 (UTC)


 * Wow, this is perfect! :D Thanks so much!! :D - cohesion 23:46, 10 August 2007 (UTC)

Users link in Toolbox
This script will have easy access through the Toolbox instead of walking through the Special Pages and finding the "User list". --  PNiddy  Go!  18:17, 18 August 2007 (UTC)


 * Do you mean Special:Listusers? Try:


 * --Splarka (rant) 07:29, 19 August 2007 (UTC)
 * Can that be modified so that it searches for the user on whose page it is clicked? i said 04:52, 23 August 2007 (UTC)


 * Maybe try this instead. --Splarka (rant) 07:42, 23 August 2007 (UTC)

Yes. That works. Thank you very very much. i said 07:49, 23 August 2007 (UTC)

2 requests for specific code

 * First request. Is there a template that I can use that when placed on a page converts into the articles name? for instance if I put (an example) it would automatically convert into the name of the article which it's placed on? Does such a thing exist? If not, What javascript would be required to make such a script possible to create such a template?


 * Second request. I'm trying to add a link to my toolbox that shows the log of todays AFD pages. Specifically this link: . How would I add such a link to my "toolbox" to the left. What would the specific script be?

Thanks in advance for anyone who might be able to help.  Wikidudeman  (talk) 19:48, 10 September 2007 (UTC)


 * To answer your first question:, or if you want the namespace included. Anomie 22:36, 10 September 2007 (UTC)


 * Thanks. I figured out the first one earlier today thankfully. As far as the second one goes, I can't figure it out. Perhaps someone knows javascript well enough to write it out for me.  Wikidudeman  (talk) 23:26, 10 September 2007 (UTC)


 * This should do what you want. --Splarka (rant) 08:44, 11 September 2007 (UTC)
 * moved below with Mike Dillon's UTC corrections


 * Bingo, You're a genius.  Wikidudeman  (talk) 12:26, 11 September 2007 (UTC)


 * If you really want to match the current page, you'll need to use UTC, i.e.,  , and  . Mike Dillon 03:17, 12 September 2007 (UTC)
 * Is there a way to make it so that it isn't in the edit page? Also, I have another addition to my toolbox, and I'd rather this one be above it. Is there a way to do that? I really like this tool. i said 03:31, 12 September 2007 (UTC)
 * Change this:


 * to this:


 * This is leaving aside the issue I mentioned earlier that these should all use UTC.


 * P.S. the links are added to the toolbox in the order they appear in your user JavaScript. Mike Dillon 05:50, 12 September 2007 (UTC)
 * Thanks very much! i said 06:00, 12 September 2007 (UTC)


 * Right, so use this instead (Note that your example link included the edit link, why?). --Splarka (rant) 07:25, 12 September 2007 (UTC)

Automatically view talk page discussion while looking at article
So often I notice that the discussion/talk page link is blue; back when I first signed up, I would usually visit the talk page to see what interesting discussions might have occurred on the article, and this was often valuable. But these days talk pages are so often a wasteland of banners and bot-edits and so I've fallen out of the habit, even though this often means I will miss the occasional real talk page. It's occurred to me that if there were some way to have the talk page for an article automatically shown, like at the bottom, then I could at a glance just from the scrollbar know whether there is real substantive stuff on the talk page and scroll down to look at it. Someone suggested that an 'inline' frame might be the way to go, but the closest I could find is "Wikipedia Inline Article Viewer", which doesn't quite do it. I don't know enough to modify it either. --Gwern (contribs) 03:14 18 September 2007 (GMT)


 * Here is some ugly code to do that (test version). It appends the talk page to bodyContent in a 20em overflow:auto div. --Splarka (rant) 08:13, 18 September 2007 (UTC)


 * Neat! It seems to work pretty well, although it is perhaps not perfectly ideal - if it's greater than a certain length, it 'overflow's and is tucked away in its own frame? --Gwern (contribs) 16:49 18 September 2007 (GMT)


 * If you want the entire talkpage to be shown whatever its length, change the line

tp.style.height = '20em';
 * to

tp.style.height = 'auto';
 * (I think, I haven't tested it). --ais523 17:02, 18 September 2007 (UTC)


 * Seems to work. Thanks. --Gwern (contribs) 20:40 18 September 2007 (GMT)

Scheduler for WP-work or wikibreaks
Hi. I like the WikiBreak Enforcer script. But could somebody improve it, please? It'd be great to get a script that allows a log-in for a given period of time (hopefully adjusted by User) and then causes the User to log off. For instance, somebody could give themselves an hour in the morning and an hour in the evening to work on Wikipedia. Is this feasible and can somebody write the script? Thanks muchly. (Pls reply to my Talk, too, if you don't mind.) HG | Talk 07:23, 23 September 2007 (UTC)
 * I've commented about this on HG's talk; more information's needed to pin down exactly what's being requested and whether this is feasible. --ais523 18:33, 24 September 2007 (UTC)
 * Thanks very much for looking into this. My answers are: (1) Do I use the same browser and computer for everything? Yes, practically and if necessary. I would be very glad to have the script for that browser/computer. I also have access to other computers elsewhere. (2) Could the times at which you can log on are determined in advance? Yes, but. As you suggested, the script could select 2 time periods a day. But are you suggesting that the User (me) would be unable to modify those time periods? I would prefer to reset the time periods occasionally. (3) Would I mind information about whether you're logged on or not being publically available? Hmmm. Don't think I'd mind. (Where would I find info on this issue?) Thanks again for considering this request, ais523. Best wishes, HG | Talk 20:07, 24 September 2007 (UTC)
 * I've written a script for this (it relies on (1) out of the three options given here). Sample usage: (copy to the start of your monobook.js, it won't work properly anywhere else)

wbeEditTime=60; wbeWaitTime=540; wbeEndDateY=2007; wbeEndDateM=12; wbeEndDateD=31; wbeBlockAnon=false; importScript("User:ais523/wikibreakenforcer.js");
 * Basically, it enforces a wikibreak, but allows you to start 'editing periods' in which you can log in. The configuration above means that you can edit for 60 minutes at a time, but after doing so, you have to wait 540 minutes before you can log in again (that's wbeEditTime and wbeWaitTime). You can set a date on which it stops enforcing wikibreaks with wbeEndDateY, M, and D; the wbeBlockAnon option is an experimental option you can set to ask the script to try to prevent you viewing/editing Wikipedia even as an anon (you might not want to set this option, and anyway it doesn't work unless you use the 'remember me' preference when logging on). Hope that helps; if you have any more suggestions, feel free to contact me. --ais523 09:41, 25 September 2007 (UTC)
 * Thanks so much for your fast work, Ais523. I'll give it a try this week and let you know (here) if I have any confusions about it. Thanks again! HG | Talk 00:09, 26 September 2007 (UTC)
 * Thanks again! This has worked very well and been helpful. Take care, HG | Talk

WikiBreak Enforcer modification.
Hello, I was wondering if this script could be modified to prevent me from editing during certain hours, but still edit the rest of the day. As you can probably tell, I'm not getting enough sleep. ;) · AndonicO Talk 23:39, 9 October 2007 (UTC)


 * *Points up* Does that answer it? i said 23:41, 9 October 2007 (UTC)

User:Tra/sidebartranslate.js
After my request at Tra's talkpage about an extension to his script to arrange the translated sidebar alphabeticaly, he replied that he didn't know how but thought it possible (diff). Could someone here possibly write the new extension? Chris DHDR 11:25, 20 October 2007 (UTC)
 * See User talk:Alex Smotrov/iwtranslate.js. In the documentation I forgot the installation part, but it's just usual  ∴ AlexSm 22:24, 22 October 2007 (UTC)

Watchlist script
I need A script that would automatically highlight new edits in my watchlist (ones that weren't there the last time I checked my watchlist). Note: I have already considered WikiProject User scripts/Scripts/Watchlist since, however it doesn't suit my needs (in you are unsure you contact me on my talkpage). Script must work on Internet Explorer7.--Sunny910910 (talk 22:28, 30 October 2007 (UTC)
 * I've added this feature to User:ais523/watchlistnotifier.js (tested on Firefox 2 and IE7); watchlist entries that weren't there the last time you viewed your watchlist will be bolded (as well as the other features of the script, which display an unobtrusive message whenever you have a new watchlist entry). You can include it the usual way (by adding {{subst:js|User:ais523/watchlistnotifier.js}} to the end of your monobook.js). --ais523 11:49, 31 October 2007 (UTC)
 * Maybe I misunderstand the original request, but wouldn't using Watchlist since and simply leaving watchlist browser window open all the time be a more convenient option? The suggested watchlistnotifier script needs to be run on the same computer anyway (since it depends on a cookie) ∴ AlexSm 14:57, 31 October 2007 (UTC)
 * Using the "Watchlist since" script may be more convenient for other people, but I dislike having too many browsers open as it clutters everything.--Sunny910910 (talk 23:56, 31 October 2007 (UTC)
 * As for User:ais523/watchlistnotifier.js, I think its what I was looking for.--Sunny910910 (talk 23:58, 31 October 2007 (UTC)

Drop down box
I have a script imported into my JS (I think it was made by ais523) which, when clicking on the tab, brings up a box, where I type in what type of stub I would like to add, and it will automatically add it. I would eventually like to have a drop down box with all the stub types (or some of them) implemented into the popup box. I would add all the necessary types myself, but it would help if someone here could tell me how add in the drop down box. Thanks   jj137  ( Talk ) 00:23, 19 November 2007 (UTC)
 * What do you think of User:ais523/stubtagtab2.js? --ais523 17:53, 22 December 2007 (UTC)
 * That is really cool. Thank you!   jj137  ♠ 18:04, 22 December 2007 (UTC)

Status script
What I am wanting is to add a script to my monobook.js where all I have to do is click a tab/radio button/drop down menu to change this instead of having to always manually go there and manually changing it to in/out/busy. I know this would be a useful script for a lot of people as well. So, anyone up for the task of writing this? -- ALLSTAR  echo 08:28, 10 December 2007 (UTC)
 * No one want to tackle this? It'd be very useful and your WikiHomies would love you for it! ;) -- ALLSTAR  echo 19:33, 12 December 2007 (UTC)
 * It shouldn't be very difficult, but I'm very busy in Real Life at the moment and don't really have time to write it right now. --ais523 19:56, 12 December 2007 (UTC)
 * Personally I find such a script a misuse of server resources. Also, I would never write anything for a user with such signature ∴ AlexSm 20:31, 12 December 2007 (UTC)
 * Thanks for your opinion. See this about what it means to me. -- ALLSTAR  echo 21:58, 12 December 2007 (UTC)
 * Try this. Just made it, for my purposes, actually. I need the same thing. --cuckooman (talk) 21:03, 3 January 2008 (UTC)

Script for different "modes" of editing
This is an idea for a script that I've had for a while. Basically, most editors will be doing one of these things at any given time: reading Wikipedia, contributing, performing maintenance tasks, discussing, or patrolling. While doing any one of these, editors are unlikely to use any scripts related to the others.

Would it be possible to create a script that lets editors switch between these "modes" of using Wikipedia? What I'm thinking is a pulldown menu in the small empty space to the left of the userpage/talk/prefs/contribs links at the top. It would have user-defined settings, and users could set each script they use to be enabled or disabled with certain settings. My guess is it could be created using cookies.

For example, using the example modes I mentioned above, Twinkle and Friendly would be enabled for patrolling and maintenance modes, but disabled for reading, contributing, and discussing modes, where they wouldn't be needed. wikEd would be enabled only for contributing, discussing, and maintenance, while popups would be enabled in all modes.

This script might decrease loading time of JavaScript by having pages load only the scripts for the current mode. It could also help to clear up page clutter caused by using a lot of scripts. Does anyone have an idea of how to go about making this script? Pyrospirit ( talk  ·  contribs ) 22:22, 15 December 2007 (UTC)
 * This wouldn't be too terribly hard. I wrote a quick example of how this could be done:


 * As-is, this simply requires two extra lines for each new script, and sets a crude cookie to enable-disable each one via a javascript: link in the sidebar (and of course, a simple page refresh (but not cache purge) is required, as easy as clicking [Back] and [Forward] in your browser). This can be done a lot snazzier, and the scripts can be grouped in a bigger if block for multiple scripts in one cookie... but this was simply a test/jumping point. --Splarka (rant) 09:27, 16 December 2007 (UTC)


 * Thanks. This is pretty much what I was thinking of. Pyrospirit  ( talk  ·  contribs ) 18:11, 16 December 2007 (UTC)

I've been also thinking how scripts could be optimized for the pages where they cannot be not used at all. There are two aspects here: I think some improvement can be achieved by checking conditions before importing a script: e.g. for editing mode script:. Also some scripts can be called "dynamically" on request (e.g. wlunwatch)∴ AlexSm 15:36, 18 December 2007 (UTC)
 * traffic: the script still gets reloaded from the server from time to time (I don't have any idea how often though)
 * processing time: the script still takes some time to check that it has nothing to do on the page


 * Thanks, I'll try using that. Chance of me breaking something: 99%. Pyrospirit  ( talk  ·  contribs ) 21:46, 18 December 2007 (UTC)


 * Sorry, but this time I broke it: should be  inside   (fixed now) (that wasn't a real script, so I didn't test it as I usually do). I forgot to mention that generally I don't like cookie solutions because I visit Wikipedia from several computers. And another possible way to "switch modes" is to put some scripts into, say, myskin.js, and then switch skins (unfortunately, have to be done manually in preferences) ∴ AlexSm 22:08, 18 December 2007 (UTC)