diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-02-21 17:48:55 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-02-21 17:48:55 +0100 |
commit | 6528b48b4762b0ddf3697580444fdf9f34e7eca9 (patch) | |
tree | 46e0e17d0b8356d0e9d142e9a00bdf242d5bbf2c /demos | |
parent | 98d72c7f6d0f1c535774d4db85556626e016603c (diff) | |
parent | d32a9e81ecb8a201c1737c3226a99c33ced451af (diff) | |
download | jquery-ui-6528b48b4762b0ddf3697580444fdf9f34e7eca9.tar.gz jquery-ui-6528b48b4762b0ddf3697580444fdf9f34e7eca9.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'demos')
-rw-r--r-- | demos/accordion/hoverintent.html | 8 | ||||
-rw-r--r-- | demos/accordion/sortable.html | 26 | ||||
-rw-r--r-- | demos/addClass/default.html | 2 | ||||
-rw-r--r-- | demos/autocomplete/categories.html | 4 | ||||
-rw-r--r-- | demos/autocomplete/combobox.html | 4 | ||||
-rw-r--r-- | demos/datepicker/localization.html | 4 | ||||
-rw-r--r-- | demos/draggable/cursor-style.html | 4 | ||||
-rw-r--r-- | demos/effect/easing.html | 35 | ||||
-rw-r--r-- | demos/index.html | 6 | ||||
-rw-r--r-- | demos/sortable/connect-lists.html | 2 |
10 files changed, 52 insertions, 43 deletions
diff --git a/demos/accordion/hoverintent.html b/demos/accordion/hoverintent.html index 09360d62d..8f628bda8 100644 --- a/demos/accordion/hoverintent.html +++ b/demos/accordion/hoverintent.html @@ -29,7 +29,7 @@ $( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler ); }, handler: function( event ) { - var self = this, + var that = this, args = arguments, target = $( event.target ), cX, cY, pX, pY; @@ -50,7 +50,11 @@ if ( ( Math.abs( pX - cX ) + Math.abs( pY - cY ) ) < cfg.sensitivity ) { clear(); event.type = "hoverintent"; - jQuery.event.handle.apply( self, args ); + // prevent accessing the original event since the new event + // is fired asynchronously and the old event is no longer + // usable (#6028) + event.originalEvent = {}; + jQuery.event.handle.apply( that, args ); } else { pX = cX; pY = cY; diff --git a/demos/accordion/sortable.html b/demos/accordion/sortable.html index a0a899344..60b5d3c70 100644 --- a/demos/accordion/sortable.html +++ b/demos/accordion/sortable.html @@ -11,16 +11,12 @@ <script src="../../ui/jquery.ui.sortable.js"></script> <script src="../../ui/jquery.ui.accordion.js"></script> <link rel="stylesheet" href="../demos.css"> + <style> + /* IE has layout issues when sorting (see #5413) */ + .group { zoom: 1 } + </style> <script> $(function() { - var stop = false; - $( "#accordion h3" ).click(function( event ) { - if ( stop ) { - event.stopImmediatePropagation(); - event.preventDefault(); - stop = false; - } - }); $( "#accordion" ) .accordion({ header: "> div > h3" @@ -28,8 +24,10 @@ .sortable({ axis: "y", handle: "h3", - stop: function() { - stop = true; + stop: function( event, ui ) { + // IE doesn't register the blur when sorting + // so trigger focusout handlers to remove .ui-state-focus + ui.item.children( "h3" ).triggerHandler( "focusout" ); } }); }); @@ -40,19 +38,19 @@ <div class="demo"> <div id="accordion"> - <div> + <div class="group"> <h3><a href="#">Section 1</a></h3> <div> <p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.</p> </div> </div> - <div> + <div class="group"> <h3><a href="#">Section 2</a></h3> <div> <p>Sed non urna. Donec et ante. Phasellus eu ligula. Vestibulum sit amet purus. Vivamus hendrerit, dolor at aliquet laoreet, mauris turpis porttitor velit, faucibus interdum tellus libero ac justo. Vivamus non quam. In suscipit faucibus urna. </p> </div> </div> - <div> + <div class="group"> <h3><a href="#">Section 3</a></h3> <div> <p>Nam enim risus, molestie et, porta ac, aliquam ac, risus. Quisque lobortis. Phasellus pellentesque purus in massa. Aenean in pede. Phasellus ac libero ac tellus pellentesque semper. Sed ac felis. Sed commodo, magna quis lacinia ornare, quam ante aliquam nisi, eu iaculis leo purus venenatis dui. </p> @@ -63,7 +61,7 @@ </ul> </div> </div> - <div> + <div class="group"> <h3><a href="#">Section 4</a></h3> <div> <p>Cras dictum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean lacinia mauris vel est. </p><p>Suspendisse eu nisl. Nullam ut libero. Integer dignissim consequat lectus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. </p> diff --git a/demos/addClass/default.html b/demos/addClass/default.html index 38acd8b4c..406466263 100644 --- a/demos/addClass/default.html +++ b/demos/addClass/default.html @@ -33,7 +33,7 @@ <div class="demo"> <div class="toggler"> - <div id="effect" class=" ui-corner-all"> + <div id="effect" class="ui-corner-all"> Etiam libero neque, luctus a, eleifend nec, semper at, lorem. Sed pede. </div> </div> diff --git a/demos/autocomplete/categories.html b/demos/autocomplete/categories.html index 2eead8ad2..902867478 100644 --- a/demos/autocomplete/categories.html +++ b/demos/autocomplete/categories.html @@ -22,14 +22,14 @@ <script> $.widget( "custom.catcomplete", $.ui.autocomplete, { _renderMenu: function( ul, items ) { - var self = this, + var that = this, currentCategory = ""; $.each( items, function( index, item ) { if ( item.category != currentCategory ) { ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); currentCategory = item.category; } - self._renderItem( ul, item ); + that._renderItem( ul, item ); }); } }); diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index aeaee5c4c..27ef92d4e 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -29,7 +29,7 @@ (function( $ ) { $.widget( "ui.combobox", { _create: function() { - var self = this, + var that = this, select = this.element.hide(), selected = select.children( ":selected" ), value = selected.val() ? selected.text() : ""; @@ -85,7 +85,7 @@ }, select: function( event, ui ) { ui.item.option.selected = true; - self._trigger( "selected", event, { + that._trigger( "selected", event, { item: ui.item.option }); }, diff --git a/demos/datepicker/localization.html b/demos/datepicker/localization.html index e11a82438..c276a1679 100644 --- a/demos/datepicker/localization.html +++ b/demos/datepicker/localization.html @@ -34,6 +34,7 @@ <script src="../../ui/i18n/jquery.ui.datepicker-fr-CH.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-gl.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-he.js"></script> + <script src="../../ui/i18n/jquery.ui.datepicker-hi.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-hr.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-hu.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-hy.js"></script> @@ -42,6 +43,7 @@ <script src="../../ui/i18n/jquery.ui.datepicker-it.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-ja.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-kk.js"></script> + <script src="../../ui/i18n/jquery.ui.datepicker-km.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-ko.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-lb.js"></script> <script src="../../ui/i18n/jquery.ui.datepicker-lt.js"></script> @@ -123,12 +125,14 @@ <option value="de">German (Deutsch)</option> <option value="el">Greek (Ελληνικά)</option> <option value="he">Hebrew (‫(עברית</option> + <option value="hi">Hindi (हिंदी)</option> <option value="hu">Hungarian (Magyar)</option> <option value="is">Icelandic (Õslenska)</option> <option value="id">Indonesian (Bahasa Indonesia)</option> <option value="it">Italian (Italiano)</option> <option value="ja">Japanese (日本語)</option> <option value="kk">Kazakhstan (Kazakh)</option> + <option value="km">Khmer</option> <option value="ko">Korean (한국어)</option> <option value="lv">Latvian (Latvieöu Valoda)</option> <option value="lt">Lithuanian (lietuviu kalba)</option> diff --git a/demos/draggable/cursor-style.html b/demos/draggable/cursor-style.html index 2e8930eb0..72e129150 100644 --- a/demos/draggable/cursor-style.html +++ b/demos/draggable/cursor-style.html @@ -15,8 +15,8 @@ </style> <script> $(function() { - $( "#draggable" ).draggable({ cursorAt: { cursor: "move", top: 56, left: 56 } }); - $( "#draggable2" ).draggable({ cursorAt: { cursor: "crosshair", top: -5, left: -5 } }); + $( "#draggable" ).draggable({ cursor: "move", cursorAt: { top: 56, left: 56 } }); + $( "#draggable2" ).draggable({ cursor: "crosshair", cursorAt: { top: -5, left: -5 } }); $( "#draggable3" ).draggable({ cursorAt: { bottom: 0 } }); }); </script> diff --git a/demos/effect/easing.html b/demos/effect/easing.html index e3270c070..f3e07a9c5 100644 --- a/demos/effect/easing.html +++ b/demos/effect/easing.html @@ -15,10 +15,9 @@ </style> <script> $(function() { - if ( !$( "<canvas/>" )[0].getContext ) { - $( "<div/>" ).text( - "Your browser doesn't support canvas, which is required for this demo. " + - "Give Firefox 3 a try!" + if ( !$( "<canvas>" )[0].getContext ) { + $( "<div>" ).text( + "Your browser doesn't support canvas, which is required for this demo." ).appendTo( "#graphs" ); return; } @@ -26,15 +25,13 @@ var i = 0, width = 100, height = 100; + $.each( $.easing, function( name, impl ) { - // skip linear/jswing and any non functioning implementation - if ( !$.isFunction( impl ) || /jswing/.test( name ) ) { - return; - } - var graph = $( "<div/>" ).addClass( "graph" ).appendTo( "#graphs" ), - text = $( "<div/>" ).text( ++i + ". " + name ).appendTo( graph ), - wrap = $( "<div/>" ).appendTo( graph ).css( 'overflow', 'hidden' ), - canvas = $( "<canvas/>" ).appendTo( wrap )[ 0 ]; + var graph = $( "<div>" ).addClass( "graph" ).appendTo( "#graphs" ), + text = $( "<div>" ).text( ++i + ". " + name ).appendTo( graph ), + wrap = $( "<div>" ).appendTo( graph ).css( 'overflow', 'hidden' ), + canvas = $( "<canvas>" ).appendTo( wrap )[ 0 ]; + canvas.width = width; canvas.height = height; var drawHeight = height * 0.8, @@ -42,6 +39,7 @@ ctx = canvas.getContext( "2d" ); ctx.fillStyle = "black"; + // draw background ctx.beginPath(); ctx.moveTo( cradius, 0 ); ctx.quadraticCurveTo( 0, 0, 0, cradius ); @@ -53,31 +51,34 @@ ctx.lineTo( cradius, 0 ); ctx.fill(); + // draw bottom line ctx.strokeStyle = "#555"; ctx.beginPath(); ctx.moveTo( width * 0.1, drawHeight + .5 ); ctx.lineTo( width * 0.9, drawHeight + .5 ); ctx.stroke(); + // draw top line ctx.strokeStyle = "#555"; ctx.beginPath(); ctx.moveTo( width * 0.1, drawHeight * .3 - .5 ); ctx.lineTo( width * 0.9, drawHeight * .3 - .5 ); ctx.stroke(); - + + // plot easing ctx.strokeStyle = "white"; ctx.beginPath(); ctx.lineWidth = 2; ctx.moveTo( width * 0.1, drawHeight ); $.each( new Array( width ), function( position ) { - var val = impl( 0, position, 0, 1, height ); - if ( /linear|jswing/.test( name ) ) { - val = position / width; - } + var state = position / width, + val = impl( state, position, 0, 1, width ); ctx.lineTo( position * 0.8 + width * 0.1, drawHeight - drawHeight * val * 0.7 ); }); ctx.stroke(); + + // animate on click graph.click(function() { wrap .animate( { height: "hide" }, 2000, name ) diff --git a/demos/index.html b/demos/index.html index 76ddcd3da..81217cba3 100644 --- a/demos/index.html +++ b/demos/index.html @@ -68,6 +68,7 @@ <script src="../ui/i18n/jquery.ui.datepicker-fr-CH.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-gl.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-he.js"></script> + <script src="../ui/i18n/jquery.ui.datepicker-hi.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-hr.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-hu.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-hy.js"></script> @@ -76,6 +77,7 @@ <script src="../ui/i18n/jquery.ui.datepicker-it.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-ja.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-kk.js"></script> + <script src="../ui/i18n/jquery.ui.datepicker-km.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-ko.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-lb.js"></script> <script src="../ui/i18n/jquery.ui.datepicker-lt.js"></script> @@ -225,9 +227,9 @@ return false; }); }); - }); + }, "html" ); } - }); + }, "html" ); } function updateDemoNotes() { diff --git a/demos/sortable/connect-lists.html b/demos/sortable/connect-lists.html index 1d4ae490e..3e62952e4 100644 --- a/demos/sortable/connect-lists.html +++ b/demos/sortable/connect-lists.html @@ -11,7 +11,7 @@ <script src="../../ui/jquery.ui.sortable.js"></script> <link rel="stylesheet" href="../demos.css"> <style> - #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; } + #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0 0 2.5em; float: left; margin-right: 10px; } #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 120px; } </style> <script> |