Version Description
- Updated it to match original JetPack plugin updates 2.2.2
- Bugfix: Comments not working due to jQuery.spin and spin.js issue (props amoshonas)
Download this release
Release Info
| Developer | smub |
| Plugin | |
| Version | 0.6 |
| Comparing to | |
| See all releases | |
Code changes from version 0.5 to 0.6
- jetpack-carousel.css +1 -1
- jetpack-carousel.js +8 -4
- jetpack-carousel.php +44 -39
- readme.txt +20 -7
jetpack-carousel.css
CHANGED
|
@@ -203,7 +203,7 @@ div.jp-carousel-buttons a:hover {
|
|
| 203 |
padding:0.35em 0 0;
|
| 204 |
position: absolute;
|
| 205 |
text-align: left;
|
| 206 |
-
width:
|
| 207 |
-webkit-transition: color 200ms linear;
|
| 208 |
-moz-transition: color 200ms linear;
|
| 209 |
-o-transition: color 200ms linear;
|
| 203 |
padding:0.35em 0 0;
|
| 204 |
position: absolute;
|
| 205 |
text-align: left;
|
| 206 |
+
width: 90%;
|
| 207 |
-webkit-transition: color 200ms linear;
|
| 208 |
-moz-transition: color 200ms linear;
|
| 209 |
-o-transition: color 200ms linear;
|
jetpack-carousel.js
CHANGED
|
@@ -4,7 +4,7 @@ jQuery(document).ready(function($) {
|
|
| 4 |
// gallery faded layer and container elements
|
| 5 |
var overlay, comments, gallery, container, nextButton, previousButton, info, title,
|
| 6 |
caption, resizeTimeout, mouseTimeout, photo_info, close_hint, commentInterval, buttons,
|
| 7 |
-
screenPadding = 110, originalOverflow = $('body').css('overflow'), proportion = 85, isMobile;
|
| 8 |
|
| 9 |
isMobile = /Android|iPhone|iPod/i.test(navigator.userAgent);
|
| 10 |
|
|
@@ -179,7 +179,7 @@ jQuery(document).ready(function($) {
|
|
| 179 |
.css({
|
| 180 |
'position' : 'fixed',
|
| 181 |
'top' : 0,
|
| 182 |
-
'right' :
|
| 183 |
'bottom' : 0,
|
| 184 |
'width' : screenPadding
|
| 185 |
});
|
|
@@ -427,6 +427,9 @@ jQuery(document).ready(function($) {
|
|
| 427 |
// infiniscroll for it when enabled (Reader, theme infiniscroll, etc).
|
| 428 |
originalOverflow = $('body').css('overflow');
|
| 429 |
$('body').css('overflow', 'hidden');
|
|
|
|
|
|
|
|
|
|
| 430 |
|
| 431 |
container.data('carousel-extra', data);
|
| 432 |
|
|
@@ -463,6 +466,7 @@ jQuery(document).ready(function($) {
|
|
| 463 |
close : function(){
|
| 464 |
// make sure to let the page scroll again
|
| 465 |
$('body').css('overflow', originalOverflow);
|
|
|
|
| 466 |
return container
|
| 467 |
.trigger('jp_carousel.beforeClose')
|
| 468 |
.fadeOut('fast', function(){
|
|
@@ -595,7 +599,7 @@ jQuery(document).ready(function($) {
|
|
| 595 |
// if advancing prepare the slide that will enter the screen
|
| 596 |
previous.jp_carousel('setSlidePosition', -previous.width() + (screenPadding * 0.75)).show();
|
| 597 |
next.jp_carousel('setSlidePosition', gallery.width() - (screenPadding * 0.75)).show();
|
| 598 |
-
|
| 599 |
document.location.href = document.location.href.replace(/#.*/, '') + '#jp-carousel-' + current.data('attachment-id');
|
| 600 |
gallery.jp_carousel('resetButtons', current);
|
| 601 |
container.trigger('jp_carousel.selectSlide', [current]);
|
|
@@ -789,7 +793,7 @@ jQuery(document).ready(function($) {
|
|
| 789 |
var slide = $('<div class="jp-carousel-slide"></div>')
|
| 790 |
.hide()
|
| 791 |
.css({
|
| 792 |
-
'position' : 'fixed',
|
| 793 |
'left' : i < start_index ? -1000 : gallery.width()
|
| 794 |
})
|
| 795 |
.append($('<img>'))
|
| 4 |
// gallery faded layer and container elements
|
| 5 |
var overlay, comments, gallery, container, nextButton, previousButton, info, title,
|
| 6 |
caption, resizeTimeout, mouseTimeout, photo_info, close_hint, commentInterval, buttons,
|
| 7 |
+
screenPadding = 110, originalOverflow = $('body').css('overflow'), originalHOverflow = $('html').css('overflow'), proportion = 85, isMobile;
|
| 8 |
|
| 9 |
isMobile = /Android|iPhone|iPod/i.test(navigator.userAgent);
|
| 10 |
|
| 179 |
.css({
|
| 180 |
'position' : 'fixed',
|
| 181 |
'top' : 0,
|
| 182 |
+
'right' : '15px',
|
| 183 |
'bottom' : 0,
|
| 184 |
'width' : screenPadding
|
| 185 |
});
|
| 427 |
// infiniscroll for it when enabled (Reader, theme infiniscroll, etc).
|
| 428 |
originalOverflow = $('body').css('overflow');
|
| 429 |
$('body').css('overflow', 'hidden');
|
| 430 |
+
// prevent html from overflowing on some of the new themes.
|
| 431 |
+
originalHOverflow = $('html').css('overflow');
|
| 432 |
+
$('html').css('overflow', 'hidden');
|
| 433 |
|
| 434 |
container.data('carousel-extra', data);
|
| 435 |
|
| 466 |
close : function(){
|
| 467 |
// make sure to let the page scroll again
|
| 468 |
$('body').css('overflow', originalOverflow);
|
| 469 |
+
$('html').css('overflow', originalHOverflow);
|
| 470 |
return container
|
| 471 |
.trigger('jp_carousel.beforeClose')
|
| 472 |
.fadeOut('fast', function(){
|
| 599 |
// if advancing prepare the slide that will enter the screen
|
| 600 |
previous.jp_carousel('setSlidePosition', -previous.width() + (screenPadding * 0.75)).show();
|
| 601 |
next.jp_carousel('setSlidePosition', gallery.width() - (screenPadding * 0.75)).show();
|
| 602 |
+
next.css({'position': ''});
|
| 603 |
document.location.href = document.location.href.replace(/#.*/, '') + '#jp-carousel-' + current.data('attachment-id');
|
| 604 |
gallery.jp_carousel('resetButtons', current);
|
| 605 |
container.trigger('jp_carousel.selectSlide', [current]);
|
| 793 |
var slide = $('<div class="jp-carousel-slide"></div>')
|
| 794 |
.hide()
|
| 795 |
.css({
|
| 796 |
+
//'position' : 'fixed',
|
| 797 |
'left' : i < start_index ? -1000 : gallery.width()
|
| 798 |
})
|
| 799 |
.append($('<img>'))
|
jetpack-carousel.php
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
Plugin Name: Gallery Carousel Without JetPack
|
| 4 |
Plugin URI: http://www.wpbeginner.com/
|
| 5 |
Description: Transform your standard galleries into an immersive full-screen experience without requiring you to connect to WordPress.com
|
| 6 |
-
Version: 0.
|
| 7 |
Author: Syed Balkhi
|
| 8 |
Author URI: http://www.wpbeginner.com
|
| 9 |
License: GPLv2 or later
|
|
@@ -89,7 +89,11 @@ class No_Jetpack_Carousel {
|
|
| 89 |
do_action( 'jp_carousel_thumbnails_shown' );
|
| 90 |
|
| 91 |
if ( $this->first_run ) {
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
// Note: using home_url() instead of admin_url() for ajaxurl to be sure to get same domain on wpcom when using mapped domains (also works on self-hosted)
|
| 95 |
// Also: not hardcoding path since there is no guarantee site is running on site root in self-hosted context.
|
|
@@ -103,34 +107,34 @@ class No_Jetpack_Carousel {
|
|
| 103 |
'display_exif' => $this->test_1or0_option( get_option( 'carousel_display_exif' ), true ),
|
| 104 |
'display_geo' => $this->test_1or0_option( get_option( 'carousel_display_geo' ), true ),
|
| 105 |
'background_color' => $this->carousel_background_color_sanitize( get_option( 'carousel_background_color' ) ),
|
| 106 |
-
'comment' => __( 'Comment', '
|
| 107 |
-
'post_comment' => __( 'Post Comment', '
|
| 108 |
-
'loading_comments' => __( 'Loading Comments...', '
|
| 109 |
-
'download_original' => sprintf( __( 'View full size <span class="photo-size">%1$s<span class="photo-size-times">×</span>%2$s</span>', '
|
| 110 |
-
'no_comment_text' => __( 'Please be sure to submit some text with your comment.', '
|
| 111 |
-
'no_comment_email' => __( 'Please provide an email address to comment.', '
|
| 112 |
-
'no_comment_author' => __( 'Please provide your name to comment.', '
|
| 113 |
-
'comment_post_error' => __( 'Sorry, but there was an error posting your comment. Please try again later.', '
|
| 114 |
-
'comment_approved' => __( 'Your comment was approved.', '
|
| 115 |
-
'comment_unapproved' => __( 'Your comment is in moderation.', '
|
| 116 |
-
'camera' => __( 'Camera', '
|
| 117 |
-
'aperture' => __( 'Aperture', '
|
| 118 |
-
'shutter_speed' => __( 'Shutter Speed', '
|
| 119 |
-
'focal_length' => __( 'Focal Length', '
|
| 120 |
);
|
| 121 |
|
| 122 |
if ( ! isset( $localize_strings['jetpack_comments_iframe_src'] ) || empty( $localize_strings['jetpack_comments_iframe_src'] ) ) {
|
| 123 |
// We're not using Jetpack comments after all, so fallback to standard local comments.
|
| 124 |
|
| 125 |
if ( $is_logged_in ) {
|
| 126 |
-
$localize_strings['local_comments_commenting_as'] = '<p id="jp-carousel-commenting-as">' . sprintf( __( 'Commenting as %s', '
|
| 127 |
} else {
|
| 128 |
$localize_strings['local_comments_commenting_as'] = ''
|
| 129 |
-
. '<fieldset><label for="email">' . __( 'Email (Required)', '
|
| 130 |
. '<input type="text" name="email" class="jp-carousel-comment-form-field jp-carousel-comment-form-text-field" id="jp-carousel-comment-form-email-field" /></fieldset>'
|
| 131 |
-
. '<fieldset><label for="author">' . __( 'Name (Required)', '
|
| 132 |
. '<input type="text" name="author" class="jp-carousel-comment-form-field jp-carousel-comment-form-text-field" id="jp-carousel-comment-form-author-field" /></fieldset>'
|
| 133 |
-
. '<fieldset><label for="url">' . __( 'Website', '
|
| 134 |
. '<input type="text" name="url" class="jp-carousel-comment-form-field jp-carousel-comment-form-text-field" id="jp-carousel-comment-form-url-field" /></fieldset>';
|
| 135 |
}
|
| 136 |
}
|
|
@@ -249,7 +253,7 @@ class No_Jetpack_Carousel {
|
|
| 249 |
$offset = ( isset( $_REQUEST['offset'] ) ) ? (int) $_REQUEST['offset'] : 0;
|
| 250 |
|
| 251 |
if ( ! $attachment_id ) {
|
| 252 |
-
echo json_encode( __( 'Missing attachment ID.', '
|
| 253 |
die();
|
| 254 |
}
|
| 255 |
|
|
@@ -287,20 +291,20 @@ class No_Jetpack_Carousel {
|
|
| 287 |
header('Content-type: text/javascript');
|
| 288 |
|
| 289 |
if ( empty( $_POST['nonce'] ) || ! wp_verify_nonce($_POST['nonce'], 'carousel_nonce') )
|
| 290 |
-
die( json_encode( array( 'error' => __( 'Nonce verification failed.', '
|
| 291 |
|
| 292 |
$_blog_id = (int) $_POST['blog_id'];
|
| 293 |
$_post_id = (int) $_POST['id'];
|
| 294 |
$comment = $_POST['comment'];
|
| 295 |
|
| 296 |
if ( empty( $_blog_id ) )
|
| 297 |
-
die( json_encode( array( 'error' => __( 'Missing target blog ID.', '
|
| 298 |
|
| 299 |
if ( empty( $_post_id ) )
|
| 300 |
-
die( json_encode( array( 'error' => __( 'Missing target post ID.', '
|
| 301 |
|
| 302 |
if ( empty( $comment ) )
|
| 303 |
-
die( json_encode( array( 'error' => __( 'No comment text was submitted.', '
|
| 304 |
|
| 305 |
// Used in context like NewDash
|
| 306 |
$switched = false;
|
|
@@ -312,7 +316,7 @@ class No_Jetpack_Carousel {
|
|
| 312 |
do_action('jp_carousel_check_blog_user_privileges');
|
| 313 |
|
| 314 |
if ( ! comments_open( $_post_id ) )
|
| 315 |
-
die( json_encode( array( 'error' => __( 'Comments on this post are closed.', '
|
| 316 |
|
| 317 |
if ( is_user_logged_in() ) {
|
| 318 |
$user = wp_get_current_user();
|
|
@@ -322,7 +326,7 @@ class No_Jetpack_Carousel {
|
|
| 322 |
$url = $user->user_url;
|
| 323 |
|
| 324 |
if ( empty( $user_id ) )
|
| 325 |
-
die( json_encode( array( 'error' => __( 'Sorry, but we could not authenticate your request.', '
|
| 326 |
} else {
|
| 327 |
$user_id = 0;
|
| 328 |
$display_name = $_POST['author'];
|
|
@@ -330,13 +334,13 @@ class No_Jetpack_Carousel {
|
|
| 330 |
$url = $_POST['url'];
|
| 331 |
|
| 332 |
if ( empty( $display_name ) )
|
| 333 |
-
die( json_encode( array( 'error' => __( 'Please provide your name.', '
|
| 334 |
|
| 335 |
if ( empty( $email ) )
|
| 336 |
-
die( json_encode( array( 'error' => __( 'Please provide an email address.', '
|
| 337 |
|
| 338 |
if ( ! is_email( $email ) )
|
| 339 |
-
die( json_encode( array( 'error' => __( 'Please provide a valid email address.', '
|
| 340 |
}
|
| 341 |
|
| 342 |
$comment_data = array(
|
|
@@ -363,21 +367,21 @@ class No_Jetpack_Carousel {
|
|
| 363 |
}
|
| 364 |
|
| 365 |
function register_settings() {
|
| 366 |
-
add_settings_section('carousel_section', __( 'Image Gallery Carousel', '
|
| 367 |
|
| 368 |
if ( ! $this->in_jetpack ) {
|
| 369 |
-
add_settings_field('carousel_enable_it', __( 'Enable carousel', '
|
| 370 |
register_setting( 'media', 'carousel_enable_it', array( $this, 'carousel_enable_it_sanitize' ) );
|
| 371 |
}
|
| 372 |
|
| 373 |
-
add_settings_field('carousel_background_color', __( 'Background color', '
|
| 374 |
register_setting( 'media', 'carousel_background_color', array( $this, 'carousel_background_color_sanitize' ) );
|
| 375 |
|
| 376 |
-
add_settings_field('carousel_display_exif', __( 'Metadata', '
|
| 377 |
register_setting( 'media', 'carousel_display_exif', array( $this, 'carousel_display_exif_sanitize' ) );
|
| 378 |
|
| 379 |
// No geo setting yet, need to "fuzzify" data first, for privacy
|
| 380 |
-
// add_settings_field('carousel_display_geo', __( 'Geolocation', '
|
| 381 |
// register_setting( 'media', 'carousel_display_geo', array( $this, 'carousel_display_geo_sanitize' ) );
|
| 382 |
}
|
| 383 |
|
|
@@ -430,7 +434,7 @@ class No_Jetpack_Carousel {
|
|
| 430 |
}
|
| 431 |
|
| 432 |
function carousel_display_exif_callback() {
|
| 433 |
-
$this->settings_checkbox( 'carousel_display_exif', __( 'Show photo metadata (<a href="http://en.wikipedia.org/wiki/Exchangeable_image_file_format" target="_blank">Exif</a>) in carousel, when available.', '
|
| 434 |
}
|
| 435 |
|
| 436 |
function carousel_display_exif_sanitize( $value ) {
|
|
@@ -438,7 +442,7 @@ class No_Jetpack_Carousel {
|
|
| 438 |
}
|
| 439 |
|
| 440 |
function carousel_display_geo_callback() {
|
| 441 |
-
$this->settings_checkbox( 'carousel_display_geo', __( 'Show map of photo location in carousel, when available.', '
|
| 442 |
}
|
| 443 |
|
| 444 |
function carousel_display_geo_sanitize( $value ) {
|
|
@@ -446,7 +450,7 @@ class No_Jetpack_Carousel {
|
|
| 446 |
}
|
| 447 |
|
| 448 |
function carousel_background_color_callback() {
|
| 449 |
-
$this->settings_select( 'carousel_background_color', array( 'black' => __( 'Black', '
|
| 450 |
}
|
| 451 |
|
| 452 |
function carousel_background_color_sanitize( $value ) {
|
|
@@ -454,7 +458,7 @@ class No_Jetpack_Carousel {
|
|
| 454 |
}
|
| 455 |
|
| 456 |
function carousel_enable_it_callback() {
|
| 457 |
-
$this->settings_checkbox( 'carousel_enable_it', __( 'Display images in full-size carousel slideshow.', '
|
| 458 |
}
|
| 459 |
|
| 460 |
function carousel_enable_it_sanitize( $value ) {
|
|
@@ -462,4 +466,5 @@ class No_Jetpack_Carousel {
|
|
| 462 |
}
|
| 463 |
}
|
| 464 |
|
|
|
|
| 465 |
new No_Jetpack_Carousel;
|
| 3 |
Plugin Name: Gallery Carousel Without JetPack
|
| 4 |
Plugin URI: http://www.wpbeginner.com/
|
| 5 |
Description: Transform your standard galleries into an immersive full-screen experience without requiring you to connect to WordPress.com
|
| 6 |
+
Version: 0.6
|
| 7 |
Author: Syed Balkhi
|
| 8 |
Author URI: http://www.wpbeginner.com
|
| 9 |
License: GPLv2 or later
|
| 89 |
do_action( 'jp_carousel_thumbnails_shown' );
|
| 90 |
|
| 91 |
if ( $this->first_run ) {
|
| 92 |
+
//Registering Spin and jQuery.spin
|
| 93 |
+
wp_register_script( 'spin', plugins_url( 'spin.js', __FILE__ ), false, '1.2.4' );
|
| 94 |
+
wp_register_script( 'jquery.spin', plugins_url( 'jquery.spin.js', __FILE__ ) , array( 'jquery', 'spin' ) );
|
| 95 |
+
|
| 96 |
+
wp_enqueue_script( 'jetpack-carousel', plugins_url( 'jetpack-carousel.js', __FILE__ ), array( 'jquery.spin' ), $this->asset_version( '20130109' ), true );
|
| 97 |
|
| 98 |
// Note: using home_url() instead of admin_url() for ajaxurl to be sure to get same domain on wpcom when using mapped domains (also works on self-hosted)
|
| 99 |
// Also: not hardcoding path since there is no guarantee site is running on site root in self-hosted context.
|
| 107 |
'display_exif' => $this->test_1or0_option( get_option( 'carousel_display_exif' ), true ),
|
| 108 |
'display_geo' => $this->test_1or0_option( get_option( 'carousel_display_geo' ), true ),
|
| 109 |
'background_color' => $this->carousel_background_color_sanitize( get_option( 'carousel_background_color' ) ),
|
| 110 |
+
'comment' => __( 'Comment', 'carousel' ),
|
| 111 |
+
'post_comment' => __( 'Post Comment', 'carousel' ),
|
| 112 |
+
'loading_comments' => __( 'Loading Comments...', 'carousel' ),
|
| 113 |
+
'download_original' => sprintf( __( 'View full size <span class="photo-size">%1$s<span class="photo-size-times">×</span>%2$s</span>', 'carousel' ), '{0}', '{1}' ),
|
| 114 |
+
'no_comment_text' => __( 'Please be sure to submit some text with your comment.', 'carousel' ),
|
| 115 |
+
'no_comment_email' => __( 'Please provide an email address to comment.', 'carousel' ),
|
| 116 |
+
'no_comment_author' => __( 'Please provide your name to comment.', 'carousel' ),
|
| 117 |
+
'comment_post_error' => __( 'Sorry, but there was an error posting your comment. Please try again later.', 'carousel' ),
|
| 118 |
+
'comment_approved' => __( 'Your comment was approved.', 'carousel' ),
|
| 119 |
+
'comment_unapproved' => __( 'Your comment is in moderation.', 'carousel' ),
|
| 120 |
+
'camera' => __( 'Camera', 'carousel' ),
|
| 121 |
+
'aperture' => __( 'Aperture', 'carousel' ),
|
| 122 |
+
'shutter_speed' => __( 'Shutter Speed', 'carousel' ),
|
| 123 |
+
'focal_length' => __( 'Focal Length', 'carousel' ),
|
| 124 |
);
|
| 125 |
|
| 126 |
if ( ! isset( $localize_strings['jetpack_comments_iframe_src'] ) || empty( $localize_strings['jetpack_comments_iframe_src'] ) ) {
|
| 127 |
// We're not using Jetpack comments after all, so fallback to standard local comments.
|
| 128 |
|
| 129 |
if ( $is_logged_in ) {
|
| 130 |
+
$localize_strings['local_comments_commenting_as'] = '<p id="jp-carousel-commenting-as">' . sprintf( __( 'Commenting as %s', 'carousel' ), $current_user->data->display_name ) . '</p>';
|
| 131 |
} else {
|
| 132 |
$localize_strings['local_comments_commenting_as'] = ''
|
| 133 |
+
. '<fieldset><label for="email">' . __( 'Email (Required)', 'carousel' ) . '</label> '
|
| 134 |
. '<input type="text" name="email" class="jp-carousel-comment-form-field jp-carousel-comment-form-text-field" id="jp-carousel-comment-form-email-field" /></fieldset>'
|
| 135 |
+
. '<fieldset><label for="author">' . __( 'Name (Required)', 'carousel' ) . '</label> '
|
| 136 |
. '<input type="text" name="author" class="jp-carousel-comment-form-field jp-carousel-comment-form-text-field" id="jp-carousel-comment-form-author-field" /></fieldset>'
|
| 137 |
+
. '<fieldset><label for="url">' . __( 'Website', 'carousel' ) . '</label> '
|
| 138 |
. '<input type="text" name="url" class="jp-carousel-comment-form-field jp-carousel-comment-form-text-field" id="jp-carousel-comment-form-url-field" /></fieldset>';
|
| 139 |
}
|
| 140 |
}
|
| 253 |
$offset = ( isset( $_REQUEST['offset'] ) ) ? (int) $_REQUEST['offset'] : 0;
|
| 254 |
|
| 255 |
if ( ! $attachment_id ) {
|
| 256 |
+
echo json_encode( __( 'Missing attachment ID.', 'carousel' ) );
|
| 257 |
die();
|
| 258 |
}
|
| 259 |
|
| 291 |
header('Content-type: text/javascript');
|
| 292 |
|
| 293 |
if ( empty( $_POST['nonce'] ) || ! wp_verify_nonce($_POST['nonce'], 'carousel_nonce') )
|
| 294 |
+
die( json_encode( array( 'error' => __( 'Nonce verification failed.', 'carousel' ) ) ) );
|
| 295 |
|
| 296 |
$_blog_id = (int) $_POST['blog_id'];
|
| 297 |
$_post_id = (int) $_POST['id'];
|
| 298 |
$comment = $_POST['comment'];
|
| 299 |
|
| 300 |
if ( empty( $_blog_id ) )
|
| 301 |
+
die( json_encode( array( 'error' => __( 'Missing target blog ID.', 'carousel' ) ) ) );
|
| 302 |
|
| 303 |
if ( empty( $_post_id ) )
|
| 304 |
+
die( json_encode( array( 'error' => __( 'Missing target post ID.', 'carousel' ) ) ) );
|
| 305 |
|
| 306 |
if ( empty( $comment ) )
|
| 307 |
+
die( json_encode( array( 'error' => __( 'No comment text was submitted.', 'carousel' ) ) ) );
|
| 308 |
|
| 309 |
// Used in context like NewDash
|
| 310 |
$switched = false;
|
| 316 |
do_action('jp_carousel_check_blog_user_privileges');
|
| 317 |
|
| 318 |
if ( ! comments_open( $_post_id ) )
|
| 319 |
+
die( json_encode( array( 'error' => __( 'Comments on this post are closed.', 'carousel' ) ) ) );
|
| 320 |
|
| 321 |
if ( is_user_logged_in() ) {
|
| 322 |
$user = wp_get_current_user();
|
| 326 |
$url = $user->user_url;
|
| 327 |
|
| 328 |
if ( empty( $user_id ) )
|
| 329 |
+
die( json_encode( array( 'error' => __( 'Sorry, but we could not authenticate your request.', 'carousel' ) ) ) );
|
| 330 |
} else {
|
| 331 |
$user_id = 0;
|
| 332 |
$display_name = $_POST['author'];
|
| 334 |
$url = $_POST['url'];
|
| 335 |
|
| 336 |
if ( empty( $display_name ) )
|
| 337 |
+
die( json_encode( array( 'error' => __( 'Please provide your name.', 'carousel' ) ) ) );
|
| 338 |
|
| 339 |
if ( empty( $email ) )
|
| 340 |
+
die( json_encode( array( 'error' => __( 'Please provide an email address.', 'carousel' ) ) ) );
|
| 341 |
|
| 342 |
if ( ! is_email( $email ) )
|
| 343 |
+
die( json_encode( array( 'error' => __( 'Please provide a valid email address.', 'carousel' ) ) ) );
|
| 344 |
}
|
| 345 |
|
| 346 |
$comment_data = array(
|
| 367 |
}
|
| 368 |
|
| 369 |
function register_settings() {
|
| 370 |
+
add_settings_section('carousel_section', __( 'Image Gallery Carousel', 'carousel' ), array( $this, 'carousel_section_callback' ), 'media');
|
| 371 |
|
| 372 |
if ( ! $this->in_jetpack ) {
|
| 373 |
+
add_settings_field('carousel_enable_it', __( 'Enable carousel', 'carousel' ), array( $this, 'carousel_enable_it_callback' ), 'media', 'carousel_section' );
|
| 374 |
register_setting( 'media', 'carousel_enable_it', array( $this, 'carousel_enable_it_sanitize' ) );
|
| 375 |
}
|
| 376 |
|
| 377 |
+
add_settings_field('carousel_background_color', __( 'Background color', 'carousel' ), array( $this, 'carousel_background_color_callback' ), 'media', 'carousel_section' );
|
| 378 |
register_setting( 'media', 'carousel_background_color', array( $this, 'carousel_background_color_sanitize' ) );
|
| 379 |
|
| 380 |
+
add_settings_field('carousel_display_exif', __( 'Metadata', 'carousel'), array( $this, 'carousel_display_exif_callback' ), 'media', 'carousel_section' );
|
| 381 |
register_setting( 'media', 'carousel_display_exif', array( $this, 'carousel_display_exif_sanitize' ) );
|
| 382 |
|
| 383 |
// No geo setting yet, need to "fuzzify" data first, for privacy
|
| 384 |
+
// add_settings_field('carousel_display_geo', __( 'Geolocation', 'carousel' ), array( $this, 'carousel_display_geo_callback' ), 'media', 'carousel_section' );
|
| 385 |
// register_setting( 'media', 'carousel_display_geo', array( $this, 'carousel_display_geo_sanitize' ) );
|
| 386 |
}
|
| 387 |
|
| 434 |
}
|
| 435 |
|
| 436 |
function carousel_display_exif_callback() {
|
| 437 |
+
$this->settings_checkbox( 'carousel_display_exif', __( 'Show photo metadata (<a href="http://en.wikipedia.org/wiki/Exchangeable_image_file_format" target="_blank">Exif</a>) in carousel, when available.', 'carousel' ) );
|
| 438 |
}
|
| 439 |
|
| 440 |
function carousel_display_exif_sanitize( $value ) {
|
| 442 |
}
|
| 443 |
|
| 444 |
function carousel_display_geo_callback() {
|
| 445 |
+
$this->settings_checkbox( 'carousel_display_geo', __( 'Show map of photo location in carousel, when available.', 'carousel' ) );
|
| 446 |
}
|
| 447 |
|
| 448 |
function carousel_display_geo_sanitize( $value ) {
|
| 450 |
}
|
| 451 |
|
| 452 |
function carousel_background_color_callback() {
|
| 453 |
+
$this->settings_select( 'carousel_background_color', array( 'black' => __( 'Black', 'carousel' ), 'white' => __( 'White', 'carousel', 'carousel' ) ) );
|
| 454 |
}
|
| 455 |
|
| 456 |
function carousel_background_color_sanitize( $value ) {
|
| 458 |
}
|
| 459 |
|
| 460 |
function carousel_enable_it_callback() {
|
| 461 |
+
$this->settings_checkbox( 'carousel_enable_it', __( 'Display images in full-size carousel slideshow.', 'carousel' ) );
|
| 462 |
}
|
| 463 |
|
| 464 |
function carousel_enable_it_sanitize( $value ) {
|
| 466 |
}
|
| 467 |
}
|
| 468 |
|
| 469 |
+
|
| 470 |
new No_Jetpack_Carousel;
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link:http://www.wpbeginner.com/wpbeginner-needs-your-help/
|
|
| 4 |
Tags: gallery, lightbox, carousel, gallery carousel, jetpack
|
| 5 |
Requires at least: 3.4.1
|
| 6 |
Tested up to: 3.5.1
|
| 7 |
-
Stable tag: 0.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -12,16 +12,24 @@ Transform your standard galleries into an immersive full-screen experience witho
|
|
| 12 |
|
| 13 |
== Description ==
|
| 14 |
|
| 15 |
-
I love this Carousel feature that is part of JetPack however I didn't like that I was being forced to connect my site with WordPress.com to use a feature that has no connection with WordPress.com. Well, I simply forked the Carousel module from JetPack. I am releasing it for all those who want to use this feature with freedom of choice.
|
| 16 |
|
| 17 |
-
The carousel feature
|
| 18 |
|
|
|
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
[Take a look at plugins I'm using at WPBeginner](http://www.wpbeginner.com/blueprint/ "Take a look at plugins I'm using at WPBeginner")
|
| 23 |
|
| 24 |
-
[Learn WordPress with free WPBeginner videos](http://videos.wpbeginner.com "Checkout out WPBeginner's WordPress tutorial videos")
|
| 25 |
|
| 26 |
Plugin Header Photo Credit: [Muffit](http://www.flickr.com/photos/calliope/3715986729/ "Carousel photo by Muffet's Flickr")
|
| 27 |
|
|
@@ -49,11 +57,16 @@ I thought long and hard about whether to add this feature in the gallery carouse
|
|
| 49 |
|
| 50 |
However, if you want to turn off comments on Media attachments, you can follow this tutorial:
|
| 51 |
|
| 52 |
-
[How to Disable Comments on WordPress Media Attachments](http://www.wpbeginner.com/wp-tutorials/how-to-disable-comments-on-wordpress-media-attachments/ "How to Disable Comments on WordPress Media Attachments)
|
| 53 |
|
| 54 |
|
| 55 |
== Changelog ==
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
= 0.5 =
|
| 58 |
* Updated it to match original JetPack plugin updates from 2.1.2
|
| 59 |
|
| 4 |
Tags: gallery, lightbox, carousel, gallery carousel, jetpack
|
| 5 |
Requires at least: 3.4.1
|
| 6 |
Tested up to: 3.5.1
|
| 7 |
+
Stable tag: 0.6
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 12 |
|
| 13 |
== Description ==
|
| 14 |
|
| 15 |
+
I love this Carousel feature that is part of the JetPack plugin however I didn't like that I was being forced to connect my site with WordPress.com to use a feature that has no connection with WordPress.com. Well, I simply forked the Carousel module from JetPack. I am releasing it for all those who want to use this feature with freedom of choice.
|
| 16 |
|
| 17 |
+
The carousel feature transforms your standard built-in WordPRess galleries into an immersive full-screen experience with comments and EXIF metadata.
|
| 18 |
|
| 19 |
+
Want to make your WordPress photo gallery stand out? Then use this jQuery Gallery Carousel without Jetpack plugin.
|
| 20 |
|
| 21 |
+
If you like this plugin, and want to learn more about WordPress, then I suggest that you visit [WPBeginner](http://www.wpbeginner.com "WPBeginner"). It is one of the largest free WordPress resource site with tons of [WordPress tutorials](http://www.wpbeginner.com/category/wp-tutorials/ "WordPress tutorials"), and I'm proud to say that I created it.
|
| 22 |
+
|
| 23 |
+
If you are not sure how to create a gallery in WordPress, then watch my [free WordPress video tutorials](http://videos.wpbeginner.com "Checkout out WPBeginner's WordPress tutorial videos"). P.S. these WordPress videos contains a lot more than just a tutorial on how to create galleries. It will show you tons of other cool stuff. So use it to your advantage.
|
| 24 |
+
|
| 25 |
+
I often get asked what are the [best WordPress plugins](http://www.wpbeginner.com/category/plugins/ "best WordPress plugins")? Which plugins should I use on my site? What are the must have plugins? I have created a blueprint of all the plugins and tools that I'm using. [Take a look at plugins I'm using at WPBeginner](http://www.wpbeginner.com/blueprint/ "Take a look at plugins I'm using at WPBeginner")
|
| 26 |
+
|
| 27 |
+
Gallery Carousel feature was first intorduced for WordPress.com blogs, and now it is available for all WordPress sites. So YES you can [switch from WordPress.com to WordPress.org](http://www.wpbeginner.com/wp-tutorials/how-to-properly-move-your-blog-from-wordpress-com-to-wordpress-org/ "switch from WordPress.com to WordPress.org") and still keep the Gallery Carousel functionality by using this plugin.
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
Lastly, if you like this plugin then follow WPBeginner on [Twitter](http://twitter.com/wpbeginner "Twitter"), [Facebook](http://facebook.com/wpbeginner "Facebook"), and [Google+](https://plus.google.com/101634180904808003404/ "Google+")
|
| 31 |
|
|
|
|
| 32 |
|
|
|
|
| 33 |
|
| 34 |
Plugin Header Photo Credit: [Muffit](http://www.flickr.com/photos/calliope/3715986729/ "Carousel photo by Muffet's Flickr")
|
| 35 |
|
| 57 |
|
| 58 |
However, if you want to turn off comments on Media attachments, you can follow this tutorial:
|
| 59 |
|
| 60 |
+
[How to Disable Comments on WordPress Media Attachments](http://www.wpbeginner.com/wp-tutorials/how-to-disable-comments-on-wordpress-media-attachments/ "How to Disable Comments on WordPress Media Attachments")
|
| 61 |
|
| 62 |
|
| 63 |
== Changelog ==
|
| 64 |
|
| 65 |
+
= 0.6 =
|
| 66 |
+
* Updated it to match original JetPack plugin updates 2.2.2
|
| 67 |
+
* Bugfix: Comments not working due to jQuery.spin and spin.js issue (props amoshonas)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
= 0.5 =
|
| 71 |
* Updated it to match original JetPack plugin updates from 2.1.2
|
| 72 |
|
