webshims-rails 1.10.6 → 1.10.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +8 -8
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/webshims/polyfiller.js +14 -7
  4. data/vendor/assets/javascripts/webshims/shims/color-picker.js +1 -0
  5. data/vendor/assets/javascripts/webshims/shims/combos/1.js +153 -155
  6. data/vendor/assets/javascripts/webshims/shims/combos/10.js +168 -136
  7. data/vendor/assets/javascripts/webshims/shims/combos/11.js +116 -44
  8. data/vendor/assets/javascripts/webshims/shims/combos/12.js +100 -95
  9. data/vendor/assets/javascripts/webshims/shims/combos/13.js +100 -95
  10. data/vendor/assets/javascripts/webshims/shims/combos/14.js +51 -91
  11. data/vendor/assets/javascripts/webshims/shims/combos/15.js +129 -232
  12. data/vendor/assets/javascripts/webshims/shims/combos/16.js +228 -326
  13. data/vendor/assets/javascripts/webshims/shims/combos/17.js +116 -44
  14. data/vendor/assets/javascripts/webshims/shims/combos/18.js +116 -44
  15. data/vendor/assets/javascripts/webshims/shims/combos/19.js +210 -214
  16. data/vendor/assets/javascripts/webshims/shims/combos/2.js +204 -246
  17. data/vendor/assets/javascripts/webshims/shims/combos/20.js +210 -214
  18. data/vendor/assets/javascripts/webshims/shims/combos/21.js +59 -28
  19. data/vendor/assets/javascripts/webshims/shims/combos/23.js +100 -95
  20. data/vendor/assets/javascripts/webshims/shims/combos/24.js +2 -2
  21. data/vendor/assets/javascripts/webshims/shims/combos/25.js +210 -214
  22. data/vendor/assets/javascripts/webshims/shims/combos/26.js +51 -91
  23. data/vendor/assets/javascripts/webshims/shims/combos/28.js +110 -119
  24. data/vendor/assets/javascripts/webshims/shims/combos/29.js +6 -0
  25. data/vendor/assets/javascripts/webshims/shims/combos/3.js +126 -156
  26. data/vendor/assets/javascripts/webshims/shims/combos/30.js +126 -155
  27. data/vendor/assets/javascripts/webshims/shims/combos/31.js +104 -151
  28. data/vendor/assets/javascripts/webshims/shims/combos/4.js +73 -96
  29. data/vendor/assets/javascripts/webshims/shims/combos/5.js +116 -44
  30. data/vendor/assets/javascripts/webshims/shims/combos/6.js +116 -44
  31. data/vendor/assets/javascripts/webshims/shims/combos/7.js +226 -250
  32. data/vendor/assets/javascripts/webshims/shims/combos/8.js +226 -250
  33. data/vendor/assets/javascripts/webshims/shims/combos/9.js +168 -136
  34. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +51 -91
  35. data/vendor/assets/javascripts/webshims/shims/form-core.js +53 -60
  36. data/vendor/assets/javascripts/webshims/shims/form-message.js +22 -5
  37. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +87 -30
  38. data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +2 -76
  39. data/vendor/assets/javascripts/webshims/shims/form-validation.js +2 -2
  40. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +1 -1
  41. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-fr.js +18 -8
  42. data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +100 -95
  43. data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +59 -28
  44. data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +9 -2
  45. data/vendor/assets/javascripts/webshims/shims/range-ui.js +29 -14
  46. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +21 -7
  47. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +30 -15
  48. data/vendor/assets/javascripts/webshims/shims/track-ui.js +6 -0
  49. metadata +2 -2
@@ -1130,6 +1130,12 @@ webshims.register('track-ui', function($, webshims, window, document, undefined)
1130
1130
  };
1131
1131
  var baseData, trackList, updateTimer;
1132
1132
 
