README.md in evil-blocks-rails-0.6.2 vs README.md in evil-blocks-rails-0.6.3

- old
+ new

@@ -1,28 +1,34 @@ -# Evil Blocks +# Evil Blocks [![Build Status](https://travis-ci.org/ai/evil-blocks.svg)](https://travis-ci.org/ai/evil-blocks) +<img align="right" width="140" height="115" src="http://ai.github.io/evil-blocks/logo.svg" title="Evil Blocks logo by Roman Shamin"> + Evil Block is a tiny JS framework for web pages. It is based on 4 ideas: * **Split code to independent blocks.** “Divide and rule” is always good idea. -* **Blocks communicate by events.** Events is an easy and safe method to clean - very complicated dependencies between controls. +* **Blocks communicate by events.** Events is an easy and safe method + to clean very complicated dependencies between controls. * **Separate JS and CSS.** You should use classes only for styles and bind JS by selectors with special attributes. So you can update your styles without fear to break your scripts. * **Try not to render on client.** 2-way data-binding looks very cool, but it has a [big price]. Most of web pages (instead of web applications) can render all HTML on server and use client rendering only in few small places. Without rendering we can incredibly clean code and architecture. See also [Evil Front], a pack of helpers for Ruby on Rails and Evil Blocks. -Sponsored by [Evil Martians]. Role aliases were taken from [Role.js]. +Role aliases were taken from [Role.js]. Based on Pieces.js by [@chrome]. +<a href="https://evilmartians.com/?utm_source=evil-blocks"> +<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg" alt="Sponsored by Evil Martians" width="236" height="54"> +</a> + [Role.js]: https://github.com/kossnocorp/role [big price]: http://staal.io/blog/2014/02/05/2-way-data-binding-under-the-microscope/ [Evil Front]: https://github.com/ai/evil-front -[Evil Martians]: http://evilmartians.com/ +[@chrome]: https://github.com/chrome ## Quick Example Slim template: @@ -53,11 +59,11 @@ form.addClass('is-loading') $.ajax url: form.attr('action') data: form.serialize() - complete: -> form.addClass('is-loading') + complete: -> form.removeClass('is-loading') 'submit on @finishForm': (e) -> @ajaxSubmit(e).done -> e.el.closest("@task").addClass("is-finished") @@ -412,10 +418,10 @@ @block.trigger('close') evil.block '@@popup', 'on close': -> - @clock.removeClass('is-open') + @block.removeClass('is-open') ``` If you want to use same methods inside of multiple block, you can create an inject-function: