2008-10-11 04:22:58 -04:00
|
|
|
:javascript
|
|
|
|
page = #{@page};
|
|
|
|
page_count = #{@page_count};
|
|
|
|
function scroll_box(newpage)
|
|
|
|
{
|
|
|
|
np = parseInt(newpage);
|
|
|
|
if(np < 0)
|
|
|
|
np = 0;
|
|
|
|
if(np >= page_count)
|
|
|
|
np = page_count - 1;
|
2008-10-11 18:44:06 -04:00
|
|
|
if(np == page || page_count == 0)
|
2008-10-11 04:22:58 -04:00
|
|
|
return;
|
|
|
|
setTimeout("update_scroll_box(" + np + ");", 800);
|
|
|
|
new Effect.DropOut($('inner_#{@pagination_block}'));
|
|
|
|
}
|
|
|
|
function update_scroll_box(newpage)
|
|
|
|
{
|
|
|
|
page = newpage;
|
|
|
|
new Ajax.Updater('#{@pagination_block}', '#{@base_pagination_url}#{@base_pagination_url =~ /\?/ ? '&' : '?'}page=' + page, { method: 'get', onComplete: function(){ new Effect.Appear($('inner_#{@pagination_block}')); }, onSuccess: function(){ $('pagenum').innerHTML = parseInt(page) + 1; } });
|
|
|
|
}
|
2008-10-11 19:15:32 -04:00
|
|
|
|
2008-10-11 19:17:18 -04:00
|
|
|
- if @page_count > 1
|
|
|
|
#pagination_navigation
|
|
|
|
%p
|
|
|
|
%a{ :href => '#', :onclick => "scroll_box(0); return false;", :title => 'First page' }
|
|
|
|
%img{ :src => '/images/go-first.png' }
|
|
|
|
%a{ :href => '#', :onclick => "scroll_box(page - 1); return false;", :title => 'Previous page' }
|
|
|
|
%img{ :src => '/images/go-previous.png' }
|
|
|
|
== <span id="pagenum">#{@page + 1}</span> / #{@page_count}
|
|
|
|
%a{ :href => '#', :onclick => "scroll_box(page + 1); return false;", :title => 'Next page' }
|
|
|
|
%img{ :src => '/images/go-next.png' }
|
|
|
|
%a{ :href => '#', :onclick => "scroll_box(page_count - 1); return false;", :title => 'Next page' }
|
|
|
|
%img{ :src => '/images/go-last.png' }
|