1133
+ elem.on('remove', function(e){
1134
+ if(!e.originalEvent && baseData && baseData.trackDisplay){
1135
+ baseData.trackDisplay.remove();
1136
+ }
1137
+ });
1138
+
1133
1139
  if(!usesNativeTrack()){
1134
1140
  addTrackView();
1135
1141
  } else {
@@ -11,10 +11,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
11
11
  if(!$.parseHTML){
12
12
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
13
13
  }
14
+
15
+ if(webshims.cfg.extendNative == 1){
16
+ webshims.warn("extendNative configuration will be set to false by default with next release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
17
+ }
18
+
14
19
  if (!webshims.cfg.no$Switch) {
15
20
  var switch$ = function(){
16
21
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
17
- webshims.error("jQuery was included more than once. Make sure to include it only once! Webshims and other Plugins might not work properly.");
22
+ webshims.error("jQuery was included more than once. Make sure to include it only once or try the $.noConflict(extreme) feature! Webshims and other Plugins might not work properly..");
18
23
  if (window.$) {
19
24
  window.$ = webshims.$;
20
25
  }
@@ -32,7 +37,10 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
32
37
  };
33
38
  switch$();
34
39
  setTimeout(switch$, 90);
40
+ webshims.ready('DOM', switch$);
35
41
  $(switch$);
42
+ webshims.ready('WINDOWLOAD', switch$);
43
+
36
44
  }
37
45
  // (function(){
38
46
  // var hostNames = {
@@ -140,6 +148,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
140
148
  $(evtDel).off(evt, fn);
141
149
  }
142
150
  });
151
+ return this;
143
152
  };
144
153
 
145
154
  var dataID = '_webshimsLib'+ (Math.round(Math.random() * 1000));
@@ -174,57 +183,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
174
183
  };
175
184
  });
176
185
 
177
- if($.Tween.propHooks._default && $.css){
178
- (function(){
179
- var isjQ8 = false;
180
- try {
181
- isjQ8 = $.css($('<b style="width: 10px" />')[0], 'width', '') == '10px';
182
- } catch(er){
183
- webshims.error(er);
184
- }
185
- var css = isjQ8 ?
186
- function(elem, prop){
187
- return $.css( elem, prop, false, "" );
188
- } :
189
- function(elem, prop){
190
- return $.css( elem, prop, "" );
191
- }
192
- ;
193
-
194
- $.extend($.Tween.propHooks._default, {
195
- get: function( tween ) {
196
- var result;
197
-
198
- if ( (tween.elem[ tween.prop ] != null || havePolyfill[ tween.prop ]) &&
199
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
200
- return havePolyfill[ tween.prop ] ? $.prop(tween.elem, tween.prop) : tween.elem[ tween.prop ];
201
- }
202
-
203
- // passing an empty string as a 3rd parameter to .css will automatically
204
- // attempt a parseFloat and fallback to a string if the parse fails
205
- // so, simple values such as "10px" are parsed to Float.
206
- // complex values such as "rotate(1rad)" are returned as is.
207
- result = css( tween.elem, tween.prop );
208
- // Empty strings, null, undefined and "auto" are converted to 0.
209
- return !result || result === "auto" ? 0 : result;
210
- },
211
- set: function( tween ) {
212
- // use step hook for back compat - use cssHook if its there - use .style if its
213
- // available and use plain properties where available
214
- if ( jQuery.fx.step[ tween.prop ] ) {
215
- jQuery.fx.step[ tween.prop ]( tween );
216
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
217
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
218
- } else if( !havePolyfill[ tween.prop ] ) {
219
- tween.elem[ tween.prop ] = tween.now;
220
- } else {
221
- $.prop(tween.elem, tween.prop, tween.now);
222
- }
223
- }
224
- });
225
- })();
226
- }
227
-
228
186
 
229
187
  ['removeAttr', 'prop', 'attr'].forEach(function(type){
230
188
  olds[type] = $[type];
@@ -628,48 +586,50 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
628
586
  });
629
587
  };
