jQuery Pin It Button for Images - Version 1.37

Version Description

  • Release 2014-08-05
  • Additional option in the description source setting
  • Issue with saving checkboxes fixed
Download this release

Release Info

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

Code changes from version 1.35 to 1.37

includes/admin/class-jpibfi-admin.php CHANGED
@@ -4,10 +4,13 @@ class JPIBFI_Admin {
4
 
5
  protected static $instance = null;
6
 
 
 
7
  private function __construct() {
8
  add_action( 'admin_menu', array( $this, 'print_admin_page_action') );
9
  add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
10
  add_action( 'save_post', array( $this, 'save_meta_data' ) );
 
11
  }
12
 
13
  public static function get_instance() {
@@ -20,7 +23,7 @@ class JPIBFI_Admin {
20
  }
21
 
22
  public function print_admin_page_action() {
23
- $page = add_submenu_page(
24
  'options-general.php',
25
  'jQuery Pin It Button For Images', // The value used to populate the browser's title bar when the menu page is active
26
  'jQuery Pin It Button For Images', // The text of the menu in the administrator's sidebar
@@ -29,7 +32,7 @@ class JPIBFI_Admin {
29
  array( $this, 'print_admin_page' ) // The callback function used to render this menu
30
  );
31
 
32
- add_action( 'admin_print_styles-' . $page, array( $this, 'add_admin_site_scripts') );
33
  }
34
 
35
  /* Adds admin scripts */
@@ -60,19 +63,16 @@ class JPIBFI_Admin {
60
  'settings_name' => 'jpibfi_selection_options',
61
  'tab_label' => __( 'Selection', 'jpibfi' ),
62
  'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
63
- 'review_link' => 'http://wordpress.org/support/view/plugin-reviews/jquery-pin-it-button-for-images'
64
  ),
65
  'visual_options' => array(
66
  'settings_name' => 'jpibfi_visual_options',
67
  'tab_label' => __( 'Visual', 'jpibfi' ),
68
  'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
69
- 'review_link' => 'http://wordpress.org/support/view/plugin-reviews/jquery-pin-it-button-for-images'
70
  ),
71
  'advanced_options' => array(
72
  'settings_name' => 'jpibfi_advanced_options',
73
  'tab_label' => __('Advanced', 'jpibfi' ),
74
  'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
75
- 'review_link' => 'http://wordpress.org/support/view/plugin-reviews/jquery-pin-it-button-for-images'
76
  )
77
  );
78
 
@@ -141,6 +141,13 @@ class JPIBFI_Admin {
141
  else
142
  delete_post_meta( $post_id, JPIBFI_METADATA );
143
  }
 
 
 
 
 
 
 
144
  }
145
 
146
  add_action( 'plugins_loaded', array( 'JPIBFI_Admin', 'get_instance' ) );
4
 
5
  protected static $instance = null;
6
 
7
+ private $admin_screen_hook = null;
8
+
9
  private function __construct() {
10
  add_action( 'admin_menu', array( $this, 'print_admin_page_action') );
11
  add_action( 'add_meta_boxes', array( $this, 'add_meta_box' ) );
12
  add_action( 'save_post', array( $this, 'save_meta_data' ) );
13
+ add_action( 'admin_notices', array( $this, 'show_admin_notice') );
14
  }
15
 
16
  public static function get_instance() {
23
  }
24
 
25
  public function print_admin_page_action() {
26
+ $this->admin_screen_hook = add_submenu_page(
27
  'options-general.php',
28
  'jQuery Pin It Button For Images', // The value used to populate the browser's title bar when the menu page is active
29
  'jQuery Pin It Button For Images', // The text of the menu in the administrator's sidebar
32
  array( $this, 'print_admin_page' ) // The callback function used to render this menu
33
  );
34
 
35
+ add_action( 'admin_print_styles-' . $this->admin_screen_hook, array( $this, 'add_admin_site_scripts') );
36
  }
37
 
38
  /* Adds admin scripts */
63
  'settings_name' => 'jpibfi_selection_options',
64
  'tab_label' => __( 'Selection', 'jpibfi' ),
65
  'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
 
66
  ),
