aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/mist/ui_lib.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/mist/ui_lib.go')
-rw-r--r--cmd/mist/ui_lib.go27
1 files changed, 8 insertions, 19 deletions
diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go
index 90237d4cb..34ce56e77 100644
--- a/cmd/mist/ui_lib.go
+++ b/cmd/mist/ui_lib.go
@@ -21,7 +21,6 @@
package main
import (
- "fmt"
"io/ioutil"
"path"
@@ -29,7 +28,6 @@ import (
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/event/filter"
- "github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/xeth"
"github.com/obscuren/qml"
)
@@ -49,15 +47,19 @@ type UiLib struct {
// The main application window
win *qml.Window
- jsEngine *javascript.JSRE
-
filterCallbacks map[int][]int
filterManager *filter.FilterManager
}
-func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib {
+func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath, libPath string) *UiLib {
x := xeth.New(eth, nil)
- lib := &UiLib{XEth: x, engine: engine, eth: eth, assetPath: assetPath, jsEngine: javascript.NewJSRE(x), filterCallbacks: make(map[int][]int)} //, filters: make(map[int]*xeth.JSFilter)}
+ lib := &UiLib{
+ XEth: x,
+ engine: engine,
+ eth: eth,
+ assetPath: assetPath,
+ filterCallbacks: make(map[int][]int),
+ }
lib.filterManager = filter.NewFilterManager(eth.EventMux())
go lib.filterManager.Start()
@@ -76,19 +78,6 @@ func (self *UiLib) ImportTx(rlpTx string) {
}
}
-func (self *UiLib) EvalJavascriptFile(path string) {
- self.jsEngine.LoadExtFile(path[7:])
-}
-
-func (self *UiLib) EvalJavascriptString(str string) string {
- value, err := self.jsEngine.Run(str)
- if err != nil {
- return err.Error()
- }
-
- return fmt.Sprintf("%v", value)
-}
-
func (ui *UiLib) Muted(content string) {
component, err := ui.engine.LoadFile(ui.AssetPath("qml/muted.qml"))
if err != nil {