630
588
  return function(nativeElem, shadowElem, opts){
631
- opts = opts || {};
632
- if(nativeElem.jquery){
633
- nativeElem = nativeElem[0];
634
- }
635
- if(shadowElem.jquery){
636
- shadowElem = shadowElem[0];
637
- }
638
- var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
639
- var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
640
- var shadowFocusElementData = {};
641
- if(!opts.shadowFocusElement){
642
- opts.shadowFocusElement = shadowElem;
643
- } else if(opts.shadowFocusElement){
644
- if(opts.shadowFocusElement.jquery){
645
- opts.shadowFocusElement = opts.shadowFocusElement[0];
589
+ if(nativeElem && shadowElem){
590
+ opts = opts || {};
591
+ if(nativeElem.jquery){
592
+ nativeElem = nativeElem[0];
646
593
  }
647
- shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
648
- }
649
-
650
- $(nativeElem).on('remove', function(e){
651
- if (!e.originalEvent) {
652
- $(shadowElem).remove();
594
+ if(shadowElem.jquery){
595
+ shadowElem = shadowElem[0];
653
596
  }
654
- });
655
-
656
- nativeData.hasShadow = shadowElem;
657
- shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
658
- shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
659
- nativeElement: nativeElem,
660
- shadowElement: shadowElem,
661
- shadowFocusElement: opts.shadowFocusElement
662
- };
663
- if(opts.shadowChilds){
664
- opts.shadowChilds.each(function(){
665
- elementData(this, 'shadowData', shadowData.shadowData);
597
+ var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
598
+ var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
599
+ var shadowFocusElementData = {};
600
+ if(!opts.shadowFocusElement){
601
+ opts.shadowFocusElement = shadowElem;
602
+ } else if(opts.shadowFocusElement){
603
+ if(opts.shadowFocusElement.jquery){
604
+ opts.shadowFocusElement = opts.shadowFocusElement[0];
605
+ }
606
+ shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
607
+ }
608
+
609
+ $(nativeElem).on('remove', function(e){
610
+ if (!e.originalEvent) {
611
+ $(shadowElem).remove();
612
+ }
666
613
  });
614
+
615
+ nativeData.hasShadow = shadowElem;
616
+ shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
617
+ shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
618
+ nativeElement: nativeElem,
619
+ shadowElement: shadowElem,
620
+ shadowFocusElement: opts.shadowFocusElement
621
+ };
622
+ if(opts.shadowChilds){
623
+ opts.shadowChilds.each(function(){
624
+ elementData(this, 'shadowData', shadowData.shadowData);
625
+ });
626
+ }
627
+
628
+ if(opts.data){
629
+ shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
630
+ }
631
+ opts = null;
667
632
  }
668
-
669
- if(opts.data){
670
- shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
671
- }
672
- opts = null;
673
633
  webshims.docObserve();
674
634
  };
675
635
  })(),
@@ -953,7 +913,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
953
913
  // register: moduleName:string,
954
914
  // callback: callback:function
955
915
  // });
956
- // get/set including removeLang
916
+ // get/set including remoteLang
957
917
  // - webshims.activeLang({
958
918
  // module: moduleName:string,
959
919
  // callback: callback:function,
@@ -1205,12 +1165,13 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1205
1165
  $.expr[":"][name] = $.expr.filters[name+"-element"];
1206
1166
  });
1207
1167
 
1208
-
1209
- $.expr[":"].focus = function( elem ) {
1168
+ var pseudoFocus = $.expr[":"].focus;
1169
+ $.expr[":"].focus = function(){
1210
1170
  try {
1211
- var doc = elem.ownerDocument;
1212
- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus());
1213
- } catch(e){}
1171
+ return pseudoFocus.apply(this, arguments);
1172
+ } catch(e){
1173
+ webshims.error(e);
1174
+ }
1214
1175
  return false;
1215
1176
  };
1216
1177
 
@@ -1225,7 +1186,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1225
1186
  });
1226
1187
  };
1227
1188
 
