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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Boxiang Sun
erp5
Commits
a89142d7
Commit
a89142d7
authored
May 21, 2019
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_notebook: Use ajax replace fetch function when importing wasm
parent
bdbc5864
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
...ateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
+19
-11
No files found.
bt5/erp5_notebook/SkinTemplateItem/portal_skins/erp5_notebook/gadget_jsmd_eval.js.js
View file @
a89142d7
...
...
@@ -24,7 +24,7 @@
line_list
=
s
.
toString
().
split
(
"
\n
"
);
for
(
i
=
0
;
i
<
line_list
.
length
;
i
+=
1
)
{
div
=
sideEffectDiv
(
"
side-effect-print
"
,
reportSideEffect
);
div
.
innerTex
t
=
line_list
[
i
];
div
.
textConten
t
=
line_list
[
i
];
}
},
element
:
function
(
nodeType
,
reportSideEffect
)
{
...
...
@@ -409,14 +409,17 @@
function
loadPyodide
(
info
,
receiveInstance
)
{
var
queue
=
new
RSVP
.
Queue
();
queue
.
push
(
function
()
{
return
WebAssembly
.
compileStreaming
(
fetch
(
"
pyodide.asm.wasm
"
));
return
ajax
({
url
:
"
pyodide.asm.wasm
"
,
dataType
:
"
arraybuffer
"
})
})
.
push
(
function
(
module
)
{
return
WebAssembly
.
instantiate
(
module
,
info
);
.
push
(
function
(
evt
)
{
return
WebAssembly
.
instantiate
(
evt
.
target
.
response
,
info
);
})
.
push
(
function
(
results
)
{
return
receiveInstance
(
results
.
instance
);
})
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
})
.
push
(
function
(
instance
)
{
return
receiveInstance
(
instance
);
});
return
queue
;
}
...
...
@@ -473,14 +476,19 @@
return
pyodideSetting
();
})
.
push
(
function
()
{
return
fetch
(
'
packages.json
'
);
return
ajax
({
url
:
'
packages.json
'
}
);
})
.
push
(
function
(
response
)
{
return
response
.
json
(
);
.
push
(
function
(
evt
)
{
return
JSON
.
parse
(
evt
.
target
.
response
);
})
.
push
(
function
(
json
)
{
window
.
pyodide
.
packages
=
json
;
window
.
pyodide
.
_module
=
Module
;
window
.
pyodide
.
loadedPackages
=
[];
window
.
pyodide
.
_module
.
packages
=
json
;
return
;
})
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
});
return
queue
;
}
...
...
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