Skip to content

Commit

Permalink
js extension fprmat work
Browse files Browse the repository at this point in the history
  • Loading branch information
pilotmoon committed Aug 27, 2021
1 parent 9c0e860 commit 77208d7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
Binary file modified extensions/Lowercase.popclipextz
Binary file not shown.
Binary file modified extensions/TestJavaScript.popclipextz
Binary file not shown.
Binary file modified extensions/Uppercase.popclipextz
Binary file not shown.
7 changes: 4 additions & 3 deletions source/Lowercase/Config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
var Extension = {
// Experimental JavaScript format, subject to change.
var extension = {
identifier: "com.pilotmoon.popclip.extension.lowercase",
name: "Lowercase",
icon: "text:[[ab]]",
code: (selection, context) => {
context.paste(selection.text.toLowerCase())
code: (selection) => {
popclip.paste(selection.text.toLowerCase())
}
}
8 changes: 4 additions & 4 deletions source/TestJavaScript/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const starIcon = `svg:
<polygon points="255 402.21 412.59 497.25 370.9 318.01 510 197.47 326.63 181.74 255 12.75 183.37 181.74 0 197.47 139.1 318.01 97.41 497.25"/>
</svg>
`
var Extension = {
var extension = {
identifier: "com.pilotmoon.popclip.extension.test-js",
name: "TestJS",
icon: starIcon,
Expand All @@ -22,12 +22,12 @@ var Extension = {
// "public.rtf": rtf
// })
console.log("Hello")
console.log(context.getBrowserUrl(), context.getBrowserTitle())
},
flags: {
captureHtml: true,
captureHtml: true,
captureRtf: true,
captureBrowserInfo: true,
},
captureTypes: ["public.rtf", "com.apple.webarchive"],
options: [{identifier: "myoption", label: "My Option", type: "string"},
{identifier: "mybool",label: "Bool Option",type: "boolean"}],
}
Expand Down
7 changes: 4 additions & 3 deletions source/Uppercase/Config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
var Extension = {
// Experimental JavaScript format, subject to change.
var extension = {
identifier: "com.pilotmoon.popclip.extension.uppercase",
name: "Uppercase",
icon: "text:[[AB]]",
code: (selection, context) => {
context.paste(selection.text.toUpperCase())
code: (selection) => {
popclip.paste(selection.text.toUpperCase())
}
}

0 comments on commit 77208d7

Please sign in to comment.