Scripts discussion (1)

Discuss and announce AkelPad plugins
Locked
  • Author
  • Message
KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

VladSh wrote:
KDJ wrote:Gentlemen, thank you very much for your good ideas. I will try to do it.
It became interesting and I made myself, sorry... :D
ShiftVerticaly.js
Congratulations, you've done it quickly.
But you need a little bit to improve. The script can add blank lines to the text.

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

Post by Infocatcher »

VladSh wrote:Ребята и я имели ввиду, что у них нет шаблонов для создания, т.е. template.css и т.п...
А то они у меня есть. Нужно давить тягу к копипасту. :D
template.html
Хотя это скорее уж template.xhtml :)
VladSh wrote:Когда нет папки...
Вроде, создание папок ни разу не рекурсивное, так что там хорошо бы и все предыдущие папки проверять. :?
Скрипт обновил.
VladSh wrote:И почему не хотите вызывать менюху при создании? :) Ну и что, что 2 раза вылетает, зато не надо реестр дёргать (пингвиноиды спасибо скажут), да и всё же красивше?.. :wink:
Так ведь можно править существующий шаблон, а можно новый создавать. Хотя можно сначала меню подправить, это да.

Красивше в начале каждого шаблона приводить его «название», а скрипт пусть парсит папку с шаблонами и показывает список. :roll:

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

Post by KDJ »

I corrected scripts LinesMoveDown.js and LinesMoveUp.js.
I used the function setRedraw(hWnd, bRedraw) written by VladSh.
Scripts now work much faster.
Thank you for your help VladSh.
viewtopic.php?p=8224&hilit=#p8224

Offline
Posts: 3234
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

KDJ wrote:The script can add blank lines to the text.
Thank you for your observation! 8) Fixed :)
KDJ wrote:I used the function setRedraw(hWnd, bRedraw) written by VladSh.
For the sake of fairness: the script was initially written by the Instructor, then was corrected Infocatcher. Thank you colleagues! :D

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

Post by KDJ »

VladSh wrote:
KDJ wrote:The script can add blank lines to the text.
Thank you for your observation! 8) Fixed :)
Yet something is wrong
When you try move the first row up, or the last line down.
The script inserts the blank lines to the document.

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

Re: Method AkelPad.GetSelText()

Post by KDJ »

KDJ wrote:I have a question.
What do the different arguments in the method AkelPad.GetSelText()?
What is the difference obtained strings?
GetSelText([nNewLine]);

Arguments
nNewLine (only for AkelPad 4.x.x)
1 //"\r" new line (default).
2 //"\n" new line.
3 //"\r\n" new line.

Return Value
String. Selected text.
I already know! :D
AkelPad.GetSelText(1) as the end of the line returns the character 0Dh,
AkelPad.GetSelText(2) returns the character 0Ah,
AkelPad.GetSelText(3) returns two characters 0Dh and 0Ah.

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

Post by Infocatcher »

VladSh wrote:the script was initially written by the Instructor, then was corrected Infocatcher.
There is no correction – just another syntax. :)

Offline
Posts: 3234
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Приколы "нашего городка".

этот код работает (заходит во второе условие, когда bSelEOL = false):

Code: Select all

var bSelEOL = (!AkelPad.IsPluginRunning("SmartSel::NoSelEOL"));

if (!bSelEOL)
{
	if (nMaxLine == nLastLine) nEndCorrect += 2;
}
else
{
	nEndCorrect += 1;
}
этот не работает:

Code: Select all

var bSelEOL = (!AkelPad.IsPluginRunning("SmartSel::NoSelEOL"));

if (!bSelEOL)
	if (nMaxLine == nLastLine) nEndCorrect += 2;
else
	nEndCorrect += 1;
я в шорохе...

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

Post by Infocatcher »

VladSh wrote:этот не работает:

Code: Select all

var bSelEOL = (!AkelPad.IsPluginRunning("SmartSel::NoSelEOL"));

if (!bSelEOL)
	if (nMaxLine == nLastLine) nEndCorrect += 2;
else
	nEndCorrect += 1;
я в шорохе...
=>

Code: Select all

if (!bSelEOL)
	if (nMaxLine == nLastLine)
		nEndCorrect += 2;
	else
		nEndCorrect += 1;
После второго if ищет else и находит.

Offline
Posts: 3234
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

Infocatcher
То тогда совсем не то условие...

А мне надо:

Code: Select all

if (!bSelEOL) 
   if (nMaxLine == nLastLine) 
      nEndCorrect += 2; 
else 
   nEndCorrect += 1;
По логике-то оно да... но пока скобки не поставил, не заработало.

Offline
Posts: 3234
Joined: Wed Nov 29, 2006 1:19 pm
Location: Киев, Русь
Contact:

Post by VladSh »

KDJ wrote:Yet something is wrong
When you try move the first row up, or the last line down.
The script inserts the blank lines to the document.
Thank you for the localization problem!
Done. But not as we would like ...
Last edited by VladSh on Thu Jul 22, 2010 7:33 am, edited 1 time in total.

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

Post by Fr0sT »

VladSh

Code: Select all

if (!bSelEOL) 
   if (nMaxLine == nLastLine) 
      nEndCorrect += 2;
   else; 
else 
   nEndCorrect += 1;

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

Post by Infocatcher »

Ok, мы тоже умеем:

Code: Select all

if (bSelEOL)
	nEndCorrect += 1;
else if (nMaxLine == nLastLine)
	nEndCorrect += 2;
И, чтобы жизнь медом не казалась:

Code: Select all

bSelEOL
	? (nEndCorrect += 1)
	: nMaxLine == nLastLine
		? (nEndCorrect += 2)
		: void 0;
:D

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

Post by KDJ »

Script LinesMoveUpDown.js - moves the selected lines in the up or down.
Two in one.

viewtopic.php?p=8224&hilit=#p8224
Last edited by KDJ on Thu Jul 22, 2010 11:04 am, edited 1 time in total.

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

Post by se7h »

Обновился LanguageHelp.js (1.4)

Забудьте о старых проблемах, теперь поиск происходит по Указателю CHM и никаких путей, декомпиляций больше делать не придётся, просто скачайте любой CHM хелп и забросьте в нужную папку

Обновились все CHM файлы в сообщении, кому нужно - скачайте заново

Tony
сбылась твоя мечта - полноценный поиск по гигантскому хелпу PHP
:D
Last edited by se7h on Thu Jul 22, 2010 9:38 am, edited 1 time in total.
Locked