[Vimperator] JavaScript for Google Bookmark(let)
cRaig Forrester
treehead at gmail.com
Sun Feb 24 07:04:09 PST 2008
On Sun, Feb 24, 2008 at 7:43 AM, Martin Stubenschrott
<stubenschrott at gmx.net> wrote:
> Andrzej Ostruszka wrote:
>
> > I'm not the best person to answer since I don't know JavaScript but I
> > made for exactly this purpose the following mapping:
> > map gb :javascript
> > loadURI("http://www.google.com/bookmarks/mark?op=edit&bkmk="+encodeURIComponent(vimperator.buffer.URL)+"&title="+vimperator.buffer.title)<CR>
>
> That's the obvious solution, yeah :)
>
> However, in :javascript, "vimperator." is the default namespace, so you
> can also write buffer.URL instead of vimperator.buffer.URL there.
>
javascript <<EOF
gmark = function(){var
a=window,b=document,c=encodeURIComponent,d=a.open("http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+c(buffer.URL)+"&title="+c(buffer.title),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=420px,width=550px,resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},300)};
EOF
map gb :js gmark()<CR>
That worked. It appears that Firefox was assuming the proper context
for everything but the URL. Without "buffer.URL" I kept getting the
"chrome://..." instead of the current URL.
cRaig
EOM
More information about the Vimperator
mailing list