Attachment 'toggle-linenumber-patch.diff'

Download

   1 diff -ur moin-1.5.0/MoinMoin/formatter/text_html.py moin-1.5.0-toggle-linenumber-patch/MoinMoin/formatter/text_html.py
   2 --- moin-1.5.0/MoinMoin/formatter/text_html.py	2005-12-04 07:37:54.000000000 -0500
   3 +++ moin-1.5.0-toggle-linenumber-patch/MoinMoin/formatter/text_html.py	2006-01-16 11:21:43.000000000 -0500
   4 @@ -541,6 +541,7 @@
   5  """
   6      
   7      def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1):
   8 +        _ = self.request.getText
   9          res = []
  10          ci = self.request.makeUniqueID('CA-%s_%03d' % (code_id, self._code_area_num))
  11          if on:
  12 @@ -562,10 +563,13 @@
  13              if self._code_area_state[1] >= 0:
  14                  toggleLineNumbersLink = r'''
  15  <script type="text/javascript">
  16 -document.write('<a href="#" onClick="return togglenumber(\'%s\', %d, %d);" \
  17 -                class="codenumbers">Toggle line numbers<\/a>');
  18 +document.write('<a href="#" onclick="return togglenumber(\'%(code_id)s\', %(code_start)d, %(code_step)d);" \
  19 +                class="codenumbers">%(toggle_phrase)s<\/a>');
  20  </script>
  21 -''' % (self._code_area_state[0], self._code_area_state[2], self._code_area_state[3])
  22 +''' % { 'toggle_phrase' : wikiutil.escape(_('Toggle line numbers')),
  23 +        'code_id' : wikiutil.escape(self._code_area_state[0], 1),
  24 +        'code_start' : self._code_area_state[2],
  25 +        'code_step' : self._code_area_state[3] }
  26                  res.append(toggleLineNumbersLink)
  27  
  28              # Open pre - using left to right always!
  29 diff -ur moin-1.5.0/wiki/htdocs/classic/css/print.css moin-1.5.0-toggle-linenumber-patch/wiki/htdocs/classic/css/print.css
  30 --- moin-1.5.0/wiki/htdocs/classic/css/print.css	2005-10-31 14:36:12.000000000 -0500
  31 +++ moin-1.5.0-toggle-linenumber-patch/wiki/htdocs/classic/css/print.css	2006-01-16 11:25:16.000000000 -0500
  32 @@ -41,6 +41,13 @@
  33  	border-top: 1pt solid gray;
  34  }
  35  
  36 +/* These are things which should not be displayed in actual hardcopy printouts,
  37 + * usually because they are for interactive "buttons" only.
  38 + */
  39 +@media print {
  40 +  .codenumbers { display:none; }
  41 +}
  42 +
  43  /* user interface styles */
  44  
  45  #header, #sidebar, #footer, #timings, #credits {
  46 diff -ur moin-1.5.0/wiki/htdocs/modern/css/print.css moin-1.5.0-toggle-linenumber-patch/wiki/htdocs/modern/css/print.css
  47 --- moin-1.5.0/wiki/htdocs/modern/css/print.css	2005-10-31 14:35:36.000000000 -0500
  48 +++ moin-1.5.0-toggle-linenumber-patch/wiki/htdocs/modern/css/print.css	2006-01-16 11:24:54.000000000 -0500
  49 @@ -41,6 +41,13 @@
  50  	border-top: 1pt solid gray;
  51  }
  52  
  53 +/* These are things which should not be displayed in actual hardcopy printouts,
  54 + * usually because they are for interactive "buttons" only.
  55 + */
  56 +@media print {
  57 +  .codenumbers { display:none; }
  58 +}
  59 +
  60  /* user interface styles */
  61  
  62  #header, #sidebar, #footer, #timings, #credits {
  63 diff -ur moin-1.5.0/wiki/htdocs/rightsidebar/css/print.css moin-1.5.0-toggle-linenumber-patch/wiki/htdocs/rightsidebar/css/print.css
  64 --- moin-1.5.0/wiki/htdocs/rightsidebar/css/print.css	2005-10-31 14:35:50.000000000 -0500
  65 +++ moin-1.5.0-toggle-linenumber-patch/wiki/htdocs/rightsidebar/css/print.css	2006-01-16 11:25:34.000000000 -0500
  66 @@ -41,6 +41,13 @@
  67  	border-top: 1pt solid gray;
  68  }
  69  
  70 +/* These are things which should not be displayed in actual hardcopy printouts,
  71 + * usually because they are for interactive "buttons" only.
  72 + */
  73 +@media print {
  74 +  .codenumbers { display:none; }
  75 +}
  76 +
  77  /* user interface styles */
  78  
  79  #header, #sidebar, #footer, #timings, #credits {

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.
  • [get | view] (2006-01-13 22:30:49, 0.3 KB) [[attachment:classic-print.css.diff]]
  • [get | view] (2006-01-13 22:30:54, 0.3 KB) [[attachment:modern-print.css.diff]]
  • [get | view] (2006-01-13 22:30:59, 0.3 KB) [[attachment:rightsidebar-print.css.diff]]
  • [get | view] (2006-01-13 22:38:16, 1.3 KB) [[attachment:text_html.py.diff]]
  • [get | view] (2006-01-16 16:28:11, 3.4 KB) [[attachment:toggle-linenumber-patch.diff]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.