diff --git a/www/events.js b/www/events.js
index 1734a78..a830721 100644
--- a/www/events.js
+++ b/www/events.js
@@ -371,18 +371,18 @@ $(document).ready(function() {
// hide child rows
$('#eventstable > tbody > tr.tablesorter-childRow td').hide();
// update map after filtering
- $('#eventstable').bind('filterEnd', function(){
+ $('#eventstable').on('filterEnd', function(){
toggleFilteredMarkers();
});
// highlight first event
- $('#eventstable').bind('sortEnd', function(){
+ $('#eventstable').on('sortEnd', function(){
highlightFirstEvent();
});
- $('#eventstable').bind('pagerComplete', function(){
+ $('#eventstable').on('pagerComplete', function(){
highlightFirstEvent();
});
// show / hide event info
- $('#eventstable').delegate('.toggle', 'click' , function(){
+ $('#eventstable').on('click', '.toggle', function(){
// load event details
var eventid = $(this).attr('eventid');
( eventDetails[eventid] ) ? null : ajaxLoadEventInfo(eventid);
diff --git a/www/external/easyPrint.css b/www/external/css/easyPrint.css
similarity index 93%
rename from www/external/easyPrint.css
rename to www/external/css/easyPrint.css
index 1b1189a..177e148 100644
--- a/www/external/easyPrint.css
+++ b/www/external/css/easyPrint.css
@@ -1,20 +1,20 @@
-
-.leaflet-control-easyPrint a {
- background:#fff url(print.png) no-repeat 5px;
- background-size:16px 16px;
- display: block;
- }
-
-
-
-@media print {
-
- html {padding: 0px!important;}
- .leaflet-control-easyPrint-button{display: none!important;}
-
-}
-
-#map {
- width: 1200;
- height: 800;
-}
+
+.leaflet-control-easyPrint a {
+ background:#fff url(print.png) no-repeat 5px;
+ background-size:16px 16px;
+ display: block;
+ }
+
+
+
+@media print {
+
+ html {padding: 0px!important;}
+ .leaflet-control-easyPrint-button{display: none!important;}
+
+}
+
+#map {
+ width: 1200;
+ height: 800;
+}
diff --git a/www/external/print.png b/www/external/css/print.png
similarity index 100%
rename from www/external/print.png
rename to www/external/css/print.png
diff --git a/www/external/jQuery.print.js b/www/external/jQuery.print.js
deleted file mode 100644
index 8942ab9..0000000
--- a/www/external/jQuery.print.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/* jQuery.print, version 1.0.3
- * (c) Sathvik Ponangi, Doers' Guild
- * Licence: CC-By (http://creativecommons.org/licenses/by/3.0/)
- *--------------------------------------------------------------------------*/
-
-(function($) {"use strict";
- // A nice closure for our definitions
-
- function getjQueryObject(string) {
- // Make string a vaild jQuery thing
- var jqObj = $("");
- try {
- jqObj = $(string).clone();
- } catch(e) {
- jqObj = $("").html(string);
- }
- return jqObj;
- }
-
- function isNode(o) {
- /* http://stackoverflow.com/a/384380/937891 */
- return !!( typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string");
- }
-
-
- $.print = $.fn.print = function() {
- // Print a given set of elements
-
- var options, $this, self = this;
-
- // console.log("Printing", this, arguments);
-
- if ( self instanceof $) {
- // Get the node if it is a jQuery object
- self = self.get(0);
- }
-
- if (isNode(self)) {
- // If `this` is a HTML element, i.e. for
- // $(selector).print()
- $this = $(self);
- if (arguments.length > 0) {
- options = arguments[0];
- }
- } else {
- if (arguments.length > 0) {
- // $.print(selector,options)
- $this = $(arguments[0]);
- if (isNode($this[0])) {
- if (arguments.length > 1) {
- options = arguments[1];
- }
- } else {
- // $.print(options)
- options = arguments[0];
- $this = $("html");
- }
- } else {
- // $.print()
- $this = $("html");
- }
- }
-
- // Default options
- var defaults = {
- globalStyles : true,
- mediaPrint : false,
- stylesheet : null,
- noPrintSelector : ".no-print",
- iframe : true,
- append : null,
- prepend : null
- };
- // Merge with user-options
- options = $.extend({}, defaults, (options || {}));
-
- var $styles = $("");
- if (options.globalStyles) {
- // Apply the stlyes from the current sheet to the printed page
- $styles = $("style, link, meta, title");
- } else if (options.mediaPrint) {
- // Apply the media-print stylesheet
- $styles = $("link[media=print]");
- }
- if (options.stylesheet) {
- // Add a custom stylesheet if given
- $styles = $.merge($styles, $(''));
- }
-
- // Create a copy of the element to print
- var copy = $this.clone();
- // Wrap it in a span to get the HTML markup string
- copy = $("").append(copy);
- // Remove unwanted elements
- copy.find(options.noPrintSelector).remove();
- // Add in the styles
- copy.append($styles.clone());
- // Appedned content
- copy.append(getjQueryObject(options.append));
- // Prepended content
- copy.prepend(getjQueryObject(options.prepend));
- // Get the HTML markup string
- var content = copy.html();
- // Destroy the copy
- copy.remove();
-
- var w, wdoc;
- if (options.iframe) {
- // Use an iframe for printing
- try {
- var $iframe = $(options.iframe + "");
- var iframeCount = $iframe.length;
- if (iframeCount === 0) {
- // Create a new iFrame if none is given
- $iframe = $('').prependTo('body').css({
- "position" : "absolute",
- "top" : -999,
- "left" : -999
- });
- }
- w = $iframe.get(0);
- w = w.contentWindow || w.contentDocument || w;
- wdoc = w.document || w.contentDocument || w;
- wdoc.open();
- wdoc.write(content);
- wdoc.close();
- setTimeout(function() {
- // Fix for IE : Allow it to render the iframe
- w.focus();
- w.print();
- setTimeout(function() {
- // Fix for IE
- if (iframeCount === 0) {
- // Destroy the iframe if created here
- $iframe.remove();
- }
- }, 100);
- }, 250);
- } catch (e) {
- // Use the pop-up method if iframe fails for some reason
- console.error("Failed to print from iframe", e.stack, e.message);
- w = window.open();
- w.document.write(content);
- w.document.close();
- w.focus();
- w.print();
- w.close();
- }
- } else {
- // Use a new window for printing
- w = window.open();
- w.document.write(content);
- w.document.close();
- w.focus();
- w.print();
- w.close();
- }
- return this;
- };
-
-})(jQuery);
diff --git a/www/external/jQuery.print.min.js b/www/external/jQuery.print.min.js
new file mode 100644
index 0000000..811cb88
--- /dev/null
+++ b/www/external/jQuery.print.min.js
@@ -0,0 +1,6 @@
+/* @license
+ * jQuery.print, version 1.6.0
+ * (c) Sathvik Ponangi, Doers' Guild
+ * Licence: CC-By (http://creativecommons.org/licenses/by/3.0/)
+ *--------------------------------------------------------------------------*/
+!function(e){"use strict";function t(t,n,r){for(var o=e(t),i=o.clone(n,r),a=o.find("textarea").add(o.filter("textarea")),l=i.find("textarea").add(i.filter("textarea")),c=o.find("select").add(o.filter("select")),d=i.find("select").add(i.filter("select")),f=0,s=a.length;f").html(n)}return r}function r(t,n,r){var o=e.Deferred();try{var i=(t=t.contentWindow||t.contentDocument||t).document||t.contentDocument||t;r.doctype&&i.write(r.doctype),i.write(n),i.close();var a=!1,l=function(){if(!a){t.focus();try{t.document.execCommand("print",!1,null)||t.print(),e("body").focus()}catch(e){t.print()}t.close(),a=!0,o.resolve()}};e(t).on("load",l),setTimeout(l,r.timeout)}catch(e){o.reject(e)}return o}function o(e,t){return r(window.open(),e,t).always(function(){try{t.deferred.resolve()}catch(e){console.warn("Error notifying deferred",e)}})}function i(e){return!!("object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName)}e.print=e.fn.print=function(){var a,l,c=this;c instanceof e&&(c=c.get(0)),i(c)?(l=e(c),arguments.length>0&&(a=arguments[0])):arguments.length>0?i((l=e(arguments[0]))[0])?arguments.length>1&&(a=arguments[1]):(a=arguments[0],l=e("html")):l=e("html");var d={globalStyles:!0,mediaPrint:!1,stylesheet:null,noPrintSelector:".no-print",iframe:!0,append:null,prepend:null,manuallyCopyFormValues:!0,deferred:e.Deferred(),timeout:750,title:null,doctype:""};a=e.extend({},d,a||{});var f=e("");a.globalStyles?f=e("style, link, meta, base, title"):a.mediaPrint&&(f=e("link[media=print]")),a.stylesheet&&(f=e.merge(f,e('')));var s=t(l);if((s=e("").append(s)).find(a.noPrintSelector).remove(),s.append(t(f)),a.title){var p=e("title",s);0===p.length&&(p=e("
= 0\n }\n\n switch (ph.type) {\n case 'b':\n arg = parseInt(arg, 10).toString(2)\n break\n case 'c':\n arg = String.fromCharCode(parseInt(arg, 10))\n break\n case 'd':\n case 'i':\n arg = parseInt(arg, 10)\n break\n case 'j':\n arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)\n break\n case 'e':\n arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()\n break\n case 'f':\n arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)\n break\n case 'g':\n arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)\n break\n case 'o':\n arg = (parseInt(arg, 10) >>> 0).toString(8)\n break\n case 's':\n arg = String(arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 't':\n arg = String(!!arg)\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'T':\n arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'u':\n arg = parseInt(arg, 10) >>> 0\n break\n case 'v':\n arg = arg.valueOf()\n arg = (ph.precision ? arg.substring(0, ph.precision) : arg)\n break\n case 'x':\n arg = (parseInt(arg, 10) >>> 0).toString(16)\n break\n case 'X':\n arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\n break\n }\n if (re.json.test(ph.type)) {\n output += arg\n }\n else {\n if (re.number.test(ph.type) && (!is_positive || ph.sign)) {\n sign = is_positive ? '+' : '-'\n arg = arg.toString().replace(re.sign, '')\n }\n else {\n sign = ''\n }\n pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '\n pad_length = ph.width - (sign + arg).length\n pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\n output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\n }\n }\n }\n return output\n }\n\n var sprintf_cache = Object.create(null)\n\n function sprintf_parse(fmt) {\n if (sprintf_cache[fmt]) {\n return sprintf_cache[fmt]\n }\n\n var _fmt = fmt, match, parse_tree = [], arg_names = 0\n while (_fmt) {\n if ((match = re.text.exec(_fmt)) !== null) {\n parse_tree.push(match[0])\n }\n else if ((match = re.modulo.exec(_fmt)) !== null) {\n parse_tree.push('%')\n }\n else if ((match = re.placeholder.exec(_fmt)) !== null) {\n if (match[2]) {\n arg_names |= 1\n var field_list = [], replacement_field = match[2], field_match = []\n if ((field_match = re.key.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n if ((field_match = re.key_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\n field_list.push(field_match[1])\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n }\n }\n else {\n throw new SyntaxError('[sprintf] failed to parse named argument key')\n }\n match[2] = field_list\n }\n else {\n arg_names |= 2\n }\n if (arg_names === 3) {\n throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\n }\n\n parse_tree.push(\n {\n placeholder: match[0],\n param_no: match[1],\n keys: match[2],\n sign: match[3],\n pad_char: match[4],\n align: match[5],\n width: match[6],\n precision: match[7],\n type: match[8]\n }\n )\n }\n else {\n throw new SyntaxError('[sprintf] unexpected placeholder')\n }\n _fmt = _fmt.substring(match[0].length)\n }\n return sprintf_cache[fmt] = parse_tree\n }\n\n /**\n * export to either browser or node.js\n */\n /* eslint-disable quote-props */\n if (typeof exports !== 'undefined') {\n exports['sprintf'] = sprintf\n exports['vsprintf'] = vsprintf\n }\n if (typeof window !== 'undefined') {\n window['sprintf'] = sprintf\n window['vsprintf'] = vsprintf\n\n if (typeof define === 'function' && define['amd']) {\n define(function() {\n return {\n 'sprintf': sprintf,\n 'vsprintf': vsprintf\n }\n })\n }\n }\n /* eslint-enable quote-props */\n}(); // eslint-disable-line\n"]} \ No newline at end of file diff --git a/www/external/widget-pager.js b/www/external/widget-pager.js deleted file mode 100644 index 43e879c..0000000 --- a/www/external/widget-pager.js +++ /dev/null @@ -1,863 +0,0 @@ -/* Pager widget (beta) for TableSorter 3/31/2014 (v2.15.12) */ -/*jshint browser:true, jquery:true, unused:false */ -;(function($){ -"use strict"; -var tsp, - ts = $.tablesorter; - -ts.addWidget({ - id: "pager", - priority: 55, // load pager after filter widget - options : { - // output default: '{page}/{totalPages}' - // possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows} - pager_output: '{startRow} to {endRow} of {totalRows} rows', // '{page}/{totalPages}' - - // apply disabled classname to the pager arrows when the rows at either extreme is visible - pager_updateArrows: true, - - // starting page of the pager (zero based index) - pager_startPage: 0, - - // Number of visible rows - pager_size: 10, - - // Save pager page & size if the storage script is loaded (requires $.tablesorter.storage in jquery.tablesorter.widgets.js) - pager_savePages: true, - - //defines custom storage key - pager_storageKey: 'tablesorter-pager', - - // if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty - // table row set to a height to compensate; default is false - pager_fixedHeight: false, - - // count child rows towards the set page size? (set true if it is a visible table row within the pager) - // if true, child row(s) may not appear to be attached to its parent row, may be split across pages or - // may distort the table if rowspan or cellspans are included. - pager_countChildRows: false, - - // remove rows from the table to speed up the sort of large tables. - // setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled. - pager_removeRows: false, // removing rows in larger tables speeds up the sort - - // use this format: "http://mydatabase.com?page={page}&size={size}&{sortList:col}&{filterList:fcol}" - // where {page} is replaced by the page number, {size} is replaced by the number of records to show, - // {sortList:col} adds the sortList to the url into a "col" array, and {filterList:fcol} adds - // the filterList to the url into an "fcol" array. - // So a sortList = [[2,0],[3,0]] becomes "&col[2]=0&col[3]=0" in the url - // and a filterList = [[2,Blue],[3,13]] becomes "&fcol[2]=Blue&fcol[3]=13" in the url - pager_ajaxUrl: null, - - // modify the url after all processing has been applied - pager_customAjaxUrl: function(table, url) { return url; }, - - // modify the $.ajax object to allow complete control over your ajax requests - pager_ajaxObject: { - dataType: 'json' - }, - - // set this to false if you want to block ajax loading on init - pager_processAjaxOnInit: true, - - // process ajax so that the following information is returned: - // [ total_rows (number), rows (array of arrays), headers (array; optional) ] - // example: - // [ - // 100, // total rows - // [ - // [ "row1cell1", "row1cell2", ... "row1cellN" ], - // [ "row2cell1", "row2cell2", ... "row2cellN" ], - // ... - // [ "rowNcell1", "rowNcell2", ... "rowNcellN" ] - // ], - // [ "header1", "header2", ... "headerN" ] // optional - // ] - pager_ajaxProcessing: function(ajax){ return [ 0, [], null ]; }, - - // css class names of pager arrows - pager_css: { - container : 'tablesorter-pager', - errorRow : 'tablesorter-errorRow', // error information row (don't include period at beginning) - disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page) - }, - - // jQuery selectors - pager_selectors: { - container : '.pager', // target the pager markup - first : '.first', // go to first page arrow - prev : '.prev', // previous page arrow - next : '.next', // next page arrow - last : '.last', // go to last page arrow - goto : '.gotoPage', // go to page selector - select dropdown that sets the current page - pageDisplay : '.pagedisplay', // location of where the "output" is displayed - pageSize : '.pagesize' // page size selector - select dropdown that sets the "size" option - } - }, - init: function(table){ - tsp.init(table); - }, - // only update to complete sorter initialization - format: function(table, c){ - if (!(c.pager && c.pager.initialized)){ - return tsp.initComplete(table, c); - } - tsp.moveToPage(table, c.pager, false); - }, - remove: function(table, c){ - tsp.destroyPager(table, c); - } -}); - -/* pager widget functions */ -tsp = ts.pager = { - - init: function(table) { - // check if tablesorter has initialized - if (table.hasInitialized && table.config.pager.initialized) { return; } - var t, - c = table.config, - wo = c.widgetOptions, - s = wo.pager_selectors, - - // save pager variables - p = c.pager = $.extend({ - totalPages: 0, - filteredRows: 0, - filteredPages: 0, - currentFilters: [], - page: wo.pager_startPage, - size: wo.pager_size, - startRow: 0, - endRow: 0, - ajaxCounter: 0, - $size: null, - last: {} - }, c.pager); - - // pager initializes multiple times before table has completed initialization - if (p.isInitializing) { return; } - - p.isInitializing = true; - if (c.debug) { - ts.log('Pager initializing'); - } - - // added in case the pager is reinitialized after being destroyed. - p.$container = $(s.container).addClass(wo.pager_css.container).show(); - // goto selector - p.$goto = p.$container.find(s.goto); - // page size selector - p.$size = p.$container.find(s.pageSize); - p.totalRows = c.$tbodies.eq(0).children().length; - p.oldAjaxSuccess = p.oldAjaxSuccess || wo.pager_ajaxObject.success; - c.appender = tsp.appender; - if (ts.filter && $.inArray('filter', c.widgets) >= 0) { - // get any default filter settings (data-value attribute) fixes #388 - p.currentFilters = c.$table.data('lastSearch') || ts.filter.setDefaults(table, c, wo) || []; - // set, but don't apply current filters - ts.setFilters(table, p.currentFilters, false); - } - if (wo.pager_savePages && ts.storage) { - t = ts.storage(table, wo.pager_storageKey) || {}; // fixes #387 - p.page = isNaN(t.page) ? p.page : t.page; - p.size = ( isNaN(t.size) ? p.size : t.size ) || 10; - $.data(table, 'pagerLastSize', p.size); - } - // clear initialized flag - p.initialized = false; - // before initialization event - c.$table.trigger('pagerBeforeInitialized', c); - - tsp.enablePager(table, c, false); - - if ( typeof(wo.pager_ajaxUrl) === 'string' ) { - // ajax pager; interact with database - p.ajax = true; - // When filtering with ajax, allow only custom filtering function, disable default filtering since it will be done server side. - wo.filter_serversideFiltering = true; - c.serverSideSorting = true; - tsp.moveToPage(table, p); - } else { - p.ajax = false; - // Regular pager; all rows stored in memory - c.$table.trigger("appendCache", [{}, true]); - tsp.hideRowsSetup(table, c); - } - - }, - - initComplete: function(table, c){ - var p = c.pager; - tsp.changeHeight(table, c); - tsp.bindEvents(table, c); - - // pager initialized - p.initialized = true; - p.isInitializing = false; - tsp.setPageSize(table, 0, c); // page size 0 is ignored - c.$table.trigger('pagerInitialized', c); - - }, - - bindEvents: function(table, c){ - var ctrls, fxn, - p = c.pager, - wo = c.widgetOptions, - s = wo.pager_selectors; - - c.$table - .unbind('filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize '.split(' ').join('.pager ')) - .bind('filterStart.pager', function(e, filters) { - p.currentFilters = filters; - p.page = 0; // fixes #456 - }) - // update pager after filter widget completes - .bind('filterEnd.pager sortEnd.pager', function() { - if (p.initialized) { - tsp.moveToPage(table, p, false); - tsp.updatePageDisplay(table, c, false); - tsp.fixHeight(table, c); - } - }) - .bind('disable.pager', function(e){ - e.stopPropagation(); - tsp.showAllRows(table, c); - }) - .on('enable.pager', function(e){ - e.stopPropagation(); - tsp.enablePager(table, c, true); - }) - .on('destroy.pager', function(e){ - e.stopPropagation(); - tsp.destroyPager(table, c); - }) - .on('update updateRows updateAll addRows '.split(' ').join('.pager '), function(e){ - e.stopPropagation(); - tsp.hideRows(table, c); - // make sure widgets are applied - fixes #450 - c.$table.trigger('applyWidgets'); - }) - .on('pageSize.pager', function(e,v){ - e.stopPropagation(); - tsp.setPageSize(table, parseInt(v, 10) || 10, c); - tsp.hideRows(table, c); - tsp.updatePageDisplay(table, c, false); - if (p.$size.length) { p.$size.val(p.size); } // twice? - }) - .on('pageSet.pager', function(e,v){ - e.stopPropagation(); - p.page = (parseInt(v, 10) || 1) - 1; - if (p.$goto.length) { p.$goto.val(c.size); } // twice? - tsp.moveToPage(table, p); - tsp.updatePageDisplay(table, c, false); - }); - - // clicked controls - ctrls = [ s.first, s.prev, s.next, s.last ]; - fxn = [ 'moveToFirstPage', 'moveToPrevPage', 'moveToNextPage', 'moveToLastPage' ]; - p.$container.find(ctrls.join(',')) - .attr("tabindex", 0) - .unbind('click.pager') - .bind('click.pager', function(e){ - e.stopPropagation(); - var i, - $c = $(this), - l = ctrls.length; - if ( !$c.hasClass(wo.pager_css.disabled) ) { - for (i = 0; i < l; i++) { - if ($c.is(ctrls[i])) { - tsp[fxn[i]](table, p); - break; - } - } - } - }); - - if ( p.$goto.length ) { - p.$goto - .unbind('change') - .bind('change', function(){ - p.page = $(this).val() - 1; - tsp.moveToPage(table, p); - tsp.updatePageDisplay(table, c, false); - }); - } - - if ( p.$size.length ) { - p.$size - .unbind('change.pager') - .bind('change.pager', function() { - p.$size.val( $(this).val() ); // in case there are more than one pagers - if ( !$(this).hasClass(wo.pager_css.disabled) ) { - tsp.setPageSize(table, parseInt( $(this).val(), 10 ), c); - tsp.changeHeight(table, c); - } - return false; - }); - } - - }, - - // hide arrows at extremes - pagerArrows: function(c, disable) { - var p = c.pager, - dis = !!disable, - first = dis || p.page === 0, - tp = Math.min( p.totalPages, p.filteredPages ), - last = dis || p.page === tp - 1 || p.totalPages === 0, - wo = c.widgetOptions, - s = wo.pager_selectors; - if ( wo.pager_updateArrows ) { - p.$container.find(s.first + ',' + s.prev).toggleClass(wo.pager_css.disabled, first).attr('aria-disabled', first); - p.$container.find(s.next + ',' + s.last).toggleClass(wo.pager_css.disabled, last).attr('aria-disabled', last); - } - }, - - updatePageDisplay: function(table, c, completed) { - var i, pg, s, out, - wo = c.widgetOptions, - p = c.pager, - f = c.$table.hasClass('hasFilters') && !wo.pager_ajaxUrl, - t = (c.widgetOptions && c.widgetOptions.filter_filteredRow || 'filtered') + ',' + c.selectorRemove + - (wo.pager_countChildRows ? '' : ',.' + c.cssChildRow), - sz = p.size || 10; // don't allow dividing by zero - p.$size.add(p.$goto).removeClass(wo.pager_css.disabled).removeAttr('disabled').attr('aria-disabled', 'false'); - p.totalPages = Math.ceil( p.totalRows / sz ); // needed for "pageSize" method - p.filteredRows = (f) ? c.$tbodies.eq(0).children('tr').not('.' + t).length : p.totalRows; - p.filteredPages = (f) ? Math.ceil( p.filteredRows / sz ) || 1 : p.totalPages; - if ( Math.min( p.totalPages, p.filteredPages ) >= 0 ) { - t = (p.size * p.page > p.filteredRows); - p.startRow = (t) ? 1 : (p.filteredRows === 0 ? 0 : p.size * p.page + 1); - p.page = (t) ? 0 : p.page; - p.endRow = Math.min( p.filteredRows, p.totalRows, p.size * ( p.page + 1 ) ); - out = p.$container.find(wo.pager_selectors.pageDisplay); - // form the output string (can now get a new output string from the server) - s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || wo.pager_output : wo.pager_output ) - // {page} = one-based index; {page+#} = zero based index +/- value - .replace(/\{page([\-+]\d+)?\}/gi, function(m,n){ - return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0; - }) - // {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object) - .replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){ - var str = m.replace(/[{}\s]/g,''), - extra = str.split(':'), - data = p.ajaxData, - // return zero for default page/row numbers - deflt = /(rows?|pages?)$/i.test(str) ? 0 : ''; - return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt; - }); - if (out.length) { - out[ (out[0].tagName === 'INPUT') ? 'val' : 'html' ](s); - if ( p.$goto.length ) { - t = ''; - pg = Math.min( p.totalPages, p.filteredPages ); - for ( i = 1; i <= pg; i++ ) { - t += ''; - } - p.$goto.html(t).val( p.page + 1 ); - } - } - } - tsp.pagerArrows(c); - if (p.initialized && completed !== false) { - c.$table.trigger('pagerComplete', c); - // save pager info to storage - if (wo.pager_savePages && ts.storage) { - ts.storage(table, wo.pager_storageKey, { - page : p.page, - size : p.size - }); - } - } - }, - - fixHeight: function(table, c) { - var d, h, - p = c.pager, - wo = c.widgetOptions, - $b = c.$tbodies.eq(0); - if (wo.pager_fixedHeight) { - $b.find('tr.pagerSavedHeightSpacer').remove(); - h = $.data(table, 'pagerSavedHeight'); - if (h) { - d = h - $b.height(); - if ( d > 5 && $.data(table, 'pagerLastSize') === p.size && $b.children('tr:visible').length < p.size ) { - $b.append('