diff options
Diffstat (limited to 'demos')
116 files changed, 3916 insertions, 0 deletions
diff --git a/demos/functional/datepicker/debug.html b/demos/functional/datepicker/debug.html new file mode 100644 index 000000000..91dab145b --- /dev/null +++ b/demos/functional/datepicker/debug.html @@ -0,0 +1,21 @@ +<html> + <head> + <title>Only core files for easy debug</title> + <link rel="stylesheet" href="../../../themes/ui.datepicker.css" type="text/css" media="screen" title="default" charset="utf-8"> + </head> + <body> + <input type="text" name="testing" value="click" id="testing" /> + + <!-- Include jQuery --> + <script src="../../../../jquery/jquery-1.2.6.js" type="text/javascript" charset="utf-8"></script> + + <!-- Include UI Datepicker --> + <script src="../../../source/ui.datepicker.js" type="text/javascript" charset="utf-8"></script> + + <script type="text/javascript" charset="utf-8"> + $(function(){ + $('#testing').datepicker(); + }); + </script> + </body> +</html>
\ No newline at end of file diff --git a/demos/functional/datepicker/demo/img/active-bg.gif b/demos/functional/datepicker/demo/img/active-bg.gif Binary files differnew file mode 100644 index 000000000..d608c5469 --- /dev/null +++ b/demos/functional/datepicker/demo/img/active-bg.gif diff --git a/demos/functional/datepicker/demo/img/ar.gif b/demos/functional/datepicker/demo/img/ar.gif Binary files differnew file mode 100644 index 000000000..f34c90f5c --- /dev/null +++ b/demos/functional/datepicker/demo/img/ar.gif diff --git a/demos/functional/datepicker/demo/img/au.gif b/demos/functional/datepicker/demo/img/au.gif Binary files differnew file mode 100644 index 000000000..db005b4c7 --- /dev/null +++ b/demos/functional/datepicker/demo/img/au.gif diff --git a/demos/functional/datepicker/demo/img/br.gif b/demos/functional/datepicker/demo/img/br.gif Binary files differnew file mode 100644 index 000000000..8b8bf147d --- /dev/null +++ b/demos/functional/datepicker/demo/img/br.gif diff --git a/demos/functional/datepicker/demo/img/calendar.gif b/demos/functional/datepicker/demo/img/calendar.gif Binary files differnew file mode 100644 index 000000000..d0abaa7c0 --- /dev/null +++ b/demos/functional/datepicker/demo/img/calendar.gif diff --git a/demos/functional/datepicker/demo/img/calendar2.gif b/demos/functional/datepicker/demo/img/calendar2.gif Binary files differnew file mode 100644 index 000000000..519a1fd4a --- /dev/null +++ b/demos/functional/datepicker/demo/img/calendar2.gif diff --git a/demos/functional/datepicker/demo/img/cn.gif b/demos/functional/datepicker/demo/img/cn.gif Binary files differnew file mode 100644 index 000000000..5482753d6 --- /dev/null +++ b/demos/functional/datepicker/demo/img/cn.gif diff --git a/demos/functional/datepicker/demo/img/dark-bg.gif b/demos/functional/datepicker/demo/img/dark-bg.gif Binary files differnew file mode 100644 index 000000000..1dea48a8f --- /dev/null +++ b/demos/functional/datepicker/demo/img/dark-bg.gif diff --git a/demos/functional/datepicker/demo/img/hover-bg.gif b/demos/functional/datepicker/demo/img/hover-bg.gif Binary files differnew file mode 100644 index 000000000..fbf94fc2c --- /dev/null +++ b/demos/functional/datepicker/demo/img/hover-bg.gif diff --git a/demos/functional/datepicker/demo/img/id.gif b/demos/functional/datepicker/demo/img/id.gif Binary files differnew file mode 100644 index 000000000..d7f4ab8a3 --- /dev/null +++ b/demos/functional/datepicker/demo/img/id.gif diff --git a/demos/functional/datepicker/demo/img/ie.gif b/demos/functional/datepicker/demo/img/ie.gif Binary files differnew file mode 100644 index 000000000..827c498d2 --- /dev/null +++ b/demos/functional/datepicker/demo/img/ie.gif diff --git a/demos/functional/datepicker/demo/img/ke.gif b/demos/functional/datepicker/demo/img/ke.gif Binary files differnew file mode 100644 index 000000000..e352177c7 --- /dev/null +++ b/demos/functional/datepicker/demo/img/ke.gif diff --git a/demos/functional/datepicker/demo/img/lb.gif b/demos/functional/datepicker/demo/img/lb.gif Binary files differnew file mode 100644 index 000000000..f204918fe --- /dev/null +++ b/demos/functional/datepicker/demo/img/lb.gif diff --git a/demos/functional/datepicker/demo/img/next.gif b/demos/functional/datepicker/demo/img/next.gif Binary files differnew file mode 100644 index 000000000..be0959b1b --- /dev/null +++ b/demos/functional/datepicker/demo/img/next.gif diff --git a/demos/functional/datepicker/demo/img/normal-bg.gif b/demos/functional/datepicker/demo/img/normal-bg.gif Binary files differnew file mode 100644 index 000000000..bdb506869 --- /dev/null +++ b/demos/functional/datepicker/demo/img/normal-bg.gif diff --git a/demos/functional/datepicker/demo/img/nz.gif b/demos/functional/datepicker/demo/img/nz.gif Binary files differnew file mode 100644 index 000000000..86b89cb27 --- /dev/null +++ b/demos/functional/datepicker/demo/img/nz.gif diff --git a/demos/functional/datepicker/demo/img/prev.gif b/demos/functional/datepicker/demo/img/prev.gif Binary files differnew file mode 100644 index 000000000..95d840f47 --- /dev/null +++ b/demos/functional/datepicker/demo/img/prev.gif diff --git a/demos/functional/datepicker/demo/img/se.gif b/demos/functional/datepicker/demo/img/se.gif Binary files differnew file mode 100644 index 000000000..7301c598e --- /dev/null +++ b/demos/functional/datepicker/demo/img/se.gif diff --git a/demos/functional/datepicker/demo/img/tab.png b/demos/functional/datepicker/demo/img/tab.png Binary files differnew file mode 100644 index 000000000..01c8ab417 --- /dev/null +++ b/demos/functional/datepicker/demo/img/tab.png diff --git a/demos/functional/datepicker/demo/img/us.gif b/demos/functional/datepicker/demo/img/us.gif Binary files differnew file mode 100644 index 000000000..39c472e26 --- /dev/null +++ b/demos/functional/datepicker/demo/img/us.gif diff --git a/demos/functional/datepicker/demo/img/za.gif b/demos/functional/datepicker/demo/img/za.gif Binary files differnew file mode 100644 index 000000000..197cbd888 --- /dev/null +++ b/demos/functional/datepicker/demo/img/za.gif diff --git a/demos/functional/datepicker/demo/jquery.localisation.js b/demos/functional/datepicker/demo/jquery.localisation.js new file mode 100644 index 000000000..b11e37835 --- /dev/null +++ b/demos/functional/datepicker/demo/jquery.localisation.js @@ -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); diff --git a/demos/functional/datepicker/demo/ui.datepicker.alt.css b/demos/functional/datepicker/demo/ui.datepicker.alt.css new file mode 100644 index 000000000..d07a6e7bf --- /dev/null +++ b/demos/functional/datepicker/demo/ui.datepicker.alt.css @@ -0,0 +1,158 @@ +/* Alternate UI date picker styles */ +#ui-datepicker-div, .ui-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; +} +#ui-datepicker-div { + display: none; + border: 1px solid #008; + z-index: 9999; /*must have*/ +} +.ui-datepicker-inline { + float: left; + display: block; + border: 0; +} +.ui-datepicker-dialog { + padding: 5px !important; + border: 4px ridge #88c !important; +} +button.ui-datepicker-trigger { + width: 25px; +} +img.ui-datepicker-trigger { + margin: 2px; + vertical-align: middle; +} +.ui-datepicker-prompt { + float: left; + padding: 2px; + xbackground: #d8d8d8 url(../img/dark-bg.gif) repeat; + background: transparent; + color: #008; +} +* html .ui-datepicker-prompt { + width: 185px; +} +.ui-datepicker-control, .ui-datepicker-links, .ui-datepicker-header, .ui-datepicker { + clear: both; + float: left; + width: 100%; +} +.ui-datepicker-control, .ui-datepicker-links { + font-weight: bold; + font-size: 80%; + letter-spacing: 1px; +} + +.ui-datepicker-links label { /* disabled links */ + padding: 2px 5px; + color: #88c; +} +.ui-datepicker-clear, .ui-datepicker-prev { + float: left; + width: 34%; +} +.ui-datepicker-current { + float: left; + width: 30%; + text-align: center; +} +.ui-datepicker-close, .ui-datepicker-next { + float: right; + width: 34%; + text-align: right; +} +.ui-datepicker-header { + padding: 1px 0 3px; + + text-align: center; + font-weight: bold; + height: 1.3em; +} +.ui-datepicker-header select { + background: #d8d8d8 url(../img/dark-bg.gif) repeat; + color: #008; + border: 0px; + font-weight: bold; +} +.ui-datepicker { + background: #f8f8f8 url(../img/normal-bg.gif) repeat; + color: #008; + text-align: center; + font-size: 100%; +} +.ui-datepicker a { + display: block; + width: 100%; +} +.ui-datepicker-titleRow { + background: #d8d8d8 url(../img/dark-bg.gif) repeat; +} +.ui-datepicker-weekEndCell { + background: #d8d8d8 url(../img/dark-bg.gif) repeat; +} +.ui-datepicker-daysCellOver { + background: #3c75c4 url(../img/active-bg.gif) repeat; +} +.ui-datepicker-unselectable { + color: #88c; +} +.ui-datepicker-today { + font-weight: bold; +} +.ui-datepicker-currentDay { + background: #3c75c4 url(../img/active-bg.gif) repeat; +} + +/* ________ CALENDAR LINKS _______ + +** Reset link properties and then override them with !important */ +#ui-datepicker-div a, .ui-datepicker-inline a { + cursor: pointer; + margin: 0; + padding: 0; + background: none; + color: #000; +} +.ui-datepicker-control a, .ui-datepicker-links a { + padding: 2px 5px !important; +} +.ui-datepicker-control a:hover { + background: #9dbae1 url(../img/hover-bg.gif) repeat !important; +} +.ui-datepicker-links a:hover, .ui-datepicker-titleRow a:hover { + background: #9dbae1 url(../img/hover-bg.gif) repeat !important; +} + +/* ___________ MULTIPLE MONTHS _________*/ + +.ui-datepicker-multi .datepicker { + border: 1px solid #008; +} +.ui-datepicker-oneMonth { + float: left; + width: 220px; +} +.ui-datepicker-newRow { + clear: left; +} + +/* ___________ IE6 IFRAME FIX ________ */ + +.ui-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*/ +}
\ No newline at end of file diff --git a/demos/functional/datepicker/demo/ui.datepicker.demo.css b/demos/functional/datepicker/demo/ui.datepicker.demo.css new file mode 100644 index 000000000..2920d857f --- /dev/null +++ b/demos/functional/datepicker/demo/ui.datepicker.demo.css @@ -0,0 +1,53 @@ +#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; background: #eee; } +#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; + background: #78A5CE; +} +.tabs li a:hover, .tabs li a.over { + border-top: 1px solid #000; + background: #333; +} +.tab_group1 h3 { + font-weight: bold; + margin-top:15px; + border-bottom: 1px solid #ddd; +} +.nextFeature { + margin-top: 15px; +} +ol li { + margin-top: 1em; +}
\ No newline at end of file diff --git a/demos/functional/datepicker/demo/ui.datepicker.demo.js b/demos/functional/datepicker/demo/ui.datepicker.demo.js new file mode 100644 index 000000000..3d7d9b640 --- /dev/null +++ b/demos/functional/datepicker/demo/ui.datepicker.demo.js @@ -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><code class="javascript">' + + $(this).html().replace(/</g, '<') + "</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('../../../source/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; + }); + }); + } +} diff --git a/demos/functional/datepicker/index.html b/demos/functional/datepicker/index.html new file mode 100644 index 000000000..4b28d7e3a --- /dev/null +++ b/demos/functional/datepicker/index.html @@ -0,0 +1,887 @@ +<!DOCTYPE html + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>jQuery UI Datepicker</title> + + <!-- Include UI Datepicker CSS --> + <link rel="stylesheet" href="../../../themes/ui.datepicker.css" type="text/css" media="screen" title="default" charset="utf-8"> + + <!-- Include Demo Stylesheets --> + <link rel="stylesheet" type="text/css" href="demo/ui.datepicker.alt.css" title="alt" id="alt" disabled="disabled"/> + <link rel="stylesheet" type="text/css" href="demo/ui.datepicker.demo.css" /> + + </head> + <body> + <div id="wrap"> + <div id="content"> + <ul id="tab_menu1" class="tabs"> + <li><a href="#default">Defaults</a></li> + <li><a href="#invoke">Invocation</a></li> + <li><a href="#keys">Keystrokes</a></li> + <li><a href="#restrict">Restricting</a></li> + <li><a href="#formats">Formats</a></li> + <li><a href="#custom">Customize</a></li> + <li><a href="#l10n">Localisation</a></li> + <li style="clear: left;"><a href="#range">Date range</a></li> + <li><a href="#misc1">Misc. 1</a></li> + <li><a href="#misc2">Misc. 2</a></li> + <li><a href="#change">Change Settings</a></li> + <li><a href="#inline">Inline</a></li> + <li><a href="#styles">Stylesheets</a></li> + <li><a href="#compat">Compatibility</a></li> + </ul> + <div style="clear:left"></div> + <div id="default" class="tab_group1 container" style="display:block"> + <h3>Defaults</h3> + <p>A date picker can easily be added to an input field with default settings.</p> + <p><span class="demoLabel">Default date picker:</span> + <input type="text" size="30" value="click to show datepicker" id="defaultFocus"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#defaultFocus').datepicker(); +</script> + <p><span class="demoLabel">IE select issue:</span> + <select><option>Show how the date picker covers a select in IE</option></select></p> + <p>The defaults are:</p> + <ul> + <li>Date picker appears on focus</li> + <li>Text is in English</li> + <li>Date format is mm/dd/yyyy</li> + <li><em>Clear</em>/<em>Close</em> controls show at the top</li> + <li>Month and year are selectable directly</li> + <li>10 years before and after the selected year are shown</li> + <li>Show a single month</li> + <li>Select a single date</li> + <li>Week starts on Sunday</li> + <li>Day names are clickable to change the first day of the week</li> + <li>Days in other months are not displayed</li> + <li>No date restrictions</li> + <li>Clicking elsewhere closes the date picker</li> + </ul> + <p>Processed fields are marked with a class of <code>hasDatepicker</code> + and are not re-processed if targetted a second time.</p> + <p>You can override the default settings that apply to all date picker instances.</p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$.datepicker.setDefaults({showOn: 'both', buttonImageOnly: true, + buttonImage: 'demo/img/calendar.gif', buttonText: 'Calendar'}); +</script> + </div> + <div id="invoke" class="tab_group1 container"> + <h3>Invocation</h3> + <p>The date picker can be invoked in a variety of ways, as shown below. + Also shown is the use of an image only trigger, + and how the controls and buttons appear when disabled.</p> + <p><span class="demoLabel">Datepicker appears on focus:</span> + <input type="text" size="10" id="invokeFocus"/> + <input type="button" id="enableFocus" value="Disable"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#invokeFocus').datepicker({showOn: 'focus'}); +</script> + <p><span class="demoLabel">Appears via text button:</span> + <input type="text" size="10" id="invokeButton"/> + <input type="button" id="enableButton" value="Disable"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#invokeButton').datepicker({showOn: 'button', buttonText: '...', + buttonImage: '', buttonImageOnly: false}); +</script> + <p style="clear:both"><span class="demoLabel">Appears both ways:</span> + <input type="text" size="10" class="invokeBoth"/> + <input type="button" id="enableBoth" value="Disable"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('.invokeBoth').datepicker({showOn: 'both', buttonImage: 'demo/img/calendar.gif', buttonImageOnly: true}); +</script> + <p>You can embed the trigger image within the input area via CSS.</p> + <p style="clear:both"><span class="demoLabel">Embedded button:</span> + <input type="text" size="10" id="embedButton"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#embedButton').datepicker({showOn: 'button', buttonImage: 'demo/img/calendar.gif', buttonImageOnly: true}); + +// CSS +// #embedButton + img { position: relative; left: -21px; top: -1px; } +</script> + <p>Enable and disable datepicker with 'enable' and 'disable' commands.</p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#enableFocus').toggle( + function () { this.value = 'Enable'; $('#invokeFocus').datepicker('disable'); }, + function () { this.value = 'Disable'; $('#invokeFocus').datepicker('enable'); }); +$('#enableButton').toggle( + function () { this.value = 'Enable'; $('#invokeButton').datepicker('disable'); }, + function () { this.value = 'Disable'; $('#invokeButton').datepicker('enable'); }); +$('#enableBoth').toggle( + function () { this.value = 'Enable'; $('.invokeBoth:first').datepicker('disable'); }, + function () { this.value = 'Disable'; $('.invokeBoth:first').datepicker('enable'); }); +</script> + <p>The date picker can also be triggered externally for a particular input.</p> + <p><span class="demoLabel">External trigger:</span> + <button id="button1">Open date picker</button></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#button1').click(function() { + $('#invokeFocus').datepicker('show'); +}); +</script> + <p>Or even opened as a "dialog". If the <em>blockUI</em> plugin is available, + it is used to create a modal dialog.</p> + <p><span class="demoLabel">Date picker dialog:</span> + <input type="text" size="10" id="invokeDialog" readonly="readonly"/> + <button id="button2">Open dialog</button></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#button2').click(function() { + $(this).datepicker('dialog', $('#invokeDialog').val(), + setDateFromDialog, {prompt: 'Choose a date', speed: ''}); +}); + +// Display a date selected in a "dialog" +function setDateFromDialog(date) { + $('#invokeDialog').val(date); +} +</script> + </div> + <div id="keys" class="tab_group1 container"> + <h3>Keystrokes</h3> + <p>The date picker also responds to keystrokes entered in the input field.</p> + <p><span class="demoLabel">Keyboard driven:</span> + <input type="text" size="10" class="invokeBoth"/></p> + <p>The relevant keystrokes are:</p> + <ul> + <li><span class="demoLabel">page up/down</span>previous/next month</li> + <li><span class="demoLabel">ctrl+page up/down</span>previous/next year</li> + <li><span class="demoLabel">ctrl+home</span>current month or open when closed</li> + <li><span class="demoLabel">ctrl+left/right</span>previous/next day</li> + <li><span class="demoLabel">ctrl+up/down</span>previous/next week</li> + <li><span class="demoLabel">enter</span>accept the selected date</li> + <li><span class="demoLabel">ctrl+end</span>close and erase the date</li> + <li><span class="demoLabel">escape</span>close the date picker without selection</li> + </ul> + </div> + <div id="restrict" class="tab_group1 container"> + <h3>Restricting</h3> + <p>You can restrict the functionality of the date picker in various ways. + The first example sets the first day of the week to Monday and prevents it from being + changed, as well as preventing the month and year from being selected directly.</p> + <p><span class="demoLabel">Restricted functionality:</span> + <input type="text" size="10" id="restrictControls"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#restrictControls').datepicker({firstDay: 1, changeFirstDay: false, + changeMonth: false, changeYear: false}); +</script> + <p>You can also limit the range of dates selectable within the date picker. + Here it's between 26-Jan-05 and 26-Jan-07.</p> + <p><span class="demoLabel">Limited dates:</span> + <input type="text" size="10" id="restrictDates"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#restrictDates').datepicker({minDate: new Date(2005, 1 - 1, 26), + maxDate: new Date(2007, 1 - 1, 26)}); +</script> + <p>Or set a range relative to today by specifying a number + rather than an exact date, in this case in the coming year.</p> + <p><span class="demoLabel">Limited dates (relative):</span> + <input type="text" size="10" id="relativeDates"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#relativeDates').datepicker({minDate: 0, maxDate: 365}); +</script> + <p>The relative dates can also be specified as a number and a period - + 'd' for days, 'w' for weeks, 'm' for months, or 'y' for years.</p> + <p><span class="demoLabel">Limited dates (extended):</span> + <input type="text" size="10" id="extendedDates"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#extendedDates').datepicker({minDate: '-1d', maxDate: '6y'}); +</script> + <p>Note that the range of selectable months and years changes appropriately. Also, + note that the <em>Today</em> link is no longer available as today is not in the range. + By default, the <em>Prev</em> and <em>Next</em> links are disabled if they are not + applicable. You can override this to remove them instead, with the + <code>hideIfNoPrevNext</code> setting.</p> + </div> + <div id="formats" class="tab_group1 container"> + <h3>Date Formats</h3> + <p>You can set a variety of date formats for the date picker, + with the default being 'mm/dd/yy'.</p> + <p><span class="demoLabel">Medium format:</span> + <input type="text" size="10" id="mediumFormat"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#mediumFormat').datepicker({dateFormat: 'M d, yy'}); +</script> + <p><span class="demoLabel">Long format:</span> + <input type="text" size="20" id="longFormat"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#longFormat').datepicker({dateFormat: 'MM d, yy'}); +</script> + <p><span class="demoLabel">Full format:</span> + <input type="text" size="30" id="fullFormat"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#fullFormat').datepicker({dateFormat: 'DD, MM d, yy'}); +</script> + <p>Display dates without the century. The century is then determined based on the + <code>shortYearCutoff</code> setting, which defaults to 10 years in the future ('+10'). + Year values less than or equal to this cutoff are interpreted as being in the current + century, while those greater than the cutoff are taken to be in the previous century.</p> + <p><span class="demoLabel">No century:</span> + <input type="text" size="10" id="noCentury"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#noCentury').datepicker({dateFormat: 'dd/mm/y'}); +</script> + <p><span class="demoLabel">ISO date format:</span> + <input type="text" size="10" id="isoFormat"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#isoFormat').datepicker({dateFormat: 'yy-mm-dd'}); +</script> + <p><span class="demoLabel">French full format:</span> + <input type="text" size="30" id="frFullFormat"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#frFullFormat').datepicker($.datepicker.regional['fr']); +$('#frFullFormat').datepicker('change', {dateFormat: 'DD, MM d, yy'}); +</script> + <p>The formatting codes are:</p> + <ul> + <li><span class="demoLabel">d</span>day of month (no leading zero)</li> + <li><span class="demoLabel">dd</span>day of month (two digit)</li> + <li><span class="demoLabel">D</span>day name short</li> + <li><span class="demoLabel">DD</span>day name long</li> + <li><span class="demoLabel">m</span>month of year (no leading zero)</li> + <li><span class="demoLabel">mm</span>month of year (two digit)</li> + <li><span class="demoLabel">M</span>month name short</li> + <li><span class="demoLabel">MM</span>month name long</li> + <li><span class="demoLabel">y</span>year (two digit)</li> + <li><span class="demoLabel">yy</span>year (four digit)</li> + <li><span class="demoLabel">'...'</span>literal text</li> + <li><span class="demoLabel">''</span>single quote</li> + </ul> + </div> + <div id="custom" class="tab_group1 container"> + <h3>Customize</h3> + <p>You can customize the selectability and/or appearance of individual days + by setting a callback function that accepts a date and returns an array + with the first entry being true/false for selectability and the second + entry being a CSS class to apply (or '' for none). One appropriate + function is built-in that prevents the selection of days on weekends.</p> + <p><span class="demoLabel">No weekends:</span> + <input type="text" size="10" id="noWeekends"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#noWeekends').datepicker({beforeShowDay: $.datepicker.noWeekends}); +</script> + <p>Or you can provide your own function. The one below highlights and + prevents selection of a set of national days.</p> + <p><span class="demoLabel">National days:</span> + <input type="text" size="10" id="nationalDays"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#nationalDays').datepicker({beforeShowDay: nationalDays}); + +// Highlight certain national days on the calendar +var natDays = [[1, 26, 'au'], [2, 6, 'nz'], [3, 17, 'ie'], [4, 27, 'za'], [5, 25, 'ar'], [6, 6, 'se'], + [7, 4, 'us'], [8, 17, 'id'], [9, 7, 'br'], [10, 1, 'cn'], [11, 22, 'lb'], [12, 12, 'ke']]; + +function nationalDays(date) { + for (i = 0; i < natDays.length; i++) { + if (date.getMonth() == natDays[i][0] - 1 && date.getDate() == natDays[i][1]) { + return [false, natDays[i][2] + '_day']; + } + } + return [true, '']; +} +</script> + <p>With CSS like the following:</p> +<pre><code>.au_day { color: blue !important; background: #eee url(au.gif) no-repeat center !important; }</code></pre> + </div> + <div id="l10n" class="tab_group1 container"> + <h3>Localisation</h3> + <p>You can localise the date picker for other languages and regional differences. + The date picker defaults to English with a date format of MM/DD/YYYY, + but you can easily translate the text into another language and date format.</p> + <p><span class="demoLabel"> + <select class="languageSelect"> + <option value="zh-CN">简体中文 (Chinese Simplified)</option> + <option value="zh-TW">簡體中文 (Chinese Traditional)</option> + <option value="bg">български език (Bulgarian)</option> + <option value="ca">Català (Catalan)</option> + <option value="cs">Čeština (Czech)</option> + <option value="da">Dansk (Danish)</option> + <option value="de">Deutsch (German)</option> + <option value="es">Español (Spanish)</option> + <option value="fr" selected="selected">Français (French)</option> + <option value="ko">한국어 (Korean)</option> + <option value="is">Íslenska (Icelandic)</option> + <option value="it">Italiano (Italian)</option> + <option value="hu">Magyar (Hungarian)</option> + <option value="nl">Nederlands (Dutch)</option> + <option value="ja">日本語 (Japanese)</option> + <option value="lt">lietuvių kalba (Lithuanian)</option> + <option value="no">Norsk (Norwegian)</option> + <option value="th">Phasa thai (Thai)</option> + <option value="pl">Polski (Polish)</option> + <option value="pt-BR">Português (Portuguese)</option> + <option value="ro">Română (Romanian)</option> + <option value="ru">Русский (Russian)</option> + <option value="sk">Slovenčina (Slovak)</option> + <option value="fi">suomi (Finnish)</option> + <option value="sv">Svenska (Swedish)</option> + <option value="tr">Türkçe (Turkish)</option> + </select>:</span> + <input type="text" size="10" id="l10nDatepicker"/></p> + <p>The presentation is slightly different for right-to-left languages.</p> + <p><span class="demoLabel"> + <select class="languageSelect"> + <option value="he" selected="selected">עברית (Hebrew)</option> + </select>:</span> + <input type="text" size="10" id="rtlDatepicker"/></p> + <p>You need to load the appropriate language package, which + adds a language set ($.datepicker.regional[langCode]) and + automatically sets this language as the default for all date pickers.</p> +<pre><code class="html"><script type="text/javascript" src="ui.datepicker-fr.js"></script></code></pre> + <p>Thereafter, if desired, you can restore the original language settings.</p> +<pre><code class="javascript">$.datepicker.setDefaults($.datepicker.regional['']);</code></pre> + <p>And then configure the language per date picker instance.</p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#l10nDatepicker').datepicker($.extend({showStatus: true}, $.datepicker.regional['fr'])); +$('#rtlDatepicker').datepicker($.extend({showStatus: true}, $.datepicker.regional['he'])); +</script> + <p><strong>Localisation packages:</strong></p> + <p>Localisation packages can be found below under <a href="#documentation">Settings and Documentation</a>.</p> + </div> + <div id="range" class="tab_group1 container"> + <h3>Date Range</h3> + <p>Use a custom field settings function to create a date range control: + two date fields, each restricting the other. The function takes an + input field as an argument and returns a settings object (anonymous).</p> + <p><span class="demoLabel">Date range:</span> + <input type="text" size="10" class="dateRange" id="dFrom"/> to + <input type="text" size="10" class="dateRange" id="dTo"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('.dateRange').datepicker({beforeShow: customRange}); + +// Customize two date pickers to work as a date range +function customRange(input) { + return {minDate: (input.id == 'dTo' ? $('#dFrom').datepicker('getDate') : null), + maxDate: (input.id == 'dFrom' ? $('#dTo').datepicker('getDate') : null)}; +} +</script> + <p>Select a date range on one date picker, first click is the start date and second click is the end date. + The last example show six months in two rows of three months + with <i>Previous</i> and <i>Next</i> moving three months at a time.</p> + <p><span class="demoLabel">Date range:</span> + <input type="text" size="25" id="rangeSelect"/></p> + +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#rangeSelect').datepicker({rangeSelect: true}); +</script> + <p><span class="demoLabel">Two months with range select:</span> + <input type="text" size="25" id="rangeSelect2Months"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#rangeSelect2Months').datepicker({rangeSelect: true, numberOfMonths: 2}); +</script> + <p><span class="demoLabel">Six months with range select:</span> + <input type="text" size="25" id="rangeSelect6Months"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#rangeSelect6Months').datepicker({rangeSelect: true, numberOfMonths: [2, 3], + stepMonths: 3, prevText: '<< Previous Months', nextText: 'Next Months >>'}); +</script> + </div> + <div id="misc1" class="tab_group1 container"> + <h3>Miscellaneous 1</h3> + <p>Set the date shown when first opening the date picker. The default is today.</p> + <p><span class="demoLabel">Open at 01-Jan-2007:</span> + <input type="text" size="10" id="openDateJan01"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#openDateJan01').datepicker({defaultDate: new Date(2007, 1 - 1, 1)}); +</script> + <p><span class="demoLabel">Open at 7 days from today:</span> + <input type="text" size="10" id="openDatePlus7"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#openDatePlus7').datepicker({defaultDate: +7}); +</script> + <p>Or specify a period from today - 'd' for days, + 'w' for weeks, 'm' for months, or 'y' for years.</span> + <p><span class="demoLabel">Open at 2 weeks from today:</span> + <input type="text" size="10" id="openDate2Weeks"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#openDate2Weeks').datepicker({defaultDate: '2w'}); +</script> + <p>Show the weeks of the year. Defaults to the ISO 8601 definition (weeks start + on Mondays and the first week of the year contains January 4). Change the + week calculation by setting <code>calculateWeek</code> to a function that + takes a date as a parameter and returns the number of the week.</p> + <p><span class="demoLabel">Show week of the year:</span> + <input type="text" size="10" id="showWeeks"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#showWeeks').datepicker({showWeeks: true, firstDay: 1, changeFirstDay: false, showOtherMonths: true}); +</script> + <p>Additional settings let you move the <em>Clear</em>/<em>Close</em> controls + to the bottom, hide the <em>Clear</em> control to make the date mandatory, + display the days in other months (non-selectable), + and show a status bar (with a custom display for today). + Callback functions are also added to operate when a date + is selected and when the datepicker is closed. + If no <code>onSelect</code> callback is specified, the + <code>onchange</code> event of the input field is triggered.</p> + <p><span class="demoLabel">Additional settings:</span> + <input type="text" size="10" id="addSettings"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#addSettings').datepicker({ + closeAtTop: false, + mandatory: true, + showOtherMonths: true, + showStatus: true, + statusForDate: highlightToday, + onSelect: alertDate, // invoke alertDate function + onClose: function(date) { alert('Closed with ' + date); } +}); + +// Demonstrate the callback on select +function alertDate(date) { + alert('The date is ' + date); +} + +// Demonstrate the callback for date status +function highlightToday(date, inst) { + var today = new Date(); + today = new Date(today.getFullYear(), today.getMonth(), today.getDate()); + return $.datepicker.dateStatus(date, inst) + + (today.getTime() == date.getTime() ? ' (today)' : ''); +} +</script> + </div> + <div id="misc2" class="tab_group1 container"> + <h3>Miscellaneous 2</h3> + <p>Hide the datepicker on demand (press <em>alt-h</em> here) or + remove the datepicker altogether if you've finished with it.</p> + <p><span class="demoLabel">Remove popup datepicker:</span> + <input type="text" size="10" id="hideDatepicker" class="removeDatepicker"/> + <button id="removeButton">Remove</button></p> + <p><span class="demoLabel">Remove inline datepicker:</span> + <span class="removeDatepicker"></span></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +var opts = {beforeShowDay: $.datepicker.noWeekends}; +$('.removeDatepicker').datepicker(opts); +$('#hideDatepicker').keypress(function(e) { + if (e.altKey && (e.charCode || e.keyCode) == 104) { + $('#hideDatepicker').datepicker('hide'); + } +}); +$('#removeButton').toggle(function() { + $(this).text('Re-attach'); + $('.removeDatepicker').datepicker('destroy'); + }, + function() { + $(this).text('Remove'); + $('.removeDatepicker').datepicker(opts); + } +); +</script> + <p><strong>(Advanced Technique)</strong><br />Connect the date picker to linked drop-downs. You still need an input field, + but it is hidden following the drop-downs.</p> + <p><span class="demoLabel">Linked drop-downs:</span> + <select id="selectMonth"><option value="01">Jan</option><option value="02">Feb</option> + <option value="03">Mar</option><option value="04">Apr</option> + <option value="05">May</option><option value="06">Jun</option> + <option value="07">Jul</option><option value="08">Aug</option> + <option value="09">Sep</option><option value="10">Oct</option> + <option value="11">Nov</option><option value="12">Dec</option></select> + <select id="selectDay"><option value="01">1</option><option value="02">2</option> + <option value="03">3</option><option value="04">4</option> + <option value="05">5</option><option value="06">6</option> + <option value="07">7</option><option value="08">8</option> + <option value="09">9</option><option value="10">10</option> + <option value="11">11</option><option value="12">12</option> + <option value="13">13</option><option value="14">14</option> + <option value="15">15</option><option value="16">16</option> + <option value="17">17</option><option value="18">18</option> + <option value="19">19</option><option value="20">20</option> + <option value="21">21</option><option value="22">22</option> + <option value="23">23</option><option value="24">24</option> + <option value="25">25</option><option value="26">26</option> + <option value="27">27</option><option value="28">28</option> + <option value="29">29</option><option value="30">30</option> + <option value="31">31</option></select> + <select id="selectYear"><option value="2001">2001</option><option value="2002">2002</option> + <option value="2003">2003</option><option value="2004">2004</option> + <option value="2005">2005</option><option value="2006">2006</option> + <option value="2007">2007</option><option value="2008">2008</option> + <option value="2009">2009</option><option value="2010">2010</option></select> + <input type="hidden" size="10" id="linkedDates" disabled="disabled"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#linkedDates').datepicker({ + minDate: new Date(2001, 1 - 1, 1), + maxDate: new Date(2010, 12 - 1, 31), + beforeShow: readLinked, + onSelect: updateLinked +}); + +// Prepare to show a date picker linked to three select controls +function readLinked() { + $('#linkedDates').val( + $('#selectMonth').val() + '/' + + $('#selectDay').val() + '/' + + $('#selectYear').val() + ); + return {}; +} + +// Update three select controls to match a date picker selection +function updateLinked(date) { + $('#selectMonth').val(date.substring(0, 2)); + $('#selectDay').val(date.substring(3, 5)); + $('#selectYear').val(date.substring(6, 10)); +} + +$('#selectMonth, #selectYear').change(checkLinkedDays); + +// Prevent selection of invalid dates through the select controls +function checkLinkedDays() { + var daysInMonth = 32 - new Date($('#selectYear').val(), + $('#selectMonth').val() - 1, 32).getDate(); + $('#selectDay option').attr('disabled', ''); + $('#selectDay option:gt(' + (daysInMonth - 1) +')').attr('disabled', 'disabled'); + if ($('#selectDay').val() > daysInMonth) { + $('#selectDay').val(daysInMonth); + } +} +</script> + </div> + <div id="change" class="tab_group1 container"> + <h3>Changing Settings</h3> + <p>If necessary, the datepicker settings for an input (or set of inputs) + can be changed on the fly. As an example, here we change the + animation and speed at which the datepicker appears.</p> + <p><span class="demoLabel">Display animation and speed:</span> + <select id="animSelector"> + <option value="show">show</option> + <option value="fadeIn">fade in</option> + <option value="slideDown">slide down</option> + </select> + <select id="speedSelector"> + <option value="">immediate</option> + <option value="slow">slow</option> + <option value="medium" selected="selected">medium</option> + <option value="fast">fast</option> + </select> + </p> + <p><span class="demoLabel">Change datepicker:</span> + <input type="text" size="10" id="changeDP"/></p> + <p>When the option in the select changes, the following function is called:</p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#changeDP').datepicker(); +// Change the datepicker to selected speed. +$('#animSelector,#speedSelector').change(function() { + $('#changeDP').datepicker('change', {showAnim: $('#animSelector').val(), + speed: $('#speedSelector').val()}); +}); +</script> + <p>Date pickers can also be configured inline. + Add attributes to the input control with the namespace "date:" + corresponding to the date picker properties. + The attribute values are evaluated as JavaScript.</p> + <p><span class="demoLabel">Inline configuration 1:</span> + <input type="text" size="10" class="inlineConfig" onchange="showDay(this);" + date:closeAtTop="false" date:firstDay="1" date:appendText="which is a"/> + <span id="inlineDay">blank</span></p> + <p><span class="demoLabel">Inline configuration 2:</span> + <input type="text" size="10" class="inlineConfig" + date:minDate="new Date(2007, 1 - 1, 1)" date:maxDate="new Date(2007, 12 - 1, 31)"/></p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +/* HTML Markup for inline configuration + +Example #1: +<input type="text" size="10" class="inlineConfig" onchange="showDay(this);" + date:closeAtTop="false" date:firstDay="1" date:appendText="which is a" /> + +Example #2: +<input type="text" size="10" class="inlineConfig" + date:minDate="new Date(2007, 1 - 1, 1)" date:maxDate="new Date(2007, 12 - 1, 31)"/> +*/ + +// Invoke inline configured datepickers +$('.inlineConfig').datepicker(); +</script> + </div> + <div id="inline" class="tab_group1 container"> + <h3>Inline</h3> + <p>The date picker can be used inline rather than as a popup. + Use inline mode by attaching the datepicker to a span or div element.</p> + <span id="inlineDemo"></span> + <div style="clear:both;height:1em"></div> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +// HTML <span id="inlineDemo"></span> +$('#inlineDemo').datepicker({ + onSelect: function(date) { + alert(date); + } +}); +</script> + <p>Show a number of months at once and set the range directly.</p> + <p>Inline range with two months:</p> + <div style="clear: both"> + <span id="rangeInline"></span> + </div> + <p style="clear: both; padding-top: 0.5em;"> + <span>Selected range is:</span> + <input type="text" size="25" id="inlineRange" readonly="readonly"/> + </p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +$('#rangeInline').datepicker({rangeSelect: true, rangeSeparator: ' to ', + numberOfMonths: 2, onSelect: updateInlineRange}); +$('#rangeInline').find('div:first').width(370); // Unfortunately not automatic + +// Display the date range from a multi-month inline date picker +function updateInlineRange(dateStr) { + var dates = $('#rangeInline').datepicker('getDate'); + var dateFormat = $.datepicker.regional[''].dateFormat; + $('#inlineRange').val(dateStr ? dateStr : + $.datepicker.formatDate(dateFormat, dates[0]) + ' to ' + + $.datepicker.formatDate(dateFormat, dates[1])); +} +</script> + <p><strong>(Advanced Technique)</strong><br /> + Set initial value of inline date range to one week before and after today's date. + Set the text field to current selected date.</p> + <p> + <button type="button" id="setInlineRange">Set Inline Range to +and- one week</button> + </p> +<script type="text/jsdemo" charset="utf-8" class="demojs"> +var nextWeek = new Date(); +nextWeek.setDate(nextWeek.getDate() + 7); + +var lastWeek = new Date(); +lastWeek.setDate(lastWeek.getDate() - 7); + +$('#setInlineRange').click(function() { + // Set Inline Date Range Selection + $('#rangeInline').datepicker('setDate', lastWeek, nextWeek); + + // Update text field with current date selections + var dates = $('#rangeInline').datepicker('getDate'); + var dateFormat = $.datepicker.regional[''].dateFormat; + $('#inlineRange').val($.datepicker.formatDate(dateFormat, dates[0]) + ' to ' + + $.datepicker.formatDate(dateFormat, dates[1])); +}); +</script> + </div> + <div id="styles" class="tab_group1 container"> + <h3>Stylesheets</h3> + <p>The date picker can be formatted through the use of a stylesheet. + The default stylesheet is used in the rest of this demo + with an alternate one used here.</p> + <p><span class="demoLabel">Alternate style:</span> + <input type="text" size="10" id="altStyle"/></p> + <p><span class="demoLabel">In a dialog:</span> + <input type="text" size="10" id="altDialog" readonly="readonly"/> + <button id="button3">Open dialog</button></p> + <p>The basic HTML structure of the date picker is shown below:</p> +<pre><code class="html"><div id="datepicker_div" class="datepicker_multi"> + <div class="datepicker_control"> + <div class="datepicker_clear"><a>Clear</a></div> + <div class="datepicker_close"><a>Close</a></div> + </div> + <div class="datepicker_links"> + <div class="datepicker_prev"><a>&lt;Prev</a></div> + <div class="datepicker_current"><a>Today</a></div> + <div class="datepicker_next"><a>Next&gt;</a></div> + </div> + <div class="datepicker_oneMonth datepicker_newRow"> + <div class="datepicker_header"> + <select class="datepicker_newMonth"></select> + <select class="datepicker_newYear"></select> + </div> + <table class="datepicker" cellpadding="0" cellspacing="0"> + <thead> + <tr class="datepicker_titleRow"> + <td><a>Su</a></td><td><a>Mo</a></td>... + </tr> + </thead> + <tbody> + <tr class="datepicker_daysRow"> + <td class="datepicker_daysCell datepicker_weekEndCell + datepicker_otherMonth datepicker_unselectable">31</td> + <td class="datepicker_daysCell"><a>1</a></td> + <td class="datepicker_daysCell datepicker_daysCellOver"><a>2</a></td> + <td class="datepicker_daysCell datepicker_daysCellOver datepicker_currentDay"><a>3</a></td> + <td class="datepicker_daysCell datepicker_today"><a>4</a></td> + ... + </tr> + ... + </tbody> + </table> + </div> + <div class="datepicker_oneMonth"> + ... + </div> + <div style="clear: both;"></div> +</div></code></pre> + </div> + <div id="compat" class="tab_group1 container"> + <h3>Compatibility</h3> + <h4>v3.3 to v3.4</h4> + <p>The jQuery UI interfaces changed again, so here's another compatibility module.</p> + <p>Users of v3.3 of the datepicker should use the following + header code to work with their existing implementation:</p> +<pre><code class="html"><link rel="stylesheet" type="text/css" href="<b>ui.datepicker.css</b>"/> +<script type="text/javascript" src="<b>ui.datepicker.js</b>"></script> +<script type="text/javascript" src="<b>ui.datepicker.compatibility-3.3.js</b>"></script></code></pre> + <p>Download the <a href="compatibility/ui.datepicker.compatibility-3.3.js" target="_blank">ui.datepicker.compatibility-3.3.js</a> module.</p> + <p>To migrate fully, the following steps need to be taken:</p> + <ul> + <li>Replace references to the <code>$(selector).attachDatepicker(...)</code> + function with <code>$(selector).datepicker(...)</code>.</li> + <li>Replace references to the <code>$(selector).removeDatepicker()</code> + function with <code>$(selector).datepicker('destroy')</code>.</li> + <li>Replace references to the <code>$(selector).datepicker.changDatepicker(...)</code> + function with <code>$(selector).datepicker('change', ...)</code>.</li> + <li>Replace references to the <code>$(selector).datepicker.enableDatepicker()</code> + function with <code>$(selector).datepicker('enable')</code>.</li> + <li>Replace references to the <code>$(selector).disableDatepicker()</code> + function with <code>$(selector).datepicker('disable')</code>.</li> + <li>Replace references to the <code>$(selector).isDisabledDatepicker()</code> + function with <code>$(selector).datepicker('isDisabled')</code>.</li> + <li>Replace references to the <code>$(selector).showDatepicker()</code> + function with <code>$(selector).datepicker('show')</code>.</li> + <li>Replace references to the <code>$.datepicker.hideDatepicker()</code> + function with <code>$(selector).datepicker('hide')</code>.</li> + <li>Replace references to the <code>$(selector).getDatepickerDate()</code> + function with <code>$(selector).datepicker('getDate')</code>.</li> + <li>Replace references to the <code>$(selector).setDatepickerDate(...)</code> + function with <code>$(selector).datepicker('setDate', ...)</code>.</li> + </ul> + <p>For example, this old style code:</p> +<pre><code class="javascript">$('inputs').<b>attachDatepicker</b>(...); +$('inputs').<b>changeDatepicker</b>(...);</code></pre> + <p>becomes:</p> +<pre><code class="javascript">$('inputs').<b>datepicker</b>(...); +$('inputs').<b>datepicker('change',</b> ...);</code></pre> + + <h4>v3.2 to v3.4</h4> + <p>To align the datepicker more closely with other jQuery UI components, + further changes were made in v3.3, resulting in another compatibility module.</p> + <p>Users of v3.2 of the datepicker should use the following + header code to work with their existing implementation:</p> +<pre><code class="html"><link rel="stylesheet" type="text/css" href="<b>ui.datepicker.css</b>"/> +<script type="text/javascript" src="<b>ui.datepicker.js</b>"></script> +<script type="text/javascript" src="<b>ui.datepicker.compatibility-3.2.js</b>"></script></code></pre> + <p>Download the <a href="compatibility/ui.datepicker.compatibility-3.2.js" target="_blank">ui.datepicker.compatibility-3.2.js</a> module.</p> + <p>To migrate fully, the following steps need to be taken:</p> + <ul> + <li>Replace references to the <code>$.datepicker.reconfigureFor(selector, ...)</code> + function with <code>$(selector).datepicker('change', ...)</code>.</li> + <li>Replace references to the <code>$.datepicker.enableFor(selector)</code> + function with <code>$(selector).datepicker('enable')</code>.</li> + <li>Replace references to the <code>$.datepicker.disableFor(selector)</code> + function with <code>$(selector).datepicker('disable')</code>.</li> + <li>Replace references to the <code>$.datepicker.isDisabled(selector)</code> + function with <code>$(selector).datepicker('isDisabled')</code>.</li> + <li>Replace references to the <code>$.datepicker.showFor(selector)</code> + function with <code>$(selector).datepicker('show')</code>.</li> + <li>Replace references to the <code>$.datepicker.getDateFor(selector)</code> + function with <code>$(selector).datepicker('getDate')</code>.</li> + <li>Replace references to the <code>$.datepicker.setDateFor(selector, ...)</code> + function with <code>$(selector).datepicker('setDate', ...)</code>.</li> + </ul> + <p>For example, this old style code:</p> +<pre><code class="javascript">$.<b>datepicker.reconfigureFor</b>('inputs', {...});</code></pre> + <p>becomes:</p> +<pre><code class="javascript">$('inputs').<b>datepicker('change',</b> {...});</code></pre> + + <h4>v2.x to v3.3</h4> + <p>The date picker has been refactored to better fit + within the <a href="http://ui.jquery.com">jQuery UI</a> project. + This has involved renaming the main function and some properties, + resulting in current uses of the plugin no longer functioning correctly. + To assist in the transition to the new format a compatibility + plugin is also provided, allowing current code to continue + to operate with minimal changes.</p> + <p>Existing users of v2 of the calendar should use the following + header code to work with their existing implementation:</p> +<pre><code class="html"><link rel="stylesheet" type="text/css" href="<b>ui.datepicker.css</b>"/> +<script type="text/javascript" src="<b>ui.datepicker.js</b>"></script> +<script type="text/javascript" src="<b>jquery-calendar-compatibility.js</b>"></script></code></pre> + <p>Download the <a href="compatibility/jquery-calendar-compatibility.js" target="_blank">jquery-calendar-compatibility.js</a> module.</p> + <p>To migrate fully, the following steps need to be taken:</p> + <ul> + <li>Replace references to the <code>jquery-calendar*</code> + files with <code>ui.datepicker*</code>.</li> + <li>Replace references to the <code>popUpCal</code> + object with <code>$.datepicker</code>.</li> + <li>Replace references to the <code>calendar</code> + function with <code>datepicker</code>.</li> + <li>Replace references to the <code>autoPopUp</code> + setting with <code>showOn</code>.</li> + <li>Replace references to the <code>fieldSettings</code> + setting with <code>beforeShow</code>.</li> + <li>Replace references to the <code>customDate</code> + setting with <code>beforeShowDay</code>.</li> + <li>Replace references to inline attributes with the <code>cal:</code> + namespace with <code>date:</code>.</li> + <li>Replace references to the <code>hideCalendar</code> + function with <code>hideDatepicker</code>.</li> + <li>Replace references to the <code>dialogCalendar</code> + function with <code>dialogDatepicker</code>.</li> + <li>Replace references to the <code>$.datepicker.reconfigureFor(selector, ...)</code> + function with <code>$(selector).datepicker('change', ...)</code>.</li> + <li>Replace references to the <code>$.datepicker.enableFor(selector)</code> + function with <code>$(selector).datepicker('enable')</code>.</li> + <li>Replace references to the <code>$.datepicker.disableFor(selector)</code> + function with <code>$(selector).datepicker('disable')</code>.</li> + <li>Replace references to the <code>$.datepicker.showFor(selector)</code> + function with <code>$(selector).datepicker('show')</code>.</li> + <li>Replace references to the <code>$.datepicker.getDateFor(selector)</code> + function with <code>$(selector).datepicker('getDate')</code>.</li> + <li>Replace references to the <code>$.datepicker.setDateFor(selector, ...)</code> + function with <code>$(selector).datepicker('setDate', ...)</code>.</li> + <li>Replace references to the <code>calendar*</code> + CSS styles with <code>datepicker*</code>.</li> + </ul> + <p>For example, this old style code:</p> +<pre><code class="javascript">$('inputs').<b>calendar</b>({<b>autoPopUp</b>: 'both', <b>fieldSettings</b>: setDateRange, + <b>customDate</b>: <b>popUpCal</b>.noWeekends}); + +<input type="text" id="inlineConfig" <b>cal:</b>defaultDate="+7"/></code></pre> + <p>becomes:</p> +<pre><code class="javascript">$('inputs').<b>datepicker</b>({<b>showOn</b>: 'both', <b>beforeShow</b>: setDateRange, + <b>beforeShowDay</b>: <b>$.datepicker</b>.noWeekends}); + +<input type="text" id="inlineConfig" <b>date:</b>defaultDate="+7"/></code></pre> + </div> + <h4>Localization Packages</h4> + <ul style="float:left;width:220px;margin-top:0"> + <li><a href="../../../source/i18n/ui.datepicker-ca.js" target="_blank">Bulgarian</a></li> + <li><a href="../../../source/i18n/ui.datepicker-ca.js" target="_blank">Catalan of Spain</a></li> + <li><a href="../../../source/i18n/ui.datepicker-zh-CN.js" target="_blank">Chinese Simplified</a></li> + <li><a href="../../../source/i18n/ui.datepicker-zh-TW.js" target="_blank">Chinese Traditional</a></li> + <li><a href="../../../source/i18n/ui.datepicker-cs.js" target="_blank">Czech</a></li> + <li><a href="../../../source/i18n/ui.datepicker-da.js" target="_blank">Danish</a></li> + <li><a href="../../../source/i18n/ui.datepicker-nl.js" target="_blank">Dutch</a></li> + <li><a href="../../../source/i18n/ui.datepicker-fi.js" target="_blank">Finnish</a></li> + <li><a href="../../../source/i18n/ui.datepicker-fr.js" target="_blank">French</a></li> + <li><a href="../../../source/i18n/ui.datepicker-de.js" target="_blank">German</a></li> + <li><a href="../../../source/i18n/ui.datepicker-he.js" target="_blank">Hebrew</a></li> + <li><a href="../../../source/i18n/ui.datepicker-hu.js" target="_blank">Hungarian</a></li> + <li><a href="../../../source/i18n/ui.datepicker-is.js" target="_blank">Icelandic</a></li> + <li><a href="../../../source/i18n/ui.datepicker-it.js" target="_blank">Italian</a></li> + </ul> + <ul> + <li><a href="../../../source/i18n/ui.datepicker-ja.js" target="_blank">Japanese</a></li> + <li><a href="../../../source/i18n/ui.datepicker-ko.js" target="_blank">Korean</a></li> + <li><a href="../../../source/i18n/ui.datepicker-lt.js" target="_blank">Lithuanian</a></li> + <li><a href="../../../source/i18n/ui.datepicker-no.js" target="_blank">Norwegian</a></li> + <li><a href="../../../source/i18n/ui.datepicker-pl.js" target="_blank">Polish</a></li> + <li><a href="../../../source/i18n/ui.datepicker-pt-BR.js" target="_blank">Portuguese of Brazil</a></li> + <li><a href="../../../source/i18n/ui.datepicker-ro.js" target="_blank">Romanian</a></li> + <li><a href="../../../source/i18n/ui.datepicker-ru.js" target="_blank">Russian</a></li> + <li><a href="../../../source/i18n/ui.datepicker-sk.js" target="_blank">Slovak</a></li> + <li><a href="../../../source/i18n/ui.datepicker-es.js" target="_blank">Spanish</a></li> + <li><a href="../../../source/i18n/ui.datepicker-sv.js" target="_blank">Swedish</a></li> + <li><a href="../../../source/i18n/ui.datepicker-th.js" target="_blank">Thai</a></li> + <li><a href="../../../source/i18n/ui.datepicker-tr.js" target="_blank">Turkish</a></li> + </ul> + + <!-- Include jQuery --> + <script src="../../../../jquery/jquery-1.2.6.js" type="text/javascript" charset="utf-8"></script> + + <!-- Include UI Datepicker --> + <script src="../../../source/ui.datepicker.js" type="text/javascript" charset="utf-8"></script> + + <!-- Include Demo Files --> + <script type="text/javascript" src="demo/jquery.localisation.js"></script> + <script src="../../../source/i18n/ui.datepicker-fr.js" type="text/javascript" charset="utf-8"></script> + <script src="../../../source/i18n/ui.datepicker-he.js" type="text/javascript" charset="utf-8"></script> + <script type="text/javascript" src="demo/ui.datepicker.demo.js"></script> + </body> +</html>
\ No newline at end of file diff --git a/demos/real-world/accordion-drawers/images/caps.gif b/demos/real-world/accordion-drawers/images/caps.gif Binary files differnew file mode 100644 index 000000000..24184e742 --- /dev/null +++ b/demos/real-world/accordion-drawers/images/caps.gif diff --git a/demos/real-world/accordion-drawers/images/sideboxlight_bg.gif b/demos/real-world/accordion-drawers/images/sideboxlight_bg.gif Binary files differnew file mode 100644 index 000000000..2d52b8054 --- /dev/null +++ b/demos/real-world/accordion-drawers/images/sideboxlight_bg.gif diff --git a/demos/real-world/accordion-drawers/images/slider_handlebg.png b/demos/real-world/accordion-drawers/images/slider_handlebg.png Binary files differnew file mode 100644 index 000000000..1077c4d6e --- /dev/null +++ b/demos/real-world/accordion-drawers/images/slider_handlebg.png diff --git a/demos/real-world/accordion-drawers/index.html b/demos/real-world/accordion-drawers/index.html new file mode 100644 index 000000000..80c4df95d --- /dev/null +++ b/demos/real-world/accordion-drawers/index.html @@ -0,0 +1,257 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <title>Slide Demo - Fixed Drawer</title> + <style type="text/css" media="screen"> + <!-- +/*************************************/ +/* Blueprint: reset.css */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +/* Remember to define focus styles! */ +:focus { + outline: 0; +} +body { + line-height: 1; + color: black; + background: white; +} +ol, ul { + list-style: none; +} + +/* Tables still need 'cellspacing="0"' in the markup. */ +table { + border-collapse: separate; + border-spacing: 0; +} +caption, th, td { + text-align: left; + font-weight: normal; +} + +/* Remove possible quote marks (") from <q>, <blockquote>. */ +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} +blockquote, q { + quotes: "" ""; +} + +/*************************************/ +/* Demo Styles */ + .capt, + .capb { + background: url("images/caps.gif") no-repeat; + height:4px; + width:100%; + /*position:absolute;*/ + z-index:100; + margin:0px; + padding:0px; + } + .capt { + position:absolute; + background-position:0 -4px; + } + .capb { + margin-top:-19px; + } + #content { + float:left; + } + .drawers-wrapper { + position: relative; + width: 188px; + float:left; + margin:10px; + } + .drawers { + margin-bottom:15px; + color:#76797C; + font-size:11px; + line-height: 18px; + } + .drawer { + background:transparent url(images/sideboxlight_bg.gif) repeat-y scroll 0pt; + color:#76797C; + font-size:11px; + line-height:1.3em; + } + .drawer-handle { + background:#939393 url(images/slider_handlebg.png) no-repeat scroll 0pt; + color:#333333; + cursor:default; + height:25px; + line-height:25px; + text-indent:15px; + font-size:12px; + width:100%; + } + .drawer-handle.open { + background-color:#72839D; + background-position:-188px 0pt; + color:#FFFFFF; + } + + /* nasty, but it fixes the indent on the first one. */ + h2.drawer-handle span { + + } + .drawer ul { + padding: 0 12px; + padding-bottom:0pt; + } + .drawer li { + border-bottom:1px solid #E5E5E5; + line-height:16px; + padding:6px 0pt; + } + .drawer-content ul { + padding-top: 7px; + } + .drawer-content li a { + display:block; + overflow:hidden; + } + .alldownloads li { + border:0pt none; + line-height:18px; + padding:0pt; + } + + .drawers a { + color:#666666; + text-decoration:none; + font-family:"Lucida Grande",Geneva,Arial,Verdana,sans-serif; + } + --> + </style> + + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + + <script type="text/javascript" src="../../../source/ui.core.js"></script> + <script type="text/javascript" src="../../../source/ui.accordion.js"></script> + + + <script type="text/javascript"> + <!-- + $(function () { + $('ul.drawers').accordion({ + header: 'h2.drawer-handle', + selectedClass: 'open', + event: 'mouseover' + }); + }); + //--> + </script> +</head> +<body id="page"> + <div id="content"> + <h1>Fixed drawer slide out demo (using accordion plugin)</h1> + <p>This example demonstrates the Apple downloads slider/accordion effect using the jQuery Accordion plugin.</p> + <p>Mouse over the headings to reveal the list of available links.</p> + + <p> + <a href="http://jqueryfordesigners.com/slide-out-and-drawer-effect/">Read the article this demonstration relates to</a> + </p> + </div> + <div class="drawers-wrapper"> + <ul class="drawers"> + <li class="drawer"> + <h2 class="drawer-handle open"> + <div class="capt"></div> + <span>Downloads</span> + </h2> + <ul class="alldownloads"> + <li id="sn-downloadsmacosx"><a href="/downloads/macosx/">All Categories</a></li> + <li id="sn-aperture"><a href="/downloads/macosx/aperture/">Aperture</a></li> + <li id="sn-apple"><a href="/downloads/macosx/apple/">Apple</a></li> + <li id="sn-audio"><a href="/downloads/macosx/audio/">Audio</a></li> + <li id="sn-automator"><a href="/downloads/macosx/automator/">Automator Actions</a></li> + <li id="sn-businessfinance"><a href="/downloads/macosx/business_finance/">Business & Finance</a></li> + <li id="sn-calendars"><a href="/downloads/macosx/calendars/">Calendars</a></li> + <li id="sn-developmenttools"><a href="/downloads/macosx/development_tools/">Development Tools</a></li> + <li id="sn-drivers"><a href="/downloads/macosx/drivers/">Drivers</a></li> + <li id="sn-emailchat"><a href="/downloads/macosx/email_chat/">Email & Chat</a></li> + <li id="sn-finalcutstudio"><a href="/downloads/macosx/finalcutstudio/">Final Cut Studio</a></li> + <li id="sn-games"><a href="/downloads/macosx/games/">Games</a></li> + <li id="sn-homelearning"><a href="/downloads/macosx/home_learning/">Home & Learning</a></li> + <li id="sn-iconsscreensavers"><a href="/downloads/macosx/icons_screensavers/">Icons, Screensavers, etc.</a></li> + <li id="sn-imaging3d"><a href="/downloads/macosx/imaging_3d/">Imaging & 3D</a></li> + <li id="sn-internetutilities"><a href="/downloads/macosx/internet_utilities/">Internet Utilities</a></li> + <li id="sn-ipoditunes"><a href="/downloads/macosx/ipod_itunes/">iPod + iTunes</a></li> + <li id="sn-mathscience"><a href="/downloads/macosx/math_science/">Math & Science</a></li> + <li id="sn-networkingsecurity"><a href="/downloads/macosx/networking_security/">Networking & Security</a></li> + <li id="sn-productivitytools"><a href="/downloads/macosx/productivity_tools/">Productivity Tools</a></li> + <li id="sn-spotlight"><a href="/downloads/macosx/spotlight/">Spotlight Plugins</a></li> + <li id="sn-systemdiskutilities"><a href="/downloads/macosx/system_disk_utilities/">System/Disk Utilities</a></li> + <li id="sn-unixopensource"><a href="/downloads/macosx/unix_open_source/">UNIX & Open Source</a></li> + <li id="sn-video"><a href="/downloads/macosx/video/">Video</a></li> + <li id="sn-dashboard"><a href="/downloads/dashboard/" class="bottom">Widgets</a></li> + </ul> + </li> + <li class="drawer"> + <h2 class="drawer-handle">Top Downloads</h2> + <ul> + <li><a title="iTunes 7.5" href="http://www.apple.com/itunes/download/">1. iTunes 7.5</a></li> + <li><a title="QuickTime 7.3.1" href="http://www.apple.com/quicktime/download/">2. QuickTime 7.3.1</a></li> + <li><a title="Safari 3 Public Beta" href="http://www.apple.com/safari/download/">3. Safari 3 Public Beta</a></li> + <li><a title="MacPool" href="/downloads/macosx/games/simulation_and_sports/macpool.html">4. MacPool Realistic and easy to play computer simu…</a></li> + <li><a title="Guitar Hero III: Legends of Rock" href="/downloads/macosx/games/demos_updates/guitarheroiiilegendsofrock.html">5. Guitar Hero III: L…</a></li> + <li><a title="Messenger for Mac" href="/downloads/macosx/email_chat/messengerformac.html">6. Messenger for Mac</a></li> + <li><a title="Google Earth" href="/downloads/macosx/home_learning/googleearth.html">7. Google Earth</a></li> + <li><a title="Monopoly" href="/downloads/macosx/games/cards_puzzle/monopoly.html">8. Monopoly</a></li> + <li><a title="Litho System Icons" href="/downloads/macosx/icons_screensavers/lithosystemicons.html">9. Litho System Icons</a></li> + <li><a title="Battlefield 2142" href="/downloads/macosx/games/demos_updates/battlefield2142.html">10. Battlefield 2142</a></li> + <li><a title="More iChat Effects" href="/downloads/macosx/email_chat/moreichateffects.html">11. More iChat Effects</a></li> + <li><a title="Dragster" href="/downloads/macosx/internet_utilities/dragster.html">12. Dragster</a></li> + <li><a title="iSquint" href="/downloads/macosx/ipod_itunes/isquint.html">13. iSquint</a></li> + <li class="last"><a title="US Holiday Calendar" href="/downloads/macosx/calendars/usholidaycalendar.html">14. US Holiday Calendar</a></li> + </ul> + </li> + <li class="drawer last"> + <h2 class="drawer-handle">Top Apple Downloads</h2> + <ul> + <li><a title="iTunes 7.5" href="http://www.apple.com/itunes/download/">1. iTunes 7.5</a></li> + <li><a title="QuickTime 7.3.1" href="http://www.apple.com/quicktime/download/">2. QuickTime 7.3.1</a></li> + <li><a title="Safari 3 Public Beta" href="http://www.apple.com/safari/download/">3. Safari 3 Public Beta</a></li> + <li><a title="Mac OS X 10.5.1 Update" href="/downloads/macosx/apple/macosx_updates/macosx1051update.html">4. Mac OS X 10.5.1 Up…</a></li> + <li><a title="Java for Mac OS X 10.4 Release 5" href="/downloads/macosx/apple/macosx_updates/javaformacosx104release5.html">5. Java for Mac OS X …</a></li> + <li><a title="iPod Reset Utility 1.0.2 for Windows" href="/downloads/macosx/apple/ipod_itunes/ipodresetutility102forwindows.html">6. iPod Reset Utility…</a></li> + <li><a title="iPhoto 7.1.1" href="/downloads/macosx/apple/application_updates/iphoto711.html">7. iPhoto 7.1.1</a></li> + <li><a title="Bonjour for Windows" href="/downloads/macosx/apple/windows/bonjourforwindows.html">8. Bonjour for Windows</a></li> + <li><a title="Mac OS X 10.4.11 Combo Update (PPC)" href="/downloads/macosx/apple/macosx_updates/macosx10411comboupdateppc.html">9. Mac OS X 10.4.11 C…<br/>The 10.4.11 Update is recommended for al…</a></li> + <li><a title="Java for Mac OS X 10.4, Release 6" href="/downloads/macosx/apple/macosx_updates/javaformacosx104release6.html">10. Java for Mac OS X …</a></li> + <li><a title="GarageBand 4.1.1" href="/downloads/macosx/apple/application_updates/garageband411.html">11. GarageBand 4.1.1</a></li> + <li><a title="iPod Updater 2006-06-28 for Windows" href="/downloads/macosx/apple/ipod_itunes/ipodupdater20060628forwindows.html">12. iPod Updater 2006-…</a></li> + <li><a title="Security Update 2007-009 1.1 (10.4.11 Universal)" href="/downloads/macosx/apple/security_updates/securityupdate20070091110411universal.html">13. Security Update 20…</a></li> + <li class="last"><a title="Security Update 2007-009 1.1 (10.5.1)" href="/downloads/macosx/apple/security_updates/securityupdate2007009111051.html">14. Security Update 20…</a></li> + </ul> + </li> + </ul> + <div class="capb"></div> + </div> +</body> +</html> diff --git a/demos/real-world/effects/demo.js b/demos/real-world/effects/demo.js new file mode 100644 index 000000000..b52b23726 --- /dev/null +++ b/demos/real-world/effects/demo.js @@ -0,0 +1,65 @@ +$(document).ready(function() { + + $("div.effect") + .hover(function() { + $(this).addClass("hover"); + }, function() { + $(this).removeClass("hover"); + }) + ; + + + var effect = function(el, n, o) { + + $.extend(o, { + easing: "easeOutQuint" + }); + + $(el).bind("click", function() { + + $(this).addClass("current").hide(n, o, 1000, function() { + var self = this; + window.setTimeout(function() { + $(self).show(n, o, 1000, function() { $(this).removeClass("current"); }); + },500); + }); + }); + + }; + + + effect("#blindHorizontally", "blind", { direction: "horizontal" }); + effect("#blindVertically", "blind", { direction: "vertical" }); + + effect("#bounce3times", "bounce", { times: 3 }); + + effect("#clipHorizontally", "clip", { direction: "horizontal" }); + effect("#clipVertically", "clip", { direction: "vertical" }); + + effect("#dropDown", "drop", { direction: "down" }); + effect("#dropUp", "drop", { direction: "up" }); + effect("#dropLeft", "drop", { direction: "left" }); + effect("#dropRight", "drop", { direction: "right" }); + + effect("#explode9", "explode", { }); + effect("#explode36", "explode", { pieces: 36 }); + + effect("#fold", "fold", { size: 50 }); + + effect("#highlight", "highlight", { }); + + effect("#pulsate", "pulsate", { times: 2 }); + + effect("#puff", "puff", { times: 2 }); + effect("#scale", "scale", { }); + + $("#shake").bind("click", function() { $(this).addClass("current").effect("shake", {}, 100, function() { $(this).removeClass("current"); }); }); + + effect("#slideDown", "slide", { direction: "down" }); + effect("#slideUp", "slide", { direction: "up" }); + effect("#slideLeft", "slide", { direction: "left" }); + effect("#slideRight", "slide", { direction: "right" }); + + $("#transfer").bind("click", function() { $(this).addClass("current").effect("transfer", { to: "div:eq(0)" }, 1000, function() { $(this).removeClass("current"); }); }); + +});
\ No newline at end of file diff --git a/demos/real-world/effects/index.html b/demos/real-world/effects/index.html new file mode 100644 index 000000000..15ebbece2 --- /dev/null +++ b/demos/real-world/effects/index.html @@ -0,0 +1,120 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> + <head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <title>Effects Test Suite</title> + <link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8" /> + + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../../source/effects.core.js"></script> + + <script type="text/javascript" src="../../../source/effects.blind.js"></script> + <script type="text/javascript" src="../../../source/effects.bounce.js"></script> + <script type="text/javascript" src="../../../source/effects.clip.js"></script> + <script type="text/javascript" src="../../../source/effects.drop.js"></script> + <script type="text/javascript" src="../../../source/effects.explode.js"></script> + <script type="text/javascript" src="../../../source/effects.fold.js"></script> + <script type="text/javascript" src="../../../source/effects.highlight.js"></script> + <script type="text/javascript" src="../../../source/effects.pulsate.js"></script> + <script type="text/javascript" src="../../../source/effects.scale.js"></script> + <script type="text/javascript" src="../../../source/effects.shake.js"></script> + <script type="text/javascript" src="../../../source/effects.slide.js"></script> + <script type="text/javascript" src="../../../source/effects.transfer.js"></script> + + <script type="text/javascript" src="demo.js"></script> + + + </head> + <body> + + <div class="effect" id="blindHorizontally"> + <p>Blind horizontally</p> + </div> + + <div class="effect" id="blindVertically"> + <p>Blind vertically</p> + </div> + + <div class="effect" id="bounce3times"> + <p>Bounce 3 times</p> + </div> + + <div class="effect" id="clipHorizontally"> + <p>Clip horizontally</p> + </div> + + <div class="effect" id="clipVertically"> + <p>Clip vertically</p> + </div> + + <div class="effect" id="dropDown"> + <p>Drop down</p> + </div> + + <div class="effect" id="dropUp"> + <p>Drop up</p> + </div> + + <div class="effect" id="dropLeft"> + <p>Drop left</p> + </div> + + <div class="effect" id="dropRight"> + <p>Drop right</p> + </div> + + <div class="effect" id="explode9"> + <p>Explode in 9 pieces</p> + </div> + + <div class="effect" id="explode36"> + <p>Explode in 36 pieces</p> + </div> + + <div class="effect" id="fold"> + <p>Fold</p> + </div> + + <div class="effect" id="highlight"> + <p>Highlight</p> + </div> + + <div class="effect" id="pulsate"> + <p>Pulsate 2 times</p> + </div> + + <div class="effect" id="puff"> + <p>Puff</p> + </div> + + <div class="effect" id="scale"> + <p>Scale</p> + </div> + + <div class="effect" id="shake"> + <p>Shake</p> + </div> + + <div class="effect" id="slideDown"> + <p>Slide down</p> + </div> + + <div class="effect" id="slideUp"> + <p>Slide up</p> + </div> + + <div class="effect" id="slideLeft"> + <p>Slide left</p> + </div> + + <div class="effect" id="slideRight"> + <p>Slide right</p> + </div> + + <div class="effect" id="transfer"> + <p>Transfer to first element</p> + </div> + + </body> +</html>
\ No newline at end of file diff --git a/demos/real-world/effects/style.css b/demos/real-world/effects/style.css new file mode 100644 index 000000000..f7ae220ef --- /dev/null +++ b/demos/real-world/effects/style.css @@ -0,0 +1,36 @@ +body,html { + margin: 0; + padding: 0; + font-size: 12px; + font-family: Arial; + background: #000; +} + +div.effect { + width: 120px; + height: 100px; + background: #333; + border: 5px outset #aaa; + float: left; + margin-top: 20px; + margin-left: 20px; + cursor: pointer; + cursor: hand; +} + +div.current { + border: 5px outset #FF0000; + background: #660000; +} + +div.effect p { + color: #eee; + margin: 0px; + padding: 10px; +} + +.ui-effects-transfer { + border: 1px dotted #fff; + background: #666; + opacity: 0.5; +}
\ No newline at end of file diff --git a/demos/real-world/image-cropper/img/img01.jpg b/demos/real-world/image-cropper/img/img01.jpg Binary files differnew file mode 100644 index 000000000..4d5f88445 --- /dev/null +++ b/demos/real-world/image-cropper/img/img01.jpg diff --git a/demos/real-world/image-cropper/img/img02.jpg b/demos/real-world/image-cropper/img/img02.jpg Binary files differnew file mode 100644 index 000000000..5745265f0 --- /dev/null +++ b/demos/real-world/image-cropper/img/img02.jpg diff --git a/demos/real-world/image-cropper/img/img03.jpg b/demos/real-world/image-cropper/img/img03.jpg Binary files differnew file mode 100644 index 000000000..7e6928f63 --- /dev/null +++ b/demos/real-world/image-cropper/img/img03.jpg diff --git a/demos/real-world/image-cropper/img/img04.jpg b/demos/real-world/image-cropper/img/img04.jpg Binary files differnew file mode 100644 index 000000000..8216a2382 --- /dev/null +++ b/demos/real-world/image-cropper/img/img04.jpg diff --git a/demos/real-world/image-cropper/img/img05.jpg b/demos/real-world/image-cropper/img/img05.jpg Binary files differnew file mode 100644 index 000000000..35de5bd8c --- /dev/null +++ b/demos/real-world/image-cropper/img/img05.jpg diff --git a/demos/real-world/image-cropper/index.html b/demos/real-world/image-cropper/index.html new file mode 100644 index 000000000..afa85ae3c --- /dev/null +++ b/demos/real-world/image-cropper/index.html @@ -0,0 +1,231 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +<meta http-equiv="Content-Language" content="en" /> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Image Cropper: jQuery Real-world Demo</title> +<script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> +<script type="text/javascript" src="../../../source/ui.core.js"></script> +<script type="text/javascript" src="../../../source/ui.resizable.js"></script> +<script type="text/javascript" src="../../../source/ui.draggable.js"></script> + +<script type="text/javascript" src="../../../source/effects.core.js"></script> +<script type="text/javascript" src="../../../source/effects.bounce.js"></script> +<script type="text/javascript" src="../../../source/effects.scale.js"></script> + + +<style type="text/css"> +<!-- +/*************************************/ +/* Real-World CSS */ + +@import "real-world.css"; + +/*************************************/ +/* Demo CSS */ + +#sidebar div { + text-align:center; +} +.thumb ul { + padding:10px 0 0 0; +} +.thumbs li { + margin:4px 20px; +} +.thumbs li a, +.thumbs li a img{ + height: 75px; + width: 75px; + display: block; +} +.thumbs li a:hover, +.thumbs li a:hover img{ + height: 130px; + width: 130px; +} +.thumbs li a:hover { + border: 4px solid #E8EEF7; +} + +#break strong { + margin:0 0 4px 0; +} +#break ul { + padding:6px; +} +#break ul li { + padding:3px 0px; + font-style: italic; +} +#break ul li span { + font-style: normal; +} + +.ui-resizable-knob { + border: 1px #fff dashed; +} + +/*************************************/ +/* Cropper CSS */ + +#resizeme_containment_wrap_image { + position: relative; +} +#resizeme_containment_div { + position: absolute; + top:0px; + left:0px; + width: 150px; + height:150px; +} + +#resizeme_containment_div_wrapper { + position: relative; +} + + +--> +</style> +<script type="text/javascript"> + var getSizeImg = function(src) { + var timg = $('<img>').attr('src', src).css({ position: 'absolute', top: '-1000px', left: '-1000px' }).appendTo('body'); + var size = [ timg.get(0).offsetWidth, timg.get(0).offsetHeight ]; + + try { document.body.removeChild(timg[0]); } + catch(e) {}; + + return size; + }; + + $().ready(function(){ + + $('#resizeme_containment_div').resizable({ + + containment: $('#resizeme_containment_div_wrapper'), + + //proxy: 'proxy', + + //ghost: true, + + //animate:true, + + handles: 'all', + + knobHandles: true, + + //transparent: true, + + //aspectRatio: true, + + autoHide: true, + + minWidth: 100, + + minHeight: 100, + + resize: function(e, ui) { + var self = $(this).data("resizable"); + + this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px'; + + + $("#log-top").html(self.position.top+"px"); + + $("#log-left").html(self.position.left+"px"); + + $("#log-height").html(self.size.height+"px"); + + $("#log-width").html(self.size.width+"px"); + + }, + stop: function(e, ui) { + var self = $(this).data("resizable"); + this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px'; + } + }) + + .draggable({ + + cursor: 'move', + + containment: $('#resizeme_containment_div_wrapper'), + + drag: function(e, ui) { + var self = $(this).data("draggable"); + this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px'; + + $("#log-top").html(self.position.top+"px"); + + $("#log-left").html(self.position.left+"px"); + + } + + }); + + $('.thumbs').find("li a").click(function(e){ + + $('#resizeme_containment_div').css('top', '0'); + + $('#resizeme_containment_div').css('left', '0'); + + var size = getSizeImg($(this).find("img").attr("src")); + + $('#resizeme_containment_wrap_image').css( { width: size[0], height: size[1], background: 'transparent url('+$(this).find("img").attr("src")+') no-repeat scroll 0%' } ); + $('#resizeme_containment_div_wrapper').css( { width: size[0], height: size[1] } ); + $('#resizeme_containment_div').css('background', 'transparent url('+$(this).find("img").attr("src")+') no-repeat scroll 0px 0px'); + + return false; + + }); + + + $('#resizeme_containment_wrap_image').css({ opacity: 0.5 }); + + $("#log-height").html($('#resizeme_containment_div').height()+"px"); + + $("#log-width").html($('#resizeme_containment_div').width()+"px"); + + }); + + $(window).load(function(){ + var size = getSizeImg("img/img01.jpg"); + $('#resizeme_containment_div').css('background', 'transparent url(img/img01.jpg) no-repeat scroll 0px 0px'); + $('#resizeme_containment_div_wrapper').css( { width: size[0], height: size[1] } ); + $('#resizeme_containment_wrap_image').css( { width: size[0], height: size[1], background: 'transparent url(img/img01.jpg) no-repeat scroll 0%' } ); + + }); +</script> +</head> +<body> + <div id="sidebar"> + <ul class="thumbs"> + <li><a href="#" title="Open This Image"><img src="img/img01.jpg"/></a></li> + <li><a href="#" title="Open This Image"><img src="img/img02.jpg"/></a></li> + <li><a href="#" title="Open This Image"><img src="img/img03.jpg"/></a></li> + <li><a href="#" title="Open This Image"><img src="img/img04.jpg"/></a></li> + <li><a href="#" title="Open This Image"><img src="img/img05.jpg"/></a></li> + </div> + </div> + <div id="main"> + <div id="header"> + <h2>jQuery Real-world Demo: Image Cropper</h2> + </div> + <div id="content"> + <div id="resizeme_containment_div_wrapper"> + <div id="resizeme_containment_wrap_image"></div> + <div id="resizeme_containment_div"></div> + </div> + </div> + <div id="break"> + <strong>Properties:</strong> + <ul> + <li>width: <span id="log-width">0px</span></li> + <li>height: <span id="log-height">0px</span></li> + <li>top: <span id="log-top">0px</span></li> + <li>left: <span id="log-left">0px</span></li> + </ul> + </div> + </div> +</body> +</html> diff --git a/demos/real-world/image-cropper/real-world.css b/demos/real-world/image-cropper/real-world.css new file mode 100644 index 000000000..683033351 --- /dev/null +++ b/demos/real-world/image-cropper/real-world.css @@ -0,0 +1,104 @@ +/*************************************/ +/* Blueprint: reset.css */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +/* Remember to define focus styles! */ +:focus { + outline: 0; +} +body { + line-height: 1; + color: black; + background: white; +} +ol, ul { + list-style: none; +} + +/* Tables still need 'cellspacing="0"' in the markup. */ +table { + border-collapse: separate; + border-spacing: 0; +} +caption, th, td { + text-align: left; + font-weight: normal; +} + +/* Remove possible quote marks (") from <q>, <blockquote>. */ +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} +blockquote, q { + quotes: "" ""; +} + +.clear { + clear:both; +} + +/*************************************/ +/* Layout */ +body, html { + height: 100%; + font-family:sans-serif; + font-size:13px; + margin:0px; + padding:0px; +} +body, html { + height: 100%; + font-family:sans-serif; + font-size:13px; + +} +#main { + height:auto; + background: #E8EEF7; + border-left:1px solid #ccc; + border-bottom:1px solid #ccc; + margin:0 0 0 200px; +} + #header { + height:30px; + padding:10px; + font-size:2em; + font-weight:bold; + text-align: center; + border-bottom:1px solid #ccc; + background: #E8EEF7; + } + #main #content { + padding:10px; + background: #FFF; + } + #main #break { + padding:10px; + border-top:1px solid #ccc; + } +#sidebar { + float:left; + width:200px; + height:100%; + border-right:1px solid #ccc; +} + #sidebar div { + padding:10px; + } diff --git a/demos/real-world/layout/demo.css b/demos/real-world/layout/demo.css new file mode 100644 index 000000000..a7b108623 --- /dev/null +++ b/demos/real-world/layout/demo.css @@ -0,0 +1,42 @@ +body { background-color:#666; color:#FFF; font:11px/1.5 Arial, sans-serif; margin:0; overflow:hidden; padding:30px 0 0 30px; } +h1 { font-size:18px; margin:0 0 20px; } +a { color:#FFF; } + +.clear { clear:both; font-size:1px; line-height:1px; } + +#overlay { background:#666; height:100%; left:0; position:absolute; top:0; width:100%; z-index:2000; } +#overlay #preloader { background:url(loader_bg.gif) no-repeat; height:50px; left:50%; line-height:50px; margin:-25px 0 0 -25px; position:absolute; text-align:center; top:50%; width:50px; } +#overlay #preloader img { margin:11px 0 0 0; vertical-align:middle; } + +.ui-sortable { background-color:#FFF; border:1px solid #555; color:#222; margin:0 15px 15px 0; padding:0 10px 10px; width:175px; } +.ui-sortable h2 { background-color:#555; border-top:3px solid #666; color:#FFF; font-size:11px; margin:0 -10px 10px; line-height:2; padding:0 10px; } + +dl.sort { color:#222; margin:10px 0; } +#uidemo dl.first { margin-top:0; } +#uidemo dl.last { margin-bottom:0; } + +dl.sort dt { background-color:#666; color:#FFF; cursor:move; height:2em; line-height:2; padding:0 6px; position:relative; } +dl.sort dd { background-color:#FFF; margin:0; padding:3px 6px; } + +.ui-sortable-helper { width:175px; } +.placeholder { border:1px dashed #AAA; } + +span.options { cursor:default; font-size:1px; line-height:1px; position:absolute; } +span.options a { background-color:#FFF; cursor:pointer; display:block; float:left; text-indent:-9000px; } + +.ui-sortable h2 span.options { right:10px; top:8px; width:30px; } +.ui-sortable h2 span.options a { height:12px; width:30px; } + +dl.sort dt span.options { right:5px; top:5px; width:27px; } +dl.sort dt span.options a { height:12px; width:12px; } +dl.sort dt span.options a.up { margin-right:3px; } +dl.sort dt span.options a.disabled { background-color:#555; cursor:default; } + +#container { float:left; } +#header { width:638px; } +#content { float:left; width:400px; } +#sidebar { float:left; width:200px; } +#footer { width:638px; } +#trashcan { float:left; } + +#trashcan p { margin:0; }
\ No newline at end of file diff --git a/demos/real-world/layout/demo.js b/demos/real-world/layout/demo.js new file mode 100644 index 000000000..695863f25 --- /dev/null +++ b/demos/real-world/layout/demo.js @@ -0,0 +1,97 @@ +(function($){ + var updateUpDown = function(sortable){ + $('dl:not(.ui-sortable-helper)', sortable) + .removeClass('first').removeClass('last') + .find('.up, .down').removeClass('disabled').end() + .filter(':first').addClass('first').find('.up').addClass('disabled').end().end() + .filter(':last').addClass('last').find('.down').addClass('disabled').end().end(); + }; + + var moveUpDown = function(){ + var link = $(this), + dl = link.parents('dl'), + prev = dl.prev('dl'), + next = dl.next('dl'); + + if(link.is('.up') && prev.length > 0) + dl.insertBefore(prev); + + if(link.is('.down') && next.length > 0) + dl.insertAfter(next); + + updateUpDown(dl.parent()); + }; + + var addItem = function(){ + var sortable = $(this).parents('.ui-sortable'); + var options = '<span class="options"><a class="up">up</a><a class="down">down</a></span>'; + var tpl = '<dl class="sort"><dt>{name}' + options + '</dt><dd>{desc}</dd></dl>'; + var html = tpl.replace(/{name}/g, 'Dynamic name :D').replace(/{desc}/g, 'Description'); + + sortable.append(html).sortable('refresh').find('a.up, a.down').bind('click', moveUpDown); + updateUpDown(sortable); + }; + + var emptyTrashCan = function(item){ + item.remove(); + }; + + var sortableChange = function(e, ui){ + if(ui.sender){ + var w = ui.element.width(); + ui.placeholder.width(w); + ui.helper.css("width",ui.element.children().width()); + } + }; + + var sortableUpdate = function(e, ui){ + if(ui.element[0].id == 'trashcan'){ + emptyTrashCan(ui.item); + } else { + updateUpDown(ui.element[0]); + if(ui.sender) + updateUpDown(ui.sender[0]); + } + }; + + $(document).ready(function(){ + var els = ['#header', '#content', '#sidebar', '#footer', '#trashcan']; + var $els = $(els.toString()); + + $('h2', $els.slice(0,-1)).append('<span class="options"><a class="add">add</a></span>'); + $('dt', $els).append('<span class="options"><a class="up">up</a><a class="down">down</a></span>'); + + $('a.add').bind('click', addItem); + $('a.up, a.down').bind('click', moveUpDown); + + $els.each(function(){ + updateUpDown(this); + }); + + $els.sortable({ + items: '> dl', + handle: 'dt', + cursor: 'move', + //cursorAt: { top: 2, left: 2 }, + //opacity: 0.8, + //helper: 'clone', + appendTo: 'body', + //placeholder: 'clone', + //placeholder: 'placeholder', + connectWith: els, + start: function(e,ui) { + ui.helper.css("width", ui.item.width()); + }, + change: sortableChange, + update: sortableUpdate + }); + }); + + $(window).bind('load',function(){ + setTimeout(function(){ + $('#overlay').fadeOut(function(){ + $('body').css('overflow', 'auto'); + }); + }, 750); + }); +})(jQuery);
\ No newline at end of file diff --git a/demos/real-world/layout/index.html b/demos/real-world/layout/index.html new file mode 100644 index 000000000..83f9d0378 --- /dev/null +++ b/demos/real-world/layout/index.html @@ -0,0 +1,94 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>UI Sortable: Layout Demo</title> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> + + <meta name="title" content="UI Sortable: Layout Demo" /> + <meta name="description" content="A sortable layout created with the jQuery UI suite" /> + + <meta name="author" content="Joan Piedra" /> + <meta name="author-url" content="http://www.joanpiedra.com/" /> + <meta name="author-url" content="http://www.justaquit.com/" /> + <meta name="author-url" content="http://jquery.com/" /> + + <link rel="shortcut icon" href="http://jquery.com/favicon.ico" /> + <link rel="icon" href="http://jquery.com/favicon.ico" type="image/x-icon" /> + + <link rel="stylesheet" href="demo.css" type="text/css" media="screen" /> + <!-- saved from url=(0013)about:internet --> + </head> + + <body id="uidemo"> + <h1>UI Sortable: <em>Layout demo</em></h1> + + <div id="container"> + <div id="header" class="ui-sortable"> + <h2>Header</h2> + <dl class="sort"> + <dt>Pages</dt> + <dd>Main Navigation</dd> + </dl> + </div> + + <div id="content" class="ui-sortable"> + <h2>Content</h2> + <dl class="sort"> + <dt>Blog</dt> + <dd>Main blog post</dd> + </dl> + </div> + + <div id="sidebar" class="ui-sortable"> + <h2>Sidebar</h2> + <dl class="sort"> + <dt>Pages</dt> + <dd>Mini About</dd> + </dl> + <dl class="sort"> + <dt>Blog</dt> + <dd>Monthly Archives</dd> + </dl> + <dl class="sort"> + <dt>Links</dt> + <dd>Random Links</dd> + </dl> + </div> + + <div class="clear"></div> + + <div id="footer" class="ui-sortable"> + <h2>Footer</h2> + <dl class="sort"> + <dt>Pages</dt> + <dd>Copyright</dd> + </dl> + </div> + </div> + + <div id="trashcan" class="ui-sortable"> + <h2>Trash can</h2> + <p>Drag modules here to delete them.</p> + </div> + + <div class="clear"></div> + <div id="overlay"> + <div id="preloader"><img src="loader.gif" alt="" /></div> + </div> + + <!-- jQuery Core --> + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + + <!-- jQuery UI Base --> + <script type="text/javascript" src="../../../source/ui.core.js"></script> + + <!-- jQuery UI Plugins --> + <script type="text/javascript" src="../../../source/ui.draggable.js"></script> + <script type="text/javascript" src="../../../source/ui.droppable.js"></script> + <script type="text/javascript" src="../../../source/ui.sortable.js"></script> + + + <!-- jQuery UI Demo --> + <script type="text/javascript" src="demo.js"></script> + </body> +</html>
\ No newline at end of file diff --git a/demos/real-world/layout/loader.gif b/demos/real-world/layout/loader.gif Binary files differnew file mode 100644 index 000000000..7e717cdf9 --- /dev/null +++ b/demos/real-world/layout/loader.gif diff --git a/demos/real-world/layout/loader_bg.gif b/demos/real-world/layout/loader_bg.gif Binary files differnew file mode 100644 index 000000000..9c0488402 --- /dev/null +++ b/demos/real-world/layout/loader_bg.gif diff --git a/demos/real-world/photo-manager/img/P1010020.JPG b/demos/real-world/photo-manager/img/P1010020.JPG Binary files differnew file mode 100644 index 000000000..7e6928f63 --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010020.JPG diff --git a/demos/real-world/photo-manager/img/P1010036.JPG b/demos/real-world/photo-manager/img/P1010036.JPG Binary files differnew file mode 100644 index 000000000..8216a2382 --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010036.JPG diff --git a/demos/real-world/photo-manager/img/P1010039.JPG b/demos/real-world/photo-manager/img/P1010039.JPG Binary files differnew file mode 100644 index 000000000..35de5bd8c --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010039.JPG diff --git a/demos/real-world/photo-manager/img/P1010044.JPG b/demos/real-world/photo-manager/img/P1010044.JPG Binary files differnew file mode 100644 index 000000000..4d5f88445 --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010044.JPG diff --git a/demos/real-world/photo-manager/img/P1010050.JPG b/demos/real-world/photo-manager/img/P1010050.JPG Binary files differnew file mode 100644 index 000000000..5745265f0 --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010050.JPG diff --git a/demos/real-world/photo-manager/img/P1010055.JPG b/demos/real-world/photo-manager/img/P1010055.JPG Binary files differnew file mode 100644 index 000000000..246121ba4 --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010055.JPG diff --git a/demos/real-world/photo-manager/img/P1010058.JPG b/demos/real-world/photo-manager/img/P1010058.JPG Binary files differnew file mode 100644 index 000000000..d107b38ce --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010058.JPG diff --git a/demos/real-world/photo-manager/img/P1010059.JPG b/demos/real-world/photo-manager/img/P1010059.JPG Binary files differnew file mode 100644 index 000000000..c7fcdbdd1 --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010059.JPG diff --git a/demos/real-world/photo-manager/img/P1010061.JPG b/demos/real-world/photo-manager/img/P1010061.JPG Binary files differnew file mode 100644 index 000000000..1812fbfdf --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010061.JPG diff --git a/demos/real-world/photo-manager/img/P1010063.JPG b/demos/real-world/photo-manager/img/P1010063.JPG Binary files differnew file mode 100644 index 000000000..05b0d133c --- /dev/null +++ b/demos/real-world/photo-manager/img/P1010063.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010020.JPG b/demos/real-world/photo-manager/img/thumbs/P1010020.JPG Binary files differnew file mode 100644 index 000000000..cba634588 --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010020.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010036.JPG b/demos/real-world/photo-manager/img/thumbs/P1010036.JPG Binary files differnew file mode 100644 index 000000000..1d062b364 --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010036.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010039.JPG b/demos/real-world/photo-manager/img/thumbs/P1010039.JPG Binary files differnew file mode 100644 index 000000000..2d0b6c726 --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010039.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010044.JPG b/demos/real-world/photo-manager/img/thumbs/P1010044.JPG Binary files differnew file mode 100644 index 000000000..9d0cccf86 --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010044.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010050.JPG b/demos/real-world/photo-manager/img/thumbs/P1010050.JPG Binary files differnew file mode 100644 index 000000000..89a36b78b --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010050.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010055.JPG b/demos/real-world/photo-manager/img/thumbs/P1010055.JPG Binary files differnew file mode 100644 index 000000000..889b4e67d --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010055.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010058.JPG b/demos/real-world/photo-manager/img/thumbs/P1010058.JPG Binary files differnew file mode 100644 index 000000000..6a83a628b --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010058.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010059.JPG b/demos/real-world/photo-manager/img/thumbs/P1010059.JPG Binary files differnew file mode 100644 index 000000000..6aac87261 --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010059.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010061.JPG b/demos/real-world/photo-manager/img/thumbs/P1010061.JPG Binary files differnew file mode 100644 index 000000000..bfe698e86 --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010061.JPG diff --git a/demos/real-world/photo-manager/img/thumbs/P1010063.JPG b/demos/real-world/photo-manager/img/thumbs/P1010063.JPG Binary files differnew file mode 100644 index 000000000..88c22e021 --- /dev/null +++ b/demos/real-world/photo-manager/img/thumbs/P1010063.JPG diff --git a/demos/real-world/photo-manager/index.html b/demos/real-world/photo-manager/index.html new file mode 100644 index 000000000..ecc9a5500 --- /dev/null +++ b/demos/real-world/photo-manager/index.html @@ -0,0 +1,126 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <title>jQuery UI Draggables and Droppables playground</title> + + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <meta http-equiv="content-language" content="en" /> + + <meta name="keywords" content="jquery, ui, droppables, draggables, demo" /> + <meta name="description" content="Demonstration of jQuery UI Droppables and Dragables. More to come." /> + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + <script type="text/javascript" src="js/jquery.livequery.js"></script> + <script type="text/javascript" src="js/jquery.blockUI.js"></script> + + <script type="text/javascript" src="../../../source/ui.core.js"></script> + <script type="text/javascript" src="../../../source/ui.draggable.js"></script> + <script type="text/javascript" src="../../../source/ui.droppable.js"></script> + + <script type="text/javascript" src="./js/demo.js"></script> + + <link rel="stylesheet" type="text/css" href="./theme/css/screen.css" media="screen, projection" /> + </head> + <body> + <h1>Manage Your Photos</h1> + <div id="body_wrap"> + <div id="content"> + <h2>Drag photos to the Trash or waste them in the Shredder:</h2> + <ul class="gallery"> + <li> + <img src="./img/thumbs/P1010020.JPG" alt="Tatry 1" title="Drag me!" /> + <p>Tatry 1</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010020.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010036.JPG" alt="Tatry 2" title="Drag me!" /> + <p>Tatry 2</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010036.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010039.JPG" alt="Tatry 3" title="Drag me!" /> + <p>Tatry 3</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010039.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010044.JPG" alt="Tatry 4" title="Drag me!" /> + <p>Tatry 4</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010044.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010050.JPG" alt="Tatry 5" title="Drag me!" /> + <p>Tatry 5</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010050.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010055.JPG" alt="Tatry 6" title="Drag me!" /> + <p>Tatry 6</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010055.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010058.JPG" alt="Tatry 7" title="Drag me!" /> + <p>Tatry 7</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010058.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010059.JPG" alt="Tatry 8" title="Drag me!" /> + <p>Tatry 8</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010059.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010061.JPG" alt="Tatry 9" title="Drag me!" /> + <p>Tatry 9</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010061.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + <li> + <img src="./img/thumbs/P1010063.JPG" alt="Tatry 10" title="Drag me!" /> + <p>Tatry 10</p> + <div> + <a href="#" title="Trash me." class="tb_trash">Trash me</a> + <a href="./img/P1010063.JPG" title="See me supersized." class="tb_supersize">See me supersized</a> + </div> + </li> + </ul> + </div> + <div id="sidebar"> + <div class="box" id="trash"> + <h2>Trash (drag me back)</h2> + <div></div> + </div> + <div class="box" id="shred"> + <h2>Shredder (see me no more)</h2> + <div></div> + </div> + </div> + </div> + <div id="footer"> + <p>Demo footer here :)</p> + </div> + </body> +</html> diff --git a/demos/real-world/photo-manager/js/demo.js b/demos/real-world/photo-manager/js/demo.js new file mode 100644 index 000000000..fac91ca1c --- /dev/null +++ b/demos/real-world/photo-manager/js/demo.js @@ -0,0 +1,130 @@ +/* + * The very first increment of Droppables&Draggables demo. The code is going to + * be more concise (remove unnecessary code repetitions etc.). And imho the + * photo management is a good candidate for demonstration of more jQuery UI + * components (sortables, selectables...). More to come... + * + */ + +$(window).bind('load', function() { + // make images in the gallery draggable + $('ul.gallery img').addClass('img_content').draggable({ + helper: 'clone' + }); + + // make the trash box droppable, accepting images from the content section only + $('#trash div').droppable({ + accept: '.img_content', + activeClass: 'active', + drop: function(ev, ui) { + var $that = $(this); + ui.draggable.parent().fadeOut('slow', function() { + ui.draggable + .hide() + .appendTo($that) + .fadeIn('slow') + .animate({ + width: '72px', + height: '54px' + }) + .removeClass('img_content') + .addClass('img_trash'); + $(this).remove(); + }); + } + }); + + // make the shredder box droppable, accepting images from both content and trash sections + $('#shred div').droppable({ + accept: '.img_content, .img_trash', + activeClass: 'active', + drop: function(ev, ui) { + var $that = $(this); + // images from the content + if (ui.draggable.hasClass('img_content')) { + ui.draggable.parent().fadeOut('slow', function() { + ui.draggable + .appendTo($that) + .animate({ + width: '0', + height: '0' + }, 'slow', function(){ + $(this).remove(); + }); + $(this).remove(); + }); + } + // images from the trash + else if (ui.draggable.hasClass('img_trash')) { + ui.draggable + .appendTo($that) + .animate({ + width: '0', + height: '0' + }, 'slow', function(){ + $(this).remove(); + }); + } + } + }); + + // make the gallery droppable as well, accepting images from the trash only + $('ul.gallery').droppable({ + accept: '.img_trash', + activeClass: 'active', + drop: function(ev, ui) { + var $that = $(this); + ui.draggable.fadeOut('slow', function() { + var $item = createGalleryItem(this).appendTo($that); + $(this) + .removeClass('img_trash') + .addClass('img_content') + .css({ width: '144px', height: '108px' }) + .show(); + $item.fadeIn('slow'); + }); + } + }); + + // handle the trash icon behavior + $('a.tb_trash').livequery('click', function() { + var $this = $(this); + var $img = $this.parent().siblings('img'); + var $item = $this.parents('li'); + + $item.fadeOut('slow', function() { + $img + .hide() + .appendTo('#trash div') + .fadeIn('slow') + .animate({ + width: '72px', + height: '54px' + }) + .removeClass('img_content') + .addClass('img_trash'); + $(this).remove(); + }); + + return false; + }); + + // handle the magnify button + $('a.tb_supersize').livequery('click', function() { + $('<img width="576" height="432">') + .attr('src', $(this).attr('href')) + .appendTo('#body_wrap') + .displayBox(); + return false; + }); +}); + +function createGalleryItem(img) { + var title = img.getAttribute('alt'); + var href = img.getAttribute('src').replace(/thumbs\//, ''); + + var $item = $('<li><p>'+title+'</p><div><a href="#" title="Trash me" class="tb_trash">Trash me</a><a href="'+href+'" title="See me supersized" class="tb_supersize">See me supersized</a></div></li>').hide(); + $item.prepend($(img)); + + return $item; +} diff --git a/demos/real-world/photo-manager/js/jquery.blockUI.js b/demos/real-world/photo-manager/js/jquery.blockUI.js new file mode 100644 index 000000000..b24c2dd05 --- /dev/null +++ b/demos/real-world/photo-manager/js/jquery.blockUI.js @@ -0,0 +1,361 @@ +/* + * jQuery blockUI plugin + * Version 1.33 (09/14/2007) + * @requires jQuery v1.1.1 + * + * $Id: jquery.blockUI.js 3291 2007-09-14 23:56:25Z malsup $ + * + * Examples at: http://malsup.com/jquery/block/ + * Copyright (c) 2007 M. Alsup + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + (function($) { +/** + * blockUI provides a mechanism for blocking user interaction with a page (or parts of a page). + * This can be an effective way to simulate synchronous behavior during ajax operations without + * locking the browser. It will prevent user operations for the current page while it is + * active ane will return the page to normal when it is deactivate. blockUI accepts the following + * two optional arguments: + * + * message (String|Element|jQuery): The message to be displayed while the UI is blocked. The message + * argument can be a plain text string like "Processing...", an HTML string like + * "<h1><img src="busy.gif" /> Please wait...</h1>", a DOM element, or a jQuery object. + * The default message is "<h1>Please wait...</h1>" + * + * css (Object): Object which contains css property/values to override the default styles of + * the message. Use this argument if you wish to override the default + * styles. The css Object should be in a format suitable for the jQuery.css + * function. For example: + * $.blockUI({ + * backgroundColor: '#ff8', + * border: '5px solid #f00, + * fontWeight: 'bold' + * }); + * + * The default blocking message used when blocking the entire page is "<h1>Please wait...</h1>" + * but this can be overridden by assigning a value to $.blockUI.defaults.pageMessage in your + * own code. For example: + * + * $.blockUI.defaults.pageMessage = "<h1>Bitte Wartezeit</h1>"; + * + * The default message styling can also be overridden. For example: + * + * $.extend($.blockUI.defaults.pageMessageCSS, { color: '#00a', backgroundColor: '#0f0' }); + * + * The default styles work well for simple messages like "Please wait", but for longer messages + * style overrides may be necessary. + * + * @example $.blockUI(); + * @desc prevent user interaction with the page (and show the default message of 'Please wait...') + * + * @example $.blockUI( { backgroundColor: '#f00', color: '#fff'} ); + * @desc prevent user interaction and override the default styles of the message to use a white on red color scheme + * + * @example $.blockUI('Processing...'); + * @desc prevent user interaction and display the message "Processing..." instead of the default message + * + * @name blockUI + * @param String|jQuery|Element message Message to display while the UI is blocked + * @param Object css Style object to control look of the message + * @cat Plugins/blockUI + */ +$.blockUI = function(msg, css, opts) { + $.blockUI.impl.install(window, msg, css, opts); +}; + +// expose version number so other plugins can interogate +$.blockUI.version = 1.33; + +/** + * unblockUI removes the UI block that was put in place by blockUI + * + * @example $.unblockUI(); + * @desc unblocks the page + * + * @name unblockUI + * @cat Plugins/blockUI + */ +$.unblockUI = function(opts) { + $.blockUI.impl.remove(window, opts); +}; + +/** + * Blocks user interaction with the selected elements. (Hat tip: Much of + * this logic comes from Brandon Aaron's bgiframe plugin. Thanks, Brandon!) + * By default, no message is displayed when blocking elements. + * + * @example $('div.special').block(); + * @desc prevent user interaction with all div elements with the 'special' class. + * + * @example $('div.special').block('Please wait'); + * @desc prevent user interaction with all div elements with the 'special' class + * and show a message over the blocked content. + * + * @name block + * @type jQuery + * @param String|jQuery|Element message Message to display while the element is blocked + * @param Object css Style object to control look of the message + * @cat Plugins/blockUI + */ +$.fn.block = function(msg, css, opts) { + return this.each(function() { + if (!this.$pos_checked) { + if ($.css(this,"position") == 'static') + this.style.position = 'relative'; + if ($.browser.msie) this.style.zoom = 1; // force 'hasLayout' in IE + this.$pos_checked = 1; + } + $.blockUI.impl.install(this, msg, css, opts); + }); +}; + +/** + * Unblocks content that was blocked by "block()" + * + * @example $('div.special').unblock(); + * @desc unblocks all div elements with the 'special' class. + * + * @name unblock + * @type jQuery + * @cat Plugins/blockUI + */ +$.fn.unblock = function(opts) { + return this.each(function() { + $.blockUI.impl.remove(this, opts); + }); +}; + +/** + * displays the first matched element in a "display box" above a page overlay. + * + * @example $('#myImage').displayBox(); + * @desc displays "myImage" element in a box + * + * @name displayBox + * @type jQuery + * @cat Plugins/blockUI + */ +$.fn.displayBox = function(css, fn, isFlash) { + var msg = this[0]; + if (!msg) return; + var $msg = $(msg); + css = css || {}; + + var w = $msg.width() || $msg.attr('width') || css.width || $.blockUI.defaults.displayBoxCSS.width; + var h = $msg.height() || $msg.attr('height') || css.height || $.blockUI.defaults.displayBoxCSS.height ; + if (w[w.length-1] == '%') { + var ww = document.documentElement.clientWidth || document.body.clientWidth; + w = parseInt(w) || 100; + w = (w * ww) / 100; + } + if (h[h.length-1] == '%') { + var hh = document.documentElement.clientHeight || document.body.clientHeight; + h = parseInt(h) || 100; + h = (h * hh) / 100; + } + + var ml = '-' + parseInt(w)/2 + 'px'; + var mt = '-' + parseInt(h)/2 + 'px'; + + // supress opacity on overlay if displaying flash content on mac/ff platform + var ua = navigator.userAgent.toLowerCase(); + var opts = { + displayMode: fn || 1, + noalpha: isFlash && /mac/.test(ua) && /firefox/.test(ua) + }; + + $.blockUI.impl.install(window, msg, { width: w, height: h, marginTop: mt, marginLeft: ml }, opts); +}; + + +// override these in your code to change the default messages and styles +$.blockUI.defaults = { + // the message displayed when blocking the entire page + pageMessage: '<h1>Please wait...</h1>', + // the message displayed when blocking an element + elementMessage: '', // none + // styles for the overlay iframe + overlayCSS: { backgroundColor: '#fff', opacity: '0.5' }, + // styles for the message when blocking the entire page + pageMessageCSS: { width:'250px', margin:'-50px 0 0 -125px', top:'50%', left:'50%', textAlign:'center', color:'#000', backgroundColor:'#fff', border:'3px solid #aaa' }, + // styles for the message when blocking an element + elementMessageCSS: { width:'250px', padding:'10px', textAlign:'center', backgroundColor:'#fff'}, + // styles for the displayBox + displayBoxCSS: { width: '400px', height: '400px', top:'50%', left:'50%' }, + // allow body element to be stetched in ie6 + ie6Stretch: 1, + // supress tab nav from leaving blocking content? + allowTabToLeave: 0, + // Title attribute for overlay when using displayBox + closeMessage: 'Click to close', + // use fadeOut effect when unblocking (can be overridden on unblock call) + fadeOut: 1, + // fadeOut transition time in millis + fadeTime: 400 +}; + +// the gory details +$.blockUI.impl = { + box: null, + boxCallback: null, + pageBlock: null, + pageBlockEls: [], + op8: window.opera && window.opera.version() < 9, + ie6: $.browser.msie && /MSIE 6.0/.test(navigator.userAgent), + install: function(el, msg, css, opts) { + opts = opts || {}; + this.boxCallback = typeof opts.displayMode == 'function' ? opts.displayMode : null; + this.box = opts.displayMode ? msg : null; + var full = (el == window); + + // use logical settings for opacity support based on browser but allow overrides via opts arg + var noalpha = this.op8 || $.browser.mozilla && /Linux/.test(navigator.platform); + if (typeof opts.alphaOverride != 'undefined') + noalpha = opts.alphaOverride == 0 ? 1 : 0; + + if (full && this.pageBlock) this.remove(window, {fadeOut:0}); + // check to see if we were only passed the css object (a literal) + if (msg && typeof msg == 'object' && !msg.jquery && !msg.nodeType) { + css = msg; + msg = null; + } + msg = msg ? (msg.nodeType ? $(msg) : msg) : full ? $.blockUI.defaults.pageMessage : $.blockUI.defaults.elementMessage; + if (opts.displayMode) + var basecss = jQuery.extend({}, $.blockUI.defaults.displayBoxCSS); + else + var basecss = jQuery.extend({}, full ? $.blockUI.defaults.pageMessageCSS : $.blockUI.defaults.elementMessageCSS); + css = jQuery.extend(basecss, css || {}); + var f = ($.browser.msie) ? $('<iframe class="blockUI" style="z-index:1000;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>') + : $('<div class="blockUI" style="display:none"></div>'); + var w = $('<div class="blockUI" style="z-index:1001;cursor:wait;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'); + var m = full ? $('<div class="blockUI blockMsg" style="z-index:1002;cursor:wait;padding:0;position:fixed"></div>') + : $('<div class="blockUI" style="display:none;z-index:1002;cursor:wait;position:absolute"></div>'); + w.css('position', full ? 'fixed' : 'absolute'); + if (msg) m.css(css); + if (!noalpha) w.css($.blockUI.defaults.overlayCSS); + if (this.op8) w.css({ width:''+el.clientWidth,height:''+el.clientHeight }); // lame + if ($.browser.msie) f.css('opacity','0.0'); + + $([f[0],w[0],m[0]]).appendTo(full ? 'body' : el); + + // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) + var expr = $.browser.msie && (!$.boxModel || $('object,embed', full ? null : el).length > 0); + if (this.ie6 || expr) { + // stretch content area if it's short + if (full && $.blockUI.defaults.ie6Stretch && $.boxModel) + $('html,body').css('height','100%'); + + // fix ie6 problem when blocked element has a border width + if ((this.ie6 || !$.boxModel) && !full) { + var t = this.sz(el,'borderTopWidth'), l = this.sz(el,'borderLeftWidth'); + var fixT = t ? '(0 - '+t+')' : 0; + var fixL = l ? '(0 - '+l+')' : 0; + } + + // simulate fixed position + $.each([f,w,m], function(i,o) { + var s = o[0].style; + s.position = 'absolute'; + if (i < 2) { + full ? s.setExpression('height','document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + "px"') + : s.setExpression('height','this.parentNode.offsetHeight + "px"'); + full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') + : s.setExpression('width','this.parentNode.offsetWidth + "px"'); + if (fixL) s.setExpression('left', fixL); + if (fixT) s.setExpression('top', fixT); + } + else { + if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); + s.marginTop = 0; + } + }); + } + if (opts.displayMode) { + w.css('cursor','default').attr('title', $.blockUI.defaults.closeMessage); + m.css('cursor','default'); + $([f[0],w[0],m[0]]).removeClass('blockUI').addClass('displayBox'); + $().click($.blockUI.impl.boxHandler).bind('keypress', $.blockUI.impl.boxHandler); + } + else + this.bind(1, el); + m.append(msg).show(); + if (msg.jquery) msg.show(); + if (opts.displayMode) return; + if (full) { + this.pageBlock = m[0]; + this.pageBlockEls = $(':input:enabled:visible',this.pageBlock); + setTimeout(this.focus, 20); + } + else this.center(m[0]); + }, + remove: function(el, opts) { + var o = $.extend({}, $.blockUI.defaults, opts); + this.bind(0, el); + var full = el == window; + var els = full ? $('body').children().filter('.blockUI') : $('.blockUI', el); + if (full) this.pageBlock = this.pageBlockEls = null; + + if (o.fadeOut) { + els.fadeOut(o.fadeTime, function() { + if (this.parentNode) this.parentNode.removeChild(this); + }); + } + else els.remove(); + }, + boxRemove: function(el) { + $().unbind('click',$.blockUI.impl.boxHandler).unbind('keypress', $.blockUI.impl.boxHandler); + if (this.boxCallback) + this.boxCallback(this.box); + $('body .displayBox').hide().remove(); + }, + // event handler to suppress keyboard/mouse events when blocking + handler: function(e) { + if (e.keyCode && e.keyCode == 9) { + if ($.blockUI.impl.pageBlock && !$.blockUI.defaults.allowTabToLeave) { + var els = $.blockUI.impl.pageBlockEls; + var fwd = !e.shiftKey && e.target == els[els.length-1]; + var back = e.shiftKey && e.target == els[0]; + if (fwd || back) { + setTimeout(function(){$.blockUI.impl.focus(back)},10); + return false; + } + } + } + if ($(e.target).parents('div.blockMsg').length > 0) + return true; + return $(e.target).parents().children().filter('div.blockUI').length == 0; + }, + boxHandler: function(e) { + if ((e.keyCode && e.keyCode == 27) || (e.type == 'click' && $(e.target).parents('div.blockMsg').length == 0)) + $.blockUI.impl.boxRemove(); + return true; + }, + // bind/unbind the handler + bind: function(b, el) { + var full = el == window; + // don't bother unbinding if there is nothing to unbind + if (!b && (full && !this.pageBlock || !full && !el.$blocked)) return; + if (!full) el.$blocked = b; + var $e = $(el).find('a,:input'); + $.each(['mousedown','mouseup','keydown','keypress','click'], function(i,o) { + $e[b?'bind':'unbind'](o, $.blockUI.impl.handler); + }); + }, + focus: function(back) { + if (!$.blockUI.impl.pageBlockEls) return; + var e = $.blockUI.impl.pageBlockEls[back===true ? $.blockUI.impl.pageBlockEls.length-1 : 0]; + if (e) e.focus(); + }, + center: function(el) { + var p = el.parentNode, s = el.style; + var l = ((p.offsetWidth - el.offsetWidth)/2) - this.sz(p,'borderLeftWidth'); + var t = ((p.offsetHeight - el.offsetHeight)/2) - this.sz(p,'borderTopWidth'); + s.left = l > 0 ? (l+'px') : '0'; + s.top = t > 0 ? (t+'px') : '0'; + }, + sz: function(el, p) { return parseInt($.css(el,p))||0; } +}; + +})(jQuery); diff --git a/demos/real-world/photo-manager/js/jquery.livequery.js b/demos/real-world/photo-manager/js/jquery.livequery.js new file mode 100644 index 000000000..dfed9fe75 --- /dev/null +++ b/demos/real-world/photo-manager/js/jquery.livequery.js @@ -0,0 +1,250 @@ +/* Copyright (c) 2007 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * Version: @VERSION + * Requires jQuery 1.1.3+ + * Docs: http://docs.jquery.com/Plugins/livequery + */ + +(function($) { + +$.extend($.fn, { + livequery: function(type, fn, fn2) { + var self = this, q; + + // Handle different call patterns + if ($.isFunction(type)) + fn2 = fn, fn = type, type = undefined; + + // See if Live Query already exists + $.each( $.livequery.queries, function(i, query) { + if ( self.selector == query.selector && self.context == query.context && + type == query.type && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) ) + // Found the query, exit the each loop + return (q = query) && false; + }); + + // Create new Live Query if it wasn't found + q = q || new $.livequery(this.selector, this.context, type, fn, fn2); + + // Make sure it is running + q.stopped = false; + + // Run it + $.livequery.run( q.id ); + + // Contnue the chain + return this; + }, + + expire: function(type, fn, fn2) { + var self = this; + + // Handle different call patterns + if ($.isFunction(type)) + fn2 = fn, fn = type, type = undefined; + + // Find the Live Query based on arguments and stop it + $.each( $.livequery.queries, function(i, query) { + if ( self.selector == query.selector && self.context == query.context && + (!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped ) + $.livequery.stop(query.id); + }); + + // Continue the chain + return this; + } +}); + +$.livequery = function(selector, context, type, fn, fn2) { + this.selector = selector; + this.context = context || document; + this.type = type; + this.fn = fn; + this.fn2 = fn2; + this.elements = []; + this.stopped = false; + + // The id is the index of the Live Query in $.livequery.queries + this.id = $.livequery.queries.push(this)-1; + + // Mark the functions for matching later on + fn.$lqguid = fn.$lqguid || $.livequery.guid++; + if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++; + + // Return the Live Query + return this; +}; + +$.livequery.prototype = { + stop: function() { + var query = this; + + if ( this.type ) + // Unbind all bound events + this.elements.unbind(this.type, this.fn); + else if (this.fn2) + // Call the second function for all matched elements + this.elements.each(function(i, el) { + query.fn2.apply(el); + }); + + // Clear out matched elements + this.elements = []; + + // Stop the Live Query from running until restarted + this.stopped = true; + }, + + run: function() { + // Short-circuit if stopped + if ( this.stopped ) return; + var query = this; + + var oEls = this.elements, + els = $(this.selector, this.context), + nEls = els.not(oEls); + + // Set elements to the latest set of matched elements + this.elements = els; + + if (this.type) { + // Bind events to newly matched elements + nEls.bind(this.type, this.fn); + + // Unbind events to elements no longer matched + if (oEls.length > 0) + $.each(oEls, function(i, el) { + if ( $.inArray(el, els) < 0 ) + $.event.remove(el, query.type, query.fn); + }); + } + else { + // Call the first function for newly matched elements + nEls.each(function() { + query.fn.apply(this); + }); + + // Call the second function for elements no longer matched + if ( this.fn2 && oEls.length > 0 ) + $.each(oEls, function(i, el) { + if ( $.inArray(el, els) < 0 ) + query.fn2.apply(el); + }); + } + } +}; + +$.extend($.livequery, { + guid: 0, + queries: [], + queue: [], + running: false, + timeout: null, + + checkQueue: function() { + if ( $.livequery.running && $.livequery.queue.length ) { + var length = $.livequery.queue.length; + // Run each Live Query currently in the queue + while ( length-- ) + $.livequery.queries[ $.livequery.queue.shift() ].run(); + } + }, + + pause: function() { + // Don't run anymore Live Queries until restarted + $.livequery.running = false; + }, + + play: function() { + // Restart Live Queries + $.livequery.running = true; + // Request a run of the Live Queries + $.livequery.run(); + }, + + registerPlugin: function() { + $.each( arguments, function(i,n) { + // Short-circuit if the method doesn't exist + if (!$.fn[n]) return; + + // Save a reference to the original method + var old = $.fn[n]; + + // Create a new method + $.fn[n] = function() { + // Call the original method + var r = old.apply(this, arguments); + + // Request a run of the Live Queries + $.livequery.run(); + + // Return the original methods result + return r; + } + }); + }, + + run: function(id) { + if (id != undefined) { + // Put the particular Live Query in the queue if it doesn't already exist + if ( $.inArray(id, $.livequery.queue) < 0 ) + $.livequery.queue.push( id ); + } + else + // Put each Live Query in the queue if it doesn't already exist + $.each( $.livequery.queries, function(id) { + if ( $.inArray(id, $.livequery.queue) < 0 ) + $.livequery.queue.push( id ); + }); + + // Clear timeout if it already exists + if ($.livequery.timeout) clearTimeout($.livequery.timeout); + // Create a timeout to check the queue and actually run the Live Queries + $.livequery.timeout = setTimeout($.livequery.checkQueue, 20); + }, + + stop: function(id) { + if (id != undefined) + // Stop are particular Live Query + $.livequery.queries[ id ].stop(); + else + // Stop all Live Queries + $.each( $.livequery.queries, function(id) { + $.livequery.queries[ id ].stop(); + }); + } +}); + +// Register core DOM manipulation methods +$.livequery.registerPlugin('append', 'prepend', 'after', 'before', 'wrap', 'attr', 'removeAttr', 'addClass', 'removeClass', 'toggleClass', 'empty', 'remove'); + +// Run Live Queries when the Document is ready +$(function() { $.livequery.play(); }); + + +// Save a reference to the original init method +var init = $.prototype.init; + +// Create a new init method that exposes two new properties: selector and context +$.prototype.init = function(a,c) { + // Call the original init and save the result + var r = init.apply(this, arguments); + + // Copy over properties if they exist already + if (a && a.selector) + r.context = a.context, r.selector = a.selector; + + // Set properties + if ( typeof a == 'string' ) + r.context = c || document, r.selector = a; + + // Return the result + return r; +}; + +// Give the init function the jQuery prototype for later instantiation (needed after Rev 4091) +$.prototype.init.prototype = $.prototype; + +})(jQuery);
\ No newline at end of file diff --git a/demos/real-world/photo-manager/theme/css/screen.css b/demos/real-world/photo-manager/theme/css/screen.css new file mode 100644 index 000000000..3866beb8e --- /dev/null +++ b/demos/real-world/photo-manager/theme/css/screen.css @@ -0,0 +1,179 @@ +body { + padding: 0; + margin: 0; + line-height: 1.5em; + font-size: 75%; /* gives us 12px in most browsers */ + font-family: "Helvetica Neue", "Lucida Grande", Helvetica, Arial, Verdana, sans-serif; + background: #aefe05 url('../img/side_top.jpg') repeat-x top; /* body background from ui.jquery.com */ + color: 222; +} + +/* +================================ +=LAYOUT +================================ */ +h1 { + padding: 0 0 0 52px; + margin: 0; + font-size: 1.5em; /* 18px */ + line-height: 2em; /* 36px */ + background: url('../img/photos_gold_32.gif') no-repeat 8px 50%; /* Thanks to Iconbuffet.com */ + color: #fff; +} +#body_wrap { + width: 960px; + margin: 0 auto; + background: #fff url('../img/body_wrap_bg.gif') repeat-y; +} +#content { + float: left; + width: 632px; +} +#sidebar { + float: right; + width: 320px; +} +#footer { + clear: both; + background: #32342f; + color: #fff; +} + +/* +================================ +=SECTIONS +================================ */ +/* +---------------- +=HEADER +---------------- */ +/* +---------------- +=CONTENT +---------------- */ +#content h2 { + padding-left: 25px; +} +/* +=gallery +-------- */ +.gallery { + min-height: 108px; + padding: 0; + margin: 18px 0; + list-style: none; +} +* html .gallery { + height: 108px; /* min-height for lte IE6 */ +} +.gallery.active { + background: #eee; +} +.gallery li { + float: left; + width: 160px; + padding: 0 25px; + margin: 0 0 8px; +} +.gallery img { + display: block; + padding: 7px; + border: 1px solid #ccc; + background: #fff; +} +.displayBox img { + border: 25px solid #222; +} +/* img title */ +.gallery p { + float: left; + padding: 0; + margin: 0; +} +/* img toolbar */ +.gallery div { + float: right; +} +.gallery div a { + float: left; + width: 24px; + height: 24px; + background-repeat: no-repeat; + background-position: center; + text-indent: -9999px; /* Phark revisited image replacement */ +} +.gallery div a:focus { + outline: 0; +} +.tb_supersize { + background-image: url('../img/search_16.gif'); /* Thanks to Iconbuffet.com */ +} +.tb_trash { + background-image: url('../img/trash_16.gif'); /* Thanks to Iconbuffet.com */ +} + +/* +---------------- +=SIDEBAR +---------------- */ +.box { + margin: 18px; + border: 1px solid #ccc; + background: #fff; +} +.box h2 { + padding: 0 8px; + margin: 0; + font-size: 1.5em; + line-height: 2em; + background: #525252 url('../img/header_bg.png') repeat-x bottom; + color: #fff; +} +.box div { + min-height: 128px; + border: 2px solid #fff; +} +* html #sidebar .box div { + height: 128px; /* min-height for lte IE6 */ +} +#trash div.active { + border-color: green; +} +#shred div.active { + border-color: red; +} +#trash div img { + float: left; + margin: 4px; +} + +/* +---------------- +=FOOTER +---------------- */ +#footer p { + margin: 0; + text-align: right; +} + + +/* +================================ +=FLOAT CLEARING +================================ */ +#body_wrap, ul.gallery, #trash div { + display: inline-block; +} +#body_wrap:after, ul.gallery:after, #trash div:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +* html #body_wrap, * html ul.gallery, * html #trash div { + height: 1%; +} +#body_wrap, ul.gallery, #trash div { + display: block; +} diff --git a/demos/real-world/photo-manager/theme/img/body_wrap_bg.gif b/demos/real-world/photo-manager/theme/img/body_wrap_bg.gif Binary files differnew file mode 100644 index 000000000..7ad1d5476 --- /dev/null +++ b/demos/real-world/photo-manager/theme/img/body_wrap_bg.gif diff --git a/demos/real-world/photo-manager/theme/img/header_bg.png b/demos/real-world/photo-manager/theme/img/header_bg.png Binary files differnew file mode 100644 index 000000000..a517ae7dd --- /dev/null +++ b/demos/real-world/photo-manager/theme/img/header_bg.png diff --git a/demos/real-world/photo-manager/theme/img/photos_gold_32.gif b/demos/real-world/photo-manager/theme/img/photos_gold_32.gif Binary files differnew file mode 100644 index 000000000..e6bdfdcbc --- /dev/null +++ b/demos/real-world/photo-manager/theme/img/photos_gold_32.gif diff --git a/demos/real-world/photo-manager/theme/img/search_16.gif b/demos/real-world/photo-manager/theme/img/search_16.gif Binary files differnew file mode 100644 index 000000000..d9ed18dfc --- /dev/null +++ b/demos/real-world/photo-manager/theme/img/search_16.gif diff --git a/demos/real-world/photo-manager/theme/img/side_top.jpg b/demos/real-world/photo-manager/theme/img/side_top.jpg Binary files differnew file mode 100644 index 000000000..ecf5a18b6 --- /dev/null +++ b/demos/real-world/photo-manager/theme/img/side_top.jpg diff --git a/demos/real-world/photo-manager/theme/img/trash_16.gif b/demos/real-world/photo-manager/theme/img/trash_16.gif Binary files differnew file mode 100644 index 000000000..cbe509180 --- /dev/null +++ b/demos/real-world/photo-manager/theme/img/trash_16.gif diff --git a/demos/real-world/product-slider/images/pb_airport_express.jpg b/demos/real-world/product-slider/images/pb_airport_express.jpg Binary files differnew file mode 100644 index 000000000..d3ae98fa6 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_airport_express.jpg diff --git a/demos/real-world/product-slider/images/pb_airport_extreme.jpg b/demos/real-world/product-slider/images/pb_airport_extreme.jpg Binary files differnew file mode 100644 index 000000000..b7d1e0395 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_airport_extreme.jpg diff --git a/demos/real-world/product-slider/images/pb_aperture20080212.jpg b/demos/real-world/product-slider/images/pb_aperture20080212.jpg Binary files differnew file mode 100644 index 000000000..b8bc10830 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_aperture20080212.jpg diff --git a/demos/real-world/product-slider/images/pb_apple_remote_desktop_20080115.jpg b/demos/real-world/product-slider/images/pb_apple_remote_desktop_20080115.jpg Binary files differnew file mode 100644 index 000000000..760035bac --- /dev/null +++ b/demos/real-world/product-slider/images/pb_apple_remote_desktop_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_cinema_display20071026.jpg b/demos/real-world/product-slider/images/pb_cinema_display20071026.jpg Binary files differnew file mode 100644 index 000000000..f75703766 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_cinema_display20071026.jpg diff --git a/demos/real-world/product-slider/images/pb_dot_mac_20080115.jpg b/demos/real-world/product-slider/images/pb_dot_mac_20080115.jpg Binary files differnew file mode 100644 index 000000000..d1bd8ffb6 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_dot_mac_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_final_cut_express_20080115.jpg b/demos/real-world/product-slider/images/pb_final_cut_express_20080115.jpg Binary files differnew file mode 100644 index 000000000..085b18033 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_final_cut_express_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_final_cut_studio2_20080115.jpg b/demos/real-world/product-slider/images/pb_final_cut_studio2_20080115.jpg Binary files differnew file mode 100644 index 000000000..1f9c60a64 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_final_cut_studio2_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_ilife_20080115.jpg b/demos/real-world/product-slider/images/pb_ilife_20080115.jpg Binary files differnew file mode 100644 index 000000000..69d6961bf --- /dev/null +++ b/demos/real-world/product-slider/images/pb_ilife_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_imac20071026.jpg b/demos/real-world/product-slider/images/pb_imac20071026.jpg Binary files differnew file mode 100644 index 000000000..961eaf7ec --- /dev/null +++ b/demos/real-world/product-slider/images/pb_imac20071026.jpg diff --git a/demos/real-world/product-slider/images/pb_iwork_20080115.jpg b/demos/real-world/product-slider/images/pb_iwork_20080115.jpg Binary files differnew file mode 100644 index 000000000..929b7130e --- /dev/null +++ b/demos/real-world/product-slider/images/pb_iwork_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_keyboards20070807.jpg b/demos/real-world/product-slider/images/pb_keyboards20070807.jpg Binary files differnew file mode 100644 index 000000000..8bed6d3d8 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_keyboards20070807.jpg diff --git a/demos/real-world/product-slider/images/pb_logic_express_20080115.jpg b/demos/real-world/product-slider/images/pb_logic_express_20080115.jpg Binary files differnew file mode 100644 index 000000000..ff708e48b --- /dev/null +++ b/demos/real-world/product-slider/images/pb_logic_express_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_logic_studio_20080115.jpg b/demos/real-world/product-slider/images/pb_logic_studio_20080115.jpg Binary files differnew file mode 100644 index 000000000..916ecce93 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_logic_studio_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_mac_mini.jpg b/demos/real-world/product-slider/images/pb_mac_mini.jpg Binary files differnew file mode 100644 index 000000000..4822b02e2 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_mac_mini.jpg diff --git a/demos/real-world/product-slider/images/pb_mac_pro_20070622.jpg b/demos/real-world/product-slider/images/pb_mac_pro_20070622.jpg Binary files differnew file mode 100644 index 000000000..d1e6ab8d6 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_mac_pro_20070622.jpg diff --git a/demos/real-world/product-slider/images/pb_macbook20071026.jpg b/demos/real-world/product-slider/images/pb_macbook20071026.jpg Binary files differnew file mode 100644 index 000000000..525175a4b --- /dev/null +++ b/demos/real-world/product-slider/images/pb_macbook20071026.jpg diff --git a/demos/real-world/product-slider/images/pb_macbook_pro20071026.jpg b/demos/real-world/product-slider/images/pb_macbook_pro20071026.jpg Binary files differnew file mode 100644 index 000000000..4e4f42cca --- /dev/null +++ b/demos/real-world/product-slider/images/pb_macbook_pro20071026.jpg diff --git a/demos/real-world/product-slider/images/pb_macbookair_20080115.jpg b/demos/real-world/product-slider/images/pb_macbookair_20080115.jpg Binary files differnew file mode 100644 index 000000000..595ecaf07 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_macbookair_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_macosx_20080115.jpg b/demos/real-world/product-slider/images/pb_macosx_20080115.jpg Binary files differnew file mode 100644 index 000000000..34ace8d55 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_macosx_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_macosx_server20071016.jpg b/demos/real-world/product-slider/images/pb_macosx_server20071016.jpg Binary files differnew file mode 100644 index 000000000..53066e432 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_macosx_server20071016.jpg diff --git a/demos/real-world/product-slider/images/pb_mighty_mouse.jpg b/demos/real-world/product-slider/images/pb_mighty_mouse.jpg Binary files differnew file mode 100644 index 000000000..a0267a7f7 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_mighty_mouse.jpg diff --git a/demos/real-world/product-slider/images/pb_quicktime.jpg b/demos/real-world/product-slider/images/pb_quicktime.jpg Binary files differnew file mode 100644 index 000000000..163059d46 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_quicktime.jpg diff --git a/demos/real-world/product-slider/images/pb_shake_20080115.jpg b/demos/real-world/product-slider/images/pb_shake_20080115.jpg Binary files differnew file mode 100644 index 000000000..43151b508 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_shake_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_timecapsule_20080115.jpg b/demos/real-world/product-slider/images/pb_timecapsule_20080115.jpg Binary files differnew file mode 100644 index 000000000..cdc24f583 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_timecapsule_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_xsan_20080115.jpg b/demos/real-world/product-slider/images/pb_xsan_20080115.jpg Binary files differnew file mode 100644 index 000000000..1623791e6 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_xsan_20080115.jpg diff --git a/demos/real-world/product-slider/images/pb_xserve.jpg b/demos/real-world/product-slider/images/pb_xserve.jpg Binary files differnew file mode 100644 index 000000000..f2c3f4b79 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_xserve.jpg diff --git a/demos/real-world/product-slider/images/pb_xserve_raid.jpg b/demos/real-world/product-slider/images/pb_xserve_raid.jpg Binary files differnew file mode 100644 index 000000000..f93f3dfc9 --- /dev/null +++ b/demos/real-world/product-slider/images/pb_xserve_raid.jpg diff --git a/demos/real-world/product-slider/images/productbrowser_background_20070622.jpg b/demos/real-world/product-slider/images/productbrowser_background_20070622.jpg Binary files differnew file mode 100644 index 000000000..0eb8f8e16 --- /dev/null +++ b/demos/real-world/product-slider/images/productbrowser_background_20070622.jpg diff --git a/demos/real-world/product-slider/images/productbrowser_scrollbar_20070622.png b/demos/real-world/product-slider/images/productbrowser_scrollbar_20070622.png Binary files differnew file mode 100644 index 000000000..997ac189c --- /dev/null +++ b/demos/real-world/product-slider/images/productbrowser_scrollbar_20070622.png diff --git a/demos/real-world/product-slider/images/productbrowser_scroller_20080115.png b/demos/real-world/product-slider/images/productbrowser_scroller_20080115.png Binary files differnew file mode 100644 index 000000000..6c9d0f9bb --- /dev/null +++ b/demos/real-world/product-slider/images/productbrowser_scroller_20080115.png diff --git a/demos/real-world/product-slider/index.html b/demos/real-world/product-slider/index.html new file mode 100644 index 000000000..07cae0de7 --- /dev/null +++ b/demos/real-world/product-slider/index.html @@ -0,0 +1,185 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <title>Slider Gallery</title> + <style type="text/css" media="screen"> + <!-- + body { + padding: 0; + font: 1em "Trebuchet MS", verdana, arial, sans-serif; + font-size: 100%; + background-color: #212121; + margin: 0; + } + + h1 { + margin-bottom: 2px; + } + + #container { + background-color: #fff; + width: 580px; + margin: 15px auto; + padding: 50px; + } + + /* slider specific CSS */ + .sliderGallery { + background: url(images/productbrowser_background_20070622.jpg) no-repeat; + overflow: hidden; + position: relative; + padding: 10px; + height: 160px; + width: 560px; + } + + .sliderGallery UL { + position: absolute; + list-style: none; + overflow: none; + white-space: nowrap; + padding: 0; + margin: 0; + } + + .sliderGallery UL LI { + display: inline; + } + + .slider { + width: 542px; + height: 17px; + margin-top: 140px; + margin-left: 5px; + padding: 1px; + position: relative; + background: url(images/productbrowser_scrollbar_20070622.png) no-repeat; + } + + .handle { + position: absolute; + cursor: move; + height: 17px; + width: 181px; + top: 0; + background: url(images/productbrowser_scroller_20080115.png) no-repeat; + z-index: 100; + } + + .slider span { + color: #bbb; + font-size: 80%; + cursor: pointer; + position: absolute; + z-index: 110; + top: 3px; + } + + .slider .slider-lbl1 { + left: 50px; + } + + .slider .slider-lbl2 { + left: 107px; + } + + .slider .slider-lbl3 { + left: 156px; + } + + .slider .slider-lbl4 { + left: 280px; + } + + .slider .slider-lbl5 { + left: 455px; + } + --> + </style> + + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../../source/ui.core.js"></script> + <script type="text/javascript" src="../../../source/ui.slider.js"></script> + + <script type="text/javascript" charset="utf-8"> + /** + * Note that we have to use window.onload because $(document).ready() fires before images are loaded + * and ul.innerWidth() - container.outerWidth(); doesn't give the correct width because the width + * of the UL hasn't expanded out until the images have finished rendering. + */ + window.onload = function () { + var container = $('div.sliderGallery'); + var ul = $('ul', container); + + var itemsWidth = ul.innerWidth() - container.outerWidth(); + + $('.slider', container).slider({ + min: 0, + max: itemsWidth, + handle: '.handle', + stop: function (event, ui) { + ul.animate({'left' : ui.value * -1}, 500); + }, + slide: function (event, ui) { + ul.css('left', ui.value * -1); + } + }); + }; + </script> +</head> +<body> + <div id="container"> + <h1>Slider Gallery</h1> + <p>This shows a demonstration of a slider widget from the jQuery UI library used to create the same effect used on <a href="http://www.apple.com/mac/">Apple's web site</a>.</p> + <p><a href="http://jqueryfordesigners.com/slider-gallery">Read the article, and see the screencast this demonstration relates to</a></p> + + <div class="sliderGallery"> + <ul> + <li><img class="pb-airportexpress" src="images/pb_airport_express.jpg" /></li> + <li><img src="images/pb_airport_extreme.jpg" /></li> + <li><img src="images/pb_timecapsule_20080115.jpg" /></li> + <li><img src="images/pb_keyboards20070807.jpg" /></li> + <li><img src="images/pb_mighty_mouse.jpg" /></li> + <li><img src="images/pb_cinema_display20071026.jpg" /></li> + <li><img src="images/pb_mac_pro_20070622.jpg" /></li> + + <li><img class="pb-macmini" src="images/pb_mac_mini.jpg" /></li> + <li><img src="images/pb_macbook20071026.jpg" /></li> + <li><img class="pb-macbookair" src="images/pb_macbookair_20080115.jpg" /></li> + <li><img class="pb-macbookpro" src="images/pb_macbook_pro20071026.jpg" /></li> + <li><img class="pb-imac" src="images/pb_imac20071026.jpg" /></li> + <li><img src="images/pb_macosx_20080115.jpg" /></li> + <li><img src="images/pb_ilife_20080115.jpg" /></li> + <li><img src="images/pb_dot_mac_20080115.jpg" /></li> + <li><img src="images/pb_iwork_20080115.jpg" /></li> + + <li><img src="images/pb_quicktime.jpg" /></li> + <li><img src="images/pb_aperture20080212.jpg" /></li> + <li><img src="images/pb_final_cut_studio2_20080115.jpg" /></li> + <li><img src="images/pb_final_cut_express_20080115.jpg" /></li> + <li><img src="images/pb_logic_studio_20080115.jpg" /></li> + <li><img src="images/pb_logic_express_20080115.jpg" /></li> + <li><img src="images/pb_shake_20080115.jpg" /></li> + <li><img src="images/pb_apple_remote_desktop_20080115.jpg" /></li> + <li><img src="images/pb_xserve.jpg" /></li> + + <li><img src="images/pb_xserve_raid.jpg" /></li> + <li><img class="pb-xsan" src="images/pb_xsan_20080115.jpg" /></li> + <li><img class="pb-macosxserver" src="images/pb_macosx_server20071016.jpg" /></li> + </ul> + <div class="slider"> + <div class="handle"></div> + <span class="slider-lbl1">Wi-Fi</span> + <span class="slider-lbl3">Macs</span> + <span class="slider-lbl4">Applications</span> + <span class="slider-lbl5">Servers</span> + </div> + </div> + </div> +</body> +</html> + + + + diff --git a/demos/real-world/range-interface/index.html b/demos/real-world/range-interface/index.html new file mode 100644 index 000000000..bb8554fa3 --- /dev/null +++ b/demos/real-world/range-interface/index.html @@ -0,0 +1,130 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Language" content="en" /> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Slider Test Page</title> +<script src="../../../../jquery/jquery-1.2.6.js" type="text/javascript" charset="utf-8"></script> +<link rel="stylesheet" href="../../../themes/flora/flora.all.css" type="text/css" media="screen" title="no title" charset="utf-8"> +<script src="../../../source/ui.core.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/ui.slider.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.core.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.blind.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.bounce.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.clip.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.drop.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.explode.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.fold.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.highlight.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.pulsate.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.scale.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.shake.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.slide.js" type="text/javascript" charset="utf-8"></script> +<script src="../../../source/effects.transfer.js" type="text/javascript" charset="utf-8"></script> + +<style type="text/css" media="all"> +#wrap { + width: 900px; + margin: 0 auto; +} +#col-1 { + width: 220px; + border: 1px solid #ccc; + padding: 20px; + float: left; +} +#col-2 { + width: 500px; + float: left; +} +#col-2 div { + width: 100px; + height: 100px; + background: #ccc; + border: 1px solid #000; + margin: 20px; + float: left; + text-align: center; + font-size: 150%; +} +.label-1 { position: absolute; left: 0; top: -1.1em; } +.label-2 { position: absolute; right: 0; top: -1.1em; } +</style> +</head> +<body class="flora"> +<div id="wrap"> + <h1>Slider Interface Example</h1> + <div id="col-1"> + <div id="slider1" class="ui-slider-2"> + <div class="ui-slider-handle"></div> + <div class="ui-slider-handle"></div> + <span class="label-1">0</span> + <span class="label-2">100</span> + </div> + <br /> + <select id="effects"> + <option>fade</option> + <option>drop</option> + <option>fold</option> + <option>highlight</option> + <option>explode</option> + <option>slide</option> + <option>clip</option> + <option>shake</option> + <option>scale</option> + <option>pulsate</option> + <option>bounce</option> + </select> + </div> + + <div id="col-2"> + <div>0</div> + <div>10</div> + <div>20</div> + <div>30</div> + <div>40</div> + <div>50</div> + <div>60</div> + <div>70</div> + <div>80</div> + <div>90</div> + <div>100</div> + </div> +</div> +<script type="text/javascript"> +$(function(){ + $('#slider1').slider({ + stepping: 10, + min: 0, + max: 100, + range: true, + change: function(e, ui) { + var minValue = $('#slider1').slider('value', 0); + var maxValue = $('#slider1').slider('value', 1); + $('#col-2 div').each(function(){ + var value = parseInt($(this).html(), 10); + if (value < minValue || value > maxValue) { + var effect = $('#effects').val(); + switch (effect) { + case 'fade' : + $(this).fadeOut(); + break; + case 'drop' : + $(this).hide('drop', { direction: 'down' }); + break; + default : + $(this).hide(effect); + } + } else + $(this).fadeIn(); + }); + }, + handles: [ + {start: 0, min: 0, max: 100}, + {start: 100, min: 0, max: 100} + ] + }); +}); +</script> +</body> +</html> diff --git a/demos/real-world/splitpane/css/demo.css b/demos/real-world/splitpane/css/demo.css new file mode 100644 index 000000000..d30c33149 --- /dev/null +++ b/demos/real-world/splitpane/css/demo.css @@ -0,0 +1,149 @@ +/* -------------------------------------------------------------- + + jQuery UI: Demo Viewer + +-------------------------------------------------------------- */ + + +/*************************************/ +/* Blueprint: reset.css */ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +dl, dt, dd, ol, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-weight: inherit; + font-style: inherit; + font-size: 100%; + font-family: inherit; + vertical-align: baseline; +} + +label { + margin-right: 5px; +} + +/* Remember to define focus styles! */ +:focus { + outline: 0; +} +body { + line-height: 1; + color: black; + background: white; + font-family: Arial,Sans-serif; font-size: 0.9em; + background-color: white; + overflow: hidden; +} +ol, ul { + list-style: none; +} + +/* Tables still need 'cellspacing="0"' in the markup. */ +table { + border-collapse: separate; + border-spacing: 0; +} +caption, th, td { + text-align: left; + font-weight: normal; +} + +/* Remove possible quote marks (") from <q>, <blockquote>. */ +blockquote:before, blockquote:after, +q:before, q:after { + content: ""; +} +blockquote, q { + quotes: "" ""; +} + +/*************************************/ +/* Viewer: Layout */ + +#wrapper { + background: #e1e7f2 url(../images/bg_gradient.gif) repeat-x; + } + #header { + padding: 10px; + background: #67A7E3; color: #fff; + position: relative; + } + #container { + height: 500px; + } + #container td { + overflow: hidden; + } + #container td div { + overflow: hidden; + padding: 0 15px 0 10px; + background: #fff; + height:475px; + font-size: 90%; + } + #container .ui-split-side-box { + width: 200px; + } + #container .ui-split-side { + overflow: hidden; + } + #container .ui-split-side ul { + margin: 0; padding: 0; padding-top: 3px; + } + #container .ui-split-side li { + margin: 0; padding: 0; border: 0; outline: 0; + list-style: none; + } + #container .ui-split-side li a { + height: 15px; + display:block; + padding: 3px 3px 3px 12px; + border-bottom: 1px solid #E8EEF7; + color: #000; + font-size: 90%; + text-decoration: none; + } + #container .ui-split-side li a:hover { + background: #E8EEF7; + border-color: #C3D9FF; + } + #container .ui-split-main-box { + + } + + #container .ui-resizable-e { + width: 10px; height: 475px; + background:#e1e7f2 url(../images/splitpane_handle-ew.gif) no-repeat scroll 75% 50% !important; + cursor:col-resize !important; + border-left: #bbb 1px solid; + padding: 3px; + } + #container .ui-resizable-n { + height: 10px; + background:#e1e7f2 url(../images/splitpane_handle-sn.gif) no-repeat scroll 50% 55% !important; + border-top: #bbb 1px solid; + padding: 3px; + } + + + + .ui-toolbar-item-hide-icon { + padding-left: 16px; height: 16px; + background-image: url(../images/icons_2.png); + background-repeat: no-repeat; margin: 0 2px; + display: inline-block; + } + + .ui-toolbar-item-hide-icon { background-position: -64px 50%; } + + .proxy { border: 1px dashed #000; }; + diff --git a/demos/real-world/splitpane/images/bg_gradient.gif b/demos/real-world/splitpane/images/bg_gradient.gif Binary files differnew file mode 100644 index 000000000..d3f535e73 --- /dev/null +++ b/demos/real-world/splitpane/images/bg_gradient.gif diff --git a/demos/real-world/splitpane/images/icons_2.png b/demos/real-world/splitpane/images/icons_2.png Binary files differnew file mode 100644 index 000000000..a05f52c7a --- /dev/null +++ b/demos/real-world/splitpane/images/icons_2.png diff --git a/demos/real-world/splitpane/images/splitpane_handle-ew.gif b/demos/real-world/splitpane/images/splitpane_handle-ew.gif Binary files differnew file mode 100644 index 000000000..262763665 --- /dev/null +++ b/demos/real-world/splitpane/images/splitpane_handle-ew.gif diff --git a/demos/real-world/splitpane/images/splitpane_handle-sn.gif b/demos/real-world/splitpane/images/splitpane_handle-sn.gif Binary files differnew file mode 100644 index 000000000..bd60c408b --- /dev/null +++ b/demos/real-world/splitpane/images/splitpane_handle-sn.gif diff --git a/demos/real-world/splitpane/index.html b/demos/real-world/splitpane/index.html new file mode 100644 index 000000000..2800b206f --- /dev/null +++ b/demos/real-world/splitpane/index.html @@ -0,0 +1,96 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta http-equiv="Content-Language" content="en" /> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>jQuery UI: SplitPane</title> + + <!-- jQuery --> + <script type="text/javascript" src="../../../../jquery/jquery-1.2.6.js"></script> + + <!-- jQuery UI --> + <script type="text/javascript" src="../../../source/ui.core.js"></script> + <script type="text/javascript" src="../../../source/ui.resizable.js"></script> + + <script src="js/demo.js" type="text/javascript" charset="utf-8"></script> + + <style type="text/css"> + @import "css/demo.css"; + </style> + +</head> +<body> + +<div id="wrapper"> + <div id="header"> + <span class="ui-toolbar-item-hide-icon"></span> <span>jQuery UI Resizable SplitPanel</span> + </div> + <table id="container" cellpadding="0" cellspacing="0" border="0"> + + <tr> + + <td class="ui-split-side-box"> + <div class="ui-split-side"> + <ul id="component-links"> + <li><a href="#ui.accordion" title="Goto Accordion's Component Page">Accordion</a></li> + <li><a href="#ui.dialog" title="Goto Dialog's Component Page">Dialog</a></li> + <li><a href="#ui.draggable" title="Goto Draggable's Component Page">Draggable</a></li> + <li><a href="#ui.droppable" title="Goto Droppable's Component Page">Droppable</a></li> + <li><a href="#ui.resizable" title="Goto Resizable's Component Page">Resizable</a></li> + <li><a href="#ui.selectable" title="Goto Selectable's Component Page">Selectable</a></li> + <li><a href="#ui.sortable" title="Goto Sortable's Component Page">Sortable</a></li> + <li><a href="#ui.tabs" title="Goto Tabs Component Page">Tabs</a></li> + </ul> + </div> + </td> + + + <td class="ui-split-main-box"> + <div class="ui-split-main1"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien. + <br><br> + Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus. + + </div> + </td> + + <td class="ui-split-main-box"> + <div class="ui-split-main2"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien. + <br><br> + Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus. + </div> + </td> + + <td class="ui-split-main-box"> + <div class="ui-split-main3"> + Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien. + <br><br> + Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus. + </div> + </td> + + </tr> + + </table> +</div> +<script type="text/javascript"> + $(function() { + + $('div.ui-split-main1, div.ui-split-main2').resizable({ + handles: 'e', + minWidth: 200, + maxWidth: 800 + }); + + $('div.ui-split-side').resizable({ + handles: 'e', + proxy: 'proxy', + minWidth: 200, + maxWidth: 300 + }); + + }); +</script> +</body> +</html> |