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
07c34751
Commit
07c34751
authored
Feb 19, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #335 from alexvandesande/ui
Cut, Copy, Undo and Redo working in webview
parents
4322632c
acd93c29
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
23 deletions
+26
-23
mist.js
cmd/mist/assets/ext/mist.js
+8
-6
main.qml
cmd/mist/assets/qml/main.qml
+5
-1
browser.qml
cmd/mist/assets/qml/views/browser.qml
+6
-4
catalog.qml
cmd/mist/assets/qml/views/catalog.qml
+7
-12
No files found.
cmd/mist/assets/ext/mist.js
View file @
07c34751
...
@@ -20,16 +20,18 @@
...
@@ -20,16 +20,18 @@
console
.
log
(
"loaded?"
);
console
.
log
(
"loaded?"
);
document
.
onkeydown
=
function
(
evt
)
{
document
.
onkeydown
=
function
(
evt
)
{
// This functions keeps track of keyboard inputs in order to allow copy, paste and other features
evt
=
evt
||
window
.
event
;
evt
=
evt
||
window
.
event
;
if
(
evt
.
ctrlKey
&&
evt
.
keyCode
==
67
)
{
if
(
evt
.
ctrlKey
&&
evt
.
keyCode
==
67
)
{
window
.
document
.
execCommand
(
"copy"
);
window
.
document
.
execCommand
(
"copy"
);
console
.
log
(
"Ctrl-C"
);
}
else
if
(
evt
.
ctrlKey
&&
evt
.
keyCode
==
88
)
{
}
else
if
(
evt
.
ctrlKey
&&
evt
.
keyCode
==
88
)
{
window
.
document
.
execCommand
(
"cut"
);
window
.
document
.
execCommand
(
"cut"
);
console
.
log
(
"Ctrl-X"
);
}
else
if
(
evt
.
ctrlKey
&&
evt
.
keyCode
==
86
)
{
}
if
(
evt
.
ctrlKey
&&
evt
.
keyCode
==
86
)
{
window
.
document
.
execCommand
(
"paste"
);
console
.
log
(
"Ctrl-V"
);
}
else
if
(
evt
.
ctrlKey
&&
evt
.
keyCode
==
90
)
{
}
if
(
evt
.
ctrlKey
&&
evt
.
keyCode
==
90
)
{
window
.
document
.
execCommand
(
"undo"
);
console
.
log
(
"Ctrl-Z"
);
}
else
if
(
evt
.
ctrlKey
&&
evt
.
shiftKey
&&
evt
.
keyCode
==
90
)
{
window
.
document
.
execCommand
(
"redo"
);
}
}
};
};
\ No newline at end of file
cmd/mist/assets/qml/main.qml
View file @
07c34751
...
@@ -131,7 +131,11 @@ ApplicationWindow {
...
@@ -131,7 +131,11 @@ ApplicationWindow {
var
existingDomain
=
matches
&&
matches
[
1
];
var
existingDomain
=
matches
&&
matches
[
1
];
if
(
requestedDomain
==
existingDomain
)
{
if
(
requestedDomain
==
existingDomain
)
{
domainAlreadyOpen
=
true
;
domainAlreadyOpen
=
true
;
mainSplit
.
views
[
i
].
view
.
url
=
url
;
if
(
mainSplit
.
views
[
i
].
view
.
url
!=
url
){
mainSplit
.
views
[
i
].
view
.
url
=
url
;
}
activeView
(
mainSplit
.
views
[
i
].
view
,
mainSplit
.
views
[
i
].
menuItem
);
activeView
(
mainSplit
.
views
[
i
].
view
,
mainSplit
.
views
[
i
].
menuItem
);
}
}
}
}
...
...
cmd/mist/assets/qml/views/browser.qml
View file @
07c34751
...
@@ -3,7 +3,7 @@ import QtQuick.Controls 1.0;
...
@@ -3,7 +3,7 @@ import QtQuick.Controls 1.0;
import
QtQuick
.
Controls
.
Styles
1.0
import
QtQuick
.
Controls
.
Styles
1.0
import
QtQuick
.
Layouts
1.0
;
import
QtQuick
.
Layouts
1.0
;
import
QtWebEngine
1.0
import
QtWebEngine
1.0
//
import QtWebEngine.experimental 1.0
import
QtWebEngine
.
experimental
1.0
import
QtQuick
.
Window
2.0
;
import
QtQuick
.
Window
2.0
;
Rectangle
{
Rectangle
{
...
@@ -340,7 +340,7 @@ Rectangle {
...
@@ -340,7 +340,7 @@ Rectangle {
WebEngineView
{
WebEngineView
{
objectName
:
"webView"
objectName
:
"webView"
id
:
webview
id
:
webview
//
experimental.settings.javascriptCanAccessClipboard: true
experimental.settings.javascriptCanAccessClipboard
:
true
//experimental.settings.localContentCanAccessRemoteUrls: true
//experimental.settings.localContentCanAccessRemoteUrls: true
anchors
{
anchors
{
left
:
parent
.
left
left
:
parent
.
left
...
@@ -399,7 +399,8 @@ Rectangle {
...
@@ -399,7 +399,8 @@ Rectangle {
onLoadingChanged
:
{
onLoadingChanged
:
{
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
;
});
});
...
@@ -441,7 +442,8 @@ Rectangle {
...
@@ -441,7 +442,8 @@ Rectangle {
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"
));
webview
.
runJavaScript
(
eth
.
readFile
(
"mist.js"
));
var
cleanTitle
=
webview
.
url
.
toString
()
var
cleanTitle
=
webview
.
url
.
toString
()
var
matches
=
cleanTitle
.
match
(
/^
[
a-z
]
*
\:\/\/([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
matches
=
cleanTitle
.
match
(
/^
[
a-z
]
*
\:\/\/([^\/
?#
]
+
)(?:[\/
?#
]
|$
)
/i
);
var
domain
=
matches
&&
matches
[
1
];
var
domain
=
matches
&&
matches
[
1
];
...
...
cmd/mist/assets/qml/views/catalog.qml
View file @
07c34751
...
@@ -3,7 +3,7 @@ import QtQuick.Controls 1.0;
...
@@ -3,7 +3,7 @@ import QtQuick.Controls 1.0;
import
QtQuick
.
Controls
.
Styles
1.0
import
QtQuick
.
Controls
.
Styles
1.0
import
QtQuick
.
Layouts
1.0
;
import
QtQuick
.
Layouts
1.0
;
import
QtWebEngine
1.0
import
QtWebEngine
1.0
//
import QtWebEngine.experimental 1.0
import
QtWebEngine
.
experimental
1.0
import
QtQuick
.
Window
2.0
;
import
QtQuick
.
Window
2.0
;
...
@@ -21,8 +21,6 @@ Rectangle {
...
@@ -21,8 +21,6 @@ Rectangle {
property
alias
windowTitle
:
webview
.
title
property
alias
windowTitle
:
webview
.
title
property
alias
webView
:
webview
property
alias
webView
:
webview
property
var
cleanPath
:
false
property
var
cleanPath
:
false
property
var
open
:
function
(
url
)
{
property
var
open
:
function
(
url
)
{
if
(
!
window
.
cleanPath
)
{
if
(
!
window
.
cleanPath
)
{
...
@@ -66,9 +64,6 @@ Rectangle {
...
@@ -66,9 +64,6 @@ Rectangle {
}
}
}
}
Component.onCompleted
:
{
}
Item
{
Item
{
objectName
:
"root"
objectName
:
"root"
id
:
root
id
:
root
...
@@ -85,7 +80,7 @@ Rectangle {
...
@@ -85,7 +80,7 @@ Rectangle {
property
var
domain
:
"ethereum-dapp-catalog.meteor.com"
property
var
domain
:
"ethereum-dapp-catalog.meteor.com"
url
:
protocol
+
domain
url
:
protocol
+
domain
//
experimental.settings.javascriptCanAccessClipboard: true
experimental.settings.javascriptCanAccessClipboard
:
true
onJavaScriptConsoleMessage
:
{
onJavaScriptConsoleMessage
:
{
...
@@ -112,11 +107,11 @@ Rectangle {
...
@@ -112,11 +107,11 @@ Rectangle {
}
}
}
}
//
onLoadingChanged: {
onLoadingChanged
:
{
//
if (loadRequest.status == WebEngineView.LoadSucceededStatus) {
if
(
loadRequest
.
status
==
WebEngineView
.
LoadSucceededStatus
)
{
//
webview.runJavaScript(eth.readFile("mist.js"));
webview
.
runJavaScript
(
eth
.
readFile
(
"mist.js"
));
//
}
}
//
}
}
}
}
...
...
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