webshims-rails 1.10.9 → 1.10.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +8 -8
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/webshims/polyfiller.js +8 -9
  4. data/vendor/assets/javascripts/webshims/shims/combos/1.js +24 -14
  5. data/vendor/assets/javascripts/webshims/shims/combos/10.js +61 -20
  6. data/vendor/assets/javascripts/webshims/shims/combos/11.js +54 -16
  7. data/vendor/assets/javascripts/webshims/shims/combos/12.js +9 -13
  8. data/vendor/assets/javascripts/webshims/shims/combos/13.js +8 -12
  9. data/vendor/assets/javascripts/webshims/shims/combos/14.js +10 -7
  10. data/vendor/assets/javascripts/webshims/shims/combos/15.js +40 -11
  11. data/vendor/assets/javascripts/webshims/shims/combos/16.js +49 -24
  12. data/vendor/assets/javascripts/webshims/shims/combos/17.js +128 -19
  13. data/vendor/assets/javascripts/webshims/shims/combos/18.js +131 -22
  14. data/vendor/assets/javascripts/webshims/shims/combos/19.js +133 -40
  15. data/vendor/assets/javascripts/webshims/shims/combos/2.js +31 -18
  16. data/vendor/assets/javascripts/webshims/shims/combos/20.js +132 -39
  17. data/vendor/assets/javascripts/webshims/shims/combos/21.js +116 -22
  18. data/vendor/assets/javascripts/webshims/shims/combos/23.js +9 -13
  19. data/vendor/assets/javascripts/webshims/shims/combos/24.js +48 -13
  20. data/vendor/assets/javascripts/webshims/shims/combos/25.js +133 -40
  21. data/vendor/assets/javascripts/webshims/shims/combos/26.js +7 -4
  22. data/vendor/assets/javascripts/webshims/shims/combos/27.js +1 -1
  23. data/vendor/assets/javascripts/webshims/shims/combos/28.js +121 -24
  24. data/vendor/assets/javascripts/webshims/shims/combos/29.js +4 -6
  25. data/vendor/assets/javascripts/webshims/shims/combos/3.js +30 -6
  26. data/vendor/assets/javascripts/webshims/shims/combos/30.js +30 -6
  27. data/vendor/assets/javascripts/webshims/shims/combos/31.js +22 -5
  28. data/vendor/assets/javascripts/webshims/shims/combos/4.js +15 -5
  29. data/vendor/assets/javascripts/webshims/shims/combos/5.js +128 -19
  30. data/vendor/assets/javascripts/webshims/shims/combos/6.js +128 -19
  31. data/vendor/assets/javascripts/webshims/shims/combos/7.js +39 -19
  32. data/vendor/assets/javascripts/webshims/shims/combos/8.js +39 -19
  33. data/vendor/assets/javascripts/webshims/shims/combos/9.js +61 -20
  34. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +7 -4
  35. data/vendor/assets/javascripts/webshims/shims/es5.js +3 -3
  36. data/vendor/assets/javascripts/webshims/shims/form-core.js +15 -1
  37. data/vendor/assets/javascripts/webshims/shims/form-message.js +8 -1
  38. data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +74 -3
  39. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +53 -15
  40. data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +10 -5
  41. data/vendor/assets/javascripts/webshims/shims/form-validation.js +48 -13
  42. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +14 -2
  43. data/vendor/assets/javascripts/webshims/shims/geolocation.js +2 -2
  44. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-ar.js +2 -2
  45. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-ch-ZN.js +2 -2
  46. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-de.txt +2 -2
  47. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-el.js +2 -2
  48. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-en.txt +2 -2
  49. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-es.js +2 -2
  50. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-fr.js +2 -2
  51. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-he.js +2 -2
  52. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-hi.js +2 -2
  53. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-hu.js +2 -2
  54. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-it.js +2 -2
  55. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-ja.js +2 -2
  56. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-lt.js +7 -4
  57. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-nl.js +2 -2
  58. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-pl.js +106 -0
  59. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-pt-PT.js +2 -2
  60. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-ru.js +2 -2
  61. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-sv.js +2 -2
  62. data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +8 -12
  63. data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +114 -20
  64. data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +132 -17
  65. data/vendor/assets/javascripts/webshims/shims/range-ui.js +1 -1
  66. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +38 -3
  67. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +42 -13
  68. data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
  69. data/vendor/assets/javascripts/webshims/shims/swfmini.js +1 -1
  70. data/vendor/assets/javascripts/webshims/shims/track-ui.js +4 -6
  71. metadata +3 -2
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWI2OGRjYmRhYTU5ZDRhOWZmM2Y3ODlmNzkwYzA0Y2FmOGQ4NWNjOQ==
4
+ MWYxOTgxNWIyNzYwNzllNGJiOGM1YzQ4ZGFmNjRlODNhMDQ3NGE3Yg==
5
5
  data.tar.gz: !binary |-
6
- ZTRlODMwMTM0YzNmMzA2YmZlYTIwNDllZWQ2YTgxZWNmYTQ2MjBhMw==
6
+ NTZkYmY1Yzk5YmJlODcyYjQ3NWE0ZTM2YjhiOTg3Y2MwYzM1MTE3Ng==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YWE1M2U1YmE0YTlhNGRhMDdmM2Y0NWY3MDNiNjljM2YwNzk5NzYyYzUwM2Q3
10
- NGQ4NjE2YzNiZDg2NGIyOTdjMTJlMDFlZDQxYzY1ZDAxZjhkYWM5OGI5ZjIz
11
- NWQ0ZGY4MDcyMjc2ZGViNjI2NDNkMDE5ODVlYTBiNjlkNzM0ZDc=
9
+ ZGY4MjZiY2VkY2UzNGY5Y2I1NGY3YjkyYTI2ZWRjMDE1YTAxZmExOTZlMmM1
10
+ YmZmZWYyMWFhOWQ3YjVkZDc4NGM1MDZkNThkMTE0ZWE1ZGNkYjA4OTZjNzM4
11
+ NDVkNzE0YTUyN2M4ZjNkMGFhOTg2OTk5MTgxNGVjODFmNGNhOGQ=
12
12
  data.tar.gz: !binary |-
13
- YjgyM2U1YzYwMTljNTAxMTE3OGZmNWNjMzg0MjdmYzZjYTMxMTQ2ZjI1NDAx
14
- NGY1NjQ1ZTY1ZDJjOGQ1ODM4NTEzZWQ4NmE5MTY1NmI4MTY2ZThlNGYxZDRi
15
- YjM1NjgxNzcxMzkzMmE5MzkyNDBmZWVmMzE3OGVlN2JjMDNlZmU=
13
+ MDQ2N2QyN2M4ODY4NWJhZGViNTZmYzBjZjQxZDVlMWY5NWJmMzkwOTkxZGY0
14
+ ZDZiZGUyNThjZDFlNzEzNDE4MWNhMmQ5MTExNjg4OGY1Mzc1ZWIzYWRhZTg2
15
+ MmI2YmQ2NjM0MGE5MjJjNWFmZDZmMjUwNTkzZTI2ZGYwYjAzODI=
@@ -1,6 +1,6 @@
1
1
  module Webshims
2
2
  module Rails
3
- VERSION = "1.10.9"
4
- WEBSHIMS_VERSION = "1.10.9"
3
+ VERSION = "1.10.10"
4
+ WEBSHIMS_VERSION = "1.10.10"
5
5
  end
6
6
  end
@@ -25,12 +25,9 @@
25
25
  Modernizr.ES5 = false;
26
26
  }
27
27
 
28
- if(!$.event.customEvent){
29
- $.event.customEvent = {};
30
- }
31
28
 
