Permalink
Comparing changes
Open a pull request
- 8 commits
- 27 files changed
- 1 commit comment
- 1 contributor
Unified
Split
Showing
with
1,101 additions
and 92 deletions.
- +0 −13 data.html
- +75 −0 polymer-core.html
- +13 −0 polymer-data.html
- +2 −62 polymer.html
- +2 −0 src/base.html
- +1 −1 src/{features → data-features}/annotations-bind.html
- +7 −8 src/{features → data-features}/bind-effects.html
- 0 src/{features → data-features}/bind.html
- 0 src/{features → data-features}/computed.html
- +76 −0 src/data/annotations-bind.html
- +275 −0 src/data/bind.html
- +48 −0 src/data/computed.html
- +101 −0 src/data/demo/app-chrome.html
- +1 −1 src/features/annotations.html
- +28 −0 src/features/constructor.html
- +2 −1 src/features/content.html
- +47 −0 src/features/extends.html
- +22 −0 src/features/focus.html
- +2 −2 src/features/keys.html
- +35 −0 src/features/mixins.html
- +15 −1 src/features/utils.html
- +6 −2 src/lang.html
- 0 src/{features → }/layout.html
- +64 −0 src/module.html
- +12 −1 src/polymer.html
- +52 −0 src/template/demo/app-chrome.html
- +215 −0 src/template/template.html
| @@ -1,13 +0,0 @@ | ||
| <!-- | ||
| @license | ||
| Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | ||
| This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
| The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
| The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
| Code distributed by Google as part of the polymer project is also | ||
| subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
| --> | ||
| <link rel="import" href="src/features/bind.html"> | ||
| <link rel="import" href="src/features/annotations-bind.html"> | ||
| <link rel="import" href="src/features/computed.html"> | ||
| <link rel="import" href="src/features/bind-effects.html"> | ||
| @@ -0,0 +1,75 @@ | ||
| <!-- | ||
| @license | ||
| Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | ||
| This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
| The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
| The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
| Code distributed by Google as part of the polymer project is also | ||
| subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
| --> | ||
| <link rel="import" href="src/polymer.html"> | ||
| <link rel="import" href="src/features/log.html"> | ||
| <link rel="import" href="src/features/constructor.html"> | ||
| <link rel="import" href="src/features/extends.html"> | ||
| <link rel="import" href="src/features/mixins.html"> | ||
| <link rel="import" href="src/features/published.html"> | ||
| <link rel="import" href="src/features/attributes.html"> | ||
| <link rel="import" href="src/features/template.html"> | ||
| <link rel="import" href="src/features/content.html"> | ||
| <link rel="import" href="src/features/annotations.html"> | ||
| <link rel="import" href="src/features/annotations-nodes.html"> | ||
| <link rel="import" href="src/features/events.html"> | ||
| <link rel="import" href="src/features/keys.html"> | ||
| <link rel="import" href="src/features/annotations-events.html"> | ||
| <link rel="import" href="src/features/utils.html"> | ||
| <link rel="import" href="src/features/ready.html"> | ||
|
|
||
| <link rel="import" href="src/layout.html"> | ||
|
|
||
| <script> | ||
| // TODO(sjmiles): hack | ||
| Base.originalInitFeatures = Base.initFeatures; | ||
| Base.addFeature({ | ||
| initFeatures: function() { | ||
| // TODO(sjmiles): hack to make sure this feature goes last | ||
| this.originalInitFeatures(this); | ||
| this.features(); | ||
| }, | ||
| features: function() { | ||
| this.defaultFeatures(); | ||
| }, | ||
| defaultFeatures: function() { | ||
| if (this._useContent) { | ||
| this.poolContent(); | ||
| } | ||
| if (this._template) { | ||
| this.stampTemplate(); | ||
| this._marshalNodeReferences(); | ||
| this._marshalAnnotatedNodes(); | ||
| this._setupAnnotatedListeners(); | ||
| if (this._setupBindListeners) { | ||
| this._setupBindListeners(); | ||
| } | ||
| } | ||
| this.listenListeners(); | ||
| this.listenKeyPresses(); | ||
| if (this._useContent) { | ||
| this.distributeContent(); | ||
| } | ||
| this.takeAttributes(); | ||
| } | ||
| }); | ||
| Polymer.noFeatures = function() { | ||
| }; | ||
| Polymer.defaultFeatures = Base.defaultFeatures; | ||
| </script> | ||
|
|
| @@ -0,0 +1,13 @@ | ||
| <!-- | ||
| @license | ||
| Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | ||
| This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
| The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
| The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
| Code distributed by Google as part of the polymer project is also | ||
| subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
| --> | ||
| <link rel="import" href="src/data-features/bind.html"> | ||
| <link rel="import" href="src/data-features/annotations-bind.html"> | ||
| <link rel="import" href="src/data-features/computed.html"> | ||
| <link rel="import" href="src/data-features/bind-effects.html"> |
| @@ -7,65 +7,5 @@ | ||
| Code distributed by Google as part of the polymer project is also | ||
| subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
| --> | ||
| <link rel="import" href="src/polymer.html"> | ||
| <link rel="import" href="src/features/log.html"> | ||
| <link rel="import" href="src/features/published.html"> | ||
| <link rel="import" href="src/features/attributes.html"> | ||
| <link rel="import" href="src/features/template.html"> | ||
| <link rel="import" href="src/features/content.html"> | ||
| <link rel="import" href="src/features/annotations.html"> | ||
| <link rel="import" href="src/features/annotations-nodes.html"> | ||
| <link rel="import" href="src/features/events.html"> | ||
| <link rel="import" href="src/features/keys.html"> | ||
| <link rel="import" href="src/features/annotations-events.html"> | ||
| <link rel="import" href="src/features/utils.html"> | ||
| <link rel="import" href="src/features/layout.html"> | ||
| <link rel="import" href="src/features/ready.html"> | ||
|
|
||
| <script> | ||
| // TODO(sjmiles): hack | ||
| Base.originalInitFeatures = Base.initFeatures; | ||
| Base.addFeature({ | ||
| initFeatures: function() { | ||
| // TODO(sjmiles): hack to make sure this feature goes last | ||
| this.originalInitFeatures(this); | ||
| this.features(); | ||
| }, | ||
| features: function() { | ||
| this.defaultFeatures(); | ||
| }, | ||
| defaultFeatures: function() { | ||
| if (this._useContent) { | ||
| this.poolContent(); | ||
| } | ||
| if (this._template) { | ||
| this.stampTemplate(); | ||
| this._marshalNodeReferences(); | ||
| this._marshalAnnotatedNodes(); | ||
| this._setupAnnotatedListeners(); | ||
| if (this._setupBindListeners) { | ||
| this._setupBindListeners(); | ||
| } | ||
| } | ||
| this.listenListeners(); | ||
| this.listenKeyPresses(); | ||
| if (this._useContent) { | ||
| this.distributeContent(); | ||
| } | ||
| this.takeAttributes(); | ||
| } | ||
| }); | ||
| Polymer.noFeatures = function() { | ||
| }; | ||
| Polymer.defaultFeatures = Base.defaultFeatures; | ||
| </script> | ||
|
|
||
| <link rel="import" href="polymer-core.html"> | ||
| <link rel="import" href="polymer-data.html"> | ||
| @@ -67,6 +67,7 @@ | ||
| }, | ||
| attachedCallback: function() { | ||
| this.isAttached = true; | ||
| // reserved for canonical behavior | ||
| this.attached(); | ||
| }, | ||
| @@ -76,6 +77,7 @@ | ||
| }, | ||
| detachedCallback: function() { | ||
| this.isAttached = false; | ||
| // reserved for canonical behavior | ||
| this.detached(); | ||
| }, | ||
| @@ -7,7 +7,7 @@ | ||
| Code distributed by Google as part of the polymer project is also | ||
| subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
| --> | ||
| <link rel="import" href="annotations.html"> | ||
| <link rel="import" href="../features/annotations.html"> | ||
|
|
||
| <script> | ||
| @@ -51,11 +51,11 @@ | ||
| // per prototype | ||
| register: function(prototype) { | ||
| prototype._bindListeners = []; | ||
| prototype._createBindings(); | ||
| }, | ||
| _createBindings: function() { | ||
| this._bindListeners = []; | ||
| var fx$ = this._propertyEffects; | ||
| if (fx$) { | ||
| //console.group(this.name); | ||
| @@ -76,14 +76,13 @@ | ||
| }, | ||
| _sortPropertyEffects: function(a, b) { | ||
| switch (a.kind) { | ||
| case 'compute': | ||
| return b.kind === 'compute' ? 0 : -1; | ||
| case 'notify': | ||
| return b.kind === 'notify' ? 0 : 1; | ||
| default: | ||
| return 0; | ||
| if (a.kind === 'compute' || b.kind === 'notify') { | ||
| return -1; | ||
| } | ||
| if (a.kind === 'notify' || b.kind === 'compute') { | ||
| return 1; | ||
| } | ||
| return 0; | ||
| }, | ||
| _buildEffect: function(property, fx) { | ||
File renamed without changes.
File renamed without changes.
| @@ -0,0 +1,76 @@ | ||
| <!-- | ||
| @license | ||
| Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | ||
| This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
| The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
| The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
| Code distributed by Google as part of the polymer project is also | ||
| subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
| --> | ||
| <link rel="import" href="annotations.html"> | ||
|
|
||
| <script> | ||
| /* | ||
| * Parses the annotations list created by `annotations` features to perform | ||
| * declarative desugaring. | ||
| * | ||
| * Depends on `annotations` feature and `bind` feature. | ||
| * | ||
| * Two tasks are supported: | ||
| * | ||
| * - nodes with 'id' are described in a virtual annotation list at | ||
| * registration time. This list is then concretized per instance. | ||
| * | ||
| * - Simple mustache expressions consisting of a single property name | ||
| * in a `textContent` context are bound using `bind` features | ||
| * `bindMethod`. In this mode, the bound method is constructed at | ||
| * registration time, so marshaling is done done via the concretized | ||
| * `_nodes` at every access. | ||
| * | ||
| * TODO(sjmiles): ph3ar general confusion between registration and | ||
| * instance time tasks. Is there a cleaner way to disambiguate? | ||
| */ | ||
| TemplateBind = { | ||
| // construct binding meta-data | ||
| _preprocessBindAnnotations: function(prototype, list) { | ||
| // create a virtual annotation list, must be concretized at instance time | ||
| prototype._nodes = []; | ||
| // process annotations that have been parsed from template | ||
| list.forEach(function(annotation) { | ||
| // where to find the node in the concretized list | ||
| var index = prototype._nodes.push(annotation) - 1; | ||
| // TODO(sjmiles): we need to support multi-bind, right now you only get | ||
| // one (not including kind === `id`) | ||
| annotation.bindings.forEach(function(binding) { | ||
| prototype._bindAnnotationBinding(binding, index); | ||
| }); | ||
| }); | ||
| }, | ||
| // _nodes[index][<binding.name=>]{{binding.value}} | ||
| _bindAnnotationBinding: function(binding, index) { | ||
| // capture the node index | ||
| binding.index = index; | ||
| // discover top-level property (model) from path | ||
| var path = binding.value; | ||
| var i = path.indexOf('.'); | ||
| // [name=]{{model[.subpath]}} | ||
| var model = (i >= 0) ? path.slice(0, i) : path; | ||
| // add 'annotation' binding effect for property 'model' | ||
| this.addPropertyEffect(model, 'annotation', binding); | ||
| } | ||
| // concretize `_nodes` map (annotation based) | ||
| marshalAnnotatedNodes: function(nodes, root) { | ||
| return nodes.map(function(a) { | ||
| return Template.findAnnotatedNode(root, a); | ||
| }; | ||
| } | ||
| }); | ||
| </script> |
Oops, something went wrong.
Showing you all comments on commits in this comparison.
This comment has been minimized.
This comment has been minimized.
|
Wait, it mixes in asynchronously!? |