Changeset 612276
- Timestamp:
- 10/14/2012 02:08:06 PM (13 years ago)
- Location:
- wpsocialite/trunk
- Files:
-
- 1 added
- 3 deleted
- 4 edited
-
. (modified) (1 prop)
-
.gitmodules (deleted)
-
README.md (deleted)
-
images (deleted)
-
lib/wpsocialite.css (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
-
wpsocialite.js (added)
-
wpsocialite.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpsocialite/trunk
-
Property
svn:ignore
set to
.svnignore
.git
.gitignore
.gitmodules
.DS_Store
README.md
-
Property
svn:ignore
set to
-
wpsocialite/trunk/lib/wpsocialite.css
r600605 r612276 1 .cf:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } 2 * html .cf { zoom: 1; } 3 *:first-child+html .cf { zoom: 1; } 1 .wpsocialite:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } 4 2 5 3 /* visually hidden from HTML5 Boilerplate */ 6 .vhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } 4 .wpsocialite .vhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } 5 7 6 8 7 /* … … 20 19 */ 21 20 22 .large { display: block; list-style: none; padding: 0; margin: 20px; } 23 .large > li { display: block; margin: 0; padding: 10px; float: left; } 24 .large .socialite { display: block; position: relative; background: url('social-sprite.png') 0 0 no-repeat; } 25 .large .socialite-loaded { background: none !important; } 26 .large .twitter-share { width: 55px; height: 65px; background-position: 0 0; } 27 .large .googleplus-one { width: 50px; height: 65px; background-position: -75px 0; } 28 .large .facebook-like { width: 50px; height: 65px; background-position: -145px 0; } 29 .large .linkedin-share { width: 60px; height: 65px; background-position: -215px 0; } 30 .large .pinterest-pinit { width: 50px; height: 65px; background-position: -367px 0; } 21 22 .wpsocialite.large { display: block; list-style: none; padding: 0; margin: 20px; } 23 .wpsocialite.large > li { display: block; margin: 0; padding: 10px; float: left; } 24 .wpsocialite.large .socialite { display: block; position: relative; background: url('social-sprite.png') 0 0 no-repeat; } 25 .wpsocialite.large .socialite-loaded { background: none !important; } 26 .wpsocialite.large .twitter-share { width: 55px; height: 65px; background-position: 0 0; } 27 .wpsocialite.large .googleplus-one { width: 50px; height: 65px; background-position: -75px 0; } 28 .wpsocialite.large .facebook-like { width: 50px; height: 65px; background-position: -145px 0; } 29 .wpsocialite.large .linkedin-share { width: 60px; height: 65px; background-position: -215px 0; } 30 .wpsocialite.large .pinterest-pinit { width: 50px; height: 65px; background-position: -367px 0; } 31 31 32 32 /* … … 34 34 */ 35 35 36 .small-load { margin: 0 0 0.625em 0; font-weight: bold; padding: 5px; }37 36 38 .small { display: block; list-style: none; padding: 10px; margin: 10px; } 39 .small > li { margin: 0; display:inline; float:left; width:20%; } 40 .small .socialite { display: block; position: relative; width: 150px; height: 30px; background: url('custom-default.png') 0 0 no-repeat; } 41 .small .socialite-loaded { background: none; } 37 /* .small-load { margin: 0 0 0.625em 0; font-weight: bold; padding: 5px; } */ 42 38 43 .small .twitter-share { background-position: 0 0; } 44 .small .googleplus-one { background-position: 0 -45px; } 45 .small .facebook-like { background-position: 0 -90px; } 46 .small .linkedin-share { background-position: 0 -135px; } 47 .small .pinterest-pinit { background-position: 0 -175px; } 39 .wpsocialite.small { display: block; list-style: none; padding: 10px; margin: 10px; } 40 .wpsocialite.small > li { margin: 0; display:inline; float:left; width:20%; } 41 .wpsocialite.small .socialite { display: block; position: relative; width: 150px; height: 30px; background: url('custom-default.png') 0 0 no-repeat; } 42 .wpsocialite.small .socialite-loaded { background: none; } 43 44 .wpsocialite.small .twitter-share { background-position: 0 0; } 45 .wpsocialite.small .googleplus-one { background-position: 0 -45px; } 46 .wpsocialite.small .facebook-like { background-position: 0 -90px; } 47 .wpsocialite.small .linkedin-share { background-position: 0 -135px; } 48 .wpsocialite.small .pinterest-pinit { background-position: 0 -175px; } -
wpsocialite/trunk/readme.txt
r611956 r612276 5 5 Requires at least: 3.0 6 6 Tested up to: 3.4.2 7 Stable tag: 1. 47 Stable tag: 1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 50 50 == Changelog == 51 51 52 = 1.4 =53 * Changed how external scripts are loading, consolidated js files, added pinterest image support.54 55 52 = 1.3 = 56 53 * Major Bugfix, CSS ID calls causing feed issues. Changed to classes. 54 57 55 58 56 = 1.2 = … … 69 67 == Upgrade Notice == 70 68 71 = 1.4 =72 Made JS Files more efficient, changed CSS to reduce conflicts and added Pinterest image support.73 74 69 = 1.0 = 75 70 None as of yet. 71 72 -
wpsocialite/trunk/wpsocialite.php
r611956 r612276 2 2 /* 3 3 Plugin Name: WPSocialite 4 Plugin URI: http://wordpress.org/extend/plugins/wpsocial te/4 Plugin URI: http://wordpress.org/extend/plugins/wpsocialite/ 5 5 Description: No one likes long load times! Yet we all want to be able to share our content via Facebook, Twitter, and all other social networks. These take a long time to load. Paradox? Not anymore! With WPSocialite (utilizing David Bushnell's amazing SocialiteJS plugin [http://www.socialitejs.com/]) we can manage the loading process of our social sharing links. Load them on hover, on page scroll, and more! 6 6 Author: Tom Morton 7 Version: 1. 47 Version: 1.3 8 8 Author URI: http://twmorton.com/ 9 9 … … 50 50 add_action( 'wp_head', array( &$this, 'wpsocialite_vardefine_head' ) ); 51 51 52 add_filter( 'body_class', array( &$this, 'wpsocialite_body_class' ) ); 53 52 54 add_filter( 'the_content', array( &$this, 'wpsocialite_add_to_content' ) ); 55 56 if( get_option('wpsocialite_excerpt') == 1 ){ 57 add_filter( 'the_excerpt', array( &$this, 'wpsocialite_add_to_content' ) ); 58 } 53 59 54 60 } // __construct … … 78 84 echo $script; 79 85 } 86 function wpsocialite_body_class($classes) 87 { 88 $value = get_option('wpsocialite_mode'); 89 90 if(!is_admin() && $value == 'scroll' ){ 91 92 $classes[] = 'wpsocialite-scroll'; 93 94 } 95 96 return $classes; 97 98 } 80 99 function wpsocialite_enqueue_scripts() 81 100 { … … 83 102 84 103 wp_enqueue_script('socialite-lib', WPSOCIALITE_URL_SOCIALITE.'/socialite.min.js', array('jquery'), '1.0', true); 85 wp_enqueue_script('socialite-pinterest', WPSOCIALITE_URL_SOCIALITE.'/extensions/socialite.pinterest.js', array('jquery'), '1.0', true); 86 87 $value = get_option('wpsocialite_mode'); 88 if($value == 'scroll'){ 89 wp_enqueue_script('wpsocialite-scroll', WPSOCIALITE_URL.'/wpsocialite-scroll.js', array('jquery'), '1.0', true); 90 }else{ 91 wp_enqueue_script('wpsocialite-scroll', WPSOCIALITE_URL.'/wpsocialite-hover.js', array('jquery'), '1.0', true); 104 105 wp_enqueue_script('wpsocialite', WPSOCIALITE_URL.'wpsocialite.js', array('jquery'), '1.0', true); 106 107 $scripts = WPSocialite_Options::wpsocialite_list_network_options(null, null, null, null); 108 109 $value = get_option('wpsocialite_networkoptions'); 110 111 foreach ($scripts as $script){ 112 if( isset($value[$script['slug']]) && $script['external_file'] !== false ) 113 wp_enqueue_script('socialite-'.$script['slug'].'', WPSOCIALITE_URL_SOCIALITE.'/extensions/'.$script['external_file'].'', array('jquery'), '1.0', true); 92 114 } 93 115 94 116 }// if is admin 95 117 96 } // wpsocialite_enqueue_scripts 118 } // wpsocialite_enqueue_scripts() 97 119 98 120 function wpsocialite_enqueue_styles() … … 115 137 $id = $post->ID; //get post id 116 138 $postlink = get_permalink($id); //get post link 139 $imagelink = wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'full' ); //get the featured image url 117 140 $title = trim($post->post_title); // get post title 118 141 119 142 $value = get_option('wpsocialite_networkoptions'); 120 $buttons = WPSocialite_Options::wpsocialite_list_network_options($postlink, $title, $size );143 $buttons = WPSocialite_Options::wpsocialite_list_network_options($postlink, $title, $size, $imagelink[0]); 121 144 122 145 $return = ''; 123 124 $return .= '<ul class="'.$size.'" class="social-buttons cf">'; 146 $return .= '<ul class="wpsocialite social-buttons '.$size.'">'; 125 147 126 148 foreach ($buttons as $button){ … … 201 223 202 224 add_settings_field( 225 $id = 'wpsocialite_excerpt', 226 $title = "WPSocialite Excerpt", 227 $callback = array( &$this, 'wpsocialite_excerpt' ), 228 $page = 'discussion' 229 ); 230 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_excerpt' ); 231 232 add_settings_field( 203 233 $id = 'wpsocialite_classes', 204 234 $title = "WPSocialite Classes", … … 267 297 </label>'; 268 298 269 299 } // function 300 301 function wpsocialite_excerpt() 302 { 303 $value = get_option('wpsocialite_excerpt'); 304 # echo your form fields here containing the value received from get_option 305 if($value == 1) : 306 $checked = 'checked'; 307 else : 308 $checked = ''; 309 endif; 310 311 echo '<label for="wpsocialite_excerpt"> 312 <input name="wpsocialite_excerpt" type="checkbox" id="wpsocialite_excerpt" value="1" '.$checked.'> 313 Display WPSocialite sharing options in the excerpt of your posts. 314 </label>'; 270 315 271 316 } // function … … 375 420 } 376 421 377 function wpsocialite_list_network_options($link = null, $title = null, $size = null) { 378 $buttons = array( 379 'facebook' => array( 380 'name' => 'Facebook', 381 'slug' => 'facebook', 382 'markup_large' => '<a href="http://www.facebook.com/sharer.php?u='.$link.'&t='.$title.'" class="socialite facebook-like" data-href="'.$link.'" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a>', 383 'markup_small' => '<a href="http://www.facebook.com/sharer.php?u='.$link.'&t='.$title.'" class="socialite facebook-like" data-href="'.$link.'" data-send="false" data-layout="button_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a>' 384 ), 385 'twitter' => array( 386 'name' => 'Twitter', 387 'slug' => 'twitter', 388 'markup_large' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$title.'" data-url="'.$link.'" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a>', 389 'markup_small' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$title.'" data-url="'.$link.'" data-count="horizontal" data-via="dbushell" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a>' 390 ), 391 'gplus' => array( 392 'name' => 'Google Plus', 393 'slug' => 'gplus', 394 'markup_large' => '<a href="https://plus.google.com/share?url='.$link.'" class="socialite googleplus-one" data-size="tall" data-href="'.$link.'" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a>', 395 'markup_small' => '<a href="https://plus.google.com/share?url='.$link.'" class="socialite googleplus-one" data-size="medium" data-href="'.$link.'" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a>' 396 ), 397 'linkedin' => array( 398 'name' => 'Linkedin', 399 'slug' => 'linkedin', 400 'markup_large' => '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$link.'&title='.$title.'" class="socialite linkedin-share" data-url="'.$link.'" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a>', 401 'markup_small' => '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$link.'&title=Socialite.js" class="socialite linkedin-share" data-url="'.$link.'" data-counter="right" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a>' 402 ), 403 'pintrest' => array( 404 'name' => 'Pintrest', 405 'slug' => 'pintrest', 406 'markup_large' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&media=&description='.$title.'" class="socialite pinterest-pinit" data-count-layout="vertical"><span class="vhidden">Pin It!</span></a>', 407 'markup_small' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&description='.$title.'" class="socialite pinterest-pinit" data-count-layout="horizontal"><span class="vhidden">Pin It!</span></a>' 408 ), 409 ); 422 function wpsocialite_list_network_options($link = null, $title = null, $size = null, $image = null) { 423 if( $image == '') { $image = null; } //link post featured image with Pinterest, if available 424 425 $buttons = array( 426 'facebook' => array( 427 'name' => 'Facebook', 428 'slug' => 'facebook', 429 'markup_large' => '<a href="http://www.facebook.com/sharer.php?u='.$link.'&t='.$title.'" class="socialite facebook-like" data-href="'.$link.'" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a>', 430 'markup_small' => '<a href="http://www.facebook.com/sharer.php?u='.$link.'&t='.$title.'" class="socialite facebook-like" data-href="'.$link.'" data-send="false" data-layout="button_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a>', 431 'external_file' => false 432 ), 433 'twitter' => array( 434 'name' => 'Twitter', 435 'slug' => 'twitter', 436 'markup_large' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$title.'" data-url="'.$link.'" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a>', 437 'markup_small' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$title.'" data-url="'.$link.'" data-count="horizontal" data-via="" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a>', 438 'external_file' => false 439 ), 440 'gplus' => array( 441 'name' => 'Google Plus', 442 'slug' => 'gplus', 443 'markup_large' => '<a href="https://plus.google.com/share?url='.$link.'" class="socialite googleplus-one" data-size="tall" data-href="'.$link.'" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a>', 444 'markup_small' => '<a href="https://plus.google.com/share?url='.$link.'" class="socialite googleplus-one" data-size="medium" data-href="'.$link.'" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a>', 445 'external_file' => false 446 ), 447 'linkedin' => array( 448 'name' => 'Linkedin', 449 'slug' => 'linkedin', 450 'markup_large' => '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$link.'&title='.$title.'" class="socialite linkedin-share" data-url="'.$link.'" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a>', 451 'markup_small' => '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$link.'&title=Socialite.js" class="socialite linkedin-share" data-url="'.$link.'" data-counter="right" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a>', 452 'external_file' => false 453 ), 454 'pintrest' => array( 455 'name' => 'Pintrest', 456 'slug' => 'pintrest', 457 'markup_large' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&media=' . $image . '&description='.$title.'" class="socialite pinterest-pinit" data-count-layout="vertical"><span class="vhidden">Pin It!</span></a>', 458 'markup_small' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&media=' . $image . '&description='.$title.'" class="socialite pinterest-pinit" data-count-layout="horizontal"><span class="vhidden">Pin It!</span></a>', 459 'external_file' => 'socialite.pinterest.js' 460 ), 461 ); 410 462 411 463 return $buttons;
Note: See TracChangeset
for help on using the changeset viewer.