Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update to use inc_pagination_shortcuts

  • Loading branch information...
commit 8e323dd1b277f2d7e2a49dc5cccfae88f2e5f14b 1 parent 9a8bddd
straup authored
View
64 www/templates/inc_pagination.txt
@@ -13,67 +13,9 @@
{capture assign="next_page"}{if $pagination.page < $pagination.page_count}{if $pagination_page_as_queryarg}{$pagination_url}&page={$pagination.page+1}{else}{$pagination_url}page{$pagination.page+1}{/if}{/if}{/capture}
{if $cfg.pagination_keyboard_shortcuts}
-
-<script type="text/javascript">
-
-var prev = {if $pagination.page_count > 1 and $pagination.page > 1}'{$prev_page}'{else}null{/if};
-var next = {if $pagination.page_count > 1 and $pagination.page < $pagination.page_count}'{$next_page}'{else}null{/if};
-
-{literal}
-
-$(document).ready(function(){
-
- var goto_next = function(){
- if (next){
- location.href = next;
- }
- };
-
- var goto_previous = function(){
- if (prev){
- location.href = prev;
- }
- };
-
- $(document).keypress(function(e){
-
- if (e.keyCode == 37){
- goto_previous();
- }
-
- else if (e.keyCode == 39){
- goto_next();
- }
-
- else {}
- });
-
-{/literal}
-
-{if $cfg.pagination_touch_shortcuts}
-{literal}
- // http://www.netcu.de/jquery-touchwipe-iphone-ipad-library
-
- $(document).touchwipe({
- wipeLeft: goto_next,
- wipeRight: goto_previous,
- wipeUp: function(){},
- wipeDown: function(){},
- min_move_x: 100,
- min_move_y: 100,
- preventDefaultEvents: false,
- allowPageScroll: 'vertical'
- });
-{/literal}
-{/if}
-
-{literal}
-});
-
-{/literal}
-
-</script>
-
+{capture assign="paginate_previous"}{if $pagination.page_count > 1 and $pagination.page > 1}{$prev_page}{else}{/if}{/capture}
+{capture assign="paginate_next"}{if $pagination.page_count > 1 and $pagination.page < $pagination.page_count}{$next_page}{else}{/if}{/capture}
+{include file="inc_pagination_shortcuts.txt"}
{/if}
{/if}
View
14 www/templates/inc_pagination_pretty.txt
@@ -1,5 +1,7 @@
<p class="pag_head">Page {$pagination.page} of {$pagination.page_count}</p>
{if $pagination.page_count > 1}
+
+ <span id="pag_prev">
{* previous button *}
{if $pagination.page > 1}
{if $pagination_page_as_queryarg}
@@ -11,8 +13,12 @@
<span class="pag_inactive">Previous page</span>
{/if}
+ </span>
+
{* middle *}
+ <span id="pag_middle">
+
{if $pagination.page_count > 10}
{assign var=range_mid value=7}
{assign var=rfloor value=$range_mid/2|@floor}
@@ -57,7 +63,7 @@
{/if}
{/section}
-
+
{else}
{section name=paglp start=1 loop=$pagination.page_count+1}
@@ -77,9 +83,9 @@
{/if}
+ </span>
-
-
+ <span id="pag_next">
{* next button *}
{if $pagination.page < $pagination.page_count}
@@ -92,7 +98,7 @@
<span class="pag_inactive">Next page</span>
{/if}
-
+ </span>
View
59 www/templates/inc_pagination_shortcuts.txt
@@ -0,0 +1,59 @@
+<script type="text/javascript">
+
+var prev = {if $paginate_previous}'{$paginate_previous}'{else}null{/if};
+var next = {if $paginate_next}'{$paginate_next}'{else}null{/if};
+
+{literal}
+
+$(document).ready(function(){
+
+ var goto_next = function(){
+ if (next){
+ location.href = next;
+ }
+ };
+
+ var goto_previous = function(){
+ if (prev){
+ location.href = prev;
+ }
+ };
+
+ $(document).keypress(function(e){
+
+ if (e.keyCode == 37){
+ goto_previous();
+ }
+
+ else if (e.keyCode == 39){
+ goto_next();
+ }
+
+ else {}
+ });
+
+{/literal}
+
+{if $cfg.pagination_touch_shortcuts}
+{literal}
+ // http://www.netcu.de/jquery-touchwipe-iphone-ipad-library
+
+ $(document).touchwipe({
+ wipeLeft: goto_next,
+ wipeRight: goto_previous,
+ wipeUp: function(){},
+ wipeDown: function(){},
+ min_move_x: 100,
+ min_move_y: 100,
+ preventDefaultEvents: false,
+ allowPageScroll: 'vertical'
+ });
+{/literal}
+{/if}
+
+{literal}
+});
+
+{/literal}
+
+</script>
Please sign in to comment.
Something went wrong with that request. Please try again.