1/*================================================================================ 2 * @name: bPopup - if you can't get it up, use bPopup 3 * @author: (c)Bjoern Klinggaard (twitter@bklinggaard) 4 * @demo: http://dinbror.dk/bpopup 5 * @version: 0.11.0.min 6 ================================================================================*/ 7(function(c) { 8 c.fn.bPopup = function(A, E) { 9 function L() { 10 a.contentContainer = c(a.contentContainer || b); 11 switch (a.content) { 12 case "iframe": 13 var d = c('<iframe class="b-iframe" ' + a.iframeAttr + "></iframe>"); 14 d.appendTo(a.contentContainer); 15 t = b.outerHeight(!0); 16 u = b.outerWidth(!0); 17 B(); 18 d.attr("src", a.loadUrl); 19 l(a.loadCallback); 20 break; 21 case "image": 22 B(); 23 c("<img />").load(function() { 24 l(a.loadCallback); 25 F(c(this)) 26 }).attr("src", a.loadUrl).hide().appendTo(a.contentContainer); 27 break; 28 default: 29 B(), c('<div class="b-ajax-wrapper"></div>').load(a.loadUrl, a.loadData, function(d, b, e) { 30 l(a.loadCallback, b); 31 F(c(this)) 32 }).hide().appendTo(a.contentContainer) 33 } 34 } 35 36 function B() { 37 a.modal && c('<div class="b-modal ' + e + '"></div>').css({ 38 backgroundColor: a.modalColor, 39 position: "fixed", 40 top: 0, 41 right: 0, 42 bottom: 0, 43 left: 0, 44 opacity: 0, 45 zIndex: a.zIndex + v 46 }).appendTo(a.appendTo).fadeTo(a.speed, a.opacity); 47 C(); 48 b.data("bPopup", a).data("id", e).css({ 49 left: "slideIn" == a.transition || "slideBack" == a.transition ? "slideBack" == a.transition ? f.scrollLeft() + w : -1 * (x + u) : m(!(!a.follow[0] && n || g)), 50 position: a.positionStyle || "absolute", 51 top: "slideDown" == a.transition || "slideUp" == a.transition ? "slideUp" == a.transition ? f.scrollTop() + y : z + -1 * t : p(!(!a.follow[1] && q || g)), 52 "z-index": a.zIndex + v + 1 53 }).each(function() { 54 a.appending && c(this).appendTo(a.appendTo) 55 }); 56 G(!0) 57 $('.b-modal').on('click', function() { 58 $('body').css({'overflow-y':'visible'}) 59 }); 60 } 61 62 function r() { 63 a.modal && c(".b-modal." + b.data("id")).fadeTo(a.speed, 0, function() { 64 c(this).remove() 65 }); 66 a.scrollBar || c("html").css("overflow", "auto"); 67 c(".b-modal." + e).unbind("click"); 68 f.unbind("keydown." + e); 69 k.unbind("." + e).data("bPopup", 0 < k.data("bPopup") - 1 ? k.data("bPopup") - 1 : null); 70 b.undelegate(".bClose, ." + a.closeClass, "click." + e, r).data("bPopup", null); 71 clearTimeout(H); 72 G(); 73 return !1 74 } 75 76 function I(d) { 77 y = k.height(); 78 w = k.width(); 79 h = D(); 80 if (h.x || h.y) clearTimeout(J), J = setTimeout(function() { 81 C(); 82 d = d || a.followSpeed; 83 var e = {}; 84 h.x && (e.left = a.follow[0] ? m(!0) : "auto"); 85 h.y && (e.top = a.follow[1] ? p(!0) : "auto"); 86 b.dequeue().each(function() { 87 g ? c(this).css({ 88 left: x, 89 top: z 90 }) : c(this).animate(e, d, a.followEasing) 91 }) 92 }, 50) 93 } 94 95 function F(d) { 96 var c = d.width(), 97 e = d.height(), 98 f = {}; 99 a.contentContainer.css({ 100 height: e, 101 width: c 102 }); 103 e >
103= b.height() && (f.height = b.height()); 104 c >= b.width() && (f.width = b.width()); 105 t = b.outerHeight(!0); 106 u = b.outerWidth(!0); 107 C(); 108 a.contentContainer.css({ 109 height: "auto", 110 width: "auto" 111 }); 112 f.left = m(!(!a.follow[0] && n || g)); 113 f.top = p(!(!a.follow[1] && q || g)); 114 b.animate(f, 250, function() { 115 d.show(); 116 h = D() 117 }) 118 } 119 120 function M() { 121 k.data("bPopup", v); 122 b.delegate(".bClose, ." + a.closeClass, "click." + e, r); 123 a.modalClose && c(".b-modal." + e).css("cursor", "pointer").bind("click", r); 124 N || !a.follow[0] && !a.follow[1] || k.bind("scroll." + e, function() { 125 if (h.x || h.y) { 126 var d = {}; 127 h.x && (d.left = a.follow[0] ? m(!g) : "auto"); 128 h.y && (d.top = a.follow[1] ? p(!g) : "auto"); 129 b.dequeue().animate(d, a.followSpeed, a.followEasing) 130 } 131 }).bind("resize." + e, function() { 132 I() 133 }); 134 a.escClose && f.bind("keydown." + e, function(a) { 135 27 == a.which && r() 136 }) 137 } 138 139 function G(d) { 140 function c(e) { 141 b.css({ 142 display: "block", 143 opacity: 1 144 }).animate(e, a.speed, a.easing, function() { 145 K(d) 146 }) 147 } 148 switch (d ? a.transition : a.transitionClose || a.transition) { 149 case "slideIn": 150 c({ 151 left: d ? m(!(!a.follow[0] && n || g)) : f.scrollLeft() - (u || b.outerWidth(!0)) - 200 152 }); 153 break; 154 case "slideBack": 155 c({ 156 left: d ? m(!(!a.follow[0] && n || g)) : f.scrollLeft() + w + 200 157 }); 158 break; 159 case "slideDown": 160 c({ 161 top: d ? p(!(!a.follow[1] && q || g)) : f.scrollTop() - (t || b.outerHeight(!0)) - 200 162 }); 163 break; 164 case "slideUp": 165 c({ 166 top: d ? p(!(!a.follow[1] && q || g)) : f.scrollTop() + y + 200 167 }); 168 break; 169 default: 170 b.stop().fadeTo(a.speed, d ? 1 : 0, function() { 171 K(d) 172 }) 173 } 174 } 175 176 function K(d) { 177 d ? (M(), l(E), a.autoClose && (H = setTimeout(r, a.autoClose))) : (b.hide(), l(a.onClose), a.loadUrl && (a.contentContainer.empty(), b.css({ 178 height: "auto", 179 width: "auto" 180 }))) 181 } 182 183 function m(a) { 184 return a ? x + f.scrollLeft() : x 185 } 186 187 function p(a) { 188 return a ? z + f.scrollTop() : z 189 } 190 191 function l(a, e) { 192 c.isFunction(a) && a.call(b, e) 193 } 194 195 function C() { 196 z = q ? a.position[1] : Math.max(0, (y - b.outerHeight(!0)) / 2 - a.amsl); 197 x = n ? a.position[0] : (w - b.outerWidth(!0)) / 2; 198 h = D() 199 } 200 201 function D() { 202 return { 203 x: w > b.outerWidth(!0), 204 y: y > b.outerHeight(!0) 205 } 206 } 207 c.isFunction(A) && (E = A, A = null); 208 var a = c.extend({}, c.fn.bPopup.defaults, A); 209 a.scrollBar || c("html").css("overflow", "hidden"); 210 var b = this, 211 f = c(document), 212 k = c(window), 213 y = k.height(), 214 w = k.width(), 215 N = /OS 6(_\d)+/i.test(navigator.userAgent), 216 v = 0, 217 e, h, q, n, g, z, x, t, u, J, H; 218 b.close = function() { 219 r() 220 }; 221 b.reposition = function(a) { 222 I(a) 223 }; 224 return b.each(function() { 225 c(this).data("bPopup") || (l(a.onOpen), v = (k.data("bPopup") || 0) + 1, e = "__b-popup" + v + "__", q = "auto" !== a.position[1], n = "auto" !== a.position[0], g = "fixed" === a.positionStyle, t = b.outerHeight(!0), u = b.outerWidth(!0), a.loadUrl ? L() : B()) 226 }) 227 }; 228 c.fn.bPopup.defaults = { 229 amsl: 50, 230 appending: !0, 231 appendTo: "body", 232 autoClose: !1, 233 closeClass: "b-close", 234 content: "ajax", 235 contentContainer: !1, 236 easing: "swing", 237 escClose: !0, 238 follow: [!0, !0], 239 followEasing: "swing", 240 followSpeed: 500, 241 iframeAttr: 'scrolling="no" frameborder="0"', 242 loadCallback: !1,
243 loadData: !1, 244 loadUrl: !1, 245 modal: !0, 246 modalClose: !0, 247 modalColor: "#000", 248 onClose: !1, 249 onOpen: !1, 250 opacity: .7, 251 position: ["auto", "auto"], 252 positionStyle: "fixed", //absolute 253 scrollBar: !0, 254 speed: 250, 255 transition: "fadeIn", 256 transitionClose: !1, 257 zIndex: 9997 258 } 259})(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.