jQuery Pin It Button for Images - Version 1.35

Version Description

  • Release 2014-06-20
  • Static mode is now disabled
Download this release

Release Info

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

Code changes from version 1.34 to 1.35

includes/admin/class-jpibfi-visual-options.php CHANGED
@@ -43,7 +43,6 @@ class JPIBFI_Visual_Options {
43
  'custom_image_width' => '0',
44
  'use_post_url' => '0',
45
  'button_position' => '0',
46
- 'mode' => 'static',
47
  'button_margin_top' => '20',
48
  'button_margin_right' => '20',
49
  'button_margin_bottom'=> '20',
@@ -66,17 +65,6 @@ class JPIBFI_Visual_Options {
66
  );
67
 
68
  //Then add all necessary fields to the section
69
- add_settings_field(
70
- 'mode',
71
- __( 'Mode', 'jpibfi' ),
72
- array( $this, 'mode_option_callback' ),
73
- 'jpibfi_visual_options',
74
- 'visual_options_section',
75
- array(
76
- __( 'Static mode adds a layer on the top of the image that restricts image download, but works on websites that protect images download. Dynamic mode doesn\'t add that layer and allows image download. If you\'re experiencing issues with static mode, try using dynamic mode.', 'jpibfi' ),
77
- )
78
- );
79
-
80
  add_settings_field(
81
  'description_option',
82
  __( 'Description source', 'jpibfi' ),
@@ -170,21 +158,6 @@ class JPIBFI_Visual_Options {
170
  echo '<p>' . __('How it should look like', 'jpibfi') . '</p>';
171
  }
172
 
173
- public function mode_option_callback( $args ) {
174
- $options = $this->get_visual_options();
175
- $mode = $options[ 'mode' ];
176
-
177
- ?>
178
-
179
- <select id="mode" name="jpibfi_visual_options[mode]">
180
- <option value="static" <?php selected ( "static", $mode ); ?>><?php _e( 'Static', 'jpibfi' ); ?></option>
181
- <option value="dynamic" <?php selected ( "dynamic", $mode ); ?>><?php _e( 'Dynamic', 'jpibfi' ); ?></option>
182
- </select>
183
-
184
- <?php
185
- echo JPIBFI_Admin_Utilities::create_description( $args[0] );
186
- }
187
-
188
  public function description_option_callback( $args ) {
189
  $options = $this->get_visual_options();
190
 
43
  'custom_image_width' => '0',
44
  'use_post_url' => '0',
45
  'button_position' => '0',
 
46
  'button_margin_top' => '20',
47
  'button_margin_right' => '20',
48
  'button_margin_bottom'=> '20',
65
  );
66
 
67
  //Then add all necessary fields to the section
 
 
 
 
 
 
 
 
 
 
 
68
  add_settings_field(
69
  'description_option',
70
  __( 'Description source', 'jpibfi' ),
158
  echo '<p>' . __('How it should look like', 'jpibfi') . '</p>';
159
  }
160
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  public function description_option_callback( $args ) {
162
  $options = $this->get_visual_options();
163
 
includes/public/class-jpibfi-client.php CHANGED
@@ -47,7 +47,6 @@ class JPIBFI_Client {
47
 
48
  if ( ! ( JPIBFI_Client_Utilities::add_jpibfi() ) )
49
  return;
50
- //TODO minify
51
  wp_enqueue_script( 'jquery-pin-it-button-script', JPIBFI_SCRIPT_URL . 'script.min.js', array( 'jquery' ), JPIBFI_VERSION . JPIBFI_VERSION_MINOR, false );
52
 
53
  $use_custom_image = isset( $jpibfi_visual_options[ 'use_custom_image' ] ) && $jpibfi_visual_options[ 'use_custom_image' ] == "1";
@@ -61,7 +60,6 @@ class JPIBFI_Client {
61
  'minImageHeight' => $jpibfi_selection_options['min_image_height'],
62
  'minImageWidth' => $jpibfi_selection_options['min_image_width'],
63
  'siteTitle' => get_bloginfo( 'name', 'display' ),
64
- 'mode' => $jpibfi_visual_options[ 'mode' ],
65
  'buttonPosition' => $jpibfi_visual_options[ 'button_position' ],
66
  'debug' => isset( $jpibfi_adanced_options[ 'debug'] ) ? $jpibfi_adanced_options[ 'debug'] : '0',
67
  'containerSelector' => $jpibfi_adanced_options[ 'container_selector'],
47
 
48
  if ( ! ( JPIBFI_Client_Utilities::add_jpibfi() ) )
49
  return;
 
50
  wp_enqueue_script( 'jquery-pin-it-button-script', JPIBFI_SCRIPT_URL . 'script.min.js', array( 'jquery' ), JPIBFI_VERSION . JPIBFI_VERSION_MINOR, false );
51
 
52
  $use_custom_image = isset( $jpibfi_visual_options[ 'use_custom_image' ] ) && $jpibfi_visual_options[ 'use_custom_image' ] == "1";
60
  'minImageHeight' => $jpibfi_selection_options['min_image_height'],
61
  'minImageWidth' => $jpibfi_selection_options['min_image_width'],
62
  'siteTitle' => get_bloginfo( 'name', 'display' ),
 
63
  'buttonPosition' => $jpibfi_visual_options[ 'button_position' ],
64
  'debug' => isset( $jpibfi_adanced_options[ 'debug'] ) ? $jpibfi_adanced_options[ 'debug'] : '0',
65
  'containerSelector' => $jpibfi_adanced_options[ 'container_selector'],
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.34
8
  Author URI: http://mrsztuczkens.me/
9
  */
10
 
@@ -47,7 +47,7 @@ if ( ! class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) :
47
  /* VERSIONING */
48
  //plugin version
49
  if ( ! defined( 'JPIBFI_VERSION' ) )
50
- define( 'JPIBFI_VERSION', '1.34' );
51
 
52
  //used in versioning css and js files
53
  if ( ! defined( 'JPIBFI_VERSION_MINOR' ) )
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.35
8
  Author URI: http://mrsztuczkens.me/
9
  */
10
 
47
  /* VERSIONING */
48
  //plugin version
49
  if ( ! defined( 'JPIBFI_VERSION' ) )
50
+ define( 'JPIBFI_VERSION', '1.35' );
51
 
52
  //used in versioning css and js files
53
  if ( ! defined( 'JPIBFI_VERSION_MINOR' ) )
js/script.js CHANGED
@@ -53,13 +53,7 @@
53
  jpibfiLog( 'Min width:' + jpibfi.settings.minImageWidth);
54
  jpibfiLog( 'Min height:' + jpibfi.settings.minImageHeight);
55
  var imageCount = 0;
56
- $elements.each(function () {
57
- var $image = $(this);
58
- if ( jpibfi.settings.mode == 'static' )
59
- jpibfiCreateAndShowOverlayDiv( $image, jpibfi.settings.buttonPosition );
60
-
61
- imageCount++;
62
- });
63
  jpibfiLog( 'Images caught after filtering: ' + imageCount );
64
  };
65
 
@@ -110,104 +104,84 @@
110
 
111
  //EVENT HANDLING - ADDING EVERY NEEDED EVENT
112
 
113
- if ( 'static' == jpibfi.settings.mode) {
114
-
115
- jpibfiLog( 'Adding static mode delegates');
 
116
 
117
- $( document).delegate( 'div.pinit-overlay', 'hover', function( event ) {
118
- var indexer = $(this).data("jpibfi-indexer");
119
- var $image = $('img[data-jpibfi-indexer="' + indexer + '"]');
 
 
 
 
 
120
 
121
- if (jpibfiCheckImageSize ( $image ) == false )
122
- return;
123
 
124
- var hover = event.type === 'mouseenter';
125
- $('.pinit-button[data-jpibfi-indexer="' + indexer + '"]').toggle( hover );
126
- $image.toggleClass( 'pinit-hover', hover );
127
- });
128
 
129
- } else if ( 'dynamic' == jpibfi.settings.mode ) {
 
130
 
131
- jpibfiLog( 'Adding dynamic mode delegates');
 
 
 
 
 
 
 
132
 
133
- $( document ).delegate( 'a.pinit-button', 'mouseenter', function() {
134
- var $button = $( this );
135
- clearTimeout( $button.data('jpibfi-timeoutId') );
136
- });
137
-
138
- $( document ).delegate( 'a.pinit-button', 'mouseleave', function() {
139
- var $button = $( this );
140
- var timeoutId = setTimeout( function(){
141
- $button.remove();
142
- $('img[data-jpibfi-indexer="' + $button.data( 'jpibfi-indexer' ) + '"]').removeClass( 'pinit-hover' );
143
- }, 100 );
144
- $button.data('jpibfi-timeoutId', timeoutId);
145
- });
146
-
147
- $( document ).delegate( 'img[data-jpibfi-indexer]', 'mouseenter', function() {
148
- var $image = $( this );
149
-
150
- if (jpibfiCheckImageSize ( $image) == false )
151
- return;
152
-
153
- var indexer = $image.data( 'jpibfi-indexer' );
154
- var $button = $('a.pinit-button[data-jpibfi-indexer="' + indexer + '"]');
155
-
156
- if ( $button.length == 0 ) {
157
- //button doesn't exist so we need to create it
158
- $button = jpibfiCreatePinitButton( indexer );
159
- var position = $image.offset();
160
- var imageDimensions = {
161
- width: $image.get(0).clientWidth,
162
- height: $image.get(0).clientHeight
163
- }
164
-
165
- switch( jpibfi.settings.buttonPosition ){
166
- case '0': //top-left
167
- position.left += pinButtonMargins.left;
168
- position.top += pinButtonMargins.top;
169
- break;
170
- case '1': //top-right
171
- position.top += pinButtonMargins.top;
172
- position.left = position.left + imageDimensions.width - pinButtonMargins.right - pinButtonDimensions.width;
173
- break;
174
- case '2': //bottom-left;
175
- position.left += pinButtonMargins.left;
176
- position.top = position.top + imageDimensions.height - pinButtonMargins.bottom - pinButtonDimensions.height;
177
- break;
178
- case '3': //bottom-right
179
- position.left = position.left + imageDimensions.width - pinButtonMargins.right - pinButtonDimensions.width;
180
- position.top = position.top + imageDimensions.height - pinButtonMargins.bottom - pinButtonDimensions.height;
181
- break;
182
- case '4': //middle
183
- position.left = Math.round( position.left + imageDimensions.width / 2 - pinButtonDimensions.width / 2 );
184
- position.top = Math.round( position.top + imageDimensions.height / 2 - pinButtonDimensions.height / 2 );
185
- break;
186
- }
187
-
188
- $image.after( $button );
189
- $button
190
- .show()
191
- .offset({ left: position.left, top: position.top });
192
- } else {
193
- //button exists, we need to clear the timeout that has to remove it
194
- clearTimeout( $button.data('jpibfi-timeoutId') );
195
  }
196
- $image.addClass( 'pinit-hover' );
197
- });
198
 
199
- $( document).delegate( 'img[data-jpibfi-indexer]', 'mouseleave', function() {
200
- var indexer = $(this).data("jpibfi-indexer");
201
- var $button = $('a.pinit-button[data-jpibfi-indexer="' + indexer + '"]');
 
 
 
 
 
 
 
202
 
203
- var timeoutId = setTimeout(function(){
204
- $button.remove();
205
- $('img[data-jpibfi-indexer="' + $button.data( 'jpibfi-indexer' ) + '"]').removeClass( 'pinit-hover' );
206
- }, 100 );
207
- $button.data('jpibfi-timeoutId', timeoutId);
208
- });
209
 
210
- }
 
 
 
 
 
211
  };
212
 
213
  return jpibfi;
@@ -265,44 +239,11 @@
265
  }
266
 
267
  function jpibfiCheckImageSize( $image ) {
268
- if ( $image[0].clientWidth < jpibfi.settings.minImageWidth || $image[0].clientHeight < jpibfi.settings.minImageHeight ) {
269
- $image.removeAttr( 'data-jpibfi-indexer' );
270
  return false;
271
- }
272
  return true;
273
  }
274
 
275
- function jpibfiCreateAndShowOverlayDiv( $image, buttonPosition ) {
276
- var position = $image.offset();
277
-
278
- var $overlay = jpibfiCreateOverlayDiv( $image, buttonPosition );
279
-
280
- $image.after( $overlay );
281
-
282
- $overlay
283
- .css({
284
- height: $image.get(0).clientHeight + 'px',
285
- width: $image.get(0).clientWidth + 'px'
286
- })
287
- .show()
288
- .offset({ left: position.left, top: position.top });
289
-
290
- return $overlay;
291
- }
292
-
293
- //function creates an overlay div that covers the image
294
- function jpibfiCreateOverlayDiv( $image, buttonPosition ) {
295
-
296
- var indexer = $image.data("jpibfi-indexer");
297
-
298
- return jQuery('<div/>', {
299
- "class": 'pinit-overlay',
300
- "data-jpibfi-indexer": indexer,
301
- title: $image.attr( 'title' ) || '',
302
- html: jpibfiCreatePinitButton( indexer).addClass( jpibfiButtonPositionToClass( buttonPosition ))
303
- })
304
- }
305
-
306
  /* PRIVATE UTILITY FUNCTIONS */
307
 
308
  //returns class name based on given button position
53
  jpibfiLog( 'Min width:' + jpibfi.settings.minImageWidth);
54
  jpibfiLog( 'Min height:' + jpibfi.settings.minImageHeight);
55
  var imageCount = 0;
56
+ $elements.each(function () { imageCount++; });
 
 
 
 
 
 
57
  jpibfiLog( 'Images caught after filtering: ' + imageCount );
58
  };
59
 
104
 
105
  //EVENT HANDLING - ADDING EVERY NEEDED EVENT
106
 
107
+ $( document ).delegate( 'a.pinit-button', 'mouseenter', function() {
108
+ var $button = $( this );
109
+ clearTimeout( $button.data('jpibfi-timeoutId') );
110
+ });
111
 
112
+ $( document ).delegate( 'a.pinit-button', 'mouseleave', function() {
113
+ var $button = $( this );
114
+ var timeoutId = setTimeout( function(){
115
+ $button.remove();
116
+ $('img[data-jpibfi-indexer="' + $button.data( 'jpibfi-indexer' ) + '"]').removeClass( 'pinit-hover' );
117
+ }, 100 );
118
+ $button.data('jpibfi-timeoutId', timeoutId);
119
+ });
120
 
121
+ $( document ).delegate( 'img[data-jpibfi-indexer]', 'mouseenter', function() {
122
+ var $image = $( this );
123
 
124
+ if (jpibfiCheckImageSize ( $image) == false ){
125
+ $image.removeAttr( 'data-jpibfi-indexer' );
126
+ return;
127
+ }
128
 
129
+ var indexer = $image.data( 'jpibfi-indexer' );
130
+ var $button = $('a.pinit-button[data-jpibfi-indexer="' + indexer + '"]');
131
 
132
+ if ( $button.length == 0 ) {
133
+ //button doesn't exist so we need to create it
134
+ $button = jpibfiCreatePinitButton( indexer );
135
+ var position = $image.offset();
136
+ var imageDimensions = {
137
+ width: $image.get(0).clientWidth,
138
+ height: $image.get(0).clientHeight
139
+ }
140
 
141
+ switch( jpibfi.settings.buttonPosition ){
142
+ case '0': //top-left
143
+ position.left += pinButtonMargins.left;
144
+ position.top += pinButtonMargins.top;
145
+ break;
146
+ case '1': //top-right
147
+ position.top += pinButtonMargins.top;
148
+ position.left = position.left + imageDimensions.width - pinButtonMargins.right - pinButtonDimensions.width;
149
+ break;
150
+ case '2': //bottom-left;
151
+ position.left += pinButtonMargins.left;
152
+ position.top = position.top + imageDimensions.height - pinButtonMargins.bottom - pinButtonDimensions.height;
153
+ break;
154
+ case '3': //bottom-right
155
+ position.left = position.left + imageDimensions.width - pinButtonMargins.right - pinButtonDimensions.width;
156
+ position.top = position.top + imageDimensions.height - pinButtonMargins.bottom - pinButtonDimensions.height;
157
+ break;
158
+ case '4': //middle
159
+ position.left = Math.round( position.left + imageDimensions.width / 2 - pinButtonDimensions.width / 2 );
160
+ position.top = Math.round( position.top + imageDimensions.height / 2 - pinButtonDimensions.height / 2 );
161
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  }
 
 
163
 
164
+ $image.after( $button );
165
+ $button
166
+ .show()
167
+ .offset({ left: position.left, top: position.top });
168
+ } else {
169
+ //button exists, we need to clear the timeout that has to remove it
170
+ clearTimeout( $button.data('jpibfi-timeoutId') );
171
+ }
172
+ $image.addClass( 'pinit-hover' );
173
+ });
174
 
175
+ $( document).delegate( 'img[data-jpibfi-indexer]', 'mouseleave', function() {
176
+ var indexer = $(this).data("jpibfi-indexer");
177
+ var $button = $('a.pinit-button[data-jpibfi-indexer="' + indexer + '"]');
 
 
 
178
 
179
+ var timeoutId = setTimeout(function(){
180
+ $button.remove();
181
+ $('img[data-jpibfi-indexer="' + $button.data( 'jpibfi-indexer' ) + '"]').removeClass( 'pinit-hover' );
182
+ }, 100 );
183
+ $button.data('jpibfi-timeoutId', timeoutId);
184
+ });
185
  };
