From 7ce9ce012229bc216c30f0da90da04f49cf0a867 Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Thu, 18 Oct 2012 18:11:41 -0700 Subject: [PATCH] Use the asset pipeline for stylesheets and javascripts. --- app/assets/javascripts/application.js | 16 ++++++++++++++++ app/assets/stylesheets/application.css | 14 ++++++++++++++ app/views/layouts/application.html.haml | 7 ++++--- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/stylesheets/application.css diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 000000000..8dc063f47 --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,16 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// +//= require jquery +//= require jquery_ujs +//= require_tree . +/////= javascript_include_tag 'prototype', 'jquery-ui.min', 'jquery.tokeninput', 'excanvas.min', 'raphael-min', 'grafico.min', 'jquery.form', 'jquery.placeholders', 'jquery.ui.combobox', 'jquery.colorbox.js', 'jquery.tipsy', 'search', 'application', :cache => 'all' diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 000000000..71a41998f --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,14 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_tree . +**********= stylesheet_link_tag 'reset', 'layout', 'forms', 'tables', 'jquery.ui.custom', 'jquery.ui.combobox', 'typography', 'links', 'token-input-facebook', 'tipsy', 'application', 'colorbox', 'help', :cache => 'all' + */ diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 71e2c636f..3e645cd55 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -8,13 +8,14 @@ - if session[:autorefresh] %meta{ :content => "5; URL=#{request.url}", "http-equiv" => "refresh" } - = javascript_include_tag 'jquery.min' + = stylesheet_link_tag 'application' + :javascript var relative_url_root = '#{ActionController::Base.relative_url_root}'; $.noConflict(); - = stylesheet_link_tag 'reset', 'layout', 'forms', 'tables', 'jquery.ui.custom', 'jquery.ui.combobox', 'typography', 'links', 'token-input-facebook', 'tipsy', 'application', 'colorbox', 'help', :cache => 'all' - = javascript_include_tag 'prototype', 'jquery-ui.min', 'jquery.tokeninput', 'excanvas.min', 'raphael-min', 'grafico.min', 'jquery.form', 'jquery.placeholders', 'jquery.ui.combobox', 'jquery.colorbox.js', 'jquery.tipsy', 'search', 'application', :cache => 'all' + = javascript_include_tag 'application' + - Registry.each_callback :core, :head_extensions do |widget| = widget.call self