diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..f220a44
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,45 @@
+# EditorConfig is awesome: http://EditorConfig.org
+
+# Howto with your editor: http://editorconfig.org/#download
+# Sublime: https://github.com/sindresorhus/editorconfig-sublime
+
+# top-most EditorConfig file
+root = true
+
+# Unix-style newlines with a newline ending every file
+[**]
+end_of_line = lf
+insert_final_newline = true
+
+# Standard at: https://github.com/felixge/node-style-guide
+[**.{js,json}]
+trim_trailing_whitespace = true
+indent_style = tab
+indent_size = 4
+quote_type = single
+curly_bracket_next_line = false
+spaces_around_operators = true
+space_after_control_statements = true
+space_after_anonymous_functions = true
+spaces_in_brackets = false
+
+# No Standard. Please document a standard if different from .js
+[**.css]
+trim_trailing_whitespace = true
+indent_style = tab
+
+[**.html]
+trim_trailing_whitespace = true
+indent_style = tab
+indent_size = 4
+
+# No standard. Please document a standard if different from .js
+[**.md]
+indent_style = tab
+
+
+# The indentation in package.json will always need to be 2 spaces
+# https://github.com/npm/npm/issues/4718
+[{package, bower}.json]
+indent_style = space
+indent_size = 2
diff --git a/.gitignore b/.gitignore
index 594c181..efa4beb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
.*
!.gitignore
+!.editorconfig
!.jscsrc
!.jshintrc
!.gitattributes
diff --git a/.jshintrc b/.jshintrc
index 04692bc..35252cc 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -6,14 +6,13 @@
"expr": true,
"immed": true,
"noarg": true,
- "quotmark": "double",
+ "quotmark": "single",
"smarttabs": true,
"trailing": true,
"undef": true,
"unused": true,
"browser": true,
"es3": true,
-
"globals": {
"QUnit": false,
"exports": false,
diff --git a/Gruntfile.js b/Gruntfile.js
index 20ebb2b..8f32e74 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -1,206 +1,209 @@
-module.exports = function(grunt) {
- grunt.initConfig({
- pkg: grunt.file.readJSON('package.json'),
-
- project: {
- app: '<%= pkg.name %>',
-
- js: {
- files: 'src/processResponseData.js, src/configuration.js, src/easy-autocomplete.js',
- src: 'src/*.js',
- dest: 'dist/jquery.easy-autocomplete.js',
- dist: 'dist/jquery.easy-autocomplete.min.js'
- },
-
- sass: {
- src: 'src/sass',
- dist: 'dist'
- }
- },
-
- tag: {
- banner: '/*\n' +
- ' * <%= pkg.name %>\n' +
- ' * <%= pkg.title %>\n' +
- ' * <%= pkg.url %>\n' +
- ' * @author <%= pkg.author %>\n' +
- ' * @version <%= pkg.version %>\n' +
- ' * Copyright <%= pkg.license.type %> License: <%= pkg.license.url %>\n' +
- ' */\n'
- },
-
-
- //------------------------ JAVASCRIPT --------------------------
-
- concat: {
- "src-js": {
- src: ['src/configuration.js', 'src/logger.js', 'src/constans.js', 'src/listBuilder.js', 'src/proccessData.js', 'src/template.js', 'src/core.js'],
- dest: '<%= project.js.dest %>',
- }
- },
-
- comments: {
- js_dist: {
- options: {
- singleline: true,
- multiline: false
- },
- src: [ '<%= project.js.dest %>']
- },
- },
-
- uglify: {
- dist: {
- files: {
- '<%= project.js.dist %>' : '<%= project.js.dest %>'
- }
- }
- },
-
-
- jshint: {
- all: [
- '<%= project.js.src %>',
- //'test/*.js',
- //'test/core/*.js'
- ],
- options: {
- jshintrc: true
- }
- },
-
- jscs: {
- options: {
- config: ".jscsrc"
- },
- all: [
- "<%= jshint.all %>"
- ]
- },
-
- qunit: {
- unit: [
- 'test/*.html'
- ],
- integration: [
- 'test/core/plugin.html',
- 'test/core/build.html',
- 'test/core/handles.html',
- 'test/core/functions.html',
- 'test/core/response.html',
- 'test/core/categories.html',
- 'test/core/event.html',
- 'test/core/template.html',
- 'test/core/features.html'
- ]
- },
-
- //------------------------ CSS --------------------------
-
- sass: {
- dev: {
- options: {
- style: 'expanded',
- sourceMap: false
- },
- files: [{
- expand: true,
- cwd: '<%= project.sass.src %>',
- src: ['*.scss'],
- dest: '<%= project.sass.dist %>',
- ext: '.css'
- },
- {
- '<%= project.sass.dist %>/easy-autocomplete.themes.css': '<%= project.sass.src %>/easy-autocomplete.themes.scss'
- }]
- },
- dist: {
- options: {
- style: 'compressed',
- sourceMap: false
- },
- files: [{
- expand: true,
- cwd: '<%= project.sass.src %>',
- src: ['*.scss'],
- dest: '<%= project.sass.dist %>',
- ext: '.min.css'
- },
- {
- '<%= project.sass.dist %>/easy-autocomplete.themes.min.css': '<%= project.sass.src %>/easy-autocomplete.themes.scss'
- }]
- },
- },
-
-
- csslint: {
- strict: {
- options: {
- import: 2
- },
- src: ['<%= project.sass.dist %>' + '/easy-autocomplete.min.css']
- },
- lax: {
- options: {
- import: false
- },
- src: ['<%= project.sass.dist %>' + '/easy-autocomplete.min.css']
- }
- },
-
- copy: {
- files: {
- cwd: '<%= project.sass.dist %>', // set working folder / root to copy
- src: '*.map', // copy all files and subfolders
- dest: '<%= project.sass.dist %>/maps', // destination folder
- expand: true // required when using cwd
- }
- },
-
- clean: ['<%= project.sass.dist %>/*.map'],
-
-
- //------------------------ MISC --------------------------
-
- usebanner: {
- options: {
- position: 'top',
- banner: '<%= tag.banner %>'
- },
- files: {
- src: [
- '<%= project.sass.dist %>/*',
- '<%= project.js.dist %>'
- ]
- }
- },
-
-
- watch: {
- build: {
- files: 'src/{,*/}*.{scss,js}',
- tasks: ['build']
- }
- }
- });
-
-
- require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
-
- grunt.registerTask('doc:jscs', ['jscs']);
-
- grunt.registerTask('doc:jshint', ['jshint']);
-
- grunt.registerTask('doc:csslint', ['csslint:lax']);
-
- grunt.registerTask('doc', ['jshint', 'jscs', 'csslint:lax']);
-
- grunt.registerTask('test', ['qunit:unit', 'qunit:integration']);
-
- grunt.registerTask('build', ['qunit:unit', 'concat', 'comments', 'uglify', 'sass:dev', 'sass:dist', 'usebanner', 'copy', 'clean']);
-
- grunt.registerTask('devel', ['build', 'qunit:integration']);
-
- grunt.registerTask('default', ['build', 'qunit:integration']);
+module.exports = function (grunt) {
+
+ grunt.initConfig({
+
+ pkg: grunt.file.readJSON('package.json'),
+
+ project: {
+ app: '<%= pkg.name %>',
+
+ js: {
+ files: 'src/processResponseData.js, src/configuration.js, src/easy-autocomplete.js',
+ src: 'src/*.js',
+ dest: 'dist/jquery.easy-autocomplete.js',
+ dist: 'dist/jquery.easy-autocomplete.min.js'
+ },
+
+ sass: {
+ src: 'src/styles',
+ dist: 'dist'
+ }
+ },
+
+ tag: {
+ banner: '/*\n' +
+ ' * <%= pkg.name %>\n' +
+ ' * <%= pkg.title %>\n' +
+ ' * <%= pkg.url %>\n' +
+ ' * @author <%= pkg.author %>\n' +
+ ' * @version <%= pkg.version %>\n' +
+ ' * Copyright <%= pkg.license.type %> License: <%= pkg.license.url %>\n' +
+ ' */\n'
+ },
+
+
+ //------------------------ JAVASCRIPT --------------------------
+
+ concat: {
+ 'src-js': {
+ src: ['src/configuration.js', 'src/logger.js', 'src/constants.js', 'src/list.builder.js', 'src/data.processor.js', 'src/template.js', 'src/core.js'],
+ dest: '<%= project.js.dest %>'
+ }
+ },
+
+ comments: {
+ js_dist: {
+ options: {
+ singleline: true,
+ multiline: false
+ },
+ src: ['<%= project.js.dest %>']
+ }
+ },
+
+ uglify: {
+ dist: {
+ files: {
+ '<%= project.js.dist %>': '<%= project.js.dest %>'
+ }
+ }
+ },
+
+
+ jshint: {
+ all: [
+ '<%= project.js.src %>'
+ //'test/*.js',
+ //'test/core/*.js'
+ ],
+ options: {
+ jshintrc: true
+ }
+ },
+
+ jscs: {
+ options: {
+ config: '.jscsrc'
+ },
+ all: [
+ '<%= jshint.all %>'
+ ]
+ },
+
+ qunit: {
+ unit: [
+ 'test/*.html'
+ ],
+ integration: [
+ 'test/core/plugin.html',
+ 'test/core/build.html',
+ 'test/core/handles.html',
+ 'test/core/functions.html',
+ // 'test/core/response.html',
+ // 'test/core/categories.html',
+ // 'test/core/event.html',
+ // 'test/core/template.html',
+ 'test/core/features.html'
+ ]
+ },
+
+ //------------------------ CSS --------------------------
+
+ sass: {
+ dev: {
+ options: {
+ style: 'expanded',
+ sourceMap: false
+ },
+ files: [{
+ expand: true,
+ cwd: '<%= project.sass.src %>',
+ src: ['*.scss'],
+ dest: '<%= project.sass.dist %>',
+ ext: '.css'
+ },
+ {
+ '<%= project.sass.dist %>/easy-autocomplete.themes.css': '<%= project.sass.src %>/easy-autocomplete.themes.scss'
+ }]
+ },
+ dist: {
+ options: {
+ style: 'compressed',
+ sourceMap: false
+ },
+ files: [{
+ expand: true,
+ cwd: '<%= project.sass.src %>',
+ src: ['*.scss'],
+ dest: '<%= project.sass.dist %>',
+ ext: '.min.css'
+ },
+ {
+ '<%= project.sass.dist %>/easy-autocomplete.themes.min.css': '<%= project.sass.src %>/easy-autocomplete.themes.scss'
+ }]
+ }
+ },
+
+
+ csslint: {
+ strict: {
+ options: {
+ import: 2
+ },
+ src: ['<%= project.sass.dist %>' + '/easy-autocomplete.min.css']
+ },
+ lax: {
+ options: {
+ import: false
+ },
+ src: ['<%= project.sass.dist %>' + '/easy-autocomplete.min.css']
+ }
+ },
+
+ copy: {
+ files: {
+ cwd: '<%= project.sass.dist %>', // set working folder / root to copy
+ src: '*.map', // copy all files and subfolders
+ dest: '<%= project.sass.dist %>/maps', // destination folder
+ expand: true // required when using cwd
+ }
+ },
+
+ clean: ['<%= project.sass.dist %>/*.map'],
+
+ //------------------------ MISC --------------------------
+
+ usebanner: {
+ options: {
+ position: 'top',
+ banner: '<%= tag.banner %>'
+ },
+ files: {
+ src: [
+ '<%= project.sass.dist %>/*',
+ '<%= project.js.dist %>'
+ ]
+ }
+ },
+
+
+ watch: {
+ build: {
+ files: 'src/{,*/}*.{scss,js}',
+ tasks: ['build']
+ }
+ }
+ });
+
+
+ require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
+
+ grunt.registerTask('doc:jscs', ['jscs']);
+
+ grunt.registerTask('doc:jshint', ['jshint']);
+
+ grunt.registerTask('doc:csslint', ['csslint:lax']);
+
+ grunt.registerTask('doc', ['jshint', 'jscs', 'csslint:lax']);
+
+ grunt.registerTask('test', ['qunit:unit', 'qunit:integration']);
+
+ grunt.registerTask('build', ['qunit:unit', 'concat', 'comments', 'uglify', 'sass:dev', 'sass:dist', 'usebanner', 'copy', 'clean']);
+
+ grunt.registerTask('devel', ['build', 'qunit:integration']);
+
+ grunt.registerTask('build:dev', ['build']);
+
+ grunt.registerTask('default', ['build', 'qunit:integration']);
};
diff --git a/LICENSE.txt b/LICENSE.txt
index 505bd49..16abb3e 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2015 Łukasz Pawełczak
+Copyright (c) 2015-2019 Łukasz Pawełczak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index d5fbd0d..d45e292 100644
--- a/README.md
+++ b/README.md
@@ -17,21 +17,62 @@ Jquery autocomplete plugin
If you are interested in using this jQuery autocomplete plugin on your site, you can find out more details in the
EasyAutocomplete - jQuery autocomplete - homepage. You can find there full documentation and easy guide on how to use EasyAutocomplete plugin.
-###File location:
+## Quick example
+
+Javascript:
+```Javascript
+var options = {
+
+ url: "location_to_file.json",
+
+ getValue: "name"
+};
+
+$("#countries").easyAutocomplete(options);
+```
+
+JSON:
+```JSON
+[
+ {"name": "Afghanistan", "code": "AF"},
+ {"name": "Aland Islands", "code": "AX"},
+ {"name": "Albania", "code": "AL"},
+ {"name": "Algeria", "code": "DZ"},
+ {"name": "American Samoa", "code": "AS"}
+ ]
+```
+
+HTML:
+```HTML
+
+```
+
+## Demo
+
+There are a couple of examples in folder: `demo`.
+
+## Build
+
+To build project(javascript and css) run:
+
+```
+grunt build
+```
+
+## File location:
+
* Distribution files Javascript, CSS are in `dist` folder,
* Source files are in the folder `src`,
* Simple examples, that presents usage of plugin can be found in folder `demo`,
* Tests for the plugin are located in folder `test`.
-###Building
-To build project(javascript and css) run:
-
-`grunt build`
-
-###Running tests
+## Run tests
To execute all unit tests, use:
-`grunt test`
+```
+grunt test
+```
+
+## License:
-###License:
Code released under the MIT license.
diff --git a/bower.json b/bower.json
deleted file mode 100644
index 0eeec50..0000000
--- a/bower.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "name": "EasyAutocomplete",
- "description": "EasyAutocomplete is a jQuery autocomplete plugin. Easy to create autocomplete dropdown list for text input fields",
- "version": "1.3.4",
- "authors": [
- "Łukasz Pawełczak "
- ],
- "main": [
- "dist/jquery.easy-autocomplete.js",
- "dist/easy-autocomplete.css"
- ],
- "license": "MIT",
- "dependencies": {
- "jquery": "~1.11.0"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/pawelczak/EasyAutocomplete.git"
- }
-}
diff --git a/demo/api/countries.php b/demo/api/countries.php
index 6b61313..983f124 100644
--- a/demo/api/countries.php
+++ b/demo/api/countries.php
@@ -1,247 +1,248 @@
-'AFGHANISTAN',
- 'AL'=>'ALBANIA',
- 'DZ'=>'ALGERIA',
- 'AS'=>'AMERICAN SAMOA',
- 'AD'=>'ANDORRA',
- 'AO'=>'ANGOLA',
- 'AI'=>'ANGUILLA',
- 'AQ'=>'ANTARCTICA',
- 'AG'=>'ANTIGUA AND BARBUDA',
- 'AR'=>'ARGENTINA',
- 'AM'=>'ARMENIA',
- 'AW'=>'ARUBA',
- 'AU'=>'AUSTRALIA',
- 'AT'=>'AUSTRIA',
- 'AZ'=>'AZERBAIJAN',
- 'BS'=>'BAHAMAS',
- 'BH'=>'BAHRAIN',
- 'BD'=>'BANGLADESH',
- 'BB'=>'BARBADOS',
- 'BY'=>'BELARUS',
- 'BE'=>'BELGIUM',
- 'BZ'=>'BELIZE',
- 'BJ'=>'BENIN',
- 'BM'=>'BERMUDA',
- 'BT'=>'BHUTAN',
- 'BO'=>'BOLIVIA',
- 'BA'=>'BOSNIA AND HERZEGOVINA',
- 'BW'=>'BOTSWANA',
- 'BV'=>'BOUVET ISLAND',
- 'BR'=>'BRAZIL',
- 'IO'=>'BRITISH INDIAN OCEAN TERRITORY',
- 'BN'=>'BRUNEI DARUSSALAM',
- 'BG'=>'BULGARIA',
- 'BF'=>'BURKINA FASO',
- 'BI'=>'BURUNDI',
- 'KH'=>'CAMBODIA',
- 'CM'=>'CAMEROON',
- 'CA'=>'CANADA',
- 'CV'=>'CAPE VERDE',
- 'KY'=>'CAYMAN ISLANDS',
- 'CF'=>'CENTRAL AFRICAN REPUBLIC',
- 'TD'=>'CHAD',
- 'CL'=>'CHILE',
- 'CN'=>'CHINA',
- 'CX'=>'CHRISTMAS ISLAND',
- 'CC'=>'COCOS (KEELING) ISLANDS',
- 'CO'=>'COLOMBIA',
- 'KM'=>'COMOROS',
- 'CG'=>'CONGO',
- 'CD'=>'CONGO, THE DEMOCRATIC REPUBLIC OF THE',
- 'CK'=>'COOK ISLANDS',
- 'CR'=>'COSTA RICA',
- 'CI'=>'COTE D IVOIRE',
- 'HR'=>'CROATIA',
- 'CU'=>'CUBA',
- 'CY'=>'CYPRUS',
- 'CZ'=>'CZECH REPUBLIC',
- 'DK'=>'DENMARK',
- 'DJ'=>'DJIBOUTI',
- 'DM'=>'DOMINICA',
- 'DO'=>'DOMINICAN REPUBLIC',
- 'TP'=>'EAST TIMOR',
- 'EC'=>'ECUADOR',
- 'EG'=>'EGYPT',
- 'SV'=>'EL SALVADOR',
- 'GQ'=>'EQUATORIAL GUINEA',
- 'ER'=>'ERITREA',
- 'EE'=>'ESTONIA',
- 'ET'=>'ETHIOPIA',
- 'FK'=>'FALKLAND ISLANDS (MALVINAS)',
- 'FO'=>'FAROE ISLANDS',
- 'FJ'=>'FIJI',
- 'FI'=>'FINLAND',
- 'FR'=>'FRANCE',
- 'GF'=>'FRENCH GUIANA',
- 'PF'=>'FRENCH POLYNESIA',
- 'TF'=>'FRENCH SOUTHERN TERRITORIES',
- 'GA'=>'GABON',
- 'GM'=>'GAMBIA',
- 'GE'=>'GEORGIA',
- 'DE'=>'GERMANY',
- 'GH'=>'GHANA',
- 'GI'=>'GIBRALTAR',
- 'GR'=>'GREECE',
- 'GL'=>'GREENLAND',
- 'GD'=>'GRENADA',
- 'GP'=>'GUADELOUPE',
- 'GU'=>'GUAM',
- 'GT'=>'GUATEMALA',
- 'GN'=>'GUINEA',
- 'GW'=>'GUINEA-BISSAU',
- 'GY'=>'GUYANA',
- 'HT'=>'HAITI',
- 'HM'=>'HEARD ISLAND AND MCDONALD ISLANDS',
- 'VA'=>'HOLY SEE (VATICAN CITY STATE)',
- 'HN'=>'HONDURAS',
- 'HK'=>'HONG KONG',
- 'HU'=>'HUNGARY',
- 'IS'=>'ICELAND',
- 'IN'=>'INDIA',
- 'ID'=>'INDONESIA',
- 'IR'=>'IRAN, ISLAMIC REPUBLIC OF',
- 'IQ'=>'IRAQ',
- 'IE'=>'IRELAND',
- 'IL'=>'ISRAEL',
- 'IT'=>'ITALY',
- 'JM'=>'JAMAICA',
- 'JP'=>'JAPAN',
- 'JO'=>'JORDAN',
- 'KZ'=>'KAZAKSTAN',
- 'KE'=>'KENYA',
- 'KI'=>'KIRIBATI',
- 'KP'=>'KOREA DEMOCRATIC PEOPLES REPUBLIC OF',
- 'KR'=>'KOREA REPUBLIC OF',
- 'KW'=>'KUWAIT',
- 'KG'=>'KYRGYZSTAN',
- 'LA'=>'LAO PEOPLES DEMOCRATIC REPUBLIC',
- 'LV'=>'LATVIA',
- 'LB'=>'LEBANON',
- 'LS'=>'LESOTHO',
- 'LR'=>'LIBERIA',
- 'LY'=>'LIBYAN ARAB JAMAHIRIYA',
- 'LI'=>'LIECHTENSTEIN',
- 'LT'=>'LITHUANIA',
- 'LU'=>'LUXEMBOURG',
- 'MO'=>'MACAU',
- 'MK'=>'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF',
- 'MG'=>'MADAGASCAR',
- 'MW'=>'MALAWI',
- 'MY'=>'MALAYSIA',
- 'MV'=>'MALDIVES',
- 'ML'=>'MALI',
- 'MT'=>'MALTA',
- 'MH'=>'MARSHALL ISLANDS',
- 'MQ'=>'MARTINIQUE',
- 'MR'=>'MAURITANIA',
- 'MU'=>'MAURITIUS',
- 'YT'=>'MAYOTTE',
- 'MX'=>'MEXICO',
- 'FM'=>'MICRONESIA, FEDERATED STATES OF',
- 'MD'=>'MOLDOVA, REPUBLIC OF',
- 'MC'=>'MONACO',
- 'MN'=>'MONGOLIA',
- 'MS'=>'MONTSERRAT',
- 'MA'=>'MOROCCO',
- 'MZ'=>'MOZAMBIQUE',
- 'MM'=>'MYANMAR',
- 'NA'=>'NAMIBIA',
- 'NR'=>'NAURU',
- 'NP'=>'NEPAL',
- 'NL'=>'NETHERLANDS',
- 'AN'=>'NETHERLANDS ANTILLES',
- 'NC'=>'NEW CALEDONIA',
- 'NZ'=>'NEW ZEALAND',
- 'NI'=>'NICARAGUA',
- 'NE'=>'NIGER',
- 'NG'=>'NIGERIA',
- 'NU'=>'NIUE',
- 'NF'=>'NORFOLK ISLAND',
- 'MP'=>'NORTHERN MARIANA ISLANDS',
- 'NO'=>'NORWAY',
- 'OM'=>'OMAN',
- 'PK'=>'PAKISTAN',
- 'PW'=>'PALAU',
- 'PS'=>'PALESTINIAN TERRITORY, OCCUPIED',
- 'PA'=>'PANAMA',
- 'PG'=>'PAPUA NEW GUINEA',
- 'PY'=>'PARAGUAY',
- 'PE'=>'PERU',
- 'PH'=>'PHILIPPINES',
- 'PN'=>'PITCAIRN',
- 'PL'=>'POLAND',
- 'PT'=>'PORTUGAL',
- 'PR'=>'PUERTO RICO',
- 'QA'=>'QATAR',
- 'RE'=>'REUNION',
- 'RO'=>'ROMANIA',
- 'RU'=>'RUSSIAN FEDERATION',
- 'RW'=>'RWANDA',
- 'SH'=>'SAINT HELENA',
- 'KN'=>'SAINT KITTS AND NEVIS',
- 'LC'=>'SAINT LUCIA',
- 'PM'=>'SAINT PIERRE AND MIQUELON',
- 'VC'=>'SAINT VINCENT AND THE GRENADINES',
- 'WS'=>'SAMOA',
- 'SM'=>'SAN MARINO',
- 'ST'=>'SAO TOME AND PRINCIPE',
- 'SA'=>'SAUDI ARABIA',
- 'SN'=>'SENEGAL',
- 'SC'=>'SEYCHELLES',
- 'SL'=>'SIERRA LEONE',
- 'SG'=>'SINGAPORE',
- 'SK'=>'SLOVAKIA',
- 'SI'=>'SLOVENIA',
- 'SB'=>'SOLOMON ISLANDS',
- 'SO'=>'SOMALIA',
- 'ZA'=>'SOUTH AFRICA',
- 'GS'=>'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS',
- 'ES'=>'SPAIN',
- 'LK'=>'SRI LANKA',
- 'SD'=>'SUDAN',
- 'SR'=>'SURINAME',
- 'SJ'=>'SVALBARD AND JAN MAYEN',
- 'SZ'=>'SWAZILAND',
- 'SE'=>'SWEDEN',
- 'CH'=>'SWITZERLAND',
- 'SY'=>'SYRIAN ARAB REPUBLIC',
- 'TW'=>'TAIWAN, PROVINCE OF CHINA',
- 'TJ'=>'TAJIKISTAN',
- 'TZ'=>'TANZANIA, UNITED REPUBLIC OF',
- 'TH'=>'THAILAND',
- 'TG'=>'TOGO',
- 'TK'=>'TOKELAU',
- 'TO'=>'TONGA',
- 'TT'=>'TRINIDAD AND TOBAGO',
- 'TN'=>'TUNISIA',
- 'TR'=>'TURKEY',
- 'TM'=>'TURKMENISTAN',
- 'TC'=>'TURKS AND CAICOS ISLANDS',
- 'TV'=>'TUVALU',
- 'UG'=>'UGANDA',
- 'UA'=>'UKRAINE',
- 'AE'=>'UNITED ARAB EMIRATES',
- 'GB'=>'UNITED KINGDOM',
- 'US'=>'UNITED STATES',
- 'UM'=>'UNITED STATES MINOR OUTLYING ISLANDS',
- 'UY'=>'URUGUAY',
- 'UZ'=>'UZBEKISTAN',
- 'VU'=>'VANUATU',
- 'VE'=>'VENEZUELA',
- 'VN'=>'VIET NAM',
- 'VG'=>'VIRGIN ISLANDS, BRITISH',
- 'VI'=>'VIRGIN ISLANDS, U.S.',
- 'WF'=>'WALLIS AND FUTUNA',
- 'EH'=>'WESTERN SAHARA',
- 'YE'=>'YEMEN',
- 'YU'=>'YUGOSLAVIA',
- 'ZM'=>'ZAMBIA',
- 'ZW'=>'ZIMBABWE',
- );
+function getCountries()
+{
+ return array(
+ 'AF' => 'AFGHANISTAN',
+ 'AL' => 'ALBANIA',
+ 'DZ' => 'ALGERIA',
+ 'AS' => 'AMERICAN SAMOA',
+ 'AD' => 'ANDORRA',
+ 'AO' => 'ANGOLA',
+ 'AI' => 'ANGUILLA',
+ 'AQ' => 'ANTARCTICA',
+ 'AG' => 'ANTIGUA AND BARBUDA',
+ 'AR' => 'ARGENTINA',
+ 'AM' => 'ARMENIA',
+ 'AW' => 'ARUBA',
+ 'AU' => 'AUSTRALIA',
+ 'AT' => 'AUSTRIA',
+ 'AZ' => 'AZERBAIJAN',
+ 'BS' => 'BAHAMAS',
+ 'BH' => 'BAHRAIN',
+ 'BD' => 'BANGLADESH',
+ 'BB' => 'BARBADOS',
+ 'BY' => 'BELARUS',
+ 'BE' => 'BELGIUM',
+ 'BZ' => 'BELIZE',
+ 'BJ' => 'BENIN',
+ 'BM' => 'BERMUDA',
+ 'BT' => 'BHUTAN',
+ 'BO' => 'BOLIVIA',
+ 'BA' => 'BOSNIA AND HERZEGOVINA',
+ 'BW' => 'BOTSWANA',
+ 'BV' => 'BOUVET ISLAND',
+ 'BR' => 'BRAZIL',
+ 'IO' => 'BRITISH INDIAN OCEAN TERRITORY',
+ 'BN' => 'BRUNEI DARUSSALAM',
+ 'BG' => 'BULGARIA',
+ 'BF' => 'BURKINA FASO',
+ 'BI' => 'BURUNDI',
+ 'KH' => 'CAMBODIA',
+ 'CM' => 'CAMEROON',
+ 'CA' => 'CANADA',
+ 'CV' => 'CAPE VERDE',
+ 'KY' => 'CAYMAN ISLANDS',
+ 'CF' => 'CENTRAL AFRICAN REPUBLIC',
+ 'TD' => 'CHAD',
+ 'CL' => 'CHILE',
+ 'CN' => 'CHINA',
+ 'CX' => 'CHRISTMAS ISLAND',
+ 'CC' => 'COCOS (KEELING) ISLANDS',
+ 'CO' => 'COLOMBIA',
+ 'KM' => 'COMOROS',
+ 'CG' => 'CONGO',
+ 'CD' => 'CONGO, THE DEMOCRATIC REPUBLIC OF THE',
+ 'CK' => 'COOK ISLANDS',
+ 'CR' => 'COSTA RICA',
+ 'CI' => 'COTE D IVOIRE',
+ 'HR' => 'CROATIA',
+ 'CU' => 'CUBA',
+ 'CY' => 'CYPRUS',
+ 'CZ' => 'CZECH REPUBLIC',
+ 'DK' => 'DENMARK',
+ 'DJ' => 'DJIBOUTI',
+ 'DM' => 'DOMINICA',
+ 'DO' => 'DOMINICAN REPUBLIC',
+ 'TP' => 'EAST TIMOR',
+ 'EC' => 'ECUADOR',
+ 'EG' => 'EGYPT',
+ 'SV' => 'EL SALVADOR',
+ 'GQ' => 'EQUATORIAL GUINEA',
+ 'ER' => 'ERITREA',
+ 'EE' => 'ESTONIA',
+ 'ET' => 'ETHIOPIA',
+ 'FK' => 'FALKLAND ISLANDS (MALVINAS)',
+ 'FO' => 'FAROE ISLANDS',
+ 'FJ' => 'FIJI',
+ 'FI' => 'FINLAND',
+ 'FR' => 'FRANCE',
+ 'GF' => 'FRENCH GUIANA',
+ 'PF' => 'FRENCH POLYNESIA',
+ 'TF' => 'FRENCH SOUTHERN TERRITORIES',
+ 'GA' => 'GABON',
+ 'GM' => 'GAMBIA',
+ 'GE' => 'GEORGIA',
+ 'DE' => 'GERMANY',
+ 'GH' => 'GHANA',
+ 'GI' => 'GIBRALTAR',
+ 'GR' => 'GREECE',
+ 'GL' => 'GREENLAND',
+ 'GD' => 'GRENADA',
+ 'GP' => 'GUADELOUPE',
+ 'GU' => 'GUAM',
+ 'GT' => 'GUATEMALA',
+ 'GN' => 'GUINEA',
+ 'GW' => 'GUINEA-BISSAU',
+ 'GY' => 'GUYANA',
+ 'HT' => 'HAITI',
+ 'HM' => 'HEARD ISLAND AND MCDONALD ISLANDS',
+ 'VA' => 'HOLY SEE (VATICAN CITY STATE)',
+ 'HN' => 'HONDURAS',
+ 'HK' => 'HONG KONG',
+ 'HU' => 'HUNGARY',
+ 'IS' => 'ICELAND',
+ 'IN' => 'INDIA',
+ 'ID' => 'INDONESIA',
+ 'IR' => 'IRAN, ISLAMIC REPUBLIC OF',
+ 'IQ' => 'IRAQ',
+ 'IE' => 'IRELAND',
+ 'IL' => 'ISRAEL',
+ 'IT' => 'ITALY',
+ 'JM' => 'JAMAICA',
+ 'JP' => 'JAPAN',
+ 'JO' => 'JORDAN',
+ 'KZ' => 'KAZAKSTAN',
+ 'KE' => 'KENYA',
+ 'KI' => 'KIRIBATI',
+ 'KP' => 'KOREA DEMOCRATIC PEOPLES REPUBLIC OF',
+ 'KR' => 'KOREA REPUBLIC OF',
+ 'KW' => 'KUWAIT',
+ 'KG' => 'KYRGYZSTAN',
+ 'LA' => 'LAO PEOPLES DEMOCRATIC REPUBLIC',
+ 'LV' => 'LATVIA',
+ 'LB' => 'LEBANON',
+ 'LS' => 'LESOTHO',
+ 'LR' => 'LIBERIA',
+ 'LY' => 'LIBYAN ARAB JAMAHIRIYA',
+ 'LI' => 'LIECHTENSTEIN',
+ 'LT' => 'LITHUANIA',
+ 'LU' => 'LUXEMBOURG',
+ 'MO' => 'MACAU',
+ 'MK' => 'MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF',
+ 'MG' => 'MADAGASCAR',
+ 'MW' => 'MALAWI',
+ 'MY' => 'MALAYSIA',
+ 'MV' => 'MALDIVES',
+ 'ML' => 'MALI',
+ 'MT' => 'MALTA',
+ 'MH' => 'MARSHALL ISLANDS',
+ 'MQ' => 'MARTINIQUE',
+ 'MR' => 'MAURITANIA',
+ 'MU' => 'MAURITIUS',
+ 'YT' => 'MAYOTTE',
+ 'MX' => 'MEXICO',
+ 'FM' => 'MICRONESIA, FEDERATED STATES OF',
+ 'MD' => 'MOLDOVA, REPUBLIC OF',
+ 'MC' => 'MONACO',
+ 'MN' => 'MONGOLIA',
+ 'MS' => 'MONTSERRAT',
+ 'MA' => 'MOROCCO',
+ 'MZ' => 'MOZAMBIQUE',
+ 'MM' => 'MYANMAR',
+ 'NA' => 'NAMIBIA',
+ 'NR' => 'NAURU',
+ 'NP' => 'NEPAL',
+ 'NL' => 'NETHERLANDS',
+ 'AN' => 'NETHERLANDS ANTILLES',
+ 'NC' => 'NEW CALEDONIA',
+ 'NZ' => 'NEW ZEALAND',
+ 'NI' => 'NICARAGUA',
+ 'NE' => 'NIGER',
+ 'NG' => 'NIGERIA',
+ 'NU' => 'NIUE',
+ 'NF' => 'NORFOLK ISLAND',
+ 'MP' => 'NORTHERN MARIANA ISLANDS',
+ 'NO' => 'NORWAY',
+ 'OM' => 'OMAN',
+ 'PK' => 'PAKISTAN',
+ 'PW' => 'PALAU',
+ 'PS' => 'PALESTINIAN TERRITORY, OCCUPIED',
+ 'PA' => 'PANAMA',
+ 'PG' => 'PAPUA NEW GUINEA',
+ 'PY' => 'PARAGUAY',
+ 'PE' => 'PERU',
+ 'PH' => 'PHILIPPINES',
+ 'PN' => 'PITCAIRN',
+ 'PL' => 'POLAND',
+ 'PT' => 'PORTUGAL',
+ 'PR' => 'PUERTO RICO',
+ 'QA' => 'QATAR',
+ 'RE' => 'REUNION',
+ 'RO' => 'ROMANIA',
+ 'RU' => 'RUSSIAN FEDERATION',
+ 'RW' => 'RWANDA',
+ 'SH' => 'SAINT HELENA',
+ 'KN' => 'SAINT KITTS AND NEVIS',
+ 'LC' => 'SAINT LUCIA',
+ 'PM' => 'SAINT PIERRE AND MIQUELON',
+ 'VC' => 'SAINT VINCENT AND THE GRENADINES',
+ 'WS' => 'SAMOA',
+ 'SM' => 'SAN MARINO',
+ 'ST' => 'SAO TOME AND PRINCIPE',
+ 'SA' => 'SAUDI ARABIA',
+ 'SN' => 'SENEGAL',
+ 'SC' => 'SEYCHELLES',
+ 'SL' => 'SIERRA LEONE',
+ 'SG' => 'SINGAPORE',
+ 'SK' => 'SLOVAKIA',
+ 'SI' => 'SLOVENIA',
+ 'SB' => 'SOLOMON ISLANDS',
+ 'SO' => 'SOMALIA',
+ 'ZA' => 'SOUTH AFRICA',
+ 'GS' => 'SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS',
+ 'ES' => 'SPAIN',
+ 'LK' => 'SRI LANKA',
+ 'SD' => 'SUDAN',
+ 'SR' => 'SURINAME',
+ 'SJ' => 'SVALBARD AND JAN MAYEN',
+ 'SZ' => 'SWAZILAND',
+ 'SE' => 'SWEDEN',
+ 'CH' => 'SWITZERLAND',
+ 'SY' => 'SYRIAN ARAB REPUBLIC',
+ 'TW' => 'TAIWAN, PROVINCE OF CHINA',
+ 'TJ' => 'TAJIKISTAN',
+ 'TZ' => 'TANZANIA, UNITED REPUBLIC OF',
+ 'TH' => 'THAILAND',
+ 'TG' => 'TOGO',
+ 'TK' => 'TOKELAU',
+ 'TO' => 'TONGA',
+ 'TT' => 'TRINIDAD AND TOBAGO',
+ 'TN' => 'TUNISIA',
+ 'TR' => 'TURKEY',
+ 'TM' => 'TURKMENISTAN',
+ 'TC' => 'TURKS AND CAICOS ISLANDS',
+ 'TV' => 'TUVALU',
+ 'UG' => 'UGANDA',
+ 'UA' => 'UKRAINE',
+ 'AE' => 'UNITED ARAB EMIRATES',
+ 'GB' => 'UNITED KINGDOM',
+ 'US' => 'UNITED STATES',
+ 'UM' => 'UNITED STATES MINOR OUTLYING ISLANDS',
+ 'UY' => 'URUGUAY',
+ 'UZ' => 'UZBEKISTAN',
+ 'VU' => 'VANUATU',
+ 'VE' => 'VENEZUELA',
+ 'VN' => 'VIET NAM',
+ 'VG' => 'VIRGIN ISLANDS, BRITISH',
+ 'VI' => 'VIRGIN ISLANDS, U.S.',
+ 'WF' => 'WALLIS AND FUTUNA',
+ 'EH' => 'WESTERN SAHARA',
+ 'YE' => 'YEMEN',
+ 'YU' => 'YUGOSLAVIA',
+ 'ZM' => 'ZAMBIA',
+ 'ZW' => 'ZIMBABWE',
+ );
}
diff --git a/demo/api/countrySearch.php b/demo/api/countrySearch.php
index af3a0c4..b34d19d 100644
--- a/demo/api/countrySearch.php
+++ b/demo/api/countrySearch.php
@@ -6,13 +6,13 @@
$phrase = "";
-if(isset($_GET['phrase'])) {
+if (isset($_GET['phrase'])) {
$phrase = $_GET['phrase'];
}
$dataType = "json";
-if(isset($_GET['dataType'])) {
+if (isset($_GET['dataType'])) {
$dataType = $_GET['dataType'];
}
@@ -21,22 +21,22 @@
foreach ($countries as $key => $country) {
if ($phrase == "" || stristr($country, $phrase) != false) {
- array_push($found_countries , $country);
+ array_push($found_countries, $country);
}
}
-switch($dataType) {
+switch ($dataType) {
case "json":
$json = '[';
- foreach($found_countries as $key => $country) {
+ foreach ($found_countries as $key => $country) {
$json .= '{"name": "' . $country . '"}';
if ($country !== end($found_countries)) {
- $json .= ',';
+ $json .= ',';
}
}
@@ -46,13 +46,13 @@
header('Content-Type: application/json');
echo $json;
- break;
+ break;
case "xml":
- $xml = '' . "\n";
+ $xml = '' . "\n";
$xml .= '';
- foreach($found_countries as $key => $country) {
+ foreach ($found_countries as $key => $country) {
$xml .= '' . $country . '';
}
@@ -61,10 +61,10 @@
header('Content-Type: text/xml');
echo $xml;
- break;
+ break;
default:
- break;
+ break;
}
diff --git a/demo/example_categories.html b/demo/example_categories.html
index 1eda5fd..8737559 100644
--- a/demo/example_categories.html
+++ b/demo/example_categories.html
@@ -1,46 +1,47 @@
-
- EasyAutocomplete categories
-
-
-
-
-
-
-
+
+ EasyAutocomplete categories
+
+
+
+
+
+
+
- EasyAutocomplete - categories example
+EasyAutocomplete - categories example
-
+
-
+
-
+
diff --git a/demo/example_custom_template.html b/demo/example_custom_template.html
index 21c735b..2e6555f 100644
--- a/demo/example_custom_template.html
+++ b/demo/example_custom_template.html
@@ -1,36 +1,36 @@
-
- EasyAutocomplete custom template example
-
-
-
-
-
+
+ EasyAutocomplete custom template example
+
+
+
+
+
- EasyAutocomplete - custom template example
+EasyAutocomplete - custom template example
-
+
-
+
-
+
diff --git a/demo/example_duckduckgo.html b/demo/example_duckduckgo.html
index eba69ce..17c8298 100644
--- a/demo/example_duckduckgo.html
+++ b/demo/example_duckduckgo.html
@@ -1,37 +1,37 @@
-
- EasyAutocomplete duckduckgo example
-
-
-
-
-
+
+ EasyAutocomplete duckduckgo example
+
+
+
+
+
- EasyAutocomplete - duckduckgo example
+EasyAutocomplete - duckduckgo example
-
+
-
+
-
+
diff --git a/demo/example_email.html b/demo/example_email.html
index f09c803..2744b54 100644
--- a/demo/example_email.html
+++ b/demo/example_email.html
@@ -1,44 +1,44 @@
-
- EasyAutocomplete email example
-
-
-
-
-
+
+ EasyAutocomplete email example
+
+
+
+
+
- EasyAutocomplete - email example
+EasyAutocomplete - email example
-
+
-
+
-
+
diff --git a/demo/example_flags.html b/demo/example_flags.html
index 2dc1cb6..bf9511a 100644
--- a/demo/example_flags.html
+++ b/demo/example_flags.html
@@ -1,44 +1,44 @@
-
- EasyAutocomplete json example
-
-
-
-
-
-
+
+ EasyAutocomplete json example
+
+
+
+
+
+
- EasyAutocomplete - country flags example
+EasyAutocomplete - country flags example
-
+
-
+
-
+
diff --git a/demo/example_json.html b/demo/example_json.html
index 6b3ed28..1628ed2 100644
--- a/demo/example_json.html
+++ b/demo/example_json.html
@@ -1,35 +1,35 @@
-
- EasyAutocomplete json example
-
-
-
-
-
+
+ EasyAutocomplete json example
+
+
+
+
+
- EasyAutocomplete - json example
+EasyAutocomplete - json example
-
+
-
+
-
+
diff --git a/demo/example_remote.html b/demo/example_remote.html
index 142c762..e2c2259 100644
--- a/demo/example_remote.html
+++ b/demo/example_remote.html
@@ -1,33 +1,33 @@
-
- EasyAutocomplete remote example
-
-
-
-
-
+
+ EasyAutocomplete remote example
+
+
+
+
+
- EasyAutocomplete - remote example
+EasyAutocomplete - remote example
-
+
-
+
-
+
-
+
diff --git a/demo/example_simple.html b/demo/example_simple.html
index a1fcbb4..36985ab 100644
--- a/demo/example_simple.html
+++ b/demo/example_simple.html
@@ -1,28 +1,28 @@
-
- EasyAutocomplete simple example
-
-
-
-
-
+
+ EasyAutocomplete simple example
+
+
+
+
+
- EasyAutocomplete - easy example
+EasyAutocomplete - easy example
-
+
-
+
-
+
diff --git a/demo/example_static_link.html b/demo/example_static_link.html
index 7fced54..58d1914 100644
--- a/demo/example_static_link.html
+++ b/demo/example_static_link.html
@@ -1,44 +1,44 @@
-
- EasyAutocomplete static links
-
-
-
-
-
+
+ EasyAutocomplete static links
+
+
+
+
+
- EasyAutocomplete - static links
+EasyAutocomplete - static links
-
+
-
+
-
+
diff --git a/demo/example_theme.html b/demo/example_theme.html
index 2356333..16729c7 100644
--- a/demo/example_theme.html
+++ b/demo/example_theme.html
@@ -1,43 +1,44 @@
-
- EasyAutocomplete json example
-
-
-
-
-
-
-
+
+ EasyAutocomplete json example
+
+
+
+
+
+
+
- EasyAutocomplete - css themes
+EasyAutocomplete - css themes
-
+
-
+
-
+
diff --git a/demo/example_theme_funky.html b/demo/example_theme_funky.html
index eece84a..73bf552 100644
--- a/demo/example_theme_funky.html
+++ b/demo/example_theme_funky.html
@@ -1,105 +1,105 @@
-
- EasyAutocomplete json example
-
-
-
-
-
-
-
-
- EasyAutocomplete - css themes
-
-
-
-
+
+
+
+
+EasyAutocomplete - css themes
+
+
+
+
+
-
+