jQuery Pin It Button for Images - Version 0.9.95

Version Description

  • Released 2013-04-28
  • Bug fixed: issue with pinning images with hashtags in their title/alt
  • New feature: possibility to change the position of the "Pin it" button
Download this release

Release Info

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

Code changes from version 0.9.9 to 0.9.95

css/admin.css CHANGED
@@ -28,6 +28,10 @@
28
width: 180px;
29
}
30
31
.jpibfi-success-message, .jpibfi-error-message {
32
border: 1px solid;
33
border-radius: 10px;
28
width: 180px;
29
}
30
31
+ .settings-table textarea:disabled {
32
+ background-color: #E0E0E0;
33
+ }
34
+
35
.jpibfi-success-message, .jpibfi-error-message {
36
border: 1px solid;
37
border-radius: 10px;
css/style.css CHANGED
@@ -5,6 +5,11 @@
5
max-width: 100%;
6
}
7
8
.pinit .pinit-overlay {
9
position:absolute;
10
top:0;
@@ -17,10 +22,7 @@
17
}
18
19
.pinit .pinit-overlay a {
20
- position:relative;
21
- top:0%;
22
- left:0%;
23
- margin:20px 0 0 20px;
24
display:block;
25
text-indent:-9999em;
26
}
5
max-width: 100%;
6
}
7
8
+ .pinit.aligncenter {
9
+ clear: both;
10
+ display: block;
11
+ }
12
+
13
.pinit .pinit-overlay {
14
position:absolute;
15
top:0;
22
}
23
24
.pinit .pinit-overlay a {
25
+ position:absolute;
26
display:block;
27
text-indent:-9999em;
28
}
jpibfi-admin.php CHANGED
@@ -20,9 +20,12 @@ function jpibfi_conditional( $condition, $true_value = "", $false_value = "", $e
20
21
//Prints out the admin page
22
function jpibfi_print_admin_page() {
23
24
$dev_options = jpibfi_get_basic_options();
25
$advanced_dev_options = jpibfi_get_advanced_options();
26
$errors = array(
27
'disabled_classes' => false,
28
'enabled_classes' => false,
@@ -61,23 +64,29 @@ function jpibfi_print_admin_page() {
61
$dev_options['description_option'] = $_POST['description_option'];
62
$dev_options['min_image_height'] = $_POST['min_image_height'];
63
$dev_options['min_image_width'] = $_POST['min_image_width'];
64
- $dev_options['use_custom_image'] = ( isset( $_POST['use_custom_image'] ) && $_POST['use_custom_image'] == "1" ) ? "1" : "0";
65
66
$dev_options['custom_image_url'] = $_POST['custom_image_url'];
67
$dev_options['custom_image_height'] = $_POST['custom_image_height'];
68
$dev_options['custom_image_width'] = $_POST['custom_image_width'];
69
70
- $dev_options['use_post_url'] = ( isset($_POST['use_post_url']) && $_POST['use_post_url'] == "1" ) ? "1" : "0";
71
-
72
73
if ( $dev_options['compatibility_mode'] == '0' )
74
$errors['transparency_value'] = ! is_numeric( $dev_options['transparency_value'] ) || ( $dev_options['transparency_value'] < 0.0 ) || ( $dev_options['transparency_value'] > 1.0 );
75
76
- $advanced_dev_options['on_home'] = ( isset( $_POST['on_home'] ) && $_POST['on_home'] == '1' ) ? '1' : '0';
77
- $advanced_dev_options['on_page'] = ( isset( $_POST['on_page'] ) && $_POST['on_page']== '1' ) ? '1' : '0';
78
- $advanced_dev_options['on_single'] = ( isset( $_POST['on_single'] ) && $_POST['on_single'] == '1' ) ? '1' : '0';
79
- $advanced_dev_options['on_category'] = ( isset( $_POST['on_category'] ) && $_POST['on_category'] == '1' ) ? '1' : '0';
80
- $advanced_dev_options['on_blog'] = ( isset( $_POST['on_blog'] ) && $_POST['on_blog'] == '1' ) ? '1' : '0';
81
82
$any_errors = false;
83
foreach ( $errors as $value )
@@ -86,6 +95,9 @@ function jpibfi_print_admin_page() {
86
if ( ! $any_errors ) { //save only if there are no errors
87
update_option( JPIBFI_BASIC_OPTIONS, $dev_options );
88
update_option( JPIBFI_ADVANCED_OPTIONS, $advanced_dev_options );
89
?>
90
<p class='jpibfi-success-message'><?php _e( "Settings Updated.", "jpibfi" );?></p>
91
<?php
@@ -123,7 +135,7 @@ function jpibfi_print_admin_page() {
123
124
<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
125
<?php wp_nonce_field( "jpibfi_admin_settings", 'jpibfi_nonce' ); ?>
126
- <h3>Which images should be pinned</h3>
127
<hr/>
128
129
<table class="settings-table">
@@ -282,6 +294,18 @@ function jpibfi_print_admin_page() {
282
</p>
283
</td>
284
</tr>
285
<tr>
286
<th scope="row"><label>Preview</label></th>
287
<td>
20
21
//Prints out the admin page
22
function jpibfi_print_admin_page() {
23
+ global $jpibfi_button_dropdown;
24
+ global $jpibfi_button_css;
25
26
$dev_options = jpibfi_get_basic_options();
27
$advanced_dev_options = jpibfi_get_advanced_options();
28
+ $custom_button_css = jpibfi_get_button_css();
29
$errors = array(
30
'disabled_classes' => false,
31
'enabled_classes' => false,
64
$dev_options['description_option'] = $_POST['description_option'];
65
$dev_options['min_image_height'] = $_POST['min_image_height'];
66
$dev_options['min_image_width'] = $_POST['min_image_width'];
67
+ $dev_options['use_custom_image'] = isset( $_POST['use_custom_image'] )? "1" : "0";
68
69
$dev_options['custom_image_url'] = $_POST['custom_image_url'];
70
$dev_options['custom_image_height'] = $_POST['custom_image_height'];
71
$dev_options['custom_image_width'] = $_POST['custom_image_width'];
72
73
+ $dev_options['use_post_url'] = isset( $_POST['use_post_url'] ) ? "1" : "0";
74
+ $dev_options['button_position'] = $_POST['button_position'];
75
76
if ( $dev_options['compatibility_mode'] == '0' )
77
$errors['transparency_value'] = ! is_numeric( $dev_options['transparency_value'] ) || ( $dev_options['transparency_value'] < 0.0 ) || ( $dev_options['transparency_value'] > 1.0 );
78
79
+ $advanced_dev_options['on_home'] = isset( $_POST['on_home'] ) ? '1' : '0';
80
+ $advanced_dev_options['on_page'] = isset( $_POST['on_page'] ) ? '1' : '0';
81
+ $advanced_dev_options['on_single'] = isset( $_POST['on_single'] ) ? '1' : '0';
82
+ $advanced_dev_options['on_category'] = isset( $_POST['on_category'] ) ? '1' : '0';
83
+ $advanced_dev_options['on_blog'] = isset( $_POST['on_blog'] ) ? '1' : '0';
84
+
85
+ // 5 means we need to use custom CSS
86
+ if ( "5" == $dev_options['button_position'] )
87
+ $custom_button_css = $_POST['custom_button_css'];
88
+ else
89
+ $custom_button_css = $jpibfi_button_css[$dev_options['button_position']];
90
91
$any_errors = false;
92
foreach ( $errors as $value )
95
if ( ! $any_errors ) { //save only if there are no errors
96
update_option( JPIBFI_BASIC_OPTIONS, $dev_options );
97
update_option( JPIBFI_ADVANCED_OPTIONS, $advanced_dev_options );
98
+ update_option( JPIBFI_BUTTON_CUSTOM_CSS, $custom_button_css );
99
+ //delete_option( JPIBFI_BUTTON_CUSTOM_CSS );
100
+
101
?>
102
<p class='jpibfi-success-message'><?php _e( "Settings Updated.", "jpibfi" );?></p>
103
<?php
135
136
<form method="post" action="<?php echo $_SERVER["REQUEST_URI"]; ?>">
137
<?php wp_nonce_field( "jpibfi_admin_settings", 'jpibfi_nonce' ); ?>
138
+ <h3>Which images can be pinned</h3>
139
<hr/>
140
141
<table class="settings-table">
294
</p>
295
</td>
296
</tr>
297
+ <tr>
298
+ <th scope="row"><label for="button_position">Pin it button position</label></th>
299
+ <td>
300
+ <select name="button_position" id="button_position">
301
+ <?php foreach( $jpibfi_button_dropdown as $key => $value ) { ?>
302
+ <option value="<?php echo $key; ?>" <?php selected( $key, $dev_options['button_position'] ); ?>><?php echo $value; ?></option>
303
+ <?php } ?>
304
+ </select><br/>
305
+ <textarea id="custom_button_css" rows="5" name="custom_button_css"><?php echo $custom_button_css; ?></textarea>
306
+
307
+ </td>
308
+ </tr>
309
<tr>
310
<th scope="row"><label>Preview</label></th>
311
<td>
jpibfi-constants.php CHANGED
@@ -5,9 +5,10 @@ if ( ! function_exists( 'add_action' ) ) {
5
exit;
6
}
7
8
- define( "JPIBFI_VERSION", "0.9.9" );
9
define( "JPIBFI_BASIC_OPTIONS", "jptbfi_options" );
10
define( "JPIBFI_ADVANCED_OPTIONS", "jptbfi_advanced_options" );
11
define( "JPIBFI_METADATA", "jpibfi_meta");
12
13
//DEFAULT PIN BUTTON IMAGE
@@ -15,4 +16,19 @@ define( "JPIBFI_IMAGE_URL", plugins_url( '/images/pinit-button.png', __FILE__ )
15
define( "JPIBFI_IMAGE_WIDTH", 65 );
16
define( "JPIBFI_IMAGE_HEIGHT", 41 );
17
18
- define( "JPIBFI_PREVIEW_IMAGE_ID", "jpibfi_preview_image" );
5
exit;
6
}
7
8
+ define( "JPIBFI_VERSION", "0.9.95" );
9
define( "JPIBFI_BASIC_OPTIONS", "jptbfi_options" );
10
define( "JPIBFI_ADVANCED_OPTIONS", "jptbfi_advanced_options" );
11
+ define( "JPIBFI_BUTTON_CUSTOM_CSS", "jpibfi_button_custom_css" );
12
define( "JPIBFI_METADATA", "jpibfi_meta");
13
14
//DEFAULT PIN BUTTON IMAGE
16
define( "JPIBFI_IMAGE_WIDTH", 65 );
17
define( "JPIBFI_IMAGE_HEIGHT", 41 );
18
19
+ define( "JPIBFI_PREVIEW_IMAGE_ID", "jpibfi_preview_image" );
20
+
21
+ $jpibfi_button_css[0] = esc_html( "top:0%;&#10;left:0%;&#10;margin:20px 0 0 20px;" ); //Top left
22
+ $jpibfi_button_css[1] = esc_html( "top:0%;&#10;right:0%;&#10;margin:20px 20px 0 0;" ); //Top right
23
+ $jpibfi_button_css[2] = esc_html( "bottom:0%;&#10;left:0%;&#10;margin:0 0 20px 20px;" ); //Bottom left
24
+ $jpibfi_button_css[3] = esc_html( "bottom:0%;&#10;right:0%;&#10;margin:0 20px 20px 0;" ); //Bottom right
25
+ $jpibfi_button_css[4] = esc_html( "top:0;&#10;left:0;&#10;right:0;&#10;bottom:0;&#10;margin:auto;" ); //Middle
26
+
27
+ $jpibfi_button_dropdown = array(
28
+ "Top left (default)",
29
+ "Top right",
30
+ "Bottom left",
31
+ "Bottom right",
32
+ "Middle",
33
+ "Custom"
34
+ );
jquery-pin-it-button-for-images.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: jQuery Pin It Button For Images
4
Plugin URI: http://wordpress.org/extend/plugins/jquery-pin-it-button-for-images/
5
Description: Highlights images on hover and adds a "Pin It" button over them for easy pinning.
6
Author: Marcin Skrzypiec
7
- Version: 0.9.9
8
Author URI: http://profiles.wordpress.org/mrsztuczkens
9
*/
10
@@ -34,7 +34,8 @@ function jpibfi_get_basic_options() {
34
'custom_image_width' => '0',
35
'use_post_url' => '0',
36
'min_image_height' => '0',
37
- 'min_image_width' => '0'
38
);
39
40
$dev_options = get_option( JPIBFI_BASIC_OPTIONS );
@@ -80,6 +81,7 @@ function jpibfi_get_basic_options() {
80
case "custom_image_height":
81
case "min_image_width":
82
case "min_image_height":
83
if ( jpibfi_is_numeric_and_more_or_equal_to_zero( $option ) )
84
$admin_options[$key] = $option;
85
else
@@ -125,6 +127,22 @@ function jpibfi_get_advanced_options() {
125
return $admin_options;
126
}
127
128
//returns false if plugin shouldn't be added to certain post based on metadata, otherwise true
129
function jpibfi_add_plugin_to_post( $post_id ) {
130
$post_meta = get_post_meta( $post_id, JPIBFI_METADATA, true );
@@ -175,7 +193,6 @@ function jpibfi_init_plugin() {
175
function jpibfi_add_plugin_scripts() {
176
if ( ! ( jpibfi_add_plugin() ) )
177
return;
178
-
179
wp_enqueue_script( 'jquery-pin-it-button-script', plugins_url( '/js/script.min.js', __FILE__ ), array( 'jquery' ), JPIBFI_VERSION, false );
180
181
$dev_options = jpibfi_get_basic_options();
@@ -201,6 +218,8 @@ function jpibfi_print_header_style_action() {
201
202
$dev_options = jpibfi_get_basic_options();
203
204
if ( $dev_options['compatibility_mode'] == '0' )
205
$css = 'background-color: rgba(255, 255, 255, ' . $dev_options['transparency_value'] . ');';
206
else
@@ -215,7 +234,7 @@ function jpibfi_print_header_style_action() {
215
}
216
else {
217
$width = JPIBFI_IMAGE_WIDTH;
218
- $height = JPIBFI_IMAGE_WIDTH;
219
$url = JPIBFI_IMAGE_URL;
220
}
221
@@ -224,8 +243,10 @@ function jpibfi_print_header_style_action() {
224
.pinit .pinit-overlay { <?php echo $css; ?> }
225
226
.pinit .pinit-overlay a {
227
- <?php printf( 'width:%spx; height:%spx; background:transparent url("%s") no-repeat 0 0;',
228
- $width, $height, $url ); ?>
229
}
230
</style>
231
<?php
@@ -242,10 +263,13 @@ function jpibfi_print_hidden_field_script( $content ) {
242
243
//add admin scripts
244
function jpibfi_add_admin_site_scripts() {
245
246
wp_register_style( 'jquery-pin-it-button-admin-style', plugins_url( '/css/admin.css', __FILE__ ), array(), JPIBFI_VERSION, 'all' );
247
wp_enqueue_style( 'jquery-pin-it-button-admin-style' );
248
wp_enqueue_script( 'jquery-pin-it-button-admin-script', plugins_url( '/js/admin.js', __FILE__ ), array( 'jquery' ), JPIBFI_VERSION, false );
249
250
if ( function_exists( "wp_enqueue_media") ) {
251
wp_enqueue_media();
4
Plugin URI: http://wordpress.org/extend/plugins/jquery-pin-it-button-for-images/
5
Description: Highlights images on hover and adds a "Pin It" button over them for easy pinning.
6
Author: Marcin Skrzypiec
7
+ Version: 0.9.95
8
Author URI: http://profiles.wordpress.org/mrsztuczkens
9
*/
10
34
'custom_image_width' => '0',
35
'use_post_url' => '0',
36
'min_image_height' => '0',
37
+ 'min_image_width' => '0',
38
+ 'button_position' => '0'
39
);
40
41
$dev_options = get_option( JPIBFI_BASIC_OPTIONS );
81
case "custom_image_height":
82
case "min_image_width":
83
case "min_image_height":
84
+ case "button_position":
85
if ( jpibfi_is_numeric_and_more_or_equal_to_zero( $option ) )
86
$admin_options[$key] = $option;
87
else
127
return $admin_options;
128
}
129
130
+ function jpibfi_get_button_css() {
131
+ global $jpibfi_button_css;
132
+
133
+ $button_css = $jpibfi_button_css[0];
134
+
135
+ $button_css_from_db = get_option( JPIBFI_BUTTON_CUSTOM_CSS );
136
+
137
+ if ( empty( $button_css_from_db ) ) {
138
+ update_option( JPIBFI_BUTTON_CUSTOM_CSS, $button_css );
139
+ return $button_css;
140
+ }
141
+
142
+ return $button_css_from_db;
143
+ }
144
+
145
+
146
//returns false if plugin shouldn't be added to certain post based on metadata, otherwise true
147
function jpibfi_add_plugin_to_post( $post_id ) {
148
$post_meta = get_post_meta( $post_id, JPIBFI_METADATA, true );
193
function jpibfi_add_plugin_scripts() {
194
if ( ! ( jpibfi_add_plugin() ) )
195
return;
196
wp_enqueue_script( 'jquery-pin-it-button-script', plugins_url( '/js/script.min.js', __FILE__ ), array( 'jquery' ), JPIBFI_VERSION, false );
197
198
$dev_options = jpibfi_get_basic_options();
218
219
$dev_options = jpibfi_get_basic_options();
220
221
+ $button_css = jpibfi_get_button_css();
222
+
223
if ( $dev_options['compatibility_mode'] == '0' )
224
$css = 'background-color: rgba(255, 255, 255, ' . $dev_options['transparency_value'] . ');';
225
else
234
}
235
else {
236
$width = JPIBFI_IMAGE_WIDTH;
237
+ $height = JPIBFI_IMAGE_HEIGHT;
238
$url = JPIBFI_IMAGE_URL;
239
}
240
243
.pinit .pinit-overlay { <?php echo $css; ?> }
244
245
.pinit .pinit-overlay a {
246
+ <?php
247
+ printf( 'width:%spx; height:%spx; background:transparent url("%s") no-repeat 0 0;', $width, $height, $url );
248
+ echo $button_css;
249
+ ?>
250
}
251
</style>
252
<?php
263
264
//add admin scripts
265
function jpibfi_add_admin_site_scripts() {
266
+ global $jpibfi_button_css;
267
268
wp_register_style( 'jquery-pin-it-button-admin-style', plugins_url( '/css/admin.css', __FILE__ ), array(), JPIBFI_VERSION, 'all' );
269
wp_enqueue_style( 'jquery-pin-it-button-admin-style' );
270
+
271
wp_enqueue_script( 'jquery-pin-it-button-admin-script', plugins_url( '/js/admin.js', __FILE__ ), array( 'jquery' ), JPIBFI_VERSION, false );
272
+ wp_localize_script( 'jquery-pin-it-button-admin-script', 'jpibfi_button_css', $jpibfi_button_css );
273
274
if ( function_exists( "wp_enqueue_media") ) {
275
wp_enqueue_media();
js/admin.js CHANGED
@@ -67,6 +67,15 @@ jQuery(document).ready(function($) {
67
}
68
69
});
70
71
function is_string_css_class_name(class_name) {
72
var regExp = new RegExp("^-?[_a-zA-Z]+[_a-zA-Z0-9-]*quot;);
67
}
68
69
});
70
+
71
+ $("#custom_button_css").prop('disabled', $('#button_position').val() != "5");
72
+
73
+ $('#button_position').change( function() {
74
+ var buttonPos = $(this).val()
75
+ $("#custom_button_css").prop('disabled', buttonPos != "5");
76
+ if ( buttonPos >= 0 && buttonPos <= 4 )
77
+ $('#custom_button_css').html( jpibfi_button_css[buttonPos] );
78
+ });
79
80
function is_string_css_class_name(class_name) {
81
var regExp = new RegExp("^-?[_a-zA-Z]+[_a-zA-Z0-9-]*quot;);
js/script.js CHANGED
@@ -82,7 +82,7 @@
82
bookmarkDescription = o.pageTitle;
83
84
var indexer = $image.attr("data-indexer"),
85
- bookmark = 'http://pinterest.com/pin/create/bookmarklet/?url=' + encodeURI(bookmarkUrl) + '&is_video=' + encodeURI('false') + '&description=' + encodeURI(bookmarkDescription);
86
87
$image.wrap('<div class="pinit" data-indexer="' + indexer + '"/>');
88
$image.after('<span class="pinit-overlay" data-indexer= "' + indexer + '"><a class="pinit-button" href="' + bookmark + '" data-indexer= "' + indexer + '">Pin It</a></span>');
@@ -106,8 +106,7 @@
106
107
if ($image.hasClass('aligncenter')) {
108
$('.pinit[data-indexer="' + indexer + '"]')
109
- .addClass('aligncenter')
110
- .css('clear', 'both');
111
112
$overlay.css({
113
'margin-left' :"auto",
@@ -128,7 +127,7 @@
128
$('.pinit').mouseenter(function () {
129
$(this).children('.pinit-overlay').fadeIn(200);
130
}).mouseleave(function () {
131
- $(this).children('.pinit-overlay').fadeOut(200);
132
});
133
})
134
};
82
bookmarkDescription = o.pageTitle;
83
84
var indexer = $image.attr("data-indexer"),
85
+ bookmark = 'http://pinterest.com/pin/create/bookmarklet/?url=' + encodeURI(bookmarkUrl) + '&is_video=' + encodeURI('false') + '&description=' + encodeURIComponent(bookmarkDescription);
86
87
$image.wrap('<div class="pinit" data-indexer="' + indexer + '"/>');
88
$image.after('<span class="pinit-overlay" data-indexer= "' + indexer + '"><a class="pinit-button" href="' + bookmark + '" data-indexer= "' + indexer + '">Pin It</a></span>');
106
107
if ($image.hasClass('aligncenter')) {
108
$('.pinit[data-indexer="' + indexer + '"]')
109
+ .addClass('aligncenter');
110
111
$overlay.css({
112
'margin-left' :"auto",
127
$('.pinit').mouseenter(function () {
128
$(this).children('.pinit-overlay').fadeIn(200);
129
}).mouseleave(function () {
130
+ $(this).children('.pinit-overlay').fadeOut(200);
131
});
132
})
133
};
js/script.min.js CHANGED
@@ -1 +1 @@
1
- (function(e){e(document).ready(function(){function i(){var n=["alignnone","alignright","alignleft"];e("img[data-indexer]").each(function(){var r=e(this);if(this.clientWidth<t.minImageWidth||this.clientHeight<t.minImageHeight){r.removeAttr("data-indexer");return}var i="";if(t.usePostUrl){var s=r.closest("div.jpibfi_container").children("input.jpibfi").first();if(s.length!=0)i=s.attr("data-jpibfi-url")}if(i.length==0)i=t.pageUrl;var u;switch(t.descriptionOption){case"3":u=r.attr("title")?r.attr("title"):r.attr("alt");break;case"2":u=t.pageDescription;break;case"4":u=t.siteTitle;break}if(!u)u=t.pageTitle;var a=r.attr("data-indexer"),f="http://pinterest.com/pin/create/bookmarklet/?url="+encodeURI(i)+"&is_video="+encodeURI("false")+"&description="+encodeURI(u);r.wrap('<div class="pinit" data-indexer="'+a+'"/>');r.after('<span class="pinit-overlay" data-indexer= "'+a+'"><a class="pinit-button" href="'+f+'" data-indexer= "'+a+'">Pin It</a></span>');var l=e('.pinit-overlay[data-indexer="'+a+'"]').css({height:this.clientHeight+"px",width:this.clientWidth+"px","margin-right":r.css("margin-right"),"margin-left":r.css("margin-left"),"margin-top":r.css("margin-top"),"margin-bottom":r.css("margin-bottom")});for(var c in n){if(r.hasClass(n[c])){e('.pinit[data-indexer="'+a+'"]').addClass(n[c]);l.addClass(n[c])}}if(r.hasClass("aligncenter")){e('.pinit[data-indexer="'+a+'"]').addClass("aligncenter").css("clear","both");l.css({"margin-left":"auto","margin-right":"auto",left:0,right:0})}e(".pinit .pinit-button").click(function(){var t=e(this).attr("data-indexer");var n=e('img[data-indexer="'+t+'"]');var r=e(this).attr("href")+"&media="+encodeURI(n.data("media")?n.data("media"):n[0].src);window.open(r,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1");return false});e(".pinit").mouseenter(function(){e(this).children(".pinit-overlay").fadeIn(200)}).mouseleave(function(){e(this).children(".pinit-overlay").fadeOut(200)})})}function s(){e("span.pinit-overlay").remove();e("img[data-indexer]").unwrap()}var t={pageUrl:document.URL,pageTitle:document.title,pageDescription:e('meta[name="description"]').attr("content"),siteTitle:jpibfi_options.site_title,imageSelector:jpibfi_options.image_selector,disabledClasses:jpibfi_options.disabled_classes,enabledClasses:jpibfi_options.enabled_classes,descriptionOption:jpibfi_options.description_option,usePostUrl:jpibfi_options.use_post_url=="1",minImageHeight:jpibfi_options.min_image_height,minImageWidth:jpibfi_options.min_image_width};var n=t.disabledClasses.split(";");var r=t.enabledClasses.split(";");e(".jpibfi").closest("div").addClass("jpibfi_container");e(t.imageSelector).each(function(t){var i=e(this);if(n[0].length>0){for(var s in n){if(i.hasClass(n[s]))return}}if(r[0].length>0){var o=false;for(var u=0;u<r.length&&!o;u++)o=i.hasClass(r[u]);if(!o)return}i.attr("data-indexer",t)});e(window).load(i);e(window).resize(function(){s();i()})})})(jQuery)
1
+ (function(e){e(document).ready(function(){function i(){var n=["alignnone","alignright","alignleft"];e("img[data-indexer]").each(function(){var r=e(this);if(this.clientWidth<t.minImageWidth||this.clientHeight<t.minImageHeight){r.removeAttr("data-indexer");return}var i="";if(t.usePostUrl){var s=r.closest("div.jpibfi_container").children("input.jpibfi").first();if(s.length!=0)i=s.attr("data-jpibfi-url")}if(i.length==0)i=t.pageUrl;var u;switch(t.descriptionOption){case"3":u=r.attr("title")?r.attr("title"):r.attr("alt");break;case"2":u=t.pageDescription;break;case"4":u=t.siteTitle;break}if(!u)u=t.pageTitle;var a=r.attr("data-indexer"),f="http://pinterest.com/pin/create/bookmarklet/?url="+encodeURI(i)+"&is_video="+encodeURI("false")+"&description="+encodeURIComponent(u);r.wrap('<div class="pinit" data-indexer="'+a+'"/>');r.after('<span class="pinit-overlay" data-indexer= "'+a+'"><a class="pinit-button" href="'+f+'" data-indexer= "'+a+'">Pin It</a></span>');var l=e('.pinit-overlay[data-indexer="'+a+'"]').css({height:this.clientHeight+"px",width:this.clientWidth+"px","margin-right":r.css("margin-right"),"margin-left":r.css("margin-left"),"margin-top":r.css("margin-top"),"margin-bottom":r.css("margin-bottom")});for(var c in n){if(r.hasClass(n[c])){e('.pinit[data-indexer="'+a+'"]').addClass(n[c]);l.addClass(n[c])}}if(r.hasClass("aligncenter")){e('.pinit[data-indexer="'+a+'"]').addClass("aligncenter");l.css({"margin-left":"auto","margin-right":"auto",left:0,right:0})}e(".pinit .pinit-button").click(function(){var t=e(this).attr("data-indexer");var n=e('img[data-indexer="'+t+'"]');var r=e(this).attr("href")+"&media="+encodeURI(n.data("media")?n.data("media"):n[0].src);window.open(r,"Pinterest","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1");return false});e(".pinit").mouseenter(function(){e(this).children(".pinit-overlay").fadeIn(200)}).mouseleave(function(){e(this).children(".pinit-overlay").fadeOut(200)})})}function s(){e("span.pinit-overlay").remove();e("img[data-indexer]").unwrap()}var t={pageUrl:document.URL,pageTitle:document.title,pageDescription:e('meta[name="description"]').attr("content"),siteTitle:jpibfi_options.site_title,imageSelector:jpibfi_options.image_selector,disabledClasses:jpibfi_options.disabled_classes,enabledClasses:jpibfi_options.enabled_classes,descriptionOption:jpibfi_options.description_option,usePostUrl:jpibfi_options.use_post_url=="1",minImageHeight:jpibfi_options.min_image_height,minImageWidth:jpibfi_options.min_image_width};var n=t.disabledClasses.split(";");var r=t.enabledClasses.split(";");e(".jpibfi").closest("div").addClass("jpibfi_container");e(t.imageSelector).each(function(t){var i=e(this);if(n[0].length>0){for(var s in n){if(i.hasClass(n[s]))return}}if(r[0].length>0){var o=false;for(var u=0;u<r.length&&!o;u++)o=i.hasClass(r[u]);if(!o)return}i.attr("data-indexer",t)});e(window).load(i);e(window).resize(function(){s();i()})})})(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.5.1
7
- Stable tag: 0.9.5
8
License: GPLv2 or later
9
10
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
@@ -69,6 +69,11 @@ Please report them in the plugin's support forum on Wordpress.org.
69
70
== Changelog ==
71
72
= 0.9.9 =
73
* Released 2013-04-04
74
* Bug fixed: showing "Pin it" button on categories and archives even though they are unchecked in the settings
@@ -122,6 +127,9 @@ Please report them in the plugin's support forum on Wordpress.org.
122
123
== Upgrade Notice ==
124
125
= 0.9.9 =
126
A minor bug fixed and two new features (minimum image size among them) added.
127
4
Tags: pinterest, pin it, button, image, images, pinit, social media, hover, click, photo, photos
5
Requires at least: 3.3.0
6
Tested up to: 3.5.1
7
+ Stable tag: 0.9.9
8
License: GPLv2 or later
9
10
Highlights images on hover and adds a Pinterest "Pin It" button over them for easy pinning.
69
70
== Changelog ==
71
72
+ = 0.9.95 =
73
+ * Released 2013-04-28
74
+ * Bug fixed: issue with pinning images with hashtags in their title/alt
75
+ * New feature: possibility to change the position of the "Pin it" button
76
+
77
= 0.9.9 =
78
* Released 2013-04-04
79
* Bug fixed: showing "Pin it" button on categories and archives even though they are unchecked in the settings
127
128
== Upgrade Notice ==
129
130
+ = 0.9.95 =
131
+ Minor bug fixed and one new feature (setting the position of the "Pin it" button) added.
132
+
133
= 0.9.9 =
134
A minor bug fixed and two new features (minimum image size among them) added.
135