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

jquery: Make code-listing line numbers unselectable #436

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Dec 13, 2022

This PR uses the well-supported1 user-select: none CSS property on the line number gutter in syntaxhighlighter code blocks, to prevent accidental inclusion when copy-pasting the contained code.

Notes

  1. while user-select: none has broad browser support, both Safari versions do require its use as the vendor-prefixed -webkit-user-select (also included in the PR changes).

(CLA Note: As I mentioned in jquery/contribute.jquery.org#149, the CLA links across the documentation are currently linking to an OpenJSF page with no CLA in evidence. I have not signed the CLA simply because I can't find any way to sign it.) Never mind, the bot's link worked.

Prevent accidental inclusion of the line numbers,
when copy-pasting from syntaxhighlighter code blocks.

Also use -webkit-user-select for Safari (desktop & mobile).

Signed-off-by: FeRD (Frank Dana) <[email protected]>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 13, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: ferdnyc / name: Frank Dana (3559b2b)

Copy link
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like a good idea, thanks! One comment.

themes/jquery/css/base.css Outdated Show resolved Hide resolved
Co-authored-by: Michał Gołębiowski-Owczarek <[email protected]>
@ferdnyc ferdnyc requested a review from mgol December 13, 2022 11:04
Copy link
Member

@mgol mgol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mgol mgol changed the title base.css: Unselectable code-listing line numbers jquery: Make code-listing line numbers unselectable Dec 13, 2022
@mgol mgol merged commit bde0bd7 into jquery:main Dec 13, 2022
@ferdnyc ferdnyc deleted the patch-1 branch December 14, 2022 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants