UX improvements
- add buttons for PixelForge and PixelArt (settings page, below "file system" button - abort build when PixelForge requested but GIF support missing - "support" PixelMagic with error message - known issues with bigger images
This commit is contained in:
@@ -99,6 +99,11 @@
|
|||||||
<button type="submit" onclick="window.location='./settings/sync'">Sync Interfaces</button>
|
<button type="submit" onclick="window.location='./settings/sync'">Sync Interfaces</button>
|
||||||
<button type="submit" onclick="window.location='./settings/time'">Time & Macros</button>
|
<button type="submit" onclick="window.location='./settings/time'">Time & Macros</button>
|
||||||
<button type="submit" onclick="window.location='./settings/sec'">Security & Updates</button>
|
<button type="submit" onclick="window.location='./settings/sec'">Security & Updates</button>
|
||||||
|
<br>
|
||||||
<button type="submit" onclick="window.location='./edit'">File System ☾</button> <!--WLEDMM-->
|
<button type="submit" onclick="window.location='./edit'">File System ☾</button> <!--WLEDMM-->
|
||||||
</body>
|
<button id="pixbtn" style="display:none;" type="submit" onclick="window.location='./pixart.htm'">Pixel Art Converter ☾</button>
|
||||||
|
<button id="pxmbtn" style="display:none;" type="submit" onclick="window.location='./pxmagic.htm'">Pixel Magic Tool</button>
|
||||||
|
<button id="forgebtn" style="display:none;" type="submit" onclick="window.location='./pixelforge.htm'">WLED Pixel Forge</button>
|
||||||
|
<br>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -6,14 +6,27 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "html_settings.h"
|
#include "html_settings.h"
|
||||||
#include "html_other.h"
|
#include "html_other.h"
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_PIXART
|
#ifdef WLED_ENABLE_PIXART
|
||||||
#include "html_pixart.h"
|
#include "html_pixart.h"
|
||||||
#endif
|
#endif
|
||||||
#ifdef WLED_ENABLE_PIXELFORGE
|
#ifdef WLED_ENABLE_PXMAGIC
|
||||||
|
//#include "html_pxmagic.h"
|
||||||
|
#if !defined(WLED_ENABLE_PIXART)
|
||||||
|
#error "PIXEL MAGIC Tool is not supported in WLED-MM. Please use Pixel Art Converter instead: add -D WLED_ENABLE_PIXART to your build_flags"
|
||||||
|
// PIXEL MAGIC has known problems when creating image presets for larger images.
|
||||||
|
// if you still want to use it, upload pxmagic.htm to your device (<WLED-IP>/edit) and then start <WLED-IP>/pxmagic.htm
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#if defined(WLED_ENABLE_PIXELFORGE) && !defined(WLED_DISABLE_PIXELFORGE) // WLEDMM uses WLED_ENABLE_PIXELFORGE, upstream has WLED_DISABLE_PIXELFORGE
|
||||||
#include "html_pixelforge.h"
|
#include "html_pixelforge.h"
|
||||||
static const char _pixelforge_htm[] PROGMEM = "/pixelforge.htm";
|
static const char _pixelforge_htm[] PROGMEM = "/pixelforge.htm";
|
||||||
static const char _common_js[] PROGMEM = "/common.js";
|
static const char _common_js[] PROGMEM = "/common.js";
|
||||||
|
#if !defined(WLED_ENABLE_GIF)
|
||||||
|
#error "GIF image support is missing. Please add -D WLED_ENABLE_GIF to your build flags."
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "html_cpal.h"
|
#include "html_cpal.h"
|
||||||
|
|
||||||
// define flash strings once (saves flash memory)
|
// define flash strings once (saves flash memory)
|
||||||
@@ -454,7 +467,7 @@ void initServer()
|
|||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_PIXELFORGE
|
#if defined(WLED_ENABLE_PIXELFORGE) && !defined(WLED_DISABLE_PIXELFORGE)
|
||||||
server.on(_pixelforge_htm, HTTP_GET, [](AsyncWebServerRequest *request) {
|
server.on(_pixelforge_htm, HTTP_GET, [](AsyncWebServerRequest *request) {
|
||||||
//handleStaticContent(request, FPSTR(_pixelforge_htm), 200, FPSTR(CONTENT_TYPE_HTML), PAGE_pixelforge, PAGE_pixelforge_length);
|
//handleStaticContent(request, FPSTR(_pixelforge_htm), 200, FPSTR(CONTENT_TYPE_HTML), PAGE_pixelforge, PAGE_pixelforge_length);
|
||||||
if (handleFileRead(request, FPSTR(_pixelforge_htm))) return;
|
if (handleFileRead(request, FPSTR(_pixelforge_htm))) return;
|
||||||
@@ -621,7 +634,7 @@ void serveSettingsJS(AsyncWebServerRequest* request)
|
|||||||
char buf[SETTINGS_STACK_BUF_SIZE+37] = { '\0' }; // WLEDMM ensure buffer is cleared initially
|
char buf[SETTINGS_STACK_BUF_SIZE+37] = { '\0' }; // WLEDMM ensure buffer is cleared initially
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
|
|
||||||
#ifdef WLED_ENABLE_PIXELFORGE
|
#if defined(WLED_ENABLE_PIXELFORGE) && !defined(WLED_DISABLE_PIXELFORGE)
|
||||||
// serve common.js if requested by subPage = 254 (.js)
|
// serve common.js if requested by subPage = 254 (.js)
|
||||||
if (request->url().indexOf(FPSTR(_common_js)) > 0) {
|
if (request->url().indexOf(FPSTR(_common_js)) > 0) {
|
||||||
AsyncWebServerResponse *response = request->beginResponse_P(200, FPSTR(CONTENT_TYPE_JAVASCRIPT), JS_common, JS_common_length);
|
AsyncWebServerResponse *response = request->beginResponse_P(200, FPSTR(CONTENT_TYPE_JAVASCRIPT), JS_common, JS_common_length);
|
||||||
|
|||||||
@@ -308,6 +308,17 @@ void getSettingsJS(AsyncWebServerRequest* request, byte subPage, char* dest) //W
|
|||||||
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
|
#ifdef WLED_ENABLE_DMX // include only if DMX is enabled
|
||||||
oappend(PSTR("gId('dmxbtn').style.display='';"));
|
oappend(PSTR("gId('dmxbtn').style.display='';"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WLED_ENABLE_PIXART // include only if PixelArt tool is enabled
|
||||||
|
oappend(PSTR("gId('pixbtn').style.display='';"));
|
||||||
|
#endif
|
||||||
|
#if defined(WLED_ENABLE_PXMAGIC) && !defined(WLED_ENABLE_PIXART) // include only if PixelMagic tool is enabled - only when PixelArt is not enabled
|
||||||
|
oappend(PSTR("gId('pxmbtn').style.display='';"));
|
||||||
|
#endif
|
||||||
|
#if defined(WLED_ENABLE_PIXELFORGE) && !defined(WLED_DISABLE_PIXELFORGE) // include only if PixelForge is enabled
|
||||||
|
oappend(PSTR("gId('forgebtn').style.display='';"));
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (subPage == 1)
|
if (subPage == 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user