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

fix typos #36525

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/ignore-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3657,6 +3657,7 @@ Picryl
Picturefill
PIDOM
pilcrow
pillarboxed
pinetools
Pingback
pingbacks
Expand Down
2 changes: 2 additions & 0 deletions .vscode/terms-abbreviations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ cdylib
CEST
CIELAB
cjpeg
closewatcher
commandfor
Condei
Damme
Datagram
Expand Down
8 changes: 4 additions & 4 deletions files/en-us/web/api/invoker_commands_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ Historically creating these kinds of controls has required JavaScript event list
### Creating custom commands

```html
<button commandfor="myimg" command="--rotate-left">Rotate left</button>
<button commandfor="myimg" command="--rotate-right">Rotate right</button>
<img id="myimg" src="photo.jpg" alt="[add appropriate alt text here]" />
<button commandfor="my-img" command="--rotate-left">Rotate left</button>
<button commandfor="my-img" command="--rotate-right">Rotate right</button>
<img id="my-img" src="photo.jpg" alt="[add appropriate alt text here]" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

FWIW I hate that guideline. What's wrong with snake case. Boo hiss.

Copy link
Contributor Author

@OnkarRuikar OnkarRuikar Oct 28, 2024

Choose a reason for hiding this comment

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

Don't hate the messenger :|
We can start a discussion...

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't hate the messenger. I prefer snake case generally because:

  • There is never a case where you copy in your id into an API and the separator makes it two identifiers separated by a minus sign.
  • Most text editors/IDEs let you select a whole identifier by double click if it is snake case but not if it is -.

I have a preference for a slightly easier life as an author. But perhaps there is a reason why - is preferred by others?

```

```js
const myImg = document.getElementById("myimg");
const myImg = document.getElementById("my-img");

myImg.addEventListener("command", (event) => {
if (event.command == "--rotate-left") {
Expand Down