fontPreviewScript.js000644 0000000376 14600100655011742 0ustar00000000 000000 const fontSelector=document.getElementById("selectedFont"),fontPreview=document.getElementById("fontPreview");fontSelector.addEventListener("change",(()=>{const e=fontSelector.value;console.info({selectedFont:e}),fontPreview.style.fontFamily=`'${e}'`}));google-fonts.css000644 0000000344 14600100655011017 0ustar00000000 000000 @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400..700&family=Dancing+Script:wght@400..700&family=Edu+NSW+ACT+Foundation:wght@400..700&family=Nanum+Brush+Script&family=Pacifico&family=Workbench&display=swap')index.js000644 0000010572 14600100655007353 0ustar00000000 000000 (()=>{"use strict";var t={998:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=joplin},143:(t,e)=>{var o,n,i,l,a,r,d,u,s,c;Object.defineProperty(e,"__esModule",{value:!0}),e.ContentScriptType=e.SettingStorage=e.AppType=e.SettingItemSubType=e.SettingItemType=e.ToolbarButtonLocation=e.isContextMenuItemLocation=e.MenuItemLocation=e.ModelType=e.ImportModuleOutputFormat=e.FileSystemItem=void 0,(c=e.FileSystemItem||(e.FileSystemItem={})).File="file",c.Directory="directory",(s=e.ImportModuleOutputFormat||(e.ImportModuleOutputFormat={})).Markdown="md",s.Html="html",(u=e.ModelType||(e.ModelType={}))[u.Note=1]="Note",u[u.Folder=2]="Folder",u[u.Setting=3]="Setting",u[u.Resource=4]="Resource",u[u.Tag=5]="Tag",u[u.NoteTag=6]="NoteTag",u[u.Search=7]="Search",u[u.Alarm=8]="Alarm",u[u.MasterKey=9]="MasterKey",u[u.ItemChange=10]="ItemChange",u[u.NoteResource=11]="NoteResource",u[u.ResourceLocalState=12]="ResourceLocalState",u[u.Revision=13]="Revision",u[u.Migration=14]="Migration",u[u.SmartFilter=15]="SmartFilter",u[u.Command=16]="Command",function(t){t.File="file",t.Edit="edit",t.View="view",t.Note="note",t.Tools="tools",t.Help="help",t.Context="context",t.NoteListContextMenu="noteListContextMenu",t.EditorContextMenu="editorContextMenu",t.FolderContextMenu="folderContextMenu",t.TagContextMenu="tagContextMenu"}(o=e.MenuItemLocation||(e.MenuItemLocation={})),e.isContextMenuItemLocation=function(t){return[o.Context,o.NoteListContextMenu,o.EditorContextMenu,o.FolderContextMenu,o.TagContextMenu].includes(t)},(d=e.ToolbarButtonLocation||(e.ToolbarButtonLocation={})).NoteToolbar="noteToolbar",d.EditorToolbar="editorToolbar",(r=e.SettingItemType||(e.SettingItemType={}))[r.Int=1]="Int",r[r.String=2]="String",r[r.Bool=3]="Bool",r[r.Array=4]="Array",r[r.Object=5]="Object",r[r.Button=6]="Button",(a=e.SettingItemSubType||(e.SettingItemSubType={})).FilePathAndArgs="file_path_and_args",a.FilePath="file_path",a.DirectoryPath="directory_path",(l=e.AppType||(e.AppType={})).Desktop="desktop",l.Mobile="mobile",l.Cli="cli",(i=e.SettingStorage||(e.SettingStorage={}))[i.Database=1]="Database",i[i.File=2]="File",(n=e.ContentScriptType||(e.ContentScriptType={})).MarkdownItPlugin="markdownItPlugin",n.CodeMirrorPlugin="codeMirrorPlugin"},156:function(t,e,o){var n=this&&this.__awaiter||function(t,e,o,n){return new(o||(o=Promise))((function(i,l){function a(t){try{d(n.next(t))}catch(t){l(t)}}function r(t){try{d(n.throw(t))}catch(t){l(t)}}function d(t){var e;t.done?i(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(a,r)}d((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=o(998),l=o(143);i.default.plugins.register({onStart:function(){return n(this,void 0,void 0,(function*(){const t=(yield i.default.plugins.installationDir())+"/google-fonts.css";yield i.default.window.loadNoteCssFile(t);const e=yield i.default.views.dialogs.create("googleFontsDialog"),o=`\n\t\t\t
\n\t\t\t\t\n
Font Preview
\n\t\t\t
\n `;yield i.default.views.dialogs.setHtml(e,o),yield i.default.views.dialogs.addScript(e,"./google-fonts.css"),yield i.default.views.dialogs.addScript(e,"./fontPreviewScript.js"),yield i.default.views.dialogs.setButtons(e,[{id:"cancel",title:"Cancel"},{id:"ok",title:"Apply Font"}]),yield i.default.commands.register({name:"googleFonts",label:"Google Fonts",iconName:"fas fa-font",execute:()=>n(this,void 0,void 0,(function*(){const t=yield i.default.views.dialogs.open(e);if("ok"===t.id){const e=t.formData.fontSelector.selectedFont;yield function(t){return n(this,void 0,void 0,(function*(){const e=yield i.default.commands.execute("selectedText");if(!(null==e?void 0:e.length))return void alert("Select text to apply font.");const o=`${e}`;yield i.default.commands.execute("replaceSelection",o)}))}(e)}}))}),yield i.default.views.toolbarButtons.create("googleFonts","googleFonts",l.ToolbarButtonLocation.EditorToolbar)}))}})}},e={};!function o(n){var i=e[n];if(void 0!==i)return i.exports;var l=e[n]={exports:{}};return t[n].call(l.exports,l,l.exports,o),l.exports}(156)})();manifest.json000644 0000000776 14600100655010414 0ustar00000000 000000 { "manifest_version": 1, "id": "com.zealmayfield.GoogleFontsPlugin", "app_min_version": "2.13", "version": "1.0.0", "name": "Google Fonts Plugin", "description": "Use a font available from Google Fonts to style the text selected in the editor.", "author": "Zeal Jared Mayfield", "homepage_url": "https://github.com/ZealJared/joplin-plugin-google-fonts", "repository_url": "https://github.com/ZealJared/joplin-plugin-google-fonts", "keywords": [], "categories": [], "screenshots": [], "icons": {} }