Wikipedia:Wikipedia Signpost/2006-11-20/Technology report
< Previous (2006-11-13) | Next (2006-11-27) >
Bugs, Repairs, and Internal Operational News
Tables can now be made sortable via JavaScript. Any table with class="sortable"
will have arrows in each of its header cells, and clicking them will cause the table to sort according to that column's values. For instance, a table of countries could be sorted by the user according to country name, GDP, currency code, etc. A demonstration of the script can be viewed here. As always, the change might not be live for several days. (patch by Stuart Langridge, Lupin, Jonathan Snook, Robert Nyman, and Simetrical; r17803, bug 2001)
An extension written by Steve Sanbeg, Labeled Section Transclusion, was committed to the MediaWiki codebase in Subversion by Nick Jenkins. While it is not yet enabled on any Wikimedia site, it may be in the future. The extension allows pieces of pages to be transcluded without transcluding the entire page. It was requested for use on Wikisource in particular at bug 5881, where Dovi Jacobs and others noted how useful it would be for including things such as Bible verses.
A minor bug in retroactive autoblocking, where a user could be retroactively autoblocked even if the block failed, was fixed. (Andrew Garrett, r17802)
Several interface changes were made this week:
- The external link icon for links to video, audio, and PDF files have been changed from the standard outward arrow to media-specific icons. Icons for image files and non-PDF document formats were not added because no one has submitted any at the bug page as of press time. (icons by Flamurai, patch by Simetrical; r17593 and r17594, bug 1578)
- Automatic edit summaries are now inserted for edits where the page is blanked or reduced in length by over 90%, and for new articles of less than 500 characters, where no summary is provided by the editor. These join Rob Church's earlier addition of an automatic summary for the creation of redirects. (Andrew Garrett; r17608, r17609, and r17804)
- Edit summary previews now appear on the preview page. (Simetrical, r17660, bug 7811)
- When previewing pages that have a float near the bottom (e.g., Template:Politics of Vatican City), the edit toolbar will now display in the correct place. (Simetrical, r17712, bug 7932)
- When viewing an old revision of a page, there is now a diff link next to the link to the current revision. (Simetrical, r17714, bug 6873)
- A rollback link is now available directly on articles' history pages. (Simetrical, r17715 and r17797, bug 3315)
- When previewing a page, additions and removals of templates will be correctly reflected in the "templates used on this page" list. When editing a section, the list will display only the templates used in that section. (Mark Haidar [Fyren], r17738 and r17800, bug 7918)
- When viewing a diff, if a summary contains an automatic edit section link, it jumps to the correct place on the diff page and doesn't load the latest version of the page. (Mark Haidar [Fyren], r17741, bug 7688)
- JavaScript code on the page MediaWiki:Common.js will now be used by all users, even those who do not use the default Monobook skin (non-Monobook skins are available under the "Skins" section of "my preferences"). Previously the contents of MediaWiki:Monobook.js had been included in every page in Monobook, enabling admins to add custom JavaScript code, but only for users of Monobook. Monobook.js is redundant to the new page, since skin-specific code can be added to Common.js using the
skin
variable, and is therefore deprecated. (Simetrical, r17737 and r17755, bug 4178) - Users who have chosen to be prompted for edit summaries when they leave them blank will no longer be prompted if a "Redirecting to X" autosummary will be inserted automatically. (Simetrical, r17801, bug 7889)
Some updates were made to non-English messages, specifically:
- Czech (thanks to Mormegil)
- Hebrew (thanks to Rotem Liss)
- Italian (thanks to BrokenArrow)
- Kazakh (thanks to AlefZet)
- Vietnamese (thanks to Minh Nguyễn)
Internationalization help is always appreciated! See m:Localization statistics for how complete the translations of languages you know are, and post any updates to Mediazilla.
Discuss this story
According to [1], the original script sorts dates according to the European style (dd/mm/[cc]yy). Has it been customized for the various date formats that can be set at Special:Preferences? – Minh Nguyễn (talk, contribs) 22:19, 21 November 2006 (UTC)[reply]
Javascript
Ah - that is why the [show/hide] thing now works in classic? Excellent. And class="sortable" sounds great too. -- ALoan (Talk) 14:53, 23 November 2006 (UTC)[reply]
class
once on an HTML element, so you'd putclass="wikitable sortable"
. – Minh Nguyễn (talk, contribs) 23:16, 23 November 2006 (UTC)[reply]another Q on sortable
what are the least and greatest values among all data types? for example it would seem that all values and data types come before numbers (e.g. x, y, z, 0, 1, 2). So does that mean 9 is always the last on the list, or is there some special character that comes after it? This is an issue when i want to sort things that don't all have numerical values under a certain heading and i want them to be evaluated last. Right now the ugly fix is to give them a value of 999 written in white font. Here's a sample:
Ideally, when sorting, numbers should go in ascending order, followed by blanks. What could we put in that would come after 9?
It needs improvement. A few thoughts:
sort-first
andsort-last
classes, perhaps, to force cells/rows to sort before or after everything without the class.From what I've read of the code, anything not recognized will be sorted in Unicode code point order. —Simetrical (talk • contribs) 07:05, 30 November 2006 (UTC)[reply]
Sorting sems a bit haphazard
It doesn't seem to work very well at Bradford North (UK Parliament constituency)#Members_of_Parliament: the sorting is rather haphazard. --BrownHairedGirl (talk) • (contribs) 14:28, 27 January 2007 (UTC)[reply]
Numbers with two commas do not sort correctly
The sorting script has problems handling numbers containing more than one comma. If you sort this table you'll see that it ignores anything after the second comma. For example: 1,025,481 is placed between 1,024 and 1,206.
Not sure if this is the proper place to report the problem, but since others have done so I figured I would add one that was causing a problem for pages I work on. Thanks. -- Zyxw 10:39, 28 January 2007 (UTC)[reply]
Looking through sorttable.js I noticed it handles currency differently than numbers. I've added a column to the above table which contains the same numbers preceded by a dollar sign. If you click on numbers column it sorts incorrectly, but it you click on the currency column it does sort correctly. -- Zyxw 16:39, 29 January 2007 (UTC)[reply]
After a bit more research I found Meta:Help:Sorting which mentions this problem. It was also reported as T10115 on 2007-01-19. At the bottom of that page it mentions that this bug has been fixed in the JavaScript code available at Meta:Help_talk:Sorting. I guess the only question now is when the updated code will be implemented. -- Zyxw 18:52, 29 January 2007 (UTC)[reply]