diff options
author | Alexander Schmitz <arschmitz@gmail.com> | 2015-06-30 15:22:59 -0400 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-07-21 11:00:41 -0400 |
commit | 0935c9af366bfc412db4cc2bea8b544d5588a7b2 (patch) | |
tree | 126daf27ecdbdeffeff4a0f5fd64ff9f493e22d9 /demos | |
parent | 9484718a00d68a36f5600c6c49365d134d1df79e (diff) | |
download | jquery-ui-0935c9af366bfc412db4cc2bea8b544d5588a7b2.tar.gz jquery-ui-0935c9af366bfc412db4cc2bea8b544d5588a7b2.zip |
Autocomplete: Update demos to use AMD
Ref #10119
Diffstat (limited to 'demos')
-rw-r--r-- | demos/autocomplete/categories.html | 55 | ||||
-rw-r--r-- | demos/autocomplete/combobox.html | 15 | ||||
-rw-r--r-- | demos/autocomplete/custom-data.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/default.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/folding.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/maxheight.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/multiple-remote.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/multiple.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/remote-jsonp.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/remote-with-cache.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/remote.html | 11 | ||||
-rw-r--r-- | demos/autocomplete/xml.html | 11 |
12 files changed, 45 insertions, 135 deletions
diff --git a/demos/autocomplete/categories.html b/demos/autocomplete/categories.html index d986fdb11..d2a107b53 100644 --- a/demos/autocomplete/categories.html +++ b/demos/autocomplete/categories.html @@ -4,12 +4,6 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Categories</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .ui-autocomplete-category { @@ -19,31 +13,29 @@ line-height: 1.5; } </style> - <script> - $.widget( "custom.catcomplete", $.ui.autocomplete, { - _create: function() { - this._super(); - this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); - }, - _renderMenu: function( ul, items ) { - var that = this, - currentCategory = ""; - $.each( items, function( index, item ) { - var li; - if ( item.category != currentCategory ) { - ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); - currentCategory = item.category; - } - li = that._renderItemData( ul, item ); - if ( item.category ) { - li.attr( "aria-label", item.category + " : " + item.label ); - } - }); - } - }); - </script> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> + $.widget( "custom.catcomplete", $.ui.autocomplete, { + _create: function() { + this._super(); + this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); + }, + _renderMenu: function( ul, items ) { + var that = this, + currentCategory = ""; + $.each( items, function( index, item ) { + var li; + if ( item.category != currentCategory ) { + ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); + currentCategory = item.category; + } + li = that._renderItemData( ul, item ); + if ( item.category ) { + li.attr( "aria-label", item.category + " : " + item.label ); + } + }); + } + }); var data = [ { label: "anders", category: "" }, { label: "andreas", category: "" }, @@ -60,7 +52,6 @@ delay: 0, source: data }); - }); </script> </head> <body> diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index 76d792470..409e64d7c 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -4,14 +4,6 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Combobox</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/button.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> - <script src="../../ui/tooltip.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .custom-combobox { @@ -30,8 +22,8 @@ padding: 5px 10px; } </style> - <script> - (function( $ ) { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js" data-modules="tooltip button"> $.widget( "custom.combobox", { _create: function() { this.wrapper = $( "<span>" ) @@ -161,14 +153,11 @@ this.element.show(); } }); - })( jQuery ); - $(function() { $( "#combobox" ).combobox(); $( "#toggle" ).on( "click", function() { $( "#combobox" ).toggle(); }); - }); </script> </head> <body> diff --git a/demos/autocomplete/custom-data.html b/demos/autocomplete/custom-data.html index 1c94a877a..06a777440 100644 --- a/demos/autocomplete/custom-data.html +++ b/demos/autocomplete/custom-data.html @@ -4,12 +4,6 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Custom data and display</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> #project-label { @@ -27,8 +21,8 @@ padding: 0; } </style> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> var projects = [ { value: "jquery", @@ -71,7 +65,6 @@ .append( "<div>" + item.label + "<br>" + item.desc + "</div>" ) .appendTo( ul ); }; - }); </script> </head> <body> diff --git a/demos/autocomplete/default.html b/demos/autocomplete/default.html index f0ade5ea7..49e575898 100644 --- a/demos/autocomplete/default.html +++ b/demos/autocomplete/default.html @@ -4,15 +4,9 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Default functionality</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> var availableTags = [ "ActionScript", "AppleScript", @@ -40,7 +34,6 @@ $( "#tags" ).autocomplete({ source: availableTags }); - }); </script> </head> <body> diff --git a/demos/autocomplete/folding.html b/demos/autocomplete/folding.html index 405809402..98bc6bbb7 100644 --- a/demos/autocomplete/folding.html +++ b/demos/autocomplete/folding.html @@ -4,15 +4,9 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Accent folding</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> var names = [ "Jörn Zaefferer", "Scott González", "John Resig" ]; var accentMap = { @@ -36,7 +30,6 @@ }) ); } }); - }); </script> </head> <body> diff --git a/demos/autocomplete/maxheight.html b/demos/autocomplete/maxheight.html index 9d7961591..8f65169c1 100644 --- a/demos/autocomplete/maxheight.html +++ b/demos/autocomplete/maxheight.html @@ -4,12 +4,6 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Scrollable results</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .ui-autocomplete { @@ -25,8 +19,8 @@ height: 100px; } </style> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> var availableTags = [ "ActionScript", "AppleScript", @@ -54,7 +48,6 @@ $( "#tags" ).autocomplete({ source: availableTags }); - }); </script> </head> <body> diff --git a/demos/autocomplete/multiple-remote.html b/demos/autocomplete/multiple-remote.html index 45f319865..f263cf75c 100644 --- a/demos/autocomplete/multiple-remote.html +++ b/demos/autocomplete/multiple-remote.html @@ -4,20 +4,14 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Multiple, remote</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .ui-autocomplete-loading { background: white url("images/ui-anim_basic_16x16.gif") right center no-repeat; } </style> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> function split( val ) { return val.split( /,\s*/ ); } @@ -62,7 +56,6 @@ return false; } }); - }); </script> </head> <body> diff --git a/demos/autocomplete/multiple.html b/demos/autocomplete/multiple.html index 1bd70f228..5ee4edb0a 100644 --- a/demos/autocomplete/multiple.html +++ b/demos/autocomplete/multiple.html @@ -4,15 +4,9 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Multiple values</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> var availableTags = [ "ActionScript", "AppleScript", @@ -75,7 +69,6 @@ return false; } }); - }); </script> </head> <body> diff --git a/demos/autocomplete/remote-jsonp.html b/demos/autocomplete/remote-jsonp.html index 0d71dae9a..3c2f4921f 100644 --- a/demos/autocomplete/remote-jsonp.html +++ b/demos/autocomplete/remote-jsonp.html @@ -4,12 +4,6 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Remote JSONP datasource</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .ui-autocomplete-loading { @@ -17,8 +11,8 @@ } #city { width: 25em; } </style> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> function log( message ) { $( "<div>" ).text( message ).prependTo( "#log" ); $( "#log" ).scrollTop( 0 ); @@ -44,7 +38,6 @@ log( "Selected: " + ui.item.label ); } } ); - } ); </script> </head> <body> diff --git a/demos/autocomplete/remote-with-cache.html b/demos/autocomplete/remote-with-cache.html index 1eea5eff1..4ab2fdefb 100644 --- a/demos/autocomplete/remote-with-cache.html +++ b/demos/autocomplete/remote-with-cache.html @@ -4,20 +4,14 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Remote with caching</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .ui-autocomplete-loading { background: white url("images/ui-anim_basic_16x16.gif") right center no-repeat; } </style> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> var cache = {}; $( "#birds" ).autocomplete({ minLength: 2, @@ -34,7 +28,6 @@ }); } }); - }); </script> </head> <body> diff --git a/demos/autocomplete/remote.html b/demos/autocomplete/remote.html index 95d2ae49c..1993f8e6d 100644 --- a/demos/autocomplete/remote.html +++ b/demos/autocomplete/remote.html @@ -4,20 +4,14 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - Remote datasource</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .ui-autocomplete-loading { background: white url("images/ui-anim_basic_16x16.gif") right center no-repeat; } </style> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> function log( message ) { $( "<div>" ).text( message ).prependTo( "#log" ); $( "#log" ).scrollTop( 0 ); @@ -32,7 +26,6 @@ "Nothing selected, input was " + this.value ); } }); - }); </script> </head> <body> diff --git a/demos/autocomplete/xml.html b/demos/autocomplete/xml.html index aa0394c10..5bdf4d3cc 100644 --- a/demos/autocomplete/xml.html +++ b/demos/autocomplete/xml.html @@ -4,20 +4,14 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete - XML data parsed once</title> <link rel="stylesheet" href="../../themes/base/all.css"> - <script src="../../external/jquery/jquery.js"></script> - <script src="../../ui/core.js"></script> - <script src="../../ui/widget.js"></script> - <script src="../../ui/position.js"></script> - <script src="../../ui/menu.js"></script> - <script src="../../ui/autocomplete.js"></script> <link rel="stylesheet" href="../demos.css"> <style> .ui-autocomplete-loading { background: white url("images/ui-anim_basic_16x16.gif") right center no-repeat; } </style> - <script> - $(function() { + <script src="../../external/requirejs/require.js"></script> + <script src="../bootstrap.js"> function log( message ) { $( "<div/>" ).text( message ).prependTo( "#log" ); $( "#log" ).attr( "scrollTop", 0 ); @@ -45,7 +39,6 @@ }); } }); - }); </script> </head> <body> |