From 5a33e1e126f0829d62d9b0f790c9b4519a3a4a9a Mon Sep 17 00:00:00 2001 From: kissel Date: Tue, 21 Nov 2023 13:54:34 +0100 Subject: [PATCH] allow multiple common blocks in the sandbox; added descriptions to complex sandbox fields --- sandbox.html | 56 ++++++++++++++++++++++++++++++++++++++------------ src/cadenza.js | 44 +++++++++++++++++---------------------- 2 files changed, 62 insertions(+), 38 deletions(-) diff --git a/sandbox.html b/sandbox.html index 7395140e..9f7d17c6 100644 --- a/sandbox.html +++ b/sandbox.html @@ -28,7 +28,21 @@ form, fieldset { display: flex; flex-direction: column; - gap: 16px; + gap: 12px; + } + fieldset > div { + display: flex; + flex-direction: column; + gap: 4px; + } + fieldset small { + display: flex; + flex-direction: column; + gap: 4px; + + & > * { + margin-block: 0; + } } main { flex: 1; @@ -57,11 +71,13 @@ const action = actionSelect.value; const settingsTemplate = document.querySelector(`[data-action=${action}]`); settingsContainer.append(settingsTemplate.content.cloneNode(true)); - const commonSettingsTemplate = document.getElementById(`common-${settingsTemplate.dataset.common}`); - if (commonSettingsTemplate) { - settingsContainer.append( - document.createElement('hr'), - commonSettingsTemplate.content.cloneNode(true)); + if (settingsTemplate.dataset.common) { + settingsTemplate.dataset.common.split(',').forEach(commonId => { + const commonSettingsTemplate = document.getElementById(`common-${commonId}`); + settingsContainer.append( + document.createElement('hr'), + commonSettingsTemplate.content.cloneNode(true)); + }) } const data = localStorage.getItem(`cadenzajs-sandbox-${action}`); @@ -118,6 +134,7 @@ function getOptions ({ disabledUiFeatures, expandNavigator, + filter, geometry, hideMainHeaderAndFooter, hideWorkbookToolBar, @@ -129,12 +146,12 @@ minScale, parts, simplifiedOperationMode, - useMapSrs, - filter + useMapSrs }) { return { disabledUiFeatures: disabledUiFeatures && disabledUiFeatures.split(','), expandNavigator: (expandNavigator === 'on'), + filter: filter && parseFilterVariables(filter), geometry: geometry && JSON.parse(geometry), hideMainHeaderAndFooter: (hideMainHeaderAndFooter === 'on'), hideWorkbookToolBar: (hideWorkbookToolBar === 'on'), @@ -146,8 +163,7 @@ minScale, parts: parts && parts.split(','), ...(simplifiedOperationMode === 'on' && { operationMode: 'simplified' }), - useMapSrs: useMapSrs === 'on', - filter: filter && parseFilterVariables(filter) + useMapSrs: useMapSrs === 'on' }; } @@ -224,11 +240,25 @@
- + + + +

Comma-separated list of features

+ + Supported features: +
    +
  • workbook-design
  • +
  • workbook-view-management
  • +
+
- + + +

A JSON object with filter variable names and values

+

Dates need to be ISO strings
(e.g. "2023-11-17T17:12:06.175Z").
Use "{{currentDate}}" for the current date.

+
@@ -301,7 +331,7 @@ -