Make WordPress Core

Opened 11 years ago

Last modified 7 years ago

#24795 new enhancement

OS X Treatment

Reported by: technosailor's profile technosailor Owned by:
Milestone: Future Release Priority: normal
Severity: trivial Version: 3.6
Component: Administration Keywords: has-patch
Focuses: javascript, administration 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 11 years ago.
24795.2.diff (1.6 KB) - added by technosailor 11 years ago.
24795.3.diff (1.6 KB) - added by technosailor 11 years ago.
You're right though. It does need to be return false;
24795.4.diff (2.3 KB) - added by technosailor 11 years ago.
No JS compatible and reintroduce is_osx() function

Download all attachments as: .zip

Change History (16)

@technosailor
11 years ago

#1 follow-up: @nacin
11 years 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.

#2 @technosailor
11 years 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.

#3 @technosailor
11 years 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.

#4 @nacin
11 years 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?

#5 @technosailor
11 years 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.

@technosailor
11 years ago

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

#6 @wonderboymusic
11 years ago

  • Milestone changed from Future Release to 3.7

these are all marked 3.7-early

@technosailor
11 years ago

No JS compatible and reintroduce is_osx() function

#7 @helen
11 years 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.

#8 in reply to: ↑ 1 @johnbillion
10 years 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+.

#9 @technosailor
10 years ago

Any way we can get this in for 4.1? Really needing that is_osx() function :)

This ticket was mentioned in Slack in #core by helen. View the logs.


9 years ago

#11 @swissspidy
7 years ago

  • Component changed from Permalinks to Administration
  • Focuses javascript administration added
  • Keywords 3.7-early removed

This ticket was mentioned in Slack in #core-editor by swissspidy. View the logs.


7 years ago

Note: See TracTickets for help on using tickets.