Skip to content

Commit

Permalink
Merge branch 'release/3.0.1'
Browse files Browse the repository at this point in the history
* release/3.0.1:
  Version 3.0.1
  Bump Craft CMS dep to 3.0.16
  Added missing changelog items
  Updated the README proper roadmap and support details
  Fixed an issue where the window onload event wasn’t getting fired in Safari
  Added a note about supertable to the roadmap
  Fixed a typo in the README
  • Loading branch information
joshangell committed Jul 18, 2018
2 parents f016b19 + 8bce5fc commit 2a43bae
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 25 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ 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/).


## Unreleased
## 3.0.1 - 2018-07-18

### Changed
- Updated the roadmap
- Updated the README with the relevant [GitHub project](https://github.com/angell-co/Spoon/projects/2) and a note about support
- Changed the required version of Craft to 3.0.16 which fixes an issue with Safari when configuring block type layouts ([#8](https://github.com/angell-co/Spoon/issues/8))

### Fixed
- Fixed a typo in the README
- Fixed an issue where the initial page load in Safari was showing blank blocks ([#10](https://github.com/angell-co/Spoon/issues/10))


## 3.0.0 - 2018-07-10
Expand Down
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ Use just one Matrix field and hide and show blocks or fields based on the Entry
![group block types button](resources/img/docs/group-block-types.jpg)


### Roadmap

If you wish to keep up with the progress of this project you can do so in the [GitHub project](https://github.com/angell-co/Spoon/projects/2).


### Support

All support requests should be submitted via [GitHub issues](https://github.com/angell-co/Spoon/issues), if you need more in-depth help then please do reach out to me on the [Craft Slack](https://craftcms.com/community#slack) (@joshangell) or email me - [[email protected]](mailto:[email protected]).


## Usage

The way Spoon works is by allowing you to create your block type groups and field layouts in multiple contexts.
Expand All @@ -67,7 +77,8 @@ You can override your defaults for a specific context by going to the field layo

![group block types button](resources/img/docs/group-block-types.jpg)

## Setting up defaults

### Setting up defaults

To create default block type groups and field layouts for all your Matrix fields go to Settings → Spoon. Here you will find a list of your current Matrix fields.

Expand All @@ -88,7 +99,7 @@ Once you have some groups you can go one step further and customize the field la
Thats it! You should now be able to browse to somewhere that uses that field and see your new groups and field layouts in action.


## Config settings
### Config settings

Spoon supports the standard config.php multi-environment friendly config file for the plugin settings. Just copy the config.php to your Craft config/ directory as spoon.php and you can configure the settings in a multi-environment friendly way.

Expand All @@ -97,20 +108,6 @@ Spoon supports the standard config.php multi-environment friendly config file fo
![nested settings menu](resources/img/docs/nested-setting-menu-example.png)


## Roadmap

* [x] Support the other contexts PMM did
* [x] Also support plugin hooks - removed support
* [x] Deal with Sites / Locales etc
* [x] Write the C2 > C3 migration
* [x] Documentation
* [x] Release 3.0.0
* [ ] Make it work with SuperTable
* [ ] Convert JS to use the new Garnish global events instead of polling, if possible
* [ ] Support columns on flds
* [ ] Vertical tab layout
* [ ] Permissions! Per block type grouping

---

Brought to you by [Angell & Co](https://angell.io)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
],
"require": {
"craftcms/cms": "^3.0.15"
"craftcms/cms": "^3.0.16"
},
"autoload": {
"psr-4": {
Expand Down
17 changes: 14 additions & 3 deletions src/assetbundles/spoon/dist/js/FieldManipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
}, this));
}

// Wait until load to loop the Matrix fields
this.addListener(Garnish.$win, 'load', 'processMatrixFields');

// Debounced resize event
this.addListener(Garnish.$win, 'resize', $.proxy(function()
{
Expand Down Expand Up @@ -560,4 +557,18 @@
});


// Load event has to be here otherwise Safari doesn’t see it
Garnish.$win.on('load', function() {

// Check if the Spoon.fieldmanipulator has been created or not yet
if (typeof Spoon.fieldmanipulator == 'undefined') {
setTimeout(function() {
Spoon.fieldmanipulator.processMatrixFields();
}, 250);
} else {
Spoon.fieldmanipulator.processMatrixFields();
}

});

})(jQuery);
5 changes: 2 additions & 3 deletions src/services/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public function run()
*/
public function configurator($container, $context)
{

$view = Craft::$app->getView();

$view->registerAssetBundle(SpoonConfigurator::class);
Expand Down Expand Up @@ -188,15 +189,13 @@ public function fieldManipulator($context)

$view->registerAssetBundle(SpoonFieldManipulator::class);

// $config = Craft::$app->config->getConfigFromFile('spoon');

$settings = [
'blockTypes' => $spoonedBlockTypes,
'context' => $context,
'nestedSettingsHandles' => Spoon::$plugin->getSettings()->nestedSettings
];

$view->registerJs('new Spoon.FieldManipulator('.Json::encode($settings, JSON_UNESCAPED_UNICODE).');');
$view->registerJs('Spoon.fieldmanipulator = new Spoon.FieldManipulator('.Json::encode($settings, JSON_UNESCAPED_UNICODE).');');

}

Expand Down

0 comments on commit 2a43bae

Please sign in to comment.