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

{{talkarchive}}

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/lifilter.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:

{{hidden|Easy DOM|

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)

[[User:Sunny910910/warningscript.js]]

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)

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‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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:

  1. it is triggered if lower or upper case c, g, h, j, s or u is followed by lower or upper case x
  2. it is necessary to identify the string to be substituted
  3. that string starts with the (first) character that triggered the algorithm
  4. that string contains also the following lower or upper case x and all subsequent lower or upper case x's
  5. processing starts from the end of the string to be substituted; from the last x|X
  6. main substitution /convertion loop
  7. the last but one character is analyzed
  8. is it upper or lower case
  9. is it c|C, g|G, h|H, j|J, s|S, u|U or x|X
  10. to determing the substitution / conversion one should
  11. preserve the case
  12. substitute / convert the last and last but one character to ĉ|Ĉ, ĝ|Ĝ, ĥ|Ĥ, ĵ|Ĵ, ŝ|Ŝ, ŭ|Ŭ, or x|X depending of the match identified before
  13. readjust the string to be substituted; it is shortened by two characters at the end
  14. 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‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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

As far as I can tell, this almost exactly matches what eo.wikipedia does.... test it? --Splarka (rant) 23:02, 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]‎

[http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}?uselang={{CONTENTLANG}}}} CSS]

generating:

[http://validator.w3.org/check?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}?uselang={{CONTENTLANG}}}}&charset=%28detect+automatically%29&doctype=Inline&group=0 XHTML 1.0]‎

[http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}?uselang={{CONTENTLANG}}}} CSS]

Thanks for all your efforts in advance! Best regards

‫·‏לערי ריינהארט‏·‏T‏·‏m‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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]‎

[http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}}} CSS]

generating:

[http://validator.w3.org/check?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}&charset=%28detect+automatically%29&doctype=Inline&group=0}} XHTML 1.0]‎

[http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}/wiki/{{FULLPAGENAME}}}} CSS]

Best regards

‫·‏לערי ריינהארט‏·‏T‏·‏m‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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]

generating:

[http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}{{SCRIPTPATH}}/index.php?oldid={{REVISIONID}}}} CSS]

alternatively one could try to use liks containing {{FULLPAGENAMEE}}

Best regards

‫·‏לערי ריינהארט‏·‏T‏·‏m‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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');

});

:--Splarka (rant) 19:43, 8 February 2008 (UTC)

Thanks Splarka! I tested the functions at [http://yi.wikisource.org/w/index.php?oldid=3489 m:s:yi:MediaWiki:Common.js oldid=3489]. Best regards

‫·‏לערי ריינהארט‏·‏T‏·‏m‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history Th]‏·‏T‏·‏email me‏·‏‬ 19:20, 9 February 2008 (UTC)

= simplified and working (usinf <nowiki>{{FULLPAGENAMEE}}</nowiki>) =

[http://validator.w3.org/check?uri={{URLENCODE:{{SERVER}}/wiki/}}{{FULLPAGENAMEE}}&charset=%28detect+automatically%29&doctype=Inline&group=0 XHTML 1.0]‎

[http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}/wiki/}}{{FULLPAGENAMEE}} CSS]

generating:

[http://validator.w3.org/check?uri={{URLENCODE:{{SERVER}}/wiki/}}{{FULLPAGENAMEE}}&charset=%28detect+automatically%29&doctype=Inline&group=0 XHTML 1.0]‎

[http://jigsaw.w3.org/css-validator/validator?uri={{URLENCODE:{{SERVER}}/wiki/}}{{FULLPAGENAMEE}} CSS]

Best regards

‫·‏לערי ריינהארט‏·‏T‏·‏m‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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: [http://test.wikipedia.org/wiki/template:this/eng template:this/eng]. Thanks for all your efforts in advance! Best regards

‫·‏לערי ריינהארט‏·‏T‏·‏m‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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

addPortletLink('p-cactions',wgServer + wgScript + '?title=' + encodeURIComponent(wgPageName) + '&uselang=' + langs[i], langs[i]);

}

});

:--Splarka (rant) 19:30, 8 February 2008 (UTC)

