Index: trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js |
— | — | @@ -82,8 +82,6 @@ |
83 | 83 | $b = jQuery( opt.batchTemplate ) |
84 | 84 | .attr({ |
85 | 85 | offset: offset, |
86 | | - storymodified: window.storyModified, |
87 | | - storyid: window.storyId, |
88 | 86 | len: opt.batchSize |
89 | 87 | }) |
90 | 88 | .addClass( opt.batchClass + " " + opt.emptyBatchClass ); |
Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js |
— | — | @@ -27,19 +27,16 @@ |
28 | 28 | 'stlimit': 2, |
29 | 29 | 'stlanguage': window.storyboardLanguage |
30 | 30 | }; |
31 | | - |
32 | | - if ( $storyboard.attr( 'storymodified' ) ) { |
33 | | - requestArgs.stcontinue = $storyboard.attr( 'storymodified' ); |
34 | | - |
35 | | - requestArgs.stcontinue += '-' + |
36 | | - ( $storyboard.attr( 'storyid' ) ? $storyboard.attr( 'storyid' ) : '0' ); |
| 31 | + |
| 32 | + if ( window.storyContinueParam ) { |
| 33 | + requestArgs.stcontinue = window.storyContinueParam.stories.stcontinue; |
37 | 34 | } |
38 | | - |
| 35 | + |
39 | 36 | $.getJSON( wgScriptPath + '/api.php', |
40 | 37 | requestArgs, |
41 | 38 | function( data ) { |
42 | 39 | if ( data.query ) { |
43 | | - addStories( $storyboard, data.query ); |
| 40 | + addStories( $storyboard, data ); |
44 | 41 | } else { |
45 | 42 | alert( 'An error occured:\n' + data.error.info ); // TODO: i18n |
46 | 43 | } |
— | — | @@ -47,19 +44,19 @@ |
48 | 45 | ); |
49 | 46 | } |
50 | 47 | |
51 | | - function addStories( $storyboard, query ) { |
| 48 | + function addStories( $storyboard, data ) { |
52 | 49 | // Remove the empty boxes. |
53 | 50 | $storyboard.html( '' ); |
54 | 51 | |
55 | | - for ( var i in query.stories ) { |
56 | | - var story = query.stories[i]; |
| 52 | + for ( var i in data.query.stories ) { |
| 53 | + var story = data.query.stories[i]; |
57 | 54 | var $storyBody = $( "<div />" ).addClass( "storyboard-box" ); |
58 | 55 | |
59 | 56 | var $header = $( "<div />" ).addClass( "story-header" ).appendTo( $storyBody ); |
60 | 57 | $( "<div />" ).addClass( "story-title" ).text( story.title ).appendTo( $header ); |
61 | 58 | |
62 | | - var deliciousUrl = "http://delicious.com/save?jump=yes&url=" + encodeURIComponent( story.permalink ) + "&title=" + encodeURIComponent( story.title ); |
63 | | - var facebookUrl = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent( story.permalink ) + '&t=' + encodeURIComponent( story.title ); |
| 59 | + var deliciousUrl = "http://delicious.com/save?jump=yes&url=" + encodeURIComponent( story.permalink ) + "&title=" + encodeURIComponent( story.title ); |
| 60 | + var facebookUrl = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent( story.permalink ) + '&t=' + encodeURIComponent( story.title ); |
64 | 61 | |
65 | 62 | $( "<div />" ) |
66 | 63 | .addClass( "story-sharing" ) |
— | — | @@ -124,9 +121,7 @@ |
125 | 122 | $storyboard.append( $storyBody ); |
126 | 123 | } |
127 | 124 | |
128 | | - var story = query.stories[query.stories.length - 1]; |
129 | | - window.storyModified = story.modified; |
130 | | - window.storyId = story.id; |
| 125 | + window.storyContinueParam = data["query-continue"] ? data["query-continue"] : false; |
131 | 126 | |
132 | 127 | window.storyboardBusy = false; |
133 | 128 | } |
Index: trunk/extensions/Storyboard/api/ApiQueryStories.php |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | } |
84 | 84 | |
85 | 85 | $this->addOption( 'LIMIT', $params['limit'] + 1 ); |
86 | | - $this->addOption( 'ORDER BY', 'story_modified, story_id DESC' ); |
| 86 | + $this->addOption( 'ORDER BY', 'story_modified DESC, story_id DESC' ); |
87 | 87 | |
88 | 88 | if ( !is_null( $params['language'] ) ) { |
89 | 89 | $this->addWhere( "story_lang_code = '$params[language]'" ); |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | |
104 | 104 | $this->addWhere( |
105 | 105 | "story_modified < $storyModified OR " . |
106 | | - "(story_modified = $storyId AND story_id <= $storyModified)" |
| 106 | + "(story_modified = $storyModified AND story_id <= $storyId)" |
107 | 107 | ); |
108 | 108 | } |
109 | 109 | |
— | — | @@ -121,10 +121,8 @@ |
122 | 122 | 'id' => $story->story_id, |
123 | 123 | 'author' => $story->story_author_name, |
124 | 124 | 'title' => $story->story_title, |
125 | | - //'created' => wfTimestamp( TS_ISO_8601, $story->story_created ), |
126 | | - //'modified' => wfTimestamp( TS_ISO_8601, $story->story_modified ), |
127 | | - 'created' => $story->story_created, |
128 | | - 'modified' => $story->story_modified, |
| 125 | + 'created' => wfTimestamp( TS_ISO_8601, $story->story_created ), |
| 126 | + 'modified' => wfTimestamp( TS_ISO_8601, $story->story_modified ), |
129 | 127 | 'imageurl' => $story->story_author_image, |
130 | 128 | 'permalink' => SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL() |
131 | 129 | ); |