Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Wikipedia bookmarklet for Opera 7.54?

Reply
Thread Tools

Wikipedia bookmarklet for Opera 7.54?

 
 
Gaikokujin Kyofusho
Guest
Posts: n/a
 
      01-12-2005
Hi, I am trying to find a wikipedia bookmarklet for Opera that would
allow me to lookup something highlighted on a page. I could have sworn
that the one i had worked until i had to reinstall opera (why would
that make a difference? all the other bookmarklets continued to work).
Any help would be thoroughly appreciated, perhaps someone out there has
written such a bookmarklet or knows where to find one?
Thank you,

-Gaiko

 
Reply With Quote
 
 
 
 
wolfgang zeidler
Guest
Posts: n/a
 
      01-13-2005
Gaikokujin Kyofusho schrieb:
> Hi, I am trying to find a wikipedia bookmarklet for Opera that would
> allow me to lookup something highlighted on a page. I could have sworn
> that the one i had worked until i had to reinstall opera (why would
> that make a difference? all the other bookmarklets continued to work).
> Any help would be thoroughly appreciated, perhaps someone out there has
> written such a bookmarklet or knows where to find one?
> Thank you,
>
> -Gaiko
>


I don't know whether this bookmarklet fits in opera, you may try it:
-----------

javascript:
var s=window.getSelection().toString();
for(var i=0;!s&&i<frames.length;i++)s=frames[i].getSelection().toString();
var w=window.open('http://en.wikipedia.org/'+
(s?escape(s.replace(/ /g,'_')):''),
'wiki','width=950,height=600,scrollbars=yes,resiza ble=yes');
w.focus();

-----------
Best regards, wz
p.s.(1): I assume you know you'll have to remove the linefeeds.
p.s.(2): Maybe you'll have to replace window.getSelection()
with the ( deprecated ) method document.getSelection().
 
Reply With Quote
 
 
 
 
Steven V. Gunhouse
Guest
Posts: n/a
 
      01-14-2005
On Fri, 14 Jan 2005 00:56:47 +0100, wolfgang zeidler
<(E-Mail Removed)> wrote:

> Gaikokujin Kyofusho schrieb:
>> Hi, I am trying to find a wikipedia bookmarklet for Opera that would
>> allow me to lookup something highlighted on a page. I could have sworn
>> that the one i had worked until i had to reinstall opera (why would
>> that make a difference? all the other bookmarklets continued to work).
>> Any help would be thoroughly appreciated, perhaps someone out there has
>> written such a bookmarklet or knows where to find one?
>> Thank you,
>> -Gaiko
>>

>
> I don't know whether this bookmarklet fits in opera, you may try it:
> -----------
>
> javascript:
> var s=window.getSelection().toString();
> for(var
> i=0;!s&&i<frames.length;i++)s=frames[i].getSelection().toString();
> var w=window.open('http://en.wikipedia.org/'+
> (s?escape(s.replace(/ /g,'_')):''),
> 'wiki','width=950,height=600,scrollbars=yes,resiza ble=yes');
> w.focus();
>
> -----------
> Best regards, wz
> p.s.(1): I assume you know you'll have to remove the linefeeds.
> p.s.(2): Maybe you'll have to replace window.getSelection()
> with the ( deprecated ) method document.getSelection().


"Fits" is not a serious issue in Opera. When actually used as a
bookmarklet (in Bookmarks rather than as a button) the legal length is
quite long.

If you were to drag it to a button, then (besides length) you also have to
insure that you don't use any double quotes. In some of the early versions
of 7 it would also have trouble with "|", "&" or ">", but I believe
they've fixed that issue.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparisons of IE, Opera and Firefox on DOM (Javascript/CSS) support(Opera wins) Bob HTML 24 05-21-2006 05:31 PM
Blogging bookmarklet (that will work with Opera)? gaikokujinkyofusho@gmail.com Javascript 0 02-21-2005 04:00 AM
Bookmarklet like nutritious? (that will work with Opera) gaikokujinkyofusho@gmail.com Javascript 0 02-21-2005 04:00 AM
Opera 7.53 vs Opera 6.0 ? Hockey Buff Computer Support 3 08-17-2004 08:53 PM
Bookmarklet for random url Martin Javascript 5 12-09-2003 10:33 AM



Advertisments