Skip to content

Commit

Permalink
Merge branch 'release-2.6.0' into releases
Browse files Browse the repository at this point in the history
  • Loading branch information
archetyped committed Nov 5, 2016
2 parents 9f4a131 + 826c4b2 commit f64f3a5
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 26 deletions.
2 changes: 1 addition & 1 deletion client/js/dev/lib.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -3070,7 +3070,7 @@ var Content_Item = {

// Element text
if ( !title ) {
title = dom.text();
title = dom.get(0).innerText.trim();
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/js/prod/lib.core.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions client/js/prod/lib.view.js

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ public function _hooks_init() {
add_action('dynamic_sidebar_before', $this->m('widget_block_start'));
add_action('dynamic_sidebar_after', $this->m('widget_block_finish'));
}

// Menus
if ( $this->options->get_bool('enabled_menu') ) {
add_filter('wp_nav_menu', $this->m('menu_process'), $priority, 2);
}
}
}

Expand Down Expand Up @@ -249,10 +254,12 @@ protected function _options() {
'enabled_page' => array('title' => __('Enable on Pages', 'simple-lightbox'), 'default' => true, 'group' => array('activation', 40)),
'enabled_archive' => array('title' => __('Enable on Archive Pages (tags, categories, etc.)', 'simple-lightbox'), 'default' => true, 'group' => array('activation', 50)),
'enabled_widget' => array('title' => __('Enable for Widgets', 'simple-lightbox'), 'default' => false, 'group' => array('activation', 60)),
'enabled_menu' => array('title' => __('Enable for Menus', 'simple-lightbox'), 'default' => false, 'group' => array('activation', 60)),
'group_links' => array('title' => __('Group items (for displaying as a slideshow)', 'simple-lightbox'), 'default' => true, 'group' => array('grouping', 10)),
'group_post' => array('title' => __('Group items by Post (e.g. on pages with multiple posts)', 'simple-lightbox'), 'default' => true, 'group' => array('grouping', 20)),
'group_gallery' => array('title' => __('Group gallery items separately', 'simple-lightbox'), 'default' => false, 'group' => array('grouping', 30)),
'group_widget' => array('title' => __('Group widget items separately', 'simple-lightbox'), 'default' => false, 'group' => array('grouping', 40)),
'group_menu' => array('title' => __('Group menu items separately', 'simple-lightbox'), 'default' => false, 'group' => array('grouping', 50)),
'ui_autofit' => array('title' => __('Resize lightbox to fit in window', 'simple-lightbox'), 'default' => true, 'group' => array('ui', 10), 'in_client' => true),
'ui_animate' => array('title' => __('Enable animations', 'simple-lightbox'), 'default' => true, 'group' => array('ui', 20), 'in_client' => true),
'slideshow_autostart' => array('title' => __('Start Slideshow Automatically', 'simple-lightbox'), 'default' => true, 'group' => array('ui', 30), 'in_client' => true),
Expand Down Expand Up @@ -624,6 +631,13 @@ protected function process_links($content, $group = null) {
$group[] = $g_props->base;
}

/**
* Filter group ID components
*
* @see process_links()
*
* @param array $group Components used to build group ID
*/
$group = $this->util->apply_filters('get_group_id', $group);

// Default group
Expand Down Expand Up @@ -1443,6 +1457,56 @@ public function widget_block_handle($is_content_valid) {
return false;
}

/*-** Menus **-*/

/**
* Process navigation menu links
*
* @see wp_nav_menu()/filter: wp_nav_menu
*
* @param string $nav_menu HTML content for navigation menu.
* @param object $args Navigation menu's arguments.
*/
public function menu_process($nav_menu, $args) {
// Grouping
if ( $this->options->get_bool('group_menu') ) {
// Generate group ID for menu
$group = 'menu';
$sep = '_';
if ( !empty( $args->menu_id ) ) {
$group .= $sep . $args->menu_id;
} elseif ( !empty( $args->menu ) ) {
$group .= $sep . ( ( is_object($args->menu) ) ? $args->menu->slug : $args->menu );
}
$group = $this->group_id_unique( $group );
} else {
$group = null;
}

// Process menu
$nav_menu = $this->activate_links($nav_menu, $group);

return $nav_menu;
}

/**
* Generate unique group ID
*
* @param string $group Group ID to check
* @return string Unique group ID
*/
public function group_id_unique($group) {
static $groups = array();
while ( in_array($group, $groups) ) {
$patt = '#-(\d+)$#';
if ( preg_match( $patt, $group, $matches ) )
$group = preg_replace($patt, '-' . ++$matches[1], $group );
else
$group = $group . '-1';
}
return $group;
}

/*-** Helpers **-*/

/**
Expand Down
1 change: 0 additions & 1 deletion grunt/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ grunt.config('sass', {
},
themes : {
options : {
includePaths : require('node-bourbon').includePaths
},
files : [{
expand : true,
Expand Down
4 changes: 2 additions & 2 deletions includes/class.utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ function get_plugin_base_file() {
$data = get_file_data($ftemp, $this->_plugin['headers']);
if ( !empty($data['Name']) ) {
// Set base file
$file = $ftemp;
$ret = $ftemp;
// Save plugin data
$this->set_plugin_info($data);
break;
Expand All @@ -1319,7 +1319,7 @@ function get_plugin_base_file() {
@closedir($dir);
}
// Return
return $file;
return $ret;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion main.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Simple Lightbox
Plugin URI: http://archetyped.com/tools/simple-lightbox/
Description: The highly customizable lightbox for WordPress
Version: 2.5.3
Version: 2.6.0
Text Domain: simple-lightbox
Domain Path: /l10n
Author: Archetyped
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
{
"name": "simple-lightbox",
"version": "2.5.3",
"version": "2.6.0",
"title": "Simple Lightbox",
"description": "The highly-customizable lightbox for WordPress",
"author": "Archetyped <[email protected]>",
"license": "GPLv2",
"private": true,
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-phplint": "0.0.5",
"grunt-sass": "^1.0.0",
"jshint-stylish": "^2.0.0",
"load-grunt-tasks": "^3.2.0",
"node-bourbon": "^4.2.3",
"time-grunt": "^1.2.1"
"grunt": "^1.0.1",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-uglify": "^2.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-phplint": "0.0.8",
"grunt-sass": "^1.2.1",
"jshint-stylish": "^2.2.1",
"load-grunt-tasks": "^3.5.2",
"time-grunt": "^1.4.0"
}
}
11 changes: 9 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: Archetyped
Donate link: http://gum.co/slb-donate
License: GPLv2
Tags: lightbox, gallery, photography, images, theme, template, style
Requires at least: 4.5
Tested up to: 4.5
Requires at least: 4.6
Tested up to: 4.6
Stable tag: trunk

The highly customizable lightbox for WordPress
Expand Down Expand Up @@ -57,6 +57,13 @@ Get more information on [Simple Lightbox's official page](http://archetyped.com/

== Changelog ==

= 2.6.0 =

* Add: Activate links in native WordPress navigation menus (enable in admin settings)
* Add: Group menu links separately (enable in admin settings)
* Optimize: Fallback lightbox title text retrieval (link text)
* Fix: Undefined variable in `Utilities::get_plugin_base_file()` (The Lost Temple of Xavivars)

= 2.5.3 =

* Optimize: Entity handling in URIs for different server environments
Expand Down
2 changes: 1 addition & 1 deletion themes/baseline/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions themes/baseline/sass/style.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
//Imports

@import "bourbon";

//Variables

//Mixins

%box-sizing-border-box {
@include box-sizing(border-box);
box-sizing: border-box;
}

#slb_viewer_wrap {
Expand Down
2 changes: 1 addition & 1 deletion themes/default/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f64f3a5

Please sign in to comment.