Genesis Simple Share - Version 1.0.4

Version Description

  • Disabled Twitter counter for now because twitter is removing the ability to get the counts after 10-2015.
Download this release

Release Info

Developer nathanrice
Plugin Icon 128x128 Genesis Simple Share
Version 1.0.4
Comparing to
See all releases

Code changes from version 1.0.3 to 1.0.4

Gruntfile.js ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ module.exports = function(grunt) {
4
+
5
+ // Load tasks
6
+ require('load-grunt-tasks')(grunt);
7
+
8
+ grunt.initConfig({
9
+ pkg: grunt.file.readJSON('package.json'),
10
+
11
+
12
+ // Dependencies
13
+
14
+ // PHP
15
+
16
+ // Lint .php files for syntax errors
17
+ phplint: {
18
+ all: [ '*.php', 'lib/**/*.php' ]
19
+ },
20
+
21
+
22
+ // I18n
23
+
24
+ // Add text domain as last argument of i18n functions
25
+ addtextdomain: {
26
+ php: {
27
+ files: {
28
+ src: [
29
+ '*.php',
30
+ 'lib/**/*.php'
31
+ ]
32
+ }
33
+ }
34
+ },
35
+
36
+ // Check text domain is last argument of i18n functions
37
+ checktextdomain: {
38
+ options: {
39
+ text_domain: '<%= pkg.name %>',
40
+ keywords: [
41
+ '__:1,2d',
42
+ '_e:1,2d',
43
+ '_x:1,2c,3d',
44
+ '_ex:1,2c,3d',
45
+ '_n:1,2,4d',
46
+ '_nx:1,2,4c,5d',
47
+ '_n_noop:1,2,3d',
48
+ '_nx_noop:1,2,3c,4d',
49
+ 'esc_attr__:1,2d',
50
+ 'esc_html__:1,2d',
51
+ 'esc_attr_e:1,2d',
52
+ 'esc_html_e:1,2d',
53
+ 'esc_attr_x:1,2c,3d',
54
+ 'esc_html_x:1,2c,3d'
55
+ ]
56
+ },
57
+ files: {
58
+ expand: true,
59
+ src: [
60
+ '*.php',
61
+ 'lib/**/*.php'
62
+ ]
63
+ }
64
+ },
65
+
66
+
67
+ // Build language .pot file
68
+ makepot: {
69
+ plugin: {
70
+ options: {
71
+ domainPath: '/lib/languages',
72
+ processPot: function( pot ) {
73
+ pot.headers['report-msgid-bugs-to'] = 'StudioPress <translations@studiopress.com>';
74
+ pot.headers['last-translator'] = 'StudioPress <translations@studiopress.com>';
75
+ pot.headers['language-team'] = 'English <translations@studiopress.com>';
76
+ pot.headers['plural-forms'] = 'nplurals=2; plural=n != 1;';
77
+ pot.headers['x-generator'] = 'grunt-wp-i18n 0.4.4';
78
+ pot.headers['x-poedit-basepath'] = '.';
79
+ pot.headers['x-poedit-language'] = 'English';
80
+ pot.headers['x-poedit-country'] = 'UNITED STATES';
81
+ pot.headers['x-poedit-sourcecharset'] = 'utf-8';
82
+ pot.headers['x-poedit-keywordslist'] = '__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;';
83
+ pot.headers['x-poedit-bookmarks'] = '';
84
+ pot.headers['x-poedit-searchpath-0'] = '.';
85
+ pot.headers['x-textdomain-support'] = 'yes';
86
+ return pot;
87
+ },
88
+ type: 'wp-plugin'
89
+ }
90
+ }
91
+ },
92
+
93
+
94
+ });
95
+
96
+ };
assets/banner-772x250.jpg ADDED
Binary file
assets/icon-256x256.png ADDED
Binary file
lib/admin-icon-preview.php CHANGED
@@ -9,9 +9,9 @@
9
  * @license http://www.opensource.org/licenses/gpl-license.php GPL-2.0+
10
  */
11
 
12
- /* Prevent direct access to the plugin */
13
- if ( !defined( 'ABSPATH' ) ) {
14
- die( "Sorry, you are not allowed to access this page directly." );
15
  }
16
 
17
  /**
9
  * @license http://www.opensource.org/licenses/gpl-license.php GPL-2.0+
10
  */
11
 
12
+ //* Prevent direct access to the plugin
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ die( __( 'Sorry, you are not allowed to access this page directly.', 'genesis-simple-share' ) );
15
  }
16
 
17
  /**
lib/admin.php CHANGED
@@ -9,9 +9,9 @@
9
  * @license http://www.opensource.org/licenses/gpl-license.php GPL-2.0+
10
  */
11
 
12
- /* Prevent direct access to the plugin */
13
- if ( !defined( 'ABSPATH' ) ) {
14
- die( "Sorry, you are not allowed to access this page directly." );
15
  }
16
 
17
 
9
  * @license http://www.opensource.org/licenses/gpl-license.php GPL-2.0+
10
  */
11
 
12
+ //* Prevent direct access to the plugin
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ die( __( 'Sorry, you are not allowed to access this page directly.', 'genesis-simple-share' ) );
15
  }
16
 
17
 
lib/css/admin.css CHANGED
@@ -41,6 +41,7 @@
41
 
42
  .genesis_page_genesis_simple_share_settings .meta-box-sortables .postbox h3.hndle {
43
  color: #fff;
 
44
  text-shadow: none;
45
  }
46
 
41
 
42
  .genesis_page_genesis_simple_share_settings .meta-box-sortables .postbox h3.hndle {
43
  color: #fff;
44
+ display: block !important;
45
  text-shadow: none;
46
  }
47
 
lib/css/share.css CHANGED
@@ -1,5 +1,6 @@
1
  .sharrre {
2
- display: inline-block;
 
3
  font-family: Helvetica, Arial, sans-serif;
4
  font-style: normal;
5
  font-weight: normal;
@@ -19,7 +20,17 @@
19
  }
20
 
21
  .share-after {
22
- margin-top: 25px;
 
 
 
 
 
 
 
 
 
 
23
  }
24
 
25
  /* Buttons */
@@ -41,6 +52,7 @@
41
  }
42
 
