Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hamza
erp5-Boxiang
Commits
b6a606af
Commit
b6a606af
authored
Mar 27, 2019
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_notebook: Only render the result of Python code
Not render original Python and JS source code anymore
parent
9beecd84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
25 deletions
+7
-25
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
...ateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
+7
-25
No files found.
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
View file @
b6a606af
...
@@ -107,7 +107,6 @@
...
@@ -107,7 +107,6 @@
pre
,
pre
,
br
,
br
,
code
;
code
;
renderCodeblock
(
line_list
.
join
(
'
\n
'
),
'
undefined
'
,
'
js
'
);
try
{
try
{
return
eval
.
call
(
window
,
text
);
return
eval
.
call
(
window
,
text
);
...
@@ -263,52 +262,35 @@
...
@@ -263,52 +262,35 @@
}
catch
(
e
)
{
}
catch
(
e
)
{
result_text
=
e
.
message
;
result_text
=
e
.
message
;
}
}
console
.
log
(
"
Result test:
"
);
console
.
log
(
result_text
);
console
.
log
(
"
=================
"
);
if
(
typeof
(
result_text
)
===
'
undefined
'
)
{
if
(
typeof
(
result_text
)
===
'
undefined
'
)
{
result_text
=
'
undefined
'
;
result_text
=
'
undefined
'
;
}
}
renderCodeblock
(
code_text
,
result_text
,
'
python
'
);
renderCodeblock
(
result_text
,
'
python
'
);
resolve
();
resolve
();
});
});
}
}
function
renderCodeblock
(
code_text
,
result_text
,
language
)
{
function
renderCodeblock
(
result_text
,
language
)
{
var
div
=
document
.
createElement
(
'
div
'
),
var
div
=
document
.
createElement
(
'
div
'
),
pre0
=
document
.
createElement
(
'
pre
'
),
pre
=
document
.
createElement
(
'
pre
'
),
p
=
document
.
createElement
(
'
p
'
),
pre1
=
document
.
createElement
(
'
pre
'
),
pre2
=
document
.
createElement
(
'
pre
'
),
code
=
document
.
createElement
(
'
code
'
),
result
=
document
.
createElement
(
'
code
'
);
result
=
document
.
createElement
(
'
code
'
);
div
.
style
.
border
=
'
1px solid #C3CCD0
'
;
div
.
style
.
border
=
'
1px solid #C3CCD0
'
;
div
.
style
.
margin
=
'
40px 10px
'
;
div
.
style
.
margin
=
'
40px 10px
'
;
code
.
style
.
border
=
'
1px solid #C3CCD0
'
;
code
.
classList
.
add
(
language
);
code
.
classList
.
add
(
'
hljs
'
);
result
.
classList
.
add
(
'
shell
'
);
result
.
classList
.
add
(
'
shell
'
);
result
.
classList
.
add
(
'
hljs
'
);
result
.
classList
.
add
(
'
hljs
'
);
code
.
innerHTML
=
code_text
;
hljs
.
highlightBlock
(
code
);
hljs
.
highlightBlock
(
result
);
hljs
.
highlightBlock
(
result
);
p
.
innerHTML
=
language
;
p
.
style
.
marginLeft
=
'
10px
'
;
pre0
.
appendChild
(
p
);
pre1
.
appendChild
(
code
);
div
.
appendChild
(
pre0
);
div
.
appendChild
(
pre1
);
if
(
result_text
!==
'
undefined
'
)
{
if
(
result_text
!==
'
undefined
'
)
{
result
.
innerHTML
=
result_text
;
result
.
innerHTML
=
result_text
;
pre
2
.
appendChild
(
result
);
pre
.
appendChild
(
result
);
div
.
appendChild
(
pre
2
);
div
.
appendChild
(
pre
);
}
}
document
.
body
.
appendChild
(
div
);
document
.
body
.
appendChild
(
div
);
}
}
function
executeCell
(
cell
)
{
function
executeCell
(
cell
)
{
if
(
cell
.
_type
===
'
raw
'
)
{
if
(
cell
.
_type
===
'
raw
'
)
{
// Do nothing...
// Do nothing...
...
...
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