Skip to content

Commit

Permalink
Rename sections #312
Browse files Browse the repository at this point in the history
  • Loading branch information
shrimp2t committed Sep 8, 2018
1 parent 6e68cf9 commit fd0f3a6
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 50 deletions.
11 changes: 11 additions & 0 deletions assets/css/customizer.css
Original file line number Diff line number Diff line change
Expand Up @@ -565,3 +565,14 @@ body .wp-full-overlay{
text-indent: 0;
text-align: center;
}

.onepress-c-heading {
padding: 5px 12px;
background: #BBBBBB;
margin: 10px -12px 2px;
text-transform: uppercase;
letter-spacing: 2px;
font-weight: 500;
font-size: 12px;
color: #FFFFFF;
}
8 changes: 6 additions & 2 deletions assets/js/jquery.bully.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,14 @@
function staggerClass( $elements, classname, timeout ) {

$.each( $elements, function( i, obj ) {

obj.$bullet.addClass( classname );
/*
var stagger = i * timeout;
setTimeout( function() {
obj.$bullet.addClass( classname );
}, stagger );
*/
} );
}

Expand Down Expand Up @@ -201,6 +203,8 @@
//init Bullly
jQuery( document ).ready( function( $ ){
$.each( Onepress_Bully.sections, function( id, args ){
$( '#'+id ).bully();
$( '#'+id ).bully({
scrollPerSecond: 1000,
});
} );
} );
1 change: 0 additions & 1 deletion assets/sass/_bully.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@

border: 2px solid currentColor;
border-radius: 50%;
box-shadow: inset 0px 0px 8px 3px rgba(255, 255, 255, 0.30);
will-change: transform;
}

Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ function onepress_the_excerpt( $type = false, $length = false ){
* Dots Navigation class
* @since 2.1.0
*/
require get_template_directory() . '/inc/class-dots-navigation.php';
require get_template_directory() . '/inc/class-sections-navigation.php';

/**
* Customizer additions.
Expand Down
65 changes: 24 additions & 41 deletions inc/class-dots-navigation.php → inc/class-sections-navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,15 @@ function get_sections(){
$new = array(
'hero' => $sections_config['hero']
);


foreach ( $sorted_sections as $id ) {
if ( isset( $sorted_sections[ $id ] ) ) {
if ( isset( $sections_config[ $id ] ) ) {
$new[ $id ] = $sections_config[ $id ];
}
}

return apply_filters( 'onepress_dots_navigation_get_sections', $new );
return apply_filters( 'onepress_sections_navigation_get_sections', $new );

}

Expand All @@ -103,7 +105,7 @@ function add_customize( $wp_customize, $section_id ){
);
$wp_customize->add_control( $section_id.'_enable',
array(
'label' => __( 'Enable dots navigation', 'onepress' ),
'label' => __( 'Enable section navigation', 'onepress' ),
'section' => $section_id,
'type' => 'checkbox',
)
Expand All @@ -123,24 +125,24 @@ function add_customize( $wp_customize, $section_id ){
)
);

// Show dots message
$wp_customize->add_setting( $section_id.'_em',
array(
'sanitize_callback' => 'onepress_sanitize_text',
)
);
$wp_customize->add_control( new OnePress_Misc_Control( $wp_customize, $section_id.'_em',
array(
'type' => 'custom_message',
'section' => $section_id,
'description' => '<strong>'.__( 'Enable dots nav for sections', 'onepress' ).'</strong>',
)
));

foreach ( $this->get_sections() as $id => $args ) {

$name = $this->get_name( $id );

$wp_customize->add_setting( $id.'_em',
array(
'sanitize_callback' => 'onepress_sanitize_text',
)
);
$wp_customize->add_control( new OnePress_Misc_Control( $wp_customize, $id.'_em',
array(
'type' => 'custom_message',
'section' => $section_id,
'description' => '<div class="onepress-c-heading">'.esc_html( $args['label'] ).'</div>',
)
));

$wp_customize->add_setting( $name,
array(
'sanitize_callback' => 'onepress_sanitize_checkbox',
Expand All @@ -150,47 +152,28 @@ function add_customize( $wp_customize, $section_id ){
);
$wp_customize->add_control( $name,
array(
'label' => $args['label'],
'label' => __( 'Enable dot navigation', 'onepress' ),
'section' => $section_id,
'type' => 'checkbox',
)
);
}

// Show dots message
$wp_customize->add_setting( $section_id.'_custom_title_m',
array(
'sanitize_callback' => 'onepress_sanitize_text',
)
);
$wp_customize->add_control( new OnePress_Misc_Control( $wp_customize, $section_id.'_custom_title_m',
array(
'type' => 'custom_message',
'section' => $section_id,
'description' => '<h3>'.__( 'Custom Navigation Labels', 'onepress' ).'</h3>',
)
));


foreach ( $this->get_sections() as $id => $args ) {

$name = $this->get_name( $id.'_label' );

$wp_customize->add_setting( $name,
$wp_customize->add_setting( $name.'_label',
array(
'sanitize_callback' => 'sanitize_text_field',
'default' => '',
//'transport' => 'postMessage'
)
);
$wp_customize->add_control( $name,
$wp_customize->add_control( $name.'_label',
array(
'label' => $args['label'],
'label' => __( 'Custom Label', 'OnePress' ),
'section' => $section_id,
)
);
}

}


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* Dots Navigation Settings
* @since 2.1.0
*/
$wp_customize->add_section( 'onepress_dots_nav',
$wp_customize->add_section( 'onepress_sections_nav',
array(
'priority' => null,
'title' => esc_html__( 'Dots Navigation', 'onepress' ),
'title' => esc_html__( 'Sections Navigation', 'onepress' ),
'description' => '',
'panel' => 'onepress_options',
)
);

Onepress_Dots_Navigation::get_instance()->add_customize( $wp_customize, 'onepress_dots_nav' );
Onepress_Dots_Navigation::get_instance()->add_customize( $wp_customize, 'onepress_sections_nav' );


2 changes: 1 addition & 1 deletion inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function onepress_customize_register( $wp_customize ) {
require_once $path. '/inc/customize-configs/options-colors.php';
require_once $path. '/inc/customize-configs/options-header.php';
require_once $path. '/inc/customize-configs/options-navigation.php';
require_once $path. '/inc/customize-configs/options-dots-navigation.php';
require_once $path. '/inc/customize-configs/options-sections-navigation.php';
require_once $path. '/inc/customize-configs/options-page.php';
require_once $path. '/inc/customize-configs/options-blog-posts.php';
require_once $path. '/inc/customize-configs/options-single.php';
Expand Down
1 change: 0 additions & 1 deletion style.css

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

0 comments on commit fd0f3a6

Please sign in to comment.