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
33f26de5
Commit
33f26de5
authored
Mar 17, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Loads raw JSON & displays in the component
[ci skip]
parent
f9ced97a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
4 deletions
+61
-4
app/assets/javascripts/blob/notebook_viewer.js
app/assets/javascripts/blob/notebook_viewer.js
+32
-3
app/assets/stylesheets/application.scss
app/assets/stylesheets/application.scss
+1
-0
app/views/projects/blob/_notebook.html.haml
app/views/projects/blob/_notebook.html.haml
+1
-1
vendor/assets/stylesheets/notebooklab.css
vendor/assets/stylesheets/notebooklab.css
+27
-0
No files found.
app/assets/javascripts/blob/notebook_viewer.js
View file @
33f26de5
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
VueResource
from
'
vue-resource
'
;
import
NotebookLab
from
'
vendor/notebooklab
'
;
import
NotebookLab
from
'
vendor/notebooklab
'
;
Vue
.
use
(
VueResource
);
Vue
.
use
(
NotebookLab
);
Vue
.
use
(
NotebookLab
);
$
(()
=>
{
$
(()
=>
{
const
el
=
document
.
getElementById
(
'
js-notebook-viewer
'
);
new
Vue
({
new
Vue
({
el
:
'
#js-notebook-viewer
'
,
el
,
data
()
{
data
()
{
return
{
return
{
loading
:
true
,
json
:
{},
json
:
{},
};
};
},
},
template
:
`
template
:
`
<div>
<div class="container-fluid">
<notebook-lab :notebook="json" />
<i
class="fa fa-spinner fa-spin"
v-if="loading">
</i>
<notebook-lab
v-if="!loading"
:notebook="json" />
</div>
</div>
`
,
`
,
mounted
()
{
$
.
get
(
gon
.
katex_css_url
,
()
=>
{
const
css
=
$
(
'
<link>
'
,
{
rel
:
'
stylesheet
'
,
type
:
'
text/css
'
,
href
:
gon
.
katex_css_url
,
});
css
.
appendTo
(
'
head
'
);
});
$
.
getScript
(
gon
.
katex_js_url
,
()
=>
{
this
.
$http
.
get
(
el
.
dataset
.
endpoint
)
.
then
((
res
)
=>
{
this
.
json
=
res
.
json
();
this
.
loading
=
false
;
});
});
},
});
});
});
});
app/assets/stylesheets/application.scss
View file @
33f26de5
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
*= require_self
*= require_self
*= require dropzone/basic
*= require dropzone/basic
*= require cropper.css
*= require cropper.css
*= require notebooklab.css
*/
*/
/*
/*
...
...
app/views/projects/blob/_notebook.html.haml
View file @
33f26de5
...
@@ -2,4 +2,4 @@
...
@@ -2,4 +2,4 @@
=
page_specific_javascript_bundle_tag
(
'common_vue'
)
=
page_specific_javascript_bundle_tag
(
'common_vue'
)
=
page_specific_javascript_bundle_tag
(
'notebook_viewer'
)
=
page_specific_javascript_bundle_tag
(
'notebook_viewer'
)
.file-content
#js-notebook-viewer
.file-content
#js-notebook-viewer
{
data:
{
endpoint:
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
@id
)
}
}
vendor/assets/stylesheets/notebooklab.css
0 → 100644
View file @
33f26de5
.cell
,
.input
,
.output
{
display
:
flex
;
width
:
100%
;
margin-bottom
:
10px
;
}
.cell
:not
(
.text-cell
)
{
flex-direction
:
column
;
}
.prompt
{
padding
:
0
10px
;
min-width
:
7em
;
font-family
:
monospace
;
}
.cell
pre
{
margin
:
0
;
width
:
100%
;
}
.markdown
.katex
{
display
:
block
;
text-align
:
center
;
}
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