PageSourceSearch

http://multtherapy.ru/js/jqModal.js

js multtherapy.ru collected 2026-10-04 16:54:55 UTC 3,918 bytes, 70 lines download raw bytes

1/*
2 * jqModal - Minimalist Modaling with jQuery
3 *   (http://dev.iceburg.net/jquery/jqModal/)
4 *
5 * Copyright (c) 2007,2008 Brice Burgess <[email protected]>
6 * Dual licensed under the MIT and GPL licenses:
7 *   http://www.opensource.org/licenses/mit-license.php
8 *   http://www.gnu.org/licenses/gpl.html
9 * 
10 * $Version: 03/01/2009 +r14
11 */
12(function($) {
13$.fn.jqm=function(o){
14var p={
15overlay: 100,
16overlayClass: 'jqmOverlay',
17closeClass: 'jqmClose',
18trigger: '.jqModal',
19ajax: F,
20ajaxText: '',
21target: F,
22modal: F,
23toTop: F,
24onShow: F,
25onHide: F,
26onLoad: F
27};
28return this.each(function(){if(this._jqm)return H[this._jqm].c=$.extend({},H[this._jqm].c,o);s++;this._jqm=s;
29H[s]={c:$.extend(p,$.jqm.params,o),a:F,w:$(this).addClass('jqmID'+s),s:s};
30if(p.trigger)$(this).jqmAddTrigger(p.trigger);
31});};
32
33$.fn.jqmAddClose=function(e){return hs(this,e,'jqmHide');};
34$.fn.jqmAddTrigger=function(e){return hs(this,e,'jqmShow');};
35$.fn.jqmShow=function(t){ $('form').validationEngine('hideAll'); $('body').css({overflow:'hidden'});return this.each(function(){t=t||window.event;$.jqm.open(this._jqm,t);});};
36$.fn.jqmHide=function(t){ $('form').validationEngine('hideAll'); $('body').css({overflow:'auto'});return this.each(function(){t=t||window.event;$.jqm.close(this._jqm,t)});};
37$.fn.alignCenter=function(){var ml=Math.max(40,parseInt($(window).width()/2-$(this).width()/2))+'px';var mt=Math.max(40,parseInt($(window).height()/2-$(this).height()/2));$(this).css({'left':ml,'top':mt+'px'});};
38
39$.jqm = {
40hash:{},
41open:function(s,t){H[s].w.hide();var h=H[s],c=h.c,cc='.'+c.closeClass,z=(parseInt(h.w.css('z-index'))),z=(z>0)?z:3000,o=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':z-2,opacity:c.overlay/100});if(h.a)return F;h.t=t;h.a=true;h.w.css('z-index',z);
42 if(c.modal) {if(!A[0])L('bind');A.push(s);}
43 else if(c.overlay > 0)h.w.jqmAddClose(o);
44 else o=F;
45 h.o=(o)?o.addClass(c.overlayClass).prependTo('body'):F;
46 if(c.ajax) {h.w.alignCenter();var r=c.target||h.w,u=c.ajax,r=(typeof r == 'string')?$(r,h.w):$(r),u=(u.substr(0,1) == '@')?$(t).attr(u.substring(1)):u;
47  r/*.html(c.ajaxText)*/.load(u,function(){h.w.alignCenter();if(c.onLoad)c.onLoad.call(this,h);if(cc)h.w.jqmAddClose($(cc,h.w));e(h);});}
48 else if(cc)h.w.jqmAddClose($(cc,h.w));
49 if(c.toTop&&h.o)h.w.before('<span id="jqmP'+h.w[0]._jqm+'"></span>').insertAfter(h.o);	
50 (c.onShow)?c.onShow(h):h.w.show();e(h);h.w.alignCenter();
51    $(h.w).wrap('<div id="scrollfix_l" style="width: 100%; height: 100%; z-index: 2999; position: fixed; top:0; left: 0; overflow-x: hidden; overflow-y: auto;"></div>');
52    $('#scrollfix_l').click(function(ev){if($(ev.target).closest(".jqmWindow").length == 0)$(h.w).jqmHide();});
53    $(window).resize(function(){h.w.alignCenter();});
54    return F;
55},
56close:function(s){var h=H[s];if(!h.a)return F;h.a=F;
57 if(A[0]){A.pop();if(!A[0])L('unbind');}
58 if(h.c.toTop&&h.o)$('#jqmP'+h.w[0]._jqm).after(h.w).remove();
59 if(h.c.onHide)h.c.onHide(h);else{$('#scrollfix_l').replaceWith($(h.w));h.w.hide();if(h.o)h.o.remove();} return F;
60},
61params:{}};
62var s=0,H=$.jqm.hash,A=[],ie6=$.browser.msie&&($.browser.version == "6.0"),F=false,
63i=$('<iframe src="javascript:false;document.write(\'\');" class="jqm"></iframe>').css({opacity:0}),
64e=function(h){if(ie6)if(h.o)h.o.html('<p style="width:100%;height:100%"/>').prepend(i);else if(!$('iframe.jqm',h.w)[0])h.w.prepend(i); f(h);},
65f=function(h){try{$(':input:visible',h.w)[0].focus();}catch(_){}},
66L=function(t){$()[t]("keypress",m)[t]("keydown",m)[t]("mousedown",m);},
67m=function(e){var h=H[A[A.length-1]],r=(!$(e.target).parents('.jqmID'+h.s)[0]);if(r)f(h);return !r;},
68hs=function(w,t,c){return w.each(function(){var s=this._jqm;$(t).each(function() {
69 if(!this[c]){this[c]=[];$(this).click(function(){for(var i in {jqmShow:1,jqmHide:1})for(var s in this[i])if(H[this[i][s]])H[this[i][s]].w[i](this);return F;});}this[c].push(s);});});};
70})(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.