diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..2d63240c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +root = true + + +[*] + +# change these settings to your own preference +indent_style = space +indent_size = 4 + +# we recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false + +[{package,bower}.json] +indent_style = space +indent_size = 2 diff --git a/devServer.js b/devServer.js old mode 100644 new mode 100755 index c05cc11a..b7d80dd7 --- a/devServer.js +++ b/devServer.js @@ -5,6 +5,7 @@ var config = require('./webpack.config.dev'); new WebpackDevServer(webpack(config), { publicPath: config.output.publicPath, hot: true, + disableHostCheck: true, headers: { "Access-Control-Allow-Origin": "*" }, historyApiFallback: { rewrites: [ diff --git a/package-lock.json b/package-lock.json index e81bff1a..4770cf04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "coriolis_shipyard", - "version": "2.5.0", + "version": "2.5.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -11961,6 +11961,17 @@ } } }, + "webpack-notifier": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/webpack-notifier/-/webpack-notifier-1.6.0.tgz", + "integrity": "sha1-/6yOVf+MRpdSuMG7sBGhbxCYbgI=", + "dev": true, + "requires": { + "node-notifier": "5.1.2", + "object-assign": "4.1.1", + "strip-ansi": "3.0.1" + } + }, "webpack-sources": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-0.1.5.tgz", diff --git a/package.json b/package.json index 395a33d9..fc28b4c8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coriolis_shipyard", - "version": "2.5.1", + "version": "2.5.2", "repository": { "type": "git", "url": "https://github.com/EDCD/coriolis" @@ -87,10 +87,11 @@ "rollup": "0.41", "rollup-plugin-node-resolve": "3", "style-loader": "^0.16.1", + "uglify-js": "^2.4.11", "url-loader": "^0.5.8", "webpack": "^2.4.1", "webpack-dev-server": "^2.4.4", - "uglify-js": "^2.4.11" + "webpack-notifier": "^1.6.0" }, "dependencies": { "babel-polyfill": "*", diff --git a/src/app/Coriolis.jsx b/src/app/Coriolis.jsx index 9fc6b0a3..cb2178c1 100644 --- a/src/app/Coriolis.jsx +++ b/src/app/Coriolis.jsx @@ -12,6 +12,7 @@ import ModalHelp from './components/ModalHelp'; import ModalImport from './components/ModalImport'; import ModalPermalink from './components/ModalPermalink'; import * as CompanionApiUtils from './utils/CompanionApiUtils'; +import * as JournalUtils from './utils/JournalUtils'; import AboutPage from './pages/AboutPage'; import NotFoundPage from './pages/NotFoundPage'; @@ -92,7 +93,14 @@ export default class Coriolis extends React.Component { // Need to decode and gunzip the data, then build the ship const data = zlib.inflate(new Buffer(r.params.data, 'base64'), { to: 'string' }); const json = JSON.parse(data); - const ship = CompanionApiUtils.shipFromJson(json); + console.log('Ship import data: '); + console.log(json); + let ship; + if (json && json.modules) { + ship = CompanionApiUtils.shipFromJson(json); + } else if (json && json.Modules) { + ship = JournalUtils.shipFromLoadoutJSON(json); + } r.params.ship = ship.id; r.params.code = ship.toString(); this._setPage(OutfittingPage, r); diff --git a/src/app/components/StandardSlot.jsx b/src/app/components/StandardSlot.jsx index f02d8146..91a1717d 100644 --- a/src/app/components/StandardSlot.jsx +++ b/src/app/components/StandardSlot.jsx @@ -96,7 +96,7 @@ export default class StandardSlot extends TranslatedComponent { return (