Fix playground toolbar link to point to repo
This commit is contained in:
@@ -11,12 +11,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export interface PlaygroundToolbarConfig {
|
export interface PlaygroundToolbarConfig {
|
||||||
/** When the playground was created (ISO string) */
|
/** When the playground was created (ISO string) */
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
/** TTL in seconds */
|
/** TTL in seconds */
|
||||||
ttl: number;
|
ttl: number;
|
||||||
/** Whether edit mode is currently active */
|
/** Whether edit mode is currently active */
|
||||||
editMode: boolean;
|
editMode: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const RE_AMP = /&/g;
|
const RE_AMP = /&/g;
|
||||||
@@ -25,9 +25,9 @@ const RE_LT = /</g;
|
|||||||
const RE_GT = />/g;
|
const RE_GT = />/g;
|
||||||
|
|
||||||
export function renderPlaygroundToolbar(config: PlaygroundToolbarConfig): string {
|
export function renderPlaygroundToolbar(config: PlaygroundToolbarConfig): string {
|
||||||
const { createdAt, ttl, editMode } = config;
|
const { createdAt, ttl, editMode } = config;
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<!-- EmDash Playground Toolbar -->
|
<!-- EmDash Playground Toolbar -->
|
||||||
<div id="emdash-playground-toolbar" data-created-at="${escapeAttr(createdAt)}" data-ttl="${ttl}" data-edit-mode="${editMode}">
|
<div id="emdash-playground-toolbar" data-created-at="${escapeAttr(createdAt)}" data-ttl="${ttl}" data-edit-mode="${editMode}">
|
||||||
<div class="ec-pg-inner">
|
<div class="ec-pg-inner">
|
||||||
@@ -53,7 +53,7 @@ export function renderPlaygroundToolbar(config: PlaygroundToolbarConfig): string
|
|||||||
<svg class="ec-pg-icon" id="ec-pg-reset-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
|
<svg class="ec-pg-icon" id="ec-pg-reset-icon" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 1 1-2.12-9.36L23 10"/></svg>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<a class="ec-pg-btn ec-pg-btn--deploy" href="https://docs.emdashcms.com/getting-started" target="_blank" rel="noopener">
|
<a class="ec-pg-btn ec-pg-btn--deploy" href="https://github.com/emdash-cms/emdash" target="_blank" rel="noopener">
|
||||||
Deploy your own
|
Deploy your own
|
||||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
|
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>
|
||||||
</a>
|
</a>
|
||||||
@@ -333,9 +333,9 @@ export function renderPlaygroundToolbar(config: PlaygroundToolbarConfig): string
|
|||||||
}
|
}
|
||||||
|
|
||||||
function escapeAttr(str: string): string {
|
function escapeAttr(str: string): string {
|
||||||
return str
|
return str
|
||||||
.replace(RE_AMP, "&")
|
.replace(RE_AMP, "&")
|
||||||
.replace(RE_QUOT, """)
|
.replace(RE_QUOT, """)
|
||||||
.replace(RE_LT, "<")
|
.replace(RE_LT, "<")
|
||||||
.replace(RE_GT, ">");
|
.replace(RE_GT, ">");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user