Commit 7fc9b079 authored by jan.koester's avatar jan.koester
Browse files

test

parent f87c4842
Loading
Loading
Loading
Loading
+13 −0
Changes for editor/node/node_widget_runner.js: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -32,6 +32,19 @@ async function main() {

  const result = await Promise.resolve(fn(req));

  if (hook === 'metadata' && result && typeof result === 'object') {
    if (!result.type_id || typeof result.type_id !== 'string' || !result.type_id.trim()) {
      const scriptBase = path.basename(scriptPath, path.extname(scriptPath));
      const widgetName = (typeof result.name === 'string' && result.name.trim()) ? result.name.trim() : scriptBase;
      if (typeof mod.getUUID === 'function') {
        result.type_id = String(mod.getUUID());
      }
      if (!result.type_id || !result.type_id.trim()) {
        throw new Error(`Widget ${widgetName} has no hardcoded UUID (type_id/getUUID missing)`);
      }
    }
  }

  if (hook === 'render') {
    let html = '';
    if (typeof result === 'string') {
+6 −0
Changes for editor/node/widgets/accordion.js: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -71,3 +71,9 @@ function bool(v,d){if(typeof v==='boolean')return v;if(typeof v==='number')retur
function css(k,v){const s=str(v);return s?`${k}:${s};`:'';}
function safe(v){return String(v).replace(/[^a-zA-Z0-9_-]/g,'_');}
function esc(v){return String(v).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');}

function getUUID() {
  return 'a2f7c1e3-49d8-4b5a-9c6e-8d1f3a7b2e04';
}

module.exports.getUUID = getUUID;
+6 −0
Changes for editor/node/widgets/article.js: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -56,3 +56,9 @@ function bool(v,d){if(typeof v==='boolean')return v;if(typeof v==='number')retur
function css(k,v){const s=str(v);return s?`${k}:${s};`:'';}
function safe(v){return String(v).replace(/[^a-zA-Z0-9_-]/g,'_');}
function esc(v){return String(v).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');}

function getUUID() {
  return '58e70fdb-d4b4-45bf-8c59-e7a8ce2db735';
}

module.exports.getUUID = getUUID;
+6 −0
Changes for editor/node/widgets/button.js: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -121,3 +121,9 @@ function buildGtagSnippet(p){
}

function jsEsc(v){return String(v).replace(/\\/g,'\\\\').replace(/'/g,"\\'");}

function getUUID() {
  return 'f77fcdg4-5i98-7h6i-d7f9-2i89g4e989f7';
}

module.exports.getUUID = getUUID;
+6 −0
Changes for editor/node/widgets/container.js: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -97,3 +97,9 @@ function bool(v,d){if(typeof v==='boolean')return v;if(typeof v==='number')retur
function css(k,v,important){const s=str(v);return s?`${k}:${s}${important?' !important':''};`:'';}
function safe(v){return String(v).replace(/[^a-zA-Z0-9_-]/g,'_');}
function escCssUrl(v){return String(v).replace(/'/g,"%27");}

function getUUID() {
  return 'a22a7ef9-0d43-4c1d-82b4-7d34b9545a24';
}

module.exports.getUUID = getUUID;
Loading