<> = 07-07-09.hacking 升级 = == smile == 加装GTalk smile 样式 * 修订 `/usr/local/lib/python2.4/site-packages/MoinMoin/config.py` {{{#!python smileys = { #"X-(": (15, 15, 0, "angry.png"), #":D": (15, 15, 0, "biggrin.png"), "<:(": (15, 15, 0, "frown.png"), ":o": (15, 15, 0, "redface.png"), #":(": (15, 15, 0, "sad.png"), ":)": (15, 15, 0, "smile.png"), "B)": (15, 15, 0, "smile2.png"), #":))": (15, 15, 0, "smile3.png"), #";)": (15, 15, 0, "smile4.png"), "/!\\": (15, 15, 0, "alert.png"), "": (15, 15, 0, "attention.png"), "(!)": (15, 15, 0, "idea.png"), # GTalk smile "<3": (13, 12, 0, "heart.gif"), ":(|)": (13, 12, 0, "monkey.gif"), "\m/": (13, 12, 0, "rockout.gif"), ":-o": (13, 12, 0, 'shocked.gif'), "B-)": (13, 12, 0, 'cool.gif'), ":-|": (13, 12, 0, 'straightface.gif'), ":P": (13, 12, 0, 'tongue.gif'), ":D": (13, 12, 0, 'grin.gif'), "=D": (13, 12, 0, 'equal_grin.gif'), ":-D": (13, 12, 0, 'nose_grin.gif'), ";)": (13, 12, 0, 'wink.gif'), ";^)": (13, 12, 0, 'wink_big_nose.gif'), ";-)": (13, 12, 0, 'wink_nose.gif'), ":-)": (13, 12, 0, 'nose_smile.gif'), "=)": (13, 12, 0, 'equal_smile.gif'), ":-/": (13, 12, 0, 'slant.gif'), ":(": (13, 12, 0, 'frown.gif'), "X-(": (13, 12, 0, 'angry.gif'), ":'(": (13, 12, 0, 'cry.gif'), # copied 2001-11-16 from http://pikie.darktech.org/cgi/pikie.py?EmotIcon ":-?": (15, 15, 0, "tongue.png"), ":\\": (15, 15, 0, "ohwell.png"), ">:>": (15, 15, 0, "devil.png"), "|)": (15, 15, 0, "tired.png"), # some folks use noses in their emoticons ":-(": (15, 15, 0, "sad.png"), #":-)": (15, 15, 0, "smile.png"), #"B-)": (15, 15, 0, "smile2.png"), #":-))": (15, 15, 0, "smile3.png"), #";-)": (15, 15, 0, "smile4.png"), "|-)": (15, 15, 0, "tired.png"), # version 1.0 "(./)": (20, 15, 0, "checkmark.png"), "{OK}": (14, 12, 0, "thumbs-up.png"), "{X}": (16, 16, 0, "icon-error.png"), "{i}": (16, 16, 0, "icon-info.png"), "{1}": (15, 13, 0, "prio1.png"), "{2}": (15, 13, 0, "prio2.png"), "{3}": (15, 13, 0, "prio3.png"), # version 1.3.4 (stars) # try {*}{*}{o} "{*}": (15, 15, 0, "star_on.png"), "{o}": (15, 15, 0, "star_off.png"), } }}} == Include() == * diff Include.py{{{ 18,19d17 < # Zoomq::05Q1 fixed global var for Apache setup the MoinMoin root < url_root = '/moin/' 225,245c223 < < # Zoomq:: fixed inclued page quick enter link < cntpage = strfile.getvalue() < subURL = args.group('name') < if None==re.compile("^/").search(subURL): < realURL=url_root+subURL < else: < realURL=url_root+this_page.page_name+subURL < #if "/" not in subURL: < # realURL=url_root+subURL < #else: < # realURL=url_root+this_page.page_name+subURL < cntpage += "
{"+subURL+"" < cntpage += "" < #cntpage +="}" < cntpage +="}e" < #cntpage +=subURL < cntpage += "
" < result.append(cntpage) < < #result.append(strfile.getvalue()) --- > result.append(strfile.getvalue()) }}} * 追加子页面快速进入/编辑链接,以及CSS容器 == macro.FootNote == * diff FootNote.py 修订{{{ 18,23c17 < attaWord = u"注" < attaFootWord = """`FootNote < < [top] < < """ --- > 38,42c32,33 < macro.formatter.anchorlink(1, 'fndef' + fn_id, < id = 'fnref' + fn_id, < onFocus="this.style.backgroundColor='#933';this.style.color='#fff';", < onBlur="this.style.backgroundColor='transparent';this.style.color='#a9a';",), < macro.formatter.text(attaWord+str(idx+1)), --- > macro.formatter.anchorlink(1, 'fndef' + fn_id, id = 'fnref' + fn_id), > macro.formatter.text(str(idx+1)), 56d46 < result.append(attaFootWord) 67,70c57,58 < id='fndef' + fn_id, < onFocus="this.style.backgroundColor='#930';this.style.color='#fff';", < onBlur="this.style.backgroundColor='#fff';this.style.color='#9a9';",)) < result.append(formatter.text(attaWord+str(idx + 1))) --- > id='fndef' + fn_id)) > result.append(formatter.text(str(idx + 1))) }}} == macro.LikePages == * diff LikePages.py{{{ 1c1 < # -*- coding: utf-8 -*- --- > # -*- coding: iso-8859-1 -*- 12,13d11 < import re < datere = re.compile(r'\d{4}-\d{2}-\d{2}') 17,38c15,22 < # we don't want to spend much CPU for spiders requesting nonexisting pages < if not request.isSpiderAgent: < pagename = macro.formatter.page.page_name < < # Get matches < start, end, matches = LikePages.findMatches(pagename, request) < #return "%s
%s
%s
" % (start, end, matches) < < tmpmatch = {} < for p in matches.keys(): < # 检查匹配页面是否带有日期形式字符串 < if re.search(datere, p): < pass < else: < tmpmatch[p]=matches[p] < #return 'Calendar Page will not be searched.' < matches = tmpmatch < < # Render matches < if matches and not isinstance(matches, (str, unicode)): < return request.redirectedOutput(LikePages.showMatches, pagename, request, start, end, matches, False) < return args --- > pagename = macro.formatter.page.page_name > > # Get matches > start, end, matches = LikePages.findMatches(pagename, request) > > # Render matches > if matches and not isinstance(matches, (str, unicode)): > return request.redirectedOutput(LikePages.showMatches, pagename, request, start, end, matches, False) 40c24 < return '' --- > return args }}} * 合理放弃大量日期格式命名的日志页面匹配