diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..15d917c4a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +--- + +language: python +python: + - "2.7" +install: + - pip install -r requirements.txt +script: + - nosetests \ No newline at end of file diff --git a/docs/api/connection.rst b/docs/api/connection.rst index 1caefe994..aab57fc44 100644 --- a/docs/api/connection.rst +++ b/docs/api/connection.rst @@ -16,17 +16,14 @@ Get connection settings Retrieve the current connection settings, including information regarding the available baudrates and serial ports and the current connection state. - **Example Request** + **Example** .. sourcecode:: http GET /api/connection HTTP/1.1 Host: example.com - Content-Type: application/json X-Api-Key: abcdef... - **Example Response** - .. sourcecode:: http HTTP/1.1 200 OK @@ -90,6 +87,10 @@ Issue a connection command "autoconnect": true } + .. sourcecode:: http + + HTTP/1.1 204 No Content + **Example Disconnect Request** .. sourcecode:: http @@ -103,6 +104,10 @@ Issue a connection command "command": "disconnect" } + .. sourcecode:: http + + HTTP/1.1 204 No Content + :json string command: The command to issue, either ``connect`` or ``disconnect`` :json string port: ``connect`` command: The port to connect to. If left out either the existing ``portPreference`` will be used, or if that is not available OctoPrint will attempt auto detection. Must be part diff --git a/docs/api/fileops.rst b/docs/api/fileops.rst index 51c75d75d..ce8ae2776 100644 --- a/docs/api/fileops.rst +++ b/docs/api/fileops.rst @@ -18,14 +18,13 @@ Retrieve all files Returns a :ref:`Retrieve response `. - **Example request**: + **Example**: .. sourcecode:: http GET /api/files HTTP/1.1 Host: example.com - - **Example response**: + X-Api-Key: abcdef... .. sourcecode:: http @@ -84,14 +83,13 @@ Retrieve files from specific location Returns a :ref:`Retrieve response `. - **Example request**: + **Example**: .. sourcecode:: http GET /api/files/local HTTP/1.1 Host: example.com - - **Example response**: + X-Api-Key: abcdef... .. sourcecode:: http @@ -150,7 +148,7 @@ Upload file Returns a :http:statuscode:`201` response with a ``Location`` header set to the management URL of the uploaded file and an :ref:`Upload Response ` as the body upon successful completion. - **Example request** + **Example** .. sourcecode:: http @@ -186,13 +184,11 @@ Upload file true ------WebKitFormBoundaryDeC2E3iWbTv1PwMC-- - **Example response** - .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json - Location: + Location: http://example.com/api/files/sdcard/whistle_.gcode { "files": { @@ -247,18 +243,17 @@ Retrieve a specific file's information On success, a :http:statuscode:`200` is returned, with a :ref:`file information item ` as the response body. - **Example Request** + **Example** .. sourcecode:: http GET /api/files/local/whistle_v2.gcode HTTP/1.1 Host: example.com - - **Example Response** + X-Api-Key: abcdef... .. sourcecode:: http - HTTP/1.1 200 Ok + HTTP/1.1 200 OK Content-Type: application/json { @@ -325,6 +320,10 @@ Issue a file command "print": true } + .. sourcecode:: http + + HTTP/1.1 204 No Content + :param target: The target location on which to delete the file, either ``local`` (for OctoPrint's ``uploads`` folder) or ``sdcard`` for the printer's SD card (if available) :param filename: The filename of the file for which to issue the command diff --git a/docs/api/general.rst b/docs/api/general.rst index 1741361aa..84f2d86ab 100644 --- a/docs/api/general.rst +++ b/docs/api/general.rst @@ -55,6 +55,11 @@ Please be advised that clients should use the header field variant if at all pos The API key options in the "Change password" dialog. Users can generate and revoke their custom API key here. +.. note:: + OctoPrint's web interface uses a custom API key that is freshly generated on every server start. This key is not + intended to be used by any other client and would not be very useful in any case, since it basically represents + a completely anonymous client. + .. _sec-api-general-contenttype: Content Type @@ -67,4 +72,4 @@ If not otherwise stated OctoPrint's API expects request bodies and issues respon Encoding ======== -OctoPrint uses UTF-8 as charset. \ No newline at end of file +OctoPrint uses UTF-8 as charset. diff --git a/docs/api/job.rst b/docs/api/job.rst index 4b34df65a..04c48b86a 100644 --- a/docs/api/job.rst +++ b/docs/api/job.rst @@ -46,6 +46,10 @@ Issue a job command "command": "start" } + .. sourcecode:: http + + HTTP/1.1 204 No Content + **Example Restart Request** .. sourcecode:: http @@ -59,6 +63,10 @@ Issue a job command "command": "restart" } + .. sourcecode:: http + + HTTP/1.1 204 No Content + **Example Pause Request** .. sourcecode:: http @@ -72,6 +80,10 @@ Issue a job command "command": "pause" } + .. sourcecode:: http + + HTTP/1.1 204 No Content + **Example Cancel Request** .. sourcecode:: http @@ -85,6 +97,10 @@ Issue a job command "command": "cancel" } + .. sourcecode:: http + + HTTP/1.1 204 No Content + :json string command: The command to issue, either ``start``, ``restart``, ``pause`` or ``cancel`` :statuscode 204: No error :statuscode 409: If the printer is not operational or the current print job state does not match the preconditions @@ -101,14 +117,13 @@ Retrieve information about the current job Returns a :http:statuscode:`200` with a :ref:`sec-api-job-datamodel-response` in the body. - **Example Request** + **Example** .. sourcecode:: http GET /api/job HTTP/1.1 Host: example.com - - **Example Response** + X-Api-Key: abcdef... .. sourcecode:: http diff --git a/docs/api/logs.rst b/docs/api/logs.rst index abdb9ceb1..b2759aadb 100644 --- a/docs/api/logs.rst +++ b/docs/api/logs.rst @@ -22,7 +22,7 @@ Retrieve a list of available log files Returns a :ref:`Logfile Retrieve response `. - **Example Request** + **Example** .. sourcecode:: http @@ -30,8 +30,6 @@ Retrieve a list of available log files Host: example.com X-Api-Key: abcdef... - **Example response**: - .. sourcecode:: http HTTP/1.1 200 OK diff --git a/docs/api/printer.rst b/docs/api/printer.rst index a39c51214..19eb9ec6f 100644 --- a/docs/api/printer.rst +++ b/docs/api/printer.rst @@ -16,15 +16,167 @@ Printer control is mostly achieved through the use of commands, issued to resour printer. OctoPrint currently knows the following components: Print head - Print head commands allow jogging and homing the print head in all three axes. See :ref:`sec-api-printer-printheadcommand`. -Heater - Heater commands allow setting the temperature and temperature offsets for the printer's hotend and bed. Currently - OctoPrint only supports one hotend heater (this will change in the future). See :ref:`sec-api-printer-heatercommand`. -Feeder - Feeder commands allow extrusion/extraction of filament. Currently OctoPrint only supports one feeder (this will - change in a future version). See :ref:`sec-api-printer-feedercommand`. + Print head commands allow jogging and homing the print head in all three axes. Querying the resource is currently + not supported. + See :ref:`sec-api-printer-printheadcommand`. +Tool + Tool commands allow setting the temperature and temperature offsets for the printer's hotends/tools. Querying the + corresponding resource returns temperature information including an optional history. + See :ref:`sec-api-printer-toolcommand`. +Bed + Bed commands allow setting the temperature and temperature offset for the printer's heated bed. Querying the + corresponding resource returns temperature information including an optional history. + See :ref:`sec-api-printer-bedcommand`. SD card - SD commands allow initialization, refresh and release of the printer's SD card (if available). See :ref:`sec-api-printer-sdcommand`. + SD commands allow initialization, refresh and release of the printer's SD card (if available). Querying the + corresponding resource returns the current SD card state. + See :ref:`sec-api-printer-sdcommand`. + +Besides that, OctoPrint also provides a :ref:`full state report of the printer `. + +.. _sec-api-printer-state: + +Retrieve the current printer state +================================== + +.. http:get:: /api/printer + + Retrieves the current state of the printer. Returned information includes: + + * temperature information (see also :ref:`Retrieve the current tool state ` and + :ref:`Retrieve the current bed state `) + * sd state (if available, see also :ref:`Retrieve the current SD state `) + * general printer state + + Temperature information can also be made to include the printer's temperature history by supplying the ``history`` + query parameter. The amount of data points to return here can be limited using the ``limit`` query parameter. + + Clients can specific a list of attributes to not return in the response (e.g. if they don't need it) via the + ``exclude`` query parameter. + + Returns a :http:statuscode:`200` with a :ref:`Full State Response ` in the + body upon success. + + **Example 1** + + Include temperature history data, but limit it to two entries. + + .. sourcecode:: http + + GET /api/printer?history=true&limit=2 HTTP/1.1 + Host: example.com + X-Api-Key: abcdef... + + .. sourcecode:: http + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "temperature": { + "tool0": { + "actual": 214.8821, + "target": 220.0, + "offset": 0 + }, + "tool1": { + "actual": 25.3, + "target": null, + "offset": 0 + }, + "bed": { + "actual": 50.221, + "target": 70.0, + "offset": 5 + }, + "history": [ + { + "time": 1395651928, + "tool0": { + "actual": 214.8821, + "target": 220.0 + }, + "tool1": { + "actual": 25.3, + "target": null + }, + "bed": { + "actual": 50.221, + "target": 70.0 + } + }, + { + "time": 1395651926, + "tool0": { + "actual": 212.32, + "target": 220.0 + }, + "tool1": { + "actual": 25.1, + "target": null + }, + "bed": { + "actual": 49.1123, + "target": 70.0 + } + } + ] + }, + "sd": { + "ready": true + }, + "state": { + "text": "Operational", + "flags": { + "operational": true, + "paused": false, + "printing": false, + "sdReady": true, + "error": false, + "ready": true, + "closedOrError": false + } + } + } + + **Example 2** + + Exclude temperature and sd data. + + .. sourcecode:: http + + GET /api/printer?exclude=temperature,sd HTTP/1.1 + Host: example.com + X-Api-Key: abcdef... + + .. sourcecode:: http + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "state": { + "text": "Operational", + "flags": { + "operational": true, + "paused": false, + "printing": false, + "sdReady": true, + "error": false, + "ready": true, + "closedOrError": false + } + } + } + + :query exclude: An optional comma-separated list of fields to exclude from the response (e.g. if not needed by + the client). Valid values to supply here are ``temperature``, ``sd`` and ``state``. + :query history: If set to ``true`` (or: ``yes``, ``y``, ``1``), history information will be included in the response + too. If no ``limit`` parameter is given, all available temperature history data will be returned. + :query limit: If set to an integer (``n``), only the last ``n`` data points from the printer's temperature history + will be returned. Will be ignored if ``history`` is not enabled. + :statuscode 200: No error + :statuscode 409: If the printer is not operational. .. _sec-api-printer-printheadcommand: @@ -70,6 +222,10 @@ Issue a print head command "z": 0.02 } + .. sourcecode:: http + + HTTP/1.1 204 No Content + **Example Home Request** Home the X and Y axes. @@ -86,6 +242,10 @@ Issue a print head command "axes": ["x", "y"] } + .. sourcecode:: http + + HTTP/1.1 204 No Content + :json string command: The command to issue, either ``jog`` or ``home``. :json number x: ``jog`` command: The amount to travel on the X axis in mm. :json number y: ``jog`` command: The amount to travel on the Y axis in mm. @@ -96,67 +256,74 @@ Issue a print head command request. :statuscode 409: If the printer is not operational or currently printing. -.. _sec-api-printer-heatercommand: +.. _sec-api-printer-toolcommand: -Issue a heater command -====================== +Issue a tool command +==================== -.. todo:: +.. http:post:: /api/printer/tool - Update to current implementation! + Tool commands allow setting the temperature and temperature offsets for the printer's tools (hotends), selecting + the current tool and extruding/retracting from the currently selected tool. Available commands are: -.. http:post:: /api/printer/heater + target + Sets the given target temperature on the printer's tools. Additional parameters: - Heater commands allow setting the temperature and temperature offsets for the printer's hotend and bed. Available - commands are: - - temp - Sets the given target temperature on the printer's hotend and/or bed. Additional parameters: - - * ``targets``: Target temperature(s) to set, allowed properties are: - - * ``hotend``: New target temperature of the printer's hotend in centigrade. - * ``bed``: New target temperature of the printer's bed in centigrade. + * ``targets``: Target temperature(s) to set, properties must match the format ``tool{n}`` with ``n`` being the + tool's index starting with 0. offset - Sets the given temperature offset on the printer's hotend and/or bed. Additional parameters: + Sets the given temperature offset on the printer's tools. Additional parameters: - * ``offsets``: Offset(s) to set, allowed properties are: + * ``offsets``: Offset(s) to set, properties must match the format ``tool{n}`` with ``n`` being the tool's index + starting with 0. - * ``hotend``: New offset of the printer's hotend temperature in centigrade, max/min of +/-50°C. - * ``bed``: New offset of the printer's bed temperature in centigrade, max/min of +/-50°C. + select + Selects the printer's current tool. Additional parameters: - All of these commands may only be sent if the printer is currently operational and not printing. Otherwise a - :http:statuscode:`409` is returned. + * ``tool``: Tool to select, format ``tool{n}`` with ``n`` being the tool's index starting with 0. + + extrude + Extrudes the given amount of filament from the currently selected tool. Additional parameters: + + * ``amount``: The amount of filament to extrude in mm. May be negative to retract. + + + All of these commands may only be sent if the printer is currently operational and -- in case of ``select`` and + ``extrude`` -- not printing. Otherwise a :http:statuscode:`409` is returned. Upon success, a status code of :http:statuscode:`204` and an empty body is returned. **Example Target Temperature Request** - Set the printer's hotend target temperature to 220°C and the bed target temperature to 75°C. + Set the target temperature for the printer's first hotend to 220°C and the printer's second extruder to 205°C. .. sourcecode:: http - POST /api/printer/heater HTTP/1.1 + POST /api/printer/tool HTTP/1.1 Host: example.com Content-Type: application/json X-Api-Key: abcdef... { - "command": "temp", - "temps": { - "hotend": 220, - "bed": 75 + "command": "target", + "targets": { + "tool0": 220, + "tool1": 205 } } + .. sourcecode:: http + + HTTP/1.1 204 No Content + **Example Offset Temperature Request** - Set the offset for hotend temperatures to +10°C and for bed temperatures to -5°C. + Set the offset for temperatures on ``tool0`` to +10°C and on ``tool1`` to -5°C. .. sourcecode:: http - POST /api/printer/heater HTTP/1.1 + POST /api/printer/tool HTTP/1.1 Host: example.com Content-Type: application/json X-Api-Key: abcdef... @@ -164,62 +331,62 @@ Issue a heater command { "command": "offset", "offsets": { - "hotend": 10, - "bed": -5 + "tool0": 10, + "tool1": -5 } } - :json string command: The command to issue, either ``temp`` or ``offset`` - :json object temps: ``temp`` command: The target temperatures to set. Valid properties are ``hotend`` and ``bed`` - :json object offsets: ``offset`` command: The offset temperature to set. Valid properties are ``hotend`` and ``bed`` - :statuscode 204: No error - :statuscode 400: If ``temps`` or ``offsets`` contains a property other than ``hotend`` or ``bed``, the - target or offset temperature is not a valid number or outside of the supported range, or if the - request is otherwise invalid. - :statuscode 409: If the printer is not operational. + .. sourcecode:: http -.. _sec-api-printer-feedercommand: + HTTP/1.1 204 No Content -Issue a feeder command -====================== + **Example Tool Select Request** -.. http:post:: /api/printer/feeder - - Feeder commands allow extrusion/extraction of filament. Available commands are: - - extrude - Extrudes the given amount of filament. Additional parameters: - - * ``amount``: The amount of filament to extrude in mm. May be negative to retract. - - All of these commands may only be sent if the printer is currently operational and not printing. Otherwise a - :http:statuscode:`409` is returned. - - Upon success, a status code of :http:statuscode:`204` and an empty body is returned. - - **Example Extrude Request** - - Extrudes 1mm of filament + Select the second hotend of the printer for any following ``extrude`` commands. .. sourcecode:: http - POST /api/printer/feeder HTTP/1.1 + POST /api/printer/tool HTTP/1.1 + Host: example.com + Content-Type: application/json + X-Api-Key: abcdef... + + { + "command": "select", + "tool": "tool1" + } + + .. sourcecode:: http + + HTTP/1.1 204 No Content + + **Example Extrude Request** + + Extrude 5mm on the currently selected tool. + + .. sourcecode:: http + + POST /api/printer/tool HTTP/1.1 Host: example.com Content-Type: application/json X-Api-Key: abcdef... { "command": "extrude", - "amount": 1 + "amount": 5 } - **Example Retract Request** - - Retracts 3mm of filament - .. sourcecode:: http - POST /api/printer/feeder HTTP/1.1 + HTTP/1.1 204 No Content + + **Example Retract Request** + + Retract 3mm of filament on the currently selected tool. + + .. sourcecode:: http + + POST /api/printer/tool HTTP/1.1 Host: example.com Content-Type: application/json X-Api-Key: abcdef... @@ -229,16 +396,240 @@ Issue a feeder command "amount": -3 } - :json string command: The command to issue, only ``extrude`` is supported right now. - :json number amount: ``extrude`` command: The amount of filament to extrude/retract in mm. + .. sourcecode:: http + + HTTP/1.1 204 No Content + + :json string command: The command to issue, either ``target``, ``offset``, ``select`` or ``extrude``. + :json object targets: ``target`` command: The target temperatures to set. Valid properties have to match the format ``tool{n}``. + :json object offsets: ``offset`` command: The offset temperature to set. Valid properties have to match the format ``tool{n}``. + :json object tool: ``select`` command: The tool to select, value has to match the format ``tool{n}``. + :json object amount: ``extrude`` command: The amount of filament to extrude from the currently selected tool. :statuscode 204: No error - :statuscode 400: If the value given for `amount` is not a valid number or the request is otherwise invalid. - :statuscode 409: If the printer is not operational or currently printing. + :statuscode 400: If ``targets`` or ``offsets`` contains a property or ``tool`` contains a value not matching the format + ``tool{n}``, the target/offset temperature or extrusion amount is not a valid number or outside of + the supported range, or if the request is otherwise invalid. + :statuscode 409: If the printer is not operational or -- in case of ``select`` or ``extrude`` -- currently printing. + +.. _sec-api-printer-toolstate: + +Retrieve the current tool state +=============================== + +.. http:get:: /api/printer/tool + + Retrieves the current temperature data (actual, target and offset) plus optionally a (limited) history (actual, target, + timestamp) for all of the printer's available tools. + + It's also possible to retrieve the temperature history by supplying the ``history`` query parameter set to ``true``. The + amount of returned history data points can be limited using the ``limit`` query parameter. + + Returns a :http:statuscode:`200` with a Temperature Response in the body upon success. + + .. note:: + If you want both tool and bed temperature information at the same time, take a look at + :ref:`Retrieve the current printer state `. + + **Example** + + Query the tool temperature data and also include the temperature history but limit it to two entries. + + .. sourcecode:: http + + GET /api/printer/tool?history=true&limit=2 HTTP/1.1 + Host: example.com + X-Api-Key: abcdef... + + .. sourcecode:: http + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "tool0": { + "actual": 214.8821, + "target": 220.0, + "offset": 0 + }, + "tool1": { + "actual": 25.3, + "target": null, + "offset": 0 + }, + "history": [ + { + "time": 1395651928, + "tool0": { + "actual": 214.8821, + "target": 220.0 + }, + "tool1": { + "actual": 25.3, + "target": null + } + }, + { + "time": 1395651926, + "tool0": { + "actual": 212.32, + "target": 220.0 + }, + "tool1": { + "actual": 25.1 + } + } + ] + } + + :query history: If set to ``true`` (or: ``yes``, ``y``, ``1``), history information will be included in the response + too. If no ``limit`` parameter is given, all available temperature history data will be returned. + :query limit: If set to an integer (``n``), only the last ``n`` data points from the printer's temperature history + will be returned. Will be ignored if ``history`` is not enabled. + :statuscode 200: No error + :statuscode 409: If the printer is not operational. + +.. _sec-api-printer-bedcommand: + +Issue a bed command +=================== + +.. http:post:: /api/printer/bed + + Bed commands allow setting the temperature and temperature offsets for the printer's heated bed. Available commands + are: + + target + Sets the given target temperature on the printer's tools. Additional parameters: + + * ``target``: Target temperature to set. + + offset + Sets the given temperature offset on the printer's tools. Additional parameters: + + * ``offset``: Offset to set. + + All of these commands may only be sent if the printer is currently operational. Otherwise a :http:statuscode:`409` + is returned. + + Upon success, a status code of :http:statuscode:`204` and an empty body is returned. + + **Example Target Temperature Request** + + Set the target temperature for the printer's heated bed to 75°C. + + .. sourcecode:: http + + POST /api/printer/bed HTTP/1.1 + Host: example.com + Content-Type: application/json + X-Api-Key: abcdef... + + { + "command": "target", + "target": 75 + } + + .. sourcecode:: http + + HTTP/1.1 204 No Content + + **Example Offset Temperature Request** + + Set the temperature offset for the heated bed to -5°C. + + .. sourcecode:: http + + POST /api/printer/bed HTTP/1.1 + Host: example.com + Content-Type: application/json + X-Api-Key: abcdef... + + { + "command": "offset", + "offset": -5 + } + + .. sourcecode:: http + + HTTP/1.1 204 No Content + + :json string command: The command to issue, either ``target`` or ``offset``. + :json object target: ``target`` command: The target temperature to set. + :json object offset: ``offset`` command: The offset temperature to set. + :statuscode 204: No error + :statuscode 400: If ``target`` or ``offset`` is not a valid number or outside of the supported range, or if the + request is otherwise invalid. + :statuscode 409: If the printer is not operational. + +.. _sec-api-printer-bedstate: + +Retrieve the current bed state +============================== + +.. http:get:: /api/printer/bed + + Retrieves the current temperature data (actual, target and offset) plus optionally a (limited) history (actual, target, + timestamp) for the printer's heated bed. + + It's also possible to retrieve the temperature history by supplying the ``history`` query parameter set to ``true``. The + amount of returned history data points can be limited using the ``limit`` query parameter. + + Returns a :http:statuscode:`200` with a Temperature Response in the body upon success. + + .. note:: + If you want both tool and bed temperature information at the same time, take a look at + :ref:`Retrieve the current printer state `. + + **Example** + + Query the bed temperature data and also include the temperature history but limit it to two entries. + + .. sourcecode:: http + + GET /api/printer/bed?history=true&limit=2 HTTP/1.1 + Host: example.com + X-Api-Key: abcdef... + + .. sourcecode:: http + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "bed": { + "actual": 50.221, + "target": 70.0, + "offset": 5 + }, + "history": [ + { + "time": 1395651928, + "bed": { + "actual": 50.221, + "target": 70.0 + } + }, + { + "time": 1395651926, + "bed": { + "actual": 49.1123, + "target": 70.0 + } + } + ] + } + + :query history: If set to ``true`` (or: ``yes``, ``y``, ``1``), history information will be included in the response + too. If no ``limit`` parameter is given, all available temperature history data will be returned. + :query limit: If set to an integer (``n``), only the last ``n`` data points from the printer's temperature history + will be returned. Will be ignored if ``history`` is not enabled. + :statuscode 200: No error + :statuscode 409: If the printer is not operational. .. _sec-api-printer-sdcommand: -Issue a SD command -================== +Issue an SD command +=================== .. http:post:: /api/printer/sd @@ -268,6 +659,8 @@ Issue a SD command **Example Init Request** + Initialize the SD card. + .. sourcecode:: http POST /api/printer/sd HTTP/1.1 @@ -279,8 +672,14 @@ Issue a SD command "command": "init" } + .. sourcecode:: http + + HTTP/1.1 204 No Content + **Example Refresh Request** + Refresh the file list of the SD card + .. sourcecode:: http POST /api/printer/sd HTTP/1.1 @@ -292,8 +691,14 @@ Issue a SD command "command": "refresh" } + .. sourcecode:: http + + HTTP/1.1 204 No Content + **Example Release Request** + Release the SD card + .. sourcecode:: http POST /api/printer/sd HTTP/1.1 @@ -305,6 +710,10 @@ Issue a SD command "command": "release" } + .. sourcecode:: http + + HTTP/1.1 204 No Content + :json string command: The command to issue, either ``init``, ``refresh`` or ``release``. :statuscode 204: No error :statuscode 409: If a ``refresh`` or ``release`` command is issued but the SD card has not been initialized (e.g. @@ -324,14 +733,15 @@ Retrieve the current SD state Returns a :http:statuscode:`200` with an :ref:`SD State Response ` in the body upon success. - **Example Request** + **Example** + + Read the current state of the SD card. .. sourcecode:: http GET /api/printer/sd HTTP/1.1 Host: example.com - - **Example Response** + X-Api-Key: abcdef... .. sourcecode:: http @@ -350,10 +760,116 @@ Retrieve the current SD state Datamodel ========= +.. _sec-api-printer-datamodel-fullstate: + +Full State Response +------------------- + +.. list-table:: + :widths: 15 5 10 30 + :header-rows: 1 + + * - Name + - Multiplicity + - Type + - Description + * - ``temperature`` + - 0..1 + - :ref:`Temperature State ` + - The printer's temperature state data + * - ``sd`` + - 0..1 + - :ref:`SD State ` + - The printer's sd state data + * - ``state`` + - 0..1 + - :ref:`Printer State ` + - The printer's general state + +.. _sec-api-printer-datamodel-temps: + +Temperature State +----------------- + +.. list-table:: + :widths: 15 5 10 30 + :header-rows: 1 + + * - Name + - Multiplicity + - Type + - Description + * - ``tool{n}`` + - 0..* + - :ref:`Temperature Data ` + - Current temperature stats for tool *n*. Enumeration starts at 0 for the first tool. Not included if querying + only bed state. + * - ``bed`` + - 0..1 + - :ref:`Temperature Data ` + - Current temperature stats for the printer's heated bed. Not included if querying only tool state. + * - ``history`` + - 0..1 + - List of :ref:`Historic Temperature Datapoint ` + - Temperature history + +.. _sec-api-printer-datamodel-temphistory: + +Historic Temperature Data Point +------------------------------- + +.. list-table:: + :widths: 15 5 10 30 + :header-rows: 1 + + * - Name + - Multiplicity + - Type + - Description + * - ``time`` + - 1 + - Unix Timestamp + - Timestamp of this data point + * - ``tool{n}`` + - 0..* + - :ref:`Temperature Data ` + - Temperature stats for tool *n*. Enumeration starts at 0 for the first tool. Not included if querying only + bed state. + * - ``bed`` + - 0..* + - :ref:`Temperature Data ` + - Temperature stats for the printer's heated bed. Not included if querying only tool state. + +.. _sec-api-printer-datamodel-tempdata: + +Temperature Data +---------------- + +.. list-table:: + :widths: 15 5 10 30 + :header-rows: 1 + + * - Name + - Multiplicity + - Type + - Description + * - ``actual`` + - 1 + - Number + - Current temperature + * - ``target`` + - 1 + - Number + - Target temperature, may be ``null`` if no target temperature is set. + * - ``offset`` + - 0..1 + - Number + - Currently configured temperature offset to apply, will be left out for historic temperature information. + .. _sec-api-printer-datamodel-sdstate: -SD State Response ------------------ +SD State +-------- .. list-table:: :widths: 15 5 10 30 @@ -366,4 +882,55 @@ SD State Response * - ``ready`` - 1 - Boolean - - Whether the SD card has been initialized (``true``) or not (``false``). \ No newline at end of file + - Whether the SD card has been initialized (``true``) or not (``false``). + +.. _sec-api-printer-datamodel-printerstate: + +Printer State +------------- + +.. list-table:: + :widths: 15 5 10 30 + :header-rows: 1 + + * - Name + - Multiplicity + - Type + - Description + * - ``text`` + - 1 + - String + - A textual representation of the current state of the printer, e.g. "Operational" or "Printing" + * - ``flags`` + - 1 + - Printer state flags + - A couple of boolean printer state flags + * - ``flags.operational`` + - 1 + - Boolean + - ``true`` if the printer is operational, ``false`` otherwise + * - ``flags.paused`` + - 1 + - Boolean + - ``true`` if the printer is currently paused, ``false`` otherwise + * - ``flags.printing`` + - 1 + - Boolean + - ``true`` if the printer is currently printing, ``false`` otherwise + * - ``flags.sdReady`` + - 1 + - Boolean + - ``true`` if the printer's SD card is available and initialized, ``false`` otherwise. This is redundant information + to :ref:`the SD State `. + * - ``flags.error`` + - 1 + - Boolean + - ``true`` if an unrecoverable error occurred, ``false`` otherwise + * - ``flags.ready`` + - 1 + - Boolean + - ``true`` if the printer is operational and no data is currently being streamed to SD, so ready to receive instructions + * - ``flags.closedOrError`` + - 1 + - Boolean + - ``true`` if the printer is disconnected (possibly due to an error), ``false`` otherwise diff --git a/requirements-bbb.txt b/requirements-bbb.txt index f2c0c582e..127383ed9 100644 --- a/requirements-bbb.txt +++ b/requirements-bbb.txt @@ -8,6 +8,8 @@ Flask-Principal==0.3.5 netaddr>=0.7.10 mock>=1.0.1 nose>=1.3.0 +watchdog +sarge sphinxcontrib-httpdomain sphinx_rtd_theme diff --git a/requirements.txt b/requirements.txt index e6d4d990a..a069eb3b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,8 @@ pyserial>=2.6 netaddr>=0.7.10 mock>=1.0.1 nose>=1.3.0 +watchdog +sarge sphinxcontrib-httpdomain sphinx_rtd_theme diff --git a/src/octoprint/__init__.py b/src/octoprint/__init__.py index dbd06e7db..6d5dad46e 100644 --- a/src/octoprint/__init__.py +++ b/src/octoprint/__init__.py @@ -5,7 +5,7 @@ from octoprint.server import Server class Main(Daemon): - def __init__(self, pidfile, configfile, basedir, host, port, debug, allowRoot): + def __init__(self, pidfile, configfile, basedir, host, port, debug, allowRoot, logConf): Daemon.__init__(self, pidfile) self._configfile = configfile @@ -14,6 +14,7 @@ class Main(Daemon): self._port = port self._debug = debug self._allowRoot = allowRoot + self._logConf = logConf def run(self): octoprint = Server(self._configfile, self._basedir, self._host, self._port, self._debug, self._allowRoot) @@ -36,6 +37,8 @@ def main(): help="Specify the config file to use. OctoPrint needs to have write access for the settings dialog to work. Defaults to ~/.octoprint/config.yaml") parser.add_argument("-b", "--basedir", action="store", dest="basedir", help="Specify the basedir to use for uploads, timelapses etc. OctoPrint needs to have write access. Defaults to ~/.octoprint") + parser.add_argument("--logging", action="store", dest="logConf", + help="Specify the config file to use for configuring logging. Defaults to ~/.octoprint/logging.yaml") parser.add_argument("--daemon", action="store", type=str, choices=["start", "stop", "restart"], help="Daemonize/control daemonized OctoPrint instance (only supported under Linux right now)") @@ -52,7 +55,7 @@ def main(): print >> sys.stderr, "Sorry, daemon mode is only supported under Linux right now" sys.exit(2) - daemon = Main(args.pidfile, args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot) + daemon = Main(args.pidfile, args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot, args.logConf) if "start" == args.daemon: daemon.start() elif "stop" == args.daemon: @@ -60,7 +63,7 @@ def main(): elif "restart" == args.daemon: daemon.restart() else: - octoprint = Server(args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot) + octoprint = Server(args.config, args.basedir, args.host, args.port, args.debug, args.allowRoot, args.logConf) octoprint.run() if __name__ == "__main__": diff --git a/src/octoprint/events.py b/src/octoprint/events.py index f9216b067..6b3324545 100644 --- a/src/octoprint/events.py +++ b/src/octoprint/events.py @@ -203,36 +203,42 @@ class DebugEventListener(GenericEventListener): class CommandTrigger(GenericEventListener): - def __init__(self, triggerType, printer): + def __init__(self, printer): GenericEventListener.__init__(self) self._printer = printer self._subscriptions = {} - self._initSubscriptions(triggerType) + self._initSubscriptions() - def _initSubscriptions(self, triggerType): + def _initSubscriptions(self): """ Subscribes all events as defined in "events > $triggerType > subscriptions" in the settings with their respective commands. """ - if not settings().get(["events", triggerType]): + if not settings().get(["events"]): return - if not settings().getBoolean(["events", triggerType, "enabled"]): + if not settings().getBoolean(["events", "enabled"]): return eventsToSubscribe = [] - for subscription in settings().get(["events", triggerType, "subscriptions"]): - if not "event" in subscription.keys() or not "command" in subscription.keys(): - self._logger.info("Invalid %s, missing either event or command: %r" % (triggerType, subscription)) + for subscription in settings().get(["events", "subscriptions"]): + if not "event" in subscription.keys() or not "command" in subscription.keys() \ + or not "type" in subscription.keys() or not subscription["type"] in ["system", "gcode"]: + self._logger.info("Invalid command trigger, missing either event, type or command or type is invalid: %r" % subscription) + continue + + if "enabled" in subscription.keys() and not subscription["enabled"]: + self._logger.info("Disabled command trigger: %r" % subscription) continue event = subscription["event"] command = subscription["command"] + commandType = subscription["type"] if not event in self._subscriptions.keys(): self._subscriptions[event] = [] - self._subscriptions[event].append(command) + self._subscriptions[event].append((command, commandType)) if not event in eventsToSubscribe: eventsToSubscribe.append(event) @@ -250,18 +256,48 @@ class CommandTrigger(GenericEventListener): if not event in self._subscriptions: return - for command in self._subscriptions[event]: + for command, commandType in self._subscriptions[event]: try: - processedCommand = self._processCommand(command, payload) - self.executeCommand(processedCommand) + if isinstance(command, (tuple, list, set)): + processedCommand = [] + for c in command: + processedCommand.append(self._processCommand(c, payload)) + else: + processedCommand = self._processCommand(command, payload) + self.executeCommand(processedCommand, commandType) except KeyError, e: self._logger.warn("There was an error processing one or more placeholders in the following command: %s" % command) - def executeCommand(self, command): - """ - Not implemented, override in child classes - """ - pass + def executeCommand(self, command, commandType): + if commandType == "system": + self._executeSystemCommand(command) + elif commandType == "gcode": + self._executeGcodeCommand(command) + + def _executeSystemCommand(self, command): + def commandExecutioner(command): + self._logger.info("Executing system command: %s" % command) + subprocess.Popen(command, shell=True) + + try: + if isinstance(command, (list, tuple, set)): + for c in command: + commandExecutioner(c) + else: + commandExecutioner(command) + except subprocess.CalledProcessError, e: + self._logger.warn("Command failed with return code %i: %s" % (e.returncode, e.message)) + except Exception, ex: + self._logger.exception("Command failed") + + def _executeGcodeCommand(self, command): + commands = [command] + if isinstance(command, (list, tuple, set)): + self.logger.debug("Executing GCode commands: %r" % command) + commands = list(command) + else: + self._logger.debug("Executing GCode command: %s" % command) + self._printer.commands(commands) def _processCommand(self, command, payload): """ @@ -302,34 +338,3 @@ class CommandTrigger(GenericEventListener): params.update(payload) return command.format(**params) - - -class SystemCommandTrigger(CommandTrigger): - """ - Performs configured system commands for configured events. - """ - - def __init__(self, printer): - CommandTrigger.__init__(self, "systemCommandTrigger", printer) - - def executeCommand(self, command): - try: - self._logger.info("Executing system command: %s" % command) - subprocess.Popen(command, shell=True) - except subprocess.CalledProcessError, e: - self._logger.warn("Command failed with return code %i: %s" % (e.returncode, e.message)) - except Exception, ex: - self._logger.exception("Command failed") - - -class GcodeCommandTrigger(CommandTrigger): - """ - Sends configured GCODE commands to the printer for configured events. - """ - - def __init__(self, printer): - CommandTrigger.__init__(self, "gcodeCommandTrigger", printer) - - def executeCommand(self, command): - self._logger.debug("Executing GCode command: %s" % command) - self._printer.commands(command.split(",")) diff --git a/src/octoprint/gcodefiles.py b/src/octoprint/gcodefiles.py index a6cf1fe4a..e9f13c659 100644 --- a/src/octoprint/gcodefiles.py +++ b/src/octoprint/gcodefiles.py @@ -342,6 +342,9 @@ class GcodeManager: if os.path.exists(stlPath): os.remove(stlPath) + self.removeFileFromMetadata(filename) + + def removeFileFromMetadata(self, filename): if filename in self._metadata.keys(): del self._metadata[filename] self._metadataDirty = True @@ -417,6 +420,8 @@ class GcodeManager: "date": val["last"]["date"], "success": val["last"]["success"] } + if "lastPrintTime" in val["last"] and val["last"]["lastPrintTime"] is not None: + last["lastPrintTime"] = val["last"]["lastPrintTime"] prints = { "success": val["success"], "failure": val["failure"], @@ -448,7 +453,7 @@ class GcodeManager: #~~ print job data - def printSucceeded(self, filename): + def printSucceeded(self, filename, printTime): filename = self._getBasicFilename(filename) absolutePath = self.getAbsolutePath(filename) if absolutePath is None: @@ -460,10 +465,14 @@ class GcodeManager: "date": time.time(), "success": True } + + if printTime is not None: + metadata["prints"]["last"]["lastPrintTime"] = printTime + self.setFileMetadata(filename, metadata) self._saveMetadata() - def printFailed(self, filename): + def printFailed(self, filename, printTime): filename = self._getBasicFilename(filename) absolutePath = self.getAbsolutePath(filename) if absolutePath is None: @@ -475,6 +484,10 @@ class GcodeManager: "date": time.time(), "success": False } + + if printTime is not None: + metadata["prints"]["last"]["lastPrintTime"] = printTime + self.setFileMetadata(filename, metadata) self._saveMetadata() diff --git a/src/octoprint/printer.py b/src/octoprint/printer.py index 5e8b55af5..0a3345228 100644 --- a/src/octoprint/printer.py +++ b/src/octoprint/printer.py @@ -331,7 +331,7 @@ class Printer(): # mark print as failure if self._selectedFile is not None: - self._gcodeManager.printFailed(self._selectedFile["filename"]) + self._gcodeManager.printFailed(self._selectedFile["filename"], self._comm.getPrintTime()) payload = { "file": self._selectedFile["filename"], "origin": FileDestinations.LOCAL @@ -479,9 +479,9 @@ class Printer(): if self._comm is not None and oldState == self._comm.STATE_PRINTING: if self._selectedFile is not None: if state == self._comm.STATE_OPERATIONAL: - self._gcodeManager.printSucceeded(self._selectedFile["filename"]) + self._gcodeManager.printSucceeded(self._selectedFile["filename"], self._comm.getPrintTime()) elif state == self._comm.STATE_CLOSED or state == self._comm.STATE_ERROR or state == self._comm.STATE_CLOSED_WITH_ERROR: - self._gcodeManager.printFailed(self._selectedFile["filename"]) + self._gcodeManager.printFailed(self._selectedFile["filename"], self._comm.getPrintTime()) self._gcodeManager.resumeAnalysis() # printing done, put those cpu cycles to good use elif self._comm is not None and state == self._comm.STATE_PRINTING: self._gcodeManager.pauseAnalysis() # do not analyse gcode while printing @@ -631,12 +631,13 @@ class Printer(): bedTempOffset = None result = {} - for tool in self._temp.keys(): - result["tool%d" % tool] = { - "actual": self._temp[tool][0], - "target": self._temp[tool][1], - "offset": tempOffset[tool] if tool in tempOffset.keys() and tempOffset[tool] is not None else 0 - } + if self._temp is not None: + for tool in self._temp.keys(): + result["tool%d" % tool] = { + "actual": self._temp[tool][0], + "target": self._temp[tool][1], + "offset": tempOffset[tool] if tool in tempOffset.keys() and tempOffset[tool] is not None else 0 + } if self._bedTemp is not None: result["bed"] = { "actual": self._bedTemp[0], diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index 51bf09f9e..9561f89ae 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -1,4 +1,6 @@ # coding=utf-8 +import uuid + __author__ = "Gina Häußge " __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' @@ -8,6 +10,7 @@ from sockjs.tornado import SockJSRouter from flask import Flask, render_template, send_from_directory, make_response from flask.ext.login import LoginManager from flask.ext.principal import Principal, Permission, RoleNeed, identity_loaded, UserNeed +from watchdog.observers import Observer import os import logging @@ -30,7 +33,8 @@ admin_permission = Permission(RoleNeed("admin")) user_permission = Permission(RoleNeed("user")) # only import the octoprint stuff down here, as it might depend on things defined above to be initialized already -from octoprint.server.util import LargeResponseHandler, ReverseProxied, restricted_access, PrinterStateConnection, admin_validator +from octoprint.server.util import LargeResponseHandler, ReverseProxied, restricted_access, PrinterStateConnection, admin_validator, \ + UrlForwardHandler, user_validator, GcodeWatchdogHandler, UploadCleanupWatchdogHandler from octoprint.printer import Printer, getConnectionOptions from octoprint.settings import settings import octoprint.gcodefiles as gcodefiles @@ -40,6 +44,9 @@ import octoprint.events as events import octoprint.timelapse +UI_API_KEY = ''.join('%02X' % ord(z) for z in uuid.uuid4().bytes) + + @app.route("/") def index(): branch = None @@ -64,7 +71,8 @@ def index(): gitCommit=commit, stylesheet=settings().get(["devel", "stylesheet"]), gcodeMobileThreshold=settings().get(["gcodeViewer", "mobileSizeThreshold"]), - gcodeThreshold=settings().get(["gcodeViewer", "sizeThreshold"]) + gcodeThreshold=settings().get(["gcodeViewer", "sizeThreshold"]), + uiApiKey=UI_API_KEY ) @@ -96,13 +104,14 @@ def load_user(id): class Server(): - def __init__(self, configfile=None, basedir=None, host="0.0.0.0", port=5000, debug=False, allowRoot=False): + def __init__(self, configfile=None, basedir=None, host="0.0.0.0", port=5000, debug=False, allowRoot=False, logConf=None): self._configfile = configfile self._basedir = basedir self._host = host self._port = port self._debug = debug self._allowRoot = allowRoot + self._logConf = logConf def run(self): @@ -127,7 +136,7 @@ class Server(): self._initSettings(self._configfile, self._basedir) # then initialize logging - self._initLogging(self._debug) + self._initLogging(self._debug, self._logConf) logger = logging.getLogger(__name__) eventManager = events.eventManager() @@ -137,9 +146,8 @@ class Server(): # configure timelapse octoprint.timelapse.configureTimelapse() - # setup system and gcode command triggers - events.SystemCommandTrigger(printer) - events.GcodeCommandTrigger(printer) + # setup command triggers + events.CommandTrigger(printer) if self._debug: events.DebugEventListener() @@ -176,23 +184,32 @@ class Server(): self._router = SockJSRouter(self._createSocketConnection, "/sockjs") - def admin_access_validation(request): + def access_validation_factory(validator): """ - Creates a custom wsgi and Flask request context in order to be able to process user information - stored in the current session. + Creates an access validation wrapper using the supplied validator. - :param request: The Tornado request for which to create the environment and context + :param validator: the access validator to use inside the validation wrapper + :return: an access validation wrapper taking a request as parameter and performing the request validation """ - wsgi_environ = tornado.wsgi.WSGIContainer.environ(request) - with app.request_context(wsgi_environ): - app.session_interface.open_session(app, flask.request) - loginManager.reload_user() - admin_validator(flask.request) + def f(request): + """ + Creates a custom wsgi and Flask request context in order to be able to process user information + stored in the current session. + + :param request: The Tornado request for which to create the environment and context + """ + wsgi_environ = tornado.wsgi.WSGIContainer.environ(request) + with app.request_context(wsgi_environ): + app.session_interface.open_session(app, flask.request) + loginManager.reload_user() + validator(flask.request) + return f self._tornado_app = Application(self._router.urls + [ (r"/downloads/timelapse/([^/]*\.mpg)", LargeResponseHandler, {"path": settings().getBaseFolder("timelapse"), "as_attachment": True}), (r"/downloads/files/local/([^/]*\.(gco|gcode))", LargeResponseHandler, {"path": settings().getBaseFolder("uploads"), "as_attachment": True}), - (r"/downloads/logs/([^/]*)", LargeResponseHandler, {"path": settings().getBaseFolder("logs"), "as_attachment": True, "access_validation": admin_access_validation}), + (r"/downloads/logs/([^/]*)", LargeResponseHandler, {"path": settings().getBaseFolder("logs"), "as_attachment": True, "access_validation": access_validation_factory(admin_validator)}), + (r"/downloads/camera/current", UrlForwardHandler, {"url": settings().get(["webcam", "snapshot"]), "as_attachment": True, "access_validation": access_validation_factory(user_validator)}), (r".*", FallbackHandler, {"fallback": WSGIContainer(app.wsgi_app)}) ]) self._server = HTTPServer(self._tornado_app) @@ -204,6 +221,13 @@ class Server(): connectionOptions = getConnectionOptions() if port in connectionOptions["ports"]: printer.connect(port, baudrate) + + # start up watchdogs + observer = Observer() + observer.schedule(GcodeWatchdogHandler(gcodeManager, printer), settings().getBaseFolder("watched")) + observer.schedule(UploadCleanupWatchdogHandler(gcodeManager), settings().getBaseFolder("uploads")) + observer.start() + try: IOLoop.instance().start() except KeyboardInterrupt: @@ -211,6 +235,9 @@ class Server(): except: logger.fatal("Now that is embarrassing... Something really really went wrong here. Please report this including the stacktrace below in OctoPrint's bugtracker. Thanks!") logger.exception("Stacktrace follows:") + finally: + observer.stop() + observer.join() def _createSocketConnection(self, session): global printer, gcodeManager, userManager, eventManager @@ -223,8 +250,8 @@ class Server(): def _initSettings(self, configfile, basedir): settings(init=True, basedir=basedir, configfile=configfile) - def _initLogging(self, debug): - config = { + def _initLogging(self, debug, logConf=None): + defaultConfig = { "version": 1, "formatters": { "simple": { @@ -255,12 +282,6 @@ class Server(): } }, "loggers": { - #"octoprint.timelapse": { - # "level": "DEBUG" - #}, - #"octoprint.events": { - # "level": "DEBUG" - #}, "SERIAL": { "level": "CRITICAL", "handlers": ["serialFile"], @@ -274,8 +295,18 @@ class Server(): } if debug: - config["root"]["level"] = "DEBUG" + defaultConfig["root"]["level"] = "DEBUG" + if logConf is None: + logConf = os.path.join(settings().settings_dir, "logging.yaml") + + configFromFile = {} + if os.path.exists(logConf) and os.path.isfile(logConf): + import yaml + with open(logConf, "r") as f: + configFromFile = yaml.safe_load(f) + + config = util.dict_merge(defaultConfig, configFromFile) logging.config.dictConfig(config) if settings().getBoolean(["serial", "log"]): diff --git a/src/octoprint/server/api/__init__.py b/src/octoprint/server/api/__init__.py index 9ff5ae549..6524bf417 100644 --- a/src/octoprint/server/api/__init__.py +++ b/src/octoprint/server/api/__init__.py @@ -1,10 +1,12 @@ # coding=utf-8 +from octoprint.server.util import getApiKey, getUserForApiKey + __author__ = "Gina Häußge " __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' import logging -import subprocess import netaddr +import sarge from flask import Blueprint, request, jsonify, abort, current_app, session, make_response from flask.ext.login import login_user, logout_user, current_user @@ -13,7 +15,7 @@ from flask.ext.principal import Identity, identity_changed, AnonymousIdentity import octoprint.util as util import octoprint.users import octoprint.server -from octoprint.server import restricted_access, admin_permission, NO_CONTENT +from octoprint.server import restricted_access, admin_permission, NO_CONTENT, UI_API_KEY from octoprint.settings import settings as s, valid_boolean_trues #~~ init api blueprint, including sub modules @@ -30,6 +32,41 @@ from . import users as api_users from . import log as api_logs +@api.before_request +def beforeApiRequests(): + """ + All requests in this blueprint need to be made supplying an API key. This may be the UI_API_KEY, in which case + the underlying request processing will directly take place, or it may be the global or a user specific case. In any + case it has to be present and must be valid, so anything other than the above three types will result in denying + the request. + """ + + apikey = getApiKey(request) + if apikey is None: + # no api key => 401 + return make_response("No API key provided", 401) + + if apikey == UI_API_KEY: + # ui api key => continue regular request processing + return + + if not s().get(["api", "enabled"]): + # api disabled => 401 + return make_response("API disabled", 401) + + if apikey == s().get(["api", "key"]): + # global api key => continue regular request processing + return + + user = getUserForApiKey(apikey) + if user is not None: + # user specific api key => continue regular request processing + return + + # invalid api key => 401 + return make_response("Invalid API key", 401) + + #~~ first run setup @@ -77,20 +114,22 @@ def apiPrinterState(): @admin_permission.require(403) def performSystemAction(): logger = logging.getLogger(__name__) - if request.values.has_key("action"): + if "action" in request.values.keys(): action = request.values["action"] - availableActions = s().get(["system", "actions"]) - for availableAction in availableActions: + available_actions = s().get(["system", "actions"]) + for availableAction in available_actions: if availableAction["action"] == action: logger.info("Performing command: %s" % availableAction["command"]) try: - subprocess.check_output(availableAction["command"], shell=True) - except subprocess.CalledProcessError, e: - logger.warn("Command failed with return code %i: %s" % (e.returncode, e.message)) - return make_response(("Command failed with return code %i: %s" % (e.returncode, e.message), 500, [])) - except Exception, ex: - logger.exception("Command failed") - return make_response(("Command failed: %r" % ex, 500, [])) + p = sarge.run(availableAction["command"], stderr=sarge.Capture()) + if p.returncode != 0: + returncode = p.returncode + stderr_text = p.stderr.text + logger.warn("Command failed with return code %i: %s" % (returncode, stderr_text)) + return make_response(("Command failed with return code %i: %s" % (returncode, stderr_text), 500, [])) + except Exception, e: + logger.warn("Command failed: %s" % e) + return make_response(("Command failed: %s" % e, 500, [])) return NO_CONTENT diff --git a/src/octoprint/server/api/files.py b/src/octoprint/server/api/files.py index bba7b2605..b615c1735 100644 --- a/src/octoprint/server/api/files.py +++ b/src/octoprint/server/api/files.py @@ -106,11 +106,13 @@ def uploadGcodeFile(target): # determine current job currentFilename = None - currentSd = None + currentOrigin = None currentJob = printer.getCurrentJob() - if currentJob is not None and "filename" in currentJob.keys() and "sd" in currentJob.keys(): - currentFilename = currentJob["filename"] - currentSd = currentJob["sd"] + if currentJob is not None and "file" in currentJob.keys(): + currentJobFile = currentJob["file"] + if "name" in currentJobFile.keys() and "origin" in currentJobFile.keys(): + currentFilename = currentJobFile["name"] + currentOrigin = currentJobFile["origin"] # determine future filename of file to be uploaded, abort if it can't be uploaded futureFilename = gcodeManager.getFutureFilename(file) @@ -118,7 +120,7 @@ def uploadGcodeFile(target): return make_response("Can not upload file %s, wrong format?" % file.filename, 415) # prohibit overwriting currently selected file while it's being printed - if futureFilename == currentFilename and sd == currentSd and printer.isPrinting() or printer.isPaused(): + if futureFilename == currentFilename and target == currentOrigin and printer.isPrinting() or printer.isPaused(): return make_response("Trying to overwrite file that is currently being printed: %s" % currentFilename, 409) filename = None @@ -145,12 +147,10 @@ def uploadGcodeFile(target): Selects the just uploaded file if either selectAfterUpload or printAfterSelect are True, or if the exact file is already selected, such reloading it. """ - sd = destination == FileDestinations.SDCARD - if selectAfterUpload or printAfterSelect or (currentFilename == filename and currentSd == sd): - printer.selectFile(nameToSelect, sd, printAfterSelect) + if selectAfterUpload or printAfterSelect or (currentFilename == filename and currentOrigin == destination): + printer.selectFile(nameToSelect, destination == FileDestinations.SDCARD, printAfterSelect) - destination = FileDestinations.SDCARD if sd else FileDestinations.LOCAL - filename, done = gcodeManager.addFile(file, destination, fileProcessingFinished) + filename, done = gcodeManager.addFile(file, target, fileProcessingFinished) if filename is None: return make_response("Could not upload the file %s" % file.filename, 500) @@ -161,30 +161,33 @@ def uploadGcodeFile(target): eventManager.fire(Events.UPLOAD, {"file": filename, "target": target}) files = {} - if done: + location = url_for(".readGcodeFile", target=FileDestinations.LOCAL, filename=filename, _external=True) + files.update({ + FileDestinations.LOCAL: { + "name": filename, + "origin": FileDestinations.LOCAL, + "refs": { + "resource": location, + "download": url_for("index", _external=True) + "downloads/files/" + FileDestinations.LOCAL + "/" + filename + } + } + }) + + if sd and sdFilename: + location = url_for(".readGcodeFile", target=FileDestinations.SDCARD, filename=sdFilename, _external=True) files.update({ - FileDestinations.LOCAL: { - "name": filename, - "origin": FileDestinations.LOCAL, + FileDestinations.SDCARD: { + "name": sdFilename, + "origin": FileDestinations.SDCARD, "refs": { - "resource": url_for(".readGcodeFile", target=FileDestinations.LOCAL, filename=filename, _external=True), - "download": url_for("index", _external=True) + "downloads/files/" + FileDestinations.LOCAL + "/" + filename + "resource": location } } }) - if sd and sdFilename: - files.update({ - FileDestinations.SDCARD: { - "name": sdFilename, - "origin": FileDestinations.SDCARD, - "refs": { - "resource": url_for(".readGcodeFile", target=FileDestinations.SDCARD, filename=sdFilename, _external=True) - } - } - }) - - return make_response(jsonify(files=files, done=done), 201) + r = make_response(jsonify(files=files, done=done), 201) + r.headers["Location"] = location + return r @api.route("/files//", methods=["GET"]) diff --git a/src/octoprint/server/api/printer.py b/src/octoprint/server/api/printer.py index 547f04228..87d717172 100644 --- a/src/octoprint/server/api/printer.py +++ b/src/octoprint/server/api/printer.py @@ -12,13 +12,36 @@ import octoprint.util as util #~~ Printer + @api.route("/printer", methods=["GET"]) def printerState(): if not printer.isOperational(): return make_response("Printer is not operational", 409) + # process excludes + excludes = [] + if "exclude" in request.values: + excludeStr = request.values["exclude"] + if len(excludeStr.strip()) > 0: + excludes = filter(lambda x: x in ["temperature", "sd", "state"], map(lambda x: x.strip(), excludeStr.split(","))) + result = {} - result.update(_getTemperatureData(lambda x: x)) + + # add temperature information + if not "temperature" in excludes: + result.update({"temperature": _getTemperatureData(lambda x: x)}) + + # add sd information + if not "sd" in excludes and settings().getBoolean(["feature", "sdSupport"]): + result.update({"sd": {"ready": printer.isSdReady()}}) + + # add state information + if not "state" in excludes: + state = printer.getCurrentData()["state"] + result.update({"state": { + "text": state["stateString"], + "flags": state["flags"] + }}) return jsonify(result) @@ -145,7 +168,7 @@ def printerBedCommand(): ##~~ temperature offset elif command == "offset": - offset = data["offsets"] + offset = data["offset"] # make sure the offset is valid if not isinstance(offset, (int, long, float)): @@ -276,11 +299,14 @@ def printerCommand(): data = request.json parameters = {} - if "parameters" in data.keys(): parameters = data["parameters"] + if "parameters" in data.keys(): + parameters = data["parameters"] commands = [] - if "command" in data.keys(): commands = [data["command"]] - elif "commands" in data.keys(): commands = data["commands"] + if "command" in data.keys(): + commands = [data["command"]] + elif "commands" in data.keys(): + commands = data["commands"] commandsToSend = [] for command in commands: @@ -306,9 +332,6 @@ def _getTemperatureData(filter): return make_response("Printer is not operational", 409) tempData = printer.getCurrentTemperatures() - result = { - "temps": filter(tempData) - } if "history" in request.values.keys() and request.values["history"] in valid_boolean_trues: tempHistory = printer.getTemperatureHistory() @@ -320,9 +343,9 @@ def _getTemperatureData(filter): history = list(tempHistory) limit = min(limit, len(history)) - result.update({ + tempData.update({ "history": map(lambda x: filter(x), history[-limit:]) }) - return result + return filter(tempData) diff --git a/src/octoprint/server/util.py b/src/octoprint/server/util.py index 711496864..eff51a625 100644 --- a/src/octoprint/server/util.py +++ b/src/octoprint/server/util.py @@ -1,9 +1,12 @@ # coding=utf-8 +from octoprint.filemanager.destinations import FileDestinations + __author__ = "Gina Häußge " __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' from flask.ext.principal import identity_changed, Identity -from tornado.web import StaticFileHandler, HTTPError +from tornado.web import StaticFileHandler, HTTPError, RequestHandler, asynchronous +from tornado.httpclient import AsyncHTTPClient, HTTPRequest from flask import url_for, make_response, request, current_app from flask.ext.login import login_required, login_user, current_user from werkzeug.utils import redirect @@ -18,13 +21,15 @@ import os import threading import logging from functools import wraps +from watchdog.events import PatternMatchingEventHandler from octoprint.settings import settings import octoprint.timelapse import octoprint.server from octoprint.users import ApiUser from octoprint.events import Events - +from octoprint import gcodefiles +import octoprint.util as util def restricted_access(func, apiEnabled=True): """ @@ -50,9 +55,9 @@ def restricted_access(func, apiEnabled=True): if settings().getBoolean(["server", "firstRun"]) and (octoprint.server.userManager is None or not octoprint.server.userManager.hasBeenCustomized()): return make_response("OctoPrint isn't setup yet", 403) - # if API is globally enabled, enabled for this request and an api key is provided, try to use that - apikey = _getApiKey(request) - if settings().get(["api", "enabled"]) and apiEnabled and apikey is not None: + # if API is globally enabled, enabled for this request and an api key is provided that is not the current UI API key, try to use that + apikey = getApiKey(request) + if settings().get(["api", "enabled"]) and apiEnabled and apikey is not None and apikey != octoprint.server.UI_API_KEY: if apikey == settings().get(["api", "key"]): # master key was used user = ApiUser() @@ -61,7 +66,7 @@ def restricted_access(func, apiEnabled=True): user = octoprint.server.userManager.findUser(apikey=apikey) if user is None: - make_response("Invalid API key", 401) + return make_response("Invalid API key", 401) if login_user(user, remember=False): identity_changed.send(current_app._get_current_object(), identity=Identity(user.get_id())) return func(*args, **kwargs) @@ -76,7 +81,7 @@ def api_access(func): def decorated_view(*args, **kwargs): if not settings().get(["api", "enabled"]): make_response("API disabled", 401) - apikey = _getApiKey(request) + apikey = getApiKey(request) if apikey is None: make_response("No API key provided", 401) if apikey != settings().get(["api", "key"]): @@ -85,7 +90,7 @@ def api_access(func): return decorated_view -def _getUserForApiKey(apikey): +def getUserForApiKey(apikey): if settings().get(["api", "enabled"]) and apikey is not None: if apikey == settings().get(["api", "key"]): # master key was used @@ -97,7 +102,7 @@ def _getUserForApiKey(apikey): return None -def _getApiKey(request): +def getApiKey(request): # Check Flask GET/POST arguments if hasattr(request, "values") and "apikey" in request.values: return request.values["apikey"] @@ -148,6 +153,10 @@ class PrinterStateConnection(SockJSConnection): def on_open(self, info): remoteAddress = self._getRemoteAddress(info) self._logger.info("New connection from client: %s" % remoteAddress) + + # connected => update the API key, might be necessary if the client was left open while the server restarted + self._emit("connected", {"apikey": octoprint.server.UI_API_KEY}) + self._printer.registerCallback(self) self._gcodeManager.registerCallback(self) octoprint.timelapse.registerCallback(self) @@ -303,6 +312,77 @@ class LargeResponseHandler(StaticFileHandler): self.set_header("Content-Disposition", "attachment") +##~~ URL Forward Handler for forwarding requests to a preconfigured static URL + + +class UrlForwardHandler(RequestHandler): + + def initialize(self, url=None, as_attachment=False, basename=None, access_validation=None): + RequestHandler.initialize(self) + self._url = url + self._as_attachment = as_attachment + self._basename = basename + self._access_validation = access_validation + + @asynchronous + def get(self, *args, **kwargs): + if self._access_validation is not None: + self._access_validation(self.request) + + if self._url is None: + raise HTTPError(404) + + client = AsyncHTTPClient() + r = HTTPRequest(url=self._url, method=self.request.method, body=self.request.body, headers=self.request.headers, follow_redirects=False, allow_nonstandard_methods=True) + + try: + return client.fetch(r, self.handle_response) + except HTTPError as e: + if hasattr(e, "response") and e.response: + self.handle_response(e.response) + else: + raise HTTPError(500) + + def handle_response(self, response): + if response.error and not isinstance(response.error, HTTPError): + raise HTTPError(500) + + filename = None + + self.set_status(response.code) + for name in ("Date", "Cache-Control", "Server", "Content-Type", "Location"): + value = response.headers.get(name) + if value: + self.set_header(name, value) + + if name == "Content-Type": + filename = self.get_filename(value) + + if self._as_attachment: + if filename is not None: + self.set_header("Content-Disposition", "attachment; filename=%s" % filename) + else: + self.set_header("Content-Disposition", "attachment") + + if response.body: + self.write(response.body) + self.finish() + + def get_filename(self, content_type): + if not self._basename: + return None + + typeValue = map(str.strip, content_type.split(";")) + if len(typeValue) == 0: + return None + + extension = mimetypes.guess_extension(typeValue[0]) + if not extension: + return None + + return "%s%s" % (self._basename, extension) + + #~~ admin access validator for use with tornado @@ -316,9 +396,9 @@ def admin_validator(request): :param request: The Flask request object """ - apikey = _getApiKey(request) + apikey = getApiKey(request) if settings().get(["api", "enabled"]) and apikey is not None: - user = _getUserForApiKey(apikey) + user = getUserForApiKey(apikey) else: user = current_user @@ -326,6 +406,29 @@ def admin_validator(request): raise HTTPError(403) +#~~ user access validator for use with tornado + + +def user_validator(request): + """ + Validates that the given request is made by an authenticated user, identified either by API key or existing Flask + session. + + Must be executed in an existing Flask request context! + + :param request: The Flask request object + """ + + apikey = getApiKey(request) + if settings().get(["api", "enabled"]) and apikey is not None: + user = getUserForApiKey(apikey) + else: + user = current_user + + if user is None or not user.is_authenticated(): + raise HTTPError(403) + + #~~ reverse proxy compatible wsgi middleware @@ -386,3 +489,77 @@ def redirectToTornado(request, target): redirectUrl += fragment return redirect(redirectUrl) + +class UploadCleanupWatchdogHandler(PatternMatchingEventHandler): + """ + Takes care of automatically deleting metadata entries for files that get deleted from the uploads folder + """ + + patterns = map(lambda x: "*.%s" % x, gcodefiles.GCODE_EXTENSIONS) + + def __init__(self, gcode_manager): + PatternMatchingEventHandler.__init__(self) + self._gcode_manager = gcode_manager + + def on_deleted(self, event): + filename = self._gcode_manager._getBasicFilename(event.src_path) + if not filename: + return + + self._gcode_manager.removeFileFromMetadata(filename) + + +class GcodeWatchdogHandler(PatternMatchingEventHandler): + """ + Takes care of automatically "uploading" files that get added to the watched folder. + """ + + patterns = map(lambda x: "*.%s" % x, gcodefiles.SUPPORTED_EXTENSIONS) + + def __init__(self, gcodeManager, printer): + PatternMatchingEventHandler.__init__(self) + + self._logger = logging.getLogger(__name__) + + self._gcodeManager = gcodeManager + self._printer = printer + + def _upload(self, path): + class WatchdogFileWrapper(object): + + def __init__(self, path): + self._path = path + self.filename = os.path.basename(self._path) + + def save(self, target): + util.safeRename(self._path, target) + + fileWrapper = WatchdogFileWrapper(path) + + # determine current job + currentFilename = None + currentOrigin = None + currentJob = self._printer.getCurrentJob() + if currentJob is not None and "file" in currentJob.keys(): + currentJobFile = currentJob["file"] + if "name" in currentJobFile.keys() and "origin" in currentJobFile.keys(): + currentFilename = currentJobFile["name"] + currentOrigin = currentJobFile["origin"] + + # determine future filename of file to be uploaded, abort if it can't be uploaded + futureFilename = self._gcodeManager.getFutureFilename(fileWrapper) + if futureFilename is None or (not settings().getBoolean(["cura", "enabled"]) and not gcodefiles.isGcodeFileName(futureFilename)): + self._logger.warn("Could not add %s: Invalid file" % fileWrapper.filename) + return + + # prohibit overwriting currently selected file while it's being printed + if futureFilename == currentFilename and not currentOrigin == FileDestinations.SDCARD and self._printer.isPrinting() or self._printer.isPaused(): + self._logger.warn("Could not add %s: Trying to overwrite file that is currently being printed" % fileWrapper.filename) + return + + self._gcodeManager.addFile(fileWrapper, FileDestinations.LOCAL) + + def on_created(self, event): + self._upload(event.src_path) + + diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index 98f159377..b9e1f0db6 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -77,7 +77,8 @@ default_settings = { "timelapse": None, "timelapse_tmp": None, "logs": None, - "virtualSd": None + "virtualSd": None, + "watched": None }, "temperature": { "profiles": @@ -100,7 +101,7 @@ default_settings = { {"x": 0.0, "y": 0.0} ], "bedDimensions": { - "x": 200.0, "y": 200.0 + "x": 200.0, "y": 200.0, "r": 100 } }, "appearance": { @@ -125,12 +126,8 @@ default_settings = { "config": "/default/path/to/your/cura/config.ini" }, "events": { - "systemCommandTrigger": { - "enabled": False - }, - "gcodeCommandTrigger": { - "enabled": False - } + "enabled": False, + "subscriptions": [] }, "api": { "enabled": False, @@ -179,7 +176,7 @@ class Settings(object): self._configfile = configfile else: self._configfile = os.path.join(self.settings_dir, "config.yaml") - self.load() + self.load(migrate=True) def _init_settings_dir(self, basedir): if basedir is not None: @@ -195,7 +192,7 @@ class Settings(object): #~~ load and save - def load(self): + def load(self, migrate=False): if os.path.exists(self._configfile) and os.path.isfile(self._configfile): with open(self._configfile, "r") as f: self._config = yaml.safe_load(f) @@ -203,6 +200,97 @@ class Settings(object): if not self._config: self._config = {} + if migrate: + self._migrateConfig() + + def _migrateConfig(self): + if not self._config: + return + + if "events" in self._config.keys() and ("gcodeCommandTrigger" in self._config["events"] or "systemCommandTrigger" in self._config["events"]): + self._logger.info("Migrating config (event subscriptions)...") + + # migrate event hooks to new format + placeholderRe = re.compile("%\((.*?)\)s") + + eventNameReplacements = { + "ClientOpen": "ClientOpened", + "TransferStart": "TransferStarted" + } + payloadDataReplacements = { + "Upload": {"data": "{file}", "filename": "{file}"}, + "Connected": {"data": "{port} at {baudrate} baud"}, + "FileSelected": {"data": "{file}", "filename": "{file}"}, + "TransferStarted": {"data": "{remote}", "filename": "{remote}"}, + "TransferDone": {"data": "{remote}", "filename": "{remote}"}, + "ZChange": {"data": "{new}"}, + "CaptureStart": {"data": "{file}"}, + "CaptureDone": {"data": "{file}"}, + "MovieDone": {"data": "{movie}", "filename": "{gcode}"}, + "Error": {"data": "{error}"}, + "PrintStarted": {"data": "{file}", "filename": "{file}"}, + "PrintDone": {"data": "{file}", "filename": "{file}"}, + } + + def migrateEventHook(event, command): + # migrate placeholders + command = placeholderRe.sub("{__\\1}", command) + + # migrate event names + if event in eventNameReplacements: + event = eventNameReplacements["event"] + + # migrate payloads to more specific placeholders + if event in payloadDataReplacements: + for key in payloadDataReplacements[event]: + command = command.replace("{__%s}" % key, payloadDataReplacements[event][key]) + + # return processed tuple + return event, command + + disableSystemCommands = False + if "systemCommandTrigger" in self._config["events"] and "enabled" in self._config["events"]["systemCommandTrigger"]: + disableSystemCommands = not self._config["events"]["systemCommandTrigger"]["enabled"] + + disableGcodeCommands = False + if "gcodeCommandTrigger" in self._config["events"] and "enabled" in self._config["events"]["gcodeCommandTrigger"]: + disableGcodeCommands = not self._config["events"]["gcodeCommandTrigger"]["enabled"] + + disableAllCommands = disableSystemCommands and disableGcodeCommands + newEvents = { + "enabled": not disableAllCommands, + "subscriptions": [] + } + + if "systemCommandTrigger" in self._config["events"] and "subscriptions" in self._config["events"]["systemCommandTrigger"]: + for trigger in self._config["events"]["systemCommandTrigger"]["subscriptions"]: + if not ("event" in trigger and "command" in trigger): + continue + + newTrigger = {"type": "system"} + if disableSystemCommands and not disableAllCommands: + newTrigger["enabled"] = False + + newTrigger["event"], newTrigger["command"] = migrateEventHook(trigger["event"], trigger["command"]) + newEvents["subscriptions"].append(newTrigger) + + if "gcodeCommandTrigger" in self._config["events"] and "subscriptions" in self._config["events"]["gcodeCommandTrigger"]: + for trigger in self._config["events"]["gcodeCommandTrigger"]["subscriptions"]: + if not ("event" in trigger and "command" in trigger): + continue + + newTrigger = {"type": "gcode"} + if disableGcodeCommands and not disableAllCommands: + newTrigger["enabled"] = False + + newTrigger["event"], newTrigger["command"] = migrateEventHook(trigger["event"], trigger["command"]) + newTrigger["command"] = newTrigger["command"].split(",") + newEvents["subscriptions"].append(newTrigger) + + self._config["events"] = newEvents + self.save(force=True) + self._logger.info("Migrated %d event subscriptions to new format and structure" % len(newEvents["subscriptions"])) + def save(self, force=False): if not self._dirty and not force: return diff --git a/src/octoprint/static/css/font-awesome.min.css b/src/octoprint/static/css/font-awesome.min.css index d4e45b3c9..866437fa4 100644 --- a/src/octoprint/static/css/font-awesome.min.css +++ b/src/octoprint/static/css/font-awesome.min.css @@ -1,33 +1,403 @@ -/*! - * Font Awesome 3.0.2 - * the iconic font designed for use with Twitter Bootstrap - * ------------------------------------------------------- - * The full suite of pictographic icons, examples, and documentation - * can be found at: http://fortawesome.github.com/Font-Awesome/ - * - * License - * ------------------------------------------------------- - * - The Font Awesome font is licensed under the SIL Open Font License - http://scripts.sil.org/OFL - * - Font Awesome CSS, LESS, and SASS files are licensed under the MIT License - - * http://opensource.org/licenses/mit-license.html - * - The Font Awesome pictograms are licensed under the CC BY 3.0 License - http://creativecommons.org/licenses/by/3.0/ - * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: - * "Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome" - - * Contact - * ------------------------------------------------------- - * Email: dave@davegandy.com - * Twitter: http://twitter.com/fortaweso_me - * Work: Lead Product Designer @ http://kyruus.com - */ - -@font-face{ - font-family:'FontAwesome'; - src:url('../font/fontawesome-webfont.eot?v=3.0.1'); - src:url('../font/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'), - url('../font/fontawesome-webfont.woff?v=3.0.1') format('woff'), - url('../font/fontawesome-webfont.ttf?v=3.0.1') format('truetype'); - font-weight:normal; - font-style:normal } - -[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0 0;background-repeat:repeat;margin-top:0}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none}[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none}a [class^="icon-"],a [class*=" icon-"]{display:inline-block}.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em}.btn [class^="icon-"],.nav [class^="icon-"],.btn [class*=" icon-"],.nav [class*=" icon-"]{display:inline}.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em}.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block}.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em}li [class^="icon-"],.nav li [class^="icon-"],li [class*=" icon-"],.nav li [class*=" icon-"]{display:inline-block;width:1.25em;text-align:center}li [class^="icon-"].icon-large,.nav li [class^="icon-"].icon-large,li [class*=" icon-"].icon-large,.nav li [class*=" icon-"].icon-large{width:1.5625em}ul.icons{list-style-type:none;text-indent:-0.75em}ul.icons li [class^="icon-"],ul.icons li [class*=" icon-"]{width:.75em}.icon-muted{color:#eee}.icon-border{border:solid 1px #eee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.icon-2x{font-size:2em}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.icon-3x{font-size:3em}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.icon-4x{font-size:4em}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.pull-right{float:right}.pull-left{float:left}[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em}[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em}.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em}.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em}.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em}.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em}.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em}.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}100%{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}100%{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}}@-moz-document url-prefix(){.icon-spin{height:.9em}.btn .icon-spin{height:auto}.icon-spin.icon-large{height:1.25em}.btn .icon-spin.icon-large{height:.75em}}.icon-glass:before{content:"\f000"}.icon-music:before{content:"\f001"}.icon-search:before{content:"\f002"}.icon-envelope:before{content:"\f003"}.icon-heart:before{content:"\f004"}.icon-star:before{content:"\f005"}.icon-star-empty:before{content:"\f006"}.icon-user:before{content:"\f007"}.icon-film:before{content:"\f008"}.icon-th-large:before{content:"\f009"}.icon-th:before{content:"\f00a"}.icon-th-list:before{content:"\f00b"}.icon-ok:before{content:"\f00c"}.icon-remove:before{content:"\f00d"}.icon-zoom-in:before{content:"\f00e"}.icon-zoom-out:before{content:"\f010"}.icon-off:before{content:"\f011"}.icon-signal:before{content:"\f012"}.icon-cog:before{content:"\f013"}.icon-trash:before{content:"\f014"}.icon-home:before{content:"\f015"}.icon-file:before{content:"\f016"}.icon-time:before{content:"\f017"}.icon-road:before{content:"\f018"}.icon-download-alt:before{content:"\f019"}.icon-download:before{content:"\f01a"}.icon-upload:before{content:"\f01b"}.icon-inbox:before{content:"\f01c"}.icon-play-circle:before{content:"\f01d"}.icon-repeat:before{content:"\f01e"}.icon-refresh:before{content:"\f021"}.icon-list-alt:before{content:"\f022"}.icon-lock:before{content:"\f023"}.icon-flag:before{content:"\f024"}.icon-headphones:before{content:"\f025"}.icon-volume-off:before{content:"\f026"}.icon-volume-down:before{content:"\f027"}.icon-volume-up:before{content:"\f028"}.icon-qrcode:before{content:"\f029"}.icon-barcode:before{content:"\f02a"}.icon-tag:before{content:"\f02b"}.icon-tags:before{content:"\f02c"}.icon-book:before{content:"\f02d"}.icon-bookmark:before{content:"\f02e"}.icon-print:before{content:"\f02f"}.icon-camera:before{content:"\f030"}.icon-font:before{content:"\f031"}.icon-bold:before{content:"\f032"}.icon-italic:before{content:"\f033"}.icon-text-height:before{content:"\f034"}.icon-text-width:before{content:"\f035"}.icon-align-left:before{content:"\f036"}.icon-align-center:before{content:"\f037"}.icon-align-right:before{content:"\f038"}.icon-align-justify:before{content:"\f039"}.icon-list:before{content:"\f03a"}.icon-indent-left:before{content:"\f03b"}.icon-indent-right:before{content:"\f03c"}.icon-facetime-video:before{content:"\f03d"}.icon-picture:before{content:"\f03e"}.icon-pencil:before{content:"\f040"}.icon-map-marker:before{content:"\f041"}.icon-adjust:before{content:"\f042"}.icon-tint:before{content:"\f043"}.icon-edit:before{content:"\f044"}.icon-share:before{content:"\f045"}.icon-check:before{content:"\f046"}.icon-move:before{content:"\f047"}.icon-step-backward:before{content:"\f048"}.icon-fast-backward:before{content:"\f049"}.icon-backward:before{content:"\f04a"}.icon-play:before{content:"\f04b"}.icon-pause:before{content:"\f04c"}.icon-stop:before{content:"\f04d"}.icon-forward:before{content:"\f04e"}.icon-fast-forward:before{content:"\f050"}.icon-step-forward:before{content:"\f051"}.icon-eject:before{content:"\f052"}.icon-chevron-left:before{content:"\f053"}.icon-chevron-right:before{content:"\f054"}.icon-plus-sign:before{content:"\f055"}.icon-minus-sign:before{content:"\f056"}.icon-remove-sign:before{content:"\f057"}.icon-ok-sign:before{content:"\f058"}.icon-question-sign:before{content:"\f059"}.icon-info-sign:before{content:"\f05a"}.icon-screenshot:before{content:"\f05b"}.icon-remove-circle:before{content:"\f05c"}.icon-ok-circle:before{content:"\f05d"}.icon-ban-circle:before{content:"\f05e"}.icon-arrow-left:before{content:"\f060"}.icon-arrow-right:before{content:"\f061"}.icon-arrow-up:before{content:"\f062"}.icon-arrow-down:before{content:"\f063"}.icon-share-alt:before{content:"\f064"}.icon-resize-full:before{content:"\f065"}.icon-resize-small:before{content:"\f066"}.icon-plus:before{content:"\f067"}.icon-minus:before{content:"\f068"}.icon-asterisk:before{content:"\f069"}.icon-exclamation-sign:before{content:"\f06a"}.icon-gift:before{content:"\f06b"}.icon-leaf:before{content:"\f06c"}.icon-fire:before{content:"\f06d"}.icon-eye-open:before{content:"\f06e"}.icon-eye-close:before{content:"\f070"}.icon-warning-sign:before{content:"\f071"}.icon-plane:before{content:"\f072"}.icon-calendar:before{content:"\f073"}.icon-random:before{content:"\f074"}.icon-comment:before{content:"\f075"}.icon-magnet:before{content:"\f076"}.icon-chevron-up:before{content:"\f077"}.icon-chevron-down:before{content:"\f078"}.icon-retweet:before{content:"\f079"}.icon-shopping-cart:before{content:"\f07a"}.icon-folder-close:before{content:"\f07b"}.icon-folder-open:before{content:"\f07c"}.icon-resize-vertical:before{content:"\f07d"}.icon-resize-horizontal:before{content:"\f07e"}.icon-bar-chart:before{content:"\f080"}.icon-twitter-sign:before{content:"\f081"}.icon-facebook-sign:before{content:"\f082"}.icon-camera-retro:before{content:"\f083"}.icon-key:before{content:"\f084"}.icon-cogs:before{content:"\f085"}.icon-comments:before{content:"\f086"}.icon-thumbs-up:before{content:"\f087"}.icon-thumbs-down:before{content:"\f088"}.icon-star-half:before{content:"\f089"}.icon-heart-empty:before{content:"\f08a"}.icon-signout:before{content:"\f08b"}.icon-linkedin-sign:before{content:"\f08c"}.icon-pushpin:before{content:"\f08d"}.icon-external-link:before{content:"\f08e"}.icon-signin:before{content:"\f090"}.icon-trophy:before{content:"\f091"}.icon-github-sign:before{content:"\f092"}.icon-upload-alt:before{content:"\f093"}.icon-lemon:before{content:"\f094"}.icon-phone:before{content:"\f095"}.icon-check-empty:before{content:"\f096"}.icon-bookmark-empty:before{content:"\f097"}.icon-phone-sign:before{content:"\f098"}.icon-twitter:before{content:"\f099"}.icon-facebook:before{content:"\f09a"}.icon-github:before{content:"\f09b"}.icon-unlock:before{content:"\f09c"}.icon-credit-card:before{content:"\f09d"}.icon-rss:before{content:"\f09e"}.icon-hdd:before{content:"\f0a0"}.icon-bullhorn:before{content:"\f0a1"}.icon-bell:before{content:"\f0a2"}.icon-certificate:before{content:"\f0a3"}.icon-hand-right:before{content:"\f0a4"}.icon-hand-left:before{content:"\f0a5"}.icon-hand-up:before{content:"\f0a6"}.icon-hand-down:before{content:"\f0a7"}.icon-circle-arrow-left:before{content:"\f0a8"}.icon-circle-arrow-right:before{content:"\f0a9"}.icon-circle-arrow-up:before{content:"\f0aa"}.icon-circle-arrow-down:before{content:"\f0ab"}.icon-globe:before{content:"\f0ac"}.icon-wrench:before{content:"\f0ad"}.icon-tasks:before{content:"\f0ae"}.icon-filter:before{content:"\f0b0"}.icon-briefcase:before{content:"\f0b1"}.icon-fullscreen:before{content:"\f0b2"}.icon-group:before{content:"\f0c0"}.icon-link:before{content:"\f0c1"}.icon-cloud:before{content:"\f0c2"}.icon-beaker:before{content:"\f0c3"}.icon-cut:before{content:"\f0c4"}.icon-copy:before{content:"\f0c5"}.icon-paper-clip:before{content:"\f0c6"}.icon-save:before{content:"\f0c7"}.icon-sign-blank:before{content:"\f0c8"}.icon-reorder:before{content:"\f0c9"}.icon-list-ul:before{content:"\f0ca"}.icon-list-ol:before{content:"\f0cb"}.icon-strikethrough:before{content:"\f0cc"}.icon-underline:before{content:"\f0cd"}.icon-table:before{content:"\f0ce"}.icon-magic:before{content:"\f0d0"}.icon-truck:before{content:"\f0d1"}.icon-pinterest:before{content:"\f0d2"}.icon-pinterest-sign:before{content:"\f0d3"}.icon-google-plus-sign:before{content:"\f0d4"}.icon-google-plus:before{content:"\f0d5"}.icon-money:before{content:"\f0d6"}.icon-caret-down:before{content:"\f0d7"}.icon-caret-up:before{content:"\f0d8"}.icon-caret-left:before{content:"\f0d9"}.icon-caret-right:before{content:"\f0da"}.icon-columns:before{content:"\f0db"}.icon-sort:before{content:"\f0dc"}.icon-sort-down:before{content:"\f0dd"}.icon-sort-up:before{content:"\f0de"}.icon-envelope-alt:before{content:"\f0e0"}.icon-linkedin:before{content:"\f0e1"}.icon-undo:before{content:"\f0e2"}.icon-legal:before{content:"\f0e3"}.icon-dashboard:before{content:"\f0e4"}.icon-comment-alt:before{content:"\f0e5"}.icon-comments-alt:before{content:"\f0e6"}.icon-bolt:before{content:"\f0e7"}.icon-sitemap:before{content:"\f0e8"}.icon-umbrella:before{content:"\f0e9"}.icon-paste:before{content:"\f0ea"}.icon-lightbulb:before{content:"\f0eb"}.icon-exchange:before{content:"\f0ec"}.icon-cloud-download:before{content:"\f0ed"}.icon-cloud-upload:before{content:"\f0ee"}.icon-user-md:before{content:"\f0f0"}.icon-stethoscope:before{content:"\f0f1"}.icon-suitcase:before{content:"\f0f2"}.icon-bell-alt:before{content:"\f0f3"}.icon-coffee:before{content:"\f0f4"}.icon-food:before{content:"\f0f5"}.icon-file-alt:before{content:"\f0f6"}.icon-building:before{content:"\f0f7"}.icon-hospital:before{content:"\f0f8"}.icon-ambulance:before{content:"\f0f9"}.icon-medkit:before{content:"\f0fa"}.icon-fighter-jet:before{content:"\f0fb"}.icon-beer:before{content:"\f0fc"}.icon-h-sign:before{content:"\f0fd"}.icon-plus-sign-alt:before{content:"\f0fe"}.icon-double-angle-left:before{content:"\f100"}.icon-double-angle-right:before{content:"\f101"}.icon-double-angle-up:before{content:"\f102"}.icon-double-angle-down:before{content:"\f103"}.icon-angle-left:before{content:"\f104"}.icon-angle-right:before{content:"\f105"}.icon-angle-up:before{content:"\f106"}.icon-angle-down:before{content:"\f107"}.icon-desktop:before{content:"\f108"}.icon-laptop:before{content:"\f109"}.icon-tablet:before{content:"\f10a"}.icon-mobile-phone:before{content:"\f10b"}.icon-circle-blank:before{content:"\f10c"}.icon-quote-left:before{content:"\f10d"}.icon-quote-right:before{content:"\f10e"}.icon-spinner:before{content:"\f110"}.icon-circle:before{content:"\f111"}.icon-reply:before{content:"\f112"}.icon-github-alt:before{content:"\f113"}.icon-folder-close-alt:before{content:"\f114"}.icon-folder-open-alt:before{content:"\f115"} \ No newline at end of file +@font-face{font-family:'FontAwesome';src:url('../font/fontawesome-webfont.eot?v=3.2.1');src:url('../font/fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'),url('../font/fontawesome-webfont.woff?v=3.2.1') format('woff'),url('../font/fontawesome-webfont.ttf?v=3.2.1') format('truetype'),url('../font/fontawesome-webfont.svg#fontawesomeregular?v=3.2.1') format('svg');font-weight:normal;font-style:normal;}[class^="icon-"],[class*=" icon-"]{font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;} +[class^="icon-"]:before,[class*=" icon-"]:before{text-decoration:inherit;display:inline-block;speak:none;} +.icon-large:before{vertical-align:-10%;font-size:1.3333333333333333em;} +a [class^="icon-"],a [class*=" icon-"]{display:inline;} +[class^="icon-"].icon-fixed-width,[class*=" icon-"].icon-fixed-width{display:inline-block;width:1.1428571428571428em;text-align:right;padding-right:0.2857142857142857em;}[class^="icon-"].icon-fixed-width.icon-large,[class*=" icon-"].icon-fixed-width.icon-large{width:1.4285714285714286em;} +.icons-ul{margin-left:2.142857142857143em;list-style-type:none;}.icons-ul>li{position:relative;} +.icons-ul .icon-li{position:absolute;left:-2.142857142857143em;width:2.142857142857143em;text-align:center;line-height:inherit;} +[class^="icon-"].hide,[class*=" icon-"].hide{display:none;} +.icon-muted{color:#eeeeee;} +.icon-light{color:#ffffff;} +.icon-dark{color:#333333;} +.icon-border{border:solid 1px #eeeeee;padding:.2em .25em .15em;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.icon-2x{font-size:2em;}.icon-2x.icon-border{border-width:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} +.icon-3x{font-size:3em;}.icon-3x.icon-border{border-width:3px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;} +.icon-4x{font-size:4em;}.icon-4x.icon-border{border-width:4px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;} +.icon-5x{font-size:5em;}.icon-5x.icon-border{border-width:5px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;} +.pull-right{float:right;} +.pull-left{float:left;} +[class^="icon-"].pull-left,[class*=" icon-"].pull-left{margin-right:.3em;} +[class^="icon-"].pull-right,[class*=" icon-"].pull-right{margin-left:.3em;} +[class^="icon-"],[class*=" icon-"]{display:inline;width:auto;height:auto;line-height:normal;vertical-align:baseline;background-image:none;background-position:0% 0%;background-repeat:repeat;margin-top:0;} +.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:none;} +.btn [class^="icon-"].icon-large,.nav [class^="icon-"].icon-large,.btn [class*=" icon-"].icon-large,.nav [class*=" icon-"].icon-large{line-height:.9em;} +.btn [class^="icon-"].icon-spin,.nav [class^="icon-"].icon-spin,.btn [class*=" icon-"].icon-spin,.nav [class*=" icon-"].icon-spin{display:inline-block;} +.nav-tabs [class^="icon-"],.nav-pills [class^="icon-"],.nav-tabs [class*=" icon-"],.nav-pills [class*=" icon-"],.nav-tabs [class^="icon-"].icon-large,.nav-pills [class^="icon-"].icon-large,.nav-tabs [class*=" icon-"].icon-large,.nav-pills [class*=" icon-"].icon-large{line-height:.9em;} +.btn [class^="icon-"].pull-left.icon-2x,.btn [class*=" icon-"].pull-left.icon-2x,.btn [class^="icon-"].pull-right.icon-2x,.btn [class*=" icon-"].pull-right.icon-2x{margin-top:.18em;} +.btn [class^="icon-"].icon-spin.icon-large,.btn [class*=" icon-"].icon-spin.icon-large{line-height:.8em;} +.btn.btn-small [class^="icon-"].pull-left.icon-2x,.btn.btn-small [class*=" icon-"].pull-left.icon-2x,.btn.btn-small [class^="icon-"].pull-right.icon-2x,.btn.btn-small [class*=" icon-"].pull-right.icon-2x{margin-top:.25em;} +.btn.btn-large [class^="icon-"],.btn.btn-large [class*=" icon-"]{margin-top:0;}.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x,.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-top:.05em;} +.btn.btn-large [class^="icon-"].pull-left.icon-2x,.btn.btn-large [class*=" icon-"].pull-left.icon-2x{margin-right:.2em;} +.btn.btn-large [class^="icon-"].pull-right.icon-2x,.btn.btn-large [class*=" icon-"].pull-right.icon-2x{margin-left:.2em;} +.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{line-height:inherit;} +.icon-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:-35%;}.icon-stack [class^="icon-"],.icon-stack [class*=" icon-"]{display:block;text-align:center;position:absolute;width:100%;height:100%;font-size:1em;line-height:inherit;*line-height:2em;} +.icon-stack .icon-stack-base{font-size:2em;*line-height:1em;} +.icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;} +a .icon-stack,a .icon-spin{display:inline-block;text-decoration:none;} +@-moz-keyframes spin{0%{-moz-transform:rotate(0deg);} 100%{-moz-transform:rotate(359deg);}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);} 100%{-webkit-transform:rotate(359deg);}}@-o-keyframes spin{0%{-o-transform:rotate(0deg);} 100%{-o-transform:rotate(359deg);}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg);} 100%{-ms-transform:rotate(359deg);}}@keyframes spin{0%{transform:rotate(0deg);} 100%{transform:rotate(359deg);}}.icon-rotate-90:before{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);} +.icon-rotate-180:before{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);} +.icon-rotate-270:before{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);} +.icon-flip-horizontal:before{-webkit-transform:scale(-1, 1);-moz-transform:scale(-1, 1);-ms-transform:scale(-1, 1);-o-transform:scale(-1, 1);transform:scale(-1, 1);} +.icon-flip-vertical:before{-webkit-transform:scale(1, -1);-moz-transform:scale(1, -1);-ms-transform:scale(1, -1);-o-transform:scale(1, -1);transform:scale(1, -1);} +a .icon-rotate-90:before,a .icon-rotate-180:before,a .icon-rotate-270:before,a .icon-flip-horizontal:before,a .icon-flip-vertical:before{display:inline-block;} +.icon-glass:before{content:"\f000";} +.icon-music:before{content:"\f001";} +.icon-search:before{content:"\f002";} +.icon-envelope-alt:before{content:"\f003";} +.icon-heart:before{content:"\f004";} +.icon-star:before{content:"\f005";} +.icon-star-empty:before{content:"\f006";} +.icon-user:before{content:"\f007";} +.icon-film:before{content:"\f008";} +.icon-th-large:before{content:"\f009";} +.icon-th:before{content:"\f00a";} +.icon-th-list:before{content:"\f00b";} +.icon-ok:before{content:"\f00c";} +.icon-remove:before{content:"\f00d";} +.icon-zoom-in:before{content:"\f00e";} +.icon-zoom-out:before{content:"\f010";} +.icon-power-off:before,.icon-off:before{content:"\f011";} +.icon-signal:before{content:"\f012";} +.icon-gear:before,.icon-cog:before{content:"\f013";} +.icon-trash:before{content:"\f014";} +.icon-home:before{content:"\f015";} +.icon-file-alt:before{content:"\f016";} +.icon-time:before{content:"\f017";} +.icon-road:before{content:"\f018";} +.icon-download-alt:before{content:"\f019";} +.icon-download:before{content:"\f01a";} +.icon-upload:before{content:"\f01b";} +.icon-inbox:before{content:"\f01c";} +.icon-play-circle:before{content:"\f01d";} +.icon-rotate-right:before,.icon-repeat:before{content:"\f01e";} +.icon-refresh:before{content:"\f021";} +.icon-list-alt:before{content:"\f022";} +.icon-lock:before{content:"\f023";} +.icon-flag:before{content:"\f024";} +.icon-headphones:before{content:"\f025";} +.icon-volume-off:before{content:"\f026";} +.icon-volume-down:before{content:"\f027";} +.icon-volume-up:before{content:"\f028";} +.icon-qrcode:before{content:"\f029";} +.icon-barcode:before{content:"\f02a";} +.icon-tag:before{content:"\f02b";} +.icon-tags:before{content:"\f02c";} +.icon-book:before{content:"\f02d";} +.icon-bookmark:before{content:"\f02e";} +.icon-print:before{content:"\f02f";} +.icon-camera:before{content:"\f030";} +.icon-font:before{content:"\f031";} +.icon-bold:before{content:"\f032";} +.icon-italic:before{content:"\f033";} +.icon-text-height:before{content:"\f034";} +.icon-text-width:before{content:"\f035";} +.icon-align-left:before{content:"\f036";} +.icon-align-center:before{content:"\f037";} +.icon-align-right:before{content:"\f038";} +.icon-align-justify:before{content:"\f039";} +.icon-list:before{content:"\f03a";} +.icon-indent-left:before{content:"\f03b";} +.icon-indent-right:before{content:"\f03c";} +.icon-facetime-video:before{content:"\f03d";} +.icon-picture:before{content:"\f03e";} +.icon-pencil:before{content:"\f040";} +.icon-map-marker:before{content:"\f041";} +.icon-adjust:before{content:"\f042";} +.icon-tint:before{content:"\f043";} +.icon-edit:before{content:"\f044";} +.icon-share:before{content:"\f045";} +.icon-check:before{content:"\f046";} +.icon-move:before{content:"\f047";} +.icon-step-backward:before{content:"\f048";} +.icon-fast-backward:before{content:"\f049";} +.icon-backward:before{content:"\f04a";} +.icon-play:before{content:"\f04b";} +.icon-pause:before{content:"\f04c";} +.icon-stop:before{content:"\f04d";} +.icon-forward:before{content:"\f04e";} +.icon-fast-forward:before{content:"\f050";} +.icon-step-forward:before{content:"\f051";} +.icon-eject:before{content:"\f052";} +.icon-chevron-left:before{content:"\f053";} +.icon-chevron-right:before{content:"\f054";} +.icon-plus-sign:before{content:"\f055";} +.icon-minus-sign:before{content:"\f056";} +.icon-remove-sign:before{content:"\f057";} +.icon-ok-sign:before{content:"\f058";} +.icon-question-sign:before{content:"\f059";} +.icon-info-sign:before{content:"\f05a";} +.icon-screenshot:before{content:"\f05b";} +.icon-remove-circle:before{content:"\f05c";} +.icon-ok-circle:before{content:"\f05d";} +.icon-ban-circle:before{content:"\f05e";} +.icon-arrow-left:before{content:"\f060";} +.icon-arrow-right:before{content:"\f061";} +.icon-arrow-up:before{content:"\f062";} +.icon-arrow-down:before{content:"\f063";} +.icon-mail-forward:before,.icon-share-alt:before{content:"\f064";} +.icon-resize-full:before{content:"\f065";} +.icon-resize-small:before{content:"\f066";} +.icon-plus:before{content:"\f067";} +.icon-minus:before{content:"\f068";} +.icon-asterisk:before{content:"\f069";} +.icon-exclamation-sign:before{content:"\f06a";} +.icon-gift:before{content:"\f06b";} +.icon-leaf:before{content:"\f06c";} +.icon-fire:before{content:"\f06d";} +.icon-eye-open:before{content:"\f06e";} +.icon-eye-close:before{content:"\f070";} +.icon-warning-sign:before{content:"\f071";} +.icon-plane:before{content:"\f072";} +.icon-calendar:before{content:"\f073";} +.icon-random:before{content:"\f074";} +.icon-comment:before{content:"\f075";} +.icon-magnet:before{content:"\f076";} +.icon-chevron-up:before{content:"\f077";} +.icon-chevron-down:before{content:"\f078";} +.icon-retweet:before{content:"\f079";} +.icon-shopping-cart:before{content:"\f07a";} +.icon-folder-close:before{content:"\f07b";} +.icon-folder-open:before{content:"\f07c";} +.icon-resize-vertical:before{content:"\f07d";} +.icon-resize-horizontal:before{content:"\f07e";} +.icon-bar-chart:before{content:"\f080";} +.icon-twitter-sign:before{content:"\f081";} +.icon-facebook-sign:before{content:"\f082";} +.icon-camera-retro:before{content:"\f083";} +.icon-key:before{content:"\f084";} +.icon-gears:before,.icon-cogs:before{content:"\f085";} +.icon-comments:before{content:"\f086";} +.icon-thumbs-up-alt:before{content:"\f087";} +.icon-thumbs-down-alt:before{content:"\f088";} +.icon-star-half:before{content:"\f089";} +.icon-heart-empty:before{content:"\f08a";} +.icon-signout:before{content:"\f08b";} +.icon-linkedin-sign:before{content:"\f08c";} +.icon-pushpin:before{content:"\f08d";} +.icon-external-link:before{content:"\f08e";} +.icon-signin:before{content:"\f090";} +.icon-trophy:before{content:"\f091";} +.icon-github-sign:before{content:"\f092";} +.icon-upload-alt:before{content:"\f093";} +.icon-lemon:before{content:"\f094";} +.icon-phone:before{content:"\f095";} +.icon-unchecked:before,.icon-check-empty:before{content:"\f096";} +.icon-bookmark-empty:before{content:"\f097";} +.icon-phone-sign:before{content:"\f098";} +.icon-twitter:before{content:"\f099";} +.icon-facebook:before{content:"\f09a";} +.icon-github:before{content:"\f09b";} +.icon-unlock:before{content:"\f09c";} +.icon-credit-card:before{content:"\f09d";} +.icon-rss:before{content:"\f09e";} +.icon-hdd:before{content:"\f0a0";} +.icon-bullhorn:before{content:"\f0a1";} +.icon-bell:before{content:"\f0a2";} +.icon-certificate:before{content:"\f0a3";} +.icon-hand-right:before{content:"\f0a4";} +.icon-hand-left:before{content:"\f0a5";} +.icon-hand-up:before{content:"\f0a6";} +.icon-hand-down:before{content:"\f0a7";} +.icon-circle-arrow-left:before{content:"\f0a8";} +.icon-circle-arrow-right:before{content:"\f0a9";} +.icon-circle-arrow-up:before{content:"\f0aa";} +.icon-circle-arrow-down:before{content:"\f0ab";} +.icon-globe:before{content:"\f0ac";} +.icon-wrench:before{content:"\f0ad";} +.icon-tasks:before{content:"\f0ae";} +.icon-filter:before{content:"\f0b0";} +.icon-briefcase:before{content:"\f0b1";} +.icon-fullscreen:before{content:"\f0b2";} +.icon-group:before{content:"\f0c0";} +.icon-link:before{content:"\f0c1";} +.icon-cloud:before{content:"\f0c2";} +.icon-beaker:before{content:"\f0c3";} +.icon-cut:before{content:"\f0c4";} +.icon-copy:before{content:"\f0c5";} +.icon-paperclip:before,.icon-paper-clip:before{content:"\f0c6";} +.icon-save:before{content:"\f0c7";} +.icon-sign-blank:before{content:"\f0c8";} +.icon-reorder:before{content:"\f0c9";} +.icon-list-ul:before{content:"\f0ca";} +.icon-list-ol:before{content:"\f0cb";} +.icon-strikethrough:before{content:"\f0cc";} +.icon-underline:before{content:"\f0cd";} +.icon-table:before{content:"\f0ce";} +.icon-magic:before{content:"\f0d0";} +.icon-truck:before{content:"\f0d1";} +.icon-pinterest:before{content:"\f0d2";} +.icon-pinterest-sign:before{content:"\f0d3";} +.icon-google-plus-sign:before{content:"\f0d4";} +.icon-google-plus:before{content:"\f0d5";} +.icon-money:before{content:"\f0d6";} +.icon-caret-down:before{content:"\f0d7";} +.icon-caret-up:before{content:"\f0d8";} +.icon-caret-left:before{content:"\f0d9";} +.icon-caret-right:before{content:"\f0da";} +.icon-columns:before{content:"\f0db";} +.icon-sort:before{content:"\f0dc";} +.icon-sort-down:before{content:"\f0dd";} +.icon-sort-up:before{content:"\f0de";} +.icon-envelope:before{content:"\f0e0";} +.icon-linkedin:before{content:"\f0e1";} +.icon-rotate-left:before,.icon-undo:before{content:"\f0e2";} +.icon-legal:before{content:"\f0e3";} +.icon-dashboard:before{content:"\f0e4";} +.icon-comment-alt:before{content:"\f0e5";} +.icon-comments-alt:before{content:"\f0e6";} +.icon-bolt:before{content:"\f0e7";} +.icon-sitemap:before{content:"\f0e8";} +.icon-umbrella:before{content:"\f0e9";} +.icon-paste:before{content:"\f0ea";} +.icon-lightbulb:before{content:"\f0eb";} +.icon-exchange:before{content:"\f0ec";} +.icon-cloud-download:before{content:"\f0ed";} +.icon-cloud-upload:before{content:"\f0ee";} +.icon-user-md:before{content:"\f0f0";} +.icon-stethoscope:before{content:"\f0f1";} +.icon-suitcase:before{content:"\f0f2";} +.icon-bell-alt:before{content:"\f0f3";} +.icon-coffee:before{content:"\f0f4";} +.icon-food:before{content:"\f0f5";} +.icon-file-text-alt:before{content:"\f0f6";} +.icon-building:before{content:"\f0f7";} +.icon-hospital:before{content:"\f0f8";} +.icon-ambulance:before{content:"\f0f9";} +.icon-medkit:before{content:"\f0fa";} +.icon-fighter-jet:before{content:"\f0fb";} +.icon-beer:before{content:"\f0fc";} +.icon-h-sign:before{content:"\f0fd";} +.icon-plus-sign-alt:before{content:"\f0fe";} +.icon-double-angle-left:before{content:"\f100";} +.icon-double-angle-right:before{content:"\f101";} +.icon-double-angle-up:before{content:"\f102";} +.icon-double-angle-down:before{content:"\f103";} +.icon-angle-left:before{content:"\f104";} +.icon-angle-right:before{content:"\f105";} +.icon-angle-up:before{content:"\f106";} +.icon-angle-down:before{content:"\f107";} +.icon-desktop:before{content:"\f108";} +.icon-laptop:before{content:"\f109";} +.icon-tablet:before{content:"\f10a";} +.icon-mobile-phone:before{content:"\f10b";} +.icon-circle-blank:before{content:"\f10c";} +.icon-quote-left:before{content:"\f10d";} +.icon-quote-right:before{content:"\f10e";} +.icon-spinner:before{content:"\f110";} +.icon-circle:before{content:"\f111";} +.icon-mail-reply:before,.icon-reply:before{content:"\f112";} +.icon-github-alt:before{content:"\f113";} +.icon-folder-close-alt:before{content:"\f114";} +.icon-folder-open-alt:before{content:"\f115";} +.icon-expand-alt:before{content:"\f116";} +.icon-collapse-alt:before{content:"\f117";} +.icon-smile:before{content:"\f118";} +.icon-frown:before{content:"\f119";} +.icon-meh:before{content:"\f11a";} +.icon-gamepad:before{content:"\f11b";} +.icon-keyboard:before{content:"\f11c";} +.icon-flag-alt:before{content:"\f11d";} +.icon-flag-checkered:before{content:"\f11e";} +.icon-terminal:before{content:"\f120";} +.icon-code:before{content:"\f121";} +.icon-reply-all:before{content:"\f122";} +.icon-mail-reply-all:before{content:"\f122";} +.icon-star-half-full:before,.icon-star-half-empty:before{content:"\f123";} +.icon-location-arrow:before{content:"\f124";} +.icon-crop:before{content:"\f125";} +.icon-code-fork:before{content:"\f126";} +.icon-unlink:before{content:"\f127";} +.icon-question:before{content:"\f128";} +.icon-info:before{content:"\f129";} +.icon-exclamation:before{content:"\f12a";} +.icon-superscript:before{content:"\f12b";} +.icon-subscript:before{content:"\f12c";} +.icon-eraser:before{content:"\f12d";} +.icon-puzzle-piece:before{content:"\f12e";} +.icon-microphone:before{content:"\f130";} +.icon-microphone-off:before{content:"\f131";} +.icon-shield:before{content:"\f132";} +.icon-calendar-empty:before{content:"\f133";} +.icon-fire-extinguisher:before{content:"\f134";} +.icon-rocket:before{content:"\f135";} +.icon-maxcdn:before{content:"\f136";} +.icon-chevron-sign-left:before{content:"\f137";} +.icon-chevron-sign-right:before{content:"\f138";} +.icon-chevron-sign-up:before{content:"\f139";} +.icon-chevron-sign-down:before{content:"\f13a";} +.icon-html5:before{content:"\f13b";} +.icon-css3:before{content:"\f13c";} +.icon-anchor:before{content:"\f13d";} +.icon-unlock-alt:before{content:"\f13e";} +.icon-bullseye:before{content:"\f140";} +.icon-ellipsis-horizontal:before{content:"\f141";} +.icon-ellipsis-vertical:before{content:"\f142";} +.icon-rss-sign:before{content:"\f143";} +.icon-play-sign:before{content:"\f144";} +.icon-ticket:before{content:"\f145";} +.icon-minus-sign-alt:before{content:"\f146";} +.icon-check-minus:before{content:"\f147";} +.icon-level-up:before{content:"\f148";} +.icon-level-down:before{content:"\f149";} +.icon-check-sign:before{content:"\f14a";} +.icon-edit-sign:before{content:"\f14b";} +.icon-external-link-sign:before{content:"\f14c";} +.icon-share-sign:before{content:"\f14d";} +.icon-compass:before{content:"\f14e";} +.icon-collapse:before{content:"\f150";} +.icon-collapse-top:before{content:"\f151";} +.icon-expand:before{content:"\f152";} +.icon-euro:before,.icon-eur:before{content:"\f153";} +.icon-gbp:before{content:"\f154";} +.icon-dollar:before,.icon-usd:before{content:"\f155";} +.icon-rupee:before,.icon-inr:before{content:"\f156";} +.icon-yen:before,.icon-jpy:before{content:"\f157";} +.icon-renminbi:before,.icon-cny:before{content:"\f158";} +.icon-won:before,.icon-krw:before{content:"\f159";} +.icon-bitcoin:before,.icon-btc:before{content:"\f15a";} +.icon-file:before{content:"\f15b";} +.icon-file-text:before{content:"\f15c";} +.icon-sort-by-alphabet:before{content:"\f15d";} +.icon-sort-by-alphabet-alt:before{content:"\f15e";} +.icon-sort-by-attributes:before{content:"\f160";} +.icon-sort-by-attributes-alt:before{content:"\f161";} +.icon-sort-by-order:before{content:"\f162";} +.icon-sort-by-order-alt:before{content:"\f163";} +.icon-thumbs-up:before{content:"\f164";} +.icon-thumbs-down:before{content:"\f165";} +.icon-youtube-sign:before{content:"\f166";} +.icon-youtube:before{content:"\f167";} +.icon-xing:before{content:"\f168";} +.icon-xing-sign:before{content:"\f169";} +.icon-youtube-play:before{content:"\f16a";} +.icon-dropbox:before{content:"\f16b";} +.icon-stackexchange:before{content:"\f16c";} +.icon-instagram:before{content:"\f16d";} +.icon-flickr:before{content:"\f16e";} +.icon-adn:before{content:"\f170";} +.icon-bitbucket:before{content:"\f171";} +.icon-bitbucket-sign:before{content:"\f172";} +.icon-tumblr:before{content:"\f173";} +.icon-tumblr-sign:before{content:"\f174";} +.icon-long-arrow-down:before{content:"\f175";} +.icon-long-arrow-up:before{content:"\f176";} +.icon-long-arrow-left:before{content:"\f177";} +.icon-long-arrow-right:before{content:"\f178";} +.icon-apple:before{content:"\f179";} +.icon-windows:before{content:"\f17a";} +.icon-android:before{content:"\f17b";} +.icon-linux:before{content:"\f17c";} +.icon-dribbble:before{content:"\f17d";} +.icon-skype:before{content:"\f17e";} +.icon-foursquare:before{content:"\f180";} +.icon-trello:before{content:"\f181";} +.icon-female:before{content:"\f182";} +.icon-male:before{content:"\f183";} +.icon-gittip:before{content:"\f184";} +.icon-sun:before{content:"\f185";} +.icon-moon:before{content:"\f186";} +.icon-archive:before{content:"\f187";} +.icon-bug:before{content:"\f188";} +.icon-vk:before{content:"\f189";} +.icon-weibo:before{content:"\f18a";} +.icon-renren:before{content:"\f18b";} diff --git a/src/octoprint/static/css/jquery.pnotify.default.css b/src/octoprint/static/css/jquery.pnotify.default.css deleted file mode 100644 index de1068aab..000000000 --- a/src/octoprint/static/css/jquery.pnotify.default.css +++ /dev/null @@ -1,83 +0,0 @@ -/* -Document : jquery.pnotify.default.css -Created on : Nov 23, 2009, 3:14:10 PM -Author : Hunter Perrin -Version : 1.2.0 -Link : http://pinesframework.org/pnotify/ -Description: - Default styling for Pines Notify jQuery plugin. -*/ -/* -- Notice */ -.ui-pnotify { -top: 25px; -right: 25px; -position: absolute; -height: auto; -/* Ensures notices are above everything */ -z-index: 9999; -} -/* Hides position: fixed from IE6 */ -html > body .ui-pnotify { -position: fixed; -} -.ui-pnotify .ui-pnotify-shadow { --webkit-box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.5); --moz-box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.5); -box-shadow: 0px 2px 10px rgba(50, 50, 50, 0.5); -} -.ui-pnotify-container { -background-position: 0 0; -padding: .8em; -height: 100%; -margin: 0; -} -.ui-pnotify-sharp { --webkit-border-radius: 0; --moz-border-radius: 0; -border-radius: 0; -} -.ui-pnotify-closer, .ui-pnotify-sticker { -float: right; -margin-left: .2em; -} -.ui-pnotify-title { -display: block; -margin-bottom: .4em; -} -.ui-pnotify-text { -display: block; -} -.ui-pnotify-icon, .ui-pnotify-icon span { -display: block; -float: left; -margin-right: .2em; -} -/* -- History Pulldown */ -.ui-pnotify-history-container { -position: absolute; -top: 0; -right: 18px; -width: 70px; -border-top: none; -padding: 0; --webkit-border-top-left-radius: 0; --moz-border-top-left-radius: 0; -border-top-left-radius: 0; --webkit-border-top-right-radius: 0; --moz-border-top-right-radius: 0; -border-top-right-radius: 0; -/* Ensures history container is above notices. */ -z-index: 10000; -} -.ui-pnotify-history-container .ui-pnotify-history-header { -padding: 2px; -} -.ui-pnotify-history-container button { -cursor: pointer; -display: block; -width: 100%; -} -.ui-pnotify-history-container .ui-pnotify-history-pulldown { -display: block; -margin: 0 auto; -} \ No newline at end of file diff --git a/src/octoprint/static/css/octoprint.css b/src/octoprint/static/css/octoprint.css index f28a9620a..19769052b 100644 --- a/src/octoprint/static/css/octoprint.css +++ b/src/octoprint/static/css/octoprint.css @@ -1 +1 @@ -.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover,.btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-inverse:hover,.btn-inverse:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{border-color:transparent;cursor:pointer;color:#08c;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover,.btn-link:focus{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,.btn-link[disabled]:focus{color:#333;text-decoration:none}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{padding-top:60px}#navbar .navbar-inner{background-color:#ebebeb;background-image:-moz-linear-gradient(top,#fff,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#ccc));background-image:-webkit-linear-gradient(top,#fff,#ccc);background-image:-o-linear-gradient(top,#fff,#ccc);background-image:linear-gradient(to bottom,#fff,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffcccccc',GradientType=0)}#navbar .navbar-inner .brand,#navbar .navbar-inner .nav>li>a{text-shadow:0 1px 0 #fff;color:#333}#navbar .navbar-inner .brand .caret,#navbar .navbar-inner .nav>li>a .caret{border-bottom-color:#939393;border-top-color:#939393}#navbar .navbar-inner .brand:hover .caret,#navbar .navbar-inner .nav>li>a:hover .caret,#navbar .navbar-inner .brand:focus .caret,#navbar .navbar-inner .nav>li>a:focus .caret{border-bottom-color:#636363;border-top-color:#636363}#navbar .navbar-inner .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner .nav li.dropdown.open.active>.dropdown-toggle{background-color:#e0e0e0;background-image:-moz-linear-gradient(top,#ccc,#fff);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(top,#ccc,#fff);background-image:-o-linear-gradient(top,#ccc,#fff);background-image:linear-gradient(to bottom,#ccc,#fff);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffcccccc',endColorstr='#ffffffff',GradientType=0)}#navbar .navbar-inner.red{background-color:#e36565;background-image:-moz-linear-gradient(top,#f9a0a0,#c20c0c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f9a0a0),to(#c20c0c));background-image:-webkit-linear-gradient(top,#f9a0a0,#c20c0c);background-image:-o-linear-gradient(top,#f9a0a0,#c20c0c);background-image:linear-gradient(to bottom,#f9a0a0,#c20c0c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9a0a0',endColorstr='#ffc20c0c',GradientType=0)}#navbar .navbar-inner.red .brand,#navbar .navbar-inner.red .nav>li>a{text-shadow:0 1px 0 #c20c0c;color:#f2f2f2}#navbar .navbar-inner.red .brand .caret,#navbar .navbar-inner.red .nav>li>a .caret{border-bottom-color:#f28d8d;border-top-color:#f28d8d}#navbar .navbar-inner.red .brand:hover .caret,#navbar .navbar-inner.red .nav>li>a:hover .caret,#navbar .navbar-inner.red .brand:focus .caret,#navbar .navbar-inner.red .nav>li>a:focus .caret{border-bottom-color:#f2c0c0;border-top-color:#f2c0c0}#navbar .navbar-inner.red .brand span{background-image:url(../img/tentacle-20x20-light.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.red .brand span{background-image:url(../img/tentacle-20x20-light@2x.png)}}#navbar .navbar-inner.red .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.red .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.red .nav li.dropdown.open.active>.dropdown-toggle{background-color:#d84747;background-image:-moz-linear-gradient(top,#c20c0c,#f9a0a0);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c20c0c),to(#f9a0a0));background-image:-webkit-linear-gradient(top,#c20c0c,#f9a0a0);background-image:-o-linear-gradient(top,#c20c0c,#f9a0a0);background-image:linear-gradient(to bottom,#c20c0c,#f9a0a0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc20c0c',endColorstr='#fff9a0a0',GradientType=0)}#navbar .navbar-inner.orange{background-color:#e39665;background-image:-moz-linear-gradient(top,#f9c3a0,#c2530c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f9c3a0),to(#c2530c));background-image:-webkit-linear-gradient(top,#f9c3a0,#c2530c);background-image:-o-linear-gradient(top,#f9c3a0,#c2530c);background-image:linear-gradient(to bottom,#f9c3a0,#c2530c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9c3a0',endColorstr='#ffc2530c',GradientType=0)}#navbar .navbar-inner.orange .brand,#navbar .navbar-inner.orange .nav>li>a{text-shadow:0 1px 0 #f6a570;color:#333}#navbar .navbar-inner.orange .brand .caret,#navbar .navbar-inner.orange .nav>li>a .caret{border-bottom-color:#93552e;border-top-color:#93552e}#navbar .navbar-inner.orange .brand:hover .caret,#navbar .navbar-inner.orange .nav>li>a:hover .caret,#navbar .navbar-inner.orange .brand:focus .caret,#navbar .navbar-inner.orange .nav>li>a:focus .caret{border-bottom-color:#634430;border-top-color:#634430}#navbar .navbar-inner.orange .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.orange .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner.orange .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.orange .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.orange .nav li.dropdown.open.active>.dropdown-toggle{background-color:#d88047;background-image:-moz-linear-gradient(top,#c2530c,#f9c3a0);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c2530c),to(#f9c3a0));background-image:-webkit-linear-gradient(top,#c2530c,#f9c3a0);background-image:-o-linear-gradient(top,#c2530c,#f9c3a0);background-image:linear-gradient(to bottom,#c2530c,#f9c3a0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc2530c',endColorstr='#fff9c3a0',GradientType=0)}#navbar .navbar-inner.yellow{background-color:#e3d765;background-image:-moz-linear-gradient(top,#f9f0a0,#c2b00c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f9f0a0),to(#c2b00c));background-image:-webkit-linear-gradient(top,#f9f0a0,#c2b00c);background-image:-o-linear-gradient(top,#f9f0a0,#c2b00c);background-image:linear-gradient(to bottom,#f9f0a0,#c2b00c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f0a0',endColorstr='#ffc2b00c',GradientType=0)}#navbar .navbar-inner.yellow .brand,#navbar .navbar-inner.yellow .nav>li>a{text-shadow:0 1px 0 #f6e970;color:#333}#navbar .navbar-inner.yellow .brand .caret,#navbar .navbar-inner.yellow .nav>li>a .caret{border-bottom-color:#93892e;border-top-color:#93892e}#navbar .navbar-inner.yellow .brand:hover .caret,#navbar .navbar-inner.yellow .nav>li>a:hover .caret,#navbar .navbar-inner.yellow .brand:focus .caret,#navbar .navbar-inner.yellow .nav>li>a:focus .caret{border-bottom-color:#635e30;border-top-color:#635e30}#navbar .navbar-inner.yellow .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.yellow .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner.yellow .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.yellow .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.yellow .nav li.dropdown.open.active>.dropdown-toggle{background-color:#d8ca47;background-image:-moz-linear-gradient(top,#c2b00c,#f9f0a0);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c2b00c),to(#f9f0a0));background-image:-webkit-linear-gradient(top,#c2b00c,#f9f0a0);background-image:-o-linear-gradient(top,#c2b00c,#f9f0a0);background-image:linear-gradient(to bottom,#c2b00c,#f9f0a0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc2b00c',endColorstr='#fff9f0a0',GradientType=0)}#navbar .navbar-inner.green{background-color:#98f064;background-image:-moz-linear-gradient(top,#c8ffa7,#50da00);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c8ffa7),to(#50da00));background-image:-webkit-linear-gradient(top,#c8ffa7,#50da00);background-image:-o-linear-gradient(top,#c8ffa7,#50da00);background-image:linear-gradient(to bottom,#c8ffa7,#50da00);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc8ffa7',endColorstr='#ff50da00',GradientType=0)}#navbar .navbar-inner.green .brand,#navbar .navbar-inner.green .nav>li>a{text-shadow:0 1px 0 #a7ff74;color:#333}#navbar .navbar-inner.green .brand .caret,#navbar .navbar-inner.green .nav>li>a .caret{border-bottom-color:#55992e;border-top-color:#55992e}#navbar .navbar-inner.green .brand:hover .caret,#navbar .navbar-inner.green .nav>li>a:hover .caret,#navbar .navbar-inner.green .brand:focus .caret,#navbar .navbar-inner.green .nav>li>a:focus .caret{border-bottom-color:#446630;border-top-color:#446630}#navbar .navbar-inner.green .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.green .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner.green .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.green .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.green .nav li.dropdown.open.active>.dropdown-toggle{background-color:#80e943;background-image:-moz-linear-gradient(top,#50da00,#c8ffa7);background-image:-webkit-gradient(linear,0 0,0 100%,from(#50da00),to(#c8ffa7));background-image:-webkit-linear-gradient(top,#50da00,#c8ffa7);background-image:-o-linear-gradient(top,#50da00,#c8ffa7);background-image:linear-gradient(to bottom,#50da00,#c8ffa7);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff50da00',endColorstr='#ffc8ffa7',GradientType=0)}#navbar .navbar-inner.blue{background-color:#6498f0;background-image:-moz-linear-gradient(top,#a7c8ff,#0050da);background-image:-webkit-gradient(linear,0 0,0 100%,from(#a7c8ff),to(#0050da));background-image:-webkit-linear-gradient(top,#a7c8ff,#0050da);background-image:-o-linear-gradient(top,#a7c8ff,#0050da);background-image:linear-gradient(to bottom,#a7c8ff,#0050da);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffa7c8ff',endColorstr='#ff0050da',GradientType=0)}#navbar .navbar-inner.blue .brand,#navbar .navbar-inner.blue .nav>li>a{text-shadow:0 1px 0 #74a7ff;color:#333}#navbar .navbar-inner.blue .brand .caret,#navbar .navbar-inner.blue .nav>li>a .caret{border-bottom-color:#2e5599;border-top-color:#2e5599}#navbar .navbar-inner.blue .brand:hover .caret,#navbar .navbar-inner.blue .nav>li>a:hover .caret,#navbar .navbar-inner.blue .brand:focus .caret,#navbar .navbar-inner.blue .nav>li>a:focus .caret{border-bottom-color:#304466;border-top-color:#304466}#navbar .navbar-inner.blue .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.blue .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner.blue .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.blue .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.blue .nav li.dropdown.open.active>.dropdown-toggle{background-color:#4380e9;background-image:-moz-linear-gradient(top,#0050da,#a7c8ff);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0050da),to(#a7c8ff));background-image:-webkit-linear-gradient(top,#0050da,#a7c8ff);background-image:-o-linear-gradient(top,#0050da,#a7c8ff);background-image:linear-gradient(to bottom,#0050da,#a7c8ff);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0050da',endColorstr='#ffa7c8ff',GradientType=0)}#navbar .navbar-inner.violet{background-color:#9864f0;background-image:-moz-linear-gradient(top,#c8a7ff,#5000da);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c8a7ff),to(#5000da));background-image:-webkit-linear-gradient(top,#c8a7ff,#5000da);background-image:-o-linear-gradient(top,#c8a7ff,#5000da);background-image:linear-gradient(to bottom,#c8a7ff,#5000da);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc8a7ff',endColorstr='#ff5000da',GradientType=0)}#navbar .navbar-inner.violet .brand,#navbar .navbar-inner.violet .nav>li>a{text-shadow:0 1px 0 #5000da;color:#f2f2f2}#navbar .navbar-inner.violet .brand .caret,#navbar .navbar-inner.violet .nav>li>a .caret{border-bottom-color:#b58df9;border-top-color:#b58df9}#navbar .navbar-inner.violet .brand:hover .caret,#navbar .navbar-inner.violet .nav>li>a:hover .caret,#navbar .navbar-inner.violet .brand:focus .caret,#navbar .navbar-inner.violet .nav>li>a:focus .caret{border-bottom-color:#d3c0f5;border-top-color:#d3c0f5}#navbar .navbar-inner.violet .brand span{background-image:url(../img/tentacle-20x20-light.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.violet .brand span{background-image:url(../img/tentacle-20x20-light@2x.png)}}#navbar .navbar-inner.violet .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.violet .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.violet .nav li.dropdown.open.active>.dropdown-toggle{background-color:#8043e9;background-image:-moz-linear-gradient(top,#5000da,#c8a7ff);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5000da),to(#c8a7ff));background-image:-webkit-linear-gradient(top,#5000da,#c8a7ff);background-image:-o-linear-gradient(top,#5000da,#c8a7ff);background-image:linear-gradient(to bottom,#5000da,#c8a7ff);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5000da',endColorstr='#ffc8a7ff',GradientType=0)}#navbar .navbar-inner.black{background-color:#4f4f4f;background-image:-moz-linear-gradient(top,#787878,#121212);background-image:-webkit-gradient(linear,0 0,0 100%,from(#787878),to(#121212));background-image:-webkit-linear-gradient(top,#787878,#121212);background-image:-o-linear-gradient(top,#787878,#121212);background-image:linear-gradient(to bottom,#787878,#121212);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff787878',endColorstr='#ff121212',GradientType=0)}#navbar .navbar-inner.black .brand,#navbar .navbar-inner.black .nav>li>a{text-shadow:0 1px 0 #121212;color:#f2f2f2}#navbar .navbar-inner.black .brand .caret,#navbar .navbar-inner.black .nav>li>a .caret{border-bottom-color:#959595;border-top-color:#959595}#navbar .navbar-inner.black .brand:hover .caret,#navbar .navbar-inner.black .nav>li>a:hover .caret,#navbar .navbar-inner.black .brand:focus .caret,#navbar .navbar-inner.black .nav>li>a:focus .caret{border-bottom-color:#c4c4c4;border-top-color:#c4c4c4}#navbar .navbar-inner.black .brand span{background-image:url(../img/tentacle-20x20-light.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.black .brand span{background-image:url(../img/tentacle-20x20-light@2x.png)}}#navbar .navbar-inner.black .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.black .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.black .nav li.dropdown.open.active>.dropdown-toggle{background-color:#3b3b3b;background-image:-moz-linear-gradient(top,#121212,#787878);background-image:-webkit-gradient(linear,0 0,0 100%,from(#121212),to(#787878));background-image:-webkit-linear-gradient(top,#121212,#787878);background-image:-o-linear-gradient(top,#121212,#787878);background-image:linear-gradient(to bottom,#121212,#787878);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff121212',endColorstr='#ff787878',GradientType=0)}#navbar .navbar-inner .brand span{background-size:20px 20px;background-position:left center;padding-left:24px;background-repeat:no-repeat}.octoprint-container .tab-content{padding:9px 15px;border-left:1px solid #DDD;border-right:1px solid #DDD;border-bottom:1px solid #DDD;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px}.octoprint-container .nav{margin-bottom:0}.octoprint-container .tab-content h1{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5;font-weight:normal}.octoprint-container .accordion-heading .accordion-heading-button{float:right}.octoprint-container .accordion-heading .accordion-heading-button a{display:inline-block;padding:8px 15px;font-size:14px;line-height:20px;color:#000;text-decoration:none;background:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.octoprint-container .accordion-heading a.accordion-toggle{display:inline-block}.octoprint-container .accordion-heading [class^="icon-"],.octoprint-container .accordion-heading [class*=" icon-"]{color:#000}.print-control .btn{padding-left:4px;padding-right:4px}.upload-buttons .btn{margin-right:0}table{table-layout:fixed}table .popover-title{text-overflow:ellipsis;word-break:break-all}table th,table td{overflow:hidden}table th.gcode_files_name,table td.gcode_files_name{text-overflow:ellipsis;white-space:nowrap;text-align:left}table th.gcode_files_size,table td.gcode_files_size{text-align:right;width:55px}table th.gcode_files_action,table td.gcode_files_action{text-align:center;width:70px}table th.gcode_files_action a,table td.gcode_files_action a{text-decoration:none;color:#000}table th.gcode_files_action a.disabled,table td.gcode_files_action a.disabled{color:#ccc;cursor:default}table th.timelapse_files_name,table td.timelapse_files_name{text-overflow:ellipsis;text-align:left}table th.timelapse_files_size,table td.timelapse_files_size{text-align:right;width:55px}table th.timelapse_files_action,table td.timelapse_files_action{text-align:center;width:45px}table th.timelapse_files_action a,table td.timelapse_files_action a{text-decoration:none;color:#000}table th.timelapse_files_action a.disabled,table td.timelapse_files_action a.disabled{color:#ccc;cursor:default}table th.settings_users_name,table td.settings_users_name{text-overflow:ellipsis;text-align:left}table th.settings_users_active,table td.settings_users_active,table th.settings_users_admin,table td.settings_users_admin{text-align:center;width:55px}table th.settings_users_actions,table td.settings_users_actions{text-align:center;width:60px}table th.settings_users_actions a,table td.settings_users_actions a{text-decoration:none;color:#000}table th.settings_users_actions a.disabled,table td.settings_users_actions a.disabled{color:#ccc;cursor:default}table th.settings_logs_name,table td.settings_logs_name{text-overflow:ellipsis;text-align:left}table th.settings_logs_size,table td.settings_logs_size{text-align:right;width:70px}table th.settings_logs_date,table td.settings_logs_date{text-align:left;width:130px}table th.settings_logs_action,table td.settings_logs_action{text-align:center;width:70px}table th.settings_logs_action a,table td.settings_logs_action a{text-decoration:none;color:#000}table th.settings_logs_action a.disabled,table td.settings_logs_action a.disabled{color:#ccc;cursor:default}#temperature-graph{height:350px;width:100%;background-image:url("../img/graph-background.png");background-position:center;background-repeat:no-repeat}.tab-content,.tab-pane{overflow:visible}.tempInput{width:50px}#temp_newTemp,#temp_newBedTemp,#speed_innerWall,#speed_outerWall,#speed_fill,#speed_support,#webcam_timelapse_interval,#webcam_timelapse_postRoll{text-align:right}ul.dropdown-menu li a{cursor:pointer}#connection_ports,#connection_baudrates{width:100%}#offline_overlay{position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;display:none}#offline_overlay_background{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;filter:alpha(opacity=50);-moz-opacity:.5;-khtml-opacity:.5;opacity:.5}#offline_overlay_wrapper{position:absolute;top:0;bottom:0;left:0;right:0;padding-top:60px}#offline_overlay_wrapper .container{margin:auto}#webcam_container{width:100%}#webcam_container .flipH{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1)}#webcam_container .flipV{-webkit-transform:scaleY(-1);-moz-transform:scaleY(-1)}#webcam_container .flipH.flipV{-webkit-transform:scaleX(-1) scaleY(-1);-moz-transform:scaleX(-1) scaleY(-1)}#files .popover{font-size:85%}#files .popover p:last-child{margin-bottom:0}#files table{margin-bottom:0}#control{overflow:hidden}#control .jog-panel{float:left;margin-right:19px}#control h1{text-align:left}#control .jog-panel>div{text-align:center}#control .jog-panel>div.distance{text-align:left}#control .box{width:30px;height:30px;margin-right:10px;margin-bottom:10px;padding-left:8px}#control .control-box{display:block;height:30px;margin-bottom:10px}#control .btn-group{margin-bottom:10px}#control .btn-group.distance>.btn{width:43px;padding:3px 0;height:30px}#gcode .progress{width:582px}#gcode .progress .bar{-webkit-transition:width 0s linear;-moz-transition:width 0s linear;-o-transition:width 0s linear;transition:width 0s linear}#gcode #gcode_layer_slider{height:568px;float:right}#gcode #gcode_layer_slider .slider-handle{width:14px;height:14px;margin-left:-3px;margin-top:-7px}#gcode #gcode_command_slider .slider-handle{width:14px;height:14px;margin-left:-7px;margin-top:-3px}#term #terminal-output{min-height:340px}.footer ul{margin:0}.footer ul li{display:inline;margin-left:1em;font-size:85%}.footer ul li:first-child{margin-left:0}.footer ul li a{color:#555}.text-right{text-align:right}.overflow_visible{overflow:visible!important}#drop_overlay{position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;display:none}#drop_overlay.in{display:block}#drop_overlay #drop_overlay_background{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;filter:alpha(opacity=50);-moz-opacity:.5;-khtml-opacity:.5;opacity:.5}#drop_overlay #drop_overlay_wrapper{position:absolute;top:0;bottom:0;left:0;right:0;padding-top:60px}#drop_overlay #drop_overlay_wrapper #drop,#drop_overlay #drop_overlay_wrapper #drop_background{position:absolute;top:50%;left:50%;margin-left:-200px;margin-top:-200px}#drop_overlay #drop_overlay_wrapper #drop_locally,#drop_overlay #drop_overlay_wrapper #drop_locally_background{position:absolute;top:50%;left:50%;margin-left:-425px;margin-top:-200px}#drop_overlay #drop_overlay_wrapper #drop_sd,#drop_overlay #drop_overlay_wrapper #drop_sd_background{position:absolute;top:50%;left:50%;margin-left:25px;margin-top:-200px}#drop_overlay #drop_overlay_wrapper .dropzone{width:404px;height:404px;z-index:10001;color:#fff;font-size:30px}#drop_overlay #drop_overlay_wrapper .dropzone i{font-size:50px}#drop_overlay #drop_overlay_wrapper .dropzone .centered{display:table-cell;text-align:center;vertical-align:middle;width:400px;height:400px;line-height:40px;filter:alpha(opacity=100);-moz-opacity:1.0;-khtml-opacity:1.0;opacity:1.0}#drop_overlay #drop_overlay_wrapper .dropzone_background{width:400px;height:400px;border:2px dashed #eee;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;background-color:#000;filter:alpha(opacity=25);-moz-opacity:.25;-khtml-opacity:.25;opacity:.25}#drop_overlay #drop_overlay_wrapper .dropzone_background.hover{background-color:#000;filter:alpha(opacity=50);-moz-opacity:.5;-khtml-opacity:.5;opacity:.5}#drop_overlay #drop_overlay_wrapper .dropzone_background.fade{-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-ms-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;opacity:1}.icon-sd-black-14{background:url("../img/icon-sd-black-14.png") 0 3px no-repeat;width:11px;height:17px}.slider .slider-selection{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.slider .slider-selection:hover,.slider .slider-selection:focus,.slider .slider-selection:active,.slider .slider-selection.active,.slider .slider-selection.disabled,.slider .slider-selection[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.slider .slider-selection:active,.slider .slider-selection.active{background-color:#039 \9}.slider.slider-disabled .slider-selection{background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.slider .slider-track{background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.slider.slider-disabled .slider-track{background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.slider .slider-handle{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);padding:0;margin-bottom:0;opacity:1;filter:alpha(opacity=100)}.slider .slider-handle:hover,.slider .slider-handle:focus,.slider .slider-handle:active,.slider .slider-handle.active,.slider .slider-handle.disabled,.slider .slider-handle[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.slider .slider-handle:active,.slider .slider-handle.active{background-color:#ccc \9}.slider .slider-handle:first-child{*margin-left:0}.slider .slider-handle:hover,.slider .slider-handle:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.slider .slider-handle:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.slider .slider-handle.active,.slider .slider-handle:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.slider .slider-handle.disabled,.slider .slider-handle[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.slider .slider-handle.hide{display:none}.slider .slider-handle.round{-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%} \ No newline at end of file +.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;margin-bottom:0;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05)}.btn:hover,.btn:focus,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover,.btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.btn-inverse:hover,.btn-inverse:focus,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{border-color:transparent;cursor:pointer;color:#08c;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover,.btn-link:focus{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,.btn-link[disabled]:focus{color:#333;text-decoration:none}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{padding-top:60px}#navbar .navbar-inner{background-color:#ebebeb;background-image:-moz-linear-gradient(top,#fff,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#ccc));background-image:-webkit-linear-gradient(top,#fff,#ccc);background-image:-o-linear-gradient(top,#fff,#ccc);background-image:linear-gradient(to bottom,#fff,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffcccccc',GradientType=0)}#navbar .navbar-inner .brand,#navbar .navbar-inner .nav>li>a{text-shadow:0 1px 0 #fff;color:#333}#navbar .navbar-inner .brand .caret,#navbar .navbar-inner .nav>li>a .caret{border-bottom-color:#939393;border-top-color:#939393}#navbar .navbar-inner .brand:hover .caret,#navbar .navbar-inner .nav>li>a:hover .caret,#navbar .navbar-inner .brand:focus .caret,#navbar .navbar-inner .nav>li>a:focus .caret{border-bottom-color:#636363;border-top-color:#636363}#navbar .navbar-inner .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner .nav li.dropdown.open.active>.dropdown-toggle{background-color:#e0e0e0;background-image:-moz-linear-gradient(top,#ccc,#fff);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ccc),to(#fff));background-image:-webkit-linear-gradient(top,#ccc,#fff);background-image:-o-linear-gradient(top,#ccc,#fff);background-image:linear-gradient(to bottom,#ccc,#fff);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffcccccc',endColorstr='#ffffffff',GradientType=0)}#navbar .navbar-inner.red{background-color:#e36565;background-image:-moz-linear-gradient(top,#f9a0a0,#c20c0c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f9a0a0),to(#c20c0c));background-image:-webkit-linear-gradient(top,#f9a0a0,#c20c0c);background-image:-o-linear-gradient(top,#f9a0a0,#c20c0c);background-image:linear-gradient(to bottom,#f9a0a0,#c20c0c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9a0a0',endColorstr='#ffc20c0c',GradientType=0)}#navbar .navbar-inner.red .brand,#navbar .navbar-inner.red .nav>li>a{text-shadow:0 1px 0 #c20c0c;color:#f2f2f2}#navbar .navbar-inner.red .brand .caret,#navbar .navbar-inner.red .nav>li>a .caret{border-bottom-color:#f28d8d;border-top-color:#f28d8d}#navbar .navbar-inner.red .brand:hover .caret,#navbar .navbar-inner.red .nav>li>a:hover .caret,#navbar .navbar-inner.red .brand:focus .caret,#navbar .navbar-inner.red .nav>li>a:focus .caret{border-bottom-color:#f2c0c0;border-top-color:#f2c0c0}#navbar .navbar-inner.red .brand span{background-image:url(../img/tentacle-20x20-light.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.red .brand span{background-image:url(../img/tentacle-20x20-light@2x.png)}}#navbar .navbar-inner.red .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.red .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.red .nav li.dropdown.open.active>.dropdown-toggle{background-color:#d84747;background-image:-moz-linear-gradient(top,#c20c0c,#f9a0a0);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c20c0c),to(#f9a0a0));background-image:-webkit-linear-gradient(top,#c20c0c,#f9a0a0);background-image:-o-linear-gradient(top,#c20c0c,#f9a0a0);background-image:linear-gradient(to bottom,#c20c0c,#f9a0a0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc20c0c',endColorstr='#fff9a0a0',GradientType=0)}#navbar .navbar-inner.orange{background-color:#e39665;background-image:-moz-linear-gradient(top,#f9c3a0,#c2530c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f9c3a0),to(#c2530c));background-image:-webkit-linear-gradient(top,#f9c3a0,#c2530c);background-image:-o-linear-gradient(top,#f9c3a0,#c2530c);background-image:linear-gradient(to bottom,#f9c3a0,#c2530c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9c3a0',endColorstr='#ffc2530c',GradientType=0)}#navbar .navbar-inner.orange .brand,#navbar .navbar-inner.orange .nav>li>a{text-shadow:0 1px 0 #f6a570;color:#333}#navbar .navbar-inner.orange .brand .caret,#navbar .navbar-inner.orange .nav>li>a .caret{border-bottom-color:#93552e;border-top-color:#93552e}#navbar .navbar-inner.orange .brand:hover .caret,#navbar .navbar-inner.orange .nav>li>a:hover .caret,#navbar .navbar-inner.orange .brand:focus .caret,#navbar .navbar-inner.orange .nav>li>a:focus .caret{border-bottom-color:#634430;border-top-color:#634430}#navbar .navbar-inner.orange .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.orange .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner.orange .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.orange .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.orange .nav li.dropdown.open.active>.dropdown-toggle{background-color:#d88047;background-image:-moz-linear-gradient(top,#c2530c,#f9c3a0);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c2530c),to(#f9c3a0));background-image:-webkit-linear-gradient(top,#c2530c,#f9c3a0);background-image:-o-linear-gradient(top,#c2530c,#f9c3a0);background-image:linear-gradient(to bottom,#c2530c,#f9c3a0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc2530c',endColorstr='#fff9c3a0',GradientType=0)}#navbar .navbar-inner.yellow{background-color:#e3d765;background-image:-moz-linear-gradient(top,#f9f0a0,#c2b00c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f9f0a0),to(#c2b00c));background-image:-webkit-linear-gradient(top,#f9f0a0,#c2b00c);background-image:-o-linear-gradient(top,#f9f0a0,#c2b00c);background-image:linear-gradient(to bottom,#f9f0a0,#c2b00c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff9f0a0',endColorstr='#ffc2b00c',GradientType=0)}#navbar .navbar-inner.yellow .brand,#navbar .navbar-inner.yellow .nav>li>a{text-shadow:0 1px 0 #f6e970;color:#333}#navbar .navbar-inner.yellow .brand .caret,#navbar .navbar-inner.yellow .nav>li>a .caret{border-bottom-color:#93892e;border-top-color:#93892e}#navbar .navbar-inner.yellow .brand:hover .caret,#navbar .navbar-inner.yellow .nav>li>a:hover .caret,#navbar .navbar-inner.yellow .brand:focus .caret,#navbar .navbar-inner.yellow .nav>li>a:focus .caret{border-bottom-color:#635e30;border-top-color:#635e30}#navbar .navbar-inner.yellow .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.yellow .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner.yellow .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.yellow .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.yellow .nav li.dropdown.open.active>.dropdown-toggle{background-color:#d8ca47;background-image:-moz-linear-gradient(top,#c2b00c,#f9f0a0);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c2b00c),to(#f9f0a0));background-image:-webkit-linear-gradient(top,#c2b00c,#f9f0a0);background-image:-o-linear-gradient(top,#c2b00c,#f9f0a0);background-image:linear-gradient(to bottom,#c2b00c,#f9f0a0);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc2b00c',endColorstr='#fff9f0a0',GradientType=0)}#navbar .navbar-inner.green{background-color:#98f064;background-image:-moz-linear-gradient(top,#c8ffa7,#50da00);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c8ffa7),to(#50da00));background-image:-webkit-linear-gradient(top,#c8ffa7,#50da00);background-image:-o-linear-gradient(top,#c8ffa7,#50da00);background-image:linear-gradient(to bottom,#c8ffa7,#50da00);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc8ffa7',endColorstr='#ff50da00',GradientType=0)}#navbar .navbar-inner.green .brand,#navbar .navbar-inner.green .nav>li>a{text-shadow:0 1px 0 #a7ff74;color:#333}#navbar .navbar-inner.green .brand .caret,#navbar .navbar-inner.green .nav>li>a .caret{border-bottom-color:#55992e;border-top-color:#55992e}#navbar .navbar-inner.green .brand:hover .caret,#navbar .navbar-inner.green .nav>li>a:hover .caret,#navbar .navbar-inner.green .brand:focus .caret,#navbar .navbar-inner.green .nav>li>a:focus .caret{border-bottom-color:#446630;border-top-color:#446630}#navbar .navbar-inner.green .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.green .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner.green .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.green .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.green .nav li.dropdown.open.active>.dropdown-toggle{background-color:#80e943;background-image:-moz-linear-gradient(top,#50da00,#c8ffa7);background-image:-webkit-gradient(linear,0 0,0 100%,from(#50da00),to(#c8ffa7));background-image:-webkit-linear-gradient(top,#50da00,#c8ffa7);background-image:-o-linear-gradient(top,#50da00,#c8ffa7);background-image:linear-gradient(to bottom,#50da00,#c8ffa7);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff50da00',endColorstr='#ffc8ffa7',GradientType=0)}#navbar .navbar-inner.blue{background-color:#6498f0;background-image:-moz-linear-gradient(top,#a7c8ff,#0050da);background-image:-webkit-gradient(linear,0 0,0 100%,from(#a7c8ff),to(#0050da));background-image:-webkit-linear-gradient(top,#a7c8ff,#0050da);background-image:-o-linear-gradient(top,#a7c8ff,#0050da);background-image:linear-gradient(to bottom,#a7c8ff,#0050da);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffa7c8ff',endColorstr='#ff0050da',GradientType=0)}#navbar .navbar-inner.blue .brand,#navbar .navbar-inner.blue .nav>li>a{text-shadow:0 1px 0 #74a7ff;color:#333}#navbar .navbar-inner.blue .brand .caret,#navbar .navbar-inner.blue .nav>li>a .caret{border-bottom-color:#2e5599;border-top-color:#2e5599}#navbar .navbar-inner.blue .brand:hover .caret,#navbar .navbar-inner.blue .nav>li>a:hover .caret,#navbar .navbar-inner.blue .brand:focus .caret,#navbar .navbar-inner.blue .nav>li>a:focus .caret{border-bottom-color:#304466;border-top-color:#304466}#navbar .navbar-inner.blue .brand span{background-image:url(../img/tentacle-20x20.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.blue .brand span{background-image:url(../img/tentacle-20x20@2x.png)}}#navbar .navbar-inner.blue .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.blue .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.blue .nav li.dropdown.open.active>.dropdown-toggle{background-color:#4380e9;background-image:-moz-linear-gradient(top,#0050da,#a7c8ff);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0050da),to(#a7c8ff));background-image:-webkit-linear-gradient(top,#0050da,#a7c8ff);background-image:-o-linear-gradient(top,#0050da,#a7c8ff);background-image:linear-gradient(to bottom,#0050da,#a7c8ff);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0050da',endColorstr='#ffa7c8ff',GradientType=0)}#navbar .navbar-inner.violet{background-color:#9864f0;background-image:-moz-linear-gradient(top,#c8a7ff,#5000da);background-image:-webkit-gradient(linear,0 0,0 100%,from(#c8a7ff),to(#5000da));background-image:-webkit-linear-gradient(top,#c8a7ff,#5000da);background-image:-o-linear-gradient(top,#c8a7ff,#5000da);background-image:linear-gradient(to bottom,#c8a7ff,#5000da);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffc8a7ff',endColorstr='#ff5000da',GradientType=0)}#navbar .navbar-inner.violet .brand,#navbar .navbar-inner.violet .nav>li>a{text-shadow:0 1px 0 #5000da;color:#f2f2f2}#navbar .navbar-inner.violet .brand .caret,#navbar .navbar-inner.violet .nav>li>a .caret{border-bottom-color:#b58df9;border-top-color:#b58df9}#navbar .navbar-inner.violet .brand:hover .caret,#navbar .navbar-inner.violet .nav>li>a:hover .caret,#navbar .navbar-inner.violet .brand:focus .caret,#navbar .navbar-inner.violet .nav>li>a:focus .caret{border-bottom-color:#d3c0f5;border-top-color:#d3c0f5}#navbar .navbar-inner.violet .brand span{background-image:url(../img/tentacle-20x20-light.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.violet .brand span{background-image:url(../img/tentacle-20x20-light@2x.png)}}#navbar .navbar-inner.violet .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.violet .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.violet .nav li.dropdown.open.active>.dropdown-toggle{background-color:#8043e9;background-image:-moz-linear-gradient(top,#5000da,#c8a7ff);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5000da),to(#c8a7ff));background-image:-webkit-linear-gradient(top,#5000da,#c8a7ff);background-image:-o-linear-gradient(top,#5000da,#c8a7ff);background-image:linear-gradient(to bottom,#5000da,#c8a7ff);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5000da',endColorstr='#ffc8a7ff',GradientType=0)}#navbar .navbar-inner.black{background-color:#4f4f4f;background-image:-moz-linear-gradient(top,#787878,#121212);background-image:-webkit-gradient(linear,0 0,0 100%,from(#787878),to(#121212));background-image:-webkit-linear-gradient(top,#787878,#121212);background-image:-o-linear-gradient(top,#787878,#121212);background-image:linear-gradient(to bottom,#787878,#121212);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff787878',endColorstr='#ff121212',GradientType=0)}#navbar .navbar-inner.black .brand,#navbar .navbar-inner.black .nav>li>a{text-shadow:0 1px 0 #121212;color:#f2f2f2}#navbar .navbar-inner.black .brand .caret,#navbar .navbar-inner.black .nav>li>a .caret{border-bottom-color:#959595;border-top-color:#959595}#navbar .navbar-inner.black .brand:hover .caret,#navbar .navbar-inner.black .nav>li>a:hover .caret,#navbar .navbar-inner.black .brand:focus .caret,#navbar .navbar-inner.black .nav>li>a:focus .caret{border-bottom-color:#c4c4c4;border-top-color:#c4c4c4}#navbar .navbar-inner.black .brand span{background-image:url(../img/tentacle-20x20-light.png)}@media(-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){#navbar .navbar-inner.black .brand span{background-image:url(../img/tentacle-20x20-light@2x.png)}}#navbar .navbar-inner.black .nav li.dropdown.open>.dropdown-toggle,#navbar .navbar-inner.black .nav li.dropdown.active>.dropdown-toggle,#navbar .navbar-inner.black .nav li.dropdown.open.active>.dropdown-toggle{background-color:#3b3b3b;background-image:-moz-linear-gradient(top,#121212,#787878);background-image:-webkit-gradient(linear,0 0,0 100%,from(#121212),to(#787878));background-image:-webkit-linear-gradient(top,#121212,#787878);background-image:-o-linear-gradient(top,#121212,#787878);background-image:linear-gradient(to bottom,#121212,#787878);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff121212',endColorstr='#ff787878',GradientType=0)}#navbar .navbar-inner .brand span{background-size:20px 20px;background-position:left center;padding-left:24px;background-repeat:no-repeat}.octoprint-container .tab-content{padding:9px 15px;border-left:1px solid #DDD;border-right:1px solid #DDD;border-bottom:1px solid #DDD;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px}.octoprint-container .nav{margin-bottom:0}.octoprint-container .tab-content h1{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5;font-weight:normal}.octoprint-container .accordion-heading .accordion-heading-button{float:right}.octoprint-container .accordion-heading .accordion-heading-button a{display:inline-block;padding:8px 15px;font-size:14px;line-height:20px;color:#000;text-decoration:none;background:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.octoprint-container .accordion-heading a.accordion-toggle{display:inline-block}.octoprint-container .accordion-heading [class^="icon-"],.octoprint-container .accordion-heading [class*=" icon-"]{color:#000}.print-control .btn{padding-left:4px;padding-right:4px}.upload-buttons .btn{margin-right:0}table{table-layout:fixed}table .popover-title{text-overflow:ellipsis;word-break:break-all}table th,table td{overflow:hidden}table th.gcode_files_name,table td.gcode_files_name{text-overflow:ellipsis;white-space:nowrap;text-align:left}table th.gcode_files_action,table td.gcode_files_action{text-align:center;width:90px}table th.gcode_files_action a,table td.gcode_files_action a{text-decoration:none;color:#000}table th.gcode_files_action a.disabled,table td.gcode_files_action a.disabled{color:#ccc;cursor:default}table th.timelapse_files_name,table td.timelapse_files_name{text-overflow:ellipsis;text-align:left}table th.timelapse_files_size,table td.timelapse_files_size{text-align:right;width:55px}table th.timelapse_files_action,table td.timelapse_files_action{text-align:center;width:45px}table th.timelapse_files_action a,table td.timelapse_files_action a{text-decoration:none;color:#000}table th.timelapse_files_action a.disabled,table td.timelapse_files_action a.disabled{color:#ccc;cursor:default}table th.settings_users_name,table td.settings_users_name{text-overflow:ellipsis;text-align:left}table th.settings_users_active,table td.settings_users_active,table th.settings_users_admin,table td.settings_users_admin{text-align:center;width:55px}table th.settings_users_actions,table td.settings_users_actions{text-align:center;width:60px}table th.settings_users_actions a,table td.settings_users_actions a{text-decoration:none;color:#000}table th.settings_users_actions a.disabled,table td.settings_users_actions a.disabled{color:#ccc;cursor:default}table th.settings_logs_name,table td.settings_logs_name{text-overflow:ellipsis;text-align:left}table th.settings_logs_size,table td.settings_logs_size{text-align:right;width:70px}table th.settings_logs_date,table td.settings_logs_date{text-align:left;width:130px}table th.settings_logs_action,table td.settings_logs_action{text-align:center;width:70px}table th.settings_logs_action a,table td.settings_logs_action a{text-decoration:none;color:#000}table th.settings_logs_action a.disabled,table td.settings_logs_action a.disabled{color:#ccc;cursor:default}#temperature-graph{height:350px;width:100%;background-image:url("../img/graph-background.png");background-position:center;background-repeat:no-repeat}.tab-content,.tab-pane{overflow:visible}.tempInput{width:50px}#temp_newTemp,#temp_newBedTemp,#speed_innerWall,#speed_outerWall,#speed_fill,#speed_support,#webcam_timelapse_interval,#webcam_timelapse_postRoll{text-align:right}ul.dropdown-menu li a{cursor:pointer}#connection_ports,#connection_baudrates{width:100%}#offline_overlay{position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;display:none}#offline_overlay_background{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;filter:alpha(opacity=50);-moz-opacity:.5;-khtml-opacity:.5;opacity:.5}#offline_overlay_wrapper{position:absolute;top:0;bottom:0;left:0;right:0;padding-top:60px}#offline_overlay_wrapper .container{margin:auto}#webcam_container{width:100%}#webcam_container .flipH{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1)}#webcam_container .flipV{-webkit-transform:scaleY(-1);-moz-transform:scaleY(-1)}#webcam_container .flipH.flipV{-webkit-transform:scaleX(-1) scaleY(-1);-moz-transform:scaleX(-1) scaleY(-1)}#files .gcode_files{padding-right:7px}#files .gcode_files .entry{padding:5px;line-height:20px;border-bottom:1px solid #ddd;position:relative}#files .gcode_files .entry:hover{background-color:#f5f5f5}#files .gcode_files .entry .title{text-overflow:ellipsis;word-break:break-all}#files .gcode_files .entry .uploaded,#files .gcode_files .entry .size,#files .gcode_files .entry .additionalInfo{font-size:85%;color:#999}#files .gcode_files .entry .action-buttons{position:absolute;bottom:5px;right:5px}#files .gcode_files .entry .additionalInfo{padding-bottom:22px}#files .upload-buttons{margin-top:10px}#files .form-search{text-align:center;margin-bottom:5px!important}#control{overflow:hidden}#control .jog-panel{float:left;margin-right:19px}#control h1{text-align:left}#control .jog-panel>div{text-align:center}#control .jog-panel>div.distance{text-align:left}#control .box{width:30px;height:30px;margin-right:10px;margin-bottom:10px;padding-left:8px}#control .control-box{display:block;height:30px;margin-bottom:10px}#control .btn-group{margin-bottom:10px}#control .btn-group.distance>.btn{width:43px;padding:3px 0;height:30px}#gcode .progress{width:582px}#gcode .progress .bar{-webkit-transition:width 0s linear;-moz-transition:width 0s linear;-o-transition:width 0s linear;transition:width 0s linear}#gcode #gcode_layer_slider{height:568px;float:right}#gcode #gcode_layer_slider .slider-handle{width:14px;height:14px;margin-left:-3px;margin-top:-7px}#gcode #gcode_command_slider .slider-handle{width:14px;height:14px;margin-left:-7px;margin-top:-3px}#term #terminal-output{min-height:340px}.footer ul{margin:0}.footer ul li{display:inline;margin-left:1em;font-size:85%}.footer ul li:first-child{margin-left:0}.footer ul li a{color:#555}.ui-pnotify .alert a{color:#c09853}.ui-pnotify .alert-error a,.ui-pnotify .alert-danger a{color:#b94a48}.ui-pnotify .alert-success a{color:#468847}.ui-pnotify .alert-info a{color:#3a87ad}.pnotify_additional_info .pnotify_more{font-size:85%}.text-right{text-align:right}.overflow_visible{overflow:visible!important}#drop_overlay{position:fixed;top:0;left:0;width:100%;height:100%;z-index:10000;display:none}#drop_overlay.in{display:block}#drop_overlay #drop_overlay_background{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000;filter:alpha(opacity=50);-moz-opacity:.5;-khtml-opacity:.5;opacity:.5}#drop_overlay #drop_overlay_wrapper{position:absolute;top:0;bottom:0;left:0;right:0;padding-top:60px}#drop_overlay #drop_overlay_wrapper #drop,#drop_overlay #drop_overlay_wrapper #drop_background{position:absolute;top:50%;left:50%;margin-left:-200px;margin-top:-200px}#drop_overlay #drop_overlay_wrapper #drop_locally,#drop_overlay #drop_overlay_wrapper #drop_locally_background{position:absolute;top:50%;left:50%;margin-left:-425px;margin-top:-200px}#drop_overlay #drop_overlay_wrapper #drop_sd,#drop_overlay #drop_overlay_wrapper #drop_sd_background{position:absolute;top:50%;left:50%;margin-left:25px;margin-top:-200px}#drop_overlay #drop_overlay_wrapper .dropzone{width:404px;height:404px;z-index:10001;color:#fff;font-size:30px}#drop_overlay #drop_overlay_wrapper .dropzone i{font-size:50px}#drop_overlay #drop_overlay_wrapper .dropzone .centered{display:table-cell;text-align:center;vertical-align:middle;width:400px;height:400px;line-height:40px;filter:alpha(opacity=100);-moz-opacity:1.0;-khtml-opacity:1.0;opacity:1.0}#drop_overlay #drop_overlay_wrapper .dropzone_background{width:400px;height:400px;border:2px dashed #eee;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;background-color:#000;filter:alpha(opacity=25);-moz-opacity:.25;-khtml-opacity:.25;opacity:.25}#drop_overlay #drop_overlay_wrapper .dropzone_background.hover{background-color:#000;filter:alpha(opacity=50);-moz-opacity:.5;-khtml-opacity:.5;opacity:.5}#drop_overlay #drop_overlay_wrapper .dropzone_background.fade{-webkit-transition:all .3s ease-out;-moz-transition:all .3s ease-out;-ms-transition:all .3s ease-out;-o-transition:all .3s ease-out;transition:all .3s ease-out;opacity:1}.icon-sd-black-14{background:url("../img/icon-sd-black-14.png") 0 3px no-repeat;width:11px;height:17px;display:inline-block!important}.center{float:none;margin-left:auto;margin-right:auto}.slider .slider-selection{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.slider .slider-selection:hover,.slider .slider-selection:focus,.slider .slider-selection:active,.slider .slider-selection.active,.slider .slider-selection.disabled,.slider .slider-selection[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.slider .slider-selection:active,.slider .slider-selection.active{background-color:#039 \9}.slider.slider-disabled .slider-selection{background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.slider .slider-track{background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.slider.slider-disabled .slider-track{background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.slider .slider-handle{display:inline-block;*display:inline;*zoom:1;padding:4px 12px;font-size:14px;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f5f5f5;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);padding:0;margin-bottom:0;opacity:1;filter:alpha(opacity=100)}.slider .slider-handle:hover,.slider .slider-handle:focus,.slider .slider-handle:active,.slider .slider-handle.active,.slider .slider-handle.disabled,.slider .slider-handle[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.slider .slider-handle:active,.slider .slider-handle.active{background-color:#ccc \9}.slider .slider-handle:first-child{*margin-left:0}.slider .slider-handle:hover,.slider .slider-handle:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.slider .slider-handle:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.slider .slider-handle.active,.slider .slider-handle:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.slider .slider-handle.disabled,.slider .slider-handle[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.slider .slider-handle.hide{display:none}.slider .slider-handle.round{-webkit-border-radius:50%;-moz-border-radius:50%;border-radius:50%} \ No newline at end of file diff --git a/src/octoprint/static/font/FontAwesome.otf b/src/octoprint/static/font/FontAwesome.otf index d13308ef5..70125459f 100644 Binary files a/src/octoprint/static/font/FontAwesome.otf and b/src/octoprint/static/font/FontAwesome.otf differ diff --git a/src/octoprint/static/font/fontawesome-webfont.eot b/src/octoprint/static/font/fontawesome-webfont.eot index 7d81019e4..0662cb96b 100644 Binary files a/src/octoprint/static/font/fontawesome-webfont.eot and b/src/octoprint/static/font/fontawesome-webfont.eot differ diff --git a/src/octoprint/static/font/fontawesome-webfont.svg b/src/octoprint/static/font/fontawesome-webfont.svg index ba0afe5ef..2edb4ec34 100644 --- a/src/octoprint/static/font/fontawesome-webfont.svg +++ b/src/octoprint/static/font/fontawesome-webfont.svg @@ -52,25 +52,25 @@ - - + + - - - + + + - - + + - + - + @@ -89,11 +89,11 @@ - + - + @@ -115,12 +115,12 @@ - - + + - - - + + + @@ -132,13 +132,13 @@ - + - + @@ -152,8 +152,8 @@ - - + + @@ -163,22 +163,22 @@ - + - - + + - + - - - - + + + + @@ -186,18 +186,18 @@ - + - + - + - + @@ -230,8 +230,8 @@ - - + + @@ -250,13 +250,13 @@ - + - - + + @@ -271,7 +271,7 @@ - + @@ -280,5 +280,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/octoprint/static/font/fontawesome-webfont.ttf b/src/octoprint/static/font/fontawesome-webfont.ttf index d46172476..d36592469 100644 Binary files a/src/octoprint/static/font/fontawesome-webfont.ttf and b/src/octoprint/static/font/fontawesome-webfont.ttf differ diff --git a/src/octoprint/static/font/fontawesome-webfont.woff b/src/octoprint/static/font/fontawesome-webfont.woff index 3c89ae09b..b9bd17e15 100644 Binary files a/src/octoprint/static/font/fontawesome-webfont.woff and b/src/octoprint/static/font/fontawesome-webfont.woff differ diff --git a/src/octoprint/static/gcodeviewer/js/renderer.js b/src/octoprint/static/gcodeviewer/js/renderer.js index c0f286882..0a0edfb97 100644 --- a/src/octoprint/static/gcodeviewer/js/renderer.js +++ b/src/octoprint/static/gcodeviewer/js/renderer.js @@ -44,6 +44,7 @@ GCODE.renderer = (function(){ zoomInOnModel: false, zoomInOnBed: false, centerViewport: false, + invertAxes: {x: false, y: false}, bed: {x: 200, y: 200}, container: undefined @@ -54,6 +55,7 @@ GCODE.renderer = (function(){ var scaleX = 1, scaleY = 1; var speeds = []; var speedsByLayer = {}; + var currentInvertX = false, currentInvertY = false; var reRender = function(){ var p1 = ctx.transformedPoint(0,0); @@ -182,25 +184,34 @@ GCODE.renderer = (function(){ }; var drawGrid = function() { - console.log("Drawing grid"); - ctx.translate(offsetBedX, offsetBedY); + if(renderOptions["bed"]["circular"]) { + drawCircularGrid(); + } else { + drawRectangularGrid(); + } + ctx.translate(-offsetBedX, -offsetBedY); + }; - ctx.beginPath(); + var drawRectangularGrid = function() { + var i; var width = renderOptions["bed"]["x"] * zoomFactor; var height = renderOptions["bed"]["y"] * zoomFactor; var origin = { x: 0, y: -1 * renderOptions["bed"]["y"] * zoomFactor }; + + ctx.beginPath(); ctx.strokeStyle = renderOptions["colorGrid"]; ctx.fillStyle = "#ffffff"; ctx.lineWidth = 2; + ctx.rect(origin.x, origin.y, width, height); + ctx.fill(); ctx.stroke(); - var i; ctx.strokeStyle = renderOptions["colorGrid"]; ctx.lineWidth = 1; @@ -217,8 +228,53 @@ GCODE.renderer = (function(){ ctx.lineTo(renderOptions["bed"]["x"] * zoomFactor, -1 * i * zoomFactor); } ctx.stroke(); + }; - ctx.translate(-offsetBedX, -offsetBedY); + var drawCircularGrid = function() { + var i; + + ctx.strokeStyle = renderOptions["colorGrid"]; + ctx.fillStyle = "#ffffff"; + ctx.lineWidth = 2; + + //~~ bed outline & origin + ctx.beginPath(); + + // outline + ctx.arc(0, 0, renderOptions["bed"]["r"] * zoomFactor, 0, Math.PI * 2, true); + + // origin + ctx.moveTo(-1 * renderOptions["bed"]["r"] * zoomFactor, 0); + ctx.lineTo(renderOptions["bed"]["r"] * zoomFactor, 0); + ctx.moveTo(0, -1 * renderOptions["bed"]["r"] * zoomFactor); + ctx.lineTo(0, renderOptions["bed"]["r"] * zoomFactor); + + // draw + ctx.fill(); + ctx.stroke(); + + ctx.strokeStyle = renderOptions["colorGrid"]; + ctx.lineWidth = 1; + + //~~ grid starting from origin + ctx.beginPath(); + for (i = 0; i <= renderOptions["bed"]["r"]; i += gridStep) { + var x = i; + var y = Math.sqrt(Math.pow(renderOptions["bed"]["r"], 2) - Math.pow(x, 2)); + + ctx.moveTo(x * zoomFactor, y * zoomFactor); + ctx.lineTo(x * zoomFactor, -1 * y * zoomFactor); + + ctx.moveTo(y * zoomFactor, x * zoomFactor); + ctx.lineTo(-1 * y * zoomFactor, x * zoomFactor); + + ctx.moveTo(-1 * x * zoomFactor, y * zoomFactor); + ctx.lineTo(-1 * x * zoomFactor, -1 * y * zoomFactor); + + ctx.moveTo(y * zoomFactor, -1 * x * zoomFactor); + ctx.lineTo(-1 * y * zoomFactor, -1 * x * zoomFactor); + } + ctx.stroke(); }; var drawLayer = function(layerNum, fromProgress, toProgress, isNotCurrentLayer){ @@ -226,8 +282,11 @@ GCODE.renderer = (function(){ var i; - isNotCurrentLayer = typeof isNotCurrentLayer !== 'undefined' ? isNotCurrentLayer : false; + //~~ store current layer values + + isNotCurrentLayer = isNotCurrentLayer !== undefined ? isNotCurrentLayer : false; if (!isNotCurrentLayer) { + // not not current layer == current layer => store layer number and from/to progress layerNumStore = layerNum; progressStore = {from: fromProgress, to: toProgress}; } @@ -237,67 +296,74 @@ GCODE.renderer = (function(){ var cmds = model[layerNum]; var x, y; - if (fromProgress > 0) { - prevX = cmds[fromProgress-1].x * zoomFactor; - prevY = -cmds[fromProgress-1].y * zoomFactor; - } else if (fromProgress === 0 && layerNum == 0) { - if (model[0] && model[0].x !== undefined && model[0].y !== undefined) { - prevX = model[0].x * zoomFactor; - prevY = -model[0].y * zoomFactor; - } else { - prevX = 0; - prevY = 0; - } - } else if(typeof(cmds[0].prevX) !== 'undefined' && typeof(cmds[0].prevY) !== 'undefined') { + //~~ find our initial prevX/prevY tuple + + if (cmds[0].prevX !== undefined && cmds[0].prevY !== undefined) { + // command contains prevX/prevY values, use those prevX = cmds[0].prevX * zoomFactor; - prevY = -cmds[0].prevY * zoomFactor; - } else { - if (model[layerNum-1]) { - prevX = undefined; - prevY = undefined; - for (i = model[layerNum-1].length-1; i >= 0; i--) { - if (prevX === undefined && model[layerNum-1][i].x !== undefined) prevX = model[layerNum-1][i].x * zoomFactor; - if (prevY === undefined && model[layerNum-1][i].y !== undefined) prevY =- model[layerNum-1][i].y * zoomFactor; - } - if (prevX === undefined) prevX=0; - if (prevY === undefined) prevY=0; - } else { - prevX = 0; - prevY = 0; + prevY = -1 * cmds[0].prevY * zoomFactor; + } else if (fromProgress > 0) { + // previous command in same layer exists, use x/y as prevX/prevY + prevX = cmds[fromProgress - 1].x * zoomFactor; + prevY = -cmds[fromProgress - 1].y * zoomFactor; + } else if (model[layerNum - 1]) { + // previous layer exists, use last x/y as prevX/prevY + prevX = undefined; + prevY = undefined; + for (i = model[layerNum-1].length-1; i >= 0; i--) { + if (prevX === undefined && model[layerNum - 1][i].x !== undefined) prevX = model[layerNum - 1][i].x * zoomFactor; + if (prevY === undefined && model[layerNum - 1][i].y !== undefined) prevY =- model[layerNum - 1][i].y * zoomFactor; } } + // if we did not find prevX or prevY, set it to 0 (might be that we are on the first command of the first layer, + // or it's just a very weird model...) + if (prevX === undefined) prevX = 0; + if (prevY === undefined) prevY = 0; + + //~~ render this layer's commands + for (i = fromProgress; i <= toProgress; i++) { ctx.lineWidth = 1; if (typeof(cmds[i]) === 'undefined') continue; if (typeof(cmds[i].prevX) !== 'undefined' && typeof(cmds[i].prevY) !== 'undefined') { + // override new (prevX, prevY) prevX = cmds[i].prevX * zoomFactor; - prevY = -cmds[i].prevY * zoomFactor; + prevY = -1 * cmds[i].prevY * zoomFactor; } + // new x if (typeof(cmds[i].x) === 'undefined' || isNaN(cmds[i].x)) { x = prevX / zoomFactor; } else { x = cmds[i].x; } + + // new y if (typeof(cmds[i].y) === 'undefined' || isNaN(cmds[i].y)) { y = prevY / zoomFactor; } else { y = -cmds[i].y; } + // current tool var tool = cmds[i].tool; if (tool === undefined) tool = 0; + // line color based on tool var lineColor = renderOptions["colorLine"][tool]; if (lineColor === undefined) lineColor = renderOptions["colorLine"][0]; + // alpha value (100% if current layer is being rendered, 30% otherwise) var alpha = (renderOptions['showNextLayer'] || renderOptions['showPreviousLayer']) && isNotCurrentLayer ? 0.3 : 1.0; var shade = tool * 0.15; + if (!cmds[i].extrude && !cmds[i].noMove) { + // neither extrusion nor move if (cmds[i].retract == -1) { + // retract => draw dot if configured to do so if (renderOptions["showRetracts"]) { ctx.strokeStyle = pusher.color(renderOptions["colorRetract"]).shade(shade).alpha(alpha).html(); ctx.fillStyle = pusher.color(renderOptions["colorRetract"]).shade(shade).alpha(alpha).html(); @@ -307,7 +373,9 @@ GCODE.renderer = (function(){ ctx.fill(); } } + if(renderOptions["showMoves"]){ + // move => draw line from (prevX, prevY) to (x, y) in move color ctx.strokeStyle = pusher.color(renderOptions["colorMove"]).shade(shade).alpha(alpha).html(); ctx.beginPath(); ctx.moveTo(prevX, prevY); @@ -316,6 +384,7 @@ GCODE.renderer = (function(){ } } else if(cmds[i].extrude) { if (cmds[i].retract == 0) { + // no retraction => real extrusion move, use tool color to draw line ctx.strokeStyle = pusher.color(renderOptions["colorLine"][tool]).shade(shade).alpha(alpha).html(); ctx.lineWidth = renderOptions['extrusionWidth']; ctx.beginPath(); @@ -323,6 +392,7 @@ GCODE.renderer = (function(){ ctx.lineTo(x*zoomFactor,y*zoomFactor); ctx.stroke(); } else { + // we were previously retracting, now we are restarting => draw dot if configured to do so if (renderOptions["showRetracts"]) { ctx.strokeStyle = pusher.color(renderOptions["colorRestart"]).shade(shade).alpha(alpha).html(); ctx.fillStyle = pusher.color(renderOptions["colorRestart"]).shade(shade).alpha(alpha).html(); @@ -333,6 +403,8 @@ GCODE.renderer = (function(){ } } } + + // set new (prevX, prevY) prevX = x * zoomFactor; prevY = y * zoomFactor; } @@ -340,10 +412,12 @@ GCODE.renderer = (function(){ }; var applyOffsets = function(mdlInfo) { + var canvasCenter; + // determine bed and model offsets if (ctx) ctx.translate(-offsetModelX, -offsetModelY); if (renderOptions["centerViewport"] || renderOptions["zoomInOnModel"]) { - var canvasCenter = ctx.transformedPoint(canvas.width / 2, canvas.height / 2); + canvasCenter = ctx.transformedPoint(canvas.width / 2, canvas.height / 2); if (mdlInfo) { offsetModelX = canvasCenter.x - (mdlInfo.min.x + mdlInfo.modelSize.x / 2) * zoomFactor; offsetModelY = canvasCenter.y + (mdlInfo.min.y + mdlInfo.modelSize.y / 2) * zoomFactor; @@ -358,6 +432,12 @@ GCODE.renderer = (function(){ offsetModelY = -1 * (renderOptions["bed"]["y"] / 2 - (mdlInfo.min.y + mdlInfo.modelSize.y / 2)) * zoomFactor; offsetBedX = -1 * (renderOptions["bed"]["x"] / 2 - (mdlInfo.min.x + mdlInfo.modelSize.x / 2)) * zoomFactor; offsetBedY = (renderOptions["bed"]["y"] / 2 - (mdlInfo.min.y + mdlInfo.modelSize.y / 2)) * zoomFactor; + } else if (renderOptions["bed"]["circular"]) { + canvasCenter = ctx.transformedPoint(canvas.width / 2, canvas.height / 2); + offsetModelX = canvasCenter.x; + offsetModelY = canvasCenter.y; + offsetBedX = 0; + offsetBedY = 0; } else { offsetModelX = 0; offsetModelY = 0; @@ -381,8 +461,8 @@ GCODE.renderer = (function(){ var scaleF = mdlInfo.modelSize.x > mdlInfo.modelSize.y ? (canvas.width - 10) / mdlInfo.modelSize.x : (canvas.height - 10) / mdlInfo.modelSize.y; scaleF /= zoomFactor; if (transform.a && transform.d) { - scaleX = scaleF / transform.a; - scaleY = scaleF / transform.d; + scaleX = scaleF / transform.a * (renderOptions["invertAxes"]["x"] ? -1 : 1); + scaleY = scaleF / transform.d * (renderOptions["invertAxes"]["y"] ? -1 : 1); ctx.translate(pt.x,pt.y); ctx.scale(scaleX, scaleY); ctx.translate(-pt.x, -pt.y); @@ -393,13 +473,47 @@ GCODE.renderer = (function(){ } }; + var applyInversion = function() { + var width = canvas.width - 10; + var height = canvas.height - 10; + + if (currentInvertX || currentInvertY) { + ctx.scale(currentInvertX ? -1 : 1, currentInvertY ? -1 : 1); + ctx.translate(currentInvertX ? -width : 0, currentInvertY ? height : 0); + } + + var invertX = renderOptions["invertAxes"]["x"]; + var invertY = renderOptions["invertAxes"]["y"]; + if (invertX || invertY) { + ctx.translate(invertX ? width : 0, invertY ? -height : 0); + ctx.scale(invertX ? -1 : 1, invertY ? -1 : 1); + } + + currentInvertX = invertX; + currentInvertY = invertY; + }; + // ***** PUBLIC ******* return { init: function(){ startCanvas(); initialized = true; - zoomFactor = Math.min((canvas.width - 10) / renderOptions["bed"]["x"], (canvas.height - 10) / renderOptions["bed"]["y"]); - ctx.translate((canvas.width - renderOptions["bed"]["x"] * zoomFactor) / 2, renderOptions["bed"]["y"] * zoomFactor + (canvas.height - renderOptions["bed"]["y"] * zoomFactor) / 2); + var bedWidth = renderOptions["bed"]["x"]; + var bedHeight = renderOptions["bed"]["y"]; + if(renderOptions["bed"]["circular"]) { + bedWidth = bedHeight = renderOptions["bed"]["r"] * 2; + } + zoomFactor = Math.min((canvas.width - 10) / bedWidth, (canvas.height - 10) / bedHeight); + + var translationX, translationY; + if (renderOptions["bed"]["circular"]) { + translationX = canvas.width / 2; + translationY = canvas.height / 2; + } else { + translationX = (canvas.width - bedWidth * zoomFactor) / 2; + translationY = bedHeight * zoomFactor + (canvas.height - bedHeight * zoomFactor) / 2; + } + ctx.translate(translationX, translationY); offsetModelX = 0; offsetModelY = 0; @@ -416,7 +530,7 @@ GCODE.renderer = (function(){ dirty = true; renderOptions[opt] = options[opt]; - if ($.inArray(opt, ["moveModel", "centerViewport", "zoomInOnModel", "bed"])) { + if ($.inArray(opt, ["moveModel", "centerViewport", "zoomInOnModel", "bed", "invertAxes"])) { mustRefresh = true; } } @@ -497,6 +611,7 @@ GCODE.renderer = (function(){ } } + applyInversion(); applyOffsets(mdlInfo); applyZoom(mdlInfo); diff --git a/src/octoprint/static/gcodeviewer/js/ui.js b/src/octoprint/static/gcodeviewer/js/ui.js index 8f5a42fbe..47d539fd9 100644 --- a/src/octoprint/static/gcodeviewer/js/ui.js +++ b/src/octoprint/static/gcodeviewer/js/ui.js @@ -180,8 +180,12 @@ GCODE.ui = (function(){ updateOptions: function(options) { setOptions(options.ui); - GCODE.gCodeReader.setOption(options.reader); - GCODE.renderer.setOption(options.renderer); + if (options.reader) { + GCODE.gCodeReader.setOption(options.reader); + } + if (options.renderer) { + GCODE.renderer.setOption(options.renderer); + } }, changeSelectedLayer: function(newLayerNum) { diff --git a/src/octoprint/static/js/app/dataupdater.js b/src/octoprint/static/js/app/dataupdater.js index 978613d21..577665e80 100644 --- a/src/octoprint/static/js/app/dataupdater.js +++ b/src/octoprint/static/js/app/dataupdater.js @@ -27,31 +27,17 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM self._socket.onopen = self._onconnect; self._socket.onclose = self._onclose; self._socket.onmessage = self._onmessage; - } + }; self.reconnect = function() { delete self._socket; self.connect(); - } + }; self._onconnect = function() { self._autoReconnecting = false; self._autoReconnectTrial = 0; - - if ($("#offline_overlay").is(":visible")) { - $("#offline_overlay").hide(); - self.logViewModel.requestData(); - self.timelapseViewModel.requestData(); - $("#webcam_image").attr("src", CONFIG_WEBCAM_STREAM + "?" + new Date().getTime()); - self.loginStateViewModel.requestData(); - self.gcodeFilesViewModel.requestData(); - self.gcodeViewModel.reset(); - - if ($('#tabs li[class="active"] a').attr("href") == "#control") { - $("#webcam_image").attr("src", CONFIG_WEBCAM_STREAM + "?" + new Date().getTime()); - } - } - } + }; self._onclose = function() { $("#offline_overlay_message").html( @@ -70,20 +56,43 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM } else { self._onreconnectfailed(); } - } + }; self._onreconnectfailed = function() { $("#offline_overlay_message").html( "The server appears to be offline, at least I'm not getting any response from it. I could not reconnect automatically, " + "but you may try a manual reconnect using the button below." ); - } + }; self._onmessage = function(e) { for (var prop in e.data) { var data = e.data[prop]; switch (prop) { + case "connected": { + // update the current UI API key and send it with any request + UI_API_KEY = data["apikey"]; + $.ajaxSetup({ + headers: {"X-Api-Key": UI_API_KEY} + }); + + if ($("#offline_overlay").is(":visible")) { + $("#offline_overlay").hide(); + self.logViewModel.requestData(); + self.timelapseViewModel.requestData(); + $("#webcam_image").attr("src", CONFIG_WEBCAM_STREAM + "?" + new Date().getTime()); + self.loginStateViewModel.requestData(); + self.gcodeFilesViewModel.requestData(); + self.gcodeViewModel.reset(); + + if ($('#tabs li[class="active"] a').attr("href") == "#control") { + $("#webcam_image").attr("src", CONFIG_WEBCAM_STREAM + "?" + new Date().getTime()); + } + } + + break; + } case "history": { self.connectionViewModel.fromHistoryData(data); self.printerStateViewModel.fromHistoryData(data); @@ -109,6 +118,7 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM case "event": { var type = data["type"]; var payload = data["payload"]; + var html = ""; var gcodeUploadProgress = $("#gcode_upload_progress"); var gcodeUploadProgressBar = $(".bar", gcodeUploadProgress); @@ -116,12 +126,14 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM if ((type == "UpdatedFiles" && payload.type == "gcode") || type == "MetadataAnalysisFinished") { gcodeFilesViewModel.requestData(); } else if (type == "MovieRendering") { - $.pnotify({title: "Rendering timelapse", text: "Now rendering timelapse " + payload.movie_basename}); + new PNotify({title: "Rendering timelapse", text: "Now rendering timelapse " + payload.movie_basename}); } else if (type == "MovieDone") { - $.pnotify({title: "Timelapse ready", text: "New timelapse " + payload.movie_basename + " is done rendering."}); + new PNotify({title: "Timelapse ready", text: "New timelapse " + payload.movie_basename + " is done rendering."}); timelapseViewModel.requestData(); } else if (type == "MovieFailed") { - $.pnotify({title: "Rendering failed", text: "Rendering of timelapse " + payload.movie_basename + " failed, return code " + payload.returncode, type: "error"}); + html = "

