jQuery Pin It Button for Images - Version 3.0.4

Version Description

  • Released 2019-02-25
  • Removed advertisement link
Download this release

Release Info

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

Code changes from version 3.0.2 to 3.0.4

includes/admin/jpibfi-admin.php CHANGED
@@ -31,8 +31,8 @@ class JPIBFI_Admin {
31
32
$jpibfi_plugin = plugin_basename( $this->file );
33
add_filter( "plugin_action_links_$jpibfi_plugin", array( $this, 'add_settings_link' ) );
34
- add_action( 'admin_notices', array( $this, 'show_ad' ), 11 );
35
add_action( 'admin_init', array( $this, 'show_nags' ) );
36
add_filter( 'plugin_row_meta', array( $this, 'plugin_meta_links' ), 10, 2 );
37
}
38
@@ -180,7 +180,15 @@ class JPIBFI_Admin {
180
$module = $this->get_tab( $tab );
181
$module->save_settings( $_POST );
182
}
183
184
185
public function show_ad() {
186
global $hook_suffix;
@@ -196,27 +204,10 @@ class JPIBFI_Admin {
196
);
197
?>
198
</p>
199
- </div>
200
- <div class="notice notice-success">
201
- <p>
202
- <?php printf(
203
- __( '<strong>Image Auto Poster</strong>, plugin that allows you to pin your images directly from the post editor to your Pinterest account, is available on the WordPress.org repository. <a class="button button-primary" href="%1$s" target="_blank">Check it out &rarr;</a>', 'jquery-pin-it-button-for-images' ),
204
- 'https://wordpress.org/plugins/iaposter/'
205
- );
206
- ?>
207
- </p>
208
</div>
209
<?php
210
}
211
212
- function show_nags() {
213
- require_once 'includes/jpibfi_review_nag.php';
214
- new JPIBFI_Review_Nag( 'jpibfi', 'jQuery Pin It Button For Images', 'http://wordpress.org/support/view/plugin-reviews/jquery-pin-it-button-for-images', '-10 days' );
215
-
216
- require_once 'includes/JPIBFI_Pro_Nag.php';
217
- new JPIBFI_Pro_Nag( 'jpibfi', 'jQuery Pin It Button For Images', 'https://highfiveplugins.com/downloads/jquery-pin-it-button-for-images-pro/' );
218
- }
219
-
220
function plugin_meta_links( $links, $file ) {
221
$plugin = plugin_basename( $this->file );
222
if ( $file == $plugin ) {
31
32
$jpibfi_plugin = plugin_basename( $this->file );
33
add_filter( "plugin_action_links_$jpibfi_plugin", array( $this, 'add_settings_link' ) );
34
add_action( 'admin_init', array( $this, 'show_nags' ) );
35
+ add_action( 'admin_notices', array( $this, 'show_ad' ), 11 );
36
add_filter( 'plugin_row_meta', array( $this, 'plugin_meta_links' ), 10, 2 );
37
}
38
180
$module = $this->get_tab( $tab );
181
$module->save_settings( $_POST );
182
}
183
+
184
+ function show_nags() {
185
+ require_once 'includes/jpibfi_review_nag.php';
186
+ new JPIBFI_Review_Nag( 'jpibfi', 'jQuery Pin It Button For Images', 'http://wordpress.org/support/view/plugin-reviews/jquery-pin-it-button-for-images', '-10 days' );
187
188
+ require_once 'includes/JPIBFI_Pro_Nag.php';
189
+ new JPIBFI_Pro_Nag( 'jpibfi', 'jQuery Pin It Button For Images', 'https://highfiveplugins.com/downloads/jquery-pin-it-button-for-images-pro/' );
190
+
191
+ }
192
193
public function show_ad() {
194
global $hook_suffix;
204
);
205
?>
206
</p>
207
</div>
208
<?php
209
}
210
211
function plugin_meta_links( $links, $file ) {
212
$plugin = plugin_basename( $this->file );
213
if ( $file == $plugin ) {
jquery-pin-it-button-for-images.php CHANGED
@@ -6,7 +6,7 @@ Description: Highlights images on hover and adds a "Pin It" button over them for
6
Text Domain: jquery-pin-it-button-for-images
7
Domain Path: /languages
8
Author: Marcin Skrzypiec
9
- Version:3.0.2
10
Author URI: https://highfiveplugins.com/
11
*/
12
@@ -18,7 +18,7 @@ if ( !class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) {
18
final class jQuery_Pin_It_Button_For_Images {
19
20
function __construct() {
21
- $version = '3.0.2';
22
require_once plugin_dir_path(__FILE__) . 'includes/jpibfi.php';
23
new JPIBFI(__FILE__, $version);
24
}
6
Text Domain: jquery-pin-it-button-for-images
7
Domain Path: /languages
8
Author: Marcin Skrzypiec
9
+ Version:3.0.4
10
Author URI: https://highfiveplugins.com/
11
*/
12
18
final class jQuery_Pin_It_Button_For_Images {
19
20
function __construct() {
21
+ $version = '3.0.4';
22
require_once plugin_dir_path(__FILE__) . 'includes/jpibfi.php';
23
new JPIBFI(__FILE__, $version);
24
}
js/jpibfi.client.js CHANGED
@@ -1 +1 @@
1
- !function(){function t(e,i,n){function r(s,a){if(!i[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[s]={exports:{}};e[s][0].call(l.exports,function(t){var i=e[s][1][t];return r(i||t)},l,l.exports,t,e,i,n)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}return t}()({1:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./css-helper"),r=55/64,o=51/73,s=41/64,a=36/54,u=.7,c=.7,l=function(t,e){var i=t*a;switch(e){case"pushpin":return i*c;case"thumb-tack":return i*u;default:return i}},p=function(t,e){switch(e){case"circle":return{"margin-top":-.5*t+"px","margin-left":-.5*t*r+"px"};case"plain":return{"margin-top":-.46875*t+"px","margin-left":-.5*t*o+"px"};case"thumb-tack":return{"margin-top":-29.5/64*t+"px","margin-left":-.5*t*s+"px"};case"pushpin":case"pinterest2":return{"margin-top":-.5*t+"px","margin-left":-.5*t+"px"}}};i.createCssRulesForDefaultButton=function(t,e){var i=l(t.height,e),r={height:t.height+"px",width:t.width+"px","font-size":i+"px"},o=p(i,e);n.addMediaQueryRule("a.pinit-button span",0,r),n.addMediaQueryRule("a.pinit-button span:before",0,o)},i.createCssRulesForCustomButton=function(t){var e={height:t.height+"px",width:t.width+"px"},i={"background-size":t.width+"px "+t.height+"px !important",height:t.height+"px",width:t.width+"px"};n.addMediaQueryRule("a.pinit-button",0,e),n.addMediaQueryRule("a.pinit-button span",0,i)}},{"./css-helper":2}],2:[function(t,e,i){"use strict";i.__esModule=!0;var n,r;!function(t){t[t.xsm=0]="xsm",t[t.sm=576]="sm",t[t.md=768]="md",t[t.lg=992]="lg",t[t.xlg=1200]="xlg"}(r=i.Breakpoints||(i.Breakpoints={})),i.BreakpointsList=Object.keys(r).filter(function(t){return"number"==typeof r[t]}).map(function(t){return Number(r[t])}),i.getCurrentBreakpoint=function(){for(var t=window.innerWidth,e=i.BreakpointsList.length-1;e>=0;e--)if(t>=i.BreakpointsList[e])return i.BreakpointsList[e];return r.xsm};var o=(n={},n[r.xsm]={width:50,height:50},n[r.sm]={width:60,height:60},n[r.md]={width:80,height:80},n[r.lg]={width:110,height:110},n[r.xlg]={width:1e3,height:1e3},n),s=function(t,e){var i="string"==typeof e?e:Object.keys(e).map(function(t){return t+":"+("content"===t?"'"+e[t]+"'":e[t])}).join(";");return t+" {"+i+"}"},a=function(t,e){return"@media (min-width: "+t+"px){ "+e+" }"},u=function(t){var e=document.createElement("style"),i=document.head.appendChild(e).sheet;i.insertRule(t,i.cssRules.length)};i.addCssRule=function(t,e){u(s(t,e))},i.addMediaQueryRule=function(t,e,i){var n=s(t,i),r=e>0?a(e,n):n;u(r)};var c=function(t,e){var i=Math.min(1,e.width/t.width),n=Math.min(1,e.height/t.height);return Math.min(i,n)};i.calculateSizeForBreakpoint=function(t,e){var i=o[e],n=c(t,i);return{height:t.height*n,width:t.width*n}}},{}],3:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(){function t(t){var e=(void 0===t?{}:t).siteTitle,i=void 0===e?"":e;this.desc_funcs={img_title:function(t){return t.attr("title")||t.attr("data-jpibfi-title")},img_alt:function(t){return t.attr("alt")||t.attr("data-jpibfi-alt")},post_title:function(t){return t.attr("data-jpibfi-post-title")},post_excerpt:function(t){return t.attr("data-jpibfi-post-excerpt")},img_description:function(t){return t.attr("data-jpibfi-description")},img_caption:function(t){return t.attr("data-jpibfi-caption")},site_title:function(){return i},data_pin_description:function(t){return t.attr("data-pin-description")}}}return t.prototype.getDescription=function(t,e){for(var i="",n=0;n<e.length&&!i;n++)i=this.desc_funcs[e[n]](t);return i||""},t}();i["default"]=n},{}],4:[function(t,e,i){"use strict";i.__esModule=!0;var n;!function(t){t[t.Width=0]="Width",t[t.PixelDensity=1]="PixelDensity"}(n||(n={}));var r=/(.+)\s+(\d{1,4})w\s*/i,o=/(.*)\s+(\d{1,3}(\.\d{0,2})?)x\s*/i,s={Url:1,WidthDescriptor:2},a=function(t){if(0!==t.length)return t.some(function(t){return null!==r.exec(t)})?n.Width:t.some(function(t){return null!==o.exec(t)})?n.PixelDensity:void 0},u=function(t,e){if(e!==n.PixelDensity){var i=t.map(function(t){return r.exec(t)}).filter(function(t){return!!t}).map(function(t){return{url:t[s.Url],width:Number(t[s.WidthDescriptor])}});if(0!==i.length)return i.reduce(function(t,e){return t.width>e.width?t:e},i[0])}};i.getWidestImageUrlFromSrcset=function(t){var e=t.prop?t.prop("srcset"):t.attr("srcset");if(e&&0!==e.length)try{var i=e.split(","),n=a(i),r=u(i,n);return void 0!==r?r.url:void 0}catch(o){return void(console&&console.error&&console.error(o))}}},{}],5:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(){function t(t){var e=this;this.flags={},this.pluginName=t;var i="undefined"!=typeof console&&"undefined"!=typeof console.log,n="undefined"!=typeof JSON&&"function"==typeof JSON.stringify;i?(this.logString=function(t){e.log(t)},this.logObject=n?function(t){e.log(JSON.stringify(t,null,4))}:function(t){return e.simplelogObject(t)}):(this.logString=function(){},this.logObject=function(){});var r=this.getQueryParams(document.location.search);Object.keys(r).forEach(function(i){var n=i.replace(t+"_","");e.setFlag(n,r[i])})}return t.prototype.getFlag=function(t){return void 0!==this.flags[t]&&this.flags[t]},t.prototype.getQueryParams=function(t){t=t.split("+").join(" ");for(var e,i={},n=/[?&]?([^=]+)=([^&]*)/g;e=n.exec(t);)i[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);return i},t.prototype.log=function(t){this.getFlag("print")&&console.log(this.pluginName+" debug: "+t)},t.prototype.setFlag=function(t,e){void 0===e&&(e=!0),this.flags[t]=e},t.prototype.simplelogObject=function(t){if(this.getFlag("print")){var e=Object.keys(t).filter(function(e){return t.hasOwnPrototype(e)}).map(function(e){return e+": "+t[e]+"\n"}).join();this.log(e)}},t}();i["default"]=n},{}],6:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./link-generator"),r=function(){function t(t,e){this.$=t,this.settings=e,this.linkGenerator=new n["default"](e),this.$element=this.$("<a />",{target:"_blank","class":"pinit-button "+e.pin_image});var i="default"===e.pin_image?"jpibfi-icon-"+e.pin_image_icon:"";this.$element.html('<span class="'+i+'"></span>'),"default"===e.pin_image&&this.$element.addClass("jpibfi-button-"+e.pin_image_button)}return t.prototype.createButton=function(t){var e=this.linkGenerator.generate(t);if(e)return this.$element.clone(!1).attr("href",e).click(function(t){t.preventDefault(),t.stopPropagation(),"#"!==t.currentTarget.href.slice(-1)&&window.open(t.currentTarget.href,"mw"+t.timeStamp,"left=20,top=20,width=600,height=500,toolbar=1,resizable=0")})},t.prototype.getSize=function(){var t={height:this.settings.pinImageHeight,width:this.settings.pinImageWidth};return t},t}();i["default"]=r},{"./link-generator":9}],7:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(){function t(t){var e=this;this.settings=t,this.disabledClasses=this.createClassList(t.disabled_classes),this.enabledClasses=this.createClassList(t.enabled_classes),this.updateSizeConstraints(),window.addEventListener("resize",function(){return e.updateSizeConstraints()},!1)}return t.prototype.createClassList=function(t){return void 0===t&&(t=""),t.split(";").filter(function(t){return!!t})},t.prototype.imageEligible=function(t){return(0===this.enabledClasses.length||this.enabledClasses.some(function(e){return t.hasClass(e)}))&&!this.disabledClasses.some(function(e){return t.hasClass(e)})&&this.imageSizeIsOk(t)},t.prototype.imageSizeIsOk=function(t){var e=t[0].clientWidth,i=t[0].clientHeight;return e>=this.minWidth&&i>=this.minHeight},t.prototype.updateSizeConstraints=function(){this.minWidth=window.outerWidth<768?this.settings.min_image_width_small:this.settings.min_image_width,this.minHeight=window.outerWidth<768?this.settings.min_image_height_small:this.settings.min_image_height},t}();i["default"]=n},{}],8:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./show-on-hover-strategy"),r=function(){function t(t,e,i){this.settings=e,this.$=t,this.logger=i}return t.prototype.init=function(){this.showStrategy=this.getStrategy(),this.showStrategy.start()},t.prototype.getStrategy=function(){var t=null;return new(t=n["default"])(this.$,this.settings,this.logger)},t}();i["default"]=r},{"./show-on-hover-strategy":11}],9:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("../common/description-helper");t("../common/srcset-helper");i.getExtension=function(t){void 0===t&&(t="");var e=t.replace(/^https?\:\/\/[^\/?#]+(?:[\/?#]|$)/i,""),i=e.split(".");if(1===i.length)return"";var n=i[i.length-1],r=n.replace(/\?.*/i,"").toLowerCase();return r};var r=function(t){return["","html","php"].indexOf(t)!==-1},o=function(t){var e=window.location&&window.location.hostname||"",i=e.replace("www.","");return t.indexOf(i)>=0},s=function(){function t(t){this.descriptionHelper=new n["default"]({siteTitle:t.siteTitle}),this.description_option=t.description_option,this.supportSrcset=t.support_srcset,this.pinLinkedUrl=t.pin_linked_url}return t.prototype.getDescription=function(t){return this.descriptionHelper.getDescription(t,this.description_option)},t.prototype.getImage=function(t,e){var n=t.attr("data-pin-media")||t.attr("data-jpibfi-src")||t.prop("src");if(n){if(!e)return n;var r=i.getExtension(n);return e.extension===r?e.href:n}},t.prototype.getUrl=function(t,e){return t.attr("data-pin-url")?t.attr("data-pin-url"):this.pinLinkedUrl&&e&&o(e.href)&&r(e.extension)?e.href:t.attr("data-jpibfi-post-url")||window.location.href},t.prototype.generate=function(t){var e=t.closest("a[href]"),n=void 0;1===e.length&&(n={extension:i.getExtension(e.prop("href")),href:e.prop("href")});var r=this.getImage(t,n);if(void 0!==r){var o=encodeURIComponent(r),s=encodeURIComponent(this.getDescription(t)),a=encodeURIComponent(this.getUrl(t,n));return"https://pinterest.com/pin/create/bookmarklet/?is_video=false&url="+a+"&media="+o+"&description="+s}},t}();i["default"]=s},{"../common/description-helper":3,"../common/srcset-helper":4}],10:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(t,e,i,n){return t.top+n.top},r=function(t,e,i,n){return t.left+n.left},o=function(t,e,i,n){return e.top-i.height-n.bottom},s=function(t,e,i,n){return e.left-n.right-i.width},a=function(t,e,i){return t.top+((e.top-t.top)/2-i.height/2)},u=function(t,e,i){return t.left+((e.left-t.left)/2-i.width/2)},c=function(){function t(t,e){this.topF=t,this.leftF=e}return t.prototype.calculate=function(t,e,i,n){return{top:this.topF(t,e,i,n),left:this.leftF(t,e,i,n)}},t}(),l=function(t){switch(t){case"top-left":return new c(n,r);case"top-right":return new c(n,s);case"bottom-left":return new c(o,r);case"bottom-right":return new c(o,s);default:return new c(a,u)}},p=function(){function t(t,e){this.margins=e,this.positionCalculator=l(t)}return t.prototype.calculatePosition=function(t,e,i){return this.positionCalculator.calculate(t,e,i,this.margins)},t}();i["default"]=p},{}],11:[function(t,e,i){"use strict";var n=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();i.__esModule=!0;var r=t("./show-strategy"),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(){this.addContainers()},e.prototype.start=function(){var t=this;this.init();var e="data-jpibfi-timeout",i=0,n=function(e){return t.$("a.pinit-button["+t.indexerAttr+'="'+e+'"]')},r=this;r.$(document).delegate(this.settings.image_selector,"mouseenter",function(){var t=r.$(this);if(r.imageFilter.imageEligible(t)){var o=t.attr(r.indexerAttr);o||(o=i++,t.attr(r.indexerAttr,o));var s=n(o);if(0===s.length){var a=r.buttonGenerator.createButton(t);if(!a)return;t.addClass("pinit-hover");var u=r.buttonGenerator.getSize(),c=t.offset(),l={top:c.top+t[0].clientHeight,left:c.left+t[0].clientWidth},p=r.positioner.calculatePosition(c,l,u);t.after(a),a.attr(r.indexerAttr,o).css("visibility","hidden").show().offset(p).css("visibility","visible").hover(function(){return clearTimeout(a.attr(e))},function(){return a.attr(e,setTimeout(function(){t.removeClass("pinit-hover"),a.remove()},100))})}else clearTimeout(s.attr(e))}}),r.$(document).delegate(this.settings.image_selector,"mouseleave",function(){if(!r.logger.getFlag("prevent_hide")){var t=r.$(this),i=t.attr(r.indexerAttr);if(i){var o=n(i);o.attr(e,setTimeout(function(){t.removeClass("pinit-hover"),o.remove()},100))}}})},e}(r["default"]);i["default"]=o},{"./show-strategy":12}],12:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./image-filter"),r=t("./button-generator"),o=t("./positioner"),s=t("../common/css-generator"),a=function(){function t(t,e,i){this.$=t,this.settings=e,this.logger=i,this.imageFilter=new n["default"](e),this.buttonGenerator=new r["default"](t,e);var a={left:e.button_margin_left,top:e.button_margin_top,right:e.button_margin_right,bottom:e.button_margin_bottom};this.positioner=new o["default"](e.button_position,a),this.indexerAttr="data-jpibfi-indexer";var u=this.settings,c=u.pin_image,l=u.pin_image_icon,p=u.pinImageHeight,f=u.pinImageWidth,h=(u.scale_pin_image,{width:f,height:p});switch(c){case"custom":case"old_default":var d=s.createCssRulesForCustomButton;d(h);break;case"default":var d=s.createCssRulesForDefaultButton;d(h,l)}}return t.prototype.addContainers=function(){var t=this.$(".jpibfi"),e=t.closest("div, article");e=e.length?e:t.parent(),e.addClass("jpibfi_container")},t}();i["default"]=a},{"../common/css-generator":1,"./button-generator":6,"./image-filter":7,"./positioner":10}],13:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./settings"),r=t("./debugger"),o=t("./hover");!function(t){var e=function(){var e=window.jpibfi_options,i=new n["default"](t.extend({pageUrl:document.URL,pageTitle:document.title,pageDescription:t('meta[name="description"]').attr("content")||""},e.hover)),s=new r["default"]("jpibfi");window.jpibfi_debugger=s;var a=new o["default"](t,i,s);a.init()};t(document).ready(e)}(window.jQuery)},{"./debugger":5,"./hover":8,"./settings":14}],14:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]}),this.isTouchDevice="ontouchstart"in window||{}.hasOwnProperty.call(navigator,"maxTouchPoints")}return t}();i["default"]=n},{}]},{},[13]);
1
+ !function(){function t(e,i,n){function r(s,a){if(!i[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[s]={exports:{}};e[s][0].call(l.exports,function(t){var i=e[s][1][t];return r(i||t)},l,l.exports,t,e,i,n)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}return t}()({1:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./css-helper"),r=55/64,o=51/73,s=41/64,a=36/54,u=.7,c=.7,l=function(t,e){var i=t*a;switch(e){case"pushpin":return i*c;case"thumb-tack":return i*u;default:return i}},p=function(t,e){switch(e){case"circle":return{"margin-top":-.5*t+"px","margin-left":-.5*t*r+"px"};case"plain":return{"margin-top":-.46875*t+"px","margin-left":-.5*t*o+"px"};case"thumb-tack":return{"margin-top":-29.5/64*t+"px","margin-left":-.5*t*s+"px"};case"pushpin":case"pinterest2":return{"margin-top":-.5*t+"px","margin-left":-.5*t+"px"}}};i.createCssRulesForDefaultButton=function(t,e){var i=l(t.height,e),r={height:t.height+"px",width:t.width+"px","font-size":i+"px"},o=p(i,e);n.addMediaQueryRule("a.pinit-button span",0,r),n.addMediaQueryRule("a.pinit-button span:before",0,o)},i.createCssRulesForCustomButton=function(t){var e={height:t.height+"px",width:t.width+"px"},i={"background-size":t.width+"px "+t.height+"px !important",height:t.height+"px",width:t.width+"px"};n.addMediaQueryRule("a.pinit-button",0,e),n.addMediaQueryRule("a.pinit-button span",0,i)}},{"./css-helper":2}],2:[function(t,e,i){"use strict";i.__esModule=!0;var n,r;!function(t){t[t.xsm=0]="xsm",t[t.sm=576]="sm",t[t.md=768]="md",t[t.lg=992]="lg",t[t.xlg=1200]="xlg"}(r=i.Breakpoints||(i.Breakpoints={})),i.BreakpointsList=Object.keys(r).filter(function(t){return"number"==typeof r[t]}).map(function(t){return Number(r[t])}),i.getCurrentBreakpoint=function(){for(var t=window.innerWidth,e=i.BreakpointsList.length-1;e>=0;e--)if(t>=i.BreakpointsList[e])return i.BreakpointsList[e];return r.xsm};var o=(n={},n[r.xsm]={width:50,height:50},n[r.sm]={width:60,height:60},n[r.md]={width:80,height:80},n[r.lg]={width:110,height:110},n[r.xlg]={width:1e3,height:1e3},n),s=function(t,e){var i="string"==typeof e?e:Object.keys(e).map(function(t){return t+":"+("content"===t?"'"+e[t]+"'":e[t])}).join(";");return t+" {"+i+"}"},a=function(t,e){return"@media (min-width: "+t+"px){ "+e+" }"},u=function(t){var e=document.createElement("style"),i=document.head.appendChild(e).sheet;i.insertRule(t,i.cssRules.length)};i.addCssRule=function(t,e){u(s(t,e))},i.addMediaQueryRule=function(t,e,i){var n=s(t,i),r=e>0?a(e,n):n;u(r)};var c=function(t,e){var i=Math.min(1,e.width/t.width),n=Math.min(1,e.height/t.height);return Math.min(i,n)};i.calculateSizeForBreakpoint=function(t,e){var i=o[e],n=c(t,i);return{height:t.height*n,width:t.width*n}}},{}],3:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(){function t(t){var e=(void 0===t?{}:t).siteTitle,i=void 0===e?"":e;this.desc_funcs={img_title:function(t){return t.attr("title")||t.attr("data-jpibfi-title")},img_alt:function(t){return t.attr("alt")||t.attr("data-jpibfi-alt")},post_title:function(t){return t.attr("data-jpibfi-post-title")},post_excerpt:function(t){return t.attr("data-jpibfi-post-excerpt")},img_description:function(t){return t.attr("data-jpibfi-description")},img_caption:function(t){return t.attr("data-jpibfi-caption")},site_title:function(){return i},data_pin_description:function(t){return t.attr("data-pin-description")}}}return t.prototype.getDescription=function(t,e){for(var i="",n=0;n<e.length&&!i;n++)i=this.desc_funcs[e[n]](t);return i||""},t}();i["default"]=n},{}],4:[function(t,e,i){"use strict";i.__esModule=!0;var n;!function(t){t[t.Width=0]="Width",t[t.PixelDensity=1]="PixelDensity"}(n||(n={}));var r=/(.+)\s+(\d{1,4})w\s*/i,o=/(.*)\s+(\d{1,3}(\.\d{0,2})?)x\s*/i,s={Url:1,WidthDescriptor:2},a=function(t){if(0!==t.length)return t.some(function(t){return null!==r.exec(t)})?n.Width:t.some(function(t){return null!==o.exec(t)})?n.PixelDensity:void 0},u=function(t,e){if(e!==n.PixelDensity){var i=t.map(function(t){return r.exec(t)}).filter(function(t){return!!t}).map(function(t){return{url:t[s.Url].trim(),width:Number(t[s.WidthDescriptor])}});if(0!==i.length)return i.reduce(function(t,e){return t.width>e.width?t:e},i[0])}};i.getWidestImageUrlFromSrcset=function(t){var e=t.prop?t.prop("srcset"):t.attr("srcset");if(e&&0!==e.length)try{var i=e.split(","),n=a(i),r=u(i,n);return void 0!==r?r.url:void 0}catch(o){return void(console&&console.error&&console.error(o))}}},{}],5:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(){function t(t){var e=this;this.flags={},this.pluginName=t;var i="undefined"!=typeof console&&"undefined"!=typeof console.log,n="undefined"!=typeof JSON&&"function"==typeof JSON.stringify;i?(this.logString=function(t){e.log(t)},this.logObject=n?function(t){e.log(JSON.stringify(t,null,4))}:function(t){return e.simplelogObject(t)}):(this.logString=function(){},this.logObject=function(){});var r=this.getQueryParams(document.location.search);Object.keys(r).forEach(function(i){var n=i.replace(t+"_","");e.setFlag(n,r[i])})}return t.prototype.getFlag=function(t){return void 0!==this.flags[t]&&this.flags[t]},t.prototype.getQueryParams=function(t){t=t.split("+").join(" ");for(var e,i={},n=/[?&]?([^=]+)=([^&]*)/g;e=n.exec(t);)i[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);return i},t.prototype.log=function(t){this.getFlag("print")&&console.log(this.pluginName+" debug: "+t)},t.prototype.setFlag=function(t,e){void 0===e&&(e=!0),this.flags[t]=e},t.prototype.simplelogObject=function(t){if(this.getFlag("print")){var e=Object.keys(t).filter(function(e){return t.hasOwnPrototype(e)}).map(function(e){return e+": "+t[e]+"\n"}).join();this.log(e)}},t}();i["default"]=n},{}],6:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./link-generator"),r=function(){function t(t,e){this.$=t,this.settings=e,this.linkGenerator=new n["default"](e),this.$element=this.$("<a />",{target:"_blank","class":"pinit-button "+e.pin_image});var i="default"===e.pin_image?"jpibfi-icon-"+e.pin_image_icon:"";this.$element.html('<span class="'+i+'"></span>'),"default"===e.pin_image&&this.$element.addClass("jpibfi-button-"+e.pin_image_button)}return t.prototype.createButton=function(t){var e=this.linkGenerator.generate(t);if(e)return this.$element.clone(!1).attr("href",e).click(function(t){t.preventDefault(),t.stopPropagation(),"#"!==t.currentTarget.href.slice(-1)&&window.open(t.currentTarget.href,"mw"+t.timeStamp,"left=20,top=20,width=600,height=500,toolbar=1,resizable=0")})},t.prototype.getSize=function(){var t={height:this.settings.pinImageHeight,width:this.settings.pinImageWidth};return t},t}();i["default"]=r},{"./link-generator":9}],7:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(){function t(t){var e=this;this.settings=t,this.disabledClasses=this.createClassList(t.disabled_classes),this.enabledClasses=this.createClassList(t.enabled_classes),this.updateSizeConstraints(),window.addEventListener("resize",function(){return e.updateSizeConstraints()},!1)}return t.prototype.createClassList=function(t){return void 0===t&&(t=""),t.split(";").filter(function(t){return!!t})},t.prototype.imageEligible=function(t){return(0===this.enabledClasses.length||this.enabledClasses.some(function(e){return t.hasClass(e)}))&&!this.disabledClasses.some(function(e){return t.hasClass(e)})&&this.imageSizeIsOk(t)},t.prototype.imageSizeIsOk=function(t){var e=t[0].clientWidth,i=t[0].clientHeight;return e>=this.minWidth&&i>=this.minHeight},t.prototype.updateSizeConstraints=function(){this.minWidth=window.outerWidth<768?this.settings.min_image_width_small:this.settings.min_image_width,this.minHeight=window.outerWidth<768?this.settings.min_image_height_small:this.settings.min_image_height},t}();i["default"]=n},{}],8:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./show-on-hover-strategy"),r=function(){function t(t,e,i){this.settings=e,this.$=t,this.logger=i}return t.prototype.init=function(){this.showStrategy=this.getStrategy(),this.showStrategy.start()},t.prototype.getStrategy=function(){var t=null;return new(t=n["default"])(this.$,this.settings,this.logger)},t}();i["default"]=r},{"./show-on-hover-strategy":11}],9:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("../common/description-helper");t("../common/srcset-helper");i.getExtension=function(t){void 0===t&&(t="");var e=t.replace(/^https?\:\/\/[^\/?#]+(?:[\/?#]|$)/i,""),i=e.split(".");if(1===i.length)return"";var n=i[i.length-1],r=n.replace(/\?.*/i,"").toLowerCase();return r};var r=function(t){return["","html","php"].indexOf(t)!==-1},o=function(t){var e=window.location&&window.location.hostname||"",i=e.replace("www.","");return t.indexOf(i)>=0},s=function(){function t(t){this.descriptionHelper=new n["default"]({siteTitle:t.siteTitle}),this.description_option=t.description_option,this.supportSrcset=t.support_srcset,this.pinLinkedUrl=t.pin_linked_url}return t.prototype.getDescription=function(t){return this.descriptionHelper.getDescription(t,this.description_option)},t.prototype.getImage=function(t,e){var n=t.attr("data-pin-media")||t.attr("data-jpibfi-src")||t.prop("src");if(n){if(!e)return n;var r=i.getExtension(n);return e.extension===r?e.href:n}},t.prototype.getUrl=function(t,e){return t.attr("data-pin-url")?t.attr("data-pin-url"):this.pinLinkedUrl&&e&&o(e.href)&&r(e.extension)?e.href:t.attr("data-jpibfi-post-url")||window.location.href},t.prototype.generate=function(t){var e=t.closest("a[href]"),n=void 0;1===e.length&&(n={extension:i.getExtension(e.prop("href")),href:e.prop("href")});var r=this.getImage(t,n);if(void 0!==r){var o=encodeURIComponent(r),s=encodeURIComponent(this.getDescription(t)),a=encodeURIComponent(this.getUrl(t,n));return"https://pinterest.com/pin/create/bookmarklet/?is_video=false&url="+a+"&media="+o+"&description="+s}},t}();i["default"]=s},{"../common/description-helper":3,"../common/srcset-helper":4}],10:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(t,e,i,n){return t.top+n.top},r=function(t,e,i,n){return t.left+n.left},o=function(t,e,i,n){return e.top-i.height-n.bottom},s=function(t,e,i,n){return e.left-n.right-i.width},a=function(t,e,i){return t.top+((e.top-t.top)/2-i.height/2)},u=function(t,e,i){return t.left+((e.left-t.left)/2-i.width/2)},c=function(){function t(t,e){this.topF=t,this.leftF=e}return t.prototype.calculate=function(t,e,i,n){return{top:this.topF(t,e,i,n),left:this.leftF(t,e,i,n)}},t}(),l=function(t){switch(t){case"top-left":return new c(n,r);case"top-right":return new c(n,s);case"bottom-left":return new c(o,r);case"bottom-right":return new c(o,s);default:return new c(a,u)}},p=function(){function t(t,e){this.margins=e,this.positionCalculator=l(t)}return t.prototype.calculatePosition=function(t,e,i){return this.positionCalculator.calculate(t,e,i,this.margins)},t}();i["default"]=p},{}],11:[function(t,e,i){"use strict";var n=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();i.__esModule=!0;var r=t("./show-strategy"),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.init=function(){this.addContainers()},e.prototype.start=function(){var t=this;this.init();var e="data-jpibfi-timeout",i=0,n=function(e){return t.$("a.pinit-button["+t.indexerAttr+'="'+e+'"]')},r=this;r.$(document).delegate(this.settings.image_selector,"mouseenter",function(){var t=r.$(this);if(r.imageFilter.imageEligible(t)){var o=t.attr(r.indexerAttr);o||(o=i++,t.attr(r.indexerAttr,o));var s=n(o);if(0===s.length){var a=r.buttonGenerator.createButton(t);if(!a)return;t.addClass("pinit-hover");var u=r.buttonGenerator.getSize(),c=t.offset(),l={top:c.top+t[0].clientHeight,left:c.left+t[0].clientWidth},p=r.positioner.calculatePosition(c,l,u);t.after(a),a.attr(r.indexerAttr,o).css("visibility","hidden").show().offset(p).css("visibility","visible").hover(function(){return clearTimeout(a.attr(e))},function(){return a.attr(e,setTimeout(function(){t.removeClass("pinit-hover"),a.remove()},100))})}else clearTimeout(s.attr(e))}}),r.$(document).delegate(this.settings.image_selector,"mouseleave",function(){if(!r.logger.getFlag("prevent_hide")){var t=r.$(this),i=t.attr(r.indexerAttr);if(i){var o=n(i);o.attr(e,setTimeout(function(){t.removeClass("pinit-hover"),o.remove()},100))}}})},e}(r["default"]);i["default"]=o},{"./show-strategy":12}],12:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./image-filter"),r=t("./button-generator"),o=t("./positioner"),s=t("../common/css-generator"),a=function(){function t(t,e,i){this.$=t,this.settings=e,this.logger=i,this.imageFilter=new n["default"](e),this.buttonGenerator=new r["default"](t,e);var a={left:e.button_margin_left,top:e.button_margin_top,right:e.button_margin_right,bottom:e.button_margin_bottom};this.positioner=new o["default"](e.button_position,a),this.indexerAttr="data-jpibfi-indexer";var u=this.settings,c=u.pin_image,l=u.pin_image_icon,p=u.pinImageHeight,f=u.pinImageWidth,h=(u.scale_pin_image,{width:f,height:p});switch(c){case"custom":case"old_default":var d=s.createCssRulesForCustomButton;d(h);break;case"default":var d=s.createCssRulesForDefaultButton;d(h,l)}}return t.prototype.addContainers=function(){var t=this.$(".jpibfi"),e=t.closest("div, article");e=e.length?e:t.parent(),e.addClass("jpibfi_container")},t}();i["default"]=a},{"../common/css-generator":1,"./button-generator":6,"./image-filter":7,"./positioner":10}],13:[function(t,e,i){"use strict";i.__esModule=!0;var n=t("./settings"),r=t("./debugger"),o=t("./hover");!function(t){var e=function(){var e=window.jpibfi_options,i=new n["default"](t.extend({pageUrl:document.URL,pageTitle:document.title,pageDescription:t('meta[name="description"]').attr("content")||""},e.hover)),s=new r["default"]("jpibfi");window.jpibfi_debugger=s;var a=new o["default"](t,i,s);a.init()};t(document).ready(e)}(window.jQuery)},{"./debugger":5,"./hover":8,"./settings":14}],14:[function(t,e,i){"use strict";i.__esModule=!0;var n=function(){function t(t){var e=this;Object.keys(t).forEach(function(i){e[i]=t[i]}),this.isTouchDevice="ontouchstart"in window||{}.hasOwnProperty.call(navigator,"maxTouchPoints")}return t}();i["default"]=n},{}]},{},[13]);
languages/jquery-pin-it-button-for-images.pot CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2018 jquery-pin-it-button-for-images
2
# This file is distributed under the same license as the jquery-pin-it-button-for-images package.
3
msgid ""
4
msgstr ""
@@ -6,7 +6,7 @@ msgstr ""
6
"MIME-Version: 1.0\n"
7
"Content-Type: text/plain; charset=UTF-8\n"
8
"Content-Transfer-Encoding: 8bit\n"
9
- "PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
10
"Language-Team: Marcin Skrzypiec\n"
11
"X-Poedit-Basepath: ..\n"
12
"X-Poedit-SourceCharset: UTF-8\n"
@@ -15,6 +15,10 @@ msgstr ""
15
"X-Poedit-SearchPathExcluded-0: *.js\n"
16
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
18
#: includes/admin/JPIBFI_Welcome_Screen.php:49, includes/admin/JPIBFI_Welcome_Screen.php:51
19
msgid "Welcome to jQuery Pin It Button for Images"
20
msgstr ""
@@ -155,14 +159,10 @@ msgstr ""
155
msgid "If you cannot see the settings page, <a href=\"%s\" target=\"_blank\">click here</a>"
156
msgstr ""
157
158
- #: includes/admin/jpibfi-admin.php:387
159
msgid "<strong>jQuery Pin It Button for Images Pro</strong> is available. <a class=\"button button-primary\" href=\"%1$s\" target=\"_blank\">Check it out &rarr;</a>"
160
msgstr ""
161
162
- #: includes/admin/jpibfi-admin.php:405
163
- msgid "<strong>Image Auto Poster</strong>, plugin that allows you to pin your images directly from the post editor to your Pinterest account, is available on the WordPress.org repository. <a class=\"button button-primary\" href=\"%1$s\" target=\"_blank\">Check it out &rarr;</a>"
164
- msgstr ""
165
-
166
#: includes/admin/settings/jpibfi-advanced-settings.php:25
167
msgid "Filters"
168
msgstr ""
1
+ # Copyright (C) 2019 jquery-pin-it-button-for-images
2
# This file is distributed under the same license as the jquery-pin-it-button-for-images package.
3
msgid ""
4
msgstr ""
6
"MIME-Version: 1.0\n"
7
"Content-Type: text/plain; charset=UTF-8\n"
8
"Content-Transfer-Encoding: 8bit\n"
9
+ "PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
10
"Language-Team: Marcin Skrzypiec\n"
11
"X-Poedit-Basepath: ..\n"
12
"X-Poedit-SourceCharset: UTF-8\n"
15
"X-Poedit-SearchPathExcluded-0: *.js\n"
16
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
18
+ #: includes/admin/includes/JPIBFI_License_Nag.php:99
19
+ msgid "You have invalid or expired license key for jQuery Pin It Button for Images Pro. Please go to the <a href=\"%s\">License tab</a> to correct this issue or <a href=\"%s\">click here</a> if you renewed the license."
20
+ msgstr ""
21
+
22
#: includes/admin/JPIBFI_Welcome_Screen.php:49, includes/admin/JPIBFI_Welcome_Screen.php:51
23
msgid "Welcome to jQuery Pin It Button for Images"
24
msgstr ""
159
msgid "If you cannot see the settings page, <a href=\"%s\" target=\"_blank\">click here</a>"
160
msgstr ""
161
162
+ #: includes/admin/jpibfi-admin.php:403
163
msgid "<strong>jQuery Pin It Button for Images Pro</strong> is available. <a class=\"button button-primary\" href=\"%1$s\" target=\"_blank\">Check it out &rarr;</a>"
164
msgstr ""
165
166
#: includes/admin/settings/jpibfi-advanced-settings.php:25
167
msgid "Filters"
168
msgstr ""
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
Contributors: mrsztuczkens, redearthdesign, brocheafoin, robertark
3
Tags: pinterest, pin it, button, image, images, pinit, social media, hover, click, photo, photos
4
Requires at least: 3.3.0
5
- Tested up to: 4.9.1
6
- Stable tag: 3.0.2
7
License: GPLv2 or later
8
9
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
@@ -68,6 +68,14 @@ Please report them in the plugin's support forum on Wordpress.org.
68
69
== Changelog ==
70
71
= 3.0.2 =
72
* Released 2018-10-28
73
* Added support for data-pin-media and data-pin-url attributes.
@@ -377,6 +385,12 @@ Please report them in the plugin's support forum on Wordpress.org.
377
378
== Upgrade Notice ==
379
380
= 3.0.2 =
381
* Added support for data-pin-media and data-pin-url attributes.
382
2
Contributors: mrsztuczkens, redearthdesign, brocheafoin, robertark
3
Tags: pinterest, pin it, button, image, images, pinit, social media, hover, click, photo, photos
4
Requires at least: 3.3.0
5
+ Tested up to: 5.1.0
6
+ Stable tag: 3.0.4
7
License: GPLv2 or later
8
9
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
68
69
== Changelog ==
70
71
+ = 3.0.4 =
72
+ * Released 2019-02-25
73
+ * Removed advertisement link
74
+
75
+ = 3.0.3 =
76
+ * Released 2018-11-25
77
+ * Fixed an issue with srcset attribute
78
+
79
= 3.0.2 =
80
* Released 2018-10-28
81
* Added support for data-pin-media and data-pin-url attributes.
385
386
== Upgrade Notice ==
387
388
+ = 3.0.4 =
389
+ * Remove advertisement link
390
+
391
+ = 3.0.3 =
392
+ * Fixed an issue with srcset attribute
393
+
394
= 3.0.2 =
395
* Added support for data-pin-media and data-pin-url attributes.
396