67
  'visual_options' => array(
68
  'settings_name' => 'jpibfi_visual_options',
69
  'tab_label' => __( 'Visual', 'jpibfi' ),
70
  'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
 
71
  ),
72
  'advanced_options' => array(
73
  'settings_name' => 'jpibfi_advanced_options',
74
  'tab_label' => __('Advanced', 'jpibfi' ),
75
  'support_link' => 'http://wordpress.org/support/plugin/jquery-pin-it-button-for-images',
 
76
  )
77
  );
78
 
141
  else
142
  delete_post_meta( $post_id, JPIBFI_METADATA );
143
  }
144
+
145
+ function show_admin_notice() {
146
+ global $hook_suffix;
147
+ if ( $this->admin_screen_hook == $hook_suffix ) {
148
+ include_once( 'views/notice.php');
149
+ }
150
+ }
151
  }
152
 
153
  add_action( 'plugins_loaded', array( 'JPIBFI_Admin', 'get_instance' ) );
includes/admin/class-jpibfi-selection-options.php CHANGED
@@ -37,6 +37,16 @@ class JPIBFI_Selection_Options {
37
  return apply_filters('jpibfi_default_selection_options', $defaults);
38
  }
39
 
 
 
 
 
 
 
 
 
 
 
40
  /*
41
  * Defines selection options section and adds all required fields
42
  */
@@ -284,6 +294,13 @@ class JPIBFI_Selection_Options {
284
 
285
  }
286
 
 
 
 
 
 
 
 
287
  $errors = get_settings_errors();
288
 
289
  if ( count( $errors ) > 0 ) {
37
  return apply_filters('jpibfi_default_selection_options', $defaults);
38
  }
39
 
40
+ private function get_checkbox_settings(){
41
+ return array(
42
+ 'show_on_home',
43
+ 'show_on_single',
44
+ 'show_on_page',
45
+ 'show_on_category',
46
+ 'show_on_blog'
47
+ );
48
+ }
49
+
50
  /*
51
  * Defines selection options section and adds all required fields
52
  */
294
 
295
  }
296
 
297
+ $checkbox_settings = $this->get_checkbox_settings();
298
+ foreach($checkbox_settings as $setting_name){
299
+ if (false == array_key_exists( $setting_name, $input) ){
300
+ $input[ $setting_name ] = '0';
301
+ }
302
+ }
303
+
304
  $errors = get_settings_errors();
305
 
