Attachment 'CPyUG-friendlyFootNote_ZH.patch'
Download 1 --- FootNote.py.orig 2006-10-25 15:47:44.000000000 +0800
2 +++ FootNote.py 2007-04-13 14:52:16.000000000 +0800
3 @@ -1,11 +1,12 @@
4 -# -*- coding: iso-8859-1 -*-
5 +# coding: utf-8
6 +## -*- coding: iso-8859-1 -*-
7 """
8 MoinMoin - FootNote Macro
9
10 Collect and emit footnotes. Note that currently footnote
11 text cannot contain wiki markup.
12
13 - @copyright: 2002 by Jürgen Hermann <[email protected]>
14 + @copyright: 2002 by J黵gen Hermann <[email protected]>
15 @license: GNU GPL, see COPYING for details.
16 """
17
18 @@ -14,7 +15,12 @@
19 from MoinMoin.parser import wiki
20
21 Dependencies = ["time"] # footnote macro cannot be cached
22 -
23 +attaWord = u"注"
24 +attaFootWord = """<span id='footlabel'>`FootNote
25 + <a href='#top'>
26 + <img alt='[top]' height='10' src='/wiki/modern/img/moin-top.png' title='[top]' width='14' /></a>
27 + </span>
28 + """
29 def execute(macro, args):
30 # create storage for footnotes
31 if not hasattr(macro.request, 'footnotes'):
32 @@ -29,8 +35,11 @@
33 macro.request.footnotes.append((args, fn_id))
34 return "%s%s%s%s%s" % (
35 macro.formatter.sup(1),
36 - macro.formatter.anchorlink(1, 'fndef' + fn_id, id = 'fnref' + fn_id),
37 - macro.formatter.text(str(idx+1)),
38 + macro.formatter.anchorlink(1, 'fndef' + fn_id,
39 + id = 'fnref' + fn_id,
40 + onFocus="this.style.backgroundColor='#933';this.style.color='#fff';",
41 + onBlur="this.style.backgroundColor='transparent';this.style.color='#a9a';",),
42 + macro.formatter.text(attaWord+str(idx+1)),
43 macro.formatter.anchorlink(0),
44 macro.formatter.sup(0),)
45
46 @@ -44,6 +53,7 @@
47 result = []
48
49 result.append(formatter.div(1, css_class='footnotes'))
50 + result.append(attaFootWord)
51
52 # Add footnotes list
53 result.append(formatter.bullet_list(1))
54 @@ -54,8 +64,10 @@
55
56 fn_id = request.footnotes[idx][1]
57 result.append(formatter.anchorlink(1, 'fnref' + fn_id,
58 - id='fndef' + fn_id))
59 - result.append(formatter.text(str(idx + 1)))
60 + id='fndef' + fn_id,
61 + onFocus="this.style.backgroundColor='#930';this.style.color='#fff';",
62 + onBlur="this.style.backgroundColor='#fff';this.style.color='#9a9';",))
63 + result.append(formatter.text(attaWord+str(idx + 1)))
64 result.append(formatter.anchorlink(0))
65 result.append(formatter.text(" "))
66
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.