-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.cfm
More file actions
190 lines (166 loc) · 6.55 KB
/
index.cfm
File metadata and controls
190 lines (166 loc) · 6.55 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!---
*******************************************************************************
Coldthumbs
Copyright 2018 - Simian Enterprises Ltd.
www.simianenterprises.co.uk
*******************************************************************************
Author: Gary Stanton
Twitter: @SimianE
--->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<link rel="stylesheet" href="monokai.css">
<title>ColdThumbs v2</title>
<style type="text/css">
iframe {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
}
.threads {
overflow: hidden;
height: 800px;
}
.nav-item {
margin-right: 10px;
}
.nav-item svg {
margin-right: 5px;
}
a.navbar-brand {
margin-right: 15px;
margin-left: 10px;
padding-right: 25px;
border-right: 1px dotted rgba(255, 255, 255, 0.5);
}
</style>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script type="text/javascript">
function checkImage(imageSrc, imageSuccess, imageFail) {
var img = new Image();
img.onload = imageSuccess;
img.onerror = imageFail;
img.src = imageSrc;
}
$(document).ready(function() {
$('img.lazy').each(function(){
var thisImage = $(this);
var thisSrc = $(this).attr('data-src');
var imageSuccess = function(){$(thisImage).attr('src', thisSrc);}
var imageFail = function(){
$(thisImage).attr('src', 'demo/Placeholder.png');
setTimeout(function(){
checkImage(thisSrc, imageSuccess, imageFail);
}, 1000);
}
checkImage(thisSrc, imageSuccess, imageFail);
});
});
</script>
</head>
<body>
<cfoutput>
<main role="main">
<div class="jumbotron">
<div class="container">
<h1 class="display-3">ColdThumbs</h1>
<p>A ColdFusion component to dynamically resize and cache images.</p>
</div>
</div>
<div class="container">
<nav class="navbar navbar-expand-sm navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="">ColdThumbs</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="##mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mainNav">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#fileExists(getDirectoryFromPath( getCurrentTemplatePath() ) & 'docs/index.html') ? 'docs/' : 'generateDocs.cfm'#"><i class="fas fa-file-alt"></i> API Docs</a>
</li>
<li class="nav-item">
<a class="nav-link" href="tests/runner.cfm"><i class="fas fa-check"></i> Tests</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/GaryStanton/ColdThumbs"><i class="fas fa-code"></i> Source</a>
</li>
</ul>
</div>
</nav>
<div class="row">
<div class="images text-center col-md-6">
<div class="row">
<cfscript>
Local.images = directoryList(expandPath('./demo/assets/'));
for (Local.thisImage in Local.images) {
if (ArrayFindNoCase(Application.com.ColdThumbs.getAllowedExtensions(), ListLast(Local.thisImage, '.'))) {
Local.testImage = Application.com.coldThumbs.getThumbnail(
src = Local.thisImage
, width = 300
);
writeOutput('
<div class="col-6 control-group">
<img class="lazy img-fluid img-thumbnail" src="/demo/placeholder.png" data-src="#Local.testImage.getURL()#" alt="#Local.testImage.getFilename()#">
<br />
<code>#Local.testImage.getURL()#</code>
<hr />
</div>');
}
}
</cfscript>
</div>
</div>
<div class="threads col-md-5 offset-md-1">
<a href="actClearCache.cfm" class="float-right btn btn-info">Clear cached files</a>
<div>
<h3>ColdThumbs settings</h3>
<hr />
<table class="table table-sm table-dark table-sm">
<tbody>
<tr>
<th scope="row">Threading</th>
<td>#YesNoFormat(Application.com.coldThumbs.getUseThreading())#</td>
</tr>
<tr>
<th scope="row">Threading system</th>
<td>#IsInstanceOf(Application.com.coldThumbs.getExecutorService(), 'cfconcurrent.ExecutorService') ? 'CFConcurrent' : 'Native CF'#</td>
</tr>
<tr>
<th scope="row">Max threads</th>
<td>#Application.com.coldThumbs.getMaxThreads()#</td>
</tr>
<tr>
<th scope="row">Image resizing</th>
<td>#(len(Application.com.coldThumbs.getImageMagickLocation()) && fileExists(Application.com.coldThumbs.getImageMagickLocation())) ? 'ImageMagick' : 'Native'#</td>
</tr>
</tbody>
</table>
</div>
<div class="embed-responsive">
<hr />
<iframe class="embed-responsive-item" style="width: 100%; height: 800px; position: relative;" src="viewThreads.cfm" allowfullscreen></iframe>
</div>
</div>
</div>
</div>
</main>
<footer class="container">
<p>© Gary Stanton #DateFormat(Now(), 'yyyy')#</p>
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/solid.js" integrity="sha384-GJiigN/ef2B3HMj0haY+eMmG4EIIrhWgGJ2Rv0IaWnNdWdbWPr1sRLkGz7xfjOFw" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/fontawesome.js" integrity="sha384-2OfHGv4zQZxcNK+oL8TR9pA+ADXtUODqGpIRy1zOgioC4X3+2vbOAp5Qv7uHM4Z8" crossorigin="anonymous"></script>
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
</cfoutput>
</body>
</html>