Rendering of timelapse " + payload.movie_basename + " failed with return code " + payload.returncode + "

"; + html += pnotifyAdditionalInfo('
' + payload.error + '
'); + new PNotify({title: "Rendering failed", text: html, type: "error", hide: false}); } else if (type == "SlicingStarted") { gcodeUploadProgress.addClass("progress-striped").addClass("active"); gcodeUploadProgressBar.css("width", "100%"); @@ -130,13 +142,15 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM gcodeUploadProgress.removeClass("progress-striped").removeClass("active"); gcodeUploadProgressBar.css("width", "0%"); gcodeUploadProgressBar.text(""); - $.pnotify({title: "Slicing done", text: "Sliced " + payload.stl + " to " + payload.gcode + ", took " + _.sprintf("%.2f", payload.time) + " seconds"}); + new PNotify({title: "Slicing done", text: "Sliced " + payload.stl + " to " + payload.gcode + ", took " + _.sprintf("%.2f", payload.time) + " seconds"}); gcodeFilesViewModel.requestData(payload.gcode); } else if (type == "SlicingFailed") { gcodeUploadProgress.removeClass("progress-striped").removeClass("active"); gcodeUploadProgressBar.css("width", "0%"); gcodeUploadProgressBar.text(""); - $.pnotify({title: "Slicing failed", text: "Could not slice " + payload.stl + " to " + payload.gcode + ": " + payload.reason, type: "error"}); + + html = "Could not slice " + payload.stl + " to " + payload.gcode + ": " + payload.reason; + new PNotify({title: "Slicing failed", text: html, type: "error", hide: false}); } else if (type == "TransferStarted") { gcodeUploadProgress.addClass("progress-striped").addClass("active"); gcodeUploadProgressBar.css("width", "100%"); @@ -145,7 +159,7 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM gcodeUploadProgress.removeClass("progress-striped").removeClass("active"); gcodeUploadProgressBar.css("width", "0%"); gcodeUploadProgressBar.text(""); - $.pnotify({title: "Streaming done", text: "Streamed " + payload.local + " to " + payload.remote + " on SD, took " + _.sprintf("%.2f", payload.time) + " seconds"}); + new PNotify({title: "Streaming done", text: "Streamed " + payload.local + " to " + payload.remote + " on SD, took " + _.sprintf("%.2f", payload.time) + " seconds"}); gcodeFilesViewModel.requestData(payload.remote, "sdcard"); } break; @@ -160,7 +174,7 @@ function DataUpdater(loginStateViewModel, connectionViewModel, printerStateViewM } } } - } + }; self.connect(); } diff --git a/src/octoprint/static/js/app/helpers.js b/src/octoprint/static/js/app/helpers.js index a04072aef..66066a5d5 100644 --- a/src/octoprint/static/js/app/helpers.js +++ b/src/octoprint/static/js/app/helpers.js @@ -8,6 +8,8 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor self.defaultFilters = defaultFilters; self.exclusiveFilters = exclusiveFilters; + self.searchFunction = undefined; + self.allItems = []; self.items = ko.observableArray([]); @@ -21,12 +23,12 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor self.refresh = function() { self._updateItems(); - } + }; self.updateItems = function(items) { self.allItems = items; self._updateItems(); - } + }; self.selectItem = function(matcher) { var itemList = self.items(); @@ -36,37 +38,41 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor break; } } - } + }; self.selectNone = function() { self.selectedItem(undefined); - } + }; self.isSelected = function(data) { return self.selectedItem() == data; - } + }; self.isSelectedByMatcher = function(matcher) { return matcher(self.selectedItem()); - } + }; //~~ pagination self.paginatedItems = ko.dependentObservable(function() { if (self.items() == undefined) { return []; + } else if (self.pageSize() == 0) { + return self.items(); } else { var from = Math.max(self.currentPage() * self.pageSize(), 0); var to = Math.min(from + self.pageSize(), self.items().length); return self.items().slice(from, to); } - }) + }); self.lastPage = ko.dependentObservable(function() { - return Math.ceil(self.items().length / self.pageSize()) - 1; - }) + return (self.pageSize() == 0 ? 1 : Math.ceil(self.items().length / self.pageSize()) - 1); + }); self.pages = ko.dependentObservable(function() { var pages = []; - if (self.lastPage() < 7) { + if (self.pageSize() == 0) { + pages.push({ number: 0, text: 1 }); + } else if (self.lastPage() < 7) { for (var i = 0; i < self.lastPage() + 1; i++) { pages.push({ number: i, text: i+1 }); } @@ -92,7 +98,7 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor pages.push({ number: self.lastPage(), text: self.lastPage() + 1}) } return pages; - }) + }); self.switchToItem = function(matcher) { var pos = -1; @@ -108,23 +114,22 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor var page = Math.floor(pos / self.pageSize()); self.changePage(page); } - } + }; self.changePage = function(newPage) { if (newPage < 0 || newPage > self.lastPage()) return; self.currentPage(newPage); - } - self.prevPage = function() { + }; self.prevPage = function() { if (self.currentPage() > 0) { self.currentPage(self.currentPage() - 1); } - } + }; self.nextPage = function() { if (self.currentPage() < self.lastPage()) { self.currentPage(self.currentPage() + 1); } - } + }; self.getItem = function(matcher) { var itemList = self.items(); @@ -135,7 +140,19 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor } return undefined; - } + }; + + //~~ searching + + self.changeSearchFunction = function(searchFunction) { + self.searchFunction = searchFunction; + self.changePage(0); + self._updateItems(); + }; + + self.resetSearch = function() { + self.changeSearchFunction(undefined); + }; //~~ sorting @@ -148,7 +165,7 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor self.changePage(0); self._updateItems(); - } + }; //~~ filtering @@ -161,7 +178,7 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor } else { self.addFilter(filter); } - } + }; self.addFilter = function(filter) { if (!_.contains(_.keys(self.supportedFilters), filter)) @@ -184,7 +201,7 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor self.changePage(0); self._updateItems(); - } + }; self.removeFilter = function(filter) { if (!_.contains(_.keys(self.supportedFilters), filter)) @@ -197,7 +214,7 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor self.changePage(0); self._updateItems(); - } + }; //~~ update for sorted and filtered view @@ -219,13 +236,18 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor result = _.filter(result, supportedFilters[filter]); }); + // search if necessary + if (typeof self.searchFunction !== undefined && self.searchFunction) { + result = _.filter(result, self.searchFunction); + } + // sort if necessary if (typeof comparator !== undefined) result.sort(comparator); // set result list self.items(result); - } + }; //~~ local storage @@ -237,7 +259,7 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor else localStorage[self.listType + "." + "currentSorting"] = undefined; } - } + }; self._loadCurrentSortingFromLocalStorage = function() { if ( self._initializeLocalStorage() ) { @@ -246,20 +268,20 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor else self.currentSorting(defaultSorting); } - } + }; self._saveCurrentFiltersToLocalStorage = function() { if ( self._initializeLocalStorage() ) { var filters = _.intersection(_.keys(self.supportedFilters), self.currentFilters()); localStorage[self.listType + "." + "currentFilters"] = JSON.stringify(filters); } - } + }; self._loadCurrentFiltersFromLocalStorage = function() { if ( self._initializeLocalStorage() ) { self.currentFilters(_.intersection(_.keys(self.supportedFilters), JSON.parse(localStorage[self.listType + "." + "currentFilters"]))); } - } + }; self._initializeLocalStorage = function() { if (!Modernizr.localstorage) @@ -272,7 +294,7 @@ function ItemListHelper(listType, supportedSorting, supportedFilters, defaultSor localStorage[self.listType + "." + "currentFilters"] = JSON.stringify(self.defaultFilters); return true; - } + }; self._loadCurrentFiltersFromLocalStorage(); self._loadCurrentSortingFromLocalStorage(); @@ -293,6 +315,7 @@ function formatSize(bytes) { function formatDuration(seconds) { if (!seconds) return "-"; + if (seconds < 0) return "00:00:00"; var s = seconds % 60; var m = (seconds % 3600) / 60; @@ -306,6 +329,11 @@ function formatDate(unixTimestamp) { return moment.unix(unixTimestamp).format("YYYY-MM-DD HH:mm"); } +function formatTimeAgo(unixTimestamp) { + if (!unixTimestamp) return "-"; + return moment.unix(unixTimestamp).fromNow(); +} + function formatFilament(filament) { if (!filament || !filament["length"]) return "-"; var result = _.sprintf("%.02fm", (filament["length"] / 1000)); @@ -324,3 +352,10 @@ function formatTemperature(temp) { if (!temp || temp < 10) return "off"; return _.sprintf("%.1f°C", temp); } + +function pnotifyAdditionalInfo(inner) { + return '
' + + '' + + '
' + inner + '
' + + '
'; +} diff --git a/src/octoprint/static/js/app/main.js b/src/octoprint/static/js/app/main.js index c649279db..ab23d9e7d 100644 --- a/src/octoprint/static/js/app/main.js +++ b/src/octoprint/static/js/app/main.js @@ -25,9 +25,11 @@ $(function() { gcodeFilesViewModel, timelapseViewModel, gcodeViewModel, - logViewModel + logViewModel ); - + + PNotify.prototype.options.styling = "bootstrap2"; + // work around a stupid iOS6 bug where ajax requests get cached and only work once, as described at // http://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results $.ajaxSetup({ @@ -35,6 +37,11 @@ $(function() { headers: { "cache-control": "no-cache" } }); + // send the current UI API key with any request + $.ajaxSetup({ + headers: {"X-Api-Key": UI_API_KEY} + }); + //~~ Show settings - to ensure centered $('#navbar_show_settings').click(function() { $('#settings_dialog').modal() @@ -52,25 +59,15 @@ $(function() { terminalViewModel.updateOutput(); }); - var webcamDisableTimeout; - $('#tabs a[data-toggle="tab"]').on('show', function (e) { - var current = e.target; - var previous = e.relatedTarget; + //~~ File list - if (current.hash == "#control") { - clearTimeout(webcamDisableTimeout); - var webcamImage = $("#webcam_image"); - var currentSrc = webcamImage.attr("src"); - if (currentSrc === undefined || currentSrc.trim() == "") { - webcamImage.attr("src", CONFIG_WEBCAM_STREAM + "?" + new Date().getTime()); - } - } else if (previous.hash == "#control") { - // only disable webcam stream if tab is out of focus for more than 5s, otherwise we might cause - // more load by the constant connection creation than by the actual webcam stream - webcamDisableTimeout = setTimeout(function() { - $("#webcam_image").attr("src", ""); - }, 5000); - } + $(".gcode_files").slimScroll({ + height: "306px", + size: "5px", + distance: "0", + railVisible: true, + alwaysVisible: true, + scrollBy: "102px" }); //~~ Gcode upload @@ -95,9 +92,11 @@ $(function() { } function gcode_upload_fail(e, data) { - $.pnotify({ + var error = "

