Corrected 2 times post with Blogger provider

This commit is contained in:
benweet 2013-04-21 15:59:29 +01:00
parent 2ed97112da
commit eede86ccc5
2 changed files with 15 additions and 9 deletions

View File

@ -7,17 +7,22 @@ define(["jquery", "core", "google-helper"], function($, core, googleHelper) {
}; };
bloggerProvider.publish = function(publishAttributes, title, content, callback) { bloggerProvider.publish = function(publishAttributes, title, content, callback) {
googleHelper.uploadBlogger(publishAttributes.blogUrl, googleHelper.uploadBlogger(
publishAttributes.blogId, publishAttributes.postId, title, content, publishAttributes.blogUrl,
publishAttributes.blogId,
publishAttributes.postId,
title,
content,
function(error, blogId, postId) { function(error, blogId, postId) {
if(error) { if(error) {
callback(error); callback(error);
return; return;
}
publishAttributes.blogId = blogId;
publishAttributes.postId = postId;
callback();
} }
publishAttributes.blogId = blogId; );
publishAttributes.postId = postId;
callback();
});
}; };
bloggerProvider.newPublishAttributes = function(event) { bloggerProvider.newPublishAttributes = function(event) {

View File

@ -464,6 +464,7 @@ define(["jquery", "core", "async-runner"], function($, core, asyncRunner) {
function getBlogId() { function getBlogId() {
if(blogId !== undefined) { if(blogId !== undefined) {
task.chain(publish); task.chain(publish);
return;
} }
$.ajax({ $.ajax({
url : "https://www.googleapis.com/blogger/v3/blogs/byurl", url : "https://www.googleapis.com/blogger/v3/blogs/byurl",