diff --git a/README.md b/README.md index 301181f..8517e5e 100644 --- a/README.md +++ b/README.md @@ -12,59 +12,59 @@ I start using role attrbute (`
`) to handle DOM eleme Some reasons: -* Markup-guys always change classes and class names (and this is normally) +* Markup-guys always change classes and class names (and this is ok) * It's hard to know this class is used for JavaScript or not? * And finally: semantic -But what wrong with id's? Isn't usage of id's is more faster than class or attributes? - -Id is ok, but it uses for styles to. So why not use prefix? For example `role-id_name`. - ## Usage ### Using selectors You can use symbol '@' in jQuery selectors to find elements with roles -``` javascript -$('@ajax-link'); // Will select all elements in document with role="ajax-link" -$('form@login_form'); //
-$('form.dark@login_form'); //
-$('form.dark@login_form[method=post]'); //
-$('form.dark@login_form@ajax_form[method=post]'); //
-etc... -``` +Will select all elements in document with `role="ajax-link"`: + +``` js +$('@ajax-link'); +`` -### Basic (WARNING: basic ($.r) functional is deprecated and will be completely removed in 0.5.0) +`
`: -``` javascript -$.role('login_form'); // To handle
+``` js +$('form@login_form'); ``` -or via alias `$.r`: +`
`: -``` javascript -$.r('login_form'); +``` js +$('form.dark@login_form'); ``` -### Pick by element id +`
`: -``` javascript -$.r('#login_form'); // To handle
+``` js +$('form.dark@login_form[method=post]'); ``` -### With context +`
`: -``` javascript -$.r('submit', loginForm); // To handle inside loginForm element +``` js +$('form.dark@login_form@ajax_form[method=post]'); ``` ## Roadmap +### 1.1.0 + * Optional usage of `data-role` instead `role`. ## Changelog +### 1.0.0 (December 26, 2011) + +* Remove depricated function +* Rewrite in CoffeeScript + ### 0.4.1 (December 8, 2011) * Fix issue #8 @@ -97,7 +97,7 @@ $.r('submit', loginForm); // To handle inside log ## Contributors -Idea by @kossnocorp and @ai. +Original idea by @kossnocorp and @ai. * @kossnocorp * @chrome