/actions/src/main/webapp/scripts/jquery.dataTables.min.js
http://alageospatialportal.googlecode.com/ · JavaScript · 2474 lines · 2398 code · 61 blank · 15 comment · 648 complexity · 39305027339885c85e3ba02d4f779517 MD5 · raw file
Large files are truncated click here to view the full file
- /*
- * File: jquery.dataTables.min.js
- * Version: 1.8.2
- * Author: Allan Jardine (www.sprymedia.co.uk)
- * Info: www.datatables.net
- *
- * Copyright 2008-2011 Allan Jardine, all rights reserved.
- *
- * This source file is free software, under either the GPL v2 license or a
- * BSD style license, as supplied with this software.
- *
- * This source file is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
- */
- (function (i, za, p) {
- i.fn.dataTableSettings = [];
- var D = i.fn.dataTableSettings;
- i.fn.dataTableExt = {};
- var n = i.fn.dataTableExt;
- n.sVersion = "1.8.2";
- n.sErrMode = "alert";
- n.iApiIndex = 0;
- n.oApi = {};
- n.afnFiltering = [];
- n.aoFeatures = [];
- n.ofnSearch = {};
- n.afnSortData = [];
- n.oStdClasses = {sPagePrevEnabled: "paginate_enabled_previous", sPagePrevDisabled: "paginate_disabled_previous", sPageNextEnabled: "paginate_enabled_next", sPageNextDisabled: "paginate_disabled_next", sPageJUINext: "", sPageJUIPrev: "", sPageButton: "paginate_button", sPageButtonActive: "paginate_active",
- sPageButtonStaticDisabled: "paginate_button paginate_button_disabled", sPageFirst: "first", sPagePrevious: "previous", sPageNext: "next", sPageLast: "last", sStripeOdd: "odd", sStripeEven: "even", sRowEmpty: "dataTables_empty", sWrapper: "dataTables_wrapper", sFilter: "dataTables_filter", sInfo: "dataTables_info", sPaging: "dataTables_paginate paging_", sLength: "dataTables_length", sProcessing: "dataTables_processing", sSortAsc: "sorting_asc", sSortDesc: "sorting_desc", sSortable: "sorting", sSortableAsc: "sorting_asc_disabled", sSortableDesc: "sorting_desc_disabled",
- sSortableNone: "sorting_disabled", sSortColumn: "sorting_", sSortJUIAsc: "", sSortJUIDesc: "", sSortJUI: "", sSortJUIAscAllowed: "", sSortJUIDescAllowed: "", sSortJUIWrapper: "", sSortIcon: "", sScrollWrapper: "dataTables_scroll", sScrollHead: "dataTables_scrollHead", sScrollHeadInner: "dataTables_scrollHeadInner", sScrollBody: "dataTables_scrollBody", sScrollFoot: "dataTables_scrollFoot", sScrollFootInner: "dataTables_scrollFootInner", sFooterTH: ""};
- n.oJUIClasses = {sPagePrevEnabled: "fg-button ui-button ui-state-default ui-corner-left",
- sPagePrevDisabled: "fg-button ui-button ui-state-default ui-corner-left ui-state-disabled", sPageNextEnabled: "fg-button ui-button ui-state-default ui-corner-right", sPageNextDisabled: "fg-button ui-button ui-state-default ui-corner-right ui-state-disabled", sPageJUINext: "ui-icon ui-icon-circle-arrow-e", sPageJUIPrev: "ui-icon ui-icon-circle-arrow-w", sPageButton: "fg-button ui-button ui-state-default", sPageButtonActive: "fg-button ui-button ui-state-default ui-state-disabled", sPageButtonStaticDisabled: "fg-button ui-button ui-state-default ui-state-disabled",
- sPageFirst: "first ui-corner-tl ui-corner-bl", sPagePrevious: "previous", sPageNext: "next", sPageLast: "last ui-corner-tr ui-corner-br", sStripeOdd: "odd", sStripeEven: "even", sRowEmpty: "dataTables_empty", sWrapper: "dataTables_wrapper", sFilter: "dataTables_filter", sInfo: "dataTables_info", sPaging: "dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_", sLength: "dataTables_length", sProcessing: "dataTables_processing", sSortAsc: "ui-state-default", sSortDesc: "ui-state-default", sSortable: "ui-state-default",
- sSortableAsc: "ui-state-default", sSortableDesc: "ui-state-default", sSortableNone: "ui-state-default", sSortColumn: "sorting_", sSortJUIAsc: "css_right ui-icon ui-icon-triangle-1-n", sSortJUIDesc: "css_right ui-icon ui-icon-triangle-1-s", sSortJUI: "css_right ui-icon ui-icon-carat-2-n-s", sSortJUIAscAllowed: "css_right ui-icon ui-icon-carat-1-n", sSortJUIDescAllowed: "css_right ui-icon ui-icon-carat-1-s", sSortJUIWrapper: "DataTables_sort_wrapper", sSortIcon: "DataTables_sort_icon", sScrollWrapper: "dataTables_scroll",
- sScrollHead: "dataTables_scrollHead ui-state-default", sScrollHeadInner: "dataTables_scrollHeadInner", sScrollBody: "dataTables_scrollBody", sScrollFoot: "dataTables_scrollFoot ui-state-default", sScrollFootInner: "dataTables_scrollFootInner", sFooterTH: "ui-state-default"};
- n.oPagination = {two_button: {fnInit: function (g, l, s) {
- var t, w, y;
- if (g.bJUI) {
- t = p.createElement("a");
- w = p.createElement("a");
- y = p.createElement("span");
- y.className = g.oClasses.sPageJUINext;
- w.appendChild(y);
- y = p.createElement("span");
- y.className = g.oClasses.sPageJUIPrev;
- t.appendChild(y)
- } else {
- t = p.createElement("div");
- w = p.createElement("div")
- }
- t.className = g.oClasses.sPagePrevDisabled;
- w.className = g.oClasses.sPageNextDisabled;
- t.title = g.oLanguage.oPaginate.sPrevious;
- w.title = g.oLanguage.oPaginate.sNext;
- l.appendChild(t);
- l.appendChild(w);
- i(t).bind("click.DT", function () {
- g.oApi._fnPageChange(g, "previous") && s(g)
- });
- i(w).bind("click.DT", function () {
- g.oApi._fnPageChange(g, "next") && s(g)
- });
- i(t).bind("selectstart.DT", function () {
- return false
- });
- i(w).bind("selectstart.DT", function () {
- return false
- });
- if (g.sTableId !== "" && typeof g.aanFeatures.p == "undefined") {
- l.setAttribute("id", g.sTableId + "_paginate");
- t.setAttribute("id", g.sTableId + "_previous");
- w.setAttribute("id", g.sTableId + "_next")
- }
- }, fnUpdate: function (g) {
- if (g.aanFeatures.p)for (var l = g.aanFeatures.p, s = 0, t = l.length; s < t; s++)if (l[s].childNodes.length !== 0) {
- l[s].childNodes[0].className = g._iDisplayStart === 0 ? g.oClasses.sPagePrevDisabled : g.oClasses.sPagePrevEnabled;
- l[s].childNodes[1].className = g.fnDisplayEnd() == g.fnRecordsDisplay() ? g.oClasses.sPageNextDisabled :
- g.oClasses.sPageNextEnabled
- }
- }}, iFullNumbersShowPages: 5, full_numbers: {fnInit: function (g, l, s) {
- var t = p.createElement("span"), w = p.createElement("span"), y = p.createElement("span"), F = p.createElement("span"), x = p.createElement("span");
- t.innerHTML = g.oLanguage.oPaginate.sFirst;
- w.innerHTML = g.oLanguage.oPaginate.sPrevious;
- F.innerHTML = g.oLanguage.oPaginate.sNext;
- x.innerHTML = g.oLanguage.oPaginate.sLast;
- var v = g.oClasses;
- t.className = v.sPageButton + " " + v.sPageFirst;
- w.className = v.sPageButton + " " + v.sPagePrevious;
- F.className =
- v.sPageButton + " " + v.sPageNext;
- x.className = v.sPageButton + " " + v.sPageLast;
- l.appendChild(t);
- l.appendChild(w);
- l.appendChild(y);
- l.appendChild(F);
- l.appendChild(x);
- i(t).bind("click.DT", function () {
- g.oApi._fnPageChange(g, "first") && s(g)
- });
- i(w).bind("click.DT", function () {
- g.oApi._fnPageChange(g, "previous") && s(g)
- });
- i(F).bind("click.DT", function () {
- g.oApi._fnPageChange(g, "next") && s(g)
- });
- i(x).bind("click.DT", function () {
- g.oApi._fnPageChange(g, "last") && s(g)
- });
- i("span", l).bind("mousedown.DT",function () {
- return false
- }).bind("selectstart.DT",
- function () {
- return false
- });
- if (g.sTableId !== "" && typeof g.aanFeatures.p == "undefined") {
- l.setAttribute("id", g.sTableId + "_paginate");
- t.setAttribute("id", g.sTableId + "_first");
- w.setAttribute("id", g.sTableId + "_previous");
- F.setAttribute("id", g.sTableId + "_next");
- x.setAttribute("id", g.sTableId + "_last")
- }
- }, fnUpdate: function (g, l) {
- if (g.aanFeatures.p) {
- var s = n.oPagination.iFullNumbersShowPages, t = Math.floor(s / 2), w = Math.ceil(g.fnRecordsDisplay() / g._iDisplayLength), y = Math.ceil(g._iDisplayStart / g._iDisplayLength) + 1, F =
- "", x, v = g.oClasses;
- if (w < s) {
- t = 1;
- x = w
- } else if (y <= t) {
- t = 1;
- x = s
- } else if (y >= w - t) {
- t = w - s + 1;
- x = w
- } else {
- t = y - Math.ceil(s / 2) + 1;
- x = t + s - 1
- }
- for (s = t; s <= x; s++)F += y != s ? '<span class="' + v.sPageButton + '">' + s + "</span>" : '<span class="' + v.sPageButtonActive + '">' + s + "</span>";
- x = g.aanFeatures.p;
- var z, $ = function (M) {
- g._iDisplayStart = (this.innerHTML * 1 - 1) * g._iDisplayLength;
- l(g);
- M.preventDefault()
- }, X = function () {
- return false
- };
- s = 0;
- for (t = x.length; s < t; s++)if (x[s].childNodes.length !== 0) {
- z = i("span:eq(2)", x[s]);
- z.html(F);
- i("span", z).bind("click.DT",
- $).bind("mousedown.DT", X).bind("selectstart.DT", X);
- z = x[s].getElementsByTagName("span");
- z = [z[0], z[1], z[z.length - 2], z[z.length - 1]];
- i(z).removeClass(v.sPageButton + " " + v.sPageButtonActive + " " + v.sPageButtonStaticDisabled);
- if (y == 1) {
- z[0].className += " " + v.sPageButtonStaticDisabled;
- z[1].className += " " + v.sPageButtonStaticDisabled
- } else {
- z[0].className += " " + v.sPageButton;
- z[1].className += " " + v.sPageButton
- }
- if (w === 0 || y == w || g._iDisplayLength == -1) {
- z[2].className += " " + v.sPageButtonStaticDisabled;
- z[3].className += " " +
- v.sPageButtonStaticDisabled
- } else {
- z[2].className += " " + v.sPageButton;
- z[3].className += " " + v.sPageButton
- }
- }
- }
- }}};
- n.oSort = {"string-asc": function (g, l) {
- if (typeof g != "string")g = "";
- if (typeof l != "string")l = "";
- g = g.toLowerCase();
- l = l.toLowerCase();
- return g < l ? -1 : g > l ? 1 : 0
- }, "string-desc": function (g, l) {
- if (typeof g != "string")g = "";
- if (typeof l != "string")l = "";
- g = g.toLowerCase();
- l = l.toLowerCase();
- return g < l ? 1 : g > l ? -1 : 0
- }, "html-asc": function (g, l) {
- g = g.replace(/<.*?>/g, "").toLowerCase();
- l = l.replace(/<.*?>/g, "").toLowerCase();
- return g <
- l ? -1 : g > l ? 1 : 0
- }, "html-desc": function (g, l) {
- g = g.replace(/<.*?>/g, "").toLowerCase();
- l = l.replace(/<.*?>/g, "").toLowerCase();
- return g < l ? 1 : g > l ? -1 : 0
- }, "date-asc": function (g, l) {
- g = Date.parse(g);
- l = Date.parse(l);
- if (isNaN(g) || g === "")g = Date.parse("01/01/1970 00:00:00");
- if (isNaN(l) || l === "")l = Date.parse("01/01/1970 00:00:00");
- return g - l
- }, "date-desc": function (g, l) {
- g = Date.parse(g);
- l = Date.parse(l);
- if (isNaN(g) || g === "")g = Date.parse("01/01/1970 00:00:00");
- if (isNaN(l) || l === "")l = Date.parse("01/01/1970 00:00:00");
- return l -
- g
- }, "numeric-asc": function (g, l) {
- return(g == "-" || g === "" ? 0 : g * 1) - (l == "-" || l === "" ? 0 : l * 1)
- }, "numeric-desc": function (g, l) {
- return(l == "-" || l === "" ? 0 : l * 1) - (g == "-" || g === "" ? 0 : g * 1)
- }};
- n.aTypes = [function (g) {
- if (typeof g == "number")return"numeric"; else if (typeof g != "string")return null;
- var l, s = false;
- l = g.charAt(0);
- if ("0123456789-".indexOf(l) == -1)return null;
- for (var t = 1; t < g.length; t++) {
- l = g.charAt(t);
- if ("0123456789.".indexOf(l) == -1)return null;
- if (l == ".") {
- if (s)return null;
- s = true
- }
- }
- return"numeric"
- }, function (g) {
- var l = Date.parse(g);
- if (l !== null && !isNaN(l) || typeof g == "string" && g.length === 0)return"date";
- return null
- }, function (g) {
- if (typeof g == "string" && g.indexOf("<") != -1 && g.indexOf(">") != -1)return"html";
- return null
- }];
- n.fnVersionCheck = function (g) {
- var l = function (x, v) {
- for (; x.length < v;)x += "0";
- return x
- }, s = n.sVersion.split(".");
- g = g.split(".");
- for (var t = "", w = "", y = 0, F = g.length; y < F; y++) {
- t += l(s[y], 3);
- w += l(g[y], 3)
- }
- return parseInt(t, 10) >= parseInt(w, 10)
- };
- n._oExternConfig = {iNextUnique: 0};
- i.fn.dataTable = function (g) {
- function l() {
- this.fnRecordsTotal =
- function () {
- return this.oFeatures.bServerSide ? parseInt(this._iRecordsTotal, 10) : this.aiDisplayMaster.length
- };
- this.fnRecordsDisplay = function () {
- return this.oFeatures.bServerSide ? parseInt(this._iRecordsDisplay, 10) : this.aiDisplay.length
- };
- this.fnDisplayEnd = function () {
- return this.oFeatures.bServerSide ? this.oFeatures.bPaginate === false || this._iDisplayLength == -1 ? this._iDisplayStart + this.aiDisplay.length : Math.min(this._iDisplayStart + this._iDisplayLength, this._iRecordsDisplay) : this._iDisplayEnd
- };
- this.sInstance =
- this.oInstance = null;
- this.oFeatures = {bPaginate: true, bLengthChange: true, bFilter: true, bSort: true, bInfo: true, bAutoWidth: true, bProcessing: false, bSortClasses: true, bStateSave: false, bServerSide: false, bDeferRender: false};
- this.oScroll = {sX: "", sXInner: "", sY: "", bCollapse: false, bInfinite: false, iLoadGap: 100, iBarWidth: 0, bAutoCss: true};
- this.aanFeatures = [];
- this.oLanguage = {sProcessing: "Processing...", sLengthMenu: "Show _MENU_ entries", sZeroRecords: "No matching records found", sEmptyTable: "No data available in table",
- sLoadingRecords: "Loading...", sInfo: "Showing _START_ to _END_ of _TOTAL_ entries", sInfoEmpty: "Showing 0 to 0 of 0 entries", sInfoFiltered: "(filtered from _MAX_ total entries)", sInfoPostFix: "", sInfoThousands: ",", sSearch: "Search:", sUrl: "", oPaginate: {sFirst: "First", sPrevious: "Previous", sNext: "Next", sLast: "Last"}, fnInfoCallback: null};
- this.aoData = [];
- this.aiDisplay = [];
- this.aiDisplayMaster = [];
- this.aoColumns = [];
- this.aoHeader = [];
- this.aoFooter = [];
- this.iNextId = 0;
- this.asDataSearch = [];
- this.oPreviousSearch = {sSearch: "",
- bRegex: false, bSmart: true};
- this.aoPreSearchCols = [];
- this.aaSorting = [
- [0, "asc", 0]
- ];
- this.aaSortingFixed = null;
- this.asStripeClasses = [];
- this.asDestroyStripes = [];
- this.sDestroyWidth = 0;
- this.fnFooterCallback = this.fnHeaderCallback = this.fnRowCallback = null;
- this.aoDrawCallback = [];
- this.fnInitComplete = this.fnPreDrawCallback = null;
- this.sTableId = "";
- this.nTableWrapper = this.nTBody = this.nTFoot = this.nTHead = this.nTable = null;
- this.bInitialised = this.bDeferLoading = false;
- this.aoOpenRows = [];
- this.sDom = "lfrtip";
- this.sPaginationType =
- "two_button";
- this.iCookieDuration = 7200;
- this.sCookiePrefix = "SpryMedia_DataTables_";
- this.fnCookieCallback = null;
- this.aoStateSave = [];
- this.aoStateLoad = [];
- this.sAjaxSource = this.oLoadedState = null;
- this.sAjaxDataProp = "aaData";
- this.bAjaxDataGet = true;
- this.jqXHR = null;
- this.fnServerData = function (a, b, c, d) {
- d.jqXHR = i.ajax({url: a, data: b, success: function (f) {
- i(d.oInstance).trigger("xhr", d);
- c(f)
- }, dataType: "json", cache: false, error: function (f, e) {
- e == "parsererror" && alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")
- }})
- };
- this.aoServerParams = [];
- this.fnFormatNumber = function (a) {
- if (a < 1E3)return a; else {
- var b = a + "";
- a = b.split("");
- var c = "";
- b = b.length;
- for (var d = 0; d < b; d++) {
- if (d % 3 === 0 && d !== 0)c = this.oLanguage.sInfoThousands + c;
- c = a[b - d - 1] + c
- }
- }
- return c
- };
- this.aLengthMenu = [10, 25, 50, 100];
- this.bDrawing = this.iDraw = 0;
- this.iDrawError = -1;
- this._iDisplayLength = 10;
- this._iDisplayStart = 0;
- this._iDisplayEnd = 10;
- this._iRecordsDisplay = this._iRecordsTotal = 0;
- this.bJUI = false;
- this.oClasses = n.oStdClasses;
- this.bSortCellsTop = this.bSorted = this.bFiltered = false;
- this.oInit = null;
- this.aoDestroyCallback = []
- }
- function s(a) {
- return function () {
- var b = [A(this[n.iApiIndex])].concat(Array.prototype.slice.call(arguments));
- return n.oApi[a].apply(this, b)
- }
- }
- function t(a) {
- var b, c, d = a.iInitDisplayStart;
- if (a.bInitialised === false)setTimeout(function () {
- t(a)
- }, 200); else {
- Aa(a);
- X(a);
- M(a, a.aoHeader);
- a.nTFoot && M(a, a.aoFooter);
- K(a, true);
- a.oFeatures.bAutoWidth && ga(a);
- b = 0;
- for (c = a.aoColumns.length; b < c; b++)if (a.aoColumns[b].sWidth !== null)a.aoColumns[b].nTh.style.width = q(a.aoColumns[b].sWidth);
- if (a.oFeatures.bSort)R(a); else if (a.oFeatures.bFilter)N(a, a.oPreviousSearch); else {
- a.aiDisplay = a.aiDisplayMaster.slice();
- E(a);
- C(a)
- }
- if (a.sAjaxSource !== null && !a.oFeatures.bServerSide) {
- c = [];
- ha(a, c);
- a.fnServerData.call(a.oInstance, a.sAjaxSource, c, function (f) {
- var e = f;
- if (a.sAjaxDataProp !== "")e = aa(a.sAjaxDataProp)(f);
- for (b = 0; b < e.length; b++)v(a, e[b]);
- a.iInitDisplayStart = d;
- if (a.oFeatures.bSort)R(a); else {
- a.aiDisplay = a.aiDisplayMaster.slice();
- E(a);
- C(a)
- }
- K(a, false);
- w(a, f)
- }, a)
- } else if (!a.oFeatures.bServerSide) {
- K(a,
- false);
- w(a)
- }
- }
- }
- function w(a, b) {
- a._bInitComplete = true;
- if (typeof a.fnInitComplete == "function")typeof b != "undefined" ? a.fnInitComplete.call(a.oInstance, a, b) : a.fnInitComplete.call(a.oInstance, a)
- }
- function y(a, b, c) {
- a.oLanguage = i.extend(true, a.oLanguage, b);
- typeof b.sEmptyTable == "undefined" && typeof b.sZeroRecords != "undefined" && o(a.oLanguage, b, "sZeroRecords", "sEmptyTable");
- typeof b.sLoadingRecords == "undefined" && typeof b.sZeroRecords != "undefined" && o(a.oLanguage, b, "sZeroRecords", "sLoadingRecords");
- c && t(a)
- }
- function F(a, b) {
- var c = a.aoColumns.length;
- b = {sType: null, _bAutoType: true, bVisible: true, bSearchable: true, bSortable: true, asSorting: ["asc", "desc"], sSortingClass: a.oClasses.sSortable, sSortingClassJUI: a.oClasses.sSortJUI, sTitle: b ? b.innerHTML : "", sName: "", sWidth: null, sWidthOrig: null, sClass: null, fnRender: null, bUseRendered: true, iDataSort: c, mDataProp: c, fnGetData: null, fnSetData: null, sSortDataType: "std", sDefaultContent: null, sContentPadding: "", nTh: b ? b : p.createElement("th"), nTf: null};
- a.aoColumns.push(b);
- if (typeof a.aoPreSearchCols[c] ==
- "undefined" || a.aoPreSearchCols[c] === null)a.aoPreSearchCols[c] = {sSearch: "", bRegex: false, bSmart: true}; else {
- if (typeof a.aoPreSearchCols[c].bRegex == "undefined")a.aoPreSearchCols[c].bRegex = true;
- if (typeof a.aoPreSearchCols[c].bSmart == "undefined")a.aoPreSearchCols[c].bSmart = true
- }
- x(a, c, null)
- }
- function x(a, b, c) {
- b = a.aoColumns[b];
- if (typeof c != "undefined" && c !== null) {
- if (typeof c.sType != "undefined") {
- b.sType = c.sType;
- b._bAutoType = false
- }
- o(b, c, "bVisible");
- o(b, c, "bSearchable");
- o(b, c, "bSortable");
- o(b, c, "sTitle");
- o(b,
- c, "sName");
- o(b, c, "sWidth");
- o(b, c, "sWidth", "sWidthOrig");
- o(b, c, "sClass");
- o(b, c, "fnRender");
- o(b, c, "bUseRendered");
- o(b, c, "iDataSort");
- o(b, c, "mDataProp");
- o(b, c, "asSorting");
- o(b, c, "sSortDataType");
- o(b, c, "sDefaultContent");
- o(b, c, "sContentPadding")
- }
- b.fnGetData = aa(b.mDataProp);
- b.fnSetData = Ba(b.mDataProp);
- if (!a.oFeatures.bSort)b.bSortable = false;
- if (!b.bSortable || i.inArray("asc", b.asSorting) == -1 && i.inArray("desc", b.asSorting) == -1) {
- b.sSortingClass = a.oClasses.sSortableNone;
- b.sSortingClassJUI = ""
- } else if (b.bSortable ||
- i.inArray("asc", b.asSorting) == -1 && i.inArray("desc", b.asSorting) == -1) {
- b.sSortingClass = a.oClasses.sSortable;
- b.sSortingClassJUI = a.oClasses.sSortJUI
- } else if (i.inArray("asc", b.asSorting) != -1 && i.inArray("desc", b.asSorting) == -1) {
- b.sSortingClass = a.oClasses.sSortableAsc;
- b.sSortingClassJUI = a.oClasses.sSortJUIAscAllowed
- } else if (i.inArray("asc", b.asSorting) == -1 && i.inArray("desc", b.asSorting) != -1) {
- b.sSortingClass = a.oClasses.sSortableDesc;
- b.sSortingClassJUI = a.oClasses.sSortJUIDescAllowed
- }
- }
- function v(a, b) {
- var c;
- c = i.isArray(b) ? b.slice() : i.extend(true, {}, b);
- b = a.aoData.length;
- var d = {nTr: null, _iId: a.iNextId++, _aData: c, _anHidden: [], _sRowStripe: ""};
- a.aoData.push(d);
- for (var f, e = 0, h = a.aoColumns.length; e < h; e++) {
- c = a.aoColumns[e];
- typeof c.fnRender == "function" && c.bUseRendered && c.mDataProp !== null && O(a, b, e, c.fnRender({iDataRow: b, iDataColumn: e, aData: d._aData, oSettings: a}));
- if (c._bAutoType && c.sType != "string") {
- f = G(a, b, e, "type");
- if (f !== null && f !== "") {
- f = ia(f);
- if (c.sType === null)c.sType = f; else if (c.sType != f && c.sType != "html")c.sType =
- "string"
- }
- }
- }
- a.aiDisplayMaster.push(b);
- a.oFeatures.bDeferRender || z(a, b);
- return b
- }
- function z(a, b) {
- var c = a.aoData[b], d;
- if (c.nTr === null) {
- c.nTr = p.createElement("tr");
- typeof c._aData.DT_RowId != "undefined" && c.nTr.setAttribute("id", c._aData.DT_RowId);
- typeof c._aData.DT_RowClass != "undefined" && i(c.nTr).addClass(c._aData.DT_RowClass);
- for (var f = 0, e = a.aoColumns.length; f < e; f++) {
- var h = a.aoColumns[f];
- d = p.createElement("td");
- d.innerHTML = typeof h.fnRender == "function" && (!h.bUseRendered || h.mDataProp === null) ? h.fnRender({iDataRow: b,
- iDataColumn: f, aData: c._aData, oSettings: a}) : G(a, b, f, "display");
- if (h.sClass !== null)d.className = h.sClass;
- if (h.bVisible) {
- c.nTr.appendChild(d);
- c._anHidden[f] = null
- } else c._anHidden[f] = d
- }
- }
- }
- function $(a) {
- var b, c, d, f, e, h, j, k, m;
- if (a.bDeferLoading || a.sAjaxSource === null) {
- j = a.nTBody.childNodes;
- b = 0;
- for (c = j.length; b < c; b++)if (j[b].nodeName.toUpperCase() == "TR") {
- k = a.aoData.length;
- a.aoData.push({nTr: j[b], _iId: a.iNextId++, _aData: [], _anHidden: [], _sRowStripe: ""});
- a.aiDisplayMaster.push(k);
- h = j[b].childNodes;
- d = e = 0;
- for (f =
- h.length; d < f; d++) {
- m = h[d].nodeName.toUpperCase();
- if (m == "TD" || m == "TH") {
- O(a, k, e, i.trim(h[d].innerHTML));
- e++
- }
- }
- }
- }
- j = ba(a);
- h = [];
- b = 0;
- for (c = j.length; b < c; b++) {
- d = 0;
- for (f = j[b].childNodes.length; d < f; d++) {
- e = j[b].childNodes[d];
- m = e.nodeName.toUpperCase();
- if (m == "TD" || m == "TH")h.push(e)
- }
- }
- h.length != j.length * a.aoColumns.length && J(a, 1, "Unexpected number of TD elements. Expected " + j.length * a.aoColumns.length + " and got " + h.length + ". DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.");
- d = 0;
- for (f = a.aoColumns.length; d < f; d++) {
- if (a.aoColumns[d].sTitle === null)a.aoColumns[d].sTitle = a.aoColumns[d].nTh.innerHTML;
- j = a.aoColumns[d]._bAutoType;
- m = typeof a.aoColumns[d].fnRender == "function";
- e = a.aoColumns[d].sClass !== null;
- k = a.aoColumns[d].bVisible;
- var u, r;
- if (j || m || e || !k) {
- b = 0;
- for (c = a.aoData.length; b < c; b++) {
- u = h[b * f + d];
- if (j && a.aoColumns[d].sType != "string") {
- r = G(a, b, d, "type");
- if (r !== "") {
- r = ia(r);
- if (a.aoColumns[d].sType === null)a.aoColumns[d].sType = r; else if (a.aoColumns[d].sType != r && a.aoColumns[d].sType !=
- "html")a.aoColumns[d].sType = "string"
- }
- }
- if (m) {
- r = a.aoColumns[d].fnRender({iDataRow: b, iDataColumn: d, aData: a.aoData[b]._aData, oSettings: a});
- u.innerHTML = r;
- a.aoColumns[d].bUseRendered && O(a, b, d, r)
- }
- if (e)u.className += " " + a.aoColumns[d].sClass;
- if (k)a.aoData[b]._anHidden[d] = null; else {
- a.aoData[b]._anHidden[d] = u;
- u.parentNode.removeChild(u)
- }
- }
- }
- }
- }
- function X(a) {
- var b, c, d;
- a.nTHead.getElementsByTagName("tr");
- if (a.nTHead.getElementsByTagName("th").length !== 0) {
- b = 0;
- for (d = a.aoColumns.length; b < d; b++) {
- c = a.aoColumns[b].nTh;
- a.aoColumns[b].sClass !== null && i(c).addClass(a.aoColumns[b].sClass);
- if (a.aoColumns[b].sTitle != c.innerHTML)c.innerHTML = a.aoColumns[b].sTitle
- }
- } else {
- var f = p.createElement("tr");
- b = 0;
- for (d = a.aoColumns.length; b < d; b++) {
- c = a.aoColumns[b].nTh;
- c.innerHTML = a.aoColumns[b].sTitle;
- a.aoColumns[b].sClass !== null && i(c).addClass(a.aoColumns[b].sClass);
- f.appendChild(c)
- }
- i(a.nTHead).html("")[0].appendChild(f);
- Y(a.aoHeader, a.nTHead)
- }
- if (a.bJUI) {
- b = 0;
- for (d = a.aoColumns.length; b < d; b++) {
- c = a.aoColumns[b].nTh;
- f = p.createElement("div");
- f.className = a.oClasses.sSortJUIWrapper;
- i(c).contents().appendTo(f);
- var e = p.createElement("span");
- e.className = a.oClasses.sSortIcon;
- f.appendChild(e);
- c.appendChild(f)
- }
- }
- d = function () {
- this.onselectstart = function () {
- return false
- };
- return false
- };
- if (a.oFeatures.bSort)for (b = 0; b < a.aoColumns.length; b++)if (a.aoColumns[b].bSortable !== false) {
- ja(a, a.aoColumns[b].nTh, b);
- i(a.aoColumns[b].nTh).bind("mousedown.DT", d)
- } else i(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);
- a.oClasses.sFooterTH !== "" && i(a.nTFoot).children("tr").children("th").addClass(a.oClasses.sFooterTH);
- if (a.nTFoot !== null) {
- c = S(a, null, a.aoFooter);
- b = 0;
- for (d = a.aoColumns.length; b < d; b++)if (typeof c[b] != "undefined")a.aoColumns[b].nTf = c[b]
- }
- }
- function M(a, b, c) {
- var d, f, e, h = [], j = [], k = a.aoColumns.length;
- if (typeof c == "undefined")c = false;
- d = 0;
- for (f = b.length; d < f; d++) {
- h[d] = b[d].slice();
- h[d].nTr = b[d].nTr;
- for (e = k - 1; e >= 0; e--)!a.aoColumns[e].bVisible && !c && h[d].splice(e, 1);
- j.push([])
- }
- d = 0;
- for (f = h.length; d < f; d++) {
- if (h[d].nTr) {
- a = 0;
- for (e = h[d].nTr.childNodes.length; a < e; a++)h[d].nTr.removeChild(h[d].nTr.childNodes[0])
- }
- e = 0;
- for (b = h[d].length; e < b; e++) {
- k = c = 1;
- if (typeof j[d][e] == "undefined") {
- h[d].nTr.appendChild(h[d][e].cell);
- for (j[d][e] = 1; typeof h[d + c] != "undefined" && h[d][e].cell == h[d + c][e].cell;) {
- j[d + c][e] = 1;
- c++
- }
- for (; typeof h[d][e + k] != "undefined" && h[d][e].cell == h[d][e + k].cell;) {
- for (a = 0; a < c; a++)j[d + a][e + k] = 1;
- k++
- }
- h[d][e].cell.rowSpan = c;
- h[d][e].cell.colSpan = k
- }
- }
- }
- }
- function C(a) {
- var b, c, d = [], f = 0, e = false;
- b = a.asStripeClasses.length;
- c = a.aoOpenRows.length;
- if (!(a.fnPreDrawCallback !== null && a.fnPreDrawCallback.call(a.oInstance, a) ===
- false)) {
- a.bDrawing = true;
- if (typeof a.iInitDisplayStart != "undefined" && a.iInitDisplayStart != -1) {
- a._iDisplayStart = a.oFeatures.bServerSide ? a.iInitDisplayStart : a.iInitDisplayStart >= a.fnRecordsDisplay() ? 0 : a.iInitDisplayStart;
- a.iInitDisplayStart = -1;
- E(a)
- }
- if (a.bDeferLoading) {
- a.bDeferLoading = false;
- a.iDraw++
- } else if (a.oFeatures.bServerSide) {
- if (!a.bDestroying && !Ca(a))return
- } else a.iDraw++;
- if (a.aiDisplay.length !== 0) {
- var h = a._iDisplayStart, j = a._iDisplayEnd;
- if (a.oFeatures.bServerSide) {
- h = 0;
- j = a.aoData.length
- }
- for (h =
- h; h < j; h++) {
- var k = a.aoData[a.aiDisplay[h]];
- k.nTr === null && z(a, a.aiDisplay[h]);
- var m = k.nTr;
- if (b !== 0) {
- var u = a.asStripeClasses[f % b];
- if (k._sRowStripe != u) {
- i(m).removeClass(k._sRowStripe).addClass(u);
- k._sRowStripe = u
- }
- }
- if (typeof a.fnRowCallback == "function") {
- m = a.fnRowCallback.call(a.oInstance, m, a.aoData[a.aiDisplay[h]]._aData, f, h);
- if (!m && !e) {
- J(a, 0, "A node was not returned by fnRowCallback");
- e = true
- }
- }
- d.push(m);
- f++;
- if (c !== 0)for (k = 0; k < c; k++)m == a.aoOpenRows[k].nParent && d.push(a.aoOpenRows[k].nTr)
- }
- } else {
- d[0] = p.createElement("tr");
- if (typeof a.asStripeClasses[0] != "undefined")d[0].className = a.asStripeClasses[0];
- e = a.oLanguage.sZeroRecords.replace("_MAX_", a.fnFormatNumber(a.fnRecordsTotal()));
- if (a.iDraw == 1 && a.sAjaxSource !== null && !a.oFeatures.bServerSide)e = a.oLanguage.sLoadingRecords; else if (typeof a.oLanguage.sEmptyTable != "undefined" && a.fnRecordsTotal() === 0)e = a.oLanguage.sEmptyTable;
- b = p.createElement("td");
- b.setAttribute("valign", "top");
- b.colSpan = Z(a);
- b.className = a.oClasses.sRowEmpty;
- b.innerHTML = e;
- d[f].appendChild(b)
- }
- typeof a.fnHeaderCallback ==
- "function" && a.fnHeaderCallback.call(a.oInstance, i(a.nTHead).children("tr")[0], ca(a), a._iDisplayStart, a.fnDisplayEnd(), a.aiDisplay);
- typeof a.fnFooterCallback == "function" && a.fnFooterCallback.call(a.oInstance, i(a.nTFoot).children("tr")[0], ca(a), a._iDisplayStart, a.fnDisplayEnd(), a.aiDisplay);
- f = p.createDocumentFragment();
- b = p.createDocumentFragment();
- if (a.nTBody) {
- e = a.nTBody.parentNode;
- b.appendChild(a.nTBody);
- if (!a.oScroll.bInfinite || !a._bInitComplete || a.bSorted || a.bFiltered) {
- c = a.nTBody.childNodes;
- for (b =
- c.length - 1; b >= 0; b--)c[b].parentNode.removeChild(c[b])
- }
- b = 0;
- for (c = d.length; b < c; b++)f.appendChild(d[b]);
- a.nTBody.appendChild(f);
- e !== null && e.appendChild(a.nTBody)
- }
- for (b = a.aoDrawCallback.length - 1; b >= 0; b--)a.aoDrawCallback[b].fn.call(a.oInstance, a);
- i(a.oInstance).trigger("draw", a);
- a.bSorted = false;
- a.bFiltered = false;
- a.bDrawing = false;
- if (a.oFeatures.bServerSide) {
- K(a, false);
- typeof a._bInitComplete == "undefined" && w(a)
- }
- }
- }
- function da(a) {
- if (a.oFeatures.bSort)R(a, a.oPreviousSearch); else if (a.oFeatures.bFilter)N(a,
- a.oPreviousSearch); else {
- E(a);
- C(a)
- }
- }
- function Ca(a) {
- if (a.bAjaxDataGet) {
- a.iDraw++;
- K(a, true);
- var b = Da(a);
- ha(a, b);
- a.fnServerData.call(a.oInstance, a.sAjaxSource, b, function (c) {
- Ea(a, c)
- }, a);
- return false
- } else return true
- }
- function Da(a) {
- var b = a.aoColumns.length, c = [], d, f;
- c.push({name: "sEcho", value: a.iDraw});
- c.push({name: "iColumns", value: b});
- c.push({name: "sColumns", value: ka(a)});
- c.push({name: "iDisplayStart", value: a._iDisplayStart});
- c.push({name: "iDisplayLength", value: a.oFeatures.bPaginate !== false ? a._iDisplayLength :
- -1});
- for (f = 0; f < b; f++) {
- d = a.aoColumns[f].mDataProp;
- c.push({name: "mDataProp_" + f, value: typeof d == "function" ? "function" : d})
- }
- if (a.oFeatures.bFilter !== false) {
- c.push({name: "sSearch", value: a.oPreviousSearch.sSearch});
- c.push({name: "bRegex", value: a.oPreviousSearch.bRegex});
- for (f = 0; f < b; f++) {
- c.push({name: "sSearch_" + f, value: a.aoPreSearchCols[f].sSearch});
- c.push({name: "bRegex_" + f, value: a.aoPreSearchCols[f].bRegex});
- c.push({name: "bSearchable_" + f, value: a.aoColumns[f].bSearchable})
- }
- }
- if (a.oFeatures.bSort !== false) {
- d =
- a.aaSortingFixed !== null ? a.aaSortingFixed.length : 0;
- var e = a.aaSorting.length;
- c.push({name: "iSortingCols", value: d + e});
- for (f = 0; f < d; f++) {
- c.push({name: "iSortCol_" + f, value: a.aaSortingFixed[f][0]});
- c.push({name: "sSortDir_" + f, value: a.aaSortingFixed[f][1]})
- }
- for (f = 0; f < e; f++) {
- c.push({name: "iSortCol_" + (f + d), value: a.aaSorting[f][0]});
- c.push({name: "sSortDir_" + (f + d), value: a.aaSorting[f][1]})
- }
- for (f = 0; f < b; f++)c.push({name: "bSortable_" + f, value: a.aoColumns[f].bSortable})
- }
- return c
- }
- function ha(a, b) {
- for (var c = 0, d = a.aoServerParams.length; c <
- d; c++)a.aoServerParams[c].fn.call(a.oInstance, b)
- }
- function Ea(a, b) {
- if (typeof b.sEcho != "undefined")if (b.sEcho * 1 < a.iDraw)return; else a.iDraw = b.sEcho * 1;
- if (!a.oScroll.bInfinite || a.oScroll.bInfinite && (a.bSorted || a.bFiltered))la(a);
- a._iRecordsTotal = b.iTotalRecords;
- a._iRecordsDisplay = b.iTotalDisplayRecords;
- var c = ka(a);
- if (c = typeof b.sColumns != "undefined" && c !== "" && b.sColumns != c)var d = Fa(a, b.sColumns);
- b = aa(a.sAjaxDataProp)(b);
- for (var f = 0, e = b.length; f < e; f++)if (c) {
- for (var h = [], j = 0, k = a.aoColumns.length; j < k; j++)h.push(b[f][d[j]]);
- v(a, h)
- } else v(a, b[f]);
- a.aiDisplay = a.aiDisplayMaster.slice();
- a.bAjaxDataGet = false;
- C(a);
- a.bAjaxDataGet = true;
- K(a, false)
- }
- function Aa(a) {
- var b = p.createElement("div");
- a.nTable.parentNode.insertBefore(b, a.nTable);
- a.nTableWrapper = p.createElement("div");
- a.nTableWrapper.className = a.oClasses.sWrapper;
- a.sTableId !== "" && a.nTableWrapper.setAttribute("id", a.sTableId + "_wrapper");
- a.nTableReinsertBefore = a.nTable.nextSibling;
- for (var c = a.nTableWrapper, d = a.sDom.split(""), f, e, h, j, k, m, u, r = 0; r < d.length; r++) {
- e = 0;
- h = d[r];
- if (h ==
- "<") {
- j = p.createElement("div");
- k = d[r + 1];
- if (k == "'" || k == '"') {
- m = "";
- for (u = 2; d[r + u] != k;) {
- m += d[r + u];
- u++
- }
- if (m == "H")m = "fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"; else if (m == "F")m = "fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix";
- if (m.indexOf(".") != -1) {
- k = m.split(".");
- j.setAttribute("id", k[0].substr(1, k[0].length - 1));
- j.className = k[1]
- } else if (m.charAt(0) == "#")j.setAttribute("id", m.substr(1, m.length - 1)); else j.className = m;
- r += u
- }
- c.appendChild(j);
- c = j
- } else if (h == ">")c = c.parentNode; else if (h == "l" && a.oFeatures.bPaginate && a.oFeatures.bLengthChange) {
- f = Ga(a);
- e = 1
- } else if (h == "f" && a.oFeatures.bFilter) {
- f = Ha(a);
- e = 1
- } else if (h == "r" && a.oFeatures.bProcessing) {
- f = Ia(a);
- e = 1
- } else if (h == "t") {
- f = Ja(a);
- e = 1
- } else if (h == "i" && a.oFeatures.bInfo) {
- f = Ka(a);
- e = 1
- } else if (h == "p" && a.oFeatures.bPaginate) {
- f = La(a);
- e = 1
- } else if (n.aoFeatures.length !== 0) {
- j = n.aoFeatures;
- u = 0;
- for (k = j.length; u < k; u++)if (h == j[u].cFeature) {
- if (f = j[u].fnInit(a))e = 1;
- break
- }
- }
- if (e == 1 && f !== null) {
- if (typeof a.aanFeatures[h] !=
- "object")a.aanFeatures[h] = [];
- a.aanFeatures[h].push(f);
- c.appendChild(f)
- }
- }
- b.parentNode.replaceChild(a.nTableWrapper, b)
- }
- function Ja(a) {
- if (a.oScroll.sX === "" && a.oScroll.sY === "")return a.nTable;
- var b = p.createElement("div"), c = p.createElement("div"), d = p.createElement("div"), f = p.createElement("div"), e = p.createElement("div"), h = p.createElement("div"), j = a.nTable.cloneNode(false), k = a.nTable.cloneNode(false), m = a.nTable.getElementsByTagName("thead")[0], u = a.nTable.getElementsByTagName("tfoot").length === 0 ? null : a.nTable.getElementsByTagName("tfoot")[0],
- r = typeof g.bJQueryUI != "undefined" && g.bJQueryUI ? n.oJUIClasses : n.oStdClasses;
- c.appendChild(d);
- e.appendChild(h);
- f.appendChild(a.nTable);
- b.appendChild(c);
- b.appendChild(f);
- d.appendChild(j);
- j.appendChild(m);
- if (u !== null) {
- b.appendChild(e);
- h.appendChild(k);
- k.appendChild(u)
- }
- b.className = r.sScrollWrapper;
- c.className = r.sScrollHead;
- d.className = r.sScrollHeadInner;
- f.className = r.sScrollBody;
- e.className = r.sScrollFoot;
- h.className = r.sScrollFootInner;
- if (a.oScroll.bAutoCss) {
- c.style.overflow = "hidden";
- c.style.position = "relative";
- e.style.overflow = "hidden";
- f.style.overflow = "auto"
- }
- c.style.border = "0";
- c.style.width = "100%";
- e.style.border = "0";
- d.style.width = "150%";
- j.removeAttribute("id");
- j.style.marginLeft = "0";
- a.nTable.style.marginLeft = "0";
- if (u !== null) {
- k.removeAttribute("id");
- k.style.marginLeft = "0"
- }
- d = i(a.nTable).children("caption");
- h = 0;
- for (k = d.length; h < k; h++)j.appendChild(d[h]);
- if (a.oScroll.sX !== "") {
- c.style.width = q(a.oScroll.sX);
- f.style.width = q(a.oScroll.sX);
- if (u !== null)e.style.width = q(a.oScroll.sX);
- i(f).scroll(function () {
- c.scrollLeft =
- this.scrollLeft;
- if (u !== null)e.scrollLeft = this.scrollLeft
- })
- }
- if (a.oScroll.sY !== "")f.style.height = q(a.oScroll.sY);
- a.aoDrawCallback.push({fn: Ma, sName: "scrolling"});
- a.oScroll.bInfinite && i(f).scroll(function () {
- if (!a.bDrawing)if (i(this).scrollTop() + i(this).height() > i(a.nTable).height() - a.oScroll.iLoadGap)if (a.fnDisplayEnd() < a.fnRecordsDisplay()) {
- ma(a, "next");
- E(a);
- C(a)
- }
- });
- a.nScrollHead = c;
- a.nScrollFoot = e;
- return b
- }
- function Ma(a) {
- var b = a.nScrollHead.getElementsByTagName("div")[0], c = b.getElementsByTagName("table")[0],
- d = a.nTable.parentNode, f, e, h, j, k, m, u, r, H = [], L = a.nTFoot !== null ? a.nScrollFoot.getElementsByTagName("div")[0] : null, T = a.nTFoot !== null ? L.getElementsByTagName("table")[0] : null, B = i.browser.msie && i.browser.version <= 7;
- h = a.nTable.getElementsByTagName("thead");
- h.length > 0 && a.nTable.removeChild(h[0]);
- if (a.nTFoot !== null) {
- k = a.nTable.getElementsByTagName("tfoot");
- k.length > 0 && a.nTable.removeChild(k[0])
- }
- h = a.nTHead.cloneNode(true);
- a.nTable.insertBefore(h, a.nTable.childNodes[0]);
- if (a.nTFoot !== null) {
- k = a.nTFoot.cloneNode(true);
- a.nTable.insertBefore(k, a.nTable.childNodes[1])
- }
- if (a.oScroll.sX === "") {
- d.style.width = "100%";
- b.parentNode.style.width = "100%"
- }
- var U = S(a, h);
- f = 0;
- for (e = U.length; f < e; f++) {
- u = Na(a, f);
- U[f].style.width = a.aoColumns[u].sWidth
- }
- a.nTFoot !== null && P(function (I) {
- I.style.width = ""
- }, k.getElementsByTagName("tr"));
- f = i(a.nTable).outerWidth();
- if (a.oScroll.sX === "") {
- a.nTable.style.width = "100%";
- if (B && (d.scrollHeight > d.offsetHeight || i(d).css("overflow-y") == "scroll"))a.nTable.style.width = q(i(a.nTable).outerWidth() - a.oScroll.iBarWidth)
- } else if (a.oScroll.sXInner !==
- "")a.nTable.style.width = q(a.oScroll.sXInner); else if (f == i(d).width() && i(d).height() < i(a.nTable).height()) {
- a.nTable.style.width = q(f - a.oScroll.iBarWidth);
- if (i(a.nTable).outerWidth() > f - a.oScroll.iBarWidth)a.nTable.style.width = q(f)
- } else a.nTable.style.width = q(f);
- f = i(a.nTable).outerWidth();
- e = a.nTHead.getElementsByTagName("tr");
- h = h.getElementsByTagName("tr");
- P(function (I, na) {
- m = I.style;
- m.paddingTop = "0";
- m.paddingBottom = "0";…