- _Rally point_ destinations added to "_Route search_" module, closed #664
- fixed a bug where "click" at system does not load system information modules
This commit is contained in:
@@ -3,11 +3,20 @@
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery'
|
||||
], function($) {
|
||||
'jquery',
|
||||
'app/render'-
|
||||
], ($, Render) => {
|
||||
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper', // wrapper div for context menus (initial hidden)
|
||||
|
||||
mapContextMenuId: 'pf-map-contextmenu', // id for "maps" context menu
|
||||
connectionContextMenuId: 'pf-map-connection-contextmenu', // id for "connections" context menu
|
||||
systemContextMenuId: 'pf-map-system-contextmenu' // id for "systems" context menu
|
||||
};
|
||||
|
||||
$.fn.contextMenu = function (settings) {
|
||||
|
||||
// animation
|
||||
@@ -19,7 +28,7 @@ define([
|
||||
return this.each(function () {
|
||||
|
||||
// Open context menu
|
||||
$(this).off('pf:openContextMenu').on('pf:openContextMenu', function (e, originalEvent, component, hiddenOptions, activeOptions) {
|
||||
$(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();
|
||||
@@ -28,20 +37,22 @@ define([
|
||||
|
||||
let menuLiElements = contextMenu.find('li');
|
||||
|
||||
// show all menu entries
|
||||
menuLiElements.show();
|
||||
// reset all menu entries
|
||||
menuLiElements.removeClass('active').removeClass('disabled').show();
|
||||
|
||||
// disable specific menu entries
|
||||
for(let i = 0; i < hiddenOptions.length; i++){
|
||||
contextMenu.find('li[data-action="' + hiddenOptions[i] + '"]').hide();
|
||||
// hide specific menu entries
|
||||
for(let action of hiddenOptions){
|
||||
contextMenu.find('li[data-action="' + action + '"]').hide();
|
||||
}
|
||||
|
||||
// deactivate all menu entries
|
||||
menuLiElements.removeClass('active');
|
||||
|
||||
//set active specific menu entries
|
||||
for(let j = 0; j < activeOptions.length; j++){
|
||||
contextMenu.find('li[data-action="' + activeOptions[j] + '"]').addClass('active');
|
||||
for(let action of activeOptions){
|
||||
contextMenu.find('li[data-action="' + action + '"]').addClass('active');
|
||||
}
|
||||
|
||||
//disable specific menu entries
|
||||
for(let action of disabledOptions){
|
||||
contextMenu.find('li[data-action="' + action + '"]').addClass('disabled');
|
||||
}
|
||||
|
||||
//open menu
|
||||
@@ -129,4 +140,122 @@ define([
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* load context menu template for maps
|
||||
*/
|
||||
let initMapContextMenu = () => {
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.mapContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plus', action: 'add_system', text: 'add system'},
|
||||
{icon: 'fa-object-ungroup', action: 'select_all', text: 'select all'},
|
||||
{icon: 'fa-filter', action: 'filter_scope', text: 'filter scope', subitems: [
|
||||
{subIcon: '', subAction: 'filter_wh', subText: 'wormhole'},
|
||||
{subIcon: '', subAction: 'filter_stargate', subText: 'stargate'},
|
||||
{subIcon: '', subAction: 'filter_jumpbridge', subText: 'jumpbridge'},
|
||||
{subIcon: '', subAction: 'filter_abyssal', subText: 'abyssal'}
|
||||
]},
|
||||
{icon: 'fa-sitemap', action: 'map', text: 'map', subitems: [
|
||||
{subIcon: 'fa-edit', subAction: 'map_edit', subText: 'edit map'},
|
||||
{subIcon: 'fa-street-view', subAction: 'map_info', subText: 'map info'},
|
||||
]},
|
||||
{divider: true, action: 'delete_systems'},
|
||||
{icon: 'fa-trash', action: 'delete_systems', text: 'delete systems'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
};
|
||||
|
||||
/**
|
||||
* load context menu template for connections
|
||||
*/
|
||||
let initConnectionContextMenu = () => {
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.connectionContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plane', action: 'frigate', text: 'frigate hole'},
|
||||
{icon: 'fa-exclamation-triangle', action: 'preserve_mass', text: 'preserve mass'},
|
||||
{icon: 'fa-crosshairs', action: 'change_scope', text: 'change scope', subitems: [
|
||||
{subIcon: 'fa-minus-circle', subIconClass: '', subAction: 'scope_wh', subText: 'wormhole'},
|
||||
{subIcon: 'fa-minus-circle', subIconClass: 'txt-color txt-color-indigoDarkest', subAction: 'scope_stargate', subText: 'stargate'},
|
||||
{subIcon: 'fa-minus-circle', subIconClass: 'txt-color txt-color-tealLighter', subAction: 'scope_jumpbridge', subText: 'jumpbridge'}
|
||||
|
||||
]},
|
||||
{icon: 'fa-reply fa-rotate-180', action: 'change_status', text: 'change status', subitems: [
|
||||
{subIcon: 'fa-clock', subAction: 'wh_eol', subText: 'toggle EOL'},
|
||||
{subDivider: true},
|
||||
{subIcon: 'fa-circle', subAction: 'status_fresh', subText: 'stage 1 (fresh)'},
|
||||
{subIcon: 'fa-adjust', subAction: 'status_reduced', subText: 'stage 2 (reduced)'},
|
||||
{subIcon: 'fa-circle', subAction: 'status_critical', subText: 'stage 3 (critical)'}
|
||||
|
||||
]},
|
||||
{divider: true, action: 'separator'} ,
|
||||
{icon: 'fa-unlink', action: 'delete_connection', text: 'detach'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
};
|
||||
|
||||
/**
|
||||
* load context menu template for systems
|
||||
* @param systemStatusData
|
||||
*/
|
||||
let initSystemContextMenu = (systemStatusData) => {
|
||||
|
||||
let statusData = [];
|
||||
for (let [statusName, data] of Object.entries(systemStatusData)){
|
||||
statusData.push({
|
||||
subIcon: 'fa-tag',
|
||||
subIconClass: data.class,
|
||||
subAction: 'change_status_' + statusName,
|
||||
subText: data.label
|
||||
});
|
||||
}
|
||||
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.systemContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plus', action: 'add_system', text: 'add system'},
|
||||
{icon: 'fa-lock', action: 'lock_system', text: 'lock system'},
|
||||
{icon: 'fa-volume-up', action: 'set_rally', text: 'set rally point'},
|
||||
{icon: 'fa-tags', text: 'set status', subitems: statusData},
|
||||
{icon: 'fa-route', action: 'find_route', text: 'find route'},
|
||||
{icon: 'fa-object-group', action: 'select_connections', text: 'select connections'},
|
||||
{icon: 'fa-reply fa-rotate-180', text: 'waypoints', subitems: [
|
||||
{subIcon: 'fa-flag-checkered', subAction: 'set_destination', subText: 'set destination'},
|
||||
{subDivider: true, action: ''},
|
||||
{subIcon: 'fa-step-backward', subAction: 'add_first_waypoint', subText: 'add new [start]'},
|
||||
{subIcon: 'fa-step-forward', subAction: 'add_last_waypoint', subText: 'add new [end]'}
|
||||
]},
|
||||
{divider: true, action: 'delete_system'},
|
||||
{icon: 'fa-trash', action: 'delete_system', text: 'delete system(s)'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
};
|
||||
|
||||
return {
|
||||
initMapContextMenu: initMapContextMenu,
|
||||
initConnectionContextMenu: initConnectionContextMenu,
|
||||
initSystemContextMenu: initSystemContextMenu
|
||||
};
|
||||
});
|
||||
@@ -14,7 +14,6 @@ define([
|
||||
'app/map/magnetizing',
|
||||
'app/map/scrollbar',
|
||||
'dragToSelect',
|
||||
'app/map/contextmenu',
|
||||
'app/map/overlay',
|
||||
'app/map/local'
|
||||
], ($, Init, Util, Render, bootbox, MapUtil, System, Layout, MagnetizerWrapper) => {
|
||||
@@ -534,8 +533,12 @@ define([
|
||||
e.stopPropagation();
|
||||
|
||||
// trigger menu "open
|
||||
Promise.all([getHiddenContextMenuOptions(component), getActiveContextMenuOptions(component)]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, component, payload[0], payload[1]]);
|
||||
Promise.all([
|
||||
getHiddenContextMenuOptions(component),
|
||||
getActiveContextMenuOptions(component),
|
||||
getDisabledContextMenuOptions(component)
|
||||
]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, component, payload[0], payload[1], payload[2]]);
|
||||
});
|
||||
|
||||
return false;
|
||||
@@ -1764,125 +1767,12 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* load context menu template for map
|
||||
*/
|
||||
let initMapContextMenu = function(){
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.mapContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plus', action: 'add_system', text: 'add system'},
|
||||
{icon: 'fa-object-ungroup', action: 'select_all', text: 'select all'},
|
||||
{icon: 'fa-filter', action: 'filter_scope', text: 'filter scope', subitems: [
|
||||
{subIcon: '', subAction: 'filter_wh', subText: 'wormhole'},
|
||||
{subIcon: '', subAction: 'filter_stargate', subText: 'stargate'},
|
||||
{subIcon: '', subAction: 'filter_jumpbridge', subText: 'jumpbridge'},
|
||||
{subIcon: '', subAction: 'filter_abyssal', subText: 'abyssal'}
|
||||
]},
|
||||
{icon: 'fa-sitemap', action: 'map', text: 'map', subitems: [
|
||||
{subIcon: 'fa-edit', subAction: 'map_edit', subText: 'edit map'},
|
||||
{subIcon: 'fa-street-view', subAction: 'map_info', subText: 'map info'},
|
||||
]},
|
||||
{divider: true, action: 'delete_systems'},
|
||||
{icon: 'fa-trash', action: 'delete_systems', text: 'delete systems'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
};
|
||||
|
||||
/**
|
||||
* load contextmenu template for connections
|
||||
*/
|
||||
let initConnectionContextMenu = function(){
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.connectionContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plane', action: 'frigate', text: 'frigate hole'},
|
||||
{icon: 'fa-exclamation-triangle', action: 'preserve_mass', text: 'preserve mass'},
|
||||
{icon: 'fa-crosshairs', action: 'change_scope', text: 'change scope', subitems: [
|
||||
{subIcon: 'fa-minus-circle', subIconClass: '', subAction: 'scope_wh', subText: 'wormhole'},
|
||||
{subIcon: 'fa-minus-circle', subIconClass: 'txt-color txt-color-indigoDarkest', subAction: 'scope_stargate', subText: 'stargate'},
|
||||
{subIcon: 'fa-minus-circle', subIconClass: 'txt-color txt-color-tealLighter', subAction: 'scope_jumpbridge', subText: 'jumpbridge'}
|
||||
|
||||
]},
|
||||
{icon: 'fa-reply fa-rotate-180', action: 'change_status', text: 'change status', subitems: [
|
||||
{subIcon: 'fa-clock', subAction: 'wh_eol', subText: 'toggle EOL'},
|
||||
{subDivider: true},
|
||||
{subIcon: 'fa-circle', subAction: 'status_fresh', subText: 'stage 1 (fresh)'},
|
||||
{subIcon: 'fa-adjust', subAction: 'status_reduced', subText: 'stage 2 (reduced)'},
|
||||
{subIcon: 'fa-circle', subAction: 'status_critical', subText: 'stage 3 (critical)'}
|
||||
|
||||
]},
|
||||
{divider: true, action: 'separator'} ,
|
||||
{icon: 'fa-unlink', action: 'delete_connection', text: 'detach'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* load contextmenu template for systems
|
||||
*/
|
||||
let initSystemContextMenu = function(){
|
||||
let systemStatus = [];
|
||||
|
||||
$.each(Init.systemStatus, function(status, statusData){
|
||||
let tempStatus = {
|
||||
subIcon: 'fa-tag',
|
||||
subIconClass: statusData.class,
|
||||
subAction: 'change_status_' + status,
|
||||
subText: statusData.label
|
||||
};
|
||||
systemStatus.push(tempStatus);
|
||||
});
|
||||
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.systemContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plus', action: 'add_system', text: 'add system'},
|
||||
{icon: 'fa-lock', action: 'lock_system', text: 'lock system'},
|
||||
{icon: 'fa-volume-up', action: 'set_rally', text: 'set rally point'},
|
||||
{icon: 'fa-object-group', action: 'select_connections', text: 'select connections'},
|
||||
{icon: 'fa-tags', text: 'set status', subitems: systemStatus},
|
||||
{icon: 'fa-reply fa-rotate-180', text: 'waypoints', subitems: [
|
||||
{subIcon: 'fa-flag-checkered', subAction: 'set_destination', subText: 'set destination'},
|
||||
{subDivider: true, action: ''},
|
||||
{subIcon: 'fa-step-backward', subAction: 'add_first_waypoint', subText: 'add new [start]'},
|
||||
{subIcon: 'fa-step-forward', subAction: 'add_last_waypoint', subText: 'add new [end]'}
|
||||
]},
|
||||
{divider: true, action: 'delete_system'},
|
||||
{icon: 'fa-trash', action: 'delete_system', text: 'delete system(s)'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* get hidden menu entry options for a context menu
|
||||
* @param component
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
let getHiddenContextMenuOptions = function(component){
|
||||
let getHiddenContextMenuOptions = component => {
|
||||
|
||||
let getHiddenContextMenuOptionsExecutor = (resolve, reject) => {
|
||||
let hiddenOptions = [];
|
||||
@@ -1916,6 +1806,11 @@ define([
|
||||
if(component.data('locked') === true){
|
||||
hiddenOptions.push('delete_system');
|
||||
}
|
||||
|
||||
let mapElement = component.parents('.' + config.mapClass);
|
||||
if( !mapElement.find('.' + config.systemActiveClass).length ){
|
||||
hiddenOptions.push('find_route');
|
||||
}
|
||||
}
|
||||
|
||||
resolve(hiddenOptions);
|
||||
@@ -1982,6 +1877,29 @@ define([
|
||||
return new Promise(getActiveContextMenuOptionsExecutor);
|
||||
};
|
||||
|
||||
/**
|
||||
* get disabled menu entry options for a context menu
|
||||
* @param component
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
let getDisabledContextMenuOptions = component => {
|
||||
|
||||
let getDisabledContextMenuOptionsExecutor = (resolve, reject) => {
|
||||
let disabledOptions = [];
|
||||
|
||||
if( component.hasClass(config.systemClass) ){
|
||||
// disable system menu entries
|
||||
if( component.hasClass(config.systemActiveClass) ){
|
||||
disabledOptions.push('find_route');
|
||||
}
|
||||
}
|
||||
|
||||
resolve(disabledOptions);
|
||||
};
|
||||
|
||||
return new Promise(getDisabledContextMenuOptionsExecutor);
|
||||
};
|
||||
|
||||
/**
|
||||
* set up all actions that can be preformed on a system
|
||||
* @param map
|
||||
@@ -2109,8 +2027,12 @@ define([
|
||||
let systemElement = $(this);
|
||||
|
||||
// trigger menu "open
|
||||
Promise.all([getHiddenContextMenuOptions(systemElement), getActiveContextMenuOptions(systemElement)]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, this, payload[0], payload[1]]);
|
||||
Promise.all([
|
||||
getHiddenContextMenuOptions(systemElement),
|
||||
getActiveContextMenuOptions(systemElement),
|
||||
getDisabledContextMenuOptions(systemElement)
|
||||
]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, this, payload[0], payload[1], payload[2]]);
|
||||
});
|
||||
|
||||
return false;
|
||||
@@ -2157,6 +2079,14 @@ define([
|
||||
currentSystem.markAsChanged();
|
||||
}
|
||||
break;
|
||||
case 'find_route':
|
||||
// show find route dialog
|
||||
systemData = system.getSystemData();
|
||||
MapUtil.showFindRouteDialog(mapContainer, {
|
||||
systemId: systemData.systemId,
|
||||
name: systemData.name
|
||||
});
|
||||
break;
|
||||
case 'select_connections':
|
||||
let connections = MapUtil.searchConnectionsBySystems(map, [currentSystem], '*');
|
||||
MapUtil.showConnectionInfo(map, connections);
|
||||
@@ -2221,13 +2151,11 @@ define([
|
||||
if( !system.hasClass('no-click') ){
|
||||
// left mouse button
|
||||
if(e.which === 1){
|
||||
if(! system.hasClass('no-click')){
|
||||
if(e.ctrlKey === true){
|
||||
// select system
|
||||
MapUtil.toggleSystemsSelect(map, [system]);
|
||||
}else{
|
||||
MapUtil.showSystemInfo(map, system);
|
||||
}
|
||||
if(e.ctrlKey === true){
|
||||
// select system
|
||||
MapUtil.toggleSystemsSelect(map, [system]);
|
||||
}else{
|
||||
MapUtil.showSystemInfo(map, system);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2402,17 +2330,6 @@ define([
|
||||
let sourceId = info.sourceId;
|
||||
let targetId = info.targetId;
|
||||
|
||||
// lock the target system for "click" events
|
||||
// to prevent loading system information
|
||||
let sourceSystem = $('#' + sourceId);
|
||||
let targetSystem = $('#' + targetId);
|
||||
sourceSystem.addClass('no-click');
|
||||
targetSystem.addClass('no-click');
|
||||
setTimeout(function(){
|
||||
sourceSystem.removeClass('no-click');
|
||||
targetSystem.removeClass('no-click');
|
||||
}, Init.timer.DBL_CLICK + 50);
|
||||
|
||||
// loop connection not allowed
|
||||
if(sourceId === targetId){
|
||||
console.warn('Source/Target systems are identical');
|
||||
@@ -2425,6 +2342,18 @@ define([
|
||||
return false;
|
||||
}
|
||||
|
||||
// lock the target system for "click" events
|
||||
// to prevent loading system information
|
||||
let sourceSystem = $('#' + sourceId);
|
||||
let targetSystem = $('#' + targetId);
|
||||
sourceSystem.addClass('no-click');
|
||||
targetSystem.addClass('no-click');
|
||||
|
||||
setTimeout(() => {
|
||||
sourceSystem.removeClass('no-click');
|
||||
targetSystem.removeClass('no-click');
|
||||
}, Init.timer.DBL_CLICK + 50);
|
||||
|
||||
// switch connection type to "abyss" in case source OR target system belongs to "a-space"
|
||||
if(sourceSystem.data('typeId') === 3 || targetSystem.data('typeId') === 3){
|
||||
setConnectionScope(connection, 'abyssal');
|
||||
@@ -2500,8 +2429,12 @@ define([
|
||||
let mapElement = $(this);
|
||||
|
||||
// trigger menu "open
|
||||
Promise.all([getHiddenContextMenuOptions(mapElement), getActiveContextMenuOptions(mapElement)]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, mapElement, payload[0], payload[1]]);
|
||||
Promise.all([
|
||||
getHiddenContextMenuOptions(mapElement),
|
||||
getActiveContextMenuOptions(mapElement),
|
||||
getDisabledContextMenuOptions(mapElement)
|
||||
]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, mapElement, payload[0], payload[1], payload[2]]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3280,11 +3213,6 @@ define([
|
||||
* @param reject
|
||||
*/
|
||||
let loadMapExecutor = (resolve, reject) => {
|
||||
// add context menus to dom (if not already
|
||||
initMapContextMenu();
|
||||
initConnectionContextMenu();
|
||||
initSystemContextMenu();
|
||||
|
||||
// init jsPlumb
|
||||
jsPlumb.ready(function(){
|
||||
// get new map instance or load existing
|
||||
|
||||
@@ -668,9 +668,8 @@ define([
|
||||
|
||||
// get parent Tab Content and fire update event
|
||||
let mapContainer = $(map.getContainer());
|
||||
let tabContentElement = getTabContentElementByMapElement(mapContainer);
|
||||
|
||||
$(tabContentElement).trigger('pf:drawConnectionModules', {
|
||||
getTabContentElementByMapElement(mapContainer).trigger('pf:drawConnectionModules', {
|
||||
connections: connections,
|
||||
mapId: parseInt(mapContainer.data('id'))
|
||||
});
|
||||
@@ -693,6 +692,33 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* show "find route" dialog -> trigger route panel
|
||||
* @param mapContainer
|
||||
* @param systemToData
|
||||
*/
|
||||
let showFindRouteDialog = (mapContainer, systemToData) => {
|
||||
// get parent Tab Content and fire update event
|
||||
getTabContentElementByMapElement(mapContainer).trigger('pf:updateRouteModules', {
|
||||
task: 'showFindRouteDialog',
|
||||
systemToData: systemToData,
|
||||
mapId: parseInt(mapContainer.data('id'))
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* performs a new route search -> trigger route panel
|
||||
* @param mapContainer
|
||||
* @param systemToData
|
||||
*/
|
||||
let findRoute = (mapContainer, systemToData) => {
|
||||
getTabContentElementByMapElement(mapContainer).trigger('pf:updateRouteModules', {
|
||||
task: 'findRoute',
|
||||
systemToData: systemToData,
|
||||
mapId: parseInt(mapContainer.data('id'))
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* search connections by systems
|
||||
* @param map
|
||||
@@ -1199,8 +1225,8 @@ define([
|
||||
|
||||
if(rallyUpdated > 0){
|
||||
// new rally point set OR update system with rally information
|
||||
system.addClass(rallyClass);
|
||||
|
||||
system.addClass( rallyClass );
|
||||
// rallyUpdated > 0 is required for poke!
|
||||
rallyPoke = options.poke;
|
||||
|
||||
@@ -1249,9 +1275,17 @@ define([
|
||||
rallyUpdated: rallyUpdated
|
||||
}));
|
||||
}
|
||||
|
||||
// update active "route" module -> add rally point row --------------------------------------------
|
||||
let mapContainer = system.parents('.' + config.mapClass);
|
||||
findRoute(mapContainer, {
|
||||
systemId: system.data('systemId'),
|
||||
name: system.data('name'),
|
||||
rally: 1
|
||||
});
|
||||
}else{
|
||||
// rally point removed
|
||||
system.removeClass( rallyClass );
|
||||
system.removeClass(rallyClass);
|
||||
|
||||
if( !options.hideNotification ){
|
||||
Util.showNotify({title: 'Rally point removed', type: 'success'});
|
||||
@@ -1601,6 +1635,7 @@ define([
|
||||
setSystemActive: setSystemActive,
|
||||
showSystemInfo: showSystemInfo,
|
||||
showConnectionInfo: showConnectionInfo,
|
||||
showFindRouteDialog: showFindRouteDialog,
|
||||
getConnectionsByType: getConnectionsByType,
|
||||
getDataByConnection: getDataByConnection,
|
||||
searchConnectionsBySystems: searchConnectionsBySystems,
|
||||
|
||||
@@ -194,9 +194,12 @@ define([
|
||||
let initMapModule = (payload) => {
|
||||
|
||||
let initMapModuleExecutor = (resolve, reject) => {
|
||||
// init tab change observer, Once the timers are available
|
||||
// init browser tab change observer, Once the timers are available
|
||||
Page.initTabChangeObserver();
|
||||
|
||||
// init hidden context menu elements
|
||||
Page.initMapContextMenus();
|
||||
|
||||
// init map module
|
||||
mapModule.initMapModule() ;
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ define([
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper', // parent Element for dynamic content (dialogs,..)
|
||||
mapTabElementId: 'pf-map-tab-element', // id for map tab element (tabs + content)
|
||||
mapTabBarId: 'pf-map-tabs', // id for map tab bar
|
||||
mapTabIdPrefix: 'pf-map-tab-', // id prefix for a map tab
|
||||
@@ -105,6 +104,10 @@ define([
|
||||
tabElement.on('pf:updateSystemModules', '.' + config.mapTabContentClass, function(e, data){
|
||||
updateSystemModules($(e.target), data);
|
||||
});
|
||||
|
||||
tabElement.on('pf:updateRouteModules', '.' + config.mapTabContentClass, function(e, data){
|
||||
updateRouteModules($(e.target), data);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -132,6 +135,16 @@ define([
|
||||
updateModules(tabContentElement, systemModules, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* update route modules with new data
|
||||
* @param tabContentElement
|
||||
* @param data
|
||||
*/
|
||||
let updateRouteModules = (tabContentElement, data) => {
|
||||
let routeModules = [SystemRouteModule];
|
||||
updateModules(tabContentElement, routeModules, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* remove multiple modules
|
||||
* @param tabContentElement
|
||||
|
||||
@@ -9,6 +9,7 @@ define([
|
||||
'app/logging',
|
||||
'mustache',
|
||||
'app/map/util',
|
||||
'app/map/contextmenu',
|
||||
'text!img/logo.svg!strip',
|
||||
'text!templates/modules/header.html',
|
||||
'text!templates/modules/footer.html',
|
||||
@@ -26,7 +27,7 @@ define([
|
||||
'xEditable',
|
||||
'slidebars',
|
||||
'app/module_map'
|
||||
], ($, Init, Util, Logging, Mustache, MapUtil, TplLogo, TplHead, TplFooter) => {
|
||||
], ($, Init, Util, Logging, Mustache, MapUtil, MapContextMenu, TplLogo, TplHead, TplFooter) => {
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -66,7 +67,7 @@ define([
|
||||
menuClockClass: 'pf-menu-clock', // class for EVE-Time clock
|
||||
|
||||
// helper element
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper',
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper', // class for container element that holds hidden "context menus"
|
||||
|
||||
// system signature module
|
||||
systemSignatureModuleClass: 'pf-signature-table-module', // module wrapper (signatures)
|
||||
@@ -105,8 +106,7 @@ define([
|
||||
id: config.pageId,
|
||||
class: config.pageClass
|
||||
}).append(
|
||||
Util.getMapModule()
|
||||
).append(
|
||||
Util.getMapModule(),
|
||||
$('<div>', {
|
||||
id: config.dynamicElementWrapperId
|
||||
})
|
||||
@@ -1087,7 +1087,7 @@ define([
|
||||
/**
|
||||
* shows a test notification for desktop messages
|
||||
*/
|
||||
let notificationTest = function(){
|
||||
let notificationTest = () => {
|
||||
Util.showNotify({
|
||||
title: 'Test Notification',
|
||||
text: 'Accept browser security question'},
|
||||
@@ -1102,7 +1102,7 @@ define([
|
||||
* set event listener if the program tab is active or not
|
||||
* this is used to lower the update ping cycle to reduce server load
|
||||
*/
|
||||
let initTabChangeObserver = function(){
|
||||
let initTabChangeObserver = () => {
|
||||
|
||||
// increase the timer if a user is inactive
|
||||
let increaseTimer = 5000;
|
||||
@@ -1128,7 +1128,7 @@ define([
|
||||
}
|
||||
|
||||
// function is called if the tab becomes active/inactive
|
||||
function handleVisibilityChange() {
|
||||
let handleVisibilityChange = () => {
|
||||
if (document[hidden]) {
|
||||
// tab is invisible
|
||||
// globally store current visibility status
|
||||
@@ -1147,7 +1147,7 @@ define([
|
||||
// stop blinking tab from previous notifications
|
||||
Util.stopTabBlink();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (
|
||||
typeof document.addEventListener !== 'undefined' &&
|
||||
@@ -1164,6 +1164,17 @@ define([
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* add "hidden" context menu elements to page
|
||||
*/
|
||||
let initMapContextMenus = () => {
|
||||
$('#' + config.dynamicElementWrapperId).append(
|
||||
MapContextMenu.initMapContextMenu(),
|
||||
MapContextMenu.initConnectionContextMenu(),
|
||||
MapContextMenu.initSystemContextMenu(Init.systemStatus)
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* trigger "program status" in head
|
||||
* @param status
|
||||
@@ -1308,7 +1319,8 @@ define([
|
||||
};
|
||||
|
||||
return {
|
||||
initTabChangeObserver: initTabChangeObserver
|
||||
initTabChangeObserver: initTabChangeObserver,
|
||||
initMapContextMenus: initMapContextMenus
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,9 @@ define([
|
||||
|
||||
dataTableActionCellClass: 'pf-table-action-cell', // class for "action" cells
|
||||
dataTableRouteCellClass: 'pf-table-route-cell', // class for "route" cells
|
||||
dataTableJumpCellClass: 'pf-table-jump-cell' // class for "route jump" cells
|
||||
dataTableJumpCellClass: 'pf-table-jump-cell', // class for "route jump" cells
|
||||
|
||||
rallyClass: 'pf-rally' // class for "rally point" style
|
||||
};
|
||||
|
||||
// cache for system routes
|
||||
@@ -109,11 +111,8 @@ define([
|
||||
* @param routesData
|
||||
*/
|
||||
let callbackAddRouteRows = (context, routesData) => {
|
||||
|
||||
if(routesData.length > 0){
|
||||
for(let i = 0; i < routesData.length; i++){
|
||||
let routeData = routesData[i];
|
||||
|
||||
for(let routeData of routesData){
|
||||
// format routeData
|
||||
let rowData = formatRouteData(routeData);
|
||||
if(rowData.route){
|
||||
@@ -145,7 +144,7 @@ define([
|
||||
// search for an existing row (e.g. on mass "table refresh" [all routes])
|
||||
// get rowIndex where column 1 (equals to "systemToData.name") matches rowData.systemToData.name
|
||||
let indexes = dataTable.rows().eq(0).filter((rowIdx) => {
|
||||
return (dataTable.cell(rowIdx, 1 ).data().name === rowData.systemToData.name);
|
||||
return (dataTable.cell(rowIdx, 1).data().name === rowData.systemToData.name);
|
||||
});
|
||||
|
||||
if(indexes.length > 0){
|
||||
@@ -163,9 +162,7 @@ define([
|
||||
|
||||
if(row.length > 0){
|
||||
rowElement = row.nodes().to$();
|
||||
if(animationStatus !== null){
|
||||
rowElement.data('animationStatus', animationStatus);
|
||||
}
|
||||
rowElement.data('animationStatus', animationStatus);
|
||||
|
||||
rowElement.initTooltips({
|
||||
container: 'body'
|
||||
@@ -262,6 +259,7 @@ define([
|
||||
selectClass: config.systemDialogSelectClass,
|
||||
mapSelectId: config.mapSelectId,
|
||||
systemFromData: dialogData.systemFromData,
|
||||
systemToData: dialogData.systemToData,
|
||||
mapSelectOptions: mapSelectOptions
|
||||
};
|
||||
|
||||
@@ -368,9 +366,9 @@ define([
|
||||
* @param moduleElement
|
||||
* @param systemFromData
|
||||
* @param routesTable
|
||||
* @param systemsTo
|
||||
* @param systemsToData
|
||||
*/
|
||||
let drawRouteTable = (mapId, moduleElement, systemFromData, routesTable, systemsTo) => {
|
||||
let drawRouteTable = (mapId, moduleElement, systemFromData, routesTable, systemsToData) => {
|
||||
let requestRouteData = [];
|
||||
|
||||
// Skip some routes from search
|
||||
@@ -378,9 +376,7 @@ define([
|
||||
let defaultRoutesCount = Init.routeSearch.defaultCount;
|
||||
let rowElements = [];
|
||||
|
||||
for(let i = 0; i < systemsTo.length; i++){
|
||||
let systemToData = systemsTo[i];
|
||||
|
||||
for(let systemToData of systemsToData){
|
||||
if(systemFromData.name !== systemToData.name){
|
||||
// check for cached rowData
|
||||
let cacheKey = getRouteDataCacheKey([mapId], systemFromData.name, systemToData.name);
|
||||
@@ -738,7 +734,7 @@ define([
|
||||
let connectionButton = '<i class="fas ' + ['fa-link', 'txt-color'].join(' ') + '"></i>';
|
||||
let flagButton = '<i class="fas ' + ['fa-shield-alt', 'txt-color', flagButtonClass].join(' ') + '"></i>';
|
||||
let reloadButton = '<i class="fas ' + ['fa-sync'].join(' ') + '"></i>';
|
||||
let searchButton = '<i class="fas ' + ['fa-search-plus '].join(' ') + '"></i>';
|
||||
let searchButton = '<i class="fas ' + ['fa-search'].join(' ') + '"></i>';
|
||||
let deleteButton = '<i class="fas ' + ['fa-times', 'txt-color', 'txt-color-redDarker'].join(' ') + '"></i>';
|
||||
|
||||
// default row data (e.g. no route found)
|
||||
@@ -873,9 +869,13 @@ define([
|
||||
|
||||
/**
|
||||
* get module element
|
||||
* @returns {*}
|
||||
* @param parentElement
|
||||
* @param mapId
|
||||
* @param systemData
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
let getModule = () => {
|
||||
let getModule = (parentElement, mapId, systemData) => {
|
||||
|
||||
// create new module container
|
||||
let moduleElement = $('<div>').append(
|
||||
$('<div>', {
|
||||
@@ -906,6 +906,15 @@ define([
|
||||
)
|
||||
);
|
||||
|
||||
// save systemFromData to module (data never changes during module lifetime)
|
||||
// -> we need this later in updateModule()
|
||||
let systemFromData = {
|
||||
systemId: systemData.systemId,
|
||||
name: systemData.name,
|
||||
};
|
||||
|
||||
moduleElement.data('systemFromData', systemFromData);
|
||||
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.systemInfoRoutesTableClass].join(' ')
|
||||
});
|
||||
@@ -951,12 +960,14 @@ define([
|
||||
$(cell).initSystemPopover({
|
||||
systemToData: rowData.systemToData
|
||||
});
|
||||
|
||||
$(cell).toggleClass(config.rallyClass, cellData.hasOwnProperty('rally'));
|
||||
}
|
||||
},{
|
||||
targets: 2,
|
||||
orderable: true,
|
||||
title: '<span title="jumps" data-toggle="tooltip"><i class="fas fa-arrows-alt-h"></i> </span>',
|
||||
width: 18,
|
||||
width: 16,
|
||||
class: 'text-right',
|
||||
data: 'jumps',
|
||||
render: {
|
||||
@@ -967,7 +978,7 @@ define([
|
||||
targets: 3,
|
||||
orderable: true,
|
||||
title: '<span title="average security" data-toggle="tooltip">Ø </span>',
|
||||
width: 15,
|
||||
width: 14,
|
||||
class: 'text-right',
|
||||
data: 'avgTrueSec',
|
||||
render: {
|
||||
@@ -1207,8 +1218,8 @@ define([
|
||||
popoverRoot.data('bs.popover').tip().find('a').on('click', function(){
|
||||
// hint: "data" attributes should be in lower case!
|
||||
let systemData = {
|
||||
name: $(this).data('name'),
|
||||
systemId: $(this).data('systemid')
|
||||
systemId: $(this).data('systemid'),
|
||||
name: $(this).data('name')
|
||||
};
|
||||
Util.setDestination(systemData, 'set_destination');
|
||||
|
||||
@@ -1219,6 +1230,58 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* get data from all Rally Point systems
|
||||
* @param mapId
|
||||
* @returns {Array}
|
||||
*/
|
||||
let getRallySystemsData = (mapId) => {
|
||||
let systemsRallyData = [];
|
||||
let map = MapUtil.getMapInstance(mapId);
|
||||
if(map){
|
||||
let mapContainer = $(map.getContainer());
|
||||
let systems = mapContainer.find('.pf-system-info-rally');
|
||||
|
||||
for(let system of systems){
|
||||
system = $(system);
|
||||
systemsRallyData.push({
|
||||
systemId: system.data('systemId'),
|
||||
name: system.data('name'),
|
||||
rally: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return systemsRallyData;
|
||||
};
|
||||
|
||||
/**
|
||||
* update trigger function for this module
|
||||
* @param moduleElement
|
||||
* @param data
|
||||
*/
|
||||
let updateModule = (moduleElement, data) => {
|
||||
let routesTableElement = moduleElement.find('.' + config.systemInfoRoutesTableClass);
|
||||
let routesTable = routesTableElement.DataTable();
|
||||
|
||||
switch(data.task){
|
||||
case 'showFindRouteDialog':
|
||||
let dialogData = {
|
||||
moduleElement: moduleElement,
|
||||
mapId: data.mapId,
|
||||
systemFromData: moduleElement.data('systemFromData'),
|
||||
systemToData: data.systemToData,
|
||||
dataTable: routesTable
|
||||
};
|
||||
|
||||
showFindRouteDialog(dialogData);
|
||||
break;
|
||||
case 'findRoute':
|
||||
drawRouteTable(data.mapId, moduleElement, moduleElement.data('systemFromData'), routesTable, [data.systemToData]);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* init route module
|
||||
* -> request route path fore "default" trade hub systems
|
||||
@@ -1229,8 +1292,8 @@ define([
|
||||
let initModule = (moduleElement, mapId, systemData) => {
|
||||
|
||||
let systemFromData = {
|
||||
name: systemData.name,
|
||||
systemId: systemData.systemId
|
||||
systemId: systemData.systemId,
|
||||
name: systemData.name
|
||||
};
|
||||
|
||||
let routesTableElement = moduleElement.find('.' + config.systemInfoRoutesTableClass);
|
||||
@@ -1247,7 +1310,7 @@ define([
|
||||
|
||||
if(routesTable.rows().count() >= maxRouteSearchLimit){
|
||||
// max routes limit reached -> show warning
|
||||
Util.showNotify({title: 'Route limit reached', text: 'Serch is limited by ' + maxRouteSearchLimit, type: 'warning'});
|
||||
Util.showNotify({title: 'Route limit reached', text: 'Search is limited by ' + maxRouteSearchLimit, type: 'warning'});
|
||||
}else{
|
||||
let dialogData = {
|
||||
moduleElement: moduleElement,
|
||||
@@ -1276,8 +1339,8 @@ define([
|
||||
promiseStore.then(function(dataStore) {
|
||||
// selected systems (if already stored)
|
||||
let systemsTo = [{
|
||||
name: 'Jita',
|
||||
systemId: 30000142
|
||||
systemId: 30000142,
|
||||
name: 'Jita'
|
||||
}];
|
||||
|
||||
if(
|
||||
@@ -1287,7 +1350,11 @@ define([
|
||||
systemsTo = dataStore.routes;
|
||||
}
|
||||
|
||||
drawRouteTable(mapId, moduleElement, systemFromData, routesTable, systemsTo);
|
||||
// add "Rally Point" systems to table
|
||||
let systemsToData = getRallySystemsData(mapId);
|
||||
systemsToData.push(...systemsTo);
|
||||
|
||||
drawRouteTable(mapId, moduleElement, systemFromData, routesTable, systemsToData);
|
||||
});
|
||||
|
||||
};
|
||||
@@ -1295,7 +1362,8 @@ define([
|
||||
return {
|
||||
config: config,
|
||||
getModule: getModule,
|
||||
initModule: initModule
|
||||
initModule: initModule,
|
||||
updateModule: updateModule
|
||||
};
|
||||
|
||||
});
|
||||
@@ -2071,7 +2071,7 @@ define([
|
||||
orderable: true,
|
||||
searchable: false,
|
||||
title: '',
|
||||
width: '10px',
|
||||
width: 2,
|
||||
class: ['text-center', 'min-tablet-l'].join(' '),
|
||||
data: 'status',
|
||||
type: 'html',
|
||||
@@ -2085,7 +2085,7 @@ define([
|
||||
searchable: true,
|
||||
title: 'id',
|
||||
type: 'html',
|
||||
width: '30px',
|
||||
width: 30,
|
||||
data: 'name',
|
||||
render: {
|
||||
_: 'render'
|
||||
@@ -2100,7 +2100,7 @@ define([
|
||||
searchable: true,
|
||||
title: 'group',
|
||||
type: 'html',
|
||||
width: '50px',
|
||||
width: 50,
|
||||
data: 'group',
|
||||
render: {
|
||||
_: 'group',
|
||||
@@ -2113,7 +2113,7 @@ define([
|
||||
searchable: false,
|
||||
title: 'type',
|
||||
type: 'html',
|
||||
width: '180px',
|
||||
width: 180,
|
||||
data: 'type'
|
||||
},{
|
||||
targets: 4,
|
||||
@@ -2129,7 +2129,7 @@ define([
|
||||
className: [config.sigTableConnectionClass].join(' '),
|
||||
title: 'leads to',
|
||||
type: 'html',
|
||||
width: '70px',
|
||||
width: 70,
|
||||
data: 'connection',
|
||||
render: {
|
||||
_: 'render'
|
||||
@@ -2137,7 +2137,7 @@ define([
|
||||
},{
|
||||
targets: 6,
|
||||
title: 'created',
|
||||
width: '90px',
|
||||
width: 90,
|
||||
searchable: false,
|
||||
className: ['text-right', config.sigTableCounterClass, config.sigTableCreatedCellClass, 'min-tablet-l'].join(' '),
|
||||
data: 'created',
|
||||
@@ -2151,7 +2151,7 @@ define([
|
||||
},{
|
||||
targets: 7,
|
||||
title: 'updated',
|
||||
width: '90px',
|
||||
width: 90,
|
||||
searchable: false,
|
||||
className: ['text-right', config.sigTableCounterClass, config.sigTableUpdatedCellClass, 'min-tablet-l'].join(' '),
|
||||
data: 'updated',
|
||||
@@ -2175,7 +2175,7 @@ define([
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
width: '10px',
|
||||
width: 10,
|
||||
class: 'pf-help text-center',
|
||||
data: 'info',
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
@@ -2196,7 +2196,7 @@ define([
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
width: '10px',
|
||||
width: 10,
|
||||
class: ['text-center', config.sigTableActionCellClass].join(' '),
|
||||
data: 'action',
|
||||
render: {
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3,11 +3,20 @@
|
||||
*/
|
||||
|
||||
define([
|
||||
'jquery'
|
||||
], function($) {
|
||||
'jquery',
|
||||
'app/render',
|
||||
], ($, Render) => {
|
||||
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper', // wrapper div for context menus (initial hidden)
|
||||
|
||||
mapContextMenuId: 'pf-map-contextmenu', // id for "maps" context menu
|
||||
connectionContextMenuId: 'pf-map-connection-contextmenu', // id for "connections" context menu
|
||||
systemContextMenuId: 'pf-map-system-contextmenu' // id for "systems" context menu
|
||||
};
|
||||
|
||||
$.fn.contextMenu = function (settings) {
|
||||
|
||||
// animation
|
||||
@@ -19,7 +28,7 @@ define([
|
||||
return this.each(function () {
|
||||
|
||||
// Open context menu
|
||||
$(this).off('pf:openContextMenu').on('pf:openContextMenu', function (e, originalEvent, component, hiddenOptions, activeOptions) {
|
||||
$(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();
|
||||
@@ -28,20 +37,22 @@ define([
|
||||
|
||||
let menuLiElements = contextMenu.find('li');
|
||||
|
||||
// show all menu entries
|
||||
menuLiElements.show();
|
||||
// reset all menu entries
|
||||
menuLiElements.removeClass('active').removeClass('disabled').show();
|
||||
|
||||
// disable specific menu entries
|
||||
for(let i = 0; i < hiddenOptions.length; i++){
|
||||
contextMenu.find('li[data-action="' + hiddenOptions[i] + '"]').hide();
|
||||
// hide specific menu entries
|
||||
for(let action of hiddenOptions){
|
||||
contextMenu.find('li[data-action="' + action + '"]').hide();
|
||||
}
|
||||
|
||||
// deactivate all menu entries
|
||||
menuLiElements.removeClass('active');
|
||||
|
||||
//set active specific menu entries
|
||||
for(let j = 0; j < activeOptions.length; j++){
|
||||
contextMenu.find('li[data-action="' + activeOptions[j] + '"]').addClass('active');
|
||||
for(let action of activeOptions){
|
||||
contextMenu.find('li[data-action="' + action + '"]').addClass('active');
|
||||
}
|
||||
|
||||
//disable specific menu entries
|
||||
for(let action of disabledOptions){
|
||||
contextMenu.find('li[data-action="' + action + '"]').addClass('disabled');
|
||||
}
|
||||
|
||||
//open menu
|
||||
@@ -129,4 +140,122 @@ define([
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* load context menu template for maps
|
||||
*/
|
||||
let initMapContextMenu = () => {
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.mapContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plus', action: 'add_system', text: 'add system'},
|
||||
{icon: 'fa-object-ungroup', action: 'select_all', text: 'select all'},
|
||||
{icon: 'fa-filter', action: 'filter_scope', text: 'filter scope', subitems: [
|
||||
{subIcon: '', subAction: 'filter_wh', subText: 'wormhole'},
|
||||
{subIcon: '', subAction: 'filter_stargate', subText: 'stargate'},
|
||||
{subIcon: '', subAction: 'filter_jumpbridge', subText: 'jumpbridge'},
|
||||
{subIcon: '', subAction: 'filter_abyssal', subText: 'abyssal'}
|
||||
]},
|
||||
{icon: 'fa-sitemap', action: 'map', text: 'map', subitems: [
|
||||
{subIcon: 'fa-edit', subAction: 'map_edit', subText: 'edit map'},
|
||||
{subIcon: 'fa-street-view', subAction: 'map_info', subText: 'map info'},
|
||||
]},
|
||||
{divider: true, action: 'delete_systems'},
|
||||
{icon: 'fa-trash', action: 'delete_systems', text: 'delete systems'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
};
|
||||
|
||||
/**
|
||||
* load context menu template for connections
|
||||
*/
|
||||
let initConnectionContextMenu = () => {
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.connectionContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plane', action: 'frigate', text: 'frigate hole'},
|
||||
{icon: 'fa-exclamation-triangle', action: 'preserve_mass', text: 'preserve mass'},
|
||||
{icon: 'fa-crosshairs', action: 'change_scope', text: 'change scope', subitems: [
|
||||
{subIcon: 'fa-minus-circle', subIconClass: '', subAction: 'scope_wh', subText: 'wormhole'},
|
||||
{subIcon: 'fa-minus-circle', subIconClass: 'txt-color txt-color-indigoDarkest', subAction: 'scope_stargate', subText: 'stargate'},
|
||||
{subIcon: 'fa-minus-circle', subIconClass: 'txt-color txt-color-tealLighter', subAction: 'scope_jumpbridge', subText: 'jumpbridge'}
|
||||
|
||||
]},
|
||||
{icon: 'fa-reply fa-rotate-180', action: 'change_status', text: 'change status', subitems: [
|
||||
{subIcon: 'fa-clock', subAction: 'wh_eol', subText: 'toggle EOL'},
|
||||
{subDivider: true},
|
||||
{subIcon: 'fa-circle', subAction: 'status_fresh', subText: 'stage 1 (fresh)'},
|
||||
{subIcon: 'fa-adjust', subAction: 'status_reduced', subText: 'stage 2 (reduced)'},
|
||||
{subIcon: 'fa-circle', subAction: 'status_critical', subText: 'stage 3 (critical)'}
|
||||
|
||||
]},
|
||||
{divider: true, action: 'separator'} ,
|
||||
{icon: 'fa-unlink', action: 'delete_connection', text: 'detach'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
};
|
||||
|
||||
/**
|
||||
* load context menu template for systems
|
||||
* @param systemStatusData
|
||||
*/
|
||||
let initSystemContextMenu = (systemStatusData) => {
|
||||
|
||||
let statusData = [];
|
||||
for (let [statusName, data] of Object.entries(systemStatusData)){
|
||||
statusData.push({
|
||||
subIcon: 'fa-tag',
|
||||
subIconClass: data.class,
|
||||
subAction: 'change_status_' + statusName,
|
||||
subText: data.label
|
||||
});
|
||||
}
|
||||
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.systemContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plus', action: 'add_system', text: 'add system'},
|
||||
{icon: 'fa-lock', action: 'lock_system', text: 'lock system'},
|
||||
{icon: 'fa-volume-up', action: 'set_rally', text: 'set rally point'},
|
||||
{icon: 'fa-tags', text: 'set status', subitems: statusData},
|
||||
{icon: 'fa-route', action: 'find_route', text: 'find route'},
|
||||
{icon: 'fa-object-group', action: 'select_connections', text: 'select connections'},
|
||||
{icon: 'fa-reply fa-rotate-180', text: 'waypoints', subitems: [
|
||||
{subIcon: 'fa-flag-checkered', subAction: 'set_destination', subText: 'set destination'},
|
||||
{subDivider: true, action: ''},
|
||||
{subIcon: 'fa-step-backward', subAction: 'add_first_waypoint', subText: 'add new [start]'},
|
||||
{subIcon: 'fa-step-forward', subAction: 'add_last_waypoint', subText: 'add new [end]'}
|
||||
]},
|
||||
{divider: true, action: 'delete_system'},
|
||||
{icon: 'fa-trash', action: 'delete_system', text: 'delete system(s)'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
};
|
||||
|
||||
return {
|
||||
initMapContextMenu: initMapContextMenu,
|
||||
initConnectionContextMenu: initConnectionContextMenu,
|
||||
initSystemContextMenu: initSystemContextMenu
|
||||
};
|
||||
});
|
||||
@@ -14,7 +14,6 @@ define([
|
||||
'app/map/magnetizing',
|
||||
'app/map/scrollbar',
|
||||
'dragToSelect',
|
||||
'app/map/contextmenu',
|
||||
'app/map/overlay',
|
||||
'app/map/local'
|
||||
], ($, Init, Util, Render, bootbox, MapUtil, System, Layout, MagnetizerWrapper) => {
|
||||
@@ -534,8 +533,12 @@ define([
|
||||
e.stopPropagation();
|
||||
|
||||
// trigger menu "open
|
||||
Promise.all([getHiddenContextMenuOptions(component), getActiveContextMenuOptions(component)]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, component, payload[0], payload[1]]);
|
||||
Promise.all([
|
||||
getHiddenContextMenuOptions(component),
|
||||
getActiveContextMenuOptions(component),
|
||||
getDisabledContextMenuOptions(component)
|
||||
]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, component, payload[0], payload[1], payload[2]]);
|
||||
});
|
||||
|
||||
return false;
|
||||
@@ -1764,125 +1767,12 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* load context menu template for map
|
||||
*/
|
||||
let initMapContextMenu = function(){
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.mapContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plus', action: 'add_system', text: 'add system'},
|
||||
{icon: 'fa-object-ungroup', action: 'select_all', text: 'select all'},
|
||||
{icon: 'fa-filter', action: 'filter_scope', text: 'filter scope', subitems: [
|
||||
{subIcon: '', subAction: 'filter_wh', subText: 'wormhole'},
|
||||
{subIcon: '', subAction: 'filter_stargate', subText: 'stargate'},
|
||||
{subIcon: '', subAction: 'filter_jumpbridge', subText: 'jumpbridge'},
|
||||
{subIcon: '', subAction: 'filter_abyssal', subText: 'abyssal'}
|
||||
]},
|
||||
{icon: 'fa-sitemap', action: 'map', text: 'map', subitems: [
|
||||
{subIcon: 'fa-edit', subAction: 'map_edit', subText: 'edit map'},
|
||||
{subIcon: 'fa-street-view', subAction: 'map_info', subText: 'map info'},
|
||||
]},
|
||||
{divider: true, action: 'delete_systems'},
|
||||
{icon: 'fa-trash', action: 'delete_systems', text: 'delete systems'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
};
|
||||
|
||||
/**
|
||||
* load contextmenu template for connections
|
||||
*/
|
||||
let initConnectionContextMenu = function(){
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.connectionContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plane', action: 'frigate', text: 'frigate hole'},
|
||||
{icon: 'fa-exclamation-triangle', action: 'preserve_mass', text: 'preserve mass'},
|
||||
{icon: 'fa-crosshairs', action: 'change_scope', text: 'change scope', subitems: [
|
||||
{subIcon: 'fa-minus-circle', subIconClass: '', subAction: 'scope_wh', subText: 'wormhole'},
|
||||
{subIcon: 'fa-minus-circle', subIconClass: 'txt-color txt-color-indigoDarkest', subAction: 'scope_stargate', subText: 'stargate'},
|
||||
{subIcon: 'fa-minus-circle', subIconClass: 'txt-color txt-color-tealLighter', subAction: 'scope_jumpbridge', subText: 'jumpbridge'}
|
||||
|
||||
]},
|
||||
{icon: 'fa-reply fa-rotate-180', action: 'change_status', text: 'change status', subitems: [
|
||||
{subIcon: 'fa-clock', subAction: 'wh_eol', subText: 'toggle EOL'},
|
||||
{subDivider: true},
|
||||
{subIcon: 'fa-circle', subAction: 'status_fresh', subText: 'stage 1 (fresh)'},
|
||||
{subIcon: 'fa-adjust', subAction: 'status_reduced', subText: 'stage 2 (reduced)'},
|
||||
{subIcon: 'fa-circle', subAction: 'status_critical', subText: 'stage 3 (critical)'}
|
||||
|
||||
]},
|
||||
{divider: true, action: 'separator'} ,
|
||||
{icon: 'fa-unlink', action: 'delete_connection', text: 'detach'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* load contextmenu template for systems
|
||||
*/
|
||||
let initSystemContextMenu = function(){
|
||||
let systemStatus = [];
|
||||
|
||||
$.each(Init.systemStatus, function(status, statusData){
|
||||
let tempStatus = {
|
||||
subIcon: 'fa-tag',
|
||||
subIconClass: statusData.class,
|
||||
subAction: 'change_status_' + status,
|
||||
subText: statusData.label
|
||||
};
|
||||
systemStatus.push(tempStatus);
|
||||
});
|
||||
|
||||
let moduleConfig = {
|
||||
name: 'modules/contextmenu',
|
||||
position: $('#' + config.dynamicElementWrapperId)
|
||||
};
|
||||
|
||||
let moduleData = {
|
||||
id: config.systemContextMenuId,
|
||||
items: [
|
||||
{icon: 'fa-plus', action: 'add_system', text: 'add system'},
|
||||
{icon: 'fa-lock', action: 'lock_system', text: 'lock system'},
|
||||
{icon: 'fa-volume-up', action: 'set_rally', text: 'set rally point'},
|
||||
{icon: 'fa-object-group', action: 'select_connections', text: 'select connections'},
|
||||
{icon: 'fa-tags', text: 'set status', subitems: systemStatus},
|
||||
{icon: 'fa-reply fa-rotate-180', text: 'waypoints', subitems: [
|
||||
{subIcon: 'fa-flag-checkered', subAction: 'set_destination', subText: 'set destination'},
|
||||
{subDivider: true, action: ''},
|
||||
{subIcon: 'fa-step-backward', subAction: 'add_first_waypoint', subText: 'add new [start]'},
|
||||
{subIcon: 'fa-step-forward', subAction: 'add_last_waypoint', subText: 'add new [end]'}
|
||||
]},
|
||||
{divider: true, action: 'delete_system'},
|
||||
{icon: 'fa-trash', action: 'delete_system', text: 'delete system(s)'}
|
||||
]
|
||||
};
|
||||
|
||||
Render.showModule(moduleConfig, moduleData);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* get hidden menu entry options for a context menu
|
||||
* @param component
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
let getHiddenContextMenuOptions = function(component){
|
||||
let getHiddenContextMenuOptions = component => {
|
||||
|
||||
let getHiddenContextMenuOptionsExecutor = (resolve, reject) => {
|
||||
let hiddenOptions = [];
|
||||
@@ -1916,6 +1806,11 @@ define([
|
||||
if(component.data('locked') === true){
|
||||
hiddenOptions.push('delete_system');
|
||||
}
|
||||
|
||||
let mapElement = component.parents('.' + config.mapClass);
|
||||
if( !mapElement.find('.' + config.systemActiveClass).length ){
|
||||
hiddenOptions.push('find_route');
|
||||
}
|
||||
}
|
||||
|
||||
resolve(hiddenOptions);
|
||||
@@ -1982,6 +1877,29 @@ define([
|
||||
return new Promise(getActiveContextMenuOptionsExecutor);
|
||||
};
|
||||
|
||||
/**
|
||||
* get disabled menu entry options for a context menu
|
||||
* @param component
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
let getDisabledContextMenuOptions = component => {
|
||||
|
||||
let getDisabledContextMenuOptionsExecutor = (resolve, reject) => {
|
||||
let disabledOptions = [];
|
||||
|
||||
if( component.hasClass(config.systemClass) ){
|
||||
// disable system menu entries
|
||||
if( component.hasClass(config.systemActiveClass) ){
|
||||
disabledOptions.push('find_route');
|
||||
}
|
||||
}
|
||||
|
||||
resolve(disabledOptions);
|
||||
};
|
||||
|
||||
return new Promise(getDisabledContextMenuOptionsExecutor);
|
||||
};
|
||||
|
||||
/**
|
||||
* set up all actions that can be preformed on a system
|
||||
* @param map
|
||||
@@ -2109,8 +2027,12 @@ define([
|
||||
let systemElement = $(this);
|
||||
|
||||
// trigger menu "open
|
||||
Promise.all([getHiddenContextMenuOptions(systemElement), getActiveContextMenuOptions(systemElement)]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, this, payload[0], payload[1]]);
|
||||
Promise.all([
|
||||
getHiddenContextMenuOptions(systemElement),
|
||||
getActiveContextMenuOptions(systemElement),
|
||||
getDisabledContextMenuOptions(systemElement)
|
||||
]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, this, payload[0], payload[1], payload[2]]);
|
||||
});
|
||||
|
||||
return false;
|
||||
@@ -2157,6 +2079,14 @@ define([
|
||||
currentSystem.markAsChanged();
|
||||
}
|
||||
break;
|
||||
case 'find_route':
|
||||
// show find route dialog
|
||||
systemData = system.getSystemData();
|
||||
MapUtil.showFindRouteDialog(mapContainer, {
|
||||
systemId: systemData.systemId,
|
||||
name: systemData.name
|
||||
});
|
||||
break;
|
||||
case 'select_connections':
|
||||
let connections = MapUtil.searchConnectionsBySystems(map, [currentSystem], '*');
|
||||
MapUtil.showConnectionInfo(map, connections);
|
||||
@@ -2221,13 +2151,11 @@ define([
|
||||
if( !system.hasClass('no-click') ){
|
||||
// left mouse button
|
||||
if(e.which === 1){
|
||||
if(! system.hasClass('no-click')){
|
||||
if(e.ctrlKey === true){
|
||||
// select system
|
||||
MapUtil.toggleSystemsSelect(map, [system]);
|
||||
}else{
|
||||
MapUtil.showSystemInfo(map, system);
|
||||
}
|
||||
if(e.ctrlKey === true){
|
||||
// select system
|
||||
MapUtil.toggleSystemsSelect(map, [system]);
|
||||
}else{
|
||||
MapUtil.showSystemInfo(map, system);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2402,17 +2330,6 @@ define([
|
||||
let sourceId = info.sourceId;
|
||||
let targetId = info.targetId;
|
||||
|
||||
// lock the target system for "click" events
|
||||
// to prevent loading system information
|
||||
let sourceSystem = $('#' + sourceId);
|
||||
let targetSystem = $('#' + targetId);
|
||||
sourceSystem.addClass('no-click');
|
||||
targetSystem.addClass('no-click');
|
||||
setTimeout(function(){
|
||||
sourceSystem.removeClass('no-click');
|
||||
targetSystem.removeClass('no-click');
|
||||
}, Init.timer.DBL_CLICK + 50);
|
||||
|
||||
// loop connection not allowed
|
||||
if(sourceId === targetId){
|
||||
console.warn('Source/Target systems are identical');
|
||||
@@ -2425,6 +2342,18 @@ define([
|
||||
return false;
|
||||
}
|
||||
|
||||
// lock the target system for "click" events
|
||||
// to prevent loading system information
|
||||
let sourceSystem = $('#' + sourceId);
|
||||
let targetSystem = $('#' + targetId);
|
||||
sourceSystem.addClass('no-click');
|
||||
targetSystem.addClass('no-click');
|
||||
|
||||
setTimeout(() => {
|
||||
sourceSystem.removeClass('no-click');
|
||||
targetSystem.removeClass('no-click');
|
||||
}, Init.timer.DBL_CLICK + 50);
|
||||
|
||||
// switch connection type to "abyss" in case source OR target system belongs to "a-space"
|
||||
if(sourceSystem.data('typeId') === 3 || targetSystem.data('typeId') === 3){
|
||||
setConnectionScope(connection, 'abyssal');
|
||||
@@ -2500,8 +2429,12 @@ define([
|
||||
let mapElement = $(this);
|
||||
|
||||
// trigger menu "open
|
||||
Promise.all([getHiddenContextMenuOptions(mapElement), getActiveContextMenuOptions(mapElement)]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, mapElement, payload[0], payload[1]]);
|
||||
Promise.all([
|
||||
getHiddenContextMenuOptions(mapElement),
|
||||
getActiveContextMenuOptions(mapElement),
|
||||
getDisabledContextMenuOptions(mapElement)
|
||||
]).then(payload => {
|
||||
$(e.target).trigger('pf:openContextMenu', [e, mapElement, payload[0], payload[1], payload[2]]);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3280,11 +3213,6 @@ define([
|
||||
* @param reject
|
||||
*/
|
||||
let loadMapExecutor = (resolve, reject) => {
|
||||
// add context menus to dom (if not already
|
||||
initMapContextMenu();
|
||||
initConnectionContextMenu();
|
||||
initSystemContextMenu();
|
||||
|
||||
// init jsPlumb
|
||||
jsPlumb.ready(function(){
|
||||
// get new map instance or load existing
|
||||
|
||||
@@ -668,9 +668,8 @@ define([
|
||||
|
||||
// get parent Tab Content and fire update event
|
||||
let mapContainer = $(map.getContainer());
|
||||
let tabContentElement = getTabContentElementByMapElement(mapContainer);
|
||||
|
||||
$(tabContentElement).trigger('pf:drawConnectionModules', {
|
||||
getTabContentElementByMapElement(mapContainer).trigger('pf:drawConnectionModules', {
|
||||
connections: connections,
|
||||
mapId: parseInt(mapContainer.data('id'))
|
||||
});
|
||||
@@ -693,6 +692,28 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* show "find route" dialog -> trigger route panel
|
||||
* @param mapContainer
|
||||
* @param systemToData
|
||||
*/
|
||||
let showFindRouteDialog = (mapContainer, systemToData) => {
|
||||
// get parent Tab Content and fire update event
|
||||
getTabContentElementByMapElement(mapContainer).trigger('pf:updateRouteModules', {
|
||||
task: 'showFindRouteDialog',
|
||||
systemToData: systemToData,
|
||||
mapId: parseInt(mapContainer.data('id'))
|
||||
});
|
||||
};
|
||||
|
||||
let findRoute = (mapContainer, systemToData) => {
|
||||
getTabContentElementByMapElement(mapContainer).trigger('pf:updateRouteModules', {
|
||||
task: 'findRoute',
|
||||
systemToData: systemToData,
|
||||
mapId: parseInt(mapContainer.data('id'))
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* search connections by systems
|
||||
* @param map
|
||||
@@ -1199,8 +1220,8 @@ define([
|
||||
|
||||
if(rallyUpdated > 0){
|
||||
// new rally point set OR update system with rally information
|
||||
system.addClass(rallyClass);
|
||||
|
||||
system.addClass( rallyClass );
|
||||
// rallyUpdated > 0 is required for poke!
|
||||
rallyPoke = options.poke;
|
||||
|
||||
@@ -1249,9 +1270,17 @@ define([
|
||||
rallyUpdated: rallyUpdated
|
||||
}));
|
||||
}
|
||||
|
||||
// update active "route" module -> add rally point row --------------------------------------------
|
||||
let mapContainer = system.parents('.' + config.mapClass);
|
||||
findRoute(mapContainer, {
|
||||
systemId: system.data('systemId'),
|
||||
name: system.data('name'),
|
||||
rally: 1
|
||||
});
|
||||
}else{
|
||||
// rally point removed
|
||||
system.removeClass( rallyClass );
|
||||
system.removeClass(rallyClass);
|
||||
|
||||
if( !options.hideNotification ){
|
||||
Util.showNotify({title: 'Rally point removed', type: 'success'});
|
||||
@@ -1601,6 +1630,7 @@ define([
|
||||
setSystemActive: setSystemActive,
|
||||
showSystemInfo: showSystemInfo,
|
||||
showConnectionInfo: showConnectionInfo,
|
||||
showFindRouteDialog: showFindRouteDialog,
|
||||
getConnectionsByType: getConnectionsByType,
|
||||
getDataByConnection: getDataByConnection,
|
||||
searchConnectionsBySystems: searchConnectionsBySystems,
|
||||
|
||||
@@ -194,9 +194,12 @@ define([
|
||||
let initMapModule = (payload) => {
|
||||
|
||||
let initMapModuleExecutor = (resolve, reject) => {
|
||||
// init tab change observer, Once the timers are available
|
||||
// init browser tab change observer, Once the timers are available
|
||||
Page.initTabChangeObserver();
|
||||
|
||||
// init hidden context menu elements
|
||||
Page.initMapContextMenus();
|
||||
|
||||
// init map module
|
||||
mapModule.initMapModule() ;
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ define([
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper', // parent Element for dynamic content (dialogs,..)
|
||||
mapTabElementId: 'pf-map-tab-element', // id for map tab element (tabs + content)
|
||||
mapTabBarId: 'pf-map-tabs', // id for map tab bar
|
||||
mapTabIdPrefix: 'pf-map-tab-', // id prefix for a map tab
|
||||
@@ -105,6 +104,10 @@ define([
|
||||
tabElement.on('pf:updateSystemModules', '.' + config.mapTabContentClass, function(e, data){
|
||||
updateSystemModules($(e.target), data);
|
||||
});
|
||||
|
||||
tabElement.on('pf:updateRouteModules', '.' + config.mapTabContentClass, function(e, data){
|
||||
updateRouteModules($(e.target), data);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -132,6 +135,16 @@ define([
|
||||
updateModules(tabContentElement, systemModules, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* update route modules with new data
|
||||
* @param tabContentElement
|
||||
* @param data
|
||||
*/
|
||||
let updateRouteModules = (tabContentElement, data) => {
|
||||
let routeModules = [SystemRouteModule];
|
||||
updateModules(tabContentElement, routeModules, data);
|
||||
};
|
||||
|
||||
/**
|
||||
* remove multiple modules
|
||||
* @param tabContentElement
|
||||
|
||||
@@ -9,6 +9,7 @@ define([
|
||||
'app/logging',
|
||||
'mustache',
|
||||
'app/map/util',
|
||||
'app/map/contextmenu',
|
||||
'text!img/logo.svg!strip',
|
||||
'text!templates/modules/header.html',
|
||||
'text!templates/modules/footer.html',
|
||||
@@ -26,7 +27,7 @@ define([
|
||||
'xEditable',
|
||||
'slidebars',
|
||||
'app/module_map'
|
||||
], ($, Init, Util, Logging, Mustache, MapUtil, TplLogo, TplHead, TplFooter) => {
|
||||
], ($, Init, Util, Logging, Mustache, MapUtil, MapContextMenu, TplLogo, TplHead, TplFooter) => {
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -66,7 +67,7 @@ define([
|
||||
menuClockClass: 'pf-menu-clock', // class for EVE-Time clock
|
||||
|
||||
// helper element
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper',
|
||||
dynamicElementWrapperId: 'pf-dialog-wrapper', // class for container element that holds hidden "context menus"
|
||||
|
||||
// system signature module
|
||||
systemSignatureModuleClass: 'pf-signature-table-module', // module wrapper (signatures)
|
||||
@@ -105,8 +106,7 @@ define([
|
||||
id: config.pageId,
|
||||
class: config.pageClass
|
||||
}).append(
|
||||
Util.getMapModule()
|
||||
).append(
|
||||
Util.getMapModule(),
|
||||
$('<div>', {
|
||||
id: config.dynamicElementWrapperId
|
||||
})
|
||||
@@ -1087,7 +1087,7 @@ define([
|
||||
/**
|
||||
* shows a test notification for desktop messages
|
||||
*/
|
||||
let notificationTest = function(){
|
||||
let notificationTest = () => {
|
||||
Util.showNotify({
|
||||
title: 'Test Notification',
|
||||
text: 'Accept browser security question'},
|
||||
@@ -1102,7 +1102,7 @@ define([
|
||||
* set event listener if the program tab is active or not
|
||||
* this is used to lower the update ping cycle to reduce server load
|
||||
*/
|
||||
let initTabChangeObserver = function(){
|
||||
let initTabChangeObserver = () => {
|
||||
|
||||
// increase the timer if a user is inactive
|
||||
let increaseTimer = 5000;
|
||||
@@ -1128,7 +1128,7 @@ define([
|
||||
}
|
||||
|
||||
// function is called if the tab becomes active/inactive
|
||||
function handleVisibilityChange() {
|
||||
let handleVisibilityChange = () => {
|
||||
if (document[hidden]) {
|
||||
// tab is invisible
|
||||
// globally store current visibility status
|
||||
@@ -1147,7 +1147,7 @@ define([
|
||||
// stop blinking tab from previous notifications
|
||||
Util.stopTabBlink();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (
|
||||
typeof document.addEventListener !== 'undefined' &&
|
||||
@@ -1164,6 +1164,14 @@ define([
|
||||
|
||||
};
|
||||
|
||||
let initMapContextMenus = () => {
|
||||
$('#' + config.dynamicElementWrapperId).append(
|
||||
MapContextMenu.initMapContextMenu(),
|
||||
MapContextMenu.initConnectionContextMenu(),
|
||||
MapContextMenu.initSystemContextMenu(Init.systemStatus)
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* trigger "program status" in head
|
||||
* @param status
|
||||
@@ -1308,7 +1316,8 @@ define([
|
||||
};
|
||||
|
||||
return {
|
||||
initTabChangeObserver: initTabChangeObserver
|
||||
initTabChangeObserver: initTabChangeObserver,
|
||||
initMapContextMenus: initMapContextMenus
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,9 @@ define([
|
||||
|
||||
dataTableActionCellClass: 'pf-table-action-cell', // class for "action" cells
|
||||
dataTableRouteCellClass: 'pf-table-route-cell', // class for "route" cells
|
||||
dataTableJumpCellClass: 'pf-table-jump-cell' // class for "route jump" cells
|
||||
dataTableJumpCellClass: 'pf-table-jump-cell', // class for "route jump" cells
|
||||
|
||||
rallyClass: 'pf-rally' // class for "rally point" style
|
||||
};
|
||||
|
||||
// cache for system routes
|
||||
@@ -109,11 +111,8 @@ define([
|
||||
* @param routesData
|
||||
*/
|
||||
let callbackAddRouteRows = (context, routesData) => {
|
||||
|
||||
if(routesData.length > 0){
|
||||
for(let i = 0; i < routesData.length; i++){
|
||||
let routeData = routesData[i];
|
||||
|
||||
for(let routeData of routesData){
|
||||
// format routeData
|
||||
let rowData = formatRouteData(routeData);
|
||||
if(rowData.route){
|
||||
@@ -145,7 +144,7 @@ define([
|
||||
// search for an existing row (e.g. on mass "table refresh" [all routes])
|
||||
// get rowIndex where column 1 (equals to "systemToData.name") matches rowData.systemToData.name
|
||||
let indexes = dataTable.rows().eq(0).filter((rowIdx) => {
|
||||
return (dataTable.cell(rowIdx, 1 ).data().name === rowData.systemToData.name);
|
||||
return (dataTable.cell(rowIdx, 1).data().name === rowData.systemToData.name);
|
||||
});
|
||||
|
||||
if(indexes.length > 0){
|
||||
@@ -163,9 +162,7 @@ define([
|
||||
|
||||
if(row.length > 0){
|
||||
rowElement = row.nodes().to$();
|
||||
if(animationStatus !== null){
|
||||
rowElement.data('animationStatus', animationStatus);
|
||||
}
|
||||
rowElement.data('animationStatus', animationStatus);
|
||||
|
||||
rowElement.initTooltips({
|
||||
container: 'body'
|
||||
@@ -262,6 +259,7 @@ define([
|
||||
selectClass: config.systemDialogSelectClass,
|
||||
mapSelectId: config.mapSelectId,
|
||||
systemFromData: dialogData.systemFromData,
|
||||
systemToData: dialogData.systemToData,
|
||||
mapSelectOptions: mapSelectOptions
|
||||
};
|
||||
|
||||
@@ -368,9 +366,9 @@ define([
|
||||
* @param moduleElement
|
||||
* @param systemFromData
|
||||
* @param routesTable
|
||||
* @param systemsTo
|
||||
* @param systemsToData
|
||||
*/
|
||||
let drawRouteTable = (mapId, moduleElement, systemFromData, routesTable, systemsTo) => {
|
||||
let drawRouteTable = (mapId, moduleElement, systemFromData, routesTable, systemsToData) => {
|
||||
let requestRouteData = [];
|
||||
|
||||
// Skip some routes from search
|
||||
@@ -378,9 +376,7 @@ define([
|
||||
let defaultRoutesCount = Init.routeSearch.defaultCount;
|
||||
let rowElements = [];
|
||||
|
||||
for(let i = 0; i < systemsTo.length; i++){
|
||||
let systemToData = systemsTo[i];
|
||||
|
||||
for(let systemToData of systemsToData){
|
||||
if(systemFromData.name !== systemToData.name){
|
||||
// check for cached rowData
|
||||
let cacheKey = getRouteDataCacheKey([mapId], systemFromData.name, systemToData.name);
|
||||
@@ -738,7 +734,7 @@ define([
|
||||
let connectionButton = '<i class="fas ' + ['fa-link', 'txt-color'].join(' ') + '"></i>';
|
||||
let flagButton = '<i class="fas ' + ['fa-shield-alt', 'txt-color', flagButtonClass].join(' ') + '"></i>';
|
||||
let reloadButton = '<i class="fas ' + ['fa-sync'].join(' ') + '"></i>';
|
||||
let searchButton = '<i class="fas ' + ['fa-search-plus '].join(' ') + '"></i>';
|
||||
let searchButton = '<i class="fas ' + ['fa-search'].join(' ') + '"></i>';
|
||||
let deleteButton = '<i class="fas ' + ['fa-times', 'txt-color', 'txt-color-redDarker'].join(' ') + '"></i>';
|
||||
|
||||
// default row data (e.g. no route found)
|
||||
@@ -873,9 +869,13 @@ define([
|
||||
|
||||
/**
|
||||
* get module element
|
||||
* @returns {*}
|
||||
* @param parentElement
|
||||
* @param mapId
|
||||
* @param systemData
|
||||
* @returns {jQuery}
|
||||
*/
|
||||
let getModule = () => {
|
||||
let getModule = (parentElement, mapId, systemData) => {
|
||||
|
||||
// create new module container
|
||||
let moduleElement = $('<div>').append(
|
||||
$('<div>', {
|
||||
@@ -906,6 +906,15 @@ define([
|
||||
)
|
||||
);
|
||||
|
||||
// save systemFromData to module (data never changes during module lifetime)
|
||||
// -> we need this later in updateModule()
|
||||
let systemFromData = {
|
||||
systemId: systemData.systemId,
|
||||
name: systemData.name,
|
||||
};
|
||||
|
||||
moduleElement.data('systemFromData', systemFromData);
|
||||
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.systemInfoRoutesTableClass].join(' ')
|
||||
});
|
||||
@@ -951,12 +960,14 @@ define([
|
||||
$(cell).initSystemPopover({
|
||||
systemToData: rowData.systemToData
|
||||
});
|
||||
|
||||
$(cell).toggleClass(config.rallyClass, cellData.hasOwnProperty('rally'));
|
||||
}
|
||||
},{
|
||||
targets: 2,
|
||||
orderable: true,
|
||||
title: '<span title="jumps" data-toggle="tooltip"><i class="fas fa-arrows-alt-h"></i> </span>',
|
||||
width: 18,
|
||||
width: 16,
|
||||
class: 'text-right',
|
||||
data: 'jumps',
|
||||
render: {
|
||||
@@ -967,7 +978,7 @@ define([
|
||||
targets: 3,
|
||||
orderable: true,
|
||||
title: '<span title="average security" data-toggle="tooltip">Ø </span>',
|
||||
width: 15,
|
||||
width: 14,
|
||||
class: 'text-right',
|
||||
data: 'avgTrueSec',
|
||||
render: {
|
||||
@@ -1207,8 +1218,8 @@ define([
|
||||
popoverRoot.data('bs.popover').tip().find('a').on('click', function(){
|
||||
// hint: "data" attributes should be in lower case!
|
||||
let systemData = {
|
||||
name: $(this).data('name'),
|
||||
systemId: $(this).data('systemid')
|
||||
systemId: $(this).data('systemid'),
|
||||
name: $(this).data('name')
|
||||
};
|
||||
Util.setDestination(systemData, 'set_destination');
|
||||
|
||||
@@ -1219,6 +1230,58 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* get data from all Rally Point systems
|
||||
* @param mapId
|
||||
* @returns {Array}
|
||||
*/
|
||||
let getRallySystemsData = (mapId) => {
|
||||
let systemsRallyData = [];
|
||||
let map = MapUtil.getMapInstance(mapId);
|
||||
if(map){
|
||||
let mapContainer = $(map.getContainer());
|
||||
let systems = mapContainer.find('.pf-system-info-rally');
|
||||
|
||||
for(let system of systems){
|
||||
system = $(system);
|
||||
systemsRallyData.push({
|
||||
systemId: system.data('systemId'),
|
||||
name: system.data('name'),
|
||||
rally: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return systemsRallyData;
|
||||
};
|
||||
|
||||
/**
|
||||
* update trigger function for this module
|
||||
* @param moduleElement
|
||||
* @param data
|
||||
*/
|
||||
let updateModule = (moduleElement, data) => {
|
||||
let routesTableElement = moduleElement.find('.' + config.systemInfoRoutesTableClass);
|
||||
let routesTable = routesTableElement.DataTable();
|
||||
|
||||
switch(data.task){
|
||||
case 'showFindRouteDialog':
|
||||
let dialogData = {
|
||||
moduleElement: moduleElement,
|
||||
mapId: data.mapId,
|
||||
systemFromData: moduleElement.data('systemFromData'),
|
||||
systemToData: data.systemToData,
|
||||
dataTable: routesTable
|
||||
};
|
||||
|
||||
showFindRouteDialog(dialogData);
|
||||
break;
|
||||
case 'findRoute':
|
||||
drawRouteTable(data.mapId, moduleElement, moduleElement.data('systemFromData'), routesTable, [data.systemToData]);
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* init route module
|
||||
* -> request route path fore "default" trade hub systems
|
||||
@@ -1229,8 +1292,8 @@ define([
|
||||
let initModule = (moduleElement, mapId, systemData) => {
|
||||
|
||||
let systemFromData = {
|
||||
name: systemData.name,
|
||||
systemId: systemData.systemId
|
||||
systemId: systemData.systemId,
|
||||
name: systemData.name
|
||||
};
|
||||
|
||||
let routesTableElement = moduleElement.find('.' + config.systemInfoRoutesTableClass);
|
||||
@@ -1247,7 +1310,7 @@ define([
|
||||
|
||||
if(routesTable.rows().count() >= maxRouteSearchLimit){
|
||||
// max routes limit reached -> show warning
|
||||
Util.showNotify({title: 'Route limit reached', text: 'Serch is limited by ' + maxRouteSearchLimit, type: 'warning'});
|
||||
Util.showNotify({title: 'Route limit reached', text: 'Search is limited by ' + maxRouteSearchLimit, type: 'warning'});
|
||||
}else{
|
||||
let dialogData = {
|
||||
moduleElement: moduleElement,
|
||||
@@ -1276,8 +1339,8 @@ define([
|
||||
promiseStore.then(function(dataStore) {
|
||||
// selected systems (if already stored)
|
||||
let systemsTo = [{
|
||||
name: 'Jita',
|
||||
systemId: 30000142
|
||||
systemId: 30000142,
|
||||
name: 'Jita'
|
||||
}];
|
||||
|
||||
if(
|
||||
@@ -1287,7 +1350,11 @@ define([
|
||||
systemsTo = dataStore.routes;
|
||||
}
|
||||
|
||||
drawRouteTable(mapId, moduleElement, systemFromData, routesTable, systemsTo);
|
||||
// add "Rally Point" systems to table
|
||||
let systemsToData = getRallySystemsData(mapId);
|
||||
systemsToData.push(...systemsTo);
|
||||
|
||||
drawRouteTable(mapId, moduleElement, systemFromData, routesTable, systemsToData);
|
||||
});
|
||||
|
||||
};
|
||||
@@ -1295,7 +1362,8 @@ define([
|
||||
return {
|
||||
config: config,
|
||||
getModule: getModule,
|
||||
initModule: initModule
|
||||
initModule: initModule,
|
||||
updateModule: updateModule
|
||||
};
|
||||
|
||||
});
|
||||
@@ -2071,7 +2071,7 @@ define([
|
||||
orderable: true,
|
||||
searchable: false,
|
||||
title: '',
|
||||
width: '10px',
|
||||
width: 2,
|
||||
class: ['text-center', 'min-tablet-l'].join(' '),
|
||||
data: 'status',
|
||||
type: 'html',
|
||||
@@ -2085,7 +2085,7 @@ define([
|
||||
searchable: true,
|
||||
title: 'id',
|
||||
type: 'html',
|
||||
width: '30px',
|
||||
width: 30,
|
||||
data: 'name',
|
||||
render: {
|
||||
_: 'render'
|
||||
@@ -2100,7 +2100,7 @@ define([
|
||||
searchable: true,
|
||||
title: 'group',
|
||||
type: 'html',
|
||||
width: '50px',
|
||||
width: 50,
|
||||
data: 'group',
|
||||
render: {
|
||||
_: 'group',
|
||||
@@ -2113,7 +2113,7 @@ define([
|
||||
searchable: false,
|
||||
title: 'type',
|
||||
type: 'html',
|
||||
width: '180px',
|
||||
width: 180,
|
||||
data: 'type'
|
||||
},{
|
||||
targets: 4,
|
||||
@@ -2129,7 +2129,7 @@ define([
|
||||
className: [config.sigTableConnectionClass].join(' '),
|
||||
title: 'leads to',
|
||||
type: 'html',
|
||||
width: '70px',
|
||||
width: 70,
|
||||
data: 'connection',
|
||||
render: {
|
||||
_: 'render'
|
||||
@@ -2137,7 +2137,7 @@ define([
|
||||
},{
|
||||
targets: 6,
|
||||
title: 'created',
|
||||
width: '90px',
|
||||
width: 90,
|
||||
searchable: false,
|
||||
className: ['text-right', config.sigTableCounterClass, config.sigTableCreatedCellClass, 'min-tablet-l'].join(' '),
|
||||
data: 'created',
|
||||
@@ -2151,7 +2151,7 @@ define([
|
||||
},{
|
||||
targets: 7,
|
||||
title: 'updated',
|
||||
width: '90px',
|
||||
width: 90,
|
||||
searchable: false,
|
||||
className: ['text-right', config.sigTableCounterClass, config.sigTableUpdatedCellClass, 'min-tablet-l'].join(' '),
|
||||
data: 'updated',
|
||||
@@ -2175,7 +2175,7 @@ define([
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
width: '10px',
|
||||
width: 10,
|
||||
class: 'pf-help text-center',
|
||||
data: 'info',
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
@@ -2196,7 +2196,7 @@ define([
|
||||
title: '',
|
||||
orderable: false,
|
||||
searchable: false,
|
||||
width: '10px',
|
||||
width: 10,
|
||||
class: ['text-center', config.sigTableActionCellClass].join(' '),
|
||||
data: 'action',
|
||||
render: {
|
||||
|
||||
@@ -21,7 +21,11 @@
|
||||
<label class="col-sm-2 col-xs-2 control-label" for="to_system">To</label>
|
||||
<div class="col-sm-10 col-xs-10">
|
||||
<div class="input-group">
|
||||
<select id="to_system" name="systemToData" class="form-control {{selectClass}}" data-error="Choose a valid system" required/>
|
||||
<select id="to_system" name="systemToData" class="form-control {{selectClass}}" data-error="Choose a valid system" required>
|
||||
{{#systemToData}}
|
||||
<option value="{{systemId}}">{{name}}</option>
|
||||
{{/systemToData}}
|
||||
</select>
|
||||
<span class="help-block with-errors"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,81 +1,79 @@
|
||||
$black: black;
|
||||
$white: white;
|
||||
$black: black;
|
||||
$white: white;
|
||||
|
||||
$bg-color: #05050a;
|
||||
$bg-color: #05050a;
|
||||
|
||||
// gray
|
||||
$gray-lightest: #eaeaea;
|
||||
$gray-lighter: #adadad;
|
||||
$gray-light: #63676a;
|
||||
$gray: #3c3f41;
|
||||
$gray-dark: #313335;
|
||||
$gray-darker: #2b2b2b;
|
||||
$gray-darkest: #1d1d1d;
|
||||
$gray-lightest: #eaeaea;
|
||||
$gray-lighter: #adadad;
|
||||
$gray-light: #63676a;
|
||||
$gray: #3c3f41;
|
||||
$gray-dark: #313335;
|
||||
$gray-darker: #2b2b2b;
|
||||
$gray-darkest: #1d1d1d;
|
||||
|
||||
$gray-mid-light: lighten($black, 75%);
|
||||
$gray-mid-light: lighten($black, 75%);
|
||||
|
||||
// blue
|
||||
$blue-lighter: #57889c;
|
||||
$blue: #428bca;
|
||||
$blue-dark: #316490;
|
||||
$blue-lighter: #57889c;
|
||||
$blue: #428bca;
|
||||
$blue-dark: #316490;
|
||||
|
||||
// teal
|
||||
$teal-lightest: #6caead;
|
||||
$teal-lighter: #568a89;
|
||||
$teal: #477372;
|
||||
$teal-dark: #375959;
|
||||
$teal-darker: #212C30;
|
||||
$teal-darkest: #1b2326;
|
||||
$teal-lightest: #6caead;
|
||||
$teal-lighter: #568a89;
|
||||
$teal: #477372;
|
||||
$teal-dark: #375959;
|
||||
$teal-darker: #212C30;
|
||||
$teal-darkest: #1b2326;
|
||||
|
||||
// green
|
||||
$green-light: #66c84f;
|
||||
$green: #5cb85c;
|
||||
$green-dark: #4f9e4f;
|
||||
$green-light: #66c84f;
|
||||
$green: #5cb85c;
|
||||
$green-dark: #4f9e4f;
|
||||
|
||||
// red
|
||||
$red: #d9534f;
|
||||
$red-darker: #a52521;
|
||||
$red-darkest: #58100d;
|
||||
|
||||
// yellow
|
||||
$yellow-lighter: #ffffbb;
|
||||
$red: #d9534f;
|
||||
$red-darker: #a52521;
|
||||
$red-darkest: #58100d;
|
||||
|
||||
// indigo
|
||||
$indigo-light: #9fa8da;
|
||||
$indigo: #7986cb;
|
||||
$indigo-dark: #5c6bc0;
|
||||
$indigo-darkest: #313966;
|
||||
$indigo-light: #9fa8da;
|
||||
$indigo: #7986cb;
|
||||
$indigo-dark: #5c6bc0;
|
||||
$indigo-darkest: #313966;
|
||||
|
||||
// orange
|
||||
$orange-light: #f0ad4e;
|
||||
$orange: #e28a0d;
|
||||
$orange-dark: #c2760c;
|
||||
$orange-light: #f0ad4e;
|
||||
$orange: #e28a0d;
|
||||
$orange-dark: #c2760c;
|
||||
|
||||
// yellow
|
||||
$yellow: #e2ce48;
|
||||
$yellow-dark: #c8b847;
|
||||
$yellow-lighter: #ffffbb;
|
||||
$yellow: #e2ce48;
|
||||
$yellow-dark: #c8b847;
|
||||
|
||||
// pink
|
||||
$pink-light: #e88ce7;
|
||||
$pink: #e06fdf;
|
||||
$pink-dark: #d747d6;
|
||||
$pink-darker: #782d77;
|
||||
$pink-light: #e88ce7;
|
||||
$pink: #e06fdf;
|
||||
$pink-dark: #d747d6;
|
||||
$pink-darker: #782d77;
|
||||
|
||||
// purple
|
||||
$purple-dark: #3e264e;
|
||||
$purple-dark: #3e264e;
|
||||
|
||||
// ranking
|
||||
$gold: #cfb53b;
|
||||
$silver: #c0c0c0;
|
||||
$bronze: #8c7853;
|
||||
$gold: #cfb53b;
|
||||
$silver: #c0c0c0;
|
||||
$bronze: #8c7853;
|
||||
|
||||
// WH effects
|
||||
$wh-color-magnetar: $pink;
|
||||
$wh-color-redgiant: $red;
|
||||
$wh-color-pulsar: $blue;
|
||||
$wh-color-wolfrayet: $orange;
|
||||
$wh-color-cataclysmic: $yellow-lighter;
|
||||
$wh-color-blackhole: $black;
|
||||
$wh-color-magnetar: $pink;
|
||||
$wh-color-redgiant: $red;
|
||||
$wh-color-pulsar: $blue;
|
||||
$wh-color-wolfrayet: $orange;
|
||||
$wh-color-cataclysmic: $yellow-lighter;
|
||||
$wh-color-blackhole: $black;
|
||||
|
||||
// system security status
|
||||
$system-color-sec-0-0: #be0000;
|
||||
@@ -91,8 +89,8 @@ $system-color-sec-0-9: #39bf99;
|
||||
$system-color-sec-1-0: #28c0bf;
|
||||
|
||||
// brand colors
|
||||
$brand-primary: $teal-dark !default;
|
||||
$brand-success: $green-dark !default;
|
||||
$brand-info: $blue-dark !default;
|
||||
$brand-warning: $orange !default;
|
||||
$brand-danger: $red-darker !default;
|
||||
$brand-primary: $teal-dark !default;
|
||||
$brand-success: $green-dark !default;
|
||||
$brand-info: $blue-dark !default;
|
||||
$brand-warning: $orange !default;
|
||||
$brand-danger: $red-darker !default;
|
||||
@@ -981,8 +981,8 @@ input[type="email"]{
|
||||
border-style: solid;
|
||||
border-width: 5px 0 5px 5px;
|
||||
border-left-color: $gray-darker;
|
||||
margin-top: 5px;
|
||||
margin-right: -10px;
|
||||
margin-top: 4px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
&:hover{
|
||||
|
||||
@@ -741,26 +741,30 @@ table{
|
||||
}
|
||||
|
||||
// system info status =============================================================================
|
||||
.pf-system-info-rally{
|
||||
.pf-system-head{
|
||||
background-color: $pink-darker;
|
||||
.pf-rally{
|
||||
text-shadow: 1px 1px 2px $gray-darkest; // improve text contrast
|
||||
background-color: $pink-darker;
|
||||
|
||||
@include background-image(linear-gradient(-45deg,
|
||||
$purple-dark 25%,
|
||||
transparent 25%,
|
||||
transparent 50%,
|
||||
$purple-dark 50%,
|
||||
$purple-dark 75%,
|
||||
transparent 75%,
|
||||
transparent));
|
||||
background-size:25px 25px;
|
||||
-webkit-animation:move 3s linear infinite;
|
||||
-moz-animation:move 3s linear infinite;
|
||||
-ms-animation:move 3s linear infinite;
|
||||
animation:move 3s linear infinite;
|
||||
}
|
||||
@include background-image(linear-gradient(-45deg,
|
||||
$purple-dark 25%,
|
||||
transparent 25%,
|
||||
transparent 50%,
|
||||
$purple-dark 50%,
|
||||
$purple-dark 75%,
|
||||
transparent 75%,
|
||||
transparent));
|
||||
background-size: 25px 25px;
|
||||
-webkit-animation: move 2.5s linear infinite;
|
||||
-moz-animation: move 2.5s linear infinite;
|
||||
-ms-animation: move 2.5s linear infinite;
|
||||
animation: move 2.5s linear infinite;
|
||||
}
|
||||
|
||||
.pf-system-info-rally{
|
||||
.pf-system-head{
|
||||
@extend .pf-rally;
|
||||
}
|
||||
}
|
||||
|
||||
// system security status =========================================================================
|
||||
|
||||
|
||||
@@ -764,6 +764,7 @@ $mapWrapperMaxWidth: $mapWidth + 35px;
|
||||
|
||||
// context menu =======================================================================================================
|
||||
.dropdown-menu{
|
||||
min-width: 150px; // overwrite default
|
||||
font-family: $font-family-bold;
|
||||
z-index: 1050; // over tooltips
|
||||
will-change: opacity, top, left, transform;
|
||||
@@ -785,20 +786,36 @@ $mapWrapperMaxWidth: $mapWidth + 35px;
|
||||
}
|
||||
|
||||
// top menu
|
||||
&[role]>li{
|
||||
position: relative; // otherwise :before indicator gets to height
|
||||
&:before{
|
||||
@include navigation-active-indicator(left);
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
}
|
||||
&[role] > li{
|
||||
|
||||
&:hover:before{
|
||||
left: -4px;
|
||||
opacity: 1;
|
||||
&:not(.disabled){
|
||||
position: relative; // otherwise :before indicator gets to height
|
||||
&:before{
|
||||
@include navigation-active-indicator(left);
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&:hover:before{
|
||||
left: -4px;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > li {
|
||||
|
||||
&.disabled{
|
||||
cursor: not-allowed;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
& > a {
|
||||
padding: 3px 8px; // overwrite default
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// tooltip for a system with active user (they are not positioned within the system element)
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.fa-sync, .fa-search-plus{
|
||||
.fa-sync, .fa-search{
|
||||
@extend .pf-dialog-icon-button;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user