webshims-rails 1.11.1 → 1.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +8 -8
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/webshims/polyfiller.js +41 -20
  4. data/vendor/assets/javascripts/webshims/shims/combos/10.js +212 -42
  5. data/vendor/assets/javascripts/webshims/shims/combos/11.js +196 -37
  6. data/vendor/assets/javascripts/webshims/shims/combos/12.js +82 -36
  7. data/vendor/assets/javascripts/webshims/shims/combos/13.js +82 -36
  8. data/vendor/assets/javascripts/webshims/shims/combos/14.js +17 -6
  9. data/vendor/assets/javascripts/webshims/shims/combos/15.js +234 -1247
  10. data/vendor/assets/javascripts/webshims/shims/combos/16.js +234 -1247
  11. data/vendor/assets/javascripts/webshims/shims/combos/17.js +202 -45
  12. data/vendor/assets/javascripts/webshims/shims/combos/18.js +202 -45
  13. data/vendor/assets/javascripts/webshims/shims/combos/19.js +16 -5
  14. data/vendor/assets/javascripts/webshims/shims/combos/2.js +51 -11
  15. data/vendor/assets/javascripts/webshims/shims/combos/20.js +16 -5
  16. data/vendor/assets/javascripts/webshims/shims/combos/21.js +82 -36
  17. data/vendor/assets/javascripts/webshims/shims/combos/22.js +82 -36
  18. data/vendor/assets/javascripts/webshims/shims/combos/24.js +1689 -997
  19. data/vendor/assets/javascripts/webshims/shims/combos/25.js +16 -5
  20. data/vendor/assets/javascripts/webshims/shims/combos/26.js +16 -5
  21. data/vendor/assets/javascripts/webshims/shims/combos/3.js +16 -5
  22. data/vendor/assets/javascripts/webshims/shims/combos/30.js +51 -11
  23. data/vendor/assets/javascripts/webshims/shims/combos/31.js +51 -11
  24. data/vendor/assets/javascripts/webshims/shims/combos/4.js +16 -5
  25. data/vendor/assets/javascripts/webshims/shims/combos/5.js +202 -45
  26. data/vendor/assets/javascripts/webshims/shims/combos/6.js +237 -51
  27. data/vendor/assets/javascripts/webshims/shims/combos/7.js +51 -11
  28. data/vendor/assets/javascripts/webshims/shims/combos/8.js +16 -5
  29. data/vendor/assets/javascripts/webshims/shims/combos/9.js +247 -48
  30. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +17 -5
  31. data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +21 -3
  32. data/vendor/assets/javascripts/webshims/shims/form-datalist.js +35 -6
  33. data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +6 -8
  34. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +134 -24
  35. data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +152 -1205
  36. data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +1076 -0
  37. data/vendor/assets/javascripts/webshims/shims/form-validation.js +47 -20
  38. data/vendor/assets/javascripts/webshims/shims/form-validators.js +2 -2
  39. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +1 -1
  40. data/vendor/assets/javascripts/webshims/shims/i18n/{formcfg-de.txt → formcfg-de.js} +3 -0
  41. data/vendor/assets/javascripts/webshims/shims/i18n/{formcfg-en.txt → formcfg-en.js} +5 -1
  42. data/vendor/assets/javascripts/webshims/shims/json-storage.js +1 -1
  43. data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +1 -1
  44. data/vendor/assets/javascripts/webshims/shims/range-ui.js +62 -13
  45. data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +610 -0
  46. data/vendor/assets/javascripts/webshims/shims/styles/scss/_extends.scss +10 -0
  47. data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +743 -0
  48. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +1 -755
  49. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +0 -606
  50. data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
  51. data/vendor/assets/javascripts/webshims/shims/track-ui.js +36 -23
  52. data/vendor/assets/javascripts/webshims/shims/track.js +82 -36
  53. metadata +8 -6
  54. data/vendor/assets/javascripts/webshims/shims/combos/28.js +0 -2196
  55. data/vendor/assets/javascripts/webshims/shims/combos/29.js +0 -1167
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDQzM2Q1ZDU3NDMyYzk3MTQ4ZTk5ZWU2MTE5MDczMTM4NTY2YTA1MQ==
4
+ NjVkNmUzNDI2Nzc2YzQ2YzEyZmU2OGU4YzNkMDhkODVkYjRiZDgzZQ==
5
5
  data.tar.gz: !binary |-
