K-Meleon

KMeleonWiki > Resources > MacroLibrary > KmmVisualize

Submitted by: rstlne



Notes:

vi.sualize.us is a service for bookmarking and sharing images. This macro is equivalent to the vi.sualize.us bookmarklet except that it works even if you have your bookmark options set to open bookmarks in a new layer. Invoke the macro from the Document popup menu on the web page containing the image you wish to share.




Open your User Macro Folder (Edit > Configuration > User-Defined Macros) or your Macro Folder (Edit > Configuration > Macros) and create the following text file(s):

visualize.kmm

# visualize.kmm
#
# Macro equivalent to the vi.sualize.us bookmarklet for posting an image to
# vi.sualize.us. This macro is the same as the bookmarklet provided by
# vi.sualize.us, except that the macro works even if you have set your
# bookmark options to open bookmarks in a new layer.

visualize_go{
# Temporarily turn off popup blocking.
$__blockpref="dom.disable_open_during_load";
$__b=getpref(BOOL,$__blockpref);
setpref(BOOL,$__blockpref,false);

$__s="(function(){function l(u,i){";
$__s=$__s."var d=document;if(!d.getElementById(i)){";
$__s=$__s."var s=d.createElement('script');s.src=u;s.id=i;";
$__s=$__s."d.body.appendChild(s);}}";
$__s=$__s."l('http://vi.sualize.us/js/visualizeus.js','visualizeus')})();";
injectJS($__s);

# Restore popup blocking if it was turned on previously.
setpref(BOOL,$__blockpref,$__b);
}

_visualize_buildmenu{
setmenu(Document,macro,"Post to vi.sualize.us",visualize_go,-1);
}

$OnInit=$OnInit."_visualize_buildmenu;";
$macroModules=$macroModules."visualize;";

# vim:set tw=0:
# -- The End --


Comments & Questions

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.