diff --git a/README.md b/README.md index ea4697b..2c9ce8a 100644 --- a/README.md +++ b/README.md @@ -18,24 +18,24 @@ html

Table test.

- - - - - - - - - - - - - - - - - -
namevalue
SatoTaro
SatoHanako
SuzukiJiro
田中半兵衛
+ + + + + + + + + + + + + + + + + +
namevalue
SatoTaro
SatoHanako
SuzukiJiro
田中半兵衛
@@ -52,4 +52,4 @@ Contact UshioShugo #TODO list -1. Ignore table header. +2. Add select html element. diff --git a/jquery.listSearch.js b/jquery.listSearch.js index f8129f8..e5426fa 100644 --- a/jquery.listSearch.js +++ b/jquery.listSearch.js @@ -75,7 +75,10 @@ var wordLength = searchWords.length; target.find(tagName).each(function(){ - var body = _this.getBody(this); + var thisJQuery = jQuery(this); + if (thisJQuery.data('ignore-list-search') === 'ignore') return true; + + var body = _this.getBody(thisJQuery); var displayFlag = true; var wordCount = 0; @@ -90,6 +93,7 @@ } jQuery(this).css('display', _this.getDisplayProperty(tagName, displayFlag)); + return true; }) }, @@ -117,7 +121,7 @@ * @returns {} */ getBody: function(target){ - var body = jQuery(target).text(); + var body = target.text(); return jQuery.trim(body); }, diff --git a/jquery.listSearch.min.js b/jquery.listSearch.min.js new file mode 100644 index 0000000..b8e718b --- /dev/null +++ b/jquery.listSearch.min.js @@ -0,0 +1,4 @@ +(function(d){var f=function(){};f.prototype={run:function(a,b){var c=this,d=b.get(0).tagName;a.on("keyup",function(h){text=c.getInputText(a);switch(d){case "TABLE":c.listSearchTable(b,text);break;case "UL":c.listSearchListUl(b,text);break;case "OL":c.listSearchListOl(b,text);break;case "DL":c.listSearchListDl(b,text);break;default:throw Error("Illegal tag name "+targetObject.targetTagName);}})},getInputText:function(a){return a.val()},listSearchTable:function(a,b){this.listSearchCommon("tr",a,b)}, +listSearchListUl:function(a,b){this.listSearchCommon("li",a,b)},listSearchListOl:function(a,b){return this.listSearchListUl(a,b)},listSearchListDl:function(a,b){this.listSearchCommon("dd dt",a,b)},listSearchCommon:function(a,b,c){var e=this,h=this.searchWordToWords(c),f=h.length;b.find(a).each(function(){var b=d(this);if("ignore"===b.data("ignore-list-search"))return!0;for(var b=e.getBody(b),c=!0,g=0,g=0;g=1.9.0" + "jquery": ">=1.7.0" } } diff --git a/sample.html b/sample.html index 2b41f79..d31f37e 100644 --- a/sample.html +++ b/sample.html @@ -3,8 +3,8 @@ jQuery.ListSearch - - + + @@ -21,7 +21,7 @@

Table test.

- +
namevalue