Index: branches/extensions-realtime/WikiEditor/WikiEditor.php |
— | — | @@ -152,6 +152,21 @@ |
153 | 153 | 'jquery.wikiEditor.dialogs', |
154 | 154 | ), |
155 | 155 | ), |
| 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 | + ), |
156 | 171 | 'jquery.wikiEditor.templateEditor' => $wikiEditorTpl + array( |
157 | 172 | 'scripts' => 'jquery.wikiEditor.templateEditor.js', |
158 | 173 | 'dependencies' => array( |
— | — | @@ -513,10 +528,11 @@ |
514 | 529 | ) |
515 | 530 | ), |
516 | 531 | 'ext.wikiEditor.remote' => $wikiEditorTpl + array( |
517 | | - 'scripts' => '', |
| 532 | + 'scripts' => 'ext.wikiEditor.remote.js', |
518 | 533 | 'dependencies' => array( |
519 | 534 | 'ext.wikiEditor', |
520 | 535 | 'ext.wikiEditor.toolbar', |
| 536 | + 'jquery.wikiEditor.remoteIframe', |
521 | 537 | // JSON? |
522 | 538 | ) |
523 | 539 | ), |
Index: branches/extensions-realtime/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -217,13 +217,6 @@ |
218 | 218 | public static function editPageShowEditFormInitial( &$toolbar ) { |
219 | 219 | global $wgOut; |
220 | 220 | |
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 | | - |
228 | 221 | // Add modules for enabled features |
229 | 222 | foreach ( self::$features as $name => $feature ) { |
230 | 223 | if ( isset( $feature['modules'] ) && self::isEnabled( $name ) ) { |
— | — | @@ -293,6 +286,16 @@ |
294 | 287 | } |
295 | 288 | |
296 | 289 | $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 | + |
297 | 300 | return true; |
298 | 301 | } |
299 | 302 | } |
Index: branches/extensions-realtime/WikiEditor/modules/jquery.wikiEditor.js |
— | — | @@ -271,6 +271,7 @@ |
272 | 272 | modules = data; |
273 | 273 | } |
274 | 274 | for ( var module in modules ) { |
| 275 | + console.log( "module: " + module ); |
275 | 276 | // Check for the existance of an available / supported module with a matching name and a create function |
276 | 277 | if ( typeof module == 'string' && typeof $.wikiEditor.modules[module] !== 'undefined' && |
277 | 278 | $.wikiEditor.isSupported( $.wikiEditor.modules[module] ) ) |
Index: branches/extensions-realtime/WikiEditor/modules/jquery.wikiEditor.remoteIframe.js |
— | — | @@ -722,8 +722,7 @@ |
723 | 723 | * Sets up the iframe in place of the textarea to allow more advanced operations |
724 | 724 | */ |
725 | 725 | 'setupIframe': function() { |
726 | | - var remoteEditor = new remoteEditor( context.$textArea ); |
727 | | - remoteEditor.launchEditor(); |
| 726 | + var remoteEditor = context.$textArea.remoteEditor(); |
728 | 727 | /* |
729 | 728 | context.$iframe = $( '<iframe></iframe>' ) |
730 | 729 | .attr( { |
— | — | @@ -1405,6 +1404,7 @@ |
1406 | 1405 | range2.select(); |
1407 | 1406 | } |
1408 | 1407 | return context.$textarea; |
| 1408 | + */ |
1409 | 1409 | }, |
1410 | 1410 | /** |
1411 | 1411 | * Scroll a textarea to the current cursor position. You can set the cursor position with setSelection() |
— | — | @@ -1445,4 +1445,4 @@ |
1446 | 1446 | /* Setup the IFrame */ |
1447 | 1447 | context.fn.setupIframe(); |
1448 | 1448 | |
1449 | | -} } )( jQuery ); |
| 1449 | +}; } )( jQuery ); |