Merge branch 'cs-cropper' into 'master'

Split Cropper.js from the main JavaScript manifest.

## What does this MR do?

Splits Cropper.js from the main JavaScript file.

## Are there points in the code the reviewer needs to double check?

That the avatar uploader works. (It did in my testing)

## Why was this MR needed?

Smaller JS payload.

## What are the relevant issue numbers?

#14372 

## Does this MR meet the acceptance criteria?

- Tests
  - [x] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

See merge request !4978
This commit is contained in:
Fatih Acet
2016-07-08 19:03:11 +00:00
18 changed files with 25 additions and 4 deletions
@@ -54,7 +54,6 @@
#= require_directory ./u2f
#= require_directory .
#= require fuzzaldrin-plus
#= require cropper
#= require u2f
window.slugify = (text) ->
@@ -131,7 +131,6 @@ class Dispatcher
when 'dashboard', 'root'
shortcut_handler = new ShortcutsDashboardNavigation()
when 'profiles'
new Profile()
new NotificationsForm()
new NotificationsDropdown()
when 'projects'
@@ -0,0 +1 @@
#= require cropper
@@ -5,12 +5,12 @@
w.gl.utils.isInGroupsPage = ->
return $('body').data('page').split(':')[0] is 'groups'
return gl.utils.getPagePath() is 'groups'
w.gl.utils.isInProjectPage = ->
return $('body').data('page').split(':')[0] is 'projects'
return gl.utils.getPagePath() is 'projects'
w.gl.utils.getProjectSlug = ->
@@ -40,6 +40,9 @@
e.stopImmediatePropagation()
return false
gl.utils.getPagePath = ->
return $('body').data('page').split(':')[0]
jQuery.timefor = (time, suffix, expiredLabel) ->
@@ -0,0 +1,2 @@
#
#= require_tree .
@@ -78,3 +78,6 @@ $ ->
if comment && comment.length > 1 && $title.val() == ''
$title.val(comment[1]).change()
if gl.utils.getPagePath() == 'profiles'
new Profile()
+3
View File
@@ -0,0 +1,3 @@
- content_for :page_specific_javascripts do
= page_specific_javascript_tag('lib/cropper.js')
= page_specific_javascript_tag('profile/application.js')
@@ -1,4 +1,5 @@
- page_title "Account"
= render 'profiles/head'
- if current_user.ldap_user?
.alert.alert-info
+1
View File
@@ -1,4 +1,5 @@
- page_title "Audit Log"
= render 'profiles/head'
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
@@ -1,4 +1,5 @@
- page_title "Emails"
= render 'profiles/head'
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
+1
View File
@@ -1,2 +1,3 @@
- page_title @key.title, "SSH Keys"
= render 'profiles/head'
= render "key_details"
@@ -1,4 +1,5 @@
- page_title "Notifications"
= render 'profiles/head'
%div
- if @user.errors.any?
@@ -1,4 +1,5 @@
- page_title "Personal Access Tokens"
= render 'profiles/head'
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
@@ -1,4 +1,5 @@
- page_title 'Preferences'
= render 'profiles/head'
= form_for @user, url: profile_preferences_path, remote: true, method: :put, html: {class: 'row prepend-top-default js-preferences-form'} do |f|
.col-lg-3.profile-settings-sidebar
+2
View File
@@ -1,3 +1,5 @@
= render 'profiles/head'
= form_for @user, url: profile_path, method: :put, html: { multipart: true, class: "edit-user prepend-top-default" }, authenticity_token: true do |f|
= form_errors(@user)
@@ -1,5 +1,6 @@
- page_title 'Two-Factor Authentication', 'Account'
- header_title "Two-Factor Authentication", profile_two_factor_auth_path
= render 'profiles/head'
.row.prepend-top-default
.col-lg-3
+1
View File
@@ -84,6 +84,7 @@ module Gitlab
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 << "lib/utils/*.js"
config.assets.precompile << "lib/*.js"