diff options
-rw-r--r-- | asterisk-listfiles-html.lsp | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/asterisk-listfiles-html.lsp b/asterisk-listfiles-html.lsp index d63398c..be70876 100644 --- a/asterisk-listfiles-html.lsp +++ b/asterisk-listfiles-html.lsp @@ -3,6 +3,25 @@ htmlviewfunctions = require("htmlviewfunctions") html = require("acf.html") %> +<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>'); + } +</script> + +<script type="text/javascript"> + if (typeof $.tablesorter == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + $(document).ready(function() { + $("#list").tablesorter({widgets: ['zebra']}); + }); +</script> + + <% htmlviewfunctions.displaycommandresults({"edit"}, session) %> <% if viewlibrary and viewlibrary.dispatch_component then @@ -10,16 +29,16 @@ html = require("acf.html") end %> <h1>Configuration</h1> -<DL><TABLE> - <TR style="background:#eee;font-weight:bold;"> - <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">File</TD> - <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Size</TD> - <TD style="white-space:nowrap;text-align:left;" class="header">Last Modified</TD> - </TR> - +<table id="list" class="tablesorter"><thead> + <tr> + <th>File</th> + <th>Size</th> + <th>Last Modified</th> + </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) .. "/edit?filename=" .. html.html_escape(v.filename) .. "&redir=" .. html.html_escape(page_info.orig_action) .. "\">" .. html.html_escape(v.filename) .. "</a></td><td>" .. html.html_escape(v.size) .."</td><td>" .. html.html_escape(v.mtime) .."</td></tr>\n" ) end %> -</TABLE></DL> +</tbody></table> |