aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/mist/assets/qml/views
diff options
context:
space:
mode:
authorAlexandre Van de Sande <alex.vandesande@ethdev.com>2015-02-12 02:16:35 +0800
committerAlexandre Van de Sande <alex.vandesande@ethdev.com>2015-02-12 02:16:35 +0800
commit6221b282d40c18c5c79c459e3b6218cd565a20b1 (patch)
treeb8d7f0ee940702febb107323f7ce98cde20acf7d /cmd/mist/assets/qml/views
parent80890cd9ddb8cf958c202be6c9bbc503fd425718 (diff)
downloadgo-tangerine-6221b282d40c18c5c79c459e3b6218cd565a20b1.tar.gz
go-tangerine-6221b282d40c18c5c79c459e3b6218cd565a20b1.tar.zst
go-tangerine-6221b282d40c18c5c79c459e3b6218cd565a20b1.zip
Catalog Page Behaviour
Diffstat (limited to 'cmd/mist/assets/qml/views')
-rw-r--r--cmd/mist/assets/qml/views/browser.qml19
-rw-r--r--cmd/mist/assets/qml/views/catalog.qml142
2 files changed, 57 insertions, 104 deletions
diff --git a/cmd/mist/assets/qml/views/browser.qml b/cmd/mist/assets/qml/views/browser.qml
index db89c6837..04b2229ec 100644
--- a/cmd/mist/assets/qml/views/browser.qml
+++ b/cmd/mist/assets/qml/views/browser.qml
@@ -345,14 +345,21 @@ Rectangle {
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;
+ 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;
+
+ };
});
diff --git a/cmd/mist/assets/qml/views/catalog.qml b/cmd/mist/assets/qml/views/catalog.qml
index 7f42c25dc..a7832e9fa 100644
--- a/cmd/mist/assets/qml/views/catalog.qml
+++ b/cmd/mist/assets/qml/views/catalog.qml
@@ -12,7 +12,7 @@ Rectangle {
anchors.fill: parent
color: "#00000000"
- property var title: ""
+ property var title: "Catalog"
property var iconSource: ""
property var menuItem
property var hideUrl: true
@@ -75,111 +75,57 @@ Rectangle {
anchors.fill: parent
state: "inspectorShown"
- RowLayout {
- id: navBar
- height: 184
- z: 20
-
- anchors {
- left: parent.left
- right: parent.right
- }
-
- Rectangle {
- id: appInfoPane
- height: 28
- color: "#efefef"
- radius: 6
- z:25
-
- MouseArea {
- anchors.fill: parent
- z: 10
- hoverEnabled: true
- onEntered: {
- uriNav.visible = true
- appTitle.visible = false
- appDomain.visible = false
- }
- }
-
- anchors {
- left: parent.left
- right: parent.right
- leftMargin: 10
- rightMargin: 10
- top: parent.verticalCenter
- topMargin: 23
- }
-
- TextField {
- id: uriNav
- anchors {
- left: parent.left
- right: parent.right
- leftMargin: 16
- top: parent.verticalCenter
- topMargin: -10
- }
-
- horizontalAlignment: Text.AlignHCenter
-
- style: TextFieldStyle {
- textColor: "#928484"
- background: Rectangle {
- border.width: 0
- color: "transparent"
- }
- }
- text: "Type the address of a new Dapp";
- y: parent.height / 2 - this.height / 2
- z: 30
- activeFocusOnPress: true
- Keys.onReturnPressed: {
- newBrowserTab(this.text);
- this.text = "Type the address of a new Dapp";
- }
-
- }
- }
-
- Rectangle {
- id: appInfoPaneShadow
- width: 10
- height: 30
- color: "#BDB6B6"
- radius: 6
- z: 15
-
- anchors {
- left: parent.left
- right: parent.right
- leftMargin:10
- rightMargin:10
- top: parent.verticalCenter
- topMargin: 23
- }
-
-
- }
-
- }
-
-
WebEngineView {
objectName: "webView"
id: webview
anchors.fill: parent
- onLoadingChanged: {
- if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
- webview.runJavaScript(eth.readFile("bignumber.min.js"));
- webview.runJavaScript(eth.readFile("ethereum.js/dist/ethereum.js"));
- }
- }
+ 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);
+ }
+
+ }
+ }
}