| curious_jp ( @ 2006-02-07 13:31:00 |
Safari Bookmarklets for Jim Breens WWWJDic
Jims page offers a great generator for most browsers, but they don't work in Safari for a variety of reasons:
Somewhat sensibly, Livejournal is not fond of Javascript in links, so these are provided "as source" and behind a cut:
-- curious_jp
Jims page offers a great generator for most browsers, but they don't work in Safari for a variety of reasons:
1 - document.characterSet isn't supported by the public releases of Webkit yet ( why, god knows ). It was fixed on the 28th of November by Alexey Proskuryakov ( http://bugzilla.opendarwin.org/show_bug.cAlso, string handling semantics are a little different in Webkit Javascript than the Mozilla universe from which these were sourced. If you run a nightly build of Webkit, or if you're reading this after the fix for 5715 has been integrated into a mainline release, here are some nifty bookmarklets. These were generated using the Japanese2Day.com mirror, as that's what I use.gi?id=5715 ).
2 - It doesn't like "document.getSelection" either, preferring "window.getSelection".
Somewhat sensibly, Livejournal is not fond of Javascript in links, so these are provided "as source" and behind a cut:
Search for Japanese word: "javascript:q=window.getSelection();d='U';c=document.characterSet;if(c=='Shift_JI S')d='S';if(c=='EUC-JP')d='D';if(!q||q== ''){void(q=prompt('Enter%20text%20to%20s earch%20using%20WWWJDIC%20(Japanese).',' '))};if(q)location.href='http://www.japa nese2day.com/cgi-bin/wwwjdic/wwwjdic.cgi?1 M'+d+'J'+q"
Search for English word: "javascript:q=window.getSelection();if(!q||q==''){void(q=prompt('Enter%20text%20to%2 0search%20using%20WWWJDIC%20(English).', ''))};if(q)location.href='http://www.jap anese2day.com/cgi-bin/wwwjdic/wwwjdic.cg i?1MDE'+q"
Gloss Japanese text: "javascript:q=window.getSelection();d='I';c=document.characterSet;if(c=='Shift_JI S')d='H';if(c=='EUC-JP')d='G';if(!q||q== ''){void(q=prompt('Enter%20Japanese%20te xt%20to%20gloss.',''))};if(q)location.hr ef='http://www.japanese2day.com/cgi-bin/w wwjdic/wwwjdic.cgi?9M'+d+'G'+q"
-- curious_jp