postal.dom binds a DOM event to a postal channel/topic so that when the DOM event is triggered, a postal message will be published.
Postal message data comes from two sources:
data-postal-* attributes on the DOM element, and/or a
data attribute provided on the publication hash passed to
postal.dom may be used in the browser with require.js. A non-require version will be available soon.
To build the project run
build/postal.dom-X.X.X.js file in your own project.
Running the demo
To run the demo project, start the demo server at the project root:
Then browse to
<!-- all data-postal-* attributes will be used as message data -->Demo Button
// subscribe to postal messagepostal;// bind DOM event to postal channel/topicpostaldom;// unbind DOM listeners when finishedpostaldom;// orpostaldom;// orpostaldom;// unbind all postal DOM lsitenerspostaldom;
The MIT License (MIT)
Copyright (c) 2013 Nicholas Cloud
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.