Changeset 800505
- Timestamp:
- 11/07/2013 04:37:25 PM (12 years ago)
- Location:
- blueimp-lightbox/trunk
- Files:
-
- 5 edited
-
blueimp-lightbox.php (modified) (1 diff)
-
js/blueimp-gallery-youtube.js (modified) (3 diffs)
-
js/blueimp-gallery.js (modified) (5 diffs)
-
lib/class-blueimp-lightbox.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
blueimp-lightbox/trunk/blueimp-lightbox.php
r790215 r800505 4 4 * Plugin URI: http://blueimp.github.io/Gallery/ 5 5 * Description: Official blueimp Gallery lightbox for Wordpress. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Text Domain: blueimp-lightbox 8 8 * Domain Path: /lang -
blueimp-lightbox/trunk/js/blueimp-gallery-youtube.js
r790215 r800505 1 1 /* 2 * blueimp Gallery YouTube Video Factory JS 1.1. 02 * blueimp Gallery YouTube Video Factory JS 1.1.1 3 3 * https://github.com/blueimp/Gallery 4 4 * … … 106 106 107 107 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 } 110 123 }, 111 124 … … 121 134 break; 122 135 } 136 // Save most recent state change to this.stateChange 137 this.stateChange = event.data; 123 138 }, 124 139 -
blueimp-lightbox/trunk/js/blueimp-gallery.js
r790215 r800505 1 1 /* 2 * blueimp Gallery JS 2.11. 02 * blueimp Gallery JS 2.11.5 3 3 * https://github.com/blueimp/Gallery 4 4 * … … 211 211 } 212 212 }, 213 prop,214 transition,215 translateZ,216 213 elementTests = function () { 214 var transition = support.transition, 215 prop, 216 translateZ; 217 217 document.body.appendChild(element); 218 218 if (transition) { … … 243 243 document.body.removeChild(element); 244 244 }; 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)); 254 256 if (document.body) { 255 257 elementTests(); … … 386 388 add: function (list) { 387 389 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 } 388 398 this.list = this.list.concat(list); 389 399 this.num = this.list.length; … … 646 656 Math.abs(this.touchDelta.x) > slideWidth / 2, 647 657 // 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), 650 660 isValidClose = !isValidSlide && this.options.closeOnSwipeUpOrDown && 651 661 ((isShortDuration && Math.abs(this.touchDelta.y) > 20) || -
blueimp-lightbox/trunk/lib/class-blueimp-lightbox.php
r790215 r800505 1 1 <?php 2 2 /** 3 * Wordpress blueimp lightbox class 1.0. 03 * Wordpress blueimp lightbox class 1.0.1 4 4 * http://blueimp.github.io/Gallery/ 5 5 * … … 47 47 $this->namespace = $this->options['namespace']; 48 48 $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 } 49 57 add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts')); 50 58 add_action('wp_footer', array(&$this, 'add_lightbox_templates')); … … 56 64 add_action('admin_menu', array(&$this, 'add_menu')); 57 65 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; 58 79 } 59 80 … … 79 100 80 101 public function add_lightbox_templates() { 102 $templates_path = plugin_dir_path($this->plugin_path).'tmpl/'; 81 103 foreach ($this->options['tmpl_files'] as $id) { 82 readfile( plugins_url('tmpl/'.$id.'.html', $this->plugin_path));104 readfile($templates_path.$id.'.html'); 83 105 } 84 106 } -
blueimp-lightbox/trunk/readme.txt
r790215 r800505 4 4 Tags: lightbox,mobile,desktop,responsive,swipe,touch,mouse,keyboard,slideshow 5 5 Requires at least: 3.6.1 6 Tested up to: 3. 6.17 Stable tag: 1.0. 06 Tested up to: 3.7.1 7 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://opensource.org/licenses/GPL-2.0 … … 72 72 73 73 == 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. 74 78 = 1.0.0 = 75 79 * Initial release. 76 80 77 81 == 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. 78 86 = 1.0.0 = 79 87 * Initial release.
Note: See TracChangeset
for help on using the changeset viewer.