PageSourceSearch

https://www.forpumps.com.au/javascript/jquery/plugins/imodal/imodal.js?

js forpumps.com.au collected 2026-10-10 01:47:26 UTC 9,436 bytes, 156 lines download raw bytes

1function ModalBox(o, t) {
2    var i = '<div class="ModalTitle">' + o + '</div><div class="ModalContent">' + t + '</div><div class="ModalButtonRow"></div>';
3    $.iModal({data: i})
4}
5
6function ModalBoxInline(o, t, i, n) {
7    if ("undefined" == typeof i) var i = 800;
8    if ("undefined" == typeof n) var n = !1;
9    if (n) var e = '<div class="ModalTitle">' + o + '</div><div class="ModalContent">' + $(t).html() + '</div><div class="ModalButtonRow"></div>'; else var e = '<div class="ModalTitle">' + o + '</div><div class="ModalContent">' + $(t).html() + '</div><div class="ModalButtonRow"><input type="button" class="CloseButton FormButton" value="Close Window" onclick="$.iModal.close();" /></div>';
10    $.iModal({data: e, width: i})
11}
12
13!function (o) {
14    o.iModal = function (t) {
15        return o.iModal.modal.init(t)
16    }, o.modal = function () {
17    }, o.modal.close = function () {
18        return o.iModal.modal.close(!0)
19    }, o.iModal.close = function () {
20        return o.iModal.modal.close(!0)
21    }, o.fn.iModal = function (t) {
22        return t = o.extend({}, {type: "inline", inline: o(this).html()}, t), o.iModal.modal.init(t)
23    }, o.iModal.defaults = {
24        overlay: 40,
25        overlayCss: {},
26        containerCss: {},
27        close: !0,
28        closeTitle: "Close",
29        closeTxt: !1,
30        onOpen: null,
31        onShow: null,
32        onClose: null,
33        onBeforeClose: null,
34        onAjaxError: null,
35        type: "string",
36        width: "630",
37        height: "auto",
38        buttons: "",
39        title: "",
40        method: "get",
41        top: "15%",
42        scrollable: !0
43    }, o.iModal.modal = {
44        options: null, init: function (t) {
45            return o("#ModalContentContainer").length > 0 ? this : (this.options = o.extend({}, o.iModal.defaults, t), "inline" == this.options.type && (this.options.data = o(this.options.inline).html(), o(this.options.inline).html("")), this.generateModal(), this)
46        }, checkHeight: function () {
47            var t, i, n;
48            setTimeout(function () {
49                if (t = o(window).height(), i = o("#ModalContentContainer").height(), n = o("#ModalContent").height() || o.iModal.modal.options.contentHeight, i > .85 * t || o.iModal.modal.options.scrollable && .85 * t < o.iModal.modal.options.height) {
50                    var e = i - n;
51                    o("#ModalContent").css({
52                        overflow: "auto",
53                        height: .75 * (i - e) + "px"
54                    }), o("#ModalContainer").css({
55                        height: .8 * t + "px",
56                        bottom: 0,
57                        "overflow-y": "scroll"
58                    }), o(".ModalButtonRow").css("padding-right", "30px")
59                }
60            }, 1)
61        }, ajaxError: function (t, i, n) {
62            this.hideLoader(), o.isFunction(this.options.onAjaxError) && this.options.onAjaxError.apply(this, [t, i, n])
63        }, createFrame: function (t, i) {
64            var n = o("<iframe />").width("100%").attr("frameBorder", "0").appendTo(t)[0],
65                e = n.contentWindow ? n.contentWindow.document : n.contentDocument;
66            e.open(), e.write(i), e.close(), o(e).ready(function () {
67                var t = e.body.scrollHeight + 20;
68                o(n).height(t)
69            })
70        }, displayModal: function (t) {
71            "object" == typeof t && "string" == typeof t.imodal && (t = t.imodal), this.hideLoader(), modalContent = "", (modalContent = '<div id="ModalTopLeftCorner"></div><div id="ModalTopBorder"></div><div id="ModalTopRightCorner"></div><div id="ModalLeftBorder"></div><div id="ModalRightBorder"></div><div id="ModalBottomLeftCorner"></div><div id="ModalBottomRightCorner"></div><div id="ModalBottomBorder"></div>'), t.indexOf("ModalTitle") > 0 && t.indexOf("ModalContent") > 0 ? modalContent += '<div id="ModalContentContainer">' + t + "</div>" : (buttons = "", this.options.buttons && (buttons = '<div class="ModalButtonRow">' + this.options.buttons + "</div>"), modalContent += '<div id="ModalContentContainer"><div class="ModalTitle">' + this.options.title + '</div><div class="ModalContent">' + t + "</div>" + buttons + "</div>"), cssProperties = {
72                position: "fixed",
73                zIndex: 3100,
74                width: this.options.width + "px",
75                height: this.options.height + "px"
76            }, cssProperties.marginLeft = "-" + this.options.width / 2 + "px", cssProperties.top = this.options.top;
77            var i = o("<div>").attr("id", "ModalContainer").addClass("modalContainer").css(cssProperties).hide().appendTo("body").html('<div class="modalData">' + modalContent + "</div>");
78            if (this.options.className && i.addClass(this.options.className), o("#ModalContainer").find(".ModalButtonRow, #ModalButtonRow").length > 0 && o("#ModalContainer").addClass("ModalContentWithButtons"), this.options.close && (modal = this, o("<a/>").addClass("modalClose").attr("title", this.options.closeTitle).appendTo("#ModalContainer").click(function (o) {
79                o.preventDefault(), modal.close()
80            }), o(document).bind("keypress", function (t) {
81                27 == t.keyCode && o("#ModalContainer .modalClose").click()
82            }), this.options.closeTxt && (o("#ModalContainer .modalClose").html(this.options.closeTitle).css("backgroundPosition", "65px 0").css("lineHeight", "15px").css("textDecoration", "none").css("width", "60px").css("paddingRight", "20px").css("textAlign", "right"), o("#ModalContainer .ModalTitle").css("borderBottom", "medium none").css("backgroundColor", "#fff"), o("#ModalContainer #ModalTopBorder").css("backgroundImage", "none"))), o.isFunction(this.options.onOpen) ? this.options.onOpen.apply(this) : (o("#ModalContainer").show(), o.isFunction(this.options.onShow) && this.options.onShow.apply(this)), this.options.scrollable) {
83                var n = o("#ModalContent");
84                n.css("overflow", "auto"), o(".ModalButtonRow").css("padding-top", "10px"), this.checkHeight()
85            }
86            o(window).resize(this.checkHeight).scroll(this.checkHeight)
87        }, showLoader: function () {
88            o("<div/>").attr("id", "ModalLoadingIndicator").appendTo("body")
89        }, showOverlayLoader: function () {
90            o("<div/>").attr("id", "ModalOverlay").addClass("modalOverlay").css({
91                opacity: .4,
92                height: "100%",
93                width: "100%",
94                position: "fixed",
95                left: 0,
96                top: 0,
97                zIndex: 3e3
98            }).appendTo("body"), o("<div/>").attr("id", "ModalLoadingIndicator").appendTo("body")
99        }, hideOverlayLoader: function () {
100            o("#ModalLoadingIndicator").remove(), o(".modalOverlay").remove()
101        }, hideLoader: function () {
102            o("#ModalLoadingIndicator").remove()
103        }, generateModal: function () {
104            if (o("<div/>").attr("id", "ModalOverlay").addClass("modalOverlay").css({
105                opacity: this.options.overlay / 100,
106                height: "100%",
107                width: "100%",
108                position: "fixed",
109                left: 0,
110                top: 0,
111                zIndex: 3e3
112            }).appendTo("body"), this.showLoader(), "ajax" == this.options.type) {
113                modal = this, data = {}, void 0 != this.options.urlData && (data = this.options.urlData);
114                var t = "get";
115                this.options.method && (t = this.options.method), o.aja
115x({
116                    url: this.options.url,
117                    type: t,
118                    success: function (o) {
119                        modal.displayModal(o)
120                    },
121                    error: function (o, t, i) {
122                        modal.ajaxError(o, t, i)
123                    },
124                    data: data,
125                    type: this.options.method,
126                    global: !1
127                })
128            } else if ("iframe" == this.options.type) {
129                modal = this, data = {}, void 0 != this.options.urlData && (data = this.options.urlData);
130                var t = "get";
131                this.options.method && (t = this.options.method), o.ajax({
132                    url: this.options.url,
133                    type: t,
134                    success: function (t) {
135                        modal.displayModal("");
136                        modal.createFrame(o("#ModalContentContainer .ModalContent"), t)
137                    },
138                    error: function (o, t, i) {
139                        modal.ajaxError(o, t, i)
140                    },
141                    data: data,
142                    type: this.options.method,
143                    global: !1
144                })
145            } else this.displayModal(this.options.data)
146        }, close: function (t) {
147            if (this.options) {
148                if (o.isFunction(this.options.onBeforeClose)) {
149                    if (this.options.onBeforeClose.apply(this, []) === !1) return;
150                    this.options.onBeforeClose = null
151                }
152                "inline" == this.options.type && o(this.options.inline).html(this.options.data), o.isFunction(this.options.onClose) && !t ? this.options.onClose.apply(this) : o("#ModalContainer").remove(), o("#ModalLoadingIndicator").remove(), o("#ModalOverlay").remove(), o("#ModalTempiFrame").remove()
153            }
154        }
155    }
156}(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.