Skip to content

Commit

Permalink
update dev dependencies + remove node engine #10 + update .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusmaso committed May 24, 2017
1 parent fb32e19 commit 3b2a7b6
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- "5.9.0"
- "7.10.0"
before_install:
- npm install -g grunt-cli
46 changes: 23 additions & 23 deletions dist/handlebars.binding.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// handlebars.binding
// ------------------
// v0.3.6
// v0.3.7
//
// Copyright (c) 2013-2016 Mateus Maso
// Copyright (c) 2013-2017 Mateus Maso
// Distributed under MIT license
//
// http://github.com/mateusmaso/handlebars.binding
//


(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
Expand Down Expand Up @@ -151,7 +151,7 @@ var Binding = function () {
}, {
key: "render",
value: function render() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

this.runOutput();

Expand All @@ -166,7 +166,7 @@ var Binding = function () {
}, {
key: "renderAttribute",
value: function renderAttribute() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if (this.options.hash.attr == true) {
if (this.previousOutput != this.output) {
Expand All @@ -183,7 +183,7 @@ var Binding = function () {
}, {
key: "renderInline",
value: function renderInline() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if ((0, _deps.getUtils)().isString(this.output)) {
this.node.textContent = (0, _deps.getUtils)().escapeExpression(new _deps2.default.Handlebars.SafeString(this.output));
Expand All @@ -194,16 +194,16 @@ var Binding = function () {
}, {
key: "renderBlock",
value: function renderBlock() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if (options.initialize) {
return _deps2.default.Handlebars.parseHTML(this.output); // gambi
} else {
(0, _utils.removeBetween)(this.marker, this.delimiter).forEach(function (node) {
return (0, _core.unbind)(node);
});
(0, _deps.getUtils)().insertAfter(this.marker, _deps2.default.Handlebars.parseHTML(this.output));
}
(0, _utils.removeBetween)(this.marker, this.delimiter).forEach(function (node) {
return (0, _core.unbind)(node);
});
(0, _deps.getUtils)().insertAfter(this.marker, _deps2.default.Handlebars.parseHTML(this.output));
}
}
}, {
key: "observe",
Expand Down Expand Up @@ -281,14 +281,14 @@ var ItemBinding = function (_Binding) {
function ItemBinding() {
_classCallCheck(this, ItemBinding);

return _possibleConstructorReturn(this, Object.getPrototypeOf(ItemBinding).apply(this, arguments));
return _possibleConstructorReturn(this, (ItemBinding.__proto__ || Object.getPrototypeOf(ItemBinding)).apply(this, arguments));
}

_createClass(ItemBinding, [{
key: "initialize",
value: function initialize() {
if (this.options.hash.bind) {
return _get(Object.getPrototypeOf(ItemBinding.prototype), "initialize", this).call(this);
return _get(ItemBinding.prototype.__proto__ || Object.getPrototypeOf(ItemBinding.prototype), "initialize", this).call(this);
} else {
return this.runOutput();
}
Expand Down Expand Up @@ -334,7 +334,7 @@ var EachBinding = function (_Binding2) {
function EachBinding(context, keypath, value, options) {
_classCallCheck(this, EachBinding);

var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(EachBinding).call(this, context, keypath, value, options));
var _this3 = _possibleConstructorReturn(this, (EachBinding.__proto__ || Object.getPrototypeOf(EachBinding)).call(this, context, keypath, value, options));

_this3.itemBindings = [];
_this3.empty = value.length == 0;
Expand All @@ -346,7 +346,7 @@ var EachBinding = function (_Binding2) {
key: "initialize",
value: function initialize() {
if (this.options.hash.bind) {
return _get(Object.getPrototypeOf(EachBinding.prototype), "initialize", this).call(this);
return _get(EachBinding.prototype.__proto__ || Object.getPrototypeOf(EachBinding.prototype), "initialize", this).call(this);
} else {
return this.runOutput();
}
Expand Down Expand Up @@ -387,7 +387,7 @@ var EachBinding = function (_Binding2) {
}, {
key: "render",
value: function render() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if (options.splice) {
var splice = options.splice;
Expand All @@ -405,7 +405,7 @@ var EachBinding = function (_Binding2) {
}
}
} else {
return _get(Object.getPrototypeOf(EachBinding.prototype), "render", this).call(this, options);
return _get(EachBinding.prototype.__proto__ || Object.getPrototypeOf(EachBinding.prototype), "render", this).call(this, options);
}
}
}, {
Expand Down Expand Up @@ -479,7 +479,7 @@ var IfBinding = function (_Binding) {
function IfBinding(context, keypath, value, options) {
_classCallCheck(this, IfBinding);

var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(IfBinding).call(this, context, keypath, value, options));
var _this = _possibleConstructorReturn(this, (IfBinding.__proto__ || Object.getPrototypeOf(IfBinding)).call(this, context, keypath, value, options));

_this.falsy = (0, _utils.isFalsy)(value);
return _this;
Expand All @@ -489,7 +489,7 @@ var IfBinding = function (_Binding) {
key: "initialize",
value: function initialize() {
if (this.options.hash.bind) {
return _get(Object.getPrototypeOf(IfBinding.prototype), "initialize", this).call(this);
return _get(IfBinding.prototype.__proto__ || Object.getPrototypeOf(IfBinding.prototype), "initialize", this).call(this);
} else {
return this.runOutput();
}
Expand Down Expand Up @@ -530,7 +530,7 @@ var IfBinding = function (_Binding) {
}, {
key: "renderAttribute",
value: function renderAttribute() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if (this.options.hash.attr == true) {
this.node.removeAttribute(this.previousOutput);
Expand Down Expand Up @@ -654,8 +654,8 @@ function register() {
});

_deps2.default.Handlebars.registerHelper("unless", function (conditional, options) {
var fn = options.fn;
var inverse = options.inverse;
var fn = options.fn,
inverse = options.inverse;

var thenHash = options.hash.then;
var elseHash = options.hash.else;
Expand Down
9 changes: 4 additions & 5 deletions dist/handlebars.binding.min.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions lib/bindings/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ var Binding = function () {
}, {
key: "render",
value: function render() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

this.runOutput();

Expand All @@ -155,7 +155,7 @@ var Binding = function () {
}, {
key: "renderAttribute",
value: function renderAttribute() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if (this.options.hash.attr == true) {
if (this.previousOutput != this.output) {
Expand All @@ -172,7 +172,7 @@ var Binding = function () {
}, {
key: "renderInline",
value: function renderInline() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if ((0, _deps.getUtils)().isString(this.output)) {
this.node.textContent = (0, _deps.getUtils)().escapeExpression(new _deps2.default.Handlebars.SafeString(this.output));
Expand All @@ -183,16 +183,16 @@ var Binding = function () {
}, {
key: "renderBlock",
value: function renderBlock() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if (options.initialize) {
return _deps2.default.Handlebars.parseHTML(this.output); // gambi
} else {
(0, _utils.removeBetween)(this.marker, this.delimiter).forEach(function (node) {
return (0, _core.unbind)(node);
});
(0, _deps.getUtils)().insertAfter(this.marker, _deps2.default.Handlebars.parseHTML(this.output));
}
(0, _utils.removeBetween)(this.marker, this.delimiter).forEach(function (node) {
return (0, _core.unbind)(node);
});
(0, _deps.getUtils)().insertAfter(this.marker, _deps2.default.Handlebars.parseHTML(this.output));
}
}
}, {
key: "observe",
Expand Down
12 changes: 6 additions & 6 deletions lib/bindings/each_binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ var ItemBinding = function (_Binding) {
function ItemBinding() {
_classCallCheck(this, ItemBinding);

return _possibleConstructorReturn(this, Object.getPrototypeOf(ItemBinding).apply(this, arguments));
return _possibleConstructorReturn(this, (ItemBinding.__proto__ || Object.getPrototypeOf(ItemBinding)).apply(this, arguments));
}

_createClass(ItemBinding, [{
key: "initialize",
value: function initialize() {
if (this.options.hash.bind) {
return _get(Object.getPrototypeOf(ItemBinding.prototype), "initialize", this).call(this);
return _get(ItemBinding.prototype.__proto__ || Object.getPrototypeOf(ItemBinding.prototype), "initialize", this).call(this);
} else {
return this.runOutput();
}
Expand Down Expand Up @@ -89,7 +89,7 @@ var EachBinding = function (_Binding2) {
function EachBinding(context, keypath, value, options) {
_classCallCheck(this, EachBinding);

var _this3 = _possibleConstructorReturn(this, Object.getPrototypeOf(EachBinding).call(this, context, keypath, value, options));
var _this3 = _possibleConstructorReturn(this, (EachBinding.__proto__ || Object.getPrototypeOf(EachBinding)).call(this, context, keypath, value, options));

_this3.itemBindings = [];
_this3.empty = value.length == 0;
Expand All @@ -101,7 +101,7 @@ var EachBinding = function (_Binding2) {
key: "initialize",
value: function initialize() {
if (this.options.hash.bind) {
return _get(Object.getPrototypeOf(EachBinding.prototype), "initialize", this).call(this);
return _get(EachBinding.prototype.__proto__ || Object.getPrototypeOf(EachBinding.prototype), "initialize", this).call(this);
} else {
return this.runOutput();
}
Expand Down Expand Up @@ -142,7 +142,7 @@ var EachBinding = function (_Binding2) {
}, {
key: "render",
value: function render() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if (options.splice) {
var splice = options.splice;
Expand All @@ -160,7 +160,7 @@ var EachBinding = function (_Binding2) {
}
}
} else {
return _get(Object.getPrototypeOf(EachBinding.prototype), "render", this).call(this, options);
return _get(EachBinding.prototype.__proto__ || Object.getPrototypeOf(EachBinding.prototype), "render", this).call(this, options);
}
}
}, {
Expand Down
6 changes: 3 additions & 3 deletions lib/bindings/if_binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var IfBinding = function (_Binding) {
function IfBinding(context, keypath, value, options) {
_classCallCheck(this, IfBinding);

var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(IfBinding).call(this, context, keypath, value, options));
var _this = _possibleConstructorReturn(this, (IfBinding.__proto__ || Object.getPrototypeOf(IfBinding)).call(this, context, keypath, value, options));

_this.falsy = (0, _utils.isFalsy)(value);
return _this;
Expand All @@ -44,7 +44,7 @@ var IfBinding = function (_Binding) {
key: "initialize",
value: function initialize() {
if (this.options.hash.bind) {
return _get(Object.getPrototypeOf(IfBinding.prototype), "initialize", this).call(this);
return _get(IfBinding.prototype.__proto__ || Object.getPrototypeOf(IfBinding.prototype), "initialize", this).call(this);
} else {
return this.runOutput();
}
Expand Down Expand Up @@ -85,7 +85,7 @@ var IfBinding = function (_Binding) {
}, {
key: "renderAttribute",
value: function renderAttribute() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};

if (this.options.hash.attr == true) {
this.node.removeAttribute(this.previousOutput);
Expand Down
4 changes: 2 additions & 2 deletions lib/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ function register() {
});

_deps2.default.Handlebars.registerHelper("unless", function (conditional, options) {
var fn = options.fn;
var inverse = options.inverse;
var fn = options.fn,
inverse = options.inverse;

var thenHash = options.hash.then;
var elseHash = options.hash.else;
Expand Down
32 changes: 13 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
{
"name": "handlebars.binding",
"description": "Handlebars plugin for using one-way data binding",
"version": "0.3.6",
"version": "0.3.7",
"author": "mateusmaso",
"license": "MIT",
"keywords": [
"handlebars",
"data binding"
],
"devDependencies": {
"babel-preset-es2015": "^6.24.1",
"babelify": "^7.3.0",
"chai": "*",
"mocha": "*",
"grunt": "~0.4.5",
"grunt": "^1.0.1",
"grunt-babel": "^6.0.0",
"grunt-browserify": "~4.0.1",
"grunt-contrib-uglify": "~0.5.0",
"grunt-mocha-test": "~0.11.0",
"grunt-mocha-phantomjs": "~3.0.0",
"babel-preset-es2015": "^6.5.0",
"babelify": "^7.2.0",
"jsdom": "^9.1.0",
"handlebars": "~4.0.5"
},
"repository": {
"type": "git",
"url": "http://github.com/mateusmaso/handlebars.binding"
"grunt-browserify": "^5.0.0",
"grunt-contrib-uglify": "^3.0.1",
"grunt-mocha-phantomjs": "^4.0.0",
"grunt-mocha-test": "^0.13.2",
"handlebars": "^4.0.10",
"jsdom": "^11.0.0",
"mocha": "*"
},
"repository": "http://github.com/mateusmaso/handlebars.binding",
"dependencies": {
"handlebars.element": "~0.3.4",
"handlebars.element": "~0.3.5",
"observe-js": "~0.5.7"
},
"scripts": {
"test": "grunt mochaTest mocha_phantomjs"
},
"engines": {
"node" : ">=4"
},
"main": "lib/index.js"
}
5 changes: 3 additions & 2 deletions spec/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
if (typeof window === "undefined") {
var jsdom = require("jsdom").jsdom;
var document = global.document = jsdom("test");
var JSDOM = require("jsdom").JSDOM;
var dom = new JSDOM("test");
var document = global.document = dom.window.document;
var window = global.window = document.defaultView;
var chai = require("chai");
var Handlebars = require("handlebars");
Expand Down

0 comments on commit 3b2a7b6

Please sign in to comment.