webshims-rails 1.11.6.1 → 1.12.0
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/polyfiller.js +126 -72
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/canvas2png.js +9 -4
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.js +32 -26
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/proxy.php +25 -4
- data/vendor/assets/javascripts/webshims/shims/FlashCanvas/save.php +9 -3
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/canvas2png.js +9 -4
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash10canvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flash9canvas.swf +0 -0
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flashcanvas.js +36 -30
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/proxy.php +25 -4
- data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/save.php +9 -3
- data/vendor/assets/javascripts/webshims/shims/combos/1.js +13 -6
- data/vendor/assets/javascripts/webshims/shims/combos/10.js +156 -143
- data/vendor/assets/javascripts/webshims/shims/combos/11.js +97 -84
- data/vendor/assets/javascripts/webshims/shims/combos/12.js +2 -4
- data/vendor/assets/javascripts/webshims/shims/combos/13.js +1 -2
- data/vendor/assets/javascripts/webshims/shims/combos/14.js +956 -2819
- data/vendor/assets/javascripts/webshims/shims/combos/15.js +73 -67
- data/vendor/assets/javascripts/webshims/shims/combos/16.js +75 -71
- data/vendor/assets/javascripts/webshims/shims/combos/17.js +118 -89
- data/vendor/assets/javascripts/webshims/shims/combos/18.js +119 -91
- data/vendor/assets/javascripts/webshims/shims/combos/19.js +62 -65
- data/vendor/assets/javascripts/webshims/shims/combos/2.js +73 -67
- data/vendor/assets/javascripts/webshims/shims/combos/20.js +61 -63
- data/vendor/assets/javascripts/webshims/shims/combos/21.js +3 -6
- data/vendor/assets/javascripts/webshims/shims/combos/22.js +1 -2
- data/vendor/assets/javascripts/webshims/shims/combos/23.js +1 -2
- data/vendor/assets/javascripts/webshims/shims/combos/24.js +22 -12
- data/vendor/assets/javascripts/webshims/shims/combos/25.js +63 -67
- data/vendor/assets/javascripts/webshims/shims/combos/26.js +59 -59
- data/vendor/assets/javascripts/webshims/shims/combos/27.js +1 -2
- data/vendor/assets/javascripts/webshims/shims/combos/28.js +1915 -0
- data/vendor/assets/javascripts/webshims/shims/combos/29.js +817 -0
- data/vendor/assets/javascripts/webshims/shims/combos/3.js +71 -63
- data/vendor/assets/javascripts/webshims/shims/combos/30.js +72 -65
- data/vendor/assets/javascripts/webshims/shims/combos/31.js +71 -63
- data/vendor/assets/javascripts/webshims/shims/combos/32.js +2343 -0
- data/vendor/assets/javascripts/webshims/shims/combos/33.js +897 -0
- data/vendor/assets/javascripts/webshims/shims/combos/4.js +59 -59
- data/vendor/assets/javascripts/webshims/shims/combos/5.js +119 -91
- data/vendor/assets/javascripts/webshims/shims/combos/6.js +120 -93
- data/vendor/assets/javascripts/webshims/shims/combos/7.js +74 -69
- data/vendor/assets/javascripts/webshims/shims/combos/8.js +73 -67
- data/vendor/assets/javascripts/webshims/shims/combos/9.js +157 -145
- data/vendor/assets/javascripts/webshims/shims/dom-extend.js +58 -57
- data/vendor/assets/javascripts/webshims/shims/form-combat.js +0 -1
- data/vendor/assets/javascripts/webshims/shims/form-core.js +12 -3
- data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +4 -3
- data/vendor/assets/javascripts/webshims/shims/form-number-date-api.js +20 -3
- data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +78 -71
- data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +21 -10
- data/vendor/assets/javascripts/webshims/shims/form-validation.js +39 -27
- data/vendor/assets/javascripts/webshims/shims/forms-picker.js +173 -128
- data/vendor/assets/javascripts/webshims/shims/i18n/{formcfg-ch-ZN.js → formcfg-ch-CN.js} +0 -0
- data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-en.js +0 -2
- data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-zh-CN.js +65 -0
- data/vendor/assets/javascripts/webshims/shims/plugins/jquery.ui.position.js +1 -1
- data/vendor/assets/javascripts/webshims/shims/range-ui.js +18 -11
- data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +221 -153
- data/vendor/assets/javascripts/webshims/shims/styles/progress.gif +0 -0
- data/vendor/assets/javascripts/webshims/shims/styles/progress.png +0 -0
- data/vendor/assets/javascripts/webshims/shims/styles/scss/_extends.scss +5 -0
- data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +273 -177
- data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +113 -98
- data/vendor/assets/javascripts/webshims/shims/styles/shim.css +114 -88
- data/vendor/assets/javascripts/webshims/shims/track-ui.js +2 -2
- metadata +10 -7
- data/vendor/assets/javascripts/webshims/extras/mousepress.js +0 -60
- data/vendor/assets/javascripts/webshims/shims/jpicker/images/Thumbs.db +0 -0
- data/vendor/assets/javascripts/webshims/shims/json-storage.js +0 -316
- data/vendor/assets/javascripts/webshims/shims/mediagroup.js +0 -29
@@ -25,6 +25,8 @@ var getGroupElements = function(elem){
|
|
25
25
|
}
|
26
26
|
return ret;
|
27
27
|
};
|
28
|
+
//support getSetAttribute
|
29
|
+
var supportGetSetAttribute = !(('getSetAttribute' in $.support) && !$.support.getSetAttribute);
|
28
30
|
//submitbubbles for IE6-IE8
|
29
31
|
var supportSubmitBubbles = !('submitBubbles' in $.support) || $.support.submitBubbles;
|
30
32
|
var addSubmitBubbles = function(form){
|
@@ -166,7 +168,7 @@ if( !('maxLength' in document.createElement('textarea')) ){
|
|
166
168
|
});
|
167
169
|
}
|
168
170
|
|
169
|
-
if(
|
171
|
+
if(!supportGetSetAttribute && $('<form novalidate></form>').attr('novalidate') == null){
|
170
172
|
webshims.defineNodeNameProperty('form', 'novalidate', {
|
171
173
|
attr: {
|
172
174
|
set: function(val){
|
@@ -185,20 +187,21 @@ if(!Modernizr.formattribute || !Modernizr.fieldsetdisabled || !Modernizr.fieldse
|
|
185
187
|
(function(){
|
186
188
|
if(!Modernizr.fieldsetdisabled){
|
187
189
|
var isFieldsetGroup = /^(?:fieldset)$/i;
|
190
|
+
var disableElementsSel = 'input, textarea, select, button';
|
188
191
|
$.extend($.expr[":"], {
|
189
192
|
"enabled": function( elem ) {
|
190
|
-
return elem.disabled === false || (isFieldsetGroup.test(elem.nodeName) &&
|
193
|
+
return elem.disabled === false || (isFieldsetGroup.test(elem.nodeName) && webshims.contentAttr(elem, 'disabled') == null && !$(elem).is('fieldset[disabled] *')) ;
|
191
194
|
},
|
192
195
|
|
193
196
|
"disabled": function( elem ) {
|
194
|
-
return elem.disabled === true || (isFieldsetGroup.test(elem.nodeName) && (
|
197
|
+
return elem.disabled === true || (isFieldsetGroup.test(elem.nodeName) && (webshims.contentAttr(elem, 'disabled') != null || $(elem).is('fieldset[disabled] *')));
|
195
198
|
}
|
196
199
|
});
|
197
200
|
|
198
201
|
|
199
202
|
var groupControl = {
|
200
203
|
getElements: function(group){
|
201
|
-
$(
|
204
|
+
$(disableElementsSel, group).each(groupControl.disable);
|
202
205
|
},
|
203
206
|
disable: function(){
|
204
207
|
if(!this.disabled){
|
@@ -215,24 +218,27 @@ if(!Modernizr.formattribute || !Modernizr.fieldsetdisabled || !Modernizr.fieldse
|
|
215
218
|
};
|
216
219
|
|
217
220
|
$(window).on('unload', function(){
|
218
|
-
$(
|
221
|
+
$(disableElementsSel).each(groupControl.enable);
|
219
222
|
});
|
220
223
|
|
221
224
|
webshims.defineNodeNamesBooleanProperty(['fieldset'], 'disabled', {
|
222
225
|
set: function(value){
|
223
226
|
|
224
227
|
if(value){
|
225
|
-
$(
|
228
|
+
$(disableElementsSel, this).each(groupControl.disable);
|
226
229
|
} else if(!$(this).is('fieldset[disabled] *')){
|
227
230
|
var nested = $('fieldset[disabled]', this);
|
228
|
-
var elements = $(
|
231
|
+
var elements = $(disableElementsSel, this);
|
232
|
+
|
229
233
|
if(nested.length){
|
230
|
-
elements = elements.
|
234
|
+
elements = elements.not('fieldset[disabled] *');
|
231
235
|
}
|
236
|
+
|
232
237
|
elements.each(groupControl.enable);
|
233
238
|
}
|
234
239
|
},
|
235
|
-
initAttr: true
|
240
|
+
initAttr: true,
|
241
|
+
useContentAttribute: true
|
236
242
|
});
|
237
243
|
|
238
244
|
['input', 'textarea', 'select', 'button'].forEach(function(nodeName){
|
@@ -264,7 +270,12 @@ if(!Modernizr.formattribute || !Modernizr.fieldsetdisabled || !Modernizr.fieldse
|
|
264
270
|
});
|
265
271
|
|
266
272
|
webshims.addReady(function(context){
|
267
|
-
|
273
|
+
|
274
|
+
$(context)
|
275
|
+
.filter('fieldset[disabled], fieldset[disabled] *')
|
276
|
+
.find(disableElementsSel)
|
277
|
+
.each(groupControl.disable)
|
278
|
+
;
|
268
279
|
});
|
269
280
|
}
|
270
281
|
|
@@ -6,13 +6,17 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
6
6
|
var webkitVersion = chromeBugs && parseFloat((navigator.userAgent.match(/Safari\/([\d\.]+)/) || ['', '999999'])[1], 10);
|
7
7
|
|
8
8
|
var iVal = options.iVal;
|
9
|
-
|
9
|
+
if(!iVal.fieldWrapper){
|
10
|
+
iVal.fieldWrapper = ':not(span), :not(label), :not(em), :not(strong), :not(p)';
|
11
|
+
}
|
12
|
+
var invalidClass = iVal.errorClass || (iVal.errorClass = 'user-error');
|
10
13
|
var validClass = iVal.successClass || 'user-success';
|
11
14
|
|
12
|
-
var invalidWrapperClass = iVal.errorWrapperClass || 'ws-invalid';
|
13
|
-
var successWrapperClass = iVal.successWrapperClass || 'ws-success';
|
14
|
-
var errorBoxClass = iVal.errorBoxClass || 'ws-errorbox';
|
15
|
-
var errorMessageClass = iVal.errorMessageClass || 'ws-errormessage';
|
15
|
+
var invalidWrapperClass = iVal.errorWrapperClass || (iVal.errorWrapperClass = 'ws-invalid');
|
16
|
+
var successWrapperClass = iVal.successWrapperClass || (iVal.successWrapperClass = 'ws-success');
|
17
|
+
var errorBoxClass = iVal.errorBoxClass || (iVal.errorBoxClass = 'ws-errorbox');
|
18
|
+
var errorMessageClass = iVal.errorMessageClass || (iVal.errorMessageClass = 'ws-errormessage');
|
19
|
+
|
16
20
|
var checkTypes = {checkbox: 1, radio: 1};
|
17
21
|
|
18
22
|
var loader = webshims.loader;
|
@@ -295,8 +299,8 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
295
299
|
that.element.css('display', '');
|
296
300
|
that.timers.show = setTimeout(function(){
|
297
301
|
that.element.addClass('ws-po-visible').trigger('wspopovershow');
|
298
|
-
},
|
299
|
-
},
|
302
|
+
}, 14);
|
303
|
+
}, 4);
|
300
304
|
|
301
305
|
$(document.body || document).on('focusin'+this.eventns+' mousedown'+this.eventns, function(e){
|
302
306
|
if(that.options.hideOnBlur && !that.stopBlur && !that.isInElement([that.lastElement[0], element[0], that.element[0]], e.target)){
|
@@ -514,7 +518,7 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
514
518
|
if(!$.fn[fx[iVal.fx].show]){
|
515
519
|
iVal.fx = 'no';
|
516
520
|
}
|
517
|
-
|
521
|
+
var errorBoxId = 0;
|
518
522
|
webshims.errorbox = {
|
519
523
|
create: function(elem, fieldWrapper){
|
520
524
|
if(!fieldWrapper){
|
@@ -526,21 +530,18 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
526
530
|
errorBox = $('<div class="'+ errorBoxClass +'" hidden="hidden" style="display: none;">');
|
527
531
|
fieldWrapper.append(errorBox);
|
528
532
|
}
|
529
|
-
|
533
|
+
if(!errorBox.prop('id')){
|
534
|
+
errorBoxId++;
|
535
|
+
errorBox.prop('id', 'errorbox-'+errorBoxId);
|
536
|
+
}
|
530
537
|
fieldWrapper.data('errorbox', errorBox);
|
531
538
|
return errorBox;
|
532
539
|
},
|
533
540
|
getFieldWrapper: function(elem){
|
534
541
|
var fieldWrapper;
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
fieldWrapper = false;
|
539
|
-
webshims.error("could not find fieldwrapper: "+ iVal.fieldWrapper);
|
540
|
-
}
|
541
|
-
}
|
542
|
-
if(!fieldWrapper){
|
543
|
-
fieldWrapper = $(elem).parent().closest(':not(span), :not(label), :not(em), :not(strong), :not(p)');
|
542
|
+
fieldWrapper = (typeof iVal.fieldWrapper == "function") ? iVal.fieldWrapper.apply(this, arguments) : $(elem).parent().closest(iVal.fieldWrapper);
|
543
|
+
if(!fieldWrapper.length){
|
544
|
+
webshims.error("could not find fieldwrapper: "+ iVal.fieldWrapper);
|
544
545
|
}
|
545
546
|
return fieldWrapper;
|
546
547
|
},
|
@@ -561,7 +562,7 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
561
562
|
}
|
562
563
|
return ret || 'defaultMessage';
|
563
564
|
};
|
564
|
-
$.each(["customError","badInput","typeMismatch","rangeUnderflow","rangeOverflow","stepMismatch","tooLong","tooShort","patternMismatch","valueMissing"
|
565
|
+
$.each(["customError","badInput","typeMismatch","rangeUnderflow","rangeOverflow","stepMismatch","tooLong","tooShort","patternMismatch","valueMissing"], function(i, name){
|
565
566
|
var cName = name.replace(/[A-Z]/, deCamelCase);
|
566
567
|
fields[name] = '.'+cName+', .'+name+', .'+(name).toLowerCase()+', [data-errortype="'+ name +'"]';
|
567
568
|
});
|
@@ -631,6 +632,9 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
631
632
|
fieldWrapper.removeClass(invalidWrapperClass);
|
632
633
|
errorBox.message = '';
|
633
634
|
errorBox[fx[iVal.fx].hide](function(){
|
635
|
+
if(this.id == elem.getAttribute('aria-describedby')){
|
636
|
+
elem.removeAttribute('aria-describedby');
|
637
|
+
}
|
634
638
|
$(this).attr({hidden: 'hidden'});
|
635
639
|
});
|
636
640
|
}
|
@@ -669,16 +673,20 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
669
673
|
if(box.stop){
|
670
674
|
box.stop(true, true);
|
671
675
|
}
|
672
|
-
box.html('<p class="'+ errorMessageClass +'"
|
676
|
+
box.html('<p class="'+ errorMessageClass +'">'+ message +'</p>');
|
673
677
|
box.message = message;
|
674
678
|
fieldWrapper.addClass(invalidWrapperClass).removeClass(successWrapperClass);
|
675
679
|
this.recheckInvalidInput(elem);
|
676
680
|
if(box.is('[hidden]') || box.css('display') == 'none'){
|
681
|
+
if(!elem.getAttribute('aria-describedby')){
|
682
|
+
elem.setAttribute('aria-describedby', box.prop('id'));
|
683
|
+
}
|
677
684
|
box
|
678
685
|
.css({display: 'none'})
|
679
686
|
.removeAttr('hidden')
|
680
687
|
[fx[iVal.fx].show]()
|
681
688
|
;
|
689
|
+
|
682
690
|
}
|
683
691
|
}
|
684
692
|
fieldWrapper.removeClass(successWrapperClass);
|
@@ -744,8 +752,9 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
744
752
|
|
745
753
|
if(options.replaceValidationUI){
|
746
754
|
$(document).on('firstinvalid', function(e){
|
747
|
-
if(!e.
|
755
|
+
if(!e.isDefaultPrevented()){
|
748
756
|
e.preventDefault();
|
757
|
+
|
749
758
|
setTimeout(function(){
|
750
759
|
webshims.validityAlert.showFor( e.target );
|
751
760
|
}, 4);
|
@@ -769,9 +778,6 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
769
778
|
if(!firstEvent){
|
770
779
|
//trigger firstinvalid
|
771
780
|
firstEvent = $.Event('firstinvalid');
|
772
|
-
firstEvent.isInvalidUIPrevented = e.isDefaultPrevented;
|
773
|
-
var firstSystemInvalid = $.Event('firstinvalidsystem');
|
774
|
-
$(document).triggerHandler(firstSystemInvalid, {element: e.target, form: e.target.form, isInvalidUIPrevented: e.isDefaultPrevented});
|
775
781
|
jElm.trigger(firstEvent);
|
776
782
|
}
|
777
783
|
|
@@ -930,15 +936,21 @@ webshims.register('form-validation', function($, webshims, window, document, und
|
|
930
936
|
}
|
931
937
|
});
|
932
938
|
}
|
933
|
-
|
939
|
+
if(webshims.cfg.debug !== false){
|
940
|
+
$(function(){
|
941
|
+
if($('form.ws-instantvalidation').length){
|
942
|
+
webshims.error('.ws-instantvalidation was renamed to .ws-validate');
|
943
|
+
}
|
944
|
+
});
|
945
|
+
}
|
934
946
|
addModule('form-combat', {
|
935
947
|
d: ['dom-support'],
|
936
|
-
test: !
|
948
|
+
test: !(($.mobile && ($.mobile.selectmenu || $.mobile.checkboxradio)) || $.fn.select2 || $.fn.chosen || $.fn.selectpicker || $.fn.selectBoxIt)
|
937
949
|
});
|
938
950
|
|
939
951
|
addModule('position', {
|
940
952
|
src: 'plugins/jquery.ui.position.js',
|
941
|
-
test
|
953
|
+
test: !!($.position && $.position.getScrollInfo)
|
942
954
|
});
|
943
955
|
|
944
956
|
loader.loadList(['form-combat', 'position']);
|
@@ -40,11 +40,11 @@ if($.event.special.mousewheel){return;}
|
|
40
40
|
|
41
41
|
$.fn.extend({
|
42
42
|
mousewheel: function(fn) {
|
43
|
-
return fn ? this.
|
43
|
+
return fn ? this.on('mousewheel', fn) : this.trigger('mousewheel');
|
44
44
|
},
|
45
45
|
|
46
46
|
unmousewheel: function(fn) {
|
47
|
-
return this.
|
47
|
+
return this.off('mousewheel', fn);
|
48
48
|
}
|
49
49
|
});
|
50
50
|
|
@@ -150,17 +150,17 @@ function unsetPos(){
|
|
150
150
|
|
151
151
|
$.event.special.mwheelIntent = {
|
152
152
|
setup: function(){
|
153
|
-
var jElm = $(this).
|
153
|
+
var jElm = $(this).on('mousewheel', $.event.special.mwheelIntent.handler);
|
154
154
|
if( this !== doc && this !== root && this !== body ){
|
155
|
-
jElm.
|
155
|
+
jElm.on('mouseleave', unsetPos);
|
156
156
|
}
|
157
157
|
jElm = null;
|
158
158
|
return true;
|
159
159
|
},
|
160
160
|
teardown: function(){
|
161
161
|
$(this)
|
162
|
-
.
|
163
|
-
.
|
162
|
+
.off('mousewheel', $.event.special.mwheelIntent.handler)
|
163
|
+
.off('mouseleave', unsetPos)
|
164
164
|
;
|
165
165
|
return true;
|
166
166
|
},
|
@@ -186,18 +186,18 @@ $.event.special.mwheelIntent = {
|
|
186
186
|
};
|
187
187
|
$.fn.extend({
|
188
188
|
mwheelIntent: function(fn) {
|
189
|
-
return fn ? this.
|
189
|
+
return fn ? this.on("mwheelIntent", fn) : this.trigger("mwheelIntent");
|
190
190
|
},
|
191
191
|
|
192
192
|
unmwheelIntent: function(fn) {
|
193
|
-
return this.
|
193
|
+
return this.off("mwheelIntent", fn);
|
194
194
|
}
|
195
195
|
});
|
196
196
|
|
197
197
|
$(function(){
|
198
198
|
body = doc.body;
|
199
199
|
//assume that document is always scrollable, doesn't hurt if not
|
200
|
-
$(doc).
|
200
|
+
$(doc).on('mwheelIntent.mwheelIntentDefault', $.noop);
|
201
201
|
});
|
202
202
|
})();
|
203
203
|
|
@@ -328,7 +328,24 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
328
328
|
var mousePress = function(e){
|
329
329
|
$(this)[e.type == 'mousepressstart' ? 'addClass' : 'removeClass']('mousepress-ui');
|
330
330
|
};
|
331
|
-
|
331
|
+
var getMonthNameHTML = function(index, year, prefix){
|
332
|
+
var dateCfg = curCfg.date;
|
333
|
+
var str = [];
|
334
|
+
if(!prefix){
|
335
|
+
prefix = '';
|
336
|
+
}
|
337
|
+
$.each({monthNames: 'monthname', monthDigits: 'month-digit', monthNamesShort: 'monthname-short'}, function(prop, cName){
|
338
|
+
var name = [prefix + dateCfg[prop][index]];
|
339
|
+
if(year){
|
340
|
+
name.push(year);
|
341
|
+
if(dateCfg.showMonthAfterYear){
|
342
|
+
name.reverse();
|
343
|
+
}
|
344
|
+
}
|
345
|
+
str.push('<span class="'+ cName +'">'+ name.join(' ') +'</span>');
|
346
|
+
});
|
347
|
+
return str.join('');
|
348
|
+
};
|
332
349
|
|
333
350
|
var widgetProtos = {
|
334
351
|
_addBindings: function(){
|
@@ -542,6 +559,9 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
542
559
|
};
|
543
560
|
})();
|
544
561
|
|
562
|
+
if(o.splitInput && o.jumpInputs == null){
|
563
|
+
o.jumpInputs = true;
|
564
|
+
}
|
545
565
|
|
546
566
|
this.buttonWrapper.on('mousedown', mouseDownInit);
|
547
567
|
|
@@ -771,18 +791,17 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
771
791
|
this.element
|
772
792
|
.on({
|
773
793
|
'keydown': function(e){
|
774
|
-
var handled;
|
794
|
+
var handled, sKey;
|
775
795
|
var key = e.keyCode;
|
776
|
-
|
777
796
|
if(e.shiftKey){return;}
|
778
|
-
|
779
|
-
if((
|
797
|
+
sKey = e.ctrlKey || e.altKey; //|| e.metaKey
|
798
|
+
if((sKey && key == 40)){
|
780
799
|
handled = 'downPage';
|
781
|
-
} else if((
|
800
|
+
} else if((sKey && key == 38)){
|
782
801
|
handled = 'upPage';
|
783
|
-
} else if(key == 33 || (
|
802
|
+
} else if(key == 33 || (sKey && key == 37)){
|
784
803
|
handled = 'prevPage';
|
785
|
-
} else if(key == 34 || (
|
804
|
+
} else if(key == 34 || (sKey && key == 39)){
|
786
805
|
handled = 'nextPage';
|
787
806
|
} else if(e.keyCode == 36 || e.keyCode == 33){
|
788
807
|
handled = 'first';
|
@@ -924,7 +943,7 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
924
943
|
prevDisabled = picker.isInRange([start-1], max, min) ? {'data-action': 'setYearList','value': start-1} : false;
|
925
944
|
}
|
926
945
|
|
927
|
-
str += '<div class="year-list picker-list ws-index-'+ j +'"><div class="ws-picker-header"><button disabled="disabled">'+ start +' – '+(start + 11)+'</button></div>';
|
946
|
+
str += '<div class="year-list picker-list ws-index-'+ j +'"><div class="ws-picker-header"><select data-action="setYearList" class="decade-select">'+ picker.createYearSelect(value, max, min, '', {start: start, step: 12 * size, label: start+' – '+(start + 11)}).join('') +'</select><button disabled="disabled"><span>'+ start +' – '+(start + 11)+'</span></button></div>';
|
928
947
|
lis = [];
|
929
948
|
for(i = 0; i < 12; i++){
|
930
949
|
val = start + i ;
|
@@ -1008,14 +1027,12 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1008
1027
|
|
1009
1028
|
str += '<div class="month-list picker-list ws-index-'+ j +'"><div class="ws-picker-header">';
|
1010
1029
|
|
1011
|
-
str +=
|
1012
|
-
'<select data-action="setMonthList" class="year-select">'+ picker.createYearSelect(value, max, min).join('') +'</select>' :
|
1013
|
-
'<button data-action="setYearList"'+disabled+' value="'+ value +'" tabindex="-1">'+ value +'</button>';
|
1030
|
+
str += '<select data-action="setMonthList" class="year-select">'+ picker.createYearSelect(value, max, min).join('') +'</select> <button data-action="setYearList"'+disabled+' value="'+ value +'" tabindex="-1"><span>'+ value +'</span></button>';
|
1014
1031
|
str += '</div>';
|
1015
1032
|
|
1016
1033
|
for(i = 0; i < 12; i++){
|
1017
1034
|
val = curCfg.date.monthkeys[i+1];
|
1018
|
-
name = (
|
1035
|
+
name = getMonthNameHTML(i);
|
1019
1036
|
classArray = [];
|
1020
1037
|
if(fullyDisabled || !picker.isInRange([value, val], max, min) ){
|
1021
1038
|
disabled = ' disabled=""';
|
@@ -1055,17 +1072,19 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1055
1072
|
};
|
1056
1073
|
|
1057
1074
|
|
1075
|
+
|
1058
1076
|
picker.getDayList = function(value, data){
|
1059
1077
|
|
1060
1078
|
var j, i, k, day, nDay, name, val, disabled, lis, prevDisabled, nextDisabled, yearNext, yearPrev, addTr, week, rowNum;
|
1061
1079
|
|
1062
|
-
var
|
1080
|
+
var lastMonth, curMonth, otherMonth, dateArray, monthName, fullMonthName, monthDigit, buttonStr, date2, classArray;
|
1081
|
+
|
1063
1082
|
var o = data.options;
|
1064
1083
|
var size = o.size;
|
1065
|
-
var max = o.
|
1066
|
-
var min = o.
|
1067
|
-
var currentValue = o.value.split('-');
|
1068
|
-
var
|
1084
|
+
var max = o.maxS;
|
1085
|
+
var min = o.minS;
|
1086
|
+
var currentValue = o.value.split('T')[0].split('-');
|
1087
|
+
var dateCfg = curCfg.date;
|
1069
1088
|
var enabled = 0;
|
1070
1089
|
var str = [];
|
1071
1090
|
var date = new Date(value[0], value[1] - 1, 1);
|
@@ -1073,18 +1092,15 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1073
1092
|
|
1074
1093
|
date.setMonth(date.getMonth() - Math.floor((size - 1) / 2));
|
1075
1094
|
|
1076
|
-
|
1077
|
-
|
1078
|
-
yearNext = picker.isInRange(yearNext, max, min) ? {'data-action': 'setDayList','value': yearNext.join('-')} : false;
|
1079
|
-
|
1080
|
-
yearPrev = [ (value[0] * 1) - 1, value[1] ];
|
1081
|
-
yearPrev = picker.isInRange(yearPrev, max, min) ? {'data-action': 'setDayList','value': yearPrev.join('-')} : false;
|
1082
|
-
}
|
1095
|
+
yearNext = [ (value[0] * 1) + 1, value[1] ];
|
1096
|
+
yearNext = picker.isInRange(yearNext, max, min) ? {'data-action': 'setDayList','value': yearNext.join('-')} : false;
|
1083
1097
|
|
1098
|
+
yearPrev = [ (value[0] * 1) - 1, value[1] ];
|
1099
|
+
yearPrev = picker.isInRange(yearPrev, max, min) ? {'data-action': 'setDayList','value': yearPrev.join('-')} : false;
|
1084
1100
|
|
1085
1101
|
for(j = 0; j < size; j++){
|
1086
1102
|
date.setDate(1);
|
1087
|
-
|
1103
|
+
lastMonth = date.getMonth();
|
1088
1104
|
rowNum = 0;
|
1089
1105
|
if(!j){
|
1090
1106
|
date2 = new Date(date.getTime());
|
@@ -1098,68 +1114,59 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1098
1114
|
|
1099
1115
|
|
1100
1116
|
str.push('<div class="day-list picker-list ws-index-'+ j +'"><div class="ws-picker-header">');
|
1101
|
-
|
1102
|
-
monthName = ['<select data-action="setDayList" class="month-select" tabindex="0">'+ picker.createMonthSelect(dateArray, max, min, monthNames).join('') +'</select>', '<select data-action="setDayList" class="year-select" tabindex="0">'+ picker.createYearSelect(dateArray[0], max, min, '-'+dateArray[1]).join('') +'</select>'];
|
1103
|
-
if(curCfg.date.showMonthAfterYear){
|
1104
|
-
monthName.reverse();
|
1105
|
-
}
|
1106
|
-
str.push( monthName.join(' ') );
|
1107
|
-
}
|
1108
|
-
|
1109
|
-
fullMonthName = [curCfg.date.monthNames[(dateArray[1] * 1) - 1], dateArray[0]];
|
1110
|
-
monthName = [monthNames[(dateArray[1] * 1) - 1], dateArray[0]];
|
1117
|
+
monthName = ['<select data-action="setDayList" class="month-select" tabindex="0">'+ picker.createMonthSelect(dateArray, max, min).join('') +'</select>', '<select data-action="setDayList" class="year-select" tabindex="0">'+ picker.createYearSelect(dateArray[0], max, min, '-'+dateArray[1]).join('') +'</select>'];
|
1111
1118
|
if(curCfg.date.showMonthAfterYear){
|
1112
1119
|
monthName.reverse();
|
1113
|
-
fullMonthName.reverse();
|
1114
1120
|
}
|
1121
|
+
str.push( monthName.join(' ') );
|
1122
|
+
|
1123
|
+
fullMonthName = [dateCfg.monthNames[(dateArray[1] * 1) - 1], dateArray[0]];
|
1115
1124
|
|
1116
|
-
if(
|
1117
|
-
|
1118
|
-
'<button data-action="setMonthList"'+ (o.minView >= 2 ? ' disabled="" ' : '') +' value="'+ dateArray.date +'" tabindex="-1">'+ monthName.join(' ') +'</button>'
|
1119
|
-
);
|
1125
|
+
if(dateCfg.showMonthAfterYear){
|
1126
|
+
fullMonthName.reverse();
|
1120
1127
|
}
|
1121
1128
|
|
1129
|
+
str.push(
|
1130
|
+
'<button data-action="setMonthList"'+ (o.minView >= 2 ? ' disabled="" ' : '') +' value="'+ dateArray.date +'" tabindex="-1">'+ getMonthNameHTML((dateArray[1] * 1) - 1, dateArray[0]) +'</button>'
|
1131
|
+
);
|
1132
|
+
|
1122
1133
|
|
1123
1134
|
str.push('</div><div class="picker-grid"><table role="grid" aria-label="'+ fullMonthName.join(' ') +'"><thead><tr>');
|
1124
1135
|
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
str.push('<th class="day-'+ k +'"><abbr title="'+ curCfg.date.dayNames[k] +'">'+ curCfg.date.dayNamesShort[k] +'</abbr></th>');
|
1136
|
+
str.push('<th class="week-header ws-week">'+ dateCfg.weekHeader +'</th>');
|
1137
|
+
|
1138
|
+
for(k = dateCfg.firstDay; k < dateCfg.dayNamesShort.length; k++){
|
1139
|
+
str.push('<th class="day-'+ k +'"><abbr title="'+ dateCfg.dayNames[k] +'">'+ dateCfg.dayNamesShort[k] +'</abbr></th>');
|
1130
1140
|
}
|
1131
|
-
k =
|
1141
|
+
k = dateCfg.firstDay;
|
1132
1142
|
while(k--){
|
1133
|
-
str.push('<th class="day-'+ k +'"><abbr title="'+
|
1143
|
+
str.push('<th class="day-'+ k +'"><abbr title="'+ dateCfg.dayNames[k] +'">'+ dateCfg.dayNamesShort[k] +'</abbr></th>');
|
1134
1144
|
}
|
1135
1145
|
str.push('</tr></thead><tbody><tr class="ws-row-0">');
|
1136
1146
|
|
1137
|
-
|
1138
|
-
|
1139
|
-
str.push('<td class="week-cell">'+ week +'</td>');
|
1140
|
-
}
|
1147
|
+
week = picker.getWeek(date);
|
1148
|
+
str.push('<td class="week-cell ws-week" role="gridcell" aria-disabled="true">'+ week +'</td>');
|
1141
1149
|
|
1142
1150
|
for (i = 0; i < 99; i++) {
|
1143
1151
|
addTr = (i && !(i % 7));
|
1144
1152
|
curMonth = date.getMonth();
|
1145
|
-
otherMonth =
|
1153
|
+
otherMonth = lastMonth != curMonth;
|
1146
1154
|
day = date.getDay();
|
1147
1155
|
classArray = [];
|
1148
1156
|
|
1149
|
-
if(addTr && otherMonth ){
|
1157
|
+
if(addTr && otherMonth && rowNum >= 5){
|
1158
|
+
|
1150
1159
|
str.push('</tr>');
|
1151
1160
|
break;
|
1152
1161
|
}
|
1153
1162
|
if(addTr){
|
1154
1163
|
rowNum++;
|
1155
|
-
str.push('</tr><tr class="ws-row-'+ rowNum +'">');
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
week = picker.getWeek(date);
|
1160
|
-
}
|
1161
|
-
str.push('<td class="week-cell">'+ week +'</td>');
|
1164
|
+
str.push('</tr><tr class="ws-row-'+ rowNum + ((otherMonth) ? ' other-month-row' : '')+'">');
|
1165
|
+
week++;
|
1166
|
+
if(week > 52){
|
1167
|
+
week = picker.getWeek(date);
|
1162
1168
|
}
|
1169
|
+
str.push('<td class="week-cell ws-week" role="gridcell" aria-disabled="true">'+ week +'</td>');
|
1163
1170
|
}
|
1164
1171
|
|
1165
1172
|
if(!i){
|
@@ -1172,7 +1179,7 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1172
1179
|
date.setDate(date.getDate() - nDay);
|
1173
1180
|
day = date.getDay();
|
1174
1181
|
curMonth = date.getMonth();
|
1175
|
-
otherMonth =
|
1182
|
+
otherMonth = lastMonth != curMonth;
|
1176
1183
|
}
|
1177
1184
|
}
|
1178
1185
|
|
@@ -1197,7 +1204,7 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1197
1204
|
buttonStr += ' class="'+ classArray.join(' ') +'"';
|
1198
1205
|
}
|
1199
1206
|
|
1200
|
-
if(!picker.isInRange(dateArray, max, min)
|
1207
|
+
if(!picker.isInRange(dateArray, max, min)){
|
1201
1208
|
buttonStr += ' disabled=""';
|
1202
1209
|
}
|
1203
1210
|
|
@@ -1240,7 +1247,6 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1240
1247
|
step: $.prop(data.orig, 'step')
|
1241
1248
|
};
|
1242
1249
|
var o = data.options;
|
1243
|
-
var monthNames = curCfg.date[o.monthNamesHead] || curCfg.date[o.monthNames] || curCfg.date.monthNames;
|
1244
1250
|
var gridLabel = '';
|
1245
1251
|
|
1246
1252
|
if(data.type == 'time'){
|
@@ -1251,8 +1257,8 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1251
1257
|
if(tmpValue[1]){
|
1252
1258
|
value[3] = tmpValue[1];
|
1253
1259
|
}
|
1254
|
-
|
1255
|
-
|
1260
|
+
gridLabel = ' aria-label="'+ value[2] +'. '+ (curCfg.date.monthNames[(value[1] * 1) - 1]) +' '+ value[0] +'"';
|
1261
|
+
label = getMonthNameHTML((value[1] * 1) - 1, value[0], value[2] +'. ');
|
1256
1262
|
label = '<button tabindex="-1" data-action="setDayList" value="'+value[0]+'-'+value[1]+'-'+value[2]+'" type="button">'+label+'</button>';
|
1257
1263
|
valPrefix = value[0] +'-'+value[1]+'-'+value[2]+'T';
|
1258
1264
|
}
|
@@ -1338,30 +1344,43 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1338
1344
|
return options;
|
1339
1345
|
};
|
1340
1346
|
|
1341
|
-
picker.createYearSelect = function(value, max, min, valueAdd){
|
1342
|
-
|
1347
|
+
picker.createYearSelect = function(value, max, min, valueAdd, stepper){
|
1348
|
+
if(!stepper){
|
1349
|
+
stepper = {start: value, step: 1, label: value};
|
1350
|
+
}
|
1343
1351
|
var temp;
|
1344
1352
|
var goUp = true;
|
1345
1353
|
var goDown = true;
|
1346
|
-
var options = ['<option selected="">'+
|
1354
|
+
var options = ['<option selected="">'+ stepper.label + '</option>'];
|
1347
1355
|
var i = 0;
|
1356
|
+
var createOption = function(value, add){
|
1357
|
+
var value2, label;
|
1358
|
+
if(stepper.step > 1){
|
1359
|
+
value2 = value + stepper.step - 1;
|
1360
|
+
label = value+' – '+value2;
|
1361
|
+
} else {
|
1362
|
+
label = value;
|
1363
|
+
}
|
1364
|
+
|
1365
|
+
if(picker.isInRange([value], max, min) || (value2 && picker.isInRange([value2], max, min))){
|
1366
|
+
options[add]('<option value="'+ (value+valueAdd) +'">'+ label +'</option>');
|
1367
|
+
return true;
|
1368
|
+
}
|
1369
|
+
};
|
1348
1370
|
if(!valueAdd){
|
1349
1371
|
valueAdd = '';
|
1350
1372
|
}
|
1351
|
-
while(i <
|
1373
|
+
while(i < 18 && (goUp || goDown)){
|
1352
1374
|
i++;
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
} else {
|
1357
|
-
goUp = false;
|
1375
|
+
if(goUp){
|
1376
|
+
temp = stepper.start - (i * stepper.step);
|
1377
|
+
goUp = createOption(temp, 'unshift');
|
1358
1378
|
}
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
} else {
|
1363
|
-
goDown = false;
|
1379
|
+
if(goDown){
|
1380
|
+
temp = stepper.start + (i * stepper.step);
|
1381
|
+
goDown = createOption(temp, 'push');
|
1364
1382
|
}
|
1383
|
+
|
1365
1384
|
}
|
1366
1385
|
return options;
|
1367
1386
|
};
|
@@ -1423,15 +1442,15 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1423
1442
|
setDirButtons(content, popover, 'prev');
|
1424
1443
|
setDirButtons(content, popover, 'next');
|
1425
1444
|
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
}
|
1445
|
+
setDirButtons(content, popover, 'yearPrev');
|
1446
|
+
setDirButtons(content, popover, 'yearNext');
|
1447
|
+
$(o.orig).trigger('pickerchange');
|
1430
1448
|
|
1431
1449
|
if(webshims[content.type]){
|
1432
1450
|
new webshims[content.type](popover.bodyElement.children(), popover, content);
|
1433
1451
|
}
|
1434
|
-
|
1452
|
+
|
1453
|
+
popover.element
|
1435
1454
|
.filter('[data-vertical="bottom"]')
|
1436
1455
|
.triggerHandler('pospopover')
|
1437
1456
|
;
|
@@ -1445,12 +1464,18 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1445
1464
|
|
1446
1465
|
picker.showPickerContent = function(data, popover){
|
1447
1466
|
var options = data.options;
|
1448
|
-
|
1467
|
+
var init = data._popoverinit;
|
1468
|
+
|
1469
|
+
data._popoverinit = true;
|
1470
|
+
|
1471
|
+
if(!init){
|
1449
1472
|
picker.commonInit(data, popover);
|
1450
1473
|
picker.commonDateInit(data, popover);
|
1451
1474
|
}
|
1452
|
-
|
1453
|
-
|
1475
|
+
|
1476
|
+
popover.element.triggerHandler('updatepickercontent');
|
1477
|
+
|
1478
|
+
if(!init || options.restartView) {
|
1454
1479
|
actions.setYearList( options.defValue || options.value, popover, data, options.startView);
|
1455
1480
|
} else {
|
1456
1481
|
actions[popover.element.attr('data-currentview') || 'setYearList']( options.defValue || options.value, popover, data, 0);
|
@@ -1460,6 +1485,9 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1460
1485
|
|
1461
1486
|
|
1462
1487
|
picker.commonDateInit = function(data, popover){
|
1488
|
+
if(data._commonDateInit){return;}
|
1489
|
+
data._commonDateInit = true;
|
1490
|
+
var o = data.options;
|
1463
1491
|
var actionfn = function(e){
|
1464
1492
|
if(!$(this).is('.othermonth') || $(this).css('cursor') == 'pointer'){
|
1465
1493
|
popover.actionFn({
|
@@ -1498,10 +1526,21 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1498
1526
|
}
|
1499
1527
|
};
|
1500
1528
|
var updateContent = function(){
|
1529
|
+
var tmpMinMax;
|
1530
|
+
|
1501
1531
|
if(popover.isDirty){
|
1502
|
-
|
1503
|
-
|
1504
|
-
o.
|
1532
|
+
popover.isDirty = false;
|
1533
|
+
tmpMinMax = o.max.split('T');
|
1534
|
+
o.maxS = tmpMinMax[0].split('-');
|
1535
|
+
if(tmpMinMax[1]){
|
1536
|
+
o.maxS.push(tmpMinMax[1]);
|
1537
|
+
}
|
1538
|
+
|
1539
|
+
tmpMinMax = o.min.split('T');
|
1540
|
+
o.minS = tmpMinMax[0].split('-');
|
1541
|
+
if(tmpMinMax[1]){
|
1542
|
+
o.minS.push(tmpMinMax[1]);
|
1543
|
+
}
|
1505
1544
|
|
1506
1545
|
$('button', popover.buttonRow).each(function(){
|
1507
1546
|
var text;
|
@@ -1531,27 +1570,17 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1531
1570
|
});
|
1532
1571
|
popover.nextElement
|
1533
1572
|
.attr({'aria-label': curCfg.date.nextText})
|
1534
|
-
.find('span')
|
1535
|
-
.html(curCfg.date.nextText)
|
1536
1573
|
;
|
1537
1574
|
popover.prevElement
|
1538
1575
|
.attr({'aria-label': curCfg.date.prevText})
|
1539
|
-
|
1540
|
-
|
1576
|
+
;
|
1577
|
+
popover.yearNextElement
|
1578
|
+
.attr({'aria-label': curCfg.date.nextText})
|
1579
|
+
;
|
1580
|
+
popover.yearPrevElement
|
1581
|
+
.attr({'aria-label': curCfg.date.prevText})
|
1541
1582
|
;
|
1542
1583
|
|
1543
|
-
if(o.yearButtons){
|
1544
|
-
popover.yearNextElement
|
1545
|
-
.attr({'aria-label': curCfg.date.nextText})
|
1546
|
-
.find('span')
|
1547
|
-
.html(curCfg.date.nextText)
|
1548
|
-
;
|
1549
|
-
popover.yearPrevElement
|
1550
|
-
.attr({'aria-label': curCfg.date.prevText})
|
1551
|
-
.find('span')
|
1552
|
-
.html(curCfg.date.prevText)
|
1553
|
-
;
|
1554
|
-
}
|
1555
1584
|
|
1556
1585
|
generateList(o, o.maxS, o.minS);
|
1557
1586
|
|
@@ -1564,6 +1593,23 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1564
1593
|
popover.isDirty = false;
|
1565
1594
|
};
|
1566
1595
|
|
1596
|
+
|
1597
|
+
if(data.type == 'time'){
|
1598
|
+
o.minView = 3;
|
1599
|
+
o.startView = 3;
|
1600
|
+
}
|
1601
|
+
if(!o.minView){
|
1602
|
+
o.minView = 0;
|
1603
|
+
}
|
1604
|
+
if(o.startView < o.minView){
|
1605
|
+
o.startView = o.minView;
|
1606
|
+
webshims.warn("wrong config for minView/startView.");
|
1607
|
+
}
|
1608
|
+
if(!o.size){
|
1609
|
+
o.size = 1;
|
1610
|
+
}
|
1611
|
+
|
1612
|
+
|
1567
1613
|
popover.actionFn = function(obj){
|
1568
1614
|
if(actions[obj['data-action']]){
|
1569
1615
|
actions[obj['data-action']](obj.value, popover, data, 0);
|
@@ -1574,35 +1620,34 @@ webshims.register('forms-picker', function($, webshims, window, document, undefi
|
|
1574
1620
|
|
1575
1621
|
|
1576
1622
|
|
1577
|
-
popover.contentElement.html('<button class="ws-prev" tabindex="0"><
|
1623
|
+
popover.contentElement.html('<div class="prev-controls ws-picker-controls"><button class="ws-super-prev ws-year-btn" tabindex="0"></button><button class="ws-prev" tabindex="0"></button></div> <div class="next-controls ws-picker-controls"><button class="ws-next" tabindex="0"></button><button class="ws-super-next ws-year-btn" tabindex="0"></button></div><div class="ws-picker-body"></div><div class="ws-button-row"><button type="button" class="ws-current" data-action="changeInput" value="'+today[data.type]+'" tabindex="0"></button> <button type="button" data-action="changeInput" value="" class="ws-empty" tabindex="0"></button></div>');
|
1578
1624
|
popover.nextElement = $('button.ws-next', popover.contentElement);
|
1579
1625
|
popover.prevElement = $('button.ws-prev', popover.contentElement);
|
1626
|
+
popover.yearNextElement = $('button.ws-super-next', popover.contentElement);
|
1627
|
+
popover.yearPrevElement = $('button.ws-super-prev', popover.contentElement);
|
1580
1628
|
popover.bodyElement = $('div.ws-picker-body', popover.contentElement);
|
1581
1629
|
popover.buttonRow = $('div.ws-button-row', popover.contentElement);
|
1582
1630
|
popover.element.on('updatepickercontent', updateContent);
|
1583
1631
|
|
1584
|
-
if(data.options.yearButtons){
|
1585
|
-
popover.element.addClass('ws-year-buttons');
|
1586
|
-
popover.yearNextElement = $('<button class="ws-super-next" tabindex="0"><span></span></button>').insertAfter(popover.nextElement);
|
1587
|
-
popover.yearPrevElement = $('<button class="ws-super-prev" tabindex="0"><span></span></button>').insertBefore(popover.prevElement);
|
1588
|
-
}
|
1589
|
-
|
1590
1632
|
popover.contentElement
|
1591
1633
|
.on('click', 'button[data-action]', actionfn)
|
1592
1634
|
.on('change', 'select[data-action]', actionfn)
|
1593
1635
|
;
|
1594
1636
|
|
1595
|
-
if(data.options.inlinePicker){
|
1596
|
-
data.options.updateOnInput = true;
|
1597
|
-
}
|
1598
1637
|
|
1599
|
-
$(
|
1638
|
+
$(o.orig).on('input', function(){
|
1600
1639
|
var currentView;
|
1601
|
-
if(
|
1640
|
+
if(o.updateOnInput && popover.isVisible && o.value && (currentView = popover.element.attr('data-currentview'))){
|
1602
1641
|
actions[currentView]( data.options.value , popover, data, 0);
|
1603
1642
|
}
|
1604
1643
|
});
|
1605
1644
|
$(document).onTrigger('wslocalechange', data._propertyChange);
|
1645
|
+
|
1646
|
+
if(o.inlinePicker){
|
1647
|
+
o.updateOnInput = true;
|
1648
|
+
}
|
1649
|
+
|
1650
|
+
$(o.orig).trigger('pickercreated');
|
1606
1651
|
};
|
1607
1652
|
|
1608
1653
|
});
|