This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2024 Adobe. All rights reserved. | |
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. You may obtain a copy | |
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under | |
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | |
* OF ANY KIND, either express or implied. See the License for the specific language | |
* governing permissions and limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-console, header/header, import/no-extraneous-dependencies */ | |
import fs from 'fs-extra'; | |
function filter(filters) { | |
return (mp) => filters.every((f) => { | |
if (f.startsWith('-')) { | |
return !mp.includes(f.substring(1)); | |
} else { | |
return mp.includes(f); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { fetchPlaceholders } from '/scripts/aem.js'; | |
// fetch placeholders from the 'en' folder | |
const placeholders = await fetchPlaceholders('en'); | |
// retrieve the value for key 'foo' | |
const { foo } = placeholders; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
try { | |
// get the resource URL from the url query parameter | |
const url = new URL(window.location.href).searchParams.get('url'); | |
if (url) { | |
const res = await fetch(url); | |
if (res.ok) { | |
const text = await res.text(); | |
const data = JSON.parse(text); | |
// do something with the data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | |
<!-- inherit base styles from sidekick (if desired) --> | |
<link rel="stylesheet" href="chrome-extension://ccfggkjabjahcjoljmgmklhpaccedipo/app.css"> | |
<!-- add your own styles --> | |
<link rel="stylesheet" href="styles.css"> | |
<!-- add your logic --> | |
<script src="script.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"specialViews": [{ | |
"title": "Better JSON Viewer", | |
"path": "**.json", | |
"viewer": "/tools/sidekick/better-json-viewer/index.html" | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2023 Adobe. All rights reserved. | |
* This file is licensed to you under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. You may obtain a copy | |
* of the License at http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under | |
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | |
* OF ANY KIND, either express or implied. See the License for the specific language | |
* governing permissions and limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"plugins": [ | |
{ | |
"id": "foo", | |
"title": "Foo", | |
"url": "/tools/sidekick/foo.html" | |
}, | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const foo = ({ detail }) => { | |
const sk = detail.data; | |
// your custom code from button.action goes here | |
}; | |
const sk = document.querySelector('helix-sidekick'); | |
if (sk) { | |
// sidekick already loaded | |
sk.addEventListener('custom:foo', foo); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"plugins": [ | |
{ | |
"id": "foo", | |
"title": "Foo", | |
"event": "foo" | |
} | |
] | |
} |
NewerOlder