Jump to content

Wikipedia talk:User scripts/Scripts subpage archive 2

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Equazcion (talk | contribs) at 07:53, 6 October 2013 (Equazcion moved page Wikipedia talk:WikiProject User scripts/Scripts/Archive 2 to Wikipedia talk:User scripts/Scripts subpage archive 2). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

My Scripts have stopped working

I was assessing articles using Outriggr's script when my scripts suddenly stopped working. Here is my monobook.js file: http://en.wikipedia.org/wiki/User:Oneworld25/monobook.js Can anyone help me? Oneworld25 19:57, 20 June 2007 (UTC)[reply]

Try bypassing your cache. If that doesn't work, try removing popups and bypassing your cache again; that should help to narrow down the problem. --ais523 09:32, 2 July 2007 (UTC)

Is there a script with which I can add a link and/or links to the 'navigation' or 'interaction' boxes? ~ thesublime514talksign 19:00, July 2, 2007 (UTC)

Take a look at Wikipedia:WikiProject User scripts/Guide, sections "Structure" and "portlets". Or simply use
addOnloadHook(function(){
 addPortletLink ('p-interaction', 'http://…', 'mylinkname');
})
see addPortletLink() in wikibits.js for full info ∴ Alex Smotrov 20:03, 2 July 2007 (UTC)[reply]
Thanks ~ thesublime514talksign 20:11, July 2, 2007 (UTC)

Unwatch

It seems the "unwatch" script stopped working (at least for me). I think the Watchlist special page itself has been upgraded a bit. Can anyone fix it? Thanks, thesublime514talk • 00:46, July 11, 2007 (UTC)

The action URL for unwatching indeed changed. I'm not sure which URL could be used now, so I can't fix Unwatch. However I have a better (imho) script that works: wlUnwatch (will add it to the list later), please try it out ∴ Alex Smotrov 16:50, 11 July 2007 (UTC)[reply]
Awesome, thanks thesublime514talk • 18:16, July 11, 2007 (UTC)

Removing "Dependencies" column

I'm planning to do a little cleanup on the "Scripts" page, and I would like to remove "Dependencies" column. It's mostly empty or outdated (e.g. for wikEd and CloseAFD.js) or just says "see doc". If you have any objections - please share them now ∴ Alex Smotrov

Excellent. That column was getting rather pointless. Shinobu 12:17, 25 July 2007 (UTC)[reply]

Regex replacing tool

I have given Gerbrant.edit.regexReplace (documentation) a bit of an overhaul. Most changes are cosmetic, but nevertheless should improve the workflow a bit. I hope I didn't introduce new bugs. Shinobu 12:17, 25 July 2007 (UTC)[reply]

Special:Contributions Script

Is there a script that allows me to see a user's S:C page? Possibly like a tab at the top of the page that would take me directly to that user's S:C page? Thanks. MilkTaco 18:25, 10 October 2007 (UTC)[reply]

There's a link to contributions in the toolbox on the left of the screen when viewing a user's userpage, even without installing a script. If that's in the wrong place for you, it would be easy enough to write a script to place it in a tab as well; see our scripts request page. --ais523 18:30, 10 October 2007 (UTC)
Wow. All this time on WikiPedia and I've never noticed that link! Thanks. MilkTaco 18:37, 10 October 2007 (UTC)[reply]

Go and Search buttons in Chick skin

Please excuse the cross posting -- not sure where this belongs.

The Go and Search buttons on the Chick skin spill over into the edit box (in which I am currently typing).

Could they be moved beneath the Search box (directly above the Toolbox label).

Robert Greer (talk) 14:01, 11 December 2007 (UTC)[reply]

Java Script

Is there a java script which allows you to see which user has been on your userpage and subpages. SKYNET X7000 (talk) 12:34, 16 December 2007 (UTC)[reply]

Respond on my talk page if that's possible. SKYNET X7000 (talk) 17:08, 16 December 2007 (UTC)[reply]

Using Scripts on other wikis

Is it possible to use some of these scripts on other wikis? RT | Talk 22:19, 17 January 2008 (UTC)[reply]

