Commit 24d72a4ddf4220a176dfa657c082c9d00ba14967
1 parent
47e7812e
added JQuerySelector type and function to format a jquery selector to string
Showing
1 changed file
with
22 additions
and
0 deletions
Show diff stats
web/CXM_jquery.anubis
| ... | ... | @@ -20,6 +20,28 @@ public type JQuery_Actioner_type: |
| 20 | 20 | public type JQuery_Actioner: |
| 21 | 21 | jQuery_actioner(Actioner_Target target, JQuery_Actioner_type type, String url_or_form_id_or_script). |
| 22 | 22 | |
| 23 | +/* jQuery Selector - http://api.jquery.com/category/selectors/ */ | |
| 24 | +public type JQuerySelector: | |
| 25 | + element(HtmlId id), | |
| 26 | + element_class(String name), | |
| 27 | + childs(HtmlId id). | |
| 28 | + | |
| 29 | +public define String | |
| 30 | + format_jquery_selector | |
| 31 | + ( | |
| 32 | + JQuerySelector selector | |
| 33 | + ) = | |
| 34 | + if selector is | |
| 35 | + { | |
| 36 | + element(html_id) then | |
| 37 | + if html_id is htmlId(id) then "'#" + id + "'", | |
| 38 | + | |
| 39 | + element_class(name) then | |
| 40 | + "'." + name + "'", | |
| 41 | + | |
| 42 | + childs(html_id) then | |
| 43 | + if html_id is htmlId(id) then "'#" + id + " > *'" | |
| 44 | + }. | |
| 23 | 45 | |
| 24 | 46 | /* */ |
| 25 | 47 | public define Script | ... | ... |