当前位置: 代码迷 >> Web前端 >> 替心爱的MoinMoin写一个小小的Done宏
  详细解决方案

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

热度:163   发布时间:2012-11-25 11:44:31.0
为心爱的MoinMoin写一个小小的Done宏
###################################################
#
# 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(为所有人生成密码,并发送邮件通知)]]
显示效果如下:

  相关解决方案