From f314e7a89cd7a1759784b605f35683eb0f75a80e Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 15 Apr 2013 15:07:40 +1000 Subject: [PATCH] make source git pull freindly, no need to copy files around when updating --- app/assets/javascripts/application.js.erb | 54 ++++++------------- .../ember.js | 0 .../group-helper.js | 0 .../sugar-1.3.5.js | 0 app/assets/javascripts/main_include.js | 31 +++++++++++ spec/javascripts/spec.js | 4 +- 6 files changed, 50 insertions(+), 39 deletions(-) rename app/assets/javascripts/{external => external_development}/ember.js (100%) rename app/assets/javascripts/{external => external_development}/group-helper.js (100%) rename app/assets/javascripts/{external => external_development}/sugar-1.3.5.js (100%) create mode 100644 app/assets/javascripts/main_include.js diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index 0c9fdac50..9dc1ad1a6 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -13,43 +13,21 @@ //= require ./external/jquery-1.8.2.js //= require ./external/jquery.ui.widget.js //= require ./external/handlebars-1.0.rc.3.js -//= require ./external/ember.js - -// Pagedown customizations -//= require ./pagedown_custom.js - -// The rest of the externals -//= require_tree ./external - -//= require ./discourse/helpers/i18n_helpers -//= require ./discourse - -//= require ./locales/date_locales.js - -// Stuff we need to load first -//= require_tree ./discourse/mixins -//= require ./discourse/views/view -//= require ./discourse/components/debounce -//= require ./discourse/controllers/controller -//= require ./discourse/controllers/object_controller -//= require ./discourse/views/modal/modal_body_view -//= require ./discourse/models/model -//= require ./discourse/routes/discourse_route -//= require ./discourse/routes/discourse_restricted_user_route - -//= require_tree ./discourse/controllers -//= require_tree ./discourse/components -//= require_tree ./discourse/models -//= require_tree ./discourse/views -//= require_tree ./discourse/helpers -//= require_tree ./discourse/templates -//= require_tree ./discourse/routes - -//= require ./external/browser-update.js - <% - # Include javascripts - DiscoursePluginRegistry.javascripts.each do |js| - require_asset(js) - end +if Rails.env.development? + require_asset ("./external_development/ember.js") + require_asset ("./external_development/sugar-1.3.5.js") + require_asset ("./external_development/group-helper.js") +else + require_asset ("./external_production/ember.js") + require_asset ("./external_production/sugar-1.3.5.js") + require_asset ("./external_production/group-helper.js") +end + +require_asset ("./main_include.js") + +# Include plugin javascripts +DiscoursePluginRegistry.javascripts.each do |js| + require_asset(js) +end %> diff --git a/app/assets/javascripts/external/ember.js b/app/assets/javascripts/external_development/ember.js similarity index 100% rename from app/assets/javascripts/external/ember.js rename to app/assets/javascripts/external_development/ember.js diff --git a/app/assets/javascripts/external/group-helper.js b/app/assets/javascripts/external_development/group-helper.js similarity index 100% rename from app/assets/javascripts/external/group-helper.js rename to app/assets/javascripts/external_development/group-helper.js diff --git a/app/assets/javascripts/external/sugar-1.3.5.js b/app/assets/javascripts/external_development/sugar-1.3.5.js similarity index 100% rename from app/assets/javascripts/external/sugar-1.3.5.js rename to app/assets/javascripts/external_development/sugar-1.3.5.js diff --git a/app/assets/javascripts/main_include.js b/app/assets/javascripts/main_include.js new file mode 100644 index 000000000..e08348fac --- /dev/null +++ b/app/assets/javascripts/main_include.js @@ -0,0 +1,31 @@ +// Pagedown customizations +//= require ./pagedown_custom.js + +// The rest of the externals +//= require_tree ./external + +//= require ./discourse/helpers/i18n_helpers +//= require ./discourse + +//= require ./locales/date_locales.js + +// Stuff we need to load first +//= require_tree ./discourse/mixins +//= require ./discourse/views/view +//= require ./discourse/components/debounce +//= require ./discourse/controllers/controller +//= require ./discourse/controllers/object_controller +//= require ./discourse/views/modal/modal_body_view +//= require ./discourse/models/model +//= require ./discourse/routes/discourse_route +//= require ./discourse/routes/discourse_restricted_user_route + +//= require_tree ./discourse/controllers +//= require_tree ./discourse/components +//= require_tree ./discourse/models +//= require_tree ./discourse/views +//= require_tree ./discourse/helpers +//= require_tree ./discourse/templates +//= require_tree ./discourse/routes + +//= require ./external/browser-update.js diff --git a/spec/javascripts/spec.js b/spec/javascripts/spec.js index 85dd2f51b..dbf9cb3e4 100644 --- a/spec/javascripts/spec.js +++ b/spec/javascripts/spec.js @@ -10,7 +10,9 @@ //= require ../../app/assets/javascripts/external/jquery.ui.widget.js //= require ../../app/assets/javascripts/external/handlebars-1.0.rc.3.js -//= require ../../app/assets/javascripts/external/ember.js +//= require ../../app/assets/javascripts/external_production/ember.js +//= require ../../app/assets/javascripts/external_production/sugar-1.3.5.js +//= require ../../app/assets/javascripts/external_production/group-helper.js // Pagedown customizations //= require ../../app/assets/javascripts/pagedown_custom.js