Skip to content

Instantly share code, notes, and snippets.

@FND
Created June 7, 2009 13:01
Show Gist options
  • Select an option

  • Save FND/125316 to your computer and use it in GitHub Desktop.

Select an option

Save FND/125316 to your computer and use it in GitHub Desktop.
/***
<<mURL "http://google.com" "http://tiddlywiki.com" "http://tiddlywiki.org">>
***/
//{{{
(function($) {
config.macros.mURL = {
handler: function(place, macroName, params, wikifier, paramString, tiddler) {
var container = $('<div class="mURL" />').appendTo(place);
$.each(params, function(i, item) {
var callback = function(ev) {
var url = $(this).attr("href");
$("iframe", container).attr("src", url);
return false;
};
$("<a />").attr("href", item).text(i).click(callback).
appendTo(container);
});
var el = $("<iframe />").appendTo(container);
}
};
})(jQuery);
//}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment