webshims-rails 1.11.6.1 → 1.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/webshims/polyfiller.js +126 -72
  4. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/canvas2png.js +9 -4
  5. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.js +32 -26
  6. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.swf +0 -0
  7. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/proxy.php +25 -4
  8. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/save.php +9 -3
  9. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/canvas2png.js +9 -4
  10. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash10canvas.swf +0 -0
  11. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash9canvas.swf +0 -0
  12. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flashcanvas.js +36 -30
  13. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/proxy.php +25 -4
  14. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/save.php +9 -3
  15. data/vendor/assets/javascripts/webshims/shims/combos/1.js +13 -6
  16. data/vendor/assets/javascripts/webshims/shims/combos/10.js +156 -143
  17. data/vendor/assets/javascripts/webshims/shims/combos/11.js +97 -84
  18. data/vendor/assets/javascripts/webshims/shims/combos/12.js +2 -4
  19. data/vendor/assets/javascripts/webshims/shims/combos/13.js +1 -2
  20. data/vendor/assets/javascripts/webshims/shims/combos/14.js +956 -2819
  21. data/vendor/assets/javascripts/webshims/shims/combos/15.js +73 -67
  22. data/vendor/assets/javascripts/webshims/shims/combos/16.js +75 -71
  23. data/vendor/assets/javascripts/webshims/shims/combos/17.js +118 -89
  24. data/vendor/assets/javascripts/webshims/shims/combos/18.js +119 -91
  25. data/vendor/assets/javascripts/webshims/shims/combos/19.js +62 -65
  26. data/vendor/assets/javascripts/webshims/shims/combos/2.js +73 -67
  27. data/vendor/assets/javascripts/webshims/shims/combos/20.js +61 -63
  28. data/vendor/assets/javascripts/webshims/shims/combos/21.js +3 -6
  29. data/vendor/assets/javascripts/webshims/shims/combos/22.js +1 -2
  30. data/vendor/assets/javascripts/webshims/shims/combos/23.js +1 -2
  31. data/vendor/assets/javascripts/webshims/shims/combos/24.js +22 -12
  32. data/vendor/assets/javascripts/webshims/shims/combos/25.js +63 -67
  33. data/vendor/assets/javascripts/webshims/shims/combos/26.js +59 -59
  34. data/vendor/assets/javascripts/webshims/shims/combos/27.js +1 -2
  35. data/vendor/assets/javascripts/webshims/shims/combos/28.js +1915 -0
  36. data/vendor/assets/javascripts/webshims/shims/combos/29.js +817 -0
  37. data/vendor/assets/javascripts/webshims/shims/combos/3.js +71 -63
  38. data/vendor/assets/javascripts/webshims/shims/combos/30.js +72 -65
  39. data/vendor/assets/javascripts/webshims/shims/combos/31.js +71 -63
  40. data/vendor/assets/javascripts/webshims/shims/combos/32.js +2343 -0
  41. data/vendor/assets/javascripts/webshims/shims/combos/33.js +897 -0
  42. data/vendor/assets/javascripts/webshims/shims/combos/4.js +59 -59
  43. data/vendor/assets/javascripts/webshims/shims/combos/5.js +119 -91
  44. data/vendor/assets/javascripts/webshims/shims/combos/6.js +120 -93
  45. data/vendor/assets/javascripts/webshims/shims/combos/7.js +74 -69
  46. data/vendor/assets/javascripts/webshims/shims/combos/8.js +73 -67
  47. data/vendor/assets/javascripts/webshims/shims/combos/9.js +157 -145
  48. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +58 -57
  49. data/vendor/assets/javascripts/webshims/shims/form-combat.js +0 -1
  50. data/vendor/assets/javascripts/webshims/shims/form-core.js +12 -3
  51. data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +4 -3
  52. data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +20 -3
  53. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +78 -71
  54. data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +21 -10
  55. data/vendor/assets/javascripts/webshims/shims/form-validation.js +39 -27
  56. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +173 -128
  57. data/vendor/assets/javascripts/webshims/shims/i18n/{formcfg-ch-ZN.js → formcfg-ch-CN.js} +0 -0
  58. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-en.js +0 -2
  59. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-zh-CN.js +65 -0
  60. data/vendor/assets/javascripts/webshims/shims/plugins/jquery.ui.position.js +1 -1
  61. data/vendor/assets/javascripts/webshims/shims/range-ui.js +18 -11
  62. data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +221 -153
  63. data/vendor/assets/javascripts/webshims/shims/styles/progress.gif +0 -0
  64. data/vendor/assets/javascripts/webshims/shims/styles/progress.png +0 -0
  65. data/vendor/assets/javascripts/webshims/shims/styles/scss/_extends.scss +5 -0
  66. data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +273 -177
  67. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +113 -98
  68. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +114 -88
  69. data/vendor/assets/javascripts/webshims/shims/track-ui.js +2 -2
  70. metadata +10 -7
  71. data/vendor/assets/javascripts/webshims/extras/mousepress.js +0 -60
  72. data/vendor/assets/javascripts/webshims/shims/jpicker/images/Thumbs.db +0 -0
  73. data/vendor/assets/javascripts/webshims/shims/json-storage.js +0 -316
  74. data/vendor/assets/javascripts/webshims/shims/mediagroup.js +0 -29
