jQuery Pin It Button for Images - Version 1.16

Version Description

  • Released 2013-11-21
  • Minor bug fix
Download this release

Release Info

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

Code changes from version 1.15 to 1.16

jquery-pin-it-button-for-images.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: jQuery Pin It Button For Images
4
Plugin URI: http://mrsztuczkens.me/jpibfi/
5
Description: Highlights images on hover and adds a "Pin It" button over them for easy pinning.
6
Author: Marcin Skrzypiec
7
- Version: 1.15
8
Author URI: http://mrsztuczkens.me/
9
*/
10
@@ -18,7 +18,7 @@ if ( ! function_exists( 'add_action' ) ) {
18
* CONSTANTS
19
*
20
*/
21
- define( "JPIBFI_VERSION", "1.15" );
22
define( "JPIBFI_VERSION_MINOR", "a" );
23
define( "JPIBFI_METADATA", "jpibfi_meta" );
24
define( "JPIBFI_SELECTION_OPTIONS", "jpibfi_selection_options" );
4
Plugin URI: http://mrsztuczkens.me/jpibfi/
5
Description: Highlights images on hover and adds a "Pin It" button over them for easy pinning.
6
Author: Marcin Skrzypiec
7
+ Version: 1.16
8
Author URI: http://mrsztuczkens.me/
9
*/
10
18
* CONSTANTS
19
*
20
*/
21
+ define( "JPIBFI_VERSION", "1.16" );
22
define( "JPIBFI_VERSION_MINOR", "a" );
23
define( "JPIBFI_METADATA", "jpibfi_meta" );
24
define( "JPIBFI_SELECTION_OPTIONS", "jpibfi_selection_options" );
js/script.js CHANGED
@@ -255,7 +255,7 @@
255
256
bookmarkDescription = bookmarkDescription || ( descriptionForUrl || settings.pageTitle );
257
258
- var imageUrl = 'http://pinterest.com/pin/create/bookmarklet/?is_video=' + encodeURI('false') + "&url=" + encodeURI( bookmarkUrl ) + "&media=" + encodeURI ( $image.data('media') || $image[0].src )
259
+ '&description=' + encodeURIComponent( bookmarkDescription );
260
261
window.open(imageUrl, 'Pinterest', 'width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1');
255
256
bookmarkDescription = bookmarkDescription || ( descriptionForUrl || settings.pageTitle );
257
258
+ var imageUrl = 'http://pinterest.com/pin/create/bookmarklet/?is_video=' + encodeURI('false') + "&url=" + encodeURIComponent( bookmarkUrl ) + "&media=" + encodeURI ( $image.data('media') || $image[0].src )
259
+ '&description=' + encodeURIComponent( bookmarkDescription );
260
261
window.open(imageUrl, 'Pinterest', 'width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1');
js/script.min.js CHANGED
@@ -1 +1 @@
1
- (function(e){"use strict";function n(e){if(t&&console&&console.log){if("string"==typeof e||e instanceof String){console.log("jpibfi debug: "+e)}else if("object"==typeof e&&typeof JSON!=="undefined"&&typeof JSON.stringify==="function"){console.log("jpibfi debug: "+JSON.stringify(e,null,4))}else if("object"==typeof e){var n="";for(var r in e)n+=r+": "+e[r]+"\n";console.log("jpibfi debug: "+n)}}}function r(e){switch(e){case"0":return"pinit-top-left";case"1":return"pinit-top-right";case"2":return"pinit-bottom-left";case"3":return"pinit-bottom-right";case"4":return"pinit-middle";default:return""}}function i(e){var t=e.split(";");var n="";for(var r=0;r<t.length;r++){if(t[r])n+="."+t[r]+","}if(n)n=n.substr(0,n.length-1);return n}var t=false;e(document).ready(function(){function h(){n("Add Elements called");var t=0;e("img[data-jpibfi-indexer]").each(function(){var n=e(this);if(this.clientWidth<s.minImageWidth||this.clientHeight<s.minImageHeight){n.removeAttr("data-jpibfi-indexer");return}if(s.mode=="static")d(n,s.buttonPosition);t++});n("Images caught after filtering: "+t)}function p(){n("Remove Elements called");e("div.pinit-overlay").remove()}function d(e,t){var n=e.offset();var r=v(e,t);e.after(r);r.css({height:e.get(0).clientHeight+"px",width:e.get(0).clientWidth+"px"}).show().offset({left:n.left,top:n.top});return r}function v(e,t){var n=e.attr("data-jpibfi-indexer");return jQuery("<div/>",{"class":"pinit-overlay","data-jpibfi-indexer":n,title:e.attr("title")||"",html:m(n).addClass(r(t))})}function m(t){var r=jQuery("<a/>",{href:"#","class":"pinit-button","data-jpibfi-indexer":t,text:"Pin It"});r.click(function(t){n("Pin In button clicked");var r=e(this).attr("data-jpibfi-indexer");var i=e('img[data-jpibfi-indexer="'+r+'"]');var o="",u="",a="";if(s.usePostUrl){var f=i.closest("div.jpibfi_container").find("input.jpibfi").first();if(f.length){u=f.attr("data-jpibfi-description");a=f.attr("data-jpibfi-url")}}a=a||s.pageUrl;if(s.descriptionOption==3)o=i.attr("title")||i.attr("alt");else if(s.descriptionOption==2)o=u||s.pageDescription;else if(s.descriptionOption==4)o=s.siteTitle;else if(s.descriptionOption==5)o=i.attr("data-jpibfi-description");o=o||u||s.pageTitle;var l="http://pinterest.com/pin/create/bookmarklet/?is_video="+encodeURI("false")+"&url="+encodeURI(a)+"&media="+encodeURI(i.data("media")||i[0].src)+"&description="+encodeURIComponent(o);window.open(l,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1");return false});return r}var s={pageUrl:document.URL,pageTitle:document.title,pageDescription:e('meta[name="description"]').attr("content")||"",siteTitle:jpibfi_options.site_title,imageSelector:jpibfi_options.image_selector,disabledClasses:jpibfi_options.disabled_classes,enabledClasses:jpibfi_options.enabled_classes,descriptionOption:jpibfi_options.description_option,usePostUrl:jpibfi_options.use_post_url=="1",minImageHeight:jpibfi_options.min_image_height,minImageWidth:jpibfi_options.min_image_width,mode:jpibfi_options.mode,buttonPosition:jpibfi_options.button_position};var o={height:parseInt(jpibfi_options.pin_image_height),width:parseInt(jpibfi_options.pin_image_width)};var u={top:parseInt(jpibfi_options.button_margin_top),right:parseInt(jpibfi_options.button_margin_right),bottom:parseInt(jpibfi_options.button_margin_bottom),left:parseInt(jpibfi_options.button_margin_left)};t="1"==jpibfi_options.debug;n(s);n(o);n(u);var a=e(".jpibfi").closest("div").addClass("jpibfi_container");n("Number of containers added: "+a.length);var f=i(s.disabledClasses);var l=i(s.enabledClasses)||"*";n("Image selector: "+s.imageSelector);n("Filter selector: "+l);n("Not selector: "+f);var c=0;e(s.imageSelector).not(f).filter(l).each(function(t){e(this).attr("data-jpibfi-indexer",t);c++});n("Images caught by selectors: "+c);if("static"==s.mode){n("Adding static mode delegates");e(document).delegate("div.pinit-overlay","hover",function(t){var n=t.type==="mouseenter";var r=e(this).attr("data-jpibfi-indexer");e('.pinit-button[data-jpibfi-indexer="'+r+'"]').toggle(n);e('img[data-jpibfi-indexer="'+r+'"]').toggleClass("pinit-hover",n)})}else if("dynamic"==s.mode){n("Adding dynamic mode delegates");e(document).delegate("a.pinit-button","mouseenter",function(){var t=e(this);clearTimeout(t.data("jpibfi-timeoutId"))});e(document).delegate("a.pinit-button","mouseleave",function(){var t=e(this);var n=setTimeout(function(){t.remove();e('img[data-jpibfi-indexer="'+t.attr("data-jpibfi-indexer")+'"]').removeClass("pinit-hover")},100);t.data("jpibfi-timeoutId",n)});e(document).delegate("img[data-jpibfi-indexer]","mouseenter",function(){var t=e(this);var n=t.attr("data-jpibfi-indexer");var r=e('a.pinit-button[data-jpibfi-indexer="'+n+'"]');if(r.length==0){var r=m(n);var i=t.offset();var a={width:t.get(0).clientWidth,height:t.get(0).clientHeight};switch(s.buttonPosition){case"0":i.left+=u.left;i.top+=u.top;break;case"1":i.top+=u.top;i.left=i.left+a.width-u.right-o.width;break;case"2":i.left+=u.left;i.top=i.top+a.height-u.bottom-o.height;break;case"3":i.left=i.left+a.width-u.right-o.width;i.top=i.top+a.height-u.bottom-o.height;break;case"4":i.left=Math.round(i.left+a.width/2-o.width/2);i.top=Math.round(i.top+a.height/2-o.height/2);break}t.after(r);r.show().offset({left:i.left,top:i.top})}else{clearTimeout(r.data("jpibfi-timeoutId"))}e('img[data-jpibfi-indexer="'+r.attr("data-jpibfi-indexer")+'"]').addClass("pinit-hover")});e(document).delegate("img[data-jpibfi-indexer]","mouseleave",function(){var t=e(this).attr("data-jpibfi-indexer");var n=e('a.pinit-button[data-jpibfi-indexer="'+t+'"]');var r=setTimeout(function(){n.remove();e('img[data-jpibfi-indexer="'+n.attr("data-jpibfi-indexer")+'"]').removeClass("pinit-hover")},100);n.data("jpibfi-timeoutId",r)})}e(window).load(h);e(window).resize(function(){p();h()})});})(jQuery)
1
+ (function(e){"use strict";function n(e){if(t&&console&&console.log){if("string"==typeof e||e instanceof String){console.log("jpibfi debug: "+e)}else if("object"==typeof e&&typeof JSON!=="undefined"&&typeof JSON.stringify==="function"){console.log("jpibfi debug: "+JSON.stringify(e,null,4))}else if("object"==typeof e){var n="";for(var r in e)n+=r+": "+e[r]+"\n";console.log("jpibfi debug: "+n)}}}function r(e){switch(e){case"0":return"pinit-top-left";case"1":return"pinit-top-right";case"2":return"pinit-bottom-left";case"3":return"pinit-bottom-right";case"4":return"pinit-middle";default:return""}}function i(e){var t=e.split(";");var n="";for(var r=0;r<t.length;r++){if(t[r])n+="."+t[r]+","}if(n)n=n.substr(0,n.length-1);return n}var t=false;e(document).ready(function(){function h(){n("Add Elements called");var t=0;e("img[data-jpibfi-indexer]").each(function(){var n=e(this);if(this.clientWidth<s.minImageWidth||this.clientHeight<s.minImageHeight){n.removeAttr("data-jpibfi-indexer");return}if(s.mode=="static")d(n,s.buttonPosition);t++});n("Images caught after filtering: "+t)}function p(){n("Remove Elements called");e("div.pinit-overlay").remove()}function d(e,t){var n=e.offset();var r=v(e,t);e.after(r);r.css({height:e.get(0).clientHeight+"px",width:e.get(0).clientWidth+"px"}).show().offset({left:n.left,top:n.top});return r}function v(e,t){var n=e.attr("data-jpibfi-indexer");return jQuery("<div/>",{"class":"pinit-overlay","data-jpibfi-indexer":n,title:e.attr("title")||"",html:m(n).addClass(r(t))})}function m(t){var r=jQuery("<a/>",{href:"#","class":"pinit-button","data-jpibfi-indexer":t,text:"Pin It"});r.click(function(t){n("Pin In button clicked");var r=e(this).attr("data-jpibfi-indexer");var i=e('img[data-jpibfi-indexer="'+r+'"]');var o="",u="",a="";if(s.usePostUrl){var f=i.closest("div.jpibfi_container").find("input.jpibfi").first();if(f.length){u=f.attr("data-jpibfi-description");a=f.attr("data-jpibfi-url")}}a=a||s.pageUrl;if(s.descriptionOption==3)o=i.attr("title")||i.attr("alt");else if(s.descriptionOption==2)o=u||s.pageDescription;else if(s.descriptionOption==4)o=s.siteTitle;else if(s.descriptionOption==5)o=i.attr("data-jpibfi-description");o=o||u||s.pageTitle;var l="http://pinterest.com/pin/create/bookmarklet/?is_video="+encodeURI("false")+"&url="+encodeURIComponent(a)+"&media="+encodeURI(i.data("media")||i[0].src)+"&description="+encodeURIComponent(o);window.open(l,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1");return false});return r}var s={pageUrl:document.URL,pageTitle:document.title,pageDescription:e('meta[name="description"]').attr("content")||"",siteTitle:jpibfi_options.site_title,imageSelector:jpibfi_options.image_selector,disabledClasses:jpibfi_options.disabled_classes,enabledClasses:jpibfi_options.enabled_classes,descriptionOption:jpibfi_options.description_option,usePostUrl:jpibfi_options.use_post_url=="1",minImageHeight:jpibfi_options.min_image_height,minImageWidth:jpibfi_options.min_image_width,mode:jpibfi_options.mode,buttonPosition:jpibfi_options.button_position};var o={height:parseInt(jpibfi_options.pin_image_height),width:parseInt(jpibfi_options.pin_image_width)};var u={top:parseInt(jpibfi_options.button_margin_top),right:parseInt(jpibfi_options.button_margin_right),bottom:parseInt(jpibfi_options.button_margin_bottom),left:parseInt(jpibfi_options.button_margin_left)};t="1"==jpibfi_options.debug;n(s);n(o);n(u);var a=e(".jpibfi").closest("div").addClass("jpibfi_container");n("Number of containers added: "+a.length);var f=i(s.disabledClasses);var l=i(s.enabledClasses)||"*";n("Image selector: "+s.imageSelector);n("Filter selector: "+l);n("Not selector: "+f);var c=0;e(s.imageSelector).not(f).filter(l).each(function(t){e(this).attr("data-jpibfi-indexer",t);c++});n("Images caught by selectors: "+c);if("static"==s.mode){n("Adding static mode delegates");e(document).delegate("div.pinit-overlay","hover",function(t){var n=t.type==="mouseenter";var r=e(this).attr("data-jpibfi-indexer");e('.pinit-button[data-jpibfi-indexer="'+r+'"]').toggle(n);e('img[data-jpibfi-indexer="'+r+'"]').toggleClass("pinit-hover",n)})}else if("dynamic"==s.mode){n("Adding dynamic mode delegates");e(document).delegate("a.pinit-button","mouseenter",function(){var t=e(this);clearTimeout(t.data("jpibfi-timeoutId"))});e(document).delegate("a.pinit-button","mouseleave",function(){var t=e(this);var n=setTimeout(function(){t.remove();e('img[data-jpibfi-indexer="'+t.attr("data-jpibfi-indexer")+'"]').removeClass("pinit-hover")},100);t.data("jpibfi-timeoutId",n)});e(document).delegate("img[data-jpibfi-indexer]","mouseenter",function(){var t=e(this);var n=t.attr("data-jpibfi-indexer");var r=e('a.pinit-button[data-jpibfi-indexer="'+n+'"]');if(r.length==0){var r=m(n);var i=t.offset();var a={width:t.get(0).clientWidth,height:t.get(0).clientHeight};switch(s.buttonPosition){case"0":i.left+=u.left;i.top+=u.top;break;case"1":i.top+=u.top;i.left=i.left+a.width-u.right-o.width;break;case"2":i.left+=u.left;i.top=i.top+a.height-u.bottom-o.height;break;case"3":i.left=i.left+a.width-u.right-o.width;i.top=i.top+a.height-u.bottom-o.height;break;case"4":i.left=Math.round(i.left+a.width/2-o.width/2);i.top=Math.round(i.top+a.height/2-o.height/2);break}t.after(r);r.show().offset({left:i.left,top:i.top})}else{clearTimeout(r.data("jpibfi-timeoutId"))}e('img[data-jpibfi-indexer="'+r.attr("data-jpibfi-indexer")+'"]').addClass("pinit-hover")});e(document).delegate("img[data-jpibfi-indexer]","mouseleave",function(){var t=e(this).attr("data-jpibfi-indexer");var n=e('a.pinit-button[data-jpibfi-indexer="'+t+'"]');var r=setTimeout(function(){n.remove();e('img[data-jpibfi-indexer="'+n.attr("data-jpibfi-indexer")+'"]').removeClass("pinit-hover")},100);n.data("jpibfi-timeoutId",r)})}e(window).load(h);e(window).resize(function(){p();h()})});})(jQuery)
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.6.1
7
- Stable tag: 1.15
8
License: GPLv2 or later
9
10
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
@@ -71,6 +71,10 @@ Please report them in the plugin's support forum on Wordpress.org.
71
72
== Changelog ==
73
74
= 1.15 =
75
* Released 2013-11-06
76
* Added 'Image description' option to 'Description source' option
@@ -167,6 +171,9 @@ Please report them in the plugin's support forum on Wordpress.org.
167
168
== Upgrade Notice ==
169
170
= 1.15 =
171
Adds 'Image description' option to 'Description source' option.
172
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.6.1
7
+ Stable tag: 1.16
8
License: GPLv2 or later
9
10
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
71
72
== Changelog ==
73
74
+ = 1.16 =
75
+ * Released 2013-11-21
76
+ * Minor bug fix
77
+
78
= 1.15 =
79
* Released 2013-11-06
80
* Added 'Image description' option to 'Description source' option
171
172
== Upgrade Notice ==
173
174
+ = 1.15 =
175
+ Minor bug fix.
176
+
177
= 1.15 =
178
Adds 'Image description' option to 'Description source' option.
179