r66071 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66070‎ | r66071 | r66072 >
Date:16:21, 8 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Removed completed todos, added docs and removed obsolete file
Modified paths:
  • /trunk/extensions/Storyboard/INSTALL (modified) (history)
  • /trunk/extensions/Storyboard/README (modified) (history)
  • /trunk/extensions/Storyboard/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js (modified) (history)
  • /trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.min.js (deleted) (history)
  • /trunk/extensions/Storyboard/storyboard.js (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard/storyboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.min.js
@@ -1,15 +0,0 @@
2 -
3 -(function($){$.fn.ajaxScroll=function(opt){opt=jQuery.extend({batchNum:5,batchSize:30,horizontal:false,batchTemplate:null,boxTemplate:null,batchClass:"batch",boxClass:"box",emptyBatchClass:"empty",scrollPaneClass:"scrollpane",lBound:"auto",uBound:"auto",eBound:"auto",maxOffset:1000,scrollDelay:600,endDelay:100,updateBatch:null,updateEnd:null},opt);return this.each(function(){var ele=this;var $me=jQuery(this);var $sp;var fnEnd,fnScroll;var offset=0;var lsp=-1;_css();opt.boxTemplate=(opt.boxTemplate||"<span class='"+opt.boxClass+"'>&nbsp</span>");if(opt.horizontal){opt.batchTemplate=(opt.batchTemplate||"<td></td>");$sp=jQuery("<table><tr></tr></table>").addClass(opt.scrollPaneClass);$me.append($sp);offset=batch($sp.find("tr"),offset,opt);_bz();_ab();fnEnd=hEnd;fnScroll=hScroll;}else{opt.batchTemplate=(opt.batchTemplate||"<span></span>");$sp=jQuery("<div></div>").addClass(opt.scrollPaneClass);$me.append($sp);offset=batch($sp,offset,opt);_bz();_ab();fnEnd=vEnd;fnScroll=vScroll;}
4 -setTimeout(monEnd,opt.endDelay);if(typeof opt.updateBatch=='function'){setTimeout(monScroll,opt.scrollDelay);}
5 -function _css(){if(opt.horizontal){$me.css({"overflow-x":"auto","overflow-y":"hidden"});}else{$me.css({"overflow-x":"hidden","overflow-y":"auto"});}}
6 -function _ab(){var os,b;if(opt.horizontal){os=$me.find('.batch:first').next().offset().left;b=($me.width()/os+1)*os;}else{os=$me.find('.batch:first').next().offset().top;b=($me.height()/os+1)*os;}
7 -if("auto"==opt.uBound){opt.uBound=b;}
8 -if("auto"==opt.lBound){opt.lBound=-b;}
9 -if("auto"==opt.eBound){opt.eBound=b*2;}}
10 -function _bz(){$me.scrollTop(0).scrollLeft(0);};function batch($s,o,opt){var $b,i,rp=opt.batchNum;while(rp--){$b=jQuery(opt.batchTemplate).attr({offset:o,len:opt.batchSize}).addClass(opt.batchClass+" "+opt.emptyBatchClass);i=opt.batchSize;while(i--&&opt.maxOffset>o++){$b.append(opt.boxTemplate);}
11 -$s.append($b);}
12 -return o;};function vScroll(){var so=$me.scrollTop();if(lsp!=so){lsp=so;var co=$me.offset().top;$sp.find('> .'+opt.emptyBatchClass).each(function(i,obj){var $b=jQuery(obj);var p=$b.position().top-co;if(opt.lBound>p||p>opt.uBound){return;}
13 -opt.updateBatch($b.removeClass(opt.emptyBatchClass));});}};function hScroll(){var so=$me.scrollLeft();if(lsp!=so){lsp=so;var co=$me.offset().left;$sp.find('tr > .'+opt.emptyBatchClass).each(function(i,obj){var $b=jQuery(obj);var p=$b.position().left-co;if(opt.lBound>p||p>opt.uBound){return;}
14 -opt.updateBatch($b.removeClass(opt.emptyBatchClass));});}};function vEnd(){if(ele.scrollTop>0&&ele.scrollHeight-ele.scrollTop<opt.eBound){offset=batch($sp,offset,opt);return 1;}
15 -return opt.endDelay;};function hEnd(){if(ele.scrollLeft>0&&ele.scrollWidth-ele.scrollLeft<opt.eBound){offset=batch($sp.find("tr:first"),offset,opt);return 1;}
16 -return opt.endDelay;};function monScroll(){fnScroll();setTimeout(monScroll,opt.scrollDelay);};function monEnd(){if(offset<opt.maxOffset){setTimeout(monEnd,fnEnd());}}});};})(jQuery);
\ No newline at end of file
Index: trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js
@@ -2,7 +2,7 @@
33 * AjaxScroll (jQuery Plugin)
44 * http://project.yctin.com/ajaxscroll
55 * Modified for MediaWiki Storyboard extension.
6 - *
 6+ *
77 * @license GPL
88 * @version 0.2
99 *
Index: trunk/extensions/Storyboard/README
@@ -0,0 +1,8 @@
 2+== About ==
 3+
 4+Storyboard is an extension developed for the Wikimedia Foundations fundraising efforts.
 5+It allows users to submit stories and can display these in an ajaxscroll board that can
 6+be embedded in wiki articles. The stories can be managed via a story review interface
 7+and be viewed and edited individually on a special story page.
 8+
 9+More at http://www.mediawiki.org/wiki/Extension:Storyboard#Description
\ No newline at end of file
Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js
@@ -36,7 +36,7 @@
3737 if ( data.query ) {
3838 addStories( $storyboard, data );
3939 } else {
40 - alert( stbMsgExt( 'storyboard-anerroroccured', [data.error.info] ) ); // TODO: i18n
 40+ alert( stbMsgExt( 'storyboard-anerroroccured', [data.error.info] ) );
4141 }
4242 }
4343 );
@@ -116,7 +116,7 @@
117117 metaDataText = stbMsgExt( 'storyboard-storymetadata', [story.author, story.creationtime, story.creationdate] );
118118 }
119119
120 - $storyBody.append( // TODO: get the actual message here
 120+ $storyBody.append(
121121 $( "<div />" ).addClass( "story-metadata" ).append(
122122 $("<span />").addClass( "story-metadata" ).text( metaDataText )
123123 )
Index: trunk/extensions/Storyboard/storyboard.js
@@ -134,7 +134,6 @@
135135 // Remove the empty boxes.
136136 $storyboard.html( '' );
137137
138 - // TODO: create the review blocks html with jQuery
139138 for ( var i in query.stories ) {
140139 var story = query.stories[i];
141140 var $storyBody = jQuery( "<div />" ).addClass( "storyboard-box" );
@@ -160,7 +159,7 @@
161160 metaDataText = stbMsgExt( 'storyboard-storymetadata', [story.author, story.creationtime, story.creationdate] );
162161 }
163162
164 - $storyBody.append( // TODO: get the actual message here
 163+ $storyBody.append(
165164 jQuery( "<div />" ).addClass( "story-metadata" ).append(
166165 jQuery("<span />").addClass( "story-metadata" ).text( metaDataText )
167166 )
@@ -201,7 +200,6 @@
202201 jQuery( '#story_' + data.storyreview.id ).slideUp( 'slow', function () {
203202 jQuery( this ).remove();
204203 } );
205 - // TODO: would be neat to update the other list when doing an (un)publish here
206204 break;
207205 case 'hideimage' : case 'unhideimage' :
208206 stbToggeShowImage( sender, data.storyreview.id, data.storyreview.action );
Index: trunk/extensions/Storyboard/INSTALL
@@ -1,5 +1,5 @@
22 Once you have downloaded the code, place the 'Storyboard' directory within your MediaWiki 'extensions' directory.
33 Then add the following code to your LocalSettings.php file:
44
5 -# Maps
 5+# Storyboard
66 require_once( "$IP/extensions/Storyboard/Storyboard.php" );
\ No newline at end of file
Index: trunk/extensions/Storyboard/RELEASE-NOTES
@@ -0,0 +1,3 @@
 2+Extension page on mediawiki.org: http://www.mediawiki.org/wiki/Extension:Storyboard
 3+
 4+This is an alpha version of Storyboard.
\ No newline at end of file

Status & tagging log