Skip to content

Commit f4f8336

Browse files
committed
Revert "Revert "Fix grunt.js to include menubar and popup and fix a few linting issues""
This reverts commit 76338ca.
1 parent f0a8f2a commit f4f8336

File tree

9 files changed

+48
-35
lines changed

9 files changed

+48
-35
lines changed

demos/menubar/default.html

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="utf-8">
45
<title>jQuery UI Menubar - Default demo</title>
56
<link rel="stylesheet" href="../demos.css" type="text/css" />
67
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" />
@@ -60,7 +61,7 @@
6061
<li><a href="#Open...">Open...</a></li>
6162
<li class="ui-state-disabled">Open recent...</li>
6263
<li><a href="#Save">Save</a></li>
63-
<li><a href="#Save as...">Save as...</a></li>
64+
<li><a href="#Save%20as...">Save as...</a></li>
6465
<li><a href="#Close">Close</a></li>
6566
<li><a href="#Quit">Quit</a></li>
6667
</ul>
@@ -77,7 +78,7 @@
7778
<a href="#View">View</a>
7879
<ul>
7980
<li><a href="#Fullscreen">Fullscreen</a></li>
80-
<li><a href="#Fit into view">Fit into view</a></li>
81+
<li><a href="#Fit%20into%20view">Fit into view</a></li>
8182
<li>
8283
<a href="#Encoding">Encoding</a>
8384
<ul>
@@ -86,10 +87,10 @@
8687
<li>
8788
<a href="#UTF-16">UTF-16</a>
8889
<ul>
89-
<li><a href="#Option 1">Option 1</a></li>
90-
<li><a href="#Option 2">Option 2</a></li>
91-
<li><a href="#Option 3">Option 3</a></li>
92-
<li><a href="#Option 4">Option 4</a></li>
90+
<li><a href="#Option%201">Option 1</a></li>
91+
<li><a href="#Option%202">Option 2</a></li>
92+
<li><a href="#Option%203">Option 3</a></li>
93+
<li><a href="#Option%204">Option 4</a></li>
9394
</ul>
9495
</li>
9596
</ul>
@@ -106,7 +107,7 @@
106107
<li><a href="#Open...">Open...</a></li>
107108
<li class="ui-state-disabled">Open recent...</li>
108109
<li><a href="#Save">Save</a></li>
109-
<li><a href="#Save as...">Save as...</a></li>
110+
<li><a href="#Save%20as...">Save as...</a></li>
110111
<li><a href="#Close">Close</a></li>
111112
<li><a href="#Quit">Quit</a></li>
112113
</ul>
@@ -123,7 +124,7 @@
123124
<a href="#View">View</a>
124125
<ul>
125126
<li><a href="#Fullscreen">Fullscreen</a></li>
126-
<li><a href="#Fit into view">Fit into view</a></li>
127+
<li><a href="#Fit%20into%20view">Fit into view</a></li>
127128
<li>
128129
<a href="#Encoding">Encoding</a>
129130
<ul>
@@ -132,10 +133,10 @@
132133
<li>
133134
<a href="#UTF-16">UTF-16</a>
134135
<ul>
135-
<li><a href="#Option 1">Option 1</a></li>
136-
<li><a href="#Option 2">Option 2</a></li>
137-
<li><a href="#Option 3">Option 3</a></li>
138-
<li><a href="#Option 4">Option 4</a></li>
136+
<li><a href="#Option%201">Option 1</a></li>
137+
<li><a href="#Option%202">Option 2</a></li>
138+
<li><a href="#Option%203">Option 3</a></li>
139+
<li><a href="#Option%204">Option 4</a></li>
139140
</ul>
140141
</li>
141142
</ul>
@@ -152,7 +153,7 @@
152153
<div><a href="#Open...">Open...</a></div>
153154
<div class="ui-state-disabled">Open recent...</div>
154155
<div><a href="#Save">Save</a></div>
155-
<div><a href="#Save as...">Save as...</a></div>
156+
<div><a href="#Save%20as...">Save as...</a></div>
156157
<div><a href="#Close">Close</a></div>
157158
<div><a href="#Quit">Quit</a></div>
158159
</div>
@@ -169,7 +170,7 @@
169170
<a href="#View">View</a>
170171
<div class="menuElement">
171172
<div><a href="#Fullscreen">Fullscreen</a></div>
172-
<div><a href="#Fit into view">Fit into view</a></div>
173+
<div><a href="#Fit%20into%20view">Fit into view</a></div>
173174
<div>
174175
<a href="#Encoding">Encoding</a>
175176
<div class="menuElement">
@@ -178,10 +179,10 @@
178179
<div>
179180
<a href="#UTF-16">UTF-16</a>
180181
<div class="menuElement">
181-
<div><a href="#Option 1">Option 1</a></div>
182-
<div><a href="#Option 2">Option 2</a></div>
182+
<div><a href="#Option%201">Option 1</a></div>
183+
<div><a href="#Option%202">Option 2</a></div>
183184
<div class="ui-state-disabled">Option 3</div>
184-
<div><a href="#Option 4">Option 4</a></div>
185+
<div><a href="#Option%204">Option 4</a></div>
185186
</div>
186187
</div>
187188
</div>

