index.js000644 0000011114 14175667616007372 0ustar00000000 000000 !function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";var n=this&&this.__awaiter||function(e,t,o,n){return new(o||(o=Promise))((function(r,i){function a(e){try{l(n.next(e))}catch(e){i(e)}}function u(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(a,u)}l((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const r=o(1),i=o(2);r.default.plugins.register({onStart:function(){return n(this,void 0,void 0,(function*(){yield r.default.commands.register({name:"removeImagesCommand",label:"Remove Images",iconName:"fas fa-ban",execute:()=>n(this,void 0,void 0,(function*(){!function(){n(this,void 0,void 0,(function*(){const e=yield r.default.workspace.selectedNote(),t=/\[?(!)(\[[^\]\[]*\[?[^\]\[]*\]?[^\]\[]*)\]\(([^\s]+?)(?:\s+(["'])(.*?)\4)?\)/,o=/\[\]\((.*?)\)/,n=/!\[(.*?)\]\((.*?)\)/,i=//;if(e){var a=e.body;let l=e.body;var u=new RegExp([t,o,n,i].map((function(e){return(e+"").replace(/\//g,"")})).join("|"),"g");let c;for(;null!==(c=u.exec(a));)c.index===u.lastIndex&&u.lastIndex++,c.forEach((e,t)=>{0===t&&void 0!==t&&(l=l.replace(""+e,""))});yield r.default.commands.execute("textSelectAll"),yield r.default.commands.execute("replaceSelection",l)}else console.log("-----Note not loaded-----")}))}()}))}),yield r.default.views.toolbarButtons.create("myButton1","removeImagesCommand",i.ToolbarButtonLocation.EditorToolbar),yield r.default.views.menuItems.create("myMenuItem1","removeImagesCommand",i.MenuItemLocation.Tools,{accelerator:"CmdOrCtrl+Alt+Shift+B"})}))}})},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=joplin},function(e,t,o){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ContentScriptType=t.SettingStorage=t.AppType=t.SettingItemType=t.ToolbarButtonLocation=t.isContextMenuItemLocation=t.MenuItemLocation=t.ModelType=t.ImportModuleOutputFormat=t.FileSystemItem=void 0,function(e){e.File="file",e.Directory="directory"}(t.FileSystemItem||(t.FileSystemItem={})),function(e){e.Markdown="md",e.Html="html"}(t.ImportModuleOutputFormat||(t.ImportModuleOutputFormat={})),function(e){e[e.Note=1]="Note",e[e.Folder=2]="Folder",e[e.Setting=3]="Setting",e[e.Resource=4]="Resource",e[e.Tag=5]="Tag",e[e.NoteTag=6]="NoteTag",e[e.Search=7]="Search",e[e.Alarm=8]="Alarm",e[e.MasterKey=9]="MasterKey",e[e.ItemChange=10]="ItemChange",e[e.NoteResource=11]="NoteResource",e[e.ResourceLocalState=12]="ResourceLocalState",e[e.Revision=13]="Revision",e[e.Migration=14]="Migration",e[e.SmartFilter=15]="SmartFilter",e[e.Command=16]="Command"}(t.ModelType||(t.ModelType={})),function(e){e.File="file",e.Edit="edit",e.View="view",e.Note="note",e.Tools="tools",e.Help="help",e.Context="context",e.NoteListContextMenu="noteListContextMenu",e.EditorContextMenu="editorContextMenu",e.FolderContextMenu="folderContextMenu",e.TagContextMenu="tagContextMenu"}(n=t.MenuItemLocation||(t.MenuItemLocation={})),t.isContextMenuItemLocation=function(e){return[n.Context,n.NoteListContextMenu,n.EditorContextMenu,n.FolderContextMenu,n.TagContextMenu].includes(e)},function(e){e.NoteToolbar="noteToolbar",e.EditorToolbar="editorToolbar"}(t.ToolbarButtonLocation||(t.ToolbarButtonLocation={})),function(e){e[e.Int=1]="Int",e[e.String=2]="String",e[e.Bool=3]="Bool",e[e.Array=4]="Array",e[e.Object=5]="Object",e[e.Button=6]="Button"}(t.SettingItemType||(t.SettingItemType={})),function(e){e.Desktop="desktop",e.Mobile="mobile",e.Cli="cli"}(t.AppType||(t.AppType={})),function(e){e[e.Database=1]="Database",e[e.File=2]="File"}(t.SettingStorage||(t.SettingStorage={})),function(e){e.MarkdownItPlugin="markdownItPlugin",e.CodeMirrorPlugin="codeMirrorPlugin"}(t.ContentScriptType||(t.ContentScriptType={}))}]);manifest.json000644 0000000654 14175667616010435 0ustar00000000 000000 { "manifest_version": 1, "id": "com.remove.images.from.note", "app_min_version": "2.6", "version": "0.0.2", "name": "Remove Images", "description": "Allows to remove images from selected note", "author": "mak2002", "homepage_url": "https://github.com/mak2002/joplin-remove-images-from-note.git", "repository_url": "https://github.com/mak2002/joplin-remove-images-from-note.git", "keywords": ["joplin-plugin","image"] }