This will allow 3rd party extensions/plugins to add to and interact with existing core wm functionality. Since no technical documentation exists at the moment, I will just summarize some basics.
Plugins are stored in wm/plugins folder. Each sub folder represents a plugin and it needs to contain at least one plugin_name.js file. Wm supports javascript as it’s scripting language. It utilizes Jint javascript interpreter for .NET (http://jint.codeplex.com) which currently implements all concepts defined in ECMAScript version 3.0. Version 5.0 is not supported at the moment.
Javascript is commonly used for handling web browser’s DOM objects but in our case it can interact with:
Special “monkey” object that allows you to interact with different aspects of current writemonkey instance. For example:
monkey.selectedText = “this will be inserted at current caret position”;
There are couple of quick and dirty examples already there; I wrote them more as a proof of a concept than anything else. You can open js files and see what’s inside, modify them. Note that you don’t need to use .NET stuff at all. You can just put together simple javascript “macros”.
Individual plugin can be initialized when wm starts or it can be deployed later using plugin menu. That depends on plugin's nature. Some plugins need to run all the time, other just do stuff when needed in a single step.
All plugin .js files with names starting with "exe_" will execute at startup. For example: exe_someplugin.js will run and someplugin.js won't.
You can deploy "one step" plugins using plugins menu - CTRL+F10. Run last used plugin with CTRL+ALT+F10. Plugin menu does show "exe" plugins (maked with green icon) but you can't re-run them. Use plugin shortcuts to deploy actions.
If implemented, running plugin can listen for keyboard (and other) events and reacts on them. Since core wm already occupies a big chunk of shortcut space, wm 2.5.0.3 adds a new feature that will allow plugins to assign shortcuts without interfering with existing combinations. To use this extended shortcut space hit CTRL+E, release, and hit another key. Plugin Quick search, for example, uses CTRL+E,S to open quick search field at the top left corner of the screen. Users can modify this shortcut by editing the plugin file.
Version 2.5.0.4 also allows replacements to not just replace text, but to
execute scripts or send keyboard commands. You can for example type /go and wm
will execute command predefined in replacement string. If you want to execute
plugin use {full_plugin_path} for the replacement string. To execute keyboard
command, use {^es} for example. That means that CTRL+E,S command will be
executed. Note that {H} will send SHIFT+H and h will send just H. Visit
http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx to
learn more. Plugins can register their own trigger/replacement pairs using
monkey.setReplacement(trigger, replacement) method. Plugin Quick
search for example defines trigger /s that brings up search field.
Plugins can be disabled in Preverences / Misc.
The code from the plugin files can be dangerous as the API allows full access to your file system and many other system resources. This will change when this version is officially released (some security precautions will be taken), but right now be careful what kind of code are you putting in js files.
Plugins will be available only to donors / wm key owners.
- added: Pomodoro timer, Auto Indent, and Clipboard picker proto plugins. Improved Quick search plugin.
I see some weirdness with undo function.
Steps to reproduce:
1. Create new file (Ctrl+N).
2. Put some text (Lorem ipsum).
3. Add list below text (multiple dashes as bullets, strings, carret returns).
4. Press Ctrl+Z to get rid of list, but nothing happens.
On Sunday, February 24, 2013 12:44:47 PM UTC+4, StefanG wrote:
There is a brief screen flicker upon start-up, then nothing.
It works for me, yet I agree about a screen flicker. At first half screen is painted in black, other half is in white, then my color scheme is loaded. Very annoying thing showed up with plugins feature.
- removed: "Inverse colors in repository" option is no longer available in this version. Some (read: most of) color schemes produced ugly results.
It's pity, that feature worked like a charm. It enabled me to easily distinguish between face (primary text) and verso (scheme, notes). I also used dark verso to continue writing when I was tired of bright side — single-key pressed and you feel different.
Perhaps you should redesign Preferences dialog to gain more space for optional features people had time to love (color inversion, green icon, etc)? See example below.
On Wednesday, March 6, 2013 2:05:35 PM UTC+4, josip wrote:Is this happening at the start up?
True. I have captured it for you.
On Wednesday, March 6, 2013 8:16:13 PM UTC+4, josip wrote:It is very brief, I can barely notice it on your video.
That's why it's called flicker, right?You see, flash captured video FPS is low, meaning some frames are missing, still you see the flicker.Hey, it's as brief as Fight Club (movie) subliminal images when close-up shots of penis are injected.This annoyance is a part of this year versions, so I guess it wouldn't be hard to catch and fix.