| 1 |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 |
// Views |
| 3 |
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 4 |
|
| 5 |
/** |
| 6 |
* Show Pagination |
| 7 |
* |
| 8 |
* @param pagination_container - '.wpbc_rules_pagination' |
| 9 |
* @param params_obj - JSON object ~ { 'page_active': $page_active, 'pages_count': $pages_count } |
| 10 |
*/ |
| 11 |
function wpbc_pagination_echo( pagination_container, container_header, container_footer, params_obj ){ |
| 12 |
|
| 13 |
// Header: " 1 - 9 of many | < > ". |
| 14 |
var wpbc_pagination__prev_next = wp.template( 'wpbc_pagination__prev_next' ); |
| 15 |
jQuery( container_header ).html( wpbc_pagination__prev_next( params_obj ) ); |
| 16 |
|
| 17 |
// Active page Number in Selectbox |
| 18 |
var wpbc_pagination_active_page_in_selectbox = wp.template( 'wpbc_pagination_active_page_in_selectbox' ); |
| 19 |
jQuery( container_footer ).html( wpbc_pagination_active_page_in_selectbox( params_obj ) ); |
| 20 |
|
| 21 |
// Number of Items / Page. |
| 22 |
var wpbc_pagination_items_per_page = wp.template( 'wpbc_pagination_items_per_page' ); |
| 23 |
jQuery( container_footer ).append( wpbc_pagination_items_per_page( params_obj ) ); |
| 24 |
|
| 25 |
|
| 26 |
// |
| 27 |
// var pagination = wp.template( 'wpbc_pagination' ); |
| 28 |
// jQuery( pagination_container ).html( '<div class="wpbc-bottom-pagination"></div>' ); |
| 29 |
// |
| 30 |
// // Pagination |
| 31 |
// jQuery( pagination_container + ' .wpbc-bottom-pagination').append( pagination( params_obj ) ) ; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
jQuery( pagination_container ).show(); |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
/** |
| 40 |
* Blank function. -- Redefine this function in specific page-XXXX.php file for specific actions |
| 41 |
* |
| 42 |
* @param page_number int |
| 43 |
*/ |
| 44 |
function wpbc_pagination_click_page( page_number ){ |
| 45 |
console.log( 'wpbc_pagination_click_page', page_number ); |
| 46 |
} |