You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
35 KiB

  1. (function ($) { var browser = $.browser; if (!browser) { function uaMatch(e) { e = e.toLowerCase(); var t = /(chrome)[ \/]([\w.]+)/.exec(e) || /(webkit)[ \/]([\w.]+)/.exec(e) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e) || /(msie) ([\w.]+)/.exec(e) || e.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e) || []; return { browser: t[1] || "", version: t[2] || "0" } } var matched = uaMatch(navigator.userAgent); browser = {}; if (matched.browser) { browser[matched.browser] = true; browser.version = matched.version } if (browser.chrome) { browser.webkit = true } else if (browser.webkit) { browser.safari = true } } if (typeof $.support.selectstart != "function") { $.support.selectstart = "onselectstart" in document.createElement("div") } if (typeof $.fn.disableSelection != "function") { $.fn.disableSelection = function () { return this.bind(($.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (e) { e.preventDefault() }) } } $.addFlex = function (t, p) { if (t.grid) return false; p = $.extend({ height: 200, width: "auto", striped: true, novstripe: false, minwidth: 30, minheight: 80, resizable: true, url: false, method: "POST", dataType: "xml", errormsg: "Connection Error", usepager: false, nowrap: true, page: 1, total: 1, useRp: true, rp: 15, rpOptions: [10, 20, 30, 50, 100], title: false, idProperty: "id", pagestat: "Displaying {from} to {to} of {total} items", pagetext: "Page", outof: "of", findtext: "Find", params: [], procmsg: "Processing, please wait ...", query: "", qtype: "", nomsg: "No items", minColToggle: 1, showToggleBtn: true, hideOnSubmit: true, autoload: true, blockOpacity: .5, preProcess: false, addTitleToCell: false, dblClickResize: false, onDragCol: false, onToggleCol: false, onChangeSort: false, onDoubleClick: false, onSuccess: false, onError: false, onSubmit: false, __mw: { datacol: function (e, t, n) { var r = typeof e.datacol[t] == "function" ? e.datacol[t](n) : n; if (typeof e.datacol["*"] == "function") { return e.datacol["*"](r) } else { return r } } }, getGridClass: function (e) { return e }, datacol: {}, colResize: true, colMove: true }, p); $(t).show().attr({ cellPadding: 0, cellSpacing: 0, border: 0 }).removeAttr("width"); var g = { hset: {}, rePosDrag: function () { var e = 0 - this.hDiv.scrollLeft; if (this.hDiv.scrollLeft > 0) e -= Math.floor(p.cgwidth / 2); $(g.cDrag).css({ top: g.hDiv.offsetTop + 1 }); var t = this.cdpad; var n = 0; $("div", g.cDrag).hide(); $("thead tr:first th:visible", this.hDiv).each(function () { var r = $("thead tr:first th:visible", g.hDiv).index(this); var i = parseInt($("div", this).width()); if (e == 0) e -= Math.floor(p.cgwidth / 2); i = i + e + t; if (isNaN(i)) { i = 0 } $("div:eq(" + r + ")", g.cDrag).css({ left: (!browser.mozilla ? i - n : i) + "px" }).show(); e = i; n++ }) }, fixHeight: function (e) { e = false; if (!e) e = $(g.bDiv).height(); var t = $(this.hDiv).height(); $("div", this.cDrag).each(function () { $(this).height(e + t) }); var n = parseInt($(g.nDiv).height(), 10); if (n > e) $(g.nDiv).height(e).width(200); else $(g.nDiv).height("auto").width("auto"); $(g.block).css({ height: e, marginBottom: e * -1 }); var r = g.bDiv.offsetTop + e; if (p.height != "auto" && p.resizable) r = g.vDiv.offsetTop; $(g.rDiv).css({ height: r }) }, dragStart: function (e, t, n) { if (e == "colresize" && p.colResize === true) { $(g.nDiv).hide(); $(g.nBtn).hide(); var r = $("div", this.cDrag).index(n); var i = $("th:visible div:eq(" + r + ")", this.hDiv).width(); $(n).addClass("dragging").siblings().hide(); $(n).prev().addClass("dragging").show(); this.colresize = { startX: t.pageX, ol: parseInt(n.style.left, 10), ow: i, n: r }; $("body").css("cursor", "col-resize") } else if (e == "vresize") { var s = false; $("body").css("cursor", "row-resize"); if (n) { s = true; $("body").css("cursor", "col-resize") } this.vresize = { h: p.height, sy: t.pageY, w: p.width, sx: t.pageX, hgo: s } } else if (e == "colMove") { $(t.target).disableSelection(); if (p.colMove === true) { $(g.nDiv).hide(); $(g.nBtn).hide(); this.hset = $(this