Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
6221b282
Commit
6221b282
authored
Feb 11, 2015
by
Alexandre Van de Sande
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catalog Page Behaviour
parent
80890cd9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
119 deletions
+96
-119
main.qml
cmd/mist/assets/qml/main.qml
+39
-15
browser.qml
cmd/mist/assets/qml/views/browser.qml
+13
-6
catalog.qml
cmd/mist/assets/qml/views/catalog.qml
+44
-98
No files found.
cmd/mist/assets/qml/main.qml
View file @
6221b282
...
...
@@ -39,7 +39,7 @@ ApplicationWindow {
// Takes care of loading all default plugins
Component.onCompleted
:
{
addPlugin
(
"./views/catalog.qml"
,
{
noAdd
:
true
,
close
:
false
,
section
:
"begin"
});
var
catalog
=
addPlugin
(
"./views/catalog.qml"
,
{
noAdd
:
true
,
close
:
false
,
section
:
"begin"
});
var
wallet
=
addPlugin
(
"./views/wallet.qml"
,
{
noAdd
:
true
,
close
:
false
,
section
:
"ethereum"
,
active
:
true
});
addPlugin
(
"./views/miner.qml"
,
{
noAdd
:
true
,
close
:
false
,
section
:
"ethereum"
,
active
:
true
});
...
...
@@ -49,9 +49,9 @@ ApplicationWindow {
addPlugin
(
"./views/pending_tx.qml"
,
{
noAdd
:
true
,
close
:
false
,
section
:
"legacy"
});
addPlugin
(
"./views/info.qml"
,
{
noAdd
:
true
,
close
:
false
,
section
:
"legacy"
});
mainSplit
.
setView
(
wallet
.
view
,
wallet
.
menuItem
);
mainSplit
.
setView
(
catalog
.
view
,
catalog
.
menuItem
);
newBrowserTab
(
"http://ethereum-dapp-whisper-client.meteor.com/chat/amstea
m"
);
//newBrowserTab("http://ethereum-dapp-catalog.meteor.co
m");
// Command setup
gui
.
sendCommand
(
0
)
...
...
@@ -114,10 +114,33 @@ ApplicationWindow {
}
function
newBrowserTab
(
url
)
{
var
window
=
addPlugin
(
"./views/browser.qml"
,
{
noAdd
:
true
,
close
:
true
,
section
:
"apps"
,
active
:
true
});
window
.
view
.
url
=
url
;
window
.
menuItem
.
title
=
"Mist"
;
activeView
(
window
.
view
,
window
.
menuItem
);
var
urlMatches
=
url
.
toString
().
match
(
/^
[
a-z
]
*
\:\/\/([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
requestedDomain
=
urlMatches
&&
urlMatches
[
1
];
var
domainAlreadyOpen
=
false
;
console
.
log
(
"requested: "
+
requestedDomain
)
for
(
var
i
=
0
;
i
<
mainSplit
.
views
.
length
;
i
++
)
{
if
(
mainSplit
.
views
[
i
].
view
.
url
)
{
var
matches
=
mainSplit
.
views
[
i
].
view
.
url
.
toString
().
match
(
/^
[
a-z
]
*
\:\/\/(?:
www
\.)?([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
existingDomain
=
matches
&&
matches
[
1
];
console
.
log
(
"exists: "
+
existingDomain
);
if
(
requestedDomain
==
existingDomain
)
{
domainAlreadyOpen
=
true
;
mainSplit
.
views
[
i
].
view
.
url
=
url
;
activeView
(
mainSplit
.
views
[
i
].
view
,
mainSplit
.
views
[
i
].
menuItem
);
}
}
}
if
(
!
domainAlreadyOpen
)
{
var
window
=
addPlugin
(
"./views/browser.qml"
,
{
noAdd
:
true
,
close
:
true
,
section
:
"apps"
,
active
:
true
});
window
.
view
.
url
=
url
;
window
.
menuItem
.
title
=
"Mist"
;
activeView
(
window
.
view
,
window
.
menuItem
);
}
}
...
...
@@ -332,8 +355,9 @@ ApplicationWindow {
id
:
mainSplit
anchors.fill
:
parent
resizing
:
false
//resizing: false // this is NOT where we remove that damning resizing handle..
handleDelegate
:
Item
{
//This handle is a way to remove the line between the split views
Rectangle
{
anchors.fill
:
parent
}
...
...
@@ -497,7 +521,7 @@ ApplicationWindow {
anchors.fill
:
parent
border.width
:
0
radius
:
5
color
:
"#F
FFFFFFF
"
color
:
"#F
AFAFA
"
}
Rectangle
{
anchors
{
...
...
@@ -506,7 +530,7 @@ ApplicationWindow {
right
:
r
.
right
}
width
:
10
color
:
"#F
FFFFFFF
"
color
:
"#F
AFAFA
"
border.width
:
0
Rectangle
{
...
...
@@ -517,7 +541,7 @@ ApplicationWindow {
top
:
parent
.
top
}
height
:
1
color
:
"#F
FFFFF
"
color
:
"#F
AFAFA
"
}
Rectangle
{
...
...
@@ -528,7 +552,7 @@ ApplicationWindow {
bottom
:
parent
.
bottom
}
height
:
1
color
:
"#F
FFFFF
"
color
:
"#F
AFAFA
"
}
}
}
...
...
@@ -800,7 +824,7 @@ ApplicationWindow {
anchors.top
:
parent
.
top
color
:
"#00000000"
Rectangle
{
/*
Rectangle {
id: urlPane
height: 40
color: "#00000000"
...
...
@@ -847,7 +871,7 @@ ApplicationWindow {
z: -1
height: 1
color: "#CCCCCC"
}
}
*/
Rectangle
{
id
:
mainView
...
...
@@ -855,7 +879,7 @@ ApplicationWindow {
anchors.right
:
parent
.
right
anchors.left
:
parent
.
left
anchors.bottom
:
parent
.
bottom
anchors.top
:
divider
.
bottom
anchors.top
:
parent
.
top
function
createView
(
component
)
{
var
view
=
component
.
createObject
(
mainView
)
...
...
cmd/mist/assets/qml/views/browser.qml
View file @
6221b282
...
...
@@ -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
;
};
});
...
...
cmd/mist/assets/qml/views/catalog.qml
View file @
6221b282
...
...
@@ -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
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment