diff options
Diffstat (limited to 'tinydns-edit-html.lsp')
-rw-r--r-- | tinydns-edit-html.lsp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tinydns-edit-html.lsp b/tinydns-edit-html.lsp index a100c27..ddb4ae4 100644 --- a/tinydns-edit-html.lsp +++ b/tinydns-edit-html.lsp @@ -116,7 +116,9 @@ addLinks($("#entries").find("tr")); $("input.submit").click(submitFile); <% if form.value.filecontent.linenumber then %> - $("#entries tr:eq(<%= form.value.filecontent.linenumber - 1 %>)").find("a:eq(2)").click().parent().next().focus(); + $("#entries tr:eq(<%= form.value.filecontent.linenumber - 1 %>)").find("a:eq(2)").click(); + var top = $("#entries tr:eq(<%= form.value.filecontent.linenumber - 1 %>)").offset().top; + $("html,body").scrollTop(top); <% end %> }); </script> @@ -144,7 +146,7 @@ displayitem(form.value.mtime) <% if form.descr then %><P CLASS='descr'><%= string.gsub(form.descr, "\n", "<BR>") %></P><% end %> <% if form.errtxt then %><P CLASS='error'><%= string.gsub(form.errtxt, "\n", "<BR>") %></P><% end %> <TABLE id="entries"> -<% for line in string.gmatch(form.value.filecontent.value.."\n", "([^\n]*)\n") do %> +<% for line in string.gmatch(html.html_escape(form.value.filecontent.value).."\n", "([^\n]*)\n") do %> <TR> <TD><%= line %></TD> </TR> @@ -154,7 +156,7 @@ displayitem(form.value.mtime) <form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %>" method="POST"> <input type="hidden" name="filename" value="<%= form.value.filename.value %>"> -<input type="hidden" name="filecontent" value="<%= form.value.filecontent.value %>"> +<input type="hidden" name="filecontent" value="<%= html.html_escape(form.value.filecontent.value) %>"> <H2>Save and Apply Above Settings</H2> <DL><DT></DT><DD><input class="submit" type="submit" name="<%= form.option %>" value="<%= form.option %>"></DD></DL> </form> |