Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gunjan Yadu
purr-data
Commits
86da0340
Commit
86da0340
authored
Aug 29, 2020
by
Zack Lee
Browse files
change the files auto-refresh rate to 200ms and change Module.FS to FS
parent
e59fe676
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/nw/pdgui.js
View file @
86da0340
...
...
@@ -2040,7 +2040,7 @@ function upload_patch(files) {
var
reader
=
new
FileReader
();
reader
.
onload
=
function
()
{
var
data
=
new
Uint8Array
(
reader
.
result
);
Module
.
FS
.
createDataFile
(
workspace
,
file
.
name
,
data
,
true
,
true
,
true
);
FS
.
createDataFile
(
workspace
,
file
.
name
,
data
,
true
,
true
,
true
);
};
reader
.
readAsArrayBuffer
(
file
);
}
...
...
@@ -2048,7 +2048,7 @@ function upload_patch(files) {
// Refresh file list after upload file
setTimeout
(
function
(){
update_file_ls
();
},
200
0
);
},
200
);
}
...
...
@@ -2072,14 +2072,14 @@ function download_patch(file_name) {
if
(
file_name
===
""
)
return
;
var
found
=
false
;
for
(
const
file
of
Module
.
FS
.
readdir
(
workspace
)){
for
(
const
file
of
FS
.
readdir
(
workspace
)){
if
(
file_name
==
file
)
{
found
=
true
;
}
}
if
(
found
){
var
content
=
Module
.
FS
.
readFile
(
workspace
+
file_name
);
var
content
=
FS
.
readFile
(
workspace
+
file_name
);
var
a
=
document
.
createElement
(
'
a
'
);
a
.
download
=
file_name
;
var
blob
=
new
Blob
(
...
...
@@ -2109,9 +2109,9 @@ function update_file_ls(){
file_ls
.
innerHTML
=
""
;
var
files_added
=
0
;
for
(
const
file
of
Module
.
FS
.
readdir
(
workspace
)){
var
mode
=
Module
.
FS
.
stat
(
workspace
+
file
).
mode
;
if
(
Module
.
FS
.
isFile
(
mode
)){
for
(
const
file
of
FS
.
readdir
(
workspace
)){
var
mode
=
FS
.
stat
(
workspace
+
file
).
mode
;
if
(
FS
.
isFile
(
mode
)){
var
li
=
window
.
document
.
createElement
(
"
li
"
);
var
a
=
window
.
document
.
createElement
(
"
a
"
);
// Add name 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