Skip to content

Commit 2e00b5a

Browse files
committed
Commit 73 (v0.9.73 - Beta)
Minor update: no important changes or bug fixes - Updated copyright and updated links to latest jQuery, QUnit etc. - Some documentation improvements New documentation topic on JsViews view object, and methods: http://www.jsviews.com/#jsvviewobject - view.refresh() - view.contents() - view.nodes() - view.childTags()
1 parent 0072edc commit 2e00b5a

28 files changed

+239
-151
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
The content of this ***ReadMe*** is available also as a *[JsViews Quickstart](http://www.jsviews.com/#jsv-quickstart)*.
1010

11-
<h3>Installation</h3>
11+
<h2>JsViews Installation</h2>
1212

1313
jsviews.js is available from [downloads](http://www.jsviews.com/#download) on the jsviews.com site.
1414

@@ -19,6 +19,8 @@ Alternatively:
1919
- It can be loaded using an AMD script loader, such as RequireJS
2020
- For installation using *Node.js* (*npm*) -- and browser loading using *Browserify* -- see *[JsRender Node.js Quickstart](http://www.jsviews.com/#jsr-node-quickstart)*
2121

22+
*Example HTML page:* [Loading JsViews](http://www.jsviews.com/#download/pages-jsv)
23+
2224
<h3>JsRender and JsViews</h3>
2325
**JsRender** is used for data-driven rendering of templates to strings, ready for insertion in the DOM. (See *[JsRender Quickstart](http://www.jsviews.com/#jsr-quickstart)* and [JsRender GitHub repository](https://github.com/BorisMoore/jsrender)).
2426

@@ -240,7 +242,6 @@ $(".changeBtn").on("click", function() {
240242

241243
[Learn more...](http://www.jsviews.com/#$view)
242244

243-
244245
<h3><i>Data-linked paths</i></h3>
245246

246247
JsViews data-linked templates (and the `$.observe()` API) use the same [paths and expressions](http://www.jsviews.com/#paths) as JsRender templates, but in addition provide *'leaf'* data-binding -- such as:

jquery.observable.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/*! JsObservable v0.9.72 (Beta): http://jsviews.com/#jsobservable */
1+
/*! JsObservable v0.9.73 (Beta): http://jsviews.com/#jsobservable */
22
/*
33
* Subcomponent of JsViews
44
* Data change events for data-linking
55
*
6-
* Copyright 2015, Boris Moore
6+
* Copyright 2016, Boris Moore
77
* Released under the MIT License.
88
*/
99

@@ -44,7 +44,7 @@ if (!$ || !$.fn) {
4444
throw "JsObservable requires jQuery"; // We require jQuery
4545
}
4646

47-
var versionNumber = "v0.9.72",
47+
var versionNumber = "v0.9.73",
4848
$observe, $observable,
4949

5050
$views = $.views =

jquery.observable.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery.observable.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery.views.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! jquery.views.js v0.9.72 (Beta): http://jsviews.com/ */
1+
/*! jquery.views.js v0.9.73 (Beta): http://jsviews.com/ */
22
/*
33
* Interactive data-driven views using JsRender templates.
44
* Subcomponent of JsViews
@@ -7,7 +7,7 @@
77
* Also requires jquery.observable.js
88
* See JsObservable at http://jsviews.com/#download and http://github.com/BorisMoore/jsviews
99
*
10-
* Copyright 2015, Boris Moore
10+
* Copyright 2016, Boris Moore
1111
* Released under the MIT License.
1212
*/
1313

@@ -44,7 +44,7 @@ var global = (0, eval)('this'), // jshint ignore:line
4444
jsr = jsr || setGlobals && global.jsrender;
4545
$ = $ || global.jQuery;
4646

47-
var versionNumber = "v0.9.72",
47+
var versionNumber = "v0.9.73",
4848
requiresStr = "JsViews requires ";
4949

5050
if (!$ || !$.fn) {
@@ -2267,7 +2267,7 @@ function addLinkMethods(tagOrView, isTag) {
22672267
tagOrView.contents = function(deep, select) {
22682268
// For a view or a tag, return jQuery object with the content nodes,
22692269
if (deep !== !!deep) {
2270-
// deep not boolean, so this is getContents(selector)
2270+
// deep not boolean, so this is contents(selector)
22712271
select = deep;
22722272
deep = undefined;
22732273
}
@@ -2374,6 +2374,7 @@ function addLinkMethods(tagOrView, isTag) {
23742374
};
23752375

23762376
if (isTag) {
2377+
// This is a TAG
23772378
tagOrView.domChange = function() { // domChange notification support
23782379
var elem = this.parentElem,
23792380
hasListener = $.hasData(elem) && $._data(elem).events,
@@ -2385,7 +2386,8 @@ function addLinkMethods(tagOrView, isTag) {
23852386
}
23862387
};
23872388
} else {
2388-
// Note: a linked view will also, after linking have nodes[], _prv (prevNode), _nxt (nextNode) ...
2389+
// This is a VIEW
2390+
// Note: a linked view will also, after linking have nodes[], _prv (prevNode), _nxt (nextNode) ...
23892391
tagOrView.addViews = function(index, dataItems, tmpl) {
23902392
// if view is not an array view, do nothing
23912393
var i, viewsCount,
@@ -2511,12 +2513,12 @@ function addLinkMethods(tagOrView, isTag) {
25112513
return this;
25122514
};
25132515

2514-
tagOrView.refresh = function(context) {
2516+
tagOrView.refresh = function() {
25152517
var self = this,
25162518
parent = self.parent;
25172519

25182520
if (parent) {
2519-
renderAndLink(self, self.index, self.tmpl, parent.views, self.data, context, true);
2521+
renderAndLink(self, self.index, self.tmpl, parent.views, self.data, undefined, true);
25202522
setArrayChangeLink(self);
25212523
}
25222524
return self;

jquery.views.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery.views.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsrender.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
/*! JsRender v0.9.72 (Beta): http://jsviews.com/#jsrender */
1+
/*! JsRender v0.9.73 (Beta): http://jsviews.com/#jsrender */
22
/*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */
33
/*
44
* Best-of-breed templating in browser or on Node.js.
55
* Does not require jQuery, or HTML DOM
66
* Integrates with JsViews (http://jsviews.com/#jsviews)
77
*
8-
* Copyright 2015, Boris Moore
8+
* Copyright 2016, Boris Moore
99
* Released under the MIT License.
1010
*/
1111

@@ -32,7 +32,7 @@
3232
}
3333
} (
3434

35-
// factory (for jquery.views.js)
35+
// factory (for jsrender.js)
3636
function($) {
3737
"use strict";
3838

@@ -44,7 +44,7 @@ var global = (0, eval)('this'), // jshint ignore:line
4444

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

47-
var versionNumber = "v0.9.72",
47+
var versionNumber = "v0.9.73",
4848
jsvStoreName, rTag, rTmplString, topView, $views,
4949

5050
//TODO tmplFnsCache = {},
@@ -235,10 +235,10 @@ function $viewsDelimiters(openChars, closeChars, link) {
235235
// make rTag available to JsViews (or other components) for parsing binding expressions
236236
$sub.rTag = "(?:" + rTag + ")";
237237
// { ^? { tag+params slash? or closingTag or comment
238-
rTag = new RegExp("(?:" + openChars + rTag + "(\\/)?|\\" + delimOpenChar0 + "\\" + delimOpenChar1 + "(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))" + closeChars, "g");
238+
rTag = new RegExp("(?:" + openChars + rTag + "(\\/)?|\\" + delimOpenChar0 + "(\\" + linkChar + ")?\\" + delimOpenChar1 + "(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))" + closeChars, "g");
239239

240-
// Default: bind tagName cvt cln html code params slash closeBlk comment
241-
// /(?:{(\^)?{(?:(\w+(?=[/\s}]))|(\w+)?(:)|(>)|(\*))\s*((?:[^}]|}(?!}))*?)(\/)?|{{(?:(?:\/(\w+))|!--[\s\S]*?--))}}/g
240+
// Default: bind tagName cvt cln html code params slash bind2 closeBlk comment
241+
// /(?:{(\^)?{(?:(\w+(?=[\/\s}]))|(\w+)?(:)|(>)|(\*))\s*((?:[^}]|}(?!}))*?)(\/)?|{(\^)?{(?:(?:\/(\w+))\s*|!--[\s\S]*?--))}}
242242

243243
rTmplString = new RegExp("<.*>|([^\\\\]|^)[{}]|" + openChars + ".*" + closeChars);
244244
// rTmplString looks for html tags or { or } char not preceded by \\, or JsRender tags {{xxx}}. Each of these strings are considered
@@ -1224,43 +1224,43 @@ function tmplFn(markup, tmpl, isLinkExpr, convertBack, hasElse) {
12241224
}
12251225
}
12261226

1227-
function parseTag(all, bind, tagName, converter, colon, html, codeTag, params, slash, closeBlock, index) {
1227+
function parseTag(all, bind, tagName, converter, colon, html, codeTag, params, slash, bind2, closeBlock, index) {
12281228
/*
12291229
1230-
bind tagName cvt cln html code params slash closeBlk comment
1231-
/(?:{(\^)?{(?:(\w+(?=[/\s}]))|(\w+)?(:)|(>)|(\*))\s*((?:[^}]|}(?!}))*?)(\/)?|{{(?:(?:\/(\w+))|!--[\s\S]*?--))}}/g
1230+
bind tagName cvt cln html code params slash bind2 closeBlk comment
1231+
/(?:{(\^)?{(?:(\w+(?=[\/\s}]))|(\w+)?(:)|(>)|(\*))\s*((?:[^}]|}(?!}))*?)(\/)?|{(\^)?{(?:(?:\/(\w+))\s*|!--[\s\S]*?--))}}/g
12321232
12331233
(?:
1234-
{(\^)?{ bind
1234+
{(\^)?{ bind
12351235
(?:
1236-
(\w+ tagName
1236+
(\w+ tagName
12371237
(?=[\/\s}])
12381238
)
12391239
|
1240-
(\w+)?(:) converter colon
1240+
(\w+)?(:) converter colon
12411241
|
1242-
(>) html
1242+
(>) html
12431243
|
1244-
(\*) codeTag
1244+
(\*) codeTag
12451245
)
12461246
\s*
1247-
( params
1247+
( params
12481248
(?:[^}]|}(?!}))*?
12491249
)
1250-
(\/)? slash
1250+
(\/)? slash
12511251
|
1252-
{{
1252+
{(\^)?{ bind2
12531253
(?:
1254-
(?:\/(\w+)) closeBlock
1254+
(?:\/(\w+))\s* closeBlock
12551255
|
1256-
!--[\s\S]*?-- comment
1256+
!--[\s\S]*?-- comment
12571257
)
12581258
)
12591259
}}/g
12601260
12611261
*/
12621262

1263-
if (codeTag && bind || slash && !tagName || params && params.slice(-1) === ":") {
1263+
if (codeTag && bind || slash && !tagName || params && params.slice(-1) === ":" || bind2) {
12641264
syntaxError(all);
12651265
}
12661266

jsrender.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsrender.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)