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
9fbfcf02
Commit
9fbfcf02
authored
Apr 22, 2015
by
chriseth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move to json compilation.
parent
1d3e62c3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
9 deletions
+45
-9
index.html
index.html
+44
-8
jquery-2.1.3.min.js
libs/jquery-2.1.3.min.js
+0
-0
styles.css
stylesheets/styles.css
+1
-1
No files found.
index.html
View file @
9fbfcf02
...
@@ -34,23 +34,32 @@ body {
...
@@ -34,23 +34,32 @@ body {
right
:
10px
;
right
:
10px
;
bottom
:
0px
;
bottom
:
0px
;
font-size
:
14px
;
font-size
:
14px
;
overflow
:
auto
;
}
}
#header
{
#header
{
margin-bottom
:
4px
;
margin-bottom
:
4px
;
}
}
.col1
{
width
:
18ex
;
display
:
inline-block
;
}
.col2
{
width
:
60ex
;
}
</style>
</style>
<script
src=
"libs/jquery-2.1.3.min.js"
></script>
<script
src=
"libs/ace.js"
></script>
<script
src=
"libs/ace.js"
></script>
<script
src=
"mode-solidity.js"
></script>
<script
src=
"mode-solidity.js"
></script>
<script
src=
"soljs.js"
></script>
<script
src=
"soljs
on
.js"
></script>
</head>
</head>
<body>
<body>
<h1
id=
"header"
>
Solidity realtime compiler
</h1>
<h1
id=
"header"
>
Solidity realtime compiler
</h1>
Source code on the left, compiled code and AST on the right (or error).
<br/>
Source code on the left, compiled code and AST on the right (or error).
<br/>
<b>
Note:
</b>
Chrome/Chromium currently reports
"
Uncaught JavaScript Exception
"
.
<b>
Note:
</b>
Chrome/Chromium currently reports
"
Uncaught JavaScript Exception
"
.
To work around this problem, enable the debug console (Ctrl+Shift+i) and reload.
<br/>
To work around this problem, enable the debug console (Ctrl+Shift+i) and reload.
<br/>
Version:
<a
href=
"https://github.com/ethereum/cpp-ethereum/commit/
bb30afcbe8d168e8bd7ebf99bd3256376470c36e"
>
bb30afcbe8...
</a>
2015-04-17
Version:
<a
href=
"https://github.com/ethereum/cpp-ethereum/commit/
2329a5af24e78c90c161dab553f6cf78f04ddea2"
>
2329a5af...
</a>
2015-04-22
<div
id=
"optimizeBox"
>
<div
id=
"optimizeBox"
>
<input
id=
"optimize"
type=
"checkbox"
checked=
"checked"
><label
for=
"optimize"
>
optimize
</label>
<input
id=
"optimize"
type=
"checkbox"
><label
for=
"optimize"
>
optimize
</label>
</div>
</div>
<div
id=
"input"
>
contract Ballot {
<div
id=
"input"
>
contract Ballot {
// Create a new ballot with $(_numProposals) different proposals.
// Create a new ballot with $(_numProposals) different proposals.
...
@@ -110,7 +119,7 @@ Version: <a href="https://github.com/ethereum/cpp-ethereum/commit/bb30afcbe8d168
...
@@ -110,7 +119,7 @@ Version: <a href="https://github.com/ethereum/cpp-ethereum/commit/bb30afcbe8d168
mapping(uint8 => uint256) voteCounts;
mapping(uint8 => uint256) voteCounts;
}
}
</div>
</div>
<
pre
id=
"output"
></pre
>
<
div
id=
"output"
></div
>
<div
style=
"height: 100px;"
></div>
<div
style=
"height: 100px;"
></div>
<p><small>
Theme by
<a
href=
"https://github.com/orderedlist"
>
orderedlist
</a></small></p>
<p><small>
Theme by
<a
href=
"https://github.com/orderedlist"
>
orderedlist
</a></small></p>
...
@@ -122,22 +131,26 @@ editor.getSession().setMode("ace/mode/javascript");
...
@@ -122,22 +131,26 @@ editor.getSession().setMode("ace/mode/javascript");
editor
.
getSession
().
setTabSize
(
4
);
editor
.
getSession
().
setTabSize
(
4
);
editor
.
getSession
().
setUseSoftTabs
(
true
);
editor
.
getSession
().
setUseSoftTabs
(
true
);
var
compile
String
=
Module
.
cwrap
(
"compileString
"
,
"string"
,
[
"string"
,
"number"
]);
var
compile
JSON
=
Module
.
cwrap
(
"compileJSON
"
,
"string"
,
[
"string"
,
"number"
]);
var
ready
=
false
;
var
ready
=
false
;
Module
[
'onRuntimeInitialized'
]
=
function
()
{
ready
=
true
;
onChange
();
};
Module
[
'onRuntimeInitialized'
]
=
function
()
{
ready
=
true
;
onChange
();
};
var
previousInput
=
''
;
var
previousInput
=
''
;
var
outputArea
=
document
.
querySelector
(
'#output'
);
var
compile
=
function
()
{
var
compile
=
function
()
{
if
(
!
ready
)
if
(
!
ready
)
return
;
return
;
var
input
=
editor
.
getValue
();
var
input
=
editor
.
getValue
();
var
optimize
=
document
.
querySelector
(
'#optimize'
).
checked
;
var
optimize
=
document
.
querySelector
(
'#optimize'
).
checked
;
try
{
try
{
outputArea
.
innerHTML
=
compileString
(
input
,
optimize
?
1
:
0
);
var
data
=
$
.
parseJSON
(
compileJSON
(
input
,
optimize
?
1
:
0
)
);
}
catch
(
exception
)
{
}
catch
(
exception
)
{
outputArea
.
innerHTML
=
"Uncaught JavaScript Exception:
\
n"
+
exception
;
renderError
(
"Uncaught JavaScript Exception:
\
n"
+
exception
);
return
;
}
}
if
(
data
[
'error'
]
!==
undefined
)
renderError
(
data
[
'error'
]);
else
renderContracts
(
data
);
}
}
var
compileTimeout
=
null
;
var
compileTimeout
=
null
;
var
onChange
=
function
()
{
var
onChange
=
function
()
{
...
@@ -153,6 +166,29 @@ var onChange = function() {
...
@@ -153,6 +166,29 @@ var onChange = function() {
editor
.
getSession
().
on
(
'change'
,
onChange
);
editor
.
getSession
().
on
(
'change'
,
onChange
);
document
.
querySelector
(
'#optimize'
).
addEventListener
(
'change'
,
compile
);
document
.
querySelector
(
'#optimize'
).
addEventListener
(
'change'
,
compile
);
var
renderError
=
function
(
message
)
{
$
(
'#output'
).
empty
().
append
(
$
(
'<pre></pre>'
).
text
(
message
));
};
var
renderContracts
=
function
(
data
)
{
$
(
'#output'
).
empty
();
for
(
var
contractName
in
data
.
contracts
)
{
var
contract
=
data
.
contracts
[
contractName
];
var
contractOutput
=
$
(
'<div class="contractOutput"/>'
)
.
append
(
$
(
'<h3/>'
).
text
(
contractName
))
.
append
(
$
(
'<div/>'
).
text
((
contract
.
bytecode
.
length
/
2
)
+
' bytes'
))
.
append
(
tableRow
(
'Bytecode'
,
contract
.
bytecode
))
.
append
(
tableRow
(
'Interface'
,
contract
[
'interface'
]))
.
append
(
tableRow
(
'Solidity Interface'
,
contract
.
solidity_interface
))
.
append
(
tableRow
(
'Opcodes'
,
contract
.
opcodes
));
$
(
'#output'
).
append
(
contractOutput
);
}
};
var
tableRow
=
function
(
description
,
data
)
{
return
$
(
'<div/>'
)
.
append
(
$
(
'<span class="col1">'
).
text
(
description
))
.
append
(
$
(
'<input readonly="readonly" class="col2">'
).
val
(
data
));
};
</script>
</script>
</body>
</body>
</html>
</html>
libs/jquery-2.1.3.min.js
0 → 100644
View file @
9fbfcf02
This diff is collapsed.
Click to expand it.
stylesheets/styles.css
View file @
9fbfcf02
...
@@ -9,7 +9,7 @@ body {
...
@@ -9,7 +9,7 @@ body {
h1
,
h2
,
h3
,
h4
,
h5
,
h6
{
h1
,
h2
,
h3
,
h4
,
h5
,
h6
{
color
:
#222
;
color
:
#222
;
margin
:
0
0
2
0px
;
margin
:
20px
0
1
0px
;
}
}
p
,
ul
,
ol
,
table
,
pre
,
dl
{
p
,
ul
,
ol
,
table
,
pre
,
dl
{
...
...
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