Wikipedia bookmarklet for Opera 7.54?

Discussion in 'Javascript' started by Gaikokujin Kyofusho, Jan 12, 2005.

  1. 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
     
    Gaikokujin Kyofusho, Jan 12, 2005
    #1
    1. Advertising

  2. 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.getSelection().toString();
    var w=window.open('http://en.wikipedia.org/'+
    (s?escape(s.replace(/ /g,'_')):''),
    'wiki','width=950,height=600,scrollbars=yes,resizable=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().
     
    wolfgang zeidler, Jan 13, 2005
    #2
    1. Advertising

  3. On Fri, 14 Jan 2005 00:56:47 +0100, wolfgang zeidler
    <> 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.getSelection().toString();
    > var w=window.open('http://en.wikipedia.org/'+
    > (s?escape(s.replace(/ /g,'_')):''),
    > 'wiki','width=950,height=600,scrollbars=yes,resizable=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/
     
    Steven V. Gunhouse, Jan 14, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob
    Replies:
    24
    Views:
    1,546
  2. Martin

    Bookmarklet for random url

    Martin, Dec 8, 2003, in forum: Javascript
    Replies:
    5
    Views:
    116
    Martin
    Dec 9, 2003
  3. Christoff Pale
    Replies:
    0
    Views:
    96
    Christoff Pale
    Jan 9, 2004
  4. Replies:
    0
    Views:
    78
  5. Replies:
    0
    Views:
    74
Loading...

Share This Page