Could not upload the file. Make sure that it is a GCODE file and has the extension \".gcode\" or \".gco\" or that it is an STL file with the extension \".stl\" and slicing support is enabled and configured.

"; + error += pnotifyAdditionalInfo("
" + data.jqXHR.responseText + "
"); + new PNotify({ title: "Upload failed", - text: "

Could not upload the file. Make sure that it is a GCODE file and has the extension \".gcode\" or \".gco\" or that it is an STL file with the extension \".stl\" and Cura support is enabled and configured.

Server reported:

" + data.jqXHR.responseText + "

", + text: error, type: "error", hide: false }); @@ -286,12 +285,24 @@ $(function() { }; $(element).popover(options); } - } + }; ko.bindingHandlers.allowBindings = { - init: function (elem, valueAccessor) { - return { controlsDescendantBindings: !valueAccessor() }; - } + init: function (elem, valueAccessor) { + return { controlsDescendantBindings: !valueAccessor() }; + } + }; + + ko.bindingHandlers.slimScrolledForeach = { + init: function(element, valueAccessor, allBindings, viewModel, bindingContext) { + return ko.bindingHandlers.foreach.init(element, valueAccessor(), allBindings, viewModel, bindingContext); + }, + update: function(element, valueAccessor, allBindings, viewModel, bindingContext) { + setTimeout(function() { + $(element).slimScroll({scrollBy: 0}); + }, 10); + return ko.bindingHandlers.foreach.update(element, valueAccessor(), allBindings, viewModel, bindingContext); + } }; ko.applyBindings(connectionViewModel, document.getElementById("connection_accordion")); @@ -340,22 +351,42 @@ $(function() { //~~ UI stuff + var webcamDisableTimeout; + $('#tabs a[data-toggle="tab"]').on('show', function (e) { + var current = e.target; + var previous = e.relatedTarget; + + if (current.hash == "#control") { + clearTimeout(webcamDisableTimeout); + var webcamImage = $("#webcam_image"); + var currentSrc = webcamImage.attr("src"); + if (currentSrc === undefined || currentSrc.trim() == "") { + webcamImage.attr("src", CONFIG_WEBCAM_STREAM + "?" + new Date().getTime()); + } + } else if (previous.hash == "#control") { + // only disable webcam stream if tab is out of focus for more than 5s, otherwise we might cause + // more load by the constant connection creation than by the actual webcam stream + webcamDisableTimeout = setTimeout(function() { + $("#webcam_image").attr("src", ""); + }, 5000); + } + }); + $(".accordion-toggle[href='#files']").click(function() { - if ($("#files").hasClass("in")) { - $("#files").removeClass("overflow_visible"); + var files = $("#files"); + if (files.hasClass("in")) { + files.removeClass("overflow_visible"); } else { setTimeout(function() { - $("#files").addClass("overflow_visible"); + files.addClass("overflow_visible"); }, 1000); } - }) - - $.pnotify.defaults.history = false; + }); $.fn.modal.defaults.maxHeight = function(){ // subtract the height of the modal header and footer return $(window).height() - 165; - } + }; // Fix input element click problem on login dialog $(".dropdown input, .dropdown label").click(function(e) { @@ -371,6 +402,10 @@ $(function() { ko.applyBindings(firstRunViewModel, document.getElementById("first_run_dialog")); firstRunViewModel.showDialog(); } + + var html = "

