switched to Gulp
This commit is contained in:
@@ -11,8 +11,8 @@ createIwcConnector = (callback)->
|
||||
#console.log "#{JSON.stringify(@iwcHandler)}"
|
||||
iwcHandler[intent.action]?.map (f)->
|
||||
setTimeout ()->
|
||||
f intent
|
||||
, 0
|
||||
f intent
|
||||
, 0
|
||||
|
||||
duiClient.initOK()
|
||||
|
||||
@@ -48,9 +48,8 @@ createIwcConnector = (callback)->
|
||||
@engine.applyOpsCheckDouble received_HB
|
||||
|
||||
sendHistoryBuffer = ()=>
|
||||
json = {
|
||||
HB : @yatta.getHistoryBuffer()._encode()
|
||||
}
|
||||
json =
|
||||
HB : @yatta.getHistoryBuffer()._encode()
|
||||
@sendIwcIntent "Yatta_push_HB_element", json
|
||||
@iwcHandler["Yatta_get_HB_element"] = [sendHistoryBuffer]
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
json_types_uninitialized = require "../Types/JsonTypes.coffee"
|
||||
HistoryBuffer = require "../HistoryBuffer.coffee"
|
||||
Engine = require "../Engine.coffee"
|
||||
json_types_uninitialized = require "../Types/JsonTypes"
|
||||
HistoryBuffer = require "../HistoryBuffer"
|
||||
Engine = require "../Engine"
|
||||
|
||||
#
|
||||
# Framework for Json data-structures.
|
||||
@@ -54,7 +54,7 @@ class JsonYatta
|
||||
# @see JsonType.setMutableDefault
|
||||
#
|
||||
setMutableDefault: (mutable)->
|
||||
@root_element.setMutableDefault(mutable)
|
||||
@root_element.setMutableDefault(mutable)
|
||||
|
||||
#
|
||||
# Get the UserId from the HistoryBuffer object.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
text_types_uninitialized = require "../Types/TextTypes.coffee"
|
||||
HistoryBuffer = require "../HistoryBuffer.coffee"
|
||||
Engine = require "../Engine.coffee"
|
||||
text_types_uninitialized = require "../Types/TextTypes"
|
||||
HistoryBuffer = require "../HistoryBuffer"
|
||||
Engine = require "../Engine"
|
||||
|
||||
#
|
||||
# Framework for Text Datastructures.
|
||||
|
||||
@@ -80,10 +80,9 @@ class HistoryBuffer
|
||||
user_id = @user_id
|
||||
if not @operation_counter[user_id]?
|
||||
@operation_counter[user_id] = 0
|
||||
uid = {
|
||||
'creator' : user_id
|
||||
'op_number' : @operation_counter[user_id]
|
||||
}
|
||||
uid =
|
||||
'creator' : user_id
|
||||
'op_number' : @operation_counter[user_id]
|
||||
@operation_counter[user_id]++
|
||||
uid
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
10
lib/index.coffee
Normal file
10
lib/index.coffee
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
exports['IwcConnector'] =
|
||||
require './Connectors/IwcConnector'
|
||||
exports['TestConnector'] =
|
||||
require './Connectors/TestConnector'
|
||||
exports['JsonYatta'] =
|
||||
require './Frameworks/JsonYatta'
|
||||
exports['TextYatta'] =
|
||||
require './Frameworks/TextYatta'
|
||||
|
||||
Reference in New Issue
Block a user