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
a247dd00
Commit
a247dd00
authored
Nov 02, 2016
by
yann300
Committed by
GitHub
Nov 02, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #292 from ethereum/periodic-save
Save file contents periodically
parents
ec1ab032
a9da67aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
app.js
src/app.js
+22
-4
compiler.js
src/app/compiler.js
+2
-4
No files found.
src/app.js
View file @
a247dd00
...
...
@@ -452,18 +452,32 @@ var run = function () {
var
previousInput
=
''
var
compileTimeout
=
null
var
saveTimeout
=
null
function
editorOnChange
()
{
var
input
=
editor
.
getValue
()
if
(
input
===
''
)
{
editor
.
setCacheFileContent
(
''
)
return
}
// if there's no change, don't do anything
if
(
input
===
previousInput
)
{
return
}
previousInput
=
input
// fire storage update
// NOTE: save at most once per 5 seconds
if
(
saveTimeout
)
{
window
.
clearTimeout
(
saveTimeout
)
}
saveTimeout
=
window
.
setTimeout
(
function
()
{
var
input
=
editor
.
getValue
()
editor
.
setCacheFileContent
(
input
)
},
5000
)
// special case: there's nothing else to do
if
(
input
===
''
)
{
return
}
if
(
!
autoCompile
)
{
return
}
...
...
@@ -508,6 +522,10 @@ var run = function () {
}
})
compiler
.
event
.
register
(
'compilationStarted'
,
this
,
function
()
{
editor
.
clearAnnotations
()
})
function
startdebugging
(
txHash
)
{
transactionDebugger
.
debug
(
txHash
)
selectTab
(
$
(
'ul#options li.debugView'
))
...
...
src/app/compiler.js
View file @
a247dd00
...
...
@@ -37,15 +37,13 @@ function Compiler (editor, handleGithubCall) {
})
}
var
compile
=
function
(
missingInputs
)
{
editor
.
clearAnnotations
()
var
compile
=
function
()
{
self
.
event
.
trigger
(
'compilationStarted'
,
[])
var
input
=
editor
.
getValue
()
editor
.
setCacheFileContent
(
input
)
var
files
=
{}
files
[
utils
.
fileNameFromKey
(
editor
.
getCacheFile
())]
=
input
internalCompile
(
files
,
missingInputs
)
internalCompile
(
files
)
}
this
.
compile
=
compile
...
...
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