2015-04-05 21:44:43 +00:00
|
|
|
|
define(function () {
|
2017-01-29 23:51:08 +00:00
|
|
|
|
'use strict';
|
2016-05-27 21:59:01 +00:00
|
|
|
|
|
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
|
|
|
|
|
2017-01-29 23:51:08 +00:00
|
|
|
|
document.title = title.join(': ');
|
2015-04-05 21:44:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-01-29 23:51:08 +00:00
|
|
|
|
this.resetView = function resetView() {
|
2016-05-22 11:23:43 +00:00
|
|
|
|
setTitle();
|
|
|
|
|
};
|
2015-04-05 21:44:43 +00:00
|
|
|
|
|
2017-01-29 23:51:08 +00:00
|
|
|
|
this.gotoNode = function gotoNode(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
|
|
|
|
|
2017-01-29 23:51:08 +00:00
|
|
|
|
this.gotoLink = function gotoLink(d) {
|
2016-05-22 12:51:30 +00:00
|
|
|
|
if (d) {
|
2017-01-29 23:51:08 +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
|
|
|
|
|
2017-01-29 23:51:08 +00:00
|
|
|
|
this.gotoLocation = function gotoLocation() {
|
|
|
|
|
// ignore
|
2016-05-22 11:23:43 +00:00
|
|
|
|
};
|
2016-02-25 14:47:07 +00:00
|
|
|
|
|
2017-01-29 23:51:08 +00:00
|
|
|
|
this.destroy = function destroy() {
|
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;
|
|
|
|
|
};
|
|
|
|
|
});
|