Version Description
- Release 2016-07-04
- Added lightbox feature
Download this release
Release Info
Developer | mrsztuczkens |
Plugin | jQuery Pin It Button for Images |
Version | 1.60 |
Comparing to | |
See all releases |
Code changes from version 1.52 to 1.60
- css/colorbox.css +70 -0
- css/images/border.png +0 -0
- css/images/controls.png +0 -0
- css/images/loading.gif +0 -0
- css/images/loading_background.png +0 -0
- css/images/overlay.png +0 -0
- includes/admin/class-jpibfi-admin.php +5 -1
- includes/admin/class-jpibfi-lightbox-options.php +121 -0
- includes/admin/class-jpibfi-visual-options.php +2 -2
- includes/consts/jpibfi-description-option.php +11 -0
- includes/public/class-jpibfi-client.php +56 -8
- jquery-pin-it-button-for-images.php +4 -2
- js/jpibfi.js +1 -1
- js/jquery.colorbox-min.js +6 -0
- languages/jquery-pin-it-button-for-images.pot +60 -32
- readme.txt +9 -2
- uninstall.php +1 -0
css/colorbox.css
ADDED
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Colorbox Core Style:
|
3 |
+
The following CSS is consistent between example themes and should not be altered.
|
4 |
+
*/
|
5 |
+
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
|
6 |
+
#cboxWrapper {max-width:none;}
|
7 |
+
#cboxOverlay{position:fixed; width:100%; height:100%;}
|
8 |
+
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
|
9 |
+
#cboxContent{position:relative;}
|
10 |
+
#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
|
11 |
+
#cboxTitle{margin:0;}
|
12 |
+
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
|
13 |
+
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
|
14 |
+
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
|
15 |
+
.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
|
16 |
+
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
|
17 |
+
|
18 |
+
/*
|
19 |
+
User Style:
|
20 |
+
Change the following styles to modify the appearance of Colorbox. They are
|
21 |
+
ordered & tabbed in a way that represents the nesting of the generated HTML.
|
22 |
+
*/
|
23 |
+
#cboxOverlay{background:url(images/overlay.png) repeat 0 0;}
|
24 |
+
#colorbox{outline:0;}
|
25 |
+
#cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;}
|
26 |
+
#cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;}
|
27 |
+
#cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;}
|
28 |
+
#cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;}
|
29 |
+
#cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
|
30 |
+
#cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
|
31 |
+
#cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
|
32 |
+
#cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
|
33 |
+
#cboxContent{background:#fff; overflow:hidden;}
|
34 |
+
.cboxIframe{background:#fff;}
|
35 |
+
#cboxError{padding:50px; border:1px solid #ccc;}
|
36 |
+
#cboxLoadedContent{margin-bottom:28px;}
|
37 |
+
#cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
|
38 |
+
#cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
|
39 |
+
#cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
|
40 |
+
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
|
41 |
+
|
42 |
+
/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
|
43 |
+
#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
|
44 |
+
|
45 |
+
/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
|
46 |
+
#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
|
47 |
+
|
48 |
+
#cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
|
49 |
+
#cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
|
50 |
+
#cboxPrevious:hover{background-position:-75px -25px;}
|
51 |
+
#cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
|
52 |
+
#cboxNext:hover{background-position:-50px -25px;}
|
53 |
+
#cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
|
54 |
+
#cboxClose:hover{background-position:-25px -25px;}
|
55 |
+
|
56 |
+
/*
|
57 |
+
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
|
58 |
+
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
|
59 |
+
See: http://jacklmoore.com/notes/ie-transparency-problems/
|
60 |
+
*/
|
61 |
+
.cboxIE #cboxTopLeft,
|
62 |
+
.cboxIE #cboxTopCenter,
|
63 |
+
.cboxIE #cboxTopRight,
|
64 |
+
.cboxIE #cboxBottomLeft,
|
65 |
+
.cboxIE #cboxBottomCenter,
|
66 |
+
.cboxIE #cboxBottomRight,
|
67 |
+
.cboxIE #cboxMiddleLeft,
|
68 |
+
.cboxIE #cboxMiddleRight {
|
69 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
|
70 |
+
}
|
css/images/border.png
ADDED
Binary file
|
css/images/controls.png
ADDED
Binary file
|
css/images/loading.gif
ADDED
Binary file
|
css/images/loading_background.png
ADDED
Binary file
|
css/images/overlay.png
ADDED
Binary file
|
includes/admin/class-jpibfi-admin.php
CHANGED
@@ -93,6 +93,10 @@ class JPIBFI_Admin {
|
|
93 |
'import_export' => array(
|
94 |
'settings_name' => 'jpibfi_import_export_options',
|
95 |
'tab_label' => __('Import/Export', 'jquery-pin-it-button-for-images')
|
|
|
|
|
|
|
|
|
96 |
)
|
97 |
);
|
98 |
|
@@ -164,7 +168,7 @@ class JPIBFI_Admin {
|
|
164 |
$show_close = 'plugins.php' == $hook_suffix;
|
165 |
?>
|
166 |
<div class="updated jpibfi-pro-notice">
|
167 |
-
<p><?php echo sprintf(__('jQuery Pin It Button for Images Pro is
|
168 |
<?php if ($show_close): ?><span id="jpibfi_remove_ad" class="dashicons dashicons-no"></span><?php endif; ?>
|
169 |
</div>
|
170 |
<?php
|
93 |
'import_export' => array(
|
94 |
'settings_name' => 'jpibfi_import_export_options',
|
95 |
'tab_label' => __('Import/Export', 'jquery-pin-it-button-for-images')
|
96 |
+
),
|
97 |
+
'lightbox' => array(
|
98 |
+
'settings_name' => 'jpibfi_lightbox_options',
|
99 |
+
'tab_label' => __('Lightbox', 'jquery-pin-it-button-for-images')
|
100 |
)
|
101 |
);
|
102 |
|
168 |
$show_close = 'plugins.php' == $hook_suffix;
|
169 |
?>
|
170 |
<div class="updated jpibfi-pro-notice">
|
171 |
+
<p><?php echo sprintf(__('jQuery Pin It Button for Images Pro is available. Click <a target="_blank" href="%s">here</a> to learn more.', 'jquery-pin-it-button-for-images'), 'http://mrsztuczkens.me/jpibfi-pro/'); ?></p>
|
172 |
<?php if ($show_close): ?><span id="jpibfi_remove_ad" class="dashicons dashicons-no"></span><?php endif; ?>
|
173 |
</div>
|
174 |
<?php
|
includes/admin/class-jpibfi-lightbox-options.php
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class JPIBFI_Lightbox_Options extends JPIBFI_Options {
|
4 |
+
|
5 |
+
protected static $instance = null;
|
6 |
+
|
7 |
+
protected $admin_advanced_options = null;
|
8 |
+
|
9 |
+
private function __construct() {
|
10 |
+
add_action( 'admin_init', array( $this, 'init' ) );
|
11 |
+
}
|
12 |
+
|
13 |
+
public static function get_instance() {
|
14 |
+
// If the single instance hasn't been set, set it now.
|
15 |
+
if ( null == self::$instance ) {
|
16 |
+
self::$instance = new self;
|
17 |
+
}
|
18 |
+
|
19 |
+
return self::$instance;
|
20 |
+
}
|
21 |
+
|
22 |
+
function get_default_options(){
|
23 |
+
$defaults = array(
|
24 |
+
'enabled' => '0',
|
25 |
+
'description_option' => '1'
|
26 |
+
);
|
27 |
+
|
28 |
+
return apply_filters( 'jpibfi_default_lightbox_options', $defaults );
|
29 |
+
}
|
30 |
+
|
31 |
+
static function get_option_name(){
|
32 |
+
return 'jpibfi_lightbox_options';
|
33 |
+
}
|
34 |
+
|
35 |
+
/* Defines selection options section and adds all required fields */
|
36 |
+
public function init() {
|
37 |
+
|
38 |
+
// First, we register a section.
|
39 |
+
add_settings_section(
|
40 |
+
'lightbox_options_section',
|
41 |
+
__( 'Lightbox Settings', 'jquery-pin-it-button-for-images' ),
|
42 |
+
array( $this, 'section_name_callback' ),
|
43 |
+
'jpibfi_lightbox_options'
|
44 |
+
);
|
45 |
+
|
46 |
+
add_settings_field(
|
47 |
+
'enabled',
|
48 |
+
__( 'Enabled', 'jquery-pin-it-button-for-images' ),
|
49 |
+
array( $this, 'enabled_callback' ),
|
50 |
+
'jpibfi_lightbox_options',
|
51 |
+
'lightbox_options_section',
|
52 |
+
array(
|
53 |
+
__( 'Activate lightbox in posts', 'jquery-pin-it-button-for-images' )
|
54 |
+
)
|
55 |
+
);
|
56 |
+
|
57 |
+
add_settings_field(
|
58 |
+
'description_option',
|
59 |
+
__( 'Description source', 'jquery-pin-it-button-for-images' ),
|
60 |
+
array( $this, 'description_option_callback' ),
|
61 |
+
'jpibfi_lightbox_options',
|
62 |
+
'lightbox_options_section',
|
63 |
+
array(
|
64 |
+
__( 'From where the lightbox description should be taken. Please note that "Image description" works properly only for images that were added to your Media Library.', 'jquery-pin-it-button-for-images' ),
|
65 |
+
)
|
66 |
+
);
|
67 |
+
|
68 |
+
add_settings_field(
|
69 |
+
'footer',
|
70 |
+
'',
|
71 |
+
array( $this, 'footer_callback' ),
|
72 |
+
'jpibfi_lightbox_options',
|
73 |
+
'lightbox_options_section',
|
74 |
+
array(
|
75 |
+
__( 'Lightbox module uses Colorbox. Visit <a href="http://www.jacklmoore.com/colorbox/" target="_blank">this page</a> to learn more about Colorbox.', 'jquery-pin-it-button-for-images' ),
|
76 |
+
)
|
77 |
+
);
|
78 |
+
|
79 |
+
register_setting(
|
80 |
+
'jpibfi_lightbox_options',
|
81 |
+
'jpibfi_lightbox_options'
|
82 |
+
);
|
83 |
+
}
|
84 |
+
|
85 |
+
public function section_name_callback() {
|
86 |
+
echo '<p>' . __('Lightbox settings', 'jquery-pin-it-button-for-images') . '</p>';
|
87 |
+
}
|
88 |
+
|
89 |
+
public function enabled_callback( $args ){
|
90 |
+
$options = $this->get_options();
|
91 |
+
$enabled = JPIBFI_Admin_Utilities::exists_and_equal_to( $options, 'enabled', '1' );
|
92 |
+
|
93 |
+
echo '<input type="checkbox" id="debug" name="jpibfi_lightbox_options[enabled]" value="1" ' . checked( "1", $enabled, false ) . '>';
|
94 |
+
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
95 |
+
}
|
96 |
+
|
97 |
+
public function description_option_callback( $args ) {
|
98 |
+
$options = $this->get_options();
|
99 |
+
|
100 |
+
$description_option = $options[ 'description_option' ];
|
101 |
+
?>
|
102 |
+
|
103 |
+
<select id="description_option" name="jpibfi_lightbox_options[description_option]">
|
104 |
+
<option value="1" <?php selected ( "1", $description_option ); ?>><?php _e( 'Page title', 'jquery-pin-it-button-for-images' ); ?></option>
|
105 |
+
<option value="2" <?php selected ( "2", $description_option ); ?>><?php _e( 'Page description (excerpt)', 'jquery-pin-it-button-for-images' ); ?></option>
|
106 |
+
<option value="3" <?php selected ( "3", $description_option ); ?>><?php _e( 'Image title or (if title not available) alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
|
107 |
+
<option value="4" <?php selected ( "4", $description_option ); ?>><?php _e( 'Site title (Settings->General)', 'jquery-pin-it-button-for-images' ); ?></option>
|
108 |
+
<option value="5" <?php selected ( "5", $description_option ); ?>><?php _e( 'Image description', 'jquery-pin-it-button-for-images' ); ?></option>
|
109 |
+
<option value="6" <?php selected ( "6", $description_option ); ?>><?php _e( 'Image alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
|
110 |
+
</select>
|
111 |
+
|
112 |
+
<?php
|
113 |
+
echo JPIBFI_Admin_Utilities::create_description( $args[0] );
|
114 |
+
}
|
115 |
+
|
116 |
+
public function footer_callback($args){
|
117 |
+
echo '<span style="font-size: 18px">' . $args[0] . '</span>';
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
add_action( 'plugins_loaded', array( 'JPIBFI_Lightbox_Options', 'get_instance' ) );
|
includes/admin/class-jpibfi-visual-options.php
CHANGED
@@ -215,8 +215,8 @@ class JPIBFI_Visual_Options extends JPIBFI_Options {
|
|
215 |
|
216 |
<select id="description_option" name="jpibfi_visual_options[description_option]">
|
217 |
<option value="1" <?php selected ( "1", $description_option ); ?>><?php _e( 'Page title', 'jquery-pin-it-button-for-images' ); ?></option>
|
218 |
-
<option value="2" <?php selected ( "2", $description_option ); ?>><?php _e( 'Page description', 'jquery-pin-it-button-for-images' ); ?></option>
|
219 |
-
<option value="3" <?php selected ( "3", $description_option ); ?>><?php _e( '
|
220 |
<option value="4" <?php selected ( "4", $description_option ); ?>><?php _e( 'Site title (Settings->General)', 'jquery-pin-it-button-for-images' ); ?></option>
|
221 |
<option value="5" <?php selected ( "5", $description_option ); ?>><?php _e( 'Image description', 'jquery-pin-it-button-for-images' ); ?></option>
|
222 |
<option value="6" <?php selected ( "6", $description_option ); ?>><?php _e( 'Image alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
|
215 |
|
216 |
<select id="description_option" name="jpibfi_visual_options[description_option]">
|
217 |
<option value="1" <?php selected ( "1", $description_option ); ?>><?php _e( 'Page title', 'jquery-pin-it-button-for-images' ); ?></option>
|
218 |
+
<option value="2" <?php selected ( "2", $description_option ); ?>><?php _e( 'Page description (excerpt)', 'jquery-pin-it-button-for-images' ); ?></option>
|
219 |
+
<option value="3" <?php selected ( "3", $description_option ); ?>><?php _e( 'Image title or (if title not available) alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
|
220 |
<option value="4" <?php selected ( "4", $description_option ); ?>><?php _e( 'Site title (Settings->General)', 'jquery-pin-it-button-for-images' ); ?></option>
|
221 |
<option value="5" <?php selected ( "5", $description_option ); ?>><?php _e( 'Image description', 'jquery-pin-it-button-for-images' ); ?></option>
|
222 |
<option value="6" <?php selected ( "6", $description_option ); ?>><?php _e( 'Image alt attribute', 'jquery-pin-it-button-for-images' ); ?></option>
|
includes/consts/jpibfi-description-option.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class JPIBFIDescriptionOption
|
4 |
+
{
|
5 |
+
const PageTitle = 1;
|
6 |
+
const PageDescription = 2;
|
7 |
+
const ImageTitleOrAlt = 3;
|
8 |
+
const SiteTitle = 4;
|
9 |
+
const ImageDescription = 5;
|
10 |
+
const ImageAlt = 6;
|
11 |
+
}
|
includes/public/class-jpibfi-client.php
CHANGED
@@ -9,8 +9,13 @@ class JPIBFI_Client {
|
|
9 |
private function __construct() {
|
10 |
add_action( 'wp_enqueue_scripts', array( $this, 'add_plugin_scripts' ) );
|
11 |
add_action( 'wp_head', array( $this, 'print_header_style' ) );
|
12 |
-
add_filter( "the_content", array( $this, 'prepare_the_content' ), 9999 );
|
13 |
add_filter( "the_excerpt", array( $this, 'prepare_the_content' ), 9999 );
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
}
|
15 |
|
16 |
public static function get_instance() {
|
@@ -27,10 +32,20 @@ class JPIBFI_Client {
|
|
27 |
$jpibfi_adanced_options = JPIBFI_Advanced_Options::get_instance()->get_options();
|
28 |
$jpibfi_selection_options = JPIBFI_Selection_Options::get_instance()->get_options();
|
29 |
$jpibfi_visual_options = JPIBFI_Visual_Options::get_instance()->get_options();
|
|
|
30 |
|
31 |
if ( ! ( JPIBFI_Client_Utilities::add_jpibfi() ) )
|
32 |
return;
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
$use_custom_image = $jpibfi_visual_options[ 'use_custom_image' ] == "1";
|
36 |
|
@@ -56,9 +71,14 @@ class JPIBFI_Client {
|
|
56 |
'showButton' => $jpibfi_visual_options['show_button'],
|
57 |
'pinLinkedImages' => $jpibfi_visual_options['pinLinkedImages'] == '1',
|
58 |
'pinLinkedImagesExtensions' => $jpibfi_visual_options['pinLinkedImagesExtensions'],
|
|
|
|
|
|
|
|
|
59 |
);
|
60 |
-
|
61 |
wp_localize_script( 'jquery-pin-it-button-script', 'jpibfi_options', apply_filters( 'jpibfi_javascript_parameters', $parameters_array ) );
|
|
|
|
|
62 |
}
|
63 |
|
64 |
public function print_header_style() {
|
@@ -110,17 +130,16 @@ class JPIBFI_Client {
|
|
110 |
return $content;
|
111 |
|
112 |
$jpibfi_visual_options = JPIBFI_Visual_Options::get_instance()->get_options();
|
|
|
113 |
|
114 |
global $post;
|
115 |
|
116 |
-
$add_attributes = false == is_singular() && '1' == $jpibfi_visual_options[ 'use_post_url' ];
|
117 |
-
|
118 |
$attributes_html = '';
|
119 |
|
120 |
//if we need to add additional attributes to handle use_post_url setting
|
121 |
-
if ( $
|
122 |
//if page description should be used as pin description and an excerpt for the post exists
|
123 |
-
if ( has_excerpt( $post->ID ) &&
|
124 |
$description = wp_kses( $post->post_excerpt, array() );
|
125 |
else
|
126 |
$description = get_the_title($post->ID);
|
@@ -132,7 +151,7 @@ class JPIBFI_Client {
|
|
132 |
$input_html = '<input class="jpibfi" type="hidden" ' . $attributes_html . '>';
|
133 |
$content = $input_html . $content;
|
134 |
|
135 |
-
$add_image_descriptions = '
|
136 |
|
137 |
//if we need to add data-jpibfi-description to each image
|
138 |
if ( $add_image_descriptions ){
|
@@ -142,6 +161,35 @@ class JPIBFI_Client {
|
|
142 |
return $content;
|
143 |
}
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
/* PRIVATE METHODS */
|
146 |
|
147 |
/*
|
9 |
private function __construct() {
|
10 |
add_action( 'wp_enqueue_scripts', array( $this, 'add_plugin_scripts' ) );
|
11 |
add_action( 'wp_head', array( $this, 'print_header_style' ) );
|
|
|
12 |
add_filter( "the_excerpt", array( $this, 'prepare_the_content' ), 9999 );
|
13 |
+
add_filter( "the_content", array( $this, 'prepare_the_content' ), 9999 );
|
14 |
+
|
15 |
+
$lightbox_options = JPIBFI_Lightbox_Options::get_instance()->get_options();
|
16 |
+
if ($lightbox_options['enabled'] == '1') {
|
17 |
+
add_filter("the_content", array($this, 'add_lightbox'), 9998);
|
18 |
+
}
|
19 |
}
|
20 |
|
21 |
public static function get_instance() {
|
32 |
$jpibfi_adanced_options = JPIBFI_Advanced_Options::get_instance()->get_options();
|
33 |
$jpibfi_selection_options = JPIBFI_Selection_Options::get_instance()->get_options();
|
34 |
$jpibfi_visual_options = JPIBFI_Visual_Options::get_instance()->get_options();
|
35 |
+
$lightbox_options = JPIBFI_Lightbox_Options::get_instance()->get_options();
|
36 |
|
37 |
if ( ! ( JPIBFI_Client_Utilities::add_jpibfi() ) )
|
38 |
return;
|
39 |
+
|
40 |
+
$deps = array('jquery');
|
41 |
+
|
42 |
+
if ($lightbox_options['enabled'] == '1') {
|
43 |
+
wp_enqueue_script('jquery-colorbox', JPIBFI_Globals::get_plugin_url() . 'js/jquery.colorbox-min.js', array('jquery'), JPIBFI_Globals::get_file_version(), false);
|
44 |
+
wp_enqueue_style('jquery-colorbox', JPIBFI_Globals::get_plugin_url() . 'css/colorbox.css', array(), JPIBFI_Globals::get_file_version());
|
45 |
+
$deps[] = 'jquery-colorbox';
|
46 |
+
}
|
47 |
+
|
48 |
+
wp_enqueue_script( 'jquery-pin-it-button-script', JPIBFI_Globals::get_plugin_url() . 'js/jpibfi.js', $deps, JPIBFI_Globals::get_file_version(), false );
|
49 |
|
50 |
$use_custom_image = $jpibfi_visual_options[ 'use_custom_image' ] == "1";
|
51 |
|
71 |
'showButton' => $jpibfi_visual_options['show_button'],
|
72 |
'pinLinkedImages' => $jpibfi_visual_options['pinLinkedImages'] == '1',
|
73 |
'pinLinkedImagesExtensions' => $jpibfi_visual_options['pinLinkedImagesExtensions'],
|
74 |
+
'lightbox' => array(
|
75 |
+
'enabled' => $lightbox_options['enabled'] == '1',
|
76 |
+
'descriptionOption' => $lightbox_options['description_option']
|
77 |
+
)
|
78 |
);
|
|
|
79 |
wp_localize_script( 'jquery-pin-it-button-script', 'jpibfi_options', apply_filters( 'jpibfi_javascript_parameters', $parameters_array ) );
|
80 |
+
|
81 |
+
|
82 |
}
|
83 |
|
84 |
public function print_header_style() {
|
130 |
return $content;
|
131 |
|
132 |
$jpibfi_visual_options = JPIBFI_Visual_Options::get_instance()->get_options();
|
133 |
+
$lightbox_options = JPIBFI_Lightbox_Options::get_instance()->get_options();
|
134 |
|
135 |
global $post;
|
136 |
|
|
|
|
|
137 |
$attributes_html = '';
|
138 |
|
139 |
//if we need to add additional attributes to handle use_post_url setting
|
140 |
+
if ( !is_singular() && '1' == $jpibfi_visual_options[ 'use_post_url' ] ){
|
141 |
//if page description should be used as pin description and an excerpt for the post exists
|
142 |
+
if ( has_excerpt( $post->ID ) && (JPIBFIDescriptionOption::PageDescription == $jpibfi_visual_options[ 'description_option' ] || JPIBFIDescriptionOption::PageDescription == $lightbox_options[ 'description_option' ]))
|
143 |
$description = wp_kses( $post->post_excerpt, array() );
|
144 |
else
|
145 |
$description = get_the_title($post->ID);
|
151 |
$input_html = '<input class="jpibfi" type="hidden" ' . $attributes_html . '>';
|
152 |
$content = $input_html . $content;
|
153 |
|
154 |
+
$add_image_descriptions = JPIBFIDescriptionOption::ImageDescription == $jpibfi_visual_options[ 'description_option' ] || JPIBFIDescriptionOption::ImageDescription == $lightbox_options[ 'description_option' ];
|
155 |
|
156 |
//if we need to add data-jpibfi-description to each image
|
157 |
if ( $add_image_descriptions ){
|
161 |
return $content;
|
162 |
}
|
163 |
|
164 |
+
public function add_lightbox( $content ){
|
165 |
+
if ( ! JPIBFI_Client_Utilities::add_jpibfi() )
|
166 |
+
return $content;
|
167 |
+
|
168 |
+
global $post;
|
169 |
+
// universal IMG-Tag pattern matches everything between "<img" and the closing "(/)>"
|
170 |
+
// will be used to match all IMG-Tags in Content.
|
171 |
+
$imgPattern = "/<img([^\>]*?)>/i";
|
172 |
+
if (preg_match_all($imgPattern, $content, $imgTags)) {
|
173 |
+
foreach ($imgTags[0] as $imgTag) {
|
174 |
+
// only work on imgTags that do not already contain the string "colorbox-"
|
175 |
+
if (!preg_match('/jpibfi-group-/i', $imgTag)) {
|
176 |
+
if (!preg_match('/class=/i', $imgTag)) {
|
177 |
+
// imgTag does not contain class-attribute
|
178 |
+
$pattern = $imgPattern;
|
179 |
+
$replacement = '<img class="jpibfi-group-' . $post->ID . '" $1>';
|
180 |
+
} else {
|
181 |
+
// imgTag already contains class-attribute
|
182 |
+
$pattern = "/<img(.*?)class=('|\")([A-Za-z0-9 \/_\.\~\:-]*?)('|\")([^\>]*?)>/i";
|
183 |
+
$replacement = '<img$1class=$2$3 jpibfi-group-' . $post->ID . '$4$5>';
|
184 |
+
}
|
185 |
+
$replacedImgTag = preg_replace($pattern, $replacement, $imgTag);
|
186 |
+
$content = str_replace($imgTag, $replacedImgTag, $content);
|
187 |
+
}
|
188 |
+
}
|
189 |
+
}
|
190 |
+
return $content;
|
191 |
+
}
|
192 |
+
|
193 |
/* PRIVATE METHODS */
|
194 |
|
195 |
/*
|
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:1.
|
10 |
Author URI: http://mrsztuczkens.me/
|
11 |
*/
|
12 |
|
@@ -42,14 +42,16 @@ if ( ! class_exists( 'jQuery_Pin_It_Button_For_Images' ) ) :
|
|
42 |
private function includes() {
|
43 |
|
44 |
require_once(plugin_dir_path(__FILE__) . 'includes/class-jpibfi-globals.php');
|
45 |
-
JPIBFI_Globals::init(__FILE__, '1.
|
46 |
|
47 |
$files = array(
|
|
|
48 |
'includes/admin/class-jpibfi-admin-utilities.php',
|
49 |
'includes/admin/class-jpibfi-options.php',
|
50 |
'includes/admin/class-jpibfi-selection-options.php',
|
51 |
'includes/admin/class-jpibfi-advanced-options.php',
|
52 |
'includes/admin/class-jpibfi-visual-options.php',
|
|
|
53 |
'includes/admin/class-jpibfi-admin.php',
|
54 |
'includes/admin/class-jpibfi-import-export.php',
|
55 |
'includes/public/class-jpibfi-client-utilities.php',
|
6 |
Text Domain: jquery-pin-it-button-for-images
|
7 |
Domain Path: /languages
|
8 |
Author: Marcin Skrzypiec
|
9 |
+
Version:1.60
|
10 |
Author URI: http://mrsztuczkens.me/
|
11 |
*/
|
12 |
|
42 |
private function includes() {
|
43 |
|
44 |
require_once(plugin_dir_path(__FILE__) . 'includes/class-jpibfi-globals.php');
|
45 |
+
JPIBFI_Globals::init(__FILE__, '1.60', 'a');
|
46 |
|
47 |
$files = array(
|
48 |
+
'includes/consts/jpibfi-description-option.php',
|
49 |
'includes/admin/class-jpibfi-admin-utilities.php',
|
50 |
'includes/admin/class-jpibfi-options.php',
|
51 |
'includes/admin/class-jpibfi-selection-options.php',
|
52 |
'includes/admin/class-jpibfi-advanced-options.php',
|
53 |
'includes/admin/class-jpibfi-visual-options.php',
|
54 |
+
'includes/admin/class-jpibfi-lightbox-options.php',
|
55 |
'includes/admin/class-jpibfi-admin.php',
|
56 |
'includes/admin/class-jpibfi-import-export.php',
|
57 |
'includes/public/class-jpibfi-client-utilities.php',
|
js/jpibfi.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var jpibfi;!function(jpibfi){!function(ButtonPosition){ButtonPosition[ButtonPosition.TopLeft=0]="TopLeft",ButtonPosition[ButtonPosition.TopRight=1]="TopRight",ButtonPosition[ButtonPosition.BottomLeft=2]="BottomLeft",ButtonPosition[ButtonPosition.BottomRight=3]="BottomRight",ButtonPosition[ButtonPosition.Middle=4]="Middle"}(jpibfi.ButtonPosition||(jpibfi.ButtonPosition={}));jpibfi.ButtonPosition;!function(ShowButton){ShowButton[ShowButton.Hover=0]="Hover",ShowButton[ShowButton.AlwaysTouch=1]="AlwaysTouch",ShowButton[ShowButton.Always=2]="Always"}(jpibfi.ShowButton||(jpibfi.ShowButton={}));jpibfi.ShowButton}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var PinButtonGenerator=function(){function PinButtonGenerator($,settings,logger){this.$=$,this.settings=settings,this.logger=logger}return PinButtonGenerator.prototype.cancelHide=function($button){clearTimeout($button.data("jpibfi-timeoutId"))},PinButtonGenerator.prototype.hide=function($button,callback){void 0===callback&&(callback=function(){});var timeoutId=($button.data("jpibfi-indexer"),setTimeout(function(){$button.remove(),callback.call(null,null)},100));$button.data("jpibfi-timeoutId",timeoutId)},PinButtonGenerator.prototype.generateForImage=function($image){var indexer=$image.data("jpibfi-indexer"),$anchor=this.$("<a/>",{href:"#","class":"pinit-button","data-jpibfi-indexer":indexer,text:""}),that=this;$anchor.click(function(){var $this=that.$(this);that.logger.logString("Pin In button clicked");var index=that.$(this).data("jpibfi-indexer"),$image=that.$('img[data-jpibfi-indexer="'+index+'"]'),bookmarkDescription="",descriptionForUrl="",bookmarkUrl="";if(that.settings.usePostUrl){var $inputWithData=$image.closest(".jpibfi_container").find("input.jpibfi").first();$inputWithData.length&&(descriptionForUrl=$inputWithData.data("jpibfi-description"),bookmarkUrl=$inputWithData.data("jpibfi-url"))}bookmarkUrl=bookmarkUrl||that.settings.pageUrl,3==that.settings.descriptionOption?bookmarkDescription=$image.attr("title")||$image.attr("alt"):2==that.settings.descriptionOption?bookmarkDescription=descriptionForUrl||that.settings.pageDescription:4==that.settings.descriptionOption?bookmarkDescription=that.settings.siteTitle:5==that.settings.descriptionOption?bookmarkDescription=$image.data("jpibfi-description"):6==that.settings.descriptionOption&&(bookmarkDescription=$image.attr("alt")),bookmarkDescription=bookmarkDescription||descriptionForUrl||that.settings.pageTitle;var imageUrl="http://pinterest.com/pin/create/bookmarklet/?is_video="+encodeURIComponent("false")+"&url="+encodeURIComponent(bookmarkUrl)+"&media="+encodeURIComponent(that.getImageUrl($image))+"&description="+encodeURIComponent(bookmarkDescription);return that.settings.isTouchDevice?($this.attr("href",imageUrl).attr("target","_blank"),!0):(window.open(imageUrl,"_blank","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1"),!1)});var position=that.calculateButtonPosition($image);return $image.after($anchor),$anchor.css("visibility","hidden").show().offset({left:position.left,top:position.top}).css("visibility","visible"),$anchor},PinButtonGenerator.prototype.getImageUrl=function($elem){var defaultUrl=this.$.fn.prop&&$elem.prop("src")||$elem.attr("src");return this.settings.pinLinkedImages?this.getLinkedImageUrl($elem)||defaultUrl:defaultUrl},PinButtonGenerator.prototype.getLinkedImageUrl=function($element){var $parent=$element.parents("a").first();if($parent.length){var href=$parent.attr("href"),useUrl=!!href&&this.fileExtensionAllowed(this.getFileExtension(href),this.settings.pinLinkedImagesExtensions);if(useUrl)return href}return null},PinButtonGenerator.prototype.getFileExtension=function(url){var parts=url.split(".");return 1==parts.length?"":parts.pop().split(/\#|\?/)[0]},PinButtonGenerator.prototype.fileExtensionAllowed=function(extension,listOfExtensions){if(!listOfExtensions.length)return!0;for(var extensions=listOfExtensions.split(","),i=0;i<extensions.length;i++)if(extensions[i]==extension)return!0;return!1},PinButtonGenerator.prototype.urlInCurrentDomain=function(url){var currentDomain=document.domain.replace(/^www./,"");return-1!=url.indexOf(currentDomain)},PinButtonGenerator.prototype.calculateButtonPosition=function($image){var position=$image.offset(),imageDimensions={width:$image.get(0).clientWidth,height:$image.get(0).clientHeight};switch(this.settings.buttonPosition){case jpibfi.ButtonPosition.TopLeft:position.left+=this.settings.buttonMarginLeft,position.top+=this.settings.buttonMarginTop;break;case jpibfi.ButtonPosition.TopRight:position.top+=this.settings.buttonMarginTop,position.left=position.left+imageDimensions.width-this.settings.buttonMarginRight-this.settings.pinImageWidth;break;case jpibfi.ButtonPosition.BottomLeft:position.left+=this.settings.buttonMarginLeft,position.top=position.top+imageDimensions.height-this.settings.buttonMarginBottom-this.settings.pinImageHeight;break;case jpibfi.ButtonPosition.BottomRight:position.left=position.left+imageDimensions.width-this.settings.buttonMarginRight-this.settings.pinImageWidth,position.top=position.top+imageDimensions.height-this.settings.buttonMarginBottom-this.settings.pinImageHeight;break;case jpibfi.ButtonPosition.Middle:position.left=Math.round(position.left+imageDimensions.width/2-this.settings.pinImageWidth/2),position.top=Math.round(position.top+imageDimensions.height/2-this.settings.pinImageHeight/2)}return position},PinButtonGenerator}();jpibfi.PinButtonGenerator=PinButtonGenerator}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var Logger=function(){function Logger(printLog){this._printLog=printLog&&"undefined"!=typeof console&&"undefined"!=typeof console.log,this._jsonStringifyExists="undefined"!=typeof JSON&&"function"==typeof JSON.stringify}return Logger.prototype._logObject=function(obj){var out="";for(var p in obj)out+=p+": "+obj[p]+"\n";console.log("jpibfi debug: "+out)},Logger.prototype.logString=function(message){this._printLog&&console.log("jpibfi debug: "+message)},Logger.prototype.logObject=function(obj){this._printLog&&(this._jsonStringifyExists?console.log("jpibfi debugz: "+JSON.stringify(obj,null,4)):this._logObject(obj))},Logger}();jpibfi.Logger=Logger}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var Settings=function(){function Settings(settings){this.filterSelector="*",this.notSelector="",this.buttonMarginTop=parseInt(settings.buttonMarginTop),this.buttonMarginRight=parseInt(settings.buttonMarginRight),this.buttonMarginBottom=parseInt(settings.buttonMarginBottom),this.buttonMarginLeft=parseInt(settings.buttonMarginLeft),this.buttonPosition=settings.hasOwnProperty("buttonPosition")?parseInt(settings.buttonPosition):4,this.debug=settings.hasOwnProperty("debug")?"1"==settings.debug:!1,this.descriptionOption=settings.hasOwnProperty("descriptionOption")?parseInt(settings.descriptionOption):1,this.imageSelector=settings.imageSelector,this.isTouchDevice="ontouchstart"in window||navigator.hasOwnProperty("maxTouchPoints"),this.minImageWidth=settings.hasOwnProperty("minImageWidth")?parseInt(settings.minImageWidth):0,this.minImageHeight=settings.hasOwnProperty("minImageHeight")?parseInt(settings.minImageHeight):0,this.showButton=settings.hasOwnProperty("showButton")?this.parseShowButtonSettings(settings.showButton):jpibfi.ShowButton.Hover,this.pageDescription=settings.pageDescription,this.pageTitle=settings.pageTitle,this.pageUrl=settings.pageUrl,this.pinImageHeight=parseInt(settings.pinImageHeight),this.pinImageWidth=parseInt(settings.pinImageWidth),this.pinLinkedImages=1==settings.pinLinkedImages,this.pinLinkedImagesExtensions=settings.pinLinkedImagesExtensions,this.retinaFriendly=settings.hasOwnProperty("retinaFriendly")?1==settings.retinaFriendly:!1,this.siteTitle=settings.siteTitle,this.usePostUrl=settings.hasOwnProperty("usePostUrl")?settings.usePostUrl:!0,this.containerSelector=settings.containerSelector,this.notSelector=settings.hasOwnProperty("disabledClasses")?this.createSelectorFromList(settings.disabledClasses):"",this.filterSelector=settings.hasOwnProperty("enabledClasses")?this.createSelectorFromList(settings.enabledClasses)||"*":"*",this.adjustPinImageSize()}return Settings.prototype.adjustPinImageSize=function(){this.retinaFriendly&&(this.pinImageHeight=Math.ceil(this.pinImageHeight/2),this.pinImageWidth=Math.ceil(this.pinImageWidth/2))},Settings.prototype.createSelectorFromList=function(classes){for(var arrayOfClasses=classes.split(";"),selector="",i=0;i<arrayOfClasses.length;i++)arrayOfClasses[i]&&(selector+="."+arrayOfClasses[i]+",");return selector?selector.substr(0,selector.length-1):selector},Settings.prototype.parseShowButtonSettings=function(showButton){switch(showButton){case"always":return jpibfi.ShowButton.Always;case"always_touch":return jpibfi.ShowButton.AlwaysTouch;case"hover":default:return jpibfi.ShowButton.Hover}},Settings}();jpibfi.Settings=Settings}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){"use strict";var Hover=function(){function Hover($,settings,logger,buttonGenerator){this.$=$,this.settings=settings,this.logger=logger,this.buttonGenerator=buttonGenerator,this._indexer=0,this.ignoreAttributeName="data-jpibfi-ignore",this.ignoreAttributeSelector="["+this.ignoreAttributeName+"]",this.indexerAttributeName="data-jpibfi-indexer",this.indexerAttributeSelector="["+this.indexerAttributeName+"]"}return Hover.prototype.init=function(){var that=this;this.$(document).delegate(that.settings.imageSelector,"mouseenter",function(){var $image=that.$(this);if(!$image.is(that.ignoreAttributeSelector)){var ignoreImage=$image.is(that.settings.notSelector)||$image.is(that.settings.filterSelector)===!1||$image[0].clientWidth<that.settings.minImageWidth||$image[0].clientHeight<that.settings.minImageHeight;if(ignoreImage)return $image.attr(that.ignoreAttributeName,1..toString());var indexer=$image.attr(that.indexerAttributeName);indexer||(indexer=(that._indexer++).toString(),$image.attr(that.indexerAttributeName,indexer));var $button=that.$('a.pinit-button[data-jpibfi-indexer="'+indexer+'"]');if(1==$button.length)that.buttonGenerator.cancelHide($button);else{var $anchor=that.buttonGenerator.generateForImage($image);null!=$anchor&&($anchor.mouseenter(function(){that.buttonGenerator.cancelHide(that.$(this))}),$anchor.mouseleave(function(){that.buttonGenerator.hide(that.$(this),function(){$image.removeClass("pinit-hover")})}),$image.addClass("pinit-hover"))}}}),that.$(document).delegate(that.settings.imageSelector,"mouseleave",function(){var $image=that.$(this),indexer=$image.attr(that.indexerAttributeName);if(indexer){var $button=that.$('a.pinit-button[data-jpibfi-indexer="'+indexer+'"]');that.buttonGenerator.hide($button,function(){$image.removeClass("pinit-hover")})}})},Hover}();jpibfi.Hover=Hover}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){"use strict";var Plugin=function(){function Plugin($,options){this.$=$,this.settings=new jpibfi.Settings(this.$.extend({pageUrl:document.URL,pageTitle:document.title,pageDescription:$('meta[name="description"]').attr("content")||""},options)),this.logger=new jpibfi.Logger(this.settings.debug),this.logger.logObject(this.settings),this.buttonGenerator=new jpibfi.PinButtonGenerator(this.$,this.settings,this.logger)}return Plugin.prototype.init=function(){var _this=this;this.addContainers(),this.$(document).scroll(function(){return _this.addContainers()}),this.$(document).ajaxSuccess(function(){return _this.addContainers()});var hover=new jpibfi.Hover(this.$,this.settings,this.logger,this.buttonGenerator);hover.init()},Plugin.prototype.addContainers=function(){var $containers=this.$(".jpibfi").not(".jpibfi-ignore");0!=$containers.length&&($containers.closest(this.settings.containerSelector).addClass("jpibfi_container"),$containers.addClass("jpibfi-ignore"))},Plugin}();!function($){$(document).ready(function(){var plugin=new Plugin($,jpibfi_options);plugin.init()})}(jQuery)}(jpibfi||(jpibfi={}));
|
1 |
+
var jpibfi;!function(jpibfi){!function(ButtonPosition){ButtonPosition[ButtonPosition.TopLeft=0]="TopLeft",ButtonPosition[ButtonPosition.TopRight=1]="TopRight",ButtonPosition[ButtonPosition.BottomLeft=2]="BottomLeft",ButtonPosition[ButtonPosition.BottomRight=3]="BottomRight",ButtonPosition[ButtonPosition.Middle=4]="Middle"}(jpibfi.ButtonPosition||(jpibfi.ButtonPosition={}));jpibfi.ButtonPosition;!function(ShowButton){ShowButton[ShowButton.Hover=0]="Hover",ShowButton[ShowButton.AlwaysTouch=1]="AlwaysTouch",ShowButton[ShowButton.Always=2]="Always"}(jpibfi.ShowButton||(jpibfi.ShowButton={}));jpibfi.ShowButton}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var PinButtonGenerator=function(){function PinButtonGenerator($,settings,logger){this.$=$,this.settings=settings,this.logger=logger}return PinButtonGenerator.prototype.cancelHide=function($button){clearTimeout($button.data("jpibfi-timeoutId"))},PinButtonGenerator.prototype.hide=function($button,callback){void 0===callback&&(callback=function(){});var timeoutId=($button.data("jpibfi-indexer"),setTimeout(function(){$button.remove(),callback.call(null,null)},100));$button.data("jpibfi-timeoutId",timeoutId)},PinButtonGenerator.prototype.generateForImage=function($image){var indexer=$image.data("jpibfi-indexer"),$anchor=this.$("<a/>",{href:"#","class":"pinit-button","data-jpibfi-indexer":indexer,text:""}),that=this;$anchor.click(function(){var $this=that.$(this);that.logger.logString("Pin In button clicked");var index=that.$(this).data("jpibfi-indexer"),$image=that.$('img[data-jpibfi-indexer="'+index+'"]'),descriptionForUrl="",bookmarkUrl="";if(that.settings.usePostUrl){var $inputWithData=$image.closest(".jpibfi_container").find("input.jpibfi").first();$inputWithData.length&&(descriptionForUrl=$inputWithData.data("jpibfi-description"),bookmarkUrl=$inputWithData.data("jpibfi-url"))}bookmarkUrl=bookmarkUrl||that.settings.pageUrl;var bookmarkDescription=jpibfi.Utils.getDescription($image,that.settings.descriptionOption,that.settings.pageTitle,that.settings.pageDescription,that.settings.siteTitle),imageUrl="http://pinterest.com/pin/create/bookmarklet/?is_video="+encodeURIComponent("false")+"&url="+encodeURIComponent(bookmarkUrl)+"&media="+encodeURIComponent(that.getImageUrl($image))+"&description="+encodeURIComponent(bookmarkDescription);return that.settings.isTouchDevice?($this.attr("href",imageUrl).attr("target","_blank"),!0):(window.open(imageUrl,"_blank","width=632,height=253,status=0,toolbar=0,menubar=0,location=1,scrollbars=1"),!1)});var position=that.calculateButtonPosition($image);return $image.after($anchor),$anchor.css("visibility","hidden").show().offset({left:position.left,top:position.top}).css("visibility","visible"),$anchor},PinButtonGenerator.prototype.getImageUrl=function($elem){var defaultUrl=this.$.fn.prop&&$elem.prop("src")||$elem.attr("src");return this.settings.pinLinkedImages?this.getLinkedImageUrl($elem)||defaultUrl:defaultUrl},PinButtonGenerator.prototype.getLinkedImageUrl=function($element){var $parent=$element.parents("a").first();if($parent.length){var href=$parent.attr("href"),useUrl=!!href&&this.fileExtensionAllowed(this.getFileExtension(href),this.settings.pinLinkedImagesExtensions);if(useUrl)return href}return null},PinButtonGenerator.prototype.getFileExtension=function(url){var parts=url.split(".");return 1==parts.length?"":parts.pop().split(/\#|\?/)[0]},PinButtonGenerator.prototype.fileExtensionAllowed=function(extension,listOfExtensions){if(!listOfExtensions.length)return!0;for(var extensions=listOfExtensions.split(","),i=0;i<extensions.length;i++)if(extensions[i]==extension)return!0;return!1},PinButtonGenerator.prototype.urlInCurrentDomain=function(url){var currentDomain=document.domain.replace(/^www./,"");return-1!=url.indexOf(currentDomain)},PinButtonGenerator.prototype.calculateButtonPosition=function($image){var position=$image.offset(),imageDimensions={width:$image.get(0).clientWidth,height:$image.get(0).clientHeight};switch(this.settings.buttonPosition){case jpibfi.ButtonPosition.TopLeft:position.left+=this.settings.buttonMarginLeft,position.top+=this.settings.buttonMarginTop;break;case jpibfi.ButtonPosition.TopRight:position.top+=this.settings.buttonMarginTop,position.left=position.left+imageDimensions.width-this.settings.buttonMarginRight-this.settings.pinImageWidth;break;case jpibfi.ButtonPosition.BottomLeft:position.left+=this.settings.buttonMarginLeft,position.top=position.top+imageDimensions.height-this.settings.buttonMarginBottom-this.settings.pinImageHeight;break;case jpibfi.ButtonPosition.BottomRight:position.left=position.left+imageDimensions.width-this.settings.buttonMarginRight-this.settings.pinImageWidth,position.top=position.top+imageDimensions.height-this.settings.buttonMarginBottom-this.settings.pinImageHeight;break;case jpibfi.ButtonPosition.Middle:position.left=Math.round(position.left+imageDimensions.width/2-this.settings.pinImageWidth/2),position.top=Math.round(position.top+imageDimensions.height/2-this.settings.pinImageHeight/2)}return position},PinButtonGenerator}();jpibfi.PinButtonGenerator=PinButtonGenerator}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var Logger=function(){function Logger(printLog){this._printLog=printLog&&"undefined"!=typeof console&&"undefined"!=typeof console.log,this._jsonStringifyExists="undefined"!=typeof JSON&&"function"==typeof JSON.stringify}return Logger.prototype._logObject=function(obj){var out="";for(var p in obj)out+=p+": "+obj[p]+"\n";console.log("jpibfi debug: "+out)},Logger.prototype.logString=function(message){this._printLog&&console.log("jpibfi debug: "+message)},Logger.prototype.logObject=function(obj){this._printLog&&(this._jsonStringifyExists?console.log("jpibfi debugz: "+JSON.stringify(obj,null,4)):this._logObject(obj))},Logger}();jpibfi.Logger=Logger}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var Settings=function(){function Settings(settings){this.filterSelector="*",this.notSelector="",this.buttonMarginTop=parseInt(settings.buttonMarginTop),this.buttonMarginRight=parseInt(settings.buttonMarginRight),this.buttonMarginBottom=parseInt(settings.buttonMarginBottom),this.buttonMarginLeft=parseInt(settings.buttonMarginLeft),this.buttonPosition=settings.hasOwnProperty("buttonPosition")?parseInt(settings.buttonPosition):4,this.debug=settings.hasOwnProperty("debug")?"1"==settings.debug:!1,this.descriptionOption=settings.hasOwnProperty("descriptionOption")?parseInt(settings.descriptionOption):1,this.imageSelector=this.createImageSelector(settings.imageSelector),this.isTouchDevice="ontouchstart"in window||navigator.hasOwnProperty("maxTouchPoints"),this.minImageWidth=settings.hasOwnProperty("minImageWidth")?parseInt(settings.minImageWidth):0,this.minImageHeight=settings.hasOwnProperty("minImageHeight")?parseInt(settings.minImageHeight):0,this.showButton=settings.hasOwnProperty("showButton")?this.parseShowButtonSettings(settings.showButton):jpibfi.ShowButton.Hover,this.pageDescription=settings.pageDescription,this.pageTitle=settings.pageTitle,this.pageUrl=settings.pageUrl,this.pinImageHeight=parseInt(settings.pinImageHeight),this.pinImageWidth=parseInt(settings.pinImageWidth),this.pinLinkedImages=1==settings.pinLinkedImages,this.pinLinkedImagesExtensions=settings.pinLinkedImagesExtensions,this.retinaFriendly=settings.hasOwnProperty("retinaFriendly")?1==settings.retinaFriendly:!1,this.siteTitle=settings.siteTitle,this.usePostUrl=settings.hasOwnProperty("usePostUrl")?settings.usePostUrl:!0,this.containerSelector=settings.containerSelector,this.notSelector=settings.hasOwnProperty("disabledClasses")?this.createSelectorFromList(settings.disabledClasses):"",this.filterSelector=settings.hasOwnProperty("enabledClasses")?this.createSelectorFromList(settings.enabledClasses)||"*":"*",this.lightbox=new LightboxSettings(settings.lightbox),this.adjustPinImageSize()}return Settings.prototype.adjustPinImageSize=function(){this.retinaFriendly&&(this.pinImageHeight=Math.ceil(this.pinImageHeight/2),this.pinImageWidth=Math.ceil(this.pinImageWidth/2))},Settings.prototype.createImageSelector=function(selector){return selector+",.jpibfi-lightbox img"},Settings.prototype.createSelectorFromList=function(classes){for(var arrayOfClasses=classes.split(";"),selector="",i=0;i<arrayOfClasses.length;i++)arrayOfClasses[i]&&(selector+="."+arrayOfClasses[i]+",");return selector?selector.substr(0,selector.length-1):selector},Settings.prototype.parseShowButtonSettings=function(showButton){switch(showButton){case"always":return jpibfi.ShowButton.Always;case"always_touch":return jpibfi.ShowButton.AlwaysTouch;case"hover":default:return jpibfi.ShowButton.Hover}},Settings}();jpibfi.Settings=Settings;var LightboxSettings=function(){function LightboxSettings(settings){this.descriptionOption=parseInt(settings.descriptionOption),this.enabled=settings.enabled}return LightboxSettings}();jpibfi.LightboxSettings=LightboxSettings}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){var Utils=function(){function Utils(){}return Utils.getDescription=function($image,descriptionOption,pageTitle,pageDescription,siteTitle){return this.getDescriptionValue($image,descriptionOption,pageTitle,pageDescription,siteTitle)||pageTitle},Utils.getDescriptionValue=function($image,descriptionOption,pageTitle,pageDescription,siteTitle){switch(descriptionOption){case 1:return pageTitle;case 2:var $inputWithData=$image.closest(".jpibfi_container").find("input.jpibfi").first(),descriptionForUrl=$inputWithData.data("jpibfi-description");return descriptionForUrl||pageDescription;case 3:return $image.attr("title")||$image.attr("alt");case 4:return siteTitle;case 5:return $image.data("jpibfi-description");case 6:return $image.attr("alt")}},Utils}();jpibfi.Utils=Utils}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){"use strict";var Hover=function(){function Hover($,settings,logger,buttonGenerator){this.$=$,this.settings=settings,this.logger=logger,this.buttonGenerator=buttonGenerator,this._indexer=0,this.ignoreAttributeName="data-jpibfi-ignore",this.ignoreAttributeSelector="["+this.ignoreAttributeName+"]",this.indexerAttributeName="data-jpibfi-indexer",this.indexerAttributeSelector="["+this.indexerAttributeName+"]"}return Hover.prototype.init=function(){var that=this;this.$(document).delegate(that.settings.imageSelector,"mouseenter",function(){var $image=that.$(this);if(!$image.is(that.ignoreAttributeSelector)){var ignoreImage=$image.is(that.settings.notSelector)||$image.is(that.settings.filterSelector)===!1||$image[0].clientWidth<that.settings.minImageWidth||$image[0].clientHeight<that.settings.minImageHeight;if(ignoreImage)return $image.attr(that.ignoreAttributeName,1..toString());var indexer=$image.attr(that.indexerAttributeName);indexer||(indexer=(that._indexer++).toString(),$image.attr(that.indexerAttributeName,indexer));var $button=that.$('a.pinit-button[data-jpibfi-indexer="'+indexer+'"]');if(1==$button.length)that.buttonGenerator.cancelHide($button);else{var $anchor=that.buttonGenerator.generateForImage($image);null!=$anchor&&($anchor.mouseenter(function(){that.buttonGenerator.cancelHide(that.$(this))}),$anchor.mouseleave(function(){that.buttonGenerator.hide(that.$(this),function(){$image.removeClass("pinit-hover")})}),$image.addClass("pinit-hover"))}}}),that.$(document).delegate(that.settings.imageSelector,"mouseleave",function(){var $image=that.$(this),indexer=$image.attr(that.indexerAttributeName);if(indexer){var $button=that.$('a.pinit-button[data-jpibfi-indexer="'+indexer+'"]');that.buttonGenerator.hide($button,function(){$image.removeClass("pinit-hover")})}})},Hover}();jpibfi.Hover=Hover}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){"use strict";var Lightbox=function(){function Lightbox($,settings){this.$=$,this.settings=settings,this.groupClass="jpibfi-group-"}return Lightbox.prototype.init=function(){var that=this;this.$("a:has(img[class*=jpibfi-group-])").each(function(){var $img=that.$(this).find("img"),rel=$img.attr("class").match("jpibfi-group-[0-9]+"),title=jpibfi.Utils.getDescription($img,that.settings.lightbox.descriptionOption,that.settings.pageTitle,that.settings.pageDescription,that.settings.siteTitle);that.$(this).colorbox({className:"jpibfi-lightbox",rel:rel[0],title:title,maxWidth:"95%",maxHeight:"95%",onComplete:function(){that.$(window).trigger("jpibfi-refresh-scroll"),that.$("#cboxTitle").hide(),that.$("#cboxLoadedContent").append(that.$("#cboxTitle").html()).css({color:that.$("#cboxTitle").css("color")}),that.$.fn.colorbox.resize()}})})},Lightbox}();jpibfi.Lightbox=Lightbox}(jpibfi||(jpibfi={}));var jpibfi;!function(jpibfi){"use strict";var Plugin=function(){function Plugin($,options){this.$=$,this.settings=new jpibfi.Settings(this.$.extend({pageUrl:document.URL,pageTitle:document.title,pageDescription:$('meta[name="description"]').attr("content")||""},options)),this.logger=new jpibfi.Logger(this.settings.debug),this.logger.logObject(this.settings),this.buttonGenerator=new jpibfi.PinButtonGenerator(this.$,this.settings,this.logger)}return Plugin.prototype.init=function(){var _this=this;this.addContainers(),this.$(document).scroll(function(){return _this.addContainers()}),this.$(document).ajaxSuccess(function(){return _this.addContainers()});var hover=new jpibfi.Hover(this.$,this.settings,this.logger,this.buttonGenerator);if(hover.init(),this.settings.lightbox.enabled){var lightbox=new jpibfi.Lightbox(this.$,this.settings);lightbox.init()}},Plugin.prototype.addContainers=function(){var $containers=this.$(".jpibfi").not(".jpibfi-ignore");0!=$containers.length&&($containers.closest(this.settings.containerSelector).addClass("jpibfi_container"),$containers.addClass("jpibfi-ignore"))},Plugin}();!function($){$(document).ready(function(){var plugin=new Plugin($,jpibfi_options);plugin.init()})}(jQuery)}(jpibfi||(jpibfi={}));
|
js/jquery.colorbox-min.js
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
Colorbox 1.6.4
|
3 |
+
license: MIT
|
4 |
+
http://www.jacklmoore.com/colorbox
|
5 |
+
*/
|
6 |
+
(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!U){U=$=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=t('<button type="button"/>').attr({id:Z+"Slideshow"}),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;U&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),U&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if($=!0,q=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e).eq(0);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),q=_.get("createImg"),t(q).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(q.height=q.height/i.devicePixelRatio,q.width=q.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){q.height-=q.height*e,q.width-=q.width*e},_.mw&&q.width>_.mw&&(e=(q.width-_.mw)/q.width,o()),_.mh&&q.height>_.mh&&(e=(q.height-_.mh)/q.height,o())),_.h&&(q.style.marginTop=Math.max(_.mh-q.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(q.style.cursor="pointer",t(q).bind("click."+Z,function(){J.next()})),q.style.width=q.width+"px",q.style.height=q.height+"px",h(q)},1)}),q.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,q,U,$,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),$=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;U&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(U){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(q).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;U&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!$&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!$&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){U&&!G&&(G=!0,U=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window);
|
languages/jquery-pin-it-button-for-images.pot
CHANGED
@@ -31,16 +31,20 @@ msgstr ""
|
|
31 |
msgid "Import/Export"
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: includes/admin/class-jpibfi-admin.php:
|
|
|
|
|
|
|
|
|
35 |
msgid "Settings"
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: includes/admin/class-jpibfi-admin.php:
|
39 |
msgid "Disable \"Pin it\" button for this post (works only on single pages/posts)"
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: includes/admin/class-jpibfi-admin.php:
|
43 |
-
msgid "jQuery Pin It Button for Images Pro is
|
44 |
msgstr ""
|
45 |
|
46 |
#: includes/admin/class-jpibfi-advanced-options.php:81
|
@@ -107,6 +111,58 @@ msgstr ""
|
|
107 |
msgid "Choose a JSON (.json) file to upload, then click Upload file and import."
|
108 |
msgstr ""
|
109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
#: includes/admin/class-jpibfi-selection-options.php:137
|
111 |
msgid "Image selector"
|
112 |
msgstr ""
|
@@ -215,10 +271,6 @@ msgstr ""
|
|
215 |
msgid "When the \"Pin it\" button should be visible."
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: includes/admin/class-jpibfi-visual-options.php:183
|
219 |
-
msgid "Description source"
|
220 |
-
msgstr ""
|
221 |
-
|
222 |
#: includes/admin/class-jpibfi-visual-options.php:193
|
223 |
msgid "From where the Pinterest message should be taken. Please note that \"Image description\" works properly only for images that were added to your Media Library."
|
224 |
msgstr ""
|
@@ -307,30 +359,6 @@ msgstr ""
|
|
307 |
msgid "This feature is disabled in this version of the plugin. Consider buying <a target=\"_blank\" href=\"%s\">the PRO version</a>."
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: includes/admin/class-jpibfi-visual-options.php:433
|
311 |
-
msgid "Page title"
|
312 |
-
msgstr ""
|
313 |
-
|
314 |
-
#: includes/admin/class-jpibfi-visual-options.php:435
|
315 |
-
msgid "Page description"
|
316 |
-
msgstr ""
|
317 |
-
|
318 |
-
#: includes/admin/class-jpibfi-visual-options.php:437
|
319 |
-
msgid "Picture title or (if title not available) alt attribute"
|
320 |
-
msgstr ""
|
321 |
-
|
322 |
-
#: includes/admin/class-jpibfi-visual-options.php:439
|
323 |
-
msgid "Site title (Settings->General)"
|
324 |
-
msgstr ""
|
325 |
-
|
326 |
-
#: includes/admin/class-jpibfi-visual-options.php:441
|
327 |
-
msgid "Image description"
|
328 |
-
msgstr ""
|
329 |
-
|
330 |
-
#: includes/admin/class-jpibfi-visual-options.php:443
|
331 |
-
msgid "Image alt attribute"
|
332 |
-
msgstr ""
|
333 |
-
|
334 |
#: includes/admin/class-jpibfi-visual-options.php:469
|
335 |
msgid "Always link to individual post page"
|
336 |
msgstr ""
|
31 |
msgid "Import/Export"
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: includes/admin/class-jpibfi-admin.php:197
|
35 |
+
msgid "Lightbox"
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: includes/admin/class-jpibfi-admin.php:235, jquery-pin-it-button-for-images.php:137
|
39 |
msgid "Settings"
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: includes/admin/class-jpibfi-admin.php:271
|
43 |
msgid "Disable \"Pin it\" button for this post (works only on single pages/posts)"
|
44 |
msgstr ""
|
45 |
|
46 |
+
#: includes/admin/class-jpibfi-admin.php:341
|
47 |
+
msgid "jQuery Pin It Button for Images Pro is available. Click <a target=\"_blank\" href=\"%s\">here</a> to learn more."
|
48 |
msgstr ""
|
49 |
|
50 |
#: includes/admin/class-jpibfi-advanced-options.php:81
|
111 |
msgid "Choose a JSON (.json) file to upload, then click Upload file and import."
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:81
|
115 |
+
msgid "Lightbox Settings"
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:95
|
119 |
+
msgid "Enabled"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:105
|
123 |
+
msgid "Activate lightbox in posts"
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:117, includes/admin/class-jpibfi-visual-options.php:183
|
127 |
+
msgid "Description source"
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:127
|
131 |
+
msgid "From where the lightbox description should be taken. Please note that \"Image description\" works properly only for images that were added to your Media Library."
|
132 |
+
msgstr ""
|
133 |
+
|
134 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:149
|
135 |
+
msgid "Lightbox module uses Colorbox. Visit <a href=\"http://www.jacklmoore.com/colorbox/\" target=\"_blank\">this page</a> to learn more about Colorbox."
|
136 |
+
msgstr ""
|
137 |
+
|
138 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:171
|
139 |
+
msgid "Lightbox settings"
|
140 |
+
msgstr ""
|
141 |
+
|
142 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:207, includes/admin/class-jpibfi-visual-options.php:433
|
143 |
+
msgid "Page title"
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:209, includes/admin/class-jpibfi-visual-options.php:435
|
147 |
+
msgid "Page description (excerpt)"
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:211, includes/admin/class-jpibfi-visual-options.php:437
|
151 |
+
msgid "Image title or (if title not available) alt attribute"
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:213, includes/admin/class-jpibfi-visual-options.php:439
|
155 |
+
msgid "Site title (Settings->General)"
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:215, includes/admin/class-jpibfi-visual-options.php:441
|
159 |
+
msgid "Image description"
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: includes/admin/class-jpibfi-lightbox-options.php:217, includes/admin/class-jpibfi-visual-options.php:443
|
163 |
+
msgid "Image alt attribute"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
#: includes/admin/class-jpibfi-selection-options.php:137
|
167 |
msgid "Image selector"
|
168 |
msgstr ""
|
271 |
msgid "When the \"Pin it\" button should be visible."
|
272 |
msgstr ""
|
273 |
|
|
|
|
|
|
|
|
|
274 |
#: includes/admin/class-jpibfi-visual-options.php:193
|
275 |
msgid "From where the Pinterest message should be taken. Please note that \"Image description\" works properly only for images that were added to your Media Library."
|
276 |
msgstr ""
|
359 |
msgid "This feature is disabled in this version of the plugin. Consider buying <a target=\"_blank\" href=\"%s\">the PRO version</a>."
|
360 |
msgstr ""
|
361 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
362 |
#: includes/admin/class-jpibfi-visual-options.php:469
|
363 |
msgid "Always link to individual post page"
|
364 |
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.
|
6 |
-
Stable tag: 1.
|
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,10 @@ Please report them in the plugin's support forum on Wordpress.org.
|
|
68 |
|
69 |
== Changelog ==
|
70 |
|
|
|
|
|
|
|
|
|
71 |
= 1.52 =
|
72 |
* Release 2016-05-05
|
73 |
* Added import/export settings feature
|
@@ -240,6 +244,9 @@ Please report them in the plugin's support forum on Wordpress.org.
|
|
240 |
|
241 |
== Upgrade Notice ==
|
242 |
|
|
|
|
|
|
|
243 |
= 1.52 =
|
244 |
* Added import/export settings feature
|
245 |
|
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.5.3
|
6 |
+
Stable tag: 1.60
|
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 |
+
= 1.60 =
|
72 |
+
* Release 2016-07-04
|
73 |
+
* Added lightbox feature
|
74 |
+
|
75 |
= 1.52 =
|
76 |
* Release 2016-05-05
|
77 |
* Added import/export settings feature
|
244 |
|
245 |
== Upgrade Notice ==
|
246 |
|
247 |
+
= 1.60 =
|
248 |
+
* Added lightbox feature
|
249 |
+
|
250 |
= 1.52 =
|
251 |
* Added import/export settings feature
|
252 |
|
uninstall.php
CHANGED
@@ -10,6 +10,7 @@ delete_option( 'jpibfi_selection_options' );
|
|
10 |
delete_option( 'jpibfi_visual_options' );
|
11 |
delete_option( 'jpibfi_advanced_options' );
|
12 |
delete_option( 'jpibfi_version' );
|
|
|
13 |
|
14 |
//delete added metadata from all posts
|
15 |
delete_post_meta_by_key( 'jpibfi_meta' );
|
10 |
delete_option( 'jpibfi_visual_options' );
|
11 |
delete_option( 'jpibfi_advanced_options' );
|
12 |
delete_option( 'jpibfi_version' );
|
13 |
+
delete_option( 'jpibfi_lightbox_options' );
|
14 |
|
15 |
//delete added metadata from all posts
|
16 |
delete_post_meta_by_key( 'jpibfi_meta' );
|