Index: trunk/extensions/Storyboard/jquery/jquery.ajaxscroll.js |
— | — | @@ -30,29 +30,33 @@ |
31 | 31 | }, |
32 | 32 | opt |
33 | 33 | ); |
34 | | - return this.each(function(){ |
35 | | - var ele=this; |
36 | | - var $me=jQuery(this); |
| 34 | + return this.each( function() { |
| 35 | + var ele = this; |
| 36 | + var $me = jQuery( this ); |
37 | 37 | var $sp; |
38 | 38 | var fnEnd,fnScroll; |
39 | | - var offset=0; |
40 | | - var lsp=-1;_css(); |
| 39 | + var offset= 0 ; |
| 40 | + var lsp = -1; |
41 | 41 | |
42 | | - opt.boxTemplate=(opt.boxTemplate||"<span class='"+opt.boxClass+"'> </span>"); |
| 42 | + _css(); |
43 | 43 | |
44 | | - opt.batchTemplate=(opt.batchTemplate||"<span></span>"); |
45 | | - $sp=jQuery("<div></div>").addClass(opt.scrollPaneClass); |
46 | | - $me.append($sp); |
47 | | - offset=batch($sp,offset,opt); |
| 44 | + opt.boxTemplate = ( opt.boxTemplate || "<span class='" + opt.boxClass + "'> </span>" ); |
| 45 | + opt.batchTemplate = ( opt.batchTemplate || "<span></span>" ); |
| 46 | + |
| 47 | + $sp = jQuery( "<div></div>" ).addClass( opt.scrollPaneClass ); |
| 48 | + $me.append( $sp ); |
| 49 | + offset = batch( $sp, offset, opt ); |
48 | 50 | $me.scrollTop(0).scrollLeft(0); |
| 51 | + |
49 | 52 | _ab(); |
50 | | - fnEnd=vEnd; |
51 | | - fnScroll=vScroll; |
52 | 53 | |
53 | | - setTimeout(monEnd,opt.endDelay); |
| 54 | + fnEnd = vEnd; |
| 55 | + fnScroll = vScroll; |
54 | 56 | |
55 | | - if(typeof opt.updateBatch=='function'){ |
56 | | - setTimeout(monScroll,opt.scrollDelay); |
| 57 | + setTimeout( monEnd, opt.endDelay ); |
| 58 | + |
| 59 | + if( typeof opt.updateBatch == 'function' ){ |
| 60 | + setTimeout( monScroll, opt.scrollDelay ); |
57 | 61 | } |
58 | 62 | |
59 | 63 | function _css(){ |
— | — | @@ -78,29 +82,39 @@ |
79 | 83 | } |
80 | 84 | } |
81 | 85 | |
82 | | - function batch($s,o,opt){ |
83 | | - var $b,i,rp=opt.batchNum; |
| 86 | + function batch($s, offset ,opt){ |
| 87 | + var $b; |
| 88 | + var i; |
| 89 | + var rp = opt.batchNum; |
84 | 90 | |
85 | | - while(rp--){ |
86 | | - $b=jQuery(opt.batchTemplate).attr({offset:o,len:opt.batchSize}).addClass(opt.batchClass+" "+opt.emptyBatchClass); |
87 | | - i=opt.batchSize; |
88 | | - while(i--&&opt.maxOffset>o++){ |
89 | | - $b.append(opt.boxTemplate); |
| 91 | + while( rp-- ) { |
| 92 | + $b=jQuery(opt.batchTemplate) |
| 93 | + .attr({ |
| 94 | + offset:offset, |
| 95 | + len:opt.batchSiz |
| 96 | + }) |
| 97 | + .addClass( opt.batchClass + " " + opt.emptyBatchClass ); |
| 98 | + |
| 99 | + i = opt.batchSize; |
| 100 | + |
| 101 | + while( i-- && opt.maxOffset > offset++ ){ |
| 102 | + $b.append( opt.boxTemplate ); |
90 | 103 | } |
| 104 | + |
91 | 105 | $s.append($b); |
92 | 106 | } |
93 | 107 | |
94 | | - return o; |
| 108 | + return offset; |
95 | 109 | }; |
96 | 110 | |
97 | 111 | function vScroll(){ |
98 | | - var so=$me.scrollTop(); |
| 112 | + var so = $me.scrollTop(); |
99 | 113 | |
100 | | - if(lsp!=so){ |
101 | | - lsp=so; |
102 | | - var co=$me.offset().top; |
| 114 | + if( lsp != so){ |
| 115 | + lsp = so; |
| 116 | + var co = $me.offset().top; |
103 | 117 | |
104 | | - $sp.find('> .'+opt.emptyBatchClass).each(function(i,obj){ |
| 118 | + $sp.find( '> .' + opt.emptyBatchClass ).each(function( i, obj ){ |
105 | 119 | var $b=jQuery(obj); |
106 | 120 | var p=$b.position().top-co; |
107 | 121 | if(opt.lBound>p||p>opt.uBound){return;} |
Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | updateBatch: updateStoryboard, |
13 | 13 | maxOffset: 500, |
14 | 14 | batchSize: 8, |
15 | | - batchNum: 1, |
| 15 | + batchNum: 2, |
16 | 16 | batchClass: "batch", |
17 | 17 | boxClass: "storyboard-box", |
18 | 18 | emptyBatchClass: "storyboard-empty", |
Index: trunk/extensions/Storyboard/api/ApiQueryStories.php |
— | — | @@ -85,7 +85,6 @@ |
86 | 86 | "(story_modified = $storyId AND story_id <= $storyModified)" |
87 | 87 | ); |
88 | 88 | */ |
89 | | - |
90 | 89 | } |
91 | 90 | |
92 | 91 | $stories = $this->select( __METHOD__ ); |