webshims-rails 1.11.3.1 → 1.11.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webshims-rails/version.rb +2 -2
- data/vendor/assets/javascripts/webshims/extras/modernizr-custom.js +114 -104
- data/vendor/assets/javascripts/webshims/extras/mousepress.js +5 -5
- data/vendor/assets/javascripts/webshims/polyfiller.js +156 -207
- data/vendor/assets/javascripts/webshims/shims/$ajax.js +862 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.js +20 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flashcanvas.js +20 -0
- data/vendor/assets/javascripts/webshims/shims/color-picker.js +12 -12
- data/vendor/assets/javascripts/webshims/shims/combos/1.js +62 -32
- data/vendor/assets/javascripts/webshims/shims/combos/10.js +192 -509
- data/vendor/assets/javascripts/webshims/shims/combos/11.js +96 -415
- data/vendor/assets/javascripts/webshims/shims/combos/12.js +36 -26
- data/vendor/assets/javascripts/webshims/shims/combos/13.js +36 -26
- data/vendor/assets/javascripts/webshims/shims/combos/14.js +1007 -359
- data/vendor/assets/javascripts/webshims/shims/combos/15.js +310 -235
- data/vendor/assets/javascripts/webshims/shims/combos/16.js +313 -237
- data/vendor/assets/javascripts/webshims/shims/combos/17.js +96 -415
- data/vendor/assets/javascripts/webshims/shims/combos/18.js +1003 -678
- data/vendor/assets/javascripts/webshims/shims/combos/19.js +1085 -387
- data/vendor/assets/javascripts/webshims/shims/combos/2.js +161 -127
- data/vendor/assets/javascripts/webshims/shims/combos/20.js +1086 -388
- data/vendor/assets/javascripts/webshims/shims/combos/21.js +168 -96
- data/vendor/assets/javascripts/webshims/shims/combos/22.js +36 -27
- data/vendor/assets/javascripts/webshims/shims/combos/23.js +2 -1
- data/vendor/assets/javascripts/webshims/shims/combos/24.js +411 -172
- data/vendor/assets/javascripts/webshims/shims/combos/25.js +1085 -387
- data/vendor/assets/javascripts/webshims/shims/combos/26.js +96 -94
- data/vendor/assets/javascripts/webshims/shims/combos/3.js +163 -140
- data/vendor/assets/javascripts/webshims/shims/combos/30.js +166 -141
- data/vendor/assets/javascripts/webshims/shims/combos/31.js +159 -126
- data/vendor/assets/javascripts/webshims/shims/combos/4.js +103 -109
- data/vendor/assets/javascripts/webshims/shims/combos/5.js +98 -417
- data/vendor/assets/javascripts/webshims/shims/combos/6.js +101 -418
- data/vendor/assets/javascripts/webshims/shims/combos/7.js +168 -142
- data/vendor/assets/javascripts/webshims/shims/combos/8.js +165 -141
- data/vendor/assets/javascripts/webshims/shims/combos/9.js +195 -510
- data/vendor/assets/javascripts/webshims/shims/details.js +2 -2
- data/vendor/assets/javascripts/webshims/shims/dom-extend.js +96 -94
- data/vendor/assets/javascripts/webshims/shims/es5.js +908 -264
- data/vendor/assets/javascripts/webshims/shims/excanvas.js +16 -1
- data/vendor/assets/javascripts/webshims/shims/form-combat.js +147 -0
- data/vendor/assets/javascripts/webshims/shims/form-core.js +60 -31
- data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +114 -33
- data/vendor/assets/javascripts/webshims/shims/form-datalist.js +3 -1
- data/vendor/assets/javascripts/webshims/shims/form-message.js +7 -15
- data/vendor/assets/javascripts/webshims/shims/form-native-extend.js +2 -2
- data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +88 -410
- data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +143 -93
- data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +268 -79
- data/vendor/assets/javascripts/webshims/shims/form-validation.js +116 -81
- data/vendor/assets/javascripts/webshims/shims/form-validators.js +23 -10
- data/vendor/assets/javascripts/webshims/shims/forms-picker.js +605 -9
- data/vendor/assets/javascripts/webshims/shims/geolocation.js +51 -39
- data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-de.js +78 -33
- data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-en.js +24 -6
- data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-nl.js +110 -49
- data/vendor/assets/javascripts/webshims/shims/json-storage.js +3 -1
- data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +2 -1
- data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +81 -30
- data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +131 -54
- data/vendor/assets/javascripts/webshims/shims/plugins/jquery.ui.position.js +497 -0
- data/vendor/assets/javascripts/webshims/shims/range-ui.js +8 -5
- data/vendor/assets/javascripts/webshims/shims/sizzle.js +2026 -0
- data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +401 -521
- data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +1 -1
- data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +94 -82
- data/vendor/assets/javascripts/webshims/shims/styles/shim.css +250 -321
- data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/track-ui.js +1 -1
- data/vendor/assets/javascripts/webshims/shims/track.js +34 -25
- metadata +7 -3
@@ -142,6 +142,32 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
142
142
|
return val.length == 1 ? '0'+val : val;
|
143
143
|
};
|
144
144
|
|
145
|
+
var loadPicker = function(type, name){
|
146
|
+
type = (type == 'color' ? 'color' : 'forms')+'-picker';
|
147
|
+
if(!loadPicker[name+'Loaded'+type]){
|
148
|
+
loadPicker[name+'Loaded'+type] = true;
|
149
|
+
webshims.ready(name, function(){
|
150
|
+
webshims.loader.loadList([type]);
|
151
|
+
|
152
|
+
});
|
153
|
+
}
|
154
|
+
return type;
|
155
|
+
};
|
156
|
+
|
157
|
+
|
158
|
+
options.addZero = addZero;
|
159
|
+
webshims.loader.addModule('forms-picker', {
|
160
|
+
noAutoCallback: true,
|
161
|
+
options: options
|
162
|
+
});
|
163
|
+
webshims.loader.addModule('color-picker', {
|
164
|
+
noAutoCallback: true,
|
165
|
+
css: 'jpicker/jpicker.css',
|
166
|
+
options: options,
|
167
|
+
d: ['forms-picker']
|
168
|
+
});
|
169
|
+
|
170
|
+
options.steps = steps;
|
145
171
|
|
146
172
|
(function(){
|
147
173
|
|
@@ -254,7 +280,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
254
280
|
langCfg.date.monthDigits = monthDigits;
|
255
281
|
langCfg.numberSigns += '-';
|
256
282
|
if(langCfg.meridian){
|
257
|
-
langCfg.timeSigns += langCfg.meridian[0] + langCfg.meridian[1];
|
283
|
+
langCfg.timeSigns += langCfg.meridian[0] + langCfg.meridian[1] + langCfg.meridian[0].toLowerCase() + langCfg.meridian[1].toLowerCase();
|
258
284
|
}
|
259
285
|
$.each(langCfg.date.monthNames, create);
|
260
286
|
$.each(langCfg.date.monthNamesShort, create);
|
@@ -280,43 +306,24 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
280
306
|
$(document).triggerHandler('wslocalechange');
|
281
307
|
};
|
282
308
|
|
283
|
-
triggerLocaleChange();
|
284
309
|
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
return false;
|
295
|
-
}
|
296
|
-
});
|
297
|
-
}
|
298
|
-
});
|
299
|
-
webshims.activeLang({
|
300
|
-
langObj: formcfg,
|
301
|
-
module: 'form-core',
|
302
|
-
callback: function(val){
|
303
|
-
if(curCfg != val){
|
304
|
-
curCfg = val;
|
305
|
-
triggerLocaleChange();
|
306
|
-
}
|
307
|
-
}
|
310
|
+
|
311
|
+
|
312
|
+
curCfg = webshims.activeLang(formcfg);
|
313
|
+
|
314
|
+
triggerLocaleChange();
|
315
|
+
|
316
|
+
$(formcfg).on('change', function(){
|
317
|
+
curCfg = formcfg.__active;
|
318
|
+
triggerLocaleChange();
|
308
319
|
});
|
320
|
+
|
309
321
|
})();
|
310
322
|
|
311
323
|
|
312
324
|
|
313
325
|
(function(){
|
314
326
|
|
315
|
-
|
316
|
-
var mousePress = function(e){
|
317
|
-
$(this)[e.type == 'mousepressstart' ? 'addClass' : 'removeClass']('mousepress-ui');
|
318
|
-
};
|
319
|
-
|
320
327
|
var retDefault = function(val, def){
|
321
328
|
if(!(typeof val == 'number' || (val && val == val * 1))){
|
322
329
|
return def;
|
@@ -428,6 +435,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
428
435
|
time: function(val){
|
429
436
|
var fVal;
|
430
437
|
if(val && curCfg.meridian){
|
438
|
+
val = val.toUpperCase();
|
431
439
|
if(val.substr(0,2) === "12"){
|
432
440
|
val = "00" + val.substr(2);
|
433
441
|
}
|
@@ -651,300 +659,32 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
651
659
|
}
|
652
660
|
},
|
653
661
|
addBindings: function(){
|
654
|
-
var isFocused;
|
655
|
-
|
656
662
|
var that = this;
|
657
663
|
var o = this.options;
|
658
|
-
|
659
|
-
|
660
|
-
var events = {};
|
661
|
-
return {
|
662
|
-
init: function(name, curVal, fn){
|
663
|
-
if(!events[name]){
|
664
|
-
events[name] = {fn: fn};
|
665
|
-
$(that.orig).on(name, function(){
|
666
|
-
events[name].val = $.prop(that.orig, 'value');
|
667
|
-
});
|
668
|
-
}
|
669
|
-
events[name].val = curVal;
|
670
|
-
},
|
671
|
-
call: function(name, val){
|
672
|
-
if(events[name] && events[name].val != val){
|
673
|
-
clearTimeout(events[name].timer);
|
674
|
-
events[name].val = val;
|
675
|
-
events[name].timer = setTimeout(function(){
|
676
|
-
events[name].fn(val, that);
|
677
|
-
}, 9);
|
678
|
-
}
|
679
|
-
}
|
680
|
-
};
|
681
|
-
})();
|
682
|
-
var initChangeEvents = function(){
|
683
|
-
eventTimer.init('input', $.prop(that.orig, 'value'), that.options.input);
|
684
|
-
eventTimer.init('change', $.prop(that.orig, 'value'), that.options.change);
|
664
|
+
var run = function(){
|
665
|
+
that._addBindings();
|
685
666
|
};
|
667
|
+
if(this._addBindings){
|
668
|
+
run();
|
669
|
+
} else {
|
670
|
+
webshims.ready('forms-picker', run);
|
671
|
+
loadPicker(this.type, 'WINDOWLOAD');
|
672
|
+
}
|
686
673
|
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
};
|
697
|
-
var callSplitChange = (function(){
|
698
|
-
var timer;
|
699
|
-
|
700
|
-
var call = function(e){
|
701
|
-
var val;
|
702
|
-
clearTimeout(timer);
|
703
|
-
val = that.parseValue();
|
704
|
-
if(that.type == 'color'){
|
705
|
-
that.inputElements.val(val);
|
706
|
-
}
|
707
|
-
$.prop(that.orig, 'value', val);
|
708
|
-
eventTimer.call('input', val);
|
709
|
-
if(!e || e.type != 'wsupdatevalue'){
|
710
|
-
eventTimer.call('change', val);
|
711
|
-
}
|
712
|
-
};
|
713
|
-
|
714
|
-
var onFocus = function(){
|
715
|
-
clearTimeout(timer);
|
716
|
-
};
|
717
|
-
var onBlur = function(e){
|
718
|
-
clearTimeout(timer);
|
719
|
-
timer = setTimeout(call, 0);
|
720
|
-
|
721
|
-
if(e.type == 'change'){
|
722
|
-
stopPropagation(e);
|
723
|
-
if(!o.splitInput){
|
724
|
-
call();
|
725
|
-
}
|
726
|
-
}
|
727
|
-
};
|
728
|
-
|
729
|
-
that.element.on('wsupdatevalue', call);
|
730
|
-
|
731
|
-
that.inputElements
|
732
|
-
.add(that.buttonWrapper)
|
733
|
-
.add(that.element)
|
734
|
-
.on(
|
735
|
-
{
|
736
|
-
'focus focusin': onFocus,
|
737
|
-
'blur focusout change': onBlur
|
738
|
-
}
|
739
|
-
)
|
740
|
-
;
|
741
|
-
setTimeout(function(){
|
742
|
-
if(that.popover){
|
743
|
-
that.popover.element.on('wspopoverhide', onBlur);
|
744
|
-
$('> *', that.popover.element)
|
745
|
-
.on({
|
746
|
-
'focusin': onFocus,
|
747
|
-
'focusout': onBlur
|
748
|
-
})
|
749
|
-
;
|
750
|
-
}
|
751
|
-
}, 0);
|
752
|
-
})();
|
753
|
-
|
754
|
-
var spinEvents = {};
|
755
|
-
var spinElement = o.splitInput ? this.inputElements.filter('.ws-spin') : this.inputElements.eq(0);
|
756
|
-
var elementEvts = {
|
757
|
-
blur: function(e){
|
758
|
-
if(!preventBlur(e) && !o.disabled && !o.readonly){
|
759
|
-
if(!preventBlur.prevent){
|
760
|
-
isFocused = false;
|
761
|
-
}
|
762
|
-
}
|
763
|
-
stopPropagation(e);
|
764
|
-
},
|
765
|
-
focus: function(e){
|
766
|
-
if(!isFocused){
|
767
|
-
initChangeEvents();
|
768
|
-
isFocused = this;
|
769
|
-
}
|
770
|
-
},
|
771
|
-
keypress: function(e){
|
772
|
-
if(e.isDefaultPrevented()){return;}
|
773
|
-
var chr;
|
774
|
-
var stepped = true;
|
775
|
-
var code = e.keyCode;
|
776
|
-
if(!e.ctrlKey && !e.metaKey && curCfg[that.type+'Signs']){
|
777
|
-
chr = String.fromCharCode(e.charCode == null ? code : e.charCode);
|
778
|
-
stepped = !(chr < " " || (curCfg[that.type+'Signs']+'0123456789').indexOf(chr) > -1);
|
779
|
-
} else {
|
780
|
-
stepped = false;
|
781
|
-
}
|
782
|
-
if(stepped){
|
783
|
-
e.preventDefault();
|
674
|
+
this.inputElements
|
675
|
+
.add(this.buttonWrapper)
|
676
|
+
.add(this.element)
|
677
|
+
.one('mousedown focusin', function(e){
|
678
|
+
loadPicker(that.type, 'DOM');
|
679
|
+
})
|
680
|
+
.on({
|
681
|
+
'change input focus focusin blur focusout': function(e){
|
682
|
+
$(e.target).trigger('ws__'+e.type);
|
784
683
|
}
|
785
|
-
}
|
786
|
-
input: (this.type == 'color' && this.isValid) ?
|
787
|
-
$.noop :
|
788
|
-
(function(){
|
789
|
-
var timer;
|
790
|
-
var check = function(){
|
791
|
-
var val = that.parseValue(true);
|
792
|
-
if(val && that.isValid(val)){
|
793
|
-
that.setInput(val);
|
794
|
-
}
|
795
|
-
|
796
|
-
};
|
797
|
-
return function(){
|
798
|
-
clearTimeout(timer);
|
799
|
-
timer = setTimeout(check, 200);
|
800
|
-
};
|
801
|
-
})(),
|
802
|
-
'input keydown keypress': (function(){
|
803
|
-
var timer;
|
804
|
-
var isStopped = false;
|
805
|
-
var releaseTab = function(){
|
806
|
-
if(isStopped === true){
|
807
|
-
isStopped = 'semi';
|
808
|
-
timer = setTimeout(releaseTab, 250);
|
809
|
-
} else {
|
810
|
-
isStopped = false;
|
811
|
-
}
|
812
|
-
};
|
813
|
-
var stopTab = function(){
|
814
|
-
isStopped = true;
|
815
|
-
clearTimeout(timer);
|
816
|
-
timer = setTimeout(releaseTab, 300);
|
817
|
-
};
|
818
|
-
var select = function(){
|
819
|
-
var elem = this;
|
820
|
-
setTimeout(function(){
|
821
|
-
elem.focus();
|
822
|
-
elem.select();
|
823
|
-
}, 4);
|
824
|
-
|
825
|
-
stopTab();
|
826
|
-
};
|
827
|
-
|
828
|
-
return function(e){
|
829
|
-
if(o.splitInput && o.jumpInputs){
|
830
|
-
if(e.type == 'input'){
|
831
|
-
if($.prop(this, 'value').length === $.prop(this, 'maxLength')){
|
832
|
-
try {
|
833
|
-
$(this)
|
834
|
-
.next()
|
835
|
-
.next('input, select')
|
836
|
-
.each(select)
|
837
|
-
;
|
838
|
-
} catch(er){}
|
839
|
-
}
|
840
|
-
} else if(!e.shiftKey && !e.crtlKey && e.keyCode == 9 && (isStopped === true || (isStopped && !$.prop(this, 'value')))){
|
841
|
-
e.preventDefault();
|
842
|
-
}
|
843
|
-
}
|
844
|
-
};
|
845
|
-
})()
|
846
|
-
};
|
847
|
-
var mouseDownInit = function(){
|
848
|
-
if(!o.disabled && !isFocused){
|
849
|
-
that.element.getShadowFocusElement().focus();
|
850
|
-
}
|
851
|
-
preventBlur.set();
|
684
|
+
})
|
852
685
|
|
853
|
-
|
854
|
-
};
|
855
|
-
|
856
|
-
preventBlur.set = (function(){
|
857
|
-
var timer;
|
858
|
-
var reset = function(){
|
859
|
-
preventBlur.prevent = false;
|
860
|
-
};
|
861
|
-
return function(){
|
862
|
-
clearTimeout(timer);
|
863
|
-
preventBlur.prevent = true;
|
864
|
-
setTimeout(reset, 9);
|
865
|
-
};
|
866
|
-
})();
|
867
|
-
|
868
|
-
|
869
|
-
this.buttonWrapper.on('mousedown', mouseDownInit);
|
870
|
-
|
871
|
-
this.setInput = function(value){
|
872
|
-
that.value(value);
|
873
|
-
eventTimer.call('input', value);
|
874
|
-
};
|
875
|
-
this.setChange = function(value){
|
876
|
-
that.setInput(value);
|
877
|
-
eventTimer.call('change', value);
|
878
|
-
};
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
this.inputElements.on(elementEvts);
|
686
|
+
;
|
883
687
|
|
884
|
-
if(steps[this.type]){
|
885
|
-
['stepUp', 'stepDown'].forEach(function(name){
|
886
|
-
step[name] = function(factor){
|
887
|
-
if(!o.disabled && !o.readonly){
|
888
|
-
if(!isFocused){
|
889
|
-
mouseDownInit();
|
890
|
-
}
|
891
|
-
var ret = false;
|
892
|
-
if (!factor) {
|
893
|
-
factor = 1;
|
894
|
-
}
|
895
|
-
try {
|
896
|
-
that.elemHelper[name](factor);
|
897
|
-
|
898
|
-
ret = that.elemHelper.prop('value');
|
899
|
-
|
900
|
-
} catch (er) {
|
901
|
-
if(!o.value && that.maxAsNumber >= that.minAsNumber){
|
902
|
-
ret = o.defValue;
|
903
|
-
}
|
904
|
-
}
|
905
|
-
if(ret !== false && o.value != ret){
|
906
|
-
that.value(ret);
|
907
|
-
eventTimer.call('input', ret);
|
908
|
-
}
|
909
|
-
return ret;
|
910
|
-
}
|
911
|
-
};
|
912
|
-
});
|
913
|
-
if(!o.noSpinbtn){
|
914
|
-
spinEvents[$.fn.mwheelIntent ? 'mwheelIntent' : 'mousewheel'] = function(e, delta){
|
915
|
-
if(delta && isFocused && !o.disabled){
|
916
|
-
step[delta > 0 ? 'stepUp' : 'stepDown']();
|
917
|
-
e.preventDefault();
|
918
|
-
}
|
919
|
-
};
|
920
|
-
spinEvents.keydown = function(e){
|
921
|
-
if(o.list || e.isDefaultPrevented() || (e.altKey && e.keyCode == 40) || $.attr(this, 'list')){return;}
|
922
|
-
var stepped = true;
|
923
|
-
var code = e.keyCode;
|
924
|
-
if (code == 38) {
|
925
|
-
step.stepUp();
|
926
|
-
} else if (code == 40) {
|
927
|
-
step.stepDown();
|
928
|
-
} else {
|
929
|
-
stepped = false;
|
930
|
-
}
|
931
|
-
if(stepped){
|
932
|
-
e.preventDefault();
|
933
|
-
}
|
934
|
-
};
|
935
|
-
|
936
|
-
spinElement.attr({'autocomplete': 'off', role: 'spinbutton'}).on(spinEvents);
|
937
|
-
}
|
938
|
-
$(this.buttonWrapper)
|
939
|
-
.on('mousepressstart mousepressend', '.step-up, .step-down', mousePress)
|
940
|
-
.on('mousedown mousepress', '.step-up', function(e){
|
941
|
-
step.stepUp();
|
942
|
-
})
|
943
|
-
.on('mousedown mousepress', '.step-down', function(e){
|
944
|
-
step.stepDown();
|
945
|
-
})
|
946
|
-
;
|
947
|
-
}
|
948
688
|
if(this.type != 'color'){
|
949
689
|
(function(){
|
950
690
|
var localeChange ;
|
@@ -968,8 +708,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
968
708
|
$(that.orig).onWSOff('wslocalechange', localeChange);
|
969
709
|
})();
|
970
710
|
}
|
971
|
-
|
972
|
-
initChangeEvents();
|
973
711
|
},
|
974
712
|
required: function(val, boolVal){
|
975
713
|
this.inputElements.attr({'aria-required': ''+boolVal});
|
@@ -1003,34 +741,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1003
741
|
this.element.prop('placeholder', placeholder);
|
1004
742
|
}
|
1005
743
|
},
|
1006
|
-
initDataList: function(){
|
1007
|
-
var listTimer;
|
1008
|
-
var that = this;
|
1009
|
-
var updateList = function(){
|
1010
|
-
$(that.orig)
|
1011
|
-
.jProp('list')
|
1012
|
-
.off('updateDatalist', updateList)
|
1013
|
-
.on('updateDatalist', updateList)
|
1014
|
-
;
|
1015
|
-
clearTimeout(listTimer);
|
1016
|
-
listTimer = setTimeout(function(){
|
1017
|
-
if(that.list){
|
1018
|
-
that.list();
|
1019
|
-
}
|
1020
|
-
}, 9);
|
1021
|
-
|
1022
|
-
};
|
1023
|
-
|
1024
|
-
$(this.orig).onTrigger('listdatalistchange', updateList);
|
1025
|
-
},
|
1026
|
-
getOptions: function(){
|
1027
|
-
var options = {};
|
1028
|
-
var datalist = $(this.orig).jProp('list');
|
1029
|
-
datalist.find('option').each(function(){
|
1030
|
-
options[$.prop(this, 'value')] = $.prop(this, 'label');
|
1031
|
-
});
|
1032
|
-
return [options, datalist.data('label')];
|
1033
|
-
},
|
1034
744
|
list: function(val){
|
1035
745
|
if(this.type == 'number'){
|
1036
746
|
this.element.attr('list', $.attr(this.orig, 'list'));
|
@@ -1160,31 +870,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1160
870
|
}, 9);
|
1161
871
|
}
|
1162
872
|
},
|
1163
|
-
value: function(val, force){
|
1164
|
-
|
1165
|
-
if(!this._init || force || this.options.value !== val){
|
1166
|
-
this.valueAsNumber = this.asNumber(val);
|
1167
|
-
this.options.value = val;
|
1168
|
-
|
1169
|
-
if(isNaN(this.valueAsNumber) || (!isNaN(this.minAsNumber) && this.valueAsNumber < this.minAsNumber) || (!isNaN(this.maxAsNumber) && this.valueAsNumber > this.maxAsNumber)){
|
1170
|
-
this._setStartInRange();
|
1171
|
-
} else {
|
1172
|
-
this.elemHelper.prop('value', val);
|
1173
|
-
this.options.defValue = "";
|
1174
|
-
}
|
1175
|
-
|
1176
|
-
val = formatVal[this.type](val, this.options);
|
1177
|
-
if(this.options.splitInput){
|
1178
|
-
$.each(this.splits, function(i, elem){
|
1179
|
-
$.prop(elem, 'value', val[i]);
|
1180
|
-
});
|
1181
|
-
} else {
|
1182
|
-
this.element.prop('value', val);
|
1183
|
-
}
|
1184
|
-
this._propertyChange('value');
|
1185
|
-
this.mirrorValidity();
|
1186
|
-
}
|
1187
|
-
},
|
1188
873
|
step: function(val){
|
1189
874
|
var defStep = steps[this.type];
|
1190
875
|
this.options.step = val;
|
@@ -1256,6 +941,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1256
941
|
});
|
1257
942
|
};
|
1258
943
|
|
944
|
+
$.fn.wsBaseWidget.wsProto = wsWidgetProto;
|
945
|
+
|
1259
946
|
$.fn.spinbtnUI = function(opts){
|
1260
947
|
opts = $.extend({
|
1261
948
|
monthNames: 'monthNames',
|
@@ -1270,32 +957,14 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1270
957
|
}, opts);
|
1271
958
|
});
|
1272
959
|
};
|
960
|
+
|
961
|
+
$.fn.spinbtnUI.wsProto = spinBtnProto;
|
962
|
+
|
1273
963
|
})();
|
1274
964
|
|
1275
965
|
(function(){
|
1276
966
|
var picker = {};
|
1277
967
|
|
1278
|
-
var loadPicker = function(type, name){
|
1279
|
-
type = (type == 'color' ? 'color' : 'forms')+'-picker';
|
1280
|
-
if(!loadPicker[name+'Loaded'+type]){
|
1281
|
-
loadPicker[name+'Loaded'+type] = true;
|
1282
|
-
webshims.ready(name, function(){
|
1283
|
-
webshims.loader.loadList([type]);
|
1284
|
-
});
|
1285
|
-
}
|
1286
|
-
return type;
|
1287
|
-
};
|
1288
|
-
options.addZero = addZero;
|
1289
|
-
webshims.loader.addModule('forms-picker', {
|
1290
|
-
noAutoCallback: true,
|
1291
|
-
options: options
|
1292
|
-
});
|
1293
|
-
webshims.loader.addModule('color-picker', {
|
1294
|
-
noAutoCallback: true,
|
1295
|
-
css: 'jpicker/jpicker.css',
|
1296
|
-
options: options
|
1297
|
-
});
|
1298
|
-
|
1299
968
|
webshims.inlinePopover = {
|
1300
969
|
_create: function(){
|
1301
970
|
this.element = $('<div class="ws-inline-picker"><div class="ws-po-box" /></div>').data('wspopover', this);
|
@@ -1339,7 +1008,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1339
1008
|
cancel: function(val, popover, data){
|
1340
1009
|
if(!data.options.inlinePicker){
|
1341
1010
|
popover.stopOpen = true;
|
1342
|
-
data.element.getShadowFocusElement().focus
|
1011
|
+
data.element.getShadowFocusElement().trigger('focus');
|
1343
1012
|
setTimeout(function(){
|
1344
1013
|
popover.stopOpen = false;
|
1345
1014
|
}, 9);
|
@@ -1428,9 +1097,16 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1428
1097
|
|
1429
1098
|
picker._common = function(data){
|
1430
1099
|
var options = data.options;
|
1431
|
-
var popover = webshims.objectCreate(options.inlinePicker ? webshims.inlinePopover : webshims.wsPopover, {}, {prepareFor: options.inlinePicker ? data.buttonWrapper : data.element
|
1100
|
+
var popover = webshims.objectCreate(options.inlinePicker ? webshims.inlinePopover : webshims.wsPopover, {}, $.extend(options.popover || {}, {prepareFor: options.inlinePicker ? data.buttonWrapper : data.element}));
|
1432
1101
|
var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper);
|
1433
1102
|
|
1103
|
+
if(options.widgetPosition){
|
1104
|
+
webshims.error('options.widgetPosition was removed use options.popover.position instead');
|
1105
|
+
}
|
1106
|
+
|
1107
|
+
if(options.openOnFocus && popover.options && (popover.options.appendTo == 'auto' || popover.options.appendTo == 'element')){
|
1108
|
+
webshims.error('openOnFocus and popover.appendTo "auto/element" can prduce a11y problems try to change appendTo to body or similiar or use openOnMouseFocus instead');
|
1109
|
+
}
|
1434
1110
|
|
1435
1111
|
var showPickerContent = function(){
|
1436
1112
|
(picker[data.type].showPickerContent || picker.showPickerContent)(data, popover);
|
@@ -1582,7 +1258,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1582
1258
|
if(options.inlinePicker){
|
1583
1259
|
show();
|
1584
1260
|
}
|
1585
|
-
loadPicker(data.type, 'WINDOWLOAD');
|
1586
1261
|
};
|
1587
1262
|
|
1588
1263
|
picker.month = picker._common;
|
@@ -1598,7 +1273,7 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1598
1273
|
.find('.ws-color-indicator')
|
1599
1274
|
;
|
1600
1275
|
var showColor = function(){
|
1601
|
-
colorIndicator.css({backgroundColor: $.prop(this, 'value') || '#
|
1276
|
+
colorIndicator.css({backgroundColor: $.prop(this, 'value') || '#000000'});
|
1602
1277
|
};
|
1603
1278
|
var showOpacity = (function(){
|
1604
1279
|
var timer;
|
@@ -1755,11 +1430,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1755
1430
|
data = {};
|
1756
1431
|
optsName = type;
|
1757
1432
|
|
1758
|
-
//todo: do we need deep extend?
|
1759
|
-
|
1760
1433
|
labels = $(this).jProp('labels');
|
1761
|
-
|
1762
|
-
opts = $.extend({}, options.widgets, options[type], $($.prop(this, 'form')).data(type) || {}, $(this).data(type) || {}, {
|
1434
|
+
opts = $.extend(webshims.getOptions(this, type, [options.widgets, options[type], $($.prop(this, 'form')).data(type)]), {
|
1763
1435
|
orig: this,
|
1764
1436
|
type: type,
|
1765
1437
|
labels: labels,
|
@@ -1781,7 +1453,6 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1781
1453
|
containerElements: []
|
1782
1454
|
});
|
1783
1455
|
|
1784
|
-
|
1785
1456
|
for(i = 0; i < copyProps.length; i++){
|
1786
1457
|
opts[copyProps[i]] = $.prop(this, copyProps[i]);
|
1787
1458
|
}
|
@@ -1935,8 +1606,8 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1935
1606
|
opts.splitInput = false;
|
1936
1607
|
}
|
1937
1608
|
var markup = opts.splitInput ?
|
1938
|
-
'<span class="ws-'+name+' ws-input" role="group"></span>' :
|
1939
|
-
'<input class="ws-'+name+'" type="text" />';
|
1609
|
+
'<span class="ws-'+name+' ws-input ws-inputreplace" role="group"></span>' :
|
1610
|
+
'<input class="ws-'+name+' ws-inputreplace" type="text" />';
|
1940
1611
|
var data = $(markup).insertAfter(opts.orig);
|
1941
1612
|
if(steps[name]){
|
1942
1613
|
data = data.spinbtnUI(opts).data('wsWidget'+name);
|
@@ -1953,13 +1624,20 @@ webshims.register('form-number-date-ui', function($, webshims, window, document,
|
|
1953
1624
|
}
|
1954
1625
|
});
|
1955
1626
|
|
1627
|
+
var init = function(){
|
1628
|
+
webshims.addReady(function(context, contextElem){
|
1629
|
+
$('input', context)
|
1630
|
+
.add(contextElem.filter('input'))
|
1631
|
+
.each(implementType)
|
1632
|
+
;
|
1633
|
+
});
|
1634
|
+
};
|
1635
|
+
if(formcfg._isLoading){
|
1636
|
+
$(formcfg).one('change', init);
|
1637
|
+
} else {
|
1638
|
+
init();
|
1639
|
+
}
|
1956
1640
|
|
1957
|
-
webshims.addReady(function(context, contextElem){
|
1958
|
-
$('input', context)
|
1959
|
-
.add(contextElem.filter('input'))
|
1960
|
-
.each(implementType)
|
1961
|
-
;
|
1962
|
-
});
|
1963
1641
|
})();
|
1964
1642
|
});
|
1965
1643
|
|