Scripts discussion (1)

Discuss and announce AkelPad plugins
Locked
  • Author
  • Message
Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

toggleComments-experimental.js
Исправлено некорректное определение конструкций вида func(a, /*b + */c) как регулярных выражений (важен первый непробельный символ перед открывающей «/»).
И,

Code: Select all

.replace(
	/([=(\[,&|?:!]\s*((\/\/[^\n\r]*[\n\r]+|\/\*[\s\S]*?\*\/)\s*)*)\/([^*\\\/\n\r]|\\[^\n\r])(\\\/|[^\/\n\r])*\//g,
	// special chars   line comments       block comments         regexp begin                       regexp end
	function(s, prefix) {
		return prefix + escaper(s.substr(prefix.length));
	}
);
:shock: :D
определение регулярных выражений, перед которыми находятся комментарии.

P.S. Что-то на форуме не то с шириной пробелов (?) в блоках кода.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Infocatcher
I like the script runScript.js.
Good for testing scripts with arguments.
Only thing missing is the list of scripts to choose from.
Could you do it?

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

KDJ
May be, but I think, is better to add arguments support to plugins dialog. :)

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

Prototype with list of scripts: runScript-test.js

Image


P.S.
Я wrote:P.S. Что-то на форуме не то с шириной пробелов (?) в блоках кода.
Как оказалось, что-то не так с отрисовкой шрифтов в Firefox 4 RC1. :)

Offline
Site Admin
Posts: 6403
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

Infocatcher

Code: Select all

AkelPad.IsOldWindows() ? 0 /*DT_ANSI*/ : 1 /*DT_UNICODE*/
эквивалентно _TSTR.

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

Instructor wrote:эквивалентно _TSTR.
Спасибо, упустил. :)

runScript-test.js
Dialog window is now resizable.
Removed eval() functionality – it's better to use separate scripts.


[Upd]
Separated eval() functionality:
executeScript.js, executeScript.vbs
Added -useTempFile argument – it's better to detect line with error.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Infocatcher
runScript-test.js is super. You've done it quickly. Thanks.
My suggestions:
1. Disable OK button when in the listbox is selected runScript
2. Double click on listbox can act as "Run".
3. After run sub-script, restore the focus to the dialog runScript.

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

1. Disable OK button when in the listbox is selected runScript
Strange. Sometimes I can run itself, but only sometimes.
In any case, it was a feature. :)
Should work better: runScript-test.js
2. Double click on listbox can act as "Run".
I don't know, how detect double click event. :?
3. After run sub-script, restore the focus to the dialog runScript.
Sounds very good, but I'm not sure that it is possible.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Infocatcher wrote:I don't know, how detect double click event. :?
You can use LBN_DBLCLK: http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Sounds very good, but I'm not sure that it is possible.
Try this: WM_ACTIVATE (http://msdn.microsoft.com/en-us/library ... 85%29.aspx)

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

KDJ wrote:You can use LBN_DBLCLK
Thanks, added. :)

[Upd]
converter.js
getHash.js
Added handling of double clicks on radiobuttons.

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

jsBeautifier.js
Now used \n as line breaks (trim_leading_comments() function didn't work).

Offline
Posts: 767
Joined: Mon Sep 28, 2009 10:03 am
Location: Minsk, Belarus

Post by se7h »

WinMerge 0.3
Some improvements in finding paths to WinMerge

Offline
Site Admin
Posts: 6403
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

Обновлен DeleteRecentFile.js для работы с AkelPad 4.5.6 или выше.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

I have a question.
What is the difference between AEGI_NEXTCHAR and AEGI_NEXTCHARINLINE?

Offline
Posts: 1873
Joined: Mon Aug 06, 2007 1:07 pm
Contact:

Post by Infocatcher »

Experimental and untested scripts come back again. :)

toggleComments-experimental.js
-blockCommentsEntireLines=-1 and -blockCommentsEntireLines=0 now works with -preferLineComments=true.

converter-test.js
Base64 converter now supports \0 character.
Added -codePageURI and -codePageBase64 arguments. Old -codePage still supported, but deprecated.

crypt-test.js (renamed AESCrypt.js script)
Added Blowfish encryption, based on scripts from http://www.farfarfar.com/scripts/encrypt/.
Added warning for slow operations.

getHash-test.js
Added SHA-224, SHA-384 and SHA-512 hash functions, based on scripts from http://www.farfarfar.com/scripts/encrypt/.
Fixed -autoCalc=true.
Added warning for slow operations.
Locked