From 4e69e9b1b21d00a2938e49e8683142dfd66179a4 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 16 Jul 2026 08:15:59 +0000 Subject: [PATCH] fix: load Gridstack.js locally in HTML head - CDN URLs were 404 --- static/designer.css | 4 ++- static/designer.js | 54 ++++++++++++++++++---------------------- static/gridstack-all.js | 3 +++ static/gridstack.min.css | 1 + static/gridstack.min.js | 15 +++++++++++ static/index.html | 2 ++ 6 files changed, 48 insertions(+), 31 deletions(-) create mode 100644 static/gridstack-all.js create mode 100644 static/gridstack.min.css create mode 100644 static/gridstack.min.js diff --git a/static/designer.css b/static/designer.css index 9dc2d1b..3deb616 100644 --- a/static/designer.css +++ b/static/designer.css @@ -1,5 +1,7 @@ /* A4 Template Designer with Gridstack.js */ -@import url('https://cdn.jsdelivr.net/npm/gridstack@11.1.3/gridstack.min.css'); + +/* Gridstack base styles (loaded locally) */ +/* gridstack.min.css is loaded via in the page */ /* Designer layout */ .designer-layout { diff --git a/static/designer.js b/static/designer.js index 236656c..bdf9d26 100644 --- a/static/designer.js +++ b/static/designer.js @@ -80,25 +80,8 @@ function showDesigner(templateId = null) { `; showModal(body, 'A4 Template Designer', 'large'); - // Load Gridstack CSS dynamically - if (!document.getElementById('gridstack-css')) { - const link = document.createElement('link'); - link.id = 'gridstack-css'; - link.rel = 'stylesheet'; - link.href = 'https://cdn.jsdelivr.net/npm/gridstack@11.1.3/gridstack.min.css'; - document.head.appendChild(link); - } - - // Load Gridstack JS dynamically - if (typeof GridStack === 'undefined') { - const script = document.createElement('script'); - script.src = 'https://cdn.jsdelivr.net/npm/gridstack@11.1.3/gridstack-all-jq.js'; - script.onload = () => initGridstack(); - document.head.appendChild(script); - } else { - initGridstack(); - } - + // Gridstack is loaded via