-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdemo.cfm
36 lines (32 loc) · 1.27 KB
/
demo.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<cfscript>
param demo="./";
parentPath = reverse(listRest(reverse(demo), "/")) & "/";
fullPath = expandPath(demo);
dir = directoryList(fullPath, false, "query");
try {
readme = fileRead("#fullPath#readme.txt");
} catch (any e) {
readme = "";
}
</cfscript>
<cfcontent reset="true"><!doctype html>
<html lang="en">
<head>
<title>LESS CSS, Meet ColdFusion Demos</title>
<link rel="stylesheet/less" type="text/css" href="demo.less" />
<script src="less-1.3.0.min.js"></script>
</head>
<body>
<cfoutput>
<nav>
<a href="index.html">« demos</a> <cfif len(demo) gt 3><a href="demo.cfm?demo=#parentPath#">&##x25b2; directory</a></cfif>
</nav>
<h1>LESS CF Experiment 1</h1>
<cfif len(readme)><p>#htmlCodeFormat(readme)#</p></cfif>
</cfoutput>
<pre><cfoutput query="dir">#chr(13)#
<cfif type EQ "file">#rJustify(dateFormat(dir.DateLastModified, "short"), 12)# #rJustify(timeFormat(dir.DateLastModified, "short"), 9)# #rJustify(dir.Size, 10)# <a href="#demo##dir.name#">#dir.Name#</a> <cfif listFindNoCase("cfm,xml,html,htm", listLast(dir.name, "."))>(<a href="code.cfm?sourcefile=#demo##dir.name#">code</a>)</cfif>
<cfelse>#lJustify(" directory", 33)# <a href="demo.cfm?demo=#demo##name#/">#name#/</a></cfif>
</cfoutput></pre>
</body>
</html>