@@ -63,7 +63,8 @@ webshims.register('form-number-date-api', function($, webshims, window, document
63
63
  cache.type = getType(input[0]);
64
64
  }
65
65
  if(cache.type == 'week'){return false;}
66
- var ret = (validityState || {}).stepMismatch || false, base;
66
+ var base, attrVal;
67
+ var ret = (validityState || {}).stepMismatch || false;
67
68
  if(typeModels[cache.type] && typeModels[cache.type].step){
68
69
  if( !('step' in cache) ){
69
70
  cache.step = webshims.getStep(input[0], cache.type);
@@ -78,6 +79,11 @@ webshims.register('form-number-date-api', function($, webshims, window, document
78
79
 
79
80
  addMinMaxNumberToCache('min', input, cache);
80
81
  base = cache.minAsNumber;
82
+
83
+ if(isNaN(base) && (attrVal = input.prop('defaultValue'))){
84
+ base = typeModels[cache.type].asNumber( attrVal );
85
+ }
86
+
81
87
  if(isNaN(base)){
82
88
  base = typeModels[cache.type].stepBase || 0;
83
89
  }
@@ -192,7 +198,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
192
198
  var stepDescriptor = webshims.defineNodeNameProperty('input', name, {
193
199
  prop: {
194
200
  value: function(factor){
195
- var step, val, dateVal, valModStep, alignValue, cache;
201
+ var step, val, dateVal, valModStep, alignValue, cache, base, attrVal;
196
202
  var type = getType(this);
197
203
  if(typeModels[type] && typeModels[type].asNumber){
198
204
  cache = {type: type};
@@ -219,10 +225,21 @@ webshims.register('form-number-date-api', function($, webshims, window, document
219
225
  webshims.addMinMaxNumberToCache('min', $(this), cache);
220
226
  webshims.addMinMaxNumberToCache('max', $(this), cache);
221
227
 
228
+ base = cache.minAsNumber;
229
+
230
+ if(isNaN(base) && (attrVal = $.prop(this, 'defaultValue'))){
231
+ base = typeModels[type].asNumber( attrVal );
232
+ }
233
+
234
+ if(!base){
235
+ base = 0;
236
+ }
237
+
222
238
  step *= factor;
223
239
 
224
240
  val = (val + step).toFixed(5) * 1;
225
- valModStep = (val - (cache.minAsNumber || 0)) % step;
241
+
242
+ valModStep = (val - base) % step;
226
243
 
227
244
  if ( valModStep && (Math.abs(valModStep) > EPS) ) {
228
245
  alignValue = val - valModStep;
@@ -586,8 +603,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
586
603
  });
587
604
  }
588
605
 
589
- });
590
- (function($){
606
+ });;(function($){
591
607
 
592
608
  var id = 0;
593
609
  var isNumber = function(string){
@@ -607,7 +623,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
607
623
 
608
624
  this.element.addClass('ws-range').attr({role: 'slider'}).append('<span class="ws-range-min ws-range-progress" /><span class="ws-range-rail ws-range-track"><span class="ws-range-thumb" /></span>');
609
625
  this.trail = $('.ws-range-track', this.element);
610
- this.range = $('.ws-range-progress ', this.element);
626
+ this.range = $('.ws-range-progress', this.element);
611
627
  this.thumb = $('.ws-range-thumb', this.trail);
612
628
 
613
629
  this.updateMetrics();
@@ -627,7 +643,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
627
643
  },
628
644
  value: $.noop,
629
645
  _value: function(val, _noNormalize, animate){
630
- var left, posDif;
646
+ var left, posDif, textValue;
631
647
  var o = this.options;
632
648
  var oVal = val;
633
649
  var thumbStyle = {};
@@ -676,9 +692,15 @@ webshims.register('form-number-date-api', function($, webshims, window, document
676
692
  if(this.orig && (oVal != val || (!this._init && this.orig.value != val)) ){
677
693
  this.options._change(val);
678
694
  }
695
+
696
+ textValue = this.options.textValue ? this.options.textValue(this.options.value) : this.options.options[this.options.value] || this.options.value;
679
697
  this.element.attr({
680
698
  'aria-valuenow': this.options.value,
681
- 'aria-valuetext': this.options.textValue ? this.options.textValue(this.options.value) : this.options.options[this.options.value] || this.options.value
699
+ 'aria-valuetext': textValue
700
+ });
701
+ this.thumb.attr({
702
+ 'data-value': this.options.value,
703
+ 'data-valuetext': textValue
682
704
  });
683
705
  },
684
706
  initDataList: function(){
@@ -722,13 +744,19 @@ webshims.register('form-number-date-api', function($, webshims, window, document
722
744
  $.each(o.options, function(val, label){
723
745
  if(!isNumber(val) || val < min || val > max){return;}
724
746
  var left = 100 * ((val - min) / (max - min));
725
- var title = o.showLabels && label ? ' title="'+ label +'"' : '';
747
+ var attr = '';
748
+ if(label){
749
+ attr += 'data-label="'+label+'"';
750
+ if(o.showLabels){
751
+ attr += ' title="'+label+'"';
752
+ }
753
+ }
726
754
  if(that.vertical){
727
755
  left = Math.abs(left - 100);
728
756
  }
729
757
 
730
758
  that.posCenter(
731
- $('<span class="ws-range-ticks"'+ title +' data-label="'+label+'" style="'+(that.dirs.left)+': '+left+'%;" />').appendTo(trail)
759
+ $('<span class="ws-range-ticks"'+ attr +' style="'+(that.dirs.left)+': '+left+'%;" />').appendTo(trail)
732
760
  );
733
761
  });
734
762
  },
@@ -1137,33 +1165,36 @@ webshims.register('form-number-date-api', function($, webshims, window, document
1137
1165
  });
1138
1166
  };
1139
1167
  if(window.webshims && webshims.isReady){
1140
- webshims.ready('es5', function(){
1141
- webshims.isReady('range-ui', true);
1142
- });
1143
- if(webshims._polyfill){
1144
- webshims._polyfill(['es5']);
1145
- }
1168
+ webshims.isReady('range-ui', true);
1146
1169
  }
1147
- })(window.webshims ? webshims.$ : jQuery);
1148
- webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){
1170
+ })(window.webshims ? webshims.$ : jQuery);;webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){
1149
1171
  "use strict";
1150
1172
  var curCfg;
1151
1173
  var formcfg = webshims.formcfg;
1174
+ var hasFormValidation = Modernizr.formvalidation && !webshims.bugs.bustedValidity;
1152
1175
  var monthDigits = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
1153
1176
  var stopPropagation = function(e){
1154
1177
  e.stopImmediatePropagation();
1155
1178
  };
1156
- var getMonthOptions = (function(){
1157
- var str;
1158
- return function(){
1159
- if(!str){
1160
- str = ('<option value=""></option>')+$.map(monthDigits, function(val){
1161
- return '<option value="'+val+'"]>'+val+'</option>';
1162
- }).join('');
1163
- }
1164
- return str;
1165
- };
1166
- })();
1179
+ var getMonthOptions = function(opts){
1180
+ var selectName = 'monthSelect'+opts.formatMonthNames;
1181
+ if(!curCfg[selectName]){
1182
+ var labels = curCfg.date[opts.formatMonthNames] || monthDigits;
1183
+ curCfg[selectName] = ('<option value=""></option>')+$.map(monthDigits, function(val, i){
1184
+ return '<option value="'+val+'"]>'+labels[i]+'</option>';
1185
+ }).join('');
1186
+ }
1187
+ return curCfg[selectName];
1188
+ };
1189
+ var daySelect = '<select class="dd"><option value=""></option>'+ (function(){
1190
+ var i = 1;
1191
+ var opts = [];
1192
+ while(i < 32){
1193
+ opts.push('<option>'+ ((i < 10) ? '0'+ i : i) +'</option>' );
1194
+ i++;
1195
+ }
1196
+ return opts.join('');
1197
+ })() +'</select>';
1167
1198
  var createFormat = function(name){
1168
1199
  if(!curCfg.patterns[name+'Obj']){
1169
1200
  var obj = {};
@@ -1177,15 +1208,19 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1177
1208
  date: {
1178
1209
  _create: function(opts){
1179
1210
  var obj = {
1180
- splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" />')[0]]
1211
+ splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" maxlength="4" />')[0]]
1181
1212
  };
1213
+
1182
1214
  if(opts.monthSelect){
1183
1215
  obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
1184
1216
  } else {
1185
1217
  obj.splits.push($('<input type="text" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0]);
1186
1218
  }
1187
- obj.splits.push($('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]);
1188
-
1219
+ if(opts.daySelect){
1220
+ obj.splits.push($(daySelect)[0]);
1221
+ } else {
1222
+ obj.splits.push($('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]);
1223
+ }
1189
1224
 
1190
1225
  obj.elements = [obj.splits[0], $('<span class="ws-input-seperator" />')[0], obj.splits[1], $('<span class="ws-input-seperator" />')[0], obj.splits[2]];
1191
1226
  return obj;
@@ -1215,7 +1250,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1215
1250
  splits: [$('<input type="text" class="yy" inputmode="numeric" size="4" />')[0]]
1216
1251
  };
1217
1252
  if(opts.monthSelect){
1218
- obj.splits.push($('<select class="mm ws-spin">'+getMonthOptions(opts)+'</select>')[0]);
1253
+ obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
1219
1254
  } else {
1220
1255
  obj.splits.push($('<input type="text" class="mm ws-spin" />')[0]);
1221
1256
  if(opts.onlyMonthDigits){
@@ -1619,18 +1654,30 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1619
1654
  },
1620
1655
  date: function(val, opts, noCorrect){
1621
1656
  createFormat('d');
1622
- var i;
1623
- var obj;
1657
+ var tmp, obj;
1658
+ var ret = '';
1624
1659
  if(opts.splitInput){
1625
1660
  obj = {yy: 0, mm: 1, dd: 2};
1626
1661
  } else {
1627
1662
  obj = curCfg.patterns.dObj;
1628
1663
  val = val.split(curCfg.dFormat);
1629
1664
  }
1630
-
1631
- return (val.length == 3 && val[0] && val[1] && val[2] && (!noCorrect || (val[obj.yy].length > 3 && val[obj.mm].length == 2 && val[obj.dd].length == 2))) ?
1632
- ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-') :
1633
- ''
1665
+ if(val.length == 3 && val[0] && val[1] && val[2] && (!noCorrect || (val[obj.yy].length > 3 && val[obj.mm].length == 2 && val[obj.dd].length == 2))){
1666
+ if(val[obj.mm] > 12 && val[obj.dd] < 13){
1667
+ tmp = val[obj.dd];
1668
+ val[obj.dd] = val[obj.mm];
1669
+ val[obj.mm] = tmp;
1670
+ }
1671
+ if(val[obj.yy].length < 4){
1672
+ tmp = ((new Date()).getFullYear() +'').substr(0, 4 - val[obj.yy].length);
1673
+ if(val[obj.yy] > 50){
1674
+ tmp--;
1675
+ }
1676
+ val[obj.yy] = tmp + val[obj.yy];
1677
+ }
1678
+ ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-');
1679
+ }
1680
+ return ret
1634
1681
  ;
1635
1682
  },
1636
1683
  color: function(val, opts){
@@ -1730,7 +1777,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1730
1777
  this.buttonWrapper = $('<span class="input-buttons '+this.type+'-input-buttons"></span>').insertAfter(this.element);
1731
1778
  this.options.containerElements.push(this.buttonWrapper[0]);
1732
1779
 
1733
- o.mirrorValidity = o.mirrorValidity && this.orig && Modernizr.formvalidation && !webshims.bugs.bustedValidity;
1780
+ o.mirrorValidity = o.mirrorValidity && this.orig && hasFormValidation;
1734
1781
 
1735
1782
  if(o.splitInput && this._addSplitInputs){
1736
1783
  if(o.monthSelect){
@@ -1834,7 +1881,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1834
1881
 
1835
1882
  if(this.type != 'color'){
1836
1883
  (function(){
1837
- var localeChange ;
1884
+ var localeChange, select, selectVal;
1838
1885
  if(!o.splitInput){
1839
1886
  localeChange = function(){
1840
1887
 
@@ -1849,6 +1896,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1849
1896
  } else {
1850
1897
  localeChange = function(){
1851
1898
  that.reorderInputs();
1899
+ if(o.monthSelect){
1900
+ select = that.inputElements.filter('select.mm');
1901
+ selectVal = select.prop('value');
1902
+ select.html(getMonthOptions(o));
1903
+ select.prop('value', selectVal);
1904
+ }
1852
1905
  };
1853
1906
  that.reorderInputs();
1854
1907
  }
@@ -1882,7 +1935,11 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1882
1935
  }
1883
1936
  if(options.splitInput && typeof placeholder == 'object'){
1884
1937
  $.each(this.splits, function(i, elem){
1885
- $.prop(elem, 'placeholder', placeholder[i]);
1938
+ if($.nodeName(elem, 'select')){
1939
+ $(elem).children('option:first-child').text(placeholder[i]);
1940
+ } else {
1941
+ $.prop(elem, 'placeholder', placeholder[i]);
1942
+ }
1886
1943
  });
1887
1944
  } else {
1888
1945
  this.element.prop('placeholder', placeholder);
@@ -1966,14 +2023,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1966
2023
  }
1967
2024
 
1968
2025
 
1969
- if(!o.min && typeof o.relMin == 'number'){
1970
- o.min = this.asValue(this.getRelNumber(o.relMin));
1971
- $.prop(this.orig, 'min', o.min);
1972
- }
1973
2026
 
1974
- if(!o.max && typeof o.relMax == 'number'){
1975
- o.max = this.asValue(this.getRelNumber(o.relMax));
1976
- $.prop(this.orig, 'max', o.max);
2027
+ if((!o.max && typeof o.relMax == 'number') || (!o.min && typeof o.relMin == 'number')){
2028
+ webshims.error('relMax/relMin are not supported anymore')
1977
2029
  }
1978
2030
  this._init = true;
1979
2031
  },
@@ -2042,6 +2094,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2042
2094
  if(!this._init || force || this.options[name] !== val){
2043
2095
  if(isValue){
2044
2096
  this._beforeValue(val);
2097
+ } else {
2098
+ this.elemHelper.prop(name, val);
2045
2099
  }
2046
2100
 
2047
2101
  val = formatVal[this.type](val, this.options);
@@ -2092,9 +2146,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2092
2146
 
2093
2147
  $.fn.spinbtnUI = function(opts){
2094
2148
  opts = $.extend({
2095
- monthNames: 'monthNames',
2096
- size: 1,
2097
- startView: 0
2149
+ monthNames: 'monthNames'
2098
2150
  }, opts);
2099
2151
  return this.each(function(){
2100
2152
  $.webshims.objectCreate(spinBtnProto, {
@@ -2166,10 +2218,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2166
2218
 
2167
2219
 
2168
2220
  picker.commonInit = function(data, popover){
2221
+ if(data._commonInit){return;}
2222
+ data._commonInit = true;
2169
2223
  var tabbable;
2170
2224
 
2171
2225
  popover.isDirty = true;
2172
-
2226
+
2173
2227
  popover.element.on('updatepickercontent pickerchange', function(){
2174
2228
  tabbable = false;
2175
2229
  });
@@ -2209,6 +2263,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2209
2263
  return function(prop){
2210
2264
  if(prop == 'value' && !data.options.inlinePicker){return;}
2211
2265
  popover.isDirty = true;
2266
+
2212
2267
  if(popover.isVisible){
2213
2268
  clearTimeout(timer);
2214
2269
  timer = setTimeout(update, 9);
@@ -2276,30 +2331,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2276
2331
 
2277
2332
  options.containerElements.push(popover.element[0]);
2278
2333
 
2279
- if(data.type != 'color'){
2280
- if(options.yearButtons){
2281
- options.startView = 2;
2282
- }
2283
- if(!options.startView){
2284
- options.startView = 0;
2285
- }
2286
-
2287
- if(data.type == 'time'){
2288
- options.minView = 3;
2289
- options.startView = 3;
2290
- }
2291
- if(!options.minView){
2292
- options.minView = 0;
2293
- }
2294
- if(options.startView < options.minView){
2295
- options.startView = options.minView;
2296
- webshims.warn("wrong config for minView/startView.");
2297
- }
2298
- if(!options.size){
2299
- options.size = 1;
2300
- }
2301
- }
2302
-
2303
2334
  popover.element
2304
2335
  .addClass(data.type+'-popover input-picker')
2305
2336
  .attr({role: 'application'})
@@ -2360,12 +2391,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2360
2391
  };
2361
2392
  data.inputElements.on({
2362
2393
  keydown: function(e){
2363
- if(e.keyCode == 40 && e.altKey){
2394
+ if(e.keyCode == 40 && e.altKey && !$.nodeName(e.target, 'select')){
2364
2395
  open();
2365
2396
  }
2366
2397
  },
2367
- focus: function(){
2368
- if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus))){
2398
+ focus: function(e){
2399
+ if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus)) && !$.nodeName(e.target, 'select')){
2369
2400
  popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
2370
2401
  show();
2371
2402
  } else {
@@ -2382,7 +2413,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2382
2413
  popover.activeElement.focus();
2383
2414
  }, 4);
2384
2415
  }
2385
- if(data.element.is(':focus')){
2416
+ if(data.element.is(':focus') && !$.nodeName(e.target, 'select')){
2386
2417
  popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
2387
2418
  show();
2388
2419
  }
@@ -2610,10 +2641,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2610
2641
  opts[optsName] = $.attr(this, copyAttrs[i]) || opts[optsName];
2611
2642
  }
2612
2643
  }
2613
- if(opts.monthSelect){
2614
- opts.onlyMonthDigits = true;
2615
- }
2616
- if(opts.onlyMonthDigits){
2644
+
2645
+ if(opts.onlyMonthDigits || (!opts.formatMonthNames && opts.monthSelect)){
2617
2646
  opts.formatMonthNames = 'monthDigits';
2618
2647
  }
2619
2648
  data.shim = inputTypes[type]._create(opts);
@@ -2663,11 +2692,11 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2663
2692
 
2664
2693
  data.shim.element.on('change input', stopPropagation);
2665
2694
 
2666
- if(Modernizr.formvalidation){
2695
+ if(hasFormValidation){
2667
2696
  $(opts.orig).on('firstinvalid', function(e){
2668
2697
  if(!webshims.fromSubmit && isCheckValidity){return;}
2669
2698
  $(opts.orig).off('invalid.replacedwidgetbubble').on('invalid.replacedwidgetbubble', function(evt){
2670
- if(!e.isInvalidUIPrevented() && !evt.isDefaultPrevented()){
2699
+ if(!evt.isDefaultPrevented()){
2671
2700
  webshims.validityAlert.showFor( e.target );
2672
2701
  e.preventDefault();
2673
2702
  evt.preventDefault();
@@ -2694,7 +2723,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2694
2723
  };
2695
2724
 
2696
2725
 
2697
- if(Modernizr.formvalidation){
2726
+ if(hasFormValidation){
2698
2727
  ['input', 'form'].forEach(function(name){
2699
2728
  var desc = webshims.defineNodeNameProperty(name, 'checkValidity', {
2700
2729
  prop: {
@@ -2745,7 +2774,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2745
2774
  if(!modernizrInputTypes[name] || replace[name]){
2746
2775
  extendType(name, {
2747
2776
  _create: function(opts, set){
2748
- if(opts.monthSelect){
2777
+ if(opts.monthSelect || opts.daySelect){
2749
2778
  opts.splitInput = true;
2750
2779
  }
2751
2780
  if(opts.splitInput && !splitInputs[name]){
@@ -1444,8 +1444,7 @@ if((!advancedObjectProperties || !Object.create || !Object.defineProperties || !
1444
1444
  })(webshims.$, webshims);
1445
1445
 
1446
1446
 
1447
-
1448
- webshims.register('form-number-date-api', function($, webshims, window, document, undefined, options){
1447
+ ;webshims.register('form-number-date-api', function($, webshims, window, document, undefined, options){
1449
1448
  "use strict";
1450
1449
  if(!webshims.addInputType){
1451
1450
  webshims.error("you can not call forms-ext feature after calling forms feature. call both at once instead: $.webshims.polyfill('forms forms-ext')");
@@ -1510,7 +1509,8 @@ webshims.register('form-number-date-api', function($, webshims, window, document
1510
1509
  cache.type = getType(input[0]);
1511
1510
  }
1512
1511
  if(cache.type == 'week'){return false;}
1513
- var ret = (validityState || {}).stepMismatch || false, base;
1512
+ var base, attrVal;
1513
+ var ret = (validityState || {}).stepMismatch || false;
1514
1514
  if(typeModels[cache.type] && typeModels[cache.type].step){
1515
1515
  if( !('step' in cache) ){
1516
1516
  cache.step = webshims.getStep(input[0], cache.type);
@@ -1525,6 +1525,11 @@ webshims.register('form-number-date-api', function($, webshims, window, document
1525
1525
 
1526
1526
  addMinMaxNumberToCache('min', input, cache);
1527
1527
  base = cache.minAsNumber;
1528
+
1529
+ if(isNaN(base) && (attrVal = input.prop('defaultValue'))){
1530
+ base = typeModels[cache.type].asNumber( attrVal );
1531
+ }
1532
+
1528
1533
  if(isNaN(base)){
1529
1534
  base = typeModels[cache.type].stepBase || 0;
1530
1535
  }
@@ -1639,7 +1644,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
1639
1644
  var stepDescriptor = webshims.defineNodeNameProperty('input', name, {
1640
1645
  prop: {
1641
1646
  value: function(factor){
1642
- var step, val, dateVal, valModStep, alignValue, cache;
1647
+ var step, val, dateVal, valModStep, alignValue, cache, base, attrVal;
1643
1648
  var type = getType(this);
1644
1649
  if(typeModels[type] && typeModels[type].asNumber){
1645
1650
  cache = {type: type};
@@ -1666,10 +1671,21 @@ webshims.register('form-number-date-api', function($, webshims, window, document
1666
1671
  webshims.addMinMaxNumberToCache('min', $(this), cache);
1667
1672
  webshims.addMinMaxNumberToCache('max', $(this), cache);
1668
1673
 
1674
+ base = cache.minAsNumber;
1675
+
1676
+ if(isNaN(base) && (attrVal = $.prop(this, 'defaultValue'))){
1677
+ base = typeModels[type].asNumber( attrVal );
1678
+ }
1679
+
1680
+ if(!base){
1681
+ base = 0;
1682
+ }
1683
+
1669
1684
  step *= factor;
1670
1685
 
1671
1686
  val = (val + step).toFixed(5) * 1;
1672
- valModStep = (val - (cache.minAsNumber || 0)) % step;
1687
+
1688
+ valModStep = (val - base) % step;
1673
1689
 
1674
1690
  if ( valModStep && (Math.abs(valModStep) > EPS) ) {
1675
1691
  alignValue = val - valModStep;
@@ -2033,8 +2049,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
2033
2049
  });
2034
2050
  }
2035
2051
 
2036
- });
2037
- (function($){
2052
+ });;(function($){
2038
2053
 
2039
2054
  var id = 0;
2040
2055
  var isNumber = function(string){
@@ -2054,7 +2069,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
2054
2069
 
2055
2070
  this.element.addClass('ws-range').attr({role: 'slider'}).append('<span class="ws-range-min ws-range-progress" /><span class="ws-range-rail ws-range-track"><span class="ws-range-thumb" /></span>');
2056
2071
  this.trail = $('.ws-range-track', this.element);
2057
- this.range = $('.ws-range-progress ', this.element);
2072
+ this.range = $('.ws-range-progress', this.element);
2058
2073
  this.thumb = $('.ws-range-thumb', this.trail);
2059
2074
 
2060
2075
  this.updateMetrics();
@@ -2074,7 +2089,7 @@ webshims.register('form-number-date-api', function($, webshims, window, document
2074
2089
  },
2075
2090
  value: $.noop,
2076
2091
  _value: function(val, _noNormalize, animate){
2077
- var left, posDif;
2092
+ var left, posDif, textValue;
2078
2093
  var o = this.options;
2079
2094
  var oVal = val;
2080
2095
  var thumbStyle = {};
@@ -2123,9 +2138,15 @@ webshims.register('form-number-date-api', function($, webshims, window, document
2123
2138
  if(this.orig && (oVal != val || (!this._init && this.orig.value != val)) ){
2124
2139
  this.options._change(val);
2125
2140
  }
2141
+
2142
+ textValue = this.options.textValue ? this.options.textValue(this.options.value) : this.options.options[this.options.value] || this.options.value;
2126
2143
  this.element.attr({
2127
2144
  'aria-valuenow': this.options.value,
2128
- 'aria-valuetext': this.options.textValue ? this.options.textValue(this.options.value) : this.options.options[this.options.value] || this.options.value
2145
+ 'aria-valuetext': textValue
2146
+ });
2147
+ this.thumb.attr({
2148
+ 'data-value': this.options.value,
2149
+ 'data-valuetext': textValue
2129
2150
  });
2130
2151
  },
2131
2152
  initDataList: function(){
@@ -2169,13 +2190,19 @@ webshims.register('form-number-date-api', function($, webshims, window, document
2169
2190
  $.each(o.options, function(val, label){
2170
2191
  if(!isNumber(val) || val < min || val > max){return;}
2171
2192
  var left = 100 * ((val - min) / (max - min));
2172
- var title = o.showLabels && label ? ' title="'+ label +'"' : '';
2193
+ var attr = '';
2194
+ if(label){
2195
+ attr += 'data-label="'+label+'"';
2196
+ if(o.showLabels){
2197
+ attr += ' title="'+label+'"';
2198
+ }
2199
+ }
2173
2200
  if(that.vertical){
2174
2201
  left = Math.abs(left - 100);
2175
2202
  }
2176
2203
 
2177
2204
  that.posCenter(
2178
- $('<span class="ws-range-ticks"'+ title +' data-label="'+label+'" style="'+(that.dirs.left)+': '+left+'%;" />').appendTo(trail)
2205
+ $('<span class="ws-range-ticks"'+ attr +' style="'+(that.dirs.left)+': '+left+'%;" />').appendTo(trail)
2179
2206
  );
2180
2207
  });
2181
2208
  },
@@ -2584,33 +2611,36 @@ webshims.register('form-number-date-api', function($, webshims, window, document
2584
2611
  });
2585
2612
  };
2586
2613
  if(window.webshims && webshims.isReady){
2587
- webshims.ready('es5', function(){
2588
- webshims.isReady('range-ui', true);
2589
- });
2590
- if(webshims._polyfill){
2591
- webshims._polyfill(['es5']);
2592
- }
2614
+ webshims.isReady('range-ui', true);
2593
2615
  }
2594
- })(window.webshims ? webshims.$ : jQuery);
2595
- webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){
2616
+ })(window.webshims ? webshims.$ : jQuery);;webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){
2596
2617
  "use strict";
2597
2618
  var curCfg;
2598
2619
  var formcfg = webshims.formcfg;
2620
+ var hasFormValidation = Modernizr.formvalidation && !webshims.bugs.bustedValidity;
2599
2621
  var monthDigits = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
2600
2622
  var stopPropagation = function(e){
2601
2623
  e.stopImmediatePropagation();
2602
2624
  };
2603
- var getMonthOptions = (function(){
2604
- var str;
2605
- return function(){
2606
- if(!str){
2607
- str = ('<option value=""></option>')+$.map(monthDigits, function(val){
2608
- return '<option value="'+val+'"]>'+val+'</option>';
2609
- }).join('');
2610
- }
2611
- return str;
2612
- };
2613
- })();
2625
+ var getMonthOptions = function(opts){
2626
+ var selectName = 'monthSelect'+opts.formatMonthNames;
2627
+ if(!curCfg[selectName]){
2628
+ var labels = curCfg.date[opts.formatMonthNames] || monthDigits;
2629
+ curCfg[selectName] = ('<option value=""></option>')+$.map(monthDigits, function(val, i){
2630
+ return '<option value="'+val+'"]>'+labels[i]+'</option>';
2631
+ }).join('');
2632
+ }
2633
+ return curCfg[selectName];
2634
+ };
2635
+ var daySelect = '<select class="dd"><option value=""></option>'+ (function(){
2636
+ var i = 1;
2637
+ var opts = [];
2638
+ while(i < 32){
2639
+ opts.push('<option>'+ ((i < 10) ? '0'+ i : i) +'</option>' );
2640
+ i++;
2641
+ }
2642
+ return opts.join('');
2643
+ })() +'</select>';
2614
2644
  var createFormat = function(name){
2615
2645
  if(!curCfg.patterns[name+'Obj']){
2616
2646
  var obj = {};
@@ -2624,15 +2654,19 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2624
2654
  date: {
2625
2655
  _create: function(opts){
2626
2656
  var obj = {
2627
- splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" />')[0]]
2657
+ splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" maxlength="4" />')[0]]
2628
2658
  };
2659
+
2629
2660
  if(opts.monthSelect){
2630
2661
  obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
2631
2662
  } else {
2632
2663
  obj.splits.push($('<input type="text" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0]);
2633
2664
  }
2634
- obj.splits.push($('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]);
2635
-
2665
+ if(opts.daySelect){
2666
+ obj.splits.push($(daySelect)[0]);
2667
+ } else {
2668
+ obj.splits.push($('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]);
2669
+ }
2636
2670
 
2637
2671
  obj.elements = [obj.splits[0], $('<span class="ws-input-seperator" />')[0], obj.splits[1], $('<span class="ws-input-seperator" />')[0], obj.splits[2]];
2638
2672
  return obj;
@@ -2662,7 +2696,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2662
2696
  splits: [$('<input type="text" class="yy" inputmode="numeric" size="4" />')[0]]
2663
2697
  };
2664
2698
  if(opts.monthSelect){
2665
- obj.splits.push($('<select class="mm ws-spin">'+getMonthOptions(opts)+'</select>')[0]);
2699
+ obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
2666
2700
  } else {
2667
2701
  obj.splits.push($('<input type="text" class="mm ws-spin" />')[0]);
2668
2702
  if(opts.onlyMonthDigits){
@@ -3066,18 +3100,30 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3066
3100
  },
3067
3101
  date: function(val, opts, noCorrect){
3068
3102
  createFormat('d');
3069
- var i;
3070
- var obj;
3103
+ var tmp, obj;
3104
+ var ret = '';
3071
3105
  if(opts.splitInput){
3072
3106
  obj = {yy: 0, mm: 1, dd: 2};
3073
3107
  } else {
3074
3108
  obj = curCfg.patterns.dObj;
3075
3109
  val = val.split(curCfg.dFormat);
3076
3110
  }
3077
-
3078
- return (val.length == 3 && val[0] && val[1] && val[2] && (!noCorrect || (val[obj.yy].length > 3 && val[obj.mm].length == 2 && val[obj.dd].length == 2))) ?
3079
- ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-') :
3080
- ''
3111
+ if(val.length == 3 && val[0] && val[1] && val[2] && (!noCorrect || (val[obj.yy].length > 3 && val[obj.mm].length == 2 && val[obj.dd].length == 2))){
3112
+ if(val[obj.mm] > 12 && val[obj.dd] < 13){
3113
+ tmp = val[obj.dd];
3114
+ val[obj.dd] = val[obj.mm];
3115
+ val[obj.mm] = tmp;
3116
+ }
3117
+ if(val[obj.yy].length < 4){
3118
+ tmp = ((new Date()).getFullYear() +'').substr(0, 4 - val[obj.yy].length);
3119
+ if(val[obj.yy] > 50){
3120
+ tmp--;
3121
+ }
3122
+ val[obj.yy] = tmp + val[obj.yy];
3123
+ }
3124
+ ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-');
3125
+ }
3126
+ return ret
3081
3127
  ;
3082
3128
  },
3083
3129
  color: function(val, opts){
@@ -3177,7 +3223,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3177
3223
  this.buttonWrapper = $('<span class="input-buttons '+this.type+'-input-buttons"></span>').insertAfter(this.element);
3178
3224
  this.options.containerElements.push(this.buttonWrapper[0]);
3179
3225
 
3180
- o.mirrorValidity = o.mirrorValidity && this.orig && Modernizr.formvalidation && !webshims.bugs.bustedValidity;
3226
+ o.mirrorValidity = o.mirrorValidity && this.orig && hasFormValidation;
3181
3227
 
3182
3228
  if(o.splitInput && this._addSplitInputs){
3183
3229
  if(o.monthSelect){
@@ -3281,7 +3327,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3281
3327
 
3282
3328
  if(this.type != 'color'){
3283
3329
  (function(){
3284
- var localeChange ;
3330
+ var localeChange, select, selectVal;
3285
3331
  if(!o.splitInput){
3286
3332
  localeChange = function(){
3287
3333
 
@@ -3296,6 +3342,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3296
3342
  } else {
3297
3343
  localeChange = function(){
3298
3344
  that.reorderInputs();
3345
+ if(o.monthSelect){
3346
+ select = that.inputElements.filter('select.mm');
3347
+ selectVal = select.prop('value');
3348
+ select.html(getMonthOptions(o));
3349
+ select.prop('value', selectVal);
3350
+ }
3299
3351
  };
3300
3352
  that.reorderInputs();
3301
3353
  }
@@ -3329,7 +3381,11 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3329
3381
  }
3330
3382
  if(options.splitInput && typeof placeholder == 'object'){
3331
3383
  $.each(this.splits, function(i, elem){
3332
- $.prop(elem, 'placeholder', placeholder[i]);
3384
+ if($.nodeName(elem, 'select')){
3385
+ $(elem).children('option:first-child').text(placeholder[i]);
3386
+ } else {
3387
+ $.prop(elem, 'placeholder', placeholder[i]);
3388
+ }
3333
3389
  });
3334
3390
  } else {
3335
3391
  this.element.prop('placeholder', placeholder);
@@ -3413,14 +3469,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3413
3469
  }
3414
3470
 
3415
3471
 
3416
- if(!o.min && typeof o.relMin == 'number'){
3417
- o.min = this.asValue(this.getRelNumber(o.relMin));
3418
- $.prop(this.orig, 'min', o.min);
3419
- }
3420
3472
 
3421
- if(!o.max && typeof o.relMax == 'number'){
3422
- o.max = this.asValue(this.getRelNumber(o.relMax));
3423
- $.prop(this.orig, 'max', o.max);
3473
+ if((!o.max && typeof o.relMax == 'number') || (!o.min && typeof o.relMin == 'number')){
3474
+ webshims.error('relMax/relMin are not supported anymore')
3424
3475
  }
3425
3476
  this._init = true;
3426
3477
  },
@@ -3489,6 +3540,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3489
3540
  if(!this._init || force || this.options[name] !== val){
3490
3541
  if(isValue){
3491
3542
  this._beforeValue(val);
3543
+ } else {
3544
+ this.elemHelper.prop(name, val);
3492
3545
  }
3493
3546
 
3494
3547
  val = formatVal[this.type](val, this.options);
@@ -3539,9 +3592,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3539
3592
 
3540
3593
  $.fn.spinbtnUI = function(opts){
3541
3594
  opts = $.extend({
3542
- monthNames: 'monthNames',
3543
- size: 1,
3544
- startView: 0
3595
+ monthNames: 'monthNames'
3545
3596
  }, opts);
3546
3597
  return this.each(function(){
3547
3598
  $.webshims.objectCreate(spinBtnProto, {
@@ -3613,10 +3664,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3613
3664
 
3614
3665
 
3615
3666
  picker.commonInit = function(data, popover){
3667
+ if(data._commonInit){return;}
3668
+ data._commonInit = true;
3616
3669
  var tabbable;
3617
3670
 
3618
3671
  popover.isDirty = true;
3619
-
3672
+
3620
3673
  popover.element.on('updatepickercontent pickerchange', function(){
3621
3674
  tabbable = false;
3622
3675
  });
@@ -3656,6 +3709,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3656
3709
  return function(prop){
3657
3710
  if(prop == 'value' && !data.options.inlinePicker){return;}
3658
3711
  popover.isDirty = true;
3712
+
3659
3713
  if(popover.isVisible){
3660
3714
  clearTimeout(timer);
3661
3715
  timer = setTimeout(update, 9);
@@ -3723,30 +3777,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3723
3777
 
3724
3778
  options.containerElements.push(popover.element[0]);
3725
3779
 
3726
- if(data.type != 'color'){
3727
- if(options.yearButtons){
3728
- options.startView = 2;
3729
- }
3730
- if(!options.startView){
3731
- options.startView = 0;
3732
- }
3733
-
3734
- if(data.type == 'time'){
3735
- options.minView = 3;
3736
- options.startView = 3;
3737
- }
3738
- if(!options.minView){
3739
- options.minView = 0;
3740
- }
3741
- if(options.startView < options.minView){
3742
- options.startView = options.minView;
3743
- webshims.warn("wrong config for minView/startView.");
3744
- }
3745
- if(!options.size){
3746
- options.size = 1;
3747
- }
3748
- }
3749
-
3750
3780
  popover.element
3751
3781
  .addClass(data.type+'-popover input-picker')
3752
3782
  .attr({role: 'application'})
@@ -3807,12 +3837,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3807
3837
  };
3808
3838
  data.inputElements.on({
3809
3839
  keydown: function(e){
3810
- if(e.keyCode == 40 && e.altKey){
3840
+ if(e.keyCode == 40 && e.altKey && !$.nodeName(e.target, 'select')){
3811
3841
  open();
3812
3842
  }
3813
3843
  },
3814
- focus: function(){
3815
- if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus))){
3844
+ focus: function(e){
3845
+ if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus)) && !$.nodeName(e.target, 'select')){
3816
3846
  popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
3817
3847
  show();
3818
3848
  } else {
@@ -3829,7 +3859,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3829
3859
  popover.activeElement.focus();
3830
3860
  }, 4);
3831
3861
  }
3832
- if(data.element.is(':focus')){
3862
+ if(data.element.is(':focus') && !$.nodeName(e.target, 'select')){
3833
3863
  popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
3834
3864
  show();
3835
3865
  }
@@ -4057,10 +4087,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
4057
4087
  opts[optsName] = $.attr(this, copyAttrs[i]) || opts[optsName];
4058
4088
  }
4059
4089
  }
4060
- if(opts.monthSelect){
4061
- opts.onlyMonthDigits = true;
4062
- }
4063
- if(opts.onlyMonthDigits){
4090
+
4091
+ if(opts.onlyMonthDigits || (!opts.formatMonthNames && opts.monthSelect)){
4064
4092
  opts.formatMonthNames = 'monthDigits';
4065
4093
  }
4066
4094
  data.shim = inputTypes[type]._create(opts);
@@ -4110,11 +4138,11 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
4110
4138
 
4111
4139
  data.shim.element.on('change input', stopPropagation);
4112
4140
 
4113
- if(Modernizr.formvalidation){
4141
+ if(hasFormValidation){
4114
4142
  $(opts.orig).on('firstinvalid', function(e){
4115
4143
  if(!webshims.fromSubmit && isCheckValidity){return;}
4116
4144
  $(opts.orig).off('invalid.replacedwidgetbubble').on('invalid.replacedwidgetbubble', function(evt){
4117
- if(!e.isInvalidUIPrevented() && !evt.isDefaultPrevented()){
4145
+ if(!evt.isDefaultPrevented()){
4118
4146
  webshims.validityAlert.showFor( e.target );
4119
4147
  e.preventDefault();
4120
4148
  evt.preventDefault();
@@ -4141,7 +4169,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
4141
4169
  };
4142
4170
 
4143
4171
 
4144
- if(Modernizr.formvalidation){
4172
+ if(hasFormValidation){
4145
4173
  ['input', 'form'].forEach(function(name){
4146
4174
  var desc = webshims.defineNodeNameProperty(name, 'checkValidity', {
4147
4175
  prop: {
@@ -4192,7 +4220,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
4192
4220
  if(!modernizrInputTypes[name] || replace[name]){
4193
4221
  extendType(name, {
4194
4222
  _create: function(opts, set){
4195
- if(opts.monthSelect){
4223
+ if(opts.monthSelect || opts.daySelect){
4196
4224
  opts.splitInput = true;
4197
4225
  }
4198
4226
  if(opts.splitInput && !splitInputs[name]){