43
  .sharrre .share {
 
44
  color: #fff;
45
  float: left;
46
  font-family: Helvetica, Arial, sans-serif;
@@ -84,6 +96,7 @@
84
  .share-small .facebook:hover .share { width: 60px; }
85
  .share-small .pinterest:hover .share { width: 45px; }
86
  .share-small .googlePlus:hover .share { width: 60px; }
 
87
 
88
  .share-small .count {
89
  border-top-right-radius: 3px;
@@ -124,6 +137,7 @@
124
  .share-medium .facebook:hover .share { width: 65px; }
125
  .share-medium .pinterest:hover .share { width: 50px; }
126
  .share-medium .googlePlus:hover .share { width: 65px; }
 
127
 
128
  .share-medium .no-count .share {
129
  border-top-right-radius: 3px;
@@ -145,6 +159,7 @@
145
 
146
  .share-tall .googlePlus .share { padding-left: 16px; }
147
  .share-tall .facebook .share { padding-left: 18px; }
 
148
 
149
  .share-tall .count {
150
  border-top-left-radius: 3px;
@@ -158,9 +173,6 @@
158
  }
159
 
160
  .share-tall .no-count .share {
161
- border-top-left-radius: 3px;
162
- border-top-right-radius: 3px;
163
- border-bottom-right-radius: 3px;
164
  width: 75px;
165
  }
166
 
@@ -245,6 +257,43 @@
245
  font-size: 16px;
246
  }
247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
 
249
  /* Appearance - filled */
250
  .share-filled .twitter .share { background: #09b0ed; }
@@ -319,6 +368,9 @@
319
  .share-outlined.share-small .share,
320
  .share-outlined.share-medium .share { border-right: none !important; }
321
 
 
 
 
322
  .share-outlined.share-tall .share { border-top: none !important; }
323
 
324
  .share-outlined .twitter:hover .share,
1
  .sharrre {
2
+ display: block;
3
+ float: left;
4
  font-family: Helvetica, Arial, sans-serif;
5
  font-style: normal;
6
  font-weight: normal;
20
  }
21
 
22
  .share-after {
23
+ margin: 25px 0;
24
+ }
25
+
26
+ .share-before:after,
27
+ .share-after:after {
28
+ visibility: hidden;
29
+ display: block;
30
+ font-size: 0;
31
+ content: " ";
32
+ clear: both;
33
+ height: 0;
34
  }
35
 
36
  /* Buttons */
52
  }
53
 
54
  .sharrre .share {
55
+ background-color: #fff;
56
  color: #fff;
57
  float: left;
58
  font-family: Helvetica, Arial, sans-serif;
96
  .share-small .facebook:hover .share { width: 60px; }
97
  .share-small .pinterest:hover .share { width: 45px; }
98
  .share-small .googlePlus:hover .share { width: 60px; }
99
+ .share-small .twitter:hover .share { width: 65px; }
100
 
101
  .share-small .count {
102
  border-top-right-radius: 3px;
137
  .share-medium .facebook:hover .share { width: 65px; }
138
  .share-medium .pinterest:hover .share { width: 50px; }
139
  .share-medium .googlePlus:hover .share { width: 65px; }
140
+ .share-medium .twitter:hover .share { width: 75px; }
141
 
142
  .share-medium .no-count .share {
143
  border-top-right-radius: 3px;
159
 
160
  .share-tall .googlePlus .share { padding-left: 16px; }
161
  .share-tall .facebook .share { padding-left: 18px; }
162
+ .share-tall .twitter .share { padding-left: 0; }
163
 
164
  .share-tall .count {
165
  border-top-left-radius: 3px;
173
  }
174
 
175
  .share-tall .no-count .share {
 
 
 
176
  width: 75px;
177
  }
178
 
257
  font-size: 16px;
258
  }
259
 
260
+ .share-tall .twitter .share:before { display: none; }
261
+
262
+ .share-tall .twitter .box.no-count {
263
+ background: #fff;
264
+ cursor: pointer;
265
+ height: 80px;
266
+ text-align: center;
267
+ }
268
+
269
+ .share-tall .twitter .box.no-count:before {
270
+ border: 1px solid #09b0ed;
271
+ border-top-left-radius: 3px;
272
+ border-top-right-radius: 3px;
273
+ box-sizing: border-box;
274
+ content: '\f202';
275
+ color: #09b0ed;
276
+ cursor: pointer;
277
+ display: block;
278
+ line-height: 1;
279
+ height: 55px;
280
+ font-family: 'Genericons';
281
+ font-size: 20px;
282
+ padding-top: 17px;
283
+ position: relative;
284
+ -webkit-font-smoothing: antialiased;
285
+ -webkit-transition: all 0.3s ease-in-out;
286
+ -moz-transition: all 0.3s ease-in-out;
287
+ -ms-transition: all 0.3s ease-in-out;
288
+ -o-transition: all 0.3s ease-in-out;
289
+ transition: all 0.3s ease-in-out;
290
+ }
291
+
292
+ .share-tall .twitter:hover .box.no-count:before {
293
+ background: #09b0ed;
294
+ color: #fff;
295
+ }
296
+
297
 
298
  /* Appearance - filled */
299
  .share-filled .twitter .share { background: #09b0ed; }
368
  .share-outlined.share-small .share,
369
  .share-outlined.share-medium .share { border-right: none !important; }
370
 
371
+ .share-outlined.share-small .twitter .share,
372
+ .share-outlined.share-medium .twitter .share { border-right: 1px solid #09b0ed !important; }
373
+
374
  .share-outlined.share-tall .share { border-top: none !important; }
375
 
376
  .share-outlined .twitter:hover .share,
lib/functions.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  //add functions that are used in admin and front end of the site
13
 
14
- /* Prevent direct access to the plugin */
15
- if ( !defined( 'ABSPATH' ) ) {
16
- die( "Sorry, you are not allowed to access this page directly." );
17
  }
11
 
12
  //add functions that are used in admin and front end of the site
13
 
14
+ //* Prevent direct access to the plugin
15
+ if ( ! defined( 'ABSPATH' ) ) {
16
+ die( __( 'Sorry, you are not allowed to access this page directly.', 'genesis-simple-share' ) );
17
  }
lib/languages/genesis-simple-share.pot ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 copyblogger
2
+ # This file is distributed under the same license as the Genesis Simple Share package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Genesis Simple Share 1.0.4\n"
6
+ "Report-Msgid-Bugs-To: StudioPress <translations@studiopress.com>\n"
7
+ "POT-Creation-Date: 2015-09-28 19:58:47+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: StudioPress <translations@studiopress.com>\n"
13
+ "Language-Team: English <translations@studiopress.com>\n"
14
+ "X-Generator: grunt-wp-i18n 0.4.4\n"
15
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
16
+ "X-Poedit-Basepath: .\n"
17
+ "X-Poedit-Language: English\n"
18
+ "X-Poedit-Country: UNITED STATES\n"
19
+ "X-Poedit-SourceCharset: utf-8\n"
20
+ "X-Poedit-KeywordsList: "
21
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
22
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
23
+ "X-Poedit-Bookmarks: \n"
24
+ "X-Poedit-SearchPath-0: .\n"
25
+ "X-Textdomain-Support: yes\n"
26
+
27
+ #: lib/admin-icon-preview.php:14 lib/admin.php:14 lib/functions.php:16
28
+ #: plugin.php:19
29
+ msgid "Sorry, you are not allowed to access this page directly."
30
+ msgstr ""
31
+
32
+ #: lib/admin.php:40
33
+ msgid "You can change button position by reordering these boxes:"
34
+ msgstr ""
35
+
36
+ #: lib/admin.php:64
37
+ msgid "Genesis Simple Share Settings"
38
+ msgstr ""
39
+
40
+ #: lib/admin.php:65
41
+ msgid "Simple Share"
42
+ msgstr ""
43
+
44
+ #: lib/admin.php:232
45
+ msgid "Google+"
46
+ msgstr ""
47
+
48
+ #: lib/admin.php:233
49
+ msgid "Facebook"
50
+ msgstr ""
51
+
52
+ #: lib/admin.php:234
53
+ msgid "Twitter"
54
+ msgstr ""
55
+
56
+ #: lib/admin.php:235
57
+ msgid "Pinterest"
58
+ msgstr ""
59
+
60
+ #: lib/admin.php:236
61
+ msgid "Linkedin"
62
+ msgstr ""
63
+
64
+ #: lib/admin.php:237
65
+ msgid "StumbleUpon"
66
+ msgstr ""
67
+
68
+ #: lib/admin.php:264
69
+ msgid "Icon Size"
70
+ msgstr ""
71
+
72
+ #: lib/admin.php:265
73
+ msgid "Small Bar"
74
+ msgstr ""
75
+
76
+ #: lib/admin.php:266
77
+ msgid "Medium Bar"
78
+ msgstr ""
79
+
80
+ #: lib/admin.php:267
81
+ msgid "Box"
82
+ msgstr ""
83
+
84
+ #: lib/admin.php:270
85
+ msgid "Icon Appearance"
86
+ msgstr ""
87
+
88
+ #: lib/admin.php:271
89
+ msgid "Outlined"
90
+ msgstr ""
91
+
92
+ #: lib/admin.php:272
93
+ msgid "Filled"
94
+ msgstr ""
95
+
96
+ #: lib/admin.php:319 lib/admin.php:336 lib/admin.php:353 lib/admin.php:374
97
+ #: lib/admin.php:389 lib/admin.php:409
98
+ msgid "Use this button?"
99
+ msgstr ""
100
+
101
+ #: lib/admin.php:356
102
+ msgid "Enter Twitter ID for @via to be added to default tweet text:"
103
+ msgstr ""
104
+
105
+ #: lib/admin.php:392
106
+ msgid ""
107
+ "Enter Default Image URL if there is no image available in content being "
108
+ "shared:"
109
+ msgstr ""
110
+
111
+ #: lib/admin.php:423
112
+ msgid "Icon Display Position"
113
+ msgstr ""
114
+
115
+ #: lib/admin.php:424
116
+ msgid "Select display position to enable icons."
117
+ msgstr ""
118
+
119
+ #: lib/admin.php:425
120
+ msgid "Before the Content"
121
+ msgstr ""
122
+
123
+ #: lib/admin.php:426
124
+ msgid "After the Content"
125
+ msgstr ""
126
+
127
+ #: lib/admin.php:427
128
+ msgid "Before and After the Content"
129
+ msgstr ""
130
+
131
+ #: lib/admin.php:477
132
+ msgid "Enable on:"
133
+ msgstr ""
134
+
135
+ #: lib/admin.php:484
136
+ msgid "Show on Archive Pages"
137
+ msgstr ""
138
+
139
+ #: lib/post-meta.php:18
140
+ msgid "Share Settings"
141
+ msgstr ""
142
+
143
+ #: lib/post-meta.php:37
144
+ msgid "Disable Share Buttons"
145
+ msgstr ""
146
+
147
+ #. Plugin Name of the plugin/theme
148
+ msgid "Genesis Simple Share"
149
+ msgstr ""
150
+
151
+ #. Description of the plugin/theme
152
+ msgid "A simple sharing plugin using the Share script."
153
+ msgstr ""
154
+
155
+ #. Author of the plugin/theme
156
+ msgid "copyblogger"
157
+ msgstr ""
158
+
159
+ #. Author URI of the plugin/theme
160
+ msgid "http://www.copyblogger.com"
161
+ msgstr ""
lib/sharrre/error_log DELETED
@@ -1,5 +0,0 @@
1
- [20-Feb-2014 01:28:53 UTC] PHP Warning: strpos() [<a href='function.strpos'>function.strpos</a>]: Empty delimiter in /home/fottsp/public_html/wp-content/plugins/genesis-simple-share/lib/sharrre/sharrre.php on line 98
2
- [20-Feb-2014 01:30:09 UTC] PHP Warning: strpos() [<a href='function.strpos'>function.strpos</a>]: Empty delimiter in /home/fottsp/public_html/wp-content/plugins/genesis-simple-share/lib/sharrre/sharrre.php on line 98
3
- [20-Feb-2014 01:33:18 UTC] PHP Parse error: syntax error, unexpected T_VARIABLE in /home/fottsp/public_html/wp-content/plugins/genesis-simple-share/lib/sharrre/sharrre.php on line 119
4
- [20-Feb-2014 01:34:20 UTC] PHP Parse error: syntax error, unexpected T_VARIABLE in /home/fottsp/public_html/wp-content/plugins/genesis-simple-share/lib/sharrre/sharrre.php on line 121
5
- [20-Feb-2014 01:34:58 UTC] PHP Parse error: syntax error, unexpected $end, expecting ')' in /home/fottsp/public_html/wp-content/plugins/genesis-simple-share/lib/sharrre/sharrre.php on line 59
 
 
 
 
 
lib/sharrre/jquery.sharrre.js CHANGED
@@ -448,54 +448,64 @@
448
  var self = this,
449
  count = 0,
450
  url = urlJson[name].replace('{url}', encodeURIComponent(this.options.url));
451
- self.options.hideCount = 0;
452
 
453
- if(this.options.buttons[name].urlCount === true && this.options.buttons[name].url !== ''){
454
- url = urlJson[name].replace('{url}', this.options.buttons[name].url);
455
- }
456
- //console.log('name : ' + name + ' - url : '+url); //debug
457
- if(url != '' && self.options.urlCurl !== ''){ //urlCurl = '' if you don't want to used PHP script but used social button
458
- $.getJSON(url, function(json){
459
- if( null != json ){
460
-
461
- if(typeof json.count !== "undefined"){ //GooglePlus, Stumbleupon, Twitter, Pinterest and Digg
462
- var temp = json.count + '';
463
- temp = temp.replace('\u00c2\u00a0', ''); //remove google plus special chars
464
- count += parseInt(temp, 10);
465
- }
466
- //get the FB total count (shares, likes and more)
467
- else if(json.data && json.data.length > 0 && typeof json.data[0].total_count !== "undefined"){ //Facebook total count
468
- count += parseInt(json.data[0].total_count, 10);
469
- }
470
- else if(typeof json[0] !== "undefined"){ //Delicious
471
- count += parseInt(json[0].total_posts, 10);
472
- }
473
- else if(typeof json[0] !== "undefined"){ //Stumbleupon
474
- }
475
- self.options.count[name] = count;
476
- self.options.total += count;
477
- self.renderer();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  self.rendererPerso();
479
- //console.log(json); //debug
480
- }
481
- else {
482
  self.renderer();
483
  self.options.count[name] = 0;
484
  self.rendererPerso();
485
- }
486
- //console.log(json); //debug
487
- })
488
- .fail(function() {
489
- self.options.hideCount = 1;
490
- self.renderer();
491
- self.options.count[name] = 0;
492
- self.rendererPerso();
493
- });
494
- }
495
- else{
496
- self.renderer();
497
- self.options.count[name] = 0;
498
- self.rendererPerso();
499
  }
500
  };
501
 
448
  var self = this,
449
  count = 0,
450
  url = urlJson[name].replace('{url}', encodeURIComponent(this.options.url));
 
451
 
452
+ if( 'twitter' == name ){ //twitter is dropping support for count service so for now we cannot get the count.
453
+ self.options.hideCount = 1;
454
+ self.renderer();
455
+ self.options.count[name] = 0;
456
+ self.rendererPerso();
457
+ } else {
458
+
459
+ self.options.hideCount = 0;
460
+
461
+ if(this.options.buttons[name].urlCount === true && this.options.buttons[name].url !== ''){
462
+ url = urlJson[name].replace('{url}', this.options.buttons[name].url);
463
+ }
464
+ //console.log('name : ' + name + ' - url : '+url); //debug
465
+ if(url != '' && self.options.urlCurl !== ''){ //urlCurl = '' if you don't want to used PHP script but used social button
466
+ $.getJSON(url, function(json){
467
+ if( null != json ){
468
+
469
+ if(typeof json.count !== "undefined"){ //GooglePlus, Stumbleupon, Twitter, Pinterest and Digg
470
+ var temp = json.count + '';
471
+ temp = temp.replace('\u00c2\u00a0', ''); //remove google plus special chars
472
+ count += parseInt(temp, 10);
473
+ }
474
+ //get the FB total count (shares, likes and more)
475
+ else if(json.data && json.data.length > 0 && typeof json.data[0].total_count !== "undefined"){ //Facebook total count
476
+ count += parseInt(json.data[0].total_count, 10);
477
+ }
478
+ else if(typeof json[0] !== "undefined"){ //Delicious
479
+ count += parseInt(json[0].total_posts, 10);
480
+ }
481
+ else if(typeof json[0] !== "undefined"){ //Stumbleupon
482
+ }
483
+ self.options.count[name] = count;
484
+ self.options.total += count;
485
+ self.renderer();
486
+ self.rendererPerso();
487
+ //console.log(json); //debug
488
+ }
489
+ else {
490
+ self.renderer();
491
+ self.options.count[name] = 0;
492
+ self.rendererPerso();
493
+ }
494
+ //console.log(json); //debug
495
+ })
496
+ .fail(function() {
497
+ self.options.hideCount = 1;
498
+ self.renderer();
499
+ self.options.count[name] = 0;
500
  self.rendererPerso();
501
+ });
502
+ }
503
+ else{
504
  self.renderer();
505
  self.options.count[name] = 0;
506
  self.rendererPerso();
507
+ }
508
+
 
 
 
 
 
 
 
 
 
 
 
 
509
  }
510
  };
511
 
lib/sharrre/jquery.sharrre.min.js CHANGED
@@ -1,7 +1,42 @@
1
- /*!
2
- * Sharrre.com - Make your sharing widget!
3
- * Version: beta 1.3.5
4
- * Author: Julien Hany
5
- * License: MIT http://en.wikipedia.org/wiki/MIT_License or GPLv2 http://en.wikipedia.org/wiki/GNU_General_Public_License
6
- */
7
- (function(t,n,r,i){function h(e,n){this.element=e;this.options=t.extend(true,{},u,n);this.options.share=n.share;this._defaults=u;this._name=o;this.init()}var o="sharrre",u={className:"sharrre",share:{googlePlus:false,facebook:false,twitter:false,digg:false,delicious:false,stumbleupon:false,linkedin:false,pinterest:false},shareTotal:0,template:"",title:"",url:r.location.href,text:r.title,urlCurl:"sharrre.php",count:{},total:0,shorterTotal:true,enableHover:true,enableCounter:true,enableTracking:false,hover:function(){},hide:function(){},click:function(){},render:function(){},buttons:{googlePlus:{url:"",urlCount:false,size:"medium",lang:"en-US",annotation:""},facebook:{url:"",urlCount:false,action:"like",layout:"button_count",width:"",send:"false",faces:"false",colorscheme:"",font:"",lang:"en_US"},twitter:{url:"",urlCount:false,count:"horizontal",hashtags:"",via:"",related:"",lang:"en"},digg:{url:"",urlCount:false,type:"DiggCompact"},delicious:{url:"",urlCount:false,size:"medium"},stumbleupon:{url:"",urlCount:false,layout:"1"},linkedin:{url:"",urlCount:false,counter:""},pinterest:{url:"",media:"",description:"",layout:"horizontal"}}},a={googlePlus:"",facebook:"https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27{url}%27&callback=?",twitter:"//cdn.api.twitter.com/1/urls/count.json?url={url}&callback=?",digg:"//services.digg.com/2.0/story.getInfo?links={url}&type=javascript&callback=?",delicious:"//feeds.delicious.com/v2/json/urlinfo/data?url={url}&callback=?",stumbleupon:"",linkedin:"//www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?",pinterest:"//api.pinterest.com/v1/urls/count.json?url={url}&callback=?"},f={googlePlus:function(e){var i=e.options.buttons.googlePlus;t(e.element).find(".buttons").append('<div class="button googleplus"><div class="g-plusone" data-size="'+i.size+'" data-href="'+(i.url!==""?i.url:e.options.url)+'" data-annotation="'+i.annotation+'"></div></div>');n.___gcfg={lang:e.options.buttons.googlePlus.lang};var s=0;if(typeof gapi==="undefined"&&s==0){s=1;(function(){var e=r.createElement("script");e.type="text/javascript";e.async=true;e.src="//apis.google.com/js/plusone.js";var t=r.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})()}else{gapi.plusone.go()}},facebook:function(e){var n=e.options.buttons.facebook;t(e.element).find(".buttons").append('<div class="button facebook"><div id="fb-root"></div><div class="fb-like" data-href="'+(n.url!==""?n.url:e.options.url)+'" data-send="'+n.send+'" data-layout="'+n.layout+'" data-width="'+n.width+'" data-show-faces="'+n.faces+'" data-action="'+n.action+'" data-colorscheme="'+n.colorscheme+'" data-font="'+n.font+'" data-via="'+n.via+'"></div></div>');var i=0;if(typeof FB==="undefined"&&i==0){i=1;(function(e,t,r){var i,s=e.getElementsByTagName(t)[0];if(e.getElementById(r)){return}i=e.createElement(t);i.id=r;i.src="//connect.facebook.net/"+n.lang+"/all.js#xfbml=1";s.parentNode.insertBefore(i,s)})(r,"script","facebook-jssdk")}else{FB.XFBML.parse()}},twitter:function(e){var n=e.options.buttons.twitter;t(e.element).find(".buttons").append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="'+(n.url!==""?n.url:e.options.url)+'" data-count="'+n.count+'" data-text="'+e.options.text+'" data-via="'+n.via+'" data-hashtags="'+n.hashtags+'" data-related="'+n.related+'" data-lang="'+n.lang+'">Tweet</a></div>');var i=0;if(typeof twttr==="undefined"&&i==0){i=1;(function(){var e=r.createElement("script");e.type="text/javascript";e.async=true;e.src="//platform.twitter.com/widgets.js";var t=r.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})()}else{t.ajax({url:"//platform.twitter.com/widgets.js",dataType:"script",cache:true})}},digg:function(e){var n=e.options.buttons.digg;t(e.element).find(".buttons").append('<div class="button digg"><a class="DiggThisButton '+n.type+'" rel="nofollow external" href="//digg.com/submit?url='+encodeURIComponent(n.url!==""?n.url:e.options.url)+'"></a></div>');var i=0;if(typeof __DBW==="undefined"&&i==0){i=1;(function(){var e=r.createElement("SCRIPT"),t=r.getElementsByTagName("SCRIPT")[0];e.type="text/javascript";e.async=true;e.src="//widgets.digg.com/buttons.js";t.parentNode.insertBefore(e,t)})()}},delicious:function(e){if(e.options.buttons.delicious.size=="tall"){var n="width:50px;",r="height:35px;width:50px;font-size:15px;line-height:35px;",i="height:18px;line-height:18px;margin-top:3px;"}else{var n="width:93px;",r="float:right;padding:0 3px;height:20px;width:26px;line-height:20px;",i="float:left;height:20px;line-height:20px;"}var s=e.shorterTotal(e.options.count.delicious);if(typeof s==="undefined"){s=0}t(e.element).find(".buttons").append('<div class="button delicious"><div style="'+n+'font:12px Arial,Helvetica,sans-serif;cursor:pointer;color:#666666;display:inline-block;float:none;height:20px;line-height:normal;margin:0;padding:0;text-indent:0;vertical-align:baseline;">'+'<div style="'+r+'background-color:#fff;margin-bottom:5px;overflow:hidden;text-align:center;border:1px solid #ccc;border-radius:3px;">'+s+"</div>"+'<div style="'+i+'display:block;padding:0;text-align:center;text-decoration:none;width:50px;background-color:#7EACEE;border:1px solid #40679C;border-radius:3px;color:#fff;">'+'<img src="//www.delicious.com/static/img/delicious.small.gif" height="10" width="10" alt="Delicious" /> Add</div></div></div>');t(e.element).find(".delicious").on("click",function(){e.openPopup("delicious")})},stumbleupon:function(e){var i=e.options.buttons.stumbleupon;t(e.element).find(".buttons").append('<div class="button stumbleupon"><su:badge layout="'+i.layout+'" location="'+(i.url!==""?i.url:e.options.url)+'"></su:badge></div>');var o=0;if(typeof STMBLPN==="undefined"&&o==0){o=1;(function(){var e=r.createElement("script");e.type="text/javascript";e.async=true;e.src="//platform.stumbleupon.com/1/widgets.js";var t=r.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})();s=n.setTimeout(function(){if(typeof STMBLPN!=="undefined"){STMBLPN.processWidgets();clearInterval(s)}},500)}else{STMBLPN.processWidgets()}},linkedin:function(e){var i=e.options.buttons.linkedin;t(e.element).find(".buttons").append('<div class="button linkedin"><script type="in/share" data-url="'+(i.url!==""?i.url:e.options.url)+'" data-counter="'+i.counter+'"></script></div>');var s=0;if(typeof n.IN==="undefined"&&s==0){s=1;(function(){var e=r.createElement("script");e.type="text/javascript";e.async=true;e.src="//platform.linkedin.com/in.js";var t=r.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})()}else{n.IN.init()}},pinterest:function(e){var n=e.options.buttons.pinterest;t(e.element).find(".buttons").append('<div class="button pinterest"><a href="//pinterest.com/pin/create/button/?url='+(n.url!==""?n.url:e.options.url)+"&media="+n.media+"&description="+n.description+'" class="pin-it-button" count-layout="'+n.layout+'">Pin It</a></div>');(function(){var e=r.createElement("script");e.type="text/javascript";e.async=true;e.src="//assets.pinterest.com/js/pinit.js";var t=r.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})()}},l={googlePlus:function(){},facebook:function(){fb=n.setInterval(function(){if(typeof FB!=="undefined"){FB.Event.subscribe("edge.create",function(e){_gaq.push(["_trackSocial","facebook","like",e])});FB.Event.subscribe("edge.remove",function(e){_gaq.push(["_trackSocial","facebook","unlike",e])});FB.Event.subscribe("message.send",function(e){_gaq.push(["_trackSocial","facebook","send",e])});clearInterval(fb)}},1e3)},twitter:function(){tw=n.setInterval(function(){if(typeof twttr!=="undefined"){twttr.events.bind("tweet",function(e){if(e){_gaq.push(["_trackSocial","twitter","tweet"])}});clearInterval(tw)}},1e3)},digg:function(){},delicious:function(){},stumbleupon:function(){},linkedin:function(){function e(){_gaq.push(["_trackSocial","linkedin","share"])}},pinterest:function(){}},c={googlePlus:function(e){n.open("https://plus.google.com/share?hl="+e.buttons.googlePlus.lang+"&url="+encodeURIComponent(e.buttons.googlePlus.url!==""?e.buttons.googlePlus.url:e.url),"","toolbar=0, status=0, width=900, height=500")},facebook:function(e){n.open("//www.facebook.com/sharer/sharer.php?u="+encodeURIComponent(e.buttons.facebook.url!==""?e.buttons.facebook.url:e.url)+"&t="+e.text+"","","toolbar=0, status=0, width=900, height=500")},twitter:function(e){n.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(e.text)+"&url="+encodeURIComponent(e.buttons.twitter.url!==""?e.buttons.twitter.url:e.url)+(e.buttons.twitter.via!==""?"&via="+e.buttons.twitter.via:""),"","toolbar=0, status=0, width=650, height=360")},digg:function(e){n.open("//digg.com/tools/diggthis/submit?url="+encodeURIComponent(e.buttons.digg.url!==""?e.buttons.digg.url:e.url)+"&title="+e.text+"&related=true&style=true","","toolbar=0, status=0, width=650, height=360")},delicious:function(e){n.open("//www.delicious.com/save?v=5&noui&jump=close&url="+encodeURIComponent(e.buttons.delicious.url!==""?e.buttons.delicious.url:e.url)+"&title="+e.text,"delicious","toolbar=no,width=550,height=550")},stumbleupon:function(e){n.open("//www.stumbleupon.com/badge/?url="+encodeURIComponent(e.buttons.delicious.url!==""?e.buttons.delicious.url:e.url),"stumbleupon","toolbar=no,width=550,height=550")},linkedin:function(e){n.open("https://www.linkedin.com/cws/share?url="+encodeURIComponent(e.buttons.delicious.url!==""?e.buttons.delicious.url:e.url)+"&token=&isFramed=true","linkedin","toolbar=no,width=550,height=550")},pinterest:function(e){n.open("//pinterest.com/pin/create/button/?url="+encodeURIComponent(e.buttons.pinterest.url!==""?e.buttons.pinterest.url:e.url)+"&media="+encodeURIComponent(e.buttons.pinterest.media)+"&description="+e.buttons.pinterest.description,"pinterest","toolbar=no,width=700,height=300")}};h.prototype.init=function(){var e=this;if(this.options.urlCurl!==""){a.googlePlus=this.options.urlCurl+"?url={url}&type=googlePlus";a.stumbleupon=this.options.urlCurl+"?url={url}&type=stumbleupon"}t(this.element).addClass(this.options.className);if(typeof t(this.element).data("title")!=="undefined"){this.options.title=t(this.element).attr("data-title")}if(typeof t(this.element).data("url")!=="undefined"){this.options.url=t(this.element).data("url")}if(typeof t(this.element).data("urlalt")!=="undefined"){this.options.urlalt=t(this.element).data("urlalt")}if(typeof t(this.element).data("text")!=="undefined"){this.options.text=t(this.element).data("text")}t.each(this.options.share,function(t,n){if(n===true){e.options.shareTotal++}});if(e.options.enableCounter===true){t.each(this.options.share,function(t,n){if(n===true){try{e.getSocialJson(t);e.getSocialJson(getSocialAltJson)}catch(r){}}})}else if(e.options.template!==""){this.options.render(this,this.options)}else{this.loadButtons()}t(this.element).hover(function(){if(t(this).find(".buttons").length===0&&e.options.enableHover===true){e.loadButtons()}e.options.hover(e,e.options)},function(){e.options.hide(e,e.options)});t(this.element).click(function(){e.options.click(e,e.options);return false})};h.prototype.loadButtons=function(){var e=this;t(this.element).append('<div class="buttons"></div>');t.each(e.options.share,function(t,n){if(n==true){f[t](e);if(e.options.enableTracking===true){l[t]()}}})};h.prototype.getSocialJson=function(e){var n=this,r=0,i=a[e].replace("{url}",encodeURIComponent(this.options.url));n.options.hideCount=0;if(this.options.buttons[e].urlCount===true&&this.options.buttons[e].url!==""){i=a[e].replace("{url}",this.options.buttons[e].url)}if(i!=""&&n.options.urlCurl!==""){t.getJSON(i,function(t){if(null!=t){if(typeof t.count!=="undefined"){var i=t.count+"";i=i.replace(" ","");r+=parseInt(i,10)}else if(t.data&&t.data.length>0&&typeof t.data[0].total_count!=="undefined"){r+=parseInt(t.data[0].total_count,10)}else if(typeof t[0]!=="undefined"){r+=parseInt(t[0].total_posts,10)}else if(typeof t[0]!=="undefined"){}n.options.count[e]=r;n.options.total+=r;n.renderer();n.rendererPerso()}else{n.renderer();n.options.count[e]=0;n.rendererPerso()}}).fail(function(){n.options.hideCount=1;n.renderer();n.options.count[e]=0;n.rendererPerso()})}else{n.renderer();n.options.count[e]=0;n.rendererPerso()}};h.prototype.getSocialAltJson=function(e){var n=this,r=0,i=a[e].replace("{url}",encodeURIComponent(this.options.urlalt));n.options.hideCount=0;if(this.options.buttons[e].urlCount===true&&this.options.buttons[e].url!==""){i=a[e].replace("{url}",this.options.buttons[e].url)}if(i!=""&&n.options.urlCurl!==""){t.getJSON(i,function(t){if(null!=t){if(typeof t.count!=="undefined"){var i=t.count+"";i=i.replace(" ","");r+=parseInt(i,10)}else if(t.data&&t.data.length>0&&typeof t.data[0].total_count!=="undefined"){r+=parseInt(t.data[0].total_count,10)}else if(typeof t[0]!=="undefined"){r+=parseInt(t[0].total_posts,10)}else if(typeof t[0]!=="undefined"){}n.options.count[e]+=r;n.options.total+=r;n.renderer();n.rendererPerso()}else{n.renderer();n.rendererPerso()}}).fail(function(){n.renderer();n.rendererPerso()})}else{n.renderer();n.rendererPerso()}};h.prototype.rendererPerso=function(){var t=0;for(e in this.options.count){t++}if(t===this.options.shareTotal){this.options.render(this,this.options)}};h.prototype.renderer=function(){var e=this.options.total,n=this.options.template;hideCount=this.options.hideCount;if(hideCount){t(this.element).html('<div class="box no-count">'+(this.options.title!==""?'<a class="share" href="#">'+this.options.title+"</a>":"")+"</div>")}else{if(this.options.shorterTotal===true){e=this.shorterTotal(e)}if(n!==""){n=n.replace("{total}",e);t(this.element).html(n)}else{t(this.element).html('<div class="box"><a class="count" href="#">'+e+"</a>"+(this.options.title!==""?'<a class="share" href="#">'+this.options.title+"</a>":"")+"</div>")}}};h.prototype.shorterTotal=function(e){if(e>=1e6){e=(e/1e6).toFixed(2)+"M"}else if(e>=1e3){e=(e/1e3).toFixed(1)+"k"}return e};h.prototype.openPopup=function(e){c[e](this.options);if(this.options.enableTracking===true){var t={googlePlus:{site:"Google",action:"+1"},facebook:{site:"facebook",action:"like"},twitter:{site:"twitter",action:"tweet"},digg:{site:"digg",action:"add"},delicious:{site:"delicious",action:"add"},stumbleupon:{site:"stumbleupon",action:"add"},linkedin:{site:"linkedin",action:"share"},pinterest:{site:"pinterest",action:"pin"}};_gaq.push(["_trackSocial",t[e].site,t[e].action])}};h.prototype.simulateClick=function(){var e=t(this.element).html();t(this.element).html(e.replace(this.options.total,this.options.total+1))};h.prototype.update=function(e,t){if(e!==""){this.options.url=e}if(t!==""){this.options.text=t}};t.fn[o]=function(e){var n=arguments;if(e===i||typeof e==="object"){return this.each(function(){if(!t.data(this,"plugin_"+o)){t.data(this,"plugin_"+o,new h(this,e))}})}else if(typeof e==="string"&&e[0]!=="_"&&e!=="init"){return this.each(function(){var r=t.data(this,"plugin_"+o);if(r instanceof h&&typeof r[e]==="function"){r[e].apply(r,Array.prototype.slice.call(n,1))}})}}})(jQuery,window,document)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ;(function($,window,document,undefined){var pluginName='sharrre',defaults={className:'sharrre',share:{googlePlus:false,facebook:false,twitter:false,digg:false,delicious:false,stumbleupon:false,linkedin:false,pinterest:false},shareTotal:0,template:'',title:'',url:document.location.href,text:document.title,urlCurl:'sharrre.php',count:{},total:0,shorterTotal:true,enableHover:true,enableCounter:true,enableTracking:false,hover:function(){},hide:function(){},click:function(){},render:function(){},buttons:{googlePlus:{url:'',urlCount:false,size:'medium',lang:'en-US',annotation:''},facebook:{url:'',urlCount:false,action:'like',layout:'button_count',width:'',send:'false',faces:'false',colorscheme:'',font:'',lang:'en_US'},twitter:{url:'',urlCount:false,count:'horizontal',hashtags:'',via:'',related:'',lang:'en'},digg:{url:'',urlCount:false,type:'DiggCompact'},delicious:{url:'',urlCount:false,size:'medium'},stumbleupon:{url:'',urlCount:false,layout:'1'},linkedin:{url:'',urlCount:false,counter:''},pinterest:{url:'',media:'',description:'',layout:'horizontal'}}},urlJson={googlePlus:"",facebook:"https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27{url}%27&callback=?",twitter:"//cdn.api.twitter.com/1/urls/count.json?url={url}&callback=?",digg:"//services.digg.com/2.0/story.getInfo?links={url}&type=javascript&callback=?",delicious:'//feeds.delicious.com/v2/json/urlinfo/data?url={url}&callback=?',stumbleupon:"",linkedin:"//www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?",pinterest:"//api.pinterest.com/v1/urls/count.json?url={url}&callback=?"},loadButton={googlePlus:function(self){var sett=self.options.buttons.googlePlus;$(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:self.options.buttons.googlePlus.lang};var loading=0;if(typeof gapi==='undefined'&&loading==0){loading=1;(function(){var po=document.createElement('script');po.type='text/javascript';po.async=true;po.src='//apis.google.com/js/plusone.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(po,s);})();}
2
+ else{gapi.plusone.go();}},facebook:function(self){var sett=self.options.buttons.facebook;$(self.element).find('.buttons').append('<div class="button facebook"><div id="fb-root"></div><div class="fb-like" data-href="'+(sett.url!==''?sett.url:self.options.url)+'" data-send="'+sett.send+'" data-layout="'+sett.layout+'" data-width="'+sett.width+'" data-show-faces="'+sett.faces+'" data-action="'+sett.action+'" data-colorscheme="'+sett.colorscheme+'" data-font="'+sett.font+'" data-via="'+sett.via+'"></div></div>');var loading=0;if(typeof FB==='undefined'&&loading==0){loading=1;(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return;}
3
+ js=d.createElement(s);js.id=id;js.src='//connect.facebook.net/'+sett.lang+'/all.js#xfbml=1';fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));}
4
+ else{FB.XFBML.parse();}},twitter:function(self){var sett=self.options.buttons.twitter;$(self.element).find('.buttons').append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="'+(sett.url!==''?sett.url:self.options.url)+'" data-count="'+sett.count+'" data-text="'+self.options.text+'" data-via="'+sett.via+'" data-hashtags="'+sett.hashtags+'" data-related="'+sett.related+'" data-lang="'+sett.lang+'">Tweet</a></div>');var loading=0;if(typeof twttr==='undefined'&&loading==0){loading=1;(function(){var twitterScriptTag=document.createElement('script');twitterScriptTag.type='text/javascript';twitterScriptTag.async=true;twitterScriptTag.src='//platform.twitter.com/widgets.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(twitterScriptTag,s);})();}
5
+ else{$.ajax({url:'//platform.twitter.com/widgets.js',dataType:'script',cache:true});}},digg:function(self){var sett=self.options.buttons.digg;$(self.element).find('.buttons').append('<div class="button digg"><a class="DiggThisButton '+sett.type+'" rel="nofollow external" href="//digg.com/submit?url='+encodeURIComponent((sett.url!==''?sett.url:self.options.url))+'"></a></div>');var loading=0;if(typeof __DBW==='undefined'&&loading==0){loading=1;(function(){var s=document.createElement('SCRIPT'),s1=document.getElementsByTagName('SCRIPT')[0];s.type='text/javascript';s.async=true;s.src='//widgets.digg.com/buttons.js';s1.parentNode.insertBefore(s,s1);})();}},delicious:function(self){if(self.options.buttons.delicious.size=='tall'){var css='width:50px;',cssCount='height:35px;width:50px;font-size:15px;line-height:35px;',cssShare='height:18px;line-height:18px;margin-top:3px;';}
6
+ else{var css='width:93px;',cssCount='float:right;padding:0 3px;height:20px;width:26px;line-height:20px;',cssShare='float:left;height:20px;line-height:20px;';}
7
+ var count=self.shorterTotal(self.options.count.delicious);if(typeof count==="undefined"){count=0;}
8
+ $(self.element).find('.buttons').append('<div class="button delicious"><div style="'+css+'font:12px Arial,Helvetica,sans-serif;cursor:pointer;color:#666666;display:inline-block;float:none;height:20px;line-height:normal;margin:0;padding:0;text-indent:0;vertical-align:baseline;">'+'<div style="'+cssCount+'background-color:#fff;margin-bottom:5px;overflow:hidden;text-align:center;border:1px solid #ccc;border-radius:3px;">'+count+'</div>'+'<div style="'+cssShare+'display:block;padding:0;text-align:center;text-decoration:none;width:50px;background-color:#7EACEE;border:1px solid #40679C;border-radius:3px;color:#fff;">'+'<img src="//www.delicious.com/static/img/delicious.small.gif" height="10" width="10" alt="Delicious" /> Add</div></div></div>');$(self.element).find('.delicious').on('click',function(){self.openPopup('delicious');});},stumbleupon:function(self){var sett=self.options.buttons.stumbleupon;$(self.element).find('.buttons').append('<div class="button stumbleupon"><su:badge layout="'+sett.layout+'" location="'+(sett.url!==''?sett.url:self.options.url)+'"></su:badge></div>');var loading=0;if(typeof STMBLPN==='undefined'&&loading==0){loading=1;(function(){var li=document.createElement('script');li.type='text/javascript';li.async=true;li.src='//platform.stumbleupon.com/1/widgets.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li,s);})();s=window.setTimeout(function(){if(typeof STMBLPN!=='undefined'){STMBLPN.processWidgets();clearInterval(s);}},500);}
9
+ else{STMBLPN.processWidgets();}},linkedin:function(self){var sett=self.options.buttons.linkedin;$(self.element).find('.buttons').append('<div class="button linkedin"><script type="in/share" data-url="'+(sett.url!==''?sett.url:self.options.url)+'" data-counter="'+sett.counter+'"></script></div>');var loading=0;if(typeof window.IN==='undefined'&&loading==0){loading=1;(function(){var li=document.createElement('script');li.type='text/javascript';li.async=true;li.src='//platform.linkedin.com/in.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li,s);})();}
10
+ else{window.IN.init();}},pinterest:function(self){var sett=self.options.buttons.pinterest;$(self.element).find('.buttons').append('<div class="button pinterest"><a href="//pinterest.com/pin/create/button/?url='+(sett.url!==''?sett.url:self.options.url)+'&media='+sett.media+'&description='+sett.description+'" class="pin-it-button" count-layout="'+sett.layout+'">Pin It</a></div>');(function(){var li=document.createElement('script');li.type='text/javascript';li.async=true;li.src='//assets.pinterest.com/js/pinit.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li,s);})();}},tracking={googlePlus:function(){},facebook:function(){fb=window.setInterval(function(){if(typeof FB!=='undefined'){FB.Event.subscribe('edge.create',function(targetUrl){_gaq.push(['_trackSocial','facebook','like',targetUrl]);});FB.Event.subscribe('edge.remove',function(targetUrl){_gaq.push(['_trackSocial','facebook','unlike',targetUrl]);});FB.Event.subscribe('message.send',function(targetUrl){_gaq.push(['_trackSocial','facebook','send',targetUrl]);});clearInterval(fb);}},1000);},twitter:function(){tw=window.setInterval(function(){if(typeof twttr!=='undefined'){twttr.events.bind('tweet',function(event){if(event){_gaq.push(['_trackSocial','twitter','tweet']);}});clearInterval(tw);}},1000);},digg:function(){},delicious:function(){},stumbleupon:function(){},linkedin:function(){function LinkedInShare(){_gaq.push(['_trackSocial','linkedin','share']);}},pinterest:function(){}},popup={googlePlus:function(opt){window.open("https://plus.google.com/share?hl="+opt.buttons.googlePlus.lang+"&url="+encodeURIComponent((opt.buttons.googlePlus.url!==''?opt.buttons.googlePlus.url:opt.url)),"","toolbar=0, status=0, width=900, height=500");},facebook:function(opt){window.open("//www.facebook.com/sharer/sharer.php?u="+encodeURIComponent((opt.buttons.facebook.url!==''?opt.buttons.facebook.url:opt.url))+"&t="+opt.text+"","","toolbar=0, status=0, width=900, height=500");},twitter:function(opt){window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(opt.text)+"&url="+encodeURIComponent((opt.buttons.twitter.url!==''?opt.buttons.twitter.url:opt.url))+(opt.buttons.twitter.via!==''?'&via='+opt.buttons.twitter.via:''),"","toolbar=0, status=0, width=650, height=360");},digg:function(opt){window.open("//digg.com/tools/diggthis/submit?url="+encodeURIComponent((opt.buttons.digg.url!==''?opt.buttons.digg.url:opt.url))+"&title="+opt.text+"&related=true&style=true","","toolbar=0, status=0, width=650, height=360");},delicious:function(opt){window.open('//www.delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent((opt.buttons.delicious.url!==''?opt.buttons.delicious.url:opt.url))+'&title='+opt.text,'delicious','toolbar=no,width=550,height=550');},stumbleupon:function(opt){window.open('//www.stumbleupon.com/badge/?url='+encodeURIComponent((opt.buttons.delicious.url!==''?opt.buttons.delicious.url:opt.url)),'stumbleupon','toolbar=no,width=550,height=550');},linkedin:function(opt){window.open('https://www.linkedin.com/cws/share?url='+encodeURIComponent((opt.buttons.delicious.url!==''?opt.buttons.delicious.url:opt.url))+'&token=&isFramed=true','linkedin','toolbar=no,width=550,height=550');},pinterest:function(opt){window.open('//pinterest.com/pin/create/button/?url='+encodeURIComponent((opt.buttons.pinterest.url!==''?opt.buttons.pinterest.url:opt.url))+'&media='+encodeURIComponent(opt.buttons.pinterest.media)+'&description='+opt.buttons.pinterest.description,'pinterest','toolbar=no,width=700,height=300');}};function Plugin(element,options){this.element=element;this.options=$.extend(true,{},defaults,options);this.options.share=options.share;this._defaults=defaults;this._name=pluginName;this.init();};Plugin.prototype.init=function(){var self=this;if(this.options.urlCurl!==''){urlJson.googlePlus=this.options.urlCurl+'?url={url}&type=googlePlus';urlJson.stumbleupon=this.options.urlCurl+'?url={url}&type=stumbleupon';}
11
+ $(this.element).addClass(this.options.className);if(typeof $(this.element).data('title')!=='undefined'){this.options.title=$(this.element).attr('data-title');}
12
+ if(typeof $(this.element).data('url')!=='undefined'){this.options.url=$(this.element).data('url');}
13
+ if(typeof $(this.element).data('urlalt')!=='undefined'){this.options.urlalt=$(this.element).data('urlalt');}
14
+ if(typeof $(this.element).data('text')!=='undefined'){this.options.text=$(this.element).data('text');}
15
+ $.each(this.options.share,function(name,val){if(val===true){self.options.shareTotal++;}});if(self.options.enableCounter===true){$.each(this.options.share,function(name,val){if(val===true){try{self.getSocialJson(name);self.getSocialJson(getSocialAltJson);}catch(e){}}});}
16
+ else if(self.options.template!==''){this.options.render(this,this.options);}
17
+ else{this.loadButtons();}
18
+ $(this.element).hover(function(){if($(this).find('.buttons').length===0&&self.options.enableHover===true){self.loadButtons();}
19
+ self.options.hover(self,self.options);},function(){self.options.hide(self,self.options);});$(this.element).click(function(){self.options.click(self,self.options);return false;});};Plugin.prototype.loadButtons=function(){var self=this;$(this.element).append('<div class="buttons"></div>');$.each(self.options.share,function(name,val){if(val==true){loadButton[name](self);if(self.options.enableTracking===true){tracking[name]();}}});};Plugin.prototype.getSocialJson=function(name){var self=this,count=0,url=urlJson[name].replace('{url}',encodeURIComponent(this.options.url));if('twitter'==name){self.options.hideCount=1;self.renderer();self.options.count[name]=0;self.rendererPerso();}else{self.options.hideCount=0;if(this.options.buttons[name].urlCount===true&&this.options.buttons[name].url!==''){url=urlJson[name].replace('{url}',this.options.buttons[name].url);}
20
+ if(url!=''&&self.options.urlCurl!==''){$.getJSON(url,function(json){if(null!=json){if(typeof json.count!=="undefined"){var temp=json.count+'';temp=temp.replace('\u00c2\u00a0','');count+=parseInt(temp,10);}
21
+ else if(json.data&&json.data.length>0&&typeof json.data[0].total_count!=="undefined"){count+=parseInt(json.data[0].total_count,10);}
22
+ else if(typeof json[0]!=="undefined"){count+=parseInt(json[0].total_posts,10);}
23
+ else if(typeof json[0]!=="undefined"){}
24
+ self.options.count[name]=count;self.options.total+=count;self.renderer();self.rendererPerso();}
25
+ else{self.renderer();self.options.count[name]=0;self.rendererPerso();}}).fail(function(){self.options.hideCount=1;self.renderer();self.options.count[name]=0;self.rendererPerso();});}
26
+ else{self.renderer();self.options.count[name]=0;self.rendererPerso();}}};Plugin.prototype.getSocialAltJson=function(name){var self=this,count=0,url=urlJson[name].replace('{url}',encodeURIComponent(this.options.urlalt));self.options.hideCount=0;if(this.options.buttons[name].urlCount===true&&this.options.buttons[name].url!==''){url=urlJson[name].replace('{url}',this.options.buttons[name].url);}
27
+ if(url!=''&&self.options.urlCurl!==''){$.getJSON(url,function(json){if(null!=json){if(typeof json.count!=="undefined"){var temp=json.count+'';temp=temp.replace('\u00c2\u00a0','');count+=parseInt(temp,10);}
28
+ else if(json.data&&json.data.length>0&&typeof json.data[0].total_count!=="undefined"){count+=parseInt(json.data[0].total_count,10);}
29
+ else if(typeof json[0]!=="undefined"){count+=parseInt(json[0].total_posts,10);}
30
+ else if(typeof json[0]!=="undefined"){}
31
+ self.options.count[name]+=count;self.options.total+=count;self.renderer();self.rendererPerso();}
32
+ else{self.renderer();self.rendererPerso();}}).fail(function(){self.renderer();self.rendererPerso();});}
33
+ else{self.renderer();self.rendererPerso();}};Plugin.prototype.rendererPerso=function(){var shareCount=0;for(e in this.options.count){shareCount++;}
34
+ if(shareCount===this.options.shareTotal){this.options.render(this,this.options);}};Plugin.prototype.renderer=function(){var total=this.options.total,template=this.options.template
35
+ hideCount=this.options.hideCount;if(hideCount){$(this.element).html('<div class="box no-count">'+
36
+ (this.options.title!==''?'<a class="share" href="#">'+this.options.title+'</a>':'')+'</div>');}
37
+ else{if(this.options.shorterTotal===true){total=this.shorterTotal(total);}
38
+ if(template!==''){template=template.replace('{total}',total);$(this.element).html(template);}
39
+ else{$(this.element).html('<div class="box"><a class="count" href="#">'+total+'</a>'+
40
+ (this.options.title!==''?'<a class="share" href="#">'+this.options.title+'</a>':'')+'</div>');}}};Plugin.prototype.shorterTotal=function(num){if(num>=1e6){num=(num/1e6).toFixed(2)+"M"}else if(num>=1e3){num=(num/1e3).toFixed(1)+"k"}
41
+ return num;};Plugin.prototype.openPopup=function(site){popup[site](this.options);if(this.options.enableTracking===true){var tracking={googlePlus:{site:'Google',action:'+1'},facebook:{site:'facebook',action:'like'},twitter:{site:'twitter',action:'tweet'},digg:{site:'digg',action:'add'},delicious:{site:'delicious',action:'add'},stumbleupon:{site:'stumbleupon',action:'add'},linkedin:{site:'linkedin',action:'share'},pinterest:{site:'pinterest',action:'pin'}};_gaq.push(['_trackSocial',tracking[site].site,tracking[site].action]);}};Plugin.prototype.simulateClick=function(){var html=$(this.element).html();$(this.element).html(html.replace(this.options.total,this.options.total+1));};Plugin.prototype.update=function(url,text){if(url!==''){this.options.url=url;}
42
+ if(text!==''){this.options.text=text;}};$.fn[pluginName]=function(options){var args=arguments;if(options===undefined||typeof options==='object'){return this.each(function(){if(!$.data(this,'plugin_'+pluginName)){$.data(this,'plugin_'+pluginName,new Plugin(this,options));}});}else if(typeof options==='string'&&options[0]!=='_'&&options!=='init'){return this.each(function(){var instance=$.data(this,'plugin_'+pluginName);if(instance instanceof Plugin&&typeof instance[options]==='function'){instance[options].apply(instance,Array.prototype.slice.call(args,1));}});}};})(jQuery,window,document);
package.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "genesis-simple-share",
3
+ "description": "Development files for the Genesis Simple Share plugin.",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/copyblogger/genesis-simple-share"
7
+ },
8
+ "dependencies": {},
9
+ "devDependencies": {
10
+ "grunt": "^0.4.5",
11
+ "grunt-autoprefixer": "^0.8.1",
12
+ "grunt-checktextdomain": "^0.1.1",
13
+ "grunt-contrib-cssmin": "^0.10.0",
14
+ "grunt-contrib-imagemin": "^0.7.1",
15
+ "grunt-contrib-jshint": "^0.10.0",
16
+ "grunt-contrib-uglify": "^0.5.0",
17
+ "grunt-contrib-watch": "^0.6.1",
18
+ "grunt-csscomb": "~2.0.1",
19
+ "grunt-jsbeautifier": "^0.2.7",
20
+ "grunt-jsvalidate": "^0.2.2",
21
+ "grunt-phplint": "0.0.5",
22
+ "grunt-styledocco": "^0.1.4",
23
+ "grunt-wp-i18n": "^0.4.5",
24
+ "load-grunt-tasks": "^0.6.0"
25
+ },
26
+ "plugin": {
27
+ "name": "Genesis Simple Share",
28
+ "uri": "https://github.com/copyblogger/genesis-simple-share",
29
+ "description": "A simple sharing plugin using the Share script.",
30
+ "author": "StudioPress",
31
+ "authoruri": "http://www.studiopress.com/",
32
+ "version": "1.0.4",
33
+ "license": "GPL-2.0+",
34
+ "licenseuri": "http://www.gnu.org/licenses/gpl-2.0.html",
35
+ "textdomain": "genesis-simple-share"
36
+ }
37
+ }
plugin.php CHANGED
@@ -1,19 +1,22 @@
1
  <?php
2
  /*
3
- Plugin Name: Genesis Simple Share
4
- Plugin URI:
5
- Description: A simple sharing plugin using the Share script.
6
- Version: 1.0.3
7
- Author: copyblogger
8
- Author URI: http://www.copyblogger.com
9
- Text Domain: genesis-simple-share
10
- Domain Path /languages/
11
 
 
 
 
 
 
 
 
 
 
12
  */
13
 
14
- /* Prevent direct access to the plugin */
15
- if ( !defined( 'ABSPATH' ) ) {
16
- die( "Sorry, you are not allowed to access this page directly." );
17
  }
18
 
19
  define( 'GENESIS_SIMPLE_SHARE_LIB', dirname( __FILE__ ) . '/lib/' );
@@ -29,10 +32,10 @@ add_action( 'genesis_init', 'genesis_simple_share_init', 99 );
29
  */
30
  function genesis_simple_share_init() {
31
 
32
- /** Load textdomain for translation */
33
  load_plugin_textdomain( 'genesis-simple-share', false, basename( dirname( __FILE__ ) ) . '/languages/' );
34
 
35
- if( is_admin() && class_exists( 'Genesis_Admin_Boxes' ) ) {
36
  require_once( GENESIS_SIMPLE_SHARE_LIB . 'admin.php' );
37
  require_once( GENESIS_SIMPLE_SHARE_LIB . 'post-meta.php' );
38
  }
1
  <?php
2
  /*
3
+ Plugin Name: Genesis Simple Share
4
+ Plugin URI:
 
 
 
 
 
 
5
 
6
+ Description: A simple sharing plugin using the Share script.
7
+
8
+ Version: 1.0.4
9
+
10
+ Author: copyblogger
11
+ Author URI: http://www.copyblogger.com
12
+
13
+ Text Domain: genesis-simple-share
14
+ Domain Path /languages/
15
  */
16
 
17
+ //* Prevent direct access to the plugin
18
+ if ( ! defined( 'ABSPATH' ) ) {
19
+ die( __( 'Sorry, you are not allowed to access this page directly.', 'genesis-simple-share' ) );
20
  }
21
 
22
  define( 'GENESIS_SIMPLE_SHARE_LIB', dirname( __FILE__ ) . '/lib/' );
32
  */
33
  function genesis_simple_share_init() {
34
 
35
+ //* Load textdomain for translation
36
  load_plugin_textdomain( 'genesis-simple-share', false, basename( dirname( __FILE__ ) ) . '/languages/' );
37
 
38
+ if ( is_admin() && class_exists( 'Genesis_Admin_Boxes' ) ) {
39
  require_once( GENESIS_SIMPLE_SHARE_LIB . 'admin.php' );
40
  require_once( GENESIS_SIMPLE_SHARE_LIB . 'post-meta.php' );
41
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: nathanrice, studiopress, wpmuguru, nick_thegeek, bgardner
3
  Tags: genesis, share, share buttons, facebook, twitter, pinterest, stumbleupon, linkedin, social
4
  Requires at least: 3.7
5
- Tested up to: 4.1
6
- Stable tag: 1.0.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -31,6 +31,9 @@ https://github.com/copyblogger/genesis-simple-share/wiki/Usage-Tips
31
 
32
  == Changelog ==
33
 
 
 
 
34
  = 1.0.3 =
35
  * Fix error resulting in double icon output
36
 
@@ -49,4 +52,4 @@ https://github.com/copyblogger/genesis-simple-share/wiki/Usage-Tips
49
  * Fixes potential error where only first post in archive will show share buttons
50
 
51
  = 1.0 =
52
- Plugin was added to the WordPress.org repo. Users should update to ensure they have the latest code.
2
  Contributors: nathanrice, studiopress, wpmuguru, nick_thegeek, bgardner
3
  Tags: genesis, share, share buttons, facebook, twitter, pinterest, stumbleupon, linkedin, social
4
  Requires at least: 3.7
5
+ Tested up to: 4.3.1
6
+ Stable tag: 1.0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
31
 
32
  == Changelog ==
33
 
34
+ = 1.0.4 =
35
+ * Disabled Twitter counter for now because twitter is removing the ability to get the counts after 10-2015.
36
+
37
  = 1.0.3 =
38
  * Fix error resulting in double icon output
39
 
52
  * Fixes potential error where only first post in archive will show share buttons
53
 
54
  = 1.0 =
55
+ Plugin was added to the WordPress.org repo. Users should update to ensure they have the latest code.