Make WordPress Core

Opened 10 years ago

Closed 8 years ago

#2560 closed defect (bug) (wontfix)

Javascript alert I18N and interface consistency

Reported by: SteveAgl Owned by:
Milestone: Priority: high
Severity: normal Version: 2.0.1
Component: Administration Keywords:
Focuses: Cc:


Referring to the thrad on polyglot ML: http://comox.textdrive.com/pipermail/wp-polyglots/2006-March/000882.html

Javascript alerts:  some have "OK" to delete, "Cancel" to stop;  
others have "Cancel" to stop, "OK" to delete (and variations).  I  
suggest standardising on the first, since that's the order the  
buttons appear in Windows.

Her the patch to stndardise all the alert to OK - Cancel order.

Attachments (1)

javascript-alerts.patch (10.9 KB) - added by SteveAgl 10 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 @davidhouse10 years ago

Can we not have verb-based buttons which are regarded to be more usable? I.e.,

"Warning; this will irretrievably delete this post. [ Delete ]; [ Cancel ]"

comment:2 @ryan10 years ago

I prefer using imperative verbs too.

Alert Buttons

comment:3 @markjaquith10 years ago

+1 ... and let's standardize the order of them as SteveAgl suggested... so that it's always [ Delete ] [ Cancel ] or [ VERB ] [ Cancel ] in generic form.

comment:4 @SteveAgl10 years ago

+1 for using imperative verbs too, using the order suggested on polyglots ML.

comment:5 @ryan10 years ago

Let's do it. Anyone want to work up a new patch?

comment:6 @davidhouse10 years ago

  • Owner changed from SteveAgl to davidhouse
  • Status changed from new to assigned

I'll give this a shot. If anyone feels like working up a list of where in the admin the dialogs appear, that'd be great ;) If not, I'll do a hunt myself.

comment:7 @mdawaffe10 years ago

davidhouse, you may run into collision here with the patch I'm working on over at #2561. I'll be putting up some code soon.

comment:8 @davidhouse10 years ago

Sure. I'll wait.

comment:9 @davidhouse10 years ago

This could be tricky. There's no JS call to pop up a dialog with custom text on the buttons: you get OK or OK/Cancel.

We could do this with a window, but it'd likely get popup-blocked. How about doing some JS-fu to grey out the screen, then display a box in the middle with some text and some buttons? This really goes beyond the JS skills/knowledge I have, so shoot this down if it sucks. Also, for the coding, I'd probably want to delegate as this isn't exactly my area of expertise.

comment:10 @mdawaffe10 years ago

I don't know where all the JS confirms are in WP, but consider this.

For the JS confirms spawned by AJAX calls (see #2561), what if we replaced the actual HTML item being deleted with an "Are you sure..." message? As an example, say you go to Manage->Categories and delete one of the categories listed in that table. The TR is replaced with "Are you sure you want to delete this Category named X? _Delete_ _Cancel_". On Delete, the TR would fade away, on Cancel the TR would be re-replaced by the old information.

My friend Greg thought of this idea, seems slick to me.

comment:11 @matt9 years ago

I like the direction of the modal dialogs, especially if there was a checkbox "never show this to me again." They would need to be just as accesible as regular popups, in that they should have proper tabbing between them (and no where else in the page), they should capture proper key presses, and have a sane "enter" default, be exitable with "esc", etc.

Also a little visual pizazz would be nice, say a OS X type drop shadow on the box, and a smoother background transition (like the widgets plugin has).

comment:12 @matt9 years ago

BTW, the above comment was in response to:



comment:13 @leftjustified9 years ago

I've started on the modifications suggested by Matt.

  • 'Do not show me again' checkbox added. Should ticking this box disable the Cancel button? Allowing them to set an auto-cancel makes the delete functionality unusable :-/
  • The captureKeys observer kicks in when a modal dialog is activated and gets removed on closing the dialog.
  • Escape key is mapped to the cancel function.
  • Focus is immedietly moved to the first input element (the 'Do not show me..' check) upon display of the window.

I'm in the process of restricting the tab order to form elements and links within the window. It's a mess at the moment, if anyone would like to have a look the function is called captureKeys. Go on, you know you want to! ;)

comment:14 @matt9 years ago

  • Milestone changed from 2.1 to 2.2
  • Priority changed from normal to high

BTW, I really want to get the modal windows from above in, but let's target 2.2.

comment:15 @rob1n9 years ago

I'm +100 for modal windows. Makes for UI consistency and it's more reliable/useful than JavaScript's alert() or its sisters.

comment:16 @rob1n9 years ago

  • Owner changed from davidhouse to rob1n
  • Status changed from assigned to new

comment:18 @rob1n9 years ago

  • Milestone changed from 2.2 to 2.3

comment:19 @rob1n8 years ago

  • Owner rob1n deleted

comment:20 @Nazgul8 years ago

  • Milestone changed from 2.3 (trunk) to 2.4 (future)

comment:21 @Nazgul8 years ago

  • Milestone 2.5 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This ticket has had no real activity for some time and has partially been superseded by #4089, so closing as wontfix for now.

Feel free to re-open if you have additional patches/information/suggestions/...

Note: See TracTickets for help on using tickets.