Rendering of timelapse someTimelapse.mpg failed with return code someReturnCode

"; + html += pnotifyAdditionalInfo('
some Error\nwith\nsome\nlines
'); + new PNotify({title: "Rendering failed", text: html, type: "error", hide: false}); } ); diff --git a/src/octoprint/static/js/app/viewmodels/files.js b/src/octoprint/static/js/app/viewmodels/files.js index c3717abb6..115ea6183 100644 --- a/src/octoprint/static/js/app/viewmodels/files.js +++ b/src/octoprint/static/js/app/viewmodels/files.js @@ -13,6 +13,11 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel) { self.isLoading = ko.observable(undefined); self.isSdReady = ko.observable(undefined); + self.searchQuery = ko.observable(undefined); + self.searchQuery.subscribe(function() { + self.performSearch(); + }); + self.freeSpace = ko.observable(undefined); self.freeSpaceString = ko.computed(function() { if (!self.freeSpace()) @@ -57,7 +62,7 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel) { "name", [], [["sd", "local"]], - CONFIG_GCODEFILESPERPAGE + 0 ); self.isLoadActionPossible = ko.computed(function() { @@ -125,7 +130,11 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel) { if (locationToFocus === undefined) { locationToFocus = "local"; } - self.listHelper.switchToItem(function(item) {return item.name == filenameToFocus && item.origin == locationToFocus}); + var entryElement = self.getEntryElement({name: filenameToFocus, origin: locationToFocus}); + if (entryElement) { + var entryOffset = entryElement.offsetTop; + $(".gcode_files").slimScroll({ scrollTo: entryOffset + "px" }); + } } if (response.free) { @@ -190,31 +199,20 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel) { }); }; - self.getPopoverContent = function(data) { - var output = "