6
- ZmMyMTI4YzI3ZmE0NWRmZDczZjVjMTdlMTVlZGI2OWU3ODY4ZTI5MQ==
6
+ NWRiNWEzN2FlYTVlOWFmNGEwNzI3NzNkMTk3MWYyMzZkZGMxNDJmNQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTZkYjFjZjU3NmIzNDc3MDdhMGM0ZTQ0OGE1NTNhOWM3ZTAxYTU0Y2I2OTcx
10
- YjVmMmJlZTg3ZTUwYTRjYjkyYTdhNTRkMjU4MzRjZjllMGYwZjNhMzZkZjM0
11
- YjAzOTkyMjRkYWRlNDVlNGM1Y2Q3MTliNDE2ZWE1NTEzNTBmNTI=
9
+ ODdjNWY5MWQ2ZGI3NmQ5OTZjYzUzZGQ0ZmMwMzE3ZjE2MmU4MWYwN2E0OGM4
10
+ ZDllYWE5YWI5ZTNmYzY1YzI4ZjBkZDFmMjI0ZWE5MjU2NGNhY2Q2MTI0YTYx
11
+ MzU0MTlhZWE1YTM3NmI4M2UwOTgwOTAyOTg1OGQwMDFhNzg2MjU=
12
12
  data.tar.gz: !binary |-
13
- MjNjN2U5ZGY1OTI4ZWIxZGVlMmM0M2EzNTdkNzdmNDE5ZWE3MWFmOGUxZjVi
14
- Nzk1ZDcwMGJiN2Y2Yjk2NGVkN2I4ZTExZjI2ZjNhNmJhZjlkZWFmZDg4NDk0
15
- ZGZhZWFkNzM0ODFhN2UwZWE1Y2ZlZmY4NjMyYjU2OThlNDM1Zjk=
13
+ YmExN2NjMmFjNTFlNzVkMDgxMWJhNGZmZjg0ZTNiY2QxYjA1ZTJhY2M3NjQx
14
+ MjIyODI4YTEyMzM3M2QxYjJiZjJkNGE5MDkwZDFhMWFhY2QyMDNhYzQ1ODdm
15
+ MTVlZGQ1MTc1OTMxODdlYWJlZGVkYzU5MWFhZDg2ZmUxZDgzYTA=
@@ -1,6 +1,6 @@
1
1
  module Webshims
2
2
  module Rails
3
- VERSION = "1.11.1"
4
- WEBSHIMS_VERSION = "1.11.1"
3
+ VERSION = "1.11.2"
4
+ WEBSHIMS_VERSION = "1.11.2"
5
5
  end
6
6
  end
@@ -27,7 +27,7 @@
27
27
 
28
28
 
