Skip to content

Commit 015391f

Browse files
committed
Merge branch 'master' into bind
2 parents 5593736 + 6d9caf1 commit 015391f

File tree

13 files changed

+545
-30
lines changed

13 files changed

+545
-30
lines changed

demos/autocomplete/combobox.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
if (!request.term || matcher.test(text))
3434
return {
3535
id: $(this).val(),
36-
label: text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + request.term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
36+
label: text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
3737
value: text
3838
};
3939
}));

demos/autocomplete/remote.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
}
1919

2020
$("#birds").autocomplete({
21-
// TODO doesn't work when loaded from /demos/#autocomplete|remote
2221
source: "search.php",
2322
minLength: 2,
2423
select: function(event, ui) {

external/qunit.js

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var QUnit = {
1818
stats: { all: 0, bad: 0 },
1919
moduleStats: { all: 0, bad: 0 },
2020
started: +new Date,
21+
updateRate: 1000,
2122
blocking: false,
2223
autorun: false,
2324
assertions: [],
@@ -590,8 +591,16 @@ function synchronize( callback ) {
590591
}
591592

592593
function process() {
594+
var start = (new Date()).getTime();
595+
593596
while ( config.queue.length && !config.blocking ) {
594-
config.queue.shift()();
597+
if ( config.updateRate <= 0 || (((new Date()).getTime() - start) < config.updateRate) ) {
598+
config.queue.shift()();
599+
600+
} else {
601+
setTimeout( process, 13 );
602+
break;
603+
}
595604
}
596605
}
597606

@@ -679,6 +688,7 @@ QUnit.equiv = function () {
679688

680689
var innerEquiv; // the real equiv function
681690
var callers = []; // stack to decide between skip/abort functions
691+
var parents = []; // stack to avoiding loops from circular referencing
682692

683693

684694
// Determine what is o.
@@ -788,28 +798,39 @@ QUnit.equiv = function () {
788798
},
789799

790800
"array": function (b, a) {
791-
var i;
801+
var i, j, loop;
792802
var len;
793803

794804
// b could be an object literal here
795805
if ( ! (hoozit(b) === "array")) {
796806
return false;
797-
}
798-
807+
}
808+
799809
len = a.length;
800810
if (len !== b.length) { // safe and faster
801811
return false;
802812
}
813+
814+
//track reference to avoid circular references
815+
parents.push(a);
803816
for (i = 0; i < len; i++) {
804-
if ( ! innerEquiv(a[i], b[i])) {
817+
loop = false;
818+
for(j=0;j<parents.length;j++){
819+
if(parents[j] === a[i]){
820+
loop = true;//dont rewalk array
821+
}
822+
}
823+
if (!loop && ! innerEquiv(a[i], b[i])) {
824+
parents.pop();
805825
return false;
806826
}
807827
}
828+
parents.pop();
808829
return true;
809830
},
810831

811832
"object": function (b, a) {
812-
var i;
833+
var i, j, loop;
813834
var eq = true; // unless we can proove it
814835
var aProperties = [], bProperties = []; // collection of strings
815836

@@ -820,18 +841,25 @@ QUnit.equiv = function () {
820841

821842
// stack constructor before traversing properties
822843
callers.push(a.constructor);
823-
844+
//track reference to avoid circular references
845+
parents.push(a);
846+
824847
for (i in a) { // be strict: don't ensures hasOwnProperty and go deep
825-
848+
loop = false;
849+
for(j=0;j<parents.length;j++){
850+
if(parents[j] === a[i])
851+
loop = true; //don't go down the same path twice
852+
}
826853
aProperties.push(i); // collect a's properties
827854

828-
if ( ! innerEquiv(a[i], b[i])) {
855+
if (!loop && ! innerEquiv(a[i], b[i])) {
829856
eq = false;
830857
break;
831858
}
832859
}
833860

834861
callers.pop(); // unstack, we are done
862+
parents.pop();
835863

836864
for (i in b) {
837865
bProperties.push(i); // collect b's properties

tests/unit/core/core.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
1212
<script type="text/javascript" src="../../../external/qunit.js"></script>
1313
<script type="text/javascript" src="../../jquery.simulate.js"></script>
14+
<script type="text/javascript" src="../testsuite.js"></script>
1415

1516
<script type="text/javascript" src="core.js"></script>
1617
<script type="text/javascript" src="selector.js"></script>

tests/unit/testsuite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ function commonWidgetTests(widget, settings) {
4545
if ( !url || url.indexOf("http") !== 0 ) {
4646
return;
4747
}
48-
document.write("<scr" + "ipt src='http://testswarm.com/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>");
48+
document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>");
4949
})();

tests/visual/menu/drilldown.html

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$.widget("ui.drilldown", {
1515
_init: function() {
1616
var self = this;
17-
this.active = this.element;
17+
this.active = this.element.find(">ul").attr("tabindex", 0);
1818

1919
// hide submenus and create indicator icons
2020
this.element.find("ul").hide().prev("a").prepend('<span class="ui-icon ui-icon-carat-1-e"></span>').end().filter(":first").show();
@@ -84,17 +84,21 @@
8484
parent.parent().removeData("submenu");
8585
submenu = submenu.data("submenu");
8686
};
87+
},
88+
89+
widget: function() {
90+
return this.element.find(">ul");
8791
}
8892
});
8993

90-
var nestedmenu = $("#drilldown").drilldown({
94+
var drilldown = $("#drilldown").drilldown({
9195
selected: function(event, ui) {
9296
$("#log").append("<div>Selected " + ui.item.text() + "</div>");
9397
}
9498
});
9599

96-
$().keydown(function(event) {
97-
var menu = nestedmenu.data("drilldown").active.data("menu");
100+
drilldown.drilldown("widget").keydown(function(event) {
101+
var menu = drilldown.data("drilldown").active.data("menu");
98102
if (menu.widget().is(":hidden"))
99103
return;
100104
event.stopPropagation();
@@ -109,10 +113,10 @@
109113
menu.previous();
110114
break;
111115
case $.ui.keyCode.LEFT:
112-
nestedmenu.nestedmenu("up");
116+
drilldown.drilldown("up");
113117
break;
114118
case $.ui.keyCode.RIGHT:
115-
nestedmenu.nestedmenu("down");
119+
drilldown.drilldown("down");
116120
break;
117121
case $.ui.keyCode.DOWN:
118122
menu.next();
@@ -121,11 +125,11 @@
121125
case $.ui.keyCode.ENTER:
122126
case $.ui.keyCode.TAB:
123127
menu.select();
124-
nestedmenu.nestedmenu("hide");
128+
drilldown.drilldown("hide");
125129
event.preventDefault();
126130
break;
127131
case $.ui.keyCode.ESCAPE:
128-
nestedmenu.nestedmenu("hide");
132+
drilldown.drilldown("hide");
129133
break;
130134
default:
131135
clearTimeout(menu.filterTimer);

0 commit comments

Comments
 (0)