Wikipedia:WikiProject User scripts/Requests
This page is for requests for new user scripts or help with modifications to existing user scripts. Please first look through the existing scripts and recently fulfilled requests. Also see Old unfullfilled requests.
Templates in edit toolbar
Something like this:
Templates
Cleanup |
Software Taxobox Book |
Choosing "Software", could add to edit box:
{{Infobox Software | name = | logo = | screenshot = | caption = | author = | developer = | released = | latest release version = | latest release date = | latest preview version = | latest preview date = | operating system = | platform = | language = | status = | genre = | license = | website = }}
It's just an example. Is this possible? Mosca2 09:15, 12 May 2007 (UTC)
Wikipedia Suggest
If it's possible, it would be cool is someone could add another search bar below the normal one via a portlet modification to create a Wikipedia Suggest. I found this site and was wondering if anyone could write a script to incorporate it. Also, this site has some screenshots of script that perhaps (?) would be helpful. Thanks, — thesublime514 • talk • 00:14, July 10, 2007 (UTC)
- Notes to help with possibly making something like this: a search suggestions database query is available at <http://en.wikipedia.org/w/api.php?action=opensearch&search=URL%20encoded%20search%20terms>; this is what Firefox 2 uses for its search suggestions when searching Wikipedia from its own search box. The output's in JSON format. --ais523 16:53, 10 July 2007 (UTC)
Constructing templates and copy to clipboard
I have looked through available scripts and can't find anything quite like what I would like. It it exists already, a pointer would be great.
I would like to have added to popups a facility to construct useful templates. This might even be customizable; not sure. The idea is that when you mouse over a link, you have the option to create some standard templates that would be instantly placed into the clipboard. You could then paste them into comments or pages that you are editing. Here are examples.
- When you mouse over a user link, there is an option to put "{{user|username}}" into the clipboard.
- When you mouse over a diff link, there is an option to put "{{wp-diff|page=pagetitle|diff=diffid|oldid=oldid|title=diff}}"
I'm sure other useful possibilities could be given.
Once in the clip board, these could be pasted as required into whatever text you are writing at the time. -- Duae Quartunciae (t|c) 00:20, 21 July 2007 (UTC)
"Undo" button
Please make a script that will add a "Undo" button at the top when viewing articles. The button will undo the current edit, with out having to go though the edit screen. This would be very good for undoing vandalism... thanks! EvilHom3r 02:21, 7 August 2007 (UTC)
- From the article page it's not clear how many last edits to undo. If you simply want to skip the eidt screen, I'm not sure but I think that Navigation popups and Twinkle can do that. P.S. Did you really need 3 edits to write your message? ∴ Alex Smotrov 03:15, 7 August 2007 (UTC)
Page edit alert
Hi, there. I was wondering if it is possible to create a user script (to be located on monobook.js) that enables a user to be alerted when a specific WP page gets edited (this would be the talk page of WikProject Olympics). A script that would work in the same way that when a user gets a "new message" alert whenever his/her talk page gets edited by other users. Can anyone help? Thank you. Parutakupiu 17:45, 8 August 2007 (UTC)
- This would require additional requests to the server; what's wrong with simply checking your watchlist from time to time? ∴ Alex Smotrov 20:13, 8 August 2007 (UTC)
- Perhaps a watchlist notifier is what you are looking for? It will display a message every time a watched page is edited. —Anas talk? 20:49, 8 August 2007 (UTC)
Whatlinkshere sorting
I suppose I'm not the first one to request this, but I would appreciate it greatly if a script that sorts entries in Special:Whatlinkshere is written or suggested. The required feature is bringing redirects to the top of the page, that is pages from the main namespace automatically tagged "(redirect)". The same goes for "(transclusion)" entries for templates. Additionally, entries can be also grouped by namespace at the end of the list. (I'm aware of scripts that add selection tabs, but as far as I know they do not provide sorting redirects and transclusions.) Súrendil 20:49, 12 August 2007 (UTC)
- It's a great idea, but it can't be done correctly just with javascript. Any javascript tool will work only on the links that are already shown on the page. OTOH, it should be possible to fake this by listing links and transclusions separately using api.php. I'm not sure about redirects though. All in all, it would probably work best as a Mediawiki feature. Zocky | picture popups 08:41, 13 August 2007 (UTC)
- Mightn't it just be possible to ask for the maximum (5000), and then assume that's everything and sort that? That would get around the problem with which links are already shown on the page. ais523 14:17, 13 August 2007 (UTC)
warning scrips
i am just wondering if a warning script that uses uw tags that will work on IE will be created or if there is one already where i can find it--AFUSCO 22:20, 20 September 2007 (UTC)
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)
One-click restore-this-version for wikibooks
I know this WikiProject is for Wikipedia, but here's hoping... I'm looking for a script that will provide a one-click restore-this-version functionality and nothing else. I imagine existing code, such as twinklefluff or revert tools, can easily be adapted and pared down to provide this. Big thanks in advance! – Mike.lifeguard | talk 05:05, 20 October 2007 (UTC)
Done Using only some part of TW does this. – Mike.lifeguard | @en.wb 17:53, 11 January 2008 (UTC)
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? ChrisDHDR 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
importScript('User:Alex Smotrov/iwtranslate.js')
∴ AlexSm 22:24, 22 October 2007 (UTC)
Quicklink
Is there a script that could let me click a link in the toolbox or make a tab that would bring me down to a user's sandbox? If you really want to know why I want it I'll say, but it's embarrassing... YДмΔќʃʀï→ГC← 10-23-2007 • 23:38:52
- As a one-liner, you could use the following:
addPortletLink ('p-tb', location.href+'/Sandbox', 'Sandbox subpage');
- This may need to be customized depending on exactly what you want to do, though. --ais523 19:44, 2 November 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 Wikipedia: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|Contributions) 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|Contributions) 23:56, 31 October 2007 (UTC)
- As for User:ais523/watchlistnotifier.js, I think its what I was looking for.--Sunny910910 (talk|Contributions) 23:58, 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|Contributions) 23:56, 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)
New page link
I would like to have a link in the toolbox showing a link to Special:Newpages, just below the Recent changes link. ChrisDHDR 10:27, 17 November 2007 (UTC)
addOnloadHook(function() {
addPortletLink ('p-tb', wgArticlePath.replace(/\$1/,'Special:Newpages'), 'New pages');
});
--Splarka (rant) 08:09, 18 November 2007 (UTC)
- Sorry, but that doesn't work. ChrisDHDR 15:19, 1 December 2007 (UTC)
- Yes it does. Maybe try it at the top of your very crowded momobook.js, or on a blank slate. --Splarka (rant) 09:50, 2 December 2007 (UTC)
- I just did the above to set a link to CAT:SPEEDY and IT WORKS! Muahahah! I had to leave a message just to revel in the fact that I, inept at any kind of programmingness, managed to do that. Woot!! SGGH speak! 10:58, 27 January 2008 (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)
Alternate watchlists
I haven't found this but if it exists, point me to it. I find myself struggling against the limitations of a single watchlist. What I really want is alternate watchlists which I can automatically add pages to with minimal fuss. This way I could focus different watchlists on specific projects/interests. I have one page set up like this here. It uses [[Special:Recentchangeslinked/User:{{PAGENAME}}]] to make a watchlist out of the links on the page where the code is placed.
Ideally, I want a way to add a regular wikilink for a page I'm viewing onto a subpage of my userpages, at the end of a column of such links. Preferably, it would allow me to specify one of, say, five pages (just pulling a number out of the air).
If anyone knows of a way to do this, point me to it. Cheers, Pigmanwhat?/trail 00:58, 22 November 2007 (UTC)
- I don't exactly see what you mean. Something like this? (to use it, make a new array of page names called
watchlists
) --cuckooman (talk) 00:37, 4 January 2008 (UTC)
Image tagging script only partially working
The functions "freeimg", "nonfreeimage", "extrarationale" and "nonfreemedia" only work on Special:Upload, not while editing imagespace. Any idea why? Will (talk) 01:55, 1 December 2007 (UTC)
- Conflicty definitions, try something like this instead
if(wgAction=='edit') { var txt = document.editform.wpTextbox1; txt.value += thetag; } if(wgPageName=='Special:Upload') { var txt = document.getElementById("wpUploadDescription"); txt.value = thetag; }
- Or simply check if the elements exist, eg
if(document.editform.wpTextbox1)
.--Splarka (rant) 09:04, 1 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? -- ALLSTARecho 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! ;) -- ALLSTARecho 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. -- ALLSTARecho 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)
- Thanks for your opinion. See this about what it means to me. -- ALLSTARecho 21:58, 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)
- 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)
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:
if (parseInt(getCookie('enableTwinkle')) == 1) importScript('User:AzaToth/twinkle.js')
if (parseInt(getCookie('enableSearchbox')) == 1) importScript('User:Zocky/SearchBox.js')
function extensionHandler() {
addPortletLink('p-tb','javascript:cookieToggle("enableTwinkle")','Twinkle','t-e-twinkle','toggle twinkle','1');
addPortletLink('p-tb','javascript:cookieToggle("enableSearchbox")','Searchbox','t-e-searchbox','toggle searchbox','2');
}
addOnloadHook(extensionHandler);
function cookieToggle(cookiename) {
var cookiestatustext = ['disabled','enabled'];
var cookiestatus = parseInt(getCookie(cookiename));
if (isNaN(cookiestatus)) cookiestatus = 0
cookiestatus = (cookiestatus==0) ? 1 : 0;
setCookie(cookiename,cookiestatus);
alert('The extension control >>' + cookiename + '<< has been:\n' + cookiestatustext[cookiestatus]);
}
// Cookie helpers, modified from en.wiktionary
function setCookie(cookieName, cookieValue) {
var today = new Date();
var expire = new Date();
var nDays = 365;
expire.setTime( today.getTime() + (3600000 * 24 * nDays) );
document.cookie = cookieName + "=" + escape(cookieValue)
+ ";path=/"
+ ";expires="+expire.toGMTString();
}
function getCookie(cookieName) {
var start = document.cookie.indexOf( cookieName + "=" );
if ( start == -1 ) return "";
var len = start + cookieName.length + 1;
if ( ( !start ) &&
( cookieName != document.cookie.substring( 0, cookieName.length ) ) )
{
return "";
}
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
function deleteCookie(cookieName) {
if ( getCookie(cookieName) ) {
document.cookie = name + "=" +
";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
}
- 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:
- 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
I think some improvement can be achieved by checking conditions before importing a script: e.g. for editing mode script: if (wgAction=='edit' || wgAction=='submit') importScript(...)
. Also some scripts can be called "dynamically" on request (e.g. wlunwatch)∴ AlexSm 15:36, 18 December 2007 (UTC)
- 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
==
insideif
(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)
- Sorry, but this time I broke it: should be
Warn
I'm sorry to have to ask your assistance again, but I've been trying to develop a tool and I think I needs your (the people here's) help. I'm trying to develop a tool (see User:Jj137/quickwarn.js) that will add a link at top next to "watch"-- but only on user talk pages-- that will allow me to open two prompt windows, one at a time, and automatically add a warning to a vandal's talk page. If you see the quickwarn.js page you will probably understand what I am trying to do. Thanks, and hope you can help. jj137 ♠ 05:02, 26 December 2007 (UTC)
- Maybe you should use my auto_mod script. Add it to your script with:
importScript("User:Jnothman/automod.js");
- Then, given an article TITLE which you want to add BEFORE to the beginning of, AFTER to the end of and using a SUMMARY, simply send the browser to the to the URL created by am_make_url("TITLE", "BEFORE", "AFTER", "SUMMARY"). To get the page title, use am_get_title(), which you might then want to check for starting with "User talk". jnothman talk 13:23, 29 December 2007 (UTC)
Suggest links script
I am looking for a script to help with WP:Dead-end pages. There is a tool here: [1] that seems to be broken and a script tool would be great.
Thanks GtstrickyTalk or C 17:31, 26 December 2007 (UTC)
Script Requested
Is there a possibility if a script could be made, so that anyone can detect which IP address or user who has been on there userpage or monobook.js file and what they have done, which will be updated every second or minutes reason for this is because occasionally i always have a feeling that someone is on the userpage or subpage doing something which the watchlist isn't reporting, since certain things have vanished on the toolbox or some text on userpages and subpages. Is this possible. →Yun-Yuuzhan→ 17:36, 28 December 2007 (UTC)
- This isn't about the request, but no one else can edit your monobook.js but you. (and probably admins) Or so I gather from that I can't edit your monobook.js. It's probably just a glitch. --cuckooman (talk) 20:49, 3 January 2008 (UTC)
- Yep, admins can edit monobooks. jj137 ♠ 03:49, 4 January 2008 (UTC)
Image Summary Editing
I've written a proposal here User:Mbisanz/ImageSystemProposal that would create a script that could add the article= variable to image summaries of images used in more than one article. There is an existing script, but I don't know how to modify it. Mbisanz (talk) 22:55, 30 December 2007 (UTC)
Cleanup of Splarka's sorting script for Special:Log/rights
/RightsSorter.js needs cleanup. This is supposed to let you filter out one right change you don't care about (ie. "rollback") and it autofilters out null rights changes. – Mike.lifeguard | @en.wb 04:52, 10 January 2008 (UTC)
- Not exactly what you requested, but I just updated LogPage Table script to recognize giving/removing rollback flag and use appropriate icons ∴ AlexSm 18:06, 10 January 2008 (UTC)
Right; this script is for looking at Special:Log/rights and sorting out the different rights changes (not just rollback, I think), since MW doesn't let you narrow the log down further than that (pending bugzilla:12571). – Mike.lifeguard | @en.wb 19:49, 10 January 2008 (UTC)
Done at User:Splarka/rightsfilter.js. It's really nice too! – Mike.lifeguard | @en.wb 00:38, 12 January 2008 (UTC)
- Yah, please delete /RightsSorter.js too, embarrasing outline. --Splarka (rant) 00:43, 12 January 2008 (UTC)
Man, that form building code would be so much nicer if it used my Easy DOM code:
with (easydom) {
var rf = form({ 'action': 'javascript:void(0)', 'id': 'rfform' },
fieldset(
legend('Filter rights log (javascript)'),
select({ 'id': 'rfselect' },
option('added rights'),
option('removed rights'),
option('added OR removed'),
option('added/removed/static')
),
label({ 'for': 'rfinput1' }, ' Regex string: '),
' ',
input({ 'id': 'rfinput1', 'name': 'rfinput1', 'type': 'text' }),
input({ 'id': 'rfinput2', 'name': 'rfinput2', 'type': 'checkbox' }),
label({ 'for': 'rfinput2' }, 'Invert '),
input({ 'type': 'button', 'value': 'filter', 'onclick': 'filterRights(false)' }),
' ',
input({ 'type': 'button', 'value': 'hilight', 'onclick': 'filterRights(true)' })
)
);
}
(this form is untested, but Easy DOM is extensively tested). Mike Dillon 03:51, 12 January 2008 (UTC)
- Well, sure, but that would require, what, four extra pages of code being downloaded and parsed by the browser?... to turn a page and a half of code into half a page of code. The net gain for this implementation seems negative. ^_^ --Splarka (rant) 04:42, 12 January 2008 (UTC)
- You just reminded my why I've been spending most of my wiki-time on Wiktionary. Thanks. Mike Dillon 04:55, 12 January 2008 (UTC)
Can someone tell me why my script doesn't work? It's suppost to added {{subst:Vandalism1}}
onto a user's talkpage, without saving it so I can added the article name. I need a script like this because TW doesn't work on IE which I intend to use it on. If anybody can help it would be appreciated. I am not much of a javascript writer, I borrowed this foundations of this script from another script that someone gave me, it needed I could show it. --Sunny910910 (talk|Contributions) 04:15, 3 February 2008 (UTC)
- Javascript is case sensitive. You have javascript:Vand1(), but function vand1(). --Splarka (rant) 08:16, 3 February 2008 (UTC)
- No wonder why it didn't work. Thanks!--Sunny910910 (talk|Contributions) 21:47, 3 February 2008 (UTC)
Coordinate alternate links
Could somebody create a popup when click on it similar to the wikiminialtas. And fill in map services that can be customized with a final link to the geohack page at the bottom. — Dispenser 15:07, 3 February 2008 (UTC)
- If I understand correctly, instead of going directly to geohack you would like a "popup menu" with several choices, right? ∴ AlexSm 17:30, 5 February 2008 (UTC)
- Yes, I think there might be some code in the wikiminiatlas that you could steal to do this easily. The original idea was posted on the GeoHack page. — Dispenser 02:21, 9 February 2008 (UTC)
- Actually, there are two separate ideas. The one linked above would allow people to move services around in the GeoHack list, and have them in the same order when coming back to the page again. I've implemented the shuffling part to test it, see GeoHack-shuffletest.html. It still needs more Javascript to save the offsets to a cookie every time a row is moved, and to load them from the cookie and shuffle the rows when the page is loaded.
Another idea closer to what AlexSm is thinking of, is a GeoHack replacement in Javascript, as some people are uncomfortable having to go to a separate page and choose a service. There are probably two groups: 1) people who don't want to choose at all, but just want direct links to any map service, and 2) people who want to choose from the most popular ones only. I've implemented the first one partially with Google Maps Love.js, which adds another icon next to all coordinates, but it doesn't handle scales which is somewhat important with getting a map of the right size. The second one would indeed need a popup to be fast for people who don't like the extra clicking.
If anyone feels like working on these, please go ahead and rip the code. --Para (talk) 03:57, 9 February 2008 (UTC)
- Actually, there are two separate ideas. The one linked above would allow people to move services around in the GeoHack list, and have them in the same order when coming back to the page again. I've implemented the shuffling part to test it, see GeoHack-shuffletest.html. It still needs more Javascript to save the offsets to a cookie every time a row is moved, and to load them from the cookie and shuffle the rows when the page is loaded.
toolbox item or tab with a short format link using « oldid={{REVISIONID}} »
→ bugzilla:000268 · "Short-hand link / URL for referring to specific version"
Dear friends; Can somebody implement a gadget which adds a toolbox item or tab with a short format link using « oldid={{REVISIONID}} » ? It will be very helpfull for non-Latin projects. Thanks for all your efforts in advance! Best regards
·לערי ריינהארט·T·m:Th·T·email me· 20:35, 3 February 2008 (UTC)
- Example:
- today m:wikt:yi:װיקיװערטערבוך:קאַװע־הױז should generate the link
http://yi.wiktionary.org/w/index.php?oldid=11715
·לערי ריינהארט·T·m:Th·T·email me· 21:00, 3 February 2008 (UTC)
- today m:wikt:yi:װיקיװערטערבוך:קאַװע־הױז should generate the link
- test:
[{{fullurl:{{FULLPAGENAME}}|action=purge}}#bugzilla_268 ↺ purge ↺] · generates {{REVISIONID}} here<br /> [{{fullurl:{{FULLPAGENAME}}|oldid={{REVISIONID}}}} rev-ID : {{REVISIONID}}] · helps only if {{REVISIONID}} is available<br /> [{{fullurl:|oldid={{REVISIONID}}}} rev-ID : {{REVISIONID}}] · does not help here<br /> {{SERVER}}{{SCRIPTPATH}}/index.php?oldid={{REVISIONID}} · helps only if {{REVISIONID}} is available<br /> {{#IF: {{REVISIONID}} | '''[{{SERVER}}{{SCRIPTPATH}}/index.php?oldid={{REVISIONID}} short url]''' }}
generates:
↺ purge ↺ · generates {{REVISIONID}} here
rev-ID : - · helps only if {{REVISIONID}} is available
rev-ID : - · does not help here
//en.wikipedia.org/w/index.php?oldid=- · helps only if {{REVISIONID}} is available
short url
- Bests regards
- ·לערי ריינהארט·T·m:Th·T·email me· 16:56, 5 February 2008 (UTC)
- I'm not sure I fully understand you request. There was a (maybe similar) request in ru.wp to remove
title=...
part from the existing «Permanent link» on the left. As a result, when you follow this link, you do not have a long percent-encoded URL in the browser address field. The code is simple, see below ∴ AlexSm 17:30, 5 February 2008 (UTC)
- I'm not sure I fully understand you request. There was a (maybe similar) request in ru.wp to remove
addOnloadHook(function(){ //remove title from permalink
var pLink = document.getElementById('t-permalink')
if (pLink) pLink.firstChild.href = pLink.firstChild.href.replace(/title=[^&]*&/,'')
})
- Thanks AlexSm! I remember this request and I remember also a bugzilla: report but I could not find it.
- With http://yi.wiktionary.org/w/index.php?diff=11784&oldid=11464 I experimented with this / implemented this at « wikt:yi: » . It works fine. As you can see I am using short format diff links. Have there been similar discussions about « diff » at « w:ru: » beside the « Permanent link » discussion? Best regards
- ·לערי ריינהארט·T·m:Th·T·email me· 03:26, 6 February 2008 (UTC)
- http://yi.wikisource.org/w/index.php?oldid=3487 is the code at « s:yi: »
- ·לערי ריינהארט·T·m:Th·T·email me· 03:34, 6 February 2008 (UTC)
- You could try this code below. It should cut the
title
part from diff links whenever you click on them, even when you open them in new windows/tabs ∴ AlexSm 16:38, 7 February 2008 (UTC)
addOnloadHook(shortDiffURLs)
function shortDiffURLs(){
addEvent(document.body, 'mousedown', shortDiffClick)
}
function shortDiffClick(e){
e = e || window.event
var targ = e.srcElement || e.target
var url = targ.href
if (!url || (url.indexOf('diff=') == -1)) return
targ.href = url.replace(/title=[^&]*&/,'')
}
- I also happent to have a script (not published here yet) that can decode URLs in the edit window. E.g. you paste
http://en.wikipedia.org/wiki/Wikipedia:Administrators%27_noticeboard
, press the button, and this is changed into[[Wikipedia:Administrators' noticeboard]]
. Of course, this script is much more useful on non-latin wikis ∴ AlexSm 16:38, 7 February 2008 (UTC)
- I noticed that you have a very unusual signature that makes it very difficult to follow conversations ... ∴ AlexSm 16:38, 7 February 2008 (UTC)
- The signature demonstrates bugzilla:012225. Please look at commons:user:לערי ריינהארט#bugzilla 012225 (the last section of the user page), edit that section and look at the usage of template:style/ril. Best regards
- ·לערי ריינהארט·T·m:Th·T·email me· 12:57, 8 February 2008 (UTC)
user script for magical Esperanto character conversion at arbitrary wikis
Dear friends; The MediaWiki code contains a « magical Esperanto character conversion » which is enabeled at all Esperanto projects. The requested Javascript should add this character conversion to arbitrary wikis via user JavaScript pages. Thanks for all your efforts in advance! Best regards
·לערי ריינהארט·T·m:Th·T·email me· 21:05, 3 February 2008 (UTC)
- Personally, I have no idea what kind of conversion is that ∴ AlexSm 17:30, 5 February 2008 (UTC)
Dear AlexSm please see http://eo.wikipedia.org/w/index.php?&oldid=1560278 and the following revisions. I tried to simulate
cx converts to ĉ gx converts to ĝ hx converts to ĥ jx converts to ĵ sx converts to ŝ ux converts to ŭ ... continued at « w:eo: »
Because the description here is a "meta language" I did not simulate all requirements at « w:eo: » .
cxx and cxX converts to cx cxxx converts to ĉx cXxX converts to ĉX cxXx, cXXx, and cXXX converts to ĉX
The algorithm is as follows:
- it is triggered if lower or upper case c, g, h, j, s or u is followed by lower or upper case x
- it is necessary to identify the string to be substituted
- that string starts with the (first) character that triggered the algorithm
- that string contains also the following lower or upper case x and all subsequent lower or upper case x's
- processing starts from the end of the string to be substituted; from the last x|X
- main substitution /convertion loop
- the last but one character is analyzed
- is it upper or lower case
- is it c|C, g|G, h|H, j|J, s|S, u|U or x|X
- to determing the substitution / conversion one should
- preserve the case
- substitute / convert the last and last but one character to ĉ|Ĉ, ĝ|Ĝ, ĥ|Ĥ, ĵ|Ĵ, ŝ|Ŝ, ŭ|Ŭ, or x|X depending of the match identified before
- readjust the string to be substituted; it is shortened by two characters at the end
- the last but one character is analyzed
- the algorithm stops either if only one character from the string to be substituted has left or that string is empty
- example:
- « cxgxhx » should trigger the algorithm three times and generate « ĉĝĥ »
- Best regards
- ·לערי ריינהארט·T·m:Th·T·email me· 04:28, 6 February 2008 (UTC)
An implementation
Here is a working example script: User:Splarka/esperanto.js
- Note that "
cXxX converts to ĉX
" ... it actually it produces "ĉx".
The way you described it seemed overly complex. What I did:
- On document load it adds a new portlet tab (this could be automated I suppose, but this can be very slow on large pages).
- Clicking the tab on action=edit or action=submit (preview) only affects the textarea, on all other actions it checks the bodyContent (this could be expanded to the whole document I suppose)
- All text nodes of the above selected object are searched for the regex matches to
/[cghjsu][x]+/ig
- These matches are iterated over in reverse for each node (this is to prevent messing up the match count by changing the match).
- For each match, the length of the match is determined.
- If it is an even length, the first two characters are converted (with the case determined by the case of the first character)
- If it is an odd length, the first one character is left literal, the rest of the X pairs (if any) are cropped to the first. so [xX][xx][Xx] returns xxX
- For the rest of the match, the pairs of Xs (if any) are cropped to the case of the first. so [xX][xx][Xx] returns xxX
- All text nodes of the above selected object are searched for the regex matches to
As far as I can tell, this almost exactly matches what eo.wikipedia does.... test it? --Splarka (rant) 23:02, 8 February 2008 (UTC)
validation check for ISBN links
→ bugzilla:002391 · "Implement a validation check for ISBN links"
Dear friends; Can somebody implement this as a JavaScript? Thanks for all your efforts in advance! Best regards
·לערי ריינהארט·T·m:Th·T·email me· 21:36, 3 February 2008 (UTC)
- The checking algorithm itself looks easy to implement, but you also need some kind of interface to that. Advisor script seems like a perfect choice for this task. You could ask the authour to build ISBN checks into his script, or we could probably create a "plugin" as described at the bottom of the script description ∴ AlexSm 17:30, 5 February 2008 (UTC)
watch tab that adds images and/or templates of an article to watchlist
I'd like to request a script that would add a tab (or some other button) that could watchlist all images (and maybe templates) used in an article. A lot of images go unwatched for many articles. It would be great to be able to watchlist all of the images in an article in one click. -- Ned Scott 05:23, 5 February 2008 (UTC)
- I do not work with images, but as far as I know, you will not see deletions or new versions uploads in your watchlist. You will only be notified when someone changes the image description. Also, there doesn't seem to be a way for a script to add a Commons image to your watchlist. Adding templates to your watchlist is possible, however they might include other templates which are still not going to be watched by you ∴ AlexSm 17:30, 5 February 2008 (UTC)
- Yeah, I figured as much. While rare, I have seen some cases of image description page vandalism, and some test edits that have removed image tags and such. Deletion notices would also trigger the watchlist, as well as anything posted on the talk page. Most people probably wouldn't have a use for it, but it's something I've always kind of wanted. -- Ned Scott 07:23, 6 February 2008 (UTC)
Script Request
Hi, I'd like to request a script. WP:PT used to be ordered by date until it was deprecated in December 2007. I would like to be able to order protected titles by date again, so I can see the most recent additions to the list. I am unable to code such myself. (of course, if there is an existing way to do so, I'd be very happy). Please let me know if I can/should help in any way. Chubbles (talk) 01:31, 8 February 2008 (UTC)
- Please fix your shortcut. If you meant Special:Protectedtitles, I think the only way is to check the protection log: Special:Log/protect. Of course, a script could be created to filter log entries and show only "create" protections, maybe using API ∴ AlexSm 03:25, 8 February 2008 (UTC)
- Yeah, that shortcut used to point to Wikipedia:Protected titles. Chubbles (talk) 06:43, 8 February 2008 (UTC)
- I made a script recently for filtering Special:Log/rights (that later was expanded to all rights, and later to work with any page that has a bunch of <li> in it). It works fine for Special:Log/rights but only filters what is on the page. To use it you simply add to your user js: importScript(User:Splarka/lifilter.js), go to the protect log eg: limit=500, click the [filter] tab, use the regex string create\=, and click [filter] or [hilight]. Of course it could be done better, but this is already written as a springboard (if badly). --Splarka (rant) 08:17, 8 February 2008 (UTC)
- Yeah, that shortcut used to point to Wikipedia:Protected titles. Chubbles (talk) 06:43, 8 February 2008 (UTC)
w3.org validation tabs
Dear friends; Please create some gadget functionality to provide w3.org validation tabs similar to
[http://validator.w3.org/check?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}?uselang={{CONTENTLANG}}}}&charset=%28detect+automatically%29&doctype=Inline&group=0 XHTML 1.0]<br /> [http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}?uselang={{CONTENTLANG}}}} CSS]<br />
Thanks for all your efforts in advance! Best regards
·לערי ריינהארט·T·m:Th·T·email me· 11:59, 8 February 2008 (UTC)
simplified
[http://validator.w3.org/check?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}&charset=%28detect+automatically%29&doctype=Inline&group=0}} XHTML 1.0]<br /> [http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}}} CSS]<br />
Best regards
·לערי ריינהארט·T·m:Th·T·email me· 12:03, 8 February 2008 (UTC)
notes
{{URLENCODE:... {{FULLPAGENAME}}}} will fail here; one could use short url's
[http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}{{SCRIPTPATH}}/index.php?oldid={{REVISIONID}}}} CSS]<br />
generating:
CSS
alternatively one could try to use liks containing {{FULLPAGENAMEE}}
Best regards
·לערי ריינהארט·T·m:Th·T·email me· 12:11, 8 February 2008 (UTC)
- I am not sure I fully understand all of your request, but I took the first example and made it into a script to add tabs to the toolbox (below the search box):
addOnloadHook(function() {
var xmlurl = 'http://validator.w3.org/check?uri=' + encodeURIComponent(wgServer + wgScript + '?title=' + encodeURIComponent(wgPageName) + '&uselang=' + wgContentLanguage) + '&charset=%28detect+automatically%29&doctype=Inline&group=0';
addPortletLink('p-tb',xmlurl,'XHTML 1.0');
var cssurl = 'http://jigsaw.w3.org/css-validator/validator?uri=' + encodeURIComponent(wgServer + wgScript + '?title=' + encodeURIComponent(wgPageName) + '&uselang=' + wgContentLanguage);
addPortletLink('p-tb',cssurl,'CSS 2.1');
});
Thanks Splarka! I tested the functions at m:s:yi:MediaWiki:Common.js oldid=3489. Best regards
·לערי ריינהארט·T·m:Th·T·email me· 19:20, 9 February 2008 (UTC)
simplified and working (usinf {{FULLPAGENAMEE}})
[http://validator.w3.org/check?uri={{URLENCODE:{{SERVER}}/wiki/}}{{FULLPAGENAMEE}}&charset=%28detect+automatically%29&doctype=Inline&group=0 XHTML 1.0]<br /> [http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}/wiki/}}{{FULLPAGENAMEE}} CSS]<br />
generating:
Best regards
·לערי ריינהארט·T·m:Th·T·email me· 18:57, 9 February 2008 (UTC)
FYI: CSS validator uri bug
Dear friends; Please read about "different uri= parameter encoding at http://validator.w3.org/check?uri= and http://jigsaw.w3.org/css-validator/validator?uri=" at m:wikt:yi:user:I18n/CSS validator uri bug. I noticed this while "traveling'"" through different language wikis. Best regards
·לערי ריינהארט·T·m:Th·T·email me· 01:21, 10 February 2008 (UTC)
- Okay, try this version with a null title, references the article by curid.
addOnloadHook(function() {
var xmlurl = 'http://validator.w3.org/check?uri=' + encodeURIComponent(wgServer + wgScript + '?title=-&curid=' + wgArticleId + '&uselang=' + wgContentLanguage) + '&charset=%28detect+automatically%29&doctype=Inline&group=0';
addPortletLink('p-tb',xmlurl,'XHTML 1.0');
var cssurl = 'http://jigsaw.w3.org/css-validator/validator?uri=' + encodeURIComponent(wgServer + wgScript + '?title=-&curid=' + wgArticleId + '&uselang=' + wgContentLanguage);
addPortletLink('p-tb',cssurl,'CSS 2.1');
});
- This would also be possible with '?title=-&curid=' + wgCurRevisionId too. --Splarka (rant) 09:55, 12 February 2008 (UTC)
uselang=foo tabs
Dear friends; Please create some gadget functionality to provide uselang=foo tabs. They should be used when working at a wiki and if one would like to see / verify the user interface in another language. The code can be similar to
{{fullurl:{{FULLPAGENAME}}|uselang=foo}}
An example is available at the test wiki: template:this/eng. Thanks for all your efforts in advance! Best regards
·לערי ריינהארט·T·m:Th·T·email me· 12:50, 8 February 2008 (UTC)
- Hows this? the var langs array defines which langs to add buttons for.
addOnloadHook(function() {
var langs = ['en','de','fr','ru'];
for(var i=0;i<langs.length;i++) {
addPortletLink('p-cactions',wgServer + wgScript + '?title=' + encodeURIComponent(wgPageName) + '&uselang=' + langs[i], langs[i]);
}
});
Thanks Splarka! I tested the functions at m:s:yi:MediaWiki:Common.js oldid=3490.
For some reason not known to me the tabs disapear if I select the « de » tab - Deutsch. I have selected « yi - ייִדיש » preferences.
I experienced similar behaviour about a disapearing « purge » tab at « wikt:yi: » if I select « de - Deutsch » as language in my preferences there.
I am using the following browsers:
- a) Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.1.3) Gecko/20070427 Firefox/2.0.0.3 on Linux KDE 3.5.5
- b) Opera see configuration at http://test.wikipedia.org/wiki/User:I18n/Opera
- c) Konqueror 3.5.5 (Using KDE 3.5.5)
- all on KDE version 3.5.5; System: Linux; Release: 2.6.22-gentoo-r2; Machine: i686
Can you please investigate on this? Thanks for all your efforts in advance. Best regards
·לערי ריינהארט·T·m:Th·T·email me· 19:40, 9 February 2008 (UTC)
- Common.js and Monobook.js is called on every page through title=-&action=raw&gen=js file. The new code you just added is not there yet, so this looks like a caching issue. I think you just have to wait. / AlexSm 20:45, 9 February 2008 (UTC)
Thanks Alex for the comment! I implemented w:yi:MediaWiki:Gadget-UseLang and w:yi:MediaWiki:Gadget-UseLang.js at w:yi:special:Preferences. As far as I can see the new tabs are inserted at an absolut position from the reference point which is at the right on « w:yi: » . Depending on the lenght of the previous tabs one can see some of the new tabs or not; this is language dependent; it depends on what tab you have clicked before.
Please take a look at w:nn:special:Prefixindex/MediaWiki:Gadget. There you will find many language related gadgets. They are implemented / selectable one by one. This might be also the case for different contributors and visitors at « w:yi: » . How such a code would look like?
re: « caching issues » I created a lot of test pages as « user:I18n » . These are oficial aliases as decribed at fr:project:Alias de Wikipédiens#Les alias officiels. The list can be seen at commons:user:I18n#i18n accounts. I did not experience much page caching because immediatelly after placing some notes at the « MediaWiki talk:Gadgets-definition » pages the « validations at w3.org: XHTML 1.0 » links at these test pages returned either a green / OK status or a minimal amount of errors (one error). Exceptions where the following UTF-8 languages: sd: ru: zh: ja: .
Best regards
·לערי ריינהארט·T·m:Th·T·email me· 22:48, 9 February 2008 (UTC)
P.S. w:yi:MediaWiki:Gadget-UseLang does not work at w:yi:special:Preferences. No clue why. Best regards
·לערי ריינהארט·T·m:Th·T·email me· 23:31, 9 February 2008 (UTC)
- P.P.S. The UseLang code work in « s:yi » (the language tabs show up at s:yi:special:Preferences). The UseLang code is defined there trough s:yi:MediaWiki:Common.js. But the language tabs do not show up at wikt:yi:special:Preferences and they do not show up at w:yi:special:Preferences. Regards
- ·לערי ריינהארט·T·m:Th·T·email me· 09:07, 11 February 2008 (UTC)
- Gadgets don't load for Special:Preferences (for security). So if you want this on that page, you can add to MediaWiki:Common.js at these projects :
if(wgCanonicalSpecialPageName == "Preferences") addOnloadHook(function() {
var langs = ['en','de','fr','ru'];
for(var i=0;i<langs.length;i++) {
addPortletLink('p-cactions',wgServer + wgScript + '?title=' + encodeURIComponent(wgPageName) + '&uselang=' + langs[i], langs[i]);
}
});
- And have that for all users, but any other page require the gadget. --Splarka (rant) 09:23, 11 February 2008 (UTC)
- Implemented at wikt:yi:MediaWiki:Common.js?diff=11822&oldid. It works fine. Thank you very much! Best regards
- ·לערי ריינהארט·T·m:Th·T·email me· 09:33, 11 February 2008 (UTC)
Syntax highlighting
I'd like to have a tool that highlights the wiki syntax. I know that WikiEd does this, but it also does a lot of other stuff I don't need nor want. All I need is syntax highlighting. I'm using Mozilla Firefox. MahangaTalk 01:47, 9 February 2008 (UTC)
- Do you mean highlighting inside edit box? I think the best option would be to ask Cacycle to select and cut the necessary code for you, like a "Lite" version. Or someone else to do that, again, using existing WikEd code. / AlexSm 20:45, 9 February 2008 (UTC)
How can we make the Add edit section 0 script worked in Wikia, etc.?
In some other wikis such as MediaWiki.org, Wikia, etc. (even in my wiki!), the Add edit section 0 script can't be worked, but I don't know the reason. How can we make it worked in those wikis? ― 韓斌/Yes0song (談笑 筆跡 다지모) 15:24, 11 February 2008 (UTC)