2015-04-05 21:44:43 +00:00
|
|
|
|
define(function () {
|
2016-05-22 12:51:30 +00:00
|
|
|
|
return function (config) {
|
2015-04-05 21:44:43 +00:00
|
|
|
|
function setTitle(d) {
|
2016-05-22 11:23:43 +00:00
|
|
|
|
var title = [config.siteName];
|
2015-04-05 21:44:43 +00:00
|
|
|
|
|
2016-05-22 12:51:30 +00:00
|
|
|
|
if (d !== undefined) {
|
2016-05-22 11:23:43 +00:00
|
|
|
|
title.push(d);
|
2016-05-22 12:51:30 +00:00
|
|
|
|
}
|
2015-04-05 21:44:43 +00:00
|
|
|
|
|
2016-05-22 11:23:43 +00:00
|
|
|
|
document.title = title.join(": ");
|
2015-04-05 21:44:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.resetView = function () {
|
2016-05-22 11:23:43 +00:00
|
|
|
|
setTitle();
|
|
|
|
|
};
|
2015-04-05 21:44:43 +00:00
|
|
|
|
|
|
|
|
|
this.gotoNode = function (d) {
|
2016-05-22 12:51:30 +00:00
|
|
|
|
if (d) {
|
2016-05-22 11:23:43 +00:00
|
|
|
|
setTitle(d.nodeinfo.hostname);
|
2016-05-22 12:51:30 +00:00
|
|
|
|
}
|
2016-05-22 11:23:43 +00:00
|
|
|
|
};
|
2015-04-05 21:44:43 +00:00
|
|
|
|
|
|
|
|
|
this.gotoLink = function (d) {
|
2016-05-22 12:51:30 +00:00
|
|
|
|
if (d) {
|
2016-05-22 11:23:43 +00:00
|
|
|
|
setTitle((d.source.node ? d.source.node.nodeinfo.hostname : d.source.id) + " – " + d.target.node.nodeinfo.hostname);
|
2016-05-22 12:51:30 +00:00
|
|
|
|
}
|
2016-05-22 11:23:43 +00:00
|
|
|
|
};
|
2015-04-05 21:44:43 +00:00
|
|
|
|
|
2016-05-22 12:51:30 +00:00
|
|
|
|
this.gotoLocation = function () {
|
2016-02-25 14:47:07 +00:00
|
|
|
|
//ignore
|
2016-05-22 11:23:43 +00:00
|
|
|
|
};
|
2016-02-25 14:47:07 +00:00
|
|
|
|
|
2015-04-05 21:44:43 +00:00
|
|
|
|
this.destroy = function () {
|
2016-05-22 11:23:43 +00:00
|
|
|
|
};
|
2015-04-05 21:44:43 +00:00
|
|
|
|
|
2016-05-22 11:23:43 +00:00
|
|
|
|
return this;
|
|
|
|
|
};
|
|
|
|
|
});
|