- code formatting

This commit is contained in:
Mark Friedrich
2018-09-16 23:31:03 +02:00
parent 4519d5e519
commit ec05738cce
94 changed files with 880 additions and 880 deletions

View File

@@ -34,7 +34,7 @@ define([
let targetElement = $('[data-id="' + targetId + '"]');
let targetFormFields = targetElement.find('input[type="radio"]');
let checkFormFields = [];
for(let formField of targetFormFields) {
for(let formField of targetFormFields){
if(this.checked){
if(formField.hasAttribute('data-default') || formField.getAttribute('data-default-value')){
checkFormFields.push(formField);
@@ -47,7 +47,7 @@ define([
}
}
for(let checkFormField of checkFormFields) {
for(let checkFormField of checkFormFields){
checkFormField.checked = true;
}
}

View File

@@ -4,7 +4,7 @@
*/
define([], function() {
define([], function(){
'use strict';

View File

@@ -139,7 +139,7 @@ define([
* @param index
* @param array
*/
let compareKeyLists = function(element, index, array) {
let compareKeyLists = function(element, index, array){
return this.find(x => x === element);
};
@@ -313,7 +313,7 @@ define([
new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if(mutation.type === 'childList'){
for (let i = 0; i < mutation.removedNodes.length; i++){
for(let i = 0; i < mutation.removedNodes.length; i++){
let removedNode = mutation.removedNodes[i];
if(typeof removedNode.getAttribute === 'function'){
let eventNames = removedNode.getAttribute(dataKeyEvents);

View File

@@ -7,7 +7,7 @@ define([
'app/init',
'app/util',
'bootbox'
], function($, Init, Util, bootbox) {
], function($, Init, Util, bootbox){
'use strict';
@@ -48,7 +48,7 @@ define([
let logDialog = $('#' + config.taskDialogId);
if(logDialog.length){
// dialog is open
requirejs(['text!templates/modules/sync_status.html', 'mustache'], function(templateSyncStatus, Mustache) {
requirejs(['text!templates/modules/sync_status.html', 'mustache'], function(templateSyncStatus, Mustache){
let data = {
timestampCounterClass: config.timestampCounterClass,
syncStatus: Init.syncStatus,
@@ -80,7 +80,7 @@ define([
let showDialog = function(){
// dialog content
requirejs(['text!templates/dialog/task_manager.html', 'mustache', 'datatables.loader'], function(templateTaskManagerDialog, Mustache) {
requirejs(['text!templates/dialog/task_manager.html', 'mustache', 'datatables.loader'], function(templateTaskManagerDialog, Mustache){
let data = {
id: config.taskDialogId,
dialogDynamicAreaClass: config.dialogDynamicAreaClass,
@@ -193,7 +193,7 @@ define([
});
// modal dialog is shown
logDialog.on('shown.bs.modal', function(e) {
logDialog.on('shown.bs.modal', function(e){
updateSyncStatus();
// show Morris graphs ----------------------------------------------------------
@@ -203,8 +203,8 @@ define([
return Math.round(y) + 'ms';
};
for(let key in chartData) {
if(chartData.hasOwnProperty(key)) {
for(let key in chartData){
if(chartData.hasOwnProperty(key)){
// create a chart for each key
let colElementGraph = $('<div>', {
@@ -293,17 +293,17 @@ define([
// modal dialog is closed
logDialog.on('hidden.bs.modal', function(e) {
logDialog.on('hidden.bs.modal', function(e){
// clear memory -> destroy all charts
for (let key in chartData) {
if (chartData.hasOwnProperty(key)) {
for(let key in chartData){
if(chartData.hasOwnProperty(key)){
chartData[key].graph = null;
}
}
});
// modal dialog before hide
logDialog.on('hide.bs.modal', function(e) {
logDialog.on('hide.bs.modal', function(e){
// destroy logTable
logDataTable.destroy(true);
@@ -342,7 +342,7 @@ define([
chartData[key].data = chartData[key].data.slice(0, maxGraphDataCount);
}
function getGraphData(data) {
function getGraphData(data){
let tempChartData = {
data: [],
dataSum: 0,
@@ -388,7 +388,7 @@ define([
avgElement[0].textContent = 'Avg. ' + tempChartData.average + 'ms';
let avgStatus = getLogStatusByDuration(key, tempChartData.average);
let avgStatusClass = Util.getLogInfo( avgStatus, 'class' );
let avgStatusClass = Util.getLogInfo( avgStatus, 'class');
//change avg. display class
if( !avgElement.hasClass(avgStatusClass) ){
@@ -473,7 +473,7 @@ define([
// check log status by duration
let logStatus = getLogStatusByDuration(logKey, logDuration);
let statusClass = Util.getLogInfo( logStatus, 'class' );
let statusClass = Util.getLogInfo( logStatus, 'class');
let typeIconClass = getLogTypeIconClass(logType);
// update graph data

View File

@@ -123,12 +123,12 @@ define([
ssoButtonElement.confirmation('destroy');
});
cookieHintElement.on('show.bs.collapse', function () {
cookieHintElement.on('show.bs.collapse', function(){
// move admin panel upwards (prevents overlapping with cookie notice)
moveAdminPanel('up');
});
cookieHintElement.on('hidden.bs.collapse', function () {
cookieHintElement.on('hidden.bs.collapse', function(){
moveAdminPanel('down');
});
@@ -205,7 +205,7 @@ define([
}
// extent "blueimp" gallery for a textFactory method to show HTML templates
Gallery.prototype.textFactory = function (obj, callback) {
Gallery.prototype.textFactory = function(obj, callback){
let newSlideContent = $('<div>')
.addClass('text-content')
.attr('imgTitle', obj.title);
@@ -277,13 +277,13 @@ define([
transitionSpeed: 600,
slideshowInterval: 5000,
preloadRange: 1,
onopened: function () {
onopened: function(){
// Callback function executed when the Gallery has been initialized
// and the initialization transition has been completed.
// -> show "demo" map
// set title for first slide
$( this.options.container ).find( this.options.titleElement).text('Browser view');
$(this.options.container).find(this.options.titleElement).text('Browser view');
$('#' + config.headHeaderMapId).drawDemoMap(function(){
@@ -348,7 +348,7 @@ define([
let allThumbLinks = getThumbnailElements();
requirejs(['blueImpGalleryBootstrap'], () => {
$(newElements).each(function() {
$(newElements).each(function(){
let borderless = false;
let galleryElement = $('#' + config.galleryId);
@@ -381,17 +381,17 @@ define([
*/
let initYoutube = () => {
$('.youtube').each(function() {
$('.youtube').each(function(){
// Based on the YouTube ID, we can easily find the thumbnail image
$(this).css('background-image', 'url(//i.ytimg.com/vi/' + this.id + '/sddefault.jpg)');
// Overlay the Play icon to make it look like a video player
$(this).append($('<div/>', {'class': 'play'}));
$(document).delegate('#' + this.id, 'click', function() {
$(document).delegate('#' + this.id, 'click', function(){
// Create an iFrame with autoplay set to true
let iFrameUrl = '//www.youtube.com/embed/' + this.id + '?autoplay=1&autohide=1';
if ( $(this).data('params') ){
if( $(this).data('params') ){
iFrameUrl += '&'+$(this).data('params');
}
@@ -488,7 +488,7 @@ define([
style: statusClass
};
requirejs(['text!templates/ui/server_panel.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/ui/server_panel.html', 'mustache'], function(template, Mustache){
let content = Mustache.render(template, data);
$('#' + config.headerId).prepend(content);
$('#' + config.stickyPanelServerId).velocity('transition.slideLeftBigIn', {
@@ -601,7 +601,7 @@ define([
let removeCharacterPanel = function(panelElement){
$(panelElement).velocity('transition.expandOut', {
duration: 250,
complete: function () {
complete: function(){
// lock row for CSS animations while removing...
$(this).parent().addClass(config.characterRowAnimateClass);
@@ -701,7 +701,7 @@ define([
// character data not available -> remove panel
removeCharacterPanel(this.characterElement);
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let characterElement = this.characterElement;
characterElement.hideLoadingAnimation();
@@ -789,7 +789,7 @@ define([
$.fn.showNotificationDialog(options);
// change url (remove logout parameter)
if (history.pushState) {
if(history.pushState){
history.pushState({}, '', location.protocol + '//' + location.host + location.pathname);
}
}

View File

@@ -17,7 +17,7 @@ define([
systemContextMenuId: 'pf-map-system-contextmenu' // id for "systems" context menu
};
$.fn.contextMenu = function (settings) {
$.fn.contextMenu = function(settings){
// animation
let animationInType = 'transition.flipXIn';
@@ -25,10 +25,10 @@ define([
let animationOutType = 'transition.flipXOut';
let animationOutDuration = 150;
return this.each(function () {
return this.each(function(){
// Open context menu
$(this).off('pf:openContextMenu').on('pf:openContextMenu', function (e, originalEvent, component, hiddenOptions, activeOptions, disabledOptions) {
$(this).off('pf:openContextMenu').on('pf:openContextMenu', function(e, originalEvent, component, hiddenOptions, activeOptions, disabledOptions){
// hide all other open context menus
$('#pf-dialog-wrapper > .dropdown-menu').hide();
@@ -73,11 +73,11 @@ define([
){
// Chrome
posX = originalEvent.offsetX;
posY = originalEvent.offsetY ;
posY = originalEvent.offsetY;
}else if(originalEvent.originalEvent){
// Firefox -> #415
posX = originalEvent.originalEvent.layerX;
posY = originalEvent.originalEvent.layerY ;
posY = originalEvent.originalEvent.layerY;
}
let position = {
@@ -85,7 +85,7 @@ define([
y: posY
};
$(this).off('click').one('click', {component: component, position: position}, function (e) {
$(this).off('click').one('click', {component: component, position: position}, function(e){
// hide contextmenu
$(this).hide();
@@ -102,7 +102,7 @@ define([
});
//make sure menu closes on any click
$(document).one('click.closeContextmenu', function () {
$(document).one('click.closeContextmenu', function(){
$('.dropdown-menu[role="menu"]').velocity(animationOutType, {
duration: animationOutDuration
});
@@ -113,27 +113,27 @@ define([
});
function getLeftLocation(e) {
function getLeftLocation(e){
let mouseWidth = e.pageX;
let pageWidth = $(window).width();
let menuWidth = $(settings.menuSelector).width();
// opening menu would pass the side of the page
if (mouseWidth + menuWidth > pageWidth &&
menuWidth < mouseWidth) {
if(mouseWidth + menuWidth > pageWidth &&
menuWidth < mouseWidth){
return mouseWidth - menuWidth;
}
return mouseWidth;
}
function getTopLocation(e) {
function getTopLocation(e){
let mouseHeight = e.pageY;
let pageHeight = $(window).height();
let menuHeight = $(settings.menuSelector).height();
// opening menu would pass the bottom of the page
if (mouseHeight + menuHeight > pageHeight &&
menuHeight < mouseHeight) {
if(mouseHeight + menuHeight > pageHeight &&
menuHeight < mouseHeight){
return mouseHeight - menuHeight;
}
return mouseHeight;
@@ -216,7 +216,7 @@ define([
let initSystemContextMenu = (systemStatusData) => {
let statusData = [];
for (let [statusName, data] of Object.entries(systemStatusData)){
for(let [statusName, data] of Object.entries(systemStatusData)){
statusData.push({
subIcon: 'fa-tag',
subIconClass: data.class,

View File

@@ -3,7 +3,7 @@ define(() => {
class Position {
constructor(config) {
constructor(config){
this._defaultConfig = {
container: null, // parent DOM container element
center: null, // DOM elements that works as center
@@ -61,8 +61,8 @@ define(() => {
left = point[0];
top = point[1];
a = this._config.gapX ;
b = this._config.gapY ;
a = this._config.gapX;
b = this._config.gapY;
}else if(element){
// DOM element
left = element.style.left ? parseInt(element.style.left, 10) : 0;
@@ -204,12 +204,12 @@ define(() => {
this._percentCovered = (dim1, dim2) => {
let percent = 0;
if (
if(
(dim1.left <= dim2.left) &&
(dim1.top <= dim2.top) &&
((dim1.left + dim1.width) >= (dim2.left + dim2.width)) &&
((dim1.top + dim1.height) > (dim2.top + dim2.height))
) {
){
// The whole thing is covering the whole other thing
percent = 100;
}else{
@@ -224,7 +224,7 @@ define(() => {
let t = Math.max(dim1.top, dim2.top);
let b = Math.min(dim1.bottom, dim2.bottom);
if (b >= t && r >= l) {
if(b >= t && r >= l){
percent = (((r - l) * (b - t)) / (dim2.width * dim2.height)) * 100;
}
}
@@ -285,7 +285,7 @@ define(() => {
if(loops === 1){
// check center element
let centerDimension = this._getElementDimension(this._config.center);
if (!this._isOverlapping(centerDimension, dimensionContainer, allDimensions)) {
if(!this._isOverlapping(centerDimension, dimensionContainer, allDimensions)){
dimensions.push({
left: centerDimension.left,
top: centerDimension.top,
@@ -310,7 +310,7 @@ define(() => {
let coordinate = this._getEllipseCoordinates(centerDimension, end);
// transform relative x/y coordinate into a absolute 2D area
let checkDimension = this._transformCoordinate(centerDimension, coordinate);
if (!this._isOverlapping(checkDimension, dimensionContainer, allDimensions)) {
if(!this._isOverlapping(checkDimension, dimensionContainer, allDimensions)){
dimensions.push({
left: checkDimension.left,
top: checkDimension.top,

View File

@@ -8,7 +8,7 @@ define([
'app/init',
'app/util',
'app/map/util'
], function($, Init, Util, MapUtil) {
], function($, Init, Util, MapUtil){
'use strict';
let config = {
@@ -122,7 +122,7 @@ define([
* @param checkExistence
*/
let filterRows = (table, data = 'id', values = [], checkExistence = true) => {
return table.rows().eq(0).filter( function (rowIdx) {
return table.rows().eq(0).filter( function(rowIdx){
let rowExists = values.indexOf( table.row(rowIdx ).data()[data] ) !== -1;
if( !checkExistence ){
@@ -157,17 +157,17 @@ define([
// update userCount for "near by" count -------------------------------------------------------------------
if( characterAll > 0){
userCountElement.toggleClass( 'txt-color-green', true).toggleClass( 'txt-color-red', false);
userCountElement.toggleClass('txt-color-green', true).toggleClass('txt-color-red', false);
}else{
userCountElement.toggleClass( 'txt-color-green', false).toggleClass( 'txt-color-red', true);
userCountElement.toggleClass('txt-color-green', false).toggleClass('txt-color-red', true);
}
userCountElement.text(characterAll);
// update userCount in current system ---------------------------------------------------------------------
if( characterLocal > 0){
childElements.eq(3).toggleClass( 'txt-color-green', true).toggleClass( 'txt-color-red', false);
childElements.eq(3).toggleClass('txt-color-green', true).toggleClass('txt-color-red', false);
}else{
childElements.eq(3).toggleClass( 'txt-color-green', false).toggleClass( 'txt-color-red', true);
childElements.eq(3).toggleClass('txt-color-green', false).toggleClass('txt-color-red', true);
}
childElements.eq(3).text(characterLocal);
};
@@ -188,7 +188,7 @@ define([
let characterLocalIds = [];
// system is on map (just for security check)
for(let jumps in userData) {
for(let jumps in userData){
if( userData.hasOwnProperty(jumps) ){
jumps = parseInt(jumps);
@@ -237,7 +237,7 @@ define([
// open Overlay -------------------------------------------------------------------------------------------
if( !isOpen(overlay) ){
let promiseStore = MapUtil.getLocaleData('map', mapId);
promiseStore.then(function(dataStore) {
promiseStore.then(function(dataStore){
if(
dataStore &&
dataStore.showLocal
@@ -256,7 +256,7 @@ define([
* @returns {*}
*/
let getDescendantProp = (obj, selector) => {
return selector.split('.').reduce(function(a, b) {
return selector.split('.').reduce(function(a, b){
return a[b];
}, obj);
};
@@ -376,7 +376,7 @@ define([
});
// table init complete
table.on( 'init.dt', function (){
table.on('init.dt', function(){
// init table head tooltips
$(this).initTooltips({
container: 'body',
@@ -394,7 +394,7 @@ define([
searching: false,
hover: false,
autoWidth: false,
rowId: function(rowData) {
rowId: function(rowData){
return 'pf-local-row_' + rowData.id; // characterId
},
language: {

View File

@@ -7,7 +7,7 @@ define([
'jquery',
'app/map/util',
'farahey'
], function($, MapUtil) {
], function($, MapUtil){
'use strict';
@@ -32,9 +32,9 @@ define([
* @returns {{left, top}}
* @private
*/
let _offset = function(system) {
let _offset = function(system){
let _ = function(p) {
let _ = function(p){
let v = system.style[p];
return parseInt(v.substring(0, v.length - 2));
};
@@ -52,7 +52,7 @@ define([
* @param o
* @private
*/
let _setOffset = function(system, o) {
let _setOffset = function(system, o){
let markAsUpdated = false;
// new position must be within parent container
@@ -85,12 +85,12 @@ define([
* @returns {boolean}
* @private
*/
let _dragFilter = function(id) {
let _dragFilter = function(id){
return !$('#' + id).is('.jsPlumb_dragged, .pf-system-locked');
};
let gridConstrain = function(gridX, gridY) {
return function(id, current, delta) {
let gridConstrain = function(gridX, gridY){
return function(id, current, delta){
if( mapContainer.hasClass(MapUtil.config.mapGridClass) ){
// active grid
return {
@@ -107,14 +107,14 @@ define([
// main init for "magnetize" feature ------------------------------------------------------
m8 = new Magnetizer({
container: mapContainer,
getContainerPosition: function(c) {
getContainerPosition: function(c){
return c.offset();
},
getPosition:_offset,
getSize: function(system) {
getSize: function(system){
return [ $(system).outerWidth(), $(system).outerHeight() ];
},
getId : function(system) {
getId : function(system){
return $(system).attr('id');
},
setPosition:_setOffset,

View File

@@ -335,8 +335,8 @@ define([
let statusId = Util.getStatusInfoForSystem(status, 'id');
let statusClass = Util.getStatusInfoForSystem(status, 'class');
for(let property in Init.systemStatus) {
if (Init.systemStatus.hasOwnProperty(property)) {
for(let property in Init.systemStatus){
if(Init.systemStatus.hasOwnProperty(property)){
system.removeClass( Init.systemStatus[property].class );
}
}
@@ -502,7 +502,7 @@ define([
system.attr('data-mapid', parseInt(mapContainer.data('id')));
// locked system
if( Boolean( system.data( 'locked') ) !== data.locked ){
if( Boolean( system.data('locked') ) !== data.locked ){
system.toggleLockSystem(false, {hideNotification: true, hideCounter: true, map: map});
}
@@ -528,7 +528,7 @@ define([
let connectionCanvas = $(connection.canvas);
// if the connection already exists -> do not set it twice
connection.unbind('contextmenu').bind('contextmenu', function(component, e) {
connection.unbind('contextmenu').bind('contextmenu', function(component, e){
e.preventDefault();
e.stopPropagation();
@@ -550,7 +550,7 @@ define([
*/
connectionCanvas.contextMenu({
menuSelector: '#' + config.connectionContextMenuId,
menuSelected: function (params){
menuSelected: function(params){
let action = params.selectedMenu.attr('data-action');
let activeConnection = params.component;
@@ -562,7 +562,7 @@ define([
// delete a single connection
// confirm dialog
bootbox.confirm('Is this connection really gone?', function(result) {
bootbox.confirm('Is this connection really gone?', function(result){
if(result){
$().deleteConnections([activeConnection]);
}
@@ -592,7 +592,7 @@ define([
let newScope = action.split('_')[1];
let newScopeName = MapUtil.getScopeInfoForConnection( newScope, 'label');
bootbox.confirm('Change scope from ' + activeScopeName + ' to ' + newScopeName + '?', function(result) {
bootbox.confirm('Change scope from ' + activeScopeName + ' to ' + newScopeName + '?', function(result){
if(result){
mapElement.getMapOverlay('timer').startMapUpdateCounter();
@@ -621,8 +621,8 @@ define([
let activeConnections = MapUtil.getConnectionsByType(map, 'active');
if(activeConnections.length >= config.maxActiveConnections && !connection.hasType('active')){
Util.showNotify({title: 'Connection select limit', text: 'You can´t select more connections', type: 'warning'});
}else {
if(activeConnections.length > 0) {
}else{
if(activeConnections.length > 0){
MapUtil.toggleConnectionActive(map, [connection]);
}else{
MapUtil.showConnectionInfo(map, [connection]);
@@ -839,7 +839,7 @@ define([
if(entry.constructor.name === 'HTMLDivElement'){
width = entry.style.width;
height = entry.style.height;
}else if (entry.constructor.name === 'ResizeObserverEntry'){
}else if(entry.constructor.name === 'ResizeObserverEntry'){
width = entry.target.style.width;
height = entry.target.style.height;
}
@@ -851,16 +851,16 @@ define([
promiseStore.then((data) => {
let storeData = true;
if (
if(
data && data.style &&
data.style.width === width &&
data.style.height === height
) {
){
// no style changes
storeData = false;
}
if (storeData) {
if(storeData){
MapUtil.storeLocalData('map', mapConfig.config.id, 'style', {
width: width,
height: height
@@ -870,7 +870,7 @@ define([
};
// map resize observer ----------------------------------------------------------------------------------------
if(window.ResizeObserver) {
if(window.ResizeObserver){
// ResizeObserver() supported
let resizeTimer;
let wrapperResize = new ResizeObserver(entries => { // jshint ignore:line
@@ -1059,7 +1059,7 @@ define([
// jsPlumb batch() is used, otherwise there are some "strange" visual bugs
// when switching maps (Endpoints are not displayed correctly)
mapConfig.map.batch(function() {
mapConfig.map.batch(function(){
for(let j = 0; j < mapConfig.data.connections.length; j++){
let connectionData = mapConfig.data.connections[j];
@@ -1364,7 +1364,7 @@ define([
Util.showNotify({title: error.field + ' error', text: 'System: ' + error.message, type: error.type});
}
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': saveSystem', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -1430,7 +1430,7 @@ define([
data.currentSystem = currentCharacterLog.system;
}
requirejs(['text!templates/dialog/system.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/system.html', 'mustache'], function(template, Mustache){
let content = Mustache.render(template, data);
@@ -1446,7 +1446,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-check"></i> save',
className: 'btn-success',
callback: function (e) {
callback: function(e){
// get form Values
let form = $('#' + config.systemDialogId).find('form');
@@ -1517,11 +1517,11 @@ define([
}
});
systemDialog.on('show.bs.modal', function(e) {
systemDialog.on('show.bs.modal', function(e){
let modalContent = $('#' + config.systemDialogId);
// init "status" select2
for (let [statusName, data] of Object.entries(Init.systemStatus)){
for(let [statusName, data] of Object.entries(Init.systemStatus)){
statusData.push({id: data.id, text: data.label, class: data.class});
}
@@ -1531,7 +1531,7 @@ define([
});
});
systemDialog.on('shown.bs.modal', function(e) {
systemDialog.on('shown.bs.modal', function(e){
let modalContent = $('#' + config.systemDialogId);
// init system select live search - some delay until modal transition has finished
@@ -1568,12 +1568,12 @@ define([
showbuttons: false
});
headElement.on('save', function(e, params) {
headElement.on('save', function(e, params){
// system alias changed -> mark system as updated
system.markAsChanged();
});
headElement.on('shown', function(e, editable) {
headElement.on('shown', function(e, editable){
// hide tooltip when xEditable is visible
system.toggleSystemTooltip('hide', {});
@@ -1586,7 +1586,7 @@ define([
}, 0, inputElement);
});
headElement.on('hidden', function(e, editable) {
headElement.on('hidden', function(e, editable){
// show tooltip "again" on xEditable hidden
system.toggleSystemTooltip('show', {show: true});
@@ -1694,7 +1694,7 @@ define([
Util.showNotify({title: error.field + ' error', text: 'System: ' + error.message, type: error.type});
}
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
// remove this connection from map
this.map.detach(this.connection, {fireEvent: false});
@@ -1758,7 +1758,7 @@ define([
if(callback){
callback();
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': deleteSystem', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -2041,7 +2041,7 @@ define([
// init context menu
system.contextMenu({
menuSelector: '#' + config.systemContextMenuId,
menuSelected: function (params) {
menuSelected: function(params){
// click action
let action = params.selectedMenu.attr('data-action');
@@ -2071,7 +2071,7 @@ define([
break;
case 'set_rally':
// toggle rally point
if( !currentSystem.data( 'rallyUpdated' ) ){
if( !currentSystem.data('rallyUpdated') ){
$.fn.showRallyPointDialog(currentSystem);
}else{
// remove rally point
@@ -2250,7 +2250,7 @@ define([
let systemName = system.getSystemInfo( ['alias'] );
if( system.data( 'locked' ) === true ){
if( system.data('locked') === true ){
system.data('locked', false);
system.removeClass( config.systemLockedClass );
@@ -2313,18 +2313,18 @@ define([
newJsPlumbInstance.registerConnectionTypes(globalMapConfig.connectionTypes);
// event after a new connection is established --------------------------
newJsPlumbInstance.bind('connection', function(info, e) {
newJsPlumbInstance.bind('connection', function(info, e){
// set connection observer
setConnectionObserver(newJsPlumbInstance, info.connection);
});
// event after connection moved ---------------------------------------------------------------------------
newJsPlumbInstance.bind('connectionMoved', function(info, e) {
newJsPlumbInstance.bind('connectionMoved', function(info, e){
});
// event after DragStop a connection or new connection ----------------------------------------------------
newJsPlumbInstance.bind('beforeDrop', function(info) {
newJsPlumbInstance.bind('beforeDrop', function(info){
let connection = info.connection;
let dropEndpoint = info.dropEndpoint;
let sourceId = info.sourceId;
@@ -2367,7 +2367,7 @@ define([
// prevent multiple connections between same systems
let connections = MapUtil.checkForConnection(newJsPlumbInstance, sourceId, targetId);
if(connections.length > 1){
bootbox.confirm('Connection already exists. Do you really want to add an additional one?', function(result) {
bootbox.confirm('Connection already exists. Do you really want to add an additional one?', function(result){
if(!result && connection._jsPlumb){
// connection._jsPlumb might be "undefined" in case connection was removed in the meantime
connection._jsPlumb.instance.detach(connection);
@@ -2382,12 +2382,12 @@ define([
});
// event before detach (existing connection) --------------------------------------------------------------
newJsPlumbInstance.bind('beforeStartDetach', function(info) {
newJsPlumbInstance.bind('beforeStartDetach', function(info){
return true;
});
// event before detach connection -------------------------------------------------------------------------
newJsPlumbInstance.bind('beforeDetach', function(info) {
newJsPlumbInstance.bind('beforeDetach', function(info){
return true;
});
@@ -2443,7 +2443,7 @@ define([
mapContainer.contextMenu({
menuSelector: '#' + config.mapContextMenuId,
menuSelected: function (params) {
menuSelected: function(params){
// click action
let action = params.selectedMenu.attr('data-action');
@@ -2540,7 +2540,7 @@ define([
mapContainer.dragToSelect({
selectOnMove: true,
selectables: '.' + config.systemClass,
onHide: function (selectBox, deselectedSystems) {
onHide: function(selectBox, deselectedSystems){
let selectedSystems = mapContainer.getSelectedSystems();
if(selectedSystems.length > 0){
@@ -2709,7 +2709,7 @@ define([
let data = MapUtil.mapOptions[mapOption.option];
let promiseStore = MapUtil.getLocaleData('map', mapElement.data('id') );
promiseStore.then(function(dataStore) {
promiseStore.then(function(dataStore){
let notificationText = 'disabled';
let button = $('#' + this.data.buttonId);
let dataExists = false;
@@ -2733,7 +2733,7 @@ define([
// call optional jQuery extension on mapElement
if(this.data.onDisable){
$.fn[ this.data.onDisable ].apply( this.mapElement );
$.fn[ this.data.onDisable ].apply(this.mapElement);
}
// show map overlay info icon
@@ -2752,7 +2752,7 @@ define([
// call optional jQuery extension on mapElement
if(this.data.onEnable){
$.fn[ this.data.onEnable ].apply( this.mapElement );
$.fn[ this.data.onEnable ].apply(this.mapElement);
}
// hide map overlay info icon
@@ -2832,7 +2832,7 @@ define([
currentCharacterLog &&
currentCharacterLog.system
){
let currentSystemData = currentMapData.data.systems.filter(function (system) {
let currentSystemData = currentMapData.data.systems.filter(function(system){
return system.systemId === currentCharacterLog.system.id;
});
@@ -2957,11 +2957,11 @@ define([
let j = userData.data.systems.length;
// search backwards to avoid decrement the counter after splice()
while (j--) {
while(j--){
let systemData = userData.data.systems[j];
// check if any user is in this system
if (systemId === systemData.id) {
if(systemId === systemData.id){
tempUserData = systemData;
// add "user count" to "total map user count"

View File

@@ -7,7 +7,7 @@ define([
'app/init',
'app/util',
'app/map/util'
], function($, Init, Util, MapUtil) {
], function($, Init, Util, MapUtil){
'use strict';
let config = {
@@ -85,7 +85,7 @@ define([
};
// loop through all map connections (get from DOM)
for(let connection of connections) {
for(let connection of connections){
let connectionId = connection.getParameter('connectionId');
let sourceEndpoint = connection.endpoints[0];
let targetEndpoint = connection.endpoints[1];
@@ -199,7 +199,7 @@ define([
iconElement.data(dataName, defaultIconClass);
}
iconElement.toggleClass( defaultIconClass + ' fa-sync fa-spin' );
iconElement.toggleClass( defaultIconClass + ' fa-sync fa-spin');
};
/**
@@ -211,7 +211,7 @@ define([
let dataName = 'default-icon';
let defaultIconClass = iconElement.data(dataName);
iconElement.toggleClass( defaultIconClass + ' fa-sync fa-spin' );
iconElement.toggleClass( defaultIconClass + ' fa-sync fa-spin');
};
/**
@@ -247,7 +247,7 @@ define([
this.mapElement.hideEndpointOverlays();
// ... add overlays
callback(this.connections, connectionsData);
}).always(function() {
}).always(function(){
hideLoading(this.overlayConnectionIcon);
});
};
@@ -275,7 +275,7 @@ define([
let MapUtil = require('app/map/util');
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh');
for (let connection of connections){
for(let connection of connections){
connection.removeOverlays(config.connectionOverlayArrowId);
connection.endpoints.forEach(removeEndpointOverlay);
}
@@ -326,7 +326,7 @@ define([
mapElement.find('.' + config.systemHeadClass).each(function(){
let system = $(this);
// init tooltip if not already exists
if ( !system.data('bs.tooltip') ){
if( !system.data('bs.tooltip') ){
system.tooltip({
container: mapElement,
placement: 'right',
@@ -379,7 +379,7 @@ define([
let serverDate = Util.getServerTime();
// show connection overlays ---------------------------------------------------
for (let connection of connections) {
for(let connection of connections){
let createdTimestamp = connection.getParameter('created');
let updatedTimestamp = connection.getParameter('updated');
@@ -412,7 +412,7 @@ define([
let MapUtil = require('app/map/util');
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh');
for (let connection of connections){
for(let connection of connections){
connection.removeOverlays(config.connectionOverlayId);
}
}
@@ -430,7 +430,7 @@ define([
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh', ['wh_eol']);
let serverDate = Util.getServerTime();
for (let connection of connections) {
for(let connection of connections){
let eolTimestamp = connection.getParameter('eolUpdated');
let eolDate = Util.convertTimestampToServerTime(eolTimestamp);
let diff = Util.getTimeDiffParts(eolDate, serverDate);
@@ -451,7 +451,7 @@ define([
let MapUtil = require('app/map/util');
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh', ['wh_eol']);
for (let connection of connections) {
for(let connection of connections){
connection.removeOverlay(config.connectionOverlayEolId);
}
}
@@ -704,7 +704,7 @@ define([
});
// add all overlay elements
for (let prop in options) {
for(let prop in options){
if(options.hasOwnProperty(prop)){
let icon = $('<i>', {
class: options[prop].iconClass.concat( ['pull-right', options[prop].class] ).join(' ')

View File

@@ -5,7 +5,7 @@ define([
'jquery',
'app/init',
'app/util'
], function($, Init, Util) {
], function($, Init, Util){
'use strict';
/**

View File

@@ -52,7 +52,7 @@ define([
let systemId = system.data('id');
let mapData = Util.getCurrentMapData(mapId);
requirejs(['text!templates/dialog/system_rally.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/system_rally.html', 'mustache'], function(template, Mustache){
let setCheckboxObserver = (checkboxes) => {
checkboxes.each(function(){
@@ -87,7 +87,7 @@ define([
context: context
}).done(function(data){
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': sendPoke', text: reason, type: 'warning'});
}).always(function(){
@@ -127,7 +127,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-volume-up"></i> set rally point',
className: 'btn-success',
callback: function() {
callback: function(){
let form = $('#' + config.dialogRallyId).find('form');
// get form data
let formData = form.getFormValues();
@@ -168,7 +168,7 @@ define([
let validDeleteSystems = [];
let activeCharacters = 0;
// check if systems belong to map -> security check
for (let system of systems) {
for(let system of systems){
let systemElement = $(system);
if(
systemElement.data('mapid') === mapContainer.data('id') &&
@@ -333,7 +333,7 @@ define([
system.attr('title', getTitle(tooltipOptions.userCount, tooltipOptions.highlight));
system.tooltip(options);
system.one('shown.bs.tooltip', function() {
system.one('shown.bs.tooltip', function(){
// set highlight only on FIRST show
$('#' + this.innerTooltipId).addClass(this.highlightClass);
}.bind({
@@ -397,7 +397,7 @@ define([
removeSystems(this.map, deletedSystems);
callback(deletedSystems);
}).fail(function(jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': deleteSystem', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -414,7 +414,7 @@ define([
map.remove(deleteSystem);
};
for (let system of systems){
for(let system of systems){
system = $(system);
// check if system is "active"

View File

@@ -121,7 +121,7 @@ define([
for(let i = 0; i < checkMapTypes.length; i++){
let objectId = Util.getCurrentUserInfo(checkMapTypes[i] + 'Id');
if(objectId > 0) {
if(objectId > 0){
// check if User could add new map with a mapType
let currentObjectMapData = Util.filterCurrentMapData('config.type.id', Util.getObjVal(mapTypes, checkMapTypes[i] + '.id'));
let maxCountObject = Util.getObjVal(mapTypes, checkMapTypes[i] + '.defaultConfig.max_count');
@@ -131,7 +131,7 @@ define([
}
}
for(let mapType in mapTypes) {
for(let mapType in mapTypes){
if(authorizedMapTypes.indexOf(mapType) < 0){
delete( mapTypes[mapType] );
}
@@ -971,7 +971,7 @@ define([
if(objectId > 0){
// get current map config
let storageKey = getLocalStoragePrefixByType(type) + objectId;
Util.getLocalStorage().getItem(storageKey).then(function(data) {
Util.getLocalStorage().getItem(storageKey).then(function(data){
// This code runs once the value has been loaded
// from the offline store.
data = (data === null) ? {} : data;
@@ -982,7 +982,7 @@ define([
key: key,
value: value,
storageKey: storageKey
})).catch(function(err) {
})).catch(function(err){
// This code runs if there were any errors
console.error('Map local storage can not be accessed!');
});
@@ -1180,7 +1180,7 @@ define([
if(objectId > 0){
// get current map config
let storageKey = getLocalStoragePrefixByType(type) + objectId;
Util.getLocalStorage().getItem(storageKey).then(function(data) {
Util.getLocalStorage().getItem(storageKey).then(function(data){
if(
data &&
data.hasOwnProperty(key)
@@ -1248,7 +1248,7 @@ define([
let mapId = system.data('mapid');
let systemId = system.data('id');
let promiseStore = getLocaleData('map', mapId);
promiseStore.then(function(data) {
promiseStore.then(function(data){
// This code runs once the value has been loaded
// from the offline store.
let rallyPokeData = {};
@@ -1633,7 +1633,7 @@ define([
}else{
console.warn('Missing systemData in response!', requestData);
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
console.warn('Fail request systemData!', requestData);
});
};

View File

@@ -4,7 +4,7 @@
define([
'app/util'
], function(Util) {
], function(Util){
'use strict';
let config = {

View File

@@ -61,7 +61,7 @@ define([
* -> stop program from working -> shutdown
*/
let clearUpdateTimeouts = () => {
for(let intervalKey in updateTimeouts) {
for(let intervalKey in updateTimeouts){
if(updateTimeouts.hasOwnProperty(intervalKey)){
clearTimeout(updateTimeouts[intervalKey]);
}
@@ -201,7 +201,7 @@ define([
Page.initMapContextMenus();
// init map module
mapModule.initMapModule() ;
mapModule.initMapModule();
// load info (maintenance) info panel (if scheduled)
if(Init.programMode.maintenance){
@@ -253,7 +253,7 @@ define([
},
onOpen: (MsgWorkerMessage) => {
Util.setSyncStatus(MsgWorkerMessage.command, MsgWorkerMessage.meta());
MapWorker.send( 'subscribe', response.data);
MapWorker.send('subscribe', response.data);
resolve(getPayload(MsgWorkerMessage.command));
},
@@ -396,7 +396,7 @@ define([
}else{
$(document).setProgramStatus('online');
if(data.userData !== undefined) {
if(data.userData !== undefined){
// store current user data global (cache)
Util.setCurrentUserData(data.userData);
}
@@ -526,7 +526,7 @@ define([
// Send map update request on tab close/reload, in order to save map changes that
// haven´t been saved through default update trigger
window.addEventListener('beforeunload', function(e) {
window.addEventListener('beforeunload', function(e){
// save unsaved map changes ...
triggerMapUpdatePing();

View File

@@ -246,7 +246,7 @@ define([
*/
let showPanel = (parentElement, Module, mapId, data) => {
let moduleElement = Module.getModule(parentElement, mapId, data);
if(moduleElement) {
if(moduleElement){
// store Module object to DOM element for further access
moduleElement.data('module', Module);
moduleElement.data('data', data);
@@ -255,7 +255,7 @@ define([
// check module position from local storage
let promiseStore = MapUtil.getLocaleData('map', mapId);
promiseStore.then(function (dataStore) {
promiseStore.then(function(dataStore){
let Module = this.moduleElement.data('module');
let defaultPosition = Module.config.modulePosition || 0;
@@ -270,7 +270,7 @@ define([
dataStore[key]
){
let positionIndex = dataStore[key].indexOf(Module.config.moduleName);
if(positionIndex !== -1) {
if(positionIndex !== -1){
// first index (0) => is position 1
defaultPosition = positionIndex + 1;
}
@@ -286,13 +286,13 @@ define([
// -> no :nth-child or :nth-of-type here because there might be temporary "spacer" div "modules"
// that should be ignored for positioning
let prevModuleElement = this.parentElement.find('.' + config.moduleClass).filter(i => ++i === position);
if(prevModuleElement.length) {
if(prevModuleElement.length){
this.moduleElement.insertAfter(prevModuleElement);
} else {
}else{
this.parentElement.prepend(this.moduleElement);
}
if(typeof Module.beforeShow === 'function') {
if(typeof Module.beforeShow === 'function'){
Module.beforeShow(this.moduleElement, moduleElement.data('data'));
}
@@ -303,10 +303,10 @@ define([
}, {
duration: Init.animationSpeed.mapModule,
easing: 'easeOutSine',
complete: function (moduleElement) {
complete: function(moduleElement){
moduleElement = $(moduleElement);
let Module = $(moduleElement).data('module');
if(typeof Module.initModule === 'function') {
if(typeof Module.initModule === 'function'){
Module.initModule(moduleElement, mapId, moduleElement.data('data'));
}
@@ -330,11 +330,11 @@ define([
// check if module already exists
let moduleElement = parentElement.find('.' + Module.config.moduleTypeClass);
if(moduleElement.length > 0) {
if(moduleElement.length > 0){
removeModule(moduleElement, Module, () => {
showPanel(parentElement, Module, mapId, data);
}, true);
} else {
}else{
showPanel(parentElement, Module, mapId, data);
}
};
@@ -487,7 +487,7 @@ define([
systemData.id === currentSystemData.systemData.id
){
// trigger system update events
let tabContentElement = $( '#' + config.mapTabIdPrefix + systemData.mapId + '.' + config.mapTabContentClass);
let tabContentElement = $('#' + config.mapTabIdPrefix + systemData.mapId + '.' + config.mapTabContentClass);
tabContentElement.trigger('pf:updateSystemModules', [systemData]);
}
}
@@ -514,15 +514,15 @@ define([
dataIdAttr: 'data-module',
sort: true,
store: {
get: function (sortable) {
get: function(sortable){
return [];
},
set: function (sortable) {
set: function(sortable){
let key = 'modules_' + sortable.options.group.name;
MapUtil.storeLocalData('map', mapId, key, sortable.toArray());
}
},
onStart: function (e) {
onStart: function(e){
// Element dragging started
// -> save initial sort state -> see store.set()
this.save();
@@ -686,17 +686,17 @@ define([
return !Boolean(mapId);
},
store: {
get: function (sortable) {
get: function(sortable){
return [];
},
set: function (sortable) {
set: function(sortable){
let key = 'maps_' + sortable.options.group.name;
// convert string array to int array
let order = sortable.toArray().map((x) => parseInt(x, 10));
MapUtil.storeLocalData('character', characterId, key, order);
}
},
onStart: function (e) {
onStart: function(e){
// Element dragging started
// -> save initial sort state -> see store.set()
this.save();
@@ -790,7 +790,7 @@ define([
}
// change url to unique map URL
if(history.pushState) {
if(history.pushState){
let mapUrl = MapUtil.getMapDeeplinkUrl(mapConfig.config.id);
history.pushState({}, '', mapUrl);
}
@@ -1002,7 +1002,7 @@ define([
let key = 'maps_list_' + tabBar.attr('data-position');
if(dataStore && dataStore[key]){
let positionIndex = dataStore[key].indexOf(this.options.id);
if(positionIndex !== -1) {
if(positionIndex !== -1){
// first index (0) => is position 1
defaultPosition = positionIndex + 1;
}
@@ -1014,9 +1014,9 @@ define([
// insert at correct position -------------------------------------------------------------------------
let prevListElement = tabBar.find('li' + '' + ':nth-child(' + position + ')');
if(prevListElement.length) {
if(prevListElement.length){
tabListElement.insertAfter(prevListElement);
} else {
}else{
tabBar.prepend(tabListElement);
}
@@ -1267,7 +1267,7 @@ define([
}
// add new tabs for new maps
for(let data of tempMapData) {
for(let data of tempMapData){
if( activeMapIds.indexOf( data.config.id ) === -1 ){
// add new map tab
promisesAddTab.push(addTab(tabMapElement, data.config, currentUserData).then(tabAddCallback));
@@ -1310,14 +1310,14 @@ define([
// add new tab for each map
for(let j = 0; j < tempMapData.length; j++){
let data = tempMapData[j];
promisesAddTab.push(addTab(tabMapElement, data.config, currentUserData)) ;
promisesAddTab.push(addTab(tabMapElement, data.config, currentUserData));
}
// add "add" button
let tabAddOptions = {
id: 0,
type: {
classTab: MapUtil.getInfoForMap( 'standard', 'classTab')
classTab: MapUtil.getInfoForMap('standard', 'classTab')
},
icon: 'fa-plus',
name: 'add',

View File

@@ -8,7 +8,7 @@ define([
'pnotify.desktop',
//'pnotify.history',
'pnotify.callbacks'
], function($, Init, PNotify) {
], function($, Init, PNotify){
'use strict';
@@ -169,8 +169,8 @@ define([
}
};
return function () {
if (!blinkTimer) {
return function(){
if(!blinkTimer){
blinkTimer = setInterval(blink, 1000);
}
};

View File

@@ -265,7 +265,7 @@ define([
})
).on('click', function(){
let fullScreenElement = $('body');
requirejs(['jquery', 'fullScreen'], function($) {
requirejs(['jquery', 'fullScreen'], function($){
if($.fullscreen.isFullScreen()){
$.fullscreen.exit();
@@ -313,7 +313,7 @@ define([
)
);
requirejs(['fullScreen'], function() {
requirejs(['fullScreen'], function(){
if($.fullscreen.isNativelySupported() === true){
$('#' + Util.config.menuButtonFullScreenId).removeClass('hide');
}
@@ -501,12 +501,12 @@ define([
});
// main menus
$('.' + config.headMenuClass).on('click', function(e) {
$('.' + config.headMenuClass).on('click', function(e){
e.preventDefault();
slideMenu.slidebars.toggle('left');
});
$('.' + config.headMapClass).on('click', function(e) {
$('.' + config.headMapClass).on('click', function(e){
e.preventDefault();
slideMenu.slidebars.toggle('right');
});
@@ -548,7 +548,7 @@ define([
// -> always "enable"
mapTrackingCheckbox.bootstrapToggle('on');
mapTrackingCheckbox.on('change', function(e) {
mapTrackingCheckbox.on('change', function(e){
let value = $(this).is(':checked');
let tracking = 'off';
let trackingText = 'Your current location will not actually be added';
@@ -734,7 +734,7 @@ define([
// END menu events =============================================================================
// global "popover" callback (for all popovers)
$('.' + Util.config.popoverTriggerClass).on('hide.bs.popover', function(e) {
$('.' + Util.config.popoverTriggerClass).on('hide.bs.popover', function(e){
let popoverElement = $(this).data('bs.popover').tip();
// destroy all active tooltips inside this popover
@@ -742,7 +742,7 @@ define([
});
// global "modal" callback (for all modals)
$('body').on('hide.bs.modal', '> .modal', function(e) {
$('body').on('hide.bs.modal', '> .modal', function(e){
let modalElement = $(this);
modalElement.destroyTimestampCounter(true);
@@ -969,7 +969,7 @@ define([
animateHeaderElement(userInfoElement, (userInfoElement) => {
if(currentCharacterChanged){
userInfoElement.find('span').text( newCharacterName );
userInfoElement.find('img').attr('src', Init.url.ccpImageServer + '/Character/' + newCharacterId + '_32.jpg' );
userInfoElement.find('img').attr('src', Init.url.ccpImageServer + '/Character/' + newCharacterId + '_32.jpg');
}
// init "character switch" popover
userInfoElement.initCharacterSwitchPopover(userData);
@@ -990,7 +990,7 @@ define([
// toggle element
animateHeaderElement(userShipElement, (userShipElement) => {
userShipElement.find('span').text( newShipData.typeName );
userShipElement.find('img').attr('src', Init.url.ccpImageServer + '/Render/' + newShipData.typeId + '_32.png' );
userShipElement.find('img').attr('src', Init.url.ccpImageServer + '/Render/' + newShipData.typeId + '_32.png');
// trigger ship change event
$(document).trigger('pf:activeShip', {
shipData: newShipData
@@ -1122,30 +1122,30 @@ define([
// Set the name of the hidden property and the change event for visibility
let hidden, visibilityChange;
if (typeof document.hidden !== 'undefined') { // Opera 12.10 and Firefox 18 and later support
if(typeof document.hidden !== 'undefined'){ // Opera 12.10 and Firefox 18 and later support
hidden = 'hidden';
visibilityChange = 'visibilitychange';
} else if (typeof document.mozHidden !== 'undefined') {
}else if(typeof document.mozHidden !== 'undefined'){
hidden = 'mozHidden';
visibilityChange = 'mozvisibilitychange';
} else if (typeof document.msHidden !== 'undefined') {
}else if(typeof document.msHidden !== 'undefined'){
hidden = 'msHidden';
visibilityChange = 'msvisibilitychange';
} else if (typeof document.webkitHidden !== 'undefined') {
}else if(typeof document.webkitHidden !== 'undefined'){
hidden = 'webkitHidden';
visibilityChange = 'webkitvisibilitychange';
}
// function is called if the tab becomes active/inactive
let handleVisibilityChange = () => {
if (document[hidden]) {
if(document[hidden]){
// tab is invisible
// globally store current visibility status
window.isVisible = false;
Util.getCurrentTriggerDelay( mapUpdateKey, increaseTimer );
Util.getCurrentTriggerDelay( mapUserUpdateKey, increaseTimer );
} else {
}else{
// tab is visible
// globally store current visibility status
window.isVisible = true;
@@ -1158,7 +1158,7 @@ define([
}
};
if (
if(
typeof document.addEventListener !== 'undefined' &&
typeof document[hidden] !== 'undefined'
){
@@ -1268,16 +1268,16 @@ define([
* show information panel to active users (on bottom)
* @returns {*|jQuery|HTMLElement}
*/
$.fn.showGlobalInfoPanel = function (){
$.fn.showGlobalInfoPanel = function(){
let body = $(this);
let infoTemplate = 'text!templates/ui/info_panel.html';
requirejs([infoTemplate, 'mustache'], function(template, Mustache) {
requirejs([infoTemplate, 'mustache'], function(template, Mustache){
let data = {
id: config.globalInfoPanelId
};
let content = $( Mustache.render(template, data) );
content.insertBefore( '#' + config.pageFooterId );
content.insertBefore('#' + config.pageFooterId );
});
return body;
@@ -1296,7 +1296,7 @@ define([
// add "unchecked" checkboxes as well
values = values.concat(
form.find('input[type=checkbox]:not(:checked)').map(
function() {
function(){
return {name: this.name, value: 0};
}).get()
);

View File

@@ -2,7 +2,7 @@
* Render controller
*/
define(['jquery', 'mustache'], function($, Mustache) {
define(['jquery', 'mustache'], function($, Mustache){
'use strict';
@@ -28,7 +28,7 @@ define(['jquery', 'mustache'], function($, Mustache) {
*/
let showModule = function(config, data){
// require module template
requirejs(['text!templates/' + config.name + '.html'], function(template) {
requirejs(['text!templates/' + config.name + '.html'], function(template){
// check for an id, if module already exists, do not insert again
if(
data.id === 'undefined' ||
@@ -64,7 +64,7 @@ define(['jquery', 'mustache'], function($, Mustache) {
let highlightJson = (obj) => {
let multiplyString = (num, str) => {
let sb = [];
for (let i = 0; i < num; i++) {
for(let i = 0; i < num; i++){
sb.push(str);
}
return sb.join('');
@@ -77,35 +77,35 @@ define(['jquery', 'mustache'], function($, Mustache) {
let quoteKeys = false;
let expImageClicked = '(() => {let container=this.parentNode.nextSibling; container.style.display=container.style.display===\'none\'?\'inline\':\'none\'})();';
let checkForArray = function (obj) {
let checkForArray = function(obj){
return obj &&
typeof obj === 'object' &&
typeof obj.length === 'number' &&
!(obj.propertyIsEnumerable('length'));
};
let getRow = function (indent, data, isPropertyContent) {
let getRow = function(indent, data, isPropertyContent){
let tabs = '';
for (let i = 0; i < indent && !isPropertyContent; i++) tabs += tab;
if (data !== null && data.length > 0 && data.charAt(data.length - 1) !== '\n')
for(let i = 0; i < indent && !isPropertyContent; i++) tabs += tab;
if(data !== null && data.length > 0 && data.charAt(data.length - 1) !== '\n')
data = data + '\n';
return tabs + data;
};
let formatLiteral = function (literal, quote, comma, indent, isArray, style) {
if (typeof literal === 'string')
let formatLiteral = function(literal, quote, comma, indent, isArray, style){
if(typeof literal === 'string')
literal = literal.split('<').join('&lt;').split('>').join('&gt;');
let str = '<span class="' + style + '">' + quote + literal + quote + comma + '</span>';
if (isArray) str = getRow(indent, str);
if(isArray) str = getRow(indent, str);
return str;
};
let formatFunction = function (indent, obj) {
let formatFunction = function(indent, obj){
let tabs = '';
for (let i = 0; i < indent; i++) tabs += tab;
for(let i = 0; i < indent; i++) tabs += tab;
let funcStrArray = obj.toString().split('\n');
let str = '';
for (let i = 0; i < funcStrArray.length; i++) {
for(let i = 0; i < funcStrArray.length; i++){
str += ((i === 0) ? '' : tabs) + funcStrArray[i] + '\n';
}
return str;
@@ -118,36 +118,36 @@ define(['jquery', 'mustache'], function($, Mustache) {
let comma = (addComma) ? '<span class="pf-code-Comma">,</span> ' : '';
let type = typeof obj;
let clpsHtml = '';
if (checkForArray(obj)) {
if (obj.length === 0) {
if(checkForArray(obj)){
if(obj.length === 0){
html += getRow(indent, '<span class="pf-code-ArrayBrace">[ ]</span>' + comma, isPropertyContent);
} else {
}else{
clpsHtml = isCollapsible ? '<span><i class="fas fa-fw fa-plus-square" onClick="' + expImageClicked + '"></i></span><span class="collapsible">' : '';
html += getRow(indent, '<span class="pf-code-ArrayBrace">[</span>' + clpsHtml, isPropertyContent);
for (let i = 0; i < obj.length; i++) {
for(let i = 0; i < obj.length; i++){
html += highlight(obj[i], indent + 1, i < (obj.length - 1), true, false);
}
clpsHtml = isCollapsible ? '</span>' : '';
html += getRow(indent, clpsHtml + '<span class="pf-code-ArrayBrace">]</span>' + comma);
}
} else if (type === 'object') {
if (obj === null) {
}else if(type === 'object'){
if(obj === null){
html += formatLiteral('null', '', comma, indent, isArray, 'pf-code-Null');
} else if (obj.constructor === dateObj.constructor) {
}else if(obj.constructor === dateObj.constructor){
html += formatLiteral('new Date(' + obj.getTime() + ') /*' + obj.toLocaleString() + '*/', '', comma, indent, isArray, 'Date');
} else if (obj.constructor === regexpObj.constructor) {
}else if(obj.constructor === regexpObj.constructor){
html += formatLiteral('new RegExp(' + obj + ')', '', comma, indent, isArray, 'RegExp');
} else {
}else{
let numProps = 0;
for (let prop in obj) numProps++;
if (numProps === 0) {
for(let prop in obj) numProps++;
if(numProps === 0){
html += getRow(indent, '<span class="pf-code-ObjectBrace">{ }</span>' + comma, isPropertyContent);
} else {
}else{
clpsHtml = isCollapsible ? '<span><i class="fas fa-fw fa-plus-square" onClick="' + expImageClicked + '"></i></span><span class="collapsible">' : '';
html += getRow(indent, '<span class="pf-code-ObjectBrace">{</span>' + clpsHtml, isPropertyContent);
let j = 0;
for (let prop in obj) {
if (obj.hasOwnProperty(prop)) {
for(let prop in obj){
if(obj.hasOwnProperty(prop)){
let quote = quoteKeys ? '"' : '';
html += getRow(indent + 1, '<span class="pf-code-PropertyName">' + quote + prop + quote + '</span>: ' + highlight(obj[prop], indent + 1, ++j < numProps, false, true));
}
@@ -156,20 +156,20 @@ define(['jquery', 'mustache'], function($, Mustache) {
html += getRow(indent, clpsHtml + '<span class="pf-code-ObjectBrace">}</span>' + comma);
}
}
} else if (type === 'number') {
}else if(type === 'number'){
html += formatLiteral(obj, '', comma, indent, isArray, 'pf-code-Number');
} else if (type === 'boolean') {
}else if(type === 'boolean'){
html += formatLiteral(obj, '', comma, indent, isArray, 'pf-code-Boolean');
} else if (type === 'function') {
if (obj.constructor === regexpObj.constructor) {
}else if(type === 'function'){
if(obj.constructor === regexpObj.constructor){
html += formatLiteral('new RegExp(' + obj + ')', '', comma, indent, isArray, 'RegExp');
} else {
}else{
obj = formatFunction(indent, obj);
html += formatLiteral(obj, '', comma, indent, isArray, 'pf-code-Function');
}
} else if (type === 'undefined') {
}else if(type === 'undefined'){
html += formatLiteral('undefined', '', comma, indent, isArray, 'pf-code-Null');
} else {
}else{
html += formatLiteral(obj.toString().split('\\').join('\\\\').split('"').join('\\"'), '"', comma, indent, isArray, 'pf-code-String');
}

View File

@@ -7,7 +7,7 @@ define([
'app/init',
'app/util',
'app/map/worker'
], function($, Init, Util, MapWorker) {
], function($, Init, Util, MapWorker){
'use strict';
let config = {
@@ -35,7 +35,7 @@ define([
context: context
}).done(function(data){
callback(this, data);
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': Failed. Please retry', text: reason, type: 'warning'});
this.target.button('reset');
@@ -83,7 +83,7 @@ define([
body.initTooltips();
// change url (remove logout parameter)
if (history.pushState) {
if(history.pushState){
history.pushState({}, '', location.protocol + '//' + location.host + location.pathname);
}
};
@@ -139,7 +139,7 @@ define([
webSocketPanel.showLoadingAnimation();
let removeColorClasses = (el) => {
el.removeClass (function (index, css) {
el.removeClass (function(index, css){
return (css.match (/\btxt-color-\S+/g) || []).join(' ');
});
};

View File

@@ -5,7 +5,7 @@
define([
'jquery',
'lazylinepainter'
], function($) {
], function($){
'use strict';

View File

@@ -8,7 +8,7 @@ define([
'app/util',
'app/render',
'bootbox'
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
let config = {
@@ -42,7 +42,7 @@ define([
return false;
}
requirejs(['text!templates/dialog/settings.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/settings.html', 'mustache'], function(template, Mustache){
let data = {
id: config.settingsDialogId,
@@ -71,7 +71,7 @@ define([
success: {
label: '<i class="fas fa-check fa-fw"></i>&nbsp;save',
className: 'btn-success',
callback: function() {
callback: function(){
// get the current active form
let form = $('#' + config.settingsDialogId).find('form').filter(':visible');
@@ -133,7 +133,7 @@ define([
accountSettingsDialog.modal('hide');
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
accountSettingsDialog.find('.modal-content').hideLoadingAnimation();
let reason = status + ' ' + error;
@@ -183,7 +183,7 @@ define([
});
// after modal is shown =======================================================================
accountSettingsDialog.on('shown.bs.modal', function(e) {
accountSettingsDialog.on('shown.bs.modal', function(e){
let dialogElement = $(this);
let form = dialogElement.find('form');

View File

@@ -80,7 +80,7 @@ define([
showVersion(changelogDialog, versionData);
requirejs(['text!templates/ui/timeline_element.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/ui/timeline_element.html', 'mustache'], function(template, Mustache){
for(let i = 0; i < releasesData.length; i++){
let releaseData = releasesData[i];
@@ -103,10 +103,10 @@ define([
complete: function(){}
});
});
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + jqXHR.status + ': ' + error;
Util.showNotify({title: jqXHR.status + ': login', text: reason, type: 'error'});
}).always(function() {
}).always(function(){
dialogContent.hideLoadingAnimation();
});
};
@@ -132,7 +132,7 @@ define([
});
// after modal is shown =======================================================================
changelogDialog.on('shown.bs.modal', function(e) {
changelogDialog.on('shown.bs.modal', function(e){
loadDialogData(changelogDialog);
});
};

View File

@@ -9,7 +9,7 @@ define([
'app/render',
'bootbox',
'app/ui/logo'
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
let config = {
@@ -23,7 +23,7 @@ define([
*/
$.fn.showCreditsDialog = function(callback, enableHover){
requirejs(['text!templates/dialog/credit.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/credit.html', 'mustache'], function(template, Mustache){
let data = {
logoContainerId: config.creditsDialogLogoContainerId,
@@ -39,7 +39,7 @@ define([
});
// after modal is shown =======================================================================
creditDialog.on('shown.bs.modal', function(e) {
creditDialog.on('shown.bs.modal', function(e){
// load Logo svg
creditDialog.find('#' + config.creditsDialogLogoContainerId).drawLogo(callback, enableHover);

View File

@@ -88,7 +88,7 @@ define([
});
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
dialogElement.find('.modal-content').hideLoadingAnimation();
let reason = status + ' ' + error;

View File

@@ -25,7 +25,7 @@ define([
requirejs(['text!templates/dialog/jump_info.html', 'mustache'], (template, Mustache) => {
let data = {
config: config,
wormholes: Object.keys(Init.wormholes).map(function(k) { return Init.wormholes[k]; }), // convert Json to array
wormholes: Object.keys(Init.wormholes).map(function(k){ return Init.wormholes[k]; }), // convert Json to array
securityClass: function(){
return function(value, render){
return this.Util.getSecurityClassForSystem( render(value) );
@@ -77,7 +77,7 @@ define([
show: false
});
jumpDialog.on('show.bs.modal', function(e) {
jumpDialog.on('show.bs.modal', function(e){
// init dataTable
$(this).find('.' + config.wormholeInfoMassTableClass).DataTable({
pageLength: 25,

View File

@@ -8,7 +8,7 @@ define([
'app/util',
'app/render',
'bootbox',
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
@@ -26,7 +26,7 @@ define([
*/
$.fn.showMapManual = function(){
requirejs(['text!templates/dialog/map_manual.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/map_manual.html', 'mustache'], function(template, Mustache){
let data = {
dialogNavigationClass: config.dialogNavigationClass,
@@ -47,7 +47,7 @@ define([
success: {
label: 'close',
className: 'btn-default',
callback: function() {
callback: function(){
$(mapManualDialog).modal('hide');
}
}
@@ -66,7 +66,7 @@ define([
// scroll navigation links
let scrollNavLiElements = null;
mapManualDialog.on('shown.bs.modal', function(e) {
mapManualDialog.on('shown.bs.modal', function(e){
// modal on open
scrolLBreakpointElements = $('.pf-manual-scroll-break');
scrollNavLiElements = $('.' + config.dialogNavigationListItemClass);

View File

@@ -224,7 +224,7 @@ define([
systemsElement.showLoadingAnimation(config.loadingOptions);
systemTable.on( 'init.dt', function (){
systemTable.on('init.dt', function(){
systemsElement.hideLoadingAnimation();
// init table tooltips
@@ -520,7 +520,7 @@ define([
connectionsElement.showLoadingAnimation(config.loadingOptions);
// table init complete
connectionTable.on( 'init.dt', function (){
connectionTable.on('init.dt', function(){
connectionsElement.hideLoadingAnimation();
});
@@ -687,7 +687,7 @@ define([
usersElement.showLoadingAnimation(config.loadingOptions);
// table init complete
userTable.on( 'init.dt', function (){
userTable.on('init.dt', function(){
usersElement.hideLoadingAnimation();
// init table tooltips
@@ -834,7 +834,7 @@ define([
className: [config.tableCellActionClass, 'min-screen-l'].join(' '),
data: 'corporation',
render: {
_: function (data, type, row, meta){
_: function(data, type, row, meta){
let value = data.name;
if(type === 'display'){
value += '&nbsp;' + getIconForInformationWindow();
@@ -874,7 +874,7 @@ define([
data: 'log',
defaultContent: getLabelForUnknownData(),
render: {
_: function (data, type, row, meta){
_: function(data, type, row, meta){
let value = data;
if(data){
if(data.station && data.station.id > 0){
@@ -897,7 +897,7 @@ define([
className: ['text-right', 'min-screen-l'].join(' '),
data: 'role',
render: {
_: function (data, type, row, meta){
_: function(data, type, row, meta){
let value = data.label;
if(type === 'display'){
value = Util.getLabelByRole(data).prop('outerHTML');
@@ -961,7 +961,7 @@ define([
context: context
}).done(function(data){
this.callback(data, context);
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': loadLogs', text: reason, type: 'warning'});
}).always(function(){
@@ -1052,7 +1052,7 @@ define([
render: {
_: function(data, type, row, meta){
// strip microseconds
let logDateString = data.substring(0, 19) ;
let logDateString = data.substring(0, 19);
let logDate = new Date(logDateString.replace(/-/g, '/'));
data = Util.convertDateToString(logDate, true);
@@ -1204,7 +1204,7 @@ define([
let timestampColumn = tableApi.column('timestamp:name').header();
let timestampColumnCells = tableApi.cells(undefined, 'timestamp:name', {page: 'current', order:'current'});
let hasOldLogs = timestampColumnCells.render( 'display' ).reduce((hasOldLogs, cellValue) => {
let hasOldLogs = timestampColumnCells.render('display').reduce((hasOldLogs, cellValue) => {
return (hasOldLogs === false && !cellValue.startsWith('today')) ? true : hasOldLogs;
}, false);
@@ -1228,7 +1228,7 @@ define([
className: 'btn btn-sm btn-default',
text: '<i class="fas fa-fw fa-plus"></i>&nbsp;load more',
enabled: false,
action: function ( e, dt, node, config ){
action: function(e, dt, node, config ){
let pageInfo = dt.page.info();
getLogsData({

View File

@@ -315,7 +315,7 @@ define([
formatFilename: function(){
// format filename from "map name" (initial)
return function (mapName, render) {
return function(mapName, render){
let filename = render(mapName);
return formatFilename(filename);
};
@@ -340,7 +340,7 @@ define([
success: {
label: '<i class="fas fa-check fa-fw"></i>&nbsp;save',
className: 'btn-success',
callback: function() {
callback: function(){
// get the current active form
let form = $('#' + config.newMapDialogId).find('form').filter(':visible');
@@ -424,12 +424,12 @@ define([
$(mapInfoDialog).modal('hide');
$(document).trigger('pf:closeMenu', [{}]);
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': saveMap', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
}).always(function() {
}).always(function(){
dialogContent.hideLoadingAnimation();
});
}
@@ -449,7 +449,7 @@ define([
// prevent "disabled" tabs from being clicked... "bootstrap" bugFix...
mapInfoDialog.find('.navbar a[data-toggle=tab]').on('click', function(e){
if ($(this).hasClass('disabled')){
if($(this).hasClass('disabled')){
e.preventDefault();
return false;
}
@@ -532,7 +532,7 @@ define([
let output = [];
let files = e.target.files;
for (let i = 0, f; !!(f = files[i]); i++) {
for(let i = 0, f; !!(f = files[i]); i++){
output.push(( i + 1 ) + '. file: ' + f.name + ' - ' +
f.size + ' bytes; last modified: ' +
f.lastModifiedDate.toLocaleDateString() );
@@ -553,7 +553,7 @@ define([
let filesCountFail = 0;
// onLoad for FileReader API
let readerOnLoad = function(readEvent) {
let readerOnLoad = function(readEvent){
// get file content
try{
@@ -574,7 +574,7 @@ define([
}
};
let handleDragOver = function(dragEvent) {
let handleDragOver = function(dragEvent){
dragEvent.stopPropagation();
dragEvent.preventDefault();
dragEvent.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
@@ -591,7 +591,7 @@ define([
files = evt.dataTransfer.files; // FileList object.
for (let file; !!(file = files[filesCount]); filesCount++){
for(let file; !!(file = files[filesCount]); filesCount++){
let reader = new FileReader();
reader.onload = readerOnLoad;
reader.readAsText(file);
@@ -605,7 +605,7 @@ define([
}
// import "button"
downloadTabElement.find('#' + config.buttonImportId).on('click', function(e) {
downloadTabElement.find('#' + config.buttonImportId).on('click', function(e){
importFormElement.validator('validate');
let validImportForm = importFormElement.isValidForm();
@@ -619,7 +619,7 @@ define([
filesCount = 0;
filesCountFail = 0;
for (let file; !!(file = files[filesCount]); filesCount++){
for(let file; !!(file = files[filesCount]); filesCount++){
let reader = new FileReader();
reader.onload = readerOnLoad;
reader.readAsText(file);
@@ -710,10 +710,10 @@ define([
Util.showNotify({title: 'Import finished', text: 'Map(s) imported', type: 'success'});
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': importMap', text: reason, type: 'error'});
}).always(function() {
}).always(function(){
importForm.find('input, select').resetFormFields().trigger('change');
dialogContent.hideLoadingAnimation();
});
@@ -798,11 +798,11 @@ define([
dataType: 'json'
}).done(function(data){
Util.showNotify({title: 'Map deleted', text: 'Map: ' + mapName, type: 'success'});
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': deleteMap', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
}).always(function() {
}).always(function(){
$(mapDeleteDialog).modal('hide');
});

View File

@@ -8,7 +8,7 @@ define([
'app/util',
'app/render',
'bootbox'
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
@@ -52,7 +52,7 @@ define([
// close all modals
$('.modal').modal('hide');
requirejs(['text!templates/dialog/notification.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/notification.html', 'mustache'], function(template, Mustache){
let data = {
id: config.notificationDialogId,
@@ -70,7 +70,7 @@ define([
});
shutdownDialog.on('shown.bs.modal', function(e) {
shutdownDialog.on('shown.bs.modal', function(e){
// remove close button
let dialog = $(this);

View File

@@ -9,7 +9,7 @@ define([
'app/render',
'bootbox',
'app/key',
], function($, Init, Util, Render, bootbox, Key) {
], function($, Init, Util, Render, bootbox, Key){
'use strict';

View File

@@ -10,7 +10,7 @@ define([
'app/render',
'bootbox',
'peityInlineChart'
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
let config = {
@@ -355,7 +355,7 @@ define([
});
});
},
footerCallback: function ( row, data, start, end, display ) {
footerCallback: function(row, data, start, end, display ){
let api = this.api();
let sumColumnIndexes = [7, 11, 15, 19, 20];
@@ -417,7 +417,7 @@ define([
this.dynamicArea.hideLoadingAnimation();
this.callback(data);
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': loadStatistics', text: reason, type: 'warning'});
});
@@ -753,7 +753,7 @@ define([
* show activity stats dialog
*/
$.fn.showStatsDialog = function(){
requirejs(['text!templates/dialog/stats.html', 'mustache', 'datatables.loader'], function(template, Mustache) {
requirejs(['text!templates/dialog/stats.html', 'mustache', 'datatables.loader'], function(template, Mustache){
// get current statistics map settings
let logActivityEnabled = false;
let activeMap = Util.getMapModule().getActiveMap();
@@ -816,20 +816,20 @@ define([
});
// model events
statsDialog.on('show.bs.modal', function(e) {
statsDialog.on('show.bs.modal', function(e){
let dialogElement = $(e.target);
initStatsTable(dialogElement);
});
// Tab module events
statsDialog.find('a[data-toggle="tab"]').on('show.bs.tab', function (e, b, c) {
statsDialog.find('a[data-toggle="tab"]').on('show.bs.tab', function(e, b, c){
if( $(e.target).parent().hasClass('disabled') ){
// no action on "disabled" tabs
return false;
}
});
statsDialog.find('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
statsDialog.find('a[data-toggle="tab"]').on('shown.bs.tab', function(e){
let requestData = getRequestDataFromTabPanels(statsDialog);
let tableApi = statsDialog.find('#' + config.statsTableId).DataTable();

View File

@@ -10,7 +10,7 @@ define([
'app/render',
'bootbox',
'app/map/util'
], function($, Init, Util, Render, bootbox, MapUtil) {
], function($, Init, Util, Render, bootbox, MapUtil){
'use strict';
let config = {
@@ -36,7 +36,7 @@ define([
let systemEffectData = Util.getSystemEffectData();
$.each( systemEffectData.wh, function( effectName, effectData ) {
$.each( systemEffectData.wh, function(effectName, effectData ){
let table = $('<table>', {
class: ['table', 'table-condensed'].join(' ')
@@ -51,7 +51,7 @@ define([
let systemEffectName = MapUtil.getEffectInfoForSystem(effectName, 'name');
let systemEffectClass = MapUtil.getEffectInfoForSystem(effectName, 'class');
$.each( effectData, function( areaId, areaData ) {
$.each( effectData, function(areaId, areaData ){
let systemType = 'C' + areaId;
let securityClass = Util.getSecurityClassForSystem( systemType );
@@ -61,7 +61,7 @@ define([
thead.append( rows[0] );
rows[0].append(
$('<td>').html( '&nbsp;&nbsp;' + systemEffectName).prepend(
$('<td>').html('&nbsp;&nbsp;' + systemEffectName).prepend(
$('<i>', {
class: ['fas', 'fa-square', 'fa-fw', systemEffectClass].join(' ')
})
@@ -73,7 +73,7 @@ define([
class: ['text-right', 'col-xs-1', securityClass].join(' ')
}).text( systemType ));
$.each( areaData, function( i, data ) {
$.each( areaData, function(i, data ){
if(areaId === '1'){
rows.push( $('<tr>') );
@@ -92,7 +92,7 @@ define([
});
dialogWrapperElement.append( table.append( thead ).append( tbody ) );
dialogWrapperElement.append(table.append(thead).append(tbody));
cache.systemEffectDialog = dialogWrapperElement;
});

View File

@@ -231,11 +231,11 @@ define([
let shatteredClass = Util.getSecurityClassForSystem('SH');
// format result data
function formatResultData (data) {
function formatResultData (data){
if(data.loading) return data.text;
// abyss system font
let systemNameClass = data.security === 'A' ? Util.config.fontTriglivianClass : '' ;
let systemNameClass = data.security === 'A' ? Util.config.fontTriglivianClass : '';
// show effect info just for wormholes
let hideEffectClass = data.effect === null ? 'hide' : '';
@@ -272,7 +272,7 @@ define([
page: params.page || 1
};
},
processResults: function(data, params) {
processResults: function(data, params){
// parse the results into the format expected by Select2.
return {
results: data.results.map( function(item){
@@ -321,7 +321,7 @@ define([
}
};
},
error: function (jqXHR, status, error) {
error: function(jqXHR, status, error){
if( !Util.isXHRAborted(jqXHR) ){
let reason = status + ' ' + jqXHR.status + ': ' + error;
@@ -386,11 +386,11 @@ define([
delay: 250,
timeout: 5000,
cache: true,
data: function(params) {
data: function(params){
// no url params here
return;
},
processResults: function(data, page) {
processResults: function(data, page){
// parse the results into the format expected by Select2.
return {
results: data.map( function(item){
@@ -402,7 +402,7 @@ define([
})
};
},
error: function (jqXHR, status, error) {
error: function(jqXHR, status, error){
if( !Util.isXHRAborted(jqXHR) ){
let reason = status + ' ' + jqXHR.status + ': ' + error;
@@ -434,7 +434,7 @@ define([
* @param options
* @returns {*}
*/
$.fn.initUniverseSearch = function(options) {
$.fn.initUniverseSearch = function(options){
let showErrorNotification = (reason) => {
Util.showNotify({title: 'Search failed', text: reason + ' deleted', type: 'warning'});
@@ -495,7 +495,7 @@ define([
});
}
return this.each(function() {
return this.each(function(){
let selectElement = $(this);
$.when(
@@ -515,7 +515,7 @@ define([
categories: options.categoryNames
};
},
processResults: function(result, page) {
processResults: function(result, page){
let data = {results: []};
if(result.hasOwnProperty('error')){
showErrorNotification(result.error);
@@ -543,7 +543,7 @@ define([
return data;
},
error: function (jqXHR, status, error) {
error: function(jqXHR, status, error){
if( !Util.isXHRAborted(jqXHR) ){
let reason = status + ' ' + jqXHR.status + ': ' + error;
showErrorNotification(reason);
@@ -631,7 +631,7 @@ define([
return data;
};
return this.each(function() {
return this.each(function(){
let selectElement = $(this);
$.when(

View File

@@ -21,7 +21,7 @@ define([
let connectionCount = 4;
let initHeader = function() {
let initHeader = function(){
width = window.innerWidth;
height = canvasHeight;
target = {x: width * 1, y: 230};
@@ -34,8 +34,8 @@ define([
// create points
points = [];
for(let x = 0; x < width; x = x + width/20) {
for(let y = 0; y < height; y = y + height/15) {
for(let x = 0; x < width; x = x + width/20){
for(let y = 0; y < height; y = y + height/15){
let px = x + Math.random()*width/15;
let py = y + Math.random()*height/15;
let p = {x: px, originX: px, y: py, originY: py };
@@ -44,25 +44,25 @@ define([
}
// for each point find the 5 closest points
for(let i = 0; i < points.length; i++) {
for(let i = 0; i < points.length; i++){
let closest = [];
let p1 = points[i];
for(let j = 0; j < points.length; j++) {
for(let j = 0; j < points.length; j++){
let p2 = points[j];
if(p1 !== p2) {
if(p1 !== p2){
let placed = false;
for(let k = 0; k < connectionCount; k++) {
if(!placed) {
if(closest[k] === undefined) {
for(let k = 0; k < connectionCount; k++){
if(!placed){
if(closest[k] === undefined){
closest[k] = p2;
placed = true;
}
}
}
for(let m = 0; m < connectionCount; m++) {
if(!placed) {
if(getDistance(p1, p2) < getDistance(p1, closest[m])) {
for(let m = 0; m < connectionCount; m++){
if(!placed){
if(getDistance(p1, p2) < getDistance(p1, closest[m])){
closest[m] = p2;
placed = true;
}
@@ -74,28 +74,28 @@ define([
}
// assign a circle to each point
for(let n in points) {
for(let n in points){
let c = new Circle(points[n], 2+Math.random()*2, 'rgba(255,255,255,0.3)');
points[n].circle = c;
}
};
// Event handling
let addListeners = function() {
if(!('ontouchstart' in window)) {
let addListeners = function(){
if(!('ontouchstart' in window)){
window.addEventListener('mousemove', mouseMove);
}
window.addEventListener('scroll', scrollCheck);
window.addEventListener('resize', resize);
};
let mouseMove = function(e) {
let mouseMove = function(e){
let posx = 0;
let posy = 0;
if (e.pageX || e.pageY) {
if(e.pageX || e.pageY){
posx = e.pageX;
posy = e.pageY;
}else if (e.clientX || e.clientY){
}else if(e.clientX || e.clientY){
posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
@@ -103,7 +103,7 @@ define([
target.y = posy;
};
let scrollCheck = function() {
let scrollCheck = function(){
if(document.body.scrollTop > height){
animateHeader = false;
}else{
@@ -111,7 +111,7 @@ define([
}
};
let resize = function() {
let resize = function(){
width = window.innerWidth;
height = canvasHeight;
largeHeader.style.height = height+'px';
@@ -120,28 +120,28 @@ define([
};
// animation
let initAnimation = function() {
let initAnimation = function(){
animate();
for(let i in points) {
for(let i in points){
shiftPoint(points[i]);
}
};
let animate = function animate() {
if(animateHeader) {
let animate = function animate(){
if(animateHeader){
ctx.clearRect(0,0,width,height);
for(let i in points) {
for(let i in points){
// detect points in range
if(Math.abs(getDistance(target, points[i])) < 4000) {
if(Math.abs(getDistance(target, points[i])) < 4000){
points[i].active = 0.25;
points[i].circle.active = 0.45;
} else if(Math.abs(getDistance(target, points[i])) < 20000) {
}else if(Math.abs(getDistance(target, points[i])) < 20000){
points[i].active = 0.1;
points[i].circle.active = 0.3;
} else if(Math.abs(getDistance(target, points[i])) < 40000) {
}else if(Math.abs(getDistance(target, points[i])) < 40000){
points[i].active = 0.02;
points[i].circle.active = 0.1;
} else {
}else{
points[i].active = 0;
points[i].circle.active = 0;
}
@@ -153,18 +153,18 @@ define([
requestAnimationFrame(animate);
};
let shiftPoint = function (p) {
let shiftPoint = function(p){
TweenLite.to(p, 1 + 1 * Math.random(), {x: p.originX - 50 + Math.random() * 100,
y: p.originY - 50 + Math.random() * 100, ease: Circ.easeInOut,
onComplete: function () {
onComplete: function(){
shiftPoint(p);
}});
};
// Canvas manipulation
let drawLines = function (p) {
let drawLines = function(p){
if(!p.active) return;
for(let i in p.closest) {
for(let i in p.closest){
ctx.beginPath();
ctx.moveTo(p.x, p.y);
ctx.lineTo(p.closest[i].x, p.closest[i].y);
@@ -173,17 +173,17 @@ define([
}
};
let Circle = function(pos,rad,color) {
let Circle = function(pos,rad,color){
let _this = this;
// constructor
(function() {
(function(){
_this.pos = pos || null;
_this.radius = rad || null;
_this.color = color || null;
})();
this.draw = function() {
this.draw = function(){
if(!_this.active) return;
ctx.beginPath();
ctx.arc(_this.pos.x, _this.pos.y, _this.radius, 0, 2 * Math.PI, false);
@@ -193,7 +193,7 @@ define([
};
// Util
let getDistance = function(p1, p2) {
let getDistance = function(p1, p2){
return Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2);
};

View File

@@ -59,7 +59,7 @@ define([
};
// load Logo svg
requirejs(['text!templates/ui/logo.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/ui/logo.html', 'mustache'], function(template, Mustache){
let logoData = {
staticLogoId: config.staticLogoId,
logoPartTopRightClass: config.logoPartTopRightClass,

View File

@@ -530,7 +530,7 @@ define([
}).done(function(connectionsData){
// enrich connectionData with "logs" data (if available) and other "missing" data
for(let i = 0; i < this.connectionsData.length; i++){
for(let connectionData of connectionsData) {
for(let connectionData of connectionsData){
if(this.connectionsData[i].id === connectionData.id){
// copy some missing data
this.connectionsData[i].created = connectionData.created;
@@ -564,7 +564,7 @@ define([
*/
let getConnectionsLogData = (moduleElement, mapId, connectionsData) => {
let connectionIds = [];
for(let connectionData of connectionsData) {
for(let connectionData of connectionsData){
connectionIds.push(connectionData.id);
}
@@ -592,11 +592,11 @@ define([
let getRowIndexesByData = (dataTable, colName, value) => {
return dataTable.rows().eq(0).filter((rowIdx) => {
return (dataTable.cell(rowIdx, colName + ':name' ).data() === value);
return (dataTable.cell(rowIdx, colName + ':name').data() === value);
});
};
for(let connectionData of connectionsData) {
for(let connectionData of connectionsData){
// find related dom element for current connection
let connectionElement = moduleElement.find('#' + getConnectionElementId(connectionData.id));
if(connectionElement.length){
@@ -756,7 +756,7 @@ define([
}
],
drawCallback: function(settings){
let animationRows = this.api().rows().nodes().to$().filter(function(a,b ) {
let animationRows = this.api().rows().nodes().to$().filter(function(a,b ){
return (
$(this).data('animationStatus') ||
$(this).data('animationTimer')
@@ -769,7 +769,7 @@ define([
}
},
footerCallback: function ( row, data, start, end, display ) {
footerCallback: function(row, data, start, end, display ){
let api = this.api();
let sumColumnIndexes = [3];

View File

@@ -170,7 +170,7 @@ define([
graphData: graphData
}
});
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': System graph data', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -204,8 +204,8 @@ define([
eventLine = 23 - eventLine;
// update graph data ------------------------------------------------------------------------------------------
for (let [systemId, graphsData] of Object.entries(graphData)){
for (let [graphKey, graphData] of Object.entries(graphsData)){
for(let [systemId, graphsData] of Object.entries(graphData)){
for(let [graphKey, graphData] of Object.entries(graphsData)){
let graphElement = context.moduleElement.find('[data-graph="' + graphKey + '"]');
graphElement.hideLoadingAnimation();
initGraph(graphElement, graphKey, graphData, eventLine);
@@ -262,7 +262,7 @@ define([
class: 'row'
});
for (let [graphKey, graphConfig] of Object.entries(config.systemGraphs)){
for(let [graphKey, graphConfig] of Object.entries(config.systemGraphs)){
rowElement.append(
$('<div>', {
class: ['col-xs-12', 'col-sm-6', 'col-md-4'].join(' ')

View File

@@ -228,7 +228,7 @@ define([
return params;
},
validate: function(value){
if(value.length > 0 && $.trim(value).length === 0) {
if(value.length > 0 && $.trim(value).length === 0){
return {newValue: ''};
}
},

View File

@@ -93,8 +93,8 @@ define([
if(systemData){
let corporations = Util.getObjVal(systemData, 'structures');
if(corporations) {
for (let [corporationId, corporationData] of Object.entries(corporations)){
if(corporations){
for(let [corporationId, corporationData] of Object.entries(corporations)){
if(corporationData.structures && corporationData.structures.length){
for(let structureData of corporationData.structures){
let rowId = getRowId(context.tableApi, structureData.id);
@@ -199,7 +199,7 @@ define([
context: context
}).done(function(data){
callback(this, data);
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': System intel data', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -283,7 +283,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-check"></i>&nbsp;save',
className: 'btn-success',
callback: function (){
callback: function(){
let form = this.find('form');
// validate form
@@ -314,7 +314,7 @@ define([
}
});
structureDialog.on('show.bs.modal', function(e) {
structureDialog.on('show.bs.modal', function(e){
let modalContent = $('#' + config.structureDialogId);
// init type select live search
@@ -375,7 +375,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-paste fa-fw"></i>&nbsp;update intel',
className: 'btn-success',
callback: function (){
callback: function(){
let form = this.find('form');
let formData = form.getFormValues();
@@ -389,7 +389,7 @@ define([
});
// dialog shown event
structureDialog.on('shown.bs.modal', function(e) {
structureDialog.on('shown.bs.modal', function(e){
// set focus on textarea
structureDialog.find('textarea').focus();
});
@@ -571,7 +571,7 @@ define([
if($(cell).is(':empty')){
$(cell).removeClass(config.dataTableActionCellClass + ' ' + config.moduleHeadlineIconClass);
}else{
$(cell).on('click', function(e) {
$(cell).on('click', function(e){
// get current row data (important!)
// -> "rowData" param is not current state, values are "on createCell()" state
rowData = tableApi.row( $(cell).parents('tr')).data();
@@ -645,14 +645,14 @@ define([
}
}
],
drawCallback: function (settings){
drawCallback: function(settings){
let tableApi = this.api();
let columnCount = tableApi.columns(':visible').count();
let rows = tableApi.rows( {page:'current'} ).nodes();
let last= null;
tableApi.column('corporation:name', {page:'current'} ).data().each( function ( group, i ) {
if ( !last || last.id !== group.id ) {
tableApi.column('corporation:name', {page:'current'} ).data().each( function(group, i ){
if( !last || last.id !== group.id ){
$(rows).eq(i).before(
'<tr class="group">' +
'<td></td>' +
@@ -666,7 +666,7 @@ define([
}
});
let animationRows = rows.to$().filter(function() {
let animationRows = rows.to$().filter(function(){
return (
$(this).data('animationStatus') ||
$(this).data('animationTimer')

View File

@@ -101,7 +101,7 @@ define([
}
};
requirejs(['text!templates/modules/killboard.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/modules/killboard.html', 'mustache'], function(template, Mustache){
let content = Mustache.render(template, data);
moduleElement.append(content);
@@ -150,7 +150,7 @@ define([
if(data.count === 0){
labelOptions.type = 'label-success';
label = getLabel( 'No kills found within the last 24h', labelOptions );
label = getLabel('No kills found within the last 24h', labelOptions );
killboardGraphElement.append( label );
minifyKillboardGraphElement(killboardGraphElement);
@@ -184,8 +184,8 @@ define([
barRadius: [2, 2, 0, 0],
barSizeRatio: 0.5,
barGap: 3,
barColors: function (row, series, type) {
if (type === 'bar') {
barColors: function(row, series, type){
if(type === 'bar'){
// highlight last row -> recent kills found
if(this.xmax === row.x){
return '#c2760c';
@@ -252,13 +252,13 @@ define([
url: url,
type: 'GET',
dataType: 'json'
}).done(function(kbData) {
}).done(function(kbData){
// the API wont return more than 200KMs ! - remember last bar block with complete KM information
let lastCompleteDiffHourData = 0;
// loop kills and count kills by hour
for (let i = 0; i < kbData.length; i++) {
for(let i = 0; i < kbData.length; i++){
let killmailData = kbData[i];
let killDate = Util.convertDateToUTC(new Date(killmailData.killmail_time));
@@ -267,16 +267,16 @@ define([
let timeDiffHour = Math.floor(timeDiffMin / 60);
// update chart data
if (chartData[timeDiffHour]) {
if(chartData[timeDiffHour]){
chartData[timeDiffHour].kills++;
// add kill mail data
if (chartData[timeDiffHour].killmails === undefined) {
if(chartData[timeDiffHour].killmails === undefined){
chartData[timeDiffHour].killmails = [];
}
chartData[timeDiffHour].killmails.push(killmailData);
if (timeDiffHour > lastCompleteDiffHourData) {
if(timeDiffHour > lastCompleteDiffHourData){
lastCompleteDiffHourData = timeDiffHour;
}
}
@@ -284,7 +284,7 @@ define([
}
// remove empty chart Data
if (kbData.length >= maxKillmailCount) {
if(kbData.length >= maxKillmailCount){
chartData = chartData.splice(0, lastCompleteDiffHourData + 1);
}

View File

@@ -207,8 +207,8 @@ define([
};
let routeData = [];
dataTable.rows().every( function() {
routeData.push( getRouteRequestDataFromRowData( this.data() ));
dataTable.rows().every( function(){
routeData.push( getRouteRequestDataFromRowData(this.data()));
});
getRouteData({routeData: routeData}, context, callbackAddRouteRows);
@@ -279,7 +279,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-search"></i>&nbsp;search route',
className: 'btn-primary',
callback: function () {
callback: function(){
// add new route to route table
// get form Values
@@ -335,7 +335,7 @@ define([
}
});
findRouteDialog.on('show.bs.modal', function(e) {
findRouteDialog.on('show.bs.modal', function(e){
findRouteDialog.initTooltips();
// init some dialog/form observer
@@ -347,7 +347,7 @@ define([
});
findRouteDialog.on('shown.bs.modal', function(e) {
findRouteDialog.on('shown.bs.modal', function(e){
// init system select live search ------------------------------------------------
// -> add some delay until modal transition has finished
@@ -467,7 +467,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-check"></i>&nbsp;save',
className: 'btn-success',
callback: function () {
callback: function(){
let form = this.find('form');
// get all system data from select2
let systemSelectData = form.find('.' + config.systemDialogSelectClass).select2('data');
@@ -489,7 +489,7 @@ define([
}
});
settingsDialog.on('shown.bs.modal', function(e) {
settingsDialog.on('shown.bs.modal', function(e){
// init default system select -----------------------------------------------------
// -> add some delay until modal transition has finished
@@ -582,7 +582,7 @@ define([
*/
let getConnectionsDataFromMaps = (mapIds) => {
let connectionsData = {};
for(let mapId of mapIds) {
for(let mapId of mapIds){
let map = MapUtil.getMapInstance(mapId);
if(map){
let cacheKey = 'map_' + mapId;
@@ -953,7 +953,7 @@ define([
_: 'name',
sort: 'name'
},
createdCell: function(cell, cellData, rowData, rowIndex, colIndex) {
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
// init context menu
$(cell).initSystemPopover({
systemToData: rowData.systemToData
@@ -1003,10 +1003,10 @@ define([
render: {
_: 'button'
},
createdCell: function(cell, cellData, rowData, rowIndex, colIndex) {
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
let tempTableApi = this.api();
$(cell).on('click', function(e) {
$(cell).on('click', function(e){
let routeCellElement = tempTableApi.cell( rowIndex, 4 ).nodes().to$();
if(routeCellElement.hasClass(config.dataTableJumpCellClass)){
@@ -1029,10 +1029,10 @@ define([
render: {
_: 'button'
},
createdCell: function(cell, cellData, rowData, rowIndex, colIndex) {
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
let tempTableApi = this.api();
$(cell).on('click', function(e) {
$(cell).on('click', function(e){
// get current row data (important!)
// -> "rowData" param is not current state, values are "on createCell()" state
rowData = tempTableApi.row( $(cell).parents('tr')).data();
@@ -1068,7 +1068,7 @@ define([
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
let tempTableApi = this.api();
$(cell).on('click', function(e) {
$(cell).on('click', function(e){
// get current row data (important!)
// -> "rowData" param is not current state, values are "on createCell()" state
rowData = tempTableApi.row( $(cell).parents('tr')).data();
@@ -1126,7 +1126,7 @@ define([
],
drawCallback: function(settings){
let animationRows = this.api().rows().nodes().to$().filter(function() {
let animationRows = this.api().rows().nodes().to$().filter(function(){
return (
$(this).data('animationStatus') ||
$(this).data('animationTimer')
@@ -1175,14 +1175,14 @@ define([
let eventNamespace = 'hideSystemPopup';
let systemToData = options.systemToData;
requirejs(['text!templates/tooltip/system_popover.html', 'mustache'], function (template, Mustache) {
requirejs(['text!templates/tooltip/system_popover.html', 'mustache'], function(template, Mustache){
let data = {
systemToData: systemToData
};
let content = Mustache.render(template, data);
elements.each(function() {
elements.each(function(){
let element = $(this);
// destroy "popover" and remove "click" event for animation
element.popover('destroy').off();
@@ -1210,7 +1210,7 @@ define([
});
// set link observer "on shown" event
elements.on('shown.bs.popover', function () {
elements.on('shown.bs.popover', function(){
let popoverRoot = $(this);
popoverRoot.data('bs.popover').tip().find('a').on('click', function(){
@@ -1334,7 +1334,7 @@ define([
// fill routesTable with data -------------------------------------------------------------
let promiseStore = MapUtil.getLocaleData('map', mapId);
promiseStore.then(function(dataStore) {
promiseStore.then(function(dataStore){
// selected systems (if already stored)
let systemsTo = [{
systemId: 30000142,

View File

@@ -293,7 +293,7 @@ define([
if(tempSelectOptions){
let fixSelectOptions = [];
for(let key in tempSelectOptions){
if (
if(
key > 0 &&
tempSelectOptions.hasOwnProperty(key)
){
@@ -319,7 +319,7 @@ define([
let frigateHoles = getFrigateHolesBySystem(areaId);
let frigateWHData = [];
for(let frigKey in frigateHoles){
if (
if(
frigKey > 0 &&
frigateHoles.hasOwnProperty(frigKey)
){
@@ -335,7 +335,7 @@ define([
// add possible incoming holes
let incomingWHData = [];
for(let incomingKey in Init.incomingWormholes){
if (
if(
incomingKey > 0 &&
Init.incomingWormholes.hasOwnProperty(incomingKey)
){
@@ -557,7 +557,7 @@ define([
}
if(percent < 30){
progressBarType = 'progress-bar-danger' ;
progressBarType = 'progress-bar-danger';
}else if(percent < 100){
progressBarType = 'progress-bar-warning';
}else{
@@ -600,7 +600,7 @@ define([
success: {
label: '<i class="fas fa-paste fa-fw"></i>&nbsp;update signatures',
className: 'btn-success',
callback: function (){
callback: function(){
let form = this.find('form');
let formData = form.getFormValues();
let signatureOptions = {
@@ -729,7 +729,7 @@ define([
unlockTable(this.tableApi);
// updates table with new/updated signature information
updateSignatureTable(this.tableApi, responseData.signatures, false);
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': Update signatures', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -825,7 +825,7 @@ define([
}
Util.showNotify(notificationOptions);
});
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': Delete signature', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -1078,7 +1078,7 @@ define([
*/
let editableDescriptionOnShown = cell => {
$(cell).on('shown', function(e, editable){
$(this).parents('.' + config.tableToolsActionClass).css( 'height', '+=35px' );
$(this).parents('.' + config.tableToolsActionClass).css('height', '+=35px');
});
};
@@ -1089,7 +1089,7 @@ define([
*/
let editableDescriptionOnHidden = cell => {
$(cell).on('hidden', function(e, editable){
$(this).parents('.' + config.tableToolsActionClass).css( 'height', '-=35px' );
$(this).parents('.' + config.tableToolsActionClass).css('height', '-=35px');
});
};
@@ -1531,7 +1531,7 @@ define([
let errorIcon = '<i class="fas fa-exclamation-triangle txt-color txt-color-danger hide"></i>&nbsp;';
$(this).html(FormElement.formatSignatureConnectionSelectionData({text: selected[0].text})).prepend(errorIcon);
}else{
$(this).empty() ;
$(this).empty();
}
},
validate: function(value, b, c){
@@ -1829,7 +1829,7 @@ define([
searching: false,
tabIndex: -1,
data: [$.extend(true, {}, emptySignatureData)],
initComplete: function (settings, json){
initComplete: function(settings, json){
let tableApi = this.api();
$(this).on('keyup', 'td', {tableApi: tableApi}, function(e){
@@ -1991,7 +1991,7 @@ define([
}
]
},
initComplete: function (settings, json){
initComplete: function(settings, json){
let tableApi = this.api();
initGroupFilterButton(tableApi);

View File

@@ -232,7 +232,7 @@ define([
}else{
callback(responseData.img);
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
showNotify({title: jqXHR.status + ': getCaptchaImage', text: reason, type: 'error'});
});
@@ -437,7 +437,7 @@ define([
(top + height) > window.pageYOffset &&
(left + width) > window.pageXOffset
){
visibleElement.push( this );
visibleElement.push(this);
}
});
@@ -587,7 +587,7 @@ define([
let elements = $(this);
let eventNamespace = 'hideCharacterPopup';
requirejs(['text!templates/tooltip/character_switch.html', 'mustache'], function (template, Mustache){
requirejs(['text!templates/tooltip/character_switch.html', 'mustache'], function(template, Mustache){
let data = {
popoverClass: config.popoverCharacterClass,
@@ -633,7 +633,7 @@ define([
if(popoverData === undefined){
button.on('shown.bs.popover', function (e){
button.on('shown.bs.popover', function(e){
let tmpPopupElement = $(this).data('bs.popover').tip();
tmpPopupElement.find('.btn').on('click', function(e){
// close popover
@@ -716,8 +716,8 @@ define([
*/
$.fn.initPopoverClose = function(eventNamespace){
return this.each(function(){
$('body').off('click.' + eventNamespace).on('click.' + eventNamespace + ' contextmenu', function (e){
$('.' + config.popoverTriggerClass).each(function (){
$('body').off('click.' + eventNamespace).on('click.' + eventNamespace + ' contextmenu', function(e){
$('.' + config.popoverTriggerClass).each(function(){
let popoverElement = $(this);
//the 'is' for buttons that trigger popups
//the 'has' for icons within a button that triggers a popup
@@ -892,7 +892,7 @@ define([
'mouseout', 'mouseleave', 'mouseup', 'mousedown', 'mousemove', 'mouseenter', 'mousewheel', 'mouseover'
];
const getDefaultPassiveOption = (passive, eventName) => {
if (passive !== undefined) return passive;
if(passive !== undefined) return passive;
return supportedPassiveTypes.indexOf(eventName) === -1 ? false : defaultOptions.passive;
};
@@ -906,15 +906,15 @@ define([
};
const prepareSafeListener = (listener, passive) => {
if (!passive) return listener;
return function (e){
if(!passive) return listener;
return function(e){
e.preventDefault = () => {};
return listener.call(this, e);
};
};
const overwriteAddEvent = (superMethod) => {
EventTarget.prototype.addEventListener = function (type, listener, options){ // jshint ignore:line
EventTarget.prototype.addEventListener = function(type, listener, options){ // jshint ignore:line
const usesListenerOptions = typeof options === 'object';
const useCapture = usesListenerOptions ? options.capture : options;
@@ -945,7 +945,7 @@ define([
};
let supportsPassive = eventListenerOptionsSupported ();
if (supportsPassive){
if(supportsPassive){
const addEvent = EventTarget.prototype.addEventListener; // jshint ignore:line
overwriteAddEvent(addEvent);
}
@@ -979,8 +979,8 @@ define([
*/
String.prototype.hashCode = function(){
let hash = 0, i, chr;
if (this.length === 0) return hash;
for (i = 0; i < this.length; i++){
if(this.length === 0) return hash;
for(i = 0; i < this.length; i++){
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
@@ -2402,7 +2402,7 @@ define([
responseData.systemData &&
responseData.systemData.length > 0
){
for (let j = 0; j < responseData.systemData.length; j++){
for(let j = 0; j < responseData.systemData.length; j++){
showNotify({title: this.description, text: 'System: ' + responseData.systemData[j].name, type: 'success'});
}
}
@@ -2416,7 +2416,7 @@ define([
}
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
showNotify({title: jqXHR.status + ': ' + this.description, text: reason, type: 'warning'});
});
@@ -2436,7 +2436,7 @@ define([
data: false
};
if (navigator.clipboard) {
if(navigator.clipboard){
// get current permission status
navigator.permissions.query({
name: 'clipboard-write'
@@ -2461,7 +2461,7 @@ define([
resolve(payload);
}
});
} else {
}else{
console.warn('Clipboard API not supported by your browser');
resolve(payload);
}
@@ -2482,7 +2482,7 @@ define([
data: false
};
if (navigator.clipboard) {
if(navigator.clipboard){
// get current permission status
navigator.permissions.query({
name: 'clipboard-read'
@@ -2507,7 +2507,7 @@ define([
resolve(payload);
}
});
} else {
}else{
console.warn('Clipboard API not supported by your browser');
resolve(payload);
}
@@ -2574,7 +2574,7 @@ define([
}else{
showNotify({title: 'Open window in client', text: 'Check your EVE client', type: 'success'});
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
showNotify({title: jqXHR.status + ': openWindow', text: reason, type: 'error'});
});
@@ -2707,11 +2707,11 @@ define([
element.off(eventName).on(eventName, function(e){
clicks++;
if (clicks === 1){
if(clicks === 1){
setTimeout(element => {
if(clicks === 1){
singleClickCallback.call(element, e);
} else {
}else{
doubleClickCallback.call(element, e);
}
clicks = 0;
@@ -2815,7 +2815,7 @@ define([
if(data.reroute){
redirect(data.reroute, ['logout']);
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
showNotify({title: jqXHR.status + ': logout', text: reason, type: 'error'});
});
@@ -2860,11 +2860,11 @@ define([
for(let i = 0; i <ca.length; i++){
let c = ca[i];
while (c.charAt(0) === ' '){
while(c.charAt(0) === ' '){
c = c.substring(1);
}
if (c.indexOf(name) === 0){
if(c.indexOf(name) === 0){
return c.substring(name.length,c.length);
}
}

View File

@@ -95,7 +95,7 @@ let broadcastPorts = (load) => {
sentToPorts = getPortsByCharacterIds(meta.characterIds);
}
for (let i = 0; i < sentToPorts.length; i++) {
for(let i = 0; i < sentToPorts.length; i++){
sentToPorts[i].postMessage(load);
}
};

View File

@@ -29,7 +29,7 @@ window.MsgWorker = class MessageWorker {
return this.cmd;
}
task(task) {
task(task){
if(task){
this.msgTask = task;
}
@@ -37,7 +37,7 @@ window.MsgWorker = class MessageWorker {
return this.msgTask;
}
meta(metaData) {
meta(metaData){
if(metaData){
this.msgMeta = metaData;
}
@@ -45,7 +45,7 @@ window.MsgWorker = class MessageWorker {
return this.msgMeta;
}
data(data) {
data(data){
if(data){
this.msgBody = data;
}

View File

@@ -34,7 +34,7 @@ define([
let targetElement = $('[data-id="' + targetId + '"]');
let targetFormFields = targetElement.find('input[type="radio"]');
let checkFormFields = [];
for(let formField of targetFormFields) {
for(let formField of targetFormFields){
if(this.checked){
if(formField.hasAttribute('data-default') || formField.getAttribute('data-default-value')){
checkFormFields.push(formField);
@@ -47,7 +47,7 @@ define([
}
}
for(let checkFormField of checkFormFields) {
for(let checkFormField of checkFormFields){
checkFormField.checked = true;
}
}

View File

@@ -4,7 +4,7 @@
*/
define([], function() {
define([], function(){
'use strict';

View File

@@ -139,7 +139,7 @@ define([
* @param index
* @param array
*/
let compareKeyLists = function(element, index, array) {
let compareKeyLists = function(element, index, array){
return this.find(x => x === element);
};
@@ -313,7 +313,7 @@ define([
new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if(mutation.type === 'childList'){
for (let i = 0; i < mutation.removedNodes.length; i++){
for(let i = 0; i < mutation.removedNodes.length; i++){
let removedNode = mutation.removedNodes[i];
if(typeof removedNode.getAttribute === 'function'){
let eventNames = removedNode.getAttribute(dataKeyEvents);

View File

@@ -7,7 +7,7 @@ define([
'app/init',
'app/util',
'bootbox'
], function($, Init, Util, bootbox) {
], function($, Init, Util, bootbox){
'use strict';
@@ -48,7 +48,7 @@ define([
let logDialog = $('#' + config.taskDialogId);
if(logDialog.length){
// dialog is open
requirejs(['text!templates/modules/sync_status.html', 'mustache'], function(templateSyncStatus, Mustache) {
requirejs(['text!templates/modules/sync_status.html', 'mustache'], function(templateSyncStatus, Mustache){
let data = {
timestampCounterClass: config.timestampCounterClass,
syncStatus: Init.syncStatus,
@@ -80,7 +80,7 @@ define([
let showDialog = function(){
// dialog content
requirejs(['text!templates/dialog/task_manager.html', 'mustache', 'datatables.loader'], function(templateTaskManagerDialog, Mustache) {
requirejs(['text!templates/dialog/task_manager.html', 'mustache', 'datatables.loader'], function(templateTaskManagerDialog, Mustache){
let data = {
id: config.taskDialogId,
dialogDynamicAreaClass: config.dialogDynamicAreaClass,
@@ -193,7 +193,7 @@ define([
});
// modal dialog is shown
logDialog.on('shown.bs.modal', function(e) {
logDialog.on('shown.bs.modal', function(e){
updateSyncStatus();
// show Morris graphs ----------------------------------------------------------
@@ -203,8 +203,8 @@ define([
return Math.round(y) + 'ms';
};
for(let key in chartData) {
if(chartData.hasOwnProperty(key)) {
for(let key in chartData){
if(chartData.hasOwnProperty(key)){
// create a chart for each key
let colElementGraph = $('<div>', {
@@ -293,17 +293,17 @@ define([
// modal dialog is closed
logDialog.on('hidden.bs.modal', function(e) {
logDialog.on('hidden.bs.modal', function(e){
// clear memory -> destroy all charts
for (let key in chartData) {
if (chartData.hasOwnProperty(key)) {
for(let key in chartData){
if(chartData.hasOwnProperty(key)){
chartData[key].graph = null;
}
}
});
// modal dialog before hide
logDialog.on('hide.bs.modal', function(e) {
logDialog.on('hide.bs.modal', function(e){
// destroy logTable
logDataTable.destroy(true);
@@ -342,7 +342,7 @@ define([
chartData[key].data = chartData[key].data.slice(0, maxGraphDataCount);
}
function getGraphData(data) {
function getGraphData(data){
let tempChartData = {
data: [],
dataSum: 0,
@@ -388,7 +388,7 @@ define([
avgElement[0].textContent = 'Avg. ' + tempChartData.average + 'ms';
let avgStatus = getLogStatusByDuration(key, tempChartData.average);
let avgStatusClass = Util.getLogInfo( avgStatus, 'class' );
let avgStatusClass = Util.getLogInfo( avgStatus, 'class');
//change avg. display class
if( !avgElement.hasClass(avgStatusClass) ){
@@ -473,7 +473,7 @@ define([
// check log status by duration
let logStatus = getLogStatusByDuration(logKey, logDuration);
let statusClass = Util.getLogInfo( logStatus, 'class' );
let statusClass = Util.getLogInfo( logStatus, 'class');
let typeIconClass = getLogTypeIconClass(logType);
// update graph data

View File

@@ -123,12 +123,12 @@ define([
ssoButtonElement.confirmation('destroy');
});
cookieHintElement.on('show.bs.collapse', function () {
cookieHintElement.on('show.bs.collapse', function(){
// move admin panel upwards (prevents overlapping with cookie notice)
moveAdminPanel('up');
});
cookieHintElement.on('hidden.bs.collapse', function () {
cookieHintElement.on('hidden.bs.collapse', function(){
moveAdminPanel('down');
});
@@ -205,7 +205,7 @@ define([
}
// extent "blueimp" gallery for a textFactory method to show HTML templates
Gallery.prototype.textFactory = function (obj, callback) {
Gallery.prototype.textFactory = function(obj, callback){
let newSlideContent = $('<div>')
.addClass('text-content')
.attr('imgTitle', obj.title);
@@ -277,13 +277,13 @@ define([
transitionSpeed: 600,
slideshowInterval: 5000,
preloadRange: 1,
onopened: function () {
onopened: function(){
// Callback function executed when the Gallery has been initialized
// and the initialization transition has been completed.
// -> show "demo" map
// set title for first slide
$( this.options.container ).find( this.options.titleElement).text('Browser view');
$(this.options.container).find(this.options.titleElement).text('Browser view');
$('#' + config.headHeaderMapId).drawDemoMap(function(){
@@ -348,7 +348,7 @@ define([
let allThumbLinks = getThumbnailElements();
requirejs(['blueImpGalleryBootstrap'], () => {
$(newElements).each(function() {
$(newElements).each(function(){
let borderless = false;
let galleryElement = $('#' + config.galleryId);
@@ -381,17 +381,17 @@ define([
*/
let initYoutube = () => {
$('.youtube').each(function() {
$('.youtube').each(function(){
// Based on the YouTube ID, we can easily find the thumbnail image
$(this).css('background-image', 'url(//i.ytimg.com/vi/' + this.id + '/sddefault.jpg)');
// Overlay the Play icon to make it look like a video player
$(this).append($('<div/>', {'class': 'play'}));
$(document).delegate('#' + this.id, 'click', function() {
$(document).delegate('#' + this.id, 'click', function(){
// Create an iFrame with autoplay set to true
let iFrameUrl = '//www.youtube.com/embed/' + this.id + '?autoplay=1&autohide=1';
if ( $(this).data('params') ){
if( $(this).data('params') ){
iFrameUrl += '&'+$(this).data('params');
}
@@ -488,7 +488,7 @@ define([
style: statusClass
};
requirejs(['text!templates/ui/server_panel.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/ui/server_panel.html', 'mustache'], function(template, Mustache){
let content = Mustache.render(template, data);
$('#' + config.headerId).prepend(content);
$('#' + config.stickyPanelServerId).velocity('transition.slideLeftBigIn', {
@@ -601,7 +601,7 @@ define([
let removeCharacterPanel = function(panelElement){
$(panelElement).velocity('transition.expandOut', {
duration: 250,
complete: function () {
complete: function(){
// lock row for CSS animations while removing...
$(this).parent().addClass(config.characterRowAnimateClass);
@@ -701,7 +701,7 @@ define([
// character data not available -> remove panel
removeCharacterPanel(this.characterElement);
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let characterElement = this.characterElement;
characterElement.hideLoadingAnimation();
@@ -789,7 +789,7 @@ define([
$.fn.showNotificationDialog(options);
// change url (remove logout parameter)
if (history.pushState) {
if(history.pushState){
history.pushState({}, '', location.protocol + '//' + location.host + location.pathname);
}
}

View File

@@ -17,7 +17,7 @@ define([
systemContextMenuId: 'pf-map-system-contextmenu' // id for "systems" context menu
};
$.fn.contextMenu = function (settings) {
$.fn.contextMenu = function(settings){
// animation
let animationInType = 'transition.flipXIn';
@@ -25,10 +25,10 @@ define([
let animationOutType = 'transition.flipXOut';
let animationOutDuration = 150;
return this.each(function () {
return this.each(function(){
// Open context menu
$(this).off('pf:openContextMenu').on('pf:openContextMenu', function (e, originalEvent, component, hiddenOptions, activeOptions, disabledOptions) {
$(this).off('pf:openContextMenu').on('pf:openContextMenu', function(e, originalEvent, component, hiddenOptions, activeOptions, disabledOptions){
// hide all other open context menus
$('#pf-dialog-wrapper > .dropdown-menu').hide();
@@ -73,11 +73,11 @@ define([
){
// Chrome
posX = originalEvent.offsetX;
posY = originalEvent.offsetY ;
posY = originalEvent.offsetY;
}else if(originalEvent.originalEvent){
// Firefox -> #415
posX = originalEvent.originalEvent.layerX;
posY = originalEvent.originalEvent.layerY ;
posY = originalEvent.originalEvent.layerY;
}
let position = {
@@ -85,7 +85,7 @@ define([
y: posY
};
$(this).off('click').one('click', {component: component, position: position}, function (e) {
$(this).off('click').one('click', {component: component, position: position}, function(e){
// hide contextmenu
$(this).hide();
@@ -102,7 +102,7 @@ define([
});
//make sure menu closes on any click
$(document).one('click.closeContextmenu', function () {
$(document).one('click.closeContextmenu', function(){
$('.dropdown-menu[role="menu"]').velocity(animationOutType, {
duration: animationOutDuration
});
@@ -113,27 +113,27 @@ define([
});
function getLeftLocation(e) {
function getLeftLocation(e){
let mouseWidth = e.pageX;
let pageWidth = $(window).width();
let menuWidth = $(settings.menuSelector).width();
// opening menu would pass the side of the page
if (mouseWidth + menuWidth > pageWidth &&
menuWidth < mouseWidth) {
if(mouseWidth + menuWidth > pageWidth &&
menuWidth < mouseWidth){
return mouseWidth - menuWidth;
}
return mouseWidth;
}
function getTopLocation(e) {
function getTopLocation(e){
let mouseHeight = e.pageY;
let pageHeight = $(window).height();
let menuHeight = $(settings.menuSelector).height();
// opening menu would pass the bottom of the page
if (mouseHeight + menuHeight > pageHeight &&
menuHeight < mouseHeight) {
if(mouseHeight + menuHeight > pageHeight &&
menuHeight < mouseHeight){
return mouseHeight - menuHeight;
}
return mouseHeight;
@@ -216,7 +216,7 @@ define([
let initSystemContextMenu = (systemStatusData) => {
let statusData = [];
for (let [statusName, data] of Object.entries(systemStatusData)){
for(let [statusName, data] of Object.entries(systemStatusData)){
statusData.push({
subIcon: 'fa-tag',
subIconClass: data.class,

View File

@@ -3,7 +3,7 @@ define(() => {
class Position {
constructor(config) {
constructor(config){
this._defaultConfig = {
container: null, // parent DOM container element
center: null, // DOM elements that works as center
@@ -61,8 +61,8 @@ define(() => {
left = point[0];
top = point[1];
a = this._config.gapX ;
b = this._config.gapY ;
a = this._config.gapX;
b = this._config.gapY;
}else if(element){
// DOM element
left = element.style.left ? parseInt(element.style.left, 10) : 0;
@@ -204,12 +204,12 @@ define(() => {
this._percentCovered = (dim1, dim2) => {
let percent = 0;
if (
if(
(dim1.left <= dim2.left) &&
(dim1.top <= dim2.top) &&
((dim1.left + dim1.width) >= (dim2.left + dim2.width)) &&
((dim1.top + dim1.height) > (dim2.top + dim2.height))
) {
){
// The whole thing is covering the whole other thing
percent = 100;
}else{
@@ -224,7 +224,7 @@ define(() => {
let t = Math.max(dim1.top, dim2.top);
let b = Math.min(dim1.bottom, dim2.bottom);
if (b >= t && r >= l) {
if(b >= t && r >= l){
percent = (((r - l) * (b - t)) / (dim2.width * dim2.height)) * 100;
}
}
@@ -285,7 +285,7 @@ define(() => {
if(loops === 1){
// check center element
let centerDimension = this._getElementDimension(this._config.center);
if (!this._isOverlapping(centerDimension, dimensionContainer, allDimensions)) {
if(!this._isOverlapping(centerDimension, dimensionContainer, allDimensions)){
dimensions.push({
left: centerDimension.left,
top: centerDimension.top,
@@ -310,7 +310,7 @@ define(() => {
let coordinate = this._getEllipseCoordinates(centerDimension, end);
// transform relative x/y coordinate into a absolute 2D area
let checkDimension = this._transformCoordinate(centerDimension, coordinate);
if (!this._isOverlapping(checkDimension, dimensionContainer, allDimensions)) {
if(!this._isOverlapping(checkDimension, dimensionContainer, allDimensions)){
dimensions.push({
left: checkDimension.left,
top: checkDimension.top,

View File

@@ -8,7 +8,7 @@ define([
'app/init',
'app/util',
'app/map/util'
], function($, Init, Util, MapUtil) {
], function($, Init, Util, MapUtil){
'use strict';
let config = {
@@ -122,7 +122,7 @@ define([
* @param checkExistence
*/
let filterRows = (table, data = 'id', values = [], checkExistence = true) => {
return table.rows().eq(0).filter( function (rowIdx) {
return table.rows().eq(0).filter( function(rowIdx){
let rowExists = values.indexOf( table.row(rowIdx ).data()[data] ) !== -1;
if( !checkExistence ){
@@ -157,17 +157,17 @@ define([
// update userCount for "near by" count -------------------------------------------------------------------
if( characterAll > 0){
userCountElement.toggleClass( 'txt-color-green', true).toggleClass( 'txt-color-red', false);
userCountElement.toggleClass('txt-color-green', true).toggleClass('txt-color-red', false);
}else{
userCountElement.toggleClass( 'txt-color-green', false).toggleClass( 'txt-color-red', true);
userCountElement.toggleClass('txt-color-green', false).toggleClass('txt-color-red', true);
}
userCountElement.text(characterAll);
// update userCount in current system ---------------------------------------------------------------------
if( characterLocal > 0){
childElements.eq(3).toggleClass( 'txt-color-green', true).toggleClass( 'txt-color-red', false);
childElements.eq(3).toggleClass('txt-color-green', true).toggleClass('txt-color-red', false);
}else{
childElements.eq(3).toggleClass( 'txt-color-green', false).toggleClass( 'txt-color-red', true);
childElements.eq(3).toggleClass('txt-color-green', false).toggleClass('txt-color-red', true);
}
childElements.eq(3).text(characterLocal);
};
@@ -188,7 +188,7 @@ define([
let characterLocalIds = [];
// system is on map (just for security check)
for(let jumps in userData) {
for(let jumps in userData){
if( userData.hasOwnProperty(jumps) ){
jumps = parseInt(jumps);
@@ -237,7 +237,7 @@ define([
// open Overlay -------------------------------------------------------------------------------------------
if( !isOpen(overlay) ){
let promiseStore = MapUtil.getLocaleData('map', mapId);
promiseStore.then(function(dataStore) {
promiseStore.then(function(dataStore){
if(
dataStore &&
dataStore.showLocal
@@ -256,7 +256,7 @@ define([
* @returns {*}
*/
let getDescendantProp = (obj, selector) => {
return selector.split('.').reduce(function(a, b) {
return selector.split('.').reduce(function(a, b){
return a[b];
}, obj);
};
@@ -376,7 +376,7 @@ define([
});
// table init complete
table.on( 'init.dt', function (){
table.on('init.dt', function(){
// init table head tooltips
$(this).initTooltips({
container: 'body',
@@ -394,7 +394,7 @@ define([
searching: false,
hover: false,
autoWidth: false,
rowId: function(rowData) {
rowId: function(rowData){
return 'pf-local-row_' + rowData.id; // characterId
},
language: {

View File

@@ -7,7 +7,7 @@ define([
'jquery',
'app/map/util',
'farahey'
], function($, MapUtil) {
], function($, MapUtil){
'use strict';
@@ -32,9 +32,9 @@ define([
* @returns {{left, top}}
* @private
*/
let _offset = function(system) {
let _offset = function(system){
let _ = function(p) {
let _ = function(p){
let v = system.style[p];
return parseInt(v.substring(0, v.length - 2));
};
@@ -52,7 +52,7 @@ define([
* @param o
* @private
*/
let _setOffset = function(system, o) {
let _setOffset = function(system, o){
let markAsUpdated = false;
// new position must be within parent container
@@ -85,12 +85,12 @@ define([
* @returns {boolean}
* @private
*/
let _dragFilter = function(id) {
let _dragFilter = function(id){
return !$('#' + id).is('.jsPlumb_dragged, .pf-system-locked');
};
let gridConstrain = function(gridX, gridY) {
return function(id, current, delta) {
let gridConstrain = function(gridX, gridY){
return function(id, current, delta){
if( mapContainer.hasClass(MapUtil.config.mapGridClass) ){
// active grid
return {
@@ -107,14 +107,14 @@ define([
// main init for "magnetize" feature ------------------------------------------------------
m8 = new Magnetizer({
container: mapContainer,
getContainerPosition: function(c) {
getContainerPosition: function(c){
return c.offset();
},
getPosition:_offset,
getSize: function(system) {
getSize: function(system){
return [ $(system).outerWidth(), $(system).outerHeight() ];
},
getId : function(system) {
getId : function(system){
return $(system).attr('id');
},
setPosition:_setOffset,

View File

@@ -335,8 +335,8 @@ define([
let statusId = Util.getStatusInfoForSystem(status, 'id');
let statusClass = Util.getStatusInfoForSystem(status, 'class');
for(let property in Init.systemStatus) {
if (Init.systemStatus.hasOwnProperty(property)) {
for(let property in Init.systemStatus){
if(Init.systemStatus.hasOwnProperty(property)){
system.removeClass( Init.systemStatus[property].class );
}
}
@@ -502,7 +502,7 @@ define([
system.attr('data-mapid', parseInt(mapContainer.data('id')));
// locked system
if( Boolean( system.data( 'locked') ) !== data.locked ){
if( Boolean( system.data('locked') ) !== data.locked ){
system.toggleLockSystem(false, {hideNotification: true, hideCounter: true, map: map});
}
@@ -528,7 +528,7 @@ define([
let connectionCanvas = $(connection.canvas);
// if the connection already exists -> do not set it twice
connection.unbind('contextmenu').bind('contextmenu', function(component, e) {
connection.unbind('contextmenu').bind('contextmenu', function(component, e){
e.preventDefault();
e.stopPropagation();
@@ -550,7 +550,7 @@ define([
*/
connectionCanvas.contextMenu({
menuSelector: '#' + config.connectionContextMenuId,
menuSelected: function (params){
menuSelected: function(params){
let action = params.selectedMenu.attr('data-action');
let activeConnection = params.component;
@@ -562,7 +562,7 @@ define([
// delete a single connection
// confirm dialog
bootbox.confirm('Is this connection really gone?', function(result) {
bootbox.confirm('Is this connection really gone?', function(result){
if(result){
$().deleteConnections([activeConnection]);
}
@@ -592,7 +592,7 @@ define([
let newScope = action.split('_')[1];
let newScopeName = MapUtil.getScopeInfoForConnection( newScope, 'label');
bootbox.confirm('Change scope from ' + activeScopeName + ' to ' + newScopeName + '?', function(result) {
bootbox.confirm('Change scope from ' + activeScopeName + ' to ' + newScopeName + '?', function(result){
if(result){
mapElement.getMapOverlay('timer').startMapUpdateCounter();
@@ -621,8 +621,8 @@ define([
let activeConnections = MapUtil.getConnectionsByType(map, 'active');
if(activeConnections.length >= config.maxActiveConnections && !connection.hasType('active')){
Util.showNotify({title: 'Connection select limit', text: 'You can´t select more connections', type: 'warning'});
}else {
if(activeConnections.length > 0) {
}else{
if(activeConnections.length > 0){
MapUtil.toggleConnectionActive(map, [connection]);
}else{
MapUtil.showConnectionInfo(map, [connection]);
@@ -839,7 +839,7 @@ define([
if(entry.constructor.name === 'HTMLDivElement'){
width = entry.style.width;
height = entry.style.height;
}else if (entry.constructor.name === 'ResizeObserverEntry'){
}else if(entry.constructor.name === 'ResizeObserverEntry'){
width = entry.target.style.width;
height = entry.target.style.height;
}
@@ -851,16 +851,16 @@ define([
promiseStore.then((data) => {
let storeData = true;
if (
if(
data && data.style &&
data.style.width === width &&
data.style.height === height
) {
){
// no style changes
storeData = false;
}
if (storeData) {
if(storeData){
MapUtil.storeLocalData('map', mapConfig.config.id, 'style', {
width: width,
height: height
@@ -870,7 +870,7 @@ define([
};
// map resize observer ----------------------------------------------------------------------------------------
if(window.ResizeObserver) {
if(window.ResizeObserver){
// ResizeObserver() supported
let resizeTimer;
let wrapperResize = new ResizeObserver(entries => { // jshint ignore:line
@@ -1059,7 +1059,7 @@ define([
// jsPlumb batch() is used, otherwise there are some "strange" visual bugs
// when switching maps (Endpoints are not displayed correctly)
mapConfig.map.batch(function() {
mapConfig.map.batch(function(){
for(let j = 0; j < mapConfig.data.connections.length; j++){
let connectionData = mapConfig.data.connections[j];
@@ -1364,7 +1364,7 @@ define([
Util.showNotify({title: error.field + ' error', text: 'System: ' + error.message, type: error.type});
}
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': saveSystem', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -1430,7 +1430,7 @@ define([
data.currentSystem = currentCharacterLog.system;
}
requirejs(['text!templates/dialog/system.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/system.html', 'mustache'], function(template, Mustache){
let content = Mustache.render(template, data);
@@ -1446,7 +1446,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-check"></i> save',
className: 'btn-success',
callback: function (e) {
callback: function(e){
// get form Values
let form = $('#' + config.systemDialogId).find('form');
@@ -1517,11 +1517,11 @@ define([
}
});
systemDialog.on('show.bs.modal', function(e) {
systemDialog.on('show.bs.modal', function(e){
let modalContent = $('#' + config.systemDialogId);
// init "status" select2
for (let [statusName, data] of Object.entries(Init.systemStatus)){
for(let [statusName, data] of Object.entries(Init.systemStatus)){
statusData.push({id: data.id, text: data.label, class: data.class});
}
@@ -1531,7 +1531,7 @@ define([
});
});
systemDialog.on('shown.bs.modal', function(e) {
systemDialog.on('shown.bs.modal', function(e){
let modalContent = $('#' + config.systemDialogId);
// init system select live search - some delay until modal transition has finished
@@ -1568,12 +1568,12 @@ define([
showbuttons: false
});
headElement.on('save', function(e, params) {
headElement.on('save', function(e, params){
// system alias changed -> mark system as updated
system.markAsChanged();
});
headElement.on('shown', function(e, editable) {
headElement.on('shown', function(e, editable){
// hide tooltip when xEditable is visible
system.toggleSystemTooltip('hide', {});
@@ -1586,7 +1586,7 @@ define([
}, 0, inputElement);
});
headElement.on('hidden', function(e, editable) {
headElement.on('hidden', function(e, editable){
// show tooltip "again" on xEditable hidden
system.toggleSystemTooltip('show', {show: true});
@@ -1694,7 +1694,7 @@ define([
Util.showNotify({title: error.field + ' error', text: 'System: ' + error.message, type: error.type});
}
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
// remove this connection from map
this.map.detach(this.connection, {fireEvent: false});
@@ -1758,7 +1758,7 @@ define([
if(callback){
callback();
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': deleteSystem', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -2041,7 +2041,7 @@ define([
// init context menu
system.contextMenu({
menuSelector: '#' + config.systemContextMenuId,
menuSelected: function (params) {
menuSelected: function(params){
// click action
let action = params.selectedMenu.attr('data-action');
@@ -2071,7 +2071,7 @@ define([
break;
case 'set_rally':
// toggle rally point
if( !currentSystem.data( 'rallyUpdated' ) ){
if( !currentSystem.data('rallyUpdated') ){
$.fn.showRallyPointDialog(currentSystem);
}else{
// remove rally point
@@ -2250,7 +2250,7 @@ define([
let systemName = system.getSystemInfo( ['alias'] );
if( system.data( 'locked' ) === true ){
if( system.data('locked') === true ){
system.data('locked', false);
system.removeClass( config.systemLockedClass );
@@ -2313,18 +2313,18 @@ define([
newJsPlumbInstance.registerConnectionTypes(globalMapConfig.connectionTypes);
// event after a new connection is established --------------------------
newJsPlumbInstance.bind('connection', function(info, e) {
newJsPlumbInstance.bind('connection', function(info, e){
// set connection observer
setConnectionObserver(newJsPlumbInstance, info.connection);
});
// event after connection moved ---------------------------------------------------------------------------
newJsPlumbInstance.bind('connectionMoved', function(info, e) {
newJsPlumbInstance.bind('connectionMoved', function(info, e){
});
// event after DragStop a connection or new connection ----------------------------------------------------
newJsPlumbInstance.bind('beforeDrop', function(info) {
newJsPlumbInstance.bind('beforeDrop', function(info){
let connection = info.connection;
let dropEndpoint = info.dropEndpoint;
let sourceId = info.sourceId;
@@ -2367,7 +2367,7 @@ define([
// prevent multiple connections between same systems
let connections = MapUtil.checkForConnection(newJsPlumbInstance, sourceId, targetId);
if(connections.length > 1){
bootbox.confirm('Connection already exists. Do you really want to add an additional one?', function(result) {
bootbox.confirm('Connection already exists. Do you really want to add an additional one?', function(result){
if(!result && connection._jsPlumb){
// connection._jsPlumb might be "undefined" in case connection was removed in the meantime
connection._jsPlumb.instance.detach(connection);
@@ -2382,12 +2382,12 @@ define([
});
// event before detach (existing connection) --------------------------------------------------------------
newJsPlumbInstance.bind('beforeStartDetach', function(info) {
newJsPlumbInstance.bind('beforeStartDetach', function(info){
return true;
});
// event before detach connection -------------------------------------------------------------------------
newJsPlumbInstance.bind('beforeDetach', function(info) {
newJsPlumbInstance.bind('beforeDetach', function(info){
return true;
});
@@ -2443,7 +2443,7 @@ define([
mapContainer.contextMenu({
menuSelector: '#' + config.mapContextMenuId,
menuSelected: function (params) {
menuSelected: function(params){
// click action
let action = params.selectedMenu.attr('data-action');
@@ -2540,7 +2540,7 @@ define([
mapContainer.dragToSelect({
selectOnMove: true,
selectables: '.' + config.systemClass,
onHide: function (selectBox, deselectedSystems) {
onHide: function(selectBox, deselectedSystems){
let selectedSystems = mapContainer.getSelectedSystems();
if(selectedSystems.length > 0){
@@ -2709,7 +2709,7 @@ define([
let data = MapUtil.mapOptions[mapOption.option];
let promiseStore = MapUtil.getLocaleData('map', mapElement.data('id') );
promiseStore.then(function(dataStore) {
promiseStore.then(function(dataStore){
let notificationText = 'disabled';
let button = $('#' + this.data.buttonId);
let dataExists = false;
@@ -2733,7 +2733,7 @@ define([
// call optional jQuery extension on mapElement
if(this.data.onDisable){
$.fn[ this.data.onDisable ].apply( this.mapElement );
$.fn[ this.data.onDisable ].apply(this.mapElement);
}
// show map overlay info icon
@@ -2752,7 +2752,7 @@ define([
// call optional jQuery extension on mapElement
if(this.data.onEnable){
$.fn[ this.data.onEnable ].apply( this.mapElement );
$.fn[ this.data.onEnable ].apply(this.mapElement);
}
// hide map overlay info icon
@@ -2832,7 +2832,7 @@ define([
currentCharacterLog &&
currentCharacterLog.system
){
let currentSystemData = currentMapData.data.systems.filter(function (system) {
let currentSystemData = currentMapData.data.systems.filter(function(system){
return system.systemId === currentCharacterLog.system.id;
});
@@ -2957,11 +2957,11 @@ define([
let j = userData.data.systems.length;
// search backwards to avoid decrement the counter after splice()
while (j--) {
while(j--){
let systemData = userData.data.systems[j];
// check if any user is in this system
if (systemId === systemData.id) {
if(systemId === systemData.id){
tempUserData = systemData;
// add "user count" to "total map user count"

View File

@@ -7,7 +7,7 @@ define([
'app/init',
'app/util',
'app/map/util'
], function($, Init, Util, MapUtil) {
], function($, Init, Util, MapUtil){
'use strict';
let config = {
@@ -85,7 +85,7 @@ define([
};
// loop through all map connections (get from DOM)
for(let connection of connections) {
for(let connection of connections){
let connectionId = connection.getParameter('connectionId');
let sourceEndpoint = connection.endpoints[0];
let targetEndpoint = connection.endpoints[1];
@@ -199,7 +199,7 @@ define([
iconElement.data(dataName, defaultIconClass);
}
iconElement.toggleClass( defaultIconClass + ' fa-sync fa-spin' );
iconElement.toggleClass( defaultIconClass + ' fa-sync fa-spin');
};
/**
@@ -211,7 +211,7 @@ define([
let dataName = 'default-icon';
let defaultIconClass = iconElement.data(dataName);
iconElement.toggleClass( defaultIconClass + ' fa-sync fa-spin' );
iconElement.toggleClass( defaultIconClass + ' fa-sync fa-spin');
};
/**
@@ -247,7 +247,7 @@ define([
this.mapElement.hideEndpointOverlays();
// ... add overlays
callback(this.connections, connectionsData);
}).always(function() {
}).always(function(){
hideLoading(this.overlayConnectionIcon);
});
};
@@ -275,7 +275,7 @@ define([
let MapUtil = require('app/map/util');
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh');
for (let connection of connections){
for(let connection of connections){
connection.removeOverlays(config.connectionOverlayArrowId);
connection.endpoints.forEach(removeEndpointOverlay);
}
@@ -326,7 +326,7 @@ define([
mapElement.find('.' + config.systemHeadClass).each(function(){
let system = $(this);
// init tooltip if not already exists
if ( !system.data('bs.tooltip') ){
if( !system.data('bs.tooltip') ){
system.tooltip({
container: mapElement,
placement: 'right',
@@ -379,7 +379,7 @@ define([
let serverDate = Util.getServerTime();
// show connection overlays ---------------------------------------------------
for (let connection of connections) {
for(let connection of connections){
let createdTimestamp = connection.getParameter('created');
let updatedTimestamp = connection.getParameter('updated');
@@ -412,7 +412,7 @@ define([
let MapUtil = require('app/map/util');
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh');
for (let connection of connections){
for(let connection of connections){
connection.removeOverlays(config.connectionOverlayId);
}
}
@@ -430,7 +430,7 @@ define([
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh', ['wh_eol']);
let serverDate = Util.getServerTime();
for (let connection of connections) {
for(let connection of connections){
let eolTimestamp = connection.getParameter('eolUpdated');
let eolDate = Util.convertTimestampToServerTime(eolTimestamp);
let diff = Util.getTimeDiffParts(eolDate, serverDate);
@@ -451,7 +451,7 @@ define([
let MapUtil = require('app/map/util');
let connections = MapUtil.searchConnectionsByScopeAndType(map, 'wh', ['wh_eol']);
for (let connection of connections) {
for(let connection of connections){
connection.removeOverlay(config.connectionOverlayEolId);
}
}
@@ -704,7 +704,7 @@ define([
});
// add all overlay elements
for (let prop in options) {
for(let prop in options){
if(options.hasOwnProperty(prop)){
let icon = $('<i>', {
class: options[prop].iconClass.concat( ['pull-right', options[prop].class] ).join(' ')

View File

@@ -5,7 +5,7 @@ define([
'jquery',
'app/init',
'app/util'
], function($, Init, Util) {
], function($, Init, Util){
'use strict';
/**

View File

@@ -52,7 +52,7 @@ define([
let systemId = system.data('id');
let mapData = Util.getCurrentMapData(mapId);
requirejs(['text!templates/dialog/system_rally.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/system_rally.html', 'mustache'], function(template, Mustache){
let setCheckboxObserver = (checkboxes) => {
checkboxes.each(function(){
@@ -87,7 +87,7 @@ define([
context: context
}).done(function(data){
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': sendPoke', text: reason, type: 'warning'});
}).always(function(){
@@ -127,7 +127,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-volume-up"></i> set rally point',
className: 'btn-success',
callback: function() {
callback: function(){
let form = $('#' + config.dialogRallyId).find('form');
// get form data
let formData = form.getFormValues();
@@ -168,7 +168,7 @@ define([
let validDeleteSystems = [];
let activeCharacters = 0;
// check if systems belong to map -> security check
for (let system of systems) {
for(let system of systems){
let systemElement = $(system);
if(
systemElement.data('mapid') === mapContainer.data('id') &&
@@ -333,7 +333,7 @@ define([
system.attr('title', getTitle(tooltipOptions.userCount, tooltipOptions.highlight));
system.tooltip(options);
system.one('shown.bs.tooltip', function() {
system.one('shown.bs.tooltip', function(){
// set highlight only on FIRST show
$('#' + this.innerTooltipId).addClass(this.highlightClass);
}.bind({
@@ -397,7 +397,7 @@ define([
removeSystems(this.map, deletedSystems);
callback(deletedSystems);
}).fail(function(jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': deleteSystem', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -414,7 +414,7 @@ define([
map.remove(deleteSystem);
};
for (let system of systems){
for(let system of systems){
system = $(system);
// check if system is "active"

View File

@@ -121,7 +121,7 @@ define([
for(let i = 0; i < checkMapTypes.length; i++){
let objectId = Util.getCurrentUserInfo(checkMapTypes[i] + 'Id');
if(objectId > 0) {
if(objectId > 0){
// check if User could add new map with a mapType
let currentObjectMapData = Util.filterCurrentMapData('config.type.id', Util.getObjVal(mapTypes, checkMapTypes[i] + '.id'));
let maxCountObject = Util.getObjVal(mapTypes, checkMapTypes[i] + '.defaultConfig.max_count');
@@ -131,7 +131,7 @@ define([
}
}
for(let mapType in mapTypes) {
for(let mapType in mapTypes){
if(authorizedMapTypes.indexOf(mapType) < 0){
delete( mapTypes[mapType] );
}
@@ -971,7 +971,7 @@ define([
if(objectId > 0){
// get current map config
let storageKey = getLocalStoragePrefixByType(type) + objectId;
Util.getLocalStorage().getItem(storageKey).then(function(data) {
Util.getLocalStorage().getItem(storageKey).then(function(data){
// This code runs once the value has been loaded
// from the offline store.
data = (data === null) ? {} : data;
@@ -982,7 +982,7 @@ define([
key: key,
value: value,
storageKey: storageKey
})).catch(function(err) {
})).catch(function(err){
// This code runs if there were any errors
console.error('Map local storage can not be accessed!');
});
@@ -1180,7 +1180,7 @@ define([
if(objectId > 0){
// get current map config
let storageKey = getLocalStoragePrefixByType(type) + objectId;
Util.getLocalStorage().getItem(storageKey).then(function(data) {
Util.getLocalStorage().getItem(storageKey).then(function(data){
if(
data &&
data.hasOwnProperty(key)
@@ -1248,7 +1248,7 @@ define([
let mapId = system.data('mapid');
let systemId = system.data('id');
let promiseStore = getLocaleData('map', mapId);
promiseStore.then(function(data) {
promiseStore.then(function(data){
// This code runs once the value has been loaded
// from the offline store.
let rallyPokeData = {};
@@ -1633,7 +1633,7 @@ define([
}else{
console.warn('Missing systemData in response!', requestData);
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
console.warn('Fail request systemData!', requestData);
});
};

View File

@@ -4,7 +4,7 @@
define([
'app/util'
], function(Util) {
], function(Util){
'use strict';
let config = {

View File

@@ -61,7 +61,7 @@ define([
* -> stop program from working -> shutdown
*/
let clearUpdateTimeouts = () => {
for(let intervalKey in updateTimeouts) {
for(let intervalKey in updateTimeouts){
if(updateTimeouts.hasOwnProperty(intervalKey)){
clearTimeout(updateTimeouts[intervalKey]);
}
@@ -201,7 +201,7 @@ define([
Page.initMapContextMenus();
// init map module
mapModule.initMapModule() ;
mapModule.initMapModule();
// load info (maintenance) info panel (if scheduled)
if(Init.programMode.maintenance){
@@ -253,7 +253,7 @@ define([
},
onOpen: (MsgWorkerMessage) => {
Util.setSyncStatus(MsgWorkerMessage.command, MsgWorkerMessage.meta());
MapWorker.send( 'subscribe', response.data);
MapWorker.send('subscribe', response.data);
resolve(getPayload(MsgWorkerMessage.command));
},
@@ -396,7 +396,7 @@ define([
}else{
$(document).setProgramStatus('online');
if(data.userData !== undefined) {
if(data.userData !== undefined){
// store current user data global (cache)
Util.setCurrentUserData(data.userData);
}
@@ -526,7 +526,7 @@ define([
// Send map update request on tab close/reload, in order to save map changes that
// haven´t been saved through default update trigger
window.addEventListener('beforeunload', function(e) {
window.addEventListener('beforeunload', function(e){
// save unsaved map changes ...
triggerMapUpdatePing();

View File

@@ -246,7 +246,7 @@ define([
*/
let showPanel = (parentElement, Module, mapId, data) => {
let moduleElement = Module.getModule(parentElement, mapId, data);
if(moduleElement) {
if(moduleElement){
// store Module object to DOM element for further access
moduleElement.data('module', Module);
moduleElement.data('data', data);
@@ -255,7 +255,7 @@ define([
// check module position from local storage
let promiseStore = MapUtil.getLocaleData('map', mapId);
promiseStore.then(function (dataStore) {
promiseStore.then(function(dataStore){
let Module = this.moduleElement.data('module');
let defaultPosition = Module.config.modulePosition || 0;
@@ -270,7 +270,7 @@ define([
dataStore[key]
){
let positionIndex = dataStore[key].indexOf(Module.config.moduleName);
if(positionIndex !== -1) {
if(positionIndex !== -1){
// first index (0) => is position 1
defaultPosition = positionIndex + 1;
}
@@ -286,13 +286,13 @@ define([
// -> no :nth-child or :nth-of-type here because there might be temporary "spacer" div "modules"
// that should be ignored for positioning
let prevModuleElement = this.parentElement.find('.' + config.moduleClass).filter(i => ++i === position);
if(prevModuleElement.length) {
if(prevModuleElement.length){
this.moduleElement.insertAfter(prevModuleElement);
} else {
}else{
this.parentElement.prepend(this.moduleElement);
}
if(typeof Module.beforeShow === 'function') {
if(typeof Module.beforeShow === 'function'){
Module.beforeShow(this.moduleElement, moduleElement.data('data'));
}
@@ -303,10 +303,10 @@ define([
}, {
duration: Init.animationSpeed.mapModule,
easing: 'easeOutSine',
complete: function (moduleElement) {
complete: function(moduleElement){
moduleElement = $(moduleElement);
let Module = $(moduleElement).data('module');
if(typeof Module.initModule === 'function') {
if(typeof Module.initModule === 'function'){
Module.initModule(moduleElement, mapId, moduleElement.data('data'));
}
@@ -330,11 +330,11 @@ define([
// check if module already exists
let moduleElement = parentElement.find('.' + Module.config.moduleTypeClass);
if(moduleElement.length > 0) {
if(moduleElement.length > 0){
removeModule(moduleElement, Module, () => {
showPanel(parentElement, Module, mapId, data);
}, true);
} else {
}else{
showPanel(parentElement, Module, mapId, data);
}
};
@@ -487,7 +487,7 @@ define([
systemData.id === currentSystemData.systemData.id
){
// trigger system update events
let tabContentElement = $( '#' + config.mapTabIdPrefix + systemData.mapId + '.' + config.mapTabContentClass);
let tabContentElement = $('#' + config.mapTabIdPrefix + systemData.mapId + '.' + config.mapTabContentClass);
tabContentElement.trigger('pf:updateSystemModules', [systemData]);
}
}
@@ -514,15 +514,15 @@ define([
dataIdAttr: 'data-module',
sort: true,
store: {
get: function (sortable) {
get: function(sortable){
return [];
},
set: function (sortable) {
set: function(sortable){
let key = 'modules_' + sortable.options.group.name;
MapUtil.storeLocalData('map', mapId, key, sortable.toArray());
}
},
onStart: function (e) {
onStart: function(e){
// Element dragging started
// -> save initial sort state -> see store.set()
this.save();
@@ -686,17 +686,17 @@ define([
return !Boolean(mapId);
},
store: {
get: function (sortable) {
get: function(sortable){
return [];
},
set: function (sortable) {
set: function(sortable){
let key = 'maps_' + sortable.options.group.name;
// convert string array to int array
let order = sortable.toArray().map((x) => parseInt(x, 10));
MapUtil.storeLocalData('character', characterId, key, order);
}
},
onStart: function (e) {
onStart: function(e){
// Element dragging started
// -> save initial sort state -> see store.set()
this.save();
@@ -790,7 +790,7 @@ define([
}
// change url to unique map URL
if(history.pushState) {
if(history.pushState){
let mapUrl = MapUtil.getMapDeeplinkUrl(mapConfig.config.id);
history.pushState({}, '', mapUrl);
}
@@ -1002,7 +1002,7 @@ define([
let key = 'maps_list_' + tabBar.attr('data-position');
if(dataStore && dataStore[key]){
let positionIndex = dataStore[key].indexOf(this.options.id);
if(positionIndex !== -1) {
if(positionIndex !== -1){
// first index (0) => is position 1
defaultPosition = positionIndex + 1;
}
@@ -1014,9 +1014,9 @@ define([
// insert at correct position -------------------------------------------------------------------------
let prevListElement = tabBar.find('li' + '' + ':nth-child(' + position + ')');
if(prevListElement.length) {
if(prevListElement.length){
tabListElement.insertAfter(prevListElement);
} else {
}else{
tabBar.prepend(tabListElement);
}
@@ -1267,7 +1267,7 @@ define([
}
// add new tabs for new maps
for(let data of tempMapData) {
for(let data of tempMapData){
if( activeMapIds.indexOf( data.config.id ) === -1 ){
// add new map tab
promisesAddTab.push(addTab(tabMapElement, data.config, currentUserData).then(tabAddCallback));
@@ -1310,14 +1310,14 @@ define([
// add new tab for each map
for(let j = 0; j < tempMapData.length; j++){
let data = tempMapData[j];
promisesAddTab.push(addTab(tabMapElement, data.config, currentUserData)) ;
promisesAddTab.push(addTab(tabMapElement, data.config, currentUserData));
}
// add "add" button
let tabAddOptions = {
id: 0,
type: {
classTab: MapUtil.getInfoForMap( 'standard', 'classTab')
classTab: MapUtil.getInfoForMap('standard', 'classTab')
},
icon: 'fa-plus',
name: 'add',

View File

@@ -8,7 +8,7 @@ define([
'pnotify.desktop',
//'pnotify.history',
'pnotify.callbacks'
], function($, Init, PNotify) {
], function($, Init, PNotify){
'use strict';
@@ -169,8 +169,8 @@ define([
}
};
return function () {
if (!blinkTimer) {
return function(){
if(!blinkTimer){
blinkTimer = setInterval(blink, 1000);
}
};

View File

@@ -265,7 +265,7 @@ define([
})
).on('click', function(){
let fullScreenElement = $('body');
requirejs(['jquery', 'fullScreen'], function($) {
requirejs(['jquery', 'fullScreen'], function($){
if($.fullscreen.isFullScreen()){
$.fullscreen.exit();
@@ -313,7 +313,7 @@ define([
)
);
requirejs(['fullScreen'], function() {
requirejs(['fullScreen'], function(){
if($.fullscreen.isNativelySupported() === true){
$('#' + Util.config.menuButtonFullScreenId).removeClass('hide');
}
@@ -501,12 +501,12 @@ define([
});
// main menus
$('.' + config.headMenuClass).on('click', function(e) {
$('.' + config.headMenuClass).on('click', function(e){
e.preventDefault();
slideMenu.slidebars.toggle('left');
});
$('.' + config.headMapClass).on('click', function(e) {
$('.' + config.headMapClass).on('click', function(e){
e.preventDefault();
slideMenu.slidebars.toggle('right');
});
@@ -548,7 +548,7 @@ define([
// -> always "enable"
mapTrackingCheckbox.bootstrapToggle('on');
mapTrackingCheckbox.on('change', function(e) {
mapTrackingCheckbox.on('change', function(e){
let value = $(this).is(':checked');
let tracking = 'off';
let trackingText = 'Your current location will not actually be added';
@@ -734,7 +734,7 @@ define([
// END menu events =============================================================================
// global "popover" callback (for all popovers)
$('.' + Util.config.popoverTriggerClass).on('hide.bs.popover', function(e) {
$('.' + Util.config.popoverTriggerClass).on('hide.bs.popover', function(e){
let popoverElement = $(this).data('bs.popover').tip();
// destroy all active tooltips inside this popover
@@ -742,7 +742,7 @@ define([
});
// global "modal" callback (for all modals)
$('body').on('hide.bs.modal', '> .modal', function(e) {
$('body').on('hide.bs.modal', '> .modal', function(e){
let modalElement = $(this);
modalElement.destroyTimestampCounter(true);
@@ -969,7 +969,7 @@ define([
animateHeaderElement(userInfoElement, (userInfoElement) => {
if(currentCharacterChanged){
userInfoElement.find('span').text( newCharacterName );
userInfoElement.find('img').attr('src', Init.url.ccpImageServer + '/Character/' + newCharacterId + '_32.jpg' );
userInfoElement.find('img').attr('src', Init.url.ccpImageServer + '/Character/' + newCharacterId + '_32.jpg');
}
// init "character switch" popover
userInfoElement.initCharacterSwitchPopover(userData);
@@ -990,7 +990,7 @@ define([
// toggle element
animateHeaderElement(userShipElement, (userShipElement) => {
userShipElement.find('span').text( newShipData.typeName );
userShipElement.find('img').attr('src', Init.url.ccpImageServer + '/Render/' + newShipData.typeId + '_32.png' );
userShipElement.find('img').attr('src', Init.url.ccpImageServer + '/Render/' + newShipData.typeId + '_32.png');
// trigger ship change event
$(document).trigger('pf:activeShip', {
shipData: newShipData
@@ -1122,30 +1122,30 @@ define([
// Set the name of the hidden property and the change event for visibility
let hidden, visibilityChange;
if (typeof document.hidden !== 'undefined') { // Opera 12.10 and Firefox 18 and later support
if(typeof document.hidden !== 'undefined'){ // Opera 12.10 and Firefox 18 and later support
hidden = 'hidden';
visibilityChange = 'visibilitychange';
} else if (typeof document.mozHidden !== 'undefined') {
}else if(typeof document.mozHidden !== 'undefined'){
hidden = 'mozHidden';
visibilityChange = 'mozvisibilitychange';
} else if (typeof document.msHidden !== 'undefined') {
}else if(typeof document.msHidden !== 'undefined'){
hidden = 'msHidden';
visibilityChange = 'msvisibilitychange';
} else if (typeof document.webkitHidden !== 'undefined') {
}else if(typeof document.webkitHidden !== 'undefined'){
hidden = 'webkitHidden';
visibilityChange = 'webkitvisibilitychange';
}
// function is called if the tab becomes active/inactive
let handleVisibilityChange = () => {
if (document[hidden]) {
if(document[hidden]){
// tab is invisible
// globally store current visibility status
window.isVisible = false;
Util.getCurrentTriggerDelay( mapUpdateKey, increaseTimer );
Util.getCurrentTriggerDelay( mapUserUpdateKey, increaseTimer );
} else {
}else{
// tab is visible
// globally store current visibility status
window.isVisible = true;
@@ -1158,7 +1158,7 @@ define([
}
};
if (
if(
typeof document.addEventListener !== 'undefined' &&
typeof document[hidden] !== 'undefined'
){
@@ -1268,16 +1268,16 @@ define([
* show information panel to active users (on bottom)
* @returns {*|jQuery|HTMLElement}
*/
$.fn.showGlobalInfoPanel = function (){
$.fn.showGlobalInfoPanel = function(){
let body = $(this);
let infoTemplate = 'text!templates/ui/info_panel.html';
requirejs([infoTemplate, 'mustache'], function(template, Mustache) {
requirejs([infoTemplate, 'mustache'], function(template, Mustache){
let data = {
id: config.globalInfoPanelId
};
let content = $( Mustache.render(template, data) );
content.insertBefore( '#' + config.pageFooterId );
content.insertBefore('#' + config.pageFooterId );
});
return body;
@@ -1296,7 +1296,7 @@ define([
// add "unchecked" checkboxes as well
values = values.concat(
form.find('input[type=checkbox]:not(:checked)').map(
function() {
function(){
return {name: this.name, value: 0};
}).get()
);

View File

@@ -2,7 +2,7 @@
* Render controller
*/
define(['jquery', 'mustache'], function($, Mustache) {
define(['jquery', 'mustache'], function($, Mustache){
'use strict';
@@ -28,7 +28,7 @@ define(['jquery', 'mustache'], function($, Mustache) {
*/
let showModule = function(config, data){
// require module template
requirejs(['text!templates/' + config.name + '.html'], function(template) {
requirejs(['text!templates/' + config.name + '.html'], function(template){
// check for an id, if module already exists, do not insert again
if(
data.id === 'undefined' ||
@@ -64,7 +64,7 @@ define(['jquery', 'mustache'], function($, Mustache) {
let highlightJson = (obj) => {
let multiplyString = (num, str) => {
let sb = [];
for (let i = 0; i < num; i++) {
for(let i = 0; i < num; i++){
sb.push(str);
}
return sb.join('');
@@ -77,35 +77,35 @@ define(['jquery', 'mustache'], function($, Mustache) {
let quoteKeys = false;
let expImageClicked = '(() => {let container=this.parentNode.nextSibling; container.style.display=container.style.display===\'none\'?\'inline\':\'none\'})();';
let checkForArray = function (obj) {
let checkForArray = function(obj){
return obj &&
typeof obj === 'object' &&
typeof obj.length === 'number' &&
!(obj.propertyIsEnumerable('length'));
};
let getRow = function (indent, data, isPropertyContent) {
let getRow = function(indent, data, isPropertyContent){
let tabs = '';
for (let i = 0; i < indent && !isPropertyContent; i++) tabs += tab;
if (data !== null && data.length > 0 && data.charAt(data.length - 1) !== '\n')
for(let i = 0; i < indent && !isPropertyContent; i++) tabs += tab;
if(data !== null && data.length > 0 && data.charAt(data.length - 1) !== '\n')
data = data + '\n';
return tabs + data;
};
let formatLiteral = function (literal, quote, comma, indent, isArray, style) {
if (typeof literal === 'string')
let formatLiteral = function(literal, quote, comma, indent, isArray, style){
if(typeof literal === 'string')
literal = literal.split('<').join('&lt;').split('>').join('&gt;');
let str = '<span class="' + style + '">' + quote + literal + quote + comma + '</span>';
if (isArray) str = getRow(indent, str);
if(isArray) str = getRow(indent, str);
return str;
};
let formatFunction = function (indent, obj) {
let formatFunction = function(indent, obj){
let tabs = '';
for (let i = 0; i < indent; i++) tabs += tab;
for(let i = 0; i < indent; i++) tabs += tab;
let funcStrArray = obj.toString().split('\n');
let str = '';
for (let i = 0; i < funcStrArray.length; i++) {
for(let i = 0; i < funcStrArray.length; i++){
str += ((i === 0) ? '' : tabs) + funcStrArray[i] + '\n';
}
return str;
@@ -118,36 +118,36 @@ define(['jquery', 'mustache'], function($, Mustache) {
let comma = (addComma) ? '<span class="pf-code-Comma">,</span> ' : '';
let type = typeof obj;
let clpsHtml = '';
if (checkForArray(obj)) {
if (obj.length === 0) {
if(checkForArray(obj)){
if(obj.length === 0){
html += getRow(indent, '<span class="pf-code-ArrayBrace">[ ]</span>' + comma, isPropertyContent);
} else {
}else{
clpsHtml = isCollapsible ? '<span><i class="fas fa-fw fa-plus-square" onClick="' + expImageClicked + '"></i></span><span class="collapsible">' : '';
html += getRow(indent, '<span class="pf-code-ArrayBrace">[</span>' + clpsHtml, isPropertyContent);
for (let i = 0; i < obj.length; i++) {
for(let i = 0; i < obj.length; i++){
html += highlight(obj[i], indent + 1, i < (obj.length - 1), true, false);
}
clpsHtml = isCollapsible ? '</span>' : '';
html += getRow(indent, clpsHtml + '<span class="pf-code-ArrayBrace">]</span>' + comma);
}
} else if (type === 'object') {
if (obj === null) {
}else if(type === 'object'){
if(obj === null){
html += formatLiteral('null', '', comma, indent, isArray, 'pf-code-Null');
} else if (obj.constructor === dateObj.constructor) {
}else if(obj.constructor === dateObj.constructor){
html += formatLiteral('new Date(' + obj.getTime() + ') /*' + obj.toLocaleString() + '*/', '', comma, indent, isArray, 'Date');
} else if (obj.constructor === regexpObj.constructor) {
}else if(obj.constructor === regexpObj.constructor){
html += formatLiteral('new RegExp(' + obj + ')', '', comma, indent, isArray, 'RegExp');
} else {
}else{
let numProps = 0;
for (let prop in obj) numProps++;
if (numProps === 0) {
for(let prop in obj) numProps++;
if(numProps === 0){
html += getRow(indent, '<span class="pf-code-ObjectBrace">{ }</span>' + comma, isPropertyContent);
} else {
}else{
clpsHtml = isCollapsible ? '<span><i class="fas fa-fw fa-plus-square" onClick="' + expImageClicked + '"></i></span><span class="collapsible">' : '';
html += getRow(indent, '<span class="pf-code-ObjectBrace">{</span>' + clpsHtml, isPropertyContent);
let j = 0;
for (let prop in obj) {
if (obj.hasOwnProperty(prop)) {
for(let prop in obj){
if(obj.hasOwnProperty(prop)){
let quote = quoteKeys ? '"' : '';
html += getRow(indent + 1, '<span class="pf-code-PropertyName">' + quote + prop + quote + '</span>: ' + highlight(obj[prop], indent + 1, ++j < numProps, false, true));
}
@@ -156,20 +156,20 @@ define(['jquery', 'mustache'], function($, Mustache) {
html += getRow(indent, clpsHtml + '<span class="pf-code-ObjectBrace">}</span>' + comma);
}
}
} else if (type === 'number') {
}else if(type === 'number'){
html += formatLiteral(obj, '', comma, indent, isArray, 'pf-code-Number');
} else if (type === 'boolean') {
}else if(type === 'boolean'){
html += formatLiteral(obj, '', comma, indent, isArray, 'pf-code-Boolean');
} else if (type === 'function') {
if (obj.constructor === regexpObj.constructor) {
}else if(type === 'function'){
if(obj.constructor === regexpObj.constructor){
html += formatLiteral('new RegExp(' + obj + ')', '', comma, indent, isArray, 'RegExp');
} else {
}else{
obj = formatFunction(indent, obj);
html += formatLiteral(obj, '', comma, indent, isArray, 'pf-code-Function');
}
} else if (type === 'undefined') {
}else if(type === 'undefined'){
html += formatLiteral('undefined', '', comma, indent, isArray, 'pf-code-Null');
} else {
}else{
html += formatLiteral(obj.toString().split('\\').join('\\\\').split('"').join('\\"'), '"', comma, indent, isArray, 'pf-code-String');
}

View File

@@ -7,7 +7,7 @@ define([
'app/init',
'app/util',
'app/map/worker'
], function($, Init, Util, MapWorker) {
], function($, Init, Util, MapWorker){
'use strict';
let config = {
@@ -35,7 +35,7 @@ define([
context: context
}).done(function(data){
callback(this, data);
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': Failed. Please retry', text: reason, type: 'warning'});
this.target.button('reset');
@@ -83,7 +83,7 @@ define([
body.initTooltips();
// change url (remove logout parameter)
if (history.pushState) {
if(history.pushState){
history.pushState({}, '', location.protocol + '//' + location.host + location.pathname);
}
};
@@ -139,7 +139,7 @@ define([
webSocketPanel.showLoadingAnimation();
let removeColorClasses = (el) => {
el.removeClass (function (index, css) {
el.removeClass (function(index, css){
return (css.match (/\btxt-color-\S+/g) || []).join(' ');
});
};

View File

@@ -5,7 +5,7 @@
define([
'jquery',
'lazylinepainter'
], function($) {
], function($){
'use strict';

View File

@@ -8,7 +8,7 @@ define([
'app/util',
'app/render',
'bootbox'
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
let config = {
@@ -42,7 +42,7 @@ define([
return false;
}
requirejs(['text!templates/dialog/settings.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/settings.html', 'mustache'], function(template, Mustache){
let data = {
id: config.settingsDialogId,
@@ -71,7 +71,7 @@ define([
success: {
label: '<i class="fas fa-check fa-fw"></i>&nbsp;save',
className: 'btn-success',
callback: function() {
callback: function(){
// get the current active form
let form = $('#' + config.settingsDialogId).find('form').filter(':visible');
@@ -133,7 +133,7 @@ define([
accountSettingsDialog.modal('hide');
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
accountSettingsDialog.find('.modal-content').hideLoadingAnimation();
let reason = status + ' ' + error;
@@ -183,7 +183,7 @@ define([
});
// after modal is shown =======================================================================
accountSettingsDialog.on('shown.bs.modal', function(e) {
accountSettingsDialog.on('shown.bs.modal', function(e){
let dialogElement = $(this);
let form = dialogElement.find('form');

View File

@@ -80,7 +80,7 @@ define([
showVersion(changelogDialog, versionData);
requirejs(['text!templates/ui/timeline_element.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/ui/timeline_element.html', 'mustache'], function(template, Mustache){
for(let i = 0; i < releasesData.length; i++){
let releaseData = releasesData[i];
@@ -103,10 +103,10 @@ define([
complete: function(){}
});
});
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + jqXHR.status + ': ' + error;
Util.showNotify({title: jqXHR.status + ': login', text: reason, type: 'error'});
}).always(function() {
}).always(function(){
dialogContent.hideLoadingAnimation();
});
};
@@ -132,7 +132,7 @@ define([
});
// after modal is shown =======================================================================
changelogDialog.on('shown.bs.modal', function(e) {
changelogDialog.on('shown.bs.modal', function(e){
loadDialogData(changelogDialog);
});
};

View File

@@ -9,7 +9,7 @@ define([
'app/render',
'bootbox',
'app/ui/logo'
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
let config = {
@@ -23,7 +23,7 @@ define([
*/
$.fn.showCreditsDialog = function(callback, enableHover){
requirejs(['text!templates/dialog/credit.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/credit.html', 'mustache'], function(template, Mustache){
let data = {
logoContainerId: config.creditsDialogLogoContainerId,
@@ -39,7 +39,7 @@ define([
});
// after modal is shown =======================================================================
creditDialog.on('shown.bs.modal', function(e) {
creditDialog.on('shown.bs.modal', function(e){
// load Logo svg
creditDialog.find('#' + config.creditsDialogLogoContainerId).drawLogo(callback, enableHover);

View File

@@ -88,7 +88,7 @@ define([
});
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
dialogElement.find('.modal-content').hideLoadingAnimation();
let reason = status + ' ' + error;

View File

@@ -25,7 +25,7 @@ define([
requirejs(['text!templates/dialog/jump_info.html', 'mustache'], (template, Mustache) => {
let data = {
config: config,
wormholes: Object.keys(Init.wormholes).map(function(k) { return Init.wormholes[k]; }), // convert Json to array
wormholes: Object.keys(Init.wormholes).map(function(k){ return Init.wormholes[k]; }), // convert Json to array
securityClass: function(){
return function(value, render){
return this.Util.getSecurityClassForSystem( render(value) );
@@ -77,7 +77,7 @@ define([
show: false
});
jumpDialog.on('show.bs.modal', function(e) {
jumpDialog.on('show.bs.modal', function(e){
// init dataTable
$(this).find('.' + config.wormholeInfoMassTableClass).DataTable({
pageLength: 25,

View File

@@ -8,7 +8,7 @@ define([
'app/util',
'app/render',
'bootbox',
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
@@ -26,7 +26,7 @@ define([
*/
$.fn.showMapManual = function(){
requirejs(['text!templates/dialog/map_manual.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/map_manual.html', 'mustache'], function(template, Mustache){
let data = {
dialogNavigationClass: config.dialogNavigationClass,
@@ -47,7 +47,7 @@ define([
success: {
label: 'close',
className: 'btn-default',
callback: function() {
callback: function(){
$(mapManualDialog).modal('hide');
}
}
@@ -66,7 +66,7 @@ define([
// scroll navigation links
let scrollNavLiElements = null;
mapManualDialog.on('shown.bs.modal', function(e) {
mapManualDialog.on('shown.bs.modal', function(e){
// modal on open
scrolLBreakpointElements = $('.pf-manual-scroll-break');
scrollNavLiElements = $('.' + config.dialogNavigationListItemClass);

View File

@@ -224,7 +224,7 @@ define([
systemsElement.showLoadingAnimation(config.loadingOptions);
systemTable.on( 'init.dt', function (){
systemTable.on('init.dt', function(){
systemsElement.hideLoadingAnimation();
// init table tooltips
@@ -520,7 +520,7 @@ define([
connectionsElement.showLoadingAnimation(config.loadingOptions);
// table init complete
connectionTable.on( 'init.dt', function (){
connectionTable.on('init.dt', function(){
connectionsElement.hideLoadingAnimation();
});
@@ -687,7 +687,7 @@ define([
usersElement.showLoadingAnimation(config.loadingOptions);
// table init complete
userTable.on( 'init.dt', function (){
userTable.on('init.dt', function(){
usersElement.hideLoadingAnimation();
// init table tooltips
@@ -834,7 +834,7 @@ define([
className: [config.tableCellActionClass, 'min-screen-l'].join(' '),
data: 'corporation',
render: {
_: function (data, type, row, meta){
_: function(data, type, row, meta){
let value = data.name;
if(type === 'display'){
value += '&nbsp;' + getIconForInformationWindow();
@@ -874,7 +874,7 @@ define([
data: 'log',
defaultContent: getLabelForUnknownData(),
render: {
_: function (data, type, row, meta){
_: function(data, type, row, meta){
let value = data;
if(data){
if(data.station && data.station.id > 0){
@@ -897,7 +897,7 @@ define([
className: ['text-right', 'min-screen-l'].join(' '),
data: 'role',
render: {
_: function (data, type, row, meta){
_: function(data, type, row, meta){
let value = data.label;
if(type === 'display'){
value = Util.getLabelByRole(data).prop('outerHTML');
@@ -961,7 +961,7 @@ define([
context: context
}).done(function(data){
this.callback(data, context);
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': loadLogs', text: reason, type: 'warning'});
}).always(function(){
@@ -1052,7 +1052,7 @@ define([
render: {
_: function(data, type, row, meta){
// strip microseconds
let logDateString = data.substring(0, 19) ;
let logDateString = data.substring(0, 19);
let logDate = new Date(logDateString.replace(/-/g, '/'));
data = Util.convertDateToString(logDate, true);
@@ -1204,7 +1204,7 @@ define([
let timestampColumn = tableApi.column('timestamp:name').header();
let timestampColumnCells = tableApi.cells(undefined, 'timestamp:name', {page: 'current', order:'current'});
let hasOldLogs = timestampColumnCells.render( 'display' ).reduce((hasOldLogs, cellValue) => {
let hasOldLogs = timestampColumnCells.render('display').reduce((hasOldLogs, cellValue) => {
return (hasOldLogs === false && !cellValue.startsWith('today')) ? true : hasOldLogs;
}, false);
@@ -1228,7 +1228,7 @@ define([
className: 'btn btn-sm btn-default',
text: '<i class="fas fa-fw fa-plus"></i>&nbsp;load more',
enabled: false,
action: function ( e, dt, node, config ){
action: function(e, dt, node, config ){
let pageInfo = dt.page.info();
getLogsData({

View File

@@ -315,7 +315,7 @@ define([
formatFilename: function(){
// format filename from "map name" (initial)
return function (mapName, render) {
return function(mapName, render){
let filename = render(mapName);
return formatFilename(filename);
};
@@ -340,7 +340,7 @@ define([
success: {
label: '<i class="fas fa-check fa-fw"></i>&nbsp;save',
className: 'btn-success',
callback: function() {
callback: function(){
// get the current active form
let form = $('#' + config.newMapDialogId).find('form').filter(':visible');
@@ -424,12 +424,12 @@ define([
$(mapInfoDialog).modal('hide');
$(document).trigger('pf:closeMenu', [{}]);
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': saveMap', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
}).always(function() {
}).always(function(){
dialogContent.hideLoadingAnimation();
});
}
@@ -449,7 +449,7 @@ define([
// prevent "disabled" tabs from being clicked... "bootstrap" bugFix...
mapInfoDialog.find('.navbar a[data-toggle=tab]').on('click', function(e){
if ($(this).hasClass('disabled')){
if($(this).hasClass('disabled')){
e.preventDefault();
return false;
}
@@ -532,7 +532,7 @@ define([
let output = [];
let files = e.target.files;
for (let i = 0, f; !!(f = files[i]); i++) {
for(let i = 0, f; !!(f = files[i]); i++){
output.push(( i + 1 ) + '. file: ' + f.name + ' - ' +
f.size + ' bytes; last modified: ' +
f.lastModifiedDate.toLocaleDateString() );
@@ -553,7 +553,7 @@ define([
let filesCountFail = 0;
// onLoad for FileReader API
let readerOnLoad = function(readEvent) {
let readerOnLoad = function(readEvent){
// get file content
try{
@@ -574,7 +574,7 @@ define([
}
};
let handleDragOver = function(dragEvent) {
let handleDragOver = function(dragEvent){
dragEvent.stopPropagation();
dragEvent.preventDefault();
dragEvent.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.
@@ -591,7 +591,7 @@ define([
files = evt.dataTransfer.files; // FileList object.
for (let file; !!(file = files[filesCount]); filesCount++){
for(let file; !!(file = files[filesCount]); filesCount++){
let reader = new FileReader();
reader.onload = readerOnLoad;
reader.readAsText(file);
@@ -605,7 +605,7 @@ define([
}
// import "button"
downloadTabElement.find('#' + config.buttonImportId).on('click', function(e) {
downloadTabElement.find('#' + config.buttonImportId).on('click', function(e){
importFormElement.validator('validate');
let validImportForm = importFormElement.isValidForm();
@@ -619,7 +619,7 @@ define([
filesCount = 0;
filesCountFail = 0;
for (let file; !!(file = files[filesCount]); filesCount++){
for(let file; !!(file = files[filesCount]); filesCount++){
let reader = new FileReader();
reader.onload = readerOnLoad;
reader.readAsText(file);
@@ -710,10 +710,10 @@ define([
Util.showNotify({title: 'Import finished', text: 'Map(s) imported', type: 'success'});
}
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': importMap', text: reason, type: 'error'});
}).always(function() {
}).always(function(){
importForm.find('input, select').resetFormFields().trigger('change');
dialogContent.hideLoadingAnimation();
});
@@ -798,11 +798,11 @@ define([
dataType: 'json'
}).done(function(data){
Util.showNotify({title: 'Map deleted', text: 'Map: ' + mapName, type: 'success'});
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': deleteMap', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
}).always(function() {
}).always(function(){
$(mapDeleteDialog).modal('hide');
});

View File

@@ -8,7 +8,7 @@ define([
'app/util',
'app/render',
'bootbox'
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
@@ -52,7 +52,7 @@ define([
// close all modals
$('.modal').modal('hide');
requirejs(['text!templates/dialog/notification.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/dialog/notification.html', 'mustache'], function(template, Mustache){
let data = {
id: config.notificationDialogId,
@@ -70,7 +70,7 @@ define([
});
shutdownDialog.on('shown.bs.modal', function(e) {
shutdownDialog.on('shown.bs.modal', function(e){
// remove close button
let dialog = $(this);

View File

@@ -9,7 +9,7 @@ define([
'app/render',
'bootbox',
'app/key',
], function($, Init, Util, Render, bootbox, Key) {
], function($, Init, Util, Render, bootbox, Key){
'use strict';

View File

@@ -10,7 +10,7 @@ define([
'app/render',
'bootbox',
'peityInlineChart'
], function($, Init, Util, Render, bootbox) {
], function($, Init, Util, Render, bootbox){
'use strict';
let config = {
@@ -355,7 +355,7 @@ define([
});
});
},
footerCallback: function ( row, data, start, end, display ) {
footerCallback: function(row, data, start, end, display ){
let api = this.api();
let sumColumnIndexes = [7, 11, 15, 19, 20];
@@ -417,7 +417,7 @@ define([
this.dynamicArea.hideLoadingAnimation();
this.callback(data);
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': loadStatistics', text: reason, type: 'warning'});
});
@@ -753,7 +753,7 @@ define([
* show activity stats dialog
*/
$.fn.showStatsDialog = function(){
requirejs(['text!templates/dialog/stats.html', 'mustache', 'datatables.loader'], function(template, Mustache) {
requirejs(['text!templates/dialog/stats.html', 'mustache', 'datatables.loader'], function(template, Mustache){
// get current statistics map settings
let logActivityEnabled = false;
let activeMap = Util.getMapModule().getActiveMap();
@@ -816,20 +816,20 @@ define([
});
// model events
statsDialog.on('show.bs.modal', function(e) {
statsDialog.on('show.bs.modal', function(e){
let dialogElement = $(e.target);
initStatsTable(dialogElement);
});
// Tab module events
statsDialog.find('a[data-toggle="tab"]').on('show.bs.tab', function (e, b, c) {
statsDialog.find('a[data-toggle="tab"]').on('show.bs.tab', function(e, b, c){
if( $(e.target).parent().hasClass('disabled') ){
// no action on "disabled" tabs
return false;
}
});
statsDialog.find('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
statsDialog.find('a[data-toggle="tab"]').on('shown.bs.tab', function(e){
let requestData = getRequestDataFromTabPanels(statsDialog);
let tableApi = statsDialog.find('#' + config.statsTableId).DataTable();

View File

@@ -10,7 +10,7 @@ define([
'app/render',
'bootbox',
'app/map/util'
], function($, Init, Util, Render, bootbox, MapUtil) {
], function($, Init, Util, Render, bootbox, MapUtil){
'use strict';
let config = {
@@ -36,7 +36,7 @@ define([
let systemEffectData = Util.getSystemEffectData();
$.each( systemEffectData.wh, function( effectName, effectData ) {
$.each( systemEffectData.wh, function(effectName, effectData ){
let table = $('<table>', {
class: ['table', 'table-condensed'].join(' ')
@@ -51,7 +51,7 @@ define([
let systemEffectName = MapUtil.getEffectInfoForSystem(effectName, 'name');
let systemEffectClass = MapUtil.getEffectInfoForSystem(effectName, 'class');
$.each( effectData, function( areaId, areaData ) {
$.each( effectData, function(areaId, areaData ){
let systemType = 'C' + areaId;
let securityClass = Util.getSecurityClassForSystem( systemType );
@@ -61,7 +61,7 @@ define([
thead.append( rows[0] );
rows[0].append(
$('<td>').html( '&nbsp;&nbsp;' + systemEffectName).prepend(
$('<td>').html('&nbsp;&nbsp;' + systemEffectName).prepend(
$('<i>', {
class: ['fas', 'fa-square', 'fa-fw', systemEffectClass].join(' ')
})
@@ -73,7 +73,7 @@ define([
class: ['text-right', 'col-xs-1', securityClass].join(' ')
}).text( systemType ));
$.each( areaData, function( i, data ) {
$.each( areaData, function(i, data ){
if(areaId === '1'){
rows.push( $('<tr>') );
@@ -92,7 +92,7 @@ define([
});
dialogWrapperElement.append( table.append( thead ).append( tbody ) );
dialogWrapperElement.append(table.append(thead).append(tbody));
cache.systemEffectDialog = dialogWrapperElement;
});

View File

@@ -231,11 +231,11 @@ define([
let shatteredClass = Util.getSecurityClassForSystem('SH');
// format result data
function formatResultData (data) {
function formatResultData (data){
if(data.loading) return data.text;
// abyss system font
let systemNameClass = data.security === 'A' ? Util.config.fontTriglivianClass : '' ;
let systemNameClass = data.security === 'A' ? Util.config.fontTriglivianClass : '';
// show effect info just for wormholes
let hideEffectClass = data.effect === null ? 'hide' : '';
@@ -272,7 +272,7 @@ define([
page: params.page || 1
};
},
processResults: function(data, params) {
processResults: function(data, params){
// parse the results into the format expected by Select2.
return {
results: data.results.map( function(item){
@@ -321,7 +321,7 @@ define([
}
};
},
error: function (jqXHR, status, error) {
error: function(jqXHR, status, error){
if( !Util.isXHRAborted(jqXHR) ){
let reason = status + ' ' + jqXHR.status + ': ' + error;
@@ -386,11 +386,11 @@ define([
delay: 250,
timeout: 5000,
cache: true,
data: function(params) {
data: function(params){
// no url params here
return;
},
processResults: function(data, page) {
processResults: function(data, page){
// parse the results into the format expected by Select2.
return {
results: data.map( function(item){
@@ -402,7 +402,7 @@ define([
})
};
},
error: function (jqXHR, status, error) {
error: function(jqXHR, status, error){
if( !Util.isXHRAborted(jqXHR) ){
let reason = status + ' ' + jqXHR.status + ': ' + error;
@@ -434,7 +434,7 @@ define([
* @param options
* @returns {*}
*/
$.fn.initUniverseSearch = function(options) {
$.fn.initUniverseSearch = function(options){
let showErrorNotification = (reason) => {
Util.showNotify({title: 'Search failed', text: reason + ' deleted', type: 'warning'});
@@ -495,7 +495,7 @@ define([
});
}
return this.each(function() {
return this.each(function(){
let selectElement = $(this);
$.when(
@@ -515,7 +515,7 @@ define([
categories: options.categoryNames
};
},
processResults: function(result, page) {
processResults: function(result, page){
let data = {results: []};
if(result.hasOwnProperty('error')){
showErrorNotification(result.error);
@@ -543,7 +543,7 @@ define([
return data;
},
error: function (jqXHR, status, error) {
error: function(jqXHR, status, error){
if( !Util.isXHRAborted(jqXHR) ){
let reason = status + ' ' + jqXHR.status + ': ' + error;
showErrorNotification(reason);
@@ -631,7 +631,7 @@ define([
return data;
};
return this.each(function() {
return this.each(function(){
let selectElement = $(this);
$.when(

View File

@@ -21,7 +21,7 @@ define([
let connectionCount = 4;
let initHeader = function() {
let initHeader = function(){
width = window.innerWidth;
height = canvasHeight;
target = {x: width * 1, y: 230};
@@ -34,8 +34,8 @@ define([
// create points
points = [];
for(let x = 0; x < width; x = x + width/20) {
for(let y = 0; y < height; y = y + height/15) {
for(let x = 0; x < width; x = x + width/20){
for(let y = 0; y < height; y = y + height/15){
let px = x + Math.random()*width/15;
let py = y + Math.random()*height/15;
let p = {x: px, originX: px, y: py, originY: py };
@@ -44,25 +44,25 @@ define([
}
// for each point find the 5 closest points
for(let i = 0; i < points.length; i++) {
for(let i = 0; i < points.length; i++){
let closest = [];
let p1 = points[i];
for(let j = 0; j < points.length; j++) {
for(let j = 0; j < points.length; j++){
let p2 = points[j];
if(p1 !== p2) {
if(p1 !== p2){
let placed = false;
for(let k = 0; k < connectionCount; k++) {
if(!placed) {
if(closest[k] === undefined) {
for(let k = 0; k < connectionCount; k++){
if(!placed){
if(closest[k] === undefined){
closest[k] = p2;
placed = true;
}
}
}
for(let m = 0; m < connectionCount; m++) {
if(!placed) {
if(getDistance(p1, p2) < getDistance(p1, closest[m])) {
for(let m = 0; m < connectionCount; m++){
if(!placed){
if(getDistance(p1, p2) < getDistance(p1, closest[m])){
closest[m] = p2;
placed = true;
}
@@ -74,28 +74,28 @@ define([
}
// assign a circle to each point
for(let n in points) {
for(let n in points){
let c = new Circle(points[n], 2+Math.random()*2, 'rgba(255,255,255,0.3)');
points[n].circle = c;
}
};
// Event handling
let addListeners = function() {
if(!('ontouchstart' in window)) {
let addListeners = function(){
if(!('ontouchstart' in window)){
window.addEventListener('mousemove', mouseMove);
}
window.addEventListener('scroll', scrollCheck);
window.addEventListener('resize', resize);
};
let mouseMove = function(e) {
let mouseMove = function(e){
let posx = 0;
let posy = 0;
if (e.pageX || e.pageY) {
if(e.pageX || e.pageY){
posx = e.pageX;
posy = e.pageY;
}else if (e.clientX || e.clientY){
}else if(e.clientX || e.clientY){
posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
@@ -103,7 +103,7 @@ define([
target.y = posy;
};
let scrollCheck = function() {
let scrollCheck = function(){
if(document.body.scrollTop > height){
animateHeader = false;
}else{
@@ -111,7 +111,7 @@ define([
}
};
let resize = function() {
let resize = function(){
width = window.innerWidth;
height = canvasHeight;
largeHeader.style.height = height+'px';
@@ -120,28 +120,28 @@ define([
};
// animation
let initAnimation = function() {
let initAnimation = function(){
animate();
for(let i in points) {
for(let i in points){
shiftPoint(points[i]);
}
};
let animate = function animate() {
if(animateHeader) {
let animate = function animate(){
if(animateHeader){
ctx.clearRect(0,0,width,height);
for(let i in points) {
for(let i in points){
// detect points in range
if(Math.abs(getDistance(target, points[i])) < 4000) {
if(Math.abs(getDistance(target, points[i])) < 4000){
points[i].active = 0.25;
points[i].circle.active = 0.45;
} else if(Math.abs(getDistance(target, points[i])) < 20000) {
}else if(Math.abs(getDistance(target, points[i])) < 20000){
points[i].active = 0.1;
points[i].circle.active = 0.3;
} else if(Math.abs(getDistance(target, points[i])) < 40000) {
}else if(Math.abs(getDistance(target, points[i])) < 40000){
points[i].active = 0.02;
points[i].circle.active = 0.1;
} else {
}else{
points[i].active = 0;
points[i].circle.active = 0;
}
@@ -153,18 +153,18 @@ define([
requestAnimationFrame(animate);
};
let shiftPoint = function (p) {
let shiftPoint = function(p){
TweenLite.to(p, 1 + 1 * Math.random(), {x: p.originX - 50 + Math.random() * 100,
y: p.originY - 50 + Math.random() * 100, ease: Circ.easeInOut,
onComplete: function () {
onComplete: function(){
shiftPoint(p);
}});
};
// Canvas manipulation
let drawLines = function (p) {
let drawLines = function(p){
if(!p.active) return;
for(let i in p.closest) {
for(let i in p.closest){
ctx.beginPath();
ctx.moveTo(p.x, p.y);
ctx.lineTo(p.closest[i].x, p.closest[i].y);
@@ -173,17 +173,17 @@ define([
}
};
let Circle = function(pos,rad,color) {
let Circle = function(pos,rad,color){
let _this = this;
// constructor
(function() {
(function(){
_this.pos = pos || null;
_this.radius = rad || null;
_this.color = color || null;
})();
this.draw = function() {
this.draw = function(){
if(!_this.active) return;
ctx.beginPath();
ctx.arc(_this.pos.x, _this.pos.y, _this.radius, 0, 2 * Math.PI, false);
@@ -193,7 +193,7 @@ define([
};
// Util
let getDistance = function(p1, p2) {
let getDistance = function(p1, p2){
return Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2);
};

View File

@@ -59,7 +59,7 @@ define([
};
// load Logo svg
requirejs(['text!templates/ui/logo.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/ui/logo.html', 'mustache'], function(template, Mustache){
let logoData = {
staticLogoId: config.staticLogoId,
logoPartTopRightClass: config.logoPartTopRightClass,

View File

@@ -530,7 +530,7 @@ define([
}).done(function(connectionsData){
// enrich connectionData with "logs" data (if available) and other "missing" data
for(let i = 0; i < this.connectionsData.length; i++){
for(let connectionData of connectionsData) {
for(let connectionData of connectionsData){
if(this.connectionsData[i].id === connectionData.id){
// copy some missing data
this.connectionsData[i].created = connectionData.created;
@@ -564,7 +564,7 @@ define([
*/
let getConnectionsLogData = (moduleElement, mapId, connectionsData) => {
let connectionIds = [];
for(let connectionData of connectionsData) {
for(let connectionData of connectionsData){
connectionIds.push(connectionData.id);
}
@@ -592,11 +592,11 @@ define([
let getRowIndexesByData = (dataTable, colName, value) => {
return dataTable.rows().eq(0).filter((rowIdx) => {
return (dataTable.cell(rowIdx, colName + ':name' ).data() === value);
return (dataTable.cell(rowIdx, colName + ':name').data() === value);
});
};
for(let connectionData of connectionsData) {
for(let connectionData of connectionsData){
// find related dom element for current connection
let connectionElement = moduleElement.find('#' + getConnectionElementId(connectionData.id));
if(connectionElement.length){
@@ -756,7 +756,7 @@ define([
}
],
drawCallback: function(settings){
let animationRows = this.api().rows().nodes().to$().filter(function(a,b ) {
let animationRows = this.api().rows().nodes().to$().filter(function(a,b ){
return (
$(this).data('animationStatus') ||
$(this).data('animationTimer')
@@ -769,7 +769,7 @@ define([
}
},
footerCallback: function ( row, data, start, end, display ) {
footerCallback: function(row, data, start, end, display ){
let api = this.api();
let sumColumnIndexes = [3];

View File

@@ -170,7 +170,7 @@ define([
graphData: graphData
}
});
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': System graph data', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -204,8 +204,8 @@ define([
eventLine = 23 - eventLine;
// update graph data ------------------------------------------------------------------------------------------
for (let [systemId, graphsData] of Object.entries(graphData)){
for (let [graphKey, graphData] of Object.entries(graphsData)){
for(let [systemId, graphsData] of Object.entries(graphData)){
for(let [graphKey, graphData] of Object.entries(graphsData)){
let graphElement = context.moduleElement.find('[data-graph="' + graphKey + '"]');
graphElement.hideLoadingAnimation();
initGraph(graphElement, graphKey, graphData, eventLine);
@@ -262,7 +262,7 @@ define([
class: 'row'
});
for (let [graphKey, graphConfig] of Object.entries(config.systemGraphs)){
for(let [graphKey, graphConfig] of Object.entries(config.systemGraphs)){
rowElement.append(
$('<div>', {
class: ['col-xs-12', 'col-sm-6', 'col-md-4'].join(' ')

View File

@@ -228,7 +228,7 @@ define([
return params;
},
validate: function(value){
if(value.length > 0 && $.trim(value).length === 0) {
if(value.length > 0 && $.trim(value).length === 0){
return {newValue: ''};
}
},

View File

@@ -93,8 +93,8 @@ define([
if(systemData){
let corporations = Util.getObjVal(systemData, 'structures');
if(corporations) {
for (let [corporationId, corporationData] of Object.entries(corporations)){
if(corporations){
for(let [corporationId, corporationData] of Object.entries(corporations)){
if(corporationData.structures && corporationData.structures.length){
for(let structureData of corporationData.structures){
let rowId = getRowId(context.tableApi, structureData.id);
@@ -199,7 +199,7 @@ define([
context: context
}).done(function(data){
callback(this, data);
}).fail(function( jqXHR, status, error) {
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': System intel data', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -283,7 +283,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-check"></i>&nbsp;save',
className: 'btn-success',
callback: function (){
callback: function(){
let form = this.find('form');
// validate form
@@ -314,7 +314,7 @@ define([
}
});
structureDialog.on('show.bs.modal', function(e) {
structureDialog.on('show.bs.modal', function(e){
let modalContent = $('#' + config.structureDialogId);
// init type select live search
@@ -375,7 +375,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-paste fa-fw"></i>&nbsp;update intel',
className: 'btn-success',
callback: function (){
callback: function(){
let form = this.find('form');
let formData = form.getFormValues();
@@ -389,7 +389,7 @@ define([
});
// dialog shown event
structureDialog.on('shown.bs.modal', function(e) {
structureDialog.on('shown.bs.modal', function(e){
// set focus on textarea
structureDialog.find('textarea').focus();
});
@@ -571,7 +571,7 @@ define([
if($(cell).is(':empty')){
$(cell).removeClass(config.dataTableActionCellClass + ' ' + config.moduleHeadlineIconClass);
}else{
$(cell).on('click', function(e) {
$(cell).on('click', function(e){
// get current row data (important!)
// -> "rowData" param is not current state, values are "on createCell()" state
rowData = tableApi.row( $(cell).parents('tr')).data();
@@ -645,14 +645,14 @@ define([
}
}
],
drawCallback: function (settings){
drawCallback: function(settings){
let tableApi = this.api();
let columnCount = tableApi.columns(':visible').count();
let rows = tableApi.rows( {page:'current'} ).nodes();
let last= null;
tableApi.column('corporation:name', {page:'current'} ).data().each( function ( group, i ) {
if ( !last || last.id !== group.id ) {
tableApi.column('corporation:name', {page:'current'} ).data().each( function(group, i ){
if( !last || last.id !== group.id ){
$(rows).eq(i).before(
'<tr class="group">' +
'<td></td>' +
@@ -666,7 +666,7 @@ define([
}
});
let animationRows = rows.to$().filter(function() {
let animationRows = rows.to$().filter(function(){
return (
$(this).data('animationStatus') ||
$(this).data('animationTimer')

View File

@@ -101,7 +101,7 @@ define([
}
};
requirejs(['text!templates/modules/killboard.html', 'mustache'], function(template, Mustache) {
requirejs(['text!templates/modules/killboard.html', 'mustache'], function(template, Mustache){
let content = Mustache.render(template, data);
moduleElement.append(content);
@@ -150,7 +150,7 @@ define([
if(data.count === 0){
labelOptions.type = 'label-success';
label = getLabel( 'No kills found within the last 24h', labelOptions );
label = getLabel('No kills found within the last 24h', labelOptions );
killboardGraphElement.append( label );
minifyKillboardGraphElement(killboardGraphElement);
@@ -184,8 +184,8 @@ define([
barRadius: [2, 2, 0, 0],
barSizeRatio: 0.5,
barGap: 3,
barColors: function (row, series, type) {
if (type === 'bar') {
barColors: function(row, series, type){
if(type === 'bar'){
// highlight last row -> recent kills found
if(this.xmax === row.x){
return '#c2760c';
@@ -252,13 +252,13 @@ define([
url: url,
type: 'GET',
dataType: 'json'
}).done(function(kbData) {
}).done(function(kbData){
// the API wont return more than 200KMs ! - remember last bar block with complete KM information
let lastCompleteDiffHourData = 0;
// loop kills and count kills by hour
for (let i = 0; i < kbData.length; i++) {
for(let i = 0; i < kbData.length; i++){
let killmailData = kbData[i];
let killDate = Util.convertDateToUTC(new Date(killmailData.killmail_time));
@@ -267,16 +267,16 @@ define([
let timeDiffHour = Math.floor(timeDiffMin / 60);
// update chart data
if (chartData[timeDiffHour]) {
if(chartData[timeDiffHour]){
chartData[timeDiffHour].kills++;
// add kill mail data
if (chartData[timeDiffHour].killmails === undefined) {
if(chartData[timeDiffHour].killmails === undefined){
chartData[timeDiffHour].killmails = [];
}
chartData[timeDiffHour].killmails.push(killmailData);
if (timeDiffHour > lastCompleteDiffHourData) {
if(timeDiffHour > lastCompleteDiffHourData){
lastCompleteDiffHourData = timeDiffHour;
}
}
@@ -284,7 +284,7 @@ define([
}
// remove empty chart Data
if (kbData.length >= maxKillmailCount) {
if(kbData.length >= maxKillmailCount){
chartData = chartData.splice(0, lastCompleteDiffHourData + 1);
}

View File

@@ -207,8 +207,8 @@ define([
};
let routeData = [];
dataTable.rows().every( function() {
routeData.push( getRouteRequestDataFromRowData( this.data() ));
dataTable.rows().every( function(){
routeData.push( getRouteRequestDataFromRowData(this.data()));
});
getRouteData({routeData: routeData}, context, callbackAddRouteRows);
@@ -279,7 +279,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-search"></i>&nbsp;search route',
className: 'btn-primary',
callback: function () {
callback: function(){
// add new route to route table
// get form Values
@@ -335,7 +335,7 @@ define([
}
});
findRouteDialog.on('show.bs.modal', function(e) {
findRouteDialog.on('show.bs.modal', function(e){
findRouteDialog.initTooltips();
// init some dialog/form observer
@@ -347,7 +347,7 @@ define([
});
findRouteDialog.on('shown.bs.modal', function(e) {
findRouteDialog.on('shown.bs.modal', function(e){
// init system select live search ------------------------------------------------
// -> add some delay until modal transition has finished
@@ -467,7 +467,7 @@ define([
success: {
label: '<i class="fas fa-fw fa-check"></i>&nbsp;save',
className: 'btn-success',
callback: function () {
callback: function(){
let form = this.find('form');
// get all system data from select2
let systemSelectData = form.find('.' + config.systemDialogSelectClass).select2('data');
@@ -489,7 +489,7 @@ define([
}
});
settingsDialog.on('shown.bs.modal', function(e) {
settingsDialog.on('shown.bs.modal', function(e){
// init default system select -----------------------------------------------------
// -> add some delay until modal transition has finished
@@ -582,7 +582,7 @@ define([
*/
let getConnectionsDataFromMaps = (mapIds) => {
let connectionsData = {};
for(let mapId of mapIds) {
for(let mapId of mapIds){
let map = MapUtil.getMapInstance(mapId);
if(map){
let cacheKey = 'map_' + mapId;
@@ -953,7 +953,7 @@ define([
_: 'name',
sort: 'name'
},
createdCell: function(cell, cellData, rowData, rowIndex, colIndex) {
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
// init context menu
$(cell).initSystemPopover({
systemToData: rowData.systemToData
@@ -1003,10 +1003,10 @@ define([
render: {
_: 'button'
},
createdCell: function(cell, cellData, rowData, rowIndex, colIndex) {
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
let tempTableApi = this.api();
$(cell).on('click', function(e) {
$(cell).on('click', function(e){
let routeCellElement = tempTableApi.cell( rowIndex, 4 ).nodes().to$();
if(routeCellElement.hasClass(config.dataTableJumpCellClass)){
@@ -1029,10 +1029,10 @@ define([
render: {
_: 'button'
},
createdCell: function(cell, cellData, rowData, rowIndex, colIndex) {
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
let tempTableApi = this.api();
$(cell).on('click', function(e) {
$(cell).on('click', function(e){
// get current row data (important!)
// -> "rowData" param is not current state, values are "on createCell()" state
rowData = tempTableApi.row( $(cell).parents('tr')).data();
@@ -1068,7 +1068,7 @@ define([
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
let tempTableApi = this.api();
$(cell).on('click', function(e) {
$(cell).on('click', function(e){
// get current row data (important!)
// -> "rowData" param is not current state, values are "on createCell()" state
rowData = tempTableApi.row( $(cell).parents('tr')).data();
@@ -1126,7 +1126,7 @@ define([
],
drawCallback: function(settings){
let animationRows = this.api().rows().nodes().to$().filter(function() {
let animationRows = this.api().rows().nodes().to$().filter(function(){
return (
$(this).data('animationStatus') ||
$(this).data('animationTimer')
@@ -1175,14 +1175,14 @@ define([
let eventNamespace = 'hideSystemPopup';
let systemToData = options.systemToData;
requirejs(['text!templates/tooltip/system_popover.html', 'mustache'], function (template, Mustache) {
requirejs(['text!templates/tooltip/system_popover.html', 'mustache'], function(template, Mustache){
let data = {
systemToData: systemToData
};
let content = Mustache.render(template, data);
elements.each(function() {
elements.each(function(){
let element = $(this);
// destroy "popover" and remove "click" event for animation
element.popover('destroy').off();
@@ -1210,7 +1210,7 @@ define([
});
// set link observer "on shown" event
elements.on('shown.bs.popover', function () {
elements.on('shown.bs.popover', function(){
let popoverRoot = $(this);
popoverRoot.data('bs.popover').tip().find('a').on('click', function(){
@@ -1334,7 +1334,7 @@ define([
// fill routesTable with data -------------------------------------------------------------
let promiseStore = MapUtil.getLocaleData('map', mapId);
promiseStore.then(function(dataStore) {
promiseStore.then(function(dataStore){
// selected systems (if already stored)
let systemsTo = [{
systemId: 30000142,

View File

@@ -293,7 +293,7 @@ define([
if(tempSelectOptions){
let fixSelectOptions = [];
for(let key in tempSelectOptions){
if (
if(
key > 0 &&
tempSelectOptions.hasOwnProperty(key)
){
@@ -319,7 +319,7 @@ define([
let frigateHoles = getFrigateHolesBySystem(areaId);
let frigateWHData = [];
for(let frigKey in frigateHoles){
if (
if(
frigKey > 0 &&
frigateHoles.hasOwnProperty(frigKey)
){
@@ -335,7 +335,7 @@ define([
// add possible incoming holes
let incomingWHData = [];
for(let incomingKey in Init.incomingWormholes){
if (
if(
incomingKey > 0 &&
Init.incomingWormholes.hasOwnProperty(incomingKey)
){
@@ -557,7 +557,7 @@ define([
}
if(percent < 30){
progressBarType = 'progress-bar-danger' ;
progressBarType = 'progress-bar-danger';
}else if(percent < 100){
progressBarType = 'progress-bar-warning';
}else{
@@ -600,7 +600,7 @@ define([
success: {
label: '<i class="fas fa-paste fa-fw"></i>&nbsp;update signatures',
className: 'btn-success',
callback: function (){
callback: function(){
let form = this.find('form');
let formData = form.getFormValues();
let signatureOptions = {
@@ -729,7 +729,7 @@ define([
unlockTable(this.tableApi);
// updates table with new/updated signature information
updateSignatureTable(this.tableApi, responseData.signatures, false);
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': Update signatures', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -825,7 +825,7 @@ define([
}
Util.showNotify(notificationOptions);
});
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
Util.showNotify({title: jqXHR.status + ': Delete signature', text: reason, type: 'warning'});
$(document).setProgramStatus('problem');
@@ -1078,7 +1078,7 @@ define([
*/
let editableDescriptionOnShown = cell => {
$(cell).on('shown', function(e, editable){
$(this).parents('.' + config.tableToolsActionClass).css( 'height', '+=35px' );
$(this).parents('.' + config.tableToolsActionClass).css('height', '+=35px');
});
};
@@ -1089,7 +1089,7 @@ define([
*/
let editableDescriptionOnHidden = cell => {
$(cell).on('hidden', function(e, editable){
$(this).parents('.' + config.tableToolsActionClass).css( 'height', '-=35px' );
$(this).parents('.' + config.tableToolsActionClass).css('height', '-=35px');
});
};
@@ -1531,7 +1531,7 @@ define([
let errorIcon = '<i class="fas fa-exclamation-triangle txt-color txt-color-danger hide"></i>&nbsp;';
$(this).html(FormElement.formatSignatureConnectionSelectionData({text: selected[0].text})).prepend(errorIcon);
}else{
$(this).empty() ;
$(this).empty();
}
},
validate: function(value, b, c){
@@ -1829,7 +1829,7 @@ define([
searching: false,
tabIndex: -1,
data: [$.extend(true, {}, emptySignatureData)],
initComplete: function (settings, json){
initComplete: function(settings, json){
let tableApi = this.api();
$(this).on('keyup', 'td', {tableApi: tableApi}, function(e){
@@ -1991,7 +1991,7 @@ define([
}
]
},
initComplete: function (settings, json){
initComplete: function(settings, json){
let tableApi = this.api();
initGroupFilterButton(tableApi);

View File

@@ -232,7 +232,7 @@ define([
}else{
callback(responseData.img);
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
showNotify({title: jqXHR.status + ': getCaptchaImage', text: reason, type: 'error'});
});
@@ -437,7 +437,7 @@ define([
(top + height) > window.pageYOffset &&
(left + width) > window.pageXOffset
){
visibleElement.push( this );
visibleElement.push(this);
}
});
@@ -587,7 +587,7 @@ define([
let elements = $(this);
let eventNamespace = 'hideCharacterPopup';
requirejs(['text!templates/tooltip/character_switch.html', 'mustache'], function (template, Mustache){
requirejs(['text!templates/tooltip/character_switch.html', 'mustache'], function(template, Mustache){
let data = {
popoverClass: config.popoverCharacterClass,
@@ -633,7 +633,7 @@ define([
if(popoverData === undefined){
button.on('shown.bs.popover', function (e){
button.on('shown.bs.popover', function(e){
let tmpPopupElement = $(this).data('bs.popover').tip();
tmpPopupElement.find('.btn').on('click', function(e){
// close popover
@@ -716,8 +716,8 @@ define([
*/
$.fn.initPopoverClose = function(eventNamespace){
return this.each(function(){
$('body').off('click.' + eventNamespace).on('click.' + eventNamespace + ' contextmenu', function (e){
$('.' + config.popoverTriggerClass).each(function (){
$('body').off('click.' + eventNamespace).on('click.' + eventNamespace + ' contextmenu', function(e){
$('.' + config.popoverTriggerClass).each(function(){
let popoverElement = $(this);
//the 'is' for buttons that trigger popups
//the 'has' for icons within a button that triggers a popup
@@ -892,7 +892,7 @@ define([
'mouseout', 'mouseleave', 'mouseup', 'mousedown', 'mousemove', 'mouseenter', 'mousewheel', 'mouseover'
];
const getDefaultPassiveOption = (passive, eventName) => {
if (passive !== undefined) return passive;
if(passive !== undefined) return passive;
return supportedPassiveTypes.indexOf(eventName) === -1 ? false : defaultOptions.passive;
};
@@ -906,15 +906,15 @@ define([
};
const prepareSafeListener = (listener, passive) => {
if (!passive) return listener;
return function (e){
if(!passive) return listener;
return function(e){
e.preventDefault = () => {};
return listener.call(this, e);
};
};
const overwriteAddEvent = (superMethod) => {
EventTarget.prototype.addEventListener = function (type, listener, options){ // jshint ignore:line
EventTarget.prototype.addEventListener = function(type, listener, options){ // jshint ignore:line
const usesListenerOptions = typeof options === 'object';
const useCapture = usesListenerOptions ? options.capture : options;
@@ -945,7 +945,7 @@ define([
};
let supportsPassive = eventListenerOptionsSupported ();
if (supportsPassive){
if(supportsPassive){
const addEvent = EventTarget.prototype.addEventListener; // jshint ignore:line
overwriteAddEvent(addEvent);
}
@@ -979,8 +979,8 @@ define([
*/
String.prototype.hashCode = function(){
let hash = 0, i, chr;
if (this.length === 0) return hash;
for (i = 0; i < this.length; i++){
if(this.length === 0) return hash;
for(i = 0; i < this.length; i++){
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
@@ -2402,7 +2402,7 @@ define([
responseData.systemData &&
responseData.systemData.length > 0
){
for (let j = 0; j < responseData.systemData.length; j++){
for(let j = 0; j < responseData.systemData.length; j++){
showNotify({title: this.description, text: 'System: ' + responseData.systemData[j].name, type: 'success'});
}
}
@@ -2416,7 +2416,7 @@ define([
}
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
showNotify({title: jqXHR.status + ': ' + this.description, text: reason, type: 'warning'});
});
@@ -2436,7 +2436,7 @@ define([
data: false
};
if (navigator.clipboard) {
if(navigator.clipboard){
// get current permission status
navigator.permissions.query({
name: 'clipboard-write'
@@ -2461,7 +2461,7 @@ define([
resolve(payload);
}
});
} else {
}else{
console.warn('Clipboard API not supported by your browser');
resolve(payload);
}
@@ -2482,7 +2482,7 @@ define([
data: false
};
if (navigator.clipboard) {
if(navigator.clipboard){
// get current permission status
navigator.permissions.query({
name: 'clipboard-read'
@@ -2507,7 +2507,7 @@ define([
resolve(payload);
}
});
} else {
}else{
console.warn('Clipboard API not supported by your browser');
resolve(payload);
}
@@ -2574,7 +2574,7 @@ define([
}else{
showNotify({title: 'Open window in client', text: 'Check your EVE client', type: 'success'});
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
showNotify({title: jqXHR.status + ': openWindow', text: reason, type: 'error'});
});
@@ -2707,11 +2707,11 @@ define([
element.off(eventName).on(eventName, function(e){
clicks++;
if (clicks === 1){
if(clicks === 1){
setTimeout(element => {
if(clicks === 1){
singleClickCallback.call(element, e);
} else {
}else{
doubleClickCallback.call(element, e);
}
clicks = 0;
@@ -2815,7 +2815,7 @@ define([
if(data.reroute){
redirect(data.reroute, ['logout']);
}
}).fail(function( jqXHR, status, error){
}).fail(function(jqXHR, status, error){
let reason = status + ' ' + error;
showNotify({title: jqXHR.status + ': logout', text: reason, type: 'error'});
});
@@ -2860,11 +2860,11 @@ define([
for(let i = 0; i <ca.length; i++){
let c = ca[i];
while (c.charAt(0) === ' '){
while(c.charAt(0) === ' '){
c = c.substring(1);
}
if (c.indexOf(name) === 0){
if(c.indexOf(name) === 0){
return c.substring(name.length,c.length);
}
}

View File

@@ -95,7 +95,7 @@ let broadcastPorts = (load) => {
sentToPorts = getPortsByCharacterIds(meta.characterIds);
}
for (let i = 0; i < sentToPorts.length; i++) {
for(let i = 0; i < sentToPorts.length; i++){
sentToPorts[i].postMessage(load);
}
};

View File

@@ -29,7 +29,7 @@ window.MsgWorker = class MessageWorker {
return this.cmd;
}
task(task) {
task(task){
if(task){
this.msgTask = task;
}
@@ -37,7 +37,7 @@ window.MsgWorker = class MessageWorker {
return this.msgTask;
}
meta(metaData) {
meta(metaData){
if(metaData){
this.msgMeta = metaData;
}
@@ -45,7 +45,7 @@ window.MsgWorker = class MessageWorker {
return this.msgMeta;
}
data(data) {
data(data){
if(data){
this.msgBody = data;
}