Thursday, December 3, 2009

new bottom mode on wiktionary lookup gadget

Just wanted to mention, I've added some new options to wiktionary lookup gadget. One of them is to display it as a bar at the bottom instead of as a tooltip. (This idea comes from [[:fr:wikt:Utilisateur:Darkdadaah]] who made a gadget on the french wiktionary to display definitions on a bar at the bottom.)

Here's what it looks like so far. Its the wiktionary logo (or at least in some languages anyways) in the background.

Friday, November 27, 2009

Quick update on WiktLookup

Wiktionary Lookup is a tool that allows you to double click on a word, and have a little popup with its definition from Wiktionary. (Its enabled on this blog, and several wikis). So far it is translated into:

  • English
  • Spanish
  • Italian
  • French
  • Japanese
  • Dutch
  • And several other languages pending

The script itself has improved quite a bit. Words can now be selected by highlighting and pressing ctrl+shift+L in addition to double clicking. It should be able to determine what language the word you are clicking on is in (in some cases anyways), to make sure it gets the right definition. There is now also several configuration options:

  • showWord - determine if it should display the word that was looked up (its set to bold on this blog)
  • count - number of definitions to return
  • height - max height of the popup box
  • width - max width
  • key - the key combo to look up a word when highlighting
  • reverseShift - change the role of the shift key from preventing the popup from appearing when double-clicking, to requiring the shift key be pressed when double clicking

In the future, there will be even more options (such as say the word if audio pronounciation is available), more languages, and more awesomeness ;) See [[n:WN:WiktLookup]] for more details and how to use the script on your own webpage/wiki.

Saturday, October 24, 2009

Introducing Wiktionary lookup. Now for blogs

At the urging of Amgine, I've been developing a gadget for Wikimedia projects that looks up a word you double click in Wiktioary. (It is based on a gadget from french Wikinews by User:Conrad.Irwin and User:Bequw) Anyways, I've been told that some people want to use it on there blog, so now you can. All you have to do is insert somewhere in the <head> of your html document:

<script src=';action=raw&amp;ctype=text/javascript' type='text/javascript'></script>

Then whenever someone double-clicks a word, the definition will popup (See diagram at top). Its currently enabled on this blog (as well as several Wikimedia projects). Please try it out and let me know what you think.

Some notes:

  • It detects the language from the lang attribute on <html> (note thats lang, not xml:lang) It will also look in js global variable wgContentLanguage for the current language.

  • Supports english (EN), french (fr, frc), Dutch (nl). Translations welcome.

  • This is still a work in progress. Expect improvements. Bug reports can go on [[n:Mediawiki_talk:Gadget-dictionaryLookupHover.js]]. There are also some generic instructions on [[n:WN:WiktLookup]]

  • Current browser support is: Full support on Firefox, Safari. Partial support on Konqueror, Internet explorer (requires xslt support for full support. IE doesn't work due to mediawiki using a mime type that IE doesn't recognize as xslt). Theoretically should have full support on Opera, but have not tested.

Update: now with compound word support.

Friday, October 9, 2009

Wikinews gets a new Main Page!

Wikinews's Main page has finally been updated to ShakataGaNai's redesign. (The delay was due to me not being avaliable to make the automated lead generator work with the new main page. I was a little worried today when i logged in i would be beheaded on irc for not being arround to do that for so long.)

I think the new design looks absolutely excellent. There have been so many failed attempts at redesigning the main page, I'm glad to see we've finally agreed on one and that it looks so nice.

Saturday, September 12, 2009

Go wikinews!

Today (Sept 12) Wikinews had a record day of 20 articles [permalink] published in a single day. This is record (while a record since we started requiring all articles be peer reviewed. we had one day back in sept 2, 2005 on the second day of a writing contest. with 24 articles).

Wohoo! Good work Wikinewsies!

Friday, August 7, 2009

Wikinews js and IE

So i happened to be browsing Wikinews in internet explorer the other day (*shudder*), and apparently there was an error in some of the site JS (relating to the comments namespace) making some of the js not work in IE. The issue was that internet explorer doesn't support the hasAttribute method of dom elements. Which isn't that bad since its fairly trivial to replace hasAttribute with getAttribute. The scary thing is that this issue has been present since November 2007.

Apparently (looking through the history) there was an attempt to fix back in January of 2008, by changing hasAttribute('missing') to getAttribute('missing', 2) == "". (I'm not sure where the 2 came from. All the docs i've read seem to state that getAttribute only takes 1 parameter) This almost would have worked, except for one important fact. In the mediawiki api, if you try to find info on a non-exisistant page, it will give you: <page ... missing="" /> [1] Thus the normal value for the attribute if present is "", and if its not present, according to the w3c getArribute should return the empty string. Thus testing for the empty string doesn't work, as it returns the empty string in both cases. However in practice this doesn't seem entirely true, as in both Firefox and IE, when getAttribute is used on a missing attribute, the browser returns null instead of "" (The previous code of getAttribute('missing', 2) == "" would still of worked since "" == null)

To fix the problem, the code in question now first tries to use the hasAttribute() method (for the good little browsers that support it), and if that throws an exception, it will see if getAttribute(attributeName) !== null. (assuming that anybody who doesn't support hasAttribute also returns null when getting a non-existant attribute.

Anyways, the moral of this story is that we should probably set up some system for tracking problems with the local javascript on wikinews, since this problem was discovered and than totally forgotten. perhaps on [[Wikinews:Javascript]].

Thursday, August 6, 2009


This is my first blog post. I plan to use this blog for stuff relating to wikinews. We'll see if i stick to it or not.