yjs/build/node/Connectors/IwcConnector.js.map
2014-08-12 19:18:56 +02:00

1 line
4.8 KiB
Plaintext
Executable File

{"version":3,"file":"Connectors/IwcConnector.js","sources":["Connectors/IwcConnector.coffee"],"names":[],"mappings":"CAIA,WAAA,GAAA,EAAA,GAAqB,SAAC,GACpB,GAAA,GAAA,EAAA,EAAA,EAAA,EAAA,QAAA,MACA,EAAgB,GAAA,WAEhB,EAAU,QAAQ,SAAC,GAGjB,GAAA,kCAA2B,IAAI,SAAC,SAC9B,YAAW,iBACT,GAAE,IACF,KAHJ,SAKF,EAAU,SAEV,EAAc,KAOR,EAAA,WAQS,QAAA,GAAE,EAAS,EAAK,EAAqB,GAChD,GAAA,GAAA,EAAA,CADY,MAAC,OAAA,EAAQ,KAAC,GAAA,EAAI,KAAC,mBAAA,EAAoB,KAAC,MAAA,EAChD,KAAC,UAAY,EACb,KAAC,WAAa,EAEd,EAAQ,SAAA,SAAA,UAAC,SACP,GAAC,KAAK,KADA,MAER,KAAC,mBAAmB,KAAK,GAEzB,EAAW,SAAA,SAAA,UAAC,GACV,GAAA,SAAA,GAAI,EAAO,OACX,EAAC,QAAQ,KAFA,MAGX,KAAC,WAAW,qBAA0B,GAEnC,MAAA,GACD,KAAC,OAAO,oBAAoB,GAE9B,EAAoB,SAAA,SAAA,YAClB,GAAA,SAAA,IACE,GAAK,EAAC,MAAM,mBAAmB,WACjC,EAAC,cAAc,wBAAyB,KAHtB,MAIpB,KAAC,WAAW,sBAA2B,SApBzC,GAAA,UA0BA,KAAM,SAAC,GACL,MAAG,GAAE,IAAI,UAAW,KAAC,GAAG,aAA6C,gBAA5B,GAAS,IAAI,UACpD,KAAC,cAAc,sBAAuB,GADxC,QA3BF,EAAA,UAkCA,QAAS,SAAC,GACR,MAAG,GAAE,IAAI,UAAa,KAAC,GAAG,YACxB,KAAC,OAAO,QAAQ,GADlB,QAnCF,EAAA,UA2CA,cAAe,SAAC,EAAa,GAC3B,GAAA,SAAA,IACE,OAAQ,EACR,UAAW,GACX,KAAM,GACN,SAAU,GACV,OAAQ,GAEV,KAAC,UAAU,WAAW,SAE1B,GACE,OAAQ,uBACR,UAAW,GACX,KAAM,GACN,SAAU,GACV,WAEF,EAAO,WACL,GAAA,GAAA,QAAA,GAAU,WAAW,GAErB,GAAiB,EACjB,EAAY,SAAC,GACX,GAAA,EAEA,OAFA,GAAmB,EAAU,eAAe,eAC5C,EAAA,MAAA,EAAc,EAAM,OAAO,GAAA,OACxB,EAAH,QACE,GAAiB,EACjB,EAAS,EAAc,KAC3B,EAAW,uBAA4B,GACvC,WAAW,EAAW,QAExB,YAAW,EAAqB,EAAd,KAAK,WAGzB,OAAO,QAAU,8CACjB,OAAQ,gBAAkB","sourcesContent":["\n#\n# @param {Function} callback The callback is called when the connector is initialized.\n#\ncreateIwcConnector = (callback)->\n iwcHandler = {}\n duiClient = new DUIClient()\n #@duiClient = new iwc.Client()\n duiClient.connect (intent)->\n #console.log \"intent received iwc: #{JSON.stringify(intent)}\"\n #console.log \"#{JSON.stringify(@iwcHandler)}\"\n iwcHandler[intent.action]?.map (f)->\n setTimeout ()->\n f intent\n , 0\n\n duiClient.initOK()\n\n received_HB = null\n\n #\n # The Iwc Connector adds support for the Inter-Widget-Communication protocol that is used in the Role-SDK.\n # @see http://dbis.rwth-aachen.de/cms/projects/the-xmpp-experience#interwidget-communication\n # @see http://dbis.rwth-aachen.de/cms/projects/ROLE\n #\n class IwcConnector\n\n #\n # @param {Engine} engine The transformation engine\n # @param {HistoryBuffer} HB\n # @param {Array<Function>} execution_listener You must ensure that whenever an operation is executed, every function in this Array is called.\n # @param {Yatta} yatta The Yatta framework.\n #\n constructor: (@engine, @HB, @execution_listener, @yatta)->\n @duiClient = duiClient\n @iwcHandler = iwcHandler\n\n send_ = (o)=>\n @send o\n @execution_listener.push send_\n\n receive_ = (intent)=>\n o = intent.extras\n @receive o\n @iwcHandler[\"Yatta_new_operation\"] = [receive_]\n\n if received_HB?\n @engine.applyOpsCheckDouble received_HB\n\n sendHistoryBuffer = ()=>\n json =\n HB : @yatta.getHistoryBuffer()._encode()\n @sendIwcIntent \"Yatta_push_HB_element\", json\n @iwcHandler[\"Yatta_get_HB_element\"] = [sendHistoryBuffer]\n\n #\n # This function is called whenever an operation was executed.\n # @param {Operation} o The operation that was executed.\n #\n send: (o)->\n if o.uid.creator is @HB.getUserId() and (typeof o.uid.op_number isnt \"string\")\n @sendIwcIntent \"Yatta_new_operation\", o\n\n #\n # This function is called whenever an operation was received from another peer.\n # @param {Operation} o The operation that was received.\n #\n receive: (o)->\n if o.uid.creator isnt @HB.getUserId()\n @engine.applyOp o\n\n #\n # Helper for sending iwc intents.\n # @param {String} action_name The name of the action that is going to be send.\n # @param {String} content The content that is atteched to the intent.\n #\n sendIwcIntent: (action_name, content)->\n intent =\n action: action_name\n component: \"\"\n data: \"\"\n dataType: \"\"\n extras: content\n\n @duiClient.sendIntent(intent)\n\n get_HB_intent =\n action: \"Yatta_get_HB_element\"\n component: \"\"\n data: \"\"\n dataType: \"\"\n extras: {}\n\n init = ()->\n duiClient.sendIntent(get_HB_intent)\n\n is_initialized = false\n receiveHB = (json)->\n proposed_user_id = duiClient.getIwcClient()._componentName\n received_HB = json?.extras.HB\n if not is_initialized\n is_initialized = true\n callback IwcConnector, proposed_user_id\n iwcHandler[\"Yatta_push_HB_element\"] = [receiveHB]\n setTimeout receiveHB, 0\n\n setTimeout init, (Math.random()*0)\n\n undefined\nmodule.exports = createIwcConnector\nwindow?.createConnector = createIwcConnector\n\n"],"sourceRoot":"/source/"}