29
29
  var webshims = {
30
- version: '1.11.1',
30
+ version: '1.11.2',
31
31
  cfg: {
32
32
 
33
33
  //addCacheBuster: false,
@@ -35,7 +35,7 @@
35
35
  // extendNative: false,
36
36
  loadStyles: true,
37
37
  disableShivMethods: true,
38
- wspopover: {appendTo: 'body', hideOnBlur: true},
38
+ wspopover: {appendTo: 'auto', hideOnBlur: true},
39
39
  basePath: (function(){
40
40
  var script = jScripts.filter('[src*="polyfiller.js"]');
41
41
  var path;
@@ -841,7 +841,7 @@
841
841
  f: DOMSUPPORT,
842
842
  noAutoCallback: true,
843
843
  d: ['es5'],
844
- c: [16, 7, 2, 15, 30, 3, 8, 4, 9, 10, 14, 25, 19, 20, 26, 28, 31]
844
+ c: [16, 7, 2, 15, 30, 3, 8, 4, 9, 10, 14, 25, 19, 20, 26, 31]
845
845
  });
846
846
 
847
847
 
@@ -938,11 +938,12 @@
938
938
  var modernizrInputTypes = Modernizr.inputtypes;
939
939
  var formvalidation = 'formvalidation';
940
940
  var fNuAPI = 'form-number-date-api';
941
- var select = $('<select required="" name="a"><option disabled="" /></select>')[0];
941
+ var select = $('<select required=""><option disabled="" /></select>')[0];
942
942
  var bustedValidity = false;
943
943
  var bustedWidgetUi = false;
944
944
 
945
945
  var initialFormTest = function(){
946
+ var range, rangeCSS;
946
947
  if(!initialFormTest.run){
947
948
  addTest(formvalidation, function(){
948
949
  return !!(modernizrInputAttrs.required && modernizrInputAttrs.pattern);
@@ -953,15 +954,25 @@
953
954
  return 'elements' in fieldset && 'disabled' in fieldset;
954
955
  });
955
956
 
956
- if(modernizrInputTypes){
957
+ if(modernizrInputTypes && modernizrInputTypes.range && !window.opera){
958
+ range = $('<input type="range" style="-webkit-appearance: slider-horizontal; -moz-appearance: range;" />').appendTo('html');
959
+ rangeCSS = range.css('appearance');
960
+ range.remove();
961
+
962
+ addTest('csstrackrange', function(){
963
+ return rangeCSS == null || rangeCSS == 'range';
964
+ });
965
+ addTest('cssrangeinput', function(){
966
+ return rangeCSS == 'slider-horizontal' || rangeCSS == 'range';
967
+ });
957
968
  addTest('styleableinputrange', function(){
958
- return modernizrInputTypes.range && !window.opera;
969
+ return Modernizr.csstrackrange || Modernizr.cssrangeinput;
959
970
  });
960
971
  }
961
972
 
962
973
  if(Modernizr[formvalidation]){
963
- bustedWidgetUi = window.opera || Modernizr.formattribute === false || !Modernizr.fieldsetdisabled || !('value' in document.createElement('progress')) || !('value' in document.createElement('output')) || !($('<input type="date" value="1488-12-11" />')[0].validity || {valid: true}).valid || !('required' in select) || (select.validity || {}).valid;
964
- bugs.bustedValidity = bustedValidity = bustedWidgetUi || !modernizrInputAttrs.list;
974
+ bustedWidgetUi = !Modernizr.fieldsetdisabled || !('value' in document.createElement('progress')) || !('value' in document.createElement('output')) || !('required' in select) || (select.validity || {}).valid;
975
+ bugs.bustedValidity = bustedValidity = window.opera || bustedWidgetUi || !modernizrInputAttrs.list;
965
976
  }
966
977
 
967
978
  formExtend = Modernizr[formvalidation] && !bustedValidity ? 'form-native-extend' : fShim;
@@ -999,7 +1010,7 @@
999
1010
  // ,fieldWrapper: undefined
1000
1011
  // ,fx: 'slide'
1001
1012
  },
1002
- availabeLangs: ['ar', 'ch-ZN', 'el', 'es', 'fr', 'he', 'hi', 'hu', 'it', 'ja', 'lt', 'nl', 'pl', 'pt-PT', 'ru', 'sv'] //en and de are directly implemented in core
1013
+ availableLangs: ['ar', 'ch-ZN', 'el', 'es', 'fr', 'he', 'hi', 'hu', 'it', 'ja', 'lt', 'nl', 'pl', 'pt-PT', 'ru', 'sv'] //en and de are directly implemented in core
1003
1014
  // ,customMessages: false,
1004
1015
  // overridePlaceholder: false, // might be good for IE10
1005
1016
  // replaceValidationUI: false
@@ -1026,7 +1037,16 @@
1026
1037
  return Modernizr[formvalidation] && !bustedValidity;
1027
1038
  },
1028
1039
  d: ['form-core', DOMSUPPORT],
1029
- c: [16, 15]
1040
+ c: [16, 15, 24]
1041
+ });
1042
+
1043
+ addPolyfill(fShim+'2', {
1044
+ f: 'forms',
1045
+ test: function(){
1046
+ return Modernizr[formvalidation] && !bustedWidgetUi;
1047
+ },
1048
+ d: [fShim],
1049
+ c: [24]
1030
1050
  });
1031
1051
 
1032
1052
  addPolyfill('form-message', {
@@ -1040,8 +1060,7 @@
1040
1060
 
1041
1061
  formExtras = {
1042
1062
  noAutoCallback: true,
1043
- options: formOptions,
1044
- c: [24]
1063
+ options: formOptions
1045
1064
  };
1046
1065
  addModule('form-validation', $.extend({d: ['form-message', 'form-core']}, formExtras));
1047
1066
 
@@ -1090,13 +1109,14 @@
1090
1109
  test: function(){
1091
1110
  var o = this.options;
1092
1111
  initialFormTest();
1093
- //input widgets on old on old androids can't be trusted
1112
+ //input widgets on old androids can't be trusted
1094
1113
  if(bustedWidgetUi && !o.replaceUI && (/Android/i).test(navigator.userAgent)){
1095
1114
  o.replaceUI = true;
1096
1115
  }
1097
1116
  return !o.replaceUI && modules[fNuAPI].test();
1098
1117
  },
1099
1118
  d: ['forms', DOMSUPPORT, fNuAPI, 'range-ui'],
1119
+ css: 'styles/forms-ext.css',
1100
1120
  options: {
1101
1121
 
1102
1122
  widgets: {
@@ -1121,12 +1141,14 @@
1121
1141
  })();
1122
1142
  //>
1123
1143
 
1144
+ //<filereader
1124
1145
  addPolyfill('filereader', {
1125
1146
  test: 'FileReader' in window,
1126
1147
  d: ['swfmini', DOMSUPPORT],
1127
1148
  c: [25, 26, 27]
1128
1149
  // ,nM: 'filereader'
1129
1150
  });
1151
+ //>
1130
1152
 
1131
1153
  //<details
1132
1154
  if(!('details' in Modernizr)){
@@ -1179,12 +1201,12 @@
1179
1201
  if(options.preferFlash && !modules.swfmini.test()){
1180
1202
  options.preferFlash = false;
1181
1203
  }
1182
- return !( options.preferFlash && window.swfmini.hasFlashPlayerVersion('9.0.115') );
1204
+ return !( options.preferFlash && swfmini.hasFlashPlayerVersion('9.0.115') );
1183
1205
  },
1184
- c: [21, 19, 25, 20, 28]
1206
+ c: [21, 19, 25, 20]
1185
1207
  });
1186
1208
 
1187
- bugs.track = (Modernizr.track && (!Modernizr.texttrackapi || typeof (document.createElement('track').track || {}).mode != 'string'));
1209
+ bugs.track = !Modernizr.texttrackapi;
1188
1210
 
1189
1211
  addPolyfill('track', {
1190
1212
  options: {
@@ -1192,18 +1214,17 @@
1192
1214
  override: bugs.track
1193
1215
  },
1194
1216
  test: function(){
1195
- return Modernizr.track && !this.options.override && !bugs.track;
1217
+ return !this.options.override && !bugs.track;
1196
1218
  },
1197
1219
  d: ['mediaelement', DOMSUPPORT],
1198
1220
  methodNames: ['addTextTrack'],
1199
- c: [21, 12, 13, 22, 29],
1221
+ c: [21, 12, 13, 22],
1200
1222
  nM: 'texttrackapi'
1201
1223
  });
1202
1224
 
1203
1225
 
1204
1226
  addModule('track-ui', {
1205
- d: ['track', DOMSUPPORT],
1206
- c: [29]
1227
+ d: ['track', DOMSUPPORT]
1207
1228
  });
1208
1229
 
1209
1230
  })();
