I often find it hard to remember which variables are passed into a function when building the user interface for a Custom Bric.
In Blocs 6.2.3 I’ve add a new button (left of function name field) that will copy a simple boilerplate function example to the clipboard based on the target UI element and the function name, making it quick and easy to paste into your custom-bric.js and begin creating the logic for it.
That’s a great help! I used to have typos or errors with upper and lower case letters, but you only notice that when you test the brict. That’s a thing of the past now.
It would also be nice if elements in the interface could be hidden or deactivated by default. At the moment, I do this in the init function.
If you run Blocs v6.2.3 in developer mode you will now notice a little gear icon is displayed to the left of the Bric name in the Sidebar Inspector (within the main application window).
Clicking this will quickly open your custom Bric in the Bric Builder, ready to edit.
Very nice indeed - for developers.
But what about us users trying hard to build websites with custom interactions and are trapped because you can’t export them.
I’ve also added a new environment utility to Blocs 6.2.3 that makes it easy to compare versions of Blocs so you can adjust available features and functions.
if ( appVersionNewerThan( "6.2.3" ))
{
// Do Something for Blocs 6.2.4 or newer
}
I’ve also added a new Custom Bric Global Variable in 6.2.3 beta 2, which lets developers identify when a Custom Bric is within a Global Area, enabling custom functionality for Brics depending on their page location.
if (inGlobalArea)
{
// This Bric is located in a Global Area.
}
else
{
// This Bric is NOT located in a Global Area.
}
It’s great that the API capabilities are being expanded!
Am I interpreting this correctly? I can now also reset the resources in the init function, which is extremely helpful, especially when the Bric consists solely of JavaScript. This is particularly useful for updates. If the Bric is used multiple times, are all resources reset?
Yes, these options are already available if you right click a Bric on the design canvas, the developer can now trigger these functions from the Brics JS functions.
BlocsApp has a cache. removing and re-adding a bric via the extension manager does not help; the cache is retained, meaning that not everything is updated. This is problematic with js files. This only occurs when the version number increases.
This is extremely tedious in the development process and can now be initiated directly by the developer. Good thing…