Changeset 828490
- Timestamp:
- 12/26/2013 12:42:55 AM (12 years ago)
- Location:
- crafty-social-buttons
- Files:
-
- 24 edited
-
assets/banner-772x250.jpg (modified) (previous)
-
trunk/README.txt (modified) (4 diffs)
-
trunk/class-SH-Crafty-Social-Buttons-Admin.php (modified) (8 diffs)
-
trunk/class-SH-Crafty-Social-Buttons-Plugin.php (modified) (1 diff)
-
trunk/class-SH-Crafty-Social-Buttons-Shortcode.php (modified) (1 diff)
-
trunk/class-SH-Crafty-Social-Buttons-Widget.php (modified) (1 diff)
-
trunk/crafty-social-buttons.php (modified) (1 diff)
-
trunk/css/admin.min.css (modified) (1 diff)
-
trunk/css/public.min.css (modified) (1 diff)
-
trunk/js/admin.min.js (modified) (1 diff)
-
trunk/services/class-SH_Craftsy.php (modified) (2 diffs)
-
trunk/services/class-SH_Digg.php (modified) (1 diff)
-
trunk/services/class-SH_Email.php (modified) (1 diff)
-
trunk/services/class-SH_Etsy.php (modified) (1 diff)
-
trunk/services/class-SH_Facebook.php (modified) (1 diff)
-
trunk/services/class-SH_Google.php (modified) (1 diff)
-
trunk/services/class-SH_LinkedIn.php (modified) (1 diff)
-
trunk/services/class-SH_Pinterest.php (modified) (1 diff)
-
trunk/services/class-SH_Ravelry.php (modified) (1 diff)
-
trunk/services/class-SH_Reddit.php (modified) (1 diff)
-
trunk/services/class-SH_Social_Service.php (modified) (1 diff)
-
trunk/services/class-SH_StumbleUpon.php (modified) (1 diff)
-
trunk/services/class-SH_Tumblr.php (modified) (1 diff)
-
trunk/services/class-SH_Twitter.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
crafty-social-buttons/trunk/README.txt
r819149 r828490 30 30 * Etsy (link only) 31 31 * Facebook 32 * Flickr (link only) 32 33 * Google+ 34 * Instagram (link only) 33 35 * LinkedIn 34 36 * Pinterest … … 90 92 91 93 = 1.0.4 = 94 * Added Instagram and Flickr link buttons 95 96 = 1.0.4 = 92 97 * Added more link options for Craftsy - link to individual user profile, pattern store, or instructor page 93 98 … … 109 114 == Upgrade Notice == 110 115 116 = 1.0.5 = 117 * Instagram and Flickr added 118 111 119 = 1.0.4 = 112 120 * More link options for Craftsy … … 125 133 These are the things currently in the pipeline: 126 134 135 * Add support for YouTube (for crafters who post video tutorials) 136 * Adding an option to choose image sizes for the icons 127 137 * Changing the post count feature to request data only after the page is loaded so it doesn't slow things down so much. 128 * Adding an option to choose image sizes for the icons129 * Add support for YouTube (for crafters who post video tutorials)130 * Add support for Flickr (for crafters who like to show off their creations)131 138 * Option to diplays in archives and category listings (?) 132 139 * (Anything else? You tell me!) -
crafty-social-buttons/trunk/class-SH-Crafty-Social-Buttons-Admin.php
r819149 r828490 13 13 * Plugin version, used for cache-busting of style and script file references. 14 14 */ 15 protected $version = '1.0. 2';15 protected $version = '1.0.5'; 16 16 17 17 /** … … 82 82 function load_all_services() { 83 83 84 include_once('services/class-SH_Social_Service.php'); 84 85 $this->all_services = array(); 85 86 … … 93 94 if (preg_match("/^class-SH_(.+)\.php$/", $file, $matches)) { 94 95 $this->all_services[] = $matches[1]; 96 include_once('services/' . $file); 95 97 } 96 98 } … … 211 213 // we want to add a custom description for some of the fields 212 214 $caption = $service; 213 switch ($service) { 214 case "Craftsy": $description = 'Hint: www.craftsy.com/user/<strong>user-id</strong>/ (numbers). For more options see Help > Link Buttons (link top right of screen)'; break; 215 case "Digg": $description = "Hint: www.digg.com/<strong>user-id</strong>"; break; 216 case "Email": $description = "Hint: Your email address"; break; 217 case "Etsy": $description = 'Hint: www.etsy.com/shop/<strong>user-id</strong>/'; break; 218 case "Facebook": $description = 'Hint: www.facebook.com/<strong>user-id</strong>/'; break; 219 case "Google": 220 $description = "Hint: plus.google.com/u/0/<strong>user-id</strong> (it's a long number)"; 221 $caption = "Google Plus"; 222 break; 223 case "LinkedIn": $description = "Hint: www.linkedin.com/in/<strong>user-id</strong> or www.linkedin.com/<strong>company/company-id</strong>"; break; 224 case "Pinterest": $description = "Hint: www.pinterest.com/<strong>user-id</strong>"; break; 225 case "Ravelry": $description = "Hint: www.ravelry.com/people/<strong>user-id</strong>"; break; 226 case "Reddit": $description = "Hint: www.reddit.com/user/<strong>user-id</strong>"; break; 227 case "StumbleUpon": $description = "Hint: www.stumbleupon/stumbler/<strong>user-id</strong>"; break; 228 case "Tumblr": $description = "Hint: http://<strong>user-id</strong>.tumblr.com"; break; 229 case "Twitter": $description = "Hint: @<strong>user-id</strong>"; break; 230 default: $description = ""; 231 } 215 $description = ""; 216 $description = $this->call_service_method($service, 'description'); 217 232 218 add_settings_field( 233 219 $service, … … 396 382 $settings = $this->getSettings(); 397 383 $image_set = ($id == 'link_services') ? $settings['link_image_set'] : $settings['share_image_set']; 384 $shareOrLink = ($id == 'link_services') ? 'Link' : 'Share'; 398 385 $value = $settings[$id]; 399 386 ?> … … 412 399 <div><span class="include-heading">Available</span> (these will <strong>not</strong> be displayed)</div> 413 400 <ul id="csbsort1" class="connectedSortable"> 414 <?php echo $this->get_available_services_html($value, $image_set ); ?>401 <?php echo $this->get_available_services_html($value, $image_set, $shareOrLink); ?> 415 402 </ul> 416 403 </center> … … 509 496 * Get list item HTML for all services EXCEPT those already selected 510 497 */ 511 function get_available_services_html($selectedServicesString, $image_set ) {498 function get_available_services_html($selectedServicesString, $image_set, $shareOrLink = 'Share') { 512 499 513 500 $htmlListItems = ''; … … 518 505 519 506 foreach ($this->all_services as $service) { 520 if (!in_array($service, $selectedServices)) { 521 $url = plugin_dir_url(__FILE__) . "buttons/" . $image_set . "/" . $service . ".png"; 522 $htmlListItems .= $this->get_service_icon_html($url, $service, $image_set); 523 } 507 if (!$this->call_service_method($service, 'can'.$shareOrLink)) continue; 508 if (in_array($service, $selectedServices)) continue; 509 510 $url = plugin_dir_url(__FILE__) . "buttons/" . $image_set . "/" . $service . ".png"; 511 $htmlListItems .= $this->get_service_icon_html($url, $service, $image_set); 512 524 513 } 525 514 526 515 return $htmlListItems; 516 } 517 518 /** 519 * Calls a static method on the given service and returns the result 520 */ 521 function call_service_method($service, $method) { 522 return call_user_func(array('SH_' . $service, $method)); 527 523 } 528 524 -
crafty-social-buttons/trunk/class-SH-Crafty-Social-Buttons-Plugin.php
r804385 r828490 13 13 * Plugin version, used for cache-busting of style and script file references. 14 14 */ 15 protected $version = '1.0. 2';15 protected $version = '1.0.5'; 16 16 17 17 /** -
crafty-social-buttons/trunk/class-SH-Crafty-Social-Buttons-Shortcode.php
r804385 r828490 13 13 * Plugin version, used for cache-busting of style and script file references. 14 14 */ 15 protected $version = '1.0. 2';15 protected $version = '1.0.5'; 16 16 17 17 /** -
crafty-social-buttons/trunk/class-SH-Crafty-Social-Buttons-Widget.php
r804385 r828490 14 14 * Plugin version, used for cache-busting of style and script file references. 15 15 */ 16 protected $version = '1.0. 2';16 protected $version = '1.0.5'; 17 17 18 18 /** -
crafty-social-buttons/trunk/crafty-social-buttons.php
r819149 r828490 16 16 * Plugin URI: http://github.com/sarahhenderson/crafty-social-buttons 17 17 * Description: Adds social sharing buttons and links to your site, including Ravelry, Etsy, Craftsy and Pinterest 18 * Version: 1.0. 418 * Version: 1.0.5 19 19 * Author: Sarah Henderson 20 20 * Author URI: http://sarahhenderson.info -
crafty-social-buttons/trunk/css/admin.min.css
r819149 r828490 1 1 /*! crafty-social-buttons (c) Sarah Henderson 2013 2 * Version 1.0. 4 (12-12-2013) */2 * Version 1.0.5 (26-12-2013) */ 3 3 4 4 .crafty-social-buttons .csb-include-list{border:1px solid #ddd;background:#f1f1f1;margin-right:.5em;vertical-align:top;padding:.4em}.crafty-social-buttons .include-heading{text-align:left;font-weight:700}.crafty-social-buttons .csb-include-list ul{border:1px solid #ddd;background:#fff;padding:.5em;margin:0;min-height:60px}.crafty-social-buttons .csb-include-list ul li{display:inline-block;padding:0;margin:.3em;text-align:center;font-size:1.2em;cursor:move}.crafty-social-buttons .csb-image-preview{margin-top:.5em}.crafty-social-buttons select{width:200px}.crafty-social-buttons input[type=text]{width:350px}.crafty-social-buttons span.description{font-style:normal}.crafty-social-buttons span.description strong{font-style:italic} -
crafty-social-buttons/trunk/css/public.min.css
r819149 r828490 1 1 /*! crafty-social-buttons (c) Sarah Henderson 2013 2 * Version 1.0. 4 (12-12-2013) */2 * Version 1.0.5 (26-12-2013) */ 3 3 4 4 .crafty-social-buttons{margin:.3em 0}.crafty-social-buttons .crafty-social-caption{display:inline-block;padding-right:1em;vertical-align:top;font-size:1.2em}.crafty-social-buttons .size48 img,.crafty-social-buttons img{max-width:48px;max-height:48px}.crafty-social-buttons .size16 img{max-width:16px;max-height:16px}.crafty-social-buttons .size32 img{max-width:32px;max-height:32px}.crafty-social-buttons .size64 img{max-width:64px;max-height:64px}.crafty-social-buttons ul{display:inline-block;list-style-type:none;margin:0;padding:0}.crafty-social-buttons ul li{display:inline-block;margin:0 .2em;padding:0}.crafty-social-buttons .crafty-social-share-count:after,.crafty-social-buttons .crafty-social-share-count:before{right:100%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.crafty-social-buttons .crafty-social-share-count:after{border-color:rgba(224,221,221,0);border-right-color:#f5f5f5;border-width:5px;top:50%;margin-top:-5px}.crafty-social-buttons .crafty-social-share-count:before{border-color:rgba(85,94,88,0);border-right-color:#e0dddd;border-width:6px;top:50%;margin-top:-6px}.crafty-social-buttons .crafty-social-share-count{font:11px Arial,Helvetica,sans-serif;color:#555e58;padding:5px;-khtml-border-radius:6px;-o-border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;position:relative;background:#f5f5f5;border:1px solid #e0dddd} -
crafty-social-buttons/trunk/js/admin.min.js
r819149 r828490 1 1 /*! crafty-social-buttons (c) Sarah Henderson 2013 2 * Version 1.0. 4 (12-12-2013) */2 * Version 1.0.5 (26-12-2013) */ 3 3 jQuery(document).ready(function(a){a("#csbsort1, #csbsort2").sortable({connectWith:".connectedSortable",update:function(){var b=a("#csbsort2 li").map(function(){return a(this).attr("id")}).get();a(".csb-services").val(b)}}).disableSelection(),a(".csb-services").val(a("#csbsort2 li").map(function(){return a(this).attr("id")}).get()),a(".csb-image-set").change(function(){var b=a(this).val();a(".csb-image-preview").attr("data-base"),a.each(a(".csb-services img"),function(c,d){var e=a(d).attr("src"),f=a(d).attr("data-image-set"),g=e.replace(f,b);0,a(d).attr("src",g),a(d).attr("data-image-set",b)})})}); -
crafty-social-buttons/trunk/services/class-SH_Craftsy.php
r819149 r828490 16 16 } 17 17 18 public function shareButton($url, $title = '', $showCount = false) { 19 18 public function shareButton($url, $title = '', $showCount = false) { 20 19 return ''; 21 20 } … … 43 42 } 44 43 45 public function shareCount($url) { 46 return '0'; // Craftsy has no share count feature 44 public static function canShare() { 45 return false; 46 } 47 48 public static function description() { 49 return "Hint: www.craftsy.com/user/<strong>user-id</strong>/ (numbers). For more options see Help > Link Buttons (link top right of screen)"; 47 50 } 48 51 } -
crafty-social-buttons/trunk/services/class-SH_Digg.php
r801913 r828490 44 44 } 45 45 46 public function shareCount($url) {47 return '0'; // Digg has no share count feature46 public static function description() { 47 return "Hint: www.digg.com/<strong>user-id</strong>"; 48 48 } 49 49 } -
crafty-social-buttons/trunk/services/class-SH_Email.php
r801913 r828490 45 45 } 46 46 47 public function shareCount($url) {48 return '0'; // Email has no share count feature47 public static function description() { 48 return "Hint: Your email address"; 49 49 } 50 50 } -
crafty-social-buttons/trunk/services/class-SH_Etsy.php
r801913 r828490 36 36 } 37 37 38 public function shareCount($url) { 39 return '0'; 38 public static function canShare() { 39 return false; 40 } 41 42 public static function description() { 43 return "Hint: www.etsy.com/shop/<strong>user-id</strong>/"; 40 44 } 41 45 } -
crafty-social-buttons/trunk/services/class-SH_Facebook.php
r801913 r828490 63 63 } 64 64 } 65 66 public static function description() { 67 return "Hint: www.facebook.com/<strong>user-id</strong>/"; 68 } 65 69 } 66 70 ?> -
crafty-social-buttons/trunk/services/class-SH_Google.php
r801913 r828490 90 90 } 91 91 } 92 93 public static function description() { 94 return "Hint: plus.google.com/u/0/<strong>user-id</strong> (it's a long number)"; 95 } 92 96 } 93 97 ?> -
crafty-social-buttons/trunk/services/class-SH_LinkedIn.php
r805665 r828490 74 74 } 75 75 } 76 77 public static function description() { 78 return "Hint: www.linkedin.com/in/<strong>user-id</strong> or www.linkedin.com/<strong>company/company-id</strong>"; 79 } 76 80 } 77 81 -
crafty-social-buttons/trunk/services/class-SH_Pinterest.php
r801913 r828490 63 63 } 64 64 } 65 public static function description() { 66 return "Hint: www.pinterest.com/<strong>user-id</strong>"; 67 } 65 68 } 66 69 -
crafty-social-buttons/trunk/services/class-SH_Ravelry.php
r801913 r828490 47 47 } 48 48 49 public function shareCount($url) { 50 return '0'; 49 50 public static function description() { 51 return "Hint: www.ravelry.com/people/<strong>user-id</strong>"; 51 52 } 52 53 } -
crafty-social-buttons/trunk/services/class-SH_Reddit.php
r801913 r828490 64 64 } 65 65 } 66 public static function description() { 67 return "Hint: www.reddit.com/user/<strong>user-id</strong>"; 68 } 66 69 } 67 70 -
crafty-social-buttons/trunk/services/class-SH_Social_Service.php
r801913 r828490 37 37 } 38 38 39 public static function canShare() { 40 return true; 41 } 42 43 public static function canLink() { 44 return true; 45 } 46 47 public static function description() { 48 return ""; 49 } 50 39 51 protected function buttonImage() { 40 52 $imageUrl = $this->imagePath . trim(strtolower($this->service)) . $this->imageExtension; -
crafty-social-buttons/trunk/services/class-SH_StumbleUpon.php
r801913 r828490 64 64 } 65 65 } 66 public static function description() { 67 return "Hint: www.stumbleupon/stumbler/<strong>user-id</strong>"; 68 } 66 69 } 67 70 ?> -
crafty-social-buttons/trunk/services/class-SH_Tumblr.php
r801913 r828490 53 53 } 54 54 55 public function shareCount($url) {56 return '0'; // Tumblr has no share count function55 public static function description() { 56 return "Hint: http://<strong>user-id</strong>.tumblr.com"; 57 57 } 58 58 } -
crafty-social-buttons/trunk/services/class-SH_Twitter.php
r801913 r828490 66 66 } 67 67 } 68 69 public static function description() { 70 return "Hint: @<strong>user-id</strong>"; 71 } 68 72 } 69 73
Note: See TracChangeset
for help on using the changeset viewer.