mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-27 23:25:51 +00:00
Changed folder structure
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'" />
|
||||
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'" />
|
||||
<title>XRPL Wallet Tutorial (JavaScript / Electron)</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h3>Build a XRPL Wallet - Part 1/8</h3>
|
||||
Latest validated ledger index: <strong id="ledger-index"></strong>
|
||||
|
||||
</body>
|
||||
|
||||
<script src="1_renderer.js"></script>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,11 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
// Expose functionality from main process (aka. "backend") to be used by the renderer process(aka. "backend")
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
// By calling "onUpdateLedgerIndex" in the frontend process we can now attach a callback function to
|
||||
// by making onUpdateLedgerIndex available at the window level.
|
||||
// The subscribed function gets triggered whenever the backend process triggers the event 'update-ledger-index'
|
||||
onUpdateLedgerIndex: (callback) => {
|
||||
ipcRenderer.on('update-ledger-index', callback)
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
const ledgerIndexEl = document.getElementById('ledger-index')
|
||||
|
||||
// Here we define the callback function that performs the content update
|
||||
// whenever 'update-ledger-index' is called by the main process
|
||||
window.electronAPI.onUpdateLedgerIndex((_event, value) => {
|
||||
ledgerIndexEl.innerText = value
|
||||
})
|
||||
Reference in New Issue
Block a user