User talk:Alex Smotrov/iwiki.js
From Wikipedia, the free encyclopedia
|
[edit] iwiki
This script
- changes the appearance of interwiki list
- makes it easy to synchronize the list with other Wikipedias.
[edit] Viewng
The script allows you to view interwiki list as:
| default | translated | links | ||
|---|---|---|---|---|
|
|
|
You can cycle through these 3 modes by clicking the portlet header «Languages». You can also set the initial (on the page load) mode by setting iwDisplayMode to 1 (translated) or 2 (links). For example:
var iwDisplayMode = 1 importScript('User:Alex Smotrov/iwiki.js')
Note that in extra modes the list is sorted alphabetically.
[edit] Synchronizing
When you edit the page a (sync) link is added to the bottom of interwiki list. This link activates the synchronizing mode: all interwikis currently in the edit window are displayed in the table under edit window:
| x | ? | |
| x | ? | |
| ……… | ||
«x» link removes interwiki from the table
«?» link queries the server (and then changes to «v»)
The query is for that article interwiki list, which is displayed on the right for comparison:
| ca:Elefant | v | |
| cs:Slon | ? | |
| da:Elefant | ? | |
| eo:Elefanto | ? | |
| ← | uk:Слонові |
First interwiki was just queried (displayed bold).
Three rows with just gray on the right indicate that remote interwikis are exactly the same as the local ones.
The 3rd row shows new remote interwiki. Press ← link to append it.
In many cases the interwikis are trivial and are already synchronized by bots (2-3 queries are usually enough to confirm this).
| ← | sk:Chobotnatce | |
| sk:Slon | ? |
Sometimes you will find a different interwiki from the existing one. If you append it to a local list, the script will alert you with a red border around the 2nd one. You have to open them both in the new windows, manually determine which one is correct, then delete the wrong one.
There also are several buttons on the left:
Query is the same as clicking on the next available «?»
Add All is equivalent to clicking all current ← links
Apply commits changes to the edit window. Remember to click it at the end
Cancel simply closes the syncronizing table without making any changes to the text.
[edit] Notes
- The script is tested in Firefox 1.5, Opera 9.2, IE6
- To get the list of «remote» interwikis the script calls query.php with langlinks and proxylang
- The list of languages codes and names was extracted from meta:List of Wikipedias
[edit] Discussion
[edit] Updates/improvements
After using this (very useful) script for awhile, I've noticed several issues that I'd like to see resolved...
First off, it would be immensely more convenient if you could add a (sync) link at the bottom of the interwiki section when viewing a page, rather than just previewing it. An immediate thought would be to make its appearance in this regards user-configurable with something along the lines of e.g. var iwOnlyDisplayOnPreviews = false in your Monobook.js subpage.
Another issue is how it handles (or rather doesn't handle) interwiki links on template documentation subpages, where the interwiki links can't be previewed directly from the documentation page. For instance, have a look at {{Navbox}} and {{Navbox/doc}} (I can't think of any unprotected examples). I'm not sure just how this would best be handled, though.
One more minor thing is that while it's nice how the script tells you that a given link is a redirect, it doesn't offer to correct it for you - you have to physically visit the page in question and find out where it redirects, and then repoint the link yourself.
One final thought is that the documentation regarding the sync link is a bit confusing - I was looking for it underneath the edit box at first, and just happened to stumble on it to the left when previewing an edit.
Other than these issues, this script is incredibly useful and a bit of fun, too. Keep up the great work! —Dinoguy1000 20:20, 3 March 2008 (UTC)
-
- The interwiki-on-subpages thing is definitely inconvenient, I experienced it myself a couple of times, had to do copy-paste back and forth. I'm thinking about adding an additional toolbar button.
- Calling the script when viewing a page is certainly possible, but I don't see a good way to transfer the results to the edit window after that.
- I know this script could do better when syncing, but I was busy with other things lately. Hopefully I will find some time to improve that as well.
- —AlexSm 20:49, 3 March 2008 (UTC)
-
- Aah, nice to see such a fast reply. I must have caught you when you were online. ;) If nothing else, perhaps calling the script when viewing a page would copy the end result to the clipboard (is that actually possible in JS?) and leaving it up to the user to paste and save it. This asks a lot of the user, but hopefully, anyone who's installed this script would also be able to follow instructions and do some basic last-minute checks before saving. Or it could call up an edit preview and automatically open and jump to the sync box. Just a few thoughts. —Dinoguy1000 20:56, 3 March 2008 (UTC)

