Changes between Version 1 and Version 2 of CtxtnavAddPlugin


Ignore:
Timestamp:
Jun 3, 2006, 6:40:04 AM (9 years ago)
Author:
coderanger
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CtxtnavAddPlugin

    v1 v2  
    2323== Example ==
    2424
    25 Stay tuned
     25Adding a link and a Javascript button to the Wiki:
     26{{{
     27#!python
     28from trac.core import *
     29from trac.util import Markup
    2630
     31from ctxtnavadd.api import ICtxtnavAdder
     32
     33class ExampleModule(Component):
     34
     35    implements(ICtxtnavAdder)
     36
     37    # ICtxtnavAdder methods
     38    def match_ctxtnav_add(self, req, path_info):
     39        return path_info.startswith('/wiki')
     40
     41    def get_ctxtnav_adds(self, req):
     42        yield Markup("""<a href="" onclick="alert('Test'); return false">Markup test</a>""")
     43        yield ('/timeline','Other test')
     44}}}
     45 
    2746== Recent Changes ==
    2847