Trac Tweak UI
Table of Contents
SEE:ZoomQuiet ~ Collection KSPEG Trac hacking
Description
- Its purpose is to implement a javascript deployment platform, which enable trac administrators to easy tweak trac pages by simply using javascript.
- It can apply different javascripts to different pages by matching regular expression.
- Support trac web admin
Bugs/Feature Requests
Existing bugs and feature requests for TracTweakUiPlugin are here.
If you have any issues, create a new ticket.
Download
Download the zipped source from here.
Source
You can check out TracTweakUiPlugin from here using Subversion, or browse the source with Trac.
Configuration
- Uninstall Trac Tweak UI if you have installed before.
- Change to the directory containning setup.py.
- If you want to install this plugin globally, that will install this plugin to the python path:
- python setup.py install
- If you want to install this plugin to trac instance only:
- python setup.py bdist_egg
- copy the generated egg file to the trac instance's plugin directory
cp dist/*.egg /srv/trac/env/plugins
- Config trac.ini:
[components] tractweakui.* = enabled
- Add following directory structure to trac environment's htdocs directory(using editcc as example):
htdocs/tractweakui/
Or you can simply copy the htdocs/tractweakui/ in source to trac environment's htdocs directory.
Example
Admin Trac Tweak UI with addon javascript plugins
- Enter trac's Web Admin, select TracTweakUI Admin
- Add url path(regular expression): /newticket
- Select /newticket, then select filter editcc
- Click Load Default, and edit filter javascript, then Save
- Now click New Ticket to test the editcc javascript plugin.
Admin Trac Tweak UI with any other javascript plugins
- take autocomplete for instance
- Prepare autocomplete directory in trac environment
mkdir /path/to/trac/environment/htdocs/tractweakui/autocomplete cp main.css /path/to/trac/environment/htdocs/tractweakui/autocomplete/ cp jquery.autocomplete.css /path/to/trac/environment/htdocs/tractweakui/autocomplete/ cp jquery.autocomplete.js /path/to/trac/environment/htdocs/tractweakui/autocomplete/ cp jquery.bgiframe.min.js /path/to/trac/environment/htdocs/tractweakui/autocomplete/ cp indicator.gif /path/to/trac/environment/htdocs/tractweakui/autocomplete/ touch /path/to/trac/environment/htdocs/tractweakui/autocomplete/__template__.js
- Edit template.js (optional)
$(document).ready(function() { var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; $("#field-cc").autocomplete(months); });
- Now, you can admin and test autocomplete javascript plugins as described above.
Recent Changes
[5180] by richard on 02/02/09 22:17:44
#4495 Try to fix setup.py package_data
[4465] by richard on 10/13/08 08:40:46
fix setup.py for plugin wiki url
[4464] by richard on 10/13/08 08:37:24
Add tractweakui plugin
[4456] by richard on 10/13/08 06:00:22
New hack TracTweakUiPlugin, created by richard
Author/Contributors
Author: richard
Contributors:
Attachments
- trac_tweakui_demo_1.png (17.9 kB) - added by richard on 10/15/08 06:54:40.
- trac_editcc.png (4.2 kB) - added by richard on 10/15/08 07:59:06.