/
MadDAD
/
alterplast
Обзор
Документация
Войти
/
MadDAD
/
alterplast
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
OpenConf_Scripts/MultiString.js
64 строки
2 KB
trdm
24 мар 2017, 12:42
24 мар 2017, 12:42
988c847
Код
Авторство
О чём код?
$NAME ������������� ����� /*=========================================================================== ������: MultiString.js ������: $Revision: 1.1 $ �����: ��������� �������� E-mail: kuntashov at [yandex.ru|gmail.com] ICQ UIN: 338758861 ��������: ������� ��� ������� �� ������/����������� � ����� ������������� ��������� �������� �� ������� 1� � �����������/��������� �������� �������� ����� ������ (|) � ������� ��������� ������� ������� (") �� ������ ("") � �������. ===========================================================================*/ function ����������������������() { var doc = CommonScripts.GetTextDocIfOpened(); var str = CommonScripts.GetFromClipboard(); if (doc && str) { var m, ind = ""; /* ��� ��������� ����� �������������� ������ ���������� ������ ������, � ������� ��������� ������ */ if (m=doc.Range(doc.SelStartLine).match(/^(\s+)/)) { ind = m[1]; } doc.Range( doc.SelStartLine, doc.SelStartCol, doc.SelEndLine, doc.SelEndCol) = str.replace(/\n/g, "\n"+ind+"\|").replace(/\"/g,'""'); } } function ����������������������() { var doc = CommonScripts.GetTextDocIfOpened(); if (doc) { var str = doc.Range(doc.SelStartLine, doc.SelStartCol, doc.SelEndLine, doc.SelEndCol); if (str) { CommonScripts.CopyToClipboard(str.replace(/^\s*\|/gm, "").replace(/\"\"/g, '"')); } } } /* * ��������� ������������� ������� */ function Init(_) // ��������� ��������, ����� ��������� �� �������� � ������� { try { var ocs = new ActiveXObject("OpenConf.CommonServices"); ocs.SetConfig(Configurator); SelfScript.AddNamedItem("CommonScripts", ocs, false); } catch (e) { Message("�� ���� ������� ������ OpenConf.CommonServices", mRedErr); Message(e.description, mRedErr); Message("������ " + SelfScript.Name + " �� ��������", mInformation); Scripts.UnLoad(SelfScript.Name); } } Init();