Gallery: Add wand menu item

8e10051100797c9f51ed70c873dec95838647685

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

2 files changed, +22 -0Showing whitespace changes
public/scripts/extensions/gallery/index.js+21 -0
@@ -797,6 +797,26 @@ async function listGalleryCommand(args) {
797 return JSON.stringify([]);797 return JSON.stringify([]);
798}798}
799799
800function 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
800// On extension load, ensure the settings are initialized820// On extension load, ensure the settings are initialized
801(function () {821(function () {
802 initSettings();822 initSettings();
@@ -829,4 +849,5 @@ async function listGalleryCommand(args) {
829 text: translate('Show Gallery'),849 text: translate('Show Gallery'),
830 }),850 }),
831 );851 );
852 addGalleryWandButton();
832})();853})();
public/scripts/templates/wandMenu.html+1 -0
@@ -3,6 +3,7 @@
3 <div id="attach_file_wand_container" class="extension_container"></div>3 <div id="attach_file_wand_container" class="extension_container"></div>
4 <div id="sd_wand_container" class="extension_container"></div>4 <div id="sd_wand_container" class="extension_container"></div>
5 <div id="caption_wand_container" class="extension_container"></div>5 <div id="caption_wand_container" class="extension_container"></div>
6 <div id="gallery_wand_container" class="extension_container"></div>
6 <div id="tts_wand_container" class="extension_container"></div>7 <div id="tts_wand_container" class="extension_container"></div>
7 <div id="screen_share_wand_container" class="extension_container"></div>8 <div id="screen_share_wand_container" class="extension_container"></div>
8 <div id="prompt_inspector_wand_container" class="extension_container"></div>9 <div id="prompt_inspector_wand_container" class="extension_container"></div>