Changes between Version 6 and Version 7 of AddStaticResourcesPlugin
- Timestamp:
- Dec 23, 2016, 8:50:08 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AddStaticResourcesPlugin
v6 v7 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Add Static Resources Plugin3 = Add Static Resources to wiki pages 4 4 5 5 == Description 6 6 7 A plugin that maps static resources into urls of your choice. Thus if you wish to add a stylesheet or a javascript to an existing trac page, you can specify in the trac ini a regex that matches the urls of the pages and insert the resources. Just add your static resources to the plugins htdocs folder and install then fill out the trac.iniconfiguration values to enable your static resources on each page you wish. '''Regular expressions are case insensitive by default'''.7 A plugin that maps static resources into urls of your choice. Thus if you wish to add a stylesheet or a javascript to an existing Trac page, you can specify in the `trac.ini` file a regular expression that matches the urls of the pages and insert the resources. Just add your static resources to the plugins htdocs folder and install, then fill out the `trac.ini` configuration values to enable your static resources on each page you wish. '''Regular expressions are case insensitive by default'''. 8 8 9 9 {{{#!ini … … 12 12 }}} 13 13 14 For example, this will cause the helloworld alert message to appear on the ticket and newticket pages: 15 16 {{{#!ini 17 [static_resources] 18 /(new)?ticket = helloworld.js 19 }}} 20 14 21 There is also a patch listed below to provide case sensitivity. 15 22 16 '''Note''': This plugin is trying to accomplish much of what TracTweakUiPlugin is, however with the following additional goals:17 * Simple, I want to simply map a url to a javascript/stylesheet that should be included.18 * Affect all tracs at once19 * I have many tracs so specifying this once in the shared conf file is much nicer than once in each database20 * Deployment of files should be simple and preferably in the egg we are already installing, rather than in a static location I need to keep track of and separately manage for each trac.23 '''Note''': This plugin shares much functionality of TracTweakUiPlugin, however with the following additional goals: 24 * I want to simply map a url to a javascript or stylesheet that should be included. 25 * Affect all Tracs at once: 26 * I have many Tracs, so specifying this once in the shared conf file is much nicer than once in each database. 27 * Deployment of files should be simple and preferably in the egg we are already installing, rather than in a static location I need to keep track of and separately manage for each Trac. 21 28 22 29 == Bugs/Feature Requests … … 27 34 If you have any issues, create a 28 35 [/newticket?component=AddStaticResourcesPlugin new ticket]. 29 30 '''Note:''' The Trac 0.11 branch seems to work fine in Trac 0.12. If you experience any issues, then please [/newticket?component=AddStaticResourcesPlugin report them].31 36 32 37 [[TicketQuery(component=AddStaticResourcesPlugin&group=type,format=progress)]] … … 45 50 46 51 1. Insert your static files into the 'addstaticresourcesplugin/htdocs' folder of the plugin before installation. 47 1. Install the plugin either for a single project or globally. See the details on how to install a trac plugin at [trac:TracPlugins]. 48 1. Enable the plugin. Add "addstaticresourcesplugin.* = enabled" to your `trac.ini` file in the [components] subheading. Alternatively, this can be enabled in the Web Admin section of the website as well. 52 1. Install the plugin either for a single project or globally. See the details on how to install a Trac plugin at [trac:TracPlugins]. 53 1. Enable the plugin in your `trac.ini` file: 54 {{{#!ini 55 [components] 56 addstaticresourcesplugin.* = enabled 57 }}} 58 Alternatively, this can be enabled in the Web Admin section of the website as well. 49 59 1. Reload/restart your HTTPD / other webserver / Tracd. 50 51 == Example52 53 This will cause the helloworld alert message to appear on the ticket and newticket pages.54 {{{#!ini55 [static_resources]56 /(new)?ticket = helloworld.js57 }}}58 60 59 61 == Recent Changes