Opened 8 years ago

Closed 8 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


I'd like something similar to the SysCssPlugin.

  • Allows a system-wide and/or project-only JavaScript directory
  • Requires only the following config settings:
sysjs.* = enabled = enabled
#sysjs.local = enabled

# 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 are enabled, then the [sysjs] global file path will be /usr/share/trac/htdocs/js/sysjs. If [component] = 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.

Attachments (0)

Change History (2)

comment:1 Changed 8 years ago by clay@…

  • Priority changed from normal to 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 8 years ago by clay

  • Resolution set to fixed
  • Status changed from new to closed

Closed in [1298]

Add Comment

Modify Ticket

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

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.