webshims-rails 1.12.5 → 1.12.7

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 +111 -132
  4. data/vendor/assets/javascripts/webshims/shims/combos/1.js +40 -37
  5. data/vendor/assets/javascripts/webshims/shims/combos/10.js +217 -36
  6. data/vendor/assets/javascripts/webshims/shims/combos/11.js +151 -29
  7. data/vendor/assets/javascripts/webshims/shims/combos/12.js +70 -93
  8. data/vendor/assets/javascripts/webshims/shims/combos/13.js +70 -93
  9. data/vendor/assets/javascripts/webshims/shims/combos/14.js +90 -13
  10. data/vendor/assets/javascripts/webshims/shims/combos/15.js +202 -59
  11. data/vendor/assets/javascripts/webshims/shims/combos/16.js +208 -70
  12. data/vendor/assets/javascripts/webshims/shims/combos/17.js +151 -29
  13. data/vendor/assets/javascripts/webshims/shims/combos/18.js +155 -30
  14. data/vendor/assets/javascripts/webshims/shims/combos/19.js +79 -20
  15. data/vendor/assets/javascripts/webshims/shims/combos/2.js +109 -47
  16. data/vendor/assets/javascripts/webshims/shims/combos/20.js +79 -20
  17. data/vendor/assets/javascripts/webshims/shims/combos/21.js +80 -87
  18. data/vendor/assets/javascripts/webshims/shims/combos/22.js +66 -83
  19. data/vendor/assets/javascripts/webshims/shims/combos/23.js +4 -10
  20. data/vendor/assets/javascripts/webshims/shims/combos/25.js +79 -20
  21. data/vendor/assets/javascripts/webshims/shims/combos/26.js +66 -7
  22. data/vendor/assets/javascripts/webshims/shims/combos/28.js +100 -25
  23. data/vendor/assets/javascripts/webshims/shims/combos/3.js +192 -47
  24. data/vendor/assets/javascripts/webshims/shims/combos/30.js +193 -49
  25. data/vendor/assets/javascripts/webshims/shims/combos/31.js +103 -36
  26. data/vendor/assets/javascripts/webshims/shims/combos/32.js +5 -3
  27. data/vendor/assets/javascripts/webshims/shims/combos/33.js +1 -2
  28. data/vendor/assets/javascripts/webshims/shims/combos/34.js +2048 -0
  29. data/vendor/assets/javascripts/webshims/shims/combos/4.js +156 -20
  30. data/vendor/assets/javascripts/webshims/shims/combos/5.js +151 -29
  31. data/vendor/assets/javascripts/webshims/shims/combos/6.js +152 -31
  32. data/vendor/assets/javascripts/webshims/shims/combos/7.js +199 -60
  33. data/vendor/assets/javascripts/webshims/shims/combos/8.js +197 -58
  34. data/vendor/assets/javascripts/webshims/shims/combos/9.js +218 -38
  35. data/vendor/assets/javascripts/webshims/shims/combos/97.js +1004 -0
  36. data/vendor/assets/javascripts/webshims/shims/combos/98.js +1283 -0
  37. data/vendor/assets/javascripts/webshims/shims/combos/99.js +204 -1248
  38. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +66 -7
  39. data/vendor/assets/javascripts/webshims/shims/es5.js +4 -1
  40. data/vendor/assets/javascripts/webshims/shims/form-combat.js +3 -3
  41. data/vendor/assets/javascripts/webshims/shims/form-core.js +36 -27
  42. data/vendor/assets/javascripts/webshims/shims/form-datalist.js +1 -2
  43. data/vendor/assets/javascripts/webshims/shims/form-fixrangechange.js +137 -0
  44. data/vendor/assets/javascripts/webshims/shims/form-message.js +90 -13
  45. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +129 -15
  46. data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +9 -10
  47. data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +886 -985
  48. data/vendor/assets/javascripts/webshims/shims/form-validation.js +78 -174
  49. data/vendor/assets/javascripts/webshims/shims/form-validators.js +39 -26
  50. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +45 -17
  51. data/vendor/assets/javascripts/webshims/shims/geolocation.js +10 -3
  52. data/vendor/assets/javascripts/webshims/shims/jme/b.js +71 -246
  53. data/vendor/assets/javascripts/webshims/shims/jme/c.js +133 -1002
  54. data/vendor/assets/javascripts/webshims/shims/jme/controls.css +62 -23
  55. data/vendor/assets/javascripts/webshims/shims/jme/controls.scss +73 -10
  56. data/vendor/assets/javascripts/webshims/shims/jme/mediacontrols-lazy.js +1117 -0
  57. data/vendor/assets/javascripts/webshims/shims/jme/p.js +603 -0
  58. data/vendor/assets/javascripts/webshims/shims/jpicker/jpicker.css +5 -2
  59. data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +4 -10
  60. data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +4 -1
  61. data/vendor/assets/javascripts/webshims/shims/range-ui.js +22 -14
  62. data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +29 -344
  63. data/vendor/assets/javascripts/webshims/shims/styles/forms-picker.css +362 -0
  64. data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +6 -483
  65. data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-picker.scss +488 -0
  66. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim-ext.scss +2 -0
  67. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +10 -2
  68. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +6 -2
  69. data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
  70. data/vendor/assets/javascripts/webshims/shims/track-ui.js +8 -1
  71. data/vendor/assets/javascripts/webshims/shims/track.js +66 -83
  72. metadata +12 -5
  73. data/vendor/assets/javascripts/webshims/shims/$ajax.js +0 -862
  74. data/vendor/assets/javascripts/webshims/shims/combos/24.js +0 -2087
