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
2b9a2bc7
Commit
2b9a2bc7
authored
Jun 01, 2016
by
Dave Hoover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Incorporating feedback from @chriseth
parent
712a3394
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
14 deletions
+14
-14
app.js
src/app.js
+2
-2
compiler.js
src/app/compiler.js
+2
-2
editor.js
src/app/editor.js
+5
-5
renderer.js
src/app/renderer.js
+5
-5
No files found.
src/app.js
View file @
2b9a2bc7
...
@@ -210,7 +210,7 @@ var run = function() {
...
@@ -210,7 +210,7 @@ var run = function() {
return
false
;
return
false
;
}
}
function
fileTabFromKey
()
{
function
activeFileTab
()
{
var
name
=
editor
.
getCacheFile
();
var
name
=
editor
.
getCacheFile
();
return
$
(
'#files .file'
).
filter
(
function
(){
return
$
(
this
).
find
(
'.name'
).
text
()
==
name
;
});
return
$
(
'#files .file'
).
filter
(
function
(){
return
$
(
this
).
find
(
'.name'
).
text
()
==
name
;
});
}
}
...
@@ -227,7 +227,7 @@ var run = function() {
...
@@ -227,7 +227,7 @@ var run = function() {
}
}
if
(
editor
.
cacheFileIsPresent
())
{
if
(
editor
.
cacheFileIsPresent
())
{
var
active
=
fileTabFromKey
();
var
active
=
activeFileTab
();
active
.
addClass
(
'active'
);
active
.
addClass
(
'active'
);
editor
.
resetSession
();
editor
.
resetSession
();
}
}
...
...
src/app/compiler.js
View file @
2b9a2bc7
...
@@ -21,7 +21,7 @@ function Compiler(web3, editor, handleGithubCall, outputField, hidingRHP, update
...
@@ -21,7 +21,7 @@ function Compiler(web3, editor, handleGithubCall, outputField, hidingRHP, update
function
onChange
()
{
function
onChange
()
{
var
input
=
editor
.
getValue
();
var
input
=
editor
.
getValue
();
if
(
input
===
""
)
{
if
(
input
===
""
)
{
window
.
localStorage
.
setItem
(
editor
.
getRawCacheFile
(),
''
);
editor
.
setCacheFileContent
(
''
);
return
;
return
;
}
}
if
(
input
===
previousInput
)
if
(
input
===
previousInput
)
...
@@ -38,7 +38,7 @@ function Compiler(web3, editor, handleGithubCall, outputField, hidingRHP, update
...
@@ -38,7 +38,7 @@ function Compiler(web3, editor, handleGithubCall, outputField, hidingRHP, update
sourceAnnotations
=
[];
sourceAnnotations
=
[];
outputField
.
empty
();
outputField
.
empty
();
var
input
=
editor
.
getValue
();
var
input
=
editor
.
getValue
();
window
.
localStorage
.
setItem
(
editor
.
getRawCacheFile
(),
input
);
editor
.
setCacheFileContent
(
input
)
var
files
=
{};
var
files
=
{};
files
[
editor
.
getCacheFile
()]
=
input
;
files
[
editor
.
getCacheFile
()]
=
input
;
...
...
src/app/editor.js
View file @
2b9a2bc7
...
@@ -11,15 +11,15 @@ function Editor(loadingFromGist) {
...
@@ -11,15 +11,15 @@ function Editor(loadingFromGist) {
untitledCount
=
(
untitledCount
-
0
)
+
1
;
untitledCount
=
(
untitledCount
-
0
)
+
1
;
SOL_CACHE_FILE
=
SOL_CACHE_UNTITLED
+
untitledCount
;
SOL_CACHE_FILE
=
SOL_CACHE_UNTITLED
+
untitledCount
;
sessions
[
SOL_CACHE_FILE
]
=
null
;
sessions
[
SOL_CACHE_FILE
]
=
null
;
window
.
localStorage
[
SOL_CACHE_FILE
]
=
''
;
this
.
setCacheFileContent
(
''
)
;
};
};
this
.
setCacheFile
=
function
(
cacheFile
)
{
this
.
setCacheFile
Content
=
function
(
content
)
{
SOL_CACHE_FILE
=
utils
.
fileKey
(
cacheFile
);
window
.
localStorage
.
setItem
(
SOL_CACHE_FILE
,
content
);
};
};
this
.
getRawCacheFile
=
function
(
)
{
this
.
setCacheFile
=
function
(
cacheFile
)
{
return
SOL_CACHE_FILE
;
SOL_CACHE_FILE
=
utils
.
fileKey
(
cacheFile
)
;
};
};
this
.
getCacheFile
=
function
()
{
this
.
getCacheFile
=
function
()
{
...
...
src/app/renderer.js
View file @
2b9a2bc7
...
@@ -83,8 +83,8 @@ function Renderer(web3, editor, compiler, updateFiles) {
...
@@ -83,8 +83,8 @@ function Renderer(web3, editor, compiler, updateFiles) {
};
};
this
.
error
=
renderError
;
this
.
error
=
renderError
;
var
combined
=
function
(
contractName
,
i
nterface
,
bytecode
){
var
combined
=
function
(
contractName
,
jsonI
nterface
,
bytecode
){
return
JSON
.
stringify
([{
name
:
contractName
,
interface
:
i
nterface
,
bytecode
:
bytecode
}]);
return
JSON
.
stringify
([{
name
:
contractName
,
interface
:
jsonI
nterface
,
bytecode
:
bytecode
}]);
};
};
function
renderContracts
(
data
,
source
)
{
function
renderContracts
(
data
,
source
)
{
...
@@ -224,15 +224,15 @@ function Renderer(web3, editor, compiler, updateFiles) {
...
@@ -224,15 +224,15 @@ function Renderer(web3, editor, compiler, updateFiles) {
return
text
;
return
text
;
};
};
function
gethDeploy
(
contractName
,
i
nterface
,
bytecode
){
function
gethDeploy
(
contractName
,
jsonI
nterface
,
bytecode
){
var
code
=
""
;
var
code
=
""
;
var
funABI
=
getConstructorInterface
(
JSON
.
parse
(
i
nterface
));
var
funABI
=
getConstructorInterface
(
JSON
.
parse
(
jsonI
nterface
));
funABI
.
inputs
.
forEach
(
function
(
inp
)
{
funABI
.
inputs
.
forEach
(
function
(
inp
)
{
code
+=
"var "
+
inp
.
name
+
" = /* var of type "
+
inp
.
type
+
" here */ ;
\
n"
;
code
+=
"var "
+
inp
.
name
+
" = /* var of type "
+
inp
.
type
+
" here */ ;
\
n"
;
});
});
code
+=
"var "
+
contractName
+
"Contract = web3.eth.contract("
+
i
nterface
.
replace
(
"
\
n"
,
""
)
+
");"
code
+=
"var "
+
contractName
+
"Contract = web3.eth.contract("
+
jsonI
nterface
.
replace
(
"
\
n"
,
""
)
+
");"
+
"
\
nvar "
+
contractName
+
" = "
+
contractName
+
"Contract.new("
;
+
"
\
nvar "
+
contractName
+
" = "
+
contractName
+
"Contract.new("
;
funABI
.
inputs
.
forEach
(
function
(
inp
)
{
funABI
.
inputs
.
forEach
(
function
(
inp
)
{
...
...
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