Merge "user: Allow "CAS update failed" exceptions to be normalised"
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets / mw.widgets.TitleOptionWidget.js
index 638f461..661f9ae 100644 (file)
@@ -4,7 +4,7 @@
  * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
  * @license The MIT License (MIT); see LICENSE.txt
  */
-( function ( $, mw ) {
+( function () {
 
        /**
         * Creates a mw.widgets.TitleOptionWidget object.
@@ -23,6 +23,7 @@
         * @cfg {boolean} [redirect] Page is a redirect
         * @cfg {boolean} [disambiguation] Page is a disambiguation page
         * @cfg {string} [query] Matching query string to highlight
+        * @cfg {string} [compare] String comparison function for query highlighting
         */
        mw.widgets.TitleOptionWidget = function MwWidgetsTitleOptionWidget( config ) {
                var icon;
@@ -50,6 +51,9 @@
                // Parent constructor
                mw.widgets.TitleOptionWidget.parent.call( this, config );
 
+               // Remove check icon
+               this.checkIcon.$element.remove();
+
                // Initialization
                this.$label.attr( 'href', config.url );
                this.$element.addClass( 'mw-widget-titleOptionWidget' );
@@ -69,7 +73,7 @@
 
                // Highlight matching parts of link suggestion
                if ( config.query ) {
-                       this.setHighlightedQuery( config.data, config.query );
+                       this.setHighlightedQuery( config.data, config.query, config.compare );
                }
                this.$label.attr( 'title', config.data );
 
 
        OO.inheritClass( mw.widgets.TitleOptionWidget, OO.ui.MenuOptionWidget );
 
-}( jQuery, mediaWiki ) );
+}() );