view-helpers
Advanced tools
Comparing version 0.1.0 to 0.1.1
0.1.1 / 2013-06-18 | ||
================== | ||
* fix page counter. fixes #4 | ||
0.1.0 / 2013-06-14 | ||
@@ -3,0 +8,0 @@ ================== |
18
index.js
@@ -87,13 +87,15 @@ | ||
params.page = 0 | ||
var clas = page == 0 ? "active" : "no" | ||
str += '<li class="'+clas+'"><a href="?'+qs.stringify(params)+'">First</a></li>' | ||
for (var p = 1; p < pages; p++) { | ||
params.page = 1 | ||
var clas = page == 1 ? "active" : "no" | ||
for (var p = 1; p <= pages; p++) { | ||
params.page = p | ||
clas = page == p ? "active" : "no" | ||
str += '<li class="'+clas+'"><a href="?'+qs.stringify(params)+'">'+ p +'</a></li>' | ||
var href = p === 1 | ||
? url.parse(req.url).pathname | ||
: '?' + qs.stringify(params) | ||
str += '<li class="'+clas+'"><a href="'+ href +'">'+ p +'</a></li>' | ||
} | ||
params.page = --p | ||
clas = page == params.page ? "active" : "no" | ||
str += '<li class="'+clas+'"><a href="?'+qs.stringify(params)+'">Last</a></li>' | ||
@@ -100,0 +102,0 @@ return str |
{ | ||
"name": "view-helpers", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "View helper methods for expressjs and other node stuff", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
## View Helpers | ||
This module is used as express middleware and it provides some helper methods. | ||
This module is used as express middleware and it provides helper methods to the views. | ||
@@ -5,0 +5,0 @@ ## Installation |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6786
119