WordPress.org

Make WordPress Core

Opened 12 months ago

Last modified 9 months ago

#24795 new enhancement

OS X Treatment

Reported by: technosailor Owned by:
Milestone: Future Release Priority: normal
Severity: trivial Version: 3.6
Component: Permalinks Keywords: has-patch 3.7-early
Focuses: Cc:

Description

Just a minor annoyance. Certain things are inherently different about using a Mac over any other Operating system. Specific to my case is keymappings. While I suspect most Mac users are smart enough to read "Ctrl + A" and translate that to "CMD + A", we should be explicit when we can.

This patch inrtroduces pluggable function is_osx() that is really basic. Sadly, relies on User Agents and so is inherently flawed, but mainly useful anyway.

Using this function, the Permalinks Options screen uses Command A instead of CTRL A when .htaccess is not writable.

A little thing but annoying enough to warrant a patch.

Attachments (4)

24795.diff (1.9 KB) - added by technosailor 12 months ago.
24795.2.diff (1.6 KB) - added by technosailor 12 months ago.
24795.3.diff (1.6 KB) - added by technosailor 12 months ago.
You're right though. It does need to be return false;
24795.4.diff (2.3 KB) - added by technosailor 11 months ago.
No JS compatible and reintroduce is_osx() function

Download all attachments as: .zip

Change History (12)

technosailor12 months ago

comment:1 follow-up: nacin12 months ago

Nice catch.

Ideally we should just eliminate this instruction and select all the moment they click into the textarea. People know how to copy, we shouldn't need to instruct them.

On TinyMCE's keyboard shortcuts popup, we actually already do browser detection to figure out which shortcuts to show, if I recall correctly.

comment:2 technosailor12 months ago

I'm okay removing the pluggable function and approaching from a JS perspective, though half of me suspects that having an API call for Operating System detection is still useful.

comment:3 technosailor12 months ago

New patch avoids the pluggable function and fixes just the permalinks options screen. It removes the Cmd/Ctrl text altogethewr and includes a jQuery routine for selecting all when clicking in the texarea.

technosailor12 months ago

comment:4 nacin12 months ago

  • Component changed from Text Changes to Permalinks
  • Keywords 3.7-early added
  • Milestone changed from Awaiting Review to Future Release

Looks good. Could you explain the return;? Was that meant to be a return false; (as in stopping propagation and default actions) or?

comment:5 technosailor12 months ago

I had it as return false in my code but changed it to just return to match syntax in the previous code block.

It works around a bug in Chrome where mouseup is fired and deselects the textarea. I short circuit that bug by unbinding the mouseup event and preventing further events on that textarea.

technosailor12 months ago

You're right though. It does need to be return false;

comment:6 wonderboymusic11 months ago

  • Milestone changed from Future Release to 3.7

these are all marked 3.7-early

technosailor11 months ago

No JS compatible and reintroduce is_osx() function

comment:7 helen10 months ago

  • Milestone changed from 3.7 to Future Release

Minor thing, enhancement punting time. Also: adding pluggable functions seems like a bad idea - filter would be better.

comment:8 in reply to: ↑ 1 johnbillion9 months ago

Replying to nacin:

On TinyMCE's keyboard shortcuts popup, we actually already do browser detection to figure out which shortcuts to show, if I recall correctly.

We (also?) need to do this for the formatting toolbar button title attributes. The buttons which say ctrl+ should say cmd+.

Note: See TracTickets for help on using tickets.