dots navigation is functional
This commit is contained in:
+12
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user