-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01.11.2013 11:06, [email protected] wrote:
> I am trying to in add a javascript thing to a Trac wiki page. For example, in 
> this Trac wiki page:
> 
>       /systems/wiki/GPS/maps
> 
> I have:
> 
>       {{{
>       #!html
>               <script src="OpenLayers-2.13.1/OpenLayers.js"></script>
>       }}}
> 
> The script is not found. I see in my apache server log that it is looking for;
> 
>       GET /systems/wiki/GPS/OpenLayers-2.13.1/OpenLayers.js
> 
> which is obviously wrong. I need to have the reference resolve to a directory 
> on the server, not a page in the wiki. How can I do that?

TracWiki will not allow content like scripts unless you explicitly allow
it in your trac.ini:

[wiki]
render_unsafe_content = true

Anyway, I would put the file into <env>/htdocs/
OpenLayers-2.13.1/OpenLayers.js and refer to it as
site/OpenLayers-2.13.1/OpenLayers.js

Resolving a server-relative path might only work, if you implement the
trac.web.chrome.ITemplateProvider [1] and use its get_htdocs_dirs()
method i.e. in a small single-file Trac plugin.

Steffen Hoffmann


[1]
http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.web.chrome.ITemplateProvider
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlJz7i8ACgkQ31DJeiZFuHdxjACfQ5BAnVWFL8741m0U+ZLPsRk6
RiYAoNYQMitqAiPbura1V12S7h0U0XEk
=b6Hj
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to