Gallery Carousel Without JetPack - Version 0.7.5

Version Description

  • Updated it to match original JetPack plugin updates from 3.6.1
  • Tested with WordPress 4.3
  • Fix: plugin_dir_path() and plugin_dir_url() used for Multisite / symlink support
Download this release

Release Info

Developer n7studios
Plugin Icon 128x128 Gallery Carousel Without JetPack
Version 0.7.5
Comparing to
See all releases

Code changes from version 0.7.4 to 0.7.5

carousel-without-jetpack.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.4
7
  Author: Syed Balkhi
8
  Author URI: http://www.wpbeginner.com
9
  License: GPLv2 or later
@@ -21,16 +21,18 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
21
  * Boostrap 'carousel' module so it'll work standalone
22
  */
23
  class CarouselWithoutJetpack {
 
24
  /**
25
  * Constructor
26
  */
27
- function CarouselWithoutJetpack() {
28
- // Plugin Details
29
- $this->plugin = new stdClass;
30
- $this->plugin->name = 'carousel-without-jetpack'; // Plugin Folder
31
- $this->plugin->folder = WP_PLUGIN_DIR.'/'.$this->plugin->name; // Full Path to Plugin Folder
32
- $this->plugin->url = WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)); // Full URL to Plugin Folder
33
 
 
 
 
 
 
 
34
  // Include class.jetpack-options.php
35
  // Ignore if Jetpack or another plugin has already done this
