mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 17:55:51 +00:00
Change to general copy paste
This commit is contained in:
parent
7eeb5e6d2e
commit
d3ff7f72ba
@ -11,12 +11,12 @@ const options = {
|
||||
}
|
||||
|
||||
const aliases = {
|
||||
'qortal-ui-crypto': 'node_modules/qortal-ui-crypto/api.js'
|
||||
'qortal-ui-crypto': '../../crypto/api.js'
|
||||
}
|
||||
|
||||
const apiComponents = {
|
||||
api: {
|
||||
file: 'api/api.js',
|
||||
file: '../../crypto/api.js',
|
||||
className: 'api'
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ import { installRouter } from 'pwa-helpers/router.js'
|
||||
import { connect } from 'pwa-helpers'
|
||||
import { store } from '../store.js'
|
||||
import { doNavigate } from '../redux/app/app-actions.js'
|
||||
import isElectron from 'is-electron'
|
||||
import '../plugins/streams.js'
|
||||
|
||||
import { loadPlugins } from '../plugins/load-plugins.js'
|
||||
@ -11,9 +12,6 @@ import '../styles/app-styles.js'
|
||||
import './login-view/login-view.js'
|
||||
import './app-view.js'
|
||||
|
||||
import copyTextMenu from '../functional-components/copy-text-menu.js'
|
||||
import framePasteMenu from '../functional-components/frame-paste-menu.js'
|
||||
|
||||
installRouter((location) => store.dispatch(doNavigate(location)))
|
||||
|
||||
class MainApp extends connect(store)(LitElement) {
|
||||
@ -66,46 +64,14 @@ class MainApp extends connect(store)(LitElement) {
|
||||
super.connectedCallback()
|
||||
this.initial = 0
|
||||
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault();
|
||||
this._textMenu(event);
|
||||
})
|
||||
|
||||
window.addEventListener('click', () => {
|
||||
copyTextMenu.close()
|
||||
framePasteMenu.close()
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
copyTextMenu.close()
|
||||
framePasteMenu.close()
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection !== 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection !== 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
const selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
|
||||
const textMenuObject = { selectedText, eventObject: event }
|
||||
copyTextMenu.open(textMenuObject)
|
||||
}
|
||||
}
|
||||
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('main-app', MainApp)
|
||||
|
@ -10,7 +10,8 @@ class ShowPlugin extends connect(store)(LitElement) {
|
||||
app: { type: Object },
|
||||
pluginConfig: { type: Object },
|
||||
url: { type: String },
|
||||
linkParam: { type: String }
|
||||
linkParam: { type: String },
|
||||
registeredUrls: { type: Array }
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,13 +51,19 @@ class ShowPlugin extends connect(store)(LitElement) {
|
||||
`
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
this.registeredUrls = []
|
||||
}
|
||||
|
||||
render() {
|
||||
const plugArr = []
|
||||
|
||||
const plugSrc = (myPlug) => {
|
||||
return myPlug === undefined ? 'about:blank' : `${window.location.origin}/plugin/${myPlug.domain}/${myPlug.page}${this.linkParam}`
|
||||
}
|
||||
|
||||
const plugArr = []
|
||||
this.app.registeredUrls.forEach(myPlugArr => {
|
||||
this.registeredUrls.forEach(myPlugArr => {
|
||||
myPlugArr.menus.length === 0 ? plugArr.push(myPlugArr) : myPlugArr.menus.forEach(i => plugArr.push(myPlugArr, i))
|
||||
})
|
||||
|
||||
@ -75,6 +82,7 @@ class ShowPlugin extends connect(store)(LitElement) {
|
||||
type: 'WINDOW',
|
||||
source: this.shadowRoot.getElementById('showPluginFrame').contentWindow
|
||||
})
|
||||
|
||||
addPluginRoutes(showingPluginEpml)
|
||||
showingPluginEpml.imReady()
|
||||
this.showingPluginEpml = showingPluginEpml
|
||||
@ -94,23 +102,35 @@ class ShowPlugin extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
stateChanged(state) {
|
||||
this.app = state.app
|
||||
this.config = state.config
|
||||
|
||||
const split = state.app.url.split('/')
|
||||
const newRegisteredUrls = state.app.registeredUrls
|
||||
|
||||
let newUrl, newLinkParam
|
||||
|
||||
if (newRegisteredUrls !== this.registeredUrls) {
|
||||
this.registeredUrls = newRegisteredUrls
|
||||
}
|
||||
|
||||
if (split[0] === '' && split[1] === 'app' && split[2] === undefined) {
|
||||
this.url = 'wallet'
|
||||
this.linkParam = ''
|
||||
newUrl = 'wallet'
|
||||
newLinkParam = ''
|
||||
} else if (split.length === 5 && split[1] === 'app') {
|
||||
this.url = split[2]
|
||||
this.linkParam = split[3] === undefined ? '' : '?' + split[3] + '/' + split[4]
|
||||
newUrl = split[2]
|
||||
newLinkParam = split[3] === undefined ? '' : '?' + split[3] + '/' + split[4]
|
||||
} else if (split[1] === 'app') {
|
||||
this.url = split[2]
|
||||
this.linkParam = ''
|
||||
newUrl = split[2]
|
||||
newLinkParam = ''
|
||||
} else {
|
||||
this.url = '404'
|
||||
this.linkParam = ''
|
||||
newUrl = '404'
|
||||
newLinkParam = ''
|
||||
}
|
||||
|
||||
if (newUrl !== this.url) {
|
||||
this.url = newUrl
|
||||
}
|
||||
|
||||
if (newLinkParam !== this.linkParam) {
|
||||
this.linkParam = newLinkParam
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,8 +17,6 @@ import {
|
||||
loadStateFromLocalStorage,
|
||||
saveStateToLocalStorage,
|
||||
} from '../localStorageHelpers.js'
|
||||
import copyTextMenu from '../functional-components/copy-text-menu.js'
|
||||
import framePasteMenu from '../functional-components/frame-paste-menu.js'
|
||||
|
||||
const createTransaction = api.createTransaction
|
||||
const processTransaction = api.processTransaction
|
||||
@ -39,10 +37,6 @@ const sendRvn = api.sendRvn
|
||||
const sendArrr = api.sendArrr
|
||||
|
||||
export const routes = {
|
||||
hello: async (req) => {
|
||||
return 'Hello from awesomeness'
|
||||
},
|
||||
|
||||
registerUrl: async (req) => {
|
||||
store.dispatch(doAddPluginUrl(req.data))
|
||||
},
|
||||
@ -95,27 +89,6 @@ export const routes = {
|
||||
return saveStateToLocalStorage(req.data.key, req.data.dataObj)
|
||||
},
|
||||
|
||||
openCopyTextMenu: async (req) => {
|
||||
const textMenuObject = {
|
||||
selectedText: req.data.selectedText,
|
||||
eventObject: req.data.eventObject,
|
||||
isFrame: req.data.isFrame,
|
||||
}
|
||||
copyTextMenu.open(textMenuObject)
|
||||
},
|
||||
|
||||
closeCopyTextMenu: async (req) => {
|
||||
copyTextMenu.close()
|
||||
},
|
||||
|
||||
openFramePasteMenu: async (req) => {
|
||||
framePasteMenu.open(req.data)
|
||||
},
|
||||
|
||||
closeFramePasteMenu: async (req) => {
|
||||
framePasteMenu.close()
|
||||
},
|
||||
|
||||
apiCall: async (req) => {
|
||||
const url = req.data.url
|
||||
delete req.data.url
|
||||
|
@ -7,8 +7,6 @@ const SELECTED_ADDRESS_STREAM_NAME = 'selected_address'
|
||||
const APP_INFO_STATE = 'app_info_state'
|
||||
const CHAT_HEADS_STREAM_NAME = 'chat_heads'
|
||||
const NODE_CONFIG_STREAM_NAME = 'node_config'
|
||||
const COPY_MENU_SWITCH = 'copy_menu_switch'
|
||||
const FRAME_PASTE_MENU_SWITCH = 'frame_paste_menu_switch'
|
||||
const CHAT_LAST_SEEN = 'chat_last_seen'
|
||||
|
||||
export const loggedInStream = new EpmlStream(LOGIN_STREAM_NAME, () => store.getState().app.loggedIn)
|
||||
@ -17,8 +15,6 @@ export const selectedAddressStream = new EpmlStream(SELECTED_ADDRESS_STREAM_NAME
|
||||
export const appInfoStateStream = new EpmlStream(APP_INFO_STATE, () => store.getState().app.appInfo)
|
||||
export const chatHeadsStateStream = new EpmlStream(CHAT_HEADS_STREAM_NAME, () => store.getState().app.chatHeads)
|
||||
export const nodeConfigStream = new EpmlStream(NODE_CONFIG_STREAM_NAME, () => store.getState().app.nodeConfig)
|
||||
export const copyMenuSwitchStream = new EpmlStream(COPY_MENU_SWITCH, () => store.getState().app.copyMenuSwitch)
|
||||
export const framePasteMenuSwitchStream = new EpmlStream(FRAME_PASTE_MENU_SWITCH, () => store.getState().app.framePasteMenuSwitch)
|
||||
export const chatLastSeenStream = new EpmlStream(CHAT_LAST_SEEN, () => store.getState().app.chatLastSeen)
|
||||
|
||||
|
||||
@ -32,7 +28,7 @@ store.subscribe(() => {
|
||||
if (oldState.app.loggedIn !== state.app.loggedIn) {
|
||||
loggedInStream.emit(state.app.loggedIn)
|
||||
}
|
||||
// This one may be a little on the heavy side...AHHH, NEED TO MOVE STORAGE OF ENCRYPTED SEED. DONE <3
|
||||
|
||||
if (oldState.config !== state.config) {
|
||||
configStream.emit(state.config)
|
||||
}
|
||||
@ -41,13 +37,6 @@ store.subscribe(() => {
|
||||
nodeConfigStream.emit(state.app.nodeConfig)
|
||||
}
|
||||
|
||||
if (oldState.app.copyMenuSwitch !== state.app.copyMenuSwitch) {
|
||||
copyMenuSwitchStream.emit(state.app.copyMenuSwitch)
|
||||
}
|
||||
|
||||
if (oldState.app.framePasteMenuSwitch !== state.app.framePasteMenuSwitch) {
|
||||
framePasteMenuSwitchStream.emit(state.app.framePasteMenuSwitch)
|
||||
}
|
||||
if (oldState.app.chatLastSeen !== state.app.chatLastSeen) {
|
||||
chatLastSeenStream.emit(state.app.chatLastSeen)
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Core App Actions here...
|
||||
import { UPDATE_BLOCK_INFO, UPDATE_NODE_STATUS, UPDATE_NODE_INFO, CHAT_HEADS, ACCOUNT_INFO, COPY_MENU_SWITCH, PASTE_MENU_SWITCH, FRAME_PASTE_MENU_SWITCH, ADD_AUTO_LOAD_IMAGES_CHAT, REMOVE_AUTO_LOAD_IMAGES_CHAT, ALLOW_QAPP_AUTO_AUTH, REMOVE_QAPP_AUTO_AUTH, SET_CHAT_LAST_SEEN, ADD_CHAT_LAST_SEEN, ALLOW_QAPP_AUTO_LISTS, REMOVE_QAPP_AUTO_LISTS } from '../app-action-types.js'
|
||||
import { UPDATE_BLOCK_INFO, UPDATE_NODE_STATUS, UPDATE_NODE_INFO, CHAT_HEADS, ACCOUNT_INFO, ADD_AUTO_LOAD_IMAGES_CHAT, REMOVE_AUTO_LOAD_IMAGES_CHAT, ALLOW_QAPP_AUTO_AUTH, REMOVE_QAPP_AUTO_AUTH, SET_CHAT_LAST_SEEN, ADD_CHAT_LAST_SEEN, ALLOW_QAPP_AUTO_LISTS, REMOVE_QAPP_AUTO_LISTS } from '../app-action-types.js'
|
||||
|
||||
export const doUpdateBlockInfo = (blockObj) => {
|
||||
return (dispatch, getState) => {
|
||||
@ -66,46 +66,6 @@ const updateAccountInfo = (payload) => {
|
||||
}
|
||||
}
|
||||
|
||||
export const doCopyMenuSwitch = (value) => {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(copyMenuSwitch(value))
|
||||
}
|
||||
}
|
||||
|
||||
const copyMenuSwitch = (payload) => {
|
||||
return {
|
||||
type: COPY_MENU_SWITCH,
|
||||
payload
|
||||
}
|
||||
}
|
||||
|
||||
export const doPasteMenuSwitch = (value) => {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(pasteMenuSwitch(value))
|
||||
}
|
||||
}
|
||||
|
||||
const pasteMenuSwitch = (payload) => {
|
||||
return {
|
||||
type: PASTE_MENU_SWITCH,
|
||||
payload
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const doFramePasteMenuSwitch = (value) => {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(framePasteMenuSwitch(value))
|
||||
}
|
||||
}
|
||||
|
||||
const framePasteMenuSwitch = (payload) => {
|
||||
return {
|
||||
type: FRAME_PASTE_MENU_SWITCH,
|
||||
payload
|
||||
}
|
||||
}
|
||||
|
||||
export const addAutoLoadImageChat = (payload) => {
|
||||
return {
|
||||
type: ADD_AUTO_LOAD_IMAGES_CHAT,
|
||||
|
@ -17,9 +17,6 @@ export const PAGE_URL = 'PAGE_URL'
|
||||
export const CHAT_HEADS = 'CHAT_HEADS'
|
||||
export const ACCOUNT_INFO = 'ACCOUNT_INFO'
|
||||
export const ADD_NEW_PLUGIN_URL = 'ADD_NEW_PLUGIN_URL'
|
||||
export const COPY_MENU_SWITCH = 'COPY_MENU_SWITCH'
|
||||
export const PASTE_MENU_SWITCH = 'PASTE_MENU_SWITCH'
|
||||
export const FRAME_PASTE_MENU_SWITCH = 'FRAME_PASTE_MENU_SWITCH'
|
||||
export const ADD_AUTO_LOAD_IMAGES_CHAT = 'ADD_AUTO_LOAD_IMAGES_CHAT'
|
||||
export const REMOVE_AUTO_LOAD_IMAGES_CHAT = 'REMOVE_AUTO_LOAD_IMAGES_CHAT'
|
||||
export const ALLOW_QAPP_AUTO_AUTH = 'ALLOW_QAPP_AUTO_AUTH'
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Loading state, login state, isNavDrawOpen state etc. None of this needs to be saved to localstorage.
|
||||
import { loadStateFromLocalStorage, saveStateToLocalStorage } from '../../localStorageHelpers.js'
|
||||
import { LOG_IN, LOG_OUT, NETWORK_CONNECTION_STATUS, INIT_WORKERS, ADD_PLUGIN_URL, ADD_PLUGIN, ADD_NEW_PLUGIN_URL, NAVIGATE, SELECT_ADDRESS, ACCOUNT_INFO, CHAT_HEADS, UPDATE_BLOCK_INFO, UPDATE_NODE_STATUS, UPDATE_NODE_INFO, LOAD_NODE_CONFIG, SET_NODE, ADD_NODE, PAGE_URL, COPY_MENU_SWITCH, PASTE_MENU_SWITCH, FRAME_PASTE_MENU_SWITCH, ADD_AUTO_LOAD_IMAGES_CHAT, REMOVE_AUTO_LOAD_IMAGES_CHAT, ALLOW_QAPP_AUTO_AUTH, REMOVE_QAPP_AUTO_AUTH, SET_CHAT_LAST_SEEN, ADD_CHAT_LAST_SEEN, ALLOW_QAPP_AUTO_LISTS, REMOVE_QAPP_AUTO_LISTS } from './app-action-types.js'
|
||||
import { LOG_IN, LOG_OUT, NETWORK_CONNECTION_STATUS, INIT_WORKERS, ADD_PLUGIN_URL, ADD_PLUGIN, ADD_NEW_PLUGIN_URL, NAVIGATE, SELECT_ADDRESS, ACCOUNT_INFO, CHAT_HEADS, UPDATE_BLOCK_INFO, UPDATE_NODE_STATUS, UPDATE_NODE_INFO, LOAD_NODE_CONFIG, SET_NODE, ADD_NODE, PAGE_URL, ADD_AUTO_LOAD_IMAGES_CHAT, REMOVE_AUTO_LOAD_IMAGES_CHAT, ALLOW_QAPP_AUTO_AUTH, REMOVE_QAPP_AUTO_AUTH, SET_CHAT_LAST_SEEN, ADD_CHAT_LAST_SEEN, ALLOW_QAPP_AUTO_LISTS, REMOVE_QAPP_AUTO_LISTS } from './app-action-types.js'
|
||||
import { initWorkersReducer } from './reducers/init-workers.js'
|
||||
import { loginReducer } from './reducers/login-reducer.js'
|
||||
import { setNode, addNode } from './reducers/manage-node.js'
|
||||
@ -43,12 +43,6 @@ const INITIAL_STATE = {
|
||||
nodeInfo: {},
|
||||
nodeStatus: {},
|
||||
pageUrl: '',
|
||||
copyMenuSwitch: false,
|
||||
pasteMenuSwitch: false,
|
||||
framePasteMenuSwitch: {
|
||||
isOpen: false,
|
||||
elementId: ''
|
||||
},
|
||||
autoLoadImageChats: loadStateFromLocalStorage('autoLoadImageChats') || [],
|
||||
qAPPAutoAuth: loadStateFromLocalStorage('qAPPAutoAuth') || false,
|
||||
qAPPAutoLists: loadStateFromLocalStorage('qAPPAutoLists') || false,
|
||||
@ -141,21 +135,6 @@ export default (state = INITIAL_STATE, action) => {
|
||||
...state,
|
||||
networkIsConnected: action.payload
|
||||
}
|
||||
case COPY_MENU_SWITCH:
|
||||
return {
|
||||
...state,
|
||||
copyMenuSwitch: action.payload
|
||||
}
|
||||
case PASTE_MENU_SWITCH:
|
||||
return {
|
||||
...state,
|
||||
pasteMenuSwitch: action.payload
|
||||
}
|
||||
case FRAME_PASTE_MENU_SWITCH:
|
||||
return {
|
||||
...state,
|
||||
framePasteMenuSwitch: action.payload
|
||||
}
|
||||
case ADD_AUTO_LOAD_IMAGES_CHAT: {
|
||||
const findChat = state.autoLoadImageChats.findIndex((chat)=> chat === action.payload)
|
||||
console.log({findChat})
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { store } from '../store.js'
|
||||
import * as api from 'qortal-ui-crypto'
|
||||
import snackbar from '../functional-components/snackbar.js'
|
||||
import copyTextMenu from '../functional-components/copy-text-menu.js';
|
||||
import framePasteMenu from '../functional-components/frame-paste-menu.js';
|
||||
|
||||
const createTransaction = api.createTransaction
|
||||
const processTransaction = api.processTransaction
|
||||
@ -25,27 +23,6 @@ export const routes = {
|
||||
return api.request(url, req.data)
|
||||
},
|
||||
|
||||
openCopyTextMenu: async (req) => {
|
||||
const textMenuObject = {
|
||||
selectedText: req.data.selectedText,
|
||||
eventObject: req.data.eventObject,
|
||||
isFrame: req.data.isFrame,
|
||||
};
|
||||
copyTextMenu.open(textMenuObject);
|
||||
},
|
||||
|
||||
closeCopyTextMenu: async (req) => {
|
||||
copyTextMenu.close();
|
||||
},
|
||||
|
||||
openFramePasteMenu: async (req) => {
|
||||
framePasteMenu.open(req.data);
|
||||
},
|
||||
|
||||
closeFramePasteMenu: async (req) => {
|
||||
framePasteMenu.close();
|
||||
},
|
||||
|
||||
transaction: async (req) => {
|
||||
let response
|
||||
try {
|
||||
|
16
electron.js
16
electron.js
@ -768,7 +768,7 @@ function createWindow() {
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
partition: 'persist:webviewsession',
|
||||
nodeIntegration: false,
|
||||
nodeIntegration: true,
|
||||
contextIsolation: true,
|
||||
enableRemoteModule: false,
|
||||
allowRunningInsecureContent: false,
|
||||
@ -933,6 +933,20 @@ if (!isLock) {
|
||||
ipcMain.on('check-for-update', (event) => {
|
||||
autoUpdater.checkForUpdatesAndNotify()
|
||||
})
|
||||
ipcMain.on('show-my-menu', (event) => {
|
||||
log.info("RIGHT CLICKED")
|
||||
let homePageOptions = Menu.buildFromTemplate([
|
||||
{
|
||||
label: 'Copy',
|
||||
role: 'copy'
|
||||
},
|
||||
{
|
||||
label: 'Paste',
|
||||
role: 'paste'
|
||||
}
|
||||
])
|
||||
homePageOptions.popup(myWindow)
|
||||
})
|
||||
autoUpdater.on('update-available', (event) => {
|
||||
const downloadOpts = {
|
||||
type: 'info',
|
||||
|
@ -2,5 +2,6 @@ const { contextBridge, ipcRenderer } = require('electron')
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
setStartCore: () => ipcRenderer.send('set-start-core'),
|
||||
checkForUpdate: () => ipcRenderer.send('check-for-update')
|
||||
checkForUpdate: () => ipcRenderer.send('check-for-update'),
|
||||
showMyMenu: () => ipcRenderer.send('show-my-menu')
|
||||
})
|
19
package.json
19
package.json
@ -73,7 +73,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "1.4.0",
|
||||
"electron": "24.2.0",
|
||||
"electron": "24.3.0",
|
||||
"electron-builder": "23.6.0",
|
||||
"electron-packager": "17.1.1",
|
||||
"epml": "0.3.3",
|
||||
@ -83,12 +83,11 @@
|
||||
"is-electron": "2.2.2",
|
||||
"lit": "2.7.4",
|
||||
"lit-translate": "2.0.1",
|
||||
"localforage": "1.10.0",
|
||||
"pwa-helpers": "0.9.1",
|
||||
"passive-events-support": "1.0.33",
|
||||
"redux": "4.2.1",
|
||||
"redux-thunk": "2.4.2",
|
||||
"rollup": "3.21.5",
|
||||
"rollup": "3.21.6",
|
||||
"rollup-plugin-node-globals": "1.4.0",
|
||||
"rollup-plugin-progress": "1.1.2",
|
||||
"rollup-plugin-scss": "3.0.0",
|
||||
@ -135,13 +134,13 @@
|
||||
"@rollup/plugin-node-resolve": "15.0.2",
|
||||
"@rollup/plugin-replace": "5.0.2",
|
||||
"@rollup/plugin-terser": "0.4.1",
|
||||
"@vaadin/avatar": "24.0.4",
|
||||
"@vaadin/button": "24.0.4",
|
||||
"@vaadin/grid": "24.0.4",
|
||||
"@vaadin/icons": "24.0.4",
|
||||
"@vaadin/password-field": "24.0.4",
|
||||
"@vaadin/tooltip": "24.0.4",
|
||||
"@zip.js/zip.js": "2.7.6"
|
||||
"@vaadin/avatar": "24.0.5",
|
||||
"@vaadin/button": "24.0.5",
|
||||
"@vaadin/grid": "24.0.5",
|
||||
"@vaadin/icons": "24.0.5",
|
||||
"@vaadin/password-field": "24.0.5",
|
||||
"@vaadin/tooltip": "24.0.5",
|
||||
"@zip.js/zip.js": "2.7.13"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.14.0"
|
||||
|
@ -1,21 +1,22 @@
|
||||
import { LitElement, html } from 'lit';
|
||||
import { Epml } from '../../../epml.js';
|
||||
import '../components/ButtonIconCopy.js';
|
||||
import { use, translate, registerTranslateConfig } from 'lit-translate';
|
||||
import { blocksNeed } from '../../utils/blocks-needed.js';
|
||||
import { LitElement, html } from 'lit'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import '../components/ButtonIconCopy.js'
|
||||
import { use, translate, registerTranslateConfig } from 'lit-translate'
|
||||
import { blocksNeed } from '../../utils/blocks-needed.js'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()),
|
||||
});
|
||||
})
|
||||
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
import '@material/mwc-button';
|
||||
import '@material/mwc-textfield';
|
||||
import '@vaadin/button';
|
||||
import { pageStyles } from './become-minter-css.src.js';
|
||||
import './components/not-sponsored.src';
|
||||
import './components/yes-sponsored.src';
|
||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-textfield'
|
||||
import '@vaadin/button'
|
||||
import { pageStyles } from './become-minter-css.src.js'
|
||||
import './components/not-sponsored.src'
|
||||
import './components/yes-sponsored.src'
|
||||
|
||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||
|
||||
class BecomeMinter extends LitElement {
|
||||
static get properties() {
|
||||
@ -27,77 +28,77 @@ class BecomeMinter extends LitElement {
|
||||
addressInfo: { type: Object },
|
||||
rewardSharePublicKey: { type: String },
|
||||
mintingAccountData: { type: Array },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static styles = [pageStyles];
|
||||
static styles = [pageStyles]
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light';
|
||||
this.sponsorshipKeyValue = '';
|
||||
this.isPageLoading = true;
|
||||
this.nodeInfo = {};
|
||||
this.addressInfo = {};
|
||||
this.rewardSharePublicKey = '';
|
||||
this.mintingAccountData = null;
|
||||
super()
|
||||
this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
|
||||
this.sponsorshipKeyValue = ''
|
||||
this.isPageLoading = true
|
||||
this.nodeInfo = {}
|
||||
this.addressInfo = {}
|
||||
this.rewardSharePublicKey = ''
|
||||
this.mintingAccountData = null
|
||||
}
|
||||
|
||||
changeLanguage() {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage');
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
|
||||
if (checkLanguage === null || checkLanguage.length === 0) {
|
||||
localStorage.setItem('qortalLanguage', 'us');
|
||||
use('us');
|
||||
localStorage.setItem('qortalLanguage', 'us')
|
||||
use('us')
|
||||
} else {
|
||||
use(checkLanguage);
|
||||
use(checkLanguage)
|
||||
}
|
||||
}
|
||||
|
||||
_handleStorage() {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage');
|
||||
const checkTheme = localStorage.getItem('qortalTheme');
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
|
||||
use(checkLanguage);
|
||||
use(checkLanguage)
|
||||
|
||||
if (checkTheme === 'dark') {
|
||||
this.theme = 'dark';
|
||||
this.theme = 'dark'
|
||||
} else {
|
||||
this.theme = 'light';
|
||||
this.theme = 'light'
|
||||
}
|
||||
document.querySelector('html').setAttribute('theme', this.theme);
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
super.connectedCallback();
|
||||
window.addEventListener('storage', this._handleStorage);
|
||||
super.connectedCallback()
|
||||
window.addEventListener('storage', this._handleStorage)
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
window.removeEventListener('storage', this._handleStorage);
|
||||
super.disconnectedCallback();
|
||||
window.removeEventListener('storage', this._handleStorage)
|
||||
super.disconnectedCallback()
|
||||
}
|
||||
|
||||
async getNodeInfo() {
|
||||
const nodeInfo = await parentEpml.request('apiCall', {
|
||||
url: `/admin/status`,
|
||||
});
|
||||
})
|
||||
|
||||
return nodeInfo;
|
||||
return nodeInfo
|
||||
}
|
||||
|
||||
async getMintingAcccounts() {
|
||||
const mintingAccountData = await parentEpml.request('apiCall', {
|
||||
url: `/admin/mintingaccounts`,
|
||||
});
|
||||
return mintingAccountData;
|
||||
})
|
||||
return mintingAccountData
|
||||
}
|
||||
|
||||
async atMount() {
|
||||
this.changeLanguage();
|
||||
this.changeLanguage()
|
||||
|
||||
|
||||
this.isPageLoading = true;
|
||||
this.isPageLoading = true
|
||||
try {
|
||||
const [nodeInfo, myRewardShareArray, mintingaccounts] =
|
||||
await Promise.all([
|
||||
@ -107,33 +108,33 @@ class BecomeMinter extends LitElement {
|
||||
?.address
|
||||
),
|
||||
this.getMintingAcccounts(),
|
||||
]);
|
||||
])
|
||||
|
||||
this.nodeInfo = nodeInfo;
|
||||
this.nodeInfo = nodeInfo
|
||||
this.rewardSharePublicKey =
|
||||
myRewardShareArray[0]?.rewardSharePublicKey;
|
||||
this.isPageLoading = false;
|
||||
this.mintingAccountData = mintingaccounts;
|
||||
myRewardShareArray[0]?.rewardSharePublicKey
|
||||
this.isPageLoading = false
|
||||
this.mintingAccountData = mintingaccounts
|
||||
this.addressInfo =
|
||||
window.parent.reduxStore.getState().app.accountInfo.addressInfo;
|
||||
window.parent.reduxStore.getState().app.accountInfo.addressInfo
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.error(error)
|
||||
|
||||
this.isPageLoading = false;
|
||||
this.isPageLoading = false
|
||||
}
|
||||
}
|
||||
|
||||
async firstUpdated() {
|
||||
await this.atMount();
|
||||
await this.atMount()
|
||||
}
|
||||
|
||||
async getRewardShareRelationship(recipientAddress) {
|
||||
const myRewardShareArray = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/addresses/rewardshares?recipients=${recipientAddress}`,
|
||||
});
|
||||
})
|
||||
|
||||
return myRewardShareArray;
|
||||
return myRewardShareArray
|
||||
}
|
||||
|
||||
_levelUpBlocks() {
|
||||
@ -141,8 +142,8 @@ class BecomeMinter extends LitElement {
|
||||
blocksNeed(0) -
|
||||
(this.addressInfo?.blocksMinted +
|
||||
this.addressInfo?.blocksMintedAdjustment)
|
||||
).toString();
|
||||
return countBlocksString;
|
||||
).toString()
|
||||
return countBlocksString
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -150,7 +151,7 @@ class BecomeMinter extends LitElement {
|
||||
const findMintingAccount = this.mintingAccountData?.find(
|
||||
(ma) => ma.recipientAccount === window.parent.reduxStore.getState().app?.selectedAddress
|
||||
?.address
|
||||
);
|
||||
)
|
||||
|
||||
const isAlreadySponsored =
|
||||
this.addressInfo?.error !== 124 &&
|
||||
@ -196,8 +197,8 @@ class BecomeMinter extends LitElement {
|
||||
</yes-sponsored>
|
||||
`}
|
||||
</div>
|
||||
`;
|
||||
`
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('become-minter', BecomeMinter);
|
||||
window.customElements.define('become-minter', BecomeMinter)
|
||||
|
@ -6,8 +6,8 @@ import { use, translate, registerTranslateConfig } from 'lit-translate';
|
||||
registerTranslateConfig({
|
||||
loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()),
|
||||
});
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
import '@material/mwc-button';
|
||||
import '@material/mwc-textfield';
|
||||
import '@vaadin/button';
|
||||
|
@ -478,31 +478,6 @@ class ChatWelcomePage extends LitElement {
|
||||
getAddressPublicKey()
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
_textArea(e) {
|
||||
if (e.keyCode === 13 && !e.shiftKey) this._sendMessage()
|
||||
}
|
||||
|
@ -106,6 +106,7 @@ class LevelFounder extends LitElement {
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
this.changeLanguage()
|
||||
this.checkAddressInfo()
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
@ -167,28 +168,6 @@ class LevelFounder extends LitElement {
|
||||
` : ''
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
if (!arr) { return true }
|
||||
return arr.length === 0
|
||||
|
@ -1252,6 +1252,13 @@ class QortalInfoView extends LitElement {
|
||||
`
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
openUserInfo(userData) {
|
||||
if (userData.startsWith('Q') && userData.length == 34) {
|
||||
this.getAddressUserResult(userData)
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -1798,14 +1799,13 @@ class GroupManagement extends LitElement {
|
||||
setTimeout(getOpen_JoinedGroups, 600000)
|
||||
}
|
||||
|
||||
window.addEventListener("contextmenu", (event) => {
|
||||
event.preventDefault();
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener("click", () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
})
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
@ -1821,12 +1821,6 @@ class GroupManagement extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
}
|
||||
|
||||
let configLoaded = false
|
||||
|
||||
parentEpml.ready().then(() => {
|
||||
@ -1844,11 +1838,6 @@ class GroupManagement extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
}
|
||||
@ -2732,28 +2721,6 @@ class GroupManagement extends LitElement {
|
||||
return html`<img src="${url}" onerror="this.src='/img/incognito.png';">`
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
async createGroup(e) {
|
||||
this.resetDefaultSettings()
|
||||
const createFeeInput = this.createFee
|
||||
@ -3650,11 +3617,6 @@ class GroupManagement extends LitElement {
|
||||
return apiKey
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
if (!arr) { return true }
|
||||
return arr.length === 0
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import isElectron from 'is-electron'
|
||||
|
||||
class ChainMessaging extends LitElement {
|
||||
static get properties() {
|
||||
@ -46,20 +47,16 @@ class ChainMessaging extends LitElement {
|
||||
|
||||
this.changeTheme()
|
||||
|
||||
setInterval(() => {
|
||||
this.changeTheme();
|
||||
}, 100)
|
||||
setInterval(() => {
|
||||
this.changeTheme();
|
||||
}, 100)
|
||||
|
||||
window.addEventListener("contextmenu", (event) => {
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
window.addEventListener("click", () => {
|
||||
});
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
|
||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||
|
||||
@ -140,26 +141,16 @@ class Messaging extends LitElement {
|
||||
|
||||
this.changeTheme()
|
||||
|
||||
setInterval(() => {
|
||||
this.changeTheme();
|
||||
}, 100)
|
||||
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)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
let configLoaded = false
|
||||
@ -177,13 +168,6 @@ class Messaging extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
}
|
||||
@ -205,40 +189,6 @@ class Messaging extends LitElement {
|
||||
onPageNavigation(pageUrl) {
|
||||
parentEpml.request('setPageUrl', pageUrl)
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
window.customElements.define('q-messaging', Messaging)
|
||||
|
@ -9,6 +9,7 @@ import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } fro
|
||||
import { qchatStyles } from './q-chat-css.src.js'
|
||||
import WebWorker from 'web-worker:./computePowWorker.src.js';
|
||||
import {repeat} from 'lit/directives/repeat.js';
|
||||
import isElectron from 'is-electron'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
@ -419,8 +420,6 @@ class Chat extends LitElement {
|
||||
|
||||
this.shadowRoot.getElementById('messageBox').addEventListener('keydown', stopKeyEventPropagation);
|
||||
|
||||
|
||||
|
||||
const runFunctionsAfterPageLoad = () => {
|
||||
// Functions to exec after render while waiting for page info...
|
||||
// getDataFromURL()
|
||||
@ -443,16 +442,6 @@ class Chat extends LitElement {
|
||||
|
||||
let runFunctionsAfterPageLoadInterval = setInterval(runFunctionsAfterPageLoad, 100);
|
||||
|
||||
window.addEventListener("contextmenu", (event) => {
|
||||
event.preventDefault()
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener("click", () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
parentEpml.request('closeFramePasteMenu', null)
|
||||
})
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -467,11 +456,12 @@ class Chat extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
parentEpml.request('closeFramePasteMenu', null)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
let configLoaded = false
|
||||
@ -499,20 +489,11 @@ class Chat extends LitElement {
|
||||
}).then(res => {
|
||||
this.balance = res
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
setOpenPrivateMessage(props) {
|
||||
this.openPrivateMessage = props.open;
|
||||
this.shadowRoot.getElementById("sendTo").value = props.name
|
||||
@ -549,8 +530,6 @@ class Chat extends LitElement {
|
||||
window.location.href = `../../group-management/index.html`
|
||||
}
|
||||
|
||||
|
||||
|
||||
async _sendMessage(outSideMsg, msg) {
|
||||
this.isLoading = true;
|
||||
|
||||
@ -914,44 +893,11 @@ class Chat extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
_textArea(e) {
|
||||
|
||||
if (e.keyCode === 13 && !e.shiftKey) this._sendMessage()
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
onPageNavigation(pageUrl) {
|
||||
parentEpml.request('setPageUrl', pageUrl)
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -396,7 +397,15 @@ class MintingInfo extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
let configLoaded = false;
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
let configLoaded = false
|
||||
|
||||
parentEpml.ready().then(() => {
|
||||
parentEpml.subscribe('selected_address', async selectedAddress => {
|
||||
@ -418,9 +427,6 @@ class MintingInfo extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) this.clearSelection()
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
import isElectron from 'is-electron'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
@ -562,15 +563,6 @@ class NameRegistration extends LitElement {
|
||||
setTimeout(fetchMarketSellNames, 180000)
|
||||
}
|
||||
|
||||
window.addEventListener("contextmenu", (event) => {
|
||||
event.preventDefault()
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener("click", () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
})
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -585,10 +577,12 @@ class NameRegistration extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
let configLoaded = false
|
||||
@ -608,11 +602,6 @@ class NameRegistration extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
}
|
||||
@ -870,11 +859,6 @@ class NameRegistration extends LitElement {
|
||||
return apiKey
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
async registerName(e) {
|
||||
this.error = false
|
||||
this.message = ''
|
||||
@ -1178,32 +1162,6 @@ class NameRegistration extends LitElement {
|
||||
validateReceiver()
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
|
||||
const getSelectedText = () => {
|
||||
var text = ""
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
|
@ -2,7 +2,9 @@ import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
import isElectron from 'is-electron'
|
||||
import '../components/qortal-info-view.js'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
})
|
||||
@ -566,15 +568,6 @@ class NamesMarket extends LitElement {
|
||||
setTimeout(fetchMarketSoldNames, 300000)
|
||||
}
|
||||
|
||||
window.addEventListener("contextmenu", (event) => {
|
||||
event.preventDefault()
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener("click", () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
})
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -589,10 +582,12 @@ class NamesMarket extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
let configLoaded = false
|
||||
@ -612,11 +607,6 @@ class NamesMarket extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
}
|
||||
@ -1026,11 +1016,6 @@ class NamesMarket extends LitElement {
|
||||
return apiKey
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
async createCancelSellName() {
|
||||
const name = this.shadowRoot.getElementById("toCancelSellName").value
|
||||
const cancelSellFeeInput = this.cancelSellFee
|
||||
@ -1171,32 +1156,6 @@ class NamesMarket extends LitElement {
|
||||
validateReceiver()
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
|
||||
const getSelectedText = () => {
|
||||
var text = ""
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
round(number) {
|
||||
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
|
||||
return result
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -283,22 +284,8 @@ class NodeManagement extends LitElement {
|
||||
|
||||
this.changeTheme()
|
||||
this.changeLanguage()
|
||||
|
||||
// Call updateMintingAccounts
|
||||
this.updateMintingAccounts()
|
||||
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
this.isTextMenuOpen = true
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener('click', () => {
|
||||
if (this.isTextMenuOpen) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
})
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -313,37 +300,14 @@ class NodeManagement extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
this.shadowRoot.getElementById('addMintingAccountKey').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'addMintingAccountKey')
|
||||
this.myElementId = this.shadowRoot.getElementById('addMintingAccountKey')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
// Calculate HH MM SS from Milliseconds...
|
||||
const convertMsToTime = (milliseconds) => {
|
||||
let day, hour, minute, seconds;
|
||||
@ -414,21 +378,6 @@ class NodeManagement extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c);
|
||||
})
|
||||
|
||||
parentEpml.subscribe('copy_menu_switch', async (value) => {
|
||||
if (value === 'false' && this.isTextMenuOpen === true) {
|
||||
this.clearSelection()
|
||||
this.isTextMenuOpen = false
|
||||
}
|
||||
})
|
||||
|
||||
parentEpml.subscribe('frame_paste_menu_switch', async res => {
|
||||
res = JSON.parse(res)
|
||||
if (res.isOpen === false && this.isPasteMenuOpen === true) {
|
||||
this.pasteToTextBox(this.myElementId)
|
||||
this.isPasteMenuOpen = false
|
||||
}
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
}
|
||||
@ -558,43 +507,6 @@ class NodeManagement extends LitElement {
|
||||
});
|
||||
}
|
||||
|
||||
pasteToTextBox(elementId) {
|
||||
window.focus()
|
||||
navigator.clipboard.readText().then((clipboardText) => {
|
||||
elementId.value += clipboardText
|
||||
elementId.focus()
|
||||
})
|
||||
}
|
||||
|
||||
pasteMenu(event, elementId) {
|
||||
let eventObject = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY, elementId }
|
||||
parentEpml.request('openFramePasteMenu', eventObject)
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
removeMintingAccount(publicKey) {
|
||||
this.removeMintingAccountLoading = true;
|
||||
|
||||
@ -622,11 +534,6 @@ class NodeManagement extends LitElement {
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
if (!arr) return true;
|
||||
return arr.length === 0;
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
})
|
||||
|
||||
// Not sure if these are imported in the proper way:
|
||||
import nacl from '../../../../crypto/api/deps/nacl-fast.js'
|
||||
import Base58 from '../../../../crypto/api/deps/Base58.js'
|
||||
import publicKeyToAddress from '../../../../crypto/api/wallet/publicKeyToAddress.js'
|
||||
@ -184,15 +184,6 @@ class Puzzles extends LitElement {
|
||||
this.changeTheme()
|
||||
this.changeLanguage()
|
||||
|
||||
window.addEventListener("contextmenu", (event) => {
|
||||
event.preventDefault();
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener("click", () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
})
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -207,10 +198,12 @@ class Puzzles extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
const textBox = this.shadowRoot.getElementById("puzzleGuess")
|
||||
@ -335,55 +328,8 @@ class Puzzles extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
|
||||
parentEpml.subscribe('frame_paste_menu_switch', async res => {
|
||||
res = JSON.parse(res)
|
||||
|
||||
if (res.isOpen === false && this.isPasteMenuOpen === true) {
|
||||
this.pasteToTextBox(textBox)
|
||||
this.isPasteMenuOpen = false
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
parentEpml.imReady()
|
||||
|
||||
textBox.addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
// ...
|
||||
} else {
|
||||
this.pasteMenu(event)
|
||||
this.isPasteMenuOpen = true
|
||||
|
||||
// Prevent Default and Stop Event Bubbling
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
}
|
||||
|
||||
changeTheme() {
|
||||
@ -486,54 +432,10 @@ class Puzzles extends LitElement {
|
||||
this.loading = false
|
||||
}
|
||||
|
||||
pasteToTextBox(textBox) {
|
||||
// Return focus to the window
|
||||
window.focus()
|
||||
|
||||
navigator.clipboard.readText().then(clipboardText => {
|
||||
|
||||
textBox.value += clipboardText
|
||||
textBox.focus()
|
||||
});
|
||||
}
|
||||
|
||||
pasteMenu(event) {
|
||||
let eventObject = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
parentEpml.request('openFramePasteMenu', eventObject)
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
if (!arr) { return true }
|
||||
return arr.length === 0
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('puzzles-info', Puzzles)
|
||||
|
@ -3,6 +3,7 @@ import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
import { columnBodyRenderer, gridRowDetailsRenderer } from '@vaadin/grid/lit.js'
|
||||
import isElectron from 'is-electron'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
@ -589,21 +590,6 @@ class QApps extends LitElement {
|
||||
setTimeout(getRelayMode, 600000)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -618,6 +604,14 @@ class QApps extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
let configLoaded = false
|
||||
|
||||
parentEpml.ready().then(() => {
|
||||
@ -639,11 +633,6 @@ class QApps extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
}
|
||||
@ -1197,39 +1186,12 @@ class QApps extends LitElement {
|
||||
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i]
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
if (!arr) { return true }
|
||||
return arr.length === 0
|
||||
|
@ -1,31 +1,29 @@
|
||||
import { LitElement, html, css } from 'lit';
|
||||
import { render } from 'lit/html.js';
|
||||
import { Epml } from '../../../../epml';
|
||||
import {
|
||||
use,
|
||||
get,
|
||||
translate,
|
||||
translateUnsafeHTML,
|
||||
registerTranslateConfig,
|
||||
} from 'lit-translate';
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../../epml'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()),
|
||||
});
|
||||
loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json())
|
||||
})
|
||||
|
||||
import FileSaver from 'file-saver'
|
||||
import * as actions from '../../components/qdn-action-types';
|
||||
import '@material/mwc-button';
|
||||
import '@material/mwc-icon';
|
||||
import * as actions from '../../components/qdn-action-types'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-icon'
|
||||
import '@material/mwc-checkbox'
|
||||
import WebWorker from 'web-worker:./computePowWorkerFile.src.js';
|
||||
import WebWorkerChat from 'web-worker:./computePowWorker.src.js';
|
||||
import { publishData } from '../../../utils/publish-image.js';
|
||||
import WebWorker from 'web-worker:./computePowWorkerFile.src.js'
|
||||
import WebWorkerChat from 'web-worker:./computePowWorker.src.js'
|
||||
import { publishData } from '../../../utils/publish-image.js'
|
||||
import { Loader } from '../../../utils/loader.js';
|
||||
import { QORT_DECIMALS } from '../../../../../crypto/api/constants';
|
||||
import { QORT_DECIMALS } from '../../../../../crypto/api/constants'
|
||||
import nacl from '../../../../../crypto/api/deps/nacl-fast.js'
|
||||
import ed2curve from '../../../../../crypto/api/deps/ed2curve.js'
|
||||
import { mimeToExtensionMap } from '../../components/qdn-action-constants';
|
||||
import { base64ToUint8Array, encryptData, fileToBase64, uint8ArrayToBase64 } from '../../components/qdn-action-encryption';
|
||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
|
||||
import { mimeToExtensionMap } from '../../components/qdn-action-constants'
|
||||
import { base64ToUint8Array, encryptData, fileToBase64, uint8ArrayToBase64 } from '../../components/qdn-action-encryption'
|
||||
|
||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||
|
||||
class WebBrowser extends LitElement {
|
||||
static get properties() {
|
||||
@ -235,14 +233,6 @@ class WebBrowser extends LitElement {
|
||||
configLoaded = true;
|
||||
}
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async (value) => {
|
||||
if (
|
||||
value === 'false' &&
|
||||
window.getSelection().toString().length !== 0
|
||||
) {
|
||||
this.clearSelection();
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@ -487,15 +477,6 @@ class WebBrowser extends LitElement {
|
||||
this.rvnWallet = window.parent.reduxStore.getState().app.selectedAddress.rvnWallet
|
||||
this.arrrWallet = window.parent.reduxStore.getState().app.selectedAddress.arrrWallet
|
||||
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault();
|
||||
this._textMenu(event);
|
||||
});
|
||||
|
||||
window.addEventListener('click', () => {
|
||||
parentEpml.request('closeCopyTextMenu', null);
|
||||
});
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage');
|
||||
const checkTheme = localStorage.getItem('qortalTheme');
|
||||
@ -510,11 +491,13 @@ class WebBrowser extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme);
|
||||
});
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null);
|
||||
}
|
||||
};
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
window.addEventListener('message', async (event) => {
|
||||
if (
|
||||
@ -2814,40 +2797,6 @@ class WebBrowser extends LitElement {
|
||||
return ret;
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = '';
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString();
|
||||
} else if (
|
||||
typeof this.shadowRoot.selection != 'undefined' &&
|
||||
this.shadowRoot.selection.type == 'Text'
|
||||
) {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text;
|
||||
};
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = {
|
||||
pageX: event.pageX,
|
||||
pageY: event.pageY,
|
||||
clientX: event.clientX,
|
||||
clientY: event.clientY,
|
||||
};
|
||||
let textMenuObject = {
|
||||
selectedText: selectedText,
|
||||
eventObject: _eve,
|
||||
isFrame: true,
|
||||
};
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject);
|
||||
}
|
||||
};
|
||||
checkSelectedTextAndShowMenu();
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode =
|
||||
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||
@ -2856,11 +2805,6 @@ class WebBrowser extends LitElement {
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges();
|
||||
window.parent.getSelection().removeAllRanges();
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('web-browser', WebBrowser);
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../../epml'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -445,15 +446,6 @@ class DataManagement extends LitElement {
|
||||
this.changeLanguage()
|
||||
this.showManagement()
|
||||
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener('click', () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
})
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -468,10 +460,12 @@ class DataManagement extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
let configLoaded = false
|
||||
@ -498,13 +492,6 @@ class DataManagement extends LitElement {
|
||||
configLoaded = true
|
||||
}
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
}
|
||||
@ -980,29 +967,6 @@ class DataManagement extends LitElement {
|
||||
return ret
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
async getResourcesGrid() {
|
||||
this.resourcesGrid = this.shadowRoot.querySelector(`#resourcesGrid`)
|
||||
this.pagesControl = this.shadowRoot.querySelector('#pages')
|
||||
@ -1123,11 +1087,6 @@ class DataManagement extends LitElement {
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
if (!arr) { return true }
|
||||
return arr.length === 0
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../../epml'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -241,12 +242,6 @@ class PublishData extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@ -327,15 +322,6 @@ class PublishData extends LitElement {
|
||||
this.changeTheme()
|
||||
this.changeLanguage()
|
||||
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener('click', () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
})
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -350,10 +336,12 @@ class PublishData extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -679,29 +667,6 @@ class PublishData extends LitElement {
|
||||
validate()
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
|
||||
fetchResourceMetadata() {
|
||||
let identifier = this.identifier != null ? this.identifier : "default"
|
||||
|
||||
@ -736,11 +701,6 @@ class PublishData extends LitElement {
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('publish-data', PublishData)
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -426,21 +427,6 @@ class Websites extends LitElement {
|
||||
setTimeout(getRelayMode, 600000)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -455,6 +441,14 @@ class Websites extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
let configLoaded = false
|
||||
|
||||
parentEpml.ready().then(() => {
|
||||
@ -476,11 +470,6 @@ class Websites extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
})
|
||||
parentEpml.imReady()
|
||||
}
|
||||
@ -1101,39 +1090,12 @@ class Websites extends LitElement {
|
||||
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i]
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
let apiKey = myNode.apiKey
|
||||
return apiKey
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
if (!arr) { return true }
|
||||
return arr.length === 0
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -214,15 +215,6 @@ class RewardShare extends LitElement {
|
||||
this.changeTheme()
|
||||
this.changeLanguage()
|
||||
|
||||
window.addEventListener("contextmenu", (event) => {
|
||||
event.preventDefault()
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener("click", () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
})
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -237,14 +229,14 @@ class RewardShare extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
const textBox = this.shadowRoot.getElementById("recipientPublicKey")
|
||||
|
||||
const updateRewardshares = () => {
|
||||
parentEpml.request('apiCall', {
|
||||
url: `/addresses/rewardshares?involving=${this.selectedAddress.address}`
|
||||
@ -271,51 +263,9 @@ class RewardShare extends LitElement {
|
||||
}
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
|
||||
parentEpml.subscribe('copy_menu_switch', async value => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) {
|
||||
this.clearSelection()
|
||||
}
|
||||
})
|
||||
|
||||
parentEpml.subscribe('frame_paste_menu_switch', async res => {
|
||||
res = JSON.parse(res)
|
||||
if (res.isOpen === false && this.isPasteMenuOpen === true) {
|
||||
this.pasteToTextBox(textBox)
|
||||
this.isPasteMenuOpen = false
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
parentEpml.imReady()
|
||||
|
||||
textBox.addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
// ...
|
||||
} else {
|
||||
this.pasteMenu(event)
|
||||
this.isPasteMenuOpen = true
|
||||
|
||||
// Prevent Default and Stop Event Bubbling
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
}
|
||||
|
||||
changeTheme() {
|
||||
@ -733,57 +683,10 @@ class RewardShare extends LitElement {
|
||||
removeReceiver()
|
||||
}
|
||||
|
||||
pasteToTextBox(textBox) {
|
||||
// Return focus to the window
|
||||
window.focus()
|
||||
|
||||
navigator.clipboard.readText().then(clipboardText => {
|
||||
|
||||
textBox.value += clipboardText
|
||||
textBox.focus()
|
||||
});
|
||||
}
|
||||
|
||||
pasteMenu(event) {
|
||||
let eventObject = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
parentEpml.request('openFramePasteMenu', eventObject)
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = "";
|
||||
if (typeof window.getSelection != "undefined") {
|
||||
text = window.getSelection().toString();
|
||||
} else if (typeof this.shadowRoot.selection != "undefined" && this.shadowRoot.selection.type == "Text") {
|
||||
text = this.shadowRoot.selection.createRange().text;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText();
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
if (!arr) { return true }
|
||||
return arr.length === 0
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('reward-share', RewardShare)
|
||||
|
@ -4,6 +4,7 @@ import "../components/ButtonIconCopy.js"
|
||||
import { use, get, translate, registerTranslateConfig } from "lit-translate"
|
||||
import { blocksNeed } from "../../utils/blocks-needed.js"
|
||||
import "../components/ButtonIconCopy.js"
|
||||
import isElectron from 'is-electron'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()),
|
||||
@ -226,6 +227,13 @@ class SponsorshipList extends LitElement {
|
||||
|
||||
async firstUpdated() {
|
||||
await this.atMount()
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async getRewardShareRelationship(recipientAddress) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -2036,17 +2037,6 @@ class TradeBotPortal extends LitElement {
|
||||
setTimeout(getQortArrrPrice, 300000)
|
||||
}
|
||||
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
this._textMenu(event)},
|
||||
{ passive: true }
|
||||
)
|
||||
|
||||
window.addEventListener('click', () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)},
|
||||
{ passive: true }
|
||||
)
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
this.tradeBotBtcBook = JSON.parse(localStorage.getItem(this.btcWallet) || "[]")
|
||||
this.tradeBotLtcBook = JSON.parse(localStorage.getItem(this.ltcWallet) || "[]")
|
||||
@ -2063,8 +2053,12 @@ class TradeBotPortal extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) parentEpml.request('closeCopyTextMenu', null)
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
this.btcWallet = window.parent.reduxStore.getState().app.selectedAddress.btcWallet.address
|
||||
@ -2106,10 +2100,6 @@ class TradeBotPortal extends LitElement {
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
|
||||
parentEpml.subscribe('copy_menu_switch', async (value) => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) this.clearSelection()
|
||||
})
|
||||
|
||||
let coinSelectionMenu = this.shadowRoot.getElementById("coinSelectionMenu")
|
||||
|
||||
coinSelectionMenu.addEventListener('change', function () {
|
||||
@ -3352,42 +3342,6 @@ class TradeBotPortal extends LitElement {
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = {
|
||||
pageX: event.pageX,
|
||||
pageY: event.pageY,
|
||||
clientX: event.clientX,
|
||||
clientY: event.clientY,
|
||||
}
|
||||
let textMenuObject = {
|
||||
selectedText: selectedText,
|
||||
eventObject: _eve,
|
||||
isFrame: true,
|
||||
}
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
clearTradeBotForm() {
|
||||
this.shadowRoot.getElementById('autoBuy' + this.listedCoins.get(this.selectedCoin).coinCode + 'QortAmountInput').value = this.initialAmount
|
||||
this.shadowRoot.getElementById('autoBuy' + this.listedCoins.get(this.selectedCoin).coinCode + 'PriceInput').value = this.initialAmount
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -1378,17 +1379,6 @@ class TradePortal extends LitElement {
|
||||
setTimeout(getQortArrrPrice, 300000)
|
||||
}
|
||||
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
this._textMenu(event)},
|
||||
{ passive: true }
|
||||
)
|
||||
|
||||
window.addEventListener('click', () => {
|
||||
parentEpml.request('closeCopyTextMenu', null)},
|
||||
{ passive: true }
|
||||
)
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -1399,8 +1389,12 @@ class TradePortal extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) parentEpml.request('closeCopyTextMenu', null)
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
this.btcWallet = window.parent.reduxStore.getState().app.selectedAddress.btcWallet.address
|
||||
@ -1443,10 +1437,6 @@ class TradePortal extends LitElement {
|
||||
this.config = JSON.parse(c)
|
||||
})
|
||||
|
||||
parentEpml.subscribe('copy_menu_switch', async (value) => {
|
||||
if (value === 'false' && window.getSelection().toString().length !== 0) this.clearSelection()
|
||||
})
|
||||
|
||||
let coinSelectionMenu = this.shadowRoot.getElementById("coinSelectionMenu")
|
||||
|
||||
coinSelectionMenu.addEventListener('change', function () {
|
||||
@ -2790,42 +2780,6 @@ class TradePortal extends LitElement {
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = {
|
||||
pageX: event.pageX,
|
||||
pageY: event.pageY,
|
||||
clientX: event.clientX,
|
||||
clientY: event.clientY,
|
||||
}
|
||||
let textMenuObject = {
|
||||
selectedText: selectedText,
|
||||
eventObject: _eve,
|
||||
isFrame: true,
|
||||
}
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
clearBuyForm() {
|
||||
this.shadowRoot.getElementById('buyAmountInput').value = this.initialAmount
|
||||
this.shadowRoot.getElementById('buyPriceInput').value = this.initialAmount
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { render } from 'lit/html.js'
|
||||
import { Epml } from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
@ -756,21 +757,6 @@ class MultiWallet extends LitElement {
|
||||
this.wallets.get('rvn').wallet = window.parent.reduxStore.getState().app.selectedAddress.rvnWallet
|
||||
this.wallets.get('arrr').wallet = window.parent.reduxStore.getState().app.selectedAddress.arrrWallet
|
||||
})
|
||||
|
||||
parentEpml.subscribe('copy_menu_switch', async (value) => {
|
||||
if (value === 'false' && this.isTextMenuOpen === true) {
|
||||
this.clearSelection()
|
||||
this.isTextMenuOpen = false
|
||||
}
|
||||
})
|
||||
|
||||
parentEpml.subscribe('frame_paste_menu_switch', async res => {
|
||||
res = JSON.parse(res)
|
||||
if (res.isOpen === false && this.isPasteMenuOpen === true) {
|
||||
this.pasteToTextBox(this.myElementId)
|
||||
this.isPasteMenuOpen = false
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@ -2660,18 +2646,6 @@ class MultiWallet extends LitElement {
|
||||
|
||||
this.showWallet()
|
||||
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
this.isTextMenuOpen = true
|
||||
this._textMenu(event)
|
||||
})
|
||||
|
||||
window.addEventListener('click', () => {
|
||||
if (this.isTextMenuOpen) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
})
|
||||
|
||||
window.addEventListener('storage', () => {
|
||||
const checkLanguage = localStorage.getItem('qortalLanguage')
|
||||
const checkTheme = localStorage.getItem('qortalTheme')
|
||||
@ -2686,386 +2660,13 @@ class MultiWallet extends LitElement {
|
||||
document.querySelector('html').setAttribute('theme', this.theme)
|
||||
})
|
||||
|
||||
window.onkeyup = (e) => {
|
||||
if (e.keyCode === 27) {
|
||||
parentEpml.request('closeCopyTextMenu', null)
|
||||
}
|
||||
if (!isElectron()) {
|
||||
} else {
|
||||
window.addEventListener('contextmenu', (event) => {
|
||||
event.preventDefault()
|
||||
window.parent.electronAPI.showMyMenu()
|
||||
})
|
||||
}
|
||||
|
||||
this.shadowRoot.getElementById('amountInput').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'amountInput')
|
||||
this.myElementId = this.shadowRoot.getElementById('amountInput')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('recipient').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'recipient')
|
||||
this.myElementId = this.shadowRoot.getElementById('recipient')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('btcAmountInput').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'btcAmountInput')
|
||||
this.myElementId = this.shadowRoot.getElementById('btcAmountInput')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('btcRecipient').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'btcRecipient')
|
||||
this.myElementId = this.shadowRoot.getElementById('btcRecipient')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('ltcAmountInput').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'ltcAmountInput')
|
||||
this.myElementId = this.shadowRoot.getElementById('ltcAmountInput')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('ltcRecipient').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'ltcRecipient')
|
||||
this.myElementId = this.shadowRoot.getElementById('ltcRecipient')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('dogeAmountInput').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'dogeAmountInput')
|
||||
this.myElementId = this.shadowRoot.getElementById('dogeAmountInput')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('dogeRecipient').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'dogeRecipient')
|
||||
this.myElementId = this.shadowRoot.getElementById('dogeRecipient')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('dgbAmountInput').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'dgbAmountInput')
|
||||
this.myElementId = this.shadowRoot.getElementById('dgbAmountInput')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('dgbRecipient').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'dgbRecipient')
|
||||
this.myElementId = this.shadowRoot.getElementById('dgbRecipient')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('rvnAmountInput').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'rvnAmountInput')
|
||||
this.myElementId = this.shadowRoot.getElementById('rvnAmountInput')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('rvnRecipient').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'rvnRecipient')
|
||||
this.myElementId = this.shadowRoot.getElementById('rvnRecipient')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('arrrAmountInput').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'arrrAmountInput')
|
||||
this.myElementId = this.shadowRoot.getElementById('arrrAmountInput')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('arrrRecipient').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'arrrRecipient')
|
||||
this.myElementId = this.shadowRoot.getElementById('arrrRecipient')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
|
||||
this.shadowRoot.getElementById('arrrMemo').addEventListener('contextmenu', (event) => {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
} else {
|
||||
this.myElementId = ''
|
||||
this.pasteMenu(event, 'arrrMemo')
|
||||
this.myElementId = this.shadowRoot.getElementById('arrrMemo')
|
||||
this.isPasteMenuOpen = true
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
})
|
||||
}
|
||||
|
||||
renderWarning() {
|
||||
@ -4210,19 +3811,6 @@ class MultiWallet extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
pasteToTextBox(elementId) {
|
||||
window.focus()
|
||||
navigator.clipboard.readText().then((clipboardText) => {
|
||||
elementId.value += clipboardText
|
||||
elementId.focus()
|
||||
})
|
||||
}
|
||||
|
||||
pasteMenu(event, elementId) {
|
||||
let eventObject = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY, elementId }
|
||||
parentEpml.request('openFramePasteMenu', eventObject)
|
||||
}
|
||||
|
||||
async sendQort() {
|
||||
const amount = this.shadowRoot.getElementById('amountInput').value
|
||||
let recipient = this.shadowRoot.getElementById('recipient').value
|
||||
@ -5649,41 +5237,12 @@ class MultiWallet extends LitElement {
|
||||
this.transactionsGrid.items = this.wallets.get(this._selectedWallet).transactions.slice(start, end)
|
||||
}
|
||||
|
||||
_textMenu(event) {
|
||||
const getSelectedText = () => {
|
||||
var text = ''
|
||||
if (typeof window.getSelection != 'undefined') {
|
||||
text = window.getSelection().toString()
|
||||
} else if (typeof this.shadowRoot.selection != 'undefined' && this.shadowRoot.selection.type == 'Text') {
|
||||
text = this.shadowRoot.selection.createRange().text
|
||||
}
|
||||
return text
|
||||
}
|
||||
|
||||
const checkSelectedTextAndShowMenu = () => {
|
||||
let selectedText = getSelectedText()
|
||||
if (selectedText && typeof selectedText === 'string') {
|
||||
let _eve = { pageX: event.pageX, pageY: event.pageY, clientX: event.clientX, clientY: event.clientY }
|
||||
|
||||
let textMenuObject = { selectedText: selectedText, eventObject: _eve, isFrame: true }
|
||||
|
||||
parentEpml.request('openCopyTextMenu', textMenuObject)
|
||||
}
|
||||
}
|
||||
checkSelectedTextAndShowMenu()
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
clearSelection() {
|
||||
window.getSelection().removeAllRanges()
|
||||
window.parent.getSelection().removeAllRanges()
|
||||
}
|
||||
|
||||
transactionItem(transactionObject) {
|
||||
return `
|
||||
<div class='transaction-item ${transactionObject.type}'>
|
||||
|
Loading…
x
Reference in New Issue
Block a user