Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
922974c7
Commit
922974c7
authored
Apr 28, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added muted
parent
c0de1195
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
287 additions
and
173 deletions
+287
-173
debugger.html
ethereal/assets/muted/debugger.html
+1
-1
index.html
ethereal/assets/muted/index.html
+44
-2
muted.js
ethereal/assets/muted/muted.js
+61
-0
muted.qml
ethereal/assets/qml/muted.qml
+58
-49
webapp.qml
ethereal/assets/qml/webapp.qml
+119
-118
ui_lib.go
ethereal/ui/ui_lib.go
+2
-2
dev_console.go
ethereum/dev_console.go
+2
-1
No files found.
ethereal/assets/muted/debugger.html
View file @
922974c7
ethereal/assets/muted/index.html
View file @
922974c7
...
...
@@ -7,20 +7,63 @@
<script
src=
"lib/codemirror.js"
></script>
<script
src=
"lib/matchbrackets.js"
></script>
<script
src=
"lib/go.js"
></script>
<script
src=
"muted.js"
></script>
<style
type=
"text/css"
>
html
,
body
{
margin
:
0
;
padding
:
0
;
min-height
:
100%
;
}
#debugger
{
height
:
30%
;
font-family
:
"Monaco"
;
border-top
:
5px
solid
grey
;
}
#debugger
.line
{
overflow
:
none
;
}
#debugger
.col1
,
#debugger
.col2
{
float
:
left
;
padding
:
3px
;
}
#debugger
.col1
{
width
:
10px
;
padding-left
:
10px
-webkit-touch-callout
:
none
;
-webkit-user-select
:
none
;
-khtml-user-select
:
none
;
-moz-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
}
#debugger
.col2
{
width
:
90%
;
}
.prompt
{
color
:
"#5089D4"
;
}
.CodeMirror
{
height
:
100%
;
height
:
70%
;
font-size
:
14pt
;
}
</style>
</head>
<body>
<textarea
id=
"editor"
></textarea>
<div
id=
"debugger"
>
<div
class=
"line"
>
<div
class=
"col1 prompt"
>
>
</div>
<div
class=
"col2"
contenteditable
>
</div>
</div>
</div>
<script>
var
textArea
=
document
.
querySelector
(
"#editor"
)
var
editor
=
CodeMirror
.
fromTextArea
(
textArea
,
{
...
...
@@ -33,6 +76,5 @@
indentWithTabs
:
true
,
});
</script>
</body>
</html>
ethereal/assets/muted/muted.js
0 → 100644
View file @
922974c7
// Helper function for generating pseudo callbacks and sending data to the QML part of the application
function
postData
(
data
,
cb
)
{
data
.
_seed
=
Math
.
floor
(
Math
.
random
()
*
1000000
)
if
(
cb
)
{
Muted
.
_callbacks
[
data
.
_seed
]
=
cb
;
}
if
(
data
.
args
===
undefined
)
{
data
.
args
=
[];
}
navigator
.
qt
.
postMessage
(
JSON
.
stringify
(
data
));
}
window
.
Muted
=
{
prototype
:
Object
(),
}
window
.
Muted
.
_callbacks
=
{}
window
.
Muted
.
_onCallbacks
=
{}
function
debug
(
/**/
)
{
console
.
log
(
"hello world"
)
var
args
=
arguments
;
var
msg
=
""
for
(
var
i
=
0
;
i
<
args
.
length
;
i
++
){
if
(
typeof
args
[
i
]
==
"object"
)
{
msg
+=
" "
+
JSON
.
stringify
(
args
[
i
])
}
else
{
msg
+=
args
[
i
]
}
}
document
.
querySelector
(
"#debugger"
).
innerHTML
+=
"<div class='line'><div class='col1'></div><div class='col2'>"
+
msg
+
"</div></div>"
;
}
console
.
log
=
function
()
{
var
args
=
[]
for
(
var
i
=
0
;
i
<
arguments
.
length
;
i
++
)
{
args
.
push
(
arguments
[
i
]);
}
postData
({
call
:
"log"
,
args
:
args
})
}
navigator
.
qt
.
onmessage
=
function
(
ev
)
{
var
data
=
JSON
.
parse
(
ev
.
data
)
if
(
data
.
_event
!==
undefined
)
{
Muted
.
trigger
(
data
.
_event
,
data
.
data
);
}
else
{
if
(
data
.
_seed
)
{
var
cb
=
Muted
.
_callbacks
[
data
.
_seed
];
if
(
cb
)
{
// Call the callback
cb
(
data
.
data
);
// Remove the "trigger" callback
delete
Muted
.
_callbacks
[
ev
.
_seed
];
}
}
}
}
ethereal/assets/qml/muted.qml
View file @
922974c7
...
...
@@ -14,7 +14,6 @@ ApplicationWindow {
minimumHeight
:
300
property
alias
url
:
webView
.
url
property
alias
debugUrl
:
debugView
.
url
property
alias
webView
:
webView
...
...
@@ -28,10 +27,30 @@ ApplicationWindow {
top
:
root
.
top
right
:
root
.
right
left
:
root
.
left
bottom
:
sizeGrip
.
top
bottom
:
root
.
bottom
//bottom: sizeGrip.top
}
experimental.preferences.javascriptEnabled
:
true
experimental.preferences.navigatorQtObjectEnabled
:
true
experimental.onMessageReceived
:
{
var
data
=
JSON
.
parse
(
message
.
data
)
switch
(
data
.
call
)
{
case
"log"
:
console
.
log
.
apply
(
this
,
data
.
args
)
break
;
}
}
function
postData
(
seed
,
data
)
{
webview
.
experimental
.
postMessage
(
JSON
.
stringify
({
data
:
data
,
_seed
:
seed
}))
}
function
postEvent
(
event
,
data
)
{
webview
.
experimental
.
postMessage
(
JSON
.
stringify
({
data
:
data
,
_event
:
event
}))
}
}
/*
Rectangle {
id: sizeGrip
color: "gray"
...
...
@@ -50,16 +69,6 @@ ApplicationWindow {
drag.axis: Drag.YAxis
}
}
WebView
{
id
:
debugView
objectName
:
"debugView"
anchors
{
left
:
root
.
left
right
:
root
.
right
bottom
:
root
.
bottom
top
:
sizeGrip
.
bottom
}
}
*/
}
}
ethereal/assets/qml/webapp.qml
View file @
922974c7
...
...
@@ -78,6 +78,7 @@ ApplicationWindow {
if
(
data
.
args
.
length
>
0
)
{
eth
.
watch
(
data
.
args
[
0
]);
}
break
}
}
function
postData
(
seed
,
data
)
{
...
...
ethereal/ui/ui_lib.go
View file @
922974c7
...
...
@@ -120,8 +120,8 @@ func (ui *UiLib) Muted(content string) {
go
func
()
{
path
:=
"file://"
+
ui
.
AssetPath
(
"muted/index.html"
)
win
.
Set
(
"url"
,
path
)
debuggerPath
:=
"file://"
+
ui
.
AssetPath
(
"muted/debugger.html"
)
win
.
Set
(
"debugUrl"
,
debuggerPath
)
//
debuggerPath := "file://" + ui.AssetPath("muted/debugger.html")
//
win.Set("debugUrl", debuggerPath)
win
.
Show
()
win
.
Wait
()
...
...
ethereum/dev_console.go
View file @
922974c7
...
...
@@ -12,6 +12,7 @@ import (
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
"github.com/ethereum/go-ethereum/utils"
"github.com/obscuren/mutan"
"os"
"strings"
)
...
...
@@ -190,7 +191,7 @@ func (i *Console) ParseInput(input string) bool {
case
"contract"
:
fmt
.
Println
(
"Contract editor (Ctrl-D = done)"
)
mainInput
,
initInput
:=
ethutil
.
PreProcess
(
i
.
Editor
())
mainInput
,
initInput
:=
mutan
.
PreProcess
(
i
.
Editor
())
mainScript
,
err
:=
utils
.
Compile
(
mainInput
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
...
...
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