1228
-
1189
+ var transClass = ('transitionDelay' in document.documentElement.style) ? '' : ' no-transition';
1229
1190
  webshims.wsPopover = {
1230
1191
  id: 0,
1231
1192
  _create: function(){
@@ -1233,7 +1194,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1233
1194
  this.id = webshims.wsPopover.id++;
1234
1195
  this.eventns = '.wsoverlay' + this.id;
1235
1196
  this.timers = {};
1236
- this.element = $('<div class="ws-popover" tabindex="-1"><div class="ws-po-outerbox"><div class="ws-po-arrow"><div class="ws-po-arrowbox" /></div><div class="ws-po-box" /></div></div>');
1197
+ this.element = $('<div class="ws-popover'+transClass+'" tabindex="-1"><div class="ws-po-outerbox"><div class="ws-po-arrow"><div class="ws-po-arrowbox" /></div><div class="ws-po-box" /></div></div>');
1237
1198
  this.contentElement = $('.ws-po-box', this.element);
1238
1199
  this.lastElement = $([]);
1239
1200
  this.bindElement();
@@ -1272,47 +1233,6 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1272
1233
  };
1273
1234
 
1274
1235
 
1275
- /* extension, but also used to fix native implementation workaround/bugfixes */
1276
- (function(){
1277
- var firstEvent,
1278
- invalids = [],
1279
- stopSubmitTimer,
1280
- form
1281
- ;
1282
-
1283
- $(document).on('invalid', function(e){
1284
- if(e.wrongWebkitInvalid){return;}
1285
- var jElm = $(e.target);
1286
-
1287
-
1288
- if(!firstEvent){
1289
- //trigger firstinvalid
1290
- firstEvent = $.Event('firstinvalid');
1291
- firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1292
- var firstSystemInvalid = $.Event('firstinvalidsystem');
1293
- $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1294
- jElm.trigger(firstEvent);
1295
- }
1296
-
1297
- //if firstinvalid was prevented all invalids will be also prevented
1298
- if( firstEvent && firstEvent.isDefaultPrevented() ){
1299
- e.preventDefault();
1300
- }
1301
- invalids.push(e.target);
1302
- e.extraData = 'fix';
1303
- clearTimeout(stopSubmitTimer);
1304
- stopSubmitTimer = setTimeout(function(){
1305
- var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1306
- //reset firstinvalid
1307
- firstEvent = false;
1308
- invalids = [];
1309
- $(e.target).trigger(lastEvent, lastEvent);
1310
- }, 9);
1311
- jElm = null;
1312
- });
1313
- })();
1314
-
1315
-
1316
1236
  webshims.getContentValidationMessage = function(elem, validity, key){
1317
1237
  var message = $(elem).data('errormessage') || elem.getAttribute('x-moz-errormessage') || '';
1318
1238
  if(key && message[key]){
@@ -1346,19 +1266,13 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1346
1266
  };
1347
1267
 
1348
1268
 
1349
- webshims.ready('forms', function(){
1350
- $(document).on('focusin.lazyloadvalidation', function(e){
1351
- if('form' in e.target && $(e.target).is(':invalid')){
1352
- lazyLoad();
1353
- }
1354
- });
1269
+ $(document).on('focusin.lazyloadvalidation', function(e){
1270
+ if('form' in e.target && $(e.target).is(':invalid')){
1271
+ lazyLoad();
1272
+ }
1355
1273
  });
1356
1274
  webshims.ready('WINDOWLOAD', lazyLoad);
1357
- if(options.overrideMessages){
1358
- options.customMessages = true;
1359
- webshims.reTest('form-message');
1360
- webshims.error('overrideMessages is deprecated. use customMessages instead.');
1361
- }
1275
+
1362
1276
  if(options.replaceValidationUI){
1363
1277
  webshims.ready('DOM forms', function(){
1364
1278
  $(document).on('firstinvalid', function(e){
@@ -1369,8 +1283,47 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1369
1283
  });
1370
1284
  });
1371
1285
  }
1372
- });
1286
+
1287
+ /* extension, but also used to fix native implementation workaround/bugfixes */
1288
+ (function(){
1289
+ var firstEvent,
1290
+ invalids = [],
1291
+ stopSubmitTimer,
1292
+ form
1293
+ ;
1294
+
1295
+ $(document).on('invalid', function(e){
1296
+ if(e.wrongWebkitInvalid){return;}
1297
+ var jElm = $(e.target);
1298
+
1299
+
1300
+ if(!firstEvent){
1301
+ //trigger firstinvalid
1302
+ firstEvent = $.Event('firstinvalid');
1303
+ firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1304
+ var firstSystemInvalid = $.Event('firstinvalidsystem');
1305
+ $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1306
+ jElm.trigger(firstEvent);
1307
+ }
1373
1308
 
1309
+ //if firstinvalid was prevented all invalids will be also prevented
1310
+ if( firstEvent && firstEvent.isDefaultPrevented() ){
1311
+ e.preventDefault();
1312
+ }
1313
+ invalids.push(e.target);
1314
+ e.extraData = 'fix';
1315
+ clearTimeout(stopSubmitTimer);
1316
+ stopSubmitTimer = setTimeout(function(){
1317
+ var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1318
+ //reset firstinvalid
1319
+ firstEvent = false;
1320
+ invalids = [];
1321
+ $(e.target).trigger(lastEvent, lastEvent);
1322
+ }, 9);
1323
+ jElm = null;
1324
+ });
1325
+ })();
1326
+ });
1374
1327
 
