Modifying global JS?

Hi all,
How, if it’s even possible, can I modify the JS used on all pages in RT? I’m toying with the idea of adding notifications, but to do that, I need to have every page use whatever script I come up with. How can I make sure every page in RT loads a custom script? Thanks in advance.

Hi

  1. Create .js file. For example /opt/rt4/local/static/js/my.js and add code you want
  2. Assign this file to RT in config. Add to RT_SiteConfig.pm

Set(@JSFiles, qw/
my.js
/);

  1. Clear “cache” rm -fr /opt/rt4/var/mason_data/obj/*
  2. Restart WebServer (ex. service httpd restart)

Thanks, I’ll give that a shot once I better know how I’ll make notifications work. Are the slashes in your example of setting the JSFiles variable supposed to be there, or were they an accident of the forum text editor?

Slashes must be there
Look at RT_Config.pm

=item C<@JSFiles>

A list of additional JavaScript files to be included in head.

=cut

Set(@JSFiles, qw//);

Ah, okay. Thanks. Looks like this project will have to wait a while, as it’s low priority and browser notifications aren’t as standardized as I thought, but it’s good to know how to insert any JS I might need into RT.