Bugzilla – Attachment 25310 Details for
Bug 11748
Remove unused jquery.uitablefilter.js plugin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11748 - Remove unused jquery.uitablefilter.js plugin
Bug-11748---Remove-unused-jqueryuitablefilterjs-pl.patch (text/plain), 3.77 KB, created by
Chris Cormack
on 2014-02-16 05:23:51 UTC
(
hide
)
Description:
Bug 11748 - Remove unused jquery.uitablefilter.js plugin
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-02-16 05:23:51 UTC
Size:
3.77 KB
patch
obsolete
>From 48927be158a7439d702018f6250708b02a5bf4e0 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 12 Feb 2014 09:49:57 -0500 >Subject: [PATCH] Bug 11748 - Remove unused jquery.uitablefilter.js plugin > >This patch removes a jQuery plugin which was added for use with the old >tablesorter plugin. Since the tablesorter plugin has been removed and >replaced with DataTables this plugin can also be removed. > >To test, apply the patch and search for instances of the plugin: > >grep -r -l "jquery.uitablefilter.js" * > >There should be no results. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > .../en/lib/jquery/plugins/jquery.uitablefilter.js | 90 ---------------------- > 1 file changed, 90 deletions(-) > delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.uitablefilter.js > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.uitablefilter.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.uitablefilter.js >deleted file mode 100644 >index d80c8dd..0000000 >--- a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.uitablefilter.js >+++ /dev/null >@@ -1,90 +0,0 @@ >-/* >- * Copyright (c) 2008 Greg Weber greg at gregweber.info >- * Dual licensed under the MIT and GPL licenses: >- * http://www.opensource.org/licenses/mit-license.php >- * http://www.gnu.org/licenses/gpl.html >- * >- * 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 >- */ >-jQuery.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(" "); >- >- // these function pointers may change >- 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 jQuery(elem.find( >- ("td:eq(" + index + ")") )).text() >- } >- } >- >- // if added one letter to last time, >- // just check newest word and only need to hide >- 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]; // just search for the newest word >- >- // only hide visible rows >- matches = function(elem) {;} >- var elems = jq.find("tbody > tr:visible") >- } >- else { >- new_hidden = true; >- var elems = jq.find("tbody > tr") >- } >- >- elems.each(function(){ >- var elem = jQuery(this); >- jQuery.uiTableFilter.has_words( getText(elem), words, false ) ? >- matches(elem) : noMatch(elem); >- }); >- >- last_phrase = phrase; >- if( ifHidden && new_hidden ) ifHidden(); >- return jq; >-}; >- >-// caching for speedup >-jQuery.uiTableFilter.last_phrase = "" >- >-// not jQuery dependent >-// "" [""] -> Boolean >-// "" [""] Boolean -> Boolean >-jQuery.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; >-} >-- >1.8.5.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11748
:
25209
|
25310
|
25340