├── css ├── wp-featherlight-rtl.css.map ├── wp-featherlight.min.css ├── wp-featherlight-rtl.min.css ├── wp-featherlight-rtl.css └── wp-featherlight.css ├── languages ├── wp-featherlight-de_DE.mo ├── wp-featherlight-es_ES.mo ├── wp-featherlight-fr_FR .mo ├── wp-featherlight-fr_FR.mo ├── wp-featherlight-pl_PL.mo ├── wp-featherlight-pt_BR.mo ├── wp-featherlight.pot └── src │ ├── wp-featherlight-fr_FR.po │ ├── wp-featherlight-es_ES.po │ └── wp-featherlight-pt_BR.po ├── .gitignore ├── assets └── plugin │ ├── css │ ├── variables │ │ ├── _colors.scss │ │ └── _icons.scss │ ├── wp-featherlight.scss │ └── partials │ │ ├── _animation.scss │ │ ├── _gallery.scss │ │ └── _base.scss │ ├── js │ └── wpFeatherlight.js │ └── .scss-lint.yml ├── config ├── .jshintrc └── grunt │ ├── concat.js │ ├── version.js │ ├── aliases.js │ ├── replace.js │ └── copy.js ├── gruntfile.js ├── .jshintrc ├── CONTRIBUTING.md ├── composer.json ├── includes ├── constants.php ├── class-i18n.php ├── class-scripts.php └── class-plugin.php ├── admin ├── views │ └── meta-box.php └── class-meta.php ├── js ├── vendor │ ├── jquery.detect_swipe.min.js │ ├── jquery.detect_swipe.js │ ├── featherlight.gallery.min.js │ ├── featherlight.gallery.js │ ├── featherlight.min.js │ └── featherlight.js ├── wpFeatherlight.min.js ├── wpFeatherlight.js └── wpFeatherlight.pkgd.min.js ├── package.json ├── wp-featherlight.php ├── README.md ├── .jscsrc ├── composer.lock ├── CHANGELOG.md └── readme.txt /css/wp-featherlight-rtl.css.map: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /languages/wp-featherlight-de_DE.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cipherdevgroup/wp-featherlight/HEAD/languages/wp-featherlight-de_DE.mo -------------------------------------------------------------------------------- /languages/wp-featherlight-es_ES.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cipherdevgroup/wp-featherlight/HEAD/languages/wp-featherlight-es_ES.mo -------------------------------------------------------------------------------- /languages/wp-featherlight-fr_FR .mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cipherdevgroup/wp-featherlight/HEAD/languages/wp-featherlight-fr_FR .mo -------------------------------------------------------------------------------- /languages/wp-featherlight-fr_FR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cipherdevgroup/wp-featherlight/HEAD/languages/wp-featherlight-fr_FR.mo -------------------------------------------------------------------------------- /languages/wp-featherlight-pl_PL.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cipherdevgroup/wp-featherlight/HEAD/languages/wp-featherlight-pl_PL.mo -------------------------------------------------------------------------------- /languages/wp-featherlight-pt_BR.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cipherdevgroup/wp-featherlight/HEAD/languages/wp-featherlight-pt_BR.mo -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .sass-cache 3 | 4 | # Development files 5 | node_modules/ 6 | bower_components/ 7 | 8 | # Development directories 9 | release/ 10 | docs/ 11 | assets/bower/ 12 | assets/composer/ 13 | -------------------------------------------------------------------------------- /assets/plugin/css/variables/_colors.scss: -------------------------------------------------------------------------------- 1 | $underlay-background-color: rgba( 0, 0, 0, 0.90 ); 2 | $content-background-color: #000; 3 | $caption-text-color: #fff; 4 | $loader-primary-color: #909090; 5 | $loader-secondary-color: #fff; 6 | -------------------------------------------------------------------------------- /config/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "boss": true, 3 | "curly": true, 4 | "eqeqeq": true, 5 | "eqnull": true, 6 | "immed": true, 7 | "latedef": true, 8 | "newcap": true, 9 | "noarg": true, 10 | "quotmark": "single", 11 | "sub": true, 12 | "undef": true, 13 | "unused": true, 14 | 15 | "node": true 16 | } 17 | -------------------------------------------------------------------------------- /gruntfile.js: -------------------------------------------------------------------------------- 1 | /*jshint node:true */ 2 | 3 | module.exports = function( grunt ) { 4 | 'use strict'; 5 | 6 | var loader = require( 'load-project-config' ), 7 | config = require( 'cipher-plugin-config' ); 8 | 9 | loader( grunt, config ).init({ 10 | pkg: grunt.file.readJSON( 'package.json' ) 11 | }); 12 | }; 13 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "boss": true, 3 | "curly": true, 4 | "eqeqeq": true, 5 | "eqnull": true, 6 | "es3": true, 7 | "expr": true, 8 | "immed": true, 9 | "noarg": true, 10 | "onevar": false, 11 | "quotmark": "single", 12 | "trailing": true, 13 | "undef": true, 14 | "unused": true, 15 | 16 | "browser": true, 17 | 18 | "globals": { 19 | "_": false, 20 | "Backbone": false, 21 | "jQuery": false, 22 | "JSON": false, 23 | "wp": false 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /assets/plugin/css/wp-featherlight.scss: -------------------------------------------------------------------------------- 1 | /**! 2 | * Plugin Name: WP Featherlight 3 | * Version: 1.3.4 4 | * Author: Cipher 5 | * License: GPL-2.0+ 6 | */ 7 | 8 | @import "variables/colors"; 9 | @import "variables/icons"; 10 | 11 | /* Base Styles 12 | --------------------------------------------- */ 13 | @import "partials/base"; 14 | 15 | 16 | /* Animated Loader 17 | --------------------------------------------- */ 18 | @import "partials/animation"; 19 | 20 | 21 | /* Gallery 22 | --------------------------------------------- */ 23 | @import "partials/gallery"; 24 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to WP Featherlight 2 | 3 | :+1::tada: First off, thanks for taking the time to contribute! :tada::+1: 4 | 5 | Please make all pull requests against the develop branch. These are the steps required to get up and running with the development version of the plugin: 6 | 7 | - Clone forked repo 8 | - Run `yarn install` 9 | - Run `bower install` 10 | - Run `grunt build` 11 | - Commit all changes and generated files and create a pull request against `develop` 12 | 13 | If you run into any issues or have any questions, please open an issue. 14 | 15 | Thanks again! 16 | -------------------------------------------------------------------------------- /config/grunt/concat.js: -------------------------------------------------------------------------------- 1 | // https://github.com/gruntjs/grunt-contrib-concat 2 | module.exports = { 3 | js: { 4 | src: [ 5 | '<%= paths.jsVend %>jquery.detect_swipe.js', 6 | '<%= paths.jsVend %>featherlight.js', 7 | '<%= paths.jsVend %>featherlight.gallery.js', 8 | '<%= paths.jsSrc %>wpFeatherlight.js' 9 | ], 10 | dest: '<%= paths.jsDist %><%= pkg.nameCamelLow %>.pkgd.js' 11 | }, 12 | adminjs: { 13 | src: [ 14 | '<%= paths.jsSrc %>admin/**/*.js', 15 | '!<%= paths.jsSrc %>**/*.min.js' 16 | ], 17 | dest: '<%= paths.jsDist %><%= pkg.nameCamelLow %>Admin.pkgd.js' 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cipherdevgroup/wp-featherlight", 3 | "description": "An ultra lightweight jQuery lightbox for WordPress images and galleries.", 4 | "type": "wordpress-plugin", 5 | "homepage" : "https://cipherdevelopment.com", 6 | "license" : "GPL-2.0+", 7 | "authors" : [ 8 | { 9 | "name" : "Robert Neu", 10 | "email" : "rob@cipherdevelopment.com" 11 | } 12 | ], 13 | "support" : { 14 | "issues" : "https://github.com/cipherdevgroup/wp-featherlight/issues" 15 | }, 16 | "config": { 17 | "vendor-dir": "includes/vendor" 18 | }, 19 | "require": { 20 | "composer/installers": "~1.0" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /includes/constants.php: -------------------------------------------------------------------------------- 1 | get_file() ); 12 | define( 'WP_FEATHERLIGHT_VERSION', wp_featherlight()->get_version() ); 13 | 14 | if ( ! defined( 'WP_FEATHERLIGHT_DIR' ) ) { 15 | define( 'WP_FEATHERLIGHT_DIR', wp_featherlight()->get_dir() ); 16 | } 17 | 18 | if ( ! defined( 'WP_FEATHERLIGHT_URL' ) ) { 19 | define( 'WP_FEATHERLIGHT_URL', wp_featherlight()->get_url() ); 20 | } 21 | -------------------------------------------------------------------------------- /config/grunt/version.js: -------------------------------------------------------------------------------- 1 | // https://github.com/kswedberg/grunt-version 2 | module.exports = { 3 | options: { 4 | pkg: { 5 | version: '<%= package.version %>' 6 | } 7 | }, 8 | project: { 9 | src: [ 10 | 'package.json', 11 | 'bower.json' 12 | ] 13 | }, 14 | phpConstant: { 15 | options: { 16 | prefix: 'VERSION\\s+=\\s+\'' 17 | }, 18 | src: [ 19 | 'includes/class-plugin.php' 20 | ] 21 | }, 22 | style: { 23 | options: { 24 | prefix: '\\s+\\*\\s+Version:\\s+' 25 | }, 26 | src: [ 27 | 'wp-featherlight.php', 28 | '<%= paths.cssSrc %>wp-featherlight.scss' 29 | ] 30 | }, 31 | readme: { 32 | options: { 33 | prefix: 'Stable tag:\\s+' 34 | }, 35 | src: [ 36 | 'readme.txt' 37 | ] 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /admin/views/meta-box.php: -------------------------------------------------------------------------------- 1 | 12 |
13 | 17 |
18 | 19 | -------------------------------------------------------------------------------- /assets/plugin/css/partials/_animation.scss: -------------------------------------------------------------------------------- 1 | @keyframes featherlightLoader { 2 | 0% { 3 | transform: rotate( 0deg ); 4 | } 5 | 6 | 100% { 7 | transform: rotate( 360deg ); 8 | } 9 | } 10 | 11 | @keyframes fadein { 12 | from { 13 | opacity: 0; 14 | } 15 | 16 | to { 17 | opacity: 1; 18 | } 19 | } 20 | 21 | .featherlight-loading { 22 | .featherlight-content { 23 | animation: featherlightLoader 1s infinite linear; 24 | background: transparent; 25 | border: 8px solid $loader-primary-color; 26 | border-left-color: $loader-secondary-color; 27 | font-size: 10px; 28 | } 29 | 30 | .featherlight-content, 31 | .featherlight-content::after { 32 | border-radius: 50%; 33 | height: 10em; 34 | width: 10em; 35 | } 36 | 37 | .featherlight-close, 38 | .featherlight-inner { 39 | display: none; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /config/grunt/aliases.js: -------------------------------------------------------------------------------- 1 | module.exports = function() { 2 | 'use strict'; 3 | var tasks = { 4 | 'build:dependencies:fonts': [ 5 | 'clean:fonts', 6 | 'copy:fonts' 7 | ], 8 | 'build:dependencies:css': [ 9 | 'clean:css', 10 | 'copy:css' 11 | ], 12 | 'build:dependencies:js': [ 13 | 'clean:js', 14 | 'copy:js' 15 | ], 16 | 'build:fonts': [ 17 | 'build:dependencies:fonts' 18 | ], 19 | 'build:css': [ 20 | 'build:dependencies:css', 21 | 'newer:sass', 22 | 'newer:postcss', 23 | 'newer:rtlcss', 24 | 'newer:cssmin', 25 | 'newer:copy:css' 26 | ], 27 | 'build:images': [ 28 | 'newer:imagemin:images' 29 | ], 30 | 'build:js': [ 31 | 'build:dependencies:js', 32 | 'newer:copy:js', 33 | 'newer:concat:js', 34 | 'newer:concat:adminjs', 35 | 'newer:uglify' 36 | ] 37 | }; 38 | 39 | return tasks; 40 | }; 41 | -------------------------------------------------------------------------------- /assets/plugin/css/variables/_icons.scss: -------------------------------------------------------------------------------- 1 | $close-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M21%204.41L19.59%203%2012%2010.59%204.41%203%203%204.41%2010.59%2012%203%2019.59%204.41%2021%2012%2013.41%2019.59%2021%2021%2019.59%2013.41%2012%2021%204.41z%22/%3E%0A%3C/svg%3E"); 2 | $next-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M8.59%2016.59L13.17%2012%208.59%207.41%2010%206l6%206-6%206-1.41-1.41z%22/%3E%0A%3C/svg%3E"); 3 | $prev-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M15.41%207.41L10.83%2012l4.58%204.59L14%2018l-6-6%206-6%201.41%201.41z%22/%3E%0A%3C/svg%3E"); 4 | -------------------------------------------------------------------------------- /assets/plugin/css/partials/_gallery.scss: -------------------------------------------------------------------------------- 1 | .featherlight-next, 2 | .featherlight-previous { 3 | background-color: transparent; 4 | background-repeat: no-repeat; 5 | background-size: 100% auto; 6 | cursor: pointer; 7 | display: block; 8 | height: 60px; 9 | margin-top: -30px; 10 | opacity: 0.4; 11 | overflow: hidden; 12 | position: fixed; 13 | text-indent: 100%; 14 | top: 50%; 15 | user-select: none; 16 | white-space: nowrap; 17 | width: 60px; 18 | 19 | span { 20 | display: none; 21 | } 22 | 23 | &:hover, 24 | &:focus { 25 | opacity: 1; 26 | } 27 | } 28 | 29 | /* rtl:ignore */ 30 | .featherlight-next { 31 | background-image: $next-icon; 32 | background-position: 0 0; 33 | right: 10px; 34 | } 35 | 36 | /* rtl:ignore */ 37 | .featherlight-previous { 38 | background-image: $prev-icon; 39 | background-position: -5px 0; 40 | left: 10px; 41 | } 42 | 43 | .featherlight-loading { 44 | 45 | .featherlight-previous, 46 | .featherlight-next { 47 | display: none; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /js/vendor/jquery.detect_swipe.min.js: -------------------------------------------------------------------------------- 1 | !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(h){var c,r,d=!(h.detectSwipe={version:"2.1.2",enabled:"ontouchstart"in document.documentElement,preventDefault:!0,threshold:20});function p(){this.removeEventListener("touchmove",t),this.removeEventListener("touchend",p),d=!1}function t(e){if(h.detectSwipe.preventDefault&&e.preventDefault(),d){var t,n=e.touches[0].pageX,i=e.touches[0].pageY,o=c-n,s=r-i,u=window.devicePixelRatio||1;Math.abs(o)*u>=h.detectSwipe.threshold?t=0=h.detectSwipe.threshold&&(t=0').appendTo(t.find(".featherlight-content"))[0].innerHTML=e.html())})}a(document).ready(function(){f()})}(0,jQuery); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "nameSpaced": "WP Featherlight", 3 | "nameSpacedLow": "wp featherlight", 4 | "nameDashed": "wp-featherlight", 5 | "nameUscore": "wp_featherlight", 6 | "nameUscoreCam": "WP_Featherlight", 7 | "nameCamel": "WPFeatherlight", 8 | "nameCamelLow": "wpFeatherlight", 9 | "version": "1.3.4", 10 | "copyright": "2020", 11 | "license": "GPL-2.0+", 12 | "private": true, 13 | "bugs": { 14 | "url": "https://cipherdevelopment.com/support/", 15 | "email": "hello@cipherdevelopment.com" 16 | }, 17 | "contributors": [ 18 | { 19 | "name": "Robert Neu", 20 | "url": "https://cipherdevelopment.com" 21 | }, 22 | { 23 | "name": "Ozzy Rodriguez", 24 | "url": "https://cipherdevelopment.com" 25 | }, 26 | { 27 | "name": "Cipher", 28 | "url": "https://cipherdevelopment.com" 29 | } 30 | ], 31 | "repository": { 32 | "type": "git", 33 | "url": "https://github.com/cipherdevgroup/wp-featherlight.git" 34 | }, 35 | "dependencies": { 36 | "detect_swipe": "~2.1.4", 37 | "featherlight": "1.7.13" 38 | }, 39 | "devDependencies": { 40 | "cipher-plugin-config": "cipherdevgroup/cipher-plugin-config", 41 | "load-project-config": "~0.2.0" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /config/grunt/replace.js: -------------------------------------------------------------------------------- 1 | // https://github.com/outaTiME/grunt-replace 2 | module.exports = { 3 | // Useful when forking this project into a new project 4 | packagename: { 5 | options: { 6 | patterns: [ 7 | { 8 | match: /WP Featherlight/g, 9 | replacement: '<%= pkg.nameSpaced %>' 10 | }, 11 | { 12 | match: /wp featherlight/g, 13 | replacement: '<%= pkg.nameSpacedLow %>' 14 | }, 15 | { 16 | match: /wp-featherlight/g, 17 | replacement: '<%= pkg.nameDashed %>' 18 | }, 19 | { 20 | match: /wp_featherlight/g, 21 | replacement: '<%= pkg.nameUscore %>' 22 | }, 23 | { 24 | match: /WP_Featherlight/g, 25 | replacement: '<%= pkg.nameUscoreCam %>' 26 | }, 27 | { 28 | match: /WPFeatherlight/g, 29 | replacement: '<%= pkg.nameCamel %>' 30 | }, 31 | { 32 | match: /wpFeatherlight/g, 33 | replacement: '<%= pkg.nameCamelLow %>' 34 | } 35 | ] 36 | }, 37 | files: [ 38 | { 39 | expand: true, 40 | src: [ 41 | '**', 42 | '.*', 43 | '!<%= paths.bower %>**/*', 44 | '!**/*.{png,ico,jpg,gif}', 45 | '!node_modules/**', 46 | '!bower_components/**', 47 | '!.sass-cache/**', 48 | '!dist/**', 49 | '!logs/**', 50 | '!tmp/**', 51 | '!*.sublime*', 52 | '!.idea/**', 53 | '!.DS_Store' 54 | ] 55 | } 56 | ] 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /languages/wp-featherlight.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Cipher 2 | # This file is distributed under the GPL-2.0+. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: WP Featherlight 1.3.4\n" 6 | "Report-Msgid-Bugs-To: https://cipherdevelopment.com/contact/\n" 7 | "POT-Creation-Date: 2020-08-08 17:45:15+00:00\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=utf-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n" 12 | "Last-Translator: Cipher \n" 13 | "Language-Team: Cipher \n" 14 | "Language: en\n" 15 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 16 | "X-Poedit-Country: United States\n" 17 | "X-Poedit-SourceCharset: UTF-8\n" 18 | "X-Poedit-KeywordsList: " 19 | "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_" 20 | "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n" 21 | "X-Poedit-Basepath: ../\n" 22 | "X-Poedit-SearchPath-0: .\n" 23 | "X-Poedit-Bookmarks: \n" 24 | "X-Textdomain-Support: yes\n" 25 | "X-Generator: grunt-wp-i18n 1.0.3\n" 26 | 27 | #. Plugin Name of the plugin/theme 28 | msgid "WP Featherlight" 29 | msgstr "" 30 | 31 | #: admin/views/meta-box.php:15 32 | msgid "Disable lightbox" 33 | msgstr "" 34 | 35 | #. Plugin URI of the plugin/theme 36 | msgid "https://wpfeatherlight.cipherdevelopment.com" 37 | msgstr "" 38 | 39 | #. Description of the plugin/theme 40 | msgid "An ultra lightweight jQuery lightbox for WordPress images and galleries." 41 | msgstr "" -------------------------------------------------------------------------------- /languages/src/wp-featherlight-fr_FR.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Cipher 2 | # This file is distributed under the GPL-2.0+. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: WP Featherlight 0.3.0\n" 6 | "Report-Msgid-Bugs-To: Robert Neu \n" 7 | "POT-Creation-Date: 2015-08-22 12:05-0600\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2015-08-22 12:06-0600\n" 12 | "Language-Team: Robert Neu \n" 13 | "X-Generator: Poedit 1.8.4\n" 14 | "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c\n" 15 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-Basepath: ..\n" 18 | "X-Textdomain-Support: yes\n" 19 | "Last-Translator: \n" 20 | "Language: fr\n" 21 | "X-Poedit-SearchPath-0: .\n" 22 | 23 | #: admin/class-meta.php:66 24 | msgid "WP Featherlight Options" 25 | msgstr "Options de WP Featherlight" 26 | 27 | #: admin/templates/metabox-sidebar.php:15 28 | msgid "Disable lightbox" 29 | msgstr "Désactiver Lightbox" 30 | 31 | #. Plugin Name of the plugin/theme 32 | msgid "WP Featherlight" 33 | msgstr "WP Featherlight" 34 | 35 | #. Plugin URI of the plugin/theme 36 | msgid "https://cipherdevelopment.com/wp-featherlight/" 37 | msgstr "https://cipherdevelopment.com/wp-featherlight/" 38 | 39 | #. Description of the plugin/theme 40 | msgid "An ultra lightweight jQuery lightbox for WordPress images and galleries." 41 | msgstr "Un ultra léger jQuery lightbox pour WordPress images et galeries." 42 | 43 | #. Author of the plugin/theme 44 | msgid "Cipher" 45 | msgstr "Cipher" 46 | 47 | #. Author URI of the plugin/theme 48 | msgid "https://cipherdevelopment.com" 49 | msgstr "https://cipherdevelopment.com" 50 | -------------------------------------------------------------------------------- /languages/src/wp-featherlight-es_ES.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Cipher 2 | # This file is distributed under the GPL-2.0+. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: WP Featherlight 0.3.0\n" 6 | "Report-Msgid-Bugs-To: Robert Neu \n" 7 | "POT-Creation-Date: 2015-08-22 11:58-0600\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2015-08-22 12:00-0600\n" 12 | "Language-Team: Robert Neu \n" 13 | "X-Generator: Poedit 1.8.4\n" 14 | "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c\n" 15 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-Basepath: ..\n" 18 | "X-Textdomain-Support: yes\n" 19 | "Last-Translator: \n" 20 | "Language: es\n" 21 | "X-Poedit-SearchPath-0: .\n" 22 | 23 | #: admin/class-meta.php:66 24 | msgid "WP Featherlight Options" 25 | msgstr "Opciones de WP Featherlight" 26 | 27 | #: admin/templates/metabox-sidebar.php:15 28 | msgid "Disable lightbox" 29 | msgstr "Desactivar lightbox" 30 | 31 | #. Plugin Name of the plugin/theme 32 | msgid "WP Featherlight" 33 | msgstr "WP Featherlight" 34 | 35 | #. Plugin URI of the plugin/theme 36 | msgid "https://cipherdevelopment.com/wp-featherlight/" 37 | msgstr "https://cipherdevelopment.com/wp-featherlight/" 38 | 39 | #. Description of the plugin/theme 40 | msgid "An ultra lightweight jQuery lightbox for WordPress images and galleries." 41 | msgstr "Un ultra ligero jQuery lightbox para WordPress imágenes y galerías." 42 | 43 | #. Author of the plugin/theme 44 | msgid "Cipher" 45 | msgstr "Cipher" 46 | 47 | #. Author URI of the plugin/theme 48 | msgid "https://cipherdevelopment.com" 49 | msgstr "https://cipherdevelopment.com" 50 | -------------------------------------------------------------------------------- /languages/src/wp-featherlight-pt_BR.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Cipher 2 | # This file is distributed under the GPL-2.0+. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: WP Featherlight 0.3.0\n" 6 | "Report-Msgid-Bugs-To: Robert Neu \n" 7 | "POT-Creation-Date: 2015-08-22 12:00-0600\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2015-08-22 12:04-0600\n" 12 | "Language-Team: Robert Neu \n" 13 | "X-Generator: Poedit 1.8.4\n" 14 | "X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c\n" 15 | "Plural-Forms: nplurals=2; plural=(n > 1);\n" 16 | "X-Poedit-SourceCharset: UTF-8\n" 17 | "X-Poedit-Basepath: ..\n" 18 | "X-Textdomain-Support: yes\n" 19 | "Last-Translator: \n" 20 | "Language: pt_BR\n" 21 | "X-Poedit-SearchPath-0: .\n" 22 | 23 | #: admin/class-meta.php:66 24 | msgid "WP Featherlight Options" 25 | msgstr "Opções de WP Featherlight" 26 | 27 | #: admin/templates/metabox-sidebar.php:15 28 | msgid "Disable lightbox" 29 | msgstr "Desativar Efeito Lightbox" 30 | 31 | #. Plugin Name of the plugin/theme 32 | msgid "WP Featherlight" 33 | msgstr "WP Featherlight" 34 | 35 | #. Plugin URI of the plugin/theme 36 | msgid "https://cipherdevelopment.com/wp-featherlight/" 37 | msgstr "https://cipherdevelopment.com/wp-featherlight/" 38 | 39 | #. Description of the plugin/theme 40 | msgid "An ultra lightweight jQuery lightbox for WordPress images and galleries." 41 | msgstr "Um ultra leve jQuery lightbox para WordPress imagens e galerias." 42 | 43 | #. Author of the plugin/theme 44 | msgid "Cipher" 45 | msgstr "Cipher" 46 | 47 | #. Author URI of the plugin/theme 48 | msgid "https://cipherdevelopment.com" 49 | msgstr "https://cipherdevelopment.com" 50 | -------------------------------------------------------------------------------- /wp-featherlight.php: -------------------------------------------------------------------------------- 1 | scripts; ?> 37 | * 38 | * @since 0.1.0 39 | * @access public 40 | * @uses WP_Featherlight 41 | * @return object WP_Featherlight A single instance of the main plugin class. 42 | */ 43 | function wp_featherlight() { 44 | static $plugin; 45 | if ( null === $plugin ) { 46 | $plugin = new WP_Featherlight( array( 'file' => __FILE__ ) ); 47 | } 48 | return $plugin; 49 | } 50 | 51 | /** 52 | * Register an activation hook to run all necessary plugin setup procedures. 53 | * 54 | * @since 0.1.0 55 | * @access public 56 | * @return void 57 | */ 58 | register_activation_hook( __FILE__, array( wp_featherlight(), 'activate' ) ); 59 | -------------------------------------------------------------------------------- /includes/class-i18n.php: -------------------------------------------------------------------------------- 1 | text_domain = $text_domain; 39 | $this->plugin_file = $plugin_file; 40 | } 41 | 42 | /** 43 | * Loads translation file. 44 | * 45 | * @since 0.3.0 46 | * @access public 47 | * @return bool true when the file was found, false otherwise. 48 | */ 49 | public function load() { 50 | return load_plugin_textdomain( 51 | $this->text_domain, 52 | false, 53 | dirname( plugin_basename( $this->plugin_file ) ) . '/languages' 54 | ); 55 | } 56 | 57 | /** 58 | * Remove translations from memory. 59 | * 60 | * @since 0.3.0 61 | * @access public 62 | * @return bool true if the text domain was loaded, false if it was not. 63 | */ 64 | public function unload() { 65 | return unload_textdomain( $this->text_domain ); 66 | } 67 | 68 | /** 69 | * Whether or not the language has been loaded already. 70 | * 71 | * @since 0.3.0 72 | * @access public 73 | * @return bool 74 | */ 75 | public function is_loaded() { 76 | return is_textdomain_loaded( $this->text_domain ); 77 | } 78 | 79 | /** 80 | * Get the class running! 81 | * 82 | * @since 0.3.0 83 | * @access public 84 | * @return void 85 | */ 86 | public function run() { 87 | _deprecated_function( __METHOD__, '1.0.0' ); 88 | } 89 | 90 | /** 91 | * Hook into WordPress. 92 | * 93 | * @since 0.3.0 94 | * @access protected 95 | * @return void 96 | */ 97 | protected function wp_hooks() { 98 | _deprecated_function( __METHOD__, '1.0.0' ); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /js/vendor/jquery.detect_swipe.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jquery.detectSwipe v2.1.3 3 | * jQuery Plugin to obtain touch gestures from iPhone, iPod Touch, iPad and Android 4 | * http://github.com/marcandre/detect_swipe 5 | * Based on touchwipe by Andreas Waltl, netCU Internetagentur (http://www.netcu.de) 6 | */ 7 | 8 | (function (factory) { 9 | if (typeof define === 'function' && define.amd) { 10 | // AMD. Register as an anonymous module. 11 | define(['jquery'], factory); 12 | } else if (typeof exports === 'object') { 13 | // Node/CommonJS 14 | module.exports = factory(require('jquery')); 15 | } else { 16 | // Browser globals 17 | factory(jQuery); 18 | } 19 | }(function($) { 20 | 21 | $.detectSwipe = { 22 | version: '2.1.2', 23 | enabled: 'ontouchstart' in document.documentElement, 24 | preventDefault: true, 25 | threshold: 20 26 | }; 27 | 28 | var startX, 29 | startY, 30 | isMoving = false; 31 | 32 | function onTouchEnd() { 33 | this.removeEventListener('touchmove', onTouchMove); 34 | this.removeEventListener('touchend', onTouchEnd); 35 | isMoving = false; 36 | } 37 | 38 | function onTouchMove(e) { 39 | if ($.detectSwipe.preventDefault) { e.preventDefault(); } 40 | if(isMoving) { 41 | var x = e.touches[0].pageX; 42 | var y = e.touches[0].pageY; 43 | var dx = startX - x; 44 | var dy = startY - y; 45 | var dir; 46 | var ratio = window.devicePixelRatio || 1; 47 | if(Math.abs(dx) * ratio >= $.detectSwipe.threshold) { 48 | dir = dx > 0 ? 'left' : 'right' 49 | } 50 | else if(Math.abs(dy) * ratio >= $.detectSwipe.threshold) { 51 | dir = dy > 0 ? 'up' : 'down' 52 | } 53 | if(dir) { 54 | onTouchEnd.call(this); 55 | $(this).trigger('swipe', dir).trigger('swipe' + dir); 56 | } 57 | } 58 | } 59 | 60 | function onTouchStart(e) { 61 | if (e.touches.length == 1) { 62 | startX = e.touches[0].pageX; 63 | startY = e.touches[0].pageY; 64 | isMoving = true; 65 | this.addEventListener('touchmove', onTouchMove, false); 66 | this.addEventListener('touchend', onTouchEnd, false); 67 | } 68 | } 69 | 70 | function setup() { 71 | this.addEventListener && this.addEventListener('touchstart', onTouchStart, false); 72 | } 73 | 74 | function teardown() { 75 | this.removeEventListener('touchstart', onTouchStart); 76 | } 77 | 78 | $.event.special.swipe = { setup: setup }; 79 | 80 | $.each(['left', 'up', 'down', 'right'], function () { 81 | $.event.special['swipe' + this] = { setup: function(){ 82 | $(this).on('swipe', $.noop); 83 | } }; 84 | }); 85 | })); 86 | -------------------------------------------------------------------------------- /js/vendor/featherlight.gallery.min.js: -------------------------------------------------------------------------------- 1 | !function(r){"use strict";var e=function(e){window.console&&window.console.warn&&window.console.warn("FeatherlightGallery: "+e)};if(void 0===r)return e("Too much lightness, Featherlight needs jQuery.");if(!r.featherlight)return e("Load the featherlight plugin before the gallery plugin");var t="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,n=r.event&&r.event.special.swipeleft&&r,i=window.Hammer&&function(e){var t=new window.Hammer.Manager(e[0]);return t.add(new window.Hammer.Swipe),t},a=t&&(n||i);t&&!a&&e("No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.");var s={afterClose:function(e,t){var n=this;return n.$instance.off("next."+n.namespace+" previous."+n.namespace),n._swiper&&(n._swiper.off("swipeleft",n._swipeleft).off("swiperight",n._swiperight),n._swiper=null),e(t)},beforeOpen:function(e,t){var n=this;return n.$instance.on("next."+n.namespace+" previous."+n.namespace,function(e){var t="next"===e.type?1:-1;n.navigateTo(n.currentNavigation()+t)}),a&&(n._swiper=a(n.$instance).on("swipeleft",n._swipeleft=function(){n.$instance.trigger("next")}).on("swiperight",n._swiperight=function(){n.$instance.trigger("previous")}),n.$instance.addClass(this.namespace+"-swipe-aware",a)),n.$instance.find("."+n.namespace+"-content").append(n.createNavigation("previous")).append(n.createNavigation("next")),e(t)},beforeContent:function(e,t){var n=this.currentNavigation(),i=this.slides().length;return this.$instance.toggleClass(this.namespace+"-first-slide",0===n).toggleClass(this.namespace+"-last-slide",n===i-1),e(t)},onKeyUp:function(e,t){var n={37:"previous",39:"next"}[t.keyCode];return n?(this.$instance.trigger(n),!1):e(t)}};function o(e,t){if(!(this instanceof o)){var n=new o(r.extend({$source:e,$currentTarget:e.first()},t));return n.open(),n}r.featherlight.apply(this,arguments),this.chainCallbacks(s)}r.featherlight.extend(o,{autoBind:"[data-featherlight-gallery]"}),r.extend(o.prototype,{previousIcon:"◀",nextIcon:"▶",galleryFadeIn:100,galleryFadeOut:300,slides:function(){return this.filter?this.$source.find(this.filter):this.$source},images:function(){return e("images is deprecated, please use slides instead"),this.slides()},currentNavigation:function(){return this.slides().index(this.$currentTarget)},navigateTo:function(e){var t=this,n=t.slides(),i=n.length,a=t.$instance.find("."+t.namespace+"-inner");return e=(e%i+i)%i,t.$currentTarget=n.eq(e),t.beforeContent(),r.when(t.getContent(),a.fadeTo(t.galleryFadeOut,.2)).always(function(e){t.setContent(e),t.afterContent(),e.fadeTo(t.galleryFadeIn,1)})},createNavigation:function(t){var n=this;return r(''+this[t+"Icon"]+"").click(function(e){r(this).trigger(t+"."+n.namespace),e.preventDefault()})}}),r.featherlightGallery=o,r.fn.featherlightGallery=function(e){return o.attach(this,e),this},r(document).ready(function(){o._onReady()})}(jQuery); -------------------------------------------------------------------------------- /config/grunt/copy.js: -------------------------------------------------------------------------------- 1 | // https://github.com/gruntjs/grunt-contrib-copy 2 | module.exports = { 3 | css: { 4 | files: [ 5 | { 6 | expand: true, 7 | flatten: true, 8 | cwd: '<%= paths.node %>', 9 | src: [], 10 | dest: '<%= paths.cssVend %>' 11 | } 12 | ] 13 | }, 14 | js: { 15 | files: [ 16 | { 17 | expand: true, 18 | flatten: true, 19 | cwd: '<%= paths.jsSrc %>', 20 | src: [ 21 | 'wpFeatherlight.js' 22 | ], 23 | dest: '<%= paths.jsDist %>' 24 | }, 25 | { 26 | expand: true, 27 | flatten: true, 28 | cwd: '<%= paths.node %>', 29 | src: [ 30 | 'featherlight/src/featherlight.js', 31 | 'featherlight/src/featherlight.gallery.js', 32 | 'detect_swipe/jquery.detect_swipe.js' 33 | ], 34 | dest: '<%= paths.jsVend %>' 35 | } 36 | ] 37 | }, 38 | fonts: { 39 | files: [ 40 | { 41 | expand: true, 42 | flatten: true, 43 | cwd: '<%= paths.fontsSrc %>', 44 | src: [ 45 | '**/*' 46 | ], 47 | dest: '<%= paths.fontsDist %>', 48 | filter: 'isFile' 49 | } 50 | ] 51 | }, 52 | languages: { 53 | files: [ 54 | { 55 | expand: true, 56 | cwd: '<%= paths.assets %><%= paths.languages %>', 57 | src: [ '*.po' ], 58 | dest: '<%= paths.plugin %><%= paths.languages %>', 59 | filter: 'isFile' 60 | } 61 | ] 62 | }, 63 | rename: { 64 | files: [ 65 | { 66 | expand: true, 67 | dot: true, 68 | cwd: '', 69 | dest: '', 70 | src: [ 71 | 'wp-featherlight.php' 72 | ], 73 | rename: function( dest, src ) { 74 | return dest + src.replace( 'wp-featherlight', '<%= pkg.nameDashed %>' ); 75 | } 76 | }, 77 | { 78 | expand: true, 79 | dot: true, 80 | cwd: '<%= paths.jsSrc %>', 81 | dest: '<%= paths.jsSrc %>', 82 | src: [ 83 | '**/*.js' 84 | ], 85 | rename: function( dest, src ) { 86 | return dest + src.replace( 'wpFeatherlight', '<%= pkg.nameCamelLow %>' ); 87 | } 88 | }, 89 | { 90 | expand: true, 91 | dot: true, 92 | cwd: '<%= paths.cssSrc %>', 93 | dest: '<%= paths.cssSrc %>', 94 | src: [ 95 | '**/*.scss' 96 | ], 97 | rename: function( dest, src ) { 98 | return dest + src.replace( 'wp-featherlight', '<%= pkg.nameDashed %>' ); 99 | } 100 | } 101 | ] 102 | }, 103 | release: { 104 | files: [ 105 | { 106 | expand: true, 107 | src: [ 108 | '**', 109 | '.*', 110 | '!.git/**', 111 | '!.sass-cache/**', 112 | '!.jscsrc', 113 | '!.jshintrc', 114 | '!.bowerrc', 115 | '!assets/**', 116 | '!config/**', 117 | '!release/**', 118 | '!css/src/**', 119 | '!languages/src/**', 120 | '!bower_components/**', 121 | '!node_modules/**', 122 | '!tmp/**', 123 | '!*.json', 124 | '!*.sublime*', 125 | '!.DS_Store', 126 | '!.gitattributes', 127 | '!.gitignore', 128 | '!composer.lock', 129 | '!gruntfile.js', 130 | '!package.json' 131 | ], 132 | dest: '<%= paths.release %><%= pkg.version %>' 133 | } 134 | ] 135 | } 136 | }; 137 | -------------------------------------------------------------------------------- /assets/plugin/css/partials/_base.scss: -------------------------------------------------------------------------------- 1 | .featherlight { 2 | background: transparent; 3 | bottom: 0; 4 | cursor: zoom-out; 5 | display: none; 6 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 7 | left: 0; 8 | position: fixed; 9 | right: 0; 10 | text-align: center; 11 | top: 0; 12 | white-space: nowrap; 13 | z-index: 2147483647; 14 | 15 | * { 16 | box-sizing: border-box; 17 | } 18 | 19 | &:last-of-type { 20 | background: $underlay-background-color; 21 | } 22 | 23 | &::before { 24 | content: ""; 25 | display: inline-block; 26 | height: 100%; 27 | margin-right: -0.25em; 28 | vertical-align: middle; 29 | } 30 | 31 | .featherlight-content { 32 | animation: fadein 0.5s; 33 | background: $content-background-color; 34 | border: 0; 35 | cursor: auto; 36 | display: inline-block; 37 | max-height: 80%; 38 | max-width: 90%; 39 | min-width: inherit; 40 | overflow: visible; 41 | padding: 0; 42 | position: relative; 43 | text-align: left; 44 | vertical-align: middle; 45 | white-space: normal; 46 | 47 | @media screen and ( min-width: 980px ) { 48 | max-height: 90%; 49 | } 50 | 51 | .caption { 52 | color: $caption-text-color; 53 | font-size: 16px; 54 | font-weight: lighter; 55 | line-height: 1.25; 56 | max-width: 100%; 57 | overflow: hidden; 58 | position: absolute; 59 | text-align: left; 60 | text-overflow: ellipsis; 61 | white-space: nowrap; 62 | 63 | &:hover, 64 | &:focus { 65 | overflow: visible; 66 | white-space: normal; 67 | } 68 | } 69 | 70 | a { 71 | color: $caption-text-color; 72 | text-decoration: underline; 73 | 74 | &:hover, 75 | &:focus { 76 | text-decoration: none; 77 | } 78 | } 79 | } 80 | 81 | .featherlight-inner { 82 | animation: fadein 0.5s; 83 | display: block; 84 | } 85 | 86 | // Reset button style. 87 | button { 88 | -webkit-appearance: button; 89 | font-family: sans-serif; 90 | font-size: 100%; 91 | line-height: 1.15; 92 | margin: 0; 93 | overflow: visible; 94 | text-transform: none; 95 | 96 | &::-moz-focus-inner { 97 | border-style: none; 98 | padding: 0; 99 | } 100 | } 101 | 102 | .featherlight-close-icon { 103 | background-color: transparent; 104 | background-image: $close-icon; 105 | background-position: center; 106 | background-repeat: no-repeat; 107 | background-size: 100% auto; 108 | border: 0; 109 | cursor: pointer; 110 | display: block; 111 | height: 30px; 112 | opacity: 0.6; 113 | overflow: hidden; 114 | padding: 0; 115 | position: fixed; 116 | right: 25px; 117 | text-align: center; 118 | text-indent: 100%; 119 | top: 25px; 120 | white-space: nowrap; 121 | width: 30px; 122 | z-index: 9999; 123 | 124 | &:hover, 125 | &:focus { 126 | opacity: 1; 127 | } 128 | } 129 | 130 | .featherlight-image { 131 | max-width: 100%; 132 | } 133 | 134 | iframe { 135 | border: 0; 136 | } 137 | } 138 | 139 | [data-featherlight] { 140 | img { 141 | cursor: zoom-in; 142 | } 143 | } 144 | 145 | .featherlight-iframe { 146 | 147 | .featherlight-content { 148 | border-bottom: 0; 149 | -webkit-overflow-scrolling: touch; 150 | overflow-y: scroll; 151 | padding: 0; 152 | } 153 | } 154 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WP Featherlight 2 | 3 | An ultra lightweight jQuery lightbox for WordPress images and galleries. 4 | 5 | __Contributors:__ [Robert Neu](https://github.com/robneu), [Ozzy Rodriguez](https://github.com/ozzyrod), [Cipher Development](https://github.com/cipherdevgroup) 6 | __Requires:__ WordPress 4.0 7 | __Tested up to:__ WordPress 5.5.0 8 | __License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html) 9 | 10 | ![nacin-at-loopconf](https://cloud.githubusercontent.com/assets/2184093/9426378/56c32f16-4902-11e5-9e57-75a4620cc51b.png) 11 | 12 | ## Description ## 13 | 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. 15 | 16 | In order for WordPress images and galleries to be lightboxed, you need to select the "Media File" option when choosing where the thumbnails should link. You can also select the "Custom Link" option if you make sure to link directly to an image file. This should work for any image file even if it's hosted on another website. 17 | 18 | ![media-file](https://cloud.githubusercontent.com/assets/2184093/9620710/8850a71e-50e3-11e5-8c89-065fdd0d367d.jpg) 19 | 20 | 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). 21 | 22 | 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. 23 | 24 | Here's an example of the plugin being used to load a large (5mb) external image in a standard WordPress post: 25 | 26 | ![Loader in Action](https://cloud.githubusercontent.com/assets/2184093/7943635/5ba2155e-092b-11e5-8b97-be5ca8cc77d8.gif) 27 | 28 | If you find a display problem, it may be related to your theme but please [open an issue](https://github.com/cipherdevgroup/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/). 29 | 30 | ## Installation ## 31 | 32 | 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. 33 | 34 | ## Developer Notes ## 35 | 36 | While there are no options in the plugin, there are some handy filters to modify the default behavior. As of `0.3.0` all images which use the default WordPress captions will also include a caption when the image is lightboxed. To disable this behavior, filter `wp_featherlight_captions` to false. 37 | 38 | You can also disable inclusion of the CSS and JavaScript conditionally using filters which can be found in the `/includes/class-scripts.php` file. If you have questions about how any part of the plugin works, please don't hesitate to [open an issue](https://github.com/cipherdevgroup/wp-featherlight/issues). 39 | 40 | ## Contributing ## 41 | 42 | If you're a developer, the most current version can be found on the [develop branch](https://github.com/cipherdevgroup/wp-featherlight/tree/develop). Pull requests, issues, and any feedback are all more than welcome. If you would like to contribute code, please make your pull requests against the develop branch rather than the master. 43 | -------------------------------------------------------------------------------- /js/wpFeatherlight.js: -------------------------------------------------------------------------------- 1 | /** 2 | * WP Featherlight - Loader and helpers for the Featherlight WordPress plugin 3 | * 4 | * @copyright Copyright (c) 2018, Cipher Development, LLC 5 | * @license MIT 6 | */ 7 | (function( window, $, undefined ) { 8 | 'use strict'; 9 | 10 | var $body = $( document.body ); 11 | 12 | /** 13 | * Checks href targets to see if a given anchor is linking to an image. 14 | * 15 | * @since 0.1.0 16 | * @return mixed 17 | */ 18 | function testImages( index, element ) { 19 | return /(.png|.jpg|.jpeg|.gif|.tiff|.bmp)$/.test( 20 | $( element ).attr( 'href' ).toLowerCase().split( '?' )[0].split( '#' )[0] 21 | ); 22 | } 23 | 24 | /** 25 | * Filters all href elements on a page to add Featherlight's data attribute. 26 | * When a match is found, the data attribute is added so Featherlight will 27 | * open it normally. 28 | * 29 | * @since 0.1.0 30 | * @return void 31 | */ 32 | function findImages() { 33 | $body.find( 'a[href]' ).filter( testImages ).attr( 'data-featherlight', 'image' ); 34 | } 35 | 36 | /** 37 | * Callback function to initialize Featherlight galleries when they contain 38 | * items that are able to be opened in a light box. 39 | * 40 | * @since 0.1.0 41 | * @return void 42 | */ 43 | function buildGalleries( index, element ) { 44 | var $galleryObj = $( element ), 45 | $galleryItems = $galleryObj.find( 'a[data-featherlight]' ); 46 | 47 | if ( $galleryItems.attr( 'data-featherlight' ) ) { 48 | $galleryItems.featherlightGallery({ 49 | previousIcon: '', 50 | nextIcon: '' 51 | }); 52 | } 53 | } 54 | 55 | /** 56 | * Finds and creates Featherlight galleries for WordPress image galleries. 57 | * 58 | * @since 0.1.0 59 | * @return void 60 | */ 61 | function findGalleries() { 62 | var $gallery = $body.find( '[class*="gallery"]' ); 63 | 64 | if ( 0 !== $gallery.length ) { 65 | $.each( $gallery, buildGalleries ); 66 | } 67 | } 68 | 69 | /** 70 | * Attempt to Find image captions using common WordPress caption markup. 71 | * 72 | * @since 1.3.0 73 | * @return void 74 | */ 75 | function findCaption( target ) { 76 | var caption = target.parent().find( '.wp-caption-text' ); 77 | 78 | if ( 0 !== caption.length ) { 79 | return caption; 80 | } 81 | 82 | var gutCaption = target.parent().find( 'figcaption' ); 83 | 84 | if ( 0 !== gutCaption.length ) { 85 | return gutCaption; 86 | } 87 | 88 | var galParent = target.parents( '.gallery-item' ); 89 | 90 | if ( 0 !== galParent.length ) { 91 | return galParent.find( '.wp-caption-text' ); 92 | } 93 | 94 | var gutParent = target.parents( '.blocks-gallery-item' ); 95 | 96 | if ( 0 !== gutParent.length ) { 97 | return gutParent.find( 'figcaption' ); 98 | } 99 | 100 | var jetParent = target.parents( '.tiled-gallery-item' ); 101 | 102 | if ( 0 !== jetParent.length ) { 103 | return jetParent.find( '.tiled-gallery-caption' ); 104 | } 105 | 106 | return ''; 107 | } 108 | 109 | /** 110 | * Append image captions to the Featherlight content
. 111 | * 112 | * @since 0.3.0 113 | * @return void 114 | */ 115 | function addCaptions() { 116 | $.featherlight.prototype.afterContent = function() { 117 | var object = this.$instance, 118 | caption = findCaption( this.$currentTarget ); 119 | 120 | object.find( '.caption' ).remove(); 121 | 122 | if ( 0 !== caption.length ) { 123 | var $captionElm = $( '
' ).appendTo( object.find( '.featherlight-content' ) ); 124 | $captionElm[0].innerHTML = caption.html(); 125 | } 126 | }; 127 | } 128 | 129 | /** 130 | * Fires all of our helper methods to load featherlight. 131 | * 132 | * @since 0.1.0 133 | * @return void 134 | */ 135 | function wpFeatherlightInit() { 136 | $.featherlight.defaults.closeIcon = ''; 137 | findImages(); 138 | findGalleries(); 139 | if ( $body.hasClass( 'wp-featherlight-captions' ) ) { 140 | addCaptions(); 141 | } 142 | } 143 | 144 | $( document ).ready(function() { 145 | wpFeatherlightInit(); 146 | }); 147 | })( this, jQuery ); 148 | -------------------------------------------------------------------------------- /assets/plugin/js/wpFeatherlight.js: -------------------------------------------------------------------------------- 1 | /** 2 | * WP Featherlight - Loader and helpers for the Featherlight WordPress plugin 3 | * 4 | * @copyright Copyright (c) 2018, Cipher Development, LLC 5 | * @license MIT 6 | */ 7 | (function( window, $, undefined ) { 8 | 'use strict'; 9 | 10 | var $body = $( document.body ); 11 | 12 | /** 13 | * Checks href targets to see if a given anchor is linking to an image. 14 | * 15 | * @since 0.1.0 16 | * @return mixed 17 | */ 18 | function testImages( index, element ) { 19 | return /(.png|.jpg|.jpeg|.gif|.tiff|.bmp)$/.test( 20 | $( element ).attr( 'href' ).toLowerCase().split( '?' )[0].split( '#' )[0] 21 | ); 22 | } 23 | 24 | /** 25 | * Filters all href elements on a page to add Featherlight's data attribute. 26 | * When a match is found, the data attribute is added so Featherlight will 27 | * open it normally. 28 | * 29 | * @since 0.1.0 30 | * @return void 31 | */ 32 | function findImages() { 33 | $body.find( 'a[href]' ).filter( testImages ).attr( 'data-featherlight', 'image' ); 34 | } 35 | 36 | /** 37 | * Callback function to initialize Featherlight galleries when they contain 38 | * items that are able to be opened in a light box. 39 | * 40 | * @since 0.1.0 41 | * @return void 42 | */ 43 | function buildGalleries( index, element ) { 44 | var $galleryObj = $( element ), 45 | $galleryItems = $galleryObj.find( 'a[data-featherlight]' ); 46 | 47 | if ( $galleryItems.attr( 'data-featherlight' ) ) { 48 | $galleryItems.featherlightGallery({ 49 | previousIcon: '', 50 | nextIcon: '' 51 | }); 52 | } 53 | } 54 | 55 | /** 56 | * Finds and creates Featherlight galleries for WordPress image galleries. 57 | * 58 | * @since 0.1.0 59 | * @return void 60 | */ 61 | function findGalleries() { 62 | var $gallery = $body.find( '[class*="gallery"]' ); 63 | 64 | if ( 0 !== $gallery.length ) { 65 | $.each( $gallery, buildGalleries ); 66 | } 67 | } 68 | 69 | /** 70 | * Attempt to Find image captions using common WordPress caption markup. 71 | * 72 | * @since 1.3.0 73 | * @return void 74 | */ 75 | function findCaption( target ) { 76 | var caption = target.parent().find( '.wp-caption-text' ); 77 | 78 | if ( 0 !== caption.length ) { 79 | return caption; 80 | } 81 | 82 | var gutCaption = target.parent().find( 'figcaption' ); 83 | 84 | if ( 0 !== gutCaption.length ) { 85 | return gutCaption; 86 | } 87 | 88 | var galParent = target.parents( '.gallery-item' ); 89 | 90 | if ( 0 !== galParent.length ) { 91 | return galParent.find( '.wp-caption-text' ); 92 | } 93 | 94 | var gutParent = target.parents( '.blocks-gallery-item' ); 95 | 96 | if ( 0 !== gutParent.length ) { 97 | return gutParent.find( 'figcaption' ); 98 | } 99 | 100 | var jetParent = target.parents( '.tiled-gallery-item' ); 101 | 102 | if ( 0 !== jetParent.length ) { 103 | return jetParent.find( '.tiled-gallery-caption' ); 104 | } 105 | 106 | return ''; 107 | } 108 | 109 | /** 110 | * Append image captions to the Featherlight content
. 111 | * 112 | * @since 0.3.0 113 | * @return void 114 | */ 115 | function addCaptions() { 116 | $.featherlight.prototype.afterContent = function() { 117 | var object = this.$instance, 118 | caption = findCaption( this.$currentTarget ); 119 | 120 | object.find( '.caption' ).remove(); 121 | 122 | if ( 0 !== caption.length ) { 123 | var $captionElm = $( '
' ).appendTo( object.find( '.featherlight-content' ) ); 124 | $captionElm[0].innerHTML = caption.html(); 125 | } 126 | }; 127 | } 128 | 129 | /** 130 | * Fires all of our helper methods to load featherlight. 131 | * 132 | * @since 0.1.0 133 | * @return void 134 | */ 135 | function wpFeatherlightInit() { 136 | $.featherlight.defaults.closeIcon = ''; 137 | findImages(); 138 | findGalleries(); 139 | if ( $body.hasClass( 'wp-featherlight-captions' ) ) { 140 | addCaptions(); 141 | } 142 | } 143 | 144 | $( document ).ready(function() { 145 | wpFeatherlightInit(); 146 | }); 147 | })( this, jQuery ); 148 | -------------------------------------------------------------------------------- /.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "requireSpacesInConditionalExpression": { 3 | "afterTest": true, 4 | "beforeConsequent": true, 5 | "afterConsequent": true, 6 | "beforeAlternate": true 7 | }, 8 | "requireSpacesInFunction": { 9 | "beforeOpeningCurlyBrace": true 10 | }, 11 | "disallowSpacesInAnonymousFunctionExpression": { 12 | "beforeOpeningRoundBrace": true 13 | }, 14 | "requireMultipleVarDecl": false, 15 | "requireSpacesInsideObjectBrackets": "all", 16 | "disallowSpaceAfterObjectKeys": true, 17 | "requireSpaceAfterBinaryOperators": [ 18 | "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", 19 | "&=", "|=", "^=", "+=", 20 | 21 | "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&", 22 | "|", "^", "&&", "||", "===", "==", ">=", 23 | "<=", "<", ">", "!=", "!==" 24 | ], 25 | "requireSpaceBeforeBinaryOperators": [ 26 | "=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", 27 | "&=", "|=", "^=", "+=", 28 | 29 | "+", "-", "*", "/", "%", "<<", ">>", ">>>", "&", 30 | "|", "^", "&&", "||", "===", "==", ">=", 31 | "<=", "<", ">", "!=", "!==" 32 | ], 33 | "disallowKeywords": ["with"], 34 | "disallowMultipleLineBreaks": true, 35 | "validateLineBreaks": "LF", 36 | "disallowMixedSpacesAndTabs": "smart", 37 | "disallowTrailingWhitespace": true, 38 | "requireCurlyBraces": [ 39 | "if", 40 | "else", 41 | "for", 42 | "while", 43 | "do", 44 | "try", 45 | "catch" 46 | ], 47 | "requireSpaceBeforeBlockStatements": true, 48 | "requireParenthesesAroundIIFE": true, 49 | "requireBlocksOnNewline": true, 50 | "requireOperatorBeforeLineBreak": [ 51 | "?", 52 | "=", 53 | "+", 54 | "-", 55 | "/", 56 | "*", 57 | "==", 58 | "===", 59 | "!=", 60 | "!==", 61 | ">", 62 | ">=", 63 | "<", 64 | "<=" 65 | ], 66 | "requireSpaceBeforeBinaryOperators": [ 67 | "?", 68 | "=", 69 | "+", 70 | "-", 71 | "/", 72 | "*", 73 | "==", 74 | "===", 75 | "!=", 76 | "!==", 77 | ">", 78 | ">=", 79 | "<", 80 | "<=" 81 | ], 82 | "requireSpaceAfterBinaryOperators": [ 83 | "?", 84 | "=", 85 | "+", 86 | "/", 87 | "*", 88 | ":", 89 | "==", 90 | "===", 91 | "!=", 92 | "!==", 93 | ">", 94 | ">=", 95 | "<", 96 | "<=" 97 | ], 98 | "disallowSpaceBeforeBinaryOperators": [","], 99 | "disallowSpaceAfterBinaryOperators": [], 100 | "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"], 101 | "requireSpaceAfterPrefixUnaryOperators": ["!"], 102 | "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], 103 | "requireCamelCaseOrUpperCaseIdentifiers": true, 104 | "disallowMultipleLineStrings": true, 105 | "validateQuoteMarks": "'", 106 | "validateIndentation": "\t", 107 | "requireLineFeedAtFileEnd": true, 108 | "requireDotNotation": true, 109 | "disallowNewlineBeforeBlockStatements": true, 110 | "requireSpaceAfterKeywords": [ 111 | "do", 112 | "for", 113 | "if", 114 | "else", 115 | "switch", 116 | "case", 117 | "try", 118 | "catch", 119 | "void", 120 | "while", 121 | "with", 122 | "return", 123 | "typeof" 124 | ], 125 | "requireSpaceAfterLineComment": true, 126 | "requireSpaceBeforeKeywords": [ 127 | "else", 128 | "while", 129 | "catch" 130 | ], 131 | "requireSpaceBeforeObjectValues": true, 132 | "requireSpaceBetweenArguments": true, 133 | "requireSpacesInAnonymousFunctionExpression": { 134 | "beforeOpeningCurlyBrace": true 135 | }, 136 | "requireSpacesInForStatement": true, 137 | "requireSpacesInsideArrayBrackets": "all", 138 | "requireSpacesInsideParentheses": { 139 | "all": true, 140 | "except": [ 141 | "{", 142 | "}", 143 | "[", 144 | "]", 145 | "function" 146 | ] 147 | }, 148 | "requireYodaConditions": true, 149 | "validateParameterSeparator": ", ", 150 | 151 | "disallowTrailingComma": true, 152 | "disallowPaddingNewlinesInBlocks": true, 153 | "disallowEmptyBlocks": true, 154 | "disallowQuotedKeysInObjects": "allButReserved", 155 | "disallowDanglingUnderscores": true, 156 | "requireCommaBeforeLineBreak": true, 157 | "disallowKeywordsOnNewLine": ["else"], 158 | "requireCapitalizedConstructors": true, 159 | "safeContextKeyword": [ "that" ], 160 | "jsDoc": { 161 | "checkParamNames": true, 162 | "checkRedundantParams": true, 163 | "requireParamTypes": true 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /assets/plugin/.scss-lint.yml: -------------------------------------------------------------------------------- 1 | # This file follows the WordPress CSS standards as closely as possible. For any 2 | # linters that aren't listed in this file, we're accepting the default settings. 3 | 4 | # https://make.wordpress.org/core/handbook/best-practices/coding-standards/css/ 5 | # Linter documentation: http://git.io/vG7gu 6 | # See also: http://sass-guidelin.es/ 7 | 8 | linters: 9 | BangFormat: 10 | enabled: true 11 | space_before_bang: true 12 | space_after_bang: false 13 | 14 | BorderZero: 15 | enabled: true 16 | convention: zero # or `none` 17 | 18 | ColorKeyword: 19 | enabled: true 20 | 21 | ColorVariable: 22 | enabled: true 23 | 24 | Comment: 25 | enabled: false 26 | 27 | DebugStatement: 28 | enabled: true 29 | 30 | DeclarationOrder: 31 | enabled: true 32 | 33 | DuplicateProperty: 34 | enabled: true 35 | 36 | ElsePlacement: 37 | enabled: true 38 | style: same_line # or 'new_line' 39 | 40 | EmptyLineBetweenBlocks: 41 | enabled: true 42 | ignore_single_line_blocks: true 43 | 44 | EmptyRule: 45 | enabled: true 46 | 47 | FinalNewline: 48 | enabled: true 49 | present: true 50 | 51 | HexLength: 52 | enabled: true 53 | style: short # or 'long' 54 | 55 | HexNotation: 56 | enabled: true 57 | style: lowercase # or 'uppercase' 58 | 59 | HexValidation: 60 | enabled: true 61 | 62 | IdSelector: 63 | enabled: false 64 | 65 | ImportantRule: 66 | enabled: true 67 | 68 | ImportPath: 69 | enabled: true 70 | leading_underscore: false 71 | filename_extension: false 72 | 73 | Indentation: 74 | enabled: true 75 | allow_non_nested_indentation: false 76 | character: tab # or 'space' 77 | width: 1 78 | 79 | LeadingZero: 80 | enabled: true 81 | style: include_zero # or 'include_zero' 82 | 83 | MergeableSelector: 84 | enabled: false 85 | force_nesting: true 86 | 87 | NameFormat: 88 | enabled: true 89 | allow_leading_underscore: true 90 | convention: hyphenated_lowercase # or 'BEM', or a regex pattern 91 | 92 | NestingDepth: 93 | enabled: true 94 | max_depth: 5 95 | 96 | PlaceholderInExtend: 97 | enabled: true 98 | 99 | PropertyCount: 100 | enabled: false 101 | include_nested: false 102 | max_properties: 10 103 | 104 | PropertySortOrder: 105 | enabled: true 106 | ignore_unspecified: false 107 | separate_groups: false 108 | 109 | PropertySpelling: 110 | enabled: true 111 | extra_properties: [] 112 | 113 | QualifyingElement: 114 | enabled: false 115 | allow_element_with_attribute: false 116 | allow_element_with_class: false 117 | allow_element_with_id: false 118 | 119 | SelectorDepth: 120 | enabled: true 121 | max_depth: 5 122 | 123 | SelectorFormat: 124 | enabled: true 125 | convention: hyphenated_lowercase # or 'BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern 126 | 127 | Shorthand: 128 | enabled: true 129 | 130 | SingleLinePerProperty: 131 | enabled: true 132 | allow_single_line_rule_sets: true 133 | 134 | SingleLinePerSelector: 135 | enabled: true 136 | 137 | SpaceAfterComma: 138 | enabled: true 139 | 140 | SpaceAfterPropertyColon: 141 | enabled: true 142 | style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned' 143 | 144 | SpaceAfterPropertyName: 145 | enabled: true 146 | 147 | SpaceBeforeBrace: 148 | enabled: true 149 | style: space # or 'new_line' 150 | allow_single_line_padding: false 151 | 152 | SpaceBetweenParens: 153 | enabled: true 154 | spaces: 1 155 | 156 | StringQuotes: 157 | enabled: true 158 | style: double_quotes 159 | 160 | TrailingSemicolon: 161 | enabled: true 162 | 163 | TrailingZero: 164 | enabled: false 165 | 166 | UnnecessaryMantissa: 167 | enabled: true 168 | 169 | UnnecessaryParentReference: 170 | enabled: true 171 | 172 | UrlFormat: 173 | enabled: true 174 | 175 | UrlQuotes: 176 | enabled: true 177 | 178 | VariableForProperty: 179 | enabled: false 180 | properties: [] 181 | 182 | VendorPrefix: 183 | enabled: true 184 | identifier_list: base 185 | additional_identifiers: [] 186 | excluded_identifiers: [] 187 | 188 | ZeroUnit: 189 | enabled: true 190 | 191 | Compass::*: 192 | enabled: false 193 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", 5 | "This file is @generated automatically" 6 | ], 7 | "hash": "0d1186212214fbaa4e5f713507762659", 8 | "content-hash": "8a47a178f1790ace539a756ea2130794", 9 | "packages": [ 10 | { 11 | "name": "composer/installers", 12 | "version": "v1.2.0", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/composer/installers.git", 16 | "reference": "d78064c68299743e0161004f2de3a0204e33b804" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/composer/installers/zipball/d78064c68299743e0161004f2de3a0204e33b804", 21 | "reference": "d78064c68299743e0161004f2de3a0204e33b804", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "composer-plugin-api": "^1.0" 26 | }, 27 | "replace": { 28 | "roundcube/plugin-installer": "*", 29 | "shama/baton": "*" 30 | }, 31 | "require-dev": { 32 | "composer/composer": "1.0.*@dev", 33 | "phpunit/phpunit": "4.1.*" 34 | }, 35 | "type": "composer-plugin", 36 | "extra": { 37 | "class": "Composer\\Installers\\Plugin", 38 | "branch-alias": { 39 | "dev-master": "1.0-dev" 40 | } 41 | }, 42 | "autoload": { 43 | "psr-4": { 44 | "Composer\\Installers\\": "src/Composer/Installers" 45 | } 46 | }, 47 | "notification-url": "https://packagist.org/downloads/", 48 | "license": [ 49 | "MIT" 50 | ], 51 | "authors": [ 52 | { 53 | "name": "Kyle Robinson Young", 54 | "email": "kyle@dontkry.com", 55 | "homepage": "https://github.com/shama" 56 | } 57 | ], 58 | "description": "A multi-framework Composer library installer", 59 | "homepage": "https://composer.github.io/installers/", 60 | "keywords": [ 61 | "Craft", 62 | "Dolibarr", 63 | "Hurad", 64 | "ImageCMS", 65 | "MODX Evo", 66 | "Mautic", 67 | "OXID", 68 | "Plentymarkets", 69 | "RadPHP", 70 | "SMF", 71 | "Thelia", 72 | "WolfCMS", 73 | "agl", 74 | "aimeos", 75 | "annotatecms", 76 | "attogram", 77 | "bitrix", 78 | "cakephp", 79 | "chef", 80 | "cockpit", 81 | "codeigniter", 82 | "concrete5", 83 | "croogo", 84 | "dokuwiki", 85 | "drupal", 86 | "elgg", 87 | "expressionengine", 88 | "fuelphp", 89 | "grav", 90 | "installer", 91 | "joomla", 92 | "kohana", 93 | "laravel", 94 | "lithium", 95 | "magento", 96 | "mako", 97 | "mediawiki", 98 | "modulework", 99 | "moodle", 100 | "phpbb", 101 | "piwik", 102 | "ppi", 103 | "puppet", 104 | "reindex", 105 | "roundcube", 106 | "shopware", 107 | "silverstripe", 108 | "symfony", 109 | "typo3", 110 | "wordpress", 111 | "yawik", 112 | "zend", 113 | "zikula" 114 | ], 115 | "time": "2016-08-13 20:53:52" 116 | } 117 | ], 118 | "packages-dev": [], 119 | "aliases": [], 120 | "minimum-stability": "stable", 121 | "stability-flags": [], 122 | "prefer-stable": false, 123 | "prefer-lowest": false, 124 | "platform": [], 125 | "platform-dev": [] 126 | } 127 | -------------------------------------------------------------------------------- /css/wp-featherlight.min.css: -------------------------------------------------------------------------------- 1 | .featherlight{background:0 0;bottom:0;cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out;display:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;left:0;position:fixed;right:0;text-align:center;top:0;white-space:nowrap;z-index:2147483647}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.featherlight:last-of-type{background:rgba(0,0,0,.9)}.featherlight::before{content:"";display:inline-block;height:100%;margin-right:-.25em;vertical-align:middle}.featherlight .featherlight-content{-webkit-animation:fadein .5s;animation:fadein .5s;background:#000;border:0;cursor:auto;display:inline-block;max-height:80%;max-width:90%;min-width:inherit;overflow:visible;padding:0;position:relative;text-align:left;vertical-align:middle;white-space:normal}@media screen and (min-width:980px){.featherlight .featherlight-content{max-height:90%}}.featherlight .featherlight-content .caption{color:#fff;font-size:16px;font-weight:lighter;line-height:1.25;max-width:100%;overflow:hidden;position:absolute;text-align:left;text-overflow:ellipsis;white-space:nowrap}.featherlight .featherlight-content .caption:focus,.featherlight .featherlight-content .caption:hover{overflow:visible;white-space:normal}.featherlight .featherlight-content a{color:#fff;text-decoration:underline}.featherlight .featherlight-content a:focus,.featherlight .featherlight-content a:hover{text-decoration:none}.featherlight .featherlight-inner{-webkit-animation:fadein .5s;animation:fadein .5s;display:block}.featherlight button{-webkit-appearance:button;font-family:sans-serif;font-size:100%;line-height:1.15;margin:0;overflow:visible;text-transform:none}.featherlight button::-moz-focus-inner{border-style:none;padding:0}.featherlight .featherlight-close-icon{background-color:transparent;background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M21%204.41L19.59%203%2012%2010.59%204.41%203%203%204.41%2010.59%2012%203%2019.59%204.41%2021%2012%2013.41%2019.59%2021%2021%2019.59%2013.41%2012%2021%204.41z%22/%3E%0A%3C/svg%3E);background-position:center;background-repeat:no-repeat;-webkit-background-size:100% auto;background-size:100% auto;border:0;cursor:pointer;display:block;height:30px;opacity:.6;overflow:hidden;padding:0;position:fixed;right:25px;text-align:center;text-indent:100%;top:25px;white-space:nowrap;width:30px;z-index:9999}.featherlight .featherlight-close-icon:focus,.featherlight .featherlight-close-icon:hover{opacity:1}.featherlight .featherlight-image{max-width:100%}.featherlight iframe{border:0}[data-featherlight] img{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.featherlight-iframe .featherlight-content{border-bottom:0;-webkit-overflow-scrolling:touch;overflow-y:scroll;padding:0}@-webkit-keyframes featherlightLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes featherlightLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}.featherlight-loading .featherlight-content{-webkit-animation:featherlightLoader 1s infinite linear;animation:featherlightLoader 1s infinite linear;background:0 0;border:8px solid #909090;border-left-color:#fff;font-size:10px}.featherlight-loading .featherlight-content,.featherlight-loading .featherlight-content::after{-webkit-border-radius:50%;border-radius:50%;height:10em;width:10em}.featherlight-loading .featherlight-close,.featherlight-loading .featherlight-inner{display:none}.featherlight-next,.featherlight-previous{background-color:transparent;background-repeat:no-repeat;-webkit-background-size:100% auto;background-size:100% auto;cursor:pointer;display:block;height:60px;margin-top:-30px;opacity:.4;overflow:hidden;position:fixed;text-indent:100%;top:50%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:60px}.featherlight-next span,.featherlight-previous span{display:none}.featherlight-next:focus,.featherlight-next:hover,.featherlight-previous:focus,.featherlight-previous:hover{opacity:1}.featherlight-next{background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M8.59%2016.59L13.17%2012%208.59%207.41%2010%206l6%206-6%206-1.41-1.41z%22/%3E%0A%3C/svg%3E);background-position:0 0;right:10px}.featherlight-previous{background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M15.41%207.41L10.83%2012l4.58%204.59L14%2018l-6-6%206-6%201.41%201.41z%22/%3E%0A%3C/svg%3E);background-position:-5px 0;left:10px}.featherlight-loading .featherlight-next,.featherlight-loading .featherlight-previous{display:none} -------------------------------------------------------------------------------- /css/wp-featherlight-rtl.min.css: -------------------------------------------------------------------------------- 1 | .featherlight{background:0 0;bottom:0;cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out;display:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;right:0;position:fixed;left:0;text-align:center;top:0;white-space:nowrap;z-index:2147483647}.featherlight *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.featherlight:last-of-type{background:rgba(0,0,0,.9)}.featherlight::before{content:"";display:inline-block;height:100%;margin-left:-.25em;vertical-align:middle}.featherlight .featherlight-content{-webkit-animation:fadein .5s;animation:fadein .5s;background:#000;border:0;cursor:auto;display:inline-block;max-height:80%;max-width:90%;min-width:inherit;overflow:visible;padding:0;position:relative;text-align:right;vertical-align:middle;white-space:normal}@media screen and (min-width:980px){.featherlight .featherlight-content{max-height:90%}}.featherlight .featherlight-content .caption{color:#fff;font-size:16px;font-weight:lighter;line-height:1.25;max-width:100%;overflow:hidden;position:absolute;text-align:right;text-overflow:ellipsis;white-space:nowrap}.featherlight .featherlight-content .caption:focus,.featherlight .featherlight-content .caption:hover{overflow:visible;white-space:normal}.featherlight .featherlight-content a{color:#fff;text-decoration:underline}.featherlight .featherlight-content a:focus,.featherlight .featherlight-content a:hover{text-decoration:none}.featherlight .featherlight-inner{-webkit-animation:fadein .5s;animation:fadein .5s;display:block}.featherlight button{-webkit-appearance:button;font-family:sans-serif;font-size:100%;line-height:1.15;margin:0;overflow:visible;text-transform:none}.featherlight button::-moz-focus-inner{border-style:none;padding:0}.featherlight .featherlight-close-icon{background-color:transparent;background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M21%204.41L19.59%203%2012%2010.59%204.41%203%203%204.41%2010.59%2012%203%2019.59%204.41%2021%2012%2013.41%2019.59%2021%2021%2019.59%2013.41%2012%2021%204.41z%22/%3E%0A%3C/svg%3E);background-position:center;background-repeat:no-repeat;-webkit-background-size:100% auto;background-size:100% auto;border:0;cursor:pointer;display:block;height:30px;opacity:.6;overflow:hidden;padding:0;position:fixed;left:25px;text-align:center;text-indent:100%;top:25px;white-space:nowrap;width:30px;z-index:9999}.featherlight .featherlight-close-icon:focus,.featherlight .featherlight-close-icon:hover{opacity:1}.featherlight .featherlight-image{max-width:100%}.featherlight iframe{border:0}[data-featherlight] img{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.featherlight-iframe .featherlight-content{border-bottom:0;-webkit-overflow-scrolling:touch;overflow-y:scroll;padding:0}@-webkit-keyframes featherlightLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(-360deg);transform:rotate(-360deg)}}@keyframes featherlightLoader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(-360deg);transform:rotate(-360deg)}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}.featherlight-loading .featherlight-content{-webkit-animation:featherlightLoader 1s infinite linear;animation:featherlightLoader 1s infinite linear;background:0 0;border:8px solid #909090;border-right-color:#fff;font-size:10px}.featherlight-loading .featherlight-content,.featherlight-loading .featherlight-content::after{-webkit-border-radius:50%;border-radius:50%;height:10em;width:10em}.featherlight-loading .featherlight-close,.featherlight-loading .featherlight-inner{display:none}.featherlight-next,.featherlight-previous{background-color:transparent;background-repeat:no-repeat;-webkit-background-size:100% auto;background-size:100% auto;cursor:pointer;display:block;height:60px;margin-top:-30px;opacity:.4;overflow:hidden;position:fixed;text-indent:100%;top:50%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:60px}.featherlight-next span,.featherlight-previous span{display:none}.featherlight-next:focus,.featherlight-next:hover,.featherlight-previous:focus,.featherlight-previous:hover{opacity:1}.featherlight-next{background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M8.59%2016.59L13.17%2012%208.59%207.41%2010%206l6%206-6%206-1.41-1.41z%22/%3E%0A%3C/svg%3E);background-position:0 0;right:10px}.featherlight-previous{background-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%09%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M15.41%207.41L10.83%2012l4.58%204.59L14%2018l-6-6%206-6%201.41%201.41z%22/%3E%0A%3C/svg%3E);background-position:-5px 0;left:10px}.featherlight-loading .featherlight-next,.featherlight-loading .featherlight-previous{display:none} -------------------------------------------------------------------------------- /admin/class-meta.php: -------------------------------------------------------------------------------- 1 | nonce_name ] ) ) { // Input var okay. 61 | return false; 62 | } 63 | 64 | if ( ! wp_verify_nonce( sanitize_key( $_POST[ $this->nonce_name ] ), $this->nonce_action ) ) { // Input var okay. 65 | return false; 66 | } 67 | 68 | // @link http://make.marketpress.com/multilingualpress/2014/10/how-to-disable-broken-save_post-callbacks/ 69 | if ( is_multisite() && ms_is_switched() ) { 70 | return false; 71 | } 72 | 73 | return wp_unslash( $_POST ); // Input var okay. 74 | } 75 | 76 | /** 77 | * Output the content of our metabox. 78 | * 79 | * @since 1.0.0 80 | * @access public 81 | * 82 | * @param object $post Post object. 83 | * @return void 84 | */ 85 | public function meta_box_view( $post ) { 86 | if ( empty( $post ) ) { 87 | $post = get_post(); 88 | } 89 | 90 | if ( ! is_object( $post ) || ! isset( $post->post_type ) ) { 91 | return; 92 | } 93 | 94 | $type = get_post_type_object( $post->post_type ); 95 | 96 | if ( ! is_object( $type ) ) { 97 | return; 98 | } 99 | 100 | if ( current_user_can( $type->cap->edit_post, $post->ID ) && $type->public ) { 101 | $disable = get_post_meta( $post->ID, 'wp_featherlight_disable', true ); 102 | $checked = empty( $disable ) ? '' : $disable; 103 | 104 | require_once wp_featherlight()->get_dir() . 'admin/views/meta-box.php'; 105 | } 106 | } 107 | 108 | /** 109 | * Callback function for saving our meta box data. 110 | * 111 | * @since 1.0.0 112 | * @access public 113 | * @param int $post_id Post ID. 114 | * @return bool Whether or not data has been saved. 115 | */ 116 | public function save_meta_boxes( $post_id ) { 117 | if ( ! $valid_request = $this->validate_request( $post_id ) ) { 118 | return false; 119 | } 120 | 121 | $value = isset( $valid_request['wp_featherlight_disable'] ) ? 'yes' : ''; 122 | 123 | return (bool) update_post_meta( $post_id, 'wp_featherlight_disable', $value ); 124 | } 125 | 126 | /** 127 | * Add a metabox to control featherlight display options. 128 | * 129 | * @since 0.1.0 130 | * @access public 131 | * @param string $post_type the current post type. 132 | * @return void 133 | */ 134 | public function add_meta_boxes( $post_type ) { 135 | $type = get_post_type_object( $post_type ); 136 | if ( is_object( $type ) && $type->public ) { 137 | add_meta_box( 138 | 'wp_featherlight_options', 139 | __( 'WP Featherlight', 'wp-featherlight' ), 140 | array( $this, 'options_callback' ), 141 | null, 142 | 'side' 143 | ); 144 | } 145 | } 146 | 147 | /** 148 | * Output the content of our metabox. 149 | * 150 | * @deprecated 1.0.0 151 | * @access public 152 | * 153 | * @param WP_Post $post Post object. 154 | * @return void 155 | */ 156 | public function options_callback( WP_Post $post ) { 157 | wp_featherlight()->i18n->load(); 158 | $disable = get_post_meta( $post->ID, 'wp_featherlight_disable', true ); 159 | $checked = empty( $disable ) ? '' : $disable; 160 | require_once wp_featherlight()->get_dir() . 'admin/views/meta-box.php'; 161 | } 162 | 163 | /** 164 | * Hook into WordPress. 165 | * 166 | * @since 1.3.1 167 | * @access protected 168 | * @return void 169 | */ 170 | protected function wp_hooks() { 171 | add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); 172 | 173 | if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) { 174 | $this->user_data = $_POST; 175 | add_action( 'save_post', array( $this, 'save_meta_boxes' ) ); 176 | } 177 | } 178 | 179 | /** 180 | * Get the class running! 181 | * 182 | * @since 0.1.0 183 | * @deprecated 1.0.0 184 | * @access public 185 | * @return void 186 | */ 187 | public function run() { 188 | $this->wp_hooks(); 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /js/vendor/featherlight.gallery.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Featherlight Gallery – an extension for the ultra slim jQuery lightbox 3 | * Version 1.7.13 - http://noelboss.github.io/featherlight/ 4 | * 5 | * Copyright 2018, Noël Raoul Bossart (http://www.noelboss.com) 6 | * MIT Licensed. 7 | **/ 8 | (function($) { 9 | "use strict"; 10 | 11 | var warn = function(m) { 12 | if(window.console && window.console.warn) { 13 | window.console.warn('FeatherlightGallery: ' + m); 14 | } 15 | }; 16 | 17 | if('undefined' === typeof $) { 18 | return warn('Too much lightness, Featherlight needs jQuery.'); 19 | } else if(!$.featherlight) { 20 | return warn('Load the featherlight plugin before the gallery plugin'); 21 | } 22 | 23 | var isTouchAware = ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch, 24 | jQueryConstructor = $.event && $.event.special.swipeleft && $, 25 | hammerConstructor = window.Hammer && function($el){ 26 | var mc = new window.Hammer.Manager($el[0]); 27 | mc.add(new window.Hammer.Swipe()); 28 | return mc; 29 | }, 30 | swipeAwareConstructor = isTouchAware && (jQueryConstructor || hammerConstructor); 31 | if(isTouchAware && !swipeAwareConstructor) { 32 | warn('No compatible swipe library detected; one must be included before featherlightGallery for swipe motions to navigate the galleries.'); 33 | } 34 | 35 | var callbackChain = { 36 | afterClose: function(_super, event) { 37 | var self = this; 38 | self.$instance.off('next.'+self.namespace+' previous.'+self.namespace); 39 | if (self._swiper) { 40 | self._swiper 41 | .off('swipeleft', self._swipeleft) /* See http://stackoverflow.com/questions/17367198/hammer-js-cant-remove-event-listener */ 42 | .off('swiperight', self._swiperight); 43 | self._swiper = null; 44 | } 45 | return _super(event); 46 | }, 47 | beforeOpen: function(_super, event){ 48 | var self = this; 49 | 50 | self.$instance.on('next.'+self.namespace+' previous.'+self.namespace, function(event){ 51 | var offset = event.type === 'next' ? +1 : -1; 52 | self.navigateTo(self.currentNavigation() + offset); 53 | }); 54 | 55 | if (swipeAwareConstructor) { 56 | self._swiper = swipeAwareConstructor(self.$instance) 57 | .on('swipeleft', self._swipeleft = function() { self.$instance.trigger('next'); }) 58 | .on('swiperight', self._swiperight = function() { self.$instance.trigger('previous'); }); 59 | 60 | self.$instance 61 | .addClass(this.namespace+'-swipe-aware', swipeAwareConstructor); 62 | } 63 | 64 | self.$instance.find('.'+self.namespace+'-content') 65 | .append(self.createNavigation('previous')) 66 | .append(self.createNavigation('next')); 67 | 68 | return _super(event); 69 | }, 70 | beforeContent: function(_super, event) { 71 | var index = this.currentNavigation(); 72 | var len = this.slides().length; 73 | this.$instance 74 | .toggleClass(this.namespace+'-first-slide', index === 0) 75 | .toggleClass(this.namespace+'-last-slide', index === len - 1); 76 | return _super(event); 77 | }, 78 | onKeyUp: function(_super, event){ 79 | var dir = { 80 | 37: 'previous', /* Left arrow */ 81 | 39: 'next' /* Rigth arrow */ 82 | }[event.keyCode]; 83 | if(dir) { 84 | this.$instance.trigger(dir); 85 | return false; 86 | } else { 87 | return _super(event); 88 | } 89 | } 90 | }; 91 | 92 | function FeatherlightGallery($source, config) { 93 | if(this instanceof FeatherlightGallery) { /* called with new */ 94 | $.featherlight.apply(this, arguments); 95 | this.chainCallbacks(callbackChain); 96 | } else { 97 | var flg = new FeatherlightGallery($.extend({$source: $source, $currentTarget: $source.first()}, config)); 98 | flg.open(); 99 | return flg; 100 | } 101 | } 102 | 103 | $.featherlight.extend(FeatherlightGallery, { 104 | autoBind: '[data-featherlight-gallery]' 105 | }); 106 | 107 | $.extend(FeatherlightGallery.prototype, { 108 | /** Additional settings for Gallery **/ 109 | previousIcon: '◀', /* Code that is used as previous icon */ 110 | nextIcon: '▶', /* Code that is used as next icon */ 111 | galleryFadeIn: 100, /* fadeIn speed when image is loaded */ 112 | galleryFadeOut: 300, /* fadeOut speed before image is loaded */ 113 | 114 | slides: function() { 115 | if (this.filter) { 116 | return this.$source.find(this.filter); 117 | } 118 | return this.$source; 119 | }, 120 | 121 | images: function() { 122 | warn('images is deprecated, please use slides instead'); 123 | return this.slides(); 124 | }, 125 | 126 | currentNavigation: function() { 127 | return this.slides().index(this.$currentTarget); 128 | }, 129 | 130 | navigateTo: function(index) { 131 | var self = this, 132 | source = self.slides(), 133 | len = source.length, 134 | $inner = self.$instance.find('.' + self.namespace + '-inner'); 135 | index = ((index % len) + len) % len; /* pin index to [0, len[ */ 136 | 137 | self.$currentTarget = source.eq(index); 138 | self.beforeContent(); 139 | return $.when( 140 | self.getContent(), 141 | $inner.fadeTo(self.galleryFadeOut,0.2) 142 | ).always(function($newContent) { 143 | self.setContent($newContent); 144 | self.afterContent(); 145 | $newContent.fadeTo(self.galleryFadeIn,1); 146 | }); 147 | }, 148 | 149 | createNavigation: function(target) { 150 | var self = this; 151 | return $(''+this[target+'Icon']+'').click(function(evt){ 152 | $(this).trigger(target+'.'+self.namespace); 153 | evt.preventDefault(); 154 | }); 155 | } 156 | }); 157 | 158 | $.featherlightGallery = FeatherlightGallery; 159 | 160 | /* extend jQuery with selector featherlight method $(elm).featherlight(config, elm); */ 161 | $.fn.featherlightGallery = function(config) { 162 | FeatherlightGallery.attach(this, config); 163 | return this; 164 | }; 165 | 166 | /* bind featherlight on ready if config autoBind is set */ 167 | $(document).ready(function(){ FeatherlightGallery._onReady(); }); 168 | 169 | }(jQuery)); 170 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.3.4 2 | This is a maintenance release. 3 | 4 | Here's a full list of what's changed since the last release: 5 | - Updated plugin URL 6 | 7 | ## 1.3.3 8 | This is primarily a maintenance release. 9 | 10 | Here's a full list of what's changed since the last release: 11 | - Tweak: Change metabox title 12 | 13 | ## 1.3.2 14 | Release to downgrade Featherlight verison until all bugs are worked out. 15 | 16 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.13` 17 | 18 | ## 1.3.1 19 | This is primarily a maintenance release, but one new feature has been added. Display the option to disable the lightbox in Gutenberg! 20 | 21 | Here's a full list of what's changed since the last release: 22 | 23 | - Feature: Add back metabox in sidebar 24 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.14` 25 | 26 | ## 1.3.0 27 | While primarily a maintenance release, one new feature has been added. WP Featherlight now supports Gutenberg galleries. 28 | 29 | Here's a full list of what's changed since the last release: 30 | 31 | - Feature: Gutenberg support 32 | - Tweak: General code cleanup in plugin 33 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.13` 34 | - Change of ownership 35 | 36 | ## 1.2.0 37 | This is primarily a maintenance release, but one new feature has been added. HTML in captions is now supported! 38 | 39 | Here's a full list of what's changed since the last release: 40 | 41 | - Feature: Allowed HTML to be displayed in lightbox image captions 42 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.9` 43 | - Dev: Updated [jQuery Detect Swipe](http://github.com/marcandre/detect_swipe) to `2.1.4` 44 | 45 | ## 1.1.0 46 | Thanks to some changes implemented in the core featherlight script, the accessibility of WP Featherlight is now significantly improved. Lightboxed elements now have more appropriate focus management for screen readers and the close button is more accessible. 47 | 48 | This update also fixes a potential plugin compatibly problem in the WordPress admin. In version 1.0, it was possible under unusual circumstances for the plugin to throw a fatal error when attempting to add the disable checkbox to the publish metabox. 49 | 50 | - Tweak: Improved accessibility (accessible close button, better focus management) 51 | - Fix: Prevented a fatal error that could happen when another plugin unsets the WP_Post object on the publish metabox. 52 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.0` 53 | 54 | ## 1.0.0 55 | Even though this is a major version change, this is primarily a maintenance release. The reason for the jump to 1.0.0 is because we've changed some code which could break backwards compatibility with custom extensions and integrations. 56 | 57 | If you're just using the plugin on your site and haven't customized it or paid anyone to customize it for you, you should be able to update without any issues. 58 | 59 | If you're a developer and have written custom code extending the PHP side of WP Featherlight, be sure to test your code before updating. 60 | 61 | Under the hood, we've [deprecated some internal methods](https://github.com/cipherdevgroup/wp-featherlight/search?utf8=%E2%9C%93&q=_deprecated_function) which could potentially break custom code which extends WP Featherlight. The changes are primarily limited to class initialization, so unless you were doing something specific to that, it's unlikely that you'll run into issues. 62 | 63 | - Tweak: Improved transition between images within galleries 64 | - Tweak: Moved our disable lightbox checkbox into the publish meta box to streamline the admin 65 | - Tweak: Made styles more aggressive to ensure elements look consistent across different themes by default 66 | - Fix: Reduced false positives for URLs that use image extensions but don't actually link to an image 67 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.5.1` 68 | - Dev: Updated [jQuery Detect Swipe](http://github.com/marcandre/detect_swipe) to `2.1.3` 69 | - Dev: Deprecated some internal methods 70 | - Dev: Reorganized how classes are instantiated and plugin actions are fired 71 | 72 | ## 0.3.0 73 | 74 | There are quite a few internal changes in the plugin for this release, plus some nice new features and improvements on the front-end. We've streamlined everything as much as possible and also added support for some languages other than English! Here's a breakdown of everything that's changed: 75 | 76 | ### New Features 77 | - Automatic captioning for WordPress images and gallery items (Including Jetpack Galleries) 78 | - Spanish language translation 79 | 80 | ### Enhancements 81 | - Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.3.3` 82 | - Improved gallery styles on desktop and mobile devices 83 | - Streamlined overall styles 84 | - Added SVG icons for more visual consistency across various platforms 85 | - Simplified the text used in the admin metabox to ease translations (props @toscho) 86 | 87 | ### Bug Fixes 88 | - Improved handling of images when certain caching plugins are enabled 89 | - Prevented gallery arrows from being hijacked by WP Emoji 90 | - Fixed a bug which allowed multiple light boxes to be opened using keyboard commands 91 | 92 | ### Developer Stuff 93 | - Reduced overhead by loading language files only when needed (props @toscho) 94 | - Improved the save routine for our admin metabox (props @toscho) 95 | - Added a `wp_featherlight_captions` filter to control auto-captioning. Filter it to false to disable captions. 96 | - Re-structured the plugin's internal code base and deprecated plugin constants 97 | - Added Grunt and Bower the plugin to allow easier updates and releases in the future 98 | 99 | ### Added Language Support 100 | - German 101 | - Spanish 102 | - French 103 | - Portuguese (Brazil) 104 | - Spanish (Peru) 105 | 106 | ## 0.2.0 107 | 108 | 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. 109 | 110 | There have also been a handful of code improvements under the hood including: 111 | 112 | - Added gallery support for Jetpack Tiled Galleries 113 | - Improved URL handling to match more image instances automatically 114 | - Fixed a mistake in the textdomain path 115 | - Improved admin metabox markup (props @GaryJones) 116 | - Fixed a typo in the main stylesheet's script handle (props @GaryJones) 117 | 118 | ## 0.1.1 119 | 120 | 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. 121 | 122 | ## 0.1.0 123 | 124 | Initial release! 125 | -------------------------------------------------------------------------------- /includes/class-scripts.php: -------------------------------------------------------------------------------- 1 | suffix = $this->get_suffix(); 52 | $this->url = $url; 53 | $this->version = $version; 54 | } 55 | 56 | /** 57 | * Helper function for getting the script `.min` suffix for minified files. 58 | * 59 | * @since 0.1.0 60 | * @access public 61 | * @return string 62 | */ 63 | public function get_suffix() { 64 | static $suffix; 65 | 66 | if ( null === $suffix ) { 67 | $debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG; 68 | $enabled = (bool) apply_filters( 'wp_featherlight_enable_suffix', ! $debug ); 69 | $suffix = $enabled ? '.min' : ''; 70 | } 71 | 72 | return $suffix; 73 | } 74 | 75 | /** 76 | * Load all required CSS files on the front end. 77 | * 78 | * Developers can disable our CSS by filtering wp_featherlight_load_css to 79 | * false within their theme or plugin. 80 | * 81 | * @since 0.1.0 82 | * @access public 83 | * @return void 84 | */ 85 | public function load_css() { 86 | if ( ! apply_filters( 'wp_featherlight_load_css', true ) ) { 87 | return; 88 | } 89 | 90 | wp_enqueue_style( 91 | 'wp-featherlight', 92 | "{$this->url}css/wp-featherlight{$this->suffix}.css", 93 | array(), 94 | $this->version 95 | ); 96 | 97 | wp_style_add_data( 'wp-featherlight', 'rtl', 'replace' ); 98 | 99 | wp_style_add_data( 'wp-featherlight', 'suffix', $this->suffix ); 100 | } 101 | 102 | /** 103 | * Helper function to determine whether or not to load a packed version of 104 | * our JavaScript libraries on the front end. 105 | * 106 | * Developers can filter wp_featherlight_enable_packed_js to false if they 107 | * are loading any of the following libraries in their theme or plugin: 108 | * 109 | * http://noelboss.github.io/featherlight/ 110 | * http://noelboss.github.io/featherlight/gallery.html 111 | * https://github.com/marcandre/detect_swipe 112 | * 113 | * @since 0.1.0 114 | * @access protected 115 | * @return bool 116 | */ 117 | protected function enable_packed_js() { 118 | if ( empty( $this->suffix ) ) { 119 | return false; 120 | } 121 | 122 | return apply_filters( 'wp_featherlight_enable_packed_js', true ); 123 | } 124 | 125 | /** 126 | * Load all required JavaScript files on the front end. 127 | * 128 | * Developers can disable our JS by filtering wp_featherlight_load_js to 129 | * false within their theme or plugin. 130 | * 131 | * @since 0.1.0 132 | * @access public 133 | * @return void 134 | */ 135 | public function load_js() { 136 | if ( ! apply_filters( 'wp_featherlight_load_js', true ) ) { 137 | return; 138 | } 139 | if ( $this->enable_packed_js() ) { 140 | $this->load_packed_js(); 141 | } else { 142 | $this->load_unpacked_js(); 143 | } 144 | } 145 | 146 | /** 147 | * Load the packed and minified version of our JavaScript files. This is the 148 | * preferred loading method as it saves us from adding a bunch of http 149 | * requests, but it could create conflicts with some plugins and themes. 150 | * 151 | * @since 0.1.0 152 | * @access public 153 | * @return void 154 | */ 155 | public function load_packed_js() { 156 | wp_enqueue_script( 157 | 'wp-featherlight', 158 | "{$this->url}js/wpFeatherlight.pkgd{$this->suffix}.js", 159 | array( 'jquery' ), 160 | $this->version, 161 | true 162 | ); 163 | } 164 | 165 | /** 166 | * Load all of our JS files individually to for maximum compatibility. 167 | * 168 | * @since 0.1.0 169 | * @access public 170 | * @return void 171 | */ 172 | public function load_unpacked_js() { 173 | wp_enqueue_script( 174 | 'jquery-detect-swipe', 175 | "{$this->url}js/vendor/jquery.detect_swipe{$this->suffix}.js", 176 | array( 'jquery' ), 177 | '2.1.4', 178 | true 179 | ); 180 | 181 | wp_enqueue_script( 182 | 'featherlight', 183 | "{$this->url}js/vendor/featherlight{$this->suffix}.js", 184 | array( 'jquery-detect-swipe' ), 185 | '1.7.9', 186 | true 187 | ); 188 | 189 | wp_enqueue_script( 190 | 'featherlight-gallery', 191 | "{$this->url}js/vendor/featherlight.gallery{$this->suffix}.js", 192 | array( 'featherlight' ), 193 | '1.7.9', 194 | true 195 | ); 196 | 197 | wp_enqueue_script( 198 | 'wp-featherlight', 199 | "{$this->url}js/wpFeatherlight{$this->suffix}.js", 200 | array( 'featherlight-gallery' ), 201 | $this->version, 202 | true 203 | ); 204 | } 205 | 206 | /** 207 | * Remove all required scripts and styles on entries where the user has 208 | * checked the admin option to disable the lightbox. 209 | * 210 | * @since 0.1.0 211 | * @access public 212 | * @return void 213 | */ 214 | public function maybe_disable() { 215 | if ( get_post_meta( get_the_ID(), 'wp_featherlight_disable', true ) ) { 216 | add_filter( 'wp_featherlight_load_css', '__return_false' ); 217 | add_filter( 'wp_featherlight_load_js', '__return_false' ); 218 | } 219 | } 220 | 221 | /** 222 | * Add custom body classes to help our script enable and disable features 223 | * without creating true plugin database options. 224 | * 225 | * @since 0.3.0 226 | * @access public 227 | * @param array $classes the existing body classes. 228 | * @return array $classes the amended body classes. 229 | */ 230 | public function script_helpers( $classes ) { 231 | if ( apply_filters( 'wp_featherlight_captions', true ) ) { 232 | $classes[] = 'wp-featherlight-captions'; 233 | } 234 | 235 | return $classes; 236 | } 237 | 238 | /** 239 | * Get the class running! 240 | * 241 | * @since 0.1.0 242 | * @access public 243 | * @return void 244 | */ 245 | public function run() { 246 | _deprecated_function( __METHOD__, '1.0.0' ); 247 | } 248 | 249 | /** 250 | * Hook into WordPress. 251 | * 252 | * @since 0.1.0 253 | * @access protected 254 | * @return void 255 | */ 256 | protected function wp_hooks() { 257 | _deprecated_function( __METHOD__, '1.0.0' ); 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === WP Featherlight - A Simple jQuery Lightbox === 2 | 3 | Contributors: fatmedia, cipherdevgroup, ozzyr 4 | Tags: lightbox, jquery lightbox, jquery, gallery, image, lightbox images, image lightbox, lightbox gallery, lightbox image, lightbox popup, featherlight, photo gallery, popup image, popup images, popup lightbox, responsive lightbox, swipe, wordpress image lightbox, wordpress lightbox, wordpress slideshow lightbox, photography, images, minimal, responsive, photo, photos 5 | Requires at least: 4.0 6 | Tested up to: 5.5.0 7 | Stable tag: 1.3.4 8 | License: GPL-2.0+ 9 | 10 | An ultra lightweight jQuery lightbox for WordPress images and galleries. 11 | 12 | == Description == 13 | 14 | WP Featherlight is a WordPress lightbox plugin for adding a minimal, high-performance, responsive jQuery lightbox to your WordPress website. At its core, 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. 15 | 16 | In order for WordPress images and galleries to be lightboxed, you need to select the "Media File" option when choosing where the thumbnails should link. You can also select the "Custom Link" option if you make sure to link directly to an image file. This should work for any image file, even if it's hosted on another website. 17 | 18 | It's also possible to lightbox videos, iframes, and ajax content with 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). 19 | 20 | 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. 21 | 22 | If you find a display problem, it may be related to your theme but please [open an support request](https://wordpress.org/support/plugin/wp-featherlight) 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/). 23 | 24 | = Developer Notes = 25 | 26 | While there are no options in the plugin, there are some handy filters to modify the default behavior. As of `0.3.0` all images which use the default WordPress captions will also include a caption when the image is lightboxed. To disable this behavior, filter `wp_featherlight_captions` to false. 27 | 28 | You can also disable inclusion of the CSS and JavaScript conditionally using filters which can be found in the `/includes/class-scripts.php` file. If you have questions about how any part of the plugin works, please don't hesitate to [open an issue on GitHub](https://github.com/cipherdevgroup/wp-featherlight/issues). 29 | 30 | = Contributing = 31 | 32 | If you'd like to submit code patches or contribute in any other way, please [fork the plugin on GitHub](https://github.com/cipherdevgroup/wp-featherlight). 33 | 34 | == Screenshots == 35 | 36 | 1. A view of the jQuery lightbox in action. 37 | 38 | == Changelog == 39 | 40 | = 1.3.3 = 41 | This is primarily a maintenance release, but one tweak was made. 42 | 43 | - Tweak: Changed name of meta box title 44 | 45 | = 1.3.2 = 46 | Release to downgrade Featherlight verison until all bugs are worked out. 47 | 48 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.13` 49 | 50 | = 1.3.1 = 51 | This is primarily a maintenance release, but one new feature has been added. Display the option to disable the lightbox in Gutenberg! 52 | 53 | Here's a full list of what's changed since the last release: 54 | 55 | - Feature: Add back metabox in sidebar 56 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.14` 57 | 58 | = 1.3.0 = 59 | While primarily a maintenance release, one new feature has been added. WP Featherlight now supports Gutenberg galleries. 60 | 61 | Here's a full list of what's changed since the last release: 62 | 63 | - Feature: Gutenberg support 64 | - Tweak: General code cleanup in plugin 65 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.13` 66 | - Change of ownership 67 | 68 | = 1.2.0 = 69 | This is primarily a maintenance release, but one new feature has been added. HTML in captions is now supported! 70 | 71 | Here's a full list of what's changed since the last release: 72 | 73 | - Feature: Allowed HTML to be displayed in lightbox image captions 74 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.9` 75 | - Dev: Updated [jQuery Detect Swipe](http://github.com/marcandre/detect_swipe) to `2.1.4` 76 | 77 | = 1.1.0 = 78 | Thanks to some changes implemented in the core featherlight script, the accessibility of WP Featherlight is now significantly improved. Lightboxed elements now have more appropriate focus management for screen readers and the close button is more accessible. 79 | 80 | This update also fixes a potential plugin compatibly problem in the WordPress admin. In version 1.0, it was possible under unusual circumstances for the plugin to throw a fatal error when attempting to add the disable checkbox to the publish metabox. 81 | 82 | - Tweak: Improved accessibility (accessible close button, better focus management) 83 | - Fix: Prevented a fatal error that could happen when another plugin unsets the WP_Post object on the publish metabox. 84 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.7.0` 85 | 86 | = 1.0.0 = 87 | Even though this is a major version change, this is primarily a maintenance release. The reason for the jump to 1.0.0 is because we've changed some code which could break backwards compatibility with custom extensions and integrations. 88 | 89 | If you're just using the plugin on your site and haven't customized it or paid anyone to customize it for you, you should be able to update without any issues. 90 | 91 | If you're a developer and have written custom code extending the PHP side of WP Featherlight, be sure to test your code before updating. 92 | 93 | Under the hood, we've [deprecated some internal methods](https://github.com/cipherdevgroup/wp-featherlight/search?utf8=%E2%9C%93&q=_deprecated_function) which could potentially break custom code which extends WP Featherlight. The changes are primarily limited to class initialization, so unless you were doing something specific to that, it's unlikely that you'll run into issues. 94 | 95 | - Tweak: Improved transition between images within galleries 96 | - Tweak: Moved our disable lightbox checkbox into the publish meta box to streamline the admin 97 | - Tweak: Made styles more aggressive to ensure elements look consistent across different themes by default 98 | - Fix: Reduced false positives for URLs that use image extensions but don't actually link to an image 99 | - Dev: Updated [Featherlight](https://github.com/noelboss/featherlight/) to `1.5.1` 100 | - Dev: Updated [jQuery Detect Swipe](http://github.com/marcandre/detect_swipe) to `2.1.3` 101 | - Dev: Deprecated some internal methods 102 | - Dev: Reorganized how classes are instantiated and plugin actions are fired 103 | 104 | [View the full changelog on GitHub](https://github.com/cipherdevgroup/wp-featherlight/blob/release/CHANGELOG.md) 105 | -------------------------------------------------------------------------------- /includes/class-plugin.php: -------------------------------------------------------------------------------- 1 | file = $args['file']; 85 | $this->dir = plugin_dir_path( $this->file ); 86 | $this->url = plugin_dir_url( $this->file ); 87 | } 88 | 89 | /** 90 | * Retrieve the plugin version number. 91 | * 92 | * @since 0.3.0 93 | * @access public 94 | * @return string 95 | */ 96 | public function get_version() { 97 | return self::VERSION; 98 | } 99 | 100 | /** 101 | * Retrieve a trailing slashed path to the plugin directory. 102 | * 103 | * @since 0.3.0 104 | * @access public 105 | * @return string 106 | */ 107 | public function get_file() { 108 | return $this->file; 109 | } 110 | 111 | /** 112 | * Retrieve a trailing slashed path to the plugin directory. 113 | * 114 | * @since 0.3.0 115 | * @access public 116 | * @return string 117 | */ 118 | public function get_dir() { 119 | return $this->dir; 120 | } 121 | 122 | /** 123 | * Retrieve a trailing slashed URL to the plugin directory. 124 | * 125 | * @since 0.3.0 126 | * @access public 127 | * @return string 128 | */ 129 | public function get_url() { 130 | return $this->url; 131 | } 132 | 133 | /** 134 | * Require all global plugin files. 135 | * 136 | * @since 0.1.0 137 | * @access protected 138 | * @return void 139 | */ 140 | protected function includes() { 141 | require_once $this->dir . 'includes/class-scripts.php'; 142 | } 143 | 144 | /** 145 | * Require all admin plugin files. 146 | * 147 | * @since 0.1.0 148 | * @access protected 149 | * @return void 150 | */ 151 | protected function admin_includes() { 152 | require_once $this->dir . 'includes/class-i18n.php'; 153 | require_once $this->dir . 'admin/class-meta.php'; 154 | } 155 | 156 | /** 157 | * Load all required files and get all of our classes running. 158 | * 159 | * @since 0.1.0 160 | * @access protected 161 | * @return void 162 | */ 163 | protected function instantiate() { 164 | $this->scripts = new WP_Featherlight_Scripts( $this->url, self::VERSION ); 165 | } 166 | 167 | /** 168 | * Load all required files and get all of our classes running. 169 | * 170 | * @since 0.1.0 171 | * @access protected 172 | * @return void 173 | */ 174 | protected function admin_instantiate() { 175 | $this->i18n = new WP_Featherlight_Language_Loader( 'wp-featherlight', $this->file ); 176 | $this->meta = new WP_Featherlight_Admin_Meta; 177 | $this->meta->run(); 178 | } 179 | 180 | /** 181 | * Run all global WordPress hooks. 182 | * 183 | * @since 1.0.0 184 | * @return void 185 | */ 186 | protected function wp_hooks() { 187 | /** 188 | * Callback defined in includes/class-scripts.php 189 | * 190 | * @see WP_Featherlight_Scripts::load_css 191 | */ 192 | add_action( 'wp_enqueue_scripts', array( $this->scripts, 'load_css' ), 20 ); 193 | 194 | /** 195 | * Callback defined in includes/class-scripts.php 196 | * 197 | * @see WP_Featherlight_Scripts::load_js 198 | */ 199 | add_action( 'wp_enqueue_scripts', array( $this->scripts, 'load_js' ), 20 ); 200 | 201 | /** 202 | * Callback defined in includes/class-scripts.php 203 | * 204 | * @see WP_Featherlight_Scripts::maybe_disable 205 | */ 206 | add_action( 'wp_enqueue_scripts', array( $this->scripts, 'maybe_disable' ), 10 ); 207 | 208 | /** 209 | * Callback defined in includes/class-scripts.php 210 | * 211 | * @see WP_Featherlight_Scripts::script_helpers 212 | */ 213 | add_action( 'body_class', array( $this->scripts, 'script_helpers' ), 10 ); 214 | } 215 | 216 | /** 217 | * Run all admin WordPress hooks. 218 | * 219 | * @since 1.0.0 220 | * @return void 221 | */ 222 | protected function admin_wp_hooks() { 223 | /** 224 | * Callback defined in includes/class-i18n.php 225 | * 226 | * @see WP_Featherlight_Language_Loader::load 227 | */ 228 | add_action( 'admin_head-plugins.php', array( $this->i18n, 'load' ), 10 ); 229 | 230 | /** 231 | * Callback defined in includes/class-i18n.php 232 | * 233 | * @see WP_Featherlight_Language_Loader::load 234 | */ 235 | add_action( 'post_submitbox_misc_actions', array( $this->i18n, 'load' ), 5 ); 236 | 237 | /** 238 | * Callback defined in admin/class-meta.php 239 | * 240 | * @see WP_Featherlight_Admin_Meta::meta_box_view 241 | */ 242 | add_action( 'post_submitbox_misc_actions', array( $this->meta, 'meta_box_view' ), 10 ); 243 | 244 | /** 245 | * Callback defined in admin/class-meta.php 246 | * 247 | * @see WP_Featherlight_Admin_Meta::save_meta_boxes 248 | */ 249 | add_action( 'save_post', array( $this->meta, 'save_meta_boxes' ), 10 ); 250 | } 251 | 252 | /** 253 | * Initialize all global functionality. 254 | * 255 | * @since 1.0.0 256 | * @return void 257 | */ 258 | public function init() { 259 | /** 260 | * Provide reliable access to the plugin's functions and methods before 261 | * the plugin's global actions, filters, and functionality are initialized. 262 | * 263 | * @since 1.0.0 264 | * @access public 265 | */ 266 | do_action( 'wp_featherlight_before_init' ); 267 | 268 | $this->includes(); 269 | $this->instantiate(); 270 | $this->wp_hooks(); 271 | 272 | /** 273 | * Provide reliable access to the plugin's functions and methods after 274 | * the plugin's global actions, filters, and functionality are initialized. 275 | * 276 | * @since 1.0.0 277 | * @access public 278 | */ 279 | do_action( 'wp_featherlight_after_init' ); 280 | } 281 | 282 | /** 283 | * Initialize all admin functionality. 284 | * 285 | * @since 1.0.0 286 | * @return void 287 | */ 288 | public function admin_init() { 289 | /** 290 | * Provide reliable access to the plugin's functions and methods before 291 | * the plugin's admin actions, filters, and functionality are initialized. 292 | * 293 | * @since 1.0.0 294 | * @access public 295 | */ 296 | do_action( 'wp_featherlight_admin_before_init' ); 297 | 298 | $this->admin_includes(); 299 | $this->admin_instantiate(); 300 | $this->admin_wp_hooks(); 301 | 302 | /** 303 | * Provide reliable access to the plugin's functions and methods after 304 | * the plugin's admin actions, filters, and functionality are initialized. 305 | * 306 | * @since 1.0.0 307 | * @access public 308 | */ 309 | do_action( 'wp_featherlight_admin_after_init' ); 310 | } 311 | 312 | /** 313 | * Initialize the plugin. 314 | * 315 | * @since 0.1.0 316 | * @return void 317 | */ 318 | public function run() { 319 | $this->init(); 320 | if ( is_admin() ) { 321 | $this->admin_init(); 322 | } 323 | } 324 | 325 | /** 326 | * Runs on plugin activation to set a default admin content label for all 327 | * existing posts using the post title. 328 | * 329 | * @since 0.1.0 330 | * @access public 331 | * @return void 332 | */ 333 | public function activate() { 334 | // Nothing yet. 335 | } 336 | } 337 | -------------------------------------------------------------------------------- /js/vendor/featherlight.min.js: -------------------------------------------------------------------------------- 1 | !function(u){"use strict";if(void 0!==u)if(u.fn.jquery.match(/-ajax/))"console"in window&&window.console.info("Featherlight needs regular jQuery, not the slim version.");else{var r=[],i=function(t){return r=u.grep(r,function(e){return e!==t&&0','
','",'
'+n.loading+"
","
","
"].join("")),o="."+n.namespace+"-close"+(n.otherClose?","+n.otherClose:"");return n.$instance=i.clone().addClass(n.variant),n.$instance.on(n.closeTrigger+"."+n.namespace,function(e){if(!e.isDefaultPrevented()){var t=u(e.target);("background"===n.closeOnClick&&t.is("."+n.namespace)||"anywhere"===n.closeOnClick||t.closest(o).length)&&(n.close(e),e.preventDefault())}}),this},getContent:function(){if(!1!==this.persist&&this.$content)return this.$content;var t=this,e=this.constructor.contentFilters,n=function(e){return t.$currentTarget&&t.$currentTarget.attr(e)},r=n(t.targetAttr),i=t.target||r||"",o=e[t.type];if(!o&&i in e&&(o=e[i],i=t.target&&r),i=i||n("href")||"",!o)for(var a in e)t[a]&&(o=e[a],i=t[a]);if(!o){var s=i;if(i=null,u.each(t.contentFilters,function(){return(o=e[this]).test&&(i=o.test(s)),!i&&o.regex&&s.match&&s.match(o.regex)&&(i=s),!i}),!i)return"console"in window&&window.console.error("Featherlight: no content filter found "+(s?' for "'+s+'"':" (no target specified)")),!1}return o.process.call(t,i)},setContent:function(e){return this.$instance.removeClass(this.namespace+"-loading"),this.$instance.toggleClass(this.namespace+"-iframe",e.is("iframe")),this.$instance.find("."+this.namespace+"-inner").not(e).slice(1).remove().end().replaceWith(u.contains(this.$instance[0],e[0])?"":e),this.$content=e.addClass(this.namespace+"-inner"),this},open:function(t){var n=this;if(n.$instance.hide().appendTo(n.root),!(t&&t.isDefaultPrevented()||!1===n.beforeOpen(t))){t&&t.preventDefault();var e=n.getContent();if(e)return r.push(n),s(!0),n.$instance.fadeIn(n.openSpeed),n.beforeContent(t),u.when(e).always(function(e){n.setContent(e),n.afterContent(t)}).then(n.$instance.promise()).done(function(){n.afterOpen(t)})}return n.$instance.detach(),u.Deferred().reject().promise()},close:function(e){var t=this,n=u.Deferred();return!1===t.beforeClose(e)?n.reject():(0===i(t).length&&s(!1),t.$instance.fadeOut(t.closeSpeed,function(){t.$instance.detach(),t.afterClose(e),n.resolve()})),n.promise()},resize:function(e,t){if(e&&t){this.$content.css("width","").css("height","");var n=Math.max(e/(this.$content.parent().width()-1),t/(this.$content.parent().height()-1));1');return n.onload=function(){r.naturalWidth=n.width,r.naturalHeight=n.height,t.resolve(r)},n.onerror=function(){t.reject(r)},n.src=e,t.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(e){return u(e)}},ajax:{regex:/./,process:function(e){var n=u.Deferred(),r=u("
").load(e,function(e,t){"error"!==t&&n.resolve(r.contents()),n.fail()});return n.promise()}},iframe:{process:function(e){var t=new u.Deferred,n=u("