1375
1328
  webshims.register('form-message', function($, webshims, window, document, undefined, options){
1376
1329
  "use strict";
@@ -1424,8 +1377,15 @@ webshims.register('form-message', function($, webshims, window, document, undefi
1424
1377
  validityMessages.en.rangeOverflow[type] = validityMessages.en.rangeOverflow[type] || 'Value must be at or before {%max}.';
1425
1378
  });
1426
1379
  }
1427
-
1428
- validityMessages['en-US'] = validityMessages['en-US'] || validityMessages.en;
1380
+ if(!validityMessages['en-US']){
1381
+ validityMessages['en-US'] = $.extend(true, {}, validityMessages.en);
1382
+ }
1383
+ if(!validityMessages['en-GB']){
1384
+ validityMessages['en-GB'] = $.extend(true, {}, validityMessages.en);
1385
+ }
1386
+ if(!validityMessages['en-AU']){
1387
+ validityMessages['en-AU'] = $.extend(true, {}, validityMessages.en);
1388
+ }
1429
1389
  validityMessages[''] = validityMessages[''] || validityMessages['en-US'];
1430
1390
 
1431
1391
  validityMessages.de = $.extend(true, {
@@ -1525,12 +1485,22 @@ webshims.register('form-message', function($, webshims, window, document, undefi
1525
1485
 
1526
1486
  webshims.activeLang({
1527
1487
  langObj: validityMessages,
1528
- module: 'form-core',
1488
+ module: 'form-core',
1529
1489
  callback: function(langObj){
1530
-
1531
1490
  currentValidationMessage = langObj;
1532
1491
  }
1533
1492
  });
1493
+ webshims.activeLang({
1494
+ register: 'form-core',
1495
+ callback: function(val){
1496
+ $.each(validityMessages, function(i, val){
1497
+ if(validityMessages[val]){
1498
+ currentValidationMessage = validityMessages[val];
1499
+ return false;
1500
+ }
1501
+ });
1502
+ }
1503
+ });
1534
1504
 
1535
1505
  implementProperties.forEach(function(messageProp){
1536
1506
  webshims.defineNodeNamesProperty(['fieldset', 'output', 'button'], messageProp, {
@@ -1576,4 +1546,4 @@ webshims.register('form-message', function($, webshims, window, document, undefi
1576
1546
  });
1577
1547
 
1578
1548
  });
1579
- });
1549
+ });
@@ -11,10 +11,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
11
11
  if(!$.parseHTML){
12
12
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
13
13
  }
14
+
15
+ if(webshims.cfg.extendNative == 1){
16
+ webshims.warn("extendNative configuration will be set to false by default with next release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
17
+ }
18
+
14
19
  if (!webshims.cfg.no$Switch) {
15
20
  var switch$ = function(){
16
21
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
17
- webshims.error("jQuery was included more than once. Make sure to include it only once! Webshims and other Plugins might not work properly.");
22
+ webshims.error("jQuery was included more than once. Make sure to include it only once or try the $.noConflict(extreme) feature! Webshims and other Plugins might not work properly..");
18
23
  if (window.$) {
19
24
  window.$ = webshims.$;
20
25
  }
@@ -32,7 +37,10 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
32
37
  };
33
38
  switch$();
34
39
  setTimeout(switch$, 90);
40
+ webshims.ready('DOM', switch$);
35
41
  $(switch$);
42
+ webshims.ready('WINDOWLOAD', switch$);
43
+
36
44
  }
37
45
  // (function(){
38
46
  // var hostNames = {
@@ -140,6 +148,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
140
148
  $(evtDel).off(evt, fn);
141
149
  }
142
150
  });
151
+ return this;
143
152
  };
144
153
 
145
154
  var dataID = '_webshimsLib'+ (Math.round(Math.random() * 1000));
@@ -174,57 +183,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
174
183
  };
175
184
  });
176
185
 
177
- if($.Tween.propHooks._default && $.css){
178
- (function(){
179
- var isjQ8 = false;
180
- try {
181
- isjQ8 = $.css($('<b style="width: 10px" />')[0], 'width', '') == '10px';
182
- } catch(er){
183
- webshims.error(er);
184
- }
185
- var css = isjQ8 ?
186
- function(elem, prop){
187
- return $.css( elem, prop, false, "" );
188
- } :
189
- function(elem, prop){
190
- return $.css( elem, prop, "" );
191
- }
192
- ;
193
-
194
- $.extend($.Tween.propHooks._default, {
195
- get: function( tween ) {
196
- var result;
197
-
198
- if ( (tween.elem[ tween.prop ] != null || havePolyfill[ tween.prop ]) &&
199
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
200
- return havePolyfill[ tween.prop ] ? $.prop(tween.elem, tween.prop) : tween.elem[ tween.prop ];
201
- }
202
-
203
- // passing an empty string as a 3rd parameter to .css will automatically
204
- // attempt a parseFloat and fallback to a string if the parse fails
205
- // so, simple values such as "10px" are parsed to Float.
206
- // complex values such as "rotate(1rad)" are returned as is.
207
- result = css( tween.elem, tween.prop );
208
- // Empty strings, null, undefined and "auto" are converted to 0.
209
- return !result || result === "auto" ? 0 : result;
210
- },
211
- set: function( tween ) {
212
- // use step hook for back compat - use cssHook if its there - use .style if its
213
- // available and use plain properties where available
214
- if ( jQuery.fx.step[ tween.prop ] ) {
215
- jQuery.fx.step[ tween.prop ]( tween );
216
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
217
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
218
- } else if( !havePolyfill[ tween.prop ] ) {
219
- tween.elem[ tween.prop ] = tween.now;
220
- } else {
221
- $.prop(tween.elem, tween.prop, tween.now);
222
- }
223
- }
224
- });
225
- })();
226
- }
227
-
228
186
 
