diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2008-10-05 00:57:59 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2008-10-05 00:57:59 +0000 |
commit | 2bfbe85ba0a71792f8d96bae6ac165d9947d8757 (patch) | |
tree | 036426fef5bb53b02b14f42454e145ee5b26bf08 | |
parent | 37f65f194770d8471119eee5c2a7acfd09178f64 (diff) | |
download | jquery-ui-2bfbe85ba0a71792f8d96bae6ac165d9947d8757.tar.gz jquery-ui-2bfbe85ba0a71792f8d96bae6ac165d9947d8757.zip |
Moving autocomplete from trunk to 1.7 branch
102 files changed, 1 insertions, 1291 deletions
diff --git a/demos/functional/index.html b/demos/functional/index.html index df5ee60c8..cf6cb9879 100644 --- a/demos/functional/index.html +++ b/demos/functional/index.html @@ -23,7 +23,6 @@ <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.autocomplete.js"></script> <script type="text/javascript" src="../../ui/ui.colorpicker.js"></script> <script type="text/javascript" src="../../ui/ui.datepicker.js"></script> <script type="text/javascript" src="../../ui/i18n/ui.datepicker-ar.js"></script> @@ -219,7 +218,6 @@ <ul class="component-links"> <li><a href="#ui.accordion" title="Goto Accordion's Component Page">Accordion</a></li> - <li><a href="#ui.autocomplete" title="Goto Accordion's Component Page">Autocomplete</a></li> <li><a href="#ui.colorpicker" title="Goto Colorpicker's Component Page">Colorpicker</a></li> <li><a href="#ui.datepicker" title="Goto Datepicker's Component Page">Datepicker</a></li> <li><a href="#ui.dialog" title="Goto Dialog's Component Page">Dialog</a></li> diff --git a/demos/functional/templates/ui.autocomplete.html b/demos/functional/templates/ui.autocomplete.html deleted file mode 100644 index 646dd3784..000000000 --- a/demos/functional/templates/ui.autocomplete.html +++ /dev/null @@ -1,32 +0,0 @@ -<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/tests/all.html b/tests/all.html index 0c64e8c6d..1ba75cd0c 100644 --- a/tests/all.html +++ b/tests/all.html @@ -7,7 +7,6 @@ <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.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> @@ -24,7 +23,6 @@ <script type="text/javascript" src="simulate/jquery.simulate.js"></script> <script type="text/javascript" src="accordion.js"></script> - <script type="text/javascript" src="autocomplete.js"></script> <script type="text/javascript" src="datepicker.js"></script> <script type="text/javascript" src="dialog.js"></script> <script type="text/javascript" src="draggable.js"></script> @@ -49,7 +47,6 @@ <h4>Run individual testsuites or doubleclick a test below</h4> <ul> <li><a href="accordion.html">Accordion</a></li> - <li><a href="autocomplete.html">Autocomplete</a></li> <li><a href="datepicker.html">Datepicker</a></li> <li><a href="dialog.html">Dialog</a></li> <li><a href="draggable.html">Draggable</a></li> diff --git a/tests/all_2.html b/tests/all_2.html index 06ee40166..efaf4c706 100644 --- a/tests/all_2.html +++ b/tests/all_2.html @@ -8,7 +8,7 @@ <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"]; + var components = ["accordion","datepicker","dialog","draggable","progressbar","resizable","selectable","slider","sortable","spinner"]; $(document).ready(function(){ @@ -40,7 +40,6 @@ </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> diff --git a/tests/autocomplete.html b/tests/autocomplete.html deleted file mode 100644 index a21bea9d3..000000000 --- a/tests/autocomplete.html +++ /dev/null @@ -1,29 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - - <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.autocomplete.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="autocomplete.js"></script> - -</head> - -<body> -<h1>jQuery - Autocomplete Test Suite</h1> -<div id="main" style="display: none"> - - <input type="text" name="autocomplete" value="" id="autocomplete"> - -</div> - -<ol id="tests"></ol> -</body> - -</html> diff --git a/tests/autocomplete.js b/tests/autocomplete.js deleted file mode 100644 index ae75a9617..000000000 --- a/tests/autocomplete.js +++ /dev/null @@ -1,51 +0,0 @@ -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/visual/autocomplete/bg.gif b/tests/visual/autocomplete/bg.gif Binary files differdeleted file mode 100644 index 846add071..000000000 --- a/tests/visual/autocomplete/bg.gif +++ /dev/null diff --git a/tests/visual/autocomplete/images/Amsterdam Van-Gogh Museum.jpg b/tests/visual/autocomplete/images/Amsterdam Van-Gogh Museum.jpg Binary files differdeleted file mode 100644 index 025328c7d..000000000 --- a/tests/visual/autocomplete/images/Amsterdam Van-Gogh Museum.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Amsterdam.jpg b/tests/visual/autocomplete/images/Amsterdam.jpg Binary files differdeleted file mode 100644 index 5f019bdfd..000000000 --- a/tests/visual/autocomplete/images/Amsterdam.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Antwerpen Rubenshaus.jpg b/tests/visual/autocomplete/images/Antwerpen Rubenshaus.jpg Binary files differdeleted file mode 100644 index 7f5d01f71..000000000 --- a/tests/visual/autocomplete/images/Antwerpen Rubenshaus.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Antwerpen.jpg b/tests/visual/autocomplete/images/Antwerpen.jpg Binary files differdeleted file mode 100644 index 46f74a3d1..000000000 --- a/tests/visual/autocomplete/images/Antwerpen.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Appenzell.jpg b/tests/visual/autocomplete/images/Appenzell.jpg Binary files differdeleted file mode 100644 index 1691ed954..000000000 --- a/tests/visual/autocomplete/images/Appenzell.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Arnhem Historisches Museum.jpg b/tests/visual/autocomplete/images/Arnhem Historisches Museum.jpg Binary files differdeleted file mode 100644 index 276f88a31..000000000 --- a/tests/visual/autocomplete/images/Arnhem Historisches Museum.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Bled.jpg b/tests/visual/autocomplete/images/Bled.jpg Binary files differdeleted file mode 100644 index bdcae3184..000000000 --- a/tests/visual/autocomplete/images/Bled.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Bled_Die Burg von Bled.jpg b/tests/visual/autocomplete/images/Bled_Die Burg von Bled.jpg Binary files differdeleted file mode 100644 index 355108409..000000000 --- a/tests/visual/autocomplete/images/Bled_Die Burg von Bled.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Bogojina_Die Pfarrkirche.jpg b/tests/visual/autocomplete/images/Bogojina_Die Pfarrkirche.jpg Binary files differdeleted file mode 100644 index 3e0cd5099..000000000 --- a/tests/visual/autocomplete/images/Bogojina_Die Pfarrkirche.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/BolognaBasilicadiSanPetronio.jpg b/tests/visual/autocomplete/images/BolognaBasilicadiSanPetronio.jpg Binary files differdeleted file mode 100644 index ef2153593..000000000 --- a/tests/visual/autocomplete/images/BolognaBasilicadiSanPetronio.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/BolognaFontanadelNettuno.jpg b/tests/visual/autocomplete/images/BolognaFontanadelNettuno.jpg Binary files differdeleted file mode 100644 index 0f5b576d5..000000000 --- a/tests/visual/autocomplete/images/BolognaFontanadelNettuno.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/BolognaPiazzaMaggiore.jpg b/tests/visual/autocomplete/images/BolognaPiazzaMaggiore.jpg Binary files differdeleted file mode 100644 index 48449cf1e..000000000 --- a/tests/visual/autocomplete/images/BolognaPiazzaMaggiore.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Bolsward Martinikerk.jpg b/tests/visual/autocomplete/images/Bolsward Martinikerk.jpg Binary files differdeleted file mode 100644 index 6df035af4..000000000 --- a/tests/visual/autocomplete/images/Bolsward Martinikerk.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Bolsward Stadhuis.jpg b/tests/visual/autocomplete/images/Bolsward Stadhuis.jpg Binary files differdeleted file mode 100644 index 7c141012d..000000000 --- a/tests/visual/autocomplete/images/Bolsward Stadhuis.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Bolsward.jpg b/tests/visual/autocomplete/images/Bolsward.jpg Binary files differdeleted file mode 100644 index 84dd775af..000000000 --- a/tests/visual/autocomplete/images/Bolsward.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/BordeauxND.jpg b/tests/visual/autocomplete/images/BordeauxND.jpg Binary files differdeleted file mode 100644 index 242ecefc3..000000000 --- a/tests/visual/autocomplete/images/BordeauxND.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/BordeauxPlaceB.jpg b/tests/visual/autocomplete/images/BordeauxPlaceB.jpg Binary files differdeleted file mode 100644 index 026b4014d..000000000 --- a/tests/visual/autocomplete/images/BordeauxPlaceB.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/BotanischerGartenZuerich.jpg b/tests/visual/autocomplete/images/BotanischerGartenZuerich.jpg Binary files differdeleted file mode 100644 index 5ee9535ef..000000000 --- a/tests/visual/autocomplete/images/BotanischerGartenZuerich.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Bouillon.jpg b/tests/visual/autocomplete/images/Bouillon.jpg Binary files differdeleted file mode 100644 index 72638cfd8..000000000 --- a/tests/visual/autocomplete/images/Bouillon.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Gent Hotel de Ville2.jpg b/tests/visual/autocomplete/images/Gent Hotel de Ville2.jpg Binary files differdeleted file mode 100644 index 9084f6f47..000000000 --- a/tests/visual/autocomplete/images/Gent Hotel de Ville2.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Gent.jpg b/tests/visual/autocomplete/images/Gent.jpg Binary files differdeleted file mode 100644 index ebbd6df49..000000000 --- a/tests/visual/autocomplete/images/Gent.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/GenuaStrand.jpg b/tests/visual/autocomplete/images/GenuaStrand.jpg Binary files differdeleted file mode 100644 index d52af3c79..000000000 --- a/tests/visual/autocomplete/images/GenuaStrand.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/GenuabeiNacht.jpg b/tests/visual/autocomplete/images/GenuabeiNacht.jpg Binary files differdeleted file mode 100644 index f2a371036..000000000 --- a/tests/visual/autocomplete/images/GenuabeiNacht.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Giessbachfaelle Brienz.jpg b/tests/visual/autocomplete/images/Giessbachfaelle Brienz.jpg Binary files differdeleted file mode 100644 index 096319267..000000000 --- a/tests/visual/autocomplete/images/Giessbachfaelle Brienz.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Giethoorn.jpg b/tests/visual/autocomplete/images/Giethoorn.jpg Binary files differdeleted file mode 100644 index a6f7b0f4c..000000000 --- a/tests/visual/autocomplete/images/Giethoorn.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Gnesen.jpg b/tests/visual/autocomplete/images/Gnesen.jpg Binary files differdeleted file mode 100644 index e8825a846..000000000 --- a/tests/visual/autocomplete/images/Gnesen.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Gornij Grad_KATHEDRALE.jpg b/tests/visual/autocomplete/images/Gornij Grad_KATHEDRALE.jpg Binary files differdeleted file mode 100644 index 47cce10d3..000000000 --- a/tests/visual/autocomplete/images/Gornij Grad_KATHEDRALE.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Gossensass.jpg b/tests/visual/autocomplete/images/Gossensass.jpg Binary files differdeleted file mode 100644 index 6aba6d373..000000000 --- a/tests/visual/autocomplete/images/Gossensass.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Grad_Burg Grad2.jpg b/tests/visual/autocomplete/images/Grad_Burg Grad2.jpg Binary files differdeleted file mode 100644 index 5bf35ad85..000000000 --- a/tests/visual/autocomplete/images/Grad_Burg Grad2.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/GrandDixence.jpg b/tests/visual/autocomplete/images/GrandDixence.jpg Binary files differdeleted file mode 100644 index 09464d7ce..000000000 --- a/tests/visual/autocomplete/images/GrandDixence.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/GrenoblePanorama.jpg b/tests/visual/autocomplete/images/GrenoblePanorama.jpg Binary files differdeleted file mode 100644 index d4d0d1bb3..000000000 --- a/tests/visual/autocomplete/images/GrenoblePanorama.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Groningen.jpg b/tests/visual/autocomplete/images/Groningen.jpg Binary files differdeleted file mode 100644 index 0068a86f3..000000000 --- a/tests/visual/autocomplete/images/Groningen.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/GrottenvonReclere.jpg b/tests/visual/autocomplete/images/GrottenvonReclere.jpg Binary files differdeleted file mode 100644 index 74d6b3d3f..000000000 --- a/tests/visual/autocomplete/images/GrottenvonReclere.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Guebwiller.jpg b/tests/visual/autocomplete/images/Guebwiller.jpg Binary files differdeleted file mode 100644 index e31f924c4..000000000 --- a/tests/visual/autocomplete/images/Guebwiller.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Kamnik_Die Franziskaner Bibliothek.jpg b/tests/visual/autocomplete/images/Kamnik_Die Franziskaner Bibliothek.jpg Binary files differdeleted file mode 100644 index 1de470593..000000000 --- a/tests/visual/autocomplete/images/Kamnik_Die Franziskaner Bibliothek.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Karlsbad Muehlbrunnkolonnade.jpg b/tests/visual/autocomplete/images/Karlsbad Muehlbrunnkolonnade.jpg Binary files differdeleted file mode 100644 index 86caa2049..000000000 --- a/tests/visual/autocomplete/images/Karlsbad Muehlbrunnkolonnade.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Kazimierz.jpg b/tests/visual/autocomplete/images/Kazimierz.jpg Binary files differdeleted file mode 100644 index 62c265074..000000000 --- a/tests/visual/autocomplete/images/Kazimierz.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/KirchbergAltesRathaus1.jpg b/tests/visual/autocomplete/images/KirchbergAltesRathaus1.jpg Binary files differdeleted file mode 100644 index 6f4d018c4..000000000 --- a/tests/visual/autocomplete/images/KirchbergAltesRathaus1.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/KlagenfurtDom.jpg b/tests/visual/autocomplete/images/KlagenfurtDom.jpg Binary files differdeleted file mode 100644 index ac9faad2f..000000000 --- a/tests/visual/autocomplete/images/KlagenfurtDom.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/KleineMeerjungfreu.jpg b/tests/visual/autocomplete/images/KleineMeerjungfreu.jpg Binary files differdeleted file mode 100644 index b5b13c193..000000000 --- a/tests/visual/autocomplete/images/KleineMeerjungfreu.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/LazienkiparkWarschau.jpg b/tests/visual/autocomplete/images/LazienkiparkWarschau.jpg Binary files differdeleted file mode 100644 index c0b114483..000000000 --- a/tests/visual/autocomplete/images/LazienkiparkWarschau.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/LeHavreHafen.jpg b/tests/visual/autocomplete/images/LeHavreHafen.jpg Binary files differdeleted file mode 100644 index 9fc38d016..000000000 --- a/tests/visual/autocomplete/images/LeHavreHafen.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/LeMans.jpg b/tests/visual/autocomplete/images/LeMans.jpg Binary files differdeleted file mode 100644 index d919de7da..000000000 --- a/tests/visual/autocomplete/images/LeMans.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Lednice.jpg b/tests/visual/autocomplete/images/Lednice.jpg Binary files differdeleted file mode 100644 index 726248044..000000000 --- a/tests/visual/autocomplete/images/Lednice.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Leeuwarden Fries Museum.jpg b/tests/visual/autocomplete/images/Leeuwarden Fries Museum.jpg Binary files differdeleted file mode 100644 index 6d93e3478..000000000 --- a/tests/visual/autocomplete/images/Leeuwarden Fries Museum.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Leeuwarden.jpg b/tests/visual/autocomplete/images/Leeuwarden.jpg Binary files differdeleted file mode 100644 index c0f78c0cf..000000000 --- a/tests/visual/autocomplete/images/Leeuwarden.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Lelystad.jpg b/tests/visual/autocomplete/images/Lelystad.jpg Binary files differdeleted file mode 100644 index be794f3cd..000000000 --- a/tests/visual/autocomplete/images/Lelystad.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Lemmer.jpg b/tests/visual/autocomplete/images/Lemmer.jpg Binary files differdeleted file mode 100644 index 41d8996b2..000000000 --- a/tests/visual/autocomplete/images/Lemmer.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Leper Halles aux draps.jpg b/tests/visual/autocomplete/images/Leper Halles aux draps.jpg Binary files differdeleted file mode 100644 index cb3138d65..000000000 --- a/tests/visual/autocomplete/images/Leper Halles aux draps.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Leuven Museum fuer Kirchenkunst.jpg b/tests/visual/autocomplete/images/Leuven Museum fuer Kirchenkunst.jpg Binary files differdeleted file mode 100644 index 235869079..000000000 --- a/tests/visual/autocomplete/images/Leuven Museum fuer Kirchenkunst.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Leuven.jpg b/tests/visual/autocomplete/images/Leuven.jpg Binary files differdeleted file mode 100644 index 3e4d5f3b3..000000000 --- a/tests/visual/autocomplete/images/Leuven.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Luxemburg.jpg b/tests/visual/autocomplete/images/Luxemburg.jpg Binary files differdeleted file mode 100644 index 3aaafc9cb..000000000 --- a/tests/visual/autocomplete/images/Luxemburg.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/LuzernAltstadt.jpg b/tests/visual/autocomplete/images/LuzernAltstadt.jpg Binary files differdeleted file mode 100644 index 47ebd5d1e..000000000 --- a/tests/visual/autocomplete/images/LuzernAltstadt.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/LuzernPicassoMuseum.jpg b/tests/visual/autocomplete/images/LuzernPicassoMuseum.jpg Binary files differdeleted file mode 100644 index 08fbb5a0e..000000000 --- a/tests/visual/autocomplete/images/LuzernPicassoMuseum.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Lyon.jpg b/tests/visual/autocomplete/images/Lyon.jpg Binary files differdeleted file mode 100644 index 7a3eda9d0..000000000 --- a/tests/visual/autocomplete/images/Lyon.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Maastricht Onze Lieve Vrou...jpg b/tests/visual/autocomplete/images/Maastricht Onze Lieve Vrou...jpg Binary files differdeleted file mode 100644 index 1474bb092..000000000 --- a/tests/visual/autocomplete/images/Maastricht Onze Lieve Vrou...jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Maastricht St Servaasbasiliek.jpg b/tests/visual/autocomplete/images/Maastricht St Servaasbasiliek.jpg Binary files differdeleted file mode 100644 index c41e1aa17..000000000 --- a/tests/visual/autocomplete/images/Maastricht St Servaasbasiliek.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Maastricht Walmuur.jpg b/tests/visual/autocomplete/images/Maastricht Walmuur.jpg Binary files differdeleted file mode 100644 index 75fb02750..000000000 --- a/tests/visual/autocomplete/images/Maastricht Walmuur.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Maastricht.jpg b/tests/visual/autocomplete/images/Maastricht.jpg Binary files differdeleted file mode 100644 index 4dcb6d5d1..000000000 --- a/tests/visual/autocomplete/images/Maastricht.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/MagiatalMaggia.jpg b/tests/visual/autocomplete/images/MagiatalMaggia.jpg Binary files differdeleted file mode 100644 index 42ff384d9..000000000 --- a/tests/visual/autocomplete/images/MagiatalMaggia.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Mailand3.jpg b/tests/visual/autocomplete/images/Mailand3.jpg Binary files differdeleted file mode 100644 index 863e198f2..000000000 --- a/tests/visual/autocomplete/images/Mailand3.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Metlika_Bela Krajina Museum.jpg b/tests/visual/autocomplete/images/Metlika_Bela Krajina Museum.jpg Binary files differdeleted file mode 100644 index 47d24d70b..000000000 --- a/tests/visual/autocomplete/images/Metlika_Bela Krajina Museum.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/MilanoCastelloSforzesco.jpg b/tests/visual/autocomplete/images/MilanoCastelloSforzesco.jpg Binary files differdeleted file mode 100644 index b430de520..000000000 --- a/tests/visual/autocomplete/images/MilanoCastelloSforzesco.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/MilanoDom.jpg b/tests/visual/autocomplete/images/MilanoDom.jpg Binary files differdeleted file mode 100644 index 0a5eef4a4..000000000 --- a/tests/visual/autocomplete/images/MilanoDom.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/MilazzoBurg.jpg b/tests/visual/autocomplete/images/MilazzoBurg.jpg Binary files differdeleted file mode 100644 index 01226a323..000000000 --- a/tests/visual/autocomplete/images/MilazzoBurg.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Novo Mesto_Das Museum.jpg b/tests/visual/autocomplete/images/Novo Mesto_Das Museum.jpg Binary files differdeleted file mode 100644 index 452076124..000000000 --- a/tests/visual/autocomplete/images/Novo Mesto_Das Museum.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/ObervellachBurgFalkenstein.jpg b/tests/visual/autocomplete/images/ObervellachBurgFalkenstein.jpg Binary files differdeleted file mode 100644 index d502ff483..000000000 --- a/tests/visual/autocomplete/images/ObervellachBurgFalkenstein.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/OdenseeAndersen.jpg b/tests/visual/autocomplete/images/OdenseeAndersen.jpg Binary files differdeleted file mode 100644 index f131b7608..000000000 --- a/tests/visual/autocomplete/images/OdenseeAndersen.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Olimje_Kirche und Apotheke in Olimje.jpg b/tests/visual/autocomplete/images/Olimje_Kirche und Apotheke in Olimje.jpg Binary files differdeleted file mode 100644 index 16ea33fb3..000000000 --- a/tests/visual/autocomplete/images/Olimje_Kirche und Apotheke in Olimje.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Olomouc.jpg b/tests/visual/autocomplete/images/Olomouc.jpg Binary files differdeleted file mode 100644 index d9a7641f3..000000000 --- a/tests/visual/autocomplete/images/Olomouc.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/OlympischesMuseumLausanne.jpg b/tests/visual/autocomplete/images/OlympischesMuseumLausanne.jpg Binary files differdeleted file mode 100644 index 37a267ae5..000000000 --- a/tests/visual/autocomplete/images/OlympischesMuseumLausanne.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/OrleansMaisonJeannedArc.jpg b/tests/visual/autocomplete/images/OrleansMaisonJeannedArc.jpg Binary files differdeleted file mode 100644 index 220ad08fa..000000000 --- a/tests/visual/autocomplete/images/OrleansMaisonJeannedArc.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/OrleansParcFloraldelaSource.jpg b/tests/visual/autocomplete/images/OrleansParcFloraldelaSource.jpg Binary files differdeleted file mode 100644 index 171e56de8..000000000 --- a/tests/visual/autocomplete/images/OrleansParcFloraldelaSource.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/OstiaAntica.jpg b/tests/visual/autocomplete/images/OstiaAntica.jpg Binary files differdeleted file mode 100644 index b505ec7fd..000000000 --- a/tests/visual/autocomplete/images/OstiaAntica.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Ostrow Tumski.jpg b/tests/visual/autocomplete/images/Ostrow Tumski.jpg Binary files differdeleted file mode 100644 index 91cae01be..000000000 --- a/tests/visual/autocomplete/images/Ostrow Tumski.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/PoertschachSchlossLeonstain.jpg b/tests/visual/autocomplete/images/PoertschachSchlossLeonstain.jpg Binary files differdeleted file mode 100644 index 9e958b7df..000000000 --- a/tests/visual/autocomplete/images/PoertschachSchlossLeonstain.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Portoroz.jpg b/tests/visual/autocomplete/images/Portoroz.jpg Binary files differdeleted file mode 100644 index bbad5aa81..000000000 --- a/tests/visual/autocomplete/images/Portoroz.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Posen.jpg b/tests/visual/autocomplete/images/Posen.jpg Binary files differdeleted file mode 100644 index 791c46f2a..000000000 --- a/tests/visual/autocomplete/images/Posen.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Postojna.jpg b/tests/visual/autocomplete/images/Postojna.jpg Binary files differdeleted file mode 100644 index ec2a6be8f..000000000 --- a/tests/visual/autocomplete/images/Postojna.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Prag Altstaedter Ring.jpg b/tests/visual/autocomplete/images/Prag Altstaedter Ring.jpg Binary files differdeleted file mode 100644 index 9f13fd367..000000000 --- a/tests/visual/autocomplete/images/Prag Altstaedter Ring.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Prag Waldsteinpalais.jpg b/tests/visual/autocomplete/images/Prag Waldsteinpalais.jpg Binary files differdeleted file mode 100644 index 718b4e8d9..000000000 --- a/tests/visual/autocomplete/images/Prag Waldsteinpalais.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/RouenNotreDame.jpg b/tests/visual/autocomplete/images/RouenNotreDame.jpg Binary files differdeleted file mode 100644 index 4e0845342..000000000 --- a/tests/visual/autocomplete/images/RouenNotreDame.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/Salzbergwerk Bex.jpg b/tests/visual/autocomplete/images/Salzbergwerk Bex.jpg Binary files differdeleted file mode 100644 index 29bdfe029..000000000 --- a/tests/visual/autocomplete/images/Salzbergwerk Bex.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/SalzbergwerkWieliczka.jpg b/tests/visual/autocomplete/images/SalzbergwerkWieliczka.jpg Binary files differdeleted file mode 100644 index 745b18501..000000000 --- a/tests/visual/autocomplete/images/SalzbergwerkWieliczka.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/SalzburgFestungHohensalzburg.jpg b/tests/visual/autocomplete/images/SalzburgFestungHohensalzburg.jpg Binary files differdeleted file mode 100644 index c3e9f7428..000000000 --- a/tests/visual/autocomplete/images/SalzburgFestungHohensalzburg.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/SalzburgResidenz.jpg b/tests/visual/autocomplete/images/SalzburgResidenz.jpg Binary files differdeleted file mode 100644 index eca7e6022..000000000 --- a/tests/visual/autocomplete/images/SalzburgResidenz.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/WienMuseumsQuartier.jpg b/tests/visual/autocomplete/images/WienMuseumsQuartier.jpg Binary files differdeleted file mode 100644 index 4e2262cac..000000000 --- a/tests/visual/autocomplete/images/WienMuseumsQuartier.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/WienMusikverein.jpg b/tests/visual/autocomplete/images/WienMusikverein.jpg Binary files differdeleted file mode 100644 index 477bafceb..000000000 --- a/tests/visual/autocomplete/images/WienMusikverein.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/WienRiesenrad.jpg b/tests/visual/autocomplete/images/WienRiesenrad.jpg Binary files differdeleted file mode 100644 index 0013657e7..000000000 --- a/tests/visual/autocomplete/images/WienRiesenrad.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/images/WienRingstrasse.jpg b/tests/visual/autocomplete/images/WienRingstrasse.jpg Binary files differdeleted file mode 100644 index 9543af9b9..000000000 --- a/tests/visual/autocomplete/images/WienRingstrasse.jpg +++ /dev/null diff --git a/tests/visual/autocomplete/index.html b/tests/visual/autocomplete/index.html deleted file mode 100644 index b6012384f..000000000 --- a/tests/visual/autocomplete/index.html +++ /dev/null @@ -1,132 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - -<title>jQuery Autocomplete Plugin</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.autocomplete.js"></script> - -<script type='text/javascript' src='localdata.js'></script> -<link rel="stylesheet" type="text/css" href="main.css" /> -<link rel="stylesheet" href="../../../themes/default/ui.all.css" type="text/css" media="screen" title="no title" charset="utf-8"> - -<script type="text/javascript"> -$().ready(function() { - - function findValueCallback(event, data, formatted) { - $("<li>").html( !data ? "No match!" : "Selected: " + formatted).appendTo("#result"); - } - - function formatItem(row) { - return row[0] + " (<strong>id: " + row[1] + "</strong>)"; - } - function formatResult(row) { - return row[0].replace(/(<.+?>)/gi, ''); - } - - $("#suggest1").autocomplete({ data: cities }); - $("#month").autocomplete({ - data: months, - minChars: 0, - max: 12, - autoFill: true, - mustMatch: true, - matchContains: false, - scrollHeight: 220, - formatItem: function(data, i, total) { - // don't show the current month in the list of values (for whatever reason) - if ( data[0] == months[new Date().getMonth()] ) - return false; - return data[0]; - } - }); - $("#suggest13").autocomplete({ - data: emails, - minChars: 0, - width: 310, - matchContains: "word", - autoFill: false, - formatItem: function(row, i, max) { - return i + "/" + max + ": \"" + row.name + "\" [" + row.to + "]"; - }, - formatMatch: function(row, i, max) { - return row.name + " " + row.to; - }, - formatResult: function(row) { - return row.to; - } - }); - - $("#suggest3").autocomplete({ - data: cities, - multiple: true, - mustMatch: true, - autoFill: true - }); - - $("#tags").autocomplete(["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "pearl"], { - width: 320, - max: 4, - highlight: false, - multiple: true, - multipleSeparator: " ", - scroll: true, - scrollHeight: 300 - }); - - - - $("#clear").click(function() { - $(":input").unautocomplete(); - }); -}); - -</script> - -</head> - -<body> - -<div id="content"> - - <form autocomplete="off"> - <p> - <label>Single City (local):</label> - <input type="text" id="suggest1" /> - <input type="button" value="Get Value" /> - </p> - <p> - <label>Month (local):</label> - <input type="text" id="month" /> - <input type="button" value="Get Value" /> - (Current month is excluded from list) - </p> - <p> - <label>E-Mail (local):</label> - <input type="text" id="suggest13" /> - <input type="button" value="Get Value" /> - </p> - <p> - <label>Multiple Cities (local):</label> - <textarea id='suggest3' cols='40' rows='3'></textarea> - <input type="button" value="Get Value" /> - </p> - <p> - <label>Tags (local):</label> - <input type="text" id='tags' /> - <input type="button" value="Get Value" /> - </p> - - <input type="submit" value="Submit" /> - </form> - - - <button id="clear">Remove all autocompletes</button> - - <h3>Result:</h3> <ol id="result"></ol> - -</div> -</body> -</html> diff --git a/tests/visual/autocomplete/indicator.gif b/tests/visual/autocomplete/indicator.gif Binary files differdeleted file mode 100644 index 085ccaeca..000000000 --- a/tests/visual/autocomplete/indicator.gif +++ /dev/null diff --git a/tests/visual/autocomplete/localdata.js b/tests/visual/autocomplete/localdata.js deleted file mode 100644 index c1cade657..000000000 --- a/tests/visual/autocomplete/localdata.js +++ /dev/null @@ -1,216 +0,0 @@ -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/autocomplete/main.css b/tests/visual/autocomplete/main.css deleted file mode 100644 index b502a8a1a..000000000 --- a/tests/visual/autocomplete/main.css +++ /dev/null @@ -1,53 +0,0 @@ -body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0} -table{border-collapse:collapse;border-spacing:0} -fieldset,img{border:0} -address,caption,cite,code,dfn,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-style:normal;font-weight:normal} -q:before,q:after{content:''} -body{font:13px arial,helvetica,clean,sans-serif;font-size:small;} -select,input,textarea{font:99% arial,helvetica,clean,sans-serif} -pre,code{font:115% monospace;font-size:100%} -body * {line-height:1.22em} -body { - color: #202020; -} - -h1 { - color: #fff; - background: #06b; - padding: 10px; - font-size: 200%; -} - -h2 { - color: #000; - font-size: 150%; - padding: 10px 0; -} - -h3 { - color: #000; - font-size: 120%; - padding: 10px 0; -} - -ul { - list-style: disc inside; - margin-left: 1em; -} - -#content { - padding: 10px; -} - -label { - float: left; - width: 12em; -} -input[type=text] { width: 15em; }
-
-#banner { padding: 15px; background-color: #06b; color: white; font-size: large; border-bottom: 1px solid #ccc;
- background: url(bg.gif) repeat-x; text-align: center }
-#banner a { color: white; }
\ No newline at end of file diff --git a/ui/ui.autocomplete.js b/ui/ui.autocomplete.js deleted file mode 100644 index 52e5bbb40..000000000 --- a/ui/ui.autocomplete.js +++ /dev/null @@ -1,771 +0,0 @@ -/* - * jQuery UI Autocomplete @VERSION - * - * Copyright (c) 2007, 2008 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Autocomplete - * - * Depends: - * ui.core.js - */ -(function($) { - -$.widget("ui.autocomplete", { - - _init: function() { - - $.extend(this.options, { - delay: this.options.url ? $.Autocompleter.defaults.delay : 10, - max: !this.options.scroll ? 10 : 150, - highlight: this.options.highlight || function(value) { return value; }, // if highlight is set to false, replace it with a do-nothing function - formatMatch: this.options.formatMatch || this.options.formatItem // if the formatMatch option is not specified, then use formatItem for backwards compatibility - }); - - new $.Autocompleter(this.element[0], this.options); - - }, - - result: function(handler) { - return this.element.bind("result", handler); - }, - search: function(handler) { - return this.element.trigger("search", [handler]); - }, - flushCache: function() { - return this.element.trigger("flushCache"); - }, - setData: function(key, value){ - return this.element.trigger("setOptions", [{ key: value }]); - }, - destroy: function() { - return this.element.trigger("unautocomplete"); - } - -}); - -$.Autocompleter = function(input, options) { - - var KEY = { - UP: 38, - DOWN: 40, - DEL: 46, - TAB: 9, - RETURN: 13, - ESC: 27, - COMMA: 188, - PAGEUP: 33, - PAGEDOWN: 34, - BACKSPACE: 8 - }; - - // Create $ object for input element - var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); - if(options.result) $input.bind('result.autocomplete', options.result); - - var timeout; - var previousValue = ""; - var cache = $.Autocompleter.Cache(options); - var hasFocus = 0; - var lastKeyPressCode; - var config = { - mouseDownOnSelect: false - }; - var select = $.Autocompleter.Select(options, input, selectCurrent, config); - - var blockSubmit; - - // prevent form submit in opera when selecting with return key - $.browser.opera && $(input.form).bind("submit.autocomplete", function() { - if (blockSubmit) { - blockSubmit = false; - return false; - } - }); - - // only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all - $input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) { - // track last key pressed - lastKeyPressCode = event.keyCode; - switch(event.keyCode) { - - case KEY.UP: - event.preventDefault(); - if ( select.visible() ) { - select.prev(); - } else { - onChange(0, true); - } - break; - - case KEY.DOWN: - event.preventDefault(); - if ( select.visible() ) { - select.next(); - } else { - onChange(0, true); - } - break; - - case KEY.PAGEUP: - event.preventDefault(); - if ( select.visible() ) { - select.pageUp(); - } else { - onChange(0, true); - } - break; - - case KEY.PAGEDOWN: - event.preventDefault(); - if ( select.visible() ) { - select.pageDown(); - } else { - onChange(0, true); - } - break; - - // matches also semicolon - case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: - case KEY.TAB: - case KEY.RETURN: - if( selectCurrent() ) { - // stop default to prevent a form submit, Opera needs special handling - event.preventDefault(); - blockSubmit = true; - return false; - } - break; - - case KEY.ESC: - select.hide(); - break; - - default: - clearTimeout(timeout); - timeout = setTimeout(onChange, options.delay); - break; - } - }).focus(function(){ - // track whether the field has focus, we shouldn't process any - // results if the field no longer has focus - hasFocus++; - }).blur(function() { - hasFocus = 0; - if (!config.mouseDownOnSelect) { - hideResults(); - } - }).click(function() { - // show select when clicking in a focused field - if ( hasFocus++ > 1 && !select.visible() ) { - onChange(0, true); - } - }).bind("search", function() { - // TODO why not just specifying both arguments? - var fn = (arguments.length > 1) ? arguments[1] : null; - function findValueCallback(q, data) { - var result; - if( data && data.length ) { - for (var i=0; i < data.length; i++) { - if( data[i].result.toLowerCase() == q.toLowerCase() ) { - result = data[i]; - break; - } - } - } - if( typeof fn == "function" ) fn(result); - else $input.trigger("result", result && [result.data, result.value]); - } - $.each(trimWords($input.val()), function(i, value) { - request(value, findValueCallback, findValueCallback); - }); - }).bind("flushCache", function() { - cache.flush(); - }).bind("setOptions", function() { - $.extend(options, arguments[1]); - // if we've updated the data, repopulate - if ( "data" in arguments[1] ) - cache.populate(); - }).bind("unautocomplete", function() { - select.unbind(); - $input.unbind(); - $(input.form).unbind(".autocomplete"); - }); - - function selectCurrent() { - var selected = select.selected(); - if( !selected ) - return false; - - var v = selected.result; - previousValue = v; - - if ( options.multiple ) { - var words = trimWords($input.val()); - if ( words.length > 1 ) { - v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v; - } - v += options.multipleSeparator; - } - - $input.val(v); - hideResultsNow(); - $input.trigger("result", [selected.data, selected.value]); - return true; - } - - function onChange(crap, skipPrevCheck) { - if( lastKeyPressCode == KEY.DEL ) { - select.hide(); - return; - } - - var currentValue = $input.val(); - - if ( !skipPrevCheck && currentValue == previousValue ) - return; - - previousValue = currentValue; - - currentValue = lastWord(currentValue); - if ( currentValue.length >= options.minChars) { - $input.addClass(options.loadingClass); - if (!options.matchCase) - currentValue = currentValue.toLowerCase(); - request(currentValue, receiveData, hideResultsNow); - } else { - stopLoading(); - select.hide(); - } - }; - - function trimWords(value) { - if ( !value ) { - return [""]; - } - var words = value.split( options.multipleSeparator ); - var result = []; - $.each(words, function(i, value) { - if ( $.trim(value) ) - result[i] = $.trim(value); - }); - return result; - } - - function lastWord(value) { - if ( !options.multiple ) - return value; - var words = trimWords(value); - return words[words.length - 1]; - } - - // fills in the input box w/the first match (assumed to be the best match) - // q: the term entered - // sValue: the first matching result - function autoFill(q, sValue){ - // autofill in the complete box w/the first match as long as the user hasn't entered in more data - // if the last user key pressed was backspace, don't autofill - if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) { - // fill in the value (keep the case the user has typed) - $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); - // select the portion of the value not typed by the user (so the next character will erase) - $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length); - } - }; - - function hideResults() { - clearTimeout(timeout); - timeout = setTimeout(hideResultsNow, 200); - }; - - function hideResultsNow() { - var wasVisible = select.visible(); - select.hide(); - clearTimeout(timeout); - stopLoading(); - if (options.mustMatch) { - // call search and run callback - $input.autocomplete("search", function (result){ - // if no value found, clear the input box - if( !result ) { - if (options.multiple) { - var words = trimWords($input.val()).slice(0, -1); - $input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") ); - } - else - $input.val( "" ); - } - } - ); - } - if (wasVisible) - // position cursor at end of input field - $.Autocompleter.Selection(input, input.value.length, input.value.length); - }; - - function receiveData(q, data) { - if ( data && data.length && hasFocus ) { - stopLoading(); - select.display(data, q); - autoFill(q, data[0].value); - select.show(); - } else { - hideResultsNow(); - } - }; - - function request(term, success, failure) { - if (!options.matchCase) - term = term.toLowerCase(); - var data = cache.load(term); - // recieve the cached data - if (data && data.length) { - success(term, data); - // if an AJAX url has been supplied, try loading the data now - - } else if( (typeof options.url == "string") && (options.url.length > 0) ){ - - var extraParams = { - timestamp: +new Date() - }; - $.each(options.extraParams, function(key, param) { - extraParams[key] = typeof param == "function" ? param() : param; - }); - - $.ajax({ - // try to leverage ajaxQueue plugin to abort previous requests - mode: "abort", - // limit abortion to this input - port: "autocomplete" + input.name, - dataType: options.dataType, - url: options.url, - data: $.extend({ - q: lastWord(term), - limit: options.max - }, extraParams), - success: function(data) { - var parsed = options.parse && options.parse(data) || parse(data); - cache.add(term, parsed); - success(term, parsed); - } - }); - } - - else if (options.source && typeof options.source == 'function') { - var resultData = options.source(term); - var parsed = (options.parse) ? options.parse(resultData) : resultData; - - cache.add(term, parsed); - success(term, parsed); - } else { - // if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match - select.emptyList(); - failure(term); - } - }; - - function parse(data) { - var parsed = []; - var rows = data.split("\n"); - for (var i=0; i < rows.length; i++) { - var row = $.trim(rows[i]); - if (row) { - row = row.split("|"); - parsed[parsed.length] = { - data: row, - value: row[0], - result: options.formatResult && options.formatResult(row, row[0]) || row[0] - }; - } - } - return parsed; - }; - - function stopLoading() { - $input.removeClass(options.loadingClass); - }; - -}; - -$.Autocompleter.defaults = { - inputClass: "ui-autocomplete-input", - resultsClass: "ui-autocomplete-results", - loadingClass: "ui-autocomplete-loading", - minChars: 1, - delay: 400, - matchCase: false, - matchSubset: true, - matchContains: false, - cacheLength: 10, - max: 100, - mustMatch: false, - extraParams: {}, - selectFirst: true, - formatItem: function(row) { return row[0]; }, - formatMatch: null, - autoFill: false, - width: 0, - multiple: false, - multipleSeparator: ", ", - highlight: function(value, term) { - return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"); - }, - scroll: true, - scrollHeight: 180 -}; - -$.extend($.ui.autocomplete, { - defaults: $.Autocompleter.defaults -}); - -$.Autocompleter.Cache = function(options) { - - var data = {}; - var length = 0; - - function matchSubset(s, sub) { - if (!options.matchCase) - s = s.toLowerCase(); - var i = s.indexOf(sub); - if (i == -1) return false; - return i == 0 || options.matchContains; - }; - - function add(q, value) { - if (length > options.cacheLength){ - flush(); - } - if (!data[q]){ - length++; - } - data[q] = value; - } - - function populate(){ - if( !options.data ) return false; - // track the matches - var stMatchSets = {}, - nullData = 0; - - // no url was specified, we need to adjust the cache length to make sure it fits the local data store - if( !options.url ) options.cacheLength = 1; - - // track all options for minChars = 0 - stMatchSets[""] = []; - - // loop through the array and create a lookup structure - for ( var i = 0, ol = options.data.length; i < ol; i++ ) { - var rawValue = options.data[i]; - // if rawValue is a string, make an array otherwise just reference the array - rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; - - var value = options.formatMatch(rawValue, i+1, options.data.length); - if ( value === false ) - continue; - - var firstChar = value.charAt(0).toLowerCase(); - // if no lookup array for this character exists, look it up now - if( !stMatchSets[firstChar] ) - stMatchSets[firstChar] = []; - - // if the match is a string - var row = { - value: value, - data: rawValue, - result: options.formatResult && options.formatResult(rawValue) || value - }; - - // push the current match into the set list - stMatchSets[firstChar].push(row); - - // keep track of minChars zero items - if ( nullData++ < options.max ) { - stMatchSets[""].push(row); - } - }; - - // add the data items to the cache - $.each(stMatchSets, function(i, value) { - // increase the cache size - options.cacheLength++; - // add to the cache - add(i, value); - }); - } - - // populate any existing data - setTimeout(populate, 25); - - function flush(){ - data = {}; - length = 0; - } - - return { - flush: flush, - add: add, - populate: populate, - load: function(q) { - if (!options.cacheLength || !length) - return null; - /* - * if dealing w/local data and matchContains than we must make sure - * to loop through all the data collections looking for matches - */ - if( !options.url && options.matchContains ){ - // track all matches - var csub = []; - // loop through all the data grids for matches - for( var k in data ){ - // don't search through the stMatchSets[""] (minChars: 0) cache - // this prevents duplicates - if( k.length > 0 ){ - var c = data[k]; - $.each(c, function(i, x) { - // if we've got a match, add it to the array - if (matchSubset(x.value, q)) { - csub.push(x); - } - }); - } - } - return csub; - } else - // if the exact item exists, use it - if (data[q]){ - return data[q]; - } else - if (options.matchSubset) { - for (var i = q.length - 1; i >= options.minChars; i--) { - var c = data[q.substr(0, i)]; - if (c) { - var csub = []; - $.each(c, function(i, x) { - if (matchSubset(x.value, q)) { - csub[csub.length] = x; - } - }); - return csub; - } - } - } - return null; - } - }; -}; - -$.Autocompleter.Select = function (options, input, select, config) { - var CLASSES = { - ACTIVE: "ui-autocomplete-over" - }; - - var listItems, - active = -1, - data, - term = "", - needsInit = true, - element, - list; - - // Create results - function init() { - if (!needsInit) - return; - element = $("<div/>") - .hide() - .addClass(options.resultsClass) - .css("position", "absolute") - .appendTo(document.body); - - list = $("<ul/>").appendTo(element).mouseover( function(event) { - if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { - active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); - $(target(event)).addClass(CLASSES.ACTIVE); - } - }).click(function(event) { - $(target(event)).addClass(CLASSES.ACTIVE); - select(); - // TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus - input.focus(); - return false; - }).mousedown(function() { - config.mouseDownOnSelect = true; - }).mouseup(function() { - config.mouseDownOnSelect = false; - }); - - if( options.width > 0 ) - element.css("width", options.width); - - needsInit = false; - } - - function target(event) { - var element = event.target; - while(element && element.tagName != "LI") - element = element.parentNode; - // more fun with IE, sometimes event.target is empty, just ignore it then - if(!element) - return []; - return element; - } - - function moveSelect(step) { - listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE); - movePosition(step); - var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); - if(options.scroll) { - var offset = 0; - listItems.slice(0, active).each(function() { - offset += this.offsetHeight; - }); - if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { - list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); - } else if(offset < list.scrollTop()) { - list.scrollTop(offset); - } - } - }; - - function movePosition(step) { - active += step; - if (active < 0) { - active = listItems.size() - 1; - } else if (active >= listItems.size()) { - active = 0; - } - } - - function limitNumberOfItems(available) { - return options.max && options.max < available - ? options.max - : available; - } - - function fillList() { - list.empty(); - var max = limitNumberOfItems(data.length); - for (var i=0; i < max; i++) { - if (!data[i]) - continue; - var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term); - if ( formatted === false ) - continue; - var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ui-autocomplete-even" : "ui-autocomplete-odd").appendTo(list)[0]; - $.data(li, "ui-autocomplete-data", data[i]); - } - listItems = list.find("li"); - if ( options.selectFirst ) { - listItems.slice(0, 1).addClass(CLASSES.ACTIVE); - active = 0; - } - // apply bgiframe if available - if ( $.fn.bgiframe ) - list.bgiframe(); - } - - return { - display: function(d, q) { - init(); - data = d; - term = q; - fillList(); - }, - next: function() { - moveSelect(1); - }, - prev: function() { - moveSelect(-1); - }, - pageUp: function() { - if (active != 0 && active - 8 < 0) { - moveSelect( -active ); - } else { - moveSelect(-8); - } - }, - pageDown: function() { - if (active != listItems.size() - 1 && active + 8 > listItems.size()) { - moveSelect( listItems.size() - 1 - active ); - } else { - moveSelect(8); - } - }, - hide: function() { - element && element.hide(); - listItems && listItems.removeClass(CLASSES.ACTIVE) - active = -1; - $(input).triggerHandler("autocompletehide", [{}, { options: options }], options["hide"]); - }, - visible : function() { - return element && element.is(":visible"); - }, - current: function() { - return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); - }, - show: function() { - var offset = $(input).offset(); - element.css({ - width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), - top: offset.top + input.offsetHeight, - left: offset.left - }).show(); - - if(options.scroll) { - list.scrollTop(0); - list.css({ - maxHeight: options.scrollHeight, - overflow: 'auto' - }); - - if($.browser.msie && typeof document.body.style.maxHeight === "undefined") { - var listHeight = 0; - listItems.each(function() { - listHeight += this.offsetHeight; - }); - var scrollbarsVisible = listHeight > options.scrollHeight; - list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight ); - if (!scrollbarsVisible) { - // IE doesn't recalculate width when scrollbar disappears - listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) ); - } - } - - } - - $(input).triggerHandler("autocompleteshow", [{}, { options: options }], options["show"]); - - }, - selected: function() { - var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); - return selected && selected.length && $.data(selected[0], "ui-autocomplete-data"); - }, - emptyList: function (){ - list && list.empty(); - }, - unbind: function() { - element && element.remove(); - } - }; -}; - -$.Autocompleter.Selection = function(field, start, end) { - if( field.createTextRange ){ - var selRange = field.createTextRange(); - selRange.collapse(true); - selRange.moveStart("character", start); - selRange.moveEnd("character", end); - selRange.select(); - } else if( field.setSelectionRange ){ - field.setSelectionRange(start, end); - } else { - if( field.selectionStart ){ - field.selectionStart = start; - field.selectionEnd = end; - } - } - field.focus(); -}; - -})(jQuery); |