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>

View File

@@ -19,14 +19,14 @@
"tools": "Polymer/tools#master",
"web-component-tester": "Polymer/web-component-tester#^1.4.2"
},
"version": "0.5.1",
"_release": "0.5.1",
"version": "0.5.2",
"_release": "0.5.2",
"_resolution": {
"type": "version",
"tag": "0.5.1",
"commit": "c654b2b4996a643e79234ac624d7bc38179dfc2c"
"tag": "0.5.2",
"commit": "2a9ca53fa79ca09907e818f1adf806765409ec9c"
},
"_source": "git://github.com/Polymer/polymer.git",
"_target": "~0.5.1",
"_target": "^0.5.0",
"_originalSource": "Polymer/polymer"
}

View File

@@ -8,11 +8,11 @@ For more detailed info goto [http://polymer-project.org/](http://polymer-project
Polymer is a new type of library for the web, designed to leverage the existing browser infrastructure to provide the encapsulation and extendability currently only available in JS libraries.
Polymer is based on a set of future technologies, including [Shadow DOM](https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html), [Custom Elements](https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html) and Model Driven Views. Currently these technologies are implemented as polyfills or shims, but as browsers adopt these features natively, the platform code that drives Polymer evacipates, leaving only the value-adds.
Polymer is based on a set of future technologies, including [Shadow DOM](http://w3c.github.io/webcomponents/spec/shadow/), [Custom Elements](http://w3c.github.io/webcomponents/spec/custom/) and Model Driven Views. Currently these technologies are implemented as polyfills or shims, but as browsers adopt these features natively, the platform code that drives Polymer evacipates, leaving only the value-adds.
## Tools & Testing
For running tests or building minified files, consult the [tooling information](http://polymer-project.org/resources/tooling-strategy.html).
For running tests or building minified files, consult the [tooling information](https://www.polymer-project.org/resources/tooling-strategy.html).
## Releases

View File

@@ -19,5 +19,5 @@
"tools": "Polymer/tools#master",
"web-component-tester": "Polymer/web-component-tester#^1.4.2"
},
"version": "0.5.1"
"version": "0.5.2"
}

View File

@@ -1,6 +1,6 @@
BUILD LOG
---------
Build Time: 2014-11-12T14:32:18
Build Time: 2014-12-11T12:46:30
NODEJS INFORMATION
==================
@@ -11,16 +11,15 @@ grunt-contrib-concat: 0.5.0
grunt-contrib-copy: 0.7.0
grunt-contrib-uglify: 0.6.0
grunt-string-replace: 1.0.0
web-component-tester: 1.6.0
REPO REVISIONS
==============
polymer-expressions: 1288fe573dc57cde304f66f0833d0644c766158c
polymer-gestures: 94660a514772e182d27f79c3d8d1bb88796a2327
polymer: da75e633f39b7761494cc3139a60733c488b2215
polymer-expressions: 197c3a0150e7a13374cfcc72e7066113723a623d
polymer-gestures: 17a6304916521be39409af292e8adf899bae0ce7
polymer: a74e9f36526361dccb6df91be439ff9c3e043f41
BUILD HASHES
============
dist/polymer.js: 59e0d3e669a3a1d163d8337766aa63bf809bfe79
dist/polymer.min.js: a9145f911c5b9fecc0d4aa422ac658d1d462d15a
dist/polymer.js: b9ad4c86af79c748cf4ea722f6d56671079fadf7
dist/polymer.min.js: 2f2021ba9682b0bb702ee7fb68fb6fbfd288eac2
dist/layout.html: 348d358a91712ecc2f8811efa430fcd954b4590c

View File

@@ -939,7 +939,7 @@ window.PolymerGestures = {};
};
})(window.PolymerGestures);
(function (scope) {
(function(scope) {
var dispatcher = scope.dispatcher;
var pointermap = dispatcher.pointermap;
// radius around touchend that swallows mouse events
@@ -948,10 +948,22 @@ window.PolymerGestures = {};
var WHICH_TO_BUTTONS = [0, 1, 4, 2];
var CURRENT_BUTTONS = 0;
var HAS_BUTTONS = false;
try {
HAS_BUTTONS = new MouseEvent('test', {buttons: 1}).buttons === 1;
} catch (e) {}
var FIREFOX_LINUX = /Linux.*Firefox\//i;
var HAS_BUTTONS = (function() {
// firefox on linux returns spec-incorrect values for mouseup.buttons
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.buttons#See_also
// https://codereview.chromium.org/727593003/#msg16
if (FIREFOX_LINUX.test(navigator.userAgent)) {
return false;
}
try {
return new MouseEvent('test', {buttons: 1}).buttons === 1;
} catch (e) {
return false;
}
})();
// handler block for native mouse events
var mouseEvents = {
@@ -1273,7 +1285,7 @@ window.PolymerGestures = {};
d.forEach(function(p) {
this.cancel(p);
pointermap.delete(p.pointerId);
});
}, this);
}
},
touchstart: function(inEvent) {
@@ -2047,7 +2059,9 @@ window.PolymerGestures = {};
'cancel'
],
exposes: [
'pinchstart',
'pinch',
'pinchend',
'rotate'
],
defaultActions: {
@@ -2065,11 +2079,19 @@ window.PolymerGestures = {};
diameter: points.diameter,
target: scope.targetFinding.LCA(points.a.target, points.b.target)
};
this.firePinch('pinchstart', points.diameter, points);
}
},
up: function(inEvent) {
var p = pointermap.get(inEvent.pointerId);
var num = pointermap.pointers();
if (p) {
if (num === 2) {
// fire 'pinchend' before deleting pointer
var points = this.calcChord();
this.firePinch('pinchend', points.diameter, points);
}
pointermap.delete(inEvent.pointerId);
}
},
@@ -2084,9 +2106,9 @@ window.PolymerGestures = {};
cancel: function(inEvent) {
this.up(inEvent);
},
firePinch: function(diameter, points) {
firePinch: function(type, diameter, points) {
var zoom = diameter / this.reference.diameter;
var e = eventFactory.makeGestureEvent('pinch', {
var e = eventFactory.makeGestureEvent(type, {
bubbles: true,
cancelable: true,
scale: zoom,
@@ -2113,7 +2135,7 @@ window.PolymerGestures = {};
var diameter = points.diameter;
var angle = this.calcAngle(points);
if (diameter != this.reference.diameter) {
this.firePinch(diameter, points);
this.firePinch('pinch', diameter, points);
}
if (angle != this.reference.angle) {
this.fireRotate(angle, points);
@@ -3258,7 +3280,7 @@ window.PolymerGestures = {};
},
setValue: function(model, newValue) {
if (this.path.length == 1);
if (this.path.length == 1)
model = findScope(model, this.path[0]);
return this.path.setValueFrom(model, newValue);
@@ -8132,7 +8154,7 @@ head.insertBefore(style, head.firstChild);
/**
* Force any pending data changes to be observed before
* the next task. Data changes are processed asynchronously but are guaranteed
* to be processed, for example, before paintin. This method should rarely be
* to be processed, for example, before painting. This method should rarely be
* needed. It does nothing when Object.observe is available;
* when Object.observe is not available, Polymer automatically flushes data
* changes approximately every 1/10 second.

File diff suppressed because one or more lines are too long