1(function ($) { 2 $.fn.open = function (t, fn) {if (this[0]) return this.data('pp_open')(t, fn)} 3 $.fn.close = function (t, fn, remove) {if (this[0]) return this.data('pp_close')(t, fn, remove)} 4 $.fn.modalPopup = function (opt) { 5 opt=opt||{}; 6 var isVisible = false, el=this.addClass('pp_cont'); 7 var popup = $('<div /><div />'); 8 popup.eq(0).addClass('pp_shadow '+(opt.shClass||'')).css(opt.shCss||{}); 9 popup.eq(1).addClass('pp_wrapper pp_body '+(opt.wrClass||'')).css(opt.wrCss||{}).append(el); 10 el.css(opt.css||{left:0, top:0, margin:'25px 3px'}) 11 .data('popup', popup.hide().appendTo('body')).show(); 12 13 el.data('pp_close', el.close=function(t, fn, remove) { 14 if (isVisible) { 15 var c=$('.pp_wrapper:visible').length; 16 popup.stop().fadeOut($.isNumeric(t)?t:"fast", function(){ 17 if(c==1){ 18 $('.wrapper').css('padding-right', '') 19 $('body').removeClass('themodal-lock'); 20 } 21 if ($(this).is('.pp_body') && typeof(fn)=='function') fn.call(el[0], el); 22 if (remove) el.remove() 23 }); 24 isVisible = false; 25 }else{ 26 if (typeof(fn)=='function') fn.call(el[0], el); 27 } 28 return el 29 }) 30 31 el.data('pp_open', el.open=function(t, fn) { 32 if (!isVisible) { 33 if(!$('.pp_wrapper:visible')[0]){ 34 var w=$('body').width(); 35 $('.wrapper').width(w); 36 $('body').addClass('themodal-lock'); 37 $('.wrapper').css({width:'', paddingRight: $('body').width()-w}) 38 } 39 popup.stop().fadeIn($.isNumeric(t)?t:"fast", function(){ 40 if ($(this).is('.pp_body') && typeof(fn)=='function') fn.call(el[0], el); 41 }); 42 isVisible = true; 43 } 44 return el 45 }) 46 47 el.remove=function() { 48 popup.remove(); return el 49 } 50 popup.options = opt; 51 52 return el 53 54 //$(document).keyup(function (evt) { 55 // evt = evt || window.event; 56 // if (evt.keyCode == 27 && isVisible) close(); 57 //}); 58 }; 59})(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.