Skip to content

Instantly share code, notes, and snippets.

@sophiathekitty
Created February 14, 2014 23:55
Show Gist options
  • Save sophiathekitty/9012060 to your computer and use it in GitHub Desktop.
Save sophiathekitty/9012060 to your computer and use it in GitHub Desktop.
//requires jquery
macros['displaydelayed'] = {
handler: function(html,name,args,wikifier){
if(args.length > 0){
var p = "";
var n = 1000;
var id = Math.round(Math.random()*1000);
if(args.length == 1){
if(tale.has(args[0]))
p = args[0];
n = p;
} else {
if(tale.has(args[0])){
p = args[0];
n = args[1]
} else {
p = args[1];
n = args[0];
}
}
if(tale.has(p)){
function showDelayedPassage(){
var t = tale.get(p);
new Wikifier($("#delayed_show_"+id)[0], t.processText());
$("#delayed_show_"+id).show();
}
new Wikifier(html, "<span id='delayed_show_"+id+"' style='display:none;'></span>");
setTimeout(showDelayedPassage,n);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment