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.
- checksums.yaml +8 -8
- data/lib/webshims-rails/version.rb +2 -2
- data/vendor/assets/javascripts/webshims/polyfiller.js +41 -20
- data/vendor/assets/javascripts/webshims/shims/combos/10.js +212 -42
- data/vendor/assets/javascripts/webshims/shims/combos/11.js +196 -37
- data/vendor/assets/javascripts/webshims/shims/combos/12.js +82 -36
- data/vendor/assets/javascripts/webshims/shims/combos/13.js +82 -36
- data/vendor/assets/javascripts/webshims/shims/combos/14.js +17 -6
- data/vendor/assets/javascripts/webshims/shims/combos/15.js +234 -1247
- data/vendor/assets/javascripts/webshims/shims/combos/16.js +234 -1247
- data/vendor/assets/javascripts/webshims/shims/combos/17.js +202 -45
- data/vendor/assets/javascripts/webshims/shims/combos/18.js +202 -45
- data/vendor/assets/javascripts/webshims/shims/combos/19.js +16 -5
- data/vendor/assets/javascripts/webshims/shims/combos/2.js +51 -11
- data/vendor/assets/javascripts/webshims/shims/combos/20.js +16 -5
- data/vendor/assets/javascripts/webshims/shims/combos/21.js +82 -36
- data/vendor/assets/javascripts/webshims/shims/combos/22.js +82 -36
- data/vendor/assets/javascripts/webshims/shims/combos/24.js +1689 -997
- data/vendor/assets/javascripts/webshims/shims/combos/25.js +16 -5
- data/vendor/assets/javascripts/webshims/shims/combos/26.js +16 -5
- data/vendor/assets/javascripts/webshims/shims/combos/3.js +16 -5
- data/vendor/assets/javascripts/webshims/shims/combos/30.js +51 -11
- data/vendor/assets/javascripts/webshims/shims/combos/31.js +51 -11
- data/vendor/assets/javascripts/webshims/shims/combos/4.js +16 -5
- data/vendor/assets/javascripts/webshims/shims/combos/5.js +202 -45
- data/vendor/assets/javascripts/webshims/shims/combos/6.js +237 -51
- data/vendor/assets/javascripts/webshims/shims/combos/7.js +51 -11
- data/vendor/assets/javascripts/webshims/shims/combos/8.js +16 -5
- data/vendor/assets/javascripts/webshims/shims/combos/9.js +247 -48
- data/vendor/assets/javascripts/webshims/shims/dom-extend.js +17 -5
- data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +21 -3
- data/vendor/assets/javascripts/webshims/shims/form-datalist.js +35 -6
- data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +6 -8
- data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +134 -24
- data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +152 -1205
- data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +1076 -0
- data/vendor/assets/javascripts/webshims/shims/form-validation.js +47 -20
- data/vendor/assets/javascripts/webshims/shims/form-validators.js +2 -2
- data/vendor/assets/javascripts/webshims/shims/forms-picker.js +1 -1
- data/vendor/assets/javascripts/webshims/shims/i18n/{formcfg-de.txt → formcfg-de.js} +3 -0
- data/vendor/assets/javascripts/webshims/shims/i18n/{formcfg-en.txt → formcfg-en.js} +5 -1
- data/vendor/assets/javascripts/webshims/shims/json-storage.js +1 -1
- data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +1 -1
- data/vendor/assets/javascripts/webshims/shims/range-ui.js +62 -13
- data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +610 -0
- data/vendor/assets/javascripts/webshims/shims/styles/scss/_extends.scss +10 -0
- data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +743 -0
- data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +1 -755
- data/vendor/assets/javascripts/webshims/shims/styles/shim.css +0 -606
- data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/track-ui.js +36 -23
- data/vendor/assets/javascripts/webshims/shims/track.js +82 -36
- metadata +8 -6
- data/vendor/assets/javascripts/webshims/shims/combos/28.js +0 -2196
- data/vendor/assets/javascripts/webshims/shims/combos/29.js +0 -1167
@@ -16,9 +16,9 @@
|
|
16
16
|
var i;
|
17
17
|
|
18
18
|
|
19
|
-
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>');
|
20
|
-
this.trail = $('.ws-range-
|
21
|
-
this.range = $('.ws-range-
|
19
|
+
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>');
|
20
|
+
this.trail = $('.ws-range-track', this.element);
|
21
|
+
this.range = $('.ws-range-progress ', this.element);
|
22
22
|
this.thumb = $('.ws-range-thumb', this.trail);
|
23
23
|
|
24
24
|
this.updateMetrics();
|
@@ -28,6 +28,7 @@
|
|
28
28
|
for(i = 0; i < createOpts.length; i++){
|
29
29
|
this[createOpts[i]](this.options[createOpts[i]]);
|
30
30
|
}
|
31
|
+
|
31
32
|
this.value = this._value;
|
32
33
|
this.value(this.options.value);
|
33
34
|
this.initDataList();
|
@@ -266,7 +267,7 @@
|
|
266
267
|
}
|
267
268
|
},
|
268
269
|
addBindings: function(){
|
269
|
-
var leftOffset, widgetUnits, hasFocus;
|
270
|
+
var leftOffset, widgetUnits, hasFocus, isActive;
|
270
271
|
var that = this;
|
271
272
|
var o = this.options;
|
272
273
|
|
@@ -296,8 +297,28 @@
|
|
296
297
|
}
|
297
298
|
};
|
298
299
|
})();
|
299
|
-
|
300
|
+
var normalizeTouch = (function(){
|
301
|
+
var types = {
|
302
|
+
touchstart: 1,
|
303
|
+
touchend: 1,
|
304
|
+
touchmove: 1
|
305
|
+
};
|
306
|
+
var normalize = ['pageX', 'pageY'];
|
307
|
+
return function(e){
|
308
|
+
if(types[e.type] && e.originalEvent && e.originalEvent.touches && e.originalEvent.touches.length){
|
309
|
+
for(var i = 0; i < normalize.length; i++){
|
310
|
+
e[normalize[i]] = e.originalEvent.touches[0][normalize[i]];
|
311
|
+
}
|
312
|
+
|
313
|
+
}
|
314
|
+
return e;
|
315
|
+
};
|
316
|
+
})();
|
300
317
|
var setValueFromPos = function(e, animate){
|
318
|
+
if(e.type == 'touchmove'){
|
319
|
+
e.preventDefault();
|
320
|
+
normalizeTouch(e);
|
321
|
+
}
|
301
322
|
|
302
323
|
var val = that.getStepedValueFromPos((e[that.dirs.mouse] - leftOffset) * widgetUnits);
|
303
324
|
if(val != o.value){
|
@@ -314,18 +335,25 @@
|
|
314
335
|
eventTimer.call('change', o.value);
|
315
336
|
}
|
316
337
|
that.addRemoveClass('ws-active');
|
317
|
-
$(document).off('mousemove', setValueFromPos).off('mouseup', remove);
|
338
|
+
$(document).off('mousemove touchmove', setValueFromPos).off('mouseup touchend', remove);
|
318
339
|
$(window).off('blur', removeWin);
|
340
|
+
isActive = false;
|
319
341
|
};
|
320
342
|
var removeWin = function(e){
|
321
343
|
if(e.target == window){remove();}
|
322
344
|
};
|
323
345
|
var add = function(e){
|
324
346
|
var outerWidth;
|
347
|
+
|
348
|
+
if(isActive || (e.type == 'touchstart' && (!e.originalEvent || !e.originalEvent.touches || e.originalEvent.touches.length != 1))){
|
349
|
+
return;
|
350
|
+
}
|
325
351
|
e.preventDefault();
|
326
|
-
|
352
|
+
|
353
|
+
$(document).off('mousemove touchmove', setValueFromPos).off('mouseup touchend', remove);
|
327
354
|
$(window).off('blur', removeWin);
|
328
355
|
if(!o.readonly && !o.disabled){
|
356
|
+
normalizeTouch(e);
|
329
357
|
that.element.focus();
|
330
358
|
that.addRemoveClass('ws-active', true);
|
331
359
|
leftOffset = that.element.focus().offset();
|
@@ -335,20 +363,27 @@
|
|
335
363
|
leftOffset = leftOffset[that.dirs.pos];
|
336
364
|
widgetUnits = 100 / widgetUnits;
|
337
365
|
setValueFromPos(e, o.animate);
|
366
|
+
isActive = true;
|
338
367
|
$(document)
|
339
|
-
.on(
|
340
|
-
|
341
|
-
|
342
|
-
|
368
|
+
.on(e.type == 'touchstart' ?
|
369
|
+
{
|
370
|
+
touchend: remove,
|
371
|
+
touchmove: setValueFromPos
|
372
|
+
} :
|
373
|
+
{
|
374
|
+
mouseup: remove,
|
375
|
+
mousemove: setValueFromPos
|
376
|
+
}
|
377
|
+
)
|
343
378
|
;
|
344
379
|
$(window).on('blur', removeWin);
|
345
380
|
e.stopPropagation();
|
346
381
|
}
|
347
382
|
};
|
348
383
|
var elementEvts = {
|
349
|
-
mousedown: add,
|
384
|
+
'touchstart mousedown': add,
|
350
385
|
focus: function(e){
|
351
|
-
if(!o.disabled){
|
386
|
+
if(!o.disabled && !hasFocus){
|
352
387
|
eventTimer.init('input', o.value);
|
353
388
|
eventTimer.init('change', o.value);
|
354
389
|
that.addRemoveClass('ws-focus', true);
|
@@ -411,6 +446,20 @@
|
|
411
446
|
this.thumb.on({
|
412
447
|
mousedown: add
|
413
448
|
});
|
449
|
+
|
450
|
+
if(this.orig){
|
451
|
+
$(this.orig).jProp('form').on('reset', function(){
|
452
|
+
var val = $.prop(that.orig, 'value');
|
453
|
+
that.value(val);
|
454
|
+
setTimeout(function(){
|
455
|
+
var val2 = $.prop(that.orig, 'value');
|
456
|
+
if(val != val2){
|
457
|
+
that.value(val2);
|
458
|
+
}
|
459
|
+
}, 4);
|
460
|
+
});
|
461
|
+
}
|
462
|
+
|
414
463
|
if (window.webshims) {
|
415
464
|
webshims.ready('WINDOWLOAD', function(){
|
416
465
|
webshims.ready('dom-support', function(){
|
@@ -516,8 +565,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
516
565
|
var str;
|
517
566
|
return function(){
|
518
567
|
if(!str){
|
519
|
-
str = ('<option></option>')+$.map(monthDigits, function(val){
|
520
|
-
return '<option>'+val+'</option>';
|
568
|
+
str = ('<option value=""></option>')+$.map(monthDigits, function(val){
|
569
|
+
return '<option value="'+val+'"]>'+val+'</option>';
|
521
570
|
}).join('');
|
522
571
|
}
|
523
572
|
return str;
|
@@ -539,7 +588,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
539
588
|
splits: [$('<input type="text" class="yy" size="4" inputmode="numeric" />')[0]]
|
540
589
|
};
|
541
590
|
if(opts.monthSelect){
|
542
|
-
obj.splits.push($('<select class="mm">'+getMonthOptions()+'</select>')[0]);
|
591
|
+
obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
|
543
592
|
} else {
|
544
593
|
obj.splits.push($('<input type="text" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0]);
|
545
594
|
}
|
@@ -574,7 +623,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
574
623
|
splits: [$('<input type="text" class="yy" inputmode="numeric" size="4" />')[0]]
|
575
624
|
};
|
576
625
|
if(opts.monthSelect){
|
577
|
-
obj.splits.push($('<select class="mm ws-spin">'+getMonthOptions()+'</select>')[0]);
|
626
|
+
obj.splits.push($('<select class="mm ws-spin">'+getMonthOptions(opts)+'</select>')[0]);
|
578
627
|
} else {
|
579
628
|
obj.splits.push($('<input type="text" class="mm ws-spin" />')[0]);
|
580
629
|
if(opts.onlyMonthDigits){
|
@@ -666,6 +715,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
666
715
|
month: {
|
667
716
|
currentText: 'Aktueller Monat'
|
668
717
|
},
|
718
|
+
time: {
|
719
|
+
currentText: 'Jetzt'
|
720
|
+
},
|
669
721
|
date: {
|
670
722
|
close: 'schließen',
|
671
723
|
clear: 'Löschen',
|
@@ -703,6 +755,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
703
755
|
month: {
|
704
756
|
currentText: 'This month'
|
705
757
|
},
|
758
|
+
time: {
|
759
|
+
"currentText": "Now"
|
760
|
+
},
|
706
761
|
date: {
|
707
762
|
"closeText": "Done",
|
708
763
|
clear: 'Clear',
|
@@ -765,6 +820,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
765
820
|
if(!langCfg['datetime-localSigns']){
|
766
821
|
langCfg['datetime-localSigns'] = langCfg.dateSigns+langCfg.timeSigns;
|
767
822
|
}
|
823
|
+
if(!langCfg['datetime-local']){
|
824
|
+
langCfg['datetime-local'] = {};
|
825
|
+
}
|
826
|
+
if(!langCfg['datetime-local'].currentText && langCfg.time.currentText){
|
827
|
+
langCfg['datetime-local'].currentText = langCfg.time.currentText;
|
828
|
+
}
|
768
829
|
};
|
769
830
|
var triggerLocaleChange = function(){
|
770
831
|
processLangCFG(curCfg);
|
@@ -832,6 +893,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
832
893
|
} else {
|
833
894
|
fVal = 0;
|
834
895
|
}
|
896
|
+
if(val[0] === '00'){
|
897
|
+
val[0] = '12';
|
898
|
+
}
|
835
899
|
val = $.trim(val.join(':')) + ' '+ curCfg.meridian[fVal];
|
836
900
|
}
|
837
901
|
return val;
|
@@ -916,6 +980,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
916
980
|
time: function(val){
|
917
981
|
var fVal;
|
918
982
|
if(val && curCfg.meridian){
|
983
|
+
if(val.substr(0,2) === "12"){
|
984
|
+
val = "00" + val.substr(2);
|
985
|
+
}
|
919
986
|
if(val.indexOf(curCfg.meridian[1]) != -1){
|
920
987
|
val = val.split(':');
|
921
988
|
fVal = (val[0] * 1);
|
@@ -1001,7 +1068,10 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1001
1068
|
if(hintValue.length == 2){
|
1002
1069
|
hintValue = opts.splitInput ?
|
1003
1070
|
hintValue :
|
1004
|
-
curCfg.
|
1071
|
+
curCfg.date.showMonthAfterYear ?
|
1072
|
+
hintValue[0] +' '+hintValue[1] :
|
1073
|
+
|
1074
|
+
hintValue[1] +' '+ hintValue[0];
|
1005
1075
|
} else {
|
1006
1076
|
hintValue = opts.splitInput ?
|
1007
1077
|
[val, val] :
|
@@ -1376,10 +1446,18 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1376
1446
|
}
|
1377
1447
|
try {
|
1378
1448
|
that.elemHelper[name](factor);
|
1449
|
+
|
1379
1450
|
ret = that.elemHelper.prop('value');
|
1451
|
+
|
1452
|
+
} catch (er) {
|
1453
|
+
if(!o.value && that.maxAsNumber >= that.minAsNumber){
|
1454
|
+
ret = o.defValue;
|
1455
|
+
}
|
1456
|
+
}
|
1457
|
+
if(ret !== false && o.value != ret){
|
1380
1458
|
that.value(ret);
|
1381
1459
|
eventTimer.call('input', ret);
|
1382
|
-
}
|
1460
|
+
}
|
1383
1461
|
return ret;
|
1384
1462
|
}
|
1385
1463
|
};
|
@@ -1445,15 +1523,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1445
1523
|
|
1446
1524
|
initChangeEvents();
|
1447
1525
|
},
|
1448
|
-
value: function(val, force){
|
1449
|
-
if(!this._init || force || val !== this.options.value){
|
1450
|
-
this.element.val(this.formatValue(val));
|
1451
|
-
this.options.value = val;
|
1452
|
-
this._propertyChange('value');
|
1453
|
-
this.mirrorValidity();
|
1454
|
-
}
|
1455
|
-
|
1456
|
-
},
|
1457
1526
|
required: function(val, boolVal){
|
1458
1527
|
this.inputElements.attr({'aria-required': ''+boolVal});
|
1459
1528
|
this.mirrorValidity();
|
@@ -1470,7 +1539,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1470
1539
|
formatValue: function(val, noSplit){
|
1471
1540
|
return formatVal[this.type](val, noSplit === false ? false : this.options);
|
1472
1541
|
},
|
1473
|
-
createOpts: ['readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'value', 'required'],
|
1542
|
+
createOpts: ['readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'defaultValue', 'value', 'required'],
|
1474
1543
|
placeholder: function(val){
|
1475
1544
|
var options = this.options;
|
1476
1545
|
options.placeholder = val;
|
@@ -1540,6 +1609,16 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1540
1609
|
}
|
1541
1610
|
};
|
1542
1611
|
|
1612
|
+
['defaultValue', 'value'].forEach(function(name){
|
1613
|
+
wsWidgetProto[name] = function(val, force){
|
1614
|
+
if(!this._init || force || val !== this.options[name]){
|
1615
|
+
this.element.prop(name, this.formatValue(val));
|
1616
|
+
this.options[name] = val;
|
1617
|
+
this._propertyChange(name);
|
1618
|
+
this.mirrorValidity();
|
1619
|
+
}
|
1620
|
+
};
|
1621
|
+
});
|
1543
1622
|
|
1544
1623
|
['readonly', 'disabled'].forEach(function(name){
|
1545
1624
|
var isDisabled = name == 'disabled';
|
@@ -1593,7 +1672,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1593
1672
|
}
|
1594
1673
|
this._init = true;
|
1595
1674
|
},
|
1596
|
-
createOpts: ['step', 'min', 'max', 'readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'value', 'required'],
|
1675
|
+
createOpts: ['step', 'min', 'max', 'readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'defaultValue', 'value', 'required'],
|
1597
1676
|
_addSplitInputs: function(){
|
1598
1677
|
if(!this.inputElements){
|
1599
1678
|
var create = splitInputs[this.type]._create(this.options);
|
@@ -1663,9 +1742,47 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1663
1742
|
this.options.step = val;
|
1664
1743
|
this.elemHelper.prop('step', retDefault(val, defStep.step));
|
1665
1744
|
this.mirrorValidity();
|
1745
|
+
},
|
1746
|
+
_beforeValue: function(val){
|
1747
|
+
this.valueAsNumber = this.asNumber(val);
|
1748
|
+
this.options.value = val;
|
1749
|
+
|
1750
|
+
if(isNaN(this.valueAsNumber) || (!isNaN(this.minAsNumber) && this.valueAsNumber < this.minAsNumber) || (!isNaN(this.maxAsNumber) && this.valueAsNumber > this.maxAsNumber)){
|
1751
|
+
this._setStartInRange();
|
1752
|
+
} else {
|
1753
|
+
this.elemHelper.prop('value', val);
|
1754
|
+
this.options.defValue = "";
|
1755
|
+
}
|
1666
1756
|
}
|
1667
1757
|
});
|
1668
1758
|
|
1759
|
+
['defaultValue', 'value'].forEach(function(name){
|
1760
|
+
var isValue = name == 'value';
|
1761
|
+
spinBtnProto[name] = function(val, force){
|
1762
|
+
if(!this._init || force || this.options[name] !== val){
|
1763
|
+
if(isValue){
|
1764
|
+
this._beforeValue(val);
|
1765
|
+
}
|
1766
|
+
|
1767
|
+
val = formatVal[this.type](val, this.options);
|
1768
|
+
if(this.options.splitInput){
|
1769
|
+
$.each(this.splits, function(i, elem){
|
1770
|
+
var setOption;
|
1771
|
+
if(!(name in elem) && !isValue && $.nodeName(elem, 'select')){
|
1772
|
+
$('option[value="'+ val[i] +'"]', elem).prop('defaultSelected', true);
|
1773
|
+
} else {
|
1774
|
+
$.prop(elem, name, val[i]);
|
1775
|
+
}
|
1776
|
+
});
|
1777
|
+
} else {
|
1778
|
+
this.element.prop(name, val);
|
1779
|
+
}
|
1780
|
+
this._propertyChange(name);
|
1781
|
+
this.mirrorValidity();
|
1782
|
+
}
|
1783
|
+
};
|
1784
|
+
});
|
1785
|
+
|
1669
1786
|
$.each({min: 1, max: -1}, function(name, factor){
|
1670
1787
|
var numName = name +'AsNumber';
|
1671
1788
|
spinBtnProto[name] = function(val){
|
@@ -2069,10 +2186,12 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
2069
2186
|
var inputTypes = {
|
2070
2187
|
|
2071
2188
|
};
|
2189
|
+
var boolAttrs = {disabled: 1, required: 1, readonly: 1};
|
2072
2190
|
var copyProps = [
|
2073
2191
|
'disabled',
|
2074
2192
|
'readonly',
|
2075
2193
|
'value',
|
2194
|
+
'defaultValue',
|
2076
2195
|
'min',
|
2077
2196
|
'max',
|
2078
2197
|
'step',
|
@@ -2090,14 +2209,18 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
2090
2209
|
if(!stopCircular){
|
2091
2210
|
var shadowData = webshims.data(this, 'shadowData');
|
2092
2211
|
if(shadowData && shadowData.data && shadowData.nativeElement === this && shadowData.data[fnName]){
|
2093
|
-
|
2212
|
+
if(boolAttrs[fnName]){
|
2213
|
+
shadowData.data[fnName](val, boolVal);
|
2214
|
+
} else {
|
2215
|
+
shadowData.data[fnName](val);
|
2216
|
+
}
|
2094
2217
|
}
|
2095
2218
|
}
|
2096
2219
|
});
|
2097
2220
|
});
|
2098
2221
|
|
2099
2222
|
if(options.replaceUI && 'valueAsNumber' in document.createElement('input')){
|
2100
|
-
var reflectFn = function(
|
2223
|
+
var reflectFn = function(){
|
2101
2224
|
if(webshims.data(this, 'hasShadow')){
|
2102
2225
|
$.prop(this, 'value', $.prop(this, 'value'));
|
2103
2226
|
}
|
@@ -2105,6 +2228,20 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
2105
2228
|
|
2106
2229
|
webshims.onNodeNamesPropertyModify('input', 'valueAsNumber', reflectFn);
|
2107
2230
|
webshims.onNodeNamesPropertyModify('input', 'valueAsDate', reflectFn);
|
2231
|
+
$.each({stepUp: 1, stepDown: -1}, function(name, stepFactor){
|
2232
|
+
var stepDescriptor = webshims.defineNodeNameProperty('input', name, {
|
2233
|
+
prop: {
|
2234
|
+
value: function(){
|
2235
|
+
var ret;
|
2236
|
+
if(stepDescriptor.prop && stepDescriptor.prop._supvalue){
|
2237
|
+
ret = stepDescriptor.prop._supvalue.apply(this, arguments);
|
2238
|
+
reflectFn.apply(this, arguments);
|
2239
|
+
}
|
2240
|
+
return ret;
|
2241
|
+
}
|
2242
|
+
}
|
2243
|
+
});
|
2244
|
+
});
|
2108
2245
|
}
|
2109
2246
|
|
2110
2247
|
var extendType = (function(){
|
@@ -2124,7 +2261,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
2124
2261
|
$(data.orig).removeClass('ws-important-hide');
|
2125
2262
|
$.style( data.orig, 'display', '' );
|
2126
2263
|
var hasButtons, marginR, marginL;
|
2127
|
-
var correctWidth = 0.
|
2264
|
+
var correctWidth = 0.8;
|
2128
2265
|
if(!init || data.orig.offsetWidth){
|
2129
2266
|
hasButtons = data.buttonWrapper && data.buttonWrapper.filter(isVisible).length;
|
2130
2267
|
marginR = $.css( data.orig, 'marginRight');
|
@@ -2148,7 +2285,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
2148
2285
|
;
|
2149
2286
|
} else {
|
2150
2287
|
data.buttonWrapper.css('marginRight', marginR);
|
2151
|
-
correctWidth = data.buttonWrapper.outerWidth(true) +
|
2288
|
+
correctWidth = data.buttonWrapper.outerWidth(true) + correctWidth;
|
2152
2289
|
}
|
2153
2290
|
}
|
2154
2291
|
|
@@ -2306,7 +2443,29 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
2306
2443
|
});
|
2307
2444
|
}
|
2308
2445
|
|
2309
|
-
|
2446
|
+
var replace = {};
|
2447
|
+
|
2448
|
+
|
2449
|
+
if(options.replaceUI){
|
2450
|
+
if( $.isPlainObject(options.replaceUI) ){
|
2451
|
+
$.extend(replace, options.replaceUI);
|
2452
|
+
} else {
|
2453
|
+
$.extend(replace, {
|
2454
|
+
'range': 1,
|
2455
|
+
'number': 1,
|
2456
|
+
'time': 1,
|
2457
|
+
'month': 1,
|
2458
|
+
'date': 1,
|
2459
|
+
'color': 1,
|
2460
|
+
'datetime-local': 1
|
2461
|
+
});
|
2462
|
+
}
|
2463
|
+
}
|
2464
|
+
if(modernizrInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && ((/MSIE 1[0|1]\.\d/.test(navigator.userAgent)) || (/Trident\/7\.0/.test(navigator.userAgent)))){
|
2465
|
+
replace.number = 1;
|
2466
|
+
}
|
2467
|
+
|
2468
|
+
if(!modernizrInputTypes.range || replace.range){
|
2310
2469
|
extendType('range', {
|
2311
2470
|
_create: function(opts, set){
|
2312
2471
|
var data = $('<span />').insertAfter(opts.orig).rangeUI(opts).data('rangeUi');
|
@@ -2315,9 +2474,9 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
2315
2474
|
});
|
2316
2475
|
}
|
2317
2476
|
|
2318
|
-
|
2477
|
+
|
2319
2478
|
['number', 'time', 'month', 'date', 'color', 'datetime-local'].forEach(function(name){
|
2320
|
-
if(!modernizrInputTypes[name] ||
|
2479
|
+
if(!modernizrInputTypes[name] || replace[name]){
|
2321
2480
|
extendType(name, {
|
2322
2481
|
_create: function(opts, set){
|
2323
2482
|
if(opts.monthSelect){
|