Gallery: Add wand menu item

8e10051100797c9f51ed70c873dec95838647685

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +22 -0Ignore whitespace
public/scripts/extensions/gallery/index.js+21 -0
@@ -797,6 +797,26 @@ async function listGalleryCommand(args) {
797797 return JSON.stringify([]);
798798}
799799
800+function addGalleryWandButton() {
801+ const showGalleryContainer = document.getElementById('gallery_wand_container') || document.getElementById('extensionsMenu');
802+ if (!(showGalleryContainer instanceof HTMLElement)) {
803+ return;
804+ }
805+ const showGalleryButton = document.createElement('div');
806+ showGalleryButton.id = 'show_gallery_wand_button';
807+ showGalleryButton.classList.add('list-group-item', 'flex-container', 'flexGap5');
808+ const showGalleryIcon = document.createElement('div');
809+ showGalleryIcon.classList.add('fa-solid', 'fa-sd-card', 'extensionsMenuExtensionButton');
810+ const showGalleryText = document.createElement('span');
811+ showGalleryText.textContent = translate('Show Gallery');
812+ showGalleryButton.appendChild(showGalleryIcon);
813+ showGalleryButton.appendChild(showGalleryText);
814+ showGalleryButton.addEventListener('click', () => {
815+ showCharGallery();
816+ });
817+ showGalleryContainer.appendChild(showGalleryButton);
818+}
819+
800820// On extension load, ensure the settings are initialized
801821(function () {
802822 initSettings();
@@ -829,4 +849,5 @@ async function listGalleryCommand(args) {
829849 text: translate('Show Gallery'),
830850 }),
831851 );
852+ addGalleryWandButton();
832853})();
public/scripts/templates/wandMenu.html+1 -0
@@ -3,6 +3,7 @@
33 <div id="attach_file_wand_container" class="extension_container"></div>
44 <div id="sd_wand_container" class="extension_container"></div>
55 <div id="caption_wand_container" class="extension_container"></div>
6+ <div id="gallery_wand_container" class="extension_container"></div>
67 <div id="tts_wand_container" class="extension_container"></div>
78 <div id="screen_share_wand_container" class="extension_container"></div>
89 <div id="prompt_inspector_wand_container" class="extension_container"></div>