diff options
-rw-r--r-- | weblog-listfiles-html.lsp | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/weblog-listfiles-html.lsp b/weblog-listfiles-html.lsp index fcca5b3..cb64723 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 - elseif string.find(string.match(size, "%d*"), "M$") then - return tonumber(size) * 1024 * 1024 - elseif string.find(size, "G$") then - return tonumber(string.match(size, "%d*")) + 1024 * 1024 * 1024 - else - return tonumber(size) - 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>'); @@ -47,7 +33,7 @@ end </TR> </THEAD><TBODY> <% for k,v in ipairs( view.value ) do - io.write( "<tr><td><a href=\"" .. html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) .. "/editfile?filename=" .. html.html_escape(v.filename) .. "&redir=" .. html.html_escape(page_info.orig_action) .. "\">" .. html.html_escape(v.filename) .. '</a></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>\n" ) + io.write( "<tr><td><a href=\"" .. html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) .. "/editfile?filename=" .. html.html_escape(v.filename) .. "&redir=" .. html.html_escape(page_info.orig_action) .. "\">" .. html.html_escape(v.filename) .. '</a></td><td><span style="display:none">'..html.html_escape(v.orig_size).."b</span>" .. html.html_escape(v.size) .."</td><td>" .. html.html_escape(v.mtime) .."</td></tr>\n" ) end %> </TBODY></TABLE> </DL> |