webshims-rails 1.10.10 → 1.10.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +8 -8
  2. data/MIT_LICENSE.txt +3 -1
  3. data/lib/webshims-rails/version.rb +2 -2
  4. data/vendor/assets/javascripts/webshims/polyfiller.js +8 -9
  5. data/vendor/assets/javascripts/webshims/shims/combos/1.js +91 -58
  6. data/vendor/assets/javascripts/webshims/shims/combos/10.js +247 -101
  7. data/vendor/assets/javascripts/webshims/shims/combos/11.js +241 -96
  8. data/vendor/assets/javascripts/webshims/shims/combos/12.js +79 -58
  9. data/vendor/assets/javascripts/webshims/shims/combos/13.js +79 -12
  10. data/vendor/assets/javascripts/webshims/shims/combos/14.js +6 -5
  11. data/vendor/assets/javascripts/webshims/shims/combos/15.js +68 -75
  12. data/vendor/assets/javascripts/webshims/shims/combos/16.js +147 -133
  13. data/vendor/assets/javascripts/webshims/shims/combos/17.js +288 -143
  14. data/vendor/assets/javascripts/webshims/shims/combos/18.js +288 -143
  15. data/vendor/assets/javascripts/webshims/shims/combos/19.js +85 -63
  16. data/vendor/assets/javascripts/webshims/shims/combos/2.js +97 -91
  17. data/vendor/assets/javascripts/webshims/shims/combos/20.js +85 -17
  18. data/vendor/assets/javascripts/webshims/shims/combos/21.js +17 -17
  19. data/vendor/assets/javascripts/webshims/shims/combos/23.js +79 -58
  20. data/vendor/assets/javascripts/webshims/shims/combos/24.js +17 -16
  21. data/vendor/assets/javascripts/webshims/shims/combos/25.js +85 -63
  22. data/vendor/assets/javascripts/webshims/shims/combos/26.js +6 -5
  23. data/vendor/assets/javascripts/webshims/shims/combos/27.js +0 -46
  24. data/vendor/assets/javascripts/webshims/shims/combos/28.js +6 -5
  25. data/vendor/assets/javascripts/webshims/shims/combos/29.js +13 -6
  26. data/vendor/assets/javascripts/webshims/shims/combos/3.js +47 -31
  27. data/vendor/assets/javascripts/webshims/shims/combos/30.js +47 -59
  28. data/vendor/assets/javascripts/webshims/shims/combos/31.js +18 -33
  29. data/vendor/assets/javascripts/webshims/shims/combos/4.js +35 -31
  30. data/vendor/assets/javascripts/webshims/shims/combos/5.js +304 -157
  31. data/vendor/assets/javascripts/webshims/shims/combos/6.js +304 -185
  32. data/vendor/assets/javascripts/webshims/shims/combos/7.js +126 -117
  33. data/vendor/assets/javascripts/webshims/shims/combos/8.js +126 -89
  34. data/vendor/assets/javascripts/webshims/shims/combos/9.js +247 -129
  35. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +6 -5
  36. data/vendor/assets/javascripts/webshims/shims/form-core.js +12 -0
  37. data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +3 -0
  38. data/vendor/assets/javascripts/webshims/shims/form-datalist.js +0 -28
  39. data/vendor/assets/javascripts/webshims/shims/form-message.js +29 -26
  40. data/vendor/assets/javascripts/webshims/shims/form-native-extend.js +16 -14
  41. data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +47 -47
  42. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +241 -96
  43. data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +21 -16
  44. data/vendor/assets/javascripts/webshims/shims/form-validation.js +17 -16
  45. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +173 -41
  46. data/vendor/assets/javascripts/webshims/shims/geolocation.js +17 -17
  47. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-ar.js +35 -33
  48. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-ch-ZN.js +32 -30
  49. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-de.txt +17 -13
  50. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-el.js +32 -30
  51. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-en.txt +4 -1
  52. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-es.js +30 -28
  53. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-fr.js +35 -32
  54. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-he.js +32 -30
  55. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-hi.js +32 -30
  56. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-hu.js +32 -30
  57. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-it.js +32 -30
  58. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-ja.js +32 -30
  59. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-lt.js +37 -36
  60. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-nl.js +32 -30
  61. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-pl.js +5 -2
  62. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-pt-PT.js +33 -30
  63. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-ru.js +3 -1
  64. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-sv.js +32 -30
  65. data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +79 -12
  66. data/vendor/assets/javascripts/webshims/shims/styles/forms.png +0 -0
  67. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +126 -121
  68. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +100 -111
  69. data/vendor/assets/javascripts/webshims/shims/swfmini.js +0 -46
  70. data/vendor/assets/javascripts/webshims/shims/track-ui.js +13 -6
  71. data/webshims-rails.gemspec +1 -0
  72. metadata +4 -3
