diff options
Diffstat (limited to 'tinydns-edit-html.lsp')
-rw-r--r-- | tinydns-edit-html.lsp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tinydns-edit-html.lsp b/tinydns-edit-html.lsp index 3ea17a7..ae3df65 100644 --- a/tinydns-edit-html.lsp +++ b/tinydns-edit-html.lsp @@ -29,7 +29,7 @@ } var entryTypes = new Array(14); - entryTypes[0]=new Entry("","Comment line",1,"Comment"); + 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"); entryTypes[3]=new Entry("=","Host",5,"Host","IP address","Time to live","Timestamp","Location"); @@ -71,6 +71,10 @@ notindomain = true; return val }).get().join(":"); + // Clean up blank comments + if ("#" == entrytext) { + entrytext = ""; + } if (addresspresent && notindomain) { if (force) entry.empty().append(entrytext); @@ -82,7 +86,7 @@ } function createForm(entry){ var entrytext = entry.text(); - var entryType = entryTypes[0]; + var entryType = null; var form = '<select>'; var typechar = entrytext.charAt(0); if (typechar === null) { typechar = ""; } @@ -96,7 +100,9 @@ } form = form + "</select><br><dl>"; var entries; - if (entryType.entryType == ""){ + if (null == entryType){ + // Invalid type, use Comment type + entryType = entryTypes[0]; entries = new Array(1); entries[0] = entrytext; } else { |