r96902 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96901‎ | r96902 | r96903 >
Date:20:55, 12 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added setting to disable js debugging
Modified paths:
  • /trunk/extensions/Survey/INSTALL (modified) (history)
  • /trunk/extensions/Survey/Survey.settings.php (modified) (history)
  • /trunk/extensions/Survey/includes/SurveyTag.php (modified) (history)
  • /trunk/extensions/Survey/resources/ext.survey.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Survey/Survey.settings.php
@@ -20,6 +20,7 @@
2121
2222 protected static function getDefaultSettings() {
2323 return array(
 24+ 'JSDebug' => false,
2425 'defaultEnabled' => false,
2526 'defaultUserType' => Survey::$USER_ALL,
2627 'defaultNamespaces' => array(),
Index: trunk/extensions/Survey/INSTALL
@@ -42,7 +42,7 @@
4343 You should NOT modify the settings file, but can have a look at it to get an idea of
4444 how to use the settings, in case the below descriptions do not suffice.
4545
46 -{|
 46+{| class="wikitable sortable"
4747 ! Name
4848 ! Type
4949 ! Default
@@ -77,4 +77,9 @@
7878 | integer
7979 | 0
8080 | The default minimun amount of pages users should visit before getting a survey
 81+| -
 82+| JSDebug
 83+| boolean
 84+| false
 85+| Indicates if JavaScript debugging should be on or not. Should be false on production environments.
8186 |}
Index: trunk/extensions/Survey/includes/SurveyTag.php
@@ -69,6 +69,11 @@
7070
7171 if ( !$loadedJs ) {
7272 $parser->getOutput()->addModules( 'ext.survey.tag' );
 73+ $parser->getOutput()->addHeadItem(
 74+ Skin::makeVariablesScript( array(
 75+ 'wgSurveyDebug' => SurveySettings::get( 'JSDebug' )
 76+ ) )
 77+ );
7378 }
7479
7580 return Html::element(
Index: trunk/extensions/Survey/resources/ext.survey.js
@@ -9,7 +9,7 @@
1010 window.survey = new( function() {
1111
1212 this.log = function( message ) {
13 - if ( true /* window.wgSurveyDebug */ ) { // TODO
 13+ if ( mediaWiki.config.get( 'wgSurveyDebug' ) ) {
1414 if ( typeof mediaWiki === 'undefined' ) {
1515 if ( typeof console !== 'undefined' ) {
1616 console.log( 'Survey: ' + message );

Status & tagging log