Skip to content

Commit

Permalink
Merge branch 'pre-release'
Browse files Browse the repository at this point in the history
  • Loading branch information
shin committed Feb 20, 2017
2 parents 4f8bea7 + 308cde4 commit da6707f
Show file tree
Hide file tree
Showing 79 changed files with 739 additions and 1,781 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Module system.

* [@MaksimTS](https://github.com/MaksimTS) - **Manager**
* [@Cheh](https://github.com/cheh) - **Developer**
* [@dkfiresky](https://github.com/dkfiresky) - **Developer**
* [@Behaart](https://github.com/MakhonkoDenis) - **Developer**
* [@MjHead](https://github.com/MjHead) - **Developer**
* [@Sargas](https://github.com/SargasTM) - **Developer**
Expand Down
2 changes: 1 addition & 1 deletion cherry-core.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Class Cherry Core
* Version: 1.4.0
* Version: 1.4.1
*
* @package Cherry_Framework
* @subpackage Class
Expand Down
18 changes: 9 additions & 9 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name" : "Cherry Framework",
"version" : "1.4.0",
"version" : "1.4.1",
"description" : "",
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs",
"git_link" : "https://github.com/CherryFramework/cherry-framework",
"modules" : {
"cherry-breadcrumbs" : {
"name" : "Breadcrumb Trail",
"description" : "A breadcrumb menu script for WordPress.",
"version" : "1.1.2",
"version" : "1.1.3",
"doc_link" : "",
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-breadcrumbs",
"compatible" : ["theme", "plugin"],
Expand All @@ -19,7 +19,7 @@
"cherry-customizer" : {
"name" : "Customizer API",
"description" : "Customizer functionality.",
"version" : "1.1.5",
"version" : "1.1.6",
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/01.%20cherry-customizer.md",
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-customizer",
"compatible" : ["theme", "plugin"],
Expand All @@ -41,7 +41,7 @@
"cherry-dynamic-css" : {
"name" : "Dynamic CSS",
"description" : "Generate CSS.",
"version" : "1.2.2",
"version" : "1.4.0",
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/03.%20cherry-dynamic-css.md",
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-dynamic-css",
"compatible" : ["theme", "plugin"],
Expand All @@ -63,7 +63,7 @@
"cherry-handler" : {
"name" : "Cherry handler",
"description" : "Initialize handlers.",
"version" : "1.1.1",
"version" : "1.1.2",
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/02.%20cherry-handler.md",
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-handler",
"compatible" : ["theme", "plugin"],
Expand Down Expand Up @@ -118,7 +118,7 @@
"cherry-template-manager" : {
"name" : "Template Manager",
"description" : "Module for load and parse *.tmpl files.",
"version" : "1.0.1",
"version" : "1.0.2",
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/05.%20cherry-template-manager.md",
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-template-manager",
"compatible" : ["theme", "plugin"],
Expand Down Expand Up @@ -151,7 +151,7 @@
"cherry-ui-elements" : {
"name" : "UI Elements",
"description" : "UI Elements",
"version" : "1.3.4",
"version" : "1.4.0",
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/09.%20cherry-ui-elements.md",
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-ui-elements",
"compatible" : ["theme", "plugin"],
Expand All @@ -162,7 +162,7 @@
"cherry-utility" : {
"name" : "Utility",
"description" : "Multiple utility functions.",
"version" : "1.1.5",
"version" : "1.1.6",
"doc_link" : "https://github.com/CherryFramework/cherry-framework-docs/blob/master/08.%20cherry-utility.md",
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry-utility",
"compatible" : ["theme", "plugin"],
Expand All @@ -184,7 +184,7 @@
"cherry5-insert-shortcode" : {
"name" : "Insert Shortcode",
"description" : "The module allows you to add shortcodes from editor tinyMCE.",
"version" : "1.0.0",
"version" : "1.0.1",
"doc_link" : "",
"git_link" : "https://github.com/CherryFramework/cherry-framework/tree/master/modules/cherry5-insert-shortcode",
"compatible" : [ "plugin" ],
Expand Down
6 changes: 3 additions & 3 deletions modules/cherry-breadcrumbs/cherry-breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Module Name: Breadcrumb Trail
* Description: A breadcrumb menu script for WordPress
* Version: 1.1.2
* Version: 1.1.3
* Author: Cherry Team
* Author URI: http://www.cherryframework.com/
* License: GPLv3
Expand Down Expand Up @@ -916,10 +916,10 @@ public function add_post_type_archive_items() {
/* Get the post type object. */
$post_type_object = get_post_type_object( get_query_var( 'post_type' ) );

if ( false !== $post_type_object->rewrite ) {
if ( ! empty( $post_type_object ) && false !== $post_type_object->rewrite ) {

/* If 'with_front' is true, add $wp_rewrite->front to the trail. */
if ( $post_type_object->rewrite['with_front'] ) {
if ( ! empty( $post_type_object->rewrite ) && $post_type_object->rewrite['with_front'] ) {
$this->add_rewrite_front_items();
}
}
Expand Down
8 changes: 5 additions & 3 deletions modules/cherry-customizer/cherry-customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/**
* Module Name: Customizer
* Description: Customizer functionality.
* Version: 1.1.5
* Version: 1.1.6
* Author: Cherry Team
* Author URI: http://www.cherryframework.com/
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* @package Cherry_Framework
* @subpackage Modules
* @version 1.1.5
* @version 1.1.6
* @author Cherry Team <[email protected]>
* @copyright Copyright (c) 2012 - 2016, Cherry Team
* @link http://www.cherryframework.com/
Expand Down Expand Up @@ -797,6 +797,8 @@ public function sanitize_range( $number, $setting ) {
// Get step.
$step = ( isset( $atts['step'] ) ? $atts['step'] : 1 );

$number = ( ! isset( $atts['min'] ) && 0 > $number ) ? $setting->default : $number ;

if ( is_float( $step ) ) {

// Ensure input is a float value.
Expand All @@ -805,7 +807,7 @@ public function sanitize_range( $number, $setting ) {
} else {

// Ensure input is an absolute integer.
$number = absint( $number );
$number = ( isset( $atts['min'] ) && 0 > $atts['min'] && 0 > $number ) ? intval( $number ) : absint( $number );
$checker = is_int( $number / $step );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ public function render_content() {
<span class="customize-control-title">
<?php echo esc_html( $this->label ); ?>
</span>

<?php if ( isset( $this->description ) ) : ?>
<span class="description customize-control-description">
<?php echo wp_kses_post( $this->description ); ?>
</span>
<?php endif; ?>
</label>
<?php
echo str_replace(
Expand Down
104 changes: 85 additions & 19 deletions modules/cherry-dynamic-css/cherry-dynamic-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
/**
* Module Name: Dynamic CSS
* Description: CSS parser which uses variables & functions for CSS code optimization
* Version: 1.2.2
* Version: 1.4.0
* Author: Cherry Team
* Author URI: http://www.cherryframework.com/
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* @package Cherry_Framework
* @subpackage Modules
* @version 1.2.2
* @version 1.4.0
* @author Cherry Team <[email protected]>
* @copyright Copyright (c) 2012 - 2016, Cherry Team
* @copyright Copyright (c) 2012 - 2017, Cherry Team
* @link http://www.cherryframework.com/
* @license http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down Expand Up @@ -72,25 +72,64 @@ class Cherry_Dynamic_Css {
*/
public static $collector = null;

/**
* Reserved words list
*
* @since 1.4.0
* @var array
*/
public $css_reserved = array(
'media',
'supports',
);

/**
* Constructor for the module
*/
function __construct( $core, $args ) {

$this->core = $core;
$this->args = wp_parse_args( $args, array(
'prefix' => 'blank',
'type' => 'theme_mod',
'single' => true,
'css_files' => null,
'options' => array(),
'prefix' => 'blank',
'type' => 'theme_mod',
'parent_handle' => false,
'single' => true,
'css_files' => null,
'options' => array(),
) );

add_action( 'wp_head', array( $this, 'print_inline_css' ), 99 );

$this->init_dynamic_css();
$this->init_collector();
}

/**
* Initalize dynamic CSS with fallback compatibility.
*
* @since 1.3.0
* @return void
*/
public function init_dynamic_css() {

/**
* Not actual for now, required only for fallback compatibility.
*/
if ( empty( $this->args['parent_handle'] ) ) {
add_action( 'wp_head', array( $this, 'print_inline_css' ), 99 );
}

add_action( 'wp_enqueue_scripts', array( $this, 'add_inline_css' ), 99 );
}

/**
* Adds inline CSS into queue
*
* @since 1.3.0
* @return void
*/
public function add_inline_css() {
wp_add_inline_style( $this->args['parent_handle'], $this->get_inline_css() );
}

/**
* Initalize CSS collector class
*
Expand Down Expand Up @@ -296,12 +335,12 @@ public function parse( $css ) {
}

/**
* Print inline CSS after current theme stylesheet
* Returns complied dynamic CSS string.
*
* @since 1.0.0
* @return void|bool false
* @since 1.3.0
* @return string|bool false
*/
public function print_inline_css() {
public function get_inline_css() {

if ( ! $this->args['css_files'] ) {
return false;
Expand All @@ -311,6 +350,14 @@ public function print_inline_css() {
$this->args['css_files'] = array( $this->args['css_files'] );
}

/**
* Filter CSS reserved words list
*
* @since 1.4.0
* @var array
*/
$this->css_reserved = apply_filters( 'cherry_dynamic_css_reserved_words_list', $this->css_reserved );

ob_start();

foreach ( $this->args['css_files'] as $file ) {
Expand Down Expand Up @@ -344,6 +391,23 @@ public function print_inline_css() {
*/
$parsed_css = apply_filters( 'cherry_dynamic_css_parsed_styles', $parsed_css, $this->args );

return $parsed_css;
}

/**
* Print inline CSS after current theme stylesheet
*
* @since 1.0.0
* @return void|bool false
*/
public function print_inline_css() {

$parsed_css = $this->get_inline_css();

if ( empty( $parsed_css ) ) {
return false;
}

printf( '<style type="text/css">%s</style>', $parsed_css );

}
Expand Down Expand Up @@ -409,11 +473,13 @@ function replace_func( $matches ) {

$functions = $this->get_css_functions();

// check if function exists and is not CSS @media query
if ( ! array_key_exists( $matches[2], $functions ) && 'media' !== $matches[2] ) {
return $not_found;
} elseif ( 'media' == $matches[2] ) {
return $matches[0];
// check if function exists and is not CSS-reserved word
if ( ! array_key_exists( $matches[2], $functions ) ) {
if ( is_array( $this->css_reserved ) && in_array( $matches[2], $this->css_reserved ) ) {
return $matches[0];
} else {
return $not_found;
}
}

$function = $functions[ $matches[2] ];
Expand Down
3 changes: 2 additions & 1 deletion modules/cherry-handler/assets/js/cherry-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'cache': false,
'processData': true,
'url': '',
'async': false,
'beforeSendCallback': function() {},
'errorCallback': function() {},
'successCallback': function() {},
Expand Down Expand Up @@ -109,7 +110,7 @@
dataType: self.handlerSettings.data_type,
processData: settings.processData,
beforeSend: function( jqXHR, ajaxSettings ) {
if ( null !== self.ajaxRequest ) {
if ( null !== self.ajaxRequest && ! settings.async ) {
self.ajaxRequest.abort();
}

Expand Down
13 changes: 2 additions & 11 deletions modules/cherry-handler/cherry-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
/**
* Module Name: Cherry handler
* Description: Initializes handlers
* Version: 1.1.1
* Version: 1.1.2
* Author: Cherry Team
* Author URI: http://www.cherryframework.com/
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* @package Cherry_Framework
* @subpackage Modules
* @version 1.1.1
* @version 1.1.2
* @author Cherry Team <[email protected]>
* @copyright Copyright (c) 2012 - 2016, Cherry Team
* @link http://www.cherryframework.com/
Expand All @@ -31,15 +31,6 @@
*/
class Cherry_Handler {

/**
* A reference to an instance of this class.
*
* @since 1.0.0
* @access private
* @var object
*/
private static $handlers_list = array();

/**
* Default settings.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ html{
color: $link-hover-color;
}
&:focus{
outline: 1px solid $link-hover-color;
outline: 1px solid rgba(41, 143, 252, .6);
box-shadow: 0px 0px 2px rgba(41,143,252,0.6);
}
}
&__description{
Expand Down
Loading

0 comments on commit da6707f

Please sign in to comment.