X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.highlightText.js;h=7205620c14cc623b4cdccba01302e6af59507067;hb=b5f06bbd12193e3f4dfa00342f882de8afb72c52;hp=a6b93733a6663b31389dfd9f07d9e0f647117848;hpb=3161af599f06cf3abdc5c9baf1f5d6337f2cb815;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/jquery/jquery.highlightText.js b/resources/src/jquery/jquery.highlightText.js index a6b93733a6..7205620c14 100644 --- a/resources/src/jquery/jquery.highlightText.js +++ b/resources/src/jquery/jquery.highlightText.js @@ -3,7 +3,7 @@ * TODO: Add a function for restoring the previous text. * TODO: Accept mappings for converting shortcuts like WP: to Wikipedia:. */ -( function ( $, mw ) { +( function () { $.highlightText = { @@ -35,7 +35,7 @@ var i, match, pos, spannode, middlebit, middleclone; if ( node.nodeType === Node.TEXT_NODE ) { // TODO - need to be smarter about the character matching here. - // non latin characters can make regex think a new word has begun: do not use \b + // non Latin characters can make regex think a new word has begun: do not use \b // http://stackoverflow.com/questions/3787072/regex-wordwrap-with-utf8-characters-in-js // look for an occurrence of our pattern and store the starting position match = node.data.match( pat ); @@ -81,7 +81,8 @@ * @param {string} [options.method='splitAndHighlight'] Method of matching to use, one of: * - 'splitAndHighlight': Split `matchString` on spaces, then match each word separately. * - 'prefixHighlight': Match `matchString` at the beginning of text only. - * @return {[type]} [description] + * @return {jQuery} + * @chainable */ $.fn.highlightText = function ( matchString, options ) { options = options || {}; @@ -93,4 +94,4 @@ } ); }; -}( jQuery, mediaWiki ) ); +}() );