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
313258fa
Commit
313258fa
authored
Mar 20, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stops errors in the rendering breaking the page
Fixed some output types [ci skip]
parent
33f26de5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
10 deletions
+49
-10
app/assets/javascripts/blob/notebook_viewer.js
app/assets/javascripts/blob/notebook_viewer.js
+10
-8
vendor/assets/javascripts/notebooklab.js
vendor/assets/javascripts/notebooklab.js
+39
-2
No files found.
app/assets/javascripts/blob/notebook_viewer.js
View file @
313258fa
...
@@ -5,6 +5,10 @@ import NotebookLab from 'vendor/notebooklab';
...
@@ -5,6 +5,10 @@ import NotebookLab from 'vendor/notebooklab';
Vue
.
use
(
VueResource
);
Vue
.
use
(
VueResource
);
Vue
.
use
(
NotebookLab
);
Vue
.
use
(
NotebookLab
);
Vue
.
config
.
errorHandler
=
(
err
)
=>
{
console
.
log
(
err
);
}
$
(()
=>
{
$
(()
=>
{
const
el
=
document
.
getElementById
(
'
js-notebook-viewer
'
);
const
el
=
document
.
getElementById
(
'
js-notebook-viewer
'
);
...
@@ -12,6 +16,7 @@ $(() => {
...
@@ -12,6 +16,7 @@ $(() => {
el
,
el
,
data
()
{
data
()
{
return
{
return
{
error
:
false
,
loading
:
true
,
loading
:
true
,
json
:
{},
json
:
{},
};
};
...
@@ -28,14 +33,11 @@ $(() => {
...
@@ -28,14 +33,11 @@ $(() => {
</div>
</div>
`
,
`
,
mounted
()
{
mounted
()
{
$
.
get
(
gon
.
katex_css_url
,
()
=>
{
$
(
'
<link>
'
,
{
const
css
=
$
(
'
<link>
'
,
{
rel
:
'
stylesheet
'
,
rel
:
'
stylesheet
'
,
type
:
'
text/css
'
,
type
:
'
text/css
'
,
href
:
gon
.
katex_css_url
,
href
:
gon
.
katex_css_url
,
}).
appendTo
(
'
head
'
);
});
css
.
appendTo
(
'
head
'
);
});
$
.
getScript
(
gon
.
katex_js_url
,
()
=>
{
$
.
getScript
(
gon
.
katex_js_url
,
()
=>
{
this
.
$http
.
get
(
el
.
dataset
.
endpoint
)
this
.
$http
.
get
(
el
.
dataset
.
endpoint
)
...
...
vendor/assets/javascripts/notebooklab.js
View file @
313258fa
...
@@ -235,11 +235,24 @@ exports.default = {
...
@@ -235,11 +235,24 @@ exports.default = {
output
:
function
output
()
{
output
:
function
output
()
{
return
this
.
cell
.
outputs
[
0
];
return
this
.
cell
.
outputs
[
0
];
},
},
outputType
:
function
outputType
()
{
if
(
!
this
.
output
.
text
)
{
return
Object
.
keys
(
this
.
output
.
data
)[
0
];
}
},
outputText
:
function
outputText
()
{
outputText
:
function
outputText
()
{
if
(
this
.
output
.
text
)
{
if
(
this
.
output
.
text
)
{
return
this
.
output
.
text
.
join
(
''
);
return
this
.
output
.
text
.
join
(
''
);
}
else
{
}
else
{
return
this
.
output
.
data
[
Object
.
keys
(
this
.
output
.
data
)[
0
]].
join
(
''
);
var
output
=
this
.
output
.
data
[
this
.
outputType
];
if
(
typeof
output
===
'
array
'
)
{
return
output
.
join
(
''
);
}
else
if
(
typeof
output
===
'
string
'
)
{
return
output
;
}
else
{
return
''
;
}
}
}
}
}
}
}
...
@@ -257,6 +270,7 @@ exports.default = {
...
@@ -257,6 +270,7 @@ exports.default = {
//
//
//
//
//
//
//
/***/
}),
/***/
}),
/* 4 */
/* 4 */
...
@@ -284,6 +298,11 @@ exports.default = {
...
@@ -284,6 +298,11 @@ exports.default = {
type
:
Number
,
type
:
Number
,
required
:
false
required
:
false
},
},
outputType
:
{
type
:
String
,
required
:
false
,
default
:
''
},
type
:
{
type
:
{
type
:
String
,
type
:
String
,
required
:
true
required
:
true
...
@@ -305,6 +324,13 @@ exports.default = {
...
@@ -305,6 +324,13 @@ exports.default = {
var
type
=
this
.
type
.
split
(
'
put
'
)[
0
];
var
type
=
this
.
type
.
split
(
'
put
'
)[
0
];
return
type
.
charAt
(
0
).
toUpperCase
()
+
type
.
slice
(
1
);;
return
type
.
charAt
(
0
).
toUpperCase
()
+
type
.
slice
(
1
);;
},
isImage
:
function
isImage
()
{
if
(
this
.
outputType
)
{
return
this
.
outputType
.
indexOf
(
'
image/
'
)
===
0
;
}
else
{
return
false
;
}
}
}
}
}
};
//
};
//
...
@@ -316,6 +342,12 @@ exports.default = {
...
@@ -316,6 +342,12 @@ exports.default = {
//
//
//
//
//
//
//
//
//
//
//
//
/***/
}),
/***/
}),
/* 5 */
/* 5 */
...
@@ -1896,6 +1928,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
...
@@ -1896,6 +1928,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
attrs
:
{
attrs
:
{
"
type
"
:
"
output
"
,
"
type
"
:
"
output
"
,
"
raw-code
"
:
_vm
.
outputText
,
"
raw-code
"
:
_vm
.
outputText
,
"
output-type
"
:
_vm
.
outputType
,
"
count
"
:
_vm
.
output
.
execution_count
"
count
"
:
_vm
.
output
.
execution_count
}
}
})
:
_vm
.
_e
()],
1
)
})
:
_vm
.
_e
()],
1
)
...
@@ -1982,10 +2015,14 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
...
@@ -1982,10 +2015,14 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
"
type
"
:
_vm
.
promptType
,
"
type
"
:
_vm
.
promptType
,
"
count
"
:
_vm
.
count
"
count
"
:
_vm
.
count
}
}
}),
_vm
.
_v
(
"
"
),
_c
(
'
pre
'
,
{
}),
_vm
.
_v
(
"
"
),
(
!
_vm
.
isImage
)
?
_c
(
'
pre
'
,
{
domProps
:
{
domProps
:
{
"
innerHTML
"
:
_vm
.
_s
(
_vm
.
code
)
"
innerHTML
"
:
_vm
.
_s
(
_vm
.
code
)
}
}
},
[
_vm
.
_v
(
"
\n
"
)])
:
_c
(
'
img
'
,
{
attrs
:
{
"
src
"
:
'
data:
'
+
_vm
.
outputType
+
'
;base64,
'
+
_vm
.
rawCode
}
})],
1
)
})],
1
)
},
staticRenderFns
:
[]}
},
staticRenderFns
:
[]}
module
.
exports
.
render
.
_withStripped
=
true
module
.
exports
.
render
.
_withStripped
=
true
...
...
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