Browse files

Documented custom javascript.

  • Loading branch information...
1 parent fec2dd4 commit 5e753ff24f977c55aa6fd9f39b36f76687b21ad7 Alan Johnson committed May 16, 2009
Showing with 9 additions and 1 deletion.
  1. +8 −0 README.markdown
  2. +1 −1 generators/control_center/templates/control_center.rb
@@ -140,6 +140,14 @@ To add custom CSS to Control Center, simply use the custom_css config property i
Would create two links in Control Center, one to a stylesheet named custom_css_1 with a media attribute of all, and one to custom_css_2 with a media attribute of print.
+Custom JavaScript
+Add custom JavaScript to the Control Center interface by using the include_javascript property in the initializer. The value you set to include_javascript gets passed to the Rails javascript_include_tag helper.
+ ControlCenter::Config.include_javascript = [ :defaults ]
+This would cause the Rails default javascripts (Prototype, Scriptaculous, and application.js) to be inluded with Control Center. The scripts are included at the bottom of the body of your page, as per the YSlow guidelines.
Where are the tests?
I'm usually very good about testing my code, but I wasn't sure of the best way to test something that was so interface intensive, so tests simply aren't present for the 1.0 release. Tests are one of my biggest goals for the 1.1 release.
@@ -11,4 +11,4 @@
# }
# Custom JavaScript Includes
-#ControlCenter::Config.include_javascript = %w(:defaults)
+#ControlCenter::Config.include_javascript = [:defaults]

0 comments on commit 5e753ff

Please sign in to comment.