diff options
author | zelig <viktor.tron@gmail.com> | 2015-03-15 14:18:58 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-03-15 14:18:58 +0800 |
commit | 31ffca6d8a777c164776642368034d84984c1f4c (patch) | |
tree | fd2b76b0d810cc04e4d19ab046ccecf999e5926d /cmd/mist/ui_lib.go | |
parent | da44097800caf2e20ec8e067f8700e59a43a5e06 (diff) | |
download | dexon-31ffca6d8a777c164776642368034d84984c1f4c.tar dexon-31ffca6d8a777c164776642368034d84984c1f4c.tar.gz dexon-31ffca6d8a777c164776642368034d84984c1f4c.tar.bz2 dexon-31ffca6d8a777c164776642368034d84984c1f4c.tar.lz dexon-31ffca6d8a777c164776642368034d84984c1f4c.tar.xz dexon-31ffca6d8a777c164776642368034d84984c1f4c.tar.zst dexon-31ffca6d8a777c164776642368034d84984c1f4c.zip |
remove jsre from mist
Diffstat (limited to 'cmd/mist/ui_lib.go')
-rw-r--r-- | cmd/mist/ui_lib.go | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go index cc213b49a..42cdcb9d7 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/eth" "github.com/ethereum/go-ethereum/ethutil" "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 { |