r58141 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58140‎ | r58141 | r58142 >
Date:16:11, 26 October 2009
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads: AJAX *loading* (but not saving) for edit form
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)
  • /trunk/extensions/LiquidThreads/lqt.js (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -319,6 +319,8 @@
320320 $this->showReplyForm( $thread );
321321 } elseif ( $method == 'talkpage_new_thread' ) {
322322 $this->showNewThreadForm();
 323+ } elseif ( $method == 'edit' ) {
 324+ $this->showPostEditingForm( $thread );
323325 }
324326
325327 $this->output->setArticleBodyOnly( true );
Index: trunk/extensions/LiquidThreads/lqt.js
@@ -40,6 +40,16 @@
4141 liquidThreads.currentReplyThread = 0;
4242 },
4343
 44+ 'handleEditLink' : function(e) {
 45+ e.preventDefault();
 46+
 47+ // Grab the container.
 48+ var container = $j(this).closest('.lqt-post-wrapper');
 49+ var query='&lqt_method=edit&lqt_operand='+container.data('thread-id');
 50+
 51+ liquidThreads.injectEditForm( query, container );
 52+ },
 53+
4454 'injectEditForm' : function(query, container, preload) {
4555 var url = wgServer+wgScript+'?lqt_inline=1&title='+encodeURIComponent(wgPageName)+
4656 query
@@ -238,6 +248,10 @@
239249 var menuContainer = post.find( '.lqt-thread-toolbar-menu' );
240250 menu.remove().appendTo( menuContainer );
241251 menuContainer.find('.lqt-thread-toolbar-command-list').hide();
 252+
 253+ // Add handler for edit link
 254+ var editLink = menu.find('.lqt-command-edit > a');
 255+ editLink.click( liquidThreads.handleEditLink );
242256
243257 var trigger = menuContainer.find( '.lqt-thread-actions-trigger' )
244258

Status & tagging log