javascript:ace

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
javascript:ace [2019/09/08 21:03] – [//#region [リージョンの説明] 〜 #endregion までをデフォルトで折り畳む方法] ともやんjavascript:ace [2019/09/08 21:07] – [//#region [リージョンの説明] 〜 //#endregion までをデフォルトで折り畳む方法] ともやん
行 126: 行 126:
   ace.EditSession.prototype.foldAllRegion = function(startRow, endRow, depth) {   ace.EditSession.prototype.foldAllRegion = function(startRow, endRow, depth) {
     if (depth == undefined)     if (depth == undefined)
-       depth = 100000; // JSON.stringify doesn't hanle Infinity+      depth = 100000; // JSON.stringify doesn't hanle Infinity
     var foldWidgets = this.foldWidgets;     var foldWidgets = this.foldWidgets;
     if (!foldWidgets)     if (!foldWidgets)
行 155: 行 155:
   };   };
   //#endregion   //#endregion
 +  
 +  jQuery(function($) {
 +    const editor = ace.edit("ace_editor");
 +    editor.setTheme("ace/theme/chrome");
 +    editor.session.setMode("ace/mode/javascript");
 +    const lines = editors[i].getSession().getDocument().getLength();
 +    editor.setOptions({maxLines: lines});
 +    
 +    // #region をデフォルトで折り畳む
 +    editor.session.foldAllRegion();
 +  });
 </code> </code>
  
  • javascript/ace.txt
  • 最終更新: 2020/06/15 19:46
  • by 非ログインユーザー