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
7aef0fed
Commit
7aef0fed
authored
Feb 13, 2015
by
Alexandre Van de Sande
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed url bar behaviour. Failed attempt at icon
parent
d73dff4d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
75 deletions
+77
-75
main.qml
cmd/mist/assets/qml/main.qml
+8
-6
browser.qml
cmd/mist/assets/qml/views/browser.qml
+62
-48
catalog.qml
cmd/mist/assets/qml/views/catalog.qml
+7
-21
No files found.
cmd/mist/assets/qml/main.qml
View file @
7aef0fed
...
@@ -59,13 +59,13 @@ ApplicationWindow {
...
@@ -59,13 +59,13 @@ ApplicationWindow {
function
activeView
(
view
,
menuItem
)
{
function
activeView
(
view
,
menuItem
)
{
mainSplit
.
setView
(
view
,
menuItem
)
mainSplit
.
setView
(
view
,
menuItem
)
if
(
view
.
hideUrl
)
{
/*
if (view.hideUrl) {
urlPane.visible = false;
urlPane.visible = false;
mainView.anchors.top = rootView.top
mainView.anchors.top = rootView.top
} else {
} else {
urlPane.visible = true;
urlPane.visible = true;
mainView.anchors.top = divider.bottom
mainView.anchors.top = divider.bottom
}
}
*/
}
}
function
addViews
(
view
,
path
,
options
)
{
function
addViews
(
view
,
path
,
options
)
{
...
@@ -120,13 +120,10 @@ ApplicationWindow {
...
@@ -120,13 +120,10 @@ ApplicationWindow {
var
domainAlreadyOpen
=
false
;
var
domainAlreadyOpen
=
false
;
console
.
log
(
"requested: "
+
requestedDomain
)
for
(
var
i
=
0
;
i
<
mainSplit
.
views
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
mainSplit
.
views
.
length
;
i
++
)
{
if
(
mainSplit
.
views
[
i
].
view
.
url
)
{
if
(
mainSplit
.
views
[
i
].
view
.
url
)
{
var
matches
=
mainSplit
.
views
[
i
].
view
.
url
.
toString
().
match
(
/^
[
a-z
]
*
\:\/\/(?:
www
\.)?([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
matches
=
mainSplit
.
views
[
i
].
view
.
url
.
toString
().
match
(
/^
[
a-z
]
*
\:\/\/(?:
www
\.)?([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
existingDomain
=
matches
&&
matches
[
1
];
var
existingDomain
=
matches
&&
matches
[
1
];
console
.
log
(
"exists: "
+
existingDomain
);
if
(
requestedDomain
==
existingDomain
)
{
if
(
requestedDomain
==
existingDomain
)
{
domainAlreadyOpen
=
true
;
domainAlreadyOpen
=
true
;
mainSplit
.
views
[
i
].
view
.
url
=
url
;
mainSplit
.
views
[
i
].
view
.
url
=
url
;
...
@@ -567,7 +564,9 @@ ApplicationWindow {
...
@@ -567,7 +564,9 @@ ApplicationWindow {
if
(
parent
.
closable
==
true
)
{
if
(
parent
.
closable
==
true
)
{
closeIcon
.
visible
=
sel
.
visible
closeIcon
.
visible
=
sel
.
visible
}
}
/*if(view.hasOwnProperty("iconSource")) {
icon.source = view.iconSource;
}*/
}
}
onExited
:
{
onExited
:
{
closeIcon
.
visible
=
false
closeIcon
.
visible
=
false
...
@@ -600,10 +599,13 @@ ApplicationWindow {
...
@@ -600,10 +599,13 @@ ApplicationWindow {
id
:
label
id
:
label
font.family
:
sourceSansPro
.
name
font.family
:
sourceSansPro
.
name
font.weight
:
Font
.
DemiBold
font.weight
:
Font
.
DemiBold
elide
:
Text
.
ElideRight
anchors
{
anchors
{
left
:
icon
.
right
left
:
icon
.
right
right
:
parent
.
right
verticalCenter
:
parent
.
verticalCenter
verticalCenter
:
parent
.
verticalCenter
leftMargin
:
6
leftMargin
:
6
rightMargin
:
8
// verticalCenterOffset: -10
// verticalCenterOffset: -10
}
}
x
:
250
x
:
250
...
...
cmd/mist/assets/qml/views/browser.qml
View file @
7aef0fed
...
@@ -64,23 +64,15 @@ Rectangle {
...
@@ -64,23 +64,15 @@ Rectangle {
}
}
function
showFullUrlBar
(
on
){
function
showFullUrlBar
(
on
){
if
(
on
)
{
if
(
uriNav
.
focus
==
false
)
{
//appTitle.visible = false
if
(
on
==
false
)
{
//appDomain.visible = false
clickAnywhereOnApp
.
visible
=
false
navBar
.
state
=
"titleVisible"
//uriNav.visible = true
}
else
{
clickAnywhereOnApp
.
visible
=
true
clickAnywhereOnApp
.
visible
=
true
navBar
.
state
=
"fullUrlVisible"
navBar
.
state
=
"fullUrlVisible"
}
}
else
{
}
//appTitle.visible = true
//appDomain.visible = true
//uriNav.visible = false
clickAnywhereOnApp
.
visible
=
false
navBar
.
state
=
"titleVisible"
}
}
}
...
@@ -90,24 +82,40 @@ Rectangle {
...
@@ -90,24 +82,40 @@ Rectangle {
Item
{
Item
{
objectName
:
"root"
objectName
:
"root"
id
:
root
id
:
root
anchors.fill
:
parent
anchors
{
fill
:
parent
}
state
:
"inspectorShown"
state
:
"inspectorShown"
MouseArea
{
MouseArea
{
id
:
clickAnywhereOnApp
id
:
clickAnywhereOnApp
z
:
15
z
:
15
//hoverEnabled: true
// Using a secondary screen to catch on mouse exits for the area, because
anchors.fill
:
parent
// there are many hover actions conflicting
/*hoverEnabled: true*/
anchors
{
top
:
parent
.
top
topMargin
:
50
right
:
parent
.
right
bottom
:
parent
.
bottom
left
:
parent
.
left
}
hoverEnabled
:
true
on
Click
ed
:
{
on
Enter
ed
:
{
showFullUrlBar
(
false
);
showFullUrlBar
(
false
);
}
}
/*Rectangle {
onClicked
:
{
anchors.fill: parent
uriNav
.
focus
=
false
color: "#88888888"
showFullUrlBar
(
false
);
}*/
}
// Rectangle {
// anchors.fill: parent
// color: "#88888888"
// }
}
}
RowLayout
{
RowLayout
{
...
@@ -126,7 +134,7 @@ Rectangle {
...
@@ -126,7 +134,7 @@ Rectangle {
webview
.
goBack
()
webview
.
goBack
()
}
}
anchors
{
anchors
{
left
:
parent
.
left
left
:
parent
.
left
leftMargin
:
6
leftMargin
:
6
}
}
...
@@ -146,15 +154,17 @@ Rectangle {
...
@@ -146,15 +154,17 @@ Rectangle {
color
:
"#FFFFFF"
color
:
"#FFFFFF"
radius
:
6
radius
:
6
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
z
:
10
z
:
10
hoverEnabled
:
true
hoverEnabled
:
true
onEntered
:
{
onEntered
:
{
showFullUrlBar
(
true
);
showFullUrlBar
(
true
);
}
}
/*onExited: {
showFullUrlBar(false);
}*/
}
}
...
@@ -171,14 +181,15 @@ Rectangle {
...
@@ -171,14 +181,15 @@ Rectangle {
font.bold
:
true
font.bold
:
true
font.capitalization
:
Font
.
AllUppercase
font.capitalization
:
Font
.
AllUppercase
horizontalAlignment
:
Text
.
AlignRight
horizontalAlignment
:
Text
.
AlignRight
verticalAlignment
:
Text
.
AlignVCenter
verticalAlignment
:
Text
.
AlignVCenter
elide
:
Text
.
ElideRight
anchors
{
anchors
{
left
:
parent
.
left
left
:
parent
.
left
right
:
parent
.
horizontalCenter
right
:
parent
.
horizontalCenter
top
:
parent
.
top
top
:
parent
.
top
bottom
:
parent
.
bottom
bottom
:
parent
.
bottom
rightMargin
:
10
leftMargin
:
32
}
}
color
:
"#928484"
color
:
"#928484"
}
}
...
@@ -189,13 +200,15 @@ Rectangle {
...
@@ -189,13 +200,15 @@ Rectangle {
font.bold
:
false
font.bold
:
false
horizontalAlignment
:
Text
.
AlignLeft
horizontalAlignment
:
Text
.
AlignLeft
verticalAlignment
:
Text
.
AlignVCenter
verticalAlignment
:
Text
.
AlignVCenter
elide
:
Text
.
ElideLeft
anchors
{
anchors
{
left
:
parent
.
horizontalCenter
left
:
parent
.
horizontalCenter
right
:
parent
.
right
right
:
parent
.
right
top
:
parent
.
top
top
:
parent
.
top
bottom
:
parent
.
bottom
bottom
:
parent
.
bottom
leftMargin
:
10
leftMargin
:
32
}
}
color
:
"#C0AFAF"
color
:
"#C0AFAF"
}
}
...
@@ -212,7 +225,7 @@ Rectangle {
...
@@ -212,7 +225,7 @@ Rectangle {
}
}
horizontalAlignment
:
Text
.
AlignHCenter
horizontalAlignment
:
Text
.
AlignHCenter
style
:
TextFieldStyle
{
style
:
TextFieldStyle
{
textColor
:
"#928484"
textColor
:
"#928484"
background
:
Rectangle
{
background
:
Rectangle
{
...
@@ -227,11 +240,6 @@ Rectangle {
...
@@ -227,11 +240,6 @@ Rectangle {
Keys.onReturnPressed
:
{
Keys.onReturnPressed
:
{
webview
.
url
=
this
.
text
;
webview
.
url
=
this
.
text
;
}
}
/* onFocusedChanged: {
if (focused) {
//uriNav.selectAll();
}
}*/
}
}
z
:
2
z
:
2
...
@@ -332,18 +340,19 @@ Rectangle {
...
@@ -332,18 +340,19 @@ Rectangle {
bottom
:
parent
.
bottom
bottom
:
parent
.
bottom
top
:
navBar
.
bottom
top
:
navBar
.
bottom
}
}
z
:
10
z
:
10
onLoadingChanged
:
{
onLoadingChanged
:
{
// this checks if your app has special header tags
if
(
loadRequest
.
status
==
WebEngineView
.
LoadSucceededStatus
)
{
if
(
loadRequest
.
status
==
WebEngineView
.
LoadSucceededStatus
)
{
webview
.
runJavaScript
(
"document.title"
,
function
(
pageTitle
)
{
webview
.
runJavaScript
(
"document.title"
,
function
(
pageTitle
)
{
menuItem
.
title
=
pageTitle
;
menuItem
.
title
=
pageTitle
;
});
});
//var topBarStyle
webView
.
runJavaScript
(
"document.querySelector(
\"
meta[name='ethereum-dapp-url-bar-style']
\"
).getAttribute(
\"
content
\"
)"
,
function
(
topBarStyle
){
webView
.
runJavaScript
(
"document.querySelector(
\"
meta[name='ethereum-dapp-url-bar-style']
\"
).getAttribute(
\"
content
\"
)"
,
function
(
topBarStyle
){
if
(
topBarStyle
==
"transparent"
)
{
if
(
topBarStyle
==
"transparent"
)
{
// Adjust for a transparent sidebar Dapp
// Adjust for a transparent sidebar Dapp
navBarBackground
.
visible
=
false
;
navBarBackground
.
visible
=
false
;
back
.
visible
=
false
;
back
.
visible
=
false
;
...
@@ -362,8 +371,13 @@ Rectangle {
...
@@ -362,8 +371,13 @@ Rectangle {
};
};
});
});
// webView.runJavaScript("document.querySelector(\"link[rel='icon']\").getAttribute(\"href\")", function(sideIcon){
// if(sideIcon){
// window.iconSource = "http://localhost:3000/whisper-icon@2x.png" //webview.url + sideIcon
// console.log(iconSource)
// };
// });
webview
.
runJavaScript
(
eth
.
readFile
(
"bignumber.min.js"
));
webview
.
runJavaScript
(
eth
.
readFile
(
"bignumber.min.js"
));
webview
.
runJavaScript
(
eth
.
readFile
(
"ethereum.js/dist/ethereum.js"
));
webview
.
runJavaScript
(
eth
.
readFile
(
"ethereum.js/dist/ethereum.js"
));
...
@@ -371,7 +385,7 @@ Rectangle {
...
@@ -371,7 +385,7 @@ Rectangle {
var
matches
=
cleanTitle
.
match
(
/^
[
a-z
]
*
\:\/\/([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
matches
=
cleanTitle
.
match
(
/^
[
a-z
]
*
\:\/\/([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
domain
=
matches
&&
matches
[
1
];
var
domain
=
matches
&&
matches
[
1
];
appDomain
.
text
=
domain
//webview.url.replace("a", "z")
appDomain
.
text
=
domain
appTitle
.
text
=
webview
.
title
appTitle
.
text
=
webview
.
title
showFullUrlBar
(
false
);
showFullUrlBar
(
false
);
...
...
cmd/mist/assets/qml/views/catalog.qml
View file @
7aef0fed
...
@@ -85,35 +85,21 @@ Rectangle {
...
@@ -85,35 +85,21 @@ Rectangle {
property
var
domain
:
"ethereum-dapp-catalog.meteor.com"
property
var
domain
:
"ethereum-dapp-catalog.meteor.com"
url
:
protocol
+
domain
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
:
{
onJavaScriptConsoleMessage
:
{
console
.
log
(
sourceID
+
":"
+
lineNumber
+
":"
+
JSON
.
stringify
(
message
));
console
.
log
(
sourceID
+
":"
+
lineNumber
+
":"
+
JSON
.
stringify
(
message
));
}
}
onNavigationRequested
:
{
onNavigationRequested
:
{
// this checks if the domain of the requested link is the same as the catalog's
// If it is, it opens on the same window, if it's not it opens a new tab
var
cleanTitle
=
request
.
url
.
toString
()
var
cleanTitle
=
request
.
url
.
toString
()
var
matches
=
cleanTitle
.
match
(
/^
[
a-z
]
*
\:\/\/([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
matches
=
cleanTitle
.
match
(
/^
[
a-z
]
*
\:\/\/([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
requestedDomain
=
matches
&&
matches
[
1
];
var
requestedDomain
=
matches
&&
matches
[
1
];
console
.
debug
(
"NavigationRequested: "
+
request
.
url
+
" navigationType="
+
request
.
navigationType
)
if
(
request
.
navigationType
==
0
){
if
(
request
.
navigationType
==
0
){
...
@@ -137,7 +123,7 @@ Rectangle {
...
@@ -137,7 +123,7 @@ Rectangle {
anchors
{
anchors
{
left
:
root
.
left
left
:
root
.
left
right
:
root
.
right
right
:
root
.
right
top
:
sizeGrip
.
bottom
top
:
root
.
top
bottom
:
root
.
bottom
bottom
:
root
.
bottom
}
}
...
...
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