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