Skip to content

Commit

Permalink
Merge branch 'release-0.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
jhotadhari committed Sep 12, 2020
2 parents aecfc0e + a42d249 commit 79245bc
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 21 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 0.0.2 - 2020-09-12
Fix setAttributes

### Fixed
- setAttributes

## 0.0.1 - 2020-09-12
Basic
2 changes: 1 addition & 1 deletion Croox__synchronize-image-block-featured_wp-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Croox Synchronize image block with featured image
Plugin URI: https://github.com/croox/Croox__synchronize-image-block-featured_wp-plugin
Description: Add option to synchronize the core/image block with the post featured image.
Version: 0.0.1
Version: 0.0.2
Author: croox
Author URI: https://github.com/croox
License: GNU General Public License v2 or later
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Croox Synchronize image block with featured image
Plugin URI: https://github.com/croox/Croox__synchronize-image-block-featured_wp-plugin
Description: Add option to synchronize the core/image block with the post featured image.
Version: 0.0.1
Version: 0.0.2
Author: croox
Author URI: https://github.com/croox
License: GNU General Public License v2 or later
Expand Down Expand Up @@ -31,7 +31,7 @@
function imfea_init() {

$init_args = array(
'version' => '0.0.1',
'version' => '0.0.2',
'slug' => 'Croox__synchronize-image-block-featured_wp-plugin',
'name' => 'Croox Synchronize image block with featured image',
'prefix' => 'imfea',
Expand Down
6 changes: 6 additions & 0 deletions dist/trunk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ Upload and install this Theme the same way you'd install any other Theme.

## Changelog ##

## 0.0.2 - 2020-09-12
Fix setAttributes

### Fixed
- setAttributes

## 0.0.1 - 2020-09-12
Basic
2 changes: 1 addition & 1 deletion dist/trunk/js/imfea_editor.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/trunk/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ Upload and install this Theme the same way you'd install any other Theme.

== Changelog ==

## 0.0.2 - 2020-09-12
Fix setAttributes

### Fixed
- setAttributes

## 0.0.1 - 2020-09-12
Basic
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"uri": "https://github.com/croox/Croox__synchronize-image-block-featured_wp-plugin",
"textDomain": "imfea",
"domainPath": "/languages",
"version": "0.0.1",
"version": "0.0.2",
"description": "Add option to synchronize the core/image block with the post featured image.",
"main": "index.js",
"author": "croox",
Expand Down
16 changes: 7 additions & 9 deletions src/js/imfea_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,23 +144,21 @@ const ImageSyncBlockEdit = ( {
// Just set attributes if disabled sync
const shouldSync = newAttributes.imfeaShouldSync ? newAttributes.imfeaShouldSync : imfeaShouldSync;
if ( ! shouldSync )
return setAttributes( newAttributes ) ;

// Just set attributes if block image did not change
const isImageChange = id !== newAttributes.id;
if ( ! isImageChange )
return setAttributes( newAttributes ) ;
return setAttributes( newAttributes ) ;

// Interrupt if image is url and not local media
if ( undefined == newAttributes.id ) {
if ( undefined == newAttributes.id && newAttributes.url ) {
return createErrorNotice(
__( 'Image block is synchronized with featured image. Impossible to use an external URL as image source.', 'imfea' ),
__( 'This image block is synchronized with featured image. Impossible to use an external URL as image source.', 'imfea' ),
{
id: 'image-sync-can-not-set-url',
type: 'snackbar',
}
);
}
}

if ( id === newAttributes.id || ! newAttributes.id )
return setAttributes( newAttributes ) ;

// Set attributes
// and disable that the block receives featured image for a moment.
Expand Down
14 changes: 7 additions & 7 deletions src/languages/imfea-LOCALE-handle.pot
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"X-Generator: babel-plugin-makepot\n"

#: src/js/imfea_editor.js:157
#: src/js/imfea_editor.js:152
msgid ""
"Image block is synchronized with featured image. Impossible to use an "
"This image block is synchronized with featured image. Impossible to use an "
"external URL as image source."
msgstr ""

#: src/js/imfea_editor.js:186
#: src/js/imfea_editor.js:184
msgid "Synchronize with Featured image"
msgstr ""

#: src/js/imfea_editor.js:189
#: src/js/imfea_editor.js:187
msgid ""
"This Image Block is synchronized with the featured image. They update each "
"other."
msgstr ""

#: src/js/imfea_editor.js:191
#: src/js/imfea_editor.js:189
msgid ""
"This Image Block is not synchronized with the featured image. But by chance "
"they are the same."
msgstr ""

#: src/js/imfea_editor.js:193
#: src/js/imfea_editor.js:191
msgid ""
"This Image Block is not synchronized with the featured image. On "
"synchronize, this block will receive the featured image."
msgstr ""

#: src/js/imfea_editor.js:194
#: src/js/imfea_editor.js:192
msgid ""
"This Image Block is not synchronized with the featured image. No featured "
"image is set. On synchronize, the featured image will receive this block "
Expand Down

0 comments on commit 79245bc

Please sign in to comment.