Yes, you can use the following code:
document.write('<script type="text/javascript" src="' 
+ 'http://en.wikipedia.org/w/index.php?title=Script_page' 
+ '&action=raw&ctype=text/javascript"></scr' + 'ipt>');
Replacing the yellow highlighted text with the text that's relevant to the script. Bear in mind, however, that scripts that contain references to en.wikipedia may not work correctly on other wikis. Also, if you're using some of the scripts on non-wikimedia wikis, they might rely on features such as the api which may not be installed. Tra (Talk) 22:31, 17 January 2008 (UTC)[reply]

Suggestion

I would like to suggest for someone to make user script that will add dropdown menu on edit toolbar (like on BG and HE wikis) with you can insert templates for infoboxes and other templates. SasaStefanovic 09:26, 26 February 2008 (UTC)[reply]

Deprecate syntax highlighter and inclusion scripts

Wikipedia:WikiProject User scripts/Scripts/Syntax highlighter seems to be deprecated by the site's built-in highlighter now.

Also, the first part of Wikipedia:WikiProject User scripts/Scripts/Inclusion is mostly deprecated by importScript. I suppose the synchronization part could be, too?

The synchronization across wikis cannot be deprecated by importScript, nor can importScript deprecate the other inclusion script, simply because importScript does not exist on the other wikis.

Also, the reason why winc allows brackets inside the link

winc('[[User:SOMEONE/monobook.js]]');         /* Comment about what the script does */

Is because I had another script User:Omegatron/monobook.js/autolinker.js which turned bracketed text in the monobook.js display into links. I think this should be worked into something better that can be used by everyone. — Omegatron 01:46, 4 April 2008 (UTC)[reply]

Request for script

Simple English I see that there is a bilingual script that can display the interwiki pages side-by-side, and I had a similar idea for a Simple English option that displays the Simple version of a page if it exists. Maybe there is a tab on top of the page that switches to the Simple English or has a side-by-side comparison if [[Simple:*]] is present? Does that seem feasible? I don't know if anyone else is interested in that, but I would like it because I could see what really needs work on Simple and it would help me port over information from en.wp. Thanks. -Justin (koavf)TCM20:31, 8 April 2008 (UTC)[reply]

Revised I have a slightly different take on it now, and I've uploaded a couple of mock-ups onto Flickr that indicate what I'm trying to say here (the differences in rounded tabs are a product of a style that I have on en.wp but not on simple.wp):
en2simple
simple2en
Forget the necessity of an interwiki link and install this script on your en account and your simple account to go back-and-forth between the two. Does anyone think he can make that happen? Please post on my talk. -Justin (koavf)TCM00:32, 9 April 2008 (UTC)[reply]

Here's the en version:

addOnloadHook(function() {
    addPortletLink('p-cactions', 'http://simple.wikipedia.org/wiki/' + encodeURIComponent(wgPageName), 'simple')
});

And the simple version:

addOnloadHook(function() {
    addPortletLink('p-cactions', 'http://en.wikipedia.org/wiki/' + encodeURIComponent(wgPageName), 'en')
});

If you need any further modifications to the functionality please ask. GracenotesT § 01:53, 9 April 2008 (UTC)[reply]

Wow Thanks so much, it looks like it's working great. I originally figured it would just be int he main namespace, but being in all of them is handy as well. -Justin (koavf)TCM02:22, 9 April 2008 (UTC)[reply]
I made a small change to the code above, wrapping wgPageName in encodeURIComponent() so that it works even for titles that contain special characters (such as question marks). —Ilmari Karonen (talk) 19:19, 26 July 2008 (UTC)[reply]

Hide talk page templates script

