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