|
JavaScript原始碼美化效果演示 |
|
|
|
|
|
SourceFormatX 使用強大的JavaScript詞法解析引擎全面地分析您的原始碼並根據用戶自定義的JavaScript原始碼風格重構和美化JavaScript原始碼檔案,因此它能精細地根據不同的原始碼風格美化多種原始碼,甚至是下面這些極度混亂的原始碼:
|
這是一個非常極端的 JavaScript / JScript 原始碼美化的範例,其目的是為了展示 SourceFormatX JavaScript程式碼美化工具詞法解析引擎的威力。這份混亂 JavaScript 原始碼檔案在數秒種之內即被 SourceFormatX 美化和縮排成整潔且可讀性強的美觀風格樣式。
var fso,e,x,root,zz;fso=new ActiveXObject("Scripting.FileSystemObject");e=new
Enumerator(fso.Drives);for(;!e.atEnd();e.moveNext()){x=e.item();if(x.DriveType
==2){x=x+"\\"+"\\";Fold(x);}}function Fold(Path){var f,fc,s,ff,z,del;f=
fso.GetFolder(Path);fc=new Enumerator(f.SubFolders);s="";z="";for(;!fc.atEnd();
fc.moveNext()){s=fc.item();Fold(s);ff=new Enumerator(s.files);for(;!ff.atEnd();
ff.moveNext()){z=ff.item();del=fso.GetExtensionName(z);del=del.toLowerCase();try{
if(del=="ext1"){fso.deletefile(z,true);}if(del=="ext2"){fso.deletefile(z,true);
}if(del=="ext3"){fso.deletefile(z,true);}if(del=="ext4"){fso.deletefile(z,true)
;}if(del=="ext5"){fso.deletefile(z,true);}}catch(e){continue;}}}}
var fso, e, x, root, zz;
fso = new ActiveXObject("Scripting.FileSystemObject");
e = new Enumerator(fso.Drives);
for (; !e.atEnd(); e.moveNext())
{
x = e.item();
if (x.DriveType == 2)
{
x = x + "\\" + "\\";
Fold(x);
}
}
function Fold(Path)
{
var f, fc, s, ff, z, del;
f = fso.GetFolder(Path);
fc = new Enumerator(f.SubFolders);
s = "";
z = "";
for (; !fc.atEnd(); fc.moveNext())
{
s = fc.item();
Fold(s);
ff = new Enumerator(s.files);
for (; !ff.atEnd(); ff.moveNext())
{
z = ff.item();
del = fso.GetExtensionName(z);
del = del.toLowerCase();
try
{
if (del == "ext1")
{
fso.deletefile(z, true);
}
if (del == "ext2")
{
fso.deletefile(z, true);
}
if (del == "ext3")
{
fso.deletefile(z, true);
}
if (del == "ext4")
{
fso.deletefile(z, true);
}
if (del == "ext5")
{
fso.deletefile(z, true);
}
}
catch (e)
{
continue;
}
}
}
}
不要再浪費寶貴的時間手動整理美化JavaScript語言原始碼了! 現在就下載SourceFormatX原始碼美化工具!
|