Changeset 17708
- Timestamp:
- Apr 29, 2020, 7:50:14 PM (5 years ago)
- Location:
- citecodemacro/1.0
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
citecodemacro/1.0/setup.py
r16550 r17708 11 11 setup( 12 12 name='TracCiteCode', 13 version='0.3. 5',13 version='0.3.6', 14 14 packages=find_packages(exclude=['*.tests*']), 15 15 license="BSD 3-Clause", … … 17 17 entry_points={ 18 18 'trac.plugins': [ 19 'traccitecode = traccitecode ',19 'traccitecode = traccitecode.citecode', 20 20 ], 21 21 }, -
citecodemacro/1.0/traccitecode/__init__.py
r15608 r17708 1 # -*- coding: utf-8 -*- 2 # 3 # Copyright (C) 2016 tkob <ether4@gmail.com> 4 # All rights reserved. 5 # 6 # This software is licensed as described in the file COPYING, which 7 # you should have received as part of this distribution. 8 9 from traccitecode import citecode 1 import pkg_resources 2 pkg_resources.require('Trac >= 1.2') -
citecodemacro/1.0/traccitecode/citecode.py
r16550 r17708 73 73 content=content, 74 74 filename="", 75 annotations=[' citecode_lineno'],75 annotations=['lineno'], 76 76 ) 77 77 return xhtml … … 133 133 )) 134 134 135 136 # Just copied from trunk of Trac core and renamed annotation_type137 # since 'lineno' hint is not available in Trac 1.0138 139 # Copyright (C) 2004-2014 Edgewall Software140 # Copyright (C) 2004 Daniel Lundin <daniel@edgewall.com>141 # Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de>142 # Copyright (C) 2006-2007 Christian Boos <cboos@edgewall.org>143 # All rights reserved.144 #145 # This software is licensed as described in the file COPYING, which146 # you should have received as part of this distribution. The terms147 # are also available at http://trac.edgewall.org/wiki/TracLicense.148 #149 # This software consists of voluntary contributions made by many150 # individuals. For the exact contribution history, see the revision151 # history and logs, available at http://trac.edgewall.org/log/.152 #153 # Author: Daniel Lundin <daniel@edgewall.com>154 # Christopher Lenz <cmlenz@gmx.de>155 # Christian Boos <cboos@edgewall.org>156 157 from trac.mimeview.api import IHTMLPreviewAnnotator158 from trac.util import Ranges159 from trac.util.html import html as tag160 from trac.util.translation import _161 162 163 class LineNumberAnnotator(Component):164 """Text annotator that adds a column with line numbers."""165 implements(IHTMLPreviewAnnotator)166 167 # IHTMLPreviewAnnotator methods168 169 def get_annotation_type(self):170 return 'citecode_lineno', _('Line'), _('Line numbers')171 172 def get_annotation_data(self, context):173 try:174 marks = Ranges(context.get_hint('marks'))175 except ValueError:176 marks = None177 return {178 'id': context.get_hint('id', '') + 'L%s',179 'marks': marks,180 'offset': context.get_hint('lineno', 1) - 1181 }182 183 def annotate_row(self, context, row, lineno, line, data):184 lineno += data['offset']185 id = data['id'] % lineno186 if data['marks'] and lineno in data['marks']:187 row(class_='hilite')188 row.append(tag.th(id=id)(tag.a(lineno, href='#' + id))) -
citecodemacro/1.0/traccitecode/htdocs/citecode.css
r15613 r17708 1 1 table.code th.citecode_lineno { width: 4em } 2 -
citecodemacro/1.0/traccitecode/htdocs/citecode.js
r16375 r17708 1 $(function() {1 jQuery(function($) { 2 2 $(document).find('table.code tr th a').each(function(){ 3 3 $(this).attr('title', 'Double click to create a ticket');
Note: See TracChangeset
for help on using the changeset viewer.