Merge branch 'launch' into launch

This commit is contained in:
Frikky
2022-07-14 13:28:36 +02:00
committed by GitHub
11 changed files with 473 additions and 273 deletions
@@ -42,6 +42,7 @@ import data from '../frameworkStyle.jsx';
const liquidFilters = [
{"name": "Size", "value": "size", "example": ""},
{"name": "Date", "value": `date: "%Y%M%d"`, "example": `{{ "now" | date: "%s" }}`},
{"name": "Escape String", "value": `{{ \"\"\"'string with weird'" quotes\"\"\" | escape_string }}`, "example": ``},
]
const mathFilters = [
@@ -51,7 +52,7 @@ const mathFilters = [
const pythonFilters = [
{"name": "Hello World", "value": `{% python %}\nprint("hello world")\n{% endpython %}`, "example": ``},
{"name": "Handle JSON", "value": `{% python %}\nimport json\njsondata = json.loads("""$nodename""")\n{% endpython %}`, "example": ``},
{"name": "Handle JSON", "value": `{% python %}\nimport json\njsondata = json.loads(r"""$nodename""")\n{% endpython %}`, "example": ``},
]
const CodeEditor = (props) => {
@@ -354,7 +355,7 @@ const CodeEditor = (props) => {
return
}
if (!item.value.includes("{%")) {
if (!item.value.includes("{%") && !item.value.includes("{{")) {
setlocalcodedata(localcodedata+" | "+item.value+" }}")
} else {
setlocalcodedata(localcodedata+item.value)
@@ -610,7 +611,7 @@ const CodeEditor = (props) => {
}}
/>
</span>
{editorPopupOpen ?
{/*editorPopupOpen ?
<Paper
style={{
margin: 10,
@@ -645,13 +646,12 @@ const CodeEditor = (props) => {
}}
>
{data.substring(0, 25)}
{/* {Object.keys(data.example).forEach(key => key)} */}
</button>
</div>
)
})}
</Paper>
: null}
: null*/}
<div
style={{