mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Add injected css/javascript to plugins (#3195)
* Add injected css/javascript to plugins * Manual documentation
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
# Embedded Plugins
|
||||
# Embedded Plugin Tasks
|
||||
|
||||
Embedded plugins are executed within the stash process using a scripting system.
|
||||
Embedded plugin tasks are executed within the stash process using a scripting system.
|
||||
|
||||
## Supported script languages
|
||||
|
||||
Stash currently supports Javascript embedded plugins using [otto](https://github.com/robertkrimen/otto).
|
||||
Stash currently supports Javascript embedded plugin tasks using [otto](https://github.com/robertkrimen/otto).
|
||||
|
||||
# Javascript plugins
|
||||
|
||||
## Plugin input
|
||||
|
||||
The input is provided to Javascript plugins using the `input` global variable, and is an object based on the structure provided in the `Plugin input` section of the [Plugins](/help/Plugins.md) page. Note that the `server_connection` field should not be necessary in most embedded plugins.
|
||||
The input is provided to Javascript plugin tasks using the `input` global variable, and is an object based on the structure provided in the `Plugin input` section of the [Plugins](/help/Plugins.md) page. Note that the `server_connection` field should not be necessary in most embedded plugins.
|
||||
|
||||
## Plugin output
|
||||
|
||||
The output of a Javascript plugin is derived from the evaluated value of the script. The output should conform to the structure provided in the `Plugin output` section of the [Plugins](/help/Plugins.md) page.
|
||||
The output of a Javascript plugin task is derived from the evaluated value of the script. The output should conform to the structure provided in the `Plugin output` section of the [Plugins](/help/Plugins.md) page.
|
||||
|
||||
There are a number of ways to return the plugin output:
|
||||
|
||||
@@ -53,22 +53,6 @@ See the `Javascript API` section below on how to log with Javascript plugins.
|
||||
|
||||
# Plugin configuration file format
|
||||
|
||||
The basic structure of an embedded plugin configuration file is as follows:
|
||||
|
||||
```
|
||||
name: <plugin name>
|
||||
description: <optional description of the plugin>
|
||||
version: <optional version tag>
|
||||
url: <optional url>
|
||||
exec:
|
||||
- <path to script>
|
||||
interface: [interface type]
|
||||
tasks:
|
||||
- ...
|
||||
```
|
||||
|
||||
The `name`, `description`, `version` and `url` fields are displayed on the plugins page.
|
||||
|
||||
## exec
|
||||
|
||||
For embedded plugins, the `exec` field is a list with the first element being the path to the Javascript file that will be executed. It is expected that the path to the Javascript file is relative to the directory of the plugin configuration file.
|
||||
|
||||
Reference in New Issue
Block a user