Skip to content
Permalink
Browse files

Initial commit of datepicker functional demo.

  • Loading branch information
1Marc committed Jun 1, 2008
1 parent 1c2d48f commit f4f8ba867ff4b2fa52dc42667923b76c9e302c3a
Showing with 1,241 additions and 0 deletions.
  1. BIN ui/demos/functional/datepicker/demo/img/active-bg.gif
  2. BIN ui/demos/functional/datepicker/demo/img/ar.gif
  3. BIN ui/demos/functional/datepicker/demo/img/au.gif
  4. BIN ui/demos/functional/datepicker/demo/img/br.gif
  5. BIN ui/demos/functional/datepicker/demo/img/calendar.gif
  6. BIN ui/demos/functional/datepicker/demo/img/calendar2.gif
  7. BIN ui/demos/functional/datepicker/demo/img/cn.gif
  8. BIN ui/demos/functional/datepicker/demo/img/dark-bg.gif
  9. BIN ui/demos/functional/datepicker/demo/img/hover-bg.gif
  10. BIN ui/demos/functional/datepicker/demo/img/id.gif
  11. BIN ui/demos/functional/datepicker/demo/img/ie.gif
  12. BIN ui/demos/functional/datepicker/demo/img/ke.gif
  13. BIN ui/demos/functional/datepicker/demo/img/lb.gif
  14. BIN ui/demos/functional/datepicker/demo/img/next.gif
  15. BIN ui/demos/functional/datepicker/demo/img/normal-bg.gif
  16. BIN ui/demos/functional/datepicker/demo/img/nz.gif
  17. BIN ui/demos/functional/datepicker/demo/img/prev.gif
  18. BIN ui/demos/functional/datepicker/demo/img/se.gif
  19. BIN ui/demos/functional/datepicker/demo/img/tab.png
  20. BIN ui/demos/functional/datepicker/demo/img/us.gif
  21. BIN ui/demos/functional/datepicker/demo/img/za.gif
  22. +64 −0 ui/demos/functional/datepicker/demo/jquery.localisation.js
  23. +158 −0 ui/demos/functional/datepicker/demo/ui.datepicker.alt.css
  24. +51 −0 ui/demos/functional/datepicker/demo/ui.datepicker.demo.css
  25. +81 −0 ui/demos/functional/datepicker/demo/ui.datepicker.demo.js
  26. +887 −0 ui/demos/functional/datepicker/index.html
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,64 @@
/* http://keith-wood.name/localisation.html
Localisation assistance for jQuery v1.0.2.
Written by Keith Wood (kbwood@iprimus.com.au) June 2007.
Under the Creative Commons Licence http://creativecommons.org/licenses/by/3.0/
Share or Remix it but please Attribute the author. */

(function($) { // Hide scope, no $ conflict

/* Load applicable localisation package(s) for one or more jQuery packages.
Assumes that the localisations are named <base>-<lang>.js
and loads them in order from least to most specific.
For example, $.localise('jquery-calendar');
with the browser set to 'en-US' would attempt to load
jquery-calendar-en.js and jquery-calendar-en-US.js.
Also accepts an array of package names to process.
Optionally specify whether or not to include the base file,
the desired language, and/or the timeout period, e.g.
$.localise(['jquery-calendar', 'jquery-timeentry'],
{loadBase: true; language: 'en-AU', timeout: 300}); */
$.localise = function(pkg, settings) {
var saveSettings = {async: $.ajaxSettings.async, timeout: $.ajaxSettings.timeout};
$.ajaxSetup({async: false, timeout: (settings && settings.timeout ? settings.timeout : 500)});
var localiseOne = function(pkg, lang) {
if (settings && settings.loadBase) {
$.getScript(pkg + '.js');
}
if (lang.length >= 2) {
$.getScript(pkg + '-' + lang.substring(0, 2) + '.js');
}
if (lang.length >= 5) {
$.getScript(pkg + '-' + lang.substring(0, 5) + '.js');
}
};
var lang = normaliseLang(settings && settings.language ? settings.language : $.defaultLanguage);
if (isArray(pkg)) {
for (i = 0; i < pkg.length; i++) {
localiseOne(pkg[i], lang);
}
}
else {
localiseOne(pkg, lang);
}
$.ajaxSetup(saveSettings);
};

/* Retrieve the default language set for the browser. */
$.defaultLanguage = normaliseLang(navigator.language ? navigator.language /* Mozilla */ :
navigator.userLanguage /* IE */);

/* Ensure language code is in the format aa-AA. */
function normaliseLang(lang) {
lang = lang.replace(/_/, '-').toLowerCase();
if (lang.length > 3) {
lang = lang.substring(0, 3) + lang.substring(3).toUpperCase();
}
return lang;
}

/* Determine whether an object is an array. */
function isArray(a) {
return (a.constructor && a.constructor.toString().match(/\Array\(\)/));
}

})(jQuery);
@@ -0,0 +1,158 @@
/* Alternate UI date picker styles */
#datepicker_div, .datepicker_inline {
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
padding: 0;
margin: 0;
background: #d8d8d8 url(../img/dark-bg.gif) repeat;
color: #008;
width: 220px;
}
#datepicker_div {
display: none;
border: 1px solid #008;
z-index: 10; /*must have*/
}
.datepicker_inline {
float: left;
display: block;
border: 0;
}
.datepicker_dialog {
padding: 5px !important;
border: 4px ridge #88c !important;
}
button.datepicker_trigger {
width: 25px;
}
img.datepicker_trigger {
margin: 2px;
vertical-align: middle;
}
.datepicker_prompt {
float: left;
padding: 2px;
xbackground: #d8d8d8 url(../img/dark-bg.gif) repeat;
background: transparent;
color: #008;
}
* html .datepicker_prompt {
width: 185px;
}
.datepicker_control, .datepicker_links, .datepicker_header, .datepicker {
clear: both;
float: left;
width: 100%;
}
.datepicker_control, .datepicker_links {
font-weight: bold;
font-size: 80%;
letter-spacing: 1px;
}

