diff --git a/docs/jsclientlib/base.rst b/docs/jsclientlib/base.rst index c92e412e..3e3fc7fc 100644 --- a/docs/jsclientlib/base.rst +++ b/docs/jsclientlib/base.rst @@ -81,7 +81,7 @@ :param string method: The HTTP method to use for the request (optional) :param string url: The URL to perform the request against (optional) :param object opts: Additional options to use for the request, see above for details (optional) - :returns Promise: A `jQuery Promise `_ for the request's response's response + :returns Promise: A `jQuery Promise `_ for the request's response .. js:function:: OctoPrint.ajaxWithData(method, url, data, opts) diff --git a/docs/jsclientlib/browser.rst b/docs/jsclientlib/browser.rst index 07708fb8..56140c44 100644 --- a/docs/jsclientlib/browser.rst +++ b/docs/jsclientlib/browser.rst @@ -9,11 +9,20 @@ ``password`` as credentials. If ``remember`` is set to ``true``, the session will also persist across browser restarts. + **Example:** + + .. code-block:: javascript + + OctoPrint.browser.login("myusername", "mypassword", true) + .done(function(response) { + // do something with the response + }); + :param string username: Username to log in with :param string password: Password to log in with :param bool remember: "Remember me" :param object opts: Additional request options - :returns Promise: A promise for the performed login request + :returns Promise: A `jQuery Promise `_ for the request's response .. js:function:: OctoPrint.browser.passiveLogin(opts) @@ -21,11 +30,11 @@ stored in the browser's cookies. :param object opts: Additional request options - :returns Promise: A promise for the performed login request + :returns Promise: A `jQuery Promise `_ for the request's response .. js:function:: OctoPrint.browser.logout(opts) Logs the browser out of OctoPrint. :param object opts: Additional request options - :returns Promise: A promise for the performed logout request + :returns Promise: A `jQuery Promise `_ for the request's response diff --git a/docs/jsclientlib/connection.rst b/docs/jsclientlib/connection.rst index a01233d5..a98950b3 100644 --- a/docs/jsclientlib/connection.rst +++ b/docs/jsclientlib/connection.rst @@ -5,8 +5,33 @@ .. js:function:: OctoPrint.connection.getSettings(opts) + Retrieves the available connection options for connection to a printer. + + See :ref:`Get connection settings ` for the response format. + .. js:function:: OctoPrint.connection.connect(data, opts) + Connects to the printer, optionally using the provided connection ``data`` as parameters. + + If ``data`` is provided it's expected to be an object specifying one or more of + + * ``port`` + * ``baudrate`` + * ``printerProfile`` + * ``save`` + * ``autoconnect`` + + See :ref:`Issue a connection command ` for more details. + .. js:function:: OctoPrint.connection.disconnect(opts) + Disconnects from the printer. + + See :ref:`Issue a connection command ` for more details. + .. js:function:: OctoPrint.connection.fakeAck(opts) + + Triggers a fake acknowledgement (``ok``) on the printer. + + See :ref:`Issue a connection command ` for more details. +