TimeTrex/interface/html5/dist/paging-Paging2.bundle.js

1 line
14 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["paging-Paging2"],{5583:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.Paging2 = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.Paging2.defaults, options );\n\t\tvar $this = this;\n\t\tvar pager_data;\n\t\tvar start;\n\t\tvar last;\n\t\tvar next;\n\t\tvar end;\n\t\tvar paging_selector;\n\t\tvar left_buttons_div;\n\t\tvar right_buttons_div;\n\n\t\tvar left_buttons_enable;\n\t\tvar right_buttons_enable;\n\n\t\tthis.getPagerData = function() {\n\t\t\treturn pager_data;\n\t\t},\n\n\t\t\tthis.setPagerData = function( value ) {\n\n\t\t\t\tpager_data = value;\n\n\t\t\t\tif ( !pager_data ) {\n\t\t\t\t\t$( this.css( 'display', 'none' ) );\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t$( this.css( 'display', 'block' ) );\n\t\t\t\t}\n\n\t\t\t\t$( paging_selector ).empty();\n\n\t\t\t\tvar len = pager_data.last_page_number;\n\n\t\t\t\tif ( len === -1 ) {\n\t\t\t\t\t$( paging_selector ).append( '<option value=\"' + 1 + '\">' + 1 + '</option>' );\n\t\t\t\t} else {\n\t\t\t\t\tfor ( var i = 1; i <= len; i++ ) {\n\t\t\t\t\t\t$( paging_selector ).append( '<option value=\"' + i + '\">' + i + '</option>' );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$( $( paging_selector ).find( 'option' ) ).filter( function() {\n\t\t\t\t\tvar current_value = parseInt( $( this ).attr( 'value' ) );\n\n\t\t\t\t\treturn current_value === pager_data.current_page;\n\t\t\t\t} ).prop( 'selected', true ).prop( 'selected', true );\n\n\t\t\t\tif ( pager_data.is_last_page === true ) {\n\t\t\t\t\tright_buttons_div.addClass( 'disabled' );\n\t\t\t\t\tright_buttons_div.addClass( 'disabled-image' );\n\t\t\t\t\tright_buttons_enable = false;\n\t\t\t\t} else {\n\t\t\t\t\tright_buttons_div.removeClass( 'disabled' );\n\t\t\t\t\tright_buttons_div.removeClass( 'disabled-image' );\n\t\t\t\t\tright_buttons_enable = true;\n\t\t\t\t}\n\n\t\t\t\tif ( pager_data.is_first_page ) {\n\t\t\t\t\tleft_buttons_div.addClass( 'disabled' );\n\t\t\t\t\tleft_buttons_div.addClass( 'disabled-image' );\n\t\t\t\t\tleft_buttons_enable = false;\n\n\t\t\t\t} else {\n\t\t\t\t\tleft_buttons_div.removeClass( 'disabled' );\n\t\t\t\t\tleft_buttons_div.removeClass( 'disabled-image' );\n\t\t\t\t\tleft_buttons_enable = true;\n\t\t\t\t}\n\n\t\t\t\tif ( len === -1 || ( pager_data.is_first_page && pager_data.is_last_page ) ) {\n\n\t\t\t\t\tleft_buttons_div.addClass( 'disabled' );\n\t\t\t\t\tleft_buttons_div.addClass( 'disabled-image' );\n\t\t\t\t\tleft_buttons_enable = false;\n\t\t\t\t\tright_buttons_div.addClass( 'disabled' );\n\t\t\t\t\tright_buttons_div.addClass( 'disabled-image' );\n\t\t\t\t\tright_buttons_enable = false;\n\n\t\t\t\t\t$this.hide();\n\t\t\t\t} else {\n\t\t\t\t\t$this.show();\n\t\t\t\t}\n\n\t\t\t};\n\n\t\tthis.each( function() {\n\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t\tvar pages_label = $( this ).find( '.page-label-span' );\n\n\t\t\tpages_label.text( $.i18n._( 'Page' ) );\n\n\t\t\tleft_buttons_div = $( this ).find( '.left-buttons-div' );\n\t\t\tright_buttons_div = $( this ).find( '.right-buttons-div' );\n\n\t\t\tstart = $( this ).find( '.start' );\n\t\t\tlast = $( this ).find( '.last' );\n\t\t\tnext = $( this ).find( '.next' );\n\t\t\tend = $( this ).find( '.end' );\n\t\t\tpaging_selector = $( this ).find( '.paging-selector' );\n\n\t\t\tstart.text( $.i18n._( 'Start' ) );\n\t\t\tlast.text( $.i18n._( 'Previous' ) );\n\n\t\t\tnext.text( $.i18n._( 'Next' ) );\n\t\t\tend.text( $.i18n._( 'End' ) );\n\n\t\t\t$( this ).hide();\n\n\t\t\tstart.click( function() {\n\t\t\t\tif ( left_buttons_enable ) {\n\t\t\t\t\t$this.trigger( 'paging', ['start'] );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tlast.click( function() {\n\t\t\t\tif ( left_buttons_enable ) {\n\t\t\t\t\t$this.trigger( 'paging', ['last'] );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tnext.click( function() {\n\t\t\t\tif ( right_buttons_enable ) {\n\t\t\t\t\t$this.trigger( 'paging', ['next'] );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tend.click( f