- add current character name as document.title
- improved document.title blink on new rally point with inactive tab, #279
This commit is contained in:
@@ -31,7 +31,7 @@ class AppController extends Controller {
|
||||
*/
|
||||
public function init(\Base $f3) {
|
||||
// page title
|
||||
$f3->set('pageTitle', 'Login');
|
||||
$f3->set('pageTitle', 'Pathfinder');
|
||||
|
||||
// main page content
|
||||
$f3->set('pageContent', $f3->get('PATHFINDER.VIEW.LOGIN'));
|
||||
|
||||
@@ -14,9 +14,11 @@ class MapController extends AccessController {
|
||||
* @param \Base $f3
|
||||
*/
|
||||
public function init($f3) {
|
||||
$character = $this->getCharacter();
|
||||
|
||||
// page title
|
||||
$f3->set('pageTitle', 'Maps');
|
||||
$pageTitle = $character ? $character->name : 'Map';
|
||||
$f3->set('pageTitle', $pageTitle);
|
||||
|
||||
// main page content
|
||||
$f3->set('pageContent', false);
|
||||
|
||||
@@ -37,6 +37,12 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
// initial page title (cached)
|
||||
var initialPageTitle = document.title;
|
||||
|
||||
// global blink timeout cache
|
||||
var blinkTimer;
|
||||
|
||||
// stack container for all notifications
|
||||
var stack = {
|
||||
bottomRight: {
|
||||
@@ -137,35 +143,48 @@ define([
|
||||
var startTabBlink = function(blinkTitle){
|
||||
var initBlink = (function(blinkTitle){
|
||||
|
||||
var currentTitle = document.title;
|
||||
// count blinks if tab is currently active
|
||||
var activeTabBlinkCount = 0;
|
||||
|
||||
var timeoutId;
|
||||
var blink = function(){
|
||||
document.title = document.title === blinkTitle ? currentTitle : blinkTitle;
|
||||
};
|
||||
// number of "blinks" should be limited if tab is currently active
|
||||
if(window.isVisible){
|
||||
activeTabBlinkCount++;
|
||||
}
|
||||
|
||||
var clear = function() {
|
||||
clearInterval(timeoutId);
|
||||
document.title = currentTitle;
|
||||
window.onmousemove = null;
|
||||
timeoutId = null;
|
||||
};
|
||||
// toggle page title
|
||||
document.title = (document.title === blinkTitle) ? initialPageTitle : blinkTitle;
|
||||
|
||||
return function () {
|
||||
if (!timeoutId) {
|
||||
timeoutId = setInterval(blink, 1000);
|
||||
window.onmousemove = clear;
|
||||
if(activeTabBlinkCount > 10){
|
||||
stopTabBlink();
|
||||
}
|
||||
};
|
||||
|
||||
return function () {
|
||||
if (!blinkTimer) {
|
||||
blinkTimer = setInterval(blink, 1000);
|
||||
}
|
||||
};
|
||||
}( blinkTitle ));
|
||||
|
||||
initBlink();
|
||||
};
|
||||
|
||||
/**
|
||||
* stop blinking document.title
|
||||
*/
|
||||
var stopTabBlink = function(){
|
||||
if(blinkTimer){
|
||||
clearInterval(blinkTimer);
|
||||
document.title = initialPageTitle;
|
||||
blinkTimer = null;
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
showNotify: showNotify,
|
||||
startTabBlink: startTabBlink
|
||||
startTabBlink: startTabBlink,
|
||||
stopTabBlink: stopTabBlink
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -890,12 +890,21 @@ define([
|
||||
function handleVisibilityChange() {
|
||||
if (document[hidden]) {
|
||||
// tab is invisible
|
||||
// globally store current visibility status
|
||||
window.isVisible = false;
|
||||
|
||||
Util.getCurrentTriggerDelay( mapUpdateKey, increaseTimer );
|
||||
Util.getCurrentTriggerDelay( mapUserUpdateKey, increaseTimer );
|
||||
} else {
|
||||
// tab is visible
|
||||
// globally store current visibility status
|
||||
window.isVisible = true;
|
||||
|
||||
Util.getCurrentTriggerDelay( mapUpdateKey, -increaseTimer );
|
||||
Util.getCurrentTriggerDelay( mapUserUpdateKey, -increaseTimer );
|
||||
|
||||
// stop blinking tab from previous notifications
|
||||
Util.stopTabBlink();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -970,12 +970,20 @@ define([
|
||||
* @param desktop
|
||||
*/
|
||||
var showNotify = function(customConfig, desktop){
|
||||
|
||||
requirejs(['app/notification'], function(Notification) {
|
||||
Notification.showNotify(customConfig, desktop);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* stop browser tab title "blinking"
|
||||
*/
|
||||
var stopTabBlink = function(){
|
||||
requirejs(['app/notification'], function(Notification) {
|
||||
Notification.stopTabBlink();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* get log entry info
|
||||
* @param logType
|
||||
@@ -1726,6 +1734,7 @@ define([
|
||||
timeStop: timeStop,
|
||||
log: log,
|
||||
showNotify: showNotify,
|
||||
stopTabBlink: stopTabBlink,
|
||||
getLogInfo: getLogInfo,
|
||||
isXHRAborted: isXHRAborted,
|
||||
getMapModule: getMapModule,
|
||||
|
||||
@@ -37,6 +37,12 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
// initial page title (cached)
|
||||
var initialPageTitle = document.title;
|
||||
|
||||
// global blink timeout cache
|
||||
var blinkTimer;
|
||||
|
||||
// stack container for all notifications
|
||||
var stack = {
|
||||
bottomRight: {
|
||||
@@ -137,35 +143,48 @@ define([
|
||||
var startTabBlink = function(blinkTitle){
|
||||
var initBlink = (function(blinkTitle){
|
||||
|
||||
var currentTitle = document.title;
|
||||
// count blinks if tab is currently active
|
||||
var activeTabBlinkCount = 0;
|
||||
|
||||
var timeoutId;
|
||||
var blink = function(){
|
||||
document.title = document.title === blinkTitle ? currentTitle : blinkTitle;
|
||||
};
|
||||
// number of "blinks" should be limited if tab is currently active
|
||||
if(window.isVisible){
|
||||
activeTabBlinkCount++;
|
||||
}
|
||||
|
||||
var clear = function() {
|
||||
clearInterval(timeoutId);
|
||||
document.title = currentTitle;
|
||||
window.onmousemove = null;
|
||||
timeoutId = null;
|
||||
};
|
||||
// toggle page title
|
||||
document.title = (document.title === blinkTitle) ? initialPageTitle : blinkTitle;
|
||||
|
||||
return function () {
|
||||
if (!timeoutId) {
|
||||
timeoutId = setInterval(blink, 1000);
|
||||
window.onmousemove = clear;
|
||||
if(activeTabBlinkCount > 10){
|
||||
stopTabBlink();
|
||||
}
|
||||
};
|
||||
|
||||
return function () {
|
||||
if (!blinkTimer) {
|
||||
blinkTimer = setInterval(blink, 1000);
|
||||
}
|
||||
};
|
||||
}( blinkTitle ));
|
||||
|
||||
initBlink();
|
||||
};
|
||||
|
||||
/**
|
||||
* stop blinking document.title
|
||||
*/
|
||||
var stopTabBlink = function(){
|
||||
if(blinkTimer){
|
||||
clearInterval(blinkTimer);
|
||||
document.title = initialPageTitle;
|
||||
blinkTimer = null;
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
showNotify: showNotify,
|
||||
startTabBlink: startTabBlink
|
||||
startTabBlink: startTabBlink,
|
||||
stopTabBlink: stopTabBlink
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -890,12 +890,21 @@ define([
|
||||
function handleVisibilityChange() {
|
||||
if (document[hidden]) {
|
||||
// tab is invisible
|
||||
// globally store current visibility status
|
||||
window.isVisible = false;
|
||||
|
||||
Util.getCurrentTriggerDelay( mapUpdateKey, increaseTimer );
|
||||
Util.getCurrentTriggerDelay( mapUserUpdateKey, increaseTimer );
|
||||
} else {
|
||||
// tab is visible
|
||||
// globally store current visibility status
|
||||
window.isVisible = true;
|
||||
|
||||
Util.getCurrentTriggerDelay( mapUpdateKey, -increaseTimer );
|
||||
Util.getCurrentTriggerDelay( mapUserUpdateKey, -increaseTimer );
|
||||
|
||||
// stop blinking tab from previous notifications
|
||||
Util.stopTabBlink();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -970,12 +970,20 @@ define([
|
||||
* @param desktop
|
||||
*/
|
||||
var showNotify = function(customConfig, desktop){
|
||||
|
||||
requirejs(['app/notification'], function(Notification) {
|
||||
Notification.showNotify(customConfig, desktop);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* stop browser tab title "blinking"
|
||||
*/
|
||||
var stopTabBlink = function(){
|
||||
requirejs(['app/notification'], function(Notification) {
|
||||
Notification.stopTabBlink();
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* get log entry info
|
||||
* @param logType
|
||||
@@ -1726,6 +1734,7 @@ define([
|
||||
timeStop: timeStop,
|
||||
log: log,
|
||||
showNotify: showNotify,
|
||||
stopTabBlink: stopTabBlink,
|
||||
getLogInfo: getLogInfo,
|
||||
isXHRAborted: isXHRAborted,
|
||||
getMapModule: getMapModule,
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<meta name="keywords" content="eve,wormhole,mapping,tool,mmo,space,game">
|
||||
<meta name="author" content="Exodus 4D">
|
||||
|
||||
<title>Pathfinder - {{ @pageTitle}}</title>
|
||||
<title>{{ @pageTitle}}</title>
|
||||
|
||||
<meta property="og:title" content="EVE ONLINE mapping tool">
|
||||
<meta property="og:site_name" content="PATHFINDER">
|
||||
|
||||
Reference in New Issue
Block a user