Changeset 4685


Ignore:
Timestamp:
Oct 31, 2008, 4:23:05 PM (16 years ago)
Author:
Jeff Hammel
Message:

adding JS selector for tags

Location:
loomingcloudsplugin/0.11/loomingclouds
Files:
3 added
1 edited

Legend:

Unmodified
Added
Removed
  • loomingcloudsplugin/0.11/loomingclouds/loomingclouds.py

    r4683 r4685  
    77from genshi.filters.transform import Transformer
    88
     9from pkg_resources import resource_filename
     10
    911from trac.core import *
    1012from trac.mimeview import Context
    1113from trac.web.api import ITemplateStreamFilter
     14from trac.web.chrome import add_script
    1215from trac.web.chrome import add_stylesheet
     16from trac.web.chrome import ITemplateProvider
    1317from trac.wiki.formatter import Formatter
    1418from tractags.macros import TagCloudMacro
     
    1620class LoomingClouds(Component):
    1721
    18     implements(ITemplateStreamFilter)
     22    implements(ITemplateStreamFilter, ITemplateProvider)
    1923
    20     ### methods for ITemplateStreamFilter
     24    ### method for ITemplateStreamFilter
    2125
    2226    """Filter a Genshi event stream prior to rendering."""
     
    3741
    3842            add_stylesheet(req, 'tags/css/tractags.css')
     43            add_script(req, 'tags/js/tag_filler.js')
    3944            formatter = Formatter(self.env, Context.from_request(req))
    4045            macro = TagCloudMacro(self.env)
     
    4449
    4550        return stream
     51
     52    ### methods for ITemplateProvider
     53   
     54    def get_htdocs_dirs(self):
     55        """Return a list of directories with static resources (such as style
     56        sheets, images, etc.)
     57
     58        Each item in the list must be a `(prefix, abspath)` tuple. The
     59        `prefix` part defines the path in the URL that requests to these
     60        resources are prefixed with.
     61       
     62        The `abspath` is the absolute path to the directory containing the
     63        resources on the local file system.
     64       
     65        """
     66        return [('tags', resource_filename(__name__, 'htdocs'))]
     67       
     68
     69    def get_templates_dirs(self):
     70        """Return a list of directories containing the provided template
     71        files.
     72        """
     73        return []
     74
Note: See TracChangeset for help on using the changeset viewer.