@@ -2,10 +2,21 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2
2
  "use strict";
3
3
  var curCfg;
4
4
  var formcfg = webshims.formcfg;
5
-
5
+ var monthDigits = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
6
6
  var stopPropagation = function(e){
7
7
  e.stopImmediatePropagation();
8
8
  };
9
+ var getMonthOptions = (function(){
10
+ var str;
11
+ return function(){
12
+ if(!str){
13
+ str = ('<option></option>')+$.map(monthDigits, function(val){
14
+ return '<option>'+val+'</option>';
15
+ }).join('');
16
+ }
17
+ return str;
18
+ };
19
+ })();
9
20
  var createFormat = function(name){
10
21
  if(!curCfg.patterns[name+'Obj']){
11
22
  var obj = {};
@@ -17,10 +28,18 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
17
28
  };
18
29
  var splitInputs = {
19
30
  date: {
20
- _create: function(){
31
+ _create: function(opts){
21
32
  var obj = {
22
- splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" />')[0], $('<input type="text" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0], $('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]]
33
+ splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" />')[0]]
23
34
  };
35
+ if(opts.monthSelect){
36
+ obj.splits.push($('<select class="mm">'+getMonthOptions()+'</select>')[0]);
37
+ } else {
38
+ obj.splits.push($('<input type="text" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0]);
39
+ }
40
+ obj.splits.push($('<input type="text" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]);
41
+
42
+
24
43
  obj.elements = [obj.splits[0], $('<span class="ws-input-seperator" />')[0], obj.splits[1], $('<span class="ws-input-seperator" />')[0], obj.splits[2]];
25
44
  return obj;
26
45
  },
@@ -28,7 +47,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
28
47
  createFormat('d');
29
48
  var i = 0;
30
49
  var seperators = $('.ws-input-seperator', element).html(curCfg.dFormat);
31
- var inputs = $('input', element);
50
+ var inputs = $('input, select', element);
32
51
  $.each(curCfg.patterns.dObj, function(name, value){
33
52
  var input = inputs.filter('.'+ name);
34
53
  if(input[0]){
@@ -46,17 +65,23 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
46
65
  _create: function(opts){
47
66
 
48
67
  var obj = {
49
- splits: [$('<input type="text" class="yy" inputmode="numeric" size="4" />')[0], $('<input type="text" class="mm ws-spin" />')[0]]
68
+ splits: [$('<input type="text" class="yy" inputmode="numeric" size="4" />')[0]]
50
69
  };
51
- if(opts.onlyMonthDigits){
52
- $(obj.splits[1]).attr({inputmode: 'numeric', size: 2, maxlength: 2});
70
+ if(opts.monthSelect){
71
+ obj.splits.push($('<select class="mm ws-spin">'+getMonthOptions()+'</select>')[0]);
72
+ } else {
73
+ obj.splits.push($('<input type="text" class="mm ws-spin" />')[0]);
74
+ if(opts.onlyMonthDigits){
75
+ $(obj.splits[1]).attr({inputmode: 'numeric', size: 2, maxlength: 2});
76
+ }
53
77
  }
78
+
54
79
  obj.elements = [obj.splits[0], $('<span class="ws-input-seperator" />')[0], obj.splits[1]];
55
80
  return obj;
56
81
  },
57
82
  sort: function(element){
58
83
  var seperator = $('.ws-input-seperator', element).html(curCfg.dFormat);
59
- var mm = $('input.mm', element);
84
+ var mm = $('input.mm, select.mm', element);
60
85
  var action;
61
86
  if(curCfg.date.showMonthAfterYear){
62
87
  mm.appendTo(element);
@@ -70,7 +95,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
70
95
  }
71
96
  };
72
97
 
73
- var nowDate = new Date().getTime() - (new Date().getTimezoneOffset() * 60 * 1000 );
98
+ var nowDate = new Date(new Date().getTime() - (new Date().getTimezoneOffset() * 60 * 1000 ));
99
+ nowDate = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate(), nowDate.getHours()).getTime()
74
100
  var steps = {
75
101
  number: {
76
102
  step: 1
@@ -79,6 +105,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
79
105
  // step: 1,
80
106
  // start: new Date(nowDate)
81
107
  // },
108
+ 'datetime-local': {
109
+ step: 60,
110
+ start: new Date(nowDate).getTime()
111
+ },
82
112
  time: {
83
113
  step: 60
84
114
  },
@@ -114,7 +144,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
114
144
 
115
145
 
116
146
  (function(){
117
- var monthDigits = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
118
147
 
119
148
  formcfg.de = $.extend(true, {
120
149
  numberFormat: {
@@ -164,6 +193,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
164
193
  patterns: {
165
194
  d: "mm/dd/yy"
166
195
  },
196
+ meridian: ['AM', 'PM'],
167
197
  month: {
168
198
  currentText: 'This month'
169
199
  },
@@ -217,12 +247,18 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
217
247
  langCfg.date.monthkeys = {};
218
248
  langCfg.date.monthDigits = monthDigits;
219
249
  langCfg.numberSigns += '-';
250
+ if(langCfg.meridian){
251
+ langCfg.timeSigns += langCfg.meridian[0] + langCfg.meridian[1];
252
+ }
220
253
  $.each(langCfg.date.monthNames, create);
221
254
  $.each(langCfg.date.monthNamesShort, create);
222
255
  }
223
256
  if(!langCfg.colorSigns){
224
257
  langCfg.colorSigns = '#abcdefABCDEF';
225
258
  }
259
+ if(!langCfg['datetime-localSigns']){
260
+ langCfg['datetime-localSigns'] = langCfg.dateSigns+langCfg.timeSigns;
261
+ }
226
262
  };
227
263
  var triggerLocaleChange = function(){
228
264
  processLangCFG(curCfg);
@@ -279,11 +315,31 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
279
315
  return (val+'').replace(/\,/g, '').replace(/\./, curCfg.numberFormat['.']);
280
316
  },
281
317
  time: function(val){
318
+ var fVal;
319
+ if(val && curCfg.meridian){
320
+ val = val.split(':');
321
+ fVal = (val[0] * 1);
322
+ if(fVal && fVal >= 12){
323
+ val[0] = addZero(fVal - 12+'');
324
+ fVal = 1;
325
+
326
+ } else {
327
+ fVal = 0;
328
+ }
329
+ val = $.trim(val.join(':')) + ' '+ curCfg.meridian[fVal];
330
+ }
282
331
  return val;
283
332
  },
284
- week: function(val){
333
+ 'datetime-local': function(val, o){
334
+ var fVal = $.trim(val || '').split('T');
335
+ if(fVal.length == 2){
336
+ val = this.date(fVal[0], o) +' '+this.time(fVal[1], o);
337
+ }
285
338
  return val;
286
339
  },
340
+ // week: function(val){
341
+ // return val;
342
+ // },
287
343
  //todo empty val for month/split
288
344
  month: function(val, options){
289
345
  var names;
@@ -336,7 +392,32 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
336
392
  // week: function(val){
337
393
  // return val;
338
394
  // },
395
+ 'datetime-local': function(val, o){
396
+ var tmp;
397
+ var fVal = $.trim(val || '').split(/\s+/);
398
+ if(fVal.length == 2){
399
+ if(fVal[0].indexOf(':') != -1 && fVal[1].indexOf(':') == -1){
400
+ tmp = fVal[1];
401
+ fVal[1] = fVal[0];
402
+ fVal[0] = tmp;
403
+ }
404
+ val = this.date(fVal[0], o) +'T'+ this.time(fVal[1], o);
405
+ }
406
+ return val;
407
+ },
339
408
  time: function(val){
409
+ var fVal;
410
+ if(val && curCfg.meridian){
411
+ if(val.indexOf(curCfg.meridian[1]) != -1){
412
+ val = val.split(':');
413
+ fVal = (val[0] * 1);
414
+ if(!isNaN(fVal)){
415
+ val[0] = fVal + 12;
416
+ }
417
+ val = val.join(':');
418
+ }
419
+ val = $.trim(val.replace(curCfg.meridian[0], '').replace(curCfg.meridian[1], ''));
420
+ }
340
421
  return val;
341
422
  },
342
423
  month: function(val, opts, noCorrect){
@@ -437,8 +518,16 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
437
518
  var type = (typeof val == 'object') ? 'valueAsDate' : 'valueAsNumber';
438
519
  return input.prop(type, val).prop('value');
439
520
  },
440
- isValid: function(val){
441
- return input.prop('value', val).is(':valid') && input.prop('value') == val;
521
+ isValid: function(val, attrs){
522
+ if(attrs && (attrs.nodeName || attrs.jquery)){
523
+ attrs = {
524
+ min: $(attrs).prop('min') || '',
525
+ max: $(attrs).prop('max') || '',
526
+ step: $(attrs).prop('step') || 'any'
527
+ };
528
+ }
529
+ attrs = $.extend({step: 'any', min: '', max: ''}, attrs || {});
530
+ return input.attr(attrs).prop('value', val).is(':valid') && input.prop('value') == val;
442
531
  }
443
532
  };
444
533
  }
@@ -463,6 +552,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
463
552
  o.mirrorValidity = o.mirrorValidity && this.orig && Modernizr.formvalidation && !webshims.bugs.bustedValidity;
464
553
 
465
554
  if(o.splitInput && this._addSplitInputs){
555
+ if(o.monthSelect){
556
+ this.element.addClass('ws-month-select');
557
+ }
466
558
  this._addSplitInputs();
467
559
  } else {
468
560
  this.inputElements = this.element;
@@ -714,7 +806,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
714
806
  try {
715
807
  $(this)
716
808
  .next()
717
- .next('input')
809
+ .next('input, select')
718
810
  .each(select)
719
811
  ;
720
812
  } catch(er){}
@@ -792,7 +884,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
792
884
  }
793
885
  };
794
886
  spinEvents.keydown = function(e){
795
- if(o.list || e.isDefaultPrevented() || $.attr(this, 'list')){return;}
887
+ if(o.list || e.isDefaultPrevented() || (e.altKey && e.keyCode == 40) || $.attr(this, 'list')){return;}
796
888
  var stepped = true;
797
889
  var code = e.keyCode;
798
890
  if (code == 38) {
@@ -915,7 +1007,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
915
1007
  return [options, datalist.data('label')];
916
1008
  },
917
1009
  list: function(val){
918
- if(this.type == 'number' || this.type == 'time'){
1010
+ if(this.type == 'number'){
919
1011
  this.element.attr('list', $.attr(this.orig, 'list'));
920
1012
  }
921
1013
  this.options.list = val;
@@ -998,7 +1090,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
998
1090
  if(!this.inputElements){
999
1091
  var create = splitInputs[this.type]._create(this.options);
1000
1092
  this.splits = create.splits;
1001
- this.inputElements = $(create.elements).prependTo(this.element).filter('input');
1093
+ this.inputElements = $(create.elements).prependTo(this.element).filter('input, select');
1002
1094
  }
1003
1095
  },
1004
1096
 
@@ -1024,11 +1116,11 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1024
1116
  reorderInputs: function(){
1025
1117
  if(splitInputs[this.type]){
1026
1118
  var element = this.element;
1027
- splitInputs[this.type].sort(element);
1119
+ splitInputs[this.type].sort(element, this.options);
1028
1120
  setTimeout(function(){
1029
1121
  var data = webshims.data(element);
1030
1122
  if(data && data.shadowData){
1031
- data.shadowData.shadowFocusElement = element.find('input')[0] || element[0];
1123
+ data.shadowData.shadowFocusElement = element.find('input, select')[0] || element[0];
1032
1124
  }
1033
1125
  }, 9);
1034
1126
  }
@@ -1131,8 +1223,21 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1131
1223
  options: options
1132
1224
  });
1133
1225
 
1226
+ webshims.inlinePopover = {
1227
+ _create: function(){
1228
+ this.element = $('<div class="ws-inline-picker"><div class="ws-po-box" /></div>').data('wspopover', this);
1229
+ this.contentElement = $('.ws-po-box', this.element);
1230
+ this.element.insertAfter(this.options.prepareFor);
1231
+ },
1232
+ show: $.noop,
1233
+ hide: $.noop,
1234
+ preventBlur: $.noop,
1235
+ isVisible: true
1236
+ };
1237
+
1134
1238
  picker._genericSetFocus = function(element, _noFocus){
1135
1239
  element = $(element || this.activeButton);
1240
+
1136
1241
  if(!this.popover.openedByFocus && !_noFocus){
1137
1242
  var that = this;
1138
1243
  var setFocus = function(noTrigger){
@@ -1157,12 +1262,14 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1157
1262
  data.setChange(val);
1158
1263
  },
1159
1264
  cancel: function(val, popover, data){
1160
- popover.stopOpen = true;
1161
- data.element.getShadowFocusElement().focus();
1162
- setTimeout(function(){
1163
- popover.stopOpen = false;
1164
- }, 9);
1165
- popover.hide();
1265
+ if(!data.options.inlinePicker){
1266
+ popover.stopOpen = true;
1267
+ data.element.getShadowFocusElement().focus();
1268
+ setTimeout(function(){
1269
+ popover.stopOpen = false;
1270
+ }, 9);
1271
+ popover.hide();
1272
+ }
1166
1273
  }
1167
1274
  };
1168
1275
 
@@ -1175,28 +1282,31 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1175
1282
  popover.element.on('updatepickercontent pickerchange', function(){
1176
1283
  tabbable = false;
1177
1284
  });
1178
- popover.contentElement.on({
1179
- keydown: function(e){
1180
- if(e.keyCode == 9){
1181
- if(!tabbable){
1182
- tabbable = $('input:not(:disabled), [tabindex="0"]:not(:disabled)', this).filter(':visible');
1183
- }
1184
- var index = tabbable.index(e.target);
1185
- if(e.shiftKey && index <= 0){
1186
- tabbable.last().focus();
1187
- return false;
1188
- }
1189
- if(!e.shiftKey && index >= tabbable.length - 1){
1190
- tabbable.first().focus();
1285
+
1286
+ if(!data.options.inlinePicker){
1287
+ popover.contentElement.on({
1288
+ keydown: function(e){
1289
+ if(e.keyCode == 9){
1290
+ if(!tabbable){
1291
+ tabbable = $('input:not(:disabled), [tabindex="0"]:not(:disabled)', this).filter(':visible');
1292
+ }
1293
+ var index = tabbable.index(e.target);
1294
+ if(e.shiftKey && index <= 0){
1295
+ tabbable.last().focus();
1296
+ return false;
1297
+ }
1298
+ if(!e.shiftKey && index >= tabbable.length - 1){
1299
+ tabbable.first().focus();
1300
+ return false;
1301
+ }
1302
+ } else if(e.keyCode == 27){
1303
+ data.element.getShadowFocusElement().focus();
1304
+ popover.hide();
1191
1305
  return false;
1192
1306
  }
1193
- } else if(e.keyCode == 27){
1194
- data.element.getShadowFocusElement().focus();
1195
- popover.hide();
1196
- return false;
1197
1307
  }
1198
- }
1199
- });
1308
+ });
1309
+ }
1200
1310
 
1201
1311
  data._propertyChange = (function(){
1202
1312
  var timer;
@@ -1206,7 +1316,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1206
1316
  }
1207
1317
  };
1208
1318
  return function(prop){
1209
- if(prop == 'value'){return;}
1319
+ if(prop == 'value' && !data.options.inlinePicker){return;}
1210
1320
  popover.isDirty = true;
1211
1321
  if(popover.isVisible){
1212
1322
  clearTimeout(timer);
@@ -1243,7 +1353,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1243
1353
 
1244
1354
  picker._common = function(data){
1245
1355
  var options = data.options;
1246
- var popover = webshims.objectCreate(webshims.wsPopover, {}, {prepareFor: data.element, position: options.widgetPosition});
1356
+ var popover = webshims.objectCreate(options.inlinePicker ? webshims.inlinePopover : webshims.wsPopover, {}, {prepareFor: options.inlinePicker ? data.buttonWrapper : data.element, position: options.widgetPosition});
1247
1357
  var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper);
1248
1358
 
1249
1359
 
@@ -1252,18 +1362,34 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1252
1362
  };
1253
1363
  var show = function(){
1254
1364
  var type = loadPicker(data.type, 'DOM');
1255
- if(!options.disabled && !options.readonly && !popover.isVisible){
1365
+ if(!options.disabled && !options.readonly && (options.inlinePicker || !popover.isVisible)){
1256
1366
  webshims.ready(type, showPickerContent);
1257
1367
  popover.show(data.element);
1258
1368
  }
1259
1369
  };
1370
+ var open = function(){
1371
+ if((options.inlinePicker || popover.isVisible) && popover.activeElement){
1372
+ popover.openedByFocus = false;
1373
+ popover.activeElement.focus();
1374
+ }
1375
+ show();
1376
+ };
1377
+
1260
1378
 
1261
1379
  options.containerElements.push(popover.element[0]);
1262
1380
 
1263
1381
  if(data.type != 'color'){
1382
+ if(options.yearButtons){
1383
+ options.startView = 2;
1384
+ }
1264
1385
  if(!options.startView){
1265
1386
  options.startView = 0;
1266
1387
  }
1388
+
1389
+ if(data.type == 'time'){
1390
+ options.minView = 3;
1391
+ options.startView = 3;
1392
+ }
1267
1393
  if(!options.minView){
1268
1394
  options.minView = 0;
1269
1395
  }
@@ -1293,6 +1419,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1293
1419
  if(popover.activeElement){
1294
1420
  popover.activeElement.removeClass('ws-focus');
1295
1421
  }
1422
+ if(options.inlinePicker){
1423
+ popover.openedByFocus = true;
1424
+ }
1296
1425
  }
1297
1426
  })
1298
1427
  ;
@@ -1308,57 +1437,63 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1308
1437
  opener.prop({disabled: true});
1309
1438
  }
1310
1439
 
1311
- opener
1312
- .on({
1313
- mousedown: function(){
1314
- stopPropagation.apply(this, arguments);
1315
- popover.preventBlur();
1316
- },
1317
- click: function(){
1318
- if(popover.isVisible && popover.activeElement){
1319
- popover.openedByFocus = false;
1320
- popover.activeElement.focus();
1321
- }
1322
- show();
1323
- },
1324
- focus: function(){
1325
- popover.preventBlur();
1326
- }
1327
- })
1328
- ;
1329
1440
 
1330
- (function(){
1331
- var mouseFocus = false;
1332
- var resetMouseFocus = function(){
1333
- mouseFocus = false;
1334
- };
1335
- data.inputElements.on({
1336
- focus: function(){
1337
- if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus))){
1338
- popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
1339
- show();
1340
- } else {
1441
+ opener.on({click: open});
1442
+
1443
+ if(options.inlinePicker){
1444
+ popover.openedByFocus = true;
1445
+ } else {
1446
+ opener
1447
+ .on({
1448
+ mousedown: function(){
1449
+ stopPropagation.apply(this, arguments);
1450
+ popover.preventBlur();
1451
+ },
1452
+ focus: function(){
1341
1453
  popover.preventBlur();
1342
1454
  }
1343
- },
1344
- mousedown: function(){
1345
- mouseFocus = true;
1346
- setTimeout(resetMouseFocus, 9);
1347
- if(options.buttonOnly && popover.isVisible && popover.activeElement){
1348
- popover.openedByFocus = false;
1349
- setTimeout(function(){
1455
+ })
1456
+ ;
1457
+
1458
+ (function(){
1459
+ var mouseFocus = false;
1460
+ var resetMouseFocus = function(){
1461
+ mouseFocus = false;
1462
+ };
1463
+ data.inputElements.on({
1464
+ keydown: function(e){
1465
+ if(e.keyCode == 40 && e.altKey){
1466
+ open();
1467
+ }
1468
+ },
1469
+ focus: function(){
1470
+ if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus))){
1471
+ popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
1472
+ show();
1473
+ } else {
1474
+ popover.preventBlur();
1475
+ }
1476
+ },
1477
+ mousedown: function(){
1478
+ mouseFocus = true;
1479
+ setTimeout(resetMouseFocus, 9);
1480
+ if(options.buttonOnly && popover.isVisible && popover.activeElement){
1350
1481
  popover.openedByFocus = false;
1351
- popover.activeElement.focus();
1352
- }, 4);
1353
- }
1354
- if(data.element.is(':focus')){
1355
- popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
1356
- show();
1482
+ setTimeout(function(){
1483
+ popover.openedByFocus = false;
1484
+ popover.activeElement.focus();
1485
+ }, 4);
1486
+ }
1487
+ if(data.element.is(':focus')){
1488
+ popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
1489
+ show();
1490
+ }
1491
+ popover.preventBlur();
1357
1492
  }
1358
- popover.preventBlur();
1359
- }
1360
- });
1361
- })();
1493
+ });
1494
+ })();
1495
+ }
1496
+
1362
1497
  data.popover = popover;
1363
1498
  data.opener = opener;
1364
1499
  $(data.orig).on('remove', function(e){
@@ -1369,12 +1504,16 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1369
1504
  }, 4);
1370
1505
  }
1371
1506
  });
1372
-
1507
+ if(options.inlinePicker){
1508
+ show();
1509
+ }
1373
1510
  loadPicker(data.type, 'WINDOWLOAD');
1374
1511
  };
1375
1512
 
1376
1513
  picker.month = picker._common;
1377
1514
  picker.date = picker._common;
1515
+ picker.time = picker._common;
1516
+ picker['datetime-local'] = picker._common;
1378
1517
  // picker.week = picker._common;
1379
1518
  picker.color = function(data){
1380
1519
  var ret = picker._common.apply(this, arguments);
@@ -1558,6 +1697,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1558
1697
  opts[optsName] = $.attr(this, copyAttrs[i]) || opts[optsName];
1559
1698
  }
1560
1699
  }
1700
+ if(opts.monthSelect){
1701
+ opts.onlyMonthDigits = true;
1702
+ }
1561
1703
  if(opts.onlyMonthDigits){
1562
1704
  opts.formatMonthNames = 'monthDigits';
1563
1705
  }
@@ -1663,11 +1805,14 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1663
1805
  });
1664
1806
  }
1665
1807
 
1666
- var isStupid = navigator.userAgent.indexOf('MSIE 10.0') != -1 && navigator.userAgent.indexOf('Touch') == -1;
1667
- ['number', 'time', 'month', 'date', 'color'].forEach(function(name){
1808
+ var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && (/MSIE 1[0|1]\.\d/.test(navigator.userAgent) || /Trident\/7\.0/.test(navigator.userAgent));
1809
+ ['number', 'time', 'month', 'date', 'color', 'datetime-local'].forEach(function(name){
1668
1810
  if(!modernizrInputTypes[name] || options.replaceUI || (name == 'number' && isStupid)){
1669
1811
  extendType(name, {
1670
1812
  _create: function(opts, set){
1813
+ if(opts.monthSelect){
1814
+ opts.splitInput = true;
1815
+ }
1671
1816
  if(opts.splitInput && !splitInputs[name]){
1672
1817
  webshims.warn('splitInput not supported for '+ name);
1673
1818
  opts.splitInput = false;