From 65377b396fcbb31a00adde2a4ebb8c9855096c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 28 Nov 2016 11:29:17 +0100 Subject: [PATCH] Added note that jquery and lodash are dependencies of the js client lib --- docs/jsclientlib/index.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/jsclientlib/index.rst b/docs/jsclientlib/index.rst index 640c2be7..103e09ff 100644 --- a/docs/jsclientlib/index.rst +++ b/docs/jsclientlib/index.rst @@ -5,7 +5,8 @@ JavaScript Client Library ######################### The JS Client Library provides an interface to all of OctoPrint's API, including the SockJS based socket to send -push messages from the server to connected clients. It is available as packed web asset file at ``/static/webassets/packed_client.js`` or as individual +push messages from the server to connected clients. It is available as packed web +asset file at ``/static/webassets/packed_client.js`` or as individual component files at ``/static/js/app/client/.js`` relative to your OctoPrint instance's base URL (e.g. ``http://octopi.local/static/webassets/packed_client.js``). @@ -27,10 +28,18 @@ correct URL prefix: +Regardless of which way you use to include the library, you'll also need to make sure you included JQuery and lodash, +because the library depends on those to be available (as ``$`` and ``_``). You can embed those like this: + +.. code-block:: html + + + + Note that all components depend on the ``base`` component to be present, so if you are only including a select number of components, make sure to at the very least include that one to be able to utilize the client.