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
dccf58af
Commit
dccf58af
authored
Sep 28, 2015
by
chriseth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13 from chriseth/versionSelector
Provide a way to select and switch the compiler version.
parents
be1fc35b
e3852b33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
+33
-7
index.html
index.html
+33
-7
No files found.
index.html
View file @
dccf58af
<html>
<head>
<meta
charset=
"utf-8"
>
<!--
The MIT License (MIT)
...
...
@@ -24,8 +26,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"chrome=1"
>
<title>
Solidity realtime compiler and runtime
</title>
<link
rel=
"stylesheet"
href=
"stylesheets/styles.css"
>
...
...
@@ -262,6 +262,7 @@ input[readonly] {
<h1>
Solidity realtime
<br/>
compiler and runtime
</h1>
<div
class=
"info"
>
<p>
Version:
<span
id=
"version"
>
(loading)
</span><br/>
Change to:
<select
id=
"versionSelector"
></select><br/>
Execution environment does not connect to any node, everyhing is local and in memory only.
<br/>
<code>
tx.origin =
<span
id=
"txorigin"
/></code></p>
</div>
...
...
@@ -278,9 +279,6 @@ input[readonly] {
<script>
// ----------------- editor ----------------------
var
SOL_CACHE_KEY
=
"sol-cache"
;
...
...
@@ -297,6 +295,27 @@ input[readonly] {
session
.
setTabSize
(
4
);
session
.
setUseSoftTabs
(
true
);
// ----------------- version selector-------------
$
.
get
(
'bin/list.txt'
).
then
(
function
(
versionList
)
{
$
(
'option'
,
'#versionSelector'
).
remove
();
$
.
each
(
versionList
.
split
(
'
\
n'
),
function
(
i
,
file
)
{
if
(
file
)
{
var
version
=
file
.
replace
(
/soljson-
(
.*
)
.js/
,
"$1"
);
$
(
'#versionSelector'
).
append
(
new
Option
(
version
,
file
));
}
});
$
(
'#versionSelector'
).
change
(
function
()
{
Module
=
null
;
compileJSON
=
null
;
var
script
=
document
.
createElement
(
'script'
);
script
.
type
=
'text/javascript'
;
script
.
src
=
'bin/'
+
$
(
'#versionSelector'
).
val
();
$
(
'head'
).
append
(
script
);
onCompilerLoaded
();
});
});
// ----------------- resizeable ui ---------------
var
EDITOR_SIZE_CACHE_KEY
=
"editor-size-cache"
;
...
...
@@ -362,8 +381,7 @@ input[readonly] {
// ----------------- compiler ----------------------
var
compileJSON
=
Module
.
cwrap
(
"compileJSON"
,
"string"
,
[
"string"
,
"number"
]);
$
(
'#version'
).
text
(
Module
.
cwrap
(
"version"
,
"string"
,
[])());
var
compileJSON
;
var
previousInput
=
''
;
var
compile
=
function
()
{
...
...
@@ -396,7 +414,15 @@ input[readonly] {
if
(
compileTimeout
)
window
.
clearTimeout
(
compileTimeout
);
compileTimeout
=
window
.
setTimeout
(
compile
,
300
);
};
var
onCompilerLoaded
=
function
()
{
compileJSON
=
Module
.
cwrap
(
"compileJSON"
,
"string"
,
[
"string"
,
"number"
]);
$
(
'#version'
).
text
(
Module
.
cwrap
(
"version"
,
"string"
,
[])());
previousInput
=
''
;
onChange
();
};
if
(
Module
)
onCompilerLoaded
();
editor
.
getSession
().
on
(
'change'
,
onChange
);
...
...
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