r77382 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77381‎ | r77382 | r77383 >
Date:07:47, 28 November 2010
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads editing toolbar fixes for Resource Loader:
* Compatibility with removal of wgWikiEditorPreferences.
* Load necessary modules.
FIXME: Messages are not loaded, because the RL module also contains "action" code which I do not want. Need to talk to others about splitting the messages out into another module.
Modified paths:
  • /trunk/extensions/LiquidThreads/LiquidThreads.php (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/LiquidThreads.php
@@ -258,3 +258,10 @@
259259
260260 /** Allow LiquidThreads embedding */
261261 $wgLiquidThreadsAllowEmbedding = true;
 262+
 263+/** Location for LiquidThreads avatars.
 264+ * Defaults to $wgImageDirectory/avatars */
 265+$wgLiquidThreadsAvatarDirectory = null;
 266+
 267+/** Web accessible path for above location */
 268+$wgLiquidThreadsAvatarPath = null;
Index: trunk/extensions/LiquidThreads/lqt.js
@@ -187,11 +187,21 @@
188188 $j(container).find('#wpDiff').hide();
189189
190190 if ( $j.fn.wikiEditor && $j.wikiEditor.isSupported( $j.wikiEditor.modules.toolbar ) ) {
191 - if ( wgWikiEditorPreferences.toolbar.dialogs && $j.wikiEditor.isSupported( $j.wikiEditor.modules.dialogs ) ) {
 191+ var useDialogs;
 192+
 193+ if ( typeof wgWikiEditorPreferences != 'undefined' ) {
 194+ useDialogs = wgWikiEditorPreferences.toolbar.dialogs;
 195+ } else {
 196+ useDialogs = mediaWiki.user.options['usebetatoolbar-cgd'];
 197+ }
 198+
 199+ if ( useDialogs && $j.wikiEditor.isSupported( $j.wikiEditor.modules.dialogs ) ) {
192200 $j( '#wpTextbox1' ).addClass( 'toolbar-dialogs' );
193201 }
 202+
194203 // Add wikiEditor toolbar
195204 $j( '#wpTextbox1' ).wikiEditor( 'addModule', { 'toolbar': liquidThreads.toolbar.config, 'dialogs': liquidThreads.toolbar.dialogs } );
 205+
196206 // cleanup unnecessary things from the old toolbar
197207 $j( '#editpage-specialchars' ).remove();
198208 $j( '#wpTextbox1' ).focus()
@@ -213,7 +223,17 @@
214224 if ( isIE7 ) {
215225 $j(container).empty().show();
216226 }
217 - liquidThreads.loadInlineEditForm( params, container, finishSetup );
 227+ liquidThreads.loadInlineEditForm( params, container,
 228+ function() {
 229+ if ( typeof mediaWiki.loader != 'undefined' && mediaWiki.loader ) {
 230+ mediaWiki.loader.using(
 231+ [ 'ext.wikiEditor', 'jquery.wikiEditor.toolbar',
 232+ 'jquery.async', 'jquery.cookie' ],
 233+ finishSetup );
 234+ } else {
 235+ finishSetup();
 236+ }
 237+ } );
218238 } );
219239
220240 },

Follow-up revisions

RevisionCommit summaryAuthorDate
r77383Remove partially committed avatar code in r77382werdna07:48, 28 November 2010

Status & tagging log