From 6bdf946790c25640c6a4573f0d660d58194c9d4c Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Tue, 26 Jun 2018 12:34:11 -0400 Subject: [PATCH] remove all .js from all appplicable imports --- src/ActiveScriptsUI.js | 14 +++---- src/Alias.js | 2 +- src/Augmentations.js | 30 +++++++-------- src/BitNode.js | 2 +- src/Bladeburner.js | 24 ++++++------ src/CinematicText.js | 4 +- src/Company.js | 8 ++-- src/CompanyJobApplication.js | 1 - src/CompanyManagement.js | 20 +++++----- src/CreateProgram.js | 6 +-- src/Crimes.js | 6 +-- src/DarkWeb.js | 10 ++--- src/Faction.js | 28 +++++++------- src/Fconf.js | 2 +- src/Gang.js | 16 ++++---- src/HacknetNode.js | 16 ++++---- src/Infiltration.js | 14 +++---- src/InteractiveTutorial.js | 8 ++-- src/Literature.js | 2 +- src/Location.js | 34 ++++++++--------- src/Message.js | 18 ++++----- src/Missions.js | 12 +++--- src/NetscriptEnvironment.js | 6 +-- src/NetscriptEvaluator.js | 22 +++++------ src/NetscriptFunctions.js | 62 +++++++++++++++--------------- src/NetscriptJSEvaluator.js | 6 +-- src/NetscriptPort.js | 2 +- src/NetscriptWorker.js | 26 ++++++------- src/Player.js | 38 +++++++++--------- src/Prestige.js | 44 ++++++++++----------- src/RedPill.js | 18 ++++----- src/SaveObject.js | 38 +++++++++--------- src/Script.js | 34 ++++++++--------- src/Server.js | 18 ++++----- src/ServerPurchases.js | 12 +++--- src/Settings.js | 2 +- src/SourceFile.js | 4 +- src/SpecialServerIps.js | 2 +- src/StockMarket.js | 20 +++++----- src/Terminal.js | 44 ++++++++++----------- src/engine.js | 70 +++++++++++++++++----------------- utils/FactionInvitationBox.js | 8 ++-- utils/HelperFunctions.js | 2 +- utils/IPAddress.js | 2 +- utils/InfiltrationBox.js | 12 +++--- utils/LogBox.js | 4 +- utils/StringHelperFunctions.ts | 2 +- utils/YesNoBox.js | 2 +- 48 files changed, 388 insertions(+), 389 deletions(-) delete mode 100644 src/CompanyJobApplication.js diff --git a/src/ActiveScriptsUI.js b/src/ActiveScriptsUI.js index 12b3880bf..f2e03e8ad 100644 --- a/src/ActiveScriptsUI.js +++ b/src/ActiveScriptsUI.js @@ -1,14 +1,14 @@ -import {Engine} from "./engine.js"; +import {Engine} from "./engine"; import {workerScripts, addWorkerScript, - killWorkerScript} from "./NetscriptWorker.js"; -import {Player} from "./Player.js"; -import {getServer} from "./Server.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; + killWorkerScript} from "./NetscriptWorker"; +import {Player} from "./Player"; +import {getServer} from "./Server"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {printArray, createElement, createAccordionElement, removeElement, - removeChildrenFromElement, exceptionAlert} from "../utils/HelperFunctions.js"; -import {logBoxCreate} from "../utils/LogBox.js"; + removeChildrenFromElement, exceptionAlert} from "../utils/HelperFunctions"; +import {logBoxCreate} from "../utils/LogBox"; import numeral from "numeral/min/numeral.min"; import {formatNumber} from "../utils/StringHelperFunctions"; diff --git a/src/Alias.js b/src/Alias.js index 405bd984e..618a956c2 100644 --- a/src/Alias.js +++ b/src/Alias.js @@ -1,4 +1,4 @@ -import {post} from "./Terminal.js"; +import {post} from "./Terminal"; let Aliases = {}; let GlobalAliases = {}; diff --git a/src/Augmentations.js b/src/Augmentations.js index a73a2430b..0ba6aa2f6 100644 --- a/src/Augmentations.js +++ b/src/Augmentations.js @@ -1,21 +1,21 @@ -import {BitNodeMultipliers} from "./BitNode.js"; -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; +import {BitNodeMultipliers} from "./BitNode"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; import {Factions, getNextNeurofluxLevel, - factionExists} from "./Faction.js"; -import {hasBladeburnerSF} from "./NetscriptFunctions.js"; -import {addWorkerScript} from "./NetscriptWorker.js"; -import {Player} from "./Player.js"; -import {prestigeAugmentation} from "./Prestige.js"; -import {saveObject} from "./SaveObject.js"; -import {Script, RunningScript} from "./Script.js"; -import {Server} from "./Server.js"; -import {SourceFiles} from "./SourceFile.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; + factionExists} from "./Faction"; +import {hasBladeburnerSF} from "./NetscriptFunctions"; +import {addWorkerScript} from "./NetscriptWorker"; +import {Player} from "./Player"; +import {prestigeAugmentation} from "./Prestige"; +import {saveObject} from "./SaveObject"; +import {Script, RunningScript} from "./Script"; +import {Server} from "./Server"; +import {SourceFiles} from "./SourceFile"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {createElement, createAccordionElement, - removeChildrenFromElement, clearObject} from "../utils/HelperFunctions.js"; + removeChildrenFromElement, clearObject} from "../utils/HelperFunctions"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; import {isString} from "../utils/StringHelperFunctions"; //Augmentations diff --git a/src/BitNode.js b/src/BitNode.js index 8b2c60bf0..57b2d30aa 100644 --- a/src/BitNode.js +++ b/src/BitNode.js @@ -1,4 +1,4 @@ -import {Player} from "./Player.js"; +import {Player} from "./Player"; function BitNode(n, name, desc="", info="") { this.number = n; diff --git a/src/Bladeburner.js b/src/Bladeburner.js index ae33a011f..112f9ce52 100644 --- a/src/Bladeburner.js +++ b/src/Bladeburner.js @@ -1,22 +1,22 @@ -import {Augmentations, AugmentationNames} from "./Augmentations.js"; -import {BitNodeMultipliers} from "./BitNode.js"; -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; +import {Augmentations, AugmentationNames} from "./Augmentations"; +import {BitNodeMultipliers} from "./BitNode"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; import {Faction, Factions, factionExists, - joinFaction, displayFactionContent} from "./Faction.js"; -import {Locations} from "./Location.js"; -import {Player} from "./Player.js"; -import {hackWorldDaemon, redPillFlag} from "./RedPill.js"; -import {KEY} from "./Terminal.js"; + joinFaction, displayFactionContent} from "./Faction"; +import {Locations} from "./Location"; +import {Player} from "./Player"; +import {hackWorldDaemon, redPillFlag} from "./RedPill"; +import {KEY} from "./Terminal"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {getRandomInt, addOffset, clearObject, createElement, removeChildrenFromElement, exceptionAlert, createPopup, appendLineBreaks, removeElementById, removeElement, - createProgressBarText} from "../utils/HelperFunctions.js"; + createProgressBarText} from "../utils/HelperFunctions"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; import numeral from "numeral/min/numeral.min"; import {formatNumber} from "../utils/StringHelperFunctions"; diff --git a/src/CinematicText.js b/src/CinematicText.js index 41424e7ad..71906bf08 100644 --- a/src/CinematicText.js +++ b/src/CinematicText.js @@ -1,7 +1,7 @@ -import {Engine} from "./engine.js"; +import {Engine} from "./engine"; import {removeChildrenFromElement, - createElement, exceptionAlert} from "../utils/HelperFunctions.js"; + createElement, exceptionAlert} from "../utils/HelperFunctions"; import {isString} from "../utils/StringHelperFunctions"; var cinematicTextFlag = false; diff --git a/src/Company.js b/src/Company.js index f8906d396..7f93f433e 100644 --- a/src/Company.js +++ b/src/Company.js @@ -1,9 +1,9 @@ -import {CONSTANTS} from "./Constants.js"; -import {Locations} from "./Location.js"; -import {Player} from "./Player.js"; +import {CONSTANTS} from "./Constants"; +import {Locations} from "./Location"; +import {Player} from "./Player"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; //Netburner Company class // Note: Company Positions can be loaded every time with init() but Company class needs diff --git a/src/CompanyJobApplication.js b/src/CompanyJobApplication.js deleted file mode 100644 index 4723340b6..000000000 --- a/src/CompanyJobApplication.js +++ /dev/null @@ -1 +0,0 @@ -//TODO probably just move this to whatever file needs it then delete this diff --git a/src/CompanyManagement.js b/src/CompanyManagement.js index 16c391c0c..b52bd8097 100644 --- a/src/CompanyManagement.js +++ b/src/CompanyManagement.js @@ -1,25 +1,25 @@ -import {BitNodeMultipliers} from "./BitNode.js"; -import {Engine} from "./engine.js"; -import {Factions} from "./Faction.js"; -import {showLiterature} from "./Literature.js"; -import {Locations} from "./Location.js"; -import {Player} from "./Player.js"; +import {BitNodeMultipliers} from "./BitNode"; +import {Engine} from "./engine"; +import {Factions} from "./Faction"; +import {showLiterature} from "./Literature"; +import {Locations} from "./Location"; +import {Player} from "./Player"; import Decimal from "decimal.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {getRandomInt, removeElementById, createElement, createAccordionElement, removeChildrenFromElement, createPopup, - clearSelector} from "../utils/HelperFunctions.js"; + clearSelector} from "../utils/HelperFunctions"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; import numeral from "numeral/min/numeral.min"; import {formatNumber, isString, generateRandomString} from "../utils/StringHelperFunctions"; import {yesNoBoxCreate, yesNoTxtInpBoxCreate, yesNoBoxGetYesButton, yesNoBoxGetNoButton, yesNoTxtInpBoxGetYesButton, yesNoTxtInpBoxGetNoButton, yesNoTxtInpBoxGetInput, yesNoBoxClose, - yesNoTxtInpBoxClose, yesNoBoxOpen} from "../utils/YesNoBox.js"; + yesNoTxtInpBoxClose, yesNoBoxOpen} from "../utils/YesNoBox"; /* State */ var companyStates = ["START", "PURCHASE", "PRODUCTION", "SALE", "EXPORT"]; diff --git a/src/CreateProgram.js b/src/CreateProgram.js index d27da7f6d..6bf339860 100644 --- a/src/CreateProgram.js +++ b/src/CreateProgram.js @@ -1,6 +1,6 @@ -import {CONSTANTS} from "./Constants.js"; -import {Player} from "./Player.js"; -import {createElement} from "../utils/HelperFunctions.js"; +import {CONSTANTS} from "./Constants"; +import {Player} from "./Player"; +import {createElement} from "../utils/HelperFunctions"; // a function that returns a requirement for a program that requires only that // the player has at least the given skill level. diff --git a/src/Crimes.js b/src/Crimes.js index cb002f1d6..bb3761855 100644 --- a/src/Crimes.js +++ b/src/Crimes.js @@ -1,6 +1,6 @@ -import {CONSTANTS} from "./Constants.js"; -import {Player} from "./Player.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; +import {CONSTANTS} from "./Constants"; +import {Player} from "./Player"; +import {dialogBoxCreate} from "../utils/DialogBox"; function Crime(name, type, time, money, difficulty, karma, params) { diff --git a/src/DarkWeb.js b/src/DarkWeb.js index 3dd8e34b2..ed0d334c7 100644 --- a/src/DarkWeb.js +++ b/src/DarkWeb.js @@ -1,9 +1,9 @@ -import {Programs} from "./CreateProgram.js"; -import {Player} from "./Player.js"; -import {SpecialServerIps} from "./SpecialServerIps.js"; -import {post} from "./Terminal.js"; +import {Programs} from "./CreateProgram"; +import {Player} from "./Player"; +import {SpecialServerIps} from "./SpecialServerIps"; +import {post} from "./Terminal"; -import {isValidIPAddress} from "../utils/IPAddress.js"; +import {isValidIPAddress} from "../utils/IPAddress"; import {formatNumber} from "../utils/StringHelperFunctions"; diff --git a/src/Faction.js b/src/Faction.js index 4af69703c..0ab119517 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -1,24 +1,24 @@ import {Augmentations, AugmentationNames, - PlayerOwnedAugmentation} from "./Augmentations.js"; -import {BitNodeMultipliers} from "./BitNode.js"; -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; -import {FactionInfos} from "./FactionInfo.js"; -import {Locations} from "./Location.js"; -import {HackingMission, setInMission} from "./Missions.js"; -import {Player} from "./Player.js"; -import {Settings} from "./Settings.js"; + PlayerOwnedAugmentation} from "./Augmentations"; +import {BitNodeMultipliers} from "./BitNode"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; +import {FactionInfos} from "./FactionInfo"; +import {Locations} from "./Location"; +import {HackingMission, setInMission} from "./Missions"; +import {Player} from "./Player"; +import {Settings} from "./Settings"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {factionInvitationBoxCreate} from "../utils/FactionInvitationBox.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {factionInvitationBoxCreate} from "../utils/FactionInvitationBox"; import {clearEventListeners, createElement, - removeChildrenFromElement} from "../utils/HelperFunctions.js"; + removeChildrenFromElement} from "../utils/HelperFunctions"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; import numeral from "numeral/min/numeral.min"; import {formatNumber} from "../utils/StringHelperFunctions"; import {yesNoBoxCreate, yesNoBoxGetYesButton, - yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox.js"; + yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox"; function Faction(name="") { this.name = name; diff --git a/src/Fconf.js b/src/Fconf.js index ac8cf8afc..77cddf622 100644 --- a/src/Fconf.js +++ b/src/Fconf.js @@ -1,4 +1,4 @@ -import {parse, Node} from "../utils/acorn.js"; +import {parse, Node} from "../utils/acorn"; var FconfSettings = { ENABLE_BASH_HOTKEYS: false, diff --git a/src/Gang.js b/src/Gang.js index b3d107c72..99c07afac 100644 --- a/src/Gang.js +++ b/src/Gang.js @@ -1,22 +1,22 @@ -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; import {Faction, Factions, - displayFactionContent} from "./Faction.js"; -import {Player} from "./Player.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; + displayFactionContent} from "./Faction"; +import {Player} from "./Player"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; import {getRandomInt, createElement, removeChildrenFromElement, createAccordionElement, createPopup, - removeElementById, removeElement} from "../utils/HelperFunctions.js"; + removeElementById, removeElement} from "../utils/HelperFunctions"; import numeral from "numeral/min/numeral.min"; import {formatNumber} from "../utils/StringHelperFunctions"; import {yesNoBoxCreate, yesNoTxtInpBoxCreate, yesNoBoxGetYesButton, yesNoBoxGetNoButton, yesNoTxtInpBoxGetYesButton, yesNoTxtInpBoxGetNoButton, yesNoTxtInpBoxGetInput, yesNoBoxClose, - yesNoTxtInpBoxClose, yesNoBoxOpen} from "../utils/YesNoBox.js"; + yesNoTxtInpBoxClose, yesNoBoxOpen} from "../utils/YesNoBox"; /* Gang.js */ //Switch between territory and management screen with 1 and 2 diff --git a/src/HacknetNode.js b/src/HacknetNode.js index 938313a61..5682b90be 100644 --- a/src/HacknetNode.js +++ b/src/HacknetNode.js @@ -1,14 +1,14 @@ -import {BitNodeMultipliers} from "./BitNode.js"; -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; +import {BitNodeMultipliers} from "./BitNode"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; import {iTutorialSteps, iTutorialNextStep, - iTutorialIsRunning, currITutorialStep} from "./InteractiveTutorial.js"; -import {Player} from "./Player.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; + iTutorialIsRunning, currITutorialStep} from "./InteractiveTutorial"; +import {Player} from "./Player"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {clearEventListeners, createElement, - getElementById} from "../utils/HelperFunctions.js"; + getElementById} from "../utils/HelperFunctions"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; import {formatNumber} from "../utils/StringHelperFunctions"; /** diff --git a/src/Infiltration.js b/src/Infiltration.js index 454ab3faa..dc47a096f 100644 --- a/src/Infiltration.js +++ b/src/Infiltration.js @@ -1,10 +1,10 @@ -import {BitNodeMultipliers} from "./BitNode.js"; -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; -import {Player} from "./Player.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {clearEventListeners, getRandomInt} from "../utils/HelperFunctions.js"; -import {infiltrationBoxCreate} from "../utils/InfiltrationBox.js"; +import {BitNodeMultipliers} from "./BitNode"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; +import {Player} from "./Player"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {clearEventListeners, getRandomInt} from "../utils/HelperFunctions"; +import {infiltrationBoxCreate} from "../utils/InfiltrationBox"; import {formatNumber} from "../utils/StringHelperFunctions"; /* Infiltration.js diff --git a/src/InteractiveTutorial.js b/src/InteractiveTutorial.js index 84fe7ebfc..9fa91b782 100644 --- a/src/InteractiveTutorial.js +++ b/src/InteractiveTutorial.js @@ -1,7 +1,7 @@ -import {Engine} from "./engine.js"; -import {Player} from "./Player.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {clearEventListeners} from "../utils/HelperFunctions.js"; +import {Engine} from "./engine"; +import {Player} from "./Player"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {clearEventListeners} from "../utils/HelperFunctions"; /* InteractiveTutorial.js */ let iTutorialSteps = { diff --git a/src/Literature.js b/src/Literature.js index d017dd4f8..bb80e6a70 100644 --- a/src/Literature.js +++ b/src/Literature.js @@ -1,4 +1,4 @@ -import {dialogBoxCreate} from "../utils/DialogBox.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; /* Literature.js * Lore / world building literature that can be found on servers diff --git a/src/Location.js b/src/Location.js index 1d24e3271..a62932dfe 100644 --- a/src/Location.js +++ b/src/Location.js @@ -1,29 +1,29 @@ -import {Bladeburner} from "./Bladeburner.js"; +import {Bladeburner} from "./Bladeburner"; import {CompanyPositions, initCompanies, - Companies, getJobRequirementText} from "./Company.js"; -import {Corporation} from "./CompanyManagement.js"; -import {CONSTANTS} from "./Constants.js"; -import {Crimes} from "./Crimes.js"; -import {Engine} from "./engine.js"; -import {beginInfiltration} from "./Infiltration.js"; -import {hasBladeburnerSF} from "./NetscriptFunctions.js"; -import {Player} from "./Player.js"; -import {Server, AllServers, AddToAllServers} from "./Server.js"; + Companies, getJobRequirementText} from "./Company"; +import {Corporation} from "./CompanyManagement"; +import {CONSTANTS} from "./Constants"; +import {Crimes} from "./Crimes"; +import {Engine} from "./engine"; +import {beginInfiltration} from "./Infiltration"; +import {hasBladeburnerSF} from "./NetscriptFunctions"; +import {Player} from "./Player"; +import {Server, AllServers, AddToAllServers} from "./Server"; import {purchaseServer, - purchaseRamForHomeComputer} from "./ServerPurchases.js"; -import {Settings} from "./Settings.js"; -import {SpecialServerNames, SpecialServerIps} from "./SpecialServerIps.js"; + purchaseRamForHomeComputer} from "./ServerPurchases"; +import {Settings} from "./Settings"; +import {SpecialServerNames, SpecialServerIps} from "./SpecialServerIps"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {clearEventListeners, createElement} from "../utils/HelperFunctions.js"; -import {createRandomIp} from "../utils/IPAddress.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {clearEventListeners, createElement} from "../utils/HelperFunctions"; +import {createRandomIp} from "../utils/IPAddress"; import numeral from "numeral/min/numeral.min"; import {formatNumber} from "../utils/StringHelperFunctions"; import {yesNoBoxCreate, yesNoTxtInpBoxCreate, yesNoBoxGetYesButton, yesNoBoxGetNoButton, yesNoTxtInpBoxGetYesButton, yesNoTxtInpBoxGetNoButton, yesNoTxtInpBoxGetInput, yesNoBoxClose, - yesNoTxtInpBoxClose} from "../utils/YesNoBox.js"; + yesNoTxtInpBoxClose} from "../utils/YesNoBox"; /* Display Location Content when visiting somewhere in the World*/ var Locations = { diff --git a/src/Message.js b/src/Message.js index 1f9aea67c..b99738dca 100644 --- a/src/Message.js +++ b/src/Message.js @@ -1,14 +1,14 @@ import {Augmentations, Augmentation, - AugmentationNames} from "./Augmentations.js"; -import {Programs} from "./CreateProgram.js"; -import {inMission} from "./Missions.js"; -import {Player} from "./Player.js"; -import {redPillFlag} from "./RedPill.js"; -import {GetServerByHostname} from "./Server.js"; -import {Settings} from "./Settings.js"; -import {dialogBoxCreate, dialogBoxOpened} from "../utils/DialogBox.js"; + AugmentationNames} from "./Augmentations"; +import {Programs} from "./CreateProgram"; +import {inMission} from "./Missions"; +import {Player} from "./Player"; +import {redPillFlag} from "./RedPill"; +import {GetServerByHostname} from "./Server"; +import {Settings} from "./Settings"; +import {dialogBoxCreate, dialogBoxOpened} from "../utils/DialogBox"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; /* Message.js */ function Message(filename="", msg="") { diff --git a/src/Missions.js b/src/Missions.js index d7a5e34a7..29eac2dc6 100644 --- a/src/Missions.js +++ b/src/Missions.js @@ -1,11 +1,11 @@ -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; -import {displayFactionContent} from "./Faction.js"; -import {Player} from "./Player.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; +import {displayFactionContent} from "./Faction"; +import {Player} from "./Player"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {addOffset, getRandomInt, clearEventListenersEl, - clearEventListeners} from "../utils/HelperFunctions.js"; + clearEventListeners} from "../utils/HelperFunctions"; import {formatNumber, isString} from "../utils/StringHelperFunctions"; import jsplumb from 'jsplumb' diff --git a/src/NetscriptEnvironment.js b/src/NetscriptEnvironment.js index cf43b4657..dcdacbb77 100644 --- a/src/NetscriptEnvironment.js +++ b/src/NetscriptEnvironment.js @@ -1,6 +1,6 @@ -import {HacknetNode} from "./HacknetNode.js"; -import {NetscriptFunctions} from "./NetscriptFunctions.js"; -import {NetscriptPort} from "./NetscriptPort.js"; +import {HacknetNode} from "./HacknetNode"; +import {NetscriptFunctions} from "./NetscriptFunctions"; +import {NetscriptPort} from "./NetscriptPort"; /* Environment * NetScript program environment diff --git a/src/NetscriptEvaluator.js b/src/NetscriptEvaluator.js index 6f2e33057..74521f242 100644 --- a/src/NetscriptEvaluator.js +++ b/src/NetscriptEvaluator.js @@ -1,16 +1,16 @@ -import {BitNodeMultipliers} from "./BitNode.js"; -import {CONSTANTS} from "./Constants.js"; -import {Player} from "./Player.js"; -import {Environment} from "./NetscriptEnvironment.js"; -import {WorkerScript, addWorkerScript} from "./NetscriptWorker.js"; -import {Server, getServer} from "./Server.js"; -import {Settings} from "./Settings.js"; +import {BitNodeMultipliers} from "./BitNode"; +import {CONSTANTS} from "./Constants"; +import {Player} from "./Player"; +import {Environment} from "./NetscriptEnvironment"; +import {WorkerScript, addWorkerScript} from "./NetscriptWorker"; +import {Server, getServer} from "./Server"; +import {Settings} from "./Settings"; import {Script, findRunningScript, - RunningScript} from "./Script.js"; + RunningScript} from "./Script"; -import {parse, Node} from "../utils/acorn.js"; -import {printArray} from "../utils/HelperFunctions.js"; -import {isValidIPAddress} from "../utils/IPAddress.js"; +import {parse, Node} from "../utils/acorn"; +import {printArray} from "../utils/HelperFunctions"; +import {isValidIPAddress} from "../utils/IPAddress"; import {isString} from "../utils/StringHelperFunctions"; var Promise = require("bluebird"); diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index ebd51ef8b..87dbf6bb1 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -1,60 +1,60 @@ var sprintf = require('sprintf-js').sprintf, vsprintf = require('sprintf-js').vsprintf -import {updateActiveScriptsItems} from "./ActiveScriptsUI.js"; +import {updateActiveScriptsItems} from "./ActiveScriptsUI"; import {Augmentations, Augmentation, augmentationExists, installAugmentations, - AugmentationNames} from "./Augmentations.js"; -import {BitNodeMultipliers} from "./BitNode.js"; -import {determineCrimeSuccess, findCrime} from "./Crimes.js"; -import {Bladeburner} from "./Bladeburner.js"; + AugmentationNames} from "./Augmentations"; +import {BitNodeMultipliers} from "./BitNode"; +import {determineCrimeSuccess, findCrime} from "./Crimes"; +import {Bladeburner} from "./Bladeburner"; import {Companies, Company, CompanyPosition, - CompanyPositions, companyExists} from "./Company.js"; -import {CONSTANTS} from "./Constants.js"; -import {Programs} from "./CreateProgram.js"; -import {DarkWebItems} from "./DarkWeb.js"; -import {Engine} from "./engine.js"; -import {AllGangs} from "./Gang.js"; + CompanyPositions, companyExists} from "./Company"; +import {CONSTANTS} from "./Constants"; +import {Programs} from "./CreateProgram"; +import {DarkWebItems} from "./DarkWeb"; +import {Engine} from "./engine"; +import {AllGangs} from "./Gang"; import {Factions, Faction, joinFaction, - factionExists, purchaseAugmentation} from "./Faction.js"; -import {getCostOfNextHacknetNode, purchaseHacknet} from "./HacknetNode.js"; -import {Locations} from "./Location.js"; -import {Message, Messages} from "./Message.js"; -import {inMission} from "./Missions.js"; -import {Player} from "./Player.js"; + factionExists, purchaseAugmentation} from "./Faction"; +import {getCostOfNextHacknetNode, purchaseHacknet} from "./HacknetNode"; +import {Locations} from "./Location"; +import {Message, Messages} from "./Message"; +import {inMission} from "./Missions"; +import {Player} from "./Player"; import {Script, findRunningScript, RunningScript, - isScriptFilename} from "./Script.js"; + isScriptFilename} from "./Script"; import {Server, getServer, AddToAllServers, AllServers, processSingleServerGrowth, - GetServerByHostname} from "./Server.js"; -import {Settings} from "./Settings.js"; -import {SpecialServerIps} from "./SpecialServerIps.js"; + GetServerByHostname} from "./Server"; +import {Settings} from "./Settings"; +import {SpecialServerIps} from "./SpecialServerIps"; import {StockMarket, StockSymbols, SymbolToStockMap, initStockSymbols, initStockMarket, initSymbolToStockMap, stockMarketCycle, buyStock, sellStock, updateStockPrices, displayStockMarketContent, updateStockTicker, updateStockPlayerPosition, Stock, shortStock, sellShort, OrderTypes, - PositionTypes, placeOrder, cancelOrder} from "./StockMarket.js"; -import {post} from "./Terminal.js"; + PositionTypes, placeOrder, cancelOrder} from "./StockMarket"; +import {post} from "./Terminal"; import {TextFile, getTextFile, createTextFile} from "./TextFile"; import {WorkerScript, workerScripts, - killWorkerScript, NetscriptPorts} from "./NetscriptWorker.js"; + killWorkerScript, NetscriptPorts} from "./NetscriptWorker"; import {makeRuntimeRejectMsg, netscriptDelay, runScriptFromScript, scriptCalculateHackingChance, scriptCalculateHackingTime, scriptCalculateExpGain, scriptCalculatePercentMoneyHacked, - scriptCalculateGrowTime, scriptCalculateWeakenTime} from "./NetscriptEvaluator.js"; -import {Environment} from "./NetscriptEnvironment.js"; -import {NetscriptPort} from "./NetscriptPort.js"; + scriptCalculateGrowTime, scriptCalculateWeakenTime} from "./NetscriptEvaluator"; +import {Environment} from "./NetscriptEnvironment"; +import {NetscriptPort} from "./NetscriptPort"; import Decimal from "decimal.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {printArray, powerOfTwo} from "../utils/HelperFunctions.js"; -import {createRandomIp} from "../utils/IPAddress.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {printArray, powerOfTwo} from "../utils/HelperFunctions"; +import {createRandomIp} from "../utils/IPAddress"; import {formatNumber, isString, isHTML} from "../utils/StringHelperFunctions"; import {yesNoBoxClose, yesNoBoxGetYesButton, yesNoBoxGetNoButton, yesNoBoxCreate, - yesNoBoxOpen} from "../utils/YesNoBox.js"; + yesNoBoxOpen} from "../utils/YesNoBox"; var hasCorporationSF = false, //Source-File 3 hasSingularitySF = false, //Source-File 4 diff --git a/src/NetscriptJSEvaluator.js b/src/NetscriptJSEvaluator.js index 2c5a6d01f..d3fddbf82 100644 --- a/src/NetscriptJSEvaluator.js +++ b/src/NetscriptJSEvaluator.js @@ -1,5 +1,5 @@ -import {registerEnv, unregisterEnv, makeEnvHeader} from "./NetscriptJSPreamble.js"; -import {makeRuntimeRejectMsg} from "./NetscriptEvaluator.js"; +import {registerEnv, unregisterEnv, makeEnvHeader} from "./NetscriptJSPreamble"; +import {makeRuntimeRejectMsg} from "./NetscriptEvaluator"; // Makes a blob that contains the code of a given script. export function makeScriptBlob(code) { @@ -71,7 +71,7 @@ function _getScriptUrls(script, scripts, seen) { // Replace every import statement with an import to a blob url containing // the corresponding script. E.g. // - // import {foo} from "bar.js"; + // import {foo} from "bar"; // // becomes // diff --git a/src/NetscriptPort.js b/src/NetscriptPort.js index 23ec2f109..1a9362932 100644 --- a/src/NetscriptPort.js +++ b/src/NetscriptPort.js @@ -1,4 +1,4 @@ -import {Settings} from "./Settings.js"; +import {Settings} from "./Settings"; function NetscriptPort() { this.data = []; diff --git a/src/NetscriptWorker.js b/src/NetscriptWorker.js index 28902f47d..da9e95470 100644 --- a/src/NetscriptWorker.js +++ b/src/NetscriptWorker.js @@ -1,20 +1,20 @@ import {addActiveScriptsItem, deleteActiveScriptsItem, - updateActiveScriptsItems} from "./ActiveScriptsUI.js"; -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; -import {Environment} from "./NetscriptEnvironment.js"; + updateActiveScriptsItems} from "./ActiveScriptsUI"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; +import {Environment} from "./NetscriptEnvironment"; import {evaluate, isScriptErrorMessage, makeRuntimeRejectMsg, - killNetscriptDelay} from "./NetscriptEvaluator.js"; -import {executeJSScript} from "./NetscriptJSEvaluator.js"; -import {NetscriptPort} from "./NetscriptPort.js"; -import {AllServers} from "./Server.js"; -import {Settings} from "./Settings.js"; + killNetscriptDelay} from "./NetscriptEvaluator"; +import {executeJSScript} from "./NetscriptJSEvaluator"; +import {NetscriptPort} from "./NetscriptPort"; +import {AllServers} from "./Server"; +import {Settings} from "./Settings"; -import {parse} from "../utils/acorn.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {compareArrays, printArray} from "../utils/HelperFunctions.js"; +import {parse} from "../utils/acorn"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {compareArrays, printArray} from "../utils/HelperFunctions"; function WorkerScript(runningScriptObj) { this.name = runningScriptObj.filename; @@ -189,7 +189,7 @@ function runScriptsLoop() { //If it isn't running, start the script if (workerScripts[i].running == false && workerScripts[i].env.stopFlag == false) { let p = null; // p is the script's result promise. - if (workerScripts[i].name.endsWith(".js") || workerScripts[i].name.endsWith(".ns")) { + if (workerScripts[i].name.endsWith("") || workerScripts[i].name.endsWith(".ns")) { p = startJsScript(workerScripts[i]); } else { try { diff --git a/src/Player.js b/src/Player.js index effd037cc..acf935823 100644 --- a/src/Player.js +++ b/src/Player.js @@ -1,30 +1,30 @@ import {Augmentations, applyAugmentation, AugmentationNames, - PlayerOwnedAugmentation} from "./Augmentations.js"; -import {BitNodes, BitNode, BitNodeMultipliers} from "./BitNode.js"; + PlayerOwnedAugmentation} from "./Augmentations"; +import {BitNodes, BitNode, BitNodeMultipliers} from "./BitNode"; import {Company, Companies, getNextCompanyPosition, getJobRequirementText, CompanyPosition, - CompanyPositions} from "./Company.js"; -import {CONSTANTS} from "./Constants.js"; -import {Corporation} from "./CompanyManagement.js"; -import {Programs} from "./CreateProgram.js"; -import {determineCrimeSuccess, Crimes} from "./Crimes.js"; -import {Engine} from "./engine.js"; + CompanyPositions} from "./Company"; +import {CONSTANTS} from "./Constants"; +import {Corporation} from "./CompanyManagement"; +import {Programs} from "./CreateProgram"; +import {determineCrimeSuccess, Crimes} from "./Crimes"; +import {Engine} from "./engine"; import {Factions, Faction, - displayFactionContent} from "./Faction.js"; -import {Gang, resetGangs} from "./Gang.js"; -import {Locations} from "./Location.js"; -import {hasBn11SF, hasWallStreetSF,hasAISF} from "./NetscriptFunctions.js"; -import {AllServers, Server, AddToAllServers} from "./Server.js"; -import {SpecialServerIps, SpecialServerNames} from "./SpecialServerIps.js"; -import {SourceFiles, applySourceFile} from "./SourceFile.js"; + displayFactionContent} from "./Faction"; +import {Gang, resetGangs} from "./Gang"; +import {Locations} from "./Location"; +import {hasBn11SF, hasWallStreetSF,hasAISF} from "./NetscriptFunctions"; +import {AllServers, Server, AddToAllServers} from "./Server"; +import {SpecialServerIps, SpecialServerNames} from "./SpecialServerIps"; +import {SourceFiles, applySourceFile} from "./SourceFile"; import Decimal from "decimal.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {clearEventListeners} from "../utils/HelperFunctions.js"; -import {createRandomIp} from "../utils/IPAddress.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {clearEventListeners} from "../utils/HelperFunctions"; +import {createRandomIp} from "../utils/IPAddress"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; import numeral from "numeral/min/numeral.min"; import {formatNumber, convertTimeMsToTimeElapsedString} from "../utils/StringHelperFunctions"; diff --git a/src/Prestige.js b/src/Prestige.js index ce8ce4325..a1c93d76d 100644 --- a/src/Prestige.js +++ b/src/Prestige.js @@ -1,39 +1,39 @@ -import {deleteActiveScriptsItem} from "./ActiveScriptsUI.js"; +import {deleteActiveScriptsItem} from "./ActiveScriptsUI"; import {Augmentations, augmentationExists, - initAugmentations, AugmentationNames} from "./Augmentations.js"; -import {initBitNodeMultipliers} from "./BitNode.js"; -import {Bladeburner} from "./Bladeburner.js"; -import {writeCinematicText} from "./CinematicText.js"; -import {Companies, Company, initCompanies} from "./Company.js"; -import {Programs} from "./CreateProgram.js"; -import {Engine} from "./engine.js"; + initAugmentations, AugmentationNames} from "./Augmentations"; +import {initBitNodeMultipliers} from "./BitNode"; +import {Bladeburner} from "./Bladeburner"; +import {writeCinematicText} from "./CinematicText"; +import {Companies, Company, initCompanies} from "./Company"; +import {Programs} from "./CreateProgram"; +import {Engine} from "./engine"; import {Factions, Faction, initFactions, - joinFaction} from "./Faction.js"; -import {deleteGangDisplayContent} from "./Gang.js"; -import {Locations} from "./Location.js"; -import {initMessages, Messages, Message} from "./Message.js"; -import {initSingularitySFFlags, hasWallStreetSF}from "./NetscriptFunctions.js"; + joinFaction} from "./Faction"; +import {deleteGangDisplayContent} from "./Gang"; +import {Locations} from "./Location"; +import {initMessages, Messages, Message} from "./Message"; +import {initSingularitySFFlags, hasWallStreetSF}from "./NetscriptFunctions"; import {WorkerScript, workerScripts, - prestigeWorkerScripts} from "./NetscriptWorker.js"; -import {Player} from "./Player.js"; + prestigeWorkerScripts} from "./NetscriptWorker"; +import {Player} from "./Player"; import {AllServers, AddToAllServers, initForeignServers, Server, prestigeAllServers, - prestigeHomeComputer} from "./Server.js"; + prestigeHomeComputer} from "./Server"; import {SpecialServerIps, SpecialServerIpsMap, prestigeSpecialServerIps, - SpecialServerNames} from "./SpecialServerIps.js"; + SpecialServerNames} from "./SpecialServerIps"; import {initStockMarket, initSymbolToStockMap, stockMarketContentCreated, - setStockMarketContentCreated} from "./StockMarket.js"; -import {Terminal, postNetburnerText} from "./Terminal.js"; + setStockMarketContentCreated} from "./StockMarket"; +import {Terminal, postNetburnerText} from "./Terminal"; import Decimal from "decimal.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {createPopup, createElement, - removeElementById, exceptionAlert} from "../utils/HelperFunctions.js"; + removeElementById, exceptionAlert} from "../utils/HelperFunctions"; import {yesNoBoxCreate, yesNoBoxGetYesButton, - yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox.js"; + yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox"; let BitNode8StartingMoney = 250e6; diff --git a/src/RedPill.js b/src/RedPill.js index 31f89a7f3..bcc3236ea 100644 --- a/src/RedPill.js +++ b/src/RedPill.js @@ -1,16 +1,16 @@ -import {BitNode, BitNodes} from "./BitNode.js"; -import {Engine} from "./engine.js"; -import {Player} from "./Player.js"; -import {prestigeSourceFile} from "./Prestige.js"; +import {BitNode, BitNodes} from "./BitNode"; +import {Engine} from "./engine"; +import {Player} from "./Player"; +import {prestigeSourceFile} from "./Prestige"; import {SourceFiles, SourceFile, - PlayerOwnedSourceFile} from "./SourceFile.js"; -import {Terminal} from "./Terminal.js"; + PlayerOwnedSourceFile} from "./SourceFile"; +import {Terminal} from "./Terminal"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {clearEventListeners, - removeChildrenFromElement} from "../utils/HelperFunctions.js"; + removeChildrenFromElement} from "../utils/HelperFunctions"; import {yesNoBoxCreate, yesNoBoxGetYesButton, - yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox.js"; + yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox"; /* RedPill.js * Implements what happens when you have Red Pill augmentation and then hack the world daemon */ diff --git a/src/SaveObject.js b/src/SaveObject.js index eb08fc7a9..44d8172f6 100644 --- a/src/SaveObject.js +++ b/src/SaveObject.js @@ -1,28 +1,28 @@ import {loadAliases, loadGlobalAliases, - Aliases, GlobalAliases} from "./Alias.js"; + Aliases, GlobalAliases} from "./Alias"; import {loadCompanies, Companies, - CompanyPositions} from "./Company.js"; -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; + CompanyPositions} from "./Company"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; import {loadFactions, Factions, - processPassiveFactionRepGain} from "./Faction.js"; -import {FconfSettings, loadFconf} from "./Fconf.js"; -import {loadAllGangs, AllGangs} from "./Gang.js"; + processPassiveFactionRepGain} from "./Faction"; +import {FconfSettings, loadFconf} from "./Fconf"; +import {loadAllGangs, AllGangs} from "./Gang"; import {processAllHacknetNodeEarnings, - createPlayerHacknetNodeWrappers} from "./HacknetNode.js"; -import {loadMessages, initMessages, Messages} from "./Message.js"; -import {Player, loadPlayer} from "./Player.js"; -import {loadAllRunningScripts} from "./Script.js"; -import {AllServers, loadAllServers} from "./Server.js"; -import {loadSettings, initSettings, Settings} from "./Settings.js"; -import {loadSpecialServerIps, SpecialServerIps} from "./SpecialServerIps.js"; -import {loadStockMarket, StockMarket} from "./StockMarket.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {gameOptionsBoxClose} from "../utils/GameOptions.js"; + createPlayerHacknetNodeWrappers} from "./HacknetNode"; +import {loadMessages, initMessages, Messages} from "./Message"; +import {Player, loadPlayer} from "./Player"; +import {loadAllRunningScripts} from "./Script"; +import {AllServers, loadAllServers} from "./Server"; +import {loadSettings, initSettings, Settings} from "./Settings"; +import {loadSpecialServerIps, SpecialServerIps} from "./SpecialServerIps"; +import {loadStockMarket, StockMarket} from "./StockMarket"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {gameOptionsBoxClose} from "../utils/GameOptions"; import {clearEventListeners, createElement, - createPopup, removeElementById} from "../utils/HelperFunctions.js"; + createPopup, removeElementById} from "../utils/HelperFunctions"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; import {formatNumber} from "../utils/StringHelperFunctions"; import Decimal from "decimal.js"; diff --git a/src/Script.js b/src/Script.js index 88981d632..93fa6b06b 100644 --- a/src/Script.js +++ b/src/Script.js @@ -17,26 +17,26 @@ require("brace/ext/language_tools"); // Importing this doesn't work for some reason. const walk = require("acorn/dist/walk"); -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; -import {FconfSettings, parseFconfSettings} from "./Fconf.js"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; +import {FconfSettings, parseFconfSettings} from "./Fconf"; import {iTutorialSteps, iTutorialNextStep, - iTutorialIsRunning, currITutorialStep} from "./InteractiveTutorial.js"; -import {evaluateImport} from "./NetscriptEvaluator.js"; -import {NetscriptFunctions} from "./NetscriptFunctions.js"; + iTutorialIsRunning, currITutorialStep} from "./InteractiveTutorial"; +import {evaluateImport} from "./NetscriptEvaluator"; +import {NetscriptFunctions} from "./NetscriptFunctions"; import {addWorkerScript, killWorkerScript, - WorkerScript} from "./NetscriptWorker.js"; -import {Player} from "./Player.js"; -import {AllServers, processSingleServerGrowth} from "./Server.js"; -import {Settings} from "./Settings.js"; -import {post, Terminal} from "./Terminal.js"; + WorkerScript} from "./NetscriptWorker"; +import {Player} from "./Player"; +import {AllServers, processSingleServerGrowth} from "./Server"; +import {Settings} from "./Settings"; +import {post, Terminal} from "./Terminal"; import {TextFile} from "./TextFile"; -import {parse, Node} from "../utils/acorn.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; +import {parse, Node} from "../utils/acorn"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; -import {compareArrays, createElement} from "../utils/HelperFunctions.js"; + Generic_fromJSON} from "../utils/JSONReviver"; +import {compareArrays, createElement} from "../utils/HelperFunctions"; import {formatNumber, numOccurrences, numNetscriptOperators} from "../utils/StringHelperFunctions"; @@ -47,7 +47,7 @@ var keybindings = { }; function isScriptFilename(f) { - return f.endsWith(".js") || f.endsWith(".script") || f.endsWith(".ns"); + return f.endsWith("") || f.endsWith(".script") || f.endsWith(".ns"); } var scriptEditorRamCheck = null, scriptEditorRamText = null; @@ -714,7 +714,7 @@ function calculateRamUsage(codeCopy) { } Script.prototype.download = function() { - var filename = this.filename + ".js"; + var filename = this.filename + ""; var file = new Blob([this.code], {type: 'text/plain'}); if (window.navigator.msSaveOrOpenBlob) {// IE10+ window.navigator.msSaveOrOpenBlob(file, filename); diff --git a/src/Server.js b/src/Server.js index 20a379d64..4cb987028 100644 --- a/src/Server.js +++ b/src/Server.js @@ -1,13 +1,13 @@ -import {BitNodeMultipliers} from "./BitNode.js"; -import {CONSTANTS} from "./Constants.js"; -import {Programs} from "./CreateProgram.js"; -import {Player} from "./Player.js"; -import {RunningScript, Script} from "./Script.js"; -import {SpecialServerNames, SpecialServerIps} from "./SpecialServerIps.js"; -import {getRandomInt} from "../utils/HelperFunctions.js"; -import {createRandomIp, isValidIPAddress, ipExists} from "../utils/IPAddress.js"; +import {BitNodeMultipliers} from "./BitNode"; +import {CONSTANTS} from "./Constants"; +import {Programs} from "./CreateProgram"; +import {Player} from "./Player"; +import {RunningScript, Script} from "./Script"; +import {SpecialServerNames, SpecialServerIps} from "./SpecialServerIps"; +import {getRandomInt} from "../utils/HelperFunctions"; +import {createRandomIp, isValidIPAddress, ipExists} from "../utils/IPAddress"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; function Server(params={ip:createRandomIp(), hostname:""}) { /* Properties */ diff --git a/src/ServerPurchases.js b/src/ServerPurchases.js index 5c0c7849c..18915770b 100644 --- a/src/ServerPurchases.js +++ b/src/ServerPurchases.js @@ -1,9 +1,9 @@ -import {CONSTANTS} from "./Constants.js"; -import {Player} from "./Player.js"; -import {Server, AllServers, AddToAllServers} from "./Server.js"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {createRandomIp} from "../utils/IPAddress.js"; -import {yesNoTxtInpBoxGetInput} from "../utils/YesNoBox.js"; +import {CONSTANTS} from "./Constants"; +import {Player} from "./Player"; +import {Server, AllServers, AddToAllServers} from "./Server"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {createRandomIp} from "../utils/IPAddress"; +import {yesNoTxtInpBoxGetInput} from "../utils/YesNoBox"; /* Functions to handle any server-related purchasing: diff --git a/src/Settings.js b/src/Settings.js index a09772502..335e6437c 100644 --- a/src/Settings.js +++ b/src/Settings.js @@ -1,4 +1,4 @@ -import {Engine} from "./engine.js"; +import {Engine} from "./engine"; /* Settings.js */ let Settings = { diff --git a/src/SourceFile.js b/src/SourceFile.js index 99eb5e72d..3079dc858 100644 --- a/src/SourceFile.js +++ b/src/SourceFile.js @@ -1,5 +1,5 @@ -import {Player} from "./Player.js"; -import {BitNode, BitNodes} from "./BitNode.js"; +import {Player} from "./Player"; +import {BitNode, BitNodes} from "./BitNode"; /* SourceFile.js */ //Each SourceFile corresponds to a BitNode with the same number diff --git a/src/SpecialServerIps.js b/src/SpecialServerIps.js index d92d12692..d3175dc01 100644 --- a/src/SpecialServerIps.js +++ b/src/SpecialServerIps.js @@ -1,5 +1,5 @@ import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; /* Holds IP of Special Servers */ let SpecialServerNames = { diff --git a/src/StockMarket.js b/src/StockMarket.js index 7dc46c5bd..7468eac8c 100644 --- a/src/StockMarket.js +++ b/src/StockMarket.js @@ -1,23 +1,23 @@ -import {CONSTANTS} from "./Constants.js"; -import {Engine} from "./engine.js"; -import {Locations} from "./Location.js"; -import {hasWallStreetSF, wallStreetSFLvl} from "./NetscriptFunctions.js"; -import {WorkerScript} from "./NetscriptWorker.js"; -import {Player} from "./Player.js"; +import {CONSTANTS} from "./Constants"; +import {Engine} from "./engine"; +import {Locations} from "./Location"; +import {hasWallStreetSF, wallStreetSFLvl} from "./NetscriptFunctions"; +import {WorkerScript} from "./NetscriptWorker"; +import {Player} from "./Player"; -import {dialogBoxCreate} from "../utils/DialogBox.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; import {clearEventListeners, getRandomInt, removeElementById, - clearEventListenersEl} from "../utils/HelperFunctions.js"; + clearEventListenersEl} from "../utils/HelperFunctions"; import {Reviver, Generic_toJSON, - Generic_fromJSON} from "../utils/JSONReviver.js"; + Generic_fromJSON} from "../utils/JSONReviver"; import numeral from "numeral/min/numeral.min"; import {formatNumber} from "../utils/StringHelperFunctions"; import {yesNoBoxCreate, yesNoTxtInpBoxCreate, yesNoBoxGetYesButton, yesNoBoxGetNoButton, yesNoTxtInpBoxGetYesButton, yesNoTxtInpBoxGetNoButton, yesNoTxtInpBoxGetInput, yesNoBoxClose, - yesNoTxtInpBoxClose, yesNoBoxOpen} from "../utils/YesNoBox.js"; + yesNoTxtInpBoxClose, yesNoBoxOpen} from "../utils/YesNoBox"; let StockPriceCap = 1e9; //Put a limit on how high a price can go diff --git a/src/Terminal.js b/src/Terminal.js index 3b4eae01d..aa12a3f4f 100644 --- a/src/Terminal.js +++ b/src/Terminal.js @@ -1,45 +1,45 @@ import {substituteAliases, printAliases, parseAliasDeclaration, removeAlias, GlobalAliases, - Aliases} from "./Alias.js"; -import {CONSTANTS} from "./Constants.js"; -import {Programs} from "./CreateProgram.js"; + Aliases} from "./Alias"; +import {CONSTANTS} from "./Constants"; +import {Programs} from "./CreateProgram"; import {executeDarkwebTerminalCommand, checkIfConnectedToDarkweb, - DarkWebItems} from "./DarkWeb.js"; -import {Engine} from "./engine.js"; + DarkWebItems} from "./DarkWeb"; +import {Engine} from "./engine"; import {FconfSettings, parseFconfSettings, - createFconf} from "./Fconf.js"; + createFconf} from "./Fconf"; import {TerminalHelpText, HelpTexts} from "./HelpText"; import {iTutorialNextStep, iTutorialSteps, iTutorialIsRunning, - currITutorialStep} from "./InteractiveTutorial.js"; -import {showLiterature} from "./Literature.js"; -import {showMessage, Message} from "./Message.js"; + currITutorialStep} from "./InteractiveTutorial"; +import {showLiterature} from "./Literature"; +import {showMessage, Message} from "./Message"; import {scriptCalculateHackingTime, scriptCalculateGrowTime, - scriptCalculateWeakenTime} from "./NetscriptEvaluator.js"; -import {killWorkerScript, addWorkerScript} from "./NetscriptWorker.js"; + scriptCalculateWeakenTime} from "./NetscriptEvaluator"; +import {killWorkerScript, addWorkerScript} from "./NetscriptWorker"; import numeral from "numeral/min/numeral.min"; -import {Player} from "./Player.js"; -import {hackWorldDaemon} from "./RedPill.js"; +import {Player} from "./Player"; +import {hackWorldDaemon} from "./RedPill"; import {findRunningScript, RunningScript, AllServersMap, Script, - isScriptFilename} from "./Script.js"; + isScriptFilename} from "./Script"; import {AllServers, GetServerByHostname, - getServer, Server} from "./Server.js"; -import {Settings} from "./Settings.js"; + getServer, Server} from "./Server"; +import {Settings} from "./Settings"; import {SpecialServerIps, - SpecialServerNames} from "./SpecialServerIps.js"; + SpecialServerNames} from "./SpecialServerIps"; import {TextFile, getTextFile} from "./TextFile"; import {containsAllStrings, longestCommonStart, formatNumber, isString} from "../utils/StringHelperFunctions"; -import {addOffset, printArray} from "../utils/HelperFunctions.js"; -import {logBoxCreate} from "../utils/LogBox.js"; +import {addOffset, printArray} from "../utils/HelperFunctions"; +import {logBoxCreate} from "../utils/LogBox"; import {yesNoBoxCreate, yesNoBoxGetYesButton, - yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox.js"; + yesNoBoxGetNoButton, yesNoBoxClose} from "../utils/YesNoBox"; import * as JSZip from 'jszip'; import * as FileSaver from 'file-saver'; @@ -1054,7 +1054,7 @@ let Terminal = { if (fn === "*" || fn === "*.script") { for (var i = 0; i < s.scripts.length; ++i) { var file = new Blob([s.scripts[i].code], {type:"text/plain"}); - zip.file(s.scripts[i].filename + ".js", file); + zip.file(s.scripts[i].filename + "", file); } } if (fn === "*" || fn === "*.txt") { @@ -1327,7 +1327,7 @@ let Terminal = { //Check if its a script or just a program/executable //if (isScriptFilename(executableName)) { - if (executableName.includes(".script") || executableName.includes(".js") || executableName.includes(".ns")) { + if (executableName.includes(".script") || executableName.includes("") || executableName.includes(".ns")) { Terminal.runScript(executableName); } else { Terminal.runProgram(executableName); diff --git a/src/engine.js b/src/engine.js index b8fd2e625..066184c87 100644 --- a/src/engine.js +++ b/src/engine.js @@ -1,67 +1,67 @@ -import {dialogBoxCreate} from "../utils/DialogBox.js"; -import {gameOptionsBoxOpen, gameOptionsBoxClose}from "../utils/GameOptions.js"; +import {dialogBoxCreate} from "../utils/DialogBox"; +import {gameOptionsBoxOpen, gameOptionsBoxClose}from "../utils/GameOptions"; import {clearEventListeners, createElement, removeChildrenFromElement, - exceptionAlert} from "../utils/HelperFunctions.js"; + exceptionAlert} from "../utils/HelperFunctions"; import numeral from "numeral/min/numeral.min"; import {formatNumber, convertTimeMsToTimeElapsedString, replaceAt} from "../utils/StringHelperFunctions"; import {loxBoxCreate, logBoxUpdateText, - logBoxOpened} from "../utils/LogBox.js"; + logBoxOpened} from "../utils/LogBox"; -import {updateActiveScriptsItems} from "./ActiveScriptsUI.js"; +import {updateActiveScriptsItems} from "./ActiveScriptsUI"; import {Augmentations, installAugmentations, initAugmentations, AugmentationNames, displayAugmentationsContent, - PlayerOwnedAugmentation} from "./Augmentations.js"; + PlayerOwnedAugmentation} from "./Augmentations"; import {BitNodes, initBitNodes, - initBitNodeMultipliers} from "./BitNode.js"; -import {Bladeburner} from "./Bladeburner.js"; -import {cinematicTextFlag} from "./CinematicText.js"; -import {CompanyPositions, initCompanies} from "./Company.js"; -import {Corporation} from "./CompanyManagement.js"; -import {CONSTANTS} from "./Constants.js"; + initBitNodeMultipliers} from "./BitNode"; +import {Bladeburner} from "./Bladeburner"; +import {cinematicTextFlag} from "./CinematicText"; +import {CompanyPositions, initCompanies} from "./Company"; +import {Corporation} from "./CompanyManagement"; +import {CONSTANTS} from "./Constants"; import {displayCreateProgramContent, getNumAvailableCreateProgram, initCreateProgramButtons, - Programs} from "./CreateProgram.js"; + Programs} from "./CreateProgram"; import {displayFactionContent, joinFaction, processPassiveFactionRepGain, Factions, - inviteToFaction, initFactions} from "./Faction.js"; -import {FconfSettings} from "./Fconf.js"; + inviteToFaction, initFactions} from "./Faction"; +import {FconfSettings} from "./Fconf"; import {Locations, displayLocationContent, - initLocationButtons} from "./Location.js"; + initLocationButtons} from "./Location"; import {displayGangContent, updateGangContent, - Gang} from "./Gang.js"; + Gang} from "./Gang"; import {displayHacknetNodesContent, processAllHacknetNodeEarnings, - updateHacknetNodesContent} from "./HacknetNode.js"; -import {iTutorialStart} from "./InteractiveTutorial.js"; -import {initLiterature} from "./Literature.js"; -import {checkForMessagesToSend, initMessages} from "./Message.js"; -import {inMission, currMission} from "./Missions.js"; + updateHacknetNodesContent} from "./HacknetNode"; +import {iTutorialStart} from "./InteractiveTutorial"; +import {initLiterature} from "./Literature"; +import {checkForMessagesToSend, initMessages} from "./Message"; +import {inMission, currMission} from "./Missions"; import {initSingularitySFFlags, - hasSingularitySF, hasCorporationSF} from "./NetscriptFunctions.js"; + hasSingularitySF, hasCorporationSF} from "./NetscriptFunctions"; import {updateOnlineScriptTimes, - runScriptsLoop} from "./NetscriptWorker.js"; -import {Player} from "./Player.js"; + runScriptsLoop} from "./NetscriptWorker"; +import {Player} from "./Player"; import {prestigeAugmentation, - prestigeSourceFile} from "./Prestige.js"; -import {redPillFlag, hackWorldDaemon} from "./RedPill.js"; -import {saveObject, loadGame} from "./SaveObject.js"; + prestigeSourceFile} from "./Prestige"; +import {redPillFlag, hackWorldDaemon} from "./RedPill"; +import {saveObject, loadGame} from "./SaveObject"; import {loadAllRunningScripts, scriptEditorInit, - updateScriptEditorContent} from "./Script.js"; -import {AllServers, Server, initForeignServers} from "./Server.js"; -import {Settings, setSettingsLabels} from "./Settings.js"; + updateScriptEditorContent} from "./Script"; +import {AllServers, Server, initForeignServers} from "./Server"; +import {Settings, setSettingsLabels} from "./Settings"; import {initSourceFiles, SourceFiles, - PlayerOwnedSourceFile} from "./SourceFile.js"; -import {SpecialServerIps, initSpecialServerIps} from "./SpecialServerIps.js"; + PlayerOwnedSourceFile} from "./SourceFile"; +import {SpecialServerIps, initSpecialServerIps} from "./SpecialServerIps"; import {StockMarket, StockSymbols, SymbolToStockMap, initStockSymbols, initSymbolToStockMap, stockMarketCycle, updateStockPrices, - displayStockMarketContent} from "./StockMarket.js"; -import {Terminal, postNetburnerText, post, KEY} from "./Terminal.js"; + displayStockMarketContent} from "./StockMarket"; +import {Terminal, postNetburnerText, post, KEY} from "./Terminal"; /* Shortcuts to navigate through the game * Alt-t - Terminal diff --git a/utils/FactionInvitationBox.js b/utils/FactionInvitationBox.js index 7fc1de8cf..bebd567f8 100644 --- a/utils/FactionInvitationBox.js +++ b/utils/FactionInvitationBox.js @@ -1,7 +1,7 @@ -import {Faction, joinFaction} from "../src/Faction.js"; -import {Engine} from "../src/engine.js"; -import {Player} from "../src/Player.js"; -import {clearEventListeners} from "./HelperFunctions.js"; +import {Faction, joinFaction} from "../src/Faction"; +import {Engine} from "../src/engine"; +import {Player} from "../src/Player"; +import {clearEventListeners} from "./HelperFunctions"; /* Faction Invitation Pop-up box */ function factionInvitationBoxClose() { diff --git a/utils/HelperFunctions.js b/utils/HelperFunctions.js index 9f07ff54c..6231cf78b 100644 --- a/utils/HelperFunctions.js +++ b/utils/HelperFunctions.js @@ -1,6 +1,6 @@ //General helper functions import {isString} from "./StringHelperFunctions"; -import {dialogBoxCreate} from "./DialogBox.js"; +import {dialogBoxCreate} from "./DialogBox"; //Returns the size (number of keys) of an object function sizeOfObject(obj) { diff --git a/utils/IPAddress.js b/utils/IPAddress.js index 493d1a041..90719d70c 100644 --- a/utils/IPAddress.js +++ b/utils/IPAddress.js @@ -1,4 +1,4 @@ -import {AllServers} from "../src/Server.js"; +import {AllServers} from "../src/Server"; /* Functions to deal with manipulating IP addresses*/ //Generate a random IP address diff --git a/utils/InfiltrationBox.js b/utils/InfiltrationBox.js index 77bc501ad..8988458f4 100644 --- a/utils/InfiltrationBox.js +++ b/utils/InfiltrationBox.js @@ -1,9 +1,9 @@ -import {BitNodeMultipliers} from "../src/BitNode.js"; -import {CONSTANTS} from "../src/Constants.js"; -import {Factions, Faction} from "../src/Faction.js"; -import {Player} from "../src/Player.js"; -import {dialogBoxCreate} from "./DialogBox.js"; -import {clearEventListeners} from "./HelperFunctions.js"; +import {BitNodeMultipliers} from "../src/BitNode"; +import {CONSTANTS} from "../src/Constants"; +import {Factions, Faction} from "../src/Faction"; +import {Player} from "../src/Player"; +import {dialogBoxCreate} from "./DialogBox"; +import {clearEventListeners} from "./HelperFunctions"; import {formatNumber} from "./StringHelperFunctions"; /* InfiltrationBox.js */ diff --git a/utils/LogBox.js b/utils/LogBox.js index 5222afeb3..627bdce22 100644 --- a/utils/LogBox.js +++ b/utils/LogBox.js @@ -1,5 +1,5 @@ -import {killWorkerScript} from "../src/NetscriptWorker.js"; -import {printArray, clearEventListeners} from "./HelperFunctions.js"; +import {killWorkerScript} from "../src/NetscriptWorker"; +import {printArray, clearEventListeners} from "./HelperFunctions"; $(document).keydown(function(event) { if (logBoxOpened && event.keyCode == 27) { diff --git a/utils/StringHelperFunctions.ts b/utils/StringHelperFunctions.ts index 4f1994bd9..e9dc724cd 100644 --- a/utils/StringHelperFunctions.ts +++ b/utils/StringHelperFunctions.ts @@ -1,4 +1,4 @@ -import { dialogBoxCreate } from "./DialogBox.js"; +import { dialogBoxCreate } from "./DialogBox"; // Netburner String helper functions diff --git a/utils/YesNoBox.js b/utils/YesNoBox.js index f9f9366c5..8b35c1752 100644 --- a/utils/YesNoBox.js +++ b/utils/YesNoBox.js @@ -1,4 +1,4 @@ -import {clearEventListeners} from "./HelperFunctions.js"; +import {clearEventListeners} from "./HelperFunctions"; /* Generic Yes-No Pop-up box * Can be used to create pop-up boxes that require a yes/no response from player */