Merge branch 'develop' into miner
This commit is contained in:
BIN
cmd/mist/assets/backButton.png
Normal file
BIN
cmd/mist/assets/backButton.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 663 B |
BIN
cmd/mist/assets/backButton@2x.png
Normal file
BIN
cmd/mist/assets/backButton@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
@@ -7,7 +7,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1>JevCoin <code id="address"></code></h1>
|
||||
<h1>JevCoin <code id="contract_addr"></code></h1>
|
||||
<div>
|
||||
<strong>Balance</strong>
|
||||
<span id="balance"></strong>
|
||||
@@ -58,29 +58,25 @@
|
||||
}],
|
||||
"outputs": []
|
||||
}, {
|
||||
"name":"changed",
|
||||
"name":"received",
|
||||
"type":"event",
|
||||
"inputs": [
|
||||
{"name":"to","type":"address","indexed":true},
|
||||
{"name":"from","type":"address","indexed":true},
|
||||
{"name":"amount","type":"uint256","indexed":true},
|
||||
],
|
||||
}];
|
||||
|
||||
var address = localStorage.getItem("address");
|
||||
// deploy if not exist
|
||||
if (address == null) {
|
||||
var code = "0x60056013565b610132806100356000396000f35b620f4240600033600160a060020a0316600052602052604060002081905550560060e060020a6000350480637bb98a681461002b578063d0679d3414610039578063e3d670d71461004d57005b61003361012d565b60006000f35b610047600435602435610062565b60006000f35b61005860043561010b565b8060005260206000f35b80600033600160a060020a0316600052602052604060002054106100855761008a565b610107565b80600033600160a060020a0316600052602052604060002090815403908190555080600083600160a060020a0316600052602052604060002090815401908190555081600160a060020a031633600160a060020a03167f1863989b4bb7c5c3941722099764574df7a459f9f9c6b6cdca35ddc9731792b860006000a35b5050565b6000600082600160a060020a03166000526020526040600020549050919050565b5b60008156";
|
||||
address = web3.eth.transact({
|
||||
data: code,
|
||||
gasPrice: "1000000000000000",
|
||||
gas: "10000",
|
||||
});
|
||||
var code = "0x60056013565b61012b806100346000396000f35b6103e8600033600160a060020a0316600052602052604060002081905550560060e060020a6000350480637bb98a681461002b578063d0679d3414610039578063e3d670d71461004d57005b610033610126565b60006000f35b610047600435602435610062565b60006000f35b610058600435610104565b8060005260206000f35b80600033600160a060020a0316600052602052604060002054101561008657610100565b80600033600160a060020a0316600052602052604060002090815403908190555080600083600160a060020a0316600052602052604060002090815401908190555033600160a060020a0316600052806020527ff11e547d796cc64acdf758e7cee90439494fd886a19159454aa61e473fdbafef60406000a15b5050565b6000600082600160a060020a03166000526020526040600020549050919050565b5b60008156";
|
||||
address = web3.eth.transact({data: code});
|
||||
localStorage.setItem("address", address);
|
||||
}
|
||||
document.querySelector("#address").innerHTML = address.toUpperCase();
|
||||
document.querySelector("#contract_addr").innerHTML = address.toUpperCase();
|
||||
|
||||
var contract = web3.eth.contract(address, desc);
|
||||
contract.changed({from: eth.accounts[0]}).changed(function() {
|
||||
contract.received({from: eth.coinbase}).changed(function() {
|
||||
refresh();
|
||||
});
|
||||
eth.watch('chain').changed(function() {
|
||||
@@ -102,7 +98,6 @@
|
||||
|
||||
function transact() {
|
||||
var to = document.querySelector("#address").value;
|
||||
|
||||
if( to.length == 0 ) {
|
||||
to = "0x4205b06c2cfa0e30359edcab94543266cb6fa1d3";
|
||||
} else {
|
||||
|
1
cmd/mist/assets/examples/coin.js
Normal file
1
cmd/mist/assets/examples/coin.js
Normal file
@@ -0,0 +1 @@
|
||||
var contract = web3.eth.contractFromAbi([{"constant":false,"inputs":[{"name":"_h","type":"hash256"}],"name":"confirm","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":_to","type":"address"},{"name":"_value","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"execute","outputs":[{"name":"_r","type":"hash256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"kill","outputs":[],"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"}],"name":"changeOwner","outputs":[],"type":"function"},{"inputs":[{"indexed":false,"name":"value","type":"uint256"}],"name":"CashIn","type":"event"},{"inputs":[{"indexed":true,"name":"out","type":"string32"},{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"}],"name":"SingleTransact","type":"event"},{"inputs":[{"indexed":true,"name":"out","type":"string32"},{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"operation","type":"hash256"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"}],"name":"MultiTransact","type":"event"}]);
|
BIN
cmd/mist/assets/qml/fonts/Simple-Line-Icons.ttf
Executable file
BIN
cmd/mist/assets/qml/fonts/Simple-Line-Icons.ttf
Executable file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Black.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Black.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-BlackIt.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-BlackIt.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Bold.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Bold.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-BoldIt.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-BoldIt.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-ExtraLight.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-ExtraLight.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-ExtraLightIt.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-ExtraLightIt.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-It.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-It.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Light.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Light.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-LightIt.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-LightIt.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Regular.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Regular.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Semibold.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-Semibold.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-SemiboldIt.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSansPro-SemiboldIt.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSerifPro-Bold.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSerifPro-Bold.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSerifPro-Regular.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSerifPro-Regular.ttf
Normal file
Binary file not shown.
BIN
cmd/mist/assets/qml/fonts/SourceSerifPro-Semibold.ttf
Normal file
BIN
cmd/mist/assets/qml/fonts/SourceSerifPro-Semibold.ttf
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -56,12 +56,34 @@ Rectangle {
|
||||
|
||||
//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;
|
||||
}
|
||||
}
|
||||
|
||||
function showFullUrlBar(on){
|
||||
if (on) {
|
||||
//appTitle.visible = false
|
||||
//appDomain.visible = false
|
||||
|
||||
//uriNav.visible = true
|
||||
clickAnywhereOnApp.visible = true
|
||||
|
||||
navBar.state = "fullUrlVisible"
|
||||
} else {
|
||||
//appTitle.visible = true
|
||||
//appDomain.visible = true
|
||||
//uriNav.visible = false
|
||||
clickAnywhereOnApp.visible = false
|
||||
|
||||
navBar.state = "titleVisible"
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
}
|
||||
|
||||
@@ -71,75 +93,234 @@ Rectangle {
|
||||
anchors.fill: parent
|
||||
state: "inspectorShown"
|
||||
|
||||
MouseArea {
|
||||
id: clickAnywhereOnApp
|
||||
z:15
|
||||
//hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
/*hoverEnabled: true*/
|
||||
|
||||
onClicked: {
|
||||
showFullUrlBar(false);
|
||||
}
|
||||
|
||||
/*Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#88888888"
|
||||
}*/
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: navBar
|
||||
height: 40
|
||||
height: 74
|
||||
z: 20
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin: 7
|
||||
}
|
||||
|
||||
Button {
|
||||
id: back
|
||||
|
||||
onClicked: {
|
||||
webview.goBack()
|
||||
}
|
||||
|
||||
anchors{
|
||||
left: parent.left
|
||||
leftMargin: 6
|
||||
}
|
||||
|
||||
style: ButtonStyle {
|
||||
background: Image {
|
||||
source: "../../back.png"
|
||||
width: 30
|
||||
source: "../../backButton.png"
|
||||
width: 20
|
||||
height: 30
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TextField {
|
||||
anchors {
|
||||
Rectangle {
|
||||
id: appInfoPane
|
||||
height: 28
|
||||
color: "#FFFFFF"
|
||||
radius: 6
|
||||
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
z: 10
|
||||
hoverEnabled: true
|
||||
|
||||
onEntered: {
|
||||
showFullUrlBar(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
anchors {
|
||||
left: back.right
|
||||
right: toggleInspector.left
|
||||
right: parent.right
|
||||
leftMargin: 10
|
||||
rightMargin: 10
|
||||
}
|
||||
text: webview.url;
|
||||
id: uriNav
|
||||
y: parent.height / 2 - this.height / 2
|
||||
|
||||
Keys.onReturnPressed: {
|
||||
webview.url = this.text;
|
||||
}
|
||||
Text {
|
||||
id: appTitle
|
||||
text: "LOADING"
|
||||
font.bold: true
|
||||
font.capitalization: Font.AllUppercase
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.horizontalCenter
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
rightMargin: 10
|
||||
}
|
||||
color: "#928484"
|
||||
}
|
||||
|
||||
Text {
|
||||
id: appDomain
|
||||
text: "loading domain"
|
||||
font.bold: false
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
anchors {
|
||||
left: parent.horizontalCenter
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
leftMargin: 10
|
||||
}
|
||||
color: "#C0AFAF"
|
||||
}
|
||||
|
||||
|
||||
TextField {
|
||||
id: uriNav
|
||||
opacity: 0.0
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
leftMargin: 16
|
||||
}
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
style: TextFieldStyle {
|
||||
textColor: "#928484"
|
||||
background: Rectangle {
|
||||
border.width: 0
|
||||
color: "transparent"
|
||||
}
|
||||
}
|
||||
text: webview.url;
|
||||
y: parent.height / 2 - this.height / 2
|
||||
z: 20
|
||||
activeFocusOnPress: true
|
||||
Keys.onReturnPressed: {
|
||||
webview.url = this.text;
|
||||
}
|
||||
/* onFocusedChanged: {
|
||||
if (focused) {
|
||||
//uriNav.selectAll();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
z:2
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: appInfoPaneShadow
|
||||
width: 10
|
||||
height: 30
|
||||
color: "#BDB6B6"
|
||||
radius: 6
|
||||
|
||||
Button {
|
||||
id: toggleInspector
|
||||
anchors {
|
||||
anchors {
|
||||
left: back.right
|
||||
right: parent.right
|
||||
leftMargin:10
|
||||
rightMargin:10
|
||||
top: parent.top
|
||||
topMargin: 23
|
||||
}
|
||||
iconSource: "../../bug.png"
|
||||
onClicked: {
|
||||
// XXX soon
|
||||
return
|
||||
if(inspector.visible == true){
|
||||
inspector.visible = false
|
||||
}else{
|
||||
inspector.visible = true
|
||||
inspector.url = webview.experimental.remoteInspectorUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Border
|
||||
Rectangle {
|
||||
id: divider
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: navBar.bottom
|
||||
z:1
|
||||
}
|
||||
z: -1
|
||||
height: 1
|
||||
color: "#CCCCCC"
|
||||
|
||||
Rectangle {
|
||||
id: navBarBackground
|
||||
anchors.fill: parent
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: "#F6F1F2" }
|
||||
GradientStop { position: 1.0; color: "#DED5D5" }
|
||||
}
|
||||
z:-1
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "fullUrlVisible"
|
||||
PropertyChanges {
|
||||
target: appTitle
|
||||
anchors.rightMargin: -50
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: appDomain
|
||||
anchors.leftMargin: -50
|
||||
opacity: 0.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: uriNav
|
||||
anchors.leftMargin: 0
|
||||
opacity: 1.0
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "titleVisible"
|
||||
|
||||
PropertyChanges {
|
||||
target: appTitle
|
||||
anchors.rightMargin: 10
|
||||
opacity: 1.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: appDomain
|
||||
anchors.leftMargin: 10
|
||||
opacity: 1.0
|
||||
}
|
||||
PropertyChanges {
|
||||
target: uriNav
|
||||
anchors.leftMargin: -50
|
||||
opacity: 0.0
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
transitions: [
|
||||
// This adds a transition that defaults to applying to all state changes
|
||||
|
||||
Transition {
|
||||
|
||||
// This applies a default NumberAnimation to any changes a state change makes to x or y properties
|
||||
NumberAnimation {
|
||||
properties: "anchors.leftMargin, anchors.rightMargin, opacity"
|
||||
easing.type: Easing.InOutQuad //Easing.InOutBack
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
WebEngineView {
|
||||
@@ -149,16 +330,51 @@ Rectangle {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
top: divider.bottom
|
||||
top: navBar.bottom
|
||||
}
|
||||
|
||||
z: 10
|
||||
|
||||
onLoadingChanged: {
|
||||
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
|
||||
webview.runJavaScript("document.title", function(pageTitle) {
|
||||
menuItem.title = pageTitle;
|
||||
});
|
||||
|
||||
//var topBarStyle
|
||||
webView.runJavaScript("document.querySelector(\"meta[name='ethereum-dapp-url-bar-style']\").getAttribute(\"content\")", function(topBarStyle){
|
||||
if (topBarStyle=="transparent") {
|
||||
|
||||
// Adjust for a transparent sidebar Dapp
|
||||
navBarBackground.visible = false;
|
||||
back.visible = false;
|
||||
appInfoPane.anchors.leftMargin = -16;
|
||||
appInfoPaneShadow.anchors.leftMargin = -16;
|
||||
webview.anchors.topMargin = -74;
|
||||
webview.runJavaScript("document.querySelector('body').classList.add('ethereum-dapp-url-bar-style-transparent')")
|
||||
|
||||
} else {
|
||||
navBarBackground.visible = true;
|
||||
back.visible = true;
|
||||
appInfoPane.anchors.leftMargin = 0;
|
||||
appInfoPaneShadow.anchors.leftMargin = 0;
|
||||
webview.anchors.topMargin = 0;
|
||||
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
|
||||
webview.runJavaScript(eth.readFile("bignumber.min.js"));
|
||||
webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
|
||||
|
||||
var cleanTitle = webview.url.toString()
|
||||
var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
|
||||
var domain = matches && matches[1];
|
||||
|
||||
appDomain.text = domain //webview.url.replace("a", "z")
|
||||
appTitle.text = webview.title
|
||||
|
||||
showFullUrlBar(false);
|
||||
}
|
||||
}
|
||||
onJavaScriptConsoleMessage: {
|
||||
@@ -208,4 +424,3 @@ Rectangle {
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
155
cmd/mist/assets/qml/views/catalog.qml
Normal file
155
cmd/mist/assets/qml/views/catalog.qml
Normal file
@@ -0,0 +1,155 @@
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 1.0;
|
||||
import QtQuick.Controls.Styles 1.0
|
||||
import QtQuick.Layouts 1.0;
|
||||
import QtWebEngine 1.0
|
||||
//import QtWebEngine.experimental 1.0
|
||||
import QtQuick.Window 2.0;
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: window
|
||||
anchors.fill: parent
|
||||
color: "#00000000"
|
||||
|
||||
property var title: "Catalog"
|
||||
property var iconSource: ""
|
||||
property var menuItem
|
||||
property var hideUrl: true
|
||||
|
||||
property alias url: webview.url
|
||||
property alias windowTitle: webview.title
|
||||
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: {
|
||||
}
|
||||
|
||||
Item {
|
||||
objectName: "root"
|
||||
id: root
|
||||
anchors.fill: parent
|
||||
state: "inspectorShown"
|
||||
|
||||
WebEngineView {
|
||||
objectName: "webView"
|
||||
id: webview
|
||||
anchors.fill: parent
|
||||
|
||||
property var protocol: "http://"
|
||||
//property var domain: "localhost:3000"
|
||||
property var domain: "ethereum-dapp-catalog.meteor.com"
|
||||
url: protocol + domain
|
||||
|
||||
//navigationRequest: WebEngineView.IgnoreRequest
|
||||
// onLoadingChanged: {
|
||||
// if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
|
||||
// webview.runJavaScript(eth.readFile("bignumber.min.js"));
|
||||
// webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
|
||||
// }
|
||||
// }
|
||||
|
||||
//onNavigationRequested: {
|
||||
// detect URL scheme prefix, most likely an external link
|
||||
//var schemaRE = /^\w+:/;
|
||||
//if (schemaRE.test(request.url)) {
|
||||
// request.action = WebView.AcceptRequest;
|
||||
//} else {
|
||||
//request.action = WebView.IgnoreRequest;
|
||||
// delegate request.url here
|
||||
//}
|
||||
//}
|
||||
|
||||
onJavaScriptConsoleMessage: {
|
||||
console.log(sourceID + ":" + lineNumber + ":" + JSON.stringify(message));
|
||||
}
|
||||
|
||||
onNavigationRequested: {
|
||||
var cleanTitle = request.url.toString()
|
||||
var matches = cleanTitle.match(/^[a-z]*\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
|
||||
var requestedDomain = matches && matches[1];
|
||||
|
||||
console.debug ("NavigationRequested: " + request.url + " navigationType=" + request.navigationType)
|
||||
|
||||
if(request.navigationType==0){
|
||||
|
||||
if (requestedDomain === this.domain){
|
||||
request.action = WebEngineView.AcceptRequest;
|
||||
} else {
|
||||
request.action = WebEngineView.IgnoreRequest;
|
||||
newBrowserTab(request.url);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
WebEngineView {
|
||||
id: inspector
|
||||
visible: false
|
||||
z:10
|
||||
anchors {
|
||||
left: root.left
|
||||
right: root.right
|
||||
top: sizeGrip.bottom
|
||||
bottom: root.bottom
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "inspectorShown"
|
||||
PropertyChanges {
|
||||
target: inspector
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user