Removes Masonry View Mode from theme and it's dependencies.

This commit is contained in:
mateuswetah 2018-08-03 13:55:45 -03:00
parent b76a17289a
commit 7b8bae7a7d
9 changed files with 2 additions and 213 deletions

View File

@ -8,9 +8,7 @@
"require": {
"twbs/bootstrap": "4.*",
"wp-bootstrap/wp-bootstrap-navwalker": "*",
"kenwheeler/slick": "1.6.1",
"desandro/masonry": "4.*",
"desandro/imagesloaded": "4.*"
"kenwheeler/slick": "1.6.1"
},
"scripts": {
"post-install-cmd": "bash install.sh",

80
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "e76fd93afcf5cccb4b58c468e70bbeba",
"content-hash": "3d0374e3fd2d6b43ef8af59ab09d04f8",
"packages": [
{
"name": "composer/installers",
@ -126,84 +126,6 @@
],
"time": "2017-12-29T09:13:20+00:00"
},
{
"name": "desandro/imagesloaded",
"version": "v4.1.4",
"source": {
"type": "git",
"url": "https://github.com/desandro/imagesloaded.git",
"reference": "67c4e57453120935180c45c6820e7d3fbd2ea1f9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/desandro/imagesloaded/zipball/67c4e57453120935180c45c6820e7d3fbd2ea1f9",
"reference": "67c4e57453120935180c45c6820e7d3fbd2ea1f9",
"shasum": ""
},
"type": "component",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "David DeSandro",
"homepage": "http://desandro.com/",
"role": "developer"
}
],
"description": "JavaScript is all like _You images done yet or what?_",
"homepage": "http://imagesloaded.desandro.com",
"keywords": [
"dom",
"images",
"javascript",
"jquery-plugin",
"library",
"loaded",
"ui"
],
"time": "2018-01-02T16:53:35+00:00"
},
{
"name": "desandro/masonry",
"version": "v4.2.2",
"source": {
"type": "git",
"url": "https://github.com/desandro/masonry.git",
"reference": "3b0883cf4a4a046896719b9cf282ea74be7ffecd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/desandro/masonry/zipball/3b0883cf4a4a046896719b9cf282ea74be7ffecd",
"reference": "3b0883cf4a4a046896719b9cf282ea74be7ffecd",
"shasum": ""
},
"type": "component",
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "David DeSandro",
"homepage": "http://desandro.com/",
"role": "developer"
}
],
"description": "Cascading grid layout library",
"homepage": "https://masonry.desandro.com",
"keywords": [
"browser",
"dom",
"grid",
"javascript",
"layout",
"library",
"outlayer"
],
"time": "2018-07-04T18:01:15+00:00"
},
{
"name": "kenwheeler/slick",
"version": "1.6.1",

View File

@ -39,13 +39,6 @@ echo "Copy Slick for Slider...\n\n";
copy("vendor/kenwheeler/slick/slick/ajax-loader.gif", "src/assets/vendor/slick/ajax-loader.gif");
recurse_copy("vendor/kenwheeler/slick/slick/fonts", "src/assets/vendor/slick/fonts");
echo "Copy Masonry & ImageLoaded... \n\n";
if (!file_exists("src/assets/vendor/desandro")) {
mkdir("src/assets/vendor/desandro/", 0777, true);
}
copy("vendor/desandro/masonry/dist/masonry.pkgd.min.js", "src/assets/vendor/desandro/masonry.pkgd.min.js");
copy("vendor/desandro/imagesloaded/imagesloaded.pkgd.min.js", "src/assets/vendor/desandro/imagesloaded.pkgd.min.js");
echo "Finish Copy files! \n\n";
function recurse_copy($src,$dst) {

View File

@ -36,22 +36,6 @@ jQuery(document).ready(function( $ ) {
*/
$('.wp-block-button a').toggleClass().addClass('btn btn-jelly-bean');
// Instantiates Masonry;
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if ($('.tainacan-masonry-view')[0]) {
$('.tainacan-masonry-view').masonry({
percentPosition: true,
itemSelector: '.grid-item',
/* columnWidth: '.grid-sizer', */
columnWidth: 277,
//gutter: '.gutter-sizer',
horizontalOrder: true,
});
}
});
});
$('.showInput').on('click', function(){
$('.tainacan-form-search').removeClass('d-none');
$('.tainacan-form-search').addClass('d-flex');
@ -81,15 +65,6 @@ jQuery(document).ready(function( $ ) {
}
});
var config = {
attributes: true,
childList: true,
characterData: true
};
if(document.getElementById('items-list-area'))
observer.observe(document.getElementById('items-list-area'), config);
$('.tainacan-list-post .table .tainacan-list-collection td').click(function(){
window.location = $('.tainacan-list-post .table .tainacan-list-collection').data("href");
});

View File

@ -1,50 +0,0 @@
.tainacan-masonry-view {
min-height: 50vh;
.grid-item{
.card{
img{
width: 247.5px;
height: auto;
}
&:hover{
background-color: #eaeaea;
}
/* &:selected{
background-color: #e6f6f8;
} */
.card-body{
padding: 0.85rem;
.card-title{
a{
color: #000 !important;
font-weight: 400;
font-size: 0.85rem;
}
}
}
}
}
/* margin: 1.5em 0;
padding: 0;
-moz-column-gap: 1.5em;
-webkit-column-gap: 1.5em;
column-gap: 0.5em;
.gutter-sizer { width: 4%; }
.grid-sizer, .grid-item{
width: 20%;
@media only screen and (max-width: 700px){
width: 100%;
}
}
.grid-item{
margin-bottom: 10px;
.card{
border: none;
img{
}
}
} */
}

View File

@ -460,8 +460,6 @@ form{
@import "_view-mode-frame.scss";
@import "_view-mode-masonry.scss";
@import "_view-mode-books.scss";
@import "_view-mode-polaroid.scss";

View File

@ -61,14 +61,6 @@ if(!function_exists('tainacan_setup')) {
'icon' => '<span class="icon"><i class="mdi mdi-apps mdi-24px"></i></span>',
'dynamic_metadata' => false,
]);
tainacan_register_view_mode('masonry', [
'label' => 'Masonry',
'description' => 'A masonry view',
'icon' => '<span class="icon"><i class="mdi mdi-view-dashboard mdi-24px"></i></span>',
'dynamic_metadata' => false,
]);
}
add_image_size( 'tainacan-theme-list-post', 300, 200, true );