306
  if ( count( $errors ) > 0 ) {
includes/admin/class-jpibfi-visual-options.php CHANGED
@@ -53,6 +53,14 @@ class JPIBFI_Visual_Options {
53
  return apply_filters( 'jpibfi_default_visual_options', $defaults );
54
  }
55
 
 
 
 
 
 
 
 
 
56
  /* Defines visual options section and defines all required fields */
57
  public function initialize_visual_options() {
58
 
@@ -171,6 +179,7 @@ class JPIBFI_Visual_Options {
171
  <option value="3" <?php selected ( "3", $description_option ); ?>><?php _e( 'Picture title or (if title not available) alt attribute', 'jpibfi' ); ?></option>
172
  <option value="4" <?php selected ( "4", $description_option ); ?>><?php _e( 'Site title (Settings->General)', 'jpibfi' ); ?></option>
173
  <option value="5" <?php selected ( "5", $description_option ); ?>><?php _e( 'Image description', 'jpibfi' ); ?></option>
 
174
  </select>
175
 
176
  <?php
@@ -335,6 +344,12 @@ class JPIBFI_Visual_Options {
335
  }
336
  }
337
 
 
 
 
 
 
 
338
  $errors = get_settings_errors();
339
 
340
  if ( count( $errors ) > 0 ) {
53
  return apply_filters( 'jpibfi_default_visual_options', $defaults );
54
  }
55
 
56
+ function get_checkbox_settings() {
57
+ return array(
58
+ 'use_post_url',
59
+ 'retina_friendly',
60
+ 'use_custom_image'
61
+ );
62
+ }
63
+
64
  /* Defines visual options section and defines all required fields */
65
  public function initialize_visual_options() {
66
 
179
  <option value="3" <?php selected ( "3", $description_option ); ?>><?php _e( 'Picture title or (if title not available) alt attribute', 'jpibfi' ); ?></option>
180
  <option value="4" <?php selected ( "4", $description_option ); ?>><?php _e( 'Site title (Settings->General)', 'jpibfi' ); ?></option>
181
  <option value="5" <?php selected ( "5", $description_option ); ?>><?php _e( 'Image description', 'jpibfi' ); ?></option>
182
+ <option value="6" <?php selected ( "6", $description_option ); ?>><?php _e( 'Image alt attribute', 'jpibfi' ); ?></option>
183
  </select>
184
 
185
  <?php
344
  }
345
  }
346
 
347
+ $checkbox_settings = $this->get_checkbox_settings();
348
+ foreach($checkbox_settings as $setting_name){
349
+ if (false == array_key_exists( $setting_name, $input) )
350
+ $input[ $setting_name ] = '0';
351
+ }
352
+
353
  $errors = get_settings_errors();
354
 
355
  if ( count( $errors ) > 0 ) {
includes/admin/views/admin.php CHANGED
@@ -26,7 +26,6 @@ $current_settings = $settings_tabs[ $tab ];
26
  <a href="http://mrsztuczkens.me/jquery-pin-it-button-for-images-extensions/" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Plugin Extensions', 'jpibfi' ); ?></b></a>
27
  <a href="http://bit.ly/Uw2mEP" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Donate', 'jpibfi' ); ?></b></a>
28
  <a href="<?php echo $current_settings['support_link']; ?>" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Support forum', 'jpibfi' ); ?></b></a>
29
- <a href="<?php echo $current_settings['review_link']; ?>" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Leave a review', 'jpibfi' ); ?></b></a>
30
  </p>
31
  <form method="post" action="options.php" ng-app="jpibfiApp" ng-controller="jpibfiController">
32
  <?php
26
  <a href="http://mrsztuczkens.me/jquery-pin-it-button-for-images-extensions/" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Plugin Extensions', 'jpibfi' ); ?></b></a>
27
  <a href="http://bit.ly/Uw2mEP" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Donate', 'jpibfi' ); ?></b></a>
28
  <a href="<?php echo $current_settings['support_link']; ?>" class="button" target="_blank" rel="nofollow"><b><?php _e( 'Support forum', 'jpibfi' ); ?></b></a>
 
29
  </p>
30
  <form method="post" action="options.php" ng-app="jpibfiApp" ng-controller="jpibfiController">
31
  <?php
includes/admin/views/notice.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <div class="updated">
2
+ <p><?php _e('<strong>jQuery Pin It Button for Images</strong> is no longer being actively developed. There will be only minor bug fix releases in the future.', 'jpibfi'); ?></p>
3
+ <p><?php _e('However, there is a new, much more powerful plugin that allows to Pin your images and much more - <strong>Frizzly</strong>.', 'jpibfi'); ?></p>
4
+ <p><a style="font-weight: bold;" class="button button-primary" href="http://wordpress.org/plugins/frizzly/" target="_blank"><?php _e('Check out Frizzly on the official WordPress repository', 'jpibfi'); ?></a></p>
5
+ </div>
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.35
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.35' );
51
 
52
  //used in versioning css and js files
53
  if ( ! defined( 'JPIBFI_VERSION_MINOR' ) )
@@ -153,24 +153,22 @@ if ( ! class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) :
153
  update_option( JPIBFI_VERSION_OPTION, JPIBFI_VERSION );
154
  //update not needed anymore
155
  update_option( JPIBFI_UPDATE_OPTIONS, false);
 
 
156
  }
157
  }
158
 
 
 
 
 
159
  /* Function makes sure that option has all needed fields by checking with defaults */
160
  public static function update_option_fields( $option, $default_option, $option_name ) {
161
 
162
- $new_option = array();
163
-
164
  if ( false == $option )
165
  $option = array();
166
 
167
- foreach ($default_option as $key => $value ) {
168
- if ( false == array_key_exists( $key, $option ) )
169
- $new_option [ $key ] = $value;
170
- else
171
- $new_option [ $key ] = $option [ $key ];
172
- }
173
-
174
  update_option( $option_name, $new_option );
175
  }
