import { PluginSettingTab , App , Setting } from "obsidian" ; import EmojiShortcodesPlugin from "./main" ; export interface EmojiPluginSettings { immediateReplace : boolean ; suggester : boolean ; } export const DEFAULT_SETTINGS = { immediateReplace : true , suggester : true , } ; export class EmojiPluginSettingTab extends PluginSettingTab { plugin : EmojiShortcodesPlugin ; constructor ( app , plugin ) { super ( app , plugin ) ; this . plugin = plugin ; } display ( ) { let { containerEl } = this ; containerEl . empty ( ) ; containerEl . createEl ( 'h2' , { text : 'Emoji Shortcodes Plugin' } ) ; new Setting ( containerEl ) . setName ( 'Immediate Emoji Replace' ) . setDesc ( 'If this is turned on, Emoji shortcodes will be immediately replaced after typing. Otherwise they are still stored as a shortcode and you only see the Emoji in Preview Mode.' ) . addToggle ( cb => { cb . setValue ( this . plugin . settings . immediateReplace ) . onChange ( async ( value ) => { this . plugin . settings . immediateReplace = value ; await this . plugin . saveSettings ( ) ; } ) ; } ) ; new Setting ( containerEl ) . setName ( 'Emoji Suggester' ) . setDesc ( 'If this is turned on, a Suggester will appear everytime you type : followed by a letter. This will help you insert Emojis. (Doesn\'t work on mobile)' ) . addToggle ( cb => { cb . setValue ( this . plugin . settings . suggester ) . onChange ( async ( value ) => { this . plugin . settings . suggester = value ; await this . plugin . saveSettings ( ) ; } ) ; } ) ; new Setting ( containerEl ) . setName ( 'Donate' ) . setDesc ( 'If you like this Plugin, consider donating to support continued development:' ) . addButton ( ( bt ) => { bt . buttonEl . outerHTML = `<a href="https://www.buymeacoffee.com/phibr0"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=phibr0&button_colour=5F7FFF&font_colour=ffffff&font_family=Inter&outline_colour=000000&coffee_colour=FFDD00"></a>` ; } ) ; } }