demos/popup/animation.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="utf-8">
45
<title>jQuery UI Popup - Animation demo</title>
56
<link rel="stylesheet" href="../demos.css" />
67
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" title="ui-theme" />
7-
<script src="../../jquery-1.7.1.js"></script>
8+
<script src="../../jquery-1.7.2.js"></script>
89
<script src="../../ui/jquery.ui.core.js"></script>
910
<script src="../../ui/jquery.ui.widget.js"></script>
1011
<script src="../../ui/jquery.ui.position.js"></script>

demos/popup/default.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="utf-8">
45
<title>jQuery UI Popup - Default demo</title>
56
<link rel="stylesheet" href="../demos.css" />
67
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" title="ui-theme" />
7-
<script src="../../jquery-1.7.1.js"></script>
8+
<script src="../../jquery-1.7.2.js"></script>
89
<script src="../../ui/jquery.ui.core.js"></script>
910
<script src="../../ui/jquery.ui.widget.js"></script>
1011
<script src="../../ui/jquery.ui.position.js"></script>

demos/popup/popup-menu-table.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="utf-8">
45
<title>jQuery UI Popup - Menu as Popup in table demo</title>
56
<link rel="stylesheet" href="../demos.css" />
67
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" title="ui-theme" />
7-
<script src="../../jquery-1.7.1.js"></script>
8+
<script src="../../jquery-1.7.2.js"></script>
89
<script src="../../ui/jquery.ui.core.js"></script>
910
<script src="../../ui/jquery.ui.widget.js"></script>
1011
<script src="../../ui/jquery.ui.position.js"></script>
@@ -20,7 +21,7 @@
2021
}
2122
};
2223

23-
$(".demo td:has(.menubar)").clone().appendTo(".demo tbody tr:not(:first)");
24+
$(".demo .menubar").clone().appendTo(".demo tbody td:last-child:not(:first)");
2425
$("table .menubar > ul").menu(selected).popup().prev().button();
2526
});
2627
</script>
@@ -79,16 +80,19 @@
7980
<td class="ui-widget-content">Rod Stewart: Storyteller 1984-1991</td>
8081
<td class="ui-widget-content">1991</td>
8182
<td class="ui-widget-content">3.1</td>
83+
<td class="ui-widget-content"></td>
8284
</tr>
8385
<tr>
8486
<td class="ui-widget-content">Stevie Ray Vaughan and Double Trouble: Live at the El Mocambo 1983</td>
8587
<td class="ui-widget-content">1991</td>
8688
<td class="ui-widget-content">3.9</td>
89+
<td class="ui-widget-content"></td>
8790
</tr>
8891
<tr>
8992
<td class="ui-widget-content">Spike and Mike's Sick &amp; Twisted Festival of Animation</td>
9093
<td class="ui-widget-content">1997</td>
9194
<td class="ui-widget-content">2.6</td>
95+
<td class="ui-widget-content"></td>
9296
</tr>
9397
</tbody>
9498
</table>

demos/popup/popup-menu.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="utf-8">
45
<title>jQuery UI Popup - Popup Menu</title>
56
<link rel="stylesheet" href="../demos.css" />
67
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" title="ui-theme" />
7-
<script src="../../jquery-1.7.1.js"></script>
8+
<script src="../../jquery-1.7.2.js"></script>
89
<script src="../../ui/jquery.ui.core.js"></script>
910
<script src="../../ui/jquery.ui.widget.js"></script>
1011
<script src="../../ui/jquery.ui.position.js"></script>

