1 | Index: themes/base/jquery.ui.core.css |
---|
2 | =================================================================== |
---|
3 | --- themes/base/jquery.ui.core.css (revision 3860) |
---|
4 | +++ themes/base/jquery.ui.core.css (working copy) |
---|
5 | @@ -30,8 +30,33 @@ |
---|
6 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } |
---|
7 | |
---|
8 | |
---|
9 | /* Misc visuals |
---|
10 | ----------------------------------*/ |
---|
11 | |
---|
12 | /* Overlays */ |
---|
13 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } |
---|
14 | + |
---|
15 | +/* High contrast compatibility |
---|
16 | ++----------------------------------*/ |
---|
17 | +.high-contrast .ui-icon, |
---|
18 | +.high-contrast .ui-dialog .ui-dialog-titlebar-close, |
---|
19 | +.high-contrast .ui-datepicker .ui-datepicker-next, |
---|
20 | +.high-contrast .ui-datepicker .ui-datepicker-prev |
---|
21 | +{ width: auto; text-indent: 0; } |
---|
22 | + |
---|
23 | +/* Focus highlight for tabs */ |
---|
24 | +.high-contrast .ui-tabs.ui-widget-content .ui-state-focus { border-width: 3px; } |
---|
25 | + |
---|
26 | +/* Focus highlight for accordion (also out of high contrast, maybe that needs to go somewhere else? */ |
---|
27 | +.ui-accordion-header.ui-state-focus { border-width: 2px; } |
---|
28 | +.high-contrast .ui-accordion-header.ui-state-focus { border-width: 4px; } |
---|
29 | + |
---|
30 | +/* Fancy positioning for datepicker buttons: */ |
---|
31 | +.high-contrast .ui-datepicker .ui-datepicker-next span { position: static; margin: 3px; } |
---|
32 | +.high-contrast .ui-datepicker .ui-datepicker-prev span { position: static; margin: 3px; } |
---|
33 | + |
---|
34 | +/* Value for progress bar */ |
---|
35 | + |
---|
36 | +.ui-progressbar-valuetext { display: none; } |
---|
37 | +.high-contrast .ui-progressbar-valuetext { display: block; position: relative; margin: 0; margin-top: 3px; top: -100%; width: 100%; text-align: center; } |
---|
38 | + |
---|
39 | Index: ui/jquery.ui.core.js |
---|
40 | =================================================================== |
---|
41 | --- ui/jquery.ui.core.js (revision 3860) |
---|
42 | +++ ui/jquery.ui.core.js (working copy) |
---|
43 | @@ -197,9 +197,39 @@ $.extend($.expr[':'], { |
---|
44 | }, |
---|
45 | |
---|
46 | tabbable: function(element) { |
---|
47 | var tabIndex = $.attr(element, 'tabindex'); |
---|
48 | return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable'); |
---|
49 | } |
---|
50 | }); |
---|
51 | |
---|
52 | +// Initialize high-contrast mode check when we have document.body |
---|
53 | +$(function() { |
---|
54 | + // create div for testing if high contrast mode is on or images are turned off |
---|
55 | + var div = document.createElement("div"); |
---|
56 | + // The ui-icon class will give it a background image. |
---|
57 | + // Proper caching should mean no additional requests will be made. |
---|
58 | + div.className = "ui-icon"; |
---|
59 | + div.style.borderWidth = "1px"; |
---|
60 | + div.style.borderStyle = "solid"; |
---|
61 | + div.style.borderTopColor = "red"; |
---|
62 | + div.style.borderRightColor = "green"; |
---|
63 | + div.style.position = "absolute"; |
---|
64 | + div.style.top = "-999px"; |
---|
65 | + document.body.appendChild(div); |
---|
66 | + |
---|
67 | + // test it |
---|
68 | + var bkImg = $.curCSS(div, "backgroundImage"); |
---|
69 | + $.highContrast = ($.curCSS(div, "borderTopColor") == $.curCSS(div, "borderRightColor")) || |
---|
70 | + (bkImg != null && (bkImg == "none" || bkImg == "url(invalid-url:)")); |
---|
71 | + if ($.browser.msie) { |
---|
72 | + div.outerHTML = ""; // prevent mixed-content warning, see http://support.microsoft.com/kb/925014 |
---|
73 | + } else { |
---|
74 | + document.body.removeChild(div); |
---|
75 | + } |
---|
76 | + if ($.highContrast) { |
---|
77 | + $("body").addClass("high-contrast"); |
---|
78 | + } |
---|
79 | +}); |
---|
80 | + |
---|
81 | + |
---|
82 | })(jQuery); |
---|
83 | Index: ui/jquery.ui.progressbar.js |
---|
84 | =================================================================== |
---|
85 | --- ui/jquery.ui.progressbar.js (revision 3860) |
---|
86 | +++ ui/jquery.ui.progressbar.js (working copy) |
---|
87 | @@ -24,16 +24,19 @@ $.widget( "ui.progressbar", { |
---|
88 | role: "progressbar", |
---|
89 | "aria-valuemin": this._valueMin(), |
---|
90 | "aria-valuemax": this._valueMax(), |
---|
91 | "aria-valuenow": this._value() |
---|
92 | }); |
---|
93 | |
---|
94 | this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" ) |
---|
95 | .appendTo( this.element ); |
---|
96 | + |
---|
97 | + this.valueTextDiv = $( "<div class='ui-progressbar-valuetext'>" + this._value() + "</div>") |
---|
98 | + .appendTo( this.element ); |
---|
99 | |
---|
100 | this._refreshValue(); |
---|
101 | }, |
---|
102 | |
---|
103 | destroy: function() { |
---|
104 | this.element |
---|
105 | .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" ) |
---|
106 | .removeAttr( "role" ) |
---|
107 | @@ -91,16 +94,17 @@ $.widget( "ui.progressbar", { |
---|
108 | return 100; |
---|
109 | }, |
---|
110 | |
---|
111 | _refreshValue: function() { |
---|
112 | var value = this.value(); |
---|
113 | this.valueDiv |
---|
114 | [ value === this._valueMax() ? "addClass" : "removeClass"]( "ui-corner-right" ) |
---|
115 | .width( value + "%" ); |
---|
116 | + this.valueTextDiv.text(value + "%"); |
---|
117 | this.element.attr( "aria-valuenow", value ); |
---|
118 | } |
---|
119 | }); |
---|
120 | |
---|
121 | $.extend( $.ui.progressbar, { |
---|
122 | version: "@VERSION" |
---|
123 | }); |
---|
124 | |
---|
125 | Index: ui/jquery.ui.button.js |
---|
126 | =================================================================== |
---|
127 | --- ui/jquery.ui.button.js (revision 3860) |
---|
128 | +++ ui/jquery.ui.button.js (working copy) |
---|
129 | @@ -205,17 +205,17 @@ $.widget( "ui.button", { |
---|
130 | buttonText = $( "<span></span>" ) |
---|
131 | .addClass( "ui-button-text" ) |
---|
132 | .html( this.options.label ) |
---|
133 | .appendTo( buttonElement.empty() ) |
---|
134 | .text(); |
---|
135 | |
---|
136 | var icons = this.options.icons, |
---|
137 | multipleIcons = icons.primary && icons.secondary; |
---|
138 | - if ( icons.primary || icons.secondary ) { |
---|
139 | + if ( !$.highContrast && ( icons.primary || icons.secondary ) ) { |
---|
140 | buttonElement.addClass( "ui-button-text-icon" + |
---|
141 | ( multipleIcons ? "s" : "" ) ); |
---|
142 | if ( icons.primary ) { |
---|
143 | buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" ); |
---|
144 | } |
---|
145 | if ( icons.secondary ) { |
---|
146 | buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" ); |
---|
147 | } |
---|