Skip to content

Commit

Permalink
replace syntax for placeholders with {{ }}
Browse files Browse the repository at this point in the history
  • Loading branch information
ylebre committed Feb 23, 2024
1 parent 1a03afa commit 8353737
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ function(data) {

// replace keys with the indentation as given
Object.keys(replacements).forEach(function(replacement) {
matches = componentPreview.match("(\\s+){" + replacement + "}");
matches = componentPreview.match("(\\s+){{" + replacement + "}}");
if (matches) {
componentPreview = componentPreview.replace("{" + replacement + "}", replacements[replacement].replace(/\n/g, matches[1]));
componentPreview = componentPreview.replace("{{" + replacement + "}}", replacements[replacement].replace(/\n/g, matches[1]));
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ function(data) {
};

Object.keys(replacements).forEach(function(replacement) {
matches = fullApp.match("(\\s+){" + replacement + "}");
fullApp = fullApp.replace("{" + replacement + "}", replacements[replacement].replace(/\n/g, matches[1]));
matches = fullApp.match("(\\s+){{" + replacement + "}}");
fullApp = fullApp.replace("{{" + replacement + "}}", replacements[replacement].replace(/\n/g, matches[1]));
});

// escape html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ function(data) {

// replace keys with the indentation as given
Object.keys(replacements).forEach(function(replacement) {
matches = pagePreview.match("(\\s+){" + replacement + "}");
matches = pagePreview.match("(\\s+){{" + replacement + "}}");
if (matches) {
pagePreview = pagePreview.replace("{" + replacement + "}", replacements[replacement].replace(/\n/g, matches[1]));
pagePreview = pagePreview.replace("{{" + replacement + "}}", replacements[replacement].replace(/\n/g, matches[1]));
}
});

Expand Down
18 changes: 9 additions & 9 deletions www/api/data/generated.html

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions www/api/data/page-frame/componentPreview.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<meta charset="utf-8">
<!-- Component CSS -->
<style>
{componentCss}
{{componentCss}}
</style>
<!-- /Component CSS -->
<!-- Page CSS -->
<style>
{pageCss}
{{pageCss}}
</style>
<!-- /Page CSS -->
<!-- Head HTML -->
{headHtml}
{{headHtml}}
<!-- /Head HTML -->
<script>
function clone(ob) {
Expand All @@ -29,36 +29,36 @@
</head>
<body>
<!-- Component HTML templates -->
{componentTemplates}
{{componentTemplates}}
<!-- /Component HTML templates -->
<div class="main">
{componentPreview}
{{componentPreview}}
</div>
<script src="js/simply.everything.js"></script>
<script src="js/simply-edit.js" data-api-key="muze"></script>
<script>
/* Transformers */
editor.transformers = {
{transformers}
{{transformers}}
};
/* /Transformers */
</script>
<script>
/* Sorters */
editor.sorters = {
{sorters}
{{sorters}}
};
/* /Sorters */
</script>
<script>
window.addEventListener("simply-content-loaded", function() {
/* Data sources */
{dataSources}
{{dataSources}}
/* /Data sources */
});
</script>
<!-- Foot HTML -->
{footHtml}
{{footHtml}}
<!-- /Foot HTML -->
</body>
</html>
30 changes: 15 additions & 15 deletions www/api/data/page-frame/fullApp.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<meta charset="utf-8">
<!-- Component CSS -->
<style>
{componentCss}
{{componentCss}}
</style>
<!-- /Component CSS -->
<!-- Page CSS -->
<style>
{pageCss}
{{pageCss}}
</style>
<!-- /Page CSS -->
<!-- Head HTML -->
{headHtml}
{{headHtml}}
<!-- /Head HTML -->
<script>
var simplyDataApi = {};
Expand All @@ -22,28 +22,28 @@
simply.bind = false;
/* Raw API */
var simplyRawApi = {
{rawApi}
{{rawApi}}
};
/* End of Raw API */
/* Data API */
simplyDataApi = {
{dataApi}
{{dataApi}}
};
/* End of Data API */
simplyApp = simply.app({
/* Actions */
actions: {
{actions}
{{actions}}
},
/* /Actions */
/* Commands */
commands: {
{commands}
{{commands}}
},
/* /Commands */
/* Routes */
routes: {
{routes}
{{routes}}
}
/* /Routes */
});
Expand All @@ -61,10 +61,10 @@
</head>
<body>
<!-- Body HTML -->
{bodyHtml}
{{bodyHtml}}
<!-- /Body HTML -->
<!-- Component HTML templates -->
{componentTemplates}
{{componentTemplates}}
<!-- /Component HTML templates -->
<header data-simply-path="/" data-simply-field="header" data-simply-content="template" data-simply-default-value="Header">
<template data-simply-template='Header' rel="header"></template>
Expand All @@ -74,34 +74,34 @@
</nav>
<div class="main" data-simply-field="page" data-simply-content="template">
<!-- Page HTML templates -->
{pageTemplates}
{{pageTemplates}}
<!-- /Page HTML templates -->
</div>
<script src="js/simply.everything.js"></script>
<script src="js/simply-edit.js" data-api-key="muze"></script>
<script>
/* Transformers */
editor.transformers = {
{transformers}
{{transformers}}
};
/* /Transformers */
</script>
<script>
/* Sorters */
editor.sorters = {
{sorters}
{{sorters}}
};
/* /Sorters */
</script>
<script>
window.addEventListener("simply-content-loaded", function() {
/* Data sources */
{dataSources}
{{dataSources}}
/* /Data sources */
});
</script>
<!-- Foot HTML -->
{footHtml}
{{footHtml}}
<!-- /Foot HTML -->
</body>
</html>
18 changes: 9 additions & 9 deletions www/api/data/page-frame/pagePreview.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
<meta charset="utf-8">
<!-- Component CSS -->
<style>
{componentCss}
{{componentCss}}
</style>
<!-- /Component CSS -->
<!-- Page CSS -->
<style>
{pageCss}
{{pageCss}}
</style>
<!-- /Page CSS -->
<!-- Head HTML -->
{headHtml}
{{headHtml}}
<!-- /Head HTML -->
<script>
function clone(ob) {
Expand All @@ -29,7 +29,7 @@
</head>
<body>
<!-- Component HTML templates -->
{componentTemplates}
{{componentTemplates}}
<!-- /Component HTML templates -->
<header data-simply-path="/" data-simply-field="header" data-simply-content="template" data-simply-default-value="Header">
<template data-simply-template='Header' rel="header"></template>
Expand All @@ -38,33 +38,33 @@
<div is="simply-component" rel="menu"></div>
</nav>
<div class="main" data-simply-field="page" data-simply-content="template">
{pagePreview}
{{pagePreview}}
</div>
<script src="js/simply.everything.js"></script>
<script src="js/simply-edit.js" data-api-key="muze"></script>
<script>
/* Transformers */
editor.transformers = {
{transformers}
{{transformers}}
};
/* /Transformers */
</script>
<script>
/* Sorters */
editor.sorters = {
{sorters}
{{sorters}}
};
/* /Sorters */
</script>
<script>
window.addEventListener("simply-content-loaded", function() {
/* Data sources */
{dataSources}
{{dataSources}}
/* /Data sources */
});
</script>
<!-- Foot HTML -->
{footHtml}
{{footHtml}}
<!-- /Foot HTML -->
</body>
</html>
Loading

0 comments on commit 8353737

Please sign in to comment.