From 15d1aabd32f71166a02642d5c61821fc48636127 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 18 Mar 2010 14:28:10 +0000 Subject: Add octal escape code handling to all fields except comment. --- tinydns-edit-html.lsp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tinydns-edit-html.lsp b/tinydns-edit-html.lsp index 55fe7aa..cbde5b4 100644 --- a/tinydns-edit-html.lsp +++ b/tinydns-edit-html.lsp @@ -45,16 +45,17 @@ } function finishForm(entry){ var entrytext = entry.find("select").val() + entry.find("input:not(.submit)").map(function(){ + var val = $(this).val().replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + if (this.name != "dontconvertme") { + val = val.replace(/[\\:\r\n ]/g, char_to_octal); + } if (this.name == "fixme") { - if ($(this).val() != "") - return $(this).val().replace(/^\s\s*/, '').replace(/\s\s*$/, '') + ".<%= html.html_escape(domain) %>"; + if (val != "") + val = val + ".<%= html.html_escape(domain) %>"; else - return "<%= html.html_escape(domain) %>"; - } else if (this.name == "convertme") { - return $(this).val().replace(/^\s\s*/, '').replace(/\s\s*$/, '').replace(/[\\:\r\n ]/g, char_to_octal); - } else { - return $(this).val().replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + val = "<%= html.html_escape(domain) %>"; } + return val }).get().join(":"); entry.empty().append(entrytext); } @@ -84,11 +85,11 @@ for (i=0; i' + entryType.descriptions[i] + '
$/i, "") + '" name="fixme"> . <%= html.html_escape(domain) %>
'; - else if (entryType.descriptions[i] == "Regular expression") - form = form + '
' + entryType.descriptions[i] + '
'; + form = form + '
' + entryType.descriptions[i] + '
$/i, "") + '" name="fixme"> . <%= html.html_escape(domain) %>
'; + else if (entryType.descriptions[i] == "Comment") + form = form + '
' + entryType.descriptions[i] + '
'; else - form = form + '
' + entryType.descriptions[i] + '
'; + form = form + '
' + entryType.descriptions[i] + '
'; } form = form + "\n"; entry.empty().append(form); -- cgit v1.2.3