32
29
  var webshims = {
33
- version: '1.10.9',
30
+ version: '1.10.10',
34
31
  cfg: {
35
32
  useImportantStyles: true,
36
33
  //addCacheBuster: false,
@@ -946,6 +943,7 @@
946
943
  var fNuAPI = 'form-number-date-api';
947
944
  var select = $('<select required="" name="a"><option disabled="" /></select>')[0];
948
945
  var bustedValidity = false;
946
+ var bustedWidgetUi = false;
949
947
 
950
948
  var initialFormTest = function(){
951
949
  if(!initialFormTest.run){
@@ -965,9 +963,10 @@
965
963
  }
966
964
 
967
965
  if(Modernizr[formvalidation]){
968
- bugs.bustedValidity = bustedValidity = !modernizrInputAttrs.list || 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;
966
+ 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;
967
+ bugs.bustedValidity = bustedValidity = bustedWidgetUi || !modernizrInputAttrs.list;
969
968
  }
970
-
969
+
971
970
  formExtend = Modernizr[formvalidation] && !bustedValidity ? 'form-native-extend' : fShim;
972
971
 
973
972
  }
@@ -1003,7 +1002,7 @@
1003
1002
  // ,fieldWrapper: undefined
1004
1003
  // ,fx: 'slide'
1005
1004
  },
1006
- availabeLangs: ['ar', 'ch-ZN', 'el', 'es', 'fr', 'he', 'hi', 'hu', 'it', 'ja', 'lt', 'nl', 'pt-PT', 'ru', 'sv'] //en and de are directly implemented in core
1005
+ 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
1007
1006
  // ,customMessages: false,
1008
1007
  // overridePlaceholder: false, // might be good for IE10
1009
1008
  // replaceValidationUI: false
@@ -1054,7 +1053,7 @@
1054
1053
  addPolyfill(fNuAPI, {
1055
1054
  f: 'forms-ext',
1056
1055
  options: {
1057
- types: 'range date time number month'
1056
+ types: 'month date time range number'
1058
1057
  },
1059
1058
  test: function(){
1060
1059
  var ret = true;
@@ -1095,7 +1094,7 @@
1095
1094
  var o = this.options;
1096
1095
  initialFormTest();
1097
1096
  //input widgets on old on old androids can't be trusted
1098
- if(fShim == formExtend && (/Android/i).test(navigator.userAgent)){
1097
+ if(bustedWidgetUi && !o.replaceUI && (/Android/i).test(navigator.userAgent)){
1099
1098
  o.replaceUI = true;
1100
1099
  }
1101
1100
  return !o.replaceUI && modules[fNuAPI].test();
@@ -8,7 +8,7 @@ var swfmini = function() {
8
8
 
9
9
  var UNDEF = "undefined",
10
10
  OBJECT = "object",
11
- webshims = jQuery.webshims || window.webshims,
11
+ webshims = window.webshims,
12
12
  SHOCKWAVE_FLASH = "Shockwave Flash",
13
13
  SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
14
14
  FLASH_MIME_TYPE = "application/x-shockwave-flash",
@@ -573,6 +573,7 @@ webshims.register('form-core', function($, webshims, window, document, undefined
573
573
  $.expr[":"][name] = $.expr.filters[name+"-element"];
574
574
  });
575
575
 
576
+ //bug was partially fixed in 1.10.0 for IE9, but not IE8 (move to es5 as soon as 1.10.2 is used)
576
577
  var pseudoFocus = $.expr[":"].focus;
577
578
  $.expr[":"].focus = function(){
578
579
  try {
@@ -595,10 +596,18 @@ webshims.register('form-core', function($, webshims, window, document, undefined
595
596
  };
596
597
 
597
598
  var transClass = ('transitionDelay' in document.documentElement.style) ? '' : ' no-transition';
599
+ var poCFG = webshims.cfg.wspopover;
600
+ if(!poCFG.position && poCFG.position !== false){
601
+ poCFG.position = {
602
+ at: 'left bottom',
603
+ my: 'left top',
604
+ collision: 'fit flip'
605
+ };
606
+ }
598
607
  webshims.wsPopover = {
599
608
  id: 0,
600
609
  _create: function(){
601
- this.options = $.extend({}, webshims.cfg.wspopover, this.options);
610
+ this.options = $.extend(true, {}, poCFG, this.options);
602
611
  this.id = webshims.wsPopover.id++;
603
612
  this.eventns = '.wsoverlay' + this.id;
604
613
  this.timers = {};
@@ -645,6 +654,11 @@ webshims.register('form-core', function($, webshims, window, document, undefined
645
654
  var message = $(elem).data('errormessage') || elem.getAttribute('x-moz-errormessage') || '';
646
655
  if(key && message[key]){
647
656
  message = message[key];
657
+ } else if(message) {
658
+ validity = validity || $.prop(elem, 'validity') || {valid: 1};
659
+ if(validity.valid){
660
+ message = '';
661
+ }
648
662
  }
649
663
  if(typeof message == 'object'){
650
664
  validity = validity || $.prop(elem, 'validity') || {valid: 1};
@@ -733,8 +747,9 @@ webshims.register('form-core', function($, webshims, window, document, undefined
733
747
  })();
734
748
  });
735
749
 
736
- (function($, Modernizr, webshims){
750
+ (function(Modernizr, webshims){
737
751
  "use strict";
752
+ var $ = webshims.$;
738
753
  var hasNative = Modernizr.audio && Modernizr.video;
739
754
  var supportsLoop = false;
740
755
  var bugs = webshims.bugs;
@@ -838,6 +853,7 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
838
853
  hasSwf = swfmini.hasFlashPlayerVersion('9.0.115');
839
854
  $('html').addClass(hasSwf ? 'swf' : 'no-swf');
840
855
  var mediaelement = webshims.mediaelement;
856
+
841
857
  mediaelement.parseRtmp = function(data){
842
858
  var src = data.src.split('://');
843
859
  var paths = src[1].split('/');
@@ -1007,7 +1023,6 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
1007
1023
  var src = getSrcObj(mediaElem, nodeName);
1008
1024
 
1009
1025
  if(!src.src){
1010
-
1011
1026
  $('source', mediaElem).each(function(){
1012
1027
  src = getSrcObj(this, nodeName);
1013
1028
  if(src.src){srces.push(src);}
@@ -1022,18 +1037,10 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
1022
1037
  srces = [srces];
1023
1038
  }
1024
1039
  srces.forEach(function(src){
1025
- var source = document.createElement('source');
1026
1040
  if(typeof src == 'string'){
1027
1041
  src = {src: src};
1028
1042
  }
1029
- source.setAttribute('src', src.src);
1030
- if(src.type){
1031
- source.setAttribute('type', src.type);
1032
- }
1033
- if(src.media){
1034
- source.setAttribute('media', src.media);
1035
- }
1036
- mediaElem.append(source);
1043
+ mediaElem.append($(document.createElement('source')).attr(src));
1037
1044
  });
1038
1045
 
1039
1046
  }
@@ -1181,6 +1188,9 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
1181
1188
 
1182
1189
  if(!_srces.length || !parent || parent.nodeType != 1 || stopParent.test(parent.nodeName || '')){return;}
1183
1190
  data = data || webshims.data(elem, 'mediaelement');
1191
+ if(mediaelement.sortMedia){
1192
+ _srces.sort(mediaelement.sortMedia);
1193
+ }
1184
1194
  stepSources(elem, data, options.preferFlash || undefined, _srces);
1185
1195
  };
1186
1196
  mediaelement.selectSource = selectSource;
@@ -1355,4 +1365,4 @@ webshims.register('mediaelement-core', function($, webshims, window, document, u
1355
1365
  }
1356
1366
  webshims.ready('track', loadTrackUi);
1357
1367
  });
1358
- })(jQuery, Modernizr, webshims);
1368
+ })(Modernizr, webshims);
@@ -12,14 +12,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
12
12
  webshims.error("Webshims needs jQuery 1.8+ to work properly. Please update your jQuery version or downgrade webshims.");
13
13
  }
14
14
 
15
- if(webshims.cfg.extendNative == 1){
15
+ if(webshims.cfg.extendNative === 1){
16
16
  webshims.warn("extendNative configuration will be set to false by default with next release. In case you rely on it set it to 'true' otherwise to 'false'. See http://bit.ly/16OOTQO");
17
17
  }
18
18
 
19
19
  if (!webshims.cfg.no$Switch) {
20
20
  var switch$ = function(){
21
21
  if (window.jQuery && (!window.$ || window.jQuery == window.$) && !window.jQuery.webshims) {
22
- webshims.error("jQuery was included more than once. Make sure to include it only once or try the $.noConflict(extreme) feature! Webshims and other Plugins might not work properly..");
22
+ webshims.error("jQuery was included more than once. Make sure to include it only once or try the $.noConflict(extreme) feature! Webshims and other Plugins might not work properly. Or set webshims.cfg.no$Switch to 'true'.");
23
23
  if (window.$) {
24
24
  window.$ = webshims.$;
25
25
  }
@@ -561,6 +561,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
561
561
  setInterval(this.test, 600);
562
562
  $(this.test);
563
563
  webshims.ready('WINDOWLOAD', this.test);
564
+ $(document).on('updatelayout', this.handler);
564
565
  $(window).bind('resize', this.handler);
565
566
  (function(){
566
567
  var oldAnimate = $.fn.animate;
@@ -608,7 +609,9 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
608
609
 
609
610
  $(nativeElem).on('remove', function(e){
610
611
  if (!e.originalEvent) {
611
- $(shadowElem).remove();
612
+ setTimeout(function(){
613
+ $(shadowElem).remove();
614
+ }, 4);
612
615
  }
613
616
  });
614
617
 
@@ -1086,7 +1089,7 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1086
1089
  }
1087
1090
  });
1088
1091
 
1089
- })(jQuery, document);
1092
+ })(webshims.$, document);
1090
1093
 
1091
1094
  (function($){
1092
1095
 
@@ -1583,14 +1586,14 @@ webshims.register('dom-extend', function($, webshims, window, document, undefine
1583
1586
  webshims._polyfill(['es5']);
1584
1587
  }
1585
1588
  }
1586
- })(jQuery);
1589
+ })(window.webshims ? webshims.$ : jQuery);
1587
1590
  webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){
1588
1591
  "use strict";
1589
1592
  var curCfg;
1590
1593
  var formcfg = webshims.formcfg;
1591
1594
 
1592
1595
  var stopPropagation = function(e){
1593
- e.stopImmediatePropagation(e);
1596
+ e.stopImmediatePropagation();
1594
1597
  };
1595
1598
  var createFormat = function(name){
1596
1599
  if(!curCfg.patterns[name+'Obj']){
@@ -1661,6 +1664,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1661
1664
  number: {
1662
1665
  step: 1
1663
1666
  },
1667
+ // week: {
1668
+ // step: 1,
1669
+ // start: new Date(nowDate)
1670
+ // },
1664
1671
  time: {
1665
1672
  step: 60
1666
1673
  },
@@ -1863,6 +1870,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1863
1870
  time: function(val){
1864
1871
  return val;
1865
1872
  },
1873
+ week: function(val){
1874
+ return val;
1875
+ },
1866
1876
  //todo empty val for month/split
1867
1877
  month: function(val, options){
1868
1878
  var names;
@@ -1912,6 +1922,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1912
1922
  number: function(val){
1913
1923
  return (val+'').replace(curCfg.numberFormat[','], '').replace(curCfg.numberFormat['.'], '.');
1914
1924
  },
1925
+ // week: function(val){
1926
+ // return val;
1927
+ // },
1915
1928
  time: function(val){
1916
1929
  return val;
1917
1930
  },
@@ -2048,6 +2061,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2048
2061
  steps[this.type].start = this.asNumber(steps[this.type].start);
2049
2062
  }
2050
2063
 
2064
+ if(!webshims.picker[this.type]){
2065
+ o.buttonOnly = false;
2066
+ }
2067
+
2051
2068
  for(i = 0; i < createOpts.length; i++){
2052
2069
  if(o[createOpts[i]] != null){
2053
2070
  this[createOpts[i]](o[createOpts[i]], o[createOpts[i]]);
@@ -2059,6 +2076,11 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2059
2076
  this.addBindings();
2060
2077
  $(this.element).data('wsWidget'+o.type, this);
2061
2078
 
2079
+
2080
+ if(o.buttonOnly){
2081
+ this.inputElements.prop({readOnly: true});
2082
+ }
2083
+
2062
2084
  this._init = true;
2063
2085
 
2064
2086
  if(o.mirrorValidity){
@@ -2139,7 +2161,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2139
2161
  if(preventBlur.prevent){
2140
2162
  e.preventDefault();
2141
2163
  (isFocused || that.element.getShadowFocusElement()).focus();
2142
- e.stopImmediatePropagation();
2164
+ stopPropagation(e);
2143
2165
  return true;
2144
2166
  }
2145
2167
  };
@@ -2511,12 +2533,18 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2511
2533
  ['readonly', 'disabled'].forEach(function(name){
2512
2534
  var isDisabled = name == 'disabled';
2513
2535
  wsWidgetProto[name] = function(val, boolVal){
2514
- if(this.options[name] != boolVal || !this._init){
2515
- this.options[name] = !!boolVal;
2516
- this.inputElements.prop(name, this.options[name]);
2517
- this.buttonWrapper[this.options[name] ? 'addClass' : 'removeClass']('ws-'+name);
2536
+ var options = this.options;
2537
+ if(options[name] != boolVal || !this._init){
2538
+ options[name] = !!boolVal;
2539
+
2540
+ if(!isDisabled && options.buttonOnly){
2541
+ this.inputElements.attr({'aria-readonly': options[name]});
2542
+ } else {
2543
+ this.inputElements.prop(name, options[name]);
2544
+ }
2545
+ this.buttonWrapper[options[name] ? 'addClass' : 'removeClass']('ws-'+name);
2518
2546
  if(isDisabled){
2519
- $('button', this.buttonWrapper).prop('disabled', this.options[name]);
2547
+ $('button', this.buttonWrapper).prop('disabled', options[name]);
2520
2548
  }
2521
2549
  }
2522
2550
  };
@@ -2803,9 +2831,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2803
2831
 
2804
2832
 
2805
2833
  picker._common = function(data){
2806
- var popover = webshims.objectCreate(webshims.wsPopover, {}, {prepareFor: data.element});
2807
- var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper);
2808
2834
  var options = data.options;
2835
+ var popover = webshims.objectCreate(webshims.wsPopover, {}, {prepareFor: data.element, position: options.widgetPosition});
2836
+ var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper);
2837
+
2809
2838
 
2810
2839
  var showPickerContent = function(){
2811
2840
  (picker[data.type].showPickerContent || picker.showPickerContent)(data, popover);
@@ -2894,8 +2923,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2894
2923
  };
2895
2924
  data.inputElements.on({
2896
2925
  focus: function(){
2897
- if(!popover.stopOpen && (data.options.openOnFocus || (mouseFocus && options.openOnMouseFocus))){
2898
- popover.openedByFocus = !options.noInput;
2926
+ if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus))){
2927
+ popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
2899
2928
  show();
2900
2929
  } else {
2901
2930
  popover.preventBlur();
@@ -2904,8 +2933,15 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2904
2933
  mousedown: function(){
2905
2934
  mouseFocus = true;
2906
2935
  setTimeout(resetMouseFocus, 9);
2936
+ if(options.buttonOnly && popover.isVisible && popover.activeElement){
2937
+ popover.openedByFocus = false;
2938
+ setTimeout(function(){
2939
+ popover.openedByFocus = false;
2940
+ popover.activeElement.focus();
2941
+ }, 4);
2942
+ }
2907
2943
  if(data.element.is(':focus')){
2908
- popover.openedByFocus = !options.noInput;
2944
+ popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
2909
2945
  show();
2910
2946
  }
2911
2947
  popover.preventBlur();
@@ -2916,8 +2952,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2916
2952
  data.opener = opener;
2917
2953
  $(data.orig).on('remove', function(e){
2918
2954
  if(!e.originalEvent){
2919
- opener.remove();
2920
- popover.element.remove();
2955
+ setTimeout(function(){
2956
+ opener.remove();
2957
+ popover.element.remove();
2958
+ }, 4);
2921
2959
  }
2922
2960
  });
2923
2961
 
@@ -2926,6 +2964,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2926
2964
 
2927
2965
  picker.month = picker._common;
2928
2966
  picker.date = picker._common;
2967
+ // picker.week = picker._common;
2929
2968
  picker.color = function(data){
2930
2969
  var ret = picker._common.apply(this, arguments);
2931
2970
  var alpha = $(data.orig).data('alphacontrol');
@@ -3177,10 +3216,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
3177
3216
  data.shim.element.addClass('has-input-buttons');
3178
3217
  }
3179
3218
 
3219
+ data.shim.element.addClass($.prop(this, 'className'));
3220
+
3180
3221
  if(opts.calculateWidth){
3181
3222
  sizeInput(data.shim);
3182
3223
  } else {
3183
- $(this).css({display: 'none'});
3224
+ $(this).addClass('ws-important-hide');
3184
3225
  }
3185
3226
  }
3186
3227
 
@@ -493,14 +493,14 @@
493
493
  webshims._polyfill(['es5']);
494
494
  }
495
495
  }
496
- })(jQuery);
496
+ })(window.webshims ? webshims.$ : jQuery);
497
497
  webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){
498
498
  "use strict";
499
499
  var curCfg;
500
500
  var formcfg = webshims.formcfg;
501
501
 
502
502
  var stopPropagation = function(e){
503
- e.stopImmediatePropagation(e);
503
+ e.stopImmediatePropagation();
504
504
  };
505
505
  var createFormat = function(name){
506
506
  if(!curCfg.patterns[name+'Obj']){
@@ -571,6 +571,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
571
571
  number: {
572
572
  step: 1
573
573
  },
574
+ // week: {
575
+ // step: 1,
576
+ // start: new Date(nowDate)
577
+ // },
574
578
  time: {
575
579
  step: 60
576
580
  },
@@ -773,6 +777,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
773
777
  time: function(val){
774
778
  return val;
775
779
  },
780
+ week: function(val){
781
+ return val;
782
+ },
776
783
  //todo empty val for month/split
777
784
  month: function(val, options){
778
785
  var names;
@@ -822,6 +829,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
822
829
  number: function(val){
823
830
  return (val+'').replace(curCfg.numberFormat[','], '').replace(curCfg.numberFormat['.'], '.');
824
831
  },
832
+ // week: function(val){
833
+ // return val;
834
+ // },
825
835
  time: function(val){
826
836
  return val;
827
837
  },
@@ -958,6 +968,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
958
968
  steps[this.type].start = this.asNumber(steps[this.type].start);
959
969
  }
960
970
 
971
+ if(!webshims.picker[this.type]){
972
+ o.buttonOnly = false;
973
+ }
974
+
961
975
  for(i = 0; i < createOpts.length; i++){
962
976
  if(o[createOpts[i]] != null){
963
977
  this[createOpts[i]](o[createOpts[i]], o[createOpts[i]]);
@@ -969,6 +983,11 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
969
983
  this.addBindings();
970
984
  $(this.element).data('wsWidget'+o.type, this);
971
985
 
986
+
987
+ if(o.buttonOnly){
988
+ this.inputElements.prop({readOnly: true});
989
+ }
990
+
972
991
  this._init = true;
973
992
 
974
993
  if(o.mirrorValidity){
@@ -1049,7 +1068,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1049
1068
  if(preventBlur.prevent){
1050
1069
  e.preventDefault();
1051
1070
  (isFocused || that.element.getShadowFocusElement()).focus();
1052
- e.stopImmediatePropagation();
1071
+ stopPropagation(e);
1053
1072
  return true;
1054
1073
  }
1055
1074
  };
@@ -1421,12 +1440,18 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1421
1440
  ['readonly', 'disabled'].forEach(function(name){
1422
1441
  var isDisabled = name == 'disabled';
1423
1442
  wsWidgetProto[name] = function(val, boolVal){
1424
- if(this.options[name] != boolVal || !this._init){
1425
- this.options[name] = !!boolVal;
1426
- this.inputElements.prop(name, this.options[name]);
1427
- this.buttonWrapper[this.options[name] ? 'addClass' : 'removeClass']('ws-'+name);
1443
+ var options = this.options;
1444
+ if(options[name] != boolVal || !this._init){
1445
+ options[name] = !!boolVal;
1446
+
1447
+ if(!isDisabled && options.buttonOnly){
1448
+ this.inputElements.attr({'aria-readonly': options[name]});
1449
+ } else {
1450
+ this.inputElements.prop(name, options[name]);
1451
+ }
1452
+ this.buttonWrapper[options[name] ? 'addClass' : 'removeClass']('ws-'+name);
1428
1453
  if(isDisabled){
1429
- $('button', this.buttonWrapper).prop('disabled', this.options[name]);
1454
+ $('button', this.buttonWrapper).prop('disabled', options[name]);
1430
1455
  }
1431
1456
  }
1432
1457
  };
@@ -1713,9 +1738,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1713
1738
 
1714
1739
 
1715
1740
  picker._common = function(data){
1716
- var popover = webshims.objectCreate(webshims.wsPopover, {}, {prepareFor: data.element});
1717
- var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper);
1718
1741
  var options = data.options;
1742
+ var popover = webshims.objectCreate(webshims.wsPopover, {}, {prepareFor: data.element, position: options.widgetPosition});
1743
+ var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper);
1744
+
1719
1745
 
1720
1746
  var showPickerContent = function(){
1721
1747
  (picker[data.type].showPickerContent || picker.showPickerContent)(data, popover);
@@ -1804,8 +1830,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1804
1830
  };
1805
1831
  data.inputElements.on({
1806
1832
  focus: function(){
1807
- if(!popover.stopOpen && (data.options.openOnFocus || (mouseFocus && options.openOnMouseFocus))){
1808
- popover.openedByFocus = !options.noInput;
1833
+ if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus))){
1834
+ popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
1809
1835
  show();
1810
1836
  } else {
1811
1837
  popover.preventBlur();
@@ -1814,8 +1840,15 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1814
1840
  mousedown: function(){
1815
1841
  mouseFocus = true;
1816
1842
  setTimeout(resetMouseFocus, 9);
1843
+ if(options.buttonOnly && popover.isVisible && popover.activeElement){
1844
+ popover.openedByFocus = false;
1845
+ setTimeout(function(){
1846
+ popover.openedByFocus = false;
1847
+ popover.activeElement.focus();
1848
+ }, 4);
1849
+ }
1817
1850
  if(data.element.is(':focus')){
1818
- popover.openedByFocus = !options.noInput;
1851
+ popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
1819
1852
  show();
1820
1853
  }
1821
1854
  popover.preventBlur();
@@ -1826,8 +1859,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1826
1859
  data.opener = opener;
1827
1860
  $(data.orig).on('remove', function(e){
1828
1861
  if(!e.originalEvent){
1829
- opener.remove();
1830
- popover.element.remove();
1862
+ setTimeout(function(){
1863
+ opener.remove();
1864
+ popover.element.remove();
1865
+ }, 4);
1831
1866
  }
1832
1867
  });
1833
1868
 
@@ -1836,6 +1871,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
1836
1871
 
1837
1872
  picker.month = picker._common;
1838
1873
  picker.date = picker._common;
1874
+ // picker.week = picker._common;
1839
1875
  picker.color = function(data){
1840
1876
  var ret = picker._common.apply(this, arguments);
1841
1877
  var alpha = $(data.orig).data('alphacontrol');
@@ -2087,10 +2123,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
2087
2123
  data.shim.element.addClass('has-input-buttons');
2088
2124
  }
2089
2125
 
2126
+ data.shim.element.addClass($.prop(this, 'className'));
2127
+
2090
2128
  if(opts.calculateWidth){
2091
2129
  sizeInput(data.shim);
2092
2130
  } else {
2093
- $(this).css({display: 'none'});
2131
+ $(this).addClass('ws-important-hide');
2094
2132
  }
2095
2133
  }
2096
2134