Attachment 'text_html.py.diff'
Download
Toggle line numbers
1 --- MoinMoin/formatter/text_html.py.orig 2005-12-04 07:37:54.000000000 -0500
2 +++ MoinMoin/formatter/text_html.py 2006-01-13 17:37:06.000000000 -0500
3 @@ -541,6 +541,7 @@
4 """
5
6 def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1):
7 + _ = self.request.getText
8 res = []
9 ci = self.request.makeUniqueID('CA-%s_%03d' % (code_id, self._code_area_num))
10 if on:
11 @@ -562,10 +563,13 @@
12 if self._code_area_state[1] >= 0:
13 toggleLineNumbersLink = r'''
14 <script type="text/javascript">
15 -document.write('<a href="#" onClick="return togglenumber(\'%s\', %d, %d);" \
16 - class="codenumbers">Toggle line numbers<\/a>');
17 +document.write('<a href="#" onclick="return togglenumber(\'%(code_id)s\', %(code_start)d, %(code_step)d);" \
18 + class="codenumbers">%(toggle_phrase)s<\/a>');
19 </script>
20 -''' % (self._code_area_state[0], self._code_area_state[2], self._code_area_state[3])
21 +''' % { 'toggle_phrase' : wikiutil.escape(_('Toggle line numbers')),
22 + 'code_id' : wikiutil.escape(self._code_area_state[0], 1),
23 + 'code_start' : self._code_area_state[2],
24 + 'code_step' : self._code_area_state[3] }
25 res.append(toggleLineNumbersLink)
26
27 # Open pre - using left to right always!
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.