Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2018-09-12 21:12:06

Rainer Goergen
Member
From: Trier, Germany
Registered: 2016-05-01
Posts: 401
Website

fancybox.cfg.php

Hi, have changed in BL 1 the fancybox.cfg.php:

<?php defined('APP_DIR') or die('No direct script access allowed in ' . __FILE__); ?>

$('[data-fancybox=gallery]').on('click', function(e) {

<?php if ( $model->value('photos_for_download.source') != 'disabled' ): ?>
    /**
     * CMD/CTRL-Click to Download Image
     */
    if( e.ctrlKey || e.metaKey ){
        var href = $(e.target).closest('figure').find('.download_image').attr("href"),
                path = href.split('file=')[1],
                url  = (
                    getMobileOperatingSystem() == 'Android' ||
                    getMobileOperatingSystem() == 'iOS' ||
                    getMobileOperatingSystem() == 'Windows Phone'
                ) ? path : href,
                a = $('<a />').attr({ 'href' : url, 'target' : '_blank', 'download' : '' }).appendTo("body");
        ;
        a[0].click(); a.remove();
    }
    else {
<?php endif; ?>
    /**
     * +Fancybox Gallery
     */
    var visibleLinks = $('[data-fancybox=gallery]:visible, .page-navigation-notice');
    $.fancybox.open( visibleLinks, {

        animationEffect : <?php echo $model->value('slideshow.animationEffect') == 'disabled' ? 'false' : '\'' . $model->value('slideshow.animationEffect') . '\'' ?>,
       
       
        slideShow : {
        autoStart : false,
        speed     : 6000
    },
       
       
       
        animationDuration : 350,
        baseClass : 'fancybox-pangolin-album',

        loop : <?php echo $model->on('slideshow.loop') ? 'true' : 'false' ?>,
        margin : [ 6 , 6 ],
        transitionEffect : <?php echo $model->value('slideshow.transitionEffect') == 'disabled' ? 'false' : '\'' . $model->value('slideshow.transitionEffect') . '\'' ?>,
        transitionDuration : 350,
        trapFocus: <?php echo (__c('FOTOMOTO_STORE_ID') && $model->value('addon_feature') == 'fotomoto') ? 'false' : 'true' ?>,
        zoomOpacity : true,

        onInit : function( e, instance ) {
            //console.log( $.fancybox.getInstance() );
        },

        lang : 'en',
        i18n : {
            'en' : {
                CLOSE       : '<?php echo __t('loc.fb.close', 'Close (Esc, X)') ?>',
                NEXT        : '<?php echo __t('loc.fb.next', 'Next (right arrow)') ?>',
                PREV        : '<?php echo __t('loc.fb.prev', 'Previous (left arrow)') ?>',
                ERROR       : '<?php echo __t('loc.fb.error', 'The requested content cannot be loaded. <br/> Please try again later.') ?>',
                PLAY_START  : '<?php echo __t('loc.fb.play', 'Start Slideshow (P)') ?>',
                PLAY_STOP   : '<?php echo __t('loc.fb.pause', 'Pause Slideshow (P)') ?>',
                FULL_SCREEN : '<?php echo __t('loc.fb.fullscreen', 'Full-screen (F)') ?>',
                THUMBS      : '<?php echo __t('loc.fb.grid', 'Thumbnails (G)') ?>'
            },
        }

    }, visibleLinks.index( this ) );
    /**
     * -Fancybox Gallery
     */
<?php if ( $model->value('photos_for_download.source') != 'disabled' ): ?>
    }
<?php endif; ?>

    return false;
}); // $('[data-fancybox=gallery]').on()

$(document).on('afterKeydown.fb', function(e, instance, current, keypress, keycode) {
    // "Z"
    if ( !keypress.ctrlKey && !keypress.metaKey && keycode === 90 ) {
        keypress.preventDefault();
        instance.isScaledDown() ? instance.scaleToActual() : instance.scaleToFit();
    }
    // "X"
    if ( !keypress.ctrlKey && !keypress.metaKey && keycode === 88 ) {
        keypress.preventDefault();
        instance.close();
    }
});


--------------

What do I have to  change here?

Thank you Ben

Offline

#2 2018-09-13 00:24:29

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: fancybox.cfg.php

Assuming by "here" you mean Backlight 2?

You'll need to edit the same file, but you'll need to edit it the file installed on your site. I'd first download the file, edit it, then upload it back to where you found it.

yoursite.com/backlight/modules/pangolin-album/dynamic/js


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#3 2018-09-13 15:21:16

Rainer Goergen
Member
From: Trier, Germany
Registered: 2016-05-01
Posts: 401
Website

Re: fancybox.cfg.php

Thanks, found it. My mistake.

Rainer

Offline

#4 2018-09-13 17:37:39

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: fancybox.cfg.php

to make it so you don't have to upload that file after every update, you could try the strategy outlined by Matt here:
http://community.theturninggate.net/vie … hp?id=8883


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

Board footer

Powered by FluxBB