Version Description
- 08 August 2022 =
- New Widget! Introducing the SiteOrigin Blog Widget.
Download this release
Release Info
Developer | SiteOrigin |
Plugin | SiteOrigin Widgets Bundle |
Version | 1.39.0 |
Comparing to | |
See all releases |
Code changes from version 1.38.3 to 1.39.0
- base/inc/fields/js/presets-field.js +42 -38
- base/inc/fields/js/presets-field.min.js +1 -1
- base/inc/fields/slider.class.php +5 -1
- base/js/admin.js +123 -51
- base/js/admin.min.js +1 -1
- js/lib/isotope.pkgd.js +3557 -0
- js/lib/isotope.pkgd.min.js +46 -0
- lang/so-widgets-bundle.pot +303 -34
- readme.txt +6 -2
- so-widgets-bundle.php +2 -2
- widgets/blog/assets/banner.svg +1 -0
- widgets/blog/blog.php +1034 -0
- widgets/blog/css/style.css +1 -0
- widgets/blog/data/templates.json +352 -0
- widgets/blog/js/masonry.js +21 -0
- widgets/blog/js/masonry.min.js +1 -0
- widgets/blog/js/portfolio.js +39 -0
- widgets/blog/js/portfolio.min.js +1 -0
- widgets/blog/styles/alternate.less +211 -0
- widgets/blog/styles/grid.less +180 -0
- widgets/blog/styles/masonry.less +240 -0
- widgets/blog/styles/offset.less +225 -0
- widgets/blog/styles/portfolio.less +179 -0
- widgets/blog/styles/standard.less +166 -0
- widgets/blog/tpl/alternate.php +22 -0
- widgets/blog/tpl/base.php +60 -0
- widgets/blog/tpl/grid.php +21 -0
- widgets/blog/tpl/masonry.php +21 -0
- widgets/blog/tpl/offset.php +93 -0
- widgets/blog/tpl/portfolio.php +35 -0
- widgets/blog/tpl/standard.php +21 -0
base/inc/fields/js/presets-field.js
CHANGED
@@ -21,57 +21,61 @@
|
|
21 |
var $formContainer = $presetSelect.closest( '.siteorigin-widget-form-main' );
|
22 |
|
23 |
// If we're adding defaults, don't show undo.
|
24 |
-
if (
|
25 |
var previousValues = $presetSelect.data( 'previousValues' );
|
26 |
-
if ( !
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
42 |
}
|
43 |
}
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
}
|
|
|
|
|
60 |
}
|
61 |
-
sowbForms.setWidgetFormValues( $formContainer, presetValues,
|
62 |
}
|
63 |
onLoadTrigger = false;
|
64 |
}
|
65 |
} );
|
66 |
|
67 |
-
if ( $presetSelect.data( 'default-preset' ) !=
|
68 |
-
//
|
69 |
-
$( this ).find( 'select[class="siteorigin-widget-input"] option[value="default"]' ).remove();
|
70 |
-
// If no value is selected, and there's a default preset, load it.
|
71 |
if ( $presetSelect.val() == 'default' ) {
|
72 |
addingDefault = true;
|
73 |
$presetSelect.val( $presetSelect.data( 'default-preset' ) );
|
74 |
}
|
|
|
|
|
75 |
}
|
76 |
onLoadTrigger = true;
|
77 |
$presetSelect.trigger( 'change' );
|
21 |
var $formContainer = $presetSelect.closest( '.siteorigin-widget-form-main' );
|
22 |
|
23 |
// If we're adding defaults, don't show undo.
|
24 |
+
if ( addingDefault || ! onLoadTrigger) {
|
25 |
var previousValues = $presetSelect.data( 'previousValues' );
|
26 |
+
if ( ! addingDefault ) {
|
27 |
+
if ( ! previousValues ) {
|
28 |
+
var presetClone = JSON.parse( JSON.stringify( presetValues ) );
|
29 |
+
var widgetData = sowbForms.getWidgetFormValues( $formContainer );
|
30 |
+
var recurseDepth = 0;
|
31 |
+
var copyValues = function( from, to ) {
|
32 |
+
if ( ++recurseDepth > 10 ) {
|
33 |
+
return to;
|
34 |
+
}
|
35 |
+
for ( var key in to ) {
|
36 |
+
if ( from.hasOwnProperty( key ) ) {
|
37 |
+
var fromItem = from[ key ];
|
38 |
+
var toItem = to[ key ];
|
39 |
+
if ( fromItem !== null && toItem !== null && typeof fromItem === 'object' ) {
|
40 |
+
copyValues( fromItem, toItem );
|
41 |
+
} else {
|
42 |
+
to[ key ] = fromItem;
|
43 |
+
}
|
44 |
}
|
45 |
}
|
46 |
+
return to;
|
47 |
+
};
|
48 |
+
// Copy existing widget values for preset properties to allow for undo.
|
49 |
+
previousValues = copyValues( widgetData, presetClone );
|
50 |
+
$presetSelect.data( 'previousValues', previousValues );
|
51 |
+
}
|
52 |
+
if ( $undoLink.not( ':visible' ) ) {
|
53 |
+
$undoLink.show();
|
54 |
+
$undoLink.on( 'click', function ( event ) {
|
55 |
+
event.preventDefault();
|
56 |
+
$undoLink.hide();
|
57 |
+
sowbForms.setWidgetFormValues( $formContainer, previousValues, false, 'preset' );
|
58 |
+
$presetSelect.removeData( 'previousValues' );
|
59 |
+
$presetSelect.val( '' );
|
60 |
+
} );
|
61 |
+
}
|
62 |
+
} else {
|
63 |
+
addingDefault = false;
|
64 |
}
|
65 |
+
sowbForms.setWidgetFormValues( $formContainer, presetValues, false, 'preset' );
|
66 |
}
|
67 |
onLoadTrigger = false;
|
68 |
}
|
69 |
} );
|
70 |
|
71 |
+
if ( $presetSelect.data( 'default-preset' ) != undefined ) {
|
72 |
+
// If no value is selected, and there's a default-preset set, load it.
|
|
|
|
|
73 |
if ( $presetSelect.val() == 'default' ) {
|
74 |
addingDefault = true;
|
75 |
$presetSelect.val( $presetSelect.data( 'default-preset' ) );
|
76 |
}
|
77 |
+
// There's a default preset set, remove the empty default.
|
78 |
+
$( this ).find( 'select[class="siteorigin-widget-input"] option[value="default"]' ).remove();
|
79 |
}
|
80 |
onLoadTrigger = true;
|
81 |
$presetSelect.trigger( 'change' );
|
base/inc/fields/js/presets-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",(function(i){var t=e(this).find('select[class="siteorigin-widget-input"]');if(!t.data("initialized")){var a=t.find("+ .sowb-presets-field-undo");a.hide();var s=!1,r=!1,o=t.data("presets");t.on("change",(function(){var e=t.val();if(e&&o.hasOwnProperty(e)){var i=o[e].values,n=t.closest(".siteorigin-widget-form-main");if(
|
1 |
+
!function(e){e(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",(function(i){var t=e(this).find('select[class="siteorigin-widget-input"]');if(!t.data("initialized")){var a=t.find("+ .sowb-presets-field-undo");a.hide();var s=!1,r=!1,o=t.data("presets");t.on("change",(function(){var e=t.val();if(e&&o.hasOwnProperty(e)){var i=o[e].values,n=t.closest(".siteorigin-widget-form-main");if(r||!s){var l=t.data("previousValues");if(r)r=!1;else{if(!l){var u=JSON.parse(JSON.stringify(i)),d=sowbForms.getWidgetFormValues(n),f=0,v=function(e,i){if(++f>10)return i;for(var t in i)if(e.hasOwnProperty(t)){var a=e[t],s=i[t];null!==a&&null!==s&&"object"==typeof a?v(a,s):i[t]=a}return i};l=v(d,u),t.data("previousValues",l)}a.not(":visible")&&(a.show(),a.on("click",(function(e){e.preventDefault(),a.hide(),sowbForms.setWidgetFormValues(n,l,!1,"preset"),t.removeData("previousValues"),t.val("")})))}sowbForms.setWidgetFormValues(n,i,!1,"preset")}s=!1}})),null!=t.data("default-preset")&&("default"==t.val()&&(r=!0,t.val(t.data("default-preset"))),e(this).find('select[class="siteorigin-widget-input"] option[value="default"]').remove()),s=!0,t.trigger("change"),t.data("initialized",!0)}}))}(jQuery);
|
base/inc/fields/slider.class.php
CHANGED
@@ -35,7 +35,11 @@ class SiteOrigin_Widget_Field_Slider extends SiteOrigin_Widget_Field_Base {
|
|
35 |
<div class="siteorigin-widget-slider-wrapper">
|
36 |
<div class="siteorigin-widget-value-slider"></div>
|
37 |
</div>
|
38 |
-
<input
|
|
|
|
|
|
|
|
|
39 |
value="<?php echo !empty( $value ) ? esc_attr( $value ) : 0 ?>"
|
40 |
min="<?php echo isset( $this->min ) ? (float) $this->min : 0 ?>"
|
41 |
max="<?php echo isset( $this->max ) ? (float) $this->max : 100 ?>"
|
35 |
<div class="siteorigin-widget-slider-wrapper">
|
36 |
<div class="siteorigin-widget-value-slider"></div>
|
37 |
</div>
|
38 |
+
<input
|
39 |
+
type="number"
|
40 |
+
class="siteorigin-widget-input siteorigin-widget-input-slider"
|
41 |
+
name="<?php echo esc_attr( $this->element_name ) ?>"
|
42 |
+
id="<?php echo esc_attr( $this->element_id ) ?>"
|
43 |
value="<?php echo !empty( $value ) ? esc_attr( $value ) : 0 ?>"
|
44 |
min="<?php echo isset( $this->min ) ? (float) $this->min : 0 ?>"
|
45 |
max="<?php echo isset( $this->max ) ? (float) $this->max : 100 ?>"
|
base/js/admin.js
CHANGED
@@ -325,6 +325,7 @@ var sowbForms = window.sowbForms || {};
|
|
325 |
$input.on( 'change', function( event, data ) {
|
326 |
if ( ! ( data && data.silent ) ) {
|
327 |
$c.slider( 'value', parseFloat( $input.val() ) );
|
|
|
328 |
}
|
329 |
});
|
330 |
});
|
@@ -1308,33 +1309,26 @@ var sowbForms = window.sowbForms || {};
|
|
1308 |
|
1309 |
updateRepeaterChildren(formContainer, data);
|
1310 |
|
1311 |
-
formContainer.find('*[name]'
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
return true;
|
1317 |
-
}
|
1318 |
-
|
1319 |
-
name = name[1];
|
1320 |
-
var parts = name.split('][');
|
1321 |
-
|
1322 |
-
// Make sure we either have numbers or strings
|
1323 |
-
parts = parts.map( function ( e ) {
|
1324 |
-
if ( !isNaN( parseFloat( e ) ) && isFinite( e ) ) {
|
1325 |
return parseInt( e );
|
1326 |
} else {
|
1327 |
return e;
|
1328 |
}
|
1329 |
} );
|
1330 |
-
|
|
|
|
|
1331 |
var sub = data;
|
1332 |
var value;
|
1333 |
-
for (var i = 0; i < parts.length; i++) {
|
1334 |
// If the field is missing from the data, just leave `value` as `undefined`.
|
1335 |
if ( ! sub.hasOwnProperty( parts[ i ] ) ) {
|
1336 |
if ( skipMissingValues ) {
|
1337 |
-
|
1338 |
} else {
|
1339 |
break;
|
1340 |
}
|
@@ -1346,45 +1340,124 @@ var sowbForms = window.sowbForms || {};
|
|
1346 |
}
|
1347 |
}
|
1348 |
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
}
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
if (
|
1358 |
-
|
1359 |
}
|
|
|
|
|
|
|
|
|
|
|
1360 |
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
|
|
1369 |
}
|
1370 |
-
|
1371 |
-
|
|
|
|
|
1372 |
}
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
if (
|
1377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1378 |
}
|
1379 |
-
} else {
|
1380 |
-
$$.val( value );
|
1381 |
-
}
|
1382 |
-
|
1383 |
-
if ( triggerChange ) {
|
1384 |
-
$$.trigger( 'change' );
|
1385 |
-
this.dispatchEvent(new Event('change', {bubbles: true, cancelable: true}));
|
1386 |
}
|
1387 |
-
}
|
|
|
1388 |
};
|
1389 |
|
1390 |
|
@@ -1452,7 +1525,6 @@ var sowbForms = window.sowbForms || {};
|
|
1452 |
var $body = $( 'body' );
|
1453 |
// Setup new widgets when they're added in the Customizer or new widgets interface.
|
1454 |
$( document ).on( 'widget-added', function( e, widget ) {
|
1455 |
-
console.log(widget.find( '.siteorigin-widget-form' ));
|
1456 |
widget.find( '.siteorigin-widget-form' ).sowSetupForm();
|
1457 |
} );
|
1458 |
|
325 |
$input.on( 'change', function( event, data ) {
|
326 |
if ( ! ( data && data.silent ) ) {
|
327 |
$c.slider( 'value', parseFloat( $input.val() ) );
|
328 |
+
$$.find('.siteorigin-widget-slider-value').html( $input.val() );
|
329 |
}
|
330 |
});
|
331 |
});
|
1309 |
|
1310 |
updateRepeaterChildren(formContainer, data);
|
1311 |
|
1312 |
+
$fields = formContainer.find( '*[name]' );
|
1313 |
+
var index = 0;
|
1314 |
+
var validateParts = function( parts ) {
|
1315 |
+
parts.map( function ( e ) {
|
1316 |
+
if ( ! isNaN( parseFloat( e ) ) && isFinite( e ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1317 |
return parseInt( e );
|
1318 |
} else {
|
1319 |
return e;
|
1320 |
}
|
1321 |
} );
|
1322 |
+
return parts;
|
1323 |
+
};
|
1324 |
+
var getValues = function( data, parts ) {
|
1325 |
var sub = data;
|
1326 |
var value;
|
1327 |
+
for ( var i = 0; i < parts.length; i++ ) {
|
1328 |
// If the field is missing from the data, just leave `value` as `undefined`.
|
1329 |
if ( ! sub.hasOwnProperty( parts[ i ] ) ) {
|
1330 |
if ( skipMissingValues ) {
|
1331 |
+
continue;
|
1332 |
} else {
|
1333 |
break;
|
1334 |
}
|
1340 |
}
|
1341 |
}
|
1342 |
|
1343 |
+
return {
|
1344 |
+
sub: sub,
|
1345 |
+
value: value
|
1346 |
+
};
|
1347 |
+
}
|
1348 |
+
|
1349 |
+
var compareValues = function ( currentValue, newValue ) {
|
1350 |
+
if ( ! newValue ) {
|
1351 |
+
if ( currentValue ) {
|
1352 |
+
return true;
|
1353 |
}
|
1354 |
+
} else if ( currentValue !== newValue ) {
|
1355 |
+
return true;
|
1356 |
+
}
|
1357 |
+
return false;
|
1358 |
+
};
|
1359 |
|
1360 |
+
var processFields = function( index, $fields ) {
|
1361 |
+
for ( ; index < $fields.length; index++ ) {
|
1362 |
+
if (
|
1363 |
+
index != 0 &&
|
1364 |
+
index + 1 < $fields.length &&
|
1365 |
+
index % 20 == 0
|
1366 |
+
) {
|
1367 |
+
setTimeout( processFields, 150, index + 1, $fields );
|
1368 |
+
return;
|
1369 |
}
|
1370 |
+
var $$ = $( $fields[ index ] );
|
1371 |
+
var name = /[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec( $$.attr( 'name' ) );
|
1372 |
+
if ( name === undefined || name === null ) {
|
1373 |
+
return true;
|
1374 |
}
|
1375 |
+
|
1376 |
+
// There's certain fields we shouldn't process as it can result
|
1377 |
+
// in invalid data, or unintentionally having things processed multiple times.
|
1378 |
+
if (
|
1379 |
+
$$.hasClass( 'sow-measurement-select-unit' ) ||
|
1380 |
+
$$.attr( 'data-presets' ) ||
|
1381 |
+
$$.parent().hasClass( 'siteorigin-widget-field-type-posts' ) ||
|
1382 |
+
$$.attr( 'type' ) == 'hidden'
|
1383 |
+
) {
|
1384 |
+
continue;
|
1385 |
+
}
|
1386 |
+
|
1387 |
+
name = name[1];
|
1388 |
+
var parts = name.split( '][' );
|
1389 |
+
// Make sure we either have numbers or strings
|
1390 |
+
parts = validateParts( parts );
|
1391 |
+
var values = getValues( data, parts )
|
1392 |
+
if ( skipMissingValues && values.value == '' ) {
|
1393 |
+
continue;
|
1394 |
+
}
|
1395 |
+
if ( typeof values.value == 'undefined' ) {
|
1396 |
+
continue;
|
1397 |
+
}
|
1398 |
+
|
1399 |
+
var updated = false;
|
1400 |
+
// This is the end, so we need to set the value on the field here.
|
1401 |
+
if ( $$.attr( 'type' ) === 'checkbox' && $$.is( ':checked' ) != values.value ) {
|
1402 |
+
$$.prop( 'checked', values.value );
|
1403 |
+
updated = true;
|
1404 |
+
} else if ( $$.attr( 'type' ) === 'radio' ) {
|
1405 |
+
$$.prop( 'checked', values.value === $$.val() );
|
1406 |
+
updated = true;
|
1407 |
+
} else if ( $$.prop( 'tagName' ) === 'TEXTAREA' && $$.hasClass( 'wp-editor-area' ) ) {
|
1408 |
+
// This is a TinyMCE editor, so we'll use the tinyMCE object to get the content
|
1409 |
+
var editor = null;
|
1410 |
+
if ( typeof tinyMCE !== 'undefined' ) {
|
1411 |
+
editor = tinyMCE.get( $$.attr( 'id' ) );
|
1412 |
+
}
|
1413 |
+
|
1414 |
+
if ( editor !== null && typeof( editor.setContent ) === "function" && ! editor.isHidden() && $$.parent().is( ':visible' ) ) {
|
1415 |
+
if ( compareValues( editor.getContent(), values.value ) ) {
|
1416 |
+
if ( editor.initialized ) {
|
1417 |
+
editor.setContent( values.value );
|
1418 |
+
updated = true;
|
1419 |
+
} else {
|
1420 |
+
editor.on('init', function () {
|
1421 |
+
editor.setContent( values.value );
|
1422 |
+
});
|
1423 |
+
updated = true;
|
1424 |
+
}
|
1425 |
+
}
|
1426 |
+
} else if ( compareValues( $$.val(), values.value ) ) {
|
1427 |
+
$$.val( values.value );
|
1428 |
+
updated = true;
|
1429 |
+
}
|
1430 |
+
} else if ( $$.is( '.panels-data' ) ) {
|
1431 |
+
if ( compareValues( $$.val(), values.value ) ) {
|
1432 |
+
$$.val( values.value );
|
1433 |
+
var builder = $$.data( 'builder' );
|
1434 |
+
if ( builder ) {
|
1435 |
+
builder.setDataField( $$ );
|
1436 |
+
updated = true;
|
1437 |
+
}
|
1438 |
+
}
|
1439 |
+
} else if ( compareValues( $$.val(), values.value ) ) {
|
1440 |
+
$$.val( values.value );
|
1441 |
+
updated = true;
|
1442 |
+
}
|
1443 |
+
|
1444 |
+
if ( triggerChange && updated ) {
|
1445 |
+
if (
|
1446 |
+
triggerChange == 'preset' &&
|
1447 |
+
(
|
1448 |
+
! $$.hasClass( 'siteorigin-widget-input-color' ) &&
|
1449 |
+
! $$.hasClass( 'siteorigin-widget-input-slider' ) &&
|
1450 |
+
! $$.attr( 'type' ) == 'checkbox'
|
1451 |
+
)
|
1452 |
+
) {
|
1453 |
+
continue;
|
1454 |
+
}
|
1455 |
+
$$.trigger( 'change' );
|
1456 |
+
this.dispatchEvent( new Event( 'change', { bubbles: true, cancelable: true } ) );
|
1457 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1458 |
}
|
1459 |
+
};
|
1460 |
+
processFields( index, $fields );
|
1461 |
};
|
1462 |
|
1463 |
|
1525 |
var $body = $( 'body' );
|
1526 |
// Setup new widgets when they're added in the Customizer or new widgets interface.
|
1527 |
$( document ).on( 'widget-added', function( e, widget ) {
|
|
|
1528 |
widget.find( '.siteorigin-widget-form' ).sowSetupForm();
|
1529 |
} );
|
1530 |
|
base/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each((function(i,t){var r,n=e(t),a=!0,s=e("body"),o=n.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(n.is(".siteorigin-widget-form-main")){if(!0===n.data("sow-form-setup"))return!0;if(s.hasClass("widgets-php")&&!s.hasClass("block-editor-page")&&!n.is(":visible")&&0===n.closest(".panel-dialog").length)return!0;n.on("sowstatechange",(function(i,t,r){n.find("[data-state-handler]").each((function(){var i,n,s,o,d,l,g=e(this),f=e.extend({},g.data("state-handler"),a?g.data("state-handler-initial"):{});if(0===Object.keys(f).length)return!0;var p={},c=sowbForms.getContainerFieldId(g,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==c){var u={};for(var w in f)u[w.replace("{$repeater}",c)]=f[w];f=u}var m=sowbForms.getContainerFieldId(g,"widget",".siteorigin-widget-widget");if(!1!==m){var v={};for(var h in f){var b=h.match(/_else\[(.*)\]|(.*)\[(.*)\]/);v[b&&b.length&&void 0===b[1]?b[2]+"_"+m+"["+b[3]+"]":"_else["+b[1]+"_"+m+"]"]=f[h]}f=v}for(var y in f)if(d=!1,null!==(i=y.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(n={group:"default",name:"",multi:!1},void 0!==i[2]?(n.group=i[1],n.name=i[3]):n.name=i[0],n.multi=void 0!==i[4],"_else"===n.group)n.group=n.name,n.name="",d=n.group===t&&void 0===p[n.group];else{l=n.name.split(",").map((function(e){return e.trim()}));for(var k=0;k<l.length&&!(d=n.group===t&&l[k]===r);k++);}if(d){s=f[y],n.multi||(s=[s]);for(k=0;k<s.length;k++){var F=!1;if((o=void 0!==s[k][1]&&Boolean(s[k][1])?g.find(s[k][1]):g).prop("style").length&&("show"==s[k][0]?(o.fadeIn("fast"),F=!0):"hide"==s[k][0]&&(o.fadeOut("fast"),F=!0)),F||o[s[k][0]].apply(o,void 0!==s[k][2]?s[k][2]:[]),o.is(".siteorigin-widget-field:visible"))if(o.is(".siteorigin-widget-field-type-section"))o.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else o.trigger("sowsetupformfield")}p[n.group]=!0}}}))})),n.sowSetupPreview(),r=n;var d=n.find(".siteorigin-widget-teaser");if(d.find(".dashicons-dismiss").on("click",(function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",(function(){d.remove()}))})),!n.data("backupDisabled")){var l=n.find("> .siteorigin-widgets-form-id").val(),g=n.find("> .siteorigin-widgets-form-timestamp"),f=parseInt(g.val()||0),p=JSON.parse(sessionStorage.getItem(l));p&&(p._sow_form_timestamp>f?sowbForms.displayNotice(n,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(r,p),e.slideUp("fast",(function(){e.remove()}))}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",(function(){sessionStorage.removeItem(l),e.remove()}))}}]):sessionStorage.removeItem(l)),n.on("change",(function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(n);sessionStorage.setItem(l,JSON.stringify(e))}))}}else r=n.closest(".siteorigin-widget-form-main");r.find("> .siteorigin-widgets-form-id").val();var c=n.find("> .siteorigin-widget-field");c.find("> .siteorigin-widget-section").sowSetupForm();var u=c.find("> .siteorigin-widget-widget");u.find("> .siteorigin-widget-section").sowSetupForm(),u.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),c.find(".siteorigin-widget-input").each((function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))})),c.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),n.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),c.find("> .siteorigin-widget-input-color").each((function(){var i=e(this),t={change:function(i,t){setTimeout((function(){e(i.target).trigger("change")}),100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)}));var w=function(i){("keyup"!=i.type||sowbForms.isEnter(i))&&(e(this).toggleClass("siteorigin-widget-section-visible"),e(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",(function(){(e(window).trigger("resize"),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible"))&&e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})))};c.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").on("click keyup",w).attr("tabinex",0),c.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").on("click keyup",w),c.filter(".siteorigin-widget-field-type-slider").each((function(){var i=e(this),t=i.find('input[type="number"]'),r=i.find(".siteorigin-widget-value-slider");r.slider({max:parseFloat(t.attr("max")),min:parseFloat(t.attr("min")),step:parseFloat(t.attr("step")),value:parseFloat(t.val()),slide:function(e,r){t.val(parseFloat(r.value)),t.trigger("change"),i.find(".siteorigin-widget-slider-value").html(r.value)}}),t.on("change",(function(e,i){i&&i.silent||r.slider("value",parseFloat(t.val()))}))})),c.filter(".siteorigin-widget-field-type-link").each((function(){var i=e(this),t=function(){var t=i.find(".content-text-search"),r={action:"so_widgets_search_posts",query:t.val(),postTypes:t.data("postTypes")};"string"==typeof icl_this_lang&&(r.language=icl_this_lang);var n=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,r,(function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label=" "),n.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]).attr("tabindex",0));n.removeClass("loading")}))};i.find(".select-content-button, .button-close").on("click",(function(r){r.preventDefault(),e(this).trigger("blur");var n=i.find(".existing-content-selector");n.toggle(),n.is(":visible")&&0===n.find("ul.posts li").length&&t()})),i.on("click keyup",".posts li",(function(t){if(t.preventDefault(),"keyup"!=t.type||sowbForms.isEnter(t)){var r=e(this);i.find("input.siteorigin-widget-input").val("post: "+r.data("value")),i.trigger("change"),i.find(".existing-content-selector").toggle()}}));var r=null;i.find(".content-text-search").on("keyup",(function(){null!==r&&clearTimeout(r),r=setTimeout((function(){t()}),500)}))})),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&c.filter(".siteorigin-widget-field-type-builder").each((function(){e(this).find("> .siteorigin-page-builder-field").each((function(){var i=e(this);i.soPanelsSetupBuilderWidget({builderType:i.data("type")})}))}));var m=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if(void 0!==t){var n=function(t,r){if(void 0===sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return r;if(i.is('[type="radio"]')&&!i.is(":checked"))return r;var n=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");!1!==n&&(t.args=t.args.map((function(e){return e.replace("{$repeater}",n)})));var a=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");!1===a||t.hasOwnProperty("widgetFieldId")||(t.widgetFieldId=a,t.args=t.args.map((function(e){return e="conditional"===t.callback?e.replace(/(.*)(\[.*)/,"$1_"+a+"$2"):e+"_"+a})));var s=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return i.parent().hasClass("siteorigin-widget-field-type-media")&&"conditional"==t.callback&&(s||(s=i.hasClass("media-fallback-external")?i.prev().val():fallbackField=i.next().val()),0==s&&(s="")),e.extend(r,sowEmitters[t.callback](s,t.args))},a={default:""};void 0===t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=n(t[s],a);var o=r.data("states");for(var d in void 0===o&&(o={default:""}),a)void 0!==o[d]&&a[d]===o[d]||(o[d]=a[d],r.trigger("sowstatechange",[d,a[d]]));r.data("states",o)}};c.filter("[data-state-emitter]").each((function(){var i=e(this).find(".siteorigin-widget-input");i.on("keyup change",m),i.each((function(){var i=e(this);i.is(":radio")?i.is(":checked")&&m.call(i[0]):m.call(i[0])}))})),n.trigger("sowsetupform",c).data("sow-form-setup",!0),c.trigger("sowsetupformfield"),n.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(s.hasClass("wp-customizer")||s.hasClass("widgets-php"))&&n.closest(".ui-sortable").on("sortstop",(function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),a=!1}))},e.fn.sowSetupPreview=function(){var i=e(this);i.siblings(".siteorigin-widget-preview").find("> a").on("click",(function(t){t.preventDefault();var r=sowbForms.getWidgetFormValues(i),n=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");n.find('input[name="data"]').val(JSON.stringify(r)),n.find('input[name="class"]').val(i.data("class")),n.find("iframe").on("load",(function(){e(this).css("visibility","visible")})),n.find("form").trigger("submit"),n.find(".close").on("click keyup",(function(e){("keyup"!=e.type||sowbForms.isEnter(e))&&n.remove()}))}))},e.fn.sowSetupRepeater=function(){return e(this).each((function(i,t){var r=e(t),n=r.find(".siteorigin-widget-field-repeater-items"),a=r.data("repeater-name");n.on("updateFieldPositions",(function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each((function(i,t){e(t).find(".siteorigin-widget-input").each((function(t,r){var n=e(r).data("repeater-positions");void 0===n&&(n={}),n[a]=i,e(r).data("repeater-positions",n)}))})),i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t),n=r.data("repeater-positions");if(void 0!==n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}})),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t);r.prop("checked",r.prop("defaultChecked"))})),i.data("initialSetup",!0));var n=r.data("scroll-count")?parseInt(r.data("scroll-count")):0;if(n>0&&t.length>n){var s=t.first().outerHeight();i.css("max-height",s*n+"px"),i.css("overflow","auto")}else i.css("max-height","").css("overflow","")})),n.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){n.find('input[type="radio"].siteorigin-widget-input').attr("name",""),n.trigger("updateFieldPositions"),r.trigger("change")},sortstop:function(i,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each((function(){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})):t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");r.trigger("change")}}),n.trigger("updateFieldPositions"),r.find("> .siteorigin-widget-field-repeater-add").disableSelection().on("click keyup",(function(i){i.preventDefault(),("keyup"!=i.type||sowbForms.isEnter(i))&&r.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",(function(){e(window).trigger("resize")}))})),r.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").on("click",(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",(function(){e(window).trigger("resize")}))}))}))},e.fn.sowAddRepeaterItem=function(){return e(this).each((function(i,t){var r=e(t),n=r.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+r.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each((function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))}));var s="";a.find("> .siteorigin-widget-field").each((function(i,t){var r=t.outerHTML;e(t).is(".siteorigin-widget-field-type-repeater")||(r=r.replace(/_id_/g,n)),s+=r}));var o=void 0!==r.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable"></div>').append(e('<div class="siteorigin-widget-field-repeater-item-top" tabindex="0" />').append(e('<div class="siteorigin-widget-field-expand" tabindex="0" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" tabindex="0" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" tabindex="0" />')).append(e("<h4></h4>").html(r.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form"></div>').html(s));r.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",(function(){e(window).trigger("resize")})),r.trigger("change")}))},e.fn.sowRemoveRepeaterItem=function(){return e(this).each((function(i,t){var r=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(t).trigger("change")}))},e.fn.sowSetupRepeaterItems=function(){return e(this).each((function(i,t){var r=e(t);if(void 0===r.data("sowrepeater-actions-setup")){var n=r.closest(".siteorigin-widget-field-repeater"),a=r.find("> .siteorigin-widget-field-repeater-item-top"),s=n.data("item-label"),o=r.parents(".siteorigin-widget-field-repeater").data("item-name");if(s&&(s.hasOwnProperty("selector")||s.hasOwnProperty("selectorArray"))){var d=function(){var e,i,t;if(s.hasOwnProperty("selectorArray"))for(var n=0;n<s.selectorArray.length&&(e=(t=s.selectorArray[n]).hasOwnProperty("valueMethod")&&t.valueMethod?t.valueMethod:"val",!(i=r.find(t.selector)[e]()));n++);else e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=r.find(s.selector)[e]();if(i)i.length>80&&(i=i.substr(0,79)+"...");else if(i=o,s.increment){var d=r.index();d++,isNaN(d)||("before"==s.increment?i=d+" "+i:i+=" "+d)}a.find("h4").text(i)};d();var l=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";r.on(l,d)}a.on("click keyup",(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&("keyup"!=i.type||sowbForms.isEnter(i))&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",(function(){e(window).trigger("resize"),e(this).is(":visible")?(e(this).trigger("slideToggleOpenComplete"),e(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each((function(i,t){var r=e(t);r.is(":visible")&&r.trigger("sowsetupformfield")}))):e(this).trigger("slideToggleCloseComplete")})))})),a.find(".siteorigin-widget-field-remove").on("click keyup",(function(i,t){if(i.preventDefault(),"keyup"!=i.type||sowbForms.isEnter(i)){var a=e(this).closest(".siteorigin-widget-field-repeater-items"),s=e(this).closest(".siteorigin-widget-field-repeater-item"),o=function(){s.remove(),a.sortable("refresh").trigger("updateFieldPositions"),e(window).trigger("resize"),n.trigger("change")};t&&t.silent?o():confirm(soWidgets.sure)&&s.slideUp("fast",o),"string"==typeof r.closest(".siteorigin-widget-field-repeater").data("item-label").increment&&r.parent().find(".siteorigin-widget-field-repeater-item").trigger("change")}})),a.find(".siteorigin-widget-field-copy").on("click keyup",(function(i){if(i.preventDefault(),"keyup"!=i.type||sowbForms.isEnter(i)){var t=e(this).closest(".siteorigin-widget-form-main"),n=e(this).closest(".siteorigin-widget-field-repeater-item"),a=n.clone(),s=n.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each((function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var g=tinymce.get(s);if(g){var f=g.getContent();_.isEmpty(f)?-1!==f.search("<")&&-1===f.search(">")&&$textarea.val(f.replace(/</g,"")):i.val(f)}}else if(i.is(".wp-color-picker")){var p=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");p.remove(),c.append(i.remove())}else{var u=s?n.find("#"+s):n.find('[name="'+l+'"]');u.length&&null!=u.val()&&i.val(u.val())}if(s){var w,m;if(i.is('[type="radio"]')){w=s.replace(/-\d+-\d+$/,"");var v=s.replace(/-\d+$/,"");if(!d[w]){var h={};d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").filter((function(i,t){var r=e(t).attr("name");return!h[r]&&(h[r]=!0,!0)})).length+1}var b=w+"-"+d[w];m=b+s.match(/-\d+$/)[0],a.find("label[for="+v+"]").attr("for",b)}else F=new RegExp("-\\d+$"),w=s.replace(F,""),d[w]||(d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").length+1),m=w+"-"+d[w]++;if(i.is(".wp-editor-area")&&(m+=Math.floor(1e3*Math.random()),i.data("tinymce-id",m)),i.attr("id",m),i.is(".wp-editor-area")){var y=i.closest(".siteorigin-widget-tinymce-container"),k=y.data("media-buttons");if(k&&k.html){var F=new RegExp(s,"g");k.html=k.html.replace(F,m),y.data("media-buttons",k)}}a.find("label[for="+s+"]").attr("for",m),a.find("[id*="+s+"]").each((function(){var i=e(this).attr("id").replace(s,m);e(this).attr("id",i)})),"undefined"!=typeof tinymce&&tinymce.get(m)&&tinymce.get(m).remove()}var x=n.parents(".siteorigin-widget-field-repeater").length,C=e("body");(C.hasClass("wp-customizer")||C.hasClass("widgets-php"))&&0===r.closest(".panel-dialog").length&&(x+=1);var E=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(x-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",E),i.data("original-name",E)})),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",(function(){e(window).trigger("resize")})),"string"==typeof r.closest(".siteorigin-widget-field-repeater").data("item-label").increment?r.parent().find(".siteorigin-widget-field-repeater-item").trigger("change"):r.trigger("change")}})),r.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),r.data("sowrepeater-actions-setup",!0)}}))},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},(function(e){window.sowVars[t]=e,r(window.sowVars[t][i])})):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each((function(){var i=e(this);try{var r=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(r))return!0;var n=(r=r[1]).split("][");n=n.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),(function(i,t){return e(i).val()})))}else s=i.val();for(var g=0;g<n.length;g++)g===n.length-1?""===n[g]?a.push(s):a[n[g]]=s:(_.isUndefined(a[n[g]])&&(_.isNumber(n[g+1])||""===n[g+1]?a[n[g]]=[]:a[n[g]]={}),a=a[n[g]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}})),t},sowbForms.isEnter=function(i,t=!1){if(13==i.which){if(!t)return!0;e(i.target).trigger("click")}},sowbForms.setWidgetFormValues=function(i,t,r,n){r=r||!1,n=void 0!==n&&n||void 0===n;var a=0,s=function(i,t){10!=++a?(i.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each((function(i,n){var a=e(this),o=a.find("> .siteorigin-widget-field-repeater"),d=o.data("repeaterName"),l=t.hasOwnProperty(d)?t[d]:null;if(a.parent().is(".siteorigin-widget-section")){var g=o.data("element-name");g=g.replace(/\[#.*?#\]/g,"");for(var f=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(g)[1].split("]["),p=f.length?t:null;f.length;){var c=f.shift();p=p.hasOwnProperty(c)?p[c]:p}l=p}if(l&&Array.isArray(l)){var u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),w=l.length,m=u.length;if(w>m)for(var v=0;v<w-m;v++)o.find("> .siteorigin-widget-field-repeater-add").trigger("click");else if(!r&&w<m)for(var h=w;h<m;h++){e(u.eq(h)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var b=0;b<u.length;b++)u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),s(u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),l[b])}})),--a):--a};s(i,t),i.find("*[name]").each((function(){var i=e(this),a=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(null==a)return!0;var s=(a=a[1]).split("][");s=s.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));for(var o,d=t,l=0;l<s.length;l++){if(!d.hasOwnProperty(s[l])){if(r)return!0;break}l===s.length-1?o=d[s[l]]:d=d[s[l]]}if("checkbox"===i.attr("type"))i.prop("checked",o);else if("radio"===i.attr("type"))i.prop("checked",o===i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var g=null;"undefined"!=typeof tinyMCE&&(g=tinyMCE.get(i.attr("id"))),null!==g&&"function"==typeof g.setContent&&!g.isHidden()&&i.parent().is(":visible")?g.initialized?g.setContent(o):g.on("init",(function(){g.setContent(o)})):i.val(o)}else if(i.is(".panels-data")){i.val(o);var f=i.data("builder");f&&f.setDataField(i)}else i.val(o);n&&(i.trigger("change"),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})))}))},sowbForms.displayNotice=function(i,t,r,n,a){var s=e('<div class="siteorigin-widget-form-notification"></div>');t&&s.append("<span>"+t+"</span>"),n&&n.length&&n.forEach((function(i){var t="";i.classes&&i.classes.length&&(t=" "+i.classes.join(" "));var r=e('<a class="button button-small'+t+'" tabindex="0">'+i.label+"</a>");i.url&&r.attr("href",i.url),i.callback&&r.on("click keyup",(function(e){("keyup"!=e.type||sowbForms.isEnter(e))&&i.callback(s)})),s.append(r)})),r&&s.append("<div><small>"+r+"</small></div>"),a?a.before(s):i.prepend(s)},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",(function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout((function(){i.sowSetupForm()}),200)}));var i=e("body");e(document).on("widget-added",(function(e,i){console.log(i.find(".siteorigin-widget-form")),i.find(".siteorigin-widget-form").sowSetupForm()})),i.hasClass("block-editor-page")&&e(document).on("panels_setup_preview",(function(){window.hasOwnProperty("sowb")&&e(sowb).trigger("setup_widgets",{preview:!0})})),e(document).on("open_dialog",(function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),e((function(){e(document).trigger("sowadminloaded")}))}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return void 0!==t[3]?(n=t[1],r=t[3]):r=t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",(function(val,args,match){return eval(match)}))},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",(function(e,i,t){return-1!==t.split(",").map((function(e){return e.trim()})).indexOf(e)}))}};window.sowbForms=sowbForms;
|
1 |
+
var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each((function(i,t){var r,n=e(t),a=!0,s=e("body"),o=n.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(n.is(".siteorigin-widget-form-main")){if(!0===n.data("sow-form-setup"))return!0;if(s.hasClass("widgets-php")&&!s.hasClass("block-editor-page")&&!n.is(":visible")&&0===n.closest(".panel-dialog").length)return!0;n.on("sowstatechange",(function(i,t,r){n.find("[data-state-handler]").each((function(){var i,n,s,o,d,l,g=e(this),f=e.extend({},g.data("state-handler"),a?g.data("state-handler-initial"):{});if(0===Object.keys(f).length)return!0;var p={},c=sowbForms.getContainerFieldId(g,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==c){var u={};for(var w in f)u[w.replace("{$repeater}",c)]=f[w];f=u}var m=sowbForms.getContainerFieldId(g,"widget",".siteorigin-widget-widget");if(!1!==m){var v={};for(var h in f){var b=h.match(/_else\[(.*)\]|(.*)\[(.*)\]/);v[b&&b.length&&void 0===b[1]?b[2]+"_"+m+"["+b[3]+"]":"_else["+b[1]+"_"+m+"]"]=f[h]}f=v}for(var y in f)if(d=!1,null!==(i=y.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(n={group:"default",name:"",multi:!1},void 0!==i[2]?(n.group=i[1],n.name=i[3]):n.name=i[0],n.multi=void 0!==i[4],"_else"===n.group)n.group=n.name,n.name="",d=n.group===t&&void 0===p[n.group];else{l=n.name.split(",").map((function(e){return e.trim()}));for(var k=0;k<l.length&&!(d=n.group===t&&l[k]===r);k++);}if(d){s=f[y],n.multi||(s=[s]);for(k=0;k<s.length;k++){var F=!1;if((o=void 0!==s[k][1]&&Boolean(s[k][1])?g.find(s[k][1]):g).prop("style").length&&("show"==s[k][0]?(o.fadeIn("fast"),F=!0):"hide"==s[k][0]&&(o.fadeOut("fast"),F=!0)),F||o[s[k][0]].apply(o,void 0!==s[k][2]?s[k][2]:[]),o.is(".siteorigin-widget-field:visible"))if(o.is(".siteorigin-widget-field-type-section"))o.find("> .siteorigin-widget-section > .siteorigin-widget-field").trigger("sowsetupformfield");else o.trigger("sowsetupformfield")}p[n.group]=!0}}}))})),n.sowSetupPreview(),r=n;var d=n.find(".siteorigin-widget-teaser");if(d.find(".dashicons-dismiss").on("click",(function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",(function(){d.remove()}))})),!n.data("backupDisabled")){var l=n.find("> .siteorigin-widgets-form-id").val(),g=n.find("> .siteorigin-widgets-form-timestamp"),f=parseInt(g.val()||0),p=JSON.parse(sessionStorage.getItem(l));p&&(p._sow_form_timestamp>f?sowbForms.displayNotice(n,soWidgets.backup.newerVersion,soWidgets.backup.replaceWarning,[{label:soWidgets.backup.restore,callback:function(e){sowbForms.setWidgetFormValues(r,p),e.slideUp("fast",(function(){e.remove()}))}},{label:soWidgets.backup.dismiss,callback:function(e){e.slideUp("fast",(function(){sessionStorage.removeItem(l),e.remove()}))}}]):sessionStorage.removeItem(l)),n.on("change",(function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(n);sessionStorage.setItem(l,JSON.stringify(e))}))}}else r=n.closest(".siteorigin-widget-form-main");r.find("> .siteorigin-widgets-form-id").val();var c=n.find("> .siteorigin-widget-field");c.find("> .siteorigin-widget-section").sowSetupForm();var u=c.find("> .siteorigin-widget-widget");u.find("> .siteorigin-widget-section").sowSetupForm(),u.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),c.find(".siteorigin-widget-input").each((function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))})),c.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),n.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),c.find("> .siteorigin-widget-input-color").each((function(){var i=e(this),t={change:function(i,t){setTimeout((function(){e(i.target).trigger("change")}),100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)}));var w=function(i){("keyup"!=i.type||sowbForms.isEnter(i))&&(e(this).toggleClass("siteorigin-widget-section-visible"),e(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",(function(){(e(window).trigger("resize"),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible"))&&e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})))};c.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").on("click keyup",w).attr("tabinex",0),c.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").on("click keyup",w),c.filter(".siteorigin-widget-field-type-slider").each((function(){var i=e(this),t=i.find('input[type="number"]'),r=i.find(".siteorigin-widget-value-slider");r.slider({max:parseFloat(t.attr("max")),min:parseFloat(t.attr("min")),step:parseFloat(t.attr("step")),value:parseFloat(t.val()),slide:function(e,r){t.val(parseFloat(r.value)),t.trigger("change"),i.find(".siteorigin-widget-slider-value").html(r.value)}}),t.on("change",(function(e,n){n&&n.silent||(r.slider("value",parseFloat(t.val())),i.find(".siteorigin-widget-slider-value").html(t.val()))}))})),c.filter(".siteorigin-widget-field-type-link").each((function(){var i=e(this),t=function(){var t=i.find(".content-text-search"),r={action:"so_widgets_search_posts",query:t.val(),postTypes:t.data("postTypes")};"string"==typeof icl_this_lang&&(r.language=icl_this_lang);var n=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,r,(function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label=" "),n.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]).attr("tabindex",0));n.removeClass("loading")}))};i.find(".select-content-button, .button-close").on("click",(function(r){r.preventDefault(),e(this).trigger("blur");var n=i.find(".existing-content-selector");n.toggle(),n.is(":visible")&&0===n.find("ul.posts li").length&&t()})),i.on("click keyup",".posts li",(function(t){if(t.preventDefault(),"keyup"!=t.type||sowbForms.isEnter(t)){var r=e(this);i.find("input.siteorigin-widget-input").val("post: "+r.data("value")),i.trigger("change"),i.find(".existing-content-selector").toggle()}}));var r=null;i.find(".content-text-search").on("keyup",(function(){null!==r&&clearTimeout(r),r=setTimeout((function(){t()}),500)}))})),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&c.filter(".siteorigin-widget-field-type-builder").each((function(){e(this).find("> .siteorigin-page-builder-field").each((function(){var i=e(this);i.soPanelsSetupBuilderWidget({builderType:i.data("type")})}))}));var m=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if(void 0!==t){var n=function(t,r){if(void 0===sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return r;if(i.is('[type="radio"]')&&!i.is(":checked"))return r;var n=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");!1!==n&&(t.args=t.args.map((function(e){return e.replace("{$repeater}",n)})));var a=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");!1===a||t.hasOwnProperty("widgetFieldId")||(t.widgetFieldId=a,t.args=t.args.map((function(e){return e="conditional"===t.callback?e.replace(/(.*)(\[.*)/,"$1_"+a+"$2"):e+"_"+a})));var s=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return i.parent().hasClass("siteorigin-widget-field-type-media")&&"conditional"==t.callback&&(s||(s=i.hasClass("media-fallback-external")?i.prev().val():fallbackField=i.next().val()),0==s&&(s="")),e.extend(r,sowEmitters[t.callback](s,t.args))},a={default:""};void 0===t.length&&(t=[t]);for(var s=0;s<t.length;s++)a=n(t[s],a);var o=r.data("states");for(var d in void 0===o&&(o={default:""}),a)void 0!==o[d]&&a[d]===o[d]||(o[d]=a[d],r.trigger("sowstatechange",[d,a[d]]));r.data("states",o)}};c.filter("[data-state-emitter]").each((function(){var i=e(this).find(".siteorigin-widget-input");i.on("keyup change",m),i.each((function(){var i=e(this);i.is(":radio")?i.is(":checked")&&m.call(i[0]):m.call(i[0])}))})),n.trigger("sowsetupform",c).data("sow-form-setup",!0),c.trigger("sowsetupformfield"),n.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(s.hasClass("wp-customizer")||s.hasClass("widgets-php"))&&n.closest(".ui-sortable").on("sortstop",(function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),a=!1}))},e.fn.sowSetupPreview=function(){var i=e(this);i.siblings(".siteorigin-widget-preview").find("> a").on("click",(function(t){t.preventDefault();var r=sowbForms.getWidgetFormValues(i),n=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");n.find('input[name="data"]').val(JSON.stringify(r)),n.find('input[name="class"]').val(i.data("class")),n.find("iframe").on("load",(function(){e(this).css("visibility","visible")})),n.find("form").trigger("submit"),n.find(".close").on("click keyup",(function(e){("keyup"!=e.type||sowbForms.isEnter(e))&&n.remove()}))}))},e.fn.sowSetupRepeater=function(){return e(this).each((function(i,t){var r=e(t),n=r.find(".siteorigin-widget-field-repeater-items"),a=r.data("repeater-name");n.on("updateFieldPositions",(function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each((function(i,t){e(t).find(".siteorigin-widget-input").each((function(t,r){var n=e(r).data("repeater-positions");void 0===n&&(n={}),n[a]=i,e(r).data("repeater-positions",n)}))})),i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t),n=r.data("repeater-positions");if(void 0!==n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}})),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each((function(i,t){var r=e(t);r.prop("checked",r.prop("defaultChecked"))})),i.data("initialSetup",!0));var n=r.data("scroll-count")?parseInt(r.data("scroll-count")):0;if(n>0&&t.length>n){var s=t.first().outerHeight();i.css("max-height",s*n+"px"),i.css("overflow","auto")}else i.css("max-height","").css("overflow","")})),n.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){n.find('input[type="radio"].siteorigin-widget-input').attr("name",""),n.trigger("updateFieldPositions"),r.trigger("change")},sortstop:function(i,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each((function(){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})):t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");r.trigger("change")}}),n.trigger("updateFieldPositions"),r.find("> .siteorigin-widget-field-repeater-add").disableSelection().on("click keyup",(function(i){i.preventDefault(),("keyup"!=i.type||sowbForms.isEnter(i))&&r.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",(function(){e(window).trigger("resize")}))})),r.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").on("click",(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",(function(){e(window).trigger("resize")}))}))}))},e.fn.sowAddRepeaterItem=function(){return e(this).each((function(i,t){var r=e(t),n=r.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+r.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each((function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))}));var s="";a.find("> .siteorigin-widget-field").each((function(i,t){var r=t.outerHTML;e(t).is(".siteorigin-widget-field-type-repeater")||(r=r.replace(/_id_/g,n)),s+=r}));var o=void 0!==r.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable"></div>').append(e('<div class="siteorigin-widget-field-repeater-item-top" tabindex="0" />').append(e('<div class="siteorigin-widget-field-expand" tabindex="0" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" tabindex="0" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" tabindex="0" />')).append(e("<h4></h4>").html(r.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form"></div>').html(s));r.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",(function(){e(window).trigger("resize")})),r.trigger("change")}))},e.fn.sowRemoveRepeaterItem=function(){return e(this).each((function(i,t){var r=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(t).trigger("change")}))},e.fn.sowSetupRepeaterItems=function(){return e(this).each((function(i,t){var r=e(t);if(void 0===r.data("sowrepeater-actions-setup")){var n=r.closest(".siteorigin-widget-field-repeater"),a=r.find("> .siteorigin-widget-field-repeater-item-top"),s=n.data("item-label"),o=r.parents(".siteorigin-widget-field-repeater").data("item-name");if(s&&(s.hasOwnProperty("selector")||s.hasOwnProperty("selectorArray"))){var d=function(){var e,i,t;if(s.hasOwnProperty("selectorArray"))for(var n=0;n<s.selectorArray.length&&(e=(t=s.selectorArray[n]).hasOwnProperty("valueMethod")&&t.valueMethod?t.valueMethod:"val",!(i=r.find(t.selector)[e]()));n++);else e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=r.find(s.selector)[e]();if(i)i.length>80&&(i=i.substr(0,79)+"...");else if(i=o,s.increment){var d=r.index();d++,isNaN(d)||("before"==s.increment?i=d+" "+i:i+=" "+d)}a.find("h4").text(i)};d();var l=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";r.on(l,d)}a.on("click keyup",(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&("keyup"!=i.type||sowbForms.isEnter(i))&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",(function(){e(window).trigger("resize"),e(this).is(":visible")?(e(this).trigger("slideToggleOpenComplete"),e(this).find(".siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field,> .siteorigin-widget-field").each((function(i,t){var r=e(t);r.is(":visible")&&r.trigger("sowsetupformfield")}))):e(this).trigger("slideToggleCloseComplete")})))})),a.find(".siteorigin-widget-field-remove").on("click keyup",(function(i,t){if(i.preventDefault(),"keyup"!=i.type||sowbForms.isEnter(i)){var a=e(this).closest(".siteorigin-widget-field-repeater-items"),s=e(this).closest(".siteorigin-widget-field-repeater-item"),o=function(){s.remove(),a.sortable("refresh").trigger("updateFieldPositions"),e(window).trigger("resize"),n.trigger("change")};t&&t.silent?o():confirm(soWidgets.sure)&&s.slideUp("fast",o),"string"==typeof r.closest(".siteorigin-widget-field-repeater").data("item-label").increment&&r.parent().find(".siteorigin-widget-field-repeater-item").trigger("change")}})),a.find(".siteorigin-widget-field-copy").on("click keyup",(function(i){if(i.preventDefault(),"keyup"!=i.type||sowbForms.isEnter(i)){var t=e(this).closest(".siteorigin-widget-form-main"),n=e(this).closest(".siteorigin-widget-field-repeater-item"),a=n.clone(),s=n.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each((function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var g=tinymce.get(s);if(g){var f=g.getContent();_.isEmpty(f)?-1!==f.search("<")&&-1===f.search(">")&&$textarea.val(f.replace(/</g,"")):i.val(f)}}else if(i.is(".wp-color-picker")){var p=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");p.remove(),c.append(i.remove())}else{var u=s?n.find("#"+s):n.find('[name="'+l+'"]');u.length&&null!=u.val()&&i.val(u.val())}if(s){var w,m;if(i.is('[type="radio"]')){w=s.replace(/-\d+-\d+$/,"");var v=s.replace(/-\d+$/,"");if(!d[w]){var h={};d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").filter((function(i,t){var r=e(t).attr("name");return!h[r]&&(h[r]=!0,!0)})).length+1}var b=w+"-"+d[w];m=b+s.match(/-\d+$/)[0],a.find("label[for="+v+"]").attr("for",b)}else F=new RegExp("-\\d+$"),w=s.replace(F,""),d[w]||(d[w]=t.find(".siteorigin-widget-input[id^="+w+"]").not("[id*=_id_]").length+1),m=w+"-"+d[w]++;if(i.is(".wp-editor-area")&&(m+=Math.floor(1e3*Math.random()),i.data("tinymce-id",m)),i.attr("id",m),i.is(".wp-editor-area")){var y=i.closest(".siteorigin-widget-tinymce-container"),k=y.data("media-buttons");if(k&&k.html){var F=new RegExp(s,"g");k.html=k.html.replace(F,m),y.data("media-buttons",k)}}a.find("label[for="+s+"]").attr("for",m),a.find("[id*="+s+"]").each((function(){var i=e(this).attr("id").replace(s,m);e(this).attr("id",i)})),"undefined"!=typeof tinymce&&tinymce.get(m)&&tinymce.get(m).remove()}var C=n.parents(".siteorigin-widget-field-repeater").length,x=e("body");(x.hasClass("wp-customizer")||x.hasClass("widgets-php"))&&0===r.closest(".panel-dialog").length&&(C+=1);var E=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(C-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",E),i.data("original-name",E)})),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",(function(){e(window).trigger("resize")})),"string"==typeof r.closest(".siteorigin-widget-field-repeater").data("item-label").increment?r.parent().find(".siteorigin-widget-field-repeater-item").trigger("change"):r.trigger("change")}})),r.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),r.data("sowrepeater-actions-setup",!0)}}))},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},(function(e){window.sowVars[t]=e,r(window.sowVars[t][i])})):r(window.sowVars[t][i])},sowbForms.getWidgetIdBase=function(e){return e.data("id-base")},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each((function(){var i=e(this);try{var r=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(r))return!0;var n=(r=r[1]).split("][");n=n.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e}));var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),(function(i,t){return e(i).val()})))}else s=i.val();for(var g=0;g<n.length;g++)g===n.length-1?""===n[g]?a.push(s):a[n[g]]=s:(_.isUndefined(a[n[g]])&&(_.isNumber(n[g+1])||""===n[g+1]?a[n[g]]=[]:a[n[g]]={}),a=a[n[g]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}})),t},sowbForms.isEnter=function(i,t=!1){if(13==i.which){if(!t)return!0;e(i.target).trigger("click")}},sowbForms.setWidgetFormValues=function(i,t,r,n){r=r||!1,n=void 0!==n&&n||void 0===n;var a=0,s=function(i,t){10!=++a?(i.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each((function(i,n){var a=e(this),o=a.find("> .siteorigin-widget-field-repeater"),d=o.data("repeaterName"),l=t.hasOwnProperty(d)?t[d]:null;if(a.parent().is(".siteorigin-widget-section")){var g=o.data("element-name");g=g.replace(/\[#.*?#\]/g,"");for(var f=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(g)[1].split("]["),p=f.length?t:null;f.length;){var c=f.shift();p=p.hasOwnProperty(c)?p[c]:p}l=p}if(l&&Array.isArray(l)){var u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),w=l.length,m=u.length;if(w>m)for(var v=0;v<w-m;v++)o.find("> .siteorigin-widget-field-repeater-add").trigger("click");else if(!r&&w<m)for(var h=w;h<m;h++){e(u.eq(h)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}u=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var b=0;b<u.length;b++)u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),s(u.eq(b).find("> .siteorigin-widget-field-repeater-item-form"),l[b])}})),--a):--a};s(i,t),$fields=i.find("*[name]");var o=function(e){return e.map((function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e})),e},d=function(e,i){for(var t,n=e,a=0;a<i.length;a++){if(!n.hasOwnProperty(i[a])){if(r)continue;break}a===i.length-1?t=n[i[a]]:n=n[i[a]]}return{sub:n,value:t}},l=function(e,i){if(i){if(e!==i)return!0}else if(e)return!0;return!1},g=function(i,a){for(;i<a.length;i++){if(0!=i&&i+1<a.length&&i%20==0)return void setTimeout(g,150,i+1,a);var s=e(a[i]),f=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(s.attr("name"));if(null==f)return!0;if(!(s.hasClass("sow-measurement-select-unit")||s.attr("data-presets")||s.parent().hasClass("siteorigin-widget-field-type-posts")||"hidden"==s.attr("type"))){var p=(f=f[1]).split("][");p=o(p);var c=d(t,p);if((!r||""!=c.value)&&void 0!==c.value){var u=!1;if("checkbox"===s.attr("type")&&s.is(":checked")!=c.value)s.prop("checked",c.value),u=!0;else if("radio"===s.attr("type"))s.prop("checked",c.value===s.val()),u=!0;else if("TEXTAREA"===s.prop("tagName")&&s.hasClass("wp-editor-area")){var w=null;"undefined"!=typeof tinyMCE&&(w=tinyMCE.get(s.attr("id"))),null!==w&&"function"==typeof w.setContent&&!w.isHidden()&&s.parent().is(":visible")?l(w.getContent(),c.value)&&(w.initialized?(w.setContent(c.value),u=!0):(w.on("init",(function(){w.setContent(c.value)})),u=!0)):l(s.val(),c.value)&&(s.val(c.value),u=!0)}else if(s.is(".panels-data")){if(l(s.val(),c.value)){s.val(c.value);var m=s.data("builder");m&&(m.setDataField(s),u=!0)}}else l(s.val(),c.value)&&(s.val(c.value),u=!0);if(n&&u){if("preset"==n&&!s.hasClass("siteorigin-widget-input-color")&&!s.hasClass("siteorigin-widget-input-slider")&&"checkbox"==!s.attr("type"))continue;s.trigger("change"),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}}}}};g(0,$fields)},sowbForms.displayNotice=function(i,t,r,n,a){var s=e('<div class="siteorigin-widget-form-notification"></div>');t&&s.append("<span>"+t+"</span>"),n&&n.length&&n.forEach((function(i){var t="";i.classes&&i.classes.length&&(t=" "+i.classes.join(" "));var r=e('<a class="button button-small'+t+'" tabindex="0">'+i.label+"</a>");i.url&&r.attr("href",i.url),i.callback&&r.on("click keyup",(function(e){("keyup"!=e.type||sowbForms.isEnter(e))&&i.callback(s)})),s.append(r)})),r&&s.append("<div><small>"+r+"</small></div>"),a?a.before(s):i.prepend(s)},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",(function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout((function(){i.sowSetupForm()}),200)}));var i=e("body");e(document).on("widget-added",(function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()})),i.hasClass("block-editor-page")&&e(document).on("panels_setup_preview",(function(){window.hasOwnProperty("sowb")&&e(sowb).trigger("setup_widgets",{preview:!0})})),e(document).on("open_dialog",(function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")})),e((function(){e(document).trigger("sowadminloaded")}))}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return void 0!==t[3]?(n=t[1],r=t[3]):r=t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",(function(val,args,match){return eval(match)}))},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",(function(e,i,t){return-1!==t.split(",").map((function(e){return e.trim()})).indexOf(e)}))}};window.sowbForms=sowbForms;
|
js/lib/isotope.pkgd.js
ADDED
@@ -0,0 +1,3557 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Isotope PACKAGED v3.0.4
|
3 |
+
*
|
4 |
+
* Licensed GPLv3 for open source use
|
5 |
+
* or Isotope Commercial License for commercial use
|
6 |
+
*
|
7 |
+
* http://isotope.metafizzy.co
|
8 |
+
* Copyright 2017 Metafizzy
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Bridget makes jQuery widgets
|
13 |
+
* v2.0.1
|
14 |
+
* MIT license
|
15 |
+
*/
|
16 |
+
|
17 |
+
/* jshint browser: true, strict: true, undef: true, unused: true */
|
18 |
+
|
19 |
+
( function( window, factory ) {
|
20 |
+
// universal module definition
|
21 |
+
/*jshint strict: false */ /* globals define, module, require */
|
22 |
+
if ( typeof define == 'function' && define.amd ) {
|
23 |
+
// AMD
|
24 |
+
define( 'jquery-bridget/jquery-bridget',[ 'jquery' ], function( jQuery ) {
|
25 |
+
return factory( window, jQuery );
|
26 |
+
});
|
27 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
28 |
+
// CommonJS
|
29 |
+
module.exports = factory(
|
30 |
+
window,
|
31 |
+
require('jquery')
|
32 |
+
);
|
33 |
+
} else {
|
34 |
+
// browser global
|
35 |
+
window.jQueryBridget = factory(
|
36 |
+
window,
|
37 |
+
window.jQuery
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
}( window, function factory( window, jQuery ) {
|
42 |
+
'use strict';
|
43 |
+
|
44 |
+
// ----- utils ----- //
|
45 |
+
|
46 |
+
var arraySlice = Array.prototype.slice;
|
47 |
+
|
48 |
+
// helper function for logging errors
|
49 |
+
// $.error breaks jQuery chaining
|
50 |
+
var console = window.console;
|
51 |
+
var logError = typeof console == 'undefined' ? function() {} :
|
52 |
+
function( message ) {
|
53 |
+
console.error( message );
|
54 |
+
};
|
55 |
+
|
56 |
+
// ----- jQueryBridget ----- //
|
57 |
+
|
58 |
+
function jQueryBridget( namespace, PluginClass, $ ) {
|
59 |
+
$ = $ || jQuery || window.jQuery;
|
60 |
+
if ( !$ ) {
|
61 |
+
return;
|
62 |
+
}
|
63 |
+
|
64 |
+
// add option method -> $().plugin('option', {...})
|
65 |
+
if ( !PluginClass.prototype.option ) {
|
66 |
+
// option setter
|
67 |
+
PluginClass.prototype.option = function( opts ) {
|
68 |
+
// bail out if not an object
|
69 |
+
if ( !$.isPlainObject( opts ) ){
|
70 |
+
return;
|
71 |
+
}
|
72 |
+
this.options = $.extend( true, this.options, opts );
|
73 |
+
};
|
74 |
+
}
|
75 |
+
|
76 |
+
// make jQuery plugin
|
77 |
+
$.fn[ namespace ] = function( arg0 /*, arg1 */ ) {
|
78 |
+
if ( typeof arg0 == 'string' ) {
|
79 |
+
// method call $().plugin( 'methodName', { options } )
|
80 |
+
// shift arguments by 1
|
81 |
+
var args = arraySlice.call( arguments, 1 );
|
82 |
+
return methodCall( this, arg0, args );
|
83 |
+
}
|
84 |
+
// just $().plugin({ options })
|
85 |
+
plainCall( this, arg0 );
|
86 |
+
return this;
|
87 |
+
};
|
88 |
+
|
89 |
+
// $().plugin('methodName')
|
90 |
+
function methodCall( $elems, methodName, args ) {
|
91 |
+
var returnValue;
|
92 |
+
var pluginMethodStr = '$().' + namespace + '("' + methodName + '")';
|
93 |
+
|
94 |
+
$elems.each( function( i, elem ) {
|
95 |
+
// get instance
|
96 |
+
var instance = $.data( elem, namespace );
|
97 |
+
if ( !instance ) {
|
98 |
+
logError( namespace + ' not initialized. Cannot call methods, i.e. ' +
|
99 |
+
pluginMethodStr );
|
100 |
+
return;
|
101 |
+
}
|
102 |
+
|
103 |
+
var method = instance[ methodName ];
|
104 |
+
if ( !method || methodName.charAt(0) == '_' ) {
|
105 |
+
logError( pluginMethodStr + ' is not a valid method' );
|
106 |
+
return;
|
107 |
+
}
|
108 |
+
|
109 |
+
// apply method, get return value
|
110 |
+
var value = method.apply( instance, args );
|
111 |
+
// set return value if value is returned, use only first value
|
112 |
+
returnValue = returnValue === undefined ? value : returnValue;
|
113 |
+
});
|
114 |
+
|
115 |
+
return returnValue !== undefined ? returnValue : $elems;
|
116 |
+
}
|
117 |
+
|
118 |
+
function plainCall( $elems, options ) {
|
119 |
+
$elems.each( function( i, elem ) {
|
120 |
+
var instance = $.data( elem, namespace );
|
121 |
+
if ( instance ) {
|
122 |
+
// set options & init
|
123 |
+
instance.option( options );
|
124 |
+
instance._init();
|
125 |
+
} else {
|
126 |
+
// initialize new instance
|
127 |
+
instance = new PluginClass( elem, options );
|
128 |
+
$.data( elem, namespace, instance );
|
129 |
+
}
|
130 |
+
});
|
131 |
+
}
|
132 |
+
|
133 |
+
updateJQuery( $ );
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
+
// ----- updateJQuery ----- //
|
138 |
+
|
139 |
+
// set $.bridget for v1 backwards compatibility
|
140 |
+
function updateJQuery( $ ) {
|
141 |
+
if ( !$ || ( $ && $.bridget ) ) {
|
142 |
+
return;
|
143 |
+
}
|
144 |
+
$.bridget = jQueryBridget;
|
145 |
+
}
|
146 |
+
|
147 |
+
updateJQuery( jQuery || window.jQuery );
|
148 |
+
|
149 |
+
// ----- ----- //
|
150 |
+
|
151 |
+
return jQueryBridget;
|
152 |
+
|
153 |
+
}));
|
154 |
+
|
155 |
+
/**
|
156 |
+
* EvEmitter v1.0.3
|
157 |
+
* Lil' event emitter
|
158 |
+
* MIT License
|
159 |
+
*/
|
160 |
+
|
161 |
+
/* jshint unused: true, undef: true, strict: true */
|
162 |
+
|
163 |
+
( function( global, factory ) {
|
164 |
+
// universal module definition
|
165 |
+
/* jshint strict: false */ /* globals define, module, window */
|
166 |
+
if ( typeof define == 'function' && define.amd ) {
|
167 |
+
// AMD - RequireJS
|
168 |
+
define( 'ev-emitter/ev-emitter',factory );
|
169 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
170 |
+
// CommonJS - Browserify, Webpack
|
171 |
+
module.exports = factory();
|
172 |
+
} else {
|
173 |
+
// Browser globals
|
174 |
+
global.EvEmitter = factory();
|
175 |
+
}
|
176 |
+
|
177 |
+
}( typeof window != 'undefined' ? window : this, function() {
|
178 |
+
|
179 |
+
|
180 |
+
|
181 |
+
function EvEmitter() {}
|
182 |
+
|
183 |
+
var proto = EvEmitter.prototype;
|
184 |
+
|
185 |
+
proto.on = function( eventName, listener ) {
|
186 |
+
if ( !eventName || !listener ) {
|
187 |
+
return;
|
188 |
+
}
|
189 |
+
// set events hash
|
190 |
+
var events = this._events = this._events || {};
|
191 |
+
// set listeners array
|
192 |
+
var listeners = events[ eventName ] = events[ eventName ] || [];
|
193 |
+
// only add once
|
194 |
+
if ( listeners.indexOf( listener ) == -1 ) {
|
195 |
+
listeners.push( listener );
|
196 |
+
}
|
197 |
+
|
198 |
+
return this;
|
199 |
+
};
|
200 |
+
|
201 |
+
proto.once = function( eventName, listener ) {
|
202 |
+
if ( !eventName || !listener ) {
|
203 |
+
return;
|
204 |
+
}
|
205 |
+
// add event
|
206 |
+
this.on( eventName, listener );
|
207 |
+
// set once flag
|
208 |
+
// set onceEvents hash
|
209 |
+
var onceEvents = this._onceEvents = this._onceEvents || {};
|
210 |
+
// set onceListeners object
|
211 |
+
var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
|
212 |
+
// set flag
|
213 |
+
onceListeners[ listener ] = true;
|
214 |
+
|
215 |
+
return this;
|
216 |
+
};
|
217 |
+
|
218 |
+
proto.off = function( eventName, listener ) {
|
219 |
+
var listeners = this._events && this._events[ eventName ];
|
220 |
+
if ( !listeners || !listeners.length ) {
|
221 |
+
return;
|
222 |
+
}
|
223 |
+
var index = listeners.indexOf( listener );
|
224 |
+
if ( index != -1 ) {
|
225 |
+
listeners.splice( index, 1 );
|
226 |
+
}
|
227 |
+
|
228 |
+
return this;
|
229 |
+
};
|
230 |
+
|
231 |
+
proto.emitEvent = function( eventName, args ) {
|
232 |
+
var listeners = this._events && this._events[ eventName ];
|
233 |
+
if ( !listeners || !listeners.length ) {
|
234 |
+
return;
|
235 |
+
}
|
236 |
+
var i = 0;
|
237 |
+
var listener = listeners[i];
|
238 |
+
args = args || [];
|
239 |
+
// once stuff
|
240 |
+
var onceListeners = this._onceEvents && this._onceEvents[ eventName ];
|
241 |
+
|
242 |
+
while ( listener ) {
|
243 |
+
var isOnce = onceListeners && onceListeners[ listener ];
|
244 |
+
if ( isOnce ) {
|
245 |
+
// remove listener
|
246 |
+
// remove before trigger to prevent recursion
|
247 |
+
this.off( eventName, listener );
|
248 |
+
// unset once flag
|
249 |
+
delete onceListeners[ listener ];
|
250 |
+
}
|
251 |
+
// trigger listener
|
252 |
+
listener.apply( this, args );
|
253 |
+
// get next listener
|
254 |
+
i += isOnce ? 0 : 1;
|
255 |
+
listener = listeners[i];
|
256 |
+
}
|
257 |
+
|
258 |
+
return this;
|
259 |
+
};
|
260 |
+
|
261 |
+
return EvEmitter;
|
262 |
+
|
263 |
+
}));
|
264 |
+
|
265 |
+
/*!
|
266 |
+
* getSize v2.0.2
|
267 |
+
* measure size of elements
|
268 |
+
* MIT license
|
269 |
+
*/
|
270 |
+
|
271 |
+
/*jshint browser: true, strict: true, undef: true, unused: true */
|
272 |
+
/*global define: false, module: false, console: false */
|
273 |
+
|
274 |
+
( function( window, factory ) {
|
275 |
+
'use strict';
|
276 |
+
|
277 |
+
if ( typeof define == 'function' && define.amd ) {
|
278 |
+
// AMD
|
279 |
+
define( 'get-size/get-size',[],function() {
|
280 |
+
return factory();
|
281 |
+
});
|
282 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
283 |
+
// CommonJS
|
284 |
+
module.exports = factory();
|
285 |
+
} else {
|
286 |
+
// browser global
|
287 |
+
window.getSize = factory();
|
288 |
+
}
|
289 |
+
|
290 |
+
})( window, function factory() {
|
291 |
+
'use strict';
|
292 |
+
|
293 |
+
// -------------------------- helpers -------------------------- //
|
294 |
+
|
295 |
+
// get a number from a string, not a percentage
|
296 |
+
function getStyleSize( value ) {
|
297 |
+
var num = parseFloat( value );
|
298 |
+
// not a percent like '100%', and a number
|
299 |
+
var isValid = value.indexOf('%') == -1 && !isNaN( num );
|
300 |
+
return isValid && num;
|
301 |
+
}
|
302 |
+
|
303 |
+
function noop() {}
|
304 |
+
|
305 |
+
var logError = typeof console == 'undefined' ? noop :
|
306 |
+
function( message ) {
|
307 |
+
console.error( message );
|
308 |
+
};
|
309 |
+
|
310 |
+
// -------------------------- measurements -------------------------- //
|
311 |
+
|
312 |
+
var measurements = [
|
313 |
+
'paddingLeft',
|
314 |
+
'paddingRight',
|
315 |
+
'paddingTop',
|
316 |
+
'paddingBottom',
|
317 |
+
'marginLeft',
|
318 |
+
'marginRight',
|
319 |
+
'marginTop',
|
320 |
+
'marginBottom',
|
321 |
+
'borderLeftWidth',
|
322 |
+
'borderRightWidth',
|
323 |
+
'borderTopWidth',
|
324 |
+
'borderBottomWidth'
|
325 |
+
];
|
326 |
+
|
327 |
+
var measurementsLength = measurements.length;
|
328 |
+
|
329 |
+
function getZeroSize() {
|
330 |
+
var size = {
|
331 |
+
width: 0,
|
332 |
+
height: 0,
|
333 |
+
innerWidth: 0,
|
334 |
+
innerHeight: 0,
|
335 |
+
outerWidth: 0,
|
336 |
+
outerHeight: 0
|
337 |
+
};
|
338 |
+
for ( var i=0; i < measurementsLength; i++ ) {
|
339 |
+
var measurement = measurements[i];
|
340 |
+
size[ measurement ] = 0;
|
341 |
+
}
|
342 |
+
return size;
|
343 |
+
}
|
344 |
+
|
345 |
+
// -------------------------- getStyle -------------------------- //
|
346 |
+
|
347 |
+
/**
|
348 |
+
* getStyle, get style of element, check for Firefox bug
|
349 |
+
* https://bugzilla.mozilla.org/show_bug.cgi?id=548397
|
350 |
+
*/
|
351 |
+
function getStyle( elem ) {
|
352 |
+
var style = getComputedStyle( elem );
|
353 |
+
if ( !style ) {
|
354 |
+
logError( 'Style returned ' + style +
|
355 |
+
'. Are you running this code in a hidden iframe on Firefox? ' +
|
356 |
+
'See http://bit.ly/getsizebug1' );
|
357 |
+
}
|
358 |
+
return style;
|
359 |
+
}
|
360 |
+
|
361 |
+
// -------------------------- setup -------------------------- //
|
362 |
+
|
363 |
+
var isSetup = false;
|
364 |
+
|
365 |
+
var isBoxSizeOuter;
|
366 |
+
|
367 |
+
/**
|
368 |
+
* setup
|
369 |
+
* check isBoxSizerOuter
|
370 |
+
* do on first getSize() rather than on page load for Firefox bug
|
371 |
+
*/
|
372 |
+
function setup() {
|
373 |
+
// setup once
|
374 |
+
if ( isSetup ) {
|
375 |
+
return;
|
376 |
+
}
|
377 |
+
isSetup = true;
|
378 |
+
|
379 |
+
// -------------------------- box sizing -------------------------- //
|
380 |
+
|
381 |
+
/**
|
382 |
+
* WebKit measures the outer-width on style.width on border-box elems
|
383 |
+
* IE & Firefox<29 measures the inner-width
|
384 |
+
*/
|
385 |
+
var div = document.createElement('div');
|
386 |
+
div.style.width = '200px';
|
387 |
+
div.style.padding = '1px 2px 3px 4px';
|
388 |
+
div.style.borderStyle = 'solid';
|
389 |
+
div.style.borderWidth = '1px 2px 3px 4px';
|
390 |
+
div.style.boxSizing = 'border-box';
|
391 |
+
|
392 |
+
var body = document.body || document.documentElement;
|
393 |
+
body.appendChild( div );
|
394 |
+
var style = getStyle( div );
|
395 |
+
|
396 |
+
getSize.isBoxSizeOuter = isBoxSizeOuter = getStyleSize( style.width ) == 200;
|
397 |
+
body.removeChild( div );
|
398 |
+
|
399 |
+
}
|
400 |
+
|
401 |
+
// -------------------------- getSize -------------------------- //
|
402 |
+
|
403 |
+
function getSize( elem ) {
|
404 |
+
setup();
|
405 |
+
|
406 |
+
// use querySeletor if elem is string
|
407 |
+
if ( typeof elem == 'string' ) {
|
408 |
+
elem = document.querySelector( elem );
|
409 |
+
}
|
410 |
+
|
411 |
+
// do not proceed on non-objects
|
412 |
+
if ( !elem || typeof elem != 'object' || !elem.nodeType ) {
|
413 |
+
return;
|
414 |
+
}
|
415 |
+
|
416 |
+
var style = getStyle( elem );
|
417 |
+
|
418 |
+
// if hidden, everything is 0
|
419 |
+
if ( style.display == 'none' ) {
|
420 |
+
return getZeroSize();
|
421 |
+
}
|
422 |
+
|
423 |
+
var size = {};
|
424 |
+
size.width = elem.offsetWidth;
|
425 |
+
size.height = elem.offsetHeight;
|
426 |
+
|
427 |
+
var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box';
|
428 |
+
|
429 |
+
// get all measurements
|
430 |
+
for ( var i=0; i < measurementsLength; i++ ) {
|
431 |
+
var measurement = measurements[i];
|
432 |
+
var value = style[ measurement ];
|
433 |
+
var num = parseFloat( value );
|
434 |
+
// any 'auto', 'medium' value will be 0
|
435 |
+
size[ measurement ] = !isNaN( num ) ? num : 0;
|
436 |
+
}
|
437 |
+
|
438 |
+
var paddingWidth = size.paddingLeft + size.paddingRight;
|
439 |
+
var paddingHeight = size.paddingTop + size.paddingBottom;
|
440 |
+
var marginWidth = size.marginLeft + size.marginRight;
|
441 |
+
var marginHeight = size.marginTop + size.marginBottom;
|
442 |
+
var borderWidth = size.borderLeftWidth + size.borderRightWidth;
|
443 |
+
var borderHeight = size.borderTopWidth + size.borderBottomWidth;
|
444 |
+
|
445 |
+
var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
|
446 |
+
|
447 |
+
// overwrite width and height if we can get it from style
|
448 |
+
var styleWidth = getStyleSize( style.width );
|
449 |
+
if ( styleWidth !== false ) {
|
450 |
+
size.width = styleWidth +
|
451 |
+
// add padding and border unless it's already including it
|
452 |
+
( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth );
|
453 |
+
}
|
454 |
+
|
455 |
+
var styleHeight = getStyleSize( style.height );
|
456 |
+
if ( styleHeight !== false ) {
|
457 |
+
size.height = styleHeight +
|
458 |
+
// add padding and border unless it's already including it
|
459 |
+
( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight );
|
460 |
+
}
|
461 |
+
|
462 |
+
size.innerWidth = size.width - ( paddingWidth + borderWidth );
|
463 |
+
size.innerHeight = size.height - ( paddingHeight + borderHeight );
|
464 |
+
|
465 |
+
size.outerWidth = size.width + marginWidth;
|
466 |
+
size.outerHeight = size.height + marginHeight;
|
467 |
+
|
468 |
+
return size;
|
469 |
+
}
|
470 |
+
|
471 |
+
return getSize;
|
472 |
+
|
473 |
+
});
|
474 |
+
|
475 |
+
/**
|
476 |
+
* matchesSelector v2.0.2
|
477 |
+
* matchesSelector( element, '.selector' )
|
478 |
+
* MIT license
|
479 |
+
*/
|
480 |
+
|
481 |
+
/*jshint browser: true, strict: true, undef: true, unused: true */
|
482 |
+
|
483 |
+
( function( window, factory ) {
|
484 |
+
/*global define: false, module: false */
|
485 |
+
'use strict';
|
486 |
+
// universal module definition
|
487 |
+
if ( typeof define == 'function' && define.amd ) {
|
488 |
+
// AMD
|
489 |
+
define( 'desandro-matches-selector/matches-selector',factory );
|
490 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
491 |
+
// CommonJS
|
492 |
+
module.exports = factory();
|
493 |
+
} else {
|
494 |
+
// browser global
|
495 |
+
window.matchesSelector = factory();
|
496 |
+
}
|
497 |
+
|
498 |
+
}( window, function factory() {
|
499 |
+
'use strict';
|
500 |
+
|
501 |
+
var matchesMethod = ( function() {
|
502 |
+
var ElemProto = window.Element.prototype;
|
503 |
+
// check for the standard method name first
|
504 |
+
if ( ElemProto.matches ) {
|
505 |
+
return 'matches';
|
506 |
+
}
|
507 |
+
// check un-prefixed
|
508 |
+
if ( ElemProto.matchesSelector ) {
|
509 |
+
return 'matchesSelector';
|
510 |
+
}
|
511 |
+
// check vendor prefixes
|
512 |
+
var prefixes = [ 'webkit', 'moz', 'ms', 'o' ];
|
513 |
+
|
514 |
+
for ( var i=0; i < prefixes.length; i++ ) {
|
515 |
+
var prefix = prefixes[i];
|
516 |
+
var method = prefix + 'MatchesSelector';
|
517 |
+
if ( ElemProto[ method ] ) {
|
518 |
+
return method;
|
519 |
+
}
|
520 |
+
}
|
521 |
+
})();
|
522 |
+
|
523 |
+
return function matchesSelector( elem, selector ) {
|
524 |
+
return elem[ matchesMethod ]( selector );
|
525 |
+
};
|
526 |
+
|
527 |
+
}));
|
528 |
+
|
529 |
+
/**
|
530 |
+
* Fizzy UI utils v2.0.5
|
531 |
+
* MIT license
|
532 |
+
*/
|
533 |
+
|
534 |
+
/*jshint browser: true, undef: true, unused: true, strict: true */
|
535 |
+
|
536 |
+
( function( window, factory ) {
|
537 |
+
// universal module definition
|
538 |
+
/*jshint strict: false */ /*globals define, module, require */
|
539 |
+
|
540 |
+
if ( typeof define == 'function' && define.amd ) {
|
541 |
+
// AMD
|
542 |
+
define( 'fizzy-ui-utils/utils',[
|
543 |
+
'desandro-matches-selector/matches-selector'
|
544 |
+
], function( matchesSelector ) {
|
545 |
+
return factory( window, matchesSelector );
|
546 |
+
});
|
547 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
548 |
+
// CommonJS
|
549 |
+
module.exports = factory(
|
550 |
+
window,
|
551 |
+
require('desandro-matches-selector')
|
552 |
+
);
|
553 |
+
} else {
|
554 |
+
// browser global
|
555 |
+
window.fizzyUIUtils = factory(
|
556 |
+
window,
|
557 |
+
window.matchesSelector
|
558 |
+
);
|
559 |
+
}
|
560 |
+
|
561 |
+
}( window, function factory( window, matchesSelector ) {
|
562 |
+
|
563 |
+
|
564 |
+
|
565 |
+
var utils = {};
|
566 |
+
|
567 |
+
// ----- extend ----- //
|
568 |
+
|
569 |
+
// extends objects
|
570 |
+
utils.extend = function( a, b ) {
|
571 |
+
for ( var prop in b ) {
|
572 |
+
a[ prop ] = b[ prop ];
|
573 |
+
}
|
574 |
+
return a;
|
575 |
+
};
|
576 |
+
|
577 |
+
// ----- modulo ----- //
|
578 |
+
|
579 |
+
utils.modulo = function( num, div ) {
|
580 |
+
return ( ( num % div ) + div ) % div;
|
581 |
+
};
|
582 |
+
|
583 |
+
// ----- makeArray ----- //
|
584 |
+
|
585 |
+
// turn element or nodeList into an array
|
586 |
+
utils.makeArray = function( obj ) {
|
587 |
+
var ary = [];
|
588 |
+
if ( Array.isArray( obj ) ) {
|
589 |
+
// use object if already an array
|
590 |
+
ary = obj;
|
591 |
+
} else if ( obj && typeof obj == 'object' &&
|
592 |
+
typeof obj.length == 'number' ) {
|
593 |
+
// convert nodeList to array
|
594 |
+
for ( var i=0; i < obj.length; i++ ) {
|
595 |
+
ary.push( obj[i] );
|
596 |
+
}
|
597 |
+
} else {
|
598 |
+
// array of single index
|
599 |
+
ary.push( obj );
|
600 |
+
}
|
601 |
+
return ary;
|
602 |
+
};
|
603 |
+
|
604 |
+
// ----- removeFrom ----- //
|
605 |
+
|
606 |
+
utils.removeFrom = function( ary, obj ) {
|
607 |
+
var index = ary.indexOf( obj );
|
608 |
+
if ( index != -1 ) {
|
609 |
+
ary.splice( index, 1 );
|
610 |
+
}
|
611 |
+
};
|
612 |
+
|
613 |
+
// ----- getParent ----- //
|
614 |
+
|
615 |
+
utils.getParent = function( elem, selector ) {
|
616 |
+
while ( elem.parentNode && elem != document.body ) {
|
617 |
+
elem = elem.parentNode;
|
618 |
+
if ( matchesSelector( elem, selector ) ) {
|
619 |
+
return elem;
|
620 |
+
}
|
621 |
+
}
|
622 |
+
};
|
623 |
+
|
624 |
+
// ----- getQueryElement ----- //
|
625 |
+
|
626 |
+
// use element as selector string
|
627 |
+
utils.getQueryElement = function( elem ) {
|
628 |
+
if ( typeof elem == 'string' ) {
|
629 |
+
return document.querySelector( elem );
|
630 |
+
}
|
631 |
+
return elem;
|
632 |
+
};
|
633 |
+
|
634 |
+
// ----- handleEvent ----- //
|
635 |
+
|
636 |
+
// enable .ontype to trigger from .addEventListener( elem, 'type' )
|
637 |
+
utils.handleEvent = function( event ) {
|
638 |
+
var method = 'on' + event.type;
|
639 |
+
if ( this[ method ] ) {
|
640 |
+
this[ method ]( event );
|
641 |
+
}
|
642 |
+
};
|
643 |
+
|
644 |
+
// ----- filterFindElements ----- //
|
645 |
+
|
646 |
+
utils.filterFindElements = function( elems, selector ) {
|
647 |
+
// make array of elems
|
648 |
+
elems = utils.makeArray( elems );
|
649 |
+
var ffElems = [];
|
650 |
+
|
651 |
+
elems.forEach( function( elem ) {
|
652 |
+
// check that elem is an actual element
|
653 |
+
if ( !( elem instanceof HTMLElement ) ) {
|
654 |
+
return;
|
655 |
+
}
|
656 |
+
// add elem if no selector
|
657 |
+
if ( !selector ) {
|
658 |
+
ffElems.push( elem );
|
659 |
+
return;
|
660 |
+
}
|
661 |
+
// filter & find items if we have a selector
|
662 |
+
// filter
|
663 |
+
if ( matchesSelector( elem, selector ) ) {
|
664 |
+
ffElems.push( elem );
|
665 |
+
}
|
666 |
+
// find children
|
667 |
+
var childElems = elem.querySelectorAll( selector );
|
668 |
+
// concat childElems to filterFound array
|
669 |
+
for ( var i=0; i < childElems.length; i++ ) {
|
670 |
+
ffElems.push( childElems[i] );
|
671 |
+
}
|
672 |
+
});
|
673 |
+
|
674 |
+
return ffElems;
|
675 |
+
};
|
676 |
+
|
677 |
+
// ----- debounceMethod ----- //
|
678 |
+
|
679 |
+
utils.debounceMethod = function( _class, methodName, threshold ) {
|
680 |
+
// original method
|
681 |
+
var method = _class.prototype[ methodName ];
|
682 |
+
var timeoutName = methodName + 'Timeout';
|
683 |
+
|
684 |
+
_class.prototype[ methodName ] = function() {
|
685 |
+
var timeout = this[ timeoutName ];
|
686 |
+
if ( timeout ) {
|
687 |
+
clearTimeout( timeout );
|
688 |
+
}
|
689 |
+
var args = arguments;
|
690 |
+
|
691 |
+
var _this = this;
|
692 |
+
this[ timeoutName ] = setTimeout( function() {
|
693 |
+
method.apply( _this, args );
|
694 |
+
delete _this[ timeoutName ];
|
695 |
+
}, threshold || 100 );
|
696 |
+
};
|
697 |
+
};
|
698 |
+
|
699 |
+
// ----- docReady ----- //
|
700 |
+
|
701 |
+
utils.docReady = function( callback ) {
|
702 |
+
var readyState = document.readyState;
|
703 |
+
if ( readyState == 'complete' || readyState == 'interactive' ) {
|
704 |
+
// do async to allow for other scripts to run. metafizzy/flickity#441
|
705 |
+
setTimeout( callback );
|
706 |
+
} else {
|
707 |
+
document.addEventListener( 'DOMContentLoaded', callback );
|
708 |
+
}
|
709 |
+
};
|
710 |
+
|
711 |
+
// ----- htmlInit ----- //
|
712 |
+
|
713 |
+
// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/
|
714 |
+
utils.toDashed = function( str ) {
|
715 |
+
return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) {
|
716 |
+
return $1 + '-' + $2;
|
717 |
+
}).toLowerCase();
|
718 |
+
};
|
719 |
+
|
720 |
+
var console = window.console;
|
721 |
+
/**
|
722 |
+
* allow user to initialize classes via [data-namespace] or .js-namespace class
|
723 |
+
* htmlInit( Widget, 'widgetName' )
|
724 |
+
* options are parsed from data-namespace-options
|
725 |
+
*/
|
726 |
+
utils.htmlInit = function( WidgetClass, namespace ) {
|
727 |
+
utils.docReady( function() {
|
728 |
+
var dashedNamespace = utils.toDashed( namespace );
|
729 |
+
var dataAttr = 'data-' + dashedNamespace;
|
730 |
+
var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' );
|
731 |
+
var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace );
|
732 |
+
var elems = utils.makeArray( dataAttrElems )
|
733 |
+
.concat( utils.makeArray( jsDashElems ) );
|
734 |
+
var dataOptionsAttr = dataAttr + '-options';
|
735 |
+
var jQuery = window.jQuery;
|
736 |
+
|
737 |
+
elems.forEach( function( elem ) {
|
738 |
+
var attr = elem.getAttribute( dataAttr ) ||
|
739 |
+
elem.getAttribute( dataOptionsAttr );
|
740 |
+
var options;
|
741 |
+
try {
|
742 |
+
options = attr && JSON.parse( attr );
|
743 |
+
} catch ( error ) {
|
744 |
+
// log error, do not initialize
|
745 |
+
if ( console ) {
|
746 |
+
console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className +
|
747 |
+
': ' + error );
|
748 |
+
}
|
749 |
+
return;
|
750 |
+
}
|
751 |
+
// initialize
|
752 |
+
var instance = new WidgetClass( elem, options );
|
753 |
+
// make available via $().data('namespace')
|
754 |
+
if ( jQuery ) {
|
755 |
+
jQuery.data( elem, namespace, instance );
|
756 |
+
}
|
757 |
+
});
|
758 |
+
|
759 |
+
});
|
760 |
+
};
|
761 |
+
|
762 |
+
// ----- ----- //
|
763 |
+
|
764 |
+
return utils;
|
765 |
+
|
766 |
+
}));
|
767 |
+
|
768 |
+
/**
|
769 |
+
* Outlayer Item
|
770 |
+
*/
|
771 |
+
|
772 |
+
( function( window, factory ) {
|
773 |
+
// universal module definition
|
774 |
+
/* jshint strict: false */ /* globals define, module, require */
|
775 |
+
if ( typeof define == 'function' && define.amd ) {
|
776 |
+
// AMD - RequireJS
|
777 |
+
define( 'outlayer/item',[
|
778 |
+
'ev-emitter/ev-emitter',
|
779 |
+
'get-size/get-size'
|
780 |
+
],
|
781 |
+
factory
|
782 |
+
);
|
783 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
784 |
+
// CommonJS - Browserify, Webpack
|
785 |
+
module.exports = factory(
|
786 |
+
require('ev-emitter'),
|
787 |
+
require('get-size')
|
788 |
+
);
|
789 |
+
} else {
|
790 |
+
// browser global
|
791 |
+
window.Outlayer = {};
|
792 |
+
window.Outlayer.Item = factory(
|
793 |
+
window.EvEmitter,
|
794 |
+
window.getSize
|
795 |
+
);
|
796 |
+
}
|
797 |
+
|
798 |
+
}( window, function factory( EvEmitter, getSize ) {
|
799 |
+
'use strict';
|
800 |
+
|
801 |
+
// ----- helpers ----- //
|
802 |
+
|
803 |
+
function isEmptyObj( obj ) {
|
804 |
+
for ( var prop in obj ) {
|
805 |
+
return false;
|
806 |
+
}
|
807 |
+
prop = null;
|
808 |
+
return true;
|
809 |
+
}
|
810 |
+
|
811 |
+
// -------------------------- CSS3 support -------------------------- //
|
812 |
+
|
813 |
+
|
814 |
+
var docElemStyle = document.documentElement.style;
|
815 |
+
|
816 |
+
var transitionProperty = typeof docElemStyle.transition == 'string' ?
|
817 |
+
'transition' : 'WebkitTransition';
|
818 |
+
var transformProperty = typeof docElemStyle.transform == 'string' ?
|
819 |
+
'transform' : 'WebkitTransform';
|
820 |
+
|
821 |
+
var transitionEndEvent = {
|
822 |
+
WebkitTransition: 'webkitTransitionEnd',
|
823 |
+
transition: 'transitionend'
|
824 |
+
}[ transitionProperty ];
|
825 |
+
|
826 |
+
// cache all vendor properties that could have vendor prefix
|
827 |
+
var vendorProperties = {
|
828 |
+
transform: transformProperty,
|
829 |
+
transition: transitionProperty,
|
830 |
+
transitionDuration: transitionProperty + 'Duration',
|
831 |
+
transitionProperty: transitionProperty + 'Property',
|
832 |
+
transitionDelay: transitionProperty + 'Delay'
|
833 |
+
};
|
834 |
+
|
835 |
+
// -------------------------- Item -------------------------- //
|
836 |
+
|
837 |
+
function Item( element, layout ) {
|
838 |
+
if ( !element ) {
|
839 |
+
return;
|
840 |
+
}
|
841 |
+
|
842 |
+
this.element = element;
|
843 |
+
// parent layout class, i.e. Masonry, Isotope, or Packery
|
844 |
+
this.layout = layout;
|
845 |
+
this.position = {
|
846 |
+
x: 0,
|
847 |
+
y: 0
|
848 |
+
};
|
849 |
+
|
850 |
+
this._create();
|
851 |
+
}
|
852 |
+
|
853 |
+
// inherit EvEmitter
|
854 |
+
var proto = Item.prototype = Object.create( EvEmitter.prototype );
|
855 |
+
proto.constructor = Item;
|
856 |
+
|
857 |
+
proto._create = function() {
|
858 |
+
// transition objects
|
859 |
+
this._transn = {
|
860 |
+
ingProperties: {},
|
861 |
+
clean: {},
|
862 |
+
onEnd: {}
|
863 |
+
};
|
864 |
+
|
865 |
+
this.css({
|
866 |
+
position: 'absolute'
|
867 |
+
});
|
868 |
+
};
|
869 |
+
|
870 |
+
// trigger specified handler for event type
|
871 |
+
proto.handleEvent = function( event ) {
|
872 |
+
var method = 'on' + event.type;
|
873 |
+
if ( this[ method ] ) {
|
874 |
+
this[ method ]( event );
|
875 |
+
}
|
876 |
+
};
|
877 |
+
|
878 |
+
proto.getSize = function() {
|
879 |
+
this.size = getSize( this.element );
|
880 |
+
};
|
881 |
+
|
882 |
+
/**
|
883 |
+
* apply CSS styles to element
|
884 |
+
* @param {Object} style
|
885 |
+
*/
|
886 |
+
proto.css = function( style ) {
|
887 |
+
var elemStyle = this.element.style;
|
888 |
+
|
889 |
+
for ( var prop in style ) {
|
890 |
+
// use vendor property if available
|
891 |
+
var supportedProp = vendorProperties[ prop ] || prop;
|
892 |
+
elemStyle[ supportedProp ] = style[ prop ];
|
893 |
+
}
|
894 |
+
};
|
895 |
+
|
896 |
+
// measure position, and sets it
|
897 |
+
proto.getPosition = function() {
|
898 |
+
var style = getComputedStyle( this.element );
|
899 |
+
var isOriginLeft = this.layout._getOption('originLeft');
|
900 |
+
var isOriginTop = this.layout._getOption('originTop');
|
901 |
+
var xValue = style[ isOriginLeft ? 'left' : 'right' ];
|
902 |
+
var yValue = style[ isOriginTop ? 'top' : 'bottom' ];
|
903 |
+
// convert percent to pixels
|
904 |
+
var layoutSize = this.layout.size;
|
905 |
+
var x = xValue.indexOf('%') != -1 ?
|
906 |
+
( parseFloat( xValue ) / 100 ) * layoutSize.width : parseInt( xValue, 10 );
|
907 |
+
var y = yValue.indexOf('%') != -1 ?
|
908 |
+
( parseFloat( yValue ) / 100 ) * layoutSize.height : parseInt( yValue, 10 );
|
909 |
+
|
910 |
+
// clean up 'auto' or other non-integer values
|
911 |
+
x = isNaN( x ) ? 0 : x;
|
912 |
+
y = isNaN( y ) ? 0 : y;
|
913 |
+
// remove padding from measurement
|
914 |
+
x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight;
|
915 |
+
y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom;
|
916 |
+
|
917 |
+
this.position.x = x;
|
918 |
+
this.position.y = y;
|
919 |
+
};
|
920 |
+
|
921 |
+
// set settled position, apply padding
|
922 |
+
proto.layoutPosition = function() {
|
923 |
+
var layoutSize = this.layout.size;
|
924 |
+
var style = {};
|
925 |
+
var isOriginLeft = this.layout._getOption('originLeft');
|
926 |
+
var isOriginTop = this.layout._getOption('originTop');
|
927 |
+
|
928 |
+
// x
|
929 |
+
var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight';
|
930 |
+
var xProperty = isOriginLeft ? 'left' : 'right';
|
931 |
+
var xResetProperty = isOriginLeft ? 'right' : 'left';
|
932 |
+
|
933 |
+
var x = this.position.x + layoutSize[ xPadding ];
|
934 |
+
// set in percentage or pixels
|
935 |
+
style[ xProperty ] = this.getXValue( x );
|
936 |
+
// reset other property
|
937 |
+
style[ xResetProperty ] = '';
|
938 |
+
|
939 |
+
// y
|
940 |
+
var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom';
|
941 |
+
var yProperty = isOriginTop ? 'top' : 'bottom';
|
942 |
+
var yResetProperty = isOriginTop ? 'bottom' : 'top';
|
943 |
+
|
944 |
+
var y = this.position.y + layoutSize[ yPadding ];
|
945 |
+
// set in percentage or pixels
|
946 |
+
style[ yProperty ] = this.getYValue( y );
|
947 |
+
// reset other property
|
948 |
+
style[ yResetProperty ] = '';
|
949 |
+
|
950 |
+
this.css( style );
|
951 |
+
this.emitEvent( 'layout', [ this ] );
|
952 |
+
};
|
953 |
+
|
954 |
+
proto.getXValue = function( x ) {
|
955 |
+
var isHorizontal = this.layout._getOption('horizontal');
|
956 |
+
return this.layout.options.percentPosition && !isHorizontal ?
|
957 |
+
( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px';
|
958 |
+
};
|
959 |
+
|
960 |
+
proto.getYValue = function( y ) {
|
961 |
+
var isHorizontal = this.layout._getOption('horizontal');
|
962 |
+
return this.layout.options.percentPosition && isHorizontal ?
|
963 |
+
( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px';
|
964 |
+
};
|
965 |
+
|
966 |
+
proto._transitionTo = function( x, y ) {
|
967 |
+
this.getPosition();
|
968 |
+
// get current x & y from top/left
|
969 |
+
var curX = this.position.x;
|
970 |
+
var curY = this.position.y;
|
971 |
+
|
972 |
+
var compareX = parseInt( x, 10 );
|
973 |
+
var compareY = parseInt( y, 10 );
|
974 |
+
var didNotMove = compareX === this.position.x && compareY === this.position.y;
|
975 |
+
|
976 |
+
// save end position
|
977 |
+
this.setPosition( x, y );
|
978 |
+
|
979 |
+
// if did not move and not transitioning, just go to layout
|
980 |
+
if ( didNotMove && !this.isTransitioning ) {
|
981 |
+
this.layoutPosition();
|
982 |
+
return;
|
983 |
+
}
|
984 |
+
|
985 |
+
var transX = x - curX;
|
986 |
+
var transY = y - curY;
|
987 |
+
var transitionStyle = {};
|
988 |
+
transitionStyle.transform = this.getTranslate( transX, transY );
|
989 |
+
|
990 |
+
this.transition({
|
991 |
+
to: transitionStyle,
|
992 |
+
onTransitionEnd: {
|
993 |
+
transform: this.layoutPosition
|
994 |
+
},
|
995 |
+
isCleaning: true
|
996 |
+
});
|
997 |
+
};
|
998 |
+
|
999 |
+
proto.getTranslate = function( x, y ) {
|
1000 |
+
// flip cooridinates if origin on right or bottom
|
1001 |
+
var isOriginLeft = this.layout._getOption('originLeft');
|
1002 |
+
var isOriginTop = this.layout._getOption('originTop');
|
1003 |
+
x = isOriginLeft ? x : -x;
|
1004 |
+
y = isOriginTop ? y : -y;
|
1005 |
+
return 'translate3d(' + x + 'px, ' + y + 'px, 0)';
|
1006 |
+
};
|
1007 |
+
|
1008 |
+
// non transition + transform support
|
1009 |
+
proto.goTo = function( x, y ) {
|
1010 |
+
this.setPosition( x, y );
|
1011 |
+
this.layoutPosition();
|
1012 |
+
};
|
1013 |
+
|
1014 |
+
proto.moveTo = proto._transitionTo;
|
1015 |
+
|
1016 |
+
proto.setPosition = function( x, y ) {
|
1017 |
+
this.position.x = parseInt( x, 10 );
|
1018 |
+
this.position.y = parseInt( y, 10 );
|
1019 |
+
};
|
1020 |
+
|
1021 |
+
// ----- transition ----- //
|
1022 |
+
|
1023 |
+
/**
|
1024 |
+
* @param {Object} style - CSS
|
1025 |
+
* @param {Function} onTransitionEnd
|
1026 |
+
*/
|
1027 |
+
|
1028 |
+
// non transition, just trigger callback
|
1029 |
+
proto._nonTransition = function( args ) {
|
1030 |
+
this.css( args.to );
|
1031 |
+
if ( args.isCleaning ) {
|
1032 |
+
this._removeStyles( args.to );
|
1033 |
+
}
|
1034 |
+
for ( var prop in args.onTransitionEnd ) {
|
1035 |
+
args.onTransitionEnd[ prop ].call( this );
|
1036 |
+
}
|
1037 |
+
};
|
1038 |
+
|
1039 |
+
/**
|
1040 |
+
* proper transition
|
1041 |
+
* @param {Object} args - arguments
|
1042 |
+
* @param {Object} to - style to transition to
|
1043 |
+
* @param {Object} from - style to start transition from
|
1044 |
+
* @param {Boolean} isCleaning - removes transition styles after transition
|
1045 |
+
* @param {Function} onTransitionEnd - callback
|
1046 |
+
*/
|
1047 |
+
proto.transition = function( args ) {
|
1048 |
+
// redirect to nonTransition if no transition duration
|
1049 |
+
if ( !parseFloat( this.layout.options.transitionDuration ) ) {
|
1050 |
+
this._nonTransition( args );
|
1051 |
+
return;
|
1052 |
+
}
|
1053 |
+
|
1054 |
+
var _transition = this._transn;
|
1055 |
+
// keep track of onTransitionEnd callback by css property
|
1056 |
+
for ( var prop in args.onTransitionEnd ) {
|
1057 |
+
_transition.onEnd[ prop ] = args.onTransitionEnd[ prop ];
|
1058 |
+
}
|
1059 |
+
// keep track of properties that are transitioning
|
1060 |
+
for ( prop in args.to ) {
|
1061 |
+
_transition.ingProperties[ prop ] = true;
|
1062 |
+
// keep track of properties to clean up when transition is done
|
1063 |
+
if ( args.isCleaning ) {
|
1064 |
+
_transition.clean[ prop ] = true;
|
1065 |
+
}
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
// set from styles
|
1069 |
+
if ( args.from ) {
|
1070 |
+
this.css( args.from );
|
1071 |
+
// force redraw. http://blog.alexmaccaw.com/css-transitions
|
1072 |
+
var h = this.element.offsetHeight;
|
1073 |
+
// hack for JSHint to hush about unused var
|
1074 |
+
h = null;
|
1075 |
+
}
|
1076 |
+
// enable transition
|
1077 |
+
this.enableTransition( args.to );
|
1078 |
+
// set styles that are transitioning
|
1079 |
+
this.css( args.to );
|
1080 |
+
|
1081 |
+
this.isTransitioning = true;
|
1082 |
+
|
1083 |
+
};
|
1084 |
+
|
1085 |
+
// dash before all cap letters, including first for
|
1086 |
+
// WebkitTransform => -webkit-transform
|
1087 |
+
function toDashedAll( str ) {
|
1088 |
+
return str.replace( /([A-Z])/g, function( $1 ) {
|
1089 |
+
return '-' + $1.toLowerCase();
|
1090 |
+
});
|
1091 |
+
}
|
1092 |
+
|
1093 |
+
var transitionProps = 'opacity,' + toDashedAll( transformProperty );
|
1094 |
+
|
1095 |
+
proto.enableTransition = function(/* style */) {
|
1096 |
+
// HACK changing transitionProperty during a transition
|
1097 |
+
// will cause transition to jump
|
1098 |
+
if ( this.isTransitioning ) {
|
1099 |
+
return;
|
1100 |
+
}
|
1101 |
+
|
1102 |
+
// make `transition: foo, bar, baz` from style object
|
1103 |
+
// HACK un-comment this when enableTransition can work
|
1104 |
+
// while a transition is happening
|
1105 |
+
// var transitionValues = [];
|
1106 |
+
// for ( var prop in style ) {
|
1107 |
+
// // dash-ify camelCased properties like WebkitTransition
|
1108 |
+
// prop = vendorProperties[ prop ] || prop;
|
1109 |
+
// transitionValues.push( toDashedAll( prop ) );
|
1110 |
+
// }
|
1111 |
+
// munge number to millisecond, to match stagger
|
1112 |
+
var duration = this.layout.options.transitionDuration;
|
1113 |
+
duration = typeof duration == 'number' ? duration + 'ms' : duration;
|
1114 |
+
// enable transition styles
|
1115 |
+
this.css({
|
1116 |
+
transitionProperty: transitionProps,
|
1117 |
+
transitionDuration: duration,
|
1118 |
+
transitionDelay: this.staggerDelay || 0
|
1119 |
+
});
|
1120 |
+
// listen for transition end event
|
1121 |
+
this.element.addEventListener( transitionEndEvent, this, false );
|
1122 |
+
};
|
1123 |
+
|
1124 |
+
// ----- events ----- //
|
1125 |
+
|
1126 |
+
proto.onwebkitTransitionEnd = function( event ) {
|
1127 |
+
this.ontransitionend( event );
|
1128 |
+
};
|
1129 |
+
|
1130 |
+
proto.onotransitionend = function( event ) {
|
1131 |
+
this.ontransitionend( event );
|
1132 |
+
};
|
1133 |
+
|
1134 |
+
// properties that I munge to make my life easier
|
1135 |
+
var dashedVendorProperties = {
|
1136 |
+
'-webkit-transform': 'transform'
|
1137 |
+
};
|
1138 |
+
|
1139 |
+
proto.ontransitionend = function( event ) {
|
1140 |
+
// disregard bubbled events from children
|
1141 |
+
if ( event.target !== this.element ) {
|
1142 |
+
return;
|
1143 |
+
}
|
1144 |
+
var _transition = this._transn;
|
1145 |
+
// get property name of transitioned property, convert to prefix-free
|
1146 |
+
var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName;
|
1147 |
+
|
1148 |
+
// remove property that has completed transitioning
|
1149 |
+
delete _transition.ingProperties[ propertyName ];
|
1150 |
+
// check if any properties are still transitioning
|
1151 |
+
if ( isEmptyObj( _transition.ingProperties ) ) {
|
1152 |
+
// all properties have completed transitioning
|
1153 |
+
this.disableTransition();
|
1154 |
+
}
|
1155 |
+
// clean style
|
1156 |
+
if ( propertyName in _transition.clean ) {
|
1157 |
+
// clean up style
|
1158 |
+
this.element.style[ event.propertyName ] = '';
|
1159 |
+
delete _transition.clean[ propertyName ];
|
1160 |
+
}
|
1161 |
+
// trigger onTransitionEnd callback
|
1162 |
+
if ( propertyName in _transition.onEnd ) {
|
1163 |
+
var onTransitionEnd = _transition.onEnd[ propertyName ];
|
1164 |
+
onTransitionEnd.call( this );
|
1165 |
+
delete _transition.onEnd[ propertyName ];
|
1166 |
+
}
|
1167 |
+
|
1168 |
+
this.emitEvent( 'transitionEnd', [ this ] );
|
1169 |
+
};
|
1170 |
+
|
1171 |
+
proto.disableTransition = function() {
|
1172 |
+
this.removeTransitionStyles();
|
1173 |
+
this.element.removeEventListener( transitionEndEvent, this, false );
|
1174 |
+
this.isTransitioning = false;
|
1175 |
+
};
|
1176 |
+
|
1177 |
+
/**
|
1178 |
+
* removes style property from element
|
1179 |
+
* @param {Object} style
|
1180 |
+
**/
|
1181 |
+
proto._removeStyles = function( style ) {
|
1182 |
+
// clean up transition styles
|
1183 |
+
var cleanStyle = {};
|
1184 |
+
for ( var prop in style ) {
|
1185 |
+
cleanStyle[ prop ] = '';
|
1186 |
+
}
|
1187 |
+
this.css( cleanStyle );
|
1188 |
+
};
|
1189 |
+
|
1190 |
+
var cleanTransitionStyle = {
|
1191 |
+
transitionProperty: '',
|
1192 |
+
transitionDuration: '',
|
1193 |
+
transitionDelay: ''
|
1194 |
+
};
|
1195 |
+
|
1196 |
+
proto.removeTransitionStyles = function() {
|
1197 |
+
// remove transition
|
1198 |
+
this.css( cleanTransitionStyle );
|
1199 |
+
};
|
1200 |
+
|
1201 |
+
// ----- stagger ----- //
|
1202 |
+
|
1203 |
+
proto.stagger = function( delay ) {
|
1204 |
+
delay = isNaN( delay ) ? 0 : delay;
|
1205 |
+
this.staggerDelay = delay + 'ms';
|
1206 |
+
};
|
1207 |
+
|
1208 |
+
// ----- show/hide/remove ----- //
|
1209 |
+
|
1210 |
+
// remove element from DOM
|
1211 |
+
proto.removeElem = function() {
|
1212 |
+
this.element.parentNode.removeChild( this.element );
|
1213 |
+
// remove display: none
|
1214 |
+
this.css({ display: '' });
|
1215 |
+
this.emitEvent( 'remove', [ this ] );
|
1216 |
+
};
|
1217 |
+
|
1218 |
+
proto.remove = function() {
|
1219 |
+
// just remove element if no transition support or no transition
|
1220 |
+
if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) {
|
1221 |
+
this.removeElem();
|
1222 |
+
return;
|
1223 |
+
}
|
1224 |
+
|
1225 |
+
// start transition
|
1226 |
+
this.once( 'transitionEnd', function() {
|
1227 |
+
this.removeElem();
|
1228 |
+
});
|
1229 |
+
this.hide();
|
1230 |
+
};
|
1231 |
+
|
1232 |
+
proto.reveal = function() {
|
1233 |
+
delete this.isHidden;
|
1234 |
+
// remove display: none
|
1235 |
+
this.css({ display: '' });
|
1236 |
+
|
1237 |
+
var options = this.layout.options;
|
1238 |
+
|
1239 |
+
var onTransitionEnd = {};
|
1240 |
+
var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle');
|
1241 |
+
onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd;
|
1242 |
+
|
1243 |
+
this.transition({
|
1244 |
+
from: options.hiddenStyle,
|
1245 |
+
to: options.visibleStyle,
|
1246 |
+
isCleaning: true,
|
1247 |
+
onTransitionEnd: onTransitionEnd
|
1248 |
+
});
|
1249 |
+
};
|
1250 |
+
|
1251 |
+
proto.onRevealTransitionEnd = function() {
|
1252 |
+
// check if still visible
|
1253 |
+
// during transition, item may have been hidden
|
1254 |
+
if ( !this.isHidden ) {
|
1255 |
+
this.emitEvent('reveal');
|
1256 |
+
}
|
1257 |
+
};
|
1258 |
+
|
1259 |
+
/**
|
1260 |
+
* get style property use for hide/reveal transition end
|
1261 |
+
* @param {String} styleProperty - hiddenStyle/visibleStyle
|
1262 |
+
* @returns {String}
|
1263 |
+
*/
|
1264 |
+
proto.getHideRevealTransitionEndProperty = function( styleProperty ) {
|
1265 |
+
var optionStyle = this.layout.options[ styleProperty ];
|
1266 |
+
// use opacity
|
1267 |
+
if ( optionStyle.opacity ) {
|
1268 |
+
return 'opacity';
|
1269 |
+
}
|
1270 |
+
// get first property
|
1271 |
+
for ( var prop in optionStyle ) {
|
1272 |
+
return prop;
|
1273 |
+
}
|
1274 |
+
};
|
1275 |
+
|
1276 |
+
proto.hide = function() {
|
1277 |
+
// set flag
|
1278 |
+
this.isHidden = true;
|
1279 |
+
// remove display: none
|
1280 |
+
this.css({ display: '' });
|
1281 |
+
|
1282 |
+
var options = this.layout.options;
|
1283 |
+
|
1284 |
+
var onTransitionEnd = {};
|
1285 |
+
var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle');
|
1286 |
+
onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd;
|
1287 |
+
|
1288 |
+
this.transition({
|
1289 |
+
from: options.visibleStyle,
|
1290 |
+
to: options.hiddenStyle,
|
1291 |
+
// keep hidden stuff hidden
|
1292 |
+
isCleaning: true,
|
1293 |
+
onTransitionEnd: onTransitionEnd
|
1294 |
+
});
|
1295 |
+
};
|
1296 |
+
|
1297 |
+
proto.onHideTransitionEnd = function() {
|
1298 |
+
// check if still hidden
|
1299 |
+
// during transition, item may have been un-hidden
|
1300 |
+
if ( this.isHidden ) {
|
1301 |
+
this.css({ display: 'none' });
|
1302 |
+
this.emitEvent('hide');
|
1303 |
+
}
|
1304 |
+
};
|
1305 |
+
|
1306 |
+
proto.destroy = function() {
|
1307 |
+
this.css({
|
1308 |
+
position: '',
|
1309 |
+
left: '',
|
1310 |
+
right: '',
|
1311 |
+
top: '',
|
1312 |
+
bottom: '',
|
1313 |
+
transition: '',
|
1314 |
+
transform: ''
|
1315 |
+
});
|
1316 |
+
};
|
1317 |
+
|
1318 |
+
return Item;
|
1319 |
+
|
1320 |
+
}));
|
1321 |
+
|
1322 |
+
/*!
|
1323 |
+
* Outlayer v2.1.0
|
1324 |
+
* the brains and guts of a layout library
|
1325 |
+
* MIT license
|
1326 |
+
*/
|
1327 |
+
|
1328 |
+
( function( window, factory ) {
|
1329 |
+
'use strict';
|
1330 |
+
// universal module definition
|
1331 |
+
/* jshint strict: false */ /* globals define, module, require */
|
1332 |
+
if ( typeof define == 'function' && define.amd ) {
|
1333 |
+
// AMD - RequireJS
|
1334 |
+
define( 'outlayer/outlayer',[
|
1335 |
+
'ev-emitter/ev-emitter',
|
1336 |
+
'get-size/get-size',
|
1337 |
+
'fizzy-ui-utils/utils',
|
1338 |
+
'./item'
|
1339 |
+
],
|
1340 |
+
function( EvEmitter, getSize, utils, Item ) {
|
1341 |
+
return factory( window, EvEmitter, getSize, utils, Item);
|
1342 |
+
}
|
1343 |
+
);
|
1344 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
1345 |
+
// CommonJS - Browserify, Webpack
|
1346 |
+
module.exports = factory(
|
1347 |
+
window,
|
1348 |
+
require('ev-emitter'),
|
1349 |
+
require('get-size'),
|
1350 |
+
require('fizzy-ui-utils'),
|
1351 |
+
require('./item')
|
1352 |
+
);
|
1353 |
+
} else {
|
1354 |
+
// browser global
|
1355 |
+
window.Outlayer = factory(
|
1356 |
+
window,
|
1357 |
+
window.EvEmitter,
|
1358 |
+
window.getSize,
|
1359 |
+
window.fizzyUIUtils,
|
1360 |
+
window.Outlayer.Item
|
1361 |
+
);
|
1362 |
+
}
|
1363 |
+
|
1364 |
+
}( window, function factory( window, EvEmitter, getSize, utils, Item ) {
|
1365 |
+
'use strict';
|
1366 |
+
|
1367 |
+
// ----- vars ----- //
|
1368 |
+
|
1369 |
+
var console = window.console;
|
1370 |
+
var jQuery = window.jQuery;
|
1371 |
+
var noop = function() {};
|
1372 |
+
|
1373 |
+
// -------------------------- Outlayer -------------------------- //
|
1374 |
+
|
1375 |
+
// globally unique identifiers
|
1376 |
+
var GUID = 0;
|
1377 |
+
// internal store of all Outlayer intances
|
1378 |
+
var instances = {};
|
1379 |
+
|
1380 |
+
|
1381 |
+
/**
|
1382 |
+
* @param {Element, String} element
|
1383 |
+
* @param {Object} options
|
1384 |
+
* @constructor
|
1385 |
+
*/
|
1386 |
+
function Outlayer( element, options ) {
|
1387 |
+
var queryElement = utils.getQueryElement( element );
|
1388 |
+
if ( !queryElement ) {
|
1389 |
+
if ( console ) {
|
1390 |
+
console.error( 'Bad element for ' + this.constructor.namespace +
|
1391 |
+
': ' + ( queryElement || element ) );
|
1392 |
+
}
|
1393 |
+
return;
|
1394 |
+
}
|
1395 |
+
this.element = queryElement;
|
1396 |
+
// add jQuery
|
1397 |
+
if ( jQuery ) {
|
1398 |
+
this.$element = jQuery( this.element );
|
1399 |
+
}
|
1400 |
+
|
1401 |
+
// options
|
1402 |
+
this.options = utils.extend( {}, this.constructor.defaults );
|
1403 |
+
this.option( options );
|
1404 |
+
|
1405 |
+
// add id for Outlayer.getFromElement
|
1406 |
+
var id = ++GUID;
|
1407 |
+
this.element.outlayerGUID = id; // expando
|
1408 |
+
instances[ id ] = this; // associate via id
|
1409 |
+
|
1410 |
+
// kick it off
|
1411 |
+
this._create();
|
1412 |
+
|
1413 |
+
var isInitLayout = this._getOption('initLayout');
|
1414 |
+
if ( isInitLayout ) {
|
1415 |
+
this.layout();
|
1416 |
+
}
|
1417 |
+
}
|
1418 |
+
|
1419 |
+
// settings are for internal use only
|
1420 |
+
Outlayer.namespace = 'outlayer';
|
1421 |
+
Outlayer.Item = Item;
|
1422 |
+
|
1423 |
+
// default options
|
1424 |
+
Outlayer.defaults = {
|
1425 |
+
containerStyle: {
|
1426 |
+
position: 'relative'
|
1427 |
+
},
|
1428 |
+
initLayout: true,
|
1429 |
+
originLeft: true,
|
1430 |
+
originTop: true,
|
1431 |
+
resize: true,
|
1432 |
+
resizeContainer: true,
|
1433 |
+
// item options
|
1434 |
+
transitionDuration: '0.4s',
|
1435 |
+
hiddenStyle: {
|
1436 |
+
opacity: 0,
|
1437 |
+
transform: 'scale(0.001)'
|
1438 |
+
},
|
1439 |
+
visibleStyle: {
|
1440 |
+
opacity: 1,
|
1441 |
+
transform: 'scale(1)'
|
1442 |
+
}
|
1443 |
+
};
|
1444 |
+
|
1445 |
+
var proto = Outlayer.prototype;
|
1446 |
+
// inherit EvEmitter
|
1447 |
+
utils.extend( proto, EvEmitter.prototype );
|
1448 |
+
|
1449 |
+
/**
|
1450 |
+
* set options
|
1451 |
+
* @param {Object} opts
|
1452 |
+
*/
|
1453 |
+
proto.option = function( opts ) {
|
1454 |
+
utils.extend( this.options, opts );
|
1455 |
+
};
|
1456 |
+
|
1457 |
+
/**
|
1458 |
+
* get backwards compatible option value, check old name
|
1459 |
+
*/
|
1460 |
+
proto._getOption = function( option ) {
|
1461 |
+
var oldOption = this.constructor.compatOptions[ option ];
|
1462 |
+
return oldOption && this.options[ oldOption ] !== undefined ?
|
1463 |
+
this.options[ oldOption ] : this.options[ option ];
|
1464 |
+
};
|
1465 |
+
|
1466 |
+
Outlayer.compatOptions = {
|
1467 |
+
// currentName: oldName
|
1468 |
+
initLayout: 'isInitLayout',
|
1469 |
+
horizontal: 'isHorizontal',
|
1470 |
+
layoutInstant: 'isLayoutInstant',
|
1471 |
+
originLeft: 'isOriginLeft',
|
1472 |
+
originTop: 'isOriginTop',
|
1473 |
+
resize: 'isResizeBound',
|
1474 |
+
resizeContainer: 'isResizingContainer'
|
1475 |
+
};
|
1476 |
+
|
1477 |
+
proto._create = function() {
|
1478 |
+
// get items from children
|
1479 |
+
this.reloadItems();
|
1480 |
+
// elements that affect layout, but are not laid out
|
1481 |
+
this.stamps = [];
|
1482 |
+
this.stamp( this.options.stamp );
|
1483 |
+
// set container style
|
1484 |
+
utils.extend( this.element.style, this.options.containerStyle );
|
1485 |
+
|
1486 |
+
// bind resize method
|
1487 |
+
var canBindResize = this._getOption('resize');
|
1488 |
+
if ( canBindResize ) {
|
1489 |
+
this.bindResize();
|
1490 |
+
}
|
1491 |
+
};
|
1492 |
+
|
1493 |
+
// goes through all children again and gets bricks in proper order
|
1494 |
+
proto.reloadItems = function() {
|
1495 |
+
// collection of item elements
|
1496 |
+
this.items = this._itemize( this.element.children );
|
1497 |
+
};
|
1498 |
+
|
1499 |
+
|
1500 |
+
/**
|
1501 |
+
* turn elements into Outlayer.Items to be used in layout
|
1502 |
+
* @param {Array or NodeList or HTMLElement} elems
|
1503 |
+
* @returns {Array} items - collection of new Outlayer Items
|
1504 |
+
*/
|
1505 |
+
proto._itemize = function( elems ) {
|
1506 |
+
|
1507 |
+
var itemElems = this._filterFindItemElements( elems );
|
1508 |
+
var Item = this.constructor.Item;
|
1509 |
+
|
1510 |
+
// create new Outlayer Items for collection
|
1511 |
+
var items = [];
|
1512 |
+
for ( var i=0; i < itemElems.length; i++ ) {
|
1513 |
+
var elem = itemElems[i];
|
1514 |
+
var item = new Item( elem, this );
|
1515 |
+
items.push( item );
|
1516 |
+
}
|
1517 |
+
|
1518 |
+
return items;
|
1519 |
+
};
|
1520 |
+
|
1521 |
+
/**
|
1522 |
+
* get item elements to be used in layout
|
1523 |
+
* @param {Array or NodeList or HTMLElement} elems
|
1524 |
+
* @returns {Array} items - item elements
|
1525 |
+
*/
|
1526 |
+
proto._filterFindItemElements = function( elems ) {
|
1527 |
+
return utils.filterFindElements( elems, this.options.itemSelector );
|
1528 |
+
};
|
1529 |
+
|
1530 |
+
/**
|
1531 |
+
* getter method for getting item elements
|
1532 |
+
* @returns {Array} elems - collection of item elements
|
1533 |
+
*/
|
1534 |
+
proto.getItemElements = function() {
|
1535 |
+
return this.items.map( function( item ) {
|
1536 |
+
return item.element;
|
1537 |
+
});
|
1538 |
+
};
|
1539 |
+
|
1540 |
+
// ----- init & layout ----- //
|
1541 |
+
|
1542 |
+
/**
|
1543 |
+
* lays out all items
|
1544 |
+
*/
|
1545 |
+
proto.layout = function() {
|
1546 |
+
this._resetLayout();
|
1547 |
+
this._manageStamps();
|
1548 |
+
|
1549 |
+
// don't animate first layout
|
1550 |
+
var layoutInstant = this._getOption('layoutInstant');
|
1551 |
+
var isInstant = layoutInstant !== undefined ?
|
1552 |
+
layoutInstant : !this._isLayoutInited;
|
1553 |
+
this.layoutItems( this.items, isInstant );
|
1554 |
+
|
1555 |
+
// flag for initalized
|
1556 |
+
this._isLayoutInited = true;
|
1557 |
+
};
|
1558 |
+
|
1559 |
+
// _init is alias for layout
|
1560 |
+
proto._init = proto.layout;
|
1561 |
+
|
1562 |
+
/**
|
1563 |
+
* logic before any new layout
|
1564 |
+
*/
|
1565 |
+
proto._resetLayout = function() {
|
1566 |
+
this.getSize();
|
1567 |
+
};
|
1568 |
+
|
1569 |
+
|
1570 |
+
proto.getSize = function() {
|
1571 |
+
this.size = getSize( this.element );
|
1572 |
+
};
|
1573 |
+
|
1574 |
+
/**
|
1575 |
+
* get measurement from option, for columnWidth, rowHeight, gutter
|
1576 |
+
* if option is String -> get element from selector string, & get size of element
|
1577 |
+
* if option is Element -> get size of element
|
1578 |
+
* else use option as a number
|
1579 |
+
*
|
1580 |
+
* @param {String} measurement
|
1581 |
+
* @param {String} size - width or height
|
1582 |
+
* @private
|
1583 |
+
*/
|
1584 |
+
proto._getMeasurement = function( measurement, size ) {
|
1585 |
+
var option = this.options[ measurement ];
|
1586 |
+
var elem;
|
1587 |
+
if ( !option ) {
|
1588 |
+
// default to 0
|
1589 |
+
this[ measurement ] = 0;
|
1590 |
+
} else {
|
1591 |
+
// use option as an element
|
1592 |
+
if ( typeof option == 'string' ) {
|
1593 |
+
elem = this.element.querySelector( option );
|
1594 |
+
} else if ( option instanceof HTMLElement ) {
|
1595 |
+
elem = option;
|
1596 |
+
}
|
1597 |
+
// use size of element, if element
|
1598 |
+
this[ measurement ] = elem ? getSize( elem )[ size ] : option;
|
1599 |
+
}
|
1600 |
+
};
|
1601 |
+
|
1602 |
+
/**
|
1603 |
+
* layout a collection of item elements
|
1604 |
+
* @api public
|
1605 |
+
*/
|
1606 |
+
proto.layoutItems = function( items, isInstant ) {
|
1607 |
+
items = this._getItemsForLayout( items );
|
1608 |
+
|
1609 |
+
this._layoutItems( items, isInstant );
|
1610 |
+
|
1611 |
+
this._postLayout();
|
1612 |
+
};
|
1613 |
+
|
1614 |
+
/**
|
1615 |
+
* get the items to be laid out
|
1616 |
+
* you may want to skip over some items
|
1617 |
+
* @param {Array} items
|
1618 |
+
* @returns {Array} items
|
1619 |
+
*/
|
1620 |
+
proto._getItemsForLayout = function( items ) {
|
1621 |
+
return items.filter( function( item ) {
|
1622 |
+
return !item.isIgnored;
|
1623 |
+
});
|
1624 |
+
};
|
1625 |
+
|
1626 |
+
/**
|
1627 |
+
* layout items
|
1628 |
+
* @param {Array} items
|
1629 |
+
* @param {Boolean} isInstant
|
1630 |
+
*/
|
1631 |
+
proto._layoutItems = function( items, isInstant ) {
|
1632 |
+
this._emitCompleteOnItems( 'layout', items );
|
1633 |
+
|
1634 |
+
if ( !items || !items.length ) {
|
1635 |
+
// no items, emit event with empty array
|
1636 |
+
return;
|
1637 |
+
}
|
1638 |
+
|
1639 |
+
var queue = [];
|
1640 |
+
|
1641 |
+
items.forEach( function( item ) {
|
1642 |
+
// get x/y object from method
|
1643 |
+
var position = this._getItemLayoutPosition( item );
|
1644 |
+
// enqueue
|
1645 |
+
position.item = item;
|
1646 |
+
position.isInstant = isInstant || item.isLayoutInstant;
|
1647 |
+
queue.push( position );
|
1648 |
+
}, this );
|
1649 |
+
|
1650 |
+
this._processLayoutQueue( queue );
|
1651 |
+
};
|
1652 |
+
|
1653 |
+
/**
|
1654 |
+
* get item layout position
|
1655 |
+
* @param {Outlayer.Item} item
|
1656 |
+
* @returns {Object} x and y position
|
1657 |
+
*/
|
1658 |
+
proto._getItemLayoutPosition = function( /* item */ ) {
|
1659 |
+
return {
|
1660 |
+
x: 0,
|
1661 |
+
y: 0
|
1662 |
+
};
|
1663 |
+
};
|
1664 |
+
|
1665 |
+
/**
|
1666 |
+
* iterate over array and position each item
|
1667 |
+
* Reason being - separating this logic prevents 'layout invalidation'
|
1668 |
+
* thx @paul_irish
|
1669 |
+
* @param {Array} queue
|
1670 |
+
*/
|
1671 |
+
proto._processLayoutQueue = function( queue ) {
|
1672 |
+
this.updateStagger();
|
1673 |
+
queue.forEach( function( obj, i ) {
|
1674 |
+
this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i );
|
1675 |
+
}, this );
|
1676 |
+
};
|
1677 |
+
|
1678 |
+
// set stagger from option in milliseconds number
|
1679 |
+
proto.updateStagger = function() {
|
1680 |
+
var stagger = this.options.stagger;
|
1681 |
+
if ( stagger === null || stagger === undefined ) {
|
1682 |
+
this.stagger = 0;
|
1683 |
+
return;
|
1684 |
+
}
|
1685 |
+
this.stagger = getMilliseconds( stagger );
|
1686 |
+
return this.stagger;
|
1687 |
+
};
|
1688 |
+
|
1689 |
+
/**
|
1690 |
+
* Sets position of item in DOM
|
1691 |
+
* @param {Outlayer.Item} item
|
1692 |
+
* @param {Number} x - horizontal position
|
1693 |
+
* @param {Number} y - vertical position
|
1694 |
+
* @param {Boolean} isInstant - disables transitions
|
1695 |
+
*/
|
1696 |
+
proto._positionItem = function( item, x, y, isInstant, i ) {
|
1697 |
+
if ( isInstant ) {
|
1698 |
+
// if not transition, just set CSS
|
1699 |
+
item.goTo( x, y );
|
1700 |
+
} else {
|
1701 |
+
item.stagger( i * this.stagger );
|
1702 |
+
item.moveTo( x, y );
|
1703 |
+
}
|
1704 |
+
};
|
1705 |
+
|
1706 |
+
/**
|
1707 |
+
* Any logic you want to do after each layout,
|
1708 |
+
* i.e. size the container
|
1709 |
+
*/
|
1710 |
+
proto._postLayout = function() {
|
1711 |
+
this.resizeContainer();
|
1712 |
+
};
|
1713 |
+
|
1714 |
+
proto.resizeContainer = function() {
|
1715 |
+
var isResizingContainer = this._getOption('resizeContainer');
|
1716 |
+
if ( !isResizingContainer ) {
|
1717 |
+
return;
|
1718 |
+
}
|
1719 |
+
var size = this._getContainerSize();
|
1720 |
+
if ( size ) {
|
1721 |
+
this._setContainerMeasure( size.width, true );
|
1722 |
+
this._setContainerMeasure( size.height, false );
|
1723 |
+
}
|
1724 |
+
};
|
1725 |
+
|
1726 |
+
/**
|
1727 |
+
* Sets width or height of container if returned
|
1728 |
+
* @returns {Object} size
|
1729 |
+
* @param {Number} width
|
1730 |
+
* @param {Number} height
|
1731 |
+
*/
|
1732 |
+
proto._getContainerSize = noop;
|
1733 |
+
|
1734 |
+
/**
|
1735 |
+
* @param {Number} measure - size of width or height
|
1736 |
+
* @param {Boolean} isWidth
|
1737 |
+
*/
|
1738 |
+
proto._setContainerMeasure = function( measure, isWidth ) {
|
1739 |
+
if ( measure === undefined ) {
|
1740 |
+
return;
|
1741 |
+
}
|
1742 |
+
|
1743 |
+
var elemSize = this.size;
|
1744 |
+
// add padding and border width if border box
|
1745 |
+
if ( elemSize.isBorderBox ) {
|
1746 |
+
measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight +
|
1747 |
+
elemSize.borderLeftWidth + elemSize.borderRightWidth :
|
1748 |
+
elemSize.paddingBottom + elemSize.paddingTop +
|
1749 |
+
elemSize.borderTopWidth + elemSize.borderBottomWidth;
|
1750 |
+
}
|
1751 |
+
|
1752 |
+
measure = Math.max( measure, 0 );
|
1753 |
+
this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px';
|
1754 |
+
};
|
1755 |
+
|
1756 |
+
/**
|
1757 |
+
* emit eventComplete on a collection of items events
|
1758 |
+
* @param {String} eventName
|
1759 |
+
* @param {Array} items - Outlayer.Items
|
1760 |
+
*/
|
1761 |
+
proto._emitCompleteOnItems = function( eventName, items ) {
|
1762 |
+
var _this = this;
|
1763 |
+
function onComplete() {
|
1764 |
+
_this.dispatchEvent( eventName + 'Complete', null, [ items ] );
|
1765 |
+
}
|
1766 |
+
|
1767 |
+
var count = items.length;
|
1768 |
+
if ( !items || !count ) {
|
1769 |
+
onComplete();
|
1770 |
+
return;
|
1771 |
+
}
|
1772 |
+
|
1773 |
+
var doneCount = 0;
|
1774 |
+
function tick() {
|
1775 |
+
doneCount++;
|
1776 |
+
if ( doneCount == count ) {
|
1777 |
+
onComplete();
|
1778 |
+
}
|
1779 |
+
}
|
1780 |
+
|
1781 |
+
// bind callback
|
1782 |
+
items.forEach( function( item ) {
|
1783 |
+
item.once( eventName, tick );
|
1784 |
+
});
|
1785 |
+
};
|
1786 |
+
|
1787 |
+
/**
|
1788 |
+
* emits events via EvEmitter and jQuery events
|
1789 |
+
* @param {String} type - name of event
|
1790 |
+
* @param {Event} event - original event
|
1791 |
+
* @param {Array} args - extra arguments
|
1792 |
+
*/
|
1793 |
+
proto.dispatchEvent = function( type, event, args ) {
|
1794 |
+
// add original event to arguments
|
1795 |
+
var emitArgs = event ? [ event ].concat( args ) : args;
|
1796 |
+
this.emitEvent( type, emitArgs );
|
1797 |
+
|
1798 |
+
if ( jQuery ) {
|
1799 |
+
// set this.$element
|
1800 |
+
this.$element = this.$element || jQuery( this.element );
|
1801 |
+
if ( event ) {
|
1802 |
+
// create jQuery event
|
1803 |
+
var $event = jQuery.Event( event );
|
1804 |
+
$event.type = type;
|
1805 |
+
this.$element.trigger( $event, args );
|
1806 |
+
} else {
|
1807 |
+
// just trigger with type if no event available
|
1808 |
+
this.$element.trigger( type, args );
|
1809 |
+
}
|
1810 |
+
}
|
1811 |
+
};
|
1812 |
+
|
1813 |
+
// -------------------------- ignore & stamps -------------------------- //
|
1814 |
+
|
1815 |
+
|
1816 |
+
/**
|
1817 |
+
* keep item in collection, but do not lay it out
|
1818 |
+
* ignored items do not get skipped in layout
|
1819 |
+
* @param {Element} elem
|
1820 |
+
*/
|
1821 |
+
proto.ignore = function( elem ) {
|
1822 |
+
var item = this.getItem( elem );
|
1823 |
+
if ( item ) {
|
1824 |
+
item.isIgnored = true;
|
1825 |
+
}
|
1826 |
+
};
|
1827 |
+
|
1828 |
+
/**
|
1829 |
+
* return item to layout collection
|
1830 |
+
* @param {Element} elem
|
1831 |
+
*/
|
1832 |
+
proto.unignore = function( elem ) {
|
1833 |
+
var item = this.getItem( elem );
|
1834 |
+
if ( item ) {
|
1835 |
+
delete item.isIgnored;
|
1836 |
+
}
|
1837 |
+
};
|
1838 |
+
|
1839 |
+
/**
|
1840 |
+
* adds elements to stamps
|
1841 |
+
* @param {NodeList, Array, Element, or String} elems
|
1842 |
+
*/
|
1843 |
+
proto.stamp = function( elems ) {
|
1844 |
+
elems = this._find( elems );
|
1845 |
+
if ( !elems ) {
|
1846 |
+
return;
|
1847 |
+
}
|
1848 |
+
|
1849 |
+
this.stamps = this.stamps.concat( elems );
|
1850 |
+
// ignore
|
1851 |
+
elems.forEach( this.ignore, this );
|
1852 |
+
};
|
1853 |
+
|
1854 |
+
/**
|
1855 |
+
* removes elements to stamps
|
1856 |
+
* @param {NodeList, Array, or Element} elems
|
1857 |
+
*/
|
1858 |
+
proto.unstamp = function( elems ) {
|
1859 |
+
elems = this._find( elems );
|
1860 |
+
if ( !elems ){
|
1861 |
+
return;
|
1862 |
+
}
|
1863 |
+
|
1864 |
+
elems.forEach( function( elem ) {
|
1865 |
+
// filter out removed stamp elements
|
1866 |
+
utils.removeFrom( this.stamps, elem );
|
1867 |
+
this.unignore( elem );
|
1868 |
+
}, this );
|
1869 |
+
};
|
1870 |
+
|
1871 |
+
/**
|
1872 |
+
* finds child elements
|
1873 |
+
* @param {NodeList, Array, Element, or String} elems
|
1874 |
+
* @returns {Array} elems
|
1875 |
+
*/
|
1876 |
+
proto._find = function( elems ) {
|
1877 |
+
if ( !elems ) {
|
1878 |
+
return;
|
1879 |
+
}
|
1880 |
+
// if string, use argument as selector string
|
1881 |
+
if ( typeof elems == 'string' ) {
|
1882 |
+
elems = this.element.querySelectorAll( elems );
|
1883 |
+
}
|
1884 |
+
elems = utils.makeArray( elems );
|
1885 |
+
return elems;
|
1886 |
+
};
|
1887 |
+
|
1888 |
+
proto._manageStamps = function() {
|
1889 |
+
if ( !this.stamps || !this.stamps.length ) {
|
1890 |
+
return;
|
1891 |
+
}
|
1892 |
+
|
1893 |
+
this._getBoundingRect();
|
1894 |
+
|
1895 |
+
this.stamps.forEach( this._manageStamp, this );
|
1896 |
+
};
|
1897 |
+
|
1898 |
+
// update boundingLeft / Top
|
1899 |
+
proto._getBoundingRect = function() {
|
1900 |
+
// get bounding rect for container element
|
1901 |
+
var boundingRect = this.element.getBoundingClientRect();
|
1902 |
+
var size = this.size;
|
1903 |
+
this._boundingRect = {
|
1904 |
+
left: boundingRect.left + size.paddingLeft + size.borderLeftWidth,
|
1905 |
+
top: boundingRect.top + size.paddingTop + size.borderTopWidth,
|
1906 |
+
right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ),
|
1907 |
+
bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth )
|
1908 |
+
};
|
1909 |
+
};
|
1910 |
+
|
1911 |
+
/**
|
1912 |
+
* @param {Element} stamp
|
1913 |
+
**/
|
1914 |
+
proto._manageStamp = noop;
|
1915 |
+
|
1916 |
+
/**
|
1917 |
+
* get x/y position of element relative to container element
|
1918 |
+
* @param {Element} elem
|
1919 |
+
* @returns {Object} offset - has left, top, right, bottom
|
1920 |
+
*/
|
1921 |
+
proto._getElementOffset = function( elem ) {
|
1922 |
+
var boundingRect = elem.getBoundingClientRect();
|
1923 |
+
var thisRect = this._boundingRect;
|
1924 |
+
var size = getSize( elem );
|
1925 |
+
var offset = {
|
1926 |
+
left: boundingRect.left - thisRect.left - size.marginLeft,
|
1927 |
+
top: boundingRect.top - thisRect.top - size.marginTop,
|
1928 |
+
right: thisRect.right - boundingRect.right - size.marginRight,
|
1929 |
+
bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom
|
1930 |
+
};
|
1931 |
+
return offset;
|
1932 |
+
};
|
1933 |
+
|
1934 |
+
// -------------------------- resize -------------------------- //
|
1935 |
+
|
1936 |
+
// enable event handlers for listeners
|
1937 |
+
// i.e. resize -> onresize
|
1938 |
+
proto.handleEvent = utils.handleEvent;
|
1939 |
+
|
1940 |
+
/**
|
1941 |
+
* Bind layout to window resizing
|
1942 |
+
*/
|
1943 |
+
proto.bindResize = function() {
|
1944 |
+
window.addEventListener( 'resize', this );
|
1945 |
+
this.isResizeBound = true;
|
1946 |
+
};
|
1947 |
+
|
1948 |
+
/**
|
1949 |
+
* Unbind layout to window resizing
|
1950 |
+
*/
|
1951 |
+
proto.unbindResize = function() {
|
1952 |
+
window.removeEventListener( 'resize', this );
|
1953 |
+
this.isResizeBound = false;
|
1954 |
+
};
|
1955 |
+
|
1956 |
+
proto.onresize = function() {
|
1957 |
+
this.resize();
|
1958 |
+
};
|
1959 |
+
|
1960 |
+
utils.debounceMethod( Outlayer, 'onresize', 100 );
|
1961 |
+
|
1962 |
+
proto.resize = function() {
|
1963 |
+
// don't trigger if size did not change
|
1964 |
+
// or if resize was unbound. See #9
|
1965 |
+
if ( !this.isResizeBound || !this.needsResizeLayout() ) {
|
1966 |
+
return;
|
1967 |
+
}
|
1968 |
+
|
1969 |
+
this.layout();
|
1970 |
+
};
|
1971 |
+
|
1972 |
+
/**
|
1973 |
+
* check if layout is needed post layout
|
1974 |
+
* @returns Boolean
|
1975 |
+
*/
|
1976 |
+
proto.needsResizeLayout = function() {
|
1977 |
+
var size = getSize( this.element );
|
1978 |
+
// check that this.size and size are there
|
1979 |
+
// IE8 triggers resize on body size change, so they might not be
|
1980 |
+
var hasSizes = this.size && size;
|
1981 |
+
return hasSizes && size.innerWidth !== this.size.innerWidth;
|
1982 |
+
};
|
1983 |
+
|
1984 |
+
// -------------------------- methods -------------------------- //
|
1985 |
+
|
1986 |
+
/**
|
1987 |
+
* add items to Outlayer instance
|
1988 |
+
* @param {Array or NodeList or Element} elems
|
1989 |
+
* @returns {Array} items - Outlayer.Items
|
1990 |
+
**/
|
1991 |
+
proto.addItems = function( elems ) {
|
1992 |
+
var items = this._itemize( elems );
|
1993 |
+
// add items to collection
|
1994 |
+
if ( items.length ) {
|
1995 |
+
this.items = this.items.concat( items );
|
1996 |
+
}
|
1997 |
+
return items;
|
1998 |
+
};
|
1999 |
+
|
2000 |
+
/**
|
2001 |
+
* Layout newly-appended item elements
|
2002 |
+
* @param {Array or NodeList or Element} elems
|
2003 |
+
*/
|
2004 |
+
proto.appended = function( elems ) {
|
2005 |
+
var items = this.addItems( elems );
|
2006 |
+
if ( !items.length ) {
|
2007 |
+
return;
|
2008 |
+
}
|
2009 |
+
// layout and reveal just the new items
|
2010 |
+
this.layoutItems( items, true );
|
2011 |
+
this.reveal( items );
|
2012 |
+
};
|
2013 |
+
|
2014 |
+
/**
|
2015 |
+
* Layout prepended elements
|
2016 |
+
* @param {Array or NodeList or Element} elems
|
2017 |
+
*/
|
2018 |
+
proto.prepended = function( elems ) {
|
2019 |
+
var items = this._itemize( elems );
|
2020 |
+
if ( !items.length ) {
|
2021 |
+
return;
|
2022 |
+
}
|
2023 |
+
// add items to beginning of collection
|
2024 |
+
var previousItems = this.items.slice(0);
|
2025 |
+
this.items = items.concat( previousItems );
|
2026 |
+
// start new layout
|
2027 |
+
this._resetLayout();
|
2028 |
+
this._manageStamps();
|
2029 |
+
// layout new stuff without transition
|
2030 |
+
this.layoutItems( items, true );
|
2031 |
+
this.reveal( items );
|
2032 |
+
// layout previous items
|
2033 |
+
this.layoutItems( previousItems );
|
2034 |
+
};
|
2035 |
+
|
2036 |
+
/**
|
2037 |
+
* reveal a collection of items
|
2038 |
+
* @param {Array of Outlayer.Items} items
|
2039 |
+
*/
|
2040 |
+
proto.reveal = function( items ) {
|
2041 |
+
this._emitCompleteOnItems( 'reveal', items );
|
2042 |
+
if ( !items || !items.length ) {
|
2043 |
+
return;
|
2044 |
+
}
|
2045 |
+
var stagger = this.updateStagger();
|
2046 |
+
items.forEach( function( item, i ) {
|
2047 |
+
item.stagger( i * stagger );
|
2048 |
+
item.reveal();
|
2049 |
+
});
|
2050 |
+
};
|
2051 |
+
|
2052 |
+
/**
|
2053 |
+
* hide a collection of items
|
2054 |
+
* @param {Array of Outlayer.Items} items
|
2055 |
+
*/
|
2056 |
+
proto.hide = function( items ) {
|
2057 |
+
this._emitCompleteOnItems( 'hide', items );
|
2058 |
+
if ( !items || !items.length ) {
|
2059 |
+
return;
|
2060 |
+
}
|
2061 |
+
var stagger = this.updateStagger();
|
2062 |
+
items.forEach( function( item, i ) {
|
2063 |
+
item.stagger( i * stagger );
|
2064 |
+
item.hide();
|
2065 |
+
});
|
2066 |
+
};
|
2067 |
+
|
2068 |
+
/**
|
2069 |
+
* reveal item elements
|
2070 |
+
* @param {Array}, {Element}, {NodeList} items
|
2071 |
+
*/
|
2072 |
+
proto.revealItemElements = function( elems ) {
|
2073 |
+
var items = this.getItems( elems );
|
2074 |
+
this.reveal( items );
|
2075 |
+
};
|
2076 |
+
|
2077 |
+
/**
|
2078 |
+
* hide item elements
|
2079 |
+
* @param {Array}, {Element}, {NodeList} items
|
2080 |
+
*/
|
2081 |
+
proto.hideItemElements = function( elems ) {
|
2082 |
+
var items = this.getItems( elems );
|
2083 |
+
this.hide( items );
|
2084 |
+
};
|
2085 |
+
|
2086 |
+
/**
|
2087 |
+
* get Outlayer.Item, given an Element
|
2088 |
+
* @param {Element} elem
|
2089 |
+
* @param {Function} callback
|
2090 |
+
* @returns {Outlayer.Item} item
|
2091 |
+
*/
|
2092 |
+
proto.getItem = function( elem ) {
|
2093 |
+
// loop through items to get the one that matches
|
2094 |
+
for ( var i=0; i < this.items.length; i++ ) {
|
2095 |
+
var item = this.items[i];
|
2096 |
+
if ( item.element == elem ) {
|
2097 |
+
// return item
|
2098 |
+
return item;
|
2099 |
+
}
|
2100 |
+
}
|
2101 |
+
};
|
2102 |
+
|
2103 |
+
/**
|
2104 |
+
* get collection of Outlayer.Items, given Elements
|
2105 |
+
* @param {Array} elems
|
2106 |
+
* @returns {Array} items - Outlayer.Items
|
2107 |
+
*/
|
2108 |
+
proto.getItems = function( elems ) {
|
2109 |
+
elems = utils.makeArray( elems );
|
2110 |
+
var items = [];
|
2111 |
+
elems.forEach( function( elem ) {
|
2112 |
+
var item = this.getItem( elem );
|
2113 |
+
if ( item ) {
|
2114 |
+
items.push( item );
|
2115 |
+
}
|
2116 |
+
}, this );
|
2117 |
+
|
2118 |
+
return items;
|
2119 |
+
};
|
2120 |
+
|
2121 |
+
/**
|
2122 |
+
* remove element(s) from instance and DOM
|
2123 |
+
* @param {Array or NodeList or Element} elems
|
2124 |
+
*/
|
2125 |
+
proto.remove = function( elems ) {
|
2126 |
+
var removeItems = this.getItems( elems );
|
2127 |
+
|
2128 |
+
this._emitCompleteOnItems( 'remove', removeItems );
|
2129 |
+
|
2130 |
+
// bail if no items to remove
|
2131 |
+
if ( !removeItems || !removeItems.length ) {
|
2132 |
+
return;
|
2133 |
+
}
|
2134 |
+
|
2135 |
+
removeItems.forEach( function( item ) {
|
2136 |
+
item.remove();
|
2137 |
+
// remove item from collection
|
2138 |
+
utils.removeFrom( this.items, item );
|
2139 |
+
}, this );
|
2140 |
+
};
|
2141 |
+
|
2142 |
+
// ----- destroy ----- //
|
2143 |
+
|
2144 |
+
// remove and disable Outlayer instance
|
2145 |
+
proto.destroy = function() {
|
2146 |
+
// clean up dynamic styles
|
2147 |
+
var style = this.element.style;
|
2148 |
+
style.height = '';
|
2149 |
+
style.position = '';
|
2150 |
+
style.width = '';
|
2151 |
+
// destroy items
|
2152 |
+
this.items.forEach( function( item ) {
|
2153 |
+
item.destroy();
|
2154 |
+
});
|
2155 |
+
|
2156 |
+
this.unbindResize();
|
2157 |
+
|
2158 |
+
var id = this.element.outlayerGUID;
|
2159 |
+
delete instances[ id ]; // remove reference to instance by id
|
2160 |
+
delete this.element.outlayerGUID;
|
2161 |
+
// remove data for jQuery
|
2162 |
+
if ( jQuery ) {
|
2163 |
+
jQuery.removeData( this.element, this.constructor.namespace );
|
2164 |
+
}
|
2165 |
+
|
2166 |
+
};
|
2167 |
+
|
2168 |
+
// -------------------------- data -------------------------- //
|
2169 |
+
|
2170 |
+
/**
|
2171 |
+
* get Outlayer instance from element
|
2172 |
+
* @param {Element} elem
|
2173 |
+
* @returns {Outlayer}
|
2174 |
+
*/
|
2175 |
+
Outlayer.data = function( elem ) {
|
2176 |
+
elem = utils.getQueryElement( elem );
|
2177 |
+
var id = elem && elem.outlayerGUID;
|
2178 |
+
return id && instances[ id ];
|
2179 |
+
};
|
2180 |
+
|
2181 |
+
|
2182 |
+
// -------------------------- create Outlayer class -------------------------- //
|
2183 |
+
|
2184 |
+
/**
|
2185 |
+
* create a layout class
|
2186 |
+
* @param {String} namespace
|
2187 |
+
*/
|
2188 |
+
Outlayer.create = function( namespace, options ) {
|
2189 |
+
// sub-class Outlayer
|
2190 |
+
var Layout = subclass( Outlayer );
|
2191 |
+
// apply new options and compatOptions
|
2192 |
+
Layout.defaults = utils.extend( {}, Outlayer.defaults );
|
2193 |
+
utils.extend( Layout.defaults, options );
|
2194 |
+
Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions );
|
2195 |
+
|
2196 |
+
Layout.namespace = namespace;
|
2197 |
+
|
2198 |
+
Layout.data = Outlayer.data;
|
2199 |
+
|
2200 |
+
// sub-class Item
|
2201 |
+
Layout.Item = subclass( Item );
|
2202 |
+
|
2203 |
+
// -------------------------- declarative -------------------------- //
|
2204 |
+
|
2205 |
+
utils.htmlInit( Layout, namespace );
|
2206 |
+
|
2207 |
+
// -------------------------- jQuery bridge -------------------------- //
|
2208 |
+
|
2209 |
+
// make into jQuery plugin
|
2210 |
+
if ( jQuery && jQuery.bridget ) {
|
2211 |
+
jQuery.bridget( namespace, Layout );
|
2212 |
+
}
|
2213 |
+
|
2214 |
+
return Layout;
|
2215 |
+
};
|
2216 |
+
|
2217 |
+
function subclass( Parent ) {
|
2218 |
+
function SubClass() {
|
2219 |
+
Parent.apply( this, arguments );
|
2220 |
+
}
|
2221 |
+
|
2222 |
+
SubClass.prototype = Object.create( Parent.prototype );
|
2223 |
+
SubClass.prototype.constructor = SubClass;
|
2224 |
+
|
2225 |
+
return SubClass;
|
2226 |
+
}
|
2227 |
+
|
2228 |
+
// ----- helpers ----- //
|
2229 |
+
|
2230 |
+
// how many milliseconds are in each unit
|
2231 |
+
var msUnits = {
|
2232 |
+
ms: 1,
|
2233 |
+
s: 1000
|
2234 |
+
};
|
2235 |
+
|
2236 |
+
// munge time-like parameter into millisecond number
|
2237 |
+
// '0.4s' -> 40
|
2238 |
+
function getMilliseconds( time ) {
|
2239 |
+
if ( typeof time == 'number' ) {
|
2240 |
+
return time;
|
2241 |
+
}
|
2242 |
+
var matches = time.match( /(^\d*\.?\d*)(\w*)/ );
|
2243 |
+
var num = matches && matches[1];
|
2244 |
+
var unit = matches && matches[2];
|
2245 |
+
if ( !num.length ) {
|
2246 |
+
return 0;
|
2247 |
+
}
|
2248 |
+
num = parseFloat( num );
|
2249 |
+
var mult = msUnits[ unit ] || 1;
|
2250 |
+
return num * mult;
|
2251 |
+
}
|
2252 |
+
|
2253 |
+
// ----- fin ----- //
|
2254 |
+
|
2255 |
+
// back in global
|
2256 |
+
Outlayer.Item = Item;
|
2257 |
+
|
2258 |
+
return Outlayer;
|
2259 |
+
|
2260 |
+
}));
|
2261 |
+
|
2262 |
+
/**
|
2263 |
+
* Isotope Item
|
2264 |
+
**/
|
2265 |
+
|
2266 |
+
( function( window, factory ) {
|
2267 |
+
// universal module definition
|
2268 |
+
/* jshint strict: false */ /*globals define, module, require */
|
2269 |
+
if ( typeof define == 'function' && define.amd ) {
|
2270 |
+
// AMD
|
2271 |
+
define( 'isotope/js/item',[
|
2272 |
+
'outlayer/outlayer'
|
2273 |
+
],
|
2274 |
+
factory );
|
2275 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
2276 |
+
// CommonJS
|
2277 |
+
module.exports = factory(
|
2278 |
+
require('outlayer')
|
2279 |
+
);
|
2280 |
+
} else {
|
2281 |
+
// browser global
|
2282 |
+
window.Isotope = window.Isotope || {};
|
2283 |
+
window.Isotope.Item = factory(
|
2284 |
+
window.Outlayer
|
2285 |
+
);
|
2286 |
+
}
|
2287 |
+
|
2288 |
+
}( window, function factory( Outlayer ) {
|
2289 |
+
'use strict';
|
2290 |
+
|
2291 |
+
// -------------------------- Item -------------------------- //
|
2292 |
+
|
2293 |
+
// sub-class Outlayer Item
|
2294 |
+
function Item() {
|
2295 |
+
Outlayer.Item.apply( this, arguments );
|
2296 |
+
}
|
2297 |
+
|
2298 |
+
var proto = Item.prototype = Object.create( Outlayer.Item.prototype );
|
2299 |
+
|
2300 |
+
var _create = proto._create;
|
2301 |
+
proto._create = function() {
|
2302 |
+
// assign id, used for original-order sorting
|
2303 |
+
this.id = this.layout.itemGUID++;
|
2304 |
+
_create.call( this );
|
2305 |
+
this.sortData = {};
|
2306 |
+
};
|
2307 |
+
|
2308 |
+
proto.updateSortData = function() {
|
2309 |
+
if ( this.isIgnored ) {
|
2310 |
+
return;
|
2311 |
+
}
|
2312 |
+
// default sorters
|
2313 |
+
this.sortData.id = this.id;
|
2314 |
+
// for backward compatibility
|
2315 |
+
this.sortData['original-order'] = this.id;
|
2316 |
+
this.sortData.random = Math.random();
|
2317 |
+
// go thru getSortData obj and apply the sorters
|
2318 |
+
var getSortData = this.layout.options.getSortData;
|
2319 |
+
var sorters = this.layout._sorters;
|
2320 |
+
for ( var key in getSortData ) {
|
2321 |
+
var sorter = sorters[ key ];
|
2322 |
+
this.sortData[ key ] = sorter( this.element, this );
|
2323 |
+
}
|
2324 |
+
};
|
2325 |
+
|
2326 |
+
var _destroy = proto.destroy;
|
2327 |
+
proto.destroy = function() {
|
2328 |
+
// call super
|
2329 |
+
_destroy.apply( this, arguments );
|
2330 |
+
// reset display, #741
|
2331 |
+
this.css({
|
2332 |
+
display: ''
|
2333 |
+
});
|
2334 |
+
};
|
2335 |
+
|
2336 |
+
return Item;
|
2337 |
+
|
2338 |
+
}));
|
2339 |
+
|
2340 |
+
/**
|
2341 |
+
* Isotope LayoutMode
|
2342 |
+
*/
|
2343 |
+
|
2344 |
+
( function( window, factory ) {
|
2345 |
+
// universal module definition
|
2346 |
+
/* jshint strict: false */ /*globals define, module, require */
|
2347 |
+
if ( typeof define == 'function' && define.amd ) {
|
2348 |
+
// AMD
|
2349 |
+
define( 'isotope/js/layout-mode',[
|
2350 |
+
'get-size/get-size',
|
2351 |
+
'outlayer/outlayer'
|
2352 |
+
],
|
2353 |
+
factory );
|
2354 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
2355 |
+
// CommonJS
|
2356 |
+
module.exports = factory(
|
2357 |
+
require('get-size'),
|
2358 |
+
require('outlayer')
|
2359 |
+
);
|
2360 |
+
} else {
|
2361 |
+
// browser global
|
2362 |
+
window.Isotope = window.Isotope || {};
|
2363 |
+
window.Isotope.LayoutMode = factory(
|
2364 |
+
window.getSize,
|
2365 |
+
window.Outlayer
|
2366 |
+
);
|
2367 |
+
}
|
2368 |
+
|
2369 |
+
}( window, function factory( getSize, Outlayer ) {
|
2370 |
+
'use strict';
|
2371 |
+
|
2372 |
+
// layout mode class
|
2373 |
+
function LayoutMode( isotope ) {
|
2374 |
+
this.isotope = isotope;
|
2375 |
+
// link properties
|
2376 |
+
if ( isotope ) {
|
2377 |
+
this.options = isotope.options[ this.namespace ];
|
2378 |
+
this.element = isotope.element;
|
2379 |
+
this.items = isotope.filteredItems;
|
2380 |
+
this.size = isotope.size;
|
2381 |
+
}
|
2382 |
+
}
|
2383 |
+
|
2384 |
+
var proto = LayoutMode.prototype;
|
2385 |
+
|
2386 |
+
/**
|
2387 |
+
* some methods should just defer to default Outlayer method
|
2388 |
+
* and reference the Isotope instance as `this`
|
2389 |
+
**/
|
2390 |
+
var facadeMethods = [
|
2391 |
+
'_resetLayout',
|
2392 |
+
'_getItemLayoutPosition',
|
2393 |
+
'_manageStamp',
|
2394 |
+
'_getContainerSize',
|
2395 |
+
'_getElementOffset',
|
2396 |
+
'needsResizeLayout',
|
2397 |
+
'_getOption'
|
2398 |
+
];
|
2399 |
+
|
2400 |
+
facadeMethods.forEach( function( methodName ) {
|
2401 |
+
proto[ methodName ] = function() {
|
2402 |
+
return Outlayer.prototype[ methodName ].apply( this.isotope, arguments );
|
2403 |
+
};
|
2404 |
+
});
|
2405 |
+
|
2406 |
+
// ----- ----- //
|
2407 |
+
|
2408 |
+
// for horizontal layout modes, check vertical size
|
2409 |
+
proto.needsVerticalResizeLayout = function() {
|
2410 |
+
// don't trigger if size did not change
|
2411 |
+
var size = getSize( this.isotope.element );
|
2412 |
+
// check that this.size and size are there
|
2413 |
+
// IE8 triggers resize on body size change, so they might not be
|
2414 |
+
var hasSizes = this.isotope.size && size;
|
2415 |
+
return hasSizes && size.innerHeight != this.isotope.size.innerHeight;
|
2416 |
+
};
|
2417 |
+
|
2418 |
+
// ----- measurements ----- //
|
2419 |
+
|
2420 |
+
proto._getMeasurement = function() {
|
2421 |
+
this.isotope._getMeasurement.apply( this, arguments );
|
2422 |
+
};
|
2423 |
+
|
2424 |
+
proto.getColumnWidth = function() {
|
2425 |
+
this.getSegmentSize( 'column', 'Width' );
|
2426 |
+
};
|
2427 |
+
|
2428 |
+
proto.getRowHeight = function() {
|
2429 |
+
this.getSegmentSize( 'row', 'Height' );
|
2430 |
+
};
|
2431 |
+
|
2432 |
+
/**
|
2433 |
+
* get columnWidth or rowHeight
|
2434 |
+
* segment: 'column' or 'row'
|
2435 |
+
* size 'Width' or 'Height'
|
2436 |
+
**/
|
2437 |
+
proto.getSegmentSize = function( segment, size ) {
|
2438 |
+
var segmentName = segment + size;
|
2439 |
+
var outerSize = 'outer' + size;
|
2440 |
+
// columnWidth / outerWidth // rowHeight / outerHeight
|
2441 |
+
this._getMeasurement( segmentName, outerSize );
|
2442 |
+
// got rowHeight or columnWidth, we can chill
|
2443 |
+
if ( this[ segmentName ] ) {
|
2444 |
+
return;
|
2445 |
+
}
|
2446 |
+
// fall back to item of first element
|
2447 |
+
var firstItemSize = this.getFirstItemSize();
|
2448 |
+
this[ segmentName ] = firstItemSize && firstItemSize[ outerSize ] ||
|
2449 |
+
// or size of container
|
2450 |
+
this.isotope.size[ 'inner' + size ];
|
2451 |
+
};
|
2452 |
+
|
2453 |
+
proto.getFirstItemSize = function() {
|
2454 |
+
var firstItem = this.isotope.filteredItems[0];
|
2455 |
+
return firstItem && firstItem.element && getSize( firstItem.element );
|
2456 |
+
};
|
2457 |
+
|
2458 |
+
// ----- methods that should reference isotope ----- //
|
2459 |
+
|
2460 |
+
proto.layout = function() {
|
2461 |
+
this.isotope.layout.apply( this.isotope, arguments );
|
2462 |
+
};
|
2463 |
+
|
2464 |
+
proto.getSize = function() {
|
2465 |
+
this.isotope.getSize();
|
2466 |
+
this.size = this.isotope.size;
|
2467 |
+
};
|
2468 |
+
|
2469 |
+
// -------------------------- create -------------------------- //
|
2470 |
+
|
2471 |
+
LayoutMode.modes = {};
|
2472 |
+
|
2473 |
+
LayoutMode.create = function( namespace, options ) {
|
2474 |
+
|
2475 |
+
function Mode() {
|
2476 |
+
LayoutMode.apply( this, arguments );
|
2477 |
+
}
|
2478 |
+
|
2479 |
+
Mode.prototype = Object.create( proto );
|
2480 |
+
Mode.prototype.constructor = Mode;
|
2481 |
+
|
2482 |
+
// default options
|
2483 |
+
if ( options ) {
|
2484 |
+
Mode.options = options;
|
2485 |
+
}
|
2486 |
+
|
2487 |
+
Mode.prototype.namespace = namespace;
|
2488 |
+
// register in Isotope
|
2489 |
+
LayoutMode.modes[ namespace ] = Mode;
|
2490 |
+
|
2491 |
+
return Mode;
|
2492 |
+
};
|
2493 |
+
|
2494 |
+
return LayoutMode;
|
2495 |
+
|
2496 |
+
}));
|
2497 |
+
|
2498 |
+
/*!
|
2499 |
+
* Masonry v4.2.0
|
2500 |
+
* Cascading grid layout library
|
2501 |
+
* http://masonry.desandro.com
|
2502 |
+
* MIT License
|
2503 |
+
* by David DeSandro
|
2504 |
+
*/
|
2505 |
+
|
2506 |
+
( function( window, factory ) {
|
2507 |
+
// universal module definition
|
2508 |
+
/* jshint strict: false */ /*globals define, module, require */
|
2509 |
+
if ( typeof define == 'function' && define.amd ) {
|
2510 |
+
// AMD
|
2511 |
+
define( 'masonry/masonry',[
|
2512 |
+
'outlayer/outlayer',
|
2513 |
+
'get-size/get-size'
|
2514 |
+
],
|
2515 |
+
factory );
|
2516 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
2517 |
+
// CommonJS
|
2518 |
+
module.exports = factory(
|
2519 |
+
require('outlayer'),
|
2520 |
+
require('get-size')
|
2521 |
+
);
|
2522 |
+
} else {
|
2523 |
+
// browser global
|
2524 |
+
window.Masonry = factory(
|
2525 |
+
window.Outlayer,
|
2526 |
+
window.getSize
|
2527 |
+
);
|
2528 |
+
}
|
2529 |
+
|
2530 |
+
}( window, function factory( Outlayer, getSize ) {
|
2531 |
+
|
2532 |
+
|
2533 |
+
|
2534 |
+
// -------------------------- masonryDefinition -------------------------- //
|
2535 |
+
|
2536 |
+
// create an Outlayer layout class
|
2537 |
+
var Masonry = Outlayer.create('masonry');
|
2538 |
+
// isFitWidth -> fitWidth
|
2539 |
+
Masonry.compatOptions.fitWidth = 'isFitWidth';
|
2540 |
+
|
2541 |
+
var proto = Masonry.prototype;
|
2542 |
+
|
2543 |
+
proto._resetLayout = function() {
|
2544 |
+
this.getSize();
|
2545 |
+
this._getMeasurement( 'columnWidth', 'outerWidth' );
|
2546 |
+
this._getMeasurement( 'gutter', 'outerWidth' );
|
2547 |
+
this.measureColumns();
|
2548 |
+
|
2549 |
+
// reset column Y
|
2550 |
+
this.colYs = [];
|
2551 |
+
for ( var i=0; i < this.cols; i++ ) {
|
2552 |
+
this.colYs.push( 0 );
|
2553 |
+
}
|
2554 |
+
|
2555 |
+
this.maxY = 0;
|
2556 |
+
this.horizontalColIndex = 0;
|
2557 |
+
};
|
2558 |
+
|
2559 |
+
proto.measureColumns = function() {
|
2560 |
+
this.getContainerWidth();
|
2561 |
+
// if columnWidth is 0, default to outerWidth of first item
|
2562 |
+
if ( !this.columnWidth ) {
|
2563 |
+
var firstItem = this.items[0];
|
2564 |
+
var firstItemElem = firstItem && firstItem.element;
|
2565 |
+
// columnWidth fall back to item of first element
|
2566 |
+
this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth ||
|
2567 |
+
// if first elem has no width, default to size of container
|
2568 |
+
this.containerWidth;
|
2569 |
+
}
|
2570 |
+
|
2571 |
+
var columnWidth = this.columnWidth += this.gutter;
|
2572 |
+
|
2573 |
+
// calculate columns
|
2574 |
+
var containerWidth = this.containerWidth + this.gutter;
|
2575 |
+
var cols = containerWidth / columnWidth;
|
2576 |
+
// fix rounding errors, typically with gutters
|
2577 |
+
var excess = columnWidth - containerWidth % columnWidth;
|
2578 |
+
// if overshoot is less than a pixel, round up, otherwise floor it
|
2579 |
+
var mathMethod = excess && excess < 1 ? 'round' : 'floor';
|
2580 |
+
cols = Math[ mathMethod ]( cols );
|
2581 |
+
this.cols = Math.max( cols, 1 );
|
2582 |
+
};
|
2583 |
+
|
2584 |
+
proto.getContainerWidth = function() {
|
2585 |
+
// container is parent if fit width
|
2586 |
+
var isFitWidth = this._getOption('fitWidth');
|
2587 |
+
var container = isFitWidth ? this.element.parentNode : this.element;
|
2588 |
+
// check that this.size and size are there
|
2589 |
+
// IE8 triggers resize on body size change, so they might not be
|
2590 |
+
var size = getSize( container );
|
2591 |
+
this.containerWidth = size && size.innerWidth;
|
2592 |
+
};
|
2593 |
+
|
2594 |
+
proto._getItemLayoutPosition = function( item ) {
|
2595 |
+
item.getSize();
|
2596 |
+
// how many columns does this brick span
|
2597 |
+
var remainder = item.size.outerWidth % this.columnWidth;
|
2598 |
+
var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil';
|
2599 |
+
// round if off by 1 pixel, otherwise use ceil
|
2600 |
+
var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth );
|
2601 |
+
colSpan = Math.min( colSpan, this.cols );
|
2602 |
+
// use horizontal or top column position
|
2603 |
+
var colPosMethod = this.options.horizontalOrder ?
|
2604 |
+
'_getHorizontalColPosition' : '_getTopColPosition';
|
2605 |
+
var colPosition = this[ colPosMethod ]( colSpan, item );
|
2606 |
+
// position the brick
|
2607 |
+
var position = {
|
2608 |
+
x: this.columnWidth * colPosition.col,
|
2609 |
+
y: colPosition.y
|
2610 |
+
};
|
2611 |
+
// apply setHeight to necessary columns
|
2612 |
+
var setHeight = colPosition.y + item.size.outerHeight;
|
2613 |
+
var setMax = colSpan + colPosition.col;
|
2614 |
+
for ( var i = colPosition.col; i < setMax; i++ ) {
|
2615 |
+
this.colYs[i] = setHeight;
|
2616 |
+
}
|
2617 |
+
|
2618 |
+
return position;
|
2619 |
+
};
|
2620 |
+
|
2621 |
+
proto._getTopColPosition = function( colSpan ) {
|
2622 |
+
var colGroup = this._getTopColGroup( colSpan );
|
2623 |
+
// get the minimum Y value from the columns
|
2624 |
+
var minimumY = Math.min.apply( Math, colGroup );
|
2625 |
+
|
2626 |
+
return {
|
2627 |
+
col: colGroup.indexOf( minimumY ),
|
2628 |
+
y: minimumY,
|
2629 |
+
};
|
2630 |
+
};
|
2631 |
+
|
2632 |
+
/**
|
2633 |
+
* @param {Number} colSpan - number of columns the element spans
|
2634 |
+
* @returns {Array} colGroup
|
2635 |
+
*/
|
2636 |
+
proto._getTopColGroup = function( colSpan ) {
|
2637 |
+
if ( colSpan < 2 ) {
|
2638 |
+
// if brick spans only one column, use all the column Ys
|
2639 |
+
return this.colYs;
|
2640 |
+
}
|
2641 |
+
|
2642 |
+
var colGroup = [];
|
2643 |
+
// how many different places could this brick fit horizontally
|
2644 |
+
var groupCount = this.cols + 1 - colSpan;
|
2645 |
+
// for each group potential horizontal position
|
2646 |
+
for ( var i = 0; i < groupCount; i++ ) {
|
2647 |
+
colGroup[i] = this._getColGroupY( i, colSpan );
|
2648 |
+
}
|
2649 |
+
return colGroup;
|
2650 |
+
};
|
2651 |
+
|
2652 |
+
proto._getColGroupY = function( col, colSpan ) {
|
2653 |
+
if ( colSpan < 2 ) {
|
2654 |
+
return this.colYs[ col ];
|
2655 |
+
}
|
2656 |
+
// make an array of colY values for that one group
|
2657 |
+
var groupColYs = this.colYs.slice( col, col + colSpan );
|
2658 |
+
// and get the max value of the array
|
2659 |
+
return Math.max.apply( Math, groupColYs );
|
2660 |
+
};
|
2661 |
+
|
2662 |
+
// get column position based on horizontal index. #873
|
2663 |
+
proto._getHorizontalColPosition = function( colSpan, item ) {
|
2664 |
+
var col = this.horizontalColIndex % this.cols;
|
2665 |
+
var isOver = colSpan > 1 && col + colSpan > this.cols;
|
2666 |
+
// shift to next row if item can't fit on current row
|
2667 |
+
col = isOver ? 0 : col;
|
2668 |
+
// don't let zero-size items take up space
|
2669 |
+
var hasSize = item.size.outerWidth && item.size.outerHeight;
|
2670 |
+
this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex;
|
2671 |
+
|
2672 |
+
return {
|
2673 |
+
col: col,
|
2674 |
+
y: this._getColGroupY( col, colSpan ),
|
2675 |
+
};
|
2676 |
+
};
|
2677 |
+
|
2678 |
+
proto._manageStamp = function( stamp ) {
|
2679 |
+
var stampSize = getSize( stamp );
|
2680 |
+
var offset = this._getElementOffset( stamp );
|
2681 |
+
// get the columns that this stamp affects
|
2682 |
+
var isOriginLeft = this._getOption('originLeft');
|
2683 |
+
var firstX = isOriginLeft ? offset.left : offset.right;
|
2684 |
+
var lastX = firstX + stampSize.outerWidth;
|
2685 |
+
var firstCol = Math.floor( firstX / this.columnWidth );
|
2686 |
+
firstCol = Math.max( 0, firstCol );
|
2687 |
+
var lastCol = Math.floor( lastX / this.columnWidth );
|
2688 |
+
// lastCol should not go over if multiple of columnWidth #425
|
2689 |
+
lastCol -= lastX % this.columnWidth ? 0 : 1;
|
2690 |
+
lastCol = Math.min( this.cols - 1, lastCol );
|
2691 |
+
// set colYs to bottom of the stamp
|
2692 |
+
|
2693 |
+
var isOriginTop = this._getOption('originTop');
|
2694 |
+
var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) +
|
2695 |
+
stampSize.outerHeight;
|
2696 |
+
for ( var i = firstCol; i <= lastCol; i++ ) {
|
2697 |
+
this.colYs[i] = Math.max( stampMaxY, this.colYs[i] );
|
2698 |
+
}
|
2699 |
+
};
|
2700 |
+
|
2701 |
+
proto._getContainerSize = function() {
|
2702 |
+
this.maxY = Math.max.apply( Math, this.colYs );
|
2703 |
+
var size = {
|
2704 |
+
height: this.maxY
|
2705 |
+
};
|
2706 |
+
|
2707 |
+
if ( this._getOption('fitWidth') ) {
|
2708 |
+
size.width = this._getContainerFitWidth();
|
2709 |
+
}
|
2710 |
+
|
2711 |
+
return size;
|
2712 |
+
};
|
2713 |
+
|
2714 |
+
proto._getContainerFitWidth = function() {
|
2715 |
+
var unusedCols = 0;
|
2716 |
+
// count unused columns
|
2717 |
+
var i = this.cols;
|
2718 |
+
while ( --i ) {
|
2719 |
+
if ( this.colYs[i] !== 0 ) {
|
2720 |
+
break;
|
2721 |
+
}
|
2722 |
+
unusedCols++;
|
2723 |
+
}
|
2724 |
+
// fit container to columns that have been used
|
2725 |
+
return ( this.cols - unusedCols ) * this.columnWidth - this.gutter;
|
2726 |
+
};
|
2727 |
+
|
2728 |
+
proto.needsResizeLayout = function() {
|
2729 |
+
var previousWidth = this.containerWidth;
|
2730 |
+
this.getContainerWidth();
|
2731 |
+
return previousWidth != this.containerWidth;
|
2732 |
+
};
|
2733 |
+
|
2734 |
+
return Masonry;
|
2735 |
+
|
2736 |
+
}));
|
2737 |
+
|
2738 |
+
/*!
|
2739 |
+
* Masonry layout mode
|
2740 |
+
* sub-classes Masonry
|
2741 |
+
* http://masonry.desandro.com
|
2742 |
+
*/
|
2743 |
+
|
2744 |
+
( function( window, factory ) {
|
2745 |
+
// universal module definition
|
2746 |
+
/* jshint strict: false */ /*globals define, module, require */
|
2747 |
+
if ( typeof define == 'function' && define.amd ) {
|
2748 |
+
// AMD
|
2749 |
+
define( 'isotope/js/layout-modes/masonry',[
|
2750 |
+
'../layout-mode',
|
2751 |
+
'masonry/masonry'
|
2752 |
+
],
|
2753 |
+
factory );
|
2754 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
2755 |
+
// CommonJS
|
2756 |
+
module.exports = factory(
|
2757 |
+
require('../layout-mode'),
|
2758 |
+
require('masonry-layout')
|
2759 |
+
);
|
2760 |
+
} else {
|
2761 |
+
// browser global
|
2762 |
+
factory(
|
2763 |
+
window.Isotope.LayoutMode,
|
2764 |
+
window.Masonry
|
2765 |
+
);
|
2766 |
+
}
|
2767 |
+
|
2768 |
+
}( window, function factory( LayoutMode, Masonry ) {
|
2769 |
+
'use strict';
|
2770 |
+
|
2771 |
+
// -------------------------- masonryDefinition -------------------------- //
|
2772 |
+
|
2773 |
+
// create an Outlayer layout class
|
2774 |
+
var MasonryMode = LayoutMode.create('masonry');
|
2775 |
+
|
2776 |
+
var proto = MasonryMode.prototype;
|
2777 |
+
|
2778 |
+
var keepModeMethods = {
|
2779 |
+
_getElementOffset: true,
|
2780 |
+
layout: true,
|
2781 |
+
_getMeasurement: true
|
2782 |
+
};
|
2783 |
+
|
2784 |
+
// inherit Masonry prototype
|
2785 |
+
for ( var method in Masonry.prototype ) {
|
2786 |
+
// do not inherit mode methods
|
2787 |
+
if ( !keepModeMethods[ method ] ) {
|
2788 |
+
proto[ method ] = Masonry.prototype[ method ];
|
2789 |
+
}
|
2790 |
+
}
|
2791 |
+
|
2792 |
+
var measureColumns = proto.measureColumns;
|
2793 |
+
proto.measureColumns = function() {
|
2794 |
+
// set items, used if measuring first item
|
2795 |
+
this.items = this.isotope.filteredItems;
|
2796 |
+
measureColumns.call( this );
|
2797 |
+
};
|
2798 |
+
|
2799 |
+
// point to mode options for fitWidth
|
2800 |
+
var _getOption = proto._getOption;
|
2801 |
+
proto._getOption = function( option ) {
|
2802 |
+
if ( option == 'fitWidth' ) {
|
2803 |
+
return this.options.isFitWidth !== undefined ?
|
2804 |
+
this.options.isFitWidth : this.options.fitWidth;
|
2805 |
+
}
|
2806 |
+
return _getOption.apply( this.isotope, arguments );
|
2807 |
+
};
|
2808 |
+
|
2809 |
+
return MasonryMode;
|
2810 |
+
|
2811 |
+
}));
|
2812 |
+
|
2813 |
+
/**
|
2814 |
+
* fitRows layout mode
|
2815 |
+
*/
|
2816 |
+
|
2817 |
+
( function( window, factory ) {
|
2818 |
+
// universal module definition
|
2819 |
+
/* jshint strict: false */ /*globals define, module, require */
|
2820 |
+
if ( typeof define == 'function' && define.amd ) {
|
2821 |
+
// AMD
|
2822 |
+
define( 'isotope/js/layout-modes/fit-rows',[
|
2823 |
+
'../layout-mode'
|
2824 |
+
],
|
2825 |
+
factory );
|
2826 |
+
} else if ( typeof exports == 'object' ) {
|
2827 |
+
// CommonJS
|
2828 |
+
module.exports = factory(
|
2829 |
+
require('../layout-mode')
|
2830 |
+
);
|
2831 |
+
} else {
|
2832 |
+
// browser global
|
2833 |
+
factory(
|
2834 |
+
window.Isotope.LayoutMode
|
2835 |
+
);
|
2836 |
+
}
|
2837 |
+
|
2838 |
+
}( window, function factory( LayoutMode ) {
|
2839 |
+
'use strict';
|
2840 |
+
|
2841 |
+
var FitRows = LayoutMode.create('fitRows');
|
2842 |
+
|
2843 |
+
var proto = FitRows.prototype;
|
2844 |
+
|
2845 |
+
proto._resetLayout = function() {
|
2846 |
+
this.x = 0;
|
2847 |
+
this.y = 0;
|
2848 |
+
this.maxY = 0;
|
2849 |
+
this._getMeasurement( 'gutter', 'outerWidth' );
|
2850 |
+
};
|
2851 |
+
|
2852 |
+
proto._getItemLayoutPosition = function( item ) {
|
2853 |
+
item.getSize();
|
2854 |
+
|
2855 |
+
var itemWidth = item.size.outerWidth + this.gutter;
|
2856 |
+
// if this element cannot fit in the current row
|
2857 |
+
var containerWidth = this.isotope.size.innerWidth + this.gutter;
|
2858 |
+
if ( this.x !== 0 && itemWidth + this.x > containerWidth ) {
|
2859 |
+
this.x = 0;
|
2860 |
+
this.y = this.maxY;
|
2861 |
+
}
|
2862 |
+
|
2863 |
+
var position = {
|
2864 |
+
x: this.x,
|
2865 |
+
y: this.y
|
2866 |
+
};
|
2867 |
+
|
2868 |
+
this.maxY = Math.max( this.maxY, this.y + item.size.outerHeight );
|
2869 |
+
this.x += itemWidth;
|
2870 |
+
|
2871 |
+
return position;
|
2872 |
+
};
|
2873 |
+
|
2874 |
+
proto._getContainerSize = function() {
|
2875 |
+
return { height: this.maxY };
|
2876 |
+
};
|
2877 |
+
|
2878 |
+
return FitRows;
|
2879 |
+
|
2880 |
+
}));
|
2881 |
+
|
2882 |
+
/**
|
2883 |
+
* vertical layout mode
|
2884 |
+
*/
|
2885 |
+
|
2886 |
+
( function( window, factory ) {
|
2887 |
+
// universal module definition
|
2888 |
+
/* jshint strict: false */ /*globals define, module, require */
|
2889 |
+
if ( typeof define == 'function' && define.amd ) {
|
2890 |
+
// AMD
|
2891 |
+
define( 'isotope/js/layout-modes/vertical',[
|
2892 |
+
'../layout-mode'
|
2893 |
+
],
|
2894 |
+
factory );
|
2895 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
2896 |
+
// CommonJS
|
2897 |
+
module.exports = factory(
|
2898 |
+
require('../layout-mode')
|
2899 |
+
);
|
2900 |
+
} else {
|
2901 |
+
// browser global
|
2902 |
+
factory(
|
2903 |
+
window.Isotope.LayoutMode
|
2904 |
+
);
|
2905 |
+
}
|
2906 |
+
|
2907 |
+
}( window, function factory( LayoutMode ) {
|
2908 |
+
'use strict';
|
2909 |
+
|
2910 |
+
var Vertical = LayoutMode.create( 'vertical', {
|
2911 |
+
horizontalAlignment: 0
|
2912 |
+
});
|
2913 |
+
|
2914 |
+
var proto = Vertical.prototype;
|
2915 |
+
|
2916 |
+
proto._resetLayout = function() {
|
2917 |
+
this.y = 0;
|
2918 |
+
};
|
2919 |
+
|
2920 |
+
proto._getItemLayoutPosition = function( item ) {
|
2921 |
+
item.getSize();
|
2922 |
+
var x = ( this.isotope.size.innerWidth - item.size.outerWidth ) *
|
2923 |
+
this.options.horizontalAlignment;
|
2924 |
+
var y = this.y;
|
2925 |
+
this.y += item.size.outerHeight;
|
2926 |
+
return { x: x, y: y };
|
2927 |
+
};
|
2928 |
+
|
2929 |
+
proto._getContainerSize = function() {
|
2930 |
+
return { height: this.y };
|
2931 |
+
};
|
2932 |
+
|
2933 |
+
return Vertical;
|
2934 |
+
|
2935 |
+
}));
|
2936 |
+
|
2937 |
+
/*!
|
2938 |
+
* Isotope v3.0.4
|
2939 |
+
*
|
2940 |
+
* Licensed GPLv3 for open source use
|
2941 |
+
* or Isotope Commercial License for commercial use
|
2942 |
+
*
|
2943 |
+
* http://isotope.metafizzy.co
|
2944 |
+
* Copyright 2017 Metafizzy
|
2945 |
+
*/
|
2946 |
+
|
2947 |
+
( function( window, factory ) {
|
2948 |
+
// universal module definition
|
2949 |
+
/* jshint strict: false */ /*globals define, module, require */
|
2950 |
+
if ( typeof define == 'function' && define.amd ) {
|
2951 |
+
// AMD
|
2952 |
+
define( [
|
2953 |
+
'outlayer/outlayer',
|
2954 |
+
'get-size/get-size',
|
2955 |
+
'desandro-matches-selector/matches-selector',
|
2956 |
+
'fizzy-ui-utils/utils',
|
2957 |
+
'isotope/js/item',
|
2958 |
+
'isotope/js/layout-mode',
|
2959 |
+
// include default layout modes
|
2960 |
+
'isotope/js/layout-modes/masonry',
|
2961 |
+
'isotope/js/layout-modes/fit-rows',
|
2962 |
+
'isotope/js/layout-modes/vertical'
|
2963 |
+
],
|
2964 |
+
function( Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ) {
|
2965 |
+
return factory( window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode );
|
2966 |
+
});
|
2967 |
+
} else if ( typeof module == 'object' && module.exports ) {
|
2968 |
+
// CommonJS
|
2969 |
+
module.exports = factory(
|
2970 |
+
window,
|
2971 |
+
require('outlayer'),
|
2972 |
+
require('get-size'),
|
2973 |
+
require('desandro-matches-selector'),
|
2974 |
+
require('fizzy-ui-utils'),
|
2975 |
+
require('isotope/js/item'),
|
2976 |
+
require('isotope/js/layout-mode'),
|
2977 |
+
// include default layout modes
|
2978 |
+
require('isotope/js/layout-modes/masonry'),
|
2979 |
+
require('isotope/js/layout-modes/fit-rows'),
|
2980 |
+
require('isotope/js/layout-modes/vertical')
|
2981 |
+
);
|
2982 |
+
} else {
|
2983 |
+
// browser global
|
2984 |
+
window.Isotope = factory(
|
2985 |
+
window,
|
2986 |
+
window.Outlayer,
|
2987 |
+
window.getSize,
|
2988 |
+
window.matchesSelector,
|
2989 |
+
window.fizzyUIUtils,
|
2990 |
+
window.Isotope.Item,
|
2991 |
+
window.Isotope.LayoutMode
|
2992 |
+
);
|
2993 |
+
}
|
2994 |
+
|
2995 |
+
}( window, function factory( window, Outlayer, getSize, matchesSelector, utils,
|
2996 |
+
Item, LayoutMode ) {
|
2997 |
+
|
2998 |
+
|
2999 |
+
|
3000 |
+
// -------------------------- vars -------------------------- //
|
3001 |
+
|
3002 |
+
var jQuery = window.jQuery;
|
3003 |
+
|
3004 |
+
// -------------------------- helpers -------------------------- //
|
3005 |
+
|
3006 |
+
var trim = String.prototype.trim ?
|
3007 |
+
function( str ) {
|
3008 |
+
return str.trim();
|
3009 |
+
} :
|
3010 |
+
function( str ) {
|
3011 |
+
return str.replace( /^\s+|\s+$/g, '' );
|
3012 |
+
};
|
3013 |
+
|
3014 |
+
// -------------------------- isotopeDefinition -------------------------- //
|
3015 |
+
|
3016 |
+
// create an Outlayer layout class
|
3017 |
+
var Isotope = Outlayer.create( 'isotope', {
|
3018 |
+
layoutMode: 'masonry',
|
3019 |
+
isJQueryFiltering: true,
|
3020 |
+
sortAscending: true
|
3021 |
+
});
|
3022 |
+
|
3023 |
+
Isotope.Item = Item;
|
3024 |
+
Isotope.LayoutMode = LayoutMode;
|
3025 |
+
|
3026 |
+
var proto = Isotope.prototype;
|
3027 |
+
|
3028 |
+
proto._create = function() {
|
3029 |
+
this.itemGUID = 0;
|
3030 |
+
// functions that sort items
|
3031 |
+
this._sorters = {};
|
3032 |
+
this._getSorters();
|
3033 |
+
// call super
|
3034 |
+
Outlayer.prototype._create.call( this );
|
3035 |
+
|
3036 |
+
// create layout modes
|
3037 |
+
this.modes = {};
|
3038 |
+
// start filteredItems with all items
|
3039 |
+
this.filteredItems = this.items;
|
3040 |
+
// keep of track of sortBys
|
3041 |
+
this.sortHistory = [ 'original-order' ];
|
3042 |
+
// create from registered layout modes
|
3043 |
+
for ( var name in LayoutMode.modes ) {
|
3044 |
+
this._initLayoutMode( name );
|
3045 |
+
}
|
3046 |
+
};
|
3047 |
+
|
3048 |
+
proto.reloadItems = function() {
|
3049 |
+
// reset item ID counter
|
3050 |
+
this.itemGUID = 0;
|
3051 |
+
// call super
|
3052 |
+
Outlayer.prototype.reloadItems.call( this );
|
3053 |
+
};
|
3054 |
+
|
3055 |
+
proto._itemize = function() {
|
3056 |
+
var items = Outlayer.prototype._itemize.apply( this, arguments );
|
3057 |
+
// assign ID for original-order
|
3058 |
+
for ( var i=0; i < items.length; i++ ) {
|
3059 |
+
var item = items[i];
|
3060 |
+
item.id = this.itemGUID++;
|
3061 |
+
}
|
3062 |
+
this._updateItemsSortData( items );
|
3063 |
+
return items;
|
3064 |
+
};
|
3065 |
+
|
3066 |
+
|
3067 |
+
// -------------------------- layout -------------------------- //
|
3068 |
+
|
3069 |
+
proto._initLayoutMode = function( name ) {
|
3070 |
+
var Mode = LayoutMode.modes[ name ];
|
3071 |
+
// set mode options
|
3072 |
+
// HACK extend initial options, back-fill in default options
|
3073 |
+
var initialOpts = this.options[ name ] || {};
|
3074 |
+
this.options[ name ] = Mode.options ?
|
3075 |
+
utils.extend( Mode.options, initialOpts ) : initialOpts;
|
3076 |
+
// init layout mode instance
|
3077 |
+
this.modes[ name ] = new Mode( this );
|
3078 |
+
};
|
3079 |
+
|
3080 |
+
|
3081 |
+
proto.layout = function() {
|
3082 |
+
// if first time doing layout, do all magic
|
3083 |
+
if ( !this._isLayoutInited && this._getOption('initLayout') ) {
|
3084 |
+
this.arrange();
|
3085 |
+
return;
|
3086 |
+
}
|
3087 |
+
this._layout();
|
3088 |
+
};
|
3089 |
+
|
3090 |
+
// private method to be used in layout() & magic()
|
3091 |
+
proto._layout = function() {
|
3092 |
+
// don't animate first layout
|
3093 |
+
var isInstant = this._getIsInstant();
|
3094 |
+
// layout flow
|
3095 |
+
this._resetLayout();
|
3096 |
+
this._manageStamps();
|
3097 |
+
this.layoutItems( this.filteredItems, isInstant );
|
3098 |
+
|
3099 |
+
// flag for initalized
|
3100 |
+
this._isLayoutInited = true;
|
3101 |
+
};
|
3102 |
+
|
3103 |
+
// filter + sort + layout
|
3104 |
+
proto.arrange = function( opts ) {
|
3105 |
+
// set any options pass
|
3106 |
+
this.option( opts );
|
3107 |
+
this._getIsInstant();
|
3108 |
+
// filter, sort, and layout
|
3109 |
+
|
3110 |
+
// filter
|
3111 |
+
var filtered = this._filter( this.items );
|
3112 |
+
this.filteredItems = filtered.matches;
|
3113 |
+
|
3114 |
+
this._bindArrangeComplete();
|
3115 |
+
|
3116 |
+
if ( this._isInstant ) {
|
3117 |
+
this._noTransition( this._hideReveal, [ filtered ] );
|
3118 |
+
} else {
|
3119 |
+
this._hideReveal( filtered );
|
3120 |
+
}
|
3121 |
+
|
3122 |
+
this._sort();
|
3123 |
+
this._layout();
|
3124 |
+
};
|
3125 |
+
// alias to _init for main plugin method
|
3126 |
+
proto._init = proto.arrange;
|
3127 |
+
|
3128 |
+
proto._hideReveal = function( filtered ) {
|
3129 |
+
this.reveal( filtered.needReveal );
|
3130 |
+
this.hide( filtered.needHide );
|
3131 |
+
};
|
3132 |
+
|
3133 |
+
// HACK
|
3134 |
+
// Don't animate/transition first layout
|
3135 |
+
// Or don't animate/transition other layouts
|
3136 |
+
proto._getIsInstant = function() {
|
3137 |
+
var isLayoutInstant = this._getOption('layoutInstant');
|
3138 |
+
var isInstant = isLayoutInstant !== undefined ? isLayoutInstant :
|
3139 |
+
!this._isLayoutInited;
|
3140 |
+
this._isInstant = isInstant;
|
3141 |
+
return isInstant;
|
3142 |
+
};
|
3143 |
+
|
3144 |
+
// listen for layoutComplete, hideComplete and revealComplete
|
3145 |
+
// to trigger arrangeComplete
|
3146 |
+
proto._bindArrangeComplete = function() {
|
3147 |
+
// listen for 3 events to trigger arrangeComplete
|
3148 |
+
var isLayoutComplete, isHideComplete, isRevealComplete;
|
3149 |
+
var _this = this;
|
3150 |
+
function arrangeParallelCallback() {
|
3151 |
+
if ( isLayoutComplete && isHideComplete && isRevealComplete ) {
|
3152 |
+
_this.dispatchEvent( 'arrangeComplete', null, [ _this.filteredItems ] );
|
3153 |
+
}
|
3154 |
+
}
|
3155 |
+
this.once( 'layoutComplete', function() {
|
3156 |
+
isLayoutComplete = true;
|
3157 |
+
arrangeParallelCallback();
|
3158 |
+
});
|
3159 |
+
this.once( 'hideComplete', function() {
|
3160 |
+
isHideComplete = true;
|
3161 |
+
arrangeParallelCallback();
|
3162 |
+
});
|
3163 |
+
this.once( 'revealComplete', function() {
|
3164 |
+
isRevealComplete = true;
|
3165 |
+
arrangeParallelCallback();
|
3166 |
+
});
|
3167 |
+
};
|
3168 |
+
|
3169 |
+
// -------------------------- filter -------------------------- //
|
3170 |
+
|
3171 |
+
proto._filter = function( items ) {
|
3172 |
+
var filter = this.options.filter;
|
3173 |
+
filter = filter || '*';
|
3174 |
+
var matches = [];
|
3175 |
+
var hiddenMatched = [];
|
3176 |
+
var visibleUnmatched = [];
|
3177 |
+
|
3178 |
+
var test = this._getFilterTest( filter );
|
3179 |
+
|
3180 |
+
// test each item
|
3181 |
+
for ( var i=0; i < items.length; i++ ) {
|
3182 |
+
var item = items[i];
|
3183 |
+
if ( item.isIgnored ) {
|
3184 |
+
continue;
|
3185 |
+
}
|
3186 |
+
// add item to either matched or unmatched group
|
3187 |
+
var isMatched = test( item );
|
3188 |
+
// item.isFilterMatched = isMatched;
|
3189 |
+
// add to matches if its a match
|
3190 |
+
if ( isMatched ) {
|
3191 |
+
matches.push( item );
|
3192 |
+
}
|
3193 |
+
// add to additional group if item needs to be hidden or revealed
|
3194 |
+
if ( isMatched && item.isHidden ) {
|
3195 |
+
hiddenMatched.push( item );
|
3196 |
+
} else if ( !isMatched && !item.isHidden ) {
|
3197 |
+
visibleUnmatched.push( item );
|
3198 |
+
}
|
3199 |
+
}
|
3200 |
+
|
3201 |
+
// return collections of items to be manipulated
|
3202 |
+
return {
|
3203 |
+
matches: matches,
|
3204 |
+
needReveal: hiddenMatched,
|
3205 |
+
needHide: visibleUnmatched
|
3206 |
+
};
|
3207 |
+
};
|
3208 |
+
|
3209 |
+
// get a jQuery, function, or a matchesSelector test given the filter
|
3210 |
+
proto._getFilterTest = function( filter ) {
|
3211 |
+
if ( jQuery && this.options.isJQueryFiltering ) {
|
3212 |
+
// use jQuery
|
3213 |
+
return function( item ) {
|
3214 |
+
return jQuery( item.element ).is( filter );
|
3215 |
+
};
|
3216 |
+
}
|
3217 |
+
if ( typeof filter == 'function' ) {
|
3218 |
+
// use filter as function
|
3219 |
+
return function( item ) {
|
3220 |
+
return filter( item.element );
|
3221 |
+
};
|
3222 |
+
}
|
3223 |
+
// default, use filter as selector string
|
3224 |
+
return function( item ) {
|
3225 |
+
return matchesSelector( item.element, filter );
|
3226 |
+
};
|
3227 |
+
};
|
3228 |
+
|
3229 |
+
// -------------------------- sorting -------------------------- //
|
3230 |
+
|
3231 |
+
/**
|
3232 |
+
* @params {Array} elems
|
3233 |
+
* @public
|
3234 |
+
*/
|
3235 |
+
proto.updateSortData = function( elems ) {
|
3236 |
+
// get items
|
3237 |
+
var items;
|
3238 |
+
if ( elems ) {
|
3239 |
+
elems = utils.makeArray( elems );
|
3240 |
+
items = this.getItems( elems );
|
3241 |
+
} else {
|
3242 |
+
// update all items if no elems provided
|
3243 |
+
items = this.items;
|
3244 |
+
}
|
3245 |
+
|
3246 |
+
this._getSorters();
|
3247 |
+
this._updateItemsSortData( items );
|
3248 |
+
};
|
3249 |
+
|
3250 |
+
proto._getSorters = function() {
|
3251 |
+
var getSortData = this.options.getSortData;
|
3252 |
+
for ( var key in getSortData ) {
|
3253 |
+
var sorter = getSortData[ key ];
|
3254 |
+
this._sorters[ key ] = mungeSorter( sorter );
|
3255 |
+
}
|
3256 |
+
};
|
3257 |
+
|
3258 |
+
/**
|
3259 |
+
* @params {Array} items - of Isotope.Items
|
3260 |
+
* @private
|
3261 |
+
*/
|
3262 |
+
proto._updateItemsSortData = function( items ) {
|
3263 |
+
// do not update if no items
|
3264 |
+
var len = items && items.length;
|
3265 |
+
|
3266 |
+
for ( var i=0; len && i < len; i++ ) {
|
3267 |
+
var item = items[i];
|
3268 |
+
item.updateSortData();
|
3269 |
+
}
|
3270 |
+
};
|
3271 |
+
|
3272 |
+
// ----- munge sorter ----- //
|
3273 |
+
|
3274 |
+
// encapsulate this, as we just need mungeSorter
|
3275 |
+
// other functions in here are just for munging
|
3276 |
+
var mungeSorter = ( function() {
|
3277 |
+
// add a magic layer to sorters for convienent shorthands
|
3278 |
+
// `.foo-bar` will use the text of .foo-bar querySelector
|
3279 |
+
// `[foo-bar]` will use attribute
|
3280 |
+
// you can also add parser
|
3281 |
+
// `.foo-bar parseInt` will parse that as a number
|
3282 |
+
function mungeSorter( sorter ) {
|
3283 |
+
// if not a string, return function or whatever it is
|
3284 |
+
if ( typeof sorter != 'string' ) {
|
3285 |
+
return sorter;
|
3286 |
+
}
|
3287 |
+
// parse the sorter string
|
3288 |
+
var args = trim( sorter ).split(' ');
|
3289 |
+
var query = args[0];
|
3290 |
+
// check if query looks like [an-attribute]
|
3291 |
+
var attrMatch = query.match( /^\[(.+)\]$/ );
|
3292 |
+
var attr = attrMatch && attrMatch[1];
|
3293 |
+
var getValue = getValueGetter( attr, query );
|
3294 |
+
// use second argument as a parser
|
3295 |
+
var parser = Isotope.sortDataParsers[ args[1] ];
|
3296 |
+
// parse the value, if there was a parser
|
3297 |
+
sorter = parser ? function( elem ) {
|
3298 |
+
return elem && parser( getValue( elem ) );
|
3299 |
+
} :
|
3300 |
+
// otherwise just return value
|
3301 |
+
function( elem ) {
|
3302 |
+
return elem && getValue( elem );
|
3303 |
+
};
|
3304 |
+
|
3305 |
+
return sorter;
|
3306 |
+
}
|
3307 |
+
|
3308 |
+
// get an attribute getter, or get text of the querySelector
|
3309 |
+
function getValueGetter( attr, query ) {
|
3310 |
+
// if query looks like [foo-bar], get attribute
|
3311 |
+
if ( attr ) {
|
3312 |
+
return function getAttribute( elem ) {
|
3313 |
+
return elem.getAttribute( attr );
|
3314 |
+
};
|
3315 |
+
}
|
3316 |
+
|
3317 |
+
// otherwise, assume its a querySelector, and get its text
|
3318 |
+
return function getChildText( elem ) {
|
3319 |
+
var child = elem.querySelector( query );
|
3320 |
+
return child && child.textContent;
|
3321 |
+
};
|
3322 |
+
}
|
3323 |
+
|
3324 |
+
return mungeSorter;
|
3325 |
+
})();
|
3326 |
+
|
3327 |
+
// parsers used in getSortData shortcut strings
|
3328 |
+
Isotope.sortDataParsers = {
|
3329 |
+
'parseInt': function( val ) {
|
3330 |
+
return parseInt( val, 10 );
|
3331 |
+
},
|
3332 |
+
'parseFloat': function( val ) {
|
3333 |
+
return parseFloat( val );
|
3334 |
+
}
|
3335 |
+
};
|
3336 |
+
|
3337 |
+
// ----- sort method ----- //
|
3338 |
+
|
3339 |
+
// sort filteredItem order
|
3340 |
+
proto._sort = function() {
|
3341 |
+
if ( !this.options.sortBy ) {
|
3342 |
+
return;
|
3343 |
+
}
|
3344 |
+
// keep track of sortBy History
|
3345 |
+
var sortBys = utils.makeArray( this.options.sortBy );
|
3346 |
+
if ( !this._getIsSameSortBy( sortBys ) ) {
|
3347 |
+
// concat all sortBy and sortHistory, add to front, oldest goes in last
|
3348 |
+
this.sortHistory = sortBys.concat( this.sortHistory );
|
3349 |
+
}
|
3350 |
+
// sort magic
|
3351 |
+
var itemSorter = getItemSorter( this.sortHistory, this.options.sortAscending );
|
3352 |
+
this.filteredItems.sort( itemSorter );
|
3353 |
+
};
|
3354 |
+
|
3355 |
+
// check if sortBys is same as start of sortHistory
|
3356 |
+
proto._getIsSameSortBy = function( sortBys ) {
|
3357 |
+
for ( var i=0; i < sortBys.length; i++ ) {
|
3358 |
+
if ( sortBys[i] != this.sortHistory[i] ) {
|
3359 |
+
return false;
|
3360 |
+
}
|
3361 |
+
}
|
3362 |
+
return true;
|
3363 |
+
};
|
3364 |
+
|
3365 |
+
// returns a function used for sorting
|
3366 |
+
function getItemSorter( sortBys, sortAsc ) {
|
3367 |
+
return function sorter( itemA, itemB ) {
|
3368 |
+
// cycle through all sortKeys
|
3369 |
+
for ( var i = 0; i < sortBys.length; i++ ) {
|
3370 |
+
var sortBy = sortBys[i];
|
3371 |
+
var a = itemA.sortData[ sortBy ];
|
3372 |
+
var b = itemB.sortData[ sortBy ];
|
3373 |
+
if ( a > b || a < b ) {
|
3374 |
+
// if sortAsc is an object, use the value given the sortBy key
|
3375 |
+
var isAscending = sortAsc[ sortBy ] !== undefined ? sortAsc[ sortBy ] : sortAsc;
|
3376 |
+
var direction = isAscending ? 1 : -1;
|
3377 |
+
return ( a > b ? 1 : -1 ) * direction;
|
3378 |
+
}
|
3379 |
+
}
|
3380 |
+
return 0;
|
3381 |
+
};
|
3382 |
+
}
|
3383 |
+
|
3384 |
+
// -------------------------- methods -------------------------- //
|
3385 |
+
|
3386 |
+
// get layout mode
|
3387 |
+
proto._mode = function() {
|
3388 |
+
var layoutMode = this.options.layoutMode;
|
3389 |
+
var mode = this.modes[ layoutMode ];
|
3390 |
+
if ( !mode ) {
|
3391 |
+
// TODO console.error
|
3392 |
+
throw new Error( 'No layout mode: ' + layoutMode );
|
3393 |
+
}
|
3394 |
+
// HACK sync mode's options
|
3395 |
+
// any options set after init for layout mode need to be synced
|
3396 |
+
mode.options = this.options[ layoutMode ];
|
3397 |
+
return mode;
|
3398 |
+
};
|
3399 |
+
|
3400 |
+
proto._resetLayout = function() {
|
3401 |
+
// trigger original reset layout
|
3402 |
+
Outlayer.prototype._resetLayout.call( this );
|
3403 |
+
this._mode()._resetLayout();
|
3404 |
+
};
|
3405 |
+
|
3406 |
+
proto._getItemLayoutPosition = function( item ) {
|
3407 |
+
return this._mode()._getItemLayoutPosition( item );
|
3408 |
+
};
|
3409 |
+
|
3410 |
+
proto._manageStamp = function( stamp ) {
|
3411 |
+
this._mode()._manageStamp( stamp );
|
3412 |
+
};
|
3413 |
+
|
3414 |
+
proto._getContainerSize = function() {
|
3415 |
+
return this._mode()._getContainerSize();
|
3416 |
+
};
|
3417 |
+
|
3418 |
+
proto.needsResizeLayout = function() {
|
3419 |
+
return this._mode().needsResizeLayout();
|
3420 |
+
};
|
3421 |
+
|
3422 |
+
// -------------------------- adding & removing -------------------------- //
|
3423 |
+
|
3424 |
+
// HEADS UP overwrites default Outlayer appended
|
3425 |
+
proto.appended = function( elems ) {
|
3426 |
+
var items = this.addItems( elems );
|
3427 |
+
if ( !items.length ) {
|
3428 |
+
return;
|
3429 |
+
}
|
3430 |
+
// filter, layout, reveal new items
|
3431 |
+
var filteredItems = this._filterRevealAdded( items );
|
3432 |
+
// add to filteredItems
|
3433 |
+
this.filteredItems = this.filteredItems.concat( filteredItems );
|
3434 |
+
};
|
3435 |
+
|
3436 |
+
// HEADS UP overwrites default Outlayer prepended
|
3437 |
+
proto.prepended = function( elems ) {
|
3438 |
+
var items = this._itemize( elems );
|
3439 |
+
if ( !items.length ) {
|
3440 |
+
return;
|
3441 |
+
}
|
3442 |
+
// start new layout
|
3443 |
+
this._resetLayout();
|
3444 |
+
this._manageStamps();
|
3445 |
+
// filter, layout, reveal new items
|
3446 |
+
var filteredItems = this._filterRevealAdded( items );
|
3447 |
+
// layout previous items
|
3448 |
+
this.layoutItems( this.filteredItems );
|
3449 |
+
// add to items and filteredItems
|
3450 |
+
this.filteredItems = filteredItems.concat( this.filteredItems );
|
3451 |
+
this.items = items.concat( this.items );
|
3452 |
+
};
|
3453 |
+
|
3454 |
+
proto._filterRevealAdded = function( items ) {
|
3455 |
+
var filtered = this._filter( items );
|
3456 |
+
this.hide( filtered.needHide );
|
3457 |
+
// reveal all new items
|
3458 |
+
this.reveal( filtered.matches );
|
3459 |
+
// layout new items, no transition
|
3460 |
+
this.layoutItems( filtered.matches, true );
|
3461 |
+
return filtered.matches;
|
3462 |
+
};
|
3463 |
+
|
3464 |
+
/**
|
3465 |
+
* Filter, sort, and layout newly-appended item elements
|
3466 |
+
* @param {Array or NodeList or Element} elems
|
3467 |
+
*/
|
3468 |
+
proto.insert = function( elems ) {
|
3469 |
+
var items = this.addItems( elems );
|
3470 |
+
if ( !items.length ) {
|
3471 |
+
return;
|
3472 |
+
}
|
3473 |
+
// append item elements
|
3474 |
+
var i, item;
|
3475 |
+
var len = items.length;
|
3476 |
+
for ( i=0; i < len; i++ ) {
|
3477 |
+
item = items[i];
|
3478 |
+
this.element.appendChild( item.element );
|
3479 |
+
}
|
3480 |
+
// filter new stuff
|
3481 |
+
var filteredInsertItems = this._filter( items ).matches;
|
3482 |
+
// set flag
|
3483 |
+
for ( i=0; i < len; i++ ) {
|
3484 |
+
items[i].isLayoutInstant = true;
|
3485 |
+
}
|
3486 |
+
this.arrange();
|
3487 |
+
// reset flag
|
3488 |
+
for ( i=0; i < len; i++ ) {
|
3489 |
+
delete items[i].isLayoutInstant;
|
3490 |
+
}
|
3491 |
+
this.reveal( filteredInsertItems );
|
3492 |
+
};
|
3493 |
+
|
3494 |
+
var _remove = proto.remove;
|
3495 |
+
proto.remove = function( elems ) {
|
3496 |
+
elems = utils.makeArray( elems );
|
3497 |
+
var removeItems = this.getItems( elems );
|
3498 |
+
// do regular thing
|
3499 |
+
_remove.call( this, elems );
|
3500 |
+
// bail if no items to remove
|
3501 |
+
var len = removeItems && removeItems.length;
|
3502 |
+
// remove elems from filteredItems
|
3503 |
+
for ( var i=0; len && i < len; i++ ) {
|
3504 |
+
var item = removeItems[i];
|
3505 |
+
// remove item from collection
|
3506 |
+
utils.removeFrom( this.filteredItems, item );
|
3507 |
+
}
|
3508 |
+
};
|
3509 |
+
|
3510 |
+
proto.shuffle = function() {
|
3511 |
+
// update random sortData
|
3512 |
+
for ( var i=0; i < this.items.length; i++ ) {
|
3513 |
+
var item = this.items[i];
|
3514 |
+
item.sortData.random = Math.random();
|
3515 |
+
}
|
3516 |
+
this.options.sortBy = 'random';
|
3517 |
+
this._sort();
|
3518 |
+
this._layout();
|
3519 |
+
};
|
3520 |
+
|
3521 |
+
/**
|
3522 |
+
* trigger fn without transition
|
3523 |
+
* kind of hacky to have this in the first place
|
3524 |
+
* @param {Function} fn
|
3525 |
+
* @param {Array} args
|
3526 |
+
* @returns ret
|
3527 |
+
* @private
|
3528 |
+
*/
|
3529 |
+
proto._noTransition = function( fn, args ) {
|
3530 |
+
// save transitionDuration before disabling
|
3531 |
+
var transitionDuration = this.options.transitionDuration;
|
3532 |
+
// disable transition
|
3533 |
+
this.options.transitionDuration = 0;
|
3534 |
+
// do it
|
3535 |
+
var returnValue = fn.apply( this, args );
|
3536 |
+
// re-enable transition for reveal
|
3537 |
+
this.options.transitionDuration = transitionDuration;
|
3538 |
+
return returnValue;
|
3539 |
+
};
|
3540 |
+
|
3541 |
+
// ----- helper methods ----- //
|
3542 |
+
|
3543 |
+
/**
|
3544 |
+
* getter method for getting filtered item elements
|
3545 |
+
* @returns {Array} elems - collection of item elements
|
3546 |
+
*/
|
3547 |
+
proto.getFilteredItemElements = function() {
|
3548 |
+
return this.filteredItems.map( function( item ) {
|
3549 |
+
return item.element;
|
3550 |
+
});
|
3551 |
+
};
|
3552 |
+
|
3553 |
+
// ----- ----- //
|
3554 |
+
|
3555 |
+
return Isotope;
|
3556 |
+
|
3557 |
+
}));
|
js/lib/isotope.pkgd.min.js
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
* Isotope PACKAGED v3.0.4
|
3 |
+
*
|
4 |
+
* Licensed GPLv3 for open source use
|
5 |
+
* or Isotope Commercial License for commercial use
|
6 |
+
*
|
7 |
+
* http://isotope.metafizzy.co
|
8 |
+
* Copyright 2017 Metafizzy
|
9 |
+
*/
|
10 |
+
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],(function(i){return e(t,i)})):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,(function(t,e){"use strict";var i=Array.prototype.slice,o=t.console,n=void 0===o?function(){}:function(t){o.error(t)};function s(o,s,a){function u(t,e,i){var s,r="$()."+o+'("'+e+'")';return t.each((function(t,u){var h=a.data(u,o);if(h){var d=h[e];if(d&&"_"!=e.charAt(0)){var l=d.apply(h,i);s=void 0===s?l:s}else n(r+" is not a valid method")}else n(o+" not initialized. Cannot call methods, i.e. "+r)})),void 0!==s?s:t}function h(t,e){t.each((function(t,i){var n=a.data(i,o);n?(n.option(e),n._init()):(n=new s(i,e),a.data(i,o,n))}))}(a=a||e||t.jQuery)&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[o]=function(t){if("string"==typeof t){var e=i.call(arguments,1);return u(this,t,e)}return h(this,t),this},r(a))}function r(t){!t||t&&t.bridget||(t.bridget=s)}return r(e||t.jQuery),s})),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return-1==o.indexOf(e)&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return-1!=o&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=0,n=i[o];e=e||[];for(var s=this._onceEvents&&this._onceEvents[t];n;){var r=s&&s[n];r&&(this.off(t,n),delete s[n]),n.apply(this,e),n=i[o+=r?0:1]}return this}},t})),
|
11 |
+
/*!
|
12 |
+
* getSize v2.0.2
|
13 |
+
* measure size of elements
|
14 |
+
* MIT license
|
15 |
+
*/
|
16 |
+
function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],(function(){return e()})):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,(function(){"use strict";function t(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}var e="undefined"==typeof console?function(){}:function(t){console.error(t)},i=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],o=i.length;function n(t){var i=getComputedStyle(t);return i||e("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),i}var s,r=!1;function a(e){if(function(){if(!r){r=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);a.isBoxSizeOuter=s=200==t(o.width),i.removeChild(e)}}(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var u=n(e);if("none"==u.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<o;e++){t[i[e]]=0}return t}();var h={};h.width=e.offsetWidth,h.height=e.offsetHeight;for(var d=h.isBorderBox="border-box"==u.boxSizing,l=0;l<o;l++){var f=i[l],c=u[f],m=parseFloat(c);h[f]=isNaN(m)?0:m}var p=h.paddingLeft+h.paddingRight,y=h.paddingTop+h.paddingBottom,g=h.marginLeft+h.marginRight,v=h.marginTop+h.marginBottom,_=h.borderLeftWidth+h.borderRightWidth,I=h.borderTopWidth+h.borderBottomWidth,z=d&&s,x=t(u.width);!1!==x&&(h.width=x+(z?0:p+_));var S=t(u.height);return!1!==S&&(h.height=S+(z?0:y+I)),h.innerWidth=h.width-(p+_),h.innerHeight=h.height-(y+I),h.outerWidth=h.width+g,h.outerHeight=h.height+v,h}}return a})),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,(function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var o=e[i]+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}})),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],(function(i){return e(t,i)})):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,(function(t,e){var i={extend:function(t,e){for(var i in e)t[i]=e[i];return t},modulo:function(t,e){return(t%e+e)%e},makeArray:function(t){var e=[];if(Array.isArray(t))e=t;else if(t&&"object"==typeof t&&"number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e},removeFrom:function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},getParent:function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},getQueryElement:function(t){return"string"==typeof t?document.querySelector(t):t},handleEvent:function(t){var e="on"+t.type;this[e]&&this[e](t)},filterFindElements:function(t,o){t=i.makeArray(t);var n=[];return t.forEach((function(t){if(t instanceof HTMLElement)if(o){e(t,o)&&n.push(t);for(var i=t.querySelectorAll(o),s=0;s<i.length;s++)n.push(i[s])}else n.push(t)})),n},debounceMethod:function(t,e,i){var o=t.prototype[e],n=e+"Timeout";t.prototype[e]=function(){var t=this[n];t&&clearTimeout(t);var e=arguments,s=this;this[n]=setTimeout((function(){o.apply(s,e),delete s[n]}),i||100)}},docReady:function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},toDashed:function(t){return t.replace(/(.)([A-Z])/g,(function(t,e,i){return e+"-"+i})).toLowerCase()}},o=t.console;return i.htmlInit=function(e,n){i.docReady((function(){var s=i.toDashed(n),r="data-"+s,a=document.querySelectorAll("["+r+"]"),u=document.querySelectorAll(".js-"+s),h=i.makeArray(a).concat(i.makeArray(u)),d=r+"-options",l=t.jQuery;h.forEach((function(t){var i,s=t.getAttribute(r)||t.getAttribute(d);try{i=s&&JSON.parse(s)}catch(e){return void(o&&o.error("Error parsing "+r+" on "+t.className+": "+e))}var a=new e(t,i);l&&l.data(t,n,a)}))}))},i})),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,(function(t,e){"use strict";var i=document.documentElement.style,o="string"==typeof i.transition?"transition":"WebkitTransition",n="string"==typeof i.transform?"transform":"WebkitTransform",s={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[o],r={transform:n,transition:o,transitionDuration:o+"Duration",transitionProperty:o+"Property",transitionDelay:o+"Delay"};function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var u=a.prototype=Object.create(t.prototype);u.constructor=a,u._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},u.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},u.getSize=function(){this.size=e(this.element)},u.css=function(t){var e=this.element.style;for(var i in t){e[r[i]||i]=t[i]}},u.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),o=t[e?"left":"right"],n=t[i?"top":"bottom"],s=this.layout.size,r=-1!=o.indexOf("%")?parseFloat(o)/100*s.width:parseInt(o,10),a=-1!=n.indexOf("%")?parseFloat(n)/100*s.height:parseInt(n,10);r=isNaN(r)?0:r,a=isNaN(a)?0:a,r-=e?s.paddingLeft:s.paddingRight,a-=i?s.paddingTop:s.paddingBottom,this.position.x=r,this.position.y=a},u.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),o=this.layout._getOption("originTop"),n=i?"paddingLeft":"paddingRight",s=i?"left":"right",r=i?"right":"left",a=this.position.x+t[n];e[s]=this.getXValue(a),e[r]="";var u=o?"paddingTop":"paddingBottom",h=o?"top":"bottom",d=o?"bottom":"top",l=this.position.y+t[u];e[h]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},u.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},u.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},u._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),s=parseInt(e,10),r=n===this.position.x&&s===this.position.y;if(this.setPosition(t,e),!r||this.isTransitioning){var a=t-i,u=e-o,h={};h.transform=this.getTranslate(a,u),this.transition({to:h,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})}else this.layoutPosition()},u.getTranslate=function(t,e){return"translate3d("+(t=this.layout._getOption("originLeft")?t:-t)+"px, "+(e=this.layout._getOption("originTop")?e:-e)+"px, 0)"},u.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},u.moveTo=u._transitionTo,u.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},u._nonTransition=function(t){for(var e in this.css(t.to),t.isCleaning&&this._removeStyles(t.to),t.onTransitionEnd)t.onTransitionEnd[e].call(this)},u.transition=function(t){if(parseFloat(this.layout.options.transitionDuration)){var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);this.element.offsetHeight;null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0}else this._nonTransition(t)};var h="opacity,"+n.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}));u.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:h,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(s,this,!1)}},u.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},u.onotransitionend=function(t){this.ontransitionend(t)};var d={"-webkit-transform":"transform"};u.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,i=d[t.propertyName]||t.propertyName;if(delete e.ingProperties[i],function(t){for(var e in t)return!1;return null,!0}(e.ingProperties)&&this.disableTransition(),i in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[i]),i in e.onEnd)e.onEnd[i].call(this),delete e.onEnd[i];this.emitEvent("transitionEnd",[this])}},u.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(s,this,!1),this.isTransitioning=!1},u._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var l={transitionProperty:"",transitionDuration:"",transitionDelay:""};return u.removeTransitionStyles=function(){this.css(l)},u.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},u.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},u.remove=function(){o&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",(function(){this.removeElem()})),this.hide()):this.removeElem()},u.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("visibleStyle")]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},u.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},u.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},u.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={};e[this.getHideRevealTransitionEndProperty("hiddenStyle")]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},u.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},u.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a})),
|
17 |
+
/*!
|
18 |
+
* Outlayer v2.1.0
|
19 |
+
* the brains and guts of a layout library
|
20 |
+
* MIT license
|
21 |
+
*/
|
22 |
+
function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],(function(i,o,n,s){return e(t,i,o,n,s)})):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,(function(t,e,i,o,n){"use strict";var s=t.console,r=t.jQuery,a=function(){},u=0,h={};function d(t,e){var i=o.getQueryElement(t);if(i){this.element=i,r&&(this.$element=r(this.element)),this.options=o.extend({},this.constructor.defaults),this.option(e);var n=++u;this.element.outlayerGUID=n,h[n]=this,this._create(),this._getOption("initLayout")&&this.layout()}else s&&s.error("Bad element for "+this.constructor.namespace+": "+(i||t))}d.namespace="outlayer",d.Item=n,d.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var l=d.prototype;function f(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}o.extend(l,e.prototype),l.option=function(t){o.extend(this.options,t)},l._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},d.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},l._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),o.extend(this.element.style,this.options.containerStyle),this._getOption("resize")&&this.bindResize()},l.reloadItems=function(){this.items=this._itemize(this.element.children)},l._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0;n<e.length;n++){var s=new i(e[n],this);o.push(s)}return o},l._filterFindItemElements=function(t){return o.filterFindElements(t,this.options.itemSelector)},l.getItemElements=function(){return this.items.map((function(t){return t.element}))},l.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},l._init=l.layout,l._resetLayout=function(){this.getSize()},l.getSize=function(){this.size=i(this.element)},l._getMeasurement=function(t,e){var o,n=this.options[t];n?("string"==typeof n?o=this.element.querySelector(n):n instanceof HTMLElement&&(o=n),this[t]=o?i(o)[e]:n):this[t]=0},l.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},l._getItemsForLayout=function(t){return t.filter((function(t){return!t.isIgnored}))},l._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach((function(t){var o=this._getItemLayoutPosition(t);o.item=t,o.isInstant=e||t.isLayoutInstant,i.push(o)}),this),this._processLayoutQueue(i)}},l._getItemLayoutPosition=function(){return{x:0,y:0}},l._processLayoutQueue=function(t){this.updateStagger(),t.forEach((function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)}),this)},l.updateStagger=function(){var t=this.options.stagger;if(null!=t)return this.stagger=function(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],o=e&&e[2];if(!i.length)return 0;return(i=parseFloat(i))*(c[o]||1)}(t),this.stagger;this.stagger=0},l._positionItem=function(t,e,i,o,n){o?t.goTo(e,i):(t.stagger(n*this.stagger),t.moveTo(e,i))},l._postLayout=function(){this.resizeContainer()},l.resizeContainer=function(){if(this._getOption("resizeContainer")){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},l._getContainerSize=a,l._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"}},l._emitCompleteOnItems=function(t,e){var i=this;function o(){i.dispatchEvent(t+"Complete",null,[e])}var n=e.length;if(e&&n){var s=0;e.forEach((function(e){e.once(t,r)}))}else o();function r(){++s==n&&o()}},l.dispatchEvent=function(t,e,i){var o=e?[e].concat(i):i;if(this.emitEvent(t,o),r)if(this.$element=this.$element||r(this.element),e){var n=r.Event(e);n.type=t,this.$element.trigger(n,i)}else this.$element.trigger(t,i)},l.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},l.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},l.stamp=function(t){(t=this._find(t))&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},l.unstamp=function(t){(t=this._find(t))&&t.forEach((function(t){o.removeFrom(this.stamps,t),this.unignore(t)}),this)},l._find=function(t){if(t)return"string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o.makeArray(t)},l._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},l._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)}},l._manageStamp=a,l._getElementOffset=function(t){var e=t.getBoundingClientRect(),o=this._boundingRect,n=i(t);return{left:e.left-o.left-n.marginLeft,top:e.top-o.top-n.marginTop,right:o.right-e.right-n.marginRight,bottom:o.bottom-e.bottom-n.marginBottom}},l.handleEvent=o.handleEvent,l.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},l.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},l.onresize=function(){this.resize()},o.debounceMethod(d,"onresize",100),l.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},l.needsResizeLayout=function(){var t=i(this.element);return this.size&&t&&t.innerWidth!==this.size.innerWidth},l.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},l.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},l.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},l.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach((function(t,i){t.stagger(i*e),t.reveal()}))}},l.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach((function(t,i){t.stagger(i*e),t.hide()}))}},l.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},l.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},l.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},l.getItems=function(t){t=o.makeArray(t);var e=[];return t.forEach((function(t){var i=this.getItem(t);i&&e.push(i)}),this),e},l.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach((function(t){t.remove(),o.removeFrom(this.items,t)}),this)},l.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach((function(t){t.destroy()})),this.unbindResize();var e=this.element.outlayerGUID;delete h[e],delete this.element.outlayerGUID,r&&r.removeData(this.element,this.constructor.namespace)},d.data=function(t){var e=(t=o.getQueryElement(t))&&t.outlayerGUID;return e&&h[e]},d.create=function(t,e){var i=f(d);return i.defaults=o.extend({},d.defaults),o.extend(i.defaults,e),i.compatOptions=o.extend({},d.compatOptions),i.namespace=t,i.data=d.data,i.Item=f(n),o.htmlInit(i,t),r&&r.bridget&&r.bridget(t,i),i};var c={ms:1,s:1e3};return d.Item=n,d})),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window,(function(t){"use strict";function e(){t.Item.apply(this,arguments)}var i=e.prototype=Object.create(t.Item.prototype),o=i._create;i._create=function(){this.id=this.layout.itemGUID++,o.call(this),this.sortData={}},i.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}};var n=i.destroy;return i.destroy=function(){n.apply(this,arguments),this.css({display:""})},e})),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):"object"==typeof module&&module.exports?module.exports=e(require("get-size"),require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window,(function(t,e){"use strict";function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}var o=i.prototype;return["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout","_getOption"].forEach((function(t){o[t]=function(){return e.prototype[t].apply(this.isotope,arguments)}})),o.needsVerticalResizeLayout=function(){var e=t(this.isotope.element);return this.isotope.size&&e&&e.innerHeight!=this.isotope.size.innerHeight},o._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},o.getColumnWidth=function(){this.getSegmentSize("column","Width")},o.getRowHeight=function(){this.getSegmentSize("row","Height")},o.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},o.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},o.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},o.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function n(){i.apply(this,arguments)}return n.prototype=Object.create(o),n.prototype.constructor=n,e&&(n.options=e),n.prototype.namespace=t,i.modes[t]=n,n},i})),
|
23 |
+
/*!
|
24 |
+
* Masonry v4.2.0
|
25 |
+
* Cascading grid layout library
|
26 |
+
* http://masonry.desandro.com
|
27 |
+
* MIT License
|
28 |
+
* by David DeSandro
|
29 |
+
*/
|
30 |
+
function(t,e){"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,(function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var o=i.prototype;return o._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},o.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var o=this.columnWidth+=this.gutter,n=this.containerWidth+this.gutter,s=n/o,r=o-n%o;s=Math[r&&r<1?"round":"floor"](s),this.cols=Math.max(s,1)},o.getContainerWidth=function(){var t=this._getOption("fitWidth")?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},o._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=Math[e&&e<1?"round":"ceil"](t.size.outerWidth/this.columnWidth);i=Math.min(i,this.cols);for(var o=this[this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition"](i,t),n={x:this.columnWidth*o.col,y:o.y},s=o.y+t.size.outerHeight,r=i+o.col,a=o.col;a<r;a++)this.colYs[a]=s;return n},o._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},o._getTopColGroup=function(t){if(t<2)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;o<i;o++)e[o]=this._getColGroupY(o,t);return e},o._getColGroupY=function(t,e){if(e<2)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},o._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols;i=t>1&&i+t>this.cols?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},o._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this._getOption("originLeft")?o.left:o.right,s=n+i.outerWidth,r=Math.floor(n/this.columnWidth);r=Math.max(0,r);var a=Math.floor(s/this.columnWidth);a-=s%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var u=(this._getOption("originTop")?o.top:o.bottom)+i.outerHeight,h=r;h<=a;h++)this.colYs[h]=Math.max(u,this.colYs[h])},o._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},o._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i})),
|
31 |
+
/*!
|
32 |
+
* Masonry layout mode
|
33 |
+
* sub-classes Masonry
|
34 |
+
* http://masonry.desandro.com
|
35 |
+
*/
|
36 |
+
function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode"),require("masonry-layout")):e(t.Isotope.LayoutMode,t.Masonry)}(window,(function(t,e){"use strict";var i=t.create("masonry"),o=i.prototype,n={_getElementOffset:!0,layout:!0,_getMeasurement:!0};for(var s in e.prototype)n[s]||(o[s]=e.prototype[s]);var r=o.measureColumns;o.measureColumns=function(){this.items=this.isotope.filteredItems,r.call(this)};var a=o._getOption;return o._getOption=function(t){return"fitWidth"==t?void 0!==this.options.isFitWidth?this.options.isFitWidth:this.options.fitWidth:a.apply(this.isotope,arguments)},i})),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,(function(t){"use strict";var e=t.create("fitRows"),i=e.prototype;return i._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},i._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth+this.gutter,i=this.isotope.size.innerWidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxY);var o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},i._getContainerSize=function(){return{height:this.maxY}},e})),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,(function(t){"use strict";var e=t.create("vertical",{horizontalAlignment:0}),i=e.prototype;return i._resetLayout=function(){this.y=0},i._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},i._getContainerSize=function(){return{height:this.y}},e})),
|
37 |
+
/*!
|
38 |
+
* Isotope v3.0.4
|
39 |
+
*
|
40 |
+
* Licensed GPLv3 for open source use
|
41 |
+
* or Isotope Commercial License for commercial use
|
42 |
+
*
|
43 |
+
* http://isotope.metafizzy.co
|
44 |
+
* Copyright 2017 Metafizzy
|
45 |
+
*/
|
46 |
+
function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","desandro-matches-selector/matches-selector","fizzy-ui-utils/utils","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],(function(i,o,n,s,r,a){return e(t,i,o,n,s,r,a)})):"object"==typeof module&&module.exports?module.exports=e(t,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("isotope/js/item"),require("isotope/js/layout-mode"),require("isotope/js/layout-modes/masonry"),require("isotope/js/layout-modes/fit-rows"),require("isotope/js/layout-modes/vertical")):t.Isotope=e(t,t.Outlayer,t.getSize,t.matchesSelector,t.fizzyUIUtils,t.Isotope.Item,t.Isotope.LayoutMode)}(window,(function(t,e,i,o,n,s,r){var a=t.jQuery,u=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},h=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});h.Item=s,h.LayoutMode=r;var d=h.prototype;d._create=function(){for(var t in this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"],r.modes)this._initLayoutMode(t)},d.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},d._itemize=function(){for(var t=e.prototype._itemize.apply(this,arguments),i=0;i<t.length;i++){var o=t[i];o.id=this.itemGUID++}return this._updateItemsSortData(t),t},d._initLayoutMode=function(t){var e=r.modes[t],i=this.options[t]||{};this.options[t]=e.options?n.extend(e.options,i):i,this.modes[t]=new e(this)},d.layout=function(){this._isLayoutInited||!this._getOption("initLayout")?this._layout():this.arrange()},d._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},d.arrange=function(t){this.option(t),this._getIsInstant();var e=this._filter(this.items);this.filteredItems=e.matches,this._bindArrangeComplete(),this._isInstant?this._noTransition(this._hideReveal,[e]):this._hideReveal(e),this._sort(),this._layout()},d._init=d.arrange,d._hideReveal=function(t){this.reveal(t.needReveal),this.hide(t.needHide)},d._getIsInstant=function(){var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;return this._isInstant=e,e},d._bindArrangeComplete=function(){var t,e,i,o=this;function n(){t&&e&&i&&o.dispatchEvent("arrangeComplete",null,[o.filteredItems])}this.once("layoutComplete",(function(){t=!0,n()})),this.once("hideComplete",(function(){e=!0,n()})),this.once("revealComplete",(function(){i=!0,n()}))},d._filter=function(t){var e=this.options.filter;e=e||"*";for(var i=[],o=[],n=[],s=this._getFilterTest(e),r=0;r<t.length;r++){var a=t[r];if(!a.isIgnored){var u=s(a);u&&i.push(a),u&&a.isHidden?o.push(a):u||a.isHidden||n.push(a)}}return{matches:i,needReveal:o,needHide:n}},d._getFilterTest=function(t){return a&&this.options.isJQueryFiltering?function(e){return a(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return o(e.element,t)}},d.updateSortData=function(t){var e;t?(t=n.makeArray(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},d._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=l(i)}},d._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&i<e;i++){t[i].updateSortData()}};var l=function(t){if("string"!=typeof t)return t;var e=u(t).split(" "),i=e[0],o=i.match(/^\[(.+)\]$/),n=function(t,e){return t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&i.textContent}}(o&&o[1],i),s=h.sortDataParsers[e[1]];return t=s?function(t){return t&&s(n(t))}:function(t){return t&&n(t)}};h.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},d._sort=function(){if(this.options.sortBy){var t=n.makeArray(this.options.sortBy);this._getIsSameSortBy(t)||(this.sortHistory=t.concat(this.sortHistory));var e=function(t,e){return function(i,o){for(var n=0;n<t.length;n++){var s=t[n],r=i.sortData[s],a=o.sortData[s];if(r>a||r<a)return(r>a?1:-1)*((void 0!==e[s]?e[s]:e)?1:-1)}return 0}}(this.sortHistory,this.options.sortAscending);this.filteredItems.sort(e)}},d._getIsSameSortBy=function(t){for(var e=0;e<t.length;e++)if(t[e]!=this.sortHistory[e])return!1;return!0},d._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw new Error("No layout mode: "+t);return e.options=this.options[t],e},d._resetLayout=function(){e.prototype._resetLayout.call(this),this._mode()._resetLayout()},d._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},d._manageStamp=function(t){this._mode()._manageStamp(t)},d._getContainerSize=function(){return this._mode()._getContainerSize()},d.needsResizeLayout=function(){return this._mode().needsResizeLayout()},d.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},d.prepended=function(t){var e=this._itemize(t);if(e.length){this._resetLayout(),this._manageStamps();var i=this._filterRevealAdded(e);this.layoutItems(this.filteredItems),this.filteredItems=i.concat(this.filteredItems),this.items=e.concat(this.items)}},d._filterRevealAdded=function(t){var e=this._filter(t);return this.hide(e.needHide),this.reveal(e.matches),this.layoutItems(e.matches,!0),e.matches},d.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;i<n;i++)o=e[i],this.element.appendChild(o.element);var s=this._filter(e).matches;for(i=0;i<n;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;i<n;i++)delete e[i].isLayoutInstant;this.reveal(s)}};var f=d.remove;return d.remove=function(t){t=n.makeArray(t);var e=this.getItems(t);f.call(this,t);for(var i=e&&e.length,o=0;i&&o<i;o++){var s=e[o];n.removeFrom(this.filteredItems,s)}},d.shuffle=function(){for(var t=0;t<this.items.length;t++){this.items[t].sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},d._noTransition=function(t,e){var i=this.options.transitionDuration;this.options.transitionDuration=0;var o=t.apply(this,e);return this.options.transitionDuration=i,o},d.getFilteredItemElements=function(){return this.filteredItems.map((function(t){return t.element}))},h}));
|
lang/so-widgets-bundle.pot
CHANGED
@@ -24,11 +24,11 @@ msgstr ""
|
|
24 |
msgid "A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin."
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: so-widgets-bundle.php:8, widgets/accordion/accordion.php:5, widgets/anything-carousel/anything-carousel.php:5, widgets/button/button.php:5, widgets/contact/contact.php:5, widgets/cta/cta.php:5, widgets/editor/editor.php:5, widgets/features/features.php:5, widgets/google-map/google-map.php:5, widgets/headline/headline.php:5, widgets/hero/hero.php:5, widgets/icon/icon.php:5, widgets/image/image.php:5, widgets/image-grid/image-grid.php:5, widgets/layout-slider/layout-slider.php:5, widgets/lottie-player/lottie-player.php:5, widgets/post-carousel/post-carousel.php:5, widgets/price-table/price-table.php:5, widgets/simple-masonry/simple-masonry.php:5, widgets/slider/slider.php:5, widgets/social-media-buttons/social-media-buttons.php:5, widgets/tabs/tabs.php:5, widgets/taxonomy/taxonomy.php:5, widgets/testimonial/testimonial.php:5, widgets/video/video.php:5
|
28 |
msgid "SiteOrigin"
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: so-widgets-bundle.php:9, widgets/accordion/accordion.php:6, widgets/anything-carousel/anything-carousel.php:6, widgets/button/button.php:6, widgets/contact/contact.php:6, widgets/cta/cta.php:6, widgets/editor/editor.php:6, widgets/features/features.php:6, widgets/google-map/google-map.php:6, widgets/headline/headline.php:6, widgets/hero/hero.php:6, widgets/icon/icon.php:6, widgets/image/image.php:6, widgets/image-grid/image-grid.php:6, widgets/layout-slider/layout-slider.php:6, widgets/lottie-player/lottie-player.php:6, widgets/post-carousel/post-carousel.php:6, widgets/price-table/price-table.php:6, widgets/simple-masonry/simple-masonry.php:6, widgets/slider/slider.php:6, widgets/social-media-buttons/social-media-buttons.php:6, widgets/tabs/tabs.php:6, widgets/taxonomy/taxonomy.php:6, widgets/testimonial/testimonial.php:6, widgets/video/video.php:6
|
32 |
msgid "https://siteorigin.com"
|
33 |
msgstr ""
|
34 |
|
@@ -156,7 +156,7 @@ msgstr ""
|
|
156 |
msgid "Filter Widgets"
|
157 |
msgstr ""
|
158 |
|
159 |
-
#: admin/tpl/admin.php:17, widgets/google-map/google-map.php:366, base/inc/fields/posts.class.php:23
|
160 |
msgid "All"
|
161 |
msgstr ""
|
162 |
|
@@ -180,7 +180,7 @@ msgstr ""
|
|
180 |
msgid "Deactivate"
|
181 |
msgstr ""
|
182 |
|
183 |
-
#: admin/tpl/admin.php:90, widgets/contact/contact.php:59, widgets/google-map/google-map.php:60, widgets/image-grid/image-grid.php:96, widgets/testimonial/testimonial.php:101, base/inc/widgets/base-carousel.class.php:249
|
184 |
msgid "Settings"
|
185 |
msgstr ""
|
186 |
|
@@ -296,7 +296,7 @@ msgstr ""
|
|
296 |
msgid "When opening the panel, scroll the user to the top of the panel."
|
297 |
msgstr ""
|
298 |
|
299 |
-
#: widgets/accordion/accordion.php:72, widgets/accordion/accordion.php:85, widgets/anything-carousel/anything-carousel.php:65, widgets/anything-carousel/anything-carousel.php:81, widgets/contact/contact.php:48, widgets/cta/cta.php:64, widgets/editor/editor.php:34, widgets/features/features.php:140, widgets/icon/icon.php:68, widgets/post-carousel/post-carousel.php:260, widgets/price-table/price-table.php:42, widgets/price-table/price-table.php:61, widgets/simple-masonry/simple-masonry.php:44, widgets/simple-masonry/simple-masonry.php:85, widgets/social-media-buttons/social-media-buttons.php:53, widgets/tabs/tabs.php:72, widgets/tabs/tabs.php:85, widgets/taxonomy/taxonomy.php:34, widgets/testimonial/testimonial.php:41, widgets/video/video.php:33, base/inc/fields/posts.class.php:108
|
300 |
msgid "Title"
|
301 |
msgstr ""
|
302 |
|
@@ -328,7 +328,7 @@ msgstr ""
|
|
328 |
msgid "Closed"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: widgets/accordion/accordion.php:111, widgets/contact/contact.php:396, widgets/cta/cta.php:74, widgets/hero/hero.php:254, widgets/layout-slider/layout-slider.php:222, widgets/slider/slider.php:134, widgets/tabs/tabs.php:101, widgets/testimonial/testimonial.php:184, base/inc/widgets/base-carousel.class.php:350
|
332 |
msgid "Design"
|
333 |
msgstr ""
|
334 |
|
@@ -400,7 +400,7 @@ msgstr ""
|
|
400 |
msgid "Item"
|
401 |
msgstr ""
|
402 |
|
403 |
-
#: widgets/anything-carousel/anything-carousel.php:108, widgets/button/button.php:201, widgets/contact/contact.php:450, widgets/contact/contact.php:500, widgets/features/features.php:158, widgets/features/features.php:179, widgets/features/features.php:200, widgets/headline/headline.php:88, widgets/headline/headline.php:169, base/inc/widgets/base-carousel.class.php:374
|
404 |
msgid "Font"
|
405 |
msgstr ""
|
406 |
|
@@ -408,7 +408,7 @@ msgstr ""
|
|
408 |
msgid "Font size"
|
409 |
msgstr ""
|
410 |
|
411 |
-
#: widgets/anything-carousel/anything-carousel.php:116, widgets/contact/contact.php:460, widgets/contact/contact.php:584, widgets/contact/contact.php:753, widgets/features/features.php:167, widgets/features/features.php:188, widgets/features/features.php:209, widgets/google-map/google-map.php:376, widgets/headline/headline.php:80, widgets/headline/headline.php:161, widgets/headline/headline.php:231, widgets/icon/icon.php:36, widgets/taxonomy/taxonomy.php:56, base/inc/widgets/base-carousel.class.php:382
|
412 |
msgid "Color"
|
413 |
msgstr ""
|
414 |
|
@@ -464,6 +464,271 @@ msgstr ""
|
|
464 |
msgid "Add widgets and layouts to your carousel items with %sSiteOrigin Premium%s"
|
465 |
msgstr ""
|
466 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
467 |
#: widgets/button/button.php:4, widgets/button/button.php:17
|
468 |
msgid "A powerful yet simple button widget for your sidebars or Page Builder pages."
|
469 |
msgstr ""
|
@@ -472,10 +737,6 @@ msgstr ""
|
|
472 |
msgid "SiteOrigin Button"
|
473 |
msgstr ""
|
474 |
|
475 |
-
#: widgets/button/button.php:33, widgets/contact/contact.php:953, widgets/features/features.php:381, widgets/headline/headline.php:37, widgets/social-media-buttons/social-media-buttons.php:32, base/inc/widgets/base-slider.class.php:222
|
476 |
-
msgid "Responsive Breakpoint"
|
477 |
-
msgstr ""
|
478 |
-
|
479 |
#: widgets/button/button.php:35
|
480 |
msgid "This setting controls when the Mobile Align setting will be used. The default value is 780px."
|
481 |
msgstr ""
|
@@ -524,10 +785,6 @@ msgstr ""
|
|
524 |
msgid "Design and Layout"
|
525 |
msgstr ""
|
526 |
|
527 |
-
#: widgets/button/button.php:121, widgets/contact/contact.php:477, widgets/contact/contact.php:707, widgets/contact/contact.php:758, widgets/google-map/google-map.php:94, base/inc/fields/image-size.class.php:69
|
528 |
-
msgid "Width"
|
529 |
-
msgstr ""
|
530 |
-
|
531 |
#: widgets/button/button.php:122
|
532 |
msgid "Leave blank to let the button resize according to content."
|
533 |
msgstr ""
|
@@ -584,10 +841,6 @@ msgstr ""
|
|
584 |
msgid "Hover Text Color"
|
585 |
msgstr ""
|
586 |
|
587 |
-
#: widgets/button/button.php:207, widgets/headline/headline.php:93, widgets/headline/headline.php:174
|
588 |
-
msgid "Font Size"
|
589 |
-
msgstr ""
|
590 |
-
|
591 |
#: widgets/button/button.php:209, widgets/contact/contact.php:317, widgets/contact/contact.php:593, widgets/contact/contact.php:695, widgets/social-media-buttons/social-media-buttons.php:141
|
592 |
msgid "Normal"
|
593 |
msgstr ""
|
@@ -1036,18 +1289,10 @@ msgstr ""
|
|
1036 |
msgid "Max width"
|
1037 |
msgstr ""
|
1038 |
|
1039 |
-
#: widgets/contact/contact.php:526, widgets/google-map/google-map.php:98, widgets/hero/hero.php:187, widgets/hero/hero.php:223, widgets/layout-slider/layout-slider.php:155, widgets/layout-slider/layout-slider.php:191, widgets/slider/slider.php:142, base/inc/fields/image-size.class.php:76
|
1040 |
-
msgid "Height"
|
1041 |
-
msgstr ""
|
1042 |
-
|
1043 |
#: widgets/contact/contact.php:530
|
1044 |
msgid "Text area height"
|
1045 |
msgstr ""
|
1046 |
|
1047 |
-
#: widgets/contact/contact.php:534, widgets/hero/hero.php:100, widgets/layout-slider/layout-slider.php:72, widgets/post-carousel/post-carousel.php:194
|
1048 |
-
msgid "Background"
|
1049 |
-
msgstr ""
|
1050 |
-
|
1051 |
#: widgets/contact/contact.php:548
|
1052 |
msgid " Border style"
|
1053 |
msgstr ""
|
@@ -1904,10 +2149,6 @@ msgstr ""
|
|
1904 |
msgid "Paragraph"
|
1905 |
msgstr ""
|
1906 |
|
1907 |
-
#: widgets/headline/headline.php:84, widgets/headline/headline.php:165
|
1908 |
-
msgid "Hover Color"
|
1909 |
-
msgstr ""
|
1910 |
-
|
1911 |
#: widgets/headline/headline.php:97, widgets/headline/headline.php:178, widgets/headline/headline.php:243, widgets/icon/icon.php:46
|
1912 |
msgid "Alignment"
|
1913 |
msgstr ""
|
@@ -3145,9 +3386,11 @@ msgstr ""
|
|
3145 |
msgid "Post ID"
|
3146 |
msgstr ""
|
3147 |
|
3148 |
-
#: base/inc/fields/posts.class.php:107
|
3149 |
msgid "Author"
|
3150 |
-
|
|
|
|
|
3151 |
|
3152 |
#: base/inc/fields/posts.class.php:109
|
3153 |
msgid "Published date"
|
@@ -3485,6 +3728,32 @@ msgstr ""
|
|
3485 |
msgid "previous slide"
|
3486 |
msgstr ""
|
3487 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3488 |
#: widgets/contact/tpl/default.php:51
|
3489 |
msgid "Unable to detect Really Simple CAPTCHA plugin."
|
3490 |
msgstr ""
|
24 |
msgid "A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin."
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: so-widgets-bundle.php:8, widgets/accordion/accordion.php:5, widgets/anything-carousel/anything-carousel.php:5, widgets/blog/blog.php:5, widgets/button/button.php:5, widgets/contact/contact.php:5, widgets/cta/cta.php:5, widgets/editor/editor.php:5, widgets/features/features.php:5, widgets/google-map/google-map.php:5, widgets/headline/headline.php:5, widgets/hero/hero.php:5, widgets/icon/icon.php:5, widgets/image/image.php:5, widgets/image-grid/image-grid.php:5, widgets/layout-slider/layout-slider.php:5, widgets/lottie-player/lottie-player.php:5, widgets/post-carousel/post-carousel.php:5, widgets/price-table/price-table.php:5, widgets/simple-masonry/simple-masonry.php:5, widgets/slider/slider.php:5, widgets/social-media-buttons/social-media-buttons.php:5, widgets/tabs/tabs.php:5, widgets/taxonomy/taxonomy.php:5, widgets/testimonial/testimonial.php:5, widgets/video/video.php:5
|
28 |
msgid "SiteOrigin"
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: so-widgets-bundle.php:9, widgets/accordion/accordion.php:6, widgets/anything-carousel/anything-carousel.php:6, widgets/blog/blog.php:6, widgets/button/button.php:6, widgets/contact/contact.php:6, widgets/cta/cta.php:6, widgets/editor/editor.php:6, widgets/features/features.php:6, widgets/google-map/google-map.php:6, widgets/headline/headline.php:6, widgets/hero/hero.php:6, widgets/icon/icon.php:6, widgets/image/image.php:6, widgets/image-grid/image-grid.php:6, widgets/layout-slider/layout-slider.php:6, widgets/lottie-player/lottie-player.php:6, widgets/post-carousel/post-carousel.php:6, widgets/price-table/price-table.php:6, widgets/simple-masonry/simple-masonry.php:6, widgets/slider/slider.php:6, widgets/social-media-buttons/social-media-buttons.php:6, widgets/tabs/tabs.php:6, widgets/taxonomy/taxonomy.php:6, widgets/testimonial/testimonial.php:6, widgets/video/video.php:6
|
32 |
msgid "https://siteorigin.com"
|
33 |
msgstr ""
|
34 |
|
156 |
msgid "Filter Widgets"
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: admin/tpl/admin.php:17, widgets/google-map/google-map.php:366, base/inc/fields/posts.class.php:23, widgets/blog/tpl/base.php:34
|
160 |
msgid "All"
|
161 |
msgstr ""
|
162 |
|
180 |
msgid "Deactivate"
|
181 |
msgstr ""
|
182 |
|
183 |
+
#: admin/tpl/admin.php:90, widgets/blog/blog.php:67, widgets/contact/contact.php:59, widgets/google-map/google-map.php:60, widgets/image-grid/image-grid.php:96, widgets/testimonial/testimonial.php:101, base/inc/widgets/base-carousel.class.php:249
|
184 |
msgid "Settings"
|
185 |
msgstr ""
|
186 |
|
296 |
msgid "When opening the panel, scroll the user to the top of the panel."
|
297 |
msgstr ""
|
298 |
|
299 |
+
#: widgets/accordion/accordion.php:72, widgets/accordion/accordion.php:85, widgets/anything-carousel/anything-carousel.php:65, widgets/anything-carousel/anything-carousel.php:81, widgets/blog/blog.php:53, widgets/contact/contact.php:48, widgets/cta/cta.php:64, widgets/editor/editor.php:34, widgets/features/features.php:140, widgets/icon/icon.php:68, widgets/post-carousel/post-carousel.php:260, widgets/price-table/price-table.php:42, widgets/price-table/price-table.php:61, widgets/simple-masonry/simple-masonry.php:44, widgets/simple-masonry/simple-masonry.php:85, widgets/social-media-buttons/social-media-buttons.php:53, widgets/tabs/tabs.php:72, widgets/tabs/tabs.php:85, widgets/taxonomy/taxonomy.php:34, widgets/testimonial/testimonial.php:41, widgets/video/video.php:33, base/inc/fields/posts.class.php:108
|
300 |
msgid "Title"
|
301 |
msgstr ""
|
302 |
|
328 |
msgid "Closed"
|
329 |
msgstr ""
|
330 |
|
331 |
+
#: widgets/accordion/accordion.php:111, widgets/blog/blog.php:139, widgets/contact/contact.php:396, widgets/cta/cta.php:74, widgets/hero/hero.php:254, widgets/layout-slider/layout-slider.php:222, widgets/slider/slider.php:134, widgets/tabs/tabs.php:101, widgets/testimonial/testimonial.php:184, base/inc/widgets/base-carousel.class.php:350
|
332 |
msgid "Design"
|
333 |
msgstr ""
|
334 |
|
400 |
msgid "Item"
|
401 |
msgstr ""
|
402 |
|
403 |
+
#: widgets/anything-carousel/anything-carousel.php:108, widgets/blog/blog.php:166, widgets/blog/blog.php:193, widgets/blog/blog.php:220, widgets/blog/blog.php:257, widgets/blog/blog.php:310, widgets/blog/blog.php:342, widgets/blog/blog.php:516, widgets/button/button.php:201, widgets/contact/contact.php:450, widgets/contact/contact.php:500, widgets/features/features.php:158, widgets/features/features.php:179, widgets/features/features.php:200, widgets/headline/headline.php:88, widgets/headline/headline.php:169, base/inc/widgets/base-carousel.class.php:374
|
404 |
msgid "Font"
|
405 |
msgstr ""
|
406 |
|
408 |
msgid "Font size"
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: widgets/anything-carousel/anything-carousel.php:116, widgets/blog/blog.php:175, widgets/blog/blog.php:202, widgets/blog/blog.php:229, widgets/blog/blog.php:266, widgets/blog/blog.php:319, widgets/blog/blog.php:359, widgets/contact/contact.php:460, widgets/contact/contact.php:584, widgets/contact/contact.php:753, widgets/features/features.php:167, widgets/features/features.php:188, widgets/features/features.php:209, widgets/google-map/google-map.php:376, widgets/headline/headline.php:80, widgets/headline/headline.php:161, widgets/headline/headline.php:231, widgets/icon/icon.php:36, widgets/taxonomy/taxonomy.php:56, base/inc/widgets/base-carousel.class.php:382
|
412 |
msgid "Color"
|
413 |
msgstr ""
|
414 |
|
464 |
msgid "Add widgets and layouts to your carousel items with %sSiteOrigin Premium%s"
|
465 |
msgstr ""
|
466 |
|
467 |
+
#: widgets/blog/blog.php:4, widgets/blog/blog.php:16
|
468 |
+
msgid "Display blog posts in a list or grid. Choose a design that suits your content."
|
469 |
+
msgstr ""
|
470 |
+
|
471 |
+
#: widgets/blog/blog.php:14
|
472 |
+
msgid "SiteOrigin Blog"
|
473 |
+
msgstr ""
|
474 |
+
|
475 |
+
#: widgets/blog/blog.php:57
|
476 |
+
msgid "Template"
|
477 |
+
msgstr ""
|
478 |
+
|
479 |
+
#: widgets/blog/blog.php:72
|
480 |
+
msgid "Column Count"
|
481 |
+
msgstr ""
|
482 |
+
|
483 |
+
#: widgets/blog/blog.php:76, widgets/blog/blog.php:407
|
484 |
+
msgid "Featured Image"
|
485 |
+
msgstr ""
|
486 |
+
|
487 |
+
#: widgets/blog/blog.php:81
|
488 |
+
msgid "Post Content "
|
489 |
+
msgstr ""
|
490 |
+
|
491 |
+
#: widgets/blog/blog.php:82
|
492 |
+
msgid "Choose how to display your post content. Select Full Post Content if using the \"more\" quicktag."
|
493 |
+
msgstr ""
|
494 |
+
|
495 |
+
#: widgets/blog/blog.php:85
|
496 |
+
msgid "Post Excerpt"
|
497 |
+
msgstr ""
|
498 |
+
|
499 |
+
#: widgets/blog/blog.php:86
|
500 |
+
msgid "Full Post Content"
|
501 |
+
msgstr ""
|
502 |
+
|
503 |
+
#: widgets/blog/blog.php:95
|
504 |
+
msgid "Post Excerpt Read More Link"
|
505 |
+
msgstr ""
|
506 |
+
|
507 |
+
#: widgets/blog/blog.php:96
|
508 |
+
msgid "Display the Read More link below the post excerpt."
|
509 |
+
msgstr ""
|
510 |
+
|
511 |
+
#: widgets/blog/blog.php:104
|
512 |
+
msgid "Post Date"
|
513 |
+
msgstr ""
|
514 |
+
|
515 |
+
#: widgets/blog/blog.php:109
|
516 |
+
msgid "Post Author"
|
517 |
+
msgstr ""
|
518 |
+
|
519 |
+
#: widgets/blog/blog.php:114
|
520 |
+
msgid "Filter Categories "
|
521 |
+
msgstr ""
|
522 |
+
|
523 |
+
#: widgets/blog/blog.php:126
|
524 |
+
msgid "Post Categories"
|
525 |
+
msgstr ""
|
526 |
+
|
527 |
+
#: widgets/blog/blog.php:131
|
528 |
+
msgid "Post Comment Count"
|
529 |
+
msgstr ""
|
530 |
+
|
531 |
+
#: widgets/blog/blog.php:144
|
532 |
+
msgid "Post"
|
533 |
+
msgstr ""
|
534 |
+
|
535 |
+
#: widgets/blog/blog.php:149, widgets/blog/blog.php:412, widgets/blog/blog.php:491
|
536 |
+
msgid "Border Color"
|
537 |
+
msgstr ""
|
538 |
+
|
539 |
+
#: widgets/blog/blog.php:154
|
540 |
+
msgid "Background Color"
|
541 |
+
msgstr ""
|
542 |
+
|
543 |
+
#: widgets/blog/blog.php:161
|
544 |
+
msgid "Post Title"
|
545 |
+
msgstr ""
|
546 |
+
|
547 |
+
#: widgets/blog/blog.php:170, widgets/blog/blog.php:197, widgets/blog/blog.php:224, widgets/blog/blog.php:261, widgets/blog/blog.php:314, widgets/blog/blog.php:350, widgets/blog/blog.php:520, widgets/button/button.php:207, widgets/headline/headline.php:93, widgets/headline/headline.php:174
|
548 |
+
msgid "Font Size"
|
549 |
+
msgstr ""
|
550 |
+
|
551 |
+
#: widgets/blog/blog.php:180, widgets/blog/blog.php:207, widgets/blog/blog.php:271, widgets/blog/blog.php:368, widgets/headline/headline.php:84, widgets/headline/headline.php:165
|
552 |
+
msgid "Hover Color"
|
553 |
+
msgstr ""
|
554 |
+
|
555 |
+
#: widgets/blog/blog.php:188
|
556 |
+
msgid "Post Meta"
|
557 |
+
msgstr ""
|
558 |
+
|
559 |
+
#: widgets/blog/blog.php:215
|
560 |
+
msgid "Offset Post Meta"
|
561 |
+
msgstr ""
|
562 |
+
|
563 |
+
#: widgets/blog/blog.php:234, widgets/blog/blog.php:324, widgets/blog/blog.php:525
|
564 |
+
msgid "Link Color"
|
565 |
+
msgstr ""
|
566 |
+
|
567 |
+
#: widgets/blog/blog.php:239
|
568 |
+
msgid "Link Color Hover"
|
569 |
+
msgstr ""
|
570 |
+
|
571 |
+
#: widgets/blog/blog.php:244
|
572 |
+
msgid "Link Font Size"
|
573 |
+
msgstr ""
|
574 |
+
|
575 |
+
#: widgets/blog/blog.php:252
|
576 |
+
msgid "Overlay Post Category"
|
577 |
+
msgstr ""
|
578 |
+
|
579 |
+
#: widgets/blog/blog.php:276, widgets/blog/blog.php:501, widgets/contact/contact.php:534, widgets/hero/hero.php:100, widgets/layout-slider/layout-slider.php:72, widgets/post-carousel/post-carousel.php:194
|
580 |
+
msgid "Background"
|
581 |
+
msgstr ""
|
582 |
+
|
583 |
+
#: widgets/blog/blog.php:281, widgets/blog/blog.php:505
|
584 |
+
msgid "Hover Background"
|
585 |
+
msgstr ""
|
586 |
+
|
587 |
+
#: widgets/blog/blog.php:286
|
588 |
+
msgid "Background Opacity"
|
589 |
+
msgstr ""
|
590 |
+
|
591 |
+
#: widgets/blog/blog.php:294
|
592 |
+
msgid "Background Opacity Hover"
|
593 |
+
msgstr ""
|
594 |
+
|
595 |
+
#: widgets/blog/blog.php:305
|
596 |
+
msgid "Post Content"
|
597 |
+
msgstr ""
|
598 |
+
|
599 |
+
#: widgets/blog/blog.php:329, widgets/blog/blog.php:530
|
600 |
+
msgid "Link Hover Color"
|
601 |
+
msgstr ""
|
602 |
+
|
603 |
+
#: widgets/blog/blog.php:337
|
604 |
+
msgid "Filter Categories"
|
605 |
+
msgstr ""
|
606 |
+
|
607 |
+
#: widgets/blog/blog.php:377
|
608 |
+
msgid "Capitalize Categories"
|
609 |
+
msgstr ""
|
610 |
+
|
611 |
+
#: widgets/blog/blog.php:386
|
612 |
+
msgid "Selected Border Color"
|
613 |
+
msgstr ""
|
614 |
+
|
615 |
+
#: widgets/blog/blog.php:395
|
616 |
+
msgid "Selected Border Thickness"
|
617 |
+
msgstr ""
|
618 |
+
|
619 |
+
#: widgets/blog/blog.php:417
|
620 |
+
msgid "Hover Overlay Color"
|
621 |
+
msgstr ""
|
622 |
+
|
623 |
+
#: widgets/blog/blog.php:421
|
624 |
+
msgid "Hover Overlay Opacity"
|
625 |
+
msgstr ""
|
626 |
+
|
627 |
+
#: widgets/blog/blog.php:430
|
628 |
+
msgid "Post Title Font"
|
629 |
+
msgstr ""
|
630 |
+
|
631 |
+
#: widgets/blog/blog.php:434
|
632 |
+
msgid "Post Title Font Size"
|
633 |
+
msgstr ""
|
634 |
+
|
635 |
+
#: widgets/blog/blog.php:439
|
636 |
+
msgid "Post Title Color"
|
637 |
+
msgstr ""
|
638 |
+
|
639 |
+
#: widgets/blog/blog.php:444
|
640 |
+
msgid "Divider Border Color"
|
641 |
+
msgstr ""
|
642 |
+
|
643 |
+
#: widgets/blog/blog.php:449
|
644 |
+
msgid "Divider Border Thickness"
|
645 |
+
msgstr ""
|
646 |
+
|
647 |
+
#: widgets/blog/blog.php:454
|
648 |
+
msgid "Divider Border Margin"
|
649 |
+
msgstr ""
|
650 |
+
|
651 |
+
#: widgets/blog/blog.php:459
|
652 |
+
msgid "Post Meta Font"
|
653 |
+
msgstr ""
|
654 |
+
|
655 |
+
#: widgets/blog/blog.php:463
|
656 |
+
msgid "Post Meta Font Size"
|
657 |
+
msgstr ""
|
658 |
+
|
659 |
+
#: widgets/blog/blog.php:468
|
660 |
+
msgid "Post Meta Color"
|
661 |
+
msgstr ""
|
662 |
+
|
663 |
+
#: widgets/blog/blog.php:476
|
664 |
+
msgid "Pagination"
|
665 |
+
msgstr ""
|
666 |
+
|
667 |
+
#: widgets/blog/blog.php:481
|
668 |
+
msgid "Top Margin"
|
669 |
+
msgstr ""
|
670 |
+
|
671 |
+
#: widgets/blog/blog.php:486
|
672 |
+
msgid "Link Margin"
|
673 |
+
msgstr ""
|
674 |
+
|
675 |
+
#: widgets/blog/blog.php:496
|
676 |
+
msgid "Border Color Hover"
|
677 |
+
msgstr ""
|
678 |
+
|
679 |
+
#: widgets/blog/blog.php:509
|
680 |
+
msgid "Border Radius"
|
681 |
+
msgstr ""
|
682 |
+
|
683 |
+
#: widgets/blog/blog.php:535
|
684 |
+
msgid "Dots Color"
|
685 |
+
msgstr ""
|
686 |
+
|
687 |
+
#: widgets/blog/blog.php:540, widgets/button/button.php:121, widgets/contact/contact.php:477, widgets/contact/contact.php:707, widgets/contact/contact.php:758, widgets/google-map/google-map.php:94, base/inc/fields/image-size.class.php:69
|
688 |
+
msgid "Width"
|
689 |
+
msgstr ""
|
690 |
+
|
691 |
+
#: widgets/blog/blog.php:546, widgets/contact/contact.php:526, widgets/google-map/google-map.php:98, widgets/hero/hero.php:187, widgets/hero/hero.php:223, widgets/layout-slider/layout-slider.php:155, widgets/layout-slider/layout-slider.php:191, widgets/slider/slider.php:142, base/inc/fields/image-size.class.php:76
|
692 |
+
msgid "Height"
|
693 |
+
msgstr ""
|
694 |
+
|
695 |
+
#: widgets/blog/blog.php:557
|
696 |
+
msgid "Posts Query"
|
697 |
+
msgstr ""
|
698 |
+
|
699 |
+
#: widgets/blog/blog.php:568, widgets/button/button.php:33, widgets/contact/contact.php:953, widgets/features/features.php:381, widgets/headline/headline.php:37, widgets/social-media-buttons/social-media-buttons.php:32, base/inc/widgets/base-slider.class.php:222
|
700 |
+
msgid "Responsive Breakpoint"
|
701 |
+
msgstr ""
|
702 |
+
|
703 |
+
#: widgets/blog/blog.php:570
|
704 |
+
msgid "Device width, in pixels, to collapse into a mobile view."
|
705 |
+
msgstr ""
|
706 |
+
|
707 |
+
#. translators: used between list items, there is a space after the comma
|
708 |
+
#: widgets/blog/blog.php:930
|
709 |
+
msgid ", "
|
710 |
+
msgstr ""
|
711 |
+
|
712 |
+
#: widgets/blog/blog.php:939
|
713 |
+
msgid "Leave a comment"
|
714 |
+
msgstr ""
|
715 |
+
|
716 |
+
#: widgets/blog/blog.php:940
|
717 |
+
msgid "One Comment"
|
718 |
+
msgstr ""
|
719 |
+
|
720 |
+
#: widgets/blog/blog.php:941, widgets/blog/tpl/offset.php:48
|
721 |
+
msgid "% Comments"
|
722 |
+
msgstr ""
|
723 |
+
|
724 |
+
#: widgets/blog/blog.php:979, widgets/blog/tpl/base.php:12
|
725 |
+
msgid "Continue reading"
|
726 |
+
msgstr ""
|
727 |
+
|
728 |
+
#: widgets/blog/blog.php:1024
|
729 |
+
msgid "Post navigation"
|
730 |
+
msgstr ""
|
731 |
+
|
732 |
#: widgets/button/button.php:4, widgets/button/button.php:17
|
733 |
msgid "A powerful yet simple button widget for your sidebars or Page Builder pages."
|
734 |
msgstr ""
|
737 |
msgid "SiteOrigin Button"
|
738 |
msgstr ""
|
739 |
|
|
|
|
|
|
|
|
|
740 |
#: widgets/button/button.php:35
|
741 |
msgid "This setting controls when the Mobile Align setting will be used. The default value is 780px."
|
742 |
msgstr ""
|
785 |
msgid "Design and Layout"
|
786 |
msgstr ""
|
787 |
|
|
|
|
|
|
|
|
|
788 |
#: widgets/button/button.php:122
|
789 |
msgid "Leave blank to let the button resize according to content."
|
790 |
msgstr ""
|
841 |
msgid "Hover Text Color"
|
842 |
msgstr ""
|
843 |
|
|
|
|
|
|
|
|
|
844 |
#: widgets/button/button.php:209, widgets/contact/contact.php:317, widgets/contact/contact.php:593, widgets/contact/contact.php:695, widgets/social-media-buttons/social-media-buttons.php:141
|
845 |
msgid "Normal"
|
846 |
msgstr ""
|
1289 |
msgid "Max width"
|
1290 |
msgstr ""
|
1291 |
|
|
|
|
|
|
|
|
|
1292 |
#: widgets/contact/contact.php:530
|
1293 |
msgid "Text area height"
|
1294 |
msgstr ""
|
1295 |
|
|
|
|
|
|
|
|
|
1296 |
#: widgets/contact/contact.php:548
|
1297 |
msgid " Border style"
|
1298 |
msgstr ""
|
2149 |
msgid "Paragraph"
|
2150 |
msgstr ""
|
2151 |
|
|
|
|
|
|
|
|
|
2152 |
#: widgets/headline/headline.php:97, widgets/headline/headline.php:178, widgets/headline/headline.php:243, widgets/icon/icon.php:46
|
2153 |
msgid "Alignment"
|
2154 |
msgstr ""
|
3386 |
msgid "Post ID"
|
3387 |
msgstr ""
|
3388 |
|
3389 |
+
#: base/inc/fields/posts.class.php:107, widgets/blog/tpl/offset.php:7
|
3390 |
msgid "Author"
|
3391 |
+
msgid_plural "Authors"
|
3392 |
+
msgstr[0] ""
|
3393 |
+
msgstr[1] ""
|
3394 |
|
3395 |
#: base/inc/fields/posts.class.php:109
|
3396 |
msgid "Published date"
|
3728 |
msgid "previous slide"
|
3729 |
msgstr ""
|
3730 |
|
3731 |
+
#: widgets/blog/tpl/offset.php:26
|
3732 |
+
msgid "Written by"
|
3733 |
+
msgstr ""
|
3734 |
+
|
3735 |
+
#: widgets/blog/tpl/offset.php:36
|
3736 |
+
msgid "Posted in"
|
3737 |
+
msgstr ""
|
3738 |
+
|
3739 |
+
#: widgets/blog/tpl/offset.php:43
|
3740 |
+
msgid "Comments"
|
3741 |
+
msgstr ""
|
3742 |
+
|
3743 |
+
#: widgets/blog/tpl/offset.php:46
|
3744 |
+
msgid "Post a comment"
|
3745 |
+
msgstr ""
|
3746 |
+
|
3747 |
+
#: widgets/blog/tpl/offset.php:47
|
3748 |
+
msgid "1 Comment"
|
3749 |
+
msgstr ""
|
3750 |
+
|
3751 |
+
#. translators: %s: post date.
|
3752 |
+
#: widgets/blog/tpl/offset.php:73
|
3753 |
+
msgctxt "post date"
|
3754 |
+
msgid "Posted on %s"
|
3755 |
+
msgstr ""
|
3756 |
+
|
3757 |
#: widgets/contact/tpl/default.php:51
|
3758 |
msgid "Unable to detect Really Simple CAPTCHA plugin."
|
3759 |
msgstr ""
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Tags: widget, button, slider, hero, google maps, image, carousel, lottie, featur
|
|
3 |
Requires at least: 4.2
|
4 |
Tested up to: 6.0
|
5 |
Requires PHP: 5.6.20
|
6 |
-
Stable tag: 1.
|
7 |
-
Build time: 2022-08-
|
8 |
License: GPLv3 or later
|
9 |
Contributors: gpriday, braam-genis, alexgso
|
10 |
Donate link: https://siteorigin.com/downloads/premium/
|
@@ -23,6 +23,7 @@ Our collection is growing; here's what we have so far:
|
|
23 |
|
24 |
- **Accordion:** Squeeze a lot of content into a small space.
|
25 |
- **Anything Carousel:** Display images, text, or any other content in a carousel.
|
|
|
26 |
- **Button:** A simple button widget with a variety of styling options.
|
27 |
- **Call To Action:** Get users moving in the right direction.
|
28 |
- **Contact Form:** A lightweight contact form builder.
|
@@ -105,6 +106,9 @@ The Widgets Bundle global interface is available at Plugins > SiteOrigin Widgets
|
|
105 |
|
106 |
== Changelog ==
|
107 |
|
|
|
|
|
|
|
108 |
= 1.38.3 - 05 August 2022 =
|
109 |
* Anything Carousel: Resolved potential navigation malfunction.
|
110 |
* Post Carousel: Improved partially visible post navigation.
|
3 |
Requires at least: 4.2
|
4 |
Tested up to: 6.0
|
5 |
Requires PHP: 5.6.20
|
6 |
+
Stable tag: 1.39.0
|
7 |
+
Build time: 2022-08-08T13:52:41+02:00
|
8 |
License: GPLv3 or later
|
9 |
Contributors: gpriday, braam-genis, alexgso
|
10 |
Donate link: https://siteorigin.com/downloads/premium/
|
23 |
|
24 |
- **Accordion:** Squeeze a lot of content into a small space.
|
25 |
- **Anything Carousel:** Display images, text, or any other content in a carousel.
|
26 |
+
- **Blog:** Display blog posts in a list or grid. Choose a design that suits your content.
|
27 |
- **Button:** A simple button widget with a variety of styling options.
|
28 |
- **Call To Action:** Get users moving in the right direction.
|
29 |
- **Contact Form:** A lightweight contact form builder.
|
106 |
|
107 |
== Changelog ==
|
108 |
|
109 |
+
= 1.39.0 - 08 August 2022 =
|
110 |
+
* New Widget! Introducing the SiteOrigin Blog Widget.
|
111 |
+
|
112 |
= 1.38.3 - 05 August 2022 =
|
113 |
* Anything Carousel: Resolved potential navigation malfunction.
|
114 |
* Post Carousel: Improved partially visible post navigation.
|
so-widgets-bundle.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
|
5 |
-
Version: 1.
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /lang
|
8 |
Author: SiteOrigin
|
@@ -12,7 +12,7 @@ License: GPL3
|
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
-
define( 'SOW_BUNDLE_VERSION', '1.
|
16 |
define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
|
17 |
|
18 |
// Allow JS suffix to be pre-set.
|
2 |
/*
|
3 |
Plugin Name: SiteOrigin Widgets Bundle
|
4 |
Description: A highly customizable collection of widgets, ready to be used anywhere, neatly bundled into a single plugin.
|
5 |
+
Version: 1.39.0
|
6 |
Text Domain: so-widgets-bundle
|
7 |
Domain Path: /lang
|
8 |
Author: SiteOrigin
|
12 |
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
|
13 |
*/
|
14 |
|
15 |
+
define( 'SOW_BUNDLE_VERSION', '1.39.0' );
|
16 |
define( 'SOW_BUNDLE_BASE_FILE', __FILE__ );
|
17 |
|
18 |
// Allow JS suffix to be pre-set.
|
widgets/blog/assets/banner.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg enable-background="new 0 0 120 120" viewBox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"><path d="m0 0h120v120h-120z" fill="#1880b6"/><g stroke="#324249" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m47.1 43.2h43.9v31h-43.9z" fill="#86d7f2"/><path d="m47.1 30.3h43.9v5.2h-43.9z" fill="#f0eed5"/><path d="m71.9 57.2-17.1 17h36.2v-5.2l-11.9-11.8c-1.9-2-5.3-2-7.2 0z" fill="#f0eed5"/><circle cx="58.7" cy="54.8" fill="#f0eed5" r="3.9"/><path d="m47.1 89.7h5.2" fill="none"/><path d="m57.4 89.7h33.6" fill="none"/><path d="m47.1 82h20.7" fill="none"/><path d="m72.9 82h12.9" fill="none"/><path d="m31.6 58.7h5.2" fill="none"/><path d="m29 43.2h10.3v10.3h-10.3z" fill="#f0eed5"/></g></svg>
|
widgets/blog/blog.php
ADDED
@@ -0,0 +1,1034 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Widget Name: Blog
|
4 |
+
Description: Display blog posts in a list or grid. Choose a design that suits your content.
|
5 |
+
Author: SiteOrigin
|
6 |
+
Author URI: https://siteorigin.com
|
7 |
+
Documentation: https://siteorigin.com/widgets-bundle/blog-widget/
|
8 |
+
*/
|
9 |
+
|
10 |
+
class SiteOrigin_Widget_Blog_Widget extends SiteOrigin_Widget {
|
11 |
+
function __construct() {
|
12 |
+
parent::__construct(
|
13 |
+
'sow-blog',
|
14 |
+
__( 'SiteOrigin Blog', 'so-widgets-bundle' ),
|
15 |
+
array(
|
16 |
+
'description' => __( 'Display blog posts in a list or grid. Choose a design that suits your content.', 'so-widgets-bundle' ),
|
17 |
+
'help' => 'https://siteorigin.com/widgets-bundle/blog-widget/',
|
18 |
+
'instance_storage' => true,
|
19 |
+
'panels_title' => false,
|
20 |
+
),
|
21 |
+
array(),
|
22 |
+
false,
|
23 |
+
plugin_dir_path( __FILE__ )
|
24 |
+
);
|
25 |
+
}
|
26 |
+
|
27 |
+
function initialize() {
|
28 |
+
add_action( 'wp_loaded', array( $this, 'register_image_sizes' ) );
|
29 |
+
$this->register_frontend_styles(
|
30 |
+
array(
|
31 |
+
array(
|
32 |
+
'sow-blog',
|
33 |
+
plugin_dir_url( __FILE__ ) . 'css/style.css',
|
34 |
+
),
|
35 |
+
)
|
36 |
+
);
|
37 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'register_template_assets' ) );
|
38 |
+
}
|
39 |
+
|
40 |
+
function register_image_sizes() {
|
41 |
+
add_image_size( 'sow-blog-portfolio', 375, 375, true );
|
42 |
+
}
|
43 |
+
|
44 |
+
function get_widget_form() {
|
45 |
+
$templates = apply_filters( 'siteorigin_widgets_blog_templates', json_decode( file_get_contents( plugin_dir_path( __FILE__ ) . 'data/templates.json' ), true ) );
|
46 |
+
|
47 |
+
return $this->dynamic_preset_state_handler(
|
48 |
+
'active_template',
|
49 |
+
$templates,
|
50 |
+
array(
|
51 |
+
'title' => array(
|
52 |
+
'type' => 'text',
|
53 |
+
'label' => __( 'Title', 'so-widgets-bundle' ),
|
54 |
+
),
|
55 |
+
'template' => array(
|
56 |
+
'type' => 'presets',
|
57 |
+
'label' => __( 'Template', 'so-widgets-bundle'),
|
58 |
+
'default' => 'standard',
|
59 |
+
'options' => $templates,
|
60 |
+
'state_emitter' => array(
|
61 |
+
'callback' => 'select',
|
62 |
+
'args' => array( 'active_template' ),
|
63 |
+
),
|
64 |
+
),
|
65 |
+
'settings' => array(
|
66 |
+
'type' => 'section',
|
67 |
+
'label' => __( 'Settings', 'so-widgets-bundle' ),
|
68 |
+
'hide' => true,
|
69 |
+
'fields' => array(
|
70 |
+
'columns' => array(
|
71 |
+
'type' => 'number',
|
72 |
+
'label' => __( 'Column Count', 'so-widgets-bundle' ),
|
73 |
+
),
|
74 |
+
'featured_image' => array(
|
75 |
+
'type' => 'checkbox',
|
76 |
+
'label' => __( 'Featured Image', 'so-widgets-bundle' ),
|
77 |
+
'default' => true,
|
78 |
+
),
|
79 |
+
'content' => array(
|
80 |
+
'type' => 'select',
|
81 |
+
'label' => __( 'Post Content ', 'so-widgets-bundle' ),
|
82 |
+
'description' => __( 'Choose how to display your post content. Select Full Post Content if using the "more" quicktag.', 'so-widgets-bundle' ),
|
83 |
+
'default' => 'full',
|
84 |
+
'options' => array(
|
85 |
+
'excerpt' => __( 'Post Excerpt', 'so-widgets-bundle' ),
|
86 |
+
'full' => __( 'Full Post Content', 'so-widgets-bundle' ),
|
87 |
+
),
|
88 |
+
'state_emitter' => array(
|
89 |
+
'callback' => 'select',
|
90 |
+
'args' => array( 'content_type' ),
|
91 |
+
),
|
92 |
+
),
|
93 |
+
'read_more' => array(
|
94 |
+
'type' => 'checkbox',
|
95 |
+
'label' => __( 'Post Excerpt Read More Link', 'so-widgets-bundle' ),
|
96 |
+
'description' => __( 'Display the Read More link below the post excerpt.', 'so-widgets-bundle' ),
|
97 |
+
'state_handler' => array(
|
98 |
+
'content_type[excerpt]' => array( 'show' ),
|
99 |
+
'_else[content_type]' => array( 'hide' ),
|
100 |
+
),
|
101 |
+
),
|
102 |
+
'date' => array(
|
103 |
+
'type' => 'checkbox',
|
104 |
+
'label' => __( 'Post Date', 'so-widgets-bundle' ),
|
105 |
+
'default' => true,
|
106 |
+
),
|
107 |
+
'author' => array(
|
108 |
+
'type' => 'checkbox',
|
109 |
+
'label' => __( 'Post Author', 'so-widgets-bundle' ),
|
110 |
+
'default' => true,
|
111 |
+
),
|
112 |
+
'filter_categories' => array(
|
113 |
+
'type' => 'checkbox',
|
114 |
+
'label' => __( 'Filter Categories ', 'so-widgets-bundle' ),
|
115 |
+
'default' => true,
|
116 |
+
'state_emitter' => array(
|
117 |
+
'callback' => 'conditional',
|
118 |
+
'args' => array(
|
119 |
+
'filter_categories[show]: val',
|
120 |
+
'filter_categories[hide]: ! val',
|
121 |
+
),
|
122 |
+
),
|
123 |
+
),
|
124 |
+
'categories' => array(
|
125 |
+
'type' => 'checkbox',
|
126 |
+
'label' => __( 'Post Categories', 'so-widgets-bundle' ),
|
127 |
+
'default' => true,
|
128 |
+
),
|
129 |
+
'comment_count' => array(
|
130 |
+
'type' => 'checkbox',
|
131 |
+
'label' => __( 'Post Comment Count', 'so-widgets-bundle' ),
|
132 |
+
'default' => true,
|
133 |
+
),
|
134 |
+
),
|
135 |
+
),
|
136 |
+
|
137 |
+
'design' => array(
|
138 |
+
'type' => 'section',
|
139 |
+
'label' => __( 'Design', 'so-widgets-bundle' ),
|
140 |
+
'hide' => true,
|
141 |
+
'fields' => array(
|
142 |
+
'post' => array(
|
143 |
+
'type' => 'section',
|
144 |
+
'label' => __( 'Post', 'so-widgets-bundle' ),
|
145 |
+
'hide' => true,
|
146 |
+
'fields' => array(
|
147 |
+
'border' => array(
|
148 |
+
'type' => 'color',
|
149 |
+
'label' => __( 'Border Color', 'so-widgets-bundle' ),
|
150 |
+
'default' => '#e6e6e6',
|
151 |
+
),
|
152 |
+
'background' => array(
|
153 |
+
'type' => 'color',
|
154 |
+
'label' => __( 'Background Color', 'so-widgets-bundle' ),
|
155 |
+
'default' => '#fff',
|
156 |
+
),
|
157 |
+
),
|
158 |
+
),
|
159 |
+
'title' => array(
|
160 |
+
'type' => 'section',
|
161 |
+
'label' => __( 'Post Title', 'so-widgets-bundle' ),
|
162 |
+
'hide' => true,
|
163 |
+
'fields' => array(
|
164 |
+
'font' => array(
|
165 |
+
'type' => 'font',
|
166 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
167 |
+
),
|
168 |
+
'font_size' => array(
|
169 |
+
'type' => 'measurement',
|
170 |
+
'label' => __( 'Font Size', 'so-widgets-bundle' ),
|
171 |
+
'default' => '24px',
|
172 |
+
),
|
173 |
+
'color' => array(
|
174 |
+
'type' => 'color',
|
175 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
176 |
+
'default' => '#2d2d2d',
|
177 |
+
),
|
178 |
+
'color_hover' => array(
|
179 |
+
'type' => 'color',
|
180 |
+
'label' => __( 'Hover Color', 'so-widgets-bundle' ),
|
181 |
+
'default' => '#626262',
|
182 |
+
),
|
183 |
+
),
|
184 |
+
),
|
185 |
+
|
186 |
+
'meta' => array(
|
187 |
+
'type' => 'section',
|
188 |
+
'label' => __( 'Post Meta', 'so-widgets-bundle' ),
|
189 |
+
'hide' => true,
|
190 |
+
'fields' => array(
|
191 |
+
'font' => array(
|
192 |
+
'type' => 'font',
|
193 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
194 |
+
),
|
195 |
+
'font_size' => array(
|
196 |
+
'type' => 'measurement',
|
197 |
+
'label' => __( 'Font Size', 'so-widgets-bundle' ),
|
198 |
+
'default' => '13px',
|
199 |
+
),
|
200 |
+
'color' => array(
|
201 |
+
'type' => 'color',
|
202 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
203 |
+
'default' => '#929292',
|
204 |
+
),
|
205 |
+
'color_hover' => array(
|
206 |
+
'type' => 'color',
|
207 |
+
'label' => __( 'Hover Color', 'so-widgets-bundle' ),
|
208 |
+
'default' => '#f14e4e',
|
209 |
+
),
|
210 |
+
),
|
211 |
+
),
|
212 |
+
|
213 |
+
'offset_post_meta' => array(
|
214 |
+
'type' => 'section',
|
215 |
+
'label' => __( 'Offset Post Meta', 'so-widgets-bundle' ),
|
216 |
+
'hide' => true,
|
217 |
+
'fields' => array(
|
218 |
+
'font' => array(
|
219 |
+
'type' => 'font',
|
220 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
221 |
+
),
|
222 |
+
'font_size' => array(
|
223 |
+
'type' => 'measurement',
|
224 |
+
'label' => __( 'Font Size', 'so-widgets-bundle' ),
|
225 |
+
'default' => '13px',
|
226 |
+
),
|
227 |
+
'color' => array(
|
228 |
+
'type' => 'color',
|
229 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
230 |
+
'default' => '#929292',
|
231 |
+
),
|
232 |
+
'link_color' => array(
|
233 |
+
'type' => 'color',
|
234 |
+
'label' => __( 'Link Color', 'so-widgets-bundle' ),
|
235 |
+
'default' => '#2d2d2d',
|
236 |
+
),
|
237 |
+
'link_color_hover' => array(
|
238 |
+
'type' => 'color',
|
239 |
+
'label' => __( 'Link Color Hover', 'so-widgets-bundle' ),
|
240 |
+
'default' => '#f14e4e',
|
241 |
+
),
|
242 |
+
'link_font_size' => array(
|
243 |
+
'type' => 'measurement',
|
244 |
+
'label' => __( 'Link Font Size', 'so-widgets-bundle' ),
|
245 |
+
'default' => '14px',
|
246 |
+
),
|
247 |
+
),
|
248 |
+
),
|
249 |
+
|
250 |
+
'overlay_post_category' => array(
|
251 |
+
'type' => 'section',
|
252 |
+
'label' => __( 'Overlay Post Category', 'so-widgets-bundle' ),
|
253 |
+
'hide' => true,
|
254 |
+
'fields' => array(
|
255 |
+
'font' => array(
|
256 |
+
'type' => 'font',
|
257 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
258 |
+
),
|
259 |
+
'font_size' => array(
|
260 |
+
'type' => 'measurement',
|
261 |
+
'label' => __( 'Font Size', 'so-widgets-bundle' ),
|
262 |
+
'default' => '11px',
|
263 |
+
),
|
264 |
+
'color' => array(
|
265 |
+
'type' => 'color',
|
266 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
267 |
+
'default' => '#fff',
|
268 |
+
),
|
269 |
+
'color_hover' => array(
|
270 |
+
'type' => 'color',
|
271 |
+
'label' => __( 'Hover Color', 'so-widgets-bundle' ),
|
272 |
+
'default' => '#fff',
|
273 |
+
),
|
274 |
+
'background' => array(
|
275 |
+
'type' => 'color',
|
276 |
+
'label' => __( 'Background', 'so-widgets-bundle' ),
|
277 |
+
'default' => '#000',
|
278 |
+
),
|
279 |
+
'background_hover' => array(
|
280 |
+
'type' => 'color',
|
281 |
+
'label' => __( 'Hover Background', 'so-widgets-bundle' ),
|
282 |
+
'default' => '#000',
|
283 |
+
),
|
284 |
+
'background_opacity' => array(
|
285 |
+
'type' => 'slider',
|
286 |
+
'label' => __( 'Background Opacity', 'so-widgets-bundle' ),
|
287 |
+
'min' => 0,
|
288 |
+
'max' => 1,
|
289 |
+
'step' => 0.01,
|
290 |
+
'default' => '0.7',
|
291 |
+
),
|
292 |
+
'background_opacity_hover' => array(
|
293 |
+
'type' => 'slider',
|
294 |
+
'label' => __( 'Background Opacity Hover', 'so-widgets-bundle' ),
|
295 |
+
'min' => 0,
|
296 |
+
'max' => 1,
|
297 |
+
'step' => 0.01,
|
298 |
+
'default' => '0.75',
|
299 |
+
),
|
300 |
+
),
|
301 |
+
),
|
302 |
+
|
303 |
+
'content' => array(
|
304 |
+
'type' => 'section',
|
305 |
+
'label' => __( 'Post Content', 'so-widgets-bundle' ),
|
306 |
+
'hide' => true,
|
307 |
+
'fields' => array(
|
308 |
+
'font' => array(
|
309 |
+
'type' => 'font',
|
310 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
311 |
+
),
|
312 |
+
'font_size' => array(
|
313 |
+
'type' => 'measurement',
|
314 |
+
'label' => __( 'Font Size', 'so-widgets-bundle' ),
|
315 |
+
'default' => '15',
|
316 |
+
),
|
317 |
+
'color' => array(
|
318 |
+
'type' => 'color',
|
319 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
320 |
+
'default' => '#626262',
|
321 |
+
),
|
322 |
+
'link_color' => array(
|
323 |
+
'type' => 'color',
|
324 |
+
'label' => __( 'Link Color', 'so-widgets-bundle' ),
|
325 |
+
'default' => '#f14e4e',
|
326 |
+
),
|
327 |
+
'link_color_hover' => array(
|
328 |
+
'type' => 'color',
|
329 |
+
'label' => __( 'Link Hover Color', 'so-widgets-bundle' ),
|
330 |
+
'default' => '#626262',
|
331 |
+
),
|
332 |
+
),
|
333 |
+
),
|
334 |
+
|
335 |
+
'filter_categories' => array(
|
336 |
+
'type' => 'section',
|
337 |
+
'label' => __( 'Filter Categories', 'so-widgets-bundle' ),
|
338 |
+
'hide' => true,
|
339 |
+
'fields' => array(
|
340 |
+
'font' => array(
|
341 |
+
'type' => 'font',
|
342 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
343 |
+
'state_handler' => array(
|
344 |
+
'filter_categories[show]' => array( 'show' ),
|
345 |
+
'filter_categories[hide]' => array( 'hide' ),
|
346 |
+
),
|
347 |
+
),
|
348 |
+
'font_size' => array(
|
349 |
+
'type' => 'measurement',
|
350 |
+
'label' => __( 'Font Size', 'so-widgets-bundle' ),
|
351 |
+
'default' => '11px',
|
352 |
+
'state_handler' => array(
|
353 |
+
'filter_categories[show]' => array( 'show' ),
|
354 |
+
'filter_categories[hide]' => array( 'hide' ),
|
355 |
+
),
|
356 |
+
),
|
357 |
+
'color' => array(
|
358 |
+
'type' => 'color',
|
359 |
+
'label' => __( 'Color', 'so-widgets-bundle' ),
|
360 |
+
'default' => '#929292',
|
361 |
+
'state_handler' => array(
|
362 |
+
'filter_categories[show]' => array( 'show' ),
|
363 |
+
'filter_categories[hide]' => array( 'hide' ),
|
364 |
+
),
|
365 |
+
),
|
366 |
+
'color_hover' => array(
|
367 |
+
'type' => 'color',
|
368 |
+
'label' => __( 'Hover Color', 'so-widgets-bundle' ),
|
369 |
+
'default' => '#2d2d2d',
|
370 |
+
'state_handler' => array(
|
371 |
+
'filter_categories[show]' => array( 'show' ),
|
372 |
+
'filter_categories[hide]' => array( 'hide' ),
|
373 |
+
),
|
374 |
+
),
|
375 |
+
'text_transform' => array(
|
376 |
+
'type' => 'checkbox',
|
377 |
+
'label' => __( 'Capitalize Categories', 'so-widgets-bundle' ),
|
378 |
+
'default' => true,
|
379 |
+
'state_handler' => array(
|
380 |
+
'filter_categories[show]' => array( 'show' ),
|
381 |
+
'filter_categories[hide]' => array( 'hide' ),
|
382 |
+
),
|
383 |
+
),
|
384 |
+
'selected_border_color' => array(
|
385 |
+
'type' => 'color',
|
386 |
+
'label' => __( 'Selected Border Color', 'so-widgets-bundle' ),
|
387 |
+
'default' => '#2d2d2d',
|
388 |
+
'state_handler' => array(
|
389 |
+
'filter_categories[show]' => array( 'show' ),
|
390 |
+
'filter_categories[hide]' => array( 'hide' ),
|
391 |
+
),
|
392 |
+
),
|
393 |
+
'selected_border_thickness' => array(
|
394 |
+
'type' => 'measurement',
|
395 |
+
'label' => __( 'Selected Border Thickness', 'so-widgets-bundle' ),
|
396 |
+
'default' => '2px',
|
397 |
+
'state_handler' => array(
|
398 |
+
'filter_categories[show]' => array( 'show' ),
|
399 |
+
'filter_categories[hide]' => array( 'hide' ),
|
400 |
+
),
|
401 |
+
),
|
402 |
+
),
|
403 |
+
),
|
404 |
+
|
405 |
+
'featured_image' => array(
|
406 |
+
'type' => 'section',
|
407 |
+
'label' => __( 'Featured Image', 'so-widgets-bundle' ),
|
408 |
+
'hide' => true,
|
409 |
+
'fields' => array(
|
410 |
+
'border_color' => array(
|
411 |
+
'type' => 'color',
|
412 |
+
'label' => __( 'Border Color', 'so-widgets-bundle' ),
|
413 |
+
'default' => '#929292',
|
414 |
+
),
|
415 |
+
'hover_overlay_color' => array(
|
416 |
+
'type' => 'color',
|
417 |
+
'label' => __( 'Hover Overlay Color', 'so-widgets-bundle' ),
|
418 |
+
'default' => '#ffffff',
|
419 |
+
),
|
420 |
+
'hover_overlay_opacity' => array(
|
421 |
+
'label' => __( 'Hover Overlay Opacity', 'so-widgets-bundle' ),
|
422 |
+
'type' => 'slider',
|
423 |
+
'min' => 0,
|
424 |
+
'max' => 1,
|
425 |
+
'step' => 0.01,
|
426 |
+
'default' => '0.9',
|
427 |
+
),
|
428 |
+
'post_title_font' => array(
|
429 |
+
'type' => 'font',
|
430 |
+
'label' => __( 'Post Title Font', 'so-widgets-bundle' ),
|
431 |
+
),
|
432 |
+
'post_title_font_size' => array(
|
433 |
+
'type' => 'measurement',
|
434 |
+
'label' => __( 'Post Title Font Size', 'so-widgets-bundle' ),
|
435 |
+
'default' => '15px',
|
436 |
+
),
|
437 |
+
'post_title_color' => array(
|
438 |
+
'type' => 'color',
|
439 |
+
'label' => __( 'Post Title Color', 'so-widgets-bundle' ),
|
440 |
+
'default' => '#2d2d2d',
|
441 |
+
),
|
442 |
+
'divider_border_color' => array(
|
443 |
+
'type' => 'color',
|
444 |
+
'label' => __( 'Divider Border Color', 'so-widgets-bundle' ),
|
445 |
+
'default' => '#2d2d2d',
|
446 |
+
),
|
447 |
+
'divider_border_thickness' => array(
|
448 |
+
'type' => 'measurement',
|
449 |
+
'label' => __( 'Divider Border Thickness', 'so-widgets-bundle' ),
|
450 |
+
'default' => '1px',
|
451 |
+
),
|
452 |
+
'divider_border_margin' => array(
|
453 |
+
'type' => 'measurement',
|
454 |
+
'label' => __( 'Divider Border Margin', 'so-widgets-bundle' ),
|
455 |
+
'default' => '13px',
|
456 |
+
),
|
457 |
+
'post_meta_font' => array(
|
458 |
+
'type' => 'font',
|
459 |
+
'label' => __( 'Post Meta Font', 'so-widgets-bundle' ),
|
460 |
+
),
|
461 |
+
'post_meta_font_size' => array(
|
462 |
+
'type' => 'measurement',
|
463 |
+
'label' => __( 'Post Meta Font Size', 'so-widgets-bundle' ),
|
464 |
+
'default' => '11px',
|
465 |
+
),
|
466 |
+
'post_meta_color' => array(
|
467 |
+
'type' => 'color',
|
468 |
+
'label' => __( 'Post Meta Color', 'so-widgets-bundle' ),
|
469 |
+
'default' => '#929292',
|
470 |
+
),
|
471 |
+
),
|
472 |
+
),
|
473 |
+
|
474 |
+
'pagination' => array(
|
475 |
+
'type' => 'section',
|
476 |
+
'label' => __( 'Pagination', 'so-widgets-bundle' ),
|
477 |
+
'hide' => true,
|
478 |
+
'fields' => array(
|
479 |
+
'top_margin' => array(
|
480 |
+
'type' => 'measurement',
|
481 |
+
'label' => __( 'Top Margin', 'so-widgets-bundle' ),
|
482 |
+
'default' => '30px',
|
483 |
+
),
|
484 |
+
'link_margin' => array(
|
485 |
+
'type' => 'measurement',
|
486 |
+
'label' => __( 'Link Margin', 'so-widgets-bundle' ),
|
487 |
+
'default' => '8px',
|
488 |
+
),
|
489 |
+
'border_color' => array(
|
490 |
+
'type' => 'color',
|
491 |
+
'label' => __( 'Border Color', 'so-widgets-bundle' ),
|
492 |
+
'default' => '#626262',
|
493 |
+
),
|
494 |
+
'border_color_hover' => array(
|
495 |
+
'type' => 'color',
|
496 |
+
'label' => __( 'Border Color Hover', 'so-widgets-bundle' ),
|
497 |
+
'default' => '#f14e4e',
|
498 |
+
),
|
499 |
+
'background' => array(
|
500 |
+
'type' => 'color',
|
501 |
+
'label' => __( 'Background', 'so-widgets-bundle' ),
|
502 |
+
),
|
503 |
+
'background_hover' => array(
|
504 |
+
'type' => 'color',
|
505 |
+
'label' => __( 'Hover Background', 'so-widgets-bundle' ),
|
506 |
+
),
|
507 |
+
'border_radius' => array(
|
508 |
+
'type' => 'slider',
|
509 |
+
'label' => __( 'Border Radius', 'so-widgets-bundle' ),
|
510 |
+
'max' => 50,
|
511 |
+
'min' => 0,
|
512 |
+
'step' => 1,
|
513 |
+
),
|
514 |
+
'font' => array(
|
515 |
+
'type' => 'font',
|
516 |
+
'label' => __( 'Font', 'so-widgets-bundle' ),
|
517 |
+
),
|
518 |
+
'font_size' => array(
|
519 |
+
'type' => 'measurement',
|
520 |
+
'label' => __( 'Font Size', 'so-widgets-bundle' ),
|
521 |
+
'default' => '14px',
|
522 |
+
),
|
523 |
+
'link_color' => array(
|
524 |
+
'type' => 'color',
|
525 |
+
'label' => __( 'Link Color', 'so-widgets-bundle' ),
|
526 |
+
'default' => '#626262',
|
527 |
+
),
|
528 |
+
'link_color_hover' => array(
|
529 |
+
'type' => 'color',
|
530 |
+
'label' => __( 'Link Hover Color', 'so-widgets-bundle' ),
|
531 |
+
'default' => '#f14e4e',
|
532 |
+
),
|
533 |
+
'dots_color' => array(
|
534 |
+
'type' => 'color',
|
535 |
+
'label' => __( 'Dots Color', 'so-widgets-bundle' ),
|
536 |
+
'default' => '#626262',
|
537 |
+
),
|
538 |
+
'width' => array(
|
539 |
+
'type' => 'measurement',
|
540 |
+
'label' => __( 'Width', 'so-widgets-bundle' ),
|
541 |
+
'units' => array( 'px', 'vh', 'vw', 'vmin', 'vmax' ),
|
542 |
+
'default' => '40px',
|
543 |
+
),
|
544 |
+
'height' => array(
|
545 |
+
'type' => 'measurement',
|
546 |
+
'label' => __( 'Height', 'so-widgets-bundle' ),
|
547 |
+
'units' => array( 'px', 'vh', 'vw', 'vmin', 'vmax' ),
|
548 |
+
'default' => '43px',
|
549 |
+
),
|
550 |
+
),
|
551 |
+
),
|
552 |
+
),
|
553 |
+
),
|
554 |
+
|
555 |
+
'posts' => array(
|
556 |
+
'type' => 'posts',
|
557 |
+
'label' => __( 'Posts Query', 'so-widgets-bundle' ),
|
558 |
+
'hide' => true,
|
559 |
+
),
|
560 |
+
)
|
561 |
+
);
|
562 |
+
}
|
563 |
+
|
564 |
+
function get_settings_form() {
|
565 |
+
return array(
|
566 |
+
'responsive_breakpoint' => array(
|
567 |
+
'type' => 'measurement',
|
568 |
+
'label' => __( 'Responsive Breakpoint', 'so-widgets-bundle' ),
|
569 |
+
'default' => '780px',
|
570 |
+
'description' => __( 'Device width, in pixels, to collapse into a mobile view.', 'so-widgets-bundle' )
|
571 |
+
)
|
572 |
+
);
|
573 |
+
}
|
574 |
+
|
575 |
+
function register_template_assets() {
|
576 |
+
wp_register_script( 'sow-blog-template-masonry', plugin_dir_url( __FILE__ ) . 'js/masonry' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery', 'jquery-isotope' ) );
|
577 |
+
wp_register_script( 'sow-blog-template-portfolio', plugin_dir_url( __FILE__ ) . 'js/portfolio' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery', 'jquery-isotope' ) );
|
578 |
+
|
579 |
+
wp_register_script( 'jquery-isotope', plugin_dir_url( SOW_BUNDLE_BASE_FILE ) . 'js/lib/isotope.pkgd' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), '3.0.4', true );
|
580 |
+
|
581 |
+
do_action( 'siteorigin_widgets_blog_template_stylesheets' );
|
582 |
+
}
|
583 |
+
|
584 |
+
function get_template_name( $instance ) {
|
585 |
+
return 'base';
|
586 |
+
}
|
587 |
+
|
588 |
+
function get_style_name( $instance ) {
|
589 |
+
$template = empty( $instance['template'] ) ? 'standard' : $instance['template'];
|
590 |
+
|
591 |
+
// If this template has any assets, load them.
|
592 |
+
if ( wp_style_is( 'sow-blog-template-' . $template, 'registered' ) ) {
|
593 |
+
wp_enqueue_style( 'sow-blog-template-' . $template );
|
594 |
+
}
|
595 |
+
|
596 |
+
if ( wp_script_is( 'sow-blog-template-' . $template, 'registered' ) ) {
|
597 |
+
wp_enqueue_script( 'sow-blog-template-' . $template );
|
598 |
+
}
|
599 |
+
|
600 |
+
return $template;
|
601 |
+
}
|
602 |
+
|
603 |
+
function get_less_variables( $instance ) {
|
604 |
+
if ( empty( $instance ) ) {
|
605 |
+
return array();
|
606 |
+
}
|
607 |
+
|
608 |
+
$less_vars = array(
|
609 |
+
'responsive_breakpoint' => $this->get_global_settings( 'responsive_breakpoint' ),
|
610 |
+
'categories' => ! empty( $instance['settings']['categories'] ) ? $instance['settings']['categories'] : false,
|
611 |
+
'author' => ! empty( $instance['settings']['author'] ) ? $instance['settings']['author'] : false,
|
612 |
+
'columns' => (int) $instance['settings']['columns'] > 0 ? (int) $instance['settings']['columns'] : 1,
|
613 |
+
);
|
614 |
+
|
615 |
+
if ( $instance['template'] == 'masonry' ) {
|
616 |
+
$less_vars['column_width'] = 100 / $less_vars['columns'] - $less_vars['columns'] * 0.5 . '%';
|
617 |
+
} elseif ( $instance['template'] == 'grid' && $less_vars['columns'] > 2 ) {
|
618 |
+
$less_vars['column_spacing'] = $less_vars['columns'] * 0.5 . '%';
|
619 |
+
}
|
620 |
+
|
621 |
+
if ( $instance['template'] != 'portfolio' ) {
|
622 |
+
|
623 |
+
// Post.
|
624 |
+
$less_vars['post_border_color'] = ! empty( $instance['design']['post']['border'] ) ? $instance['design']['post']['border'] : '';
|
625 |
+
$less_vars['post_background'] = ! empty( $instance['design']['post']['background'] ) ? $instance['design']['post']['background'] : '';
|
626 |
+
|
627 |
+
// Post Title.
|
628 |
+
if ( ! empty( $instance['design']['title']['font'] ) ) {
|
629 |
+
$font = siteorigin_widget_get_font( $instance['design']['title']['font'] );
|
630 |
+
$less_vars['title_font'] = $font['family'];
|
631 |
+
if ( ! empty( $font['weight'] ) ) {
|
632 |
+
$less_vars['title_font_style'] = $font['style'];
|
633 |
+
$less_vars['title_font_weight'] = $font['weight_raw'];
|
634 |
+
}
|
635 |
+
}
|
636 |
+
$less_vars['title_font_size'] = ! empty( $instance['design']['title']['font_size'] ) ? $instance['design']['title']['font_size'] : '';
|
637 |
+
$less_vars['title_color'] = ! empty( $instance['design']['title']['color'] ) ? $instance['design']['title']['color'] : '';
|
638 |
+
$less_vars['title_color_hover'] = ! empty( $instance['design']['title']['color_hover'] ) ? $instance['design']['title']['color_hover'] : '';
|
639 |
+
|
640 |
+
// Post Meta.
|
641 |
+
if ( ! empty( $instance['design']['meta']['font'] ) ) {
|
642 |
+
$font = siteorigin_widget_get_font( $instance['design']['meta']['font'] );
|
643 |
+
$less_vars['meta_font'] = $font['family'];
|
644 |
+
if ( ! empty( $font['weight'] ) ) {
|
645 |
+
$less_vars['meta_font_style'] = $font['style'];
|
646 |
+
$less_vars['meta_font_weight'] = $font['weight_raw'];
|
647 |
+
}
|
648 |
+
}
|
649 |
+
$less_vars['meta_font_size'] = ! empty( $instance['design']['meta']['font_size'] ) ? $instance['design']['meta']['font_size'] : '';
|
650 |
+
$less_vars['meta_color'] = ! empty( $instance['design']['meta']['color'] ) ? $instance['design']['meta']['color'] : '';
|
651 |
+
$less_vars['meta_color_hover'] = ! empty( $instance['design']['meta']['color_hover'] ) ? $instance['design']['meta']['color_hover'] : '';
|
652 |
+
|
653 |
+
if ( $instance['template'] == 'offset' ) {
|
654 |
+
// Offset Post Meta.
|
655 |
+
if ( ! empty( $instance['design']['offset_post_meta']['font'] ) ) {
|
656 |
+
$font = siteorigin_widget_get_font( $instance['design']['offset_post_meta']['font'] );
|
657 |
+
$less_vars['offset_post_meta_font'] = $font['family'];
|
658 |
+
if ( ! empty( $font['weight'] ) ) {
|
659 |
+
$less_vars['offset_post_meta_font_style'] = $font['style'];
|
660 |
+
$less_vars['offset_post_meta_font_weight'] = $font['weight_raw'];
|
661 |
+
}
|
662 |
+
}
|
663 |
+
$less_vars['offset_post_meta_font_size'] = ! empty( $instance['design']['offset_post_meta']['font_size'] ) ? $instance['design']['offset_post_meta']['font_size'] : '';
|
664 |
+
$less_vars['offset_post_meta_color'] = ! empty( $instance['design']['offset_post_meta']['color'] ) ? $instance['design']['offset_post_meta']['color'] : '';
|
665 |
+
$less_vars['offset_post_meta_link_color'] = ! empty( $instance['design']['offset_post_meta']['link_color'] ) ? $instance['design']['offset_post_meta']['link_color'] : '';
|
666 |
+
$less_vars['offset_post_meta_link_color_hover'] = ! empty( $instance['design']['offset_post_meta']['link_color_hover'] ) ? $instance['design']['offset_post_meta']['link_color_hover'] : '';
|
667 |
+
$less_vars['offset_post_meta_link_font_size'] = ! empty( $instance['design']['offset_post_meta']['link_font_size'] ) ? $instance['design']['offset_post_meta']['link_font_size'] : '';
|
668 |
+
}
|
669 |
+
|
670 |
+
// Content.
|
671 |
+
if ( ! empty( $instance['design']['content']['font'] ) ) {
|
672 |
+
$font = siteorigin_widget_get_font( $instance['design']['content']['font'] );
|
673 |
+
$less_vars['content_font'] = $font['family'];
|
674 |
+
if ( ! empty( $font['weight'] ) ) {
|
675 |
+
$less_vars['content_font_style'] = $font['style'];
|
676 |
+
$less_vars['content_font_weight'] = $font['weight_raw'];
|
677 |
+
}
|
678 |
+
}
|
679 |
+
$less_vars['content_font_size'] = ! empty( $instance['design']['content']['font_size'] ) ? $instance['design']['content']['font_size'] : '';
|
680 |
+
$less_vars['content_color'] = ! empty( $instance['design']['content']['color'] ) ? $instance['design']['content']['color'] : '';
|
681 |
+
$less_vars['content_link'] = ! empty( $instance['design']['content']['link_color'] ) ? $instance['design']['content']['link_color'] : '';
|
682 |
+
$less_vars['content_link_hover'] = ! empty( $instance['design']['content']['link_color_hover'] ) ? $instance['design']['content']['link_color_hover'] : '';
|
683 |
+
} else {
|
684 |
+
$less_vars['column_width'] = number_format( 100 / $less_vars['columns'], 2 ) . '%';
|
685 |
+
if ( empty( $less_vars['categories'] ) && ! empty( $instance['settings']['filter_categories'] ) ) {
|
686 |
+
$less_vars['categories'] = 1;
|
687 |
+
}
|
688 |
+
}
|
689 |
+
|
690 |
+
// Pagination.
|
691 |
+
$less_vars['pagination_top_margin'] = ! empty( $instance['design']['pagination']['top_margin'] ) ? $instance['design']['pagination']['top_margin'] : '';
|
692 |
+
$less_vars['pagination_link_margin'] = ! empty( $instance['design']['pagination']['link_margin'] ) ? $instance['design']['pagination']['link_margin'] : '';
|
693 |
+
$less_vars['pagination_link_margin_offset'] = ! empty( $instance['design']['pagination']['link_margin'] ) ? '-' . $instance['design']['pagination']['link_margin'] : '';
|
694 |
+
$less_vars['pagination_border_color'] = ! empty( $instance['design']['pagination']['border_color'] ) ? $instance['design']['pagination']['border_color'] : '';
|
695 |
+
$less_vars['pagination_border_color_hover'] = ! empty( $instance['design']['pagination']['border_color_hover'] ) ? $instance['design']['pagination']['border_color_hover'] : '';
|
696 |
+
$less_vars['pagination_background'] = ! empty( $instance['design']['pagination']['background'] ) ? $instance['design']['pagination']['background'] : '';
|
697 |
+
$less_vars['pagination_background_hover'] = ! empty( $instance['design']['pagination']['background_hover'] ) ? $instance['design']['pagination']['background_hover'] : '';
|
698 |
+
$less_vars['pagination_border_radius'] = ! empty( $instance['design']['pagination']['border_radius'] ) ? $instance['design']['pagination']['border_radius'] . 'px' : '';
|
699 |
+
if ( ! empty( $instance['design']['pagination']['font'] ) ) {
|
700 |
+
$font = siteorigin_widget_get_font( $instance['design']['pagination']['font'] );
|
701 |
+
$less_vars['pagination_font'] = $font['family'];
|
702 |
+
if ( ! empty( $font['weight'] ) ) {
|
703 |
+
$less_vars['pagination_font_style'] = $font['style'];
|
704 |
+
$less_vars['pagination_font_weight'] = $font['weight_raw'];
|
705 |
+
}
|
706 |
+
}
|
707 |
+
$less_vars['pagination_font_size'] = ! empty( $instance['design']['pagination']['font_size'] ) ? $instance['design']['pagination']['font_size'] : '';
|
708 |
+
$less_vars['pagination_link_color'] = ! empty( $instance['design']['pagination']['link_color'] ) ? $instance['design']['pagination']['link_color'] : '';
|
709 |
+
$less_vars['pagination_link_color_hover'] = ! empty( $instance['design']['pagination']['link_color_hover'] ) ? $instance['design']['pagination']['link_color_hover'] : '';
|
710 |
+
$less_vars['pagination_dots_color'] = ! empty( $instance['design']['pagination']['dots_color'] ) ? $instance['design']['pagination']['dots_color'] : '';
|
711 |
+
$less_vars['pagination_width'] = ! empty( $instance['design']['pagination']['width'] ) ? $instance['design']['pagination']['width'] : '';
|
712 |
+
$less_vars['pagination_height'] = ! empty( $instance['design']['pagination']['height'] ) ? $instance['design']['pagination']['height'] : '';
|
713 |
+
|
714 |
+
if ( $instance['template'] == 'masonry' ) {
|
715 |
+
// Overlay Post Category.
|
716 |
+
if ( ! empty( $instance['design']['overlay_post_category']['font'] ) ) {
|
717 |
+
$font = siteorigin_widget_get_font( $instance['design']['overlay_post_category']['font'] );
|
718 |
+
$less_vars['overlay_post_category_font'] = $font['family'];
|
719 |
+
if ( ! empty( $font['weight'] ) ) {
|
720 |
+
$less_vars['overlay_post_category_font_style'] = $font['style'];
|
721 |
+
$less_vars['overlay_post_category_font_weight'] = $font['weight_raw'];
|
722 |
+
}
|
723 |
+
}
|
724 |
+
$less_vars['overlay_post_category_font_size'] = ! empty( $instance['design']['overlay_post_category']['font_size'] ) ? $instance['design']['overlay_post_category']['font_size'] : '';
|
725 |
+
$less_vars['overlay_post_category_color'] = ! empty( $instance['design']['overlay_post_category']['color'] ) ? $instance['design']['overlay_post_category']['color'] : '';
|
726 |
+
$less_vars['overlay_post_category_color_hover'] = ! empty( $instance['design']['overlay_post_category']['color_hover'] ) ? $instance['design']['overlay_post_category']['color_hover'] : '';
|
727 |
+
|
728 |
+
$color = ! empty( $instance['design']['overlay_post_category']['background'] ) ? $instance['design']['overlay_post_category']['background'] : '#000';
|
729 |
+
$rgb = ltrim( $color, '#' );
|
730 |
+
$rgb = array_map( 'hexdec', str_split( $rgb , strlen( $rgb ) == 6 ? 2 : 1 ) );
|
731 |
+
$opacity = ! empty( $instance['design']['overlay_post_category']['background_opacity'] ) ? $instance['design']['overlay_post_category']['background_opacity'] : 0.8;
|
732 |
+
$less_vars['overlay_post_category_background'] = "rgba( $rgb[0], $rgb[1], $rgb[2], $opacity )";
|
733 |
+
|
734 |
+
$color = ! empty( $instance['design']['overlay_post_category']['background_hover'] ) ? $instance['design']['overlay_post_category']['background_hover'] : '#000';
|
735 |
+
$rgb = ltrim( $color, '#' );
|
736 |
+
$rgb = array_map( 'hexdec', str_split( $rgb , strlen( $rgb ) == 6 ? 2 : 1 ) );
|
737 |
+
$opacity = ! empty( $instance['design']['overlay_post_category']['background_opacity_hover'] ) ? $instance['design']['overlay_post_category']['background_opacity_hover'] : 0.75;
|
738 |
+
$less_vars['overlay_post_category_background_hover'] = "rgba( $rgb[0], $rgb[1], $rgb[2], $opacity )";
|
739 |
+
}
|
740 |
+
|
741 |
+
if ( $instance['template'] == 'portfolio' ) {
|
742 |
+
// Filter Categories.
|
743 |
+
if ( ! empty( $instance['design']['filter_categories']['font'] ) ) {
|
744 |
+
$font = siteorigin_widget_get_font( $instance['design']['filter_categories']['font'] );
|
745 |
+
$less_vars['filter_categories_font'] = $font['family'];
|
746 |
+
if ( ! empty( $font['weight'] ) ) {
|
747 |
+
$less_vars['filter_categories_font_style'] = $font['style'];
|
748 |
+
$less_vars['filter_categories_font_weight'] = $font['weight_raw'];
|
749 |
+
}
|
750 |
+
}
|
751 |
+
$less_vars['filter_categories_font_size'] = ! empty( $instance['design']['filter_categories']['font_size'] ) ? $instance['design']['filter_categories']['font_size'] : '';
|
752 |
+
$less_vars['filter_categories_color'] = ! empty( $instance['design']['filter_categories']['color'] ) ? $instance['design']['filter_categories']['color'] : '';
|
753 |
+
$less_vars['filter_categories_color_hover'] = ! empty( $instance['design']['filter_categories']['color_hover'] ) ? $instance['design']['filter_categories']['color_hover'] : '';
|
754 |
+
$less_vars['filter_categories_text_transform'] = ! empty( $instance['design']['filter_categories']['text_transform'] ) ? 'uppercase' : '';
|
755 |
+
$less_vars['filter_categories_selected_border_color'] = ! empty( $instance['design']['filter_categories']['selected_border_color'] ) ? $instance['design']['filter_categories']['selected_border_color'] : '';
|
756 |
+
$less_vars['filter_categories_selected_border_thickness'] = ! empty( $instance['design']['filter_categories']['selected_border_thickness'] ) ? $instance['design']['filter_categories']['selected_border_thickness'] : '';
|
757 |
+
|
758 |
+
// Featured Images.
|
759 |
+
$less_vars['featured_image_border_color'] = ! empty( $instance['design']['featured_image']['border_color'] ) ? $instance['design']['featured_image']['border_color'] : '';
|
760 |
+
|
761 |
+
if ( ! empty( $instance['design']['featured_image']['hover_overlay_color'] ) ) {
|
762 |
+
$rgb = ltrim( $instance['design']['featured_image']['hover_overlay_color'], '#' );
|
763 |
+
$rgb = array_map( 'hexdec', str_split( $rgb , strlen( $rgb ) == 6 ? 2 : 1 ) );
|
764 |
+
$opacity = ! empty( $instance['design']['featured_image']['hover_overlay_opacity'] ) ? $instance['design']['featured_image']['hover_overlay_opacity'] : 0.9;
|
765 |
+
$less_vars['featured_image_hover_overlay_color'] = "rgba( $rgb[0], $rgb[1], $rgb[2], $opacity )";
|
766 |
+
}
|
767 |
+
|
768 |
+
if ( ! empty( $instance['design']['featured_image']['post_title_font'] ) ) {
|
769 |
+
$font = siteorigin_widget_get_font( $instance['design']['featured_image']['post_title_font'] );
|
770 |
+
$less_vars['featured_image_post_title_font'] = $font['family'];
|
771 |
+
if ( ! empty( $font['weight'] ) ) {
|
772 |
+
$less_vars['featured_image_post_title_font_style'] = $font['style'];
|
773 |
+
$less_vars['featured_image_post_title_font_weight'] = $font['weight_raw'];
|
774 |
+
}
|
775 |
+
}
|
776 |
+
$less_vars['featured_image_post_title_font_size'] = ! empty( $instance['design']['featured_image']['post_title_font_size'] ) ? $instance['design']['featured_image']['post_title_font_size'] : '';
|
777 |
+
$less_vars['featured_image_post_title_color'] = ! empty( $instance['design']['featured_image']['post_title_color'] ) ? $instance['design']['featured_image']['post_title_color'] : '';
|
778 |
+
$less_vars['featured_image_divider_border_color'] = ! empty( $instance['design']['featured_image']['divider_border_color'] ) ? $instance['design']['featured_image']['divider_border_color'] : '';
|
779 |
+
$less_vars['featured_image_divider_border_thickness'] = ! empty( $instance['design']['featured_image']['divider_border_thickness'] ) ? $instance['design']['featured_image']['divider_border_thickness'] : '';
|
780 |
+
$less_vars['featured_image_divider_border_margin'] = ! empty( $instance['design']['featured_image']['divider_border_margin'] ) ? $instance['design']['featured_image']['divider_border_margin'] : '';
|
781 |
+
if ( ! empty( $instance['design']['featured_image']['post_meta_font'] ) ) {
|
782 |
+
$font = siteorigin_widget_get_font( $instance['design']['featured_image']['post_meta_font'] );
|
783 |
+
$less_vars['featured_image_post_meta_font'] = $font['family'];
|
784 |
+
if ( ! empty( $font['weight'] ) ) {
|
785 |
+
$less_vars['featured_image_post_meta_font_style'] = $font['style'];
|
786 |
+
$less_vars['featured_image_post_meta_font_weight'] = $font['weight_raw'];
|
787 |
+
}
|
788 |
+
}
|
789 |
+
$less_vars['featured_image_post_meta_font_size'] = ! empty( $instance['design']['featured_image']['post_meta_font_size'] ) ? $instance['design']['featured_image']['post_meta_font_size'] : '';
|
790 |
+
$less_vars['featured_image_post_meta_color'] = ! empty( $instance['design']['featured_image']['post_meta_color'] ) ? $instance['design']['featured_image']['post_meta_color'] : '';
|
791 |
+
}
|
792 |
+
|
793 |
+
return $less_vars;
|
794 |
+
}
|
795 |
+
|
796 |
+
static public function portfolio_get_terms( $instance, $post_id = 0 ) {
|
797 |
+
$terms = array();
|
798 |
+
if ( post_type_exists( 'jetpack-portfolio' ) ) {
|
799 |
+
if ( $post_id ) {
|
800 |
+
$terms = get_the_terms( (int) $post_id, 'jetpack-portfolio-type' );
|
801 |
+
} else {
|
802 |
+
$terms = get_terms( 'jetpack-portfolio-type' );
|
803 |
+
}
|
804 |
+
}
|
805 |
+
|
806 |
+
if ( empty( $terms ) || is_wp_error( $terms ) ) {
|
807 |
+
$fallback = apply_filters( 'siteorigin_widgets_blog_portfolio_fallback_term', 'category', $instance );
|
808 |
+
// Unable to find posts with portfolio type. Try using fallback term.
|
809 |
+
if ( $post_id ) {
|
810 |
+
return get_the_terms( (int) $post_id, $fallback );
|
811 |
+
} else {
|
812 |
+
return get_terms( $fallback );
|
813 |
+
}
|
814 |
+
} else {
|
815 |
+
return $terms;
|
816 |
+
}
|
817 |
+
|
818 |
+
}
|
819 |
+
|
820 |
+
function modify_instance( $instance ) {
|
821 |
+
if ( empty( $instance ) ) {
|
822 |
+
return array();
|
823 |
+
}
|
824 |
+
|
825 |
+
if ( empty( $instance['template'] ) ) {
|
826 |
+
$instance['template'] = 'standard';
|
827 |
+
} else {
|
828 |
+
// Ensure selected template is valid.
|
829 |
+
switch ( $instance['template'] ) {
|
830 |
+
case 'alternate':
|
831 |
+
case 'grid':
|
832 |
+
case 'masonry':
|
833 |
+
case 'offset':
|
834 |
+
case 'portfolio':
|
835 |
+
case 'standard':
|
836 |
+
break;
|
837 |
+
default:
|
838 |
+
$instance['template'] = 'standard';
|
839 |
+
break;
|
840 |
+
}
|
841 |
+
}
|
842 |
+
|
843 |
+
$instance['paged_id'] = ! empty( $instance['_sow_form_id'] ) ? (int) substr( $instance['_sow_form_id'], 0, 5 ) : null;
|
844 |
+
|
845 |
+
return $instance;
|
846 |
+
}
|
847 |
+
|
848 |
+
public function get_template_variables( $instance, $args ) {
|
849 |
+
if ( ! isset( $instance['paged'] ) ) {
|
850 |
+
$instance['paged'] = ! empty( $_GET['sow-' . $instance['paged_id'] ] ) ? (int) $_GET['sow-' . $instance['paged_id'] ] : 1;
|
851 |
+
}
|
852 |
+
$query = wp_parse_args(
|
853 |
+
array(
|
854 |
+
'paged' => $instance['paged'],
|
855 |
+
),
|
856 |
+
siteorigin_widget_post_selector_process_query( $instance['posts'] )
|
857 |
+
);
|
858 |
+
|
859 |
+
if ( $instance['template'] == 'portfolio' ) {
|
860 |
+
// The portfolio template relies on each post having an image so exclude any posts that don't.
|
861 |
+
$query['meta_query'] = array(
|
862 |
+
array(
|
863 |
+
'key' => '_thumbnail_id',
|
864 |
+
'compare' => 'EXISTS'
|
865 |
+
),
|
866 |
+
);
|
867 |
+
}
|
868 |
+
|
869 |
+
// Add template specific settings.
|
870 |
+
$template_settings = array(
|
871 |
+
'date_format' => isset( $instance['settings']['date_format'] ) ? $instance['settings']['date_format'] : null,
|
872 |
+
);
|
873 |
+
if ( $instance['template'] == 'offset' ) {
|
874 |
+
if ( $instance['settings']['date'] ) {
|
875 |
+
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
|
876 |
+
$template_settings['time_string'] = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
|
877 |
+
} else {
|
878 |
+
$template_settings['time_string'] = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
|
879 |
+
}
|
880 |
+
}
|
881 |
+
}
|
882 |
+
|
883 |
+
if ( $instance['template'] == 'portfolio' ) {
|
884 |
+
$template_settings['terms'] = $this->portfolio_get_terms( $instance );
|
885 |
+
$template_settings['filter_categories'] = ! empty( $instance['settings']['filter_categories'] );
|
886 |
+
}
|
887 |
+
|
888 |
+
return array(
|
889 |
+
'title' => $instance['title'],
|
890 |
+
'settings' => $instance['settings'],
|
891 |
+
'template_settings' => $template_settings,
|
892 |
+
'posts' => new WP_Query( apply_filters( 'siteorigin_widgets_blog_query', $query, $instance ) ),
|
893 |
+
);
|
894 |
+
}
|
895 |
+
|
896 |
+
static public function post_meta( $settings ) {
|
897 |
+
if ( $settings['date'] ) :
|
898 |
+
$date_format = isset( $settings['date_format'] ) ? $settings['date_format'] : null;
|
899 |
+
?>
|
900 |
+
<span class="sow-entry-date">
|
901 |
+
<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark">
|
902 |
+
<time class="published" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>">
|
903 |
+
<?php echo esc_html( get_the_date( $date_format ) ); ?>
|
904 |
+
</time>
|
905 |
+
<time class="updated" datetime="<?php echo esc_attr( get_the_modified_date( 'c' ) ); ?>">
|
906 |
+
<?php echo esc_html( get_the_modified_date() ); ?>
|
907 |
+
</time>
|
908 |
+
</a>
|
909 |
+
</span>
|
910 |
+
<?php endif; ?>
|
911 |
+
|
912 |
+
<?php if ( $settings['author'] ) : ?>
|
913 |
+
<span class="sow-entry-author-link byline">
|
914 |
+
<?php if ( function_exists( 'coauthors_posts_links' ) ) : ?>
|
915 |
+
<?php coauthors_posts_links(); ?>
|
916 |
+
<?php else: ?>
|
917 |
+
<span class="sow-author author vcard">
|
918 |
+
<a class="url fn n" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
|
919 |
+
<?php echo esc_html( get_the_author() ); ?>
|
920 |
+
</a>
|
921 |
+
</span>
|
922 |
+
<?php endif; ?>
|
923 |
+
</span>
|
924 |
+
<?php endif; ?>
|
925 |
+
|
926 |
+
<?php if ( $settings['categories'] && has_category() ) : ?>
|
927 |
+
<span class="sow-entry-categories">
|
928 |
+
<?php
|
929 |
+
/* translators: used between list items, there is a space after the comma */
|
930 |
+
the_category( esc_html__( ', ', 'so-widgets-bundle' ) );
|
931 |
+
?>
|
932 |
+
</span>
|
933 |
+
<?php endif; ?>
|
934 |
+
|
935 |
+
<?php if ( comments_open() && $settings['comment_count'] ) : ?>
|
936 |
+
<span class="sow-entry-comments">
|
937 |
+
<?php
|
938 |
+
comments_popup_link(
|
939 |
+
esc_html__( 'Leave a comment', 'so-widgets-bundle' ),
|
940 |
+
esc_html__( 'One Comment', 'so-widgets-bundle' ),
|
941 |
+
esc_html__( '% Comments', 'so-widgets-bundle' )
|
942 |
+
);
|
943 |
+
?>
|
944 |
+
</span>
|
945 |
+
<?php endif;
|
946 |
+
}
|
947 |
+
|
948 |
+
static public function post_featured_image( $settings, $categories = false, $size = 'post-thumbnail' ) {
|
949 |
+
if ( $settings['featured_image'] && has_post_thumbnail() ) : ?>
|
950 |
+
<div class="sow-entry-thumbnail">
|
951 |
+
<?php if ( $categories && $settings['categories'] && has_category() ) : ?>
|
952 |
+
<div class="sow-thumbnail-meta">
|
953 |
+
<?php
|
954 |
+
echo get_the_category_list();
|
955 |
+
?>
|
956 |
+
</div>
|
957 |
+
<?php endif; ?>
|
958 |
+
<a href="<?php the_permalink(); ?>">
|
959 |
+
<?php the_post_thumbnail( $size ); ?>
|
960 |
+
</a>
|
961 |
+
</div>
|
962 |
+
<?php
|
963 |
+
endif;
|
964 |
+
}
|
965 |
+
|
966 |
+
static public function generate_post_title() {
|
967 |
+
the_title(
|
968 |
+
'<h2 class="sow-entry-title" style="margin: 0 0 5px;"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">',
|
969 |
+
'</a></h2>'
|
970 |
+
);
|
971 |
+
}
|
972 |
+
|
973 |
+
function alter_read_more_link( $link ) {
|
974 |
+
return '<a class="sow-more-link more-link excerpt" href="' . esc_url( get_permalink() ) . '"> ' . esc_html( get_query_var( 'siteorigin_blog_read_more' ) ) . '<span class="sow-more-link-arrow">→</span></a>';
|
975 |
+
}
|
976 |
+
|
977 |
+
static public function generate_excerpt( $settings ) {
|
978 |
+
if ( $settings['read_more'] ) {
|
979 |
+
$read_more_text = ! empty( $settings['read_more_text'] ) ? $settings['read_more_text'] : __( 'Continue reading', 'so-widgets-bundle' );
|
980 |
+
$read_more_text = '<a class="sow-more-link more-link excerpt" href="' . esc_url( get_permalink() ) . '">
|
981 |
+
' . esc_html( $read_more_text ) . '<span class="sow-more-link-arrow">→</span></a>';
|
982 |
+
}
|
983 |
+
$length = apply_filters( 'siteorigin_widgets_blog_excerpt_length', 55 );
|
984 |
+
$excerpt = get_the_excerpt();
|
985 |
+
$excerpt_add_read_more = str_word_count( $excerpt ) >= $length;
|
986 |
+
|
987 |
+
if ( ! has_excerpt() ) {
|
988 |
+
$excerpt = wp_trim_words( $excerpt, $length, '...' );
|
989 |
+
}
|
990 |
+
|
991 |
+
if ( $settings['read_more'] && ( has_excerpt() || $excerpt_add_read_more ) ) {
|
992 |
+
$excerpt .= $read_more_text;
|
993 |
+
}
|
994 |
+
|
995 |
+
echo '<p>' . wp_kses_post( $excerpt ) . '</p>';
|
996 |
+
}
|
997 |
+
|
998 |
+
function paginate_links( $settings, $posts, $instance ) {
|
999 |
+
$pagination_markup = defined( 'SITEORIGIN_PREMIUM_VERSION' ) ? apply_filters( 'siteorigin_widgets_blog_pagination_markup', false, $settings, $posts, $instance ) : false;
|
1000 |
+
|
1001 |
+
if ( empty( $pagination_markup ) ) {
|
1002 |
+
if ( isset( $settings['pagination_reload'] ) && $settings['pagination_reload'] == 'ajax' ) {
|
1003 |
+
$current = 99999;
|
1004 |
+
$show_all_prev_next = true;
|
1005 |
+
} else {
|
1006 |
+
$current = max( 1, $posts->query['paged'] );
|
1007 |
+
$show_all_prev_next = false;
|
1008 |
+
}
|
1009 |
+
|
1010 |
+
$pagination_markup = paginate_links( array(
|
1011 |
+
'format' => '?sow-' . $instance['paged_id'] . '=%#%',
|
1012 |
+
'total' => $posts->max_num_pages,
|
1013 |
+
'current' => $current,
|
1014 |
+
'show_all' => $show_all_prev_next,
|
1015 |
+
'prev_next' => ! $show_all_prev_next,
|
1016 |
+
'prev_text' => is_rtl() ? '→' : '←',
|
1017 |
+
'next_text' => is_rtl() ? '←' : '→',
|
1018 |
+
) );
|
1019 |
+
}
|
1020 |
+
|
1021 |
+
if ( ! empty( $pagination_markup ) ) {
|
1022 |
+
?>
|
1023 |
+
<nav class="sow-post-navigation">
|
1024 |
+
<h2 class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'so-widgets-bundle' ); ?></h2>
|
1025 |
+
<div class="sow-nav-links">
|
1026 |
+
<?php echo $pagination_markup; ?>
|
1027 |
+
</div>
|
1028 |
+
</nav>
|
1029 |
+
<?php
|
1030 |
+
}
|
1031 |
+
}
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
siteorigin_widget_register( 'sow-blog', __FILE__, 'SiteOrigin_Widget_Blog_Widget' );
|
widgets/blog/css/style.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.sow-blog.sow-blog-layout-alternate .sow-blog-posts,.sow-blog.sow-blog-layout-masonry .sow-blog-posts{display:flex;flex-wrap:wrap;justify-content:space-between}.sow-blog article{border:none;box-sizing:border-box;margin:0;padding:0}.sow-blog article .sow-entry-thumbnail a{display:block;line-height:0;text-align:center}.sow-blog article .sow-entry-header .sow-entry-title{font-weight:600;line-height:normal}.sow-blog article .sow-entry-header .sow-entry-title a{text-decoration:none}.sow-blog article .sow-entry-meta{line-height:normal}.sow-blog article .sow-entry-meta span a{text-decoration:none}.sow-blog article .sow-entry-meta span:not(:last-child)::after{content:"\007c";padding:0 2px;vertical-align:top}.sow-blog article .sow-entry-meta .updated:not(.published){display:none}.sow-blog article .sow-blog-content-wrapper{overflow:auto}.sow-blog article p:last-child,.sow-blog article p:only-child{margin-bottom:0}.sow-blog article .sow-more-link{padding:0}.sow-blog article .sow-more-link.excerpt{background:none;border:none;box-shadow:none;display:block;float:none;font-size:1em;font-weight:normal;margin-top:26px}.sow-blog article .sow-more-link .more-text{display:block}.sow-blog article .sow-more-link .more-text span{display:inline-block;padding-left:3px;vertical-align:middle}.sow-blog article .sow-more-link .sow-more-link-arrow{display:inline-block;font-size:1.1em;padding-bottom:2px;padding-left:4px;vertical-align:middle}.sow-blog .sow-post-navigation{clear:both;width:100%}.sow-blog .sow-post-navigation .sow-nav-links{display:flex;flex-direction:row;justify-content:center}.sow-blog .sow-post-navigation .page-numbers,.sow-blog .sow-post-navigation .current{display:inline-block;line-height:normal;margin-bottom:4px;text-decoration:none;transition:.3s;vertical-align:top}.sow-blog .sow-post-navigation .page-numbers .prev,.sow-blog .sow-post-navigation .page-numbers .next{line-height:1;padding-left:14px;padding-right:14px}.sow-blog .sow-post-navigation .dots{border:none;line-height:normal;transition:.3s;vertical-align:top}.sow-blog .sow-post-navigation .dots:hover{background:none;color:inherit}.sow-blog.sow-blog-layout-standard article .sow-entry-thumbnail{margin-bottom:-1px}.sow-blog.sow-blog-layout-grid article .sow-entry-thumbnail{margin:-1px}.sow-blog.sow-blog-layout-offset article .sow-blog-entry-offset div{margin-bottom:12px}.sow-blog.sow-blog-layout-offset article .sow-blog-entry-offset span{display:block;line-height:normal;margin-bottom:2px}.sow-blog.sow-blog-layout-offset article .sow-entry-thumbnail{margin-bottom:-1px}.sow-blog.sow-blog-layout-alternate article .sow-entry-thumbnail a{margin:-1px}.sow-blog.sow-blog-layout-alternate article .sow-blog-content-wrapper{box-sizing:border-box;padding:25px 30px 33px}.sow-blog.sow-blog-layout-alternate article .sow-blog-content-wrapper .sow-entry-content p:last-of-type{margin:0}.sow-blog.sow-blog-layout-alternate article .sow-blog-content-wrapper .sow-entry-content p:only-of-type{margin:0}.sow-blog.sow-blog-layout-alternate article.sow-no-thumbnail .sow-blog-content-wrapper{width:100%}.sow-blog.sow-blog-layout-masonry .sow-blog-posts{clear:both;margin:0 -15px}.sow-blog.sow-blog-layout-masonry .sow-blog-posts article{margin-bottom:30px;padding:0 15px}.sow-blog.sow-blog-layout-masonry .sow-blog-posts article .sow-entry-thumbnail{margin-bottom:-1px;position:relative}.sow-blog.sow-blog-layout-portfolio .sow-blog-posts{margin-left:-1.1667%;margin-right:-1.1667%}.sow-blog.sow-blog-layout-portfolio .sow-portfolio-filter-terms button{cursor:pointer}.sow-blog.sow-blog-layout-portfolio .sow-portfolio-filter-terms:hover,.sow-blog.sow-blog-layout-portfolio .sow-portfolio-filter-terms:focus{background:transparent}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail{align-items:center;display:flex;justify-content:center;position:relative;text-align:center}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail:hover .sow-entry-content{opacity:1;visibility:visible}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail .sow-entry-link-overlay{bottom:0;left:0;position:absolute;right:0;text-decoration:none;top:0;z-index:1}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail .sow-entry-overlay{height:100%;position:absolute;transition:.3s;width:100%;z-index:0}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail .sow-entry-content{align-items:center;display:flex;flex-direction:column;opacity:0;position:absolute;transition:.3s;visibility:hidden;width:100%}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail .sow-entry-content .sow-entry-title{line-height:normal;text-align:center;width:100%}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail .sow-entry-content .sow-entry-title a{position:relative;z-index:2}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail .sow-entry-content .sow-entry-divider{width:30px}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail .sow-entry-content .sow-entry-project-type{display:block;text-align:center;width:100%}.sow-blog.sow-blog-layout-portfolio article .sow-entry-thumbnail .wp-post-image{border:0;box-shadow:none;height:auto;max-width:100%;width:100%}
|
widgets/blog/data/templates.json
ADDED
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"standard": {
|
3 |
+
"label": "Standard",
|
4 |
+
"values": {
|
5 |
+
"settings": {
|
6 |
+
"featured_image": true,
|
7 |
+
"content": "full",
|
8 |
+
"read_more": true,
|
9 |
+
"date": true,
|
10 |
+
"author": true,
|
11 |
+
"categories": true,
|
12 |
+
"comment_count": true
|
13 |
+
},
|
14 |
+
"design": {
|
15 |
+
"post":{
|
16 |
+
"background": "#fff",
|
17 |
+
"border": "#e6e6e6"
|
18 |
+
},
|
19 |
+
"title": {
|
20 |
+
"color": "#2d2d2d",
|
21 |
+
"color_hover": "#626262",
|
22 |
+
"font": "default",
|
23 |
+
"font_size": "24"
|
24 |
+
},
|
25 |
+
"meta":{
|
26 |
+
"color": "#929292",
|
27 |
+
"color_hover": "#f14e4e",
|
28 |
+
"font": "default",
|
29 |
+
"font_size": "13"
|
30 |
+
},
|
31 |
+
"content":{
|
32 |
+
"color": "#626262",
|
33 |
+
"color_hover": "",
|
34 |
+
"font": "default",
|
35 |
+
"font_size": "15",
|
36 |
+
"link_color": "#f14e4e",
|
37 |
+
"link_color_hover": "#626262"
|
38 |
+
},
|
39 |
+
"pagination":{
|
40 |
+
"background": "",
|
41 |
+
"background_hover": "",
|
42 |
+
"border_color": "#626262",
|
43 |
+
"border_color_hover": "#f14e4e",
|
44 |
+
"border_radius": "0",
|
45 |
+
"font": "default",
|
46 |
+
"font_size": "14",
|
47 |
+
"height":"43",
|
48 |
+
"link_color": "#626262",
|
49 |
+
"link_color_hover": "#f14e4e",
|
50 |
+
"dots_color": "#626262",
|
51 |
+
"link_margin": "8",
|
52 |
+
"top_margin": "30",
|
53 |
+
"width": "44"
|
54 |
+
}
|
55 |
+
}
|
56 |
+
}
|
57 |
+
},
|
58 |
+
"grid": {
|
59 |
+
"label": "Grid",
|
60 |
+
"values": {
|
61 |
+
"settings": {
|
62 |
+
"columns": 2,
|
63 |
+
"featured_image": true,
|
64 |
+
"content": "excerpt",
|
65 |
+
"read_more": true,
|
66 |
+
"date": true,
|
67 |
+
"author": true,
|
68 |
+
"categories": true,
|
69 |
+
"comment_count": true
|
70 |
+
},
|
71 |
+
"design": {
|
72 |
+
"post":{
|
73 |
+
"background": "#fff",
|
74 |
+
"border": "#e6e6e6"
|
75 |
+
},
|
76 |
+
"title": {
|
77 |
+
"color": "#2d2d2d",
|
78 |
+
"color_hover": "#626262",
|
79 |
+
"font": "default",
|
80 |
+
"font_size": "16"
|
81 |
+
},
|
82 |
+
"meta":{
|
83 |
+
"color": "#929292",
|
84 |
+
"color_hover": "#f14e4e",
|
85 |
+
"font": "default",
|
86 |
+
"font_size": "13"
|
87 |
+
},
|
88 |
+
"content":{
|
89 |
+
"color": "#626262",
|
90 |
+
"color_hover": "",
|
91 |
+
"font": "default",
|
92 |
+
"font_size": "14",
|
93 |
+
"link_color": "#f14e4e",
|
94 |
+
"link_color_hover": "#626262"
|
95 |
+
},
|
96 |
+
"pagination":{
|
97 |
+
"background": "",
|
98 |
+
"background_hover": "",
|
99 |
+
"border_color": "#626262",
|
100 |
+
"border_color_hover": "#f14e4e",
|
101 |
+
"border_radius": "0",
|
102 |
+
"font": "default",
|
103 |
+
"font_size": "14",
|
104 |
+
"height":"43",
|
105 |
+
"link_color": "#626262",
|
106 |
+
"link_color_hover": "#f14e4e",
|
107 |
+
"dots_color": "#626262",
|
108 |
+
"link_margin": "8",
|
109 |
+
"top_margin": "30",
|
110 |
+
"width": "44"
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
},
|
115 |
+
"offset": {
|
116 |
+
"label": "Offset",
|
117 |
+
"values": {
|
118 |
+
"settings": {
|
119 |
+
"featured_image": true,
|
120 |
+
"content": "full",
|
121 |
+
"read_more": true,
|
122 |
+
"date": true,
|
123 |
+
"author": true,
|
124 |
+
"categories": true,
|
125 |
+
"comment_count": true
|
126 |
+
},
|
127 |
+
"design": {
|
128 |
+
"post":{
|
129 |
+
"border": "#e6e6e6",
|
130 |
+
"background": "#fff"
|
131 |
+
},
|
132 |
+
"title": {
|
133 |
+
"color": "#2d2d2d",
|
134 |
+
"color_hover": "#626262",
|
135 |
+
"font": "default",
|
136 |
+
"font_size": "24"
|
137 |
+
},
|
138 |
+
"meta":{
|
139 |
+
"color": "#929292",
|
140 |
+
"color_hover": "#f14e4e",
|
141 |
+
"font": "default",
|
142 |
+
"font_size": "13"
|
143 |
+
},
|
144 |
+
"offset_post_meta":{
|
145 |
+
"color": "#929292",
|
146 |
+
"font": "default",
|
147 |
+
"font_size": "13",
|
148 |
+
"link_color": "#2d2d2d",
|
149 |
+
"link_color_hover": "#f14e4e",
|
150 |
+
"link_font_size": "14"
|
151 |
+
},
|
152 |
+
"content":{
|
153 |
+
"color": "#626262",
|
154 |
+
"color_hover": "",
|
155 |
+
"font": "default",
|
156 |
+
"font_size": "15",
|
157 |
+
"link_color": "#f14e4e",
|
158 |
+
"link_color_hover": "#626262"
|
159 |
+
},
|
160 |
+
"pagination":{
|
161 |
+
"background": "",
|
162 |
+
"background_hover": "",
|
163 |
+
"border_color": "#626262",
|
164 |
+
"border_color_hover": "#f14e4e",
|
165 |
+
"border_radius": "0",
|
166 |
+
"font": "default",
|
167 |
+
"font_size": "14",
|
168 |
+
"height":"43",
|
169 |
+
"link_color": "#626262",
|
170 |
+
"link_color_hover": "#f14e4e",
|
171 |
+
"dots_color": "#626262",
|
172 |
+
"link_margin": "8",
|
173 |
+
"top_margin": "30",
|
174 |
+
"width": "44"
|
175 |
+
}
|
176 |
+
}
|
177 |
+
}
|
178 |
+
},
|
179 |
+
"alternate": {
|
180 |
+
"label": "Alternate",
|
181 |
+
"values": {
|
182 |
+
"settings": {
|
183 |
+
"featured_image": true,
|
184 |
+
"content": "excerpt",
|
185 |
+
"read_more": true,
|
186 |
+
"date": true,
|
187 |
+
"author": true,
|
188 |
+
"categories": true,
|
189 |
+
"comment_count": true
|
190 |
+
},
|
191 |
+
"design": {
|
192 |
+
"post":{
|
193 |
+
"border": "#e6e6e6",
|
194 |
+
"background": "#fff"
|
195 |
+
},
|
196 |
+
"title": {
|
197 |
+
"font": "default",
|
198 |
+
"font_size": "16",
|
199 |
+
"color": "#2d2d2d",
|
200 |
+
"color_hover": "#626262"
|
201 |
+
},
|
202 |
+
"meta":{
|
203 |
+
"color": "#929292",
|
204 |
+
"color_hover": "#f14e4e",
|
205 |
+
"font": "default",
|
206 |
+
"font_size": "13"
|
207 |
+
},
|
208 |
+
"content":{
|
209 |
+
"color": "#626262",
|
210 |
+
"color_hover": "",
|
211 |
+
"font": "default",
|
212 |
+
"font_size": "15",
|
213 |
+
"link_color": "#f14e4e",
|
214 |
+
"link_color_hover": "#626262"
|
215 |
+
},
|
216 |
+
"pagination":{
|
217 |
+
"background": "",
|
218 |
+
"background_hover": "",
|
219 |
+
"border_color": "#626262",
|
220 |
+
"border_color_hover": "#f14e4e",
|
221 |
+
"border_radius": "0",
|
222 |
+
"font": "default",
|
223 |
+
"font_size": "14",
|
224 |
+
"height":"43",
|
225 |
+
"link_color": "#626262",
|
226 |
+
"link_color_hover": "#f14e4e",
|
227 |
+
"dots_color": "#626262",
|
228 |
+
"link_margin": "8",
|
229 |
+
"top_margin": "30",
|
230 |
+
"width": "44"
|
231 |
+
}
|
232 |
+
}
|
233 |
+
}
|
234 |
+
},
|
235 |
+
"masonry": {
|
236 |
+
"label": "Masonry",
|
237 |
+
"values": {
|
238 |
+
"settings": {
|
239 |
+
"columns": 2,
|
240 |
+
"featured_image": true,
|
241 |
+
"content": "excerpt",
|
242 |
+
"read_more": true,
|
243 |
+
"date": true,
|
244 |
+
"author": true,
|
245 |
+
"categories": true,
|
246 |
+
"comment_count": true
|
247 |
+
},
|
248 |
+
"design": {
|
249 |
+
"post":{
|
250 |
+
"border": "#e6e6e6",
|
251 |
+
"background": "#fff"
|
252 |
+
},
|
253 |
+
"title": {
|
254 |
+
"color": "#2d2d2d",
|
255 |
+
"color_hover": "#626262",
|
256 |
+
"font": "default",
|
257 |
+
"font_size": "16"
|
258 |
+
},
|
259 |
+
"meta":{
|
260 |
+
"color": "#929292",
|
261 |
+
"color_hover": "#f14e4e",
|
262 |
+
"font": "default",
|
263 |
+
"font_size": "13"
|
264 |
+
},
|
265 |
+
"overlay_post_category": {
|
266 |
+
"background": "#000",
|
267 |
+
"background_hover": "#000",
|
268 |
+
"background_opacity": "0.7",
|
269 |
+
"background_opacity_hover": "0.75",
|
270 |
+
"color": "#fff",
|
271 |
+
"color_hover": "#fff",
|
272 |
+
"font": "default",
|
273 |
+
"font_size": "11"
|
274 |
+
},
|
275 |
+
"content":{
|
276 |
+
"color": "#626262",
|
277 |
+
"color_hover": "",
|
278 |
+
"font": "default",
|
279 |
+
"font_size": "14",
|
280 |
+
"link_color": "#f14e4e",
|
281 |
+
"link_color_hover": "#626262"
|
282 |
+
},
|
283 |
+
"pagination":{
|
284 |
+
"background": "",
|
285 |
+
"background_hover": "",
|
286 |
+
"border_color": "#626262",
|
287 |
+
"border_color_hover": "#f14e4e",
|
288 |
+
"border_radius": "0",
|
289 |
+
"font": "default",
|
290 |
+
"font_size": "14",
|
291 |
+
"height":"43",
|
292 |
+
"link_color": "#626262",
|
293 |
+
"link_color_hover": "#f14e4e",
|
294 |
+
"link_margin": "8",
|
295 |
+
"top_margin": "30",
|
296 |
+
"width": "44"
|
297 |
+
}
|
298 |
+
}
|
299 |
+
}
|
300 |
+
},
|
301 |
+
"portfolio": {
|
302 |
+
"label": "Portfolio",
|
303 |
+
"values": {
|
304 |
+
"settings": {
|
305 |
+
"columns": 3,
|
306 |
+
"filter_categories": "true",
|
307 |
+
"categories": true
|
308 |
+
},
|
309 |
+
"design": {
|
310 |
+
"filter_categories":{
|
311 |
+
"color": "#929292",
|
312 |
+
"color_hover": "#2d2d2d",
|
313 |
+
"font": "default",
|
314 |
+
"font_size": "11",
|
315 |
+
"selected_border_color": "#2d2d2d",
|
316 |
+
"selected_border_thickness": "2",
|
317 |
+
"text_transform": "true"
|
318 |
+
},
|
319 |
+
"featured_image":{
|
320 |
+
"border_color": "#929292",
|
321 |
+
"divider_border_color": "#2d2d2d",
|
322 |
+
"divider_border_thickness": "1",
|
323 |
+
"divider_border_margin": "13",
|
324 |
+
"hover_overlay_color": "#ffffff",
|
325 |
+
"hover_overlay_opacity": "0.9",
|
326 |
+
"post_meta_font": "default",
|
327 |
+
"post_meta_font_size": "11",
|
328 |
+
"post_meta_color": "#929292",
|
329 |
+
"post_title_color": "#2d2d2d",
|
330 |
+
"post_title_font": "default",
|
331 |
+
"post_title_font_size": "15"
|
332 |
+
},
|
333 |
+
"pagination":{
|
334 |
+
"background": "",
|
335 |
+
"background_hover": "",
|
336 |
+
"border_color": "#626262",
|
337 |
+
"border_color_hover": "#f14e4e",
|
338 |
+
"border_radius": "0",
|
339 |
+
"font": "default",
|
340 |
+
"font_size": "14",
|
341 |
+
"height":"43",
|
342 |
+
"link_color": "#626262",
|
343 |
+
"link_color_hover": "#f14e4e",
|
344 |
+
"dots_color": "#626262",
|
345 |
+
"link_margin": "8",
|
346 |
+
"top_margin": "30",
|
347 |
+
"width": "44"
|
348 |
+
}
|
349 |
+
}
|
350 |
+
}
|
351 |
+
}
|
352 |
+
}
|
widgets/blog/js/masonry.js
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* globals jQuery, sowb */
|
2 |
+
|
3 |
+
var sowb = window.sowb || {};
|
4 |
+
|
5 |
+
jQuery( function ( $ ) {
|
6 |
+
|
7 |
+
sowb.setupBlogMasonry = function () {
|
8 |
+
$( '.sow-blog-layout-masonry .sow-blog-posts' ).each( function () {
|
9 |
+
$( this ).masonry( {
|
10 |
+
itemSelector: '.sow-masonry-item',
|
11 |
+
columnWidth: '.sow-masonry-item',
|
12 |
+
} );
|
13 |
+
} );
|
14 |
+
};
|
15 |
+
|
16 |
+
sowb.setupBlogMasonry();
|
17 |
+
|
18 |
+
$( sowb ).on( 'setup_widgets', sowb.setupBlogMasonry );
|
19 |
+
} );
|
20 |
+
|
21 |
+
window.sowb = sowb;
|
widgets/blog/js/masonry.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var sowb=window.sowb||{};jQuery((function(o){sowb.setupBlogMasonry=function(){o(".sow-blog-layout-masonry .sow-blog-posts").each((function(){o(this).masonry({itemSelector:".sow-masonry-item",columnWidth:".sow-masonry-item"})}))},sowb.setupBlogMasonry(),o(sowb).on("setup_widgets",sowb.setupBlogMasonry)})),window.sowb=sowb;
|
widgets/blog/js/portfolio.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* globals jQuery, sowb */
|
2 |
+
|
3 |
+
var sowb = window.sowb || {};
|
4 |
+
|
5 |
+
jQuery( function ( $ ) {
|
6 |
+
|
7 |
+
sowb.setupBlogPortfolio = function () {
|
8 |
+
$( '.sow-blog-layout-portfolio' ).each( function () {
|
9 |
+
var $$ = $( this ),
|
10 |
+
$buttons = $$.find( '.sow-portfolio-filter-terms button' ),
|
11 |
+
$container = $$.find( '.sow-blog-posts' );
|
12 |
+
|
13 |
+
if ( $buttons.length ) {
|
14 |
+
$container.isotope( {
|
15 |
+
itemSelector: '.sow-portfolio-item',
|
16 |
+
filter: '*',
|
17 |
+
layoutMode: 'fitRows',
|
18 |
+
resizable: true,
|
19 |
+
} );
|
20 |
+
}
|
21 |
+
|
22 |
+
$buttons.on( 'click', function() {
|
23 |
+
var selector = $( this ).attr( 'data-filter' );
|
24 |
+
$container.isotope( {
|
25 |
+
filter: selector,
|
26 |
+
} );
|
27 |
+
$buttons.removeClass( 'active' );
|
28 |
+
$( this ).addClass( 'active' );
|
29 |
+
return false;
|
30 |
+
} );
|
31 |
+
} );
|
32 |
+
};
|
33 |
+
|
34 |
+
sowb.setupBlogPortfolio();
|
35 |
+
|
36 |
+
$( sowb ).on( 'setup_widgets', sowb.setupBlogPortfolio );
|
37 |
+
} );
|
38 |
+
|
39 |
+
window.sowb = sowb;
|
widgets/blog/js/portfolio.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
var sowb=window.sowb||{};jQuery((function(o){sowb.setupBlogPortfolio=function(){o(".sow-blog-layout-portfolio").each((function(){var t=o(this),i=t.find(".sow-portfolio-filter-terms button"),s=t.find(".sow-blog-posts");i.length&&s.isotope({itemSelector:".sow-portfolio-item",filter:"*",layoutMode:"fitRows",resizable:!0}),i.on("click",(function(){var t=o(this).attr("data-filter");return s.isotope({filter:t}),i.removeClass("active"),o(this).addClass("active"),!1}))}))},sowb.setupBlogPortfolio(),o(sowb).on("setup_widgets",sowb.setupBlogPortfolio)})),window.sowb=sowb;
|
widgets/blog/styles/alternate.less
ADDED
@@ -0,0 +1,211 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@responsive_breakpoint: 780px;
|
2 |
+
|
3 |
+
// Post.
|
4 |
+
@post_border_color: default;
|
5 |
+
@post_background: default;
|
6 |
+
|
7 |
+
// Post Title.
|
8 |
+
@title_color: default;
|
9 |
+
@title_color_hover: default;
|
10 |
+
@title_font: default;
|
11 |
+
@title_font_style: default;
|
12 |
+
@title_font_weight: default;
|
13 |
+
@title_font_size: default;
|
14 |
+
|
15 |
+
// Meta.
|
16 |
+
@meta_color: default;
|
17 |
+
@meta_color_hover: default;
|
18 |
+
@meta_font: default;
|
19 |
+
@meta_font_style: default;
|
20 |
+
@meta_font_size: default;
|
21 |
+
@meta_font_weight: default;
|
22 |
+
|
23 |
+
// Content.
|
24 |
+
@content_color: default;
|
25 |
+
@content_font: default;
|
26 |
+
@content_font_style: default;
|
27 |
+
@content_font_weight: default;
|
28 |
+
@content_font_size: default;
|
29 |
+
@content_link: default;
|
30 |
+
@content_link_hover: default;
|
31 |
+
|
32 |
+
// Pagination.
|
33 |
+
@pagination_background: default;
|
34 |
+
@pagination_background_hover: default;
|
35 |
+
@pagination_border_color: default;
|
36 |
+
@pagination_border_color_hover: default;
|
37 |
+
@pagination_border_radius: default;
|
38 |
+
@pagination_font: default;
|
39 |
+
@pagination_font_size: default;
|
40 |
+
@pagination_font_style: default;
|
41 |
+
@pagination_font_weight: default;
|
42 |
+
@pagination_height: default;
|
43 |
+
@pagination_link_color: default;
|
44 |
+
@pagination_link_margin: default;
|
45 |
+
@pagination_link_margin_offset: default;
|
46 |
+
@pagination_link_color_hover: default;
|
47 |
+
@pagination_dots_color: default;
|
48 |
+
@pagination_top_margin: default;
|
49 |
+
@pagination_width: default;
|
50 |
+
|
51 |
+
.sow-blog-layout-alternate {
|
52 |
+
|
53 |
+
article {
|
54 |
+
background: @post_background;
|
55 |
+
border: 1px solid @post_border_color;
|
56 |
+
margin-left: 0;
|
57 |
+
margin-right: 0;
|
58 |
+
margin-top: 0;
|
59 |
+
width: 100%;
|
60 |
+
|
61 |
+
// Alternating featured image alignment.
|
62 |
+
@media (min-width: @responsive_breakpoint) {
|
63 |
+
|
64 |
+
&:nth-of-type(2n) {
|
65 |
+
flex-direction: row-reverse;
|
66 |
+
}
|
67 |
+
|
68 |
+
&:nth-of-type(2n) {
|
69 |
+
|
70 |
+
.sow-entry-thumbnail a {
|
71 |
+
text-align: right;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
@media (max-width: @responsive_breakpoint) {
|
77 |
+
width: 100%;
|
78 |
+
}
|
79 |
+
|
80 |
+
.sow-entry-thumbnail {
|
81 |
+
width: 41.5006%;
|
82 |
+
|
83 |
+
@media (max-width: @responsive_breakpoint) {
|
84 |
+
width: 100%;
|
85 |
+
|
86 |
+
a {
|
87 |
+
text-align: left;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
.sow-blog-content-wrapper {
|
93 |
+
width: 58.4994%;
|
94 |
+
|
95 |
+
@media (max-width: @responsive_breakpoint) {
|
96 |
+
width: auto;
|
97 |
+
}
|
98 |
+
|
99 |
+
.sow-entry-header {
|
100 |
+
|
101 |
+
.sow-entry-title {
|
102 |
+
font-family: @title_font;
|
103 |
+
font-size: @title_font_size;
|
104 |
+
font-style: @title_font_style;
|
105 |
+
font-weight: @title_font_weight;
|
106 |
+
|
107 |
+
a {
|
108 |
+
color: @title_color;
|
109 |
+
|
110 |
+
&:hover,
|
111 |
+
&:focus {
|
112 |
+
color: @title_color_hover;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
}
|
116 |
+
|
117 |
+
.sow-entry-meta {
|
118 |
+
font-family: @meta_font;
|
119 |
+
font-size: @meta_font_size;
|
120 |
+
font-style: @meta_font_style;
|
121 |
+
font-weight: @meta_font_weight;
|
122 |
+
|
123 |
+
span {
|
124 |
+
color: @meta_color;
|
125 |
+
|
126 |
+
a {
|
127 |
+
color: @meta_color;
|
128 |
+
|
129 |
+
&:hover,
|
130 |
+
&:focus {
|
131 |
+
color: @meta_color_hover;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
&:not(:last-child)::after {
|
137 |
+
font-size: @meta_font_size;
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
.sow-entry-content {
|
143 |
+
color: @content_color;
|
144 |
+
font-family: @content_font;
|
145 |
+
font-size: @content_font_size;
|
146 |
+
font-style: @content_font_style;
|
147 |
+
font-weight: @content_font_weight;
|
148 |
+
|
149 |
+
a {
|
150 |
+
color: @content_link;
|
151 |
+
|
152 |
+
&:hover,
|
153 |
+
&:focus {
|
154 |
+
color: @content_link_hover;
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
.sow-more-link {
|
160 |
+
font-family: @content_font;
|
161 |
+
font-size: @content_font_size;
|
162 |
+
font-style: @content_font_style;
|
163 |
+
font-weight: @content_font_weight;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
}
|
167 |
+
|
168 |
+
.sow-post-navigation {
|
169 |
+
|
170 |
+
.sow-nav-links {
|
171 |
+
margin-top: @pagination_top_margin;
|
172 |
+
}
|
173 |
+
|
174 |
+
.page-numbers {
|
175 |
+
align-items: center;
|
176 |
+
display: flex;
|
177 |
+
height: @pagination_height;
|
178 |
+
justify-content: center;
|
179 |
+
width: @pagination_width;
|
180 |
+
|
181 |
+
&:not(.dots) {
|
182 |
+
background: @pagination_background;
|
183 |
+
border: 1px solid @pagination_border_color;
|
184 |
+
border-radius: @pagination_border_radius;
|
185 |
+
color: @pagination_link_color;
|
186 |
+
font-family: @pagination_font;
|
187 |
+
font-size: @pagination_font_size;
|
188 |
+
font-style: @pagination_font_style;
|
189 |
+
font-weight: @pagination_font_weight;
|
190 |
+
margin-right: @pagination_link_margin;
|
191 |
+
|
192 |
+
&:last-child {
|
193 |
+
margin-right: 0;
|
194 |
+
}
|
195 |
+
|
196 |
+
&.current,
|
197 |
+
&:hover,
|
198 |
+
&:focus {
|
199 |
+
background: @pagination_background_hover;
|
200 |
+
color: @pagination_link_color_hover;
|
201 |
+
border-color: @pagination_border_color_hover;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
.dots {
|
207 |
+
color: @pagination_dots_color;
|
208 |
+
margin-left: @pagination_link_margin_offset;
|
209 |
+
}
|
210 |
+
}
|
211 |
+
}
|
widgets/blog/styles/grid.less
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@columns: 2;
|
2 |
+
@column_spacing: 3.5%;
|
3 |
+
@responsive_breakpoint: 780px;
|
4 |
+
|
5 |
+
// Post.
|
6 |
+
@post_border_color: default;
|
7 |
+
@post_background: default;
|
8 |
+
|
9 |
+
// Post Title.
|
10 |
+
@title_color: default;
|
11 |
+
@title_color_hover: default;
|
12 |
+
@title_font: default;
|
13 |
+
@title_font_style: default;
|
14 |
+
@title_font_weight: default;
|
15 |
+
@title_font_size: default;
|
16 |
+
|
17 |
+
// Meta.
|
18 |
+
@meta_color: default;
|
19 |
+
@meta_color_hover: default;
|
20 |
+
@meta_font: default;
|
21 |
+
@meta_font_style: default;
|
22 |
+
@meta_font_size: default;
|
23 |
+
@meta_font_weight: default;
|
24 |
+
|
25 |
+
// Content.
|
26 |
+
@content_color: default;
|
27 |
+
@content_font: default;
|
28 |
+
@content_font_style: default;
|
29 |
+
@content_font_weight: default;
|
30 |
+
@content_font_size: default;
|
31 |
+
@content_link: default;
|
32 |
+
@content_link_hover: default;
|
33 |
+
|
34 |
+
// Pagination.
|
35 |
+
@pagination_background: default;
|
36 |
+
@pagination_background_hover: default;
|
37 |
+
@pagination_border_color: default;
|
38 |
+
@pagination_border_color_hover: default;
|
39 |
+
@pagination_border_radius: default;
|
40 |
+
@pagination_font: default;
|
41 |
+
@pagination_font_size: default;
|
42 |
+
@pagination_font_style: default;
|
43 |
+
@pagination_font_weight: default;
|
44 |
+
@pagination_height: default;
|
45 |
+
@pagination_link_color: default;
|
46 |
+
@pagination_link_margin: default;
|
47 |
+
@pagination_link_margin_offset: default;
|
48 |
+
@pagination_link_color_hover: default;
|
49 |
+
@pagination_dots_color: default;
|
50 |
+
@pagination_top_margin: default;
|
51 |
+
@pagination_width: default;
|
52 |
+
|
53 |
+
.sow-blog-layout-grid {
|
54 |
+
|
55 |
+
.sow-blog-posts {
|
56 |
+
column-gap: @column_spacing;
|
57 |
+
display: grid;
|
58 |
+
grid-template-columns: repeat( @columns, 1fr );
|
59 |
+
}
|
60 |
+
|
61 |
+
article {
|
62 |
+
background: @post_background;
|
63 |
+
border: 1px solid @post_border_color;
|
64 |
+
|
65 |
+
@media (max-width: @responsive_breakpoint) {
|
66 |
+
width: 100%;
|
67 |
+
}
|
68 |
+
|
69 |
+
.sow-entry-header {
|
70 |
+
|
71 |
+
.sow-entry-title {
|
72 |
+
font-family: @title_font;
|
73 |
+
font-size: @title_font_size;
|
74 |
+
font-style: @title_font_style;
|
75 |
+
font-weight: @title_font_weight;
|
76 |
+
|
77 |
+
a {
|
78 |
+
color: @title_color;
|
79 |
+
|
80 |
+
&:hover,
|
81 |
+
&:focus {
|
82 |
+
color: @title_color_hover;
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
.sow-entry-meta {
|
88 |
+
font-family: @meta_font;
|
89 |
+
font-size: @meta_font_size;
|
90 |
+
font-style: @meta_font_style;
|
91 |
+
font-weight: @meta_font_weight;
|
92 |
+
|
93 |
+
span {
|
94 |
+
color: @meta_color;
|
95 |
+
|
96 |
+
a {
|
97 |
+
color: @meta_color;
|
98 |
+
|
99 |
+
&:hover,
|
100 |
+
&:focus {
|
101 |
+
color: @meta_color_hover;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
&:not(:last-child)::after {
|
107 |
+
font-size: @meta_font_size;
|
108 |
+
}
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
.sow-entry-content {
|
113 |
+
color: @content_color;
|
114 |
+
font-family: @content_font;
|
115 |
+
font-size: @content_font_size;
|
116 |
+
font-style: @content_font_style;
|
117 |
+
font-weight: @content_font_weight;
|
118 |
+
|
119 |
+
a {
|
120 |
+
color: @content_link;
|
121 |
+
|
122 |
+
&:hover,
|
123 |
+
&:focus {
|
124 |
+
color: @content_link_hover;
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
.sow-more-link {
|
130 |
+
font-family: @content_font;
|
131 |
+
font-size: @content_font_size;
|
132 |
+
font-style: @content_font_style;
|
133 |
+
font-weight: @content_font_weight;
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
.sow-post-navigation {
|
138 |
+
|
139 |
+
.sow-nav-links {
|
140 |
+
margin-top: @pagination_top_margin;
|
141 |
+
}
|
142 |
+
|
143 |
+
.page-numbers {
|
144 |
+
align-items: center;
|
145 |
+
display: flex;
|
146 |
+
height: @pagination_height;
|
147 |
+
justify-content: center;
|
148 |
+
width: @pagination_width;
|
149 |
+
|
150 |
+
&:not(.dots) {
|
151 |
+
background: @pagination_background;
|
152 |
+
border: 1px solid @pagination_border_color;
|
153 |
+
border-radius: @pagination_border_radius;
|
154 |
+
color: @pagination_link_color;
|
155 |
+
font-family: @pagination_font;
|
156 |
+
font-size: @pagination_font_size;
|
157 |
+
font-style: @pagination_font_style;
|
158 |
+
font-weight: @pagination_font_weight;
|
159 |
+
margin-right: @pagination_link_margin;
|
160 |
+
|
161 |
+
&:last-child {
|
162 |
+
margin-right: 0;
|
163 |
+
}
|
164 |
+
|
165 |
+
&.current,
|
166 |
+
&:hover,
|
167 |
+
&:focus {
|
168 |
+
background: @pagination_background_hover;
|
169 |
+
color: @pagination_link_color_hover;
|
170 |
+
border-color: @pagination_border_color_hover;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
}
|
174 |
+
|
175 |
+
.dots {
|
176 |
+
color: @pagination_dots_color;
|
177 |
+
margin-left: @pagination_link_margin_offset;
|
178 |
+
}
|
179 |
+
}
|
180 |
+
}
|
widgets/blog/styles/masonry.less
ADDED
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@categories: default;
|
2 |
+
@column_width: 50%;
|
3 |
+
@responsive_breakpoint: 780px;
|
4 |
+
|
5 |
+
// Post.
|
6 |
+
@post_border_color: default;
|
7 |
+
@post_background: default;
|
8 |
+
|
9 |
+
// Post Title.
|
10 |
+
@title_color: default;
|
11 |
+
@title_color_hover: default;
|
12 |
+
@title_font: default;
|
13 |
+
@title_font_style: default;
|
14 |
+
@title_font_weight: default;
|
15 |
+
@title_font_size: default;
|
16 |
+
|
17 |
+
// Meta.
|
18 |
+
@meta_color: default;
|
19 |
+
@meta_color_hover: default;
|
20 |
+
@meta_font: default;
|
21 |
+
@meta_font_style: default;
|
22 |
+
@meta_font_size: default;
|
23 |
+
@meta_font_weight: default;
|
24 |
+
|
25 |
+
// Content.
|
26 |
+
@content_color: default;
|
27 |
+
@content_font: default;
|
28 |
+
@content_font_style: default;
|
29 |
+
@content_font_weight: default;
|
30 |
+
@content_font_size: default;
|
31 |
+
@content_link: default;
|
32 |
+
@content_link_hover: default;
|
33 |
+
|
34 |
+
// Pagination.
|
35 |
+
@pagination_background: default;
|
36 |
+
@pagination_background_hover: default;
|
37 |
+
@pagination_border_color: default;
|
38 |
+
@pagination_border_color_hover: default;
|
39 |
+
@pagination_border_radius: default;
|
40 |
+
@pagination_font: default;
|
41 |
+
@pagination_font_size: default;
|
42 |
+
@pagination_font_style: default;
|
43 |
+
@pagination_font_weight: default;
|
44 |
+
@pagination_height: default;
|
45 |
+
@pagination_link_color: default;
|
46 |
+
@pagination_link_margin: default;
|
47 |
+
@pagination_link_margin_offset: default;
|
48 |
+
@pagination_link_color_hover: default;
|
49 |
+
@pagination_dots_color: default;
|
50 |
+
@pagination_top_margin: default;
|
51 |
+
@pagination_width: default;
|
52 |
+
|
53 |
+
// Overlay Post Category.
|
54 |
+
@overlay_post_category_font: default;
|
55 |
+
@overlay_post_category_font_size: default;
|
56 |
+
@overlay_post_category_font_style: default;
|
57 |
+
@overlay_post_category_font_weight: default;
|
58 |
+
@overlay_post_category_color: default;
|
59 |
+
@overlay_post_category_color_hover: default;
|
60 |
+
@overlay_post_category_background: default;
|
61 |
+
@overlay_post_category_background_hover: default;
|
62 |
+
|
63 |
+
.sow-blog-layout-masonry {
|
64 |
+
|
65 |
+
article {
|
66 |
+
width: @column_width;
|
67 |
+
|
68 |
+
@media (max-width: @responsive_breakpoint) {
|
69 |
+
width: 100%;
|
70 |
+
}
|
71 |
+
|
72 |
+
.sow-blog-content-wrapper {
|
73 |
+
background: @post_background;
|
74 |
+
border: 1px solid @post_border_color;
|
75 |
+
}
|
76 |
+
|
77 |
+
& when( @categories = 1 ) {
|
78 |
+
|
79 |
+
.sow-entry-thumbnail {
|
80 |
+
|
81 |
+
.sow-thumbnail-meta {
|
82 |
+
display: block;
|
83 |
+
left: 10px;
|
84 |
+
position: absolute;
|
85 |
+
top: 10px;
|
86 |
+
z-index: 1;
|
87 |
+
|
88 |
+
ul {
|
89 |
+
display: inline-block;
|
90 |
+
list-style: none;
|
91 |
+
margin: 0 5px 0 0;
|
92 |
+
padding: 0;
|
93 |
+
|
94 |
+
li {
|
95 |
+
background: @overlay_post_category_background;
|
96 |
+
display: inline-block;
|
97 |
+
margin: 0 0 3px;
|
98 |
+
text-transform: uppercase;
|
99 |
+
transition: all 300ms ease-in-out;
|
100 |
+
|
101 |
+
&:hover,
|
102 |
+
&:focus {
|
103 |
+
background: @overlay_post_category_background_hover;
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
a {
|
108 |
+
color: @overlay_post_category_color;
|
109 |
+
display: block;
|
110 |
+
font-family: @overlay_post_category_font;
|
111 |
+
font-size: @overlay_post_category_font_size;
|
112 |
+
font-style: @overlay_post_category_font_style;
|
113 |
+
font-weight: @overlay_post_category_font_weight;
|
114 |
+
letter-spacing: 1px;
|
115 |
+
line-height: normal;
|
116 |
+
padding: 5.5px 12px 5px;
|
117 |
+
text-decoration: none;
|
118 |
+
|
119 |
+
&:hover,
|
120 |
+
&:focus {
|
121 |
+
color: @overlay_post_category_color_hover;
|
122 |
+
}
|
123 |
+
}
|
124 |
+
}
|
125 |
+
}
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
.sow-entry-header {
|
130 |
+
|
131 |
+
.sow-entry-title {
|
132 |
+
font-family: @title_font;
|
133 |
+
font-size: @title_font_size;
|
134 |
+
font-style: @title_font_style;
|
135 |
+
font-weight: @title_font_weight;
|
136 |
+
|
137 |
+
a {
|
138 |
+
color: @title_color;
|
139 |
+
|
140 |
+
&:hover,
|
141 |
+
&:focus {
|
142 |
+
color: @title_color_hover;
|
143 |
+
}
|
144 |
+
}
|
145 |
+
}
|
146 |
+
|
147 |
+
.sow-entry-meta {
|
148 |
+
font-family: @meta_font;
|
149 |
+
font-size: @meta_font_size;
|
150 |
+
font-style: @meta_font_style;
|
151 |
+
font-weight: @meta_font_weight;
|
152 |
+
|
153 |
+
span {
|
154 |
+
color: @meta_color;
|
155 |
+
|
156 |
+
a {
|
157 |
+
color: @meta_color;
|
158 |
+
|
159 |
+
&:hover,
|
160 |
+
&:focus {
|
161 |
+
color: @meta_color_hover;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
&:not(:last-child)::after {
|
166 |
+
font-size: @meta_font_size;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
|
172 |
+
.sow-entry-content {
|
173 |
+
color: @content_color;
|
174 |
+
font-family: @content_font;
|
175 |
+
font-size: @content_font_size;
|
176 |
+
font-style: @content_font_style;
|
177 |
+
font-weight: @content_font_weight;
|
178 |
+
|
179 |
+
a {
|
180 |
+
color: @content_link;
|
181 |
+
|
182 |
+
&:hover,
|
183 |
+
&:focus {
|
184 |
+
color: @content_link_hover;
|
185 |
+
}
|
186 |
+
}
|
187 |
+
}
|
188 |
+
|
189 |
+
.sow-more-link {
|
190 |
+
font-family: @content_font;
|
191 |
+
font-size: @content_font_size;
|
192 |
+
font-style: @content_font_style;
|
193 |
+
font-weight: @content_font_weight;
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
.sow-post-navigation {
|
198 |
+
|
199 |
+
.sow-nav-links {
|
200 |
+
margin-top: @pagination_top_margin;
|
201 |
+
}
|
202 |
+
|
203 |
+
.page-numbers {
|
204 |
+
align-items: center;
|
205 |
+
display: flex;
|
206 |
+
height: @pagination_height;
|
207 |
+
justify-content: center;
|
208 |
+
width: @pagination_width;
|
209 |
+
|
210 |
+
&:not(.dots) {
|
211 |
+
background: @pagination_background;
|
212 |
+
border: 1px solid @pagination_border_color;
|
213 |
+
border-radius: @pagination_border_radius;
|
214 |
+
color: @pagination_link_color;
|
215 |
+
font-family: @pagination_font;
|
216 |
+
font-size: @pagination_font_size;
|
217 |
+
font-style: @pagination_font_style;
|
218 |
+
font-weight: @pagination_font_weight;
|
219 |
+
margin-right: @pagination_link_margin;
|
220 |
+
|
221 |
+
&:last-child {
|
222 |
+
margin-right: 0;
|
223 |
+
}
|
224 |
+
|
225 |
+
&.current,
|
226 |
+
&:hover,
|
227 |
+
&:focus {
|
228 |
+
background: @pagination_background_hover;
|
229 |
+
color: @pagination_link_color_hover;
|
230 |
+
border-color: @pagination_border_color_hover;
|
231 |
+
}
|
232 |
+
}
|
233 |
+
}
|
234 |
+
|
235 |
+
.dots {
|
236 |
+
color: @pagination_dots_color;
|
237 |
+
margin-left: @pagination_link_margin_offset;
|
238 |
+
}
|
239 |
+
}
|
240 |
+
}
|
widgets/blog/styles/offset.less
ADDED
@@ -0,0 +1,225 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@responsive_breakpoint: 780px;
|
2 |
+
@author: default;
|
3 |
+
|
4 |
+
// Post.
|
5 |
+
@post_border_color: default;
|
6 |
+
@post_background: default;
|
7 |
+
|
8 |
+
// Post Title.
|
9 |
+
@title_color: default;
|
10 |
+
@title_color_hover: default;
|
11 |
+
@title_font: default;
|
12 |
+
@title_font_style: default;
|
13 |
+
@title_font_weight: default;
|
14 |
+
@title_font_size: default;
|
15 |
+
|
16 |
+
// Meta.
|
17 |
+
@meta_color: default;
|
18 |
+
@meta_color_hover: default;
|
19 |
+
@meta_font: default;
|
20 |
+
@meta_font_style: default;
|
21 |
+
@meta_font_size: default;
|
22 |
+
@meta_font_weight: default;
|
23 |
+
|
24 |
+
// Content.
|
25 |
+
@content_color: default;
|
26 |
+
@content_font: default;
|
27 |
+
@content_font_style: default;
|
28 |
+
@content_font_weight: default;
|
29 |
+
@content_font_size: default;
|
30 |
+
@content_link: default;
|
31 |
+
@content_link_hover: default;
|
32 |
+
|
33 |
+
// Pagination.
|
34 |
+
@pagination_background: default;
|
35 |
+
@pagination_background_hover: default;
|
36 |
+
@pagination_border_color: default;
|
37 |
+
@pagination_border_color_hover: default;
|
38 |
+
@pagination_border_radius: default;
|
39 |
+
@pagination_font: default;
|
40 |
+
@pagination_font_size: default;
|
41 |
+
@pagination_font_style: default;
|
42 |
+
@pagination_font_weight: default;
|
43 |
+
@pagination_height: default;
|
44 |
+
@pagination_link_color: default;
|
45 |
+
@pagination_link_margin: default;
|
46 |
+
@pagination_link_margin_offset: default;
|
47 |
+
@pagination_link_color_hover: default;
|
48 |
+
@pagination_dots_color: default;
|
49 |
+
@pagination_top_margin: default;
|
50 |
+
@pagination_width: default;
|
51 |
+
|
52 |
+
// Offset Post Meta.
|
53 |
+
@offset_post_meta_color: default;
|
54 |
+
@offset_post_meta_font: default;
|
55 |
+
@offset_post_meta_font_size: default;
|
56 |
+
@offset_post_meta_font_style: default;
|
57 |
+
@offset_post_meta_font_weight: default;
|
58 |
+
@offset_post_meta_link_color: default;
|
59 |
+
@offset_post_meta_link_color_hover: default;
|
60 |
+
@offset_post_meta_link_font_size: default;
|
61 |
+
|
62 |
+
.sow-blog-layout-offset {
|
63 |
+
|
64 |
+
article {
|
65 |
+
|
66 |
+
.sow-blog-entry-offset {
|
67 |
+
color: @offset_post_meta_color;
|
68 |
+
font-family: @offset_post_meta_font;
|
69 |
+
font-size: @offset_post_meta_font_size;
|
70 |
+
font-style: @offset_post_meta_font_style;
|
71 |
+
font-weight: @offset_post_meta_font_weight;
|
72 |
+
|
73 |
+
@media (max-width: @responsive_breakpoint) {
|
74 |
+
margin-bottom: 15px;
|
75 |
+
width: 100% !important;
|
76 |
+
}
|
77 |
+
|
78 |
+
a {
|
79 |
+
color: @offset_post_meta_link_color;
|
80 |
+
font-size: @offset_post_meta_link_font_size;
|
81 |
+
|
82 |
+
&:hover,
|
83 |
+
&:focus {
|
84 |
+
color: @offset_post_meta_link_color_hover;
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
& when( @author = 1 ) {
|
89 |
+
|
90 |
+
.sow-entry-author-avatar {
|
91 |
+
display: block;
|
92 |
+
line-height: 0;
|
93 |
+
|
94 |
+
img {
|
95 |
+
border-radius: 50%;
|
96 |
+
width: 70px;
|
97 |
+
}
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
.sow-blog-entry {
|
103 |
+
|
104 |
+
@media (max-width: @responsive_breakpoint) {
|
105 |
+
width: 100% !important;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
.sow-blog-content-wrapper {
|
110 |
+
background: @post_background;
|
111 |
+
border: 1px solid @post_border_color;
|
112 |
+
}
|
113 |
+
|
114 |
+
.sow-entry-header {
|
115 |
+
|
116 |
+
.sow-entry-title {
|
117 |
+
font-family: @title_font;
|
118 |
+
font-size: @title_font_size;
|
119 |
+
font-style: @title_font_style;
|
120 |
+
font-weight: @title_font_weight;
|
121 |
+
|
122 |
+
a {
|
123 |
+
color: @title_color;
|
124 |
+
|
125 |
+
&:hover,
|
126 |
+
&:focus {
|
127 |
+
color: @title_color_hover;
|
128 |
+
}
|
129 |
+
}
|
130 |
+
}
|
131 |
+
|
132 |
+
.sow-entry-meta {
|
133 |
+
font-family: @meta_font;
|
134 |
+
font-size: @meta_font_size;
|
135 |
+
font-style: @meta_font_style;
|
136 |
+
font-weight: @meta_font_weight;
|
137 |
+
|
138 |
+
span {
|
139 |
+
color: @meta_color;
|
140 |
+
|
141 |
+
a {
|
142 |
+
color: @meta_color;
|
143 |
+
|
144 |
+
&:hover,
|
145 |
+
&:focus {
|
146 |
+
color: @meta_color_hover;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
&:not(:last-child)::after {
|
152 |
+
font-size: @meta_font_size;
|
153 |
+
}
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
.sow-entry-content {
|
158 |
+
color: @content_color;
|
159 |
+
font-family: @content_font;
|
160 |
+
font-size: @content_font_size;
|
161 |
+
font-style: @content_font_style;
|
162 |
+
font-weight: @content_font_weight;
|
163 |
+
|
164 |
+
a {
|
165 |
+
color: @content_link;
|
166 |
+
|
167 |
+
&:hover,
|
168 |
+
&:focus {
|
169 |
+
color: @content_link_hover;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
.sow-more-link {
|
175 |
+
font-family: @content_font;
|
176 |
+
font-size: @content_font_size;
|
177 |
+
font-style: @content_font_style;
|
178 |
+
font-weight: @content_font_weight;
|
179 |
+
}
|
180 |
+
}
|
181 |
+
|
182 |
+
.sow-post-navigation {
|
183 |
+
|
184 |
+
.sow-nav-links {
|
185 |
+
margin-top: @pagination_top_margin;
|
186 |
+
}
|
187 |
+
|
188 |
+
.page-numbers {
|
189 |
+
align-items: center;
|
190 |
+
display: flex;
|
191 |
+
height: @pagination_height;
|
192 |
+
justify-content: center;
|
193 |
+
width: @pagination_width;
|
194 |
+
|
195 |
+
&:not(.dots) {
|
196 |
+
background: @pagination_background;
|
197 |
+
border: 1px solid @pagination_border_color;
|
198 |
+
border-radius: @pagination_border_radius;
|
199 |
+
color: @pagination_link_color;
|
200 |
+
font-family: @pagination_font;
|
201 |
+
font-size: @pagination_font_size;
|
202 |
+
font-style: @pagination_font_style;
|
203 |
+
font-weight: @pagination_font_weight;
|
204 |
+
margin-right: @pagination_link_margin;
|
205 |
+
|
206 |
+
&:last-child {
|
207 |
+
margin-right: 0;
|
208 |
+
}
|
209 |
+
|
210 |
+
&.current,
|
211 |
+
&:hover,
|
212 |
+
&:focus {
|
213 |
+
background: @pagination_background_hover;
|
214 |
+
color: @pagination_link_color_hover;
|
215 |
+
border-color: @pagination_border_color_hover;
|
216 |
+
}
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
.dots {
|
221 |
+
color: @pagination_dots_color;
|
222 |
+
margin-left: @pagination_link_margin_offset;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
}
|
widgets/blog/styles/portfolio.less
ADDED
@@ -0,0 +1,179 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@categories: default;
|
2 |
+
@columns: 3;
|
3 |
+
@responsive_breakpoint: 780px;
|
4 |
+
|
5 |
+
// Pagination.
|
6 |
+
@pagination_background: default;
|
7 |
+
@pagination_background_hover: default;
|
8 |
+
@pagination_border_color: default;
|
9 |
+
@pagination_border_color_hover: default;
|
10 |
+
@pagination_border_radius: default;
|
11 |
+
@pagination_font: default;
|
12 |
+
@pagination_font_size: default;
|
13 |
+
@pagination_font_style: default;
|
14 |
+
@pagination_font_weight: default;
|
15 |
+
@pagination_height: default;
|
16 |
+
@pagination_link_color: default;
|
17 |
+
@pagination_link_margin: default;
|
18 |
+
@pagination_link_margin_offset: default;
|
19 |
+
@pagination_link_color_hover: default;
|
20 |
+
@pagination_dots_color: default;
|
21 |
+
@pagination_top_margin: default;
|
22 |
+
@pagination_width: default;
|
23 |
+
|
24 |
+
// Filter Categories.
|
25 |
+
@filter_categories_font: default;
|
26 |
+
@filter_categories_font_size: default;
|
27 |
+
@filter_categories_font_style: default;
|
28 |
+
@filter_categories_font_weight: 600;
|
29 |
+
@filter_categories_color: default;
|
30 |
+
@filter_categories_color_hover: default;
|
31 |
+
@filter_categories_text_transform: default;
|
32 |
+
@filter_categories_selected_border_color: default;
|
33 |
+
@filter_categories_selected_border_thickness: default;
|
34 |
+
|
35 |
+
// Featured Image.
|
36 |
+
@featured_image_border_color: default;
|
37 |
+
@featured_image_hover_overlay_color: default;
|
38 |
+
@featured_image_post_title_font: default;
|
39 |
+
@featured_image_post_title_font_size: default;
|
40 |
+
@featured_image_post_title_font_style: default;
|
41 |
+
@featured_image_post_title_font_weight: 700;
|
42 |
+
@featured_image_post_title_color: default;
|
43 |
+
@featured_image_divider_border_color: default;
|
44 |
+
@featured_image_divider_border_thickness: default;
|
45 |
+
@featured_image_divider_border_margin: default;
|
46 |
+
@featured_image_post_meta_font: default;
|
47 |
+
@featured_image_post_meta_font_size: default;
|
48 |
+
@featured_image_post_meta_font_style: default;
|
49 |
+
@featured_image_post_meta_font_weight: 600;
|
50 |
+
@featured_image_post_meta_color: default;
|
51 |
+
|
52 |
+
.sow-blog-layout-portfolio {
|
53 |
+
|
54 |
+
.sow-blog-posts {
|
55 |
+
column-gap: 1.1667%;
|
56 |
+
display: grid;
|
57 |
+
grid-template-columns: repeat( @columns, 1fr );
|
58 |
+
}
|
59 |
+
|
60 |
+
& when( @categories = 1 ) {
|
61 |
+
|
62 |
+
.sow-portfolio-filter-terms {
|
63 |
+
|
64 |
+
button {
|
65 |
+
border: none;
|
66 |
+
border-bottom: @filter_categories_selected_border_thickness solid transparent;
|
67 |
+
border-radius: 0;
|
68 |
+
color: @filter_categories_color;
|
69 |
+
font-family: @filter_categories_font;
|
70 |
+
font-size: @filter_categories_font_size;
|
71 |
+
font-style: @filter_categories_font_style;
|
72 |
+
font-weight: @filter_categories_font_weight;
|
73 |
+
letter-spacing: 1px;
|
74 |
+
line-height: normal;
|
75 |
+
text-transform: @filter_categories_text_transform;
|
76 |
+
|
77 |
+
@media (max-width: @responsive_breakpoint) {
|
78 |
+
margin: 0 10px 5px 0;
|
79 |
+
}
|
80 |
+
|
81 |
+
&:hover,
|
82 |
+
&:focus {
|
83 |
+
color: @filter_categories_color_hover;
|
84 |
+
}
|
85 |
+
|
86 |
+
&.active {
|
87 |
+
border-bottom-color: @filter_categories_selected_border_color;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
}
|
91 |
+
}
|
92 |
+
|
93 |
+
article {
|
94 |
+
margin-bottom: 30px;
|
95 |
+
padding: 0 1.1667%;
|
96 |
+
|
97 |
+
@media (max-width: @responsive_breakpoint) {
|
98 |
+
width: 100%;
|
99 |
+
}
|
100 |
+
|
101 |
+
.sow-entry-thumbnail {
|
102 |
+
|
103 |
+
&:hover .sow-entry-overlay {
|
104 |
+
background: @featured_image_hover_overlay_color;
|
105 |
+
border: 2px solid @featured_image_border_color;
|
106 |
+
}
|
107 |
+
|
108 |
+
.sow-entry-title {
|
109 |
+
color: @featured_image_post_title_color;
|
110 |
+
font-family: @featured_image_post_title_font;
|
111 |
+
font-size: @featured_image_post_title_font_size;
|
112 |
+
font-style: @featured_image_post_title_font_style;
|
113 |
+
font-weight: @featured_image_post_title_font_weight;
|
114 |
+
}
|
115 |
+
|
116 |
+
& when( @categories = 1 ) {
|
117 |
+
.sow-entry-divider {
|
118 |
+
margin: @featured_image_divider_border_margin 0;
|
119 |
+
border: @featured_image_divider_border_thickness solid @featured_image_divider_border_color;
|
120 |
+
}
|
121 |
+
|
122 |
+
.sow-entry-project-type {
|
123 |
+
color: @featured_image_post_meta_color;
|
124 |
+
font-family: @featured_image_post_meta_font;
|
125 |
+
font-size: @featured_image_post_meta_font_size;
|
126 |
+
font-style: @featured_image_post_meta_font_style;
|
127 |
+
font-weight: @featured_image_post_meta_font_weight;
|
128 |
+
letter-spacing: 1px;
|
129 |
+
line-height: 1.7333;
|
130 |
+
text-transform: uppercase;
|
131 |
+
}
|
132 |
+
}
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
.sow-post-navigation {
|
137 |
+
|
138 |
+
.sow-nav-links {
|
139 |
+
margin-top: @pagination_top_margin;
|
140 |
+
}
|
141 |
+
|
142 |
+
.page-numbers {
|
143 |
+
align-items: center;
|
144 |
+
display: flex;
|
145 |
+
height: @pagination_height;
|
146 |
+
justify-content: center;
|
147 |
+
width: @pagination_width;
|
148 |
+
|
149 |
+
&:not(.dots) {
|
150 |
+
background: @pagination_background;
|
151 |
+
border: 1px solid @pagination_border_color;
|
152 |
+
border-radius: @pagination_border_radius;
|
153 |
+
color: @pagination_link_color;
|
154 |
+
font-family: @pagination_font;
|
155 |
+
font-size: @pagination_font_size;
|
156 |
+
font-style: @pagination_font_style;
|
157 |
+
font-weight: @pagination_font_weight;
|
158 |
+
margin-right: @pagination_link_margin;
|
159 |
+
|
160 |
+
&:last-child {
|
161 |
+
margin-right: 0;
|
162 |
+
}
|
163 |
+
|
164 |
+
&.current,
|
165 |
+
&:hover,
|
166 |
+
&:focus {
|
167 |
+
background: @pagination_background_hover;
|
168 |
+
color: @pagination_link_color_hover;
|
169 |
+
border-color: @pagination_border_color_hover;
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
.dots {
|
175 |
+
color: @pagination_dots_color;
|
176 |
+
margin-left: @pagination_link_margin_offset;
|
177 |
+
}
|
178 |
+
}
|
179 |
+
}
|
widgets/blog/styles/standard.less
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Post.
|
2 |
+
@post_border_color: default;
|
3 |
+
@post_background: default;
|
4 |
+
|
5 |
+
// Post Title
|
6 |
+
@title_color: default;
|
7 |
+
@title_color_hover: default;
|
8 |
+
@title_font: default;
|
9 |
+
@title_font_style: default;
|
10 |
+
@title_font_weight: default;
|
11 |
+
@title_font_size: default;
|
12 |
+
|
13 |
+
// Meta.
|
14 |
+
@meta_color: default;
|
15 |
+
@meta_color_hover: default;
|
16 |
+
@meta_font: default;
|
17 |
+
@meta_font_style: default;
|
18 |
+
@meta_font_size: default;
|
19 |
+
@meta_font_weight: default;
|
20 |
+
|
21 |
+
// Content.
|
22 |
+
@content_color: default;
|
23 |
+
@content_font: default;
|
24 |
+
@content_font_style: default;
|
25 |
+
@content_font_weight: default;
|
26 |
+
@content_font_size: default;
|
27 |
+
@content_link: default;
|
28 |
+
@content_link_hover: default;
|
29 |
+
|
30 |
+
// Pagination.
|
31 |
+
@pagination_background: default;
|
32 |
+
@pagination_background_hover: default;
|
33 |
+
@pagination_border_color: default;
|
34 |
+
@pagination_border_color_hover: default;
|
35 |
+
@pagination_border_radius: default;
|
36 |
+
@pagination_font: default;
|
37 |
+
@pagination_font_size: default;
|
38 |
+
@pagination_font_style: default;
|
39 |
+
@pagination_font_weight: default;
|
40 |
+
@pagination_height: default;
|
41 |
+
@pagination_link_color: default;
|
42 |
+
@pagination_link_margin: default;
|
43 |
+
@pagination_link_margin_offset: default;
|
44 |
+
@pagination_link_color_hover: default;
|
45 |
+
@pagination_dots_color: default;
|
46 |
+
@pagination_top_margin: default;
|
47 |
+
@pagination_width: default;
|
48 |
+
|
49 |
+
.sow-blog-layout-standard {
|
50 |
+
|
51 |
+
article {
|
52 |
+
|
53 |
+
.sow-blog-content-wrapper {
|
54 |
+
background: @post_background;
|
55 |
+
border: 1px solid @post_border_color;
|
56 |
+
}
|
57 |
+
|
58 |
+
.sow-entry-header {
|
59 |
+
|
60 |
+
.sow-entry-title a {
|
61 |
+
font-family: @title_font;
|
62 |
+
font-size: @title_font_size;
|
63 |
+
font-style: @title_font_style;
|
64 |
+
font-weight: @title_font_weight;
|
65 |
+
color: @title_color;
|
66 |
+
|
67 |
+
&:hover,
|
68 |
+
&:focus {
|
69 |
+
color: @title_color_hover;
|
70 |
+
}
|
71 |
+
}
|
72 |
+
|
73 |
+
.sow-entry-meta {
|
74 |
+
font-family: @meta_font;
|
75 |
+
font-size: @meta_font_size;
|
76 |
+
font-style: @meta_font_style;
|
77 |
+
font-weight: @meta_font_weight;
|
78 |
+
|
79 |
+
span {
|
80 |
+
color: @meta_color;
|
81 |
+
|
82 |
+
a {
|
83 |
+
color: @meta_color;
|
84 |
+
|
85 |
+
&:hover,
|
86 |
+
&:focus {
|
87 |
+
color: @meta_color_hover;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
&:not(:last-child)::after {
|
93 |
+
font-size: @meta_font_size;
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
.sow-entry-content {
|
99 |
+
color: @content_color;
|
100 |
+
font-family: @content_font;
|
101 |
+
font-size: @content_font_size;
|
102 |
+
font-style: @content_font_style;
|
103 |
+
font-weight: @content_font_weight;
|
104 |
+
|
105 |
+
a {
|
106 |
+
color: @content_link;
|
107 |
+
|
108 |
+
&:hover,
|
109 |
+
&:focus {
|
110 |
+
color: @content_link_hover;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
.sow-more-link {
|
116 |
+
font-family: @content_font;
|
117 |
+
font-size: @content_font_size;
|
118 |
+
font-style: @content_font_style;
|
119 |
+
font-weight: @content_font_weight;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
.sow-post-navigation {
|
124 |
+
|
125 |
+
.sow-nav-links {
|
126 |
+
margin-top: @pagination_top_margin;
|
127 |
+
}
|
128 |
+
|
129 |
+
.page-numbers {
|
130 |
+
align-items: center;
|
131 |
+
display: flex;
|
132 |
+
height: @pagination_height;
|
133 |
+
justify-content: center;
|
134 |
+
width: @pagination_width;
|
135 |
+
|
136 |
+
&:not(.dots) {
|
137 |
+
background: @pagination_background;
|
138 |
+
border: 1px solid @pagination_border_color;
|
139 |
+
border-radius: @pagination_border_radius;
|
140 |
+
color: @pagination_link_color;
|
141 |
+
font-family: @pagination_font;
|
142 |
+
font-size: @pagination_font_size;
|
143 |
+
font-style: @pagination_font_style;
|
144 |
+
font-weight: @pagination_font_weight;
|
145 |
+
margin-right: @pagination_link_margin;
|
146 |
+
|
147 |
+
&:last-child {
|
148 |
+
margin-right: 0;
|
149 |
+
}
|
150 |
+
|
151 |
+
&.current,
|
152 |
+
&:hover,
|
153 |
+
&:focus {
|
154 |
+
background: @pagination_background_hover;
|
155 |
+
color: @pagination_link_color_hover;
|
156 |
+
border-color: @pagination_border_color_hover;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
}
|
160 |
+
|
161 |
+
.dots {
|
162 |
+
color: @pagination_dots_color;
|
163 |
+
margin-left: @pagination_link_margin_offset;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
}
|
widgets/blog/tpl/alternate.php
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $thumbnail_class = ! $settings['featured_image'] || ! has_post_thumbnail() ? 'sow-no-thumbnail' : ''; ?>
|
2 |
+
<article id="post-<?php the_ID(); ?>" <?php post_class( "sow-blog-columns $thumbnail_class" ); ?> style="display: flex; flex-wrap: wrap; justify-content: space-between; margin-bottom: 30px;">
|
3 |
+
<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings ); ?>
|
4 |
+
<div class="sow-blog-content-wrapper">
|
5 |
+
<header class="sow-entry-header" style="margin-bottom: 18px;">
|
6 |
+
<?php SiteOrigin_Widget_Blog_Widget::generate_post_title(); ?>
|
7 |
+
<div class="sow-entry-meta">
|
8 |
+
<?php SiteOrigin_Widget_Blog_Widget::post_meta( $settings ); ?>
|
9 |
+
</div>
|
10 |
+
</header>
|
11 |
+
|
12 |
+
<div class="sow-entry-content">
|
13 |
+
<?php
|
14 |
+
if ( $settings['content'] == 'full' ) {
|
15 |
+
the_content();
|
16 |
+
} else {
|
17 |
+
SiteOrigin_Widget_Blog_Widget::generate_excerpt( $settings );
|
18 |
+
}
|
19 |
+
?>
|
20 |
+
</div>
|
21 |
+
</div>
|
22 |
+
</article>
|
widgets/blog/tpl/base.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if ( ! empty( $posts ) && $posts->have_posts() ) : ?>
|
2 |
+
<?php
|
3 |
+
if ( ! empty( $instance['title'] ) ) :
|
4 |
+
echo $args['before_title'] . $instance['title'] . $args['after_title'];
|
5 |
+
endif;
|
6 |
+
|
7 |
+
// Set up moretag override when the full content is set to output.
|
8 |
+
if (
|
9 |
+
$settings['content'] == 'full' &&
|
10 |
+
apply_filters( 'siteorigin_widgets_blog_full_content_read_more', true )
|
11 |
+
) :
|
12 |
+
set_query_var( 'siteorigin_blog_read_more', ! empty( $settings['read_more_text'] ) ? $settings['read_more_text'] : __( 'Continue reading', 'so-widgets-bundle' ) );
|
13 |
+
|
14 |
+
add_filter( 'the_content_more_link', array( $this, 'alter_read_more_link' ) );
|
15 |
+
endif;
|
16 |
+
?>
|
17 |
+
<div
|
18 |
+
class="sow-blog sow-blog-layout-<?php echo esc_attr( $instance['template'] ); ?>"
|
19 |
+
data-template="<?php echo esc_attr( $instance['template'] ); ?>"
|
20 |
+
data-settings="<?php echo esc_attr( json_encode( $settings ) ); ?>"
|
21 |
+
data-paged="<?php echo esc_attr( $posts->query['paged'] ); ?>"
|
22 |
+
data-total-pages="<?php echo esc_attr( $posts->max_num_pages ); ?>"
|
23 |
+
data-hash="<?php echo esc_attr( $storage_hash ); ?>"
|
24 |
+
>
|
25 |
+
<?php
|
26 |
+
if (
|
27 |
+
$instance['template'] == 'portfolio' &&
|
28 |
+
$template_settings['filter_categories'] &&
|
29 |
+
! is_wp_error( $template_settings['terms'] )
|
30 |
+
) :
|
31 |
+
?>
|
32 |
+
<div class="sow-portfolio-filter-terms" style="margin-bottom: 25px;">
|
33 |
+
<button data-filter="*" class="active" style="background: none; margin-right: 34px; padding: 0 0 6px;">
|
34 |
+
<?php echo esc_html__( 'All', 'so-widgets-bundle' ); ?>
|
35 |
+
</button>
|
36 |
+
<?php foreach ( $template_settings['terms'] as $tax_term ) : ?>
|
37 |
+
<button data-filter=".<?php echo $tax_term->slug; ?>" style="background: none; box-shadow: none; margin-right: 34px; padding: 0 0 6px;">
|
38 |
+
<?php echo $tax_term->slug; ?>
|
39 |
+
</button>
|
40 |
+
<?php endforeach; ?>
|
41 |
+
</div>
|
42 |
+
<?php endif; ?>
|
43 |
+
|
44 |
+
<div class="sow-blog-posts">
|
45 |
+
<?php while ( $posts->have_posts() ) : $posts->the_post(); ?>
|
46 |
+
<?php include plugin_dir_path( __FILE__ ) . $instance['template'] . '.php'; ?>
|
47 |
+
<?php endwhile; ?>
|
48 |
+
</div>
|
49 |
+
<?php $this->paginate_links( $settings, $posts, $instance ); ?>
|
50 |
+
</div>
|
51 |
+
<?php
|
52 |
+
if (
|
53 |
+
$settings['content'] == 'full' &&
|
54 |
+
apply_filters( 'siteorigin_widgets_blog_full_content_read_more', true )
|
55 |
+
) :
|
56 |
+
remove_filter( 'the_content_more_link', array( $this, 'alter_read_more_link' ) );
|
57 |
+
endif;
|
58 |
+
?>
|
59 |
+
<?php endif; ?>
|
60 |
+
<?php wp_reset_postdata(); ?>
|
widgets/blog/tpl/grid.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> style="margin: 0 0 30px;">
|
2 |
+
<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings ); ?>
|
3 |
+
<div class="sow-blog-content-wrapper" style="padding: 25px 30px 33px;">
|
4 |
+
<header class="sow-entry-header" style="margin-bottom: 20px;">
|
5 |
+
<?php SiteOrigin_Widget_Blog_Widget::generate_post_title(); ?>
|
6 |
+
<div class="sow-entry-meta">
|
7 |
+
<?php SiteOrigin_Widget_Blog_Widget::post_meta( $settings ); ?>
|
8 |
+
</div>
|
9 |
+
</header>
|
10 |
+
|
11 |
+
<div class="sow-entry-content">
|
12 |
+
<?php
|
13 |
+
if ( $settings['content'] == 'full' ) {
|
14 |
+
the_content();
|
15 |
+
} else {
|
16 |
+
SiteOrigin_Widget_Blog_Widget::generate_excerpt( $settings );
|
17 |
+
}
|
18 |
+
?>
|
19 |
+
</div>
|
20 |
+
</div>
|
21 |
+
</article>
|
widgets/blog/tpl/masonry.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<article id="post-<?php the_ID(); ?>" <?php post_class( 'sow-masonry-item' ); ?>>
|
2 |
+
<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings, true ); ?>
|
3 |
+
<div class="sow-blog-content-wrapper" style="padding: 25px 30px 33px;">
|
4 |
+
<header class="sow-entry-header" style="margin-bottom: 20px;">
|
5 |
+
<?php SiteOrigin_Widget_Blog_Widget::generate_post_title(); ?>
|
6 |
+
<div class="sow-entry-meta">
|
7 |
+
<?php SiteOrigin_Widget_Blog_Widget::post_meta( $settings ); ?>
|
8 |
+
</div>
|
9 |
+
</header>
|
10 |
+
|
11 |
+
<div class="sow-entry-content">
|
12 |
+
<?php
|
13 |
+
if ( $settings['content'] == 'full' ) {
|
14 |
+
the_content();
|
15 |
+
} else {
|
16 |
+
SiteOrigin_Widget_Blog_Widget::generate_excerpt( $settings );
|
17 |
+
}
|
18 |
+
?>
|
19 |
+
</div>
|
20 |
+
</div>
|
21 |
+
</article>
|
widgets/blog/tpl/offset.php
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<article id="post-<?php the_ID(); ?>" <?php post_class( 'sow-blog-columns' ); ?> style="display: flex; flex-wrap: wrap; justify-content: space-between; margin: 0 0 40px;">
|
2 |
+
<div class="sow-blog-entry-offset" style="box-sizing: border-box; padding-right: 30px; width: 22%;">
|
3 |
+
<?php if ( $settings['author'] ) : ?>
|
4 |
+
<?php if ( function_exists( 'coauthors_posts_links' ) ) : ?>
|
5 |
+
<?php $coauthors = get_coauthors(); ?>
|
6 |
+
<span class="sow-meta-text">
|
7 |
+
<?php echo esc_html( _n( 'Author', 'Authors', count( $coauthors ), 'so-widgets-bundle' ) ); ?>
|
8 |
+
</span>
|
9 |
+
<?php foreach ( $coauthors as $author ) : ?>
|
10 |
+
<div class="sow-entry-author-avatar">
|
11 |
+
<a href="<?php echo get_author_posts_url( $author->ID ); ?>">
|
12 |
+
<?php echo get_avatar( $author->ID, 70 ); ?>
|
13 |
+
</a>
|
14 |
+
</div>
|
15 |
+
<div class="sow-entry-author-link">
|
16 |
+
<?php echo coauthors_posts_links_single( $author ); ?>
|
17 |
+
</div>
|
18 |
+
<?php endforeach; ?>
|
19 |
+
<?php else : ?>
|
20 |
+
<div class="sow-entry-author-avatar">
|
21 |
+
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
|
22 |
+
<?php echo get_avatar( get_the_author_meta( 'ID' ), 70 ); ?>
|
23 |
+
</a>
|
24 |
+
</div>
|
25 |
+
<div class="sow-entry-author-link">
|
26 |
+
<span class="sow-meta-text"><?php esc_html_e( 'Written by', 'so-widgets-bundle' ); ?></span>
|
27 |
+
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
|
28 |
+
<?php echo get_the_author(); ?>
|
29 |
+
</a>
|
30 |
+
</div>
|
31 |
+
<?php endif; ?>
|
32 |
+
<?php endif; ?>
|
33 |
+
|
34 |
+
<?php if ( $settings['categories'] ) : ?>
|
35 |
+
<div class="sow-entry-categories">
|
36 |
+
<span class="sow-meta-text"><?php esc_html_e( 'Posted in', 'so-widgets-bundle' ); ?></span>
|
37 |
+
<?php the_category( ', ', '', '' ); ?>
|
38 |
+
</div>
|
39 |
+
<?php endif; ?>
|
40 |
+
|
41 |
+
<?php if ( comments_open() && $settings['comment_count'] ) : ?>
|
42 |
+
<div class="sow-entry-comments">
|
43 |
+
<span class="sow-meta-text"><?php esc_html_e( 'Comments', 'so-widgets-bundle' ); ?></span>
|
44 |
+
<?php
|
45 |
+
echo comments_popup_link(
|
46 |
+
esc_html__( 'Post a comment', 'so-widgets-bundle' ),
|
47 |
+
esc_html__( '1 Comment', 'so-widgets-bundle' ),
|
48 |
+
esc_html__( '% Comments', 'so-widgets-bundle' )
|
49 |
+
);
|
50 |
+
?>
|
51 |
+
</div>
|
52 |
+
<?php endif; ?>
|
53 |
+
</div>
|
54 |
+
<div class="sow-blog-entry" style="width: 78%;">
|
55 |
+
<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings ); ?>
|
56 |
+
<div class="sow-blog-content-wrapper" style="padding: 25px 30px 33px;">
|
57 |
+
<header class="sow-entry-header" style="margin-bottom: 20px;">
|
58 |
+
<?php
|
59 |
+
SiteOrigin_Widget_Blog_Widget::generate_post_title();
|
60 |
+
if ( ! empty( $template_settings['time_string'] ) ) {
|
61 |
+
$time_string = sprintf( $template_settings['time_string'],
|
62 |
+
esc_attr( get_the_date( DATE_W3C ) ),
|
63 |
+
esc_html( get_the_date( $template_settings['date_format'] ) ),
|
64 |
+
esc_attr( get_the_modified_date( DATE_W3C ) ),
|
65 |
+
esc_html( get_the_modified_date( $template_settings['date_format'] ) )
|
66 |
+
);
|
67 |
+
?>
|
68 |
+
<div class="sow-entry-meta">
|
69 |
+
<?php
|
70 |
+
echo '<span class="sow-posted-on">';
|
71 |
+
printf(
|
72 |
+
/* translators: %s: post date. */
|
73 |
+
esc_html_x( 'Posted on %s', 'post date', 'so-widgets-bundle' ),
|
74 |
+
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
|
75 |
+
);
|
76 |
+
echo '</span>';
|
77 |
+
?>
|
78 |
+
</div>
|
79 |
+
<?php } ?>
|
80 |
+
</header>
|
81 |
+
|
82 |
+
<div class="sow-entry-content">
|
83 |
+
<?php
|
84 |
+
if ( $settings['content'] == 'full' ) {
|
85 |
+
the_content();
|
86 |
+
} else {
|
87 |
+
SiteOrigin_Widget_Blog_Widget::generate_excerpt( $settings );
|
88 |
+
}
|
89 |
+
?>
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
</article>
|
widgets/blog/tpl/portfolio.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$types = null;
|
3 |
+
if ( $settings['categories'] || $template_settings['filter_categories'] ) {
|
4 |
+
$terms = SiteOrigin_Widget_Blog_Widget::portfolio_get_terms( $instance, get_the_ID() );
|
5 |
+
if ( ! is_wp_error( $terms ) ) {
|
6 |
+
$filtering_links = array();
|
7 |
+
|
8 |
+
if ( $terms ) {
|
9 |
+
foreach ( $terms as $term ) {
|
10 |
+
$filtering_links[] = $term->slug;
|
11 |
+
}
|
12 |
+
}
|
13 |
+
|
14 |
+
$filtering = join( ', ', $filtering_links );
|
15 |
+
$types = $filtering ? join( ' ', $filtering_links ) : ' ';
|
16 |
+
}
|
17 |
+
}
|
18 |
+
?>
|
19 |
+
<article id="post-<?php the_ID(); ?> <?php echo $types; ?>" <?php post_class( 'sow-portfolio-item ' . $types ); ?>>
|
20 |
+
<div class="sow-entry-thumbnail">
|
21 |
+
<a href="<?php the_permalink(); ?>" class="sow-entry-link-overlay"> </a>
|
22 |
+
<span class="sow-entry-overlay"> </span>
|
23 |
+
<div class="sow-entry-content">
|
24 |
+
<?php the_title(
|
25 |
+
'<h2 class="sow-entry-title" style="margin: 0 0 5px;">',
|
26 |
+
'</h2>'
|
27 |
+
); ?>
|
28 |
+
<?php if ( $settings['categories'] ) : ?>
|
29 |
+
<div class="sow-entry-divider"></div>
|
30 |
+
<span class="sow-entry-project-type"><?php echo $filtering; ?></span>
|
31 |
+
<?php endif; ?>
|
32 |
+
</div>
|
33 |
+
<?php the_post_thumbnail( 'sow-blog-portfolio' ); ?>
|
34 |
+
</div>
|
35 |
+
</article>
|
widgets/blog/tpl/standard.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> style="margin: 0 0 40px">
|
2 |
+
<?php SiteOrigin_Widget_Blog_Widget::post_featured_image( $settings ); ?>
|
3 |
+
<div class="sow-blog-content-wrapper" style="padding: 25px 30px 38px;">
|
4 |
+
<header class="sow-entry-header" style="margin-bottom: 20px;">
|
5 |
+
<?php SiteOrigin_Widget_Blog_Widget::generate_post_title(); ?>
|
6 |
+
<div class="sow-entry-meta">
|
7 |
+
<?php SiteOrigin_Widget_Blog_Widget::post_meta( $settings ); ?>
|
8 |
+
</div>
|
9 |
+
</header>
|
10 |
+
|
11 |
+
<div class="sow-entry-content">
|
12 |
+
<?php
|
13 |
+
if ( $settings['content'] == 'full' ) {
|
14 |
+
the_content();
|
15 |
+
} else {
|
16 |
+
SiteOrigin_Widget_Blog_Widget::generate_excerpt( $settings );
|
17 |
+
}
|
18 |
+
?>
|
19 |
+
</div>
|
20 |
+
</div>
|
21 |
+
</article>
|