Nightly Build 2.5.0.3

447 views
Skip to first unread message

josip

unread,
Jan 21, 2013, 5:06:47 PM1/21/13
to write...@googlegroups.com

DL: http://writemonkey.com/__files/NB/wm2503NB.zip


- fixed: False positive "The file was saved outside wm" message when saving files to remote machine with out of the sync system clock.


- changed: Updated sound library IrrKlang to version v1.4.0.


- added: New plugin engine features (see emphasized text below)



## Plugins engine


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:


* .NET 4.0 core functionality – Your scripts can instantiate and use all generic classes and methods. The usage is the same as in C# (.NET flagship language) with some minor differences.

* 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”.


### Included proto plugins


* Lorem ipsum - generate random lorem ipsum paragraphs of different lengths

* Namely - generate random names using huge database of real names

* Smarty pants - replace straight quotes with curly ones, -- to en dash, --- to em dash etc.

* Start double return - automatically insert 2 paragraph breaks with a single key stroke

* Wordwrap at 75 - hard break the text at certain position

* Quick search - find text quickly, [initialized at startup]

* Deploy: CTRL+E,S

* Find: start writing

* Next down: Down arrow, Enter

* Next up: Up arrow

* First: Home

* Last: End

* Clear search field: Delete

* Back to original location: Insert

* Auto save scratch - backup unsaved "scratch" files to desktop (or any other) folder on set interval [initialized at startup]

* Block comment - add or remove "//" from the paragraphs of selected text [initialized at startup]

* Deploy: CTRL+E,C (comment) / CTRL+E,U (uncomment)

* If nothing is selected, paragraph under the caret will be acted upon


### Modes of deployment


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. 


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.


## Notice of caution


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.

Kensai

unread,
Jan 21, 2013, 10:53:51 PM1/21/13
to write...@googlegroups.com
Sweet.  Quick search has already been helpful.  Auto save scratch went bonkers after I dumped the folder it put on my desktop (Bad Monkey messages, but no actual crash), so I pulled it from the plugin folder and everything is normal.  Haven't had a chance to test with sounds yet, but will tonight, so assume that if you don't hear back on that, I haven't had any issues with the new sound code either.

I'm working on my programmer buddy about maybe helping me write some plugins.  Of course I've only got one solid idea of one to make, so far ;-p

Kensai

josip

unread,
Jan 22, 2013, 3:45:11 AM1/22/13
to write...@googlegroups.com
Do share you plugin idea with us.
i.

Kensai

unread,
Jan 22, 2013, 8:55:58 AM1/22/13
to write...@googlegroups.com
Allow to save as and open zipped text file.  Would give us the same file size edge as .docx (since that is basically a zipped XHTML), but more importantly would allow us to password protect our files, which, while obviously not the most secure measure, would be that one simple roadblock that would easily stymie someone from casually browsing through our stuff and picking out stuff that looks useful for appropriation.

Might allow for user to input passwords for individual files, but should store a single master password that it will use by default for all files so saving and opening would still appear seamless if the user wanted to go that way.

Again, I know it doesn't sound terribly secure, and against your average physical intruder or a hack focused on you and your material, its not much of a deterrent, but against the kind of snooping that people who store their work on cloud services such as Dropbox, fear.  An attempt sift the archives that such services keep for us, hunting for potentially useful information would be blocked by simple ZIP encryption, and, IMO would virtually eliminate any lingering threat that users might feel from using such services.

I've also got tons of little stuff that I might be able to get done via plugin, though I won't know till I get someone who can figure that out for me.  Things like changing how Save As autonames files to help with notetaking and other rapid file creation tasks, or maybe figuring out how to give borderless windows rounded corners.

Kensai

josip

unread,
Jan 22, 2013, 11:15:12 AM1/22/13
to write...@googlegroups.com
Allow to save as and open zipped text file --> this is a good idea and it can be done. I might just add , that .net has some strong encryption methods build in so why not utilize those? The file size is not problematic with text files and modern drives / network pipes.

Save As autonames  --> can be done

Borderless windows with rounded corners --> easy to do

i.

Kensai

unread,
Jan 22, 2013, 11:29:54 AM1/22/13
to write...@googlegroups.com
i,


Allow to save as and open zipped text file --> this is a good idea and it can be done. I might just add , that .net has some strong encryption methods build in so why not utilize those? The file size is not problematic with text files and modern drives / network pipes.

Why not?  Mainly because I didn't know they existed and might be easier to do.  The seed for using ZIP was mainly planted when I discovered that DOCX format ran on it.  And no, file size isn't important, but it does seem weird that Word's proprietary format produces files much smaller than our beloved TXT files.  That just shouldn't happen, right? ;-p
 
Save As autonames  --> can be done

I'd be happy if it autonamed a new file with the first line of the text, sans illegal characters, maintaining capitalization and using spaces rather than underscores.  Being able to customize the number of characters used would be cool, but probably not necessary as long as the default allows for 30-40.

Borderless windows with rounded corners --> easy to do

That would be sweet :) 

Kensai

josip

unread,
Jan 22, 2013, 3:20:06 PM1/22/13
to write...@googlegroups.com
There you go :) Enable borderless window (ctrl click right edge of the writemonkey window to toggle) to see the effect. 
i.
Rounded monkey.zip

Kensai

unread,
Jan 22, 2013, 4:33:18 PM1/22/13
to write...@googlegroups.com
First off, that was fast.

Second off, that is beautiful.

Third off, now I am so glad that hadn't yet banished SublimeText from my tool kit.  You have included a bit of transparency with this plug that kicked in, then I switched back to 100%, then I resized or moved the window and it kicked back in, which made me want to see if I could just make that stop (not that its a bad idea, just not what I had in mind at that moment), so I pulled the script over to ST and it gave me a good look at it, so now I realize I can see what these things are doing and can at least modify their behavior, which, is awesome.  Played with setting the rounding way high to give myself a perfect circle of a text editing window which, while not useful in any way, was a bunch of fun for a couple minutes.  Anyway, this point is probably actually, thanks for including something that got my attention, leading me to see that I might possibly be able to put a hand in on this stuff.

Oh, and of course, I'm using right now.  I use TEA to move any sort of other text editing scenarios over to WM whenever possible, and right now I've just been digging the aesthetic and environment offered by the borderless window.  So ... thank you, thank you and heaping helpings more of thanks.  Just having too much fun with all this.

Kensai

josip

unread,
Jan 23, 2013, 3:09:53 AM1/23/13
to write...@googlegroups.com
Yes, it is fun, isn't it :) btw: Plugin will run more smoothly you use ClientSizeChanged event.
i.

monkey.form.add_ClientSizeChanged(function(object, eventargs) {
setBorder (); // Set border on resize
});

Kensai

unread,
Jan 23, 2013, 8:35:02 AM1/23/13
to write...@googlegroups.com
Why yes, it does.  Thanks you :)  Resizing did often hang previously.  Much more responsive now.

Kensai

unread,
Jan 23, 2013, 3:12:40 PM1/23/13
to write...@googlegroups.com
Any way to attach "drag borderless window by infobar" to that plugin? :)

Kensai

josip

unread,
Jan 23, 2013, 3:46:37 PM1/23/13
to write...@googlegroups.com
You can do it by dragging right side of the window. To resize, use right bottom corner (above info bar if enabled). But if you want to drag using info bar, yes it can be done in plugin.
i.

Kensai

unread,
Jan 23, 2013, 4:19:02 PM1/23/13
to write...@googlegroups.com
I only ask because I still keep trying to grab it and move the window, even though I've been using it a great deal this way for months now.  I will seriously attempt to click and drag the thing maybe 3 times per occurrence some days, even though I know where to grab it.  I'm not sure where my dysfunction is there.  I go to the right spot to resize every time, but I guess I'm having a harder time countering decades of click and drag at the title bar conditioning ;-p

josip

unread,
Jan 25, 2013, 3:45:42 AM1/25/13
to write...@googlegroups.com, luca...@gmail.com
Check is file irrKlang.NET4.dll is in your wm folder. If it is, which windows version are you using?
i.

On Thursday, January 24, 2013 9:39:11 PM UTC+1, luca...@gmail.com wrote:
This seems to be the problem:


- changed: Updated sound library IrrKlang to version v1.4.0.



josip

unread,
Jan 25, 2013, 3:59:14 AM1/25/13
to write...@googlegroups.com, luca...@gmail.com
Unzip and copy attached file into your wm dir (along with existing irrKlang.NET4.dll file) and give it another try. Let me know if that solves your problem. Thanks.
msvcr100.zip
Reply all
Reply to author
Forward
0 new messages