switched to Gulp
This commit is contained in:
@@ -27,6 +27,31 @@ module.exports = (HB)->
|
||||
'op_number' : @op_number
|
||||
} = uid
|
||||
|
||||
#
|
||||
# Add an event listener. It depends on the operation which events are supported.
|
||||
# @param {String} event Name of the event.
|
||||
# @param {Function} f f is executed in case the event fires.
|
||||
#
|
||||
on: (event, f)->
|
||||
@event_listeners ?= {}
|
||||
@event_listeners[event] ?= []
|
||||
@event_listeners[event].push f
|
||||
|
||||
#
|
||||
# Fire an event.
|
||||
# TODO: Do something with timeouts. You don't want this to fire for every operation (e.g. insert).
|
||||
#
|
||||
callEvent: (event, args)->
|
||||
if @event_listeners[event]?
|
||||
for f in @event_listeners[event]
|
||||
f.call @, event, args
|
||||
|
||||
#
|
||||
# Set the parent of this operation.
|
||||
#
|
||||
setParent: (o)->
|
||||
@parent = o
|
||||
|
||||
#
|
||||
# Computes a unique identifier (uid) that identifies this operation.
|
||||
#
|
||||
@@ -390,12 +415,12 @@ module.exports = (HB)->
|
||||
}
|
||||
|
||||
parser['Delimiter'] = (json)->
|
||||
{
|
||||
'uid' : uid
|
||||
'prev' : prev
|
||||
'next' : next
|
||||
} = json
|
||||
new Delimiter uid, prev, next
|
||||
{
|
||||
'uid' : uid
|
||||
'prev' : prev
|
||||
'next' : next
|
||||
} = json
|
||||
new Delimiter uid, prev, next
|
||||
|
||||
# This is what this module exports after initializing it with the HistoryBuffer
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
text_types_uninitialized = require "./TextTypes.coffee"
|
||||
text_types_uninitialized = require "./TextTypes"
|
||||
|
||||
module.exports = (HB)->
|
||||
text_types = text_types_uninitialized HB
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
basic_types_uninitialized = require "./BasicTypes.coffee"
|
||||
basic_types_uninitialized = require "./BasicTypes"
|
||||
|
||||
module.exports = (HB)->
|
||||
basic_types = basic_types_uninitialized HB
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
structured_types_uninitialized = require "./StructuredTypes.coffee"
|
||||
structured_types_uninitialized = require "./StructuredTypes"
|
||||
|
||||
module.exports = (HB)->
|
||||
structured_types = structured_types_uninitialized HB
|
||||
|
||||
Reference in New Issue
Block a user