summaryrefslogtreecommitdiffstats
path: root/weblog-listfiles-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-10-24 19:03:17 +0000
committerTed Trask <ttrask01@yahoo.com>2014-10-24 19:03:17 +0000
commit662cc57d8249ad1d2749a2b420a452822d07eba0 (patch)
tree3395d869a9215bd613275e7b976c8c699e4ead42 /weblog-listfiles-html.lsp
parent366316f1b246385cebb68d66d16af9fffdeabb8a (diff)
downloadacf-weblog-662cc57d8249ad1d2749a2b420a452822d07eba0.tar.bz2
acf-weblog-662cc57d8249ad1d2749a2b420a452822d07eba0.tar.xz
In listfiles HTML view, replace convertsize function with orig_size because throws an exception when file is missing
Diffstat (limited to 'weblog-listfiles-html.lsp')
-rw-r--r--weblog-listfiles-html.lsp16
1 files changed, 1 insertions, 15 deletions
diff --git a/weblog-listfiles-html.lsp b/weblog-listfiles-html.lsp
index 8cc522c..b55d972 100644
--- a/weblog-listfiles-html.lsp
+++ b/weblog-listfiles-html.lsp
@@ -3,20 +3,6 @@ htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
-<%
-function convertsize(size)
- if string.find(size, "k$") then
- return tonumber(string.match(size, "[%d.]*")) * 1024.0
- elseif string.find(size, "M$") then
- return tonumber(string.match(size, "[%d.]*")) * 1024.0 * 1024.0
- elseif string.find(size, "G$") then
- return tonumber(string.match(size, "[%d.]*")) + 1024.0 * 1024.0 * 1024.0
- else
- return tonumber(string.match(size, "[%d.]*"))
- end
-end
-%>
-
<script type="text/javascript">
if (typeof jQuery == 'undefined') {
document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>');
@@ -54,7 +40,7 @@ end
<tr>
<td><% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) %></td>
<td><%= html.html_escape(file.filename) %></td>
- <td><span class="hide"><%= convertsize(file.size) %>b</span><%= html.html_escape(file.size) %></td>
+ <td><span class="hide"><%= html.html_escape(file.orig_size) %>b</span><%= html.html_escape(file.size) %></td>
<td><%= html.html_escape(file.mtime) %></td>
</tr>
<% end %>