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
c3e71688
Commit
c3e71688
authored
Sep 07, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move editor.onChange from compiler to app
parent
3cea49f6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
23 deletions
+22
-23
app.js
src/app.js
+22
-0
compiler.js
src/app/compiler.js
+0
-23
No files found.
src/app.js
View file @
c3e71688
...
@@ -436,6 +436,27 @@ var run = function () {
...
@@ -436,6 +436,27 @@ var run = function () {
var
renderer
=
new
Renderer
(
editor
,
executionContext
.
web3
(),
updateFiles
,
udapp
,
executionContext
,
formalVerification
.
event
,
compiler
.
event
);
// eslint-disable-line
var
renderer
=
new
Renderer
(
editor
,
executionContext
.
web3
(),
updateFiles
,
udapp
,
executionContext
,
formalVerification
.
event
,
compiler
.
event
);
// eslint-disable-line
var
previousInput
=
''
;
var
compileTimeout
=
null
;
function
editorOnChange
()
{
var
input
=
editor
.
getValue
();
if
(
input
===
''
)
{
editor
.
setCacheFileContent
(
''
);
return
;
}
if
(
input
===
previousInput
)
{
return
;
}
previousInput
=
input
;
if
(
compileTimeout
)
{
window
.
clearTimeout
(
compileTimeout
);
}
compileTimeout
=
window
.
setTimeout
(
compiler
.
compile
,
300
);
}
editor
.
onChangeSetup
(
editorOnChange
);
$
(
'#compile'
).
click
(
function
()
{
$
(
'#compile'
).
click
(
function
()
{
compiler
.
compile
();
compiler
.
compile
();
});
});
...
@@ -453,6 +474,7 @@ var run = function () {
...
@@ -453,6 +474,7 @@ var run = function () {
});
});
compiler
.
event
.
register
(
'compilerLoaded'
,
this
,
function
(
version
)
{
compiler
.
event
.
register
(
'compilerLoaded'
,
this
,
function
(
version
)
{
previousInput
=
''
;
setVersionText
(
version
);
setVersionText
(
version
);
compiler
.
compile
();
compiler
.
compile
();
initWithQueryParams
();
initWithQueryParams
();
...
...
src/app/compiler.js
View file @
c3e71688
...
@@ -17,31 +17,9 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
...
@@ -17,31 +17,9 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
var
compileJSON
;
var
compileJSON
;
var
compilerAcceptsMultipleFiles
;
var
compilerAcceptsMultipleFiles
;
var
previousInput
=
''
;
var
cachedRemoteFiles
=
{};
var
cachedRemoteFiles
=
{};
var
worker
=
null
;
var
worker
=
null
;
var
compileTimeout
=
null
;
function
onChange
()
{
var
input
=
editor
.
getValue
();
if
(
input
===
''
)
{
editor
.
setCacheFileContent
(
''
);
return
;
}
if
(
input
===
previousInput
)
{
return
;
}
previousInput
=
input
;
if
(
compileTimeout
)
{
window
.
clearTimeout
(
compileTimeout
);
}
compileTimeout
=
window
.
setTimeout
(
compile
,
300
);
}
editor
.
onChangeSetup
(
onChange
);
var
compile
=
function
(
missingInputs
)
{
var
compile
=
function
(
missingInputs
)
{
editor
.
clearAnnotations
();
editor
.
clearAnnotations
();
self
.
event
.
trigger
(
'compilationStarted'
,
[]);
self
.
event
.
trigger
(
'compilationStarted'
,
[]);
...
@@ -67,7 +45,6 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
...
@@ -67,7 +45,6 @@ function Compiler (editor, queryParams, handleGithubCall, updateFiles) {
this
.
setCompileJSON
=
setCompileJSON
;
// this is exposed for testing
this
.
setCompileJSON
=
setCompileJSON
;
// this is exposed for testing
function
onCompilerLoaded
(
version
)
{
function
onCompilerLoaded
(
version
)
{
previousInput
=
''
;
self
.
event
.
trigger
(
'compilerLoaded'
,
[
version
]);
self
.
event
.
trigger
(
'compilerLoaded'
,
[
version
]);
}
}
...
...
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