DNS for a hrefs should now be fixed

This commit is contained in:
obscuren 2014-08-14 13:26:29 +02:00
parent 14e4f1283c
commit 3fd0337330
5 changed files with 112 additions and 99 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 931 B

After

Width:  |  Height:  |  Size: 1004 B

BIN
ethereal/assets/bug.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -8,14 +8,15 @@ h1 {
text-align: center;
font-family: Courier;
font-size: 50pt;
margin-top: 25%
}
</style>
</head>
<body>
<h1>... Ethereum ...</h1>
<!-- ĐΞV --!>
<ul>
<li><a href="http://std.eth">std::Service</a></li>
</ul>
</body>
</html>

@ -2,6 +2,7 @@ import QtQuick 2.0
import QtWebKit 3.0
import QtWebKit.experimental 1.0
import QtQuick.Controls 1.0;
import QtQuick.Controls.Styles 1.0
import QtQuick.Layouts 1.0;
import QtQuick.Window 2.1;
import Ethereum 1.0
@ -9,8 +10,8 @@ import Ethereum 1.0
ApplicationWindow {
id: window
title: "Ethereum"
width: 900
height: 600
width: 1000
height: 800
minimumHeight: 300
property alias url: webview.url
@ -24,29 +25,74 @@ ApplicationWindow {
RowLayout {
id: navBar
height: 40
anchors {
left: parent.left
right: parent.right
leftMargin: 7
}
Button {
id: back
iconSource: "../back.png"
onClicked: {
webview.goBack()
}
style: ButtonStyle {
background: Image {
source: "../back.png"
width: 30
height: 30
}
}
}
TextField {
anchors {
top: parent.top
left: back.right
right: parent.right
right: toggleInspector.left
leftMargin: 5
rightMargin: 5
}
id: uriNav
y: parent.height / 2 - this.height / 2
Keys.onReturnPressed: {
var uri = this.text;
webview.url = this.text;
}
}
Button {
id: toggleInspector
anchors {
right: parent.right
}
iconSource: "../bug.png"
onClicked: {
if(inspector.visible == true){
inspector.visible = false
}else{
inspector.visible = true
inspector.url = webview.experimental.remoteInspectorUrl
}
}
}
}
WebView {
objectName: "webView"
id: webview
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
top: navBar.bottom
}
onTitleChanged: { window.title = title }
property var cleanPath: false
onNavigationRequested: {
if(!this.cleanPath) {
var uri = request.url.toString();
if(!/.*\:\/\/.*/.test(uri)) {
uri = "http://" + uri;
}
@ -54,7 +100,7 @@ ApplicationWindow {
var reg = /(^https?\:\/\/(?:www\.)?)([a-zA-Z0-9_\-]*\.eth)(.*)/
if(reg.test(uri)) {
this.text.replace(reg, function(match, pre, domain, path) {
uri.replace(reg, function(match, pre, domain, path) {
uri = pre;
var lookup = eth.lookupDomain(domain.substring(0, domain.length - 4));
@ -73,23 +119,14 @@ ApplicationWindow {
});
}
console.log("connecting to ...", uri)
this.cleanPath = true;
webview.url = uri;
} else {
// Prevent inf loop.
this.cleanPath = false;
}
}
}
WebView {
objectName: "webView"
id: webview
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
top: navBar.bottom
}
onTitleChanged: { window.title = title }
experimental.preferences.javascriptEnabled: true
experimental.preferences.navigatorQtObjectEnabled: true
experimental.preferences.developerExtrasEnabled: true
@ -236,31 +273,6 @@ ApplicationWindow {
}
}
Rectangle {
id: toggleInspector
color: "#bcbcbc"
visible: true
height: 20
width: 20
anchors {
right: root.right
}
MouseArea {
onClicked: {
if(inspector.visible == true){
inspector.visible = false
}else{
inspector.visible = true
inspector.url = webview.experimental.remoteInspectorUrl
}
}
onDoubleClicked: {
webView.reload()
}
anchors.fill: parent
}
}
Rectangle {
id: sizeGrip

@ -391,12 +391,12 @@ func (gui *Gui) update() {
if bytes.Compare(tx.Sender(), gui.address()) == 0 {
object.SubAmount(tx.Value)
gui.getObjectByName("transactionView").Call("addTx", "post", ethpub.NewPTx(tx), "send")
gui.getObjectByName("transactionView").Call("addTx", ethpub.NewPTx(tx), "send")
gui.txDb.Put(tx.Hash(), tx.RlpEncode())
} else if bytes.Compare(tx.Recipient, gui.address()) == 0 {
object.AddAmount(tx.Value)
gui.getObjectByName("transactionView").Call("addTx", "post", ethpub.NewPTx(tx), "recv")
gui.getObjectByName("transactionView").Call("addTx", ethpub.NewPTx(tx), "recv")
gui.txDb.Put(tx.Hash(), tx.RlpEncode())
}