1$( document ).ready(function() { 2 if (typeof fancybox === "undefined") { 3 // safe to use the function 4 // console.error(".fancybox() function is undefined"); 5 // return; 6 } 7 8 9 // fancybox, use only for images 10 $(".fancybox").fancybox(); 11 12 // fancyAjax, use for images and/or other links 13 $(".fancyAjax").fancybox({ 14 type : "ajax", 15 padding : 0, 16 helpers: { 17 title: null, 18 overlay: {closeClick: false}, 19 } 20 }); 21 22 // fancyAjaxModal - same as fancyAjax, but must be closed manually 23 $(".fancyAjaxModal").fancybox({ 24 type : "ajax", 25 overlayShow : false, 26 modal : true, 27 padding : 0, 28 helpers: { 29 title: null 30 } 31 }); 32 33 // fancyIframe - open an iframe in a fancybox 34 $(".fancyIframe").fancybox({ 35 type : "iframe", 36 padding : 0 37 }); 38 39 40 41 42 // apply fancybox to links with target="fancybox" 43 $("a[target='fancybox']").each(function(){ 44 // get targetUrl 45 var targetUrl = $(this).attr('href'); 46 47 // get the last part of targetUrl 48 var pathPart = targetUrl.substring(targetUrl.lastIndexOf('/')+1); 49 50 // filter out GET parameters 51 if(pathPart.indexOf('?') > -1 ) { 52 pathPart = pathPart.substring(0, pathPart.indexOf('?')); 53 console.log(pathPart); 54 } 55 56 // get extension 57 var extension; 58 if(pathPart.indexOf('.') > -1 ) { 59 extension = pathPart.split('.').pop(); 60 } 61 else { 62 extension = null; 63 } 64 65 // apply fancybox depending on target type 66 if(extension == 'php' || extension == 'html') { 67 $(this).fancybox({ 68 "type" : "ajax", 69 "padding" : 0 70 }); 71 } 72 else if(extension) { 73 $(this).fancybox(); 74 } 75 else { 76 $(this).fancybox({ 77 "type" : "ajax", 78 "padding" : 0 79 }); 80 } 81 }); 82 83 84 85 86 // apply fancybox to links with defined target attribute 87 $("a[target='fancyAjax']:not([href*='javascript:void'])").fancybox({ 88 "type" : "ajax", 89 "padding" : 0 90 }); 91 92 $("a[target='fancyIframe']:not([href*='javascript:void'])").fancybox({ 93 type : "iframe", 94 padding : 0 95 96 }); 97 98 99 $("a[target='fancyboxModal']:not([href*='javascript:void'])").fancybox({ 100 "type" : "ajax", 101 "overlayShow" : false, 102 "modal" : true, 103 "wrapCSS" : 'fancybox-modal', 104 "padding" : 0, 105 "helpers" : { 106 overlay: { 107 opacity: 1, // or the opacity you want 108 css: {'background-color': 'rgba(0,0,0,0.85)'} // or your preferred hex color value 109 } // overlay 110 } // helpers 111 }); 112 113 114 115 116 117});
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.