1/***************************/ 2//@Author: Adrian "yEnS" Mato Gondelle 3//@website: www.yensdesign.com 4//@email: [email protected] 5//@license: Feel free to use it, but keep this credits please! 6/***************************/ 7 8//SETTING UP OUR POPUP 9//0 means disabled; 1 means enabled; 10var popupStatus = 0; 11 12//loading popup with jQuery magic! 13function loadPopup(){ 14 //loads popup only if it is disabled 15 if(popupStatus==0){ 16 jQuery("#wpmg-popup-background").css({ 17 "opacity": "0.7" 18 }); 19 jQuery("#wpmg-popup-background").fadeIn("slow"); 20 jQuery("#wpmg-popup").fadeIn("slow"); 21 popupStatus = 1; 22 } 23} 24 25//disabling popup with jQuery magic! 26function disablePopup(){ 27 //disables popup only if it is enabled 28 if(popupStatus==1){ 29 jQuery("#wpmg-popup-background").fadeOut("slow"); 30 jQuery("#wpmg-popup").fadeOut("slow"); 31 popupStatus = 0; 32 } 33} 34 35//centering popup 36function centerPopup(){ 37 //request data for centering 38 var windowWidth = document.documentElement.clientWidth; 39 var windowHeight = document.documentElement.clientHeight; 40 var popupHeight = jQuery("#wpmg-popup").height(); 41 var popupWidth = jQuery("#wpmg-popup").width(); 42 //centering 43 jQuery("#wpmg-popup").css({ 44 "position": "absolute", 45 "top": windowHeight/2-popupHeight/2, 46 "left": windowWidth/2-popupWidth/2 47 }); 48 //only need force for IE6 49 50 jQuery("#wpmg-popup-background").css({ 51 "height": windowHeight 52 }); 53 54} 55 56//CONTROLLING EVENTS IN jQuery 57jQuery(document).ready(function(){ 58 59 //LOADING POPUP 60 //Click the button event! 61 jQuery("a.wpmg-embed-field").click(function(){ 62 //centering with css 63 centerPopup(); 64 //load popup 65 loadPopup(); 66 }); 67 68 //CLOSING POPUP 69 //Click the x event! 70 jQuery("#wpmg-popup-close").click(function(){ 71 disablePopup(); 72 }); 73 //Click out event! 74 jQuery("#wpmg-popup-background").click(function(){ 75 disablePopup(); 76 }); 77 //Press Escape event! 78 jQuery(document).keypress(function(e){ 79 if(e.keyCode==27 && popupStatus==1){ 80 disablePopup(); 81 } 82 }); 83 84});
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.