From ec47c6b1756423f7ecb9a203cd0005dc48e858d4 Mon Sep 17 00:00:00 2001 From: Lukas Metzger Date: Mon, 28 Mar 2016 16:48:35 +0200 Subject: [PATCH] Adding default values for ttl and prio, closes #4 --- edit-master.php | 4 ++-- js/edit-master.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/edit-master.php b/edit-master.php index deab40a..93778a8 100644 --- a/edit-master.php +++ b/edit-master.php @@ -158,8 +158,8 @@ limitations under the License. - - + + diff --git a/js/edit-master.js b/js/edit-master.js index 61f77d7..318a689 100644 --- a/js/edit-master.js +++ b/js/edit-master.js @@ -331,11 +331,17 @@ function addRecord() { return; } + var prio = $('#addPrio').val(); + if(prio.length === 0) prio = 0; + + var ttl = $('#addTtl').val(); + if(ttl.length === 0) ttl = 86400; + var data = { type: $('#addType').val(), content: $('#addContent').val(), - prio: $('#addPrio').val(), - ttl: $('#addTtl').val(), + prio: prio, + ttl: ttl, action: "addRecord", domain: location.hash.substring(1), csrfToken: $('#csrfToken').text()