Open gutenberg links in the same tab.

This commit is contained in:
mateuswetah 2021-09-22 11:05:42 -03:00
parent 91346de697
commit 2982520e17
13 changed files with 16 additions and 34 deletions

View File

@ -70,8 +70,7 @@ export default function ({ attributes, setAttributes, className, isSelected, cli
}
<a
id={ isNaN(collection.id) ? collection.id : 'collection-id-' + collection.id }
href={ collection.url }
target="_blank">
href={ collection.url }>
{ !showCollectionThumbnail ?
<div class="collection-items-grid">
<img

View File

@ -19,8 +19,7 @@
<a
v-if="showCollectionThumbnail"
:id="isNaN(collection.id) ? collection.id : 'collection-id-' + collection.id"
:href="collection.url"
target="_blank">
:href="collection.url">
<img
:src="
collection.thumbnail && collection.thumbnail[maxCollectionsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'full'][0] && collection.thumbnail[maxCollectionsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'full'][0]
@ -54,8 +53,7 @@
<a
v-else
:id="isNaN(collection.id) ? collection.id : 'collection-id-' + collection.id"
:href="collection.url"
target="_blank">
:href="collection.url">
<div class="collection-items-grid">
<blur-hash-image
:height="collectionItems[collection.id][0] ? $thumbHelper.getHeight(collectionItems[collection.id][0]['thumbnail'], 'tainacan-medium') : 275"

View File

@ -81,8 +81,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
}
<a
id={ isNaN(item.id) ? item.id : 'item-id-' + item.id }
href={ item.url }
target="_blank">
href={ item.url }>
<div class="items-list-item--image-wrap">
<img
src={ thumbHelper.getSrc(item['thumbnail'], (maxItemsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'large'), item['document_mimetype']) }
@ -569,7 +568,6 @@ export default function({ attributes, setAttributes, className, isSelected, clie
:
<a
href={ collection.url ? collection.url : '' }
target="_blank"
class="carousel-items-collection-header">
<div
style={{

View File

@ -9,7 +9,6 @@
:style="{ height: '165px' }"/>
<a
v-else
target="_blank"
:href="collection.url ? collection.url : ''"
class="carousel-items-collection-header">
<div
@ -69,8 +68,7 @@
:class="{ 'is-forced-square': cropImagesToSquare }">
<a
:id="isNaN(item.id) ? item.id : 'item-id-' + item.id"
:href="item.url"
target="_blank">
:href="item.url">
<blur-hash-image
:height="$thumbHelper.getHeight(item['thumbnail'], (maxItemsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'large'))"
:width="$thumbHelper.getWidth(item['thumbnail'], (maxItemsPerScreen > 4 ? (!cropImagesToSquare ? 'tainacan-medium-full' : 'tainacan-medium') : 'large'))"

View File

@ -66,8 +66,7 @@ export default function({ attributes, setAttributes, className, isSelected, clie
}
<a
id={ isNaN(term.id) ? term.id : 'term-id-' + term.id }
href={ term.url }
target="_blank">
href={ term.url }>
{ !showTermThumbnail ?
<div class="term-items-grid">
<img

View File

@ -19,8 +19,7 @@
<a
v-if="showTermThumbnail"
:id="isNaN(term.id) ? term.id : 'term-id-' + term.id"
:href="term.url"
target="_blank">
:href="term.url">
<img
:src="term.header_image ? term.header_image : `${tainacanBaseUrl}/assets/images/placeholder_square.png`"
:alt="term.name ? term.name : $root.__('Thumbnail', 'tainacan')" >
@ -29,8 +28,7 @@
<a
v-else
:id="isNaN(term.id) ? term.id : 'term-id-' + term.id"
:href="term.url"
target="_blank">
:href="term.url">
<div class="term-items-grid">
<blur-hash-image
:height="termItems[term.id][2] ? $thumbHelper.getHeight(termItems[term.id][0]['thumbnail'], 'tainacan-medium') : 275"

View File

@ -43,8 +43,7 @@ export default function({ attributes, setAttributes, className, isSelected }) {
}
<a
id={ isNaN(collection.id) ? collection.id : 'collection-id-' + collection.id }
href={ collection.url }
target="_blank"
href={ collection.url }
className={ (!showName ? 'collection-without-name' : '') + ' ' + (!showImage ? 'collection-without-image' : '') }>
<img
src={ collection.thumbnail && collection.thumbnail[0] && collection.thumbnail[0].src ? collection.thumbnail[0].src : `${tainacan_blocks.base_url}/assets/images/placeholder_square.png`}

View File

@ -95,13 +95,14 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id={ isNaN(item.id) ? item.id : 'item-id-' + item.id }
href={ item.url }
onClick={ (event) => event.preventDefault() }
target="_blank"
className={ (!showName ? 'item-without-title' : '') + ' ' + (!showImage ? 'item-without-image' : '') }>
<img
src={ thumbHelper.getSrc(item['thumbnail'], ( (layout == 'list' || cropImagesToSquare) ? 'tainacan-medium' : 'tainacan-medium-full'), item['document_mimetype']) }
srcSet={ thumbHelper.getSrcSet(item['thumbnail'], ( (layout == 'list' || cropImagesToSquare) ? 'tainacan-medium' : 'tainacan-medium-full'), item['document_mimetype']) }
alt={ item.thumbnail_alt ? item.thumbnail_alt : (item && item.title ? item.title : __( 'Thumbnail', 'tainacan' )) }/>
<span>{ item.title ? item.title : '' }</span>
{ item.title ?
<span>{ item.title }</span>
: null }
</a>
</li>
);
@ -848,7 +849,6 @@ export default function({ attributes, setAttributes, className, isSelected, clie
:
<a
href={ collection.url ? collection.url : '' }
target="_blank"
class="dynamic-items-collection-header">
<div
style={{

View File

@ -9,7 +9,6 @@
:style="{ height: '165px' }"/>
<a
v-else
target="_blank"
:href="collection.url ? collection.url : ''"
class="dynamic-items-collection-header">
<div
@ -204,7 +203,6 @@
<a
:id="isNaN(item.id) ? item.id : 'item-id-' + item.id"
:href="item.url"
target="_blank"
:class="(!showName ? 'item-without-title' : '') + ' ' + (!showImage ? 'item-without-image' : '')">
<blur-hash-image
v-if="showImage"
@ -215,7 +213,7 @@
:hash="$thumbHelper.getBlurhashString(item['thumbnail'], ( layout == 'list' || cropImagesToSquare ? 'tainacan-medium' : 'tainacan-medium-full' ))"
:alt="item.thumbnail_alt ? item.thumbnail_alt : (item && item.name ? item.name : $root.__( 'Thumbnail', 'tainacan' ))"
:transition-duration="500" />
<span>{{ item.title ? item.title : '' }}</span>
<span v-if="item.title">{{ item.title }}</span>
</a>
</li>
</ul>
@ -252,7 +250,6 @@
<a
:id="isNaN(item.id) ? item.id : 'item-id-' + item.id"
:href="item.url"
target="_blank"
:class="(!showName ? 'item-without-title' : '') + ' ' + (!showImage ? 'item-without-image' : '')">
<blur-hash-image
:height="$thumbHelper.getHeight(item['thumbnail'], ( layout == 'list' || cropImagesToSquare ? 'tainacan-medium' : 'tainacan-medium-full' ))"
@ -262,7 +259,7 @@
:hash="$thumbHelper.getBlurhashString(item['thumbnail'], ( layout == 'list' || cropImagesToSquare ? 'tainacan-medium' : 'tainacan-medium-full' ))"
:alt="item.thumbnail_alt ? item.thumbnail_alt : (item && item.name ? item.name : $root.__( 'Thumbnail', 'tainacan' ))"
:transition-duration="500" />
<span>{{ item.title ? item.title : '' }}</span>
<span v-if="item.title">{{ item.title }}</span>
</a>
</li>
</div>

View File

@ -99,7 +99,6 @@ export default function({ attributes, setAttributes, className, isSelected, clie
id={ isNaN(facetId) ? facetId : 'facet-id-' + facetId }
href={ !appendChildTerms ? ((linkTermFacetsToTermPage && isMetadatumTypeTaxonomy(metadatumType)) ? facet.term_url : facet.url) : (facet.total_children > 0 ? null : (linkTermFacetsToTermPage ? facet.term_url : facet.url)) }
onClick={ () => { (appendChildTerms && facet.total_children > 0) ? displayChildTerms(facetId) : null } }
target="_blank"
style={{ fontSize: layout == 'cloud' && facet.total_items ? + (1 + (cloudRate/4) * Math.log(facet.total_items)) + 'em' : ''}}>
{ isMetadatumTypeTaxonomy(metadatumType) ?
<img

View File

@ -6,7 +6,6 @@
:id="isNaN(facetId) ? facetId : 'facet-id-' + facetId"
:href="(appendChildTerms && facet.total_children > 0) ? null : ((linkTermFacetsToTermPage && isMetadatumTypeTaxonomy) ? facet.term_url : facet.url)"
@click="() => { (appendChildTerms && facet.total_children > 0) ? displayChildTerms(facetId) : null }"
target="_blank"
:style="{ fontSize: layout == 'cloud' && facet.total_items ? + (1 + (cloudRate/4) * Math.log(facet.total_items)) + 'em' : ''}">
<img
v-if="isMetadatumTypeTaxonomy"

View File

@ -43,8 +43,7 @@ export default function({ attributes, setAttributes, className, isSelected }) {
}
<a
id={ isNaN(item.id) ? item.id : 'item-id-' + item.id }
href={ item.url }
target="_blank"
href={ item.url }
className={ (!showName ? 'item-without-title' : '') + ' ' + (!showImage ? 'item-without-image' : '') }>
<img
src={ item.thumbnail && item.thumbnail[0] && item.thumbnail[0].src ? item.thumbnail[0].src : `${tainacan_blocks.base_url}/assets/images/placeholder_square.png`}

View File

@ -41,8 +41,7 @@ export default function({ attributes, setAttributes, className, isSelected }){
}
<a
id={ isNaN(term.id) ? term.id : 'term-id-' + term.id }
href={ term.url }
target="_blank"
href={ term.url }
className={ (!showName ? 'term-without-name' : '') + ' ' + (!showImage ? 'term-without-image' : '') }>
<img
src={ term.header_image && term.header_image[0] && term.header_image[0].src ? term.header_image[0].src : `${tainacan_blocks.base_url}/assets/images/placeholder_square.png`}