0.0.1-alpha0 • Published 5 years ago

hypescript.org v0.0.1-alpha0

Weekly downloads
4
License
BSD 2-Clause
Repository
github
Last release
5 years ago

/// hypescript

introduction

hypescript is a small web scripting language based applescript and hypertalk

it is a companion project of https://htmx.org

sample

<button hscript="toggle clicked">
  Toggle the "clicked" class on me
</button>


<div hscript="on mouseOver toggle mouse-over on #foo">
</div>

<div hscript="on click call aJavascriptFunction() then
              wait 10s then 
              call anotherJavascriptFunction()">
           Do some stuff
</div>

Grammar

 hyperscript => [on_expr] action_list;
 on_expr => "on", IDENTIFIER;
 action_list => action {["then", action_list]};
 action => [on_expr] operation_expr;
 operation_expr => add_expr | remove_expr | toggle_expr | call_expr | wait_expr
 add_expr => "add", IDENTIFIER, [on_expr];
 remove_expr => "remove", IDENTIFIER, [on_expr];
 toggle_expr => "toggle", IDENTIFIER, [on_expr];
 call_expr => "call" ? javascript_method_call_expr ?;
 wait_expr => "wait" time_expr;
0.0.1-alpha0

5 years ago