You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
I've started work on a WebBlocks project for generating and mutating WebBlocks structures. This is needed for work with @melcassio@marywatkins@quyenv and @albertwu, as it will allow me to provide a "style generator" as part of the WebBlocks-kit.
I see this as eventually being an optional package that can be included with WebBlocks core, as well as something that can go into the documentation to help people actually tinker with styles live.
The test case and starting example was Entity/Message:
Creation
Initialization
The most basic way to define a message:
varmessage=newWebBlocks.Blocks.Message({'header': 'Heading','content': 'This is some message content','color': 'primary dark'});$('body').append(message);
Setters and Getters
For the message entity, several setters are exposed:
I've started work on a WebBlocks project for generating and mutating WebBlocks structures. This is needed for work with @melcassio @marywatkins @quyenv and @albertwu, as it will allow me to provide a "style generator" as part of the WebBlocks-kit.
My work thus far can be found here:
https://github.com/ebollens/WebBlocks.Blocks.js
I see this as eventually being an optional package that can be included with WebBlocks core, as well as something that can go into the documentation to help people actually tinker with styles live.
/CC @loganfranken @edsakabu @chris4ucla @lnicks
The test case and starting example was
Entity/Message
:Creation
Initialization
The most basic way to define a message:
Setters and Getters
For the message entity, several setters are exposed:
Equivalent getters (
getHeader
,getContent
,getColor) and unsetters (
unsetHeader,
unsetContent,
unsetColor`) also exist.Shorthand
Adding some short-hand simplifies this:
Use
with
cautiously (see reference).Mutation
Basic
An existing element can be cast into a WebBlocks.Block as:
jQuery Helper
The
jQuery.toBlock.js
library provides a shorthand:Note that this method only supports a single block at once; if you have more than one, consider:
The text was updated successfully, but these errors were encountered: