Skip to content
This repository was archived by the owner on Jan 28, 2019. It is now read-only.

Commit 900ac40

Browse files
Merge pull request #434 from Codeinwp/development
NEW template for SiteOrigin compatibility Updated grunt and fixed issues Reorganize customize upsells Update images license
2 parents c0d5f83 + cac18a0 commit 900ac40

29 files changed

+1142
-785
lines changed

Gruntfile.js

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ module.exports = function( grunt ) {
77
config = require( 'grunt-theme-fleet' );
88
config = config();
99
config.files.php.push( '!inc/admin/**/*.php' );
10+
config.files.php.push( '!class-tgm-plugin-activation.php' );
1011
config.files.js.push( '!inc/admin/**/*.js' );
12+
config.files.js.push( '!inc/icon-picker/js/*.js' );
13+
config.files.js.push( '!js/bootstrap.js' );
14+
config.files.js.push( '!js/bootstrap.min.js' );
15+
config.files.js.push( '!js/html5shiv.min.js' );
16+
config.files.js.push( '!js/html5shiv.js' );
17+
config.files.js.push( '!js/plugin.home.js' );
18+
config.files.js.push( '!js/scrollReveal.js' );
19+
config.files.js.push( '!js/skip-link-focus-fix.js' );
1120
loader( grunt, config ).init();
1221
};

content-page-no-title.php

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
/**
3+
* The template used for displaying page content in template-fullwidth-no-title.php
4+
*
5+
* @package parallax-one
6+
*/
7+
?>
8+
9+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
10+
<?php parallax_hook_page_top(); ?>
11+
12+
<div class="entry-content content-page <?php if ( empty( $page_title ) ) { echo 'parallax-one-top-margin-5px'; } ?>" itemprop="text">
13+
<?php the_content(); ?>
14+
</div><!-- .entry-content -->
15+
16+
<?php edit_post_link( esc_html__( 'Edit', 'parallax-one' ), '<span class="edit-link">', '</span>' ); ?>
17+
18+
<?php parallax_hook_page_bottom(); ?>
19+
</article><!-- #post-## -->

css/admin-style.css

