Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
095974e6
Commit
095974e6
authored
Jun 09, 2016
by
Denton Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make uploadFile have a callback
This should fix #80.
parent
76aa0228
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
app.js
src/app.js
+2
-1
editor.js
src/app/editor.js
+2
-1
No files found.
src/app.js
View file @
095974e6
...
...
@@ -163,8 +163,9 @@ var run = function () {
for
(
var
i
=
0
;
i
<
fileList
.
length
;
i
++
)
{
var
name
=
fileList
[
i
].
name
;
if
(
!
window
.
localStorage
[
utils
.
fileKey
(
name
)]
||
confirm
(
'The file '
+
name
+
' already exists! Would you like to overwrite it?'
))
{
editor
.
uploadFile
(
fileList
[
i
]
);
editor
.
uploadFile
(
fileList
[
i
]
,
function
()
{
updateFiles
();
});
}
}
...
...
src/app/editor.js
View file @
095974e6
...
...
@@ -16,13 +16,14 @@ function Editor (loadingFromGist) {
this
.
setCacheFileContent
(
''
);
};
this
.
uploadFile
=
function
(
file
)
{
this
.
uploadFile
=
function
(
file
,
callback
)
{
var
fileReader
=
new
FileReader
();
SOL_CACHE_FILE
=
utils
.
fileKey
(
file
.
name
);
fileReader
.
onload
=
function
(
e
)
{
window
.
localStorage
[
SOL_CACHE_FILE
]
=
e
.
target
.
result
;
sessions
[
SOL_CACHE_FILE
]
=
null
;
callback
();
};
fileReader
.
readAsText
(
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