Opened 19 years ago
Closed 19 years ago
#734 closed enhancement (fixed)
SiteJS module - global and local JavaScript
| Reported by: | clay | Owned by: | anybody |
|---|---|---|---|
| Priority: | high | Component: | Request-a-Hack |
| Severity: | blocker | Keywords: | |
| Cc: | coderanger@… | Trac Release: | 0.10 |
Description
I'd like something similar to the SysCssPlugin.
- Allows a system-wide and/or project-only JavaScript directory
- Requires only the following config settings:
[components] sysjs.* = enabled #sysjs.global = enabled #sysjs.local = enabled [sysjs] # files to load global = prototype.js,scriptaculous.js,subdir/other.js local = myproject.js,subdir/extra.js
If possible, I'd like to be able to avoid creating a .py file as the syscss plugin currently requires. It seems like this could be avoided by just establishing defaults.
For example, if [component] values of sysjs.* or sysjs.global are enabled, then the [sysjs] global file path will be /usr/share/trac/htdocs/js/sysjs. If [component] sysjs.global = disabled, the [sysjs] global setting will be ignored.
Similarly, if [component] sysjs.* = enabled or [component] sysjs.local = enabled, then files specified by [sysjs] local will be loaded from /path/to/trac/env/js.
Seems like a much simpler setup to me than what's done in SysCssPlugin. Love SysCssPlugin, but think it could possibly be easier to configure than it is currently. (Of course, I say this knowing damn little about Python.)
CC'ing coderanger, since I hope he'll be interested in this project.



Oh yeah ... perhaps this goes without saying, but the
<script src="..."></script>tags that this plugin generates should live in the document<head>block. :)