Skip to content

Commit

Permalink
Merge pull request #54 from rsingel/develop
Browse files Browse the repository at this point in the history
Version 4.2
  • Loading branch information
anikolaenko authored Nov 2, 2016
2 parents 6c92746 + 619f48c commit 606c880
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
16 changes: 16 additions & 0 deletions Contextly.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ class Contextly
const WIDGET_SNIPPET_CLASS = 'ctx-module-container';
const WIDGET_STORYLINE_CLASS = 'ctx-subscribe-container';
const WIDGET_PERSONALIZATION_CLASS = 'ctx-personalization-container';
const WIDGET_CHANNEL_CLASS = 'ctx-channel-container';
const WIDGET_SIDERAIL_CLASS = 'ctx-siderail-container';
const WIDGET_SOCIAL_CLASS = 'ctx-social-container';

const MAIN_MODULE_SHORT_CODE = 'contextly_main_module';
const SL_MODULE_SHORT_CODE = 'contextly_sl_button';
const PERSONALIZATION_MODULE_SHORT_CODE = 'contextly_personalization_button';
const CHANNEL_MODULE_SHORT_CODE = 'contextly_channel_button';
const ALL_BUTTONS_SHORT_CODE = 'contextly_all_buttons';
const SIDERAIL_MODULE_SHORT_CODE = 'contextly_siderail';
const SOCIAL_MODULE_SHORT_CODE = 'contextly_social';
Expand Down Expand Up @@ -237,6 +239,7 @@ public function initDefault() {
add_shortcode('contextly_auto_sidebar', array( $this, 'prepareAutoSidebar' ) );
add_shortcode(self::SL_MODULE_SHORT_CODE, array( $this, 'prepareSLButtonShortCode' ) );
add_shortcode(self::PERSONALIZATION_MODULE_SHORT_CODE, array( $this, 'preparePersonalizationButtonShortCode' ) );
add_shortcode(self::CHANNEL_MODULE_SHORT_CODE, array( $this, 'prepareChannelButtonShortCode' ) );
add_shortcode(self::ALL_BUTTONS_SHORT_CODE, array( $this, 'prepareAllButtonsShortCode' ) );
add_shortcode(self::SIDERAIL_MODULE_SHORT_CODE, array( $this, 'prepareSiderailShortCode' ) );
add_shortcode(self::SOCIAL_MODULE_SHORT_CODE, array( $this, 'prepareSocialShortCode' ) );
Expand Down Expand Up @@ -1090,13 +1093,26 @@ public function preparePersonalizationButtonShortCode() {
return sprintf( "<div class='%s'></div>", $this->escapeClasses( $classes ) );
}

/**
* @return string
*/
public function prepareChannelButtonShortCode() {
$classes = array(
self::WIDGET_CHANNEL_CLASS,
self::SHORTCODE_PLACEMENT_CLASS,
self::CLEARFIX_CLASS,
);
return sprintf( "<div class='%s'></div>", $this->escapeClasses( $classes ) );
}

/**
* @return string
*/
public function prepareAllButtonsShortCode() {
$classes = array(
self::WIDGET_PERSONALIZATION_CLASS,
self::WIDGET_STORYLINE_CLASS,
self::WIDGET_CHANNEL_CLASS,
self::SHORTCODE_PLACEMENT_CLASS,
self::CLEARFIX_CLASS,
);
Expand Down
4 changes: 2 additions & 2 deletions contextly-linker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://contextly.com
Description: Adds the Contextly content recommendation tool to your site. Contextly provides related, trending, evergreen and personalized recommendations to help your readers keep reading. Includes text, video and product recommendations to show off your best content.
Author: Contextly
Version: 4.1
Version: 4.2
*/

if ( ! defined( "CONTEXTLY_MODE" ) ) {
Expand All @@ -19,7 +19,7 @@

define ( "CONTEXTLY_HTTPS", $is_https );
define ( "CONTEXTLY_PLUGIN_FILE", __FILE__ );
define ( "CONTEXTLY_PLUGIN_VERSION", '4.1' );
define ( "CONTEXTLY_PLUGIN_VERSION", '4.2' );
define ( "CONTEXTLY_CDN_VERSION", 'branch' );
if ( ! defined( "CONTEXTLY_MOD" ) ) {
define ( "CONTEXTLY_MOD", false );
Expand Down
15 changes: 13 additions & 2 deletions js/contextly-wordpress.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ $(window)
'ctx_default_placement'
],
sharesWith: [
'ctx-personalization-container'
'ctx-personalization-container',
'ctx-channel-container'
]
},
'ctx-personalization-container': {
Expand All @@ -141,7 +142,17 @@ $(window)
'ctx_default_placement'
],
sharesWith: [
'ctx-subscribe-container'
'ctx-subscribe-container',
'ctx-channel-container'
]
},
'ctx-channel-container': {
placements: [
'ctx_shortcode_placement'
],
sharesWith: [
'ctx-subscribe-container',
'ctx-personalization-container'
]
},
'ctx-siderail-container': {
Expand Down
5 changes: 5 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ If you just want to choose some items, copy and paste your main RSS feed into th
== Changelog ==


= 4.2 =

- Added support for new Channel button


= 4.1 =

- Support for new Personalization module
Expand Down

0 comments on commit 606c880

Please sign in to comment.