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
|
<% local form, viewlibrary, page_info = ...
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">
$(function(){
$('input, select').first().focus();
$('input, select').keydown(function(e){
if (e.keyCode == 13) {
$(this).parents('form').find('input.submit').click();
return false;
}
});
});
</script>
<% if form.value.values then %>
<H1>Device</H1>
<DL>
<% if form.errtxt then io.write("<P CLASS='error'>" .. string.gsub(html.html_escape(form.errtxt), "\n", "<BR>") .. "</P>\n") end %>
<DT>Device ID</DT><DD><input class="text" type="text" value="<%= html.html_escape(form.value.result.value[1].device_id) %>" readonly="true"></DD>
<H2>Parameter Values</H2>
<%
require("session")
val = session.serialize("values", form.value.values.value)
val = string.gsub(val, "[^\n]*%{%}\n", "")
print("<pre>"..val.."</pre>")
form.value.values = nil
elseif form.value.result then
local func = haserl.loadfile(page_info.viewfile:gsub("searchdevices", "listdevices"))
func(form.value.result, viewlibrary, page_info, session)
%>
</DL>
<% end %>
<H1><%= html.html_escape(form.label) %></H1>
<%
form.value.result = nil
htmlviewfunctions.displayform(form, nil, nil, page_info, 2)
%>
|