Skip to content

Commit 1c61ecd

Browse files
committed
fake endpoints for autocomplete testing.
1 parent 6ccb7f1 commit 1c61ecd

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

test.html

+15
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
<link rel="stylesheet" type="text/css" href="jquery.tagsinput.css" />
88
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
99
<script type="text/javascript" src="jquery.tagsinput.js"></script>
10+
<!-- To test using the original jQuery.autocomplete, uncomment the following -->
11+
<!--
12+
<script type='text/javascript' src='http://xoxco.com/x/tagsinput/jquery-autocomplete/jquery.autocomplete.min.js'></script>
13+
<link rel="stylesheet" type="text/css" href="http://xoxco.com/x/tagsinput/jquery-autocomplete/jquery.autocomplete.css" />
14+
-->
15+
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js'></script>
16+
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/start/jquery-ui.css" />
1017

1118

1219
<script type="text/javascript">
@@ -31,6 +38,10 @@
3138
});
3239
}
3340
});
41+
$('#tags_3').tagsInput({
42+
//autocomplete_url:'test/fake_plaintext_endpoint.html' //jquery.autocomplete (not jquery ui)
43+
autocomplete_url:'test/fake_json_endpoint.html' // jquery ui autocomplete requires a json endpoint
44+
});
3445

3546
// Uncomment this line to see the callback functions in action
3647
// $('input.tags').tagsInput({onAddTag:onAddTag,onRemoveTag:onRemoveTag});
@@ -52,6 +63,10 @@
5263

5364
<label>Technologies: (Programming languages in yellow)</label>
5465
<input id="tags_2" type="text" class="tags" value="php,ios,javascript,ruby,android,kindle" />
66+
67+
<label>Autocomplete:</label>
68+
<input id='tags_3' type='text' class='tags'>
69+
5570
</form>
5671
</section>
5772

test/fake_json_endpoint.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[ { "id": "Netta rufina", "label": "Red-crested Pochard", "value": "Red-crested Pochard" }, { "id": "Sterna sandvicensis", "label": "Sandwich Tern", "value": "Sandwich Tern" }, { "id": "Saxicola rubetra", "label": "Whinchat", "value": "Whinchat" }, { "id": "Saxicola rubicola", "label": "European Stonechat", "value": "European Stonechat" }, { "id": "Lanius senator", "label": "Woodchat Shrike", "value": "Woodchat Shrike" }, { "id": "Coccothraustes coccothraustes", "label": "Hawfinch", "value": "Hawfinch" }, { "id": "Ficedula hypoleuca", "label": "Eurasian Pied Flycatcher", "value": "Eurasian Pied Flycatcher" }, { "id": "Sitta europaea", "label": "Eurasian Nuthatch", "value": "Eurasian Nuthatch" }, { "id": "Pyrrhula pyrrhula", "label": "Eurasian Bullfinch", "value": "Eurasian Bullfinch" }, { "id": "Muscicapa striata", "label": "Spotted Flycatcher", "value": "Spotted Flycatcher" }, { "id": "Carduelis chloris", "label": "European Greenfinch", "value": "European Greenfinch" }, { "id": "Carduelis carduelis", "label": "European Goldfinch", "value": "European Goldfinch" } ]

test/fake_plaintext_endpoint.html

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
inky
2+
pinky
3+
blinky
4+
clyde

0 commit comments

Comments
 (0)