r65770 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65769‎ | r65770 | r65771 >
Date:22:37, 1 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added storymodified and storyid attributes to the batch html for the continue parameter
Modified paths:
  • /trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard/storyboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js
@@ -61,15 +61,16 @@
6262 }
6363
6464 function _css(){
65 - $me.css({"overflow-x":"hidden","overflow-y":"auto"});
 65+ $me.css( {
 66+ "overflow-x": "hidden",
 67+ "overflow-y": "auto"
 68+ } );
6669 }
6770
6871 function _ab(){
69 - var os,b;
 72+ var os = $me.find( '.batch:first' ).next().offset().top;
 73+ var b = ( $me.height() / os + 1 ) * os;
7074
71 - os=$me.find('.batch:first').next().offset().top;
72 - b=($me.height()/os+1)*os;
73 -
7475 if ( "auto" == opt.uBound ) {
7576 opt.uBound = b;
7677 }
@@ -91,8 +92,10 @@
9293 while( rp-- ) {
9394 $b=jQuery( opt.batchTemplate )
9495 .attr({
95 - offset:offset,
96 - len:opt.batchSiz
 96+ offset: offset,
 97+ len: opt.batchSiz,
 98+ storymodified: 0,
 99+ storyid: 0
97100 })
98101 .addClass( opt.batchClass + " " + opt.emptyBatchClass );
99102
@@ -124,9 +127,9 @@
125128 }
126129 };
127130
128 - function vEnd(){
129 - if(ele.scrollTop > 0 && ele.scrollHeight-ele.scrollTop < opt.eBound){
130 - offset=batch($sp,offset,opt);
 131+ function vEnd() {
 132+ if( ele.scrollTop > 0 && ele.scrollHeight-ele.scrollTop < opt.eBound ) {
 133+ offset = batch( $sp, offset, opt );
131134 return 1;
132135 }
133136
Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js
@@ -23,11 +23,11 @@
2424 $.getJSON( wgScriptPath + '/api.php',
2525 {
2626 'action': 'query',
27 - 'list': 'stories',
28 - 'stcontinue': $storyboard.attr( 'offset' ) + '-0', // TODO: get modification date and id of the last story
29 - 'stlimit': 4,
30 - 'stlanguage': window.storyboardLanguage,
31 - 'format': 'json'
 27+ 'list': 'stories',
 28+ 'format': 'json',
 29+ 'stcontinue': $storyboard.attr( 'storymodified' ) + '-' + $storyboard.attr( 'storyid' ),
 30+ 'stlimit': 8,
 31+ 'stlanguage': window.storyboardLanguage
3232 },
3333 function( data ) {
3434 if ( data.query ) {

Status & tagging log