Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
cb6c036d
Commit
cb6c036d
authored
Mar 01, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create a common.js bundle and include all jQuery plugins
parent
e80fa698
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
30 deletions
+34
-30
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+1
-17
app/assets/javascripts/commons/bootstrap.js
app/assets/javascripts/commons/bootstrap.js
+10
-0
app/assets/javascripts/commons/index.js
app/assets/javascripts/commons/index.js
+2
-0
app/assets/javascripts/commons/jquery.js
app/assets/javascripts/commons/jquery.js
+12
-0
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+1
-0
config/webpack.config.js
config/webpack.config.js
+7
-1
spec/javascripts/test_bundle.js
spec/javascripts/test_bundle.js
+1
-12
No files found.
app/assets/javascripts/application.js
View file @
cb6c036d
...
...
@@ -6,23 +6,8 @@
/* global AwardsHandler */
/* global Aside */
window
.
$
=
window
.
jQuery
=
require
(
'
jquery
'
);
require
(
'
jquery-ujs
'
);
require
(
'
vendor/jquery.endless-scroll
'
);
require
(
'
vendor/jquery.waitforimages
'
);
require
(
'
vendor/jquery.caret
'
);
require
(
'
vendor/jquery.atwho
'
);
require
(
'
vendor/jquery.scrollTo
'
);
// common libraries
window
.
Cookies
=
require
(
'
js-cookie
'
);
require
(
'
./autosave
'
);
require
(
'
bootstrap/js/affix
'
);
require
(
'
bootstrap/js/alert
'
);
require
(
'
bootstrap/js/dropdown
'
);
require
(
'
bootstrap/js/modal
'
);
require
(
'
bootstrap/js/tab
'
);
require
(
'
bootstrap/js/transition
'
);
require
(
'
bootstrap/js/tooltip
'
);
require
(
'
select2/select2.js
'
);
window
.
Pikaday
=
require
(
'
pikaday
'
);
window
.
_
=
require
(
'
underscore
'
);
window
.
Dropzone
=
require
(
'
dropzone
'
);
...
...
@@ -34,7 +19,6 @@ require('./shortcuts_navigation');
require
(
'
./shortcuts_dashboard_navigation
'
);
require
(
'
./shortcuts_issuable
'
);
require
(
'
./shortcuts_network
'
);
require
(
'
vendor/jquery.nicescroll
'
);
// behaviors
require
(
'
./behaviors/autosize
'
);
...
...
app/assets/javascripts/commons/bootstrap.js
0 → 100644
View file @
cb6c036d
require
(
'
./jquery
'
);
// twitter bootstrap plugins
require
(
'
bootstrap-sass/assets/javascripts/bootstrap/affix
'
);
require
(
'
bootstrap-sass/assets/javascripts/bootstrap/alert
'
);
require
(
'
bootstrap-sass/assets/javascripts/bootstrap/dropdown
'
);
require
(
'
bootstrap-sass/assets/javascripts/bootstrap/modal
'
);
require
(
'
bootstrap-sass/assets/javascripts/bootstrap/tab
'
);
require
(
'
bootstrap-sass/assets/javascripts/bootstrap/transition
'
);
require
(
'
bootstrap-sass/assets/javascripts/bootstrap/tooltip
'
);
app/assets/javascripts/commons/index.js
0 → 100644
View file @
cb6c036d
require
(
'
./jquery
'
);
require
(
'
./bootstrap
'
);
app/assets/javascripts/commons/jquery.js
0 → 100644
View file @
cb6c036d
// jQuery library
window
.
$
=
window
.
jQuery
=
require
(
'
jquery
'
);
// jQuery plugins
require
(
'
jquery-ujs
'
);
require
(
'
vendor/jquery.endless-scroll
'
);
require
(
'
vendor/jquery.caret
'
);
require
(
'
vendor/jquery.atwho
'
);
require
(
'
vendor/jquery.scrollTo
'
);
require
(
'
vendor/jquery.nicescroll
'
);
require
(
'
vendor/jquery.waitforimages
'
);
require
(
'
select2/select2.js
'
);
app/views/layouts/_head.html.haml
View file @
cb6c036d
...
...
@@ -28,6 +28,7 @@
=
stylesheet_link_tag
"application"
,
media:
"all"
=
stylesheet_link_tag
"print"
,
media:
"print"
=
javascript_include_tag
(
*
webpack_asset_paths
(
"common"
))
=
javascript_include_tag
(
*
webpack_asset_paths
(
"application"
))
-
if
content_for?
(
:page_specific_javascripts
)
...
...
config/webpack.config.js
View file @
cb6c036d
...
...
@@ -17,6 +17,7 @@ var WEBPACK_REPORT = process.env.WEBPACK_REPORT;
var
config
=
{
context
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
),
entry
:
{
common
:
'
./commons/index.js
'
,
application
:
'
./application.js
'
,
blob_edit
:
'
./blob_edit/blob_edit_bundle.js
'
,
boards
:
'
./boards/boards_bundle.js
'
,
...
...
@@ -90,13 +91,18 @@ var config = {
IS_PRODUCTION
?
new
webpack
.
HashedModuleIdsPlugin
()
:
new
webpack
.
NamedModulesPlugin
(),
// create a common.js bundle to be loaded on every page
new
webpack
.
optimize
.
CommonsChunkPlugin
({
name
:
'
common
'
,
minChunks
:
Infinity
,
}),
],
resolve
:
{
extensions
:
[
'
.js
'
,
'
.es6
'
,
'
.js.es6
'
],
alias
:
{
'
~
'
:
path
.
join
(
ROOT_PATH
,
'
app/assets/javascripts
'
),
'
bootstrap/js
'
:
'
bootstrap-sass/assets/javascripts/bootstrap
'
,
'
emoji-aliases$
'
:
path
.
join
(
ROOT_PATH
,
'
fixtures/emojis/aliases.json
'
),
'
icons
'
:
path
.
join
(
ROOT_PATH
,
'
app/views/shared/icons
'
),
'
vendor
'
:
path
.
join
(
ROOT_PATH
,
'
vendor/assets/javascripts
'
),
...
...
spec/javascripts/test_bundle.js
View file @
cb6c036d
...
...
@@ -5,23 +5,12 @@ jasmine.getFixtures().fixturesPath = 'base/spec/javascripts/fixtures';
jasmine
.
getJSONFixtures
().
fixturesPath
=
'
base/spec/javascripts/fixtures
'
;
// include common libraries
require
(
'
~/commons/index.js
'
);
window
.
$
=
window
.
jQuery
=
require
(
'
jquery
'
);
window
.
_
=
require
(
'
underscore
'
);
window
.
Cookies
=
require
(
'
js-cookie
'
);
window
.
Vue
=
require
(
'
vue
'
);
window
.
Vue
.
use
(
require
(
'
vue-resource
'
));
require
(
'
jquery-ujs
'
);
require
(
'
bootstrap/js/affix
'
);
require
(
'
bootstrap/js/alert
'
);
require
(
'
bootstrap/js/button
'
);
require
(
'
bootstrap/js/collapse
'
);
require
(
'
bootstrap/js/dropdown
'
);
require
(
'
bootstrap/js/modal
'
);
require
(
'
bootstrap/js/scrollspy
'
);
require
(
'
bootstrap/js/tab
'
);
require
(
'
bootstrap/js/transition
'
);
require
(
'
bootstrap/js/tooltip
'
);
require
(
'
bootstrap/js/popover
'
);
// stub expected globals
window
.
gl
=
window
.
gl
||
{};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment