diff --git a/Gemfile b/Gemfile index 01c8a4f0..05d4cb65 100644 --- a/Gemfile +++ b/Gemfile @@ -36,19 +36,17 @@ gem 'haml-rails' # Use SCSS for stylesheets gem 'sass-rails', '>= 4.0.2' -# Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 1.3.0' - # Use bootstrap as the front-end framework gem 'bootstrap-sass' gem 'formtastic-bootstrap' gem 'formtastic', '~> 2.3.0.rc3' - # Use jquery as the JavaScript library gem 'jquery-rails' gem 'jquery-ui-rails' gem 'jquery-fileupload-rails' +gem 'jquery-rails-cdn' +gem 'jquery-ui-rails-cdn' gem 'cocoon' # Use gravtastic for user avatars @@ -134,3 +132,8 @@ end group :development, :test do gem 'byebug' end + +group :production do + # Use Uglifier as compressor for JavaScript assets + gem 'uglifier' +end diff --git a/Gemfile.lock b/Gemfile.lock index 5c4b58ac..4b721d53 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -118,7 +118,7 @@ GEM diff-lcs (1.2.5) docile (1.1.3) erubis (2.7.0) - execjs (2.0.2) + execjs (2.2.1) factory_girl (4.4.0) activesupport (>= 3.0.0) factory_girl_rails (4.4.1) @@ -167,8 +167,12 @@ GEM jquery-rails (3.1.0) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) + jquery-rails-cdn (1.0.3) + jquery-rails jquery-ui-rails (4.2.1) railties (>= 3.2.16) + jquery-ui-rails-cdn (0.1.5) + jquery-ui-rails (~> 4.1) json (1.8.1) jwt (1.0.0) launchy (2.4.2) @@ -377,7 +381,7 @@ GEM coffee-rails tzinfo (1.2.1) thread_safe (~> 0.1) - uglifier (2.5.0) + uglifier (2.5.3) execjs (>= 0.3.0) json (>= 1.8.0) user_agent_parser (2.1.5) @@ -423,7 +427,9 @@ DEPENDENCIES hoptoad_notifier (~> 2.3) jquery-fileupload-rails jquery-rails + jquery-rails-cdn jquery-ui-rails + jquery-ui-rails-cdn letter_opener mina mysql2 @@ -451,5 +457,5 @@ DEPENDENCIES timecop transitions turbolinks - uglifier (>= 1.3.0) + uglifier whenever diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 0898e46b..482ab129 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -9,9 +9,7 @@ // // 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.ui.all + //= require jquery_ujs //= require jquery-fileupload //= require jquery-ui-timepicker-addon diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 84263735..492ff5ee 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -5,9 +5,11 @@ %title= content_for?(:title) ? yield(:title) : "OSEM" %meta{:content => "", :name => "description"} %meta{:content => "", :name => "author"} + = jquery_include_tag :google + = jquery_ui_include_tag :google + = javascript_include_tag "application" = stylesheet_link_tag "application", :media => "all" = stylesheet_link_tag "splash" if content_for :splash - = javascript_include_tag "application" = csrf_meta_tags :javascript $(function() { diff --git a/config/boot.rb b/config/boot.rb index d2a5e451..fa732982 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,6 +1,4 @@ require 'rubygems' -require 'yaml' -YAML::ENGINE.yamler = 'syck' # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) diff --git a/config/environments/production.rb b/config/environments/production.rb index 69c7f9de..48dda5fd 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,4 @@ -Osem::Application.configure do +Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb # Code is not reloaded between requests @@ -16,8 +16,8 @@ Osem::Application.configure do # Disable Rails's static asset server (Apache or nginx will already do this) config.serve_static_assets = false - # Compress JavaScripts and CSS - config.assets.compress = true + # Compress JavaScripts + config.assets.js_compressor = :uglifier # Don't fallback to assets pipeline if a precompiled asset is missed config.assets.compile = false