Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreycrofte committed Dec 9, 2019
2 parents c61b227 + d284de6 commit f2c78f7
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 116 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules/

.DS_Store
.idea
8 changes: 4 additions & 4 deletions admin/jsps-admin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,16 @@ function add_juiz_sps_plugin_options() {

add_settings_section( 'juiz_sps_plugin_main', __( 'Main settings', 'juiz-social-post-sharer' ), 'juiz_sps_section_text', JUIZ_SPS_SLUG);
add_settings_field( 'juiz_sps_style_choice', __( 'Choose a style to display', 'juiz-social-post-sharer' ), 'juiz_sps_setting_radio_style_choice', JUIZ_SPS_SLUG, 'juiz_sps_plugin_main');
add_settings_field( 'juiz_sps_temp_submit', get_submit_button( __( 'Save Changes' ), 'secondary' ), create_function( '', 'return "";' ), JUIZ_SPS_SLUG, 'juiz_sps_plugin_main' );
add_settings_field( 'juiz_sps_temp_submit', get_submit_button( __( 'Save Changes' ), 'secondary' ), function(){ ''; return ""; }, JUIZ_SPS_SLUG, 'juiz_sps_plugin_main' );
add_settings_field( 'juiz_sps_network_selection', __( 'Display those following social networks:', 'juiz-social-post-sharer' ) , 'juiz_sps_setting_checkbox_network_selection', JUIZ_SPS_SLUG, 'juiz_sps_plugin_main' );
add_settings_field( 'juiz_sps_twitter_user', __( 'What is your Twitter user name to be mentioned?', 'juiz-social-post-sharer' ) , 'juiz_sps_setting_input_twitter_user', JUIZ_SPS_SLUG, 'juiz_sps_plugin_main' );
add_settings_field( 'juiz_sps_temp_submit_1', get_submit_button( __( 'Save Changes' ), 'secondary' ), create_function( '', 'return "";' ), JUIZ_SPS_SLUG, 'juiz_sps_plugin_main' );
add_settings_field( 'juiz_sps_temp_submit_1', get_submit_button( __( 'Save Changes' ), 'secondary' ), function(){ ''; return ""; }, JUIZ_SPS_SLUG, 'juiz_sps_plugin_main' );


add_settings_section( 'juiz_sps_plugin_display_in', __( 'Display settings','juiz-social-post-sharer'), 'juiz_sps_section_text_display', JUIZ_SPS_SLUG );
add_settings_field( 'juiz_sps_display_in_types', __( 'What type of content must have buttons?', 'juiz-social-post-sharer' ), 'juiz_sps_setting_checkbox_content_type', JUIZ_SPS_SLUG, 'juiz_sps_plugin_display_in' );
add_settings_field( 'juiz_sps_display_where', __( 'Where do you want to display buttons?','juiz-social-post-sharer' ), 'juiz_sps_setting_radio_where', JUIZ_SPS_SLUG, 'juiz_sps_plugin_display_in' );
add_settings_field( 'juiz_sps_temp_submit_2', get_submit_button( __( 'Save Changes' ), 'secondary' ), create_function( '', 'return "";' ), JUIZ_SPS_SLUG, 'juiz_sps_plugin_display_in' );
add_settings_field( 'juiz_sps_temp_submit_2', get_submit_button( __( 'Save Changes' ), 'secondary' ), function(){ ''; return "";}, JUIZ_SPS_SLUG, 'juiz_sps_plugin_display_in' );


add_settings_section( 'juiz_sps_plugin_advanced', __( 'Advanced settings','juiz-social-post-sharer' ), 'juiz_sps_section_text_advanced', JUIZ_SPS_SLUG );
Expand All @@ -208,7 +208,7 @@ function add_juiz_sps_plugin_options() {
add_settings_field( 'juiz_sps_counter', __( 'Display counter of sharing?', 'juiz-social-post-sharer' ) . '<br /><em>(' . __( 'need JavaScript', 'juiz-social-post-sharer' ) . ')</em>', 'juiz_sps_setting_radio_counter', JUIZ_SPS_SLUG, 'juiz_sps_plugin_advanced' );
add_settings_field( 'juiz_sps_counter_option', __( 'For this counter, you want to display:', 'juiz-social-post-sharer' ), 'juiz_sps_setting_radio_counter_option', JUIZ_SPS_SLUG, 'juiz_sps_plugin_advanced' );
add_settings_field( 'juiz_sps_write_css_in_html', __( 'Write CSS code in HTML head?', 'juiz-social-post-sharer' ) . '<br /><em>(' . __( 'good thing for performance on mobile', 'juiz-social-post-sharer' ) . ')</em>', 'juiz_sps_setting_radio_css_in_html', JUIZ_SPS_SLUG, 'juiz_sps_plugin_advanced' );
add_settings_field( 'juiz_sps_temp_submit_3', get_submit_button( __( 'Save Changes' ), 'secondary' ), create_function( '', 'return "";' ), JUIZ_SPS_SLUG, 'juiz_sps_plugin_advanced' );
add_settings_field( 'juiz_sps_temp_submit_3', get_submit_button( __( 'Save Changes' ), 'secondary' ), function(){ ''; return ""; }, JUIZ_SPS_SLUG, 'juiz_sps_plugin_advanced' );


add_settings_section( 'juiz_sps_plugin_mail_informations', __( 'Customize mail texts', 'juiz-social-post-sharer' ), 'juiz_sps_section_text_mail', JUIZ_SPS_SLUG );
Expand Down
89 changes: 0 additions & 89 deletions js/get-noapi-counts.php

This file was deleted.

22 changes: 6 additions & 16 deletions js/juiz-social-post-sharer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,26 @@ Author: Geoffrey Crofte
/* Juiz SPS core */

;jQuery(document).ready(function($){

jQuery.fn.juiz_get_counters = function(){
return this.each(function(){

var nonce = $(this).find('.juiz_sps_nonce').val(),
url = $(this).find('.juiz_sps_info_permalink').val(),
$twitter = $(this).find('.juiz_sps_link_twitter'),
$linkedin = $(this).find('.juiz_sps_link_linkedin'),
$delicious = $(this).find('.juiz_sps_link_delicious'),
$facebook = $(this).find('.juiz_sps_link_facebook'),
$pinterest = $(this).find('.juiz_sps_link_pinterest'),
$stumble = $(this).find('.juiz_sps_link_stumbleupon'),
item_class = '';

if ( $(this).hasClass('counters_total') ) {
item_class = ' juiz_hidden_counter';
}

var twitter_url = "//public.newsharecounts.com/count.json?url=" + url;
var twitter_url = "//public.newsharecounts.com/count.json?url=" + url;
// return : {"count":18,"url":"http:\/\/www.creativejuiz.fr\/blog\/"}
var delicious_url = "//feeds.delicious.com/v2/json/urlinfo/data?url=" + url + "&callback=?" ;
// return : [{"url": "http://www.creativejuiz.fr/blog", "total_posts": 2}]
var linkedin_url = "//www.linkedin.com/countserv/count/share?format=jsonp&url=" + url + "&callback=?";
// return : {"count":17,"fCnt":"17","fCntPlusOne":"18","url":"http:\/\/stylehatch.co"}
var pinterest_url = "//api.pinterest.com/v1/urls/count.json?callback=?&url=" + url;
// return : ({"count": 0, "url": "http://stylehatch.co"})
var facebook_url = "//graph.facebook.com/?id=" + url;
Expand All @@ -45,12 +41,6 @@ Author: Geoffrey Crofte
$twitter.prepend('<span class="juiz_sps_counter'+item_class+'">' + data.count + '</span>');
});
}
if ( $linkedin.length ) {
$.getJSON(linkedin_url)
.done(function(data){
$linkedin.prepend('<span class="juiz_sps_counter'+item_class+'">' + data.count + '</span>');
});
}
if ( $pinterest.length ) {
$.getJSON(pinterest_url)
.done(function(data){
Expand Down Expand Up @@ -120,7 +110,7 @@ Author: Geoffrey Crofte
else {
$('.juiz_sps_link_print').remove();
}

/**
* Bokmark button
*
Expand Down Expand Up @@ -186,5 +176,5 @@ Author: Geoffrey Crofte
});
/*
//var google_url = "https://clients6.google.com/rpc?key=YOUR_API_KEY";
//var digg_url = "http://services.digg.com/2.0/story.getInfo?links=" + url + "&type=javascript&callback=?";
*/
//var digg_url = "http://services.digg.com/2.0/story.getInfo?links=" + url + "&type=javascript&callback=?";
*/
8 changes: 1 addition & 7 deletions js/juiz-social-post-sharer.min.js

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

3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ Find my plugins at <a href="http://profiles.wordpress.org/creativejuiz/">http://

= 1.4.8 =
* Security Update: Fixes XSS vulnerability.
* Network Counters:
* StumbleUpon: code improvement.
* Google+: not supported anymore.

= 1.4.7 =
* Compatibility on network (multisite) thanks to Marie Comet ([Marie Comet](http://mariecomet.fr/))
Expand Down

0 comments on commit f2c78f7

Please sign in to comment.