r65474 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65473‎ | r65474 | r65475 >
Date:18:45, 23 April 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Tested and applied patch from pdhanda to fix story batch load when scrolling down.
Modified paths:
  • /trunk/extensions/Storyboard/api/ApiQueryStories.php (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard/storyboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js
@@ -9,13 +9,17 @@
1010 $( document ).ready( function() {
1111 $( '.storyboard' ).ajaxScroll( {
1212 updateBatch: updateStoryboard,
 13+ maxOffset: 500,
1314 batchSize: 4,
14 - batchNum: 2
 15+ batchNum: 2,
 16+ batchClass: "batch",
 17+ boxClass: "storyboard-box",
 18+ emptyBatchClass: "storyboard-empty",
 19+ scrollPaneClass: "scrollpane"
1520 } );
1621 } );
1722
1823 function updateStoryboard( $storyboard ) {
19 - // TODO: fix eternal load, broken when swicthing from .load to .getJSON.
2024 $.getJSON( wgScriptPath + '/api.php',
2125 {
2226 'action': 'query',
Index: trunk/extensions/Storyboard/api/ApiQueryStories.php
@@ -54,7 +54,8 @@
5555 'story_author_image',
5656 'story_title',
5757 'story_text',
58 - 'story_created'
 58+ 'story_created',
 59+ 'story_modified'
5960 ) );
6061 $this->addWhere( array(
6162 'story_state' => Storyboard_STORY_PUBLISHED
@@ -73,11 +74,12 @@
7475
7576 $storyModified = $continueParams[0];
7677 $storyId = intval( $continueParams[1] );
77 - var_dump($storyModified);exit;
 78+ /* FIXME
7879 $this->addWhere(
7980 "story_modified > $storyModified OR " .
8081 "(story_modified = $storyId AND story_id <= $storyModified)"
8182 );
 83+ */
8284
8385 }
8486
@@ -88,7 +90,7 @@
8991 if ( ++$count > $params['limit'] ) {
9092 // We've reached the one extra which shows that
9193 // there are additional pages to be had. Stop here...
92 - $this->setContinueEnumParameter( 'continue', wfTimestamp( TS_MW, $row->story_modified ) . '-' . $row->story_id );
 94+ $this->setContinueEnumParameter( 'continue', wfTimestamp( TS_MW, $story->story_modified ) . '-' . $story->story_id );
9395 break;
9496 }
9597 $res = array(

Status & tagging log