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
|
|
|
|
2017-11-03 21:07:22 +00:00
|
|
|
return function () {
|
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) {
|
2017-04-25 22:43:53 +00:00
|
|
|
title.unshift(d);
|
2016-05-22 12:51:30 +00:00
|
|
|
}
|
2015-04-05 21:44:43 +00:00
|
|
|
|
2017-04-25 22:43:53 +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) {
|
2017-10-29 14:11:24 +00:00
|
|
|
setTitle(d.hostname);
|
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) {
|
2017-10-29 14:11:24 +00:00
|
|
|
setTitle((d.source ? d.source.hostname : d.source.id) + ' \u21D4 ' + d.target.hostname);
|
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;
|
|
|
|
};
|
|
|
|
});
|