Highlight nodes being processed.

master
Alinson S. Xavier 11 years ago
parent a004f36043
commit bd7d36a5ab

@ -1,8 +1,10 @@
var visjs_options = {
nodes: {
borderWidth: 3,
borderWidthSelected: 3,
color: {
border: '#bbb',
background: '#fff',
border: '#fff',
background: '#fff',
highlight: {
border: '#fff',
background: '#dd3'
@ -48,5 +50,5 @@ var visjs_options = {
}
};
var seed_url = 'http://www.scopus.com/results/results.url?sort=plf-f&src=s&st1=urea+permeation+immobilized&sid=B0FE19FE3CFF4CCF86DD857756E90636.FZg2ODcJC9ArCe8WOZPvA%3a1400&sot=b&sdt=b&sl=34&s=TITLE%28urea+permeation+immobilized%29&origin=searchbasic&txGid=B0FE19FE3CFF4CCF86DD857756E90636.FZg2ODcJC9ArCe8WOZPvA%3a140';
var node_queued_color = jQuery.extend({},visjs_options.nodes.color);
node_queued_color.background = '#da2d2f';

@ -51,14 +51,22 @@ ScholarCrawler.prototype.process = function(url, parent_node)
if(crawler.node_ids.indexOf(child['id']) == -1)
{
crawler.node_ids.push(child['id']);
crawler.nodes.add(child);
if(child['depth'] < crawler.max_depth) {
if(child['depth'] < crawler.max_depth && child['n_citations'] > 0) {
crawler.push(child['citations_url'], child);
child.color = node_queued_color;
}
crawler.node_ids.push(child['id']);
crawler.nodes.add(child);
}
}
if(!(parent_node === null))
{
parent_node.color = visjs_options.nodes.color;
crawler.nodes.update(parent_node);
}
});
};

@ -1,6 +1,6 @@
function ScopusParser() {};
ScopusParser.prototype.parse = function(url, callback)
ScopusParser.prototype._parse_results_page = function(url, callback)
{
var iframe = document.createElement("iframe");
$(iframe).hide();
@ -15,6 +15,7 @@ ScopusParser.prototype.parse = function(url, callback)
if(select_pages.val() != 200) {
select_pages.val(200);
select_pages.change();
return;
}
$(ibody).find(".resultItemLists li").each(function(index, li)
@ -56,3 +57,10 @@ ScopusParser.prototype.parse = function(url, callback)
document.body.removeChild(iframe);
});
}
ScopusParser.prototype.parse = function(url, callback)
{
if(url === undefined) return;
//if(url.indexOf("/results/") > 0 || url.indexOf("/search/") > 0)
this._parse_results_page(url, callback);
}