-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
622a9e5
commit 3628aea
Showing
1 changed file
with
8 additions
and
57 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,13 @@ | ||
## ScriptsPlus, a StrokesPlus.net Plugin | ||
## SPPM - Scripts Plus Plugin Manager | ||
|
||
### Enhance the scripting capabilities of S+ with a rich module library. | ||
### Enhance the scripting capabilities of StrokesPlus with community made plugins. | ||
Inspired by the simplicity of jQuery, there are 40+ modules that extend and enhance the scripting capabilities within action scripts. | ||
Many common `sp.xxxx` methods are wrapped to simplify their use and some wrapped together to create new tools. | ||
|
||
# Install | ||
Download `ScriptsPlusPlugin.dll` from here and place it in `C:\Program Files\StrokesPlus.net\Plug-Ins` to be automatically picked up by S+ | ||
You can also add it manually, or place it in your own plugins folder and add that path. | ||
## Install | ||
Download `sppm.dll` from here and place it in `C:\Program Files\StrokesPlus.net\Plug-Ins` to be loaded automatically. You can also load the plugin manually _or_ place it in your own plugins folder and add that path. | ||
|
||
# Loading | ||
- Head to `Global Actions` | ||
- Open the `Load/Unload` tab | ||
- Check the box to enable the load script | ||
- Paste in this snippet: `var $ = ScriptsPlus();` | ||
- Profit! | ||
|
||
# Examples | ||
|
||
### Wrapped Methods | ||
```javascript | ||
// wraps `sp.MessageBox()` | ||
$.alert("Hello World!"); | ||
|
||
// wraps `new DisplayTextInfo()` | ||
$.toast("Hello World!"); | ||
|
||
// wraps `sp.sp.ShowBalloonTip()` | ||
$.balloon("Hello World!"); | ||
``` | ||
|
||
### Dialogs | ||
```javascript | ||
function getUserInput() { | ||
var modal = $.dialog.create("Text Input Demo"); | ||
|
||
modal.show(input => $.alert(input, "Input")); | ||
} | ||
|
||
getUserInput(); | ||
``` | ||
|
||
### Popup Menus | ||
```javascript | ||
var { addToMenu, addToSubMenu, menuItem, show } = $.popup; | ||
|
||
var popup = $.popup.create(); | ||
var addToMainMenu = $.popup.addToMenu(popup); | ||
|
||
var mastercam = menuItem("Mastercam"); | ||
var addToDemo = $.popup.addToSubMenu(mastercam); | ||
|
||
addToDemo(menuItem("Hello World", `$.alert('Hello World')`)); | ||
addToDemo(menuItem("Taco Bell", `$.alert('Taco Bell')`)); | ||
addToDemo(menuItem("Is Good", `$.alert('Is Good')`)); | ||
|
||
addToMainMenu(mastercam); | ||
addToMainMenu($.popup.spacer); | ||
addToMainMenu($.popup.cancel); | ||
|
||
show(popup); | ||
``` | ||
## Usage | ||
There are two main Classes provided to S+ | ||
- `SPPM` is used to manage and load plugins into the script engine. | ||
- `NPM` is used by `SPPM` for the heavy lifting and interacting with the file system. |