Opened 10 years ago

Closed 10 years ago

SiteJS module - global and local JavaScript

Reported by: Owned by: clay anybody high Request-a-Hack blocker coderanger@… 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]
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.

comment:1 Changed 10 years ago by clay

Priority: normal → high

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

comment:2 Changed 10 years ago by clay

Resolution: → fixed new → closed

Closed in [1298]

Modify Ticket

Action
as closed The owner will remain anybody.
The resolution will be deleted. Next status will be 'reopened'.