It would be useful to copy paste addresses when viewing a transaction. Add button for this.
Details
- Reviewers
emack Fabien - Group Reviewers
Restricted Project - Commits
- rABC2e93345905cb: [explorer] Add copy paste button for addresses on transaction page
preview and test feature
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- explorer-copy-address
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 29899 Build 59333: Build Diff Build 59332: arc lint + arc unit
Event Timeline
web/explorer/explorer-server/code/common.js | ||
---|---|---|
417 | we cannot get addresses by ID without programmatically generating nonce IDs, and some txs would have 1000s. So we add a new function to copy a given param. It is "better" to copy "the text that is there on the page." But, in this case, they are both generated from the same variable in the template. | |
web/explorer/explorer-server/templates/base.html | ||
1 | I think auto change from linter as this page has not been edited in some time. | |
105 | not sure what the original hash value was. I took the same chars from sha256sum code/common.js output. The important thing is the value is different from the "old" deployed version. So the site will not use the cached version and will get the new function. |
web/explorer/explorer-server/code/common.js | ||
---|---|---|
421 | What's the need behind the 1.3 second delay here? |
web/explorer/explorer-server/code/common.js | ||
---|---|---|
421 | tbh I didn't even see this, I just directly copied this function from the existing copyText and only changed what is being copied. looking into it -- we should keep it. What's happening here
1.3s seems like a decent value, already what the app has been using. Since this function is not trying to alter the behavior of the app, just cover the ability to copy a new variable, makes sense to keep it the same. |
Build Bitcoin ABC Diffs / Diff Testing (preview-explorer) passed.
Preview is available at http://51.178.130.230:41698 for the next 60 minutes.
This doesn't work for me. I see the icon and the tooltip but on click I get TypeError: navigator.clipboard is undefined (Firefox on linux)
web/explorer/explorer-server/code/common.js | ||
---|---|---|
418 | Please use brackets, it's hard to know where the scope of this if ends | |
425 | navigator.clipboard is undefined at this line |
Does copy paste in other places work, like address at top of address page, or txid at top of tx page?
Build Bitcoin ABC Diffs / Diff Testing (preview-explorer) passed.
Preview is available at http://51.83.66.92:41482 for the next 60 minutes.
Clicking the copy icon for txid at the top gives this
Whilst clicking the copy icon for the addresses triggers the tooltip but no response. Have verified address has not been copied to clipboard.
I can't repeat this with cargo run locally .. possibly there is some functionality missing in the preview site. will test
Ok I was able to repeat this in a diff that makes no changes from master except a token test text change
So -- there is some issue where the JS does not work on explorer previews, prob related to not being https, would have to troubleshoot -- anyway not related to this diff
test with cargo run locally
OK I confirm this is the issue, the clipboard is only defined for https or localhost so it can't work on preview but it works just fine locally.