Skip to content

Commit eb0dd27

Browse files
committed
Merge branch 'develop'
2 parents c02a76b + 6b06f44 commit eb0dd27

13 files changed

Lines changed: 174 additions & 75 deletions

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## 0.2.0
2+
3+
The primary feature in this release is the addition of a visual loader and the automatic lightboxing of external images. In prior versions, only images from the WordPress host domain were lightboxed automatically. This caused some problems with people using a CDN as the URLs were treated as external.
4+
5+
There have also been a handful of code improvements under the hood including:
6+
7+
- Added gallery support for Jetpack Tiled Galleries
8+
- Improved URL handling to match more image instances automatically
9+
- Fixed a mistake in the textdomain path
10+
- Improved admin metabox markup (props @GaryJones)
11+
- Fixed a typo in the main stylesheet's script handle (props @GaryJones)
12+
113
## 0.1.1
214

315
Fixed a bug that caused all WordPress galleries to open in a light box. Now only galleries which have been set to link to the media attachment are opened using Featherlight.

README.md

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,27 @@ An ultra lightweight jQuery lightbox for WordPress images and galleries.
44

55
__Contributors:__ [Robert Neu](https://github.com/robneu)
66
__Requires:__ WordPress 4.1
7-
__Tested up to:__ WordPress 4.1
7+
__Tested up to:__ WordPress 4.2.2
88
__License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)
99