36
  if (!class_exists('No_Jetpack_Options')) {
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.5
7
  Author: Syed Balkhi
8
  Author URI: http://www.wpbeginner.com
9
  License: GPLv2 or later
21
  * Boostrap 'carousel' module so it'll work standalone
22
  */
23
  class CarouselWithoutJetpack {
24
+
25
  /**
26
  * Constructor
27
  */
28
+ function __construct() {
 
 
 
 
 
29
 
30
+ // Plugin Details
31
+ $this->plugin = new stdClass;
32
+ $this->plugin->name = 'carousel-without-jetpack'; // Plugin Folder
33
+ $this->plugin->folder = plugin_dir_path( __FILE__ );
34
+ $this->plugin->url = plugin_dir_url( __FILE__ );
35
+
36
  // Include class.jetpack-options.php
37
  // Ignore if Jetpack or another plugin has already done this
38
  if (!class_exists('No_Jetpack_Options')) {
carousel/jetpack-carousel-ie8fix.css CHANGED
@@ -1,5 +1,5 @@
1
  .jp-carousel .jp-carousel-slide {
2
- display: none !important;
3
  }
4
  .jp-carousel {
5
  text-align: center!important;
@@ -9,5 +9,5 @@
9
  margin: 0 auto;
10
  display: block !important;
11
  width: auto;
12
- position: relative!important;
13
  }
1
  .jp-carousel .jp-carousel-slide {
2
+ display: none !important;
3
  }
4
  .jp-carousel {
5
  text-align: center!important;
9
  margin: 0 auto;
10
  display: block !important;
11
  width: auto;
12
+ position: relative!important;
13
  }
carousel/jetpack-carousel.css CHANGED
@@ -22,6 +22,21 @@ div.jp-carousel-fadeaway {
22
  background-size: 200px 126px;
23
  }
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  @media
26
  only screen and (-webkit-min-device-pixel-ratio: 1.5),
27
  only screen and (-o-min-device-pixel-ratio: 3/2),
@@ -276,7 +291,7 @@ a.jp-carousel-image-download {
276
 
277
  div.jp-carousel-buttons a.jp-carousel-reblog,
278
  div.jp-carousel-buttons a.jp-carousel-commentlink {
279
- margin:0 14px 0 0 !important;
280
  }
281
 
282
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged,
@@ -284,7 +299,7 @@ div.jp-carousel-buttons a.jp-carousel-like.liked {
284
  background-color: #303030;
285
  padding-right: 8px !important;
286
  border-radius: 2px;
287
- border-radius:2px;
288
  -webkit-border-radius:2px;
289
  -moz-border-radius:2px;
290
  -ms-border-radius:2px;
@@ -292,13 +307,13 @@ div.jp-carousel-buttons a.jp-carousel-like.liked {
292
  }
293
 
294
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
295
- margin:0 2px 0 -12px !important;
296
  }
297
 
298
-
299
  div.jp-carousel-buttons a.jp-carousel-reblog,
300
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover {
301
  background-position: 6px -36px;
 
302
  padding-left: 26px !important;
303
  color: #999;
304
  }
@@ -307,9 +322,6 @@ div.jp-carousel-buttons a.jp-carousel-commentlink {
307
  background-position: 0px -156px;
308
  padding-left: 19px !important;
309
  }
310
- .rtl div.jp-carousel-buttons a.jp-carousel-commentlink{
311
- background-position: 100% -156px;
312
- }
313
 
314
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover {
315
  cursor: default;
@@ -577,9 +589,6 @@ a.jp-carousel-image-download {
577
  text-decoration: none;
578
  background-position: 0 -82px;
579
  }
580
- .rtl a.jp-carousel-image-download{
581
- background-position: 100% -82px;
582
- }
583
 
584
  a.jp-carousel-image-download span.photo-size {
585
  font-size: 11px;
@@ -597,9 +606,6 @@ a.jp-carousel-image-download:hover {
597
  color: #68c9e8;
598
  border: none !important;
599
  }
600
- .rtl a.jp-carousel-image-download:hover{
601
- background-position: 100% -122px;
602
- }
603
 
604
  /** Meta Box End **/
605
 
@@ -843,8 +849,8 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
843
  border-radius: 2px;
844
  font: 13px/1.4 "Helvetica Neue", sans-serif !important;
845
  border: 1px solid rgba( 255, 255, 255, 0.17 );
846
- -webkit-box-shadow: inset 0px 0px 5px 5px rgba(0, 0, 0, 1);
847
- box-shadow: inset 0px 0px 5px 5px rgba(0, 0, 0, 1);
848
  }
849
 
850
  .jp-carousel-comment-post-error {
@@ -861,7 +867,7 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
861
  }
862
 
863
  #jp-carousel-comments-loading {
864
- font: 444 15px/1.7 "Helvetica Neue", sans-serif !important;
865
  display: none;
866
  color: #999;
867
  text-align: left;
@@ -941,9 +947,6 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
941
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink {
942
  background-position: 0px -176px;
943
  }
944
- .rtl .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink{
945
- background-position: 100% -176px;
946
- }
947
 
948
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like,
949
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like:hover {
@@ -1035,19 +1038,11 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
1035
  background-position: 0 -122px;
1036
  }
1037
 
1038
- .rtl .jp-carousel-light a.jp-carousel-image-download {
1039
- background-position: 100% -122px;
1040
- }
1041
-
1042
  .jp-carousel-light a.jp-carousel-image-download:hover {
1043
  background-position: 0 -122px;
1044
  color: #f1831e;
1045
  }
1046
 
1047
- .rtl .jp-carousel-light a.jp-carousel-image-download:hover {
1048
- background-position: 100% -122px;
1049
- }
1050
-
1051
  .jp-carousel-light textarea#jp-carousel-comment-form-comment-field {
1052
  background: #fbfbfb;
1053
  color: #333;
@@ -1072,8 +1067,8 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
1072
  .jp-carousel-light #jp-carousel-comment-post-results span {
1073
  background: #f7f7f7;
1074
  border:1px solid #dfdfdf;
1075
- -webkit-box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.05);
1076
- box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.05);
1077
  }
1078
 
1079
  .jp-carousel-light .jp-carousel-slide {
22
  background-size: 200px 126px;
23
  }
24
 
25
+ .jp-carousel-msg {
26
+ font-family: "Open Sans", sans-serif;
27
+ font-style: normal;
28
+ display: inline-block;
29
+ line-height: 19px;
30
+ padding: 11px 15px;
31
+ font-size: 14px;
32
+ text-align: center;
33
+ margin: 25px 20px 0 2px;
34
+ background-color: #fff;
35
+ border-left: 4px solid #ffba00;
36
+ -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
37
+ box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
38
+ }
39
+
40
  @media
41
  only screen and (-webkit-min-device-pixel-ratio: 1.5),
42
  only screen and (-o-min-device-pixel-ratio: 3/2),
291
 
292
  div.jp-carousel-buttons a.jp-carousel-reblog,
293
  div.jp-carousel-buttons a.jp-carousel-commentlink {
294
+ margin: 0 14px 0 0 !important;
295
  }
296
 
297
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged,
299
  background-color: #303030;
300
  padding-right: 8px !important;
301
  border-radius: 2px;
302
+ border-radius: 2px;
303
  -webkit-border-radius:2px;
304
  -moz-border-radius:2px;
305
  -ms-border-radius:2px;
307
  }
308
 
309
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
310
+ margin: 0 2px 0 -12px !important;
311
  }
312
 
 
313
  div.jp-carousel-buttons a.jp-carousel-reblog,
314
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover {
315
  background-position: 6px -36px;
316
+ padding-right: auto !important;
317
  padding-left: 26px !important;
318
  color: #999;
319
  }
322
  background-position: 0px -156px;
323
  padding-left: 19px !important;
324
  }
 
 
 
325
 
