diff --git a/public/editor-files/editor.js b/public/editor-files/editor.js index 04add5c..016fa43 100644 --- a/public/editor-files/editor.js +++ b/public/editor-files/editor.js @@ -73,12 +73,11 @@ $(function() { $('#publish-fields').addClass('hidden'); var category = $("#post-tags").tokenfield("getTokens").map(function(t){ return t.value}); - var image = $("#post-image").tokenfield("getTokens").map(function(t){ return t.value}); - + $.post('/editor/publish', { name: $("#post-name").val(), description: $("#post-description").val(), - image: image, + image: $("#post-image").val(), body: editor.serialize().content.value, category: category, slug: $("#post-slug").val(), @@ -143,7 +142,7 @@ $(function() { function reset_page() { $("#post-name").val(''); $("#post-description").val(''); - $("#post-image").tokenfield('setTokens',[]); + $("#post-image").val(''); $("#post-slug").val(''); $("#post-tags").tokenfield('setTokens',[]); $("#post-status").val('published'); @@ -167,7 +166,7 @@ function doAutoSave() { var savedData = { title: $("#post-name").val(), description: $("#post-description").val(), - image: $("#post-image").tokenfield('getTokensList'), + image: $("#post-image").val(), body: editor.serialize().content.value, tags: $("#post-tags").tokenfield('getTokensList'), slug: $("#post-slug").val(),