229
187
  ['removeAttr', 'prop', 'attr'].forEach(function(type){
230
188
  olds[type] = $[type];
@@ -628,48 +586,50 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
628
586
  });
629
587
  };
630
588
  return function(nativeElem, shadowElem, opts){
631
- opts = opts || {};
632
- if(nativeElem.jquery){
633
- nativeElem = nativeElem[0];
634
- }
635
- if(shadowElem.jquery){
636
- shadowElem = shadowElem[0];
637
- }
638
- var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
639
- var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
640
- var shadowFocusElementData = {};
641
- if(!opts.shadowFocusElement){
642
- opts.shadowFocusElement = shadowElem;
643
- } else if(opts.shadowFocusElement){
644
- if(opts.shadowFocusElement.jquery){
645
- opts.shadowFocusElement = opts.shadowFocusElement[0];
589
+ if(nativeElem && shadowElem){
590
+ opts = opts || {};
591
+ if(nativeElem.jquery){
592
+ nativeElem = nativeElem[0];
646
593
  }
647
- shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
648
- }
649
-
650
- $(nativeElem).on('remove', function(e){
651
- if (!e.originalEvent) {
652
- $(shadowElem).remove();
594
+ if(shadowElem.jquery){
595
+ shadowElem = shadowElem[0];
653
596
  }
654
- });
655
-
656
- nativeData.hasShadow = shadowElem;
657
- shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
658
- shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
659
- nativeElement: nativeElem,
660
- shadowElement: shadowElem,
661
- shadowFocusElement: opts.shadowFocusElement
662
- };
663
- if(opts.shadowChilds){
664
- opts.shadowChilds.each(function(){
665
- elementData(this, 'shadowData', shadowData.shadowData);
597
+ var nativeData = $.data(nativeElem, dataID) || $.data(nativeElem, dataID, {});
598
+ var shadowData = $.data(shadowElem, dataID) || $.data(shadowElem, dataID, {});
599
+ var shadowFocusElementData = {};
600
+ if(!opts.shadowFocusElement){
601
+ opts.shadowFocusElement = shadowElem;
602
+ } else if(opts.shadowFocusElement){
603
+ if(opts.shadowFocusElement.jquery){
604
+ opts.shadowFocusElement = opts.shadowFocusElement[0];
605
+ }
606
+ shadowFocusElementData = $.data(opts.shadowFocusElement, dataID) || $.data(opts.shadowFocusElement, dataID, shadowFocusElementData);
607
+ }
608
+
609
+ $(nativeElem).on('remove', function(e){
610
+ if (!e.originalEvent) {
611
+ $(shadowElem).remove();
612
+ }
666
613
  });
614
+
615
+ nativeData.hasShadow = shadowElem;
616
+ shadowFocusElementData.nativeElement = shadowData.nativeElement = nativeElem;
617
+ shadowFocusElementData.shadowData = shadowData.shadowData = nativeData.shadowData = {
618
+ nativeElement: nativeElem,
619
+ shadowElement: shadowElem,
620
+ shadowFocusElement: opts.shadowFocusElement
621
+ };
622
+ if(opts.shadowChilds){
623
+ opts.shadowChilds.each(function(){
624
+ elementData(this, 'shadowData', shadowData.shadowData);
625
+ });
626
+ }
627
+
628
+ if(opts.data){
629
+ shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
630
+ }
631
+ opts = null;
667
632
  }
668
-
669
- if(opts.data){
670
- shadowFocusElementData.shadowData.data = shadowData.shadowData.data = nativeData.shadowData.data = opts.data;
671
- }
672
- opts = null;
673
633
  webshims.docObserve();
674
634
  };
675
635
  })(),
@@ -953,7 +913,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
953
913
  // register: moduleName:string,
954
914
  // callback: callback:function
955
915
  // });
956
- // get/set including removeLang
916
+ // get/set including remoteLang
957
917
  // - webshims.activeLang({
958
918
  // module: moduleName:string,
959
919
  // callback: callback:function,
@@ -1205,12 +1165,13 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1205
1165
  $.expr[":"][name] = $.expr.filters[name+"-element"];
1206
1166
  });
