diff options
author | Richard Worth <rdworth@gmail.com> | 2008-09-20 17:42:04 +0000 |
---|---|---|
committer | Richard Worth <rdworth@gmail.com> | 2008-09-20 17:42:04 +0000 |
commit | 77cea8f36476e4195fac38bd57fecd70d642b24d (patch) | |
tree | 06d03e1e2d0810aa311a0051d7157c90b849e39a | |
parent | 057d3c677eefe6c6406d1344359a77a864eb1d66 (diff) | |
download | jquery-ui-77cea8f36476e4195fac38bd57fecd70d642b24d.tar.gz jquery-ui-77cea8f36476e4195fac38bd57fecd70d642b24d.zip |
set svn:eol-style to native
53 files changed, 7900 insertions, 7900 deletions
diff --git a/demos/functional/templates/ui.autocomplete.html b/demos/functional/templates/ui.autocomplete.html index 4811693f9..646dd3784 100644 --- a/demos/functional/templates/ui.autocomplete.html +++ b/demos/functional/templates/ui.autocomplete.html @@ -1,32 +1,32 @@ -<script type="text/javascript">
-
- var autocomplete_data = '["aero", "airplane", "book","movie","music","sports","skating","swim"]';
-
- var model = {
-
- renderAt: '#containerDemo',
-
- title: 'Autocomplete Demos',
-
- demos: [
-
- {
- title: 'Simple autocomplete',
- desc: 'With few lines of code you could build a autocomplete. You can try more options on the fly! ',
- html: '<input id="autocomplete" type="text" /> (Try type <em>a</em>, <em>m</em> or <em>s</em>)',
- destroy: '$("#autocomplete").autocomplete("destroy");',
- options: [
- { desc: 'Attach a autocomplete', source: '$("#autocomplete").autocomplete({data:'+autocomplete_data+'});' }
- ]
- }
-
- ]
- };
-
- $(function(){
-
- uiRenderDemo(model);
-
- });
-
+<script type="text/javascript"> + + var autocomplete_data = '["aero", "airplane", "book","movie","music","sports","skating","swim"]'; + + var model = { + + renderAt: '#containerDemo', + + title: 'Autocomplete Demos', + + demos: [ + + { + title: 'Simple autocomplete', + desc: 'With few lines of code you could build a autocomplete. You can try more options on the fly! ', + html: '<input id="autocomplete" type="text" /> (Try type <em>a</em>, <em>m</em> or <em>s</em>)', + destroy: '$("#autocomplete").autocomplete("destroy");', + options: [ + { desc: 'Attach a autocomplete', source: '$("#autocomplete").autocomplete({data:'+autocomplete_data+'});' } + ] + } + + ] + }; + + $(function(){ + + uiRenderDemo(model); + + }); + </script>
\ No newline at end of file diff --git a/demos/functional/templates/ui.colorpicker.html b/demos/functional/templates/ui.colorpicker.html index 81f5f66b2..844b6266f 100644 --- a/demos/functional/templates/ui.colorpicker.html +++ b/demos/functional/templates/ui.colorpicker.html @@ -1,41 +1,41 @@ -<script type="text/javascript">
-
- var model = {
-
- renderAt: '#containerDemo',
-
- title: 'Colorpicker Demos',
-
- demos: [
-
- {
- title: 'Inline colorpicker',
- desc: 'With few lines of code you could build a colorpicker. You can try more options on the fly!',
- html: '<div id="colorpicker" />',
- destroy: '$("#colorpicker").colorpicker("destroy");',
- options: [
- { desc: 'Make a colorpicker', source: '$("#colorpicker").colorpicker({flat:true});' }
- ]
- },
-
- {
- title: 'Triggered colorpicker',
- desc: 'With few lines of code you could build a colorpicker. You can try more options on the fly!',
- html: '<input id="colorpicker2" /><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>',
- destroy: '$("#colorpicker2").colorpicker("destroy");',
- options: [
- { desc: 'Make a colorpicker', source: '$("#colorpicker2").colorpicker( {submit: function(e,ui) { $("#colorpicker2").val(ui.hex);} });' },
- { desc: 'Fade in/out a colorpicker', source: '$("#colorpicker2").colorpicker( {show: function (e,ui) { $(this).data("colorpicker").picker.fadeIn(500);return false; }, hide: function (e,ui) { $(this).data("colorpicker").picker.fadeOut(500);return false; }, change: function(e,ui) { $("#colorpicker2").val(ui.hex); } });' }
- ]
- }
-
- ]
- };
-
- $(function(){
-
- uiRenderDemo(model);
-
- });
-
+<script type="text/javascript"> + + var model = { + + renderAt: '#containerDemo', + + title: 'Colorpicker Demos', + + demos: [ + + { + title: 'Inline colorpicker', + desc: 'With few lines of code you could build a colorpicker. You can try more options on the fly!', + html: '<div id="colorpicker" />', + destroy: '$("#colorpicker").colorpicker("destroy");', + options: [ + { desc: 'Make a colorpicker', source: '$("#colorpicker").colorpicker({flat:true});' } + ] + }, + + { + title: 'Triggered colorpicker', + desc: 'With few lines of code you could build a colorpicker. You can try more options on the fly!', + html: '<input id="colorpicker2" /><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>', + destroy: '$("#colorpicker2").colorpicker("destroy");', + options: [ + { desc: 'Make a colorpicker', source: '$("#colorpicker2").colorpicker( {submit: function(e,ui) { $("#colorpicker2").val(ui.hex);} });' }, + { desc: 'Fade in/out a colorpicker', source: '$("#colorpicker2").colorpicker( {show: function (e,ui) { $(this).data("colorpicker").picker.fadeIn(500);return false; }, hide: function (e,ui) { $(this).data("colorpicker").picker.fadeOut(500);return false; }, change: function(e,ui) { $("#colorpicker2").val(ui.hex); } });' } + ] + } + + ] + }; + + $(function(){ + + uiRenderDemo(model); + + }); + </script>
\ No newline at end of file diff --git a/demos/functional/templates/ui.datepicker.dbd.html b/demos/functional/templates/ui.datepicker.dbd.html index 6b2573461..e686b3d25 100644 --- a/demos/functional/templates/ui.datepicker.dbd.html +++ b/demos/functional/templates/ui.datepicker.dbd.html @@ -1,40 +1,40 @@ -<input type="text" size="10" value="" id="dayByDay"/>
-<style type="text/css">
-.ar_day { color: white !important; background: #eee url(templates/images/ar.gif) no-repeat center !important; }
-.au_day { color: blue !important; background: #eee url(templates/images/au.gif) no-repeat center !important; }
-.br_day { color: green !important; background: #eee url(templates/images/br.gif) no-repeat center !important; }
-.cn_day { color: red !important; background: #eee url(templates/images/cn.gif) no-repeat center !important; }
-.id_day { color: white !important; background: #eee url(templates/images/id.gif) no-repeat center !important; }
-.ie_day { color: white !important; background: #eee url(templates/images/ie.gif) no-repeat center !important; }
-.ke_day { color: red !important; background: #eee url(templates/images/ke.gif) no-repeat center !important; }
-.lb_day { color: white !important; background: #eee url(templates/images/lb.gif) no-repeat center !important; }
-.nz_day { color: blue !important; background: #eee url(templates/images/nz.gif) no-repeat center !important; }
-.se_day { color: blue !important; background: #eee url(templates/images/se.gif) no-repeat center !important; }
-.us_day { color: white !important; background: #eee url(templates/images/us.gif) no-repeat center !important; }
-.za_day { color: green !important; background: #eee url(templates/images/za.gif) no-repeat center !important; }
-</style>
-<script type="text/javascript">
-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, ""];
-}
-
-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)" : "");
-}
-
-function showDayOfYear(date) {
- var lastYearEnd = new Date(date.getFullYear() - 1, 12 - 1, 31, 0, 0, 0, 0);
- return [true, "", "Day " + ((date.getTime() - lastYearEnd.getTime()) / 86400000) + " of the year"];
-}
+<input type="text" size="10" value="" id="dayByDay"/> +<style type="text/css"> +.ar_day { color: white !important; background: #eee url(templates/images/ar.gif) no-repeat center !important; } +.au_day { color: blue !important; background: #eee url(templates/images/au.gif) no-repeat center !important; } +.br_day { color: green !important; background: #eee url(templates/images/br.gif) no-repeat center !important; } +.cn_day { color: red !important; background: #eee url(templates/images/cn.gif) no-repeat center !important; } +.id_day { color: white !important; background: #eee url(templates/images/id.gif) no-repeat center !important; } +.ie_day { color: white !important; background: #eee url(templates/images/ie.gif) no-repeat center !important; } +.ke_day { color: red !important; background: #eee url(templates/images/ke.gif) no-repeat center !important; } +.lb_day { color: white !important; background: #eee url(templates/images/lb.gif) no-repeat center !important; } +.nz_day { color: blue !important; background: #eee url(templates/images/nz.gif) no-repeat center !important; } +.se_day { color: blue !important; background: #eee url(templates/images/se.gif) no-repeat center !important; } +.us_day { color: white !important; background: #eee url(templates/images/us.gif) no-repeat center !important; } +.za_day { color: green !important; background: #eee url(templates/images/za.gif) no-repeat center !important; } +</style> +<script type="text/javascript"> +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, ""]; +} + +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)" : ""); +} + +function showDayOfYear(date) { + var lastYearEnd = new Date(date.getFullYear() - 1, 12 - 1, 31, 0, 0, 0, 0); + return [true, "", "Day " + ((date.getTime() - lastYearEnd.getTime()) / 86400000) + " of the year"]; +} </script>
\ No newline at end of file diff --git a/demos/functional/templates/ui.datepicker.dlg.html b/demos/functional/templates/ui.datepicker.dlg.html index 4d5eaaa7f..fe82c181b 100644 --- a/demos/functional/templates/ui.datepicker.dlg.html +++ b/demos/functional/templates/ui.datepicker.dlg.html @@ -1,6 +1,6 @@ -<input type="text" size="10" value="" id="dialog" readonly="readonly"/> <button id="dialogButton" type="button">Open dialog</button>
-<script type="text/javascript">
-function setDateFromDialog(date) {
- $("#dialog").val(date);
-}
+<input type="text" size="10" value="" id="dialog" readonly="readonly"/> <button id="dialogButton" type="button">Open dialog</button> +<script type="text/javascript"> +function setDateFromDialog(date) { + $("#dialog").val(date); +} </script>
\ No newline at end of file diff --git a/demos/functional/templates/ui.datepicker.inl.html b/demos/functional/templates/ui.datepicker.inl.html index 9543a98eb..925ef0718 100644 --- a/demos/functional/templates/ui.datepicker.inl.html +++ b/demos/functional/templates/ui.datepicker.inl.html @@ -1,14 +1,14 @@ -<input type="text" id="altInline" size="10"/>
-<div id="inline"></div>
-<p style="clear: both;"><!-- See day-by-day example for highlighting days code --></p>
-<script type="text/javascript">
-function setInlineDate() {
- try {
- var date = $.datepicker.parseDate("mm/dd/yy", $("#altInline").val());
- $("#inline").datepicker("setDate", date);
- }
- catch (e) {
- // Ignore
- }
-}
+<input type="text" id="altInline" size="10"/> +<div id="inline"></div> +<p style="clear: both;"><!-- See day-by-day example for highlighting days code --></p> +<script type="text/javascript"> +function setInlineDate() { + try { + var date = $.datepicker.parseDate("mm/dd/yy", $("#altInline").val()); + $("#inline").datepicker("setDate", date); + } + catch (e) { + // Ignore + } +} </script>
\ No newline at end of file diff --git a/demos/functional/templates/ui.datepicker.sel.html b/demos/functional/templates/ui.datepicker.sel.html index 3f8185af2..a05b48438 100644 --- a/demos/functional/templates/ui.datepicker.sel.html +++ b/demos/functional/templates/ui.datepicker.sel.html @@ -1,54 +1,54 @@ -<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/javascript">
-// 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));
-}
-
-// 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>
+<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/javascript"> +// 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)); +} + +// 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> diff --git a/demos/functional/templates/ui.datepicker.two.html b/demos/functional/templates/ui.datepicker.two.html index 639aa0518..62e927859 100644 --- a/demos/functional/templates/ui.datepicker.two.html +++ b/demos/functional/templates/ui.datepicker.two.html @@ -1,7 +1,7 @@ -<input type="text" size="10" value="" id="startDate"/> to <input type="text" size="10" value="" id="endDate"/>
-<script type="text/javascript">
-function customRange(input) {
- return {minDate: (input.id == "endDate" ? $("#startDate").datepicker("getDate") : null),
- maxDate: (input.id == "startDate" ? $("#endDate").datepicker("getDate") : null)};
-}
+<input type="text" size="10" value="" id="startDate"/> to <input type="text" size="10" value="" id="endDate"/> +<script type="text/javascript"> +function customRange(input) { + return {minDate: (input.id == "endDate" ? $("#startDate").datepicker("getDate") : null), + maxDate: (input.id == "startDate" ? $("#endDate").datepicker("getDate") : null)}; +} </script>
\ No newline at end of file diff --git a/demos/functional/templates/ui.magnifier.html b/demos/functional/templates/ui.magnifier.html index fd701ae3b..fddef3d6b 100644 --- a/demos/functional/templates/ui.magnifier.html +++ b/demos/functional/templates/ui.magnifier.html @@ -1,52 +1,52 @@ -<script type="text/javascript">
-
- var model = {
-
- renderAt: '#containerDemo',
-
- title: 'Magnifier Demos',
-
- demos: [
-
- {
- title: 'Simple Magnifier',
- desc: 'With few lines of code you could build a magnifier. You can try more options on the fly!',
- html: '<div id="magnifier"><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /></div>',
- destroy: '$("#magnifier").magnifier("destroy");',
- options: [
- { desc: 'Attach a magnifier', source: '$("#magnifier").magnifier();' },
- { desc: 'Small magnification', source: '$("#magnifier").magnifier({magnification:1.5});' },
- { desc: 'Disable the magnifier', source: '$("#magnifier").magnifier("disable");' }
- ]
- },
-
- {
- title: 'Opacity Magnifier',
- desc: 'With few lines of code you could build a magnifier. You can try more options on the fly!',
- html: '<div id="magnifier2"><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /></div>',
- destroy: '$("#magnifier2").magnifier("destroy");',
- options: [
- { desc: 'Opacity option', source: '$("#magnifier2").magnifier({opacity:{min:0.4,max:1.0}});' }
- ]
- },
-
- {
- title: 'Overlap Magnifier',
- desc: 'With few lines of code you could build a magnifier. You can try more options on the fly!',
- html: '<div style="height:16px;"> </div><div id="magnifier3"><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /></div><div style="height:84px;"> </div>',
- destroy: '$("#magnifier3").magnifier("destroy");',
- options: [
- { desc: 'Overlap option', source: '$("#magnifier3").magnifier({overlap:true});' }
- ]
- }
-
- ]
- };
-
- $(function(){
-
- uiRenderDemo(model);
-
- });
-
+<script type="text/javascript"> + + var model = { + + renderAt: '#containerDemo', + + title: 'Magnifier Demos', + + demos: [ + + { + title: 'Simple Magnifier', + desc: 'With few lines of code you could build a magnifier. You can try more options on the fly!', + html: '<div id="magnifier"><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /></div>', + destroy: '$("#magnifier").magnifier("destroy");', + options: [ + { desc: 'Attach a magnifier', source: '$("#magnifier").magnifier();' }, + { desc: 'Small magnification', source: '$("#magnifier").magnifier({magnification:1.5});' }, + { desc: 'Disable the magnifier', source: '$("#magnifier").magnifier("disable");' } + ] + }, + + { + title: 'Opacity Magnifier', + desc: 'With few lines of code you could build a magnifier. You can try more options on the fly!', + html: '<div id="magnifier2"><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /></div>', + destroy: '$("#magnifier2").magnifier("destroy");', + options: [ + { desc: 'Opacity option', source: '$("#magnifier2").magnifier({opacity:{min:0.4,max:1.0}});' } + ] + }, + + { + title: 'Overlap Magnifier', + desc: 'With few lines of code you could build a magnifier. You can try more options on the fly!', + html: '<div style="height:16px;"> </div><div id="magnifier3"><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /><img src="images/clock.png" width="64" height="64" alt="demo image" /></div><div style="height:84px;"> </div>', + destroy: '$("#magnifier3").magnifier("destroy");', + options: [ + { desc: 'Overlap option', source: '$("#magnifier3").magnifier({overlap:true});' } + ] + } + + ] + }; + + $(function(){ + + uiRenderDemo(model); + + }); + </script>
\ No newline at end of file diff --git a/demos/functional/templates/ui.progressbar.html b/demos/functional/templates/ui.progressbar.html index cb99c33a9..6c33203e6 100644 --- a/demos/functional/templates/ui.progressbar.html +++ b/demos/functional/templates/ui.progressbar.html @@ -1,35 +1,35 @@ -<script type="text/javascript">
-
- var model = {
-
- renderAt: '#containerDemo',
-
- title: 'Progressbar Demos',
-
- demos: [
-
- {
- title: 'Simple Progressbar',
- desc: 'With few lines of code you could build a progressbar. You can try more options on the fly!',
- html: '<div id="progressbar"></div>',
- destroy: '$("#progressbar").progressbar("destroy");',
- options: [
- { desc: 'Start a progressbar', source: '$("#progressbar").progressbar({interval:2000}); $("#progressbar").progressbar("start");' },
- { desc: 'With different increment', source: '$("#progressbar").progressbar({interval:2000, increment:100}).progressbar("start");' },
- { desc: 'Set progress to 50%', source: '$("#progressbar").progressbar().progressbar("progress", 50);' },
- { desc: 'Callback when finish', source: '$("#progressbar").progressbar({interval: 1000, stop:function(){alert("Finished");}}).progressbar("start");' },
- { desc: 'Enable the progressbar', source: '$("#progressbar").progressbar().progressbar("enable");' },
- { desc: 'Disable the progressbar', source: '$("#progressbar").progressbar().progressbar("disable");' }
- ]
- }
-
- ]
- };
-
- $(function(){
-
- uiRenderDemo(model);
-
- });
-
+<script type="text/javascript"> + + var model = { + + renderAt: '#containerDemo', + + title: 'Progressbar Demos', + + demos: [ + + { + title: 'Simple Progressbar', + desc: 'With few lines of code you could build a progressbar. You can try more options on the fly!', + html: '<div id="progressbar"></div>', + destroy: '$("#progressbar").progressbar("destroy");', + options: [ + { desc: 'Start a progressbar', source: '$("#progressbar").progressbar({interval:2000}); $("#progressbar").progressbar("start");' }, + { desc: 'With different increment', source: '$("#progressbar").progressbar({interval:2000, increment:100}).progressbar("start");' }, + { desc: 'Set progress to 50%', source: '$("#progressbar").progressbar().progressbar("progress", 50);' }, + { desc: 'Callback when finish', source: '$("#progressbar").progressbar({interval: 1000, stop:function(){alert("Finished");}}).progressbar("start");' }, + { desc: 'Enable the progressbar', source: '$("#progressbar").progressbar().progressbar("enable");' }, + { desc: 'Disable the progressbar', source: '$("#progressbar").progressbar().progressbar("disable");' } + ] + } + + ] + }; + + $(function(){ + + uiRenderDemo(model); + + }); + </script>
\ No newline at end of file diff --git a/demos/functional/templates/ui.spinner.html b/demos/functional/templates/ui.spinner.html index acfc1bb80..3db5f288b 100644 --- a/demos/functional/templates/ui.spinner.html +++ b/demos/functional/templates/ui.spinner.html @@ -1,36 +1,36 @@ -<script type="text/javascript">
-
- var model = {
-
- renderAt: '#containerDemo',
-
- title: 'Spinner Demos',
-
- demos: [
-
- {
- title: 'Simple spinner',
- desc: 'With few lines of code you could build a spinner. You can try more options on the fly!',
- html: '<input id="spinner" type="text" />',
- destroy: '$("#spinner").spinner("destroy");',
- options: [
- { desc: 'Make a spinner', source: '$("#spinner").spinner();' },
- { desc: 'A spinner with min and max value', source: '$("#spinner").spinner({min:-100, max:150});' },
- { desc: 'Big stepping', source: '$("#spinner").spinner({stepping:100});' },
- { desc: 'Currency option', source: '$("#spinner").spinner({currency:"$"});' },
- { desc: 'Disable incremental option', source: '$("#spinner").spinner({incremental:false});' },
- { desc: 'Disable the spinner', source: '$("#spinner").spinner().spinner("disable");' },
- { desc: 'Enable the spinner', source: '$("#spinner").spinner().spinner("enable");' }
- ]
- }
-
- ]
- };
-
- $(function(){
-
- uiRenderDemo(model);
-
- });
-
+<script type="text/javascript"> + + var model = { + + renderAt: '#containerDemo', + + title: 'Spinner Demos', + + demos: [ + + { + title: 'Simple spinner', + desc: 'With few lines of code you could build a spinner. You can try more options on the fly!', + html: '<input id="spinner" type="text" />', + destroy: '$("#spinner").spinner("destroy");', + options: [ + { desc: 'Make a spinner', source: '$("#spinner").spinner();' }, + { desc: 'A spinner with min and max value', source: '$("#spinner").spinner({min:-100, max:150});' }, + { desc: 'Big stepping', source: '$("#spinner").spinner({stepping:100});' }, + { desc: 'Currency option', source: '$("#spinner").spinner({currency:"$"});' }, + { desc: 'Disable incremental option', source: '$("#spinner").spinner({incremental:false});' }, + { desc: 'Disable the spinner', source: '$("#spinner").spinner().spinner("disable");' }, + { desc: 'Enable the spinner', source: '$("#spinner").spinner().spinner("enable");' } + ] + } + + ] + }; + + $(function(){ + + uiRenderDemo(model); + + }); + </script>
\ No newline at end of file diff --git a/tests/all_2.html b/tests/all_2.html index c0c714f96..06ee40166 100644 --- a/tests/all_2.html +++ b/tests/all_2.html @@ -1,81 +1,81 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>jQuery UI All Tests</title>
- <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
- <script type="text/javascript" src="../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../ui/ui.core.js"></script>
-
- <script type="text/javascript">
- var components = ["accordion","autocomplete","datepicker","dialog","draggable","progressbar","resizable","selectable","slider","sortable","spinner"];
-
- $(document).ready(function(){
-
- var $list = $("#individual_list"),
- $main = $("#main");
-
- $.each(components, function(i, val){
- $list.append('<li><a href="' + val + '.html">' + val + '</a></li>');
- $('<div class="component_panel" id="' + val + '">').appendTo($main);
- $('div#'+val).load(val + '.html #main *');
- });
-
- loadScripts();
-
- function loadScripts() {
- if ( $("div.component_panel").length == components.length ) {
- $.each(components, function(i, val){
- $('head').append('<script type="text/javascript" src="'+val+'.js"></scr'+'pit>');
- });
- } else {
- setTimeout( function (){ loadScripts(); } ,10);
- }
- }
-
-
- });
-
-
- </script>
-
- <script type="text/javascript" src="../ui/ui.accordion.js"></script>
- <script type="text/javascript" src="../ui/ui.autocomplete.js"></script>
- <script type="text/javascript" src="../ui/ui.datepicker.js"></script>
- <script type="text/javascript" src="../ui/ui.dialog.js"></script>
- <script type="text/javascript" src="../ui/ui.draggable.js"></script>
- <script type="text/javascript" src="../ui/ui.droppable.js"></script>
- <script type="text/javascript" src="../ui/ui.progressbar.js"></script>
- <script type="text/javascript" src="../ui/ui.resizable.js"></script>
- <script type="text/javascript" src="../ui/ui.selectable.js"></script>
- <script type="text/javascript" src="../ui/ui.slider.js"></script>
- <script type="text/javascript" src="../ui/ui.sortable.js"></script>
- <script type="text/javascript" src="../ui/ui.spinner.js"></script>
- <script type="text/javascript" src="../ui/ui.tabs.js"></script>
-
- <script type="text/javascript" src="qunit/testrunner.js"></script>
- <script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
- <style type="text/css">
- @import "../themes/flora/flora.datepicker.css";
- .xerror, .error { display: none }
- </style>
-
-</head>
-<body class="flora">
- <h1>jQuery UI All Tests</h1>
- <h2 id="banner"></h2>
- <h2 id="userAgent"></h2>
-
- <h4>Run individual testsuites or doubleclick a test below</h4>
- <ul id="individual_list">
- </ul>
-
- <ol id="tests"></ol>
-
- <div id="main" style="position:absolute;top:-2000000px;">
-
- </div>
-
- </body>
+<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI All Tests</title> + <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen"> + + <script type="text/javascript" src="../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../ui/ui.core.js"></script> + + <script type="text/javascript"> + var components = ["accordion","autocomplete","datepicker","dialog","draggable","progressbar","resizable","selectable","slider","sortable","spinner"]; + + $(document).ready(function(){ + + var $list = $("#individual_list"), + $main = $("#main"); + + $.each(components, function(i, val){ + $list.append('<li><a href="' + val + '.html">' + val + '</a></li>'); + $('<div class="component_panel" id="' + val + '">').appendTo($main); + $('div#'+val).load(val + '.html #main *'); + }); + + loadScripts(); + + function loadScripts() { + if ( $("div.component_panel").length == components.length ) { + $.each(components, function(i, val){ + $('head').append('<script type="text/javascript" src="'+val+'.js"></scr'+'pit>'); + }); + } else { + setTimeout( function (){ loadScripts(); } ,10); + } + } + + + }); + + + </script> + + <script type="text/javascript" src="../ui/ui.accordion.js"></script> + <script type="text/javascript" src="../ui/ui.autocomplete.js"></script> + <script type="text/javascript" src="../ui/ui.datepicker.js"></script> + <script type="text/javascript" src="../ui/ui.dialog.js"></script> + <script type="text/javascript" src="../ui/ui.draggable.js"></script> + <script type="text/javascript" src="../ui/ui.droppable.js"></script> + <script type="text/javascript" src="../ui/ui.progressbar.js"></script> + <script type="text/javascript" src="../ui/ui.resizable.js"></script> + <script type="text/javascript" src="../ui/ui.selectable.js"></script> + <script type="text/javascript" src="../ui/ui.slider.js"></script> + <script type="text/javascript" src="../ui/ui.sortable.js"></script> + <script type="text/javascript" src="../ui/ui.spinner.js"></script> + <script type="text/javascript" src="../ui/ui.tabs.js"></script> + + <script type="text/javascript" src="qunit/testrunner.js"></script> + <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + + <style type="text/css"> + @import "../themes/flora/flora.datepicker.css"; + .xerror, .error { display: none } + </style> + +</head> +<body class="flora"> + <h1>jQuery UI All Tests</h1> + <h2 id="banner"></h2> + <h2 id="userAgent"></h2> + + <h4>Run individual testsuites or doubleclick a test below</h4> + <ul id="individual_list"> + </ul> + + <ol id="tests"></ol> + + <div id="main" style="position:absolute;top:-2000000px;"> + + </div> + + </body> </html>
\ No newline at end of file diff --git a/tests/autocomplete.js b/tests/autocomplete.js index 2196e96f9..ae75a9617 100644 --- a/tests/autocomplete.js +++ b/tests/autocomplete.js @@ -1,51 +1,51 @@ -test("init", function() {
- expect(6);
-
- el = $("#autocomplete").autocomplete();
- ok(true, '.autocomplete() called on element');
-
- $([]).autocomplete();
- ok(true, '.autocomplete() called on empty collection');
-
- $("<input/>").autocomplete();
- ok(true, '.autocomplete() called on disconnected DOMElement');
-
- $("<input/>").autocomplete().autocomplete("foo");
- ok(true, 'arbitrary method called after init');
-
- $("<input/>").autocomplete().data("foo.autocomplete");
- ok(true, 'arbitrary option getter after init');
-
- $("<input/>").autocomplete().data("foo.autocomplete", "bar");
- ok(true, 'arbitrary option setter after init');
-});
-
-test("destroy", function() {
- expect(6);
-
- $("#autocomplete").autocomplete().autocomplete("destroy");
- ok(true, '.autocomplete("destroy") called on element');
-
- $([]).autocomplete().autocomplete("destroy");
- ok(true, '.autocomplete("destroy") called on empty collection');
-
- $("<input/>").autocomplete().autocomplete("destroy");
- ok(true, '.autocomplete("destroy") called on disconnected DOMElement');
-
- $("<input/>").autocomplete().autocomplete("destroy").autocomplete("foo");
- ok(true, 'arbitrary method called after destroy');
-
- $("<input/>").autocomplete().autocomplete("destroy").data("foo.autocomplete");
- ok(true, 'arbitrary option getter after destroy');
-
- $("<input/>").autocomplete().autocomplete("destroy").data("foo.autocomplete", "bar");
- ok(true, 'arbitrary option setter after destroy');
-});
-
-
-test("highlighter", function() {
- equals( jQuery.Autocompleter.defaults.highlight("Peter", "Pe"), "<strong>Pe</strong>ter" );
- equals( jQuery.Autocompleter.defaults.highlight("Peter <em><Pan></em>", "Pe"), "<strong>Pe</strong>ter <em><Pan></em>" );
- equals( jQuery.Autocompleter.defaults.highlight("Peter <em><Pan></em>", "a"), "Peter <em><P<strong>a</strong>n></em>" );
- equals( jQuery.Autocompleter.defaults.highlight("Peter <em>(<Pan>)</em>", "(<P"), "Peter <em><strong>(<P</strong>an>)</em>" );
-});
+test("init", function() { + expect(6); + + el = $("#autocomplete").autocomplete(); + ok(true, '.autocomplete() called on element'); + + $([]).autocomplete(); + ok(true, '.autocomplete() called on empty collection'); + + $("<input/>").autocomplete(); + ok(true, '.autocomplete() called on disconnected DOMElement'); + + $("<input/>").autocomplete().autocomplete("foo"); + ok(true, 'arbitrary method called after init'); + + $("<input/>").autocomplete().data("foo.autocomplete"); + ok(true, 'arbitrary option getter after init'); + + $("<input/>").autocomplete().data("foo.autocomplete", "bar"); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + expect(6); + + $("#autocomplete").autocomplete().autocomplete("destroy"); + ok(true, '.autocomplete("destroy") called on element'); + + $([]).autocomplete().autocomplete("destroy"); + ok(true, '.autocomplete("destroy") called on empty collection'); + + $("<input/>").autocomplete().autocomplete("destroy"); + ok(true, '.autocomplete("destroy") called on disconnected DOMElement'); + + $("<input/>").autocomplete().autocomplete("destroy").autocomplete("foo"); + ok(true, 'arbitrary method called after destroy'); + + $("<input/>").autocomplete().autocomplete("destroy").data("foo.autocomplete"); + ok(true, 'arbitrary option getter after destroy'); + + $("<input/>").autocomplete().autocomplete("destroy").data("foo.autocomplete", "bar"); + ok(true, 'arbitrary option setter after destroy'); +}); + + +test("highlighter", function() { + equals( jQuery.Autocompleter.defaults.highlight("Peter", "Pe"), "<strong>Pe</strong>ter" ); + equals( jQuery.Autocompleter.defaults.highlight("Peter <em><Pan></em>", "Pe"), "<strong>Pe</strong>ter <em><Pan></em>" ); + equals( jQuery.Autocompleter.defaults.highlight("Peter <em><Pan></em>", "a"), "Peter <em><P<strong>a</strong>n></em>" ); + equals( jQuery.Autocompleter.defaults.highlight("Peter <em>(<Pan>)</em>", "(<P"), "Peter <em><strong>(<P</strong>an>)</em>" ); +}); diff --git a/tests/core.js b/tests/core.js index 507b3e7cb..144c27265 100644 --- a/tests/core.js +++ b/tests/core.js @@ -1,56 +1,56 @@ -/*
- * core unit tests
- */
-(function($) {
-
-module("selectors");
-
-test("tabbable - enabled elements", function() {
- expect(10);
-
- ok( $('#input1-1').is(':tabbable'), 'input, no type');
- ok( $('#input1-2').is(':tabbable'), 'input, type text');
- ok( $('#input1-3').is(':tabbable'), 'input, type checkbox');
- ok( $('#input1-4').is(':tabbable'), 'input, type radio');
- ok( $('#input1-5').is(':tabbable'), 'input, type button');
- ok(!$('#input1-6').is(':tabbable'), 'input, type hidden');
- ok( $('#input1-7').is(':tabbable'), 'select');
- ok( $('#input1-8').is(':tabbable'), 'textarea');
- ok( $('#anchor1-1').is(':tabbable'), 'anchor with href');
- ok(!$('#anchor1-2').is(':tabbable'), 'anchor without href');
-});
-
-test("tabbable - disabled elements", function() {
- expect(8);
-
- ok(!$('#input2-1').is(':tabbable'), 'input, no type');
- ok(!$('#input2-2').is(':tabbable'), 'input, type text');
- ok(!$('#input2-3').is(':tabbable'), 'input, type checkbox');
- ok(!$('#input2-4').is(':tabbable'), 'input, type radio');
- ok(!$('#input2-5').is(':tabbable'), 'input, type button');
- ok(!$('#input2-6').is(':tabbable'), 'input, type hidden');
- ok(!$('#input2-7').is(':tabbable'), 'select');
- ok(!$('#input2-8').is(':tabbable'), 'textarea');
-});
-
-test("tabbable - hidden styles", function() {
- expect(6);
-
- ok(!$('#input3-1').is(':tabbable'), 'input, hidden wrapper - display: none');
- ok(!$('#anchor3-1').is(':tabbable'), 'anchor, hidden wrapper - display: none');
- ok(!$('#input3-2').is(':tabbable'), 'input, hidden wrapper - visibility: hidden');
- ok(!$('#anchor3-2').is(':tabbable'), 'anchor, hidden wrapper - visibility: hidden');
- ok(!$('#input3-3').is(':tabbable'), 'input, display: none');
- ok(!$('#input3-4').is(':tabbable'), 'input, visibility: hidden');
-});
-
-test("tabbable - tabindex", function() {
- expect(4);
-
- ok( $('#input4-1').is(':tabbable'), 'input, tabindex 0');
- ok( $('#input4-2').is(':tabbable'), 'input, tabindex 10');
- ok(!$('#input4-3').is(':tabbable'), 'input, tabindex -1');
- ok(!$('#input4-4').is(':tabbable'), 'input, tabindex -50');
-});
-
-})(jQuery);
+/* + * core unit tests + */ +(function($) { + +module("selectors"); + +test("tabbable - enabled elements", function() { + expect(10); + + ok( $('#input1-1').is(':tabbable'), 'input, no type'); + ok( $('#input1-2').is(':tabbable'), 'input, type text'); + ok( $('#input1-3').is(':tabbable'), 'input, type checkbox'); + ok( $('#input1-4').is(':tabbable'), 'input, type radio'); + ok( $('#input1-5').is(':tabbable'), 'input, type button'); + ok(!$('#input1-6').is(':tabbable'), 'input, type hidden'); + ok( $('#input1-7').is(':tabbable'), 'select'); + ok( $('#input1-8').is(':tabbable'), 'textarea'); + ok( $('#anchor1-1').is(':tabbable'), 'anchor with href'); + ok(!$('#anchor1-2').is(':tabbable'), 'anchor without href'); +}); + +test("tabbable - disabled elements", function() { + expect(8); + + ok(!$('#input2-1').is(':tabbable'), 'input, no type'); + ok(!$('#input2-2').is(':tabbable'), 'input, type text'); + ok(!$('#input2-3').is(':tabbable'), 'input, type checkbox'); + ok(!$('#input2-4').is(':tabbable'), 'input, type radio'); + ok(!$('#input2-5').is(':tabbable'), 'input, type button'); + ok(!$('#input2-6').is(':tabbable'), 'input, type hidden'); + ok(!$('#input2-7').is(':tabbable'), 'select'); + ok(!$('#input2-8').is(':tabbable'), 'textarea'); +}); + +test("tabbable - hidden styles", function() { + expect(6); + + ok(!$('#input3-1').is(':tabbable'), 'input, hidden wrapper - display: none'); + ok(!$('#anchor3-1').is(':tabbable'), 'anchor, hidden wrapper - display: none'); + ok(!$('#input3-2').is(':tabbable'), 'input, hidden wrapper - visibility: hidden'); + ok(!$('#anchor3-2').is(':tabbable'), 'anchor, hidden wrapper - visibility: hidden'); + ok(!$('#input3-3').is(':tabbable'), 'input, display: none'); + ok(!$('#input3-4').is(':tabbable'), 'input, visibility: hidden'); +}); + +test("tabbable - tabindex", function() { + expect(4); + + ok( $('#input4-1').is(':tabbable'), 'input, tabindex 0'); + ok( $('#input4-2').is(':tabbable'), 'input, tabindex 10'); + ok(!$('#input4-3').is(':tabbable'), 'input, tabindex -1'); + ok(!$('#input4-4').is(':tabbable'), 'input, tabindex -50'); +}); + +})(jQuery); diff --git a/tests/datepicker.html b/tests/datepicker.html index d65f80968..4ace4ad17 100644 --- a/tests/datepicker.html +++ b/tests/datepicker.html @@ -1,37 +1,37 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>jQuery UI Datepicker Test Suite</title>
-
- <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
- <script type="text/javascript" src="../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../ui/ui.core.js"></script>
- <script type="text/javascript" src="../ui/ui.datepicker.js"></script>
- <script type="text/javascript" src="../ui/i18n/ui.datepicker-fr.js"></script>
- <script type="text/javascript" src="../ui/i18n/ui.datepicker-he.js"></script>
-
- <script type="text/javascript" src="qunit/testrunner.js"></script>
- <script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
- <script type="text/javascript" src="datepicker.js"></script>
-
- <style type="text/css">
- @import "../themes/flora/flora.datepicker.css";
- .xerror, .error { display: none }
- </style>
-</head>
-<body>
-
-<h1 id="header">jQuery UI Datepicker Test Suite</h1>
-<h2 id="banner"></h2>
-<h2 id="userAgent"></h2>
-
-<ol id="tests"></ol>
-
-<div id="main" style="position:absolute;top:-2000000px;">
- <p><input type="text" id="inp"/><input type="text" id="alt"/><div id="inl"></div></p>
-</div>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Datepicker Test Suite</title> + + <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen"> + + <script type="text/javascript" src="../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../ui/ui.core.js"></script> + <script type="text/javascript" src="../ui/ui.datepicker.js"></script> + <script type="text/javascript" src="../ui/i18n/ui.datepicker-fr.js"></script> + <script type="text/javascript" src="../ui/i18n/ui.datepicker-he.js"></script> + + <script type="text/javascript" src="qunit/testrunner.js"></script> + <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="datepicker.js"></script> + + <style type="text/css"> + @import "../themes/flora/flora.datepicker.css"; + .xerror, .error { display: none } + </style> +</head> +<body> + +<h1 id="header">jQuery UI Datepicker Test Suite</h1> +<h2 id="banner"></h2> +<h2 id="userAgent"></h2> + +<ol id="tests"></ol> + +<div id="main" style="position:absolute;top:-2000000px;"> + <p><input type="text" id="inp"/><input type="text" id="alt"/><div id="inl"></div></p> +</div> + +</body> +</html> diff --git a/tests/datepicker.js b/tests/datepicker.js index 268041a90..970288438 100644 --- a/tests/datepicker.js +++ b/tests/datepicker.js @@ -1,1657 +1,1657 @@ -/*
- * datepicker unit tests
- */
-(function($) {
-
-module('datepicker');
-
-function equalsDate(d1, d2, message) {
- if (!d1 || !d2) {
- ok(false, message + ' - missing date');
- return;
- }
- d1 = new Date(d1.getFullYear(), d1.getMonth(), d1.getDate());
- d2 = new Date(d2.getFullYear(), d2.getMonth(), d2.getDate());
- equals(d1.toString(), d2.toString(), message);
-}
-
-function equalsDateArray(a1, a2, message) {
- if (!a1 || !a2) {
- ok(false, message + ' - missing dates');
- return;
- }
- a1[0] = (a1[0] ? new Date(a1[0].getFullYear(), a1[0].getMonth(), a1[0].getDate()) : '');
- a1[1] = (a1[1] ? new Date(a1[1].getFullYear(), a1[1].getMonth(), a1[1].getDate()) : '');
- a2[0] = (a2[0] ? new Date(a2[0].getFullYear(), a2[0].getMonth(), a2[0].getDate()) : '');
- a2[1] = (a2[1] ? new Date(a2[1].getFullYear(), a2[1].getMonth(), a2[1].getDate()) : '');
- equals(serialArray(a1), serialArray(a2), message);
-}
-
-function init(id, options) {
- $.datepicker.setDefaults($.datepicker.regional['']);
- var inp = $(id);
- inp.datepicker($.extend({duration: ''}, options || {}));
- return inp;
-}
-
-var PROP_NAME = 'datepicker';
-
-test('setDefaults', function() {
- var inp = init('#inp');
- var dp = $('#ui-datepicker-div');
- ok(!dp.is(':visible'), 'Initially invisible');
- ok(inp.is('.hasDatepicker'), 'Marker class set');
- ok($($.datepicker.dpDiv).html() == '', 'Content empty');
- inp.datepicker('show');
- ok($($.datepicker.dpDiv).html() != '', 'Content present');
- inp.datepicker('hide');
- equals($.datepicker._defaults.showOn, 'focus', 'Initial showOn');
- $.datepicker.setDefaults({showOn: 'button'});
- equals($.datepicker._defaults.showOn, 'button', 'Change default showOn');
- $.datepicker.setDefaults({showOn: 'focus'});
- equals($.datepicker._defaults.showOn, 'focus', 'Restore showOn');
-});
-
-test('destroy', function() {
- var inp = init('#inp');
- ok(inp.is('.hasDatepicker'), 'Default - marker class set');
- ok($.data(inp[0], PROP_NAME), 'Default - instance present');
- ok(inp.next().is('#alt'), 'Default - button absent');
- inp.datepicker('destroy');
- inp = $('#inp');
- ok(!inp.is('.hasDatepicker'), 'Default - marker class cleared');
- ok(!$.data(inp[0], PROP_NAME), 'Default - instance absent');
- ok(inp.next().is('#alt'), 'Default - button absent');
- // With button
- inp= init('#inp', {showOn: 'both'});
- ok(inp.is('.hasDatepicker'), 'Button - marker class set');
- ok($.data(inp[0], PROP_NAME), 'Button - instance present');
- ok(inp.next().text() == '...', 'Button - button added');
- inp.datepicker('destroy');
- inp = $('#inp');
- ok(!inp.is('.hasDatepicker'), 'Button - marker class cleared');
- ok(!$.data(inp[0], PROP_NAME), 'Button - instance absent');
- ok(inp.next().is('#alt'), 'Button - button removed');
- // With append text
- inp = init('#inp', {appendText: 'Testing'});
- ok(inp.is('.hasDatepicker'), 'Append - marker class set');
- ok($.data(inp[0], PROP_NAME), 'Append - instance present');
- ok(inp.next().text() == 'Testing', 'Append - append text added');
- inp.datepicker('destroy');
- inp = $('#inp');
- ok(!inp.is('.hasDatepicker'), 'Append - marker class cleared');
- ok(!$.data(inp[0], PROP_NAME), 'Append - instance absent');
- ok(inp.next().is('#alt'), 'Append - append text removed');
- // With both
- inp= init('#inp', {showOn: 'both', buttonImageOnly: true,
- buttonImage: 'img/calendar.gif', appendText: 'Testing'});
- ok(inp.is('.hasDatepicker'), 'Both - marker class set');
- ok($.data(inp[0], PROP_NAME), 'Both - instance present');
- ok(inp.next()[0].nodeName.toLowerCase() == 'img', 'Both - button added');
- ok(inp.next().next().text() == 'Testing', 'Both - append text added');
- inp.datepicker('destroy');
- inp = $('#inp');
- ok(!inp.is('.hasDatepicker'), 'Both - marker class cleared');
- ok(!$.data(inp[0], PROP_NAME), 'Both - instance absent');
- ok(inp.next().is('#alt'), 'Both - button and append text absent');
- // Inline
- var inl = init('#inl');
- ok(inl.is('.hasDatepicker'), 'Inline - marker class set');
- ok(inl.html() != '', 'Inline - datepicker present');
- ok($.data(inl[0], PROP_NAME), 'Inline - instance present');
- ok(inl.next().length == 0 || inl.next().is('p'), 'Inline - button absent');
- inl.datepicker('destroy');
- inl = $('#inl');
- ok(!inl.is('.hasDatepicker'), 'Inline - marker class cleared');
- ok(inl.html() == '', 'Inline - datepicker absent');
- ok(!$.data(inl[0], PROP_NAME), 'Inline - instance absent');
- ok(inl.next().length == 0 || inl.next().is('p'), 'Inline - button absent');
-});
-
-test('change', function() {
- var inp = init('#inp');
- var inst = $.data(inp[0], PROP_NAME);
- equals(inst.settings.showOn, null, 'Initial setting showOn');
- equals($.datepicker._get(inst, 'showOn'), 'focus', 'Initial instance showOn');
- equals($.datepicker._defaults.showOn, 'focus', 'Initial default showOn');
- inp.datepicker('change', 'showOn', 'button');
- equals(inst.settings.showOn, 'button', 'Change setting showOn');
- equals($.datepicker._get(inst, 'showOn'), 'button', 'Change instance showOn');
- equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn');
- inp.datepicker('change', {showOn: 'both'});
- equals(inst.settings.showOn, 'both', 'Change setting showOn');
- equals($.datepicker._get(inst, 'showOn'), 'both', 'Change instance showOn');
- equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn');
- inp.datepicker('change', 'showOn', undefined);
- equals(inst.settings.showOn, null, 'Clear setting showOn');
- equals($.datepicker._get(inst, 'showOn'), 'focus', 'Restore instance showOn');
- equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn');
-});
-
-test('invocation', function() {
- var inp = init('#inp');
- var dp = $('#ui-datepicker-div');
- var body = $('body');
- // On focus
- var button = inp.siblings('button');
- ok(button.length == 0, 'Focus - button absent');
- var image = inp.siblings('img');
- ok(image.length == 0, 'Focus - image absent');
- inp.focus();
- ok(dp.is(':visible'), 'Focus - rendered on focus');
- inp.simulate('keydown', {keyCode: $.simulate.VK_ESC});
- ok(!dp.is(':visible'), 'Focus - hidden on exit');
- inp.focus();
- ok(dp.is(':visible'), 'Focus - rendered on focus');
- body.simulate('mousedown', {});
- ok(!dp.is(':visible'), 'Focus - hidden on external click');
- inp.datepicker('hide').datepicker('destroy');
- // On button
- inp = init('#inp', {showOn: 'button', buttonText: 'Popup'});
- ok(!dp.is(':visible'), 'Button - initially hidden');
- button = inp.siblings('button');
- image = inp.siblings('img');
- ok(button.length == 1, 'Button - button present');
- ok(image.length == 0, 'Button - image absent');
- equals(button.text(), 'Popup', 'Button - button text');
- inp.focus();
- ok(!dp.is(':visible'), 'Button - not rendered on focus');
- button.click();
- ok(dp.is(':visible'), 'Button - rendered on button click');
- button.click();
- ok(!dp.is(':visible'), 'Button - hidden on second button click');
- inp.datepicker('hide').datepicker('destroy');
- // On image button
- inp = init('#inp', {showOn: 'button', buttonImageOnly: true,
- buttonImage: 'img/calendar.gif', buttonText: 'Cal'});
- ok(!dp.is(':visible'), 'Image button - initially hidden');
- button = inp.siblings('button');
- ok(button.length == 0, 'Image button - button absent');
- image = inp.siblings('img');
- ok(image.length == 1, 'Image button - image present');
- equals(image.attr('src'), 'img/calendar.gif', 'Image button - image source');
- equals(image.attr('title'), 'Cal', 'Image button - image text');
- inp.focus();
- ok(!dp.is(':visible'), 'Image button - not rendered on focus');
- image.click();
- ok(dp.is(':visible'), 'Image button - rendered on image click');
- image.click();
- ok(!dp.is(':visible'), 'Image button - hidden on second image click');
- inp.datepicker('hide').datepicker('destroy');
- // On both
- inp = init('#inp', {showOn: 'both', buttonImage: 'img/calendar.gif'});
- ok(!dp.is(':visible'), 'Both - initially hidden');
- button = inp.siblings('button');
- ok(button.length == 1, 'Both - button present');
- image = inp.siblings('img');
- ok(image.length == 0, 'Both - image absent');
- image = button.children('img');
- ok(image.length == 1, 'Both - button image present');
- inp.focus();
- ok(dp.is(':visible'), 'Both - rendered on focus');
- body.simulate('mousedown', {});
- ok(!dp.is(':visible'), 'Both - hidden on external click');
- button.click();
- ok(dp.is(':visible'), 'Both - rendered on button click');
- button.click();
- ok(!dp.is(':visible'), 'Both - hidden on second button click');
- inp.datepicker('hide').datepicker('destroy');
-});
-
-test('baseStructure', function() {
- var dp = $('#ui-datepicker-div');
- var inp = init('#inp');
- inp.focus();
- var iframe = ($.browser.msie && parseInt($.browser.version) < 7);
- ok(dp.is(':visible'), 'Structure - datepicker visible');
- ok(!dp.is('.ui-datepicker-rtl'), 'Structure - not right-to-left');
- ok(!dp.is('.ui-datepicker-multi'), 'Structure - not multi-month');
- equals(dp.children().length, 4 + (iframe ? 1 : 0), 'Structure - child count');
- var control = dp.children(':first');
- ok(control.is('div.ui-datepicker-control'), 'Structure - control division');
- equals(control.children().length, 2, 'Structure - control child count');
- ok(control.children(':first').is('div.ui-datepicker-clear'),
- 'Structure - clear division');
- ok(control.children(':last').is('div.ui-datepicker-close'),
- 'Structure - close division');
- var links = dp.children(':eq(1)');
- ok(links.is('div.ui-datepicker-links'), 'Structure - links division');
- equals(links.children().length, 3, 'Structure - links child count');
- ok(links.children(':first').is('div.ui-datepicker-prev') &&
- links.children(':first').html() != '',
- 'Structure - prev division');
- ok(links.children(':eq(1)').is('div.ui-datepicker-current') &&
- links.children(':eq(1)').html() != '',
- 'Structure - current division');
- ok(links.children(':last').is('div.ui-datepicker-next') &&
- links.children(':last').html() != '',
- 'Structure - next division');
- var month = dp.children(':eq(2)');
- ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'),
- 'Structure - month division');
- var header = month.children(':first');
- ok(header.is('div.ui-datepicker-header'), 'Structure - month header division');
- equals(header.children().length, 2, 'Structure - month header child count');
- ok(header.children(':first').is('select.ui-datepicker-new-month'),
- 'Structure - new month select');
- ok(header.children(':last').is('select.ui-datepicker-new-year'),
- 'Structure - new year select');
- var table = month.children(':eq(1)');
- ok(table.is('table.ui-datepicker'), 'Structure - month table');
- ok(table.children(':first').is('thead'), 'Structure - month table thead');
- var titles = table.children(':first').children(':first');
- ok(titles.is('tr.ui-datepicker-title-row'), 'Structure - month table title row');
- equals(titles.find('a').length, 7, 'Structure - month table title links');
- ok(table.children(':eq(1)').is('tbody'), 'Structure - month table body');
- ok(table.children(':eq(1)').children('tr').length >= 4,
- 'Structure - month table week count');
- var week = table.children(':eq(1)').children(':first');
- ok(week.is('tr.ui-datepicker-days-row'), 'Structure - month table week row');
- equals(week.children().length, 7, 'Structure - week child count');
- ok(week.children(':first').is('td.ui-datepicker-days-cell') &&
- week.children(':first').is('.ui-datepicker-week-end-cell') &&
- !week.children(':first').is('.ui-datepicker-week-col'),
- 'Structure - month table first day cell');
- ok(week.children(':eq(1)').is('td.ui-datepicker-days-cell') &&
- !week.children(':eq(1)').is('.ui-datepicker-week-end-cell'),
- 'Structure - month table second day cell');
- ok(dp.children('.ui-datepicker-status').length == 0, 'Structure - status');
- ok(dp.children('iframe').length == (iframe ? 1 : 0), 'Structure - iframe');
- inp.datepicker('hide').datepicker('destroy');
- // Multi-month 2
- inp = init('#inp', {numberOfMonths: 2});
- inp.focus();
- ok(dp.is('.ui-datepicker-multi'), 'Structure multi - multi-month');
- equals(dp.children().length, 5 + (iframe ? 1 : 0), 'Structure multi - child count');
- month = dp.children(':eq(2)');
- ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'),
- 'Structure multi - first month division');
- month = dp.children(':eq(3)');
- ok(month.is('div.ui-datepicker-one-month') && !month.is('div.ui-datepicker-new-row'),
- 'Structure multi - second month division');
- inp.datepicker('hide').datepicker('destroy');
- // Multi-month [2, 2]
- inp = init('#inp', {numberOfMonths: [2, 2]});
- inp.focus();
- ok(dp.is('.ui-datepicker-multi'), 'Structure multi - multi-month');
- equals(dp.children().length, 7 + (iframe ? 1 : 0), 'Structure multi - child count');
- month = dp.children(':eq(2)');
- ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'),
- 'Structure multi - first month division');
- month = dp.children(':eq(3)');
- ok(month.is('div.ui-datepicker-one-month') && !month.is('div.ui-datepicker-new-row'),
- 'Structure multi - second month division');
- month = dp.children(':eq(4)');
- ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'),
- 'Structure multi - third month division');
- month = dp.children(':eq(5)');
- ok(month.is('div.ui-datepicker-one-month') && !month.is('div.ui-datepicker-new-row'),
- 'Structure multi - fourth month division');
- inp.datepicker('hide').datepicker('destroy');
- // Inline
- var inl = init('#inl');
- dp = inl.children();
- ok(dp.is('.ui-datepicker-inline'), 'Structure inline - main div');
- ok(!dp.is('.ui-datepicker-rtl'), 'Structure inline - not right-to-left');
- ok(!dp.is('.ui-datepicker-multi'), 'Structure inline - not multi-month');
- equals(dp.children().length, 3, 'Structure inline - child count');
- var links = dp.children(':first');
- ok(links.is('div.ui-datepicker-links'), 'Structure inline - links division');
- equals(links.children().length, 3, 'Structure inline - links child count');
- var month = dp.children(':eq(1)');
- ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'),
- 'Structure inline - month division');
- var header = month.children(':first');
- ok(header.is('div.ui-datepicker-header'), 'Structure inline - month header division');
- equals(header.children().length, 2, 'Structure inline - month header child count');
- var table = month.children(':eq(1)');
- ok(table.is('table.ui-datepicker'), 'Structure inline - month table');
- ok(table.children(':first').is('thead'), 'Structure inline - month table thead');
- ok(table.children(':eq(1)').is('tbody'), 'Structure inline - month table body');
- ok(dp.children('.ui-datepicker-status').length == 0, 'Structure inline - status');
- inl.datepicker('destroy');
- // Inline multi-month
- inl = init('#inl', {numberOfMonths: 2});
- dp = inl.children();
- ok(dp.is('.ui-datepicker-inline'), 'Structure inline multi - main div');
- ok(dp.is('.ui-datepicker-multi'), 'Structure inline multi - not multi-month');
- equals(dp.children().length, 4, 'Structure inline multi - child count');
- var links = dp.children(':first');
- ok(links.is('div.ui-datepicker-links'), 'Structure inline multi - links division');
- equals(links.children().length, 3, 'Structure inline multi - links child count');
- var month = dp.children(':eq(1)');
- ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'),
- 'Structure inline multi - first month division');
- month = dp.children(':eq(2)');
- ok(month.is('div.ui-datepicker-one-month') && !month.is('div.ui-datepicker-new-row'),
- 'Structure inline multi - second month division');
- inl.datepicker('destroy');
-});
-
-test('customStructure', function() {
- var dp = $('#ui-datepicker-div');
- // Check right-to-left localisation
- var inp = init('#inp', $.datepicker.regional['he']);
- inp.focus();
- var iframe = ($.browser.msie && parseInt($.browser.version) < 7);
- ok(dp.is('.ui-datepicker-rtl'), 'Structure RTL - right-to-left');
- var links = dp.children(':eq(1)');
- ok(links.is('div.ui-datepicker-links'), 'Structure - links division');
- equals(links.children().length, 3, 'Structure - links child count');
- ok(links.children(':first').is('div.ui-datepicker-next'),
- 'Structure - next division');
- ok(links.children(':eq(1)').is('div.ui-datepicker-current'),
- 'Structure - current division');
- ok(links.children(':last').is('div.ui-datepicker-prev'),
- 'Structure - prev division');
- inp.datepicker('hide').datepicker('destroy');
- // Close at bottom
- inp = init('#inp', {closeAtTop: false});
- inp.focus();
- equals(dp.children().length, 4 + (iframe ? 1 : 0),
- 'Structure close at bottom - child count');
- ok(dp.children(':first').is('div.ui-datepicker-links'),
- 'Structure close at bottom - links division');
- ok(dp.children(':last').prev().is('div.ui-datepicker-control'),
- 'Structure close at bottom - control division');
- inp.datepicker('hide').datepicker('destroy');
- // Mandatory
- inp = init('#inp', {mandatory: true});
- inp.focus();
- var control = dp.children(':first');
- ok(control.is('div.ui-datepicker-control'),
- 'Structure mandatory - control division');
- equals(control.children().length, 1, 'Structure mandatory - control child count');
- ok(control.children(':first').is('div.ui-datepicker-close'),
- 'Structure mandatory - close division');
- inp.datepicker('hide').datepicker('destroy');
- // Hide prev/next
- inp = init('#inp', {hideIfNoPrevNext: true,
- minDate: new Date(2008, 2 - 1, 4), maxDate: new Date(2008, 2 - 1, 14)});
- inp.val('02/10/2008').focus();
- var links = dp.children(':eq(1)');
- ok(links.is('div.ui-datepicker-links'),
- 'Structure hide prev/next - links division');
- equals(links.children().length, 2, 'Structure hide prev/next - links child count');
- ok(links.children(':first').is('div.ui-datepicker-prev') &&
- links.children(':first').html() == '',
- 'Structure hide prev/next - prev division');
- ok(links.children(':last').is('div.ui-datepicker-next') &&
- links.children(':last').html() == '',
- 'Structure hide prev/next - next division');
- inp.datepicker('hide').datepicker('destroy');
- // Can't change month
- inp = init('#inp', {changeMonth: false});
- inp.focus();
- var header = dp.children(':eq(2)').children(':first');
- equals(header.children().length, 1, 'Structure change month - header child count');
- ok(header.children(':last').is('select.ui-datepicker-new-year'),
- 'Structure change month - new year select');
- inp.datepicker('hide').datepicker('destroy');
- // Can't change year
- inp = init('#inp', {changeYear: false});
- inp.focus();
- var header = dp.children(':eq(2)').children(':first');
- equals(header.children().length, 1, 'Structure change year - header child count');
- ok(header.children(':first').is('select.ui-datepicker-new-month'),
- 'Structure change year - new month select');
- inp.datepicker('hide').datepicker('destroy');
- // Can't change first day of week
- inp = init('#inp', {changeFirstDay: false});
- inp.focus();
- var titles = dp.find('.ui-datepicker-title-row');
- equals(titles.children().length, 7, 'Structure change first day - titles child count');
- equals(titles.find('a').length, 0, 'Structure change first day - titles links count');
- inp.datepicker('hide').datepicker('destroy');
- // Show weeks
- inp = init('#inp', {showWeeks: true});
- inp.focus();
- titles = dp.find('.ui-datepicker-title-row');
- equals(titles.children().length, 8, 'Structure show weeks - titles child count');
- var week = dp.find('.ui-datepicker-days-row:first');
- equals(week.children().length, 8, 'Structure show weeks - week child count');
- ok(week.children(':first').is('td.ui-datepicker-week-col'),
- 'Structure show weeks - week column');
- inp.datepicker('hide').datepicker('destroy');
- // Show status
- inp = init('#inp', {showStatus: true});
- inp.focus();
- equals(dp.children().length, 6 + (iframe ? 1 : 0),
- 'Structure show status - datepicker child count');
- ok(dp.children(':last').prev().is('div.ui-datepicker-status'),
- 'Structure show status - status division');
- inp.datepicker('hide').datepicker('destroy');
- // Inline
- var inl = init('#inl', {showStatus: true, hideIfNoPrevNext: true,
- minDate: new Date(2008, 2 - 1, 4), maxDate: new Date(2008, 2 - 1, 14)});
- dp = inl.children();
- ok(dp.is('.ui-datepicker-inline'), 'Structure inline - main div');
- ok(!dp.is('.ui-datepicker-rtl'), 'Structure inline - not right-to-left');
- ok(!dp.is('.ui-datepicker-multi'), 'Structure inline - not multi-month');
- equals(dp.children().length, 5, 'Structure inline - child count');
- var links = dp.children(':first');
- ok(links.is('div.ui-datepicker-links'), 'Structure inline - links division');
- equals(links.children().children().length, 0, 'Structure inline - links child count');
- var month = dp.children(':eq(1)');
- ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'),
- 'Structure inline - month division');
- ok(dp.children(':last').prev().is('div.ui-datepicker-status'),
- 'Structure inline - status');
- inl.datepicker('destroy');
-});
-
-test('enableDisable', function() {
- var inp = init('#inp');
- ok(!inp.datepicker('isDisabled'), 'Enable/disable - initially marked as enabled');
- ok(!inp[0].disabled, 'Enable/disable - field initially enabled');
- inp.datepicker('disable');
- ok(inp.datepicker('isDisabled'), 'Enable/disable - now marked as disabled');
- ok(inp[0].disabled, 'Enable/disable - field now disabled');
- inp.datepicker('enable');
- ok(!inp.datepicker('isDisabled'), 'Enable/disable - now marked as enabled');
- ok(!inp[0].disabled, 'Enable/disable - field now enabled');
- inp.datepicker('destroy');
- // With a button
- inp = init('#inp', {showOn: 'button'});
- ok(!inp.datepicker('isDisabled'), 'Enable/disable button - initially marked as enabled');
- ok(!inp[0].disabled, 'Enable/disable button - field initially enabled');
- ok(!inp.next('button')[0].disabled, 'Enable/disable button - button initially enabled');
- inp.datepicker('disable');
- ok(inp.datepicker('isDisabled'), 'Enable/disable button - now marked as disabled');
- ok(inp[0].disabled, 'Enable/disable button - field now disabled');
- ok(inp.next('button')[0].disabled, 'Enable/disable button - button now disabled');
- inp.datepicker('enable');
- ok(!inp.datepicker('isDisabled'), 'Enable/disable button - now marked as enabled');
- ok(!inp[0].disabled, 'Enable/disable button - field now enabled');
- ok(!inp.next('button')[0].disabled, 'Enable/disable button - button now enabled');
- inp.datepicker('destroy');
- // With an image button
- inp = init('#inp', {showOn: 'button', buttonImageOnly: true,
- buttonImage: 'img/calendar.gif'});
- ok(!inp.datepicker('isDisabled'), 'Enable/disable image - initially marked as enabled');
- ok(!inp[0].disabled, 'Enable/disable image - field initially enabled');
- ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image initially enabled');
- inp.datepicker('disable');
- ok(inp.datepicker('isDisabled'), 'Enable/disable image - now marked as disabled');
- ok(inp[0].disabled, 'Enable/disable image - field now disabled');
- ok(inp.next('img').css('opacity') != 1, 'Enable/disable image - image now disabled');
- inp.datepicker('enable');
- ok(!inp.datepicker('isDisabled'), 'Enable/disable image - now marked as enabled');
- ok(!inp[0].disabled, 'Enable/disable image - field now enabled');
- ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image now enabled');
- inp.datepicker('destroy');
- // Inline
- var inl = init('#inl');
- ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - initially marked as enabled');
- ok($('.ui-datepicker-disabled', inl).length == 0, 'Enable/disable inline - cover initially absent');
- inl.datepicker('disable');
- ok(inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as disabled');
- var disabled = $('.ui-datepicker-disabled', inl);
- var dp = $('.ui-datepicker-inline', inl);
- ok(disabled.length == 1, 'Enable/disable inline - cover now present');
- ok(disabled.offset().top == dp.offset().top && disabled.offset().left == dp.offset().left,
- 'Enable/disable inline - cover positioning');
- ok(disabled.width() == dp.width() && disabled.height() == dp.height(),
- 'Enable/disable inline - cover sizing');
- inl.datepicker('enable');
- ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as enabled');
- ok($('.ui-datepicker-disabled', inl).length == 0, 'Enable/disable inline - cover now absent');
- inl.datepicker('destroy');
-});
-
-test('keystrokes', function() {
- var inp = init('#inp');
- var date = new Date();
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke enter');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
- 'Keystroke enter - preset');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+home');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END});
- ok(inp.datepicker('getDate') == null, 'Keystroke ctrl+end');
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ESC});
- ok(inp.datepicker('getDate') == null, 'Keystroke esc');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ESC});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
- 'Keystroke esc - preset');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ESC});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
- 'Keystroke esc - abandoned');
- // Moving by day or week
- inp.val('').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_LEFT}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() - 1);
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+left');
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_LEFT}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() + 1);
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke left');
- inp.val('').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_RIGHT}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() + 1);
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+right');
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_RIGHT}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() - 1);
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke right');
- inp.val('').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_UP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() - 7);
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+up');
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_UP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() + 7);
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke up');
- inp.val('').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() + 7);
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+down');
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() - 7);
- equalsDate(inp.datepicker('getDate'), date, 'Keystroke down');
- // Moving by month or year
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 1 - 1, 4),
- 'Keystroke pgup');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 3 - 1, 4),
- 'Keystroke pgdn');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2007, 2 - 1, 4),
- 'Keystroke ctrl+pgup');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2009, 2 - 1, 4),
- 'Keystroke ctrl+pgdn');
- // Check for moving to short months
- inp.val('03/31/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 29),
- 'Keystroke pgup - Feb');
- inp.val('01/30/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 29),
- 'Keystroke pgdn - Feb');
- inp.val('02/29/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2007, 2 - 1, 28),
- 'Keystroke ctrl+pgup - Feb');
- inp.val('02/29/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2009, 2 - 1, 28),
- 'Keystroke ctrl+pgdn - Feb');
- // Goto current
- inp.datepicker('change', {gotoCurrent: true}).
- datepicker('hide').val('02/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
- 'Keystroke ctrl+home');
- // Change steps
- inp.datepicker('change', {stepMonths: 2, stepBigMonths: 6, gotoCurrent: false}).
- datepicker('hide').val('02/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2007, 12 - 1, 4),
- 'Keystroke pgup step 2');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 4 - 1, 4),
- 'Keystroke pgdn step 2');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2007, 8 - 1, 4),
- 'Keystroke ctrl+pgup step 6');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 8 - 1, 4),
- 'Keystroke ctrl+pgdn step 6');
-});
-
-test('mouse', function() {
- var inp = init('#inp');
- var dp = $('#ui-datepicker-div');
- var date = new Date();
- inp.val('').datepicker('show');
- $('.ui-datepicker tbody a:contains(10)', dp).simulate('click', {});
- date.setDate(10);
- equalsDate(inp.datepicker('getDate'), date, 'Mouse click');
- inp.val('02/04/2008').datepicker('show');
- $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 12),
- 'Mouse click - preset');
- inp.val('02/04/2008').datepicker('show');
- $('.ui-datepicker-clear a', dp).simulate('click', {});
- ok(inp.datepicker('getDate') == null, 'Mouse click - clear');
- inp.val('').datepicker('show');
- $('.ui-datepicker-close a', dp).simulate('click', {});
- ok(inp.datepicker('getDate') == null, 'Mouse click - close');
- inp.val('02/04/2008').datepicker('show');
- $('.ui-datepicker-close a', dp).simulate('click', {});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
- 'Mouse click - close + preset');
- inp.val('02/04/2008').datepicker('show');
- $('.ui-datepicker-prev a', dp).simulate('click', {});
- $('.ui-datepicker-close a', dp).simulate('click', {});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4),
- 'Mouse click - abandoned');
- // Current/previous/next
- inp.val('02/04/2008').datepicker('show');
- $('.ui-datepicker-current a', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(14)', dp).simulate('click', {});
- date.setDate(14);
- equalsDate(inp.datepicker('getDate'), date, 'Mouse click - current');
- inp.val('02/04/2008').datepicker('show');
- $('.ui-datepicker-prev a', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(16)', dp).simulate('click', {});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 1 - 1, 16),
- 'Mouse click - previous');
- inp.val('02/04/2008').datepicker('show');
- $('.ui-datepicker-next a', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(18)', dp).simulate('click', {});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 3 - 1, 18),
- 'Mouse click - next');
- // Previous/next with minimum/maximum
- inp.datepicker('change', {minDate: new Date(2008, 2 - 1, 2),
- maxDate: new Date(2008, 2 - 1, 26)}).val('02/04/2008').datepicker('show');
- $('.ui-datepicker-prev a', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(16)', dp).simulate('click', {});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 16),
- 'Mouse click - previous + min/max');
- inp.val('02/04/2008').datepicker('show');
- $('.ui-datepicker-next a', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(18)', dp).simulate('click', {});
- equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 18),
- 'Mouse click - next + min/max');
- // Change day of week
- inp.val('02/04/2008').datepicker('show');
- equals($('.ui-datepicker-title-row td:first', dp).text(), 'Su',
- 'Mouse click - initial day of week');
- $('.ui-datepicker-title-row td:last a', dp).simulate('click', {});
- equals($('.ui-datepicker-title-row td:first', dp).text(), 'Sa',
- 'Mouse click - day of week');
- // Highlight week
- inp.datepicker('change', {highlightWeek: true}).
- datepicker('hide').val('02/04/2008').datepicker('show');
- ok(!$('.ui-datepicker tr:eq(2)', dp).is('.ui-datepicker-week-over'),
- 'Mouse over - no week highlight');
- $('.ui-datepicker tr:eq(2) td:first', dp).simulate('mouseover', {});
- ok($('.ui-datepicker tr:eq(2)', dp).is('.ui-datepicker-week-over'),
- 'Mouse over - week highlight');
- // Inline
- var inl = init('#inl');
- var dp = $('.ui-datepicker-inline', inl);
- var date = new Date();
- inl.datepicker('setDate', date);
- $('.ui-datepicker tbody a:contains(10)', dp).simulate('click', {});
- date.setDate(10);
- equalsDate(inl.datepicker('getDate'), date, 'Mouse click inline');
- inl.datepicker('setDate', new Date(2008, 2 - 1, 4));
- $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {});
- equalsDate(inl.datepicker('getDate'), new Date(2008, 2 - 1, 12),
- 'Mouse click inline - preset');
- $('.ui-datepicker-current a', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(14)', dp).simulate('click', {});
- date.setDate(14);
- equalsDate(inl.datepicker('getDate'), date, 'Mouse click inline - current');
- inl.datepicker('setDate', new Date(2008, 2 - 1, 4));
- $('.ui-datepicker-prev a', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(16)', dp).simulate('click', {});
- equalsDate(inl.datepicker('getDate'), new Date(2008, 1 - 1, 16),
- 'Mouse click inline - previous');
- inl.datepicker('setDate', new Date(2008, 2 - 1, 4));
- $('.ui-datepicker-next a', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(18)', dp).simulate('click', {});
- equalsDate(inl.datepicker('getDate'), new Date(2008, 3 - 1, 18),
- 'Mouse click inline - next');
-});
-
-test('defaultDate', function() {
- var inp = init('#inp');
- var date = new Date();
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), date, 'Default date null');
- // numeric values
- inp.datepicker('change', {defaultDate: -2}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() - 2);
- equalsDate(inp.datepicker('getDate'), date, 'Default date -2');
- inp.datepicker('change', {defaultDate: 3}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() + 5);
- equalsDate(inp.datepicker('getDate'), date, 'Default date 3');
- inp.datepicker('change', {defaultDate: 1 / 0}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() - 3);
- equalsDate(inp.datepicker('getDate'), date, 'Default date Infinity');
- inp.datepicker('change', {defaultDate: 1 / 'a'}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), date, 'Default date NaN');
- // string values
- inp.datepicker('change', {defaultDate: '-1d'}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() - 1);
- equalsDate(inp.datepicker('getDate'), date, 'Default date -1d');
- inp.datepicker('change', {defaultDate: '+3D'}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() + 4);
- equalsDate(inp.datepicker('getDate'), date, 'Default date +3D');
- inp.datepicker('change', {defaultDate: ' -2 w '}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date = new Date();
- date.setDate(date.getDate() - 14);
- equalsDate(inp.datepicker('getDate'), date, 'Default date -2 w');
- inp.datepicker('change', {defaultDate: '+1 W'}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() + 21);
- equalsDate(inp.datepicker('getDate'), date, 'Default date +1 W');
- inp.datepicker('change', {defaultDate: ' -1 m '}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date = new Date();
- date.setMonth(date.getMonth() - 1);
- equalsDate(inp.datepicker('getDate'), date, 'Default date -1 m');
- inp.datepicker('change', {defaultDate: '+2M'}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setMonth(date.getMonth() + 3);
- equalsDate(inp.datepicker('getDate'), date, 'Default date +2M');
- inp.datepicker('change', {defaultDate: '-2y'}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date = new Date();
- date.setFullYear(date.getFullYear() - 2);
- equalsDate(inp.datepicker('getDate'), date, 'Default date -2y');
- inp.datepicker('change', {defaultDate: '+1 Y '}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setFullYear(date.getFullYear() + 3);
- equalsDate(inp.datepicker('getDate'), date, 'Default date +1 Y');
- inp.datepicker('change', {defaultDate: '+1M +10d'}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date = new Date();
- date.setMonth(date.getMonth() + 1);
- date.setDate(date.getDate() + 10);
- equalsDate(inp.datepicker('getDate'), date, 'Default date +1M +10d');
- date = new Date(2007, 1 - 1, 26);
- inp.datepicker('change', {defaultDate: date}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), date, 'Default date 01/26/2007');
-});
-
-test('miscellaneous', function() {
- var dp = $('#ui-datepicker-div');
- var inp = init('#inp');
- // Year range
- inp.val('02/04/2008').datepicker('show');
- equals(dp.find('.ui-datepicker-new-year').text(),
- '199819992000200120022003200420052006200720082009201020112012201320142015201620172018',
- 'Year range - default');
- inp.datepicker('hide').datepicker('change', {yearRange: '-6:+2'}).datepicker('show');
- equals(dp.find('.ui-datepicker-new-year').text(),
- '200220032004200520062007200820092010', 'Year range - -6:+2');
- inp.datepicker('hide').datepicker('change', {yearRange: '2000:2010'}).datepicker('show');
- equals(dp.find('.ui-datepicker-new-year').text(),
- '20002001200220032004200520062007200820092010', 'Year range - 2000:2010');
- // Navigation as date format
- equals(dp.find('.ui-datepicker-prev').text(),
- '<Prev', 'Navigation prev - default');
- equals(dp.find('.ui-datepicker-current').text(),
- 'Today', 'Navigation current - default');
- equals(dp.find('.ui-datepicker-next').text(),
- 'Next>', 'Navigation next - default');
- inp.datepicker('hide').datepicker('change', {navigationAsDateFormat: true,
- prevText: '< M', currentText: 'MM', nextText: 'M >'}).
- val('02/04/2008').datepicker('show');
- var longNames = $.datepicker.regional[''].monthNames;
- var shortNames = $.datepicker.regional[''].monthNamesShort;
- var date = new Date();
- equals(dp.find('.ui-datepicker-prev').text(),
- '< ' + shortNames[0], 'Navigation prev - as date format');
- equals(dp.find('.ui-datepicker-current').text(),
- longNames[date.getMonth()], 'Navigation current - as date format');
- equals(dp.find('.ui-datepicker-next').text(),
- shortNames[2] + ' >', 'Navigation next - as date format');
- inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN});
- equals(dp.find('.ui-datepicker-prev').text(),
- '< ' + shortNames[1], 'Navigation prev - as date format + pgdn');
- equals(dp.find('.ui-datepicker-current').text(),
- longNames[date.getMonth()], 'Navigation current - as date format + pgdn');
- equals(dp.find('.ui-datepicker-next').text(),
- shortNames[3] + ' >', 'Navigation next - as date format + pgdn');
- inp.datepicker('hide').datepicker('change', {gotoCurrent: true}).
- val('02/04/2008').datepicker('show');
- equals(dp.find('.ui-datepicker-prev').text(),
- '< ' + shortNames[0], 'Navigation prev - as date format + goto current');
- equals(dp.find('.ui-datepicker-current').text(),
- longNames[1], 'Navigation current - as date format + goto current');
- equals(dp.find('.ui-datepicker-next').text(),
- shortNames[2] + ' >', 'Navigation next - as date format + goto current');
-});
-
-test('minMax', function() {
- var inp = init('#inp');
- var lastYear = new Date(2007, 6 - 1, 4);
- var nextYear = new Date(2009, 6 - 1, 4);
- var minDate = new Date(2008, 2 - 1, 29);
- var maxDate = new Date(2008, 12 - 1, 7);
- inp.val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), lastYear,
- 'Min/max - null, null - ctrl+pgup');
- inp.val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), nextYear,
- 'Min/max - null, null - ctrl+pgdn');
- inp.datepicker('change', {minDate: minDate}).
- datepicker('hide').val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), minDate,
- 'Min/max - 02/29/2008, null - ctrl+pgup');
- inp.val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), nextYear,
- 'Min/max - 02/29/2008, null - ctrl+pgdn');
- inp.datepicker('change', {maxDate: maxDate}).
- datepicker('hide').val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), minDate,
- 'Min/max - 02/29/2008, 12/07/2008 - ctrl+pgup');
- inp.val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), maxDate,
- 'Min/max - 02/29/2008, 12/07/2008 - ctrl+pgdn');
- inp.datepicker('change', {minDate: null}).
- datepicker('hide').val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), lastYear,
- 'Min/max - null, 12/07/2008 - ctrl+pgup');
- inp.val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), maxDate,
- 'Min/max - null, 12/07/2008 - ctrl+pgdn');
- // Relative dates
- var date = new Date();
- date.setDate(date.getDate() - 7);
- inp.datepicker('change', {minDate: '-1w', maxDate: '+1 M +10 D '}).
- datepicker('hide').val('').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), date,
- 'Min/max - -1w, +1 M +10 D - ctrl+pgup');
- date = new Date();
- date.setMonth(date.getMonth() + 1);
- date.setDate(date.getDate() + 10);
- inp.val('').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDate(inp.datepicker('getDate'), date,
- 'Min/max - -1w, +1 M +10 D - ctrl+pgdn');
-});
-
-test('setDate', function() {
- var inp = init('#inp');
- var date1 = new Date(2008, 6 - 1, 4);
- var date2 = new Date();
- ok(inp.datepicker('getDate') == null, 'Set date - default');
- inp.datepicker('setDate', date1);
- equalsDate(inp.datepicker('getDate'), date1, 'Set date - 2008-06-04');
- date1 = new Date();
- date1.setDate(date1.getDate() + 7);
- inp.datepicker('setDate', +7);
- equalsDate(inp.datepicker('getDate'), date1, 'Set date - +7');
- date2.setFullYear(date2.getFullYear() + 2);
- inp.datepicker('setDate', '+2y');
- equalsDate(inp.datepicker('getDate'), date2, 'Set date - +2y');
- inp.datepicker('setDate', date1, date2);
- equalsDate(inp.datepicker('getDate'), date1, 'Set date - two dates');
- inp.datepicker('setDate');
- ok(inp.datepicker('getDate') == null, 'Set date - null');
- // Ranges
- date1 = new Date(2008, 6 - 1, 4);
- date2 = new Date(2009, 7 - 1, 5);
- inp.datepicker('change', {rangeSelect: true});
- inp.datepicker('setDate', date1, date2);
- equalsDateArray(inp.datepicker('getDate'), [date1, date2],
- 'Set date range - 2008-06-04 - 2009-07-05');
- inp.datepicker('setDate', date1);
- equalsDateArray(inp.datepicker('getDate'), [date1, date1],
- 'Set date range - 2008-06-04');
- date1 = new Date();
- date1.setDate(date1.getDate() - 10);
- date2 = new Date();
- date2.setDate(date2.getDate() + 10);
- inp.datepicker('setDate', -10, +10);
- equalsDateArray(inp.datepicker('getDate'), [date1, date2],
- 'Set date range - -10 - +10');
- inp.datepicker('setDate', -10);
- equalsDateArray(inp.datepicker('getDate'), [date1, date1],
- 'Set date range - -10');
- date1 = new Date();
- date1.setDate(date1.getDate() - 14);
- date2 = new Date();
- date2.setFullYear(date2.getFullYear() + 1);
- inp.datepicker('setDate', '-2w', '+1Y');
- equalsDateArray(inp.datepicker('getDate'), [date1, date2],
- 'Set date range - -2w - +1Y');
- inp.datepicker('setDate', '-2w');
- equalsDateArray(inp.datepicker('getDate'), [date1, date1],
- 'Set date range - -2w');
- inp.datepicker('setDate');
- isObj(inp.datepicker('getDate'), [null, null], 'Set date range - null');
- // Inline
- var inl = init('#inl');
- date1 = new Date(2008, 6 - 1, 4);
- date2 = new Date();
- equalsDate(inl.datepicker('getDate'), date2, 'Set date inline - default');
- inl.datepicker('setDate', date1);
- equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - 2008-06-04');
- date1 = new Date();
- date1.setDate(date1.getDate() + 7);
- inl.datepicker('setDate', +7);
- equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - +7');
- date2.setFullYear(date2.getFullYear() + 2);
- inl.datepicker('setDate', '+2y');
- equalsDate(inl.datepicker('getDate'), date2, 'Set date inline - +2y');
- inl.datepicker('setDate', date1, date2);
- equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - two dates');
- inl.datepicker('setDate');
- ok(inl.datepicker('getDate') == null, 'Set date inline - null');
- // Alternate field
- var alt = $('#alt');
- inp.datepicker('change', {altField: '#alt', altFormat: 'yy-mm-dd'});
- date1 = new Date(2008, 6 - 1, 4);
- date2 = new Date(2009, 7 - 1, 5);
- inp.datepicker('setDate', date1, date2);
- equals(inp.val(), '06/04/2008 - 07/05/2009',
- 'Set date alternate - 06/04/2008 - 07/05/2009');
- equals(alt.val(), '2008-06-04 - 2009-07-05',
- 'Set date alternate - 2008-06-04 - 2009-07-05');
- inp.datepicker('change', {rangeSelect: false}).datepicker('setDate', date1);
- equals(inp.val(), '06/04/2008', 'Set date alternate - 06/04/2008');
- equals(alt.val(), '2008-06-04', 'Set date alternate - 2008-06-04');
-});
-
-test('ranges', function() {
- var inp = init('#inp', {rangeSelect: true});
- var date1 = new Date();
- var date2 = new Date();
- // Select today - today
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDateArray(inp.datepicker('getDate'), [date1, date1],
- 'Range - enter/enter');
- // Can't select prior to start date
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_UP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDateArray(inp.datepicker('getDate'), [date1, date1],
- 'Range - enter/ctrl+up/enter');
- // Can select after start date
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date2.setDate(date2.getDate() + 7);
- equalsDateArray(inp.datepicker('getDate'), [date1, date2],
- 'Range - enter/ctrl+down/enter');
- equals(inp.val(), $.datepicker.formatDate('mm/dd/yy', date1) + ' - ' +
- $.datepicker.formatDate('mm/dd/yy', date2), 'Range - value');
- // Select then cancel defaults to first date
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ESC});
- equalsDateArray(inp.datepicker('getDate'), [date1, date1],
- 'Range - enter/ctrl+down/esc');
- // Separator
- inp.datepicker('change', {rangeSeparator: ' to '}).
- datepicker('hide').val('06/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDateArray(inp.datepicker('getDate'),
- [new Date(2008, 6 - 1, 4), new Date(2008, 6 - 1, 11)],
- 'Range separator - enter/ctrl+down/enter');
- equals(inp.val(), '06/04/2008 to 06/11/2008',
- 'Range separator - value');
- // Callbacks
- inp.datepicker('change', {onSelect: callback, rangeSeparator: ' - '}).
- datepicker('hide').val('06/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(selectedDate, '06/04/2008 - 06/11/2008',
- 'Range onSelect - enter/ctrl+down/enter');
- inp.datepicker('change', {onChangeMonthYear: callback2, onSelect: null}).
- datepicker('hide').val('05/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(selectedDate, '2008/4',
- 'Range onChangeMonthYear - enter/ctrl+down/enter');
- inp.datepicker('change', {onClose: callback, onChangeMonthYear: null}).
- datepicker('hide').val('03/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(selectedDate, '03/04/2008 - 03/11/2008',
- 'Range onClose - enter/ctrl+down/enter');
- // Minimum/maximum
- date1 = new Date(2008, 5 - 1, 20);
- date2 = new Date(2008, 7 - 1, 2);
- inp.datepicker('change', {minDate: date1, maxDate: date2, onClose: null}).
- datepicker('hide').val('06/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGUP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDateArray(inp.datepicker('getDate'), [date1, date2],
- 'Range min/max - pgup/enter/pgdn/pgdn/enter');
- inp.val('06/04/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_UP}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equalsDateArray(inp.datepicker('getDate'),
- [new Date(2008, 5 - 1, 28), new Date(2008, 6 - 1, 11)],
- 'Range min/max - ctrl+up/enter/ctrl+down/ctrl+down/enter');
- // Inline
- var inl = init('#inl', {rangeSelect: true});
- var dp = $('.ui-datepicker-inline', inl);
- date1 = new Date();
- date1.setDate(12);
- date2 = new Date();
- date2.setDate(19);
- $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {});
- equalsDateArray(inl.datepicker('getDate'), [date1, date1],
- 'Range inline - same day');
- $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(10)', dp).simulate('click', {}); // Doesn't select
- equalsDateArray(inl.datepicker('getDate'), [date1, date1],
- 'Range inline - prev');
- $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {}); // Selects
- inl.datepicker('setDate', date1);
- $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {});
- $('.ui-datepicker tbody a:contains(19)', dp).simulate('click', {});
- equalsDateArray(inl.datepicker('getDate'), [date1, date2],
- 'Range inline - next');
-});
-
-test('altField', function() {
- var inp = init('#inp');
- var alt = $('#alt');
- // No alternate field set
- alt.val('');
- inp.val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(inp.val(), '06/04/2008', 'Alt field - dp - enter');
- equals(alt.val(), '', 'Alt field - alt not set');
- // Alternate field set
- alt.val('');
- inp.datepicker('change', {altField: '#alt', altFormat: 'yy-mm-dd'}).
- val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(inp.val(), '06/04/2008', 'Alt field - dp - enter');
- equals(alt.val(), '2008-06-04', 'Alt field - alt - enter');
- // Move from initial date
- alt.val('');
- inp.val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(inp.val(), '07/04/2008', 'Alt field - dp - pgdn');
- equals(alt.val(), '2008-07-04', 'Alt field - alt - pgdn');
- // Alternate field set - closed
- alt.val('');
- inp.val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ESC});
- equals(inp.val(), '06/04/2008', 'Alt field - dp - pgdn/esc');
- equals(alt.val(), '', 'Alt field - alt - pgdn/esc');
- // Clear date and alternate
- alt.val('');
- inp.val('06/04/2008').datepicker('show');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END});
- equals(inp.val(), '', 'Alt field - dp - ctrl+end');
- equals(alt.val(), '', 'Alt field - alt - ctrl+end');
- // Range select no alternate field set
- alt.val('');
- inp.datepicker('change', {rangeSelect: true, altField: '', altFormat: ''}).
- datepicker('hide').val('06/04/2008 - 07/14/2008').datepicker('show');
- inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(inp.val(), '06/04/2008 - 06/04/2008', 'Alt field range - dp - enter');
- equals(alt.val(), '', 'Alt field range - alt not set');
- // Range select no movement
- alt.val('');
- inp.datepicker('change', {altField: '#alt', altFormat: 'yy-mm-dd'}).
- datepicker('hide').val('06/04/2008 - 07/14/2008').datepicker('show');
- inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(inp.val(), '06/04/2008 - 06/04/2008', 'Alt field range - dp - enter');
- equals(alt.val(), '2008-06-04 - 2008-06-04', 'Alt field range - alt - enter');
- // Range select next month
- alt.val('');
- inp.val('06/04/2008 - 07/14/2008').datepicker('show');
- inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(inp.val(), '06/04/2008 - 07/04/2008',
- 'Alt field range - dp - enter/pgdn/enter');
- equals(alt.val(), '2008-06-04 - 2008-07-04',
- 'Alt field range - alt - enter/pgdn/enter');
- // Range select escape
- alt.val('');
- inp.val('06/04/2008 - 07/14/2008').datepicker('show');
- inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {keyCode: $.simulate.VK_ESC});
- equals(inp.val(), '06/04/2008 - 06/04/2008',
- 'Alt field range - dp - enter/pgdn/esc');
- equals(alt.val(), '2008-06-04 - 2008-06-04',
- 'Alt field range - alt - enter/pgdn/esc');
- // Range select clear
- alt.val('');
- inp.val('06/04/2008 - 07/14/2008').datepicker('show');
- inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}).
- simulate('keydown', {keyCode: $.simulate.VK_PGDN}).
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END});
- equals(inp.val(), '', 'Alt field range - dp - enter/pgdn/ctrl+end');
- equals(alt.val(), '', 'Alt field range - alt - enter/pgdn/ctrl+end');
-});
-
-var beforeShowThis = null;
-var beforeShowInput = null;
-var beforeShowInst = null;
-
-function beforeAll(input, inst) {
- beforeShowThis = this;
- beforeShowInput = input;
- beforeShowInst = inst;
- return {currentText: 'Current'};
-}
-
-var beforeShowDayThis = null;
-var beforeShowDayOK = true;
-
-function beforeDay(date) {
- beforeShowDayThis = this;
- beforeShowDayOK &= (date > new Date(2008, 1 - 1, 26) &&
- date < new Date(2008, 3 - 1, 6));
- return [(date.getDate() % 2 == 0), (date.getDate() % 10 == 0 ? 'day10' : ''),
- (date.getDate() % 3 == 0 ? 'Divisble by 3' : '')];
-}
-
-function calcWeek(date) {
- var doy = date.getDate() + 6;
- for (var m = date.getMonth() - 1; m >= 0; m--)
- doy += $.datepicker._getDaysInMonth(date.getFullYear(), m);
- // Simple count from 01/01 starting at week 1
- return Math.floor(doy / 7);
-}
-
-test('callbacks', function() {
- // Before show
- var inp = init('#inp', {beforeShow: beforeAll});
- var inst = $.data(inp[0], 'datepicker');
- equals($.datepicker._get(inst, 'currentText'), 'Today', 'Before show - initial');
- inp.val('02/04/2008').datepicker('show');
- equals($.datepicker._get(inst, 'currentText'), 'Current', 'Before show - changed');
- ok(beforeShowThis.id == inp[0].id, 'Before show - this OK');
- ok(beforeShowInput.id == inp[0].id, 'Before show - input OK');
- isObj(beforeShowInst, inst, 'Before show - inst OK');
- inp.datepicker('hide').datepicker('destroy');
- // Before show day
- inp = init('#inp', {beforeShowDay: beforeDay});
- var dp = $('#ui-datepicker-div');
- inp.val('02/04/2008').datepicker('show');
- ok(beforeShowDayThis.id == inp[0].id, 'Before show day - this OK');
- ok(beforeShowDayOK, 'Before show day - dates OK');
- var day20 = dp.find('.ui-datepicker td:contains("20")');
- var day21 = dp.find('.ui-datepicker td:contains("21")');
- ok(!day20.is('.ui-datepicker-unselectable'), 'Before show day - unselectable 20');
- ok(day21.is('.ui-datepicker-unselectable'), 'Before show day - unselectable 21');
- ok(day20.is('.day10'), 'Before show day - CSS 20');
- ok(!day21.is('.day10'), 'Before show day - CSS 21');
- ok(day20.attr('title') == '', 'Before show day - title 20');
- ok(day21.attr('title') == 'Divisble by 3', 'Before show day - title 21');
- inp.datepicker('hide').datepicker('destroy');
- // Calculate week
- inp = init('#inp', {showWeeks: true, calculateWeek: calcWeek});
- inp.val('02/04/2008').datepicker('show');
- equals($('.ui-datepicker-week-col:first').text(), 4, 'Calculate week');
- equals($('.ui-datepicker-week-col:last').text(), 8, 'Calculate week');
- // Make Tuesday first
- $('.ui-datepicker-title-row a:contains("Tu")', dp).simulate('click', {});
- equals($('.ui-datepicker-week-col:first').text(), 5, 'Calculate week');
- equals($('.ui-datepicker-week-col:last').text(), 9, 'Calculate week');
- inp.datepicker('hide').datepicker('destroy');
-});
-
-var selectedThis = null;
-var selectedDate = null;
-var selectedInst = null;
-
-function callback(date, inst) {
- selectedThis = this;
- selectedDate = date;
- selectedInst = inst;
-}
-
-function callback2(year, month, inst) {
- selectedThis = this;
- selectedDate = year + '/' + month;
- selectedInst = inst;
-}
-
-test('events', function() {
- var inp = init('#inp', {onSelect: callback});
- var date = new Date();
- // onSelect
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(selectedThis, inp[0], 'Callback selected this');
- equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback selected inst');
- equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
- 'Callback selected date');
- inp.val('').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}).
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- date.setDate(date.getDate() + 7);
- equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
- 'Callback selected date - ctrl+down');
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ESC});
- equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
- 'Callback selected date - esc');
- // onChangeMonthYear
- inp.datepicker('change', {onChangeMonthYear: callback2, onSelect: null}).
- val('').datepicker('show');
- var newMonthYear = function(date) {
- return date.getFullYear() + '/' + (date.getMonth() + 1);
- };
- date = new Date();
- date.setDate(1);
- inp.simulate('keydown', {keyCode: $.simulate.VK_PGUP});
- date.setMonth(date.getMonth() - 1);
- equals(selectedThis, inp[0], 'Callback change month/year this');
- equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback change month/year inst');
- equals(selectedDate, newMonthYear(date),
- 'Callback change month/year date - pgup');
- inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN});
- date.setMonth(date.getMonth() + 1);
- equals(selectedDate, newMonthYear(date),
- 'Callback change month/year date - pgdn');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP});
- date.setFullYear(date.getFullYear() - 1);
- equals(selectedDate, newMonthYear(date),
- 'Callback change month/year date - ctrl+pgup');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME});
- date.setFullYear(date.getFullYear() + 1);
- equals(selectedDate, newMonthYear(date),
- 'Callback change month/year date - ctrl+home');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN});
- date.setFullYear(date.getFullYear() + 1);
- equals(selectedDate, newMonthYear(date),
- 'Callback change month/year date - ctrl+pgdn');
- inp.datepicker('setDate', new Date(2007, 1 - 1, 26));
- equals(selectedDate, '2007/1', 'Callback change month/year date - setDate');
- selectedDate = null;
- inp.datepicker('setDate', new Date(2007, 1 - 1, 12));
- ok(selectedDate == null, 'Callback change month/year date - setDate no change');
- // onChangeMonthYear step by 2
- inp.datepicker('change', {stepMonths: 2}).
- datepicker('hide').val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_PGUP});
- date.setMonth(date.getMonth() - 14);
- equals(selectedDate, newMonthYear(date),
- 'Callback change month/year by 2 date - pgup');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP});
- date.setMonth(date.getMonth() - 12);
- equals(selectedDate, newMonthYear(date),
- 'Callback change month/year by 2 date - ctrl+pgup');
- inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN});
- date.setMonth(date.getMonth() + 2);
- equals(selectedDate, newMonthYear(date),
- 'Callback change month/year by 2 date - pgdn');
- inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN});
- date.setMonth(date.getMonth() + 12);
- equals(selectedDate, newMonthYear(date),
- 'Callback change month/year by 2 date - ctrl+pgdn');
- // onClose
- inp.datepicker('change', {onClose: callback, onChangeMonthYear: null, stepMonths: 1}).
- val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ESC});
- equals(selectedThis, inp[0], 'Callback close this');
- equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback close inst');
- equals(selectedDate, '', 'Callback close date - esc');
- inp.val('').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', new Date()),
- 'Callback close date - enter');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {keyCode: $.simulate.VK_ESC});
- equals(selectedDate, '02/04/2008', 'Callback close date - preset');
- inp.val('02/04/2008').datepicker('show').
- simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END});
- equals(selectedDate, '', 'Callback close date - ctrl+end');
-});
-
-function highlight20(date, inst) {
- return (date.getDate() == 20 ? '*** 20 ***' : $.datepicker.dateStatus(date, inst));
-}
-
-test('status', function() {
- var dp = $('#ui-datepicker-div');
- var inp = init('#inp', {showStatus: true, statusForDate: highlight20, showWeeks: true});
- inp.val('').datepicker('show');
- var status = $('.ui-datepicker-status', dp);
- ok(status.length == 1, 'Status - present');
- equals(status.text(), 'Select a date', 'Status - default');
- $('.ui-datepicker-clear a', dp).simulate('mouseover');
- equals(status.text(), 'Erase the current date', 'Status - clear');
- $('.ui-datepicker-close a', dp).simulate('mouseover');
- equals(status.text(), 'Close without change', 'Status - close');
- $('.ui-datepicker-prev a', dp).simulate('mouseover');
- equals(status.text(), 'Show the previous month', 'Status - previous');
- $('.ui-datepicker-current a', dp).simulate('mouseover');
- equals(status.text(), 'Show the current month', 'Status - current');
- $('.ui-datepicker-next a', dp).simulate('mouseover');
- equals(status.text(), 'Show the next month', 'Status - next');
- $('.ui-datepicker-new-month', dp).simulate('mouseover');
- equals(status.text(), 'Show a different month', 'Status - new month');
- $('.ui-datepicker-new-year', dp).simulate('mouseover');
- equals(status.text(), 'Show a different year', 'Status - new year');
- $('.ui-datepicker-title-row td:first', dp).simulate('mouseover');
- equals(status.text(), 'Week of the year', 'Status - week header');
- var day = 0;
- $('.ui-datepicker-title-row a', dp).each(function() {
- $(this).simulate('mouseover');
- equals(status.text(), 'Set ' + $.datepicker.regional[''].dayNames[day] +
- ' as first week day', 'Status - day ' + day);
- day++;
- });
- $('.ui-datepicker-days-row:eq(1) td:first', dp).simulate('mouseover');
- equals(status.text(), 'Week of the year', 'Status - week column');
- day = 0;
- var month = $.datepicker.regional[''].monthNamesShort[new Date().getMonth()];
- $('.ui-datepicker-days-row:eq(1) a', dp).each(function() {
- $(this).simulate('mouseover');
- equals(status.text(), 'Select ' + $.datepicker.regional[''].dayNames[day] +
- ', ' + month + ' ' + $(this).text(), 'Status - dates');
- day++;
- });
- $('.ui-datepicker-days-row a:contains("20")', dp).each(function() {
- $(this).simulate('mouseover');
- equals(status.text(), '*** 20 ***', 'Status - dates');
- });
- inp.datepicker('hide').datepicker('destroy');
-});
-
-test('localisation', function() {
- var inp = init('#inp', $.datepicker.regional['fr']);
- inp.datepicker('change', {dateFormat: 'DD, d MM yy', showStatus: true, showWeeks: true}).
- val('').datepicker('show');
- var dp = $('#ui-datepicker-div');
- var status = $('.ui-datepicker-status', dp);
- equals($('.ui-datepicker-clear', dp).text(), 'Effacer', 'Localisation - clear');
- equals($('.ui-datepicker-close', dp).text(), 'Fermer', 'Localisation - close');
- $('.ui-datepicker-close a', dp).simulate('mouseover');
- equals(status.text(), 'Fermer sans modifier', 'Localisation - status');
- equals($('.ui-datepicker-prev', dp).text(), '<Préc', 'Localisation - previous');
- equals($('.ui-datepicker-current', dp).text(), 'Courant', 'Localisation - current');
- equals($('.ui-datepicker-next', dp).text(), 'Suiv>', 'Localisation - next');
- equals($('.ui-datepicker-current', dp).text(), 'Courant', 'Localisation - current');
- var month = 0;
- $('.ui-datepicker-new-month option', dp).each(function() {
- equals($(this).text(), $.datepicker.regional['fr'].monthNames[month],
- 'Localisation - month ' + month);
- month++;
- });
- equals($('.ui-datepicker-title-row td:first', dp).text(),
- $.datepicker.regional['fr'].weekHeader, 'Localisation - week header');
- var day = 0;
- $('.ui-datepicker-title-row a', dp).each(function() {
- equals($(this).text(), $.datepicker.regional['fr'].dayNamesMin[day],
- 'Localisation - day ' + day);
- day++;
- });
- inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER});
- var date = new Date();
- equals(inp.val(), $.datepicker.regional['fr'].dayNames[date.getDay()] + ', ' +
- date.getDate() + ' ' + $.datepicker.regional['fr'].monthNames[date.getMonth()] +
- ' ' + date.getFullYear(), 'Localisation - formatting');
-});
-
-test('noWeekends', function() {
- for (var i = 1; i <= 31; i++) {
- var date = new Date(2001, 1 - 1, i);
- isSet($.datepicker.noWeekends(date), [(i + 1) % 7 >= 2, ''],
- 'No weekends ' + date);
- }
-});
-
-test('iso8601Week', function() {
- var date = new Date(2000, 12 - 1, 31);
- equals($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date);
- date = new Date(2001, 1 - 1, 1);
- equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
- date = new Date(2001, 1 - 1, 7);
- equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
- date = new Date(2001, 1 - 1, 8);
- equals($.datepicker.iso8601Week(date), 2, 'ISO 8601 week ' + date);
- date = new Date(2003, 12 - 1, 28);
- equals($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date);
- date = new Date(2003, 12 - 1, 29);
- equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
- date = new Date(2004, 1 - 1, 4);
- equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
- date = new Date(2004, 1 - 1, 5);
- equals($.datepicker.iso8601Week(date), 2, 'ISO 8601 week ' + date);
- date = new Date(2009, 12 - 1, 28);
- equals($.datepicker.iso8601Week(date), 53, 'ISO 8601 week ' + date);
- date = new Date(2010, 1 - 1, 3);
- equals($.datepicker.iso8601Week(date), 53, 'ISO 8601 week ' + date);
- date = new Date(2010, 1 - 1, 4);
- equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
- date = new Date(2010, 1 - 1, 10);
- equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date);
-});
-
-test('parseDate', function() {
- init('#inp');
- ok($.datepicker.parseDate('d m y', '') == null, 'Parse date empty');
- equalsDate($.datepicker.parseDate('d m y', '3 2 01'),
- new Date(2001, 2 - 1, 3), 'Parse date d m y');
- equalsDate($.datepicker.parseDate('dd mm yy', '03 02 2001'),
- new Date(2001, 2 - 1, 3), 'Parse date dd mm yy');
- equalsDate($.datepicker.parseDate('d m y', '13 12 01'),
- new Date(2001, 12 - 1, 13), 'Parse date d m y');
- equalsDate($.datepicker.parseDate('dd mm yy', '13 12 2001'),
- new Date(2001, 12 - 1, 13), 'Parse date dd mm yy');
- equalsDate($.datepicker.parseDate('y-o', '2001-34'),
- new Date(2001, 2 - 1, 3), 'Parse date y-o');
- equalsDate($.datepicker.parseDate('yy-oo', '2001-347'),
- new Date(2001, 12 - 1, 13), 'Parse date yy oo');
- equalsDate($.datepicker.parseDate('oo yy', '348 2004'),
- new Date(2004, 12 - 1, 13), 'Parse date oo-yy');
- equalsDate($.datepicker.parseDate('D d M y', 'Sat 3 Feb 01'),
- new Date(2001, 2 - 1, 3), 'Parse date D d M y');
- equalsDate($.datepicker.parseDate('d MM DD yy', '3 February Saturday 2001'),
- new Date(2001, 2 - 1, 3), 'Parse date dd MM DD yy');
- equalsDate($.datepicker.parseDate('DD, MM d, yy', 'Saturday, February 3, 2001'),
- new Date(2001, 2 - 1, 3), 'Parse date DD, MM d, yy');
- equalsDate($.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy',
- 'day 3 of February (\'Saturday\'), 2001'), new Date(2001, 2 - 1, 3),
- 'Parse date \'day\' d \'of\' MM (\'\'DD\'\'), yy');
- equalsDate($.datepicker.parseDate('y-m-d', '01-02-03'),
- new Date(2001, 2 - 1, 3), 'Parse date y-m-d - default cutoff');
- equalsDate($.datepicker.parseDate('y-m-d', '51-02-03'),
- new Date(1951, 2 - 1, 3), 'Parse date y-m-d - default cutoff');
- equalsDate($.datepicker.parseDate('y-m-d', '51-02-03', {shortYearCutoff: 80}),
- new Date(2051, 2 - 1, 3), 'Parse date y-m-d - cutoff 80');
- equalsDate($.datepicker.parseDate('y-m-d', '51-02-03', {shortYearCutoff: '+60'}),
- new Date(2051, 2 - 1, 3), 'Parse date y-m-d - cutoff +60');
- var fr = $.datepicker.regional['fr'];
- var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames,
- monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames};
- equalsDate($.datepicker.parseDate('D d M y', 'Lun 9 Avr 01', settings),
- new Date(2001, 4 - 1, 9), 'Parse date D M y with settings');
- equalsDate($.datepicker.parseDate('d MM DD yy', '9 Avril Lundi 2001', settings),
- new Date(2001, 4 - 1, 9), 'Parse date d MM DD yy with settings');
- equalsDate($.datepicker.parseDate('DD, MM d, yy', 'Lundi, Avril 9, 2001', settings),
- new Date(2001, 4 - 1, 9), 'Parse date DD, MM d, yy with settings');
- equalsDate($.datepicker.parseDate('\'jour\' d \'de\' MM (\'\'DD\'\'), yy',
- 'jour 9 de Avril (\'Lundi\'), 2001', settings), new Date(2001, 4 - 1, 9),
- 'Parse date \'jour\' d \'de\' MM (\'\'DD\'\'), yy with settings');
-});
-
-test('parseDateErrors', function() {
- init('#inp');
- var expectError = function(expr, value, error) {
- try {
- expr();
- ok(false, 'Parsed error ' + value);
- }
- catch (e) {
- equals(e, error, 'Parsed error ' + value);
- }
- };
- expectError(function() { $.datepicker.parseDate(null, 'Sat 2 01'); },
- 'Sat 2 01', 'Invalid arguments');
- expectError(function() { $.datepicker.parseDate('d m y', null); },
- 'null', 'Invalid arguments');
- expectError(function() { $.datepicker.parseDate('d m y', 'Sat 2 01'); },
- 'Sat 2 01 - d m y', 'Missing number at position 0');
- expectError(function() { $.datepicker.parseDate('dd mm yy', 'Sat 2 01'); },
- 'Sat 2 01 - dd mm yy', 'Missing number at position 0');
- expectError(function() { $.datepicker.parseDate('d m y', '3 Feb 01'); },
- '3 Feb 01 - d m y', 'Missing number at position 2');
- expectError(function() { $.datepicker.parseDate('dd mm yy', '3 Feb 01'); },
- '3 Feb 01 - dd mm yy', 'Missing number at position 2');
- expectError(function() { $.datepicker.parseDate('d m y', '3 2 AD01'); },
- '3 2 AD01 - d m y', 'Missing number at position 4');
- expectError(function() { $.datepicker.parseDate('d m yy', '3 2 AD01'); },
- '3 2 AD01 - dd mm yy', 'Missing number at position 4');
- expectError(function() { $.datepicker.parseDate('y-o', '2001-D01'); },
- '2001-D01 - y-o', 'Missing number at position 5');
- expectError(function() { $.datepicker.parseDate('yy-oo', '2001-D01'); },
- '2001-D01 - yy-oo', 'Missing number at position 5');
- expectError(function() { $.datepicker.parseDate('D d M y', 'D7 3 Feb 01'); },
- 'D7 3 Feb 01 - D d M y', 'Unknown name at position 0');
- expectError(function() { $.datepicker.parseDate('D d M y', 'Sat 3 M2 01'); },
- 'Sat 3 M2 01 - D d M y', 'Unknown name at position 6');
- expectError(function() { $.datepicker.parseDate('DD, MM d, yy', 'Saturday- Feb 3, 2001'); },
- 'Saturday- Feb 3, 2001 - DD, MM d, yy', 'Unexpected literal at position 8');
- expectError(function() { $.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy',
- 'day 3 of February ("Saturday"), 2001'); },
- 'day 3 of Mon2 ("Day7"), 2001', 'Unexpected literal at position 19');
- expectError(function() { $.datepicker.parseDate('d m y', '29 2 01'); },
- '29 2 01 - d m y', 'Invalid date');
- var fr = $.datepicker.regional['fr'];
- var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames,
- monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames};
- expectError(function() { $.datepicker.parseDate('D d M y', 'Mon 9 Avr 01', settings); },
- 'Mon 9 Avr 01 - D d M y', 'Unknown name at position 0');
- expectError(function() { $.datepicker.parseDate('D d M y', 'Lun 9 Apr 01', settings); },
- 'Lun 9 Apr 01 - D d M y', 'Unknown name at position 6');
-});
-
-test('formatDate', function() {
- init('#inp');
- equals($.datepicker.formatDate('d m y', new Date(2001, 2 - 1, 3)),
- '3 2 01', 'Format date d m y');
- equals($.datepicker.formatDate('dd mm yy', new Date(2001, 2 - 1, 3)),
- '03 02 2001', 'Format date dd mm yy');
- equals($.datepicker.formatDate('d m y', new Date(2001, 12 - 1, 13)),
- '13 12 01', 'Format date d m y');
- equals($.datepicker.formatDate('dd mm yy', new Date(2001, 12 - 1, 13)),
- '13 12 2001', 'Format date dd mm yy');
- equals($.datepicker.formatDate('yy-o', new Date(2001, 2 - 1, 3)),
- '2001-34', 'Format date yy-o');
- equals($.datepicker.formatDate('yy-oo', new Date(2001, 2 - 1, 3)),
- '2001-034', 'Format date yy-oo');
- equals($.datepicker.formatDate('D M y', new Date(2001, 2 - 1, 3)),
- 'Sat Feb 01', 'Format date D M y');
- equals($.datepicker.formatDate('DD MM yy', new Date(2001, 2 - 1, 3)),
- 'Saturday February 2001', 'Format date DD MM yy');
- equals($.datepicker.formatDate('DD, MM d, yy', new Date(2001, 2 - 1, 3)),
- 'Saturday, February 3, 2001', 'Format date DD, MM d, yy');
- equals($.datepicker.formatDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy',
- new Date(2001, 2 - 1, 3)), 'day 3 of February (\'Saturday\'), 2001',
- 'Format date \'day\' d \'of\' MM (\'\'DD\'\'), yy');
- var fr = $.datepicker.regional['fr'];
- var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames,
- monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames};
- equals($.datepicker.formatDate('D M y', new Date(2001, 4 - 1, 9), settings),
- 'Lun Avr 01', 'Format date D M y with settings');
- equals($.datepicker.formatDate('DD MM yy', new Date(2001, 4 - 1, 9), settings),
- 'Lundi Avril 2001', 'Format date DD MM yy with settings');
- equals($.datepicker.formatDate('DD, MM d, yy', new Date(2001, 4 - 1, 9), settings),
- 'Lundi, Avril 9, 2001', 'Format date DD, MM d, yy with settings');
- equals($.datepicker.formatDate('\'jour\' d \'de\' MM (\'\'DD\'\'), yy',
- new Date(2001, 4 - 1, 9), settings), 'jour 9 de Avril (\'Lundi\'), 2001',
- 'Format date \'jour\' d \'de\' MM (\'\'DD\'\'), yy with settings');
-});
-
-})(jQuery);
+/* + * datepicker unit tests + */ +(function($) { + +module('datepicker'); + +function equalsDate(d1, d2, message) { + if (!d1 || !d2) { + ok(false, message + ' - missing date'); + return; + } + d1 = new Date(d1.getFullYear(), d1.getMonth(), d1.getDate()); + d2 = new Date(d2.getFullYear(), d2.getMonth(), d2.getDate()); + equals(d1.toString(), d2.toString(), message); +} + +function equalsDateArray(a1, a2, message) { + if (!a1 || !a2) { + ok(false, message + ' - missing dates'); + return; + } + a1[0] = (a1[0] ? new Date(a1[0].getFullYear(), a1[0].getMonth(), a1[0].getDate()) : ''); + a1[1] = (a1[1] ? new Date(a1[1].getFullYear(), a1[1].getMonth(), a1[1].getDate()) : ''); + a2[0] = (a2[0] ? new Date(a2[0].getFullYear(), a2[0].getMonth(), a2[0].getDate()) : ''); + a2[1] = (a2[1] ? new Date(a2[1].getFullYear(), a2[1].getMonth(), a2[1].getDate()) : ''); + equals(serialArray(a1), serialArray(a2), message); +} + +function init(id, options) { + $.datepicker.setDefaults($.datepicker.regional['']); + var inp = $(id); + inp.datepicker($.extend({duration: ''}, options || {})); + return inp; +} + +var PROP_NAME = 'datepicker'; + +test('setDefaults', function() { + var inp = init('#inp'); + var dp = $('#ui-datepicker-div'); + ok(!dp.is(':visible'), 'Initially invisible'); + ok(inp.is('.hasDatepicker'), 'Marker class set'); + ok($($.datepicker.dpDiv).html() == '', 'Content empty'); + inp.datepicker('show'); + ok($($.datepicker.dpDiv).html() != '', 'Content present'); + inp.datepicker('hide'); + equals($.datepicker._defaults.showOn, 'focus', 'Initial showOn'); + $.datepicker.setDefaults({showOn: 'button'}); + equals($.datepicker._defaults.showOn, 'button', 'Change default showOn'); + $.datepicker.setDefaults({showOn: 'focus'}); + equals($.datepicker._defaults.showOn, 'focus', 'Restore showOn'); +}); + +test('destroy', function() { + var inp = init('#inp'); + ok(inp.is('.hasDatepicker'), 'Default - marker class set'); + ok($.data(inp[0], PROP_NAME), 'Default - instance present'); + ok(inp.next().is('#alt'), 'Default - button absent'); + inp.datepicker('destroy'); + inp = $('#inp'); + ok(!inp.is('.hasDatepicker'), 'Default - marker class cleared'); + ok(!$.data(inp[0], PROP_NAME), 'Default - instance absent'); + ok(inp.next().is('#alt'), 'Default - button absent'); + // With button + inp= init('#inp', {showOn: 'both'}); + ok(inp.is('.hasDatepicker'), 'Button - marker class set'); + ok($.data(inp[0], PROP_NAME), 'Button - instance present'); + ok(inp.next().text() == '...', 'Button - button added'); + inp.datepicker('destroy'); + inp = $('#inp'); + ok(!inp.is('.hasDatepicker'), 'Button - marker class cleared'); + ok(!$.data(inp[0], PROP_NAME), 'Button - instance absent'); + ok(inp.next().is('#alt'), 'Button - button removed'); + // With append text + inp = init('#inp', {appendText: 'Testing'}); + ok(inp.is('.hasDatepicker'), 'Append - marker class set'); + ok($.data(inp[0], PROP_NAME), 'Append - instance present'); + ok(inp.next().text() == 'Testing', 'Append - append text added'); + inp.datepicker('destroy'); + inp = $('#inp'); + ok(!inp.is('.hasDatepicker'), 'Append - marker class cleared'); + ok(!$.data(inp[0], PROP_NAME), 'Append - instance absent'); + ok(inp.next().is('#alt'), 'Append - append text removed'); + // With both + inp= init('#inp', {showOn: 'both', buttonImageOnly: true, + buttonImage: 'img/calendar.gif', appendText: 'Testing'}); + ok(inp.is('.hasDatepicker'), 'Both - marker class set'); + ok($.data(inp[0], PROP_NAME), 'Both - instance present'); + ok(inp.next()[0].nodeName.toLowerCase() == 'img', 'Both - button added'); + ok(inp.next().next().text() == 'Testing', 'Both - append text added'); + inp.datepicker('destroy'); + inp = $('#inp'); + ok(!inp.is('.hasDatepicker'), 'Both - marker class cleared'); + ok(!$.data(inp[0], PROP_NAME), 'Both - instance absent'); + ok(inp.next().is('#alt'), 'Both - button and append text absent'); + // Inline + var inl = init('#inl'); + ok(inl.is('.hasDatepicker'), 'Inline - marker class set'); + ok(inl.html() != '', 'Inline - datepicker present'); + ok($.data(inl[0], PROP_NAME), 'Inline - instance present'); + ok(inl.next().length == 0 || inl.next().is('p'), 'Inline - button absent'); + inl.datepicker('destroy'); + inl = $('#inl'); + ok(!inl.is('.hasDatepicker'), 'Inline - marker class cleared'); + ok(inl.html() == '', 'Inline - datepicker absent'); + ok(!$.data(inl[0], PROP_NAME), 'Inline - instance absent'); + ok(inl.next().length == 0 || inl.next().is('p'), 'Inline - button absent'); +}); + +test('change', function() { + var inp = init('#inp'); + var inst = $.data(inp[0], PROP_NAME); + equals(inst.settings.showOn, null, 'Initial setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'focus', 'Initial instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Initial default showOn'); + inp.datepicker('change', 'showOn', 'button'); + equals(inst.settings.showOn, 'button', 'Change setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'button', 'Change instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); + inp.datepicker('change', {showOn: 'both'}); + equals(inst.settings.showOn, 'both', 'Change setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'both', 'Change instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); + inp.datepicker('change', 'showOn', undefined); + equals(inst.settings.showOn, null, 'Clear setting showOn'); + equals($.datepicker._get(inst, 'showOn'), 'focus', 'Restore instance showOn'); + equals($.datepicker._defaults.showOn, 'focus', 'Retain default showOn'); +}); + +test('invocation', function() { + var inp = init('#inp'); + var dp = $('#ui-datepicker-div'); + var body = $('body'); + // On focus + var button = inp.siblings('button'); + ok(button.length == 0, 'Focus - button absent'); + var image = inp.siblings('img'); + ok(image.length == 0, 'Focus - image absent'); + inp.focus(); + ok(dp.is(':visible'), 'Focus - rendered on focus'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ESC}); + ok(!dp.is(':visible'), 'Focus - hidden on exit'); + inp.focus(); + ok(dp.is(':visible'), 'Focus - rendered on focus'); + body.simulate('mousedown', {}); + ok(!dp.is(':visible'), 'Focus - hidden on external click'); + inp.datepicker('hide').datepicker('destroy'); + // On button + inp = init('#inp', {showOn: 'button', buttonText: 'Popup'}); + ok(!dp.is(':visible'), 'Button - initially hidden'); + button = inp.siblings('button'); + image = inp.siblings('img'); + ok(button.length == 1, 'Button - button present'); + ok(image.length == 0, 'Button - image absent'); + equals(button.text(), 'Popup', 'Button - button text'); + inp.focus(); + ok(!dp.is(':visible'), 'Button - not rendered on focus'); + button.click(); + ok(dp.is(':visible'), 'Button - rendered on button click'); + button.click(); + ok(!dp.is(':visible'), 'Button - hidden on second button click'); + inp.datepicker('hide').datepicker('destroy'); + // On image button + inp = init('#inp', {showOn: 'button', buttonImageOnly: true, + buttonImage: 'img/calendar.gif', buttonText: 'Cal'}); + ok(!dp.is(':visible'), 'Image button - initially hidden'); + button = inp.siblings('button'); + ok(button.length == 0, 'Image button - button absent'); + image = inp.siblings('img'); + ok(image.length == 1, 'Image button - image present'); + equals(image.attr('src'), 'img/calendar.gif', 'Image button - image source'); + equals(image.attr('title'), 'Cal', 'Image button - image text'); + inp.focus(); + ok(!dp.is(':visible'), 'Image button - not rendered on focus'); + image.click(); + ok(dp.is(':visible'), 'Image button - rendered on image click'); + image.click(); + ok(!dp.is(':visible'), 'Image button - hidden on second image click'); + inp.datepicker('hide').datepicker('destroy'); + // On both + inp = init('#inp', {showOn: 'both', buttonImage: 'img/calendar.gif'}); + ok(!dp.is(':visible'), 'Both - initially hidden'); + button = inp.siblings('button'); + ok(button.length == 1, 'Both - button present'); + image = inp.siblings('img'); + ok(image.length == 0, 'Both - image absent'); + image = button.children('img'); + ok(image.length == 1, 'Both - button image present'); + inp.focus(); + ok(dp.is(':visible'), 'Both - rendered on focus'); + body.simulate('mousedown', {}); + ok(!dp.is(':visible'), 'Both - hidden on external click'); + button.click(); + ok(dp.is(':visible'), 'Both - rendered on button click'); + button.click(); + ok(!dp.is(':visible'), 'Both - hidden on second button click'); + inp.datepicker('hide').datepicker('destroy'); +}); + +test('baseStructure', function() { + var dp = $('#ui-datepicker-div'); + var inp = init('#inp'); + inp.focus(); + var iframe = ($.browser.msie && parseInt($.browser.version) < 7); + ok(dp.is(':visible'), 'Structure - datepicker visible'); + ok(!dp.is('.ui-datepicker-rtl'), 'Structure - not right-to-left'); + ok(!dp.is('.ui-datepicker-multi'), 'Structure - not multi-month'); + equals(dp.children().length, 4 + (iframe ? 1 : 0), 'Structure - child count'); + var control = dp.children(':first'); + ok(control.is('div.ui-datepicker-control'), 'Structure - control division'); + equals(control.children().length, 2, 'Structure - control child count'); + ok(control.children(':first').is('div.ui-datepicker-clear'), + 'Structure - clear division'); + ok(control.children(':last').is('div.ui-datepicker-close'), + 'Structure - close division'); + var links = dp.children(':eq(1)'); + ok(links.is('div.ui-datepicker-links'), 'Structure - links division'); + equals(links.children().length, 3, 'Structure - links child count'); + ok(links.children(':first').is('div.ui-datepicker-prev') && + links.children(':first').html() != '', + 'Structure - prev division'); + ok(links.children(':eq(1)').is('div.ui-datepicker-current') && + links.children(':eq(1)').html() != '', + 'Structure - current division'); + ok(links.children(':last').is('div.ui-datepicker-next') && + links.children(':last').html() != '', + 'Structure - next division'); + var month = dp.children(':eq(2)'); + ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'), + 'Structure - month division'); + var header = month.children(':first'); + ok(header.is('div.ui-datepicker-header'), 'Structure - month header division'); + equals(header.children().length, 2, 'Structure - month header child count'); + ok(header.children(':first').is('select.ui-datepicker-new-month'), + 'Structure - new month select'); + ok(header.children(':last').is('select.ui-datepicker-new-year'), + 'Structure - new year select'); + var table = month.children(':eq(1)'); + ok(table.is('table.ui-datepicker'), 'Structure - month table'); + ok(table.children(':first').is('thead'), 'Structure - month table thead'); + var titles = table.children(':first').children(':first'); + ok(titles.is('tr.ui-datepicker-title-row'), 'Structure - month table title row'); + equals(titles.find('a').length, 7, 'Structure - month table title links'); + ok(table.children(':eq(1)').is('tbody'), 'Structure - month table body'); + ok(table.children(':eq(1)').children('tr').length >= 4, + 'Structure - month table week count'); + var week = table.children(':eq(1)').children(':first'); + ok(week.is('tr.ui-datepicker-days-row'), 'Structure - month table week row'); + equals(week.children().length, 7, 'Structure - week child count'); + ok(week.children(':first').is('td.ui-datepicker-days-cell') && + week.children(':first').is('.ui-datepicker-week-end-cell') && + !week.children(':first').is('.ui-datepicker-week-col'), + 'Structure - month table first day cell'); + ok(week.children(':eq(1)').is('td.ui-datepicker-days-cell') && + !week.children(':eq(1)').is('.ui-datepicker-week-end-cell'), + 'Structure - month table second day cell'); + ok(dp.children('.ui-datepicker-status').length == 0, 'Structure - status'); + ok(dp.children('iframe').length == (iframe ? 1 : 0), 'Structure - iframe'); + inp.datepicker('hide').datepicker('destroy'); + // Multi-month 2 + inp = init('#inp', {numberOfMonths: 2}); + inp.focus(); + ok(dp.is('.ui-datepicker-multi'), 'Structure multi - multi-month'); + equals(dp.children().length, 5 + (iframe ? 1 : 0), 'Structure multi - child count'); + month = dp.children(':eq(2)'); + ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'), + 'Structure multi - first month division'); + month = dp.children(':eq(3)'); + ok(month.is('div.ui-datepicker-one-month') && !month.is('div.ui-datepicker-new-row'), + 'Structure multi - second month division'); + inp.datepicker('hide').datepicker('destroy'); + // Multi-month [2, 2] + inp = init('#inp', {numberOfMonths: [2, 2]}); + inp.focus(); + ok(dp.is('.ui-datepicker-multi'), 'Structure multi - multi-month'); + equals(dp.children().length, 7 + (iframe ? 1 : 0), 'Structure multi - child count'); + month = dp.children(':eq(2)'); + ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'), + 'Structure multi - first month division'); + month = dp.children(':eq(3)'); + ok(month.is('div.ui-datepicker-one-month') && !month.is('div.ui-datepicker-new-row'), + 'Structure multi - second month division'); + month = dp.children(':eq(4)'); + ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'), + 'Structure multi - third month division'); + month = dp.children(':eq(5)'); + ok(month.is('div.ui-datepicker-one-month') && !month.is('div.ui-datepicker-new-row'), + 'Structure multi - fourth month division'); + inp.datepicker('hide').datepicker('destroy'); + // Inline + var inl = init('#inl'); + dp = inl.children(); + ok(dp.is('.ui-datepicker-inline'), 'Structure inline - main div'); + ok(!dp.is('.ui-datepicker-rtl'), 'Structure inline - not right-to-left'); + ok(!dp.is('.ui-datepicker-multi'), 'Structure inline - not multi-month'); + equals(dp.children().length, 3, 'Structure inline - child count'); + var links = dp.children(':first'); + ok(links.is('div.ui-datepicker-links'), 'Structure inline - links division'); + equals(links.children().length, 3, 'Structure inline - links child count'); + var month = dp.children(':eq(1)'); + ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'), + 'Structure inline - month division'); + var header = month.children(':first'); + ok(header.is('div.ui-datepicker-header'), 'Structure inline - month header division'); + equals(header.children().length, 2, 'Structure inline - month header child count'); + var table = month.children(':eq(1)'); + ok(table.is('table.ui-datepicker'), 'Structure inline - month table'); + ok(table.children(':first').is('thead'), 'Structure inline - month table thead'); + ok(table.children(':eq(1)').is('tbody'), 'Structure inline - month table body'); + ok(dp.children('.ui-datepicker-status').length == 0, 'Structure inline - status'); + inl.datepicker('destroy'); + // Inline multi-month + inl = init('#inl', {numberOfMonths: 2}); + dp = inl.children(); + ok(dp.is('.ui-datepicker-inline'), 'Structure inline multi - main div'); + ok(dp.is('.ui-datepicker-multi'), 'Structure inline multi - not multi-month'); + equals(dp.children().length, 4, 'Structure inline multi - child count'); + var links = dp.children(':first'); + ok(links.is('div.ui-datepicker-links'), 'Structure inline multi - links division'); + equals(links.children().length, 3, 'Structure inline multi - links child count'); + var month = dp.children(':eq(1)'); + ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'), + 'Structure inline multi - first month division'); + month = dp.children(':eq(2)'); + ok(month.is('div.ui-datepicker-one-month') && !month.is('div.ui-datepicker-new-row'), + 'Structure inline multi - second month division'); + inl.datepicker('destroy'); +}); + +test('customStructure', function() { + var dp = $('#ui-datepicker-div'); + // Check right-to-left localisation + var inp = init('#inp', $.datepicker.regional['he']); + inp.focus(); + var iframe = ($.browser.msie && parseInt($.browser.version) < 7); + ok(dp.is('.ui-datepicker-rtl'), 'Structure RTL - right-to-left'); + var links = dp.children(':eq(1)'); + ok(links.is('div.ui-datepicker-links'), 'Structure - links division'); + equals(links.children().length, 3, 'Structure - links child count'); + ok(links.children(':first').is('div.ui-datepicker-next'), + 'Structure - next division'); + ok(links.children(':eq(1)').is('div.ui-datepicker-current'), + 'Structure - current division'); + ok(links.children(':last').is('div.ui-datepicker-prev'), + 'Structure - prev division'); + inp.datepicker('hide').datepicker('destroy'); + // Close at bottom + inp = init('#inp', {closeAtTop: false}); + inp.focus(); + equals(dp.children().length, 4 + (iframe ? 1 : 0), + 'Structure close at bottom - child count'); + ok(dp.children(':first').is('div.ui-datepicker-links'), + 'Structure close at bottom - links division'); + ok(dp.children(':last').prev().is('div.ui-datepicker-control'), + 'Structure close at bottom - control division'); + inp.datepicker('hide').datepicker('destroy'); + // Mandatory + inp = init('#inp', {mandatory: true}); + inp.focus(); + var control = dp.children(':first'); + ok(control.is('div.ui-datepicker-control'), + 'Structure mandatory - control division'); + equals(control.children().length, 1, 'Structure mandatory - control child count'); + ok(control.children(':first').is('div.ui-datepicker-close'), + 'Structure mandatory - close division'); + inp.datepicker('hide').datepicker('destroy'); + // Hide prev/next + inp = init('#inp', {hideIfNoPrevNext: true, + minDate: new Date(2008, 2 - 1, 4), maxDate: new Date(2008, 2 - 1, 14)}); + inp.val('02/10/2008').focus(); + var links = dp.children(':eq(1)'); + ok(links.is('div.ui-datepicker-links'), + 'Structure hide prev/next - links division'); + equals(links.children().length, 2, 'Structure hide prev/next - links child count'); + ok(links.children(':first').is('div.ui-datepicker-prev') && + links.children(':first').html() == '', + 'Structure hide prev/next - prev division'); + ok(links.children(':last').is('div.ui-datepicker-next') && + links.children(':last').html() == '', + 'Structure hide prev/next - next division'); + inp.datepicker('hide').datepicker('destroy'); + // Can't change month + inp = init('#inp', {changeMonth: false}); + inp.focus(); + var header = dp.children(':eq(2)').children(':first'); + equals(header.children().length, 1, 'Structure change month - header child count'); + ok(header.children(':last').is('select.ui-datepicker-new-year'), + 'Structure change month - new year select'); + inp.datepicker('hide').datepicker('destroy'); + // Can't change year + inp = init('#inp', {changeYear: false}); + inp.focus(); + var header = dp.children(':eq(2)').children(':first'); + equals(header.children().length, 1, 'Structure change year - header child count'); + ok(header.children(':first').is('select.ui-datepicker-new-month'), + 'Structure change year - new month select'); + inp.datepicker('hide').datepicker('destroy'); + // Can't change first day of week + inp = init('#inp', {changeFirstDay: false}); + inp.focus(); + var titles = dp.find('.ui-datepicker-title-row'); + equals(titles.children().length, 7, 'Structure change first day - titles child count'); + equals(titles.find('a').length, 0, 'Structure change first day - titles links count'); + inp.datepicker('hide').datepicker('destroy'); + // Show weeks + inp = init('#inp', {showWeeks: true}); + inp.focus(); + titles = dp.find('.ui-datepicker-title-row'); + equals(titles.children().length, 8, 'Structure show weeks - titles child count'); + var week = dp.find('.ui-datepicker-days-row:first'); + equals(week.children().length, 8, 'Structure show weeks - week child count'); + ok(week.children(':first').is('td.ui-datepicker-week-col'), + 'Structure show weeks - week column'); + inp.datepicker('hide').datepicker('destroy'); + // Show status + inp = init('#inp', {showStatus: true}); + inp.focus(); + equals(dp.children().length, 6 + (iframe ? 1 : 0), + 'Structure show status - datepicker child count'); + ok(dp.children(':last').prev().is('div.ui-datepicker-status'), + 'Structure show status - status division'); + inp.datepicker('hide').datepicker('destroy'); + // Inline + var inl = init('#inl', {showStatus: true, hideIfNoPrevNext: true, + minDate: new Date(2008, 2 - 1, 4), maxDate: new Date(2008, 2 - 1, 14)}); + dp = inl.children(); + ok(dp.is('.ui-datepicker-inline'), 'Structure inline - main div'); + ok(!dp.is('.ui-datepicker-rtl'), 'Structure inline - not right-to-left'); + ok(!dp.is('.ui-datepicker-multi'), 'Structure inline - not multi-month'); + equals(dp.children().length, 5, 'Structure inline - child count'); + var links = dp.children(':first'); + ok(links.is('div.ui-datepicker-links'), 'Structure inline - links division'); + equals(links.children().children().length, 0, 'Structure inline - links child count'); + var month = dp.children(':eq(1)'); + ok(month.is('div.ui-datepicker-one-month') && month.is('div.ui-datepicker-new-row'), + 'Structure inline - month division'); + ok(dp.children(':last').prev().is('div.ui-datepicker-status'), + 'Structure inline - status'); + inl.datepicker('destroy'); +}); + +test('enableDisable', function() { + var inp = init('#inp'); + ok(!inp.datepicker('isDisabled'), 'Enable/disable - initially marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable - field initially enabled'); + inp.datepicker('disable'); + ok(inp.datepicker('isDisabled'), 'Enable/disable - now marked as disabled'); + ok(inp[0].disabled, 'Enable/disable - field now disabled'); + inp.datepicker('enable'); + ok(!inp.datepicker('isDisabled'), 'Enable/disable - now marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable - field now enabled'); + inp.datepicker('destroy'); + // With a button + inp = init('#inp', {showOn: 'button'}); + ok(!inp.datepicker('isDisabled'), 'Enable/disable button - initially marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable button - field initially enabled'); + ok(!inp.next('button')[0].disabled, 'Enable/disable button - button initially enabled'); + inp.datepicker('disable'); + ok(inp.datepicker('isDisabled'), 'Enable/disable button - now marked as disabled'); + ok(inp[0].disabled, 'Enable/disable button - field now disabled'); + ok(inp.next('button')[0].disabled, 'Enable/disable button - button now disabled'); + inp.datepicker('enable'); + ok(!inp.datepicker('isDisabled'), 'Enable/disable button - now marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable button - field now enabled'); + ok(!inp.next('button')[0].disabled, 'Enable/disable button - button now enabled'); + inp.datepicker('destroy'); + // With an image button + inp = init('#inp', {showOn: 'button', buttonImageOnly: true, + buttonImage: 'img/calendar.gif'}); + ok(!inp.datepicker('isDisabled'), 'Enable/disable image - initially marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable image - field initially enabled'); + ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image initially enabled'); + inp.datepicker('disable'); + ok(inp.datepicker('isDisabled'), 'Enable/disable image - now marked as disabled'); + ok(inp[0].disabled, 'Enable/disable image - field now disabled'); + ok(inp.next('img').css('opacity') != 1, 'Enable/disable image - image now disabled'); + inp.datepicker('enable'); + ok(!inp.datepicker('isDisabled'), 'Enable/disable image - now marked as enabled'); + ok(!inp[0].disabled, 'Enable/disable image - field now enabled'); + ok(inp.next('img').css('opacity') == 1, 'Enable/disable image - image now enabled'); + inp.datepicker('destroy'); + // Inline + var inl = init('#inl'); + ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - initially marked as enabled'); + ok($('.ui-datepicker-disabled', inl).length == 0, 'Enable/disable inline - cover initially absent'); + inl.datepicker('disable'); + ok(inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as disabled'); + var disabled = $('.ui-datepicker-disabled', inl); + var dp = $('.ui-datepicker-inline', inl); + ok(disabled.length == 1, 'Enable/disable inline - cover now present'); + ok(disabled.offset().top == dp.offset().top && disabled.offset().left == dp.offset().left, + 'Enable/disable inline - cover positioning'); + ok(disabled.width() == dp.width() && disabled.height() == dp.height(), + 'Enable/disable inline - cover sizing'); + inl.datepicker('enable'); + ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as enabled'); + ok($('.ui-datepicker-disabled', inl).length == 0, 'Enable/disable inline - cover now absent'); + inl.datepicker('destroy'); +}); + +test('keystrokes', function() { + var inp = init('#inp'); + var date = new Date(); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke enter'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Keystroke enter - preset'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+home'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END}); + ok(inp.datepicker('getDate') == null, 'Keystroke ctrl+end'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + ok(inp.datepicker('getDate') == null, 'Keystroke esc'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Keystroke esc - preset'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Keystroke esc - abandoned'); + // Moving by day or week + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_LEFT}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 1); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+left'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_LEFT}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 1); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke left'); + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_RIGHT}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 1); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+right'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_RIGHT}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 1); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke right'); + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_UP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 7); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+up'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_UP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 7); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke up'); + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 7); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke ctrl+down'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 7); + equalsDate(inp.datepicker('getDate'), date, 'Keystroke down'); + // Moving by month or year + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 1 - 1, 4), + 'Keystroke pgup'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 3 - 1, 4), + 'Keystroke pgdn'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2007, 2 - 1, 4), + 'Keystroke ctrl+pgup'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2009, 2 - 1, 4), + 'Keystroke ctrl+pgdn'); + // Check for moving to short months + inp.val('03/31/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 29), + 'Keystroke pgup - Feb'); + inp.val('01/30/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 29), + 'Keystroke pgdn - Feb'); + inp.val('02/29/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2007, 2 - 1, 28), + 'Keystroke ctrl+pgup - Feb'); + inp.val('02/29/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2009, 2 - 1, 28), + 'Keystroke ctrl+pgdn - Feb'); + // Goto current + inp.datepicker('change', {gotoCurrent: true}). + datepicker('hide').val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Keystroke ctrl+home'); + // Change steps + inp.datepicker('change', {stepMonths: 2, stepBigMonths: 6, gotoCurrent: false}). + datepicker('hide').val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2007, 12 - 1, 4), + 'Keystroke pgup step 2'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 4 - 1, 4), + 'Keystroke pgdn step 2'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2007, 8 - 1, 4), + 'Keystroke ctrl+pgup step 6'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 8 - 1, 4), + 'Keystroke ctrl+pgdn step 6'); +}); + +test('mouse', function() { + var inp = init('#inp'); + var dp = $('#ui-datepicker-div'); + var date = new Date(); + inp.val('').datepicker('show'); + $('.ui-datepicker tbody a:contains(10)', dp).simulate('click', {}); + date.setDate(10); + equalsDate(inp.datepicker('getDate'), date, 'Mouse click'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 12), + 'Mouse click - preset'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-clear a', dp).simulate('click', {}); + ok(inp.datepicker('getDate') == null, 'Mouse click - clear'); + inp.val('').datepicker('show'); + $('.ui-datepicker-close a', dp).simulate('click', {}); + ok(inp.datepicker('getDate') == null, 'Mouse click - close'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-close a', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Mouse click - close + preset'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-prev a', dp).simulate('click', {}); + $('.ui-datepicker-close a', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 4), + 'Mouse click - abandoned'); + // Current/previous/next + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-current a', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(14)', dp).simulate('click', {}); + date.setDate(14); + equalsDate(inp.datepicker('getDate'), date, 'Mouse click - current'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-prev a', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(16)', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 1 - 1, 16), + 'Mouse click - previous'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-next a', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(18)', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 3 - 1, 18), + 'Mouse click - next'); + // Previous/next with minimum/maximum + inp.datepicker('change', {minDate: new Date(2008, 2 - 1, 2), + maxDate: new Date(2008, 2 - 1, 26)}).val('02/04/2008').datepicker('show'); + $('.ui-datepicker-prev a', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(16)', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 16), + 'Mouse click - previous + min/max'); + inp.val('02/04/2008').datepicker('show'); + $('.ui-datepicker-next a', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(18)', dp).simulate('click', {}); + equalsDate(inp.datepicker('getDate'), new Date(2008, 2 - 1, 18), + 'Mouse click - next + min/max'); + // Change day of week + inp.val('02/04/2008').datepicker('show'); + equals($('.ui-datepicker-title-row td:first', dp).text(), 'Su', + 'Mouse click - initial day of week'); + $('.ui-datepicker-title-row td:last a', dp).simulate('click', {}); + equals($('.ui-datepicker-title-row td:first', dp).text(), 'Sa', + 'Mouse click - day of week'); + // Highlight week + inp.datepicker('change', {highlightWeek: true}). + datepicker('hide').val('02/04/2008').datepicker('show'); + ok(!$('.ui-datepicker tr:eq(2)', dp).is('.ui-datepicker-week-over'), + 'Mouse over - no week highlight'); + $('.ui-datepicker tr:eq(2) td:first', dp).simulate('mouseover', {}); + ok($('.ui-datepicker tr:eq(2)', dp).is('.ui-datepicker-week-over'), + 'Mouse over - week highlight'); + // Inline + var inl = init('#inl'); + var dp = $('.ui-datepicker-inline', inl); + var date = new Date(); + inl.datepicker('setDate', date); + $('.ui-datepicker tbody a:contains(10)', dp).simulate('click', {}); + date.setDate(10); + equalsDate(inl.datepicker('getDate'), date, 'Mouse click inline'); + inl.datepicker('setDate', new Date(2008, 2 - 1, 4)); + $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {}); + equalsDate(inl.datepicker('getDate'), new Date(2008, 2 - 1, 12), + 'Mouse click inline - preset'); + $('.ui-datepicker-current a', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(14)', dp).simulate('click', {}); + date.setDate(14); + equalsDate(inl.datepicker('getDate'), date, 'Mouse click inline - current'); + inl.datepicker('setDate', new Date(2008, 2 - 1, 4)); + $('.ui-datepicker-prev a', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(16)', dp).simulate('click', {}); + equalsDate(inl.datepicker('getDate'), new Date(2008, 1 - 1, 16), + 'Mouse click inline - previous'); + inl.datepicker('setDate', new Date(2008, 2 - 1, 4)); + $('.ui-datepicker-next a', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(18)', dp).simulate('click', {}); + equalsDate(inl.datepicker('getDate'), new Date(2008, 3 - 1, 18), + 'Mouse click inline - next'); +}); + +test('defaultDate', function() { + var inp = init('#inp'); + var date = new Date(); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Default date null'); + // numeric values + inp.datepicker('change', {defaultDate: -2}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 2); + equalsDate(inp.datepicker('getDate'), date, 'Default date -2'); + inp.datepicker('change', {defaultDate: 3}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 5); + equalsDate(inp.datepicker('getDate'), date, 'Default date 3'); + inp.datepicker('change', {defaultDate: 1 / 0}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 3); + equalsDate(inp.datepicker('getDate'), date, 'Default date Infinity'); + inp.datepicker('change', {defaultDate: 1 / 'a'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Default date NaN'); + // string values + inp.datepicker('change', {defaultDate: '-1d'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() - 1); + equalsDate(inp.datepicker('getDate'), date, 'Default date -1d'); + inp.datepicker('change', {defaultDate: '+3D'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 4); + equalsDate(inp.datepicker('getDate'), date, 'Default date +3D'); + inp.datepicker('change', {defaultDate: ' -2 w '}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = new Date(); + date.setDate(date.getDate() - 14); + equalsDate(inp.datepicker('getDate'), date, 'Default date -2 w'); + inp.datepicker('change', {defaultDate: '+1 W'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 21); + equalsDate(inp.datepicker('getDate'), date, 'Default date +1 W'); + inp.datepicker('change', {defaultDate: ' -1 m '}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = new Date(); + date.setMonth(date.getMonth() - 1); + equalsDate(inp.datepicker('getDate'), date, 'Default date -1 m'); + inp.datepicker('change', {defaultDate: '+2M'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setMonth(date.getMonth() + 3); + equalsDate(inp.datepicker('getDate'), date, 'Default date +2M'); + inp.datepicker('change', {defaultDate: '-2y'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = new Date(); + date.setFullYear(date.getFullYear() - 2); + equalsDate(inp.datepicker('getDate'), date, 'Default date -2y'); + inp.datepicker('change', {defaultDate: '+1 Y '}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setFullYear(date.getFullYear() + 3); + equalsDate(inp.datepicker('getDate'), date, 'Default date +1 Y'); + inp.datepicker('change', {defaultDate: '+1M +10d'}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date = new Date(); + date.setMonth(date.getMonth() + 1); + date.setDate(date.getDate() + 10); + equalsDate(inp.datepicker('getDate'), date, 'Default date +1M +10d'); + date = new Date(2007, 1 - 1, 26); + inp.datepicker('change', {defaultDate: date}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, 'Default date 01/26/2007'); +}); + +test('miscellaneous', function() { + var dp = $('#ui-datepicker-div'); + var inp = init('#inp'); + // Year range + inp.val('02/04/2008').datepicker('show'); + equals(dp.find('.ui-datepicker-new-year').text(), + '199819992000200120022003200420052006200720082009201020112012201320142015201620172018', + 'Year range - default'); + inp.datepicker('hide').datepicker('change', {yearRange: '-6:+2'}).datepicker('show'); + equals(dp.find('.ui-datepicker-new-year').text(), + '200220032004200520062007200820092010', 'Year range - -6:+2'); + inp.datepicker('hide').datepicker('change', {yearRange: '2000:2010'}).datepicker('show'); + equals(dp.find('.ui-datepicker-new-year').text(), + '20002001200220032004200520062007200820092010', 'Year range - 2000:2010'); + // Navigation as date format + equals(dp.find('.ui-datepicker-prev').text(), + '<Prev', 'Navigation prev - default'); + equals(dp.find('.ui-datepicker-current').text(), + 'Today', 'Navigation current - default'); + equals(dp.find('.ui-datepicker-next').text(), + 'Next>', 'Navigation next - default'); + inp.datepicker('hide').datepicker('change', {navigationAsDateFormat: true, + prevText: '< M', currentText: 'MM', nextText: 'M >'}). + val('02/04/2008').datepicker('show'); + var longNames = $.datepicker.regional[''].monthNames; + var shortNames = $.datepicker.regional[''].monthNamesShort; + var date = new Date(); + equals(dp.find('.ui-datepicker-prev').text(), + '< ' + shortNames[0], 'Navigation prev - as date format'); + equals(dp.find('.ui-datepicker-current').text(), + longNames[date.getMonth()], 'Navigation current - as date format'); + equals(dp.find('.ui-datepicker-next').text(), + shortNames[2] + ' >', 'Navigation next - as date format'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}); + equals(dp.find('.ui-datepicker-prev').text(), + '< ' + shortNames[1], 'Navigation prev - as date format + pgdn'); + equals(dp.find('.ui-datepicker-current').text(), + longNames[date.getMonth()], 'Navigation current - as date format + pgdn'); + equals(dp.find('.ui-datepicker-next').text(), + shortNames[3] + ' >', 'Navigation next - as date format + pgdn'); + inp.datepicker('hide').datepicker('change', {gotoCurrent: true}). + val('02/04/2008').datepicker('show'); + equals(dp.find('.ui-datepicker-prev').text(), + '< ' + shortNames[0], 'Navigation prev - as date format + goto current'); + equals(dp.find('.ui-datepicker-current').text(), + longNames[1], 'Navigation current - as date format + goto current'); + equals(dp.find('.ui-datepicker-next').text(), + shortNames[2] + ' >', 'Navigation next - as date format + goto current'); +}); + +test('minMax', function() { + var inp = init('#inp'); + var lastYear = new Date(2007, 6 - 1, 4); + var nextYear = new Date(2009, 6 - 1, 4); + var minDate = new Date(2008, 2 - 1, 29); + var maxDate = new Date(2008, 12 - 1, 7); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), lastYear, + 'Min/max - null, null - ctrl+pgup'); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), nextYear, + 'Min/max - null, null - ctrl+pgdn'); + inp.datepicker('change', {minDate: minDate}). + datepicker('hide').val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), minDate, + 'Min/max - 02/29/2008, null - ctrl+pgup'); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), nextYear, + 'Min/max - 02/29/2008, null - ctrl+pgdn'); + inp.datepicker('change', {maxDate: maxDate}). + datepicker('hide').val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), minDate, + 'Min/max - 02/29/2008, 12/07/2008 - ctrl+pgup'); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), maxDate, + 'Min/max - 02/29/2008, 12/07/2008 - ctrl+pgdn'); + inp.datepicker('change', {minDate: null}). + datepicker('hide').val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), lastYear, + 'Min/max - null, 12/07/2008 - ctrl+pgup'); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), maxDate, + 'Min/max - null, 12/07/2008 - ctrl+pgdn'); + // Relative dates + var date = new Date(); + date.setDate(date.getDate() - 7); + inp.datepicker('change', {minDate: '-1w', maxDate: '+1 M +10 D '}). + datepicker('hide').val('').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, + 'Min/max - -1w, +1 M +10 D - ctrl+pgup'); + date = new Date(); + date.setMonth(date.getMonth() + 1); + date.setDate(date.getDate() + 10); + inp.val('').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDate(inp.datepicker('getDate'), date, + 'Min/max - -1w, +1 M +10 D - ctrl+pgdn'); +}); + +test('setDate', function() { + var inp = init('#inp'); + var date1 = new Date(2008, 6 - 1, 4); + var date2 = new Date(); + ok(inp.datepicker('getDate') == null, 'Set date - default'); + inp.datepicker('setDate', date1); + equalsDate(inp.datepicker('getDate'), date1, 'Set date - 2008-06-04'); + date1 = new Date(); + date1.setDate(date1.getDate() + 7); + inp.datepicker('setDate', +7); + equalsDate(inp.datepicker('getDate'), date1, 'Set date - +7'); + date2.setFullYear(date2.getFullYear() + 2); + inp.datepicker('setDate', '+2y'); + equalsDate(inp.datepicker('getDate'), date2, 'Set date - +2y'); + inp.datepicker('setDate', date1, date2); + equalsDate(inp.datepicker('getDate'), date1, 'Set date - two dates'); + inp.datepicker('setDate'); + ok(inp.datepicker('getDate') == null, 'Set date - null'); + // Ranges + date1 = new Date(2008, 6 - 1, 4); + date2 = new Date(2009, 7 - 1, 5); + inp.datepicker('change', {rangeSelect: true}); + inp.datepicker('setDate', date1, date2); + equalsDateArray(inp.datepicker('getDate'), [date1, date2], + 'Set date range - 2008-06-04 - 2009-07-05'); + inp.datepicker('setDate', date1); + equalsDateArray(inp.datepicker('getDate'), [date1, date1], + 'Set date range - 2008-06-04'); + date1 = new Date(); + date1.setDate(date1.getDate() - 10); + date2 = new Date(); + date2.setDate(date2.getDate() + 10); + inp.datepicker('setDate', -10, +10); + equalsDateArray(inp.datepicker('getDate'), [date1, date2], + 'Set date range - -10 - +10'); + inp.datepicker('setDate', -10); + equalsDateArray(inp.datepicker('getDate'), [date1, date1], + 'Set date range - -10'); + date1 = new Date(); + date1.setDate(date1.getDate() - 14); + date2 = new Date(); + date2.setFullYear(date2.getFullYear() + 1); + inp.datepicker('setDate', '-2w', '+1Y'); + equalsDateArray(inp.datepicker('getDate'), [date1, date2], + 'Set date range - -2w - +1Y'); + inp.datepicker('setDate', '-2w'); + equalsDateArray(inp.datepicker('getDate'), [date1, date1], + 'Set date range - -2w'); + inp.datepicker('setDate'); + isObj(inp.datepicker('getDate'), [null, null], 'Set date range - null'); + // Inline + var inl = init('#inl'); + date1 = new Date(2008, 6 - 1, 4); + date2 = new Date(); + equalsDate(inl.datepicker('getDate'), date2, 'Set date inline - default'); + inl.datepicker('setDate', date1); + equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - 2008-06-04'); + date1 = new Date(); + date1.setDate(date1.getDate() + 7); + inl.datepicker('setDate', +7); + equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - +7'); + date2.setFullYear(date2.getFullYear() + 2); + inl.datepicker('setDate', '+2y'); + equalsDate(inl.datepicker('getDate'), date2, 'Set date inline - +2y'); + inl.datepicker('setDate', date1, date2); + equalsDate(inl.datepicker('getDate'), date1, 'Set date inline - two dates'); + inl.datepicker('setDate'); + ok(inl.datepicker('getDate') == null, 'Set date inline - null'); + // Alternate field + var alt = $('#alt'); + inp.datepicker('change', {altField: '#alt', altFormat: 'yy-mm-dd'}); + date1 = new Date(2008, 6 - 1, 4); + date2 = new Date(2009, 7 - 1, 5); + inp.datepicker('setDate', date1, date2); + equals(inp.val(), '06/04/2008 - 07/05/2009', + 'Set date alternate - 06/04/2008 - 07/05/2009'); + equals(alt.val(), '2008-06-04 - 2009-07-05', + 'Set date alternate - 2008-06-04 - 2009-07-05'); + inp.datepicker('change', {rangeSelect: false}).datepicker('setDate', date1); + equals(inp.val(), '06/04/2008', 'Set date alternate - 06/04/2008'); + equals(alt.val(), '2008-06-04', 'Set date alternate - 2008-06-04'); +}); + +test('ranges', function() { + var inp = init('#inp', {rangeSelect: true}); + var date1 = new Date(); + var date2 = new Date(); + // Select today - today + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDateArray(inp.datepicker('getDate'), [date1, date1], + 'Range - enter/enter'); + // Can't select prior to start date + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_UP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDateArray(inp.datepicker('getDate'), [date1, date1], + 'Range - enter/ctrl+up/enter'); + // Can select after start date + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date2.setDate(date2.getDate() + 7); + equalsDateArray(inp.datepicker('getDate'), [date1, date2], + 'Range - enter/ctrl+down/enter'); + equals(inp.val(), $.datepicker.formatDate('mm/dd/yy', date1) + ' - ' + + $.datepicker.formatDate('mm/dd/yy', date2), 'Range - value'); + // Select then cancel defaults to first date + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equalsDateArray(inp.datepicker('getDate'), [date1, date1], + 'Range - enter/ctrl+down/esc'); + // Separator + inp.datepicker('change', {rangeSeparator: ' to '}). + datepicker('hide').val('06/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDateArray(inp.datepicker('getDate'), + [new Date(2008, 6 - 1, 4), new Date(2008, 6 - 1, 11)], + 'Range separator - enter/ctrl+down/enter'); + equals(inp.val(), '06/04/2008 to 06/11/2008', + 'Range separator - value'); + // Callbacks + inp.datepicker('change', {onSelect: callback, rangeSeparator: ' - '}). + datepicker('hide').val('06/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(selectedDate, '06/04/2008 - 06/11/2008', + 'Range onSelect - enter/ctrl+down/enter'); + inp.datepicker('change', {onChangeMonthYear: callback2, onSelect: null}). + datepicker('hide').val('05/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(selectedDate, '2008/4', + 'Range onChangeMonthYear - enter/ctrl+down/enter'); + inp.datepicker('change', {onClose: callback, onChangeMonthYear: null}). + datepicker('hide').val('03/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(selectedDate, '03/04/2008 - 03/11/2008', + 'Range onClose - enter/ctrl+down/enter'); + // Minimum/maximum + date1 = new Date(2008, 5 - 1, 20); + date2 = new Date(2008, 7 - 1, 2); + inp.datepicker('change', {minDate: date1, maxDate: date2, onClose: null}). + datepicker('hide').val('06/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDateArray(inp.datepicker('getDate'), [date1, date2], + 'Range min/max - pgup/enter/pgdn/pgdn/enter'); + inp.val('06/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_UP}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equalsDateArray(inp.datepicker('getDate'), + [new Date(2008, 5 - 1, 28), new Date(2008, 6 - 1, 11)], + 'Range min/max - ctrl+up/enter/ctrl+down/ctrl+down/enter'); + // Inline + var inl = init('#inl', {rangeSelect: true}); + var dp = $('.ui-datepicker-inline', inl); + date1 = new Date(); + date1.setDate(12); + date2 = new Date(); + date2.setDate(19); + $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {}); + equalsDateArray(inl.datepicker('getDate'), [date1, date1], + 'Range inline - same day'); + $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(10)', dp).simulate('click', {}); // Doesn't select + equalsDateArray(inl.datepicker('getDate'), [date1, date1], + 'Range inline - prev'); + $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {}); // Selects + inl.datepicker('setDate', date1); + $('.ui-datepicker tbody a:contains(12)', dp).simulate('click', {}); + $('.ui-datepicker tbody a:contains(19)', dp).simulate('click', {}); + equalsDateArray(inl.datepicker('getDate'), [date1, date2], + 'Range inline - next'); +}); + +test('altField', function() { + var inp = init('#inp'); + var alt = $('#alt'); + // No alternate field set + alt.val(''); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(inp.val(), '06/04/2008', 'Alt field - dp - enter'); + equals(alt.val(), '', 'Alt field - alt not set'); + // Alternate field set + alt.val(''); + inp.datepicker('change', {altField: '#alt', altFormat: 'yy-mm-dd'}). + val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(inp.val(), '06/04/2008', 'Alt field - dp - enter'); + equals(alt.val(), '2008-06-04', 'Alt field - alt - enter'); + // Move from initial date + alt.val(''); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(inp.val(), '07/04/2008', 'Alt field - dp - pgdn'); + equals(alt.val(), '2008-07-04', 'Alt field - alt - pgdn'); + // Alternate field set - closed + alt.val(''); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equals(inp.val(), '06/04/2008', 'Alt field - dp - pgdn/esc'); + equals(alt.val(), '', 'Alt field - alt - pgdn/esc'); + // Clear date and alternate + alt.val(''); + inp.val('06/04/2008').datepicker('show'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END}); + equals(inp.val(), '', 'Alt field - dp - ctrl+end'); + equals(alt.val(), '', 'Alt field - alt - ctrl+end'); + // Range select no alternate field set + alt.val(''); + inp.datepicker('change', {rangeSelect: true, altField: '', altFormat: ''}). + datepicker('hide').val('06/04/2008 - 07/14/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(inp.val(), '06/04/2008 - 06/04/2008', 'Alt field range - dp - enter'); + equals(alt.val(), '', 'Alt field range - alt not set'); + // Range select no movement + alt.val(''); + inp.datepicker('change', {altField: '#alt', altFormat: 'yy-mm-dd'}). + datepicker('hide').val('06/04/2008 - 07/14/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(inp.val(), '06/04/2008 - 06/04/2008', 'Alt field range - dp - enter'); + equals(alt.val(), '2008-06-04 - 2008-06-04', 'Alt field range - alt - enter'); + // Range select next month + alt.val(''); + inp.val('06/04/2008 - 07/14/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(inp.val(), '06/04/2008 - 07/04/2008', + 'Alt field range - dp - enter/pgdn/enter'); + equals(alt.val(), '2008-06-04 - 2008-07-04', + 'Alt field range - alt - enter/pgdn/enter'); + // Range select escape + alt.val(''); + inp.val('06/04/2008 - 07/14/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equals(inp.val(), '06/04/2008 - 06/04/2008', + 'Alt field range - dp - enter/pgdn/esc'); + equals(alt.val(), '2008-06-04 - 2008-06-04', + 'Alt field range - alt - enter/pgdn/esc'); + // Range select clear + alt.val(''); + inp.val('06/04/2008 - 07/14/2008').datepicker('show'); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}). + simulate('keydown', {keyCode: $.simulate.VK_PGDN}). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END}); + equals(inp.val(), '', 'Alt field range - dp - enter/pgdn/ctrl+end'); + equals(alt.val(), '', 'Alt field range - alt - enter/pgdn/ctrl+end'); +}); + +var beforeShowThis = null; +var beforeShowInput = null; +var beforeShowInst = null; + +function beforeAll(input, inst) { + beforeShowThis = this; + beforeShowInput = input; + beforeShowInst = inst; + return {currentText: 'Current'}; +} + +var beforeShowDayThis = null; +var beforeShowDayOK = true; + +function beforeDay(date) { + beforeShowDayThis = this; + beforeShowDayOK &= (date > new Date(2008, 1 - 1, 26) && + date < new Date(2008, 3 - 1, 6)); + return [(date.getDate() % 2 == 0), (date.getDate() % 10 == 0 ? 'day10' : ''), + (date.getDate() % 3 == 0 ? 'Divisble by 3' : '')]; +} + +function calcWeek(date) { + var doy = date.getDate() + 6; + for (var m = date.getMonth() - 1; m >= 0; m--) + doy += $.datepicker._getDaysInMonth(date.getFullYear(), m); + // Simple count from 01/01 starting at week 1 + return Math.floor(doy / 7); +} + +test('callbacks', function() { + // Before show + var inp = init('#inp', {beforeShow: beforeAll}); + var inst = $.data(inp[0], 'datepicker'); + equals($.datepicker._get(inst, 'currentText'), 'Today', 'Before show - initial'); + inp.val('02/04/2008').datepicker('show'); + equals($.datepicker._get(inst, 'currentText'), 'Current', 'Before show - changed'); + ok(beforeShowThis.id == inp[0].id, 'Before show - this OK'); + ok(beforeShowInput.id == inp[0].id, 'Before show - input OK'); + isObj(beforeShowInst, inst, 'Before show - inst OK'); + inp.datepicker('hide').datepicker('destroy'); + // Before show day + inp = init('#inp', {beforeShowDay: beforeDay}); + var dp = $('#ui-datepicker-div'); + inp.val('02/04/2008').datepicker('show'); + ok(beforeShowDayThis.id == inp[0].id, 'Before show day - this OK'); + ok(beforeShowDayOK, 'Before show day - dates OK'); + var day20 = dp.find('.ui-datepicker td:contains("20")'); + var day21 = dp.find('.ui-datepicker td:contains("21")'); + ok(!day20.is('.ui-datepicker-unselectable'), 'Before show day - unselectable 20'); + ok(day21.is('.ui-datepicker-unselectable'), 'Before show day - unselectable 21'); + ok(day20.is('.day10'), 'Before show day - CSS 20'); + ok(!day21.is('.day10'), 'Before show day - CSS 21'); + ok(day20.attr('title') == '', 'Before show day - title 20'); + ok(day21.attr('title') == 'Divisble by 3', 'Before show day - title 21'); + inp.datepicker('hide').datepicker('destroy'); + // Calculate week + inp = init('#inp', {showWeeks: true, calculateWeek: calcWeek}); + inp.val('02/04/2008').datepicker('show'); + equals($('.ui-datepicker-week-col:first').text(), 4, 'Calculate week'); + equals($('.ui-datepicker-week-col:last').text(), 8, 'Calculate week'); + // Make Tuesday first + $('.ui-datepicker-title-row a:contains("Tu")', dp).simulate('click', {}); + equals($('.ui-datepicker-week-col:first').text(), 5, 'Calculate week'); + equals($('.ui-datepicker-week-col:last').text(), 9, 'Calculate week'); + inp.datepicker('hide').datepicker('destroy'); +}); + +var selectedThis = null; +var selectedDate = null; +var selectedInst = null; + +function callback(date, inst) { + selectedThis = this; + selectedDate = date; + selectedInst = inst; +} + +function callback2(year, month, inst) { + selectedThis = this; + selectedDate = year + '/' + month; + selectedInst = inst; +} + +test('events', function() { + var inp = init('#inp', {onSelect: callback}); + var date = new Date(); + // onSelect + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(selectedThis, inp[0], 'Callback selected this'); + equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback selected inst'); + equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date), + 'Callback selected date'); + inp.val('').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_DOWN}). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + date.setDate(date.getDate() + 7); + equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date), + 'Callback selected date - ctrl+down'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date), + 'Callback selected date - esc'); + // onChangeMonthYear + inp.datepicker('change', {onChangeMonthYear: callback2, onSelect: null}). + val('').datepicker('show'); + var newMonthYear = function(date) { + return date.getFullYear() + '/' + (date.getMonth() + 1); + }; + date = new Date(); + date.setDate(1); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGUP}); + date.setMonth(date.getMonth() - 1); + equals(selectedThis, inp[0], 'Callback change month/year this'); + equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback change month/year inst'); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - pgup'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}); + date.setMonth(date.getMonth() + 1); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - pgdn'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}); + date.setFullYear(date.getFullYear() - 1); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - ctrl+pgup'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_HOME}); + date.setFullYear(date.getFullYear() + 1); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - ctrl+home'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}); + date.setFullYear(date.getFullYear() + 1); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year date - ctrl+pgdn'); + inp.datepicker('setDate', new Date(2007, 1 - 1, 26)); + equals(selectedDate, '2007/1', 'Callback change month/year date - setDate'); + selectedDate = null; + inp.datepicker('setDate', new Date(2007, 1 - 1, 12)); + ok(selectedDate == null, 'Callback change month/year date - setDate no change'); + // onChangeMonthYear step by 2 + inp.datepicker('change', {stepMonths: 2}). + datepicker('hide').val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_PGUP}); + date.setMonth(date.getMonth() - 14); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year by 2 date - pgup'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGUP}); + date.setMonth(date.getMonth() - 12); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year by 2 date - ctrl+pgup'); + inp.simulate('keydown', {keyCode: $.simulate.VK_PGDN}); + date.setMonth(date.getMonth() + 2); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year by 2 date - pgdn'); + inp.simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_PGDN}); + date.setMonth(date.getMonth() + 12); + equals(selectedDate, newMonthYear(date), + 'Callback change month/year by 2 date - ctrl+pgdn'); + // onClose + inp.datepicker('change', {onClose: callback, onChangeMonthYear: null, stepMonths: 1}). + val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equals(selectedThis, inp[0], 'Callback close this'); + equals(selectedInst, $.data(inp[0], PROP_NAME), 'Callback close inst'); + equals(selectedDate, '', 'Callback close date - esc'); + inp.val('').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', new Date()), + 'Callback close date - enter'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {keyCode: $.simulate.VK_ESC}); + equals(selectedDate, '02/04/2008', 'Callback close date - preset'); + inp.val('02/04/2008').datepicker('show'). + simulate('keydown', {ctrlKey: true, keyCode: $.simulate.VK_END}); + equals(selectedDate, '', 'Callback close date - ctrl+end'); +}); + +function highlight20(date, inst) { + return (date.getDate() == 20 ? '*** 20 ***' : $.datepicker.dateStatus(date, inst)); +} + +test('status', function() { + var dp = $('#ui-datepicker-div'); + var inp = init('#inp', {showStatus: true, statusForDate: highlight20, showWeeks: true}); + inp.val('').datepicker('show'); + var status = $('.ui-datepicker-status', dp); + ok(status.length == 1, 'Status - present'); + equals(status.text(), 'Select a date', 'Status - default'); + $('.ui-datepicker-clear a', dp).simulate('mouseover'); + equals(status.text(), 'Erase the current date', 'Status - clear'); + $('.ui-datepicker-close a', dp).simulate('mouseover'); + equals(status.text(), 'Close without change', 'Status - close'); + $('.ui-datepicker-prev a', dp).simulate('mouseover'); + equals(status.text(), 'Show the previous month', 'Status - previous'); + $('.ui-datepicker-current a', dp).simulate('mouseover'); + equals(status.text(), 'Show the current month', 'Status - current'); + $('.ui-datepicker-next a', dp).simulate('mouseover'); + equals(status.text(), 'Show the next month', 'Status - next'); + $('.ui-datepicker-new-month', dp).simulate('mouseover'); + equals(status.text(), 'Show a different month', 'Status - new month'); + $('.ui-datepicker-new-year', dp).simulate('mouseover'); + equals(status.text(), 'Show a different year', 'Status - new year'); + $('.ui-datepicker-title-row td:first', dp).simulate('mouseover'); + equals(status.text(), 'Week of the year', 'Status - week header'); + var day = 0; + $('.ui-datepicker-title-row a', dp).each(function() { + $(this).simulate('mouseover'); + equals(status.text(), 'Set ' + $.datepicker.regional[''].dayNames[day] + + ' as first week day', 'Status - day ' + day); + day++; + }); + $('.ui-datepicker-days-row:eq(1) td:first', dp).simulate('mouseover'); + equals(status.text(), 'Week of the year', 'Status - week column'); + day = 0; + var month = $.datepicker.regional[''].monthNamesShort[new Date().getMonth()]; + $('.ui-datepicker-days-row:eq(1) a', dp).each(function() { + $(this).simulate('mouseover'); + equals(status.text(), 'Select ' + $.datepicker.regional[''].dayNames[day] + + ', ' + month + ' ' + $(this).text(), 'Status - dates'); + day++; + }); + $('.ui-datepicker-days-row a:contains("20")', dp).each(function() { + $(this).simulate('mouseover'); + equals(status.text(), '*** 20 ***', 'Status - dates'); + }); + inp.datepicker('hide').datepicker('destroy'); +}); + +test('localisation', function() { + var inp = init('#inp', $.datepicker.regional['fr']); + inp.datepicker('change', {dateFormat: 'DD, d MM yy', showStatus: true, showWeeks: true}). + val('').datepicker('show'); + var dp = $('#ui-datepicker-div'); + var status = $('.ui-datepicker-status', dp); + equals($('.ui-datepicker-clear', dp).text(), 'Effacer', 'Localisation - clear'); + equals($('.ui-datepicker-close', dp).text(), 'Fermer', 'Localisation - close'); + $('.ui-datepicker-close a', dp).simulate('mouseover'); + equals(status.text(), 'Fermer sans modifier', 'Localisation - status'); + equals($('.ui-datepicker-prev', dp).text(), '<Préc', 'Localisation - previous'); + equals($('.ui-datepicker-current', dp).text(), 'Courant', 'Localisation - current'); + equals($('.ui-datepicker-next', dp).text(), 'Suiv>', 'Localisation - next'); + equals($('.ui-datepicker-current', dp).text(), 'Courant', 'Localisation - current'); + var month = 0; + $('.ui-datepicker-new-month option', dp).each(function() { + equals($(this).text(), $.datepicker.regional['fr'].monthNames[month], + 'Localisation - month ' + month); + month++; + }); + equals($('.ui-datepicker-title-row td:first', dp).text(), + $.datepicker.regional['fr'].weekHeader, 'Localisation - week header'); + var day = 0; + $('.ui-datepicker-title-row a', dp).each(function() { + equals($(this).text(), $.datepicker.regional['fr'].dayNamesMin[day], + 'Localisation - day ' + day); + day++; + }); + inp.simulate('keydown', {keyCode: $.simulate.VK_ENTER}); + var date = new Date(); + equals(inp.val(), $.datepicker.regional['fr'].dayNames[date.getDay()] + ', ' + + date.getDate() + ' ' + $.datepicker.regional['fr'].monthNames[date.getMonth()] + + ' ' + date.getFullYear(), 'Localisation - formatting'); +}); + +test('noWeekends', function() { + for (var i = 1; i <= 31; i++) { + var date = new Date(2001, 1 - 1, i); + isSet($.datepicker.noWeekends(date), [(i + 1) % 7 >= 2, ''], + 'No weekends ' + date); + } +}); + +test('iso8601Week', function() { + var date = new Date(2000, 12 - 1, 31); + equals($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date); + date = new Date(2001, 1 - 1, 1); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2001, 1 - 1, 7); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2001, 1 - 1, 8); + equals($.datepicker.iso8601Week(date), 2, 'ISO 8601 week ' + date); + date = new Date(2003, 12 - 1, 28); + equals($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date); + date = new Date(2003, 12 - 1, 29); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2004, 1 - 1, 4); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2004, 1 - 1, 5); + equals($.datepicker.iso8601Week(date), 2, 'ISO 8601 week ' + date); + date = new Date(2009, 12 - 1, 28); + equals($.datepicker.iso8601Week(date), 53, 'ISO 8601 week ' + date); + date = new Date(2010, 1 - 1, 3); + equals($.datepicker.iso8601Week(date), 53, 'ISO 8601 week ' + date); + date = new Date(2010, 1 - 1, 4); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); + date = new Date(2010, 1 - 1, 10); + equals($.datepicker.iso8601Week(date), 1, 'ISO 8601 week ' + date); +}); + +test('parseDate', function() { + init('#inp'); + ok($.datepicker.parseDate('d m y', '') == null, 'Parse date empty'); + equalsDate($.datepicker.parseDate('d m y', '3 2 01'), + new Date(2001, 2 - 1, 3), 'Parse date d m y'); + equalsDate($.datepicker.parseDate('dd mm yy', '03 02 2001'), + new Date(2001, 2 - 1, 3), 'Parse date dd mm yy'); + equalsDate($.datepicker.parseDate('d m y', '13 12 01'), + new Date(2001, 12 - 1, 13), 'Parse date d m y'); + equalsDate($.datepicker.parseDate('dd mm yy', '13 12 2001'), + new Date(2001, 12 - 1, 13), 'Parse date dd mm yy'); + equalsDate($.datepicker.parseDate('y-o', '2001-34'), + new Date(2001, 2 - 1, 3), 'Parse date y-o'); + equalsDate($.datepicker.parseDate('yy-oo', '2001-347'), + new Date(2001, 12 - 1, 13), 'Parse date yy oo'); + equalsDate($.datepicker.parseDate('oo yy', '348 2004'), + new Date(2004, 12 - 1, 13), 'Parse date oo-yy'); + equalsDate($.datepicker.parseDate('D d M y', 'Sat 3 Feb 01'), + new Date(2001, 2 - 1, 3), 'Parse date D d M y'); + equalsDate($.datepicker.parseDate('d MM DD yy', '3 February Saturday 2001'), + new Date(2001, 2 - 1, 3), 'Parse date dd MM DD yy'); + equalsDate($.datepicker.parseDate('DD, MM d, yy', 'Saturday, February 3, 2001'), + new Date(2001, 2 - 1, 3), 'Parse date DD, MM d, yy'); + equalsDate($.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy', + 'day 3 of February (\'Saturday\'), 2001'), new Date(2001, 2 - 1, 3), + 'Parse date \'day\' d \'of\' MM (\'\'DD\'\'), yy'); + equalsDate($.datepicker.parseDate('y-m-d', '01-02-03'), + new Date(2001, 2 - 1, 3), 'Parse date y-m-d - default cutoff'); + equalsDate($.datepicker.parseDate('y-m-d', '51-02-03'), + new Date(1951, 2 - 1, 3), 'Parse date y-m-d - default cutoff'); + equalsDate($.datepicker.parseDate('y-m-d', '51-02-03', {shortYearCutoff: 80}), + new Date(2051, 2 - 1, 3), 'Parse date y-m-d - cutoff 80'); + equalsDate($.datepicker.parseDate('y-m-d', '51-02-03', {shortYearCutoff: '+60'}), + new Date(2051, 2 - 1, 3), 'Parse date y-m-d - cutoff +60'); + var fr = $.datepicker.regional['fr']; + var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames, + monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames}; + equalsDate($.datepicker.parseDate('D d M y', 'Lun 9 Avr 01', settings), + new Date(2001, 4 - 1, 9), 'Parse date D M y with settings'); + equalsDate($.datepicker.parseDate('d MM DD yy', '9 Avril Lundi 2001', settings), + new Date(2001, 4 - 1, 9), 'Parse date d MM DD yy with settings'); + equalsDate($.datepicker.parseDate('DD, MM d, yy', 'Lundi, Avril 9, 2001', settings), + new Date(2001, 4 - 1, 9), 'Parse date DD, MM d, yy with settings'); + equalsDate($.datepicker.parseDate('\'jour\' d \'de\' MM (\'\'DD\'\'), yy', + 'jour 9 de Avril (\'Lundi\'), 2001', settings), new Date(2001, 4 - 1, 9), + 'Parse date \'jour\' d \'de\' MM (\'\'DD\'\'), yy with settings'); +}); + +test('parseDateErrors', function() { + init('#inp'); + var expectError = function(expr, value, error) { + try { + expr(); + ok(false, 'Parsed error ' + value); + } + catch (e) { + equals(e, error, 'Parsed error ' + value); + } + }; + expectError(function() { $.datepicker.parseDate(null, 'Sat 2 01'); }, + 'Sat 2 01', 'Invalid arguments'); + expectError(function() { $.datepicker.parseDate('d m y', null); }, + 'null', 'Invalid arguments'); + expectError(function() { $.datepicker.parseDate('d m y', 'Sat 2 01'); }, + 'Sat 2 01 - d m y', 'Missing number at position 0'); + expectError(function() { $.datepicker.parseDate('dd mm yy', 'Sat 2 01'); }, + 'Sat 2 01 - dd mm yy', 'Missing number at position 0'); + expectError(function() { $.datepicker.parseDate('d m y', '3 Feb 01'); }, + '3 Feb 01 - d m y', 'Missing number at position 2'); + expectError(function() { $.datepicker.parseDate('dd mm yy', '3 Feb 01'); }, + '3 Feb 01 - dd mm yy', 'Missing number at position 2'); + expectError(function() { $.datepicker.parseDate('d m y', '3 2 AD01'); }, + '3 2 AD01 - d m y', 'Missing number at position 4'); + expectError(function() { $.datepicker.parseDate('d m yy', '3 2 AD01'); }, + '3 2 AD01 - dd mm yy', 'Missing number at position 4'); + expectError(function() { $.datepicker.parseDate('y-o', '2001-D01'); }, + '2001-D01 - y-o', 'Missing number at position 5'); + expectError(function() { $.datepicker.parseDate('yy-oo', '2001-D01'); }, + '2001-D01 - yy-oo', 'Missing number at position 5'); + expectError(function() { $.datepicker.parseDate('D d M y', 'D7 3 Feb 01'); }, + 'D7 3 Feb 01 - D d M y', 'Unknown name at position 0'); + expectError(function() { $.datepicker.parseDate('D d M y', 'Sat 3 M2 01'); }, + 'Sat 3 M2 01 - D d M y', 'Unknown name at position 6'); + expectError(function() { $.datepicker.parseDate('DD, MM d, yy', 'Saturday- Feb 3, 2001'); }, + 'Saturday- Feb 3, 2001 - DD, MM d, yy', 'Unexpected literal at position 8'); + expectError(function() { $.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy', + 'day 3 of February ("Saturday"), 2001'); }, + 'day 3 of Mon2 ("Day7"), 2001', 'Unexpected literal at position 19'); + expectError(function() { $.datepicker.parseDate('d m y', '29 2 01'); }, + '29 2 01 - d m y', 'Invalid date'); + var fr = $.datepicker.regional['fr']; + var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames, + monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames}; + expectError(function() { $.datepicker.parseDate('D d M y', 'Mon 9 Avr 01', settings); }, + 'Mon 9 Avr 01 - D d M y', 'Unknown name at position 0'); + expectError(function() { $.datepicker.parseDate('D d M y', 'Lun 9 Apr 01', settings); }, + 'Lun 9 Apr 01 - D d M y', 'Unknown name at position 6'); +}); + +test('formatDate', function() { + init('#inp'); + equals($.datepicker.formatDate('d m y', new Date(2001, 2 - 1, 3)), + '3 2 01', 'Format date d m y'); + equals($.datepicker.formatDate('dd mm yy', new Date(2001, 2 - 1, 3)), + '03 02 2001', 'Format date dd mm yy'); + equals($.datepicker.formatDate('d m y', new Date(2001, 12 - 1, 13)), + '13 12 01', 'Format date d m y'); + equals($.datepicker.formatDate('dd mm yy', new Date(2001, 12 - 1, 13)), + '13 12 2001', 'Format date dd mm yy'); + equals($.datepicker.formatDate('yy-o', new Date(2001, 2 - 1, 3)), + '2001-34', 'Format date yy-o'); + equals($.datepicker.formatDate('yy-oo', new Date(2001, 2 - 1, 3)), + '2001-034', 'Format date yy-oo'); + equals($.datepicker.formatDate('D M y', new Date(2001, 2 - 1, 3)), + 'Sat Feb 01', 'Format date D M y'); + equals($.datepicker.formatDate('DD MM yy', new Date(2001, 2 - 1, 3)), + 'Saturday February 2001', 'Format date DD MM yy'); + equals($.datepicker.formatDate('DD, MM d, yy', new Date(2001, 2 - 1, 3)), + 'Saturday, February 3, 2001', 'Format date DD, MM d, yy'); + equals($.datepicker.formatDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy', + new Date(2001, 2 - 1, 3)), 'day 3 of February (\'Saturday\'), 2001', + 'Format date \'day\' d \'of\' MM (\'\'DD\'\'), yy'); + var fr = $.datepicker.regional['fr']; + var settings = {dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames, + monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames}; + equals($.datepicker.formatDate('D M y', new Date(2001, 4 - 1, 9), settings), + 'Lun Avr 01', 'Format date D M y with settings'); + equals($.datepicker.formatDate('DD MM yy', new Date(2001, 4 - 1, 9), settings), + 'Lundi Avril 2001', 'Format date DD MM yy with settings'); + equals($.datepicker.formatDate('DD, MM d, yy', new Date(2001, 4 - 1, 9), settings), + 'Lundi, Avril 9, 2001', 'Format date DD, MM d, yy with settings'); + equals($.datepicker.formatDate('\'jour\' d \'de\' MM (\'\'DD\'\'), yy', + new Date(2001, 4 - 1, 9), settings), 'jour 9 de Avril (\'Lundi\'), 2001', + 'Format date \'jour\' d \'de\' MM (\'\'DD\'\'), yy with settings'); +}); + +})(jQuery); diff --git a/tests/dialog.html b/tests/dialog.html index 9febc1a7d..503485038 100644 --- a/tests/dialog.html +++ b/tests/dialog.html @@ -1,40 +1,40 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>jQuery UI Dialog Test Suite</title>
-
- <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
- <!--link rel="stylesheet" href="../themes/flora/flora.dialog.css" type="text/css" media="screen"-->
-
- <script type="text/javascript" src="../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../ui/ui.core.js"></script>
- <script type="text/javascript" src="../ui/ui.dialog.js"></script>
- <script type="text/javascript" src="../ui/ui.draggable.js"></script>
- <script type="text/javascript" src="../ui/ui.resizable.js"></script>
-
- <script type="text/javascript" src="qunit/testrunner.js"></script>
- <script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
- <script type="text/javascript" src="dialog.js"></script>
-
- <style type="text/css">
- html { border: 0; }
- </style>
-
-
-
-</head>
-<body class="flora">
-
-<h1 id="header">jQuery UI Dialog Test Suite</h1>
-<h2 id="banner"></h2>
-<h2 id="userAgent"></h2>
-
-<ol id="tests"></ol>
-
-<div id="main" style="position: absolute; top: -10000px; border: 1px solid black; padding: 10px; margin: 10px;">
- <div id="dialog1">Dialog Content</div>
-</div>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Dialog Test Suite</title> + + <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen"> + <!--link rel="stylesheet" href="../themes/flora/flora.dialog.css" type="text/css" media="screen"--> + + <script type="text/javascript" src="../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../ui/ui.core.js"></script> + <script type="text/javascript" src="../ui/ui.dialog.js"></script> + <script type="text/javascript" src="../ui/ui.draggable.js"></script> + <script type="text/javascript" src="../ui/ui.resizable.js"></script> + + <script type="text/javascript" src="qunit/testrunner.js"></script> + <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="dialog.js"></script> + + <style type="text/css"> + html { border: 0; } + </style> + + + +</head> +<body class="flora"> + +<h1 id="header">jQuery UI Dialog Test Suite</h1> +<h2 id="banner"></h2> +<h2 id="userAgent"></h2> + +<ol id="tests"></ol> + +<div id="main" style="position: absolute; top: -10000px; border: 1px solid black; padding: 10px; margin: 10px;"> + <div id="dialog1">Dialog Content</div> +</div> + +</body> +</html> diff --git a/tests/dialog.js b/tests/dialog.js index b6362aa4e..a2e143599 100644 --- a/tests/dialog.js +++ b/tests/dialog.js @@ -1,675 +1,675 @@ -/*
- * dialog unit tests
- */
-(function($) {
-//
-// Dialog Test Helper Functions
-//
-
-var defaults = {
- autoOpen: true,
- autoResize: true,
- buttons: {},
- disabled: false,
- dialogClass: null,
- draggable: true,
- height: 200,
- maxHeight: null,
- maxWidth: null,
- minHeight: 100,
- minWidth: 150,
- modal: false,
- overlay: {},
- position: 'center',
- resizable: true,
- stack: true,
- title: '',
- width: 300
-};
-
-var el,
- offsetBefore, offsetAfter,
- heightBefore, heightAfter,
- widthBefore, widthAfter,
- dragged;
-
-function dlg() {
- return el.data("dialog").element.parents(".ui-dialog:first");
-}
-
-function isOpen(why) {
- ok(dlg().is(":visible"), why);
-}
-
-function isNotOpen(why) {
- ok(!dlg().is(":visible"), why);
-}
-
-function drag(handle, dx, dy) {
- var d = dlg();
- offsetBefore = d.offset();
- heightBefore = d.height();
- widthBefore = d.width();
- //this mouseover is to work around a limitation in resizable
- //TODO: fix resizable so handle doesn't require mouseover in order to be used
- $(handle, d).simulate("mouseover");
- $(handle, d).simulate("drag", {
- dx: dx || 0,
- dy: dy || 0
- });
- dragged = { dx: dx, dy: dy };
- offsetAfter = d.offset();
- heightAfter = d.height();
- widthAfter = d.width();
-}
-
-function moved(dx, dy, msg) {
- msg = msg ? msg + "." : "";
- var actual = { left: offsetAfter.left, top: offsetAfter.top };
- var expected = { left: offsetBefore.left + dx, top: offsetBefore.top + dy };
- compare2(actual, expected, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ' + msg);
-}
-
-function shouldmove(why) {
- var handle = $(".ui-dialog-titlebar", dlg());
- drag(handle, 50, 50);
- moved(50, 50, why);
-}
-
-function shouldnotmove(why) {
- var handle = $(".ui-dialog-titlebar", dlg());
- drag(handle, 50, 50);
- moved(0, 0, why);
-}
-
-function resized(dw, dh, msg) {
- msg = msg ? msg + "." : "";
- var actual = { width: widthAfter, height: heightAfter };
- var expected = { width: widthBefore + dw, height: heightBefore + dh };
- compare2(actual, expected, 'resized[' + dragged.dx + ', ' + dragged.dy + '] ' + msg);
-}
-
-function shouldresize(why) {
- var handle = $(".ui-resizable-se", dlg());
- drag(handle, 50, 50);
- resized(50, 50, why);
-}
-
-function shouldnotresize(why) {
- var handle = $(".ui-resizable-se", dlg());
- drag(handle, 50, 50);
- resized(0, 0, why);
-}
-
-function broder(el, side){
- return parseInt(el.css('border-' + side + '-width'), 10);
-}
-
-function margin(el, side) {
- return parseInt(el.css('margin-' + side), 10);
-}
-
-// Dialog Tests
-module("dialog");
-
-test("init", function() {
- expect(6);
-
- $("#dialog1").dialog().remove();
- ok(true, '.dialog() called on element');
-
- $([]).dialog().remove();
- ok(true, '.dialog() called on empty collection');
-
- $('<div/>').dialog().remove();
- ok(true, '.dialog() called on disconnected DOMElement');
-
- $('<div/>').dialog().dialog("foo").remove();
- ok(true, 'arbitrary method called after init');
-
- el = $('<div/>').dialog();
- var foo = el.data("foo.dialog");
- el.remove();
- ok(true, 'arbitrary option getter after init');
-
- $('<div/>').dialog().data("foo.dialog", "bar").remove();
- ok(true, 'arbitrary option setter after init');
-});
-
-test("destroy", function() {
- expect(6);
-
- $("#dialog1").dialog().dialog("destroy").remove();
- ok(true, '.dialog("destroy") called on element');
-
- $([]).dialog().dialog("destroy").remove();
- ok(true, '.dialog("destroy") called on empty collection');
-
- $('<div/>').dialog().dialog("destroy").remove();
- ok(true, '.dialog("destroy") called on disconnected DOMElement');
-
- $('<div/>').dialog().dialog("destroy").dialog("foo").remove();
- ok(true, 'arbitrary method called after destroy');
-
- el = $('<div/>').dialog();
- var foo = el.dialog("destroy").data("foo.dialog");
- el.remove();
- ok(true, 'arbitrary option getter after destroy');
-
- $('<div/>').dialog().dialog("destroy").data("foo.dialog", "bar").remove();
- ok(true, 'arbitrary option setter after destroy');
-});
-
-/*
-//This one takes a while to run
-
-test("element types", function() {
- var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form'
- + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr'
- + ',acronym,code,samp,kbd,var,img,object,hr'
- + ',input,button,label,select,iframe').split(',');
-
- $.each(typeNames, function(i) {
- var typeName = typeNames[i];
- el = $(document.createElement(typeName)).appendTo('body');
- (typeName == 'table' && el.append("<tr><td>content</td></tr>"));
- el.dialog();
- ok(true, '$("<' + typeName + '/>").dialog()');
- el.dialog("destroy");
- el.remove();
- });
-});
-
-*/
-
-test("defaults", function() {
- el = $('<div/>').dialog();
- $.each(defaults, function(key, val) {
- var actual = el.data(key + ".dialog"), expected = val,
- method = (expected && expected.constructor == Object) ?
- compare2 : equals;
- method(actual, expected, key);
- });
- el.remove();
-});
-
-test("title id", function() {
- expect(3);
-
- var titleId;
-
- // reset the uuid so we know what values to expect
- $.ui.dialog.uuid = 0;
-
- el = $('<div/>').dialog();
- titleId = dlg().find('.ui-dialog-title').attr('id');
- equals(titleId, 'ui-dialog-title-1', 'auto-numbered title id');
- el.remove();
-
- el = $('<div/>').dialog();
- titleId = dlg().find('.ui-dialog-title').attr('id');
- equals(titleId, 'ui-dialog-title-2', 'auto-numbered title id');
- el.remove();
-
- el = $('<div id="foo"/>').dialog();
- titleId = dlg().find('.ui-dialog-title').attr('id');
- equals(titleId, 'ui-dialog-title-foo', 'carried over title id');
- el.remove();
-});
-
-module("dialog: Options");
-
-test("autoOpen", function() {
- expect(2);
-
- el = $('<div/>').dialog({ autoOpen: false });
- isNotOpen('.dialog({ autoOpen: false })');
- el.remove();
-
- el = $('<div/>').dialog({ autoOpen: true });
- isOpen('.dialog({ autoOpen: true })');
- el.remove();
-});
-
-test("autoResize", function() {
- expect(2);
-
- var actual,
- before,
- expected,
- handle;
-
- el = $('<div>content<br>content<br>content<br>content<br>content</div>').dialog({ autoResize: false });
- expected = { height: el.height() };
- handle = $(".ui-resizable-se", dlg());
- drag(handle, 50, 50);
- actual = { height: el.height() };
- compare2(actual, expected, '.dialog({ autoResize: false })');
- el.remove();
- el = $('<div>content<br>content<br>content<br>content<br>content</div>').dialog({ autoResize: true });
- before = { width: el.width(), height: el.height() };
- handle = $(".ui-resizable-se", dlg());
- drag(handle, 50, 50);
- expected = { width: before.width + 50, height: before.height + 50 };
- actual = { width: el.width(), height: el.height() };
- compare2(actual, expected, '.dialog({ autoResize: true })');
- el.remove();
-});
-
-test("buttons", function() {
- expect(17);
-
- var buttons = {
- "Ok": function(ev, ui) {
- ok(true, "button click fires callback");
- equals(this, el[0], "context of callback");
- equals(ev.target, btn[0], "event target");
- },
- "Cancel": function(ev, ui) {
- ok(true, "button click fires callback");
- equals(this, el[0], "context of callback");
- equals(ev.target, btn[1], "event target");
- }
- };
-
- el = $('<div/>').dialog({ buttons: buttons });
- var btn = $("button", dlg());
- equals(btn.length, 2, "number of buttons");
-
- var i = 0;
- $.each(buttons, function(key, val) {
- equals(btn.eq(i).text(), key, "text of button " + (i+1));
- i++;
- });
-
- equals(btn.parent().attr('className'), 'ui-dialog-buttonpane', "buttons in container");
- btn.trigger("click");
-
- var newButtons = {
- "Close": function(ev, ui) {
- ok(true, "button click fires callback");
- equals(this, el[0], "context of callback");
- equals(ev.target, btn[0], "event target");
- }
- };
-
- equals(el.data("buttons.dialog"), buttons, '.data("buttons.dialog") getter');
- el.data("buttons.dialog", newButtons);
- equals(el.data("buttons.dialog"), newButtons, '.data("buttons.dialog", ...) setter');
-
- btn = $("button", dlg());
- equals(btn.length, 1, "number of buttons after setter");
- btn.trigger('click');
-
- i = 0;
- $.each(newButtons, function(key, val) {
- equals(btn.eq(i).text(), key, "text of button " + (i+1));
- i += 1;
- });
-
- el.remove();
-});
-
-test("dialogClass", function() {
- expect(4);
-
- el = $('<div/>').dialog();
- equals(dlg().is(".foo"), false, 'dialogClass not specified. foo class added');
- el.remove();
-
- el = $('<div/>').dialog({ dialogClass: "foo" });
- equals(dlg().is(".foo"), true, 'dialogClass in init. foo class added');
- el.remove();
-
- el = $('<div/>').dialog({ dialogClass: "foo bar" });
- equals(dlg().is(".foo"), true, 'dialogClass in init, two classes. foo class added');
- equals(dlg().is(".bar"), true, 'dialogClass in init, two classes. bar class added');
- el.remove();
-});
-
-test("draggable", function() {
- expect(4);
-
- el = $('<div/>').dialog({ draggable: false });
- shouldnotmove();
- el.data('draggable.dialog', true);
- shouldmove();
- el.remove();
-
- el = $('<div/>').dialog({ draggable: true });
- shouldmove();
- el.data('draggable.dialog', false);
- shouldnotmove();
- el.remove();
-});
-
-test("height", function() {
- expect(3);
-
- el = $('<div/>').dialog();
- equals(dlg().height(), defaults.height, "default height");
- el.remove();
-
- el = $('<div/>').dialog({ height: 437 });
- equals(dlg().height(), 437, "explicit height");
- el.remove();
-
- el = $('<div/>').dialog();
- el.data('height.dialog', 438);
- equals(dlg().height(), 438, "explicit height set after init");
- el.remove();
-});
-
-test("maxHeight", function() {
- expect(3);
-
- el = $('<div/>').dialog({ maxHeight: 400 });
- drag('.ui-resizable-s', 1000, 1000);
- equals(heightAfter, 400, "maxHeight");
- el.remove();
-
- el = $('<div/>').dialog({ maxHeight: 400 });
- drag('.ui-resizable-n', -1000, -1000);
- equals(heightAfter, 400, "maxHeight");
- el.remove();
-
- el = $('<div/>').dialog({ maxHeight: 400 }).data('maxHeight.dialog', 600);
- drag('.ui-resizable-n', -1000, -1000);
- equals(heightAfter, 600, "maxHeight");
- el.remove();
-});
-
-test("maxWidth", function() {
- expect(3);
-
- el = $('<div/>').dialog({ maxWidth: 400 });
- drag('.ui-resizable-e', 1000, 1000);
- equals(widthAfter, 400, "maxWidth");
- el.remove();
-
- el = $('<div/>').dialog({ maxWidth: 400 });
- drag('.ui-resizable-w', -1000, -1000);
- equals(widthAfter, 400, "maxWidth");
- el.remove();
-
- el = $('<div/>').dialog({ maxWidth: 400 }).data('maxWidth.dialog', 600);
- drag('.ui-resizable-w', -1000, -1000);
- equals(widthAfter, 600, "maxWidth");
- el.remove();
-});
-
-test("minHeight", function() {
- expect(3);
-
- el = $('<div/>').dialog({ minHeight: 10 });
- drag('.ui-resizable-s', -1000, -1000);
- equals(heightAfter, 10, "minHeight");
- el.remove();
-
- el = $('<div/>').dialog({ minHeight: 10 });
- drag('.ui-resizable-n', 1000, 1000);
- equals(heightAfter, 10, "minHeight");
- el.remove();
-
- el = $('<div/>').dialog({ minHeight: 10 }).data('minHeight.dialog', 30);
- drag('.ui-resizable-n', 1000, 1000);
- equals(heightAfter, 30, "minHeight");
- el.remove();
-});
-
-test("minWidth", function() {
- expect(3);
-
- el = $('<div/>').dialog({ minWidth: 10 });
- drag('.ui-resizable-e', -1000, -1000);
- equals(widthAfter, 10, "minWidth");
- el.remove();
-
- el = $('<div/>').dialog({ minWidth: 10 });
- drag('.ui-resizable-w', 1000, 1000);
- equals(widthAfter, 10, "minWidth");
- el.remove();
-
- el = $('<div/>').dialog({ minWidth: 30 }).data('minWidth.dialog', 30);
- drag('.ui-resizable-w', 1000, 1000);
- equals(widthAfter, 30, "minWidth");
- el.remove();
-});
-
-test("modal", function() {
- ok(false, "missing test");
-});
-
-test("overlay", function() {
- ok(false, "missing test");
-});
-
-test("position", function() {
- ok(false, "missing test");
-});
-
-test("resizable", function() {
- expect(4);
-
- el = $('<div/>').dialog();
- shouldresize("[default]");
- el.data('resizable.dialog', false);
- shouldnotresize('disabled after init');
- el.remove();
-
- el = $('<div/>').dialog({ resizable: false });
- shouldnotresize("disabled in init options");
- el.data('resizable.dialog', true);
- shouldresize('enabled after init');
- el.remove();
-});
-
-test("stack", function() {
- ok(false, "missing test");
-});
-
-test("title", function() {
- expect(5);
-
- function titleText() {
- return dlg().find(".ui-dialog-title").html();
- }
-
- el = $('<div/>').dialog();
- equals(titleText(), " ", "[default]");
- el.remove();
-
- el = $('<div title="foo"/>').dialog();
- equals(titleText(), "foo", "title in element attribute");
- el.remove();
-
- el = $('<div/>').dialog({ title: 'foo' });
- equals(titleText(), "foo", "title in init options");
- el.remove();
-
- el = $('<div title="foo"/>').dialog({ title: 'bar' });
- equals(titleText(), "bar", "title in init options should override title in element attribute");
- el.remove();
-
- el = $('<div/>').dialog().data('title.dialog', 'foo');
- equals(titleText(), 'foo', 'title after init');
- el.remove();
-});
-
-test("width", function() {
- expect(3);
-
- el = $('<div/>').dialog();
- equals(dlg().width(), defaults.width, "default width");
- el.remove();
-
- el = $('<div/>').dialog({width: 437 });
- equals(dlg().width(), 437, "explicit width");
- el.data('width.dialog', 438);
- equals(dlg().width(), 438, 'explicit width after init');
- el.remove();
-});
-
-module("dialog: Methods");
-
-test("isOpen", function() {
- expect(4);
-
- el = $('<div/>').dialog();
- equals(el.dialog('isOpen'), true, "dialog is open after init");
- el.dialog('close');
- equals(el.dialog('isOpen'), false, "dialog is closed");
- el.remove();
-
- el = $('<div/>').dialog({autoOpen: false});
- equals(el.dialog('isOpen'), false, "dialog is closed after init");
- el.dialog('open');
- equals(el.dialog('isOpen'), true, "dialog is open");
- el.remove();
-});
-
-module("dialog: Callbacks");
-
-test("open", function() {
- expect(4);
- el = $("<div/>");
- el.dialog({
- open: function(ev, ui) {
- ok(true, 'autoOpen: true fires open callback');
- equals(this, el[0], "context of callback");
- }
- });
- el.remove();
- el = $("<div/>");
- el.dialog({
- autoOpen: false,
- open: function(ev, ui) {
- ok(true, '.dialog("open") fires open callback');
- equals(this, el[0], "context of callback");
- }
- });
- el.dialog("open");
- el.remove();
-});
-
-test("dragStart", function() {
- expect(1);
- el = $("<div/>");
- el.dialog({
- dragStart: function(ev, ui) {
- equals(this, el[0], "context of callback");
- }
- });
- var handle = $(".ui-dialog-titlebar", dlg());
- drag(handle, 50, 50);
- el.remove();
-});
-
-test("drag", function() {
- var fired = false;
- el = $("<div/>");
- el.dialog({
- drag: function(ev, ui) {
- fired = true;
- equals(this, el[0], "context of callback");
- }
- });
- var handle = $(".ui-dialog-titlebar", dlg());
- drag(handle, 50, 50);
- ok(fired, "resize fired");
- el.remove();
-});
-
-test("dragStop", function() {
- expect(1);
- el = $("<div/>");
- el.dialog({
- dragStop: function(ev, ui) {
- equals(this, el[0], "context of callback");
- }
- });
- var handle = $(".ui-dialog-titlebar", dlg());
- drag(handle, 50, 50);
- el.remove();
-});
-
-test("resizeStart", function() {
- expect(1);
- el = $("<div/>");
- el.dialog({
- resizeStart: function(ev, ui) {
- equals(this, el[0], "context of callback");
- }
- });
- var handle = $(".ui-resizable-se", dlg());
- drag(handle, 50, 50);
- el.remove();
-});
-
-test("resize", function() {
- var fired = false;
- el = $("<div/>");
- el.dialog({
- resize: function(ev, ui) {
- fired = true;
- equals(this, el[0], "context of callback");
- }
- });
- var handle = $(".ui-resizable-se", dlg());
- drag(handle, 50, 50);
- ok(fired, "resize fired");
- el.remove();
-});
-
-test("resizeStop", function() {
- expect(1);
- el = $("<div/>");
- el.dialog({
- resizeStop: function(ev, ui) {
- equals(this, el[0], "context of callback");
- }
- });
- var handle = $(".ui-resizable-se", dlg());
- drag(handle, 50, 50);
- el.remove();
-});
-
-test("close", function() {
- expect(2);
- el = $('<div/>').dialog({
- close: function(ev, ui) {
- ok(true, '.dialog("close") fires close callback');
- equals(this, el[0], "context of callback");
- }
- });
- el.dialog("close");
- el.remove();
-});
-
-test("beforeclose", function() {
- expect(6);
-
- el = $('<div/>').dialog({
- beforeclose: function(ev, ui) {
- ok(true, '.dialog("close") fires beforeclose callback');
- equals(this, el[0], "context of callback");
- return false;
- }
- });
- el.dialog('close');
- isOpen('beforeclose callback should prevent dialog from closing');
- el.remove();
-
- el = $('<div/>').dialog().bind('dialogbeforeclose', function(ev, ui) {
- ok(true, '.dialog("close") triggers dialogbeforeclose event');
- equals(this, el[0], "context of event");
- return false;
- });
- el.dialog('close');
- isOpen('dialogbeforeclose event should prevent dialog from closing');
- el.remove();
-});
-
-module("dialog: Tickets");
-
-})(jQuery);
+/* + * dialog unit tests + */ +(function($) { +// +// Dialog Test Helper Functions +// + +var defaults = { + autoOpen: true, + autoResize: true, + buttons: {}, + disabled: false, + dialogClass: null, + draggable: true, + height: 200, + maxHeight: null, + maxWidth: null, + minHeight: 100, + minWidth: 150, + modal: false, + overlay: {}, + position: 'center', + resizable: true, + stack: true, + title: '', + width: 300 +}; + +var el, + offsetBefore, offsetAfter, + heightBefore, heightAfter, + widthBefore, widthAfter, + dragged; + +function dlg() { + return el.data("dialog").element.parents(".ui-dialog:first"); +} + +function isOpen(why) { + ok(dlg().is(":visible"), why); +} + +function isNotOpen(why) { + ok(!dlg().is(":visible"), why); +} + +function drag(handle, dx, dy) { + var d = dlg(); + offsetBefore = d.offset(); + heightBefore = d.height(); + widthBefore = d.width(); + //this mouseover is to work around a limitation in resizable + //TODO: fix resizable so handle doesn't require mouseover in order to be used + $(handle, d).simulate("mouseover"); + $(handle, d).simulate("drag", { + dx: dx || 0, + dy: dy || 0 + }); + dragged = { dx: dx, dy: dy }; + offsetAfter = d.offset(); + heightAfter = d.height(); + widthAfter = d.width(); +} + +function moved(dx, dy, msg) { + msg = msg ? msg + "." : ""; + var actual = { left: offsetAfter.left, top: offsetAfter.top }; + var expected = { left: offsetBefore.left + dx, top: offsetBefore.top + dy }; + compare2(actual, expected, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ' + msg); +} + +function shouldmove(why) { + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, 50); + moved(50, 50, why); +} + +function shouldnotmove(why) { + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, 50); + moved(0, 0, why); +} + +function resized(dw, dh, msg) { + msg = msg ? msg + "." : ""; + var actual = { width: widthAfter, height: heightAfter }; + var expected = { width: widthBefore + dw, height: heightBefore + dh }; + compare2(actual, expected, 'resized[' + dragged.dx + ', ' + dragged.dy + '] ' + msg); +} + +function shouldresize(why) { + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + resized(50, 50, why); +} + +function shouldnotresize(why) { + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + resized(0, 0, why); +} + +function broder(el, side){ + return parseInt(el.css('border-' + side + '-width'), 10); +} + +function margin(el, side) { + return parseInt(el.css('margin-' + side), 10); +} + +// Dialog Tests +module("dialog"); + +test("init", function() { + expect(6); + + $("#dialog1").dialog().remove(); + ok(true, '.dialog() called on element'); + + $([]).dialog().remove(); + ok(true, '.dialog() called on empty collection'); + + $('<div/>').dialog().remove(); + ok(true, '.dialog() called on disconnected DOMElement'); + + $('<div/>').dialog().dialog("foo").remove(); + ok(true, 'arbitrary method called after init'); + + el = $('<div/>').dialog(); + var foo = el.data("foo.dialog"); + el.remove(); + ok(true, 'arbitrary option getter after init'); + + $('<div/>').dialog().data("foo.dialog", "bar").remove(); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + expect(6); + + $("#dialog1").dialog().dialog("destroy").remove(); + ok(true, '.dialog("destroy") called on element'); + + $([]).dialog().dialog("destroy").remove(); + ok(true, '.dialog("destroy") called on empty collection'); + + $('<div/>').dialog().dialog("destroy").remove(); + ok(true, '.dialog("destroy") called on disconnected DOMElement'); + + $('<div/>').dialog().dialog("destroy").dialog("foo").remove(); + ok(true, 'arbitrary method called after destroy'); + + el = $('<div/>').dialog(); + var foo = el.dialog("destroy").data("foo.dialog"); + el.remove(); + ok(true, 'arbitrary option getter after destroy'); + + $('<div/>').dialog().dialog("destroy").data("foo.dialog", "bar").remove(); + ok(true, 'arbitrary option setter after destroy'); +}); + +/* +//This one takes a while to run + +test("element types", function() { + var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form' + + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr' + + ',acronym,code,samp,kbd,var,img,object,hr' + + ',input,button,label,select,iframe').split(','); + + $.each(typeNames, function(i) { + var typeName = typeNames[i]; + el = $(document.createElement(typeName)).appendTo('body'); + (typeName == 'table' && el.append("<tr><td>content</td></tr>")); + el.dialog(); + ok(true, '$("<' + typeName + '/>").dialog()'); + el.dialog("destroy"); + el.remove(); + }); +}); + +*/ + +test("defaults", function() { + el = $('<div/>').dialog(); + $.each(defaults, function(key, val) { + var actual = el.data(key + ".dialog"), expected = val, + method = (expected && expected.constructor == Object) ? + compare2 : equals; + method(actual, expected, key); + }); + el.remove(); +}); + +test("title id", function() { + expect(3); + + var titleId; + + // reset the uuid so we know what values to expect + $.ui.dialog.uuid = 0; + + el = $('<div/>').dialog(); + titleId = dlg().find('.ui-dialog-title').attr('id'); + equals(titleId, 'ui-dialog-title-1', 'auto-numbered title id'); + el.remove(); + + el = $('<div/>').dialog(); + titleId = dlg().find('.ui-dialog-title').attr('id'); + equals(titleId, 'ui-dialog-title-2', 'auto-numbered title id'); + el.remove(); + + el = $('<div id="foo"/>').dialog(); + titleId = dlg().find('.ui-dialog-title').attr('id'); + equals(titleId, 'ui-dialog-title-foo', 'carried over title id'); + el.remove(); +}); + +module("dialog: Options"); + +test("autoOpen", function() { + expect(2); + + el = $('<div/>').dialog({ autoOpen: false }); + isNotOpen('.dialog({ autoOpen: false })'); + el.remove(); + + el = $('<div/>').dialog({ autoOpen: true }); + isOpen('.dialog({ autoOpen: true })'); + el.remove(); +}); + +test("autoResize", function() { + expect(2); + + var actual, + before, + expected, + handle; + + el = $('<div>content<br>content<br>content<br>content<br>content</div>').dialog({ autoResize: false }); + expected = { height: el.height() }; + handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + actual = { height: el.height() }; + compare2(actual, expected, '.dialog({ autoResize: false })'); + el.remove(); + el = $('<div>content<br>content<br>content<br>content<br>content</div>').dialog({ autoResize: true }); + before = { width: el.width(), height: el.height() }; + handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + expected = { width: before.width + 50, height: before.height + 50 }; + actual = { width: el.width(), height: el.height() }; + compare2(actual, expected, '.dialog({ autoResize: true })'); + el.remove(); +}); + +test("buttons", function() { + expect(17); + + var buttons = { + "Ok": function(ev, ui) { + ok(true, "button click fires callback"); + equals(this, el[0], "context of callback"); + equals(ev.target, btn[0], "event target"); + }, + "Cancel": function(ev, ui) { + ok(true, "button click fires callback"); + equals(this, el[0], "context of callback"); + equals(ev.target, btn[1], "event target"); + } + }; + + el = $('<div/>').dialog({ buttons: buttons }); + var btn = $("button", dlg()); + equals(btn.length, 2, "number of buttons"); + + var i = 0; + $.each(buttons, function(key, val) { + equals(btn.eq(i).text(), key, "text of button " + (i+1)); + i++; + }); + + equals(btn.parent().attr('className'), 'ui-dialog-buttonpane', "buttons in container"); + btn.trigger("click"); + + var newButtons = { + "Close": function(ev, ui) { + ok(true, "button click fires callback"); + equals(this, el[0], "context of callback"); + equals(ev.target, btn[0], "event target"); + } + }; + + equals(el.data("buttons.dialog"), buttons, '.data("buttons.dialog") getter'); + el.data("buttons.dialog", newButtons); + equals(el.data("buttons.dialog"), newButtons, '.data("buttons.dialog", ...) setter'); + + btn = $("button", dlg()); + equals(btn.length, 1, "number of buttons after setter"); + btn.trigger('click'); + + i = 0; + $.each(newButtons, function(key, val) { + equals(btn.eq(i).text(), key, "text of button " + (i+1)); + i += 1; + }); + + el.remove(); +}); + +test("dialogClass", function() { + expect(4); + + el = $('<div/>').dialog(); + equals(dlg().is(".foo"), false, 'dialogClass not specified. foo class added'); + el.remove(); + + el = $('<div/>').dialog({ dialogClass: "foo" }); + equals(dlg().is(".foo"), true, 'dialogClass in init. foo class added'); + el.remove(); + + el = $('<div/>').dialog({ dialogClass: "foo bar" }); + equals(dlg().is(".foo"), true, 'dialogClass in init, two classes. foo class added'); + equals(dlg().is(".bar"), true, 'dialogClass in init, two classes. bar class added'); + el.remove(); +}); + +test("draggable", function() { + expect(4); + + el = $('<div/>').dialog({ draggable: false }); + shouldnotmove(); + el.data('draggable.dialog', true); + shouldmove(); + el.remove(); + + el = $('<div/>').dialog({ draggable: true }); + shouldmove(); + el.data('draggable.dialog', false); + shouldnotmove(); + el.remove(); +}); + +test("height", function() { + expect(3); + + el = $('<div/>').dialog(); + equals(dlg().height(), defaults.height, "default height"); + el.remove(); + + el = $('<div/>').dialog({ height: 437 }); + equals(dlg().height(), 437, "explicit height"); + el.remove(); + + el = $('<div/>').dialog(); + el.data('height.dialog', 438); + equals(dlg().height(), 438, "explicit height set after init"); + el.remove(); +}); + +test("maxHeight", function() { + expect(3); + + el = $('<div/>').dialog({ maxHeight: 400 }); + drag('.ui-resizable-s', 1000, 1000); + equals(heightAfter, 400, "maxHeight"); + el.remove(); + + el = $('<div/>').dialog({ maxHeight: 400 }); + drag('.ui-resizable-n', -1000, -1000); + equals(heightAfter, 400, "maxHeight"); + el.remove(); + + el = $('<div/>').dialog({ maxHeight: 400 }).data('maxHeight.dialog', 600); + drag('.ui-resizable-n', -1000, -1000); + equals(heightAfter, 600, "maxHeight"); + el.remove(); +}); + +test("maxWidth", function() { + expect(3); + + el = $('<div/>').dialog({ maxWidth: 400 }); + drag('.ui-resizable-e', 1000, 1000); + equals(widthAfter, 400, "maxWidth"); + el.remove(); + + el = $('<div/>').dialog({ maxWidth: 400 }); + drag('.ui-resizable-w', -1000, -1000); + equals(widthAfter, 400, "maxWidth"); + el.remove(); + + el = $('<div/>').dialog({ maxWidth: 400 }).data('maxWidth.dialog', 600); + drag('.ui-resizable-w', -1000, -1000); + equals(widthAfter, 600, "maxWidth"); + el.remove(); +}); + +test("minHeight", function() { + expect(3); + + el = $('<div/>').dialog({ minHeight: 10 }); + drag('.ui-resizable-s', -1000, -1000); + equals(heightAfter, 10, "minHeight"); + el.remove(); + + el = $('<div/>').dialog({ minHeight: 10 }); + drag('.ui-resizable-n', 1000, 1000); + equals(heightAfter, 10, "minHeight"); + el.remove(); + + el = $('<div/>').dialog({ minHeight: 10 }).data('minHeight.dialog', 30); + drag('.ui-resizable-n', 1000, 1000); + equals(heightAfter, 30, "minHeight"); + el.remove(); +}); + +test("minWidth", function() { + expect(3); + + el = $('<div/>').dialog({ minWidth: 10 }); + drag('.ui-resizable-e', -1000, -1000); + equals(widthAfter, 10, "minWidth"); + el.remove(); + + el = $('<div/>').dialog({ minWidth: 10 }); + drag('.ui-resizable-w', 1000, 1000); + equals(widthAfter, 10, "minWidth"); + el.remove(); + + el = $('<div/>').dialog({ minWidth: 30 }).data('minWidth.dialog', 30); + drag('.ui-resizable-w', 1000, 1000); + equals(widthAfter, 30, "minWidth"); + el.remove(); +}); + +test("modal", function() { + ok(false, "missing test"); +}); + +test("overlay", function() { + ok(false, "missing test"); +}); + +test("position", function() { + ok(false, "missing test"); +}); + +test("resizable", function() { + expect(4); + + el = $('<div/>').dialog(); + shouldresize("[default]"); + el.data('resizable.dialog', false); + shouldnotresize('disabled after init'); + el.remove(); + + el = $('<div/>').dialog({ resizable: false }); + shouldnotresize("disabled in init options"); + el.data('resizable.dialog', true); + shouldresize('enabled after init'); + el.remove(); +}); + +test("stack", function() { + ok(false, "missing test"); +}); + +test("title", function() { + expect(5); + + function titleText() { + return dlg().find(".ui-dialog-title").html(); + } + + el = $('<div/>').dialog(); + equals(titleText(), " ", "[default]"); + el.remove(); + + el = $('<div title="foo"/>').dialog(); + equals(titleText(), "foo", "title in element attribute"); + el.remove(); + + el = $('<div/>').dialog({ title: 'foo' }); + equals(titleText(), "foo", "title in init options"); + el.remove(); + + el = $('<div title="foo"/>').dialog({ title: 'bar' }); + equals(titleText(), "bar", "title in init options should override title in element attribute"); + el.remove(); + + el = $('<div/>').dialog().data('title.dialog', 'foo'); + equals(titleText(), 'foo', 'title after init'); + el.remove(); +}); + +test("width", function() { + expect(3); + + el = $('<div/>').dialog(); + equals(dlg().width(), defaults.width, "default width"); + el.remove(); + + el = $('<div/>').dialog({width: 437 }); + equals(dlg().width(), 437, "explicit width"); + el.data('width.dialog', 438); + equals(dlg().width(), 438, 'explicit width after init'); + el.remove(); +}); + +module("dialog: Methods"); + +test("isOpen", function() { + expect(4); + + el = $('<div/>').dialog(); + equals(el.dialog('isOpen'), true, "dialog is open after init"); + el.dialog('close'); + equals(el.dialog('isOpen'), false, "dialog is closed"); + el.remove(); + + el = $('<div/>').dialog({autoOpen: false}); + equals(el.dialog('isOpen'), false, "dialog is closed after init"); + el.dialog('open'); + equals(el.dialog('isOpen'), true, "dialog is open"); + el.remove(); +}); + +module("dialog: Callbacks"); + +test("open", function() { + expect(4); + el = $("<div/>"); + el.dialog({ + open: function(ev, ui) { + ok(true, 'autoOpen: true fires open callback'); + equals(this, el[0], "context of callback"); + } + }); + el.remove(); + el = $("<div/>"); + el.dialog({ + autoOpen: false, + open: function(ev, ui) { + ok(true, '.dialog("open") fires open callback'); + equals(this, el[0], "context of callback"); + } + }); + el.dialog("open"); + el.remove(); +}); + +test("dragStart", function() { + expect(1); + el = $("<div/>"); + el.dialog({ + dragStart: function(ev, ui) { + equals(this, el[0], "context of callback"); + } + }); + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("drag", function() { + var fired = false; + el = $("<div/>"); + el.dialog({ + drag: function(ev, ui) { + fired = true; + equals(this, el[0], "context of callback"); + } + }); + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, 50); + ok(fired, "resize fired"); + el.remove(); +}); + +test("dragStop", function() { + expect(1); + el = $("<div/>"); + el.dialog({ + dragStop: function(ev, ui) { + equals(this, el[0], "context of callback"); + } + }); + var handle = $(".ui-dialog-titlebar", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("resizeStart", function() { + expect(1); + el = $("<div/>"); + el.dialog({ + resizeStart: function(ev, ui) { + equals(this, el[0], "context of callback"); + } + }); + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("resize", function() { + var fired = false; + el = $("<div/>"); + el.dialog({ + resize: function(ev, ui) { + fired = true; + equals(this, el[0], "context of callback"); + } + }); + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + ok(fired, "resize fired"); + el.remove(); +}); + +test("resizeStop", function() { + expect(1); + el = $("<div/>"); + el.dialog({ + resizeStop: function(ev, ui) { + equals(this, el[0], "context of callback"); + } + }); + var handle = $(".ui-resizable-se", dlg()); + drag(handle, 50, 50); + el.remove(); +}); + +test("close", function() { + expect(2); + el = $('<div/>').dialog({ + close: function(ev, ui) { + ok(true, '.dialog("close") fires close callback'); + equals(this, el[0], "context of callback"); + } + }); + el.dialog("close"); + el.remove(); +}); + +test("beforeclose", function() { + expect(6); + + el = $('<div/>').dialog({ + beforeclose: function(ev, ui) { + ok(true, '.dialog("close") fires beforeclose callback'); + equals(this, el[0], "context of callback"); + return false; + } + }); + el.dialog('close'); + isOpen('beforeclose callback should prevent dialog from closing'); + el.remove(); + + el = $('<div/>').dialog().bind('dialogbeforeclose', function(ev, ui) { + ok(true, '.dialog("close") triggers dialogbeforeclose event'); + equals(this, el[0], "context of event"); + return false; + }); + el.dialog('close'); + isOpen('dialogbeforeclose event should prevent dialog from closing'); + el.remove(); +}); + +module("dialog: Tickets"); + +})(jQuery); diff --git a/tests/progressbar.html b/tests/progressbar.html index 2138572e7..1d082681c 100644 --- a/tests/progressbar.html +++ b/tests/progressbar.html @@ -1,39 +1,39 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>jQuery UI Progressbar Test Suite</title>
-
- <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
- <script type="text/javascript" src="../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../ui/ui.core.js"></script>
- <script type="text/javascript" src="../ui/ui.progressbar.js"></script>
-
- <script type="text/javascript" src="qunit/testrunner.js"></script>
- <script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
- <script type="text/javascript" src="progressbar.js"></script>
-
- <style type="text/css">
-
-
-
- </style>
-
-
-
-</head>
-<body>
-
-<h1 id="header">jQuery UI Progressbar Test Suite</h1>
-<h2 id="banner"></h2>
-<h2 id="userAgent"></h2>
-
-<ol id="tests"></ol>
-
-<div id="main" style="position:absolute;top:-20000px">
- <div id="progressbar"></div>
-</div>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Progressbar Test Suite</title> + + <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen"> + + <script type="text/javascript" src="../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../ui/ui.core.js"></script> + <script type="text/javascript" src="../ui/ui.progressbar.js"></script> + + <script type="text/javascript" src="qunit/testrunner.js"></script> + <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="progressbar.js"></script> + + <style type="text/css"> + + + + </style> + + + +</head> +<body> + +<h1 id="header">jQuery UI Progressbar Test Suite</h1> +<h2 id="banner"></h2> +<h2 id="userAgent"></h2> + +<ol id="tests"></ol> + +<div id="main" style="position:absolute;top:-20000px"> + <div id="progressbar"></div> +</div> + +</body> +</html> diff --git a/tests/progressbar.js b/tests/progressbar.js index 37d484a22..e95f17a80 100644 --- a/tests/progressbar.js +++ b/tests/progressbar.js @@ -1,56 +1,56 @@ -/*
- * progressbar unit tests
- */
-(function($) {
-
-// Spinner Tests
-module("progressbar");
-
-test("init", function() {
- expect(1);
-
- el = $("#progressbar").progressbar();
- ok(true, '.progressbar() called on element');
-
-});
-
-test("destroy", function() {
- expect(1);
-
- $("#progressbar").progressbar().progressbar("destroy");
- ok(true, '.progressbar("destroy") called on element');
-
-});
-
-test("defaults", function() {
- expect(5);
- el = $("#progressbar").progressbar();
-
- equals(el.data("width.progressbar"), 300, "width");
- equals(el.data("duration.progressbar"), 3000, "duration");
- equals(el.data("interval.progressbar"), 200, "interval");
- equals(el.data("increment.progressbar"), 1, "increment");
- equals(el.data("range.progressbar"), true, "range");
-
-});
-
-test("set defaults on init", function() {
- expect(5);
- el = $("#progressbar").progressbar({
- width: 500,
- duration: 5000,
- interval: 500,
- increment: 5,
- range: false
- });
-
- equals(el.data("width.progressbar"), 500, "width");
- equals(el.data("duration.progressbar"), 5000, "duration");
- equals(el.data("interval.progressbar"), 500, "interval");
- equals(el.data("increment.progressbar"), 5, "increment");
- equals(el.data("range.progressbar"), false, "range");
-
-});
-
-
-})(jQuery);
+/* + * progressbar unit tests + */ +(function($) { + +// Spinner Tests +module("progressbar"); + +test("init", function() { + expect(1); + + el = $("#progressbar").progressbar(); + ok(true, '.progressbar() called on element'); + +}); + +test("destroy", function() { + expect(1); + + $("#progressbar").progressbar().progressbar("destroy"); + ok(true, '.progressbar("destroy") called on element'); + +}); + +test("defaults", function() { + expect(5); + el = $("#progressbar").progressbar(); + + equals(el.data("width.progressbar"), 300, "width"); + equals(el.data("duration.progressbar"), 3000, "duration"); + equals(el.data("interval.progressbar"), 200, "interval"); + equals(el.data("increment.progressbar"), 1, "increment"); + equals(el.data("range.progressbar"), true, "range"); + +}); + +test("set defaults on init", function() { + expect(5); + el = $("#progressbar").progressbar({ + width: 500, + duration: 5000, + interval: 500, + increment: 5, + range: false + }); + + equals(el.data("width.progressbar"), 500, "width"); + equals(el.data("duration.progressbar"), 5000, "duration"); + equals(el.data("interval.progressbar"), 500, "interval"); + equals(el.data("increment.progressbar"), 5, "increment"); + equals(el.data("range.progressbar"), false, "range"); + +}); + + +})(jQuery); diff --git a/tests/selectable.html b/tests/selectable.html index 25d5a5c28..b92ec5c1c 100644 --- a/tests/selectable.html +++ b/tests/selectable.html @@ -1,44 +1,44 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>jQuery UI Selectable Test Suite</title>
-
- <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
- <!--link rel="stylesheet" href="../themes/flora/flora.selectable.css" type="text/css" media="screen"-->
-
- <script type="text/javascript" src="../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../ui/ui.core.js"></script>
- <script type="text/javascript" src="../ui/ui.selectable.js"></script>
-
- <script type="text/javascript" src="qunit/testrunner.js"></script>
- <script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
- <script type="text/javascript" src="selectable.js"></script>
-
- <style type="text/css">
- html { border: 0; }
- </style>
-
-
-
-</head>
-<body class="flora">
-
-<h1 id="header">jQuery UI Selectable Test Suite</h1>
-<h2 id="banner"></h2>
-<h2 id="userAgent"></h2>
-
-<ol id="tests"></ol>
-
-<div id="main" style="position: absolute; top: -10000px; border: 1px solid black; padding: 10px; margin: 10px;">
- <ul id="selectable1">
- <li>Item 1</li>
- <li>Item 2</li>
- <li class="special">Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- </ul>
-</div>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Selectable Test Suite</title> + + <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen"> + <!--link rel="stylesheet" href="../themes/flora/flora.selectable.css" type="text/css" media="screen"--> + + <script type="text/javascript" src="../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../ui/ui.core.js"></script> + <script type="text/javascript" src="../ui/ui.selectable.js"></script> + + <script type="text/javascript" src="qunit/testrunner.js"></script> + <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="selectable.js"></script> + + <style type="text/css"> + html { border: 0; } + </style> + + + +</head> +<body class="flora"> + +<h1 id="header">jQuery UI Selectable Test Suite</h1> +<h2 id="banner"></h2> +<h2 id="userAgent"></h2> + +<ol id="tests"></ol> + +<div id="main" style="position: absolute; top: -10000px; border: 1px solid black; padding: 10px; margin: 10px;"> + <ul id="selectable1"> + <li>Item 1</li> + <li>Item 2</li> + <li class="special">Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + </ul> +</div> + +</body> +</html> diff --git a/tests/selectable.js b/tests/selectable.js index 5060650d1..267b88931 100644 --- a/tests/selectable.js +++ b/tests/selectable.js @@ -1,207 +1,207 @@ -/*
- * selectable unit tests
- */
-(function($) {
-//
-// Selectable Test Helper Functions
-//
-var el;
-
-var drag = function(dx, dy) {
- var off = el.offset(), pos = { clientX: off.left, clientY: off.top };
- el.simulate("mousedown", pos);
- $(document).simulate("mousemove", pos);
- pos.clientX += dx;
- pos.clientY += dy;
- $(document).simulate("mousemove", pos);
- $(document).simulate("mouseup", pos);
-}
-
-var border = function(el, side) { return parseInt(el.css('border-' + side + '-width')); }
-
-var margin = function(el, side) { return parseInt(el.css('margin-' + side)); }
-
-// Selectable Tests
-module("selectable");
-
-test("init", function() {
- expect(6);
-
- $("#selectable1").selectable().remove();
- ok(true, '.selectable() called on element');
-
- $([]).selectable().remove();
- ok(true, '.selectable() called on empty collection');
-
- $("<div/>").selectable().remove();
- ok(true, '.selectable() called on disconnected DOMElement');
-
- $("<div/>").selectable().selectable("foo").remove();
- ok(true, 'arbitrary method called after init');
-
- el = $("<div/>").selectable()
- var foo = el.data("foo.selectable");
- el.remove();
- ok(true, 'arbitrary option getter after init');
-
- $("<div/>").selectable().data("foo.selectable", "bar").remove();
- ok(true, 'arbitrary option setter after init');
-});
-
-test("destroy", function() {
- expect(6);
-
- $("#selectable1").selectable().selectable("destroy").remove();
- ok(true, '.selectable("destroy") called on element');
-
- $([]).selectable().selectable("destroy").remove();
- ok(true, '.selectable("destroy") called on empty collection');
-
- $("<div/>").selectable().selectable("destroy").remove();
- ok(true, '.selectable("destroy") called on disconnected DOMElement');
-
- $("<div/>").selectable().selectable("destroy").selectable("foo").remove();
- ok(true, 'arbitrary method called after destroy');
-
- el = $("<div/>").selectable();
- var foo = el.selectable("destroy").data("foo.selectable");
- el.remove();
- ok(true, 'arbitrary option getter after destroy');
-
- $("<div/>").selectable().selectable("destroy").data("foo.selectable", "bar").remove();
- ok(true, 'arbitrary option setter after destroy');
-});
-
-test("defaults", function() {
- el = $('#selectable1').selectable();
- var defaults = {
- autoRefresh: true,
- filter: '*'
- };
- $.each(defaults, function(key, val) {
- var actual = el.data(key + ".selectable"), expected = val,
- method = (expected && expected.constructor == Object) ?
- compare2 : equals;
- method(actual, expected, key);
- });
- el.remove();
-});
-
-module("selectable: Options");
-
-test("autoRefresh", function() {
- expect(3);
- el = $("#selectable1");
- var actual, sel = $("*", el), selected = function() { actual += 1 };
-
- actual = 0;
- el = $("#selectable1").selectable({ autoRefresh: false, selected: selected });
- sel.hide();
- drag(1000, 1000);
- equals(actual, sel.length);
- el.selectable("destroy");
-
- actual = 0;
- sel.show();
- el = $("#selectable1").selectable({ autoRefresh: true, selected: selected });
- sel.hide();
- drag(1000, 1000);
- equals(actual, 0);
- sel.show();
- drag(1000, 1000);
- equals(actual, sel.length);
- el.selectable("destroy");
- sel.show();
-});
-
-test("filter", function() {
- expect(2);
- el = $("#selectable1");
- var actual, sel = $("*", el), selected = function() { actual += 1 };
-
- actual = 0;
- el = $("#selectable1").selectable({ filter: '.special', selected: selected });
- drag(1000, 1000);
- ok(sel.length != 1, "this test assumes more than 1 selectee");
- equals(actual, 1);
- el.selectable("destroy");
-});
-
-module("selectable: Methods");
-
-test("disable", function() {
- expect(2);
- var fired = false;
-
- el = $("#selectable1");
- el.selectable({
- disabled: false,
- start: function() { fired = true; }
- });
- el.simulate("drag", 20, 20);
- equals(fired, true, "start fired");
- el.selectable("disable");
- fired = false;
- el.simulate("drag", 20, 20);
- equals(fired, false, "start fired");
- el.selectable("destroy");
-});
-
-test("enable", function() {
- expect(2);
- var fired = false;
-
- el = $("#selectable1");
- el.selectable({
- disabled: true,
- start: function() { fired = true; }
- });
- el.simulate("drag", 20, 20);
- equals(fired, false, "start fired");
- el.selectable("enable");
- el.simulate("drag", 20, 20);
- equals(fired, true, "start fired");
- el.selectable("destroy");
-});
-
-test("toggle", function() {
- expect(2);
-
- el = $("#selectable1").selectable({ disabled: true }).selectable("toggle");
- equals(el.data("disabled.selectable"), false, "disabled -> enabled");
- el.selectable("destroy");
-
- el = $("#selectable1").selectable({ disabled: false }).selectable("toggle");
- equals(el.data("disabled.selectable"), true, "enabled -> disabled");
- el.selectable("destroy");
-});
-
-module("selectable: Callbacks");
-
-test("start", function() {
- expect(2);
- el = $("#selectable1");
- el.selectable({
- start: function(ev, ui) {
- ok(true, "drag fired start callback");
- equals(this, el[0], "context of callback");
- }
- });
- el.simulate("drag", 20, 20);
-});
-
-test("stop", function() {
- expect(2);
- el = $("#selectable1");
- el.selectable({
- start: function(ev, ui) {
- ok(true, "drag fired stop callback");
- equals(this, el[0], "context of callback");
- }
- });
- el.simulate("drag", 20, 20);
-});
-
-module("selectable: Tickets");
-
-})(jQuery);
+/* + * selectable unit tests + */ +(function($) { +// +// Selectable Test Helper Functions +// +var el; + +var drag = function(dx, dy) { + var off = el.offset(), pos = { clientX: off.left, clientY: off.top }; + el.simulate("mousedown", pos); + $(document).simulate("mousemove", pos); + pos.clientX += dx; + pos.clientY += dy; + $(document).simulate("mousemove", pos); + $(document).simulate("mouseup", pos); +} + +var border = function(el, side) { return parseInt(el.css('border-' + side + '-width')); } + +var margin = function(el, side) { return parseInt(el.css('margin-' + side)); } + +// Selectable Tests +module("selectable"); + +test("init", function() { + expect(6); + + $("#selectable1").selectable().remove(); + ok(true, '.selectable() called on element'); + + $([]).selectable().remove(); + ok(true, '.selectable() called on empty collection'); + + $("<div/>").selectable().remove(); + ok(true, '.selectable() called on disconnected DOMElement'); + + $("<div/>").selectable().selectable("foo").remove(); + ok(true, 'arbitrary method called after init'); + + el = $("<div/>").selectable() + var foo = el.data("foo.selectable"); + el.remove(); + ok(true, 'arbitrary option getter after init'); + + $("<div/>").selectable().data("foo.selectable", "bar").remove(); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + expect(6); + + $("#selectable1").selectable().selectable("destroy").remove(); + ok(true, '.selectable("destroy") called on element'); + + $([]).selectable().selectable("destroy").remove(); + ok(true, '.selectable("destroy") called on empty collection'); + + $("<div/>").selectable().selectable("destroy").remove(); + ok(true, '.selectable("destroy") called on disconnected DOMElement'); + + $("<div/>").selectable().selectable("destroy").selectable("foo").remove(); + ok(true, 'arbitrary method called after destroy'); + + el = $("<div/>").selectable(); + var foo = el.selectable("destroy").data("foo.selectable"); + el.remove(); + ok(true, 'arbitrary option getter after destroy'); + + $("<div/>").selectable().selectable("destroy").data("foo.selectable", "bar").remove(); + ok(true, 'arbitrary option setter after destroy'); +}); + +test("defaults", function() { + el = $('#selectable1').selectable(); + var defaults = { + autoRefresh: true, + filter: '*' + }; + $.each(defaults, function(key, val) { + var actual = el.data(key + ".selectable"), expected = val, + method = (expected && expected.constructor == Object) ? + compare2 : equals; + method(actual, expected, key); + }); + el.remove(); +}); + +module("selectable: Options"); + +test("autoRefresh", function() { + expect(3); + el = $("#selectable1"); + var actual, sel = $("*", el), selected = function() { actual += 1 }; + + actual = 0; + el = $("#selectable1").selectable({ autoRefresh: false, selected: selected }); + sel.hide(); + drag(1000, 1000); + equals(actual, sel.length); + el.selectable("destroy"); + + actual = 0; + sel.show(); + el = $("#selectable1").selectable({ autoRefresh: true, selected: selected }); + sel.hide(); + drag(1000, 1000); + equals(actual, 0); + sel.show(); + drag(1000, 1000); + equals(actual, sel.length); + el.selectable("destroy"); + sel.show(); +}); + +test("filter", function() { + expect(2); + el = $("#selectable1"); + var actual, sel = $("*", el), selected = function() { actual += 1 }; + + actual = 0; + el = $("#selectable1").selectable({ filter: '.special', selected: selected }); + drag(1000, 1000); + ok(sel.length != 1, "this test assumes more than 1 selectee"); + equals(actual, 1); + el.selectable("destroy"); +}); + +module("selectable: Methods"); + +test("disable", function() { + expect(2); + var fired = false; + + el = $("#selectable1"); + el.selectable({ + disabled: false, + start: function() { fired = true; } + }); + el.simulate("drag", 20, 20); + equals(fired, true, "start fired"); + el.selectable("disable"); + fired = false; + el.simulate("drag", 20, 20); + equals(fired, false, "start fired"); + el.selectable("destroy"); +}); + +test("enable", function() { + expect(2); + var fired = false; + + el = $("#selectable1"); + el.selectable({ + disabled: true, + start: function() { fired = true; } + }); + el.simulate("drag", 20, 20); + equals(fired, false, "start fired"); + el.selectable("enable"); + el.simulate("drag", 20, 20); + equals(fired, true, "start fired"); + el.selectable("destroy"); +}); + +test("toggle", function() { + expect(2); + + el = $("#selectable1").selectable({ disabled: true }).selectable("toggle"); + equals(el.data("disabled.selectable"), false, "disabled -> enabled"); + el.selectable("destroy"); + + el = $("#selectable1").selectable({ disabled: false }).selectable("toggle"); + equals(el.data("disabled.selectable"), true, "enabled -> disabled"); + el.selectable("destroy"); +}); + +module("selectable: Callbacks"); + +test("start", function() { + expect(2); + el = $("#selectable1"); + el.selectable({ + start: function(ev, ui) { + ok(true, "drag fired start callback"); + equals(this, el[0], "context of callback"); + } + }); + el.simulate("drag", 20, 20); +}); + +test("stop", function() { + expect(2); + el = $("#selectable1"); + el.selectable({ + start: function(ev, ui) { + ok(true, "drag fired stop callback"); + equals(this, el[0], "context of callback"); + } + }); + el.simulate("drag", 20, 20); +}); + +module("selectable: Tickets"); + +})(jQuery); diff --git a/tests/simulate/jquery.simulate.js b/tests/simulate/jquery.simulate.js index b55687388..85deb23f9 100644 --- a/tests/simulate/jquery.simulate.js +++ b/tests/simulate/jquery.simulate.js @@ -1,152 +1,152 @@ -/*
- * jquery.simulate - simulate browser mouse and keyboard events
- *
- * Copyright (c) 2007 Eduardo Lundgren (eduardolundgren@gmail.com)
- * and Richard D. Worth (rdworth@gmail.com)
- *
- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
- *
- */
-
-;(function($) {
-
-$.fn.extend({
- simulate: function(type, options) {
- return this.each(function() {
- var opt = $.extend({}, $.simulate.defaults, options || {});
- new $.simulate(this, type, opt);
- });
- }
-});
-
-$.simulate = function(el, type, options) {
- this.target = el;
- this.options = options;
-
- if (/^drag$/.test(type)) {
- this[type].apply(this, [this.target, options]);
- } else {
- this.simulateEvent(el, type, options);
- }
-}
-
-$.extend($.simulate.prototype, {
- simulateEvent: function(el, type, options) {
- var evt = this.createEvent(type, options);
- this.dispatchEvent(el, type, evt, options);
- return evt;
- },
- createEvent: function(type, options) {
- if (/^mouse(over|out|down|up|move)|(dbl)?click$/.test(type)) {
- return this.mouseEvent(type, options);
- } else if (/^key(up|down|press)$/.test(type)) {
- return this.keyboardEvent(type, options);
- }
- },
- mouseEvent: function(type, options) {
- var evt;
- var e = $.extend({
- bubbles: true, cancelable: (type != "mousemove"), view: window, detail: 0,
- screenX: 0, screenY: 0, clientX: 0, clientY: 0,
- ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
- button: 0, relatedTarget: undefined
- }, options);
-
- var relatedTarget = $(e.relatedTarget)[0];
-
- if ($.isFunction(document.createEvent)) {
- evt = document.createEvent("MouseEvents");
- evt.initMouseEvent(type, e.bubbles, e.cancelable, e.view, e.detail,
- e.screenX, e.screenY, e.clientX, e.clientY,
- e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
- e.button, e.relatedTarget || document.body.parentNode);
- } else if (document.createEventObject) {
- evt = document.createEventObject();
- $.extend(evt, e);
- evt.button = { 0:1, 1:4, 2:2 }[evt.button] || evt.button;
- }
- return evt;
- },
- keyboardEvent: function(type, options) {
- var evt;
-
- var e = $.extend({ bubbles: true, cancelable: true, view: window,
- ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
- keyCode: 0, charCode: 0
- }, options);
-
- if ($.isFunction(document.createEvent)) {
- try {
- evt = document.createEvent("KeyEvents");
- evt.initKeyEvent(type, e.bubbles, e.cancelable, e.view,
- e.ctrlKey, e.altKey, e.shiftKey, e.metaKey,
- e.keyCode, e.charCode);
- } catch(err) {
- evt = document.createEvent("Events");
- evt.initEvent(type, e.bubbles, e.cancelable);
- $.extend(evt, { view: e.view,
- ctrlKey: e.ctrlKey, altKey: e.altKey, shiftKey: e.shiftKey, metaKey: e.metaKey,
- keyCode: e.keyCode, charCode: e.charCode
- });
- }
- } else if (document.createEventObject) {
- evt = document.createEventObject();
- $.extend(evt, e);
- }
- if ($.browser.msie || $.browser.opera) {
- evt.keyCode = (e.charCode > 0) ? e.charCode : e.keyCode;
- evt.charCode = undefined;
- }
- return evt;
- },
-
- dispatchEvent: function(el, type, evt) {
- if (el.dispatchEvent) {
- el.dispatchEvent(evt);
- } else if (el.fireEvent) {
- el.fireEvent('on' + type, evt);
- }
- return evt;
- },
-
- drag: function(el) {
- var self = this, center = this.findCenter(this.target),
- options = this.options, x = Math.floor(center.x), y = Math.floor(center.y),
- dx = options.dx || 0, dy = options.dy || 0, target = this.target;
- var coord = { clientX: x, clientY: y };
- this.simulateEvent(target, "mousedown", coord);
- coord = { clientX: x + 1, clientY: y + 1 };
- this.simulateEvent(document, "mousemove", coord);
- coord = { clientX: x + dx, clientY: y + dy };
- this.simulateEvent(document, "mousemove", coord);
- this.simulateEvent(document, "mousemove", coord);
- this.simulateEvent(target, "mouseup", coord);
- },
- findCenter: function(el) {
- var el = $(this.target), o = el.offset();
- return {
- x: o.left + el.outerWidth() / 2,
- y: o.top + el.outerHeight() / 2
- };
- }
-});
-
-$.extend($.simulate, {
- defaults: {
- speed: 'sync'
- },
- VK_TAB: 9,
- VK_ENTER: 13,
- VK_ESC: 27,
- VK_PGUP: 33,
- VK_PGDN: 34,
- VK_END: 35,
- VK_HOME: 36,
- VK_LEFT: 37,
- VK_UP: 38,
- VK_RIGHT: 39,
- VK_DOWN: 40
-});
-
-})(jQuery);
+/* + * jquery.simulate - simulate browser mouse and keyboard events + * + * Copyright (c) 2007 Eduardo Lundgren (eduardolundgren@gmail.com) + * and Richard D. Worth (rdworth@gmail.com) + * + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + */ + +;(function($) { + +$.fn.extend({ + simulate: function(type, options) { + return this.each(function() { + var opt = $.extend({}, $.simulate.defaults, options || {}); + new $.simulate(this, type, opt); + }); + } +}); + +$.simulate = function(el, type, options) { + this.target = el; + this.options = options; + + if (/^drag$/.test(type)) { + this[type].apply(this, [this.target, options]); + } else { + this.simulateEvent(el, type, options); + } +} + +$.extend($.simulate.prototype, { + simulateEvent: function(el, type, options) { + var evt = this.createEvent(type, options); + this.dispatchEvent(el, type, evt, options); + return evt; + }, + createEvent: function(type, options) { + if (/^mouse(over|out|down|up|move)|(dbl)?click$/.test(type)) { + return this.mouseEvent(type, options); + } else if (/^key(up|down|press)$/.test(type)) { + return this.keyboardEvent(type, options); + } + }, + mouseEvent: function(type, options) { + var evt; + var e = $.extend({ + bubbles: true, cancelable: (type != "mousemove"), view: window, detail: 0, + screenX: 0, screenY: 0, clientX: 0, clientY: 0, + ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, + button: 0, relatedTarget: undefined + }, options); + + var relatedTarget = $(e.relatedTarget)[0]; + + if ($.isFunction(document.createEvent)) { + evt = document.createEvent("MouseEvents"); + evt.initMouseEvent(type, e.bubbles, e.cancelable, e.view, e.detail, + e.screenX, e.screenY, e.clientX, e.clientY, + e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, + e.button, e.relatedTarget || document.body.parentNode); + } else if (document.createEventObject) { + evt = document.createEventObject(); + $.extend(evt, e); + evt.button = { 0:1, 1:4, 2:2 }[evt.button] || evt.button; + } + return evt; + }, + keyboardEvent: function(type, options) { + var evt; + + var e = $.extend({ bubbles: true, cancelable: true, view: window, + ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, + keyCode: 0, charCode: 0 + }, options); + + if ($.isFunction(document.createEvent)) { + try { + evt = document.createEvent("KeyEvents"); + evt.initKeyEvent(type, e.bubbles, e.cancelable, e.view, + e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, + e.keyCode, e.charCode); + } catch(err) { + evt = document.createEvent("Events"); + evt.initEvent(type, e.bubbles, e.cancelable); + $.extend(evt, { view: e.view, + ctrlKey: e.ctrlKey, altKey: e.altKey, shiftKey: e.shiftKey, metaKey: e.metaKey, + keyCode: e.keyCode, charCode: e.charCode + }); + } + } else if (document.createEventObject) { + evt = document.createEventObject(); + $.extend(evt, e); + } + if ($.browser.msie || $.browser.opera) { + evt.keyCode = (e.charCode > 0) ? e.charCode : e.keyCode; + evt.charCode = undefined; + } + return evt; + }, + + dispatchEvent: function(el, type, evt) { + if (el.dispatchEvent) { + el.dispatchEvent(evt); + } else if (el.fireEvent) { + el.fireEvent('on' + type, evt); + } + return evt; + }, + + drag: function(el) { + var self = this, center = this.findCenter(this.target), + options = this.options, x = Math.floor(center.x), y = Math.floor(center.y), + dx = options.dx || 0, dy = options.dy || 0, target = this.target; + var coord = { clientX: x, clientY: y }; + this.simulateEvent(target, "mousedown", coord); + coord = { clientX: x + 1, clientY: y + 1 }; + this.simulateEvent(document, "mousemove", coord); + coord = { clientX: x + dx, clientY: y + dy }; + this.simulateEvent(document, "mousemove", coord); + this.simulateEvent(document, "mousemove", coord); + this.simulateEvent(target, "mouseup", coord); + }, + findCenter: function(el) { + var el = $(this.target), o = el.offset(); + return { + x: o.left + el.outerWidth() / 2, + y: o.top + el.outerHeight() / 2 + }; + } +}); + +$.extend($.simulate, { + defaults: { + speed: 'sync' + }, + VK_TAB: 9, + VK_ENTER: 13, + VK_ESC: 27, + VK_PGUP: 33, + VK_PGDN: 34, + VK_END: 35, + VK_HOME: 36, + VK_LEFT: 37, + VK_UP: 38, + VK_RIGHT: 39, + VK_DOWN: 40 +}); + +})(jQuery); diff --git a/tests/sortable.html b/tests/sortable.html index d85b8eb61..0e48adf09 100644 --- a/tests/sortable.html +++ b/tests/sortable.html @@ -1,45 +1,45 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>jQuery UI Sortable Test Suite</title>
-
- <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
- <script type="text/javascript" src="../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../ui/ui.core.js"></script>
- <script type="text/javascript" src="../ui/ui.sortable.js"></script>
-
- <script type="text/javascript" src="qunit/testrunner.js"></script>
- <script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
- <script type="text/javascript" src="sortable.js"></script>
-
- <style type="text/css">
- html { border: 0; }
- #main {
- position:absolute !important;
- top: -1000px !important;
- left: -1000px !important;
- }
- </style>
-</head>
-<body>
-
-<h1 id="header">jQuery UI Sortable Test Suite</h1>
-<h2 id="banner"></h2>
-<h2 id="userAgent"></h2>
-
-<ol id="tests"></ol>
-
-<div id="main" style="border: 1px solid black; padding: 10px; margin: 10px;">
- <ul id="sortable">
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- </ul>
-</div>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Sortable Test Suite</title> + + <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen"> + + <script type="text/javascript" src="../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../ui/ui.core.js"></script> + <script type="text/javascript" src="../ui/ui.sortable.js"></script> + + <script type="text/javascript" src="qunit/testrunner.js"></script> + <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="sortable.js"></script> + + <style type="text/css"> + html { border: 0; } + #main { + position:absolute !important; + top: -1000px !important; + left: -1000px !important; + } + </style> +</head> +<body> + +<h1 id="header">jQuery UI Sortable Test Suite</h1> +<h2 id="banner"></h2> +<h2 id="userAgent"></h2> + +<ol id="tests"></ol> + +<div id="main" style="border: 1px solid black; padding: 10px; margin: 10px;"> + <ul id="sortable"> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + </ul> +</div> + +</body> +</html> diff --git a/tests/sortable.js b/tests/sortable.js index 7b79311a7..d3ab006cf 100644 --- a/tests/sortable.js +++ b/tests/sortable.js @@ -1,141 +1,141 @@ -/*
- * sortable unit tests
- */
-(function($) {
-//
-// Sortable Test Helper Functions
-//
-var el, offsetBefore, offsetAfter, dragged;
-
-var drag = function(handle, dx, dy) {
- offsetBefore = $(handle).offset();
- $(handle).simulate("drag", {
- dx: dx || 0,
- dy: dy || 0
- });
- dragged = { dx: dx, dy: dy };
- offsetAfter = $(handle).offset();
-}
-
-var sort = function(handle, dx, dy, index, msg) {
- drag(handle, dx, dy);
- equals($(handle).parent().children().index(handle), index, msg);
-}
-
-var border = function(el, side) { return parseInt(el.css('border-' + side + '-width')); }
-var margin = function(el, side) { return parseInt(el.css('margin-' + side)); }
-
-// Sortable Tests
-module("sortable");
-
-test("init", function() {
- expect(6);
-
- el = $("#sortable").sortable();
- ok(true, '.sortable() called on element');
-
- $([]).sortable();
- ok(true, '.sortable() called on empty collection');
-
- $("<div/>").sortable();
- ok(true, '.sortable() called on disconnected DOMElement');
-
- $("<div/>").sortable().sortable("foo");
- ok(true, 'arbitrary method called after init');
-
- $("<div/>").sortable().data("foo.sortable");
- ok(true, 'arbitrary option getter after init');
-
- $("<div/>").sortable().data("foo.sortable", "bar");
- ok(true, 'arbitrary option setter after init');
-});
-
-test("destroy", function() {
- expect(6);
-
- $("#sortable").sortable().sortable("destroy");
- ok(true, '.sortable("destroy") called on element');
-
- $([]).sortable().sortable("destroy");
- ok(true, '.sortable("destroy") called on empty collection');
-
- $("<div/>").sortable().sortable("destroy");
- ok(true, '.sortable("destroy") called on disconnected DOMElement');
-
- $("<div/>").sortable().sortable("destroy").sortable("foo");
- ok(true, 'arbitrary method called after destroy');
-
- $("<div/>").sortable().sortable("destroy").data("foo.sortable");
- ok(true, 'arbitrary option getter after destroy');
-
- $("<div/>").sortable().sortable("destroy").data("foo.sortable", "bar");
- ok(true, 'arbitrary option setter after destroy');
-});
-
-test("enable", function() {
- expect(4);
- el = $("#sortable").sortable({ disabled: true });
-
- sort($("li", el)[0], 0, 40, 0, '.sortable({ disabled: true })');
-
- el.sortable("enable");
- equals(el.data("disabled.sortable"), false, "disabled.sortable getter");
-
- el.sortable("destroy");
- el.sortable({ disabled: true });
- el.data("disabled.sortable", false);
- equals(el.data("disabled.sortable"), false, "disabled.sortable setter");
-
- sort($("li", el)[0], 0, 40, 2, '.data("disabled.sortable", false)');
-});
-
-test("disable", function() {
- expect(5);
- el = $("#sortable").sortable({ disabled: false });
- sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })');
-
- el.sortable("disable");
- sort($("li", el)[0], 0, 40, 0, 'disabled.sortable getter');
-
- el.sortable("destroy");
-
- el.sortable({ disabled: false });
- sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })');
- el.data("disabled.sortable", true);
- equals(el.data("disabled.sortable"), true, "disabled.sortable setter");
- sort($("li", el)[0], 0, 40, 0, '.data("disabled.sortable", true)');
-});
-
-test("defaults", function() {
- el = $("#sortable").sortable();
-
- equals(el.data("helper.sortable"), "original", "helper");
- equals(el.data("tolerance.sortable"), "guess", "tolerance");
- equals(el.data("distance.sortable"), 1, "distance");
- equals(el.data("disabled.sortable"), false, "disabled");
- equals(el.data("delay.sortable"), 0, "delay");
- equals(el.data("scroll.sortable"), true, "scroll");
- equals(el.data("scrollSensitivity.sortable"), 20, "scrollSensitivity");
- equals(el.data("scrollSpeed.sortable"), 20, "scrollSpeed");
- equals(el.data("cancel.sortable"), ":input", "cancel");
- equals(el.data("items.sortable"), "> *", "items");
- equals(el.data("zIndex.sortable"), 1000, "zIndex");
- equals(el.data("dropOnEmpty.sortable"), true, "dropOnEmpty");
- equals(el.data("appendTo.sortable"), "parent", "appendTo");
-
-});
-
-test("#3019: Stop fires too early", function() {
-
- var helper = null;
- el = $("#sortable").sortable({ stop: function(e, ui) {
- helper = ui.helper;
- }});
-
- sort($("li", el)[0], 0, 40, 2, 'Dragging the sortable');
- equals(helper, null, "helper should be false");
-
-});
-
-
-})(jQuery);
+/* + * sortable unit tests + */ +(function($) { +// +// Sortable Test Helper Functions +// +var el, offsetBefore, offsetAfter, dragged; + +var drag = function(handle, dx, dy) { + offsetBefore = $(handle).offset(); + $(handle).simulate("drag", { + dx: dx || 0, + dy: dy || 0 + }); + dragged = { dx: dx, dy: dy }; + offsetAfter = $(handle).offset(); +} + +var sort = function(handle, dx, dy, index, msg) { + drag(handle, dx, dy); + equals($(handle).parent().children().index(handle), index, msg); +} + +var border = function(el, side) { return parseInt(el.css('border-' + side + '-width')); } +var margin = function(el, side) { return parseInt(el.css('margin-' + side)); } + +// Sortable Tests +module("sortable"); + +test("init", function() { + expect(6); + + el = $("#sortable").sortable(); + ok(true, '.sortable() called on element'); + + $([]).sortable(); + ok(true, '.sortable() called on empty collection'); + + $("<div/>").sortable(); + ok(true, '.sortable() called on disconnected DOMElement'); + + $("<div/>").sortable().sortable("foo"); + ok(true, 'arbitrary method called after init'); + + $("<div/>").sortable().data("foo.sortable"); + ok(true, 'arbitrary option getter after init'); + + $("<div/>").sortable().data("foo.sortable", "bar"); + ok(true, 'arbitrary option setter after init'); +}); + +test("destroy", function() { + expect(6); + + $("#sortable").sortable().sortable("destroy"); + ok(true, '.sortable("destroy") called on element'); + + $([]).sortable().sortable("destroy"); + ok(true, '.sortable("destroy") called on empty collection'); + + $("<div/>").sortable().sortable("destroy"); + ok(true, '.sortable("destroy") called on disconnected DOMElement'); + + $("<div/>").sortable().sortable("destroy").sortable("foo"); + ok(true, 'arbitrary method called after destroy'); + + $("<div/>").sortable().sortable("destroy").data("foo.sortable"); + ok(true, 'arbitrary option getter after destroy'); + + $("<div/>").sortable().sortable("destroy").data("foo.sortable", "bar"); + ok(true, 'arbitrary option setter after destroy'); +}); + +test("enable", function() { + expect(4); + el = $("#sortable").sortable({ disabled: true }); + + sort($("li", el)[0], 0, 40, 0, '.sortable({ disabled: true })'); + + el.sortable("enable"); + equals(el.data("disabled.sortable"), false, "disabled.sortable getter"); + + el.sortable("destroy"); + el.sortable({ disabled: true }); + el.data("disabled.sortable", false); + equals(el.data("disabled.sortable"), false, "disabled.sortable setter"); + + sort($("li", el)[0], 0, 40, 2, '.data("disabled.sortable", false)'); +}); + +test("disable", function() { + expect(5); + el = $("#sortable").sortable({ disabled: false }); + sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })'); + + el.sortable("disable"); + sort($("li", el)[0], 0, 40, 0, 'disabled.sortable getter'); + + el.sortable("destroy"); + + el.sortable({ disabled: false }); + sort($("li", el)[0], 0, 40, 2, '.sortable({ disabled: false })'); + el.data("disabled.sortable", true); + equals(el.data("disabled.sortable"), true, "disabled.sortable setter"); + sort($("li", el)[0], 0, 40, 0, '.data("disabled.sortable", true)'); +}); + +test("defaults", function() { + el = $("#sortable").sortable(); + + equals(el.data("helper.sortable"), "original", "helper"); + equals(el.data("tolerance.sortable"), "guess", "tolerance"); + equals(el.data("distance.sortable"), 1, "distance"); + equals(el.data("disabled.sortable"), false, "disabled"); + equals(el.data("delay.sortable"), 0, "delay"); + equals(el.data("scroll.sortable"), true, "scroll"); + equals(el.data("scrollSensitivity.sortable"), 20, "scrollSensitivity"); + equals(el.data("scrollSpeed.sortable"), 20, "scrollSpeed"); + equals(el.data("cancel.sortable"), ":input", "cancel"); + equals(el.data("items.sortable"), "> *", "items"); + equals(el.data("zIndex.sortable"), 1000, "zIndex"); + equals(el.data("dropOnEmpty.sortable"), true, "dropOnEmpty"); + equals(el.data("appendTo.sortable"), "parent", "appendTo"); + +}); + +test("#3019: Stop fires too early", function() { + + var helper = null; + el = $("#sortable").sortable({ stop: function(e, ui) { + helper = ui.helper; + }}); + + sort($("li", el)[0], 0, 40, 2, 'Dragging the sortable'); + equals(helper, null, "helper should be false"); + +}); + + +})(jQuery); diff --git a/tests/spinner.html b/tests/spinner.html index c8b1f0dee..e9b2f0058 100644 --- a/tests/spinner.html +++ b/tests/spinner.html @@ -1,39 +1,39 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>jQuery UI Spinner Test Suite</title>
-
- <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen">
-
- <script type="text/javascript" src="../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../ui/ui.core.js"></script>
- <script type="text/javascript" src="../ui/ui.spinner.js"></script>
-
- <script type="text/javascript" src="qunit/testrunner.js"></script>
- <script type="text/javascript" src="simulate/jquery.simulate.js"></script>
-
- <script type="text/javascript" src="spinner.js"></script>
-
- <style type="text/css">
-
-
-
- </style>
-
-
-
-</head>
-<body>
-
-<h1 id="header">jQuery UI Spinner Test Suite</h1>
-<h2 id="banner"></h2>
-<h2 id="userAgent"></h2>
-
-<ol id="tests"></ol>
-
-<div id="main" style="position:absolute;top:-20000px">
- <input type="text" id="spin" />
-</div>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Spinner Test Suite</title> + + <link rel="stylesheet" href="qunit/testsuite.css" type="text/css" media="screen"> + + <script type="text/javascript" src="../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../ui/ui.core.js"></script> + <script type="text/javascript" src="../ui/ui.spinner.js"></script> + + <script type="text/javascript" src="qunit/testrunner.js"></script> + <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="spinner.js"></script> + + <style type="text/css"> + + + + </style> + + + +</head> +<body> + +<h1 id="header">jQuery UI Spinner Test Suite</h1> +<h2 id="banner"></h2> +<h2 id="userAgent"></h2> + +<ol id="tests"></ol> + +<div id="main" style="position:absolute;top:-20000px"> + <input type="text" id="spin" /> +</div> + +</body> +</html> diff --git a/tests/spinner.js b/tests/spinner.js index ceb14a618..533034a95 100644 --- a/tests/spinner.js +++ b/tests/spinner.js @@ -1,311 +1,311 @@ -/*
- * spinner unit tests
- */
-(function($) {
-
-// Spinner Tests
-module("spinner");
-
-test("init", function() {
- expect(2);
-
- $("#spin").spinner();
- ok(true, '.spinner() called on element');
-
- $('<input id="spinner_dis">').spinner().remove();
- ok(true, '.spinner() called on disconnected element');
-
-});
-
-test("destroy", function() {
- expect(2);
-
- $("#spin").spinner().spinner("destroy");
- ok(true, '.spinner("destroy") called on element');
-
- $('<input id="spinner_dis">').spinner().spinner("destroy").remove();
- ok(true, '.spinner().spinner("destroy") called on disconnected element');
-
-});
-
-test("re-attach", function() {
- expect(2);
-
- el = $("#spin").spinner().spinner("destroy").spinner();
- ok(true, '.spinner().spinner("destroy").spinner() called on element');
-
- $('<input id="spinner_dis">').spinner().spinner("destroy").spinner().remove();
- ok(true, '.spinner().spinner("destroy").spinner() called on disconnected element');
-
-});
-
-test("disable", function() {
- expect(1);
-
- $("#spin").spinner().spinner("disable");
- ok(true, '.spinner("disable") called on element');
-
-});
-
-test("enable", function() {
- expect(1);
-
- $("#spin").spinner().spinner("disable").spinner("enable");
- ok(true, '.spinner("enable") called on element');
-
-});
-
-test("defaults", function() {
- expect(7);
- el = $("#spin").spinner();
-
- equals(el.data("currency.spinner"), false, "currency");
- equals(el.data("disabled.spinner"), false, "disabled");
- equals(el.data("incremental.spinner"), true, "incremental");
- equals(el.data("max.spinner"), undefined, "max");
- equals(el.data("min.spinner"), undefined, "min");
- equals(el.data("start.spinner"), 0, "start");
- equals(el.data("stepping.spinner"), 1, "stepping");
-
-});
-
-test("set defaults on init", function() {
- expect(7);
- el = $("#spin").spinner({ currency:"", disabled:true, incremental:false, max:200, min:-100, start:50, stepping:2 });
-
- equals(el.data("currency.spinner"), "", "currency");
- equals(el.data("disabled.spinner"), true, "disabled");
- equals(el.data("incremental.spinner"), false, "incremental");
- equals(el.data("max.spinner"), 200, "max");
- equals(el.data("min.spinner"), -100, "min");
- equals(el.data("start.spinner"), 50, "start");
- equals(el.data("stepping.spinner"), 2, "stepping");
-
-});
-
-test("keydown on input", function() {
- expect(6);
- el = $("#spin").spinner();
-
- equals(el.val(), 0, "start number");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_UP})
- .simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(el.val(), 1, "Up key");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_RIGHT})
- .simulate("keyup",{keyCode:$.simulate.VK_RIGHT});
-
- equals(el.val(), 1, "Right key");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_HOME})
- .simulate("keyup",{keyCode:$.simulate.VK_HOME});
-
- equals(el.val(), 0, "Home key to start");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_DOWN})
- .simulate("keyup",{keyCode:$.simulate.VK_DOWN});
-
- equals(el.val(), -1, "Down Key");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_LEFT})
- .simulate("keyup",{keyCode:$.simulate.VK_LEFT});
-
- equals(el.val(), -1, "Left Key");
-
-});
-
-test("keydown on input with options", function() {
- expect(4);
-
- el = $("#spin").spinner({ incremental:false, max:200, min:-100, start:50, stepping:10 });
-
- equals(el.val(), 50, "start number");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_UP})
- .simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(el.val(), 60, "stepping 10 on 50");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_END})
- .simulate("keyup",{keyCode:$.simulate.VK_END});
-
- equals(el.val(), 200, "End key to max");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_HOME})
- .simulate("keyup",{keyCode:$.simulate.VK_HOME});
-
- equals(el.val(), -100, "Home key to min");
-
-
-});
-
-test("currency and decimal options", function() {
- expect(5);
-
- el = $("#spin").spinner({ currency:"$", incremental:false, max:120, min:-50, stepping:0.3 });
-
- equals(el.val(), "$0.00", "start number");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_UP})
- .simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(el.val(), "$0.30", "stepping 0.30");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_END})
- .simulate("keyup",{keyCode:$.simulate.VK_END});
-
- equals(el.val(), "$120.00", "End key to max");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_HOME})
- .simulate("keyup",{keyCode:$.simulate.VK_HOME});
-
- equals(el.val(), "-$50.00", "Home key to min");
-
- for ( var i = 1 ; i<=120 ; i++ ) {
- el.simulate("keydown",{keyCode:$.simulate.VK_UP});
- }
-
- el.simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(el.val(), "-$14.00", "keydown 120 times");
-
-});
-
-test("decimal options", function() {
- expect(3);
-
- el = $("#spin").spinner({ currency:false, incremental:false, stepping:0.7 });
-
- equals(el.val(), "0.0", "start number");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_DOWN})
- .simulate("keyup",{keyCode:$.simulate.VK_DOWN});
-
- equals(el.val(), "-0.7", "stepping 0.7");
-
- for ( var i = 1 ; i<=11 ; i++ ) {
- el.simulate("keydown",{keyCode:$.simulate.VK_UP});
- }
-
- el.simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(el.val(), "7.0", "keydown 11 times");
-
-});
-
-test("spin without auto-incremental stepping", function() {
- expect(2);
-
- el = $("#spin").spinner({ incremental:false });
-
- for ( var i = 1 ; i<=120 ; i++ ) {
- el.simulate("keydown",{keyCode:$.simulate.VK_UP});
- }
-
- el.simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(el.val(), 120, "keydown 120 times");
-
- for ( var i = 1 ; i<=210 ; i++ ) {
- el.simulate("keydown",{keyCode:$.simulate.VK_DOWN});
- }
-
- el.simulate("keyup",{keyCode:$.simulate.VK_DOWN});
-
- equals(el.val(), -90, "keydown 210 times");
-
-});
-
-test("spin with auto-incremental stepping", function() {
- expect(2);
-
- el = $("#spin").spinner();
-
- for ( var i = 1 ; i<=120 ; i++ ) {
- el.simulate("keydown",{keyCode:$.simulate.VK_UP});
- }
-
- el.simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(el.val(), 300, "keydown 120 times (100+20*10)");
-
- for ( var i = 1 ; i<=210 ; i++ ) {
- el.simulate("keydown",{keyCode:$.simulate.VK_DOWN});
- }
-
- el.simulate("keyup",{keyCode:$.simulate.VK_DOWN});
-
- equals(el.val(), -1800, "keydown 210 times (300-100-100*10-10*100)");
-
-});
-
-test("mouse click on buttons", function() {
- expect(4);
- el = $("#spin").spinner();
-
- $(".ui-spinner-up").trigger("mousedown").trigger("mouseup");
-
- equals(el.val(), 1, "mouse click to up");
-
- $(".ui-spinner-up").trigger("dblclick");
-
- equals(el.val(), 2, "mouse double click to up");
-
- $(".ui-spinner-down").trigger("mousedown").trigger("mouseup");
-
- equals(el.val(), 1, "mouse click to down");
-
- $(".ui-spinner-down").trigger("dblclick");
-
- equals(el.val(), 0, "mouse double click to down");
-
-
-});
-
-test("callback", function() {
- expect(4);
-
- var s = c = d = u = 0;
-
- el = $("#spin").spinner({
- spin: function(){
- s++;
- },
- change: function(){
- c++;
- },
- up: function(){
- u++;
- },
- down: function(){
- d++;
- }
- });
-
- el.simulate("keydown",{keyCode:$.simulate.VK_UP}).simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(u, 1, "Up 1 time");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_DOWN}).simulate("keyup",{keyCode:$.simulate.VK_DOWN});
-
- equals(d, 1, "Down 1 time");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_UP}).simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(s, 3, "Spin 3 times");
-
- el.simulate("keydown",{keyCode:$.simulate.VK_UP}).simulate("keyup",{keyCode:$.simulate.VK_UP});
-
- equals(c, 4, "Change 4 times");
-
-});
-
-test("mouse wheel on input", function() {
- expect(0);
-
-
-});
-
-})(jQuery);
+/* + * spinner unit tests + */ +(function($) { + +// Spinner Tests +module("spinner"); + +test("init", function() { + expect(2); + + $("#spin").spinner(); + ok(true, '.spinner() called on element'); + + $('<input id="spinner_dis">').spinner().remove(); + ok(true, '.spinner() called on disconnected element'); + +}); + +test("destroy", function() { + expect(2); + + $("#spin").spinner().spinner("destroy"); + ok(true, '.spinner("destroy") called on element'); + + $('<input id="spinner_dis">').spinner().spinner("destroy").remove(); + ok(true, '.spinner().spinner("destroy") called on disconnected element'); + +}); + +test("re-attach", function() { + expect(2); + + el = $("#spin").spinner().spinner("destroy").spinner(); + ok(true, '.spinner().spinner("destroy").spinner() called on element'); + + $('<input id="spinner_dis">').spinner().spinner("destroy").spinner().remove(); + ok(true, '.spinner().spinner("destroy").spinner() called on disconnected element'); + +}); + +test("disable", function() { + expect(1); + + $("#spin").spinner().spinner("disable"); + ok(true, '.spinner("disable") called on element'); + +}); + +test("enable", function() { + expect(1); + + $("#spin").spinner().spinner("disable").spinner("enable"); + ok(true, '.spinner("enable") called on element'); + +}); + +test("defaults", function() { + expect(7); + el = $("#spin").spinner(); + + equals(el.data("currency.spinner"), false, "currency"); + equals(el.data("disabled.spinner"), false, "disabled"); + equals(el.data("incremental.spinner"), true, "incremental"); + equals(el.data("max.spinner"), undefined, "max"); + equals(el.data("min.spinner"), undefined, "min"); + equals(el.data("start.spinner"), 0, "start"); + equals(el.data("stepping.spinner"), 1, "stepping"); + +}); + +test("set defaults on init", function() { + expect(7); + el = $("#spin").spinner({ currency:"", disabled:true, incremental:false, max:200, min:-100, start:50, stepping:2 }); + + equals(el.data("currency.spinner"), "", "currency"); + equals(el.data("disabled.spinner"), true, "disabled"); + equals(el.data("incremental.spinner"), false, "incremental"); + equals(el.data("max.spinner"), 200, "max"); + equals(el.data("min.spinner"), -100, "min"); + equals(el.data("start.spinner"), 50, "start"); + equals(el.data("stepping.spinner"), 2, "stepping"); + +}); + +test("keydown on input", function() { + expect(6); + el = $("#spin").spinner(); + + equals(el.val(), 0, "start number"); + + el.simulate("keydown",{keyCode:$.simulate.VK_UP}) + .simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(el.val(), 1, "Up key"); + + el.simulate("keydown",{keyCode:$.simulate.VK_RIGHT}) + .simulate("keyup",{keyCode:$.simulate.VK_RIGHT}); + + equals(el.val(), 1, "Right key"); + + el.simulate("keydown",{keyCode:$.simulate.VK_HOME}) + .simulate("keyup",{keyCode:$.simulate.VK_HOME}); + + equals(el.val(), 0, "Home key to start"); + + el.simulate("keydown",{keyCode:$.simulate.VK_DOWN}) + .simulate("keyup",{keyCode:$.simulate.VK_DOWN}); + + equals(el.val(), -1, "Down Key"); + + el.simulate("keydown",{keyCode:$.simulate.VK_LEFT}) + .simulate("keyup",{keyCode:$.simulate.VK_LEFT}); + + equals(el.val(), -1, "Left Key"); + +}); + +test("keydown on input with options", function() { + expect(4); + + el = $("#spin").spinner({ incremental:false, max:200, min:-100, start:50, stepping:10 }); + + equals(el.val(), 50, "start number"); + + el.simulate("keydown",{keyCode:$.simulate.VK_UP}) + .simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(el.val(), 60, "stepping 10 on 50"); + + el.simulate("keydown",{keyCode:$.simulate.VK_END}) + .simulate("keyup",{keyCode:$.simulate.VK_END}); + + equals(el.val(), 200, "End key to max"); + + el.simulate("keydown",{keyCode:$.simulate.VK_HOME}) + .simulate("keyup",{keyCode:$.simulate.VK_HOME}); + + equals(el.val(), -100, "Home key to min"); + + +}); + +test("currency and decimal options", function() { + expect(5); + + el = $("#spin").spinner({ currency:"$", incremental:false, max:120, min:-50, stepping:0.3 }); + + equals(el.val(), "$0.00", "start number"); + + el.simulate("keydown",{keyCode:$.simulate.VK_UP}) + .simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(el.val(), "$0.30", "stepping 0.30"); + + el.simulate("keydown",{keyCode:$.simulate.VK_END}) + .simulate("keyup",{keyCode:$.simulate.VK_END}); + + equals(el.val(), "$120.00", "End key to max"); + + el.simulate("keydown",{keyCode:$.simulate.VK_HOME}) + .simulate("keyup",{keyCode:$.simulate.VK_HOME}); + + equals(el.val(), "-$50.00", "Home key to min"); + + for ( var i = 1 ; i<=120 ; i++ ) { + el.simulate("keydown",{keyCode:$.simulate.VK_UP}); + } + + el.simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(el.val(), "-$14.00", "keydown 120 times"); + +}); + +test("decimal options", function() { + expect(3); + + el = $("#spin").spinner({ currency:false, incremental:false, stepping:0.7 }); + + equals(el.val(), "0.0", "start number"); + + el.simulate("keydown",{keyCode:$.simulate.VK_DOWN}) + .simulate("keyup",{keyCode:$.simulate.VK_DOWN}); + + equals(el.val(), "-0.7", "stepping 0.7"); + + for ( var i = 1 ; i<=11 ; i++ ) { + el.simulate("keydown",{keyCode:$.simulate.VK_UP}); + } + + el.simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(el.val(), "7.0", "keydown 11 times"); + +}); + +test("spin without auto-incremental stepping", function() { + expect(2); + + el = $("#spin").spinner({ incremental:false }); + + for ( var i = 1 ; i<=120 ; i++ ) { + el.simulate("keydown",{keyCode:$.simulate.VK_UP}); + } + + el.simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(el.val(), 120, "keydown 120 times"); + + for ( var i = 1 ; i<=210 ; i++ ) { + el.simulate("keydown",{keyCode:$.simulate.VK_DOWN}); + } + + el.simulate("keyup",{keyCode:$.simulate.VK_DOWN}); + + equals(el.val(), -90, "keydown 210 times"); + +}); + +test("spin with auto-incremental stepping", function() { + expect(2); + + el = $("#spin").spinner(); + + for ( var i = 1 ; i<=120 ; i++ ) { + el.simulate("keydown",{keyCode:$.simulate.VK_UP}); + } + + el.simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(el.val(), 300, "keydown 120 times (100+20*10)"); + + for ( var i = 1 ; i<=210 ; i++ ) { + el.simulate("keydown",{keyCode:$.simulate.VK_DOWN}); + } + + el.simulate("keyup",{keyCode:$.simulate.VK_DOWN}); + + equals(el.val(), -1800, "keydown 210 times (300-100-100*10-10*100)"); + +}); + +test("mouse click on buttons", function() { + expect(4); + el = $("#spin").spinner(); + + $(".ui-spinner-up").trigger("mousedown").trigger("mouseup"); + + equals(el.val(), 1, "mouse click to up"); + + $(".ui-spinner-up").trigger("dblclick"); + + equals(el.val(), 2, "mouse double click to up"); + + $(".ui-spinner-down").trigger("mousedown").trigger("mouseup"); + + equals(el.val(), 1, "mouse click to down"); + + $(".ui-spinner-down").trigger("dblclick"); + + equals(el.val(), 0, "mouse double click to down"); + + +}); + +test("callback", function() { + expect(4); + + var s = c = d = u = 0; + + el = $("#spin").spinner({ + spin: function(){ + s++; + }, + change: function(){ + c++; + }, + up: function(){ + u++; + }, + down: function(){ + d++; + } + }); + + el.simulate("keydown",{keyCode:$.simulate.VK_UP}).simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(u, 1, "Up 1 time"); + + el.simulate("keydown",{keyCode:$.simulate.VK_DOWN}).simulate("keyup",{keyCode:$.simulate.VK_DOWN}); + + equals(d, 1, "Down 1 time"); + + el.simulate("keydown",{keyCode:$.simulate.VK_UP}).simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(s, 3, "Spin 3 times"); + + el.simulate("keydown",{keyCode:$.simulate.VK_UP}).simulate("keyup",{keyCode:$.simulate.VK_UP}); + + equals(c, 4, "Change 4 times"); + +}); + +test("mouse wheel on input", function() { + expect(0); + + +}); + +})(jQuery); diff --git a/tests/visual/all.css b/tests/visual/all.css index 7f49f20af..afa86e6c3 100644 --- a/tests/visual/all.css +++ b/tests/visual/all.css @@ -1,80 +1,80 @@ -
-body { margin: 0; padding: 20px; background: black; }
-ul.plugins { margin: 0; padding: 0; }
-ul.plugins li { margin: 0 12px 12px 0;
- list-style-type: none; width: 210px; height: 220px; float: left;
- color: white; border: 1px solid gray; text-align: center; font-weight: bold; }
-
-#accordion, #draggable,
-#resizable, #selectable, #sortable, #tabs {
- margin: 10px;
- width: 190px; height: 180px;
- text-align: center;
- background: #FF9C08; color: white; font-weight: bold;
-}
-#selectable div {
- width: 45px; height: 45px; float: left; margin: 6px;
- border: 1px solid white;
-}
-#selectable .ui-selecting {
- background: gray;
-}
-#selectable .ui-selected {
- background: black;
-}
-#sortable div {
- width: 45px; height: 45px; float: left; margin: 6px;
- border: 1px solid white;
-}
-#sortable .ui-sortable-helper {
- background: black;
-}
-
-.draggable { margin: 10px; width: 32px; height: 30px; float: left; background: #FF9C08; }
-#droppable { margin: 10px; width: 190px; height: 130px; float: left; border: 1px solid #FF9C08; overflow: hidden; }
-#droppable .draggable { margin: 7px; }
-
-.ui-dialog { background-color: #FF9C08; }
-.ui-dialog .ui-dialog-titlebar { background: black; padding: 0px; height: 28px; _height: 29px; }
-.ui-dialog.ui-draggable .ui-dialog-titlebar { cursor: move; }
-
-.ui-dialog .ui-dialog-titlebar-close {
- width: 16px; height: 16px; position: absolute; top: 6px; right: 7px;
- cursor: default; color: white;
-}
-
-.ui-dialog .ui-dialog-titlebar-close-hover { color: #FF9C08; }
-
-.ui-dialog .ui-dialog-title {
- margin-left: 5px; color: white; font-weight: bold;
- position: relative; top: 7px; left: 4px;
-}
-
-.ui-dialog .ui-dialog-content {
- margin: 1.2em;
-}
-
-.ui-dialog .ui-dialog-buttonpane {
- position: absolute;
- bottom: 8px;
- right: 12px;
- width: 100%;
- text-align: right;
-}
-
-.ui-dialog .ui-dialog-buttonpane button {
- margin: 6px;
-}
-
-/* Dialog handle styles */
-.ui-dialog .ui-resizable-n { cursor: n-resize; height: 6px; width: 100%; top: 0px; left: 0px; background: gray !important; border: none !important; }
-.ui-dialog .ui-resizable-s { cursor: s-resize; height: 8px; width: 100%; bottom: 0px; left: 0px; background: gray !important; border: none !important; }
-.ui-dialog .ui-resizable-e { cursor: e-resize; width: 7px; right: 0px; top: 0px; height: 100%; background: gray !important; border: none !important; }
-.ui-dialog .ui-resizable-w { cursor: w-resize; width: 7px; left: 0px; top: 0px; height: 100%; background: gray !important; border: none !important; }
-.ui-dialog .ui-resizable-se { cursor: se-resize; width: 9px; height: 9px; right: 0px; bottom: 0px; background: gray !important; border: none !important; }
-.ui-dialog .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: 0px; bottom: 0px; background: gray !important; border: none !important; }
-.ui-dialog .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 29px; left: 0px; top: 0px; background: gray !important; border: none !important; }
-.ui-dialog .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 29px; right: 0px; top: 0px; background: gray !important; border: none !important; }
-
-.ui-slider { margin: 10px; background: #FF9C08; height: 15px; position: relative; }
-.ui-slider-handle { width: 10px; height: 15px; background: white; position: absolute; top: 0px; left: 0px; }
+ +body { margin: 0; padding: 20px; background: black; } +ul.plugins { margin: 0; padding: 0; } +ul.plugins li { margin: 0 12px 12px 0; + list-style-type: none; width: 210px; height: 220px; float: left; + color: white; border: 1px solid gray; text-align: center; font-weight: bold; } + +#accordion, #draggable, +#resizable, #selectable, #sortable, #tabs { + margin: 10px; + width: 190px; height: 180px; + text-align: center; + background: #FF9C08; color: white; font-weight: bold; +} +#selectable div { + width: 45px; height: 45px; float: left; margin: 6px; + border: 1px solid white; +} +#selectable .ui-selecting { + background: gray; +} +#selectable .ui-selected { + background: black; +} +#sortable div { + width: 45px; height: 45px; float: left; margin: 6px; + border: 1px solid white; +} +#sortable .ui-sortable-helper { + background: black; +} + +.draggable { margin: 10px; width: 32px; height: 30px; float: left; background: #FF9C08; } +#droppable { margin: 10px; width: 190px; height: 130px; float: left; border: 1px solid #FF9C08; overflow: hidden; } +#droppable .draggable { margin: 7px; } + +.ui-dialog { background-color: #FF9C08; } +.ui-dialog .ui-dialog-titlebar { background: black; padding: 0px; height: 28px; _height: 29px; } +.ui-dialog.ui-draggable .ui-dialog-titlebar { cursor: move; } + +.ui-dialog .ui-dialog-titlebar-close { + width: 16px; height: 16px; position: absolute; top: 6px; right: 7px; + cursor: default; color: white; +} + +.ui-dialog .ui-dialog-titlebar-close-hover { color: #FF9C08; } + +.ui-dialog .ui-dialog-title { + margin-left: 5px; color: white; font-weight: bold; + position: relative; top: 7px; left: 4px; +} + +.ui-dialog .ui-dialog-content { + margin: 1.2em; +} + +.ui-dialog .ui-dialog-buttonpane { + position: absolute; + bottom: 8px; + right: 12px; + width: 100%; + text-align: right; +} + +.ui-dialog .ui-dialog-buttonpane button { + margin: 6px; +} + +/* Dialog handle styles */ +.ui-dialog .ui-resizable-n { cursor: n-resize; height: 6px; width: 100%; top: 0px; left: 0px; background: gray !important; border: none !important; } +.ui-dialog .ui-resizable-s { cursor: s-resize; height: 8px; width: 100%; bottom: 0px; left: 0px; background: gray !important; border: none !important; } +.ui-dialog .ui-resizable-e { cursor: e-resize; width: 7px; right: 0px; top: 0px; height: 100%; background: gray !important; border: none !important; } +.ui-dialog .ui-resizable-w { cursor: w-resize; width: 7px; left: 0px; top: 0px; height: 100%; background: gray !important; border: none !important; } +.ui-dialog .ui-resizable-se { cursor: se-resize; width: 9px; height: 9px; right: 0px; bottom: 0px; background: gray !important; border: none !important; } +.ui-dialog .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: 0px; bottom: 0px; background: gray !important; border: none !important; } +.ui-dialog .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 29px; left: 0px; top: 0px; background: gray !important; border: none !important; } +.ui-dialog .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 29px; right: 0px; top: 0px; background: gray !important; border: none !important; } + +.ui-slider { margin: 10px; background: #FF9C08; height: 15px; position: relative; } +.ui-slider-handle { width: 10px; height: 15px; background: white; position: absolute; top: 0px; left: 0px; } diff --git a/tests/visual/all.html b/tests/visual/all.html index 23eb00acc..09897b62f 100644 --- a/tests/visual/all.html +++ b/tests/visual/all.html @@ -1,107 +1,107 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple All</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <link rel="stylesheet" href="../../themes/ui.datepicker.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.accordion.js"></script>
- <script type="text/javascript" src="../../ui/ui.datepicker.js"></script>
- <script type="text/javascript" src="../../ui/ui.dialog.js"></script>
- <script type="text/javascript" src="../../ui/ui.draggable.js"></script>
- <script type="text/javascript" src="../../ui/ui.droppable.js"></script>
- <script type="text/javascript" src="../../ui/ui.resizable.js"></script>
- <script type="text/javascript" src="../../ui/ui.selectable.js"></script>
- <script type="text/javascript" src="../../ui/ui.slider.js"></script>
- <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
- <script type="text/javascript" src="../../ui/ui.tabs.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#datepicker").datepicker();
- $("#dialog").click(function() { $("<div/>").dialog(); });
- $("#draggable").draggable();
- $(".draggable").draggable();
- $("#droppable").droppable({
- accept: '.draggable',
- drop: function(ev, ui) {
- ui.draggable.css({ position: 'relative', top: 0, left: 0 }).clone().appendTo(this);
- }
- });
- $("#resizable").resizable();
- $("#selectable").selectable();
- $("#slider").slider();
- $("#sortable").sortable();
- });
- </script>
-</head>
-<body>
-
-<ul class="plugins">
-<li>
- Datepicker
- <div style="text-align:left;margin-left:10px;">
- <input type="text" id="datepicker">
- </div>
-</li>
-<li>
- Dialog
- <div id="dialog">
- <button>Open</button>
- </div>
-</li>
-<li>
- Draggable
- <div id="draggable"></div>
-</li>
-<li>
- Droppable
- <div class="draggable">D</div>
- <div class="draggable">R</div>
- <div class="draggable">A</div>
- <div class="draggable">G</div>
- <div id="droppable">
- DROP
- <hr>
- </div>
-</li>
-<li>
- Resizable
- <div id="resizable"></div>
-</li>
-<li>
- Selectable
- <div id="selectable">
- <div>1</div>
- <div>2</div>
- <div>3</div>
- <div>4</div>
- <div>5</div>
- <div>6</div>
- <div>7</div>
- <div>8</div>
- <div>9</div>
- </div>
-</li>
-<li>
- Slider
- <div id="slider"></div>
-</li>
-<li>
- Sortable
- <div id="sortable">
- <div>C</div>
- <div>I</div>
- <div>G</div>
- <div>F</div>
- <div>D</div>
- <div>H</div>
- <div>A</div>
- <div>E</div>
- <div>B</div>
- </div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple All</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <link rel="stylesheet" href="../../themes/ui.datepicker.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.accordion.js"></script> + <script type="text/javascript" src="../../ui/ui.datepicker.js"></script> + <script type="text/javascript" src="../../ui/ui.dialog.js"></script> + <script type="text/javascript" src="../../ui/ui.draggable.js"></script> + <script type="text/javascript" src="../../ui/ui.droppable.js"></script> + <script type="text/javascript" src="../../ui/ui.resizable.js"></script> + <script type="text/javascript" src="../../ui/ui.selectable.js"></script> + <script type="text/javascript" src="../../ui/ui.slider.js"></script> + <script type="text/javascript" src="../../ui/ui.sortable.js"></script> + <script type="text/javascript" src="../../ui/ui.tabs.js"></script> + <script type="text/javascript"> + $(function() { + $("#datepicker").datepicker(); + $("#dialog").click(function() { $("<div/>").dialog(); }); + $("#draggable").draggable(); + $(".draggable").draggable(); + $("#droppable").droppable({ + accept: '.draggable', + drop: function(ev, ui) { + ui.draggable.css({ position: 'relative', top: 0, left: 0 }).clone().appendTo(this); + } + }); + $("#resizable").resizable(); + $("#selectable").selectable(); + $("#slider").slider(); + $("#sortable").sortable(); + }); + </script> +</head> +<body> + +<ul class="plugins"> +<li> + Datepicker + <div style="text-align:left;margin-left:10px;"> + <input type="text" id="datepicker"> + </div> +</li> +<li> + Dialog + <div id="dialog"> + <button>Open</button> + </div> +</li> +<li> + Draggable + <div id="draggable"></div> +</li> +<li> + Droppable + <div class="draggable">D</div> + <div class="draggable">R</div> + <div class="draggable">A</div> + <div class="draggable">G</div> + <div id="droppable"> + DROP + <hr> + </div> +</li> +<li> + Resizable + <div id="resizable"></div> +</li> +<li> + Selectable + <div id="selectable"> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + </div> +</li> +<li> + Slider + <div id="slider"></div> +</li> +<li> + Sortable + <div id="sortable"> + <div>C</div> + <div>I</div> + <div>G</div> + <div>F</div> + <div>D</div> + <div>H</div> + <div>A</div> + <div>E</div> + <div>B</div> + </div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/autocomplete/localdata.js b/tests/visual/autocomplete/localdata.js index 6015f7c82..c1cade657 100644 --- a/tests/visual/autocomplete/localdata.js +++ b/tests/visual/autocomplete/localdata.js @@ -1,216 +1,216 @@ -var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
-var emails = [
- { name: "Peter Pan", to: "peter@pan.de" },
- { name: "Molly", to: "molly@yahoo.com" },
- { name: "Forneria Marconi", to: "live@japan.jp" },
- { name: "Master <em>Sync</em>", to: "205bw@samsung.com" },
- { name: "Dr. <strong>Tech</strong> de Log", to: "g15@logitech.com" },
- { name: "Don Corleone", to: "don@vegas.com" },
- { name: "Mc Chick", to: "info@donalds.org" },
- { name: "Donnie Darko", to: "dd@timeshift.info" },
- { name: "Quake The Net", to: "webmaster@quakenet.org" },
- { name: "Dr. Write", to: "write@writable.com" }
-];
-var cities = [
- "Aberdeen", "Ada", "Adamsville", "Addyston", "Adelphi", "Adena", "Adrian", "Akron",
- "Albany", "Alexandria", "Alger", "Alledonia", "Alliance", "Alpha", "Alvada",
- "Alvordton", "Amanda", "Amelia", "Amesville", "Amherst", "Amlin", "Amsden",
- "Amsterdam", "Andover", "Anna", "Ansonia", "Antwerp", "Apple Creek", "Arcadia",
- "Arcanum", "Archbold", "Arlington", "Ashland", "Ashley", "Ashtabula", "Ashville",
- "Athens", "Attica", "Atwater", "Augusta", "Aurora", "Austinburg", "Ava", "Avon",
- "Avon Lake", "Bainbridge", "Bakersville", "Baltic", "Baltimore", "Bannock",
- "Barberton", "Barlow", "Barnesville", "Bartlett", "Barton", "Bascom", "Batavia",
- "Bath", "Bay Village", "Beach City", "Beachwood", "Beallsville", "Beaver",
- "Beaverdam", "Bedford", "Bellaire", "Bellbrook", "Belle Center", "Belle Valley",
- "Bellefontaine", "Bellevue", "Bellville", "Belmont", "Belmore", "Beloit", "Belpre",
- "Benton Ridge", "Bentonville", "Berea", "Bergholz", "Berkey", "Berlin",
- "Berlin Center", "Berlin Heights", "Bethel", "Bethesda", "Bettsville", "Beverly",
- "Bidwell", "Big Prairie", "Birmingham", "Blacklick", "Bladensburg", "Blaine",
- "Blakeslee", "Blanchester", "Blissfield", "Bloomdale", "Bloomingburg",
- "Bloomingdale", "Bloomville", "Blue Creek", "Blue Rock", "Bluffton",
- "Bolivar", "Botkins", "Bourneville", "Bowerston", "Bowersville",
- "Bowling Green", "Bradford", "Bradner", "Brady Lake", "Brecksville",
- "Bremen", "Brewster", "Brice", "Bridgeport", "Brilliant", "Brinkhaven",
- "Bristolville", "Broadview Heights", "Broadway", "Brookfield", "Brookpark",
- "Brookville", "Brownsville", "Brunswick", "Bryan", "Buchtel", "Buckeye Lake",
- "Buckland", "Bucyrus", "Buffalo", "Buford", "Burbank", "Burghill", "Burgoon",
- "Burkettsville", "Burton", "Butler", "Byesville", "Cable", "Cadiz", "Cairo",
- "Caldwell", "Caledonia", "Cambridge", "Camden", "Cameron", "Camp Dennison",
- "Campbell", "Canal Fulton", "Canal Winchester", "Canfield", "Canton", "Carbon Hill",
- "Carbondale", "Cardington", "Carey", "Carroll", "Carrollton", "Casstown",
- "Castalia", "Catawba", "Cecil", "Cedarville", "Celina", "Centerburg",
- "Chagrin Falls", "Chandlersville", "Chardon", "Charm", "Chatfield", "Chauncey",
- "Cherry Fork", "Chesapeake", "Cheshire", "Chester", "Chesterhill", "Chesterland",
- "Chesterville", "Chickasaw", "Chillicothe", "Chilo", "Chippewa Lake",
- "Christiansburg", "Cincinnati", "Circleville", "Clarington", "Clarksburg",
- "Clarksville", "Clay Center", "Clayton", "Cleveland", "Cleves", "Clifton",
- "Clinton", "Cloverdale", "Clyde", "Coal Run", "Coalton", "Coldwater", "Colerain",
- "College Corner", "Collins", "Collinsville", "Colton", "Columbia Station",
- "Columbiana", "Columbus", "Columbus Grove", "Commercial Point", "Conesville",
- "Conneaut", "Conover", "Continental", "Convoy", "Coolville", "Corning", "Cortland",
- "Coshocton", "Covington", "Creola", "Crestline", "Creston", "Crooksville",
- "Croton", "Crown City", "Cuba", "Cumberland", "Curtice", "Custar", "Cutler",
- "Cuyahoga Falls", "Cygnet", "Cynthiana", "Dalton", "Damascus", "Danville",
- "Dayton", "De Graff", "Decatur", "Deerfield", "Deersville", "Defiance",
- "Delaware", "Dellroy", "Delphos", "Delta", "Dennison", "Derby", "Derwent",
- "Deshler", "Dexter City", "Diamond", "Dillonvale", "Dola", "Donnelsville",
- "Dorset", "Dover", "Doylestown", "Dresden", "Dublin", "Dunbridge", "Duncan Falls",
- "Dundee", "Dunkirk", "Dupont", "East Claridon", "East Fultonham",
- "East Liberty", "East Liverpool", "East Palestine", "East Rochester",
- "East Sparta", "East Springfield", "Eastlake", "Eaton", "Edgerton", "Edison",
- "Edon", "Eldorado", "Elgin", "Elkton", "Ellsworth", "Elmore", "Elyria",
- "Empire", "Englewood", "Enon", "Etna", "Euclid", "Evansport", "Fairborn",
- "Fairfield", "Fairpoint", "Fairview", "Farmdale", "Farmer", "Farmersville",
- "Fayette", "Fayetteville", "Feesburg", "Felicity", "Findlay", "Flat Rock",
- "Fleming", "Fletcher", "Flushing", "Forest", "Fort Jennings", "Fort Loramie",
- "Fort Recovery", "Fostoria", "Fowler", "Frankfort", "Franklin",
- "Franklin Furnace", "Frazeysburg", "Fredericksburg", "Fredericktown",
- "Freeport", "Fremont", "Fresno", "Friendship", "Fulton", "Fultonham",
- "Galena", "Galion", "Gallipolis", "Galloway", "Gambier", "Garrettsville",
- "Gates Mills", "Geneva", "Genoa", "Georgetown", "Germantown", "Gettysburg",
- "Gibsonburg", "Girard", "Glandorf", "Glencoe", "Glenford", "Glenmont",
- "Glouster", "Gnadenhutten", "Gomer", "Goshen", "Grafton", "Grand Rapids",
- "Grand River", "Granville", "Gratiot", "Gratis", "Graysville", "Graytown",
- "Green", "Green Camp", "Green Springs", "Greenfield", "Greenford",
- "Greentown", "Greenville", "Greenwich", "Grelton", "Grove City",
- "Groveport", "Grover Hill", "Guysville", "Gypsum", "Hallsville",
- "Hamden", "Hamersville", "Hamilton", "Hamler", "Hammondsville",
- "Hannibal", "Hanoverton", "Harbor View", "Harlem Springs", "Harpster",
- "Harrisburg", "Harrison", "Harrisville", "Harrod", "Hartford", "Hartville",
- "Harveysburg", "Haskins", "Haverhill", "Haviland", "Haydenville", "Hayesville",
- "Heath", "Hebron", "Helena", "Hicksville", "Higginsport", "Highland", "Hilliard",
- "Hillsboro", "Hinckley", "Hiram", "Hockingport", "Holgate", "Holland",
- "Hollansburg", "Holloway", "Holmesville", "Homer", "Homerville", "Homeworth",
- "Hooven", "Hopedale", "Hopewell", "Houston", "Howard", "Hoytville", "Hubbard",
- "Hudson", "Huntsburg", "Huntsville", "Huron", "Iberia", "Independence",
- "Irondale", "Ironton", "Irwin", "Isle Saint George", "Jackson", "Jackson Center",
- "Jacksontown", "Jacksonville", "Jacobsburg", "Jamestown", "Jasper",
- "Jefferson", "Jeffersonville", "Jenera", "Jeromesville", "Jerry City",
- "Jerusalem", "Jewell", "Jewett", "Johnstown", "Junction City", "Kalida",
- "Kansas", "Keene", "Kelleys Island", "Kensington", "Kent", "Kenton",
- "Kerr", "Kettlersville", "Kidron", "Kilbourne", "Killbuck", "Kimbolton",
- "Kings Mills", "Kingston", "Kingsville", "Kinsman", "Kipling", "Kipton",
- "Kirby", "Kirkersville", "Kitts Hill", "Kunkle", "La Rue", "Lacarne",
- "Lafayette", "Lafferty", "Lagrange", "Laings", "Lake Milton", "Lakemore",
- "Lakeside Marblehead", "Lakeview", "Lakeville", "Lakewood", "Lancaster",
- "Langsville", "Lansing", "Latham", "Latty", "Laura", "Laurelville",
- "Leavittsburg", "Lebanon", "Lees Creek", "Leesburg", "Leesville",
- "Leetonia", "Leipsic", "Lemoyne", "Lewis Center", "Lewisburg",
- "Lewistown", "Lewisville", "Liberty Center", "Lima", "Limaville",
- "Lindsey", "Lisbon", "Litchfield", "Lithopolis", "Little Hocking",
- "Lockbourne", "Lodi", "Logan", "London", "Londonderry",
- "Long Bottom", "Lorain", "Lore City", "Loudonville", "Louisville",
- "Loveland", "Lowell", "Lowellville", "Lower Salem", "Lucas",
- "Lucasville", "Luckey", "Ludlow Falls", "Lynchburg", "Lynx",
- "Lyons", "Macedonia", "Macksburg", "Madison", "Magnetic Springs",
- "Magnolia", "Maineville", "Malaga", "Malinta", "Malta", "Malvern",
- "Manchester", "Mansfield", "Mantua", "Maple Heights", "Maplewood",
- "Marathon", "Marengo", "Maria Stein", "Marietta", "Marion",
- "Mark Center", "Marshallville", "Martel", "Martin", "Martins Ferry",
- "Martinsburg", "Martinsville", "Marysville", "Mason", "Massillon",
- "Masury", "Maumee", "Maximo", "Maynard", "Mc Arthur", "Mc Clure",
- "Mc Comb", "Mc Connelsville", "Mc Cutchenville", "Mc Dermott",
- "Mc Donald", "Mc Guffey", "Mechanicsburg", "Mechanicstown",
- "Medina", "Medway", "Melmore", "Melrose", "Mendon", "Mentor",
- "Mesopotamia", "Metamora", "Miamisburg", "Miamitown", "Miamiville",
- "Middle Bass", "Middle Point", "Middlebranch", "Middleburg",
- "Middlefield", "Middleport", "Middletown", "Midland", "Midvale",
- "Milan", "Milford", "Milford Center", "Millbury", "Milledgeville",
- "Miller City", "Millersburg", "Millersport", "Millfield",
- "Milton Center", "Mineral City", "Mineral Ridge", "Minerva",
- "Minford", "Mingo", "Mingo Junction", "Minster", "Mogadore",
- "Monclova", "Monroe", "Monroeville", "Montezuma", "Montpelier",
- "Montville", "Morral", "Morristown", "Morrow", "Moscow",
- "Mount Blanchard", "Mount Cory", "Mount Eaton", "Mount Gilead",
- "Mount Hope", "Mount Liberty", "Mount Orab", "Mount Perry",
- "Mount Pleasant", "Mount Saint Joseph", "Mount Sterling",
- "Mount Vernon", "Mount Victory", "Mowrystown", "Moxahala",
- "Munroe Falls", "Murray City", "Nankin", "Napoleon", "Nashport",
- "Nashville", "Navarre", "Neapolis", "Neffs", "Negley",
- "Nelsonville", "Nevada", "Neville", "New Albany", "New Athens",
- "New Bavaria", "New Bloomington", "New Bremen", "New Carlisle",
- "New Concord", "New Hampshire", "New Haven", "New Holland",
- "New Knoxville", "New Lebanon", "New Lexington", "New London",
- "New Madison", "New Marshfield", "New Matamoras", "New Middletown",
- "New Paris", "New Philadelphia", "New Plymouth", "New Richmond",
- "New Riegel", "New Rumley", "New Springfield", "New Straitsville",
- "New Vienna", "New Washington", "New Waterford", "New Weston",
- "Newark", "Newbury", "Newcomerstown", "Newport", "Newton Falls",
- "Newtonsville", "Ney", "Niles", "North Baltimore", "North Bend",
- "North Benton", "North Bloomfield", "North Fairfield",
- "North Georgetown", "North Hampton", "North Jackson",
- "North Kingsville", "North Lawrence", "North Lewisburg",
- "North Lima", "North Olmsted", "North Ridgeville", "North Robinson",
- "North Royalton", "North Star", "Northfield", "Northwood", "Norwalk",
- "Norwich", "Nova", "Novelty", "Oak Harbor", "Oak Hill", "Oakwood",
- "Oberlin", "Oceola", "Ohio City", "Okeana", "Okolona", "Old Fort",
- "Old Washington", "Olmsted Falls", "Ontario", "Orangeville",
- "Oregon", "Oregonia", "Orient", "Orrville", "Orwell", "Osgood",
- "Ostrander", "Ottawa", "Ottoville", "Otway", "Overpeck",
- "Owensville", "Oxford", "Painesville", "Palestine", "Pandora",
- "Paris", "Parkman", "Pataskala", "Patriot", "Paulding", "Payne",
- "Pedro", "Peebles", "Pemberton", "Pemberville", "Peninsula",
- "Perry", "Perrysburg", "Perrysville", "Petersburg", "Pettisville",
- "Phillipsburg", "Philo", "Pickerington", "Piedmont", "Pierpont",
- "Piketon", "Piney Fork", "Pioneer", "Piqua", "Pitsburg",
- "Plain City", "Plainfield", "Pleasant City", "Pleasant Hill",
- "Pleasant Plain", "Pleasantville", "Plymouth", "Polk",
- "Pomeroy", "Port Clinton", "Port Jefferson", "Port Washington",
- "Port William", "Portage", "Portland", "Portsmouth", "Potsdam",
- "Powell", "Powhatan Point", "Proctorville", "Prospect", "Put in Bay",
- "Quaker City", "Quincy", "Racine", "Radnor", "Randolph", "Rarden",
- "Ravenna", "Rawson", "Ray", "Rayland", "Raymond", "Reedsville",
- "Reesville", "Reno", "Republic", "Reynoldsburg", "Richfield",
- "Richmond", "Richmond Dale", "Richwood", "Ridgeville Corners",
- "Ridgeway", "Rio Grande", "Ripley", "Risingsun", "Rittman",
- "Robertsville", "Rock Camp", "Rock Creek", "Rockbridge", "Rockford",
- "Rocky Ridge", "Rocky River", "Rogers", "Rome", "Rootstown", "Roseville",
- "Rosewood", "Ross", "Rossburg", "Rossford", "Roundhead", "Rudolph",
- "Rushsylvania", "Rushville", "Russells Point", "Russellville", "Russia",
- "Rutland", "Sabina", "Saint Clairsville", "Saint Henry", "Saint Johns",
- "Saint Louisville", "Saint Marys", "Saint Paris", "Salem", "Salesville",
- "Salineville", "Sandusky", "Sandyville", "Sarahsville", "Sardinia",
- "Sardis", "Savannah", "Scio", "Scioto Furnace", "Scott", "Scottown",
- "Seaman", "Sebring", "Sedalia", "Senecaville", "Seven Mile", "Seville",
- "Shade", "Shadyside", "Shandon", "Sharon Center", "Sharpsburg",
- "Shauck", "Shawnee", "Sheffield Lake", "Shelby", "Sherrodsville",
- "Sherwood", "Shiloh", "Short Creek", "Shreve", "Sidney", "Sinking Spring",
- "Smithfield", "Smithville", "Solon", "Somerdale", "Somerset",
- "Somerville", "South Bloomingville", "South Charleston", "South Lebanon",
- "South Point", "South Salem", "South Solon", "South Vienna",
- "South Webster", "Southington", "Sparta", "Spencer", "Spencerville",
- "Spring Valley", "Springboro", "Springfield", "Stafford", "Sterling",
- "Steubenville", "Stewart", "Stillwater", "Stockdale", "Stockport",
- "Stone Creek", "Stony Ridge", "Stout", "Stoutsville", "Stow", "Strasburg",
- "Stratton", "Streetsboro", "Strongsville", "Struthers", "Stryker",
- "Sugar Grove", "Sugarcreek", "Sullivan", "Sulphur Springs", "Summerfield",
- "Summit Station", "Summitville", "Sunbury", "Swanton", "Sycamore",
- "Sycamore Valley", "Sylvania", "Syracuse", "Tallmadge", "Tarlton",
- "Terrace Park", "The Plains", "Thompson", "Thornville", "Thurman",
- "Thurston", "Tiffin", "Tiltonsville", "Tipp City", "Tippecanoe", "Tiro",
- "Toledo", "Tontogany", "Torch", "Toronto", "Tremont City", "Trenton",
- "Trimble", "Trinway", "Troy", "Tuppers Plains", "Tuscarawas", "Twinsburg",
- "Uhrichsville", "Union City", "Union Furnace", "Unionport", "Uniontown",
- "Unionville", "Unionville Center", "Uniopolis", "Upper Sandusky", "Urbana",
- "Utica", "Valley City", "Van Buren", "Van Wert", "Vandalia", "Vanlue",
- "Vaughnsville", "Venedocia", "Vermilion", "Verona", "Versailles",
- "Vickery", "Vienna", "Vincent", "Vinton", "Wadsworth", "Wakefield",
- "Wakeman", "Walbridge", "Waldo", "Walhonding", "Walnut Creek", "Wapakoneta",
- "Warnock", "Warren", "Warsaw", "Washington Court House",
- "Washingtonville", "Waterford", "Waterloo", "Watertown", "Waterville",
- "Wauseon", "Waverly", "Wayland", "Wayne", "Waynesburg", "Waynesfield",
- "Waynesville", "Wellington", "Wellston", "Wellsville", "West Alexandria",
- "West Chester", "West Elkton", "West Farmington", "West Jefferson",
- "West Lafayette", "West Liberty", "West Manchester", "West Mansfield",
- "West Millgrove", "West Milton", "West Point", "West Portsmouth",
- "West Rushville", "West Salem", "West Union", "West Unity", "Westerville",
- "Westfield Center", "Westlake", "Weston", "Westville", "Wharton",
- "Wheelersburg", "Whipple", "White Cottage", "Whitehouse", "Wickliffe",
- "Wilberforce", "Wilkesville", "Willard", "Williamsburg", "Williamsfield",
- "Williamsport", "Williamstown", "Williston", "Willoughby", "Willow Wood",
- "Willshire", "Wilmington", "Wilmot", "Winchester", "Windham", "Windsor",
- "Winesburg", "Wingett Run", "Winona", "Wolf Run", "Woodsfield",
- "Woodstock", "Woodville", "Wooster", "Wren", "Xenia", "Yellow Springs",
- "Yorkshire", "Yorkville", "Youngstown", "Zaleski", "Zanesfield", "Zanesville",
- "Zoar"
+var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; +var emails = [ + { name: "Peter Pan", to: "peter@pan.de" }, + { name: "Molly", to: "molly@yahoo.com" }, + { name: "Forneria Marconi", to: "live@japan.jp" }, + { name: "Master <em>Sync</em>", to: "205bw@samsung.com" }, + { name: "Dr. <strong>Tech</strong> de Log", to: "g15@logitech.com" }, + { name: "Don Corleone", to: "don@vegas.com" }, + { name: "Mc Chick", to: "info@donalds.org" }, + { name: "Donnie Darko", to: "dd@timeshift.info" }, + { name: "Quake The Net", to: "webmaster@quakenet.org" }, + { name: "Dr. Write", to: "write@writable.com" } +]; +var cities = [ + "Aberdeen", "Ada", "Adamsville", "Addyston", "Adelphi", "Adena", "Adrian", "Akron", + "Albany", "Alexandria", "Alger", "Alledonia", "Alliance", "Alpha", "Alvada", + "Alvordton", "Amanda", "Amelia", "Amesville", "Amherst", "Amlin", "Amsden", + "Amsterdam", "Andover", "Anna", "Ansonia", "Antwerp", "Apple Creek", "Arcadia", + "Arcanum", "Archbold", "Arlington", "Ashland", "Ashley", "Ashtabula", "Ashville", + "Athens", "Attica", "Atwater", "Augusta", "Aurora", "Austinburg", "Ava", "Avon", + "Avon Lake", "Bainbridge", "Bakersville", "Baltic", "Baltimore", "Bannock", + "Barberton", "Barlow", "Barnesville", "Bartlett", "Barton", "Bascom", "Batavia", + "Bath", "Bay Village", "Beach City", "Beachwood", "Beallsville", "Beaver", + "Beaverdam", "Bedford", "Bellaire", "Bellbrook", "Belle Center", "Belle Valley", + "Bellefontaine", "Bellevue", "Bellville", "Belmont", "Belmore", "Beloit", "Belpre", + "Benton Ridge", "Bentonville", "Berea", "Bergholz", "Berkey", "Berlin", + "Berlin Center", "Berlin Heights", "Bethel", "Bethesda", "Bettsville", "Beverly", + "Bidwell", "Big Prairie", "Birmingham", "Blacklick", "Bladensburg", "Blaine", + "Blakeslee", "Blanchester", "Blissfield", "Bloomdale", "Bloomingburg", + "Bloomingdale", "Bloomville", "Blue Creek", "Blue Rock", "Bluffton", + "Bolivar", "Botkins", "Bourneville", "Bowerston", "Bowersville", + "Bowling Green", "Bradford", "Bradner", "Brady Lake", "Brecksville", + "Bremen", "Brewster", "Brice", "Bridgeport", "Brilliant", "Brinkhaven", + "Bristolville", "Broadview Heights", "Broadway", "Brookfield", "Brookpark", + "Brookville", "Brownsville", "Brunswick", "Bryan", "Buchtel", "Buckeye Lake", + "Buckland", "Bucyrus", "Buffalo", "Buford", "Burbank", "Burghill", "Burgoon", + "Burkettsville", "Burton", "Butler", "Byesville", "Cable", "Cadiz", "Cairo", + "Caldwell", "Caledonia", "Cambridge", "Camden", "Cameron", "Camp Dennison", + "Campbell", "Canal Fulton", "Canal Winchester", "Canfield", "Canton", "Carbon Hill", + "Carbondale", "Cardington", "Carey", "Carroll", "Carrollton", "Casstown", + "Castalia", "Catawba", "Cecil", "Cedarville", "Celina", "Centerburg", + "Chagrin Falls", "Chandlersville", "Chardon", "Charm", "Chatfield", "Chauncey", + "Cherry Fork", "Chesapeake", "Cheshire", "Chester", "Chesterhill", "Chesterland", + "Chesterville", "Chickasaw", "Chillicothe", "Chilo", "Chippewa Lake", + "Christiansburg", "Cincinnati", "Circleville", "Clarington", "Clarksburg", + "Clarksville", "Clay Center", "Clayton", "Cleveland", "Cleves", "Clifton", + "Clinton", "Cloverdale", "Clyde", "Coal Run", "Coalton", "Coldwater", "Colerain", + "College Corner", "Collins", "Collinsville", "Colton", "Columbia Station", + "Columbiana", "Columbus", "Columbus Grove", "Commercial Point", "Conesville", + "Conneaut", "Conover", "Continental", "Convoy", "Coolville", "Corning", "Cortland", + "Coshocton", "Covington", "Creola", "Crestline", "Creston", "Crooksville", + "Croton", "Crown City", "Cuba", "Cumberland", "Curtice", "Custar", "Cutler", + "Cuyahoga Falls", "Cygnet", "Cynthiana", "Dalton", "Damascus", "Danville", + "Dayton", "De Graff", "Decatur", "Deerfield", "Deersville", "Defiance", + "Delaware", "Dellroy", "Delphos", "Delta", "Dennison", "Derby", "Derwent", + "Deshler", "Dexter City", "Diamond", "Dillonvale", "Dola", "Donnelsville", + "Dorset", "Dover", "Doylestown", "Dresden", "Dublin", "Dunbridge", "Duncan Falls", + "Dundee", "Dunkirk", "Dupont", "East Claridon", "East Fultonham", + "East Liberty", "East Liverpool", "East Palestine", "East Rochester", + "East Sparta", "East Springfield", "Eastlake", "Eaton", "Edgerton", "Edison", + "Edon", "Eldorado", "Elgin", "Elkton", "Ellsworth", "Elmore", "Elyria", + "Empire", "Englewood", "Enon", "Etna", "Euclid", "Evansport", "Fairborn", + "Fairfield", "Fairpoint", "Fairview", "Farmdale", "Farmer", "Farmersville", + "Fayette", "Fayetteville", "Feesburg", "Felicity", "Findlay", "Flat Rock", + "Fleming", "Fletcher", "Flushing", "Forest", "Fort Jennings", "Fort Loramie", + "Fort Recovery", "Fostoria", "Fowler", "Frankfort", "Franklin", + "Franklin Furnace", "Frazeysburg", "Fredericksburg", "Fredericktown", + "Freeport", "Fremont", "Fresno", "Friendship", "Fulton", "Fultonham", + "Galena", "Galion", "Gallipolis", "Galloway", "Gambier", "Garrettsville", + "Gates Mills", "Geneva", "Genoa", "Georgetown", "Germantown", "Gettysburg", + "Gibsonburg", "Girard", "Glandorf", "Glencoe", "Glenford", "Glenmont", + "Glouster", "Gnadenhutten", "Gomer", "Goshen", "Grafton", "Grand Rapids", + "Grand River", "Granville", "Gratiot", "Gratis", "Graysville", "Graytown", + "Green", "Green Camp", "Green Springs", "Greenfield", "Greenford", + "Greentown", "Greenville", "Greenwich", "Grelton", "Grove City", + "Groveport", "Grover Hill", "Guysville", "Gypsum", "Hallsville", + "Hamden", "Hamersville", "Hamilton", "Hamler", "Hammondsville", + "Hannibal", "Hanoverton", "Harbor View", "Harlem Springs", "Harpster", + "Harrisburg", "Harrison", "Harrisville", "Harrod", "Hartford", "Hartville", + "Harveysburg", "Haskins", "Haverhill", "Haviland", "Haydenville", "Hayesville", + "Heath", "Hebron", "Helena", "Hicksville", "Higginsport", "Highland", "Hilliard", + "Hillsboro", "Hinckley", "Hiram", "Hockingport", "Holgate", "Holland", + "Hollansburg", "Holloway", "Holmesville", "Homer", "Homerville", "Homeworth", + "Hooven", "Hopedale", "Hopewell", "Houston", "Howard", "Hoytville", "Hubbard", + "Hudson", "Huntsburg", "Huntsville", "Huron", "Iberia", "Independence", + "Irondale", "Ironton", "Irwin", "Isle Saint George", "Jackson", "Jackson Center", + "Jacksontown", "Jacksonville", "Jacobsburg", "Jamestown", "Jasper", + "Jefferson", "Jeffersonville", "Jenera", "Jeromesville", "Jerry City", + "Jerusalem", "Jewell", "Jewett", "Johnstown", "Junction City", "Kalida", + "Kansas", "Keene", "Kelleys Island", "Kensington", "Kent", "Kenton", + "Kerr", "Kettlersville", "Kidron", "Kilbourne", "Killbuck", "Kimbolton", + "Kings Mills", "Kingston", "Kingsville", "Kinsman", "Kipling", "Kipton", + "Kirby", "Kirkersville", "Kitts Hill", "Kunkle", "La Rue", "Lacarne", + "Lafayette", "Lafferty", "Lagrange", "Laings", "Lake Milton", "Lakemore", + "Lakeside Marblehead", "Lakeview", "Lakeville", "Lakewood", "Lancaster", + "Langsville", "Lansing", "Latham", "Latty", "Laura", "Laurelville", + "Leavittsburg", "Lebanon", "Lees Creek", "Leesburg", "Leesville", + "Leetonia", "Leipsic", "Lemoyne", "Lewis Center", "Lewisburg", + "Lewistown", "Lewisville", "Liberty Center", "Lima", "Limaville", + "Lindsey", "Lisbon", "Litchfield", "Lithopolis", "Little Hocking", + "Lockbourne", "Lodi", "Logan", "London", "Londonderry", + "Long Bottom", "Lorain", "Lore City", "Loudonville", "Louisville", + "Loveland", "Lowell", "Lowellville", "Lower Salem", "Lucas", + "Lucasville", "Luckey", "Ludlow Falls", "Lynchburg", "Lynx", + "Lyons", "Macedonia", "Macksburg", "Madison", "Magnetic Springs", + "Magnolia", "Maineville", "Malaga", "Malinta", "Malta", "Malvern", + "Manchester", "Mansfield", "Mantua", "Maple Heights", "Maplewood", + "Marathon", "Marengo", "Maria Stein", "Marietta", "Marion", + "Mark Center", "Marshallville", "Martel", "Martin", "Martins Ferry", + "Martinsburg", "Martinsville", "Marysville", "Mason", "Massillon", + "Masury", "Maumee", "Maximo", "Maynard", "Mc Arthur", "Mc Clure", + "Mc Comb", "Mc Connelsville", "Mc Cutchenville", "Mc Dermott", + "Mc Donald", "Mc Guffey", "Mechanicsburg", "Mechanicstown", + "Medina", "Medway", "Melmore", "Melrose", "Mendon", "Mentor", + "Mesopotamia", "Metamora", "Miamisburg", "Miamitown", "Miamiville", + "Middle Bass", "Middle Point", "Middlebranch", "Middleburg", + "Middlefield", "Middleport", "Middletown", "Midland", "Midvale", + "Milan", "Milford", "Milford Center", "Millbury", "Milledgeville", + "Miller City", "Millersburg", "Millersport", "Millfield", + "Milton Center", "Mineral City", "Mineral Ridge", "Minerva", + "Minford", "Mingo", "Mingo Junction", "Minster", "Mogadore", + "Monclova", "Monroe", "Monroeville", "Montezuma", "Montpelier", + "Montville", "Morral", "Morristown", "Morrow", "Moscow", + "Mount Blanchard", "Mount Cory", "Mount Eaton", "Mount Gilead", + "Mount Hope", "Mount Liberty", "Mount Orab", "Mount Perry", + "Mount Pleasant", "Mount Saint Joseph", "Mount Sterling", + "Mount Vernon", "Mount Victory", "Mowrystown", "Moxahala", + "Munroe Falls", "Murray City", "Nankin", "Napoleon", "Nashport", + "Nashville", "Navarre", "Neapolis", "Neffs", "Negley", + "Nelsonville", "Nevada", "Neville", "New Albany", "New Athens", + "New Bavaria", "New Bloomington", "New Bremen", "New Carlisle", + "New Concord", "New Hampshire", "New Haven", "New Holland", + "New Knoxville", "New Lebanon", "New Lexington", "New London", + "New Madison", "New Marshfield", "New Matamoras", "New Middletown", + "New Paris", "New Philadelphia", "New Plymouth", "New Richmond", + "New Riegel", "New Rumley", "New Springfield", "New Straitsville", + "New Vienna", "New Washington", "New Waterford", "New Weston", + "Newark", "Newbury", "Newcomerstown", "Newport", "Newton Falls", + "Newtonsville", "Ney", "Niles", "North Baltimore", "North Bend", + "North Benton", "North Bloomfield", "North Fairfield", + "North Georgetown", "North Hampton", "North Jackson", + "North Kingsville", "North Lawrence", "North Lewisburg", + "North Lima", "North Olmsted", "North Ridgeville", "North Robinson", + "North Royalton", "North Star", "Northfield", "Northwood", "Norwalk", + "Norwich", "Nova", "Novelty", "Oak Harbor", "Oak Hill", "Oakwood", + "Oberlin", "Oceola", "Ohio City", "Okeana", "Okolona", "Old Fort", + "Old Washington", "Olmsted Falls", "Ontario", "Orangeville", + "Oregon", "Oregonia", "Orient", "Orrville", "Orwell", "Osgood", + "Ostrander", "Ottawa", "Ottoville", "Otway", "Overpeck", + "Owensville", "Oxford", "Painesville", "Palestine", "Pandora", + "Paris", "Parkman", "Pataskala", "Patriot", "Paulding", "Payne", + "Pedro", "Peebles", "Pemberton", "Pemberville", "Peninsula", + "Perry", "Perrysburg", "Perrysville", "Petersburg", "Pettisville", + "Phillipsburg", "Philo", "Pickerington", "Piedmont", "Pierpont", + "Piketon", "Piney Fork", "Pioneer", "Piqua", "Pitsburg", + "Plain City", "Plainfield", "Pleasant City", "Pleasant Hill", + "Pleasant Plain", "Pleasantville", "Plymouth", "Polk", + "Pomeroy", "Port Clinton", "Port Jefferson", "Port Washington", + "Port William", "Portage", "Portland", "Portsmouth", "Potsdam", + "Powell", "Powhatan Point", "Proctorville", "Prospect", "Put in Bay", + "Quaker City", "Quincy", "Racine", "Radnor", "Randolph", "Rarden", + "Ravenna", "Rawson", "Ray", "Rayland", "Raymond", "Reedsville", + "Reesville", "Reno", "Republic", "Reynoldsburg", "Richfield", + "Richmond", "Richmond Dale", "Richwood", "Ridgeville Corners", + "Ridgeway", "Rio Grande", "Ripley", "Risingsun", "Rittman", + "Robertsville", "Rock Camp", "Rock Creek", "Rockbridge", "Rockford", + "Rocky Ridge", "Rocky River", "Rogers", "Rome", "Rootstown", "Roseville", + "Rosewood", "Ross", "Rossburg", "Rossford", "Roundhead", "Rudolph", + "Rushsylvania", "Rushville", "Russells Point", "Russellville", "Russia", + "Rutland", "Sabina", "Saint Clairsville", "Saint Henry", "Saint Johns", + "Saint Louisville", "Saint Marys", "Saint Paris", "Salem", "Salesville", + "Salineville", "Sandusky", "Sandyville", "Sarahsville", "Sardinia", + "Sardis", "Savannah", "Scio", "Scioto Furnace", "Scott", "Scottown", + "Seaman", "Sebring", "Sedalia", "Senecaville", "Seven Mile", "Seville", + "Shade", "Shadyside", "Shandon", "Sharon Center", "Sharpsburg", + "Shauck", "Shawnee", "Sheffield Lake", "Shelby", "Sherrodsville", + "Sherwood", "Shiloh", "Short Creek", "Shreve", "Sidney", "Sinking Spring", + "Smithfield", "Smithville", "Solon", "Somerdale", "Somerset", + "Somerville", "South Bloomingville", "South Charleston", "South Lebanon", + "South Point", "South Salem", "South Solon", "South Vienna", + "South Webster", "Southington", "Sparta", "Spencer", "Spencerville", + "Spring Valley", "Springboro", "Springfield", "Stafford", "Sterling", + "Steubenville", "Stewart", "Stillwater", "Stockdale", "Stockport", + "Stone Creek", "Stony Ridge", "Stout", "Stoutsville", "Stow", "Strasburg", + "Stratton", "Streetsboro", "Strongsville", "Struthers", "Stryker", + "Sugar Grove", "Sugarcreek", "Sullivan", "Sulphur Springs", "Summerfield", + "Summit Station", "Summitville", "Sunbury", "Swanton", "Sycamore", + "Sycamore Valley", "Sylvania", "Syracuse", "Tallmadge", "Tarlton", + "Terrace Park", "The Plains", "Thompson", "Thornville", "Thurman", + "Thurston", "Tiffin", "Tiltonsville", "Tipp City", "Tippecanoe", "Tiro", + "Toledo", "Tontogany", "Torch", "Toronto", "Tremont City", "Trenton", + "Trimble", "Trinway", "Troy", "Tuppers Plains", "Tuscarawas", "Twinsburg", + "Uhrichsville", "Union City", "Union Furnace", "Unionport", "Uniontown", + "Unionville", "Unionville Center", "Uniopolis", "Upper Sandusky", "Urbana", + "Utica", "Valley City", "Van Buren", "Van Wert", "Vandalia", "Vanlue", + "Vaughnsville", "Venedocia", "Vermilion", "Verona", "Versailles", + "Vickery", "Vienna", "Vincent", "Vinton", "Wadsworth", "Wakefield", + "Wakeman", "Walbridge", "Waldo", "Walhonding", "Walnut Creek", "Wapakoneta", + "Warnock", "Warren", "Warsaw", "Washington Court House", + "Washingtonville", "Waterford", "Waterloo", "Watertown", "Waterville", + "Wauseon", "Waverly", "Wayland", "Wayne", "Waynesburg", "Waynesfield", + "Waynesville", "Wellington", "Wellston", "Wellsville", "West Alexandria", + "West Chester", "West Elkton", "West Farmington", "West Jefferson", + "West Lafayette", "West Liberty", "West Manchester", "West Mansfield", + "West Millgrove", "West Milton", "West Point", "West Portsmouth", + "West Rushville", "West Salem", "West Union", "West Unity", "Westerville", + "Westfield Center", "Westlake", "Weston", "Westville", "Wharton", + "Wheelersburg", "Whipple", "White Cottage", "Whitehouse", "Wickliffe", + "Wilberforce", "Wilkesville", "Willard", "Williamsburg", "Williamsfield", + "Williamsport", "Williamstown", "Williston", "Willoughby", "Willow Wood", + "Willshire", "Wilmington", "Wilmot", "Winchester", "Windham", "Windsor", + "Winesburg", "Wingett Run", "Winona", "Wolf Run", "Woodsfield", + "Woodstock", "Woodville", "Wooster", "Wren", "Xenia", "Yellow Springs", + "Yorkshire", "Yorkville", "Youngstown", "Zaleski", "Zanesfield", "Zanesville", + "Zoar" ];
\ No newline at end of file diff --git a/tests/visual/colorpicker.html b/tests/visual/colorpicker.html index 9c5287dc6..d1dc0a491 100644 --- a/tests/visual/colorpicker.html +++ b/tests/visual/colorpicker.html @@ -1,357 +1,357 @@ -<!doctype html>
-<html lang="en">
-<head>
-
- <title>ColorPicker</title>
-
-<style type="text/css" media="screen">
-
-body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
- margin:0;
- padding:0;
-}
-table {
- border-collapse:collapse;
- border-spacing:0;
-}
-fieldset,img {
- border:0;
-}
-address,caption,cite,code,dfn,em,strong,th,var {
- font-style:normal;
- font-weight:normal;
-}
-ol,ul {
- list-style:none;
-}
-caption,th {
- text-align:left;
-}
-h1,h2,h3,h4,h5,h6 {
- font-size:100%;
- font-weight:normal;
-}
-q:before,q:after {
- content:'';
-}
-abbr,acronym { border:0;
-}
-html, body {
- background-color: #fff;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 12px;
- line-height: 18px;
- color: #52697E;
-}
-body {
- text-align: center;
- overflow: auto;
-}
-.wrapper {
- width: 700px;
- margin: 0 auto;
- text-align: left;
-}
-h1 {
- font-size: 21px;
- height: 47px;
- line-height: 47px;
- text-transform: uppercase;
-}
-.navigationTabs {
- height: 23px;
- line-height: 23px;
- border-bottom: 1px solid #ccc;
-}
-.navigationTabs li {
- float: left;
- height: 23px;
- line-height: 23px;
- padding-right: 3px;
-}
-.navigationTabs li a{
- float: left;
- dispaly: block;
- height: 23px;
- line-height: 23px;
- padding: 0 10px;
- overflow: hidden;
- color: #52697E;
- background-color: #eee;
- position: relative;
- text-decoration: none;
-}
-.navigationTabs li a:hover {
- background-color: #f0f0f0;
-}
-.navigationTabs li a.active {
- background-color: #fff;
- border: 1px solid #ccc;
- border-bottom: 0px solid;
-}
-.tabsContent {
- border: 1px solid #ccc;
- border-top: 0px solid;
- width: 698px;
- overflow: hidden;
-}
-.tab {
- padding: 16px;
- display: block;
-}
-.tab h2 {
- font-weight: bold;
- font-size: 16px;
-}
-.tab h3 {
- font-weight: bold;
- font-size: 14px;
- margin-top: 20px;
-}
-.tab p {
- margin-top: 16px;
- clear: both;
-}
-.tab ul {
- margin-top: 16px;
- list-style: disc;
-}
-.tab li {
- margin: 10px 0 0 35px;
-}
-.tab a {
- color: #8FB0CF;
-}
-.tab strong {
- font-weight: bold;
-}
-.tab pre {
- font-size: 11px;
- margin-top: 20px;
- width: 668px;
- overflow: auto;
- clear: both;
-}
-.tab table {
- width: 100%;
-}
-.tab table td {
- padding: 6px 10px 6px 0;
- vertical-align: top;
-}
-.tab dt {
- margin-top: 16px;
-}
-
-#colorSelector {
- position: relative;
- width: 36px;
- height: 36px;
- background: url(../../themes/default/images/select.png);
-}
-#colorSelector div {
- position: absolute;
- top: 3px;
- left: 3px;
- width: 30px;
- height: 30px;
- background: url(../../themes/default/images/select.png) center;
-}
-#colorSelector2 {
- position: absolute;
- top: 0;
- left: 0;
- width: 36px;
- height: 36px;
- background: url(../../themes/default/images/select2.png);
-}
-#colorSelector2 div {
- position: absolute;
- top: 4px;
- left: 4px;
- width: 28px;
- height: 28px;
- background: url(../../themes/default/images/select2.png) center;
-}
-#colorpickerHolder2 {
- top: 32px;
- left: 0;
- width: 356px;
- height: 0;
- overflow: hidden;
- position: absolute;
-}
-#colorpickerHolder2 .ui-colorpicker {
- background-image: url(../../themes/default/images/custom_background.png);
- position: absolute;
- bottom: 0;
- left: 0;
-}
-#colorpickerHolder2 .ui-colorpicker-hue div {
- background-image: url(../../themes/default/images/custom_indic.gif);
-}
-#colorpickerHolder2 .ui-colorpicker-hex {
- background-image: url(../../themes/default/images/custom_hex.png);
-}
-#colorpickerHolder2 .ui-colorpicker-rgb-r {
- background-image: url(../../themes/default/images/custom_rgb_r.png);
-}
-#colorpickerHolder2 .ui-colorpicker-rgb-g {
- background-image: url(../../themes/default/images/custom_rgb_g.png);
-}
-#colorpickerHolder2 .ui-colorpicker-rgb-b {
- background-image: url(../../themes/default/images/custom_rgb_b.png);
-}
-#colorpickerHolder2 .ui-colorpicker-hsb-s {
- background-image: url(../../themes/default/images/custom_hsb_s.png);
- display: none;
-}
-#colorpickerHolder2 .ui-colorpicker-hsb-h {
- background-image: url(../../themes/default/images/custom_hsb_h.png);
- display: none;
-}
-#colorpickerHolder2 .ui-colorpicker-hsb-b {
- background-image: url(../../themes/default/images/custom_hsb_b.png);
- display: none;
-}
-#colorpickerHolder2 .ui-colorpicker-submit {
- background-image: url(../../themes/default/images/colorpicker_submit.png);
-}
-#colorpickerHolder2 .ui-colorpicker input {
- color: #778398;
-}
-#customWidget {
- position: relative;
- height: 36px;
-}
-
-
-</style>
-
-<link rel="stylesheet" href="../../themes/default/ui.all.css" type="text/css" media="screen" title="no title" charset="utf-8">
-
-<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
-<script type="text/javascript" src="../../ui/ui.core.js"></script>
-<script type="text/javascript" src="../../ui/ui.colorpicker.js"></script>
-
-<script type="text/javascript">
-
-$(document).ready(function() {
-
- $('#colorpickerHolder').colorpicker({ flat: true });
- $('#colorpickerHolder2').colorpicker({
- flat: true,
- color: '#00ff00',
- submit: function(e, ui) {
- $('#colorSelector2 div').css('backgroundColor', '#' + ui.hex);
- }
- });
- $('#colorpickerHolder2>div').css('position', 'absolute');
- var widt = false;
- $('#colorSelector2').bind('click', function() {
- $('#colorpickerHolder2').stop().animate({height: widt ? 0 : 173}, 500);
- widt = !widt;
- });
- $('#colorpickerField1').colorpicker({
- submit: function(e, ui) {
- $('#colorpickerField1').val(ui.hex);
- },
- beforeShow: function (e, ui) {
- $(this).colorpicker("setColor", this.value);
- }
- })
- .bind('keyup', function(){
- $(this).colorpicker("setColor", this.value);
- });
- $('#colorSelector').colorpicker({
- color: '#0000ff',
- show: function (e, ui) {
- $(this).data("colorpicker").picker.fadeIn(500);
- return false;
- },
- hide: function (e, ui) {
- $(this).data("colorpicker").picker.fadeOut(500);
- return false;
- },
- change: function (e, ui) {
- $('#colorSelector div').css('backgroundColor', '#' + ui.hex);
- }
- });
-
-});
-
-</script>
-
-
-</head>
-<body>
- <div class="wrapper">
- <h1>Color Picker</h1>
- <ul class="navigationTabs">
- <li><a href="#about" rel="about">About</a></li>
- </ul>
- <div class="tabsContent">
- <div class="tab">
- <h2>About</h2>
- <p>A simple component to select color in the same way you select color in Adobe Photoshop</p>
- <h3>Features</h3>
- <ul>
- <li>Flat mode - as element in page</li>
- <li>Powerful controls for color selection</li>
- <li>Easy to customize the look by changing some images</li>
- <li>Fits into the viewport</li>
- </ul>
- <h3>Examples</h3>
- <p>Flat mode.</p>
- <p id="colorpickerHolder">
- </p>
- <pre>
-$('#colorpickerHolder').ColorPicker({flat: true});
- </pre>
- <p>Custom skin and using flat mode to display the color picker in a custom widget.</p>
- <div id="customWidget">
- <div id="colorSelector2"><div style="background-color: #00ff00"></div></div>
- <div id="colorpickerHolder2">
- </div>
- </div>
-
- <p>Attached to an text field and using callback functions to update the color with field's value and set the value back in the field by submiting the color.</p>
- <p><input type="text" maxlength="6" size="6" id="colorpickerField1" value="00ff00" /></p>
- <pre>
-$('#colorpickerField1').ColorPicker({
- onSubmit: function(hsb, hex, rgb) {
- $('#colorpickerField1').val(hex);
- },
- onBeforeShow: function () {
- $(this).ColorPickerSetColor(this.value);
- }
-})
-.bind('keyup', function(){
- $(this).ColorPickerSetColor(this.value);
-});
-</pre>
- <p>Attached to DOMElement and using callbacks to live preview the color and adding animation.</p>
- <p>
- <div id="colorSelector"><div style="background-color: #0000ff"></div></div>
- </p>
- <pre>
-$('#colorSelector').ColorPicker({
- color: '#0000ff',
- onShow: function (colpkr) {
- $(colpkr).fadeIn(500);
- return false;
- },
- onHide: function (colpkr) {
- $(colpkr).fadeOut(500);
- return false;
- },
- onChange: function (hsb, hex, rgb) {
- $('#colorSelector div').css('backgroundColor', '#' + hex);
- }
-});
-</pre>
- </div>
- </div>
- </div>
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + + <title>ColorPicker</title> + +<style type="text/css" media="screen"> + +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { + margin:0; + padding:0; +} +table { + border-collapse:collapse; + border-spacing:0; +} +fieldset,img { + border:0; +} +address,caption,cite,code,dfn,em,strong,th,var { + font-style:normal; + font-weight:normal; +} +ol,ul { + list-style:none; +} +caption,th { + text-align:left; +} +h1,h2,h3,h4,h5,h6 { + font-size:100%; + font-weight:normal; +} +q:before,q:after { + content:''; +} +abbr,acronym { border:0; +} +html, body { + background-color: #fff; + font-family: Arial, Helvetica, sans-serif; + font-size: 12px; + line-height: 18px; + color: #52697E; +} +body { + text-align: center; + overflow: auto; +} +.wrapper { + width: 700px; + margin: 0 auto; + text-align: left; +} +h1 { + font-size: 21px; + height: 47px; + line-height: 47px; + text-transform: uppercase; +} +.navigationTabs { + height: 23px; + line-height: 23px; + border-bottom: 1px solid #ccc; +} +.navigationTabs li { + float: left; + height: 23px; + line-height: 23px; + padding-right: 3px; +} +.navigationTabs li a{ + float: left; + dispaly: block; + height: 23px; + line-height: 23px; + padding: 0 10px; + overflow: hidden; + color: #52697E; + background-color: #eee; + position: relative; + text-decoration: none; +} +.navigationTabs li a:hover { + background-color: #f0f0f0; +} +.navigationTabs li a.active { + background-color: #fff; + border: 1px solid #ccc; + border-bottom: 0px solid; +} +.tabsContent { + border: 1px solid #ccc; + border-top: 0px solid; + width: 698px; + overflow: hidden; +} +.tab { + padding: 16px; + display: block; +} +.tab h2 { + font-weight: bold; + font-size: 16px; +} +.tab h3 { + font-weight: bold; + font-size: 14px; + margin-top: 20px; +} +.tab p { + margin-top: 16px; + clear: both; +} +.tab ul { + margin-top: 16px; + list-style: disc; +} +.tab li { + margin: 10px 0 0 35px; +} +.tab a { + color: #8FB0CF; +} +.tab strong { + font-weight: bold; +} +.tab pre { + font-size: 11px; + margin-top: 20px; + width: 668px; + overflow: auto; + clear: both; +} +.tab table { + width: 100%; +} +.tab table td { + padding: 6px 10px 6px 0; + vertical-align: top; +} +.tab dt { + margin-top: 16px; +} + +#colorSelector { + position: relative; + width: 36px; + height: 36px; + background: url(../../themes/default/images/select.png); +} +#colorSelector div { + position: absolute; + top: 3px; + left: 3px; + width: 30px; + height: 30px; + background: url(../../themes/default/images/select.png) center; +} +#colorSelector2 { + position: absolute; + top: 0; + left: 0; + width: 36px; + height: 36px; + background: url(../../themes/default/images/select2.png); +} +#colorSelector2 div { + position: absolute; + top: 4px; + left: 4px; + width: 28px; + height: 28px; + background: url(../../themes/default/images/select2.png) center; +} +#colorpickerHolder2 { + top: 32px; + left: 0; + width: 356px; + height: 0; + overflow: hidden; + position: absolute; +} +#colorpickerHolder2 .ui-colorpicker { + background-image: url(../../themes/default/images/custom_background.png); + position: absolute; + bottom: 0; + left: 0; +} +#colorpickerHolder2 .ui-colorpicker-hue div { + background-image: url(../../themes/default/images/custom_indic.gif); +} +#colorpickerHolder2 .ui-colorpicker-hex { + background-image: url(../../themes/default/images/custom_hex.png); +} +#colorpickerHolder2 .ui-colorpicker-rgb-r { + background-image: url(../../themes/default/images/custom_rgb_r.png); +} +#colorpickerHolder2 .ui-colorpicker-rgb-g { + background-image: url(../../themes/default/images/custom_rgb_g.png); +} +#colorpickerHolder2 .ui-colorpicker-rgb-b { + background-image: url(../../themes/default/images/custom_rgb_b.png); +} +#colorpickerHolder2 .ui-colorpicker-hsb-s { + background-image: url(../../themes/default/images/custom_hsb_s.png); + display: none; +} +#colorpickerHolder2 .ui-colorpicker-hsb-h { + background-image: url(../../themes/default/images/custom_hsb_h.png); + display: none; +} +#colorpickerHolder2 .ui-colorpicker-hsb-b { + background-image: url(../../themes/default/images/custom_hsb_b.png); + display: none; +} +#colorpickerHolder2 .ui-colorpicker-submit { + background-image: url(../../themes/default/images/colorpicker_submit.png); +} +#colorpickerHolder2 .ui-colorpicker input { + color: #778398; +} +#customWidget { + position: relative; + height: 36px; +} + + +</style> + +<link rel="stylesheet" href="../../themes/default/ui.all.css" type="text/css" media="screen" title="no title" charset="utf-8"> + +<script type="text/javascript" src="../../jquery-1.2.6.js"></script> +<script type="text/javascript" src="../../ui/ui.core.js"></script> +<script type="text/javascript" src="../../ui/ui.colorpicker.js"></script> + +<script type="text/javascript"> + +$(document).ready(function() { + + $('#colorpickerHolder').colorpicker({ flat: true }); + $('#colorpickerHolder2').colorpicker({ + flat: true, + color: '#00ff00', + submit: function(e, ui) { + $('#colorSelector2 div').css('backgroundColor', '#' + ui.hex); + } + }); + $('#colorpickerHolder2>div').css('position', 'absolute'); + var widt = false; + $('#colorSelector2').bind('click', function() { + $('#colorpickerHolder2').stop().animate({height: widt ? 0 : 173}, 500); + widt = !widt; + }); + $('#colorpickerField1').colorpicker({ + submit: function(e, ui) { + $('#colorpickerField1').val(ui.hex); + }, + beforeShow: function (e, ui) { + $(this).colorpicker("setColor", this.value); + } + }) + .bind('keyup', function(){ + $(this).colorpicker("setColor", this.value); + }); + $('#colorSelector').colorpicker({ + color: '#0000ff', + show: function (e, ui) { + $(this).data("colorpicker").picker.fadeIn(500); + return false; + }, + hide: function (e, ui) { + $(this).data("colorpicker").picker.fadeOut(500); + return false; + }, + change: function (e, ui) { + $('#colorSelector div').css('backgroundColor', '#' + ui.hex); + } + }); + +}); + +</script> + + +</head> +<body> + <div class="wrapper"> + <h1>Color Picker</h1> + <ul class="navigationTabs"> + <li><a href="#about" rel="about">About</a></li> + </ul> + <div class="tabsContent"> + <div class="tab"> + <h2>About</h2> + <p>A simple component to select color in the same way you select color in Adobe Photoshop</p> + <h3>Features</h3> + <ul> + <li>Flat mode - as element in page</li> + <li>Powerful controls for color selection</li> + <li>Easy to customize the look by changing some images</li> + <li>Fits into the viewport</li> + </ul> + <h3>Examples</h3> + <p>Flat mode.</p> + <p id="colorpickerHolder"> + </p> + <pre> +$('#colorpickerHolder').ColorPicker({flat: true}); + </pre> + <p>Custom skin and using flat mode to display the color picker in a custom widget.</p> + <div id="customWidget"> + <div id="colorSelector2"><div style="background-color: #00ff00"></div></div> + <div id="colorpickerHolder2"> + </div> + </div> + + <p>Attached to an text field and using callback functions to update the color with field's value and set the value back in the field by submiting the color.</p> + <p><input type="text" maxlength="6" size="6" id="colorpickerField1" value="00ff00" /></p> + <pre> +$('#colorpickerField1').ColorPicker({ + onSubmit: function(hsb, hex, rgb) { + $('#colorpickerField1').val(hex); + }, + onBeforeShow: function () { + $(this).ColorPickerSetColor(this.value); + } +}) +.bind('keyup', function(){ + $(this).ColorPickerSetColor(this.value); +}); +</pre> + <p>Attached to DOMElement and using callbacks to live preview the color and adding animation.</p> + <p> + <div id="colorSelector"><div style="background-color: #0000ff"></div></div> + </p> + <pre> +$('#colorSelector').ColorPicker({ + color: '#0000ff', + onShow: function (colpkr) { + $(colpkr).fadeIn(500); + return false; + }, + onHide: function (colpkr) { + $(colpkr).fadeOut(500); + return false; + }, + onChange: function (hsb, hex, rgb) { + $('#colorSelector div').css('backgroundColor', '#' + hex); + } +}); +</pre> + </div> + </div> + </div> +</body> +</html> diff --git a/tests/visual/datepicker.html b/tests/visual/datepicker.html index d3439fd35..7fea7cbea 100644 --- a/tests/visual/datepicker.html +++ b/tests/visual/datepicker.html @@ -1,28 +1,28 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple Datepicker</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <link rel="stylesheet" href="../../themes/ui.datepicker.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.datepicker.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#datepicker").datepicker();
- });
- </script>
-</head>
-<body>
-
-<ul class="plugins">
-<li>
- Datepicker
- <div style="text-align:left;margin-left:10px;">
- <input type="text" id="datepicker">
- </div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple Datepicker</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <link rel="stylesheet" href="../../themes/ui.datepicker.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.datepicker.js"></script> + <script type="text/javascript"> + $(function() { + $("#datepicker").datepicker(); + }); + </script> +</head> +<body> + +<ul class="plugins"> +<li> + Datepicker + <div style="text-align:left;margin-left:10px;"> + <input type="text" id="datepicker"> + </div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/dialog.html b/tests/visual/dialog.html index 66a3f88c1..d0733c920 100644 --- a/tests/visual/dialog.html +++ b/tests/visual/dialog.html @@ -1,31 +1,31 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple Dialog</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.dialog.js"></script>
- <script type="text/javascript" src="../../ui/ui.draggable.js"></script>
- <script type="text/javascript" src="../../ui/ui.resizable.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#dialog").click(function() {
- $("<div/>").dialog();
- });
- });
- </script>
-</head>
-<body>
-
-<ul class="plugins">
-<li>
- Dialog
- <div id="dialog">
- <button>Open</button>
- </div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple Dialog</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.dialog.js"></script> + <script type="text/javascript" src="../../ui/ui.draggable.js"></script> + <script type="text/javascript" src="../../ui/ui.resizable.js"></script> + <script type="text/javascript"> + $(function() { + $("#dialog").click(function() { + $("<div/>").dialog(); + }); + }); + </script> +</head> +<body> + +<ul class="plugins"> +<li> + Dialog + <div id="dialog"> + <button>Open</button> + </div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/draggable.handle.html b/tests/visual/draggable.handle.html index fa58014f7..798898363 100644 --- a/tests/visual/draggable.handle.html +++ b/tests/visual/draggable.handle.html @@ -1,27 +1,27 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple Draggable</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.draggable.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#draggable").draggable({ handle: "span" });
- });
- </script>
-</head>
-<body>
-
-<ul class="plugins">
-<li>
- Draggable
- <div id="draggable">
- <span>Handle</span>
- </div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple Draggable</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.draggable.js"></script> + <script type="text/javascript"> + $(function() { + $("#draggable").draggable({ handle: "span" }); + }); + </script> +</head> +<body> + +<ul class="plugins"> +<li> + Draggable + <div id="draggable"> + <span>Handle</span> + </div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/draggable.html b/tests/visual/draggable.html index 97de96492..bade45b0e 100644 --- a/tests/visual/draggable.html +++ b/tests/visual/draggable.html @@ -1,25 +1,25 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple Draggable</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.draggable.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#draggable").draggable();
- });
- </script>
-</head>
-<body>
-
-<ul class="plugins">
-<li>
- Draggable
- <div id="draggable"></div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple Draggable</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.draggable.js"></script> + <script type="text/javascript"> + $(function() { + $("#draggable").draggable(); + }); + </script> +</head> +<body> + +<ul class="plugins"> +<li> + Draggable + <div id="draggable"></div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/droppable.html b/tests/visual/droppable.html index b89176679..264978e9c 100644 --- a/tests/visual/droppable.html +++ b/tests/visual/droppable.html @@ -1,39 +1,39 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple Droppable</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.draggable.js"></script>
- <script type="text/javascript" src="../../ui/ui.droppable.js"></script>
- <script type="text/javascript">
- $(function() {
- $(".draggable").draggable();
- $("#droppable").droppable({
- accept: '.draggable',
- drop: function(ev, ui) {
- ui.draggable.css({ position: 'relative', top: 0, left: 0 }).clone().appendTo(this);
- }
- });
- });
- </script>
-</head>
-<body>
-
-<ul class="plugins">
-<li>
- Droppable
- <div class="draggable">D</div>
- <div class="draggable">R</div>
- <div class="draggable">A</div>
- <div class="draggable">G</div>
- <div id="droppable">
- DROP
- <hr>
- </div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple Droppable</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.draggable.js"></script> + <script type="text/javascript" src="../../ui/ui.droppable.js"></script> + <script type="text/javascript"> + $(function() { + $(".draggable").draggable(); + $("#droppable").droppable({ + accept: '.draggable', + drop: function(ev, ui) { + ui.draggable.css({ position: 'relative', top: 0, left: 0 }).clone().appendTo(this); + } + }); + }); + </script> +</head> +<body> + +<ul class="plugins"> +<li> + Droppable + <div class="draggable">D</div> + <div class="draggable">R</div> + <div class="draggable">A</div> + <div class="draggable">G</div> + <div id="droppable"> + DROP + <hr> + </div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/effects.all.css b/tests/visual/effects.all.css index 587c64696..88d513b2c 100644 --- a/tests/visual/effects.all.css +++ b/tests/visual/effects.all.css @@ -1,49 +1,49 @@ -body,html {
- margin: 0;
- padding: 0;
- font-size: 12px;
- font-family: Arial;
- background: #000;
-}
-
-ul.effects {
- margin: 0;
- padding: 0;
-}
-
-ul.effects li {
- margin: 0;
- padding: 0;
- width: 120px;
- height: 100px;
- float: left;
- margin-top: 20px;
- margin-left: 20px;
-}
-
-div.effect {
- width: 120px;
- height: 100px;
- background: #333;
- border: 5px outset #aaa;
- float: left;
- 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;
+body,html { + margin: 0; + padding: 0; + font-size: 12px; + font-family: Arial; + background: #000; +} + +ul.effects { + margin: 0; + padding: 0; +} + +ul.effects li { + margin: 0; + padding: 0; + width: 120px; + height: 100px; + float: left; + margin-top: 20px; + margin-left: 20px; +} + +div.effect { + width: 120px; + height: 100px; + background: #333; + border: 5px outset #aaa; + float: left; + 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/tests/visual/effects.all.html b/tests/visual/effects.all.html index 180a6972d..d89dbecd8 100644 --- a/tests/visual/effects.all.html +++ b/tests/visual/effects.all.html @@ -1,165 +1,165 @@ -<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <title>Effects Test Suite</title>
- <link rel="stylesheet" href="effects.all.css" type="text/css" media="screen" title="no title" charset="utf-8" />
-
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/effects.core.js"></script>
-
- <script type="text/javascript" src="../../ui/effects.blind.js"></script>
- <script type="text/javascript" src="../../ui/effects.bounce.js"></script>
- <script type="text/javascript" src="../../ui/effects.clip.js"></script>
- <script type="text/javascript" src="../../ui/effects.drop.js"></script>
- <script type="text/javascript" src="../../ui/effects.explode.js"></script>
- <script type="text/javascript" src="../../ui/effects.fold.js"></script>
- <script type="text/javascript" src="../../ui/effects.highlight.js"></script>
- <script type="text/javascript" src="../../ui/effects.pulsate.js"></script>
- <script type="text/javascript" src="../../ui/effects.scale.js"></script>
- <script type="text/javascript" src="../../ui/effects.shake.js"></script>
- <script type="text/javascript" src="../../ui/effects.slide.js"></script>
- <script type="text/javascript" src="../../ui/effects.transfer.js"></script>
-
- <script type="text/javascript" src="effects.all.js"></script>
-</head>
-<body>
-
-<ul class="effects">
-
- <li>
- <div class="effect" id="blindHorizontally">
- <p>Blind horizontally</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="blindVertically">
- <p>Blind vertically</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="bounce3times">
- <p>Bounce 3 times</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="clipHorizontally">
- <p>Clip horizontally</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="clipVertically">
- <p>Clip vertically</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="dropDown">
- <p>Drop down</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="dropUp">
- <p>Drop up</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="dropLeft">
- <p>Drop left</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="dropRight">
- <p>Drop right</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="explode9">
- <p>Explode in 9 pieces</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="explode36">
- <p>Explode in 36 pieces</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="fold">
- <p>Fold</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="highlight">
- <p>Highlight</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="pulsate">
- <p>Pulsate 2 times</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="puff">
- <p>Puff</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="scale">
- <p>Scale</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="shake">
- <p>Shake</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="slideDown">
- <p>Slide down</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="slideUp">
- <p>Slide up</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="slideLeft">
- <p>Slide left</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="slideRight">
- <p>Slide right</p>
- </div>
- </li>
-
- <li>
- <div class="effect" id="transfer">
- <p>Transfer to first element</p>
- </div>
- </li>
-
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> + <title>Effects Test Suite</title> + <link rel="stylesheet" href="effects.all.css" type="text/css" media="screen" title="no title" charset="utf-8" /> + + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/effects.core.js"></script> + + <script type="text/javascript" src="../../ui/effects.blind.js"></script> + <script type="text/javascript" src="../../ui/effects.bounce.js"></script> + <script type="text/javascript" src="../../ui/effects.clip.js"></script> + <script type="text/javascript" src="../../ui/effects.drop.js"></script> + <script type="text/javascript" src="../../ui/effects.explode.js"></script> + <script type="text/javascript" src="../../ui/effects.fold.js"></script> + <script type="text/javascript" src="../../ui/effects.highlight.js"></script> + <script type="text/javascript" src="../../ui/effects.pulsate.js"></script> + <script type="text/javascript" src="../../ui/effects.scale.js"></script> + <script type="text/javascript" src="../../ui/effects.shake.js"></script> + <script type="text/javascript" src="../../ui/effects.slide.js"></script> + <script type="text/javascript" src="../../ui/effects.transfer.js"></script> + + <script type="text/javascript" src="effects.all.js"></script> +</head> +<body> + +<ul class="effects"> + + <li> + <div class="effect" id="blindHorizontally"> + <p>Blind horizontally</p> + </div> + </li> + + <li> + <div class="effect" id="blindVertically"> + <p>Blind vertically</p> + </div> + </li> + + <li> + <div class="effect" id="bounce3times"> + <p>Bounce 3 times</p> + </div> + </li> + + <li> + <div class="effect" id="clipHorizontally"> + <p>Clip horizontally</p> + </div> + </li> + + <li> + <div class="effect" id="clipVertically"> + <p>Clip vertically</p> + </div> + </li> + + <li> + <div class="effect" id="dropDown"> + <p>Drop down</p> + </div> + </li> + + <li> + <div class="effect" id="dropUp"> + <p>Drop up</p> + </div> + </li> + + <li> + <div class="effect" id="dropLeft"> + <p>Drop left</p> + </div> + </li> + + <li> + <div class="effect" id="dropRight"> + <p>Drop right</p> + </div> + </li> + + <li> + <div class="effect" id="explode9"> + <p>Explode in 9 pieces</p> + </div> + </li> + + <li> + <div class="effect" id="explode36"> + <p>Explode in 36 pieces</p> + </div> + </li> + + <li> + <div class="effect" id="fold"> + <p>Fold</p> + </div> + </li> + + <li> + <div class="effect" id="highlight"> + <p>Highlight</p> + </div> + </li> + + <li> + <div class="effect" id="pulsate"> + <p>Pulsate 2 times</p> + </div> + </li> + + <li> + <div class="effect" id="puff"> + <p>Puff</p> + </div> + </li> + + <li> + <div class="effect" id="scale"> + <p>Scale</p> + </div> + </li> + + <li> + <div class="effect" id="shake"> + <p>Shake</p> + </div> + </li> + + <li> + <div class="effect" id="slideDown"> + <p>Slide down</p> + </div> + </li> + + <li> + <div class="effect" id="slideUp"> + <p>Slide up</p> + </div> + </li> + + <li> + <div class="effect" id="slideLeft"> + <p>Slide left</p> + </div> + </li> + + <li> + <div class="effect" id="slideRight"> + <p>Slide right</p> + </div> + </li> + + <li> + <div class="effect" id="transfer"> + <p>Transfer to first element</p> + </div> + </li> + +</ul> + +</body> +</html> diff --git a/tests/visual/effects.all.js b/tests/visual/effects.all.js index ebf0ad082..b52b23726 100644 --- a/tests/visual/effects.all.js +++ b/tests/visual/effects.all.js @@ -1,65 +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"); }); });
-
+$(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/tests/visual/magnifier.html b/tests/visual/magnifier.html index 75b64807a..39d8fe96c 100644 --- a/tests/visual/magnifier.html +++ b/tests/visual/magnifier.html @@ -1,107 +1,107 @@ -<!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>Magnifier Demo</title>
-
-<style type="text/css">
-
-body,html {
- margin: 0;
- padding: 0;
- font-family: Arial;
- font-size: 12px;
-}
-
-div.playground {
- height: 150px;
-}
-
-#example1 img,
-#example2 img,
-#example3 img,
-#example4 img {
- float:left;
-}
-
-</style>
-<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
-<script type="text/javascript" src="../../ui/ui.core.js"></script>
-<script type="text/javascript" src="../../ui/ui.magnifier.js"></script>
-
-
-</head>
-<body>
-
-<h2>1. Default, no options</h2>
-<div class="playground">
- <div id='example1' class="ui-wrapper example" style="width: 580px; padding: 20px;">
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- </div>
-</div>
-
-<h2>2. Magnification set to 1.5 (default: 2)</h2>
-<div class="playground">
- <div id='example2' class="ui-wrapper example" style="width: 580px; padding: 20px;">
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- </div>
-</div>
-
-<h2>3. Advanced example: overlap: true, zIndex: 10, opacity: { min: 0.6, max: 1 }, baseline: -1</h2>
-<div class="playground">
- <div id='example3' class="ui-wrapper example" style="width: 580px; padding: 20px;">
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- </div>
-</div>
-
-<h2>4. Advanced example: The direction doesn't have to be horizontal!</h2>
-<div class="playground">
- <div id='example4' class="ui-wrapper example" style="width: 150px; padding: 20px; height: 150px;">
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- <img src="../images/clock.png" width="48" alt="" />
- </div>
-</div>
-
-<script type="text/javascript">
-if(!window.console) {
- window.console = {
- log: function() {
- alert(arguments[0]);
- }
- }
-}
-
-$(window).bind("load",function(){
-
- $('#example1').magnifier();
- $('#example2').magnifier({ magnification: 1.5 });
- $('#example3').magnifier({ magnification: 1.5, overlap: true, zIndex: 10, opacity: { min: 0.6, max: 1 }, baseline: -1 });
- $('#example4').magnifier({ magnification: 1.5, overlap: true, zIndex: 10, opacity: { min: 0.6, max: 1 }, distance: 30 });
-
-});
-</script>
-</body>
-</html>
+<!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>Magnifier Demo</title> + +<style type="text/css"> + +body,html { + margin: 0; + padding: 0; + font-family: Arial; + font-size: 12px; +} + +div.playground { + height: 150px; +} + +#example1 img, +#example2 img, +#example3 img, +#example4 img { + float:left; +} + +</style> +<script type="text/javascript" src="../../jquery-1.2.6.js"></script> +<script type="text/javascript" src="../../ui/ui.core.js"></script> +<script type="text/javascript" src="../../ui/ui.magnifier.js"></script> + + +</head> +<body> + +<h2>1. Default, no options</h2> +<div class="playground"> + <div id='example1' class="ui-wrapper example" style="width: 580px; padding: 20px;"> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + </div> +</div> + +<h2>2. Magnification set to 1.5 (default: 2)</h2> +<div class="playground"> + <div id='example2' class="ui-wrapper example" style="width: 580px; padding: 20px;"> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + </div> +</div> + +<h2>3. Advanced example: overlap: true, zIndex: 10, opacity: { min: 0.6, max: 1 }, baseline: -1</h2> +<div class="playground"> + <div id='example3' class="ui-wrapper example" style="width: 580px; padding: 20px;"> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + </div> +</div> + +<h2>4. Advanced example: The direction doesn't have to be horizontal!</h2> +<div class="playground"> + <div id='example4' class="ui-wrapper example" style="width: 150px; padding: 20px; height: 150px;"> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + <img src="../images/clock.png" width="48" alt="" /> + </div> +</div> + +<script type="text/javascript"> +if(!window.console) { + window.console = { + log: function() { + alert(arguments[0]); + } + } +} + +$(window).bind("load",function(){ + + $('#example1').magnifier(); + $('#example2').magnifier({ magnification: 1.5 }); + $('#example3').magnifier({ magnification: 1.5, overlap: true, zIndex: 10, opacity: { min: 0.6, max: 1 }, baseline: -1 }); + $('#example4').magnifier({ magnification: 1.5, overlap: true, zIndex: 10, opacity: { min: 0.6, max: 1 }, distance: 30 }); + +}); +</script> +</body> +</html> diff --git a/tests/visual/progressbar.html b/tests/visual/progressbar.html index 79dae2e4d..6341a342f 100644 --- a/tests/visual/progressbar.html +++ b/tests/visual/progressbar.html @@ -1,294 +1,294 @@ -<!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>ProgressBar Test Page</title>
-<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
-<script type="text/javascript" src="../../ui/ui.core.js"></script>
-<script type="text/javascript" src="../../ui/ui.resizable.js"></script>
-<script type="text/javascript" src="../../ui/ui.draggable.js"></script>
-<script type="text/javascript" src="../../ui/ui.progressbar.js"></script>
-<script type="text/javascript" src="../../ui/effects.core.js"></script>
-
-<style type="text/css" media="all">
-
-body
-{
- background: #fff;
- font-family: Arial;
-}
-
-#log {
- right:0px;
- top:0px;
- background-color:#FAFCFE;
- border:1px solid #DFE8F6;
- height:400px;
- width:300px;
- position:absolute;
- overflow:auto;
-}
-
-/* ProgressBar */
-
-.ui-progressbar {
- width: 400px; height: 20px;
- border: 1px #ccc solid;
- background:#E0E8F3 url(../images/bg.gif) repeat-x scroll 0%;
- position:relative;
-}
-
-.ui-progressbar-wrap {
- position: relative;
- height: auto;
- width: auto;
- line-height: 18px;
- _line-height: 16px;
-}
-
-.ui-progressbar-bar {
- background:#9CBFEE url(../images/progress-bg.gif) repeat-x scroll left center;
- border-bottom:1px solid #7FA9E4;
- border-right:1px solid #7FA9E4;
- border-top:1px solid #D1E4FD;
- position: absolute;
-}
-
-.ui-progressbar-text {
- color:#fff;
- overflow: hidden;
- white-space: nowrap;
- font-size: 11px;
- font-weight: bold;
- padding-left: 5px;
-}
-
-.ui-progressbar-text-back {
- color:#000;
- padding-top: 1px;
- padding-bottom: 1px;
- padding-right: 1px;
-}
-
-.ui-progressbar-disabled {
- opacity:.5;
- filter:Alpha(Opacity=50);
-}
-
-
-/* custom */
-.ui-progressbar-text.right-align {
- text-align: right;
- padding: 0 5px 0 0;
-}
-.ui-progressbar-inner-custom {
- background: url(../images/custom-bar.gif) repeat-x scroll left center;
- border-bottom:1px solid #EFEFEF;
- border-right:0pt none;
- border-top:1px solid #BEBEBE;
- height:15px;
-}
-.bold {
- color: red !important;
-}
-.ui-hidden {
- left:-10000px;
- position:absolute;
- top:-10000px;
- visibility:hidden;
-}
-
-</style>
-</head>
-<body >
-
-<h1>jQuery - ProgressBar</h1>
-
-<div id="log">log</div>
-
-
-<div id='p1'></div><br>
-
-<button id="p1-create">Create</button>
-<button id="p1-destroy" onclick="$('#p1').progressbar('destroy');">destroy</button>
-<button id="p1-start" onclick="$('#p1').progressbar('start');">Start</button>
-<button id="p1-stop" onclick="$('#p1').progressbar('stop');">Stop</button>
-<button id="p1-stop" onclick="$('#p1').progressbar('pause');">pause</button>
-<button id="p1-enable" onclick="$('#p1').progressbar('enable');">enable</button>
-<button id="p1-disable" onclick="$('#p1').progressbar('disable');">disable</button>
-<button id="p1-progress" onclick="$('#p1').progressbar('progress', 50);">progress to 50</button>
-<button id="p1-progress" onclick="$('#p1').progressbar('text', 'Textchanged!');">Change text</button>
-
-<br><br>
-
-<div id='p2'></div><br>
-
-<button id="p2-create">Create</button>
-<button id="p2-destroy" onclick="$('#p2').progressbar('destroy');">destroy</button>
-<button id="p2-start" onclick="$('#p2').progressbar('start');">Start</button>
-<button id="p2-stop" onclick="$('#p2').progressbar('stop');">Stop</button>
-<button id="p2-stop" onclick="$('#p2').progressbar('pause');">pause</button>
-<button id="p2-enable" onclick="$('#p2').progressbar('enable');">enable</button>
-<button id="p2-disable" onclick="$('#p2').progressbar('disable');">disable</button>
-<button id="p2-progress" onclick="$('#p2').progressbar('progress', 40);">progress to 50</button>
-
-<br><br>
-
-<div id='p3'></div><br>
-
-<button id="p3-create">Create</button>
-<button id="p3-destroy" onclick="$('#p3').progressbar('destroy');">destroy</button>
-<button id="p3-start" onclick="$('#p3').progressbar('start');">Start</button>
-<button id="p3-stop" onclick="$('#p3').progressbar('stop');">Stop</button>
-<button id="p3-stop" onclick="$('#p3').progressbar('pause');">pause</button>
-<button id="p3-enable" onclick="$('#p3').progressbar('enable');">enable</button>
-<button id="p3-disable" onclick="$('#p3').progressbar('disable');">disable</button>
-<button id="p3-progress" onclick="$('#p3').progressbar('progress', $('#p3-value').val());">progress to</button>
-<input type="text" id="p3-value" value="35"/>
-
-<br><br>
-
-<button id="p2-startall" onclick="$('#p2, #p1, #p3').progressbar('start');">Start All</button>
-<button id="p2-stopall" onclick="$('#p2, #p1, #p3').progressbar('stop');">Stop All</button>
-<button id="p2-stopall" onclick="$('#p2, #p1, #p3').progressbar('pause');">Pause All</button>
-
-<script>
-
-$(function() {
-
- $('#p1-create').click(function() {
-
- $('#p1').progressbar({
-
- text: 'jQuery ProgressBar waiting...',
-
- //addClass: 'ui-progressbar-inner-custom teste',
-
- //textClass: 'right-align',
-
- //align: 'right',
-
- equation: 'easeOutBounce',
-
- width: 500,
-
- duration: 3000,
-
- interval: 800,
-
- increment: 1,
-
- progress: function(ui) {
- //console.log(ui.pixelRange);
- //console.log(ui);
- //ui.instance.text('Waiting...');
- },
-
- stop: function(ui) {
- //console.log('user stop', ui);
- },
-
- start: function(ui) {
- //console.log('user start', ui);
- console.log('p1', ui.identifier);
- }
-
- });
-
- }).trigger("click");
-
-
- $('#p2-create').click(function() {
-
- $('#p2').progressbar({
-
- text: 'Testing...',
-
- //addClass: 'ui-progressbar-inner-custom teste',
-
- //textClass: 'right-align',
-
- //align: 'right',
-
- width: 500,
-
- duration: 5000,
-
- equation: 'easeInOutQuint',
-
- interval: 2000,
-
- increment: 50,
-
- progress: function(ui) {
- //console.log(ui.pixelRange);
- //console.log(ui);
- //ui.instance.text('Waiting...');
- },
-
- stop: function(ui) {
- //console.log('user stop', ui);
- },
-
- start: function(ui) {
- //console.log('user start', ui);
- console.log('p2', ui.identifier);
- }
-
- });
-
- }).trigger("click");
-
-
- $('#p3-create').click(function() {
-
- $('#p3').progressbar({
-
- //text: 'Testing again...',
-
- //addClass: 'ui-progressbar-inner-custom teste',
-
- //textClass: 'right-align',
-
- //align: 'right',
-
- width: 700,
-
- duration: 5000,
-
- interval: 3000,
-
- increment: 10,
-
- progress: function(ui) {
- //console.log(ui.pixelRange);
- //console.log(ui);
- //ui.instance.text('Waiting...');
- },
-
- stop: function(ui) {
- //console.log('user stop', ui);
- },
-
- start: function(ui) {
- //console.log('user start', ui);
- console.log('p3', ui.identifier);
- }
-
- });
- }).trigger('click');
-});
-
-if(!window.console) {
- window.console = {
- log: function() {
- $('#log').append(arguments[0]+"<br>");
- $('#log').scrollTop(999999);
- }
- };
-}
-
-</script>
-</body>
-</html>
+<!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>ProgressBar Test Page</title> +<script type="text/javascript" src="../../jquery-1.2.6.js"></script> +<script type="text/javascript" src="../../ui/ui.core.js"></script> +<script type="text/javascript" src="../../ui/ui.resizable.js"></script> +<script type="text/javascript" src="../../ui/ui.draggable.js"></script> +<script type="text/javascript" src="../../ui/ui.progressbar.js"></script> +<script type="text/javascript" src="../../ui/effects.core.js"></script> + +<style type="text/css" media="all"> + +body +{ + background: #fff; + font-family: Arial; +} + +#log { + right:0px; + top:0px; + background-color:#FAFCFE; + border:1px solid #DFE8F6; + height:400px; + width:300px; + position:absolute; + overflow:auto; +} + +/* ProgressBar */ + +.ui-progressbar { + width: 400px; height: 20px; + border: 1px #ccc solid; + background:#E0E8F3 url(../images/bg.gif) repeat-x scroll 0%; + position:relative; +} + +.ui-progressbar-wrap { + position: relative; + height: auto; + width: auto; + line-height: 18px; + _line-height: 16px; +} + +.ui-progressbar-bar { + background:#9CBFEE url(../images/progress-bg.gif) repeat-x scroll left center; + border-bottom:1px solid #7FA9E4; + border-right:1px solid #7FA9E4; + border-top:1px solid #D1E4FD; + position: absolute; +} + +.ui-progressbar-text { + color:#fff; + overflow: hidden; + white-space: nowrap; + font-size: 11px; + font-weight: bold; + padding-left: 5px; +} + +.ui-progressbar-text-back { + color:#000; + padding-top: 1px; + padding-bottom: 1px; + padding-right: 1px; +} + +.ui-progressbar-disabled { + opacity:.5; + filter:Alpha(Opacity=50); +} + + +/* custom */ +.ui-progressbar-text.right-align { + text-align: right; + padding: 0 5px 0 0; +} +.ui-progressbar-inner-custom { + background: url(../images/custom-bar.gif) repeat-x scroll left center; + border-bottom:1px solid #EFEFEF; + border-right:0pt none; + border-top:1px solid #BEBEBE; + height:15px; +} +.bold { + color: red !important; +} +.ui-hidden { + left:-10000px; + position:absolute; + top:-10000px; + visibility:hidden; +} + +</style> +</head> +<body > + +<h1>jQuery - ProgressBar</h1> + +<div id="log">log</div> + + +<div id='p1'></div><br> + +<button id="p1-create">Create</button> +<button id="p1-destroy" onclick="$('#p1').progressbar('destroy');">destroy</button> +<button id="p1-start" onclick="$('#p1').progressbar('start');">Start</button> +<button id="p1-stop" onclick="$('#p1').progressbar('stop');">Stop</button> +<button id="p1-stop" onclick="$('#p1').progressbar('pause');">pause</button> +<button id="p1-enable" onclick="$('#p1').progressbar('enable');">enable</button> +<button id="p1-disable" onclick="$('#p1').progressbar('disable');">disable</button> +<button id="p1-progress" onclick="$('#p1').progressbar('progress', 50);">progress to 50</button> +<button id="p1-progress" onclick="$('#p1').progressbar('text', 'Textchanged!');">Change text</button> + +<br><br> + +<div id='p2'></div><br> + +<button id="p2-create">Create</button> +<button id="p2-destroy" onclick="$('#p2').progressbar('destroy');">destroy</button> +<button id="p2-start" onclick="$('#p2').progressbar('start');">Start</button> +<button id="p2-stop" onclick="$('#p2').progressbar('stop');">Stop</button> +<button id="p2-stop" onclick="$('#p2').progressbar('pause');">pause</button> +<button id="p2-enable" onclick="$('#p2').progressbar('enable');">enable</button> +<button id="p2-disable" onclick="$('#p2').progressbar('disable');">disable</button> +<button id="p2-progress" onclick="$('#p2').progressbar('progress', 40);">progress to 50</button> + +<br><br> + +<div id='p3'></div><br> + +<button id="p3-create">Create</button> +<button id="p3-destroy" onclick="$('#p3').progressbar('destroy');">destroy</button> +<button id="p3-start" onclick="$('#p3').progressbar('start');">Start</button> +<button id="p3-stop" onclick="$('#p3').progressbar('stop');">Stop</button> +<button id="p3-stop" onclick="$('#p3').progressbar('pause');">pause</button> +<button id="p3-enable" onclick="$('#p3').progressbar('enable');">enable</button> +<button id="p3-disable" onclick="$('#p3').progressbar('disable');">disable</button> +<button id="p3-progress" onclick="$('#p3').progressbar('progress', $('#p3-value').val());">progress to</button> +<input type="text" id="p3-value" value="35"/> + +<br><br> + +<button id="p2-startall" onclick="$('#p2, #p1, #p3').progressbar('start');">Start All</button> +<button id="p2-stopall" onclick="$('#p2, #p1, #p3').progressbar('stop');">Stop All</button> +<button id="p2-stopall" onclick="$('#p2, #p1, #p3').progressbar('pause');">Pause All</button> + +<script> + +$(function() { + + $('#p1-create').click(function() { + + $('#p1').progressbar({ + + text: 'jQuery ProgressBar waiting...', + + //addClass: 'ui-progressbar-inner-custom teste', + + //textClass: 'right-align', + + //align: 'right', + + equation: 'easeOutBounce', + + width: 500, + + duration: 3000, + + interval: 800, + + increment: 1, + + progress: function(ui) { + //console.log(ui.pixelRange); + //console.log(ui); + //ui.instance.text('Waiting...'); + }, + + stop: function(ui) { + //console.log('user stop', ui); + }, + + start: function(ui) { + //console.log('user start', ui); + console.log('p1', ui.identifier); + } + + }); + + }).trigger("click"); + + + $('#p2-create').click(function() { + + $('#p2').progressbar({ + + text: 'Testing...', + + //addClass: 'ui-progressbar-inner-custom teste', + + //textClass: 'right-align', + + //align: 'right', + + width: 500, + + duration: 5000, + + equation: 'easeInOutQuint', + + interval: 2000, + + increment: 50, + + progress: function(ui) { + //console.log(ui.pixelRange); + //console.log(ui); + //ui.instance.text('Waiting...'); + }, + + stop: function(ui) { + //console.log('user stop', ui); + }, + + start: function(ui) { + //console.log('user start', ui); + console.log('p2', ui.identifier); + } + + }); + + }).trigger("click"); + + + $('#p3-create').click(function() { + + $('#p3').progressbar({ + + //text: 'Testing again...', + + //addClass: 'ui-progressbar-inner-custom teste', + + //textClass: 'right-align', + + //align: 'right', + + width: 700, + + duration: 5000, + + interval: 3000, + + increment: 10, + + progress: function(ui) { + //console.log(ui.pixelRange); + //console.log(ui); + //ui.instance.text('Waiting...'); + }, + + stop: function(ui) { + //console.log('user stop', ui); + }, + + start: function(ui) { + //console.log('user start', ui); + console.log('p3', ui.identifier); + } + + }); + }).trigger('click'); +}); + +if(!window.console) { + window.console = { + log: function() { + $('#log').append(arguments[0]+"<br>"); + $('#log').scrollTop(999999); + } + }; +} + +</script> +</body> +</html> diff --git a/tests/visual/resizable.html b/tests/visual/resizable.html index caef95f26..1129db91e 100644 --- a/tests/visual/resizable.html +++ b/tests/visual/resizable.html @@ -1,26 +1,26 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple Resizable</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.resizable.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#resizable").resizable();
- });
- </script>
-</head>
-
-<body>
-
-<ul class="plugins">
-<li>
- Resizable
- <div id="resizable"></div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple Resizable</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.resizable.js"></script> + <script type="text/javascript"> + $(function() { + $("#resizable").resizable(); + }); + </script> +</head> + +<body> + +<ul class="plugins"> +<li> + Resizable + <div id="resizable"></div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/selectable.html b/tests/visual/selectable.html index a0f21d0ef..f3351d898 100644 --- a/tests/visual/selectable.html +++ b/tests/visual/selectable.html @@ -1,36 +1,36 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple Selectable</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.selectable.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#selectable").selectable();
- });
- </script>
-</head>
-
-<body>
-
-<ul class="plugins">
-<li>
- Selectable
- <div id="selectable">
- <div>1</div>
- <div>2</div>
- <div>3</div>
- <div>4</div>
- <div>5</div>
- <div>6</div>
- <div>7</div>
- <div>8</div>
- <div>9</div>
- </div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple Selectable</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.selectable.js"></script> + <script type="text/javascript"> + $(function() { + $("#selectable").selectable(); + }); + </script> +</head> + +<body> + +<ul class="plugins"> +<li> + Selectable + <div id="selectable"> + <div>1</div> + <div>2</div> + <div>3</div> + <div>4</div> + <div>5</div> + <div>6</div> + <div>7</div> + <div>8</div> + <div>9</div> + </div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/slider.html b/tests/visual/slider.html index 543140d10..c6306ed8c 100644 --- a/tests/visual/slider.html +++ b/tests/visual/slider.html @@ -1,26 +1,26 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple Slider</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.slider.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#slider").slider();
- });
- </script>
-</head>
-
-<body>
-
-<ul class="plugins">
-<li>
- Slider
- <div id="slider"></div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple Slider</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.slider.js"></script> + <script type="text/javascript"> + $(function() { + $("#slider").slider(); + }); + </script> +</head> + +<body> + +<ul class="plugins"> +<li> + Slider + <div id="slider"></div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/sortable.html b/tests/visual/sortable.html index d0b6bcb98..6d280ef92 100644 --- a/tests/visual/sortable.html +++ b/tests/visual/sortable.html @@ -1,36 +1,36 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Simple Sortable</title>
- <link rel="stylesheet" href="all.css" type="text/css" media="screen">
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
- <script type="text/javascript">
- $(function() {
- $("#sortable").sortable();
- });
- </script>
-</head>
-
-<body>
-
-<ul class="plugins">
-<li>
- Sortable
- <div id="sortable">
- <div>C</div>
- <div>I</div>
- <div>G</div>
- <div>F</div>
- <div>D</div>
- <div>H</div>
- <div>A</div>
- <div>E</div>
- <div>B</div>
- </div>
-</li>
-</ul>
-
-</body>
-</html>
+<!doctype html> +<html lang="en"> +<head> + <title>Simple Sortable</title> + <link rel="stylesheet" href="all.css" type="text/css" media="screen"> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.sortable.js"></script> + <script type="text/javascript"> + $(function() { + $("#sortable").sortable(); + }); + </script> +</head> + +<body> + +<ul class="plugins"> +<li> + Sortable + <div id="sortable"> + <div>C</div> + <div>I</div> + <div>G</div> + <div>F</div> + <div>D</div> + <div>H</div> + <div>A</div> + <div>E</div> + <div>B</div> + </div> +</li> +</ul> + +</body> +</html> diff --git a/tests/visual/sortable_massive_scale.html b/tests/visual/sortable_massive_scale.html index a7c4c1d04..591341ad2 100644 --- a/tests/visual/sortable_massive_scale.html +++ b/tests/visual/sortable_massive_scale.html @@ -1,756 +1,756 @@ -<!doctype html>
-<html lang="en">
-<head>
- <title>Sortable Visual Test</title>
- <script type="text/javascript" src="../../jquery-1.2.6.js"></script>
- <script type="text/javascript" src="../../ui/ui.core.js"></script>
- <script type="text/javascript" src="../../ui/ui.sortable.js"></script>
- <script type="text/javascript" src="../../ui/ui.draggable.js"></script>
-
- <script type="text/javascript">
-
-
-
- $(document).ready( function() {
- $('ul').not(".draggable").sortable({ items: "li" });
- $("ul.draggable li").draggable({ helper: "clone", connectToSortable: "ul" });
- });
- </script>
- <style>
- ul {
- list-style: none;
- padding: 0;
- border: 1px solid black;
- width: 210px;
- float: left;
- margin-right: 10px;
- }
- li {
- width: 200px;
- background: #eee;
- margin: 5px;
- }
- </style>
-</head>
-<body>
-
-<ul class="draggable">
- <li>Draggable</li>
-</ul>
-
-<ul>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
-</ul>
-
-<ul>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
-</ul>
-
-<ul>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
-</ul>
-
-<ul>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
-</ul>
-
-<ul>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
- <li>Item 1</li>
- <li>Item 2</li>
- <li>Item 3</li>
- <li>Item 4</li>
- <li>Item 5</li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- <li>Item 9</li>
- <li>Item 10</li>
- <li>Item 11</li>
- <li>Item 12</li>
- <li>Item 13</li>
- <li>Item 14</li>
- <li>Item 15</li>
- <li>Item 16</li>
- <li>Item 17</li>
- <li>Item 18</li>
- <li>Item 19</li>
- <li>Item 20</li>
-</ul>
-</body>
+<!doctype html> +<html lang="en"> +<head> + <title>Sortable Visual Test</title> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.sortable.js"></script> + <script type="text/javascript" src="../../ui/ui.draggable.js"></script> + + <script type="text/javascript"> + + + + $(document).ready( function() { + $('ul').not(".draggable").sortable({ items: "li" }); + $("ul.draggable li").draggable({ helper: "clone", connectToSortable: "ul" }); + }); + </script> + <style> + ul { + list-style: none; + padding: 0; + border: 1px solid black; + width: 210px; + float: left; + margin-right: 10px; + } + li { + width: 200px; + background: #eee; + margin: 5px; + } + </style> +</head> +<body> + +<ul class="draggable"> + <li>Draggable</li> +</ul> + +<ul> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> +</ul> + +<ul> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> +</ul> + +<ul> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> +</ul> + +<ul> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> +</ul> + +<ul> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + <li>Item 9</li> + <li>Item 10</li> + <li>Item 11</li> + <li>Item 12</li> + <li>Item 13</li> + <li>Item 14</li> + <li>Item 15</li> + <li>Item 16</li> + <li>Item 17</li> + <li>Item 18</li> + <li>Item 19</li> + <li>Item 20</li> +</ul> +</body> </html>
\ No newline at end of file diff --git a/tests/visual/spinner.html b/tests/visual/spinner.html index 219a178ec..de05b6d25 100644 --- a/tests/visual/spinner.html +++ b/tests/visual/spinner.html @@ -1,220 +1,220 @@ -<!doctype html>
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>jQuery UI Spinner Test page</title>
-<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
-<script type="text/javascript" src="../../ui/ui.core.js"></script>
-<script type="text/javascript" src="../../ui/ui.spinner.js"></script>
-
-
-<script type="text/javascript">
-$(function(){
- var itemList = [
- {url: "http://ejohn.org", title: "John Resig"},
- {url: "http://bassistance.de/", title: "Jörn Zaefferer"},
- {url: "http://snook.ca/jonathan/", title: "Jonathan Snook"},
- {url: "http://rdworth.org/", title: "Richard Worth"},
- {url: "http://www.paulbakaus.com/", title: "Paul Bakaus"},
- {url: "http://www.yehudakatz.com/", title: "Yehuda Katz"},
- {url: "http://www.azarask.in/", title: "Aza Raskin"},
- {url: "http://www.karlswedberg.com/", title: "Karl Swedberg"},
- {url: "http://scottjehl.com/", title: "Scott Jehl"},
- {url: "http://jdsharp.us/", title: "Jonathan Sharp"},
- {url: "http://www.kevinhoyt.org/", title: "Kevin Hoyt"},
- {url: "http://www.codylindley.com/", title: "Cody Lindley"},
- {url: "http://malsup.com/jquery/", title: "Mike Alsup"}
- ];
-
- var opts = {
- 's1': {},
- 's2': {stepping: 0.25},
- 's3': {currency: '$'},
- 's4': {},
- 's5': {
- init: function(ui) {
- for (var i=0; i<itemList.length; i++) {
- ui.add(itemList[i].title +' <a href="'+ itemList[i].url +'" target="_blank">»</a>');
- }
- }
- }
- };
-
- for (var n in opts)
- $("#"+n).spinner(opts[n]);
-
- $("button").click(function(e){
- var ns = $(this).attr('id').match(/(s\d)\-(\w+)$/);
- if (ns != null)
- $('#'+ns[1]).spinner( (ns[2] == 'create') ? opts[ns[1]] : ns[2]);
- });
-
-});
-</script>
-
-<style type="text/css">
-
-body
-{
- background: #fff;
- font-family: Arial;
-}
-
-label {
- float: left;
- margin-right: .5em;
- padding: .15em 0;
- font-weight: bold;
-}
-
-.ui-spinner {
- width: 15em;
- display: block;
- position: relative;
- overflow: hidden;
- border: 1px solid #999;
- background: #FEFEFE url(../images/spinner-bg.gif) repeat-x left bottom;
- padding: 0 5px;
-}
-
-.ui-spinner-disabled {
- background: #F4F4F4;
- color: #CCC;
-}
-
-.ui-spinner-box {
- width: 90%;
- height: 100%;
- float: left;
- font-size: 125%;
- border: none;
- background: none;
- padding: 0;
-}
-
-.ui-spinner-up,
-.ui-spinner-down {
- width: 10%;
- height: 50%;
- font-size: 0.5em;
- padding: 0;
- margin: 0;
- z-index: 100;
- text-align: center;
- vertical-align: middle;
- position: absolute;
- right: 0;
- cursor: default;
- border: 1px solid #999;
- border-right: none;
- border-top: none;
-}
-
-.ui-spinner-down {
- bottom: 0;
- border-bottom: 0;
-}
-
-.ui-spinner-pressed {
- background: #FEFEFE;
-}
-
-.ui-spinner-list,
-.ui-spinner-listitem {
- margin: 0;
- padding: 0;
-}
-
-</style>
-</head>
-
-<body>
-
-<h1>jQuery UI Spinner Test Page</h1>
-
-<p>This is a visual test page for developers and demonstrates some of the features included in ui.spinner. Mousewheel support is provided by the <a href="http://plugins.jquery.com/project/mousewheel">mousewheel plugin</a>.</p>
-
-<p><label for="s1">Basic: </label>
-<input type="text" id="s1" value="10" /></p>
-
-<p>
-<button id="s1-disable">disable</button>
-<button id="s1-enable">enable</button>
-<button id="s1-destroy">destroy</button>
-<button id="s1-create">create</button>
-</p>
-
-<hr />
-
-<p><label for="s2">Decimal: </label>
-<input type="text" id="s2" value="10.25" /></p>
-
-<p>
-<button id="s2-disable">disable</button>
-<button id="s2-enable">enable</button>
-<button id="s2-destroy">destroy</button>
-<button id="s2-create">create</button>
-</p>
-
-<hr />
-
-<p><label for="s3">Currency: </label>
-<input type="text" id="s3" /></p>
-
-<p>
-<button id="s3-disable">disable</button>
-<button id="s3-enable">enable</button>
-<button id="s3-destroy">destroy</button>
-<button id="s3-create">create</button>
-</p>
-
-<hr />
-
-<p><label for="s4">Data List: </label>
-<ul id="s4">
- <li>item 1</li>
- <li>item 2</li>
- <li>item 3</li>
- <li>item 4</li>
- <li>item 5</li>
- <li>item 6</li>
- <li>item 7</li>
- <li>item 8</li>
- <li>item 9</li>
- <li>item 10</li>
- <li>item 11</li>
- <li>item 12</li>
- <li>item 13</li>
- <li>item 14</li>
- <li>item 15</li>
- <li>item 16</li>
- <li>item 17</li>
- <li>item 18</li>
- <li>item 19</li>
- <li>item 20</li>
-</ul>
-
-<p>
-<button id="s4-disable">disable</button>
-<button id="s4-enable">enable</button>
-<button id="s4-destroy">destroy</button>
-<button id="s4-create">create</button>
-</p>
-
-<hr />
-
-<p><label for="s5">Presenters: </label>
-<div id="s5"></div>
-
-<p>
-<button id="s5-disable">disable</button>
-<button id="s5-enable">enable</button>
-<button id="s5-destroy">destroy</button>
-<button id="s5-create">create</button>
-</p>
-
-<hr />
-
-
-</body>
+<!doctype html> +<html lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>jQuery UI Spinner Test page</title> +<script type="text/javascript" src="../../jquery-1.2.6.js"></script> +<script type="text/javascript" src="../../ui/ui.core.js"></script> +<script type="text/javascript" src="../../ui/ui.spinner.js"></script> + + +<script type="text/javascript"> +$(function(){ + var itemList = [ + {url: "http://ejohn.org", title: "John Resig"}, + {url: "http://bassistance.de/", title: "Jörn Zaefferer"}, + {url: "http://snook.ca/jonathan/", title: "Jonathan Snook"}, + {url: "http://rdworth.org/", title: "Richard Worth"}, + {url: "http://www.paulbakaus.com/", title: "Paul Bakaus"}, + {url: "http://www.yehudakatz.com/", title: "Yehuda Katz"}, + {url: "http://www.azarask.in/", title: "Aza Raskin"}, + {url: "http://www.karlswedberg.com/", title: "Karl Swedberg"}, + {url: "http://scottjehl.com/", title: "Scott Jehl"}, + {url: "http://jdsharp.us/", title: "Jonathan Sharp"}, + {url: "http://www.kevinhoyt.org/", title: "Kevin Hoyt"}, + {url: "http://www.codylindley.com/", title: "Cody Lindley"}, + {url: "http://malsup.com/jquery/", title: "Mike Alsup"} + ]; + + var opts = { + 's1': {}, + 's2': {stepping: 0.25}, + 's3': {currency: '$'}, + 's4': {}, + 's5': { + init: function(ui) { + for (var i=0; i<itemList.length; i++) { + ui.add(itemList[i].title +' <a href="'+ itemList[i].url +'" target="_blank">»</a>'); + } + } + } + }; + + for (var n in opts) + $("#"+n).spinner(opts[n]); + + $("button").click(function(e){ + var ns = $(this).attr('id').match(/(s\d)\-(\w+)$/); + if (ns != null) + $('#'+ns[1]).spinner( (ns[2] == 'create') ? opts[ns[1]] : ns[2]); + }); + +}); +</script> + +<style type="text/css"> + +body +{ + background: #fff; + font-family: Arial; +} + +label { + float: left; + margin-right: .5em; + padding: .15em 0; + font-weight: bold; +} + +.ui-spinner { + width: 15em; + display: block; + position: relative; + overflow: hidden; + border: 1px solid #999; + background: #FEFEFE url(../images/spinner-bg.gif) repeat-x left bottom; + padding: 0 5px; +} + +.ui-spinner-disabled { + background: #F4F4F4; + color: #CCC; +} + +.ui-spinner-box { + width: 90%; + height: 100%; + float: left; + font-size: 125%; + border: none; + background: none; + padding: 0; +} + +.ui-spinner-up, +.ui-spinner-down { + width: 10%; + height: 50%; + font-size: 0.5em; + padding: 0; + margin: 0; + z-index: 100; + text-align: center; + vertical-align: middle; + position: absolute; + right: 0; + cursor: default; + border: 1px solid #999; + border-right: none; + border-top: none; +} + +.ui-spinner-down { + bottom: 0; + border-bottom: 0; +} + +.ui-spinner-pressed { + background: #FEFEFE; +} + +.ui-spinner-list, +.ui-spinner-listitem { + margin: 0; + padding: 0; +} + +</style> +</head> + +<body> + +<h1>jQuery UI Spinner Test Page</h1> + +<p>This is a visual test page for developers and demonstrates some of the features included in ui.spinner. Mousewheel support is provided by the <a href="http://plugins.jquery.com/project/mousewheel">mousewheel plugin</a>.</p> + +<p><label for="s1">Basic: </label> +<input type="text" id="s1" value="10" /></p> + +<p> +<button id="s1-disable">disable</button> +<button id="s1-enable">enable</button> +<button id="s1-destroy">destroy</button> +<button id="s1-create">create</button> +</p> + +<hr /> + +<p><label for="s2">Decimal: </label> +<input type="text" id="s2" value="10.25" /></p> + +<p> +<button id="s2-disable">disable</button> +<button id="s2-enable">enable</button> +<button id="s2-destroy">destroy</button> +<button id="s2-create">create</button> +</p> + +<hr /> + +<p><label for="s3">Currency: </label> +<input type="text" id="s3" /></p> + +<p> +<button id="s3-disable">disable</button> +<button id="s3-enable">enable</button> +<button id="s3-destroy">destroy</button> +<button id="s3-create">create</button> +</p> + +<hr /> + +<p><label for="s4">Data List: </label> +<ul id="s4"> + <li>item 1</li> + <li>item 2</li> + <li>item 3</li> + <li>item 4</li> + <li>item 5</li> + <li>item 6</li> + <li>item 7</li> + <li>item 8</li> + <li>item 9</li> + <li>item 10</li> + <li>item 11</li> + <li>item 12</li> + <li>item 13</li> + <li>item 14</li> + <li>item 15</li> + <li>item 16</li> + <li>item 17</li> + <li>item 18</li> + <li>item 19</li> + <li>item 20</li> +</ul> + +<p> +<button id="s4-disable">disable</button> +<button id="s4-enable">enable</button> +<button id="s4-destroy">destroy</button> +<button id="s4-create">create</button> +</p> + +<hr /> + +<p><label for="s5">Presenters: </label> +<div id="s5"></div> + +<p> +<button id="s5-disable">disable</button> +<button id="s5-enable">enable</button> +<button id="s5-destroy">destroy</button> +<button id="s5-create">create</button> +</p> + +<hr /> + + +</body> </html>
\ No newline at end of file diff --git a/tests/visual/tree.html b/tests/visual/tree.html index 4ae543245..988e7d132 100644 --- a/tests/visual/tree.html +++ b/tests/visual/tree.html @@ -1,100 +1,100 @@ -<!doctype html>
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<title>Untitled Document</title>
-
-<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
-<script type="text/javascript" src="../../ui/ui.core.js"></script>
-<script type="text/javascript" src="../../ui/ui.draggable.js"></script>
-<script type="text/javascript" src="../../ui/ui.droppable.js"></script>
-<script type="text/javascript" src="../../ui/ui.resizable.js"></script>
-<script type="text/javascript" src="../../ui/ui.sortable.js"></script>
-<script type="text/javascript" src="../../../branches/1.8/ui.tree.js"></script>
-
-
-<script>
-$(document).ready(function(){
-
-$("ul.sortable").tree({
- sortOn: "li",
- dropOn: ".folder",
- dropHoverClass: "hover"
-});
-
-
-
-});
-</script>
-
-<style type="text/css">
-body {
-background:#fff;
-color:#333;
-font-size:11px;
-font-family:"lucida grande", tahoma, verdana, arial, sans-serif;
-}
-
-.hover {
- background: green;
- color: #fff;
-}
-
-.placeholder {
- display: none;
-}
-
-.hover-up {
- border-bottom: 2px solid black;
-}
-
-.hover-down {
- border-top: 2px solid black;
-}
-
-.folder {
- border: 1px solid black;
-}
-
-li {
- padding: 3px;
-}
-
-</style>
-</head>
-
-<body>
-
- <ul class="sortable">
- <li><div class="folder">Item 1</div></li>
- <li><div class="folder">Item 2</div>
- <ul>
- <li>Sub Item 1</li>
- <li>Sub Item 3</li>
- <li>Sub Item 4</li>
- <li>Sub Item 5</li>
- </ul>
- </li>
- <li><div class="folder">Item 3</div></li>
- <li><div class="folder">Item 4</div></li>
- <li><div class="folder">Item 4</div></li>
- <li><div class="folder">Item 4</div></li>
- <li><div class="folder">Item 4</div></li>
- <li><div class="folder">Item 4</div></li>
- <li><div class="folder">Item 4</div></li>
- <li><div class="folder">Item 4</div></li>
- <li><div class="folder">Item 2</div>
- <ul>
- <li>Sub Item 1</li>
- <li>Sub Item 3</li>
- <li>Sub Item 4</li>
- <li>Sub Item 5</li>
- </ul>
- </li>
- <li>Item 6</li>
- <li>Item 7</li>
- <li>Item 8</li>
- </ul>
-
-</body>
+<!doctype html> +<html lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> +<title>Untitled Document</title> + +<script type="text/javascript" src="../../jquery-1.2.6.js"></script> +<script type="text/javascript" src="../../ui/ui.core.js"></script> +<script type="text/javascript" src="../../ui/ui.draggable.js"></script> +<script type="text/javascript" src="../../ui/ui.droppable.js"></script> +<script type="text/javascript" src="../../ui/ui.resizable.js"></script> +<script type="text/javascript" src="../../ui/ui.sortable.js"></script> +<script type="text/javascript" src="../../../branches/1.8/ui.tree.js"></script> + + +<script> +$(document).ready(function(){ + +$("ul.sortable").tree({ + sortOn: "li", + dropOn: ".folder", + dropHoverClass: "hover" +}); + + + +}); +</script> + +<style type="text/css"> +body { +background:#fff; +color:#333; +font-size:11px; +font-family:"lucida grande", tahoma, verdana, arial, sans-serif; +} + +.hover { + background: green; + color: #fff; +} + +.placeholder { + display: none; +} + +.hover-up { + border-bottom: 2px solid black; +} + +.hover-down { + border-top: 2px solid black; +} + +.folder { + border: 1px solid black; +} + +li { + padding: 3px; +} + +</style> +</head> + +<body> + + <ul class="sortable"> + <li><div class="folder">Item 1</div></li> + <li><div class="folder">Item 2</div> + <ul> + <li>Sub Item 1</li> + <li>Sub Item 3</li> + <li>Sub Item 4</li> + <li>Sub Item 5</li> + </ul> + </li> + <li><div class="folder">Item 3</div></li> + <li><div class="folder">Item 4</div></li> + <li><div class="folder">Item 4</div></li> + <li><div class="folder">Item 4</div></li> + <li><div class="folder">Item 4</div></li> + <li><div class="folder">Item 4</div></li> + <li><div class="folder">Item 4</div></li> + <li><div class="folder">Item 4</div></li> + <li><div class="folder">Item 2</div> + <ul> + <li>Sub Item 1</li> + <li>Sub Item 3</li> + <li>Sub Item 4</li> + <li>Sub Item 5</li> + </ul> + </li> + <li>Item 6</li> + <li>Item 7</li> + <li>Item 8</li> + </ul> + +</body> </html>
\ No newline at end of file diff --git a/themes/default/ui.all.css b/themes/default/ui.all.css index 64efdfba3..d77a0384a 100644 --- a/themes/default/ui.all.css +++ b/themes/default/ui.all.css @@ -1,869 +1,869 @@ -/*
- * jQuery UI screen structure and presentation
- * This CSS file was generated by ThemeRoller, a Filament Group Project for jQuery UI
- * Author: Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com
- * Visit themeroller.com
-*/
-
-
-
-
-/*UI accordion*/
-.ui-accordion {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- font-family: Verdana, Arial, sans-serif;
- border-bottom: 1px solid #d3d3d3;
-}
-.ui-accordion-group {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- border: 1px solid #d3d3d3;
- border-bottom: none;
-}
-.ui-accordion-header {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- cursor: pointer;
- background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
-}
-.ui-accordion-header a {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- display: block;
- font-size: 1.1em;
- font-weight: normal;
- text-decoration: none;
- padding: .5em .5em .5em 1.7em;
- color: #555555;
- background: url(images/888888_7x7_arrow_right.gif) .5em 50% no-repeat;
-}
-.ui-accordion-header a:hover {
- background: url(images/454545_7x7_arrow_right.gif) .5em 50% no-repeat;
- color: #212121;
-}
-.ui-accordion-header:hover {
- background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- color: #212121;
-}
-.selected .ui-accordion-header, .selected .ui-accordion-header:hover {
- background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
-}
-.selected .ui-accordion-header a, .selected .ui-accordion-header a:hover {
- color: #222222;
- background: url(images/222222_7x7_arrow_down.gif) .5em 50% no-repeat;
-}
-.ui-accordion-content {
- padding: 1.5em 1.7em;
- background: #ffffff;
- color: #222222;
- font-size: 1.1em;
-}
-
-
-/*slider*/
-.ui-slider {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- font-family: Verdana, Arial, sans-serif;
- background: #ffffff;
- border: 1px solid #d3d3d3;
- height: .8em;
- position: relative;
-}
-.ui-slider-handle {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- position: absolute;
- z-index: 2;
- top: -3px;
- width: 1.2em;
- height: 1.2em;
- background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
- border: 1px solid #dddddd;
-}
-.ui-slider-handle:hover {
- background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- border: 1px solid #999999;
-}
-.ui-slider-handle-active, .ui-slider-handle-active:hover {
- background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- border: 1px solid #dddddd;
-}
-.ui-slider-range {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- height: .8em;
- background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- position: absolute;
- border: 1px solid #d3d3d3;
- border-left: 0;
- border-right: 0;
- top: -1px;
- z-index: 1;
-}
-
-
-
-
-
-
-/*dialog*/
-.ui-dialog {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- font-family: Verdana, Arial, sans-serif;
- background: #ffffff;
- color: #222222;
- border: 4px solid #d3d3d3;
- position: relative;
-}
-.ui-dialog-content {
- border: 1px solid #d3d3d3;
- background: #ffffff;
- color: #222222;
-}
-.ui-resizable-handle {
- position: absolute;
- font-size: 0.1px;
- z-index: 99999;
-}
-.ui-resizable .ui-resizable-handle {
- display: block;
-}
-body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
-body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */
-.ui-resizable-n {
- cursor: n-resize;
- height: 7px;
- width: 100%;
- top: -5px;
- left: 0px;
-}
-.ui-resizable-s {
- cursor: s-resize;
- height: 7px;
- width: 100%;
- bottom: -5px;
- left: 0px;
-}
-.ui-resizable-e {
- cursor: e-resize;
- width: 7px;
- right: -5px;
- top: 0px;
- height: 100%;
-}
-.ui-resizable-w {
- cursor: w-resize;
- width: 7px;
- left: -5px;
- top: 0px;
- height: 100%;
-}
-.ui-resizable-se {
- cursor: se-resize;
- width: 13px;
- height: 13px;
- right: 0px;
- bottom: 0px;
- background: url(images/222222_11x11_icon_resize_se.gif) no-repeat 0 0;
-}
-.ui-resizable-sw {
- cursor: sw-resize;
- width: 9px;
- height: 9px;
- left: 0px;
- bottom: 0px;
-}
-.ui-resizable-nw {
- cursor: nw-resize;
- width: 9px;
- height: 9px;
- left: 0px;
- top: 0px;
-}
-.ui-resizable-ne {
- cursor: ne-resize;
- width: 9px;
- height: 9px;
- right: 0px;
- top: 0px;
-}
-.ui-dialog-titlebar {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- padding: .5em 1.5em .5em 1em;
- color: #555555;
- background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- border-bottom: 1px solid #d3d3d3;
- font-size: 1.1em;
- font-weight: normal;
- position: relative;
-}
-.ui-dialog-title {
-
-}
-.ui-dialog-titlebar-close {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- background: url(images/888888_11x11_icon_close.gif) 0 0 no-repeat;
- position: absolute;
- right: 8px;
- top: .7em;
- width: 11px;
- height: 11px;
- z-index: 100;
-}
-.ui-dialog-titlebar-close-hover, .ui-dialog-titlebar-close:hover {
- background: url(images/454545_11x11_icon_close.gif) 0 0 no-repeat;
-}
-.ui-dialog-titlebar-close:active {
- background: url(images/222222_11x11_icon_close.gif) 0 0 no-repeat;
-}
-.ui-dialog-titlebar-close span {
- display: none;
-}
-.ui-dialog-content {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- background: #ffffff;
- color: #222222;
- padding: 1.5em 1.7em;
-}
-.ui-dialog-buttonpane {
- position: absolute;
- bottom: 0;
- width: 100%;
- text-align: left;
- border-top: 1px solid #d3d3d3;
- background: ;
-}
-.ui-dialog-buttonpane button {
- margin: .5em 0 .5em 8px;
- color: #555555;
- background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- font-size: 1.1em;
- border: 1px solid #d3d3d3;
- cursor: pointer;
- padding: .2em .6em .3em .6em;
- line-height: 1.4em;
-}
-.ui-dialog-buttonpane button:hover {
- color: #212121;
- background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- border: 1px solid #999999;
-}
-.ui-dialog-buttonpane button:active {
- color: #222222;
- background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
- border: 1px solid #dddddd;
-}
-/* This file skins dialog */
-.ui-dialog.ui-draggable .ui-dialog-titlebar,
-.ui-dialog.ui-draggable .ui-dialog-titlebar {
- cursor: move;
-}
-
-
-
-
-
-
-
-/*datepicker*/
-/* Main Style Sheet for jQuery UI date picker */
-.ui-datepicker-div, #ui-datepicker-div, .ui-datepicker-inline {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- font-family: Verdana, Arial, sans-serif;
- background: #ffffff;
- font-size: 1.1em;
- border: 4px solid #d3d3d3;
- width: 15.5em;
- padding: 2.5em .5em .5em .5em;
- position: relative;
-}
-#ui-datepicker-div, .ui-datepicker-div {
- z-index: 9999; /*must have*/
- display: none;
- background: #ffffff;
-}
-.ui-datepicker-inline {
- float: left;
- display: block;
-}
-.ui-datepicker-control {
- display: none;
-}
-.ui-datepicker-current {
- display: none;
-}
-.ui-datepicker-next, .ui-datepicker-prev {
- position: absolute;
- left: .5em;
- top: .5em;
- background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
-}
-.ui-datepicker-next {
- left: 14.6em;
-}
-.ui-datepicker-next:hover, .ui-datepicker-prev:hover {
- background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
-}
-.ui-datepicker-next a, .ui-datepicker-prev a {
- text-indent: -999999px;
- width: 1.3em;
- height: 1.4em;
- display: block;
- font-size: 1em;
- background: url(images/888888_7x7_arrow_left.gif) 50% 50% no-repeat;
- border: 1px solid #d3d3d3;
- cursor: pointer;
-}
-.ui-datepicker-next a {
- background: url(images/888888_7x7_arrow_right.gif) 50% 50% no-repeat;
-}
-.ui-datepicker-prev a:hover {
- background: url(images/454545_7x7_arrow_left.gif) 50% 50% no-repeat;
-}
-.ui-datepicker-next a:hover {
- background: url(images/454545_7x7_arrow_right.gif) 50% 50% no-repeat;
-}
-.ui-datepicker-prev a:active {
- background: url(images/222222_7x7_arrow_left.gif) 50% 50% no-repeat;
-}
-.ui-datepicker-next a:active {
- background: url(images/222222_7x7_arrow_right.gif) 50% 50% no-repeat;
-}
-.ui-datepicker-header select {
- border: 1px solid #d3d3d3;
- color: #555555;
- background: #e6e6e6;
- font-size: 1em;
- line-height: 1.4em;
- position: absolute;
- top: .5em;
- margin: 0 !important;
-
-}
-.ui-datepicker-header select.ui-datepicker-new-month {
-width: 7em;
-left: 2.2em;
-}
-.ui-datepicker-header select.ui-datepicker-new-year {
-width: 5em;
-left: 9.4em;
-}
-table.ui-datepicker {
- width: 15.5em;
- text-align: right;
-}
-table.ui-datepicker td a {
- padding: .1em .3em .1em 0;
- display: block;
- color: #555555;
- background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- cursor: pointer;
- border: 1px solid #ffffff;
-}
-table.ui-datepicker td a:hover {
- border: 1px solid #999999;
- color: #212121;
- background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
-}
-table.ui-datepicker td a:active {
- border: 1px solid #dddddd;
- color: #222222;
- background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
-}
-table.ui-datepicker .ui-datepicker-title-row td {
- padding: .3em 0;
- text-align: center;
- font-size: .9em;
- color: #222222;
- text-transform: uppercase;
- /*border-bottom: 1px solid #d3d3d3;*/
-}
-
-table.ui-datepicker .ui-datepicker-title-row td a {
- color: #222222;
-}
-
-
-
-
-
-
-/*colorpicker*/
-.ui-colorpicker {
- width: 356px;
- height: 176px;
- overflow: hidden;
- position: absolute;
- background: url(images/colorpicker_background.png);
- font-family: Arial, Helvetica, sans-serif;
- display: none;
-}
-.ui-colorpicker-color {
- width: 150px;
- height: 150px;
- left: 14px;
- top: 13px;
- position: absolute;
- background: #f00;
- overflow: hidden;
- cursor: crosshair;
-}
-.ui-colorpicker-color div {
- position: absolute;
- top: 0;
- left: 0;
- width: 150px;
- height: 150px;
- background: url(images/colorpicker_overlay.png);
-}
-.ui-colorpicker-color div div {
- position: absolute;
- top: 0;
- left: 0;
- width: 11px;
- height: 11px;
- overflow: hidden;
- background: url(images/colorpicker_select.gif);
- margin: -5px 0 0 -5px;
-}
-.ui-colorpicker-hue {
- position: absolute;
- top: 13px;
- left: 171px;
- width: 35px;
- height: 150px;
- cursor: n-resize;
-}
-.ui-colorpicker-hue div {
- position: absolute;
- width: 35px;
- height: 9px;
- overflow: hidden;
- background: url(images/colorpicker_indic.gif) left top;
- margin: -4px 0 0 0;
- left: 0px;
-}
-.ui-colorpicker-new-color {
- position: absolute;
- width: 60px;
- height: 30px;
- left: 213px;
- top: 13px;
- background: #f00;
-}
-.ui-colorpicker-current-color {
- position: absolute;
- width: 60px;
- height: 30px;
- left: 283px;
- top: 13px;
- background: #f00;
-}
-.colorpicker input {
- background-color: transparent;
- border: 1px solid transparent;
- position: absolute;
- font-size: 10px;
- font-family: Arial, Helvetica, sans-serif;
- color: #898989;
- top: 4px;
- right: 11px;
- text-align: right;
- margin: 0;
- padding: 0;
- height: 11px;
-}
-.ui-colorpicker-hex {
- position: absolute;
- width: 72px;
- height: 22px;
- background: url(images/colorpicker_hex.png) top;
- left: 212px;
- top: 142px;
-}
-.ui-colorpicker input {
- height: 15px;
-}
-.ui-colorpicker-hex input {
- margin-left: 18px;
- right: 6px;
- width: 47px;
-}
-.ui-colorpicker-field {
- height: 22px;
- width: 62px;
- background-position: top;
- position: absolute;
-}
-.ui-colorpicker-field label {
- padding-left: 17px;
- font-size: 10px;
-}
-.ui-colorpicker-field input {
- width: 25px;
-}
-.ui-colorpicker-field span {
- position: absolute;
- width: 12px;
- height: 22px;
- overflow: hidden;
- top: 0;
- right: 0;
- cursor: n-resize;
-}
-.ui-colorpicker-rgb-r {
- background-image: url(images/colorpicker_rgb_r.png);
- top: 52px;
- left: 212px;
-}
-.ui-colorpicker-rgb-g {
- background-image: url(images/colorpicker_rgb_g.png);
- top: 82px;
- left: 212px;
-}
-.ui-colorpicker-rgb-b {
- background-image: url(images/colorpicker_rgb_b.png);
- top: 112px;
- left: 212px;
-}
-.ui-colorpicker-hsb-h {
- background-image: url(images/colorpicker_hsb_h.png);
- top: 52px;
- left: 282px;
-}
-.ui-colorpicker-hsb-s {
- background-image: url(images/colorpicker_hsb_s.png);
- top: 82px;
- left: 282px;
-}
-.ui-colorpicker-hsb-b {
- background-image: url(images/colorpicker_hsb_b.png);
- top: 112px;
- left: 282px;
-}
-.ui-colorpicker-submit {
- position: absolute;
- left: 296px;
- top: 144px;
- overflow: hidden;
-}
-.ui-colorpicker-focus {
- background-position: center;
-}
-.ui-colorpicker-hex.ui-colorpicker-focus {
- background-position: bottom;
-}
-.ui-colorpicker-submit.ui-colorpicker-focus {
- background-position: bottom;
-}
-.ui-colorpicker-slider {
- background-position: bottom;
-}
-
-
-/*autocomplete*/
-.ui-autocomplete-results {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- font-family: Verdana, Arial, sans-serif;
- font-size: 1.1em;
-
- border: 1px solid #d3d3d3;
- background: #ffffff;
- color: #222222;
-
- overflow: hidden;
- z-index: 99999;
-}
-
-.ui-autocomplete-results ul {
- width: 100%;
- list-style-position: outside;
- list-style: none;
- padding: 0;
- margin: 0;
-}
-
-.ui-autocomplete-results li {
- margin: 0px;
- padding: 2px 5px;
- cursor: default;
- display: block;
- /*
- if width will be 100% horizontal scrollbar will apear
- when scroll mode will be used
- */
- /*width: 100%;*/
- font: menu;
- font-size: 12px;
- /*
- it is very important, if line-height not setted or setted
- in relative units scroll will be broken in firefox
- */
- line-height: 16px;
- overflow: hidden;
-
-
- border: 1px solid #d3d3d3;
- background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- font-weight: normal;
- color: #555555 !important;
-
-}
-
-.ui-autocomplete-loading {
- background: white url('indicator.gif') right center no-repeat;
-}
-
-.ui-autocomplete-results li.ui-autocomplete-over {
- border: 1px solid #999999;
- background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- font-weight: normal;
- color: #212121 !important;
-}
-
-
-
-
-
-/* ProgressBar */
-
-.ui-progressbar {
- width: 400px; height: 20px;
- border: 1px #ccc solid;
- background:#E0E8F3 url(images/bg.gif) repeat-x scroll 0%;
- position:relative;
-}
-
-.ui-progressbar-wrap {
- position: relative;
- height: auto;
- width: auto;
- line-height: 18px;
- _line-height: 16px;
-}
-
-.ui-progressbar-bar {
- background:#9CBFEE url(images/progress-bg.gif) repeat-x scroll left center;
- border-bottom:1px solid #7FA9E4;
- border-right:1px solid #7FA9E4;
- border-top:1px solid #D1E4FD;
- position: absolute;
-}
-
-.ui-progressbar-text {
- color:#fff;
- overflow: hidden;
- white-space: nowrap;
- font-size: 11px;
- font-weight: bold;
- padding-left: 5px;
-}
-
-.ui-progressbar-text-back {
- color:#000;
- padding-top: 1px;
- padding-bottom: 1px;
- padding-right: 1px;
-}
-
-.ui-progressbar-disabled {
- opacity:.5;
- filter:Alpha(Opacity=50);
-}
-
-
-/* custom */
-.ui-progressbar-text.right-align {
- text-align: right;
- padding: 0 5px 0 0;
-}
-.ui-progressbar-inner-custom {
- background: url(images/custom-bar.gif) repeat-x scroll left center;
- border-bottom:1px solid #EFEFEF;
- border-right:0pt none;
- border-top:1px solid #BEBEBE;
- height:15px;
-}
-.bold {
- color: red !important;
-}
-.ui-hidden {
- left:-10000px;
- position:absolute;
- top:-10000px;
- visibility:hidden;
-}
-
-
-
-/*
-Generic ThemeRoller Classes
->> Make your jQuery Components ThemeRoller-Compatible!
-*/
-
-/*component global class*/
-.ui-component {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
- font-family: Verdana, Arial, sans-serif;
- font-size: 1.1em;
-}
-/*component content styles*/
-.ui-component-content {
- border: 1px solid #d3d3d3;
- background: #ffffff;
- color: #222222;
-}
-.ui-component-content a {
- color: #222222;
- text-decoration: underline;
-}
-/*component states*/
-.ui-default-state {
- border: 1px solid #d3d3d3;
- background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- font-weight: normal;
- color: #555555 !important;
-}
-.ui-default-state a {
- color: #555555;
-}
-.ui-default-state:hover, .ui-hover-state {
- border: 1px solid #999999;
- background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x;
- font-weight: normal;
- color: #212121 !important;
-}
-.ui-hover-state a {
- color: #212121;
-}
-.ui-default-state:active, .ui-active-state {
- border: 1px solid #dddddd;
- background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x;
- font-weight: normal;
- color: #222222 !important;
- outline: none;
-}
-.ui-active-state a {
- color: #222222;
- outline: none;
-}
-/*icons*/
-.ui-arrow-right-default {background: url(images/888888_7x7_arrow_right.gif) no-repeat 50% 50%;}
-.ui-arrow-right-default:hover, .ui-arrow-right-hover {background: url(images/454545_7x7_arrow_right.gif) no-repeat 50% 50%;}
-.ui-arrow-right-default:active, .ui-arrow-right-active {background: url(images/222222_7x7_arrow_right.gif) no-repeat 50% 50%;}
-.ui-arrow-left-default {background: url(images/888888_7x7_arrow_left.gif) no-repeat 50% 50%;}
-.ui-arrow-left-default:hover, .ui-arrow-left-hover {background: url(images/454545_7x7_arrow_left.gif) no-repeat 50% 50%;}
-.ui-arrow-left-default:active, .ui-arrow-left-active {background: url(images/222222_7x7_arrow_left.gif) no-repeat 50% 50%;}
-.ui-arrow-down-default {background: url(images/888888_7x7_arrow_down.gif) no-repeat 50% 50%;}
-.ui-arrow-down-default:hover, .ui-arrow-down-hover {background: url(images/454545_7x7_arrow_down.gif) no-repeat 50% 50%;}
-.ui-arrow-down-default:active, .ui-arrow-down-active {background: url(images/222222_7x7_arrow_down.gif) no-repeat 50% 50%;}
-.ui-arrow-up-default {background: url(images/888888_7x7_arrow_up.gif) no-repeat 50% 50%;}
-.ui-arrow-up-default:hover, .ui-arrow-up-hover {background: url(images/454545_7x7_arrow_up.gif) no-repeat 50% 50%;}
-.ui-arrow-up-default:active, .ui-arrow-up-active {background: url(images/222222_7x7_arrow_up.gif) no-repeat 50% 50%;}
-.ui-close-default {background: url(images/888888_11x11_icon_close.gif) no-repeat 50% 50%;}
-.ui-close-default:hover, .ui-close-hover {background: url(images/454545_11x11_icon_close.gif) no-repeat 50% 50%;}
-.ui-close-default:active, .ui-close-active {background: url(images/222222_11x11_icon_close.gif) no-repeat 50% 50%;}
-.ui-folder-closed-default {background: url(images/888888_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
-.ui-folder-closed-default:hover, .ui-folder-closed-hover {background: url(images/454545_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
-.ui-folder-closed-default:active, .ui-folder-closed-active {background: url(images/222222_11x11_icon_folder_closed.gif) no-repeat 50% 50%;}
-.ui-folder-open-default {background: url(images/888888_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
-.ui-folder-open-default:hover, .ui-folder-open-hover {background: url(images/454545_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
-.ui-folder-open-default:active, .ui-folder-open-active {background: url(images/222222_11x11_icon_folder_open.gif) no-repeat 50% 50%;}
-.ui-doc-default {background: url(images/888888_11x11_icon_doc.gif) no-repeat 50% 50%;}
-.ui-doc-default:hover, .ui-doc-hover {background: url(images/454545_11x11_icon_doc.gif) no-repeat 50% 50%;}
-.ui-doc-default:active, .ui-doc-active {background: url(images/222222_11x11_icon_doc.gif) no-repeat 50% 50%;}
-.ui-arrows-leftright-default {background: url(images/888888_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
-.ui-arrows-leftright-default:hover, .ui-arrows-leftright-hover {background: url(images/454545_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
-.ui-arrows-leftright-default:active, .ui-arrows-leftright-active {background: url(images/222222_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;}
-.ui-arrows-updown-default {background: url(images/888888_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
-.ui-arrows-updown-default:hover, .ui-arrows-updown-hover {background: url(images/454545_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
-.ui-arrows-updown-default:active, .ui-arrows-updown-active {background: url(images/222222_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;}
-.ui-minus-default {background: url(images/888888_11x11_icon_minus.gif) no-repeat 50% 50%;}
-.ui-minus-default:hover, .ui-minus-hover {background: url(images/454545_11x11_icon_minus.gif) no-repeat 50% 50%;}
-.ui-minus-default:active, .ui-minus-active {background: url(images/222222_11x11_icon_minus.gif) no-repeat 50% 50%;}
-.ui-plus-default {background: url(images/888888_11x11_icon_plus.gif) no-repeat 50% 50%;}
-.ui-plus-default:hover, .ui-plus-hover {background: url(images/454545_11x11_icon_plus.gif) no-repeat 50% 50%;}
-.ui-plus-default:active, .ui-plus-active {background: url(images/222222_11x11_icon_plus.gif) no-repeat 50% 50%;}
-/*hidden elements*/
-.ui-hidden {
- display: none;/* for accessible hiding: position: absolute; left: -99999999px*/;
-}
-.ui-accessible-hidden {
- position: absolute; left: -99999999px;
-}
-/*reset styles*/
-.ui-reset {
- /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none;
-}
-/*clearfix class*/
-.ui-clearfix:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
-}
-.ui-clearfix {display: inline-block;}
-/* Hides from IE-mac \*/
-* html .ui-clearfix {height: 1%;}
-.ui-clearfix {display: block;}
-/* End hide from IE-mac */
-
-/* Note: for resizable styles, use the styles listed above in the dialog section */
-
-
-
-
-/* UI Spinner */
-.ui-spinner {
- width: 15em;
- display: block;
- position: relative;
- overflow: hidden;
- border: 1px solid #999;
- background: #FEFEFE url(./images/spinner-bg.gif) repeat-x left bottom;
- padding: 0 5px;
-}
-
-.ui-spinner-disabled {
- background: #F4F4F4;
- color: #CCC;
-}
-
-.ui-spinner-box {
- width: 90%;
- height: 100%;
- float: left;
- font-size: 125%;
- border: none;
- background: none;
- padding: 0;
-}
-
-.ui-spinner-up,
-.ui-spinner-down {
- width: 10%;
- height: 50%;
- font-size: 0.5em;
- padding: 0;
- margin: 0;
- z-index: 100;
- text-align: center;
- vertical-align: middle;
- position: absolute;
- right: 0;
- cursor: default;
- border: 1px solid #999;
- border-right: none;
- border-top: none;
-}
-
-.ui-spinner-down {
- bottom: 0;
- border-bottom: 0;
-}
-
-.ui-spinner-pressed {
- background: #FEFEFE;
-}
-
-.ui-spinner-list,
-.ui-spinner-listitem {
- margin: 0;
- padding: 0;
+/* + * jQuery UI screen structure and presentation + * This CSS file was generated by ThemeRoller, a Filament Group Project for jQuery UI + * Author: Scott Jehl, scott@filamentgroup.com, http://www.filamentgroup.com + * Visit themeroller.com +*/ + + + + +/*UI accordion*/ +.ui-accordion { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + font-family: Verdana, Arial, sans-serif; + border-bottom: 1px solid #d3d3d3; +} +.ui-accordion-group { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + border: 1px solid #d3d3d3; + border-bottom: none; +} +.ui-accordion-header { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + cursor: pointer; + background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x; +} +.ui-accordion-header a { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + display: block; + font-size: 1.1em; + font-weight: normal; + text-decoration: none; + padding: .5em .5em .5em 1.7em; + color: #555555; + background: url(images/888888_7x7_arrow_right.gif) .5em 50% no-repeat; +} +.ui-accordion-header a:hover { + background: url(images/454545_7x7_arrow_right.gif) .5em 50% no-repeat; + color: #212121; +} +.ui-accordion-header:hover { + background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x; + color: #212121; +} +.selected .ui-accordion-header, .selected .ui-accordion-header:hover { + background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x; +} +.selected .ui-accordion-header a, .selected .ui-accordion-header a:hover { + color: #222222; + background: url(images/222222_7x7_arrow_down.gif) .5em 50% no-repeat; +} +.ui-accordion-content { + padding: 1.5em 1.7em; + background: #ffffff; + color: #222222; + font-size: 1.1em; +} + + +/*slider*/ +.ui-slider { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + font-family: Verdana, Arial, sans-serif; + background: #ffffff; + border: 1px solid #d3d3d3; + height: .8em; + position: relative; +} +.ui-slider-handle { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + position: absolute; + z-index: 2; + top: -3px; + width: 1.2em; + height: 1.2em; + background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x; + border: 1px solid #dddddd; +} +.ui-slider-handle:hover { + background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x; + border: 1px solid #999999; +} +.ui-slider-handle-active, .ui-slider-handle-active:hover { + background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x; + border: 1px solid #dddddd; +} +.ui-slider-range { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + height: .8em; + background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x; + position: absolute; + border: 1px solid #d3d3d3; + border-left: 0; + border-right: 0; + top: -1px; + z-index: 1; +} + + + + + + +/*dialog*/ +.ui-dialog { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + font-family: Verdana, Arial, sans-serif; + background: #ffffff; + color: #222222; + border: 4px solid #d3d3d3; + position: relative; +} +.ui-dialog-content { + border: 1px solid #d3d3d3; + background: #ffffff; + color: #222222; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + z-index: 99999; +} +.ui-resizable .ui-resizable-handle { + display: block; +} +body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ +body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0px; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0px; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0px; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0px; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 13px; + height: 13px; + right: 0px; + bottom: 0px; + background: url(images/222222_11x11_icon_resize_se.gif) no-repeat 0 0; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: 0px; + bottom: 0px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: 0px; + top: 0px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: 0px; + top: 0px; +} +.ui-dialog-titlebar { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + padding: .5em 1.5em .5em 1em; + color: #555555; + background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x; + border-bottom: 1px solid #d3d3d3; + font-size: 1.1em; + font-weight: normal; + position: relative; +} +.ui-dialog-title { + +} +.ui-dialog-titlebar-close { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + background: url(images/888888_11x11_icon_close.gif) 0 0 no-repeat; + position: absolute; + right: 8px; + top: .7em; + width: 11px; + height: 11px; + z-index: 100; +} +.ui-dialog-titlebar-close-hover, .ui-dialog-titlebar-close:hover { + background: url(images/454545_11x11_icon_close.gif) 0 0 no-repeat; +} +.ui-dialog-titlebar-close:active { + background: url(images/222222_11x11_icon_close.gif) 0 0 no-repeat; +} +.ui-dialog-titlebar-close span { + display: none; +} +.ui-dialog-content { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + background: #ffffff; + color: #222222; + padding: 1.5em 1.7em; +} +.ui-dialog-buttonpane { + position: absolute; + bottom: 0; + width: 100%; + text-align: left; + border-top: 1px solid #d3d3d3; + background: ; +} +.ui-dialog-buttonpane button { + margin: .5em 0 .5em 8px; + color: #555555; + background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x; + font-size: 1.1em; + border: 1px solid #d3d3d3; + cursor: pointer; + padding: .2em .6em .3em .6em; + line-height: 1.4em; +} +.ui-dialog-buttonpane button:hover { + color: #212121; + background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x; + border: 1px solid #999999; +} +.ui-dialog-buttonpane button:active { + color: #222222; + background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x; + border: 1px solid #dddddd; +} +/* This file skins dialog */ +.ui-dialog.ui-draggable .ui-dialog-titlebar, +.ui-dialog.ui-draggable .ui-dialog-titlebar { + cursor: move; +} + + + + + + + +/*datepicker*/ +/* Main Style Sheet for jQuery UI date picker */ +.ui-datepicker-div, #ui-datepicker-div, .ui-datepicker-inline { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + font-family: Verdana, Arial, sans-serif; + background: #ffffff; + font-size: 1.1em; + border: 4px solid #d3d3d3; + width: 15.5em; + padding: 2.5em .5em .5em .5em; + position: relative; +} +#ui-datepicker-div, .ui-datepicker-div { + z-index: 9999; /*must have*/ + display: none; + background: #ffffff; +} +.ui-datepicker-inline { + float: left; + display: block; +} +.ui-datepicker-control { + display: none; +} +.ui-datepicker-current { + display: none; +} +.ui-datepicker-next, .ui-datepicker-prev { + position: absolute; + left: .5em; + top: .5em; + background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x; +} +.ui-datepicker-next { + left: 14.6em; +} +.ui-datepicker-next:hover, .ui-datepicker-prev:hover { + background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x; +} +.ui-datepicker-next a, .ui-datepicker-prev a { + text-indent: -999999px; + width: 1.3em; + height: 1.4em; + display: block; + font-size: 1em; + background: url(images/888888_7x7_arrow_left.gif) 50% 50% no-repeat; + border: 1px solid #d3d3d3; + cursor: pointer; +} +.ui-datepicker-next a { + background: url(images/888888_7x7_arrow_right.gif) 50% 50% no-repeat; +} +.ui-datepicker-prev a:hover { + background: url(images/454545_7x7_arrow_left.gif) 50% 50% no-repeat; +} +.ui-datepicker-next a:hover { + background: url(images/454545_7x7_arrow_right.gif) 50% 50% no-repeat; +} +.ui-datepicker-prev a:active { + background: url(images/222222_7x7_arrow_left.gif) 50% 50% no-repeat; +} +.ui-datepicker-next a:active { + background: url(images/222222_7x7_arrow_right.gif) 50% 50% no-repeat; +} +.ui-datepicker-header select { + border: 1px solid #d3d3d3; + color: #555555; + background: #e6e6e6; + font-size: 1em; + line-height: 1.4em; + position: absolute; + top: .5em; + margin: 0 !important; + +} +.ui-datepicker-header select.ui-datepicker-new-month { +width: 7em; +left: 2.2em; +} +.ui-datepicker-header select.ui-datepicker-new-year { +width: 5em; +left: 9.4em; +} +table.ui-datepicker { + width: 15.5em; + text-align: right; +} +table.ui-datepicker td a { + padding: .1em .3em .1em 0; + display: block; + color: #555555; + background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x; + cursor: pointer; + border: 1px solid #ffffff; +} +table.ui-datepicker td a:hover { + border: 1px solid #999999; + color: #212121; + background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x; +} +table.ui-datepicker td a:active { + border: 1px solid #dddddd; + color: #222222; + background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x; +} +table.ui-datepicker .ui-datepicker-title-row td { + padding: .3em 0; + text-align: center; + font-size: .9em; + color: #222222; + text-transform: uppercase; + /*border-bottom: 1px solid #d3d3d3;*/ +} + +table.ui-datepicker .ui-datepicker-title-row td a { + color: #222222; +} + + + + + + +/*colorpicker*/ +.ui-colorpicker { + width: 356px; + height: 176px; + overflow: hidden; + position: absolute; + background: url(images/colorpicker_background.png); + font-family: Arial, Helvetica, sans-serif; + display: none; +} +.ui-colorpicker-color { + width: 150px; + height: 150px; + left: 14px; + top: 13px; + position: absolute; + background: #f00; + overflow: hidden; + cursor: crosshair; +} +.ui-colorpicker-color div { + position: absolute; + top: 0; + left: 0; + width: 150px; + height: 150px; + background: url(images/colorpicker_overlay.png); +} +.ui-colorpicker-color div div { + position: absolute; + top: 0; + left: 0; + width: 11px; + height: 11px; + overflow: hidden; + background: url(images/colorpicker_select.gif); + margin: -5px 0 0 -5px; +} +.ui-colorpicker-hue { + position: absolute; + top: 13px; + left: 171px; + width: 35px; + height: 150px; + cursor: n-resize; +} +.ui-colorpicker-hue div { + position: absolute; + width: 35px; + height: 9px; + overflow: hidden; + background: url(images/colorpicker_indic.gif) left top; + margin: -4px 0 0 0; + left: 0px; +} +.ui-colorpicker-new-color { + position: absolute; + width: 60px; + height: 30px; + left: 213px; + top: 13px; + background: #f00; +} +.ui-colorpicker-current-color { + position: absolute; + width: 60px; + height: 30px; + left: 283px; + top: 13px; + background: #f00; +} +.colorpicker input { + background-color: transparent; + border: 1px solid transparent; + position: absolute; + font-size: 10px; + font-family: Arial, Helvetica, sans-serif; + color: #898989; + top: 4px; + right: 11px; + text-align: right; + margin: 0; + padding: 0; + height: 11px; +} +.ui-colorpicker-hex { + position: absolute; + width: 72px; + height: 22px; + background: url(images/colorpicker_hex.png) top; + left: 212px; + top: 142px; +} +.ui-colorpicker input { + height: 15px; +} +.ui-colorpicker-hex input { + margin-left: 18px; + right: 6px; + width: 47px; +} +.ui-colorpicker-field { + height: 22px; + width: 62px; + background-position: top; + position: absolute; +} +.ui-colorpicker-field label { + padding-left: 17px; + font-size: 10px; +} +.ui-colorpicker-field input { + width: 25px; +} +.ui-colorpicker-field span { + position: absolute; + width: 12px; + height: 22px; + overflow: hidden; + top: 0; + right: 0; + cursor: n-resize; +} +.ui-colorpicker-rgb-r { + background-image: url(images/colorpicker_rgb_r.png); + top: 52px; + left: 212px; +} +.ui-colorpicker-rgb-g { + background-image: url(images/colorpicker_rgb_g.png); + top: 82px; + left: 212px; +} +.ui-colorpicker-rgb-b { + background-image: url(images/colorpicker_rgb_b.png); + top: 112px; + left: 212px; +} +.ui-colorpicker-hsb-h { + background-image: url(images/colorpicker_hsb_h.png); + top: 52px; + left: 282px; +} +.ui-colorpicker-hsb-s { + background-image: url(images/colorpicker_hsb_s.png); + top: 82px; + left: 282px; +} +.ui-colorpicker-hsb-b { + background-image: url(images/colorpicker_hsb_b.png); + top: 112px; + left: 282px; +} +.ui-colorpicker-submit { + position: absolute; + left: 296px; + top: 144px; + overflow: hidden; +} +.ui-colorpicker-focus { + background-position: center; +} +.ui-colorpicker-hex.ui-colorpicker-focus { + background-position: bottom; +} +.ui-colorpicker-submit.ui-colorpicker-focus { + background-position: bottom; +} +.ui-colorpicker-slider { + background-position: bottom; +} + + +/*autocomplete*/ +.ui-autocomplete-results { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + font-family: Verdana, Arial, sans-serif; + font-size: 1.1em; + + border: 1px solid #d3d3d3; + background: #ffffff; + color: #222222; + + overflow: hidden; + z-index: 99999; +} + +.ui-autocomplete-results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; +} + +.ui-autocomplete-results li { + margin: 0px; + padding: 2px 5px; + cursor: default; + display: block; + /* + if width will be 100% horizontal scrollbar will apear + when scroll mode will be used + */ + /*width: 100%;*/ + font: menu; + font-size: 12px; + /* + it is very important, if line-height not setted or setted + in relative units scroll will be broken in firefox + */ + line-height: 16px; + overflow: hidden; + + + border: 1px solid #d3d3d3; + background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x; + font-weight: normal; + color: #555555 !important; + +} + +.ui-autocomplete-loading { + background: white url('indicator.gif') right center no-repeat; +} + +.ui-autocomplete-results li.ui-autocomplete-over { + border: 1px solid #999999; + background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x; + font-weight: normal; + color: #212121 !important; +} + + + + + +/* ProgressBar */ + +.ui-progressbar { + width: 400px; height: 20px; + border: 1px #ccc solid; + background:#E0E8F3 url(images/bg.gif) repeat-x scroll 0%; + position:relative; +} + +.ui-progressbar-wrap { + position: relative; + height: auto; + width: auto; + line-height: 18px; + _line-height: 16px; +} + +.ui-progressbar-bar { + background:#9CBFEE url(images/progress-bg.gif) repeat-x scroll left center; + border-bottom:1px solid #7FA9E4; + border-right:1px solid #7FA9E4; + border-top:1px solid #D1E4FD; + position: absolute; +} + +.ui-progressbar-text { + color:#fff; + overflow: hidden; + white-space: nowrap; + font-size: 11px; + font-weight: bold; + padding-left: 5px; +} + +.ui-progressbar-text-back { + color:#000; + padding-top: 1px; + padding-bottom: 1px; + padding-right: 1px; +} + +.ui-progressbar-disabled { + opacity:.5; + filter:Alpha(Opacity=50); +} + + +/* custom */ +.ui-progressbar-text.right-align { + text-align: right; + padding: 0 5px 0 0; +} +.ui-progressbar-inner-custom { + background: url(images/custom-bar.gif) repeat-x scroll left center; + border-bottom:1px solid #EFEFEF; + border-right:0pt none; + border-top:1px solid #BEBEBE; + height:15px; +} +.bold { + color: red !important; +} +.ui-hidden { + left:-10000px; + position:absolute; + top:-10000px; + visibility:hidden; +} + + + +/* +Generic ThemeRoller Classes +>> Make your jQuery Components ThemeRoller-Compatible! +*/ + +/*component global class*/ +.ui-component { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; + font-family: Verdana, Arial, sans-serif; + font-size: 1.1em; +} +/*component content styles*/ +.ui-component-content { + border: 1px solid #d3d3d3; + background: #ffffff; + color: #222222; +} +.ui-component-content a { + color: #222222; + text-decoration: underline; +} +/*component states*/ +.ui-default-state { + border: 1px solid #d3d3d3; + background: #e6e6e6 url(images/e6e6e6_40x100_textures_02_glass_75.png) 0 50% repeat-x; + font-weight: normal; + color: #555555 !important; +} +.ui-default-state a { + color: #555555; +} +.ui-default-state:hover, .ui-hover-state { + border: 1px solid #999999; + background: #dadada url(images/dadada_40x100_textures_02_glass_75.png) 0 50% repeat-x; + font-weight: normal; + color: #212121 !important; +} +.ui-hover-state a { + color: #212121; +} +.ui-default-state:active, .ui-active-state { + border: 1px solid #dddddd; + background: #ffffff url(images/ffffff_40x100_textures_02_glass_65.png) 0 50% repeat-x; + font-weight: normal; + color: #222222 !important; + outline: none; +} +.ui-active-state a { + color: #222222; + outline: none; +} +/*icons*/ +.ui-arrow-right-default {background: url(images/888888_7x7_arrow_right.gif) no-repeat 50% 50%;} +.ui-arrow-right-default:hover, .ui-arrow-right-hover {background: url(images/454545_7x7_arrow_right.gif) no-repeat 50% 50%;} +.ui-arrow-right-default:active, .ui-arrow-right-active {background: url(images/222222_7x7_arrow_right.gif) no-repeat 50% 50%;} +.ui-arrow-left-default {background: url(images/888888_7x7_arrow_left.gif) no-repeat 50% 50%;} +.ui-arrow-left-default:hover, .ui-arrow-left-hover {background: url(images/454545_7x7_arrow_left.gif) no-repeat 50% 50%;} +.ui-arrow-left-default:active, .ui-arrow-left-active {background: url(images/222222_7x7_arrow_left.gif) no-repeat 50% 50%;} +.ui-arrow-down-default {background: url(images/888888_7x7_arrow_down.gif) no-repeat 50% 50%;} +.ui-arrow-down-default:hover, .ui-arrow-down-hover {background: url(images/454545_7x7_arrow_down.gif) no-repeat 50% 50%;} +.ui-arrow-down-default:active, .ui-arrow-down-active {background: url(images/222222_7x7_arrow_down.gif) no-repeat 50% 50%;} +.ui-arrow-up-default {background: url(images/888888_7x7_arrow_up.gif) no-repeat 50% 50%;} +.ui-arrow-up-default:hover, .ui-arrow-up-hover {background: url(images/454545_7x7_arrow_up.gif) no-repeat 50% 50%;} +.ui-arrow-up-default:active, .ui-arrow-up-active {background: url(images/222222_7x7_arrow_up.gif) no-repeat 50% 50%;} +.ui-close-default {background: url(images/888888_11x11_icon_close.gif) no-repeat 50% 50%;} +.ui-close-default:hover, .ui-close-hover {background: url(images/454545_11x11_icon_close.gif) no-repeat 50% 50%;} +.ui-close-default:active, .ui-close-active {background: url(images/222222_11x11_icon_close.gif) no-repeat 50% 50%;} +.ui-folder-closed-default {background: url(images/888888_11x11_icon_folder_closed.gif) no-repeat 50% 50%;} +.ui-folder-closed-default:hover, .ui-folder-closed-hover {background: url(images/454545_11x11_icon_folder_closed.gif) no-repeat 50% 50%;} +.ui-folder-closed-default:active, .ui-folder-closed-active {background: url(images/222222_11x11_icon_folder_closed.gif) no-repeat 50% 50%;} +.ui-folder-open-default {background: url(images/888888_11x11_icon_folder_open.gif) no-repeat 50% 50%;} +.ui-folder-open-default:hover, .ui-folder-open-hover {background: url(images/454545_11x11_icon_folder_open.gif) no-repeat 50% 50%;} +.ui-folder-open-default:active, .ui-folder-open-active {background: url(images/222222_11x11_icon_folder_open.gif) no-repeat 50% 50%;} +.ui-doc-default {background: url(images/888888_11x11_icon_doc.gif) no-repeat 50% 50%;} +.ui-doc-default:hover, .ui-doc-hover {background: url(images/454545_11x11_icon_doc.gif) no-repeat 50% 50%;} +.ui-doc-default:active, .ui-doc-active {background: url(images/222222_11x11_icon_doc.gif) no-repeat 50% 50%;} +.ui-arrows-leftright-default {background: url(images/888888_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;} +.ui-arrows-leftright-default:hover, .ui-arrows-leftright-hover {background: url(images/454545_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;} +.ui-arrows-leftright-default:active, .ui-arrows-leftright-active {background: url(images/222222_11x11_icon_arrows_leftright.gif) no-repeat 50% 50%;} +.ui-arrows-updown-default {background: url(images/888888_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;} +.ui-arrows-updown-default:hover, .ui-arrows-updown-hover {background: url(images/454545_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;} +.ui-arrows-updown-default:active, .ui-arrows-updown-active {background: url(images/222222_11x11_icon_arrows_updown.gif) no-repeat 50% 50%;} +.ui-minus-default {background: url(images/888888_11x11_icon_minus.gif) no-repeat 50% 50%;} +.ui-minus-default:hover, .ui-minus-hover {background: url(images/454545_11x11_icon_minus.gif) no-repeat 50% 50%;} +.ui-minus-default:active, .ui-minus-active {background: url(images/222222_11x11_icon_minus.gif) no-repeat 50% 50%;} +.ui-plus-default {background: url(images/888888_11x11_icon_plus.gif) no-repeat 50% 50%;} +.ui-plus-default:hover, .ui-plus-hover {background: url(images/454545_11x11_icon_plus.gif) no-repeat 50% 50%;} +.ui-plus-default:active, .ui-plus-active {background: url(images/222222_11x11_icon_plus.gif) no-repeat 50% 50%;} +/*hidden elements*/ +.ui-hidden { + display: none;/* for accessible hiding: position: absolute; left: -99999999px*/; +} +.ui-accessible-hidden { + position: absolute; left: -99999999px; +} +/*reset styles*/ +.ui-reset { + /*resets*/margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; +} +/*clearfix class*/ +.ui-clearfix:after { + content: "."; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +.ui-clearfix {display: inline-block;} +/* Hides from IE-mac \*/ +* html .ui-clearfix {height: 1%;} +.ui-clearfix {display: block;} +/* End hide from IE-mac */ + +/* Note: for resizable styles, use the styles listed above in the dialog section */ + + + + +/* UI Spinner */ +.ui-spinner { + width: 15em; + display: block; + position: relative; + overflow: hidden; + border: 1px solid #999; + background: #FEFEFE url(./images/spinner-bg.gif) repeat-x left bottom; + padding: 0 5px; +} + +.ui-spinner-disabled { + background: #F4F4F4; + color: #CCC; +} + +.ui-spinner-box { + width: 90%; + height: 100%; + float: left; + font-size: 125%; + border: none; + background: none; + padding: 0; +} + +.ui-spinner-up, +.ui-spinner-down { + width: 10%; + height: 50%; + font-size: 0.5em; + padding: 0; + margin: 0; + z-index: 100; + text-align: center; + vertical-align: middle; + position: absolute; + right: 0; + cursor: default; + border: 1px solid #999; + border-right: none; + border-top: none; +} + +.ui-spinner-down { + bottom: 0; + border-bottom: 0; +} + +.ui-spinner-pressed { + background: #FEFEFE; +} + +.ui-spinner-list, +.ui-spinner-listitem { + margin: 0; + padding: 0; }
\ No newline at end of file diff --git a/themes/default/ui.datepicker.css b/themes/default/ui.datepicker.css index d485bc76b..49b00c0dc 100644 --- a/themes/default/ui.datepicker.css +++ b/themes/default/ui.datepicker.css @@ -1,213 +1,213 @@ -/* Main Style Sheet for jQuery UI date picker */
-#ui-datepicker-div, .ui-datepicker-inline {
- font-family: Arial, Helvetica, sans-serif;
- font-size: 14px;
- padding: 0;
- margin: 0;
- background: #ddd;
- width: 185px;
-}
-#ui-datepicker-div {
- display: none;
- border: 1px solid #777;
- z-index: 100; /*must have*/
-}
-.ui-datepicker-inline {
- float: left;
- display: block;
- border: 0;
-}
-.ui-datepicker-rtl {
- direction: rtl;
-}
-.ui-datepicker-dialog {
- padding: 5px !important;
- border: 4px ridge #ddd !important;
-}
-.ui-datepicker-disabled {
- position: absolute;
- z-index: 100;
- background-color: white;
- opacity: 0.5;
-}
-button.ui-datepicker-trigger {
- width: 25px;
-}
-img.ui-datepicker-trigger {
- margin: 2px;
- vertical-align: middle;
-}
-.ui-datepicker-prompt {
- float: left;
- padding: 2px;
- background: #ddd;
- color: #000;
-}
-* html .ui-datepicker-prompt {
- width: 185px;
-}
-.ui-datepicker-control, .ui-datepicker-links, .ui-datepicker-header, .ui-datepicker {
- clear: both;
- float: left;
- width: 100%;
- color: #fff;
-}
-.ui-datepicker-control {
- background: #400;
- padding: 2px 0px;
-}
-.ui-datepicker-links {
- background: #000;
- padding: 2px 0px;
-}
-.ui-datepicker-control, .ui-datepicker-links {
- font-weight: bold;
- font-size: 80%;
-}
-.ui-datepicker-links label { /* disabled links */
- padding: 2px 5px;
- color: #888;
-}
-.ui-datepicker-clear, .ui-datepicker-prev {
- float: left;
- width: 34%;
-}
-.ui-datepicker-rtl .ui-datepicker-clear, .ui-datepicker-rtl .ui-datepicker-prev {
- float: right;
- text-align: right;
-}
-.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-rtl .ui-datepicker-close, .ui-datepicker-rtl .ui-datepicker-next {
- float: left;
- text-align: left;
-}
-.ui-datepicker-header {
- padding: 1px 0 3px;
- background: #333;
- text-align: center;
- font-weight: bold;
- height: 1.3em;
-}
-.ui-datepicker-header select {
- background: #333;
- color: #fff;
- border: 0px;
- font-weight: bold;
-}
-.ui-datepicker {
- background: #ccc;
- text-align: center;
- font-size: 100%;
-}
-.ui-datepicker a {
- display: block;
- width: 100%;
-}
-.ui-datepicker-title-row {
- background: #777;
-}
-.ui-datepicker-days-row {
- background: #eee;
- color: #666;
-}
-.ui-datepicker-week-col {
- background: #777;
- color: #fff;
-}
-.ui-datepicker-days-cell {
- color: #000;
- border: 1px solid #ddd;
-}
-.ui-datepicker-days-cell a{
- display: block;
-}
-.ui-datepicker-week-end-cell {
- background: #ddd;
-}
-.ui-datepicker-title-row .ui-datepicker-week-end-cell {
- background: #777;
-}
-.ui-datepicker-days-cell-over {
- background: #fff;
- border: 1px solid #777;
-}
-.ui-datepicker-unselectable {
- color: #888;
-}
-.ui-datepicker-today {
- background: #fcc !important;
-}
-.ui-datepicker-current-day {
- background: #999 !important;
-}
-.ui-datepicker-status {
- background: #ddd;
- width: 100%;
- font-size: 80%;
- text-align: center;
-}
-
-/* ________ Datepicker 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-inline .ui-datepicker-links a {
- padding: 0 5px !important;
-}
-.ui-datepicker-control a, .ui-datepicker-links a {
- padding: 2px 5px !important;
- color: #eee !important;
-}
-.ui-datepicker-title-row a {
- color: #eee !important;
-}
-.ui-datepicker-control a:hover {
- background: #fdd !important;
- color: #333 !important;
-}
-.ui-datepicker-links a:hover, .ui-datepicker-title-row a:hover {
- background: #ddd !important;
- color: #333 !important;
-}
-
-/* ___________ MULTIPLE MONTHS _________*/
-
-.ui-datepicker-multi .ui-datepicker {
- border: 1px solid #777;
-}
-.ui-datepicker-one-month {
- float: left;
- width: 185px;
-}
-.ui-datepicker-new-row {
- 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*/
-}
+/* Main Style Sheet for jQuery UI date picker */ +#ui-datepicker-div, .ui-datepicker-inline { + font-family: Arial, Helvetica, sans-serif; + font-size: 14px; + padding: 0; + margin: 0; + background: #ddd; + width: 185px; +} +#ui-datepicker-div { + display: none; + border: 1px solid #777; + z-index: 100; /*must have*/ +} +.ui-datepicker-inline { + float: left; + display: block; + border: 0; +} +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-dialog { + padding: 5px !important; + border: 4px ridge #ddd !important; +} +.ui-datepicker-disabled { + position: absolute; + z-index: 100; + background-color: white; + opacity: 0.5; +} +button.ui-datepicker-trigger { + width: 25px; +} +img.ui-datepicker-trigger { + margin: 2px; + vertical-align: middle; +} +.ui-datepicker-prompt { + float: left; + padding: 2px; + background: #ddd; + color: #000; +} +* html .ui-datepicker-prompt { + width: 185px; +} +.ui-datepicker-control, .ui-datepicker-links, .ui-datepicker-header, .ui-datepicker { + clear: both; + float: left; + width: 100%; + color: #fff; +} +.ui-datepicker-control { + background: #400; + padding: 2px 0px; +} +.ui-datepicker-links { + background: #000; + padding: 2px 0px; +} +.ui-datepicker-control, .ui-datepicker-links { + font-weight: bold; + font-size: 80%; +} +.ui-datepicker-links label { /* disabled links */ + padding: 2px 5px; + color: #888; +} +.ui-datepicker-clear, .ui-datepicker-prev { + float: left; + width: 34%; +} +.ui-datepicker-rtl .ui-datepicker-clear, .ui-datepicker-rtl .ui-datepicker-prev { + float: right; + text-align: right; +} +.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-rtl .ui-datepicker-close, .ui-datepicker-rtl .ui-datepicker-next { + float: left; + text-align: left; +} +.ui-datepicker-header { + padding: 1px 0 3px; + background: #333; + text-align: center; + font-weight: bold; + height: 1.3em; +} +.ui-datepicker-header select { + background: #333; + color: #fff; + border: 0px; + font-weight: bold; +} +.ui-datepicker { + background: #ccc; + text-align: center; + font-size: 100%; +} +.ui-datepicker a { + display: block; + width: 100%; +} +.ui-datepicker-title-row { + background: #777; +} +.ui-datepicker-days-row { + background: #eee; + color: #666; +} +.ui-datepicker-week-col { + background: #777; + color: #fff; +} +.ui-datepicker-days-cell { + color: #000; + border: 1px solid #ddd; +} +.ui-datepicker-days-cell a{ + display: block; +} +.ui-datepicker-week-end-cell { + background: #ddd; +} +.ui-datepicker-title-row .ui-datepicker-week-end-cell { + background: #777; +} +.ui-datepicker-days-cell-over { + background: #fff; + border: 1px solid #777; +} +.ui-datepicker-unselectable { + color: #888; +} +.ui-datepicker-today { + background: #fcc !important; +} +.ui-datepicker-current-day { + background: #999 !important; +} +.ui-datepicker-status { + background: #ddd; + width: 100%; + font-size: 80%; + text-align: center; +} + +/* ________ Datepicker 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-inline .ui-datepicker-links a { + padding: 0 5px !important; +} +.ui-datepicker-control a, .ui-datepicker-links a { + padding: 2px 5px !important; + color: #eee !important; +} +.ui-datepicker-title-row a { + color: #eee !important; +} +.ui-datepicker-control a:hover { + background: #fdd !important; + color: #333 !important; +} +.ui-datepicker-links a:hover, .ui-datepicker-title-row a:hover { + background: #ddd !important; + color: #333 !important; +} + +/* ___________ MULTIPLE MONTHS _________*/ + +.ui-datepicker-multi .ui-datepicker { + border: 1px solid #777; +} +.ui-datepicker-one-month { + float: left; + width: 185px; +} +.ui-datepicker-new-row { + 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*/ +} diff --git a/ui/i18n/ui.datepicker-eo.js b/ui/i18n/ui.datepicker-eo.js index 92009dcdf..42e9118ab 100644 --- a/ui/i18n/ui.datepicker-eo.js +++ b/ui/i18n/ui.datepicker-eo.js @@ -1,25 +1,25 @@ -/* Esperanto initialisation for the jQuery UI date picker plugin. */
-/* Written by Olivier M. (olivierweb@ifrance.com). */
-jQuery(function($){
- $.datepicker.regional['eo'] = {
- clearText: 'Vakigi', clearStatus: '',
- closeText: 'Fermi', closeStatus: 'Fermi sen modifi',
- prevText: '<Anta', prevStatus: 'Vidi la antaŭan monaton',
- prevBigText: '<<', prevBigStatus: '',
- nextText: 'Sekv>', nextStatus: 'Vidi la sekvan monaton',
- nextBigText: '>>', nextBigStatus: '',
- currentText: 'Nuna', currentStatus: 'Vidi la nunan monaton',
- monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio',
- 'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'],
- monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
- 'Jul','Aŭg','Sep','Okt','Nov','Dec'],
- monthStatus: 'Vidi alian monaton', yearStatus: 'Vidi alian jaron',
- weekHeader: 'Sb', weekStatus: '',
- dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'],
- dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'],
- dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'],
- dayStatus: 'Uzi DD kiel unua tago de la semajno', dateStatus: 'Elekti DD, MM d',
- dateFormat: 'dd/mm/yy', firstDay: 0,
- initStatus: 'Elekti la daton', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['eo']);
-});
+/* Esperanto initialisation for the jQuery UI date picker plugin. */ +/* Written by Olivier M. (olivierweb@ifrance.com). */ +jQuery(function($){ + $.datepicker.regional['eo'] = { + clearText: 'Vakigi', clearStatus: '', + closeText: 'Fermi', closeStatus: 'Fermi sen modifi', + prevText: '<Anta', prevStatus: 'Vidi la antaŭan monaton', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Sekv>', nextStatus: 'Vidi la sekvan monaton', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Nuna', currentStatus: 'Vidi la nunan monaton', + monthNames: ['Januaro','Februaro','Marto','Aprilo','Majo','Junio', + 'Julio','Aŭgusto','Septembro','Oktobro','Novembro','Decembro'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun', + 'Jul','Aŭg','Sep','Okt','Nov','Dec'], + monthStatus: 'Vidi alian monaton', yearStatus: 'Vidi alian jaron', + weekHeader: 'Sb', weekStatus: '', + dayNames: ['Dimanĉo','Lundo','Mardo','Merkredo','Ĵaŭdo','Vendredo','Sabato'], + dayNamesShort: ['Dim','Lun','Mar','Mer','Ĵaŭ','Ven','Sab'], + dayNamesMin: ['Di','Lu','Ma','Me','Ĵa','Ve','Sa'], + dayStatus: 'Uzi DD kiel unua tago de la semajno', dateStatus: 'Elekti DD, MM d', + dateFormat: 'dd/mm/yy', firstDay: 0, + initStatus: 'Elekti la daton', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['eo']); +}); diff --git a/ui/i18n/ui.datepicker-hr.js b/ui/i18n/ui.datepicker-hr.js index be438acfb..597aa4ae6 100644 --- a/ui/i18n/ui.datepicker-hr.js +++ b/ui/i18n/ui.datepicker-hr.js @@ -1,25 +1,25 @@ -/* Croatian i18n for the jQuery UI date picker plugin. */
-/* Written by Vjekoslav Nesek. */
-jQuery(function($){
- $.datepicker.regional['hr'] = {
- clearText: 'izbriši', clearStatus: 'Izbriši trenutni datum',
- closeText: 'Zatvori', closeStatus: 'Zatvori kalendar',
- prevText: '<', prevStatus: 'Prikaži prethodni mjesec',
- prevBigText: '<<', prevBigStatus: '',
- nextText: '>', nextStatus: 'Prikaži slijedeći mjesec',
- nextBigText: '>>', nextBigStatus: '',
- currentText: 'Danas', currentStatus: 'Današnji datum',
- monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipani',
- 'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
- monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
- 'Srp','Kol','Ruj','Lis','Stu','Pro'],
- monthStatus: 'Prikaži mjesece', yearStatus: 'Prikaži godine',
- weekHeader: 'Tje', weekStatus: 'Tjedan',
- dayNames: ['Nedjalja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
- dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
- dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
- dayStatus: 'Odaber DD za prvi dan tjedna', dateStatus: '\'Datum\' D, M d',
- dateFormat: 'dd.mm.yy.', firstDay: 1,
- initStatus: 'Odaberi datum', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['hr']);
+/* Croatian i18n for the jQuery UI date picker plugin. */ +/* Written by Vjekoslav Nesek. */ +jQuery(function($){ + $.datepicker.regional['hr'] = { + clearText: 'izbriši', clearStatus: 'Izbriši trenutni datum', + closeText: 'Zatvori', closeStatus: 'Zatvori kalendar', + prevText: '<', prevStatus: 'Prikaži prethodni mjesec', + prevBigText: '<<', prevBigStatus: '', + nextText: '>', nextStatus: 'Prikaži slijedeći mjesec', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Danas', currentStatus: 'Današnji datum', + monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipani', + 'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'], + monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip', + 'Srp','Kol','Ruj','Lis','Stu','Pro'], + monthStatus: 'Prikaži mjesece', yearStatus: 'Prikaži godine', + weekHeader: 'Tje', weekStatus: 'Tjedan', + dayNames: ['Nedjalja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'], + dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'], + dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'], + dayStatus: 'Odaber DD za prvi dan tjedna', dateStatus: '\'Datum\' D, M d', + dateFormat: 'dd.mm.yy.', firstDay: 1, + initStatus: 'Odaberi datum', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['hr']); });
\ No newline at end of file diff --git a/ui/i18n/ui.datepicker-hy.js b/ui/i18n/ui.datepicker-hy.js index 4afb109df..95ac6f0f0 100644 --- a/ui/i18n/ui.datepicker-hy.js +++ b/ui/i18n/ui.datepicker-hy.js @@ -1,25 +1,25 @@ -/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */
-/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/
-jQuery(function($){
- $.datepicker.regional['hy'] = {
- clearText: 'Մաքրել', clearStatus: '',
- closeText: 'Փակել', closeStatus: '',
- prevText: '<Նախ.', prevStatus: '',
- prevBigText: '<<', prevBigStatus: '',
- nextText: 'Հաջ.>', nextStatus: '',
- nextBigText: '>>', nextBigStatus: '',
- currentText: 'Այսօր', currentStatus: '',
- monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս',
- 'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'],
- monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս',
- 'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'ՇԲՏ', weekStatus: '',
- dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'],
- dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
- dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['hy']);
+/* Armenian(UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Levon Zakaryan (levon.zakaryan@gmail.com)*/ +jQuery(function($){ + $.datepicker.regional['hy'] = { + clearText: 'Մաքրել', clearStatus: '', + closeText: 'Փակել', closeStatus: '', + prevText: '<Նախ.', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: 'Հաջ.>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Այսօր', currentStatus: '', + monthNames: ['Հունվար','Փետրվար','Մարտ','Ապրիլ','Մայիս','Հունիս', + 'Հուլիս','Օգոստոս','Սեպտեմբեր','Հոկտեմբեր','Նոյեմբեր','Դեկտեմբեր'], + monthNamesShort: ['Հունվ','Փետր','Մարտ','Ապր','Մայիս','Հունիս', + 'Հուլ','Օգս','Սեպ','Հոկ','Նոյ','Դեկ'], + monthStatus: '', yearStatus: '', + weekHeader: 'ՇԲՏ', weekStatus: '', + dayNames: ['կիրակի','եկուշաբթի','երեքշաբթի','չորեքշաբթի','հինգշաբթի','ուրբաթ','շաբաթ'], + dayNamesShort: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], + dayNamesMin: ['կիր','երկ','երք','չրք','հնգ','ուրբ','շբթ'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['hy']); });
\ No newline at end of file diff --git a/ui/i18n/ui.datepicker-uk.js b/ui/i18n/ui.datepicker-uk.js index c296c0c7e..7dcfde5d9 100644 --- a/ui/i18n/ui.datepicker-uk.js +++ b/ui/i18n/ui.datepicker-uk.js @@ -1,25 +1,25 @@ -/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */
-/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */
-jQuery(function($){
- $.datepicker.regional['uk'] = {
- clearText: 'Очистити', clearStatus: '',
- closeText: 'Закрити', closeStatus: '',
- prevText: '<', prevStatus: '',
- prevBigText: '<<', prevBigStatus: '',
- nextText: '>', nextStatus: '',
- nextBigText: '>>', nextBigStatus: '',
- currentText: 'Сьогодні', currentStatus: '',
- monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень',
- 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'],
- monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер',
- 'Лип','Сер','Вер','Жов','Лис','Гру'],
- monthStatus: '', yearStatus: '',
- weekHeader: 'Не', weekStatus: '',
- dayNames: ['неділя','понеділок','вівторок','середа','четвер','пятниця','суббота'],
- dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'],
- dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'],
- dayStatus: 'DD', dateStatus: 'D, M d',
- dateFormat: 'dd.mm.yy', firstDay: 1,
- initStatus: '', isRTL: false};
- $.datepicker.setDefaults($.datepicker.regional['uk']);
+/* Ukrainian (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Maxim Drogobitskiy (maxdao@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['uk'] = { + clearText: 'Очистити', clearStatus: '', + closeText: 'Закрити', closeStatus: '', + prevText: '<', prevStatus: '', + prevBigText: '<<', prevBigStatus: '', + nextText: '>', nextStatus: '', + nextBigText: '>>', nextBigStatus: '', + currentText: 'Сьогодні', currentStatus: '', + monthNames: ['Січень','Лютий','Березень','Квітень','Травень','Червень', + 'Липень','Серпень','Вересень','Жовтень','Листопад','Грудень'], + monthNamesShort: ['Січ','Лют','Бер','Кві','Тра','Чер', + 'Лип','Сер','Вер','Жов','Лис','Гру'], + monthStatus: '', yearStatus: '', + weekHeader: 'Не', weekStatus: '', + dayNames: ['неділя','понеділок','вівторок','середа','четвер','пятниця','суббота'], + dayNamesShort: ['нед','пнд','вів','срд','чтв','птн','сбт'], + dayNamesMin: ['Нд','Пн','Вт','Ср','Чт','Пт','Сб'], + dayStatus: 'DD', dateStatus: 'D, M d', + dateFormat: 'dd.mm.yy', firstDay: 1, + initStatus: '', isRTL: false}; + $.datepicker.setDefaults($.datepicker.regional['uk']); });
\ No newline at end of file |