@@ -1,3 +1,61 @@
1
+
2
+ //this might was already extended by ES5 shim feature
3
+ (function($){
4
+ "use strict";
5
+ var webshims = window.webshims;
6
+ if(webshims.defineProperties){return;}
7
+ var defineProperty = 'defineProperty';
8
+ var has = Object.prototype.hasOwnProperty;
9
+ var descProps = ['configurable', 'enumerable', 'writable'];
10
+ var extendUndefined = function(prop){
11
+ for(var i = 0; i < 3; i++){
12
+ if(prop[descProps[i]] === undefined && (descProps[i] !== 'writable' || prop.value !== undefined)){
13
+ prop[descProps[i]] = true;
14
+ }
15
+ }
16
+ };
17
+
18
+ var extendProps = function(props){
19
+ if(props){
20
+ for(var i in props){
21
+ if(has.call(props, i)){
22
+ extendUndefined(props[i]);
23
+ }
24
+ }
25
+ }
26
+ };
27
+
28
+ if(Object.create){
29
+ webshims.objectCreate = function(proto, props, opts){
30
+ extendProps(props);
31
+ var o = Object.create(proto, props);
32
+ if(opts){
33
+ o.options = $.extend(true, {}, o.options || {}, opts);
34
+ opts = o.options;
35
+ }
36
+ if(o._create && $.isFunction(o._create)){
37
+ o._create(opts);
38
+ }
39
+ return o;
40
+ };
41
+ }
42
+
43
+ if(Object[defineProperty]){
44
+ webshims[defineProperty] = function(obj, prop, desc){
45
+ extendUndefined(desc);
46
+ return Object[defineProperty](obj, prop, desc);
47
+ };
48
+ }
49
+ if(Object.defineProperties){
50
+ webshims.defineProperties = function(obj, props){
51
+ extendProps(props);
52
+ return Object.defineProperties(obj, props);
53
+ };
54
+ }
55
+ webshims.getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
56
+
57
+ webshims.getPrototypeOf = Object.getPrototypeOf;
58
+ })(window.webshims.$);
1
59
  //DOM-Extension helper
