Switched to lowercase "blogger" namespace

This commit is contained in:
Tobi Schäfer 2008-05-05 00:35:28 +00:00
parent 4a8b6ccb4f
commit 8d97041dae
3 changed files with 15 additions and 14 deletions

1
.gitattributes vendored
View file

@ -2,6 +2,7 @@
build/extra/helma.jar -text build/extra/helma.jar -text
build/extra/launcher.jar -text build/extra/launcher.jar -text
build/extra/mckoidb.jar -text build/extra/mckoidb.jar -text
code/Api/Api.blogger.js -text
code/Choice/$Choice.skin -text code/Choice/$Choice.skin -text
code/Poll/$Poll.skin -text code/Poll/$Poll.skin -text
code/TagHub/$TagHub.skin -text code/TagHub/$TagHub.skin -text

View file

@ -26,9 +26,9 @@
// see http://www.blogger.com/developers/api/1_docs/ for further details // see http://www.blogger.com/developers/api/1_docs/ for further details
// blogger.getTemplate and blogger.setTemplate are not supported // blogger.getTemplate and blogger.setTemplate are not supported
Api.Blogger = {}; Api.blogger = {};
Api.Blogger.util = { Api.blogger.util = {
getContentParts: function(content) { getContentParts: function(content) {
content && (content = content.trim()); content && (content = content.trim());
content || (content = ""); content || (content = "");
@ -48,7 +48,7 @@ Api.Blogger.util = {
} }
} }
Api.Blogger.getUserInfo = function(appKey, name, password) { Api.blogger.getUserInfo = function(appKey, name, password) {
var user = User.getByName(name); var user = User.getByName(name);
if (!user) { if (!user) {
throw Error("User " + name + " does not exist on this server"); throw Error("User " + name + " does not exist on this server");
@ -60,7 +60,7 @@ Api.Blogger.getUserInfo = function(appKey, name, password) {
} }
} }
Api.Blogger.getUsersBlogs = function(appKey, name, password) { Api.blogger.getUsersBlogs = function(appKey, name, password) {
var user = Api.getUser(name, password); var user = Api.getUser(name, password);
var result = []; var result = [];
user.forEach(function() { user.forEach(function() {
@ -80,7 +80,7 @@ Api.Blogger.getUsersBlogs = function(appKey, name, password) {
return result; return result;
} }
Api.Blogger.getRecentPosts = function(appKey, id, name, password, limit) { Api.blogger.getRecentPosts = function(appKey, id, name, password, limit) {
var user = Api.getUser(name, password); var user = Api.getUser(name, password);
var site = Api.getSite(id); var site = Api.getSite(id);
if (!site) { if (!site) {
@ -111,7 +111,7 @@ Api.Blogger.getRecentPosts = function(appKey, id, name, password, limit) {
return result; return result;
} }
Api.Blogger.getPost = function(appKey, id, name, password) { Api.blogger.getPost = function(appKey, id, name, password) {
var user = Api.getUser(name, password); var user = Api.getUser(name, password);
var story = Story.getById(id); var story = Story.getById(id);
if (!story) { if (!story) {
@ -136,7 +136,7 @@ Api.Blogger.getPost = function(appKey, id, name, password) {
} }
} }
Api.Blogger.newPost = function(appKey, id, name, password, content, publish) { Api.blogger.newPost = function(appKey, id, name, password, content, publish) {
var user = Api.getUser(name, password); var user = Api.getUser(name, password);
var site = Api.getSite(id); var site = Api.getSite(id);
if (!site) { if (!site) {
@ -152,7 +152,7 @@ Api.Blogger.newPost = function(appKey, id, name, password, content, publish) {
" to add a story to site " + site.name); " to add a story to site " + site.name);
} }
var parts = Api.Blogger.util.getContentParts(content); var parts = Api.blogger.util.getContentParts(content);
var story = new Story; var story = new Story;
story.site = site; story.site = site;
story.creator = user; story.creator = user;
@ -166,7 +166,7 @@ Api.Blogger.newPost = function(appKey, id, name, password, content, publish) {
return story._id; return story._id;
} }
Api.Blogger.editPost = function(appkey, id, name, password, content, publish) { Api.blogger.editPost = function(appkey, id, name, password, content, publish) {
var user = Api.getUser(name, password); var user = Api.getUser(name, password);
var story = Story.getById(id); var story = Story.getById(id);
if (!story) { if (!story) {
@ -182,7 +182,7 @@ Api.Blogger.editPost = function(appkey, id, name, password, content, publish) {
" to edit story #" + id); " to edit story #" + id);
} }
var parts = Api.Blogger.util.getContentParts(content); var parts = Api.blogger.util.getContentParts(content);
story.update({ story.update({
title: parts.title, title: parts.title,
text: parts.text, text: parts.text,
@ -193,7 +193,7 @@ Api.Blogger.editPost = function(appkey, id, name, password, content, publish) {
return true; return true;
} }
Api.Blogger.deletePost = function(appKey, id, name, password, publish) { Api.blogger.deletePost = function(appKey, id, name, password, publish) {
var user = Api.getUser(name, password); var user = Api.getUser(name, password);
var story = Story.getById(id); var story = Story.getById(id);
if (!story) { if (!story) {

View file

@ -50,10 +50,10 @@ Api.prototype.main_action = function() {
} }
Api.prototype.blogger_action_xmlrpc = function(method) { Api.prototype.blogger_action_xmlrpc = function(method) {
if (method && Api.Blogger[method]) { if (method && Api.blogger[method]) {
var args = Array.prototype.splice.call(arguments, 1); var args = Array.prototype.splice.call(arguments, 1);
return Api.Blogger[method].apply(null, args); return Api.blogger[method].apply(null, args);
} }
throw Error("Method " + method + "() is not implemented"); throw Error("Method blogger." + method + "() is not implemented");
return; return;
} }