Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addresses issue #244 adds a copy button to code blocks #247

Merged
merged 3 commits into from May 5, 2023

Conversation

finanalyst
Copy link
Collaborator

The patch affect Website/ogdenwebb by

  • changing the template for block code to add a button,
  • adding the js code to core.js, and
  • adding CSS for the button (placing on top left of block).

The JS has been tested for Firefox. Uses execCommand, which is deprecated because Firefox does not recognise all of Clipboard API.

This took a while to get a copy that would remove all HTML but respect whitespace.

MINOR change to lists CSS to align bullets with left margin.

The patch affect `Website/ogdenwebb` by changing the template for block code to add a button, adding the js code to core.js, and adding CSS for the button (placing on top left of block).
The JS has been tested for Firefox. Uses `execCommand`, which is deprecated because Firefox does not recognise all of Clipboard API. This took a while to get a copy that would remove all HTML but respect whitespace.
MINOR change to `lists` CSS to align bullets with left margin.
@finanalyst finanalyst requested a review from coke May 2, 2023 16:28
@finanalyst finanalyst added the UI CSS/HTML issues label May 2, 2023
@coke
Copy link
Contributor

coke commented May 2, 2023

I don't see any code to actually do the copying here, just changes to generated HTML/CSS

@finanalyst
Copy link
Collaborator Author

@coke whoops. missed adding the change to core.js
Effect can be seen at [new-raku](https://new-raku.finanalyst.org] try eg. Independent routines

The patch affect `Website/ogdenwebb` by changing the template for block code to add a button, adding the js code to core.js, and adding CSS for the button (placing on top left of block).
The JS has been tested for Firefox. Uses `execCommand`, which is deprecated because Firefox does not recognise all of Clipboard API. This took a while to get a copy that would remove all HTML but respect whitespace.
MINOR change to `lists` CSS to align bullets with left margin.
@coke
Copy link
Contributor

coke commented May 2, 2023

Tested on chrome on windows, OK.

@finanalyst finanalyst requested a review from coke May 5, 2023 15:30
@coke coke merged commit 52549cf into main May 5, 2023
@coke coke deleted the add_copy_button_to_code_blocks branch May 5, 2023 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI CSS/HTML issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants