Added Api.main_action_xmlrpc() method which could replace the three other XML-RPC methods
This commit is contained in:
parent
9011841b88
commit
8e8667e5f4
1 changed files with 13 additions and 4 deletions
|
@ -31,8 +31,8 @@ Api.constrain = function(site, user) {
|
||||||
Api.dispatch = function() {
|
Api.dispatch = function() {
|
||||||
var handler = Api[this];
|
var handler = Api[this];
|
||||||
var method = arguments[0];
|
var method = arguments[0];
|
||||||
if (!method.startsWith("_")) {
|
if (method && !method.startsWith("_")) {
|
||||||
if (handler && method && handler[method]) {
|
if (handler && handler[method]) {
|
||||||
var args = Array.prototype.splice.call(arguments, 1);
|
var args = Array.prototype.splice.call(arguments, 1);
|
||||||
return handler[method].apply(null, args);
|
return handler[method].apply(null, args);
|
||||||
}
|
}
|
||||||
|
@ -109,11 +109,20 @@ Api.prototype.callback_action = function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Api.prototype.blogger_action_xmlrpc = function(method) {
|
Api.prototype.main_action_xmlrpc = function(method) {
|
||||||
|
if (!method) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
var parts = method.split(".");
|
||||||
|
arguments[0] = parts[1];
|
||||||
|
return Api.dispatch.apply(parts[0], arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
Api.prototype.blogger_action_xmlrpc = function() {
|
||||||
return Api.dispatch.apply("blogger", arguments);
|
return Api.dispatch.apply("blogger", arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
Api.prototype.movableType_action_xmlrpc = function(method) {
|
Api.prototype.movableType_action_xmlrpc = function() {
|
||||||
return Api.dispatch.apply("movableType", arguments);
|
return Api.dispatch.apply("movableType", arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue