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+"'> </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 @@ |
3 | 3 | * AjaxScroll (jQuery Plugin) |
4 | 4 | * http://project.yctin.com/ajaxscroll |
5 | 5 | * Modified for MediaWiki Storyboard extension. |
6 | | - * |
| 6 | + * |
7 | 7 | * @license GPL |
8 | 8 | * @version 0.2 |
9 | 9 | * |
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 @@ |
37 | 37 | if ( data.query ) { |
38 | 38 | addStories( $storyboard, data ); |
39 | 39 | } else { |
40 | | - alert( stbMsgExt( 'storyboard-anerroroccured', [data.error.info] ) ); // TODO: i18n |
| 40 | + alert( stbMsgExt( 'storyboard-anerroroccured', [data.error.info] ) ); |
41 | 41 | } |
42 | 42 | } |
43 | 43 | ); |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | metaDataText = stbMsgExt( 'storyboard-storymetadata', [story.author, story.creationtime, story.creationdate] ); |
118 | 118 | } |
119 | 119 | |
120 | | - $storyBody.append( // TODO: get the actual message here |
| 120 | + $storyBody.append( |
121 | 121 | $( "<div />" ).addClass( "story-metadata" ).append( |
122 | 122 | $("<span />").addClass( "story-metadata" ).text( metaDataText ) |
123 | 123 | ) |
Index: trunk/extensions/Storyboard/storyboard.js |
— | — | @@ -134,7 +134,6 @@ |
135 | 135 | // Remove the empty boxes. |
136 | 136 | $storyboard.html( '' ); |
137 | 137 | |
138 | | - // TODO: create the review blocks html with jQuery |
139 | 138 | for ( var i in query.stories ) { |
140 | 139 | var story = query.stories[i]; |
141 | 140 | var $storyBody = jQuery( "<div />" ).addClass( "storyboard-box" ); |
— | — | @@ -160,7 +159,7 @@ |
161 | 160 | metaDataText = stbMsgExt( 'storyboard-storymetadata', [story.author, story.creationtime, story.creationdate] ); |
162 | 161 | } |
163 | 162 | |
164 | | - $storyBody.append( // TODO: get the actual message here |
| 163 | + $storyBody.append( |
165 | 164 | jQuery( "<div />" ).addClass( "story-metadata" ).append( |
166 | 165 | jQuery("<span />").addClass( "story-metadata" ).text( metaDataText ) |
167 | 166 | ) |
— | — | @@ -201,7 +200,6 @@ |
202 | 201 | jQuery( '#story_' + data.storyreview.id ).slideUp( 'slow', function () { |
203 | 202 | jQuery( this ).remove(); |
204 | 203 | } ); |
205 | | - // TODO: would be neat to update the other list when doing an (un)publish here |
206 | 204 | break; |
207 | 205 | case 'hideimage' : case 'unhideimage' : |
208 | 206 | stbToggeShowImage( sender, data.storyreview.id, data.storyreview.action ); |
Index: trunk/extensions/Storyboard/INSTALL |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | Once you have downloaded the code, place the 'Storyboard' directory within your MediaWiki 'extensions' directory. |
3 | 3 | Then add the following code to your LocalSettings.php file: |
4 | 4 | |
5 | | -# Maps |
| 5 | +# Storyboard |
6 | 6 | 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 |