Skip to content

Commit

Permalink
chore(all): prepare release 1.0.0-beta.1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Dec 3, 2015
1 parent d025af9 commit 9f6b166
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 62 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-templating-binding",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.1.0.1",
"description": "An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.",
"keywords": [
"aurelia",
Expand Down
28 changes: 16 additions & 12 deletions dist/amd/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,20 +209,20 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
this.eventManager = eventManager;
}

SyntaxInterpreter.prototype.interpret = function interpret(resources, element, info, existingInstruction) {
SyntaxInterpreter.prototype.interpret = function interpret(resources, element, info, existingInstruction, context) {
if (info.command in this) {
return this[info.command](resources, element, info, existingInstruction);
return this[info.command](resources, element, info, existingInstruction, context);
}

return this.handleUnknownCommand(resources, element, info, existingInstruction);
return this.handleUnknownCommand(resources, element, info, existingInstruction, context);
};

SyntaxInterpreter.prototype.handleUnknownCommand = function handleUnknownCommand(resources, element, info, existingInstruction) {
SyntaxInterpreter.prototype.handleUnknownCommand = function handleUnknownCommand(resources, element, info, existingInstruction, context) {
_aureliaLogging.getLogger('templating-binding').warn('Unknown binding command.', info);
return existingInstruction;
};

SyntaxInterpreter.prototype.determineDefaultBindingMode = function determineDefaultBindingMode(element, attrName) {
SyntaxInterpreter.prototype.determineDefaultBindingMode = function determineDefaultBindingMode(element, attrName, context) {
var tagName = element.tagName.toLowerCase();

if (tagName === 'input') {
Expand All @@ -235,13 +235,17 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
return _aureliaBinding.bindingMode.twoWay;
}

if (context && attrName in context.attributes) {
return context.attributes[attrName].defaultBindingMode || _aureliaBinding.bindingMode.oneWay;
}

return _aureliaBinding.bindingMode.oneWay;
};

SyntaxInterpreter.prototype.bind = function bind(resources, element, info, existingInstruction) {
SyntaxInterpreter.prototype.bind = function bind(resources, element, info, existingInstruction, context) {
var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);

instruction.attributes[info.attrName] = new _aureliaBinding.BindingExpression(this.observerLocator, this.attributeMap[info.attrName] || info.attrName, this.parser.parse(info.attrValue), info.defaultBindingMode || this.determineDefaultBindingMode(element, info.attrName), resources.lookupFunctions);
instruction.attributes[info.attrName] = new _aureliaBinding.BindingExpression(this.observerLocator, this.attributeMap[info.attrName] || info.attrName, this.parser.parse(info.attrValue), info.defaultBindingMode || this.determineDefaultBindingMode(element, info.attrName, context), resources.lookupFunctions);

return instruction;
};
Expand All @@ -262,7 +266,7 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
return instruction;
};

SyntaxInterpreter.prototype.options = function options(resources, element, info, existingInstruction) {
SyntaxInterpreter.prototype.options = function options(resources, element, info, existingInstruction, context) {
var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);
var attrValue = info.attrValue;
var language = this.language;
Expand All @@ -277,7 +281,7 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],

if (current === ';') {
info = language.inspectAttribute(resources, name, target.trim());
language.createAttributeInstruction(resources, element, info, instruction);
language.createAttributeInstruction(resources, element, info, instruction, context);

if (!instruction.attributes[info.attrName]) {
instruction.attributes[info.attrName] = info.attrValue;
Expand All @@ -295,7 +299,7 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],

if (name !== null) {
info = language.inspectAttribute(resources, name, target.trim());
language.createAttributeInstruction(resources, element, info, instruction);
language.createAttributeInstruction(resources, element, info, instruction, context);

if (!instruction.attributes[info.attrName]) {
instruction.attributes[info.attrName] = info.attrValue;
Expand Down Expand Up @@ -436,7 +440,7 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
return info;
};

TemplatingBindingLanguage.prototype.createAttributeInstruction = function createAttributeInstruction(resources, element, theInfo, existingInstruction) {
TemplatingBindingLanguage.prototype.createAttributeInstruction = function createAttributeInstruction(resources, element, theInfo, existingInstruction, context) {
var instruction = undefined;

if (theInfo.expression) {
Expand All @@ -447,7 +451,7 @@ define(['exports', 'aurelia-logging', 'aurelia-binding', 'aurelia-templating'],
instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(theInfo.attrName);
instruction.attributes[theInfo.attrName] = theInfo.expression;
} else if (theInfo.command) {
instruction = this.syntaxInterpreter.interpret(resources, element, theInfo, existingInstruction);
instruction = this.syntaxInterpreter.interpret(resources, element, theInfo, existingInstruction, context);
}

return instruction;
Expand Down
29 changes: 17 additions & 12 deletions dist/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,20 @@ export class SyntaxInterpreter {
this.eventManager = eventManager;
}

interpret(resources, element, info, existingInstruction) {
interpret(resources, element, info, existingInstruction, context) {
if (info.command in this) {
return this[info.command](resources, element, info, existingInstruction);
return this[info.command](resources, element, info, existingInstruction, context);
}

return this.handleUnknownCommand(resources, element, info, existingInstruction);
return this.handleUnknownCommand(resources, element, info, existingInstruction, context);
}

handleUnknownCommand(resources, element, info, existingInstruction) {
handleUnknownCommand(resources, element, info, existingInstruction, context) {
LogManager.getLogger('templating-binding').warn('Unknown binding command.', info);
return existingInstruction;
}

determineDefaultBindingMode(element, attrName) {
determineDefaultBindingMode(element, attrName, context) {
let tagName = element.tagName.toLowerCase();

if (tagName === 'input') {
Expand All @@ -224,17 +224,21 @@ export class SyntaxInterpreter {
return bindingMode.twoWay;
}

if (context && attrName in context.attributes) {
return context.attributes[attrName].defaultBindingMode || bindingMode.oneWay;
}

return bindingMode.oneWay;
}

bind(resources, element, info, existingInstruction) {
bind(resources, element, info, existingInstruction, context) {
let instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);

instruction.attributes[info.attrName] = new BindingExpression(
this.observerLocator,
this.attributeMap[info.attrName] || info.attrName,
this.parser.parse(info.attrValue),
info.defaultBindingMode || this.determineDefaultBindingMode(element, info.attrName),
info.defaultBindingMode || this.determineDefaultBindingMode(element, info.attrName, context),
resources.lookupFunctions
);

Expand Down Expand Up @@ -276,7 +280,7 @@ export class SyntaxInterpreter {
return instruction;
}

options(resources, element, info, existingInstruction) {
options(resources, element, info, existingInstruction, context) {
let instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);
let attrValue = info.attrValue;
let language = this.language;
Expand All @@ -291,7 +295,7 @@ export class SyntaxInterpreter {

if (current === ';') {
info = language.inspectAttribute(resources, name, target.trim());
language.createAttributeInstruction(resources, element, info, instruction);
language.createAttributeInstruction(resources, element, info, instruction, context);

if (!instruction.attributes[info.attrName]) {
instruction.attributes[info.attrName] = info.attrValue;
Expand All @@ -309,7 +313,7 @@ export class SyntaxInterpreter {

if (name !== null) {
info = language.inspectAttribute(resources, name, target.trim());
language.createAttributeInstruction(resources, element, info, instruction);
language.createAttributeInstruction(resources, element, info, instruction, context);

if (!instruction.attributes[info.attrName]) {
instruction.attributes[info.attrName] = info.attrValue;
Expand Down Expand Up @@ -463,7 +467,7 @@ export class TemplatingBindingLanguage extends BindingLanguage {
return info;
}

createAttributeInstruction(resources, element, theInfo, existingInstruction) {
createAttributeInstruction(resources, element, theInfo, existingInstruction, context) {
let instruction;

if (theInfo.expression) {
Expand All @@ -478,7 +482,8 @@ export class TemplatingBindingLanguage extends BindingLanguage {
resources,
element,
theInfo,
existingInstruction
existingInstruction,
context
);
}

Expand Down
28 changes: 16 additions & 12 deletions dist/commonjs/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,20 @@ var SyntaxInterpreter = (function () {
this.eventManager = eventManager;
}

SyntaxInterpreter.prototype.interpret = function interpret(resources, element, info, existingInstruction) {
SyntaxInterpreter.prototype.interpret = function interpret(resources, element, info, existingInstruction, context) {
if (info.command in this) {
return this[info.command](resources, element, info, existingInstruction);
return this[info.command](resources, element, info, existingInstruction, context);
}

return this.handleUnknownCommand(resources, element, info, existingInstruction);
return this.handleUnknownCommand(resources, element, info, existingInstruction, context);
};

SyntaxInterpreter.prototype.handleUnknownCommand = function handleUnknownCommand(resources, element, info, existingInstruction) {
SyntaxInterpreter.prototype.handleUnknownCommand = function handleUnknownCommand(resources, element, info, existingInstruction, context) {
LogManager.getLogger('templating-binding').warn('Unknown binding command.', info);
return existingInstruction;
};

SyntaxInterpreter.prototype.determineDefaultBindingMode = function determineDefaultBindingMode(element, attrName) {
SyntaxInterpreter.prototype.determineDefaultBindingMode = function determineDefaultBindingMode(element, attrName, context) {
var tagName = element.tagName.toLowerCase();

if (tagName === 'input') {
Expand All @@ -244,13 +244,17 @@ var SyntaxInterpreter = (function () {
return _aureliaBinding.bindingMode.twoWay;
}

if (context && attrName in context.attributes) {
return context.attributes[attrName].defaultBindingMode || _aureliaBinding.bindingMode.oneWay;
}

return _aureliaBinding.bindingMode.oneWay;
};

SyntaxInterpreter.prototype.bind = function bind(resources, element, info, existingInstruction) {
SyntaxInterpreter.prototype.bind = function bind(resources, element, info, existingInstruction, context) {
var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);

instruction.attributes[info.attrName] = new _aureliaBinding.BindingExpression(this.observerLocator, this.attributeMap[info.attrName] || info.attrName, this.parser.parse(info.attrValue), info.defaultBindingMode || this.determineDefaultBindingMode(element, info.attrName), resources.lookupFunctions);
instruction.attributes[info.attrName] = new _aureliaBinding.BindingExpression(this.observerLocator, this.attributeMap[info.attrName] || info.attrName, this.parser.parse(info.attrValue), info.defaultBindingMode || this.determineDefaultBindingMode(element, info.attrName, context), resources.lookupFunctions);

return instruction;
};
Expand All @@ -271,7 +275,7 @@ var SyntaxInterpreter = (function () {
return instruction;
};

SyntaxInterpreter.prototype.options = function options(resources, element, info, existingInstruction) {
SyntaxInterpreter.prototype.options = function options(resources, element, info, existingInstruction, context) {
var instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(info.attrName);
var attrValue = info.attrValue;
var language = this.language;
Expand All @@ -286,7 +290,7 @@ var SyntaxInterpreter = (function () {

if (current === ';') {
info = language.inspectAttribute(resources, name, target.trim());
language.createAttributeInstruction(resources, element, info, instruction);
language.createAttributeInstruction(resources, element, info, instruction, context);

if (!instruction.attributes[info.attrName]) {
instruction.attributes[info.attrName] = info.attrValue;
Expand All @@ -304,7 +308,7 @@ var SyntaxInterpreter = (function () {

if (name !== null) {
info = language.inspectAttribute(resources, name, target.trim());
language.createAttributeInstruction(resources, element, info, instruction);
language.createAttributeInstruction(resources, element, info, instruction, context);

if (!instruction.attributes[info.attrName]) {
instruction.attributes[info.attrName] = info.attrValue;
Expand Down Expand Up @@ -445,7 +449,7 @@ var TemplatingBindingLanguage = (function (_BindingLanguage) {
return info;
};

TemplatingBindingLanguage.prototype.createAttributeInstruction = function createAttributeInstruction(resources, element, theInfo, existingInstruction) {
TemplatingBindingLanguage.prototype.createAttributeInstruction = function createAttributeInstruction(resources, element, theInfo, existingInstruction, context) {
var instruction = undefined;

if (theInfo.expression) {
Expand All @@ -456,7 +460,7 @@ var TemplatingBindingLanguage = (function (_BindingLanguage) {
instruction = existingInstruction || _aureliaTemplating.BehaviorInstruction.attribute(theInfo.attrName);
instruction.attributes[theInfo.attrName] = theInfo.expression;
} else if (theInfo.command) {
instruction = this.syntaxInterpreter.interpret(resources, element, theInfo, existingInstruction);
instruction = this.syntaxInterpreter.interpret(resources, element, theInfo, existingInstruction, context);
}

return instruction;
Expand Down
29 changes: 17 additions & 12 deletions dist/es6/aurelia-templating-binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,20 @@ export class SyntaxInterpreter {
this.eventManager = eventManager;
}

interpret(resources, element, info, existingInstruction) {
interpret(resources, element, info, existingInstruction, context) {
if (info.command in this) {
return this[info.command](resources, element, info, existingInstruction);
return this[info.command](resources, element, info, existingInstruction, context);
}

return this.handleUnknownCommand(resources, element, info, existingInstruction);
return this.handleUnknownCommand(resources, element, info, existingInstruction, context);
}

handleUnknownCommand(resources, element, info, existingInstruction) {
handleUnknownCommand(resources, element, info, existingInstruction, context) {
LogManager.getLogger('templating-binding').warn('Unknown binding command.', info);
return existingInstruction;
}

determineDefaultBindingMode(element, attrName) {
determineDefaultBindingMode(element, attrName, context) {
let tagName = element.tagName.toLowerCase();

if (tagName === 'input') {
Expand All @@ -224,17 +224,21 @@ export class SyntaxInterpreter {
return bindingMode.twoWay;
}

if (context && attrName in context.attributes) {
return context.attributes[attrName].defaultBindingMode || bindingMode.oneWay;
}

return bindingMode.oneWay;
}

bind(resources, element, info, existingInstruction) {
bind(resources, element, info, existingInstruction, context) {
let instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);

instruction.attributes[info.attrName] = new BindingExpression(
this.observerLocator,
this.attributeMap[info.attrName] || info.attrName,
this.parser.parse(info.attrValue),
info.defaultBindingMode || this.determineDefaultBindingMode(element, info.attrName),
info.defaultBindingMode || this.determineDefaultBindingMode(element, info.attrName, context),
resources.lookupFunctions
);

Expand Down Expand Up @@ -276,7 +280,7 @@ export class SyntaxInterpreter {
return instruction;
}

options(resources, element, info, existingInstruction) {
options(resources, element, info, existingInstruction, context) {
let instruction = existingInstruction || BehaviorInstruction.attribute(info.attrName);
let attrValue = info.attrValue;
let language = this.language;
Expand All @@ -291,7 +295,7 @@ export class SyntaxInterpreter {

if (current === ';') {
info = language.inspectAttribute(resources, name, target.trim());
language.createAttributeInstruction(resources, element, info, instruction);
language.createAttributeInstruction(resources, element, info, instruction, context);

if (!instruction.attributes[info.attrName]) {
instruction.attributes[info.attrName] = info.attrValue;
Expand All @@ -309,7 +313,7 @@ export class SyntaxInterpreter {

if (name !== null) {
info = language.inspectAttribute(resources, name, target.trim());
language.createAttributeInstruction(resources, element, info, instruction);
language.createAttributeInstruction(resources, element, info, instruction, context);

if (!instruction.attributes[info.attrName]) {
instruction.attributes[info.attrName] = info.attrValue;
Expand Down Expand Up @@ -463,7 +467,7 @@ export class TemplatingBindingLanguage extends BindingLanguage {
return info;
}

createAttributeInstruction(resources, element, theInfo, existingInstruction) {
createAttributeInstruction(resources, element, theInfo, existingInstruction, context) {
let instruction;

if (theInfo.expression) {
Expand All @@ -478,7 +482,8 @@ export class TemplatingBindingLanguage extends BindingLanguage {
resources,
element,
theInfo,
existingInstruction
existingInstruction,
context
);
}

Expand Down
Loading

0 comments on commit 9f6b166

Please sign in to comment.