demos/popup/tooltip.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="utf-8">
45
<title>jQuery UI Popup - Tooltip style demo</title>
56
<link rel="stylesheet" href="../demos.css" />
67
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css" title="ui-theme" />
7-
<script src="../../jquery-1.7.1.js"></script>
8+
<script src="../../jquery-1.7.2.js"></script>
89
<script src="../../ui/jquery.ui.core.js"></script>
910
<script src="../../ui/jquery.ui.widget.js"></script>
1011
<script src="../../ui/jquery.ui.position.js"></script>
@@ -28,8 +29,8 @@
2829
display: inline-block;
2930
}
3031
#more-info {
31-
width: 11em;
32-
border: 1px solid gray;
32+
width: 11em;
33+
border: 1px solid gray;
3334
border-radius: 5px;
3435
padding: 1em;
3536
box-shadow: 3px 3px 5px -1px rgba(0, 0, 0, 0.5);

grunt.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ var // modules
3535
"datepicker",
3636
"dialog",
3737
"menu",
38+
"menubar",
39+
"popup",
3840
"progressbar",
3941
"resizable",
4042
"selectable",

ui/jquery.ui.menubar.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ $.widget( "ui.menubar", {
6767
})
6868
.bind( "keydown.menubar", function( event ) {
6969
var menu = $( this );
70-
if ( menu.is( ":hidden" ) )
70+
if ( menu.is( ":hidden" ) ) {
7171
return;
72+
}
7273
switch ( event.keyCode ) {
7374
case $.ui.keyCode.LEFT:
7475
that.previous( event );
@@ -78,7 +79,7 @@ $.widget( "ui.menubar", {
7879
that.next( event );
7980
event.preventDefault();
8081
break;
81-
};
82+
}
8283
});
8384
this.items.each(function() {
8485
var input = $(this),
@@ -87,17 +88,17 @@ $.widget( "ui.menubar", {
8788

8889
input.bind( "click.menubar focus.menubar mouseenter.menubar", function( event ) {
8990
// ignore triggered focus event
90-
if ( event.type == "focus" && !event.originalEvent ) {
91+
if ( event.type === "focus" && !event.originalEvent ) {
9192
return;
9293
}
9394
event.preventDefault();
9495
// TODO can we simplify or extractthis check? especially the last two expressions
9596
// there's a similar active[0] == menu[0] check in _open
96-
if ( event.type == "click" && menu.is( ":visible" ) && that.active && that.active[0] == menu[0] ) {
97+
if ( event.type === "click" && menu.is( ":visible" ) && that.active && that.active[0] === menu[0] ) {
9798
that._close();
9899
return;
99100
}
100-
if ( ( that.open && event.type == "mouseenter" ) || event.type == "click" || that.options.autoExpand ) {
101+
if ( ( that.open && event.type === "mouseenter" ) || event.type === "click" || that.options.autoExpand ) {
101102
if( that.options.autoExpand ) {
102103
clearTimeout( that.closeTimer );
103104
}
@@ -137,12 +138,12 @@ $.widget( "ui.menubar", {
137138
if ( !that.options.buttons ) {
138139
// TODO ui-menubar-link is added above, not needed here?
139140
input.addClass( "ui-menubar-link" ).removeClass( "ui-state-default" );
140-
};
141+
}
141142

142143
});
143144
that._bind( {
144145
keydown: function( event ) {
145-
if ( event.keyCode == $.ui.keyCode.ESCAPE && that.active && that.active.menu( "collapse", event ) !== true ) {
146+
if ( event.keyCode === $.ui.keyCode.ESCAPE && that.active && that.active.menu( "collapse", event ) !== true ) {
146147
var active = that.active;
147148
that.active.blur();
148149
that._close( event );
@@ -206,8 +207,9 @@ $.widget( "ui.menubar", {
206207
},
207208

208209
_close: function() {
209-
if ( !this.active || !this.active.length )
210+
if ( !this.active || !this.active.length ) {
210211
return;
212+
}
211213
this.active
212214
.menu( "collapseAll" )
213215
.hide()
@@ -226,7 +228,7 @@ $.widget( "ui.menubar", {
226228

227229
_open: function( event, menu ) {
228230
// on a single-button menubar, ignore reopening the same menu
229-
if ( this.active && this.active[0] == menu[0] ) {
231+
if ( this.active && this.active[0] === menu[0] ) {
230232
return;
231233
}
232234
// TODO refactor, almost the same as _close above, but don't remove tabIndex

ui/jquery.ui.popup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ $.widget( "ui.popup", {
180180

181181
this._bind({
182182
keyup: function( event ) {
183-
if ( event.keyCode == $.ui.keyCode.ESCAPE && this.element.is( ":visible" ) ) {
183+
if ( event.keyCode === $.ui.keyCode.ESCAPE && this.element.is( ":visible" ) ) {
184184
this.close( event );
185185
this.focusTrigger();
186186
}

0 commit comments

Comments
 (0)