User talk:Atelaes/TabbedLanguages.js

Bugs

 * Entries with many languages can push the L2 edit link off the page. in
 * Entries with many languages can have tabs pushed below the TOC. in
 * On some browsers, a hash scroll, achieved by pressing an already activated tab, scrolls down past tabs.
 * Tab bottom borders do not perfectly line up with L2 bottom borders in Monobook or Vector.
 * TOC is not sectioned along with entry content.
 * Tabs pushed down by pre-L2 images, templates. go
 * Older browsers cannot handle getElementsByClassName, array.indexOf.
 * Non-bleeding-edge browsers can't handle window.onhashchange (< FF3.6, Chrome 5, Safari 5, IE8).
 * Categories aren't sorted by language.
 * Clicking on linked L2 headers (cf WT:TOP40) don't direct to the language name entry
 * Breaks with HotCat enabled.
 * Shows hidden categories.
 * Category sorting breaks L2 edit link (eg smidgen, հիսուն)
 * Going to a URL w/o a has should show both the Translingual and English pages if both are present.
 * Saving an edit in a subsection of a non-initial entry (e.g. tonto in the Spanish entry) sends the user back to the initial language entry (e.g. French entry). Related to having links to non-language anchors not working.

Clicking
Section links don't work in page revisions when previously clicked. Can't the tabs just link to "#Language" rather than "PAGENAME#Language"? --Yair rand (talk) 19:19, 28 June 2010 (UTC)


 * Huh, I can't believe I didn't think of that, though I didn't expect it to work in revisions. Kind spooky, actually, as the address doesn't change, and yet....it has to be doing so.  I've got a few other things that I'm halfway through writing, so I won't put this on the site for a little while.  Rest assured it's in my working draft of the code.  Thanks for all the help, by the way.  -Atelaes λάλει ἐμοί 19:48, 28 June 2010 (UTC)

Hm, I think it looked better with the line below the tabs... --Yair rand (talk) 06:12, 4 July 2010 (UTC)


 * I solve 87 bugs and what do I get. "I liked the line."  I could put the line back in, but I feel like it detracts from the tab illusion.  A tab is supposed to be physically connected to its document, and the line ruins that.  -Atelaes λάλει ἐμοί 06:54, 4 July 2010 (UTC)

All tabs are always on one line in Vector in Chrome, and only line break inside languages with spaces in monobook in Chrome. Also, TabbedLanguages isn't working at all in IE. --Yair rand (talk) 21:05, 5 July 2010 (UTC)


 * I'll take a look at the non-wrapping problem. May I ask what version of IE?  Tabbed languages relies upon "onhashchange", a feature which is present in IE8, but not earlier versions.  If it's not working in IE8, if you've got an error message or any more details, it would be greatly appreciated.  -Atelaes λάλει ἐμοί 21:28, 5 July 2010 (UTC)
 * I was using IE8, and there's no error message. The tabs just don't appear. --Yair rand (talk) 21:31, 5 July 2010 (UTC)


 * Hmmm......do the normal L2's get axed? -Atelaes λάλει ἐμοί 23:00, 5 July 2010 (UTC)
 * No, the L2's are still there. --Yair rand (talk) 02:57, 6 July 2010 (UTC)
 * Also, I checked this in Chrome, and the tabs are, indeed, not wrapping. I find this a little odd, as Chrome is seeing the zero-width spaces between each tab, and the 'white-space' property on the containing div is set to normal.  These two combined should make for "line breaks when necessary, but only on tab borders".  I'll look into the issue and try to find out if Chrome has some quirks with zero-width spaces, and if there are any workarounds, but I don't have any solutions off the top of my head.  -Atelaes λάλει ἐμοί 23:24, 5 July 2010 (UTC)


 * I've substituted a standard space for the zero width space on all browsers except Firefox. This fixes the problem, although it's not quite the look I'd've preferred.  Still no idea why webkit won't break on zero-width spaces in between spans when it has no problem doing so with regular spaces.  It breaks on them in the middle of regular text.  I guess I don't even know where to start with IE.  I don't have access to it at the moment, though I am planning on getting a Windows XP computer in the near future.  Unless someone can troubleshoot for me, it'll have to wait til then.  -Atelaes λάλει ἐμοί 14:03, 7 July 2010 (UTC)
 * Maybe could be used instead of a standard space where necessary/possible? (Though I'm not sure which browsers it works on...) --Yair rand (talk) 21:20, 7 July 2010 (UTC)


 * Goddammit, I tried it and Chrome freaked out, so I put it out of my head. But now that you've mentioned it here, it works perfectly (both for FF and Chrome).  I think you and Chrome are in on something.  -Atelaes λάλει ἐμοί 00:11, 8 July 2010 (UTC)
 * Well, I'm confused. None of the tabs are working anymore. --Yair rand (talk) 00:15, 8 July 2010 (UTC)


 * Oops. The switch function looked at the innerHTML all the childNodes of languageLinks, to determine which one to switch to "selectedTab" and which one to switch to "unselectedTab".  Since the wbr's didn't have any innerHTML, it got confused.  Fixed now.  Sorry.  -Atelaes λάλει ἐμοί 00:56, 8 July 2010 (UTC)
 * Okay, perfect. :) --Yair rand (talk) 01:12, 8 July 2010 (UTC)
 * IE8 gives the error Message: 'object' is undefined | Line: 10 | Char: 3 | Code: 0 | URI: http://en.wiktionary.org/w/index.php?title=User:Atelaes/TabbedLanguages.js&action=raw&ctype=text/javascript. --Yair rand (talk) 01:12, 8 July 2010 (UTC)


 * Hmm....try it now. -Atelaes λάλει ἐμοί 01:21, 8 July 2010 (UTC)
 * Message: Object doesn't support this property or method | Line: 100 | Char: 9 | Code: 0 | URI: http://en.wiktionary.org/w/index.php?title=User:Atelaes/TabbedLanguages.js&action=raw&ctype=text/javascript --Yair rand (talk) 01:25, 8 July 2010 (UTC)


 * Ok. I wonder if adding prototype methods to all objects simply isn't allowed.  It would seem a sensible prohibition.  I'll see if there's a way to prototype only DOM nodes.  -Atelaes λάλει ἐμοί 01:33, 8 July 2010 (UTC)
 * Hm, now it just goes through the whole "Stop running this script? If you don't, your computer will explode" routine on IE. --Yair rand (talk) 01:42, 8 July 2010 (UTC)

