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
49caabde
Commit
49caabde
authored
Jun 09, 2016
by
chriseth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #85 from Denton-L/upload-fix
Fix all problems with the upload button
parents
76aa0228
93f003ac
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
index.html
index.html
+1
-1
app.js
src/app.js
+2
-1
editor.js
src/app/editor.js
+2
-1
No files found.
index.html
View file @
49caabde
...
...
@@ -45,7 +45,7 @@
<div
id=
"editor"
>
<span
class=
"newFile"
title=
"New File"
><i
class=
"fa fa-file-code-o"
></i></span>
<span
class=
"uploadFile"
title=
"Upload"
><label
class=
"fa fa-upload"
><input
type=
"file"
class=
"inputFile"
multiple
/></label
</span
>
<span
class=
"uploadFile"
title=
"Upload"
><label
class=
"fa fa-upload"
><input
type=
"file"
class=
"inputFile"
multiple
/></label
>
</span>
<div
class=
"files-wrapper"
>
<div
class=
"scroller scroller-left"
><i
class=
"fa fa-chevron-left "
></i></div>
<div
class=
"scroller scroller-right"
><i
class=
"fa fa-chevron-right "
></i></div>
...
...
src/app.js
View file @
49caabde
...
...
@@ -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 @
49caabde
...
...
@@ -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