Skip to content

Commit

Permalink
chore(all): prepare release 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 22, 2015
1 parent f8927df commit 0ba93a7
Show file tree
Hide file tree
Showing 14 changed files with 158 additions and 90 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": "0.7.2",
"version": "0.8.0",
"description": "An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.",
"keywords": [
"aurelia",
Expand Down
28 changes: 15 additions & 13 deletions dist/amd/binding-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ define(["exports", "aurelia-templating", "aurelia-binding", "./syntax-interprete
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

var _inherits = function (child, parent) {
if (typeof parent !== "function" && parent !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof parent);
var _inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
child.prototype = Object.create(parent && parent.prototype, {
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: child,
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (parent) child.__proto__ = parent;
if (superClass) subClass.__proto__ = superClass;
};

var BindingLanguage = _aureliaTemplating.BindingLanguage;
Expand All @@ -33,7 +33,7 @@ define(["exports", "aurelia-templating", "aurelia-binding", "./syntax-interprete
var info = {};

var TemplatingBindingLanguage = (function (BindingLanguage) {
var TemplatingBindingLanguage = function TemplatingBindingLanguage(parser, observerLocator, syntaxInterpreter) {
function TemplatingBindingLanguage(parser, observerLocator, syntaxInterpreter) {
this.parser = parser;
this.observerLocator = observerLocator;
this.syntaxInterpreter = syntaxInterpreter;
Expand All @@ -43,13 +43,13 @@ define(["exports", "aurelia-templating", "aurelia-binding", "./syntax-interprete
"class": "className",
"for": "htmlFor"
};
};
}

_inherits(TemplatingBindingLanguage, BindingLanguage);

_prototypeProperties(TemplatingBindingLanguage, {
inject: {
value: function () {
value: function inject() {
return [Parser, ObserverLocator, SyntaxInterpreter];
},
writable: true,
Expand All @@ -58,9 +58,11 @@ define(["exports", "aurelia-templating", "aurelia-binding", "./syntax-interprete
}
}, {
inspectAttribute: {
value: function (resources, attrName, attrValue) {
value: function inspectAttribute(resources, attrName, attrValue) {
var parts = attrName.split(".");

info.defaultBindingMode = null;

if (parts.length == 2) {
info.attrName = parts[0].trim();
info.attrValue = attrValue;
Expand All @@ -85,7 +87,7 @@ define(["exports", "aurelia-templating", "aurelia-binding", "./syntax-interprete
configurable: true
},
createAttributeInstruction: {
value: function (resources, element, info, existingInstruction) {
value: function createAttributeInstruction(resources, element, info, existingInstruction) {
var instruction;

if (info.expression) {
Expand All @@ -106,15 +108,15 @@ define(["exports", "aurelia-templating", "aurelia-binding", "./syntax-interprete
configurable: true
},
parseText: {
value: function (resources, value) {
value: function parseText(resources, value) {
return this.parseContent(resources, "textContent", value);
},
writable: true,
enumerable: true,
configurable: true
},
parseContent: {
value: function (resources, attrName, attrValue) {
value: function parseContent(resources, attrName, attrValue) {
var expressionText, expression;

var parts = attrValue.split(this.interpolationRegex);
Expand Down
3 changes: 2 additions & 1 deletion dist/amd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ define(["exports", "aurelia-templating", "./binding-language", "./syntax-interpr


function install(aurelia) {
var instance, getInstance = function (c) {
var instance,
getInstance = function (c) {
return instance || (instance = c.invoke(TemplatingBindingLanguage));
};

Expand Down
38 changes: 24 additions & 14 deletions dist/amd/syntax-interpreter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ define(["exports", "aurelia-binding"], function (exports, _aureliaBinding) {
var TWO_WAY = _aureliaBinding.TWO_WAY;
var ONE_TIME = _aureliaBinding.ONE_TIME;
var SyntaxInterpreter = (function () {
var SyntaxInterpreter = function SyntaxInterpreter(parser, observerLocator, eventManager) {
function SyntaxInterpreter(parser, observerLocator, eventManager) {
this.parser = parser;
this.observerLocator = observerLocator;
this.eventManager = eventManager;
};
}

_prototypeProperties(SyntaxInterpreter, {
inject: {
value: function () {
value: function inject() {
return [Parser, ObserverLocator, EventManager];
},
writable: true,
Expand All @@ -34,7 +34,7 @@ define(["exports", "aurelia-binding"], function (exports, _aureliaBinding) {
}
}, {
interpret: {
value: function (resources, element, info, existingInstruction) {
value: function interpret(resources, element, info, existingInstruction) {
if (info.command in this) {
return this[info.command](resources, element, info, existingInstruction);
}
Expand All @@ -46,15 +46,25 @@ define(["exports", "aurelia-binding"], function (exports, _aureliaBinding) {
configurable: true
},
handleUnknownCommand: {
value: function (resources, element, info, existingInstruction) {
throw new Error("Unknown binding command ${info.command} used.");
value: function handleUnknownCommand(resources, element, info, existingInstruction) {
var attrName = info.attrName,
command = info.command;

var instruction = this.options(resources, element, info, existingInstruction);

instruction.alteredAttr = true;
instruction.attrName = "global-behavior";
instruction.attributes.aureliaAttrName = attrName;
instruction.attributes.aureliaCommand = command;

return instruction;
},
writable: true,
enumerable: true,
configurable: true
},
determineDefaultBindingMode: {
value: function (element, attrName) {
value: function determineDefaultBindingMode(element, attrName) {
var tagName = element.tagName.toLowerCase();

if (tagName === "input") {
Expand All @@ -70,10 +80,10 @@ define(["exports", "aurelia-binding"], function (exports, _aureliaBinding) {
configurable: true
},
bind: {
value: function (resources, element, info, existingInstruction) {
value: function bind(resources, element, info, existingInstruction) {
var instruction = existingInstruction || { attrName: info.attrName, attributes: {} };

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

return instruction;
},
Expand All @@ -82,23 +92,23 @@ define(["exports", "aurelia-binding"], function (exports, _aureliaBinding) {
configurable: true
},
trigger: {
value: function (resources, element, info) {
value: function trigger(resources, element, info) {
return new ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), false, true);
},
writable: true,
enumerable: true,
configurable: true
},
delegate: {
value: function (resources, element, info) {
value: function delegate(resources, element, info) {
return new ListenerExpression(this.eventManager, info.attrName, this.parser.parse(info.attrValue), true, true);
},
writable: true,
enumerable: true,
configurable: true
},
call: {
value: function (resources, element, info, existingInstruction) {
value: function call(resources, element, info, existingInstruction) {
var instruction = existingInstruction || { attrName: info.attrName, attributes: {} };

instruction.attributes[info.attrName] = new CallExpression(this.observerLocator, info.attrName, this.parser.parse(info.attrValue), resources.valueConverterLookupFunction);
Expand All @@ -110,8 +120,8 @@ define(["exports", "aurelia-binding"], function (exports, _aureliaBinding) {
configurable: true
},
options: {
value: function (resources, element, info) {
var instruction = { attrName: info.attrName, attributes: {} },
value: function options(resources, element, info, existingInstruction) {
var instruction = existingInstruction || { attrName: info.attrName, attributes: {} },
attrValue = info.attrValue,
language = this.language,
name = null,
Expand Down
28 changes: 15 additions & 13 deletions dist/commonjs/binding-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ var _prototypeProperties = function (child, staticProps, instanceProps) {
if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
};

var _inherits = function (child, parent) {
if (typeof parent !== "function" && parent !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof parent);
var _inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
}
child.prototype = Object.create(parent && parent.prototype, {
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: child,
value: subClass,
enumerable: false,
writable: true,
configurable: true
}
});
if (parent) child.__proto__ = parent;
if (superClass) subClass.__proto__ = superClass;
};

var BindingLanguage = require("aurelia-templating").BindingLanguage;
Expand All @@ -32,7 +32,7 @@ var SyntaxInterpreter = require("./syntax-interpreter").SyntaxInterpreter;
var info = {};

var TemplatingBindingLanguage = (function (BindingLanguage) {
var TemplatingBindingLanguage = function TemplatingBindingLanguage(parser, observerLocator, syntaxInterpreter) {
function TemplatingBindingLanguage(parser, observerLocator, syntaxInterpreter) {
this.parser = parser;
this.observerLocator = observerLocator;
this.syntaxInterpreter = syntaxInterpreter;
Expand All @@ -42,13 +42,13 @@ var TemplatingBindingLanguage = (function (BindingLanguage) {
"class": "className",
"for": "htmlFor"
};
};
}

_inherits(TemplatingBindingLanguage, BindingLanguage);

_prototypeProperties(TemplatingBindingLanguage, {
inject: {
value: function () {
value: function inject() {
return [Parser, ObserverLocator, SyntaxInterpreter];
},
writable: true,
Expand All @@ -57,9 +57,11 @@ var TemplatingBindingLanguage = (function (BindingLanguage) {
}
}, {
inspectAttribute: {
value: function (resources, attrName, attrValue) {
value: function inspectAttribute(resources, attrName, attrValue) {
var parts = attrName.split(".");

info.defaultBindingMode = null;

if (parts.length == 2) {
info.attrName = parts[0].trim();
info.attrValue = attrValue;
Expand All @@ -84,7 +86,7 @@ var TemplatingBindingLanguage = (function (BindingLanguage) {
configurable: true
},
createAttributeInstruction: {
value: function (resources, element, info, existingInstruction) {
value: function createAttributeInstruction(resources, element, info, existingInstruction) {
var instruction;

if (info.expression) {
Expand All @@ -105,15 +107,15 @@ var TemplatingBindingLanguage = (function (BindingLanguage) {
configurable: true
},
parseText: {
value: function (resources, value) {
value: function parseText(resources, value) {
return this.parseContent(resources, "textContent", value);
},
writable: true,
enumerable: true,
configurable: true
},
parseContent: {
value: function (resources, attrName, attrValue) {
value: function parseContent(resources, attrName, attrValue) {
var expressionText, expression;

var parts = attrValue.split(this.interpolationRegex);
Expand Down
3 changes: 2 additions & 1 deletion dist/commonjs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ var SyntaxInterpreter = require("./syntax-interpreter").SyntaxInterpreter;


function install(aurelia) {
var instance, getInstance = function (c) {
var instance,
getInstance = function (c) {
return instance || (instance = c.invoke(TemplatingBindingLanguage));
};

Expand Down
Loading

0 comments on commit 0ba93a7

Please sign in to comment.