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 »

Sidelong wrote:aescrypt-test не шифрует.
И не должен, он окошко запроса пароля тестирует (и специально не выполняет медленное шифрование).
Sidelong wrote:готовых реализаций разных алгоритмов полно, запихал несколько функций шифрования в длл, форму с вводом пароля и выбором алгоритма прикрутил и всё, плюс быстродействие да и со звёздами проблем не будет.
Думается, было бы все очень просто, было бы оно уже давно в Format-плагине. :)
FeyFre wrote:RTFM читали? Там черным по белому написано: если реализация EDIT-контрола загружается из библиотеки USER32.DLL то отображаются звездочки, если же реализация из comctl32.dll - отображаются черные кружки.
Да какая разница, в чем причина, если нужно всего лишь получить такие же символы.
FeyFre wrote:Можете попросить Инструктора что-бы в GetLastError соотв. ошибку ставил(библиотека не найдена, символ не найден, пр).
По-моему, если что и делать для подобных целей, так это консоль в виде отдельной панели – чтобы туда предупреждения выдавать.


Теперь со своим окошком для запроса пароля: AESCrypt.js

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

Post by KDJ »

The function Array2DSort is now able to sort ignoring case-sensitive.

Offline
Posts: 120
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

Infocatcher wrote:All: implemented new localization method (example).
Your localization method is so good, but most of your scripts unable to run on my machine. Because Russian char in the scripts is incompatible on NON-Russian machine.
Long time ago SearchReplace.js and LineFilter.js have the same problem. See here. But now they work OK by using unicode ESC sequence for Russian char.

Offline
Posts: 2248
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

cnnnc
You should correctly save scripts(e.g BOM-ed utf8).ECMA supports most of encoding transparently.

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

Post by Infocatcher »

FeyFre wrote:e.g BOM-ed utf8).ECMA
Sounds very good. Does it work on old Windows? At least on Windows 2000 and newer.


I forgot to test :( and some my scripts contains function insertNoScroll() with SetSel(0, -1) before them.
Updated: convertHTML.js, convertEscapes.js, AESCrypt.js (+ fixed small bug with uninitialized variable)

toggleComments.js – corrected escapeRegExp() function (not affected with default settings)

highlighter-test.js – implemented experimental recognize mechanism for unsaved files or files without extension (it's stupid and fails sometimes)

New untested scripts:
convertRegExp.js

Code: Select all

Escape special RegExp symbols:
http://example.com/ => http:\/\/example\.com\/

Unescape special RegExp symbols:
http:\/\/example\.com\/ => http://example.com/
converter.js – all converters in one script with optional GUI :)
And I don't know, how make marked as «//~ todo:». :?
Last edited by Infocatcher on Mon Dec 06, 2010 6:58 pm, edited 1 time in total.

Offline
Posts: 2248
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

Sounds very good. Does it work on old Windows? At least on Windows 2000 and newer.
Have not such old Windows installed on accessible PCs. Minimum XPSP3 or 2k3 standard edition.

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

Post by se7h »

Infocatcher
ссылка на convertHTML.js не та

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

Post by Infocatcher »

se7h wrote:ссылка на convertHTML.js не та
Никогда не давался массовый копипаст. :) Спасибо, исправил.

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

Post by KDJ »

FeyFre wrote:AkelEdit message AEM_GETTEXTRANGE.
Help me. What is size of AETEXTRANGEW?

typedef struct {
AECHARRANGE cr; // 24B
BOOL bColumnSel; // 1B
wchar_t *pBuffer; // 2B
DWORD dwBufferMax; // 4B
int nNewLine; // 4B
int nCodePage; // 4B
const char *lpDefaultChar; // 1B
BOOL *lpUsedDefChar; // 1B
BOOL bFillSpaces; // 1B
} AETEXTRANGEW;

Have I counted correctly? Will it be 42 Bytes?

Offline
Posts: 2248
Joined: Tue Aug 07, 2007 2:03 pm
Location: Vinnitsa, Ukraine

Post by FeyFre »

Code: Select all

typedef struct _AECHARINDEX {
  int nLine;           4
  AELINEDATA *lpLine;  sizeof any pointer is equal 4 (32 bit)
  int nCharInLine;     4
} AECHARINDEX;
			// SUM = 12
typedef struct {
  AECHARINDEX ciMin;  12
  AECHARINDEX ciMax;  12
} AECHARRANGE;
			// SUM = 24

typedef struct {
  AECHARRANGE cr;             24
  BOOL bColumnSel;            BOOL is typedef to int(in some versions of SDK to long) == 4 (32 bit)
  wchar_t *pBuffer;           sizeof any pointer is equal 4 (32 bit)
  DWORD dwBufferMax;          4
  int nNewLine;               4
  int nCodePage;              4
  const char *lpDefaultChar;  sizeof any pointer is equal 4 (32 bit)
  BOOL *lpUsedDefChar;        sizeof any pointer is equal 4 (32 bit)
  BOOL bFillSpaces;           4
} AETEXTRANGEW;
				// SUM = 56

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

Post by Infocatcher »

Infocatcher wrote:corrected escapeRegExp() function (not affected with default settings)
Oh, I forgot about «|» too. :? Updated again.

More untested features for converter.js :D
Encode/decode Uniform Resource Identifiers (URIs) with
encodeURI/decodeURI
and
encodeURIComponent/decodeURIComponent

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

Post by KDJ »

Thanks FeyFre. A little wrong, but I was close. :D
Last edited by KDJ on Fri Dec 10, 2010 11:20 am, edited 1 time in total.

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

Post by Infocatcher »

Still test versions:
highlighter-test.js – fixed command line handling, added «-restore» argument for set extensions from current file without dialog.
converter.js – small improvements.

Offline
Posts: 876
Joined: Tue Jul 24, 2007 8:54 am

Post by Fr0sT »

Infocatcher
можешь добавить мой base64 кодер/декодер в свой мега-конвертер :) а вообще, по-хорошему, надо бы всё это в плагин забабахать.

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

Post by KDJ »

Instructor wrote:KDJ
I need a function that gets the text in columns.
SetSel -> AEM_UPDATESEL with AESELT_COLUMNON -> GetSelText
But I wanted to retrieve the text without selecting.
Locked