// manually merge of modules search
This commit is contained in:
1 parent
486e6c1b66
commit
2e65214c39
5 files changed
+29
-23
No files matched your search
@@ -66,22 +66,11 @@
|
|||||||
if (anchor != '')
|
if (anchor != '')
|
||||||
$.scrollTo('#'+anchor, 1200, {offset: -100});
|
$.scrollTo('#'+anchor, 1200, {offset: -100});
|
||||||
|
|
||||||
// AutoComplete Search
|
$('#moduleQuicksearch').keyup(function() {
|
||||||
$('input[name="filtername"]').autocomplete(moduleList, {
|
console.log(this.value);
|
||||||
minChars: 0,
|
$.uiTableFilter($('#moduleContainer').find('table'), this.value);
|
||||||
width: 310,
|
|
||||||
matchContains: true,
|
|
||||||
highlightItem: true,
|
|
||||||
formatItem: function(row, i, max, term) {
|
|
||||||
var image = '../modules/'+row.name+'/logo.gif';
|
|
||||||
if (row.image != '')
|
|
||||||
image = row.image;
|
|
||||||
return '<img src="'+image+'" style="float:left;margin:5px;width:16px;height:16px"><strong>'+row.displayName+'</strong>'+((row.author != '') ? ' ' + by + ' ' + truncate_author(row.author) : '') + '<br /><span style="font-size: 80%;">'+ row.desc +'</span><br/><div style="height:15px;padding-top:5px">'+ row.option +'</div>';
|
|
||||||
},
|
|
||||||
formatResult: function(row) {
|
|
||||||
return row.displayName;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input[name="filtername"]').result(function(event, data, formatted) {
|
$('input[name="filtername"]').result(function(event, data, formatted) {
|
||||||
$('#filternameForm').submit();
|
$('#filternameForm').submit();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -75,12 +75,7 @@
|
|||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
<form id="filternameForm" method="post" class="list-group-item form-horizontal">
|
<form id="filternameForm" method="post" class="list-group-item form-horizontal">
|
||||||
<div class="input-group col-lg-12">
|
<div class="input-group col-lg-12">
|
||||||
<input type="text" value="" name="filtername" autocomplete="off" class="ac_input">
|
<input placeholder="{l s='Search'}" type="text" value="" name="moduleQuicksearch" id="moduleQuicksearch" autocomplete="off" />
|
||||||
<span class="input-group-btn">
|
|
||||||
<button class="btn btn-default" type="submit">
|
|
||||||
<i class="icon-search"></i> {l s='Search'}
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<a class="list-group-item {if isset($categoryFiltered.favorites)}active{/if}" href="{$currentIndex}&token={$token}&filterCategory=favorites">
|
<a class="list-group-item {if isset($categoryFiltered.favorites)}active{/if}" href="{$currentIndex}&token={$token}&filterCategory=favorites">
|
||||||
|
|||||||
+1
-1
@@ -292,7 +292,7 @@ class MediaCore
|
|||||||
$url_data = parse_url($folder.$file);
|
$url_data = parse_url($folder.$file);
|
||||||
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
|
$file_uri = _PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, $url_data['path']);
|
||||||
$ui_tmp = array();
|
$ui_tmp = array();
|
||||||
if (self::$jquery_ui_dependencies[$component]['theme'] && $check_dependencies)
|
if (isset(Media::$jquery_ui_dependencies[$component]) && Media::$jquery_ui_dependencies[$component]['theme'] && $check_dependencies)
|
||||||
{
|
{
|
||||||
$theme_css = Media::getCSSPath($folder.'themes/'.$theme.'/jquery.ui.theme.css');
|
$theme_css = Media::getCSSPath($folder.'themes/'.$theme.'/jquery.ui.theme.css');
|
||||||
$comp_css = Media::getCSSPath($folder.'themes/'.$theme.'/jquery.'.$component.'.css');
|
$comp_css = Media::getCSSPath($folder.'themes/'.$theme.'/jquery.'.$component.'.css');
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
public function setMedia()
|
public function setMedia()
|
||||||
{
|
{
|
||||||
parent::setMedia();
|
parent::setMedia();
|
||||||
$this->addJqueryPlugin(array('autocomplete', 'fancybox'));
|
$this->addJqueryPlugin(array('autocomplete', 'fancybox', 'tablefilter'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ajaxProcessRefreshModuleList()
|
public function ajaxProcessRefreshModuleList()
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008 Greg Weber greg at gregweber.info
|
||||||
|
* Dual licensed under the MIT and GPLv2 licenses just as jQuery is:
|
||||||
|
* http://jquery.org/license
|
||||||
|
*
|
||||||
|
* documentation at http://gregweber.info/projects/uitablefilter
|
||||||
|
*
|
||||||
|
* allows table rows to be filtered (made invisible)
|
||||||
|
* <code>
|
||||||
|
* t = $('table')
|
||||||
|
* $.uiTableFilter( t, phrase )
|
||||||
|
* </code>
|
||||||
|
* arguments:
|
||||||
|
* jQuery object containing table rows
|
||||||
|
* phrase to search for
|
||||||
|
* optional arguments:
|
||||||
|
* column to limit search too (the column title in the table header)
|
||||||
|
* ifHidden - callback to execute if one or more elements was hidden
|
||||||
|
*/
|
||||||
|
(function($){$.uiTableFilter=function(jq,phrase,column,ifHidden){var new_hidden=false;if(this.last_phrase===phrase)return false;var phrase_length=phrase.length;var words=phrase.toLowerCase().split(" ");var matches=function(elem){elem.show()};var noMatch=function(elem){elem.hide();new_hidden=true};var getText=function(elem){return elem.text()};if(column){var index=null;jq.find("thead > tr:last > th").each(function(i){if($.trim($(this).text())==column){index=i;return false}});if(index==null)throw"given column: "+
|
||||||
|
column+" not found";getText=function(elem){return $(elem.find("td:eq("+index+")")).text()}}if(words.size>1&&phrase.substr(0,phrase_length-1)===this.last_phrase){if(phrase[-1]===" "){this.last_phrase=phrase;return false}var words=words[-1];matches=function(elem){};var elems=jq.find("tbody:first > tr:visible")}else{new_hidden=true;var elems=jq.find("tbody:first > tr")}elems.each(function(){var elem=$(this);$.uiTableFilter.has_words(getText(elem),words,false)?matches(elem):noMatch(elem)});last_phrase=
|
||||||
|
phrase;if(ifHidden&&new_hidden)ifHidden();return jq};$.uiTableFilter.last_phrase="";$.uiTableFilter.has_words=function(str,words,caseSensitive){var text=caseSensitive?str:str.toLowerCase();for(var i=0;i<words.length;i++)if(text.indexOf(words[i])===-1)return false;return true}})(jQuery);
|
||||||
Reference in new issue
Block a user