Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
139
Merge Requests
139
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
0f16aaa5
Commit
0f16aaa5
authored
Mar 28, 2019
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_notebook: Add a js file to init the pyodide webassembly module loading
Replace the original pyodide.js
parent
e84f99f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
5 deletions
+69
-5
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/custom_pyodide.js.js
...plateItem/portal_skins/erp5_notebook/custom_pyodide.js.js
+36
-0
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/custom_pyodide.js.xml
...lateItem/portal_skins/erp5_notebook/custom_pyodide.js.xml
+28
-0
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.html.html
...tem/portal_skins/erp5_notebook/gadget_jsmd_eval.html.html
+1
-1
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
...ateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
+4
-4
No files found.
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/custom_pyodide.js.js
0 → 100644
View file @
0f16aaa5
var
initPyodide
=
new
Promise
((
resolve
,
reject
)
=>
{
// Loading Pyodide
let
wasmURL
=
`pyodide.asm.wasm`
;
let
Module
=
{};
window
.
Module
=
Module
;
let
wasm_promise
=
WebAssembly
.
compileStreaming
(
fetch
(
wasmURL
));
Module
.
instantiateWasm
=
(
info
,
receiveInstance
)
=>
{
wasm_promise
.
then
(
module
=>
WebAssembly
.
instantiate
(
module
,
info
))
.
then
(
instance
=>
receiveInstance
(
instance
));
return
{};
};
var
postRunPromise
=
new
Promise
((
resolve
,
reject
)
=>
{
Module
.
postRun
=
()
=>
{
resolve
();
};
});
Promise
.
all
([
postRunPromise
,
]).
then
(()
=>
resolve
());
let
data_script
=
document
.
createElement
(
'
script
'
);
data_script
.
src
=
`pyodide.asm.data.js`
;
data_script
.
onload
=
(
event
)
=>
{
let
script
=
document
.
createElement
(
'
script
'
);
script
.
src
=
`pyodide.asm.js`
;
script
.
onload
=
()
=>
{
window
.
pyodide
=
pyodide
(
Module
);
};
document
.
head
.
appendChild
(
script
);
};
document
.
head
.
appendChild
(
data_script
);
});
initPyodide
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/custom_pyodide.js.xml
0 → 100644
View file @
0f16aaa5
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"File"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
custom_pyodide.js
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
application/javascript
</string>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.html.html
View file @
0f16aaa5
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"marked.js"
type=
"text/javascript"
></script>
<script
src=
"marked.js"
type=
"text/javascript"
></script>
<script
src=
"pyodide.js"
type=
"text/javascript"
></script>
<script
src=
"
custom_
pyodide.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_jsmd_eval.js"
type=
"text/javascript"
></script>
<script
src=
"gadget_jsmd_eval.js"
type=
"text/javascript"
></script>
</head>
</head>
...
...
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
View file @
0f16aaa5
/*global window, console, RSVP, document, URL, eval, XMLHttpRequest, marked, pyodide
hljs
*/
/*global window, console, RSVP, document, URL, eval, XMLHttpRequest, marked, pyodide */
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
languagePluginLoader
)
{
(
function
(
window
,
initPyodide
)
{
"
use strict
"
;
"
use strict
"
;
var
IODide
=
function
createIODide
()
{
var
IODide
=
function
createIODide
()
{
...
@@ -330,7 +330,7 @@
...
@@ -330,7 +330,7 @@
queue
=
new
RSVP
.
Queue
();
queue
=
new
RSVP
.
Queue
();
queue
.
push
(
function
()
{
queue
.
push
(
function
()
{
return
languagePluginLoader
;
return
initPyodide
;
});
});
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
queue
.
push
(
deferCellExecution
(
cell_list
[
i
]));
queue
.
push
(
deferCellExecution
(
cell_list
[
i
]));
...
@@ -352,4 +352,4 @@
...
@@ -352,4 +352,4 @@
},
false
);
},
false
);
}(
window
,
languagePluginLoader
));
}(
window
,
initPyodide
));
\ No newline at end of file
\ No newline at end of file
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