willzh 发表于 2013-2-7 18:52:08

为心爱的MoinMoin写一个小小的Done宏

##################################################### Author: willzh@javaeye# Date: Wed Apr 15 16:07:30 CST 2009# GPLv3##import randomdef 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"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里编辑:
[]
显示效果如下:
http://www.agoit.com/upload/attachment/94515/1be00620-d653-3ac2-bed9-bc9ce1c6b6b3.png
页: [1]
查看完整版本: 为心爱的MoinMoin写一个小小的Done宏