Created
February 14, 2014 23:55
-
-
Save sophiathekitty/9012060 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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