.datepicker_links label { /* disabled links */
padding: 2px 5px;
color: #88c;
}
.datepicker_clear, .datepicker_prev {
float: left;
width: 34%;
}
.datepicker_current {
float: left;
width: 30%;
text-align: center;
}
.datepicker_close, .datepicker_next {
float: right;
width: 34%;
text-align: right;
}
.datepicker_header {
padding: 1px 0 3px;

text-align: center;
font-weight: bold;
height: 1.3em;
}
.datepicker_header select {
background: #d8d8d8 url(../img/dark-bg.gif) repeat;
color: #008;
border: 0px;
font-weight: bold;
}
.datepicker {
background: #f8f8f8 url(../img/normal-bg.gif) repeat;
color: #008;
text-align: center;
font-size: 100%;
}
.datepicker a {
display: block;
width: 100%;
}
.datepicker_titleRow {
background: #d8d8d8 url(../img/dark-bg.gif) repeat;
}
.datepicker_weekEndCell {
background: #d8d8d8 url(../img/dark-bg.gif) repeat;
}
.datepicker_daysCellOver {
background: #3c75c4 url(../img/active-bg.gif) repeat;
}
.datepicker_unselectable {
color: #88c;
}
.datepicker_today {
font-weight: bold;
}
.datepicker_currentDay {
background: #3c75c4 url(../img/active-bg.gif) repeat;
}

/* ________ CALENDAR LINKS _______
** Reset link properties and then override them with !important */
#datepicker_div a, .datepicker_inline a {
cursor: pointer;
margin: 0;
padding: 0;
background: none;
color: #000;
}
.datepicker_control a, .datepicker_links a {
padding: 2px 5px !important;
}
.datepicker_control a:hover {
background: #9dbae1 url(../img/hover-bg.gif) repeat !important;
}
.datepicker_links a:hover, .datepicker_titleRow a:hover {
background: #9dbae1 url(../img/hover-bg.gif) repeat !important;
}

/* ___________ MULTIPLE MONTHS _________*/

.datepicker_multi .datepicker {
border: 1px solid #008;
}
.datepicker_oneMonth {
float: left;
width: 220px;
}
.datepicker_newRow {
clear: left;
}

/* ___________ IE6 IFRAME FIX ________ */

