Skip to content

Commit c1a9e23

Browse files
apsdehalarschmitz
authored andcommitted
Build: Add jqm datepicker wrapper and update ui
1 parent 22dd612 commit c1a9e23

23 files changed

Lines changed: 2491 additions & 43 deletions

bower.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
],
1616
"dependencies": {
1717
"jquery": ">=1.8.0",
18-
"jquery-ui": "arschmitz/jquery-ui#button-fixup"
18+
"jquery-ui": "jquery/jquery-ui#master"
1919
},
2020
"devDependencies": {
2121
"requirejs": "2.1.2",
2222
"qunit": "1.18.0",
2323
"qunit-assert-classes": "1.0.2",
2424
"jquery-1.11.3": "jquery#1.11.3",
25+
"jquery-mobile-datepicker-wrapper": "arschmitz/jquery-mobile-datepicker-wrapper#0.1.9",
2526
"jshint": "2.4.0"
2627
}
2728
}

build/tasks/options/bowercopy.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ return {
1818
"jshint/jshint.js": "jshint/dist/jshint.js"
1919
}
2020
},
21+
demos: {
22+
files: {
23+
"jquery-mobile-datepicker-wrapper/jquery.mobile.datepicker.js":
24+
"jquery-mobile-datepicker-wrapper/jquery.mobile.datepicker.js",
25+
"jquery-mobile-datepicker-wrapper/jquery.mobile.datepicker.css":
26+
"jquery-mobile-datepicker-wrapper/jquery.mobile.datepicker.css",
27+
"jquery-mobile-datepicker-wrapper/jquery.mobile.datepicker.theme.css":
28+
"jquery-mobile-datepicker-wrapper/jquery.mobile.datepicker.theme.css"
29+
}
30+
},
2131
requirejs: {
2232
files: {
2333
"requirejs/require.js": "requirejs/require.js"
@@ -54,10 +64,7 @@ return {
5464
"jquery-ui/jquery-1-7.js": "jquery-ui/ui/jquery-1-7.js",
5565
"jquery-ui/keycode.js": "jquery-ui/ui/keycode.js",
5666
"jquery-ui/labels.js": "jquery-ui/ui/labels.js",
57-
"jquery-ui/LICENSE.txt": "jquery-ui/ui/LICENSE.txt",
58-
"jquery-ui/LICENSE.txt~HEAD": "jquery-ui/ui/LICENSE.txt~HEAD",
59-
"jquery-ui/LICENSE.txt~Widgets": "jquery-ui/ui/LICENSE.txt~Widgets",
60-
"jquery-ui/MIT-LICENSE.txt": "jquery-ui/ui/MIT-LICENSE.txt",
67+
"jquery-ui/LICENSE.txt": "jquery-ui/LICENSE.txt",
6168
"jquery-ui/plugin.js": "jquery-ui/ui/plugin.js",
6269
"jquery-ui/safe-active-element.js": "jquery-ui/ui/safe-active-element.js",
6370
"jquery-ui/safe-blur.js": "jquery-ui/ui/safe-blur.js",
@@ -70,6 +77,7 @@ return {
7077
"jquery-ui/widgets/button.js": "jquery-ui/ui/widgets/button.js",
7178
"jquery-ui/widgets/checkboxradio.js": "jquery-ui/ui/widgets/checkboxradio.js",
7279
"jquery-ui/widgets/controlgroup.js": "jquery-ui/ui/widgets/controlgroup.js",
80+
"jquery-ui/widgets/datepicker.js": "jquery-ui/ui/widgets/datepicker.js",
7381
"jquery-ui/widgets/tabs.js": "jquery-ui/ui/widgets/tabs.js"
7482
}
7583
}
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
div.hasDatepicker {
2+
display: block;
3+
padding: 0;
4+
overflow: visible;
5+
margin: 8px 0;
6+
max-width:340px
7+
}
8+
.ui-datepicker {
9+
overflow: visible; margin: 0;
10+
}
11+
.ui-datepicker .ui-datepicker-header {
12+
position:relative;
13+
padding:.6em 0;
14+
border-bottom: 0;
15+
font-weight: bold;
16+
}
17+
.ui-datepicker .ui-datepicker-prev,
18+
.ui-datepicker .ui-datepicker-next {
19+
padding: 1px 0 1px 2px;
20+
position:absolute;
21+
top: .6em;
22+
margin-top: 0;
23+
text-indent: -9999px;
24+
-webkit-border-radius: 1em;
25+
border-radius: 1em;
26+
vertical-align: middle;
27+
margin-right: .625em;
28+
width: 1.75em;
29+
height: 1.75em;
30+
white-space: nowrap !important;
31+
}
32+
.ui-datepicker .ui-datepicker-prev:after,
33+
.ui-datepicker .ui-datepicker-next:after {
34+
left: 50%;
35+
margin-left: -11px;
36+
top: 50%;
37+
margin-top: -11px;
38+
content: "";
39+
position: absolute;
40+
display: block;
41+
width: 22px;
42+
height: 22px;
43+
background-color: rgba(0,0,0,.3) /*{global-icon-disc}*/;
44+
background-position: center center;
45+
background-repeat: no-repeat;
46+
-webkit-border-radius: 1em;
47+
border-radius: 1em;
48+
}
49+
.ui-datepicker .ui-datepicker-next:after{
50+
background-image: url("data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%2214%2C7%207%2C0%207%2C5%200%2C5%200%2C9%207%2C9%207%2C14%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E");
51+
}
52+
.ui-datepicker .ui-datepicker-prev:after{
53+
background-image: url("data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%22%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20style%3D%22enable-background%3Anew%200%200%2014%2014%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20fill%3D%22%23FFF%22%20points%3D%227%2C5%207%2C0%200%2C7%207%2C14%207%2C9%2014%2C9%2014%2C5%20%22%2F%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3Cg%3E%3C%2Fg%3E%3C%2Fsvg%3E");
54+
}
55+
.ui-datepicker .ui-datepicker-prev {
56+
left:9px;
57+
}
58+
.ui-datepicker .ui-datepicker-next {
59+
right:2px;
60+
}
61+
.ui-datepicker .ui-datepicker-title {
62+
margin: 0 2.3em;
63+
line-height: 1.8em;
64+
text-align: center;
65+
}
66+
.ui-datepicker .ui-datepicker-title select {
67+
font-size:1em; margin:1px 0;
68+
}
69+
.ui-datepicker select.ui-datepicker-month-year {
70+
width: 100%;
71+
}
72+
.ui-datepicker select.ui-datepicker-month,
73+
.ui-datepicker select.ui-datepicker-year {
74+
width: 49%;
75+
}
76+
.ui-datepicker table {
77+
width: 100%;
78+
border-collapse: collapse;
79+
margin:0;
80+
}
81+
.ui-datepicker td {
82+
border-width: 1px;
83+
padding: 0;
84+
border-style: solid;
85+
text-align: center;
86+
min-width: 41px;
87+
}
88+
.ui-datepicker td span,
89+
.ui-datepicker a {
90+
display: block;
91+
text-align: center;
92+
text-decoration: none;
93+
/* from .ui-btn class */
94+
font-size: 16px;
95+
position: relative;
96+
text-overflow: ellipsis;
97+
overflow: hidden;
98+
white-space: nowrap;
99+
cursor: pointer;
100+
-webkit-user-select: none;
101+
-moz-user-select: none;
102+
-ms-user-select: none;
103+
user-select: none;
104+
text-decoration: none !important;
105+
font-weight: bold;
106+
border-width: 1px;
107+
border-style: solid;
108+
}
109+
.ui-datepicker td a {
110+
padding: .2em 0;
111+
font-weight: bold;
112+
margin: 0;
113+
border-width: 0;
114+
}
115+
.ui-datepicker-calendar th {
116+
padding-top: .4em;
117+
padding-bottom: .4em;
118+
border-width: 1px;
119+
border-style: solid;
120+
}
121+
.ui-datepicker-calendar th span,
122+
.ui-datepicker-calendar span.ui-state-default {
123+
opacity: .7;
124+
}
125+
.ui-datepicker-calendar td a,
126+
.ui-datepicker-calendar td span {
127+
padding: .6em .5em;
128+
}
129+
.ui-datepicker .ui-state-disabled {
130+
opacity: 1;
131+
}
132+
.ui-datepicker.ui-corner-all,
133+
.ui-datepicker .ui-datepicker-header.ui-corner-all {
134+
border-radius: 0;
135+
-webkit-border-radius: 0;
136+
}
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/*!
2+
* jQuery Mobile Datepicker
3+
* http://uglymongrel.com.com
4+
*
5+
* Copyright 2014 Alexander Schmitz and other contributors
6+
* Released under the MIT license.
7+
* http://jquery.org/license
8+
*
9+
* http://api.uglymongrel.com.com/jquery-mobile-datepicker-wrapper/
10+
*/
11+
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
12+
//>>description: Consistent styling for native dates. Tapping opens a calender to select date.
13+
//>>label: Datepicker
14+
//>>group: Forms
15+
//>>css.structure: ../external/uglymongrel/arschmitz/jquery.mobile.datepicker.wrapper.css
16+
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css
17+
//>>excludeEnd("jqmBuildExclude");
18+
(function( factory ) {
19+
if ( typeof define === "function" && define.amd ) {
20+
21+
// AMD. Register as an anonymous module.
22+
define([
23+
"jquery",
24+
"jquery-ui/datepicker"
25+
], factory );
26+
} else {
27+
28+
// Browser globals
29+
factory( jQuery );
30+
}
31+
}(function( $ ) {
32+
$.widget("mobile.date",{
33+
options:{
34+
defaultDate: null, // Used when field is blank: actual date,
35+
// +/-number for offset from today, null for today
36+
appendText: "", // Display text following the input box, e.g. showing the format
37+
buttonText: "...", // Text for trigger button
38+
buttonImage: "", // URL for trigger button image
39+
buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
40+
hideIfNoPrevNext: false, // True to hide next/previous month links
41+
// if not applicable, false to just disable them
42+
navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
43+
gotoCurrent: false, // True if today link goes back to current selection instead
44+
changeMonth: false, // True if month can be selected directly, false if only prev/next
45+
changeYear: false, // True if year can be selected directly, false if only prev/next
46+
yearRange: "c-10:c+10", // Range of years to display in drop-down,
47+
// either relative to today's year (-nn:+nn), relative to currently displayed year
48+
// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
49+
showOtherMonths: false, // True to show dates in other months, false to leave blank
50+
selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
51+
showWeek: false, // True to show week of the year, false to not show it
52+
calculateWeek: this.iso8601Week, // How to calculate the week of the year,
53+
// takes a Date and returns the number of the week for it
54+
shortYearCutoff: "+10", // Short year values < this are in the current century,
55+
// > this are in the previous century,
56+
// string value starting with "+" for current year + value
57+
minDate: null, // The earliest selectable date, or null for no limit
58+
maxDate: null, // The latest selectable date, or null for no limit
59+
beforeShowDay: null, // Function that takes a date and returns an array with
60+
// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
61+
// [2] = cell title (optional), e.g. $.datepicker.noWeekends
62+
onSelect: null, // Define a callback function when a date is selected
63+
onChangeMonthYear: null, // Define a callback function when the month or year is changed
64+
beforeShow: null, // Define a callback function when the calendar is shown
65+
numberOfMonths: 1, // Number of months to show at a time
66+
showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
67+
stepMonths: 1, // Number of months to step back/forward
68+
stepBigMonths: 12, // Number of months to step back/forward for the big links
69+
altField: "", // Selector for an alternate field to store selected dates into
70+
altFormat: "", // The date format to use for the alternate field
71+
constrainInput: true, // The input is constrained by the current date format
72+
showButtonPanel: false, // True to show button panel, false to not show it
73+
autoSize: false, // True to size the input for the date format, false to leave as is
74+
disabled: false, // The initial disabled state
75+
inline: false, // True to set the calendar always visible
76+
theme: "a",
77+
dateFormat: "mm/dd/yy"
78+
},
79+
_getCreateOptions: function(){
80+
$.extend( this.options, $.datepicker._defaults );
81+
return this._super();
82+
},
83+
_create:function(){
84+
var calendar;
85+
86+
if( this.options.inline ){
87+
this.options.altField = this.element;
88+
calendar = $("<div>").datepicker(this.options);
89+
this.element.parent().after(calendar);
90+
} else {
91+
this.element.datepicker( this.options );
92+
calendar = this.element.datepicker( "widget" );
93+
}
94+
95+
this.baseWidget = ( !this.options.inline )? this.element: this.calendar;
96+
97+
if ( this.options.inline ) {
98+
this._on({
99+
"change": function() {
100+
calendar.datepicker( "setDate", this.element.val() );
101+
}
102+
});
103+
}
104+
},
105+
setOption:function( key, value ){
106+
this.baseWidget.datepicker( "option", key, value );
107+
},
108+
getDate: function(){
109+
return this.baseWidget.datepicker( "getDate" );
110+
},
111+
_destroy: function(){
112+
return this.baseWidget.datepicker( "destroy" );
113+
},
114+
isDisabled: function(){
115+
return this.baseWidget.datepicker( "isDisabled" );
116+
},
117+
refresh: function(){
118+
return this.baseWidget.datepicker( "refresh" );
119+
},
120+
setDate: function( date ){
121+
return this.baseWidget.datepicker( "setDate", date );
122+
},
123+
widget:function(){
124+
return this.element;
125+
}
126+
});
127+
128+
return $.mobile.date;
129+
130+
}));
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*!
2+
* jQuery Mobile Datepicker Wrapper 1.4.2
3+
http://uglymongrel.com.com
4+
*
5+
* Copyright Alexander Schmitz and other contributors
6+
* Released under the MIT license.
7+
* http://uglymongrel.com.org/license
8+
*
9+
*/
10+
11+
/* Globals */
12+
.ui-datepicker,
13+
.ui-datepicker .ui-datepicker-next,
14+
.ui-datepicker .ui-datepicker-prev {
15+
/* ui-shadow */
16+
-webkit-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.15) /*{global-box-shadow-color}*/;
17+
-moz-box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.15) /*{global-box-shadow-color}*/;
18+
box-shadow: 0 1px 3px /*{global-box-shadow-size}*/ rgba(0,0,0,.15) /*{global-box-shadow-color}*/;
19+
}
20+
/* Swatches */
21+
/* A
22+
-----------------------------------------------------------------------------------------------------------*/
23+
html .ui-overlay-a .ui-datepicker td span,
24+
html .ui-overlay-a .ui-datepicker a,
25+
html .ui-body-a .ui-datepicker td span,
26+
html .ui-body-a .ui-datepicker a,
27+
.ui-page-theme-a .ui-datepicker td span,
28+
.ui-page-theme-a .ui-datepicker a {
29+
/* ui-btn-a */
30+
background-color: #f6f6f6 /*{a-bup-background-color}*/;
31+
border-color: #ddd /*{a-bup-border}*/;
32+
color: #333 /*{a-bup-color}*/;
33+
text-shadow: 0 /*{a-bup-shadow-x}*/ 1px /*{a-bup-shadow-y}*/ 0 /*{a-bup-shadow-radius}*/ #f3f3f3 /*{a-bup-shadow-color}*/;
34+
}
35+
html body .ui-datepicker .ui-state-highlight {
36+
/* ui-btn-down */
37+
background-color: #e8e8e8 /*{a-bdown-background-color}*/;
38+
border-color: #ddd /*{a-bdown-border}*/;
39+
color: #333 /*{a-bdown-color}*/;
40+
text-shadow: 0 /*{a-bdown-shadow-x}*/ 1px /*{a-bdown-shadow-y}*/ 0 /*{a-bdown-shadow-radius}*/ #f3f3f3 /*{a-bdown-shadow-color}*/;
41+
}
42+
html body .ui-datepicker .ui-state-active {
43+
/* ui-btn-active */
44+
background-color: #3388cc /*{a-active-background-color}*/;
45+
border-color: #3388cc /*{a-active-border}*/;
46+
color: #fff /*{a-active-color}*/;
47+
text-shadow: 0 /*{a-active-shadow-x}*/ 1px /*{a-active-shadow-y}*/ 0 /*{a-active-shadow-radius}*/ #005599 /*{a-active-shadow-color}*/;
48+
}
49+
.ui-datepicker td,
50+
.ui-datepicker .ui-datepicker-header {
51+
/* ui-body-a */
52+
border-color: #ddd /*{a-body-border}*/;
53+
background-color: #fff /*{a-body-background-color}*/;
54+
color: #333 /*{a-body-color}*/;
55+
text-shadow: 0 /*{a-body-shadow-x}*/ 1px /*{a-body-shadow-y}*/ 0 /*{a-body-shadow-radius}*/ #f3f3f3 /*{a-body-shadow-color}*/;
56+
}
57+
58+
.ui-datepicker th {
59+
/* ui-bar-a */
60+
background-color: #e9e9e9 /*{a-bar-background-color}*/;
61+
border-color: #ddd /*{a-bar-border}*/;
62+
color: #333 /*{a-bar-color}*/;
63+
text-shadow: 0 /*{a-bar-shadow-x}*/ 1px /*{a-bar-shadow-y}*/ 0 /*{a-bar-shadow-radius}*/ #eee /*{a-bar-shadow-color}*/;
64+
font-weight: bold;
65+
}

external/jquery-ui/data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI :data @VERSION
2+
* jQuery UI :data master
33
* http://jqueryui.com
44
*
55
* Copyright jQuery Foundation and other contributors

0 commit comments

Comments
 (0)