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
bf37ed8e
Commit
bf37ed8e
authored
Apr 05, 2019
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_notebook: Add iodide.output
parent
26929ed6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
...ateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
+34
-2
No files found.
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
View file @
bf37ed8e
...
...
@@ -2,9 +2,41 @@
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
)
{
"
use strict
"
;
function
sideEffectDiv
(
sideEffectClass
,
reportSideEffect
)
{
// appends a side effect div to the side effect area
var
div
=
document
.
createElement
(
"
div
"
);
div
.
setAttribute
(
"
class
"
,
sideEffectClass
);
if
(
reportSideEffect
===
false
)
{
div
.
setAttribute
(
"
style
"
,
"
display:
"
);
}
document
.
body
.
appendChild
(
div
);
return
div
;
}
var
IODide
=
function
createIODide
()
{
return
;
var
iodide
=
{
addOutputHandler
:
function
(
renderer
)
{
// TODO: seems this function was deprecated...
},
output
:
{
text
:
(
s
,
reportSideEffect
=
false
)
=>
{
console
.
log
(
"
Inside output.text
"
);
console
.
log
(
s
);
for
(
const
line
of
s
.
toString
().
split
(
"
\n
"
))
{
const
div
=
sideEffectDiv
(
"
side-effect-print
"
,
reportSideEffect
);
div
.
innerText
=
line
;
}
},
element
:
(
nodeType
,
reportSideEffect
=
true
)
=>
{
console
.
log
(
"
Inside output.element
"
);
const
div
=
sideEffectDiv
(
"
side-effect-element
"
,
reportSideEffect
);
const
node
=
document
.
createElement
(
nodeType
);
div
.
append
(
node
);
console
.
log
(
node
);
return
node
;
}
}
};
return
iodide
;
},
JSMDCell
=
function
createJSMDCell
(
type
,
line_list
)
{
this
.
_type
=
type
;
...
...
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