Skip to content

Commit

Permalink
Commit 77 (v0.9.77 - Beta)
Browse files Browse the repository at this point in the history
- Several minor bug fixes
  • Loading branch information
BorisMoore committed Jun 16, 2016
1 parent 0b9c01a commit f4b56e1
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Alternatively:
- It can be installed with ***[Bower](http://bower.io/search/?q=jsrender)***, using `$ bower install jsrender`
- It can be loaded using an *AMD script loader*, such as RequireJS
- For installation using *Node.js* (*npm*) see *[JsRender Node.js Quickstart](http://www.jsviews.com/#jsr-node-quickstart)*
- (For browser loading using *Browserify* or *webpack* -- see also *[JsRender Node.js Quickstart](http://www.jsviews.com/#jsr-node-quickstart)*)
- (For browser loading using *Browserify* or *webpack* -- see *[JsRender Node.js Quickstart](http://www.jsviews.com/#jsr-node-quickstart)*, *[JsRender as a Browserify module](http://www.jsviews.com/#node/browserify@jsrender)* and *[JsRender as a webpack module](http://www.jsviews.com/#node/webpack@jsrender)*)

<h4><b>Using JsRender with jQuery</b></h4>
When jQuery is present, JsRender loads as a jQuery plugin and adds `$.views`, `$.templates` and `$.render` to the jQuery namespace object, `$` (or `window.jQuery`).
Expand Down
10 changes: 5 additions & 5 deletions jsrender-node.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! JsRender v0.9.76 (Beta): http://jsviews.com/#jsrender */
/*! JsRender v0.9.77 (Beta): http://jsviews.com/#jsrender */
/*! **VERSION FOR NODE.JS** (For WEB see http://jsviews.com/download/jsrender.js) */
/*
* Best-of-breed templating in browser or on Node.js.
Expand All @@ -19,7 +19,7 @@ if (typeof exports !== 'object' ) {

//========================== Top-level vars ==========================

var versionNumber = "v0.9.76",
var versionNumber = "v0.9.77",

// global var is the this object, which is window when running in the usual browser environment

Expand Down Expand Up @@ -387,10 +387,10 @@ function convertVal(converter, view, tagCtx, onError) {

tagCtx.view = view;

tag.ctx = tagCtx.ctx || {};
tag.ctx = tagCtx.ctx || tag.ctx || {};
tagCtx.ctx = undefined;

value = tag.cvtArgs(tag.convert || converter !== "true" && converter)[0]; // If there is a convertBack but no convert, converter will be "true"
value = tag.cvtArgs(converter !== "true" && converter)[0]; // If there is a convertBack but no convert, converter will be "true"

// Call onRender (used by JsViews if present, to add binding annotations around rendered content)
value = boundTag && view._.onRender
Expand All @@ -406,7 +406,7 @@ function convertArgs(converter) {
view = tagCtx.view,
args = tagCtx.args;

converter = tag.convert || converter;
converter = converter || tag.convert;
converter = converter && ("" + converter === converter
? (view.getRsc("converters", converter) || error("Unknown converter: '" + converter + "'"))
: converter);
Expand Down
10 changes: 5 additions & 5 deletions jsrender.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! JsRender v0.9.76 (Beta): http://jsviews.com/#jsrender */
/*! JsRender v0.9.77 (Beta): http://jsviews.com/#jsrender */
/*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */
/*
* Best-of-breed templating in browser or on Node.js.
Expand Down Expand Up @@ -44,7 +44,7 @@ var setGlobals = $ === false; // Only set globals if script block in browser (no

$ = $ && $.fn ? $ : global.jQuery; // $ is jQuery passed in by CommonJS loader (Browserify), or global jQuery.

var versionNumber = "v0.9.76",
var versionNumber = "v0.9.77",
jsvStoreName, rTag, rTmplString, topView, $views,

//TODO tmplFnsCache = {},
Expand Down Expand Up @@ -412,10 +412,10 @@ function convertVal(converter, view, tagCtx, onError) {

tagCtx.view = view;

tag.ctx = tagCtx.ctx || {};
tag.ctx = tagCtx.ctx || tag.ctx || {};
tagCtx.ctx = undefined;

value = tag.cvtArgs(tag.convert || converter !== "true" && converter)[0]; // If there is a convertBack but no convert, converter will be "true"
value = tag.cvtArgs(converter !== "true" && converter)[0]; // If there is a convertBack but no convert, converter will be "true"

// Call onRender (used by JsViews if present, to add binding annotations around rendered content)
value = boundTag && view._.onRender
Expand All @@ -431,7 +431,7 @@ function convertArgs(converter) {
view = tagCtx.view,
args = tagCtx.args;

converter = tag.convert || converter;
converter = converter || tag.convert;
converter = converter && ("" + converter === converter
? (view.getRsc("converters", converter) || error("Unknown converter: '" + converter + "'"))
: converter);
Expand Down
4 changes: 2 additions & 2 deletions jsrender.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jsrender.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsrender",
"version": "v0.9.76",
"version": "v0.9.77",
"description": "Best-of-breed templating in browser or on Node.js (with Express 4, Hapi and Browserify integration)",
"main": "./jsrender-node.js",
"browser": "./jsrender.js",
Expand Down
12 changes: 6 additions & 6 deletions test/browserify/bundles/1-bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions test/browserify/bundles/12-nested-bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions test/browserify/bundles/2-bundle.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions test/browserify/bundles/3-bundle.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions test/browserify/bundles/htm-jsrender-tmpl-bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(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){
/*! JsRender v0.9.76 (Beta): http://jsviews.com/#jsrender */
/*! JsRender v0.9.77 (Beta): http://jsviews.com/#jsrender */
/*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */
/*
* Best-of-breed templating in browser or on Node.js.
Expand Down Expand Up @@ -45,7 +45,7 @@ var setGlobals = $ === false; // Only set globals if script block in browser (no

$ = $ && $.fn ? $ : global.jQuery; // $ is jQuery passed in by CommonJS loader (Browserify), or global jQuery.

var versionNumber = "v0.9.76",
var versionNumber = "v0.9.77",
jsvStoreName, rTag, rTmplString, topView, $views,

//TODO tmplFnsCache = {},
Expand Down Expand Up @@ -413,10 +413,10 @@ function convertVal(converter, view, tagCtx, onError) {

tagCtx.view = view;

tag.ctx = tagCtx.ctx || {};
tag.ctx = tagCtx.ctx || tag.ctx || {};
tagCtx.ctx = undefined;

value = tag.cvtArgs(tag.convert || converter !== "true" && converter)[0]; // If there is a convertBack but no convert, converter will be "true"
value = tag.cvtArgs(converter !== "true" && converter)[0]; // If there is a convertBack but no convert, converter will be "true"

// Call onRender (used by JsViews if present, to add binding annotations around rendered content)
value = boundTag && view._.onRender
Expand All @@ -432,7 +432,7 @@ function convertArgs(converter) {
view = tagCtx.view,
args = tagCtx.args;

converter = tag.convert || converter;
converter = converter || tag.convert;
converter = converter && ("" + converter === converter
? (view.getRsc("converters", converter) || error("Unknown converter: '" + converter + "'"))
: converter);
Expand Down
10 changes: 5 additions & 5 deletions test/browserify/bundles/html-jsr-tmpl-bundle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(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){
/*! JsRender v0.9.76 (Beta): http://jsviews.com/#jsrender */
/*! JsRender v0.9.77 (Beta): http://jsviews.com/#jsrender */
/*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */
/*
* Best-of-breed templating in browser or on Node.js.
Expand Down Expand Up @@ -45,7 +45,7 @@ var setGlobals = $ === false; // Only set globals if script block in browser (no

$ = $ && $.fn ? $ : global.jQuery; // $ is jQuery passed in by CommonJS loader (Browserify), or global jQuery.

var versionNumber = "v0.9.76",
var versionNumber = "v0.9.77",
jsvStoreName, rTag, rTmplString, topView, $views,

//TODO tmplFnsCache = {},
Expand Down Expand Up @@ -413,10 +413,10 @@ function convertVal(converter, view, tagCtx, onError) {

tagCtx.view = view;

tag.ctx = tagCtx.ctx || {};
tag.ctx = tagCtx.ctx || tag.ctx || {};
tagCtx.ctx = undefined;

value = tag.cvtArgs(tag.convert || converter !== "true" && converter)[0]; // If there is a convertBack but no convert, converter will be "true"
value = tag.cvtArgs(converter !== "true" && converter)[0]; // If there is a convertBack but no convert, converter will be "true"

// Call onRender (used by JsViews if present, to add binding annotations around rendered content)
value = boundTag && view._.onRender
Expand All @@ -432,7 +432,7 @@ function convertArgs(converter) {
view = tagCtx.view,
args = tagCtx.args;

converter = tag.convert || converter;
converter = converter || tag.convert;
converter = converter && ("" + converter === converter
? (view.getRsc("converters", converter) || error("Unknown converter: '" + converter + "'"))
: converter);
Expand Down
2 changes: 1 addition & 1 deletion test/unit-tests/tests-jsrender-no-jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ test("{{sometag convert=converter}}", function() {

equal($.templates("1{{:#data convert='loc'}} 2{{:'desktop' convert='loc'}} 3{{:#data convert=~myloc}} 4{{:'desktop' convert=~myloc}}").render("desktop", {myloc: loc}), "1bureau 2bureau 3bureau 4bureau", "{{: convert=~myconverter}}");
equal($.templates("1:{{:'a<b' convert=~myloc}} 2:{{> 'a<b'}} 3:{{html: 'a<b' convert=~myloc}} 4:{{> 'a<b' convert=~myloc}} 5:{{attr: 'a<b' convert=~myloc}}").render(1, {myloc: loc}),
"1:a moins <que b 2:a&lt;b 3:a&lt;b 4:a&lt;b 5:a moins <que b",
"1:a moins <que b 2:a&lt;b 3:a&lt;b 4:a&lt;b 5:a&lt;b",
"{{foo: convert=~myconverter}} convert=converter is used rather than {{foo:, but with {{html: convert=~myconverter}}" +
"\nor {{> convert=~myconverter}} html converter takes precedence and ~myconverter is ignored");
equal($.templates("{{if true convert=~invert}}yes{{else false convert=~invert}}no{{else}}neither{{/if}}").render('desktop', {invert: function(val) {return !val;}}), "no", "{{if expression convert=~myconverter}}...{{else expression2 convert=~myconverter}}... ");
Expand Down

0 comments on commit f4b56e1

Please sign in to comment.