326
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover {
327
  cursor: default;
589
  text-decoration: none;
590
  background-position: 0 -82px;
591
  }
 
 
 
592
 
593
  a.jp-carousel-image-download span.photo-size {
594
  font-size: 11px;
606
  color: #68c9e8;
607
  border: none !important;
608
  }
 
 
 
609
 
610
  /** Meta Box End **/
611
 
849
  border-radius: 2px;
850
  font: 13px/1.4 "Helvetica Neue", sans-serif !important;
851
  border: 1px solid rgba( 255, 255, 255, 0.17 );
852
+ -webkit-box-shadow: inset 0px 0px 5px 5px rgba(0, 0, 0, 1);
853
+ box-shadow: inset 0px 0px 5px 5px rgba(0, 0, 0, 1);
854
  }
855
 
856
  .jp-carousel-comment-post-error {
867
  }
868
 
869
  #jp-carousel-comments-loading {
870
+ font: 400 15px/1.7 "Helvetica Neue", sans-serif !important;
871
  display: none;
872
  color: #999;
873
  text-align: left;
947
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink {
948
  background-position: 0px -176px;
949
  }
 
 
 
950
 
951
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like,
952
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like:hover {
1038
  background-position: 0 -122px;
1039
  }
1040
 
 
 
 
 
1041
  .jp-carousel-light a.jp-carousel-image-download:hover {
1042
  background-position: 0 -122px;
1043
  color: #f1831e;
1044
  }
1045
 
 
 
 
 
1046
  .jp-carousel-light textarea#jp-carousel-comment-form-comment-field {
1047
  background: #fbfbfb;
1048
  color: #333;
1067
  .jp-carousel-light #jp-carousel-comment-post-results span {
1068
  background: #f7f7f7;
1069
  border:1px solid #dfdfdf;
1070
+ -webkit-box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.05);
1071
+ box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.05);
1072
  }
1073
 
