chocolate
Version:
A full stack Node.js web framework built using Coffeescript
26 lines (18 loc) • 777 B
text/coffeescript
_ = require '../../general/chocodash'
Action = _.prototype
constructor: ->
= []
do: (what, value, type) ->
.push {so: 'do', what, value} ; @
move: (what, where, how) ->
.push {so: 'move', what, where, how} ; @
eval: (what, value) ->
.push {so: 'eval', what, value} ; @
go: (what, where) ->
where ?= Action.go.Where.Inside
.push {so: 'go', what, where} ; @
Action::do.What = New:0, Set:1, Delete:2
Action::move.How = Replace:0, Append:1, Prepend:2, InsertBefore:3, InsertAfter:4
Action::go.Where = Front:0, Inside:1, Through:2
_module = window ? module
if _module.exports? then _module.exports = Action else window.Locco ?= {} ; window.Locco.Action = Action