r104465 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104464‎ | r104465 | r104466 >
Date:18:26, 28 November 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
* (bug 32685) Fix error in Vector extension's SimpleSearch module if the module is disabled but individual users have the option for it still

The module gets loaded if the user has the setting, even if we've not turned on $wgVectorUseSimpleSearch.
Tweaked so it aborts itself if its magic area isn't actually there, so it won't explode.
Modified paths:
  • /trunk/extensions/Vector/modules/ext.vector.simpleSearch.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Vector/modules/ext.vector.simpleSearch.js
@@ -2,6 +2,14 @@
33
44 jQuery( document ).ready( function( $ ) {
55
 6+ // Ensure that the thing is actually present!
 7+ if ($('#simpleSearch').length == 0) {
 8+ // Don't try to set anything up if simpleSearch is disabled sitewide.
 9+ // The loader code loads us if the option is present, even if we're
 10+ // not actually enabled (anymore).
 11+ return;
 12+ }
 13+
614 // Compatibility map
715 var map = {
816 'browsers': {

Comments

#Comment by Nikerabbit (talk | contribs)   07:19, 30 November 2011

Could use more whitespace :)

#Comment by Brion VIBBER (talk | contribs)   07:22, 30 November 2011

poop, I got so used to writing JS in the other style I forget we've mostly standardized our JS to the same whitespace as our PHP. :DD I'll try to remember in future.

Status & tagging log