+8
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,11 @@ button.parallax_one_general_control_remove_field:hover {
221221
.parallax_one_add_social_item {
222222
margin-top: 10px;
223223
}
224+
225+
.parallax-one-theme-info {
226+
text-align: center;
227+
}
228+
229+
.parallax-one-theme-info hr {
230+
margin: 10px auto;
231+
}

functions.php

+13-9
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,6 @@ function parallax_one_customizer_scripts() {
202202

203203
wp_enqueue_script( 'parallax_one_customizer_script', parallax_get_file( '/js/parallax_one_customizer.js' ), array( 'jquery', 'jquery-ui-draggable' ),'1.0.2', true );
204204

205-
wp_localize_script( 'parallax_one_customizer_script', 'parallaxOneCustomizerObject', array(
206-
207-
'documentation' => esc_html__( 'Documentation', 'parallax-one' ),
208-
'support' => esc_html__( 'Support','parallax-one' ),
209-
'pro' => __( 'Upgrade to PRO','parallax-one' ),
210-
211-
) );
212205
}
213206
add_action( 'customize_controls_enqueue_scripts', 'parallax_one_customizer_scripts' );
214207

@@ -294,8 +287,8 @@ function parallax_one_scripts() {
294287

295288
}
296289

297-
$parallax_one_frontpage_animations = get_theme_mod( 'parallax_one_enable_animations', '0' );
298-
if ( ! empty( $parallax_one_frontpage_animations ) && ( $parallax_one_frontpage_animations == 1 ) && 'posts' == get_option( 'show_on_front' ) && is_front_page() ) {
290+
$parallax_one_frontpage_animations = get_theme_mod( 'parallax_one_enable_animations', false );
291+
if ( ! empty( $parallax_one_frontpage_animations ) && ( (bool) $parallax_one_frontpage_animations === true ) && 'posts' == get_option( 'show_on_front' ) && is_front_page() ) {
299292

300293
wp_enqueue_script( 'parallax-one-home-animations', parallax_get_file( '/js/scrollReveal.js' ), array( 'jquery' ), '1.0.0', true );
301294

@@ -341,6 +334,11 @@ function parallax_one_scripts() {
341334
*/
342335
require get_template_directory() . '/inc/hooks.php';
343336

337+
/**
338+
* Customizer info
339+
*/
340+
require_once get_template_directory() . '/inc/customizer-info/class/class-singleton-customizer-info-section.php';
341+
344342
/**
345343
* TAV_Remote_Notification_Client.
346344
*/
@@ -620,6 +618,12 @@ function parallax_one_get_template_part( $template ) {
620618
} else {
621619
if ( defined( 'PARALLAX_ONE_PLUS_PATH' ) ) {
622620
$template = basename( $template );
621+
if ( get_template_directory() !== get_stylesheet_directory() ) {
622+
if ( file_exists( get_stylesheet_directory() . '/sections/' . $template . '.php' ) ) {
623+
require_once( get_stylesheet_directory() . '/sections/' . $template . '.php' );
624+
return;
625+
}
626+
}
623627
if ( file_exists( PARALLAX_ONE_PLUS_PATH . 'public/templates/' . $template . '.php' ) ) {
624628
require_once( PARALLAX_ONE_PLUS_PATH . 'public/templates/' . $template . '.php' );
625629
}

inc/admin/welcome-screen/css/welcome_customizer.css

-23
This file was deleted.

inc/admin/welcome-screen/js/welcome_customizer.js

-16
This file was deleted.

inc/admin/welcome-screen/sections/getting-started.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@
4949
</div>
5050

5151
<div class="prallax-one-tab-pane-half prallax-one-tab-pane-first-half">
52-
52+
<?php
53+
$link = 'http://docs.themeisle.com/article/14-how-to-create-a-child-theme/';
54+
if( class_exists('Parallax_One_Plus') ){
55+
$link = 'http://docs.themeisle.com/article/264-how-to-create-a-child-theme-if-you-use-parallax-one-plus';
56+
} ?>
5357
<h4><?php esc_html_e( 'Create a child theme', 'parallax-one' ); ?></h4>
5458
<p><?php esc_html_e( 'If you want to make changes to the theme\'s files, those changes are likely to be overwritten when you next update the theme. In order to prevent that from happening, you need to create a child theme. For this, please follow the documentation below.', 'parallax-one' ); ?></p>
55-
<p><a href="http://docs.themeisle.com/article/14-how-to-create-a-child-theme/" class="button"><?php esc_html_e( 'View how to do this', 'parallax-one' ); ?></a></p>
59+
<p><a href="<?php echo esc_url($link); ?>" class="button"><?php esc_html_e( 'View how to do this', 'parallax-one' ); ?></a></p>
5660

5761
<hr />
5862

inc/admin/welcome-screen/welcome-screen.php

-17
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ public function __construct() {
1717

1818
/* enqueue script and style for welcome screen */
1919
add_action( 'admin_enqueue_scripts', array( $this, 'parallax_one_welcome_style_and_scripts' ) );
20-
21-
/* enqueue script for customizer */
22-
add_action( 'customize_controls_enqueue_scripts', array( $this, 'parallax_one_welcome_scripts_for_customizer' ) );
2320

2421
/* load welcome screen */
2522
add_action( 'parallax_one_welcome', array( $this, 'parallax_one_welcome_getting_started' ), 10 );
@@ -69,20 +66,6 @@ public function parallax_one_welcome_style_and_scripts( $hook_suffix ) {
6966
wp_enqueue_script( 'parallax-one-welcome-screen-js', get_template_directory_uri() . '/inc/admin/welcome-screen/js/welcome.js', array('jquery') );
7067
}
7168
}
72-
73-
/**
74-
* Load scripts for customizer page
75-
*/
76-
public function parallax_one_welcome_scripts_for_customizer() {
77-
78-
wp_enqueue_style( 'parallax-one-welcome-screen-customizer-css', get_template_directory_uri() . '/inc/admin/welcome-screen/css/welcome_customizer.css' );
79-
wp_enqueue_script( 'parallax-one-welcome-screen-customizer-js', get_template_directory_uri() . '/inc/admin/welcome-screen/js/welcome_customizer.js', array('jquery'), '20120206', true );
80-
wp_localize_script( 'parallax-one-welcome-screen-customizer-js', 'parallaxOneWelcomeScreenCustomizerObject', array(
81-
'aboutpage' => esc_url( admin_url( 'themes.php?page=parallax-one-welcome#getting_started' ) ),
82-
'themeinfo' => __('View Theme Info','parallax-one'),
83-
) );
84-
85-
}
8669

8770
/**
8871
* Welcome screen content

inc/class/parallax-one-info.php

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
/**
3+
* Class to display upsells.
4+
*
5+
* @package WordPress
6+
* @subpackage parallax-one
7+
*/
8+
if ( ! class_exists( 'WP_Customize_Control' ) ) {
9+
return;
10+
}
11+
12+
/**
13+
* Class Parallax_One_Info
14+
*/
15+
class Parallax_One_Info extends WP_Customize_Control {
16+
17+
/**
18+
* The type of customize section being rendered.
19+
*
20+
* @since 1.0.0
21+
* @access public
22+
* @var string
23+
*/
24+
public $type = 'info';
25+
26+
/**
27+
* Control label
28+
*
29+
* @since 1.0.0
30+
* @access public
31+
* @var string
32+
*/
33+
public $label = '';
34+
35+
/**
36+
* The render function for the controler
37+
*/
38+
public function render_content() {
39+
$links = array(
40+
array(
41+
'name' => __( 'Documentation','parallax-one' ),
42+
'link' => esc_url( 'http://themeisle.com/documentation-parallax-one/' ),
43+
),
44+
array(
45+
'name' => __( 'Support','parallax-one' ),
46+
'link' => esc_url( 'http://themeisle.com/contact/' ),
47+
),
48+
array(
49+
'name' => __( 'View Theme Info','parallax-one' ),
50+
'link' => admin_url( 'themes.php?page=parallax-one-welcome#getting_started' ),
51+
),
52+
); ?>
53+
54+
55+
<div class="parallax-one-theme-info">
56+
<?php
57+
foreach ( $links as $item ) { ?>
58+
<a href="<?php echo esc_url( $item['link'] ); ?>" target="_blank"><?php echo esc_html( $item['name'] ); ?></a>
59+
<hr/>
60+
<?php
61+
} ?>
62+
</div>
63+
<?php
64+
}
65+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?php
2+
/**
3+
* Customizer info main class.
4+
*
5+
* @package parallax-one
6+
*/
7+
8+
/**
9+
* Pro customizer section.
10+
*
11+
* @since 1.0.0
12+
* @access public
13+
*/
14+
class Customizer_Info extends WP_Customize_Section {
15+
16+
/**
17+
* The type of customize section being rendered.
18+
*
19+
* @since 1.0.0
20+
* @access public
21+
* @var string
22+
*/
23+
public $type = 'customizer-info';
24+
25+
26+
/**
27+
* Label title to output.
28+
*
29+
* @since 1.0.0
30+
* @access public
31+
* @var string
32+
*/
33+
public $section_title = '';
34+
35+
36+
/**
37+
* Label text to output.
38+
*
39+
* @since 1.0.0
40+
* @access public
41+
* @var string
42+
*/
43+
public $section_text = '';
44+
45+
/**
46+
* Button url.
47+
*
48+
* @since 1.0.0
49+
* @access public
50+
* @var string
51+
*/
52+
public $section_url = '';
53+
54+
/**
55+
* Add custom parameters to pass to the JS via JSON.
56+
*
57+
* @since 1.0.0
58+
* @access public
59+
* @return array
60+
*/
61+
public function json() {
62+
$json = parent::json();
63+
$json['section_text'] = $this->section_text;
64+
$json['section_title'] = $this->section_title;
65+
$json['section_url'] = $this->section_url;
66+
return $json;
67+
}
68+
69+
/**
70+
* Outputs the Underscore.js template.
71+
*
72+
* @since 1.0.0
73+
* @access public
74+
* @return void
75+
*/
76+
protected function render_template() {
77+
?>
78+
79+
<li id="accordion-section-{{ data.id }}" class="accordion-section control-section control-section-{{ data.type }} cannot-expand">
80+
<h3 class="accordion-section-title">
81+
<# if ( data.section_url){ #>
82+
<# if ( data.section_title ) { #>
83+
{{{data.section_title}}}
84+
<# } #>
85+
<# if ( data.section_text && data.section_url ) { #>
86+
<a class="button button-secondary alignright" href="{{data.section_url}}" target="_blank">
87+
{{data.section_text}}
88+
</a>
89+
<# } #>
90+
<# } #>
91+
</h3>
92+
</li>
93+
<?php
94+
}
95+
}

0 commit comments

Comments
 (0)