diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-11-10 18:02:36 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-11-10 18:02:36 +0000 |
commit | 9e62c361c0fd51809a6fefdf5772768147b310a7 (patch) | |
tree | 78a6394a7c81ce5babcf66f431f1c448436d0620 /tinydns-edit-html.lsp | |
parent | c2e72718bc52cccb6377bfc44db425e7dc9b8b41 (diff) | |
download | acf-tinydns-9e62c361c0fd51809a6fefdf5772768147b310a7.tar.bz2 acf-tinydns-9e62c361c0fd51809a6fefdf5772768147b310a7.tar.xz |
Added support for SRV and NAPTR records, some UI cleanup.
Diffstat (limited to 'tinydns-edit-html.lsp')
-rw-r--r-- | tinydns-edit-html.lsp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/tinydns-edit-html.lsp b/tinydns-edit-html.lsp index 785589a..4361b8f 100644 --- a/tinydns-edit-html.lsp +++ b/tinydns-edit-html.lsp @@ -9,6 +9,9 @@ <a href="javascript:;"><img src="/skins/static/tango/16x16/actions/list-remove.png" width="16" height="16" title="Remove record"></a> \ <a href="javascript:;"><img src="/skins/static/tango/16x16/actions/document-properties.png" width="16" height="16" title="Edit record"></a> \ </td>'; + var addEntry = '<tr><td> \ + <a href="javascript:;"><img src="/skins/static/tango/16x16/actions/list-add.png" width="16" height="16" title="Insert record"></a> \ + </td></tr>'; function Entry(entryType,descr,num,descr0,descr1,descr2,descr3,descr4,descr5,descr6,descr7,descr8,descr9,descr10){ this.entryType=entryType; @@ -17,7 +20,7 @@ this.descriptions[0]=descr0;this.descriptions[1]=descr1;this.descriptions[2]=descr2;this.descriptions[3]=descr3;this.descriptions[4]=descr4;this.descriptions[5]=descr5;this.descriptions[6]=descr6;this.descriptions[7]=descr7;this.descriptions[8]=descr8;this.descriptions[9]=descr9;this.descriptions[10]=descr10; } - var entryTypes = new Array(12); + var entryTypes = new Array(14); entryTypes[0]=new Entry("","Comment line",1,"Comment"); entryTypes[1]=new Entry(".","Name server",6,"Domain","IP address","Name server","Time to live","Timestamp","Location"); entryTypes[2]=new Entry("&","Delegate subdomain",6,"Domain","IP address","Name server","Time to live","Timestamp","Location"); @@ -30,6 +33,8 @@ entryTypes[9]=new Entry("Z","SOA record",11,"Domain","Primary name server","Contact address","Serial number","Refresh time","Retry time","Expire time","Minimum time","Time to live","Timestamp","Location"); entryTypes[10]=new Entry(":","Generic record",6,"Domain","Record type","Record data","Time to live","Timestamp","Location"); entryTypes[11]=new Entry("%","Client location",2,"Location","IP prefix"); + entryTypes[12]=new Entry("S","Service location",8,"Domain", "IP address", "X", "Port", "Weight", "Priority", "Time to live", "Timestamp"); + entryTypes[13]=new Entry("N","Naming authority pointer",9,"Domain", "Order", "Preference", "Flags", "Service", "Regular expression", "Replacement", "Time to live", "Timestamp"); function finishForm(entry){ var entrytext = entry.find("select").val() + entry.find("input:not(.submit)").map(function(){ @@ -50,7 +55,7 @@ var form = '<select>'; var typechar = entrytext.charAt(0); if (typechar === null) { typechar = ""; } - for (i=0; i<12; i++) { + for (i=0; i<14; i++) { form = form + '<option '; if (typechar == entryTypes[i].entryType){ entryType=entryTypes[i]; @@ -74,7 +79,6 @@ else form = form + '<dt>' + entryType.descriptions[i] + '</dt><dd><input type="text" value="' + entries[i] + '"></dd>'; } - form = form + '\n<DT></DT><DD><input class="submit" type="submit" value="<%= html.html_escape(form.option) %>"></DD>'; form = form + "\n</dl>"; entry.empty().append(form); entry.find("select").change(function(){ @@ -128,6 +132,7 @@ $(function(){ addLinks($("#entries").find("tr")); + $("#entries").append(addEntry).find("a").click(addLine); $("input.submit").click(submitFile); <% if form.value.filecontent.linenumber then %> $("#entries tr:eq(<%= form.value.filecontent.linenumber - 1 %>)").find("a:eq(2)").click(); @@ -137,14 +142,6 @@ }); </script> -<% ---[[ DEBUG INFORMATION -io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>") -io.write(html.cfe_unpack(form)) -io.write("</span>") ---]] -%> - <H1>Configuration</H1> <H2>Expert Configuration</H2> <H3>File Details</H3> @@ -160,7 +157,7 @@ displayitem(form.value.mtime) <% if form.descr then %><P CLASS='descr'><%= string.gsub(html.html_escape(form.descr), "\n", "<BR>") %></P><% end %> <% if form.errtxt then %><P CLASS='error'><%= string.gsub(html.html_escape(form.errtxt), "\n", "<BR>") %></P><% end %> <TABLE id="entries"> -<% for line in string.gmatch(html.html_escape(form.value.filecontent.value).."\n", "([^\n]*)\n") do %> +<% for line in string.gmatch(html.html_escape(form.value.filecontent.value), "([^\n]*)\n?") do %> <TR> <TD><%= line %></TD> </TR> |