jQuery Pin It Button for Images - Version 0.9.2

Version Description

  • Released 2013-02-12
  • It now works with jQuery versions older than 1.7
Download this release

Release Info

Developer mrsztuczkens
Plugin Icon wp plugin jQuery Pin It Button for Images
Version 0.9.2
Comparing to
See all releases

Code changes from version 0.9.1 to 0.9.2

jquery-pin-it-button-for-images.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: jQuery Pin It Button For Images
4
Plugin URI: http://wordpress.org/extend/plugins/jquery-pin-it-button-for-images/
5
Description: Highlights images on hover and adds a "Pin It" button over them for easy pinning.
6
Author: Marcin Skrzypiec
7
- Version: 0.9.1
8
Author URI: http://profiles.wordpress.org/mrsztuczkens
9
*/
10
@@ -13,7 +13,7 @@ if ( ! function_exists( 'add_action' ) ) {
13
exit;
14
}
15
16
- define( "JPIBFI_VERSION", "0.9.1" );
17
18
require_once( "jpibfi-validation.php" );
19
require_once( "jpibfi-admin.php" );
4
Plugin URI: http://wordpress.org/extend/plugins/jquery-pin-it-button-for-images/
5
Description: Highlights images on hover and adds a "Pin It" button over them for easy pinning.
6
Author: Marcin Skrzypiec
7
+ Version: 0.9.2
8
Author URI: http://profiles.wordpress.org/mrsztuczkens
9
*/
10
13
exit;
14
}
15
16
+ define( "JPIBFI_VERSION", "0.9.2" );
17
18
require_once( "jpibfi-validation.php" );
19
require_once( "jpibfi-admin.php" );
js/script.js CHANGED
@@ -88,7 +88,7 @@ function jpibfi_pinit(options) {
88
})
89
}
90
91
- $('.pinit .pinit-button').on('click', function () {
92
var index = $(this).attr("data-indexer");
93
var image = $('img[data-indexer="' + index+ '"]');
94
var url = $(this).attr('href') + "&media=" + encodeURI ( image.data('media') ? image.data('media') : image[0].src );
88
})
89
}
90
91
+ $('.pinit .pinit-button').click( function () {
92
var index = $(this).attr("data-indexer");
93
var image = $('img[data-indexer="' + index+ '"]');
94
var url = $(this).attr('href') + "&media=" + encodeURI ( image.data('media') ? image.data('media') : image[0].src );
js/script.min.js CHANGED
@@ -1 +1 @@
1
- function jpibfi_pinit(e){var t=jQuery;var n={pageURL:document.URL,pageTitle:document.title,pageDescription:t('meta[name="description"]').attr("content")};var r=t.extend(n,e);var i=r.disabled_classes.split(";");if(!(typeof r.enabled_classes==="undefined"))var s=r.enabled_classes.split(";");t(r.image_selector).each(function(e){var n=t(this);for(var r in i){if(n.hasClass(i[r]))return}if(!(typeof s==="undefined")){var o=false;for(var r in s){if(n.hasClass(s[r])){o=true;break}}if(!o)return}n.attr("data-indexer",e)});window.onload=function(){var e=["alignnone","alignright","alignleft"];t("img[data-indexer]").each(function(){var n=t(this),i=r.pageURL;var s;if(r.description_option==3)s=n.attr("title")?n.attr("title"):n.attr("alt");else if(r.description_option==2)s=r.pageDescription;!s&&(s=r.pageTitle);var u=n.attr("data-indexer"),a="http://pinterest.com/pin/create/bookmarklet/?url="+encodeURI(i)+"&is_video="+encodeURI("false")+"&description="+encodeURI(s),f=this.clientHeight,l=this.clientWidth;n.wrap('<div class="pinit" data-indexer="'+u+'"/>');n.after('<span class="pinit-overlay" data-indexer= "'+u+'"><a class="pinit-button" href="'+a+'" data-indexer= "'+u+'">Pin It</a></span>');n.attr("height",f+"px").attr("width",l+"px");t('span.pinit-overlay[data-indexer="'+u+'"]').css({height:f+"px",width:l+"px","margin-right":n.css("margin-right"),"margin-left":n.css("margin-left"),"margin-top":n.css("margin-top"),"margin-bottom":n.css("margin-bottom")});for(var c in e)n.hasClass(e[c])&&t('span.pinit[data-indexer="'+u+'"]').addClass(e[c]);if(n.hasClass("aligncenter")){t('.pinit[data-indexer="'+u+'"]').addClass("aligncenter").css("clear","both");t('span.pinit-overlay[data-indexer="'+u+'"]').css({"margin-left":"auto","margin-right":"auto",left:0,right:0})}t(".pinit .pinit-button").on("click",function(){var e=t(this).attr("data-indexer");var n=t('img[data-indexer="'+e+'"]');var r=t(this).attr("href")+"&media="+encodeURI(n.data("media")?n.data("media"):n[0].src);window.open(r,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1");return false});t(".pinit").mouseenter(function(){t(this).children(".pinit-overlay").fadeIn(200)}).mouseleave(function(){t(this).children(".pinit-overlay").fadeOut(200)})})}}
1
+ function jpibfi_pinit(e){var t=jQuery;var n={pageURL:document.URL,pageTitle:document.title,pageDescription:t('meta[name="description"]').attr("content")};var r=t.extend(n,e);var i=r.disabled_classes.split(";");if(!(typeof r.enabled_classes==="undefined"))var s=r.enabled_classes.split(";");t(r.image_selector).each(function(e){var n=t(this);for(var r in i){if(n.hasClass(i[r]))return}if(!(typeof s==="undefined")){var o=false;for(var r in s){if(n.hasClass(s[r])){o=true;break}}if(!o)return}n.attr("data-indexer",e)});window.onload=function(){var e=["alignnone","alignright","alignleft"];t("img[data-indexer]").each(function(){var n=t(this),i=r.pageURL;var s;if(r.description_option==3)s=n.attr("title")?n.attr("title"):n.attr("alt");else if(r.description_option==2)s=r.pageDescription;!s&&(s=r.pageTitle);var u=n.attr("data-indexer"),a="http://pinterest.com/pin/create/bookmarklet/?url="+encodeURI(i)+"&is_video="+encodeURI("false")+"&description="+encodeURI(s),f=this.clientHeight,l=this.clientWidth;n.wrap('<div class="pinit" data-indexer="'+u+'"/>');n.after('<span class="pinit-overlay" data-indexer= "'+u+'"><a class="pinit-button" href="'+a+'" data-indexer= "'+u+'">Pin It</a></span>');n.attr("height",f+"px").attr("width",l+"px");t('span.pinit-overlay[data-indexer="'+u+'"]').css({height:f+"px",width:l+"px","margin-right":n.css("margin-right"),"margin-left":n.css("margin-left"),"margin-top":n.css("margin-top"),"margin-bottom":n.css("margin-bottom")});for(var c in e)n.hasClass(e[c])&&t('span.pinit[data-indexer="'+u+'"]').addClass(e[c]);if(n.hasClass("aligncenter")){t('.pinit[data-indexer="'+u+'"]').addClass("aligncenter").css("clear","both");t('span.pinit-overlay[data-indexer="'+u+'"]').css({"margin-left":"auto","margin-right":"auto",left:0,right:0})}t(".pinit .pinit-button").click(function(){var e=t(this).attr("data-indexer");var n=t('img[data-indexer="'+e+'"]');var r=t(this).attr("href")+"&media="+encodeURI(n.data("media")?n.data("media"):n[0].src);window.open(r,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1");return false});t(".pinit").mouseenter(function(){t(this).children(".pinit-overlay").fadeIn(200)}).mouseleave(function(){t(this).children(".pinit-overlay").fadeOut(200)})})}}
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://bit.ly/Uw2mEP
4
Tags: pinterest, pin it, button, image, images, pinit, social media, hover, click, photo, photos
5
Requires at least: 3.3.0
6
Tested up to: 3.5.1
7
- Stable tag: 0.9.1
8
License: GPLv2 or later
9
10
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
@@ -69,6 +69,10 @@ Please report them in the plugin's support forum on Wordpress.org.
69
70
== Changelog ==
71
72
= 0.9.1 =
73
* Released 2013-02-12
74
* Bug fixed: resizing images when their dimensions are larger than the container they're in
@@ -104,6 +108,9 @@ Please report them in the plugin's support forum on Wordpress.org.
104
105
== Upgrade Notice ==
106
107
= 0.9.1 =
108
Few bugs reported by users got fixed.
109
4
Tags: pinterest, pin it, button, image, images, pinit, social media, hover, click, photo, photos
5
Requires at least: 3.3.0
6
Tested up to: 3.5.1
7
+ Stable tag: 0.9.2
8
License: GPLv2 or later
9
10
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
69
70
== Changelog ==
71
72
+ = 0.9.2 =
73
+ * Released 2013-02-12
74
+ * It now works with jQuery versions older than 1.7
75
+
76
= 0.9.1 =
77
* Released 2013-02-12
78
* Bug fixed: resizing images when their dimensions are larger than the container they're in
108
109
== Upgrade Notice ==
110
111
+ = 0.9.2 =
112
+ Small update - plugin now works with jQuery versions older than 1.7.
113
+
114
= 0.9.1 =
115
Few bugs reported by users got fixed.
116