1207
1167
 
1208
-
1209
- $.expr[":"].focus = function( elem ) {
1168
+ var pseudoFocus = $.expr[":"].focus;
1169
+ $.expr[":"].focus = function(){
1210
1170
  try {
1211
- var doc = elem.ownerDocument;
1212
- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus());
1213
- } catch(e){}
1171
+ return pseudoFocus.apply(this, arguments);
1172
+ } catch(e){
1173
+ webshims.error(e);
1174
+ }
1214
1175
  return false;
1215
1176
  };
1216
1177
 
@@ -1225,7 +1186,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1225
1186
  });
1226
1187
  };
1227
1188
 
1228
-
1189
+ var transClass = ('transitionDelay' in document.documentElement.style) ? '' : ' no-transition';
1229
1190
  webshims.wsPopover = {
1230
1191
  id: 0,
1231
1192
  _create: function(){
@@ -1233,7 +1194,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1233
1194
  this.id = webshims.wsPopover.id++;
1234
1195
  this.eventns = '.wsoverlay' + this.id;
1235
1196
  this.timers = {};
1236
- this.element = $('<div class="ws-popover" tabindex="-1"><div class="ws-po-outerbox"><div class="ws-po-arrow"><div class="ws-po-arrowbox" /></div><div class="ws-po-box" /></div></div>');
1197
+ this.element = $('<div class="ws-popover'+transClass+'" tabindex="-1"><div class="ws-po-outerbox"><div class="ws-po-arrow"><div class="ws-po-arrowbox" /></div><div class="ws-po-box" /></div></div>');
1237
1198
  this.contentElement = $('.ws-po-box', this.element);
1238
1199
  this.lastElement = $([]);
1239
1200
  this.bindElement();
@@ -1272,47 +1233,6 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1272
1233
  };
1273
1234
 
1274
1235
 
1275
- /* extension, but also used to fix native implementation workaround/bugfixes */
1276
- (function(){
1277
- var firstEvent,
1278
- invalids = [],
1279
- stopSubmitTimer,
1280
- form
1281
- ;
1282
-
1283
- $(document).on('invalid', function(e){
1284
- if(e.wrongWebkitInvalid){return;}
1285
- var jElm = $(e.target);
1286
-
1287
-
1288
- if(!firstEvent){
1289
- //trigger firstinvalid
1290
- firstEvent = $.Event('firstinvalid');
1291
- firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1292
- var firstSystemInvalid = $.Event('firstinvalidsystem');
1293
- $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1294
- jElm.trigger(firstEvent);
1295
- }
1296
-
1297
- //if firstinvalid was prevented all invalids will be also prevented
1298
- if( firstEvent && firstEvent.isDefaultPrevented() ){
1299
- e.preventDefault();
1300
- }
1301
- invalids.push(e.target);
1302
- e.extraData = 'fix';
1303
- clearTimeout(stopSubmitTimer);
1304
- stopSubmitTimer = setTimeout(function(){
1305
- var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1306
- //reset firstinvalid
1307
- firstEvent = false;
1308
- invalids = [];
1309
- $(e.target).trigger(lastEvent, lastEvent);
1310
- }, 9);
1311
- jElm = null;
1312
- });
1313
- })();
1314
-
1315
-
1316
1236
  webshims.getContentValidationMessage = function(elem, validity, key){
1317
1237
  var message = $(elem).data('errormessage') || elem.getAttribute('x-moz-errormessage') || '';
1318
1238
  if(key && message[key]){
@@ -1346,19 +1266,13 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1346
1266
  };
1347
1267
 
1348
1268
 
1349
- webshims.ready('forms', function(){
1350
- $(document).on('focusin.lazyloadvalidation', function(e){
1351
- if('form' in e.target && $(e.target).is(':invalid')){
1352
- lazyLoad();
1353
- }
1354
- });
1269
+ $(document).on('focusin.lazyloadvalidation', function(e){
1270
+ if('form' in e.target && $(e.target).is(':invalid')){
1271
+ lazyLoad();
1272
+ }
1355
1273
  });
1356
1274
  webshims.ready('WINDOWLOAD', lazyLoad);
1357
- if(options.overrideMessages){
1358
- options.customMessages = true;
1359
- webshims.reTest('form-message');
1360
- webshims.error('overrideMessages is deprecated. use customMessages instead.');
1361
- }
1275
+
1362
1276
  if(options.replaceValidationUI){
1363
1277
  webshims.ready('DOM forms', function(){
1364
1278
  $(document).on('firstinvalid', function(e){
@@ -1369,8 +1283,47 @@ webshims.register('form-core', function($, webshims, window, document, undefined
1369
1283
  });
1370
1284
  });
1371
1285
  }
1372
- });
1286
+
1287
+ /* extension, but also used to fix native implementation workaround/bugfixes */
1288
+ (function(){
1289
+ var firstEvent,
1290
+ invalids = [],
1291
+ stopSubmitTimer,
1292
+ form
1293
+ ;
1294
+
1295
+ $(document).on('invalid', function(e){
1296
+ if(e.wrongWebkitInvalid){return;}
1297
+ var jElm = $(e.target);
1298
+
1299
+
1300
+ if(!firstEvent){
1301
+ //trigger firstinvalid
1302
+ firstEvent = $.Event('firstinvalid');
1303
+ firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
1304
+ var firstSystemInvalid = $.Event('firstinvalidsystem');
1305
+ $(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
1306
+ jElm.trigger(firstEvent);
1307
+ }
1373
1308
 
1309
+ //if firstinvalid was prevented all invalids will be also prevented
1310
+ if( firstEvent && firstEvent.isDefaultPrevented() ){
1311
+ e.preventDefault();
1312
+ }
1313
+ invalids.push(e.target);
1314
+ e.extraData = 'fix';
1315
+ clearTimeout(stopSubmitTimer);
1316
+ stopSubmitTimer = setTimeout(function(){
1317
+ var lastEvent = {type: 'lastinvalid', cancelable: false, invalidlist: $(invalids)};
1318
+ //reset firstinvalid
1319
+ firstEvent = false;
1320
+ invalids = [];
1321
+ $(e.target).trigger(lastEvent, lastEvent);
1322
+ }, 9);
1323
+ jElm = null;
1324
+ });
1325
+ })();
1326
+ });
1374
1327
 
1375
1328
  webshims.register('form-message', function($, webshims, window, document, undefined, options){
1376
1329
  "use strict";
@@ -1424,8 +1377,15 @@ webshims.register('form-message', function($, webshims, window, document, undefi
1424
1377
  validityMessages.en.rangeOverflow[type] = validityMessages.en.rangeOverflow[type] || 'Value must be at or before {%max}.';
1425
1378
  });
1426
1379
  }
1427
-
1428
- validityMessages['en-US'] = validityMessages['en-US'] || validityMessages.en;
1380
+ if(!validityMessages['en-US']){
1381
+ validityMessages['en-US'] = $.extend(true, {}, validityMessages.en);
1382
+ }
1383
+ if(!validityMessages['en-GB']){
1384
+ validityMessages['en-GB'] = $.extend(true, {}, validityMessages.en);
1385
+ }
1386
+ if(!validityMessages['en-AU']){
1387
+ validityMessages['en-AU'] = $.extend(true, {}, validityMessages.en);
1388
+ }
1429
1389
  validityMessages[''] = validityMessages[''] || validityMessages['en-US'];
1430
1390
 
1431
1391
  validityMessages.de = $.extend(true, {
@@ -1525,12 +1485,22 @@ webshims.register('form-message', function($, webshims, window, document, undefi
1525
1485
 
1526
1486
  webshims.activeLang({
1527
1487
  langObj: validityMessages,
1528
- module: 'form-core',
1488
+ module: 'form-core',
1529
1489
  callback: function(langObj){
1530
-
1531
1490
  currentValidationMessage = langObj;
1532
1491
  }
1533
1492
  });
1493
+ webshims.activeLang({
1494
+ register: 'form-core',
1495
+ callback: function(val){
1496
+ $.each(validityMessages, function(i, val){
1497
+ if(validityMessages[val]){
1498
+ currentValidationMessage = validityMessages[val];
1499
+ return false;
1500
+ }
1501
+ });
1502
+ }
1503
+ });
1534
1504
 
1535
1505
  implementProperties.forEach(function(messageProp){
1536
1506
  webshims.defineNodeNamesProperty(['fieldset', 'output', 'button'], messageProp, {
@@ -1577,6 +1547,7 @@ webshims.register('form-message', function($, webshims, window, document, undefi
1577
1547
 
1578
1548
  });
1579
1549
  });
1550
+
1580
1551
  webshims.register('form-datalist', function($, webshims, window, document, undefined, options){
1581
1552
  "use strict";
1582
1553
  var doc = document;