Gav Wood
10 years ago
21 changed files with 390 additions and 110 deletions
@ -0,0 +1,5 @@ |
|||
<RCC> |
|||
<qresource prefix="/"> |
|||
<file alias="qml/WebPreview.qml">qml/WebPreviewStub.qml</file> |
|||
</qresource> |
|||
</RCC> |
@ -0,0 +1,15 @@ |
|||
import QtQuick 2.0 |
|||
import QtQuick.Window 2.0 |
|||
import QtQuick.Layouts 1.0 |
|||
import QtQuick.Controls 1.0 |
|||
import QtQuick.Controls.Styles 1.1 |
|||
|
|||
Item { |
|||
id: webPreview |
|||
Text { |
|||
anchors.fill: parent |
|||
horizontalAlignment: Text.AlignHCenter |
|||
verticalAlignment: Text.AlignVCenter |
|||
text: qsTr("Web preview is not supported in this build"); |
|||
} |
|||
} |
@ -0,0 +1,43 @@ |
|||
<!doctype html> |
|||
<html> |
|||
<head> |
|||
<script src="qrc:///js/es6-promise-2.0.0.js"></script> |
|||
<script src="qrc:///js/bignumber.min.js"></script> |
|||
<script src="qrc:///js/webthree.js"></script> |
|||
<script> |
|||
loadPage = function(url) { |
|||
var preview = document.getElementById('preview'); |
|||
preview.src = url; |
|||
|
|||
}; |
|||
|
|||
reloadPage = function() { |
|||
var preview = document.getElementById('preview'); |
|||
preview.contentWindow.location.reload(); |
|||
}; |
|||
|
|||
updateContract = function(address, definition) { |
|||
if (window.web3) { |
|||
window.contractAddress = address; |
|||
window.contractDefinition = definition; |
|||
window.contract = window.web3.eth.contract(address, definition); |
|||
} |
|||
}; |
|||
|
|||
init = function(url) { |
|||
web3 = require('web3'); |
|||
web3.setProvider(new web3.providers.WebSocketProvider(url)); |
|||
window.web3 = web3; |
|||
}; |
|||
|
|||
</script> |
|||
|
|||
<style> |
|||
body { |
|||
margin: 0; |
|||
} |
|||
</style> |
|||
|
|||
</head> |
|||
<body><iframe src="" name="preview" id="preview" style="border: 0; width: 100%; height: 100%"></iframe></body> |
|||
</html> |
@ -0,0 +1,6 @@ |
|||
<RCC> |
|||
<qresource prefix="/"> |
|||
<file>qml/WebPreview.qml</file> |
|||
<file>qml/html/WebContainer.html</file> |
|||
</qresource> |
|||
</RCC> |
Loading…
Reference in new issue