View File

@ -14,12 +14,6 @@ if ( ! function_exists('tainacan_Enqueues') ) {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', includes_url( '/js/jquery/jquery.js' ), false, NULL, true );
wp_enqueue_script( 'jquery' );
wp_register_script('masonryJS', get_template_directory_uri() . '/assets/vendor/desandro/masonry.pkgd.min.js', '', '', true);
wp_enqueue_script( 'masonryJS' );
wp_register_script('imageLoadedJS', get_template_directory_uri() . '/assets/vendor/desandro/imagesloaded.pkgd.min.js', '', '', true);
wp_enqueue_script( 'imageLoadedJS' );
/**
* Bootstrap 4.1.3
*/

View File

@ -1,33 +0,0 @@
<div class="container">
<?php if (have_posts()): ?>
<div class="clearfix tainacan-masonry-view">
<div class="grid-sizer col col-sm-6 col-md-4 col-lg-3"></div>
<div class="gutter-sizer"></div>
<!-- <div class="tainacan-masonry-container card-columns p-3"> -->
<?php while (have_posts()): the_post(); ?>
<div class="grid-item col col-sm-6 col-md-4 col-lg-3 mb-3">
<div class="card border-0">
<?php if ( tainacan_current_view_displays('thumbnail') ): ?>
<?php if ( has_post_thumbnail() ): ?>
<?php the_post_thumbnail('tainacan-medium-full'); ?>
<?php else: ?>
<?php echo '<img alt="Thumbnail placeholder" src="'.get_stylesheet_directory_uri().'/assets/images/thumbnail_placeholder.png">'?>
<?php endif; ?>
<?php endif; ?>
<div class="card-body">
<h5 class="card-title">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h5>
</div>
</div>
</div>
<?php endwhile; ?>
</div>
<?php else: ?>
<div class="tainacan-masonry-view">
Nenhum item encontrado
</div>
<?php endif; ?>
</div>