summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprzemyslawpluta <przemekpluta@hotmail.com>2014-03-26 19:52:34 +0000
committerprzemyslawpluta <przemekpluta@hotmail.com>2014-03-26 19:52:34 +0000
commit0c138410706f9711ecd11686722355e7888bfe55 (patch)
tree66e493412e26d89f40f0b75b46b0924e072690e4
parent40167aa8b4c66497d07a450bc32856cd6afb0f63 (diff)
downloadmongo-edu-0c138410706f9711ecd11686722355e7888bfe55.zip
link fix
-rw-r--r--lib/login.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/login.js b/lib/login.js
index d1b2d8c..7223126 100644
--- a/lib/login.js
+++ b/lib/login.js
@@ -110,12 +110,16 @@ module.exports = {
$('div.wiki-article p').children().filter('a').map(function map(i, item) {
var current = $(item);
- if (current.text().indexOf(options) !== -1) { list.push(current.attr('href')); }
+ if (current.text().indexOf(options) !== -1) {
+ list.push({ href: current.attr('href'), text: current.text() });
+ }
});
- getCourses = _.filter(list, function map(item) { return item.match(/(wiki\/M101|wiki\/M102|wiki\/C100|wiki\/M202)/); });
+ getCourses = _.filter(list, function map(item) {
+ if (item.href.match(/(wiki\/M101|wiki\/M102|wiki\/C100|wiki\/M202|wiki\/list-youtube-links)/)) { return item; }
+ });
- callback(null, _.map(getCourses, function map(item) { return { name: item.replace(tag, '').slice(0, -1).slice(1).replace(/-/g, ' ').replace(/\//g, ': '), value: item }; }));
+ callback(null, _.map(getCourses, function map(item) { return { name: !item.href.match(/wiki\/list-youtube-links/) ? item.href.replace(tag, '').slice(0, -1).slice(1).replace(/-/g, ' ').replace(/\//g, ': ') : item.text, value: item.href }; }));
}
});