編集の要約なし |
編集の要約なし |
||
| 11行目: | 11行目: | ||
|- | |- | ||
|KL.js | |KL.js | ||
|Selection/Document/ | |Selection/Document/Editorの拡張など。 | ||
|- | |- | ||
|polyfill.js | |polyfill.js | ||
| 43行目: | 43行目: | ||
|旧版に同じ。 | |旧版に同じ。 | ||
|} | |} | ||
==KL.js== | |||
KLを名前空間として独自のオブジェクトとMery組み込みオブジェクトの拡張を含む。 | |||
===オブジェクト=== | |||
;KL.Range(<= KILI.Range) | |||
:範囲を表す。座標系はKL.Pointで指定する。 | |||
KL.Coord(<= KILI.Coordinate/KILI.LineMode) | |||
:座標系posをserialに変更。logicalとviewはmePosViewとmePosLogicalに数値を合わせた | |||
;KL.Dir(<= KILI.Direction) | |||
:選択方向。 | |||
KL.Point(<= KILI.Point) | |||
:座標系を指定できる様に変更。 | |||
===メソッド=== | |||
;KL.GetScroll/KL.SetScroll | |||
:スクロール位置の取得/設定。 | |||
===組み込みオブジェクトの拡張=== | |||
旧版の機能ごとの分類からSelection/Document/Editorのラッパに変更したので、Mery組み込みの機能と独自の機能を同じ方法で呼び出せる。 | |||
e.g. | |||
<source lang="javascript" style="word-wrap:break-word;"> | |||
//旧版 | |||
var $d=GSO(); | |||
$s.Text=KILI.selex.getLeft(); | |||
//新版 | |||
let $s=KL.Selection(); | |||
$s.Text=$s.GetLeft(); | |||
</source> | |||
====KL.Editor==== | |||
{| class="wikitable" | |||
|Original | |||
|組み込みのEditor。 | |||
|- | |||
|Documents | |||
|KL.Documents。 | |||
|- | |||
|ActiveDocument | |||
|アクティブな文書のKL.Document。組み込みのActiveDocumentではない。 | |||
|- | |||
|NewFile | |||
|文書を新規作成する。 | |||
|- | |||
|GetDocument | |||
|Documentオブジェクトを取得する。 | |||
|- | |||
|} | |||
====KL.Document==== | |||
{| class="wikitable" | |||
|Original | |||
|組み込みのDocument。 | |||
|- | |||
|Close | |||
|文書を閉じる。組み込みのを追加拡張している。 | |||
|- | |||
|Selection | |||
|KL.Selectionを取得。 | |||
|- | |||
|LineEndingChar | |||
|改行文字を取得する。 | |||
|- | |||
|ToSerial | |||
|座標を文頭からの位置に変換する。 | |||
|- | |||
|ToLogical | |||
|座標を論理行座標に変換する。 | |||
|- | |||
|ToView | |||
|座標を表示行座標に変換する。 | |||
|- | |||
|LogicalToView | |||
|論理行座標を表示行座標に変換する。 | |||
|- | |||
|LogicalToSerial | |||
|論理行座標を文頭からの位置に変換する。 | |||
|- | |||
|SerialToLogical | |||
|文頭からの位置を論理行座標に変換する。 | |||
|- | |||
|SerialToView | |||
|文頭からの位置を表示行座標に変換する。 | |||
|- | |||
|ViewToLogical | |||
|表示行座標を論理行座標に変換する。 | |||
|- | |||
|ViewToSerial | |||
|表示行座標を文書先頭からの位置に変換する。 | |||
|- | |||
|Clone | |||
|文書のクローンを作成する。 | |||
|- | |||
|Lines | |||
|行を取得する。 | |||
|- | |||
|} | |||
====KL.Selection==== | |||
{| class="wikitable" | |||
|Original | |||
|組み込みのDocument。 | |||
|- | |||
|OriginalParent | |||
|親となる組み込みのDocument。 | |||
|- | |||
|Parent | |||
|親となるKL.Documentオブジェクト。 | |||
|- | |||
|SelectLines | |||
|複数の行を選択する。 | |||
|- | |||
|SelectLineRange | |||
|複数の行を選択する。 | |||
|- | |||
|SelectIfEmpty | |||
|選択されていなければ選択する。 | |||
|- | |||
|IsLogicalStart | |||
|論理行頭かどうか判定する。 | |||
|- | |||
|IsLogicalEnd | |||
|論理行末かどうか判定する。 | |||
|- | |||
|IsViewStart | |||
|表示行頭かどうか判定する。 | |||
|- | |||
|IsViewEnd | |||
|表示行末かどうか判定する。 | |||
|- | |||
|IsEOF | |||
|文末かどうか判定する。 | |||
|- | |||
|Inline | |||
|行内選択かどうか判定する。 | |||
|- | |||
|Multiline | |||
|複数行に渡る選択かどうか判定する。 | |||
|- | |||
|WholeLines | |||
|行の全体を選択しているかどうか判定する。 | |||
|- | |||
|GetRange | |||
|選択範囲を取得する。 | |||
|- | |||
|SetRange | |||
|範囲選択する。 | |||
|- | |||
|GetDirection | |||
|テキスト選択方向を取得する。 | |||
|- | |||
|SetDirection | |||
|テキスト選択方向を設定する。 | |||
|- | |||
|Reverse | |||
|選択範囲を反転する。 | |||
|- | |||
|GetBottomPos | |||
|選択範囲の文末側の位置を取得する。 | |||
|- | |||
|GetTopPos | |||
|選択範囲の文頭側の位置を取得する。 | |||
|- | |||
|GetAnchorPoint | |||
|カーソル位置を取得する。 | |||
|- | |||
|GetActivePoint | |||
|選択範囲の開始位置を取得する。 | |||
|- | |||
|GetBottomPoint | |||
|選択範囲の文末側の位置を取得する。 | |||
|- | |||
|GetTopPoint | |||
|選択範囲の文頭側の位置を取得する。 | |||
|- | |||
|GetLeft | |||
|選択範囲より左の文字列を取得する。 | |||
|- | |||
|GetRight | |||
|選択範囲より右の文字列を取得する。 | |||
|- | |||
|Exclude | |||
|選択部分から文末側の改行を除外する。 | |||
|- | |||
|Duplicate | |||
|テキスト二重化。 | |||
|- | |||
|Sort | |||
|選択範囲の行または文字列をソートする。 | |||
|- | |||
|DeleteLines | |||
|行を削除する。 | |||
|- | |||
|} | |||
==polyfill== | |||
ECMAScriptにありChakraでは使用できないものの補完。 | |||
* Array.from() | |||
* Array.of() | |||
* Array.prototype.copyWithin() | |||
* Array.prototype.fill() | |||
* Array.prototype.find() | |||
* Array.prototype.findIndex() | |||
* Array.prototype.flat() | |||
* Array.prototype.flatMap() | |||
* Array.prototype.includes() | |||
* Math.trunc() | |||
* Number.isFinite() | |||
* Number.isInteger() | |||
* Number.isNaN() | |||
* Number.parseFloat() | |||
* Number.parseInt() | |||
* Object.is() | |||
* String.fromCodePoint() | |||
* String.prototype.codePointAt() | |||
* String.prototype.endsWith() | |||
* String.prototype.includes() | |||
* String.prototype.padEnd() | |||
* String.prototype.padStart() | |||
* String.prototype.repeat() | |||
* String.prototype.startsWith() | |||
* String.prototype.trimEnd() | |||
=kili= | =kili= | ||
スポンサーリンク