Files
pathfinder/js/app/ccp.js
Exodus4D 2a73bb3018 - added new map scopes to map dialog, which affect system (jump) trackintg
- moved system (jump) tracking from client (js) to backend (php)
- improved system (jump) tracking performance (reduced update timings by 40%)
- improved map data caching
- updated jQuery custom content scroller 3.0.9 -> 3.1.13
- updated "manual dialog" content
- increased "manual dialog"
2016-06-12 13:30:39 +02:00

60 lines
1.2 KiB
JavaScript

/**
* Global CCPEvE function wrapper
*/
define(['jquery'], function($) {
'use strict';
/**
* checks whether the program URL is IGB trusted or not
* @returns {boolean}
*/
var isTrusted = function(){
var isPageTrusted = false;
if(isInGameBrowser()){
var trustedAttribute = $('body').attr('data-trusted');
if(trustedAttribute === '1'){
isPageTrusted = true;
}
}else{
// out of game browser is always trusted
isPageTrusted = true;
}
return isPageTrusted;
};
/**
* show IGB trust message
*/
var requestTrust = function(){
if(
isInGameBrowser() &&
!isTrusted()
){
CCPEVE.requestTrust( location.protocol + '//' + location.host );
}
};
/**
* in-game or out-of-game browser
* @returns {boolean}
*/
var isInGameBrowser = function(){
var inGame = false;
if(typeof CCPEVE === 'object'){
inGame = true;
}
return inGame;
};
return {
isInGameBrowser: isInGameBrowser,
isTrusted: isTrusted,
requestTrust: requestTrust
};
});