Skip to content

Commit

Permalink
Merge pull request #3 from vokseverk/icon-update
Browse files Browse the repository at this point in the history
Update icon and build files
  • Loading branch information
greystate authored Jun 1, 2021
2 parents bde4d0c + 01fa3eb commit b192a85
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 13 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<img align="right" src="images/keyvalue-icon.png" width="120" height="120" alt="Two text inputs side-by-side with the values 'Key' and 'Value' on top of the Vokseværk 'fire-heart' logo" />

# Key/Value Editor for Umbraco

<img align="right" src="images/vv-keyvalueeditor-icon.png" width="180" height="180" alt="Two text inputs side-by-side with the values ‘Key’ and ‘Value’ inside a square with the Vokseværk ‘fire-heart’ logo" />

This property editor is *heavily* based on the **Multiple Textstrings** built-in
property editor, so should look and behave very similar to that one, even though
it has twice as many textboxes. (So hitting <kbd>Enter</kbd>/<kbd>Return</kbd>
Expand Down
Binary file removed images/keyvalue-icon.png
Binary file not shown.
Binary file added images/vv-keyvalueeditor-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion lib/manifester.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
exclude-result-prefixes="str"
>
<xsl:output method="text"
indent="yes"
Expand Down Expand Up @@ -89,6 +91,13 @@
<xsl:if test="not(position() = last())">, </xsl:if>
</xsl:template>

<xsl:template match="*[. = 'true'] | *[. = 'false']" mode="json">
<xsl:value-of select="name()" />
<xsl:text>: </xsl:text>
<xsl:value-of select="." />
<xsl:if test="not(position() = last())">, </xsl:if>
</xsl:template>

<xsl:template match="*[not(text()) and not(*)]" mode="json">
<xsl:value-of select="name()" />
<xsl:text>: ""</xsl:text>
Expand Down Expand Up @@ -128,7 +137,17 @@

<xsl:template match="*" mode="versioned">
<xsl:variable name="pluginpath" select="concat('~/App_Plugins/', $packageAlias, '/')" />
<xsl:value-of select="concat($pluginpath, $version, '/', .)" />
<xsl:variable name="parts" select="str:split(., '.')" />
<xsl:value-of select="$pluginpath" />
<xsl:for-each select="$parts">
<xsl:if test="not(position() = 1) and not(position() = last())">.</xsl:if>
<xsl:if test="not(position() = last())">
<xsl:value-of select="." />
</xsl:if>
<xsl:if test="position() = last()">
<xsl:value-of select="concat('-', $version, '.', .)" />
</xsl:if>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
37 changes: 29 additions & 8 deletions lib/packager.xslt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
exclude-result-prefixes="str"
>

<xsl:output method="xml"
Expand All @@ -36,9 +38,8 @@
</xsl:copy>
</xsl:template>

<xsl:template match="comment() | processing-instruction()">
<xsl:copy-of select="." />
</xsl:template>
<!-- No output for these -->
<xsl:template match="comment() | processing-instruction()" />

<!-- The `<files>` element has a `@folderPrefix` attribute we don't want to copy -->
<xsl:template match="files">
Expand All @@ -47,13 +48,25 @@
</files>
</xsl:template>

<xsl:template match="file[@path]">
<file>
<guid><xsl:value-of select="@name" /></guid>
<orgPath><xsl:value-of select="@path" /></orgPath>
<orgName><xsl:value-of select="@name" /></orgName>
</file>
</xsl:template>

<xsl:template match="file[@ref]">
<file>
<guid><xsl:value-of select="@ref" /></guid>
<orgPath>
<xsl:apply-templates select="@ref" mode="versioned" />
<xsl:value-of select="concat('/App_Plugins/', $packageAlias)" />
</orgPath>
<orgName><xsl:value-of select="@ref" /></orgName>
<orgName>
<!-- These are mutually exclusive: -->
<xsl:apply-templates select="@ref[../@versioned = 'no']" />
<xsl:apply-templates select="@ref[not(../@versioned = 'no')]" mode="versioned" />
</orgName>
</file>
</xsl:template>

Expand All @@ -67,9 +80,17 @@
</file>
</xsl:template>

<xsl:template match="@*" mode="versioned">
<xsl:value-of select="concat('/App_Plugins/', $packageAlias, '/')" />
<xsl:if test="not(../@versioned = 'no')"><xsl:value-of select="$version" /></xsl:if>
<xsl:template match="@ref" mode="versioned">
<xsl:variable name="parts" select="str:split(., '.')" />
<xsl:for-each select="$parts">
<xsl:if test="not(position() = 1) and not(position() = last())">.</xsl:if>
<xsl:if test="not(position() = last())">
<xsl:value-of select="." />
</xsl:if>
<xsl:if test="position() = last()">
<xsl:value-of select="concat('-', $version, '.', .)" />
</xsl:if>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
3 changes: 2 additions & 1 deletion src/package.ent
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<!ENTITY packageVersion "1.0.0">
<!ENTITY packageVersion "1.1.0">
<!ENTITY packageName "Vokseværk Key/Value Editor">
<!ENTITY packageAlias "Vokseverk.KeyValueEditor">
<!ENTITY packageAuthor "Vokseværk">
<!ENTITY packageAuthorURL "https://vokseverk.dk/">
<!ENTITY packageIconURL "https://raw.githubusercontent.com/vokseverk/Vokseverk.KeyValueEditor/main/images/vv-keyvalueeditor-icon.png">
<!ENTITY packageURL "https://our.umbraco.com/packages/backoffice-extensions/keyvalue-editor/">
<!ENTITY packageREADME "A property editor that can be used for adding multiple sets of keys and values to a document.">
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<package>
<name>&packageName;</name>
<version>&packageVersion;</version>
<iconUrl />
<iconUrl>&packageIconURL;</iconUrl>
<license url="http://opensource.org/licenses/MIT">MIT License</license>
<url>&packageURL;</url>
<requirements type="strict">
Expand Down

0 comments on commit b192a85

Please sign in to comment.