+
+
+ this.goBack()} class="address-bar-button">arrow_back_ios Back
+
+
+
+
Publish / Update ${this.category}
+
Note: it is recommended that you set up port forwarding before hosting data, so that it can more easily accessed by peers on the network.
-
-
-
Publish / Update ${this.category}
-
Note: it is recommended that you set up port forwarding before hosting data, so that it can more easily accessed by peers on the network.
-
-
-
-
- this.selectName(e)} style="min-width: 130px; max-width:100%; width:100%;">
-
- ${this.myRegisteredName}
-
-
- ${this.renderUploadField()}
-
-
-
-
-
-
-
- ${this.generalMessage}
- ${this.errorMessage}
- ${this.successMessage}
+
+
+
+ this.selectName(e)} style="min-width: 130px; max-width:100%; width:100%;">
+
+ ${this.myRegisteredName}
+
+
+ ${this.renderUploadField()}
+
+
+
+
+
+
- ${this.loading ? html`
` : ''}
+
${this.generalMessage}
+
${this.errorMessage}
+
${this.successMessage}
-
- `
+
+ `
+ }
+
+ firstUpdated() {
+
+ this.changeTheme()
+
+ 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);
}
// Navigation
-
goBack() {
window.history.back();
}
@@ -140,13 +281,13 @@ class PublishData extends LitElement {
renderUploadField() {
if (this.uploadType === "file") {
return html`
-
+
`;
}
else if (this.uploadType === "zip") {
return html`
Select zip file containing static content:
-
+
`;
}
else {
@@ -291,7 +432,6 @@ class PublishData extends LitElement {
url: `${uploadDataUrl}?apiKey=${this.getApiKey()}`,
body: `${postBody}`,
})
-
return uploadDataRes
}
@@ -302,7 +442,6 @@ class PublishData extends LitElement {
url: `/transactions/convert`,
body: `${transactionBytesBase58}`,
})
-
return convertedBytes
}
@@ -345,20 +484,11 @@ class PublishData extends LitElement {
else {
myResponse = response
}
-
return myResponse
}
-
validate()
}
-
- // Helper Functions (Re-Used in Most part of the UI )
-
- textColor(color) {
- return color == 'light' ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.87)'
- }
-
_textMenu(event) {
const getSelectedText = () => {
var text = ''
@@ -380,123 +510,9 @@ class PublishData extends LitElement {
parentEpml.request('openCopyTextMenu', textMenuObject)
}
}
-
checkSelectedTextAndShowMenu()
}
- constructor() {
- super()
-
- this.showName = false;
- this.showService = false
- this.showIdentifier = false
-
- const urlParams = new URLSearchParams(window.location.search)
- this.name = urlParams.get('name')
- this.service = urlParams.get('service')
- this.identifier = urlParams.get('identifier')
- this.category = urlParams.get('category')
- this.uploadType = urlParams.get('uploadType') !== "null" ? urlParams.get('uploadType') : "file"
-
- if (urlParams.get('showName') === "true") {
- this.showName = true
- }
- if (urlParams.get('showService') === "true") {
- this.showService = true
- }
- if (urlParams.get('showIdentifier') === "true") {
- this.showIdentifier = true
- }
-
- if (this.identifier != null) {
- if (this.identifier === "null" || this.identifier.trim().length == 0) {
- this.identifier = null
- }
- }
-
- // Default to true so the message doesn't appear and disappear quickly
- this.portForwardingEnabled = true
- this.names = []
- this.myRegisteredName = ''
- this.selectedName = 'invalid'
- this.path = ''
- this.successMessage = ''
- this.generalMessage = ''
- this.errorMessage = ''
- this.loading = false
- this.btnDisable = false
-
- const fetchNames = () => {
- parentEpml.request('apiCall', {
- url: `/names/address/${this.selectedAddress.address}?limit=0&reverse=true`
- }).then(res => {
-
- setTimeout(() => {
- this.names = res
- if (res[0] != null) {
- this.myRegisteredName = res[0].name;
- }
- }, 1)
- })
- setTimeout(fetchNames, this.config.user.nodeSettings.pingInterval)
- }
-
- const fetchPeersSummary = () => {
- parentEpml.request('apiCall', {
- url: `/peers/summary`
- }).then(res => {
-
- setTimeout(() => {
- this.portForwardingEnabled = (res.inboundConnections != null && res.inboundConnections > 0);
- }, 1)
- })
- setTimeout(fetchPeersSummary, this.config.user.nodeSettings.pingInterval)
- }
-
- 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 => {
- if (!configLoaded) {
- setTimeout(fetchNames, 1)
- setTimeout(fetchPeersSummary, 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()
- }
- })
- })
- }
-
- 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)
- }
- }
- }
-
selectName(e) {
let name = this.shadowRoot.getElementById('registeredName')
this.selectedName = (name.value)
diff --git a/qortal-ui-plugins/plugins/core/qdn/websites.src.js b/qortal-ui-plugins/plugins/core/qdn/websites.src.js
index 3eb65edf..116450bc 100644
--- a/qortal-ui-plugins/plugins/core/qdn/websites.src.js
+++ b/qortal-ui-plugins/plugins/core/qdn/websites.src.js
@@ -388,6 +388,8 @@ class Websites extends LitElement {
firstUpdated() {
+ this.changeTheme()
+
setInterval(() => {
this.changeTheme();
}, 100)
@@ -404,7 +406,7 @@ class Websites extends LitElement {
})
this.followedNames = followedNames
- setTimeout(getFollowedNames, 60000)
+ setTimeout(getFollowedNames, 120000)
}
const getBlockedNames = async () => {
@@ -413,7 +415,7 @@ class Websites extends LitElement {
})
this.blockedNames = blockedNames
- setTimeout(getBlockedNames, 60000)
+ setTimeout(getBlockedNames, 120000)
}
const getWebFollowedNames = async () => {
@@ -422,7 +424,7 @@ class Websites extends LitElement {
})
this.webFollowedNames = webFollowedNames
- setTimeout(getWebFollowedNames, 60000)
+ setTimeout(getWebFollowedNames, 120000)
}
const getWebBlockedNames = async () => {
@@ -431,7 +433,7 @@ class Websites extends LitElement {
})
this.webBlockedNames = webBlockedNames
- setTimeout(getWebBlockedNames, 60000)
+ setTimeout(getWebBlockedNames, 120000)
}
const getBlockFollowedNames = async () => {
@@ -440,7 +442,7 @@ class Websites extends LitElement {
})
this.blockFollowedNames = blockFollowedNames
- setTimeout(getBlockFollowedNames, 60000)
+ setTimeout(getBlockFollowedNames, 120000)
}
const getBlockBlockedNames = async () => {
@@ -449,7 +451,7 @@ class Websites extends LitElement {
})
this.blockBlockedNames = blockBlockedNames
- setTimeout(getBlockBlockedNames, 60000)
+ setTimeout(getBlockBlockedNames, 120000)
}
const getSearchFollowedNames = async () => {
@@ -458,7 +460,7 @@ class Websites extends LitElement {
})
this.searchFollowedNames = searchFollowedNames
- setTimeout(getSearchFollowedNames, 60000)
+ setTimeout(getSearchFollowedNames, 120000)
}
const getSearchBlockedNames = async () => {
@@ -467,7 +469,7 @@ class Websites extends LitElement {
})
this.searchBlockedNames = searchBlockedNames
- setTimeout(getSearchBlockedNames, 60000)
+ setTimeout(getSearchBlockedNames, 120000)
}
const getRelayMode = async () => {
@@ -476,7 +478,7 @@ class Websites extends LitElement {
})
this.relayMode = relayMode;
- setTimeout(getRelayMode, 60000)
+ setTimeout(getRelayMode, 120000)
}
window.addEventListener("contextmenu", (event) => {
@@ -518,8 +520,8 @@ class Websites extends LitElement {
setTimeout(getSearchBlockedNames, 1)
setTimeout(getRelayMode, 1)
setInterval(this.getArbitraryResources, 120000)
- setInterval(this.getFollowedWebsites, 60000)
- setInterval(this.getBlockedWebsites, 60000)
+ setInterval(this.getFollowedWebsites, 120000)
+ setInterval(this.getBlockedWebsites, 120000)
configLoaded = true
}
this.config = JSON.parse(c)
diff --git a/qortal-ui-plugins/plugins/core/reward-share/reward-share.src.js b/qortal-ui-plugins/plugins/core/reward-share/reward-share.src.js
index 2b8bff8c..454a6b3d 100644
--- a/qortal-ui-plugins/plugins/core/reward-share/reward-share.src.js
+++ b/qortal-ui-plugins/plugins/core/reward-share/reward-share.src.js
@@ -165,6 +165,8 @@ class RewardShare extends LitElement {
firstUpdated() {
+ this.changeTheme()
+
setInterval(() => {
this.changeTheme();
}, 100)
diff --git a/qortal-ui-plugins/plugins/core/send-coin/send-coin.src.js b/qortal-ui-plugins/plugins/core/send-coin/send-coin.src.js
index ab0bbe43..0381c714 100644
--- a/qortal-ui-plugins/plugins/core/send-coin/send-coin.src.js
+++ b/qortal-ui-plugins/plugins/core/send-coin/send-coin.src.js
@@ -275,6 +275,8 @@ class SendMoneyPage extends LitElement {
firstUpdated() {
+ this.changeTheme()
+
setInterval(() => {
this.changeTheme();
}, 100)
diff --git a/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js b/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js
index ebfdb2e1..affbd1e6 100644
--- a/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js
+++ b/qortal-ui-plugins/plugins/core/trade-portal/trade-portal.src.js
@@ -855,8 +855,11 @@ class TradePortal extends LitElement {
}
firstUpdated() {
+
let _this = this
+ this.changeTheme()
+
setInterval(() => {
this.changeTheme();
}, 100)
diff --git a/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js b/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js
index 43f671ad..e21beca0 100644
--- a/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js
+++ b/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js
@@ -660,6 +660,8 @@ class MultiWallet extends LitElement {
firstUpdated() {
+ this.changeTheme()
+
setInterval(() => {
this.changeTheme();
}, 100)