Thanks Splarka! I tested the functions at [http://yi.wikisource.org/w/index.php?oldid=3490 m:s:yi:MediaWiki:Common.js oldid=3490].

For some reason not known to me the tabs disapear if I select the « de » tab - {{#language:de}}. I have selected « yi - {{style/yid|dir=ltr|yid={{#language:yi}}}} » preferences.

I experienced similar behaviour about a disapearing « purge » tab at « wikt:yi: » if I select « de - {{#language:de}} » 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‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history Th]‏·‏T‏·‏email me‏·‏‬ 19:40, 9 February 2008 (UTC)

:Common.js and Monobook.js is called on every page through [http://yi.wikisource.org/w/index.php?title=-&action=raw&gen=js&useskin=monobook 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‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history 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

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 [http://yi.wiktionary.org/w/index.php?title=MediaWiki:Common.js&diff=11822&oldid=11784 wikt:yi:MediaWiki:Common.js?diff=11822&oldid]. It works fine. Thank you very much! Best regards

: ‫·‏לערי ריינהארט‏·‏T‏·‏m‏:‏[http://meta.wikimedia.org/wiki/user_talk:%D7%9C%D7%A2%D7%A8%D7%99_%D7%A8%D7%99%D7%99%D7%A0%D7%94%D7%90%D7%A8%D7%98?action=history Th]‏·‏T‏·‏email me‏·‏‬ 09:33, 11 February 2008 (UTC)

How can we make the [[Wikipedia:WikiProject User scripts/Scripts/Add edit section 0|Add edit section 0]] script worked in Wikia, etc.?

In some other wikis such as MediaWiki.org, WikiaWikia, etc. (even in [http://hanbin.new21.net/wiki/ 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)

:Sorry, they're working now in MediaWiki.org and Wikia. ― 韓斌/Yes0song (談笑 筆跡 다지모) 14:46, 16 February 2008 (UTC)

Force show preview

i know ive seen this before, but can someone direct me/post the code for forcing the show preview button? it causes the save button to be unclickable until you click show preview.--24.109.218.172 (talk) 02:42, 13 February 2008 (UTC)

if(wgAction=='edit') addOnloadHook(function() { document.getElementById('wpSave').disabled = 'disabled'; })

:--Splarka (rant) 08:17, 13 February 2008 (UTC)

if (wgAction=='edit') addOnloadHook(function() {

var wpSave = document.getElementById('wpSave')

if (wpSave) wpSave.disabled = 'disabled'

})

::This version above avoids JS errors on "View source" (protected pages). By the way, the code like this also usually changes "Save" button into "Save (after preview)", and makes "Preview" button bold. 6 out of 10 biggest Wikipedias implemented this for unlogged users, so just check Common.js on: de, fr, sv, nl, ja, pt. -AlexSm 17:20, 13 February 2008 (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)

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

User:Sceptre/cattag.js

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)

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)

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)

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 [http://en.wikipedia.org/w/api.php?action=query&list=logevents&letype=protect 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: [http://en.wikipedia.org/w/index.php?title=Special:Log&type=protect&user=&page=&pattern=&limit=500&offset=0 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)

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)

Advanced "Short Link"

:See [http://en.wikipedia.org/w/index.php?oldid=190868168#toolbox_item_or_tab_with_a_short_format_link_using_.C2.AB_oldid.3D.7B.7BREVISIONID.7D.7D_.C2.BB #toolbox item or tab with a short format link using « oldid={{REVISIONID}} »]

I want to make MediaWiki delete long unicode titles in the URL, not only historic pages (permanent links) but also diff. pages and the printable pages of those. Can someone make the javascript? ― 韓斌/Yes0song (談笑 筆跡 [http://ko.wikipedia.org/wiki/User:Yes0song/%EB%8B%A4%EC%A7%80%EB%AA%A8 다지모] [http://kore.wikia.com 한자위키]) 12:53, 20 February 2008 (UTC)

:You could take the 2nd script in that section (with shortDiffURLs()) and slightly modify it to recognize other links and remove the title from URL whenever possible. Also, just a thought: when title cannot be removed, the script could at least decode it, if I remember correcty, this should help Opera display readable titles in the address bar. I would help, but your 8-line signature makes it too difficult to follow this conversation.AlexSm 20:31, 21 February 2008 (UTC)

Tool to highlight matching braces, to aid in debugging templates with mismatched opening and closing braces

Well, basically I am looking for something that, analogously to what Netbeans does with Java code, will highlight the braces so that it's easy to distinguish what matches with what:

fdksajhsdfhksdflh{{{{dfjkalhfdslsaflklhdsfdfsadhflsalsdfhsd{{jaksdfslkadslhjhjhlklhlh

khlk{{sfdakllsdfaljksdalf}}khfdksdh}}sdafhhdsasfd

lk;lkjadfjlksadfs{{fdalhsafdlksafdhdsfaks}}lfdhahlkfds}}asdfhlfdsahklh}}ksdahksadkhsdafl

I'm working on nested #ifs and keep running into bugs that I'm having trouble tracing. It's driving me nuts. Absidy (talk) 05:07, 24 February 2008 (UTC)

:I've filed bugzilla:13829; if and when that enhancement is fixed, it should be much easier to write a script that does that. --ais523 12:07, 23 April 2008 (UTC)

::See User:ais523/bracketmatch.js. It adds a link 'Parse' above the edit box; clicking on it will add a bracket-matched copy of the edit box. (It works by calling the Wikimedia servers and asking them to parse the code, so the resulting parse will be exactly how the code will be interpreted, even in pathological cases.) --ais523 12:13, 14 May 2008 (UTC)

xFD closer

There is a script to close AFDs, can it be expanded to all xFds???? The Placebo Effect (talk) 03:30, 6 March 2008 (UTC)

:I've made one for MFDs - see User:Jj137/CloseMFD.js. I'm still working on the others (sort of a long term goal, but I'll give it a shot).  jj137 (talk) 03:03, 23 March 2008 (UTC)

::Could there be a script to not only close the AfD, but also pull down the AfD notice on Kept pages and add the OldAfDFull template to their talk pages? MBisanz talk 08:41, 23 March 2008 (UTC)

Submit

Does anyone know how to automatically submit the page for the delete function? I know for edits it is

document.getElementById('editform').submit();

so it is probably something similar.   jj137 (talk) 01:45, 27 March 2008 (UTC)

Hint in page source:

--Splarka (rant) 07:28, 27 March 2008 (UTC)

:I think you'll need to obtain a wpEditToken from the server before submitting, so you may need to send two requests. --Cameltrader (talk) 08:36, 27 March 2008 (UTC)

::How would I obtain that? Would I use document.getElementById('wpEditToken').submit(); ?   jj137 (talk) 22:18, 27 March 2008 (UTC)

:::I can't help you much, because I've never done that, but [http://en.wikipedia.org/w/api.php the API] could well give you what you need, assuming you have some familiarity with AJAX and XMLHttpRequest. Also, there are scripts scattered around—in Python, in Perl, and [http://www.google.com/search?q=wpedittoken maybe others], which might give you an idea of how to deal with the edit token. --Cameltrader (talk) 22:36, 27 March 2008 (UTC)

::::document.getElementById('deleteconfirm').submit(); , although I don't understand why you would need that. —AlexSm 23:26, 27 March 2008 (UTC)

:::::That works, but it doesn't give me a choice of what I want for the delete summary. I would like for the delete confirm screen to appear, and then with the script I am writing tabs will appear with some of the CSD reasons. When I click that tab, it will automatically delete the page with that CSD reason as the delete summary. I'm just trying to save time when doing maintenance tasks.   jj137 (talk) 00:44, 28 March 2008 (UTC)

::::::I must be getting something wrong, because I don't see how these tab are supposed to help. The way you described them, they would save you two clicks on the SELECT drop-down box, but before that you still have to load the delete confirmation page anyway. I can create a script that would skip the confirmation screen entirely (only making one extra API query for edittoken), deleting the page in only one click. However, it would not insert the usual quote of the page content. —AlexSm 04:29, 31 March 2008 (UTC)

:::::::Well, that's what the document.getElementById('deleteconfirm').submit(); seemed to do. How exactly would I specify a reason?   jj137 (talk) 01:30, 1 April 2008 (UTC)

You could also pass along a reason as a URL parameter: wgServer + wgScript + '?title=Main_Page&action=delete&wpReason=' + encodeURIComponent('[[WP:CSD#G8]]: talk page without a corresponding article'). You seem to already have this in your script.

To instruct the script to automatically submit a page like that, you could also pass along a fake URL parameter, such as '&autosubmit=true'. (Be careful, though, since this makes you vulnerable to attacks like http://tinyurl.com/yoe45f, which logs you out if you don't have tinyurl preview enabled.) Alternatively, you can use an XHR request to get a delete token, although this is a bit more complicated. GracenotesT § 15:22, 2 April 2008 (UTC)

page looks different for blocked user

Can someone write a script that will cause a special:contributions/, user:, or user talk: page to look different (perhaps have a different background color) if the user is currently blocked? Alternatively (or also), if the user has ever been blocked?—msh210 20:49, 2 April 2008 (UTC)

:It is possible, with an extra [http://en.wikipedia.org/w/api.php?action=query&meta=userinfo&uiprop=blockinfo API query]. However, userscripts are personal, and it seems you want this executed for every user out there, but nobody is going to agree to add this script into global MediaWiki:Common.js. —AlexSm 21:11, 2 April 2008 (UTC)

::No, I don't care if you execute this. I'd want it added to monobook.js. (It would, of course, execute on every user's userpage, but only when I view the page.)—msh210 21:21, 2 April 2008 (UTC)

:Ah, user:Conrad.Irwin has written wikt:User:Conrad.Irwin/isblocked.js in response to this request. Thank you, Conrad!—msh210 21:44, 2 April 2008 (UTC)

::Umm, somehow I thought it was the same request as on Wikipedia:Village pump (technical)#Blocked from editing notice WHILE READING, cause it happened to be at the same time... Anyway, I might have even a better script in one or two weeks. —AlexSm 23:27, 2 April 2008 (UTC)

Meta script for linking locations in scripts

See Wikipedia_talk:WikiProject_User_scripts/Scripts#Deprecate_syntax_highlighter_and_inclusion_scripts

I had an autolinker written that turned any bracketed text in a script into a link when the script is displayed (like on Special:Mypage/monobook.js), so that things like this:

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

would be clickable. It seems we have such a script floating around somewhere because bracketed text in diff view is now clickable. Maybe this could be co-opted to create links when viewing a script, too.

Then we'd need to allow bracketed links inside the importScript argument, as they are allowed in my winc() function. — Omegatron 02:15, 4 April 2008 (UTC)