.datepicker_cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}
@@ -0,0 +1,51 @@
#tab_menu1 { margin:0.5em 0 0 0; padding:0; font-size:1em; }
.tab_group1 { clear:left; padding-top:0; display:none; }
.demoLabel { float: left; width: 18em; }
.ar_day { color: white !important; background: #eee url(img/ar.gif) no-repeat center !important; }
.au_day { color: blue !important; background: #eee url(img/au.gif) no-repeat center !important; }
.br_day { color: green !important; background: #eee url(img/br.gif) no-repeat center !important; }
.cn_day { color: red !important; background: #eee url(img/cn.gif) no-repeat center !important; }
.id_day { color: white !important; background: #eee url(img/id.gif) no-repeat center !important; }
.ie_day { color: white !important; background: #eee url(img/ie.gif) no-repeat center !important; }
.ke_day { color: red !important; background: #eee url(img/ke.gif) no-repeat center !important; }
.lb_day { color: white !important; background: #eee url(img/lb.gif) no-repeat center !important; }
.nz_day { color: blue !important; background: #eee url(img/nz.gif) no-repeat center !important; }
.se_day { color: blue !important; background: #eee url(img/se.gif) no-repeat center !important; }
.us_day { color: white !important; background: #eee url(img/us.gif) no-repeat center !important; }
.za_day { color: green !important; background: #eee url(img/za.gif) no-repeat center !important; }
code { font-size: 13px; font-family: Verdana, Arial, Helvetica, sans-serif; }
pre { clear: both; padding-left: 2em; }
#embedButton { width: 7em; }
#embedButton + img { position: relative; left: -21px; top: -1px; }
.tabs {
list-style: none;
}
.tabs li {
float: left;
}
.tabs li a {
display:block;
padding: 0.4em .75em;
margin: 0;
border-left: 1px solid #fff;
border-right: 1px solid #ddd;
cursor: pointer;
cursor: hand;
text-decoration: none;
color: #eee;
border-top: 1px solid #F9F9F9;
}
.tabs li a:hover, .tabs li a.over {
border-top: 1px solid #000;
}
.tab_group1 h3 {
font-weight: bold;
margin-top:15px;
border-bottom: 1px solid #ddd;
}
.nextFeature {
margin-top: 15px;
}
ol li {
margin-top: 1em;
}
@@ -0,0 +1,81 @@
// Initialise the date picker demonstrations
$(document).ready(function () {
// initialize tab interface
tabs.init();
// reset defaults to English
$.datepicker.setDefaults($.datepicker.regional['']);
// replace script tags with HTML code
$(".demojs").each(function () {
$(this).before( '<pre style="padding-top:0 !important"><code class="javascript">' +
$(this).html().replace(/</g, '&lt;') + "</code></pre>" );
eval( $(this).html() );
});
// Localization
if ($.browser.safari)
$('.languageSelect,.l10nDatepicker,#frFullFormat').attr({ disabled: 'disabled' });
else
$('.languageSelect').change(localise);
// Stylesheets
$('#altStyle').datepicker({buttonImage: 'demo/img/calendar2.gif',
prevText: '<img src="demo/img/prev.gif" style="vertical-align: middle;"/> Prev',
nextText: 'Next <img src="demo/img/next.gif" style="vertical-align: middle;"/>'});
$('#button3').click(function() {
$(this).datepicker('dialog', $('#altDialog').val(),
setAltDateFromDialog, {prompt: 'Choose a date', speed: '',
prevText: '<img src="demo/img/prev.gif" style="vertical-align: middle;"/> Prev',
nextText: 'Next <img src="demo/img/next.gif" style="vertical-align: middle;"/>'});
});
});

// Load and apply a localisation package for the date picker
function localise() {
var input = $('input', this.parentNode.parentNode);
var date = $(input).datepicker('getDate');
var language = $(this).val();
$.localise('i18n/ui.datepicker', {language: language});
$(input).datepicker('change', $.datepicker.regional[language]);
$.datepicker.setDefaults($.datepicker.regional['']); // Reset for general usage
if (date) {
$(input).datepicker('setDate', date);
input.val($.datepicker.formatDate(
$.datepicker.regional[language].dateFormat, date));
}
}

// Demonstrate a callback from inline configuration
function showDay(input) {
var date = $(input).datepicker('getDate');
$('#inlineDay').html(date ? $.datepicker.formatDate('DD', date) : 'blank');
}

// Display a date selected in a "dialog"
function setAltDateFromDialog(date) {
$('#altDialog').val(date);
}

// Custom Tabs written by Marc Grabanski
var tabs =
{
init : function ()
{
// Setup tabs
$("div[@class^=tab_group]").hide();
$("div[@class^=tab_group]:first").show().id;
$("ul[@id^=tab_menu] a:eq(0)").addClass('over');

// Slide visible up and clicked one down
$("ul[@id^=tab_menu] a").each(function(i){
$(this).click(function () {
$("ul[@id^=tab_menu] a.over").removeClass('over');
$(this).addClass('over');
$("div[@class^=tab_group]:visible").hide();
$( $(this).attr("href") ).fadeIn();
tabs.stylesheet = $(this).attr("href") == "#styles" ? 'alt' : 'default';
$('link').each(function() {
this.disabled = (this.title != '' && this.title != tabs.stylesheet);
});
return false;
});
});
}
}

0 comments on commit f4f8ba8

Please sign in to comment.
You can’t perform that action at this time.