Last active
June 17, 2018 09:56
-
-
Save oeway/228a22a19899da7ac4084a4b781ae895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
importScripts('https://rawgit.com/joewalnes/filtrex/master/filtrex.js') | |
class Filter { | |
constructor() { | |
this.default_expression = '' | |
} | |
async run(my){ | |
const expression = my.data.filter_expression || this.default_expression; | |
const myfilter = compileExpression(expression) | |
return myfilter(my.target); | |
} | |
register(){ | |
return { | |
name: "Filter", | |
type: "localization/filter", | |
tags: ["localization", "action"], | |
init: "Filter the image with {id:'filter_expression', type:'string', placeholder:''}", | |
onact: this.run | |
} | |
} | |
} | |
api.export(new Filter()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment