mirror of
https://github.com/pa11y/pa11y-dashboard.git
synced 2025-09-24 22:31:15 +00:00
Support Node.js 0.10–6 (#132)
* Update dependencies * Switch from jsdom to cheerio * Update the supported Node.js versions * Recompile the client-side CSS and JS
This commit is contained in:

committed by
Andrew Mee

parent
6bfb4f72d9
commit
ae6208d87e
@@ -19,20 +19,20 @@ var moment = require('moment');
|
||||
|
||||
module.exports = helper;
|
||||
|
||||
function helper(register) {
|
||||
function helper(hbs) {
|
||||
|
||||
// Format a date with Moment
|
||||
register('date-format', function(context, block) {
|
||||
hbs.registerHelper('date-format', function(context, block) {
|
||||
var format = block.hash.format || 'YYYY-MM-DD HH:mm:ss';
|
||||
return moment(context).format(format);
|
||||
});
|
||||
|
||||
// Get a relative date
|
||||
register('date-relative', function(context) {
|
||||
hbs.registerHelper('date-relative', function(context) {
|
||||
return moment(context).fromNow();
|
||||
});
|
||||
|
||||
register('date-timestamp', function(context) {
|
||||
hbs.registerHelper('date-timestamp', function(context) {
|
||||
return moment(context).valueOf();
|
||||
});
|
||||
|
||||
|
@@ -2,10 +2,10 @@
|
||||
|
||||
module.exports = helper;
|
||||
|
||||
function helper(register) {
|
||||
function helper(hbs) {
|
||||
|
||||
// Convert a string to lower-case
|
||||
register('lowercase', function(context) {
|
||||
hbs.registerHelper('lowercase', function(context) {
|
||||
return context.toLowerCase();
|
||||
});
|
||||
|
||||
|
@@ -17,10 +17,10 @@
|
||||
|
||||
module.exports = helper;
|
||||
|
||||
function helper(register) {
|
||||
function helper(hbs) {
|
||||
|
||||
// Simplify url by removing (eg http://, https://, trailing slashes) from url
|
||||
register('simplify-url', function(context) {
|
||||
hbs.registerHelper('simplify-url', function(context) {
|
||||
return context.replace(/^https?:\/\//i, '').replace(/\/$/, '').toLowerCase();
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user