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
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 @@
...
@@ -24,7 +24,7 @@
line_list
=
s
.
toString
().
split
(
"
\n
"
);
line_list
=
s
.
toString
().
split
(
"
\n
"
);
for
(
i
=
0
;
i
<
line_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
line_list
.
length
;
i
+=
1
)
{
div
=
sideEffectDiv
(
"
side-effect-print
"
,
reportSideEffect
);
div
=
sideEffectDiv
(
"
side-effect-print
"
,
reportSideEffect
);
div
.
innerTex
t
=
line_list
[
i
];
div
.
textConten
t
=
line_list
[
i
];
}
}
},
},
element
:
function
(
nodeType
,
reportSideEffect
)
{
element
:
function
(
nodeType
,
reportSideEffect
)
{
...
@@ -409,14 +409,17 @@
...
@@ -409,14 +409,17 @@
function
loadPyodide
(
info
,
receiveInstance
)
{
function
loadPyodide
(
info
,
receiveInstance
)
{
var
queue
=
new
RSVP
.
Queue
();
var
queue
=
new
RSVP
.
Queue
();
queue
.
push
(
function
()
{
queue
.
push
(
function
()
{
return
WebAssembly
.
compileStreaming
(
fetch
(
"
pyodide.asm.wasm
"
));
return
ajax
({
url
:
"
pyodide.asm.wasm
"
,
dataType
:
"
arraybuffer
"
})
})
})
.
push
(
function
(
module
)
{
.
push
(
function
(
evt
)
{
return
WebAssembly
.
instantiate
(
module
,
info
);
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
;
return
queue
;
}
}
...
@@ -473,14 +476,19 @@
...
@@ -473,14 +476,19 @@
return
pyodideSetting
();
return
pyodideSetting
();
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
fetch
(
'
packages.json
'
);
return
ajax
({
url
:
'
packages.json
'
}
);
})
})
.
push
(
function
(
response
)
{
.
push
(
function
(
evt
)
{
return
response
.
json
(
);
return
JSON
.
parse
(
evt
.
target
.
response
);
})
})
.
push
(
function
(
json
)
{
.
push
(
function
(
json
)
{
window
.
pyodide
.
packages
=
json
;
window
.
pyodide
.
_module
=
Module
;
window
.
pyodide
.
loadedPackages
=
[];
window
.
pyodide
.
_module
.
packages
=
json
;
return
;
return
;
})
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
});
});
return
queue
;
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