Polymer elements support bind, creation of new elements, overwrite with simple object, events

This commit is contained in:
DadaMonad
2014-12-26 13:36:45 +00:00
parent fd1128d456
commit 6790355232
84 changed files with 249 additions and 31221 deletions

View File

@@ -19,22 +19,21 @@
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"polymer": "Polymer/polymer#~0.5.1"
"polymer": "Polymer/polymer#~0.5.1",
"peerjs": "~0.3.14"
},
"homepage": "https://github.com/DadaMonad/Connector",
"_release": "35f8d81ce7",
"_release": "27a5fbf2af",
"_resolution": {
"type": "branch",
"branch": "master",
"commit": "35f8d81ce73ecac317b3dd7fabf32a871a4926a6"
"commit": "27a5fbf2af5c336df0dc4b27adbe43a0959bbdb1"
},
"_source": "git://github.com/DadaMonad/Connector.git",
"_target": "*",
"_originalSource": "DadaMonad/Connector",
"_direct": true
"_originalSource": "DadaMonad/Connector"
}

View File

@@ -20,11 +20,11 @@
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"polymer": "Polymer/polymer#~0.5.1"
"polymer": "Polymer/polymer#~0.5.1",
"peerjs": "~0.3.14"
}
}

View File

@@ -14,7 +14,10 @@ class Connector
@receive_handlers = []
# A list of functions that are executed (left to right) when syncing with a peer.
@sync_process_order = []
getUniqueConnectionId: ->
@id # make sure, that every connector implementation does it like this
#
# Execute a function _when_ we are connected. If not connected, wait until connected.
# @param f {Function} Will be executed on the PeerJs-Connector context.

View File

@@ -5,7 +5,7 @@ new Polymer 'peerjs-connector',
if this.is_initialized
throw new Error "You must not set the user_id twice!"
else
this.initializeConnection()
this.initializeConnection()
initializeConnection: ()->
if this.conn_id?
@@ -22,8 +22,7 @@ new Polymer 'peerjs-connector',
writeIfAvailable 'debug', this.debug
this.is_initialized = true;
this.connector = new PeerJsConnector this.conn_id, options
ready: ()->
if this.conn_id != null
this.initializeConnection()

View File

@@ -1,4 +1,3 @@
<link rel="import" href="../bower_components/polymer/polymer.html">
<polymer-element name="peerjs-connector" hidden attributes="conn_id connector key host port path secure debug">
<script src="../bower_components/peerjs/peer.min.js"></script>
@@ -6,5 +5,4 @@
<template>
</template>
<script src="./peerjs-connector-polymer.min.js"></script>
</polymer-element>