186
 
187
  return jpibfi;
239
  }
240
 
241
  function jpibfiCheckImageSize( $image ) {
242
+ if ( $image[0].clientWidth < jpibfi.settings.minImageWidth || $image[0].clientHeight < jpibfi.settings.minImageHeight )
 
243
  return false;
 
244
  return true;
245
  }
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  /* PRIVATE UTILITY FUNCTIONS */
248
 
249
  //returns class name based on given button position
js/script.min.js CHANGED
@@ -1 +1 @@
1
- (function(e){"use strict";window.jpibfi=function(){function a(t){var n=jQuery("<a/>",{href:"#","class":"pinit-button","data-jpibfi-indexer":t,text:""});n.click(function(t){d("Pin In button clicked");var n=e(this).data("jpibfi-indexer");var r=e('img[data-jpibfi-indexer="'+n+'"]');var i="",s="",o="";if(u.settings.usePostUrl){var a=r.closest(".jpibfi_container").find("input.jpibfi").first();if(a.length){s=a.data("jpibfi-description");o=a.data("jpibfi-url")}}o=o||u.settings.pageUrl;if(u.settings.descriptionOption==3)i=r.attr("title")||r.attr("alt");else if(u.settings.descriptionOption==2)i=s||u.settings.pageDescription;else if(u.settings.descriptionOption==4)i=u.settings.siteTitle;else if(u.settings.descriptionOption==5)i=r.data("jpibfi-description");i=i||s||u.settings.pageTitle;var f="http://pinterest.com/pin/create/bookmarklet/?is_video="+encodeURIComponent("false")+"&url="+encodeURIComponent(o)+"&media="+encodeURIComponent(u.fn.getImageUrl(r))+"&description="+encodeURIComponent(i);window.open(f,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1");return false});return n}function f(e){if(e[0].clientWidth<u.settings.minImageWidth||e[0].clientHeight<u.settings.minImageHeight){e.removeAttr("data-jpibfi-indexer");return false}return true}function l(e,t){var n=e.offset();var r=c(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 c(e,t){var n=e.data("jpibfi-indexer");return jQuery("<div/>",{"class":"pinit-overlay","data-jpibfi-indexer":n,title:e.attr("title")||"",html:a(n).addClass(h(t))})}function h(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 p(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}function d(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)}}}var t=false;var n={};var r={};var i="";var s="*";var o=0;var u={};u.settings={};u.fn={};u.fn.getImageUrl=function(e){return e.data("media")||e.attr("src")};u.addImages=function(t){d(">>addImages");var n=e(t).not(i).not("[data-jpibfi-indexer]").filter(s);n.each(function(){e(this).attr("data-jpibfi-indexer",o);o++});d("Images caught by selectors: "+o);return n};u.prepareImages=function(t){d(">>Add Elements");d("Elements: "+t.length);d("Min width:"+u.settings.minImageWidth);d("Min height:"+u.settings.minImageHeight);var n=0;t.each(function(){var t=e(this);if(u.settings.mode=="static")l(t,u.settings.buttonPosition);n++});d("Images caught after filtering: "+n)};u.removeAllImages=function(){d("Remove Elements called");e("div.pinit-overlay").remove()};u.init=function(o){u.settings={pageUrl:document.URL,pageTitle:document.title,pageDescription:e('meta[name="description"]').attr("content")||""};u.settings=e.extend(u.settings,o);n={height:parseInt(o.pinImageHeight),width:parseInt(o.pinImageWidth)};r={top:parseInt(o.buttonMarginTop),right:parseInt(o.buttonMarginRight),bottom:parseInt(o.buttonMarginBottom),left:parseInt(o.buttonMarginLeft)};t="1"==o.debug;d(u.settings);d(n);d(r);var l=e(".jpibfi").closest(u.settings.containerSelector).addClass("jpibfi_container");d("Number of containers added: "+l.length);i=p(u.settings.disabledClasses);s=p(u.settings.enabledClasses)||"*";d("Filter selector: "+s);d("Not selector: "+i);if("static"==u.settings.mode){d("Adding static mode delegates");e(document).delegate("div.pinit-overlay","hover",function(t){var n=e(this).data("jpibfi-indexer");var r=e('img[data-jpibfi-indexer="'+n+'"]');if(f(r)==false)return;var i=t.type==="mouseenter";e('.pinit-button[data-jpibfi-indexer="'+n+'"]').toggle(i);r.toggleClass("pinit-hover",i)})}else if("dynamic"==u.settings.mode){d("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.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);if(f(t)==false)return;var i=t.data("jpibfi-indexer");var s=e('a.pinit-button[data-jpibfi-indexer="'+i+'"]');if(s.length==0){s=a(i);var o=t.offset();var l={width:t.get(0).clientWidth,height:t.get(0).clientHeight};switch(u.settings.buttonPosition){case"0":o.left+=r.left;o.top+=r.top;break;case"1":o.top+=r.top;o.left=o.left+l.width-r.right-n.width;break;case"2":o.left+=r.left;o.top=o.top+l.height-r.bottom-n.height;break;case"3":o.left=o.left+l.width-r.right-n.width;o.top=o.top+l.height-r.bottom-n.height;break;case"4":o.left=Math.round(o.left+l.width/2-n.width/2);o.top=Math.round(o.top+l.height/2-n.height/2);break}t.after(s);s.show().offset({left:o.left,top:o.top})}else{clearTimeout(s.data("jpibfi-timeoutId"))}t.addClass("pinit-hover")});e(document).delegate("img[data-jpibfi-indexer]","mouseleave",function(){var t=e(this).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.data("jpibfi-indexer")+'"]').removeClass("pinit-hover")},100);n.data("jpibfi-timeoutId",r)})}};return u;}()})(jQuery);(function(e){"use strict";e(document).ready(function(){jpibfi.init(jpibfi_options);e(document).trigger("jpibfi_beforeAddImages",{});jpibfi.addImages(jpibfi_options.imageSelector);e(document).trigger("jpibfi_afterAddImages",{});e(window).load(function(){jpibfi.prepareImages(e("img[data-jpibfi-indexer]"))});e(window).resize(function(){jpibfi.removeAllImages();jpibfi.prepareImages(e("img[data-jpibfi-indexer]"))})})})(jQuery)
1
+ (function(e){"use strict";window.jpibfi=function(){function a(t){var n=jQuery("<a/>",{href:"#","class":"pinit-button","data-jpibfi-indexer":t,text:""});n.click(function(t){h("Pin In button clicked");var n=e(this).data("jpibfi-indexer");var r=e('img[data-jpibfi-indexer="'+n+'"]');var i="",s="",o="";if(u.settings.usePostUrl){var a=r.closest(".jpibfi_container").find("input.jpibfi").first();if(a.length){s=a.data("jpibfi-description");o=a.data("jpibfi-url")}}o=o||u.settings.pageUrl;if(u.settings.descriptionOption==3)i=r.attr("title")||r.attr("alt");else if(u.settings.descriptionOption==2)i=s||u.settings.pageDescription;else if(u.settings.descriptionOption==4)i=u.settings.siteTitle;else if(u.settings.descriptionOption==5)i=r.data("jpibfi-description");i=i||s||u.settings.pageTitle;var f="http://pinterest.com/pin/create/bookmarklet/?is_video="+encodeURIComponent("false")+"&url="+encodeURIComponent(o)+"&media="+encodeURIComponent(u.fn.getImageUrl(r))+"&description="+encodeURIComponent(i);window.open(f,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1");return false});return n}function f(e){if(e[0].clientWidth<u.settings.minImageWidth||e[0].clientHeight<u.settings.minImageHeight)return false;return true}function l(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 c(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}function h(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)}}}var t=false;var n={};var r={};var i="";var s="*";var o=0;var u={};u.settings={};u.fn={};u.fn.getImageUrl=function(e){return e.data("media")||e.attr("src")};u.addImages=function(t){h(">>addImages");var n=e(t).not(i).not("[data-jpibfi-indexer]").filter(s);n.each(function(){e(this).attr("data-jpibfi-indexer",o);o++});h("Images caught by selectors: "+o);return n};u.prepareImages=function(e){h(">>Add Elements");h("Elements: "+e.length);h("Min width:"+u.settings.minImageWidth);h("Min height:"+u.settings.minImageHeight);var t=0;e.each(function(){t++});h("Images caught after filtering: "+t)};u.removeAllImages=function(){h("Remove Elements called");e("div.pinit-overlay").remove()};u.init=function(o){u.settings={pageUrl:document.URL,pageTitle:document.title,pageDescription:e('meta[name="description"]').attr("content")||""};u.settings=e.extend(u.settings,o);n={height:parseInt(o.pinImageHeight),width:parseInt(o.pinImageWidth)};r={top:parseInt(o.buttonMarginTop),right:parseInt(o.buttonMarginRight),bottom:parseInt(o.buttonMarginBottom),left:parseInt(o.buttonMarginLeft)};t="1"==o.debug;h(u.settings);h(n);h(r);var l=e(".jpibfi").closest(u.settings.containerSelector).addClass("jpibfi_container");h("Number of containers added: "+l.length);i=c(u.settings.disabledClasses);s=c(u.settings.enabledClasses)||"*";h("Filter selector: "+s);h("Not selector: "+i);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.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);if(f(t)==false){t.removeAttr("data-jpibfi-indexer");return}var i=t.data("jpibfi-indexer");var s=e('a.pinit-button[data-jpibfi-indexer="'+i+'"]');if(s.length==0){s=a(i);var o=t.offset();var l={width:t.get(0).clientWidth,height:t.get(0).clientHeight};switch(u.settings.buttonPosition){case"0":o.left+=r.left;o.top+=r.top;break;case"1":o.top+=r.top;o.left=o.left+l.width-r.right-n.width;break;case"2":o.left+=r.left;o.top=o.top+l.height-r.bottom-n.height;break;case"3":o.left=o.left+l.width-r.right-n.width;o.top=o.top+l.height-r.bottom-n.height;break;case"4":o.left=Math.round(o.left+l.width/2-n.width/2);o.top=Math.round(o.top+l.height/2-n.height/2);break}t.after(s);s.show().offset({left:o.left,top:o.top})}else{clearTimeout(s.data("jpibfi-timeoutId"))}t.addClass("pinit-hover")});e(document).delegate("img[data-jpibfi-indexer]","mouseleave",function(){var t=e(this).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.data("jpibfi-indexer")+'"]').removeClass("pinit-hover")},100);n.data("jpibfi-timeoutId",r)})};return u;}()})(jQuery);(function(e){"use strict";e(document).ready(function(){jpibfi.init(jpibfi_options);e(document).trigger("jpibfi_beforeAddImages",{});jpibfi.addImages(jpibfi_options.imageSelector);e(document).trigger("jpibfi_afterAddImages",{});e(window).load(function(){jpibfi.prepareImages(e("img[data-jpibfi-indexer]"))});e(window).resize(function(){jpibfi.removeAllImages();jpibfi.prepareImages(e("img[data-jpibfi-indexer]"))})})})(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.9
7
- Stable tag: 1.34
8
  License: GPLv2 or later
9
 
10
  Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
@@ -76,6 +76,10 @@ Please report them in the plugin's support forum on Wordpress.org.
76
 
77
  == Changelog ==
78
 
 
 
 
 
79
  = 1.34 =
80
  * Release 2014-06-16
81
  * Added support for plugins lazy loading images
@@ -210,6 +214,9 @@ Please report them in the plugin's support forum on Wordpress.org.
210
 
211
  == Upgrade Notice ==
212
 
 
 
 
213
  = 1.34 =
214
  Minor update.
215
 
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.9
7
+ Stable tag: 1.35
8
  License: GPLv2 or later
9
 
10
  Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
76
 
77
  == Changelog ==
78
 
79
+ = 1.35 =
80
+ * Release 2014-06-20
81
+ * Static mode is now disabled
82
+
83
  = 1.34 =
84
  * Release 2014-06-16
85
  * Added support for plugins lazy loading images
214
 
215
  == Upgrade Notice ==
216
 
217
+ = 1.35 =
218
+ Static mode is now disabled.
219
+
220
  = 1.34 =
221
  Minor update.
222