adds dotlan plugin, fixes zkill system clickout, allows signatures in any column

This commit is contained in:
soneill
2020-08-30 19:58:00 +12:00
parent cab7695f4c
commit c3f0bb2ecc
6 changed files with 88 additions and 34 deletions

View File

@@ -5,11 +5,11 @@ define([ // dependencies for this module
'use strict';
/**
* EmptyModule class
* DotlanModule class
* -> skeleton for custom module plugins
* @type {EmptyModule}
* @type {DotlanModule}
*/
let EmptyModule = class EmptyModule extends BaseModule {
let DotlanModule = class DotlanModule extends BaseModule {
constructor(config = {}) {
super(Object.assign({}, new.target.defaultConfig, config));
}
@@ -29,7 +29,17 @@ define([ // dependencies for this module
let bodyEl = Object.assign(document.createElement('div'), {
className: this._config.bodyClassName
});
if (this.isWormhole(systemData.name)) {
var moduleContent = 'Not available for Jspace'
} else {
var moduleContent = Object.assign(document.createElement('iframe'), {
src: this.dotlanPath(this._systemData),
className: 'dotlan-iframe',
style: "width: 100%; height: 650px;"
})
}
bodyEl.append(moduleContent)
this.moduleElement.append(bodyEl);
return this.moduleElement;
@@ -53,19 +63,36 @@ define([ // dependencies for this module
onSortableEvent(name, e){
super.onSortableEvent(name, e);
}
dotlanPath(sysData){
let regionName = this.snakeCase(sysData.region.name);
let systemName = this.snakeCase(sysData.name);
return ["https://evemaps.dotlan.net/map/", regionName, "/", systemName, "#npc_delta"].join('');
}
snakeCase(str){
const regex = /\ /g;
return str.replace(regex, "_");
}
isWormhole(systemName){
const jspace = /^[jJ][0-9]{4,6}/;
return systemName.match(jspace) ? true : false;
}
};
EmptyModule.isPlugin = true; // module is defined as 'plugin'
EmptyModule.scope = 'system'; // module scope controls how module gets updated and what type of data is injected
EmptyModule.sortArea = 'a'; // default sortable area
EmptyModule.position = 15; // default sort/order position within sortable area
EmptyModule.label = 'Empty'; // static module label (e.g. description)
DotlanModule.isPlugin = true; // module is defined as 'plugin'
DotlanModule.scope = 'system'; // module scope controls how module gets updated and what type of data is injected
DotlanModule.sortArea = 'a'; // default sortable area
DotlanModule.position = 15; // default sort/order position within sortable area
DotlanModule.label = 'Dotlan'; // static module label (e.g. description)
EmptyModule.defaultConfig = {
className: 'pf-system-empty-module', // class for module
sortTargetAreas: ['a', 'b', 'c'], // sortable areas where module can be dragged into
headline: 'Empty Module',
DotlanModule.defaultConfig = {
className: 'pf-system-dotlan-module', // class for module
sortTargetAreas: ['a'], // sortable areas where module can be dragged into
headline: 'Dotlan Module',
};
return EmptyModule;
});
return DotlanModule;
});

View File

@@ -554,7 +554,7 @@ define([
*/
openKillboardUrl(e){
e.stopPropagation();
window.open(`//zkillboard.com/system/${this._systemData.systemId}`, '_blank');
window.open(`//zkillboard.com/system/${this._systemData.systemId}/`, '_blank');
}
/**

View File

@@ -3181,7 +3181,7 @@ define([
SystemSignatureModule.defaultConfig = {
className: 'pf-system-signature-module', // class for module
sortTargetAreas: ['a'], // sortable areas where module can be dragged into
sortTargetAreas: ['a', 'b', 'c'], // sortable areas where module can be dragged into
headline: 'Signatures',
// headline toolbar