diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-23 23:56:35 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-23 23:56:35 +0800 |
commit | a4007f3b686b16e73b4cb9ebceb63f3755d31ff3 (patch) | |
tree | b8bd5760a3c3e6002aeaf55fd16941f7be774e57 /mist/assets/qml/webapp.qml | |
parent | 353b558536933523cd65f35eea23e2f904a5c378 (diff) | |
download | dexon-a4007f3b686b16e73b4cb9ebceb63f3755d31ff3.tar dexon-a4007f3b686b16e73b4cb9ebceb63f3755d31ff3.tar.gz dexon-a4007f3b686b16e73b4cb9ebceb63f3755d31ff3.tar.bz2 dexon-a4007f3b686b16e73b4cb9ebceb63f3755d31ff3.tar.lz dexon-a4007f3b686b16e73b4cb9ebceb63f3755d31ff3.tar.xz dexon-a4007f3b686b16e73b4cb9ebceb63f3755d31ff3.tar.zst dexon-a4007f3b686b16e73b4cb9ebceb63f3755d31ff3.zip |
Fixed min gas price on coin
Diffstat (limited to 'mist/assets/qml/webapp.qml')
-rw-r--r-- | mist/assets/qml/webapp.qml | 80 |
1 files changed, 44 insertions, 36 deletions
diff --git a/mist/assets/qml/webapp.qml b/mist/assets/qml/webapp.qml index 8801b6b47..dde298484 100644 --- a/mist/assets/qml/webapp.qml +++ b/mist/assets/qml/webapp.qml @@ -19,6 +19,48 @@ import "../ext/qml_messaging.js" as Messaging property alias url: webview.url property alias webView: webview + property var cleanPath: false + property var open: function(url) { + if(!window.cleanPath) { + var uri = url; + if(!/.*\:\/\/.*/.test(uri)) { + uri = "http://" + uri; + } + + var reg = /(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.eth)(.*)/ + + if(reg.test(uri)) { + uri.replace(reg, function(match, pre, domain, path) { + uri = pre; + + var lookup = eth.lookupDomain(domain.substring(0, domain.length - 4)); + var ip = []; + for(var i = 0, l = lookup.length; i < l; i++) { + ip.push(lookup.charCodeAt(i)) + } + + if(ip.length != 0) { + uri += lookup; + } else { + uri += domain; + } + + uri += path; + }); + } + + window.cleanPath = true; + + webview.url = uri; + + //uriNav.text = uri.text.replace(/(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.\w{2,3})(.*)/, "$1$2<span style='color:#CCC'>$3</span>"); + uriNav.text = uri; + } else { + // Prevent inf loop. + window.cleanPath = false; + } + } + Component.onCompleted: { webview.url = "http://etherian.io" } @@ -103,43 +145,9 @@ import "../ext/qml_messaging.js" as Messaging top: navBar.bottom } - property var cleanPath: false + //property var cleanPath: false onNavigationRequested: { - if(!this.cleanPath) { - var uri = request.url.toString(); - if(!/.*\:\/\/.*/.test(uri)) { - uri = "http://" + uri; - } - - var reg = /(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.eth)(.*)/ - - if(reg.test(uri)) { - uri.replace(reg, function(match, pre, domain, path) { - uri = pre; - - var lookup = eth.lookupDomain(domain.substring(0, domain.length - 4)); - var ip = []; - for(var i = 0, l = lookup.length; i < l; i++) { - ip.push(lookup.charCodeAt(i)) - } - - if(ip.length != 0) { - uri += lookup; - } else { - uri += domain; - } - - uri += path; - }); - } - - this.cleanPath = true; - - webview.url = uri; - } else { - // Prevent inf loop. - this.cleanPath = false; - } + window.open(request.url.toString()); } function sendMessage(data) { |