summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--freeswitch-listfiles-html.lsp16
1 files changed, 15 insertions, 1 deletions
diff --git a/freeswitch-listfiles-html.lsp b/freeswitch-listfiles-html.lsp
index 5b38091..02fc1e2 100644
--- a/freeswitch-listfiles-html.lsp
+++ b/freeswitch-listfiles-html.lsp
@@ -3,6 +3,20 @@ 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>');
@@ -48,7 +62,7 @@ end %>
<% end %>
</td>
<td><%= html.html_escape(v.filename) %></td>
- <td><%= html.html_escape(v.size) %></td>
+ <td><span style="display:none"><%= convertsize(v.size) %>b</span><%= html.html_escape(v.size) %></td>
<td><%= html.html_escape(v.mtime) %></td>
</tr>
<% end %>