Changeset 2052

Show
Ignore:
Timestamp:
02/27/07 15:24:47 (1 year ago)
Author:
ErikRose
Message:

WikiWygPlugin:

setup.py and deletes:

  • Deleted dead and useless templates. Their functionality is covered, between Trac.js and our IRequestFilter.

wikiwyg.py:

  • Removed superfluous parentheses.
  • Gave the wikiwyg library includer the potential to only include them where necessary.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wikiwygplugin/0.11/setup.py

    r2051 r2052  
    88    version = '1.0', 
    99    packages = ['wikiwyg'], 
    10     package_data = {'wikiwyg': ['templates/*.html', 'htdocs/*.js', 'htdocs/*.css', 'htdocs/*.gif', 'htdocs/*.htc']}, 
     10    package_data = {'wikiwyg': ['htdocs/*.js', 'htdocs/*.css', 'htdocs/*.gif', 'htdocs/*.htc']},  # 'templates/*.html' can go back in here if we need it 
    1111     
    1212    author = "soloturn, Erik Rose, and Frank Wierzbicki", 
  • wikiwygplugin/0.11/wikiwyg/wikiwyg.py

    r2051 r2052  
    1717    def get_htdocs_dirs(self): 
    1818        """Provide the static JavaScript files, CSS, etc.""" 
    19         yield ('', resource_filename(__name__, 'htdocs')
     19        yield '', resource_filename(__name__, 'htdocs'
    2020     
    2121     
     
    2323     
    2424    def pre_process_request(self, req, handler): 
    25         """Load Wikiwyg libs on every page. 
     25        """Load Wikiwyg libs pages that make use of them.""" 
     26        def uses_wikiwyg(req): 
     27            """Return whether the page referenced by req can make use of Wikiwyg.""" 
     28            return True  # TODO: Replace this with actual intelligence: perhaps all wiki pages, etc. 
    2629         
    27         (We might want to get more selective eventually.) 
    28         """ 
    29         for curScript in ['Wikiwyg', 'Toolbar', 'Wysiwyg', 'Wikitext', 'Preview', 'ClientServer']: 
    30             add_script(req, 'wikiwyg/%s.js' % curScript) 
     30        if uses_wikiwyg(req): 
     31            for curScript in ['Wikiwyg', 'Toolbar', 'Wysiwyg', 'Wikitext', 'Preview', 'Trac']:  # 'ClientServer' (put this back in when you implement async save) 
     32                add_script(req, 'wikiwyg/%s.js' % curScript) 
    3133        return handler 
    3234     
    33     # for Genshi templates 
     35    # the Genshi template version 
    3436    def post_process_request(self, req, template, data, content_type): 
    3537        return template, data, content_type