Permalink
Browse files

nix old tests.

  • Loading branch information...
1 parent 286bfcd commit 3af5341e2ff994b7023d012963e199278060753c @anutron committed Oct 20, 2010
@@ -1,5 +0,0 @@
-<link rel="STYLESHEET" type="text/css" href="../Assets/autocompleter/Autocompleter.css">
-<h2>Single items:</h2>
-<input id="foo" style="width:350px">
-<h2>Multiple items:</h2>
-<input id="foo2" style="width:350px">
@@ -1,98 +0,0 @@
-{
- tests: [
- {
- title: "Autocompleter.JSONP: single value",
- description: "Creates an auto completed input using data retrieved with JSONP.",
- verify: "Can you use the input to type in values that are autocompleted?",
- before: function(){
- var ac = new Autocompleter.JSONP($('foo'), 'http://api.cnet.com/restApi/v1.0/techProductSearch', {
- jsonpOptions: {
- //this data gets added to the query string using JsonP's options
- data: {
- viewType: 'json',
- partKey: '19926949750937665684988687810562', //this is my code, user your own!
- iod:'none',
- start:0,
- results:40
- }
- },
- width: 350,
- //require at least a key stroke from the user
- minLength: 1,
- //this function filters the results based on the input
- filter: function(resp) {
- try {
- //this structure is unique to the CNET API
- choices = resp.CNETResponse.TechProducts.TechProduct;
- //test it
- if(!choices || choices.length == 0) return [];
- //filter it and return it
- return choices.filter(function(choice){
- return (choice.Name.$.test(this.queryValue, 'i')
- || choice['@id'].test(this.queryValue), 'i');
- }.bind(this));
- } catch(e){dbug.log('filterResponse error: ', e);}
- },
- injectChoice: function(choice){
- //again, the structure of these items is unique to the CNET API
- if(! choice.Name.$)return;
- var el = new Element('li', {
- html: this.markQueryValue(choice.Name.$)
- }).adopt(new Element('span', {'class': 'example-info'}).set('html',this.markQueryValue(choice['@id'])));
- el.inputValue = choice.Name.$;
- this.addChoiceEvents(el).inject(this.choices);
- }
- });
- }
- },
- {
- title: "Autocompleter.JSONP: multiple values",
- description: "Creates a multiple auto completed input using data retrieved with JSONP.",
- verify: "Can you use the input to type in values that are autocompleted (<b>note:</b> semi-colons are used as the delimiter)?",
- before: function(){
- var ac = new Autocompleter.JSONP($('foo2'), 'http://api.cnet.com/restApi/v1.0/techProductSearch', {
- jsonpOptions: {
- //this data gets added to the query string using JsonP's options
- data: {
- viewType: 'json',
- partKey: '19926949750937665684988687810562', //this is my code, user your own!
- iod:'none',
- start:0,
- results:10
- }
- },
- selectMode: 'type-ahead', // Instant completion,
- multiple: true,
- separator: '; ',
- width: 350,
- //require at least a key stroke from the user
- minLength: 1,
- //this function filters the results based on the input
- filter: function(resp) {
- try {
- //this structure is unique to the CNET API
- choices = resp.CNETResponse.TechProducts.TechProduct;
- //test it
- if(!choices || choices.length == 0) return [];
- //filter it and return it
- return choices.filter(function(choice){
- return (choice.Name.$.test(this.queryValue, 'i')
- || choice['@id'].test(this.queryValue), 'i');
- }.bind(this));
- } catch(e){dbug.log('filterResponse error: ', e);}
- },
- injectChoice: function(choice){
- //again, the structure of these items is unique to the CNET API
- if(! choice.Name.$)return;
- var el = new Element('li', {
- html: this.markQueryValue(choice.Name.$)
- });
- el.inputValue = choice.Name.$;
- this.addChoiceEvents(el).inject(this.choices);
- }
- });
- }
- }
- ],
- otherScripts: ['Autocompleter.Clientcide']
-}
@@ -1,13 +0,0 @@
-<script>
-
- // Test source, list of tags from http://del.icio.us/tag/
- var tokens = ['Afghanistan', 'Aland Islands', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica', 'Antigua And Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia And Herzegovina', 'Botswana', 'Bouvet Island', 'Brazil', 'British Indian Ocean Territory', 'Brunei Darussalam', 'Bulgaria', 'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon', 'Canada', 'Cape Verde', 'Cayman Islands', 'Central African Republic', 'Chad', 'Chile', 'China', 'Christmas Island', 'Cocos (Keeling) Islands', 'Colombia', 'Comoros', 'Congo', 'Congo, The Democratic Republic Of The', 'Cook Islands', 'Costa Rica', 'Cote D\'ivoire', 'Croatia', 'Cuba', 'Cyprus', 'Czech Republic', 'Denmark', 'Djibouti', 'Dominica', 'Dominican Republic', 'Ecuador', 'Egypt', 'El Salvador', 'Equatorial Guinea', 'Eritrea', 'Estonia', 'Ethiopia', 'Falkland Islands (Malvinas)', 'Faroe Islands', 'Fiji', 'Finland', 'France', 'French Guiana', 'French Polynesia', 'French Southern Territories', 'Gabon', 'Gambia', 'Georgia', 'Germany', 'Ghana', 'Gibraltar', 'Greece', 'Greenland', 'Grenada', 'Guadeloupe', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea-Bissau', 'Guyana', 'Haiti', 'Heard Island And Mcdonald Islands', 'Holy See (Vatican City State)', 'Honduras', 'Hong Kong', 'Hungary', 'Iceland', 'India', 'Indonesia', 'Iran, Islamic Republic Of', 'Iraq', 'Ireland', 'Isle Of Man', 'Israel', 'Italy', 'Jamaica', 'Japan', 'Jersey', 'Jordan', 'Kazakhstan', 'Kenya', 'Kiribati', 'Korea, Democratic People\'s Republic Of', 'Korea, Republic Of', 'Kuwait', 'Kyrgyzstan', 'Lao People\'s Democratic Republic', 'Latvia', 'Lebanon', 'Lesotho', 'Liberia', 'Libyan Arab Jamahiriya', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Macao', 'Macedonia, The Former Yugoslav Republic Of', 'Madagascar', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta', 'Marshall Islands', 'Martinique', 'Mauritania', 'Mauritius', 'Mayotte', 'Mexico', 'Micronesia, Federated States Of', 'Moldova, Republic Of', 'Monaco', 'Mongolia', 'Montenegro', 'Montserrat', 'Morocco', 'Mozambique', 'Myanmar', 'Namibia', 'Nauru', 'Nepal', 'Netherlands', 'Netherlands Antilles', 'New Caledonia', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria', 'Niue', 'Norfolk Island', 'Northern Mariana Islands', 'Norway', 'Oman', 'Pakistan', 'Palau', 'Palestinian Territory, Occupied', 'Panama', 'Papua New Guinea', 'Paraguay', 'Peru', 'Philippines', 'Pitcairn', 'Poland', 'Portugal', 'Puerto Rico', 'Qatar', 'Reunion', 'Romania', 'Russian Federation', 'Rwanda', 'Saint Helena', 'Saint Kitts And Nevis', 'Saint Lucia', 'Saint Pierre And Miquelon', 'Saint Vincent And The Grenadines', 'Samoa', 'San Marino', 'Sao Tome And Principe', 'Saudi Arabia', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovakia', 'Slovenia', 'Solomon Islands', 'Somalia', 'South Africa', 'South Georgia And The South Sandwich Islands', 'Spain', 'Sri Lanka', 'Sudan', 'Suriname', 'Svalbard And Jan Mayen', 'Swaziland', 'Sweden', 'Switzerland', 'Syrian Arab Republic', 'Taiwan, Province Of China', 'Tajikistan', 'Tanzania, United Republic Of', 'Thailand', 'Timor-Leste', 'Togo', 'Tokelau', 'Tonga', 'Trinidad And Tobago', 'Tunisia', 'Turkey', 'Turkmenistan', 'Turks And Caicos Islands', 'Tuvalu', 'Uganda', 'Ukraine', 'United Arab Emirates', 'United Kingdom', 'United States', 'United States Minor Outlying Islands', 'Uruguay', 'Uzbekistan', 'Vanuatu', 'Venezuela', 'Viet Nam', 'Virgin Islands, British', 'Virgin Islands, U.S.', 'Wallis And Futuna', 'Western Sahara', 'Yemen', 'Zambia', 'Zimbabwe'];
-
-</script>
-<link rel="STYLESHEET" type="text/css" href="../Assets/autocompleter/Autocompleter.css"/>
-<h2>Single value: (pick)</h2>
-<input id="foo">
-<h2>Multiple values: (select)</h2>
-<input id="foo2">
-<h2>3 (type-ahead)</h2>
-<input id="foo3">
@@ -1,49 +0,0 @@
-{
- tests: [
- {
- title: "Autocompleter.Local: single value",
- description: "Creates an auto completed input using data in memory.",
- verify: "Can you use the input to type in values that are autocompleted?",
- before: function(){
- Clientcide.setAssetLocation('../Assets');
- // Our instance for the element with id "demo-local"
- new Autocompleter.Local('foo', tokens, {
- minLength: 1, // We need at least 1 character
- selectMode: 'pick', // Instant completion
- overflow: true
- });
- }
- },
- {
- title: "Autocompleter.Local: multiple values: selection",
- description: "Creates an auto completed input using data in memory; allows for more than one value.",
- verify: "Can you use the input to type in values that are autocompleted? Can you add a comma and enter another value that is autocompleted?",
- before: function(){
- Clientcide.setAssetLocation('../Assets');
- // Our instance for the element with id "demo-local"
- new Autocompleter.Local('foo2', tokens, {
- minLength: 1, // We need at least 1 character
- selectMode: 'selection', // Instant completion,
- multiple: true,
- overflow: true
- });
- }
- },
- {
- title: "Autocompleter.Local: multiple values: type-ahead",
- description: "Creates an auto completed input using data in memory; allows for more than one value.",
- verify: "Can you use the input to type in values that are autocompleted? Can you add a comma and enter another value that is autocompleted?",
- before: function(){
- Clientcide.setAssetLocation('../Assets');
- // Our instance for the element with id "demo-local"
- new Autocompleter.Local('foo3', tokens, {
- minLength: 1, // We need at least 1 character
- selectMode: 'type-ahead', // Instant completion,
- multiple: true,
- overflow: true
- });
- }
- }
- ],
- otherScripts: ['Autocompleter.Clientcide']
-}

0 comments on commit 3af5341

Please sign in to comment.