1074
  .jp-carousel-light .jp-carousel-slide {
carousel/jetpack-carousel.js CHANGED
@@ -871,7 +871,7 @@ jQuery(document).ready(function($) {
871
  thumb_size = { width : src_item[0].naturalWidth, height : src_item[0].naturalHeight },
872
  title = src_item.data('image-title') || '',
873
  description = src_item.data('image-description') || '',
874
- caption = src_item.parents('dl').find('dd.gallery-caption').html() || '',
875
  src = src_item.data('gallery-src') || '',
876
  medium_file = src_item.data('medium-file') || '',
877
  large_file = src_item.data('large-file') || '',
@@ -998,11 +998,13 @@ jQuery(document).ready(function($) {
998
 
999
  shutterSpeed: function(d) {
1000
  if (d >= 1) {
1001
- return Math.round(d) + 's';
1002
  }
1003
  var df = 1, top = 1, bot = 1;
1004
- var limit = 1e3;
1005
- while (df !== d && limit-- > 0) {
 
 
1006
  if (df < d) {
1007
  top += 1;
1008
  } else {
@@ -1428,7 +1430,10 @@ jQuery(document).ready(function($) {
1428
 
1429
  // Makes carousel work on page load and when back button leads to same URL with carousel hash (ie: no actual document.ready trigger)
1430
  $( window ).on( 'hashchange', function () {
1431
- if ( ! window.location.hash || ! window.location.hash.match(/jp-carousel-(\d+)/) ) {
 
 
 
1432
  return;
1433
  }
1434
 
@@ -1437,26 +1442,25 @@ jQuery(document).ready(function($) {
1437
  }
1438
 
1439
  last_known_location_hash = window.location.hash;
 
 
 
 
 
 
 
 
 
 
 
 
 
1440
 
1441
- var gallery = $('div.gallery, div.tiled-gallery'), index = -1, n = window.location.hash.match(/jp-carousel-(\d+)/);
1442
-
1443
- if ( ! $(this).jp_carousel( 'testForData', gallery ) ) {
1444
- return;
1445
- }
1446
-
1447
- n = parseInt(n[1], 10);
1448
-
1449
- gallery.find('img').each(function(num, el){
1450
- // n cannot be 0 (zero)
1451
- if ( n && Number( $(el).data('attachment-id') ) === n ) {
1452
- index = num;
1453
- return false;
1454
  }
1455
  });
1456
-
1457
- if ( index !== -1 ) {
1458
- gallery.jp_carousel('openOrSelectSlide', index);
1459
- }
1460
  });
1461
 
1462
  if ( window.location.hash ) {
871
  thumb_size = { width : src_item[0].naturalWidth, height : src_item[0].naturalHeight },
872
  title = src_item.data('image-title') || '',
873
  description = src_item.data('image-description') || '',
874
+ caption = src_item.parents('.gallery-item').find('.gallery-caption').html() || '',
875
  src = src_item.data('gallery-src') || '',
876
  medium_file = src_item.data('medium-file') || '',
877
  large_file = src_item.data('large-file') || '',
998
 
999
  shutterSpeed: function(d) {
1000
  if (d >= 1) {
1001
+ return Math.round(d*10)/10 + 's'; // round to one decimal if value > 1s by multiplying it by 10, rounding, then dividing by 10 again
1002
  }
1003
  var df = 1, top = 1, bot = 1;
1004
+ var tol = 1e-8;
1005
+ // iterate while value not reached and difference (positive or negative, hence the Math.abs) between value
1006
+ // and approximated value greater than given tolerance
1007
+ while (df !== d && Math.abs(df-d) > tol) {
1008
  if (df < d) {
1009
  top += 1;
1010
  } else {
1430
 
1431
  // Makes carousel work on page load and when back button leads to same URL with carousel hash (ie: no actual document.ready trigger)
1432
  $( window ).on( 'hashchange', function () {
1433
+ var hashRegExp = /jp-carousel-(\d+)/,
1434
+ matches, attachmentId, galleries, selectedThumbnail;
1435
+
1436
+ if ( ! window.location.hash || ! hashRegExp.test( window.location.hash ) ) {
1437
  return;
1438
  }
1439
 
1442
  }
1443
 
1444
  last_known_location_hash = window.location.hash;
1445
+ matches = window.location.hash.match( hashRegExp );
1446
+ attachmentId = parseInt( matches[1], 10 );
1447
+ galleries = $( 'div.gallery, div.tiled-gallery' );
1448
+
1449
+ // Find the first thumbnail that matches the attachment ID in the location
1450
+ // hash, then open the gallery that contains it.
1451
+ galleries.each( function( _, galleryEl ) {
1452
+ $( galleryEl ).find('img').each( function( imageIndex, imageEl ) {
1453
+ if ( $( imageEl ).data( 'attachment-id' ) === parseInt( attachmentId, 10 ) ) {
1454
+ selectedThumbnail = { index: imageIndex, gallery: galleryEl };
1455
+ return false;
1456
+ }
1457
+ });
1458
 
1459
+ if ( selectedThumbnail ) {
1460
+ $( selectedThumbnail.gallery )
1461
+ .jp_carousel( 'openOrSelectSlide', selectedThumbnail.index );
 
 
 
 
 
 
 
 
 
 
1462
  }
1463
  });
 
 
 
 
1464
  });
1465
 
1466
  if ( window.location.hash ) {
carousel/jetpack-carousel.php CHANGED
@@ -20,6 +20,8 @@ class Jetpack_Carousel {
20
 
21
  var $first_run = true;
22
 
 
 
23
  var $in_jetpack = true;
24
 
25
  function __construct() {
@@ -52,6 +54,7 @@ class Jetpack_Carousel {
52
  // If on front-end, do the Carousel thang.
53
  $this->prebuilt_widths = apply_filters( 'jp_carousel_widths', $this->prebuilt_widths );
54
  add_filter( 'post_gallery', array( $this, 'enqueue_assets' ), 1000, 2 ); // load later than other callbacks hooked it
 
55
  add_filter( 'gallery_style', array( $this, 'add_data_to_container' ) );
56
  add_filter( 'wp_get_attachment_image_attributes', array( $this, 'add_data_to_images' ), 10, 2 );
57
  }
@@ -75,14 +78,34 @@ class Jetpack_Carousel {
75
  return apply_filters( 'jp_carousel_asset_version', $version );
76
  }
77
 
 
 
 
 
 
 
 
 
 
 
78
  function enqueue_assets( $output ) {
79
  if ( ! empty( $output ) && ! apply_filters( 'jp_carousel_force_enable', false ) ) {
80
  // Bail because someone is overriding the [gallery] shortcode.
81
  remove_filter( 'gallery_style', array( $this, 'add_data_to_container' ) );
82
  remove_filter( 'wp_get_attachment_image_attributes', array( $this, 'add_data_to_images' ) );
 
 
 
 
83
  return $output;
84
  }
85
 
 
 
 
 
 
 
86
  do_action( 'jp_carousel_thumbnails_shown' );
87
 
88
  if ( $this->first_run ) {
@@ -147,15 +170,24 @@ class Jetpack_Carousel {
147
  $localize_strings = apply_filters( 'jp_carousel_localize_strings', $localize_strings );
148
  wp_localize_script( 'jetpack-carousel', 'jetpackCarouselStrings', $localize_strings );
149
  if( is_rtl() ) {
150
- wp_enqueue_style( 'jetpack-carousel', plugins_url( '/rtl/jetpack-carousel-rtl.css', __FILE__ ), array(), $this->asset_version( '20120629' ) );
151
  } else {
152
- wp_enqueue_style( 'jetpack-carousel', plugins_url( 'jetpack-carousel.css', __FILE__ ), array(), $this->asset_version( '20120629' ) );
153
  }
154
-
155
  wp_register_style( 'jetpack-carousel-ie8fix', plugins_url( 'jetpack-carousel-ie8fix.css', __FILE__ ), array(), $this->asset_version( '20121024' ) );
156
  $GLOBALS['wp_styles']->add_data( 'jetpack-carousel-ie8fix', 'conditional', 'lte IE 8' );
157
  wp_enqueue_style( 'jetpack-carousel-ie8fix' );
158
-
 
 
 
 
 
 
 
 
 
159
  do_action( 'jp_carousel_enqueue_assets', $this->first_run, $localize_strings );
160
 
161
  $this->first_run = false;
@@ -164,10 +196,17 @@ class Jetpack_Carousel {
164
  return $output;
165
  }
166
 
 
 
 
 
 
167
  function add_data_to_images( $attr, $attachment = null ) {
168
 
169
- if ( $this->first_run ) // not in a gallery
 
170
  return $attr;
 
171
 
172
  $attachment_id = intval( $attachment->ID );
173
  $orig_file = wp_get_attachment_image_src( $attachment_id, 'full' );
@@ -258,6 +297,15 @@ class Jetpack_Carousel {
258
  if ( ! headers_sent() )
259
  header('Content-type: text/javascript');
260
 
 
 
 
 
 
 
 
 
 
261
  do_action('jp_carousel_check_blog_user_privileges');
262
 
263
  $attachment_id = ( isset( $_REQUEST['id'] ) ) ? (int) $_REQUEST['id'] : 0;
@@ -326,6 +374,11 @@ class Jetpack_Carousel {
326
  $switched = true;
327
  }
328
 
 
 
 
 
 
329
  do_action('jp_carousel_check_blog_user_privileges');
330
 
331
  if ( ! comments_open( $_post_id ) )
@@ -373,6 +426,14 @@ class Jetpack_Carousel {
373
 
374
  // Note: wp_new_comment() sanitizes and validates the values (too).
375
  $comment_id = wp_new_comment( $comment_data );
 
 
 
 
 
 
 
 
376
  do_action( 'jp_carousel_post_attachment_comment' );
377
  $comment_status = wp_get_comment_status( $comment_id );
378
 
20
 
21
  var $first_run = true;
22
 
23
+ var $in_gallery = false;
24
+
25
  var $in_jetpack = true;
26
 
27
  function __construct() {
54
  // If on front-end, do the Carousel thang.
55
  $this->prebuilt_widths = apply_filters( 'jp_carousel_widths', $this->prebuilt_widths );
56
  add_filter( 'post_gallery', array( $this, 'enqueue_assets' ), 1000, 2 ); // load later than other callbacks hooked it
57
+ add_filter( 'post_gallery', array( $this, 'set_in_gallery' ), -1000 );
58
  add_filter( 'gallery_style', array( $this, 'add_data_to_container' ) );
59
  add_filter( 'wp_get_attachment_image_attributes', array( $this, 'add_data_to_images' ), 10, 2 );
60
  }
78
  return apply_filters( 'jp_carousel_asset_version', $version );
79
  }
80
 
81
+ function display_bail_message( $output= '' ) {
82
+ // Displays a message on top of gallery if carousel has bailed
83
+ $message = '<div class="jp-carousel-msg"><p>';
84
+ $message .= __( 'Jetpack\'s Carousel has been disabled, because another plugin or your theme is overriding the [gallery] shortcode.', 'jetpack' );
85
+ $message .= '</p></div>';
86
+ // put before gallery output
87
+ $output = $message . $output;
88
+ return $output;
89
+ }
90
+
91
  function enqueue_assets( $output ) {
92
  if ( ! empty( $output ) && ! apply_filters( 'jp_carousel_force_enable', false ) ) {
93
  // Bail because someone is overriding the [gallery] shortcode.
94
  remove_filter( 'gallery_style', array( $this, 'add_data_to_container' ) );
95
  remove_filter( 'wp_get_attachment_image_attributes', array( $this, 'add_data_to_images' ) );
96
+ // Display message that carousel has bailed, if user is super_admin
97
+ if ( is_super_admin() ) {
98
+ add_filter( 'post_gallery', array( $this, 'display_bail_message' ) );
99
+ }
100
  return $output;
101
  }
102
 
103
+ /**
104
+ * Fires when thumbnails are shown in Carousel.
105
+ *
106
+ * @since ?
107
+ * @module Carousel
108
+ **/
109
  do_action( 'jp_carousel_thumbnails_shown' );
110
 
111
  if ( $this->first_run ) {
170
  $localize_strings = apply_filters( 'jp_carousel_localize_strings', $localize_strings );
171
  wp_localize_script( 'jetpack-carousel', 'jetpackCarouselStrings', $localize_strings );
172
  if( is_rtl() ) {
173
+ wp_enqueue_style( 'jetpack-carousel', plugins_url( '/rtl/jetpack-carousel-rtl.css', __FILE__ ), array(), $this->asset_version( '20120629' ) );
174
  } else {
175
+ wp_enqueue_style( 'jetpack-carousel', plugins_url( 'jetpack-carousel.css', __FILE__ ), array(), $this->asset_version( '20120629' ) );
176
  }
177
+
178
  wp_register_style( 'jetpack-carousel-ie8fix', plugins_url( 'jetpack-carousel-ie8fix.css', __FILE__ ), array(), $this->asset_version( '20121024' ) );
179
  $GLOBALS['wp_styles']->add_data( 'jetpack-carousel-ie8fix', 'conditional', 'lte IE 8' );
180
  wp_enqueue_style( 'jetpack-carousel-ie8fix' );
181
+
182
+ /**
183
+ * Fires after carousel assets are enqueued for the first time.
184
+ * Allows for adding additional assets to the carousel page.
185
+ *
186
+ * @since ?
187
+ * @module Carousel
188
+ * @param boolean $first_run
189
+ * @param array $localized_strings
190
+ **/
191
  do_action( 'jp_carousel_enqueue_assets', $this->first_run, $localize_strings );
192
 
193
  $this->first_run = false;
196
  return $output;
197
  }
198
 
199
+ function set_in_gallery( $output ) {
200
+ $this->in_gallery = true;
201
+ return $output;
202
+ }
203
+
204
  function add_data_to_images( $attr, $attachment = null ) {
205
 
206
+ // not in a gallery?
207
+ if ( ! $this->in_gallery ) {
208
  return $attr;
209
+ }
210
 
211
  $attachment_id = intval( $attachment->ID );
212
  $orig_file = wp_get_attachment_image_src( $attachment_id, 'full' );
297
  if ( ! headers_sent() )
298
  header('Content-type: text/javascript');
299
 
300
+ /**
301
+ * Allows for the checking of privileges of the blog user before comments
302
+ * are packaged as JSON and sent back from the get_attachment_comments
303
+ * AJAX endpoint
304
+ *
305
+ * @duplicate yes
306
+ * @since ?
307
+ * @module Carousel
308
+ **/
309
  do_action('jp_carousel_check_blog_user_privileges');
310
 
311
  $attachment_id = ( isset( $_REQUEST['id'] ) ) ? (int) $_REQUEST['id'] : 0;
374
  $switched = true;
375
  }
376
 
377
+ /**
378
+ * @duplicate yes
379
+ * @since ?
380
+ * @module Carousel
381
+ **/
382
  do_action('jp_carousel_check_blog_user_privileges');
383
 
384
  if ( ! comments_open( $_post_id ) )
426
 
427
  // Note: wp_new_comment() sanitizes and validates the values (too).
428
  $comment_id = wp_new_comment( $comment_data );
429
+
430
+ /**
431
+ * Fires before adding a new comment to the database via the get_attachment_comments
432
+ * ajax endpoint
433
+ *
434
+ * @since ?
435
+ * @module Carousel
436
+ **/
437
  do_action( 'jp_carousel_post_attachment_comment' );
438
  $comment_status = wp_get_comment_status( $comment_id );
439
 
carousel/rtl/jetpack-carousel-rtl.css CHANGED
@@ -1,4 +1,4 @@
1
- /* This file was automatically generated on Jul 14 2014 00:33:37 */
2
 
3
  .jp-carousel-wrap * {
4
  line-height:inherit; /* prevent declarations of line-height in the universal selector */
@@ -278,7 +278,7 @@ a.jp-carousel-image-download {
278
 
279
  div.jp-carousel-buttons a.jp-carousel-reblog,
280
  div.jp-carousel-buttons a.jp-carousel-commentlink {
281
- margin:0 0 0 14px !important;
282
  }
283
 
284
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged,
@@ -286,7 +286,7 @@ div.jp-carousel-buttons a.jp-carousel-like.liked {
286
  background-color: #303030;
287
  padding-left: 8px !important;
288
  border-radius: 2px;
289
- border-radius:2px;
290
  -webkit-border-radius:2px;
291
  -moz-border-radius:2px;
292
  -ms-border-radius:2px;
@@ -294,13 +294,13 @@ div.jp-carousel-buttons a.jp-carousel-like.liked {
294
  }
295
 
296
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
297
- margin:0 -12px 0 2px !important;
298
  }
299
 
300
-
301
  div.jp-carousel-buttons a.jp-carousel-reblog,
302
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover {
303
  background-position: 6px -36px;
 
304
  padding-right: 26px !important;
305
  color: #999;
306
  }
@@ -309,13 +309,6 @@ div.jp-carousel-buttons a.jp-carousel-commentlink {
309
  background-position: 0px -156px;
310
  padding-right: 19px !important;
311
  }
312
- .rtl div.jp-carousel-buttons a.jp-carousel-commentlink{
313
- background-position: 100% -156px;
314
- }
315
-
316
- .rtl div.jp-carousel-buttons a.jp-carousel-commentlink{
317
- background-position: 100% -156px;
318
- }
319
 
320
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover {
321
  cursor: default;
@@ -583,9 +576,6 @@ a.jp-carousel-image-download {
583
  text-decoration: none;
584
  background-position: 0 -82px;
585
  }
586
- .rtl a.jp-carousel-image-download{
587
- background-position: 100% -82px;
588
- }
589
 
590
  a.jp-carousel-image-download span.photo-size {
591
  font-size: 11px;
@@ -603,9 +593,6 @@ a.jp-carousel-image-download:hover {
603
  color: #68c9e8;
604
  border: none !important;
605
  }
606
- .rtl a.jp-carousel-image-download:hover{
607
- background-position: 100% -122px;
608
- }
609
 
610
  /** Meta Box End **/
611
 
@@ -849,8 +836,8 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
849
  border-radius: 2px;
850
  font: 13px/1.4 "Helvetica Neue", sans-serif !important;
851
  border: 1px solid rgba( 255, 255, 255, 0.17 );
852
- -webkit-box-shadow: inset 0px 5px 5px 0px rgba(0, 0, 0, 1);
853
- box-shadow: inset 0px 5px 5px 0px rgba(0, 0, 0, 1);
854
  }
855
 
856
  .jp-carousel-comment-post-error {
@@ -867,7 +854,7 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
867
  }
868
 
869
  #jp-carousel-comments-loading {
870
- font: 444 15px/1.7 "Helvetica Neue", sans-serif !important;
871
  display: none;
872
  color: #999;
873
  text-align: right;
@@ -947,9 +934,6 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
947
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink {
948
  background-position: 0px -176px;
949
  }
950
- .rtl .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink{
951
- background-position: 100% -176px;
952
- }
953
 
954
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like,
955
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like:hover {
@@ -1041,19 +1025,11 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
1041
  background-position: 0 -122px;
1042
  }
1043
 
1044
- .rtl .jp-carousel-light a.jp-carousel-image-download {
1045
- background-position: 100% -122px;
1046
- }
1047
-
1048
  .jp-carousel-light a.jp-carousel-image-download:hover {
1049
  background-position: 0 -122px;
1050
  color: #f1831e;
1051
  }
1052
 
1053
- .rtl .jp-carousel-light a.jp-carousel-image-download:hover {
1054
- background-position: 100% -122px;
1055
- }
1056
-
1057
  .jp-carousel-light textarea#jp-carousel-comment-form-comment-field {
1058
  background: #fbfbfb;
1059
  color: #333;
@@ -1078,8 +1054,8 @@ textarea#jp-carousel-comment-form-comment-field:focus::-webkit-input-placeholder
1078
  .jp-carousel-light #jp-carousel-comment-post-results span {
1079
  background: #f7f7f7;
1080
  border:1px solid #dfdfdf;
1081
- -webkit-box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.05);
1082
- box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.05);
1083
  }
1084
 
1085
  .jp-carousel-light .jp-carousel-slide {
1
+ /* This file was automatically generated on May 08 2015 23:47:14 */
2
 
3
  .jp-carousel-wrap * {
4
  line-height:inherit; /* prevent declarations of line-height in the universal selector */
278
 
279
  div.jp-carousel-buttons a.jp-carousel-reblog,
280
  div.jp-carousel-buttons a.jp-carousel-commentlink {
281
+ margin: 0 0 0 14px !important;
282
  }
283
 
284
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged,
286
  background-color: #303030;
287
  padding-left: 8px !important;
288
  border-radius: 2px;
289
+ border-radius: 2px;
290
  -webkit-border-radius:2px;
291
  -moz-border-radius:2px;
292
  -ms-border-radius:2px;
294
  }
295
 
296
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged {
297
+ margin: 0 -12px 0 2px !important;
298
  }
299
 
 
300
  div.jp-carousel-buttons a.jp-carousel-reblog,
301
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover {
302
  background-position: 6px -36px;
303
+ padding-left: auto !important;
304
  padding-right: 26px !important;
305
  color: #999;
306
  }
309
  background-position: 0px -156px;
310
  padding-right: 19px !important;
311
  }
 
 
 
 
 
 
 
312
 
313
  div.jp-carousel-buttons a.jp-carousel-reblog.reblogged:hover {
314
  cursor: default;
576
  text-decoration: none;
577
  background-position: 0 -82px;
578
  }
 
 
 
579
 
580
  a.jp-carousel-image-download span.photo-size {
581
  font-size: 11px;
593
  color: #68c9e8;
594
  border: none !important;
595
  }
 
 
 
596
 
597
  /** Meta Box End **/
598
 
836
  border-radius: 2px;
837
  font: 13px/1.4 "Helvetica Neue", sans-serif !important;
838
  border: 1px solid rgba( 255, 255, 255, 0.17 );
839
+ -webkit-box-shadow: inset 0px 5px 5px 0px rgba(0, 0, 0, 1);
840
+ box-shadow: inset 0px 5px 5px 0px rgba(0, 0, 0, 1);
841
  }
842
 
843
  .jp-carousel-comment-post-error {
854
  }
855
 
856
  #jp-carousel-comments-loading {
857
+ font: 400 15px/1.7 "Helvetica Neue", sans-serif !important;
858
  display: none;
859
  color: #999;
860
  text-align: right;
934
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-commentlink {
935
  background-position: 0px -176px;
936
  }
 
 
 
937
 
938
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like,
939
  .jp-carousel-light div.jp-carousel-buttons a.jp-carousel-like:hover {
1025
  background-position: 0 -122px;
1026
  }
1027
 
 
 
 
 
1028
  .jp-carousel-light a.jp-carousel-image-download:hover {
1029
  background-position: 0 -122px;
1030
  color: #f1831e;
1031
  }
1032
 
 
 
 
 
1033
  .jp-carousel-light textarea#jp-carousel-comment-form-comment-field {
1034
  background: #fbfbfb;
1035
  color: #333;
1054
  .jp-carousel-light #jp-carousel-comment-post-results span {
1055
  background: #f7f7f7;
1056
  border:1px solid #dfdfdf;
1057
+ -webkit-box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.05);
1058
+ box-shadow: inset 0px 0px 5px rgba(0, 0, 0, 0.05);
1059
  }
1060
 
1061
  .jp-carousel-light .jp-carousel-slide {
languages/carousel-without-jetpack.pot CHANGED
@@ -1,15 +1,15 @@
1
- # Copyright (C) 2014 Gallery Carousel Without JetPack
2
  # This file is distributed under the same license as the Gallery Carousel Without JetPack package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Gallery Carousel Without JetPack 0.7.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/carousel-without-"
7
  "jetpack\n"
8
- "POT-Creation-Date: 2014-08-28 11:24:39+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
 
1
+ # Copyright (C) 2015 Gallery Carousel Without JetPack
2
  # This file is distributed under the same license as the Gallery Carousel Without JetPack package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Gallery Carousel Without JetPack 0.7.4\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/carousel-without-"
7
  "jetpack\n"
8
+ "POT-Creation-Date: 2015-03-26 11:32:59+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: WPbeginner, smub, iamdpegg, n7studios
3
  Donate link:http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: gallery, lightbox, carousel, gallery carousel, jetpack, image gallery, wordpress gallery plugin, wordpress image gallery plugin, responsive gallery
5
  Requires at least: 3.4.1
6
- Tested up to: 4.0.1
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -64,9 +64,14 @@ However, if you want to turn off comments on Media attachments, you can follow t
64
 
65
 
66
  == Changelog ==
67
-
68
- = 0.7.4 =
69
- * Added French translation (props: Blacky)
 
 
 
 
 
70
 
71
  = 0.7.3 =
72
  * Updated it to match original JetPack plugin updates from 3.1.1
3
  Donate link:http://www.wpbeginner.com/wpbeginner-needs-your-help/
4
  Tags: gallery, lightbox, carousel, gallery carousel, jetpack, image gallery, wordpress gallery plugin, wordpress image gallery plugin, responsive gallery
5
  Requires at least: 3.4.1
6
+ Tested up to: 4.3
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
64
 
65
 
66
  == Changelog ==
67
+
68
+ = 0.7.5 =
69
+ * Updated it to match original JetPack plugin updates from 3.6.1
70
+ * Tested with WordPress 4.3
71
+ * Fix: plugin_dir_path() and plugin_dir_url() used for Multisite / symlink support
72
+
73
+ = 0.7.4 =
74
+ * Added French translation (props: Blacky)
75
 
76
  = 0.7.3 =
77
  * Updated it to match original JetPack plugin updates from 3.1.1