2
60
  webshims.register('dom-extend', function($, webshims, window, document, undefined){
3
61
  "use strict";
@@ -633,6 +691,13 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
633
691
  this.width = docObserve.getWidth();
634
692
  setInterval(this.test, 999);
635
693
  $(this.test);
694
+ if($.support.boxSizing == null){
695
+ $(function(){
696
+ if($.support.boxSizing){
697
+ docObserve.handler({type: 'boxsizing'});
698
+ }
699
+ });
700
+ }
636
701
  webshims.ready('WINDOWLOAD', this.test);
637
702
  $(document).on('updatelayout.webshim pageinit popupafteropen panelbeforeopen tabsactivate collapsibleexpand shown.bs.modal shown.bs.collapse slid.bs.carousel', this.handler);
638
703
  $(window).on('resize', this.handler);
@@ -644,13 +709,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
644
709
  webshims.docObserve = function(){
645
710
  webshims.ready('DOM', function(){
646
711
  docObserve.start();
647
- if($.support.boxSizing == null){
648
- $(function(){
649
- if($.support.boxSizing){
650
- docObserve.handler({type: 'boxsizing'});
651
- }
652
- });
653
- }
712
+
654
713
  });
655
714
  };
656
715
  return function(nativeElem, shadowElem, opts){
@@ -1147,10 +1206,11 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1147
1206
  _create: function(){
1148
1207
  var i;
1149
1208
 
1150
- this.element.addClass(this.options.baseClass || '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><span data-value="" data-valuetext="" /></span></span></span>');
1209
+ this.element.addClass(this.options.baseClass || 'ws-range ws-input').attr({role: 'slider'}).append('<span class="ws-range-rail ws-range-track"><span class="ws-range-min ws-range-progress" /><span class="ws-range-thumb"><span><span data-value="" data-valuetext="" /></span></span></span>');
1151
1210
  this.trail = $('.ws-range-track', this.element);
1152
1211
  this.range = $('.ws-range-progress', this.element);
1153
1212
  this.thumb = $('.ws-range-thumb', this.trail);
1213
+ this.thumbValue = $('span[data-value]', this.thumb);
1154
1214
 
1155
1215
  this.updateMetrics();
1156
1216
 
@@ -1201,8 +1261,8 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1201
1261
 
1202
1262
 
1203
1263
  if(!animate || !$.fn.animate){
1204
- this.thumb.css(thumbStyle);
1205
- this.range.css(rangeStyle);
1264
+ this.thumb[0].style[this.dirs.left] = thumbStyle[this.dirs.left];
1265
+ this.range[0].style[this.dirs.width] = rangeStyle[this.dirs.width];
1206
1266
  } else {
1207
1267
  if(typeof animate != 'object'){
1208
1268
  animate = {};
@@ -1225,20 +1285,19 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1225
1285
  _setValueMarkup: function(){
1226
1286
  var o = this.options;
1227
1287
  var textValue = o.textValue ? o.textValue(this.options.value) : o.options[o.value] || o.value;
1228
- this.element.attr({
1229
- 'aria-valuenow': this.options.value,
1230
- 'aria-valuetext': textValue
1231
- });
1232
- $('span[data-value]', this.thumb).attr({
1233
- 'data-value': this.options.value,
1234
- 'data-valuetext': textValue
1235
- });
1288
+
1289
+ this.element[0].setAttribute('aria-valuenow', this.options.value);
1290
+ this.element[0].setAttribute('aria-valuetext', textValue);
1291
+
1292
+ this.thumbValue[0].setAttribute('data-value', this.options.value);
1293
+ this.thumbValue[0].setAttribute('data-valuetext', textValue);
1294
+
1236
1295
  if(o.selectedOption){
1237
1296
  $(o.selectedOption).removeClass('ws-selected-option');
1238
1297
  o.selectedOption = null;
1239
1298
  }
1240
1299
  if(o.value in o.options){
1241
- o.selectedOption = $('[data-value="'+o.value+'"].ws-range-ticks').addClass('ws-selected-option');
1300
+ o.selectedOption = $('[data-value="'+o.value+'"].ws-range-ticks', this.trail).addClass('ws-selected-option');
1242
1301
  }
1243
1302
  },
1244
1303
  initDataList: function(){
@@ -1674,9 +1733,16 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1674
1733
  temp = this.element[this.dirs.innerHeight]();
1675
1734
  eS[this.dirs.marginTop] = ((elem[this.dirs.outerHeight]() - temp) / -2) + 'px';
1676
1735
  this.range[0].style[this.dirs.marginTop] = ((this.range[this.dirs.outerHeight]() - temp) / -2 ) +'px';
1736
+
1737
+ this.range[0].style[this.dirs.posLeft] = outerWidth +'px';
1738
+
1677
1739
  outerWidth *= -1;
1740
+
1741
+ this.range[0].style[this.dirs.paddingRight] = outerWidth +'px';
1678
1742
  this.trail[0].style[this.dirs.left] = outerWidth +'px';
1679
1743
  this.trail[0].style[this.dirs.right] = outerWidth +'px';
1744
+
1745
+
1680
1746
  }
1681
1747
  }
1682
1748
  },
@@ -1685,14 +1751,15 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1685
1751
  this.vertical = (width && this.element.innerHeight() - width > 10);
1686
1752
 
1687
1753
  this.dirs = this.vertical ?
1688
- {mouse: 'pageY', pos: 'top', min: 'max', max: 'min', left: 'top', right: 'bottom', width: 'height', innerWidth: 'innerHeight', innerHeight: 'innerWidth', outerWidth: 'outerHeight', outerHeight: 'outerWidth', marginTop: 'marginLeft', marginLeft: 'marginTop'} :
1689
- {mouse: 'pageX', pos: 'left', min: 'min', max: 'max', left: 'left', right: 'right', width: 'width', innerWidth: 'innerWidth', innerHeight: 'innerHeight', outerWidth: 'outerWidth', outerHeight: 'outerHeight', marginTop: 'marginTop', marginLeft: 'marginLeft'}
1754
+ {mouse: 'pageY', pos: 'top', posLeft: 'bottom', paddingRight: 'paddingTop', min: 'max', max: 'min', left: 'top', right: 'bottom', width: 'height', innerWidth: 'innerHeight', innerHeight: 'innerWidth', outerWidth: 'outerHeight', outerHeight: 'outerWidth', marginTop: 'marginLeft', marginLeft: 'marginTop'} :
1755
+ {mouse: 'pageX', pos: 'left', posLeft: 'left', paddingRight: 'paddingRight', min: 'min', max: 'max', left: 'left', right: 'right', width: 'width', innerWidth: 'innerWidth', innerHeight: 'innerHeight', outerWidth: 'outerWidth', outerHeight: 'outerHeight', marginTop: 'marginTop', marginLeft: 'marginLeft'}
1690
1756
  ;
1691
1757
  if(!this.vertical && this.element.css('direction') == 'rtl'){
1692
1758
  this.isRtl = true;
1693
1759
  this.dirs.left = 'right';
1694
1760
  this.dirs.right = 'left';
1695
1761
  this.dirs.marginLeft = 'marginRight';
1762
+ this.dirs.posLeft = 'right';
1696
1763
  }
1697
1764
  this.element
1698
1765
  [this.vertical ? 'addClass' : 'removeClass']('vertical-range')
@@ -1945,6 +2012,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1945
2012
  options.addZero = addZero;
1946
2013
  webshims.loader.addModule('forms-picker', {
1947
2014
  noAutoCallback: true,
2015
+ css: 'styles/forms-picker.css',
1948
2016
  options: options
1949
2017
  });
1950
2018
  webshims.loader.addModule('color-picker', {
@@ -2117,8 +2185,40 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2117
2185
 
2118
2186
 
2119
2187
  var formatVal = {
2120
- number: function(val, o){
2121
- return (val+'').replace(/\,/g, '').replace(/\./, curCfg.numberFormat['.']);
2188
+ number: function(val, o, noCorrect){
2189
+ var parts, len, i, isNegative;
2190
+ if(o && o.nogrouping){
2191
+ return (val+'').replace(/\,/g, '').replace(/\./, curCfg.numberFormat['.']);
2192
+ }
2193
+
2194
+ val += '';
2195
+
2196
+ if(val.charAt(0) == '-'){
2197
+ isNegative = true;
2198
+ val = val.replace('-', '');
2199
+ }
2200
+ parts = val.split('.');
2201
+ len = parts[0].length;
2202
+ i = len - 1;
2203
+
2204
+ val = "";
2205
+ while(i >= 0) {
2206
+ val = parts[0].charAt(i) + val;
2207
+ if (i > 0 && (len - i) % 3 === 0) {
2208
+ val = curCfg.numberFormat[','] + val;
2209
+ }
2210
+ --i;
2211
+ }
2212
+ if(parts[1] != null){
2213
+ if(!noCorrect){
2214
+ parts[1] = parts[1].replace(/\-/g, '0');
2215
+ }
2216
+ val += curCfg.numberFormat['.'] + parts[1];
2217
+ }
2218
+ if(isNegative){
2219
+ val = '-'+val;
2220
+ }
2221
+ return val;
2122
2222
  },
2123
2223
  time: function(val){
2124
2224
  var fVal;
@@ -2197,10 +2297,10 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2197
2297
  return ret;
2198
2298
  }
2199
2299
  };
2200
-
2300
+
2201
2301
  var parseVal = {
2202
2302
  number: function(val){
2203
- return (val+'').replace(curCfg.numberFormat[','], '').replace(curCfg.numberFormat['.'], '.');
2303
+ return (val+'').split(curCfg.numberFormat[',']).join('').replace(curCfg.numberFormat['.'], '.');
2204
2304
  },
2205
2305
  // week: function(val){
2206
2306
  // return val;
@@ -2269,7 +2369,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2269
2369
  val = val.split(curCfg.dFormat);
2270
2370
  }
2271
2371
  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))){
2272
- if(val[obj.mm] > 12 && val[obj.dd] < 13){
2372
+ if(!opts.noDayMonthSwitch && val[obj.mm] > 12 && val[obj.dd] < 13){
2273
2373
  tmp = val[obj.dd];
2274
2374
  val[obj.dd] = val[obj.mm];
2275
2375
  val[obj.mm] = tmp;
@@ -2702,7 +2802,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2702
2802
  },
2703
2803
  toFixed: function(val, force){
2704
2804
  var o = this.options;
2705
- if(o.toFixed && o.type == 'number' && val && this.valueAsNumber && (force || !this.element.is(':focus')) && (!o.fixOnlyFloat || (this.valueAsNumber % 1)) && !$(this.orig).is(':invalid')){
2805
+ if(o.toFixed && o.type == 'number' && val && !isNaN(this.valueAsNumber) && (force || !this.element.is(':focus')) && (!o.fixOnlyFloat || (this.valueAsNumber % 1))){
2706
2806
  val = formatVal[this.type](this.valueAsNumber.toFixed(o.toFixed), this.options);
2707
2807
  }
2708
2808
  return val;
@@ -2711,7 +2811,8 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2711
2811
 
2712
2812
  ['defaultValue', 'value'].forEach(function(name){
2713
2813
  var isValue = name == 'value';
2714
- spinBtnProto[name] = function(val, force){
2814
+ spinBtnProto[name] = function(val, force, isLive){
2815
+ var selectionEnd;
2715
2816
  if(!this._init || force || this.options[name] !== val){
2716
2817
  if(isValue){
2717
2818
  this._beforeValue(val);
@@ -2730,7 +2831,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2730
2831
  }
2731
2832
  });
2732
2833
  } else {
2733
- this.element.prop(name, this.toFixed(val));
2834
+ val = this.toFixed(val);
2835
+ if(isLive && this._getSelectionEnd){
2836
+ selectionEnd = this._getSelectionEnd(val);
2837
+ }
2838
+ this.element.prop(name, val);
2839
+ if(selectionEnd){
2840
+ this.element.prop('selectionEnd', selectionEnd);
2841
+ }
2734
2842
  }
2735
2843
  this._propertyChange(name);
2736
2844
  this.mirrorValidity();
@@ -2758,7 +2866,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2758
2866
  $.fn.wsBaseWidget = function(opts){
2759
2867
  opts = $.extend({}, opts);
2760
2868
  return this.each(function(){
2761
- $.webshims.objectCreate(wsWidgetProto, {
2869
+ webshims.objectCreate(wsWidgetProto, {
2762
2870
  element: {
2763
2871
  value: $(this)
2764
2872
  }
@@ -2773,7 +2881,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2773
2881
  monthNames: 'monthNamesShort'
2774
2882
  }, opts);
2775
2883
  return this.each(function(){
2776
- $.webshims.objectCreate(spinBtnProto, {
2884
+ webshims.objectCreate(spinBtnProto, {
2777
2885
  element: {
2778
2886
  value: $(this)
2779
2887
  }
@@ -2782,12 +2890,80 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2782
2890
  };
2783
2891
 
2784
2892
  $.fn.spinbtnUI.wsProto = spinBtnProto;
2893
+
2894
+ webshims._format = formatVal;
2785
2895
 
2786
2896
  })();
2787
-
2897
+
2898
+
2899
+ $.fn.wsTouchClick = (function(){
2900
+ var supportsTouchaction = ('touchAction' in document.documentElement.style);
2901
+ var addTouch = !supportsTouchaction && ('ontouchstart' in window) && document.addEventListener;
2902
+ return function(target, handler){
2903
+ var touchData, touchEnd, touchStart;
2904
+
2905
+ if(addTouch){
2906
+
2907
+ touchEnd = function(e){
2908
+ var ret, touch;
2909
+ e = e.originalEvent || {};
2910
+ $(this).off('touchend', touchEnd);
2911
+ var changedTouches = e.changedTouches || e.touches;
2912
+ if(!touchData || !changedTouches || changedTouches.length != 1){
2913
+ return;
2914
+ }
2915
+
2916
+ touch = changedTouches[0];
2917
+ if(Math.abs(touchData.x - touch.pageX) > 40 || Math.abs(touchData.y - touch.pageY) > 40 || Date.now() - touchData.now > 600){
2918
+ return;
2919
+ }
2920
+ e.preventDefault();
2921
+ ret = handler.apply(this, arguments);
2922
+
2923
+ return ret;
2924
+ };
2925
+
2926
+ touchStart = function(e){
2927
+ var touch, elemTarget;
2928
+
2929
+
2930
+ if((!e || e.touches.length != 1)){
2931
+ return;
2932
+ }
2933
+ touch = e.touches[0];
2934
+ elemTarget = target ? $(touch.target).closest(target) : $(this);
2935
+ if(!elemTarget.length){
2936
+ return;
2937
+ }
2938
+ touchData = {
2939
+ x: touch.pageX,
2940
+ y: touch.pageY,
2941
+ now: Date.now()
2942
+ };
2943
+ elemTarget.on('touchend', touchEnd);
2944
+ };
2945
+
2946
+ this.each(function(){
2947
+ this.addEventListener('touchstart', touchStart, true);
2948
+ });
2949
+ } else if(supportsTouchaction){
2950
+ this.css('touch-action', 'manipulation');
2951
+ }
2952
+
2953
+ if($.isFunction(target)){
2954
+ handler = target;
2955
+ target = false;
2956
+ this.on('click', handler);
2957
+ } else {
2958
+ this.on('click', target, handler);
2959
+ }
2960
+ return this;
2961
+ };
2962
+ })();
2963
+
2788
2964
  (function(){
2789
2965
  var picker = {};
2790
-
2966
+ var assumeVirtualKeyBoard = Modernizr.touchevents || Modernizr.touch || (/android|iphone|ipad|ipod|blackberry|iemobile/i.test(navigator.userAgent.toLowerCase()));
2791
2967
  webshims.inlinePopover = {
2792
2968
  _create: function(){
2793
2969
  this.element = $('<div class="ws-inline-picker"><div class="ws-po-box" /></div>').data('wspopover', this);
@@ -2878,7 +3054,11 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2878
3054
  cancel: function(val, popover, data){
2879
3055
  if(!data.options.inlinePicker){
2880
3056
  popover.stopOpen = true;
2881
- data.element.getShadowFocusElement().trigger('focus');
3057
+ if(assumeVirtualKeyBoard){
3058
+ $('button', data.buttonWrapper).trigger('focus');
3059
+ } else {
3060
+ data.element.getShadowFocusElement().trigger('focus');
3061
+ }
2882
3062
  setTimeout(function(){
2883
3063
  popover.stopOpen = false;
2884
3064
  }, 9);
@@ -2969,6 +3149,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
2969
3149
 
2970
3150
 
2971
3151
  picker._common = function(data){
3152
+ if(data.options.nopicker){return;}
2972
3153
  var options = data.options;
2973
3154
  var popover = webshims.objectCreate(options.inlinePicker ? webshims.inlinePopover : webshims.wsPopover, {}, $.extend(options.popover || {}, {prepareFor: options.inlinePicker ? data.buttonWrapper : data.element}));
2974
3155
  var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper);
@@ -3038,7 +3219,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
3038
3219
  }
3039
3220
 
3040
3221
 
3041
- opener.on({click: open});
3222
+ opener.wsTouchClick(open);
3042
3223
 
3043
3224
  if(options.inlinePicker){
3044
3225
  popover.openedByFocus = true;
@@ -3231,7 +3412,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
3231
3412
  var init, parent, lastWidth, left, right, isRtl, hasButtons;
3232
3413
  var oriStyleO = data.orig.style;
3233
3414
  var styleO = data.element[0].style;
3234
- if($.support.boxSizing == null && !$.isReady){
3415
+ if($.support.boxSizing == null){
3235
3416
  $(function(){
3236
3417
  parent = data.orig.parentNode;
3237
3418
  });
@@ -15,10 +15,11 @@
15
15
  _create: function(){
16
16
  var i;
17
17
 
18
- this.element.addClass(this.options.baseClass || '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><span data-value="" data-valuetext="" /></span></span></span>');
18
+ this.element.addClass(this.options.baseClass || 'ws-range ws-input').attr({role: 'slider'}).append('<span class="ws-range-rail ws-range-track"><span class="ws-range-min ws-range-progress" /><span class="ws-range-thumb"><span><span data-value="" data-valuetext="" /></span></span></span>');
19
19
  this.trail = $('.ws-range-track', this.element);
20
20
  this.range = $('.ws-range-progress', this.element);
21
21
  this.thumb = $('.ws-range-thumb', this.trail);
22
+ this.thumbValue = $('span[data-value]', this.thumb);
22
23
 
23
24
  this.updateMetrics();
24
25
 
@@ -69,8 +70,8 @@
69
70
 
70
71
 
71
72
  if(!animate || !$.fn.animate){
72
- this.thumb.css(thumbStyle);
73
- this.range.css(rangeStyle);
73
+ this.thumb[0].style[this.dirs.left] = thumbStyle[this.dirs.left];
74
+ this.range[0].style[this.dirs.width] = rangeStyle[this.dirs.width];
74
75
  } else {
75
76
  if(typeof animate != 'object'){
76
77
  animate = {};
@@ -93,20 +94,19 @@
93
94
  _setValueMarkup: function(){
94
95
  var o = this.options;
95
96
  var textValue = o.textValue ? o.textValue(this.options.value) : o.options[o.value] || o.value;
96
- this.element.attr({
97
- 'aria-valuenow': this.options.value,
98
- 'aria-valuetext': textValue
99
- });
100
- $('span[data-value]', this.thumb).attr({
101
- 'data-value': this.options.value,
102
- 'data-valuetext': textValue
103
- });
97
+
98
+ this.element[0].setAttribute('aria-valuenow', this.options.value);
99
+ this.element[0].setAttribute('aria-valuetext', textValue);
100
+
101
+ this.thumbValue[0].setAttribute('data-value', this.options.value);
102
+ this.thumbValue[0].setAttribute('data-valuetext', textValue);
103
+
104
104
  if(o.selectedOption){
105
105
  $(o.selectedOption).removeClass('ws-selected-option');
106
106
  o.selectedOption = null;
107
107
  }
108
108
  if(o.value in o.options){
109
- o.selectedOption = $('[data-value="'+o.value+'"].ws-range-ticks').addClass('ws-selected-option');
109
+ o.selectedOption = $('[data-value="'+o.value+'"].ws-range-ticks', this.trail).addClass('ws-selected-option');
110
110
  }
111
111
  },
112
112
  initDataList: function(){
@@ -542,9 +542,16 @@
542
542
  temp = this.element[this.dirs.innerHeight]();
543
543
  eS[this.dirs.marginTop] = ((elem[this.dirs.outerHeight]() - temp) / -2) + 'px';
544
544
  this.range[0].style[this.dirs.marginTop] = ((this.range[this.dirs.outerHeight]() - temp) / -2 ) +'px';
545
+
546
+ this.range[0].style[this.dirs.posLeft] = outerWidth +'px';
547
+
545
548
  outerWidth *= -1;
549
+
550
+ this.range[0].style[this.dirs.paddingRight] = outerWidth +'px';
546
551
  this.trail[0].style[this.dirs.left] = outerWidth +'px';
547
552
  this.trail[0].style[this.dirs.right] = outerWidth +'px';
553
+
554
+
548
555
  }
549
556
  }
550
557
  },
@@ -553,14 +560,15 @@
553
560
  this.vertical = (width && this.element.innerHeight() - width > 10);
554
561
 
555
562
  this.dirs = this.vertical ?
556
- {mouse: 'pageY', pos: 'top', min: 'max', max: 'min', left: 'top', right: 'bottom', width: 'height', innerWidth: 'innerHeight', innerHeight: 'innerWidth', outerWidth: 'outerHeight', outerHeight: 'outerWidth', marginTop: 'marginLeft', marginLeft: 'marginTop'} :
557
- {mouse: 'pageX', pos: 'left', min: 'min', max: 'max', left: 'left', right: 'right', width: 'width', innerWidth: 'innerWidth', innerHeight: 'innerHeight', outerWidth: 'outerWidth', outerHeight: 'outerHeight', marginTop: 'marginTop', marginLeft: 'marginLeft'}
563
+ {mouse: 'pageY', pos: 'top', posLeft: 'bottom', paddingRight: 'paddingTop', min: 'max', max: 'min', left: 'top', right: 'bottom', width: 'height', innerWidth: 'innerHeight', innerHeight: 'innerWidth', outerWidth: 'outerHeight', outerHeight: 'outerWidth', marginTop: 'marginLeft', marginLeft: 'marginTop'} :
564
+ {mouse: 'pageX', pos: 'left', posLeft: 'left', paddingRight: 'paddingRight', min: 'min', max: 'max', left: 'left', right: 'right', width: 'width', innerWidth: 'innerWidth', innerHeight: 'innerHeight', outerWidth: 'outerWidth', outerHeight: 'outerHeight', marginTop: 'marginTop', marginLeft: 'marginLeft'}
558
565
  ;
559
566
  if(!this.vertical && this.element.css('direction') == 'rtl'){
560
567
  this.isRtl = true;
561
568
  this.dirs.left = 'right';
562
569
  this.dirs.right = 'left';
563
570
  this.dirs.marginLeft = 'marginRight';
571
+ this.dirs.posLeft = 'right';
564
572
  }
565
573
  this.element
566
574
  [this.vertical ? 'addClass' : 'removeClass']('vertical-range')
@@ -813,6 +821,7 @@
813
821
  options.addZero = addZero;
814
822
  webshims.loader.addModule('forms-picker', {
815
823
  noAutoCallback: true,
824
+ css: 'styles/forms-picker.css',
816
825
  options: options
817
826
  });
818
827
  webshims.loader.addModule('color-picker', {
@@ -985,8 +994,40 @@
985
994
 
986
995
 
987
996
  var formatVal = {
988
- number: function(val, o){
989
- return (val+'').replace(/\,/g, '').replace(/\./, curCfg.numberFormat['.']);
997
+ number: function(val, o, noCorrect){
998
+ var parts, len, i, isNegative;
999
+ if(o && o.nogrouping){
1000
+ return (val+'').replace(/\,/g, '').replace(/\./, curCfg.numberFormat['.']);
1001
+ }
1002
+
1003
+ val += '';
1004
+
1005
+ if(val.charAt(0) == '-'){
1006
+ isNegative = true;
1007
+ val = val.replace('-', '');
1008
+ }
1009
+ parts = val.split('.');
1010
+ len = parts[0].length;
1011
+ i = len - 1;
1012
+
1013
+ val = "";
1014
+ while(i >= 0) {
1015
+ val = parts[0].charAt(i) + val;
1016
+ if (i > 0 && (len - i) % 3 === 0) {
1017
+ val = curCfg.numberFormat[','] + val;
1018
+ }
1019
+ --i;
1020
+ }
1021
+ if(parts[1] != null){
1022
+ if(!noCorrect){
1023
+ parts[1] = parts[1].replace(/\-/g, '0');
1024
+ }
1025
+ val += curCfg.numberFormat['.'] + parts[1];
1026
+ }
1027
+ if(isNegative){
1028
+ val = '-'+val;
1029
+ }
1030
+ return val;
990
1031
  },
991
1032
  time: function(val){
992
1033
  var fVal;
@@ -1065,10 +1106,10 @@
1065
1106
  return ret;
1066
1107
  }
1067
1108
  };
1068
-
1109
+
1069
1110
  var parseVal = {
1070
1111
  number: function(val){
1071
- return (val+'').replace(curCfg.numberFormat[','], '').replace(curCfg.numberFormat['.'], '.');
1112
+ return (val+'').split(curCfg.numberFormat[',']).join('').replace(curCfg.numberFormat['.'], '.');
1072
1113
  },
1073
1114
  // week: function(val){
1074
1115
  // return val;
@@ -1137,7 +1178,7 @@
1137
1178
  val = val.split(curCfg.dFormat);
1138
1179
  }
1139
1180
  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))){
1140
- if(val[obj.mm] > 12 && val[obj.dd] < 13){
1181
+ if(!opts.noDayMonthSwitch && val[obj.mm] > 12 && val[obj.dd] < 13){
1141
1182
  tmp = val[obj.dd];
1142
1183
  val[obj.dd] = val[obj.mm];
1143
1184
  val[obj.mm] = tmp;
@@ -1570,7 +1611,7 @@
1570
1611
  },
1571
1612
  toFixed: function(val, force){
1572
1613
  var o = this.options;
1573
- if(o.toFixed && o.type == 'number' && val && this.valueAsNumber && (force || !this.element.is(':focus')) && (!o.fixOnlyFloat || (this.valueAsNumber % 1)) && !$(this.orig).is(':invalid')){
1614
+ if(o.toFixed && o.type == 'number' && val && !isNaN(this.valueAsNumber) && (force || !this.element.is(':focus')) && (!o.fixOnlyFloat || (this.valueAsNumber % 1))){
1574
1615
  val = formatVal[this.type](this.valueAsNumber.toFixed(o.toFixed), this.options);
1575
1616
  }
1576
1617
  return val;
@@ -1579,7 +1620,8 @@
1579
1620
 
1580
1621
  ['defaultValue', 'value'].forEach(function(name){
1581
1622
  var isValue = name == 'value';
1582
- spinBtnProto[name] = function(val, force){
1623
+ spinBtnProto[name] = function(val, force, isLive){
1624
+ var selectionEnd;
1583
1625
  if(!this._init || force || this.options[name] !== val){
1584
1626
  if(isValue){
1585
1627
  this._beforeValue(val);
@@ -1598,7 +1640,14 @@
1598
1640
  }
1599
1641
  });
1600
1642
  } else {
1601
- this.element.prop(name, this.toFixed(val));
1643
+ val = this.toFixed(val);
1644
+ if(isLive && this._getSelectionEnd){
1645
+ selectionEnd = this._getSelectionEnd(val);
1646
+ }
1647
+ this.element.prop(name, val);
1648
+ if(selectionEnd){
1649
+ this.element.prop('selectionEnd', selectionEnd);
1650
+ }
1602
1651
  }
1603
1652
  this._propertyChange(name);
1604
1653
  this.mirrorValidity();
@@ -1626,7 +1675,7 @@
1626
1675
  $.fn.wsBaseWidget = function(opts){
1627
1676
  opts = $.extend({}, opts);
1628
1677
  return this.each(function(){
1629
- $.webshims.objectCreate(wsWidgetProto, {
1678
+ webshims.objectCreate(wsWidgetProto, {
1630
1679
  element: {
1631
1680
  value: $(this)
1632
1681
  }
@@ -1641,7 +1690,7 @@
1641
1690
  monthNames: 'monthNamesShort'
1642
1691
  }, opts);
1643
1692
  return this.each(function(){
1644
- $.webshims.objectCreate(spinBtnProto, {
1693
+ webshims.objectCreate(spinBtnProto, {
1645
1694
  element: {
1646
1695
  value: $(this)
1647
1696
  }
@@ -1650,12 +1699,80 @@
1650
1699
  };
1651
1700
 
1652
1701
  $.fn.spinbtnUI.wsProto = spinBtnProto;
1702
+
1703
+ webshims._format = formatVal;
1653
1704
 
1654
1705
  })();
1655
-
1706
+
1707
+
1708
+ $.fn.wsTouchClick = (function(){
1709
+ var supportsTouchaction = ('touchAction' in document.documentElement.style);
1710
+ var addTouch = !supportsTouchaction && ('ontouchstart' in window) && document.addEventListener;
1711
+ return function(target, handler){
1712
+ var touchData, touchEnd, touchStart;
1713
+
1714
+ if(addTouch){
1715
+
1716
+ touchEnd = function(e){
1717
+ var ret, touch;
1718
+ e = e.originalEvent || {};
1719
+ $(this).off('touchend', touchEnd);
1720
+ var changedTouches = e.changedTouches || e.touches;
1721
+ if(!touchData || !changedTouches || changedTouches.length != 1){
1722
+ return;
1723
+ }
1724
+
1725
+ touch = changedTouches[0];
1726
+ if(Math.abs(touchData.x - touch.pageX) > 40 || Math.abs(touchData.y - touch.pageY) > 40 || Date.now() - touchData.now > 600){
1727
+ return;
1728
+ }
1729
+ e.preventDefault();
1730
+ ret = handler.apply(this, arguments);
1731
+
1732
+ return ret;
1733
+ };
1734
+
1735
+ touchStart = function(e){
1736
+ var touch, elemTarget;
1737
+
1738
+
1739
+ if((!e || e.touches.length != 1)){
1740
+ return;
1741
+ }
1742
+ touch = e.touches[0];
1743
+ elemTarget = target ? $(touch.target).closest(target) : $(this);
1744
+ if(!elemTarget.length){
1745
+ return;
1746
+ }
1747
+ touchData = {
1748
+ x: touch.pageX,
1749
+ y: touch.pageY,
1750
+ now: Date.now()
1751
+ };
1752
+ elemTarget.on('touchend', touchEnd);
1753
+ };
1754
+
1755
+ this.each(function(){
1756
+ this.addEventListener('touchstart', touchStart, true);
1757
+ });
1758
+ } else if(supportsTouchaction){
1759
+ this.css('touch-action', 'manipulation');
1760
+ }
1761
+
1762
+ if($.isFunction(target)){
1763
+ handler = target;
1764
+ target = false;
1765
+ this.on('click', handler);
1766
+ } else {
1767
+ this.on('click', target, handler);
1768
+ }
1769
+ return this;
1770
+ };
1771
+ })();
1772
+
1656
1773
  (function(){
1657
1774
  var picker = {};
1658
-
1775
+ var assumeVirtualKeyBoard = Modernizr.touchevents || Modernizr.touch || (/android|iphone|ipad|ipod|blackberry|iemobile/i.test(navigator.userAgent.toLowerCase()));
1659
1776
  webshims.inlinePopover = {
1660
1777
  _create: function(){
1661
1778
  this.element = $('<div class="ws-inline-picker"><div class="ws-po-box" /></div>').data('wspopover', this);
@@ -1746,7 +1863,11 @@
1746
1863
  cancel: function(val, popover, data){
1747
1864
  if(!data.options.inlinePicker){
1748
1865
  popover.stopOpen = true;
1749
- data.element.getShadowFocusElement().trigger('focus');
1866
+ if(assumeVirtualKeyBoard){
1867
+ $('button', data.buttonWrapper).trigger('focus');
1868
+ } else {
1869
+ data.element.getShadowFocusElement().trigger('focus');
1870
+ }
1750
1871
  setTimeout(function(){
1751
1872
  popover.stopOpen = false;
1752
1873
  }, 9);
@@ -1837,6 +1958,7 @@
1837
1958
 
1838
1959
 
1839
1960
  picker._common = function(data){
1961
+ if(data.options.nopicker){return;}
1840
1962
  var options = data.options;
1841
1963
  var popover = webshims.objectCreate(options.inlinePicker ? webshims.inlinePopover : webshims.wsPopover, {}, $.extend(options.popover || {}, {prepareFor: options.inlinePicker ? data.buttonWrapper : data.element}));
1842
1964
  var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper);
@@ -1906,7 +2028,7 @@
1906
2028
  }
1907
2029
 
1908
2030
 
1909
- opener.on({click: open});
2031
+ opener.wsTouchClick(open);
1910
2032
 
1911
2033
  if(options.inlinePicker){
1912
2034
  popover.openedByFocus = true;
@@ -2099,7 +2221,7 @@
2099
2221
  var init, parent, lastWidth, left, right, isRtl, hasButtons;
2100
2222
  var oriStyleO = data.orig.style;
2101
2223
  var styleO = data.element[0].style;
2102
- if($.support.boxSizing == null && !$.isReady){
2224
+ if($.support.boxSizing == null){
2103
2225
  $(function(){
2104
2226
  parent = data.orig.parentNode;
2105
2227
  });