From ec8a25ba0b1b7cff6f432cb77574cfc181bea012 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Tue, 12 Jul 2016 14:30:09 -0600 Subject: Replace namespace-specific application.js files with namespace-bundle.js files. --- app/assets/javascripts/graphs/application.js.coffee | 7 ------- app/assets/javascripts/graphs/graphs_bundle.js.coffee | 7 +++++++ app/assets/javascripts/network/application.js.coffee | 17 ----------------- app/assets/javascripts/network/network_bundle.js.coffee | 17 +++++++++++++++++ app/assets/javascripts/profile/application.js.coffee | 2 -- app/assets/javascripts/profile/profile_bundle.js.coffee | 2 ++ app/assets/javascripts/users/application.js.coffee | 2 -- app/assets/javascripts/users/users_bundle.js.coffee | 2 ++ app/views/profiles/_head.html.haml | 2 +- app/views/projects/graphs/_head.html.haml | 2 +- app/views/projects/network/show.html.haml | 2 +- app/views/users/show.html.haml | 2 +- config/application.rb | 8 ++++---- 13 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 app/assets/javascripts/graphs/application.js.coffee create mode 100644 app/assets/javascripts/graphs/graphs_bundle.js.coffee delete mode 100644 app/assets/javascripts/network/application.js.coffee create mode 100644 app/assets/javascripts/network/network_bundle.js.coffee delete mode 100644 app/assets/javascripts/profile/application.js.coffee create mode 100644 app/assets/javascripts/profile/profile_bundle.js.coffee delete mode 100644 app/assets/javascripts/users/application.js.coffee create mode 100644 app/assets/javascripts/users/users_bundle.js.coffee diff --git a/app/assets/javascripts/graphs/application.js.coffee b/app/assets/javascripts/graphs/application.js.coffee deleted file mode 100644 index e0f681acf0b..00000000000 --- a/app/assets/javascripts/graphs/application.js.coffee +++ /dev/null @@ -1,7 +0,0 @@ -# This is a manifest file that'll be compiled into including all the files listed below. -# Add new JavaScript/Coffee code in separate files in this directory and they'll automatically -# be included in the compiled file accessible from http://example.com/assets/application.js -# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -# the compiled file. -# -#= require_tree . diff --git a/app/assets/javascripts/graphs/graphs_bundle.js.coffee b/app/assets/javascripts/graphs/graphs_bundle.js.coffee new file mode 100644 index 00000000000..e0f681acf0b --- /dev/null +++ b/app/assets/javascripts/graphs/graphs_bundle.js.coffee @@ -0,0 +1,7 @@ +# This is a manifest file that'll be compiled into including all the files listed below. +# Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +# be included in the compiled file accessible from http://example.com/assets/application.js +# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +# the compiled file. +# +#= require_tree . diff --git a/app/assets/javascripts/network/application.js.coffee b/app/assets/javascripts/network/application.js.coffee deleted file mode 100644 index f75f63869c5..00000000000 --- a/app/assets/javascripts/network/application.js.coffee +++ /dev/null @@ -1,17 +0,0 @@ -# This is a manifest file that'll be compiled into including all the files listed below. -# Add new JavaScript/Coffee code in separate files in this directory and they'll automatically -# be included in the compiled file accessible from http://example.com/assets/application.js -# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -# the compiled file. -# -#= require_tree . - -$ -> - network_graph = new Network({ - url: $(".network-graph").attr('data-url'), - commit_url: $(".network-graph").attr('data-commit-url'), - ref: $(".network-graph").attr('data-ref'), - commit_id: $(".network-graph").attr('data-commit-id') - }) - - new ShortcutsNetwork(network_graph.branch_graph) diff --git a/app/assets/javascripts/network/network_bundle.js.coffee b/app/assets/javascripts/network/network_bundle.js.coffee new file mode 100644 index 00000000000..f75f63869c5 --- /dev/null +++ b/app/assets/javascripts/network/network_bundle.js.coffee @@ -0,0 +1,17 @@ +# This is a manifest file that'll be compiled into including all the files listed below. +# Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +# be included in the compiled file accessible from http://example.com/assets/application.js +# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +# the compiled file. +# +#= require_tree . + +$ -> + network_graph = new Network({ + url: $(".network-graph").attr('data-url'), + commit_url: $(".network-graph").attr('data-commit-url'), + ref: $(".network-graph").attr('data-ref'), + commit_id: $(".network-graph").attr('data-commit-id') + }) + + new ShortcutsNetwork(network_graph.branch_graph) diff --git a/app/assets/javascripts/profile/application.js.coffee b/app/assets/javascripts/profile/application.js.coffee deleted file mode 100644 index 91cacfece46..00000000000 --- a/app/assets/javascripts/profile/application.js.coffee +++ /dev/null @@ -1,2 +0,0 @@ -# -#= require_tree . diff --git a/app/assets/javascripts/profile/profile_bundle.js.coffee b/app/assets/javascripts/profile/profile_bundle.js.coffee new file mode 100644 index 00000000000..91cacfece46 --- /dev/null +++ b/app/assets/javascripts/profile/profile_bundle.js.coffee @@ -0,0 +1,2 @@ +# +#= require_tree . diff --git a/app/assets/javascripts/users/application.js.coffee b/app/assets/javascripts/users/application.js.coffee deleted file mode 100644 index 91cacfece46..00000000000 --- a/app/assets/javascripts/users/application.js.coffee +++ /dev/null @@ -1,2 +0,0 @@ -# -#= require_tree . diff --git a/app/assets/javascripts/users/users_bundle.js.coffee b/app/assets/javascripts/users/users_bundle.js.coffee new file mode 100644 index 00000000000..91cacfece46 --- /dev/null +++ b/app/assets/javascripts/users/users_bundle.js.coffee @@ -0,0 +1,2 @@ +# +#= require_tree . diff --git a/app/views/profiles/_head.html.haml b/app/views/profiles/_head.html.haml index 003884a5bd9..943ebdaeffe 100644 --- a/app/views/profiles/_head.html.haml +++ b/app/views/profiles/_head.html.haml @@ -1,3 +1,3 @@ - content_for :page_specific_javascripts do = page_specific_javascript_tag('lib/cropper.js') - = page_specific_javascript_tag('profile/application.js') + = page_specific_javascript_tag('profile/profile_bundle.js') diff --git a/app/views/projects/graphs/_head.html.haml b/app/views/projects/graphs/_head.html.haml index ca347406dfe..45e51389c00 100644 --- a/app/views/projects/graphs/_head.html.haml +++ b/app/views/projects/graphs/_head.html.haml @@ -3,7 +3,7 @@ - content_for :page_specific_javascripts do = page_specific_javascript_tag('lib/chart.js') - = page_specific_javascript_tag('graphs/application.js') + = page_specific_javascript_tag('graphs/graphs_bundle.js') = nav_link(action: :show) do = link_to 'Contributors', namespace_project_graph_path = nav_link(action: :commits) do diff --git a/app/views/projects/network/show.html.haml b/app/views/projects/network/show.html.haml index 091af4df4a1..b2ece44d966 100644 --- a/app/views/projects/network/show.html.haml +++ b/app/views/projects/network/show.html.haml @@ -1,7 +1,7 @@ - page_title "Network", @ref - content_for :page_specific_javascripts do = page_specific_javascript_tag('lib/raphael.js') - = page_specific_javascript_tag('network/application.js') + = page_specific_javascript_tag('network/network_bundle.js') = render "projects/commits/head" = render "head" %div{ class: container_class } diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index db2b4885861..c7f39868e71 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -2,7 +2,7 @@ - page_description @user.bio - content_for :page_specific_javascripts do = page_specific_javascript_tag('lib/d3.js') - = page_specific_javascript_tag('users/application.js') + = page_specific_javascript_tag('users/users_bundle.js') - header_title @user.name, user_path(@user) - @no_container = true diff --git a/config/application.rb b/config/application.rb index 21e7cc7b6e8..843502a9826 100644 --- a/config/application.rb +++ b/config/application.rb @@ -81,10 +81,10 @@ module Gitlab config.assets.precompile << "print.css" config.assets.precompile << "notify.css" config.assets.precompile << "mailers/*.css" - config.assets.precompile << "graphs/application.js" - config.assets.precompile << "users/application.js" - config.assets.precompile << "network/application.js" - config.assets.precompile << "profile/application.js" + config.assets.precompile << "graphs/graphs_bundle.js" + config.assets.precompile << "users/users_bundle.js" + config.assets.precompile << "network/network_bundle.js" + config.assets.precompile << "profile/profile_bundle.js" config.assets.precompile << "lib/utils/*.js" config.assets.precompile << "lib/*.js" -- cgit v1.2.1