r110463 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110462‎ | r110463 | r110464 >
Date:06:09, 1 February 2012
Author:neilk
Status:deferred
Tags:
Comment:
commit just to record what has been done - leaving WMF today
Modified paths:
  • /branches/extensions-realtime/WikiEditor/WikiEditor.hooks.php (modified) (history)
  • /branches/extensions-realtime/WikiEditor/WikiEditor.php (modified) (history)
  • /branches/extensions-realtime/WikiEditor/modules/jquery.wikiEditor.js (modified) (history)
  • /branches/extensions-realtime/WikiEditor/modules/jquery.wikiEditor.remoteIframe.js (modified) (history)

Diff [purge]

Index: branches/extensions-realtime/WikiEditor/WikiEditor.php
@@ -152,6 +152,21 @@
153153 'jquery.wikiEditor.dialogs',
154154 ),
155155 ),
 156+ 'jquery.wikiEditor.remoteEditor' => $wikiEditorTpl + array(
 157+ 'scripts' => 'jquery.wikiEditor.remoteEditor.js',
 158+ 'dependencies' => array(
 159+ 'jquery.wikiEditor',
 160+ 'jquery.wikiEditor.dialogs',
 161+ )
 162+ ),
 163+ 'jquery.wikiEditor.remoteIframe' => $wikiEditorTpl + array(
 164+ 'scripts' => 'jquery.wikiEditor.remoteIframe.js',
 165+ 'dependencies' => array(
 166+ 'jquery.wikiEditor',
 167+ 'jquery.wikiEditor.dialogs',
 168+ 'jquery.wikiEditor.remoteEditor',
 169+ )
 170+ ),
156171 'jquery.wikiEditor.templateEditor' => $wikiEditorTpl + array(
157172 'scripts' => 'jquery.wikiEditor.templateEditor.js',
158173 'dependencies' => array(
@@ -513,10 +528,11 @@
514529 )
515530 ),
516531 'ext.wikiEditor.remote' => $wikiEditorTpl + array(
517 - 'scripts' => '',
 532+ 'scripts' => 'ext.wikiEditor.remote.js',
518533 'dependencies' => array(
519534 'ext.wikiEditor',
520535 'ext.wikiEditor.toolbar',
 536+ 'jquery.wikiEditor.remoteIframe',
521537 // JSON?
522538 )
523539 ),
Index: branches/extensions-realtime/WikiEditor/WikiEditor.hooks.php
@@ -217,13 +217,6 @@
218218 public static function editPageShowEditFormInitial( &$toolbar ) {
219219 global $wgOut;
220220
221 - if ( isset( $feature['remote'] ) && self::isEnabled( 'remote' ) ) {
222 - $params = IdentityApi::getAuthParams();
223 - if ( $params !== null ) {
224 - $wgOut->addInlineScript( Skin::makeVariablesScript( $params ) );
225 - }
226 - }
227 -
228221 // Add modules for enabled features
229222 foreach ( self::$features as $name => $feature ) {
230223 if ( isset( $feature['modules'] ) && self::isEnabled( $name ) ) {
@@ -293,6 +286,16 @@
294287 }
295288
296289 $vars['wgWikiEditorEnabledModules'] = $enabledModules;
 290+
 291+ if ( isset( $feature['remote'] ) && self::isEnabled( 'remote' ) ) {
 292+ $params = IdentityApi::getAuthParams();
 293+ if ( $params !== null ) {
 294+ foreach ($params as $key => $val) {
 295+ $vars[ 'wgRemoteEditor' + ucfirst( $key ) ] = $val;
 296+ }
 297+ }
 298+ }
 299+
297300 return true;
298301 }
299302 }
Index: branches/extensions-realtime/WikiEditor/modules/jquery.wikiEditor.js
@@ -271,6 +271,7 @@
272272 modules = data;
273273 }
274274 for ( var module in modules ) {
 275+ console.log( "module: " + module );
275276 // Check for the existance of an available / supported module with a matching name and a create function
276277 if ( typeof module == 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' &&
277278 $.wikiEditor.isSupported( $.wikiEditor.modules[module] ) )
Index: branches/extensions-realtime/WikiEditor/modules/jquery.wikiEditor.remoteIframe.js
@@ -722,8 +722,7 @@
723723 * Sets up the iframe in place of the textarea to allow more advanced operations
724724 */
725725 'setupIframe': function() {
726 - var remoteEditor = new remoteEditor( context.$textArea );
727 - remoteEditor.launchEditor();
 726+ var remoteEditor = context.$textArea.remoteEditor();
728727 /*
729728 context.$iframe = $( '<iframe></iframe>' )
730729 .attr( {
@@ -1405,6 +1404,7 @@
14061405 range2.select();
14071406 }
14081407 return context.$textarea;
 1408+ */
14091409 },
14101410 /**
14111411 * Scroll a textarea to the current cursor position. You can set the cursor position with setSelection()
@@ -1445,4 +1445,4 @@
14461446 /* Setup the IFrame */
14471447 context.fn.setupIframe();
14481448
1449 -} } )( jQuery );
 1449+}; } )( jQuery );

Status & tagging log