Viewing file: footer_gallery.php (8.87 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php global $tpl_body_id,$portfolio_page,$data;
### getting current file template name ### global $wp_query; $template_name = get_post_meta( $wp_query->post->ID, '_wp_page_template', true );
if ($tpl_body_id=="colorbox" || $template_name == "template-colorbox.php") { ?> <script type="text/javascript">
jQuery(document).ready(function() {
var items = jQuery('div#content a').filter(function() { if (jQuery(this).attr('href')) return jQuery(this).attr('href').match(/\.(jpg|png|gif|JPG|GIF|PNG|Jpg|Gif|Png|JPEG|Jpeg)/); });
<?php if ( $data['wm_img_gallery_nxt_prev'] == "1" ) { ?> if (items.length > 0){ var gallerySwitch="gallery"; }else{ var gallerySwitch=""; } <?php } else { ?> var gallerySwitch=""; <?php } ?>
items.attr('rel',gallerySwitch);
// Setting colorbox ------------------------------------------------------------------------------ $(document).ready(function(){ $(".gallery_2col").colorbox({rel:'gallery_2col' <?php if($data["wm_gallery_titles_colorbox"] != "Enable Colorbox Titles") { echo ", 'title' : false"; } ?>}); $(".gallery_3col").colorbox({rel:'gallery_3col' <?php if($data["wm_gallery_titles_colorbox"] != "Enable Colorbox Titles") { echo ", 'title' : false"; } ?>}); $(".gallery_4col").colorbox({rel:'gallery_4col' <?php if($data["wm_gallery_titles_colorbox"] != "Enable Colorbox Titles") { echo ", 'title' : false"; } ?>}); $(".gallery_grid").colorbox({rel:'gallery_grid' <?php if($data["wm_gallery_titles_colorbox"] != "Enable Colorbox Titles") { echo ", 'title' : false"; } ?>}); });
// If an image is inserted into Gallery Page Template (PrettyPhoto) it breaks the page functionality jQuery("a[rel^='gallery']").colorbox({ 'maxHeight' : '95%', 'maxWidth' : '95%' <?php if($data["wm_gallery_titles_colorbox"] != "Enable Colorbox Titles") { echo ", 'title' : false"; } ?> });
// ColorBox resize function to make it responsive var resizeTimer; function resizeColorBox(){ if (resizeTimer) clearTimeout(resizeTimer); resizeTimer = setTimeout(function() { if ($('#cboxOverlay').is(':visible')) { $.colorbox.load(true); } }, 300); } // Resize ColorBox when resizing window or changing mobile device orientation $(window).resize(resizeColorBox); window.addEventListener("orientationchange", resizeColorBox, false); //---------------------------------------------------------------------------------------------------
}); </script> <?php } elseif ($tpl_body_id=="fancybox" || $template_name == "template-fancybox.php") { ?> <script type="text/javascript"> function formatTitle(title, currentArray, currentIndex, currentOpts) { return '<div id="tip7-title">' + (title && title.length ? '<b>' + title + '</b>' : '' ) + '<span>' + (currentIndex + 1) + ' / ' + currentArray.length + '</span></div>'; } jQuery(document).ready(function() {
var items = jQuery('div#content a').filter(function() { if (jQuery(this).attr('href')) return jQuery(this).attr('href').match(/\.(jpg|png|gif|JPG|GIF|PNG|Jpg|Gif|Png|JPEG|Jpeg)/); }); <?php if ( $data['wm_img_gallery_nxt_prev'] == "1" ) { ?> if (items.length > 0){ var gallerySwitch="gallery"; }else{ var gallerySwitch=""; } <?php } else { ?> var gallerySwitch=""; <?php } ?>
items.attr('rel',gallerySwitch);
// Fancybox JS Added for responsive ---- $(document).ready(function(){ $('.fancybox').fancybox({ closeClick : true, openEffect : 'elastic', openSpeed : 200, prevEffect : 'fade', nextEffect : 'fade', helpers : { title : { type : 'inside' }, overlay : { css : { 'background' : 'rgba(0,0,0,0.85)' }, showEarly : false } }, 'titleFormat' : formatTitle <?php if($data["wm_gallery_titles_fancybox"] != "Enable Fancybox Titles") { echo ", 'title' : ''"; } ?> }); }); // Fancybox JS ends ----
//load fancybox and options jQuery("#gallery_fancybox ul li a").fancybox({ 'overlayOpacity': '0.8', 'overlayColor' : 'black', 'transitionIn' : 'elastic', 'transitionOut' : 'fade', 'titlePosition' : 'inside', 'titleFormat' : formatTitle <?php if($data["wm_gallery_titles_fancybox"] != "Enable Fancybox Titles") { echo ", 'title' : ''"; } ?> }); // If an image is inserted into Gallery Page Template (PrettyPhoto) it breaks the page functionality jQuery("a[rel^='gallery']").fancybox({ 'overlayOpacity': '0.8', 'overlayColor' : 'black', 'transitionIn' : 'elastic', 'transitionOut' : 'fade', 'titlePosition' : 'inside', 'titleFormat' : formatTitle <?php if($data["wm_gallery_titles_fancybox"] != "Enable Fancybox Titles") { echo ", 'title' : ''"; } ?> });
}); </script> <?php } elseif ($tpl_body_id=="prettyphoto" || $template_name == "template-prettyphoto.php") { ?> <script type="text/javascript"> jQuery(document).ready(function() {
var items = jQuery('div#content a').filter(function() { if (jQuery(this).attr('href')){
//alert(jQuery(this).attr('rel')); 7/11/2013 //if there is no rel defined in anchor if(jQuery(this).attr('rel') == undefined) { return jQuery(this).attr('href').match(/\.(jpg|png|gif|JPG|GIF|PNG|Jpg|Gif|Png|JPEG|Jpeg)/); } } }); <?php if ( $data['wm_img_gallery_nxt_prev'] == "1" ) { ?> if (items.length > 0){ var gallerySwitch="prettyPhoto[gallery]"; }else{ var gallerySwitch=""; } <?php } else { ?> var gallerySwitch=""; <?php } ?>
items.attr('rel',gallerySwitch);
//load prettyPhoto <?php if($portfolio_page == 'portfolio') { ?> jQuery("a[rel^='prettyPhoto']").prettyPhoto({ <?php if($data["wm_prettybox_share_option"] != "Disable PrettyPhoto Share") { echo ''; } else { echo 'social_tools: false'; }?>}); <?php } else { ?> jQuery(document).ready(function($) { $("a[href$='.jpg'], a[href$='.jpeg'], a[href$='.gif'], a[href$='.png']").prettyPhoto({ animationSpeed: 'normal', /* fast/slow/normal */ padding: 40, /* padding for each side of the picture */ opacity: 0.7, /* Value betwee 0 and 1 */ <?php if($data["wm_prettybox_share_option"] != "Disable PrettyPhoto Share") { echo ''; } else { echo 'social_tools: false,'; }?> <?php if($data["wm_gallery_titles_prettyphoto"] == "Enable PrettyPhoto Titles") { echo 'showTitle: true /* true/false */';} else { echo 'showTitle: false';} ?> }); }) <?php } ?> }); </script> <?php } elseif ($tpl_body_id=="galleria" || $template_name == "template-galleria.php") {
//FIX THE ISSUE OF GALLERIA ON ARCHIVE PAGE global $tpl_body_arhive_id; if($tpl_body_arhive_id!="blog_overview_archive"){ ?> <script type="text/javascript"> // Galleria JS ---- $(document).ready(function(){ // Load the classic theme Galleria.loadTheme('<?php echo get_template_directory_uri(); ?>/js/galleria.classic.js'); // Initialize Galleria //Galleria.run('#galleria'); $('#galleria').galleria({ transition: 'fade' <?php if($data["wm_gallery_titles_galleria"] != "Enable Galleria Titles") { echo ", _toggleInfo: false, showInfo: false"; } ?> }); });
// Initialize Galleria //7/24/2014 jQuery('#galleria #gallery_galleria,.gallery').galleria({ transition: 'fade' <?php if($data["wm_gallery_titles_galleria"] != "Enable Galleria Titles") { echo ", _toggleInfo: false, showInfo: false"; } ?> });
// If an image is inserted into Gallery Page Template (PrettyPhoto) it breaks the page functionality jQuery(document).ready(function() {
var items = jQuery('div#content a').filter(function() { if (jQuery(this).attr('href')) return jQuery(this).attr('href').match(/\.(jpg|png|gif|JPG|GIF|PNG|Jpg|Gif|Png|JPEG|Jpeg)/); });
<?php if ( $data['wm_img_gallery_nxt_prev'] == "1" ) { ?> if (items.length > 0){ var gallerySwitch="prettyPhoto[gallery]"; }else{ var gallerySwitch=""; } <?php } else { ?> var gallerySwitch=""; <?php } ?>
items.attr('rel',gallerySwitch);
jQuery("a[rel^='prettyPhoto']").prettyPhoto({ <?php if($data["wm_prettybox_share_option"] != "Disable PrettyPhoto Share") { echo ''; } else { echo 'social_tools: false'; }?>}); }); </script> <?php } } elseif ($tpl_body_id=="slideviewer" || $template_name == "template-slideviewer.php") { //FIX THE ISSUE OF GALLERIA ON ARCHIVE PAGE global $tpl_body_arhive_id; if($tpl_body_arhive_id!="blog_overview_archive"){ ?> <script type="text/javascript"> jQuery(document).ready(function() {
var items = jQuery('div#content a').filter(function() { if (jQuery(this).attr('href')) return jQuery(this).attr('href').match(/\.(jpg|png|gif|JPG|GIF|PNG|Jpg|Gif|Png|JPEG|Jpeg)/); });
if (items.length > 0){ var gallerySwitch="prettyPhoto[gallery]"; }else{ var gallerySwitch=""; }
items.attr('rel',gallerySwitch);
jQuery("a[rel^='prettyPhoto']").prettyPhoto({ <?php if($data["wm_prettybox_share_option"] != "Disable PrettyPhoto Share") { echo ''; } else { echo 'social_tools: false'; }?>});
}); </script> <?php } } ?>
|