Uploaded: " + formatDate(data["date"]) + "

"; - if (data["gcodeAnalysis"]) { - output += "

"; - if (data["gcodeAnalysis"]["filament"] && typeof(data["gcodeAnalysis"]["filament"]) == "object") { - var filament = data["gcodeAnalysis"]["filament"]; - if (_.keys(filament).length == 1) { - output += "Filament: " + formatFilament(data["gcodeAnalysis"]["filament"]["tool" + 0]) + "
"; - } else { - var i = 0; - do { - output += "Filament (Tool " + i + "): " + formatFilament(data["gcodeAnalysis"]["filament"]["tool" + i]) + "
"; - i++; - } while (filament.hasOwnProperty("tool" + i)); - } - } - output += "Estimated Print Time: " + formatDuration(data["gcodeAnalysis"]["estimatedPrintTime"]); - output += "

"; + self.downloadLink = function(data) { + if (data["refs"] && data["refs"]["download"]) { + return data["refs"]["download"]; + } else { + return false; } - if (data["prints"] && data["prints"]["last"]) { - output += "

"; - output += "Last Print: " + formatDate(data["prints"]["last"]["date"]) + ""; - output += "

"; + }; + + self.lastTimePrinted = function(data) { + if (data["prints"] && data["prints"]["last"] && data["prints"]["last"]["date"]) { + return data["prints"]["last"]["date"]; + } else { + return "-"; } - return output; }; self.getSuccessClass = function(data) { @@ -224,6 +222,20 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel) { return data["prints"]["last"]["success"] ? "text-success" : "text-error"; }; + self.getEntryId = function(data) { + return "gcode_file_" + md5(data["name"] + ":" + data["origin"]); + }; + + self.getEntryElement = function(data) { + var entryId = self.getEntryId(data); + var entryElements = $("#" + entryId); + if (entryElements && entryElements[0]) { + return entryElements[0]; + } else { + return undefined; + } + }; + self.enableRemove = function(data) { return self.loginState.isUser() && !(self.listHelper.isSelected(data) && (self.isPrinting() || self.isPaused())); }; @@ -233,5 +245,56 @@ function GcodeFilesViewModel(printerStateViewModel, loginStateViewModel) { return isLoadActionPossible && !self.listHelper.isSelected(data); }; + self.enableAdditionalData = function(data) { + return data["gcodeAnalysis"] || data["prints"] && data["prints"]["last"]; + }; + + self.toggleAdditionalData = function(data) { + var entryElement = self.getEntryElement(data); + if (!entryElement) return; + + var additionalInfo = $(".additionalInfo", entryElement); + additionalInfo.slideToggle("fast", function() { + $(".toggleAdditionalData i", entryElement).toggleClass("icon-chevron-down icon-chevron-up"); + }); + }; + + self.getAdditionalData = function(data) { + var output = ""; + if (data["gcodeAnalysis"]) { + if (data["gcodeAnalysis"]["filament"] && typeof(data["gcodeAnalysis"]["filament"]) == "object") { + var filament = data["gcodeAnalysis"]["filament"]; + if (_.keys(filament).length == 1) { + output += "Filament: " + formatFilament(data["gcodeAnalysis"]["filament"]["tool" + 0]) + "
"; + } else { + var i = 0; + do { + output += "Filament (Tool " + i + "): " + formatFilament(data["gcodeAnalysis"]["filament"]["tool" + i]) + "
"; + i++; + } while (filament.hasOwnProperty("tool" + i)); + } + } + output += "Estimated Print Time: " + formatDuration(data["gcodeAnalysis"]["estimatedPrintTime"]); + } + if (data["prints"] && data["prints"]["last"]) { + output += "
Last Printed: " + formatTimeAgo(data["prints"]["last"]["date"]); + if (data["prints"]["last"]["lastPrintTime"]) { + output += "
Last Print Time: " + formatDuration(data["prints"]["last"]["lastPrintTime"]); + } + } + return output; + }; + + self.performSearch = function() { + var query = self.searchQuery(); + if (query !== undefined && query.trim() != "") { + self.listHelper.changeSearchFunction(function(entry) { + return entry && entry["name"].toLocaleLowerCase().indexOf(query) > -1; + }); + } else { + self.listHelper.resetSearch(); + } + }; + } diff --git a/src/octoprint/static/js/app/viewmodels/gcode.js b/src/octoprint/static/js/app/viewmodels/gcode.js index efba29c09..9219a1efe 100644 --- a/src/octoprint/static/js/app/viewmodels/gcode.js +++ b/src/octoprint/static/js/app/viewmodels/gcode.js @@ -96,21 +96,38 @@ function GcodeViewModel(loginStateViewModel, settingsViewModel) { // subscribe to relevant printer settings... self.settings.printer_extruderOffsets.subscribe(function() { if (!self.enabled) return; + if (!self.settings.printer_extruderOffsets()) return; - var options = { + GCODE.ui.updateOptions({ reader: { toolOffsets: self.settings.printer_extruderOffsets() } - }; + }); + }); + self.settings.printer_bedDimensions.subscribe(function() { + if (!self.enabled) return; var bedDimensions = self.settings.printer_bedDimensions(); - if (bedDimensions && bedDimensions.hasOwnProperty("x") && bedDimensions.hasOwnProperty("y")) { - options["renderer"] = { - bed: self.settings.printer_bedDimensions() - } - } + if (!bedDimensions || (!bedDimensions.hasOwnProperty("x") && !bedDimensions.hasOwnProperty("y") && !bedDimensions.hasOwnProperty("r"))) return; - GCODE.ui.updateOptions(options); + GCODE.ui.updateOptions({ + renderer: { + bed: bedDimensions + } + }); + }); + self.settings.printer_invertAxes.subscribe(function() { + if (!self.enabled) return; + if (!self.settings.printer_invertAxes()) return; + + GCODE.ui.updateOptions({ + renderer: { + invertAxes: { + x: self.settings.printer_invertX(), + y: self.settings.printer_invertY() + } + } + }); }); self.loadedFilename = undefined; @@ -168,7 +185,7 @@ function GcodeViewModel(loginStateViewModel, settingsViewModel) { step: 1, value: 0, enabled: false, - formatter: function(value) { return "Layer #" + value; } + formatter: function(value) { return "Layer #" + (value + 1); } }).on("slide", self.changeLayer); }; @@ -288,7 +305,7 @@ function GcodeViewModel(loginStateViewModel, settingsViewModel) { self.approveLargeFile = function() { self.waitForApproval(false); self.loadFile(self.selectedFile.name(), self.selectedFile.date()); - } + }; self._onProgress = function(type, percentage) { self.ui_progress_type(type); @@ -333,7 +350,7 @@ function GcodeViewModel(loginStateViewModel, settingsViewModel) { self.currentCommand = [0, 1]; } else { var output = []; - output.push("Layer number: " + layer.number); + output.push("Layer number: " + (layer.number + 1)); output.push("Layer height (mm): " + layer.height); output.push("GCODE commands in layer: " + layer.commands); if (layer.filament.length == 1) { diff --git a/src/octoprint/static/js/app/viewmodels/loginstate.js b/src/octoprint/static/js/app/viewmodels/loginstate.js index 17f2859a4..f6d68557f 100644 --- a/src/octoprint/static/js/app/viewmodels/loginstate.js +++ b/src/octoprint/static/js/app/viewmodels/loginstate.js @@ -67,11 +67,11 @@ function LoginStateViewModel() { type: "POST", data: {"user": username, "pass": password, "remember": remember}, success: function(response) { - $.pnotify({title: "Login successful", text: "You are now logged in as \"" + response.name + "\"", type: "success"}); + new PNotify({title: "Login successful", text: "You are now logged in as \"" + response.name + "\"", type: "success"}); self.fromResponse(response); }, error: function(jqXHR, textStatus, errorThrown) { - $.pnotify({title: "Login failed", text: "User unknown or wrong password", type: "error"}); + new PNotify({title: "Login failed", text: "User unknown or wrong password", type: "error"}); } }) } @@ -81,7 +81,7 @@ function LoginStateViewModel() { url: API_BASEURL + "logout", type: "POST", success: function(response) { - $.pnotify({title: "Logout successful", text: "You are now logged out", type: "success"}); + new PNotify({title: "Logout successful", text: "You are now logged out", type: "success"}); self.fromResponse(response); } }) diff --git a/src/octoprint/static/js/app/viewmodels/navigation.js b/src/octoprint/static/js/app/viewmodels/navigation.js index 29d404155..7603a606c 100644 --- a/src/octoprint/static/js/app/viewmodels/navigation.js +++ b/src/octoprint/static/js/app/viewmodels/navigation.js @@ -14,10 +14,12 @@ function NavigationViewModel(loginStateViewModel, appearanceViewModel, settingsV dataType: "json", data: "action=" + action.action, success: function() { - $.pnotify({title: "Success", text: "The command \""+ action.name +"\" executed successfully", type: "success"}); + new PNotify({title: "Success", text: "The command \""+ action.name +"\" executed successfully", type: "success"}); }, error: function(jqXHR, textStatus, errorThrown) { - $.pnotify({title: "Error", text: "

