Browse Source

Unterstützung CUSTOM_CSS and CUSTOM_JS in XML-Frontend #375529

master
Daniel Quathamer 1 month ago
parent
commit
eb163ec837
  1. 16
      src/de/superx/common/Maske.java
  2. BIN
      superx/WEB-INF/lib/superx6.0.jar
  3. 2
      superx/xml/nd_templates.xsl
  4. 26
      superx/xml/pageComponents_html.xsl

16
src/de/superx/common/Maske.java

@ -2022,6 +2022,22 @@ public class Maske extends NamedIdObject {
Logger.getLogger("superx_" + mandantenID + "_xml").log(Level.DEBUG, "Hinzufügen von " + key + ":\n " + customadd + DateUtils.getNowString()); Logger.getLogger("superx_" + mandantenID + "_xml").log(Level.DEBUG, "Hinzufügen von " + key + ":\n " + customadd + DateUtils.getNowString());
result.append(customadd); result.append(customadd);
} }
if (key.startsWith("CUSTOM_CSS")) {
String customcss = ((RepositoryItemCollection) SxPools.get(mandantenID).getRepository().get(key))
.get("content").toString();
if(customcss!=null && !customcss.trim().equals(""))
{
result.append("<custom_css><style type=\"text/css\"><![CDATA["+customcss+"]]></style></custom_css>");
}
}
if (key.startsWith("CUSTOM_JS")) {
String customjs = ((RepositoryItemCollection) SxPools.get(mandantenID).getRepository().get(key))
.get("content").toString();
if(customjs!=null && !customjs.trim().equals(""))
{
result.append("<custom_js><script language=\"javascript\"><![CDATA["+customjs+"]]></script></custom_js>");
}
}
} }
} }

BIN
superx/WEB-INF/lib/superx6.0.jar

Binary file not shown.

2
superx/xml/nd_templates.xsl

@ -3063,7 +3063,7 @@ Seite 1 von 1
<xsl:text>ok=</xsl:text><xsl:value-of select="/maske/felder/feld[ name='_customValidation']/defaultwert/key" /><xsl:text>(document.forms[0],'superx');if (ok==true) document.getElementById('progressbar').style.display='block';return ok;</xsl:text> <xsl:text>ok=</xsl:text><xsl:value-of select="/maske/felder/feld[ name='_customValidation']/defaultwert/key" /><xsl:text>(document.forms[0],'superx');if (ok==true) document.getElementById('progressbar').style.display='block';return ok;</xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>ok=validateForm(document.forms[0],'superx');if (ok==true) document.getElementById('progressbar').style.display='block';return ok;</xsl:text> <xsl:text>ok=validateForm(document.forms['maske'],'superx');if (ok==true) document.getElementById('progressbar').style.display='block';return ok;</xsl:text>
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>

26
superx/xml/pageComponents_html.xsl

@ -1865,9 +1865,18 @@ and not(ends-with(filename,'.jrxml'))">
<link rel="stylesheet" href="../xml/js/jquery/jqm-demos.dw.css" /> <link rel="stylesheet" href="../xml/js/jquery/jqm-demos.dw.css" />
<xsl:if test="$css != ''"> <xsl:if test="$css != ''">
<link rel="stylesheet" type="text/css" href="$css" /> <link rel="stylesheet" type="text/css" href="{$css}" />
</xsl:if>
<xsl:if test="/*/custom_css != ''">
<style type="text/css"><xsl:value-of select="/*/custom_css/child::*"/></style>
</xsl:if>
<xsl:if test="/*/custom_js != ''">
<script language="javascript">
<xsl:value-of select="/*/custom_js/child::*"/>
</script>
</xsl:if> </xsl:if>
</head> </head>
</xsl:template> </xsl:template>
@ -1911,9 +1920,18 @@ and not(ends-with(filename,'.jrxml'))">
<link rel="stylesheet" href="../xml/js/jquery/jqm-demos.dw.css" /> --> <link rel="stylesheet" href="../xml/js/jquery/jqm-demos.dw.css" /> -->
<xsl:if test="$css != ''"> <xsl:if test="$css != ''">
<link rel="stylesheet" type="text/css" href="$css" /> <link rel="stylesheet" type="text/css" href="{$css}" />
</xsl:if>
<xsl:if test="/*/custom_css != ''">
<style type="text/css"><xsl:value-of select="/*/custom_css/child::*"/></style>
</xsl:if>
<xsl:if test="/*/custom_js != ''">
<script language="javascript">
<xsl:value-of select="/*/custom_js/child::*"/>
</script>
</xsl:if> </xsl:if>
</head> </head>
</xsl:template> </xsl:template>

Loading…
Cancel
Save