From 913ddae6367fe67769041e3f18caffd06e1a8c25 Mon Sep 17 00:00:00 2001 From: UshioShugo Date: Mon, 4 Feb 2013 09:32:41 +0900 Subject: [PATCH 01/18] change format. --- index.html | 12 ++++-------- js/jquery.listSearch.js | 36 ++++++++++-------------------------- listsearch.jquery.json | 2 +- 3 files changed, 15 insertions(+), 35 deletions(-) diff --git a/index.html b/index.html index 558b31e..a6c793a 100644 --- a/index.html +++ b/index.html @@ -12,13 +12,9 @@
@@ -63,4 +59,4 @@

Number list test.

- \ No newline at end of file + diff --git a/js/jquery.listSearch.js b/js/jquery.listSearch.js index 2755b1b..3920738 100644 --- a/js/jquery.listSearch.js +++ b/js/jquery.listSearch.js @@ -91,33 +91,17 @@ /** * Main stream */ - $.fn.listSearch = function(config, options){ - var options = $.extend($.fn.listSearch.defaults, options); + $.fn.listSearch = function(input, options){ + var options = $.extend($.fn.listSearch.defaults, options); - // config - var configLength = config.length; - for (var configCnt = 0; configCnt < configLength; configCnt ++){ - // chack target tag type - var target = $(config[configCnt]['target']); - - // get input jquery object; - var input = $(config[configCnt]['input']); - - // Event start - listSearch = new ListSearch(); - listSearch.start(input, target); - - // create new Object. - var targets = { - 'input': input, - 'target': target, - 'listSearchObject': listSearch - } - - config[configCnt] = targets; - } + var target = $(this); + input = $(input); + + // Event start + listSearch = new ListSearch(); + listSearch.start(input, target); - return $(this); + return target; }; /** @@ -126,4 +110,4 @@ $.fn.listSearch.defaults = { }; -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/listsearch.jquery.json b/listsearch.jquery.json index 7f4ef97..9fe094d 100644 --- a/listsearch.jquery.json +++ b/listsearch.jquery.json @@ -1,6 +1,6 @@ { "name": "listsearch", - "version": "0.1.0", + "version": "0.2.0", "title": "jQuery List Search", "author": { "name": "Ushio Shugo", From 225fce04da3eadfd571af951ec874172b5ef7b82 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Mon, 4 Feb 2013 09:36:39 +0900 Subject: [PATCH 02/18] Update README.md --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 22ef4a4..ea4697b 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,7 @@ javascript From 2288b5800d55b7c4b392f607b67c34794139f700 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 17:45:27 +0900 Subject: [PATCH 03/18] use 'jQuery' not '$' --- .gitignore | 4 ++++ index.html | 2 +- js/jquery.listSearch.js | 23 ++++++++++++++++------- 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d210807 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.project +.settings +*.swp +.DS_Store diff --git a/index.html b/index.html index a6c793a..88c377b 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ $(function(){ $('#searchTable').listSearch('#tableText'); $('#searchList').listSearch('#listText'); - $('#searchNumberList').listSearch('#numberListText'); + $('#searchNumberList').listSearch($('#numberListText')); });
diff --git a/js/jquery.listSearch.js b/js/jquery.listSearch.js index 3920738..b85c24d 100644 --- a/js/jquery.listSearch.js +++ b/js/jquery.listSearch.js @@ -1,6 +1,5 @@ -(function($){ +(function(jQuery){ var ListSearch = function() {}; - ListSearch.prototype = { /** * start list search @@ -91,11 +90,21 @@ /** * Main stream */ - $.fn.listSearch = function(input, options){ - var options = $.extend($.fn.listSearch.defaults, options); + jQuery.fn.listSearch = function(input, options){ + var options = jQuery.extend(jQuery.fn.listSearch.defaults, options); - var target = $(this); - input = $(input); + // set using objects. + var target = jQuery(this); + switch (jQuery.type(input)){ + case 'string': + input = $(input); + break; + case 'object': + input = input; + break; + default: + throw 'input object is invalid.'; + } // Event start listSearch = new ListSearch(); @@ -107,7 +116,7 @@ /** * default settings. */ - $.fn.listSearch.defaults = { + jQuery.fn.listSearch.defaults = { }; })(jQuery); From 60f7a6d779ed229a18297266c9fa46821face2e8 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 17:58:07 +0900 Subject: [PATCH 04/18] add argument validation. --- js/jquery.listSearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.listSearch.js b/js/jquery.listSearch.js index b85c24d..26a9b76 100644 --- a/js/jquery.listSearch.js +++ b/js/jquery.listSearch.js @@ -103,7 +103,7 @@ input = input; break; default: - throw 'input object is invalid.'; + throw 'Argiment value "' + input + '" is invalid.'; } // Event start From 4ebda729e41f3117766468cbf38c63998cdd8f94 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 18:13:53 +0900 Subject: [PATCH 05/18] change directories. --- index.html | 62 -------------------- js/jquery.listSearch.js | 122 ---------------------------------------- 2 files changed, 184 deletions(-) delete mode 100644 index.html delete mode 100644 js/jquery.listSearch.js diff --git a/index.html b/index.html deleted file mode 100644 index 88c377b..0000000 --- a/index.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - -jQuery.ListSearch - - - - - - -
-

Table test.

- - - - - - - - - - - - - - - - - -
namevalue
SatoTaro
SatoHanako
SuzukiJiro
田中半兵衛
-
- -
-

List test.

- -
    -
  • iPod touch
  • -
  • iPhone 4G
  • -
  • Mac book air
  • -
-
- -
-

Number list test.

- -
    -
  1. iPod touch
  2. -
  3. iPhone 4G
  4. -
  5. Mac book air
  6. -
-
- - diff --git a/js/jquery.listSearch.js b/js/jquery.listSearch.js deleted file mode 100644 index 26a9b76..0000000 --- a/js/jquery.listSearch.js +++ /dev/null @@ -1,122 +0,0 @@ -(function(jQuery){ - var ListSearch = function() {}; - ListSearch.prototype = { - /** - * start list search - */ - start: function(input, target){ - var _this = this; - var tagName = target.get(0).tagName; - - input.on('keyup', function(e){ - text = _this.getInputText(input); - - switch(tagName){ - case 'TABLE': - _this.listSearchTable(target, text); - break; - case 'UL': - _this.listSearchListUl(target, text); - break; - case 'OL': - _this.listSearchListOl(target, text); - break; - case 'DL': - _this.listSearchListDl(target, text); - break; - default: - throw new Error('Illegal tag name ' + targetObject.targetTagName); - } - }); - }, - - getInputText: function(input){ - return input.val(); - }, - - /** - * tag table - */ - listSearchTable: function(target, text){ - this.listSearchCommon('tr', target, text); - }, - - /** - * tag ul - */ - listSearchListUl: function(target, text){ - this.listSearchCommon('li', target, text); - }, - - /** - * tag ol - */ - listSearchListOl: function(target, text){ - return this.listSearchListUl(target, text); - }, - - /** - * tag dl - */ - listSearchListDl: function(target, text){ - this.listSearchCommon('dd dt', target, text); - }, - - /** - * commondSearchList - */ - listSearchCommon: function(tagName ,target, text){ - var _this = this; - target.find(tagName).each(function(){ - var displayFlag = $(this).text().match(text); - $(this).css('display', _this.getDisplayProperty(tagName, displayFlag)); - }) - }, - - getDisplayProperty: function(tagName, flag){ - switch(tagName){ - case 'tr': - return flag?'table-row':'none'; - case 'li': - return flag?'list-item':'none'; - case 'dd dt': - return flag?'list-item':'none'; - default: - throw new Error('Illegal tag name ' + targetObject.targetTagName); - } - } - } - - /** - * Main stream - */ - jQuery.fn.listSearch = function(input, options){ - var options = jQuery.extend(jQuery.fn.listSearch.defaults, options); - - // set using objects. - var target = jQuery(this); - switch (jQuery.type(input)){ - case 'string': - input = $(input); - break; - case 'object': - input = input; - break; - default: - throw 'Argiment value "' + input + '" is invalid.'; - } - - // Event start - listSearch = new ListSearch(); - listSearch.start(input, target); - - return target; - }; - - /** - * default settings. - */ - jQuery.fn.listSearch.defaults = { - - }; -})(jQuery); From 7b71f4fb9b9c843ec102194cdf1493a59beb9069 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 18:14:02 +0900 Subject: [PATCH 06/18] change directories. --- jquery.listSearch.js | 122 +++++++++++++++++++++++++++++++++++++++++++ sample.html | 62 ++++++++++++++++++++++ 2 files changed, 184 insertions(+) create mode 100644 jquery.listSearch.js create mode 100644 sample.html diff --git a/jquery.listSearch.js b/jquery.listSearch.js new file mode 100644 index 0000000..472e090 --- /dev/null +++ b/jquery.listSearch.js @@ -0,0 +1,122 @@ +(function(jQuery){ + var ListSearch = function() {}; + ListSearch.prototype = { + /** + * start list search + */ + run: function(input, target){ + var _this = this; + var tagName = target.get(0).tagName; + + input.on('keyup', function(e){ + text = _this.getInputText(input); + + switch(tagName){ + case 'TABLE': + _this.listSearchTable(target, text); + break; + case 'UL': + _this.listSearchListUl(target, text); + break; + case 'OL': + _this.listSearchListOl(target, text); + break; + case 'DL': + _this.listSearchListDl(target, text); + break; + default: + throw new Error('Illegal tag name ' + targetObject.targetTagName); + } + }); + }, + + getInputText: function(input){ + return input.val(); + }, + + /** + * tag table + */ + listSearchTable: function(target, text){ + this.listSearchCommon('tr', target, text); + }, + + /** + * tag ul + */ + listSearchListUl: function(target, text){ + this.listSearchCommon('li', target, text); + }, + + /** + * tag ol + */ + listSearchListOl: function(target, text){ + return this.listSearchListUl(target, text); + }, + + /** + * tag dl + */ + listSearchListDl: function(target, text){ + this.listSearchCommon('dd dt', target, text); + }, + + /** + * commondSearchList + */ + listSearchCommon: function(tagName ,target, text){ + var _this = this; + target.find(tagName).each(function(){ + var displayFlag = $(this).text().match(text); + $(this).css('display', _this.getDisplayProperty(tagName, displayFlag)); + }) + }, + + getDisplayProperty: function(tagName, flag){ + switch(tagName){ + case 'tr': + return flag?'table-row':'none'; + case 'li': + return flag?'list-item':'none'; + case 'dd dt': + return flag?'list-item':'none'; + default: + throw new Error('Illegal tag name ' + targetObject.targetTagName); + } + } + } + + /** + * Main stream + */ + jQuery.fn.listSearch = function(input, options){ + var options = jQuery.extend(jQuery.fn.listSearch.defaults, options); + + // set using objects. + var target = jQuery(this); + switch (jQuery.type(input)){ + case 'string': + input = $(input); + break; + case 'object': + input = input; + break; + default: + throw 'Argiment value "' + input + '" is invalid.'; + } + + // Event start + listSearch = new ListSearch(); + listSearch.run(input, target); + + return target; + }; + + /** + * default settings. + */ + jQuery.fn.listSearch.defaults = { + + }; +})(jQuery); diff --git a/sample.html b/sample.html new file mode 100644 index 0000000..2b41f79 --- /dev/null +++ b/sample.html @@ -0,0 +1,62 @@ + + + + +jQuery.ListSearch + + + + + + +
+

Table test.

+ + + + + + + + + + + + + + + + + +
namevalue
SatoTaro
SatoHanako
SuzukiJiro
田中半兵衛
+
+ +
+

List test.

+ +
    +
  • iPod touch
  • +
  • iPhone 4G
  • +
  • Mac book air
  • +
+
+ +
+

Number list test.

+ +
    +
  1. iPod touch
  2. +
  3. iPhone 4G
  4. +
  5. Mac book air
  6. +
+
+ + From f408e9474cb400d6813bd5b4b9283555c4e2d99f Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 19:13:10 +0900 Subject: [PATCH 07/18] update search algorithm --- jquery.listSearch.js | 64 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/jquery.listSearch.js b/jquery.listSearch.js index 472e090..bab0e97 100644 --- a/jquery.listSearch.js +++ b/jquery.listSearch.js @@ -2,7 +2,11 @@ var ListSearch = function() {}; ListSearch.prototype = { /** - * start list search + * run + * start incremental search. + * @param {} input + * @param {} target + * @returns {} */ run: function(input, target){ var _this = this; @@ -67,12 +71,32 @@ */ listSearchCommon: function(tagName ,target, text){ var _this = this; + var searchWords = this.searchWordToWords(text); + var wordLength = searchWords.length; + target.find(tagName).each(function(){ - var displayFlag = $(this).text().match(text); - $(this).css('display', _this.getDisplayProperty(tagName, displayFlag)); + var body = _this.getBody(this); + var displayFlag = true; + + var wordCount = 0; + for(wordCount = 0; wordCount < wordLength; wordCount++){ + var word = searchWords[wordCount]; + if ( !body.match(word) ) { + displayFlag = false; + break; + } + } + + jQuery(this).css('display', _this.getDisplayProperty(tagName, displayFlag)); }) }, + /** + * getDisplayProperty + * @param {} tagName + * @param {} flag + * @returns {} + */ getDisplayProperty: function(tagName, flag){ switch(tagName){ case 'tr': @@ -84,6 +108,38 @@ default: throw new Error('Illegal tag name ' + targetObject.targetTagName); } + }, + + /** + * getBody + * @returns {} + */ + getBody: function(target){ + var body = jQuery(target).text(); + return jQuery.trim(body); + }, + + /** + * searchWordToWords + * a search text split to search words. + * @param {} body + * @param {} searchWord + * @returns {} + */ + searchWordToWords: function(text){ + text = jQuery.trim(text); + var words = text.split(/[  \-\/]/); + + // delete empty element + var wordsLength = words.length; + var wordsCount = 0; + for (wordsCount = 0; wordsCount < wordsLength; wordsCount++){ + var word = words[wordsCount]; + if (word == ""){ + delete words[wordsCount]; + } + } + return words; } } @@ -97,7 +153,7 @@ var target = jQuery(this); switch (jQuery.type(input)){ case 'string': - input = $(input); + input = jQuery(input); break; case 'object': input = input; From 0936fee19275b23606366ca7bd3a377950a44b88 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 19:24:15 +0900 Subject: [PATCH 08/18] match regexp add 'i' option --- jquery.listSearch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jquery.listSearch.js b/jquery.listSearch.js index bab0e97..793751b 100644 --- a/jquery.listSearch.js +++ b/jquery.listSearch.js @@ -81,7 +81,9 @@ var wordCount = 0; for(wordCount = 0; wordCount < wordLength; wordCount++){ var word = searchWords[wordCount]; - if ( !body.match(word) ) { + + var pattern = new RegExp(word, 'i'); + if ( !body.match(pattern) ) { displayFlag = false; break; } From cc8cd5dd46191edbce6efeef3c53854a4a044071 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 19:28:38 +0900 Subject: [PATCH 09/18] refact --- jquery.listSearch.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jquery.listSearch.js b/jquery.listSearch.js index 793751b..f8129f8 100644 --- a/jquery.listSearch.js +++ b/jquery.listSearch.js @@ -130,18 +130,20 @@ */ searchWordToWords: function(text){ text = jQuery.trim(text); - var words = text.split(/[  \-\/]/); + var pattern = new RegExp(/[  \-\/]/); + var words = text.split(pattern); // delete empty element + var newWords = new Array(); var wordsLength = words.length; var wordsCount = 0; for (wordsCount = 0; wordsCount < wordsLength; wordsCount++){ var word = words[wordsCount]; - if (word == ""){ - delete words[wordsCount]; + if (word != ""){ + newWords.push(words[wordsCount]); } } - return words; + return newWords; } } From 598126b4c81253e6a5c912b4ad1f9264676485e6 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 20:01:29 +0900 Subject: [PATCH 10/18] change manifest --- listsearch.jquery.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/listsearch.jquery.json b/listsearch.jquery.json index 9fe094d..df1bf83 100644 --- a/listsearch.jquery.json +++ b/listsearch.jquery.json @@ -1,6 +1,6 @@ { "name": "listsearch", - "version": "0.2.0", + "version": "0.3.0", "title": "jQuery List Search", "author": { "name": "Ushio Shugo", @@ -16,10 +16,14 @@ "url": "http://www.opensource.org/licenses/mit-license.php" } ], - "description": "Incremental search for table, ul and ol tags. Perfect match only.", + "demos": [ + "dropbox": "https://dl-web.dropbox.com/get/Public/jQueryPlugins/jQuery.ListSearch/sample.html?w=AADjrV5tuzthgdylHvVZlDLG-DQaHqdSHfjYGOMhkl69tQ" + ], + "bugs": "https://github.com/ushios/jQuery.ListSearch/issues", + "docs": "https://github.com/ushios/jQuery.ListSearch/blob/master/README.md", + "homepage": "https://github.com/ushios/jQuery.ListSearch", + "description": "Incremental search for table, ul and ol tags.", "keywords": ["incremental", "search", "list", "table", "ul", "li", "ol"], - "homepage": "", - "demo": "", "dependencies": { "jquery": ">=1.9.0" } From e7a1458017802dcca4898859cdd56069bca021d3 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 20:05:10 +0900 Subject: [PATCH 11/18] change manifest indent --- listsearch.jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/listsearch.jquery.json b/listsearch.jquery.json index df1bf83..1df9049 100644 --- a/listsearch.jquery.json +++ b/listsearch.jquery.json @@ -17,7 +17,7 @@ } ], "demos": [ - "dropbox": "https://dl-web.dropbox.com/get/Public/jQueryPlugins/jQuery.ListSearch/sample.html?w=AADjrV5tuzthgdylHvVZlDLG-DQaHqdSHfjYGOMhkl69tQ" + "dropbox": "https://dl-web.dropbox.com/get/Public/jQueryPlugins/jQuery.ListSearch/sample.html?w=AADjrV5tuzthgdylHvVZlDLG-DQaHqdSHfjYGOMhkl69tQ" ], "bugs": "https://github.com/ushios/jQuery.ListSearch/issues", "docs": "https://github.com/ushios/jQuery.ListSearch/blob/master/README.md", From 743071ae6cd9dca5eb105e99fc22ce44ff93d44f Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 20:14:00 +0900 Subject: [PATCH 12/18] fix manifest file. --- listsearch.jquery.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/listsearch.jquery.json b/listsearch.jquery.json index 1df9049..bb92304 100644 --- a/listsearch.jquery.json +++ b/listsearch.jquery.json @@ -16,9 +16,7 @@ "url": "http://www.opensource.org/licenses/mit-license.php" } ], - "demos": [ - "dropbox": "https://dl-web.dropbox.com/get/Public/jQueryPlugins/jQuery.ListSearch/sample.html?w=AADjrV5tuzthgdylHvVZlDLG-DQaHqdSHfjYGOMhkl69tQ" - ], + "demo": "https://dl-web.dropbox.com/get/Public/jQueryPlugins/jQuery.ListSearch/sample.html?w=AADjrV5tuzthgdylHvVZlDLG-DQaHqdSHfjYGOMhkl69tQ", "bugs": "https://github.com/ushios/jQuery.ListSearch/issues", "docs": "https://github.com/ushios/jQuery.ListSearch/blob/master/README.md", "homepage": "https://github.com/ushios/jQuery.ListSearch", From 1d4630c3987f81d9bebc917245d943c0c5636f3c Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 20:24:48 +0900 Subject: [PATCH 13/18] update manifest --- listsearch.jquery.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/listsearch.jquery.json b/listsearch.jquery.json index bb92304..4d9b7ef 100644 --- a/listsearch.jquery.json +++ b/listsearch.jquery.json @@ -1,6 +1,6 @@ { "name": "listsearch", - "version": "0.3.0", + "version": "0.3.1", "title": "jQuery List Search", "author": { "name": "Ushio Shugo", From c1e1e03a446d2735192fdd291c6eb905d314a283 Mon Sep 17 00:00:00 2001 From: Ushio Shugo Date: Sat, 9 Feb 2013 20:28:28 +0900 Subject: [PATCH 14/18] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ea4697b..efaefc8 100644 --- a/README.md +++ b/README.md @@ -53,3 +53,4 @@ UshioShugo #TODO list 1. Ignore table header. +2. Add select html element. From aee2a9dfe2ce10ea2ecf357d737a88b5e469daf1 Mon Sep 17 00:00:00 2001 From: UshioShugo Date: Mon, 15 Apr 2013 17:55:26 +0900 Subject: [PATCH 15/18] remove demo --- listsearch.jquery.json | 1 - 1 file changed, 1 deletion(-) diff --git a/listsearch.jquery.json b/listsearch.jquery.json index 4d9b7ef..b47cf97 100644 --- a/listsearch.jquery.json +++ b/listsearch.jquery.json @@ -16,7 +16,6 @@ "url": "http://www.opensource.org/licenses/mit-license.php" } ], - "demo": "https://dl-web.dropbox.com/get/Public/jQueryPlugins/jQuery.ListSearch/sample.html?w=AADjrV5tuzthgdylHvVZlDLG-DQaHqdSHfjYGOMhkl69tQ", "bugs": "https://github.com/ushios/jQuery.ListSearch/issues", "docs": "https://github.com/ushios/jQuery.ListSearch/blob/master/README.md", "homepage": "https://github.com/ushios/jQuery.ListSearch", From c5226f295aefab3658636e5ba18d51829b6291b1 Mon Sep 17 00:00:00 2001 From: UshioShugo Date: Fri, 26 Apr 2013 13:08:53 +0900 Subject: [PATCH 16/18] add ignore option. --- README.md | 36 ++++++++++++++++++------------------ jquery.listSearch.js | 8 ++++++-- listsearch.jquery.json | 4 ++-- sample.html | 4 ++-- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index efaefc8..ffdf026 100644 --- a/README.md +++ b/README.md @@ -18,24 +18,24 @@ html

Table test.

- - - - - - - - - - - - - - - - - -
namevalue
SatoTaro
SatoHanako
SuzukiJiro
田中半兵衛
+ + + + + + + + + + + + + + + + + +
namevalue
SatoTaro
SatoHanako
SuzukiJiro
田中半兵衛
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/listsearch.jquery.json b/listsearch.jquery.json index b47cf97..ce50180 100644 --- a/listsearch.jquery.json +++ b/listsearch.jquery.json @@ -1,6 +1,6 @@ { "name": "listsearch", - "version": "0.3.1", + "version": "0.4.0", "title": "jQuery List Search", "author": { "name": "Ushio Shugo", @@ -22,6 +22,6 @@ "description": "Incremental search for table, ul and ol tags.", "keywords": ["incremental", "search", "list", "table", "ul", "li", "ol"], "dependencies": { - "jquery": ">=1.9.0" + "jquery": ">=1.7.0" } } diff --git a/sample.html b/sample.html index 2b41f79..3dab19b 100644 --- a/sample.html +++ b/sample.html @@ -3,7 +3,7 @@ jQuery.ListSearch - + From bc0bab14ca7816d6e0a3cba60cfbf40477cca02e Mon Sep 17 00:00:00 2001 From: UshioShugo Date: Fri, 26 Apr 2013 13:14:10 +0900 Subject: [PATCH 18/18] fix readme. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index ffdf026..2c9ce8a 100644 --- a/README.md +++ b/README.md @@ -52,5 +52,4 @@ Contact UshioShugo #TODO list -1. Ignore table header. 2. Add select html element.