r73162 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73161‎ | r73162 | r73163 >
Date:22:20, 16 September 2010
Author:tparscal
Status:ok
Tags:
Comment:
Table of contents is working now - fixed dependency issues and removed some globals that are no longer needed.
Modified paths:
  • /trunk/extensions/WikiEditor/WikiEditor.hooks.php (modified) (history)
  • /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js (modified) (history)
  • /trunk/extensions/WikiEditor/modules/wikiEditor.toc.js (modified) (history)

Diff [purge]

Index: trunk/extensions/WikiEditor/WikiEditor.hooks.php
@@ -79,7 +79,11 @@
8080 'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.toc.js',
8181 'styles' => 'extensions/WikiEditor/modules/jquery.wikiEditor.toc.css',
8282 'dependencies' => array(
83 - 'jquery.wikiEditor', 'jquery.ui.draggable', 'jquery.ui.resizable'
 83+ 'jquery.wikiEditor',
 84+ 'jquery.ui.draggable',
 85+ 'jquery.ui.resizable',
 86+ 'jquery.autoEllipsis',
 87+ 'jquery.color',
8488 ),
8589 ),
8690 'jquery.wikiEditor.toolbar' => array(
@@ -548,11 +552,6 @@
549553 'modules' => array(
550554 'wikiEditor.toc',
551555 ),
552 - 'configurations' => array(
553 - // These are probably only for testing purposes?
554 - 'wgNavigableTOCCollapseEnable',
555 - 'wgNavigableTOCResizable'
556 - ),
557556 ),
558557 );
559558
Index: trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toc.js
@@ -446,7 +446,7 @@
447447 */
448448 function buildList( structure ) {
449449 var list = $( '<ul />' );
450 - for ( i in structure ) {
 450+ for ( var i = 0; i < structure.length; i++ ) {
451451 var div = $( '<div />' )
452452 .addClass( 'section-' + structure[i].index )
453453 .data( 'index', structure[i].index )
@@ -641,7 +641,7 @@
642642 }
643643 context.modules.toc.$toc.html( buildList( structure ) );
644644
645 - if ( wgNavigableTOCResizable && !context.$ui.data( 'resizableDone' ) ) {
 645+ if ( !context.$ui.data( 'resizableDone' ) ) {
646646 buildResizeControls();
647647 buildCollapseControls();
648648 }
Index: trunk/extensions/WikiEditor/modules/wikiEditor.toc.js
@@ -5,7 +5,7 @@
66 $( document ).ready( function() {
77 // Add table of contents module
88 $( '#wpTextbox1' )
9 - .wikiEditor( 'addModule', 'toc' )
 9+ .wikiEditor( 'addModule', 'toc' );
1010 // FIXME - should move the ready handler code to the create function so this isn't necissary
11 - .data( 'wikiEditor-context' ).fn.trigger( 'ready' );
 11+ //.data( 'wikiEditor-context' ).fn.trigger( 'ready' );
1212 } );

Status & tagging log