10-
## Description ##
11-
12-
A WordPress plugin wrapper for the Featherlight jQuery lightbox plugin. This plugin automatically displays all standard WordPress images and galleries in a simple, minimalistic lightbox popup.
13-
14-
Featherlight is a very lightweight jQuery lightbox plugin. It's simple yet flexible and easy to use. Featherlight has minimal css and uses no inline styles, everything is name-spaced, it's completely customizable via config object and offers image, ajax and iframe support out of the box. Featherlight's small footprint weights about 4kB – in total.
15-
16-
For more information about the Featherlight script, check out their [GitHub plugin page](http://noelboss.github.io/featherlight/).
17-
18-
## Installation ##
19-
20-
### Upload ###
21-
22-
1. Download the [latest release](https://github.com/wpsitecare/wp-featherlight/archive/master.zip) from GitHub.
23-
2. Go to the __Plugins → Add New__ screen in your WordPress admin panel and click the __Upload__ tab at the top.
24-
3. Upload the zipped archive.
25-
4. Click the __Activate Plugin__ link after installation completes.
10+
![Lightbox Popup](https://cloud.githubusercontent.com/assets/2184093/7943642/6885759a-092b-11e5-943c-c9211653a1e4.png)
2611

27-
### Manual ###
12+
## Description ##
2813

29-
1. Download the [latest release](https://github.com/wpsitecare/wp-featherlight/archive/master.zip) from GitHub.
30-
2. Unzip the archive.
31-
3. Copy the folder to `/wp-content/plugins/`.
32-
4. Go to the __Plugins__ screen in your WordPress admin panel and click the __Activate__ link under WP Featherlight.
14+
WP Featherlight is a WordPress plugin wrapper for the Featherlight jQuery lightbox plugin. When installed, the plugin will automatically display all standard WordPress images and galleries in a simple, minimalistic lightbox popup. It's also possible to load Videos, iframes, and ajax content using WP Featherlight by adding data attributes to your content. For more details on custom content loading, check out the [featherlight documentation](https://github.com/noelboss/featherlight/#usage).
3315

34-
Read the Codex for more information about [installing plugins manually](http://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).
16+
There are no settings for WP Featherlight, so you should be able to install it without needing to configure anything. In the event you don't want a lightbox on certain pages or posts, there is an option to disable it from within the post editor screen.
3517

36-
### Git ###
18+
Here's an example of the plugin being used to load a large (5mb) external image in a standard WordPress post:
3719

38-
Clone this repository in `/wp-content/plugins/`:
20+
![Loader in Action](https://cloud.githubusercontent.com/assets/2184093/7943635/5ba2155e-092b-11e5-8b97-be5ca8cc77d8.gif)
3921

40-
`git clone https://github.com/wpsitecare/wp-featherlight.git`
22+
If you find a display problem, it may be related to your theme but please [open an issue](https://github.com/wpsitecare/wp-featherlight/issues) about it so we can look into it. For more information about the Featherlight script itself, check out their [GitHub plugin page](http://noelboss.github.io/featherlight/).
4123

42-
Then go to the __Plugins__ screen in your WordPress admin panel and click the __Activate__ link under WP Featherlight.
24+
## Installation ##
4325

44-
## Updating ##
26+
The best way to install this plugin is to either [download a copy](https://wordpress.org/plugins/wp-featherlight/) from the WordPress.org repository or search for "WP Featherlight" from your WordPress admin dashboard.
4527

46-
There are a couple of plugins for managing updates to GitHub-hosted plugins. Either of these should notify you when this plugin is updated:
28+
## Contributing ##
4729

48-
* [Git Plugin Updates](https://github.com/brainstormmedia/git-plugin-updates)
49-
* [GitHub Updater](https://github.com/afragen/github-updater)
30+
If you're a developer, the most current version can be found on the [develop branch](https://github.com/wpsitecare/wp-featherlight/tree/develop). Pull requests, issues, and any feedback is more than welcome. If you would like to contribute code, please make your pull requests against the develop branch rather than the master.

css/src/_featherlight.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/**
2+
* Featherlight Animations
3+
* Version 0.2.0
4+
*
5+
* Copyright 2015, WP Site Care
6+
* MIT Licensed.
7+
*/
8+
@import "parts/animation";
9+
10+
111
/**
212
* Featherlight - ultra slim jQuery lightbox
313
* Version 1.2.3 - http://noelboss.github.io/featherlight/

css/src/parts/_animation.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@keyframes featherlightLoader {
2+
0% {
3+
transform: rotate(0deg);
4+
}
5+
100% {
6+
transform: rotate(360deg);
7+
}
8+
}

css/src/parts/_base.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,27 @@
7979
border-bottom: 0;
8080
padding: 0;
8181
}
82+
83+
/* Animated Loader
84+
--------------------------------------------- */
85+
.featherlight-loading {
86+
.featherlight-content {
87+
animation: featherlightLoader 1s infinite linear;
88+
background: transparent;
89+
border: 8px solid #909090;
90+
border-left-color: #fff;
91+
font-size: 10px;
92+
}
93+
94+
.featherlight-content,
95+
.featherlight-content:after {
96+
border-radius: 50%;
97+
width: 10em;
98+
height: 10em;
99+
}
100+
101+
.featherlight-close,
102+
.featherlight-inner {
103+
display: none;
104+
}
105+
}

css/wp-featherlight.css

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
1+
/**
2+
* Featherlight Animations
3+
* Version 0.2.0
4+
*
5+
* Copyright 2015, WP Site Care
6+
* MIT Licensed.
7+
*/
8+
@-webkit-keyframes featherlightLoader {
9+
0% {
10+
-webkit-transform: rotate(0deg);
11+
transform: rotate(0deg);
12+
}
13+
14+
100% {
15+
-webkit-transform: rotate(360deg);
16+
transform: rotate(360deg);
17+
}
18+
}
19+
20+
@keyframes featherlightLoader {
21+
0% {
22+
-webkit-transform: rotate(0deg);
23+
transform: rotate(0deg);
24+
}
25+
26+
100% {
27+
-webkit-transform: rotate(360deg);
28+
transform: rotate(360deg);
29+
}
30+
}
31+
132
/**
233
* Featherlight - ultra slim jQuery lightbox
334
* Version 1.2.3 - http://noelboss.github.io/featherlight/
435
*
536
* Copyright 2015, Noel Raoul Bossart (http://www.noelboss.com)
637
* MIT Licensed.
738
*/
8-
939
.featherlight {
1040
background: transparent;
1141
cursor: pointer;
@@ -93,14 +123,38 @@
93123
}
94124

95125

126+
/* Animated Loader
127+
--------------------------------------------- */
128+
129+
.featherlight-loading .featherlight-content {
130+
-webkit-animation: featherlightLoader 1s infinite linear;
131+
animation: featherlightLoader 1s infinite linear;
132+
background: transparent;
133+
border: 8px solid #909090;
134+
border-left-color: #fff;
135+
font-size: 10px;
136+
}
137+
138+
.featherlight-loading .featherlight-content,
139+
.featherlight-loading .featherlight-content:after {
140+
-webkit-border-radius: 50%;
141+
border-radius: 50%;
142+
height: 10em;
143+
width: 10em;
144+
}
145+
146+
.featherlight-loading .featherlight-close,
147+
.featherlight-loading .featherlight-inner {
148+
display: none;
149+
}
150+
96151
/**
97152
* Featherlight Gallery - an extension for the ultra slim jQuery lightbox
98153
* Version 1.2.3 - http://noelboss.github.io/featherlight/
99154
*
100155
* Copyright 2015, Noel Raoul Bossart (http://www.noelboss.com)
101156
* MIT Licensed.
102157
*/
103-
104158
.featherlight-next,
105159
.featherlight-previous {
106160
background: transparent;

css/wp-featherlight.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/dist/wpFeatherlight.pkgd.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@
759759
/**
760760
* WP Featherlight - Loader and helpers for the Featherlight WordPress plugin
761761
*
762-
* @version Version 0.1.1
762+
* @version Version 0.2.0
763763
* @copyright Copyright 2015, Robert Neu (http://robneu.com)
764764
* @license MIT
765765
*/
@@ -775,10 +775,7 @@
775775
* @return mixed
776776
*/
777777
function testImages( index, element ) {
778-
if ( element.hostname && element.hostname !== location.hostname ) {
779-
return false;
780-
}
781-
return /(png|jpg|jpeg|gif|tiff|bmp)$/.test( $( element ).attr( 'href' ) );
778+
return /(png|jpg|jpeg|gif|tiff|bmp)$/.test( $( element ).attr( 'href' ).toLowerCase() );
782779
}
783780

784781
/**
@@ -800,17 +797,19 @@
800797
* @since 0.1.0
801798
* @return void
802799
*/
803-
function buildGalleries( index, value ) {
804-
var galleryID = $( value ).attr( 'id' ),
805-
$galleryItem = $( '#' + galleryID + ' .gallery-item a' );
800+
function buildGalleries( index, element ) {
801+
var $galleryObj = $( element ),
802+
$galleryItems = $galleryObj.find( '.gallery-item a' );
803+
804+
if ( $galleryItems.length === 0 ) {
805+
$galleryItems = $galleryObj.find( '.tiled-gallery-item a' );
806+
}
806807

807-
if ( ! $galleryItem.attr( 'data-featherlight' ) ) {
808+
if ( ! $galleryItems.attr( 'data-featherlight' ) ) {
808809
return;
809810
}
810811

811-
$galleryItem.featherlightGallery({
812-
openSpeed: 300
813-
});
812+
$galleryItems.featherlightGallery();
814813
}
815814

816815
/**
@@ -820,7 +819,7 @@
820819
* @return void
821820
*/
822821
function findGalleries() {
823-
var $gallery = $( '.gallery' );
822+
var $gallery = $( '.gallery, .tiled-gallery' );
824823

825824
if ( $gallery.length === 0 ) {
826825
return;
@@ -840,7 +839,7 @@
840839
findGalleries();
841840
}
842841

843-
$(document).ready(function() {
842+
$( document ).ready(function() {
844843
wpFeatherlightInit();
845844
});
846845
})( this, jQuery );

0 commit comments

Comments
 (0)