Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -10,6 +10,8 @@ |
11 | 11 | |
12 | 12 | /* Static Members */ |
13 | 13 | |
| 14 | + static $modulesAdded = false; |
| 15 | + |
14 | 16 | static $scripts = array( |
15 | 17 | 'raw' => array( |
16 | 18 | array( 'src' => 'Modules/Highlight/Highlight.js', 'version' => 5 ), |
— | — | @@ -411,7 +413,11 @@ |
412 | 414 | */ |
413 | 415 | public static function addModules( &$toolbar ) { |
414 | 416 | global $wgUser, $wgWikiEditorModules, $wgUsabilityInitiativeResourceMode; |
415 | | - |
| 417 | + |
| 418 | + if ( self::$modulesAdded ) { |
| 419 | + return true; |
| 420 | + } |
| 421 | + |
416 | 422 | // Modules |
417 | 423 | $preferences = array(); |
418 | 424 | $enabledModules = array(); |
— | — | @@ -470,6 +476,7 @@ |
471 | 477 | 'wgWikiEditorPreferences' => $preferences, |
472 | 478 | 'wgWikiEditorEnabledModules' => $enabledModules, |
473 | 479 | ) ); |
| 480 | + self::$modulesAdded = true; |
474 | 481 | return true; |
475 | 482 | } |
476 | 483 | |