Skip to content

Commit

Permalink
replaced broken sharre count by "+" sign
Browse files Browse the repository at this point in the history
removed deprecated Google Plus
v2.2.6 build
  • Loading branch information
nikeo committed May 8, 2019
1 parent 7b50782 commit 81854b3
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 104 deletions.
57 changes: 0 additions & 57 deletions addons/assets/front/js/jQuerySharrre.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,63 +172,6 @@ var SharrrePlatform = SharrrePlatform || (function () {



SharrrePlatform.register("googlePlus", function (options) {
defaultSettings = { //http://www.google.com/webmasters/+1/button/
url: '', //if you need to personnalize button url
urlCount: false, //if you want to use personnalize button url on global counter
size: 'medium',
lang: 'en-US',
annotation: '',
count: true,
popup: {
width: 900,
height: 500
}
};

defaultSettings = $.extend(true, {}, defaultSettings, options);
return {
settings: defaultSettings,
url: function (url) {
return url + '?url={url}&type=googlePlus';
},
trackingAction: {site: 'Google', action: '+1'},
load: function (self) {
var sett = this.settings;
//$(self.element).find('.buttons').append('<div class="button googleplus"><g:plusone size="'+self.options.buttons.googlePlus.size+'" href="'+self.options.url+'"></g:plusone></div>');
$(self.element).find('.buttons').append('<div class="button googleplus"><div class="g-plusone" data-size="' +
sett.size + '" data-href="' + (sett.url !== '' ? sett.url : self.options.url) +
'" data-annotation="' + sett.annotation + '"></div></div>');
window.___gcfg = {
lang: sett.lang
};
var loading = 0;
if ((typeof gapi === 'undefined' || typeof gapi.plusone === 'undefined') && loading === 0) {
loading = 1;
(function () {
var po = document.createElement('script');
po.type = 'text/javascript';
po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
}
else {
gapi.plusone.go();
}
},
tracking: function () {
},
popup: function (opt) {
window.open("https://plus.google.com/share?hl=" + this.settings.lang +
"&url=" + encodeURIComponent((this.settings.url !== '' ? this.settings.url : opt.url)),
"", "toolbar=0, status=0, width=" + this.settings.popup.width + ", height=" + this.settings.popup.height);
}
};
});


SharrrePlatform.register("pinterest", function (options) {
defaultSettings = { //http://pinterest.com/about/goodies/
url: '', //if you need to personalize url button
Expand Down
2 changes: 1 addition & 1 deletion addons/assets/front/js/jQuerySharrre.min.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion addons/czr/ha-czr.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ function hu_extend_dependencies() {
'sharrre-twitter-on',
'twitter-username',
'sharrre-facebook-on',
'sharrre-google-on',
'sharrre-pinterest-on',
'sharrre-linkedin-on'
],
Expand Down
10 changes: 1 addition & 9 deletions addons/sharrre/ha-sharrre.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
function ha_are_share_buttons_enabled() {
if ( ! hu_is_checked('sharrre') )
return;
if ( ! hu_is_checked('sharrre-twitter-on') && ! hu_is_checked('sharrre-facebook-on') && ! hu_is_checked('sharrre-google-on') && ! hu_is_checked('sharrre-pinterest-on') && ! hu_is_checked('sharrre-linkedin-on') )
if ( ! hu_is_checked('sharrre-twitter-on') && ! hu_is_checked('sharrre-facebook-on') && ! hu_is_checked('sharrre-pinterest-on') && ! hu_is_checked('sharrre-linkedin-on') )
return;
return true;
}
Expand Down Expand Up @@ -144,14 +144,6 @@ function ha_register_sharrre_settings( $settings ) {
'type' => 'nimblecheck',
'priority' => 80
),
'sharrre-google-on' => array(
'default' => 1,
'control' => 'HU_controls',
'label' => __('Enable Google Plus Button', 'hueman-addons'),
'section' => 'content_single_sec',
'type' => 'nimblecheck',
'priority' => 90
),
'sharrre-pinterest-on' => array(
'default' => 0,
'control' => 'HU_controls',
Expand Down
28 changes: 4 additions & 24 deletions addons/sharrre/sharrre-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<?php if ( hu_is_checked('sharrre-facebook-on') ) : ?>
<div id="facebook" data-url="<?php echo the_permalink(); ?>" data-text="<?php the_title_attribute(); ?>" data-title="<?php _e('Like', 'hueman-addons'); ?>"></div>
<?php endif; ?>
<?php if ( hu_is_checked('sharrre-google-on') ) : ?>
<div id="googleplus" data-url="<?php echo the_permalink(); ?>" data-text="<?php the_title_attribute(); ?>" data-title="<?php _e('+1', 'hueman-addons'); ?>"></div>
<?php endif; ?>
<?php if ( hu_is_checked('sharrre-pinterest-on') ) : ?>
<div id="pinterest" data-url="<?php echo the_permalink(); ?>" data-text="<?php the_title_attribute(); ?>" data-title="<?php _e('Pin It', 'hueman-addons'); ?>"></div>
<?php endif; ?>
Expand All @@ -28,7 +25,7 @@
share: {
twitter: true
},
template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><i class="fab fa-twitter"></i></div></a>',
template: '<a class="box" href="#"><div class="count" href="#"><i class="fa fa-plus"></i></div><div class="share"><i class="fab fa-twitter"></i></div></a>',
enableHover: false,
enableTracking: true,
buttons: { twitter: {via: '<?php echo esc_attr( hu_get_option("twitter-username") ); ?>'}},
Expand All @@ -43,7 +40,7 @@
share: {
facebook: true
},
template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><i class="fab fa-facebook-square"></i></div></a>',
template: '<a class="box" href="#"><div class="count" href="#"><i class="fa fa-plus"></i></div><div class="share"><i class="fab fa-facebook-square"></i></div></a>',
enableHover: false,
enableTracking: true,
buttons:{layout: 'box_count'},
Expand All @@ -53,29 +50,12 @@
}
});
<?php endif; ?>
<?php if ( hu_is_checked('sharrre-google-on') ) : ?>
<?php $path = HU_AD() -> ha_get_base_url(); ?>
$('#googleplus').sharrre({
share: {
googlePlus: true
},
template: '<a class="box" href="#"><div class="count" href="#">{total}</div><div class="share"><i class="fab fa-google-plus-square"></i></div></a>',
enableHover: false,
enableTracking: true,
buttons:{size: 'tall'},
urlCurl: '<?php echo $path . "addons/assets/front/js/sharrre.php"; ?>',
click: function(api, options){
api.simulateClick();
api.openPopup('googlePlus');
}
});
<?php endif; ?>
<?php if ( hu_is_checked('sharrre-pinterest-on') ) : ?>
$('#pinterest').sharrre({
share: {
pinterest: true
},
template: '<a class="box" href="#" rel="nofollow"><div class="count" href="#">{total}</div><div class="share"><i class="fab fa-pinterest"></i></div></a>',
template: '<a class="box" href="#" rel="nofollow"><div class="count" href="#"><i class="fa fa-plus"></i></div><div class="share"><i class="fab fa-pinterest"></i></div></a>',
enableHover: false,
enableTracking: true,
buttons: {
Expand All @@ -94,7 +74,7 @@
share: {
linkedin: true
},
template: '<a class="box" href="#" rel="nofollow"><div class="count" href="#">{total}</div><div class="share"><i class="fab fa-linkedin"></i></div></a>',
template: '<a class="box" href="#" rel="nofollow"><div class="count" href="#"><i class="fa fa-plus"></i></div><div class="share"><i class="fab fa-linkedin"></i></div></a>',
enableHover: false,
enableTracking: true,
buttons: {
Expand Down
2 changes: 1 addition & 1 deletion contextualizer/ccat-contextualizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ function ctx_get_skope_module_tmpl( $html, $requested_tmpl = '', $posted_params
// Is used when the theme_mod "ctx_filtrable_candidates" is not set yet
// invoked in ctx_cache_filtrable_candidates()
private function _get_default_filtrable_candidate_json() {
return '{"options":["blogname","blogdescription"],"multidim_options":{"hu_theme_options":["display-header-title","display-header-logo","logo-max-height","font","body-font-size","container-width","boxed","sidebar-padding","color-1","color-2","image-border-radius","ext_link_style","ext_link_target","post-comments","page-comments","smoothscroll","responsive","fittext","sharrre","sharrre-counter","sharrre-scrollable","sharrre-twitter-on","twitter-username","sharrre-facebook-on","sharrre-google-on","sharrre-pinterest-on","sharrre-linkedin-on","minified-css","structured-data","smart_load_img","js-mobile-detect","site-description","color-topbar","color-header","color-header-menu","color-mobile-menu","transparent-fixed-topnav","use-header-image","logo-title-on-header-image","header-ads","header-ads-desktop","header-ads-mobile","default-menu-header","header-desktop-sticky","desktop-search","header_mobile_menu_layout","header-mobile-sticky","header_mobile_btn","mobile-search","infinite-scroll","load_on_scroll_desktop","load_on_scroll_mobile","pro_post_list_design","pro_grid_columns","blog-heading-enabled","blog-heading","blog-subheading","excerpt-length","featured-posts-enabled","featured-category","featured-posts-count","featured-posts-full-content","featured-slideshow","featured-slideshow-speed","author-bio","related-posts","post-nav","placeholder","comment-count","sidebar-top","desktop-sticky-sb","mobile-sticky-sb","mobile-sidebar-hide","footer-ads","default-menu-footer","color-footer","copyright","credit"]},"multidim_theme_mods":[],"simple_theme_mods":["header_text","custom_logo","header_textcolor","background_color","header_image","background_preset","background_size","background_repeat","background_attachment","nav_menu_locations"]}';
return '{"options":["blogname","blogdescription"],"multidim_options":{"hu_theme_options":["display-header-title","display-header-logo","logo-max-height","font","body-font-size","container-width","boxed","sidebar-padding","color-1","color-2","image-border-radius","ext_link_style","ext_link_target","post-comments","page-comments","smoothscroll","responsive","fittext","sharrre","sharrre-counter","sharrre-scrollable","sharrre-twitter-on","twitter-username","sharrre-facebook-on","sharrre-pinterest-on","sharrre-linkedin-on","minified-css","structured-data","smart_load_img","js-mobile-detect","site-description","color-topbar","color-header","color-header-menu","color-mobile-menu","transparent-fixed-topnav","use-header-image","logo-title-on-header-image","header-ads","header-ads-desktop","header-ads-mobile","default-menu-header","header-desktop-sticky","desktop-search","header_mobile_menu_layout","header-mobile-sticky","header_mobile_btn","mobile-search","infinite-scroll","load_on_scroll_desktop","load_on_scroll_mobile","pro_post_list_design","pro_grid_columns","blog-heading-enabled","blog-heading","blog-subheading","excerpt-length","featured-posts-enabled","featured-category","featured-posts-count","featured-posts-full-content","featured-slideshow","featured-slideshow-speed","author-bio","related-posts","post-nav","placeholder","comment-count","sidebar-top","desktop-sticky-sb","mobile-sticky-sb","mobile-sidebar-hide","footer-ads","default-menu-footer","color-footer","copyright","credit"]},"multidim_theme_mods":[],"simple_theme_mods":["header_text","custom_logo","header_textcolor","background_color","header_image","background_preset","background_size","background_repeat","background_attachment","nav_menu_locations"]}';
}
}//class
endif;
Expand Down
2 changes: 1 addition & 1 deletion ha-fire.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Hueman Addons
* Plugin URI: https://presscustomizr.com
* Description: Hueman Theme Addons
* Version: 2.2.5
* Version: 2.2.6
* Text Domain: hueman-addons
* Author: Press Customizr
* Author URI: https://presscustomizr.com
Expand Down
6 changes: 6 additions & 0 deletions inc/czr-base-fmk/assets/js/_0_ccat_czr-base-fmk.js
Original file line number Diff line number Diff line change
Expand Up @@ -1864,6 +1864,12 @@ $.extend( CZRInputMths , {
// _do_();
// },

// when input and label are tied by an id - for relationship
// clicking on any of them changes the input
// => We need a unique ID here so that input and label are tied by a unique link
// The unique ID is generated server side as a GUID
// @see https://www.w3.org/TR/html401/interact/forms.html#h-17.9.1
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/checkbox
setupNimbleCheck : function( params ) {
var input = this;
var $input = input.container.find('input[type=checkbox]'),
Expand Down
23 changes: 20 additions & 3 deletions inc/czr-base-fmk/czr-base-fmk.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class CZR_Fmk_Base_Construct {

public $czr_css_attr = array();

public $current_module_params_when_ajaxing;// store the params when ajaxing and allows us to access the currently requested module params at any point of the ajax action

public static function czr_fmk_get_instance( $params ) {
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof CZR_Fmk_Base ) ) {
self::$instance = new CZR_Fmk_Base( $params );
Expand Down Expand Up @@ -586,7 +588,11 @@ function ac_generate_czr_tmpl_from_map( $tmpl_map ) {

'scope' => 'local',// <= used when resetting the sections
// introduced for https://github.com/presscustomizr/nimble-builder/issues/403
'editor_params' => array()
'editor_params' => array(),

// introduced for https://github.com/presscustomizr/nimble-builder/issues/431
'section_collection' => array(),
'section_type' => 'content'
);
foreach( $tmpl_map as $input_id => $input_data ) {
if ( ! is_string( $input_id ) || empty( $input_id ) ) {
Expand Down Expand Up @@ -814,9 +820,17 @@ private function ac_set_input_tmpl_content( $input_type, $input_id, $input_data
<#
var _checked = ( false != data['<?php echo $input_id; ?>'] ) ? "checked=checked" : '';
#>
<?php
// when input and label are tied by an id - for relationship
// clicking on any of them changes the input
// => We need a unique ID here so that input and label are tied by a unique link
// @see https://www.w3.org/TR/html401/interact/forms.html#h-17.9.1
// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input/checkbox
$unique_id = sprintf('%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535));
?>
<div class="nimblecheck-wrap">
<input id="nimblecheck-<?php echo $input_id; ?>" data-czrtype="<?php echo $input_id; ?>" type="checkbox" {{ _checked }} class="nimblecheck-input">
<label for="nimblecheck-<?php echo $input_id; ?>" class="nimblecheck-label">Switch</label>
<input id="nimblecheck-<?php echo $unique_id; ?>" data-czrtype="<?php echo $input_id; ?>" type="checkbox" {{ _checked }} class="nimblecheck-input">
<label for="nimblecheck-<?php echo $unique_id; ?>" class="nimblecheck-label">Switch</label>
</div>
<?php
break;
Expand Down Expand Up @@ -1454,6 +1468,9 @@ function ac_get_ajax_module_tmpl( $html, $requested_tmpl = '', $posted_params =
}

$module_params = $registered_modules[ $module_type ];
// Store the params now, so we can access them when rendering the input templates
$this->current_module_params_when_ajaxing = $module_params;

$tmpl_params = $module_params[ 'tmpl' ];
// Enqueue the list of registered scripts
if ( empty( $tmpl_params ) ) {
Expand Down
2 changes: 1 addition & 1 deletion lang/en_US.po
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
msgid ""
msgstr ""
"Project-Id-Version: Hueman Addons v2.2.5\n"
"Project-Id-Version: Hueman Addons v2.2.6\n"
"POT-Creation-Date: 2016-12-19 18:13+0100\n"
"PO-Revision-Date: 2016-12-19 18:14+0100\n"
"Last-Translator: \n"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hueman-addons",
"version": "2.2.5",
"version": "2.2.6",
"description": "Lightweight addons plugins for the Hueman WordPress theme.",
"author": "nikeo",
"license": "GNU GPL v3.0",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Tags: hueman theme, hueman
* Requires at least: 3.4
* Tested up to: 5.1.1
* Stable tag: 2.2.5
* Stable tag: 2.2.6
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
12 changes: 8 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Plugin URI: https://wordpress.org/plugins/hueman-addons/
Tags: hueman theme, hueman, customizer, contextualizer
Requires at least: 4.7
Requires PHP: 5.4
Tested up to: 5.1.1
Stable tag: 2.2.5
Tested up to: 5.2
Stable tag: 2.2.6
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -37,10 +37,14 @@ The plugin has been designed specifically for the Hueman WordPress theme. Lightw
[Documentation here](http://docs.presscustomizr.com/article/242-hueman-addons-how-to-set-the-share-bar-options)

== Upgrade Notice ==
= 2.2.5 =
Added support for rgb alpha colors in the contextualizer.
= 2.2.6 =
Replaced broken sharre count by "+" sign. Removed Google Plus share button.

== Changelog ==
= 2.2.6 May 8th, 2019 =
* replaced broken sharre count by "+" sign
* removed deprecated Google Plus

= 2.2.5 April 5th, 2019 =
* added : a new checkbox style in the customizer

Expand Down

0 comments on commit 81854b3

Please sign in to comment.