$(function() {
    $("#submit").on("click", function() {
        var speechName = $("#speechName").val();
        var topicPhrases = document.getElementById("topicPhrases").value;

        topicPhrases = topicPhrases.split("\n");
        var sections = [];
        // Trim trailing whitespace and format correctly for storage
        for (var i in topicPhrases) {
            var topic = {
                "seconds": 0,
                "topic": topicPhrases[i].trim()
            };
            sections.push(topic);
        }

        var speechData = {
            title: speechName,
            sections: sections
        };

        var jsonSpeech = JSON.stringify(speechData);
        console.log(jsonSpeech);

        $.ajax({
            type: "POST",
            url: "http://pspk.kesdev.com/speeches",
            data: JSON.stringify(speechData),
            contentType: "application/json",
            dataType: "json",
            success: function(data){
                console.log(data);
            },
            failure: function(err){
                console.log(err);
            }
        });
    });
});

@@ -172,16 +172,49 @@
 ).value;
+%0A        var defaultSeconds = 10;
 %0A%0A      
@@ -443,17 +443,30 @@
 conds%22: 
-0
+defaultSeconds
 ,%0A      

Default text seconds = 10