Thursday, December 3, 2009
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
- 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
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:
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.
- 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'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
Wohoo! Good work Wikinewsies!
Friday, August 7, 2009
hasAttributemethod of dom elements. Which isn't that bad since its fairly trivial to replace
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
getAttribute('missing', 2) == "". (I'm not sure where the 2 came from. All the docs i've read seem to state that
getAttributeonly 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:
missing="" /> Thus the normal value for the attribute if present is "", and if its not present, according to the w3c
getArributeshould 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
getAttributeis used on a missing attribute, the browser returns
""(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
hasAttributealso returns null when getting a non-existant attribute.