176
  }
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.37
8
  Author URI: http://mrsztuczkens.me/
9
  */
10
 
47
  /* VERSIONING */
48
  //plugin version
49
  if ( ! defined( 'JPIBFI_VERSION' ) )
50
+ define( 'JPIBFI_VERSION', '1.37' );
51
 
52
  //used in versioning css and js files
53
  if ( ! defined( 'JPIBFI_VERSION_MINOR' ) )
153
  update_option( JPIBFI_VERSION_OPTION, JPIBFI_VERSION );
154
  //update not needed anymore
155
  update_option( JPIBFI_UPDATE_OPTIONS, false);
156
+
157
+ add_action( 'admin_notices', array( $this, 'show_admin_notice') );
158
  }
159
  }
160
 
161
+ public function show_admin_notice(){
162
+ include_once( 'includes/admin/views/notice.php');
163
+ }
164
+
165
  /* Function makes sure that option has all needed fields by checking with defaults */
166
  public static function update_option_fields( $option, $default_option, $option_name ) {
167
 
 
 
168
  if ( false == $option )
169
  $option = array();
170
 
171
+ $new_option = array_merge($default_option, $option);
 
 
 
 
 
 
172
  update_option( $option_name, $new_option );
173
  }
174
  }
js/script.js CHANGED
@@ -26,7 +26,7 @@
26
  jpibfi.fn = {};
27
 
28
  jpibfi.fn.getImageUrl = function( $elem ) {
29
- return $elem.data('media') || $elem.attr('src');
30
  };
31
 
32
  /* FUNCTIONS THAT SHOULDN'T BE OVERRIDDEN */
@@ -224,6 +224,8 @@
224
  bookmarkDescription = jpibfi.settings.siteTitle;
225
  else if ( jpibfi.settings.descriptionOption == 5 )
226
  bookmarkDescription = $image.data( 'jpibfi-description' );
 
 
227
 
228
  bookmarkDescription = bookmarkDescription || ( descriptionForUrl || jpibfi.settings.pageTitle );
229
 
26
  jpibfi.fn = {};
27
 
28
  jpibfi.fn.getImageUrl = function( $elem ) {
29
+ return ($.fn.prop && $elem.prop('src')) || $elem.attr('src');
30
  };
31
 
32
  /* FUNCTIONS THAT SHOULDN'T BE OVERRIDDEN */
224
  bookmarkDescription = jpibfi.settings.siteTitle;
225
  else if ( jpibfi.settings.descriptionOption == 5 )
226
  bookmarkDescription = $image.data( 'jpibfi-description' );
227
+ else if ( jpibfi.settings.descriptionOption == 6 )
228
+ bookmarkDescription = $image.attr('alt');
229
 
230
  bookmarkDescription = bookmarkDescription || ( descriptionForUrl || jpibfi.settings.pageTitle );
231
 
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){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)
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");else if(u.settings.descriptionOption==6)i=r.attr("alt");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(t){return e.fn.prop&&t.prop("src")||t.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.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,6 +76,11 @@ Please report them in the plugin's support forum on Wordpress.org.
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
79
  = 1.35 =
80
  * Release 2014-06-20
81
  * Static mode is now disabled
@@ -214,6 +219,9 @@ Please report them in the plugin's support forum on Wordpress.org.
214
 
215
  == Upgrade Notice ==
216
 
 
 
 
217
  = 1.35 =
218
  Static mode is now disabled.
219
 
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.37
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.37 =
80
+ * Release 2014-08-05
81
+ * Additional option in the description source setting
82
+ * Issue with saving checkboxes fixed
83
+
84
  = 1.35 =
85
  * Release 2014-06-20
86
  * Static mode is now disabled
219
 
220
  == Upgrade Notice ==
221
 
222
+ = 1.37 =
223
+ Additional setting in the description source setting. Small bug fix.
224
+
225
  = 1.35 =
226
  Static mode is now disabled.
227