From 1b1da5655a009b7b26ff073ad60b70d7aacd780e Mon Sep 17 00:00:00 2001 From: SunSung-W541-2025 Date: Wed, 11 Feb 2026 19:25:56 +0100 Subject: [PATCH] =?UTF-8?q?add/data/export-cave-glade=20[1.2.2-add-data-ex?= =?UTF-8?q?port-cave-gla.0]=20=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D1=83=20=D0=BA?= =?UTF-8?q?=D0=BE=D1=82=D0=BE=D1=80=D0=B0=D1=8F=20=D0=BB=D0=BE=D0=BC=D0=B0?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=B2=D1=81=D0=B5=20=D0=BF=D1=80=D0=B8=20=D1=87?= =?UTF-8?q?=D0=B0=D1=81=D1=82=D1=8B=D1=85=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D1=81=D0=B0=D1=85=20=D0=BA=20=D0=B0=D0=BF=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/js/Cave.js | 41 ++++++++++++++++++++++++++--------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index ecb7f97..0e44858 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fantasy-maphub", "name_full": "Fantasy MapHub Generators", - "version": "1.2.1", + "version": "1.2.2-add-data-export-cave-gla.0", "description": "An offline-first hub that bundles several Watabou map generators into one consistent web app: same UI patterns, local assets, and modern import/export. It adds OpenAPI docs, proto-first serialization (including pure protobuf files), and a PWA build so everything works without an internet connection.", "license": "MPL-2.0", "author": "mail@sunsung.fun", diff --git a/src/js/Cave.js b/src/js/Cave.js index 60dabac..7a3ba29 100644 --- a/src/js/Cave.js +++ b/src/js/Cave.js @@ -11346,22 +11346,33 @@ var $lime_init = function (A, r) { return Sa.baseURL + Sa.getParams() }; Sa.update = function () { - window.history.replaceState(Sa.data, "", Sa.getParams()) - }; - Sa.fromString = function (a) { - Sa.data = {}; - a = S.substr(a, a.indexOf("?") + 1, null).split("&"); - for (var b = 0; b < a.length;) { - var c = a[b]; - ++b; - var d = c.indexOf("="), - f = S.substr(c, 0, d); - c = S.substr(c, d + 1, null); - c = decodeURIComponent(c.split("+").join(" ")); - Sa.data[f] = c - } - Sa.update() + if (Sa.__disabled) return; + + Sa.init(); + Sa.__pendingParams = Sa.getParams(); + if (Sa.__timer != null) return; + + var now = (window.performance && window.performance.now) ? window.performance.now() : Date.now(); + var last = (Sa.__lastCall != null) ? Sa.__lastCall : 0; + var interval = (Sa.__minInterval != null) ? Sa.__minInterval : 250; + var wait = Math.max(0, last + interval - now); + + Sa.__timer = window.setTimeout(function () { + Sa.__timer = null; + Sa.__lastCall = (window.performance && window.performance.now) ? window.performance.now() : Date.now(); + + var params = Sa.__pendingParams; + if (params === Sa.__lastParams) return; + Sa.__lastParams = params; + + try { + window.history.replaceState(Sa.data, "", params); + } catch (e) { + Sa.__disabled = true; + } + }, wait); }; + var rf = function (a) { this.ruleSet = a; this.clearState()