event
You can define some callback functions in advance according to your needs, and Eagle will actively call them when events occur.
onPluginCreate(callback)
When the plugin window is created, Eagle will actively call this method. You can use this method to initialize the modules required by the plugin.
callback
Functionplugin
Object - Plugin attributesmanifest
Object - The complete configuration of the plugin's manifest.json.path
String - The path where the plugin is located
Tip: If the plugin can run without manifest information, you can also use window.onload
for development.
onPluginRun(callback)
When the user clicks on the plugin in the plugin panel, Eagle will actively call this method.
callback
Function
onPluginBeforeExit(callback)
Before the plugin window closes, Eagle will actively call this method.
callback
Function
Tip: If you want to prevent the window from being closed, you can register the window.onbeforeunload
method to avoid the window being closed.
onPluginShow(callback)
When the plugin window is displayed, Eagle will actively call this method.
callback
Function
onPluginHide(callback)
When the plugin window is hidden, Eagle will actively call this method.
callback
Function
onLibraryChanged(callback)
When the user switches the resource library, Eagle will actively call this method.
callback
FunctionlibraryPath
String - The current resource library path.
Tip: If you need to get more complete information about the resource library, you can use the eagle.library.info()
method to obtain it.
Note: If the plugin execution process must rely on a relative resource library path, you may need to register this method and make corresponding adjustments when the resource library changes to avoid errors during program execution.
onThemeChanged(callback)
When the main program theme color of Eagle changes, Eagle will actively call this method. If the plugin supports multiple color themes, you can use this method to make corresponding UI adjustments.
callback
Functiontheme
String - The name of the current theme color, such asAuto
,LIGHT
,LIGHTGRAY
,GRAY
,DARK
,BLUE
,PURPLE
.
Last updated