Plugin Directory

Changeset 800505


Ignore:
Timestamp:
11/07/2013 04:37:25 PM (12 years ago)
Author:
blueimp
Message:

Bugfix release 1.0.1.

Location:
blueimp-lightbox/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • blueimp-lightbox/trunk/blueimp-lightbox.php

    r790215 r800505  
    44 * Plugin URI: http://blueimp.github.io/Gallery/
    55 * Description: Official blueimp Gallery lightbox for Wordpress.
    6  * Version: 1.0.0
     6 * Version: 1.0.1
    77 * Text Domain: blueimp-lightbox
    88 * Domain Path: /lang
  • blueimp-lightbox/trunk/js/blueimp-gallery-youtube.js

    r790215 r800505  
    11/*
    2  * blueimp Gallery YouTube Video Factory JS 1.1.0
     2 * blueimp Gallery YouTube Video Factory JS 1.1.1
    33 * https://github.com/blueimp/Gallery
    44 *
     
    106106
    107107        onPause: function () {
    108             this.listeners.pause();
    109             delete this.playStatus;
     108            Gallery.prototype.setTimeout.call(
     109                this,
     110                this.checkSeek,
     111                null,
     112                2000
     113            );
     114        },
     115
     116        checkSeek: function () {
     117            if (this.stateChange === YT.PlayerState.PAUSED ||
     118                    this.stateChange === YT.PlayerState.ENDED) {
     119                // check if current state change is actually paused
     120                this.listeners.pause();
     121                delete this.playStatus;
     122            }
    110123        },
    111124
     
    121134                break;
    122135            }
     136            // Save most recent state change to this.stateChange
     137            this.stateChange = event.data;
    123138        },
    124139
  • blueimp-lightbox/trunk/js/blueimp-gallery.js

    r790215 r800505  
    11/*
    2  * blueimp Gallery JS 2.11.0
     2 * blueimp Gallery JS 2.11.5
    33 * https://github.com/blueimp/Gallery
    44 *
     
    211211                    }
    212212                },
    213                 prop,
    214                 transition,
    215                 translateZ,
    216213                elementTests = function () {
     214                    var transition = support.transition,
     215                        prop,
     216                        translateZ;
    217217                    document.body.appendChild(element);
    218218                    if (transition) {
     
    243243                    document.body.removeChild(element);
    244244                };
    245             for (prop in transitions) {
    246                 if (transitions.hasOwnProperty(prop) &&
    247                         element.style[prop] !== undefined) {
    248                     transition = transitions[prop];
    249                     transition.name = prop;
    250                     support.transition = transition;
    251                     break;
    252                 }
    253             }
     245            (function (support, transitions) {
     246                var prop;
     247                for (prop in transitions) {
     248                    if (transitions.hasOwnProperty(prop) &&
     249                            element.style[prop] !== undefined) {
     250                        support.transition = transitions[prop];
     251                        support.transition.name = prop;
     252                        break;
     253                    }
     254                }
     255            }(support, transitions));
    254256            if (document.body) {
    255257                elementTests();
     
    386388        add: function (list) {
    387389            var i;
     390            if (!list.concat) {
     391                // Make a real array out of the list to add:
     392                list = Array.prototype.slice.call(list);
     393            }
     394            if (!this.list.concat) {
     395                // Make a real array out of the Gallery list:
     396                this.list = Array.prototype.slice.call(this.list);
     397            }
    388398            this.list = this.list.concat(list);
    389399            this.num = this.list.length;
     
    646656                    Math.abs(this.touchDelta.x) > slideWidth / 2,
    647657                // Determine if slide attempt is past start or end:
    648                 isPastBounds = (!index && this.touchDelta.x > 0)
    649                         || (index === this.num - 1 && this.touchDelta.x < 0),
     658                isPastBounds = (!index && this.touchDelta.x > 0) ||
     659                        (index === this.num - 1 && this.touchDelta.x < 0),
    650660                isValidClose = !isValidSlide && this.options.closeOnSwipeUpOrDown &&
    651661                    ((isShortDuration && Math.abs(this.touchDelta.y) > 20) ||
  • blueimp-lightbox/trunk/lib/class-blueimp-lightbox.php

    r790215 r800505  
    11<?php
    22/**
    3  * Wordpress blueimp lightbox class 1.0.0
     3 * Wordpress blueimp lightbox class 1.0.1
    44 * http://blueimp.github.io/Gallery/
    55 *
     
    4747        $this->namespace = $this->options['namespace'];
    4848        $this->options_group = str_replace('-', '_', $this->namespace);
     49        // Check if the url returned by plugins_url contains the absolute path:
     50        if (strpos(
     51            plugins_url(null, $this->plugin_path),
     52            dirname($this->plugin_path)
     53        ) !== false) {
     54            // Add a filter to remove the absolute path to create valid plugin_urls:
     55            add_filter('plugins_url', array(&$this, 'plugins_url_symlink_fix'), 10, 3);
     56        }
    4957        add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts'));
    5058        add_action('wp_footer', array(&$this, 'add_lightbox_templates'));
     
    5664        add_action('admin_menu', array(&$this, 'add_menu'));
    5765        add_action('plugins_loaded', array(&$this, 'load_plugin_textdomain'));
     66    }
     67
     68    public function plugins_url_symlink_fix($url, $path, $plugin) {
     69        // Check if the plugins_url function is called for this plugin:
     70        if (strpos($plugin, basename($this->plugin_path)) !== false) {
     71            // Replace the absolute path of the symlinked plugin from the url:
     72            return str_replace(
     73                dirname($this->plugin_path),
     74                '/'.basename($plugin, '.php'),
     75                $url
     76            );
     77        }
     78        return $url;
    5879    }
    5980
     
    79100
    80101    public function add_lightbox_templates() {
     102        $templates_path = plugin_dir_path($this->plugin_path).'tmpl/';
    81103        foreach ($this->options['tmpl_files'] as $id) {
    82             readfile(plugins_url('tmpl/'.$id.'.html', $this->plugin_path));
     104            readfile($templates_path.$id.'.html');
    83105        }
    84106    }
  • blueimp-lightbox/trunk/readme.txt

    r790215 r800505  
    44Tags: lightbox,mobile,desktop,responsive,swipe,touch,mouse,keyboard,slideshow
    55Requires at least: 3.6.1
    6 Tested up to: 3.6.1
    7 Stable tag: 1.0.0
     6Tested up to: 3.7.1
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: http://opensource.org/licenses/GPL-2.0
     
    7272
    7373== Changelog ==
     74= 1.0.1 =
     75* Updated resource files to blueimp Gallery 2.11.5.
     76* Added a workaround for the plugin urls if the plugin is included via symlink.
     77* Replaced plugins_url with plugin_dir_path for the path to the HTML templates.
    7478= 1.0.0 =
    7579* Initial release.
    7680
    7781== Upgrade Notice ==
     82= 1.0.1 =
     83* Fixes issues when pausing YouTube videos in the lightbox.
     84* Fixes issues when the plugin is included via symlink.
     85* Fixes issues including the HTML template files.
    7886= 1.0.0 =
    7987* Initial release.
Note: See TracChangeset for help on using the changeset viewer.