poi-plugin-akashic-records
Advanced tools
Comparing version 6.3.0 to 7.0.0
@@ -60,4 +60,5 @@ module.exports = { | ||
'lodash', | ||
'redux', | ||
], | ||
}, | ||
} |
{ | ||
} |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
36
index.js
@@ -6,4 +6,15 @@ 'use strict'; | ||
}); | ||
exports.settingsClass = exports.useEnv = exports.windowURL = exports.windowOptions = undefined; | ||
exports.settingsClass = exports.reactClass = exports.windowMode = undefined; | ||
var _views = require('./views'); | ||
Object.defineProperty(exports, 'reactClass', { | ||
enumerable: true, | ||
get: function () { | ||
return _views.reactClass; | ||
} | ||
}); | ||
exports.pluginDidLoad = pluginDidLoad; | ||
exports.pluginWillUnload = pluginWillUnload; | ||
var _electron = require('electron'); | ||
@@ -21,2 +32,4 @@ | ||
var _apiResolver = require('./views/api-resolver'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -28,4 +41,14 @@ | ||
const __ = window.i18n['poi-plugin-akashic-records'].__.bind(window.i18n['poi-plugin-akashic-records']); | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
const windowMode = exports.windowMode = true; | ||
function pluginDidLoad() { | ||
_apiResolver.apiResolver.start(); | ||
} | ||
function pluginWillUnload() { | ||
_apiResolver.apiResolver.stop(); | ||
} | ||
// # Parameters: | ||
@@ -121,11 +144,2 @@ // # label String The title to display | ||
const windowOptions = exports.windowOptions = { | ||
x: config.get('poi.window.x', 0), | ||
y: config.get('poi.window.y', 0), | ||
width: 820, | ||
height: 650 | ||
}; | ||
const windowURL = exports.windowURL = `file://${__dirname}/index.html`; | ||
const useEnv = exports.useEnv = true; | ||
const settingsClass = exports.settingsClass = () => _react2.default.createElement(FolderPickerConfig, { | ||
@@ -132,0 +146,0 @@ label: __('Data Folder'), |
@@ -19,5 +19,9 @@ "use strict"; | ||
var _constant = require('../lib/constant'); | ||
var _constant2 = _interopRequireDefault(_constant); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const { APPDATA_PATH, CONST, config } = window; | ||
const { APPDATA_PATH, config } = window; | ||
@@ -66,4 +70,4 @@ const DATA_PATH = config.get("plugin.Akashic.dataPath", APPDATA_PATH); | ||
const data = {}; | ||
for (const k of Object.keys(CONST.typeList)) { | ||
const type = CONST.typeList[k]; | ||
for (const k of Object.keys(_constant2.default.typeList)) { | ||
const type = _constant2.default.typeList[k]; | ||
data[type] = this._getDataAccordingToNameId(this.nickNameId, type); | ||
@@ -70,0 +74,0 @@ } |
{ | ||
"name": "poi-plugin-akashic-records", | ||
"version": "6.3.0", | ||
"version": "7.0.0", | ||
"description": "logbook plugin for poi", | ||
@@ -55,5 +55,6 @@ "main": "index.js", | ||
"7.5.99": "6.0.5", | ||
"8.1.0-beta.999": "6.1.6" | ||
"8.1.0-beta.999": "6.1.6", | ||
"8.2.9": "6.3.0" | ||
} | ||
} | ||
} |
@@ -0,0 +0,0 @@ [![NPM](https://nodei.co/npm/poi-plugin-akashic-records.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/poi-plugin-akashic-records/) |
@@ -25,5 +25,3 @@ 'use strict'; | ||
const { __ } = window; | ||
// import i18n from '../node_modules/i18n' | ||
// {__} = i18n | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
@@ -30,0 +28,0 @@ const AkashicResourceTable = () => _react2.default.createElement( |
@@ -6,3 +6,8 @@ 'use strict'; | ||
}); | ||
exports.apiResolver = undefined; | ||
var _constant = require('../lib/constant'); | ||
var _constant2 = _interopRequireDefault(_constant); | ||
var _actions = require('./actions'); | ||
@@ -14,5 +19,7 @@ | ||
var _createStore = require('./create-store'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const { CONST, config } = window; | ||
const { config } = window; | ||
@@ -151,4 +158,4 @@ | ||
}); | ||
_dataCoManager2.default.saveLog(CONST.typeList.mission, dataItem); | ||
this.store.dispatch((0, _actions.addLog)(dataItem, CONST.typeList.mission)); | ||
_dataCoManager2.default.saveLog(_constant2.default.typeList.mission, dataItem); | ||
this.store.dispatch((0, _actions.addLog)(dataItem, _constant2.default.typeList.mission)); | ||
break; | ||
@@ -173,4 +180,4 @@ } | ||
dataItem.push(`${this._ships[_decks[0].api_ship[0]].api_name}(Lv.${this._ships[_decks[0].api_ship[0]].api_lv})`, window._teitokuLv); | ||
_dataCoManager2.default.saveLog(CONST.typeList.createItem, dataItem); | ||
this.store.dispatch((0, _actions.addLog)(dataItem, CONST.typeList.createItem)); | ||
_dataCoManager2.default.saveLog(_constant2.default.typeList.createItem, dataItem); | ||
this.store.dispatch((0, _actions.addLog)(dataItem, _constant2.default.typeList.createItem)); | ||
break; | ||
@@ -202,4 +209,4 @@ } | ||
dataItem.push(body.filter(kdock => kdock.api_state === 0).length, `${this._ships[_decks[0].api_ship[0]].api_name}(Lv.${this._ships[_decks[0].api_ship[0]].api_lv})`, window._teitokuLv); | ||
_dataCoManager2.default.saveLog(CONST.typeList.createShip, dataItem); | ||
this.store.dispatch((0, _actions.addLog)(dataItem, CONST.typeList.createShip)); | ||
_dataCoManager2.default.saveLog(_constant2.default.typeList.createShip, dataItem); | ||
this.store.dispatch((0, _actions.addLog)(dataItem, _constant2.default.typeList.createShip)); | ||
this.createShipFlag = false; | ||
@@ -311,4 +318,4 @@ } | ||
dataItem = dataItem.concat(tmp); | ||
_dataCoManager2.default.saveLog(CONST.typeList.attack, dataItem); | ||
this.store.dispatch((0, _actions.addLog)(dataItem, CONST.typeList.attack)); | ||
_dataCoManager2.default.saveLog(_constant2.default.typeList.attack, dataItem); | ||
this.store.dispatch((0, _actions.addLog)(dataItem, _constant2.default.typeList.attack)); | ||
}; | ||
@@ -368,3 +375,3 @@ | ||
exports.default = APIResolver; | ||
module.exports = exports['default']; | ||
const apiResolver = exports.apiResolver = new APIResolver(_createStore.store); | ||
exports.default = APIResolver; |
@@ -39,2 +39,6 @@ 'use strict'; | ||
var _i18next = require('views/env-parts/i18next'); | ||
var _i18next2 = _interopRequireDefault(_i18next); | ||
var _tab = require('../reducers/tab'); | ||
@@ -44,5 +48,9 @@ | ||
var _constant = require('../../lib/constant'); | ||
var _constant2 = _interopRequireDefault(_constant); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const { __, translate, CONST, config, APPDATA_PATH } = window; | ||
const { config, APPDATA_PATH } = window; | ||
const DATA_PATH = config.get("plugin.Akashic.dataPath", APPDATA_PATH); | ||
@@ -52,2 +60,6 @@ const { dialog } = _electron.remote.require('electron'); | ||
const translate = (locale, str) => _i18next2.default.getFixedT(locale, 'poi-plugin-akashic-records')(str); | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
_jschardet2.default.Constants.MINIMUM_THRESHOLD = 0.10; | ||
@@ -117,8 +129,8 @@ | ||
switch (logs[0]) { | ||
case tableTab['en-US'][CONST.typeList.attack]: | ||
case tableTab['ja-JP'][CONST.typeList.attack]: | ||
case tableTab['zh-CN'][CONST.typeList.attack]: | ||
case tableTab['zh-TW'][CONST.typeList.attack]: | ||
case tableTab['en-US'][_constant2.default.typeList.attack]: | ||
case tableTab['ja-JP'][_constant2.default.typeList.attack]: | ||
case tableTab['zh-CN'][_constant2.default.typeList.attack]: | ||
case tableTab['zh-TW'][_constant2.default.typeList.attack]: | ||
{ | ||
logType = CONST.typeList.attack; | ||
logType = _constant2.default.typeList.attack; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -135,8 +147,8 @@ logItem = logItem.split(','); | ||
} | ||
case tableTab['en-US'][CONST.typeList.mission]: | ||
case tableTab['ja-JP'][CONST.typeList.mission]: | ||
case tableTab['zh-CN'][CONST.typeList.mission]: | ||
case tableTab['zh-TW'][CONST.typeList.mission]: | ||
case tableTab['en-US'][_constant2.default.typeList.mission]: | ||
case tableTab['ja-JP'][_constant2.default.typeList.mission]: | ||
case tableTab['zh-CN'][_constant2.default.typeList.mission]: | ||
case tableTab['zh-TW'][_constant2.default.typeList.mission]: | ||
{ | ||
logType = CONST.typeList.mission; | ||
logType = _constant2.default.typeList.mission; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -151,8 +163,8 @@ logItem = logItem.split(','); | ||
} | ||
case tableTab['en-US'][CONST.typeList.createShip]: | ||
case tableTab['ja-JP'][CONST.typeList.createShip]: | ||
case tableTab['zh-CN'][CONST.typeList.createShip]: | ||
case tableTab['zh-TW'][CONST.typeList.createShip]: | ||
case tableTab['en-US'][_constant2.default.typeList.createShip]: | ||
case tableTab['ja-JP'][_constant2.default.typeList.createShip]: | ||
case tableTab['zh-CN'][_constant2.default.typeList.createShip]: | ||
case tableTab['zh-TW'][_constant2.default.typeList.createShip]: | ||
{ | ||
logType = CONST.typeList.createShip; | ||
logType = _constant2.default.typeList.createShip; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -167,8 +179,8 @@ logItem = logItem.split(','); | ||
} | ||
case tableTab['en-US'][CONST.typeList.createItem]: | ||
case tableTab['ja-JP'][CONST.typeList.createItem]: | ||
case tableTab['zh-CN'][CONST.typeList.createItem]: | ||
case tableTab['zh-TW'][CONST.typeList.createItem]: | ||
case tableTab['en-US'][_constant2.default.typeList.createItem]: | ||
case tableTab['ja-JP'][_constant2.default.typeList.createItem]: | ||
case tableTab['zh-CN'][_constant2.default.typeList.createItem]: | ||
case tableTab['zh-TW'][_constant2.default.typeList.createItem]: | ||
{ | ||
logType = CONST.typeList.createItem; | ||
logType = _constant2.default.typeList.createItem; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -183,8 +195,8 @@ logItem = logItem.split(','); | ||
} | ||
case tableTab['en-US'][CONST.typeList.retirement]: | ||
case tableTab['ja-JP'][CONST.typeList.retirement]: | ||
case tableTab['zh-CN'][CONST.typeList.retirement]: | ||
case tableTab['zh-TW'][CONST.typeList.retirement]: | ||
case tableTab['en-US'][_constant2.default.typeList.retirement]: | ||
case tableTab['ja-JP'][_constant2.default.typeList.retirement]: | ||
case tableTab['zh-CN'][_constant2.default.typeList.retirement]: | ||
case tableTab['zh-TW'][_constant2.default.typeList.retirement]: | ||
{ | ||
logType = CONST.typeList.retirement; | ||
logType = _constant2.default.typeList.retirement; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -199,8 +211,8 @@ logItem = logItem.split(','); | ||
} | ||
case tableTab['en-US'][CONST.typeList.resource]: | ||
case tableTab['ja-JP'][CONST.typeList.resource]: | ||
case tableTab['zh-CN'][CONST.typeList.resource]: | ||
case tableTab['zh-TW'][CONST.typeList.resource]: | ||
case tableTab['en-US'][_constant2.default.typeList.resource]: | ||
case tableTab['ja-JP'][_constant2.default.typeList.resource]: | ||
case tableTab['zh-CN'][_constant2.default.typeList.resource]: | ||
case tableTab['zh-TW'][_constant2.default.typeList.resource]: | ||
{ | ||
logType = CONST.typeList.resource; | ||
logType = _constant2.default.typeList.resource; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -219,3 +231,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.attack; | ||
logType = _constant2.default.typeList.attack; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -239,3 +251,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.attack; | ||
logType = _constant2.default.typeList.attack; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -260,3 +272,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.attack; | ||
logType = _constant2.default.typeList.attack; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -280,3 +292,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.attack; | ||
logType = _constant2.default.typeList.attack; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -308,3 +320,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.mission; | ||
logType = _constant2.default.typeList.mission; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -320,3 +332,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.mission; | ||
logType = _constant2.default.typeList.mission; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -332,3 +344,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.mission; | ||
logType = _constant2.default.typeList.mission; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -344,3 +356,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.createShip; | ||
logType = _constant2.default.typeList.createShip; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -356,3 +368,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.createShip; | ||
logType = _constant2.default.typeList.createShip; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -368,3 +380,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.createItem; | ||
logType = _constant2.default.typeList.createItem; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -387,3 +399,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.createItem; | ||
logType = _constant2.default.typeList.createItem; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -406,3 +418,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.resource; | ||
logType = _constant2.default.typeList.resource; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -418,3 +430,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.resource; | ||
logType = _constant2.default.typeList.resource; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -430,3 +442,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.resource; | ||
logType = _constant2.default.typeList.resource; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -442,3 +454,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.retirement; | ||
logType = _constant2.default.typeList.retirement; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -456,3 +468,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.attack; | ||
logType = _constant2.default.typeList.attack; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -468,3 +480,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.createItem; | ||
logType = _constant2.default.typeList.createItem; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -487,3 +499,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.createShip; | ||
logType = _constant2.default.typeList.createShip; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -499,3 +511,3 @@ logItem = logItem.split(','); | ||
{ | ||
logType = CONST.typeList.resource; | ||
logType = _constant2.default.typeList.resource; | ||
data = logs.slice(1).map(logItem => { | ||
@@ -543,23 +555,23 @@ logItem = logItem.split(','); | ||
case '出击': | ||
logType = CONST.typeList.attack; | ||
logType = _constant2.default.typeList.attack; | ||
data = this.props.attackData; | ||
break; | ||
case '远征': | ||
logType = CONST.typeList.mission; | ||
logType = _constant2.default.typeList.mission; | ||
data = this.props.missionData; | ||
break; | ||
case '建造': | ||
logType = CONST.typeList.createShip; | ||
logType = _constant2.default.typeList.createShip; | ||
data = this.props.createShipData; | ||
break; | ||
case '开发': | ||
logType = CONST.typeList.createItem; | ||
logType = _constant2.default.typeList.createItem; | ||
data = this.props.createItemData; | ||
break; | ||
case '除籍': | ||
logType = CONST.typeList.retirement; | ||
logType = _constant2.default.typeList.retirement; | ||
data = this.props.retirementData; | ||
break; | ||
case '资源': | ||
logType = CONST.typeList.resource; | ||
logType = _constant2.default.typeList.resource; | ||
data = this.props.resourceData; | ||
@@ -647,23 +659,23 @@ break; | ||
switch (logType) { | ||
case CONST.typeList.attack: | ||
case _constant2.default.typeList.attack: | ||
hint = '出击'; | ||
oldData = duplicateRemoval(this.props.attackData); | ||
break; | ||
case CONST.typeList.mission: | ||
case _constant2.default.typeList.mission: | ||
hint = '远征'; | ||
oldData = duplicateRemoval(this.props.missionData); | ||
break; | ||
case CONST.typeList.createShip: | ||
case _constant2.default.typeList.createShip: | ||
hint = '建造'; | ||
oldData = duplicateRemoval(this.props.createShipData); | ||
break; | ||
case CONST.typeList.createItem: | ||
case _constant2.default.typeList.createItem: | ||
hint = '开发'; | ||
oldData = duplicateRemoval(this.props.createItemData); | ||
break; | ||
case CONST.typeList.retirement: | ||
case _constant2.default.typeList.retirement: | ||
hint = '除籍'; | ||
oldData = duplicateRemoval(this.props.retirementData); | ||
break; | ||
case CONST.typeList.resource: | ||
case _constant2.default.typeList.resource: | ||
hint = '资源'; | ||
@@ -678,3 +690,3 @@ oldData = duplicateRemoval(this.props.resourceData); | ||
let newData = oldData.concat(data); | ||
if (logType === CONST.typeList.resource) newData = duplicateResourceRemoval(newData);else newData = duplicateRemoval(newData); | ||
if (logType === _constant2.default.typeList.resource) newData = duplicateResourceRemoval(newData);else newData = duplicateRemoval(newData); | ||
const newLength = newData.length; | ||
@@ -681,0 +693,0 @@ _fsExtra2.default.emptyDirSync(_pathExtra2.default.join(DATA_PATH, 'akashic-records', "tmp")); |
@@ -21,4 +21,6 @@ 'use strict'; | ||
const { config, __ } = window; | ||
const { config } = window; | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
class AkashicRecordsCheckboxPanel extends _react2.default.Component { | ||
@@ -25,0 +27,0 @@ constructor(props) { |
@@ -23,5 +23,12 @@ 'use strict'; | ||
var _constant = require('../../lib/constant'); | ||
var _constant2 = _interopRequireDefault(_constant); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const { config, __, CONST } = window; | ||
const { config } = window; | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
const { openExternal } = require('electron').shell; | ||
@@ -219,3 +226,3 @@ | ||
'option', | ||
{ key: CONST.search.rawDataIndex, value: CONST.search.rawDataIndex }, | ||
{ key: _constant2.default.search.rawDataIndex, value: _constant2.default.search.rawDataIndex }, | ||
__("All Data") | ||
@@ -225,3 +232,3 @@ ), | ||
'option', | ||
{ key: CONST.search.filteredDataIndex, value: CONST.search.filteredDataIndex }, | ||
{ key: _constant2.default.search.filteredDataIndex, value: _constant2.default.search.filteredDataIndex }, | ||
__("Filtered") | ||
@@ -232,4 +239,4 @@ ), | ||
{ | ||
key: CONST.search.indexBase + (i + 1), | ||
value: CONST.search.indexBase + (i + 1) | ||
key: _constant2.default.search.indexBase + (i + 1), | ||
value: _constant2.default.search.indexBase + (i + 1) | ||
}, | ||
@@ -346,3 +353,3 @@ __("Search Result No. %s", i + 1) | ||
'option', | ||
{ key: CONST.search.rawDataIndex, value: CONST.search.rawDataIndex }, | ||
{ key: _constant2.default.search.rawDataIndex, value: _constant2.default.search.rawDataIndex }, | ||
__("All Data") | ||
@@ -352,3 +359,3 @@ ), | ||
'option', | ||
{ key: CONST.search.filteredDataIndex, value: CONST.search.filteredDataIndex }, | ||
{ key: _constant2.default.search.filteredDataIndex, value: _constant2.default.search.filteredDataIndex }, | ||
__("Filtered") | ||
@@ -359,4 +366,4 @@ ), | ||
{ | ||
key: CONST.search.indexBase + (i + 1), | ||
value: CONST.search.indexBase + (i + 1) | ||
key: _constant2.default.search.indexBase + (i + 1), | ||
value: _constant2.default.search.indexBase + (i + 1) | ||
}, | ||
@@ -388,3 +395,3 @@ __("Search Result No. %s", i + 1) | ||
'option', | ||
{ key: CONST.search.rawDataIndex, value: CONST.search.rawDataIndex }, | ||
{ key: _constant2.default.search.rawDataIndex, value: _constant2.default.search.rawDataIndex }, | ||
__("All Data") | ||
@@ -394,3 +401,3 @@ ), | ||
'option', | ||
{ key: CONST.search.filteredDataIndex, value: CONST.search.filteredDataIndex }, | ||
{ key: _constant2.default.search.filteredDataIndex, value: _constant2.default.search.filteredDataIndex }, | ||
__("Filtered") | ||
@@ -401,4 +408,4 @@ ), | ||
{ | ||
key: CONST.search.indexBase + (i + 1), | ||
value: CONST.search.indexBase + (i + 1) | ||
key: _constant2.default.search.indexBase + (i + 1), | ||
value: _constant2.default.search.indexBase + (i + 1) | ||
}, | ||
@@ -405,0 +412,0 @@ __("Search Result No. %s", i + 1) |
@@ -27,3 +27,6 @@ 'use strict'; | ||
const { __, ipc } = window; | ||
const { ipc } = window; | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
const { openExternal } = require('electron').shell; | ||
@@ -40,13 +43,26 @@ | ||
const battleDetailPlugin = window.getStore('plugins').find(p => p.id === 'poi-plugin-battle-detail'); | ||
if (!battleDetailPlugin || !battleDetailPlugin.enabled) { | ||
throw `${__("In order to find the detailed battle log, you need to download the latest battle-detail plugin and enable it.")}`; | ||
} | ||
timestamp = new Date(timestamp).getTime(); | ||
const battleDetail = ipc.access('BattleDetail'); | ||
if (battleDetail == null || battleDetail.showBattleWithTimestamp == null) { | ||
throw `${__("In order to find the detailed battle log, you need to download the latest battle-detail plugin and enable it.")}`; | ||
ipc.register("BattleDetail", { | ||
timestamp | ||
}); | ||
} else { | ||
battleDetail.showBattleWithTimestamp(timestamp, message => { | ||
if (message) { | ||
window.toggleModal("Warning", `${__('Battle Detail')}: ${message}`); | ||
} | ||
}); | ||
} | ||
timestamp = new Date(timestamp).getTime(); | ||
battleDetail.showBattleWithTimestamp(timestamp, message => { | ||
if (message) { | ||
window.toggleModal("Warning", `${__('Battle Detail')}: ${message}`); | ||
} | ||
}); | ||
const mainWindow = ipc.access('MainWindow'); | ||
if (mainWindow && mainWindow.ipcFocusPlugin) { | ||
mainWindow.ipcFocusPlugin('poi-plugin-battle-detail'); | ||
} | ||
} catch (e) { | ||
@@ -53,0 +69,0 @@ window.toggleModal('Warning', e); |
@@ -21,2 +21,4 @@ 'use strict'; | ||
var _windowEnv = require('views/components/etc/window-env'); | ||
var _dark = require('../../assets/themes/dark'); | ||
@@ -32,3 +34,7 @@ | ||
const { config, ROOT, __ } = window; | ||
const { config, ROOT } = window; | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
const { error } = require(_pathExtra2.default.join(ROOT, 'lib/utils')); | ||
@@ -62,5 +68,5 @@ | ||
}; | ||
this.showAsDay = true; | ||
this.showAllSymbol = false; | ||
this.sleepMode = false; | ||
this.showAsDay = config.get("plugin.Akashic.resource.chart.showAsDay", true); | ||
this.showAllSymbol = config.get("plugin.Akashic.resource.chart.showAllSymbol", false); | ||
this.sleepMode = config.get("plugin.Akashic.resource.chart.sleepMode", true); | ||
this.resourceChart = 0; | ||
@@ -70,10 +76,7 @@ this.wholeDataLength = 0; | ||
this.showData = []; | ||
} | ||
componentWillMount() { | ||
this.showAsDay = config.get("plugin.Akashic.resource.chart.showAsDay", true); | ||
this.showAllSymbol = config.get("plugin.Akashic.resource.chart.showAllSymbol", false); | ||
this.sleepMode = config.get("plugin.Akashic.resource.chart.sleepMode", true); | ||
window.onresize = () => { | ||
props.window.onresize = () => { | ||
try { | ||
document.getElementById('ECharts').style.height = `${window.remote.getCurrentWindow().getBounds().height - 150}px`; | ||
const { window } = props; | ||
window.document.getElementById('ECharts').style.height = `${window.innerHeight - 150}px`; | ||
if (this.resourceChart !== 0) { | ||
@@ -85,3 +88,2 @@ this.resourceChart.resize(); | ||
console.log(err); | ||
} finally { | ||
return true; | ||
@@ -177,6 +179,6 @@ } | ||
title: __("Show by %s", __("Day")), | ||
icon: './assets/echarts-day.png' | ||
icon: _pathExtra2.default.join(__dirname, '../../assets/echarts-day.png') | ||
} : { | ||
title: __("Show by %s", __("Hour")), | ||
icon: './assets/echarts-hour.png' | ||
icon: _pathExtra2.default.join(__dirname, '../../assets/echarts-hour.png') | ||
}; | ||
@@ -205,6 +207,6 @@ return _extends({ | ||
title: __("Show node"), | ||
icon: `./assets/echarts-with-node${suffix}.png` | ||
icon: _pathExtra2.default.join(__dirname, `../../assets/echarts-with-node${suffix}.png`) | ||
} : { | ||
title: __("Hide node"), | ||
icon: `./assets/echarts-no-node${suffix}.png` | ||
icon: _pathExtra2.default.join(__dirname, `../../assets/echarts-no-node${suffix}.png`) | ||
}; | ||
@@ -226,6 +228,6 @@ const showType = _extends({ | ||
title: __("Sleep mode"), | ||
icon: './assets/echarts-moon.png' | ||
icon: _pathExtra2.default.join(__dirname, '../../assets/echarts-moon.png') | ||
} : { | ||
title: __("Light mode"), | ||
icon: './assets/echarts-sun.png' | ||
icon: _pathExtra2.default.join(__dirname, '../../assets/echarts-sun.png') | ||
}; | ||
@@ -452,3 +454,8 @@ return _extends({ | ||
exports.default = AkashicResourceChart; | ||
exports.default = props => _react2.default.createElement( | ||
_windowEnv.WindowEnv.Consumer, | ||
null, | ||
({ window }) => _react2.default.createElement(AkashicResourceChart, _extends({ window: window }, props)) | ||
); | ||
module.exports = exports['default']; |
@@ -23,3 +23,5 @@ 'use strict'; | ||
const { __, config } = window; | ||
const { config } = window; | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
// # import i18n from '../node_modules/i18n' | ||
@@ -26,0 +28,0 @@ // # {__} = i18n |
@@ -19,3 +19,3 @@ 'use strict'; | ||
const { __ } = window; | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
@@ -22,0 +22,0 @@ class ErrorBoundary extends _react.Component { |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.reactClass = undefined; | ||
var _reactRedux = require('react-redux'); | ||
var _redux = require('redux'); | ||
var _pathExtra = require('path-extra'); | ||
var _reducers = require('./reducers'); | ||
var _createStore = require('./create-store'); | ||
var _reducers2 = _interopRequireDefault(_reducers); | ||
var _react = require('react'); | ||
@@ -21,5 +24,5 @@ | ||
var _apiResolver = require('./api-resolver'); | ||
var _constant = require('../lib/constant'); | ||
var _apiResolver2 = _interopRequireDefault(_apiResolver); | ||
var _constant2 = _interopRequireDefault(_constant); | ||
@@ -44,10 +47,6 @@ var _akashicRecordsLog = require('./akashic-records-log'); | ||
const store = (0, _redux.createStore)(_reducers2.default); | ||
const { $ } = window; | ||
window.getState = () => store.getState(); | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
const { $, __, CONST } = window; | ||
const apiResolver = new _apiResolver2.default(store); | ||
if ($('#font-awesome')) { | ||
@@ -82,3 +81,3 @@ $('#font-awesome').setAttribute('href', require.resolve('font-awesome/css/font-awesome.css')); | ||
class AkashicRecordsArea extends _react2.default.Component { | ||
class reactClass extends _react2.default.Component { | ||
constructor(props) { | ||
@@ -105,10 +104,2 @@ super(props); | ||
componentDidMount() { | ||
apiResolver.start(); | ||
} | ||
componentWillUnmount() { | ||
apiResolver.stop(); | ||
} | ||
componentDidCatch(error, info) { | ||
@@ -120,50 +111,55 @@ console.log(error, info); | ||
return _react2.default.createElement( | ||
'div', | ||
null, | ||
_reactRedux.Provider, | ||
{ store: _createStore.store }, | ||
_react2.default.createElement( | ||
'div', | ||
{ style: { 'fontSize': 18 } }, | ||
{ id: 'akashic-records-main-wrapper' }, | ||
_react2.default.createElement('link', { rel: 'stylesheet', href: (0, _pathExtra.join)(__dirname, '..', 'assets', 'main.css') }), | ||
_react2.default.createElement( | ||
_reactBootstrap.Label, | ||
{ bsStyle: 'danger' }, | ||
this.state.warning | ||
) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tabs, | ||
{ id: '', activeKey: this.state.selectedKey, animation: false, onSelect: this.handleSelectTab }, | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '0', eventKey: 0, title: __("Sortie") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: CONST.typeList.attack }) | ||
'div', | ||
{ style: { 'fontSize': 18 } }, | ||
_react2.default.createElement( | ||
_reactBootstrap.Label, | ||
{ bsStyle: 'danger' }, | ||
this.state.warning | ||
) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '1', eventKey: 1, title: __("Expedition") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: CONST.typeList.mission }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '2', eventKey: 2, title: __("Construction") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: CONST.typeList.createShip }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '3', eventKey: 3, title: __("Development") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: CONST.typeList.createItem }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '4', eventKey: 4, title: __("Retirement") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: CONST.typeList.retirement }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '5', eventKey: 5, title: __("Resource") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicResourceLog2.default, mapShowFlag: this.state.mapShowFlag }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '6', eventKey: 6, title: __("Others") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _advancedModule2.default }) | ||
_reactBootstrap.Tabs, | ||
{ id: '', activeKey: this.state.selectedKey, animation: false, onSelect: this.handleSelectTab }, | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '0', eventKey: 0, title: __("Sortie") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.attack }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '1', eventKey: 1, title: __("Expedition") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.mission }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '2', eventKey: 2, title: __("Construction") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.createShip }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '3', eventKey: 3, title: __("Development") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.createItem }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '4', eventKey: 4, title: __("Retirement") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicRecordsLog2.default, contentType: _constant2.default.typeList.retirement }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '5', eventKey: 5, title: __("Resource") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _akashicResourceLog2.default, mapShowFlag: this.state.mapShowFlag }) | ||
), | ||
_react2.default.createElement( | ||
_reactBootstrap.Tab, | ||
{ id: '6', eventKey: 6, title: __("Others") }, | ||
_react2.default.createElement(_errorBoundary2.default, { component: _advancedModule2.default }) | ||
) | ||
) | ||
@@ -174,7 +170,2 @@ ) | ||
} | ||
_reactDom2.default.render(_react2.default.createElement( | ||
_reactRedux.Provider, | ||
{ store: store }, | ||
_react2.default.createElement(AkashicRecordsArea, null) | ||
), $('akashic-records')); | ||
exports.reactClass = reactClass; |
@@ -19,4 +19,6 @@ 'use strict'; | ||
const { $, __ } = window; | ||
const { $ } = window; | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
// Notification modal | ||
@@ -23,0 +25,0 @@ class ModalTrigger extends _react2.default.Component { |
@@ -9,4 +9,6 @@ 'use strict'; | ||
exports.tabVisibility = tabVisibility; | ||
const { config, __ } = window; | ||
const { config } = window; | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
const tableTab = { | ||
@@ -13,0 +15,0 @@ attack: ['No.', 'Time', 'World', "Node", "Sortie Type", "Battle Result", "Enemy Encounters", "Drop", "Heavily Damaged", "Flagship", "Flagship (Second Fleet)", 'MVP', "MVP (Second Fleet)"], |
@@ -11,4 +11,6 @@ "use strict"; | ||
exports.showTimeScale = showTimeScale; | ||
const { config, __ } = window; | ||
const { config } = window; | ||
const { __ } = window.i18n['poi-plugin-akashic-records']; | ||
const initConfigList = ["Show Headings", "Show Filter-box", "Auto-selected", "Disable filtering while hiding filter-box"]; | ||
@@ -15,0 +17,0 @@ |
@@ -12,4 +12,8 @@ 'use strict'; | ||
const { CONST } = window; | ||
var _constant = require('../../lib/constant'); | ||
var _constant2 = _interopRequireDefault(_constant); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const dateToDateString = datetime => { | ||
@@ -127,3 +131,3 @@ const date = new Date(datetime); | ||
const logsRes = [logs, filteredLogs]; | ||
searchRules.forEach((searchRule, i) => logsRes[CONST.search.indexBase + i + 1] = selector[i](logsRes, searchRule)); | ||
searchRules.forEach((searchRule, i) => logsRes[_constant2.default.search.indexBase + i + 1] = selector[i](logsRes, searchRule)); | ||
return logsRes.map(logs => logs.length); | ||
@@ -130,0 +134,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
9
2742454
100
58681
1