Skip to content

Commit 547406d

Browse files
committed
update
1 parent a4d47d8 commit 547406d

23 files changed

+39
-170
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ It also has a desktop version (desktop-app) for Linux, macOS, Windows and a mobi
5858
- [x] transactions list (with unconfirmed tx)
5959
- [x] show balances in USD
6060
- [x] specify Node RPC
61-
- [x] good UX & UI with 26 themes (20 light and 6 dark)
61+
- [x] good UX & UI with 10 themes (7 light and 3 dark)
6262

6363
------------
6464

@@ -122,6 +122,7 @@ Patches are welcome! If you would like to contribute, but don't know what to wor
122122
## Donations
123123

124124
If you'd like to buy me a beer, I won't complain. I will thank you! =)
125+
125126
BGL: [bgl1qlmzckh904vze03n0lwzptt5dkmvf2vj3ev4qm9](bgl:bgl1qlmzckh904vze03n0lwzptt5dkmvf2vj3ev4qm9)
126127

127128
------------

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"local-server": "IP=$npm_package_config_IP PORT=$npm_package_config_PORT node local-server.js",
1919
"start": "npm run eslint && npm run local-server",
2020
"build": "./build.sh $npm_package_config_DIST_FOLDER",
21-
"dist-start": "npm run build && DIST_FOLDER=$npm_package_config_DIST_FOLDER npm run local-server"
21+
"dist-start": "npm run build && DIST_FOLDER=$npm_package_config_DIST_FOLDER npm run local-server",
22+
"ngrok": "ngrok http $npm_package_config_PORT"
2223
},
2324
"husky": {
2425
"hooks": {

public/themes/cerulean.min.css

-12
This file was deleted.

public/themes/default.min.css

-6
This file was deleted.

public/themes/journal.min.css

-12
This file was deleted.

public/themes/materia.min.css

-12
This file was deleted.

public/themes/minty.min.css

-12
This file was deleted.

public/themes/pulse.min.css

-12
This file was deleted.

public/themes/sandstone.min.css

-12
This file was deleted.

public/themes/simplex.min.css

-12
This file was deleted.

public/themes/solar.min.css

-12
This file was deleted.

public/themes/spacelab.min.css

-12
This file was deleted.

public/themes/superhero.min.css

-12
This file was deleted.

public/themes/united.min.css

-12
This file was deleted.

src/app.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ document.addEventListener('DOMContentLoaded', () => {
192192
});
193193

194194
if (localStorage.theme) {
195-
if ([ 'lux', 'quartz', 'morph', 'slate' ].indexOf(localStorage.theme) !== -1) localStorage.theme = 'flatly';
195+
if ([ 'cerulean', 'default', 'journal', 'lux', 'quartz', 'materia', 'minty', 'morph', 'pulse', 'sandstone', 'slate', 'simplex', 'spacelab', 'solar', 'superhero', 'united' ].indexOf(localStorage.theme) !== -1) localStorage.theme = 'lumen';
196196
$themeVal.value = localStorage.theme;
197197
trigger($themeVal, 'change');
198198
}
199-
else $themeVal.value = 'flatly';
199+
else $themeVal.value = 'lumen';
200200

201201
const currentYear = new Date().getFullYear();
202202

@@ -275,29 +275,17 @@ const trigger = (element, event) => {
275275

276276
const themes = {
277277
light: [
278-
'cerulean',
279278
'cosmo',
280-
'default',
281279
'flatly',
282-
'journal',
283280
'litera',
284281
'lumen',
285-
'materia',
286-
'minty',
287-
'pulse',
288-
'sandstone',
289-
'simplex',
290282
'sketchy',
291-
'spacelab',
292-
'united',
293283
'yeti',
294284
'zephyr',
295285
],
296286
dark: [
297287
'cyborg',
298288
'darkly',
299-
'solar',
300-
'superhero',
301289
'vapor',
302290
],
303291
};
@@ -308,6 +296,15 @@ const replacesInnerText = (...agrs) => {
308296

309297
const downloadHrefValue = (value) => `data:text/plain;charset=utf-8,${encodeURIComponent(value)}`;
310298

299+
const hideDataTablePagingIfOnlyOnePage = (oSettings) => {
300+
if ( ! oSettings) return;
301+
302+
const $paging = oSettings.nTableWrapper.querySelector('.dt-paging').closest('.row');
303+
304+
if (oSettings._iDisplayLength >= oSettings.fnRecordsDisplay()) hide($paging);
305+
else show($paging);
306+
};
307+
311308
window.navigateMobileMenu = () => {
312309
hide($dashboard, $myAddresses, $send, $setPassword, $welcome, $newAddress, $transactions, $createWallet, $exportWallet);
313310
show($main, $mobileMenu);
@@ -323,16 +320,20 @@ window.navigateMobileMenu = () => {
323320

324321
tempStorage.cryptoStorage = cryptoStorage;
325322

326-
const iv = await getItem('iv');
323+
let iv = await getItem('iv');
327324

328325
/* start temp crutch for those who have used the wallet before */
329326
if ( ! iv) {
330-
tempStorage = JSON.parse(tempStorage.cryptoStorage);
327+
const oldSchema = JSON.parse(tempStorage.cryptoStorage);
328+
tempStorage.iv = oldSchema.iv;
329+
tempStorage.cryptoStorage = oldSchema.encrypted;
331330

332331
if ( ! tempStorage.iv) {
333332
window.location.hash = 'set-password';
334333
return;
335334
}
335+
336+
iv = JSON.stringify(tempStorage.iv);
336337
}
337338
/* end temp crutch for those who have used the wallet before */
338339

src/custom.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ table.dataTable.collapsed>tbody>tr>th.dtr-control {
6565
filter: saturate(1);
6666
}
6767
.nav-pills .nav-link i {
68-
transform: scale(1.5);
68+
transform: scale(1.25);
6969
}

src/footer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626

2727
<script src="jsbgl.min.js"></script>
2828
<script src="coinmarketcap-coin-ticker-widget.js"></script>
29-
<script src="app.min.js?25"></script>
29+
<script src="app.min.js?26"></script>
3030
</body>
3131
</html>

src/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no">
6-
<link rel="stylesheet" href="themes/flatly.min.css" id="theme">
6+
<link rel="stylesheet" href="themes/lumen.min.css" id="theme">
77
<link rel="stylesheet" href="custom.min.css?8">
88

99
<title>Bitgesell Wallet</title>

src/main.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top">
88
<div class="container-fluid">
99
<a class="navbar-brand" href="#dashboard"><img class="d-inline-block align-top" src="logo-square.png?2" alt=""> Bitgesell Wallet</a>
10-
<ul class="navbar-nav gap-5" id="menu-items">
10+
<ul class="navbar-nav text-uppercase gap-5" id="menu-items">
1111
<li class="nav-item mx-sm-0 mx-xl-2 mx-xxl-5"><a class="nav-link fs-5 fw-bold" href="#my-addresses">My addresses</a></li>
1212
<li class="nav-item mx-sm-0 mx-xl-2 mx-xxl-5"><a class="nav-link fs-5 fw-bold" href="#send">Send</a></li>
1313
<!-- <li class="nav-item mx-sm-0 mx-xl-2 mx-xxl-5"><a class="nav-link fs-5 fw-bold" href="https://bglswap.com" target="_blank">Swap</a></li> -->
@@ -38,7 +38,7 @@
3838
</header>
3939

4040
<div class="modal" id="node-address-modal" tabindex="-1" role="dialog">
41-
<div class="modal-dialog" role="document">
41+
<div class="modal-dialog modal-dialog-centered" role="document">
4242
<div class="modal-content">
4343
<div class="modal-header">
4444
<h5 class="modal-title">Node RPC API address</h5>
@@ -58,7 +58,7 @@ <h5 class="modal-title">Node RPC API address</h5>
5858
</div>
5959

6060
<div class="modal" id="theme-modal" tabindex="-1" role="dialog" data-bs-backdrop="false">
61-
<div class="modal-dialog" role="document">
61+
<div class="modal-dialog modal-sm modal-dialog-centered" role="document">
6262
<div class="modal-content">
6363
<div class="modal-header">
6464
<h5 class="modal-title">Theme</h5>
@@ -67,12 +67,12 @@ <h5 class="modal-title">Theme</h5>
6767
<div class="modal-body">
6868
<form id="theme-form">
6969
<div class="input-group">
70-
<button class="btn btn-outline-primary" type="button" id="prev-theme">Previous</button>
70+
<button class="btn btn-outline-primary" type="button" id="prev-theme"></button>
7171
<select class="form-control" id="theme-val" name="theme" placeholder="Select theme" required="">
7272
<optgroup label="Light"></optgroup>
7373
<optgroup label="Dark"></optgroup>
7474
</select>
75-
<button class="btn btn-outline-primary" type="button" id="next-theme">Next</button>
75+
<button class="btn btn-outline-primary" type="button" id="next-theme"></button>
7676
</div>
7777
</form>
7878
</div>

src/my-addresses/my-addresses.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
<th></th>
1616
<th>#</th>
1717
<th>Address</th>
18-
<th>Balances</th>
18+
<th>Balance</th>
1919
<th>Usages</th>
2020
<th>Options</th>
2121
</tr>
2222
</thead>
2323
</table>
2424

2525
<div class="modal" id="qr-code-modal" tabindex="-1" role="dialog" data-bs-backdrop="true">
26-
<div class="modal-dialog" role="document">
26+
<div class="modal-dialog modal-dialog-centered" role="document">
2727
<div class="modal-content">
2828
<div class="modal-header">
2929
<h5 class="modal-title">Receive</h5>
@@ -48,7 +48,7 @@ <h5 class="modal-title">Receive</h5>
4848
</div>
4949

5050
<div class="modal" id="import-address-modal" tabindex="-1" role="dialog" data-bs-backdrop="true">
51-
<div class="modal-dialog" role="document">
51+
<div class="modal-dialog modal-dialog-centered" role="document">
5252
<div class="modal-content">
5353
<div class="modal-header">
5454
<h5 class="modal-title">Import address</h5>

src/my-addresses/my-addresses.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ document.addEventListener('DOMContentLoaded', () => {
1414

1515
const addressQRcode = generateQRCode($addressQrcode, 256);
1616

17-
window.addEventButtons = () => {
17+
window.addEventButtons = (oSettings) => {
1818
$myAddressesTable.querySelectorAll('.qr-code-btn').forEach(($btn) => {
1919
$btn.addEventListener('click', () => {
2020
addressQRcode.clear();
@@ -30,6 +30,8 @@ document.addEventListener('DOMContentLoaded', () => {
3030
copyToBuffer($input);
3131
});
3232
});
33+
34+
hideDataTablePagingIfOnlyOnePage(oSettings);
3335
};
3436

3537
const optionsButtonHtml = (address) => (

src/transactions/transactions.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ document.addEventListener('DOMContentLoaded', () => {
5757
`<a class="btn btn-warning btn-sm d-inline-flex" target="_blank" href="https://bgl.bitaps.com/${data}"><i class="fa-solid fa-binoculars mt-1"></i><span class="hidden-sr ms-1">Explorer</span></a>`
5858
), className: 'd-flex justify-content-end' },
5959
],
60-
drawCallback: () => {
60+
drawCallback: (oSettings) => {
6161
$transactionsTable.querySelectorAll('input').forEach(($input) => {
6262
$input.addEventListener('click', () => copyToBuffer($input));
6363
});
64+
65+
hideDataTablePagingIfOnlyOnePage(oSettings);
6466
},
6567
}),
6668
)

src/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const dataTableParams = {
5858
searching: false,
5959
serverSide: false,
6060
ajax: '',
61-
stateSave: true,
61+
stateSave: false,
6262
};
6363

6464
const dateTimeFormat = (timestamp) => {

0 commit comments

Comments
 (0)