- Fixed broken "Account settings" dialog where "map share toggles" did not save, closed #889, closed #911
This commit is contained in:
@@ -243,7 +243,7 @@ class User extends Controller\Controller{
|
||||
public function saveAccount(\Base $f3){
|
||||
$data = $f3->get('POST');
|
||||
|
||||
$return = (object) [];
|
||||
$return = (object)[];
|
||||
$return->error = [];
|
||||
|
||||
$captcha = $f3->get(self::SESSION_CAPTCHA_ACCOUNT_UPDATE);
|
||||
@@ -253,7 +253,7 @@ class User extends Controller\Controller{
|
||||
|
||||
$newUserData = null;
|
||||
|
||||
if( isset($data['formData']) ){
|
||||
if(isset($data['formData'])){
|
||||
$formData = $data['formData'];
|
||||
|
||||
try{
|
||||
@@ -261,18 +261,12 @@ class User extends Controller\Controller{
|
||||
$user = $activeCharacter->getUser();
|
||||
|
||||
// captcha is send -> check captcha ---------------------------------------------------------------
|
||||
if(
|
||||
isset($formData['captcha']) &&
|
||||
!empty($formData['captcha'])
|
||||
){
|
||||
if(isset($formData['captcha']) && !empty($formData['captcha'])){
|
||||
if($formData['captcha'] === $captcha){
|
||||
// change/set sensitive user data requires captcha!
|
||||
|
||||
// set username
|
||||
if(
|
||||
isset($formData['name']) &&
|
||||
!empty($formData['name'])
|
||||
){
|
||||
if(isset($formData['name']) && !empty($formData['name'])){
|
||||
$user->name = $formData['name'];
|
||||
}
|
||||
|
||||
@@ -293,7 +287,7 @@ class User extends Controller\Controller{
|
||||
|
||||
}else{
|
||||
// captcha was send but not valid -> return error
|
||||
$captchaError = (object) [];
|
||||
$captchaError = (object)[];
|
||||
$captchaError->type = 'error';
|
||||
$captchaError->message = 'Captcha does not match';
|
||||
$return->error[] = $captchaError;
|
||||
|
||||
42
config.rb
42
config.rb
@@ -1,42 +0,0 @@
|
||||
# Compass 1.0.1 (Polaris)
|
||||
|
||||
require 'compass/import-once/activate'
|
||||
|
||||
# Require any additional compass plugins here.
|
||||
|
||||
|
||||
http_path = "/"
|
||||
# project_path = ''
|
||||
# css_dir = 'public/css'
|
||||
# sass_dir = 'sass'
|
||||
images_dir = 'public/img'
|
||||
generated_images_path = 'img_cache'
|
||||
# javascripts_dir = 'javascripts'
|
||||
fonts_dir = 'public/fonts'
|
||||
|
||||
# You can select your preferred output style here (can be overridden via the command line):
|
||||
# output_style = :expanded or :nested or :compact or :compressed
|
||||
output_style = :compressed
|
||||
|
||||
# To enable relative paths to assets via compass helper functions. Uncomment:
|
||||
relative_assets = true
|
||||
|
||||
# To disable debugging comments that display the original location of your selectors. Uncomment:
|
||||
line_comments = false
|
||||
|
||||
# Define the location of a the compass / sass cache directory.
|
||||
cache_path = '.sass-cache'
|
||||
|
||||
# If you prefer the indented syntax, you might want to regenerate this
|
||||
# project again passing --syntax sass, or you can uncomment this:
|
||||
# preferred_syntax = :sass
|
||||
# and then run:
|
||||
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
|
||||
|
||||
# custom SASS functions
|
||||
module Sass::Script::Functions
|
||||
def currentYear()
|
||||
# return Sass::Script::String.new(Time.now.to_s)
|
||||
return Sass::Script::String.new(Time.now.year.to_s)
|
||||
end
|
||||
end
|
||||
12
gulpfile.js
12
gulpfile.js
@@ -833,8 +833,10 @@ gulp.task('task:configProduction',
|
||||
* updates JS destination move to (final) dir
|
||||
*/
|
||||
gulp.task('task:updateJsDest', gulp.series(
|
||||
'task:gzipJsAssets',
|
||||
'task:brotliJsAssets',
|
||||
gulp.parallel(
|
||||
'task:gzipJsAssets',
|
||||
'task:brotliJsAssets'
|
||||
),
|
||||
'task:renameJsDest',
|
||||
// 'task:printJsSummary',
|
||||
'task:cleanJsBuild'
|
||||
@@ -913,8 +915,10 @@ gulp.task(
|
||||
gulp.series(
|
||||
'task:buildCss',
|
||||
// 'task:cleanCss',
|
||||
'task:gzipCssAssets',
|
||||
'task:brotliCssAssets',
|
||||
gulp.parallel(
|
||||
'task:gzipCssAssets',
|
||||
'task:brotliCssAssets'
|
||||
),
|
||||
// 'task:printJsSummary',
|
||||
'task:notifyCssDone'
|
||||
)
|
||||
|
||||
@@ -165,7 +165,7 @@ requirejs.config({
|
||||
deps: ['bootstrap']
|
||||
},
|
||||
bootstrapToggle: {
|
||||
deps: ['jquery']
|
||||
deps: ['jquery', 'bootstrap']
|
||||
},
|
||||
lazyload: {
|
||||
deps: ['jquery']
|
||||
|
||||
@@ -7,7 +7,7 @@ define([
|
||||
'app/init',
|
||||
'app/util',
|
||||
'datatables.loader'
|
||||
], ($, Init, Util) => {
|
||||
], ($, Init, Util, dtLoader) => {
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -73,21 +73,23 @@ define([
|
||||
|
||||
setPageObserver();
|
||||
|
||||
let temp = $('.dataTable').dataTable({
|
||||
pageLength: 100,
|
||||
paging: true,
|
||||
ordering: true,
|
||||
autoWidth: false,
|
||||
hover: false,
|
||||
language: {
|
||||
emptyTable: 'No entries',
|
||||
zeroRecords: 'No entries found',
|
||||
lengthMenu: 'Show _MENU_ entries',
|
||||
info: 'Showing _START_ to _END_ of _TOTAL_ entries'
|
||||
},
|
||||
data: null // use DOM data overwrites [] default -> data.loader.js
|
||||
dtLoader.initDefaultConfig({
|
||||
breakpoints: Init.breakpoints
|
||||
}).then(() => {
|
||||
let temp = $('.dataTable').dataTable({
|
||||
pageLength: 100,
|
||||
paging: true,
|
||||
ordering: true,
|
||||
autoWidth: false,
|
||||
hover: false,
|
||||
language: {
|
||||
emptyTable: 'No entries',
|
||||
zeroRecords: 'No entries found',
|
||||
lengthMenu: 'Show _MENU_ entries',
|
||||
info: 'Showing _START_ to _END_ of _TOTAL_ entries'
|
||||
},
|
||||
data: null // use DOM data overwrites [] default -> data.loader.js
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,5 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/counter',
|
||||
'app/promises/promise.deferred',
|
||||
'app/promises/promise.timeout',
|
||||
'datatables.net',
|
||||
@@ -10,12 +8,16 @@ define([
|
||||
'datatables.net-buttons-html',
|
||||
'datatables.net-responsive',
|
||||
'datatables.net-rowgroup'
|
||||
], ($, Init, Counter, DeferredPromise, TimeoutPromise) => {
|
||||
|
||||
], ($, DeferredPromise, TimeoutPromise) => {
|
||||
'use strict';
|
||||
|
||||
// all Datatables stuff is available...
|
||||
let initDefaultDatatablesConfig = () => {
|
||||
/**
|
||||
* DataTable dependencies loaded
|
||||
* -> init default DataTables config (e.g. custom plugins)
|
||||
* @param options
|
||||
* @returns {Promise}
|
||||
*/
|
||||
let initDefaultConfig = options => new Promise(resolve => {
|
||||
|
||||
$.extend(true, $.fn.dataTable.defaults, {
|
||||
pageLength: -1,
|
||||
@@ -27,14 +29,14 @@ define([
|
||||
info: '_START_ - _END_ of _TOTAL_ entries'
|
||||
},
|
||||
responsive: {
|
||||
breakpoints: Init.breakpoints,
|
||||
breakpoints: options.breakpoints,
|
||||
details: false
|
||||
},
|
||||
columnDefs: [],
|
||||
data: []
|
||||
});
|
||||
|
||||
// global open event
|
||||
// global destroy event
|
||||
$(document).on('destroy.dt', '.dataTable ', function(e, settings){
|
||||
let table = $(this);
|
||||
let tableApi = new $.fn.dataTable.Api(settings);
|
||||
@@ -44,8 +46,9 @@ define([
|
||||
tableApi.endProcesses();
|
||||
}
|
||||
|
||||
// remove all active counters in table
|
||||
Counter.destroyTimestampCounter(table, true);
|
||||
if(typeof options.onDestroy === 'function'){
|
||||
options.onDestroy(table);
|
||||
}
|
||||
});
|
||||
|
||||
// Status Plugin ==============================================================================================
|
||||
@@ -159,7 +162,11 @@ define([
|
||||
cFeature: 'S',
|
||||
sFeature: 'StatusTable'
|
||||
});
|
||||
};
|
||||
|
||||
initDefaultDatatablesConfig();
|
||||
resolve();
|
||||
});
|
||||
|
||||
return {
|
||||
initDefaultConfig
|
||||
};
|
||||
});
|
||||
@@ -71,9 +71,7 @@ define([
|
||||
* shows the logging dialog
|
||||
*/
|
||||
let showDialog = () => {
|
||||
// dialog content
|
||||
|
||||
requirejs(['text!templates/dialog/task_manager.html', 'mustache', 'datatables.loader'], function(templateTaskManagerDialog, Mustache){
|
||||
requirejs(['text!templates/dialog/task_manager.html', 'mustache'], function(templateTaskManagerDialog, Mustache){
|
||||
let data = {
|
||||
id: config.taskDialogId,
|
||||
dialogDynamicAreaClass: Util.config.dynamicAreaClass,
|
||||
|
||||
@@ -287,280 +287,278 @@ define([
|
||||
$.fn.initLocalOverlay = function(mapId){
|
||||
let parentElements = $(this);
|
||||
|
||||
require(['datatables.loader'], () => {
|
||||
parentElements.each(function(){
|
||||
let parentElement = $(this);
|
||||
parentElements.each(function(){
|
||||
let parentElement = $(this);
|
||||
|
||||
let overlay = $('<div>', {
|
||||
class: [config.overlayClass, config.overlayLocalClass].join(' ')
|
||||
});
|
||||
let overlay = $('<div>', {
|
||||
class: [config.overlayClass, config.overlayLocalClass].join(' ')
|
||||
});
|
||||
|
||||
let content = $('<div>', {
|
||||
class: [ 'text-right', config.overlayLocalContentClass].join(' ')
|
||||
});
|
||||
let content = $('<div>', {
|
||||
class: [ 'text-right', config.overlayLocalContentClass].join(' ')
|
||||
});
|
||||
|
||||
// crate new route table
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'order-column', config.overlayLocalTableClass].join(' ')
|
||||
});
|
||||
// crate new route table
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'order-column', config.overlayLocalTableClass].join(' ')
|
||||
});
|
||||
|
||||
let overlayMain = $('<div>', {
|
||||
text: '',
|
||||
class: config.overlayLocalMainClass
|
||||
}).append(
|
||||
$('<i>', {
|
||||
class: ['fas', 'fa-chevron-down', 'fa-fw', 'pf-animate-rotate', config.overlayLocalTriggerClass].join(' ')
|
||||
}),
|
||||
$('<span>', {
|
||||
class: ['badge', 'txt-color', 'txt-color-red', config.overlayLocalUsersClass].join(' '),
|
||||
text: 0
|
||||
}),
|
||||
$('<div>', {
|
||||
class: config.overlayLocalJumpsClass
|
||||
}).append(
|
||||
$('<span>', {
|
||||
class: ['badge', 'txt-color', 'txt-color-grayLight'].join(' '),
|
||||
text: MapUtil.config.defaultLocalJumpRadius
|
||||
}).attr('title', 'jumps')
|
||||
)
|
||||
);
|
||||
|
||||
let headline = $('<div>', {
|
||||
class: config.overlayLocalHeadlineClass
|
||||
let overlayMain = $('<div>', {
|
||||
text: '',
|
||||
class: config.overlayLocalMainClass
|
||||
}).append(
|
||||
$('<i>', {
|
||||
class: ['fas', 'fa-chevron-down', 'fa-fw', 'pf-animate-rotate', config.overlayLocalTriggerClass].join(' ')
|
||||
}),
|
||||
$('<span>', {
|
||||
class: ['badge', 'txt-color', 'txt-color-red', config.overlayLocalUsersClass].join(' '),
|
||||
text: 0
|
||||
}),
|
||||
$('<div>', {
|
||||
class: config.overlayLocalJumpsClass
|
||||
}).append(
|
||||
$('<span>', {
|
||||
html: 'Nearby ',
|
||||
class: 'pull-left'
|
||||
}),
|
||||
$('<span>'),
|
||||
$('<span>'),
|
||||
$('<span>', {
|
||||
class: ['badge', ' txt-color', 'txt-color-red'].join(' '),
|
||||
text: 0
|
||||
})
|
||||
);
|
||||
class: ['badge', 'txt-color', 'txt-color-grayLight'].join(' '),
|
||||
text: MapUtil.config.defaultLocalJumpRadius
|
||||
}).attr('title', 'jumps')
|
||||
)
|
||||
);
|
||||
|
||||
content.append(headline);
|
||||
content.append(table);
|
||||
// toolbar not used for now
|
||||
// content.append(initToolbar());
|
||||
let headline = $('<div>', {
|
||||
class: config.overlayLocalHeadlineClass
|
||||
}).append(
|
||||
$('<span>', {
|
||||
html: 'Nearby ',
|
||||
class: 'pull-left'
|
||||
}),
|
||||
$('<span>'),
|
||||
$('<span>'),
|
||||
$('<span>', {
|
||||
class: ['badge', ' txt-color', 'txt-color-red'].join(' '),
|
||||
text: 0
|
||||
})
|
||||
);
|
||||
|
||||
overlay.append(overlayMain);
|
||||
overlay.append(content);
|
||||
content.append(headline);
|
||||
content.append(table);
|
||||
// toolbar not used for now
|
||||
// content.append(initToolbar());
|
||||
|
||||
parentElement.append(overlay);
|
||||
overlay.append(overlayMain);
|
||||
overlay.append(content);
|
||||
|
||||
// set observer
|
||||
setOverlayObserver(overlay, mapId);
|
||||
parentElement.append(overlay);
|
||||
|
||||
// init local table ---------------------------------------------------------------------------------------
|
||||
table.on('preDraw.dt', function(e, settings){
|
||||
let table = $(this);
|
||||
let areaMap = table.closest('.' + Util.getMapTabContentAreaClass('map'));
|
||||
// set observer
|
||||
setOverlayObserver(overlay, mapId);
|
||||
|
||||
// areaMap should always exist
|
||||
if(areaMap && areaMap.length) {
|
||||
// check available maxHeight for "locale" table based on current map height (resizable)
|
||||
let mapHeight = areaMap[0].offsetHeight;
|
||||
let localOverlay = MapOverlayUtil.getMapOverlay(table, 'local');
|
||||
let paginationElement = localOverlay.find('.dataTables_paginate');
|
||||
// init local table ---------------------------------------------------------------------------------------
|
||||
table.on('preDraw.dt', function(e, settings){
|
||||
let table = $(this);
|
||||
let areaMap = table.closest('.' + Util.getMapTabContentAreaClass('map'));
|
||||
|
||||
let tableApi = table.DataTable();
|
||||
let pageInfo = tableApi.page.info();
|
||||
let localTableRowHeight = 26;
|
||||
// areaMap should always exist
|
||||
if(areaMap && areaMap.length) {
|
||||
// check available maxHeight for "locale" table based on current map height (resizable)
|
||||
let mapHeight = areaMap[0].offsetHeight;
|
||||
let localOverlay = MapOverlayUtil.getMapOverlay(table, 'local');
|
||||
let paginationElement = localOverlay.find('.dataTables_paginate');
|
||||
|
||||
let localTop = localOverlay[0].offsetTop;
|
||||
let bottomSpace = 38 + 10; // "timer" overlay + some spacing top
|
||||
bottomSpace += 16 + 5 + 5; // horizontal scrollBar height + some spacing top + bottom
|
||||
let localHeightMax = mapHeight - bottomSpace - localTop; // max available for local overlay
|
||||
let tableApi = table.DataTable();
|
||||
let pageInfo = tableApi.page.info();
|
||||
let localTableRowHeight = 26;
|
||||
|
||||
let localTableBodyMaxHeight = localHeightMax - 53; // - headline height + <thead> height
|
||||
let newPageLength = Math.floor(localTableBodyMaxHeight / localTableRowHeight);
|
||||
if(pageInfo.recordsDisplay > newPageLength){
|
||||
// show pagination and limit page length
|
||||
localTableBodyMaxHeight -= 30; // - pagination height
|
||||
newPageLength = Math.floor(localTableBodyMaxHeight / localTableRowHeight);
|
||||
}
|
||||
let localTop = localOverlay[0].offsetTop;
|
||||
let bottomSpace = 38 + 10; // "timer" overlay + some spacing top
|
||||
bottomSpace += 16 + 5 + 5; // horizontal scrollBar height + some spacing top + bottom
|
||||
let localHeightMax = mapHeight - bottomSpace - localTop; // max available for local overlay
|
||||
|
||||
if(pageInfo.length !== newPageLength){
|
||||
tableApi.page.len(newPageLength);
|
||||
let localTableBodyMaxHeight = localHeightMax - 53; // - headline height + <thead> height
|
||||
let newPageLength = Math.floor(localTableBodyMaxHeight / localTableRowHeight);
|
||||
if(pageInfo.recordsDisplay > newPageLength){
|
||||
// show pagination and limit page length
|
||||
localTableBodyMaxHeight -= 30; // - pagination height
|
||||
newPageLength = Math.floor(localTableBodyMaxHeight / localTableRowHeight);
|
||||
}
|
||||
|
||||
// page length changed -> show/hide pagination
|
||||
pageInfo = tableApi.page.info();
|
||||
if(pageInfo.pages <= 1){
|
||||
paginationElement.hide();
|
||||
}else{
|
||||
paginationElement.show();
|
||||
}
|
||||
if(pageInfo.length !== newPageLength){
|
||||
tableApi.page.len(newPageLength);
|
||||
|
||||
// page length changed -> show/hide pagination
|
||||
pageInfo = tableApi.page.info();
|
||||
if(pageInfo.pages <= 1){
|
||||
paginationElement.hide();
|
||||
}else{
|
||||
paginationElement.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
table.on('draw.dt', function(e, settings){
|
||||
// init table tooltips
|
||||
$(this).find('td').initTooltips({
|
||||
placement: 'left'
|
||||
});
|
||||
table.on('draw.dt', function(e, settings){
|
||||
// init table tooltips
|
||||
$(this).find('td').initTooltips({
|
||||
placement: 'left'
|
||||
});
|
||||
});
|
||||
|
||||
// table init complete
|
||||
table.on('init.dt', function(){
|
||||
// init table head tooltips
|
||||
$(this).initTooltips({
|
||||
placement: 'top'
|
||||
});
|
||||
// table init complete
|
||||
table.on('init.dt', function(){
|
||||
// init table head tooltips
|
||||
$(this).initTooltips({
|
||||
placement: 'top'
|
||||
});
|
||||
});
|
||||
|
||||
let localTable = table.DataTable({
|
||||
pageLength: 5,
|
||||
paging: true,
|
||||
pagingType: 'simple',
|
||||
lengthChange: false,
|
||||
ordering: true,
|
||||
order: [ 0, 'asc' ],
|
||||
info: false,
|
||||
searching: false,
|
||||
hover: false,
|
||||
responsive: false, // true "hides" some columns on init (why?)
|
||||
rowId: function(rowData){
|
||||
return 'pf-local-row_' + rowData.id; // characterId
|
||||
},
|
||||
language: {
|
||||
emptyTable: '<span>You are alone</span>',
|
||||
paginate: {
|
||||
next: ' ',
|
||||
previous: ' '
|
||||
let localTable = table.DataTable({
|
||||
pageLength: 5,
|
||||
paging: true,
|
||||
pagingType: 'simple',
|
||||
lengthChange: false,
|
||||
ordering: true,
|
||||
order: [ 0, 'asc' ],
|
||||
info: false,
|
||||
searching: false,
|
||||
hover: false,
|
||||
responsive: false, // true "hides" some columns on init (why?)
|
||||
rowId: function(rowData){
|
||||
return 'pf-local-row_' + rowData.id; // characterId
|
||||
},
|
||||
language: {
|
||||
emptyTable: '<span>You are alone</span>',
|
||||
paginate: {
|
||||
next: ' ',
|
||||
previous: ' '
|
||||
}
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
orderable: true,
|
||||
title: '<span title="jumps" data-toggle="tooltip"> </span>',
|
||||
width: '1px',
|
||||
className: [Util.config.helpDefaultClass, 'text-center'].join(' '),
|
||||
data: 'jumps',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
if(value === 0){
|
||||
value = '<i class="fas fa-map-marker-alt"></i>';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, 'log.system.name');
|
||||
}
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
orderable: true,
|
||||
title: '<span title="jumps" data-toggle="tooltip"> </span>',
|
||||
width: '1px',
|
||||
className: [Util.config.helpDefaultClass, 'text-center'].join(' '),
|
||||
data: 'jumps',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
if(value === 0){
|
||||
value = '<i class="fas fa-map-marker-alt"></i>';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
},{
|
||||
targets: 1,
|
||||
orderable: false,
|
||||
title: '',
|
||||
width: '26px',
|
||||
className: [Util.config.helpDefaultClass, 'text-center', config.tableCellImageClass].join(' '),
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data.typeName;
|
||||
if(type === 'display'){
|
||||
value = '<img src="' + Util.eveImageUrl('types', data.typeId) + '"/>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, 'log.ship.typeName');
|
||||
}
|
||||
}, {
|
||||
targets: 2,
|
||||
orderable: true,
|
||||
title: 'ship name',
|
||||
width: '80px',
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data.name;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis80Class + '">' + data.name + '</div>';
|
||||
}
|
||||
return value;
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, 'log.system.name');
|
||||
}
|
||||
},{
|
||||
targets: 1,
|
||||
orderable: false,
|
||||
title: '',
|
||||
width: '26px',
|
||||
className: [Util.config.helpDefaultClass, 'text-center', config.tableCellImageClass].join(' '),
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data.typeName;
|
||||
if(type === 'display'){
|
||||
value = '<img src="' + Util.eveImageUrl('types', data.typeId) + '"/>';
|
||||
}
|
||||
return value;
|
||||
sort: 'name'
|
||||
}
|
||||
},{
|
||||
targets: 3,
|
||||
orderable: true,
|
||||
title: 'pilot',
|
||||
data: 'name',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis90Class + '">' + data + '</div>';
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, 'log.ship.typeName');
|
||||
}
|
||||
}, {
|
||||
targets: 2,
|
||||
orderable: true,
|
||||
title: 'ship name',
|
||||
width: '80px',
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data.name;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis80Class + '">' + data.name + '</div>';
|
||||
}
|
||||
return value;
|
||||
},
|
||||
sort: 'name'
|
||||
}
|
||||
},{
|
||||
targets: 3,
|
||||
orderable: true,
|
||||
title: 'pilot',
|
||||
data: 'name',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis90Class + '">' + data + '</div>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},{
|
||||
targets: 4,
|
||||
orderable: false,
|
||||
title: '',
|
||||
width: '10px',
|
||||
className: [Util.config.helpDefaultClass].join(' '),
|
||||
data: 'log',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = '';
|
||||
if(type === 'display'){
|
||||
if(data.station && data.station.id > 0){
|
||||
value = '<i class="fas fa-home"></i>';
|
||||
}else if(data.structure && data.structure.id > 0){
|
||||
value = '<i class="fas fa-industry"></i>';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let selector = '';
|
||||
if(cellData.station && cellData.station.id > 0){
|
||||
selector = 'log.station.name';
|
||||
}else if(cellData.structure && cellData.structure.id > 0){
|
||||
selector = 'log.structure.name';
|
||||
}
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, selector);
|
||||
}
|
||||
},{
|
||||
targets: 5,
|
||||
orderable: false,
|
||||
title: '<i title="open ingame" data-toggle="tooltip" class="fas fa-id-card text-right"></i>',
|
||||
width: '10px',
|
||||
className: [config.tableCellActionClass].join(' '),
|
||||
data: 'id',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
value = '<i class="fas fa-id-card ' + config.tableCellActionIconClass + '"></i>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
// open character information window (ingame)
|
||||
$(cell).on('click', { tableApi: this.DataTable(), cellData: cellData }, function(e){
|
||||
let cellData = e.data.tableApi.cell(this).data();
|
||||
Util.openIngameWindow(e.data.cellData);
|
||||
});
|
||||
return value;
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
},{
|
||||
targets: 4,
|
||||
orderable: false,
|
||||
title: '',
|
||||
width: '10px',
|
||||
className: [Util.config.helpDefaultClass].join(' '),
|
||||
data: 'log',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = '';
|
||||
if(type === 'display'){
|
||||
if(data.station && data.station.id > 0){
|
||||
value = '<i class="fas fa-home"></i>';
|
||||
}else if(data.structure && data.structure.id > 0){
|
||||
value = '<i class="fas fa-industry"></i>';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let selector = '';
|
||||
if(cellData.station && cellData.station.id > 0){
|
||||
selector = 'log.station.name';
|
||||
}else if(cellData.structure && cellData.structure.id > 0){
|
||||
selector = 'log.structure.name';
|
||||
}
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, selector);
|
||||
}
|
||||
},{
|
||||
targets: 5,
|
||||
orderable: false,
|
||||
title: '<i title="open ingame" data-toggle="tooltip" class="fas fa-id-card text-right"></i>',
|
||||
width: '10px',
|
||||
className: [config.tableCellActionClass].join(' '),
|
||||
data: 'id',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
value = '<i class="fas fa-id-card ' + config.tableCellActionIconClass + '"></i>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
// open character information window (ingame)
|
||||
$(cell).on('click', { tableApi: this.DataTable(), cellData: cellData }, function(e){
|
||||
let cellData = e.data.tableApi.cell(this).data();
|
||||
Util.openIngameWindow(e.data.cellData);
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1436,7 +1436,8 @@ define([
|
||||
let setMapDefaultOptionsExecutor = (resolve, reject) => {
|
||||
// update main menu options based on the active map -----------------------------------------------
|
||||
$(document).trigger('pf:updateMenuOptions', {
|
||||
mapConfig: mapConfig
|
||||
menuGroup: 'mapOptions',
|
||||
payload: mapConfig
|
||||
});
|
||||
|
||||
// init compact system layout ---------------------------------------------------------------------
|
||||
|
||||
@@ -8,12 +8,13 @@ define([
|
||||
'app/util',
|
||||
'app/logging',
|
||||
'app/page',
|
||||
'app/counter',
|
||||
'app/map/worker',
|
||||
'app/map/util',
|
||||
'app/module_map',
|
||||
'app/key',
|
||||
'app/ui/form_element'
|
||||
], ($, Init, Util, Logging, Page, MapWorker, MapUtil, ModuleMap) => {
|
||||
], ($, Init, Util, Logging, Page, Counter, MapWorker, MapUtil, ModuleMap) => {
|
||||
'use strict';
|
||||
|
||||
// main update intervals/trigger (heartbeat)
|
||||
@@ -157,6 +158,27 @@ define([
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* init DataTables plugin + dependencies + default config
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
let initDataTables = () => new Promise(resolve => {
|
||||
let payload = {
|
||||
action: 'initDataTables',
|
||||
data: false
|
||||
};
|
||||
|
||||
require(['datatables.loader'], dtLoader => {
|
||||
dtLoader.initDefaultConfig({
|
||||
breakpoints: Init.breakpoints,
|
||||
onDestroy: table => {
|
||||
// remove all active counters in table
|
||||
Counter.destroyTimestampCounter(table, true);
|
||||
}
|
||||
}).then(() => resolve(payload));
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* init main mapModule
|
||||
* -> initData() needs to be resolved first!
|
||||
@@ -570,11 +592,12 @@ define([
|
||||
Promise.all([
|
||||
initApp(rootEl),
|
||||
initData(),
|
||||
getMapAccessData()
|
||||
getMapAccessData(),
|
||||
initDataTables(),
|
||||
])
|
||||
.then(([mapModule, initData, accessData]) => Promise.all([
|
||||
initMapModule(mapModule),
|
||||
initMapWorker(mapModule,accessData),
|
||||
initMapWorker(mapModule, accessData),
|
||||
initUnload(mapModule)
|
||||
]))
|
||||
.then(([payloadMapModule, payloadMapWorker]) => {
|
||||
|
||||
@@ -65,15 +65,17 @@ define([
|
||||
systemIntelModuleClass: 'pf-system-intel-module', // module wrapper (intel)
|
||||
};
|
||||
|
||||
let menuBtnTypes = {
|
||||
'info': {class: 'list-group-item-info'},
|
||||
'danger': {class: 'list-group-item-danger'},
|
||||
'warning': {class: 'list-group-item-warning'}
|
||||
};
|
||||
|
||||
let programStatusCounter = 0; // current count down in s until next status change is possible
|
||||
let programStatusInterval = false; // interval timer until next status change is possible
|
||||
|
||||
/**
|
||||
* get menu button class by type
|
||||
* -> if no type -> get default class (all buttons)
|
||||
* @param type
|
||||
* @returns {string}
|
||||
*/
|
||||
let getMenuBtnClass = type => 'list-group-item' + (['info', 'danger', 'warning'].includes(type) ? `-${type}` : '');
|
||||
|
||||
/**
|
||||
* set an DOM element to fullscreen mode
|
||||
* @ see https://developer.mozilla.org/docs/Web/API/Fullscreen_API
|
||||
@@ -187,16 +189,22 @@ define([
|
||||
|
||||
switch(itemConfig.type){
|
||||
case 'button':
|
||||
let className = Util.getObjVal(menuBtnTypes, itemConfig.btnType + '.class') || '';
|
||||
className += itemConfig.class || '';
|
||||
let classNames = [getMenuBtnClass(), getMenuBtnClass(itemConfig.btnType)];
|
||||
if(itemConfig.class){
|
||||
classNames.push(itemConfig.class);
|
||||
}
|
||||
|
||||
item = $('<a>', {
|
||||
id: itemConfig.id || undefined,
|
||||
class: 'list-group-item ' + className,
|
||||
class: classNames.join(' '),
|
||||
href: itemConfig.href || undefined,
|
||||
html: ' ' + itemConfig.label
|
||||
});
|
||||
|
||||
if(itemConfig.group){
|
||||
item.attr('data-group', itemConfig.group);
|
||||
}
|
||||
|
||||
if(itemConfig.action){
|
||||
item.attr('data-action', itemConfig.action);
|
||||
if(itemConfig.target){
|
||||
@@ -273,8 +281,10 @@ define([
|
||||
label: 'Settings'
|
||||
},{
|
||||
type: 'button',
|
||||
class: 'loading',
|
||||
label: 'Account',
|
||||
icon: 'fa-user',
|
||||
group: 'userOptions',
|
||||
action: 'ShowSettingsDialog'
|
||||
}, document.fullscreenEnabled ? {
|
||||
type: 'button',
|
||||
@@ -338,6 +348,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Settings',
|
||||
icon: 'fa-cogs',
|
||||
group: 'mapOptions',
|
||||
action: 'ShowMapSettings',
|
||||
data: {tab: 'settings'}
|
||||
},{
|
||||
@@ -346,6 +357,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Grid snapping',
|
||||
icon: 'fa-th',
|
||||
group: 'mapOptions',
|
||||
action: 'MapOption',
|
||||
target: 'map',
|
||||
data: {option: 'mapSnapToGrid', toggle: true}
|
||||
@@ -355,6 +367,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Magnetizing',
|
||||
icon: 'fa-magnet',
|
||||
group: 'mapOptions',
|
||||
action: 'MapOption',
|
||||
target: 'map',
|
||||
data: {option: 'mapMagnetizer', toggle: true}
|
||||
@@ -364,6 +377,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Signatures',
|
||||
icon: 'fa-link',
|
||||
group: 'mapOptions',
|
||||
action: 'MapOption',
|
||||
target: 'map',
|
||||
data: {option: 'mapSignatureOverlays', toggle: true}
|
||||
@@ -373,6 +387,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Compact',
|
||||
icon: 'fa-compress',
|
||||
group: 'mapOptions',
|
||||
action: 'MapOption',
|
||||
target: 'map',
|
||||
data: {option: 'mapCompact', toggle: true}
|
||||
@@ -769,13 +784,23 @@ define([
|
||||
});
|
||||
|
||||
// disable menu links based on current map config ---------------------------------------------------------
|
||||
documentElement.on('pf:updateMenuOptions', (e, data) => {
|
||||
let hasRightMapDelete = MapUtil.checkRight('map_delete', data.mapConfig);
|
||||
$('#' + Util.config.menuButtonMapDeleteId).toggleClass('disabled', !hasRightMapDelete);
|
||||
documentElement.on('pf:updateMenuOptions', (e, {menuGroup, payload}) => {
|
||||
let buttonGroup = document.querySelectorAll(`.${getMenuBtnClass()}[data-group="${menuGroup}"]`);
|
||||
// find menu buttons by menuGroup
|
||||
switch(menuGroup){
|
||||
case 'mapOptions':
|
||||
// payload is mapConfig
|
||||
let hasRightMapDelete = MapUtil.checkRight('map_delete', payload);
|
||||
document.getElementById(Util.config.menuButtonMapDeleteId).classList.toggle('disabled', !hasRightMapDelete);
|
||||
|
||||
// "loading" menu options require an active map
|
||||
// -> active map now available -> remove loading class
|
||||
$('.' + config.pageMenuRightClass + ' .loading').removeClass('loading');
|
||||
// active map -> remove loading classes
|
||||
[...buttonGroup].forEach(button => button.classList.remove('loading'));
|
||||
break;
|
||||
case 'userOptions':
|
||||
// payload is boolean (true if valid character data exists)
|
||||
[...buttonGroup].forEach(button => button.classList.toggle('loading', !payload));
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
// update header links with current map data --------------------------------------------------------------
|
||||
@@ -799,6 +824,15 @@ define([
|
||||
|
||||
// changes in current userData ----------------------------------------------------------------------------
|
||||
documentElement.on('pf:changedUserData', (e, userData, changes) => {
|
||||
// update menu buttons (en/disable)
|
||||
if(changes.characterId){
|
||||
documentElement.trigger('pf:updateMenuOptions', {
|
||||
menuGroup: 'userOptions',
|
||||
payload: Boolean(Util.getObjVal(userData, 'character.id'))
|
||||
});
|
||||
}
|
||||
|
||||
// update header
|
||||
updateHeaderUserData(userData, changes).then();
|
||||
});
|
||||
|
||||
|
||||
@@ -189,16 +189,9 @@ define([
|
||||
dialogElement.initTooltips();
|
||||
|
||||
form.initFormValidation();
|
||||
});
|
||||
|
||||
// show dialog
|
||||
accountSettingsDialog.modal('show');
|
||||
|
||||
// events for tab change
|
||||
accountSettingsDialog.find('.navbar a').on('shown.bs.tab', function(e){
|
||||
|
||||
// init "toggle" switches on current active tab
|
||||
accountSettingsDialog.find( $(this).attr('href') ).find('input[data-toggle="toggle"][type="checkbox"]').bootstrapToggle({
|
||||
// init "toggle" switches
|
||||
dialogElement.find('input[type="checkbox"][data-toggle="toggle"]').bootstrapToggle({
|
||||
on: '<i class="fas fa-fw fa-check"></i> Enable',
|
||||
off: 'Disable <i class="fas fa-fw fa-ban"></i>',
|
||||
onstyle: 'success',
|
||||
@@ -206,9 +199,10 @@ define([
|
||||
width: 100,
|
||||
height: 30
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// show dialog
|
||||
accountSettingsDialog.modal('show');
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -28,7 +28,7 @@ define([
|
||||
* show jump info dialog
|
||||
*/
|
||||
$.fn.showJumpInfoDialog = function(){
|
||||
requirejs(['text!templates/dialog/jump_info.html', 'mustache', 'datatables.loader'], (template, Mustache) => {
|
||||
requirejs(['text!templates/dialog/jump_info.html', 'mustache'], (template, Mustache) => {
|
||||
let iconShattered = '<i class="fas fa-fw fa-chart-pie pf-system-sec-unknown"></i>';
|
||||
let iconDrifter = '<i class="fas fa-fw fa-wave-square pf-system-sec-drifter"></i>';
|
||||
|
||||
|
||||
@@ -1316,7 +1316,7 @@ define([
|
||||
// "log" tab -> get "Origin", not all config options are set in mapData
|
||||
let mapDataOrigin = Util.getCurrentMapData(mapData.config.id);
|
||||
|
||||
requirejs(['text!templates/dialog/map_info.html', 'mustache', 'datatables.loader'], (template, Mustache) => {
|
||||
requirejs(['text!templates/dialog/map_info.html', 'mustache'], (template, Mustache) => {
|
||||
|
||||
let data = {
|
||||
dialogSummaryContainerId: config.dialogMapInfoSummaryId,
|
||||
|
||||
@@ -772,7 +772,7 @@ define([
|
||||
* show activity stats dialog
|
||||
*/
|
||||
$.fn.showStatsDialog = function(){
|
||||
requirejs(['text!templates/dialog/stats.html', 'mustache', 'datatables.loader'], (template, Mustache) => {
|
||||
requirejs(['text!templates/dialog/stats.html', 'mustache'], (template, Mustache) => {
|
||||
// get current statistics map settings
|
||||
let logActivityEnabled = false;
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
|
||||
@@ -26,172 +26,169 @@ define([
|
||||
* show system effect dialog
|
||||
*/
|
||||
$.fn.showSystemEffectInfoDialog = function(){
|
||||
requirejs(['datatables.loader'], () => {
|
||||
let rowElement = $('<div>', {
|
||||
class: 'row'
|
||||
});
|
||||
|
||||
let rowElement = $('<div>', {
|
||||
class: 'row'
|
||||
let systemEffectData = Util.getSystemEffectData();
|
||||
|
||||
// last active (hover) table columnName
|
||||
let lastActiveColName = null;
|
||||
|
||||
let colCount = 0;
|
||||
for(let [effectName, effectData] of Object.entries(systemEffectData.wh)){
|
||||
colCount++;
|
||||
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.systemEffectTableClass].join(' ')
|
||||
});
|
||||
|
||||
let systemEffectData = Util.getSystemEffectData();
|
||||
let tbody = $('<tbody>');
|
||||
let thead = $('<thead>');
|
||||
|
||||
// last active (hover) table columnName
|
||||
let lastActiveColName = null;
|
||||
let rows = [];
|
||||
|
||||
let colCount = 0;
|
||||
for(let [effectName, effectData] of Object.entries(systemEffectData.wh)){
|
||||
colCount++;
|
||||
// get formatted system effect name
|
||||
let systemEffectName = MapUtil.getEffectInfoForSystem(effectName, 'name');
|
||||
let systemEffectClass = MapUtil.getEffectInfoForSystem(effectName, 'class');
|
||||
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.systemEffectTableClass].join(' ')
|
||||
});
|
||||
for(let [areaId, areaData] of Object.entries(effectData)){
|
||||
let systemType = 'C' + areaId;
|
||||
let securityClass = Util.getSecurityClassForSystem(systemType);
|
||||
|
||||
let tbody = $('<tbody>');
|
||||
let thead = $('<thead>');
|
||||
if(areaId === '1'){
|
||||
rows.push( $('<tr>') );
|
||||
rows.push( $('<tr>') );
|
||||
thead.append( rows[0] );
|
||||
thead.append( rows[1] );
|
||||
|
||||
let rows = [];
|
||||
rows[0].append(
|
||||
$('<th>').html(' ' + systemEffectName).prepend(
|
||||
$('<i>', {
|
||||
class: ['fas', 'fa-square', systemEffectClass].join(' ')
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
// get formatted system effect name
|
||||
let systemEffectName = MapUtil.getEffectInfoForSystem(effectName, 'name');
|
||||
let systemEffectClass = MapUtil.getEffectInfoForSystem(effectName, 'class');
|
||||
rows[1].append($('<th>'));
|
||||
}
|
||||
|
||||
for(let [areaId, areaData] of Object.entries(effectData)){
|
||||
let systemType = 'C' + areaId;
|
||||
let securityClass = Util.getSecurityClassForSystem(systemType);
|
||||
rows[0].append( $('<th>', {
|
||||
class: ['text-right', 'col-xs-1', securityClass].join(' ')
|
||||
}).text( systemType ).attr('data-name', systemType));
|
||||
|
||||
rows[1].append( $('<th>', {
|
||||
class: ['text-right', 'txt-color', 'txt-color-grayLight'].join(' ')
|
||||
}).text(Util.getSystemEffectMultiplierByAreaId(parseInt(areaId)) + ' x').attr('data-name', systemType));
|
||||
|
||||
for(let [i, data] of Object.entries(areaData)){
|
||||
i = parseInt(i);
|
||||
if(areaId === '1'){
|
||||
rows.push( $('<tr>') );
|
||||
rows.push( $('<tr>') );
|
||||
thead.append( rows[0] );
|
||||
thead.append( rows[1] );
|
||||
tbody.append(rows[i + 2]);
|
||||
|
||||
rows[0].append(
|
||||
$('<th>').html(' ' + systemEffectName).prepend(
|
||||
$('<i>', {
|
||||
class: ['fas', 'fa-square', systemEffectClass].join(' ')
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
rows[1].append($('<th>'));
|
||||
// add label
|
||||
rows[i + 2].append( $('<td>').text( data.effect ));
|
||||
}
|
||||
|
||||
rows[0].append( $('<th>', {
|
||||
class: ['text-right', 'col-xs-1', securityClass].join(' ')
|
||||
}).text( systemType ).attr('data-name', systemType));
|
||||
|
||||
rows[1].append( $('<th>', {
|
||||
class: ['text-right', 'txt-color', 'txt-color-grayLight'].join(' ')
|
||||
}).text(Util.getSystemEffectMultiplierByAreaId(parseInt(areaId)) + ' x').attr('data-name', systemType));
|
||||
|
||||
for(let [i, data] of Object.entries(areaData)){
|
||||
i = parseInt(i);
|
||||
if(areaId === '1'){
|
||||
rows.push( $('<tr>') );
|
||||
tbody.append(rows[i + 2]);
|
||||
|
||||
// add label
|
||||
rows[i + 2].append( $('<td>').text( data.effect ));
|
||||
}
|
||||
|
||||
|
||||
rows[i + 2].append( $('<td>', {
|
||||
class: 'text-right'
|
||||
}).text( data.value ));
|
||||
}
|
||||
rows[i + 2].append( $('<td>', {
|
||||
class: 'text-right'
|
||||
}).text( data.value ));
|
||||
}
|
||||
|
||||
let colElement = $('<div>', {
|
||||
class: ['col-md-6'].join(' ')
|
||||
}).append(
|
||||
$('<div>', {
|
||||
class: [Util.config.dynamicAreaClass].join(' ')
|
||||
}).append(
|
||||
table.append(thead).append(tbody)
|
||||
)
|
||||
);
|
||||
|
||||
rowElement.append(colElement);
|
||||
|
||||
// add clearfix after even col count
|
||||
if(colCount % 2 === 0){
|
||||
rowElement.append(
|
||||
$('<div>', {
|
||||
class: ['clearfix', 'visible-md', 'visible-lg'].join(' ')
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
cache.systemEffectDialog = rowElement;
|
||||
}
|
||||
|
||||
let effectsDialog = bootbox.dialog({
|
||||
className: config.systemEffectDialogClass,
|
||||
title: 'System effect information',
|
||||
message: cache.systemEffectDialog,
|
||||
size: 'large',
|
||||
show: false
|
||||
});
|
||||
let colElement = $('<div>', {
|
||||
class: ['col-md-6'].join(' ')
|
||||
}).append(
|
||||
$('<div>', {
|
||||
class: [Util.config.dynamicAreaClass].join(' ')
|
||||
}).append(
|
||||
table.append(thead).append(tbody)
|
||||
)
|
||||
);
|
||||
|
||||
effectsDialog.on('show.bs.modal', function(e){
|
||||
let headerAll = $();
|
||||
let columnsAll = $();
|
||||
rowElement.append(colElement);
|
||||
|
||||
let removeColumnHighlight = () => {
|
||||
headerAll.removeClass('colHighlight');
|
||||
columnsAll.removeClass('colHighlight');
|
||||
};
|
||||
// add clearfix after even col count
|
||||
if(colCount % 2 === 0){
|
||||
rowElement.append(
|
||||
$('<div>', {
|
||||
class: ['clearfix', 'visible-md', 'visible-lg'].join(' ')
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
let tableApis = $(this).find('table').DataTable({
|
||||
pageLength: -1,
|
||||
paging: false,
|
||||
lengthChange: false,
|
||||
ordering: false,
|
||||
searching: false,
|
||||
info: false,
|
||||
columnDefs: [],
|
||||
data: null, // use DOM data overwrites [] default -> data.loader.js
|
||||
initComplete: function(settings, json){
|
||||
let tableApi = this.api();
|
||||
cache.systemEffectDialog = rowElement;
|
||||
}
|
||||
|
||||
tableApi.tables().nodes().to$().on('mouseover', 'td', function(){
|
||||
// inside table cell -> get current hover colIndex
|
||||
let colIndex = tableApi.cell(this).index().column;
|
||||
let colName = tableApi.column(colIndex).header().dataset.name || '';
|
||||
|
||||
if(colName !== lastActiveColName){
|
||||
removeColumnHighlight();
|
||||
|
||||
lastActiveColName = colName;
|
||||
|
||||
if(colName.length){
|
||||
// active column changed -> highlight same colName on other tables
|
||||
let tableApis = $.fn.dataTable.tables({ visible: false, api: true })
|
||||
.tables('.' + config.systemEffectTableClass);
|
||||
|
||||
let columns = tableApis.columns([colName + ':name']);
|
||||
columns.header().flatten().to$().addClass('colHighlight');
|
||||
columns.nodes().flatten().to$().addClass('colHighlight');
|
||||
}
|
||||
}
|
||||
}).on('mouseleave', function(){
|
||||
// no longer inside table
|
||||
lastActiveColName = null;
|
||||
removeColumnHighlight();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// table cells will not change so we should cache them once
|
||||
headerAll = tableApis.columns().header().to$();
|
||||
columnsAll = tableApis.cells().nodes().to$();
|
||||
});
|
||||
|
||||
effectsDialog.on('hide.bs.modal', function(e){
|
||||
// destroy logTable
|
||||
$(this).find('table').DataTable().destroy(true);
|
||||
});
|
||||
|
||||
effectsDialog.modal('show');
|
||||
let effectsDialog = bootbox.dialog({
|
||||
className: config.systemEffectDialogClass,
|
||||
title: 'System effect information',
|
||||
message: cache.systemEffectDialog,
|
||||
size: 'large',
|
||||
show: false
|
||||
});
|
||||
|
||||
effectsDialog.on('show.bs.modal', function(e){
|
||||
let headerAll = $();
|
||||
let columnsAll = $();
|
||||
|
||||
let removeColumnHighlight = () => {
|
||||
headerAll.removeClass('colHighlight');
|
||||
columnsAll.removeClass('colHighlight');
|
||||
};
|
||||
|
||||
let tableApis = $(this).find('table').DataTable({
|
||||
pageLength: -1,
|
||||
paging: false,
|
||||
lengthChange: false,
|
||||
ordering: false,
|
||||
searching: false,
|
||||
info: false,
|
||||
columnDefs: [],
|
||||
data: null, // use DOM data overwrites [] default -> data.loader.js
|
||||
initComplete: function(settings, json){
|
||||
let tableApi = this.api();
|
||||
|
||||
tableApi.tables().nodes().to$().on('mouseover', 'td', function(){
|
||||
// inside table cell -> get current hover colIndex
|
||||
let colIndex = tableApi.cell(this).index().column;
|
||||
let colName = tableApi.column(colIndex).header().dataset.name || '';
|
||||
|
||||
if(colName !== lastActiveColName){
|
||||
removeColumnHighlight();
|
||||
|
||||
lastActiveColName = colName;
|
||||
|
||||
if(colName.length){
|
||||
// active column changed -> highlight same colName on other tables
|
||||
let tableApis = $.fn.dataTable.tables({ visible: false, api: true })
|
||||
.tables('.' + config.systemEffectTableClass);
|
||||
|
||||
let columns = tableApis.columns([colName + ':name']);
|
||||
columns.header().flatten().to$().addClass('colHighlight');
|
||||
columns.nodes().flatten().to$().addClass('colHighlight');
|
||||
}
|
||||
}
|
||||
}).on('mouseleave', function(){
|
||||
// no longer inside table
|
||||
lastActiveColName = null;
|
||||
removeColumnHighlight();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// table cells will not change so we should cache them once
|
||||
headerAll = tableApis.columns().header().to$();
|
||||
columnsAll = tableApis.cells().nodes().to$();
|
||||
});
|
||||
|
||||
effectsDialog.on('hide.bs.modal', function(e){
|
||||
// destroy logTable
|
||||
$(this).find('table').DataTable().destroy(true);
|
||||
});
|
||||
|
||||
effectsDialog.modal('show');
|
||||
};
|
||||
});
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -165,7 +165,7 @@ requirejs.config({
|
||||
deps: ['bootstrap']
|
||||
},
|
||||
bootstrapToggle: {
|
||||
deps: ['jquery']
|
||||
deps: ['jquery', 'bootstrap']
|
||||
},
|
||||
lazyload: {
|
||||
deps: ['jquery']
|
||||
|
||||
@@ -7,7 +7,7 @@ define([
|
||||
'app/init',
|
||||
'app/util',
|
||||
'datatables.loader'
|
||||
], ($, Init, Util) => {
|
||||
], ($, Init, Util, dtLoader) => {
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -73,21 +73,23 @@ define([
|
||||
|
||||
setPageObserver();
|
||||
|
||||
let temp = $('.dataTable').dataTable({
|
||||
pageLength: 100,
|
||||
paging: true,
|
||||
ordering: true,
|
||||
autoWidth: false,
|
||||
hover: false,
|
||||
language: {
|
||||
emptyTable: 'No entries',
|
||||
zeroRecords: 'No entries found',
|
||||
lengthMenu: 'Show _MENU_ entries',
|
||||
info: 'Showing _START_ to _END_ of _TOTAL_ entries'
|
||||
},
|
||||
data: null // use DOM data overwrites [] default -> data.loader.js
|
||||
dtLoader.initDefaultConfig({
|
||||
breakpoints: Init.breakpoints
|
||||
}).then(() => {
|
||||
let temp = $('.dataTable').dataTable({
|
||||
pageLength: 100,
|
||||
paging: true,
|
||||
ordering: true,
|
||||
autoWidth: false,
|
||||
hover: false,
|
||||
language: {
|
||||
emptyTable: 'No entries',
|
||||
zeroRecords: 'No entries found',
|
||||
lengthMenu: 'Show _MENU_ entries',
|
||||
info: 'Showing _START_ to _END_ of _TOTAL_ entries'
|
||||
},
|
||||
data: null // use DOM data overwrites [] default -> data.loader.js
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,5 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/counter',
|
||||
'app/promises/promise.deferred',
|
||||
'app/promises/promise.timeout',
|
||||
'datatables.net',
|
||||
@@ -10,12 +8,16 @@ define([
|
||||
'datatables.net-buttons-html',
|
||||
'datatables.net-responsive',
|
||||
'datatables.net-rowgroup'
|
||||
], ($, Init, Counter, DeferredPromise, TimeoutPromise) => {
|
||||
|
||||
], ($, DeferredPromise, TimeoutPromise) => {
|
||||
'use strict';
|
||||
|
||||
// all Datatables stuff is available...
|
||||
let initDefaultDatatablesConfig = () => {
|
||||
/**
|
||||
* DataTable dependencies loaded
|
||||
* -> init default DataTables config (e.g. custom plugins)
|
||||
* @param options
|
||||
* @returns {Promise}
|
||||
*/
|
||||
let initDefaultConfig = options => new Promise(resolve => {
|
||||
|
||||
$.extend(true, $.fn.dataTable.defaults, {
|
||||
pageLength: -1,
|
||||
@@ -27,14 +29,14 @@ define([
|
||||
info: '_START_ - _END_ of _TOTAL_ entries'
|
||||
},
|
||||
responsive: {
|
||||
breakpoints: Init.breakpoints,
|
||||
breakpoints: options.breakpoints,
|
||||
details: false
|
||||
},
|
||||
columnDefs: [],
|
||||
data: []
|
||||
});
|
||||
|
||||
// global open event
|
||||
// global destroy event
|
||||
$(document).on('destroy.dt', '.dataTable ', function(e, settings){
|
||||
let table = $(this);
|
||||
let tableApi = new $.fn.dataTable.Api(settings);
|
||||
@@ -44,8 +46,9 @@ define([
|
||||
tableApi.endProcesses();
|
||||
}
|
||||
|
||||
// remove all active counters in table
|
||||
Counter.destroyTimestampCounter(table, true);
|
||||
if(typeof options.onDestroy === 'function'){
|
||||
options.onDestroy(table);
|
||||
}
|
||||
});
|
||||
|
||||
// Status Plugin ==============================================================================================
|
||||
@@ -159,7 +162,11 @@ define([
|
||||
cFeature: 'S',
|
||||
sFeature: 'StatusTable'
|
||||
});
|
||||
};
|
||||
|
||||
initDefaultDatatablesConfig();
|
||||
resolve();
|
||||
});
|
||||
|
||||
return {
|
||||
initDefaultConfig
|
||||
};
|
||||
});
|
||||
@@ -71,9 +71,7 @@ define([
|
||||
* shows the logging dialog
|
||||
*/
|
||||
let showDialog = () => {
|
||||
// dialog content
|
||||
|
||||
requirejs(['text!templates/dialog/task_manager.html', 'mustache', 'datatables.loader'], function(templateTaskManagerDialog, Mustache){
|
||||
requirejs(['text!templates/dialog/task_manager.html', 'mustache'], function(templateTaskManagerDialog, Mustache){
|
||||
let data = {
|
||||
id: config.taskDialogId,
|
||||
dialogDynamicAreaClass: Util.config.dynamicAreaClass,
|
||||
|
||||
@@ -287,280 +287,278 @@ define([
|
||||
$.fn.initLocalOverlay = function(mapId){
|
||||
let parentElements = $(this);
|
||||
|
||||
require(['datatables.loader'], () => {
|
||||
parentElements.each(function(){
|
||||
let parentElement = $(this);
|
||||
parentElements.each(function(){
|
||||
let parentElement = $(this);
|
||||
|
||||
let overlay = $('<div>', {
|
||||
class: [config.overlayClass, config.overlayLocalClass].join(' ')
|
||||
});
|
||||
let overlay = $('<div>', {
|
||||
class: [config.overlayClass, config.overlayLocalClass].join(' ')
|
||||
});
|
||||
|
||||
let content = $('<div>', {
|
||||
class: [ 'text-right', config.overlayLocalContentClass].join(' ')
|
||||
});
|
||||
let content = $('<div>', {
|
||||
class: [ 'text-right', config.overlayLocalContentClass].join(' ')
|
||||
});
|
||||
|
||||
// crate new route table
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'order-column', config.overlayLocalTableClass].join(' ')
|
||||
});
|
||||
// crate new route table
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'order-column', config.overlayLocalTableClass].join(' ')
|
||||
});
|
||||
|
||||
let overlayMain = $('<div>', {
|
||||
text: '',
|
||||
class: config.overlayLocalMainClass
|
||||
}).append(
|
||||
$('<i>', {
|
||||
class: ['fas', 'fa-chevron-down', 'fa-fw', 'pf-animate-rotate', config.overlayLocalTriggerClass].join(' ')
|
||||
}),
|
||||
$('<span>', {
|
||||
class: ['badge', 'txt-color', 'txt-color-red', config.overlayLocalUsersClass].join(' '),
|
||||
text: 0
|
||||
}),
|
||||
$('<div>', {
|
||||
class: config.overlayLocalJumpsClass
|
||||
}).append(
|
||||
$('<span>', {
|
||||
class: ['badge', 'txt-color', 'txt-color-grayLight'].join(' '),
|
||||
text: MapUtil.config.defaultLocalJumpRadius
|
||||
}).attr('title', 'jumps')
|
||||
)
|
||||
);
|
||||
|
||||
let headline = $('<div>', {
|
||||
class: config.overlayLocalHeadlineClass
|
||||
let overlayMain = $('<div>', {
|
||||
text: '',
|
||||
class: config.overlayLocalMainClass
|
||||
}).append(
|
||||
$('<i>', {
|
||||
class: ['fas', 'fa-chevron-down', 'fa-fw', 'pf-animate-rotate', config.overlayLocalTriggerClass].join(' ')
|
||||
}),
|
||||
$('<span>', {
|
||||
class: ['badge', 'txt-color', 'txt-color-red', config.overlayLocalUsersClass].join(' '),
|
||||
text: 0
|
||||
}),
|
||||
$('<div>', {
|
||||
class: config.overlayLocalJumpsClass
|
||||
}).append(
|
||||
$('<span>', {
|
||||
html: 'Nearby ',
|
||||
class: 'pull-left'
|
||||
}),
|
||||
$('<span>'),
|
||||
$('<span>'),
|
||||
$('<span>', {
|
||||
class: ['badge', ' txt-color', 'txt-color-red'].join(' '),
|
||||
text: 0
|
||||
})
|
||||
);
|
||||
class: ['badge', 'txt-color', 'txt-color-grayLight'].join(' '),
|
||||
text: MapUtil.config.defaultLocalJumpRadius
|
||||
}).attr('title', 'jumps')
|
||||
)
|
||||
);
|
||||
|
||||
content.append(headline);
|
||||
content.append(table);
|
||||
// toolbar not used for now
|
||||
// content.append(initToolbar());
|
||||
let headline = $('<div>', {
|
||||
class: config.overlayLocalHeadlineClass
|
||||
}).append(
|
||||
$('<span>', {
|
||||
html: 'Nearby ',
|
||||
class: 'pull-left'
|
||||
}),
|
||||
$('<span>'),
|
||||
$('<span>'),
|
||||
$('<span>', {
|
||||
class: ['badge', ' txt-color', 'txt-color-red'].join(' '),
|
||||
text: 0
|
||||
})
|
||||
);
|
||||
|
||||
overlay.append(overlayMain);
|
||||
overlay.append(content);
|
||||
content.append(headline);
|
||||
content.append(table);
|
||||
// toolbar not used for now
|
||||
// content.append(initToolbar());
|
||||
|
||||
parentElement.append(overlay);
|
||||
overlay.append(overlayMain);
|
||||
overlay.append(content);
|
||||
|
||||
// set observer
|
||||
setOverlayObserver(overlay, mapId);
|
||||
parentElement.append(overlay);
|
||||
|
||||
// init local table ---------------------------------------------------------------------------------------
|
||||
table.on('preDraw.dt', function(e, settings){
|
||||
let table = $(this);
|
||||
let areaMap = table.closest('.' + Util.getMapTabContentAreaClass('map'));
|
||||
// set observer
|
||||
setOverlayObserver(overlay, mapId);
|
||||
|
||||
// areaMap should always exist
|
||||
if(areaMap && areaMap.length) {
|
||||
// check available maxHeight for "locale" table based on current map height (resizable)
|
||||
let mapHeight = areaMap[0].offsetHeight;
|
||||
let localOverlay = MapOverlayUtil.getMapOverlay(table, 'local');
|
||||
let paginationElement = localOverlay.find('.dataTables_paginate');
|
||||
// init local table ---------------------------------------------------------------------------------------
|
||||
table.on('preDraw.dt', function(e, settings){
|
||||
let table = $(this);
|
||||
let areaMap = table.closest('.' + Util.getMapTabContentAreaClass('map'));
|
||||
|
||||
let tableApi = table.DataTable();
|
||||
let pageInfo = tableApi.page.info();
|
||||
let localTableRowHeight = 26;
|
||||
// areaMap should always exist
|
||||
if(areaMap && areaMap.length) {
|
||||
// check available maxHeight for "locale" table based on current map height (resizable)
|
||||
let mapHeight = areaMap[0].offsetHeight;
|
||||
let localOverlay = MapOverlayUtil.getMapOverlay(table, 'local');
|
||||
let paginationElement = localOverlay.find('.dataTables_paginate');
|
||||
|
||||
let localTop = localOverlay[0].offsetTop;
|
||||
let bottomSpace = 38 + 10; // "timer" overlay + some spacing top
|
||||
bottomSpace += 16 + 5 + 5; // horizontal scrollBar height + some spacing top + bottom
|
||||
let localHeightMax = mapHeight - bottomSpace - localTop; // max available for local overlay
|
||||
let tableApi = table.DataTable();
|
||||
let pageInfo = tableApi.page.info();
|
||||
let localTableRowHeight = 26;
|
||||
|
||||
let localTableBodyMaxHeight = localHeightMax - 53; // - headline height + <thead> height
|
||||
let newPageLength = Math.floor(localTableBodyMaxHeight / localTableRowHeight);
|
||||
if(pageInfo.recordsDisplay > newPageLength){
|
||||
// show pagination and limit page length
|
||||
localTableBodyMaxHeight -= 30; // - pagination height
|
||||
newPageLength = Math.floor(localTableBodyMaxHeight / localTableRowHeight);
|
||||
}
|
||||
let localTop = localOverlay[0].offsetTop;
|
||||
let bottomSpace = 38 + 10; // "timer" overlay + some spacing top
|
||||
bottomSpace += 16 + 5 + 5; // horizontal scrollBar height + some spacing top + bottom
|
||||
let localHeightMax = mapHeight - bottomSpace - localTop; // max available for local overlay
|
||||
|
||||
if(pageInfo.length !== newPageLength){
|
||||
tableApi.page.len(newPageLength);
|
||||
let localTableBodyMaxHeight = localHeightMax - 53; // - headline height + <thead> height
|
||||
let newPageLength = Math.floor(localTableBodyMaxHeight / localTableRowHeight);
|
||||
if(pageInfo.recordsDisplay > newPageLength){
|
||||
// show pagination and limit page length
|
||||
localTableBodyMaxHeight -= 30; // - pagination height
|
||||
newPageLength = Math.floor(localTableBodyMaxHeight / localTableRowHeight);
|
||||
}
|
||||
|
||||
// page length changed -> show/hide pagination
|
||||
pageInfo = tableApi.page.info();
|
||||
if(pageInfo.pages <= 1){
|
||||
paginationElement.hide();
|
||||
}else{
|
||||
paginationElement.show();
|
||||
}
|
||||
if(pageInfo.length !== newPageLength){
|
||||
tableApi.page.len(newPageLength);
|
||||
|
||||
// page length changed -> show/hide pagination
|
||||
pageInfo = tableApi.page.info();
|
||||
if(pageInfo.pages <= 1){
|
||||
paginationElement.hide();
|
||||
}else{
|
||||
paginationElement.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
table.on('draw.dt', function(e, settings){
|
||||
// init table tooltips
|
||||
$(this).find('td').initTooltips({
|
||||
placement: 'left'
|
||||
});
|
||||
table.on('draw.dt', function(e, settings){
|
||||
// init table tooltips
|
||||
$(this).find('td').initTooltips({
|
||||
placement: 'left'
|
||||
});
|
||||
});
|
||||
|
||||
// table init complete
|
||||
table.on('init.dt', function(){
|
||||
// init table head tooltips
|
||||
$(this).initTooltips({
|
||||
placement: 'top'
|
||||
});
|
||||
// table init complete
|
||||
table.on('init.dt', function(){
|
||||
// init table head tooltips
|
||||
$(this).initTooltips({
|
||||
placement: 'top'
|
||||
});
|
||||
});
|
||||
|
||||
let localTable = table.DataTable({
|
||||
pageLength: 5,
|
||||
paging: true,
|
||||
pagingType: 'simple',
|
||||
lengthChange: false,
|
||||
ordering: true,
|
||||
order: [ 0, 'asc' ],
|
||||
info: false,
|
||||
searching: false,
|
||||
hover: false,
|
||||
responsive: false, // true "hides" some columns on init (why?)
|
||||
rowId: function(rowData){
|
||||
return 'pf-local-row_' + rowData.id; // characterId
|
||||
},
|
||||
language: {
|
||||
emptyTable: '<span>You are alone</span>',
|
||||
paginate: {
|
||||
next: ' ',
|
||||
previous: ' '
|
||||
let localTable = table.DataTable({
|
||||
pageLength: 5,
|
||||
paging: true,
|
||||
pagingType: 'simple',
|
||||
lengthChange: false,
|
||||
ordering: true,
|
||||
order: [ 0, 'asc' ],
|
||||
info: false,
|
||||
searching: false,
|
||||
hover: false,
|
||||
responsive: false, // true "hides" some columns on init (why?)
|
||||
rowId: function(rowData){
|
||||
return 'pf-local-row_' + rowData.id; // characterId
|
||||
},
|
||||
language: {
|
||||
emptyTable: '<span>You are alone</span>',
|
||||
paginate: {
|
||||
next: ' ',
|
||||
previous: ' '
|
||||
}
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
orderable: true,
|
||||
title: '<span title="jumps" data-toggle="tooltip"> </span>',
|
||||
width: '1px',
|
||||
className: [Util.config.helpDefaultClass, 'text-center'].join(' '),
|
||||
data: 'jumps',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
if(value === 0){
|
||||
value = '<i class="fas fa-map-marker-alt"></i>';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, 'log.system.name');
|
||||
}
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
targets: 0,
|
||||
orderable: true,
|
||||
title: '<span title="jumps" data-toggle="tooltip"> </span>',
|
||||
width: '1px',
|
||||
className: [Util.config.helpDefaultClass, 'text-center'].join(' '),
|
||||
data: 'jumps',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
if(value === 0){
|
||||
value = '<i class="fas fa-map-marker-alt"></i>';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
},{
|
||||
targets: 1,
|
||||
orderable: false,
|
||||
title: '',
|
||||
width: '26px',
|
||||
className: [Util.config.helpDefaultClass, 'text-center', config.tableCellImageClass].join(' '),
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data.typeName;
|
||||
if(type === 'display'){
|
||||
value = '<img src="' + Util.eveImageUrl('types', data.typeId) + '"/>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, 'log.ship.typeName');
|
||||
}
|
||||
}, {
|
||||
targets: 2,
|
||||
orderable: true,
|
||||
title: 'ship name',
|
||||
width: '80px',
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data.name;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis80Class + '">' + data.name + '</div>';
|
||||
}
|
||||
return value;
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, 'log.system.name');
|
||||
}
|
||||
},{
|
||||
targets: 1,
|
||||
orderable: false,
|
||||
title: '',
|
||||
width: '26px',
|
||||
className: [Util.config.helpDefaultClass, 'text-center', config.tableCellImageClass].join(' '),
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data.typeName;
|
||||
if(type === 'display'){
|
||||
value = '<img src="' + Util.eveImageUrl('types', data.typeId) + '"/>';
|
||||
}
|
||||
return value;
|
||||
sort: 'name'
|
||||
}
|
||||
},{
|
||||
targets: 3,
|
||||
orderable: true,
|
||||
title: 'pilot',
|
||||
data: 'name',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis90Class + '">' + data + '</div>';
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, 'log.ship.typeName');
|
||||
}
|
||||
}, {
|
||||
targets: 2,
|
||||
orderable: true,
|
||||
title: 'ship name',
|
||||
width: '80px',
|
||||
data: 'log.ship',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data.name;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis80Class + '">' + data.name + '</div>';
|
||||
}
|
||||
return value;
|
||||
},
|
||||
sort: 'name'
|
||||
}
|
||||
},{
|
||||
targets: 3,
|
||||
orderable: true,
|
||||
title: 'pilot',
|
||||
data: 'name',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis90Class + '">' + data + '</div>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},{
|
||||
targets: 4,
|
||||
orderable: false,
|
||||
title: '',
|
||||
width: '10px',
|
||||
className: [Util.config.helpDefaultClass].join(' '),
|
||||
data: 'log',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = '';
|
||||
if(type === 'display'){
|
||||
if(data.station && data.station.id > 0){
|
||||
value = '<i class="fas fa-home"></i>';
|
||||
}else if(data.structure && data.structure.id > 0){
|
||||
value = '<i class="fas fa-industry"></i>';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let selector = '';
|
||||
if(cellData.station && cellData.station.id > 0){
|
||||
selector = 'log.station.name';
|
||||
}else if(cellData.structure && cellData.structure.id > 0){
|
||||
selector = 'log.structure.name';
|
||||
}
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, selector);
|
||||
}
|
||||
},{
|
||||
targets: 5,
|
||||
orderable: false,
|
||||
title: '<i title="open ingame" data-toggle="tooltip" class="fas fa-id-card text-right"></i>',
|
||||
width: '10px',
|
||||
className: [config.tableCellActionClass].join(' '),
|
||||
data: 'id',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
value = '<i class="fas fa-id-card ' + config.tableCellActionIconClass + '"></i>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
// open character information window (ingame)
|
||||
$(cell).on('click', { tableApi: this.DataTable(), cellData: cellData }, function(e){
|
||||
let cellData = e.data.tableApi.cell(this).data();
|
||||
Util.openIngameWindow(e.data.cellData);
|
||||
});
|
||||
return value;
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
},{
|
||||
targets: 4,
|
||||
orderable: false,
|
||||
title: '',
|
||||
width: '10px',
|
||||
className: [Util.config.helpDefaultClass].join(' '),
|
||||
data: 'log',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = '';
|
||||
if(type === 'display'){
|
||||
if(data.station && data.station.id > 0){
|
||||
value = '<i class="fas fa-home"></i>';
|
||||
}else if(data.structure && data.structure.id > 0){
|
||||
value = '<i class="fas fa-industry"></i>';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
let selector = '';
|
||||
if(cellData.station && cellData.station.id > 0){
|
||||
selector = 'log.station.name';
|
||||
}else if(cellData.structure && cellData.structure.id > 0){
|
||||
selector = 'log.structure.name';
|
||||
}
|
||||
let api = this.DataTable();
|
||||
initCellTooltip(api, cell, selector);
|
||||
}
|
||||
},{
|
||||
targets: 5,
|
||||
orderable: false,
|
||||
title: '<i title="open ingame" data-toggle="tooltip" class="fas fa-id-card text-right"></i>',
|
||||
width: '10px',
|
||||
className: [config.tableCellActionClass].join(' '),
|
||||
data: 'id',
|
||||
render: {
|
||||
_: (data, type, row, meta) => {
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
value = '<i class="fas fa-id-card ' + config.tableCellActionIconClass + '"></i>';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
createdCell: function(cell, cellData, rowData, rowIndex, colIndex){
|
||||
// open character information window (ingame)
|
||||
$(cell).on('click', { tableApi: this.DataTable(), cellData: cellData }, function(e){
|
||||
let cellData = e.data.tableApi.cell(this).data();
|
||||
Util.openIngameWindow(e.data.cellData);
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1436,7 +1436,8 @@ define([
|
||||
let setMapDefaultOptionsExecutor = (resolve, reject) => {
|
||||
// update main menu options based on the active map -----------------------------------------------
|
||||
$(document).trigger('pf:updateMenuOptions', {
|
||||
mapConfig: mapConfig
|
||||
menuGroup: 'mapOptions',
|
||||
payload: mapConfig
|
||||
});
|
||||
|
||||
// init compact system layout ---------------------------------------------------------------------
|
||||
|
||||
@@ -8,12 +8,13 @@ define([
|
||||
'app/util',
|
||||
'app/logging',
|
||||
'app/page',
|
||||
'app/counter',
|
||||
'app/map/worker',
|
||||
'app/map/util',
|
||||
'app/module_map',
|
||||
'app/key',
|
||||
'app/ui/form_element'
|
||||
], ($, Init, Util, Logging, Page, MapWorker, MapUtil, ModuleMap) => {
|
||||
], ($, Init, Util, Logging, Page, Counter, MapWorker, MapUtil, ModuleMap) => {
|
||||
'use strict';
|
||||
|
||||
// main update intervals/trigger (heartbeat)
|
||||
@@ -157,6 +158,27 @@ define([
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* init DataTables plugin + dependencies + default config
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
let initDataTables = () => new Promise(resolve => {
|
||||
let payload = {
|
||||
action: 'initDataTables',
|
||||
data: false
|
||||
};
|
||||
|
||||
require(['datatables.loader'], dtLoader => {
|
||||
dtLoader.initDefaultConfig({
|
||||
breakpoints: Init.breakpoints,
|
||||
onDestroy: table => {
|
||||
// remove all active counters in table
|
||||
Counter.destroyTimestampCounter(table, true);
|
||||
}
|
||||
}).then(() => resolve(payload));
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* init main mapModule
|
||||
* -> initData() needs to be resolved first!
|
||||
@@ -570,11 +592,12 @@ define([
|
||||
Promise.all([
|
||||
initApp(rootEl),
|
||||
initData(),
|
||||
getMapAccessData()
|
||||
getMapAccessData(),
|
||||
initDataTables(),
|
||||
])
|
||||
.then(([mapModule, initData, accessData]) => Promise.all([
|
||||
initMapModule(mapModule),
|
||||
initMapWorker(mapModule,accessData),
|
||||
initMapWorker(mapModule, accessData),
|
||||
initUnload(mapModule)
|
||||
]))
|
||||
.then(([payloadMapModule, payloadMapWorker]) => {
|
||||
|
||||
@@ -65,15 +65,17 @@ define([
|
||||
systemIntelModuleClass: 'pf-system-intel-module', // module wrapper (intel)
|
||||
};
|
||||
|
||||
let menuBtnTypes = {
|
||||
'info': {class: 'list-group-item-info'},
|
||||
'danger': {class: 'list-group-item-danger'},
|
||||
'warning': {class: 'list-group-item-warning'}
|
||||
};
|
||||
|
||||
let programStatusCounter = 0; // current count down in s until next status change is possible
|
||||
let programStatusInterval = false; // interval timer until next status change is possible
|
||||
|
||||
/**
|
||||
* get menu button class by type
|
||||
* -> if no type -> get default class (all buttons)
|
||||
* @param type
|
||||
* @returns {string}
|
||||
*/
|
||||
let getMenuBtnClass = type => 'list-group-item' + (['info', 'danger', 'warning'].includes(type) ? `-${type}` : '');
|
||||
|
||||
/**
|
||||
* set an DOM element to fullscreen mode
|
||||
* @ see https://developer.mozilla.org/docs/Web/API/Fullscreen_API
|
||||
@@ -187,16 +189,22 @@ define([
|
||||
|
||||
switch(itemConfig.type){
|
||||
case 'button':
|
||||
let className = Util.getObjVal(menuBtnTypes, itemConfig.btnType + '.class') || '';
|
||||
className += itemConfig.class || '';
|
||||
let classNames = [getMenuBtnClass(), getMenuBtnClass(itemConfig.btnType)];
|
||||
if(itemConfig.class){
|
||||
classNames.push(itemConfig.class);
|
||||
}
|
||||
|
||||
item = $('<a>', {
|
||||
id: itemConfig.id || undefined,
|
||||
class: 'list-group-item ' + className,
|
||||
class: classNames.join(' '),
|
||||
href: itemConfig.href || undefined,
|
||||
html: ' ' + itemConfig.label
|
||||
});
|
||||
|
||||
if(itemConfig.group){
|
||||
item.attr('data-group', itemConfig.group);
|
||||
}
|
||||
|
||||
if(itemConfig.action){
|
||||
item.attr('data-action', itemConfig.action);
|
||||
if(itemConfig.target){
|
||||
@@ -273,8 +281,10 @@ define([
|
||||
label: 'Settings'
|
||||
},{
|
||||
type: 'button',
|
||||
class: 'loading',
|
||||
label: 'Account',
|
||||
icon: 'fa-user',
|
||||
group: 'userOptions',
|
||||
action: 'ShowSettingsDialog'
|
||||
}, document.fullscreenEnabled ? {
|
||||
type: 'button',
|
||||
@@ -338,6 +348,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Settings',
|
||||
icon: 'fa-cogs',
|
||||
group: 'mapOptions',
|
||||
action: 'ShowMapSettings',
|
||||
data: {tab: 'settings'}
|
||||
},{
|
||||
@@ -346,6 +357,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Grid snapping',
|
||||
icon: 'fa-th',
|
||||
group: 'mapOptions',
|
||||
action: 'MapOption',
|
||||
target: 'map',
|
||||
data: {option: 'mapSnapToGrid', toggle: true}
|
||||
@@ -355,6 +367,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Magnetizing',
|
||||
icon: 'fa-magnet',
|
||||
group: 'mapOptions',
|
||||
action: 'MapOption',
|
||||
target: 'map',
|
||||
data: {option: 'mapMagnetizer', toggle: true}
|
||||
@@ -364,6 +377,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Signatures',
|
||||
icon: 'fa-link',
|
||||
group: 'mapOptions',
|
||||
action: 'MapOption',
|
||||
target: 'map',
|
||||
data: {option: 'mapSignatureOverlays', toggle: true}
|
||||
@@ -373,6 +387,7 @@ define([
|
||||
class: 'loading',
|
||||
label: 'Compact',
|
||||
icon: 'fa-compress',
|
||||
group: 'mapOptions',
|
||||
action: 'MapOption',
|
||||
target: 'map',
|
||||
data: {option: 'mapCompact', toggle: true}
|
||||
@@ -769,13 +784,23 @@ define([
|
||||
});
|
||||
|
||||
// disable menu links based on current map config ---------------------------------------------------------
|
||||
documentElement.on('pf:updateMenuOptions', (e, data) => {
|
||||
let hasRightMapDelete = MapUtil.checkRight('map_delete', data.mapConfig);
|
||||
$('#' + Util.config.menuButtonMapDeleteId).toggleClass('disabled', !hasRightMapDelete);
|
||||
documentElement.on('pf:updateMenuOptions', (e, {menuGroup, payload}) => {
|
||||
let buttonGroup = document.querySelectorAll(`.${getMenuBtnClass()}[data-group="${menuGroup}"]`);
|
||||
// find menu buttons by menuGroup
|
||||
switch(menuGroup){
|
||||
case 'mapOptions':
|
||||
// payload is mapConfig
|
||||
let hasRightMapDelete = MapUtil.checkRight('map_delete', payload);
|
||||
document.getElementById(Util.config.menuButtonMapDeleteId).classList.toggle('disabled', !hasRightMapDelete);
|
||||
|
||||
// "loading" menu options require an active map
|
||||
// -> active map now available -> remove loading class
|
||||
$('.' + config.pageMenuRightClass + ' .loading').removeClass('loading');
|
||||
// active map -> remove loading classes
|
||||
[...buttonGroup].forEach(button => button.classList.remove('loading'));
|
||||
break;
|
||||
case 'userOptions':
|
||||
// payload is boolean (true if valid character data exists)
|
||||
[...buttonGroup].forEach(button => button.classList.toggle('loading', !payload));
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
// update header links with current map data --------------------------------------------------------------
|
||||
@@ -799,6 +824,15 @@ define([
|
||||
|
||||
// changes in current userData ----------------------------------------------------------------------------
|
||||
documentElement.on('pf:changedUserData', (e, userData, changes) => {
|
||||
// update menu buttons (en/disable)
|
||||
if(changes.characterId){
|
||||
documentElement.trigger('pf:updateMenuOptions', {
|
||||
menuGroup: 'userOptions',
|
||||
payload: Boolean(Util.getObjVal(userData, 'character.id'))
|
||||
});
|
||||
}
|
||||
|
||||
// update header
|
||||
updateHeaderUserData(userData, changes).then();
|
||||
});
|
||||
|
||||
|
||||
@@ -189,16 +189,9 @@ define([
|
||||
dialogElement.initTooltips();
|
||||
|
||||
form.initFormValidation();
|
||||
});
|
||||
|
||||
// show dialog
|
||||
accountSettingsDialog.modal('show');
|
||||
|
||||
// events for tab change
|
||||
accountSettingsDialog.find('.navbar a').on('shown.bs.tab', function(e){
|
||||
|
||||
// init "toggle" switches on current active tab
|
||||
accountSettingsDialog.find( $(this).attr('href') ).find('input[data-toggle="toggle"][type="checkbox"]').bootstrapToggle({
|
||||
// init "toggle" switches
|
||||
dialogElement.find('input[type="checkbox"][data-toggle="toggle"]').bootstrapToggle({
|
||||
on: '<i class="fas fa-fw fa-check"></i> Enable',
|
||||
off: 'Disable <i class="fas fa-fw fa-ban"></i>',
|
||||
onstyle: 'success',
|
||||
@@ -206,9 +199,10 @@ define([
|
||||
width: 100,
|
||||
height: 30
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// show dialog
|
||||
accountSettingsDialog.modal('show');
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -28,7 +28,7 @@ define([
|
||||
* show jump info dialog
|
||||
*/
|
||||
$.fn.showJumpInfoDialog = function(){
|
||||
requirejs(['text!templates/dialog/jump_info.html', 'mustache', 'datatables.loader'], (template, Mustache) => {
|
||||
requirejs(['text!templates/dialog/jump_info.html', 'mustache'], (template, Mustache) => {
|
||||
let iconShattered = '<i class="fas fa-fw fa-chart-pie pf-system-sec-unknown"></i>';
|
||||
let iconDrifter = '<i class="fas fa-fw fa-wave-square pf-system-sec-drifter"></i>';
|
||||
|
||||
|
||||
@@ -1316,7 +1316,7 @@ define([
|
||||
// "log" tab -> get "Origin", not all config options are set in mapData
|
||||
let mapDataOrigin = Util.getCurrentMapData(mapData.config.id);
|
||||
|
||||
requirejs(['text!templates/dialog/map_info.html', 'mustache', 'datatables.loader'], (template, Mustache) => {
|
||||
requirejs(['text!templates/dialog/map_info.html', 'mustache'], (template, Mustache) => {
|
||||
|
||||
let data = {
|
||||
dialogSummaryContainerId: config.dialogMapInfoSummaryId,
|
||||
|
||||
@@ -772,7 +772,7 @@ define([
|
||||
* show activity stats dialog
|
||||
*/
|
||||
$.fn.showStatsDialog = function(){
|
||||
requirejs(['text!templates/dialog/stats.html', 'mustache', 'datatables.loader'], (template, Mustache) => {
|
||||
requirejs(['text!templates/dialog/stats.html', 'mustache'], (template, Mustache) => {
|
||||
// get current statistics map settings
|
||||
let logActivityEnabled = false;
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
|
||||
@@ -26,172 +26,169 @@ define([
|
||||
* show system effect dialog
|
||||
*/
|
||||
$.fn.showSystemEffectInfoDialog = function(){
|
||||
requirejs(['datatables.loader'], () => {
|
||||
let rowElement = $('<div>', {
|
||||
class: 'row'
|
||||
});
|
||||
|
||||
let rowElement = $('<div>', {
|
||||
class: 'row'
|
||||
let systemEffectData = Util.getSystemEffectData();
|
||||
|
||||
// last active (hover) table columnName
|
||||
let lastActiveColName = null;
|
||||
|
||||
let colCount = 0;
|
||||
for(let [effectName, effectData] of Object.entries(systemEffectData.wh)){
|
||||
colCount++;
|
||||
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.systemEffectTableClass].join(' ')
|
||||
});
|
||||
|
||||
let systemEffectData = Util.getSystemEffectData();
|
||||
let tbody = $('<tbody>');
|
||||
let thead = $('<thead>');
|
||||
|
||||
// last active (hover) table columnName
|
||||
let lastActiveColName = null;
|
||||
let rows = [];
|
||||
|
||||
let colCount = 0;
|
||||
for(let [effectName, effectData] of Object.entries(systemEffectData.wh)){
|
||||
colCount++;
|
||||
// get formatted system effect name
|
||||
let systemEffectName = MapUtil.getEffectInfoForSystem(effectName, 'name');
|
||||
let systemEffectClass = MapUtil.getEffectInfoForSystem(effectName, 'class');
|
||||
|
||||
let table = $('<table>', {
|
||||
class: ['compact', 'stripe', 'order-column', 'row-border', config.systemEffectTableClass].join(' ')
|
||||
});
|
||||
for(let [areaId, areaData] of Object.entries(effectData)){
|
||||
let systemType = 'C' + areaId;
|
||||
let securityClass = Util.getSecurityClassForSystem(systemType);
|
||||
|
||||
let tbody = $('<tbody>');
|
||||
let thead = $('<thead>');
|
||||
if(areaId === '1'){
|
||||
rows.push( $('<tr>') );
|
||||
rows.push( $('<tr>') );
|
||||
thead.append( rows[0] );
|
||||
thead.append( rows[1] );
|
||||
|
||||
let rows = [];
|
||||
rows[0].append(
|
||||
$('<th>').html(' ' + systemEffectName).prepend(
|
||||
$('<i>', {
|
||||
class: ['fas', 'fa-square', systemEffectClass].join(' ')
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
// get formatted system effect name
|
||||
let systemEffectName = MapUtil.getEffectInfoForSystem(effectName, 'name');
|
||||
let systemEffectClass = MapUtil.getEffectInfoForSystem(effectName, 'class');
|
||||
rows[1].append($('<th>'));
|
||||
}
|
||||
|
||||
for(let [areaId, areaData] of Object.entries(effectData)){
|
||||
let systemType = 'C' + areaId;
|
||||
let securityClass = Util.getSecurityClassForSystem(systemType);
|
||||
rows[0].append( $('<th>', {
|
||||
class: ['text-right', 'col-xs-1', securityClass].join(' ')
|
||||
}).text( systemType ).attr('data-name', systemType));
|
||||
|
||||
rows[1].append( $('<th>', {
|
||||
class: ['text-right', 'txt-color', 'txt-color-grayLight'].join(' ')
|
||||
}).text(Util.getSystemEffectMultiplierByAreaId(parseInt(areaId)) + ' x').attr('data-name', systemType));
|
||||
|
||||
for(let [i, data] of Object.entries(areaData)){
|
||||
i = parseInt(i);
|
||||
if(areaId === '1'){
|
||||
rows.push( $('<tr>') );
|
||||
rows.push( $('<tr>') );
|
||||
thead.append( rows[0] );
|
||||
thead.append( rows[1] );
|
||||
tbody.append(rows[i + 2]);
|
||||
|
||||
rows[0].append(
|
||||
$('<th>').html(' ' + systemEffectName).prepend(
|
||||
$('<i>', {
|
||||
class: ['fas', 'fa-square', systemEffectClass].join(' ')
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
rows[1].append($('<th>'));
|
||||
// add label
|
||||
rows[i + 2].append( $('<td>').text( data.effect ));
|
||||
}
|
||||
|
||||
rows[0].append( $('<th>', {
|
||||
class: ['text-right', 'col-xs-1', securityClass].join(' ')
|
||||
}).text( systemType ).attr('data-name', systemType));
|
||||
|
||||
rows[1].append( $('<th>', {
|
||||
class: ['text-right', 'txt-color', 'txt-color-grayLight'].join(' ')
|
||||
}).text(Util.getSystemEffectMultiplierByAreaId(parseInt(areaId)) + ' x').attr('data-name', systemType));
|
||||
|
||||
for(let [i, data] of Object.entries(areaData)){
|
||||
i = parseInt(i);
|
||||
if(areaId === '1'){
|
||||
rows.push( $('<tr>') );
|
||||
tbody.append(rows[i + 2]);
|
||||
|
||||
// add label
|
||||
rows[i + 2].append( $('<td>').text( data.effect ));
|
||||
}
|
||||
|
||||
|
||||
rows[i + 2].append( $('<td>', {
|
||||
class: 'text-right'
|
||||
}).text( data.value ));
|
||||
}
|
||||
rows[i + 2].append( $('<td>', {
|
||||
class: 'text-right'
|
||||
}).text( data.value ));
|
||||
}
|
||||
|
||||
let colElement = $('<div>', {
|
||||
class: ['col-md-6'].join(' ')
|
||||
}).append(
|
||||
$('<div>', {
|
||||
class: [Util.config.dynamicAreaClass].join(' ')
|
||||
}).append(
|
||||
table.append(thead).append(tbody)
|
||||
)
|
||||
);
|
||||
|
||||
rowElement.append(colElement);
|
||||
|
||||
// add clearfix after even col count
|
||||
if(colCount % 2 === 0){
|
||||
rowElement.append(
|
||||
$('<div>', {
|
||||
class: ['clearfix', 'visible-md', 'visible-lg'].join(' ')
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
cache.systemEffectDialog = rowElement;
|
||||
}
|
||||
|
||||
let effectsDialog = bootbox.dialog({
|
||||
className: config.systemEffectDialogClass,
|
||||
title: 'System effect information',
|
||||
message: cache.systemEffectDialog,
|
||||
size: 'large',
|
||||
show: false
|
||||
});
|
||||
let colElement = $('<div>', {
|
||||
class: ['col-md-6'].join(' ')
|
||||
}).append(
|
||||
$('<div>', {
|
||||
class: [Util.config.dynamicAreaClass].join(' ')
|
||||
}).append(
|
||||
table.append(thead).append(tbody)
|
||||
)
|
||||
);
|
||||
|
||||
effectsDialog.on('show.bs.modal', function(e){
|
||||
let headerAll = $();
|
||||
let columnsAll = $();
|
||||
rowElement.append(colElement);
|
||||
|
||||
let removeColumnHighlight = () => {
|
||||
headerAll.removeClass('colHighlight');
|
||||
columnsAll.removeClass('colHighlight');
|
||||
};
|
||||
// add clearfix after even col count
|
||||
if(colCount % 2 === 0){
|
||||
rowElement.append(
|
||||
$('<div>', {
|
||||
class: ['clearfix', 'visible-md', 'visible-lg'].join(' ')
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
let tableApis = $(this).find('table').DataTable({
|
||||
pageLength: -1,
|
||||
paging: false,
|
||||
lengthChange: false,
|
||||
ordering: false,
|
||||
searching: false,
|
||||
info: false,
|
||||
columnDefs: [],
|
||||
data: null, // use DOM data overwrites [] default -> data.loader.js
|
||||
initComplete: function(settings, json){
|
||||
let tableApi = this.api();
|
||||
cache.systemEffectDialog = rowElement;
|
||||
}
|
||||
|
||||
tableApi.tables().nodes().to$().on('mouseover', 'td', function(){
|
||||
// inside table cell -> get current hover colIndex
|
||||
let colIndex = tableApi.cell(this).index().column;
|
||||
let colName = tableApi.column(colIndex).header().dataset.name || '';
|
||||
|
||||
if(colName !== lastActiveColName){
|
||||
removeColumnHighlight();
|
||||
|
||||
lastActiveColName = colName;
|
||||
|
||||
if(colName.length){
|
||||
// active column changed -> highlight same colName on other tables
|
||||
let tableApis = $.fn.dataTable.tables({ visible: false, api: true })
|
||||
.tables('.' + config.systemEffectTableClass);
|
||||
|
||||
let columns = tableApis.columns([colName + ':name']);
|
||||
columns.header().flatten().to$().addClass('colHighlight');
|
||||
columns.nodes().flatten().to$().addClass('colHighlight');
|
||||
}
|
||||
}
|
||||
}).on('mouseleave', function(){
|
||||
// no longer inside table
|
||||
lastActiveColName = null;
|
||||
removeColumnHighlight();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// table cells will not change so we should cache them once
|
||||
headerAll = tableApis.columns().header().to$();
|
||||
columnsAll = tableApis.cells().nodes().to$();
|
||||
});
|
||||
|
||||
effectsDialog.on('hide.bs.modal', function(e){
|
||||
// destroy logTable
|
||||
$(this).find('table').DataTable().destroy(true);
|
||||
});
|
||||
|
||||
effectsDialog.modal('show');
|
||||
let effectsDialog = bootbox.dialog({
|
||||
className: config.systemEffectDialogClass,
|
||||
title: 'System effect information',
|
||||
message: cache.systemEffectDialog,
|
||||
size: 'large',
|
||||
show: false
|
||||
});
|
||||
|
||||
effectsDialog.on('show.bs.modal', function(e){
|
||||
let headerAll = $();
|
||||
let columnsAll = $();
|
||||
|
||||
let removeColumnHighlight = () => {
|
||||
headerAll.removeClass('colHighlight');
|
||||
columnsAll.removeClass('colHighlight');
|
||||
};
|
||||
|
||||
let tableApis = $(this).find('table').DataTable({
|
||||
pageLength: -1,
|
||||
paging: false,
|
||||
lengthChange: false,
|
||||
ordering: false,
|
||||
searching: false,
|
||||
info: false,
|
||||
columnDefs: [],
|
||||
data: null, // use DOM data overwrites [] default -> data.loader.js
|
||||
initComplete: function(settings, json){
|
||||
let tableApi = this.api();
|
||||
|
||||
tableApi.tables().nodes().to$().on('mouseover', 'td', function(){
|
||||
// inside table cell -> get current hover colIndex
|
||||
let colIndex = tableApi.cell(this).index().column;
|
||||
let colName = tableApi.column(colIndex).header().dataset.name || '';
|
||||
|
||||
if(colName !== lastActiveColName){
|
||||
removeColumnHighlight();
|
||||
|
||||
lastActiveColName = colName;
|
||||
|
||||
if(colName.length){
|
||||
// active column changed -> highlight same colName on other tables
|
||||
let tableApis = $.fn.dataTable.tables({ visible: false, api: true })
|
||||
.tables('.' + config.systemEffectTableClass);
|
||||
|
||||
let columns = tableApis.columns([colName + ':name']);
|
||||
columns.header().flatten().to$().addClass('colHighlight');
|
||||
columns.nodes().flatten().to$().addClass('colHighlight');
|
||||
}
|
||||
}
|
||||
}).on('mouseleave', function(){
|
||||
// no longer inside table
|
||||
lastActiveColName = null;
|
||||
removeColumnHighlight();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// table cells will not change so we should cache them once
|
||||
headerAll = tableApis.columns().header().to$();
|
||||
columnsAll = tableApis.cells().nodes().to$();
|
||||
});
|
||||
|
||||
effectsDialog.on('hide.bs.modal', function(e){
|
||||
// destroy logTable
|
||||
$(this).find('table').DataTable().destroy(true);
|
||||
});
|
||||
|
||||
effectsDialog.modal('show');
|
||||
};
|
||||
});
|
||||
@@ -170,6 +170,7 @@
|
||||
#pf-dialog-captcha-wrapper{
|
||||
margin: 0;
|
||||
padding: 3px 0;
|
||||
min-height: 35px; // captcha img has dynamic height. Height should not change on captcha reload
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user