-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommit-order.html
74 lines (74 loc) · 2.97 KB
/
commit-order.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>Commit Order Example</title>
<!-- Load the required javascript and CSS files. -->
<link rel="stylesheet" type="text/css" href="../modules/commit-order.css">
<script src="../modules/commit-order.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function(event) {
dlgSetCommitOrder();
});
</script>
</head>
<body>
<p>
The commit-order module allows you to order elements differently on
different plattforms.
</p>
<p>
Windows and Mac have different conventions for the order of dialog commit buttons.
Windows has the default/affirmative button furthest to the left
(first in Western reading order)
while Mac has it to the right (closest to where you stop scanning the dialog).
</p>
<blockquote>
Present the commit buttons in the following order:
<ol>
<li>OK/[Do it]/Yes</li>
<li>[Don't do it]/No</li>
<li>Cancel</li>
<li>Apply (if present)</li>
<li>Help (if present)</li>
</ol>
<footer>—
<cite><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dn742499(v=vs.85).aspx">Microsoft Dev Center</a></cite>
</footer>
</blockquote>
<blockquote>
An action button, which initiates the dialog’s primary action, should be farthest to the right. A Cancel button should be to the immediate left of the action button. If a third dismissal button exists, it should be to the left of the Cancel button. A Help button should be farthest to the left
<footer>—
<cite><a href="https://developer.apple.com/macos/human-interface-guidelines/windows-and-views/dialogs/">Apple human Interface Guidelines</a></cite>
</footer>
</blockquote>
<p>
In the HTML source the elements are defined in the Windows order (because
I personally use Windows, lol). To reverse elements on Mac only, wrap them
in an element with the class <code>dlg-reverse-on-mac</code>.
</p>
<span class="dlg-reverse-on-mac">
<button>Ok</button>
<button>Cancel</button>
</span>
<p>
All elements cannot in all cases on Mac simply be reversed though.
For instance, both Windows and back have buttons to the Previous step to
the left, and buttons to the Next step to the right.
Reversing all would lead to faulty Next and Previous buttons.
reversing none would lead to the cancel button being in the wrong position.
</p>
<p>
To mix buttons that should be reversed and buttons that should not because
reversed, use a nested <code>dlg-do-not-reverse-on-mac</code>element
within the <code>dlg-reverse-on-mac</code> element.
</p>
<span class="dlg-reverse-on-mac">
<span class="dlg-do-not-reverse-on-mac">
<button>← Previous</button>
<button>Next →</button>
</span>
<button>Cancel</button>
</span>
</body>
</html>