PageSourceSearch

https://www.pcbgogo.jp/img/js/diy-pop-animate/jquery.poptrox.min.js

js pcbgogo.jp collected 2026-09-26 13:36:50 UTC 14,460 bytes, 240 lines download raw bytes

1/* jquery.poptrox.js v2.5.1 | (c) n33 | n33.co | MIT licensed */
2!function (e) {
3	e.fn.poptrox_disableSelection = function () {
4		return e(this).css("user-select", "none").css("-khtml-user-select", "none").css("-moz-user-select", "none").css("-o-user-select", "none").css("-webkit-user-select", "none")
5	}, e.fn.poptrox = function (o) {
6		function t () {
7			p = e(window).width(), s = e(window).height() + r.windowHeightPad;
8			var o = Math.abs(x.width() - x.outerWidth()), t = Math.abs(x.height() - x.outerHeight()),
9				i = (w.width(), w.height(), p - 2 * r.windowMargin - o), n = s - 2 * r.windowMargin - t;
10			x.css("min-width", r.popupWidth).css("min-height", r.popupHeight), v.children().css("max-width", i).css("max-height", n)
11		}
12
13		if (0 == this.length) return e(this);
14		if (this.length > 1) {
15			for (var i = 0; i < this.length; i++) e(this[i]).poptrox(o);
16			return e(this)
17		}
18		var p, s, r = e.extend({
19				preload: !1,
20				baseZIndex: 1e3,
21				fadeSpeed: 300,
22				overlayColor: "#000000",
23				overlayOpacity: .6,
24				overlayClass: "poptrox-overlay",
25				windowMargin: 50,
26				windowHeightPad: 0,
27				selector: "a",
28				caption: null,
29				parent: "body",
30				popupSpeed: 300,
31				popupWidth: 200,
32				popupHeight: 100,
33				popupIsFixed: !1,
34				useBodyOverflow: !1,
35				usePopupEasyClose: !0,
36				usePopupForceClose: !1,
37				usePopupLoader: !0,
38				usePopupCloser: !0,
39				usePopupCaption: !1,
40				usePopupNav: !1,
41				usePopupDefaultStyling: !0,
42				popupBackgroundColor: "#FFFFFF",
43				popupTextColor: "#000000",
44				popupLoaderTextSize: "2em",
45				popupCloserBackgroundColor: "#000000",
46				popupCloserTextColor: "#FFFFFF",
47				popupCloserTextSize: "20px",
48				popupPadding: 10,
49				popupCaptionHeight: 60,
50				popupCaptionTextSize: null,
51				popupBlankCaptionText: "(untitled)",
52				popupCloserText: "&#215;",
53				popupLoaderText: "&bull;&bull;&bull;&bull;",
54				popupClass: "poptrox-popup",
55				popupSelector: null,
56				popupLoaderSelector: ".loader",
57				popupCloserSelector: ".closer",
58				popupCaptionSelector: ".caption",
59				popupNavPreviousSelector: ".nav-previous",
60				popupNavNextSelector: ".nav-next",
61				onPopupClose: null,
62				onPopupOpen: null
63			}, o), n = e(this), a = e("body"), l = e('<div class="' + r.overlayClass + '"></div>'), u = e(window), d = [],
64			h = 0, g = !1, f = new Array;
65		r.usePopupLoader || (r.popupLoaderSelector = null), r.usePopupCloser || (r.popupCloserSelector = null), r.usePopupCaption || (r.popupCaptionSelector = null), r.usePopupNav || (r.popupNavPreviousSelector = null, r.popupNavNextSelector = null);
66		var x;
67		x = e(r.popupSelector ? r.popupSelector : '<div class="' + r.popupClass + '">' + (r.popupLoaderSelector ? '<div class="loader">' + r.popupLoaderText + "</div>" : "") + '<div class="pic"></div>' + (r.popupCaptionSelector ? '<div class="caption"></div>' : "") + (r.popupCloserSelector ? '<span class="closer">' + r.popupCloserText + "</span>" : "") + (r.popupNavPreviousSelector ? '<div class="nav-previous"></div>' : "") + (r.popupNavNextSelector ? '<div class="nav-next"></div>' : "") + "</div>");
68		var v = x.find(".pic"), w = e(), b = x.find(r.popupLoaderSelector), m = x.find(r.popupCaptionSelector),
69			y = x.find(r.popupCloserSelector), S = x.find(r.popupNavNextSelector), C = x.find(r.popupNavPreviousSelector),
70			P = S.add(C);
71		if (r.usePopupDefaultStyling && (x.css("background", r.popupBackgroundColor).css("color", r.popupTextColor).css("padding", r.popupPadding + "px"), m.length > 0 && (x.css("padding-bottom", r.popupCaptionHeight + "px"), m.css("position", "absolute").css("left", "0").css("bottom", "0").css("width", "100%").css("text-align", "center").css("height", r.popupCaptionHeight + "px").css("line-height", r.popupCaptionHeight + "px"), r.popupCaptionTextSize && m.css("font-size", popupCaptionTextSize)), y.length > 0 && y.html(r.popupCloserText).css("font-size", r.popupCloserTextSize).css("background", r.popupCloserBackgroundColor).css("color", r.popupCloserTextColor).css("display", "block").css("width", "40px").css("height", "40px").css("line-height", "40px").css("text-align", "center").css("position", "absolute").css("text-decoration", "none").css("outline", "0").css("top", "0").css("right", "-40px"), b.length > 0 && b.html("").css("position", "relative").css("font-size", r.popupLoaderTextSize).on("startSpinning", function (o) {
72			var t = e("<div>" + r.popupLoaderText + "</div>");
73			t.css("height", Math.floor(r.popupHeight / 2) + "px").css("overflow", "hidden").css("line-height", Math.floor(r.popupHeight / 2) + "px").css("text-align", "center").css("margin-top", Math.floor((x.height() - t.height() + (m.length > 0 ? m.height() : 0)) / 2)).css("color", r.popupTextColor ? r.popupTextColor : "").on("xfin", function () {
74				t.fadeTo(300, .5, function () {
75					t.trigger("xfout")
76				})
77			}).on("xfout", function () {
78				t.fadeTo(300, .05, function () {
79					t.trigger("xfin")
80				})
81			}).trigger("xfin"), b.append(t)
82		}).on("stopSpinning", function (e) {
83			var o = b.find("div");
84			o.remove()
85		}), 2 == P.length)) {
86			P.css("font-size", "75px").css("text-align", "center").css("color", "#fff").css("text-shadow", "none").css("height", "100%").css("position", "absolute").css("top", "0").css("opacity", "0.35").css("cursor", "pointer").css("box-shadow", "inset 0px 0px 10px 0px rgba(0,0,0,0)").poptrox_disableSelection();
87			var k, T;
88			r.usePopupEasyClose ? (k = "100px", T = "100px") : (k = "75%", T = "25%"), S.css("right", "0").css("width", k).html('<div style="position: absolute; height: 100px; width: 125px; top: 50%; right: 0; margin-top: -50px;">&gt;</div>'), C.css("left", "0").css("width", T).html('<div style="position: absolute; height: 100px; width: 125px; top: 50%; left: 0; margin-top: -50px;">&lt;</div>')
89		}
90		return u.on("resize orientationchange", function () {
91			t()
92		}), m.on("update", function (e, o) {
93			o && 0 != o.length || (o = r.popupBlankCaptionText), m.html(o)
94		}), y.css("cursor", "pointer").on("click", function (e) {
95			return e.preventDefault(), e.stopPropagation(), x.trigger("poptrox_close"), !0
96		}), S.on("click", function (e) {
97			e.stopPropagation(), e.preventDefault(), x.trigger("poptrox_next")
98		}), C.on("click", function (e) {
99			e.stopPropagation(), e.preventDefault(), x.trigger("poptrox_previous")
100		}), l.css("position", "fixed").css("left", 0).css("top", 0).css("z-index", r.baseZIndex).css("width", "100%").css("height", "100%").css("text-align", "center").css("cursor", "pointer").appendTo(r.parent).prepend('<div style="display:inline-block;height:100%;vertical-align:middle;"></div>').append('<div style="position:absolute;left:0;top:0;width:100%;height:100%;background:' + r.overlayColor + ";opacity:" + r.overlayOpacity + ";filter:alpha(opacity=" + 100 * r.overlayOpacity + ');"></div>').hide().on("touchmove", function (e) {
101			return !1
102		}).on("click", function (e) {
103			e.preventDefault(), e.stopPropagation(), x.trigger("poptrox_close")
104		}), x.css("display", "inline-block").css("vertical-align", "middle").css("position", "relative").css("z-index", 1).css("cursor", "auto").appendTo(l).hide().on("poptrox_next", function () {
105			var e = h + 1;
106			e >= d.length && (e = 0), x.trigger("poptrox_switch", [e])
107		}).on("poptrox_previous", function () {
108			var e = h - 1;
109			0 > e && (e = d.length - 1), x.trigger("poptrox_switch", [e])
110		}).on("poptrox_reset", function () {
111			t(), x.data("width", r.popupWidth).data("height", r.popupHeight), b.hide().trigger("stopSpinning"), m.hide(), y.hide(), P.hide(), v.hide(), w.attr("src", "").detach()
112		}).on("poptrox_open", function (e, o) {
113			return g ? !0 : (g = !0, r.useBodyOverflow && a.css("overflow", "hidden"), r.onPopupOpen && r.onPopupOpen(), void l.fadeTo(r.fadeSpeed, 1, function () {
114				x.trigger("poptrox_switch", [o, !0])
115			}))
116		}).on("poptrox_switch", function (o, i, p) {
117			var s;
118			if (!p && g) return !0;
119			if (g = !0, x.css("width", x.data("width")).css("height", x.data("height")), m.hide(), w.attr("src") && w.attr("src", ""), w.detach(), s = d[i], w = s.object, w.off("load"), v.css("text-indent", "-9999px").show().append(w), "ajax" == s.type ? e.get(s.src, function (e) {
120				w.html(e), w.trigger("load")
121			}) : w.attr("src", s.src), "image" != s.type) {
122				var n, a;
123				n = s.width, a = s.height, "%" == n.slice(-1) && (n = parseInt(n.substring(0, n.length - 1)) / 100 * u.width()), "%" == a.slice(-1) && (a = parseInt(a.substring(0, a.length - 1)) / 100 * u.height()), w.css("position", "relative").css("outline", "0").css("z-index", r.baseZIndex + 100).width(n).height(a)
124			}
125			b.trigger("startSpinning").fadeIn(300), x.show(), r.popupIsFixed ? (x.width(r.popupWidth).height(r.popupHeight), w.load(function () {
126				w.off("load"), b.hide().trigger("stopSpinning"), m.trigger("update", [s.captionText]).fadeIn(r.fadeSpeed), y.fadeIn(r.fadeSpeed), v.css("text-indent", 0).hide().fadeIn(r.fadeSpeed, function () {
127					g = !1
128				}), h = i, P.fadeIn(r.fadeSpeed)
129			})) : w.load(function () {
130				t(), w.off("load"), b.hide().trigger("stopSpinning");
131				var e = w.width(), o = w.height(), p = function () {
132					m.trigger("update", [s.captionText]).fadeIn(r.fadeSpeed), y.fadeIn(r.fadeSpeed), v.css("text-indent", 0).hide().fadeIn(r.fadeSpeed, function () {
133						g = !1
134					}), h = i, P.fadeIn(r.fadeSpeed), x.data("width", e).data("height", o).css("width", "auto").css("height", "auto")
135				};
136				e == x.data("width") && o == x.data("height") ? p() : x.animate({width: e, height: o}, r.popupSpeed, "swing", p)
137			}), "image" != s.type && w.trigger("load")
138		}).on("poptrox_close", function () {
139			return g && !r.usePopupForceClose ? !0 : (g = !0, x.hide().trigger("poptrox_reset"), r.onPopupClose && r.onPopupClose(), void l.fadeOut(r.fadeSpeed, function () {
140				r.useBodyOverflow && a.css("overflow", "auto"), g = !1
141			}))
142		}).trigger("poptrox_reset"), r.usePopupEasyClose ? (m.on("click", "a", function (e) {
143			e.stopPropagation()
144		}), x.css("cursor", "pointer").on("click", function (e) {
145			e.stopPropagation(), e.preventDefault(), x.trigger("poptrox_close")
146		})) : x.on("click", function (e) {
147			e.stopPropagation()
148		}), u.keydown(function (e) {
149			if (x.is(":visible")) switch (e.keyCode) {
150				case 37:
151				case 32:
152					if (r.usePopupNav) return x.trigger("poptrox_previous"), !1;
153					break;
154				case 39:
155					if (r.usePopupNav) return x.trigger("poptrox_next"), !1;
156					break;
157				case 27:
158					return x.trigger("poptrox_close"), !1
159			}
160		}), n.find(r.selector).each(function (o) {
161			var t, i, p = e(this), s = p.find("img"), n = p.data("poptrox");
162			if ("ignore" != n && p.attr("href")) {
163				if (t = {
164					src: p.attr("href"),
165					captionText: s.attr("title"),
166					width: null,
167					height: null,
168					type: null,
169					object: null,
170					options: null
171				}, r.caption) {
172					if ("function" == typeof r.caption) c = r.caption(p); else if ("selector" in r.caption) {
173						var a;
174						a = p.find(r.caption.selector), "attribute" in r.caption ? c = a.attr(r.caption.attribute) : (c = a.html(), r.caption.remove === !0 && a.remove())
175					}
176				} else c = s.attr("title");
177				if (t.captionText = c, n) {
178					var l = n.split(",");
179					0 in l && (t.type = l[0]), 1 in l && (i = l[1].match(/([0-9%]+)x([0-9%]+)/), i && 3 == i.length && (t.width = i[1], t.height = i[2])), 2 in l && (t.options = l[2])
180				}
181				if (!t.type) switch (i = t.src.match(/\/\/([a-z0-9\.]+)\/.*/), (!i || i.length < 2) && (i = [!1]), i[1]) {
182					case"api.soundcloud.com":
183						t.type = "soundcloud";
184						break;
185					case"youtu.be":
186						t.type = "youtube";
187						break;
188					case"vimeo.com":
189						t.type = "vimeo";
190						break;
191					case"wistia.net":
192						t.type = "wistia";
193						break;
194					case"bcove.me":
195						t.type = "bcove";
196						break;
197					default:
198						t.type = "image"
199				}
200				switch (i = t.src.match(/\/\/[a-z0-9\.]+\/(.*)/), t.type) {
201					case"iframe":
202						t.object = e('<iframe src="" frameborder="0"></iframe>'), t.object.on("click", function (e) {
203							e.stopPropagation()
204						}).css("cursor", "auto"), t.width && t.height || (t.width = "600", t.height = "400");
205						break;
206					case"ajax":
207						t.object = e('<div class="poptrox-ajax"></div>'), t.object.on("click", function (e) {
208							e.stopPropagation()
209						}).css("cursor", "auto").css("overflow", "auto"), t.width && t.height || (t.width = "600", t.height = "400");
210						break;
211					case"soundcloud":
212						t.object = e('<iframe scrolling="no" frameborder="no" src=""></iframe>'), t.src = "//w.soundcloud.com/player/?url=" + escape(t.src) + (t.options ? "&" + t.options : ""), t.width = "600", t.height = "166";
213						break;
214					case"youtube":
215						t.object = e('<iframe src="" frameborder="0" allowfullscreen="1"></iframe>'), t.src = "//www.youtube.com/embed/" + i[1] + (t.options ? "?" + t.options : ""), t.width && t.height || (t.width = "800", t.height = "480");
216						break;
217					case"vimeo":
218						t.object = e('<iframe src="" frameborder="0" allowFullScreen="1"></iframe>'), t.src = "//player.vimeo.com/video/" + i[1] + (t.options ? "?" + t.options : ""), t.width && t.height || (t.width = "800", t.height = "480");
219						break;
220					case"wistia":
221						t.object = e('<iframe src="" frameborder="0" allowFullScreen="1"></iframe>'), t.src = "//fast.wistia.net/" + i[1] + (t.options ? "?" + t.options : ""), t.width && t.height || (t.width = "800", t.height = "480");
222						break;
223					case"bcove":
224						t.object = e('<iframe src="" frameborder="0" allowFullScreen="1" width="100%"></iframe>'), t.src = "//bcove.me/" + i[1] + (t.options ? "?" + t.options : ""), t.width && t.height || (t.width = "640", t.height = "360");
225						break;
226					default:
227						if (t.object = e('<img src="" alt="" style="vertical-align:bottom" />'), r.preload) {
228							var i = document.createElement("img");
229							i.src = t.src, f.push(i)
230						}
231						t.width = p.attr("width"), t.height = p.attr("height")
232				}
233				"file:" == window.location.protocol && t.src.match(/^\/\//) && (t.src = "http:" + t.src), d.push(t), s.attr("title", ""), p.attr("href", "").css("outline", 0).on("click", function (e) {
234					e.preventDefault(), e.stopPropagation(), x.trigger("poptrox_open", [o])
235				})
236			}
237		}), e(this)
238	}
239}(jQuery);
240/*www.sucaijiayuan.com*/

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.