Skip to content

Commit

Permalink
Merge pull request #39 from codefoxes/dev
Browse files Browse the repository at this point in the history
Version 2.0.0
  • Loading branch information
karthikax authored Oct 25, 2020
2 parents f1752d5 + 9120f46 commit 473820d
Show file tree
Hide file tree
Showing 130 changed files with 18,755 additions and 6,730 deletions.
17 changes: 17 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"ignore": [
"node_modules/**"
]
}
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ node_modules/

assets/css/*
assets/js/*
library/backend/assets/js/greenlet-controls.js
library/backend/assets/fonts/google-fonts.json
library/backend/assets/css/greenlet-preview.*
library/backend/assets/js/greenlet-*

library/addons/colorwings/js/color-wings.js.map
library/addons/colorwings/js/color-wings-preview.js.map
library/addons/colorwings/fonts/google-fonts.json

**/cypress.env.json
**/cypress/videos
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "library/pro"]
path = library/pro
url = [email protected]
[submodule "src/backend/colorwings"]
path = src/backend/colorwings
url = [email protected]
51 changes: 51 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Version 2.0.0 / Release: 25-10-2020
===================
- New: Visual CSS editor under "Extra Styles".
- New: Unlimited Headers and Footers creator.
- New: Individual post/page layout selector
- Improvement: All visual styles are moved to "Extra Styles".
- Improvement: Bootstrap update to 4.5.3.
- Improvement: Show logo, title & tagline independently.
- Improvement: Full-width & full-width container block support

Version 1.2.4 / Release: 24-04-2020
===================
- Improvement: Remove Post meta boxes
- Fix: Fix editor styles

Version 1.2.1 / Release: 11-04-2020
===================
- Improvement: Removed options from the themes admin page
- Improvement: Original (un-minified version) of the minified files are included
- Improvement: "Disable emoji" feature is removed
- Improvement: "Meta description" is removed
- Improvement: All non-translatable text strings are converted into translatable strings.
- Improvement: Escaping is added to untrusted data wherever appropriate.
- Fix: Keyboard Navigation

Version 1.2.0 / Release: 23-03-2020
===================
- New: Added presets
- New: Added code customizer options
- Improvement: Bundled Bootstrap with theme

Version 1.1.0 / Release: 15-03-2020
===================
- New: Added Google Fonts
- New: WooCommerce Support
- New: Added Customizer Border
- New: Added Customizer Color
- New: Added Customizer Length
- New: Editor Styles
- New: Logo width and Height
- Improvement: Better cover template selector
- Improvement: Styles improvement
- Improvement: Added more customizer options
- Improvement: Multiple Customizer options with Hot reload
- Improvement: Better CSS rendering
- Improvement: Meta display options
- Improvement: Better Template loader

Version 1.0.0 / Release: 23-01-2020
===================
- Initial release
180 changes: 180 additions & 0 deletions library/addons/colorwings/class-colorwings-admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
<?php
/**
* Color Wings Admin Manager.
*
* @package ColorWings
*/

namespace ColorWings;

/**
* Class Color Wings Admin.
*
* @since 1.0.0
*/
class ColorWings_Admin {
/**
* Holds the instances of this class.
*
* @since 1.0.0
* @access private
* @var object
*/
private static $instance;

/**
* Sets up Color Wings admin features.
*
* @since 1.0.0
* @access public
* @return void
*/
public function __construct() {
$enable_color_wings = apply_filters( 'enable_color_wings', true );
if ( ! $enable_color_wings ) {
return;
}

add_action( 'customize_register', array( $this, 'require_control_classes' ) );
add_action( 'customize_register', array( $this, 'register_controls' ) );
add_action( 'customize_register', array( $this, 'add_controls' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ), 20 );
}

/**
* Require control classes.
*
* @since 1.0.0
*/
public function require_control_classes() {
require_once dirname( __FILE__ ) . '/class-control-colorwings.php';
require_once dirname( __FILE__ ) . '/class-control-link.php';
}

/**
* Enqueue Customizer Preview Scripts.
*
* @since 1.0.0
*/
public function enqueue_preview_scripts() {
$min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_enqueue_script( 'color-wings-preview', COLORWINGS_URL . '/js/color-wings-preview' . $min . '.js', array( 'react-dom', 'customize-preview' ), COLORWINGS_VERSION, true );

$preview_object = array(
'pages' => array(
'is_front_page' => is_front_page(),
'is_home' => is_home(),
'is_archive' => is_archive(),
'is_page' => is_page(),
'is_single' => is_single(),
),
'page' => array(
'id' => get_the_ID(),
'title' => get_the_title(),
),
);
wp_localize_script( 'color-wings-preview', 'cwPreviewObject', $preview_object );
}

/**
* Register Custom Control.
*
* @since 1.0.0
* @param object $wp_customize WP_Customize_Manager.
*/
public function register_controls( $wp_customize ) {
$wp_customize->register_control_type( 'ColorWings\Control_ColorWings' );
$wp_customize->register_control_type( 'ColorWings\Control_Link' );
}

/**
* Add Custom Control.
*
* @since 1.0.0
* @param object $wp_customize WP_Customize_Manager.
*/
public function add_controls( $wp_customize ) {
$wp_customize->add_section(
'extra_styles',
array(
'title' => __( 'Extra Styles', 'greenlet' ),
'priority' => 900,
'capability' => 'edit_theme_options',
)
);

$wp_customize->add_setting(
'color_wings',
array(
'type' => 'option',
'capability' => 'edit_theme_options',
'transport' => 'postMessage',
'sanitize_callback' => array( $this, 'sanitize' ),
'validate_callback' => array( $this, 'validate' ),
)
);

$wp_customize->add_control(
new Control_ColorWings(
$wp_customize,
'color_wings',
array( 'section' => 'extra_styles' )
)
);
}

/**
* Sanitize ColorWings Settings.
*
* @since 1.0.0
* @access public
* @param array $settings ColorWings Settings.
*
* @return array Sanitized settings.
*/
public static function sanitize( $settings ) {
if ( ! isset( $settings[ get_stylesheet() ] ) ) {
return array();
}

return $settings;
}

/**
* Validate ColorWings Settings.
*
* @since 1.0.0
* @access public
* @param \WP_Error $validity True if the input was validated, otherwise WP_Error.
* @param array $settings ColorWings Settings.
*
* @return \WP_Error Validity object.
*/
public static function validate( $validity, $settings ) {
foreach ( $settings as $theme => $theme_data ) {
foreach ( $theme_data as $type => $data ) {
if ( isset( $data['styles'] ) && preg_match( '#</?\w+#', $data['styles'] ) ) {
$validity->add( 'illegal_markup', __( 'Markup is not allowed in CSS.', 'greenlet' ) );
}
}
}

return $validity;
}

/**
* Returns the instance.
*
* @since 1.0.0
* @access public
* @return object
*/
public static function get_instance() {

if ( ! self::$instance ) {
self::$instance = new self();
}

return self::$instance;
}
}
Loading

0 comments on commit 473820d

Please sign in to comment.