diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-27 12:35:10 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-03-27 12:35:10 +0200 |
commit | 1a4c60ef57d047dab6aa823f7cc50548897b74f6 (patch) | |
tree | 92bbccd1e1850837da5c7b10344ff77f0be0e7be /app/assets/javascripts/blob_edit/blob_bundle.js | |
parent | 7ada193e0fd28b4a6eca1fda7dda6f0ebe6b2d72 (diff) | |
parent | 7324d6713262d7f9c563d48b82934c4a8eb72a52 (diff) | |
download | gitlab-ce-1a4c60ef57d047dab6aa823f7cc50548897b74f6.tar.gz |
Merge branch 'master' into feature/multi-level-container-registry-images
* master: (192 commits)
Implement new service for creating user
Update sentry-raven 2.0.2 -> 2.4.0
Update webmock 1.21.0 -> 1.24.6
Update spring 1.7.2 -> 2.0.1
Update simplecov 0.12.0 -> 0.14.1
Update pry-rails 0.3.4 -> 0.3.5
Update pry-byebug 3.4.1 -> 3.4.2
Update flay 2.6.1 -> 2.8.1
Remove Tags filter from Projects Explore dropdown
Update capybara-screenshot 1.0.11 -> 1.0.14
Update bullet 5.2.0 -> 5.5.1
Update brakeman 3.4.1 -> 3.6.1
Remove web-console gem
Update better_errors 1.0.1 -> 2.1.1
Display flash message to unauthenticated user when creating new issue
Fix up emoji tests that should have failed :/
Fix RSpec/DescribeSymbol cop violations
Add event limit warning all tabs Cycle Analytics
Adding non_archived scope for counting projects
Resolve "Gitlab administrator cannot create projects in every group"
...
Conflicts:
db/schema.rb
Diffstat (limited to 'app/assets/javascripts/blob_edit/blob_bundle.js')
-rw-r--r-- | app/assets/javascripts/blob_edit/blob_bundle.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/assets/javascripts/blob_edit/blob_bundle.js b/app/assets/javascripts/blob_edit/blob_bundle.js new file mode 100644 index 00000000000..c5deccf631e --- /dev/null +++ b/app/assets/javascripts/blob_edit/blob_bundle.js @@ -0,0 +1,32 @@ +/* eslint-disable func-names, space-before-function-paren, prefer-arrow-callback, no-var, quotes, vars-on-top, no-unused-vars, no-new, max-len */ +/* global EditBlob */ +/* global NewCommitForm */ + +import EditBlob from './edit_blob'; +import BlobFileDropzone from '../blob/blob_file_dropzone'; + +$(() => { + const editBlobForm = $('.js-edit-blob-form'); + const uploadBlobForm = $('.js-upload-blob-form'); + + if (editBlobForm.length) { + const urlRoot = editBlobForm.data('relative-url-root'); + const assetsPath = editBlobForm.data('assets-prefix'); + const blobLanguage = editBlobForm.data('blob-language'); + + new EditBlob(`${urlRoot}${assetsPath}`, blobLanguage); + new NewCommitForm(editBlobForm); + } + + if (uploadBlobForm.length) { + const method = uploadBlobForm.data('method'); + + new BlobFileDropzone(uploadBlobForm, method); + new NewCommitForm(uploadBlobForm); + + window.gl.utils.disableButtonIfEmptyField( + uploadBlobForm.find('.js-commit-message'), + '.btn-upload-file', + ); + } +}); |