summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <yuv.adm@gmail.com>2014-06-07 22:21:02 +0300
committerYuval Adam <yuv.adm@gmail.com>2014-06-07 22:21:02 +0300
commitf28d277126d971216a3c4cacc07fff4162721e80 (patch)
treeceaaa889bc31375ff7af51f49123d9963062da9a
parentfd770a171d1363b163843b0950cbb179d80753b2 (diff)
Small fix
-rw-r--r--templates/home.html9
1 files changed, 8 insertions, 1 deletions
diff --git a/templates/home.html b/templates/home.html
index 61a3beb..ae0a933 100644
--- a/templates/home.html
+++ b/templates/home.html
@@ -19,15 +19,22 @@
}
$(document).ready(function() {
+ $.get('/data', function(res) {
+ var data = res.data.split('\n===\n');
+ $('#sequences-area').val(data[0]);
+ $('#composition-area').val(data[1]);
+ })
+
$('#save-btn').click(function() {
$.ajax({
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({
- "data": $('#sequences-area').val() + '\n\n' + $('#composition-area').val()
+ "data": $('#sequences-area').val() + '\n===\n' + $('#composition-area').val()
}),
dataType: 'json',
url: '/data',
+ success: function() { alert('Saved'); }
});
});
});