Skip to content

Commit 934554a

Browse files
authored
Merge pull request #5 from JoryHogeveen/dev
Version 0.2.1
2 parents 095b1b2 + b8efb87 commit 934554a

7 files changed

+43
-15
lines changed

includes/off-canvas-sidebars-frontend.class.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Front-end
66
* @author Jory Hogeveen <[email protected]>
77
* @package off-canvas-sidebars
8-
* @version 0.2
8+
* @version 0.2.1
99
*/
1010

1111
! defined( 'ABSPATH' ) and die( 'You shall not pass!' );
@@ -53,7 +53,7 @@ function default_actions() {
5353
$before_hook = 'website_before';
5454
$after_hook = 'website_after';
5555
}
56-
add_action( $before_hook, array( $this, 'before_site' ), 0 ); // enforce first addition
56+
add_action( $before_hook, array( $this, 'before_site' ), 5 ); // enforce early addition
5757
add_action( $after_hook, array( $this, 'after_site' ), 999999999 ); // enforce last addition
5858

5959
/* EXPERIMENTAL */
@@ -64,24 +64,40 @@ function default_actions() {
6464
/**
6565
* before_site action hook
6666
*
67-
* @since 0.1
68-
* @since 0.2 Add canvas attribute (Slidebars 2.0)
67+
* @since 0.1
68+
* @since 0.2 Add canvas attribute (Slidebars 2.0)
69+
* @since 0.2.1 Add actions
6970
* @return void
7071
*/
7172
function before_site() {
73+
74+
// Add content before the site container
75+
do_action( 'ocs_container_before' );
76+
7277
echo '<div id="sb-site" canvas="container">';
78+
79+
// Add content before other content in the site container
80+
do_action( 'ocs_container_inner_before' );
7381
}
7482

7583
/**
7684
* after_site action hook
7785
*
7886
* @since 0.1
87+
* @since 0.2.1 Add actions
7988
* @return void
8089
*/
8190
function after_site() {
91+
92+
// Add content after other content in the site container
93+
do_action( 'ocs_container_inner_after' );
94+
8295
if ( $this->general_settings['frontend_type'] != 'jquery' ) {
8396
echo '</div>'; // close #sb-site
8497
}
98+
// Add content after the site container
99+
do_action( 'ocs_container_after' );
100+
85101
foreach ($this->general_settings['sidebars'] as $sidebar => $sidebar_data) {
86102
if ( $sidebar_data['enable'] == 1 ) {
87103
$this->add_slidebar($sidebar);

includes/off-canvas-sidebars-menu-meta-box.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Menu Meta Box
66
* @author Jory Hogeveen <[email protected]>
77
* @package off-canvas-sidebars
8-
* @version 0.2
8+
* @version 0.2.1
99
*
1010
* Credits to the Polylang plugin
1111
*/

includes/off-canvas-sidebars-settings.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Settings
66
* @author Jory Hogeveen <[email protected]>
77
* @package off-canvas-sidebars
8-
* @version 0.2
8+
* @version 0.2.1
99
*/
1010

1111
! defined( 'ABSPATH' ) and die( 'You shall not pass!' );
@@ -692,7 +692,7 @@ function plugin_options_page() {
692692
<img alt="PayPal - The safer, easier way to pay online!" border="0" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif">
693693
</a>
694694
<p class="inner">
695-
<a href="http://wordpress.org/support/view/plugin-reviews/off-canvas-sidebars" target="_blank"><?php _e( 'Rate it 5 on WordPress.org', 'off-canvas-sidebars' ) ?></a><br />
695+
<a href="https://wordpress.org/support/plugin/off-canvas-sidebars/reviews/" target="_blank"><?php _e( 'Rate it 5 on WordPress.org', 'off-canvas-sidebars' ) ?></a><br />
696696
<a href="https://wordpress.org/plugins/off-canvas-sidebars/" target="_blank"> <?php _e( 'Blog about it & link to the plugin page', 'off-canvas-sidebars' ) ?></a><br />
697697
<a href="https://profiles.wordpress.org/keraweb/#content-plugins" target="_blank"> <?php _e( 'Check out my other WordPress plugins', 'off-canvas-sidebars' ) ?></a>
698698
</p>

js/off-canvas-sidebars.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* OCS_OFF_CANVAS_SIDEBARS
55
* @author Jory Hogeveen <[email protected]>
66
* @package off-canvas-sidebars
7-
* @version 0.2
7+
* @version 0.2.1
88
*/
99

1010
if ( typeof OCS_OFF_CANVAS_SIDEBARS == 'undefined' ) {
@@ -31,7 +31,7 @@ if ( typeof OCS_OFF_CANVAS_SIDEBARS == 'undefined' ) {
3131

3232
$( '.sb-slidebar' ).each( function(e) {
3333
var id = $( this ).attr('off-canvas-sidebar-id');
34-
$(document).on( 'click', '.sb-toggle-' + id, function(e) {
34+
$(document).on( 'touchend click', '.sb-toggle-' + id, function(e) {
3535
// Stop default action and bubbling
3636
e.stopPropagation();
3737
e.preventDefault();
@@ -48,7 +48,7 @@ if ( typeof OCS_OFF_CANVAS_SIDEBARS == 'undefined' ) {
4848
} );
4949

5050
// Close any
51-
$( document ).on( 'click', '.sb-close-any', function( e ) {
51+
$( document ).on( 'touchend click', '.sb-close-any', function( e ) {
5252
if ( controller.getActiveSlidebar() ) {
5353
e.preventDefault();
5454
e.stopPropagation();
@@ -57,7 +57,7 @@ if ( typeof OCS_OFF_CANVAS_SIDEBARS == 'undefined' ) {
5757
} );
5858

5959
// Close Slidebars when clicking on a link within a slidebar
60-
$( '[off-canvas] a' ).on( 'click', function( e ) {
60+
$( '[off-canvas] a' ).on( 'touchend click', function( e ) {
6161
e.preventDefault();
6262
e.stopPropagation();
6363

off-canvas-sidebars.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Off-Canvas Sidebars
44
* Description: Add off-canvas sidebars using the Slidebars jQuery plugin
55
* Plugin URI: https://wordpress.org/plugins/off-canvas-sidebars/
6-
* Version: 0.2.0.1
6+
* Version: 0.2.1
77
* Author: Jory Hogeveen
88
* Author URI: http://www.keraweb.nl
99
* Text Domain: off-canvas-sidebars
@@ -13,7 +13,7 @@
1313

1414
! defined( 'ABSPATH' ) and die( 'You shall not pass!' );
1515

16-
if ( !defined( 'OCS_PLUGIN_VERSION' ) ) define( 'OCS_PLUGIN_VERSION', '0.2.0.1' );
16+
if ( !defined( 'OCS_PLUGIN_VERSION' ) ) define( 'OCS_PLUGIN_VERSION', '0.2.1' );
1717
if ( !defined( 'OCS_FILE' ) ) define( 'OCS_FILE', __FILE__ );
1818
if ( !defined( 'OCS_BASENAME' ) ) define( 'OCS_BASENAME', plugin_basename( __FILE__ ) );
1919
if ( !defined( 'OCS_PLUGIN_DIR' ) ) define( 'OCS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );

readme.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=YGPLM
44
Tags: genesis, off-canvas, sidebars, slidebars, jQuery, app, mobile, tablet, responsive
55
Requires at least: 3.8
66
Tested up to: 4.6
7-
Stable tag: 0.2.0.1
7+
Stable tag: 0.2.1
88

99
Add off-canvas sidebars using the Slidebars jQuery plugin.
1010

@@ -91,6 +91,11 @@ The final output of your theme should be similar to this:
9191

9292
== Changelog ==
9393

94+
= 0.2.1 =
95+
96+
* Fix: Add touch events for iOS mobile device compatibility
97+
* Added some actions for front-end (see Other Notes)
98+
9499
= 0.2.0.1 =
95100

96101
* Fix: Global variable bug
@@ -127,6 +132,13 @@ You can find me here:
127132
* [Keraweb](http://www.keraweb.nl/ "Keraweb")
128133
* [LinkedIn](https://nl.linkedin.com/in/joryhogeveen "LinkedIn profile")
129134

135+
= Actions =
136+
137+
- `ocs_container_before` Add content before the site container
138+
- `ocs_container_inner_before` Add content before other content in the site container
139+
- `ocs_container_inner_after` Add content after other content in the site container
140+
- `ocs_container_after` Add content after the site container
141+
130142
= Credits =
131143

132144
* Slidebars jQuery plugin by [Adam](https://www.adchsm.com/slidebars/ "Adam"), thank you for this great plugin!

widgets/off-canvas-sidebars-widget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Control Widget
66
* @author Jory Hogeveen <[email protected]>
77
* @package off-canvas-slidebars
8-
* @version 0.2
8+
* @version 0.2.1
99
*/
1010

1111
! defined( 'ABSPATH' ) and die( 'You shall not pass!' );

0 commit comments

Comments
 (0)