PageSourceSearch

https://www.txfannin.org/java/vendors/bootbox.min.js

js txfannin.org collected 2026-10-02 10:42:14 UTC 13,382 bytes, 212 lines download raw bytes

1/**
2 * bootbox.js v4.4.0
3 *
4 * http://bootboxjs.com/license.txt
5 * 
6 * This mined version has be unmined for better reading
7 */
8!function (a, b) {
9    'use strict';
10    "function" == typeof define && define.amd ? define(["jquery"], b) : "object" == typeof exports ? module.exports = b(require("jquery")) : a.bootbox = b(a.jQuery)
11}
12
13(this, function a(b, c) {
14    'use strict';
15    function d(a) {
16        var b = q[o.locale];
17        return b ? b[a] : q.en[a]
18    }
19    
20    function e(a, c, d) {
21        a.stopPropagation(), a.preventDefault();
22        var e = b.isFunction(d) && d.call(c, a) === !1; e || c.modal("hide")
23    }
24    
25    function f(a) {
26        var b, c = 0;
27        for (b in a) c++;
28        return c
29    }
30    
31    function g(a, c) {
32        var d = 0;
33        b.each(a, function (a, b) {
34        c(a, b, d++) })
35    }
36
37    function h(a) {
38        var c, d;
39        if ("object" != typeof a) throw new Error("Please supply an object of options");
40        if (!a.message) throw new Error("Please specify a message");
41        return a = b.extend({}, o, a), a.buttons || (a.buttons = {}), c = a.buttons, d = f(c), g(c, function (a, e, f) {
42        if (b.isFunction(e) && (e = c[a] = {
43        callback: e }), "object" !== b.type(e)) throw new Error("button with key " + a + " must be an object");
44        e.label || (e.label = a), e.className || (e.className = 2 >= d && f === d - 1 ? "btn-primary" : "btn-default") }), a 
45    }
46
47    function i(a, b) {
48        var c = a.length, d = {};
49        if (1 > c || c > 2) throw new Error("Invalid argument length");
50        return 2 === c || "string" == typeof a[0] ? (d[b[0]] = a[0], d[b[1]] = a[1]) : d = a[0], d 
51    }
52
53    function j(a, c, d) {
54        return b.extend(!0, {}, a, i(c, d)) 
55    }
56
57    function k(a, b, c, d) {
58        var e = {
59        className: "bootbox-" + a, buttons: l.apply(null, b) };
60        return m(j(e, d, c), b) 
61    }
62
63    function l() {
64        for (var a = {}, b = 0, c = arguments.length;
65        c > b;
66        b++) {
67        var e = arguments[b], f = e.toLowerCase(), g = e.toUpperCase();
68        a[f] = { label: d(g) } } return a 
69    }
70
71    function m(a, b) {
72        var d = {};
73        return g( b, function (a, b) { d[b] = !0 } ), g( a.buttons, function (a) {
74            if (d[a] === c) throw new Error("button key " + a + " is not allowed (options are " + b.join("\n") + ")") 
75        }), a
76    }
77    var n = {
78        dialog: "<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>", header: "<div class='modal-header'><h4 class='modal-title'></h4></div>", footer: "<div class='modal-footer'></div>", closeButton: "<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;</button>", form: "<form class='bootbox-form'></form>", inputs: {
79        text: "<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />", textarea: "<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>", email: "<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />", select: "<select class='bootbox-input bootbox-input-select form-control'></select>", checkbox: "<div class='checkbox'><label>
79<input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>", date: "<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />", time: "<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />", number: "<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />", password: "<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />" }
80    }, 
81        o = {
82            locale: "en", backdrop: "static", animate: !0, className: null, closeButton: !0, show: !0, container: "body" 
83        }, 
84        p = {};
85        p.alert = function () {
86            var a;
87            if (a = k("alert", ["ok"], ["message", "callback"], arguments), a.callback && !b.isFunction(a.callback)) throw new Error("alert requires callback property to be a function when provided");
88            return a.buttons.ok.callback = a.onEscape = function () {
89            return b.isFunction(a.callback) ? a.callback.call(this) : !0 }, p.dialog(a)
90        },
91        p.confirm = function () {
92            var a;
93            if (a = k("confirm", ["cancel", "confirm"], ["message", "callback"], arguments), a.buttons.cancel.callback = a.onEscape = function () {
94            return a.callback.call(this, !1) }, a.buttons.confirm.callback = function () {
95            return a.callback.call(this, !0) }, !b.isFunction(a.callback)) throw new Error("confirm requires a callback");
96            return p.dialog(a)
97        },
98        p.prompt = function () {
99            var a, d, e, f, h, i, k;
100            if (f = b(n.form), d = {
101            className: "bootbox-prompt", buttons: l("cancel", "confirm"), value: "", inputType: "text" }, a = m(j(d, arguments, ["title", "callback"]), ["cancel", "confirm"]), i = a.show === c ? !0 : a.show, a.message = f, a.buttons.cancel.callback = a.onEscape = function () {
102            return a.callback.call(this, null) }, a.buttons.confirm.callback = function () {
103            var c;
104            switch (a.inputType) {
105            case "text": case "textarea": case "email": case "select": case "date": case "time": case "number": case "password": c = h.val();
106            break;
107            case "checkbox": var d = h.find("input:checked");
108            c = [], g(d, function (a, d) {
109            c.push(b(d).val()) }) }return a.callback.call(this, c) }, a.show = !1, !a.title) throw new Error("prompt requires a title");
110            if (!b.isFunction(a.callback)) throw new Error("prompt requires a callback");
111            if (!n.inputs[a.inputType]) throw new Error("invalid prompt type");
112            switch (h = b(n.inputs[a.inputType]), a.inputType) {
113            case "text": case "textarea": case "email": case "date": case "time": case "number": case "password": h.val(a.value);
114            break;
115            case "select": var o = {};
116            if (k = a.inputOptions || [], !b.isArray(k)) throw new Error("Please pass an array of input options");
117            if (!k.length) throw new Error("prompt with select requires options");
118            g(k, function (a, d) {
119            var e = h;
120            if (d.value === c || d.text === c) throw new Error("given options in wrong format");
121            d.group && (o[d.group] || (o[d.group] = b("<optgroup/>").attr("label", d.group)), e = o[d.group]), e.append("<option value='" + d.value + "'>" + d.text + "</option>") }), g(o, function (a, b) {
122            h.append(b) }), h.val(a.value);
123            break;
124            case "checkbox": var q = b.isArray(a.value) ? a.value : [a.value];
125            if (k = a.inputOptions || [], !k.length) throw new Error("prompt with checkbox requires options");
126            if (!k[0].value || !k[0].text) throw new Error("given options in wrong format");
127            h = b("<div/>"), g(k, function (c, d) {
128            var e = b(n.inputs[a.inputType]);
129            e.find("input").attr("value", d.value), e.find("label").append(d.text), g(q, function (a, b) {
130            b === d.value && e.find("input").prop("checked", !0) }), h.append(e) }) }return a.placeholder && h.attr("placeholder", a.placeholder), a.pattern && h.attr("pattern", a.pattern), a.maxlength && h.attr("maxlength", a.maxlength), f.append(h), f.on("submit", function (a) {
131            a.preventDefault(), a.stopPropagation(), e.find(".btn-primary").click() }), e = p.dialog(a), e.off("shown.bs.modal"), e.on("shown.bs.modal", function () {
132            h.focus() }), i === !0 && e.modal("show"), e
133        },
134        p.dialog = function (a) {
135            a = h(a);
136            var d = b(n.dialog), f = d.find(".modal-dialog"), i = d.find(".modal-body"), j = a.buttons, k = "", l = { onEscape: a.onEscape };
137            if (b.fn.modal === c) throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");
138            if (g(j, function (a, b) {
139                k += "<button data-bb-handler='" + a + "' type='button' class='btn " + b.className + "'>" + b.label + "</button>", l[a] = b.callback 
140            }),
141            i.find(".bootbox-body").html(a.message), a.animate === !0 && d.addClass("fade"), a.className && d.addClass(a.className), "large" === a.size 
142                ? f.addClass("modal-lg")
143                : "small" === a.size && f.addClass("modal-sm"), a.title && i.before(n.header), a.closeButton)
144            {
145            var m = b(n.closeButton);
146            a.title ? d.find(".modal-header").prepend(m) : m.css("margin-top", "-10px").prependTo(i) } return a.title && d.find(".modal-title").html(a.title), k.length && (i.after(n.footer), d.find(".modal-footer").html(k)), d.on("hidden.bs.modal", function (a) {
147            a.target === this && d.remove() }), d.on("shown.bs.modal", function () {
148            d.find(".btn-primary:first").focus() }), "static" !== a.backdrop && d.on("click.dismiss.bs.modal", function (a) {
149            d.children(".modal-backdrop").length && (a.currentTarget = d.children(".modal-backdrop").get(0)), a.target === a.currentTarget && d.trigger("escape.close.bb") }), d.on("escape.close.bb", function (a) {
150            l.onEscape && e(a, d, l.onEscape) }), d.on("click", ".modal-footer button", function (a) {
151            var c = b(this).data("bb-handler");
152            e(a, d, l[c]) }), d.on("click", ".bootbox-close-button", function (a) {
153            e(a, d, l.onEscape) }), d.on("keyup", function (a) {
154            27 === a.which && d.trigger("escape.close.bb") }), b(a.container).append(d), d.modal({
155            backdrop: a.backdrop ? "static" : !1, keyboard: !1, show: !1 }), a.show && d.modal("show"), d
156        },
157        p.setDefaults = function () {
158            var a = {};
159                2 === arguments.length ? a[arguments[0]] = arguments[1] : a = arguments[0], b.extend(o, a)
160        }, p.hideAll = function () {
161            return b(".bootbox").modal("hide"), p
162        };
163            var q = {
164            bg_BG: {
165            OK: "Ок", CANCEL: "Отказ", CONFIRM: "Потвърждавам" }, br: {
166            OK: "OK", CANCEL: "Cancelar", CONFIRM: "Sim" }, cs: {
167            OK: "OK", CANCEL: "Zrušit", CONFIRM: "Potvrdit" }, da: {
168            OK: "OK", CANCEL: "Annuller", CONFIRM: "Accepter" }, de: {
169            OK: "OK", CANCEL: "Abbrechen", CONFIRM: "Akzeptieren" }, el: {
170            OK: "Εντάξει", CANCEL: "Ακύρωση", CONFIRM: "Επιβεβαίωση" }, en: {
171            OK: "OK", CANCEL: "Cancel", CONFIRM: "OK" }, es: {
172            OK: "OK", CANCEL: "Cancelar", CONFIRM: "Aceptar" }, et: {
173            OK: "OK", CANCEL: "Katkesta", CONFIRM: "OK" }, fa: {
174            OK: "قبول", CANCEL: "لغو", CONFIRM: "تایید" }, fi: {
175            OK: "OK", CANCEL: "Peruuta", CONFIRM: "OK" }, fr: {
176            OK: "OK", CANCEL: "Annuler", CONFIRM: "D'accord" }, he: {
177            OK: "אישור", CANCEL: "ביטול", CONFIRM: "אישור" }, hu: {
178            OK: "OK", CANCEL: "Mégsem", CONFIRM: "Megerősít" }, hr: {
179            OK: "OK", CANCEL: "Odustani", CONFIRM: "Potvrdi" }, id: {
180            OK: "OK", CANCEL: "Batal", CONFIRM: "OK" }, it: {
181            OK: "OK", CANCEL: "Annulla", CONFIRM: "Conferma" }, ja: {
182            OK: "OK", CANCEL: "キャンセル", CONFIRM: "確認" }, lt: {
183            OK: "Gerai", CANCEL: "Atšaukti", CONFIRM: "Patvirtinti" }, lv: {
184            OK: "Labi", CANCEL: "Atcelt", CONFIRM: "Apstiprināt" }, nl: {
185            OK: "OK", CANCEL: "Annuleren", CONFIRM: "Accepteren" }, no: {
186            OK: "OK", CANCEL: "Avbryt", CONFIRM: "OK" }, pl: {
187            OK: "OK", CANCEL: "Anuluj", CONFIRM: "Potwierdź" }, pt: {
188            OK: "OK", CANCEL: "Cancelar", CONFIRM: "Confirmar" }, ru: {
189            OK: "OK", CANCEL: "Отмена", CONFIRM: "Применить" }, sq: {
190            OK: "OK", CANCEL: "Anulo", CONFIRM: "Prano" }, sv: {
191            OK: "OK", CANCEL: "Avbryt", CONFIRM: "OK" }, th: {
192            OK: "ตกลง", CANCEL: "ยกเลิก", CONFIRM: "ยืนยัน" }, tr: {
193            OK: "Tamam", CANCEL: "İptal", CONFIRM: "Onayla" }, zh_CN: {
194            OK: "OK", CANCEL: "取消", CONFIRM: "确认" }, zh_TW: {
195            OK: "OK", CANCEL: "取消", CONFIRM: "確認" }
196        };
197    return p.addLocale = function (a, c) {
198        return b.each(["OK", "CANCEL", "CONFIRM"], function (a, b) {
199        if (!c[b]) throw new Error("Please supply a translation for '" + b + "'") }), q[a] = {
200        OK: c.OK, CANCEL: c.CANCEL, CONFIRM: c.CONFIRM }, p
201    },
202    p.removeLocale = function (a) {
203        return delete q[a], p
204    },
205    p.setLocale = function (a) {
206        return p.setDefaults("locale", a)
207    },
208    p.init = function (c) {
209        return a(c || b)
210    },
211    p
212});

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.