mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-17 01:41:22 +01:00
don't consider localhost as PRODUCTION
This commit is contained in:
parent
055c55b731
commit
f07cbe9323
6 changed files with 7 additions and 10 deletions
|
|
@ -4313,6 +4313,7 @@
|
|||
<script defer src="modules/ui/emblems-editor.js"></script>
|
||||
<script defer src="modules/ui/editors.js"></script>
|
||||
<script defer src="modules/ui/3d.js"></script>
|
||||
<script defer src="modules/ui/hotkeys.js"></script>
|
||||
<script defer src="libs/rgbquant.min.js"></script>
|
||||
<script defer src="libs/jquery.ui.touch-punch.min.js"></script>
|
||||
<script defer src="libs/pell.min.js"></script>
|
||||
|
|
|
|||
2
main.js
2
main.js
|
|
@ -6,7 +6,7 @@ const version = "1.661"; // generator version
|
|||
document.title += " v" + version;
|
||||
|
||||
// Switches to disable/enable logging features
|
||||
const PRODUCTION = window.location.host;
|
||||
const PRODUCTION = location.hostname && location.hostname !== "localhost" && location.hostname !== "127.0.0.1";
|
||||
const DEBUG = localStorage.getItem("debug");
|
||||
const INFO = DEBUG || !PRODUCTION;
|
||||
const TIME = DEBUG || !PRODUCTION;
|
||||
|
|
|
|||
|
|
@ -1795,7 +1795,7 @@ window.COArenderer = (function () {
|
|||
return fetchedCharges.join("");
|
||||
}
|
||||
|
||||
const url = PRODUCTION ? "./charges/" : "http://armoria.herokuapp.com/charges/"; // on local machine fetch files from server
|
||||
const url = location.hostname ? "./charges/" : "http://armoria.herokuapp.com/charges/"; // on local machine fetch files from server
|
||||
async function fetchCharge(charge, id) {
|
||||
const fetched = fetch(url + charge + ".svg")
|
||||
.then(res => {
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ async function getMapURL(type, options = {}) {
|
|||
}
|
||||
|
||||
// replace ocean pattern href to base64
|
||||
if (PRODUCTION && cloneEl.getElementById("oceanicPattern")) {
|
||||
if (location.hostname && cloneEl.getElementById("oceanicPattern")) {
|
||||
const el = cloneEl.getElementById("oceanicPattern");
|
||||
const url = el.getAttribute("href");
|
||||
await new Promise(resolve => {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ $(window).resize(function (e) {
|
|||
changeMapSize();
|
||||
});
|
||||
|
||||
window.onbeforeunload = () => "Are you sure you want to navigate away?";
|
||||
if (location.hostname && location.hostname !== "localhost" && location.hostname !== "127.0.0.1") {
|
||||
window.onbeforeunload = () => "Are you sure you want to navigate away?";
|
||||
}
|
||||
|
||||
// Tooltips
|
||||
const tooltip = document.getElementById("tooltip");
|
||||
|
|
@ -19,12 +21,6 @@ document.getElementById("dialogs").addEventListener("mousemove", showDataTip);
|
|||
document.getElementById("optionsContainer").addEventListener("mousemove", showDataTip);
|
||||
document.getElementById("exitCustomization").addEventListener("mousemove", showDataTip);
|
||||
|
||||
/**
|
||||
* @param {string} tip Tooltip text
|
||||
* @param {boolean} main Show above other tooltips
|
||||
* @param {string} type Message type (color): error / warn / success
|
||||
* @param {number} time Timeout to auto hide, ms
|
||||
*/
|
||||
function tip(tip = "Tip is undefined", main, type, time) {
|
||||
tooltip.innerHTML = tip;
|
||||
tooltip.style.background = "linear-gradient(0.1turn, #ffffff00, #5e5c5c80, #ffffff00)";
|
||||
|
|
|
|||
0
modules/ui/hotkeys.js
Normal file
0
modules/ui/hotkeys.js
Normal file
Loading…
Add table
Add a link
Reference in a new issue