/* * pagination.js 2.1.5 * A jQuery plugin to provide simple yet fully customisable pagination. * https://github.com/superRaytin/paginationjs * * Homepage: http://pagination.js.org * * Copyright 2014-2100, superRaytin * Released under the MIT license. */ (function(global, $) { if (typeof $ === 'undefined') { throwError('Pagination requires jQuery.'); } var pluginName = 'pagination'; var pluginHookMethod = 'addHook'; var eventPrefix = '__pagination-'; var isFunction = function(func){ return typeof func === "function"; } var isNumeric = function( obj ) { // As of jQuery 3.0, isNumeric is limited to // strings and numbers (primitives or objects) // that can be coerced to finite numbers (gh-2662) var type = typeof obj; return ( type === "number" || type === "string" ) && // parseFloat NaNs numeric-cast false positives ("") // ...but misinterprets leading-number strings, e.g. hex literals ("0x...") // subtraction forces infinities to NaN !isNaN( obj - parseFloat( obj ) ); }; // Conflict, use backup if ($.fn.pagination) { pluginName = 'pagination2'; } $.fn[pluginName] = function(options) { if (typeof options === 'undefined') { return this; } var container = $(this); var attributes = $.extend({}, $.fn[pluginName].defaults, options); var pagination = { initialize: function() { var self = this; // Cache attributes of current instance if (!container.data('pagination')) { container.data('pagination', {}); } if (self.callHook('beforeInit') === false) return; // Pagination has been initialized, destroy it if (container.data('pagination').initialized) { $('.paginationjs', container).remove(); } // Whether to disable Pagination at the initialization self.disabled = !!attributes.disabled; // Model will be passed to the callback function var model = self.model = { pageRange: attributes.pageRange, pageSize: attributes.pageSize }; // dataSource`s type is unknown, parse it to find true data self.parseDataSource(attributes.dataSource, function(dataSource) { // Currently in asynchronous mode self.isAsync = Helpers.isString(dataSource); if (Helpers.isArray(dataSource)) { model.totalNumber = attributes.totalNumber = dataSource.length; } // Currently in asynchronous mode and a totalNumberLocator is specified self.isDynamicTotalNumber = self.isAsync && attributes.totalNumberLocator; var el = self.render(true); // Add extra className to the pagination element if (attributes.className) { el.addClass(attributes.className); } model.el = el; // Append/prepend pagination element to the container container[attributes.position === 'bottom' ? 'append' : 'prepend'](el); // Bind events self.observer(); // Pagination is currently initialized container.data('pagination').initialized = true; // Will be invoked after initialized self.callHook('afterInit', el); }); }, render: function(isBoot) { var self = this; var model = self.model; var el = model.el || $('
'); var isForced = isBoot !== true; self.callHook('beforeRender', isForced); var currentPage = model.pageNumber || attributes.pageNumber; var pageRange = attributes.pageRange || 0; var totalPage = self.getTotalPage(); var rangeStart = currentPage - pageRange; var rangeEnd = currentPage + pageRange; if (rangeEnd > totalPage) { rangeEnd = totalPage; rangeStart = totalPage - pageRange * 2; rangeStart = rangeStart < 1 ? 1 : rangeStart; } if (rangeStart <= 1) { rangeStart = 1; rangeEnd = Math.min(pageRange * 2 + 1, totalPage); } el.html(self.generateHTML({ currentPage: currentPage, pageRange: pageRange, rangeStart: rangeStart, rangeEnd: rangeEnd })); // There is only one page if (attributes.hideWhenLessThanOnePage) { el[totalPage <= 1 ? 'hide' : 'show'](); } self.callHook('afterRender', isForced); return el; }, // Generate HTML of the pages generatePageNumbersHTML: function(args) { var self = this; var currentPage = args.currentPage; var totalPage = self.getTotalPage(); var rangeStart = args.rangeStart; var rangeEnd = args.rangeEnd; var html = ''; var i; var pageLink = attributes.pageLink; var ellipsisText = attributes.ellipsisText; var classPrefix = attributes.classPrefix; var activeClassName = attributes.activeClassName; var disableClassName = attributes.disableClassName; // Disable page range, display all the pages if (attributes.pageRange === null) { for (i = 1; i <= totalPage; i++) { if (i == currentPage) { html += 'The initial impression your blog post makes is crucial, and that’s where your introduction comes into play. Hook your readers with a captivating opening that sparks curiosity or emotion. Address their pain points or questions to establish a connection. Outline the purpose of your post and give a sneak peek into what they can expect. A well-crafted introduction sets the tone for an immersive reading experience.
Within the body of your blog post lies the heart of your message. Break down your content into coherent sections, each with a clear heading that guides readers through the narrative. Dive deep into each subtopic, providing valuable insights, data, and relatable examples. Maintain a logical flow between paragraphs using transitions, ensuring that each point naturally progresses to the next. By structuring your body content effectively, you keep readers engaged and eager to learn more.
Concluding your blog post isn’t just about wrapping things up – it’s your final opportunity to leave a strong impact. Summarize the key takeaways from your post, reinforcing your main points. If relevant, provide actionable solutions or thought-provoking questions to keep readers thinking beyond the post. Encourage engagement by inviting comments, questions, or sharing. A well-crafted conclusion should linger in your readers’ minds, inspiring them to explore further or apply what they’ve learned.
Read more at WISE DIGITAL SOLUTIONS
]]>The initial impression your blog post makes is crucial, and that’s where your introduction comes into play. Hook your readers with a captivating opening that sparks curiosity or emotion. Address their pain points or questions to establish a connection. Outline the purpose of your post and give a sneak peek into what they can expect. A well-crafted introduction sets the tone for an immersive reading experience.
Within the body of your blog post lies the heart of your message. Break down your content into coherent sections, each with a clear heading that guides readers through the narrative. Dive deep into each subtopic, providing valuable insights, data, and relatable examples. Maintain a logical flow between paragraphs using transitions, ensuring that each point naturally progresses to the next. By structuring your body content effectively, you keep readers engaged and eager to learn more.
Concluding your blog post isn’t just about wrapping things up – it’s your final opportunity to leave a strong impact. Summarize the key takeaways from your post, reinforcing your main points. If relevant, provide actionable solutions or thought-provoking questions to keep readers thinking beyond the post. Encourage engagement by inviting comments, questions, or sharing. A well-crafted conclusion should linger in your readers’ minds, inspiring them to explore further or apply what they’ve learned.
Read more at WISE DIGITAL SOLUTIONS
]]>The initial impression your blog post makes is crucial, and that’s where your introduction comes into play. Hook your readers with a captivating opening that sparks curiosity or emotion. Address their pain points or questions to establish a connection. Outline the purpose of your post and give a sneak peek into what they can expect. A well-crafted introduction sets the tone for an immersive reading experience.
Within the body of your blog post lies the heart of your message. Break down your content into coherent sections, each with a clear heading that guides readers through the narrative. Dive deep into each subtopic, providing valuable insights, data, and relatable examples. Maintain a logical flow between paragraphs using transitions, ensuring that each point naturally progresses to the next. By structuring your body content effectively, you keep readers engaged and eager to learn more.
Concluding your blog post isn’t just about wrapping things up – it’s your final opportunity to leave a strong impact. Summarize the key takeaways from your post, reinforcing your main points. If relevant, provide actionable solutions or thought-provoking questions to keep readers thinking beyond the post. Encourage engagement by inviting comments, questions, or sharing. A well-crafted conclusion should linger in your readers’ minds, inspiring them to explore further or apply what they’ve learned.
Read more at WISE DIGITAL SOLUTIONS
]]>Read more at WISE DIGITAL SOLUTIONS
]]>