(unindenting) Ok, it looks like adding to DOM prototypes is a feature new to IE8, so it won't work on any earlier versions. That's fine, however, as I'm done worrying about IE6 and IE7. Those fuckers can just upgrade or suffer a shit internet. According to Microsoft's own lips the new code should work. Does it? -Atelaes λάλει ἐμοί 01:50, 8 July 2010 (UTC)
 * Now it gives Message: Object doesn't support this property or method | Line: 157 | Char: 5 | Code: 0 | URI: http://en.wiktionary.org/w/index.php?title=User:Atelaes/TabbedLanguages.js&action=raw&ctype=text/javascript, and the h2's content disappears along with the toc. --Yair rand (talk) 01:52, 8 July 2010 (UTC)


 * Ok, good. That means it got partway through the function before breaking.  I think I need to prototype the document too, which is apparently different from any other element.  I have to leave for work shortly, and so won't be able to fix this just now, but should be able to later.  -Atelaes λάλει ἐμοί 02:02, 8 July 2010 (UTC)


 * Ok, I've prototyped it to the document object as well as the element object. This also works in Firefox and Chrome (at least the current versions).  IE8?  -Atelaes λάλει ἐμοί 12:26, 8 July 2010 (UTC)
 * Nope. Message: 'HTMLDocument' is undefined | Line: 24 | Char: 5 | Code: 0 | URI: http://en.wiktionary.org/w/index.php?title=User:Atelaes/TabbedLanguages.js&action=raw&ctype=text/javascript, and it acts just as though tabbedlanguages was off. (I'm starting to think it might be better to try to get it work without using getElementsByClassName, especially if it won't work with IE6/7, which is used by 25% of our audience.) Side note: It would probably be better if the language name was removed from the toc, and the show/hide button inside the toc should probably also be removed, and the first number and period in each point if possible. --Yair rand (talk) 18:53, 8 July 2010 (UTC)


 * *sigh* I suppose it was unreasonable to expect that recent documentation from MS about IE would actually work (the documentation was specifically about writing a getElementsByClassName function for IE8; exactly what I'm trying to do).  I'll do a little more research and see what I can figure out.  As for IE's 6 and 7, I'm willing to put in a test case which stops the script for those browsers, so we're not throwing errors, but I'm unwilling to actually code for them.  I won't hobble my scripts for idiots who haven't updated their browsers in years.  They can just suffer a shit internet as far as I'm concerned.  I'm willing to put some effort in for IE8 because it's the most recent version and it vaguely resembles a modern browser.  -Atelaes λάλει ἐμοί 01:47, 9 July 2010 (UTC)


 * I don't suppose my most recent edit did anything helpful, did it? -Atelaes λάλει ἐμοί 01:50, 9 July 2010 (UTC)
 * It now works with IE8, although tab switching happens really, really slowly. --Yair rand (talk) 01:55, 9 July 2010 (UTC)


 * Fantastic! It's not terribly surprising that it's really slow.  IE is really, really slow.  This isn't just me being biased against IE (which I admittedly am), take a look at these tests, where IE is generally not included, as it would force the graph scale so high as to render all other differences undetectable, but on one where it is, you can see the absurd sluggishness of IE compared to every other browser.  Well, now that that's settled, on to making onhashchange work for older browsers.  I don't know if I've said this, but your constant help with debugging is invaluable and deeply appreciated Yair.  -Atelaes λάλει ἐμοί 02:02, 9 July 2010 (UTC)

Links to language sections containing spaces (i.e. for) don't work. --Yair rand (talk) 07:33, 9 July 2010 (UTC)


 * Fixed. -Atelaes λάλει ἐμοί 13:01, 9 July 2010 (UTC)

HotCat
With the HotCat gadget enabled, the new category sorting breaks the script (I think it's because HotCat introduces those links in the category box making it hard to parse). There's several times that this happens, but on page refresh (on for example cure) it occurs in the newest stable Firefox and Chrome. --Bequw → τ 21:21, 12 July 2010 (UTC)