dots navigation is functional

This commit is contained in:
Bachir Soussi Chiadmi
2017-07-17 16:39:32 +02:00
parent 6fce164c58
commit c62b1df52d
7 changed files with 888 additions and 530 deletions
+12 -3
View File
@@ -89,20 +89,29 @@ module.exports = {
// get links
links_match = item.text.match(/\[[^\]]+\]\([^\)]+\)/g);
// console.log(links_match);
// if links exist on text
if(links_match){
for(link of links_match){
// console.log(link);
// get the target id
tid = link.match(/\((.+)\)/)[1];
obj.to.push(tid);
// avoid duplicates
if (obj.to.indexOf(tid) == -1)
obj.to.push(tid);
// add id to "from" links in target
// if target exists
if(typeof this.data_strct[tid] !== 'undefined'){
this.data_strct[tid].from.push(id);
// avoid duplicates
if (this.data_strct[tid].from.indexOf(tid) == -1)
this.data_strct[tid].from.push(id);
}else{
// if targets does not exists, the db has an issue, warn about that
console.log('!! warning : '+tid+' target id does not exists');
}
}
}
// console.log(this.links);
// add the item links to the main links listings
this.data_strct[id] = obj;
}
// console.log('data_strct',this.data_strct);