Comparing version 1.0.0 to 1.1.0
57
index.js
@@ -1,2 +0,2 @@ | ||
(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){ | ||
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
/* global fetch */ | ||
@@ -147,5 +147,33 @@ 'use strict'; | ||
},{"./utils":9}],2:[function(require,module,exports){ | ||
},{"./utils":10}],2:[function(require,module,exports){ | ||
'use strict'; | ||
module.exports = (rows) => { | ||
const approvals = {}; | ||
rows.forEach((row) => { | ||
if (!row.approvals || !row.approvals.data) { | ||
return; | ||
} | ||
row.approvals.data.forEach((approval) => { | ||
const k = approval.status; | ||
approvals[k] = approvals[k] || 0; | ||
++approvals[k]; | ||
}); | ||
}); | ||
if (approvals.approved) { | ||
return '<div class="tk-icon-lock"></div>'; | ||
} | ||
else if (approvals.pending) { | ||
return '<div class="tk-icon-check-small"></div>'; | ||
} | ||
}; | ||
},{}],3:[function(require,module,exports){ | ||
'use strict'; | ||
const hourCellColor = (projects, leaveTypes, projectKey, hasError) => { | ||
@@ -182,3 +210,3 @@ | ||
},{}],3:[function(require,module,exports){ | ||
},{}],4:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -188,2 +216,3 @@ | ||
exports.approvals = require('./approvals'); | ||
exports.projectHeading = require('./projectHeading'); | ||
@@ -194,3 +223,3 @@ exports.projectHours = require('./projectHours'); | ||
},{"./hourCellClass":2,"./projectHeading":4,"./projectHours":5,"./rowStyle":6,"./table.ejs":7}],4:[function(require,module,exports){ | ||
},{"./approvals":2,"./hourCellClass":3,"./projectHeading":5,"./projectHours":6,"./rowStyle":7,"./table.ejs":8}],5:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -221,3 +250,3 @@ | ||
},{}],5:[function(require,module,exports){ | ||
},{}],6:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -238,3 +267,3 @@ | ||
},{}],6:[function(require,module,exports){ | ||
},{}],7:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -257,3 +286,3 @@ | ||
},{}],7:[function(require,module,exports){ | ||
},{}],8:[function(require,module,exports){ | ||
module.exports = (function anonymous(locals, escapeFn, include, rethrow | ||
@@ -265,3 +294,3 @@ /*``*/) { | ||
: String(markup) | ||
.replace(_MATCH_HTML, encode_char); | ||
.replace(_MATCH_HTML, encode_char); | ||
}; | ||
@@ -307,3 +336,5 @@ var _ENCODE_HTML_RULES = { | ||
; __append( Templates.hourCellClass(projects, leaveTypes, projectKey, projectData) ) | ||
; __append("\"><div class=\"tk-hours\">\n ") | ||
; __append("\">") | ||
; __append( Templates.approvals(dayData.rows) ) | ||
; __append("<div class=\"tk-hours\">\n ") | ||
; __append( Templates.projectHours(projectData, rowHours) ) | ||
@@ -343,3 +374,3 @@ ; __append("\n </div></td>\n <td style=\"padding-right: 14px;\">\n ") | ||
}) | ||
},{"../templates":3,"../utils":9}],8:[function(require,module,exports){ | ||
},{"../templates":4,"../utils":10}],9:[function(require,module,exports){ | ||
/* global document */ | ||
@@ -378,3 +409,3 @@ 'use strict'; | ||
},{"./templates":3}],9:[function(require,module,exports){ | ||
},{"./templates":4}],10:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -396,3 +427,3 @@ | ||
},{}],10:[function(require,module,exports){ | ||
},{}],11:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -419,2 +450,2 @@ | ||
},{"./data":1,"./ui":8}]},{},[10]); | ||
},{"./data":1,"./ui":9}]},{},[11]); |
@@ -5,2 +5,3 @@ 'use strict'; | ||
exports.approvals = require('./approvals'); | ||
exports.projectHeading = require('./projectHeading'); | ||
@@ -7,0 +8,0 @@ exports.projectHours = require('./projectHours'); |
{ | ||
"name": "3048m", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Visit [https://dominykas.github.io/3048m/](https://dominykas.github.io/3048m/) and drag <a href=\"javascript:(() => { const s = document.createElement('script'); s.src = 'https://rawgit.com/dominykas/3048m/master/index.js'; document.head.appendChild(s); })();\">`3048m`</a> to your bookmarks bar.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "eslint .", | ||
"test": "lab -L", | ||
"build": "browserify -t ejsify lib -o index.js", | ||
"watch": "watchify -t ejsify lib -o index.js", | ||
"pre-commit": "npm run build && npm run test && git add -A index.js" | ||
@@ -22,9 +23,8 @@ }, | ||
"devDependencies": { | ||
"browserify": "15.x.x", | ||
"browserify": "16.x.x", | ||
"ejs": "2.x.x", | ||
"ejsify": "git://github.com/insidewarehouse/ejsify#ejs@2.x", | ||
"eslint": "4.x.x", | ||
"eslint-config-hapi": "11.x.x", | ||
"eslint-plugin-hapi": "4.x.x", | ||
"git-pre-hooks": "1.x.x" | ||
"git-pre-hooks": "1.x.x", | ||
"lab": "15.x.x", | ||
"watchify": "3.x.x" | ||
}, | ||
@@ -31,0 +31,0 @@ "git-pre-hooks": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
27178
6
17
562