07-07-09.hacking 升级
smile
加装GTalk smile 样式
修订 /usr/local/lib/python2.4/site-packages/MoinMoin/config.py
1 smileys = {
2 #"X-(": (15, 15, 0, "angry.png"),
3 #":D": (15, 15, 0, "biggrin.png"),
4 "<:(": (15, 15, 0, "frown.png"),
5 ":o": (15, 15, 0, "redface.png"),
6 #":(": (15, 15, 0, "sad.png"),
7 ":)": (15, 15, 0, "smile.png"),
8 "B)": (15, 15, 0, "smile2.png"),
9 #":))": (15, 15, 0, "smile3.png"),
10 #";)": (15, 15, 0, "smile4.png"),
11 "/!\\": (15, 15, 0, "alert.png"),
12 "<!>": (15, 15, 0, "attention.png"),
13 "(!)": (15, 15, 0, "idea.png"),
14
15 # GTalk smile
16 "<3": (13, 12, 0, "heart.gif"),
17 ":(|)": (13, 12, 0, "monkey.gif"),
18 "\m/": (13, 12, 0, "rockout.gif"),
19 ":-o": (13, 12, 0, 'shocked.gif'),
20 "B-)": (13, 12, 0, 'cool.gif'),
21 ":-|": (13, 12, 0, 'straightface.gif'),
22
23 ":P": (13, 12, 0, 'tongue.gif'),
24 ":D": (13, 12, 0, 'grin.gif'),
25 "=D": (13, 12, 0, 'equal_grin.gif'),
26 ":-D": (13, 12, 0, 'nose_grin.gif'),
27
28 ";)": (13, 12, 0, 'wink.gif'),
29 ";^)": (13, 12, 0, 'wink_big_nose.gif'),
30 ";-)": (13, 12, 0, 'wink_nose.gif'),
31 ":-)": (13, 12, 0, 'nose_smile.gif'),
32 "=)": (13, 12, 0, 'equal_smile.gif'),
33
34 ":-/": (13, 12, 0, 'slant.gif'),
35 ":(": (13, 12, 0, 'frown.gif'),
36 "X-(": (13, 12, 0, 'angry.gif'),
37 ":'(": (13, 12, 0, 'cry.gif'),
38
39 # copied 2001-11-16 from http://pikie.darktech.org/cgi/pikie.py?EmotIcon
40 ":-?": (15, 15, 0, "tongue.png"),
41 ":\\": (15, 15, 0, "ohwell.png"),
42 ">:>": (15, 15, 0, "devil.png"),
43 "|)": (15, 15, 0, "tired.png"),
44
45 # some folks use noses in their emoticons
46 ":-(": (15, 15, 0, "sad.png"),
47 #":-)": (15, 15, 0, "smile.png"),
48 #"B-)": (15, 15, 0, "smile2.png"),
49 #":-))": (15, 15, 0, "smile3.png"),
50 #";-)": (15, 15, 0, "smile4.png"),
51 "|-)": (15, 15, 0, "tired.png"),
52
53 # version 1.0
54 "(./)": (20, 15, 0, "checkmark.png"),
55 "{OK}": (14, 12, 0, "thumbs-up.png"),
56 "{X}": (16, 16, 0, "icon-error.png"),
57 "{i}": (16, 16, 0, "icon-info.png"),
58 "{1}": (15, 13, 0, "prio1.png"),
59 "{2}": (15, 13, 0, "prio2.png"),
60 "{3}": (15, 13, 0, "prio3.png"),
61
62 # version 1.3.4 (stars)
63 # try {*}{*}{o}
64 "{*}": (15, 15, 0, "star_on.png"),
65 "{o}": (15, 15, 0, "star_off.png"),
66 }
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 += "<div id='subpageQuickIn'>{<a href='"+realURL+"'>"+subURL+"</a>" < cntpage += "<a href='"+realURL+"?action=edit'>" < #cntpage +="}<img src='"+url_prefix+"/classic/img/moin-edit.png'/>" < cntpage +="}<sup>e</sup>" < #cntpage +=subURL < cntpage += "</a></div><div id='subpageLineSpace'></div>" < result.append(cntpage) < < #result.append(strfile.getvalue()) --- > result.append(strfile.getvalue())
- 追加子页面快速进入/编辑链接,以及CSS容器
macro.FootNote
diff FootNote.py 修订
18,23c17 < attaWord = u"注" < attaFootWord = """<span id='footlabel'>`FootNote < <a href='#top'> < <img alt='[top]' height='10' src='/wiki/modern/img/moin-top.png' title='[top]' width='14' /></a> < </span> < """ --- > 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<br/>%s<br/>%s<br/>" % (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
- 合理放弃大量日期格式命名的日志页面匹配