Version Description
Download this release
Release Info
| Developer | cbaldelomar |
| Plugin | |
| Version | 1.8 |
| Comparing to | |
| See all releases | |
Code changes from version 1.7 to 1.8
- README.md +13 -6
- includes/css/style.css +7 -47
- includes/functions.php +38 -7
- includes/js/admin.js +2 -0
- includes/js/gallery.js +67 -10
- includes/js/imagesloaded.pkgd.min.js +7 -0
- includes/js/masonry.pkgd.min.js +2 -2
- includes/options.php +8 -0
- includes/scripts.php +10 -4
- includes/settings.php +2 -2
- readme.txt +13 -6
- wc-gallery.php +3 -3
README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
**Contributors:** cbaldelomar
|
| 4 |
**Donate link:** http://webplantmedia.com/pay-now/
|
|
@@ -15,13 +15,13 @@ Extend WordPress galleries to display masonry gallery, carousel gallery, and sli
|
|
| 15 |
|
| 16 |
See the galleries in action.
|
| 17 |
|
| 18 |
-
1. [
|
| 19 |
-
2. [
|
| 20 |
-
3. [
|
| 21 |
|
| 22 |
### Professional Support
|
| 23 |
|
| 24 |
-
If you need professional plugin support from me, the plugin author, you can contact me at [
|
| 25 |
|
| 26 |
### Plugin Development
|
| 27 |
|
|
@@ -36,7 +36,7 @@ Yes, I do accept donations. If you want to buy me a sandwich or something, you
|
|
| 36 |
1. Uzip the `wc-gallery.zip` folder.
|
| 37 |
2. Upload the `wc-gallery` folder to your `/wp-content/plugins` directory.
|
| 38 |
3. In your WordPress dashboard, head over to the *Plugins* section.
|
| 39 |
-
4. Activate *
|
| 40 |
|
| 41 |
## Frequently Asked Questions ##
|
| 42 |
|
|
@@ -46,6 +46,13 @@ Insert a gallery through your dashboard. You will see extra dropdown settings wh
|
|
| 46 |
|
| 47 |
## Changelog ##
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
### Version 1.7
|
| 50 |
|
| 51 |
* Updated magnific popup script
|
| 1 |
+
# WP Canvas - Gallery #
|
| 2 |
|
| 3 |
**Contributors:** cbaldelomar
|
| 4 |
**Donate link:** http://webplantmedia.com/pay-now/
|
| 15 |
|
| 16 |
See the galleries in action.
|
| 17 |
|
| 18 |
+
1. [WP Canvas Galleries](http://wordpresscanvas.com/features/gallery/)
|
| 19 |
+
2. [WP Canvas Slider & Carousel](http://wordpresscanvas.com/features/gallery/slider-carousel/)
|
| 20 |
+
3. [WP Canvas Gallery Columns](http://wordpresscanvas.com/features/gallery/gallery-columns/)
|
| 21 |
|
| 22 |
### Professional Support
|
| 23 |
|
| 24 |
+
If you need professional plugin support from me, the plugin author, you can contact me at [WP Canvas](http://wordpresscanvas.com/).
|
| 25 |
|
| 26 |
### Plugin Development
|
| 27 |
|
| 36 |
1. Uzip the `wc-gallery.zip` folder.
|
| 37 |
2. Upload the `wc-gallery` folder to your `/wp-content/plugins` directory.
|
| 38 |
3. In your WordPress dashboard, head over to the *Plugins* section.
|
| 39 |
+
4. Activate *WP Canvas Gallery*.
|
| 40 |
|
| 41 |
## Frequently Asked Questions ##
|
| 42 |
|
| 46 |
|
| 47 |
## Changelog ##
|
| 48 |
|
| 49 |
+
### Version 1.8
|
| 50 |
+
|
| 51 |
+
* Fixed bug where custom links only worked when link was set to media
|
| 52 |
+
* Added option to disable integrated popup script
|
| 53 |
+
* updated masonry library
|
| 54 |
+
* Fixed permission bug with options
|
| 55 |
+
|
| 56 |
### Version 1.7
|
| 57 |
|
| 58 |
* Updated magnific popup script
|
includes/css/style.css
CHANGED
|
@@ -7,9 +7,12 @@
|
|
| 7 |
margin-left: 0px;
|
| 8 |
margin-right: 0px;
|
| 9 |
}
|
|
|
|
|
|
|
|
|
|
| 10 |
.wc-gallery .gallery.gallery-masonry,
|
| 11 |
.wc-gallery .gallery.gallery-default {
|
| 12 |
-
margin-right: -5px;
|
| 13 |
}
|
| 14 |
|
| 15 |
.wc-gallery .gallery.wc-gallery-bottomspace-ten {
|
|
@@ -35,12 +38,12 @@
|
|
| 35 |
margin: 0;
|
| 36 |
overflow: hidden;
|
| 37 |
position: relative;
|
| 38 |
-
margin-bottom: 5px;
|
| 39 |
max-width: none !important;
|
| 40 |
}
|
| 41 |
.wc-gallery .gallery-item .gallery-icon,
|
| 42 |
.wc-gallery .gallery-item .gallery-caption {
|
| 43 |
-
margin-right: 5px;
|
| 44 |
}
|
| 45 |
|
| 46 |
.wc-gallery .gallery .gallery-icon a {
|
|
@@ -58,35 +61,6 @@
|
|
| 58 |
border: 1px solid #eeeeee;
|
| 59 |
}
|
| 60 |
|
| 61 |
-
/* firefox can't handle more than 5 decimals */
|
| 62 |
-
.wc-gallery .gallery.gallery-columns-1 .gallery-item {
|
| 63 |
-
width: 100%;
|
| 64 |
-
}
|
| 65 |
-
.wc-gallery .gallery.gallery-columns-2 .gallery-item {
|
| 66 |
-
width: 50%;
|
| 67 |
-
}
|
| 68 |
-
.wc-gallery .gallery.gallery-columns-3 .gallery-item {
|
| 69 |
-
width: 33.33333%;
|
| 70 |
-
}
|
| 71 |
-
.wc-gallery .gallery.gallery-columns-4 .gallery-item {
|
| 72 |
-
width: 25%;
|
| 73 |
-
}
|
| 74 |
-
.wc-gallery .gallery.gallery-columns-5 .gallery-item {
|
| 75 |
-
width: 20%;
|
| 76 |
-
}
|
| 77 |
-
.wc-gallery .gallery.gallery-columns-6 .gallery-item {
|
| 78 |
-
width: 16.66666%;
|
| 79 |
-
}
|
| 80 |
-
.wc-gallery .gallery.gallery-columns-7 .gallery-item {
|
| 81 |
-
width: 14.28571%;
|
| 82 |
-
}
|
| 83 |
-
.wc-gallery .gallery.gallery-columns-8 .gallery-item {
|
| 84 |
-
width: 12.5%;
|
| 85 |
-
}
|
| 86 |
-
.wc-gallery .gallery.gallery-columns-9 .gallery-item {
|
| 87 |
-
width: 11.11111%;
|
| 88 |
-
}
|
| 89 |
-
|
| 90 |
.wc-gallery .gallery-caption {
|
| 91 |
margin: 0;
|
| 92 |
/* -webkit-transition: opacity 400ms ease; */
|
|
@@ -154,20 +128,6 @@
|
|
| 154 |
display: block;
|
| 155 |
}
|
| 156 |
|
| 157 |
-
@media (max-width: 480px) {
|
| 158 |
-
body .wc-gallery .gallery.gallery-columns-9 .gallery-item,
|
| 159 |
-
body .wc-gallery .gallery.gallery-columns-8 .gallery-item,
|
| 160 |
-
body .wc-gallery .gallery.gallery-columns-7 .gallery-item,
|
| 161 |
-
body .wc-gallery .gallery.gallery-columns-6 .gallery-item,
|
| 162 |
-
body .wc-gallery .gallery.gallery-columns-5 .gallery-item,
|
| 163 |
-
body .wc-gallery .gallery.gallery-columns-4 .gallery-item,
|
| 164 |
-
body .wc-gallery .gallery.gallery-columns-3 .gallery-item,
|
| 165 |
-
body .wc-gallery .gallery.gallery-columns-2 .gallery-item,
|
| 166 |
-
body .wc-gallery .gallery.gallery-columns-1 .gallery-item {
|
| 167 |
-
width: 99.9%;
|
| 168 |
-
}
|
| 169 |
-
}
|
| 170 |
-
|
| 171 |
/**
|
| 172 |
* [gallery flexslider]
|
| 173 |
* ----------------------------------------------------------------------------
|
|
@@ -208,7 +168,7 @@
|
|
| 208 |
margin-right: auto;
|
| 209 |
}
|
| 210 |
.wc-gallery .gallery.wcflexslider .wcflex-slide-item .wp-caption-text {
|
| 211 |
-
padding:
|
| 212 |
opacity: 0.7;
|
| 213 |
position: absolute;
|
| 214 |
bottom: 0;
|
| 7 |
margin-left: 0px;
|
| 8 |
margin-right: 0px;
|
| 9 |
}
|
| 10 |
+
.wc-gallery .gallery.gallery-masonry {
|
| 11 |
+
visibility: hidden;
|
| 12 |
+
}
|
| 13 |
.wc-gallery .gallery.gallery-masonry,
|
| 14 |
.wc-gallery .gallery.gallery-default {
|
| 15 |
+
/* margin-right: -5px; */
|
| 16 |
}
|
| 17 |
|
| 18 |
.wc-gallery .gallery.wc-gallery-bottomspace-ten {
|
| 38 |
margin: 0;
|
| 39 |
overflow: hidden;
|
| 40 |
position: relative;
|
| 41 |
+
/* margin-bottom: 5px; */
|
| 42 |
max-width: none !important;
|
| 43 |
}
|
| 44 |
.wc-gallery .gallery-item .gallery-icon,
|
| 45 |
.wc-gallery .gallery-item .gallery-caption {
|
| 46 |
+
/* margin-right: 5px; */
|
| 47 |
}
|
| 48 |
|
| 49 |
.wc-gallery .gallery .gallery-icon a {
|
| 61 |
border: 1px solid #eeeeee;
|
| 62 |
}
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
.wc-gallery .gallery-caption {
|
| 65 |
margin: 0;
|
| 66 |
/* -webkit-transition: opacity 400ms ease; */
|
| 128 |
display: block;
|
| 129 |
}
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
/**
|
| 132 |
* [gallery flexslider]
|
| 133 |
* ----------------------------------------------------------------------------
|
| 168 |
margin-right: auto;
|
| 169 |
}
|
| 170 |
.wc-gallery .gallery.wcflexslider .wcflex-slide-item .wp-caption-text {
|
| 171 |
+
padding: 0 10px;
|
| 172 |
opacity: 0.7;
|
| 173 |
position: absolute;
|
| 174 |
bottom: 0;
|
includes/functions.php
CHANGED
|
@@ -30,6 +30,7 @@ function wc_gallery_shortcode($blank, $attr) {
|
|
| 30 |
'captions' => 'show',
|
| 31 |
'captiontype' => 'p',
|
| 32 |
'columns' => 3,
|
|
|
|
| 33 |
'link' => 'post',
|
| 34 |
'size' => 'thumbnail',
|
| 35 |
'targetsize' => 'large',
|
|
@@ -75,6 +76,15 @@ function wc_gallery_shortcode($blank, $attr) {
|
|
| 75 |
}
|
| 76 |
|
| 77 |
$columns = intval($columns);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
|
| 79 |
$float = is_rtl() ? 'right' : 'left';
|
| 80 |
|
|
@@ -151,10 +161,13 @@ function wc_gallery_shortcode($blank, $attr) {
|
|
| 151 |
$output .= "</ul></div>\n";
|
| 152 |
}
|
| 153 |
else {
|
| 154 |
-
|
|
|
|
|
|
|
| 155 |
wp_enqueue_script( 'wc-gallery' );
|
| 156 |
|
| 157 |
-
|
|
|
|
| 158 |
|
| 159 |
$class[] = "gallery-{$display}";
|
| 160 |
$class[] = "galleryid-{$id}";
|
|
@@ -166,15 +179,19 @@ function wc_gallery_shortcode($blank, $attr) {
|
|
| 166 |
|
| 167 |
$class = implode( ' ', $class );
|
| 168 |
|
| 169 |
-
$output = "<div id='$selector' class='{$class}'>";
|
| 170 |
|
| 171 |
$i = 0;
|
| 172 |
foreach ( $attachments as $id => $attachment ) {
|
| 173 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
$image_output = wc_gallery_get_attachment_link( $id, $size, false, false, false, $targetsize, $customlink );
|
| 175 |
$image_output = preg_replace( '/^<a /', '<a rel="gallery-'.$instance.'" ', $image_output );
|
| 176 |
}
|
| 177 |
-
|
| 178 |
$image_output = wp_get_attachment_image( $id, $size, false );
|
| 179 |
else
|
| 180 |
$image_output = wp_get_attachment_link( $id, $size, true, false );
|
|
@@ -265,7 +282,6 @@ function wc_gallery_print_media_templates() {
|
|
| 265 |
'slider' => __( 'Slider (Fade)', 'wc_gallery' ),
|
| 266 |
'slider2' => __( 'Slider (Slide)', 'wc_gallery' ),
|
| 267 |
'carousel' => __( 'Carousel', 'wc_gallery' ),
|
| 268 |
-
'float' => __( 'Float', 'wc_gallery' ),
|
| 269 |
);
|
| 270 |
?>
|
| 271 |
<script type="text/html" id="tmpl-wc-gallery-settings">
|
|
@@ -346,6 +362,21 @@ function wc_gallery_print_media_templates() {
|
|
| 346 |
<input class="customlink" type="checkbox" name="customlink" data-setting="customlink" />
|
| 347 |
</label>
|
| 348 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
<?php
|
| 350 |
$space = array(
|
| 351 |
'default' => __( '20px', 'wc_gallery' ),
|
|
@@ -370,7 +401,7 @@ function wc_gallery_print_media_templates() {
|
|
| 370 |
|
| 371 |
<label class="setting">
|
| 372 |
<span><?php _e( 'Class', 'wc_gallery' ); ?></span>
|
| 373 |
-
<input class="class" type="text" name="class" data-setting="class" />
|
| 374 |
</label>
|
| 375 |
</script>
|
| 376 |
<?php
|
| 30 |
'captions' => 'show',
|
| 31 |
'captiontype' => 'p',
|
| 32 |
'columns' => 3,
|
| 33 |
+
'gutterwidth' => '0.005',
|
| 34 |
'link' => 'post',
|
| 35 |
'size' => 'thumbnail',
|
| 36 |
'targetsize' => 'large',
|
| 76 |
}
|
| 77 |
|
| 78 |
$columns = intval($columns);
|
| 79 |
+
|
| 80 |
+
if ( ! is_numeric( $gutterwidth ) ) {
|
| 81 |
+
$gutterwidth = 0.005;
|
| 82 |
+
}
|
| 83 |
+
$gutterwidth = number_format( $gutterwidth, 3 );
|
| 84 |
+
if ( $gutterwidth > 0.05 || $gutterwidth < 0.000 ) {
|
| 85 |
+
$gutterwidth = 0.005;
|
| 86 |
+
}
|
| 87 |
+
|
| 88 |
$itemwidth = $columns > 0 ? floor(100/$columns) : 100;
|
| 89 |
$float = is_rtl() ? 'right' : 'left';
|
| 90 |
|
| 161 |
$output .= "</ul></div>\n";
|
| 162 |
}
|
| 163 |
else {
|
| 164 |
+
if ( get_option( WC_GALLERY_PREFIX . 'enable_image_popup', true ) ) {
|
| 165 |
+
wp_enqueue_script( 'wc-gallery-popup' );
|
| 166 |
+
}
|
| 167 |
wp_enqueue_script( 'wc-gallery' );
|
| 168 |
|
| 169 |
+
// getting rid of float
|
| 170 |
+
$display = 'float' == $display ? 'masonry' : $display;
|
| 171 |
|
| 172 |
$class[] = "gallery-{$display}";
|
| 173 |
$class[] = "galleryid-{$id}";
|
| 179 |
|
| 180 |
$class = implode( ' ', $class );
|
| 181 |
|
| 182 |
+
$output = "<div id='$selector' data-gutter-width='".$gutterwidth."' data-columns='".$columns."' class='{$class}'>";
|
| 183 |
|
| 184 |
$i = 0;
|
| 185 |
foreach ( $attachments as $id => $attachment ) {
|
| 186 |
+
if ( $customlink ) {
|
| 187 |
+
$image_output = wc_gallery_get_attachment_link( $id, $size, false, false, false, $targetsize, $customlink );
|
| 188 |
+
$image_output = preg_replace( '/^<a /', '<a rel="gallery-'.$instance.'" ', $image_output );
|
| 189 |
+
}
|
| 190 |
+
else if ( ! empty( $link ) && 'file' === $link ) {
|
| 191 |
$image_output = wc_gallery_get_attachment_link( $id, $size, false, false, false, $targetsize, $customlink );
|
| 192 |
$image_output = preg_replace( '/^<a /', '<a rel="gallery-'.$instance.'" ', $image_output );
|
| 193 |
}
|
| 194 |
+
else if ( ! empty( $link ) && 'none' === $link )
|
| 195 |
$image_output = wp_get_attachment_image( $id, $size, false );
|
| 196 |
else
|
| 197 |
$image_output = wp_get_attachment_link( $id, $size, true, false );
|
| 282 |
'slider' => __( 'Slider (Fade)', 'wc_gallery' ),
|
| 283 |
'slider2' => __( 'Slider (Slide)', 'wc_gallery' ),
|
| 284 |
'carousel' => __( 'Carousel', 'wc_gallery' ),
|
|
|
|
| 285 |
);
|
| 286 |
?>
|
| 287 |
<script type="text/html" id="tmpl-wc-gallery-settings">
|
| 362 |
<input class="customlink" type="checkbox" name="customlink" data-setting="customlink" />
|
| 363 |
</label>
|
| 364 |
|
| 365 |
+
<?php
|
| 366 |
+
$gutterwidth = array();
|
| 367 |
+
for ( $i = 0; $i <= 50; $i++ ) {
|
| 368 |
+
$gutterwidth[ $i ] = number_format( ( $i / 1000 ), 3 );
|
| 369 |
+
}
|
| 370 |
+
?>
|
| 371 |
+
<label class="setting">
|
| 372 |
+
<span><?php _e( 'Gutter Width', 'wc_gallery' ); ?></span>
|
| 373 |
+
<select class="gutterwidth" name="gutterwidth" data-setting="gutterwidth">
|
| 374 |
+
<?php foreach ( $gutterwidth as $key => $value ) : ?>
|
| 375 |
+
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $key, '5' ); ?>><?php echo esc_html( $value ); ?>%</option>
|
| 376 |
+
<?php endforeach; ?>
|
| 377 |
+
</select>
|
| 378 |
+
</label>
|
| 379 |
+
|
| 380 |
<?php
|
| 381 |
$space = array(
|
| 382 |
'default' => __( '20px', 'wc_gallery' ),
|
| 401 |
|
| 402 |
<label class="setting">
|
| 403 |
<span><?php _e( 'Class', 'wc_gallery' ); ?></span>
|
| 404 |
+
<input class="class" type="text" name="class" style="float:left;" data-setting="class" />
|
| 405 |
</label>
|
| 406 |
</script>
|
| 407 |
<?php
|
includes/js/admin.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
| 19 |
media.gallery.defaults.captiontype = 'p'; // lil hack that lets media know there's a layout attribute.
|
| 20 |
media.gallery.defaults.customlink = false; // lil hack that lets media know there's a layout attribute.
|
| 21 |
media.gallery.defaults.bottomspace = 'default'; // lil hack that lets media know there's a layout attribute.
|
|
|
|
| 22 |
media.gallery.defaults.hidecontrols = false; // lil hack that lets media know there's a layout attribute.
|
| 23 |
media.gallery.defaults.class = ''; // lil hack that lets media know there's a layout attribute.
|
| 24 |
this.update.apply( this, ['display'] );
|
|
@@ -28,6 +29,7 @@
|
|
| 28 |
this.update.apply( this, ['captiontype'] );
|
| 29 |
this.update.apply( this, ['customlink'] );
|
| 30 |
this.update.apply( this, ['bottomspace'] );
|
|
|
|
| 31 |
this.update.apply( this, ['hidecontrols'] );
|
| 32 |
this.update.apply( this, ['class'] );
|
| 33 |
|
| 19 |
media.gallery.defaults.captiontype = 'p'; // lil hack that lets media know there's a layout attribute.
|
| 20 |
media.gallery.defaults.customlink = false; // lil hack that lets media know there's a layout attribute.
|
| 21 |
media.gallery.defaults.bottomspace = 'default'; // lil hack that lets media know there's a layout attribute.
|
| 22 |
+
media.gallery.defaults.gutterwidth = '0.005'; // lil hack that lets media know there's a layout attribute.
|
| 23 |
media.gallery.defaults.hidecontrols = false; // lil hack that lets media know there's a layout attribute.
|
| 24 |
media.gallery.defaults.class = ''; // lil hack that lets media know there's a layout attribute.
|
| 25 |
this.update.apply( this, ['display'] );
|
| 29 |
this.update.apply( this, ['captiontype'] );
|
| 30 |
this.update.apply( this, ['customlink'] );
|
| 31 |
this.update.apply( this, ['bottomspace'] );
|
| 32 |
+
this.update.apply( this, ['gutterwidth'] );
|
| 33 |
this.update.apply( this, ['hidecontrols'] );
|
| 34 |
this.update.apply( this, ['class'] );
|
| 35 |
|
includes/js/gallery.js
CHANGED
|
@@ -10,18 +10,75 @@
|
|
| 10 |
var body = $( 'body' ),
|
| 11 |
_window = $( window );
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
$(document).ready(function(){
|
| 14 |
-
|
| 15 |
-
var $
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
_window.load(function() {
|
| 22 |
-
$gallery.masonry();
|
| 23 |
});
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
if( jQuery().magnificPopup) {
|
| 27 |
$('.gallery-link-file').each( function() {
|
| 10 |
var body = $( 'body' ),
|
| 11 |
_window = $( window );
|
| 12 |
|
| 13 |
+
var calculateGrid = function($container) {
|
| 14 |
+
var columns = parseInt( $container.data('columns') );
|
| 15 |
+
var gutterWidth = $container.data('gutterWidth');
|
| 16 |
+
var containerWidth = $container.width();
|
| 17 |
+
|
| 18 |
+
if ( isNaN( gutterWidth ) ) {
|
| 19 |
+
gutterWidth = .020;
|
| 20 |
+
}
|
| 21 |
+
else if ( gutterWidth > 0.05 || gutterWidth < 0 ) {
|
| 22 |
+
gutterWidth = .020;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
if ( columns > 1 ) {
|
| 26 |
+
if ( containerWidth < 568 ) {
|
| 27 |
+
columns -= 2;
|
| 28 |
+
if ( columns > 4 ) {
|
| 29 |
+
columns = 4;
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
else if ( containerWidth < 768 ) {
|
| 33 |
+
columns -= 1;
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
+
if ( columns < 2 ) {
|
| 37 |
+
columns = 2;
|
| 38 |
+
}
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
var gutterWidth = Math.floor( containerWidth * gutterWidth );
|
| 42 |
+
|
| 43 |
+
var allGutters = gutterWidth * ( columns - 1 );
|
| 44 |
+
var contentWidth = containerWidth - allGutters;
|
| 45 |
+
|
| 46 |
+
var columnWidth = Math.floor( contentWidth / columns );
|
| 47 |
+
|
| 48 |
+
return {columnWidth: columnWidth, gutterWidth: gutterWidth, columns: columns};
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
var runMasonry = function( duration, $container) {
|
| 52 |
+
var $postBox = $container.children('.gallery-item');
|
| 53 |
+
|
| 54 |
+
var o = calculateGrid($container);
|
| 55 |
+
|
| 56 |
+
$postBox.css({'width':o.columnWidth+'px', 'margin-bottom':o.gutterWidth+'px', 'padding':'0'});
|
| 57 |
+
|
| 58 |
+
$container.masonry( {
|
| 59 |
+
itemSelector: '.gallery-item',
|
| 60 |
+
columnWidth: o.columnWidth,
|
| 61 |
+
gutter: o.gutterWidth,
|
| 62 |
+
transitionDuration: duration
|
| 63 |
+
} );
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
|
| 67 |
$(document).ready(function(){
|
| 68 |
+
$('.gallery-masonry').each( function() {
|
| 69 |
+
var $container = $(this);
|
| 70 |
+
|
| 71 |
+
imagesLoaded( $container, function() {
|
| 72 |
+
runMasonry(0, $container);
|
| 73 |
+
|
| 74 |
+
$container.css('visibility', 'visible');
|
|
|
|
|
|
|
| 75 |
});
|
| 76 |
+
|
| 77 |
+
$(window).resize(function() {
|
| 78 |
+
runMasonry(0, $container);
|
| 79 |
+
});
|
| 80 |
+
});
|
| 81 |
+
|
| 82 |
|
| 83 |
if( jQuery().magnificPopup) {
|
| 84 |
$('.gallery-link-file').each( function() {
|
includes/js/imagesloaded.pkgd.min.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*!
|
| 2 |
+
* imagesLoaded PACKAGED v3.1.5
|
| 3 |
+
* JavaScript is all like "You images are done yet or what?"
|
| 4 |
+
* MIT License
|
| 5 |
+
*/
|
| 6 |
+
|
| 7 |
+
(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("eventEmitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(this,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function c(e){this.img=e}function f(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];if("IMG"===n.nodeName&&this.addImage(n),n.nodeType&&(1===n.nodeType||9===n.nodeType))for(var i=n.querySelectorAll("img"),r=0,o=i.length;o>r;r++){var s=i[r];this.addImage(s)}}},s.prototype.addImage=function(e){var t=new c(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),c.prototype=new t,c.prototype.check=function(){var e=v[this.img.src]||new f(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},c.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return f.prototype=new t,f.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},f.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},f.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},f.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},f.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},f.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});
|
includes/js/masonry.pkgd.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
/*!
|
| 2 |
-
* Masonry PACKAGED v3.1.
|
| 3 |
* Cascading grid layout library
|
| 4 |
* http://masonry.desandro.com
|
| 5 |
* MIT License
|
| 6 |
* by David DeSandro
|
| 7 |
*/
|
| 8 |
|
| 9 |
-
(function(t){"use strict";function e(t){if(t){if("string"==typeof n[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,o=0,r=i.length;r>o;o++)if(e=i[o]+t,"string"==typeof n[e])return e}}var i="Webkit Moz ms Ms O".split(" "),n=document.documentElement.style;"function"==typeof define&&define.amd?define(function(){return e}):t.getStyleProperty=e})(window),function(t){"use strict";function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=s.length;i>e;e++){var n=s[e];t[n]=0}return t}function n(t){function n(t){if("string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var n=r(t);if("none"===n.display)return i();var h={};h.width=t.offsetWidth,h.height=t.offsetHeight;for(var p=h.isBorderBox=!(!a||!n[a]||"border-box"!==n[a]),u=0,f=s.length;f>u;u++){var d=s[u],c=n[d],l=parseFloat(c);h[d]=isNaN(l)?0:l}var m=h.paddingLeft+h.paddingRight,y=h.paddingTop+h.paddingBottom,g=h.marginLeft+h.marginRight,v=h.marginTop+h.marginBottom,_=h.borderLeftWidth+h.borderRightWidth,E=h.borderTopWidth+h.borderBottomWidth,b=p&&o,L=e(n.width);L!==!1&&(h.width=L+(b?0:m+_));var T=e(n.height);return T!==!1&&(h.height=T+(b?0:y+E)),h.innerWidth=h.width-(m+_),h.innerHeight=h.height-(y+E),h.outerWidth=h.width+g,h.outerHeight=h.height+v,h}}var o,a=t("boxSizing");return function(){if(a){var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style[a]="border-box";var i=document.body||document.documentElement;i.appendChild(t);var n=r(t);o=200===e(n.width),i.removeChild(t)}}(),n}var o=document.defaultView,r=o&&o.getComputedStyle?function(t){return o.getComputedStyle(t,null)}:function(t){return t.currentStyle},s=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define(["get-style-property/get-style-property"],n):t.getSize=n(t.getStyleProperty)}(window),function(t){"use strict";var e=document.documentElement,i=function(){};e.addEventListener?i=function(t,e,i){t.addEventListener(e,i,!1)}:e.attachEvent&&(i=function(e,i,n){e[i+n]=n.handleEvent?function(){var e=t.event;e.target=e.target||e.srcElement,n.handleEvent.call(n,e)}:function(){var i=t.event;i.target=i.target||i.srcElement,n.call(e,i)},e.attachEvent("on"+i,e[i+n])});var n=function(){};e.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:e.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(n){t[e+i]=void 0}});var o={bind:i,unbind:n};"function"==typeof define&&define.amd?define(o):t.eventie=o}(this),function(t){"use strict";function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==o.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var n=0,s=r.length;s>n;n++){var a=r[n];a()}}}function n(n){return n.bind(o,"DOMContentLoaded",i),n.bind(o,"readystatechange",i),n.bind(t,"load",i),e}var o=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?(e.isReady="function"==typeof requirejs,define(["eventie/eventie"],n)):t.docReady=n(t.eventie)}(this),function(){"use strict";function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var n=t.prototype;n.getListeners=function(t){var e,i,n=this._getEvents();if("object"==typeof t){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},n.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},n.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},n.addListener=function(t,i){var n,o=this.getListenersAsObject(t),r="object"==typeof i;for(n in o)o.hasOwnProperty(n)&&-1===e(o[n],i)&&o[n].push(r?i:{listener:i,once:!1});return this},n.on=i("addListener"),n.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},n.once=i("addOnceListener"),n.defineEvent=function(t){return this.getListeners(t),this},n.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},n.removeListener=function(t,i){var n,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&(n=e(r[o],i),-1!==n&&r[o].splice(n,1));return this},n.off=i("removeListener"),n.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},n.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},n.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},n.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if("object"===i)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},n.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(o in s)if(s.hasOwnProperty(o))for(n=s[o].length;n--;)i=s[o][n],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},n.trigger=i("emitEvent"),n.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},n.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},n._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},n._getEvents=function(){return this._events||(this._events={})},"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:this.EventEmitter=t}.call(this),function(t){"use strict";function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function o(e,i){t.fn[e]=function(o){if("string"==typeof o){for(var s=n.call(arguments,1),a=0,h=this.length;h>a;a++){var p=this[a],u=t.data(p,e);if(u)if(t.isFunction(u[o])&&"_"!==o.charAt(0)){var f=u[o].apply(u,s);if(void 0!==f)return f}else r("no such method '"+o+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+o+"'")}return this}return this.each(function(){var n=t.data(this,e);n?(n.option(o),n._init()):(n=new i(this,o),t.data(this,e,n))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};t.bridget=function(t,e){i(e),o(t,e)}}}var n=Array.prototype.slice;"function"==typeof define&&define.amd?define(["jquery"],i):i(t.jQuery)}(window),function(t,e){"use strict";function i(t,e){return t[a](e)}function n(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function o(t,e){n(t);for(var i=t.parentNode.querySelectorAll(e),o=0,r=i.length;r>o;o++)if(i[o]===t)return!0;return!1}function r(t,e){return n(t),i(t,e)}var s,a=function(){if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],i=0,n=t.length;n>i;i++){var o=t[i],r=o+"MatchesSelector";if(e[r])return r}}();if(a){var h=document.createElement("div"),p=i(h,"div");s=p?i:r}else s=o;"function"==typeof define&&define.amd?define(function(){return s}):window.matchesSelector=s}(this,Element.prototype),function(t){"use strict";function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t,i,n){function r(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var s=n("transition"),a=n("transform"),h=s&&a,p=!!n("perspective"),u={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[s],f=["transform","transition","transitionDuration","transitionProperty"],d=function(){for(var t={},e=0,i=f.length;i>e;e++){var o=f[e],r=n(o);r&&r!==o&&(t[o]=r)}return t}();e(r.prototype,t.prototype),r.prototype._create=function(){this.css({position:"absolute"})},r.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},r.prototype.getSize=function(){this.size=i(this.element)},r.prototype.css=function(t){var e=this.element.style;for(var i in t){var n=d[i]||i;e[n]=t[i]}},r.prototype.getPosition=function(){var t=o(this.element),e=this.layout.options,i=e.isOriginLeft,n=e.isOriginTop,r=parseInt(t[i?"left":"right"],10),s=parseInt(t[n?"top":"bottom"],10);r=isNaN(r)?0:r,s=isNaN(s)?0:s;var a=this.layout.size;r-=i?a.paddingLeft:a.paddingRight,s-=n?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},r.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isOriginLeft?(i.left=this.position.x+t.paddingLeft+"px",i.right=""):(i.right=this.position.x+t.paddingRight+"px",i.left=""),e.isOriginTop?(i.top=this.position.y+t.paddingTop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingBottom+"px",i.top=""),this.css(i),this.emitEvent("layout",[this])};var c=p?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};r.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=parseInt(t,10),r=parseInt(e,10),s=o===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return this.layoutPosition(),void 0;var a=t-i,h=e-n,p={},u=this.layout.options;a=u.isOriginLeft?a:-a,h=u.isOriginTop?h:-h,p.transform=c(a,h),this.transition({to:p,onTransitionEnd:this.layoutPosition,isCleaning:!0})},r.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},r.prototype.moveTo=h?r.prototype._transitionTo:r.prototype.goTo,r.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},r.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd&&t.onTransitionEnd.call(this)},r.prototype._transition=function(t){var e=this.layout.options.transitionDuration;if(!parseFloat(e))return this._nonTransition(t),void 0;var i=t.to,n=[];for(var o in i)n.push(o);var r={};if(r.transitionProperty=n.join(","),r.transitionDuration=e,this.element.addEventListener(u,this,!1),(t.isCleaning||t.onTransitionEnd)&&(this.onTransitionEnd=function(){t.isCleaning&&this._removeStyles(i),t.onTransitionEnd&&t.onTransitionEnd.call(this)}),t.from){this.css(t.from);var s=this.element.offsetHeight;s=null}this.css(r),this.css(i),this.isTransitioning=!0},r.prototype.transition=r.prototype[s?"_transition":"_nonTransition"],r.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},r.prototype.onotransitionend=function(t){this.ontransitionend(t)},r.prototype.ontransitionend=function(t){t.target===this.element&&(this.removeTransitionStyles(),this.element.removeEventListener(u,this,!1),this.isTransitioning=!1,this.onTransitionEnd&&(this.onTransitionEnd.call(this),delete this.onTransitionEnd),this.emitEvent("transitionEnd",[this]))},r.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var l={transitionProperty:"",transitionDuration:""};return r.prototype.removeTransitionStyles=function(){this.css(l)},r.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},r.prototype.remove=function(){if(!s||!parseFloat(this.layout.options.transitionDuration))return this.removeElem(),void 0;var t=this;this.on("transitionEnd",function(){return t.removeElem(),!0}),this.hide()},r.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0})},r.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:function(){this.css({display:"none"})}})},r.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},r}var n=document.defaultView,o=n&&n.getComputedStyle?function(t){return n.getComputedStyle(t,null)}:function(t){return t.currentStyle};"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],i):(t.Outlayer={},t.Outlayer.Item=i(t.EventEmitter,t.getSize,t.getStyleProperty))}(window),function(t){"use strict";function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===u.call(t)}function n(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var n=0,o=t.length;o>n;n++)e.push(t[n]);else e.push(t);return e}function o(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()}function r(i,r,u,c,l,m){function y(t,i){if("string"==typeof t&&(t=s.querySelector(t)),!t||!f(t))return a&&a.error("Bad "+this.settings.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.options),this.option(i);var n=++v;this.element.outlayerGUID=n,_[n]=this,this._create(),this.options.isInitLayout&&this.layout()}function g(t,i){t.prototype[i]=e({},y.prototype[i])}var v=0,_={};return y.prototype.settings={namespace:"outlayer",item:m},y.prototype.options={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e(y.prototype,u.prototype),y.prototype.option=function(t){e(this.options,t)},y.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},y.prototype.reloadItems=function(){this.items=this._getItems(this.element.children)},y.prototype._getItems=function(t){for(var e=this._filterFindItemElements(t),i=this.settings.item,n=[],o=0,r=e.length;r>o;o++){var s=e[o],a=new i(s,this,this.options.itemOptions);n.push(a)}return n},y.prototype._filterFindItemElements=function(t){t=n(t);for(var e=this.options.itemSelector,i=[],o=0,r=t.length;r>o;o++){var s=t[o];if(f(s))if(e){l(s,e)&&i.push(s);for(var a=s.querySelectorAll(e),h=0,p=a.length;p>h;h++)i.push(a[h])}else i.push(s)}return i},y.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},y.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},y.prototype._init=y.prototype.layout,y.prototype._resetLayout=function(){this.getSize()},y.prototype.getSize=function(){this.size=c(this.element)},y.prototype._getMeasurement=function(t,e){var i,n=this.options[t];n?("string"==typeof n?i=this.element.querySelector(n):f(n)&&(i=n),this[t]=i?c(i)[e]:n):this[t]=0},y.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},y.prototype._getItemsForLayout=function(t){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i];o.isIgnored||e.push(o)}return e},y.prototype._layoutItems=function(t,e){if(!t||!t.length)return this.emitEvent("layoutComplete",[this,t]),void 0;this._itemsOn(t,"layout",function(){this.emitEvent("layoutComplete",[this,t])});for(var i=[],n=0,o=t.length;o>n;n++){var r=t[n],s=this._getItemLayoutPosition(r);s.item=r,s.isInstant=e,i.push(s)}this._processLayoutQueue(i)},y.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},y.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var n=t[e];this._positionItem(n.item,n.x,n.y,n.isInstant)}},y.prototype._positionItem=function(t,e,i,n){n?t.goTo(e,i):t.moveTo(e,i)},y.prototype._postLayout=function(){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))},y.prototype._getContainerSize=p,y.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},y.prototype._itemsOn=function(t,e,i){function n(){return o++,o===r&&i.call(s),!0}for(var o=0,r=t.length,s=this,a=0,h=t.length;h>a;a++){var p=t[a];p.on(e,n)}},y.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},y.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},y.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var n=t[e];this.ignore(n)}}},y.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var n=t[e],o=d(this.stamps,n);-1!==o&&this.stamps.splice(o,1),this.unignore(n)}},y.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n(t)):void 0},y.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},y.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},y.prototype._manageStamp=p,y.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,n=c(t),o={left:e.left-i.left-n.marginLeft,top:e.top-i.top-n.marginTop,right:i.right-e.right-n.marginRight,bottom:i.bottom-e.bottom-n.marginBottom};return o},y.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},y.prototype.bindResize=function(){this.isResizeBound||(i.bind(t,"resize",this),this.isResizeBound=!0)},y.prototype.unbindResize=function(){i.unbind(t,"resize",this),this.isResizeBound=!1},y.prototype.onresize=function(){function t(){e.resize()}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},y.prototype.resize=function(){var t=c(this.element),e=this.size&&t;e&&t.innerWidth===this.size.innerWidth||(this.layout(),delete this.resizeTimeout)},y.prototype.addItems=function(t){var e=this._getItems(t);if(e.length)return this.items=this.items.concat(e),e},y.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},y.prototype.prepended=function(t){var e=this._getItems(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},y.prototype.reveal=function(t){if(t&&t.length)for(var e=0,i=t.length;i>e;e++){var n=t[e];n.reveal()}},y.prototype.hide=function(t){if(t&&t.length)for(var e=0,i=t.length;i>e;e++){var n=t[e];n.hide()}},y.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];if(n.element===t)return n}},y.prototype.getItems=function(t){if(t&&t.length){for(var e=[],i=0,n=t.length;n>i;i++){var o=t[i],r=this.getItem(o);r&&e.push(r)}return e}},y.prototype.remove=function(t){t=n(t);var e=this.getItems(t);if(e&&e.length){this._itemsOn(e,"remove",function(){this.emitEvent("removeComplete",[this,e])});for(var i=0,o=e.length;o>i;i++){var r=e[i];r.remove();var s=d(this.items,r);this.items.splice(s,1)}}},y.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var n=this.items[e];n.destroy()}this.unbindResize(),delete this.element.outlayerGUID,h&&h.removeData(this.element,this.settings.namespace)},y.data=function(t){var e=t&&t.outlayerGUID;return e&&_[e]},y.create=function(t,i){function n(){y.apply(this,arguments)}return e(n.prototype,y.prototype),g(n,"options"),g(n,"settings"),e(n.prototype.options,i),n.prototype.settings.namespace=t,n.data=y.data,n.Item=function(){m.apply(this,arguments)},n.Item.prototype=new m,n.prototype.settings.item=n.Item,r(function(){for(var e=o(t),i=s.querySelectorAll(".js-"+e),r="data-"+e+"-options",p=0,u=i.length;u>p;p++){var f,d=i[p],c=d.getAttribute(r);try{f=c&&JSON.parse(c)}catch(l){a&&a.error("Error parsing "+r+" on "+d.nodeName.toLowerCase()+(d.id?"#"+d.id:"")+": "+l);continue}var m=new n(d,f);h&&h.data(d,t,m)}}),h&&h.bridget&&h.bridget(t,n),n},y.Item=m,y}var s=t.document,a=t.console,h=t.jQuery,p=function(){},u=Object.prototype.toString,f="object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName},d=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,n=t.length;n>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],r):t.Outlayer=r(t.eventie,t.docReady,t.EventEmitter,t.getSize,t.matchesSelector,t.Outlayer.Item)}(window),function(t){"use strict";function e(t,e){var n=t.create("masonry");return n.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},n.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},n.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},n.prototype._getItemLayoutPosition=function(t){t.getSize();var e=Math.ceil(t.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var n=this._getColGroup(e),o=Math.min.apply(Math,n),r=i(n,o),s={x:this.columnWidth*r,y:o},a=o+t.size.outerHeight,h=this.cols+1-n.length,p=0;h>p;p++)this.colYs[r+p]=a;return s},n.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++){var o=this.colYs.slice(n,n+t);e[n]=Math.max.apply(Math,o)}return e},n.prototype._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this.options.isOriginLeft?n.left:n.right,r=o+i.outerWidth,s=Math.floor(o/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a=Math.min(this.cols-1,a);for(var h=(this.options.isOriginTop?n.top:n.bottom)+i.outerHeight,p=s;a>=p;p++)this.colYs[p]=Math.max(h,this.colYs[p])},n.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},n.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.prototype.resize=function(){var t=this.containerWidth;this.getContainerWidth(),t!==this.containerWidth&&this.layout()},n}var i=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,n=t.length;n>i;i++){var o=t[i];if(o===e)return i}return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):t.Masonry=e(t.Outlayer,t.getSize)}(window);
|
| 1 |
/*!
|
| 2 |
+
* Masonry PACKAGED v3.1.5
|
| 3 |
* Cascading grid layout library
|
| 4 |
* http://masonry.desandro.com
|
| 5 |
* MIT License
|
| 6 |
* by David DeSandro
|
| 7 |
*/
|
| 8 |
|
| 9 |
+
!function(a){function b(){}function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c(a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(this),function(a){function b(a){"function"==typeof a&&(b.isReady?a():f.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==e.readyState;if(!b.isReady&&!c){b.isReady=!0;for(var d=0,g=f.length;g>d;d++){var h=f[d];h()}}}function d(d){return d.bind(e,"DOMContentLoaded",c),d.bind(e,"readystatechange",c),d.bind(a,"load",c),b}var e=a.document,f=[];b.isReady=!1,"function"==typeof define&&define.amd?(b.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],d)):a.docReady=d(a.eventie)}(this),function(){function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&-1===b(e[d],c)&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),-1!==d&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if(a instanceof RegExp)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g=this.getListenersAsObject(a);for(e in g)if(g.hasOwnProperty(e))for(d=g[e].length;d--;)c=g[e][d],c.once===!0&&this.removeListener(a,c.listener),f=c.listener.apply(this,b||[]),f===this._getOnceReturnValue()&&this.removeListener(a,c.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return a}):"object"==typeof module&&module.exports?module.exports=a:this.EventEmitter=a}.call(this),function(a){function b(a){if(a){if("string"==typeof d[a])return a;a=a.charAt(0).toUpperCase()+a.slice(1);for(var b,e=0,f=c.length;f>e;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a){function b(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function c(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0}return a}function d(a){function d(a){if("string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var d=f(a);if("none"===d.display)return c();var e={};e.width=a.offsetWidth,e.height=a.offsetHeight;for(var k=e.isBorderBox=!(!j||!d[j]||"border-box"!==d[j]),l=0,m=g.length;m>l;l++){var n=g[l],o=d[n];o=h(a,o);var p=parseFloat(o);e[n]=isNaN(p)?0:p}var q=e.paddingLeft+e.paddingRight,r=e.paddingTop+e.paddingBottom,s=e.marginLeft+e.marginRight,t=e.marginTop+e.marginBottom,u=e.borderLeftWidth+e.borderRightWidth,v=e.borderTopWidth+e.borderBottomWidth,w=k&&i,x=b(d.width);x!==!1&&(e.width=x+(w?0:q+u));var y=b(d.height);return y!==!1&&(e.height=y+(w?0:r+v)),e.innerWidth=e.width-(q+u),e.innerHeight=e.height-(r+v),e.outerWidth=e.width+s,e.outerHeight=e.height+t,e}}function h(a,b){if(e||-1===b.indexOf("%"))return b;var c=a.style,d=c.left,f=a.runtimeStyle,g=f&&f.left;return g&&(f.left=a.currentStyle.left),c.left=b,b=c.pixelLeft,c.left=d,g&&(f.left=g),b}var i,j=a("boxSizing");return function(){if(j){var a=document.createElement("div");a.style.width="200px",a.style.padding="1px 2px 3px 4px",a.style.borderStyle="solid",a.style.borderWidth="1px 2px 3px 4px",a.style[j]="border-box";var c=document.body||document.documentElement;c.appendChild(a);var d=f(a);i=200===b(d.width),c.removeChild(a)}}(),d}var e=a.getComputedStyle,f=e?function(a){return e(a,null)}:function(a){return a.currentStyle},g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],d):"object"==typeof exports?module.exports=d(require("get-style-property")):a.getSize=d(a.getStyleProperty)}(window),function(a,b){function c(a,b){return a[h](b)}function d(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}function e(a,b){d(a);for(var c=a.parentNode.querySelectorAll(b),e=0,f=c.length;f>e;e++)if(c[e]===a)return!0;return!1}function f(a,b){return d(a),c(a,b)}var g,h=function(){if(b.matchesSelector)return"matchesSelector";for(var a=["webkit","moz","ms","o"],c=0,d=a.length;d>c;c++){var e=a[c],f=e+"MatchesSelector";if(b[f])return f}}();if(h){var i=document.createElement("div"),j=c(i,"div");g=j?c:f}else g=e;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return g}):window.matchesSelector=g}(this,Element.prototype),function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}function c(a){for(var b in a)return!1;return b=null,!0}function d(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function e(a,e,f){function h(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}var i=f("transition"),j=f("transform"),k=i&&j,l=!!f("perspective"),m={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[i],n=["transform","transition","transitionDuration","transitionProperty"],o=function(){for(var a={},b=0,c=n.length;c>b;b++){var d=n[b],e=f(d);e&&e!==d&&(a[d]=e)}return a}();b(h.prototype,a.prototype),h.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},h.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},h.prototype.getSize=function(){this.size=e(this.element)},h.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=o[c]||c;b[d]=a[c]}},h.prototype.getPosition=function(){var a=g(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=parseInt(a[c?"left":"right"],10),f=parseInt(a[d?"top":"bottom"],10);e=isNaN(e)?0:e,f=isNaN(f)?0:f;var h=this.layout.size;e-=c?h.paddingLeft:h.paddingRight,f-=d?h.paddingTop:h.paddingBottom,this.position.x=e,this.position.y=f},h.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={};b.isOriginLeft?(c.left=this.position.x+a.paddingLeft+"px",c.right=""):(c.right=this.position.x+a.paddingRight+"px",c.left=""),b.isOriginTop?(c.top=this.position.y+a.paddingTop+"px",c.bottom=""):(c.bottom=this.position.y+a.paddingBottom+"px",c.top=""),this.css(c),this.emitEvent("layout",[this])};var p=l?function(a,b){return"translate3d("+a+"px, "+b+"px, 0)"}:function(a,b){return"translate("+a+"px, "+b+"px)"};h.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={},k=this.layout.options;h=k.isOriginLeft?h:-h,i=k.isOriginTop?i:-i,j.transform=p(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},h.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},h.prototype.moveTo=k?h.prototype._transitionTo:h.prototype.goTo,h.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},h.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},h.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var q=j&&d(j)+",opacity";h.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:q,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(m,this,!1))},h.prototype.transition=h.prototype[i?"_transition":"_nonTransition"],h.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},h.prototype.onotransitionend=function(a){this.ontransitionend(a)};var r={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};h.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,d=r[a.propertyName]||a.propertyName;if(delete b.ingProperties[d],c(b.ingProperties)&&this.disableTransition(),d in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[d]),d in b.onEnd){var e=b.onEnd[d];e.call(this),delete b.onEnd[d]}this.emitEvent("transitionEnd",[this])}},h.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(m,this,!1),this.isTransitioning=!1},h.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var s={transitionProperty:"",transitionDuration:""};return h.prototype.removeTransitionStyles=function(){this.css(s)},h.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},h.prototype.remove=function(){if(!i||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.on("transitionEnd",function(){return a.removeElem(),!0}),this.hide()},h.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options;this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0})},h.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options;this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.isHidden&&this.css({display:"none"})}}})},h.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},h}var f=a.getComputedStyle,g=f?function(a){return f(a,null)}:function(a){return a.currentStyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],e):(a.Outlayer={},a.Outlayer.Item=e(a.EventEmitter,a.getSize,a.getStyleProperty))}(window),function(a){function b(a,b){for(var c in b)a[c]=b[c];return a}function c(a){return"[object Array]"===l.call(a)}function d(a){var b=[];if(c(a))b=a;else if(a&&"number"==typeof a.length)for(var d=0,e=a.length;e>d;d++)b.push(a[d]);else b.push(a);return b}function e(a,b){var c=n(b,a);-1!==c&&b.splice(c,1)}function f(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()}function g(c,g,l,n,o,p){function q(a,c){if("string"==typeof a&&(a=h.querySelector(a)),!a||!m(a))return void(i&&i.error("Bad "+this.constructor.namespace+" element: "+a));this.element=a,this.options=b({},this.constructor.defaults),this.option(c);var d=++r;this.element.outlayerGUID=d,s[d]=this,this._create(),this.options.isInitLayout&&this.layout()}var r=0,s={};return q.namespace="outlayer",q.Item=p,q.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},b(q.prototype,l.prototype),q.prototype.option=function(a){b(this.options,a)},q.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),b(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},q.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},q.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},q.prototype._filterFindItemElements=function(a){a=d(a);for(var b=this.options.itemSelector,c=[],e=0,f=a.length;f>e;e++){var g=a[e];if(m(g))if(b){o(g,b)&&c.push(g);for(var h=g.querySelectorAll(b),i=0,j=h.length;j>i;i++)c.push(h[i])}else c.push(g)}return c},q.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},q.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},q.prototype._init=q.prototype.layout,q.prototype._resetLayout=function(){this.getSize()},q.prototype.getSize=function(){this.size=n(this.element)},q.prototype._getMeasurement=function(a,b){var c,d=this.options[a];d?("string"==typeof d?c=this.element.querySelector(d):m(d)&&(c=d),this[a]=c?n(c)[b]:d):this[a]=0},q.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},q.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}return b},q.prototype._layoutItems=function(a,b){function c(){d.emitEvent("layoutComplete",[d,a])}var d=this;if(!a||!a.length)return void c();this._itemsOn(a,"layout",c);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f],i=this._getItemLayoutPosition(h);i.item=h,i.isInstant=b||h.isLayoutInstant,e.push(i)}this._processLayoutQueue(e)},q.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},q.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},q.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},q.prototype._postLayout=function(){this.resizeContainer()},q.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},q.prototype._getContainerSize=k,q.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},q.prototype._itemsOn=function(a,b,c){function d(){return e++,e===f&&c.call(g),!0}for(var e=0,f=a.length,g=this,h=0,i=a.length;i>h;h++){var j=a[h];j.on(b,d)}},q.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},q.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},q.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},q.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e(d,this.stamps),this.unignore(d)}},q.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=d(a)):void 0},q.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},q.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},q.prototype._manageStamp=k,q.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,d=n(a),e={left:b.left-c.left-d.marginLeft,top:b.top-c.top-d.marginTop,right:c.right-b.right-d.marginRight,bottom:c.bottom-b.bottom-d.marginBottom};return e},q.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},q.prototype.bindResize=function(){this.isResizeBound||(c.bind(a,"resize",this),this.isResizeBound=!0)},q.prototype.unbindResize=function(){this.isResizeBound&&c.unbind(a,"resize",this),this.isResizeBound=!1},q.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},q.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},q.prototype.needsResizeLayout=function(){var a=n(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},q.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},q.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},q.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},q.prototype.reveal=function(a){var b=a&&a.length;if(b)for(var c=0;b>c;c++){var d=a[c];d.reveal()}},q.prototype.hide=function(a){var b=a&&a.length;if(b)for(var c=0;b>c;c++){var d=a[c];d.hide()}},q.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},q.prototype.getItems=function(a){if(a&&a.length){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c],f=this.getItem(e);f&&b.push(f)}return b}},q.prototype.remove=function(a){a=d(a);var b=this.getItems(a);if(b&&b.length){this._itemsOn(b,"remove",function(){this.emitEvent("removeComplete",[this,b])});for(var c=0,f=b.length;f>c;c++){var g=b[c];g.remove(),e(g,this.items)}}},q.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindResize(),delete this.element.outlayerGUID,j&&j.removeData(this.element,this.constructor.namespace)},q.data=function(a){var b=a&&a.outlayerGUID;return b&&s[b]},q.create=function(a,c){function d(){q.apply(this,arguments)}return Object.create?d.prototype=Object.create(q.prototype):b(d.prototype,q.prototype),d.prototype.constructor=d,d.defaults=b({},q.defaults),b(d.defaults,c),d.prototype.settings={},d.namespace=a,d.data=q.data,d.Item=function(){p.apply(this,arguments)},d.Item.prototype=new p,g(function(){for(var b=f(a),c=h.querySelectorAll(".js-"+b),e="data-"+b+"-options",g=0,k=c.length;k>g;g++){var l,m=c[g],n=m.getAttribute(e);try{l=n&&JSON.parse(n)}catch(o){i&&i.error("Error parsing "+e+" on "+m.nodeName.toLowerCase()+(m.id?"#"+m.id:"")+": "+o);continue}var p=new d(m,l);j&&j.data(m,a,p)}}),j&&j.bridget&&j.bridget(a,d),d},q.Item=p,q}var h=a.document,i=a.console,j=a.jQuery,k=function(){},l=Object.prototype.toString,m="object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName},n=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],g):a.Outlayer=g(a.eventie,a.docReady,a.EventEmitter,a.getSize,a.matchesSelector,a.Outlayer.Item)}(window),function(a){function b(a,b){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d}var c=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c];if(e===b)return c}return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],b):a.Masonry=b(a.Outlayer,a.getSize)}(window);
|
includes/options.php
CHANGED
|
@@ -15,6 +15,14 @@ $wc_gallery_options = array(
|
|
| 15 |
'label' => 'Use gallery CSS provided by plugin',
|
| 16 |
'type' => 'checkbox',
|
| 17 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
),
|
| 19 |
),
|
| 20 |
),
|
| 15 |
'label' => 'Use gallery CSS provided by plugin',
|
| 16 |
'type' => 'checkbox',
|
| 17 |
),
|
| 18 |
+
array(
|
| 19 |
+
'id' => 'enable_image_popup',
|
| 20 |
+
'title' => 'Image Popup',
|
| 21 |
+
'default' => '1',
|
| 22 |
+
'description' => '',
|
| 23 |
+
'label' => 'Use <a target="_blank" href="http://dimsemenov.com/plugins/magnific-popup/">Magnific Popup</a> to showcase your images?',
|
| 24 |
+
'type' => 'checkbox',
|
| 25 |
+
),
|
| 26 |
),
|
| 27 |
),
|
| 28 |
),
|
includes/scripts.php
CHANGED
|
@@ -19,18 +19,24 @@ if( !function_exists ('wc_gallery_scripts') ) :
|
|
| 19 |
|
| 20 |
// Masonry
|
| 21 |
wp_deregister_script( 'jquery-masonry' );
|
| 22 |
-
wp_register_script( 'jquery-masonry', plugin_dir_url( __FILE__ ) . 'js/masonry.pkgd.min.js', array( ), '3.1.
|
| 23 |
wp_enqueue_script( 'jquery-masonry' );
|
| 24 |
|
| 25 |
// jQuery
|
| 26 |
wp_enqueue_script('jquery');
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
// Gallery Shortcode
|
| 29 |
-
wp_enqueue_style( 'wc-gallery-popup-style', plugin_dir_url( __FILE__ ) . 'css/magnific-popup.css', array( ), '0.9.9' );
|
| 30 |
wp_enqueue_style( 'wc-gallery-flexslider-style', plugin_dir_url( __FILE__ ) . 'js/flexslider/flexslider.css', array( ), '2.2.0' );
|
| 31 |
-
wp_register_script( 'wc-gallery-popup', plugin_dir_url( __FILE__ ) . 'js/jquery.magnific-popup.min.js', array ( 'jquery' ), '0.9.9', true );
|
| 32 |
wp_register_script( 'wc-gallery-flexslider', plugin_dir_url( __FILE__ ) . 'js/flexslider/jquery.flexslider-min.js', array ( 'jquery' ), '2.2.0', true );
|
| 33 |
-
wp_register_script( 'wc-gallery', plugin_dir_url( __FILE__ ) . 'js/gallery.js', array ( 'jquery' ), $ver, true );
|
| 34 |
wp_register_script( 'wc-gallery-woocommerce-product', plugin_dir_url( __FILE__ ) . 'js/woocommerce.product.js', array( 'jquery' ), $ver, true );
|
| 35 |
|
| 36 |
if ( WC_GALLERY_USING_WOOCOMMERCE ) {
|
| 19 |
|
| 20 |
// Masonry
|
| 21 |
wp_deregister_script( 'jquery-masonry' );
|
| 22 |
+
wp_register_script( 'jquery-masonry', plugin_dir_url( __FILE__ ) . 'js/masonry.pkgd.min.js', array( ), '3.1.5', true );
|
| 23 |
wp_enqueue_script( 'jquery-masonry' );
|
| 24 |
|
| 25 |
// jQuery
|
| 26 |
wp_enqueue_script('jquery');
|
| 27 |
|
| 28 |
+
// images loaded
|
| 29 |
+
wp_register_script( 'wordpresscanvas-imagesloaded', plugin_dir_url( __FILE__ ) . 'js/imagesloaded.pkgd.min.js', array (), '3.1.5', true );
|
| 30 |
+
|
| 31 |
+
if ( get_option( WC_GALLERY_PREFIX . 'enable_image_popup', true ) ) {
|
| 32 |
+
wp_enqueue_style( 'wc-gallery-popup-style', plugin_dir_url( __FILE__ ) . 'css/magnific-popup.css', array( ), '0.9.9' );
|
| 33 |
+
wp_register_script( 'wc-gallery-popup', plugin_dir_url( __FILE__ ) . 'js/jquery.magnific-popup.min.js', array ( 'jquery' ), '0.9.9', true );
|
| 34 |
+
}
|
| 35 |
+
|
| 36 |
// Gallery Shortcode
|
|
|
|
| 37 |
wp_enqueue_style( 'wc-gallery-flexslider-style', plugin_dir_url( __FILE__ ) . 'js/flexslider/flexslider.css', array( ), '2.2.0' );
|
|
|
|
| 38 |
wp_register_script( 'wc-gallery-flexslider', plugin_dir_url( __FILE__ ) . 'js/flexslider/jquery.flexslider-min.js', array ( 'jquery' ), '2.2.0', true );
|
| 39 |
+
wp_register_script( 'wc-gallery', plugin_dir_url( __FILE__ ) . 'js/gallery.js', array ( 'jquery', 'wordpresscanvas-imagesloaded' ), $ver, true );
|
| 40 |
wp_register_script( 'wc-gallery-woocommerce-product', plugin_dir_url( __FILE__ ) . 'js/woocommerce.product.js', array( 'jquery' ), $ver, true );
|
| 41 |
|
| 42 |
if ( WC_GALLERY_USING_WOOCOMMERCE ) {
|
includes/settings.php
CHANGED
|
@@ -29,11 +29,11 @@ function wc_gallery_options_admin_menu() {
|
|
| 29 |
global $wc_gallery_options;
|
| 30 |
|
| 31 |
foreach ( $wc_gallery_options as $tab => $o ) {
|
| 32 |
-
$view_hook_name = add_submenu_page( 'options.php', $o['title'], $o['title'], '
|
| 33 |
}
|
| 34 |
|
| 35 |
// add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
|
| 36 |
-
$view_hook_name = add_submenu_page( 'themes.php', 'WC Gallery', 'WC Gallery', '
|
| 37 |
}
|
| 38 |
add_action( 'admin_menu', 'wc_gallery_options_admin_menu' );
|
| 39 |
|
| 29 |
global $wc_gallery_options;
|
| 30 |
|
| 31 |
foreach ( $wc_gallery_options as $tab => $o ) {
|
| 32 |
+
$view_hook_name = add_submenu_page( 'options.php', $o['title'], $o['title'], 'manage_options', 'wc-gallery-options-' . $tab, 'wc_gallery_options_display_page' );
|
| 33 |
}
|
| 34 |
|
| 35 |
// add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );
|
| 36 |
+
$view_hook_name = add_submenu_page( 'themes.php', 'WC Gallery', 'WC Gallery', 'manage_options', 'wc-gallery-options', 'wc_gallery_options_display_page' );
|
| 37 |
}
|
| 38 |
add_action( 'admin_menu', 'wc_gallery_options_admin_menu' );
|
| 39 |
|
readme.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
===
|
| 2 |
|
| 3 |
Contributors: cbaldelomar
|
| 4 |
Donate link: http://webplantmedia.com/pay-now/
|
|
@@ -15,13 +15,13 @@ Extend WordPress galleries to display masonry gallery, carousel gallery, and sli
|
|
| 15 |
|
| 16 |
See the galleries in action.
|
| 17 |
|
| 18 |
-
1. [
|
| 19 |
-
2. [
|
| 20 |
-
3. [
|
| 21 |
|
| 22 |
### Professional Support
|
| 23 |
|
| 24 |
-
If you need professional plugin support from me, the plugin author, you can contact me at [
|
| 25 |
|
| 26 |
### Plugin Development
|
| 27 |
|
|
@@ -36,7 +36,7 @@ Yes, I do accept donations. If you want to buy me a sandwich or something, you
|
|
| 36 |
1. Uzip the `wc-gallery.zip` folder.
|
| 37 |
2. Upload the `wc-gallery` folder to your `/wp-content/plugins` directory.
|
| 38 |
3. In your WordPress dashboard, head over to the *Plugins* section.
|
| 39 |
-
4. Activate *
|
| 40 |
|
| 41 |
== Frequently Asked Questions ==
|
| 42 |
|
|
@@ -46,6 +46,13 @@ Insert a gallery through your dashboard. You will see extra dropdown settings wh
|
|
| 46 |
|
| 47 |
== Changelog ==
|
| 48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
### Version 1.7
|
| 50 |
|
| 51 |
* Updated magnific popup script
|
| 1 |
+
=== WP Canvas - Gallery ===
|
| 2 |
|
| 3 |
Contributors: cbaldelomar
|
| 4 |
Donate link: http://webplantmedia.com/pay-now/
|
| 15 |
|
| 16 |
See the galleries in action.
|
| 17 |
|
| 18 |
+
1. [WP Canvas Galleries](http://wordpresscanvas.com/features/gallery/)
|
| 19 |
+
2. [WP Canvas Slider & Carousel](http://wordpresscanvas.com/features/gallery/slider-carousel/)
|
| 20 |
+
3. [WP Canvas Gallery Columns](http://wordpresscanvas.com/features/gallery/gallery-columns/)
|
| 21 |
|
| 22 |
### Professional Support
|
| 23 |
|
| 24 |
+
If you need professional plugin support from me, the plugin author, you can contact me at [WP Canvas](http://wordpresscanvas.com/).
|
| 25 |
|
| 26 |
### Plugin Development
|
| 27 |
|
| 36 |
1. Uzip the `wc-gallery.zip` folder.
|
| 37 |
2. Upload the `wc-gallery` folder to your `/wp-content/plugins` directory.
|
| 38 |
3. In your WordPress dashboard, head over to the *Plugins* section.
|
| 39 |
+
4. Activate *WP Canvas - Gallery*.
|
| 40 |
|
| 41 |
== Frequently Asked Questions ==
|
| 42 |
|
| 46 |
|
| 47 |
== Changelog ==
|
| 48 |
|
| 49 |
+
### Version 1.8
|
| 50 |
+
|
| 51 |
+
* Fixed bug where custom links only worked when link was set to media
|
| 52 |
+
* Added option to disable integrated popup script
|
| 53 |
+
* updated masonry library
|
| 54 |
+
* Fixed permission bug with options
|
| 55 |
+
|
| 56 |
### Version 1.7
|
| 57 |
|
| 58 |
* Updated magnific popup script
|
wc-gallery.php
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
<?php
|
| 2 |
/*
|
| 3 |
-
Plugin Name:
|
| 4 |
Plugin URI: http://wordpresscanvas.com/features/gallery/
|
| 5 |
Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://webplantmedia.com/
|
| 8 |
-
Version: 1.
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
|
@@ -13,7 +13,7 @@ function wc_gallery_using_woocommerce() {
|
|
| 13 |
return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
|
| 14 |
}
|
| 15 |
|
| 16 |
-
define( 'WC_GALLERY_VERSION', '1.
|
| 17 |
define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
|
| 18 |
define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
|
| 19 |
define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
| 1 |
<?php
|
| 2 |
/*
|
| 3 |
+
Plugin Name: WP Canvas - Gallery
|
| 4 |
Plugin URI: http://wordpresscanvas.com/features/gallery/
|
| 5 |
Description: Extend WordPress galleries to display masonry gallery, carousel gallery, and slider gallery
|
| 6 |
Author: Chris Baldelomar
|
| 7 |
Author URI: http://webplantmedia.com/
|
| 8 |
+
Version: 1.8
|
| 9 |
License: GPLv2 or later
|
| 10 |
*/
|
| 11 |
|
| 13 |
return in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
|
| 14 |
}
|
| 15 |
|
| 16 |
+
define( 'WC_GALLERY_VERSION', '1.8' );
|
| 17 |
define( 'WC_GALLERY_PREFIX', 'wc_gallery_' );
|
| 18 |
define( '_WC_GALLERY_PREFIX', '_wc_gallery_' );
|
| 19 |
define( 'WC_GALLERY_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
