差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| javascript:ace [2019/09/08 21:03] – [//#region [リージョンの説明] 〜 #endregion までをデフォルトで折り畳む方法] ともやん | javascript:ace [2020/06/15 19:46] (現在) – ↷ 移動操作に合わせてリンクを書き換えました。 非ログインユーザー | ||
|---|---|---|---|
| 行 87: | 行 87: | ||
| ==== ソースコードからのインストール ==== | ==== ソースコードからのインストール ==== | ||
| - | Ace をソースからビルドするには [[javascript: | + | Ace をソースからビルドするには [[javascript: |
| \\ | \\ | ||
| ソースを取得する。 | ソースを取得する。 | ||
| 行 116: | 行 116: | ||
| ===== //#region [リージョンの説明] 〜 //# | ===== //#region [リージョンの説明] 〜 //# | ||
| + | 実際のデモは以下にある。\\ | ||
| + | [[javascript: | ||
| <code javascript> | <code javascript> | ||
| //#region [Ace Editor fold all region] | //#region [Ace Editor fold all region] | ||
| 行 126: | 行 128: | ||
| ace.EditSession.prototype.foldAllRegion = function(startRow, | ace.EditSession.prototype.foldAllRegion = function(startRow, | ||
| if (depth == undefined) | if (depth == undefined) | ||
| - | depth = 100000; // JSON.stringify doesn' | + | |
| var foldWidgets = this.foldWidgets; | var foldWidgets = this.foldWidgets; | ||
| if (!foldWidgets) | if (!foldWidgets) | ||
| 行 155: | 行 157: | ||
| }; | }; | ||
| //# | //# | ||
| + | | ||
| + | jQuery(function($) { | ||
| + | const editor = ace.edit(" | ||
| + | editor.setTheme(" | ||
| + | editor.session.setMode(" | ||
| + | const lines = editors[i].getSession().getDocument().getLength(); | ||
| + | editor.setOptions({maxLines: | ||
| + | | ||
| + | // #region をデフォルトで折り畳む | ||
| + | editor.session.foldAllRegion(); | ||
| + | }); | ||
| </ | </ | ||