@@ -6,7 +6,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
6
6
  webshims.assumeARIA = supportGetSetAttribute || Modernizr.canvas || Modernizr.video || Modernizr.boxsizing;
7
7
 
8
8
  if($('<input type="email" />').attr('type') == 'text' || $('<form />').attr('novalidate') === "" || ('required' in $('<input />')[0].attributes)){
9
- webshims.error("IE browser modes are busted in IE10. Please test your HTML/CSS/JS with a real IE version or at least IETester or similiar tools");
9
+ webshims.error("IE browser modes are busted in IE10+. Please test your HTML/CSS/JS with a real IE version or at least IETester or similiar tools");
10
10
  }
11
11
 
12
12
  if(!$.parseHTML){
@@ -559,7 +559,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
559
559
  $(this.test);
560
560
  webshims.ready('WINDOWLOAD', this.test);
561
561
  $(document).on('updatelayout', this.handler);
562
- $(window).bind('resize', this.handler);
562
+ $(window).on('resize', this.handler);
563
563
  (function(){
564
564
  var oldAnimate = $.fn.animate;
565
565
  var animationTimer;
@@ -581,6 +581,13 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
581
581
  webshims.docObserve = function(){
582
582
  webshims.ready('DOM', function(){
583
583
  docObserve.start();
584
+ if($.support.boxSizing == null){
585
+ $(function(){
586
+ if($.support.boxSizing){
587
+ docObserve.handler({type: 'boxsizing'});
588
+ }
589
+ });
590
+ }
584
591
  });
585
592
  };
586
593
  return function(nativeElem, shadowElem, opts){
@@ -741,7 +748,12 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
741
748
  havePolyfill[prop] = true;
742
749
 
743
750
  if(descs.reflect){
744
- webshims.propTypes[descs.propType || 'standard'](descs, prop);
751
+ if(descs.propType && !webshims.propTypes[descs.propType]){
752
+ webshims.error('could not finde propType '+ descs.propType);
753
+ } else {
754
+ webshims.propTypes[descs.propType || 'standard'](descs, prop);
755
+ }
756
+
745
757
  }
746
758
 
747
759
  ['prop', 'attr', 'removeAttr'].forEach(function(type){
@@ -927,7 +939,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
927
939
  var notLocal = /:\/\/|^\.*\//;
928
940
  var loadRemoteLang = function(data, lang, options){
929
941
  var langSrc;
930
- if(lang && options && $.inArray(lang, options.availabeLangs || []) !== -1){
942
+ if(lang && options && $.inArray(lang, options.availableLangs || options.availabeLangs || []) !== -1){
931
943
  data.loading = true;
932
944
  langSrc = options.langSrc;
933
945
  if(!notLocal.test(langSrc)){
@@ -1087,7 +1099,6 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1087
1099
  });
1088
1100
 
1089
1101
  })(webshims.$, document);
1090
-
1091
1102
  (function($){
1092
1103
 
1093
1104
  var id = 0;
@@ -1106,9 +1117,9 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1106
1117
  var i;
1107
1118
 
1108
1119
 
1109
- this.element.addClass('ws-range').attr({role: 'slider'}).append('<span class="ws-range-min" /><span class="ws-range-rail"><span class="ws-range-thumb" /></span>');
1110
- this.trail = $('.ws-range-rail', this.element);
1111
- this.range = $('.ws-range-min', this.element);
1120
+ 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>');
1121
+ this.trail = $('.ws-range-track', this.element);
1122
+ this.range = $('.ws-range-progress ', this.element);
1112
1123
  this.thumb = $('.ws-range-thumb', this.trail);
1113
1124
 
1114
1125
  this.updateMetrics();
@@ -1118,6 +1129,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1118
1129
  for(i = 0; i < createOpts.length; i++){
1119
1130
  this[createOpts[i]](this.options[createOpts[i]]);
1120
1131
  }
1132
+
1121
1133
  this.value = this._value;
1122
1134
  this.value(this.options.value);
1123
1135
  this.initDataList();
@@ -1356,7 +1368,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1356
1368
  }
1357
1369
  },
1358
1370
  addBindings: function(){
1359
- var leftOffset, widgetUnits, hasFocus;
1371
+ var leftOffset, widgetUnits, hasFocus, isActive;
1360
1372
  var that = this;
1361
1373
  var o = this.options;
1362
1374
 
@@ -1386,8 +1398,28 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1386
1398
  }
1387
1399
  };
1388
1400
  })();
1389
-
1401
+ var normalizeTouch = (function(){
1402
+ var types = {
1403
+ touchstart: 1,
1404
+ touchend: 1,
1405
+ touchmove: 1
1406
+ };
1407
+ var normalize = ['pageX', 'pageY'];
1408
+ return function(e){
1409
+ if(types[e.type] && e.originalEvent && e.originalEvent.touches && e.originalEvent.touches.length){
1410
+ for(var i = 0; i < normalize.length; i++){
1411
+ e[normalize[i]] = e.originalEvent.touches[0][normalize[i]];
1412
+ }
1413
+
1414
+ }
1415
+ return e;
1416
+ };
1417
+ })();
1390
1418
  var setValueFromPos = function(e, animate){
1419
+ if(e.type == 'touchmove'){
1420
+ e.preventDefault();
1421
+ normalizeTouch(e);
1422
+ }
1391
1423
 
1392
1424
  var val = that.getStepedValueFromPos((e[that.dirs.mouse] - leftOffset) * widgetUnits);
1393
1425
  if(val != o.value){
@@ -1404,18 +1436,25 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1404
1436
  eventTimer.call('change', o.value);
1405
1437
  }
1406
1438
  that.addRemoveClass('ws-active');
1407
- $(document).off('mousemove', setValueFromPos).off('mouseup', remove);
1439
+ $(document).off('mousemove touchmove', setValueFromPos).off('mouseup touchend', remove);
1408
1440
  $(window).off('blur', removeWin);
1441
+ isActive = false;
1409
1442
  };
1410
1443
  var removeWin = function(e){
1411
1444
  if(e.target == window){remove();}
1412
1445
  };
1413
1446
  var add = function(e){
1414
1447
  var outerWidth;
1448
+
1449
+ if(isActive || (e.type == 'touchstart' && (!e.originalEvent || !e.originalEvent.touches || e.originalEvent.touches.length != 1))){
1450
+ return;
1451
+ }
1415
1452
  e.preventDefault();
1416
- $(document).off('mousemove', setValueFromPos).off('mouseup', remove);
1453
+
1454
+ $(document).off('mousemove touchmove', setValueFromPos).off('mouseup touchend', remove);
1417
1455
  $(window).off('blur', removeWin);
1418
1456
  if(!o.readonly && !o.disabled){
1457
+ normalizeTouch(e);
1419
1458
  that.element.focus();
1420
1459
  that.addRemoveClass('ws-active', true);
1421
1460
  leftOffset = that.element.focus().offset();
@@ -1425,20 +1464,27 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1425
1464
  leftOffset = leftOffset[that.dirs.pos];
1426
1465
  widgetUnits = 100 / widgetUnits;
1427
1466
  setValueFromPos(e, o.animate);
1467
+ isActive = true;
1428
1468
  $(document)
1429
- .on({
1430
- mouseup: remove,
1431
- mousemove: setValueFromPos
1432
- })
1469
+ .on(e.type == 'touchstart' ?
1470
+ {
1471
+ touchend: remove,
1472
+ touchmove: setValueFromPos
1473
+ } :
1474
+ {
1475
+ mouseup: remove,
1476
+ mousemove: setValueFromPos
1477
+ }
1478
+ )
1433
1479
  ;
1434
1480
  $(window).on('blur', removeWin);
1435
1481
  e.stopPropagation();
1436
1482
  }
1437
1483
  };
1438
1484
  var elementEvts = {
1439
- mousedown: add,
1485
+ 'touchstart mousedown': add,
1440
1486
  focus: function(e){
1441
- if(!o.disabled){
1487
+ if(!o.disabled && !hasFocus){
1442
1488
  eventTimer.init('input', o.value);
1443
1489
  eventTimer.init('change', o.value);
1444
1490
  that.addRemoveClass('ws-focus', true);
@@ -1501,6 +1547,20 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1501
1547
  this.thumb.on({
1502
1548
  mousedown: add
1503
1549
  });
1550
+
1551
+ if(this.orig){
1552
+ $(this.orig).jProp('form').on('reset', function(){
1553
+ var val = $.prop(that.orig, 'value');
1554
+ that.value(val);
1555
+ setTimeout(function(){
1556
+ var val2 = $.prop(that.orig, 'value');
1557
+ if(val != val2){
1558
+ that.value(val2);
1559
+ }
1560
+ }, 4);
1561
+ });
1562
+ }
1563
+
1504
1564
  if (window.webshims) {
1505
1565
  webshims.ready('WINDOWLOAD', function(){
1506
1566
  webshims.ready('dom-support', function(){
@@ -1606,8 +1666,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1606
1666
  var str;
1607
1667
  return function(){
1608
1668
  if(!str){
1609
- str = ('<option></option>')+$.map(monthDigits, function(val){
1610
- return '<option>'+val+'</option>';
1669
+ str = ('<option value=""></option>')+$.map(monthDigits, function(val){
1670
+ return '<option value="'+val+'"]>'+val+'</option>';
1611
1671
  }).join('');
1612
1672
  }
1613
1673
  return str;
@@ -1629,7 +1689,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1629
1689
  splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" />')[0]]
1630
1690
  };
1631
1691
  if(opts.monthSelect){
1632
- obj.splits.push($('<select class="mm">'+getMonthOptions()+'</select>')[0]);
1692
+ obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
1633
1693
  } else {
1634
1694
  obj.splits.push($('<input type="text" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0]);
1635
1695
  }
@@ -1664,7 +1724,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1664
1724
  splits: [$('<input type="text" class="yy" inputmode="numeric" size="4" />')[0]]
1665
1725
  };
1666
1726
  if(opts.monthSelect){
1667
- obj.splits.push($('<select class="mm ws-spin">'+getMonthOptions()+'</select>')[0]);
1727
+ obj.splits.push($('<select class="mm ws-spin">'+getMonthOptions(opts)+'</select>')[0]);
1668
1728
  } else {
1669
1729
  obj.splits.push($('<input type="text" class="mm ws-spin" />')[0]);
1670
1730
  if(opts.onlyMonthDigits){
@@ -1756,6 +1816,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1756
1816
  month: {
1757
1817
  currentText: 'Aktueller Monat'
1758
1818
  },
1819
+ time: {
1820
+ currentText: 'Jetzt'
1821
+ },
1759
1822
  date: {
1760
1823
  close: 'schließen',
1761
1824
  clear: 'Löschen',
@@ -1793,6 +1856,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1793
1856
  month: {
1794
1857
  currentText: 'This month'
1795
1858
  },
1859
+ time: {
1860
+ "currentText": "Now"
1861
+ },
1796
1862
  date: {
1797
1863
  "closeText": "Done",
1798
1864
  clear: 'Clear',
@@ -1855,6 +1921,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1855
1921
  if(!langCfg['datetime-localSigns']){
1856
1922
  langCfg['datetime-localSigns'] = langCfg.dateSigns+langCfg.timeSigns;
1857
1923
  }
1924
+ if(!langCfg['datetime-local']){
1925
+ langCfg['datetime-local'] = {};
1926
+ }
1927
+ if(!langCfg['datetime-local'].currentText && langCfg.time.currentText){
1928
+ langCfg['datetime-local'].currentText = langCfg.time.currentText;
1929
+ }
1858
1930
  };
1859
1931
  var triggerLocaleChange = function(){
1860
1932
  processLangCFG(curCfg);
@@ -1922,6 +1994,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1922
1994
  } else {
1923
1995
  fVal = 0;
1924
1996
  }
1997
+ if(val[0] === '00'){
1998
+ val[0] = '12';
1999
+ }
1925
2000
  val = $.trim(val.join(':')) + ' '+ curCfg.meridian[fVal];
1926
2001
  }
1927
2002
  return val;
@@ -2006,6 +2081,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2006
2081
  time: function(val){
2007
2082
  var fVal;
2008
2083
  if(val && curCfg.meridian){
2084
+ if(val.substr(0,2) === "12"){
2085
+ val = "00" + val.substr(2);
2086
+ }
2009
2087
  if(val.indexOf(curCfg.meridian[1]) != -1){
2010
2088
  val = val.split(':');
2011
2089
  fVal = (val[0] * 1);
@@ -2091,7 +2169,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2091
2169
  if(hintValue.length == 2){
2092
2170
  hintValue = opts.splitInput ?
2093
2171
  hintValue :
2094
- curCfg.patterns.d.replace('yy', hintValue[0]).replace('mm', hintValue[1]);
2172
+ curCfg.date.showMonthAfterYear ?
2173
+ hintValue[0] +' '+hintValue[1] :
2174
+
2175
+ hintValue[1] +' '+ hintValue[0];
2095
2176
  } else {
2096
2177
  hintValue = opts.splitInput ?
2097
2178
  [val, val] :
@@ -2466,10 +2547,18 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2466
2547
  }
2467
2548
  try {
2468
2549
  that.elemHelper[name](factor);
2550
+
2469
2551
  ret = that.elemHelper.prop('value');
2552
+
2553
+ } catch (er) {
2554
+ if(!o.value && that.maxAsNumber >= that.minAsNumber){
2555
+ ret = o.defValue;
2556
+ }
2557
+ }
2558
+ if(ret !== false && o.value != ret){
2470
2559
  that.value(ret);
2471
2560
  eventTimer.call('input', ret);
2472
- } catch (er) {}
2561
+ }
2473
2562
  return ret;
2474
2563
  }
2475
2564
  };
@@ -2535,15 +2624,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2535
2624
 
2536
2625
  initChangeEvents();
2537
2626
  },
2538
- value: function(val, force){
2539
- if(!this._init || force || val !== this.options.value){
2540
- this.element.val(this.formatValue(val));
2541
- this.options.value = val;
2542
- this._propertyChange('value');
2543
- this.mirrorValidity();
2544
- }
2545
-
2546
- },
2547
2627
  required: function(val, boolVal){
2548
2628
  this.inputElements.attr({'aria-required': ''+boolVal});
2549
2629
  this.mirrorValidity();
@@ -2560,7 +2640,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2560
2640
  formatValue: function(val, noSplit){
2561
2641
  return formatVal[this.type](val, noSplit === false ? false : this.options);
2562
2642
  },
2563
- createOpts: ['readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'value', 'required'],
2643
+ createOpts: ['readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'defaultValue', 'value', 'required'],
2564
2644
  placeholder: function(val){
2565
2645
  var options = this.options;
2566
2646
  options.placeholder = val;
@@ -2630,6 +2710,16 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2630
2710
  }
2631
2711
  };
2632
2712
 
2713
+ ['defaultValue', 'value'].forEach(function(name){
2714
+ wsWidgetProto[name] = function(val, force){
2715
+ if(!this._init || force || val !== this.options[name]){
2716
+ this.element.prop(name, this.formatValue(val));
2717
+ this.options[name] = val;
2718
+ this._propertyChange(name);
2719
+ this.mirrorValidity();
2720
+ }
2721
+ };
2722
+ });
2633
2723
 
2634
2724
  ['readonly', 'disabled'].forEach(function(name){
2635
2725
  var isDisabled = name == 'disabled';
@@ -2683,7 +2773,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2683
2773
  }
2684
2774
  this._init = true;
2685
2775
  },
2686
- createOpts: ['step', 'min', 'max', 'readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'value', 'required'],
2776
+ createOpts: ['step', 'min', 'max', 'readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'defaultValue', 'value', 'required'],
2687
2777
  _addSplitInputs: function(){
2688
2778
  if(!this.inputElements){
2689
2779
  var create = splitInputs[this.type]._create(this.options);
@@ -2753,9 +2843,47 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2753
2843
  this.options.step = val;
2754
2844
  this.elemHelper.prop('step', retDefault(val, defStep.step));
2755
2845
  this.mirrorValidity();
2846
+ },
2847
+ _beforeValue: function(val){
2848
+ this.valueAsNumber = this.asNumber(val);
2849
+ this.options.value = val;
2850
+
2851
+ if(isNaN(this.valueAsNumber) || (!isNaN(this.minAsNumber) && this.valueAsNumber < this.minAsNumber) || (!isNaN(this.maxAsNumber) && this.valueAsNumber > this.maxAsNumber)){
2852
+ this._setStartInRange();
2853
+ } else {
2854
+ this.elemHelper.prop('value', val);
2855
+ this.options.defValue = "";
2856
+ }
2756
2857
  }
2757
2858
  });
2758
2859
 
2860
+ ['defaultValue', 'value'].forEach(function(name){
2861
+ var isValue = name == 'value';
2862
+ spinBtnProto[name] = function(val, force){
2863
+ if(!this._init || force || this.options[name] !== val){
2864
+ if(isValue){
2865
+ this._beforeValue(val);
2866
+ }
2867
+
2868
+ val = formatVal[this.type](val, this.options);
2869
+ if(this.options.splitInput){
2870
+ $.each(this.splits, function(i, elem){
2871
+ var setOption;
2872
+ if(!(name in elem) && !isValue && $.nodeName(elem, 'select')){
2873
+ $('option[value="'+ val[i] +'"]', elem).prop('defaultSelected', true);
2874
+ } else {
2875
+ $.prop(elem, name, val[i]);
2876
+ }
2877
+ });
2878
+ } else {
2879
+ this.element.prop(name, val);
2880
+ }
2881
+ this._propertyChange(name);
2882
+ this.mirrorValidity();
2883
+ }
2884
+ };
2885
+ });
2886
+
2759
2887
  $.each({min: 1, max: -1}, function(name, factor){
2760
2888
  var numName = name +'AsNumber';
2761
2889
  spinBtnProto[name] = function(val){
@@ -3159,10 +3287,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3159
3287
  var inputTypes = {
3160
3288
 
3161
3289
  };
3290
+ var boolAttrs = {disabled: 1, required: 1, readonly: 1};
3162
3291
  var copyProps = [
3163
3292
  'disabled',
3164
3293
  'readonly',
3165
3294
  'value',
3295
+ 'defaultValue',
3166
3296
  'min',
3167
3297
  'max',
3168
3298
  'step',
@@ -3180,14 +3310,18 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3180
3310
  if(!stopCircular){
3181
3311
  var shadowData = webshims.data(this, 'shadowData');
3182
3312
  if(shadowData && shadowData.data && shadowData.nativeElement === this && shadowData.data[fnName]){
3183
- shadowData.data[fnName](val, boolVal);
3313
+ if(boolAttrs[fnName]){
3314
+ shadowData.data[fnName](val, boolVal);
3315
+ } else {
3316
+ shadowData.data[fnName](val);
3317
+ }
3184
3318
  }
3185
3319
  }
3186
3320
  });
3187
3321
  });
3188
3322
 
3189
3323
  if(options.replaceUI && 'valueAsNumber' in document.createElement('input')){
3190
- var reflectFn = function(val){
3324
+ var reflectFn = function(){
3191
3325
  if(webshims.data(this, 'hasShadow')){
3192
3326
  $.prop(this, 'value', $.prop(this, 'value'));
3193
3327
  }
@@ -3195,6 +3329,20 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3195
3329
 
3196
3330
  webshims.onNodeNamesPropertyModify('input', 'valueAsNumber', reflectFn);
3197
3331
  webshims.onNodeNamesPropertyModify('input', 'valueAsDate', reflectFn);
3332
+ $.each({stepUp: 1, stepDown: -1}, function(name, stepFactor){
3333
+ var stepDescriptor = webshims.defineNodeNameProperty('input', name, {
3334
+ prop: {
3335
+ value: function(){
3336
+ var ret;
3337
+ if(stepDescriptor.prop && stepDescriptor.prop._supvalue){
3338
+ ret = stepDescriptor.prop._supvalue.apply(this, arguments);
3339
+ reflectFn.apply(this, arguments);
3340
+ }
3341
+ return ret;
3342
+ }
3343
+ }
3344
+ });
3345
+ });
3198
3346
  }
3199
3347
 
3200
3348
  var extendType = (function(){
@@ -3214,7 +3362,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3214
3362
  $(data.orig).removeClass('ws-important-hide');
3215
3363
  $.style( data.orig, 'display', '' );
3216
3364
  var hasButtons, marginR, marginL;
3217
- var correctWidth = 0.6;
3365
+ var correctWidth = 0.8;
3218
3366
  if(!init || data.orig.offsetWidth){
3219
3367
  hasButtons = data.buttonWrapper && data.buttonWrapper.filter(isVisible).length;
3220
3368
  marginR = $.css( data.orig, 'marginRight');
@@ -3238,7 +3386,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3238
3386
  ;
3239
3387
  } else {
3240
3388
  data.buttonWrapper.css('marginRight', marginR);
3241
- correctWidth = data.buttonWrapper.outerWidth(true) + 0.6;
3389
+ correctWidth = data.buttonWrapper.outerWidth(true) + correctWidth;
3242
3390
  }
3243
3391
  }
3244
3392
 
@@ -3396,7 +3544,29 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3396
3544
  });
3397
3545
  }
3398
3546
 
3399
- if(!modernizrInputTypes.range || options.replaceUI){
3547
+ var replace = {};
3548
+
3549
+
3550
+ if(options.replaceUI){
3551
+ if( $.isPlainObject(options.replaceUI) ){
3552
+ $.extend(replace, options.replaceUI);
3553
+ } else {
3554
+ $.extend(replace, {
3555
+ 'range': 1,
3556
+ 'number': 1,
3557
+ 'time': 1,
3558
+ 'month': 1,
3559
+ 'date': 1,
3560
+ 'color': 1,
3561
+ 'datetime-local': 1
3562
+ });
3563
+ }
3564
+ }
3565
+ if(modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && ((/MSIE 1[0|1]\.\d/.test(navigator.userAgent)) || (/Trident\/7\.0/.test(navigator.userAgent)))){
3566
+ replace.number = 1;
3567
+ }
3568
+
3569
+ if(!modernizrInputTypes.range || replace.range){
3400
3570
  extendType('range', {
3401
3571
  _create: function(opts, set){
3402
3572
  var data = $('<span />').insertAfter(opts.orig).rangeUI(opts).data('rangeUi');
@@ -3405,9 +3575,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3405
3575
  });
3406
3576
  }
3407
3577
 
3408
- var isStupid = modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && ((/MSIE 1[0|1]\.\d/.test(navigator.userAgent)) || (/Trident\/7\.0/.test(navigator.userAgent)));
3578
+
3409
3579
  ['number', 'time', 'month', 'date', 'color', 'datetime-local'].forEach(function(name){
3410
- if(!modernizrInputTypes[name] || options.replaceUI || (name == 'number' && isStupid)){
3580
+ if(!modernizrInputTypes[name] || replace[name]){
3411
3581
  extendType(name, {
3412
3582
  _create: function(opts, set){
3413
3583
  if(opts.monthSelect){