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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9d9d0105
Commit
9d9d0105
authored
Mar 01, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate sketch_viewer to dynamic import
parent
4e86a737
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
7 deletions
+5
-7
app/assets/javascripts/blob/sketch_viewer.js
app/assets/javascripts/blob/sketch_viewer.js
+2
-2
app/assets/javascripts/blob/viewer/index.js
app/assets/javascripts/blob/viewer/index.js
+3
-0
app/views/projects/blob/viewers/_sketch.html.haml
app/views/projects/blob/viewers/_sketch.html.haml
+0
-4
config/webpack.config.js
config/webpack.config.js
+0
-1
No files found.
app/assets/javascripts/blob/sketch_viewer.js
View file @
9d9d0105
/* eslint-disable no-new */
/* eslint-disable no-new */
import
SketchLoader
from
'
./sketch
'
;
import
SketchLoader
from
'
./sketch
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
export
default
()
=>
{
const
el
=
document
.
getElementById
(
'
js-sketch-viewer
'
);
const
el
=
document
.
getElementById
(
'
js-sketch-viewer
'
);
new
SketchLoader
(
el
);
new
SketchLoader
(
el
);
}
)
;
};
app/assets/javascripts/blob/viewer/index.js
View file @
9d9d0105
...
@@ -38,6 +38,9 @@ export default class BlobViewer {
...
@@ -38,6 +38,9 @@ export default class BlobViewer {
case
'
pdf
'
:
case
'
pdf
'
:
initViewer
(
import
(
/* webpackChunkName: 'pdf_viewer' */
'
../pdf_viewer
'
));
initViewer
(
import
(
/* webpackChunkName: 'pdf_viewer' */
'
../pdf_viewer
'
));
break
;
break
;
case
'
sketch
'
:
initViewer
(
import
(
/* webpackChunkName: 'sketch_viewer' */
'
../sketch_viewer
'
));
break
;
default
:
default
:
break
;
break
;
}
}
...
...
app/views/projects/blob/viewers/_sketch.html.haml
View file @
9d9d0105
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
(
'common_vue'
)
=
webpack_bundle_tag
(
'sketch_viewer'
)
.file-content
#js-sketch-viewer
{
data:
{
endpoint:
blob_raw_path
}
}
.file-content
#js-sketch-viewer
{
data:
{
endpoint:
blob_raw_path
}
}
.js-loading-icon.text-center.prepend-top-default.append-bottom-default.js-loading-icon
{
'aria-label'
=>
'Loading Sketch preview'
}
.js-loading-icon.text-center.prepend-top-default.append-bottom-default.js-loading-icon
{
'aria-label'
=>
'Loading Sketch preview'
}
=
icon
(
'spinner spin 2x'
,
'aria-hidden'
=>
'true'
);
=
icon
(
'spinner spin 2x'
,
'aria-hidden'
=>
'true'
);
config/webpack.config.js
View file @
9d9d0105
...
@@ -47,7 +47,6 @@ function generateEntries() {
...
@@ -47,7 +47,6 @@ function generateEntries() {
mr_notes
:
'
./mr_notes/index.js
'
,
mr_notes
:
'
./mr_notes/index.js
'
,
protected_branches
:
'
./protected_branches
'
,
protected_branches
:
'
./protected_branches
'
,
registry_list
:
'
./registry/index.js
'
,
registry_list
:
'
./registry/index.js
'
,
sketch_viewer
:
'
./blob/sketch_viewer.js
'
,
stl_viewer
:
'
./blob/stl_viewer.js
'
,
stl_viewer
:
'
./blob/stl_viewer.js
'
,
terminal
:
'
./terminal/terminal_bundle.js
'
,
terminal
:
'
./terminal/terminal_bundle.js
'
,
two_factor_auth
:
'
./two_factor_auth.js
'
,
two_factor_auth
:
'
./two_factor_auth.js
'
,
...
...
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