|
|
@ -76,6 +76,8 @@ $(function() { |
|
|
|
|
|
|
|
$.post('/editor/publish', { |
|
|
|
name: $("#post-name").val(), |
|
|
|
description: $("#post-description").val(), |
|
|
|
image: $("#post-image").val(), |
|
|
|
body: editor.serialize().content.value, |
|
|
|
category: category, |
|
|
|
slug: $("#post-slug").val(), |
|
|
@ -139,6 +141,8 @@ $(function() { |
|
|
|
|
|
|
|
function reset_page() { |
|
|
|
$("#post-name").val(''); |
|
|
|
$("#post-description").val(''); |
|
|
|
$("#postimage").val(''); |
|
|
|
$("#post-slug").val(''); |
|
|
|
$("#post-tags").tokenfield('setTokens',[]); |
|
|
|
$("#post-status").val('published'); |
|
|
@ -161,6 +165,8 @@ function doAutoSave() { |
|
|
|
autosaveTimeout = false; |
|
|
|
var savedData = { |
|
|
|
title: $("#post-name").val(), |
|
|
|
description: $("#post-description").val(), |
|
|
|
image: $("#post-image").val(), |
|
|
|
body: editor.serialize().content.value, |
|
|
|
tags: $("#post-tags").tokenfield('getTokensList'), |
|
|
|
slug: $("#post-slug").val(), |
|
|
@ -189,6 +195,8 @@ $(function(){ |
|
|
|
$("#post-slug").val(val.slug); |
|
|
|
$("#post-status").val(val.status); |
|
|
|
$("#post-publish-date").val(val.publish); |
|
|
|
$("#post-description").val(val.description); |
|
|
|
$("#post-image").val(val.image); |
|
|
|
// drop the cursor into the editor which clears the placeholder text
|
|
|
|
$("#content").focus().click(); |
|
|
|
activateTokenField(); |
|
|
@ -210,5 +218,5 @@ editor.on(document.getElementById('content'), 'input', function(){ |
|
|
|
contentChanged(); |
|
|
|
}); |
|
|
|
$(function(){ |
|
|
|
$('#post-name, #post-tags, #post-slug, #post-publish-date').on('keyup', contentChanged); |
|
|
|
$('#post-name, #post-description, #post-image, #post-tags, #post-slug, #post-publish-date').on('keyup', contentChanged); |
|
|
|
}); |