################################################### # # Author: willzh@javaeye # Date: Wed Apr 15 16:07:30 CST 2009 # GPLv3 # # import random def execute(macro, args): html =''' <script> function displayDoneHint%(id)s() { var done = document.getElementById('done%(id)s'); done.style.display="inline"; } function hiddenDoneHint%(id)s() { var done = document.getElementById('done%(id)s'); done.style.display="none"; } </script> <style> .donehint { position: absolute; display:none; background-color:#f3f3cc; font-size:10px; border: 1px solid #e2e2aa; padding: 1px 2px; margin-top: -6px; } </style> <span style="text-decoration:line-through" onmouseover="displayDoneHint%(id)s()" onmouseout="hiddenDoneHint%(id)s()" >%(content)s</span> <div id="done%(id)s" class="donehint">Done!</div> ''' content = args or "" return html % {'id':str(random.randint(0,1000)),'content':content}
然后在MoinMoin里编辑:
[[Done(为所有人生成密码,并发送邮件通知)]]
显示效果如下: