Greasemonkey Script to add keyboard shortcuts to MySource Matrix


(Webmaster) #1

One day I got really sick of clicking while using matrix.


So i began hacking up this (very messy) greasemonkey script (you need to install the greasemonkey plugin for firefox to use it)



I cant upload .js files so you will have to rename the attachment to matrix.user.js before you use it.



[attachment=345:matrix.user.js.txt] (download and rename to matrix.user.js) then just open it if firefox with greasemonkey installed and it will offer to install it.



it adds:



<ctrl><alt>` - help menu

<ctrl>s - save

<ctrl><alt>v - make live

<ctrl><alt>c - cascade changes

<ctrl><alt>l - get a lock

<ctrl><alt>h - set areas to html

<ctrl><alt>u - hide mysource areas in parse file

<ctrl><alt><s>u - show mysource areas in parse file

<ctrl><alt>1(one) - jump to edit contents screen of current asset (and get a lock)

<ctrl><alt>0(zero) - jump to screen select menu of asset

<ctrl><alt>m - insert %asset_metadata_DC.Description%

<ctrl><alt>n - insert %asset_name%



also a little menu at the top of the parse files textarea which inserts all the common MySource Areas you might use and causes the tab key to indent by 3 spaces and shift tab to outdent 3 spaces (works on blocks of code).



code may or may not work with your version of matrix tested (well more like used) with firerfox 2 and 3 on matrix 3.16.0



feel free to post suggestions or improvements



enjoy

Steven
matrix.user.js.txt (47.7 KB)


(Duncan Robertson) #2

Thanks so much, I installed it and it seems to work great. If I have any ideas I'll post them here!


(Webmaster) #3

Glad you like it, have updated the script to keep the cursor position in textareas when you click save so when you are 200 lines down a css file and testing changes you dont have to scroll back to find where you were up to.

Also removed so comments that caused the script to not install properly.

(Duncan Robertson) #4

Oh that is sweet!


(Webmaster) #5

Yeah ... I so wish I had put that in first. :P I am thinking about changing to remember position based on asset id, cause at the moment it only rembers if you keep editing the same asset.

(Tavernerj) #6

Steven,


I prefer <ctrl>a to lock/unlock an asset - uses less fingers :wink:



so you'll need to edit line 195 to;



if(event.ctrlKey && (event.charCode == 97)){ // 97 <- a key



Cheers Julian



P.S. there does seem to be a slight delay (2 seconds or so) between actioning the shortcuts & the actual execution, any clues ???


(Webmaster) #7

[quote]Steven,


I prefer <ctrl>a to lock/unlock an asset - uses less fingers :wink:



so you'll need to edit line 195 to;



if(event.ctrlKey && (event.charCode == 97)){ // 97 <- a key



Cheers Julian



P.S. there does seem to be a slight delay (2 seconds or so) between actioning the shortcuts & the actual execution, any clues ???[/quote]



Was thinking about creating configurable shortcuts (one day).



I did try to avoid common shortcuts like <ctrl>a but would be nice if ppl could pick their own.



Sorry no clues about the speed … maybe the lightning speed of matrix ? seem to submit the form instantly here.



Steven


(Duncan Robertson) #8

I think it's Matrix rather than GM that's causing the delay…


(Webmaster) #9

I have uploaded a new version at http://steven.upritchard.com/code/mysource_matrix_greasemoneky


(Rachel Macdonald) #10

Trying it for the first time… are the shortcuts all the same as above?


(Benjamin Pearson) #11

There is some keyboard shortcuts in MySource Matrix:
Acquire Lock(s): Alt+A (Mac: Ctrl+A, Firefox: Alt+Shift+A)

Release Lock(s): Alt+R (Mac: Ctrl+R, Firefox: Alt+Shift+R)

Commit (Save): Alt+S (Mac: Ctrl+S, Firefox: Alt+Shirt+S)

Increase the size of the text in the Asset Map: Ctrl+Shift+Plus

Decrease the size of the text in the Asset Map: Ctrl+Shift+Minus

Jump to an asset in the Asset Map: First letter of the asset name

Move up the Asset Map:Up arrow

Move down the Asset Map: Down arrow

Expand the assets in the Asset Map: Right arrow

Collapse the assets in the Asset Map: Left arrow

Delete an Asset in the Asset Map: Delete key


(Deborah Sherwood) #12

You can find the full list of available keyboard shortcuts here on the manuals web site.