Merge branch 'release/0.18' of https://github.com/tainacan/tainacan into release/0.18

This commit is contained in:
vnmedeiros 2021-05-13 11:56:46 -03:00
commit 9df35c82c4
55 changed files with 570 additions and 258 deletions

92
package-lock.json generated
View File

@ -3724,9 +3724,9 @@
}
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"ms": {
@ -5471,9 +5471,9 @@
"dev": true
},
"hosted-git-info": {
"version": "2.8.8",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz",
"integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg=="
"version": "2.8.9",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw=="
},
"hpack.js": {
"version": "2.1.6",
@ -5851,9 +5851,9 @@
"dev": true
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"string-width": {
@ -6459,9 +6459,9 @@
}
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ=="
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.difference": {
"version": "4.5.0",
@ -8295,9 +8295,9 @@
"dev": true
},
"querystringify": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz",
"integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
"dev": true
},
"randombytes": {
@ -8467,8 +8467,7 @@
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA=="
},
"regenerator-transform": {
"version": "0.14.4",
@ -10138,9 +10137,9 @@
"dev": true
},
"lodash": {
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"dev": true
},
"string-width": {
@ -10723,9 +10722,9 @@
}
},
"url-parse": {
"version": "1.4.7",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.4.7.tgz",
"integrity": "sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg==",
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.1.tgz",
"integrity": "sha512-HOfCOUJt7iSYzEx/UqgtwKRMC6EU91NFhsCHMv9oM03VJcVo2Qrp8T8kI9D7amFf1cu+/3CEhgb3rF9zL7k85Q==",
"dev": true,
"requires": {
"querystringify": "^2.1.1",
@ -10764,13 +10763,29 @@
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
},
"v-tooltip": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/v-tooltip/-/v-tooltip-2.0.3.tgz",
"integrity": "sha512-KZZY3s+dcijzZmV2qoDH4rYmjMZ9YKGBVoUznZKQX0e3c2GjpJm3Sldzz8HHH2Ud87JqhZPB4+4gyKZ6m98cKQ==",
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/v-tooltip/-/v-tooltip-2.1.3.tgz",
"integrity": "sha512-xXngyxLQTOx/yUEy50thb8te7Qo4XU6h4LZB6cvEfVd9mnysUxLEoYwGWDdqR+l69liKsy3IPkdYff3J1gAJ5w==",
"requires": {
"lodash": "^4.17.15",
"popper.js": "^1.16.0",
"vue-resize": "^0.4.5"
"@babel/runtime": "^7.13.10",
"lodash": "^4.17.21",
"popper.js": "^1.16.1",
"vue-resize": "^1.0.1"
},
"dependencies": {
"@babel/runtime": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz",
"integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
},
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
}
}
},
"v8-compile-cache": {
@ -10902,9 +10917,22 @@
"integrity": "sha512-viecHQiHVLez7HlYUQsv1wJb2MT/RDSzkDp6m3In41vPrk6OsBmT2qRE8LZqYIA4daIwrnx/Xm8h4fjOpuE3hw=="
},
"vue-resize": {
"version": "0.4.5",
"resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-0.4.5.tgz",
"integrity": "sha512-bhP7MlgJQ8TIkZJXAfDf78uJO+mEI3CaLABLjv0WNzr4CcGRGPIAItyWYnP6LsPA4Oq0WE+suidNs6dgpO4RHg=="
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-1.0.1.tgz",
"integrity": "sha512-z5M7lJs0QluJnaoMFTIeGx6dIkYxOwHThlZDeQnWZBizKblb99GSejPnK37ZbNE/rVwDcYcHY+Io+AxdpY952w==",
"requires": {
"@babel/runtime": "^7.13.10"
},
"dependencies": {
"@babel/runtime": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.0.tgz",
"integrity": "sha512-JELkvo/DlpNdJ7dlyw/eY7E0suy5i5GQH+Vlxaq1nsNJ+H7f4Vtv3jMeCEgRhZZQFXTjldYfQgv2qmM6M1v5wA==",
"requires": {
"regenerator-runtime": "^0.13.4"
}
}
}
},
"vue-router": {
"version": "3.1.6",

View File

@ -24,7 +24,7 @@
"react-dom": "^16.13.1",
"swiper": "^5.2.0",
"t": "^0.5.1",
"v-tooltip": "^2.0.3",
"v-tooltip": "^2.1.3",
"vue": "^2.6.11",
"vue-apexcharts": "^1.6.1",
"vue-awesome-swiper": "^4.1.1",

View File

@ -687,17 +687,37 @@ a.pswp__share--download:hover {
.tainacan-media-component__swiper-main .swiper-slide-content {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column; }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-embed-container {
display: block;
text-align: center; }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed {
width: 100%;
height: auto; }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-has-aspect-ratio {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 2) / 1);
/* Default to 2:1 aspect ratio. */
margin-left: auto;
margin-right: auto; }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-21-9 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 21) / 9); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-18-9 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 18) / 9); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-16-9 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 16) / 9); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-4-3 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 4) / 3); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-1-1 {
max-width: var(--tainacan-media-main-carousel-height, 60vh); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-3-4 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 3) / 4); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-9-16 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 9) / 16); }
.tainacan-media-component__swiper-main .swiper-slide-content .tainacan-content-embed.tainacan-embed-aspect-1-2 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 1) / 2); }
.tainacan-media-component__swiper-main .swiper-slide-content iframe {
max-height: var(--tainacan-media-main-carousel-height, 60vh);
width: 100%;
max-width: 100%;
margin-left: auto;
margin-right: auto;
border: none;
display: block;
background-image: url("../images/preloader.gif");
@ -724,6 +744,9 @@ a.pswp__share--download:hover {
.tainacan-media-component__swiper-main .swiper-slide-content img {
width: auto;
max-height: var(--tainacan-media-main-carousel-height, 60vh); }
.tainacan-media-component__swiper-main .swiper-slide-content .twitter-tweet {
margin-left: auto;
margin-right: auto; }
.tainacan-media-component__swiper-thumbs {
width: 100%;
@ -833,27 +856,53 @@ a.pswp__share--download:hover {
justify-content: center; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image {
width: 100%;
height: 100%;
height: calc(100% - 44px);
display: flex;
justify-content: center;
align-items: center;
justify-content: center; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image.tainacan-embed-container:not(.tainacan-embed-without-iframe) {
padding: 0px; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image .tainacan-embed-container .twitter-tweet {
width: 100vw !important; }
.tainacan-photoswipe-layer .pswp__container iframe {
text-align: center;
padding: 44px;
min-height: 90vh;
max-height: 90vh;
height: 100%;
width: 100%;
max-width: 100%;
margin: 0 auto;
margin-top: 22px; }
.tainacan-photoswipe-layer .pswp__container .attachment-without-image > iframe:not(.wp-embedded-content) {
width: 90vw;
height: 90vh;
border: none;
margin: 44px;
display: block;
background-image: url("../images/preloader.gif");
background-repeat: no-repeat;
background-position: center; }
.tainacan-photoswipe-layer .pswp__container .pswp__zoom-wrap > iframe#iframePDF {
width: 90vw;
height: 90vh;
border: none;
margin: 44px auto;
display: block;
background-image: url("../images/preloader.gif");
background-repeat: no-repeat;
background-position: center; }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed {
width: 100%;
height: auto; }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-has-aspect-ratio {
max-width: calc((90vh * 2) / 1);
/* Default to 2:1 aspect ratio. */
margin-left: auto;
margin-right: auto; }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-21-9 {
max-width: calc((90vh * 21) / 9); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-18-9 {
max-width: calc((90vh * 18) / 9); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-16-9 {
max-width: calc((90vh * 16) / 9); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-4-3 {
max-width: calc((90vh * 4) / 3); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-1-1 {
max-width: 90vh; }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-9-16 {
max-width: calc((90vh * 9) / 16); }
.tainacan-photoswipe-layer .pswp__container .tainacan-content-embed.tainacan-embed-aspect-1-2 {
max-width: calc((90vh * 1) / 2); }
.tainacan-photoswipe-layer .pswp__container a:first-of-type,
.tainacan-photoswipe-layer .pswp__container p:first-of-type,
.tainacan-photoswipe-layer .pswp__container article:first-of-type {

File diff suppressed because one or more lines are too long

View File

@ -1,54 +1,64 @@
body:not(.wp-embed-responsive) .tainacan-embed-container,
body.wp-embed-responsive :not(.wp-block-embed__wrapper)>.tainacan-embed-container {
position: relative;
overflow: hidden;
/* TAINACAN EMBEDS
* This file copies most of Gutenberg's logic for responsive blocks,
* but uses different classes to avoid future conflicts.
* Check their original css: /packages/block-library/src/embed/style.scss
*/
/*
* The embed container is in a `figure` element, and many themes zero this out.
* This rule explicitly sets it, to ensure at least some bottom-margin in the flow.
*/
:not(.wp-block-embed__wrapper)>.tainacan-content-embed {
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
clear: both;
}
/* Don't allow iframe to overflow it's container. */
:not(.wp-block-embed__wrapper)>.tainacan-content-embed iframe {
max-width: 100%;
height: auto;
}
:not(.wp-block-embed__wrapper)>.tainacan-content-embed .tainacan-content-embed__wrapper {
position: relative;
}
body:not(.wp-embed-responsive) .tainacan-embed-container:not(.tainacan-embed-without-iframe),
body.wp-embed-responsive :not(.wp-block-embed__wrapper)>.tainacan-embed-container:not(.tainacan-embed-without-iframe) {
padding-bottom: 56.25%;
padding-top: 30px;
width: 100%;
margin: auto;
/* Add responsiveness to embeds with aspect ratios. */
:not(.wp-block-embed__wrapper)>.tainacan-has-aspect-ratio .tainacan-content-embed__wrapper::before {
content: "";
display: block;
padding-top: 50%; /* Default to 2:1 aspect ratio. */
}
body:not(.wp-embed-responsive) .tainacan-embed-container .twitter-tweet,
body.wp-embed-responsive :not(.wp-block-embed__wrapper)>.tainacan-embed-container .twitter-tweet {
margin: 0 auto;
:not(.wp-block-embed__wrapper)>.tainacan-has-aspect-ratio iframe {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
height: 100%;
width: 100%;
}
body:not(.wp-embed-responsive) .tainacan-embed-container iframe.wp-embedded-content,
body.wp-embed-responsive :not(.wp-block-embed__wrapper)>.tainacan-embed-container iframe.wp-embedded-content {
display: flex !important;
align-items: center;
justify-content: center;
margin: auto !important;
width: auto !important;
top: 50%;
bottom: 50%;
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-21-9 .tainacan-content-embed__wrapper::before {
padding-top: 42.85%; /* 9 / 21 * 100 */
}
@media screen and (max-width: 1024px) {
body:not(.wp-embed-responsive) .tainacan-embed-container iframe.wp-embedded-content,
body.wp-embed-responsive :not(.wp-block-embed__wrapper)>.tainacan-embed-container iframe.wp-embedded-content {
position: relative;
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-18-9 .tainacan-content-embed__wrapper::before {
padding-top: 50%; /* 9 / 18 * 100 */
}
body:not(.wp-embed-responsive) .tainacan-embed-container #tainacan-attachment-iframe ,
body.wp-embed-responsive :not(.wp-block-embed__wrapper)>.tainacan-embed-container #tainacan-attachment-iframe { /* PDF */
width: 100%;
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-16-9 .tainacan-content-embed__wrapper::before {
padding-top: 56.25%; /* 9 / 16 * 100 */
}
body:not(.wp-embed-responsive) .tainacan-embed-container iframe,
body:not(.wp-embed-responsive) .tainacan-embed-container object,
body:not(.wp-embed-responsive) .tainacan-embed-container embed,
body.wp-embed-responsive :not(.wp-block-embed__wrapper)>.tainacan-embed-container iframe,
body.wp-embed-responsive :not(.wp-block-embed__wrapper)>.tainacan-embed-container object,
body.wp-embed-responsive :not(.wp-block-embed__wrapper)>.tainacan-embed-container embed {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-4-3 .tainacan-content-embed__wrapper::before {
padding-top: 75%; /* 3 / 4 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-1-1 .tainacan-content-embed__wrapper::before {
padding-top: 100%; /* 1 / 1 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-9-16 .tainacan-content-embed__wrapper::before {
padding-top: 177.77%; /* 16 / 9 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-3-4 .tainacan-content-embed__wrapper::before {
padding-top: 133.33%; /* 4 / 3 * 100 */
}
:not(.wp-block-embed__wrapper)>.tainacan-embed-aspect-1-2 .tainacan-content-embed__wrapper::before {
padding-top: 200%; /* 2 / 1 * 100 */
}

View File

@ -12,6 +12,19 @@ class Embed {
return self::$instance;
}
private static $aspect_ratios = array(
// Common video resolutions.
array("ratio" => '2.33', "className" => 'tainacan-embed-aspect-21-9'),
array("ratio" => '2.00', "className" => 'tainacan-embed-aspect-18-9'),
array("ratio" => '1.78', "className" => 'tainacan-embed-aspect-16-9'),
array("ratio" => '1.33', "className" => 'tainacan-embed-aspect-4-3'),
// Vertical video and instagram square video support.
array("ratio" => '1.00', "className" => 'tainacan-embed-aspect-1-1' ),
array("ratio" => '0.75', "className" => 'tainacan-embed-aspect-3-4'),
array("ratio" => '0.56', "className" => 'tainacan-embed-aspect-9-16'),
array("ratio" => '0.50', "className" => 'tainacan-embed-aspect-1-2' )
);
protected function __construct() {
@ -24,7 +37,7 @@ class Embed {
/**
* Add responsiveness to embeds
*/
add_filter('embed_oembed_html', [$this, 'responsive_embed'], 10, 3);
add_filter( 'embed_oembed_html', [$this, 'responsive_embed'], 10, 3);
add_action( 'admin_enqueue_scripts', array( &$this, 'add_css' ) );
add_action( 'wp_enqueue_scripts', array( &$this, 'add_css' ) );
@ -74,7 +87,7 @@ class Embed {
);
$args = array_merge($attr, $defaults);
$dimensions = '';
if ( ! empty( $args['width'] ) && ! empty( $args['height'] ) ) {
$dimensions .= sprintf( "width='%s' ", $args['width'] );
@ -109,7 +122,6 @@ class Embed {
}
/**
* Responsiveness
*/
@ -117,6 +129,69 @@ class Embed {
global $TAINACAN_BASE_URL;
wp_enqueue_style( 'tainacan-embeds', $TAINACAN_BASE_URL . '/assets/css/tainacan-embeds.css', [], TAINACAN_VERSION );
}
/**
* Get responsive class based on aspect ratio
* This code is heavily inspired by Gutenberg plugin's "getClassNames" function.
* Check their source code for more details: /packages/block-library/src/embed/util.js
*
* @param {string} html The preview HTML that possibly contains an iframe with width and height set.
* @param {string} existingClassNames Any existing class names.
* @return {string} Deduped class names.
*/
public function add_responsive_wrapper( $html, $existingClassNames = '' ) {
$height = false;
$width = false;
$dom = new \DOMDocument();
$dom->loadHTML($html);
// If we have a fixed aspect iframe, and it's a responsive embed content.
if ($dom) {
$externalContentElement = $dom->getElementsByTagName('iframe');
if (!$externalContentElement)
$externalContentElement = $dom->getElementsByTagName('embed');
if (!$externalContentElement)
$externalContentElement = $dom->getElementsByTagName('object');
if ($externalContentElement) {
foreach($externalContentElement as $element) {
foreach($element->attributes as $attribute) {
if ($attribute->nodeName == 'width')
$width = $attribute->nodeValue;
if ($attribute->nodeName == 'height')
$height = $attribute->nodeValue;
if ($attribute->nodeName == 'class' && $attribute->nodeValue == 'wp-embedded-content') {
$height = false;
$width = false;
break;
}
}
}
}
if ( $height && $width ) {
$aspect_ratio = number_format(( $width / $height ), 2, '.', "");
// Given the actual aspect ratio, find the widest ratio to support it.
for ($ratioIndex = 0; $ratioIndex < count(self::$aspect_ratios); $ratioIndex++) {
$potentialRatio = self::$aspect_ratios[ $ratioIndex ];
if ( $aspect_ratio >= $potentialRatio['ratio'] ) {
$class = $potentialRatio['className'] . ' tainacan-content-embed tainacan-has-aspect-ratio';
return '<figure class="' . $class . '"><div class="tainacan-content-embed__wrapper">' . $html . '</div></figure>';
}
}
}
}
return $html;
}
/**
* Adds a responsive embed wrapper around oEmbed content
* @param string $html The oEmbed markup
@ -126,12 +201,9 @@ class Embed {
*/
function responsive_embed($html, $url, $attr) {
$class = 'tainacan-embed-container';
$element = $this->add_responsive_wrapper($html);
if ( !preg_match('/(?:<iframe[^>]*)(?:(?:\/>)|(?:>.*?<\/iframe>))/i', $html ) && !preg_match('/(?:<object[^>]*)(?:(?:\/>)|(?:>.*?<\/object>))/i', $html) && !preg_match('/(?:<embed[^>]*)(?:(?:\/>)|(?:>.*?<\/embed>))/i', $html ) )
$class .= ' tainacan-embed-without-iframe';
return $html !== '' ? '<div class="' . $class . '">'.$html.'</div>' : '';
return $element;
}
}

View File

@ -99,7 +99,8 @@
hideCancel: true
},
ariaRole: 'alertdialog',
ariaModal: true
ariaModal: true,
customClass: 'tainacan-modal'
});
}
});

View File

@ -500,7 +500,7 @@ export default {
margin: 12px 0 6px 0;
}
.modal .animation-content {
.tainacan-modal .animation-content {
width: 100%;
z-index: 99999;

View File

@ -182,7 +182,8 @@
:active.sync="isNewMetadatumModalActive"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div
autofocus="true"
tabindex="-1"
@ -302,7 +303,8 @@
autofocus
role="dialog"
tabindex="-1"
aria-modal>
aria-modal
custom-class="tainacan-modal">
<form class="tainacan-modal-content tainacan-form">
<div class="tainacan-modal-title">
<h2>{{ $i18n.get('instruction_select_title_mapping') }}</h2>
@ -954,7 +956,7 @@ export default {
}
}
.modal .animation-content {
.tainacan-modal .animation-content {
width: 100%;
z-index: 99999;

View File

@ -330,7 +330,8 @@ export default {
collectionId: this.collectionId
},
width: 'calc(100% - (2 * var(--tainacan-one-column)))',
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteOneItem(itemId, index) {
@ -351,7 +352,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
}

View File

@ -217,7 +217,8 @@
scroll="keep"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div class="tainacan-modal-content">
<div class="tainacan-modal-title">
<h2>{{ $i18n.get('instruction_write_text') }}</h2>
@ -258,7 +259,8 @@
role="dialog"
tabindex="-1"
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div class="tainacan-modal-content">
<div class="tainacan-modal-title">
<h2>{{ $i18n.get('instruction_insert_url') }}</h2>
@ -314,7 +316,7 @@
class="image">
<span
class="image-placeholder"
v-if="item.document_type == 'empty'">
v-if="item.document_type == 'empty' && item.document_mimetype == 'empty'">
{{ $i18n.get('label_empty_thumbnail') }}
</span>
<img
@ -991,7 +993,8 @@ export default {
next();
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next()
@ -1232,6 +1235,7 @@ export default {
this.updateItemDocument({ item_id: this.itemId, document: this.form.document, document_type: this.form.document_type })
.then(item => {
this.item.document_as_html = item.document_as_html;
this.item.document_mimetype = item.document_mimetype;
this.isLoading = false;
})
.catch((errors) => {
@ -1263,6 +1267,7 @@ export default {
this.updateItemDocument({ item_id: this.itemId, document: this.form.document, document_type: this.form.document_type })
.then(item => {
this.item.document_as_html = item.document_as_html;
this.item.document_mimetype = item.document_mimetype;
this.isLoading = false;
let oldThumbnail = this.item.thumbnail;
@ -1298,6 +1303,7 @@ export default {
document_type: this.form.document_type
})
.then(() => {
this.item.document_mimetype = 'empty';
this.isLoadingAttachments = true;
this.fetchAttachments({
page: 1,
@ -1359,7 +1365,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
@ -1381,6 +1388,7 @@ export default {
.then((item) => {
this.isLoading = false;
this.item.document_as_html = item.document_as_html;
this.item.document_mimetype = item.document_mimetype;
let oldThumbnail = this.item.thumbnail;
if (item.document_type == 'attachment' && oldThumbnail != item.thumbnail )
@ -1480,7 +1488,8 @@ export default {
this.$router.push(this.$routerHelper.getCollectionPath(this.form.collectionId))
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
loadExistingItem() {

View File

@ -299,7 +299,8 @@
next();
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else if (this.isEditingTerm) {
this.$buefy.modal.open({
@ -313,7 +314,8 @@
next();
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next();

View File

@ -181,7 +181,8 @@
this.loadOptions();
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
}
@ -192,7 +193,7 @@
.view-all-button {
font-size: 0.75em;
font-size: 0.75em !important;
padding: 0.1em 1em;
}

View File

@ -95,16 +95,20 @@
&:not(:last-child) {
margin-bottom: 0;
padding-bottom: 0.75em;
padding-bottom: 0.25em;
}
.collapse-trigger {
margin-left: -7px;
button {
background-color: inherit !important;
color: inherit !important;
}
.icon {
margin-right: 5px;
}
.collapse-label {
display: inline-block;
display: inline;
width: 100%;
overflow-x: hidden;
text-overflow: ellipsis;

View File

@ -314,7 +314,8 @@
}
},
width: 'calc(100% - (4 * var(--tainacan-one-column)))',
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
prepareOptionsForTaxonomy(items) {
@ -351,7 +352,7 @@
<style lang="scss" scoped>
.view-all-button {
font-size: 0.75em;
font-size: 0.75em !important;
padding: 0.1em 1em;
}

View File

@ -183,7 +183,8 @@
approveActivity: (activityId) => this.approveActivity(activityId),
notApproveActivity: (activityId) => this.notApproveActivity(activityId)
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
}

View File

@ -104,7 +104,8 @@ export default {
message: this.$i18n.get('info_warning_terms_not_saved'),
onConfirm: () => { this.removeTerm(); },
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
this.removeTerm();
@ -125,7 +126,8 @@ export default {
this.$eventBusTermsList.onDeleteBasicTermItem(this.term);
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
eventOnEditTerm() {

View File

@ -143,7 +143,8 @@
capability: this.capabilities[capabilityKey],
capabilityKey: capabilityKey
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
getCompleteRolesList(roles, rolesInherited) {

View File

@ -392,7 +392,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
this.clearContextMenu();
},
@ -432,7 +433,8 @@ export default {
this.allCollectionsOnPageSelected = false;
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
openCollection() {

View File

@ -1240,7 +1240,8 @@ export default {
collectionId: this.$route.params.collectionId,
},
width: 'calc(100% - (2 * var(--tainacan-one-column)))',
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
sequenceEditSelectedItems() {
@ -1278,7 +1279,8 @@ export default {
}
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
this.clearContextMenu();
@ -1310,7 +1312,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteOneItem(itemId) {
@ -1333,7 +1336,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
this.clearContextMenu();
},
@ -1365,7 +1369,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteSelectedItems() {
@ -1406,7 +1411,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
openItem() {

View File

@ -142,7 +142,8 @@
:active.sync="isMapperMetadataCreating"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div
autofocus
role="dialog"

View File

@ -420,7 +420,8 @@
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteSelected() {
@ -459,7 +460,8 @@
this.allOnPageSelected = false;
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
getDate(rawDate) {
@ -484,7 +486,8 @@
this.updateProcess({ id: this.processes[index].ID, status: 'closed' });
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
onHeartBitTickList(event, data) {

View File

@ -235,7 +235,8 @@ export default {
message: this.$i18n.get('info_warning_terms_not_saved'),
onConfirm: () => { this.removeTerm(); },
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
this.removeTerm();
@ -277,7 +278,8 @@ export default {
}
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
eventOnChildTermDeleted(parentTermId) {

View File

@ -276,7 +276,8 @@
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
deleteSelected() {
@ -315,7 +316,8 @@
this.allOnPageSelected = false;
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
onClickTaxonomy($event, taxonomyId, index) {

View File

@ -88,7 +88,7 @@
v-if="isMultiple"
:disabled="itemMetadatum.item.id && (childItemMetadataGroups.length > 0 && !someValueOnLastInput)"
@click="addGroup"
class="is-block add-link">
class="is-inline-block add-link">
<span class="icon is-small">
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
</span>

View File

@ -289,7 +289,8 @@
next();
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next();
@ -382,7 +383,8 @@
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
toggleMetadatumEdition(metadatumId) {

View File

@ -63,7 +63,8 @@
</a>
<b-modal
:width="1200"
:active.sync="createNewItemModal">
:active.sync="createNewItemModal"
custom-class="tainacan-modal">
<iframe
:id="newItemFrame"
width="100%"

View File

@ -85,7 +85,7 @@
<template v-if="isMultiple">
<a
@click="addValue"
class="is-block add-link">
class="is-inline-block add-link">
<span class="icon is-small">
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
</span>

View File

@ -50,7 +50,8 @@
trap-focus
aria-role="dialog"
aria-modal
:can-cancel="['outside', 'escape']">
:can-cancel="['outside', 'escape']"
custom-class="tainacan-modal">
<term-edition-form
:taxonomy-id="taxonomyId"
:edit-form="{ id: 'new', name: newTermName ? newTermName : '' }"

View File

@ -275,7 +275,7 @@
<a
:disabled="dones.every((item) => item === true) === false"
@click="addEditionCriterion()"
class="has-text-right is-block add-link">
class="has-text-right is-inline-block add-link">
<span class="icon is-small">
<i class="tainacan-icon has-text-secondary tainacan-icon-add"/>
</span>

View File

@ -116,7 +116,8 @@ export default {
sourceCollection: this.collection.id,
hideWhenManualCollection: true
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
}
}

View File

@ -4,7 +4,7 @@
aria-modal
autofocus
role="alertdialog"
class="tainacan-form dialog"
class="tainacan-form tainacan-dialog dialog"
ref="customDialog">
<div
class="modal-card"

View File

@ -14,7 +14,8 @@
scroll="keep"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<!-- <div class="tainacan-modal-content">
<div class="tainacan-modal-title">
<h2>{{ $i18n.get('label_document') }}</h2>

View File

@ -35,7 +35,8 @@
scroll="keep"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div
autofocus
role="dialog"

View File

@ -187,7 +187,8 @@
collectionId: this.collectionId
},
width: 'calc(100% - (2 * var(--tainacan-one-column)))',
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
this.$parent.close();
@ -216,6 +217,5 @@
margin-top: 12px;
}
</style>

View File

@ -497,7 +497,7 @@
.collapse-all {
display: inline-flex;
align-items: center;
margin-left: -0.65em;
margin-left: -0.5em !important;
}
.collapse-all__text {
font-size: 0.75em !important;

View File

@ -50,7 +50,8 @@ const tainacanErrorHandler = function(error){
hideCancel: true
},
ariaRole: 'alertdialog',
ariaModal: true
ariaModal: true,
customClass: 'tainacan-modal'
});
}
});

View File

@ -477,7 +477,8 @@ export default {
parent: this,
component: AvailableImportersModal,
hasModalCard: true,
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
searchCollections() {

View File

@ -298,7 +298,8 @@
:active.sync="isSelectingFilterType"
trap-focus
aria-modal
aria-role="dialog">
aria-role="dialog"
custom-class="tainacan-modal">
<div
autofocus
role="dialog"
@ -455,7 +456,8 @@ export default {
next();
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next()

View File

@ -441,7 +441,7 @@
trap-focus
aria-modal
aria-role="dialog"
custom-class="tainacan-form filters-menu">
custom-class="tainacan-modal tainacan-form filters-menu">
<filters-items-list
:is-loading-items="isLoadingItems"
autofocus="true"
@ -889,7 +889,8 @@
targetCollection: this.collectionId,
hideWhenManualCollection: true
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
openExposersModal(selectedItems) {
@ -902,7 +903,8 @@
totalItems: this.totalItems,
selectedItems: selectedItems
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
})
},
onOpenCollectionsModal() {
@ -910,7 +912,8 @@
parent: this,
component: CollectionsModal,
hasModalCard: true,
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
updateSearch() {
@ -1222,7 +1225,8 @@
showNeverShowAgainOption: offerCheckbox && tainacan_plugin.user_caps != undefined && Object.keys(tainacan_plugin.user_caps).length != undefined && Object.keys(tainacan_plugin.user_caps).length > 0,
messageKeyForUserPrefs: 'ItemsHiddenDueSorting'
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
hideFiltersOnMobile: _.debounce( function() {

View File

@ -451,7 +451,8 @@ export default {
next();
},
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
} else {
next();
@ -597,7 +598,8 @@ export default {
});
}
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
toggleMetadatumEdition(metadatumId) {

View File

@ -433,7 +433,8 @@
itemURL: this.item.url,
totalItems: 1,
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
}
}

View File

@ -6,11 +6,11 @@ button.link-style:active {
cursor: pointer;
font-size: inherit;
text-transform: inherit;
color: var(--tainacan-secondary);
color: var(--tainacan-secondary) !important;
padding: 0;
margin: 0;
font-weight: normal;
background: transparent;
background: transparent !important;
&:hover {
text-decoration: underline;

View File

@ -6,6 +6,7 @@
}
.modal-content {
background-color: var(--tainacan-background-color);
padding: 24px 18px var(--tainacan-one-column);
padding: 24px 18px 24px 4.1666667vw;
margin: 0;
@ -20,6 +21,7 @@
h3 {
font-size: 1em;
color: var(--tainacan-heading-color);
margin-bottom: 1em;
}
}
@ -40,6 +42,7 @@
margin: 0 12% 0 0;
margin: 0 12vw 0 0;
padding: var(--tainacan-container-padding);
max-width: calc(100% - 12vw) !important;
}
}
}

View File

@ -1,5 +1,5 @@
// Tainacan modals
.modal .animation-content {
.tainacan-modal .animation-content {
background: none;
width: calc(100% - (2 * var(--tainacan-one-column)));
width: 91.6666667vw;
@ -13,11 +13,8 @@
max-height: 95vh;
}
}
.modal.is-full-screen > .animation-content,
.modal.is-full-screen > .animation-content > .modal-card {
background-color: transparent;
}
.modal .modal-close {
.tainacan-modal .modal-close {
z-index: 99999;
@media only screen and (max-width: 768px) {
&:before, &:after { background-color: #298596; }
@ -98,8 +95,9 @@
display: block;
}
}
// Bulma modals customized for Tainacan (custom-dialog.vue)
.dialog {
.tainacan-dialog {
.modal-background {
background-color: rgba(0, 0, 0, 0.70);

View File

@ -1,5 +1,5 @@
.notices {
z-index: 99999999;
z-index: 99999999;
.toast, .snackbar {
min-width: auto !important;
@ -12,24 +12,28 @@
&.is-dark .button:hover {
background-color: var(--tainacan-gray2) !important;
color: var(--tainacan-info-color) !important;
font-size: 0.875em;
}
&.is-warning,
&.is-warning .button,
&.is-warning .button:hover {
background-color: var(--tainacan-yellow1) !important;
color: var(--tainacan-warning) !important;
font-size: 0.875em;
}
&.is-danger,
&.is-danger .button,
&.is-danger .button:hover {
background-color: var(--tainacan-red1) !important;
color: var(--tainacan-danger) !important;
font-size: 0.875em;
}
&.is-success,
&.is-success .button,
&.is-success .button:hover {
background-color: var(--tainacan-green1) !important;
color: var(--tainacan-success) !important;
font-size: 0.875em;
}
}
}

View File

@ -12,8 +12,8 @@ function tainacan_blocks_initialize() {
add_action('init', 'tainacan_blocks_add_plugin_settings', 90);
add_action('init', 'tainacan_blocks_add_plugin_admin_settings', 90);
add_action('init', 'register_tainacan_blocks_add_gutenberg_blocks');
add_action('wp_enqueue_scripts', 'unregister_taiancan_blocks');
add_action('admin_enqueue_scripts', 'unregister_taiancan_blocks');
add_action('wp_enqueue_scripts', 'unregister_tainacan_blocks');
add_action('admin_enqueue_scripts', 'unregister_tainacan_blocks');
}
}
@ -33,11 +33,11 @@ function register_tainacan_blocks_add_gutenberg_blocks() {
tainacan_blocks_register_tainacan_carousel_collections_list();
}
function unregister_taiancan_blocks() {
function unregister_tainacan_blocks() {
global $post;
if(!$post) return;
$not_allowed = apply_filters('posts-names-to-unregister-taiancan-blocks', []);
$not_allowed = apply_filters('posts-names-to-unregister-tainacan-blocks', []);
$current_page = $post->post_name;
if ( in_array($current_page, $not_allowed) ) {

View File

@ -52,26 +52,34 @@ export default {
@import "../../../node_modules/buefy/src/scss/components/_notices.scss";
@import "../../../node_modules/buefy/src/scss/components/_numberinput.scss";
// Tainacan imports
@import "../admin/scss/_tainacan-form.scss";
@import "../admin/scss/_modals.scss";
@import "../admin/scss/_buttons.scss";
@import "../admin/scss/_inputs.scss";
@import "../admin/scss/_checkboxes.scss";
@import "../admin/scss/_radios.scss";
@import "../admin/scss/_switches.scss";
@import "../admin/scss/_pagination.scss";
@import "../admin/scss/_tags.scss";
@import "../admin/scss/_notices.scss";
@import "../admin/scss/_tabs.scss";
@import "../admin/scss/_selects.scss";
@import "../admin/scss/_dropdown-and-autocomplete.scss";
@import "../admin/scss/_tooltips.scss";
@import "../admin/scss/_control.scss";
@import "../admin/scss/_upload.scss";
// Block level custom variables
@import "../admin/scss/_custom_variables.scss";
.tainacan-item-submission-form {
// These have to be outside of the scoped context
@import "../admin/scss/_tooltips.scss";
@import "../admin/scss/_notices.scss";
@import "../admin/scss/_modals.scss";
// Scoped, to avoid conflicts with theme's css
.tainacan-modal,
.tainacan-item-submission-form {
// Tainacan imports
@import "../admin/scss/_tainacan-form.scss";
@import "../admin/scss/_modals.scss";
@import "../admin/scss/_buttons.scss";
@import "../admin/scss/_inputs.scss";
@import "../admin/scss/_checkboxes.scss";
@import "../admin/scss/_radios.scss";
@import "../admin/scss/_switches.scss";
@import "../admin/scss/_pagination.scss";
@import "../admin/scss/_tags.scss";
@import "../admin/scss/_tabs.scss";
@import "../admin/scss/_selects.scss";
@import "../admin/scss/_dropdown-and-autocomplete.scss";
@import "../admin/scss/_control.scss";
@import "../admin/scss/_upload.scss";
.tainacan-icon {
opacity: 0; // Will make it 1 once window.load is done;
}

View File

@ -112,26 +112,54 @@ $pswp__include-minimal-style: true !default;
.swiper-slide-content {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
display: block;
text-align: center;
.tainacan-embed-container {
.tainacan-content-embed {
width: 100%;
height: auto;
&.tainacan-has-aspect-ratio {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 2) / 1); /* Default to 2:1 aspect ratio. */
margin-left: auto;
margin-right: auto;
}
&.tainacan-embed-aspect-21-9 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 21) / 9);
}
&.tainacan-embed-aspect-18-9 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 18) / 9);
}
&.tainacan-embed-aspect-16-9 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 16) / 9);
}
&.tainacan-embed-aspect-4-3 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 4) / 3);
}
&.tainacan-embed-aspect-1-1 {
max-width: var(--tainacan-media-main-carousel-height, 60vh);
}
&.tainacan-embed-aspect-3-4 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 3) / 4);
}
&.tainacan-embed-aspect-9-16 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 9) / 16);
}
&.tainacan-embed-aspect-1-2 {
max-width: calc((var(--tainacan-media-main-carousel-height, 60vh) * 1) / 2);
}
}
iframe {
max-height: var(--tainacan-media-main-carousel-height, 60vh);
width: 100%;
max-width: 100%;
margin-left: auto;
margin-right: auto;
border: none;
display: block;
background-image: url('../images/preloader.gif');
background-repeat: no-repeat;
background-position: center;
}
a:first-of-type,
p:first-of-type {
z-index: 99;
@ -157,6 +185,10 @@ $pswp__include-minimal-style: true !default;
width: auto;
max-height: var(--tainacan-media-main-carousel-height, 60vh);
}
.twitter-tweet {
margin-left: auto;
margin-right: auto;
}
}
}
.tainacan-media-component__swiper-thumbs {
@ -304,34 +336,68 @@ $pswp__include-minimal-style: true !default;
.attachment-without-image {
width: 100%;
height: 100%;
height: calc(100% - 44px);
display: flex;
align-items: center;
justify-content: center;
align-items: center;
text-align: center;
padding: 44px;
margin-top: 22px;
&.tainacan-embed-container:not(.tainacan-embed-without-iframe) {
padding: 0px;
}
.tainacan-embed-container .twitter-tweet {
width: 100vw !important;
&>iframe:not(.wp-embedded-content) {
width: 90vw;
height: 90vh;
border: none;
margin: 44px;
display: block;
background-image: url('../images/preloader.gif');
background-repeat: no-repeat;
background-position: center;
}
}
iframe {
padding: 44px;
min-height: 90vh;
max-height: 90vh;
height: 100%;
width: 100%;
max-width: 100%;
margin: 0 auto;
// PDFs file that come from document instead of attachments
.pswp__zoom-wrap>iframe#iframePDF {
width: 90vw;
height: 90vh;
border: none;
margin: 44px auto;
display: block;
background-image: url('../images/preloader.gif');
background-repeat: no-repeat;
background-position: center;
}
.tainacan-content-embed {
width: 100%;
height: auto;
&.tainacan-has-aspect-ratio {
max-width: calc((90vh * 2) / 1); /* Default to 2:1 aspect ratio. */
margin-left: auto;
margin-right: auto;
}
&.tainacan-embed-aspect-21-9 {
max-width: calc((90vh * 21) / 9);
}
&.tainacan-embed-aspect-18-9 {
max-width: calc((90vh * 18) / 9);
}
&.tainacan-embed-aspect-16-9 {
max-width: calc((90vh * 16) / 9);
}
&.tainacan-embed-aspect-4-3 {
max-width: calc((90vh * 4) / 3);
}
&.tainacan-embed-aspect-1-1 {
max-width: 90vh;
}
&.tainacan-embed-aspect-9-16 {
max-width: calc((90vh * 9) / 16);
}
&.tainacan-embed-aspect-1-2 {
max-width: calc((90vh * 1) / 2);
}
}
a:first-of-type,
p:first-of-type ,
article:first-of-type {

View File

@ -143,7 +143,7 @@ export default {
return this.taxonomiesList && this.taxonomiesList != undefined ? Object.values(this.taxonomiesList) : [];
},
taxonomyTermsLatestCachedOn() {
return this.reportsLatestCachedOn['taxonomy-terms-' + this.selectedTaxonomy.id];
return this.reportsLatestCachedOn['taxonomy-terms-default-' + this.selectedTaxonomy.id];
},
currentTotalTerms() {
return Array.isArray(this.chartData) ? this.chartData.length : 0

View File

@ -29,7 +29,7 @@
</template>
<style lang="scss">
.modal.slides-help-modal {
.tainacan-modal.slides-help-modal {
z-index: 9999999999;
.slides-help-modal-content {

View File

@ -625,7 +625,7 @@ export default {
width: 680,
ariaRole: 'alertdialog',
ariaModal: true,
customClass: 'slides-help-modal',
customClass: 'tainacan-modal slides-help-modal',
onCancel: () => {
setTimeout(() => document.documentElement.classList.add('is-clipped'), 500);
}

View File

@ -410,7 +410,7 @@
:auto-focus="filtersAsModal"
:trap-focus="filtersAsModal"
full-screen
:custom-class="'tainacan-form filters-menu' + (filtersAsModal ? ' filters-menu-modal' : '')"
:custom-class="'tainacan-modal tainacan-form filters-menu' + (filtersAsModal ? ' filters-menu-modal' : '')"
:can-cancel="hideHideFiltersButton || !filtersAsModal ? ['x', 'outside'] : ['x', 'escape', 'outside']">
<filters-items-list
:is-loading-items="isLoadingItems"
@ -879,7 +879,8 @@
collectionId: this.collectionId,
totalItems: this.totalItems
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
updateSearch() {
@ -1171,7 +1172,8 @@
showNeverShowAgainOption: offerCheckbox && tainacan_plugin.user_caps != undefined && Object.keys(tainacan_plugin.user_caps).length != undefined && Object.keys(tainacan_plugin.user_caps).length > 0,
messageKeyForUserPrefs: 'ItemsHiddenDueSorting'
},
trapFocus: true
trapFocus: true,
customClass: 'tainacan-modal'
});
},
hideFiltersOnMobile: _.debounce( function() {
@ -1232,12 +1234,12 @@
width: 100vw;
height: 100vh;
z-index: 999999999;
background-color: var(--tainacan-black);
background-color: var(--tainacan-black) !important;
transition: background-color 0.3s ease, width 0.3s ease, height 0.3s ease;
animation: open-full-screen 0.4s ease;
.filters-menu {
display: none;
display: none !important;
}
.metadata-alert {
position: absolute;
@ -1606,6 +1608,7 @@
padding-left: var(--tainacan-one-column);
padding-right: var(--tainacan-one-column);
min-height: 50vh;
margin-top: 12px;
//height: calc(100% - 82px);
}

View File

@ -97,6 +97,7 @@
@media screen and (max-width: 768px) {
padding: 0;
z-index: 99999;
max-width: 100%;
.modal-content {
top: 0;

View File

@ -37,7 +37,7 @@ export default {
}
</script>
<style lang="scss">
<style lang="scss" >
// TAINACAN Variables
@import "../admin/scss/_variables.scss";
@ -58,30 +58,40 @@ export default {
@import "../../../node_modules/buefy/src/scss/components/_notices.scss";
@import "../../../node_modules/buefy/src/scss/components/_numberinput.scss";
// Vue Blurhash transtition effect
@import '../../../node_modules/vue-blurhash/dist/vue-blurhash.css';
// Tainacan imports
@import "../admin/scss/_tables.scss";
@import "../admin/scss/_modals.scss";
@import "../admin/scss/_buttons.scss";
@import "../admin/scss/_inputs.scss";
@import "../admin/scss/_checkboxes.scss";
@import "../admin/scss/_pagination.scss";
@import "../admin/scss/_tags.scss";
@import "../admin/scss/_notices.scss";
@import "../admin/scss/_tabs.scss";
@import "../admin/scss/_selects.scss";
@import "../admin/scss/_dropdown-and-autocomplete.scss";
@import "../admin/scss/_tooltips.scss";
@import "../admin/scss/_control.scss";
@import "../admin/scss/_tainacan-form.scss";
@import "../admin/scss/_filters-menu-modal.scss";
@import "./scss/_layout.scss";
// Block level custom variables
@import "../admin/scss/_custom_variables.scss";
// These have to be outside of the scoped context
@import "./scss/_layout.scss";
@import "../admin/scss/_tooltips.scss";
@import "../admin/scss/_notices.scss";
@import "../admin/scss/_modals.scss";
// Scoped, to avoid conflicts with theme's css
.tainacan-modal,
.theme-items-list {
background: var(--tainacan-background-color, inherit);
// Vue Blurhash transtition effect
@import '../../../node_modules/vue-blurhash/dist/vue-blurhash.css';
// Tainacan imports
@import "../admin/scss/_tables.scss";
@import "../admin/scss/_modals.scss";
@import "../admin/scss/_buttons.scss";
@import "../admin/scss/_inputs.scss";
@import "../admin/scss/_checkboxes.scss";
@import "../admin/scss/_pagination.scss";
@import "../admin/scss/_tags.scss";
@import "../admin/scss/_tabs.scss";
@import "../admin/scss/_selects.scss";
@import "../admin/scss/_dropdown-and-autocomplete.scss";
@import "../admin/scss/_control.scss";
@import "../admin/scss/_tainacan-form.scss";
@import "../admin/scss/_filters-menu-modal.scss";
&:not(.tainacan-modal) {
background: var(--tainacan-background-color, inherit);
}
font-size: var(--tainacan-base-font-size, inherit);
font-family: var(--tainacan-font-family, inherit);
position: relative;