p('Quick links') ?>
diff --git a/bl-kernel/boot/rules/60.plugins.php b/bl-kernel/boot/rules/60.plugins.php
index 89f7cccb..5d12ccd4 100644
--- a/bl-kernel/boot/rules/60.plugins.php
+++ b/bl-kernel/boot/rules/60.plugins.php
@@ -24,10 +24,11 @@ $plugins = array(
'adminContentSidebar'=>array(),
'dashboard'=>array(),
- 'beforeRulesLoad'=>array(),
'beforeAll'=>array(),
'afterAll'=>array(),
+ 'paginator'=>array(),
+
'afterPageCreate'=>array(),
'afterPageModify'=>array(),
'afterPageDelete'=>array(),
diff --git a/bl-kernel/boot/rules/99.paginator.php b/bl-kernel/boot/rules/99.paginator.php
index cd1ffb12..6324398e 100644
--- a/bl-kernel/boot/rules/99.paginator.php
+++ b/bl-kernel/boot/rules/99.paginator.php
@@ -4,25 +4,25 @@
$currentPage = $url->pageNumber();
Paginator::set('currentPage', $currentPage);
-if($url->whereAmI()=='admin') {
+if ($url->whereAmI()=='admin') {
$itemsPerPage = ITEMS_PER_PAGE_ADMIN;
$numberOfItems = $pages->count(true);
-}
-elseif($url->whereAmI()=='tag') {
+} elseif ($url->whereAmI()=='tag') {
$itemsPerPage = $site->itemsPerPage();
$tagKey = $url->slug();
$numberOfItems = $tags->numberOfPages($tagKey);
-}
-elseif($url->whereAmI()=='category') {
+} elseif ($url->whereAmI()=='category') {
$itemsPerPage = $site->itemsPerPage();
$categoryKey = $url->slug();
$numberOfItems = $categories->numberOfPages($categoryKey);
-}
-else {
+} else {
$itemsPerPage = $site->itemsPerPage();
$numberOfItems = $pages->count(true);
}
+// Execute hook from plugins
+Theme::plugins('paginator');
+
// Items per page
Paginator::set('itemsPerPage', $itemsPerPage);
diff --git a/bl-kernel/boot/site.php b/bl-kernel/boot/site.php
index 5616c768..e41590dc 100644
--- a/bl-kernel/boot/site.php
+++ b/bl-kernel/boot/site.php
@@ -33,4 +33,3 @@ Theme::plugins('afterSiteLoad');
// Plugins after all
Theme::plugins('afterAll');
-
diff --git a/bl-kernel/helpers/text.class.php b/bl-kernel/helpers/text.class.php
index 59c89f3a..ec1e4573 100644
--- a/bl-kernel/helpers/text.class.php
+++ b/bl-kernel/helpers/text.class.php
@@ -190,14 +190,18 @@ class Text {
}
// Find position of first occurrence of substring in a string otherwise returns FALSE.
- public static function stringPosition($string, $substring)
+ public static function stringPosition($string, $substring, $caseSensitive=true)
{
- return mb_strpos($string, $substring, 0, CHARSET);
+ if ($caseSensitive) {
+ return mb_strpos($string, $substring, 0, CHARSET);
+ }
+
+ return mb_stripos($string, $substring, 0, CHARSET);
}
- public static function stringContains($string, $substring)
+ public static function stringContains($string, $substring, $caseSensitive=true)
{
- return (self::stringPosition($string, $substring) !== false);
+ return (self::stringPosition($string, $substring, $caseSensitive) !== false);
}
// Returns the portion of string specified by the start and length parameters.
diff --git a/bl-kernel/site.class.php b/bl-kernel/site.class.php
index 178a941c..93d9949c 100644
--- a/bl-kernel/site.class.php
+++ b/bl-kernel/site.class.php
@@ -248,8 +248,6 @@ class Site extends dbJSON {
return $this->getField('url');
}
-
-
// Returns the protocol and the domain, without the base url
// For example, http://www.domain.com
public function domain()
diff --git a/bl-languages/en.json b/bl-languages/en.json
index 4938c77f..e983372e 100644
--- a/bl-languages/en.json
+++ b/bl-languages/en.json
@@ -356,5 +356,8 @@
"last": "Last",
"there-are-no-pages-at-this-moment": "There are no pages at this moment.",
"there-are-no-static-pages-at-this-moment": "There are no static pages at this moment.",
- "there-are-no-draft-pages-at-this-moment": "There are no draft pages at this moment."
+ "there-are-no-draft-pages-at-this-moment": "There are no draft pages at this moment.",
+ "good-morning": "Good morning!",
+ "good-afternoon": "Good afternoon!",
+ "good-evening": "Good evening!"
}
\ No newline at end of file
diff --git a/bl-plugins/search/css/easy-autocomplete.css b/bl-plugins/search/css/easy-autocomplete.css
new file mode 100755
index 00000000..3351771b
--- /dev/null
+++ b/bl-plugins/search/css/easy-autocomplete.css
@@ -0,0 +1,320 @@
+/*
+ * easy-autocomplete
+ * jQuery plugin for autocompletion
+ *
+ * @author Łukasz Pawełczak (http://github.com/pawelczak)
+ * @version 1.3.5
+ * Copyright License:
+ */
+
+.easy-autocomplete {
+ position: relative;
+}
+.easy-autocomplete input {
+ border-color: #ccc;
+ border-radius: 4px;
+ border-style: solid;
+ border-width: 1px;
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
+ color: #555;
+ float: none;
+ padding: 6px 12px;
+}
+.easy-autocomplete input:hover, .easy-autocomplete input:focus {
+ box-shadow: none;
+}
+.easy-autocomplete a {
+ display: block;
+}
+.easy-autocomplete.eac-blue-light input:hover, .easy-autocomplete.eac-blue-light input:focus {
+ border-color: #66afe9;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(102, 175, 233, 0.6);
+}
+.easy-autocomplete.eac-blue-light ul {
+ border-color: #66afe9;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(102, 175, 233, 0.6);
+}
+.easy-autocomplete.eac-blue-light ul li, .easy-autocomplete.eac-blue-light ul .eac-category {
+ border-color: #66afe9;
+}
+.easy-autocomplete.eac-blue-light ul li.selected, .easy-autocomplete.eac-blue-light ul .eac-category.selected {
+ background-color: #ecf5fc;
+}
+.easy-autocomplete.eac-green-light input:hover, .easy-autocomplete.eac-green-light input:focus {
+ border-color: #41DB00;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(146, 237, 107, 0.6);
+}
+.easy-autocomplete.eac-green-light ul {
+ border-color: #41DB00;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(146, 237, 107, 0.6);
+}
+.easy-autocomplete.eac-green-light ul li, .easy-autocomplete.eac-green-light ul .eac-category {
+ border-color: #41DB00;
+}
+.easy-autocomplete.eac-green-light ul li.selected, .easy-autocomplete.eac-green-light ul .eac-category.selected {
+ background-color: #9eff75;
+}
+.easy-autocomplete.eac-red-light input:hover, .easy-autocomplete.eac-red-light input:focus {
+ border-color: #ff5b5b;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(255, 90, 90, 0.6);
+}
+.easy-autocomplete.eac-red-light ul {
+ border-color: #ff5b5b;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(255, 90, 90, 0.6);
+}
+.easy-autocomplete.eac-red-light ul li, .easy-autocomplete.eac-red-light ul .eac-category {
+ border-color: #ff5b5b;
+}
+.easy-autocomplete.eac-red-light ul li.selected, .easy-autocomplete.eac-red-light ul .eac-category.selected {
+ background-color: #ff8e8e;
+}
+.easy-autocomplete.eac-yellow-light input:hover, .easy-autocomplete.eac-yellow-light input:focus {
+ border-color: #ffdb00;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(255, 231, 84, 0.6);
+}
+.easy-autocomplete.eac-yellow-light ul {
+ border-color: #ffdb00;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(255, 231, 84, 0.6);
+}
+.easy-autocomplete.eac-yellow-light ul li, .easy-autocomplete.eac-yellow-light ul .eac-category {
+ border-color: #ffdb00;
+}
+.easy-autocomplete.eac-yellow-light ul li.selected, .easy-autocomplete.eac-yellow-light ul .eac-category.selected {
+ background-color: #ffe233;
+}
+.easy-autocomplete.eac-dark-light input:hover, .easy-autocomplete.eac-dark-light input:focus {
+ border-color: #333;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(55, 55, 55, 0.6);
+}
+.easy-autocomplete.eac-dark-light ul {
+ border-color: #333;
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(55, 55, 55, 0.6);
+}
+.easy-autocomplete.eac-dark-light ul li, .easy-autocomplete.eac-dark-light ul .eac-category {
+ border-color: #333;
+}
+.easy-autocomplete.eac-dark-light ul li.selected, .easy-autocomplete.eac-dark-light ul .eac-category.selected {
+ background-color: #4d4d4d;
+ color: #fff;
+}
+.easy-autocomplete.eac-dark {
+ color: #fff;
+}
+.easy-autocomplete.eac-dark input {
+ background-color: #404040;
+ border-radius: 4px;
+ box-shadow: 0;
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-dark input:hover, .easy-autocomplete.eac-dark input:focus {
+ border-color: #333;
+ box-shadow: 0;
+}
+.easy-autocomplete.eac-dark ul {
+ border-color: #333;
+}
+.easy-autocomplete.eac-dark ul li, .easy-autocomplete.eac-dark ul .eac-category {
+ background-color: #404040;
+ border-color: #333;
+}
+.easy-autocomplete.eac-dark ul li.selected, .easy-autocomplete.eac-dark ul .eac-category.selected {
+ background-color: #737373;
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-dark-glass {
+ color: #fff;
+}
+.easy-autocomplete.eac-dark-glass input {
+ background-color: rgba(0, 0, 0, 0.8);
+ border-radius: 4px;
+ box-shadow: 0;
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-dark-glass input:hover, .easy-autocomplete.eac-dark-glass input:focus {
+ border-color: rgba(0, 0, 0, 0.8);
+ box-shadow: 0;
+}
+.easy-autocomplete.eac-dark-glass ul {
+ border-color: rgba(0, 0, 0, 0.8);
+}
+.easy-autocomplete.eac-dark-glass ul li, .easy-autocomplete.eac-dark-glass ul .eac-category {
+ background-color: rgba(0, 0, 0, 0.8);
+ border-color: rgba(0, 0, 0, 0.8);
+}
+.easy-autocomplete.eac-dark-glass ul li.selected, .easy-autocomplete.eac-dark-glass ul .eac-category.selected {
+ background-color: rgba(64, 64, 64, 0.8);
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-dark-glass ul li:last-child, .easy-autocomplete.eac-dark-glass ul .eac-category:last-child {
+ border-radius: 0 0 4px 4px;
+}
+.easy-autocomplete.eac-blue {
+ color: #fff;
+}
+.easy-autocomplete.eac-blue input {
+ background-color: #6d9ed1;
+ border-radius: 4px;
+ box-shadow: 0;
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-blue input::-webkit-input-placeholder {
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-blue input:-moz-placeholder {
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-blue input::-moz-placeholder {
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-blue input:-ms-input-placeholder {
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-blue input:hover, .easy-autocomplete.eac-blue input:focus {
+ border-color: #5A91CB;
+ box-shadow: 0;
+}
+.easy-autocomplete.eac-blue ul {
+ border-color: #5A91CB;
+}
+.easy-autocomplete.eac-blue ul li, .easy-autocomplete.eac-blue ul .eac-category {
+ background-color: #6d9ed1;
+ border-color: #5A91CB;
+}
+.easy-autocomplete.eac-blue ul li.selected, .easy-autocomplete.eac-blue ul .eac-category.selected {
+ background-color: #94b8dd;
+ color: #f6f6f6;
+}
+.easy-autocomplete.eac-yellow {
+ color: #333;
+}
+.easy-autocomplete.eac-yellow input {
+ background-color: #ffdb7e;
+ border-color: #333;
+ border-radius: 4px;
+ box-shadow: 0;
+ color: #333;
+}
+.easy-autocomplete.eac-yellow input:hover, .easy-autocomplete.eac-yellow input:focus {
+ border-color: #333;
+ box-shadow: 0;
+}
+.easy-autocomplete.eac-yellow ul {
+ border-color: #333;
+}
+.easy-autocomplete.eac-yellow ul li, .easy-autocomplete.eac-yellow ul .eac-category {
+ background-color: #ffdb7e;
+ border-color: #333;
+}
+.easy-autocomplete.eac-yellow ul li.selected, .easy-autocomplete.eac-yellow ul .eac-category.selected {
+ background-color: #ffe9b1;
+ color: #333;
+}
+.easy-autocomplete.eac-purple {
+ color: #333;
+}
+.easy-autocomplete.eac-purple input {
+ background-color: #d6d1e7;
+ border-color: #b8afd5;
+ box-shadow: 0;
+ color: #333;
+}
+.easy-autocomplete.eac-purple input:hover, .easy-autocomplete.eac-purple input:focus {
+ border-color: #333;
+ box-shadow: 0;
+}
+.easy-autocomplete.eac-purple ul {
+ border-color: #333;
+}
+.easy-autocomplete.eac-purple ul li, .easy-autocomplete.eac-purple ul .eac-category {
+ background-color: #d6d1e7;
+ border-color: #333;
+}
+.easy-autocomplete.eac-purple ul li.selected, .easy-autocomplete.eac-purple ul .eac-category.selected {
+ background-color: #ebe8f3;
+ color: #333;
+}
+.easy-autocomplete.eac-bootstrap input {
+ border-color: #ccc;
+ border-radius: 4px;
+ border-style: solid;
+ border-width: 1px;
+ color: #555;
+ padding: 6px 12px;
+}
+
+.easy-autocomplete-container {
+ left: 0;
+ position: absolute;
+ width: 100%;
+ z-index: 2;
+}
+.easy-autocomplete-container ul {
+ background: none repeat scroll 0 0 #ffffff;
+ border-top: 1px dotted #ccc;
+ display: none;
+ margin-top: 0;
+ padding-bottom: 0;
+ padding-left: 0;
+ position: relative;
+ top: -1px;
+}
+.easy-autocomplete-container ul li, .easy-autocomplete-container ul .eac-category {
+ background: inherit;
+ border-color: #ccc;
+ border-image: none;
+ border-style: solid;
+ border-width: 0 1px;
+ display: block;
+ font-size: 14px;
+ font-weight: normal;
+ padding: 4px 12px;
+}
+.easy-autocomplete-container ul li:last-child {
+ border-radius: 0 0 2px 2px;
+ border-width: 0 1px 1px;
+}
+.easy-autocomplete-container ul li.selected {
+ background: none repeat scroll 0 0 #ebebeb;
+ cursor: pointer;
+}
+.easy-autocomplete-container ul li.selected div {
+ font-weight: normal;
+}
+.easy-autocomplete-container ul li div {
+ display: block;
+ font-weight: normal;
+ word-break: break-all;
+}
+.easy-autocomplete-container ul li b {
+ font-weight: bold;
+}
+.easy-autocomplete-container ul .eac-category {
+ font-color: #aaa;
+ font-style: italic;
+}
+
+.eac-description .eac-item span {
+ color: #aaa;
+ font-style: italic;
+ font-size: 0.9em;
+}
+
+.eac-icon-left .eac-item img {
+ margin-right: 4px;
+ max-height: 30px;
+}
+
+.eac-icon-right .eac-item {
+ margin-top: 8px;
+ min-height: 24px;
+ position: relative;
+}
+.eac-icon-right .eac-item img {
+ margin-left: 4px;
+ max-height: 30px;
+ position: absolute;
+ right: -4px;
+ top: -8px;
+}
+
+/*# sourceMappingURL=easy-autocomplete.css.map */
diff --git a/bl-plugins/search/css/easy-autocomplete.min.css b/bl-plugins/search/css/easy-autocomplete.min.css
new file mode 100755
index 00000000..b5c08750
--- /dev/null
+++ b/bl-plugins/search/css/easy-autocomplete.min.css
@@ -0,0 +1,11 @@
+/*
+ * easy-autocomplete
+ * jQuery plugin for autocompletion
+ *
+ * @author Łukasz Pawełczak (http://github.com/pawelczak)
+ * @version 1.3.5
+ * Copyright License:
+ */
+
+.easy-autocomplete{position:relative}.easy-autocomplete input{border-color:#ccc;border-radius:4px;border-style:solid;border-width:1px;box-shadow:0 1px 2px rgba(0,0,0,0.1) inset;color:#555;float:none;padding:6px 12px}.easy-autocomplete input:hover,.easy-autocomplete input:focus{box-shadow:none}.easy-autocomplete a{display:block}.easy-autocomplete.eac-blue-light input:hover,.easy-autocomplete.eac-blue-light input:focus{border-color:#66afe9;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(102,175,233,0.6)}.easy-autocomplete.eac-blue-light ul{border-color:#66afe9;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(102,175,233,0.6)}.easy-autocomplete.eac-blue-light ul li,.easy-autocomplete.eac-blue-light ul .eac-category{border-color:#66afe9}.easy-autocomplete.eac-blue-light ul li.selected,.easy-autocomplete.eac-blue-light ul .eac-category.selected{background-color:#ecf5fc}.easy-autocomplete.eac-green-light input:hover,.easy-autocomplete.eac-green-light input:focus{border-color:#41DB00;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(146,237,107,0.6)}.easy-autocomplete.eac-green-light ul{border-color:#41DB00;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(146,237,107,0.6)}.easy-autocomplete.eac-green-light ul li,.easy-autocomplete.eac-green-light ul .eac-category{border-color:#41DB00}.easy-autocomplete.eac-green-light ul li.selected,.easy-autocomplete.eac-green-light ul .eac-category.selected{background-color:#9eff75}.easy-autocomplete.eac-red-light input:hover,.easy-autocomplete.eac-red-light input:focus{border-color:#ff5b5b;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(255,90,90,0.6)}.easy-autocomplete.eac-red-light ul{border-color:#ff5b5b;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(255,90,90,0.6)}.easy-autocomplete.eac-red-light ul li,.easy-autocomplete.eac-red-light ul .eac-category{border-color:#ff5b5b}.easy-autocomplete.eac-red-light ul li.selected,.easy-autocomplete.eac-red-light ul .eac-category.selected{background-color:#ff8e8e}.easy-autocomplete.eac-yellow-light input:hover,.easy-autocomplete.eac-yellow-light input:focus{border-color:#ffdb00;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(255,231,84,0.6)}.easy-autocomplete.eac-yellow-light ul{border-color:#ffdb00;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(255,231,84,0.6)}.easy-autocomplete.eac-yellow-light ul li,.easy-autocomplete.eac-yellow-light ul .eac-category{border-color:#ffdb00}.easy-autocomplete.eac-yellow-light ul li.selected,.easy-autocomplete.eac-yellow-light ul .eac-category.selected{background-color:#ffe233}.easy-autocomplete.eac-dark-light input:hover,.easy-autocomplete.eac-dark-light input:focus{border-color:#333;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(55,55,55,0.6)}.easy-autocomplete.eac-dark-light ul{border-color:#333;box-shadow:0 1px 1px rgba(0,0,0,0.075) inset,0 0 8px rgba(55,55,55,0.6)}.easy-autocomplete.eac-dark-light ul li,.easy-autocomplete.eac-dark-light ul .eac-category{border-color:#333}.easy-autocomplete.eac-dark-light ul li.selected,.easy-autocomplete.eac-dark-light ul .eac-category.selected{background-color:#4d4d4d;color:#fff}.easy-autocomplete.eac-dark{color:#fff}.easy-autocomplete.eac-dark input{background-color:#404040;border-radius:4px;box-shadow:0;color:#f6f6f6}.easy-autocomplete.eac-dark input:hover,.easy-autocomplete.eac-dark input:focus{border-color:#333;box-shadow:0}.easy-autocomplete.eac-dark ul{border-color:#333}.easy-autocomplete.eac-dark ul li,.easy-autocomplete.eac-dark ul .eac-category{background-color:#404040;border-color:#333}.easy-autocomplete.eac-dark ul li.selected,.easy-autocomplete.eac-dark ul .eac-category.selected{background-color:#737373;color:#f6f6f6}.easy-autocomplete.eac-dark-glass{color:#fff}.easy-autocomplete.eac-dark-glass input{background-color:rgba(0,0,0,0.8);border-radius:4px;box-shadow:0;color:#f6f6f6}.easy-autocomplete.eac-dark-glass input:hover,.easy-autocomplete.eac-dark-glass input:focus{border-color:rgba(0,0,0,0.8);box-shadow:0}.easy-autocomplete.eac-dark-glass ul{border-color:rgba(0,0,0,0.8)}.easy-autocomplete.eac-dark-glass ul li,.easy-autocomplete.eac-dark-glass ul .eac-category{background-color:rgba(0,0,0,0.8);border-color:rgba(0,0,0,0.8)}.easy-autocomplete.eac-dark-glass ul li.selected,.easy-autocomplete.eac-dark-glass ul .eac-category.selected{background-color:rgba(64,64,64,0.8);color:#f6f6f6}.easy-autocomplete.eac-dark-glass ul li:last-child,.easy-autocomplete.eac-dark-glass ul .eac-category:last-child{border-radius:0 0 4px 4px}.easy-autocomplete.eac-blue{color:#fff}.easy-autocomplete.eac-blue input{background-color:#6d9ed1;border-radius:4px;box-shadow:0;color:#f6f6f6}.easy-autocomplete.eac-blue input::-webkit-input-placeholder{color:#f6f6f6}.easy-autocomplete.eac-blue input:-moz-placeholder{color:#f6f6f6}.easy-autocomplete.eac-blue input::-moz-placeholder{color:#f6f6f6}.easy-autocomplete.eac-blue input:-ms-input-placeholder{color:#f6f6f6}.easy-autocomplete.eac-blue input:hover,.easy-autocomplete.eac-blue input:focus{border-color:#5A91CB;box-shadow:0}.easy-autocomplete.eac-blue ul{border-color:#5A91CB}.easy-autocomplete.eac-blue ul li,.easy-autocomplete.eac-blue ul .eac-category{background-color:#6d9ed1;border-color:#5A91CB}.easy-autocomplete.eac-blue ul li.selected,.easy-autocomplete.eac-blue ul .eac-category.selected{background-color:#94b8dd;color:#f6f6f6}.easy-autocomplete.eac-yellow{color:#333}.easy-autocomplete.eac-yellow input{background-color:#ffdb7e;border-color:#333;border-radius:4px;box-shadow:0;color:#333}.easy-autocomplete.eac-yellow input:hover,.easy-autocomplete.eac-yellow input:focus{border-color:#333;box-shadow:0}.easy-autocomplete.eac-yellow ul{border-color:#333}.easy-autocomplete.eac-yellow ul li,.easy-autocomplete.eac-yellow ul .eac-category{background-color:#ffdb7e;border-color:#333}.easy-autocomplete.eac-yellow ul li.selected,.easy-autocomplete.eac-yellow ul .eac-category.selected{background-color:#ffe9b1;color:#333}.easy-autocomplete.eac-purple{color:#333}.easy-autocomplete.eac-purple input{background-color:#d6d1e7;border-color:#b8afd5;box-shadow:0;color:#333}.easy-autocomplete.eac-purple input:hover,.easy-autocomplete.eac-purple input:focus{border-color:#333;box-shadow:0}.easy-autocomplete.eac-purple ul{border-color:#333}.easy-autocomplete.eac-purple ul li,.easy-autocomplete.eac-purple ul .eac-category{background-color:#d6d1e7;border-color:#333}.easy-autocomplete.eac-purple ul li.selected,.easy-autocomplete.eac-purple ul .eac-category.selected{background-color:#ebe8f3;color:#333}.easy-autocomplete.eac-bootstrap input{border-color:#ccc;border-radius:4px;border-style:solid;border-width:1px;color:#555;padding:6px 12px}.easy-autocomplete-container{left:0;position:absolute;width:100%;z-index:2}.easy-autocomplete-container ul{background:none repeat scroll 0 0 #ffffff;border-top:1px dotted #ccc;display:none;margin-top:0;padding-bottom:0;padding-left:0;position:relative;top:-1px}.easy-autocomplete-container ul li,.easy-autocomplete-container ul .eac-category{background:inherit;border-color:#ccc;border-image:none;border-style:solid;border-width:0 1px;display:block;font-size:14px;font-weight:normal;padding:4px 12px}.easy-autocomplete-container ul li:last-child{border-radius:0 0 2px 2px;border-width:0 1px 1px}.easy-autocomplete-container ul li.selected{background:none repeat scroll 0 0 #ebebeb;cursor:pointer}.easy-autocomplete-container ul li.selected div{font-weight:normal}.easy-autocomplete-container ul li div{display:block;font-weight:normal;word-break:break-all}.easy-autocomplete-container ul li b{font-weight:bold}.easy-autocomplete-container ul .eac-category{font-color:#aaa;font-style:italic}.eac-description .eac-item span{color:#aaa;font-style:italic;font-size:0.9em}.eac-icon-left .eac-item img{margin-right:4px;max-height:30px}.eac-icon-right .eac-item{margin-top:8px;min-height:24px;position:relative}.eac-icon-right .eac-item img{margin-left:4px;max-height:30px;position:absolute;right:-4px;top:-8px}
+/*# sourceMappingURL=easy-autocomplete.min.css.map */
diff --git a/bl-plugins/search/css/easy-autocomplete.themes.css b/bl-plugins/search/css/easy-autocomplete.themes.css
new file mode 100755
index 00000000..e005d7a9
--- /dev/null
+++ b/bl-plugins/search/css/easy-autocomplete.themes.css
@@ -0,0 +1,208 @@
+/*
+ * easy-autocomplete
+ * jQuery plugin for autocompletion
+ *
+ * @author Łukasz Pawełczak (http://github.com/pawelczak)
+ * @version 1.3.5
+ * Copyright License:
+ */
+
+.easy-autocomplete {
+ /* Theme Square */
+ /* Round */
+ /* Funky */
+ /* Solid */
+ /* Plate */
+}
+.easy-autocomplete.eac-square {
+ font-family: "Roboto", "Helvetica Neue",Helvetica,Arial,sans-serif;
+}
+.easy-autocomplete.eac-square input {
+ border: 1px solid #7f8c8d;
+ border-radius: 0;
+ color: #7f8c8d;
+ font-family: inherit;
+ font-size: 18px;
+ font-style: italic;
+ font-weight: 300;
+ margin: 0;
+ min-width: 350px;
+ padding: 12px 43px 12px 15px;
+}
+.easy-autocomplete.eac-square ul {
+ border-color: #7f8c8d;
+ border-top: 0;
+ box-shadow: none;
+ top: 0;
+}
+.easy-autocomplete.eac-square ul li, .easy-autocomplete.eac-square ul .eac-category {
+ border-color: #7f8c8d;
+ font-family: inherit;
+ font-size: 16px;
+ font-weight: 300;
+ padding: 6px 12px;
+ transition: all 0.4s ease 0s;
+}
+.easy-autocomplete.eac-square ul li *, .easy-autocomplete.eac-square ul .eac-category * {
+ font-weight: 300;
+}
+.easy-autocomplete.eac-square ul li.selected, .easy-autocomplete.eac-square ul .eac-category.selected {
+ background-color: #f1f1f1;
+ font-weight: 300;
+}
+.easy-autocomplete.eac-square ul li b, .easy-autocomplete.eac-square ul .eac-category b {
+ font-weight: 600;
+}
+.easy-autocomplete.eac-round {
+ font-family: "Open Sans", "Helvetica Neue",Helvetica,Arial,sans-serif;
+}
+.easy-autocomplete.eac-round input {
+ border: 2px solid #888;
+ border-radius: 10px;
+ color: #888;
+ font-family: inherit;
+ font-size: 16px;
+ font-weight: 400;
+ margin: 0;
+ min-width: 300px;
+ padding: 10px;
+}
+.easy-autocomplete.eac-round input:hover, .easy-autocomplete.eac-round input:focus {
+ border-color: #3079ed;
+}
+.easy-autocomplete.eac-round ul {
+ background: none;
+ border-color: #888;
+ border-width: 0;
+ box-shadow: none;
+ min-width: 300px;
+ top: 20px;
+}
+.easy-autocomplete.eac-round ul li, .easy-autocomplete.eac-round ul .eac-category {
+ background: #fff;
+ border-color: #3079ed;
+ border-width: 0 2px;
+ font-size: 14px;
+ padding: 8px 12px;
+ transition: all 0.4s ease 0s;
+}
+.easy-autocomplete.eac-round ul li.selected, .easy-autocomplete.eac-round ul .eac-category.selected {
+ background-color: #d4e3fb;
+}
+.easy-autocomplete.eac-round ul li:first-child, .easy-autocomplete.eac-round ul .eac-category:first-child {
+ border-radius: 10px 10px 0 0;
+ border-width: 2px 2px 0;
+}
+.easy-autocomplete.eac-round ul li:last-child, .easy-autocomplete.eac-round ul .eac-category:last-child {
+ border-radius: 0 0 10px 10px;
+ border-width: 0 2px 2px;
+}
+.easy-autocomplete.eac-round ul li b, .easy-autocomplete.eac-round ul .eac-category b {
+ font-weight: 700;
+}
+.easy-autocomplete.eac-funky {
+ font-family: "Inconsolata", "Helvetica Neue",Helvetica,Arial,sans-serif;
+}
+.easy-autocomplete.eac-funky input {
+ background: #07ED89;
+ border: 0;
+ border-radius: 0;
+ color: #ED076B;
+ font-family: inherit;
+ font-size: 18px;
+ min-width: 240px;
+ padding: 12px;
+}
+.easy-autocomplete.eac-funky ul {
+ background: transparent;
+ border: 0;
+}
+.easy-autocomplete.eac-funky ul li, .easy-autocomplete.eac-funky ul .eac-category {
+ background: transparent;
+ border: 0;
+ color: #ED076B;
+ font-size: 18px;
+ padding: 4px 12px;
+ transition: all 0.4s ease 0s;
+}
+.easy-autocomplete.eac-funky ul li.selected, .easy-autocomplete.eac-funky ul .eac-category.selected {
+ color: #8907ED;
+}
+.easy-autocomplete.eac-solid input {
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15) inset;
+ border-color: #ddd;
+ color: #666;
+ font-size: 13px;
+ min-height: 0;
+ padding: 6px 12px;
+}
+.easy-autocomplete.eac-solid ul li, .easy-autocomplete.eac-solid ul .eac-category {
+ transition: all 0.4s ease 0s;
+}
+.easy-autocomplete.eac-solid ul li.selected, .easy-autocomplete.eac-solid ul .eac-category.selected {
+ background-color: #f2f2f2;
+}
+.easy-autocomplete.eac-plate {
+ font-family: "Open Sans", "Helvetica Neue",Helvetica,Arial,sans-serif;
+}
+.easy-autocomplete.eac-plate input {
+ font-size: 13px;
+ padding: 6px 12px;
+}
+.easy-autocomplete.eac-plate ul {
+ background: #b5b5b5;
+ border-radius: 6px;
+ border-width: 0;
+ top: 10px;
+}
+.easy-autocomplete.eac-plate ul li, .easy-autocomplete.eac-plate ul .eac-category {
+ background: #b5b5b5;
+ color: #FAFAFA;
+ font-size: 12px;
+ transition: all 0.4s ease 0s;
+}
+.easy-autocomplete.eac-plate ul li b, .easy-autocomplete.eac-plate ul .eac-category b {
+ color: #ffd464;
+}
+.easy-autocomplete.eac-plate ul li.selected, .easy-autocomplete.eac-plate ul .eac-category.selected {
+ background: #656565;
+}
+.easy-autocomplete.eac-plate ul li:first-child, .easy-autocomplete.eac-plate ul .eac-category:first-child {
+ border-radius: 6px 6px 0 0;
+}
+.easy-autocomplete.eac-plate ul li:last-child, .easy-autocomplete.eac-plate ul .eac-category:last-child {
+ border-radius: 0 0 6px 6px;
+}
+.easy-autocomplete.eac-plate-dark {
+ font-family: "Open Sans", "Helvetica Neue",Helvetica,Arial,sans-serif;
+}
+.easy-autocomplete.eac-plate-dark input {
+ font-size: 13px;
+ padding: 6px 12px;
+}
+.easy-autocomplete.eac-plate-dark ul {
+ background: #212121;
+ border-radius: 6px;
+ border-width: 0;
+ top: 10px;
+}
+.easy-autocomplete.eac-plate-dark ul li, .easy-autocomplete.eac-plate-dark ul .eac-category {
+ background: #212121;
+ color: #FAFAFA;
+ font-size: 12px;
+ transition: all 0.4s ease 0s;
+}
+.easy-autocomplete.eac-plate-dark ul li b, .easy-autocomplete.eac-plate-dark ul .eac-category b {
+ color: #ffd464;
+}
+.easy-autocomplete.eac-plate-dark ul li.selected, .easy-autocomplete.eac-plate-dark ul .eac-category.selected {
+ background: #656565;
+}
+.easy-autocomplete.eac-plate-dark ul li:first-child, .easy-autocomplete.eac-plate-dark ul .eac-category:first-child {
+ border-radius: 6px 6px 0 0;
+}
+.easy-autocomplete.eac-plate-dark ul li:last-child, .easy-autocomplete.eac-plate-dark ul .eac-category:last-child {
+ border-radius: 0 0 6px 6px;
+}
+
+/*# sourceMappingURL=easy-autocomplete.themes.css.map */
diff --git a/bl-plugins/search/css/easy-autocomplete.themes.min.css b/bl-plugins/search/css/easy-autocomplete.themes.min.css
new file mode 100755
index 00000000..37ac6938
--- /dev/null
+++ b/bl-plugins/search/css/easy-autocomplete.themes.min.css
@@ -0,0 +1,11 @@
+/*
+ * easy-autocomplete
+ * jQuery plugin for autocompletion
+ *
+ * @author Łukasz Pawełczak (http://github.com/pawelczak)
+ * @version 1.3.5
+ * Copyright License:
+ */
+
+.easy-autocomplete.eac-square{font-family:"Roboto", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-square input{border:1px solid #7f8c8d;border-radius:0;color:#7f8c8d;font-family:inherit;font-size:18px;font-style:italic;font-weight:300;margin:0;min-width:350px;padding:12px 43px 12px 15px}.easy-autocomplete.eac-square ul{border-color:#7f8c8d;border-top:0;box-shadow:none;top:0}.easy-autocomplete.eac-square ul li,.easy-autocomplete.eac-square ul .eac-category{border-color:#7f8c8d;font-family:inherit;font-size:16px;font-weight:300;padding:6px 12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-square ul li *,.easy-autocomplete.eac-square ul .eac-category *{font-weight:300}.easy-autocomplete.eac-square ul li.selected,.easy-autocomplete.eac-square ul .eac-category.selected{background-color:#f1f1f1;font-weight:300}.easy-autocomplete.eac-square ul li b,.easy-autocomplete.eac-square ul .eac-category b{font-weight:600}.easy-autocomplete.eac-round{font-family:"Open Sans", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-round input{border:2px solid #888;border-radius:10px;color:#888;font-family:inherit;font-size:16px;font-weight:400;margin:0;min-width:300px;padding:10px}.easy-autocomplete.eac-round input:hover,.easy-autocomplete.eac-round input:focus{border-color:#3079ed}.easy-autocomplete.eac-round ul{background:none;border-color:#888;border-width:0;box-shadow:none;min-width:300px;top:20px}.easy-autocomplete.eac-round ul li,.easy-autocomplete.eac-round ul .eac-category{background:#fff;border-color:#3079ed;border-width:0 2px;font-size:14px;padding:8px 12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-round ul li.selected,.easy-autocomplete.eac-round ul .eac-category.selected{background-color:#d4e3fb}.easy-autocomplete.eac-round ul li:first-child,.easy-autocomplete.eac-round ul .eac-category:first-child{border-radius:10px 10px 0 0;border-width:2px 2px 0}.easy-autocomplete.eac-round ul li:last-child,.easy-autocomplete.eac-round ul .eac-category:last-child{border-radius:0 0 10px 10px;border-width:0 2px 2px}.easy-autocomplete.eac-round ul li b,.easy-autocomplete.eac-round ul .eac-category b{font-weight:700}.easy-autocomplete.eac-funky{font-family:"Inconsolata", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-funky input{background:#07ED89;border:0;border-radius:0;color:#ED076B;font-family:inherit;font-size:18px;min-width:240px;padding:12px}.easy-autocomplete.eac-funky ul{background:transparent;border:0}.easy-autocomplete.eac-funky ul li,.easy-autocomplete.eac-funky ul .eac-category{background:transparent;border:0;color:#ED076B;font-size:18px;padding:4px 12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-funky ul li.selected,.easy-autocomplete.eac-funky ul .eac-category.selected{color:#8907ED}.easy-autocomplete.eac-solid input{box-shadow:0 1px 2px rgba(0,0,0,0.15) inset;border-color:#ddd;color:#666;font-size:13px;min-height:0;padding:6px 12px}.easy-autocomplete.eac-solid ul li,.easy-autocomplete.eac-solid ul .eac-category{transition:all 0.4s ease 0s}.easy-autocomplete.eac-solid ul li.selected,.easy-autocomplete.eac-solid ul .eac-category.selected{background-color:#f2f2f2}.easy-autocomplete.eac-plate{font-family:"Open Sans", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-plate input{font-size:13px;padding:6px 12px}.easy-autocomplete.eac-plate ul{background:#b5b5b5;border-radius:6px;border-width:0;top:10px}.easy-autocomplete.eac-plate ul li,.easy-autocomplete.eac-plate ul .eac-category{background:#b5b5b5;color:#FAFAFA;font-size:12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-plate ul li b,.easy-autocomplete.eac-plate ul .eac-category b{color:#ffd464}.easy-autocomplete.eac-plate ul li.selected,.easy-autocomplete.eac-plate ul .eac-category.selected{background:#656565}.easy-autocomplete.eac-plate ul li:first-child,.easy-autocomplete.eac-plate ul .eac-category:first-child{border-radius:6px 6px 0 0}.easy-autocomplete.eac-plate ul li:last-child,.easy-autocomplete.eac-plate ul .eac-category:last-child{border-radius:0 0 6px 6px}.easy-autocomplete.eac-plate-dark{font-family:"Open Sans", "Helvetica Neue",Helvetica,Arial,sans-serif}.easy-autocomplete.eac-plate-dark input{font-size:13px;padding:6px 12px}.easy-autocomplete.eac-plate-dark ul{background:#212121;border-radius:6px;border-width:0;top:10px}.easy-autocomplete.eac-plate-dark ul li,.easy-autocomplete.eac-plate-dark ul .eac-category{background:#212121;color:#FAFAFA;font-size:12px;transition:all 0.4s ease 0s}.easy-autocomplete.eac-plate-dark ul li b,.easy-autocomplete.eac-plate-dark ul .eac-category b{color:#ffd464}.easy-autocomplete.eac-plate-dark ul li.selected,.easy-autocomplete.eac-plate-dark ul .eac-category.selected{background:#656565}.easy-autocomplete.eac-plate-dark ul li:first-child,.easy-autocomplete.eac-plate-dark ul .eac-category:first-child{border-radius:6px 6px 0 0}.easy-autocomplete.eac-plate-dark ul li:last-child,.easy-autocomplete.eac-plate-dark ul .eac-category:last-child{border-radius:0 0 6px 6px}
+/*# sourceMappingURL=easy-autocomplete.themes.min.css.map */
diff --git a/bl-plugins/search/css/jquery.modal.min.css b/bl-plugins/search/css/jquery.modal.min.css
new file mode 100755
index 00000000..f568c621
--- /dev/null
+++ b/bl-plugins/search/css/jquery.modal.min.css
@@ -0,0 +1 @@
+.blocker{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;overflow:auto;z-index:1;padding:20px;box-sizing:border-box;background-color:#000;background-color:rgba(0,0,0,0.75);text-align:center}.blocker:before{content:"";display:inline-block;height:100%;vertical-align:middle;margin-right:-0.05em}.blocker.behind{background-color:transparent}.modal{display:none;vertical-align:middle;position:relative;z-index:2;max-width:500px;box-sizing:border-box;width:90%;background:#fff;padding:15px 30px;-webkit-border-radius:8px;-moz-border-radius:8px;-o-border-radius:8px;-ms-border-radius:8px;border-radius:8px;-webkit-box-shadow:0 0 10px #000;-moz-box-shadow:0 0 10px #000;-o-box-shadow:0 0 10px #000;-ms-box-shadow:0 0 10px #000;box-shadow:0 0 10px #000;text-align:left}.modal a.close-modal{position:absolute;top:-12.5px;right:-12.5px;display:block;width:30px;height:30px;text-indent:-9999px;background-size:contain;background-repeat:no-repeat;background-position:center center;background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAAXNSR0IArs4c6QAAA3hJREFUaAXlm8+K00Acx7MiCIJH/yw+gA9g25O49SL4AO3Bp1jw5NvktC+wF88qevK4BU97EmzxUBCEolK/n5gp3W6TTJPfpNPNF37MNsl85/vN/DaTmU6PknC4K+pniqeKJ3k8UnkvDxXJzzy+q/yaxxeVHxW/FNHjgRSeKt4rFoplzaAuHHDBGR2eS9G54reirsmienDCTRt7xwsp+KAoEmt9nLaGitZxrBbPFNaGfPloGw2t4JVamSt8xYW6Dg1oCYo3Yv+rCGViV160oMkcd8SYKnYV1Nb1aEOjCe6L5ZOiLfF120EjWhuBu3YIZt1NQmujnk5F4MgOpURzLfAwOBSTmzp3fpDxuI/pabxpqOoz2r2HLAb0GMbZKlNV5/Hg9XJypguryA7lPF5KMdTZQzHjqxNPhWhzIuAruOl1eNqKEx1tSh5rfbxdw7mOxCq4qS68ZTjKS1YVvilu559vWvFHhh4rZrdyZ69Vmpgdj8fJbDZLJpNJ0uv1cnr/gjrUhQMuI+ANjyuwftQ0bbL6Erp0mM/ny8Fg4M3LtdRxgMtKl3jwmIHVxYXChFy94/Rmpa/pTbNUhstKV+4Rr8lLQ9KlUvJKLyG8yvQ2s9SBy1Jb7jV5a0yapfF6apaZLjLLcWtd4sNrmJUMHyM+1xibTjH82Zh01TNlhsrOhdKTe00uAzZQmN6+KW+sDa/JD2PSVQ873m29yf+1Q9VDzfEYlHi1G5LKBBWZbtEsHbFwb1oYDwr1ZiF/2bnCSg1OBE/pfr9/bWx26UxJL3ONPISOLKUvQza0LZUxSKyjpdTGa/vDEr25rddbMM0Q3O6Lx3rqFvU+x6UrRKQY7tyrZecmD9FODy8uLizTmilwNj0kraNcAJhOp5aGVwsAGD5VmJBrWWbJSgWT9zrzWepQF47RaGSiKfeGx6Szi3gzmX/HHbihwBser4B9UJYpFBNX4R6vTn3VQnez0SymnrHQMsRYGTr1dSk34ljRqS/EMd2pLQ8YBp3a1PLfcqCpo8gtHkZFHKkTX6fs3MY0blKnth66rKCnU0VRGu37ONrQaA4eZDFtWAu2fXj9zjFkxTBOo8F7t926gTp/83Kyzzcy2kZD6xiqxTYnHLRFm3vHiRSwNSjkz3hoIzo8lCKWUlg/YtGs7tObunDAZfpDLbfEI15zsEIY3U/x/gHHc/G1zltnAgAAAABJRU5ErkJggg==')}.modal-spinner{display:none;position:fixed;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);padding:12px 16px;border-radius:5px;background-color:#111;height:20px}.modal-spinner>div{border-radius:100px;background-color:#fff;height:20px;width:2px;margin:0 1px;display:inline-block;-webkit-animation:sk-stretchdelay 1.2s infinite ease-in-out;animation:sk-stretchdelay 1.2s infinite ease-in-out}.modal-spinner .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.modal-spinner .rect3{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.modal-spinner .rect4{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}@-webkit-keyframes sk-stretchdelay{0%,40%,100%{-webkit-transform:scaleY(0.5)}20%{-webkit-transform:scaleY(1.0)}}@keyframes sk-stretchdelay{0%,40%,100%{transform:scaleY(0.5);-webkit-transform:scaleY(0.5)}20%{transform:scaleY(1.0);-webkit-transform:scaleY(1.0)}}
\ No newline at end of file
diff --git a/bl-plugins/search/css/remodal-default-theme.css b/bl-plugins/search/css/remodal-default-theme.css
new file mode 100755
index 00000000..c996c054
--- /dev/null
+++ b/bl-plugins/search/css/remodal-default-theme.css
@@ -0,0 +1,323 @@
+/*
+ * Remodal - v1.1.1
+ * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
+ * http://vodkabears.github.io/remodal/
+ *
+ * Made by Ilya Makarov
+ * Under MIT License
+ */
+
+/* ==========================================================================
+ Remodal's default mobile first theme
+ ========================================================================== */
+
+/* Default theme styles for the background */
+
+.remodal-bg.remodal-is-opening,
+.remodal-bg.remodal-is-opened {
+ -webkit-filter: blur(3px);
+ filter: blur(3px);
+}
+
+/* Default theme styles of the overlay */
+
+.remodal-overlay {
+ background: rgba(43, 46, 56, 0.9);
+}
+
+.remodal-overlay.remodal-is-opening,
+.remodal-overlay.remodal-is-closing {
+ -webkit-animation-duration: 0.3s;
+ animation-duration: 0.3s;
+ -webkit-animation-fill-mode: forwards;
+ animation-fill-mode: forwards;
+}
+
+.remodal-overlay.remodal-is-opening {
+ -webkit-animation-name: remodal-overlay-opening-keyframes;
+ animation-name: remodal-overlay-opening-keyframes;
+}
+
+.remodal-overlay.remodal-is-closing {
+ -webkit-animation-name: remodal-overlay-closing-keyframes;
+ animation-name: remodal-overlay-closing-keyframes;
+}
+
+/* Default theme styles of the wrapper */
+
+.remodal-wrapper {
+ padding: 10px 10px 0;
+}
+
+/* Default theme styles of the modal dialog */
+
+.remodal {
+ box-sizing: border-box;
+ width: 100%;
+ margin-bottom: 10px;
+ padding: 35px;
+
+ -webkit-transform: translate3d(0, 0, 0);
+ transform: translate3d(0, 0, 0);
+
+ color: #2b2e38;
+ background: #fff;
+}
+
+.remodal.remodal-is-opening,
+.remodal.remodal-is-closing {
+ -webkit-animation-duration: 0.3s;
+ animation-duration: 0.3s;
+ -webkit-animation-fill-mode: forwards;
+ animation-fill-mode: forwards;
+}
+
+.remodal.remodal-is-opening {
+ -webkit-animation-name: remodal-opening-keyframes;
+ animation-name: remodal-opening-keyframes;
+}
+
+.remodal.remodal-is-closing {
+ -webkit-animation-name: remodal-closing-keyframes;
+ animation-name: remodal-closing-keyframes;
+}
+
+/* Vertical align of the modal dialog */
+
+.remodal,
+.remodal-wrapper:after {
+ vertical-align: middle;
+}
+
+/* Close button */
+
+.remodal-close {
+ position: absolute;
+ top: 0;
+ left: 0;
+
+ display: block;
+ overflow: visible;
+
+ width: 35px;
+ height: 35px;
+ margin: 0;
+ padding: 0;
+
+ cursor: pointer;
+ -webkit-transition: color 0.2s;
+ transition: color 0.2s;
+ text-decoration: none;
+
+ color: #95979c;
+ border: 0;
+ outline: 0;
+ background: transparent;
+}
+
+.remodal-close:hover,
+.remodal-close:focus {
+ color: #2b2e38;
+}
+
+.remodal-close:before {
+ font-family: Arial, "Helvetica CY", "Nimbus Sans L", sans-serif !important;
+ font-size: 25px;
+ line-height: 35px;
+
+ position: absolute;
+ top: 0;
+ left: 0;
+
+ display: block;
+
+ width: 35px;
+
+ content: "\00d7";
+ text-align: center;
+}
+
+/* Dialog buttons */
+
+.remodal-confirm,
+.remodal-cancel {
+ font: inherit;
+
+ display: inline-block;
+ overflow: visible;
+
+ min-width: 110px;
+ margin: 0;
+ padding: 12px 0;
+
+ cursor: pointer;
+ -webkit-transition: background 0.2s;
+ transition: background 0.2s;
+ text-align: center;
+ vertical-align: middle;
+ text-decoration: none;
+
+ border: 0;
+ outline: 0;
+}
+
+.remodal-confirm {
+ color: #fff;
+ background: #81c784;
+}
+
+.remodal-confirm:hover,
+.remodal-confirm:focus {
+ background: #66bb6a;
+}
+
+.remodal-cancel {
+ color: #fff;
+ background: #e57373;
+}
+
+.remodal-cancel:hover,
+.remodal-cancel:focus {
+ background: #ef5350;
+}
+
+/* Remove inner padding and border in Firefox 4+ for the button tag. */
+
+.remodal-confirm::-moz-focus-inner,
+.remodal-cancel::-moz-focus-inner,
+.remodal-close::-moz-focus-inner {
+ padding: 0;
+
+ border: 0;
+}
+
+/* Keyframes
+ ========================================================================== */
+
+@-webkit-keyframes remodal-opening-keyframes {
+ from {
+ -webkit-transform: scale(1.05);
+ transform: scale(1.05);
+
+ opacity: 0;
+ }
+ to {
+ -webkit-transform: none;
+ transform: none;
+
+ opacity: 1;
+
+ -webkit-filter: blur(0);
+ filter: blur(0);
+ }
+}
+
+@keyframes remodal-opening-keyframes {
+ from {
+ -webkit-transform: scale(1.05);
+ transform: scale(1.05);
+
+ opacity: 0;
+ }
+ to {
+ -webkit-transform: none;
+ transform: none;
+
+ opacity: 1;
+
+ -webkit-filter: blur(0);
+ filter: blur(0);
+ }
+}
+
+@-webkit-keyframes remodal-closing-keyframes {
+ from {
+ -webkit-transform: scale(1);
+ transform: scale(1);
+
+ opacity: 1;
+ }
+ to {
+ -webkit-transform: scale(0.95);
+ transform: scale(0.95);
+
+ opacity: 0;
+
+ -webkit-filter: blur(0);
+ filter: blur(0);
+ }
+}
+
+@keyframes remodal-closing-keyframes {
+ from {
+ -webkit-transform: scale(1);
+ transform: scale(1);
+
+ opacity: 1;
+ }
+ to {
+ -webkit-transform: scale(0.95);
+ transform: scale(0.95);
+
+ opacity: 0;
+
+ -webkit-filter: blur(0);
+ filter: blur(0);
+ }
+}
+
+@-webkit-keyframes remodal-overlay-opening-keyframes {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
+@keyframes remodal-overlay-opening-keyframes {
+ from {
+ opacity: 0;
+ }
+ to {
+ opacity: 1;
+ }
+}
+
+@-webkit-keyframes remodal-overlay-closing-keyframes {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+
+@keyframes remodal-overlay-closing-keyframes {
+ from {
+ opacity: 1;
+ }
+ to {
+ opacity: 0;
+ }
+}
+
+/* Media queries
+ ========================================================================== */
+
+@media only screen and (min-width: 641px) {
+ .remodal {
+ max-width: 700px;
+ }
+}
+
+/* IE8
+ ========================================================================== */
+
+.lt-ie9 .remodal-overlay {
+ background: #2b2e38;
+}
+
+.lt-ie9 .remodal {
+ width: 700px;
+}
diff --git a/bl-plugins/search/css/remodal.css b/bl-plugins/search/css/remodal.css
new file mode 100755
index 00000000..fa2ea128
--- /dev/null
+++ b/bl-plugins/search/css/remodal.css
@@ -0,0 +1,93 @@
+/*
+ * Remodal - v1.1.1
+ * Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
+ * http://vodkabears.github.io/remodal/
+ *
+ * Made by Ilya Makarov
+ * Under MIT License
+ */
+
+/* ==========================================================================
+ Remodal's necessary styles
+ ========================================================================== */
+
+/* Hide scroll bar */
+
+html.remodal-is-locked {
+ overflow: hidden;
+
+ -ms-touch-action: none;
+ touch-action: none;
+}
+
+/* Anti FOUC */
+
+.remodal,
+[data-remodal-id] {
+ display: none;
+}
+
+/* Necessary styles of the overlay */
+
+.remodal-overlay {
+ position: fixed;
+ z-index: 9999;
+ top: -5000px;
+ right: -5000px;
+ bottom: -5000px;
+ left: -5000px;
+
+ display: none;
+}
+
+/* Necessary styles of the wrapper */
+
+.remodal-wrapper {
+ position: fixed;
+ z-index: 10000;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+
+ display: none;
+ overflow: auto;
+
+ text-align: center;
+
+ -webkit-overflow-scrolling: touch;
+}
+
+.remodal-wrapper:after {
+ display: inline-block;
+
+ height: 100%;
+ margin-left: -0.05em;
+
+ content: "";
+}
+
+/* Fix iPad, iPhone glitches */
+
+.remodal-overlay,
+.remodal-wrapper {
+ -webkit-backface-visibility: hidden;
+ backface-visibility: hidden;
+}
+
+/* Necessary styles of the modal dialog */
+
+.remodal {
+ position: relative;
+
+ outline: none;
+
+ -webkit-text-size-adjust: 100%;
+ -ms-text-size-adjust: 100%;
+ text-size-adjust: 100%;
+}
+
+.remodal-is-initialized {
+ /* Disable Anti-FOUC */
+ display: inline-block;
+}
diff --git a/bl-plugins/search/css/search.css b/bl-plugins/search/css/search.css
new file mode 100644
index 00000000..a2ae10a2
--- /dev/null
+++ b/bl-plugins/search/css/search.css
@@ -0,0 +1,8 @@
+.easy-autocomplete {
+ width: 100% !important;
+ text-align: left;
+}
+
+#plugin-search-input {
+ width: 100% !important;
+}
\ No newline at end of file
diff --git a/bl-plugins/search/js/jquery.easy-autocomplete.js b/bl-plugins/search/js/jquery.easy-autocomplete.js
new file mode 100755
index 00000000..c582c0f2
--- /dev/null
+++ b/bl-plugins/search/js/jquery.easy-autocomplete.js
@@ -0,0 +1,1623 @@
+/*
+ * easy-autocomplete
+ * jQuery plugin for autocompletion
+ *
+ * @author Łukasz Pawełczak (http://github.com/pawelczak)
+ * @version 1.3.5
+ * Copyright License:
+ */
+
+/*
+ * EasyAutocomplete - Configuration
+ */
+var EasyAutocomplete = (function(scope){
+
+ scope.Configuration = function Configuration(options) {
+ var defaults = {
+ data: "list-required",
+ url: "list-required",
+ dataType: "json",
+
+ listLocation: function(data) {
+ return data;
+ },
+
+ xmlElementName: "",
+
+ getValue: function(element) {
+ return element;
+ },
+
+ autocompleteOff: true,
+
+ placeholder: false,
+
+ ajaxCallback: function() {},
+
+ matchResponseProperty: false,
+
+ list: {
+ sort: {
+ enabled: false,
+ method: function(a, b) {
+ a = defaults.getValue(a);
+ b = defaults.getValue(b);
+ if (a < b) {
+ return -1;
+ }
+ if (a > b) {
+ return 1;
+ }
+ return 0;
+ }
+ },
+
+ maxNumberOfElements: 6,
+
+ hideOnEmptyPhrase: true,
+
+ match: {
+ enabled: false,
+ caseSensitive: false,
+ method: function(element, phrase) {
+
+ if (element.search(phrase) > -1) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ },
+
+ showAnimation: {
+ type: "normal", //normal|slide|fade
+ time: 400,
+ callback: function() {}
+ },
+
+ hideAnimation: {
+ type: "normal",
+ time: 400,
+ callback: function() {}
+ },
+
+ /* Events */
+ onClickEvent: function() {},
+ onSelectItemEvent: function() {},
+ onLoadEvent: function() {},
+ onChooseEvent: function() {},
+ onKeyEnterEvent: function() {},
+ onMouseOverEvent: function() {},
+ onMouseOutEvent: function() {},
+ onShowListEvent: function() {},
+ onHideListEvent: function() {}
+ },
+
+ highlightPhrase: true,
+
+ theme: "",
+
+ cssClasses: "",
+
+ minCharNumber: 0,
+
+ requestDelay: 0,
+
+ adjustWidth: true,
+
+ ajaxSettings: {},
+
+ preparePostData: function(data, inputPhrase) {return data;},
+
+ loggerEnabled: true,
+
+ template: "",
+
+ categoriesAssigned: false,
+
+ categories: [{
+ maxNumberOfElements: 4
+ }]
+
+ };
+
+ var externalObjects = ["ajaxSettings", "template"];
+
+ this.get = function(propertyName) {
+ return defaults[propertyName];
+ };
+
+ this.equals = function(name, value) {
+ if (isAssigned(name)) {
+ if (defaults[name] === value) {
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ this.checkDataUrlProperties = function() {
+ if (defaults.url === "list-required" && defaults.data === "list-required") {
+ return false;
+ }
+ return true;
+ };
+ this.checkRequiredProperties = function() {
+ for (var propertyName in defaults) {
+ if (defaults[propertyName] === "required") {
+ logger.error("Option " + propertyName + " must be defined");
+ return false;
+ }
+ }
+ return true;
+ };
+
+ this.printPropertiesThatDoesntExist = function(consol, optionsToCheck) {
+ printPropertiesThatDoesntExist(consol, optionsToCheck);
+ };
+
+
+ prepareDefaults();
+
+ mergeOptions();
+
+ if (defaults.loggerEnabled === true) {
+ printPropertiesThatDoesntExist(console, options);
+ }
+
+ addAjaxSettings();
+
+ processAfterMerge();
+ function prepareDefaults() {
+
+ if (options.dataType === "xml") {
+
+ if (!options.getValue) {
+
+ options.getValue = function(element) {
+ return $(element).text();
+ };
+ }
+
+
+ if (!options.list) {
+
+ options.list = {};
+ }
+
+ if (!options.list.sort) {
+ options.list.sort = {};
+ }
+
+
+ options.list.sort.method = function(a, b) {
+ a = options.getValue(a);
+ b = options.getValue(b);
+ if (a < b) {
+ return -1;
+ }
+ if (a > b) {
+ return 1;
+ }
+ return 0;
+ };
+
+ if (!options.list.match) {
+ options.list.match = {};
+ }
+
+ options.list.match.method = function(element, phrase) {
+
+ if (element.search(phrase) > -1) {
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ }
+ if (options.categories !== undefined && options.categories instanceof Array) {
+
+ var categories = [];
+
+ for (var i = 0, length = options.categories.length; i < length; i += 1) {
+
+ var category = options.categories[i];
+
+ for (var property in defaults.categories[0]) {
+
+ if (category[property] === undefined) {
+ category[property] = defaults.categories[0][property];
+ }
+ }
+
+ categories.push(category);
+ }
+
+ options.categories = categories;
+ }
+ }
+
+ function mergeOptions() {
+
+ defaults = mergeObjects(defaults, options);
+
+ function mergeObjects(source, target) {
+ var mergedObject = source || {};
+
+ for (var propertyName in source) {
+ if (target[propertyName] !== undefined && target[propertyName] !== null) {
+
+ if (typeof target[propertyName] !== "object" ||
+ target[propertyName] instanceof Array) {
+ mergedObject[propertyName] = target[propertyName];
+ } else {
+ mergeObjects(source[propertyName], target[propertyName]);
+ }
+ }
+ }
+
+ /* If data is an object */
+ if (target.data !== undefined && target.data !== null && typeof target.data === "object") {
+ mergedObject.data = target.data;
+ }
+
+ return mergedObject;
+ }
+ }
+
+
+ function processAfterMerge() {
+
+ if (defaults.url !== "list-required" && typeof defaults.url !== "function") {
+ var defaultUrl = defaults.url;
+ defaults.url = function() {
+ return defaultUrl;
+ };
+ }
+
+ if (defaults.ajaxSettings.url !== undefined && typeof defaults.ajaxSettings.url !== "function") {
+ var defaultUrl = defaults.ajaxSettings.url;
+ defaults.ajaxSettings.url = function() {
+ return defaultUrl;
+ };
+ }
+
+ if (typeof defaults.listLocation === "string") {
+ var defaultlistLocation = defaults.listLocation;
+
+ if (defaults.dataType.toUpperCase() === "XML") {
+ defaults.listLocation = function(data) {
+ return $(data).find(defaultlistLocation);
+ };
+ } else {
+ defaults.listLocation = function(data) {
+ return data[defaultlistLocation];
+ };
+ }
+ }
+
+ if (typeof defaults.getValue === "string") {
+ var defaultsGetValue = defaults.getValue;
+ defaults.getValue = function(element) {
+ return element[defaultsGetValue];
+ };
+ }
+
+ if (options.categories !== undefined) {
+ defaults.categoriesAssigned = true;
+ }
+
+ }
+
+ function addAjaxSettings() {
+
+ if (options.ajaxSettings !== undefined && typeof options.ajaxSettings === "object") {
+ defaults.ajaxSettings = options.ajaxSettings;
+ } else {
+ defaults.ajaxSettings = {};
+ }
+
+ }
+
+ function isAssigned(name) {
+ if (defaults[name] !== undefined && defaults[name] !== null) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ 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.");
+ }
+
+ if (typeof source[property] === "object" && $.inArray(property, externalObjects) === -1) {
+ checkPropertiesIfExist(source[property], target[property]);
+ }
+ }
+ }
+ }
+ };
+
+ return scope;
+
+})(EasyAutocomplete || {});
+
+
+/*
+ * EasyAutocomplete - Logger
+ */
+var EasyAutocomplete = (function(scope){
+
+ scope.Logger = function Logger() {
+
+ this.error = function(message) {
+ console.log("ERROR: " + message);
+ };
+
+ this.warning = function(message) {
+ console.log("WARNING: " + message);
+ };
+ };
+
+ return scope;
+
+})(EasyAutocomplete || {});
+
+
+/*
+ * EasyAutocomplete - Constans
+ */
+var EasyAutocomplete = (function(scope){
+
+ scope.Constans = function Constans() {
+ var constants = {
+ CONTAINER_CLASS: "easy-autocomplete-container",
+ CONTAINER_ID: "eac-container-",
+
+ WRAPPER_CSS_CLASS: "easy-autocomplete"
+ };
+
+ this.getValue = function(propertyName) {
+ return constants[propertyName];
+ };
+
+ };
+
+ return scope;
+
+})(EasyAutocomplete || {});
+
+/*
+ * EasyAutocomplete - ListBuilderService
+ *
+ * @author Łukasz Pawełczak
+ *
+ */
+var EasyAutocomplete = (function(scope) {
+
+ scope.ListBuilderService = function ListBuilderService(configuration, proccessResponseData) {
+
+
+ this.init = function(data) {
+ var listBuilder = [],
+ builder = {};
+
+ builder.data = configuration.get("listLocation")(data);
+ 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 = [];
+
+ for(var i = 0; i < configuration.get("categories").length; i += 1) {
+
+ var builder = convertToListBuilder(configuration.get("categories")[i], data);
+
+ listBuilder.push(builder);
+ }
+
+ }
+
+ return listBuilder;
+ };
+
+ this.convertXml = function(listBuilder) {
+ if(configuration.get("dataType").toUpperCase() === "XML") {
+
+ for(var i = 0; i < listBuilder.length; i += 1) {
+ listBuilder[i].data = convertXmlToList(listBuilder[i]);
+ }
+ }
+
+ return listBuilder;
+ };
+
+ this.processData = function(listBuilder, inputPhrase) {
+
+ for(var i = 0, length = listBuilder.length; i < length; i+=1) {
+ listBuilder[i].data = proccessResponseData(configuration, listBuilder[i], inputPhrase);
+ }
+
+ return listBuilder;
+ };
+
+ this.checkIfDataExists = function(listBuilders) {
+
+ for(var i = 0, length = listBuilders.length; i < length; i += 1) {
+
+ if (listBuilders[i].data !== undefined && listBuilders[i].data instanceof Array) {
+ if (listBuilders[i].data.length > 0) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ };
+
+
+ function convertToListBuilder(category, data) {
+
+ var builder = {};
+
+ if(configuration.get("dataType").toUpperCase() === "XML") {
+
+ builder = convertXmlToListBuilder();
+ } else {
+
+ builder = convertDataToListBuilder();
+ }
+
+
+ if (category.header !== undefined) {
+ builder.header = category.header;
+ }
+
+ if (category.maxNumberOfElements !== undefined) {
+ builder.maxNumberOfElements = category.maxNumberOfElements;
+ }
+
+ if (configuration.get("list").maxNumberOfElements !== undefined) {
+
+ builder.maxListSize = configuration.get("list").maxNumberOfElements;
+ }
+
+ if (category.getValue !== undefined) {
+
+ if (typeof category.getValue === "string") {
+ var defaultsGetValue = category.getValue;
+ builder.getValue = function(element) {
+ return element[defaultsGetValue];
+ };
+ } else if (typeof category.getValue === "function") {
+ builder.getValue = category.getValue;
+ }
+
+ } else {
+ builder.getValue = configuration.get("getValue");
+ }
+
+
+ return builder;
+
+
+ function convertXmlToListBuilder() {
+
+ var builder = {},
+ listLocation;
+
+ if (category.xmlElementName !== undefined) {
+ builder.xmlElementName = category.xmlElementName;
+ }
+
+ if (category.listLocation !== undefined) {
+
+ listLocation = category.listLocation;
+ } else if (configuration.get("listLocation") !== undefined) {
+
+ listLocation = configuration.get("listLocation");
+ }
+
+ if (listLocation !== undefined) {
+ if (typeof listLocation === "string") {
+ builder.data = $(data).find(listLocation);
+ } else if (typeof listLocation === "function") {
+
+ builder.data = listLocation(data);
+ }
+ } else {
+
+ builder.data = data;
+ }
+
+ return builder;
+ }
+
+
+ function convertDataToListBuilder() {
+
+ var builder = {};
+
+ if (category.listLocation !== undefined) {
+
+ if (typeof category.listLocation === "string") {
+ builder.data = data[category.listLocation];
+ } else if (typeof category.listLocation === "function") {
+ builder.data = category.listLocation(data);
+ }
+ } else {
+ builder.data = data;
+ }
+
+ return builder;
+ }
+ }
+
+ function convertXmlToList(builder) {
+ var simpleList = [];
+
+ if (builder.xmlElementName === undefined) {
+ builder.xmlElementName = configuration.get("xmlElementName");
+ }
+
+
+ $(builder.data).find(builder.xmlElementName).each(function() {
+ simpleList.push(this);
+ });
+
+ return simpleList;
+ }
+
+ };
+
+ return scope;
+
+})(EasyAutocomplete || {});
+
+
+/*
+ * EasyAutocomplete - Data proccess module
+ *
+ * Process list to display:
+ * - sort
+ * - decrease number to specific number
+ * - show only matching list
+ *
+ */
+var EasyAutocomplete = (function(scope) {
+
+ scope.proccess = function proccessData(config, listBuilder, phrase) {
+
+ scope.proccess.match = match;
+
+ var list = listBuilder.data,
+ inputPhrase = phrase;//TODO REFACTOR
+
+ list = findMatch(list, inputPhrase);
+ list = reduceElementsInList(list);
+ list = sort(list);
+
+ return list;
+
+
+ function findMatch(list, phrase) {
+ var preparedList = [],
+ value = "";
+
+ if (config.get("list").match.enabled) {
+
+ for(var i = 0, length = list.length; i < length; i += 1) {
+
+ value = config.get("getValue")(list[i]);
+
+ if (match(value, phrase)) {
+ preparedList.push(list[i]);
+ }
+
+ }
+
+ } else {
+ preparedList = list;
+ }
+
+ return preparedList;
+ }
+
+ function match(value, phrase) {
+
+ if (!config.get("list").match.caseSensitive) {
+
+ if (typeof value === "string") {
+ value = value.toLowerCase();
+ }
+
+ phrase = phrase.toLowerCase();
+ }
+ if (config.get("list").match.method(value, phrase)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ function reduceElementsInList(list) {
+ if (listBuilder.maxNumberOfElements !== undefined && list.length > listBuilder.maxNumberOfElements) {
+ list = list.slice(0, listBuilder.maxNumberOfElements);
+ }
+
+ return list;
+ }
+
+ function sort(list) {
+ if (config.get("list").sort.enabled) {
+ list.sort(config.get("list").sort.method);
+ }
+
+ return list;
+ }
+
+ };
+
+
+ return scope;
+
+
+})(EasyAutocomplete || {});
+
+
+/*
+ * EasyAutocomplete - Template
+ *
+ *
+ *
+ */
+var EasyAutocomplete = (function(scope){
+
+ scope.Template = function Template(options) {
+
+
+ var genericTemplates = {
+ basic: {
+ type: "basic",
+ method: function(element) { return element; },
+ cssClass: ""
+ },
+ description: {
+ type: "description",
+ fields: {
+ description: "description"
+ },
+ method: function(element) { return element + " - description"; },
+ cssClass: "eac-description"
+ },
+ iconLeft: {
+ type: "iconLeft",
+ fields: {
+ icon: ""
+ },
+ method: function(element) {
+ return element;
+ },
+ cssClass: "eac-icon-left"
+ },
+ iconRight: {
+ type: "iconRight",
+ fields: {
+ iconSrc: ""
+ },
+ method: function(element) {
+ return element;
+ },
+ cssClass: "eac-icon-right"
+ },
+ links: {
+ type: "links",
+ fields: {
+ link: ""
+ },
+ method: function(element) {
+ return element;
+ },
+ cssClass: ""
+ },
+ custom: {
+ type: "custom",
+ method: function() {},
+ cssClass: ""
+ }
+ },
+
+
+
+ /*
+ * Converts method with {{text}} to function
+ */
+ convertTemplateToMethod = function(template) {
+
+
+ var _fields = template.fields,
+ buildMethod;
+
+ if (template.type === "description") {
+
+ buildMethod = genericTemplates.description.method;
+
+ if (typeof _fields.description === "string") {
+ buildMethod = function(elementValue, element) {
+ return elementValue + " -
" + element[_fields.description] + "";
+ };
+ } else if (typeof _fields.description === "function") {
+ buildMethod = function(elementValue, element) {
+ return elementValue + " -
" + _fields.description(element) + "";
+ };
+ }
+
+ return buildMethod;
+ }
+
+ if (template.type === "iconRight") {
+
+ if (typeof _fields.iconSrc === "string") {
+ buildMethod = function(elementValue, element) {
+ return elementValue + "
" ;
+ };
+ } else if (typeof _fields.iconSrc === "function") {
+ buildMethod = function(elementValue, element) {
+ return elementValue + "
" ;
+ };
+ }
+
+ return buildMethod;
+ }
+
+
+ if (template.type === "iconLeft") {
+
+ if (typeof _fields.iconSrc === "string") {
+ buildMethod = function(elementValue, element) {
+ return "
" + elementValue;
+ };
+ } else if (typeof _fields.iconSrc === "function") {
+ buildMethod = function(elementValue, element) {
+ return "
" + elementValue;
+ };
+ }
+
+ return buildMethod;
+ }
+
+ if(template.type === "links") {
+
+ if (typeof _fields.link === "string") {
+ buildMethod = function(elementValue, element) {
+ return "
" + elementValue + "";
+ };
+ } else if (typeof _fields.link === "function") {
+ buildMethod = function(elementValue, element) {
+ return "
" + elementValue + "";
+ };
+ }
+
+ return buildMethod;
+ }
+
+
+ if (template.type === "custom") {
+
+ return template.method;
+ }
+
+ return genericTemplates.basic.method;
+
+ },
+
+
+ prepareBuildMethod = function(options) {
+ if (!options || !options.type) {
+
+ return genericTemplates.basic.method;
+ }
+
+ if (options.type && genericTemplates[options.type]) {
+
+ return convertTemplateToMethod(options);
+ } else {
+
+ return genericTemplates.basic.method;
+ }
+
+ },
+
+ templateClass = function(options) {
+ var emptyStringFunction = function() {return "";};
+
+ if (!options || !options.type) {
+
+ return emptyStringFunction;
+ }
+
+ if (options.type && genericTemplates[options.type]) {
+ return (function () {
+ var _cssClass = genericTemplates[options.type].cssClass;
+ return function() { return _cssClass;};
+ })();
+ } else {
+ return emptyStringFunction;
+ }
+ };
+
+
+ this.getTemplateClass = templateClass(options);
+
+ this.build = prepareBuildMethod(options);
+
+
+ };
+
+ return scope;
+
+})(EasyAutocomplete || {});
+
+
+/*
+ * EasyAutocomplete - jQuery plugin for autocompletion
+ *
+ */
+var EasyAutocomplete = (function(scope) {
+
+
+ scope.main = function Core($input, options) {
+
+ var module = {
+ name: "EasyAutocomplete",
+ shortcut: "eac"
+ };
+
+ var consts = new scope.Constans(),
+ config = new scope.Configuration(options),
+ logger = new scope.Logger(),
+ template = new scope.Template(options.template),
+ listBuilderService = new scope.ListBuilderService(config, scope.proccess),
+ checkParam = config.equals,
+
+ $field = $input,
+ $container = "",
+ elementsList = [],
+ selectedElement = -1,
+ requestDelayTimeoutId;
+
+ scope.consts = consts;
+
+ this.getConstants = function() {
+ return consts;
+ };
+
+ this.getConfiguration = function() {
+ return config;
+ };
+
+ this.getContainer = function() {
+ return $container;
+ };
+
+ this.getSelectedItemIndex = function() {
+ return selectedElement;
+ };
+
+ this.getItems = function () {
+ return elementsList;
+ };
+
+ this.getItemData = function(index) {
+
+ if (elementsList.length < index || elementsList[index] === undefined) {
+ return -1;
+ } else {
+ return elementsList[index];
+ }
+ };
+
+ this.getSelectedItemData = function() {
+ return this.getItemData(selectedElement);
+ };
+
+ this.build = function() {
+ prepareField();
+ };
+
+ this.init = function() {
+ init();
+ };
+ function init() {
+
+ if ($field.length === 0) {
+ logger.error("Input field doesn't exist.");
+ return;
+ }
+
+ if (!config.checkDataUrlProperties()) {
+ logger.error("One of options variables 'data' or 'url' must be defined.");
+ return;
+ }
+
+ if (!config.checkRequiredProperties()) {
+ logger.error("Will not work without mentioned properties.");
+ return;
+ }
+
+
+ prepareField();
+ bindEvents();
+
+ }
+ function prepareField() {
+
+
+ if ($field.parent().hasClass(consts.getValue("WRAPPER_CSS_CLASS"))) {
+ removeContainer();
+ removeWrapper();
+ }
+
+ createWrapper();
+ createContainer();
+
+ $container = $("#" + getContainerId());
+ if (config.get("placeholder")) {
+ $field.attr("placeholder", config.get("placeholder"));
+ }
+
+
+ function createWrapper() {
+ var $wrapper = $("
"),
+ classes = consts.getValue("WRAPPER_CSS_CLASS");
+
+
+ if (config.get("theme") && config.get("theme") !== "") {
+ classes += " eac-" + config.get("theme");
+ }
+
+ if (config.get("cssClasses") && config.get("cssClasses") !== "") {
+ classes += " " + config.get("cssClasses");
+ }
+
+ if (template.getTemplateClass() !== "") {
+ classes += " " + template.getTemplateClass();
+ }
+
+
+ $wrapper
+ .addClass(classes);
+ $field.wrap($wrapper);
+
+
+ if (config.get("adjustWidth") === true) {
+ adjustWrapperWidth();
+ }
+
+
+ }
+
+ function adjustWrapperWidth() {
+ var fieldWidth = $field.outerWidth();
+
+ $field.parent().css("width", fieldWidth);
+ }
+
+ function removeWrapper() {
+ $field.unwrap();
+ }
+
+ function createContainer() {
+ var $elements_container = $("
").addClass(consts.getValue("CONTAINER_CLASS"));
+
+ $elements_container
+ .attr("id", getContainerId())
+ .prepend($("