JS代碼格式化和語法著色V2
2024-09-06 12:44:43
供稿:網友
升級到第二版,開一貼以示慶賀,哈哈哈
自 Ver1.1 升級內容
1. 增加函數列表
2. 增加函數 Export 功能
3. 增加函數依存關系分析 (這個功能個人未見其他軟件實現過,自己創意,問題多多,目前分析能力還是比較有限的,只能分析全局函數依存關系,可能在復雜代碼的情況下出現 bug)
4. 修正 for 語句分析 bug
5. 修正 語法折疊的 bug
6. 改進 Collapse All ※ Expand All 函數工作方式,避免行數太大時的死機
7. 改進行號分析機制,避免行數太大時的死機
代碼如下:
<html>
<head>
<title>JSer Ver 2.0</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<style>
/* Global CSS */
* { padding:0px; margin:0px; font-size:13px; font-family: arial 宋體; }
body { overflow:auto; border:0px none black; background-color:buttonface; }
li { margin:0px 0px 0px 40px; padding:2px 4px; }
div { font-size:13px; line-height:14px; }
p { font-size:13px; line-height:14px; }
/* Class CSS */
.codeRoot { line-height:14px; }
.quote { color:#999; }
.comments { color: #009090; }
.indent { margin-left:25px; }
.regexp { color:#F000F0; }
.keyWord { color:blue; }
.object { color:red; }
.method_property { color:#FF8000; }
.operator { color:#004000; }
.colsp { font-size:12px; width:14px; height:14px; overflow:hidden; border:1px outset buttonface; text-align:center;
cursor:pointer; padding-left:2px; }
.colsp2 { font-size:12px; width:14px; height:14px; overflow:hidden; border:1px inset buttonface; text-align:center;
cursor:pointer; padding-left:2px; color:red!important; background-color:#E0FFF8!important; }
/* Identified CSS */
#divTools { height:20px; border-bottom:1px solid #555; padding-left:15px; }
#divTools a { color:navy; text-decoration:none; height:20px; line-height:20px; padding:0px 25px; }
#divTools a:hover { color:white; background-color:navy; text-decoration:none; height:20px; line-height:20px; }
#divJSInput { display:none; width:600px; height:450px; border:2px outset buttonface; position:absolute; background-