Feature #2803

Support for Javascript in Themes

Added by Leonard Brünings almost 9 years ago. Updated almost 7 years ago.

Status:ClosedStart date:2009-02-21
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:ThemesEstimated time:0.50 hour
Target version:1.1.0
Resolution:Fixed

Description

Our theme requires Javascript and it seems the only way to include js is via a custom plugin,
which is a bit overkill IMHO.

Someone already wrote a patch http://www.redmine.org/issues/show/1864 so the work to implement
this in the trunk should be limited.


Related issues

Related to Redmine - Patch #1864: Automatically extend /public with javascripts and images ... Closed 2008-09-05

Associated revisions

Revision 4558
Added by Jean-Philippe Lang almost 7 years ago

Support for Javascript in Themes (#2803).

If javascripts/theme.js is found in the theme directory, it will be automatically loaded on each page.

History

#1 Updated by Ruben Kruiswijk almost 7 years ago

What is the status about this issue? I think it would be very valuable to add javascript support on themes. Are there problems in integrating the patch in issue #1864 ?

#2 Updated by Jean-Philippe Lang almost 7 years ago

Unlike CSS, I don't think it makes sense to let themes override the core application.js (any change to that file would break the compatibility with the theme). Instead, we could automatically load a given script (/javascripts/theme.js for example) if it is found in the theme directory.

#3 Updated by Leonard Brünings almost 7 years ago

That solution would be fine.

#4 Updated by Ruben Kruiswijk almost 7 years ago

That solution would be fine for me too. Could that feature be implemented in Redmine 1.0.5?

#5 Updated by Jean-Philippe Lang almost 7 years ago

  • Category set to Themes
  • Target version set to 1.1.0

No features in stable branches but I think I can add this improvement to 1.1.

#6 Updated by Jean-Philippe Lang almost 7 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Feature added in r4558.
Add javascripts/theme.js to your theme directory and it will loaded automatically.

Also available in: Atom PDF