client/general: replace underscore with lodash
This commit is contained in:
parent
d123f27815
commit
2cba1a432f
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
require('../util/polyfill.js');
|
require('../util/polyfill.js');
|
||||||
const underscore = require('underscore');
|
const lodash = require('lodash');
|
||||||
const tags = require('../tags.js');
|
const tags = require('../tags.js');
|
||||||
const events = require('../events.js');
|
const events = require('../events.js');
|
||||||
const domParser = new DOMParser();
|
const domParser = new DOMParser();
|
||||||
|
@ -240,12 +240,12 @@ function getTemplate(templatePath) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const templateText = templates[templatePath].trim();
|
const templateText = templates[templatePath].trim();
|
||||||
const templateFactory = underscore.template(templateText);
|
const templateFactory = lodash.template(templateText);
|
||||||
return ctx => {
|
return ctx => {
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
ctx = {};
|
ctx = {};
|
||||||
}
|
}
|
||||||
underscore.extend(ctx, {
|
lodash.extend(ctx, {
|
||||||
makeRelativeTime: makeRelativeTime,
|
makeRelativeTime: makeRelativeTime,
|
||||||
makeThumbnail: makeThumbnail,
|
makeThumbnail: makeThumbnail,
|
||||||
makeRadio: makeRadio,
|
makeRadio: makeRadio,
|
||||||
|
|
|
@ -17,14 +17,14 @@
|
||||||
"html-minifier": "^1.3.1",
|
"html-minifier": "^1.3.1",
|
||||||
"js-cookie": "^2.1.0",
|
"js-cookie": "^2.1.0",
|
||||||
"js-yaml": "^3.5.5",
|
"js-yaml": "^3.5.5",
|
||||||
|
"lodash": "^4.12.0",
|
||||||
"merge": "^1.2.0",
|
"merge": "^1.2.0",
|
||||||
"mousetrap": "^1.5.3",
|
"mousetrap": "^1.5.3",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"page": "^1.7.1",
|
"page": "^1.7.1",
|
||||||
"stylus": "^0.54.2",
|
"stylus": "^0.54.2",
|
||||||
"superagent": "^1.8.3",
|
"superagent": "^1.8.3",
|
||||||
"uglify-js": "git://github.com/mishoo/UglifyJS2.git#harmony",
|
"uglify-js": "git://github.com/mishoo/UglifyJS2.git#harmony"
|
||||||
"underscore": "^1.8.3"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"watch": "latest"
|
"watch": "latest"
|
||||||
|
|
Loading…
Reference in New Issue