]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete demos: Coding standards.
authorScott González <scott.gonzalez@gmail.com>
Fri, 10 Sep 2010 02:24:52 +0000 (22:24 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 10 Sep 2010 02:33:28 +0000 (22:33 -0400)
13 files changed:
demos/autocomplete/categories.html
demos/autocomplete/combobox.html
demos/autocomplete/custom-data.html
demos/autocomplete/default.html
demos/autocomplete/folding.html
demos/autocomplete/index.html
demos/autocomplete/maxheight.html
demos/autocomplete/multiple-remote.html
demos/autocomplete/multiple.html
demos/autocomplete/remote-jsonp.html
demos/autocomplete/remote-with-cache.html
demos/autocomplete/remote.html
demos/autocomplete/xml.html

index bb59bf31e89280b66495fa70a48b3b520c059191..693886d6617c6ec2645cc7e167865005c46c06b8 100644 (file)
@@ -1,25 +1,25 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Autocomplete Custom Data Demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.ui.autocomplete.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
        .ui-autocomplete-category {
-               font-weight:bold;
-               padding:.2em .4em;
-               margin:.8em 0 .2em;
-               line-height:1.5;
+               font-weight: bold;
+               padding: .2em .4em;
+               margin: .8em 0 .2em;
+               line-height: 1.5;
        }
        </style>
-       <script type="text/javascript">
-       $.widget("custom.catcomplete", $.ui.autocomplete, {
+       <script>
+       $.widget( "custom.catcomplete", $.ui.autocomplete, {
                _renderMenu: function( ul, items ) {
                        var self = this,
                                currentCategory = "";
@@ -33,7 +33,7 @@
                }
        });
        </script>
-       <script type="text/javascript">
+       <script>
        $(function() {
                var data = [
                        { label: "anders", category: "" },
@@ -47,7 +47,7 @@
                        { label: "andreas johnson", category: "People" }
                ];
                
-               $('#search').catcomplete({
+               $( "#search" ).catcomplete({
                        delay: 0,
                        source: data
                });
        <input id="search" />
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-       A categorized search result. Try typing "a" or "n".
-</p>
+<p>A categorized search result. Try typing "a" or "n".</p>
 </div><!-- End demo-description -->
 
 </body>
index b5309888e811a59f217852a2ad710e222843a8e9..d78d12155473f9e5a09beb6eeaf12ab414f2f53b 100644 (file)
@@ -1,27 +1,27 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Combobox Demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
-               .ui-button { margin-left: -1px; }
-               .ui-button-icon-only .ui-button-text { padding: 0.35em; } 
-               .ui-autocomplete-input { margin: 0; padding: 0.48em 0 0.47em 0.45em; }
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.button.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.ui.autocomplete.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
+       .ui-button { margin-left: -1px; }
+       .ui-button-icon-only .ui-button-text { padding: 0.35em; } 
+       .ui-autocomplete-input { margin: 0; padding: 0.48em 0 0.47em 0.45em; }
        </style>
-       <script type="text/javascript">
+       <script>
        (function( $ ) {
                $.widget( "ui.combobox", {
                        _create: function() {
-                               var self = this;
-                               var select = this.element.hide(),
+                               var self = this,
+                                       select = this.element.hide(),
                                        selected = select.children( ":selected" ),
                                        value = selected.val() ? selected.text() : "";
                                var input = $( "<input>" )
                                        });
                        }
                });
-       })(jQuery);
+       })( jQuery );
 
        $(function() {
-               $("#combobox").combobox();
-               $("#toggle").click(function() {
-                       $("#combobox").toggle();
+               $( "#combobox" ).combobox();
+               $( "#toggle" ).click(function() {
+                       $( "#combobox" ).toggle();
                });
        });
        </script>
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-A custom widget built by composition of Autocomplete and Button. You can either type something into the field to get filtered suggestions based on your input, or use the button to get the full list of selections.
-</p>
-<p>
-The input is read from an existing select-element for progressive enhancement, passed to Autocomplete with a customized source-option.
-</p>
+<p>A custom widget built by composition of Autocomplete and Button. You can either type something into the field to get filtered suggestions based on your input, or use the button to get the full list of selections.</p>
+<p>The input is read from an existing select-element for progressive enhancement, passed to Autocomplete with a customized source-option.</p>
 </div><!-- End demo-description -->
 
 </body>
index b9de20576931d8539985582cb471451be605fb04..aa097fd589de6ab7ee10efa20dc705630c0e45ba 100644 (file)
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Custom Data Demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.ui.autocomplete.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
        #project-label {
                display: block;
                font-weight: bold;
                padding: 0;
        }
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
                var projects = [
                        {
-                               value: 'jquery',
-                               label: 'jQuery',
-                               desc: 'the write less, do more, JavaScript library',
-                               icon: 'jquery_32x32.png'
+                               value: "jquery",
+                               label: "jQuery",
+                               desc: "the write less, do more, JavaScript library",
+                               icon: "jquery_32x32.png"
                        },
                        {
-                               value: 'jquery-ui',
-                               label: 'jQuery UI',
-                               desc: 'the official user interface library for jQuery',
-                               icon: 'jqueryui_32x32.png'
+                               value: "jquery-ui",
+                               label: "jQuery UI",
+                               desc: "the official user interface library for jQuery",
+                               icon: "jqueryui_32x32.png"
                        },
                        {
-                               value: 'sizzlejs',
-                               label: 'Sizzle JS',
-                               desc: 'a pure-JavaScript CSS selector engine',
-                               icon: 'sizzlejs_32x32.png'
+                               value: "sizzlejs",
+                               label: "Sizzle JS",
+                               desc: "a pure-JavaScript CSS selector engine",
+                               icon: "sizzlejs_32x32.png"
                        }
                ];
-               
-               $('#project').autocomplete({
+
+               $( "#project" ).autocomplete({
                        minLength: 0,
                        source: projects,
-                       focus: function(event, ui) {
-                               $('#project').val(ui.item.label);
+                       focus: function( event, ui ) {
+                               $( "#project" ).val( ui.item.label );
                                return false;
                        },
-                       select: function(event, ui) {
-                               $('#project').val(ui.item.label);
-                               $('#project-id').val(ui.item.value);
-                               $('#project-description').html(ui.item.desc);
-                               $('#project-icon').attr('src', 'images/' + ui.item.icon);
-                               
+                       select: function( event, ui ) {
+                               $( "#project" ).val( ui.item.label );
+                               $( "#project-id" ).val( ui.item.value );
+                               $( "#project-description" ).html( ui.item.desc );
+                               $( "#project-icon" ).attr( "src", "images/" + ui.item.icon );
+
                                return false;
                        }
                })
        <p id="project-description"></p>
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-You can use your own custom data formats and displays by simply overriding the default focus and select actions.
-</p>
-<p>
-Try typing "j" to get a list of projects or just press the down arrow.
-</p>
+<p>You can use your own custom data formats and displays by simply overriding the default focus and select actions.</p>
+<p>Try typing "j" to get a list of projects or just press the down arrow.</p>
 </div><!-- End demo-description -->
 
 </body>
index 110263dac20d34d80b43cefed24581da96d07dcf..658d06fd2f49b02cfdd0b451858d4f8de33fa8b4 100644 (file)
@@ -1,19 +1,42 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Default Demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <script type="text/javascript">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.ui.autocomplete.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <script>
        $(function() {
-               var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
-               $("#tags").autocomplete({
+               var availableTags = [
+                       "ActionScript",
+                       "AppleScript",
+                       "Asp",
+                       "BASIC",
+                       "C",
+                       "C++",
+                       "Clojure",
+                       "COBOL",
+                       "ColdFusion",
+                       "Erlang",
+                       "Fortran",
+                       "Groovy",
+                       "Haskell",
+                       "Java",
+                       "JavaScript",
+                       "Lisp",
+                       "Perl",
+                       "PHP",
+                       "Python",
+                       "Ruby",
+                       "Scala",
+                       "Scheme"
+               ];
+               $( "#tags" ).autocomplete({
                        source: availableTags
                });
        });
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give "ja" (for Java or JavaScript) a try.
-</p>
-<p>
-The datasource is a simple JavaScript array, provided to the widget using the source-option.
-</p>
+<p>The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give "ja" (for Java or JavaScript) a try.</p>
+<p>The datasource is a simple JavaScript array, provided to the widget using the source-option.</p>
 </div><!-- End demo-description -->
 
 </body>
index d5bc71e9df7d2ab3fb47dec2df5163f384a06a57..8fd813ffd8d3d5a7be6fe17bd98e36106eb28e02 100644 (file)
@@ -1,25 +1,25 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Accent Folding Demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <script type="text/javascript">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.ui.autocomplete.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <script>
        $(function() {
                var names = [ "Jörn Zaefferer", "Scott González", "John Resig" ];
 
                var accentMap = {
-                       'á':'a',
-                       'ö':'o'
+                       "á": "a",
+                       "ö": "o"
                };
                var normalize = function( term ) {
-                       var ret = '';
+                       var ret = "";
                        for ( var i = 0; i < term.length; i++ ) {
                                ret += accentMap[ term.charAt(i) ] || term.charAt(i);
                        }
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-The autocomplete field uses a custom source option which will match results that have accented characters even when the text field doesn't contain accented characters. However if the you type in accented characters in the text field it is smart enough not to show results that aren't accented.
-</p>
-<p>
-Try typing "Jo" to see "John" and "Jörn", then type "Jö" to see only "Jörn".
-</p>
+<p>The autocomplete field uses a custom source option which will match results that have accented characters even when the text field doesn't contain accented characters. However if the you type in accented characters in the text field it is smart enough not to show results that aren't accented.</p>
+<p>Try typing "Jo" to see "John" and "Jörn", then type "Jö" to see only "Jörn".</p>
 </div><!-- End demo-description -->
 
 </body>
index 9d5ba3a87cfd88a9c94effc862cc2a75646e5e5b..d97c817fbdec75197de7bc3a3c5b0beb2149907d 100644 (file)
@@ -1,9 +1,9 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Demos</title>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
+       <link rel="stylesheet" href="../demos.css">
 </head>
 <body>
        <div class="demos-nav">
index 97de724bac0bd55e88aa7eddd4040803260e934e..955fed8978f5c5b0151115ab330fc606829145b8 100644 (file)
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Scrollable Results Demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.ui.autocomplete.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <style>
        .ui-autocomplete {
                max-height: 100px;
                overflow-y: auto;
                height: 100px;
        }
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
-               $("#tags").autocomplete({
+               var availableTags = [
+                       "ActionScript",
+                       "AppleScript",
+                       "Asp",
+                       "BASIC",
+                       "C",
+                       "C++",
+                       "Clojure",
+                       "COBOL",
+                       "ColdFusion",
+                       "Erlang",
+                       "Fortran",
+                       "Groovy",
+                       "Haskell",
+                       "Java",
+                       "JavaScript",
+                       "Lisp",
+                       "Perl",
+                       "PHP",
+                       "Python",
+                       "Ruby",
+                       "Scala",
+                       "Scheme"
+               ];
+               $( "#tags" ).autocomplete({
                        source: availableTags
                });
        });
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-When displaying a long list of options, you can simply set the max-height for the autocomplete menu to prevent the menu from growing too large. Try typing "a" or "s" above to get a long list of results that you can scroll through.
-</p>
+<p>When displaying a long list of options, you can simply set the max-height for the autocomplete menu to prevent the menu from growing too large. Try typing "a" or "s" above to get a long list of results that you can scroll through.</p>
 </div><!-- End demo-description -->
 
 </body>
index 0f77e795df0cb37d89aba639881626bba8311eff..b0313e1d0763221df442bf0b441c1b26e0bf01a9 100644 (file)
@@ -1,37 +1,37 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8">
        <title>jQuery UI Autocomplete multiple demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.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 type="text/javascript">
+       <script>
        $(function() {
-               function split(val) {
-                       return val.split(/,\s*/);
+               function split( val ) {
+                       return val.split( /,\s*/ );
                }
-               function extractLast(term) {
-                       return split(term).pop();
+               function extractLast( term ) {
+                       return split( term ).pop();
                }
-               
-               $("#birds").autocomplete({
-                       source: function(request, response) {
-                               $.getJSON("search.php", {
-                                       term: extractLast(request.term)
-                               }, response);
+
+               $( "#birds" ).autocomplete({
+                       source: function( request, response ) {
+                               $.getJSON( "search.php", {
+                                       term: extractLast( request.term )
+                               }, response );
                        },
                        search: function() {
                                // custom minLength
-                               var term = extractLast(this.value);
-                               if (term.length < 2) {
+                               var term = extractLast( this.value );
+                               if ( term.length < 2 ) {
                                        return false;
                                }
                        },
                                // prevent value inserted on focus
                                return false;
                        },
-                       select: function(event, ui) {
+                       select: function( event, ui ) {
                                var terms = split( this.value );
                                // remove the current input
                                terms.pop();
                                // add the selected item
                                terms.push( ui.item.value );
                                // add placeholder to get the comma-and-space at the end
-                               terms.push("");
-                               this.value = terms.join(", ");
+                               terms.push( "" );
+                               this.value = terms.join( ", " );
                                return false;
                        }
                });
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-Usage: Enter at least two characters to get bird name suggestions. Select a value to continue adding more names.
-</p>
-<p>
-This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.
-</p>
+<p>Usage: Enter at least two characters to get bird name suggestions. Select a value to continue adding more names.</p>
+<p>This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.</p>
 </div><!-- End demo-description -->
 
 </body>
index 1f9243bf28c2e793b564e83fed67444d08aba171..d14fac375b3968f4da8a91cfbae108f3709d4d94 100644 (file)
@@ -1,44 +1,68 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete multiple demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <script type="text/javascript">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.ui.autocomplete.js"></script>
+       <link rel="stylesheet" href="../demos.css">
+       <script>
        $(function() {
-               var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
-               function split(val) {
-                       return val.split(/,\s*/);
+               var availableTags = [
+                       "ActionScript",
+                       "AppleScript",
+                       "Asp",
+                       "BASIC",
+                       "C",
+                       "C++",
+                       "Clojure",
+                       "COBOL",
+                       "ColdFusion",
+                       "Erlang",
+                       "Fortran",
+                       "Groovy",
+                       "Haskell",
+                       "Java",
+                       "JavaScript",
+                       "Lisp",
+                       "Perl",
+                       "PHP",
+                       "Python",
+                       "Ruby",
+                       "Scala",
+                       "Scheme"
+               ];
+               function split( val ) {
+                       return val.split( /,\s*/ );
                }
-               function extractLast(term) {
-                       return split(term).pop();
+               function extractLast( term ) {
+                       return split( term ).pop();
                }
-               
-               $("#tags").autocomplete({
+
+               $( "#tags" ).autocomplete({
                        minLength: 0,
-                       source: function(request, response) {
+                       source: function( request, response ) {
                                // delegate back to autocomplete, but extract the last term
-                               response($.ui.autocomplete.filter(availableTags, extractLast(request.term)));
+                               response( $.ui.autocomplete.filter(
+                                       availableTags, extractLast( request.term ) ) );
                        },
                        focus: function() {
                                // prevent value inserted on focus
                                return false;
                        },
-                       select: function(event, ui) {
+                       select: function( event, ui ) {
                                var terms = split( this.value );
                                // remove the current input
                                terms.pop();
                                // add the selected item
                                terms.push( ui.item.value );
                                // add placeholder to get the comma-and-space at the end
-                               terms.push("");
-                               this.value = terms.join(", ");
+                               terms.push( "" );
+                               this.value = terms.join( ", " );
                                return false;
                        }
                });
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-Usage: Type something, eg. "j" to see suggestions for tagging with programming languages. Select a value, then continue typing to add more.
-</p>
-<p>
-This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.
-</p>
+<p>Usage: Type something, eg. "j" to see suggestions for tagging with programming languages. Select a value, then continue typing to add more.</p>
+<p>This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field.</p>
 </div><!-- End demo-description -->
 
 </body>
index 127298e3648a76f03e9e4fab0364ab058a723e1d..738bee5223d08f9b92c89bf7a70f440c6a8dc5f8 100644 (file)
@@ -1,27 +1,28 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Remote JSONP datasource demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.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; }
+       #city { width: 25em; }
        </style>
-       <script type="text/javascript">
+       <script>
        $(function() {
-               function log(message) {
-                       $("<div/>").text(message).prependTo("#log");
-                       $("#log").attr("scrollTop", 0);
+               function log( message ) {
+                       $( "<div/>" ).text( message ).prependTo( "#log" );
+                       $( "#log" ).attr( "scrollTop", 0 );
                }
-               
-               $("#city").autocomplete({
-                       source: function(request, response) {
+
+               $( "#city" ).autocomplete({
+                       source: function( request, response ) {
                                $.ajax({
                                        url: "http://ws.geonames.org/searchJSON",
                                        dataType: "jsonp",
                                                maxRows: 12,
                                                name_startsWith: request.term
                                        },
-                                       success: function(data) {
-                                               response($.map(data.geonames, function(item) {
+                                       success: function( data ) {
+                                               response( $.map( data.geonames, function( item ) {
                                                        return {
                                                                label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
                                                                value: item.name
                                                        }
-                                               }))
+                                               }));
                                        }
-                               })
+                               });
                        },
                        minLength: 2,
-                       select: function(event, ui) {
-                               log(ui.item ? ("Selected: " + ui.item.label) : "Nothing selected, input was " + this.value);
+                       select: function( event, ui ) {
+                               log( ui.item ?
+                                       "Selected: " + ui.item.label :
+                                       "Nothing selected, input was " + this.value);
                        },
                        open: function() {
-                               $(this).removeClass("ui-corner-all").addClass("ui-corner-top");
+                               $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
                        },
                        close: function() {
-                               $(this).removeClass("ui-corner-top").addClass("ui-corner-all");
+                               $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
                        }
                });
        });
        </script>
-       <style>
-               .ui-autocomplete-loading { background: url(indicator.gif) no-repeat right; }
-               #city { width: 25em; }
-       </style>
 </head>
 <body>
 
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are cities, displayed when at least two characters are entered into the field.
-</p>
-<p>
-In this case, the datasource is the <a href="http://geonames.org">geonames.org webservice</a>. While only the city name itself ends up in the input after selecting an element, more info is displayed in the suggestions to help find the right entry. That data is also available in callbacks, as illustrated by the Result area below the input. 
-</p>
+<p>The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are cities, displayed when at least two characters are entered into the field.</p>
+<p>In this case, the datasource is the <a href="http://geonames.org">geonames.org webservice</a>. While only the city name itself ends up in the input after selecting an element, more info is displayed in the suggestions to help find the right entry. That data is also available in callbacks, as illustrated by the Result area below the input.</p>
 </div><!-- End demo-description -->
 
 </body>
index 77741fbe916c1c93e09eec32a3839b5473960a2b..09eb6c0d3ddb155eeacce449fe73c3aec704eaf3 100644 (file)
@@ -1,25 +1,25 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Remote with caching demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.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 type="text/javascript">
+       <script>
        $(function() {
                var cache = {},
                        lastXhr;
                $( "#birds" ).autocomplete({
                        minLength: 2,
-                       source: function(request, response) {
+                       source: function( request, response ) {
                                var term = request.term;
                                if ( term in cache ) {
                                        response( cache[ term ] );
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are bird names, displayed when at least two characters are entered into the field.
-</p>
-<p>
-Similar to the remote datasource demo, though this adds some local caching to improve performance. The cache here saves just one query, and could be extended to cache multiple values, one for each term.
-</p>
+<p>The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are bird names, displayed when at least two characters are entered into the field.</p>
+<p>Similar to the remote datasource demo, though this adds some local caching to improve performance. The cache here saves just one query, and could be extended to cache multiple values, one for each term.</p>
 </div><!-- End demo-description -->
 
 </body>
index 2dd0eb7330729306004e260474b7aa054868eb13..6c924fe91293b779da23efa820e69757ff351b7f 100644 (file)
@@ -1,30 +1,32 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Remote datasource demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.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 type="text/javascript">
+       <script>
        $(function() {
-               function log(message) {
-                       $("<div/>").text(message).prependTo("#log");
-                       $("#log").attr("scrollTop", 0);
+               function log( message ) {
+                       $( "<div/>" ).text( message ).prependTo( "#log" );
+                       $( "#log" ).attr( "scrollTop", 0 );
                }
-               
-               $("#birds").autocomplete({
+
+               $( "#birds" ).autocomplete({
                        source: "search.php",
                        minLength: 2,
-                       select: function(event, ui) {
-                               log(ui.item ? ("Selected: " + ui.item.value + " aka " + ui.item.id) : "Nothing selected, input was " + this.value);
+                       select: function( event, ui ) {
+                               log( ui.item ?
+                                       "Selected: " + ui.item.value + " aka " + ui.item.id :
+                                       "Nothing selected, input was " + this.value );
                        }
                });
        });
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are bird names, displayed when at least two characters are entered into the field.
-</p>
-<p>
-The datasource is a server-side script which returns JSON data, specified via a simple URL for the source-option. In addition, the minLength-option is set to 2 to avoid queries that would return too many results and the select-event is used to display some feedback.
-</p>
+<p>The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are bird names, displayed when at least two characters are entered into the field.</p>
+<p>The datasource is a server-side script which returns JSON data, specified via a simple URL for the source-option. In addition, the minLength-option is set to 2 to avoid queries that would return too many results and the select-event is used to display some feedback.</p>
 </div><!-- End demo-description -->
 
 </body>
index c00868cac2f1a8a6b159755502ea4c3071503e7c..5ed68b70b2f774ac26a2b77ba48b74080a11d430 100644 (file)
@@ -1,45 +1,47 @@
 <!DOCTYPE html>
 <html lang="en">
 <head>
-       <meta charset="UTF-8" />
+       <meta charset="utf-8" />
        <title>jQuery UI Autocomplete Remote datasource demo</title>
-       <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
-       <script type="text/javascript" src="../../jquery-1.4.2.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
-       <script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
-       <link type="text/css" href="../demos.css" rel="stylesheet" />
-       <style type="text/css">
+       <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
+       <script src="../../jquery-1.4.2.js"></script>
+       <script src="../../ui/jquery.ui.core.js"></script>
+       <script src="../../ui/jquery.ui.widget.js"></script>
+       <script src="../../ui/jquery.ui.position.js"></script>
+       <script src="../../ui/jquery.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 type="text/javascript">
+       <script>
        $(function() {
-               function log(message) {
-                       $("<div/>").text(message).prependTo("#log");
-                       $("#log").attr("scrollTop", 0);
+               function log( message ) {
+                       $( "<div/>" ).text( message ).prependTo( "#log" );
+                       $( "#log" ).attr( "scrollTop", 0 );
                }
-               
+
                $.ajax({
                        url: "london.xml",
                        dataType: "xml",
-                       success: function(xmlResponse) {
-                               var data = $("geoname", xmlResponse).map(function() {
+                       success: function( xmlResponse ) {
+                               var data = $( "geoname", xmlResponse ).map(function() {
                                        return {
-                                               value: $("name", this).text() + ", " + ($.trim($("countryName", this).text()) || "(unknown country)"),
-                                               id: $("geonameId", this).text()
+                                               value: $( "name", this ).text() + ", " +
+                                                       ( $.trim( $( "countryName", this ).text() ) || "(unknown country)" ),
+                                               id: $( "geonameId", this ).text()
                                        };
                                }).get();
-                               $("#birds").autocomplete({
+                               $( "#birds" ).autocomplete({
                                        source: data,
                                        minLength: 0,
-                                       select: function(event, ui) {
-                                               log(ui.item ? ("Selected: " + ui.item.value + ", geonameId: " + ui.item.id) : "Nothing selected, input was " + this.value);
+                                       select: function( event, ui ) {
+                                               log( ui.item ?
+                                                       "Selected: " + ui.item.value + ", geonameId: " + ui.item.id :
+                                                       "Nothing selected, input was " + this.value );
                                        }
                                });
                        }
-               })
-               
+               });
        });
        </script>
 </head>
 
 </div><!-- End demo -->
 
+
+
 <div class="demo-description">
-<p>
-This demo shows how to retrieve some XML data, parse it using jQuery's methods, then provide it to the autocomplete as the datasource.
-</p>
-<p>
-This should also serve as a reference on how to parse a remote XML datasource - the parsing would just happen for each request within the source-callback.
-</p>
+<p>This demo shows how to retrieve some XML data, parse it using jQuery's methods, then provide it to the autocomplete as the datasource.</p>
+<p>This should also serve as a reference on how to parse a remote XML datasource - the parsing would just happen for each request within the source-callback.</p>
 </div><!-- End demo-description -->
 
 </body>