Skip to content

Commit

Permalink
better detection of document complete + form interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
aFarkas committed Jul 13, 2014
1 parent c317a66 commit 0bd56f8
Show file tree
Hide file tree
Showing 45 changed files with 282 additions and 36 deletions.
12 changes: 12 additions & 0 deletions js-webshim/dev/shims/combos/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,14 @@ webshims.isReady('swfmini', true);
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
;(function(webshims){
"use strict";
Expand Down Expand Up @@ -1071,6 +1079,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});

})(webshims);
4 changes: 4 additions & 0 deletions js-webshim/dev/shims/combos/12.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});

})(webshims);
Expand Down
4 changes: 4 additions & 0 deletions js-webshim/dev/shims/combos/13.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});

})(webshims);
Expand Down
8 changes: 8 additions & 0 deletions js-webshim/dev/shims/combos/15.js
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
;webshims.register('form-shim-extend', function($, webshims, window, document, undefined, options){
"use strict";
Expand Down
12 changes: 12 additions & 0 deletions js-webshim/dev/shims/combos/16.js
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
;webshims.register('form-shim-extend', function($, webshims, window, document, undefined, options){
"use strict";
Expand Down Expand Up @@ -3699,6 +3707,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});

})(webshims);
12 changes: 12 additions & 0 deletions js-webshim/dev/shims/combos/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
;webshims.register('form-datalist', function($, webshims, window, document, undefined, options){
"use strict";
Expand Down Expand Up @@ -2580,6 +2588,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});

})(webshims);
4 changes: 4 additions & 0 deletions js-webshim/dev/shims/combos/23.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});

})(webshims);
8 changes: 8 additions & 0 deletions js-webshim/dev/shims/combos/3.js
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
;webshims.register('form-message', function($, webshims, window, document, undefined, options){
"use strict";
Expand Down
8 changes: 8 additions & 0 deletions js-webshim/dev/shims/combos/30.js
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
;webshims.register('form-message', function($, webshims, window, document, undefined, options){
"use strict";
Expand Down
8 changes: 8 additions & 0 deletions js-webshim/dev/shims/combos/31.js
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
;webshims.register('form-datalist', function($, webshims, window, document, undefined, options){
"use strict";
Expand Down
12 changes: 12 additions & 0 deletions js-webshim/dev/shims/combos/7.js
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
;webshims.register('form-message', function($, webshims, window, document, undefined, options){
"use strict";
Expand Down Expand Up @@ -2892,6 +2900,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});

})(webshims);
12 changes: 12 additions & 0 deletions js-webshim/dev/shims/combos/8.js
Original file line number Diff line number Diff line change
Expand Up @@ -1749,6 +1749,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
;webshims.register('form-message', function($, webshims, window, document, undefined, options){
"use strict";
Expand Down Expand Up @@ -2595,6 +2603,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});

})(webshims);
8 changes: 8 additions & 0 deletions js-webshim/dev/shims/form-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,12 @@ webshims.register('form-core', function($, webshims, window, document, undefined
});
}
});

if(options.addValidators && options.fastValidators){
webshims.reTest(['form-validators', 'form-validation']);
}

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
23 changes: 15 additions & 8 deletions js-webshim/dev/shims/form-validators.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
webshims.register('form-validators', function($, webshims, window, document, undefined, options){
"use strict";
var iValClasses = '.'+ options.iVal.errorClass +', .'+options.iVal.successClass;

var iValClasses;
webshims.ready('form-validation', function(){
iValClasses = '.'+ options.iVal.errorClass +', .'+options.iVal.successClass;
});

(function(){
if(webshims.refreshCustomValidityRules){
webshims.error("form-validators already included. please remove custom-validity.js");
Expand Down Expand Up @@ -30,7 +35,7 @@ var iValClasses = '.'+ options.iVal.errorClass +', .'+options.iVal.successClass;
elem = elements[id].elem;
if(elem != noTest && elements[id].val != (val = elem.value)){
elements[id].val = val;
if($(elem).hasClass(iValClasses)){
if(iValClasses && $(elem).hasClass(iValClasses)){
$(elem).trigger('updatevalidation.webshims');
} else {
testValidityRules(elem);
Expand Down Expand Up @@ -337,7 +342,7 @@ var iValClasses = '.'+ options.iVal.errorClass +', .'+options.iVal.successClass;
val = !val;
}
$.prop( elem, data.prop, val);
if(e){
if(iValClasses && e){
$(elem).getShadowElement().filter(iValClasses).trigger('updatevalidation.webshims');
}
};
Expand Down Expand Up @@ -377,11 +382,13 @@ var iValClasses = '.'+ options.iVal.errorClass +', .'+options.iVal.successClass;
} else {
$(data.masterElement).on('change', function(){
webshims.refreshCustomValidityRules(elem);
$(elem)
.getShadowElement()
.filter(iValClasses)
.trigger('updatevalidation.webshims')
;
if(iValClasses){
$(elem)
.getShadowElement()
.filter(iValClasses)
.trigger('updatevalidation.webshims')
;
}
});
}
}
Expand Down
4 changes: 4 additions & 0 deletions js-webshim/dev/shims/mediaelement-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);

if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});

})(webshims);
2 changes: 1 addition & 1 deletion js-webshim/minified/shims/combos/1.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js-webshim/minified/shims/combos/12.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js-webshim/minified/shims/combos/13.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js-webshim/minified/shims/combos/15.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js-webshim/minified/shims/combos/16.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js-webshim/minified/shims/combos/2.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js-webshim/minified/shims/combos/23.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js-webshim/minified/shims/combos/3.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js-webshim/minified/shims/combos/30.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js-webshim/minified/shims/combos/31.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js-webshim/minified/shims/combos/7.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js-webshim/minified/shims/combos/8.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js-webshim/minified/shims/form-core.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0bd56f8

Please sign in to comment.