User talk:Alex Smotrov/iwiki.js

=iwiki= This script
 * changes the appearance of interwiki list
 * makes it easy to synchronize the list with other Wikipedias.

Viewng
The script allows you to view interwiki list as:

You can cycle through these 3 modes by clicking the portlet header «». You can also set the initial (on the page load) mode by setting  to 1 (translated) or 2 (links). For example:

Note that in extra modes the list is sorted alphabetically.

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» 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:

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).

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.

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! — Dino guy  1000  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. — Dino guy  1000  20:56, 3 March 2008 (UTC)

Show/hide link?
Hey Alex, it's me (again ;) ). I was wondering about the possibility of adding a show/hide link to the interwiki portlet. I think ideally it shouldn't affect edit/preview pages, and it should be disabled by default (and thus enabled with something along the lines of var iwEnableCollapsiblePortlet = true, and given a default state with something along the lines of iwCollapsePortletByDefault or iwPortletCollapseState). Any thoughts? — Dino guy  1000  20:49, 28 July 2008 (UTC)


 * It's very easy to make a portlet collapsible, but I just don't see the point. In the default Monobook skin this portlet takes the space that would be empty otherwise. Also, I think it's better to implement this in a separate script that can collapse any portlet on the left (in fact, I already have such a script somewhere on my hard drive). —AlexSm 21:52, 28 July 2008 (UTC)


 * All right, I figured it would be easy. Personally,, I'd like to be able to collapse the interwiki portlet because I use another script that adds custom links below all the portlets, and iw links frequently push those links past the bottom of my screen when I'm scrolled to the top. I *do* use iw links from time to time, so I don't want to hide them altogether in my monobook.css (as I have done with another portlet), but I'd definitely be interested in that generic portlet show/hide script you mentioned. — Dino guy  1000  22:41, 28 July 2008 (UTC)

dsb
Hello, Alex. I doesnt found the code for lower sorbian in the list of the language codes. 'dsb':'Lower Sorbian', Could you add it to the script, please? Greetings --Tlustulimu (talk) 11:49, 27 November 2008 (UTC)

Javascript not working
Hello Alex, your javascript 'gadget' would be extremely useful for me - but unfortunately it does not seem to work. For some reason, the script does not want to carry out the 'query' when either pressing the "Запит" button or the "?" link. When I try to activate it just flashes and nothing further happens (no "bold", no "v")

I have Firefox 3.04 and have JS turned on, and I allow popups for wikipedia. There is no outwardly noticeable reaction from my firewall to indicate that something is deliberately blocking the JS.

Am I doing something wrong? I am not a programmer, so I don't understand references to changing the script - I have had it automatically installed as a 'gadget' through my user preferences in Ukrainian wikipedia. Also, I don't see anything that looks like the "portlet header «Languages»" as mentioned above? I noticed that the link above to http://en.wikipedia.org/w/query.php is no longer active, so is this the problem? --Pkravchenko (talk) 23:45, 1 December 2008 (UTC)