1(function(a) { 2 a.alerts = { 3 verticalOffset: -75, 4 horizontalOffset: 0, 5 repositionOnResize: true, 6 overlayOpacity: 0.50, 7 overlayColor: "#FFF", 8 draggable: true, 9 okButton: "OK", 10 cancelButton: "Cancel", 11 dialogClass: null, 12 alert: function(b, c, d) { 13 if (c == null) { 14 c = "OK" 15 } 16 a.alerts._show(c, b, null, "alert", 17 function(e) { 18 if (d) { 19 d(e) 20 } 21 }, 22 null, null, null, null) 23 }, 24 confirm: function(b, c, d) { 25 if (c == null) { 26 c = "Are you sure" 27 } 28 a.alerts._show(c, b, null, "confirm", 29 function(e) { 30 if (d) { 31 d(e) 32 } 33 }, 34 null, null, null, null) 35 }, 36 prompt: function(b, c, d, e) { 37 if (d == null) { 38 d = "Please enter something" 39 } 40 a.alerts._show(d, b, c, "prompt", 41 function(f) { 42 if (e) { 43 e(f) 44 } 45 }, 46 null, null, null, null) 47 }, 48 openBox: function(f, g, b, c, e, d, i) { 49 if (g == null) { 50 g = "Information" 51 } 52 a.alerts._show(g, f, null, "openBox", 53 function(h) { 54 if (i) { 55 i(h) 56 } 57 }, 58 b, c, e, d) 59 }, 60 overAlert: function(c, b) { 61 a.alerts._overShow(c, b) 62 }, 63 _overShow: function(d, c) { 64 if (c == null) { 65 c = 3000 66 } 67 var b = c + 600; 68 a("body").append('<div id="over_container" style="display:none"><div id="over_message"></div></div>'); 69 a("#over_message").text(d).html(a("#over_message").text().replace(/\n/g, "<br />")); 70 if (a.alerts.dialogClass) { 71 a("#over_container").addClass(a.alerts.dialogClass) 72 } 73 var e = (a.cpeoplebrowser.msie && parseInt(a.cpeoplebrowser.version) <= 6) ? "absolute" : "fixed"; 74 a("#over_container").css({ 75 position: e, 76 zIndex: 99999, 77 width: 350, 78 padding: 0, 79 margin: 0 80 }).show("fast"); 81 a("#over_container").css({ 82 minWidth: a("#over_container").outerWidth(), 83 maxWidth: a("#over_container").outerWidth() 84 }); 85 a.alerts._overReposition(); 86 setTimeout(function() { 87 a("#over_container").hide("fast") 88 }, 89 c); 90 setTimeout(function() { 91 a("#over_container").remove() 92 }, 93 b) 94 }, 95 _overReposition: function() { 96 var c = 4; 97 var b = ((a(window).width() / 2) - (a("#over_container").outerWidth() / 2)) + a.alerts.horizontalOffset; 98 if (c < 0) { 99 c = 0 100 } 101 if (b < 0) { 102 b = 0 103 } 104 if (a.cpeoplebrowser.msie && parseInt(a.cpeoplebrowser.version) <= 6) { 105 c = c + a(window).scrollTop() 106 } 107 if (a.cpeoplebrowser.msie && parseInt(a.cpeoplebrowser.version) <= 6) { 108 b = b - 175 109 } 110 a("#over_container").css({ 111 top: c + "px", 112 left: b + "px" 113 }); 114 a("#popup_overlay").height(a(document).height()) 115 }, 116 _show: function(j, b, k, g, m, l, c, f, n) { 117 a.alerts._hide(); 118 a.alerts._overlay("show"); 119 a("body").append('<div id="popup_container" style="display:none"><h1 id="popup_title"></h1><em id="ctl"></em><em id="cbl"></em><em id="ctr"></em><em id="cbr"></em><span id="popup_close"></span><div id="popup_content"><div id="popup_message"></div></div></div>'); 120 if (a.alerts.dialogClass) { 121 a("#popup_container").addClass(a.alerts.dialogClass) 122 } 123 var i = (a.cpeoplebrowser.msie && parseInt(a.cpeoplebrowser.version) <= 6) ? "absolute" : "fixed"; 124 a("#popup_container").css({ 125 position: i, 126 zIndex: 99999, 127 padding: 0, 128 margin: 0 129 }).show();
130 a("#popup_title").text(j); 131 a("#popup_content").addClass(g); 132 if (g != "openBox") { 133 a("#popup_message").text(b).html(a("#popup_message").text().replace(/\n/g, "<br />")) 134 } 135 a("#popup_container").css({}); 136 a.alerts._reposition(); 137 a.alerts._maintainPosition(true); 138 switch (g) { 139 case "alert": 140 a("#popup_message").after('<div id="popup_panel"><input type="button" value="' + a.alerts.okButton + '" id="popup_ok" /></div>'); 141 a("#popup_ok").click(function() { 142 a.alerts._hide(); 143 m(true) 144 }); 145 a("#popup_ok").focus().keypress(function(h) { 146 if (h.keyCode == 13 || h.keyCode == 27) { 147 a("#popup_ok").trigger("click") 148 } 149 }); 150 break; 151 case "confirm": 152 a("#popup_message").after('<div id="popup_panel"><input type="button" value="' + a.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + a.alerts.cancelButton + '" id="popup_cancel" /></div>'); 153 a("#popup_ok").click(function() { 154 a.alerts._hide(); 155 if (m) { 156 m(true) 157 } 158 }); 159 a("#popup_cancel").click(function() { 160 a.alerts._hide(); 161 if (m) { 162 m(false) 163 } 164 }); 165 a("#popup_ok").focus(); 166 a("#popup_ok, #popup_cancel").keypress(function(h) { 167 if (h.keyCode == 13) { 168 a("#popup_ok").trigger("click") 169 } 170 if (h.keyCode == 27) { 171 a("#popup_cancel").trigger("click") 172 } 173 }); 174 break; 175 case "prompt": 176 a("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="' + a.alerts.okButton + '" id="popup_ok" /> <input type="button" value="' + a.alerts.cancelButton + '" id="popup_cancel" /></div>'); 177 a("#popup_prompt").width(a("#popup_message").width() - 10); 178 a("#popup_ok").click(function() { 179 var e = a("#popup_prompt").val(); 180 a.alerts._hide(); 181 if (m) { 182 m(e) 183 } 184 }); 185 a("#popup_cancel").click(function() { 186 a.alerts._hide(); 187 if (m) { 188 m(null) 189 } 190 }); 191 a("#popup_prompt, #popup_ok, #popup_cancel").keypress(function(h) { 192 if (h.keyCode == 13) { 193 a("#popup_ok").trigger("click") 194 } 195 if (h.keyCode == 27) { 196 a("#popup_cancel").trigger("click") 197 } 198 }); 199 if (k) { 200 a("#popup_prompt").val(k) 201 } 202 a("#popup_prompt").focus().select(); 203 break; 204 case "openBox": 205 a("#popup_message").append(a(b).html()); 206 if (l) { 207 a("#popup_container").css({ 208 width: 209 l + "px" 210 }) 211 } 212 if (c) { 213 a("#popup_container").css({ 214 height: c + "px" 215 }); 216 a("#popup_message").css({ 217 height: (c - 48) + "px" 218 }) 219 } 220 a.alerts._reposition(); 221 if (f) { 222 a(f).click(function() { 223 a.alerts._hide(); 224 if (m) { 225 m(true) 226 } 227 }) 228 } 229 if (n) { 230 a(n).click(function() { 231 a.alerts._hide(); 232 return false; 233 if (m) { 234 m(false) 235 } 236 }) 237 } 238 break 239 } 240 a("#popup_close").click(function() { 241 a.alerts._hide(); 242 if (m) { 243 m() 244 } 245 }); 246 if (a.alerts.draggable) { 247 try { 248 a("#popup_container").draggable({
249 handle: a("#popup_title") 250 }); 251 a("#popup_title").css({ 252 cursor: "move" 253 }) 254 } catch (d) { } 255 } 256 }, 257 _hide: function() { 258 a("#popup_container").remove(); 259 a.alerts._overlay("hide"); 260 a.alerts._maintainPosition(false) 261 }, 262 _overlay: function(b) { 263 switch (b) { 264 case "show": 265 a.alerts._overlay("hide"); 266 a("BODY").append('<div id="popup_overlay"></div>'); 267 a("#popup_overlay").css({ 268 position: 269 "absolute", 270 zIndex: 99998, 271 top: "0px", 272 left: "0px", 273 width: "100%", 274 height: a(document).height(), 275 background: a.alerts.overlayColor, 276 opacity: a.alerts.overlayOpacity 277 }); 278 break; 279 case "hide": 280 a("#popup_overlay").remove(); 281 break 282 } 283 }, 284 _reposition: function() { 285 var c = ((a(window).height() / 2) - (a("#popup_container").height() / 2)) + a.alerts.verticalOffset; 286 var b = ((a(window).width() / 2) - (a("#popup_container").width() / 2)) + a.alerts.horizontalOffset; 287 if (c < 0) { 288 c = 0 289 } 290 if (b < 0) { 291 b = 0 292 } 293 if (a.cpeoplebrowser.msie && parseInt(a.cpeoplebrowser.version) <= 6) { 294 c = c + a(window).scrollTop() 295 } 296 a("#popup_container").css({ 297 top: c + "px", 298 left: b + "px" 299 }); 300 a("#popup_overlay").height(a(document).height()) 301 }, 302 _maintainPosition: function(b) { 303 if (a.alerts.repositionOnResize) { 304 switch (b) { 305 case true: 306 a(window).bind("resize", a.alerts._reposition); 307 break; 308 case false: 309 a(window).unbind("resize", a.alerts._reposition); 310 break 311 } 312 } 313 } 314 }; 315 hiAlert = function(b, c, d) { 316 a.alerts.alert(b, c, d) 317 }; 318 hiConfirm = function(b, c, d) { 319 a.alerts.confirm(b, c, d) 320 }; 321 hiPrompt = function(b, c, d, e) { 322 a.alerts.prompt(b, c, d, e) 323 }; 324 hiBox = function(f, g, b, c, e, d, i) { 325 a.alerts.openBox(f, g, b, c, e, d, i) 326 }; 327 hiOverAlert = function(c, b) { 328 a.alerts.overAlert(c, b) 329 } 330})(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.