diff --git a/couchpotato/__init__.py b/couchpotato/__init__.py index f7dfb3a5..799a2984 100644 --- a/couchpotato/__init__.py +++ b/couchpotato/__init__.py @@ -49,7 +49,7 @@ def apiDocs(): if api_docs.get(''): del api_docs[''] del api_docs_missing[''] - return render_template('api.html', routes = sorted(routes), api_docs = api_docs, api_docs_missing = sorted(api_docs_missing)) + return render_template('api.html', fireEvent = fireEvent, routes = sorted(routes), api_docs = api_docs, api_docs_missing = sorted(api_docs_missing)) @app.errorhandler(404) def page_not_found(error): diff --git a/couchpotato/core/helpers/request.py b/couchpotato/core/helpers/request.py index 09ee6b8f..a9dff599 100644 --- a/couchpotato/core/helpers/request.py +++ b/couchpotato/core/helpers/request.py @@ -70,7 +70,7 @@ def jsonify(mimetype, *args, **kwargs): def jsonified(*args, **kwargs): from couchpotato.environment import Env - callback = getParam('json_callback', None) + callback = getParam('callback_func', None) if callback: return padded_jsonify(callback, *args, **kwargs) else: diff --git a/couchpotato/static/scripts/api.js b/couchpotato/static/scripts/api.js index f39ec6f2..f14eb14d 100644 --- a/couchpotato/static/scripts/api.js +++ b/couchpotato/static/scripts/api.js @@ -11,7 +11,7 @@ var ApiClass = new Class({ var r_type = self.options.is_remote ? 'JSONP' : 'JSON'; return new Request[r_type](Object.merge({ - 'callbackKey': 'json_callback', + 'callbackKey': 'callback_func', 'method': 'get', 'url': self.createUrl(type), }, options)).send() diff --git a/couchpotato/templates/api.html b/couchpotato/templates/api.html index 47fb6c34..ec067f95 100644 --- a/couchpotato/templates/api.html +++ b/couchpotato/templates/api.html @@ -7,6 +7,19 @@
{{ fireEvent('app.api_url', single = True)|safe }}/
+ To see it in action, have a look at the webinterface with Firebug (on firefox) or the development tools included in Chrome.
+ All the data that you see there are from the API.
+ {{ fireEvent('app.api_url', single = True)|safe }}/updater.info/+
{{ fireEvent('app.api_url', single = True)|safe }}/updater.info/?callback_func=myfunction+