Changes between Version 4 and Version 5 of AddStaticResourcesPlugin
- Timestamp:
- Jun 9, 2015, 9:42:43 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AddStaticResourcesPlugin
v4 v5 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Add StaticResourcesPlugin =3 = Add Static Resources Plugin 4 4 5 == Description ==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.ini configuration values to enable your static resources on each page you wish. '''Regular expressions are case insensitive by default'''. (There is a patch listed below to provide case sensitivity)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.ini configuration values to enable your static resources on each page you wish. '''Regular expressions are case insensitive by default'''. 8 8 9 {{{ 10 #!ini 9 {{{#!ini 11 10 [static_resources] 12 11 url-regex = list_of_files.js, and_style.css 13 12 }}} 14 13 15 == Installation Help == 16 1. Insert your static files into the 'addstaticresourcesplugin/htdocs' folder of the plugin before install 17 1. Install the plugin (either for a single project, or globally). See the details on how to install a trac plugin at: [trac:TracPlugins] 18 * '''No Really, GO READ [trac:TracPlugins]''' 19 1. Be sure that the plugin is enabled. Add "addstaticresourcesplugin.* = enabled" to trac.ini (in the [components] subheading). 20 * Alternatively, this can be enabled in the Web Admin section of the website as well 21 1. Reload/restart your HTTPD / other webserver / Tracd. That's it. 14 There is also a patch listed below to provide case sensitivity. 22 15 23 24 == Related Plugins == 25 === TracTweakUiPlugin === 26 This plugin is trying to accomplish much of what TracTweakUiPlugin is, however I had some goals that were not being met by TracTweakUiPlugin. 27 * Simple, I want to simply map a url to a javascript/stylesheet that should be included. 28 * Affect all tracs at once 29 * I have many tracs so specifying this once in the shared conf file is much nicer than once in each database 30 * 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. 31 32 == Bugs/Feature Requests == 16 == Bugs/Feature Requests 33 17 34 18 Existing bugs and feature requests for AddStaticResourcesPlugin are … … 36 20 37 21 If you have any issues, create a 38 [ http://trac-hacks.org/newticket?component=AddStaticResourcesPlugin&owner=bobbysmith007new ticket].22 [/newticket?component=AddStaticResourcesPlugin new ticket]. 39 23 40 == Download & Source == 41 '''The trac 11 branch seems to work fine in trac 12, if you experience any issues [http://trac-hacks.org/newticket?component=AddStaticResourcesPlugin&owner=bobbysmith007 please report them]''' 24 [[TicketQuery(component=AddStaticResourcesPlugin&group=type,format=progress)]] 25 26 == Download & Source 27 28 '''Note:''' The Trac 0.11 branch seems to work fine in Trac 0.12. If you experience any issues, then please [http://trac-hacks.org/newticket?component=AddStaticResourcesPlugin&owner=bobbysmith007 report them]. 29 42 30 Download the zipped source: 43 31 * [download:addstaticresourcesplugin ZIP]. … … 47 35 or [source:addstaticresourcesplugin browse the source] with Trac. 48 36 49 === Patches === 37 === Patches 38 50 39 * [http://trac-hacks.org/ticket/7334 Case Sensitive Regex] 51 40 52 == Example == 41 == Installation 42 43 1. Insert your static files into the 'addstaticresourcesplugin/htdocs' folder of the plugin before install 44 1. Install the plugin either for a single project or globally. See the details on how to install a trac plugin at: [trac:TracPlugins]. 45 1. Be sure that the plugin is enabled. Add "addstaticresourcesplugin.* = enabled" to your `trac.ini` file in the [components] subheading. 46 * Alternatively, this can be enabled in the Web Admin section of the website as well. 47 1. Reload/restart your HTTPD / other webserver / Tracd. 48 49 == Related Plugins 50 51 === TracTweakUiPlugin 52 53 This plugin is trying to accomplish much of what TracTweakUiPlugin is, however I had some goals that were not being met by TracTweakUiPlugin. 54 * Simple, I want to simply map a url to a javascript/stylesheet that should be included. 55 * Affect all tracs at once 56 * I have many tracs so specifying this once in the shared conf file is much nicer than once in each database 57 * 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. 58 59 == Example 53 60 54 61 This will cause the helloworld alert message to appear on the ticket and newticket pages. 55 {{{ 56 #!ini 62 {{{#!ini 57 63 [static_resources] 58 64 /(new)?ticket = helloworld.js 59 65 }}} 60 66 61 == Recent Changes ==67 == Recent Changes 62 68 63 69 [[ChangeLog(addstaticresourcesplugin, 3)]] 64 70 65 == Author/Contributors ==71 == Author/Contributors 66 72 67 73 '''Author:''' [wiki:bobbysmith007] [[BR]] 68 '''Maintainer:''' [ wiki:bobbysmith007] [[BR]]74 '''Maintainer:''' [[Maintainer]] [[BR]] 69 75 '''Contributors:'''