The command \"" + action.name + "\" could not be executed.

Reason:

" + jqXHR.responseText + "

", type: "error"}); + var error = "

The command \"" + action.name + "\" could not be executed.

"; + error += pnotifyAdditionalInfo("
" + jqXHR.responseText + "
"); + new PNotify({title: "Error", text: error, type: "error", hide: false}); } }) } diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js index 1647d2b86..77828a083 100644 --- a/src/octoprint/static/js/app/viewmodels/settings.js +++ b/src/octoprint/static/js/app/viewmodels/settings.js @@ -68,16 +68,22 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) { self.printer_bedDimensionX = ko.observable(undefined); self.printer_bedDimensionY = ko.observable(undefined); + self.printer_bedDimensionR = ko.observable(undefined); + self.printer_bedCircular = ko.observable(undefined); self.printer_bedDimensions = ko.computed({ read: function () { return { x: parseFloat(self.printer_bedDimensionX()), - y: parseFloat(self.printer_bedDimensionY()) + y: parseFloat(self.printer_bedDimensionY()), + r: parseFloat(self.printer_bedDimensionR()), + circular: self.printer_bedCircular() }; }, write: function(value) { self.printer_bedDimensionX(value.x); self.printer_bedDimensionY(value.y); + self.printer_bedDimensionR(value.r); + self.printer_bedCircular(value.circular); }, owner: self }); @@ -177,7 +183,7 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) { if (callback) callback(); } }); - } + }; self.fromResponse = function(response) { self.api_enabled(response.api.enabled); @@ -238,7 +244,7 @@ function SettingsViewModel(loginStateViewModel, usersViewModel) { self.system_actions(response.system.actions); self.terminalFilters(response.terminalFilters); - } + }; self.saveData = function() { var data = { diff --git a/src/octoprint/static/js/app/viewmodels/users.js b/src/octoprint/static/js/app/viewmodels/users.js index 0f0c3cb3a..faaedf5bd 100644 --- a/src/octoprint/static/js/app/viewmodels/users.js +++ b/src/octoprint/static/js/app/viewmodels/users.js @@ -170,7 +170,7 @@ function UsersViewModel(loginStateViewModel) { if (user.name == loginStateViewModel.username()) { // we do not allow to delete ourselves - $.pnotify({title: "Not possible", text: "You may not delete your own account.", type: "error"}); + new PNotify({title: "Not possible", text: "You may not delete your own account.", type: "error"}); return; } diff --git a/src/octoprint/static/js/lib/jquery/jquery.pnotify.min.js b/src/octoprint/static/js/lib/jquery/jquery.pnotify.min.js deleted file mode 100644 index 801793916..000000000 --- a/src/octoprint/static/js/lib/jquery/jquery.pnotify.min.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * jQuery Pines Notify (pnotify) Plugin 1.2.0 - * - * http://pinesframework.org/pnotify/ - * Copyright (c) 2009-2012 Hunter Perrin - * - * Triple license under the GPL, LGPL, and MPL: - * http://www.gnu.org/licenses/gpl.html - * http://www.gnu.org/licenses/lgpl.html - * http://www.mozilla.org/MPL/MPL-1.1.html - */ -(function(d){var q,j,r,i=d(window),u={jqueryui:{container:"ui-widget ui-widget-content ui-corner-all",notice:"ui-state-highlight",notice_icon:"ui-icon ui-icon-info",info:"",info_icon:"ui-icon ui-icon-info",success:"ui-state-default",success_icon:"ui-icon ui-icon-circle-check",error:"ui-state-error",error_icon:"ui-icon ui-icon-alert",closer:"ui-icon ui-icon-close",pin_up:"ui-icon ui-icon-pin-w",pin_down:"ui-icon ui-icon-pin-s",hi_menu:"ui-state-default ui-corner-bottom",hi_btn:"ui-state-default ui-corner-all", -hi_btnhov:"ui-state-hover",hi_hnd:"ui-icon ui-icon-grip-dotted-horizontal"},bootstrap:{container:"alert",notice:"",notice_icon:"icon-exclamation-sign",info:"alert-info",info_icon:"icon-info-sign",success:"alert-success",success_icon:"icon-ok-sign",error:"alert-error",error_icon:"icon-warning-sign",closer:"icon-remove",pin_up:"icon-pause",pin_down:"icon-play",hi_menu:"well",hi_btn:"btn",hi_btnhov:"",hi_hnd:"icon-chevron-down"}},s=function(){r=d("body");i=d(window);i.bind("resize",function(){j&&clearTimeout(j); -j=setTimeout(d.pnotify_position_all,10)})};document.body?s():d(s);d.extend({pnotify_remove_all:function(){var e=i.data("pnotify");e&&e.length&&d.each(e,function(){this.pnotify_remove&&this.pnotify_remove()})},pnotify_position_all:function(){j&&clearTimeout(j);j=null;var e=i.data("pnotify");e&&e.length&&(d.each(e,function(){var d=this.opts.stack;if(d)d.nextpos1=d.firstpos1,d.nextpos2=d.firstpos2,d.addpos2=0,d.animation=true}),d.each(e,function(){this.pnotify_position()}))},pnotify:function(e){var g, -a;typeof e!="object"?(a=d.extend({},d.pnotify.defaults),a.text=e):a=d.extend({},d.pnotify.defaults,e);for(var p in a)typeof p=="string"&&p.match(/^pnotify_/)&&(a[p.replace(/^pnotify_/,"")]=a[p]);if(a.before_init&&a.before_init(a)===false)return null;var k,o=function(a,c){b.css("display","none");var f=document.elementFromPoint(a.clientX,a.clientY);b.css("display","block");var e=d(f),g=e.css("cursor");b.css("cursor",g!="auto"?g:"default");if(!k||k.get(0)!=f)k&&(n.call(k.get(0),"mouseleave",a.originalEvent), -n.call(k.get(0),"mouseout",a.originalEvent)),n.call(f,"mouseenter",a.originalEvent),n.call(f,"mouseover",a.originalEvent);n.call(f,c,a.originalEvent);k=e},f=u[a.styling],b=d("
",{"class":"ui-pnotify "+a.addclass,css:{display:"none"},mouseenter:function(l){a.nonblock&&l.stopPropagation();a.mouse_reset&&g=="out"&&(b.stop(true),g="in",b.css("height","auto").animate({width:a.width,opacity:a.nonblock?a.nonblock_opacity:a.opacity},"fast"));a.nonblock&&b.animate({opacity:a.nonblock_opacity},"fast"); -a.hide&&a.mouse_reset&&b.pnotify_cancel_remove();a.sticker&&!a.nonblock&&b.sticker.trigger("pnotify_icon").css("visibility","visible");a.closer&&!a.nonblock&&b.closer.css("visibility","visible")},mouseleave:function(l){a.nonblock&&l.stopPropagation();k=null;b.css("cursor","auto");a.nonblock&&g!="out"&&b.animate({opacity:a.opacity},"fast");a.hide&&a.mouse_reset&&b.pnotify_queue_remove();a.sticker_hover&&b.sticker.css("visibility","hidden");a.closer_hover&&b.closer.css("visibility","hidden");d.pnotify_position_all()}, -mouseover:function(b){a.nonblock&&b.stopPropagation()},mouseout:function(b){a.nonblock&&b.stopPropagation()},mousemove:function(b){a.nonblock&&(b.stopPropagation(),o(b,"onmousemove"))},mousedown:function(b){a.nonblock&&(b.stopPropagation(),b.preventDefault(),o(b,"onmousedown"))},mouseup:function(b){a.nonblock&&(b.stopPropagation(),b.preventDefault(),o(b,"onmouseup"))},click:function(b){a.nonblock&&(b.stopPropagation(),o(b,"onclick"))},dblclick:function(b){a.nonblock&&(b.stopPropagation(),o(b,"ondblclick"))}}); -b.opts=a;b.container=d("
",{"class":f.container+" ui-pnotify-container "+(a.type=="error"?f.error:a.type=="info"?f.info:a.type=="success"?f.success:f.notice)}).appendTo(b);a.cornerclass!=""&&b.container.removeClass("ui-corner-all").addClass(a.cornerclass);a.shadow&&b.container.addClass("ui-pnotify-shadow");b.pnotify_version="1.2.0";b.pnotify=function(l){var c=a;typeof l=="string"?a.text=l:a=d.extend({},a,l);for(var e in a)typeof e=="string"&&e.match(/^pnotify_/)&&(a[e.replace(/^pnotify_/,"")]= -a[e]);b.opts=a;a.cornerclass!=c.cornerclass&&b.container.removeClass("ui-corner-all").addClass(a.cornerclass);a.shadow!=c.shadow&&(a.shadow?b.container.addClass("ui-pnotify-shadow"):b.container.removeClass("ui-pnotify-shadow"));a.addclass===false?b.removeClass(c.addclass):a.addclass!==c.addclass&&b.removeClass(c.addclass).addClass(a.addclass);a.title===false?b.title_container.slideUp("fast"):a.title!==c.title&&(a.title_escape?b.title_container.text(a.title).slideDown(200):b.title_container.html(a.title).slideDown(200)); -a.text===false?b.text_container.slideUp("fast"):a.text!==c.text&&(a.text_escape?b.text_container.text(a.text).slideDown(200):b.text_container.html(a.insert_brs?String(a.text).replace(/\n/g,"
"):a.text).slideDown(200));b.pnotify_history=a.history;b.pnotify_hide=a.hide;a.type!=c.type&&b.container.removeClass(f.error+" "+f.notice+" "+f.success+" "+f.info).addClass(a.type=="error"?f.error:a.type=="info"?f.info:a.type=="success"?f.success:f.notice);if(a.icon!==c.icon||a.icon===true&&a.type!=c.type)b.container.find("div.ui-pnotify-icon").remove(), -a.icon!==false&&d("
",{"class":"ui-pnotify-icon"}).append(d("",{"class":a.icon===true?a.type=="error"?f.error_icon:a.type=="info"?f.info_icon:a.type=="success"?f.success_icon:f.notice_icon:a.icon})).prependTo(b.container);a.width!==c.width&&b.animate({width:a.width});a.min_height!==c.min_height&&b.container.animate({minHeight:a.min_height});a.opacity!==c.opacity&&b.fadeTo(a.animate_speed,a.opacity);!a.closer||a.nonblock?b.closer.css("display","none"):b.closer.css("display","block"); -!a.sticker||a.nonblock?b.sticker.css("display","none"):b.sticker.css("display","block");b.sticker.trigger("pnotify_icon");a.sticker_hover?b.sticker.css("visibility","hidden"):a.nonblock||b.sticker.css("visibility","visible");a.closer_hover?b.closer.css("visibility","hidden"):a.nonblock||b.closer.css("visibility","visible");a.hide?c.hide||b.pnotify_queue_remove():b.pnotify_cancel_remove();b.pnotify_queue_position();return b};b.pnotify_position=function(a){var c=b.opts.stack;if(c){if(!c.nextpos1)c.nextpos1= -c.firstpos1;if(!c.nextpos2)c.nextpos2=c.firstpos2;if(!c.addpos2)c.addpos2=0;var d=b.css("display")=="none";if(!d||a){var f,e={},g;switch(c.dir1){case "down":g="top";break;case "up":g="bottom";break;case "left":g="right";break;case "right":g="left"}a=parseInt(b.css(g));isNaN(a)&&(a=0);if(typeof c.firstpos1=="undefined"&&!d)c.firstpos1=a,c.nextpos1=c.firstpos1;var h;switch(c.dir2){case "down":h="top";break;case "up":h="bottom";break;case "left":h="right";break;case "right":h="left"}f=parseInt(b.css(h)); -isNaN(f)&&(f=0);if(typeof c.firstpos2=="undefined"&&!d)c.firstpos2=f,c.nextpos2=c.firstpos2;if(c.dir1=="down"&&c.nextpos1+b.height()>i.height()||c.dir1=="up"&&c.nextpos1+b.height()>i.height()||c.dir1=="left"&&c.nextpos1+b.width()>i.width()||c.dir1=="right"&&c.nextpos1+b.width()>i.width())c.nextpos1=c.firstpos1,c.nextpos2+=c.addpos2+(typeof c.spacing2=="undefined"?25:c.spacing2),c.addpos2=0;if(c.animation&&c.nextpos2c.addpos2)c.addpos2=b.height();break;case "left":case "right":if(b.outerWidth(true)>c.addpos2)c.addpos2=b.width()}if(c.nextpos1)if(c.animation&&(a>c.nextpos1||e.top||e.bottom||e.right||e.left))switch(c.dir1){case "down":e.top=c.nextpos1+"px";break;case "up":e.bottom=c.nextpos1+"px";break;case "left":e.right=c.nextpos1+"px"; -break;case "right":e.left=c.nextpos1+"px"}else b.css(g,c.nextpos1+"px");(e.top||e.bottom||e.right||e.left)&&b.animate(e,{duration:500,queue:false});switch(c.dir1){case "down":case "up":c.nextpos1+=b.height()+(typeof c.spacing1=="undefined"?25:c.spacing1);break;case "left":case "right":c.nextpos1+=b.width()+(typeof c.spacing1=="undefined"?25:c.spacing1)}}}};b.pnotify_queue_position=function(a){j&&clearTimeout(j);a||(a=10);j=setTimeout(d.pnotify_position_all,a)};b.pnotify_display=function(){b.parent().length|| -b.appendTo(r);a.before_open&&a.before_open(b)===false||(a.stack.push!="top"&&b.pnotify_position(true),a.animation=="fade"||a.animation.effect_in=="fade"?b.show().fadeTo(0,0).hide():a.opacity!=1&&b.show().fadeTo(0,a.opacity).hide(),b.animate_in(function(){a.after_open&&a.after_open(b);b.pnotify_queue_position();a.hide&&b.pnotify_queue_remove()}))};b.pnotify_remove=function(){if(b.timer)window.clearTimeout(b.timer),b.timer=null;a.before_close&&a.before_close(b)===false||b.animate_out(function(){a.after_close&& -a.after_close(b)===false||(b.pnotify_queue_position(),a.remove&&b.detach())})};b.animate_in=function(d){g="in";var c;c=typeof a.animation.effect_in!="undefined"?a.animation.effect_in:a.animation;c=="none"?(b.show(),d()):c=="show"?b.show(a.animate_speed,d):c=="fade"?b.show().fadeTo(a.animate_speed,a.opacity,d):c=="slide"?b.slideDown(a.animate_speed,d):typeof c=="function"?c("in",d,b):b.show(c,typeof a.animation.options_in=="object"?a.animation.options_in:{},a.animate_speed,d)};b.animate_out=function(d){g= -"out";var c;c=typeof a.animation.effect_out!="undefined"?a.animation.effect_out:a.animation;c=="none"?(b.hide(),d()):c=="show"?b.hide(a.animate_speed,d):c=="fade"?b.fadeOut(a.animate_speed,d):c=="slide"?b.slideUp(a.animate_speed,d):typeof c=="function"?c("out",d,b):b.hide(c,typeof a.animation.options_out=="object"?a.animation.options_out:{},a.animate_speed,d)};b.pnotify_cancel_remove=function(){b.timer&&window.clearTimeout(b.timer)};b.pnotify_queue_remove=function(){b.pnotify_cancel_remove();b.timer= -window.setTimeout(function(){b.pnotify_remove()},isNaN(a.delay)?0:a.delay)};b.closer=d("
",{"class":"ui-pnotify-closer",css:{cursor:"pointer",visibility:a.closer_hover?"hidden":"visible"},click:function(){b.pnotify_remove();b.sticker.css("visibility","hidden");b.closer.css("visibility","hidden")}}).append(d("",{"class":f.closer})).appendTo(b.container);(!a.closer||a.nonblock)&&b.closer.css("display","none");b.sticker=d("
",{"class":"ui-pnotify-sticker",css:{cursor:"pointer",visibility:a.sticker_hover? -"hidden":"visible"},click:function(){a.hide=!a.hide;a.hide?b.pnotify_queue_remove():b.pnotify_cancel_remove();d(this).trigger("pnotify_icon")}}).bind("pnotify_icon",function(){d(this).children().removeClass(f.pin_up+" "+f.pin_down).addClass(a.hide?f.pin_up:f.pin_down)}).append(d("",{"class":f.pin_up})).appendTo(b.container);(!a.sticker||a.nonblock)&&b.sticker.css("display","none");a.icon!==false&&d("
",{"class":"ui-pnotify-icon"}).append(d("",{"class":a.icon===true?a.type=="error"? -f.error_icon:a.type=="info"?f.info_icon:a.type=="success"?f.success_icon:f.notice_icon:a.icon})).prependTo(b.container);b.title_container=d("