I just wrote a script that hides all those annoying yellow talk page templates in a single collapsed table. I went ahead and added it to the list, though it does not work in Internet Explorer (I'm not sure why). Anyone who knows more about IE can check it out if you'd like. — Bob • (talk) • 00:46, 10 April 2008 (UTC)[reply]

I think you should have tested it a bit more before publishsing. Anyway, it does seem to work in IE6, I don't have IE7 at the moment. However, it doesn't work with Preferences->Misc->"Enable "jump to" accessibility links" (extra <div id=jump-to-nav>), and I'm pretty sure it doesn't work in at least 3 skins. —AlexSm 02:02, 10 April 2008 (UTC)[reply]
I'll continue testing it in other browsers. I just added a few rules that take the user's skin into account, as well as the jump-to nav. — Bob • (talk) • 03:52, 10 April 2008 (UTC)[reply]

Multiple scripts

Is adding a couple of scripts into one .js page going to screw up or should I create new .js pages for each script? --staka (TC) 23:38, 17 April 2008 (UTC)[reply]

Multiple scripts on page are just fine. This even saves resources a bit when your browser requests them from the server (which usually happens once in several days, as far as I know). But remember if one script has an error, everything below will most likely stop working as well. —AlexSm 00:29, 18 April 2008 (UTC)[reply]
Alright, thanks for the help. --staka (TC) 01:31, 18 April 2008 (UTC)[reply]

Following a discussion on WP:VPT, another user wrote a script that converts all links on edit and preview pages to open in new windows (or tabs, given your browser configuration) in Internet Explorer, since it has a bad habit of chucking changed form data should you accidentally click something you shouldn't have. Following that, I asked User:Alex Smotrov for some advice on improving the script, and he subsequently rewrote it for me, after which I made one addition. In its current form, the script runs when you click on a link while editing or previewing, and if the link is not part of the user interface (tabs at top, sidebar, footer, etc.) or a script-generated link (show/hide link on collapsible tables, primarily), the script changes it to open in a new window. I was wondering if the script could be listed here? Also, could anyone take a look and tell me if it'll work in any skins besides Monobook? —Dinoguy1000 18:45, 26 July 2008 (UTC)[reply]

I got tired of waiting for a response and added it myself. Go ahead and move it if I added it to the wrong section, I'm really not sure where the best place for it would be. —Dinoguy1000 21:01, 5 August 2008 (UTC)[reply]
(I didn't notice the 1st message.) Yes, the script should work in all skins. Would be nice if you added a separate script description page though. —AlexSm 21:15, 5 August 2008 (UTC)[reply]
Yeah, I've been thinking about that (as well as playing around and seeing if editors can define further sections to be parsed in their own monobook.js), but I just haven't gotten around to it yet. You can go ahead and start one if you'd like. —Dinoguy1000 21:45, 5 August 2008 (UTC)[reply]

Monobook.js ?

What is a monobook.js ? I would like to add a script but I have no idea of how. I know that you have to save a script somehow, but nothing on wiki tells you how. It says that you have to save it to your monobook.js....which is....?Think about this. Once Bread becomes toast, you can't make it back into bread. (talk) 23:46, 26 August 2008 (UTC)[reply]

Look here. You can edit it just like any other wiki page (but note that only administrators can edit other users' monobook.js files, for security reasons). —Dinoguy1000 17:03, 27 August 2008 (UTC)[reply]

OK, so I want to add a link to my personal links. I figured out how to get the link up there (well, someone else figured it out for me, anyway!), but how can I change its position? --Alinnisawest, Dalek Empress (extermination requests here) 04:51, 28 August 2008 (UTC)[reply]

Proposal to promote User scripts via User boxes

User scripts can bring many benefits to users, and I suggest that they should be better known. One way to promote them is to encourage users of a script to say that they use it, on their user page, using user boxes. This would enable a virtuous circle ("I see that you use it, so I might use it as well").

User scriptsThis user uses:

This would also allow to look at how many users are using a particular script by looking at what pages link to that script page. It would then become possible to list scripts by their popularity.

Any thoughts on this ? Any suggestions for a graphical design ? Pcarbonn (talk) 17:24, 30 August 2008 (UTC)[reply]

For info, I have now created this template, and added it to my userpage. Feel free to improve it.Pcarbonn (talk) 19:54, 31 August 2008 (UTC)[reply]

Any suggestions for replacement script

I have been using a script called User:Outriggr/metadatatest.js to tag and assess articles for various WikiProjects without having to open the talk page first. Unfortunately, the creator has decided to discontinue this script and I would like to know if anybody can recommend a similar script to me? __meco (talk) 15:36, 13 September 2008 (UTC)[reply]

I'd suggest that you have a look at User:Outriggr. Here is what it says: "scripts · User talk:Outriggr/metadata.js graduated to the "Preferences" gadget MediaWiki:Gadget-metadata.js — this was elaborated into the interactive metadatatest.js, which displays and updates an article's assessment templates from an interface on the article page (rather than the talk page). I have abandoned this script, because the whole template and article grading thing is really more busy-work than useful, in general." Pcarbonn (talk) 22:06, 13 September 2008 (UTC)[reply]
I have read that and I don't see how that is helpful to me in finding another script to replace the functionality that I relied on in that script. __meco (talk) 22:29, 13 September 2008 (UTC)[reply]
I am currently maintaining the gadget at MediaWiki:Gadget-metadata.js. I don't know of any complete replacement for metadatatest.js, but I've written a script (located at User:Pyrospirit/metadata/projectbanners.js) that extends metadata.js to duplicate part of the functionality of metadatatest.js. However, projectbanners.js doesn't have any way to modify assessments already in place; it only displays the project banner's name, assessment, and importance for each WikiProject already on the talk page. Pyrospirit (talk · contribs) 03:15, 20 November 2008 (UTC)[reply]

So what's this?

I was cleaning through my monobook, I had copied a few scripts staright instead of importing them. I ran across the following:

 
var cwwpajax;
// From [[WP:US]] mainpage (wpajax renamed to cwwpajax)
cwwpajax={
        download:function(bundle) {
                // mandatory: bundle.url
                // mandatory: bundle.async
                // optional:  bundle.onSuccess (xmlhttprequest, bundle)
                // optional:  bundle.onFailure (xmlhttprequest, bundle)
                // optional:  bundle.otherStuff OK too, passed to onSuccess and onFailure
 
                var x = window.XMLHttpRequest ? new XMLHttpRequest() // Firefox, Safari, Opera, IE7
                : window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") // IE6
                : false;
 
                if (x) {
                        x.onreadystatechange=function() {
                                x.readyState==4 && cwwpajax.downloadComplete(x,bundle);
                        };
                        x.open("GET",bundle.url,bundle.async);
                        x.send(null); 
                }
                return x;
        },
 
        downloadComplete:function(x,bundle) {
                x.status==200 && ( bundle.onSuccess && bundle.onSuccess(x,bundle) || true )
                || ( bundle.onFailure && bundle.onFailure(x,bundle) || alert(x.statusText));
        }
};
 
// Example:
// function dlComplete(xmlreq, data) {
//      alert(data.message + xmlreq.responseText);
// }
//  cwwpajax.download({url:'http://en.wikipedia.org/w/index.php?title=Thresher&action=raw', 
//                   onSuccess: dlComplete, message: "Here's what we got:\n\n" });
 
// End of [[WP:US]] quote
 
//<!--[[Category:Wikipedia scripts]]-->

Does anybody here know what this matches up to or what it's doing? Thanks a lot. Stepshep (talk) 02:04, 20 November 2008 (UTC)[reply]

It's an AJAX script, designed to allow your browser to fetch content "behind the scenes" that isn't actually on the page. The variable names imply that it must be from my category watchlist script (the AJAX code isn't mine originally, by the way, I just copied it); in that case, it's using the AJAX capability to download the list of last-changed dates of categories from the API so they can be checked for changes. Note that it's rather old code; nowadays, there's a function in wikibits.js that does all that, so the gory details are hidden from monobook.js itself (and update over time). --ais523 13:02, 12 February 2009 (UTC)

I have produced an update to "Hide top contributions" that isn't broken for redirects, and also recovers to continue hiding remaining entries if there is any other type of link not matched by either regex. Should I just be bold and change the link in here /Scripts#Contributions to point to my version, or is there a less anarchic procedure not documented here or on the project page.

I have already mentioned my change on the script's talk page.

Mark Hurd (talk) 14:09, 1 April 2009 (UTC)[reply]

I've directed /Scripts#Contributions to my version. Mark Hurd (talk) 14:07, 2 April 2009 (UTC)[reply]

Quick Preview / QPreview

Is the linked version not superseded by user:js/ajaxPreview? The linked version was last edited in 2007, the Js version was edited in April 2009. --Ysangkok (talk) 15:41, 19 July 2009 (UTC)[reply]

My extension to Navigation popups

Can somebody please try my "History reviewer", if it might be usefull to other users? Thanks..  2aprilboy talk 11:06, 6 February 2010 (UTC)[reply]

I'm trying to edit the links at the top of my monobook on wikisource (not here, yet)—see s:User:Spangineer/monobook.js. For example, change "my talk" to "talk", add links to frequently used user pages, etc. I have code in my wikipedia monobook that does this, but after removing some things that I didn't need I couldn't get it to work again. I looked on this page but didn't see a script that does what I want; can I get some help? --Spangineerws (háblame) 05:40, 16 February 2010 (UTC)[reply]

Good news for devs

Wikipedia_talk:WikiProject_User_scripts#Script_purger_for_developers