schoolbox web extension :)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: gist and remove buttons for user snippets

Willow 2cc3d443 60f4423d

+17 -4
+3 -3
src/options/components/Footer.svelte
··· 36 36 <button 37 37 title="Support" 38 38 id="support" 39 - class="mx-2 small bg-ctp-surface0 text-ctp-text hover:bg-ctp-pink hover:text-ctp-crust" 39 + class="mx-2 small" 40 40 on:click={handleSupportClick}> 41 41 <MessageCircleQuestion /> 42 42 </button> 43 43 <button 44 44 title="Reset" 45 45 id="reset" 46 - class="mx-2 small bg-ctp-surface0 text-ctp-text hover:bg-ctp-red hover:text-ctp-crust" 46 + class="mx-2 small hover:bg-ctp-red" 47 47 on:click={handleResetClick}> 48 48 <RotateCcw /> 49 49 </button> 50 50 <button 51 51 title="Debug" 52 52 id="support" 53 - class="mx-2 small bg-ctp-surface0 text-ctp-text hover:bg-ctp-blue hover:text-ctp-crust" 53 + class="mx-2 small hover:bg-ctp-blue" 54 54 on:click={handleBugClick}> 55 55 <BugPlay /> 56 56 </button>
+9
src/options/pages/Snippets.svelte
··· 51 51 author: sections[3], 52 52 name: getMatch(data, /\/\*\s*name:\s*(.*?)\s*\*\//), 53 53 description: getMatch(data, /\/\*\s*description:\s*(.*?)\s*\*\//), 54 + url: snippetURL, 54 55 toggled: true, 55 56 }; 56 57 await browser.storage.local.set({ snippets: snippets }); ··· 67 68 snippets.enabled = snippets.enabled.filter((id) => id !== snippetId); 68 69 } 69 70 } 71 + await browser.storage.local.set({ snippets: snippets }); 72 + } 73 + 74 + async function removeSnippet(snippetId) { 75 + delete snippets.user[snippetId]; 76 + snippets.user = {...snippets.user}; // force reactivity 70 77 await browser.storage.local.set({ snippets: snippets }); 71 78 } 72 79 </script> ··· 130 137 <div class="text-ctp-overlay1 group-hover:text-ctp-subtext0 transition-colors duration-500 ease-in-out"> 131 138 {snippet.description} 132 139 </div> 140 + <button class="xsmall hover:bg-ctp-red" on:click={() => { removeSnippet(key); }}>Remove</button> 141 + <a href={snippet.url} target="_blank"><button class="xsmall">Gist</button></a> 133 142 </div> 134 143 {/each} 135 144 </div>
+5 -1
src/options/popup.css
··· 68 68 @apply rounded-lg px-2 py-1 text-sm font-bold; 69 69 } 70 70 71 + button.xsmall { 72 + @apply rounded-md px-1 py-0.5 text-xs; 73 + } 74 + 71 75 button { 72 - @apply transition duration-500 ease-in-out; 76 + @apply transition duration-500 ease-in-out bg-ctp-surface0 text-ctp-text hover:text-ctp-crust hover:bg-ctp-pink; 73 77 } 74 78 75 79 #palette {