source: queryuiassistplugin/1.0/uiassist/query.py

Last change on this file was 14387, checked in by matobaa, 9 years ago

closes #12062

File size: 1.2 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Copyright (C) 2012-2013 MATOBA Akihiro <matobaa+trac-hacks@gmail.com>
5# All rights reserved.
6#
7# This software is licensed as described in the file COPYING, which
8# you should have received as part of this distribution.
9
10from trac.core import Component, implements
11from trac.web.api import ITemplateStreamFilter
12from trac.web.chrome import add_script, ITemplateProvider
13from pkg_resources import ResourceManager
14
15
16class Checkbox(Component):
17    """at query when
18    double-click a checkbox clears neighbor checkboxes and check it.
19    double-click a label at left of checkboxes flips checked or not. """
20
21    implements(ITemplateProvider, ITemplateStreamFilter)
22
23    #ITemplateStreamFilter methods
24    def filter_stream(self, req, method, filename, stream, data):
25        if filename == 'query.html':
26            add_script(req, 'querystatushelper/js/enabler.js')
27        return stream
28
29    # ITemplateProvider methods
30    def get_htdocs_dirs(self):
31        return [('querystatushelper', ResourceManager().resource_filename(__name__, 'htdocs'))]
32
33    def get_templates_dirs(self):
34        return []
Note: See TracBrowser for help on using the repository browser.