",{"class":"ui-pnotify-title"}).appendTo(b.container);a.title===false?b.title_container.hide():a.title_escape?b.title_container.text(a.title):b.title_container.html(a.title);b.text_container=d("
",{"class":"ui-pnotify-text"}).appendTo(b.container);a.text===false?b.text_container.hide():a.text_escape?b.text_container.text(a.text):b.text_container.html(a.insert_brs? -String(a.text).replace(/\n/g,"
"):a.text);typeof a.width=="string"&&b.css("width",a.width);typeof a.min_height=="string"&&b.container.css("min-height",a.min_height);b.pnotify_history=a.history;b.pnotify_hide=a.hide;var h=i.data("pnotify");if(h==null||typeof h!="object")h=[];h=a.stack.push=="top"?d.merge([b],h):d.merge(h,[b]);i.data("pnotify",h);a.stack.push=="top"&&b.pnotify_queue_position(1);a.after_init&&a.after_init(b);if(a.history){var m=i.data("pnotify_history");typeof m=="undefined"&&(m= -d("
",{"class":"ui-pnotify-history-container "+f.hi_menu,mouseleave:function(){m.animate({top:"-"+q+"px"},{duration:100,queue:false})}}).append(d("
",{"class":"ui-pnotify-history-header",text:"Redisplay"})).append(d("
- - - - - - - - - - - - - - - -
NameSizeAction
-  |  |  -
+ +
+
+
+
Uploaded:
+
Size:
+
+
+
+ +
+
+
+
+
+
Free:
-
{% if enableSdSupport %} @@ -626,14 +617,16 @@ - + + + diff --git a/src/octoprint/templates/settings.jinja2 b/src/octoprint/templates/settings.jinja2 index 91c900e23..67d4ddd6f 100644 --- a/src/octoprint/templates/settings.jinja2 +++ b/src/octoprint/templates/settings.jinja2 @@ -166,7 +166,7 @@
-
+
@@ -178,6 +178,18 @@ mm
+
+ +
+ + mm +
+
+
+ +
diff --git a/src/octoprint/timelapse.py b/src/octoprint/timelapse.py index 2c3b2c827..0c4f45402 100644 --- a/src/octoprint/timelapse.py +++ b/src/octoprint/timelapse.py @@ -18,6 +18,7 @@ import octoprint.util as util from octoprint.settings import settings from octoprint.events import eventManager, Events +import sarge # currently configured timelapse current = None @@ -236,10 +237,15 @@ class Timelapse(object): return filename def _captureWorker(self, filename): - eventManager().fire(Events.CAPTURE_START, {"file": filename}); - urllib.urlretrieve(self._snapshotUrl, filename) - self._logger.debug("Image %s captured from %s" % (filename, self._snapshotUrl)) - eventManager().fire(Events.CAPTURE_DONE, {"file": filename}); + eventManager().fire(Events.CAPTURE_START, {"file": filename}) + try: + urllib.urlretrieve(self._snapshotUrl, filename) + self._logger.debug("Image %s captured from %s" % (filename, self._snapshotUrl)) + except: + self._logger.exception("Could not capture image %s from %s, decreasing image counter again" % (filename, self._snapshotUrl)) + if self._imageNumber is not None and self._imageNumber > 0: + self._imageNumber -= 1 + eventManager().fire(Events.CAPTURE_DONE, {"file": filename}) def _createMovie(self, success=True): ffmpeg = settings().get(["webcam", "ffmpeg"]) @@ -256,7 +262,7 @@ class Timelapse(object): # prepare ffmpeg command command = [ - ffmpeg, '-i', input, '-vcodec', 'mpeg2video', '-pix_fmt', 'yuv420p', '-r', str(self._fps), '-y', '-b:v', bitrate, + ffmpeg, '-loglevel', 'error', '-i', input, '-vcodec', 'mpeg2video', '-pix_fmt', 'yuv420p', '-r', str(self._fps), '-y', '-b:v', bitrate, '-f', 'vob'] filters = [] @@ -289,18 +295,24 @@ class Timelapse(object): if filterstring is not None: self._logger.debug("Applying videofilter chain: %s" % filterstring) - command.extend(["-vf", filterstring]) + command.extend(["-vf", sarge.shell_quote(filterstring)]) # finalize command with output file self._logger.debug("Rendering movie to %s" % output) command.append(output) eventManager().fire(Events.MOVIE_RENDERING, {"gcode": self._gcodeFile, "movie": output, "movie_basename": os.path.basename(output)}) - try: - subprocess.check_call(command) + + command_str = " ".join(command) + self._logger.debug("Executing command: %s" % command_str) + + p = sarge.run(command_str, stderr=sarge.Capture()) + if p.returncode == 0: eventManager().fire(Events.MOVIE_DONE, {"gcode": self._gcodeFile, "movie": output, "movie_basename": os.path.basename(output)}) - except subprocess.CalledProcessError as (e): - self._logger.warn("Could not render movie, got return code %r" % e.returncode) - eventManager().fire(Events.MOVIE_FAILED, {"gcode": self._gcodeFile, "movie": output, "movie_basename": os.path.basename(output), "returncode": e.returncode}) + else: + returncode = p.returncode + stderr_text = p.stderr.text + self._logger.warn("Could not render movie, got return code %r: %s" % (returncode, stderr_text)) + eventManager().fire(Events.MOVIE_FAILED, {"gcode": self._gcodeFile, "movie": output, "movie_basename": os.path.basename(output), "returncode": returncode, "error": stderr_text}) def cleanCaptureDir(self): if not os.path.isdir(self._captureDir): diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py index ae4bbe73c..5df97e7f0 100644 --- a/src/octoprint/util/__init__.py +++ b/src/octoprint/util/__init__.py @@ -8,11 +8,14 @@ import sys import time import re import tempfile +import logging from flask import make_response from octoprint.settings import settings, default_settings +logger = logging.getLogger(__name__) + def getFormattedSize(num): """ Taken from http://stackoverflow.com/a/1094933/2028598 @@ -171,6 +174,7 @@ def safeRename(old, new): os.remove(backup) except OSError: # if anything went wrong, try to rename the backup file to its original name + logger.error("Could not perform safe rename, trying to revert") if os.path.exists(backup): os.remove(new) os.rename(backup, new) @@ -225,3 +229,22 @@ def getJsonCommandFromRequest(request, valid_commands): return command, data, None + +def dict_merge(a, b): + '''recursively merges dict's. not just simple a['key'] = b['key'], if + both a and bhave a key who's value is a dict then dict_merge is called + on both values and the result stored in the returned dictionary. + + Taken from https://www.xormedia.com/recursively-merge-dictionaries-in-python/''' + + from copy import deepcopy + + if not isinstance(b, dict): + return b + result = deepcopy(a) + for k, v in b.iteritems(): + if k in result and isinstance(result[k], dict): + result[k] = dict_merge(result[k], v) + else: + result[k] = deepcopy(v) + return result diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index c8760e7d2..1c0f49d99 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -1206,6 +1206,11 @@ class MachineCom(object): return None + def _gcode_M112(self, cmd): # It's an emergency what todo? Canceling the print should be the minimum + self.cancelPrint() + return cmd + + ### MachineCom callback ################################################################################################ class MachineComPrintCallback(object): diff --git a/src/octoprint/util/gcodeInterpreter.py b/src/octoprint/util/gcodeInterpreter.py index bf5ddb9e6..4a0901c9f 100644 --- a/src/octoprint/util/gcodeInterpreter.py +++ b/src/octoprint/util/gcodeInterpreter.py @@ -83,27 +83,10 @@ class gcode(object): self._filamentDiameter = 0.0 line = line[0:line.find(';')] - T = getCodeInt(line, 'T') - if T is not None: - posOffset[0] -= offsets[currentExtruder]["x"] if currentExtruder < len(offsets) else 0 - posOffset[1] -= offsets[currentExtruder]["y"] if currentExtruder < len(offsets) else 0 - - currentExtruder = T - - posOffset[0] += offsets[currentExtruder]["x"] if currentExtruder < len(offsets) else 0 - posOffset[1] += offsets[currentExtruder]["y"] if currentExtruder < len(offsets) else 0 - - if len(currentE) <= currentExtruder: - for i in range(len(currentE), currentExtruder + 1): - currentE.append(0.0) - if len(maxExtrusion) <= currentExtruder: - for i in range(len(maxExtrusion), currentExtruder + 1): - maxExtrusion.append(0.0) - if len(totalExtrusion) <= currentExtruder: - for i in range(len(totalExtrusion), currentExtruder + 1): - totalExtrusion.append(0.0) - G = getCodeInt(line, 'G') + M = getCodeInt(line, 'M') + T = getCodeInt(line, 'T') + if G is not None: if G == 0 or G == 1: #Move x = getCodeFloat(line, 'X') @@ -204,13 +187,32 @@ class gcode(object): posOffset[1] = pos[1] - y if z is not None: posOffset[2] = pos[2] - z - else: - M = getCodeInt(line, 'M') - if M is not None: - if M == 82: #Absolute E - absoluteE = True - elif M == 83: #Relative E - absoluteE = False + + elif M is not None: + if M == 82: #Absolute E + absoluteE = True + elif M == 83: #Relative E + absoluteE = False + + elif T is not None: + posOffset[0] -= offsets[currentExtruder]["x"] if currentExtruder < len(offsets) else 0 + posOffset[1] -= offsets[currentExtruder]["y"] if currentExtruder < len(offsets) else 0 + + currentExtruder = T + + posOffset[0] += offsets[currentExtruder]["x"] if currentExtruder < len(offsets) else 0 + posOffset[1] += offsets[currentExtruder]["y"] if currentExtruder < len(offsets) else 0 + + if len(currentE) <= currentExtruder: + for i in range(len(currentE), currentExtruder + 1): + currentE.append(0.0) + if len(maxExtrusion) <= currentExtruder: + for i in range(len(maxExtrusion), currentExtruder + 1): + maxExtrusion.append(0.0) + if len(totalExtrusion) <= currentExtruder: + for i in range(len(totalExtrusion), currentExtruder + 1): + totalExtrusion.append(0.0) + if self.progressCallback is not None: self.progressCallback(100.0)