diff --git a/dist/jquery.easy-autocomplete.js b/dist/jquery.easy-autocomplete.js index 88f2951..3066d26 100644 --- a/dist/jquery.easy-autocomplete.js +++ b/dist/jquery.easy-autocomplete.js @@ -8,7 +8,7 @@ */ /* - * EasyAutocomplete - Configuration + * EasyAutocomplete - Configuration */ var EasyAutocomplete = (function(scope){ @@ -88,7 +88,7 @@ var EasyAutocomplete = (function(scope){ onChooseEvent: function() {}, onKeyEnterEvent: function() {}, onMouseOverEvent: function() {}, - onMouseOutEvent: function() {}, + onMouseOutEvent: function() {}, onShowListEvent: function() {}, onHideListEvent: function() {} }, @@ -120,7 +120,7 @@ var EasyAutocomplete = (function(scope){ }] }; - + var externalObjects = ["ajaxSettings", "template"]; this.get = function(propertyName) { @@ -132,8 +132,8 @@ var EasyAutocomplete = (function(scope){ if (defaults[name] === value) { return true; } - } - + } + return false; }; @@ -163,7 +163,7 @@ var EasyAutocomplete = (function(scope){ mergeOptions(); if (defaults.loggerEnabled === true) { - printPropertiesThatDoesntExist(console, options); + printPropertiesThatDoesntExist(console, options); } addAjaxSettings(); @@ -172,19 +172,19 @@ var EasyAutocomplete = (function(scope){ function prepareDefaults() { if (options.dataType === "xml") { - + if (!options.getValue) { options.getValue = function(element) { - return $(element).text(); + return jQuery(element).text(); }; } - + if (!options.list) { options.list = {}; - } + } if (!options.list.sort) { options.list.sort = {}; @@ -221,7 +221,7 @@ var EasyAutocomplete = (function(scope){ var categories = []; - for (var i = 0, length = options.categories.length; i < length; i += 1) { + for (var i = 0, length = options.categories.length; i < length; i += 1) { var category = options.categories[i]; @@ -249,7 +249,7 @@ var EasyAutocomplete = (function(scope){ for (var propertyName in source) { if (target[propertyName] !== undefined && target[propertyName] !== null) { - if (typeof target[propertyName] !== "object" || + if (typeof target[propertyName] !== "object" || target[propertyName] instanceof Array) { mergedObject[propertyName] = target[propertyName]; } else { @@ -257,7 +257,7 @@ var EasyAutocomplete = (function(scope){ } } } - + /* If data is an object */ if (target.data !== undefined && target.data !== null && typeof target.data === "object") { mergedObject.data = target.data; @@ -265,11 +265,11 @@ var EasyAutocomplete = (function(scope){ return mergedObject; } - } + } function processAfterMerge() { - + if (defaults.url !== "list-required" && typeof defaults.url !== "function") { var defaultUrl = defaults.url; defaults.url = function() { @@ -289,12 +289,12 @@ var EasyAutocomplete = (function(scope){ if (defaults.dataType.toUpperCase() === "XML") { defaults.listLocation = function(data) { - return $(data).find(defaultlistLocation); + return jQuery(data).find(defaultlistLocation); }; } else { defaults.listLocation = function(data) { return data[defaultlistLocation]; - }; + }; } } @@ -316,9 +316,9 @@ var EasyAutocomplete = (function(scope){ if (options.ajaxSettings !== undefined && typeof options.ajaxSettings === "object") { defaults.ajaxSettings = options.ajaxSettings; } else { - defaults.ajaxSettings = {}; + defaults.ajaxSettings = {}; } - + } function isAssigned(name) { @@ -329,19 +329,19 @@ var EasyAutocomplete = (function(scope){ } } function printPropertiesThatDoesntExist(consol, optionsToCheck) { - + checkPropertiesIfExist(defaults, optionsToCheck); function checkPropertiesIfExist(source, target) { for(var property in target) { if (source[property] === undefined) { - consol.log("Property '" + property + "' does not exist in EasyAutocomplete options API."); + consol.log("Property '" + property + "' does not exist in EasyAutocomplete options API."); } - if (typeof source[property] === "object" && $.inArray(property, externalObjects) === -1) { + if (typeof source[property] === "object" && jQuery.inArray(property, externalObjects) === -1) { checkPropertiesIfExist(source[property], target[property]); } - } + } } } }; @@ -396,9 +396,9 @@ var EasyAutocomplete = (function(scope){ })(EasyAutocomplete || {}); /* - * EasyAutocomplete - ListBuilderService + * EasyAutocomplete - ListBuilderService * - * @author Łukasz Pawełczak + * @author Łukasz Pawełczak * */ var EasyAutocomplete = (function(scope) { @@ -414,14 +414,14 @@ var EasyAutocomplete = (function(scope) { builder.getValue = configuration.get("getValue"); builder.maxListSize = configuration.get("list").maxNumberOfElements; - + listBuilder.push(builder); return listBuilder; }; this.updateCategories = function(listBuilder, data) { - + if (configuration.get("categoriesAssigned")) { listBuilder = []; @@ -433,7 +433,7 @@ var EasyAutocomplete = (function(scope) { listBuilder.push(builder); } - } + } return listBuilder; }; @@ -466,7 +466,7 @@ var EasyAutocomplete = (function(scope) { if (listBuilders[i].data.length > 0) { return true; } - } + } } return false; @@ -484,7 +484,7 @@ var EasyAutocomplete = (function(scope) { builder = convertDataToListBuilder(); } - + if (category.header !== undefined) { builder.header = category.header; @@ -511,9 +511,9 @@ var EasyAutocomplete = (function(scope) { } } else { - builder.getValue = configuration.get("getValue"); + builder.getValue = configuration.get("getValue"); } - + return builder; @@ -537,7 +537,7 @@ var EasyAutocomplete = (function(scope) { if (listLocation !== undefined) { if (typeof listLocation === "string") { - builder.data = $(data).find(listLocation); + builder.data = jQuery(data).find(listLocation); } else if (typeof listLocation === "function") { builder.data = listLocation(data); @@ -578,7 +578,7 @@ var EasyAutocomplete = (function(scope) { } - $(builder.data).find(builder.xmlElementName).each(function() { + jQuery(builder.data).find(builder.xmlElementName).each(function() { simpleList.push(this); }); @@ -882,9 +882,9 @@ var EasyAutocomplete = (function(scope){ */ var EasyAutocomplete = (function(scope) { - + scope.main = function Core($input, options) { - + var module = { name: "EasyAutocomplete", shortcut: "eac" @@ -897,7 +897,7 @@ var EasyAutocomplete = (function(scope) { listBuilderService = new scope.ListBuilderService(config, scope.proccess), checkParam = config.equals, - $field = $input, + $field = $input, $container = "", elementsList = [], selectedElement = -1, @@ -964,31 +964,31 @@ var EasyAutocomplete = (function(scope) { prepareField(); - bindEvents(); + bindEvents(); } function prepareField() { - + if ($field.parent().hasClass(consts.getValue("WRAPPER_CSS_CLASS"))) { removeContainer(); removeWrapper(); - } - + } + createWrapper(); - createContainer(); + createContainer(); - $container = $("#" + getContainerId()); + $container = jQuery("#" + getContainerId()); if (config.get("placeholder")) { $field.attr("placeholder", config.get("placeholder")); } function createWrapper() { - var $wrapper = $("