@@ -336,63 +343,12 @@ class Chat extends LitElement {
`
}
- renderChatWelcomePage() {
- return html` `
- }
-
- renderChatHead(chatHeadArr) {
-
- let tempUrl = document.location.href
- let splitedUrl = decodeURI(tempUrl).split('?')
- let activeChatHeadUrl = splitedUrl[1] === undefined ? '' : splitedUrl[1]
-
- return chatHeadArr.map(eachChatHead => {
- return html` `
- })
- }
-
- renderChatPage(chatId) {
- // Check for the chat ID from and render chat messages
- // Else render Welcome to Q-CHat
-
- // TODO: DONE: Do the above in the ChatPage
-
- return html` `
- }
-
- setChatHeads(chatObj) {
-
- let groupList = chatObj.groups.map(group => group.groupId === 0 ? { groupId: group.groupId, url: `group/${group.groupId}`, groupName: "Qortal General Chat", timestamp: group.timestamp === undefined ? 2 : group.timestamp } : { ...group, timestamp: group.timestamp === undefined ? 1 : group.timestamp, url: `group/${group.groupId}` })
- let directList = chatObj.direct.map(dc => {
- return { ...dc, url: `direct/${dc.address}` }
- })
- const compareNames = (a, b) => {
- return a.groupName.localeCompare(b.groupName)
- }
- groupList.sort(compareNames)
- let chatHeadMasterList = [...groupList, ...directList]
-
- const compareArgs = (a, b) => {
- return b.timestamp - a.timestamp
- }
-
- this.chatHeads = chatHeadMasterList.sort(compareArgs)
- }
-
- getChatHeadFromState(chatObj) {
-
- if (chatObj === undefined) {
- return
- } else {
-
- this.chatHeadsObj = chatObj
- this.setChatHeads(chatObj)
- }
- }
-
-
firstUpdated() {
+ setInterval(() => {
+ this.changeTheme();
+ }, 250)
+
const stopKeyEventPropagation = (e) => {
e.stopPropagation();
return false;
@@ -455,6 +411,7 @@ class Chat extends LitElement {
}
let configLoaded = false
+
parentEpml.ready().then(() => {
parentEpml.subscribe('selected_address', async selectedAddress => {
this.selectedAddress = {}
@@ -485,10 +442,73 @@ class Chat extends LitElement {
}
})
})
-
parentEpml.imReady()
}
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ if (checkTheme === 'dark') {
+ this.theme = 'dark';
+ } else {
+ this.theme = 'light';
+ }
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
+ renderChatWelcomePage() {
+ return html` `
+ }
+
+ renderChatHead(chatHeadArr) {
+
+ let tempUrl = document.location.href
+ let splitedUrl = decodeURI(tempUrl).split('?')
+ let activeChatHeadUrl = splitedUrl[1] === undefined ? '' : splitedUrl[1]
+
+ return chatHeadArr.map(eachChatHead => {
+ return html` `
+ })
+ }
+
+ renderChatPage(chatId) {
+ // Check for the chat ID from and render chat messages
+ // Else render Welcome to Q-CHat
+
+ // TODO: DONE: Do the above in the ChatPage
+
+ return html` `
+ }
+
+ setChatHeads(chatObj) {
+
+ let groupList = chatObj.groups.map(group => group.groupId === 0 ? { groupId: group.groupId, url: `group/${group.groupId}`, groupName: "Qortal General Chat", timestamp: group.timestamp === undefined ? 2 : group.timestamp } : { ...group, timestamp: group.timestamp === undefined ? 1 : group.timestamp, url: `group/${group.groupId}` })
+ let directList = chatObj.direct.map(dc => {
+ return { ...dc, url: `direct/${dc.address}` }
+ })
+ const compareNames = (a, b) => {
+ return a.groupName.localeCompare(b.groupName)
+ }
+ groupList.sort(compareNames)
+ let chatHeadMasterList = [...groupList, ...directList]
+
+ const compareArgs = (a, b) => {
+ return b.timestamp - a.timestamp
+ }
+
+ this.chatHeads = chatHeadMasterList.sort(compareArgs)
+ }
+
+ getChatHeadFromState(chatObj) {
+
+ if (chatObj === undefined) {
+ return
+ } else {
+
+ this.chatHeadsObj = chatObj
+ this.setChatHeads(chatObj)
+ }
+ }
+
_sendMessage() {
this.isLoading = true
diff --git a/qortal-ui-plugins/plugins/core/minting/index.html b/qortal-ui-plugins/plugins/core/minting/index.html
index 5b664c0f..672750a0 100644
--- a/qortal-ui-plugins/plugins/core/minting/index.html
+++ b/qortal-ui-plugins/plugins/core/minting/index.html
@@ -3,6 +3,7 @@
+
diff --git a/qortal-ui-plugins/plugins/core/minting/minting-info.src.js b/qortal-ui-plugins/plugins/core/minting/minting-info.src.js
index fd5a8895..74a8c66d 100644
--- a/qortal-ui-plugins/plugins/core/minting/minting-info.src.js
+++ b/qortal-ui-plugins/plugins/core/minting/minting-info.src.js
@@ -18,7 +18,8 @@ class MintingInfo extends LitElement {
nodeInfo: { type: Array },
sampleBlock: { type: Array },
addressInfo: { type: Array },
- addressLevel: { type: Array }
+ addressLevel: { type: Array },
+ theme: { type: String, reflect: true }
}
}
@@ -45,14 +46,14 @@ class MintingInfo extends LitElement {
font-weight:600;
font-size:20px;
line-height: 28px;
- color:#000000;
+ color: var(--black);
}
.header-title {
display: block;
overflow: hidden;
font-size: 40px;
- color: black;
+ color: var(--black);
font-weight: 400;
text-align: center;
white-space: pre-wrap;
@@ -64,7 +65,7 @@ class MintingInfo extends LitElement {
.level-black {
font-size: 32px;
- color: black;
+ color: var(--black);
font-weight: 400;
text-align: center;
margin-top: 2rem;
@@ -165,7 +166,7 @@ class MintingInfo extends LitElement {
}
.black {
- color: #000000;
+ color: var(--black);
}
.red {
@@ -192,6 +193,7 @@ class MintingInfo extends LitElement {
this.sampleBlock = [];
this.addressInfo = [];
this.addressLevel = [];
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light';
}
render() {
@@ -238,10 +240,10 @@ class MintingInfo extends LitElement {
Introduction
- To "activate" your account, an OUTGOING transaction needs to take place.
- Name Registration is the most common method. You can ask someone in Q-Chat to send you a small amount of QORT so that you may activate your account,
- or buy QORT within the Trade Portal then make an OUTGOING transaction of any kind and secure your public key on the blockchain.
- Until you do this, your public key is only known by you, in your UI, and no one else can pull your public key from the chain.
+ To "activate" your account, an OUTGOING transaction needs to take place.
+ Name Registration is the most common method. You can ask someone in Q-Chat to send you a small amount of QORT so that you may activate your account,
+ or buy QORT within the Trade Portal then make an OUTGOING transaction of any kind and secure your public key on the blockchain.
+ Until you do this, your public key is only known by you, in your UI, and no one else can pull your public key from the chain.
Close
@@ -355,6 +357,11 @@ class MintingInfo extends LitElement {
}
firstUpdated() {
+
+ setInterval(() => {
+ this.changeTheme();
+ }, 100)
+
const getAdminInfo = () => {
parentEpml.request("apiCall", { url: `/admin/info` }).then((res) => {
setTimeout(() => { this.adminInfo = res; }, 1);
@@ -422,6 +429,16 @@ class MintingInfo extends LitElement {
parentEpml.imReady();
}
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ if (checkTheme === 'dark') {
+ this.theme = 'dark';
+ } else {
+ this.theme = 'light';
+ }
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
renderMintingPage() {
if (this.addressInfo.error === 124) {
return "false"
diff --git a/qortal-ui-plugins/plugins/core/name-registration/index.html b/qortal-ui-plugins/plugins/core/name-registration/index.html
index 879ea894..d30c4598 100644
--- a/qortal-ui-plugins/plugins/core/name-registration/index.html
+++ b/qortal-ui-plugins/plugins/core/name-registration/index.html
@@ -3,6 +3,7 @@
+
diff --git a/qortal-ui-plugins/plugins/core/name-registration/name-registration.src.js b/qortal-ui-plugins/plugins/core/name-registration/name-registration.src.js
index 3233e63f..66ddc9a2 100644
--- a/qortal-ui-plugins/plugins/core/name-registration/name-registration.src.js
+++ b/qortal-ui-plugins/plugins/core/name-registration/name-registration.src.js
@@ -23,7 +23,8 @@ class NameRegistration extends LitElement {
error: { type: Boolean },
message: { type: String },
removeError: { type: Boolean },
- removeMessage: { type: String }
+ removeMessage: { type: String },
+ theme: { type: String, reflect: true }
}
}
@@ -37,9 +38,14 @@ class NameRegistration extends LitElement {
--lumo-primary-color-50pct: rgba(0, 167, 245, 0.5);
--lumo-primary-color-10pct: rgba(0, 167, 245, 0.1);
--lumo-primary-color: hsl(199, 100%, 48%);
+ --lumo-base-color: var(--white);
+ --lumo-body-text-color: var(--black);
+ --_lumo-grid-border-color: var(--border);
+ --_lumo-grid-secondary-border-color: var(--border2);
}
+
#name-registration-page {
- background: #fff;
+ background: var(--white);
padding: 12px 24px;
}
@@ -54,7 +60,7 @@ class NameRegistration extends LitElement {
}
h2, h3, h4, h5 {
- color:#333;
+ color: var(--black);
font-weight: 400;
}
@@ -79,6 +85,7 @@ class NameRegistration extends LitElement {
this.btnDisable = false
this.registerNameLoading = false
this.fee = 0.001
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
}
render() {
@@ -102,7 +109,7 @@ class NameRegistration extends LitElement {
}}>
${this.isEmptyArray(this.names) ? html`
- No names registered by this account!
+
No names registered by this account!
`: ''}
@@ -151,6 +158,11 @@ class NameRegistration extends LitElement {
}
firstUpdated() {
+
+ setInterval(() => {
+ this.changeTheme();
+ }, 100)
+
this.unitFee();
window.addEventListener("contextmenu", (event) => {
@@ -202,6 +214,16 @@ class NameRegistration extends LitElement {
parentEpml.imReady()
}
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ if (checkTheme === 'dark') {
+ this.theme = 'dark';
+ } else {
+ this.theme = 'light';
+ }
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
renderAvatar(nameObj) {
let name = nameObj.name
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
diff --git a/qortal-ui-plugins/plugins/core/node-management/index.html b/qortal-ui-plugins/plugins/core/node-management/index.html
index a1a60432..9661cdc9 100644
--- a/qortal-ui-plugins/plugins/core/node-management/index.html
+++ b/qortal-ui-plugins/plugins/core/node-management/index.html
@@ -3,6 +3,7 @@
+
diff --git a/qortal-ui-plugins/plugins/core/node-management/node-management.src.js b/qortal-ui-plugins/plugins/core/node-management/node-management.src.js
index 83bf989d..9915a034 100644
--- a/qortal-ui-plugins/plugins/core/node-management/node-management.src.js
+++ b/qortal-ui-plugins/plugins/core/node-management/node-management.src.js
@@ -7,8 +7,7 @@ import '@material/mwc-icon'
import '@material/mwc-textfield'
import '@material/mwc-button'
import '@material/mwc-dialog'
-import '@vaadin/grid/vaadin-grid.js'
-import '@vaadin/grid/theme/material/all-imports.js'
+import '@vaadin/grid'
const parentEpml = new Epml({ type: "WINDOW", source: window.parent })
@@ -31,7 +30,8 @@ class NodeManagement extends LitElement {
removeMintingAccountMessage: { type: String },
tempMintingAccount: { type: Object },
nodeConfig: { type: Object },
- nodeDomain: { type: String }
+ nodeDomain: { type: String },
+ theme: { type: String, reflect: true }
};
}
@@ -44,6 +44,12 @@ class NodeManagement extends LitElement {
--lumo-primary-color-50pct: rgba(0, 167, 245, 0.5);
--lumo-primary-color-10pct: rgba(0, 167, 245, 0.1);
--lumo-primary-color: hsl(199, 100%, 48%);
+ --lumo-base-color: var(--white);
+ --lumo-body-text-color: var(--black);
+ --lumo-secondary-text-color: var(--sectxt);
+ --lumo-contrast-60pct: var(--vdicon);
+ --_lumo-grid-border-color: var(--border);
+ --_lumo-grid-secondary-border-color: var(--border2);
}
paper-spinner-lite {
@@ -54,7 +60,7 @@ class NodeManagement extends LitElement {
}
#node-management-page {
- background: #fff;
+ background: var(--white);
}
mwc-textfield {
@@ -77,7 +83,7 @@ class NodeManagement extends LitElement {
.node-card {
padding: 12px 24px;
- background: #fff;
+ background: var(--white);
border-radius: 2px;
box-shadow: 11;
}
@@ -90,10 +96,14 @@ class NodeManagement extends LitElement {
h3,
h4,
h5 {
- color: #333;
+ color: var(--black);
font-weight: 400;
}
+ .sblack {
+ color: var(--black);
+ }
+
[hidden] {
display: hidden !important;
visibility: none !important;
@@ -127,6 +137,7 @@ class NodeManagement extends LitElement {
};
this.nodeConfig = {};
this.nodeDomain = "";
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light';
}
render() {
@@ -134,7 +145,7 @@ class NodeManagement extends LitElement {
Node management for: ${this.nodeDomain}
-
Node has been online for: ${this.upTime}
+
Node has been online for: ${this.upTime}
@@ -212,8 +223,7 @@ class NodeManagement extends LitElement {
render(html` this.removeMintingAccount(data.item.publicKey)}>create Remove `, root)
}}>
-
- ${this.isEmptyArray(this.mintingAccounts) ? html` No minting accounts found for this node ` : ""}
+ ${this.isEmptyArray(this.mintingAccounts) ? html`No minting accounts found for this node ` : ""}
@@ -267,7 +277,7 @@ class NodeManagement extends LitElement {
}}>
- ${this.isEmptyArray(this.peers) ? html` Node has no connected peers ` : ""}
+ ${this.isEmptyArray(this.peers) ? html`
Node has no connected peers ` : ""}
@@ -275,6 +285,113 @@ class NodeManagement extends LitElement {
`;
}
+ firstUpdated() {
+
+ setInterval(() => {
+ this.changeTheme();
+ }, 100)
+
+ // Call updateMintingAccounts
+ this.updateMintingAccounts();
+
+ window.addEventListener("contextmenu", (event) => {
+ event.preventDefault();
+ this._textMenu(event)
+ });
+ window.addEventListener("click", () => {
+ parentEpml.request('closeCopyTextMenu', null)
+ });
+ window.onkeyup = (e) => {
+ if (e.keyCode === 27) parentEpml.request('closeCopyTextMenu', null)
+ }
+
+ // Calculate HH MM SS from Milliseconds...
+ const convertMsToTime = (milliseconds) => {
+ let day, hour, minute, seconds;
+ seconds = Math.floor(milliseconds / 1000);
+ minute = Math.floor(seconds / 60);
+ seconds = seconds % 60;
+ hour = Math.floor(minute / 60);
+ minute = minute % 60;
+ day = Math.floor(hour / 24);
+ hour = hour % 24;
+ if (isNaN(day)) {
+ return "offline";
+ }
+ return day + "d " + hour + "h " + minute + "m";
+ };
+
+ const getNodeUpTime = () => {
+ parentEpml
+ .request("apiCall", {
+ url: `/admin/uptime`,
+ })
+ .then((res) => {
+ this.upTime = "";
+ setTimeout(() => {
+ this.upTime = convertMsToTime(res);
+ }, 1);
+ });
+
+ setTimeout(getNodeUpTime, this.config.user.nodeSettings.pingInterval);
+ };
+
+ const updatePeers = () => {
+ parentEpml
+ .request("apiCall", {
+ url: `/peers`,
+ })
+ .then((res) => {
+ setTimeout(() => {
+ this.peers = res;
+ }, 1);
+ });
+
+ setTimeout(updatePeers, this.config.user.nodeSettings.pingInterval);
+ };
+
+ const getNodeConfig = () => {
+ parentEpml.request("getNodeConfig").then((res) => {
+ setTimeout(() => {
+ this.nodeConfig = res;
+ }, 1);
+ let myNode = window.parent.reduxStore.getState().app.nodeConfig
+ .knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
+ this.nodeDomain = myNode.domain + ":" + myNode.port;
+ });
+
+ setTimeout(getNodeConfig, 1000);
+ };
+
+ let configLoaded = false;
+ parentEpml.ready().then(() => {
+ parentEpml.subscribe("config", async c => {
+ if (!configLoaded) {
+ setTimeout(getNodeUpTime, 1);
+ setTimeout(updatePeers, 1);
+ setTimeout(this.updateMintingAccounts, 1);
+ setTimeout(getNodeConfig, 1);
+ configLoaded = true;
+ }
+ this.config = JSON.parse(c);
+ })
+ parentEpml.subscribe('copy_menu_switch', async value => {
+ if (value === 'false' && window.getSelection().toString().length !== 0) this.clearSelection();
+ })
+ });
+ parentEpml.imReady();
+ }
+
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ if (checkTheme === 'dark') {
+ this.theme = 'dark';
+ } else {
+ this.theme = 'light';
+ }
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
forceSyncPeer(peerAddress, rowIndex) {
parentEpml
.request("apiCall", {
@@ -403,99 +520,6 @@ class NodeManagement extends LitElement {
});
}
- firstUpdated() {
-
- // Call updateMintingAccounts
- this.updateMintingAccounts();
-
- window.addEventListener("contextmenu", (event) => {
- event.preventDefault();
- this._textMenu(event)
- });
- window.addEventListener("click", () => {
- parentEpml.request('closeCopyTextMenu', null)
- });
- window.onkeyup = (e) => {
- if (e.keyCode === 27) parentEpml.request('closeCopyTextMenu', null)
- }
-
- // Calculate HH MM SS from Milliseconds...
- const convertMsToTime = (milliseconds) => {
- let day, hour, minute, seconds;
- seconds = Math.floor(milliseconds / 1000);
- minute = Math.floor(seconds / 60);
- seconds = seconds % 60;
- hour = Math.floor(minute / 60);
- minute = minute % 60;
- day = Math.floor(hour / 24);
- hour = hour % 24;
- if (isNaN(day)) {
- return "offline";
- }
- return day + "d " + hour + "h " + minute + "m";
- };
-
- const getNodeUpTime = () => {
- parentEpml
- .request("apiCall", {
- url: `/admin/uptime`,
- })
- .then((res) => {
- this.upTime = "";
- setTimeout(() => {
- this.upTime = convertMsToTime(res);
- }, 1);
- });
-
- setTimeout(getNodeUpTime, this.config.user.nodeSettings.pingInterval);
- };
-
- const updatePeers = () => {
- parentEpml
- .request("apiCall", {
- url: `/peers`,
- })
- .then((res) => {
- setTimeout(() => {
- this.peers = res;
- }, 1);
- });
-
- setTimeout(updatePeers, this.config.user.nodeSettings.pingInterval);
- };
-
- const getNodeConfig = () => {
- parentEpml.request("getNodeConfig").then((res) => {
- setTimeout(() => {
- this.nodeConfig = res;
- }, 1);
- let myNode = window.parent.reduxStore.getState().app.nodeConfig
- .knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
- this.nodeDomain = myNode.domain + ":" + myNode.port;
- });
-
- setTimeout(getNodeConfig, 1000);
- };
-
- let configLoaded = false;
- parentEpml.ready().then(() => {
- parentEpml.subscribe("config", async c => {
- if (!configLoaded) {
- setTimeout(getNodeUpTime, 1);
- setTimeout(updatePeers, 1);
- setTimeout(this.updateMintingAccounts, 1);
- setTimeout(getNodeConfig, 1);
- configLoaded = true;
- }
- this.config = JSON.parse(c);
- })
- parentEpml.subscribe('copy_menu_switch', async value => {
- if (value === 'false' && window.getSelection().toString().length !== 0) this.clearSelection();
- })
- });
- parentEpml.imReady();
- }
-
getApiKey() {
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
let apiKey = myNode.apiKey;
diff --git a/qortal-ui-plugins/plugins/core/puzzles/index.html b/qortal-ui-plugins/plugins/core/puzzles/index.html
index 1b4000b5..9d4d8fbf 100644
--- a/qortal-ui-plugins/plugins/core/puzzles/index.html
+++ b/qortal-ui-plugins/plugins/core/puzzles/index.html
@@ -3,6 +3,7 @@
+
diff --git a/qortal-ui-plugins/plugins/core/puzzles/puzzles.src.js b/qortal-ui-plugins/plugins/core/puzzles/puzzles.src.js
index 6614348b..657c2af1 100644
--- a/qortal-ui-plugins/plugins/core/puzzles/puzzles.src.js
+++ b/qortal-ui-plugins/plugins/core/puzzles/puzzles.src.js
@@ -29,7 +29,8 @@ class Puzzles extends LitElement {
selectedAddress: { type: Object },
selectedPuzzle: { type: Object },
error: { type: Boolean },
- message: { type: String }
+ message: { type: String },
+ theme: { type: String, reflect: true }
}
}
@@ -43,9 +44,16 @@ class Puzzles extends LitElement {
--lumo-primary-color-50pct: rgba(0, 167, 245, 0.5);
--lumo-primary-color-10pct: rgba(0, 167, 245, 0.1);
--lumo-primary-color: hsl(199, 100%, 48%);
+ --lumo-base-color: var(--white);
+ --lumo-body-text-color: var(--black);
+ --lumo-secondary-text-color: var(--sectxt);
+ --lumo-contrast-60pct: var(--vdicon);
+ --_lumo-grid-border-color: var(--border);
+ --_lumo-grid-secondary-border-color: var(--border2);
}
+
#puzzle-page {
- background: #fff;
+ background: var(--white);
padding: 12px 24px;
}
@@ -54,7 +62,7 @@ class Puzzles extends LitElement {
}
h2, h3, h4, h5 {
- color:#333;
+ color: var(--black);
font-weight: 400;
}
@@ -66,6 +74,13 @@ class Puzzles extends LitElement {
font-family: "Lucida Console", "Courier New", monospace;
font-size: smaller;
}
+
+ .divCard {
+ border: 1px solid #eee;
+ padding: 1em;
+ box-shadow: 0 .3px 1px 0 rgba(0,0,0,0.14), 0 1px 1px -1px rgba(0,0,0,0.12), 0 1px 2px 0 rgba(0,0,0,0.20);
+ margin-bottom: 2em;
+ }
`
}
@@ -79,6 +94,7 @@ class Puzzles extends LitElement {
this.selectedPuzzle = {}
this.error = false
this.message = ''
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
}
render() {
@@ -154,6 +170,11 @@ class Puzzles extends LitElement {
}
firstUpdated() {
+
+ setInterval(() => {
+ this.changeTheme();
+ }, 100)
+
window.addEventListener("contextmenu", (event) => {
event.preventDefault();
this._textMenu(event)
@@ -342,6 +363,16 @@ class Puzzles extends LitElement {
})
}
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ if (checkTheme === 'dark') {
+ this.theme = 'dark';
+ } else {
+ this.theme = 'light';
+ }
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
async guessPuzzle(puzzle) {
this.selectedPuzzle = puzzle
this.shadowRoot.getElementById("puzzleGuess").value = ''
diff --git a/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js b/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js
index 38c921e1..87a9f11b 100644
--- a/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js
+++ b/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js
@@ -19,7 +19,8 @@ class WebBrowser extends LitElement {
service: { type: String },
identifier: { type: String },
followedNames: { type: Array },
- blockedNames: { type: Array }
+ blockedNames: { type: Array },
+ theme: { type: String, reflect: true }
}
}
@@ -49,7 +50,7 @@ class WebBrowser extends LitElement {
left: 0;
right: 0;
height: 100px;
- background-color: white;
+ background-color: var(--white);
height: 36px;
}
@@ -63,7 +64,7 @@ class WebBrowser extends LitElement {
left: 0;
right: 0;
bottom: 0;
- border-top: 1px solid #000000;
+ border-top: 1px solid var(--black);
}
.iframe-container iframe {
@@ -71,7 +72,7 @@ class WebBrowser extends LitElement {
width: 100%;
height: 100%;
border: none;
- background-color: #ffffff;
+ background-color: var(--white);
}
input[type=text] {
@@ -80,7 +81,7 @@ class WebBrowser extends LitElement {
border: 0;
height: 34px;
font-size: 16px;
- background-color: #ffffff;
+ background-color: var(--white);
}
paper-progress {
@@ -94,23 +95,105 @@ class WebBrowser extends LitElement {
`
}
+ constructor() {
+ super()
+ this.url = 'about:blank'
+
+ const urlParams = new URLSearchParams(window.location.search);
+ this.name = urlParams.get('name');
+ this.service = urlParams.get('service');
+ // FUTURE: add support for identifiers
+ this.identifier = null;
+ this.followedNames = []
+ this.blockedNames = []
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
+
+ const getFollowedNames = async () => {
+
+ let followedNames = await parentEpml.request('apiCall', {
+ url: `/lists/followedNames?apiKey=${this.getApiKey()}`
+ })
+
+ this.followedNames = followedNames
+ setTimeout(getFollowedNames, this.config.user.nodeSettings.pingInterval)
+ }
+
+ const getBlockedNames = async () => {
+
+ let blockedNames = await parentEpml.request('apiCall', {
+ url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
+ })
+
+ this.blockedNames = blockedNames
+ setTimeout(getBlockedNames, this.config.user.nodeSettings.pingInterval)
+ }
+
+ const render = () => {
+ const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
+ const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
+ this.url = `${nodeUrl}/render/${this.service}/${this.name}`;
+ }
+
+ const authorizeAndRender = () => {
+ parentEpml.request('apiCall', {
+ url: `/render/authorize/${this.name}?apiKey=${this.getApiKey()}`,
+ method: "POST"
+ }).then(res => {
+ console.log(res)
+ if (res.error) {
+ // Authorization problem - API key incorrect?
+ }
+ else {
+ render()
+ }
+ })
+ }
+
+ let configLoaded = false
+
+ parentEpml.ready().then(() => {
+ parentEpml.subscribe('selected_address', async selectedAddress => {
+ this.selectedAddress = {}
+ selectedAddress = JSON.parse(selectedAddress)
+ if (!selectedAddress || Object.entries(selectedAddress).length === 0) return
+ this.selectedAddress = selectedAddress
+ })
+ parentEpml.subscribe('config', c => {
+ this.config = JSON.parse(c)
+ if (!configLoaded) {
+ authorizeAndRender()
+ setTimeout(getFollowedNames, 1)
+ setTimeout(getBlockedNames, 1)
+ configLoaded = true
+ }
+ })
+ parentEpml.subscribe('copy_menu_switch', async value => {
+
+ if (value === 'false' && window.getSelection().toString().length !== 0) {
+
+ this.clearSelection()
+ }
+ })
+ })
+ }
+
render() {
return html`
-
+
@@ -118,6 +201,38 @@ class WebBrowser extends LitElement {
`
}
+ firstUpdated() {
+
+ setInterval(() => {
+ this.changeTheme();
+ }, 100)
+
+ window.addEventListener('contextmenu', (event) => {
+ event.preventDefault()
+ this._textMenu(event)
+ })
+
+ window.addEventListener('click', () => {
+ parentEpml.request('closeCopyTextMenu', null)
+ })
+
+ window.onkeyup = (e) => {
+ if (e.keyCode === 27) {
+ parentEpml.request('closeCopyTextMenu', null)
+ }
+ }
+ }
+
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ if (checkTheme === 'dark') {
+ this.theme = 'dark';
+ } else {
+ this.theme = 'light';
+ }
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
renderFollowUnfollowButton() {
// Only show the follow/unfollow button if we have permission to modify the list on this node
if (this.followedNames == null || !Array.isArray(this.followedNames)) {
@@ -357,105 +472,6 @@ class WebBrowser extends LitElement {
checkSelectedTextAndShowMenu()
}
- constructor() {
- super()
- this.url = 'about:blank'
-
- const urlParams = new URLSearchParams(window.location.search);
- this.name = urlParams.get('name');
- this.service = urlParams.get('service');
- // FUTURE: add support for identifiers
- this.identifier = null;
- this.followedNames = []
- this.blockedNames = []
-
-
- const getFollowedNames = async () => {
-
- let followedNames = await parentEpml.request('apiCall', {
- url: `/lists/followedNames?apiKey=${this.getApiKey()}`
- })
-
- this.followedNames = followedNames
- setTimeout(getFollowedNames, this.config.user.nodeSettings.pingInterval)
- }
-
- const getBlockedNames = async () => {
-
- let blockedNames = await parentEpml.request('apiCall', {
- url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
- })
-
- this.blockedNames = blockedNames
- setTimeout(getBlockedNames, this.config.user.nodeSettings.pingInterval)
- }
-
- const render = () => {
- const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
- const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
- this.url = `${nodeUrl}/render/${this.service}/${this.name}`;
- }
-
- const authorizeAndRender = () => {
- parentEpml.request('apiCall', {
- url: `/render/authorize/${this.name}?apiKey=${this.getApiKey()}`,
- method: "POST"
- }).then(res => {
- console.log(res)
- if (res.error) {
- // Authorization problem - API key incorrect?
- }
- else {
- render()
- }
- })
- }
-
- let configLoaded = false
- parentEpml.ready().then(() => {
- parentEpml.subscribe('selected_address', async selectedAddress => {
- this.selectedAddress = {}
- selectedAddress = JSON.parse(selectedAddress)
- if (!selectedAddress || Object.entries(selectedAddress).length === 0) return
- this.selectedAddress = selectedAddress
- })
- parentEpml.subscribe('config', c => {
- this.config = JSON.parse(c)
- if (!configLoaded) {
- authorizeAndRender()
- setTimeout(getFollowedNames, 1)
- setTimeout(getBlockedNames, 1)
- configLoaded = true
- }
- })
- parentEpml.subscribe('copy_menu_switch', async value => {
-
- if (value === 'false' && window.getSelection().toString().length !== 0) {
-
- this.clearSelection()
- }
- })
- })
- }
-
- firstUpdated() {
-
- window.addEventListener('contextmenu', (event) => {
- event.preventDefault()
- this._textMenu(event)
- })
-
- window.addEventListener('click', () => {
- parentEpml.request('closeCopyTextMenu', null)
- })
-
- window.onkeyup = (e) => {
- if (e.keyCode === 27) {
- parentEpml.request('closeCopyTextMenu', null)
- }
- }
- }
-
getApiKey() {
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
let apiKey = myNode.apiKey;
diff --git a/qortal-ui-plugins/plugins/core/qdn/browser/index.html b/qortal-ui-plugins/plugins/core/qdn/browser/index.html
index ee932db3..ecfb424b 100644
--- a/qortal-ui-plugins/plugins/core/qdn/browser/index.html
+++ b/qortal-ui-plugins/plugins/core/qdn/browser/index.html
@@ -3,6 +3,7 @@
+
diff --git a/qortal-ui-plugins/plugins/core/qdn/data-management/data-management.src.js b/qortal-ui-plugins/plugins/core/qdn/data-management/data-management.src.js
index f10fef02..006792b7 100644
--- a/qortal-ui-plugins/plugins/core/qdn/data-management/data-management.src.js
+++ b/qortal-ui-plugins/plugins/core/qdn/data-management/data-management.src.js
@@ -21,7 +21,8 @@ class DataManagement extends LitElement {
searchDatres: { type: Array },
blockedNames: { type: Array },
followedNames: { type: Array },
- datres: { type: Array }
+ datres: { type: Array },
+ theme: { type: String, reflect: true }
}
}
@@ -34,12 +35,18 @@ class DataManagement extends LitElement {
--lumo-primary-color-50pct: rgba(0, 167, 245, 0.5);
--lumo-primary-color-10pct: rgba(0, 167, 245, 0.1);
--lumo-primary-color: hsl(199, 100%, 48%);
+ --lumo-base-color: var(--white);
+ --lumo-body-text-color: var(--black);
+ --lumo-secondary-text-color: var(--sectxt);
+ --lumo-contrast-60pct: var(--vdicon);
+ --_lumo-grid-border-color: var(--border);
+ --_lumo-grid-secondary-border-color: var(--border2);
}
- #pages {
+ #pages {
display: flex;
flex-wrap: wrap;
- padding: 10px 5px 5px 5px;
+ padding: 10px 5px 5px 5px;
margin: 0px 20px 20px 20px;
}
@@ -53,6 +60,7 @@ class DataManagement extends LitElement {
font: inherit;
outline: none;
cursor: pointer;
+ color: var(--black);
}
#pages > button:not([disabled]):hover,
@@ -63,7 +71,7 @@ class DataManagement extends LitElement {
#pages > button[selected] {
font-weight: bold;
- color: white;
+ color: var(--white);
background-color: #ccc;
}
@@ -73,7 +81,7 @@ class DataManagement extends LitElement {
}
#websites-list-page {
- background: #fff;
+ background: var(--white);
padding: 12px 24px;
}
@@ -95,12 +103,12 @@ class DataManagement extends LitElement {
}
h2, h3, h4, h5 {
- color:#333;
+ color: var(--black);
font-weight: 400;
}
a.visitSite {
- color: #000;
+ color: var(--black);
text-decoration: none;
}
@@ -155,6 +163,7 @@ class DataManagement extends LitElement {
this.followedNames = []
this.datres = []
this.isLoading = false
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
}
render() {
@@ -218,6 +227,10 @@ class DataManagement extends LitElement {
firstUpdated() {
+ setInterval(() => {
+ this.changeTheme();
+ }, 100)
+
this.showManagement()
window.addEventListener('contextmenu', (event) => {
@@ -270,6 +283,16 @@ class DataManagement extends LitElement {
parentEpml.imReady()
}
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ if (checkTheme === 'dark') {
+ this.theme = 'dark';
+ } else {
+ this.theme = 'light';
+ }
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
searchListener(e) {
if (e.key === 'Enter') {
this.doSearch(e);
diff --git a/qortal-ui-plugins/plugins/core/qdn/data-management/index.html b/qortal-ui-plugins/plugins/core/qdn/data-management/index.html
index 24d49dbe..364289f0 100644
--- a/qortal-ui-plugins/plugins/core/qdn/data-management/index.html
+++ b/qortal-ui-plugins/plugins/core/qdn/data-management/index.html
@@ -3,6 +3,7 @@
+
diff --git a/qortal-ui-plugins/plugins/core/qdn/index.html b/qortal-ui-plugins/plugins/core/qdn/index.html
index b989fca7..6398e02e 100644
--- a/qortal-ui-plugins/plugins/core/qdn/index.html
+++ b/qortal-ui-plugins/plugins/core/qdn/index.html
@@ -3,6 +3,7 @@
+
diff --git a/qortal-ui-plugins/plugins/core/qdn/websites.src.js b/qortal-ui-plugins/plugins/core/qdn/websites.src.js
index 0c0c6257..62b29bc8 100644
--- a/qortal-ui-plugins/plugins/core/qdn/websites.src.js
+++ b/qortal-ui-plugins/plugins/core/qdn/websites.src.js
@@ -35,7 +35,8 @@ class Websites extends LitElement {
webBlockedNames: { type: Array },
blockResources: { type: Array },
blockFollowedNames: { type: Array },
- blockBlockedNames: { type: Array }
+ blockBlockedNames: { type: Array },
+ theme: { type: String, reflect: true }
}
}
@@ -48,6 +49,12 @@ class Websites extends LitElement {
--lumo-primary-color-50pct: rgba(0, 167, 245, 0.5);
--lumo-primary-color-10pct: rgba(0, 167, 245, 0.1);
--lumo-primary-color: hsl(199, 100%, 48%);
+ --lumo-base-color: var(--white);
+ --lumo-body-text-color: var(--black);
+ --lumo-secondary-text-color: var(--sectxt);
+ --lumo-contrast-60pct: var(--vdicon);
+ --_lumo-grid-border-color: var(--border);
+ --_lumo-grid-secondary-border-color: var(--border2);
}
#tabs-1 {
@@ -59,10 +66,16 @@ class Websites extends LitElement {
padding-bottom: 10px;
}
- #pages {
+ mwc-tab-bar {
+ --mdc-text-transform: none;
+ --mdc-tab-color-default: var(--black);
+ --mdc-tab-text-label-color-default: var(--black);
+ }
+
+ #pages {
display: flex;
flex-wrap: wrap;
- padding: 10px 5px 5px 5px;
+ padding: 10px 5px 5px 5px;
margin: 0px 20px 20px 20px;
}
@@ -76,6 +89,7 @@ class Websites extends LitElement {
font: inherit;
outline: none;
cursor: pointer;
+ color: var(--black);
}
#pages > button:not([disabled]):hover,
@@ -86,7 +100,7 @@ class Websites extends LitElement {
#pages > button[selected] {
font-weight: bold;
- color: white;
+ color: var(--white);
background-color: #ccc;
}
@@ -96,7 +110,7 @@ class Websites extends LitElement {
}
#websites-list-page {
- background: #fff;
+ background: var(--white);
padding: 12px 24px;
}
@@ -118,12 +132,12 @@ class Websites extends LitElement {
}
h2, h3, h4, h5 {
- color:#333;
+ color: var(--black);
font-weight: 400;
}
a.visitSite {
- color: #000;
+ color: var(--black);
text-decoration: none;
}
@@ -167,7 +181,7 @@ class Websites extends LitElement {
word-break:normal;
font-size:14px;
line-height:20px;
- color:rgb(100,100,100);
+ color: var(--relaynodetxt);
}
img {
@@ -199,6 +213,7 @@ class Websites extends LitElement {
this.blockResources = []
this.blockFollowedNames = []
this.blockBlockedNames = []
+ this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
}
render() {
@@ -283,7 +298,7 @@ class Websites extends LitElement {
${this.isEmptyArray(this.resources) ? html`
- No websites available
+
No websites available
`: ''}
${this.renderRelayModeText()}
@@ -322,7 +337,7 @@ class Websites extends LitElement {
${this.isEmptyArray(this.webResources) ? html`
- You not follow any website
+
You not follow any website
`: ''}
${this.renderRelayModeText()}
@@ -361,7 +376,7 @@ class Websites extends LitElement {
${this.isEmptyArray(this.blockResources) ? html`
- You have not blocked any website
+
You have not blocked any website
`: ''}
${this.renderRelayModeText()}
@@ -373,6 +388,10 @@ class Websites extends LitElement {
firstUpdated() {
+ setInterval(() => {
+ this.changeTheme();
+ }, 100)
+
this.showWebsites()
setTimeout(() => {
@@ -514,6 +533,16 @@ class Websites extends LitElement {
parentEpml.imReady()
}
+ changeTheme() {
+ const checkTheme = localStorage.getItem('qortalTheme')
+ if (checkTheme === 'dark') {
+ this.theme = 'dark';
+ } else {
+ this.theme = 'light';
+ }
+ document.querySelector('html').setAttribute('theme', this.theme);
+ }
+
displayTabContent(tab) {
const tabBrowseContent = this.shadowRoot.getElementById('tab-browse-content')
const tabFollowedContent = this.shadowRoot.getElementById('tab-followed-content')
diff --git a/qortal-ui-plugins/plugins/core/reward-share/index.html b/qortal-ui-plugins/plugins/core/reward-share/index.html
index f0c83c3b..5f9413f5 100644
--- a/qortal-ui-plugins/plugins/core/reward-share/index.html
+++ b/qortal-ui-plugins/plugins/core/reward-share/index.html
@@ -3,6 +3,7 @@