diff --git a/.3rd-party/README.md b/.3rd-party/README.md index efce1189c..35c2be1eb 100644 --- a/.3rd-party/README.md +++ b/.3rd-party/README.md @@ -1,5 +1,9 @@ # Third-Party Dependencies -This folder provides listings of all 3rd-party dependencies incl. their licenses. There is a dedicated subfolder for each release (and milestone) holding the release-specific information. +This folder provides listings of all 3rd-party dependencies incl. their licenses. There is a dedicated subfolder for +each release (and milestone) holding the release-specific information. -The files are generated using the [check-dependencies.sh](https://github.com/eclipse-hawkbit/hawkbit/tree/master/check-dependencies.sh) script. The script makes use of the [Eclipse Dash License Tool](https://github.com/eclipse/dash-licenses) which identifies and vets the licenses of the project content. +The files are generated using +the [check-dependencies.sh](https://github.com/eclipse-hawkbit/hawkbit/tree/master/check-dependencies.sh) script. The +script makes use of the [Eclipse Dash License Tool](https://github.com/eclipse/dash-licenses) which identifies and vets +the licenses of the project content. diff --git a/.github/workflows/first-interaction.yml b/.github/workflows/first-interaction.yml index de2b244f2..9374f148a 100644 --- a/.github/workflows/first-interaction.yml +++ b/.github/workflows/first-interaction.yml @@ -2,7 +2,7 @@ name: First User Interaction on: pull_request_target: - types: [opened] + types: [ opened ] jobs: greeting: diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 9ccb7b219..0450adaa6 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,7 +2,10 @@ ## Our Pledge -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making +participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, +disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, +religion, or sexual identity and orientation. ## Our Standards @@ -24,23 +27,35 @@ Examples of unacceptable behavior by participants include: ## Our Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take +appropriate and fair corrective action in response to any instances of unacceptable behavior. -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, +issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the +project or its community. Examples of representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed representative at an online or offline +event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hawkbit-dev@eclipse.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at +hawkbit-dev@eclipse.org. The project team will review and investigate all complaints, and will respond in a way that it +deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the +reporter of an incident. Further details of specific enforcement policies may be posted separately. -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent +repercussions as determined by other members of the project's leadership. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available +at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org + [version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3834bd2cb..72b5a6380 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,37 +9,44 @@ Please read this if you intend to contribute to the project. ### Code Style * Java files: - * we follow the standard eclipse IDE (built in) code formatter with the following changes: - * Tab policy: spaces only: 4 - * We recommend using at least Eclipse [Mars](https://www.eclipse.org/mars/) IDE release. It seems that the Java code formatter line break handling has been changed between [Luna](https://www.eclipse.org/luna/) and Mars. + * we follow the standard eclipse IDE (built in) code formatter with the following changes: + * Tab policy: spaces only: 4 + * We recommend using at least Eclipse [Mars](https://www.eclipse.org/mars/) IDE release. It seems that the Java code + formatter line break handling has been changed between [Luna](https://www.eclipse.org/luna/) and Mars. * XML files: - * we follow the standard eclipse IDE XML formatter with the following changes: - * Indent using spaces only: 3 + * we follow the standard eclipse IDE XML formatter with the following changes: + * Indent using spaces only: 3 * SCSS files: - * we follow the standard [scss-lint](https://github.com/brigade/scss-lint/) rules with the following exception: - * disabled rules: ImportantRule, PropertySortOrder + * we follow the standard [scss-lint](https://github.com/brigade/scss-lint/) rules with the following exception: + * disabled rules: ImportantRule, PropertySortOrder * Sonarqube: - * Our rule set can be found [here](https://sonarcloud.io/organizations/bosch-iot-rollouts/rules) - * Sonarqube reports can be found [here](https://sonarcloud.io/project/overview?id=org.eclipse.hawkbit%3Ahawkbit-parent) + * Our rule set can be found [here](https://sonarcloud.io/organizations/bosch-iot-rollouts/rules) + * Sonarqube reports can be + found [here](https://sonarcloud.io/project/overview?id=org.eclipse.hawkbit%3Ahawkbit-parent) ### Utility library usage -hawkBit has currently [Apache commons lang](https://commons.apache.org/proper/commons-lang/) on the classpath in several of its modules. However, we see introducing too many utility libraries problematic as we force these as transitive dependencies on hawkBit users. We in fact are looking into reducing them in future not adding new ones. +hawkBit has currently [Apache commons lang](https://commons.apache.org/proper/commons-lang/) on the classpath in several +of its modules. However, we see introducing too many utility libraries problematic as we force these as transitive +dependencies on hawkBit users. We in fact are looking into reducing them in future not adding new ones. So we kindly ask contributors: * not introduce extra utility library dependencies -* keep them out of the core modules (e.g. hawkbit-core, hawkbit-rest-core, hawkbit-http-security) to avoid that all modules have them as transitive dependency +* keep them out of the core modules (e.g. hawkbit-core, hawkbit-rest-core, hawkbit-http-security) to avoid that all + modules have them as transitive dependency * use utility functions in general based in the following priority: - * use utility functions from JDK if feasible - * use Spring utility classes if feasible - * use [Apache commons lang](https://commons.apache.org/proper/commons-lang/) if feasible + * use utility functions from JDK if feasible + * use Spring utility classes if feasible + * use [Apache commons lang](https://commons.apache.org/proper/commons-lang/) if feasible ### Test documentation -Please document the test cases that you contribute by means of [Allure](https://docs.qameta.io/allure/) annotations and proper test method naming. +Please document the test cases that you contribute by means of [Allure](https://docs.qameta.io/allure/) annotations and +proper test method naming. -All test classes are documented with [Allure's](https://docs.qameta.io/allure/#_behaviours_mapping) **@Feature** and **@Story** annotations in the following format: +All test classes are documented with [Allure's](https://docs.qameta.io/allure/#_behaviours_mapping) **@Feature** and * +*@Story** annotations in the following format: ```java @Feature("TEST_TYPE - HAWKBIT_COMPONENT") @@ -49,7 +56,8 @@ All test classes are documented with [Allure's](https://docs.qameta.io/allure/#_ Test types are: * Unit Tests - for single units tests with a mocked environment -* Component Tests - for complete components including lower layers, e.g. Spring MVC test on rest API including repository and database. +* Component Tests - for complete components including lower layers, e.g. Spring MVC test on rest API including + repository and database. * Integration Tests - including clients, e.g. Selenium UI tests with various browsers. * System Tests - on target environments, e.g. Cloud Foundry. @@ -66,7 +74,8 @@ Examples for hawkBit components: @Story("Distribution Set Type Resource") ``` -In addition all test method's name describes in **camel case** what the test is all about and has in addition a long description in Allures **@Description** annotation. +In addition all test method's name describes in **camel case** what the test is all about and has in addition a long +description in Allures **@Description** annotation. ## Legal considerations for your contribution @@ -129,8 +138,11 @@ Submit a pull request via the normal GitHub UI (desktop or web). ## Reporting a security vulnerability -If you find a vulnerability, **DO NOT** disclose it in the public immediately! Instead, give us the possibility to fix it beforehand. -So please don’t report your finding using GitHub issues and better head over to [https://eclipse.org/security](https://eclipse.org/security) and learn how to disclose a vulnerability in a safe and responsible manner +If you find a vulnerability, **DO NOT** disclose it in the public immediately! Instead, give us the possibility to fix +it beforehand. +So please don’t report your finding using GitHub issues and better head over +to [https://eclipse.org/security](https://eclipse.org/security) and learn how to disclose a vulnerability in a safe and +responsible manner ## Further information diff --git a/MIGRATION.md b/MIGRATION.md index 40bb6a1a9..e24922a61 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -13,13 +13,17 @@ ### REST API model changes for clients -- ENTITYPagedList classes have been removed; generic `PagedList` used instead (e.g. `PagedList` instead of `TargetPagedList`). -- ENTITYsrest classes have been removed; `List` used instead (e.g. `List` instead of `TargetsRest`) +- ENTITYPagedList classes have been removed; generic `PagedList` used instead (e.g. `PagedList` instead + of `TargetPagedList`). +- ENTITYsrest classes have been removed; `List` used instead (e.g. `List` instead + of `TargetsRest`) ### Renamed api annotations -- Annotation `org.eclipse.hawkbit.rest.resource.EnableRestResources` has changed to `org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi` -- Annotation `org.eclipse.hawkbit.ddi.resource.EnableDirectDeviceApi` has changed to `org.eclipse.hawkbit.ddi.annotation.EnableDdiApi` +- Annotation `org.eclipse.hawkbit.rest.resource.EnableRestResources` has changed + to `org.eclipse.hawkbit.mgmt.annotation.EnableMgmtApi` +- Annotation `org.eclipse.hawkbit.ddi.resource.EnableDirectDeviceApi` has changed + to `org.eclipse.hawkbit.ddi.annotation.EnableDdiApi` ### Renamed maven modules @@ -29,17 +33,21 @@ ### Configuration Property changes -- `hawkbit.server.security.dos.maxTargetsPerManualAssignment` has changed to `hawkbit.server.security.dos.maxTargetDistributionSetAssignmentsPerManualAssignment` +- `hawkbit.server.security.dos.maxTargetsPerManualAssignment` has changed + to `hawkbit.server.security.dos.maxTargetDistributionSetAssignmentsPerManualAssignment` ## Milestone 0.3.0M7 ### Configuration Property changes -- Due to Spring Boot version upgrade (see [spring boot 2.2 deprecations](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.2-Release-Notes#deprecations-in-spring-boot-22)) `server.use-forward-headers` has changed to `server.forward-headers-strategy` +- Due to Spring Boot version upgrade ( + see [spring boot 2.2 deprecations](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.2-Release-Notes#deprecations-in-spring-boot-22)) `server.use-forward-headers` + has changed to `server.forward-headers-strategy` ## Upgrade from Master Branch (after 0.3.0M6) to 0.3.0M7 -Due to changes in the DB migration scripts within PR [#1017](https://github.com/eclipse-hawkbit/hawkbit/pull/1017) the Hawkbit will not start up if one of the following cases is true: +Due to changes in the DB migration scripts within PR [#1017](https://github.com/eclipse-hawkbit/hawkbit/pull/1017) the +Hawkbit will not start up if one of the following cases is true: - DB2 database is used - MSSQL database is used and the `sp_action` table is not empty @@ -47,9 +55,13 @@ Due to changes in the DB migration scripts within PR [#1017](https://github.com/ The script was fixed with PR [#1061](https://github.com/eclipse-hawkbit/hawkbit/pull/1061). -In case you upgrade from 0.3.0M6 to 0.3.0M7 there is no issue. But if you have built the Hawkbit from the master branch between PR [#1017](https://github.com/eclipse-hawkbit/hawkbit/pull/1017) and PR [#1061](https://github.com/eclipse-hawkbit/hawkbit/pull/1061), use PostgreSQL or MSSQL and upgrade to 0.3.0M7, it will fail at startup with the message: `Validate failed: Migration checksum mismatch for migration version 1.12.16` +In case you upgrade from 0.3.0M6 to 0.3.0M7 there is no issue. But if you have built the Hawkbit from the master branch +between PR [#1017](https://github.com/eclipse-hawkbit/hawkbit/pull/1017) and +PR [#1061](https://github.com/eclipse-hawkbit/hawkbit/pull/1061), use PostgreSQL or MSSQL and upgrade to 0.3.0M7, it +will fail at startup with the message: `Validate failed: Migration checksum mismatch for migration version 1.12.16` -This can be fixed by adapting the schema_version table of the database. The checksum field of the entry with the version 1.12.16 has to be changed (mind the minus): +This can be fixed by adapting the schema_version table of the database. The checksum field of the entry with the version +1.12.16 has to be changed (mind the minus): - -1684307461 for MSSQL - -596342656 for PostgreSql diff --git a/README.md b/README.md index b61041df6..83fd6b798 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ # Eclipse hawkBit™ - Update Server -Eclipse [hawkBit](http://www.eclipse.org/hawkbit/index.html) is an domain independent back end solution for rolling out software updates to constrained edge devices as well as more powerful controllers and gateways connected to IP based networking infrastructure. +Eclipse [hawkBit](http://www.eclipse.org/hawkbit/index.html) is an domain independent back end solution for rolling out +software updates to constrained edge devices as well as more powerful controllers and gateways connected to IP based +networking infrastructure. Build: [![Build Status](https://github.com/eclipse-hawkbit/hawkbit/actions/workflows/verify.yml/badge.svg?branch=master)](https://github.com/eclipse-hawkbit/hawkbit/actions/workflows/verify.yml) @@ -13,8 +15,8 @@ Build: License: [![License](https://img.shields.io/badge/License-EPL%202.0-green.svg)](https://opensource.org/licenses/EPL-2.0) -Docker: -[![Docker](https://img.shields.io/docker/v/hawkbit/hawkbit-update-server/latest?color=blue)](https://hub.docker.com/r/hawkbit/hawkbit-update-server) +Docker: +[![Docker](https://img.shields.io/docker/v/hawkbit/hawkbit-update-server/latest?color=blue)](https://hub.docker.com/r/hawkbit/hawkbit-update-server) [![Docker MYSQL](https://img.shields.io/docker/v/hawkbit/hawkbit-update-server/latest-mysql?color=blue)](https://hub.docker.com/r/hawkbit/hawkbit-update-server) [![Docker pulls](https://img.shields.io/docker/pulls/hawkbit/hawkbit-update-server.svg)](https://hub.docker.com/search?q=hawkbit%2Fhawkbit-update-server&type=image) @@ -25,13 +27,17 @@ see [hawkBit Documentation](https://www.eclipse.dev/hawkbit/) # Contact us - Having questions about hawkBit? Check [Stack Overflow](https://stackoverflow.com/questions/tagged/eclipse-hawkbit) -- Want to chat with the team behind hawkBit? [![Join the chat at https://gitter.im/eclipse/hawkbit](https://badges.gitter.im/eclipse/hawkbit.svg)](https://gitter.im/eclipse/hawkbit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +- Want to chat with the team behind + hawkBit? [![Join the chat at https://gitter.im/eclipse/hawkbit](https://badges.gitter.im/eclipse/hawkbit.svg)](https://gitter.im/eclipse/hawkbit?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - Having issues with hawkBit? Open a [GitHub issue](https://github.com/eclipse-hawkbit/hawkbit/issues). - You can also check out our [Project Homepage](https://www.eclipse.dev/hawkbit) for further contact options. # hawkBit sandbox -We offer a sandbox installation that is free for everyone to try out hawkBit. However, keep in mind that the sandbox database will be reset from time to time. It is also not possible to upload any artifacts into the sandbox. But you can use it to try out the Management API and DDI API. Keep in mind as well that you are not permitted to store any kind of personal data in the sandbox. +We offer a sandbox installation that is free for everyone to try out hawkBit. However, keep in mind that the sandbox +database will be reset from time to time. It is also not possible to upload any artifacts into the sandbox. But you can +use it to try out the Management API and DDI API. Keep in mind as well that you are not permitted to store any kind of +personal data in the sandbox. [https://hawkbit.eclipseprojects.io](https://hawkbit.eclipseprojects.io) @@ -42,29 +48,44 @@ In addition the following vendors offer free trial accounts for their hawkBit co # Device Integration (Client libraries) -hawkBit exposes HTTP/JSON based [Direct Device Integration (API) API](https://www.eclipse.org/hawkbit/apis/ddi_api/) that allow any update client to integrate quite easily. +hawkBit exposes HTTP/JSON based [Direct Device Integration (API) API](https://www.eclipse.org/hawkbit/apis/ddi_api/) +that allow any update client to integrate quite easily. -The [Eclipse Hara subproject](https://projects.eclipse.org/projects/iot.hawkbit.hara) aims to provide a reference agent software implementation of the Eclipse hawkBit device API. The [hara-ddiclient repository](https://github.com/eclipse-hara/hara-ddiclient) provides: +The [Eclipse Hara subproject](https://projects.eclipse.org/projects/iot.hawkbit.hara) aims to provide a reference agent +software implementation of the Eclipse hawkBit device API. +The [hara-ddiclient repository](https://github.com/eclipse-hara/hara-ddiclient) provides: - a Kotlin library that facilitates and speeds up the development of DDI API clients running on the JVM - a virtual-device application which provides: - a reference example on how to use the library - a configurable virtual device that can be used for different testing scenarios -The hara-ddiclient library has [reached version 2.x](https://github.com/eclipse-hara/hara-ddiclient/releases), and has been successfully used in production for years. +The hara-ddiclient library has [reached version 2.x](https://github.com/eclipse-hara/hara-ddiclient/releases), and has +been successfully used in production for years. -Additionally, the hawkBit project has the long term goal to provide [Eclipse Hono](https://github.com/eclipse/hono) integration which will provide connectivity through various IoT protocols and as a result will allow a wide range of clients to connect to hawkBit. +Additionally, the hawkBit project has the long term goal to provide [Eclipse Hono](https://github.com/eclipse/hono) +integration which will provide connectivity through various IoT protocols and as a result will allow a wide range of +clients to connect to hawkBit. ## Other open-source hawkBit Clients There are clients outside of the Eclipse IoT eco system as well, e.g.: -- [SWupdate](https://github.com/sbabic/swupdate) which is a Linux Update agent with focus on a efficient and safe way to update embedded systems. -- [rauc-hawkbit-updater](https://github.com/rauc/rauc-hawkbit-updater) which is a hawkBit client for the [RAUC](https://github.com/rauc/rauc) update framework written in C/glib. -- [rauc-hawkbit](https://github.com/rauc/rauc-hawkbit) which is a python-based hawkBit client demo application and library for the [RAUC](https://github.com/rauc/rauc) update framework. -- [hawkbit-rs](https://github.com/collabora/hawkbit-rs) provides a couple of [Rust](https://www.rust-lang.org) crates to help [implement](https://crates.io/crates/hawkbit) and [test](https://crates.io/crates/hawkbit_mock) hawkBit clients. -- [Zephyr-RTOS](https://docs.zephyrproject.org/apidoc/latest/group__hawkbit.html#details): The Zephyr OS is a small-footprint kernel designed for use on resource-constrained and embedded systems: from simple embedded environmental sensors and LED wearables to sophisticated embedded controllers, smart watches, and IoT wireless applications. -- [ChirpStack](https://www.chirpstack.io/docs/chirpstack-gateway-os/use/software-update.html): ChirpStack Gateway OS uses [SWUpdate](https://github.com/sbabic/swupdate) for handling updates which can be integrated with Eclipse hawkBit. ChirpStack is an open-source LoRaWAN Network Server which can be used to to setup private or public LoRaWAN networks. +- [SWupdate](https://github.com/sbabic/swupdate) which is a Linux Update agent with focus on a efficient and safe way to + update embedded systems. +- [rauc-hawkbit-updater](https://github.com/rauc/rauc-hawkbit-updater) which is a hawkBit client for + the [RAUC](https://github.com/rauc/rauc) update framework written in C/glib. +- [rauc-hawkbit](https://github.com/rauc/rauc-hawkbit) which is a python-based hawkBit client demo application and + library for the [RAUC](https://github.com/rauc/rauc) update framework. +- [hawkbit-rs](https://github.com/collabora/hawkbit-rs) provides a couple of [Rust](https://www.rust-lang.org) crates to + help [implement](https://crates.io/crates/hawkbit) and [test](https://crates.io/crates/hawkbit_mock) hawkBit clients. +- [Zephyr-RTOS](https://docs.zephyrproject.org/apidoc/latest/group__hawkbit.html#details): The Zephyr OS is a + small-footprint kernel designed for use on resource-constrained and embedded systems: from simple embedded + environmental sensors and LED wearables to sophisticated embedded controllers, smart watches, and IoT wireless + applications. +- [ChirpStack](https://www.chirpstack.io/docs/chirpstack-gateway-os/use/software-update.html): ChirpStack Gateway OS + uses [SWUpdate](https://github.com/sbabic/swupdate) for handling updates which can be integrated with Eclipse hawkBit. + ChirpStack is an open-source LoRaWAN Network Server which can be used to to setup private or public LoRaWAN networks. # Runtime dependencies and support @@ -72,20 +93,22 @@ There are clients outside of the Eclipse IoT eco system as well, e.g.: ## SQL database -| Database | H2 | MySQL/MariaDB | MS SQL Server | PostgreSQL | IBM DB2 | -| --------------------------------- | :----------------------------------------------------: | :-------------------------------------------------------------------------: | :--------------------------------------------------------------: | :----------------------------------------------------------------: | :----------------: | -| DDLs maintained by project | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | -| Test dependencies defined | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | -| Versions tested | 2.1 | MySQL 8.0.23, AWS Aurora | MS SQL Server 2017/2019 | PostgreSQL 12/13 | DB2 Server v11.1 | -| Docker image with driver provided | :white_check_mark: | :white_check_mark: (Tag: "-mysql") | :white_check_mark: | :white_check_mark: | | +| Database | H2 | MySQL/MariaDB | MS SQL Server | PostgreSQL | IBM DB2 | +|-----------------------------------|:------------------------------------------------------:|:---------------------------------------------------------------------------:|:-----------------------------------------------------------------:|:-----------------------------------------------------------------:|:------------------:| +| DDLs maintained by project | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Test dependencies defined | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | +| Versions tested | 2.1 | MySQL 8.0.23, AWS Aurora | MS SQL Server 2017/2019 | PostgreSQL 12/13 | DB2 Server v11.1 | +| Docker image with driver provided | :white_check_mark: | :white_check_mark: (Tag: "-mysql") | :white_check_mark: | :white_check_mark: | | | JDBC driver | [H2 2.1.214](https://github.com/h2database/h2database) | [MariaDB Connector/J 2.7.8](https://github.com/MariaDB/mariadb-connector-j) | [MSSQL-JDBC 10.2.3.jre8](https://github.com/Microsoft/mssql-jdbc) | [PostgreSQL JDBC Driver 42.3.8](https://github.com/pgjdbc/pgjdbc) | | -| Status | Test, Dev | Production grade | Production grade | Test, Dev | Test, Dev | +| Status | Test, Dev | Production grade | Production grade | Test, Dev | Test, Dev | ## (Optional) RabbitMQ: 3.6,3.7,3.8 # Getting Started -We are providing a [Spring Boot](https://projects.spring.io/spring-boot/) based reference [Update Server](hawkbit-runtime/hawkbit-update-server) including embedded H2 DB for test and evaluation purposes. +We are providing a [Spring Boot](https://projects.spring.io/spring-boot/) based +reference [Update Server](hawkbit-runtime/hawkbit-update-server) including embedded H2 DB for test and evaluation +purposes. Run with docker: ```bash @@ -96,13 +119,18 @@ Open the update server in your browser: [localhost:8080](http://localhost:8080) -See below for how to build and run the update server on your own. In addition we have a [guide](https://www.eclipse.org/hawkbit/guides/runhawkbit/) for setting up a complete landscape. +See below for how to build and run the update server on your own. In addition we have +a [guide](https://www.eclipse.org/hawkbit/guides/runhawkbit/) for setting up a complete landscape. -**Note**: this docker image supports both DDI and DMF APIs. However, in order to have DMF API working you shall have started additionally RabbitMQ on localhost:5672 with user guest/guest. Then the DMF will use / vhost. See more at [guide](https://www.eclipse.org/hawkbit/guides/runhawkbit/) -> _Configure RabbitMQ connection settings_. +**Note**: this docker image supports both DDI and DMF APIs. However, in order to have DMF API working you shall have +started additionally RabbitMQ on localhost:5672 with user guest/guest. Then the DMF will use / vhost. See more +at [guide](https://www.eclipse.org/hawkbit/guides/runhawkbit/) -> _Configure RabbitMQ connection settings_. # hawkBit (Spring boot) starters -Next to the [Update Server](hawkbit-runtime/hawkbit-update-server) we are also providing a set of [Spring Boot Starters](hawkbit-starters) to quick start your own [Spring Boot](https://projects.spring.io/spring-boot/) based application. +Next to the [Update Server](hawkbit-runtime/hawkbit-update-server) we are also providing a set +of [Spring Boot Starters](hawkbit-starters) to quick start your +own [Spring Boot](https://projects.spring.io/spring-boot/) based application. # Clone, build and run hawkBit @@ -135,8 +163,16 @@ java -jar ./hawkbit-example-mgmt-simulator/target/hawkbit-example-mgmt-simulator # Status and API stability -hawkBit is currently in '0.X' semantic version. That is due to the need that there is still content in hawkBit that is in need for refactoring. That includes the maven module structure, Spring Boot Properties, Spring Boot auto configuration as well as internal Java APIs (e.g. the [repository API](https://github.com/eclipse-hawkbit/hawkbit/issues/197) ). +hawkBit is currently in '0.X' semantic version. That is due to the need that there is still content in hawkBit that is +in need for refactoring. That includes the maven module structure, Spring Boot Properties, Spring Boot auto +configuration as well as internal Java APIs (e.g. +the [repository API](https://github.com/eclipse-hawkbit/hawkbit/issues/197) ). -However, the device facing [DDI API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-rest/hawkbit-ddi-api) is on major version 'v1' and will be kept stable. +However, the device +facing [DDI API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-rest/hawkbit-ddi-api) is on major +version 'v1' and will be kept stable. -Server facing and [DMF API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api) are [Management API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-rest/hawkbit-mgmt-api) are on v1 as well. However, we cannot fully guarantee the same stability during hawkBit's 0.X development but we will try as best we can. +Server facing and [DMF API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api) +are [Management API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-rest/hawkbit-mgmt-api) are on v1 as +well. However, we cannot fully guarantee the same stability during hawkBit's 0.X development but we will try as best we +can. diff --git a/SECURITY.md b/SECURITY.md index e0432d2c2..16785b7f4 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,4 +1,7 @@ # Reporting a Security Vulnerability -If you find a vulnerability, **DO NOT** disclose it in the public immediately! Instead, give us the possibility to fix it beforehand. -So please don’t report your finding using GitHub issues and better head over to [https://eclipse.org/security](https://eclipse.org/security) and learn how to disclose a vulnerability in a safe and responsible manner +If you find a vulnerability, **DO NOT** disclose it in the public immediately! Instead, give us the possibility to fix +it beforehand. +So please don’t report your finding using GitHub issues and better head over +to [https://eclipse.org/security](https://eclipse.org/security) and learn how to disclose a vulnerability in a safe and +responsible manner diff --git a/eclipse_codeformatter.xml b/eclipse_codeformatter.xml index 2b2b4a809..f087b31eb 100644 --- a/eclipse_codeformatter.xml +++ b/eclipse_codeformatter.xml @@ -1,380 +1,504 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hawkbit-repository/README.md b/hawkbit-repository/README.md index 2ee2fea11..72ff30628 100644 --- a/hawkbit-repository/README.md +++ b/hawkbit-repository/README.md @@ -25,7 +25,8 @@ When starting a rollout, for all targets within this rollout deployment actions of the first group will be started immediately all other deployment actions will be scheduled. > Due rollouts might include a large number of targets and deployment group, creation as well as starting a rollout -> might take some time and therefore the creation and starting of an rollout is executed asynchronously. The creation and +> might take some time and therefore the creation and starting of an rollout is executed asynchronously. The creation +> and > starting progress is reflected by the rollout's status attribute ### Rollout Creation diff --git a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/event/remote/entity/AbstractRolloutGroupEvent.java b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/event/remote/entity/AbstractRolloutGroupEvent.java index 95decb151..4c06e5683 100644 --- a/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/event/remote/entity/AbstractRolloutGroupEvent.java +++ b/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/event/remote/entity/AbstractRolloutGroupEvent.java @@ -41,6 +41,11 @@ public abstract class AbstractRolloutGroupEvent extends RemoteEntityEvent - 4.0.0 - - org.eclipse.hawkbit - hawkbit-sdk - ${revision} - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"> + 4.0.0 + + org.eclipse.hawkbit + hawkbit-sdk + ${revision} + - hawkbit-sdk-commons - hawkBit :: SDK :: Commons - SDK commons + hawkbit-sdk-commons + hawkBit :: SDK :: Commons + SDK commons - - - - org.springframework.cloud - spring-cloud-starter-openfeign - ${spring-cloud-starter-openfeign.version} - - - io.github.openfeign - feign-hc5 - ${openfeign-hc5.version} - - - org.springframework.boot - spring-boot-starter-hateoas - - + + + org.springframework.cloud + spring-cloud-starter-openfeign + ${spring-cloud-starter-openfeign.version} + + + io.github.openfeign + feign-hc5 + ${openfeign-hc5.version} + + + org.springframework.boot + spring-boot-starter-hateoas + + diff --git a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/Controller.java b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/Controller.java index c52b3e6c7..d63ef2095 100644 --- a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/Controller.java +++ b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/Controller.java @@ -11,8 +11,6 @@ package org.eclipse.hawkbit.sdk; import lombok.Builder; import lombok.Data; -import lombok.ToString; -import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; diff --git a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java index 5dbf54f86..d170277de 100644 --- a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java +++ b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitClient.java @@ -9,6 +9,11 @@ */ package org.eclipse.hawkbit.sdk; +import java.nio.charset.StandardCharsets; +import java.util.Base64; +import java.util.Objects; +import java.util.function.BiFunction; + import feign.Client; import feign.Contract; import feign.Feign; @@ -20,49 +25,42 @@ import lombok.Builder; import lombok.extern.slf4j.Slf4j; import org.springframework.util.ObjectUtils; -import java.nio.charset.StandardCharsets; -import java.util.Base64; -import java.util.Objects; -import java.util.function.BiFunction; - @Slf4j @Builder public class HawkbitClient { private static final String AUTHORIZATION = "Authorization"; - private static final ErrorDecoder DEFAULT_ERROR_DECODER_0 = new ErrorDecoder.Default(); + public static final BiFunction DEFAULT_REQUEST_INTERCEPTOR_FN = + (tenant, controller) -> + controller == null ? + template -> { + template.header( + AUTHORIZATION, + "Basic " + + Base64.getEncoder() + .encodeToString( + (Objects.requireNonNull(tenant.getUsername(), "User is null!") + + ":" + + Objects.requireNonNull(tenant.getPassword(), + "Password is not available!")) + .getBytes(StandardCharsets.ISO_8859_1))); + } : + template -> { + if (ObjectUtils.isEmpty(tenant.getGatewayToken())) { + if (!ObjectUtils.isEmpty(controller.getSecurityToken())) { + template.header(AUTHORIZATION, "TargetToken " + controller.getSecurityToken()); + } // else do not sent authentication + } else { + template.header(AUTHORIZATION, "GatewayToken " + tenant.getGatewayToken()); + } + }; + private static final ErrorDecoder DEFAULT_ERROR_DECODER_0 = new ErrorDecoder.Default(); public static final ErrorDecoder DEFAULT_ERROR_DECODER = (methodKey, response) -> { final Exception e = DEFAULT_ERROR_DECODER_0.decode(methodKey, response); log.trace("REST API call failed!", e); return e; }; - - public static final BiFunction DEFAULT_REQUEST_INTERCEPTOR_FN = - (tenant, controller) -> - controller == null ? - template -> { - template.header( - AUTHORIZATION, - - "Basic " + - Base64.getEncoder() - .encodeToString( - (Objects.requireNonNull(tenant.getUsername(), "User is null!") + - ":" + - Objects.requireNonNull(tenant.getPassword(),"Password is not available!")) - .getBytes(StandardCharsets.ISO_8859_1))); - } : - template -> { - if (ObjectUtils.isEmpty(tenant.getGatewayToken())) { - if (!ObjectUtils.isEmpty(controller.getSecurityToken())) { - template.header(AUTHORIZATION, "TargetToken " + controller.getSecurityToken()); - } // else do not sent authentication - } else { - template.header(AUTHORIZATION, "GatewayToken " + tenant.getGatewayToken()); - } - }; - private final HawkbitServer hawkBitServerProperties; private final Client client; @@ -100,6 +98,7 @@ public class HawkbitClient { public T mgmtService(final Class serviceType, final Tenant tenantProperties) { return service(serviceType, tenantProperties, null); } + public T ddiService(final Class serviceType, final Tenant tenantProperties, final Controller controller) { return service(serviceType, tenantProperties, controller); } @@ -113,7 +112,7 @@ public class HawkbitClient { .requestInterceptor(requestInterceptorFn.apply(tenant, controller)) .target(serviceType, controller == null ? - hawkBitServerProperties.getMgmtUrl() : - hawkBitServerProperties.getDdiUrl()); + hawkBitServerProperties.getMgmtUrl() : + hawkBitServerProperties.getDdiUrl()); } } \ No newline at end of file diff --git a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitSDKConfigurtion.java b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitSDKConfigurtion.java index f187036a3..fb17b6297 100644 --- a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitSDKConfigurtion.java +++ b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitSDKConfigurtion.java @@ -9,6 +9,10 @@ */ package org.eclipse.hawkbit.sdk; +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import java.util.LinkedHashMap; + import feign.Contract; import feign.MethodMetadata; import feign.RequestInterceptor; @@ -30,13 +34,9 @@ import org.springframework.hateoas.config.EnableHypermediaSupport; import org.springframework.hateoas.config.WebConverters; import org.springframework.http.MediaType; -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; -import java.util.LinkedHashMap; - @Slf4j @Configuration -@EnableConfigurationProperties({ HawkbitServer.class, Tenant.class}) +@EnableConfigurationProperties({ HawkbitServer.class, Tenant.class }) @EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL) @Import(FeignClientsConfiguration.class) @PropertySource("classpath:/hawkbit-sdk-defaults.properties") @@ -62,7 +62,7 @@ public class HawkbitSDKConfigurtion { @Bean @ConditionalOnMissingBean @ConditionalOnNotWebApplication - @ConditionalOnClass({ WebConverters.class}) + @ConditionalOnClass({ WebConverters.class }) public HttpMessageConverterCustomizer webConvertersCustomizerOverrider(WebConverters webConverters) { return new WebConvertersCustomizer(webConverters); } diff --git a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitServer.java b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitServer.java index 3e13d1ec7..58a98a6bc 100644 --- a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitServer.java +++ b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/HawkbitServer.java @@ -13,7 +13,7 @@ import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.lang.NonNull; -@ConfigurationProperties(prefix="hawkbit.server") +@ConfigurationProperties(prefix = "hawkbit.server") @Data public class HawkbitServer { diff --git a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/spi/ArtifactHandler.java b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/spi/ArtifactHandler.java index 20f73b8f1..351ff9203 100644 --- a/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/spi/ArtifactHandler.java +++ b/hawkbit-sdk/hawkbit-sdk-commons/src/main/java/org/eclipse/hawkbit/sdk/spi/ArtifactHandler.java @@ -25,11 +25,8 @@ public interface ArtifactHandler { interface DownloadHandler { - enum Status { - SUCCESS, ERROR - } - DownloadHandler SKIP = new DownloadHandler() { + @Override public void read(byte[] buff, int off, int len) { // skip @@ -69,5 +66,9 @@ public interface ArtifactHandler { * @return the path to the download */ Optional download(); + + enum Status { + SUCCESS, ERROR + } } } diff --git a/hawkbit-sdk/hawkbit-sdk-demo/pom.xml b/hawkbit-sdk/hawkbit-sdk-demo/pom.xml index 3e4e8ccde..423e9f27d 100644 --- a/hawkbit-sdk/hawkbit-sdk-demo/pom.xml +++ b/hawkbit-sdk/hawkbit-sdk-demo/pom.xml @@ -10,72 +10,72 @@ --> - 4.0.0 - - org.eclipse.hawkbit - hawkbit-sdk - ${revision} - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"> + 4.0.0 + + org.eclipse.hawkbit + hawkbit-sdk + ${revision} + - hawkbit-sdk-demo - hawkBit :: SDK :: Test / Example - Test / Example of how SDK could be used to for devices and for Mgmt API access + hawkbit-sdk-demo + hawkBit :: SDK :: Test / Example + Test / Example of how SDK could be used to for devices and for Mgmt API access - - 3.1.5 - org.eclipse.hawkbit.sdk.demo.multidevice.MultiDeviceApp - ${spring.app.class} - + + 3.1.5 + org.eclipse.hawkbit.sdk.demo.multidevice.MultiDeviceApp + ${spring.app.class} + - - - org.eclipse.hawkbit - hawkbit-sdk-device - ${project.version} - - - org.eclipse.hawkbit - hawkbit-sdk-dmf - ${project.version} - - - org.eclipse.hawkbit - hawkbit-sdk-mgmt - ${project.version} - + + + org.eclipse.hawkbit + hawkbit-sdk-device + ${project.version} + + + org.eclipse.hawkbit + hawkbit-sdk-dmf + ${project.version} + + + org.eclipse.hawkbit + hawkbit-sdk-mgmt + ${project.version} + - - org.springframework.shell - spring-shell-starter - ${spring-shell.version} - - + + org.springframework.shell + spring-shell-starter + ${spring-shell.version} + + - - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - ${baseDir} - JAR - - - - - + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + ${baseDir} + JAR + + + + + - - - src/main/resources - - - + + + src/main/resources + + + diff --git a/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/device/DeviceApp.java b/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/device/DeviceApp.java index a3ac8d9c5..a04f0aa6e 100644 --- a/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/device/DeviceApp.java +++ b/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/device/DeviceApp.java @@ -9,6 +9,9 @@ */ package org.eclipse.hawkbit.sdk.demo.device; +import java.util.Optional; +import java.util.concurrent.Executors; + import feign.Client; import feign.Contract; import feign.codec.Decoder; @@ -29,9 +32,6 @@ import org.springframework.shell.standard.ShellComponent; import org.springframework.shell.standard.ShellMethod; import org.springframework.util.ObjectUtils; -import java.util.Optional; -import java.util.concurrent.Executors; - /** * Abstract class representing DDI device connecting directly to hawkVit. */ @@ -52,7 +52,7 @@ public class DeviceApp { @Bean DdiTenant ddiTenant(final Tenant defaultTenant, - final HawkbitClient hawkbitClient) { + final HawkbitClient hawkbitClient) { return new DdiTenant(defaultTenant, hawkbitClient); } @@ -69,7 +69,6 @@ public class DeviceApp { private final DdiController device; private final MgmtApi mgmtApi; - Shell(final DdiTenant ddiTenant, final MgmtApi mgmtApi, final Optional updateHandler) { this.ddiTenant = ddiTenant; this.mgmtApi = mgmtApi; @@ -88,7 +87,7 @@ public class DeviceApp { @ShellMethod(key = "setup") public void setup() { mgmtApi.setupTargetAuthentication(); - mgmtApi.setupTargetToken(device.getControllerId(),device.getTargetSecurityToken()); + mgmtApi.setupTargetToken(device.getControllerId(), device.getTargetSecurityToken()); } @ShellMethod(key = "start") diff --git a/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/dmf/DmfApp.java b/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/dmf/DmfApp.java index 8a8e632a2..5954bbb4d 100644 --- a/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/dmf/DmfApp.java +++ b/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/dmf/DmfApp.java @@ -9,6 +9,9 @@ */ package org.eclipse.hawkbit.sdk.demo.dmf; +import java.util.Optional; +import java.util.concurrent.Executors; + import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.sdk.Controller; import org.eclipse.hawkbit.sdk.Tenant; @@ -26,9 +29,6 @@ import org.springframework.shell.standard.ShellComponent; import org.springframework.shell.standard.ShellMethod; import org.springframework.shell.standard.ShellOption; -import java.util.Optional; -import java.util.concurrent.Executors; - /** * Abstract class representing DDI device connecting directly to hawkVit. */ diff --git a/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/multidevice/MultiDeviceApp.java b/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/multidevice/MultiDeviceApp.java index 2ab418953..6e1c10322 100644 --- a/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/multidevice/MultiDeviceApp.java +++ b/hawkbit-sdk/hawkbit-sdk-demo/src/main/java/org/eclipse/hawkbit/sdk/demo/multidevice/MultiDeviceApp.java @@ -9,6 +9,9 @@ */ package org.eclipse.hawkbit.sdk.demo.multidevice; +import java.util.Optional; +import java.util.concurrent.Executors; + import feign.Client; import feign.Contract; import feign.codec.Decoder; @@ -29,9 +32,6 @@ import org.springframework.shell.standard.ShellComponent; import org.springframework.shell.standard.ShellMethod; import org.springframework.shell.standard.ShellOption; -import java.util.Optional; -import java.util.concurrent.Executors; - /** * Abstract class representing DDI device connecting directly to hawkVit. */ @@ -52,7 +52,7 @@ public class MultiDeviceApp { @Bean DdiTenant ddiTenant(final Tenant defaultTenant, - final HawkbitClient hawkbitClient) { + final HawkbitClient hawkbitClient) { return new DdiTenant(defaultTenant, hawkbitClient); } @@ -86,7 +86,7 @@ public class MultiDeviceApp { public void startOne(@ShellOption("--id") final String controllerId) { final String securityTargetToken; if (setup) { - securityTargetToken = mgmtApi.setupTargetToken(controllerId,null); + securityTargetToken = mgmtApi.setupTargetToken(controllerId, null); } else { securityTargetToken = null; } @@ -96,12 +96,12 @@ public class MultiDeviceApp { ddiTenant.getController(controllerId).ifPresentOrElse( ddiController -> ddiController.start(Executors.newSingleThreadScheduledExecutor()), () -> ddiTenant.createController(Controller.builder() - .controllerId(controllerId) - .securityToken(securityTargetToken) - .build(),updateHandler) + .controllerId(controllerId) + .securityToken(securityTargetToken) + .build(), updateHandler) .setOverridePollMillis(10_000) .start(Executors.newSingleThreadScheduledExecutor()) - ); + ); } @ShellMethod(key = "stop-one") diff --git a/hawkbit-sdk/hawkbit-sdk-device/pom.xml b/hawkbit-sdk/hawkbit-sdk-device/pom.xml index 6b490a16b..dd69d680d 100644 --- a/hawkbit-sdk/hawkbit-sdk-device/pom.xml +++ b/hawkbit-sdk/hawkbit-sdk-device/pom.xml @@ -10,31 +10,31 @@ --> - 4.0.0 - - org.eclipse.hawkbit - hawkbit-sdk - ${revision} - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"> + 4.0.0 + + org.eclipse.hawkbit + hawkbit-sdk + ${revision} + - hawkbit-sdk-device - hawkBit :: SDK :: Device SDK - Device SDK that could be used for development of devices on JVM based languages + hawkbit-sdk-device + hawkBit :: SDK :: Device SDK + Device SDK that could be used for development of devices on JVM based languages - - - org.eclipse.hawkbit - hawkbit-sdk-commons - ${project.version} - + + + org.eclipse.hawkbit + hawkbit-sdk-commons + ${project.version} + - - org.eclipse.hawkbit - hawkbit-ddi-api - ${project.version} - + + org.eclipse.hawkbit + hawkbit-ddi-api + ${project.version} + - + \ No newline at end of file diff --git a/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/DdiController.java b/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/DdiController.java index 0aad284df..9d5453f1d 100644 --- a/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/DdiController.java +++ b/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/DdiController.java @@ -9,6 +9,17 @@ */ package org.eclipse.hawkbit.sdk.device; +import java.time.LocalTime; +import java.time.temporal.ChronoField; +import java.util.AbstractMap; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -28,17 +39,6 @@ import org.springframework.hateoas.Link; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import java.time.LocalTime; -import java.time.temporal.ChronoField; -import java.util.AbstractMap; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; - /** * Class representing DDI device connecting directly to hawkBit. */ @@ -81,10 +81,10 @@ public class DdiController { * @param tenant the tenant of the device belongs to * @param controller the controller * @param hawkbitClient a factory for creating to {@link DdiRootControllerRestApi} (and used) - * for communication to hawkBit + * for communication to hawkBit */ public DdiController(final Tenant tenant, final Controller controller, - final UpdateHandler updateHandler, final HawkbitClient hawkbitClient) { + final UpdateHandler updateHandler, final HawkbitClient hawkbitClient) { this.tenantId = tenant.getTenantId(); gatewayToken = tenant.getGatewayToken(); downloadAuthenticationEnabled = tenant.isDownloadAuthenticationEnabled(); @@ -112,58 +112,88 @@ public class DdiController { currentActionId = null; } + public void updateAttribute(final String mode, final String key, final String value) { + final DdiUpdateMode updateMode = switch (mode.toLowerCase()) { + case "replace" -> DdiUpdateMode.REPLACE; + case "remove" -> DdiUpdateMode.REMOVE; + default -> DdiUpdateMode.MERGE; + }; + + final DdiConfigData configData = new DdiConfigData(Collections.singletonMap(key, value), updateMode); + + getDdiApi().putConfigData(configData, getTenantId(), getControllerId()); + } + + void sendFeedback(final UpdateStatus updateStatus) { + log.debug(LOG_PREFIX + "Send feedback {} -> {}", getTenantId(), getControllerId(), currentActionId, updateStatus); + try { + getDdiApi().postDeploymentBaseActionFeedback(updateStatus.feedback(), getTenantId(), getControllerId(), + currentActionId); + } catch (final RuntimeException e) { + log.error(LOG_PREFIX + "Failed to send feedback {} -> {}", getTenantId(), getControllerId(), + currentActionId, updateStatus, e); + } + + if (updateStatus.status() == UpdateStatus.Status.SUCCESSFUL || + updateStatus.status() == UpdateStatus.Status.FAILURE) { + lastActionId = currentActionId; + currentActionId = null; + } + } + private void poll() { log.debug(LOG_PREFIX + " Polling ...", tenantId, controllerId); Optional.ofNullable(executorService).ifPresent(executor -> - getControllerBase().ifPresentOrElse( - controllerBase -> { - final Optional confirmationBaseLink = getRequiredLink(controllerBase, CONFIRMATION_BASE_LINK); - if (confirmationBaseLink.isPresent()) { - final long actionId = getActionId(confirmationBaseLink.get()); - log.info(LOG_PREFIX + "Confirmation is required for action {}!", getTenantId(), - getControllerId(), actionId); - // TODO - confirmation handler - sendConfirmationFeedback(actionId); - executor.schedule(this::poll, IMMEDIATE_MS, TimeUnit.MILLISECONDS); - } else { - getRequiredLink(controllerBase, DEPLOYMENT_BASE_LINK).flatMap(this::getActionWithDeployment).ifPresentOrElse(actionWithDeployment -> { - final long actionId = actionWithDeployment.getKey(); - if (currentActionId == null) { - if (lastActionId != null && lastActionId == actionId) { - log.info(LOG_PREFIX + "Still receive the last action {}", - getTenantId(), getControllerId(), actionId); - return; - } + getControllerBase().ifPresentOrElse( + controllerBase -> { + final Optional confirmationBaseLink = getRequiredLink(controllerBase, CONFIRMATION_BASE_LINK); + if (confirmationBaseLink.isPresent()) { + final long actionId = getActionId(confirmationBaseLink.get()); + log.info(LOG_PREFIX + "Confirmation is required for action {}!", getTenantId(), + getControllerId(), actionId); + // TODO - confirmation handler + sendConfirmationFeedback(actionId); + executor.schedule(this::poll, IMMEDIATE_MS, TimeUnit.MILLISECONDS); + } else { + getRequiredLink(controllerBase, DEPLOYMENT_BASE_LINK).flatMap(this::getActionWithDeployment) + .ifPresentOrElse(actionWithDeployment -> { + final long actionId = actionWithDeployment.getKey(); + if (currentActionId == null) { + if (lastActionId != null && lastActionId == actionId) { + log.info(LOG_PREFIX + "Still receive the last action {}", + getTenantId(), getControllerId(), actionId); + return; + } - log.info(LOG_PREFIX + "Process action {}", getTenantId(), getControllerId(), - actionId); - final DdiDeployment deployment = actionWithDeployment.getValue().getDeployment(); - final DdiDeployment.HandlingType updateType = deployment.getUpdate(); - final List modules = deployment.getChunks(); + log.info(LOG_PREFIX + "Process action {}", getTenantId(), getControllerId(), + actionId); + final DdiDeployment deployment = actionWithDeployment.getValue().getDeployment(); + final DdiDeployment.HandlingType updateType = deployment.getUpdate(); + final List modules = deployment.getChunks(); - currentActionId = actionId; - executor.submit( - updateHandler.getUpdateProcessor(this, updateType, modules)); - } else if (currentActionId != actionId) { - // TODO - cancel and start new one? - log.info(LOG_PREFIX + "Action {} is canceled while in process (new {})!", getTenantId(), - getControllerId(), currentActionId, actionId); - } // else same action - already processing - }, () -> { - if (currentActionId != null) { - // TODO - cancel current? - log.info(LOG_PREFIX + "Action {} is canceled while in process (not returned)!", getTenantId(), - getControllerId(), getCurrentActionId()); - } - }); - executor.schedule(this::poll, getPollMillis(controllerBase), TimeUnit.MILLISECONDS); + currentActionId = actionId; + executor.submit( + updateHandler.getUpdateProcessor(this, updateType, modules)); + } else if (currentActionId != actionId) { + // TODO - cancel and start new one? + log.info(LOG_PREFIX + "Action {} is canceled while in process (new {})!", getTenantId(), + getControllerId(), currentActionId, actionId); + } // else same action - already processing + }, () -> { + if (currentActionId != null) { + // TODO - cancel current? + log.info(LOG_PREFIX + "Action {} is canceled while in process (not returned)!", getTenantId(), + getControllerId(), getCurrentActionId()); + } + }); + executor.schedule(this::poll, getPollMillis(controllerBase), TimeUnit.MILLISECONDS); + } + }, + () -> { + // error has occurred or no controller base hasn't been acquired + executor.schedule(this::poll, DEFAULT_POLL_MS, TimeUnit.MILLISECONDS); } - }, - () -> { - // error has occurred or no controller base hasn't been acquired - executor.schedule(this::poll, DEFAULT_POLL_MS, TimeUnit.MILLISECONDS); - } - )); + )); } private Optional getControllerBase() { @@ -211,42 +241,14 @@ public class DdiController { final ResponseEntity action = getDdiApi() .getControllerDeploymentBaseAction(getTenantId(), getControllerId(), actionId, -1, null); if (action.getStatusCode() != HttpStatus.OK) { - log.warn(LOG_PREFIX + "Fail to get deployment action: {} -> {}", getTenantId(), getControllerId(), actionId, action.getStatusCode()); + log.warn(LOG_PREFIX + "Fail to get deployment action: {} -> {}", getTenantId(), getControllerId(), actionId, + action.getStatusCode()); return Optional.empty(); } return Optional.ofNullable(action.getBody() == null ? null : new AbstractMap.SimpleEntry<>(actionId, action.getBody())); } - public void updateAttribute(final String mode, final String key, final String value) { - final DdiUpdateMode updateMode = switch (mode.toLowerCase()) { - case "replace" -> DdiUpdateMode.REPLACE; - case "remove" -> DdiUpdateMode.REMOVE; - default -> DdiUpdateMode.MERGE; - }; - - final DdiConfigData configData = new DdiConfigData(Collections.singletonMap(key, value), updateMode); - - getDdiApi().putConfigData(configData, getTenantId(), getControllerId()); - } - - void sendFeedback(final UpdateStatus updateStatus) { - log.debug(LOG_PREFIX + "Send feedback {} -> {}", getTenantId(), getControllerId(), currentActionId, updateStatus); - try { - getDdiApi().postDeploymentBaseActionFeedback(updateStatus.feedback(), getTenantId(), getControllerId(), - currentActionId); - } catch (final RuntimeException e) { - log.error(LOG_PREFIX + "Failed to send feedback {} -> {}", getTenantId(), getControllerId(), - currentActionId, updateStatus, e); - } - - if (updateStatus.status() == UpdateStatus.Status.SUCCESSFUL || - updateStatus.status() == UpdateStatus.Status.FAILURE) { - lastActionId = currentActionId; - currentActionId = null; - } - } - private void sendConfirmationFeedback(final long actionId) { final DdiConfirmationFeedback ddiConfirmationFeedback = new DdiConfirmationFeedback( DdiConfirmationFeedback.Confirmation.CONFIRMED, 0, Collections.singletonList( diff --git a/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/DdiTenant.java b/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/DdiTenant.java index 117396006..28387b4fe 100644 --- a/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/DdiTenant.java +++ b/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/DdiTenant.java @@ -9,15 +9,15 @@ */ package org.eclipse.hawkbit.sdk.device; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; + import lombok.Getter; import org.eclipse.hawkbit.sdk.Controller; import org.eclipse.hawkbit.sdk.HawkbitClient; import org.eclipse.hawkbit.sdk.Tenant; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.ConcurrentHashMap; - /** * An in-memory simulated DDI Tenant to hold the controller twins in * memory and be able to retrieve them again. diff --git a/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/UpdateHandler.java b/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/UpdateHandler.java index d3973bd91..057f40ac8 100644 --- a/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/UpdateHandler.java +++ b/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/UpdateHandler.java @@ -9,6 +9,22 @@ */ package org.eclipse.hawkbit.sdk.device; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HexFormat; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + import lombok.extern.slf4j.Slf4j; import org.apache.hc.client5.http.classic.methods.HttpGet; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; @@ -28,22 +44,6 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HexFormat; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - /** * Update handler provide plug-in endpoint allowing for customization of the update processing. */ @@ -67,20 +67,16 @@ public interface UpdateHandler { @Slf4j class UpdateProcessor implements Runnable { + protected final Map downloads = new HashMap<>(); private static final String LOG_PREFIX = "[{}:{}] "; - private static final String DOWNLOAD_LOG_MESSAGE = "Download "; private static final String EXPECTED = "(Expected: "; private static final String BUT_GOT_LOG_MESSAGE = " but got: "; private static final int MINIMUM_TOKEN_LENGTH_FOR_HINT = 6; - private final DdiController ddiController; - private final DdiDeployment.HandlingType updateType; private final List modules; - private final ArtifactHandler artifactHandler; - protected final Map downloads = new HashMap<>(); public UpdateProcessor( final DdiController ddiController, @@ -186,101 +182,6 @@ public interface UpdateHandler { log.debug(LOG_PREFIX + "Cleaned up", ddiController.getTenantId(), ddiController.getControllerId()); } - private void handleArtifact( - final String targetToken, final String gatewayToken, - final List status, final DdiArtifact artifact) { - artifact.getLink("download").ifPresentOrElse( - // HTTPS - link -> status.add(downloadUrl(link.getHref(), gatewayToken, targetToken, - artifact.getHashes(), artifact.getSize())), - // HTTP - () -> status.add(downloadUrl( - artifact.getLink("download-http") - .map(Link::getHref) - .orElseThrow(() -> new IllegalArgumentException("Nor https nor http found!")), - gatewayToken, targetToken, - artifact.getHashes(), artifact.getSize())) - ); - } - - private UpdateStatus downloadUrl( - final String url, final String gatewayToken, final String targetToken, - final DdiArtifactHash hash, final long size) { - if (log.isDebugEnabled()) { - log.debug(LOG_PREFIX + "Downloading {} with token {}, expected hash {} and size {}", - ddiController.getTenantId(), ddiController.getControllerId(), url, - hideTokenDetails(targetToken), hash, size); - } - - try { - return readAndCheckDownloadUrl(url, gatewayToken, targetToken, hash, size); - } catch (final IOException | KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) { - log.error(LOG_PREFIX + "Failed to download {}", - ddiController.getTenantId(), ddiController.getControllerId(), url, e); - return new UpdateStatus( - UpdateStatus.Status.FAILURE, - List.of("Failed to download " + url + ": " + e.getMessage())); - } - } - - private UpdateStatus readAndCheckDownloadUrl(final String url, final String gatewayToken, - final String targetToken, final DdiArtifactHash hash, final long size) - throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException { - final Validator sizeValidator = sizeValidator(size); - final Validator hashValidator = hashValidator(hash); - final ArtifactHandler.DownloadHandler downloadHandler = artifactHandler.getDownloadHandler(url); - - try (final CloseableHttpClient httpclient = createHttpClientThatAcceptsAllServerCerts()) { - final HttpGet request = new HttpGet(url); - if (StringUtils.hasLength(targetToken)) { - request.addHeader(HttpHeaders.AUTHORIZATION, "TargetToken " + targetToken); - } else if (StringUtils.hasLength(gatewayToken)) { - request.addHeader(HttpHeaders.AUTHORIZATION, "GatewayToken " + gatewayToken); - } - - return httpclient.execute(request, response -> { - try { - if (response.getCode() != HttpStatus.OK.value()) { - throw new IllegalStateException("Unexpected status code: " + response.getCode()); - } - - if (response.getEntity().getContentLength() != size) { - throw new IllegalArgumentException("Wrong content length " + EXPECTED + size + BUT_GOT_LOG_MESSAGE + response.getEntity() - .getContentLength() + ")!"); - } - - final byte[] buff = new byte[32 * 1024]; - try (final InputStream is = response.getEntity().getContent()) { - for (int read; (read = is.read(buff)) != -1; ) { - sizeValidator.read(buff, read); - hashValidator.read(buff, read); - downloadHandler.read(buff, 0, read); - } - } - sizeValidator.validate(); - hashValidator.validate(); - - final String message = "Downloaded " + url + " (" + size + " bytes)"; - log.debug(LOG_PREFIX + message, ddiController.getTenantId(), ddiController.getControllerId()); - downloadHandler.finished(ArtifactHandler.DownloadHandler.Status.SUCCESS); - downloadHandler.download().ifPresent(path -> downloads.put(url, path)); - return new UpdateStatus(UpdateStatus.Status.SUCCESSFUL, List.of(message)); - } catch (final Exception e) { - final String message = e.getMessage(); - if (log.isTraceEnabled()) { - log.error(LOG_PREFIX + DOWNLOAD_LOG_MESSAGE + url + " failed: " + message, - ddiController.getTenantId(), ddiController.getControllerId(), e); - } else { - log.error(LOG_PREFIX + DOWNLOAD_LOG_MESSAGE + url + " failed: " + message, - ddiController.getTenantId(), ddiController.getControllerId()); - } - downloadHandler.finished(ArtifactHandler.DownloadHandler.Status.ERROR); - return new UpdateStatus(UpdateStatus.Status.FAILURE, List.of(message)); - } - }); - } - } - private static String hideTokenDetails(final String targetToken) { if (targetToken == null) { return ""; @@ -314,14 +215,6 @@ public interface UpdateHandler { .build(); } - - private interface Validator { - - void read(final byte[] buff, final int len); - - void validate(); - } - private static Validator sizeValidator(final long size) { return new Validator() { @@ -384,6 +277,7 @@ public interface UpdateHandler { } return new Validator() { + @Override public void read(final byte[] buff, final int len) { hashValidators.forEach(hashValidator -> hashValidator.update(buff, len)); @@ -395,5 +289,108 @@ public interface UpdateHandler { } }; } + + private void handleArtifact( + final String targetToken, final String gatewayToken, + final List status, final DdiArtifact artifact) { + artifact.getLink("download").ifPresentOrElse( + // HTTPS + link -> status.add(downloadUrl(link.getHref(), gatewayToken, targetToken, + artifact.getHashes(), artifact.getSize())), + // HTTP + () -> status.add(downloadUrl( + artifact.getLink("download-http") + .map(Link::getHref) + .orElseThrow(() -> new IllegalArgumentException("Nor https nor http found!")), + gatewayToken, targetToken, + artifact.getHashes(), artifact.getSize())) + ); + } + + private UpdateStatus downloadUrl( + final String url, final String gatewayToken, final String targetToken, + final DdiArtifactHash hash, final long size) { + if (log.isDebugEnabled()) { + log.debug(LOG_PREFIX + "Downloading {} with token {}, expected hash {} and size {}", + ddiController.getTenantId(), ddiController.getControllerId(), url, + hideTokenDetails(targetToken), hash, size); + } + + try { + return readAndCheckDownloadUrl(url, gatewayToken, targetToken, hash, size); + } catch (final IOException | KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) { + log.error(LOG_PREFIX + "Failed to download {}", + ddiController.getTenantId(), ddiController.getControllerId(), url, e); + return new UpdateStatus( + UpdateStatus.Status.FAILURE, + List.of("Failed to download " + url + ": " + e.getMessage())); + } + } + + private UpdateStatus readAndCheckDownloadUrl(final String url, final String gatewayToken, + final String targetToken, final DdiArtifactHash hash, final long size) + throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException { + final Validator sizeValidator = sizeValidator(size); + final Validator hashValidator = hashValidator(hash); + final ArtifactHandler.DownloadHandler downloadHandler = artifactHandler.getDownloadHandler(url); + + try (final CloseableHttpClient httpclient = createHttpClientThatAcceptsAllServerCerts()) { + final HttpGet request = new HttpGet(url); + if (StringUtils.hasLength(targetToken)) { + request.addHeader(HttpHeaders.AUTHORIZATION, "TargetToken " + targetToken); + } else if (StringUtils.hasLength(gatewayToken)) { + request.addHeader(HttpHeaders.AUTHORIZATION, "GatewayToken " + gatewayToken); + } + + return httpclient.execute(request, response -> { + try { + if (response.getCode() != HttpStatus.OK.value()) { + throw new IllegalStateException("Unexpected status code: " + response.getCode()); + } + + if (response.getEntity().getContentLength() != size) { + throw new IllegalArgumentException( + "Wrong content length " + EXPECTED + size + BUT_GOT_LOG_MESSAGE + response.getEntity() + .getContentLength() + ")!"); + } + + final byte[] buff = new byte[32 * 1024]; + try (final InputStream is = response.getEntity().getContent()) { + for (int read; (read = is.read(buff)) != -1; ) { + sizeValidator.read(buff, read); + hashValidator.read(buff, read); + downloadHandler.read(buff, 0, read); + } + } + sizeValidator.validate(); + hashValidator.validate(); + + final String message = "Downloaded " + url + " (" + size + " bytes)"; + log.debug(LOG_PREFIX + message, ddiController.getTenantId(), ddiController.getControllerId()); + downloadHandler.finished(ArtifactHandler.DownloadHandler.Status.SUCCESS); + downloadHandler.download().ifPresent(path -> downloads.put(url, path)); + return new UpdateStatus(UpdateStatus.Status.SUCCESSFUL, List.of(message)); + } catch (final Exception e) { + final String message = e.getMessage(); + if (log.isTraceEnabled()) { + log.error(LOG_PREFIX + DOWNLOAD_LOG_MESSAGE + url + " failed: " + message, + ddiController.getTenantId(), ddiController.getControllerId(), e); + } else { + log.error(LOG_PREFIX + DOWNLOAD_LOG_MESSAGE + url + " failed: " + message, + ddiController.getTenantId(), ddiController.getControllerId()); + } + downloadHandler.finished(ArtifactHandler.DownloadHandler.Status.ERROR); + return new UpdateStatus(UpdateStatus.Status.FAILURE, List.of(message)); + } + }); + } + } + + private interface Validator { + + void read(final byte[] buff, final int len); + + void validate(); + } } } \ No newline at end of file diff --git a/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/UpdateStatus.java b/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/UpdateStatus.java index d92589858..5d573eb8f 100644 --- a/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/UpdateStatus.java +++ b/hawkbit-sdk/hawkbit-sdk-device/src/main/java/org/eclipse/hawkbit/sdk/device/UpdateStatus.java @@ -9,14 +9,19 @@ */ package org.eclipse.hawkbit.sdk.device; +import java.util.List; + import org.eclipse.hawkbit.ddi.json.model.DdiActionFeedback; import org.eclipse.hawkbit.ddi.json.model.DdiResult; import org.eclipse.hawkbit.ddi.json.model.DdiStatus; -import java.util.List; - public record UpdateStatus(Status status, List messages) { + DdiActionFeedback feedback() { + return new DdiActionFeedback(null, + new DdiStatus(status.executionStatus, new DdiResult(status.finalResult, null), status.code, messages)); + } + /** * The status to response to the hawkBit update server if an simulated update process should be respond with * successful or failure update. @@ -59,9 +64,4 @@ public record UpdateStatus(Status status, List messages) { this.code = code; } } - - DdiActionFeedback feedback() { - return new DdiActionFeedback(null, - new DdiStatus(status.executionStatus, new DdiResult(status.finalResult, null), status.code, messages)); - } } diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/pom.xml b/hawkbit-sdk/hawkbit-sdk-dmf/pom.xml index 441309f50..0f45717b3 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/pom.xml +++ b/hawkbit-sdk/hawkbit-sdk-dmf/pom.xml @@ -10,35 +10,35 @@ --> - 4.0.0 - - org.eclipse.hawkbit - hawkbit-sdk - ${revision} - + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"> + 4.0.0 + + org.eclipse.hawkbit + hawkbit-sdk + ${revision} + - hawkbit-sdk-dmf - hawkBit :: SDK :: DMF SDK - DMF SDK that could be used for development of DMF integrations on JVM based languages + hawkbit-sdk-dmf + hawkBit :: SDK :: DMF SDK + DMF SDK that could be used for development of DMF integrations on JVM based languages - - - org.eclipse.hawkbit - hawkbit-sdk-commons - ${project.version} - + + + org.eclipse.hawkbit + hawkbit-sdk-commons + ${project.version} + - - org.eclipse.hawkbit - hawkbit-dmf-api - ${project.version} - + + org.eclipse.hawkbit + hawkbit-dmf-api + ${project.version} + - - org.springframework.amqp - spring-rabbit - - + + org.springframework.amqp + spring-rabbit + + \ No newline at end of file diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/DmfController.java b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/DmfController.java index bef946071..977570ef5 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/DmfController.java +++ b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/DmfController.java @@ -9,6 +9,10 @@ */ package org.eclipse.hawkbit.sdk.dmf; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ScheduledExecutorService; + import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -19,10 +23,6 @@ import org.eclipse.hawkbit.sdk.Controller; import org.eclipse.hawkbit.sdk.Tenant; import org.eclipse.hawkbit.sdk.dmf.amqp.DmfSender; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ScheduledExecutorService; - /** * Class representing DMF device twin connecting to hawkBit via DMF. */ diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/DmfTenant.java b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/DmfTenant.java index 9ca753d31..777b1be77 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/DmfTenant.java +++ b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/DmfTenant.java @@ -9,6 +9,11 @@ */ package org.eclipse.hawkbit.sdk.dmf; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.BiConsumer; + import lombok.Getter; import org.eclipse.hawkbit.sdk.Controller; import org.eclipse.hawkbit.sdk.Tenant; @@ -16,11 +21,6 @@ import org.eclipse.hawkbit.sdk.dmf.amqp.Amqp; import org.eclipse.hawkbit.sdk.dmf.amqp.VHost; import org.springframework.amqp.core.Message; -import java.util.Map; -import java.util.Optional; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.BiConsumer; - /** * An in-memory simulated DMF Tenant to hold the controller twins in * memory and be able to retrieve them again. diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/UpdateHandler.java b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/UpdateHandler.java index 1a1fb2c9d..7c8376621 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/UpdateHandler.java +++ b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/UpdateHandler.java @@ -9,6 +9,22 @@ */ package org.eclipse.hawkbit.sdk.dmf; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HexFormat; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + import lombok.extern.slf4j.Slf4j; import org.apache.hc.client5.http.classic.methods.HttpGet; import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; @@ -29,22 +45,6 @@ import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import org.springframework.util.StringUtils; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.security.KeyManagementException; -import java.security.KeyStoreException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HexFormat; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - /** * Update handler provide plug-in endpoint allowing for customization of the update processing. */ @@ -68,20 +68,16 @@ public interface UpdateHandler { @Slf4j class UpdateProcessor implements Runnable { + protected final Map downloads = new HashMap<>(); private static final String LOG_PREFIX = "[{}:{}] "; - private static final String DOWNLOAD_LOG_MESSAGE = "Download "; private static final String EXPECTED = "(Expected: "; private static final String BUT_GOT_LOG_MESSAGE = " but got: "; private static final int MINIMUM_TOKEN_LENGTH_FOR_HINT = 6; - private final DmfController dmfController; - private final DmfDownloadAndUpdateRequest updateRequest; private final EventTopic eventTopic; - private final ArtifactHandler artifactHandler; - protected final Map downloads = new HashMap<>(); public UpdateProcessor( final DmfController dmfController, @@ -189,94 +185,6 @@ public interface UpdateHandler { log.debug(LOG_PREFIX + "Cleaned up", dmfController.getTenantId(), dmfController.getControllerId()); } - private void handleArtifact( - final String targetToken, - final List status, final DmfArtifact artifact) { - if (artifact.getUrls().containsKey("HTTPS")) { - status.add(downloadUrl(artifact.getUrls().get("HTTPS"), targetToken, - artifact.getHashes(), artifact.getSize())); - } else if (artifact.getUrls().containsKey("HTTP")) { - status.add(downloadUrl(artifact.getUrls().get("HTTP"), targetToken, - artifact.getHashes(), artifact.getSize())); - } - } - - private UpdateStatus downloadUrl( - final String url, final String targetToken, - final DmfArtifactHash hash, final long size) { - if (log.isDebugEnabled()) { - log.debug(LOG_PREFIX + "Downloading {} with token {}, expected hash {} and size {}", - dmfController.getTenantId(), dmfController.getControllerId(), url, - hideTokenDetails(targetToken), hash, size); - } - - try { - return readAndCheckDownloadUrl(url, targetToken, hash, size); - } catch (final IOException | KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) { - log.error(LOG_PREFIX + "Failed to download {}", - dmfController.getTenantId(), dmfController.getControllerId(), url, e); - return new UpdateStatus( - DmfActionStatus.ERROR, - List.of("Failed to download " + url + ": " + e.getMessage())); - } - } - - private UpdateStatus readAndCheckDownloadUrl(final String url, - final String targetToken, final DmfArtifactHash hash, final long size) - throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException { - final Validator sizeValidator = sizeValidator(size); - final Validator hashValidator = hashValidator(hash); - final ArtifactHandler.DownloadHandler downloadHandler = artifactHandler.getDownloadHandler(url); - - try (final CloseableHttpClient httpclient = createHttpClientThatAcceptsAllServerCerts()) { - final HttpGet request = new HttpGet(url); - if (StringUtils.hasLength(targetToken)) { - request.addHeader(HttpHeaders.AUTHORIZATION, "TargetToken " + targetToken); - } - - return httpclient.execute(request, response -> { - try { - if (response.getCode() != HttpStatus.OK.value()) { - throw new IllegalStateException("Unexpected status code: " + response.getCode()); - } - - if (response.getEntity().getContentLength() != size) { - throw new IllegalArgumentException("Wrong content length " + EXPECTED + size + BUT_GOT_LOG_MESSAGE + response.getEntity() - .getContentLength() + ")!"); - } - - final byte[] buff = new byte[32 * 1024]; - try (final InputStream is = response.getEntity().getContent()) { - for (int read; (read = is.read(buff)) != -1; ) { - sizeValidator.read(buff, read); - hashValidator.read(buff, read); - downloadHandler.read(buff, 0, read); - } - } - sizeValidator.validate(); - hashValidator.validate(); - - final String message = "Downloaded " + url + " (" + size + " bytes)"; - log.debug(LOG_PREFIX + message, dmfController.getTenantId(), dmfController.getControllerId()); - downloadHandler.finished(ArtifactHandler.DownloadHandler.Status.SUCCESS); - downloadHandler.download().ifPresent(path -> downloads.put(url, path)); - return new UpdateStatus(DmfActionStatus.FINISHED, List.of(message)); - } catch (final Exception e) { - final String message = e.getMessage(); - if (log.isTraceEnabled()) { - log.error(LOG_PREFIX + DOWNLOAD_LOG_MESSAGE + url + " failed: " + message, - dmfController.getTenantId(), dmfController.getControllerId(), e); - } else { - log.error(LOG_PREFIX + DOWNLOAD_LOG_MESSAGE + url + " failed: " + message, - dmfController.getTenantId(), dmfController.getControllerId()); - } - downloadHandler.finished(ArtifactHandler.DownloadHandler.Status.ERROR); - return new UpdateStatus(DmfActionStatus.ERROR, List.of(message)); - } - }); - } - } - private static String hideTokenDetails(final String targetToken) { if (targetToken == null) { return ""; @@ -310,14 +218,6 @@ public interface UpdateHandler { .build(); } - - private interface Validator { - - void read(final byte[] buff, final int len); - - void validate(); - } - private static Validator sizeValidator(final long size) { return new Validator() { @@ -377,6 +277,7 @@ public interface UpdateHandler { } return new Validator() { + @Override public void read(final byte[] buff, final int len) { hashValidators.forEach(hashValidator -> hashValidator.update(buff, len)); @@ -388,5 +289,101 @@ public interface UpdateHandler { } }; } + + private void handleArtifact( + final String targetToken, + final List status, final DmfArtifact artifact) { + if (artifact.getUrls().containsKey("HTTPS")) { + status.add(downloadUrl(artifact.getUrls().get("HTTPS"), targetToken, + artifact.getHashes(), artifact.getSize())); + } else if (artifact.getUrls().containsKey("HTTP")) { + status.add(downloadUrl(artifact.getUrls().get("HTTP"), targetToken, + artifact.getHashes(), artifact.getSize())); + } + } + + private UpdateStatus downloadUrl( + final String url, final String targetToken, + final DmfArtifactHash hash, final long size) { + if (log.isDebugEnabled()) { + log.debug(LOG_PREFIX + "Downloading {} with token {}, expected hash {} and size {}", + dmfController.getTenantId(), dmfController.getControllerId(), url, + hideTokenDetails(targetToken), hash, size); + } + + try { + return readAndCheckDownloadUrl(url, targetToken, hash, size); + } catch (final IOException | KeyManagementException | NoSuchAlgorithmException | KeyStoreException e) { + log.error(LOG_PREFIX + "Failed to download {}", + dmfController.getTenantId(), dmfController.getControllerId(), url, e); + return new UpdateStatus( + DmfActionStatus.ERROR, + List.of("Failed to download " + url + ": " + e.getMessage())); + } + } + + private UpdateStatus readAndCheckDownloadUrl(final String url, + final String targetToken, final DmfArtifactHash hash, final long size) + throws NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException { + final Validator sizeValidator = sizeValidator(size); + final Validator hashValidator = hashValidator(hash); + final ArtifactHandler.DownloadHandler downloadHandler = artifactHandler.getDownloadHandler(url); + + try (final CloseableHttpClient httpclient = createHttpClientThatAcceptsAllServerCerts()) { + final HttpGet request = new HttpGet(url); + if (StringUtils.hasLength(targetToken)) { + request.addHeader(HttpHeaders.AUTHORIZATION, "TargetToken " + targetToken); + } + + return httpclient.execute(request, response -> { + try { + if (response.getCode() != HttpStatus.OK.value()) { + throw new IllegalStateException("Unexpected status code: " + response.getCode()); + } + + if (response.getEntity().getContentLength() != size) { + throw new IllegalArgumentException( + "Wrong content length " + EXPECTED + size + BUT_GOT_LOG_MESSAGE + response.getEntity() + .getContentLength() + ")!"); + } + + final byte[] buff = new byte[32 * 1024]; + try (final InputStream is = response.getEntity().getContent()) { + for (int read; (read = is.read(buff)) != -1; ) { + sizeValidator.read(buff, read); + hashValidator.read(buff, read); + downloadHandler.read(buff, 0, read); + } + } + sizeValidator.validate(); + hashValidator.validate(); + + final String message = "Downloaded " + url + " (" + size + " bytes)"; + log.debug(LOG_PREFIX + message, dmfController.getTenantId(), dmfController.getControllerId()); + downloadHandler.finished(ArtifactHandler.DownloadHandler.Status.SUCCESS); + downloadHandler.download().ifPresent(path -> downloads.put(url, path)); + return new UpdateStatus(DmfActionStatus.FINISHED, List.of(message)); + } catch (final Exception e) { + final String message = e.getMessage(); + if (log.isTraceEnabled()) { + log.error(LOG_PREFIX + DOWNLOAD_LOG_MESSAGE + url + " failed: " + message, + dmfController.getTenantId(), dmfController.getControllerId(), e); + } else { + log.error(LOG_PREFIX + DOWNLOAD_LOG_MESSAGE + url + " failed: " + message, + dmfController.getTenantId(), dmfController.getControllerId()); + } + downloadHandler.finished(ArtifactHandler.DownloadHandler.Status.ERROR); + return new UpdateStatus(DmfActionStatus.ERROR, List.of(message)); + } + }); + } + } + + private interface Validator { + + void read(final byte[] buff, final int len); + + void validate(); + } } } \ No newline at end of file diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/UpdateStatus.java b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/UpdateStatus.java index 0bf847ae8..b46167f66 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/UpdateStatus.java +++ b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/UpdateStatus.java @@ -9,8 +9,8 @@ */ package org.eclipse.hawkbit.sdk.dmf; -import org.eclipse.hawkbit.dmf.json.model.DmfActionStatus; - import java.util.List; +import org.eclipse.hawkbit.dmf.json.model.DmfActionStatus; + public record UpdateStatus(DmfActionStatus status, List messages) {} \ No newline at end of file diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/Amqp.java b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/Amqp.java index 122159731..409409bef 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/Amqp.java +++ b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/Amqp.java @@ -9,6 +9,10 @@ */ package org.eclipse.hawkbit.sdk.dmf.amqp; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.util.concurrent.ConcurrentHashMap; + import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.sdk.Tenant.DMF; import org.springframework.amqp.rabbit.connection.CachingConnectionFactory; @@ -16,10 +20,6 @@ import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.boot.autoconfigure.amqp.RabbitProperties; import org.springframework.util.ObjectUtils; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.util.concurrent.ConcurrentHashMap; - /** * Abstract class for connecting to AMQP host. */ @@ -41,7 +41,7 @@ public class Amqp { public VHost getVhost(final DMF dmf, final boolean initVHost) { final String vHost = dmf == null || ObjectUtils.isEmpty(dmf.getVirtualHost()) ? - (rabbitProperties.getVirtualHost() == null ? "/" :rabbitProperties.getVirtualHost()) : + (rabbitProperties.getVirtualHost() == null ? "/" : rabbitProperties.getVirtualHost()) : dmf.getVirtualHost(); return vHosts.computeIfAbsent(vHost, vh -> new VHost(getConnectionFactory(dmf, vHost), amqpProperties, initVHost)); } diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/AmqpProperties.java b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/AmqpProperties.java index 902550092..86774cf4b 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/AmqpProperties.java +++ b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/AmqpProperties.java @@ -12,7 +12,6 @@ package org.eclipse.hawkbit.sdk.dmf.amqp; import lombok.Data; import lombok.ToString; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; /** * Bean which holds the necessary properties for configuring the AMQP connection. diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/DmfSender.java b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/DmfSender.java index 88e0a00cf..3e3cd4cc2 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/DmfSender.java +++ b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/DmfSender.java @@ -9,6 +9,8 @@ */ package org.eclipse.hawkbit.sdk.dmf.amqp; +import static org.eclipse.hawkbit.dmf.amqp.api.AmqpSettings.DMF_EXCHANGE; + import java.util.List; import java.util.Map; import java.util.UUID; @@ -31,17 +33,14 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.support.converter.AbstractJavaTypeMapper; import org.springframework.util.ObjectUtils; -import static org.eclipse.hawkbit.dmf.amqp.api.AmqpSettings.DMF_EXCHANGE; - /** * Sender service to send messages to update server. */ @Slf4j public class DmfSender { - private static final byte[] EMPTY_BODY = new byte[0]; - protected final RabbitTemplate rabbitTemplate; + private static final byte[] EMPTY_BODY = new byte[0]; private final AmqpProperties amqpProperties; private final ConcurrentHashMap> pingListeners = new ConcurrentHashMap<>(); diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/VHost.java b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/VHost.java index 64e2a9d54..f467e6178 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/VHost.java +++ b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/amqp/VHost.java @@ -9,6 +9,15 @@ */ package org.eclipse.hawkbit.sdk.dmf.amqp; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + import lombok.extern.slf4j.Slf4j; import org.eclipse.hawkbit.dmf.amqp.api.EventTopic; import org.eclipse.hawkbit.dmf.amqp.api.MessageHeaderKey; @@ -33,24 +42,15 @@ import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; import org.springframework.amqp.support.converter.AbstractJavaTypeMapper; import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.Collections; -import java.util.HashSet; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - /** * Abstract class for sender and receiver service. */ @Slf4j public class VHost extends DmfSender implements MessageListener { + private static final String REGEX_EXTRACT_ACTION_ID = "[^0-9]"; private final SimpleMessageListenerContainer container; private final ConcurrentHashMap dmfTenants = new ConcurrentHashMap<>(); - private final Set openActions = Collections.synchronizedSet(new HashSet<>()); public VHost(final ConnectionFactory connectionFactory, final AmqpProperties amqpProperties) { @@ -80,7 +80,7 @@ public class VHost extends DmfSender implements MessageListener { rabbitAdmin.declareExchange(exchange); rabbitAdmin.declareBinding(BindingBuilder.bind(queue).to(exchange)); } - + container = new SimpleMessageListenerContainer(); container.setConnectionFactory(connectionFactory); container.setQueueNames(amqpProperties.getReceiverConnectorQueueFromSp()); @@ -88,11 +88,6 @@ public class VHost extends DmfSender implements MessageListener { container.start(); } - void stop() { - container.stop(); - rabbitTemplate.destroy(); - } - public void register(final DmfTenant dmfTenant) { dmfTenants.put(dmfTenant.getTenant().getTenantId(), dmfTenant); } @@ -100,8 +95,8 @@ public class VHost extends DmfSender implements MessageListener { @Override public void onMessage(final Message message) { final String tenantId = getTenant(message); - final String controllerId = (String)message.getMessageProperties().getHeaders().get(MessageHeaderKey.THING_ID); - final String type = (String)message.getMessageProperties().getHeaders().get(MessageHeaderKey.TYPE); + final String controllerId = (String) message.getMessageProperties().getHeaders().get(MessageHeaderKey.THING_ID); + final String type = (String) message.getMessageProperties().getHeaders().get(MessageHeaderKey.TYPE); log.info("Message received for target {}, value : {}", controllerId, message); switch (MessageType.valueOf(type)) { @@ -130,6 +125,62 @@ public class VHost extends DmfSender implements MessageListener { } } + protected void handleAttributeUpdateRequest(final Message message, final String controllerId) { + final String tenantId = getTenant(message); + Optional.ofNullable(dmfTenants.get(tenantId)) + .flatMap(dmfTenant -> dmfTenant.getController(controllerId)) + .ifPresent(controller -> + updateAttributes(tenantId, controllerId, DmfUpdateMode.MERGE, controller.getAttributes())); + } + + protected void handleCancelDownloadAction(final Message message, final String thingId) { + final String tenant = getTenant(message); + final Long actionId = extractActionIdFrom(message); + + processCancelDownloadAction(thingId, tenant, actionId); + } + + protected void handleUpdateProcess(final Message message, final String controllerId, final EventTopic actionType) { + final String tenant = getTenant(message); + final DmfDownloadAndUpdateRequest downloadAndUpdateRequest = convertMessage(message, + DmfDownloadAndUpdateRequest.class); + dmfTenants.get(tenant).getController(controllerId) + .ifPresent(controller -> controller.setCurrentActionId(downloadAndUpdateRequest.getActionId())); + processUpdate(tenant, controllerId, actionType, downloadAndUpdateRequest); + } + + void stop() { + container.stop(); + rabbitTemplate.destroy(); + } + + private static String getTenant(final Message message) { + final MessageProperties messageProperties = message.getMessageProperties(); + final Map headers = messageProperties.getHeaders(); + return (String) headers.get(MessageHeaderKey.TENANT); + } + + /** + * Method to validate if content type is set in the message properties. + * + * @param message the message to get validated + */ + private static void checkContentTypeJson(final Message message) { + if (message.getBody().length == 0) { + return; + } + final MessageProperties messageProperties = message.getMessageProperties(); + final String headerContentType = (String) messageProperties.getHeaders().get("content-type"); + if (null != headerContentType) { + messageProperties.setContentType(headerContentType); + } + final String contentType = messageProperties.getContentType(); + if (contentType != null && contentType.contains("json")) { + return; + } + throw new AmqpRejectAndDontRequeueException("Content-Type is not JSON compatible"); + } + private void handleEventMessage(final Message message, final String thingId) { final Object eventHeader = message.getMessageProperties().getHeaders().get(MessageHeaderKey.TOPIC); if (eventHeader == null) { @@ -138,27 +189,26 @@ public class VHost extends DmfSender implements MessageListener { } // Exception squid:S2259 - Checked before - @SuppressWarnings({ "squid:S2259" }) - final EventTopic eventTopic = EventTopic.valueOf(eventHeader.toString()); + @SuppressWarnings({ "squid:S2259" }) final EventTopic eventTopic = EventTopic.valueOf(eventHeader.toString()); switch (eventTopic) { - case CONFIRM: - handleConfirmation(message, thingId); - break; - case DOWNLOAD_AND_INSTALL, DOWNLOAD: - handleUpdateProcess(message, thingId, eventTopic); - break; - case CANCEL_DOWNLOAD: - handleCancelDownloadAction(message, thingId); - break; - case REQUEST_ATTRIBUTES_UPDATE: - handleAttributeUpdateRequest(message, thingId); - break; - case MULTI_ACTION: - handleMultiActionRequest(message, thingId); - break; - default: - log.info("No valid event property: {}", eventTopic); - break; + case CONFIRM: + handleConfirmation(message, thingId); + break; + case DOWNLOAD_AND_INSTALL, DOWNLOAD: + handleUpdateProcess(message, thingId, eventTopic); + break; + case CANCEL_DOWNLOAD: + handleCancelDownloadAction(message, thingId); + break; + case REQUEST_ATTRIBUTES_UPDATE: + handleAttributeUpdateRequest(message, thingId); + break; + case MULTI_ACTION: + handleMultiActionRequest(message, thingId); + break; + default: + log.info("No valid event property: {}", eventTopic); + break; } } @@ -166,7 +216,6 @@ public class VHost extends DmfSender implements MessageListener { log.warn("Handle confirmed received for {}! Skip it!", controllerId); } - private static final String REGEX_EXTRACT_ACTION_ID = "[^0-9]"; private long extractActionIdFrom(final Message message) { final String messageAsString = message.toString(); final String requiredMessageContent = messageAsString @@ -191,57 +240,29 @@ public class VHost extends DmfSender implements MessageListener { openActions.add(actionId); switch (eventTopic) { - case DOWNLOAD: - case DOWNLOAD_AND_INSTALL: - if (action instanceof DmfDownloadAndUpdateRequest) { - processUpdate(tenant, controllerId, eventTopic, (DmfDownloadAndUpdateRequest) action); - } - break; - case CANCEL_DOWNLOAD: - processCancelDownloadAction(controllerId, tenant, action.getActionId()); - break; - default: - openActions.remove(actionId); - log.info("No valid event property in MULTI_ACTION."); - break; + case DOWNLOAD: + case DOWNLOAD_AND_INSTALL: + if (action instanceof DmfDownloadAndUpdateRequest) { + processUpdate(tenant, controllerId, eventTopic, (DmfDownloadAndUpdateRequest) action); + } + break; + case CANCEL_DOWNLOAD: + processCancelDownloadAction(controllerId, tenant, action.getActionId()); + break; + default: + openActions.remove(actionId); + log.info("No valid event property in MULTI_ACTION."); + break; } } - protected void handleAttributeUpdateRequest(final Message message, final String controllerId) { - final String tenantId = getTenant(message); - Optional.ofNullable(dmfTenants.get(tenantId)) - .flatMap(dmfTenant -> dmfTenant.getController(controllerId)) - .ifPresent(controller -> - updateAttributes(tenantId, controllerId, DmfUpdateMode.MERGE, controller.getAttributes())); - } - - private static String getTenant(final Message message) { - final MessageProperties messageProperties = message.getMessageProperties(); - final Map headers = messageProperties.getHeaders(); - return (String) headers.get(MessageHeaderKey.TENANT); - } - - protected void handleCancelDownloadAction(final Message message, final String thingId) { - final String tenant = getTenant(message); - final Long actionId = extractActionIdFrom(message); - - processCancelDownloadAction(thingId, tenant, actionId); - } - private void processCancelDownloadAction(final String thingId, final String tenant, final Long actionId) { finishUpdateProcess(thingId, actionId, Collections.singletonList("Simulation canceled")); openActions.remove(actionId); } - protected void handleUpdateProcess(final Message message, final String controllerId, final EventTopic actionType) { - final String tenant = getTenant(message); - final DmfDownloadAndUpdateRequest downloadAndUpdateRequest = convertMessage(message, - DmfDownloadAndUpdateRequest.class); - dmfTenants.get(tenant).getController(controllerId).ifPresent(controller -> controller.setCurrentActionId(downloadAndUpdateRequest.getActionId())); - processUpdate(tenant, controllerId, actionType, downloadAndUpdateRequest); - } - - private void processUpdate(final String tenantId, final String controllerId, final EventTopic actionType, final DmfDownloadAndUpdateRequest updateRequest) { + private void processUpdate(final String tenantId, final String controllerId, final EventTopic actionType, + final DmfDownloadAndUpdateRequest updateRequest) { Optional.ofNullable(dmfTenants.get(tenantId)) .flatMap(dmfTenant -> dmfTenant.getController(controllerId)) .ifPresent(controller -> controller.processUpdate(actionType, updateRequest)); @@ -257,26 +278,4 @@ public class VHost extends DmfSender implements MessageListener { clazz.getTypeName()); return (T) rabbitTemplate.getMessageConverter().fromMessage(message); } - - /** - * Method to validate if content type is set in the message properties. - * - * @param message - * the message to get validated - */ - private static void checkContentTypeJson(final Message message) { - if (message.getBody().length == 0) { - return; - } - final MessageProperties messageProperties = message.getMessageProperties(); - final String headerContentType = (String) messageProperties.getHeaders().get("content-type"); - if (null != headerContentType) { - messageProperties.setContentType(headerContentType); - } - final String contentType = messageProperties.getContentType(); - if (contentType != null && contentType.contains("json")) { - return; - } - throw new AmqpRejectAndDontRequeueException("Content-Type is not JSON compatible"); - } } \ No newline at end of file diff --git a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/health/HealthService.java b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/health/HealthService.java index 110451976..da9ec32ee 100644 --- a/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/health/HealthService.java +++ b/hawkbit-sdk/hawkbit-sdk-dmf/src/main/java/org/eclipse/hawkbit/sdk/dmf/health/HealthService.java @@ -9,18 +9,18 @@ */ package org.eclipse.hawkbit.sdk.dmf.health; -import org.eclipse.hawkbit.sdk.dmf.DmfTenant; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.amqp.core.Message; -import org.springframework.scheduling.annotation.Scheduled; - import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; import java.util.UUID; +import org.eclipse.hawkbit.sdk.dmf.DmfTenant; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.amqp.core.Message; +import org.springframework.scheduling.annotation.Scheduled; + /** * Handle all incoming Messages from hawkBit update server. */ diff --git a/hawkbit-sdk/hawkbit-sdk-mgmt/pom.xml b/hawkbit-sdk/hawkbit-sdk-mgmt/pom.xml index 15782df13..446fd9765 100644 --- a/hawkbit-sdk/hawkbit-sdk-mgmt/pom.xml +++ b/hawkbit-sdk/hawkbit-sdk-mgmt/pom.xml @@ -10,8 +10,8 @@ --> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"> 4.0.0 diff --git a/hawkbit-sdk/hawkbit-sdk-mgmt/src/main/java/org/eclipse/hawkbit/sdk/mgmt/MgmtApi.java b/hawkbit-sdk/hawkbit-sdk-mgmt/src/main/java/org/eclipse/hawkbit/sdk/mgmt/MgmtApi.java index c6bc8e8c8..c2df9641f 100644 --- a/hawkbit-sdk/hawkbit-sdk-mgmt/src/main/java/org/eclipse/hawkbit/sdk/mgmt/MgmtApi.java +++ b/hawkbit-sdk/hawkbit-sdk-mgmt/src/main/java/org/eclipse/hawkbit/sdk/mgmt/MgmtApi.java @@ -9,6 +9,12 @@ */ package org.eclipse.hawkbit.sdk.mgmt; +import java.security.SecureRandom; +import java.util.Base64; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Random; import feign.FeignException; import lombok.AllArgsConstructor; @@ -22,13 +28,6 @@ import org.eclipse.hawkbit.sdk.HawkbitClient; import org.eclipse.hawkbit.sdk.Tenant; import org.springframework.util.ObjectUtils; -import java.security.SecureRandom; -import java.util.Base64; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Random; - /** * Management Api Interface */ @@ -39,13 +38,17 @@ public class MgmtApi { private static final String AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY = "authentication.gatewaytoken.key"; private static final String AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_ENABLED = "authentication.gatewaytoken.enabled"; private static final String AUTHENTICATION_MODE_TARGET_SECURITY_TOKEN_ENABLED = "authentication.targettoken.enabled"; - - + private static final Random RND = new SecureRandom(); @NonNull private final Tenant tenant; @NonNull private final HawkbitClient hawkbitClient; + public static String randomToken() { + final byte[] rnd = new byte[24]; + RND.nextBytes(rnd); + return Base64.getEncoder().encodeToString(rnd); + } // if gateway toke is configured then the gateway auth is enabled key is set // so all devices use gateway token authentication @@ -73,8 +76,8 @@ public class MgmtApi { } if (!gatewayToken.equals( Objects.requireNonNull(mgmtTenantManagementRestApi - .getTenantConfigurationValue(AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY) - .getBody()).getValue())) { + .getTenantConfigurationValue(AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY) + .getBody()).getValue())) { mgmtTenantManagementRestApi.updateTenantConfiguration( Map.of(AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, gatewayToken) ); @@ -121,11 +124,4 @@ public class MgmtApi { public void deleteController(final String controllerId) { hawkbitClient.mgmtService(MgmtTargetRestApi.class, tenant).deleteTarget(controllerId); } - - private static final Random RND = new SecureRandom(); - public static String randomToken() { - final byte[] rnd = new byte[24]; - RND.nextBytes(rnd); - return Base64.getEncoder().encodeToString(rnd); - } } \ No newline at end of file diff --git a/hawkbit-sdk/pom.xml b/hawkbit-sdk/pom.xml index bd994b569..ad9b8911e 100644 --- a/hawkbit-sdk/pom.xml +++ b/hawkbit-sdk/pom.xml @@ -9,8 +9,8 @@ SPDX-License-Identifier: EPL-2.0 --> - 4.0.0 diff --git a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/SpPermission.java b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/SpPermission.java index ed80da771..5f9891c21 100644 --- a/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/SpPermission.java +++ b/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/SpPermission.java @@ -198,16 +198,6 @@ public final class SpPermission { public static final String BRACKET_CLOSE = ")"; public static final String HAS_AUTH_PREFIX = "hasAuthority" + BRACKET_OPEN + "'"; public static final String HAS_AUTH_SUFFIX = "'" + BRACKET_CLOSE; - public static final String HAS_AUTH_AND = " and "; - /** - * The role which contains the spring security context in case the - * system is executing code which is necessary to be privileged. - */ - public static final String SYSTEM_ROLE = "ROLE_SYSTEM_CODE"; - /** - * The spring security eval expression operator {@code or}. - */ - public static final String HAS_AUTH_OR = " or "; /** * Spring security eval hasAnyRole expression to check if the spring * context contains system code role @@ -387,6 +377,16 @@ public final class SpPermission { */ public static final String HAS_AUTH_TENANT_CONFIGURATION = HAS_AUTH_PREFIX + TENANT_CONFIGURATION + HAS_AUTH_SUFFIX + HAS_AUTH_OR + IS_SYSTEM_CODE; + public static final String HAS_AUTH_AND = " and "; + /** + * The role which contains the spring security context in case the + * system is executing code which is necessary to be privileged. + */ + public static final String SYSTEM_ROLE = "ROLE_SYSTEM_CODE"; + /** + * The spring security eval expression operator {@code or}. + */ + public static final String HAS_AUTH_OR = " or "; /** * The role which contains in the spring security context in case an * controller is authenticated. diff --git a/hawkbit-starters/README.md b/hawkbit-starters/README.md index f52f91dfc..a560b8e71 100644 --- a/hawkbit-starters/README.md +++ b/hawkbit-starters/README.md @@ -1,5 +1,8 @@ -This is a set of [Spring Boot Starters](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) that allows to quick start a spring boot based application with hawkBit's core functionality. +This is a set +of [Spring Boot Starters](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) that +allows to quick start a spring boot based application with hawkBit's core functionality. -The [all in one](hawkbit-boot-starter) starter contains the complete feature set in addition we provide four starters for the hawkBit interfaces. They can be combined in any order. +The [all in one](hawkbit-boot-starter) starter contains the complete feature set in addition we provide four starters +for the hawkBit interfaces. They can be combined in any order. Check out the hawkBit [update server](../hawkbit-runtime/hawkbit-update-server) as a reference. \ No newline at end of file diff --git a/hawkbit-starters/hawkbit-boot-starter-ddi-api/README.md b/hawkbit-starters/hawkbit-boot-starter-ddi-api/README.md index 7a900dfae..bf30adfb6 100644 --- a/hawkbit-starters/hawkbit-boot-starter-ddi-api/README.md +++ b/hawkbit-starters/hawkbit-boot-starter-ddi-api/README.md @@ -1 +1,2 @@ -[Spring Boot Starter](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) for the [Direct Device Integration API](https://www.eclipse.org/hawkbit/documentation/interfaces/ddi-api.html). \ No newline at end of file +[Spring Boot Starter](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) for +the [Direct Device Integration API](https://www.eclipse.org/hawkbit/documentation/interfaces/ddi-api.html). \ No newline at end of file diff --git a/hawkbit-starters/hawkbit-boot-starter-ddi-api/pom.xml b/hawkbit-starters/hawkbit-boot-starter-ddi-api/pom.xml index b330ee40b..634843d3f 100644 --- a/hawkbit-starters/hawkbit-boot-starter-ddi-api/pom.xml +++ b/hawkbit-starters/hawkbit-boot-starter-ddi-api/pom.xml @@ -9,68 +9,68 @@ SPDX-License-Identifier: EPL-2.0 --> - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-starters - ${revision} - - hawkbit-boot-starter-ddi-api - hawkBit :: Spring Boot Starter DDI API + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-starters + ${revision} + + hawkbit-boot-starter-ddi-api + hawkBit :: Spring Boot Starter DDI API - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter - - - org.springframework.security - spring-security-web - - - org.springframework.security - spring-security-config - - - org.springframework.security - spring-security-aspects - - + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter + + + org.springframework.security + spring-security-web + + + org.springframework.security + spring-security-config + + + org.springframework.security + spring-security-aspects + + - - - org.eclipse.hawkbit - hawkbit-ddi-resource - ${project.version} - - - org.eclipse.hawkbit - hawkbit-security-integration - ${project.version} - - - org.eclipse.hawkbit - hawkbit-http-security - ${project.version} - - - org.eclipse.hawkbit - hawkbit-repository-jpa - ${project.version} - - - org.eclipse.hawkbit - hawkbit-autoconfigure - ${project.version} - - + + + org.eclipse.hawkbit + hawkbit-ddi-resource + ${project.version} + + + org.eclipse.hawkbit + hawkbit-security-integration + ${project.version} + + + org.eclipse.hawkbit + hawkbit-http-security + ${project.version} + + + org.eclipse.hawkbit + hawkbit-repository-jpa + ${project.version} + + + org.eclipse.hawkbit + hawkbit-autoconfigure + ${project.version} + + - + \ No newline at end of file diff --git a/hawkbit-starters/hawkbit-boot-starter-dmf-api/README.md b/hawkbit-starters/hawkbit-boot-starter-dmf-api/README.md index 6ed433b5c..7059bee9c 100644 --- a/hawkbit-starters/hawkbit-boot-starter-dmf-api/README.md +++ b/hawkbit-starters/hawkbit-boot-starter-dmf-api/README.md @@ -1 +1,2 @@ -[Spring Boot Starter](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) for the [Device Management Federation API (AMQP 0.9)](https://www.eclipse.org/hawkbit/documentation/interfaces/dmf-api.html). \ No newline at end of file +[Spring Boot Starter](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) for +the [Device Management Federation API (AMQP 0.9)](https://www.eclipse.org/hawkbit/documentation/interfaces/dmf-api.html). \ No newline at end of file diff --git a/hawkbit-starters/hawkbit-boot-starter-dmf-api/pom.xml b/hawkbit-starters/hawkbit-boot-starter-dmf-api/pom.xml index e2627676f..bc61937ce 100644 --- a/hawkbit-starters/hawkbit-boot-starter-dmf-api/pom.xml +++ b/hawkbit-starters/hawkbit-boot-starter-dmf-api/pom.xml @@ -9,49 +9,50 @@ SPDX-License-Identifier: EPL-2.0 --> - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-starters - ${revision} - - hawkbit-boot-starter-dmf-api - hawkBit :: Spring Boot Starter DMF API - - - - - org.springframework.boot - spring-boot-starter - - - org.springframework.security - spring-security-config - - - org.springframework.security - spring-security-aspects - - + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-starters + ${revision} + + hawkbit-boot-starter-dmf-api + hawkBit :: Spring Boot Starter DMF API - - - org.eclipse.hawkbit - hawkbit-dmf-amqp - ${project.version} - - - org.eclipse.hawkbit - hawkbit-repository-jpa - ${project.version} - - - org.eclipse.hawkbit - hawkbit-autoconfigure - ${project.version} - - + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.security + spring-security-config + + + org.springframework.security + spring-security-aspects + + - + + + org.eclipse.hawkbit + hawkbit-dmf-amqp + ${project.version} + + + org.eclipse.hawkbit + hawkbit-repository-jpa + ${project.version} + + + org.eclipse.hawkbit + hawkbit-autoconfigure + ${project.version} + + + + \ No newline at end of file diff --git a/hawkbit-starters/hawkbit-boot-starter-mgmt-api/README.md b/hawkbit-starters/hawkbit-boot-starter-mgmt-api/README.md index 2202eef70..701ab8589 100644 --- a/hawkbit-starters/hawkbit-boot-starter-mgmt-api/README.md +++ b/hawkbit-starters/hawkbit-boot-starter-mgmt-api/README.md @@ -1 +1,2 @@ -[Spring Boot Starter](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) for the [Management API](https://www.eclipse.org/hawkbit/documentation/interfaces/management-api.html). \ No newline at end of file +[Spring Boot Starter](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) for +the [Management API](https://www.eclipse.org/hawkbit/documentation/interfaces/management-api.html). \ No newline at end of file diff --git a/hawkbit-starters/hawkbit-boot-starter-mgmt-api/pom.xml b/hawkbit-starters/hawkbit-boot-starter-mgmt-api/pom.xml index 65a422443..8b04c554d 100644 --- a/hawkbit-starters/hawkbit-boot-starter-mgmt-api/pom.xml +++ b/hawkbit-starters/hawkbit-boot-starter-mgmt-api/pom.xml @@ -9,68 +9,69 @@ SPDX-License-Identifier: EPL-2.0 --> - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-starters - ${revision} - - hawkbit-boot-starter-mgmt-api - hawkBit :: Spring Boot Starter Management API - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter - - - org.springframework.security - spring-security-web - - - org.springframework.security - spring-security-config - - - org.springframework.security - spring-security-aspects - - + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-starters + ${revision} + + hawkbit-boot-starter-mgmt-api + hawkBit :: Spring Boot Starter Management API - - - org.eclipse.hawkbit - hawkbit-mgmt-resource - ${project.version} - - - org.eclipse.hawkbit - hawkbit-security-integration - ${project.version} - - - org.eclipse.hawkbit - hawkbit-http-security - ${project.version} - - - org.eclipse.hawkbit - hawkbit-repository-jpa - ${project.version} - - - org.eclipse.hawkbit - hawkbit-autoconfigure - ${project.version} - - + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter + + + org.springframework.security + spring-security-web + + + org.springframework.security + spring-security-config + + + org.springframework.security + spring-security-aspects + + + + + + org.eclipse.hawkbit + hawkbit-mgmt-resource + ${project.version} + + + org.eclipse.hawkbit + hawkbit-security-integration + ${project.version} + + + org.eclipse.hawkbit + hawkbit-http-security + ${project.version} + + + org.eclipse.hawkbit + hawkbit-repository-jpa + ${project.version} + + + org.eclipse.hawkbit + hawkbit-autoconfigure + ${project.version} + + + + - - \ No newline at end of file diff --git a/hawkbit-starters/hawkbit-boot-starter/README.MD b/hawkbit-starters/hawkbit-boot-starter/README.MD index aa57f584a..a1ba4b0ff 100644 --- a/hawkbit-starters/hawkbit-boot-starter/README.MD +++ b/hawkbit-starters/hawkbit-boot-starter/README.MD @@ -1,4 +1,5 @@ -[Spring Boot Starter](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) including all four interfaces: +[Spring Boot Starter](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-starter) including +all four interfaces: * [Management API](https://www.eclipse.org/hawkbit/documentation/interfaces/management-api.html) * [Direct Device Integration API](https://www.eclipse.org/hawkbit/documentation/interfaces/ddi-api.html) diff --git a/hawkbit-starters/hawkbit-boot-starter/pom.xml b/hawkbit-starters/hawkbit-boot-starter/pom.xml index 66c12f9d1..4a62b5f58 100644 --- a/hawkbit-starters/hawkbit-boot-starter/pom.xml +++ b/hawkbit-starters/hawkbit-boot-starter/pom.xml @@ -9,33 +9,33 @@ SPDX-License-Identifier: EPL-2.0 --> - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-starters - ${revision} - - hawkbit-boot-starter - hawkBit :: Spring Boot Starter - Complete starter, including auto-configuration, logging and all hawkBit interfaces + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-starters + ${revision} + + hawkbit-boot-starter + hawkBit :: Spring Boot Starter + Complete starter, including auto-configuration, logging and all hawkBit interfaces - - - org.eclipse.hawkbit - hawkbit-boot-starter-ddi-api - ${project.version} - - - org.eclipse.hawkbit - hawkbit-boot-starter-dmf-api - ${project.version} - - - org.eclipse.hawkbit - hawkbit-boot-starter-mgmt-api - ${project.version} - - + + + org.eclipse.hawkbit + hawkbit-boot-starter-ddi-api + ${project.version} + + + org.eclipse.hawkbit + hawkbit-boot-starter-dmf-api + ${project.version} + + + org.eclipse.hawkbit + hawkbit-boot-starter-mgmt-api + ${project.version} + + \ No newline at end of file diff --git a/hawkbit-starters/pom.xml b/hawkbit-starters/pom.xml index 45e7ef304..e7decc60b 100644 --- a/hawkbit-starters/pom.xml +++ b/hawkbit-starters/pom.xml @@ -9,21 +9,21 @@ SPDX-License-Identifier: EPL-2.0 --> - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-parent - ${revision} - - hawkbit-starters - hawkBit :: Spring Boot Starters - pom - - hawkbit-boot-starter - hawkbit-boot-starter-mgmt-api - hawkbit-boot-starter-ddi-api - hawkbit-boot-starter-dmf-api - + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-parent + ${revision} + + hawkbit-starters + hawkBit :: Spring Boot Starters + pom + + hawkbit-boot-starter + hawkbit-boot-starter-mgmt-api + hawkbit-boot-starter-ddi-api + hawkbit-boot-starter-dmf-api + \ No newline at end of file diff --git a/hawkbit-test-report/pom.xml b/hawkbit-test-report/pom.xml index 7d6e27d8a..4af2916cc 100644 --- a/hawkbit-test-report/pom.xml +++ b/hawkbit-test-report/pom.xml @@ -9,185 +9,185 @@ SPDX-License-Identifier: EPL-2.0 --> - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-parent - ${revision} - - hawkbit-test-report - hawkBit :: Test Report + 4.0.0 + + org.eclipse.hawkbit + hawkbit-parent + ${revision} + + hawkbit-test-report + hawkBit :: Test Report - - - org.eclipse.hawkbit - hawkbit-core - ${project.version} - - - org.eclipse.hawkbit - hawkbit-security-core - ${project.version} - - - org.eclipse.hawkbit - hawkbit-security-integration - ${project.version} - - - org.eclipse.hawkbit - hawkbit-http-security - ${project.version} - - - org.eclipse.hawkbit - hawkbit-repository-api - ${project.version} - - - org.eclipse.hawkbit - hawkbit-repository-core - ${project.version} - - - org.eclipse.hawkbit - hawkbit-repository-jpa - ${project.version} - - - org.eclipse.hawkbit - hawkbit-artifact-repository-filesystem - ${project.version} - - - org.eclipse.hawkbit - hawkbit-autoconfigure - ${project.version} - - - org.eclipse.hawkbit - hawkbit-ddi-api - ${project.version} - - - org.eclipse.hawkbit - hawkbit-ddi-resource - ${project.version} - - - org.eclipse.hawkbit - hawkbit-mgmt-api - ${project.version} - - - org.eclipse.hawkbit - hawkbit-mgmt-resource - ${project.version} - - - org.eclipse.hawkbit - hawkbit-rest-core - ${project.version} - - - org.eclipse.hawkbit - hawkbit-dmf-amqp - ${project.version} - - - org.eclipse.hawkbit - hawkbit-dmf-api - ${project.version} - - - org.eclipse.hawkbit - hawkbit-update-server - ${project.version} - - + + + org.eclipse.hawkbit + hawkbit-core + ${project.version} + + + org.eclipse.hawkbit + hawkbit-security-core + ${project.version} + + + org.eclipse.hawkbit + hawkbit-security-integration + ${project.version} + + + org.eclipse.hawkbit + hawkbit-http-security + ${project.version} + + + org.eclipse.hawkbit + hawkbit-repository-api + ${project.version} + + + org.eclipse.hawkbit + hawkbit-repository-core + ${project.version} + + + org.eclipse.hawkbit + hawkbit-repository-jpa + ${project.version} + + + org.eclipse.hawkbit + hawkbit-artifact-repository-filesystem + ${project.version} + + + org.eclipse.hawkbit + hawkbit-autoconfigure + ${project.version} + + + org.eclipse.hawkbit + hawkbit-ddi-api + ${project.version} + + + org.eclipse.hawkbit + hawkbit-ddi-resource + ${project.version} + + + org.eclipse.hawkbit + hawkbit-mgmt-api + ${project.version} + + + org.eclipse.hawkbit + hawkbit-mgmt-resource + ${project.version} + + + org.eclipse.hawkbit + hawkbit-rest-core + ${project.version} + + + org.eclipse.hawkbit + hawkbit-dmf-amqp + ${project.version} + + + org.eclipse.hawkbit + hawkbit-dmf-api + ${project.version} + + + org.eclipse.hawkbit + hawkbit-update-server + ${project.version} + + - - + + - - org.jacoco - jacoco-maven-plugin - - - aggregate-reports - verify - - report-aggregate - - - ${jacoco.outputDir}/jacoco-aggregate - - - - - - - - - - - generateTestReport - - - - maven-resources-plugin - - - copy-resources + + org.jacoco + jacoco-maven-plugin + + + aggregate-reports verify - copy-resources + report-aggregate - ${basedir}/target/allure-results - - - ${basedir}/.. - false - - **/target/allure-results/*.json - - - - ${basedir} - false - - placeholder.txt - - - + ${jacoco.outputDir}/jacoco-aggregate - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - src/main/resources/assemblies/test-report.xml - - true - - - - create-report-zip-assembly - verify - - single - - - - - - - - + + + + + + + + + + generateTestReport + + + + maven-resources-plugin + + + copy-resources + verify + + copy-resources + + + ${basedir}/target/allure-results + + + ${basedir}/.. + false + + **/target/allure-results/*.json + + + + ${basedir} + false + + placeholder.txt + + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + src/main/resources/assemblies/test-report.xml + + true + + + + create-report-zip-assembly + verify + + single + + + + + + + + diff --git a/hawkbit-test-report/src/main/resources/assemblies/test-report.xml b/hawkbit-test-report/src/main/resources/assemblies/test-report.xml index 974d6b6d1..1f8f96370 100644 --- a/hawkbit-test-report/src/main/resources/assemblies/test-report.xml +++ b/hawkbit-test-report/src/main/resources/assemblies/test-report.xml @@ -9,18 +9,19 @@ SPDX-License-Identifier: EPL-2.0 --> - - testReport - / - false - - zip - - - - ${project.build.directory}/allure-results - / - - + + testReport + / + false + + zip + + + + ${project.build.directory}/allure-results + / + + diff --git a/intellij_codeformatter.xml b/intellij_codeformatter.xml index bc9c7bdb1..dbbcabc9e 100644 --- a/intellij_codeformatter.xml +++ b/intellij_codeformatter.xml @@ -1,421 +1,421 @@ - \ No newline at end of file diff --git a/pom.xml b/pom.xml index c7174fc36..0f3898264 100644 --- a/pom.xml +++ b/pom.xml @@ -9,795 +9,797 @@ SPDX-License-Identifier: EPL-2.0 --> - - 4.0.0 + 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 3.3.5 - + + org.springframework.boot + spring-boot-starter-parent + 3.3.5 + - org.eclipse.hawkbit - hawkbit-parent - ${revision} - pom - hawkBit :: Parent + org.eclipse.hawkbit + hawkbit-parent + ${revision} + pom + hawkBit :: Parent - - - EPL-2.0 - https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt - Eclipse Public License - Version 2.0 - - + + + EPL-2.0 + https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt + Eclipse Public License - Version 2.0 + + - - 0-SNAPSHOT - 17 + + 0-SNAPSHOT + 17 - true + true - 3.3.5 - 2023.0.2 - 2.6.0 - 3.0.0 - - - + 3.3.5 + 2023.0.2 + 2.6.0 + 3.0.0 + + + - - - 4.0.3 - - 3.0.1 - + + + 4.0.3 + + 3.0.1 + - - 9.2.1 - 1.18.1 - 2.3.1 - 3.0.0 - 2.1.0 - 2.16.1 - 4.4 - 1.8.0 - - 5.2.0 - 4.8.174 - 2.28.1 - 4.2.1 - + + 9.2.1 + 1.18.1 + 2.3.1 + 3.0.0 + 2.1.0 + 2.16.1 + 4.4 + 1.8.0 + + 5.2.0 + 4.8.174 + 2.28.1 + 4.2.1 + - - 3.5.0 - 1.6.0 - 2.1.0 - 3.12.1 + + 3.5.0 + 1.6.0 + 2.1.0 + 3.12.1 - 1.1.0 - 4.5 + 1.1.0 + 4.5 - 3.3.1 - 3.3.1 - 0.8.12 + 3.3.1 + 3.3.1 + 0.8.12 - 1.7.0 - 3.2.4 - + 1.7.0 + 3.2.4 + - - scm:git:git@github.com:eclipse/hawkbit.git - scm:git:https://github.com/eclipse-hawkbit/hawkbit.git - https://github.com/eclipse-hawkbit/hawkbit.git - + + scm:git:git@github.com:eclipse/hawkbit.git + scm:git:https://github.com/eclipse-hawkbit/hawkbit.git + + https://github.com/eclipse-hawkbit/hawkbit.git + - - https://sonarcloud.io - LOCAL_SCAN - true - 600 - https://www.eclipse.org/hawkbit - https://github.com/eclipse-hawkbit/hawkbit/actions - - **/target/generated-sources/apt/**,**/src/test/**,**/src/main/java/org/eclipse/hawkbit/repository/test/** - - - **/src/main/java/org/eclipse/hawkbit/ui/**,**/target/generated-sources/apt/**,**/src/main/java/org/eclipse/hawkbit/repository/test/**,**/examples/** - - ${project.build.directory} - - ${project.basedir}/../hawkbit-test-report/target/jacoco-aggregate/jacoco.xml, - ${project.basedir}/../../hawkbit-test-report/target/jacoco-aggregate/jacoco.xml - - + + https://sonarcloud.io + LOCAL_SCAN + true + 600 + https://www.eclipse.org/hawkbit + https://github.com/eclipse-hawkbit/hawkbit/actions + + **/target/generated-sources/apt/**,**/src/test/**,**/src/main/java/org/eclipse/hawkbit/repository/test/** + + + **/src/main/java/org/eclipse/hawkbit/ui/**,**/target/generated-sources/apt/**,**/src/main/java/org/eclipse/hawkbit/repository/test/**,**/examples/** + + ${project.build.directory} + + ${project.basedir}/../hawkbit-test-report/target/jacoco-aggregate/jacoco.xml, + ${project.basedir}/../../hawkbit-test-report/target/jacoco-aggregate/jacoco.xml + + - - true - true - iot.hawkbit - ${project.build.directory}/dash/summary - - ${project.build.directory}/dash/review-summary - org.eclipse,org.junit - + + true + true + iot.hawkbit + ${project.build.directory}/dash/summary + + ${project.build.directory}/dash/review-summary + org.eclipse,org.junit + - - 1 - - - + + 1 + + + - - hawkbit-core - hawkbit-security-core - hawkbit-security-integration - hawkbit-http-security - hawkbit-repository - hawkbit-artifact-repository-filesystem - hawkbit-autoconfigure - hawkbit-rest - hawkbit-dmf - hawkbit-test-report - hawkbit-runtime - hawkbit-starters - hawkbit-sdk - + + hawkbit-core + hawkbit-security-core + hawkbit-security-integration + hawkbit-http-security + hawkbit-repository + hawkbit-artifact-repository-filesystem + hawkbit-autoconfigure + hawkbit-rest + hawkbit-dmf + hawkbit-test-report + hawkbit-runtime + hawkbit-starters + hawkbit-sdk + - - ${release.scm.connection} - ${release.scm.developerConnection} - ${release.scm.url} - + + ${release.scm.connection} + ${release.scm.developerConnection} + ${release.scm.url} + - - Jenkins - https://hudson.eclipse.org/hawkbit/ - + + Jenkins + https://hudson.eclipse.org/hawkbit/ + - - - kaizimmerm - kai.zimmermann@microsoft.com - Microsoft - https://www.microsoft.com - - Lead - Committer - - - - laverman - Jeroen.Laverman@bosch.io - Bosch.IO GmbH - https://www.bosch.io - - Lead - Committer - - - - michahirsch - - Committer - - - - schabdo - Dominic.Schabel@bosch.io - Bosch.IO GmbH - https://www.bosch.io - - Committer - - - - stefbehl - Stefan.Behl@bosch.io - Bosch.IO GmbH - https://www.bosch.io - - Committer - - - - avgustinmm - Avgustin.Marinov@bosch.com - Bosch Digital - https://www.bosch-digital.com/ - - Committer - - - + + + kaizimmerm + kai.zimmermann@microsoft.com + Microsoft + https://www.microsoft.com + + Lead + Committer + + + + laverman + Jeroen.Laverman@bosch.io + Bosch.IO GmbH + https://www.bosch.io + + Lead + Committer + + + + michahirsch + + Committer + + + + schabdo + Dominic.Schabel@bosch.io + Bosch.IO GmbH + https://www.bosch.io + + Committer + + + + stefbehl + Stefan.Behl@bosch.io + Bosch.IO GmbH + https://www.bosch.io + + Committer + + + + avgustinmm + Avgustin.Marinov@bosch.com + Bosch Digital + https://www.bosch-digital.com/ + + Committer + + + - - - ossrh - hawkBit Repository - Release - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - - ossrh - hawkBit Repository - Snapshots - https://oss.sonatype.org/content/repositories/snapshots - - + + + ossrh + hawkBit Repository - Release + https://oss.sonatype.org/service/local/staging/deploy/maven2 + + + ossrh + hawkBit Repository - Snapshots + https://oss.sonatype.org/content/repositories/snapshots + + - - - dash-licenses - https://repo.eclipse.org/content/repositories/dash-licenses - - + + + dash-licenses + https://repo.eclipse.org/content/repositories/dash-licenses + + - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-enforcer-plugin - - - org.codehaus.mojo - flatten-maven-plugin - - - org.apache.maven.plugins - maven-scm-plugin - - - org.codehaus.mojo - versions-maven-plugin - - - - com.mycila - license-maven-plugin - - - org.eclipse.dash - license-tool-plugin - - - - org.jacoco - jacoco-maven-plugin - - - - - + + - org.apache.maven.plugins - maven-compiler-plugin - - -Xlint:all - true - true - + org.apache.maven.plugins + maven-compiler-plugin - org.apache.maven.plugins - maven-javadoc-plugin - - syntax - + org.apache.maven.plugins + maven-source-plugin - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - + org.apache.maven.plugins + maven-enforcer-plugin + + + org.codehaus.mojo + flatten-maven-plugin + + + org.apache.maven.plugins + maven-scm-plugin + + + org.codehaus.mojo + versions-maven-plugin - org.apache.maven.plugins - maven-enforcer-plugin - ${maven.enforcer.plugin.version} - - - - enforce-no-snapshots - - enforce - - - ${snapshotDependencyAllowed} - - - No Snapshots Allowed! - - - No Snapshots Allowed! - - - 3.9 - - - - - + com.mycila + license-maven-plugin - org.codehaus.mojo - flatten-maven-plugin - ${flatten.maven.plugin.version} - - resolveCiFriendliesOnly - true - - - - flatten - process-resources - - flatten - - - - flatten.clean - clean - - clean - - - - - - org.apache.maven.plugins - maven-scm-plugin - ${maven.scm.plugin.version} - - ${project.version} - - - - org.apache.maven.plugins - maven-site-plugin - ${maven.site.plugin.version} - - true - true - + org.eclipse.dash + license-tool-plugin - com.mycila - license-maven-plugin - ${license.maven.plugin.version} - - - -
licenses/LICENSE_HEADER_TEMPLATE.txt
- - licenses/LICENSE_HEADER_TEMPLATE_CONTRIBUTORS_23.txt - licenses/LICENSE_HEADER_TEMPLATE_SIEMENS.txt - licenses/LICENSE_HEADER_TEMPLATE_SIEMENS_18.txt - licenses/LICENSE_HEADER_TEMPLATE_BOSCH_15.txt - licenses/LICENSE_HEADER_TEMPLATE_BOSCH_18.txt - licenses/LICENSE_HEADER_TEMPLATE_BOSCH_19.txt - licenses/LICENSE_HEADER_TEMPLATE_BOSCH_20.txt - licenses/LICENSE_HEADER_TEMPLATE_BOSCH_21.txt - licenses/LICENSE_HEADER_TEMPLATE_BOSCH_22.txt - licenses/LICENSE_HEADER_TEMPLATE_BOSCH_23.txt - licenses/LICENSE_HEADER_TEMPLATE_MICROSOFT_18.txt - licenses/LICENSE_HEADER_TEMPLATE_MICROSOFT_20.txt - licenses/LICENSE_HEADER_TEMPLATE_DEVOLO_19.txt - licenses/LICENSE_HEADER_TEMPLATE_DEVOLO_20.txt - licenses/LICENSE_HEADER_TEMPLATE_KIWIGRID_19.txt - licenses/LICENSE_HEADER_TEMPLATE_ENAPTER.txt - + org.jacoco + jacoco-maven-plugin +
+
+ + + + + org.apache.maven.plugins + maven-compiler-plugin + + -Xlint:all + true + true + + + + org.apache.maven.plugins + maven-javadoc-plugin + + syntax + + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + + jar + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${maven.enforcer.plugin.version} + + + + enforce-no-snapshots + + enforce + + + ${snapshotDependencyAllowed} + + + No Snapshots Allowed! + + + No Snapshots Allowed! + + + 3.9 + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + ${flatten.maven.plugin.version} + + resolveCiFriendliesOnly + true + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + + + org.apache.maven.plugins + maven-scm-plugin + ${maven.scm.plugin.version} + + ${project.version} + + + + org.apache.maven.plugins + maven-site-plugin + ${maven.site.plugin.version} + + true + true + + + + + com.mycila + license-maven-plugin + ${license.maven.plugin.version} + + + +
licenses/LICENSE_HEADER_TEMPLATE.txt
+ + licenses/LICENSE_HEADER_TEMPLATE_CONTRIBUTORS_23.txt + licenses/LICENSE_HEADER_TEMPLATE_SIEMENS.txt + licenses/LICENSE_HEADER_TEMPLATE_SIEMENS_18.txt + licenses/LICENSE_HEADER_TEMPLATE_BOSCH_15.txt + licenses/LICENSE_HEADER_TEMPLATE_BOSCH_18.txt + licenses/LICENSE_HEADER_TEMPLATE_BOSCH_19.txt + licenses/LICENSE_HEADER_TEMPLATE_BOSCH_20.txt + licenses/LICENSE_HEADER_TEMPLATE_BOSCH_21.txt + licenses/LICENSE_HEADER_TEMPLATE_BOSCH_22.txt + licenses/LICENSE_HEADER_TEMPLATE_BOSCH_23.txt + licenses/LICENSE_HEADER_TEMPLATE_MICROSOFT_18.txt + licenses/LICENSE_HEADER_TEMPLATE_MICROSOFT_20.txt + licenses/LICENSE_HEADER_TEMPLATE_DEVOLO_19.txt + licenses/LICENSE_HEADER_TEMPLATE_DEVOLO_20.txt + licenses/LICENSE_HEADER_TEMPLATE_KIWIGRID_19.txt + licenses/LICENSE_HEADER_TEMPLATE_ENAPTER.txt + + + .3rd-party/** + .azure-pipelines/* + .devcontainer/* + .git* + .github/** + .sonar + licenses/LICENSE* + eclipse_codeformatter.xml + intellij_codeformatter.xml + **/banner.txt + **/helm/** + **/README + **/.git* + **/*.sql + **/docker/** + **/.sonar/** + **/frontend/** + site/content/** + site/layouts/** + site/static/** + site/*.toml + **/spring.factories + +
+
+ + JAVADOC_STYLE + JAVADOC_STYLE + +
+
+ + org.eclipse.dash + license-tool-plugin + ${license.tool.plugin.version} + + + license-check + + license-check + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + + + ${project.build.directory}/allure-results + + + 650 + + + false + true + ${surefire.forkcount} + ${jacoco.agent.ut.arg} ${test.jvm.args} + + + listener + io.qameta.allure.junit5.AllureJunit5 + + + + **/*Tests.java + **/*Test.java + **/*IT.java + - .3rd-party/** - .azure-pipelines/* - .devcontainer/* - .git* - .github/** - .sonar - licenses/LICENSE* - eclipse_codeformatter.xml - intellij_codeformatter.xml - **/banner.txt - **/helm/** - **/README - **/.git* - **/*.sql - **/docker/** - **/.sonar/** - **/frontend/** - site/content/** - site/layouts/** - site/static/** - site/*.toml - **/spring.factories + **/Abstract*.java - - - - JAVADOC_STYLE - JAVADOC_STYLE - - - - - org.eclipse.dash - license-tool-plugin - ${license.tool.plugin.version} - - - license-check - - license-check - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven.surefire.plugin.version} - - - - ${project.build.directory}/allure-results - - 650 - - - false - true - ${surefire.forkcount} - ${jacoco.agent.ut.arg} ${test.jvm.args} - - - listener - io.qameta.allure.junit5.AllureJunit5 - - - - **/*Tests.java - **/*Test.java - **/*IT.java - - - **/Abstract*.java - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${maven.failsafe.plugin.version} - - false - ${surefire.forkcount} - -Xmx1024m ${jacoco.agent.ut.arg} - - - listener - io.qameta.allure.junit5.AllureJunit5 - - - - - - integration-test - integration-test - - integration-test - - - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.maven.plugin.version} - - - prepare-ut-agent - process-test-classes - - prepare-agent - - - jacoco.agent.ut.arg - - - - prepare-it-agent - pre-integration-test - - prepare-agent-integration - - - jacoco.agent.it.arg - - - - - - com.ethlo.persistence.tools - eclipselink-maven-plugin - ${eclipselink.maven.plugin.version} - -
-
-
- - - - nexus_staging - - - !skipNexusStaging - - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - ${nexus.staging.maven.plugin.version} - true - - ossrh - https://oss.sonatype.org/ - false - - + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven.failsafe.plugin.version} + + false + ${surefire.forkcount} + -Xmx1024m ${jacoco.agent.ut.arg} + + + listener + io.qameta.allure.junit5.AllureJunit5 + + + + + + integration-test + integration-test + + integration-test + + + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.maven.plugin.version} + + + prepare-ut-agent + process-test-classes + + prepare-agent + + + jacoco.agent.ut.arg + + + + prepare-it-agent + pre-integration-test + + prepare-agent-integration + + + jacoco.agent.it.arg + + + + + + com.ethlo.persistence.tools + eclipselink-maven-plugin + ${eclipselink.maven.plugin.version} + - - - - - create_gpg_signature - - false - - createGPGSignature - - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${maven.gpg.plugin.version} - - - sign-artifacts - verify - - sign - +
+
+ + + + nexus_staging + + + !skipNexusStaging + + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + ${nexus.staging.maven.plugin.version} + true - - --pinentry-mode - loopback - + ossrh + https://oss.sonatype.org/ + false - - - - - - - + + + + + + + create_gpg_signature + + false + + createGPGSignature + + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven.gpg.plugin.version} + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + + + - - - - - com.rabbitmq - http-client - ${rabbitmq.http-client.version} - - - com.cronutils - cron-utils - ${cron-utils.version} - - - org.jsoup - jsoup - ${jsoup.version} - - - javax.el - javax.el-api - ${javax.el-api.version} - - - javax.xml.bind - jaxb-api - ${jaxb-api.version} - + + + + + com.rabbitmq + http-client + ${rabbitmq.http-client.version} + + + com.cronutils + cron-utils + ${cron-utils.version} + + + org.jsoup + jsoup + ${jsoup.version} + + + javax.el + javax.el-api + ${javax.el-api.version} + + + javax.xml.bind + jaxb-api + ${jaxb-api.version} + - - - org.springframework.cloud - spring-cloud-dependencies - ${spring.cloud.version} - pom - import - - - org.springframework.boot - spring-boot-starter-web - ${spring.boot.version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jdk8 - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - com.fasterxml.jackson.module - jackson-module-parameter-names - - - - - org.springframework.boot - spring-boot-starter-tomcat - ${spring.boot.version} - provided - - - org.springframework.boot - spring-boot-starter - ${spring.boot.version} - - - org.apache.logging.log4j - log4j-to-slf4j - - - - - org.springframework.boot - spring-boot-starter-data-jpa - ${spring.boot.version} - - - org.hibernate - hibernate-entitymanager - - - org.hibernate - hibernate-core - - - org.springframework.boot - spring-boot-starter-logging - - - javax.xml.bind - jaxb-api - - - - - org.springframework.boot - spring-boot-starter-test - ${spring.boot.version} - - - org.eclipse.persistence - org.eclipse.persistence.jpa - ${eclipselink.version} - - - org.springframework.plugin - spring-plugin-core - ${spring.plugin.core.version} - + + + org.springframework.cloud + spring-cloud-dependencies + ${spring.cloud.version} + pom + import + + + org.springframework.boot + spring-boot-starter-web + ${spring.boot.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jdk8 + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + com.fasterxml.jackson.module + jackson-module-parameter-names + + + + + org.springframework.boot + spring-boot-starter-tomcat + ${spring.boot.version} + provided + + + org.springframework.boot + spring-boot-starter + ${spring.boot.version} + + + org.apache.logging.log4j + log4j-to-slf4j + + + + + org.springframework.boot + spring-boot-starter-data-jpa + ${spring.boot.version} + + + org.hibernate + hibernate-entitymanager + + + org.hibernate + hibernate-core + + + org.springframework.boot + spring-boot-starter-logging + + + javax.xml.bind + jaxb-api + + + + + org.springframework.boot + spring-boot-starter-test + ${spring.boot.version} + + + org.eclipse.persistence + org.eclipse.persistence.jpa + ${eclipselink.version} + + + org.springframework.plugin + spring-plugin-core + ${spring.plugin.core.version} + - - org.springdoc - springdoc-openapi-starter-webmvc-ui - ${springdoc-openapi.version} - + + org.springdoc + springdoc-openapi-starter-webmvc-ui + ${springdoc-openapi.version} + - - - io.protostuff - protostuff-core - ${io-protostuff.version} - - - io.protostuff - protostuff-runtime - ${io-protostuff.version} - + + + io.protostuff + protostuff-core + ${io-protostuff.version} + + + io.protostuff + protostuff-runtime + ${io-protostuff.version} + - - - cz.jirutka.rsql - rsql-parser - ${rsql-parser.version} - - - commons-io - commons-io - ${commons-io.version} - - - org.apache.commons - commons-collections4 - ${commons-collections4.version} - + + + cz.jirutka.rsql + rsql-parser + ${rsql-parser.version} + + + commons-io + commons-io + ${commons-io.version} + + + org.apache.commons + commons-collections4 + ${commons-collections4.version} + - - - io.github.classgraph - classgraph - ${classgraph.version} - test - - - org.springframework.amqp - spring-rabbit-junit - ${spring-amqp.version} - test - - - org.springframework.amqp - spring-rabbit-test - ${spring-amqp.version} - test - - - io.qameta.allure - allure-junit5 - ${allure.version} - test - - - org.awaitility - awaitility - ${awaitility.version} - - - + + + io.github.classgraph + classgraph + ${classgraph.version} + test + + + org.springframework.amqp + spring-rabbit-junit + ${spring-amqp.version} + test + + + org.springframework.amqp + spring-rabbit-test + ${spring-amqp.version} + test + + + io.qameta.allure + allure-junit5 + ${allure.version} + test + + + org.awaitility + awaitility + ${awaitility.version} + + + - - - org.projectlombok - lombok - true - - + + + org.projectlombok + lombok + true + +
diff --git a/site/README.md b/site/README.md index 21dda6a65..7585152ed 100644 --- a/site/README.md +++ b/site/README.md @@ -1,15 +1,22 @@ # Eclipse hawkBit Documentation -The hawkBit documentation is built with [Hugo](https://www.gohugo.io/) using the [Material](http://github.com/digitalcraftsman/hugo-material-docs) + +The hawkBit documentation is built with [Hugo](https://www.gohugo.io/) using +the [Material](http://github.com/digitalcraftsman/hugo-material-docs) theme. Compiling the documentation is not included within the regular Maven build. ## Prerequisites -1. **Install Hugo**: see [installing Hugo](https://gohugo.io/getting-started/installing/) documentation on how to install Hugo. -2. **Install NODE.js and npm** see [installing Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) documentation on how to install Node.js and npm -3. **Install Redocly CLI** see [installing Redocly CLI](https://redocly.com/docs/cli/installation/) documentation on how to install Redocly CLI + +1. **Install Hugo**: see [installing Hugo](https://gohugo.io/getting-started/installing/) documentation on how to + install Hugo. +2. **Install NODE.js and npm** + see [installing Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) documentation on + how to install Node.js and npm +3. **Install Redocly CLI** see [installing Redocly CLI](https://redocly.com/docs/cli/installation/) documentation on how + to install Redocly CLI 4. **Install hawkBit**: run `mvn install` in the parent directory to generate the latest REST docs for hawkBit. - ## Build and Serve documentation + The following Maven targets are available in order to build and serve the documentation: * `mvn install`: _i._ Copies the generated REST docs to `content/rest-api/` and _ii._ downloads the required Hugo theme @@ -19,6 +26,7 @@ The following Maven targets are available in order to build and serve the docume * `mvn clean`: Delete generated artifacts (REST docs, Hugo theme) ## Generate /public folder + In order to generate the `/public` folder, which can be put on a web-server, run the following command: ```bash diff --git a/site/config.toml b/site/config.toml index 8b7303789..c7b693e14 100755 --- a/site/config.toml +++ b/site/config.toml @@ -16,95 +16,95 @@ metadataformat = "toml" canonifyurls = false [markup] - [markup.goldmark] - [markup.goldmark.extensions] - typographer = true - [markup.goldmark.renderer] - unsafe = true +[markup.goldmark] +[markup.goldmark.extensions] +typographer = true +[markup.goldmark.renderer] +unsafe = true [markup.highlight] - codeFences = false +codeFences = false [params] - # General information - author = "The Eclipse hawkBit Project" - description = "IoT. Update. Device." - copyright = "The Eclipse hawkBit Project" - logo = "images/hawkbit_icon.png" - favicon = "images/favicon.ico" +# General information +author = "The Eclipse hawkBit Project" +description = "IoT. Update. Device." +copyright = "The Eclipse hawkBit Project" +logo = "images/hawkbit_icon.png" +favicon = "images/favicon.ico" - # Repository - provider = "GitHub" - repo_url = "https://github.com/eclipse-hawkbit/hawkbit" +# Repository +provider = "GitHub" +repo_url = "https://github.com/eclipse-hawkbit/hawkbit" - permalink = "#" +permalink = "#" - # Custom assets - custom_css = ["css/hawkbit.css","//www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/vendor/cookieconsent/cookieconsent.min.css"] - custom_js = [] +# Custom assets +custom_css = ["css/hawkbit.css", "//www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/vendor/cookieconsent/cookieconsent.min.css"] +custom_js = [] - # Syntax highlighting theme - highlight_css = "" +# Syntax highlighting theme +highlight_css = "" [params.palette] - primary = "deep-purple" - accent = "light-green" +primary = "deep-purple" +accent = "light-green" [params.font] - text = "Ubuntu" - code = "Ubuntu Mono" +text = "Ubuntu" +code = "Ubuntu Mono" [social] - github = "eclipse/hawkbit" - gitter = "eclipse/hawkbit" - docker = "hawkbit" +github = "eclipse/hawkbit" +gitter = "eclipse/hawkbit" +docker = "hawkbit" [[menu.main]] - name = "What is hawkBit" - url = "/whatishawkbit/" - weight = 10 +name = "What is hawkBit" +url = "/whatishawkbit/" +weight = 10 [[menu.main]] - name = "Getting started" - url = "/gettingstarted/" - weight = 20 +name = "Getting started" +url = "/gettingstarted/" +weight = 20 [[menu.main]] - name = "Guides" - url = "/guides/" - weight = 30 +name = "Guides" +url = "/guides/" +weight = 30 [[menu.main]] - name = "Features" - url = "/features/" - weight = 40 +name = "Features" +url = "/features/" +weight = 40 [[menu.main]] - name = "Concepts" - url = "/concepts/" - weight = 50 +name = "Concepts" +url = "/concepts/" +weight = 50 [[menu.main]] - name = "Architecture" - url = "/architecture/" - weight = 60 +name = "Architecture" +url = "/architecture/" +weight = 60 [[menu.main]] - name = "APIs" - url = "/apis/" - weight = 80 +name = "APIs" +url = "/apis/" +weight = 80 [[menu.main]] - name = "Release notes" - url = "/release-notes/" - weight = 90 +name = "Release notes" +url = "/release-notes/" +weight = 90 [[menu.main]] - name = "Blog" - url = "/blog/" - weight = 100 +name = "Blog" +url = "/blog/" +weight = 100 [[menu.main]] - name = "Community" - url = "/community/" - weight = 110 +name = "Community" +url = "/community/" +weight = 110 diff --git a/site/content/apis/ddi_api.md b/site/content/apis/ddi_api.md index 2865c76da..5037b7047 100644 --- a/site/content/apis/ddi_api.md +++ b/site/content/apis/ddi_api.md @@ -4,32 +4,39 @@ parent: APIs weight: 82 --- -The hawkBit [update server](https://github.com/eclipse-hawkbit/hawkbit) provides REST resources which are consumed by the device to retrieve software update tasks. +The hawkBit [update server](https://github.com/eclipse-hawkbit/hawkbit) provides REST resources which are consumed by +the device to retrieve software update tasks. This API is based on HTTP standards and a polling mechanism. {{% note %}} -In DDI the target is identified using a **controllerId**. Controller is used as a term for the actual service/client on the device. That allows users to have in some cases even multiple clients on the same target for different tasks, e.g. Firmware update and App management. +In DDI the target is identified using a **controllerId**. Controller is used as a term for the actual service/client on +the device. That allows users to have in some cases even multiple clients on the same target for different tasks, e.g. +Firmware update and App management. {{% /note %}} ## State Machine Mapping -For historical reasons the DDI has a different state machine and status messages than the [Target State Machine](../../concepts/targetstate/) of the hawkBit update server. +For historical reasons the DDI has a different state machine and status messages than +the [Target State Machine](../../concepts/targetstate/) of the hawkBit update server. -This is kept in order to ensure that _DDI_ stays compatible for devices out there in the field. A future version "2" of _DDI_ might change that. _DDI_ also defines more states than the update server, e.g. multiple DDI states are currently mapped by the _DDI_ implementation to _RUNNING_ state. It is possible that in the future hawkBit will fully leverage these additional states. +This is kept in order to ensure that _DDI_ stays compatible for devices out there in the field. A future version "2" of +_DDI_ might change that. _DDI_ also defines more states than the update server, e.g. multiple DDI states are currently +mapped by the _DDI_ implementation to _RUNNING_ state. It is possible that in the future hawkBit will fully leverage +these additional states. The _DDI_ API allows the device to provide the following feedback messages: -DDI `status.execution` type | handling by update server | Mapped ActionStatus type ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- -CANCELED | This is send by the target as confirmation of a cancellation request by the update server. | CANCELED -REJECTED | This is send by the target in case an update of a cancellation is rejected, i.e. cannot be fulfilled at this point in time. Note: the target should send a CLOSED->ERROR if it believes it will not be able to proceed the action at all. | WARNING -CLOSED | Target completes the action either with `status.result.finished` SUCCESS or FAILURE as result. Note: DDI defines also a status NONE which will not be interpreted by the update server and handled like SUCCESS. | ERROR (DDI FAILURE) or FINISHED (DDI SUCCESS or NONE) -DOWNLOAD | This can be used by the target to inform that it is downloading artifacts of the action. | DOWNLOAD -DOWNLOADED | This can be used by the target to inform that it has downloaded artifacts of the action. | DOWNLOADED -PROCEEDING | This can be used by the target to inform that it is working on the action. | RUNNING -SCHEDULED | This can be used by the target to inform that it scheduled on the action. | RUNNING -RESUMED | This can be used by the target to inform that it continued to work on the action. | RUNNING + DDI `status.execution` type | handling by update server | Mapped ActionStatus type +-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------- + CANCELED | This is send by the target as confirmation of a cancellation request by the update server. | CANCELED + REJECTED | This is send by the target in case an update of a cancellation is rejected, i.e. cannot be fulfilled at this point in time. Note: the target should send a CLOSED->ERROR if it believes it will not be able to proceed the action at all. | WARNING + CLOSED | Target completes the action either with `status.result.finished` SUCCESS or FAILURE as result. Note: DDI defines also a status NONE which will not be interpreted by the update server and handled like SUCCESS. | ERROR (DDI FAILURE) or FINISHED (DDI SUCCESS or NONE) + DOWNLOAD | This can be used by the target to inform that it is downloading artifacts of the action. | DOWNLOAD + DOWNLOADED | This can be used by the target to inform that it has downloaded artifacts of the action. | DOWNLOADED + PROCEEDING | This can be used by the target to inform that it is working on the action. | RUNNING + SCHEDULED | This can be used by the target to inform that it scheduled on the action. | RUNNING + RESUMED | This can be used by the target to inform that it continued to work on the action. | RUNNING ## DDI APIs diff --git a/site/content/apis/dmf_api.md b/site/content/apis/dmf_api.md index 3c4d4ccf8..3237d2862 100644 --- a/site/content/apis/dmf_api.md +++ b/site/content/apis/dmf_api.md @@ -4,7 +4,8 @@ parent: API weight: 83 --- -The DMF API provides Java classes which allows that the message body can be deserialized at runtime into a Java object. Also Java classes can be used to serialize Java objects into JSON bodies to send a message to hawkBit. +The DMF API provides Java classes which allows that the message body can be deserialized at runtime into a Java object. +Also Java classes can be used to serialize Java objects into JSON bodies to send a message to hawkBit. Currently, bodies of messages are based on JSON. @@ -22,20 +23,22 @@ Bindings determine how messages get put in this place Queues can also be bound to multiple exchanges. **Exchanges** are just publish messages. -The user decides who can produce on an exchange and who can create bindings on that exchange for delivery to a specific queue. +The user decides who can produce on an exchange and who can create bindings on that exchange for delivery to a specific +queue. hawkBit will create all necessary queues, exchanges and bindings for the user, making it easy to get started. The exchange name for outgoing messages is **dmf.exchange**. -The user has to set a `reply_to` header (see chapter below), in order to specify the exchange to which hawkBit should reply to. +The user has to set a `reply_to` header (see chapter below), in order to specify the exchange to which hawkBit should +reply to. The following chapter describes the message body, header and properties. -Note: the DMF protocol was intended to be compatible to other use cases by design. As a result, DMF uses the term **thing** and not **target** but they are actually synonyms in this case. +Note: the DMF protocol was intended to be compatible to other use cases by design. As a result, DMF uses the term * +*thing** and not **target** but they are actually synonyms in this case. ## Messages sent to hawkBit (Client -> hawkBit) - ### THING_CREATED Message to register and update a provisioning target. @@ -76,9 +79,10 @@ Payload Template (optional): The "name" property specifies the name of the thing, which by default is the thing ID. This property is optional.

-The "type" property specifies name of a target type which should be assigned to the created/updated target. The +The "type" property specifies name of a target type which should be assigned to the created/updated target. The target type with the specified name should be created in advance, otherwise it can't be assigned to the target, resulting in: + * error is logged * if the target does not exist then it is created without any target type assigned * if it exists already then no changes to its target type assignment are made. @@ -87,8 +91,8 @@ If the "type" property is set to a blank string while updating an existing targe assignment is removed from the target. This property is optional and if omitted then no changes to the target type assignment are made.

-The "attributeUpdate" property provides the attributes of the thing, for details see UPDATE_ATTRIBUTES message. This property is optional. - +The "attributeUpdate" property provides the attributes of the thing, for details see UPDATE_ATTRIBUTES message. This +property is optional. ### THING_REMOVED @@ -112,7 +116,8 @@ Example headers ### UPDATE_ATTRIBUTES -Message to update target attributes. This message can be send in response to a REQUEST_ATTRIBUTES_UPDATE event, sent by hawkBit. +Message to update target attributes. This message can be send in response to a REQUEST_ATTRIBUTES_UPDATE event, sent by +hawkBit. | Header | Description | Type | Mandatory | |---------|----------------------------------|----------------------------------|-----------| @@ -121,9 +126,9 @@ Message to update target attributes. This message can be send in response to a R | thingId | The ID of the registered thing | String | true | | tenant | The tenant this thing belongs to | String | false | -| Message Properties | Description | Type | Mandatory | -|-----------------------------|----------------------------------|--------|-----------| -| content_type | The content type of the payload | String | true | +| Message Properties | Description | Type | Mandatory | +|--------------------|---------------------------------|--------|-----------| +| content_type | The content type of the payload | String | true | Example header and payload: @@ -143,7 +148,9 @@ Payload Template: } ``` -The "mode" property specifies the update mode that should be applied. This property is optional. Possible [mode](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfUpdateMode.java) values: +The "mode" property specifies the update mode that should be applied. This property is optional. +Possible [mode](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfUpdateMode.java) +values: | Value | Description | |---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -165,7 +172,8 @@ Message to send an action status event to hawkBit. |--------------------|---------------------------------|--------|-----------| | content_type | The content type of the payload | String | true | -Payload Template (the Java representation is [ActionUpdateStatus](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfActionUpdateStatus.java)): +Payload Template (the Java representation +is [ActionUpdateStatus](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfActionUpdateStatus.java)): ```json { @@ -176,7 +184,8 @@ Payload Template (the Java representation is [ActionUpdateStatus](https://github } ``` -Possible [actionStatus](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfActionStatus.java) values: +Possible [actionStatus](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfActionStatus.java) +values: | Value | Description | |-----------------|-----------------------------------------| @@ -207,7 +216,8 @@ Example header and payload: ### PING -hawkBit allows DMF clients to check the availability of the DMF service. For this scenario DMF specifies a PING message that can be sent by the client: +hawkBit allows DMF clients to check the availability of the DMF service. For this scenario DMF specifies a PING message +that can be sent by the client: | Header | Description | Type | Mandatory | |--------|--------------------------------|---------------------|-----------| @@ -255,7 +265,8 @@ Example Headers and Payload: } ``` -After sending this message, an action status event with either actionStatus=CANCELED or actionStatus=CANCEL_REJECTED has to be returned. +After sending this message, an action status event with either actionStatus=CANCELED or actionStatus=CANCEL_REJECTED has +to be returned. Example header and payload when cancellation is successful: @@ -287,10 +298,10 @@ Example header and payload when cancellation is rejected: } ``` - ### DOWNLOAD_AND_INSTALL or DOWNLOAD -Message sent by hawkBit to initialize an update or download task. Note: in case of a maintenance window configured but not yet active the message will have the topic _DOWNLOAD_ instead of _DOWNLOAD_AND_INSTALL_. +Message sent by hawkBit to initialize an update or download task. Note: in case of a maintenance window configured but +not yet active the message will have the topic _DOWNLOAD_ instead of _DOWNLOAD_AND_INSTALL_. | Header | Description | Type | Mandatory | |---------|------------------------------------------------|---------------------------------------------------|-----------| @@ -303,7 +314,8 @@ Message sent by hawkBit to initialize an update or download task. Note: in case |--------------------|---------------------------------|--------|-----------| | content_type | The content type of the payload | String | true | -Payload Template (the Java representation is [DmfDownloadAndUpdateRequest](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfDownloadAndUpdateRequest.java)): +Payload Template (the Java representation +is [DmfDownloadAndUpdateRequest](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfDownloadAndUpdateRequest.java)): ```json { @@ -375,13 +387,13 @@ Example header and payload: } ``` - ### MULTI_ACTION -If `multi.assignments.enabled` is enabled, this message is sent instead of DOWNLOAD_AND_INSTALL, DOWNLOAD, or CANCEL_DOWNLOAD - by hawkBit to initialize update, download, or cancel task(s). +If `multi.assignments.enabled` is enabled, this message is sent instead of DOWNLOAD_AND_INSTALL, DOWNLOAD, or +CANCEL_DOWNLOAD +by hawkBit to initialize update, download, or cancel task(s). - With weight, one can set the priority to the action. The higher the weight, the higher is the priority of an action. +With weight, one can set the priority to the action. The higher the weight, the higher is the priority of an action. | Header | Description | Type | Mandatory | |---------|------------------------------------------------|-----------------------------|-----------| @@ -394,7 +406,8 @@ If `multi.assignments.enabled` is enabled, this message is sent instead of DOWNL |--------------------|---------------------------------|--------|-----------| | content_type | The content type of the payload | String | true | -Payload Template (the Java representation is [DmfMultiActionRequest](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfMultiActionRequest.java)): +Payload Template (the Java representation +is [DmfMultiActionRequest](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-dmf/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/DmfMultiActionRequest.java)): ```json [{ @@ -540,7 +553,6 @@ Example header and payload: }] ``` - ### THING_DELETED Message sent by hawkBit when a target has been deleted. @@ -557,7 +569,6 @@ Example header: |--------------------------------------------------------------|-------------------| | type=THING\_DELETED
tenant=default
thingId=abc | | - ### REQUEST_ATTRIBUTES_UPDATE Message sent by Eclipse hawkBit when a re-transmission of target attributes is requested. @@ -575,10 +586,10 @@ Example headers: |----------------------------------------------------------------------------------------------|-------------------| | type=EVENT
tenant=default
thingId=abc
topic=REQUEST\_ATTRIBUTES\_UPDATE | | - ### PING_RESPONSE -_hawkBit_ will respond to the PING message with a PING_RESPONSE type message that has the same correlationId as the original PING message: +_hawkBit_ will respond to the PING message with a PING_RESPONSE type message that has the same correlationId as the +original PING message: | Header | Description | Type | Mandatory | |--------|--------------------------------|------------------------------|-----------| @@ -590,7 +601,8 @@ _hawkBit_ will respond to the PING message with a PING_RESPONSE type message tha | correlationId | CorrelationId of the original PING request | String | true | | content_type | The content type of the payload | String | true | -The PING_RESPONSE also contains a timestamp (i.e. the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC) as plain text. It is not guaranteed that this timestamp is completely accurate. +The PING_RESPONSE also contains a timestamp (i.e. the difference, measured in milliseconds, between the current time and +midnight, January 1, 1970 UTC) as plain text. It is not guaranteed that this timestamp is completely accurate. | Header | MessageProperties | |-------------------------------------------|-------------------------| diff --git a/site/content/apis/management_api.md b/site/content/apis/management_api.md index 5070b504c..cf0751778 100644 --- a/site/content/apis/management_api.md +++ b/site/content/apis/management_api.md @@ -4,16 +4,20 @@ parent: API weight: 81 --- -The Management API is a RESTful API that enables to perform Create/Read/Update/Delete operations for provisioning targets (i.e. devices) and repository content (i.e. software). +The Management API is a RESTful API that enables to perform Create/Read/Update/Delete operations for provisioning +targets (i.e. devices) and repository content (i.e. software). -Based on the Management API you can manage and monitor software update operations via HTTP/HTTPS. The _Management API_ supports JSON payload with hypermedia as well as filtering, sorting and paging. Furthermore the Management API provides permission based access control and standard roles as well as custom role creation. +Based on the Management API you can manage and monitor software update operations via HTTP/HTTPS. The _Management API_ +supports JSON payload with hypermedia as well as filtering, sorting and paging. Furthermore the Management API provides +permission based access control and standard roles as well as custom role creation. The API is protected and needs authentication and authorization based on the security concept. ## API Version -hawkBit provides an consistent Management API interface that guarantees backwards compatibility for future releases by version control. +hawkBit provides an consistent Management API interface that guarantees backwards compatibility for future releases by +version control. The current version of the Management API is `version 1 (v1)` with the URI http://localhost:8080/rest/v1/ @@ -42,10 +46,11 @@ In addition, for POST and PUT requests the `Content-Type` header has to be set. ## Request Body -Besides the relevant data (name, description, createdBy etc.) of a resource entity, a resource entity also has URIs (`_links`) to linked resource entities. - -A _Distribution Set_ entity may have for example URIs to artifacts, _Software Modules_, _Software Module Types_ and metadata. +Besides the relevant data (name, description, createdBy etc.) of a resource entity, a resource entity also has +URIs (`_links`) to linked resource entities. +A _Distribution Set_ entity may have for example URIs to artifacts, _Software Modules_, _Software Module Types_ and +metadata. ```json "_links": { @@ -65,5 +70,4 @@ A _Distribution Set_ entity may have for example URIs to artifacts, _Software Mo ## Management APIs - diff --git a/site/content/blog/2018-07-26-first-release.md b/site/content/blog/2018-07-26-first-release.md index 726d75ad1..507568836 100644 --- a/site/content/blog/2018-07-26-first-release.md +++ b/site/content/blog/2018-07-26-first-release.md @@ -4,17 +4,19 @@ parent: Blog weight: 200 --- -hawkBit is a domain-independent back-end framework for rolling out software updates to constrained edge devices as well -as more powerful controllers and gateways connected to IP based networking infrastructure. It is part of the Eclipse IoT +hawkBit is a domain-independent back-end framework for rolling out software updates to constrained edge devices as well +as more powerful controllers and gateways connected to IP based networking infrastructure. It is part of the Eclipse IoT since 2015 and with version _0.2.0_ a first release is available. -In this article, we want to give an overview of the latest highlights of hawkBit and let you know how you can get +In this article, we want to give an overview of the latest highlights of hawkBit and let you know how you can get started in seconds. -## Finally, it is here! +## Finally, it is here! -After being around in the Eclipse IoT realm for quite some time now, we are more than happy to announce our first release: -[_Eclipse hawkBit 0.2.0_](https://projects.eclipse.org/projects/iot.hawkbit/releases/0.2.0). The release can be found on [Maven Central](https://mvnrepository.com/artifact/org.eclipse.hawkbit) +After being around in the Eclipse IoT realm for quite some time now, we are more than happy to announce our first +release: +[_Eclipse hawkBit 0.2.0_](https://projects.eclipse.org/projects/iot.hawkbit/releases/0.2.0). The release can be found +on [Maven Central](https://mvnrepository.com/artifact/org.eclipse.hawkbit) and [Docker Hub](https://hub.docker.com/r/hawkbit/hawkbit-update-server/). It includes the following core features: * Device and Software Repository @@ -31,63 +33,69 @@ The features are accessible via the following interfaces: ![hawkBit Overview](../../images/hawkBit_overview.jpeg) - ## What's new? -Whenever there is a new release, the first question that comes to mind is: What's new? Since this is our first release, -one could argue that everything is new. However, most of the features are already well-established. This holds true, for -example, for our APIs or the Rollout Management. Nevertheless, there have been some recent updates to hawkBit, which we -do not want to leave unmentioned: +Whenever there is a new release, the first question that comes to mind is: What's new? Since this is our first release, +one could argue that everything is new. However, most of the features are already well-established. This holds true, for +example, for our APIs or the Rollout Management. Nevertheless, there have been some recent updates to hawkBit, which we +do not want to leave unmentioned: ### Streamlined UI -The probably most noticeable change has been the removal of the two buttons (`Drop here to delete` and `Actions`) at the -bottom of the _Deployment_, _Distributions_, and _Upload_ view. This is a major usability improvement! For example, -deleting an item required (1) dragging an item onto the delete button, (2) opening the delete pop-up, and (3) confirming -the deletion. Now, an item can be easily removed by clicking on its remove icon and confirming the action. Moreover, -multiple (or all `CTRL` + `A`) items can be selected and removed at once using the same mechanism. This is not only -faster and more intuitive, it also saves a lot of display real estate which can now be used to focus on what is important. +The probably most noticeable change has been the removal of the two buttons (`Drop here to delete` and `Actions`) at the +bottom of the _Deployment_, _Distributions_, and _Upload_ view. This is a major usability improvement! For example, +deleting an item required (1) dragging an item onto the delete button, (2) opening the delete pop-up, and (3) confirming +the deletion. Now, an item can be easily removed by clicking on its remove icon and confirming the action. Moreover, +multiple (or all `CTRL` + `A`) items can be selected and removed at once using the same mechanism. This is not only +faster and more intuitive, it also saves a lot of display real estate which can now be used to focus on what is +important. We hope you like this change as much as we do! _(Requires: hawkBit > 0.2.2)_ ![Screenshot of improved UI](../../images/hawkbit_ui.png) ### MS SQL Server -Eclipse hawkBit supports a range of different SQL databases. Up to now, these have been the internal H2 database (which can be -used for testing, development, or trial) and MySQL/MariaDB for production-grade usage. This list is now extended by +Eclipse hawkBit supports a range of different SQL databases. Up to now, these have been the internal H2 database (which +can be +used for testing, development, or trial) and MySQL/MariaDB for production-grade usage. This list is now extended by Microsoft's SQL Server which is also available in production grade, as well as, IBM's DB2 for testing and development. ### Open Sourced REST docs -A huge benefit for the community is the recently open sourced REST docs of hawkBit. This has been an [open request](https://github.com/eclipse-hawkbit/hawkbit/issues/480) -for some time, which we were happy to meet. The documentation is generated using [Spring REST docs](https://spring.io/projects/spring-restdocs), based on unit-tests. These tests, with the respective documentation, are now available in the [code base](https://github.com/eclipse-hawkbit/hawkbit/pull/688). - Furthermore, the API documentation will be hosted on our new [website](https://www.eclipse.org/hawkbit/) (coming soon). - +A huge benefit for the community is the recently open sourced REST docs of hawkBit. This has been +an [open request](https://github.com/eclipse-hawkbit/hawkbit/issues/480) +for some time, which we were happy to meet. The documentation is generated +using [Spring REST docs](https://spring.io/projects/spring-restdocs), based on unit-tests. These tests, with the +respective documentation, are now available in the [code base](https://github.com/eclipse-hawkbit/hawkbit/pull/688). +Furthermore, the API documentation will be hosted on our new [website](https://www.eclipse.org/hawkbit/) (coming soon). ### Docker Images -In order to enable interested parties to get started with hawkBit conveniently, we decided to provide the -[Update Server as a Docker image](https://hub.docker.com/r/hawkbit/hawkbit-update-server/) on Docker Hub. The image comes -in two flavors: The default image uses the internal H2 database, while the images with a `-mysql` suffix contain the MySQL -driver to allow connecting a MySQL database. In addition to the Docker image, the hawkBit repository contains a -[docker-compose.yml](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-runtime/hawkbit-update-server/docker/docker-compose.yml) -that not only starts the Update Server, but further includes a MySQL database and a RabbitMQ message broker so you're -able to use Device Management Federation (DMF) as well. +In order to enable interested parties to get started with hawkBit conveniently, we decided to provide the +[Update Server as a Docker image](https://hub.docker.com/r/hawkbit/hawkbit-update-server/) on Docker Hub. The image +comes +in two flavors: The default image uses the internal H2 database, while the images with a `-mysql` suffix contain the +MySQL +driver to allow connecting a MySQL database. In addition to the Docker image, the hawkBit repository contains a +[docker-compose.yml](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-runtime/hawkbit-update-server/docker/docker-compose.yml) +that not only starts the Update Server, but further includes a MySQL database and a RabbitMQ message broker so you're +able to use Device Management Federation (DMF) as well. -To start the hawkBit Update Server image, open a terminal and run: +To start the hawkBit Update Server image, open a terminal and run: ``` $ docker run -d -p 8080:8080 hawkbit/hawkbit-update-server ``` + {{% note %}} _Note: This requires a running [Docker deamon](https://docs.docker.com/install/) on your system._ {{% /note %}} -Now, browse to [http://localhost:8080](http://localhost:8080) and log-in with `admin:admin`. There you go! +Now, browse to [http://localhost:8080](http://localhost:8080) and log-in with `admin:admin`. There you go! ## Community Updates -Although features and functionality play a major role in the hawkBit project, there is also some interesting news from +Although features and functionality play a major role in the hawkBit project, there is also some interesting news from the community. As of July 2018, there have been: * Pull Requests: 587 @@ -98,17 +106,19 @@ the community. As of July 2018, there have been: ### New Project Lead and Committers -We are happy to announce that the hawkBit project got a new project lead. In addition to -[Kai Zimmermann](https://projects.eclipse.org/user/6364), project lead from the first hour, -[Jeroen Laverman](https://projects.eclipse.org/user/10982) joined the lead to support him in this responsibility. -Moreover, with [Stefan Behl](https://projects.eclipse.org/user/10842) and Jeroen Laverman, two new committers are aboard. - +We are happy to announce that the hawkBit project got a new project lead. In addition to +[Kai Zimmermann](https://projects.eclipse.org/user/6364), project lead from the first hour, +[Jeroen Laverman](https://projects.eclipse.org/user/10982) joined the lead to support him in this responsibility. +Moreover, with [Stefan Behl](https://projects.eclipse.org/user/10842) and Jeroen Laverman, two new committers are +aboard. ## What's next? -Looking ahead, there are two major topics that we want to tackle next: First, there is the migration of our UI from Vaadin +Looking ahead, there are two major topics that we want to tackle next: First, there is the migration of our UI from +Vaadin 7 to Vaadin 8, since Vaadin announced the end-of-life for our current version. Another big topic will be the update -to Spring Boot 2. On the community side, we are in the final stage of updating our [website](https://www.eclipse.org/hawkbit/) -with a new design, so make sure you stop by in a couple of days to check it out. Finally, the hawkBit team will be +to Spring Boot 2. On the community side, we are in the final stage of updating +our [website](https://www.eclipse.org/hawkbit/) +with a new design, so make sure you stop by in a couple of days to check it out. Finally, the hawkBit team will be present at EclipseCon Europe 2018, so if you are interested in meeting us, that is the place to be. diff --git a/site/content/blog/2023-09-21-epl2.0.md b/site/content/blog/2023-09-21-epl2.0.md index fbba6a511..fce631504 100644 --- a/site/content/blog/2023-09-21-epl2.0.md +++ b/site/content/blog/2023-09-21-epl2.0.md @@ -15,6 +15,7 @@ In this article, we want to give an overview of the latest highlights of hawkBit Based on the issues [Switch to EPL 2.0 License](https://github.com/eclipse-hawkbit/hawkbit/issues/1393) and [Update hawkBit's license to EPL 2.0](https://github.com/eclipse-hawkbit/hawkbit/issues/1008) -the hawkBit license is upgraded from [Eclipse Public License - Version 1.0](http://www.eclipse.org/org/documents/epl-v10.php) to +the hawkBit license is upgraded +from [Eclipse Public License - Version 1.0](http://www.eclipse.org/org/documents/epl-v10.php) to [Eclipse Public License - v 2.0](https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt). diff --git a/site/content/blog/2023-11-22-vaadin8_ui_discontinuation.md b/site/content/blog/2023-11-22-vaadin8_ui_discontinuation.md index bdf811d84..f6784e201 100644 --- a/site/content/blog/2023-11-22-vaadin8_ui_discontinuation.md +++ b/site/content/blog/2023-11-22-vaadin8_ui_discontinuation.md @@ -8,18 +8,34 @@ In this article, we want to give an overview of the future of the hawkBit UI ## hawkBit Vaadin 8 UI discontinuation -The hawkBit UI uses Vaadin as a web UI framework. It uses Vaadin 8 (8.14.3). This major version, according [Vaadin Roadmap](https://vaadin.com/roadmap), has no free support since 21st Feb 2022. There are some version releases after that date (8.15.0 - 8.16.0) that are Apache 2.0 licensed. However, since 8.16.1 ([see here](https://mvnrepository.com/artifact/com.vaadin/vaadin-server)) the license is [Commercial Vaadin Developer License 4.0](https://vaadin.com/license/cvdl-4.0), so they could not be used in hawkBit. +The hawkBit UI uses Vaadin as a web UI framework. It uses Vaadin 8 (8.14.3). This major version, +according [Vaadin Roadmap](https://vaadin.com/roadmap), has no free support since 21st Feb 2022. There are some version +releases after that date (8.15.0 - 8.16.0) that are Apache 2.0 licensed. However, since +8.16.1 ([see here](https://mvnrepository.com/artifact/com.vaadin/vaadin-server)) the license +is [Commercial Vaadin Developer License 4.0](https://vaadin.com/license/cvdl-4.0), so they could not be used in hawkBit. -We believe it is not a good practice to keep an out of free support library in an open source project like hawkBit. And moreover, even if we keep it, if a security vulnerability is discovered - all users shall opt for commercial support or to drop UI. +We believe it is not a good practice to keep an out of free support library in an open source project like hawkBit. And +moreover, even if we keep it, if a security vulnerability is discovered - all users shall opt for commercial support or +to drop UI. -There is another critical obstacle with keeping Vaadin 8 UI. At the moment hawkBit uses Spring Boot 2.7. According to [Spring Boot EOL](https://endoflife.date/spring-boot) Spring Boot 2.7 stream will reach end of support 24th Nov 2023. So, hawkBit shall be migrated to Spring Boot 3.0+. Since Vaadin 8 seem to be incompatible with Spring Boot 3 (they added support for Spring Boot 3 in Vaadin 24 ([Vaadin 24 pre release](https://vaadin.com/blog/vaadin-24-pre-release-available-for-spring-boot-3.0)) we shall drop Vaadin UI 8 anyway. +There is another critical obstacle with keeping Vaadin 8 UI. At the moment hawkBit uses Spring Boot 2.7. According +to [Spring Boot EOL](https://endoflife.date/spring-boot) Spring Boot 2.7 stream will reach end of support 24th Nov 2023. +So, hawkBit shall be migrated to Spring Boot 3.0+. Since Vaadin 8 seem to be incompatible with Spring Boot 3 (they added +support for Spring Boot 3 in Vaadin +24 ([Vaadin 24 pre release](https://vaadin.com/blog/vaadin-24-pre-release-available-for-spring-boot-3.0)) we shall drop +Vaadin UI 8 anyway. -Many months ago we asked for community help to migrate hawkBit UI to newer Vaadin versions - [Urgent migration needed to a newer Vaadin version -](https://github.com/eclipse-hawkbit/hawkbit/issues/1376) and gitter channel. However, there was no volunteer found to do the migration. +Many months ago we asked for community help to migrate hawkBit UI to newer Vaadin +versions - [Urgent migration needed to a newer Vaadin version +](https://github.com/eclipse-hawkbit/hawkbit/issues/1376) and gitter channel. However, there was no volunteer found to +do the migration. -All this being said, unfortunately, we've come to the decision to drop the Vaadin 8 UI from the Eclipse hawkBit and the latest hawkBit release 0.3.0 is the last version of hawkBit that includes it. For the next 0.4.0 release we plan to remove this Vaadin 8 UI. Thus the hawkBit may become an UI-less project. +All this being said, unfortunately, we've come to the decision to drop the Vaadin 8 UI from the Eclipse hawkBit and the +latest hawkBit release 0.3.0 is the last version of hawkBit that includes it. For the next 0.4.0 release we plan to +remove this Vaadin 8 UI. Thus the hawkBit may become an UI-less project. + +There were steps taken to mitigate the problem: -There were steps taken to mitigate the problem: * extending the REST API * introducing Swagger UI which allow easier use of the REST API diff --git a/site/content/blog/2024-01-16-0.4.1-release.md b/site/content/blog/2024-01-16-0.4.1-release.md index 1e16634f2..005d4bd30 100644 --- a/site/content/blog/2024-01-16-0.4.1-release.md +++ b/site/content/blog/2024-01-16-0.4.1-release.md @@ -9,19 +9,42 @@ In this article, we want to give an overview of the 0.4.1 hawkBit release (Frida ## hawkBit [0.4.1](https://github.com/eclipse-hawkbit/hawkbit/releases/tag/0.4.1) release ### Steps towards removal of the legacy Vaadin8-based UI -As announced at [Vaadin 8 UI discontinuation](2023-11-22-vaadin8_ui_discontinuation.md) the current Vaadin 8 based UI will be removed. This release will likely be the last one including it. Some steps are taken to mitigate this. -* First of all, this release introduces [Simple UI](https://github.com/eclipse-hawkbit/hawkbit/tree/0.4.1/hawkbit-runtime/hawkbit-simple-ui) - a demo/PoC level UI. It includes the most essential functionality allowing you to play around with hawkBit. It could not be compared to legacy UI in features and maturity in any case. Some notes for it: + +As announced at [Vaadin 8 UI discontinuation](2023-11-22-vaadin8_ui_discontinuation.md) the current Vaadin 8 based UI +will be removed. This release will likely be the last one including it. Some steps are taken to mitigate this. + +* First of all, this release + introduces [Simple UI](https://github.com/eclipse-hawkbit/hawkbit/tree/0.4.1/hawkbit-runtime/hawkbit-simple-ui) - a + demo/PoC level UI. It includes the most essential functionality allowing you to play around with hawkBit. It could not + be compared to legacy UI in features and maturity in any case. Some notes for it: * *Status* - as already said - low maturity and very feature-limited, *EXPERIMENTAL* - * Intended for demo/play-around purposes. It could become an initial version of a new hawkBit UI but currently, there are no resources for further development. Any contribution to this UI in the direction of making it a full-fledged mature UI is welcome! + * Intended for demo/play-around purposes. It could become an initial version of a new hawkBit UI but currently, + there are no resources for further development. Any contribution to this UI in the direction of making it a + full-fledged mature UI is welcome! * It provides features like - create software modules & distribution sets, targets, and rollouts - * In contrast with legacy UI the new UI is a standalone application and uses only REST API to provide functionality to the user. -* To the legacy monolith update server application there is added a new microservice-based application. As part of this effort, there was introduced an example of [legacy Vaadin 8 UI standalone application](https://github.com/eclipse-hawkbit/hawkbit/tree/0.4.1/hawkbit-runtime/hawkbit-vv8-ui). This legacy UI standalone application could be used together with future hawkBit update server versions as long as it is compatible and on the user's responsibility. Some notes for it: - * *NOT RECOMMENDED* - it might contain security vulnerabilities and bugs. It could be hard to verify its compatibility with the new hawkBit versions. - * *ON USER's RESPONSIBILITY* - no guarantees of any kind are provided for that application. It is entirely the user's responsibility to test, scan for vulnerabilities, and use it. + * In contrast with legacy UI the new UI is a standalone application and uses only REST API to provide functionality + to the user. +* To the legacy monolith update server application there is added a new microservice-based application. As part of this + effort, there was introduced an example + of [legacy Vaadin 8 UI standalone application](https://github.com/eclipse-hawkbit/hawkbit/tree/0.4.1/hawkbit-runtime/hawkbit-vv8-ui). + This legacy UI standalone application could be used together with future hawkBit update server versions as long as it + is compatible and on the user's responsibility. Some notes for it: + * *NOT RECOMMENDED* - it might contain security vulnerabilities and bugs. It could be hard to verify its + compatibility with the new hawkBit versions. + * *ON USER's RESPONSIBILITY* - no guarantees of any kind are provided for that application. It is entirely the + user's responsibility to test, scan for vulnerabilities, and use it. * Provides an option to use the legacy Vaadin 8 UI with the new hawkBit versions under the conditions above * It uses directly the database and legacy update server code * It includes the outdated Spring Boot 2.7 which is after its end of support * It will not be developed any further and new features won't be available * No bugfixes would be provided for it + ### Extended access control management - entity-based -There is a new feature implemented in access control management. Up until now, permissions (e.g. CREATE_TARGET) were assigned to the users, and based on that users were able to execute some action or not. Now there is added a pluggable mechanism via [AccessController](https://github.com/eclipse-hawkbit/hawkbit/blob/0.4.1/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/acm/AccessController.java) that allows to further restrict the access based on the entity. For instance, a developer could implement its custom access controller for targets that, depending on the user, could grant or reject permissions for accessing targets of certain target types. \ No newline at end of file + +There is a new feature implemented in access control management. Up until now, permissions (e.g. CREATE_TARGET) were +assigned to the users, and based on that users were able to execute some action or not. Now there is added a pluggable +mechanism +via [AccessController](https://github.com/eclipse-hawkbit/hawkbit/blob/0.4.1/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/acm/AccessController.java) +that allows to further restrict the access based on the entity. For instance, a developer could implement its custom +access controller for targets that, depending on the user, could grant or reject permissions for accessing targets of +certain target types. \ No newline at end of file diff --git a/site/content/community.md b/site/content/community.md index 41022e1bb..3d5fdfc72 100755 --- a/site/content/community.md +++ b/site/content/community.md @@ -5,41 +5,59 @@ weight: 90 ## Presentations -Here you can find links to arbitrary material covering Eclipse hawkBit which has been presented at events, conferences and meet-ups. +Here you can find links to arbitrary material covering Eclipse hawkBit which has been presented at events, conferences +and meet-ups. -- 09/23/2015 - Eclipse IoT Working Group meeting - [slides](https://docs.bosch-iot-rollouts.com/slides/hawkBitProposal20150923.html) +- 09/23/2015 - Eclipse IoT Working Group + meeting - [slides](https://docs.bosch-iot-rollouts.com/slides/hawkBitProposal20150923.html) - 04/11/2015 - EclipseCon Europe 2015 - [slides](https://docs.bosch-iot-rollouts.com/slides/eclipseCon2015.html) -- 03/09/2016 - EclipseCon North America 2016 - [slides](https://docs.bosch-iot-rollouts.com/slides/eclipseConNA2016.html) -- 05/16/2016 - Eclipse Virtual IoT Meetup - [video](https://www.youtube.com/watch?v=g-dhKMaaanE) - [slides](https://docs.bosch-iot-rollouts.com/slides/virtualIoTMeetup2016.html) -- 03/20/2017 - Eclipse IoT Day SanJose, CA - [video](https://www.youtube.com/watch?v=x5OfBgnYW44) - [slides](https://docs.bosch-iot-rollouts.com/slides/iotDaySanJose2017.pdf) +- 03/09/2016 - EclipseCon North America + 2016 - [slides](https://docs.bosch-iot-rollouts.com/slides/eclipseConNA2016.html) +- 05/16/2016 - Eclipse Virtual IoT + Meetup - [video](https://www.youtube.com/watch?v=g-dhKMaaanE) - [slides](https://docs.bosch-iot-rollouts.com/slides/virtualIoTMeetup2016.html) +- 03/20/2017 - Eclipse IoT Day SanJose, + CA - [video](https://www.youtube.com/watch?v=x5OfBgnYW44) - [slides](https://docs.bosch-iot-rollouts.com/slides/iotDaySanJose2017.pdf) - 09/12/2017 - Eclipse IoT Day ThingMonk 2017 - [video](https://www.youtube.com/watch?v=7hK-kiQjKGA) -- 01/10/2018 - Eclipse Virtual IoT Meetup - [video](https://www.youtube.com/watch?v=8vcLXs9lc-4) - [slides](https://docs.bosch-iot-rollouts.com/slides/hawkBitIntroduction.html) -- 10/22/2018 - Community Day EclipseCon Europe 2018 - [slides](https://www.eclipse.org/hawkbit/slides/community-day-2018.html) -- 10/21/2019 - Community Day EclipseCon Europe 2019 - [slides](https://www.eclipse.org/hawkbit/slides/community-day-2019.html) -- 10/19/2020 - Community Day EclipseCon Europe 2020 - [slides](https://www.eclipse.org/hawkbit/slides/community-day-2020.html) +- 01/10/2018 - Eclipse Virtual IoT + Meetup - [video](https://www.youtube.com/watch?v=8vcLXs9lc-4) - [slides](https://docs.bosch-iot-rollouts.com/slides/hawkBitIntroduction.html) +- 10/22/2018 - Community Day EclipseCon Europe + 2018 - [slides](https://www.eclipse.org/hawkbit/slides/community-day-2018.html) +- 10/21/2019 - Community Day EclipseCon Europe + 2019 - [slides](https://www.eclipse.org/hawkbit/slides/community-day-2019.html) +- 10/19/2020 - Community Day EclipseCon Europe + 2020 - [slides](https://www.eclipse.org/hawkbit/slides/community-day-2020.html) ## Articles -- 10/27/2015 - Why software provisioning goes open source - [article](http://blog.bosch-si.com/categories/technology/2015/10/software-provisioning-goes-open-source-find/) -- 05/25/2016 - jaxenter: Eclipse hawkBit - [english](https://jaxenter.com/eclipse-hawkbit-126445.html) - [german](https://jaxenter.de/eclipse-hawkbit-46372) -- 09/27/2016 - Eclipse Newsletter - 'IoT is the new black' - [article](http://www.eclipse.org/community/eclipse_newsletter/2016/september/article2.php) +- 10/27/2015 - Why software provisioning goes open + source - [article](http://blog.bosch-si.com/categories/technology/2015/10/software-provisioning-goes-open-source-find/) +- 05/25/2016 - jaxenter: Eclipse + hawkBit - [english](https://jaxenter.com/eclipse-hawkbit-126445.html) - [german](https://jaxenter.de/eclipse-hawkbit-46372) +- 09/27/2016 - Eclipse Newsletter - 'IoT is the new + black' - [article](http://www.eclipse.org/community/eclipse_newsletter/2016/september/article2.php) ## Ask a question -Visit [stackoverflow.com](https://stackoverflow.com/questions/tagged/eclipse-hawkbit) to find questions or raise your own tagged with `eclipse-hawkbit`. +Visit [stackoverflow.com](https://stackoverflow.com/questions/tagged/eclipse-hawkbit) to find questions or raise your +own tagged with `eclipse-hawkbit`. ## Chat -Searching for a quick response from the team behind hawkBit and the hawkBit community, join the [Gitter Chat](https://gitter.im/eclipse/hawkbit). +Searching for a quick response from the team behind hawkBit and the hawkBit community, join +the [Gitter Chat](https://gitter.im/eclipse/hawkbit). ## Mailing List -A great way to stay up to date with hawkBit activity is to subscribe to the Mailing list provided by Eclipse. Sign up for the mailing list [here](https://dev.eclipse.org/mailman/listinfo/hawkbit-dev). +A great way to stay up to date with hawkBit activity is to subscribe to the Mailing list provided by Eclipse. Sign up +for the mailing list [here](https://dev.eclipse.org/mailman/listinfo/hawkbit-dev). ## Issue Tracker -Issues and bugs related to hawkBit are tracked with the Github Issue tracking system. If you find any issues, please report them [here](https://github.com/eclipse-hawkbit/hawkbit/issues). +Issues and bugs related to hawkBit are tracked with the Github Issue tracking system. If you find any issues, please +report them [here](https://github.com/eclipse-hawkbit/hawkbit/issues). ## Contributing -An overview of the contribution process is [here](https://wiki.eclipse.org/Development_Resources/Contributing_via_Git). Checkout the [Contribution Guidelines](https://github.com/eclipse-hawkbit/hawkbit/blob/master/CONTRIBUTING.md) on the Eclipse hawkBit GitHub Repository. +An overview of the contribution process is [here](https://wiki.eclipse.org/Development_Resources/Contributing_via_Git). +Checkout the [Contribution Guidelines](https://github.com/eclipse-hawkbit/hawkbit/blob/master/CONTRIBUTING.md) on the +Eclipse hawkBit GitHub Repository. diff --git a/site/content/concepts/authentication.md b/site/content/concepts/authentication.md index 5ca952b72..d6b22f1da 100644 --- a/site/content/concepts/authentication.md +++ b/site/content/concepts/authentication.md @@ -9,17 +9,21 @@ A hawkBit update server can be accessed in four different ways: - _Direct Device Integration (DDI) API_ by **targets**. - _Management API_ by 3rd party **applications**. - _Device Management Federation (DMF) API_ by 3rd party **applications** through AMQP. - + ## DDI API Authentication Modes ### Security Token -hawkBit supports multiple ways to authenticate a target against the server. The different authentication modes can be individual enabled and disabled within hawkBit. Both on system level (with Spring Boot properties) as per individual tenant. +hawkBit supports multiple ways to authenticate a target against the server. The different authentication modes can be +individual enabled and disabled within hawkBit. Both on system level (with Spring Boot properties) as per individual +tenant. #### Target Security Token Authentication -There is a 32 alphanumeric character security-token for each created target within IoT hawkBit. This token can be used to authenticate the target at hawkBit through the HTTP-Authorization header with the custom scheme _TargetToken_. + +There is a 32 alphanumeric character security-token for each created target within IoT hawkBit. This token can be used +to authenticate the target at hawkBit through the HTTP-Authorization header with the custom scheme _TargetToken_. ``` GET /SPDEMO/controller/v1/0e945f95-9117-4500-9b0a-9c6d72fa6c07 HTTP/1.1 @@ -27,18 +31,28 @@ Host: your.hawkBit.server Authorization: TargetToken bH7XXAprK1ChnLfKSdtlsp7NOlPnZAYY ``` -The target security token is provided in [DMF API](../../apis/dmf_api/) as part of the update message in order to allow DMF clients to leverage the feature or can it be manually retrieved per target by [Management API](../../apis/management_api/) or in the [Management UI](../../ui) in the target details. +The target security token is provided in [DMF API](../../apis/dmf_api/) as part of the update message in order to allow +DMF clients to leverage the feature or can it be manually retrieved per target +by [Management API](../../apis/management_api/) or in the [Management UI](../../ui) in the target details. -Note: needs to be enabled in your hawkBit installation **and** in the tenant configuration. That allows both the operator as well as the individual customer (if run in a multi-tenant setup) to enable this access method. See [DdiSecurityProperties](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/DdiSecurityProperties.java) for system wide enablement. +Note: needs to be enabled in your hawkBit installation **and** in the tenant configuration. That allows both the +operator as well as the individual customer (if run in a multi-tenant setup) to enable this access method. +See [DdiSecurityProperties](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/DdiSecurityProperties.java) +for system wide enablement. The additional activation for the individual tenant: ![Enable Target Token](../../images/security/targetToken.png) #### Gateway Security Token Authentication -Often the targets are connected through a gateway which manages the targets directly and as a result are indirectly connected to the hawkBit update server. -To authenticate this gateway and allow it to manage all target instances under its tenant there is a _GatewayToken_ to authenticate this gateway through the HTTP-Authorization header with a custom scheme _GatewayToken_. This is of course also handy during development or for testing purposes. However, we generally recommend to use this token with care as it allows to act _in the name of_ any device. +Often the targets are connected through a gateway which manages the targets directly and as a result are indirectly +connected to the hawkBit update server. + +To authenticate this gateway and allow it to manage all target instances under its tenant there is a _GatewayToken_ to +authenticate this gateway through the HTTP-Authorization header with a custom scheme _GatewayToken_. This is of course +also handy during development or for testing purposes. However, we generally recommend to use this token with care as it +allows to act _in the name of_ any device. ``` GET /SPDEMO/controller/v1/0e945f95-9117-4500-9b0a-9c6d72fa6c07 HTTP/1.1 @@ -46,16 +60,24 @@ Host: your.hawkBit.server Authorization: GatewayToken 3nkswAZhX81oDtktq0FF9Pn0Tc0UGXPW ``` -Note: needs to be enabled in your hawkBit installation **and** in the tenant configuration. That allows both the operator as well as the individual customer (if run in a multi-tenant setup) to enable this access method. See [DdiSecurityProperties](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/DdiSecurityProperties.java) for system wide enablement. +Note: needs to be enabled in your hawkBit installation **and** in the tenant configuration. That allows both the +operator as well as the individual customer (if run in a multi-tenant setup) to enable this access method. +See [DdiSecurityProperties](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/DdiSecurityProperties.java) +for system wide enablement. The additional activation for the individual tenant: ![Enable Gateway Token](../../images/security/gatewayToken.png) #### Anonymous access -Here we offer general anonymous access for all targets (see [DdiSecurityProperties](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/DdiSecurityProperties.java)) which we consider not really sufficient for a production system but it might come in handy to get a project started in the beginning. -However, anonymous download on the other side might be interesting even in production for scenarios where the artifact itself is already encrypted. +Here we offer general anonymous access for all targets ( +see [DdiSecurityProperties](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/DdiSecurityProperties.java)) +which we consider not really sufficient for a production system but it might come in handy to get a project started in +the beginning. + +However, anonymous download on the other side might be interesting even in production for scenarios where the artifact +itself is already encrypted. The activation for the individual tenant: @@ -63,15 +85,24 @@ The activation for the individual tenant: ### Certificate Authentication by Reverse Proxy -hawkBit offers a certificate-based authentication mechanism, also known as mutual TLS (mTLS), which eliminates the need to share a security token with the server. To implement this, you'll require a reverse proxy deployed in front of the hawkBit server to handle authentication. This process involves obtaining certificates (and keys) for both the client and the reverse proxy and configuring hawkBit accordingly. +hawkBit offers a certificate-based authentication mechanism, also known as mutual TLS (mTLS), which eliminates the need +to share a security token with the server. To implement this, you'll require a reverse proxy deployed in front of the +hawkBit server to handle authentication. This process involves obtaining certificates (and keys) for both the client and +the reverse proxy and configuring hawkBit accordingly. -Initially, you'll need to obtain certificates (and keys) for these components from the same or different Certificate Authorities (CAs). Once you have acquired certificates you have to set them up to both the client and the hawkBit server. +Initially, you'll need to obtain certificates (and keys) for these components from the same or different Certificate +Authorities (CAs). Once you have acquired certificates you have to set them up to both the client and the hawkBit +server. -Then you shall enable *Allow targets to authenticate via a certificate authenticated by a reverse proxy* and set the fingerprint of the client certificate issuer(s) (as a comma separated list). +Then you shall enable *Allow targets to authenticate via a certificate authenticated by a reverse proxy* and set the +fingerprint of the client certificate issuer(s) (as a comma separated list). To authenticate the request to hawBit the following condition shall be met: + - the common name of the client certificate shall match the controller/client id -- the SSL Issuer(s) hash of the presented client certificate shall be set for the tenant. For that, in Hawkbit's UI section, under system configuration, you shall enable 'Allow targets to authenticate via a certificate by an reverse proxy' and set the hash of the client certificate issuer(s) (as a comma separated list). +- the SSL Issuer(s) hash of the presented client certificate shall be set for the tenant. For that, in Hawkbit's UI + section, under system configuration, you shall enable 'Allow targets to authenticate via a certificate by an reverse + proxy' and set the hash of the client certificate issuer(s) (as a comma separated list). ![Example Reverse Proxy Settings](../../images/security/exampleReverseProxySettings.png) @@ -81,7 +112,8 @@ You can use the following command to get the issuer hash: openssl x509 -in client_certificate.crt -issuer_hash -noout` ``` -Here is an example diagram that shows all the communication between the hawkBit, reverse proxy and client. For the sake of simplification we assume that there are not intermediate certificates and the certificate and key are as follows: +Here is an example diagram that shows all the communication between the hawkBit, reverse proxy and client. For the sake +of simplification we assume that there are not intermediate certificates and the certificate and key are as follows: - client_ca.crt signs client.crt - server_ca.crt signs server.crt @@ -93,25 +125,37 @@ Here is an example diagram that shows all the communication between the hawkBit, #### Example - Nginx Reverse Proxy Configurations -Nginx doesn't support obtaining the issuer hash without addons. Therefore, in this example we bypass sending real SSL Issuer hash to hawhBit but do certificate issuer validation at Nginx and then supply shared (between Nginx and hawkBit) fixed hash "Hawkbit". You could use any value here as long as it is matched with the *Allow targets to authenticate via a certificate authenticated by a reverse proxy* setting in the hawkBit UI. Note that for multi-tenant scenarios with different trusted CAs this example won't work. +Nginx doesn't support obtaining the issuer hash without addons. Therefore, in this example we bypass sending real SSL +Issuer hash to hawhBit but do certificate issuer validation at Nginx and then supply shared (between Nginx and hawkBit) +fixed hash "Hawkbit". You could use any value here as long as it is matched with the *Allow targets to authenticate via +a certificate authenticated by a reverse proxy* setting in the hawkBit UI. Note that for multi-tenant scenarios with +different trusted CAs this example won't work. 1. Hawkbit Configurations There are also some configurations that you need update when you deployed your hawkbit service. - You need to add the given setting to your hawkBit configurations so that hawkBit can generate the URLs according to the https that the client will use to download. If you're deploying hawkBit as a Docker container, add these configurations as environmental values in the docker-compose.yml file. + You need to add the given setting to your hawkBit configurations so that hawkBit can generate the URLs according to + the https that the client will use to download. If you're deploying hawkBit as a Docker container, add these + configurations as environmental values in the docker-compose.yml file. ``` server.forward-headers-strategy=NATIVE ``` -2. In Hawkbit's UI section, under system configuration, make sure to select *Allow targets to authenticate via a certificate authenticated by a reverse proxy* and input the fixed issuer hash as "Hawkbit". This can be whetever you have configured in the nginx configuration in `proxy_set_header X-Ssl-Issuer-Hash-1` below. +2. In Hawkbit's UI section, under system configuration, make sure to select *Allow targets to authenticate via a + certificate authenticated by a reverse proxy* and input the fixed issuer hash as "Hawkbit". This can be whetever you + have configured in the nginx configuration in `proxy_set_header X-Ssl-Issuer-Hash-1` below. -3. After placing your certificates and keys, you need to deploy your proxy server and apply the provided configurations. You can apply mutual TLS specifically to the URL given below to implement the process only for devices using the Device Integration API: +3. After placing your certificates and keys, you need to deploy your proxy server and apply the provided configurations. + You can apply mutual TLS specifically to the URL given below to implement the process only for devices using the + Device Integration API: - `hawkbit.dev.example.com/default/controller/` + `hawkbit.dev.example.com/default/controller/` - This ensures that other clients, like UI users, can connect to hawkBit without requiring client certificates. They can use Username and Password in the Management API, eliminating the need for authentication and making it more user-friendly. + This ensures that other clients, like UI users, can connect to hawkBit without requiring client certificates. They + can use Username and Password in the Management API, eliminating the need for authentication and making it more + user-friendly. ```nginx # Nginx Hawkbit Configurations @@ -185,7 +229,7 @@ server { } } ``` - + 4. To deploy Nginx, you could use a `.yml` file. Here's an example `docker-compose.yml` file for Nginx Docker. ```yml @@ -210,14 +254,21 @@ services: - ./certbot/www/:/var/www/certbot/:rw - ./certbot/conf/:/etc/letsencrypt/:rw ``` -`/client-cer/:/etc/nginx/client-cer/` is the designated location for the certificate authority that has signed the client certificate. The presented client certificate will be verified against this CA. -5. After successfully generating your certificates with the correct chain, deploying your Nginx and Hawkbit services with appropriate configurations, and updating the settings on the device side, you will be able to establish a certificate-based authentication mechanism. This will eliminate the necessity of sharing a security token with the server. - +`/client-cer/:/etc/nginx/client-cer/` is the designated location for the certificate authority that has signed the +client certificate. The presented client certificate will be verified against this CA. + +5. After successfully generating your certificates with the correct chain, deploying your Nginx and Hawkbit services + with appropriate configurations, and updating the settings on the device side, you will be able to establish a + certificate-based authentication mechanism. This will eliminate the necessity of sharing a security token with the + server. +   + ##### Swupdate Suricatta Configurations -If the client is utilizing the SWUpdate Suricatta service, the configurations on the device or client side should also be adjusted as follows. Remember to change id, url and certificate names to your needs. +If the client is utilizing the SWUpdate Suricatta service, the configurations on the device or client side should also +be adjusted as follows. Remember to change id, url and certificate names to your needs. The location of the config file is `/etc/swupdate/swupdate.conf` @@ -241,6 +292,7 @@ journalctl --follow -u swupdate ```   + ##### Testing You can test the communication by using the Curl command below to see if you successfully implemented mutual TLS: @@ -249,14 +301,18 @@ You can test the communication by using the Curl command below to see if you suc curl -L -v --cert client.crt --key client.key --cacert server_ca.crt https://hawkbit.dev.example.com/default/controller/v1/{device-id} ``` -In the UI, after uploading an SWU package and requesting a firmware update, you can use the link below to attempt to install the software package. +In the UI, after uploading an SWU package and requesting a firmware update, you can use the link below to attempt to +install the software package. ``` curl -L -v --cert client.crt --key client.key --cacert server_ca.crt https://hawkbit.dev.example.com/default/controller/v1/{device-id}/softwaremodules/{artifact-id}/artifacts/hawkbit_updated_5.swu --output outputfile ``` ## DMF API -Authentication is provided by _RabbitMQ_ [vhost and user credentials](https://www.rabbitmq.com/access-control.html) that is used for the integration. + +Authentication is provided by _RabbitMQ_ [vhost and user credentials](https://www.rabbitmq.com/access-control.html) that +is used for the integration. ## Management API + - Basic Auth diff --git a/site/content/concepts/authorization.md b/site/content/concepts/authorization.md index 5688930b1..f90f9c546 100644 --- a/site/content/concepts/authorization.md +++ b/site/content/concepts/authorization.md @@ -4,12 +4,22 @@ parent: Concepts weight: 52 --- -Authorization is handled separately for _Direct Device Integration (DDI) API_ and _Device Management Federation (DMF) API_ (where successful authentication includes full authorization) and _Management API_ and _UI_ which is based on Spring security [authorities](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/SpPermission.java). +Authorization is handled separately for _Direct Device Integration (DDI) API_ and _Device Management Federation (DMF) +API_ (where successful authentication includes full authorization) and _Management API_ and _UI_ which is based on +Spring +security [authorities](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-security-core/src/main/java/org/eclipse/hawkbit/im/authentication/SpPermission.java). -However, keep in mind that hawkBit does not offer an off the shelf authentication provider to leverage these permissions and the underlying multi user/tenant capabilities of hawkBit but it supports authentication providers offering an OpenID Connect interface. Check out [Spring security documentation](http://projects.spring.io/spring-security/) for further information. In hawkBit [SecurityAutoConfiguration](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityAutoConfiguration.java) is a good starting point for integration. +However, keep in mind that hawkBit does not offer an off the shelf authentication provider to leverage these permissions +and the underlying multi user/tenant capabilities of hawkBit but it supports authentication providers offering an OpenID +Connect interface. Check out [Spring security documentation](http://projects.spring.io/spring-security/) for further +information. In +hawkBit [SecurityAutoConfiguration](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityAutoConfiguration.java) +is a good starting point for integration. -The default implementation is single user/tenant with basic auth and the logged in user is provided with all permissions. Additionally, the application properties may be configured for multiple static users; see [Multiple Users](#multiple-users) for details. +The default implementation is single user/tenant with basic auth and the logged in user is provided with all +permissions. Additionally, the application properties may be configured for multiple static users; +see [Multiple Users](#multiple-users) for details. ## DDI API @@ -19,13 +29,16 @@ An authenticated target is permitted to: - provide feedback to the the server - download artifacts that are assigned to it -A target might be permitted to download artifacts without authentication (if enabled, see above). Only the download can be permitted to disable the authentication. This can be used in scenarios where the artifacts itself are e.g. signed and secured. +A target might be permitted to download artifacts without authentication (if enabled, see above). Only the download can +be permitted to disable the authentication. This can be used in scenarios where the artifacts itself are e.g. signed and +secured. ## Management API and UI ### Multiple Users -hawkBit optionally supports configuring multiple static users through the application properties. In this case, the user and password Spring security properties are ignored. +hawkBit optionally supports configuring multiple static users through the application properties. In this case, the user +and password Spring security properties are ignored. An example configuration is given below. hawkbit.server.im.users[0].username=admin @@ -42,46 +55,54 @@ An example configuration is given below. hawkbit.server.im.users[1].email=test@tester.com hawkbit.server.im.users[1].permissions=READ_TARGET,UPDATE_TARGET,CREATE_TARGET,DELETE_TARGET -A permissions value of `ALL` will provide that user with all possible permissions. Passwords need to be specified with the used password encoder in brackets. In this example, `noop` is used as the plaintext encoder. For production use, it is recommended to use a hash function designed for passwords such as *bcrypt*. See this [blog post](https://spring.io/blog/2017/11/01/spring-security-5-0-0-rc1-released#password-storage-format) for more information on password encoders in Spring Security. +A permissions value of `ALL` will provide that user with all possible permissions. Passwords need to be specified with +the used password encoder in brackets. In this example, `noop` is used as the plaintext encoder. For production use, it +is recommended to use a hash function designed for passwords such as *bcrypt*. See +this [blog post](https://spring.io/blog/2017/11/01/spring-security-5-0-0-rc1-released#password-storage-format) for more +information on password encoders in Spring Security. ### OpenID Connect -hawkbit supports authentication providers which use the OpenID Connect standard, an authentication layer built on top of the OAuth 2.0 protocol. +hawkbit supports authentication providers which use the OpenID Connect standard, an authentication layer built on top of +the OAuth 2.0 protocol. An example configuration is given below. spring.security.oauth2.client.registration.oidc.client-id=clientID spring.security.oauth2.client.provider.oidc.issuer-uri=https://oidc-provider/issuer-uri spring.security.oauth2.client.provider.oidc.jwk-set-uri=https://oidc-provider/jwk-set-uri -Note: at the moment only DEFAULT tenant is supported. By default the resource_access//roles claim is mapped to hawkBit permissions. However, by registering a Spring bean _org.eclipse.hawkbit.autoconfigure.security.OidcUserManagementAutoConfiguration.JwtAuthoritiesExtractor_ a custom extractor permission mapper could be registered. +Note: at the moment only DEFAULT tenant is supported. By default the resource_access//roles claim is mapped +to hawkBit permissions. However, by registering a Spring bean +_org.eclipse.hawkbit.autoconfigure.security.OidcUserManagementAutoConfiguration.JwtAuthoritiesExtractor_ a custom +extractor permission mapper could be registered. ### Delivered Permissions - READ_/UPDATE_/CREATE_/DELETE_TARGET for: - - Target entities including metadata (that includes also the installed and assigned distribution sets) - - Target tags - - Target actions - - Target registration rules - - Bulk operations - - Target filters + - Target entities including metadata (that includes also the installed and assigned distribution sets) + - Target tags + - Target actions + - Target registration rules + - Bulk operations + - Target filters - READ_/UPDATE_/CREATE_/DELETE_REPOSITORY for: - - Distribution sets - - Software Modules - - Artifacts - - DS tags + - Distribution sets + - Software Modules + - Artifacts + - DS tags - READ_TARGET_SECURITY_TOKEN - - Permission to read the target security token. The security token is security concerned and should be protected. + - Permission to read the target security token. The security token is security concerned and should be protected. - DOWNLOAD_REPOSITORY_ARTIFACT - - Permission to download artifacts of a software module (Note: READ_REPOSITORY allows only to read the metadata). + - Permission to download artifacts of a software module (Note: READ_REPOSITORY allows only to read the metadata). - TENANT_CONFIGURATION - - Permission to administrate the tenant settings. + - Permission to administrate the tenant settings. - READ_/UPDATE_/CREATE_/DELETE_/HANDLE_/APPROVE_ROLLOUT for: - - Managing rollouts and provision targets through a rollout. + - Managing rollouts and provision targets through a rollout. ### Permission Matrix for example uses cases that need more than one permission @@ -95,4 +116,6 @@ Note: at the moment only DEFAULT tenant is supported. By default the resource_ac ## Device Management Federation API -The provided _RabbitMQ_ [vhost and user](https://www.rabbitmq.com/access-control.html) should be provided with the necessary permissions to send messages to hawkBit through the exchange and receive messages from it through the specified queue. +The provided _RabbitMQ_ [vhost and user](https://www.rabbitmq.com/access-control.html) should be provided with the +necessary permissions to send messages to hawkBit through the exchange and receive messages from it through the +specified queue. diff --git a/site/content/concepts/datamodel.md b/site/content/concepts/datamodel.md index 8aed1525d..9a226e93b 100644 --- a/site/content/concepts/datamodel.md +++ b/site/content/concepts/datamodel.md @@ -4,18 +4,30 @@ parent: Concepts weight: 53 --- -The hawkBit data model was designed to have enough flexibility to define complex software structures (e.g. operating system, runtimes, apps, different kind of artifacts) on one side and simplicity compared to the capabilities of a full blown configuration management on the other. +The hawkBit data model was designed to have enough flexibility to define complex software structures (e.g. operating +system, runtimes, apps, different kind of artifacts) on one side and simplicity compared to the capabilities of a full +blown configuration management on the other. -It does define a hierarchy of software that starts with a distribution, which can have (sub-)modules and these may have multiple artifacts. However, it does not consider any kind of dependency definitions between modules or artifacts. As a result, dependency checks - if necessary - have to be done outside hawkBit, i.e. on the device itself or before the entity creation in hawkBit by the origin. +It does define a hierarchy of software that starts with a distribution, which can have (sub-)modules and these may have +multiple artifacts. However, it does not consider any kind of dependency definitions between modules or artifacts. As a +result, dependency checks - if necessary - have to be done outside hawkBit, i.e. on the device itself or before the +entity creation in hawkBit by the origin. ## Provisioning Target Definition -A Provisioning Target is a neutral definition that may be an actual real device (e.g. gateway, embedded sensor) or a virtual device (e.g. vehicle, smart home). +A Provisioning Target is a neutral definition that may be an actual real device (e.g. gateway, embedded sensor) or a +virtual device (e.g. vehicle, smart home). -The definition in hawkBit might reflect the transactional behavior if necessary on the device side. A vehicle might be updated device by device or as a whole. As a result one way of defining a vehicle in hawkBit could be to have one all inclusive Software Module or one module per (sub-) device. +The definition in hawkBit might reflect the transactional behavior if necessary on the device side. A vehicle might be +updated device by device or as a whole. As a result one way of defining a vehicle in hawkBit could be to have one all +inclusive Software Module or one module per (sub-) device. -A Target can have, next to its defined properties (e.g. controller ID, target type, name, description, security token), a generic set of attributes and meta data, both in key:value format. Target attributes are owned and managed by the device whereas target meta data are managed by the operator. If a target is defined to be of a certain target type, then during the assignment of a distribution set, a compatibility check will be performed between the target type and distribution set type. +A Target can have, next to its defined properties (e.g. controller ID, target type, name, description, security token), +a generic set of attributes and meta data, both in key:value format. Target attributes are owned and managed by the +device whereas target meta data are managed by the operator. If a target is defined to be of a certain target type, then +during the assignment of a distribution set, a compatibility check will be performed between the target type and +distribution set type. ## Software Structure Definition @@ -23,28 +35,38 @@ The structure defines the model of the supported software by the provisioning ta - Distribution Set Type:defines a package structure that is supported by certain devices - Consists of Software Module Types both for - - Firmware - device can have only one module of that type (e.g. the operating system) - - Software - device can have multiple modules of that type (e.g. "Apps") + - Firmware - device can have only one module of that type (e.g. the operating system) + - Software - device can have multiple modules of that type (e.g. "Apps") Software Content Definition: - Distribution Set: can be deployed to a provisioning target - Software Module: is a sub element of the distribution, e.g. OS, application, firmware X, firmware Y -- Artifact: binaries for a software module. Note: the decision which artifacts have to be downloaded are done on the device side, e.g. Full package, signatures, binary deltas - +- Artifact: binaries for a software module. Note: the decision which artifacts have to be downloaded are done on the + device side, e.g. Full package, signatures, binary deltas ## Entity Relationships + The public defined entities and their relation which are reflected by the Management API. - - ## Deleting and Archiving Software Modules -When a user deletes a Software Module, the update server cannot simply remove all the corresponding data. Because when the Software Module is already assigned to a Distribution Set or was assigned to a Target in the past, the hawkBit server has to make sure that remains a clean and full update history for every target. The history contains all information (e.g. name, version) of the software, which was assigned to a specific Target. Obviously storing the binary data of the artifacts is not necessary for the history purpose. -The delete process which is performed, when there are historical connections to targets is called SoftDelete. This process marks the Software Module as deleted and removes the artifact, but it won't delete the meta data, which describes the SoftwareModule and the associated Artifacts. SoftwareModules, which are marked as delete won't be visible for the user, when he is requesting all SoftwareModules. +When a user deletes a Software Module, the update server cannot simply remove all the corresponding data. Because when +the Software Module is already assigned to a Distribution Set or was assigned to a Target in the past, the hawkBit +server has to make sure that remains a clean and full update history for every target. The history contains all +information (e.g. name, version) of the software, which was assigned to a specific Target. Obviously storing the binary +data of the artifacts is not necessary for the history purpose. -Just in case there are no connections to Distribution Sets and targets the server will perform a HardDelete. This process deletes all stored data, including all meta information. +The delete process which is performed, when there are historical connections to targets is called SoftDelete. This +process marks the Software Module as deleted and removes the artifact, but it won't delete the meta data, which +describes the SoftwareModule and the associated Artifacts. SoftwareModules, which are marked as delete won't be visible +for the user, when he is requesting all SoftwareModules. + +Just in case there are no connections to Distribution Sets and targets the server will perform a HardDelete. This +process deletes all stored data, including all meta information. {{% note %}} -In case of a SoftDelete the unique constraints are still in place, i.e. you cannot create an entity with the same name/key. This constraint might be removed in future versions because of the impact on the user experience (i.e. he does not see the soft deleted module but cannot create a new one). +In case of a SoftDelete the unique constraints are still in place, i.e. you cannot create an entity with the same +name/key. This constraint might be removed in future versions because of the impact on the user experience (i.e. he does +not see the soft deleted module but cannot create a new one). {{% /note %}} \ No newline at end of file diff --git a/site/content/concepts/rollout-management.md b/site/content/concepts/rollout-management.md index a809aeaac..936d48779 100644 --- a/site/content/concepts/rollout-management.md +++ b/site/content/concepts/rollout-management.md @@ -12,9 +12,9 @@ That includes: - _Technical Scalability_ by means of horizontal scale of the hawkBit server cluster in the cloud. - _Global_ artifact _content delivery_ capacities. - _Functional Scalability_ by means of: - - Secure handling of large volumes of devices at rollout creation time. - - Monitoring of the rollout progress. - - Emergency rollout shutdown in case of problems on to many devices. + - Secure handling of large volumes of devices at rollout creation time. + - Monitoring of the rollout progress. + - Emergency rollout shutdown in case of problems on to many devices. - Reporting capabilities for a complete understanding of the rollout progress at each point in time. @@ -23,44 +23,58 @@ Eclipse hawkBit sees these capabilities under the term Rollout Management. The following capabilities are currently supported by the _Rollout Management_: - Create, update and start of rollouts. - - Selection of targets as input for the rollout based on _target filter_ functionality. - - Selection of a _DistributionSet_. - - Auto-splitting of the input target list into a defined number deployment groups. + - Selection of targets as input for the rollout based on _target filter_ functionality. + - Selection of a _DistributionSet_. + - Auto-splitting of the input target list into a defined number deployment groups. - Approval workflow - - Has to be enabled explicitly in configuration. - - Enables a workflow that requires a user with adequate permissions to review any new or updated rollout before it - can be started. - - Allows integration with 3rd party workflow engines. - + - Has to be enabled explicitly in configuration. + - Enables a workflow that requires a user with adequate permissions to review any new or updated rollout before it + can be started. + - Allows integration with 3rd party workflow engines. + - Cascading start of the deployment groups based on installation status of the previous group. - Emergency shutdown of the rollout in case a group exceeds the defined error threshold. - Rollout progress monitoring for the entire rollout and the individual groups. - ## Cascading Deployment Group Execution + The cascading execution of the deployment groups is based on two thresholds that can be defined by the rollout creator. + - success condition by means of percentage of successfully installed targets in the current groups triggers. -- error condition by means of absolute or percentage of failed installations which triggers an emergency shutdown of the entire rollout. +- error condition by means of absolute or percentage of failed installations which triggers an emergency shutdown of the + entire rollout. ## Rollout state machine ### State Machine on Rollout + ![](../../images/rolloutstatediagram.png) ### State Machine on Rollout Deployment Group + ![](../../images/rolloutgroupstatediagram.png) ## Multi-Assignments (beta) -One of the main paradigms of Eclipse hawkBit is, that a Distribution Set represents the currently installed software of a device. Hence, a device can have only one Distribution Set assigned/installed at a time. With _Multi-Assignments_ enabled, this paradigm shifts. Multi-Assignments allows to assign multiple Distribution Sets to a device simultaneously, without cancelling each other. As a consequence, an operator can trigger multiple campaigns addressing the same devices in parallel. +One of the main paradigms of Eclipse hawkBit is, that a Distribution Set represents the currently installed software of +a device. Hence, a device can have only one Distribution Set assigned/installed at a time. With _Multi-Assignments_ +enabled, this paradigm shifts. Multi-Assignments allows to assign multiple Distribution Sets to a device simultaneously, +without cancelling each other. As a consequence, an operator can trigger multiple campaigns addressing the same devices +in parallel. ### Action weight -To differentiate between important and less important updates a property called _weight_ is used. When multi-assignments is enabled every action has a weight value between (and including) 0 and 1000. The higher the weight the more important is the assignment represented by the action. Also when defining a _rollout_ or an _auto-assignment_ and multi-assignments is enabled a weight value has to be provided. This value is passed to the actions created during the execution of these _rollouts_ and _auto-assignments_. If no weight was provided the highest value of 1000 is used instead. +To differentiate between important and less important updates a property called _weight_ is used. When multi-assignments +is enabled every action has a weight value between (and including) 0 and 1000. The higher the weight the more important +is the assignment represented by the action. Also when defining a _rollout_ or an _auto-assignment_ and +multi-assignments is enabled a weight value has to be provided. This value is passed to the actions created during the +execution of these _rollouts_ and _auto-assignments_. If no weight was provided the highest value of 1000 is used +instead. ### Consequences -While this feature provides more flexibility to the user and enables new use-cases, there are also some consequences one should be aware of: +While this feature provides more flexibility to the user and enables new use-cases, there are also some consequences one +should be aware of: **Critical** @@ -69,9 +83,12 @@ While this feature provides more flexibility to the user and enables new use-cas **Minor** -* While on DMF-API a MULTI_ACTION request is sent, DDI-API only exposes the next action which has the highest priority in the list of open actions(according to their weight property). -* All information regarding the currently assigned or installed Distribution Set does only respect the last assignment, as well as the last successfully installed Distribution set. This also affects: +* While on DMF-API a MULTI_ACTION request is sent, DDI-API only exposes the next action which has the highest priority + in the list of open actions(according to their weight property). +* All information regarding the currently assigned or installed Distribution Set does only respect the last assignment, + as well as the last successfully installed Distribution set. This also affects: * Pinning a target or Distribution Set in Deployment View. * Statistics about installed or assigned Distribution Sets. -* Auto close running actions, when a new Distribution Set is assigned (`repository.actions.autoclose.enabled`) is deactivated. +* Auto close running actions, when a new Distribution Set is assigned (`repository.actions.autoclose.enabled`) is + deactivated. * Marking a Distribution Set to be a *Required Migration Step* is deactivated. \ No newline at end of file diff --git a/site/content/concepts/targetstate.md b/site/content/concepts/targetstate.md index fab899a87..2544f2c4d 100644 --- a/site/content/concepts/targetstate.md +++ b/site/content/concepts/targetstate.md @@ -4,7 +4,10 @@ parent: Concepts weight: 55 --- -A target has a current state which reflects the provisioning status of the device at this point in time. State changes are driven either by the update server by means of starting an update or by the controller on the provisioning target that gives feedback to the update server, e.g. "I am here", "I am working on a provisioning", "I have finished a provisioning". +A target has a current state which reflects the provisioning status of the device at this point in time. State changes +are driven either by the update server by means of starting an update or by the controller on the provisioning target +that gives feedback to the update server, e.g. "I am here", "I am working on a provisioning", "I have finished a +provisioning". ## Defined states @@ -18,4 +21,5 @@ A target has a current state which reflects the provisioning status of the devic | REGISTERED | Target registered at the update server but no _Distribution Set_ assigned. Is the initial starting point for plug-and-play devices. | ## Transitions + ![](../../images/architecture/targetStatusStates.png) diff --git a/site/content/features.md b/site/content/features.md index 94c75bcce..ec77de0d8 100644 --- a/site/content/features.md +++ b/site/content/features.md @@ -3,30 +3,35 @@ title: Features weight: 40 --- - ## Device and Software Repository + - Repository that holds the provisioning targets and assignable software distributions. - Targets to be logically grouped by Target Types. - That includes a full software update history for every device. -- Support for pre-commission devices in the repository and plug and play, i.e. device is created if it is authenticated for the first time. +- Support for pre-commission devices in the repository and plug and play, i.e. device is created if it is authenticated + for the first time. ## Update Management + - Directly deploy a defined software distribution to a device (by Management API). - Update handling is independent of the device type, integration approach or connectivity. -- Optional user consent flow, download and install updates only after respective end user has confirmed it. +- Optional user consent flow, download and install updates only after respective end user has confirmed it. - Mass cancel the distribution of an update by invalidating the distribution set. - Use action status codes for easier analysis. ## Artifact Content Delivery + - Partial downloads supported. - Download resume supported (RFC7233). - Content management by RESTful API and UI (see above). -- Authorization based on software assignment, i.e. a device can only download what has been assigned to it in the first place. +- Authorization based on software assignment, i.e. a device can only download what has been assigned to it in the first + place. - Delta artifact hosting supported. - Artifact signature hosting supported. - Plug-point for artifact encryption allowing to encrypt artifacts on upload. ## Rollout/Campaign Management + - Secure handling of large volumes of devices at rollout creation time. - Flexible deployment group definition as part of a rollout. - Monitoring of the rollout progress. @@ -36,6 +41,7 @@ weight: 40 ## Interfaces ### Management API + - RESTful API - Create/Read/Update/Delete operations for provisioning targets (i.e. devices) and repository content (i.e. software). - Manage and monitor software update operations. @@ -44,6 +50,7 @@ weight: 40 - Supports filtering, sorting and paging. ### Direct Device Integration API + - RESTful HTTP based API for direct device integration - JSON payload. - Traffic optimized (content based Etag generation, not modified). @@ -51,7 +58,9 @@ weight: 40 - TLS encryption. ### Device Management Federation API + - Indirect device integration through a device management service or application into hawkBit. -- Optimized for high service to service throughput with [AMQP](https://www.rabbitmq.com/amqp-0-9-1-reference.html) messaging interface. +- Optimized for high service to service throughput with [AMQP](https://www.rabbitmq.com/amqp-0-9-1-reference.html) + messaging interface. - Separate AMQP vHost per tenant for maximum security. diff --git a/site/content/gettingstarted.md b/site/content/gettingstarted.md index 3b874b034..640c2e0d6 100755 --- a/site/content/gettingstarted.md +++ b/site/content/gettingstarted.md @@ -16,17 +16,20 @@ any personal data. In addition, the following vendors offer free trial accounts for their Eclipse hawkBit compatible products: -* [Bosch IoT Rollouts](https://bosch-iot-suite.com/service/rollouts/) (by [Bosch Digital](https://www.bosch-digital.com)) +* [Bosch IoT Rollouts](https://bosch-iot-suite.com/service/rollouts/) ( + by [Bosch Digital](https://www.bosch-digital.com)) * [Kynetics Update Factory](https://www.kynetics.com/update-factory) (by [Kynetics LLC](https://www.kynetics.com/)) - ## From Docker Image ### Overview -HawkBit Update Server username/password -> admin/admin as default login credentials. They can be overridden by the environment variables spring.security.user.name and spring.security.user.password which are defined in the corresponding default [application.properties](hawkbit-runtime/hawkbit-update-server/src/main/resources/application.properties). +HawkBit Update Server username/password -> admin/admin as default login credentials. They can be overridden by the +environment variables spring.security.user.name and spring.security.user.password which are defined in the corresponding +default [application.properties](hawkbit-runtime/hawkbit-update-server/src/main/resources/application.properties). It supports two configurations: + * monolith - hawkbit-update-server * micro-service - hawkbit-mgmt-server, hawkbit-ddi-server, hawkbit-dmf-server. @@ -61,6 +64,7 @@ $ docker-compose -f docker-compose-micro-service-mysql.yml up -d ## From Sources ### 1: Clone and build hawkBit + ```sh $ git clone https://github.com/eclipse-hawkbit/hawkbit.git $ cd hawkbit @@ -82,6 +86,7 @@ $ mvn clean install ``` ### 4: Start hawkBit [Device Simulator](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-device-simulator) + ```sh $ java -jar ./hawkbit-device-simulator/target/hawkbit-device-simulator-#version#.jar ``` diff --git a/site/content/guides/clustering.md b/site/content/guides/clustering.md index 4c21fdd79..d031d4c2a 100644 --- a/site/content/guides/clustering.md +++ b/site/content/guides/clustering.md @@ -4,7 +4,9 @@ parent: Guides weight: 33 --- -hawkBit is able to run in a cluster with some constraints. This guide provides insights in the basic concepts and how to setup your own cluster. You can find additional information in the [hawkBit runtimes's README](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-runtime/hawkbit-update-server/README.md). +hawkBit is able to run in a cluster with some constraints. This guide provides insights in the basic concepts and how to +setup your own cluster. You can find additional information in +the [hawkBit runtimes's README](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-runtime/hawkbit-update-server/README.md). ## Big picture @@ -13,8 +15,13 @@ hawkBit is able to run in a cluster with some constraints. This guide provides i ## Events -Event communication between nodes is based on [Spring Cloud Bus](https://cloud.spring.io/spring-cloud-bus/) and [Spring Cloud Stream](http://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/). There are different [binder implementations](http://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/#_binders) available. The _hawkbit Update Server_ uses RabbitMQ binder. Every node gets his own queue to receive cluster events, the default payload is JSON. -If an event is thrown locally at one node, it will be automatically delivered to all other available nodes via the Spring Cloud Bus's topic exchange: +Event communication between nodes is based on [Spring Cloud Bus](https://cloud.spring.io/spring-cloud-bus/) +and [Spring Cloud Stream](http://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/). There are +different [binder implementations](http://docs.spring.io/spring-cloud-stream/docs/current/reference/htmlsingle/#_binders) +available. The _hawkbit Update Server_ uses RabbitMQ binder. Every node gets his own queue to receive cluster events, +the default payload is JSON. +If an event is thrown locally at one node, it will be automatically delivered to all other available nodes via the +Spring Cloud Bus's topic exchange: ![](../../images/eventing-within-cluster.png) @@ -23,16 +30,25 @@ Via the ServiceMatcher you can check whether an event happened locally at one no ## Caching -Every node is maintaining its own caches independent from other nodes. So there is no globally shared/synchronized cache instance within the cluster. In order to keep nodes in sync a TTL (time to live) can be set for all caches to ensure that after some time the cache is refreshed from the database. To enable the TTL just set the property "hawkbit.cache.global.ttl" (value in milliseconds). Of course you can implement a shared cache, e.g. Redis. +Every node is maintaining its own caches independent from other nodes. So there is no globally shared/synchronized cache +instance within the cluster. In order to keep nodes in sync a TTL (time to live) can be set for all caches to ensure +that after some time the cache is refreshed from the database. To enable the TTL just set the property " +hawkbit.cache.global.ttl" (value in milliseconds). Of course you can implement a shared cache, e.g. Redis. See [CacheAutoConfiguration](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/cache/CacheAutoConfiguration.java) ## Schedulers -Every node has multiple schedulers which run after a defined period of time. All schedulers always run on every node. This has to be kept in mind e.g. if the scheduler executes critical code which has to be executed only once. +Every node has multiple schedulers which run after a defined period of time. All schedulers always run on every node. +This has to be kept in mind e.g. if the scheduler executes critical code which has to be executed only once. ## Known constraints ### Denial-of-Service (DoS) filter -hawkBit owns the feature of guarding itself from DoS attacks, a [DoS filter](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-http-security/src/main/java/org/eclipse/hawkbit/security/DosFilter.java). It reduces the maximum number of requests per seconds which can be configured for read and write requests. -This mechanism is only working for every node separately, i.e. in a cluster environment the worst-case behaviour would be that the maximum number of requests per seconds will be increased to its product if every request is handled by a different node. + +hawkBit owns the feature of guarding itself from DoS attacks, +a [DoS filter](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-http-security/src/main/java/org/eclipse/hawkbit/security/DosFilter.java). +It reduces the maximum number of requests per seconds which can be configured for read and write requests. +This mechanism is only working for every node separately, i.e. in a cluster environment the worst-case behaviour would +be that the maximum number of requests per seconds will be increased to its product if every request is handled by a +different node. The same constraint exists with the validator to check if a user tried too many logins within a defined period of time. diff --git a/site/content/guides/feignclient.md b/site/content/guides/feignclient.md index 15102087d..10b3fd3a6 100644 --- a/site/content/guides/feignclient.md +++ b/site/content/guides/feignclient.md @@ -4,18 +4,31 @@ parent: Guides weight: 32 --- -In this guide we describe how to create a [Feign](https://github.com/Netflix/feign) Rest Client based on a [Spring Boot](http://projects.spring.io/spring-boot/) Application. +In this guide we describe how to create a [Feign](https://github.com/Netflix/feign) Rest Client based on +a [Spring Boot](http://projects.spring.io/spring-boot/) Application. ## Create Feign REST Client -hawkBit provides REST interfaces for [Management API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-ddi-api) and [DDI API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-ddi-api). Using this interfaces you can create a feign client with the help of the [feign inheritance support](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance). -Our [example](https://github.com/eclipse-hawkbit/hawkbit-examples) modules demonstrate how to create [Feign](https://github.com/Netflix/feign) client resources. Here you can find the [Management API client resources](hhttps://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-mgmt-feign-client) and the [DDI client resources](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-ddi-feign-client). -A small [simulator application](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-mgmt-simulator) demonstrates how you can interact with the hawkBit via the [Management API -](http://www.eclipse.org/hawkbit/documentation/interfaces/management-api.html). + +hawkBit provides REST interfaces +for [Management API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-ddi-api) +and [DDI API](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkbit-ddi-api). Using this interfaces you can +create a feign client with the help of +the [feign inheritance support](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance). +Our [example](https://github.com/eclipse-hawkbit/hawkbit-examples) modules demonstrate how to +create [Feign](https://github.com/Netflix/feign) client resources. Here you can find +the [Management API client resources](hhttps://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-mgmt-feign-client) +and +the [DDI client resources](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-ddi-feign-client). +A +small [simulator application](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-mgmt-simulator) +demonstrates how you can interact with the hawkBit via the [Management API +](http://www.eclipse.org/hawkbit/documentation/interfaces/management-api.html). ## Example Management API simulator -In the follow code section, you can a see a feign client resource example. The interface extend the origin api interface to declare the `@FeignClient`. The `@FeignClient`declares that a REST client with that interface should be created. +In the follow code section, you can a see a feign client resource example. The interface extend the origin api interface +to declare the `@FeignClient`. The `@FeignClient`declares that a REST client with that interface should be created. ```Java @FeignClient(url = "${hawkbit.url:localhost:8080}/" + MgmtRestConstants.TARGET_V1_REQUEST_MAPPING) @@ -40,7 +53,8 @@ public class CreateStartedRolloutExample { ``` -At [hawkbit-example-core-feign-client](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-core-feign-client) is a spring configuration to auto configure some beans, which can be reused for a own feign client. +At [hawkbit-example-core-feign-client](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-core-feign-client) +is a spring configuration to auto configure some beans, which can be reused for a own feign client. ```Java @Configuration diff --git a/site/content/guides/runhawkbit.md b/site/content/guides/runhawkbit.md index ecb0eac1e..70e5b897a 100644 --- a/site/content/guides/runhawkbit.md +++ b/site/content/guides/runhawkbit.md @@ -4,12 +4,14 @@ parent: Guides weight: 31 --- -In this guide we describe how to run a full featured hawkBit setup based on a production ready infrastructure. It is based on the hawkBit example modules and update server. +In this guide we describe how to run a full featured hawkBit setup based on a production ready infrastructure. It is +based on the hawkBit example modules and update server. {{% note %}} -The update server can in fact be run stand alone. However, only with an embedded H2, no Device Management Federation API and no artifact storage. +The update server can in fact be run stand alone. However, only with an embedded H2, no Device Management Federation API +and no artifact storage. {{% /note %}} ## System Architecture @@ -30,7 +32,8 @@ This guide describes a target architecture that is more like one that you will e ## Adapt hawkBit Update Server and Device Simulator to your environment. -As mentioned you can create your own application with hawkBit inside or adapt the existing example app. The second option will be shown here. +As mentioned you can create your own application with hawkBit inside or adapt the existing example app. The second +option will be shown here. ### Set MariaDB dependency to compile in the [update server POM](https://github.com/eclipse-hawkbit/hawkbit/blob/master/hawkbit-runtime/hawkbit-update-server/pom.xml) @@ -44,7 +47,8 @@ As mentioned you can create your own application with hawkBit inside or adapt th ### Configure MariaDB/MySQL connection settings. -For this you can either edit the existing _application.properties_ or create a [new profile](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config-profile-specific-properties). +For this you can either edit the existing _application.properties_ or create +a [new profile](http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config-profile-specific-properties). ```properties spring.jpa.database=MYSQL @@ -54,12 +58,15 @@ spring.datasource.password=YOUR_PWD spring.datasource.driverClassName=org.mariadb.jdbc.Driver ``` -Note: On Ubuntu 18.04 with MariaDB 10.1 installed from the default repository via apt install _COLLATE option_ of database have to be changed manually to "latin1". -For recent versions of MariaDB running on Ubuntu this is not required (cf. [system variables](https://mariadb.com/kb/en/differences-in-mariadb-in-debian-and-ubuntu), [issue](https://github.com/eclipse-hawkbit/hawkbit/issues/963)) +Note: On Ubuntu 18.04 with MariaDB 10.1 installed from the default repository via apt install _COLLATE option_ of +database have to be changed manually to "latin1". +For recent versions of MariaDB running on Ubuntu this is not required ( +cf. [system variables](https://mariadb.com/kb/en/differences-in-mariadb-in-debian-and-ubuntu), [issue](https://github.com/eclipse-hawkbit/hawkbit/issues/963)) ### Configure RabbitMQ connection settings for update server and device simulator (optional). -We provide already defaults that should work with a standard Rabbit installation. Otherwise configure the following in the `application.properties` of the two services: +We provide already defaults that should work with a standard Rabbit installation. Otherwise configure the following in +the `application.properties` of the two services: ```properties spring.rabbitmq.username=guest @@ -93,9 +100,11 @@ see [update server](https://github.com/eclipse-hawkbit/hawkbit/tree/master/hawkb ### Compile & Run example scenario [creation script](https://github.com/eclipse-hawkbit/hawkbit-examples/tree/master/hawkbit-example-mgmt-simulator) (optional) -This has to be done before the device simulator is started. hawkBit creates the mandatory tenant metadata with first login into either Management API (which is done by this client). +This has to be done before the device simulator is started. hawkBit creates the mandatory tenant metadata with first +login into either Management API (which is done by this client). -However, this is not done by _DMF_ which is in fact used by the device simulator, i.e. without calling _Management API_ first hawkBit would drop all _DMF_ messages as the tenant is unknown. +However, this is not done by _DMF_ which is in fact used by the device simulator, i.e. without calling _Management API_ +first hawkBit would drop all _DMF_ messages as the tenant is unknown. ### Compile & Run device simulator (optional) diff --git a/site/content/release-notes.md b/site/content/release-notes.md index 2971b25aa..89ca1ccb8 100755 --- a/site/content/release-notes.md +++ b/site/content/release-notes.md @@ -28,25 +28,24 @@ Extensions: [Tag](https://github.com/eclipse-hawkbit/hawkbit-extensions/releases **Release Date:** Thursday, August 24, 2023
Hawkbit: [Tag](https://github.com/eclipse-hawkbit/hawkbit/releases/tag/0.3.0M9) / - [Release](https://github.com/eclipse-hawkbit/hawkbit/milestone/24)
+[Release](https://github.com/eclipse-hawkbit/hawkbit/milestone/24)
Extensions: [Tag](https://github.com/eclipse-hawkbit/hawkbit-extensions/releases/tag/0.3.0M9) ## 0.3.0M8 **Release Date:** Friday, April 21, 2023
Hawkbit: [Tag](https://github.com/eclipse-hawkbit/hawkbit/releases/tag/0.3.0M8) / - [Release](https://github.com/eclipse-hawkbit/hawkbit/milestone/23)
+[Release](https://github.com/eclipse-hawkbit/hawkbit/milestone/23)
Extensions: [Tag](https://github.com/eclipse-hawkbit/hawkbit-extensions/releases/tag/0.3.0M8) / - [Release](https://github.com/eclipse-hawkbit/hawkbit-extensions/milestone/2) - +[Release](https://github.com/eclipse-hawkbit/hawkbit-extensions/milestone/2) ## 0.3.0M7 **Release Date:** Monday, February 15, 2021
Hawkbit: [Tag](https://github.com/eclipse-hawkbit/hawkbit/releases/tag/0.3.0M7) / - [Release](https://github.com/eclipse-hawkbit/hawkbit/milestone/22?closed=1)
+[Release](https://github.com/eclipse-hawkbit/hawkbit/milestone/22?closed=1)
Extensions: [Tag](https://github.com/eclipse-hawkbit/hawkbit-extensions/releases/tag/0.3.0M7) / - [Release](https://github.com/eclipse-hawkbit/hawkbit-extensions/milestone/1?closed=1) +[Release](https://github.com/eclipse-hawkbit/hawkbit-extensions/milestone/1?closed=1) ## 0.3.0M6 @@ -114,20 +113,19 @@ Extensions: [Tag](https://github.com/eclipse-hawkbit/hawkbit-extensions/releases [Tag](https://github.com/eclipse-hawkbit/hawkbit/releases/tag/0.2.1) / [Release](https://github.com/eclipse-hawkbit/hawkbit/milestone/9?closed=1) - ## 0.2.0 First Eclipse hawkBit release including: * **Core features:** - * Device and Software Repository - * Artifact Content Delivery - * Rollout/Campaign Management + * Device and Software Repository + * Artifact Content Delivery + * Rollout/Campaign Management * **Interfaces:** - * Management API - * Direct Device Integration (DDI) API - * Device Management Federation (DMF) API + * Management API + * Direct Device Integration (DDI) API + * Device Management Federation (DMF) API **Release Date:** Friday, June 15, 2018
[Tag](https://github.com/eclipse-hawkbit/hawkbit/releases/tag/0.2.0) / diff --git a/site/content/whatishawkbit.md b/site/content/whatishawkbit.md index c1b091fdb..6d96d8ed6 100755 --- a/site/content/whatishawkbit.md +++ b/site/content/whatishawkbit.md @@ -2,37 +2,73 @@ title: What is hawkBit? weight: 10 --- -Eclipse hawkBit™ is a domain-independent back-end framework for rolling out software updates to constrained edge devices as well as more powerful controllers and gateways connected to IP based networking infrastructure. + +Eclipse hawkBit™ is a domain-independent back-end framework for rolling out software updates to constrained edge +devices as well as more powerful controllers and gateways connected to IP based networking infrastructure. ![](../images/hawkbit_logo.png) ## Why Software Updates in IoT? -Having software update capabilities ensures a secure IoT by means that it gives IoT projects a fighting chance against pandora's box that they opened the moment their devices got connected. From that moment on devices are at the forefront of IT security threats many embedded software developers historically never had to face. Shipping for instance a Linux powered device connected to the Internet without any security updates ever applied during its lifetime is kind of a suicidal act these days. -A more charming argument for software update is that it enables agile development for hardware and hardware near development. Concepts like a minimum viable product can be applied for devices as not all features need to be ready at manufacturing time. Changes on the cloud side of the IoT project can be applied to the devices at runtime as well. +Having software update capabilities ensures a secure IoT by means that it gives IoT projects a fighting chance against +pandora's box that they opened the moment their devices got connected. From that moment on devices are at the forefront +of IT security threats many embedded software developers historically never had to face. Shipping for instance a Linux +powered device connected to the Internet without any security updates ever applied during its lifetime is kind of a +suicidal act these days. -Sometimes Software Update is a business model on its own as it makes devices much more attractive to the customer if they are updatable, i.e. they do not only buy a product because of its current feature set but make also a bet on its future capabilities. In addition new revenue streams may arise from the fact that feature extensions can potentially be monetized (e.g. Apps) without the need to design, manufacture and ship a new device (revision). +A more charming argument for software update is that it enables agile development for hardware and hardware near +development. Concepts like a minimum viable product can be applied for devices as not all features need to be ready at +manufacturing time. Changes on the cloud side of the IoT project can be applied to the devices at runtime as well. + +Sometimes Software Update is a business model on its own as it makes devices much more attractive to the customer if +they are updatable, i.e. they do not only buy a product because of its current feature set but make also a bet on its +future capabilities. In addition new revenue streams may arise from the fact that feature extensions can potentially be +monetized (e.g. Apps) without the need to design, manufacture and ship a new device (revision). ## Why hawkBit? -**Updating software** (components) on constrained edge devices as well as more powerful controllers and gateways is as mentioned before a **common requirement** in most IoT scenarios. +**Updating software** (components) on constrained edge devices as well as more powerful controllers and gateways is as +mentioned before a **common requirement** in most IoT scenarios. -At the time being, this process is **usually handled by the IoT solution itself**, sometimes backed by a full fledged device management system. We believe that this approach generates unnecessary **duplicate work** in the IoT space, in particular when considering the challenges of implementing a safe and reliable remote software update process: the software update process must never fail and also must never be compromised as, at the one hand, it can be used to fix almost any issue/problem on the device but at the same time also poses the greatest security threat if mis-used to introduce malicious code to the device. +At the time being, this process is **usually handled by the IoT solution itself**, sometimes backed by a full fledged +device management system. We believe that this approach generates unnecessary **duplicate work** in the IoT space, in +particular when considering the challenges of implementing a safe and reliable remote software update process: the +software update process must never fail and also must never be compromised as, at the one hand, it can be used to fix +almost any issue/problem on the device but at the same time also poses the greatest security threat if mis-used to +introduce malicious code to the device. -In addition we believe the software update process to be relatively **independent from particular application domains** when seen from the back-end (cloud) perspective. Updating the software for an entire car may differ from updating the firmware of a single sensor with regard to the connectivity of the device to the cloud and also to the complexity of the software package update process on the device. However, the process of rolling out the software, e.g. uploading an artifact to the repository, assigning it to eligible devices, managing the roll out campaign for a large number of devices, orchestrating content delivery networks to distribute the package, monitoring and reporting the progress of the roll-out and last but not least requirements regarding security and reliability are quite similar. +In addition we believe the software update process to be relatively **independent from particular application domains** +when seen from the back-end (cloud) perspective. Updating the software for an entire car may differ from updating the +firmware of a single sensor with regard to the connectivity of the device to the cloud and also to the complexity of the +software package update process on the device. However, the process of rolling out the software, e.g. uploading an +artifact to the repository, assigning it to eligible devices, managing the roll out campaign for a large number of +devices, orchestrating content delivery networks to distribute the package, monitoring and reporting the progress of the +roll-out and last but not least requirements regarding security and reliability are quite similar. -Software update itself is often seen as a sub process of general device management. In fact, most device management systems include functionality for triggering groups of devices to perform an update, usually accompanied by an artifact repository and basic reporting and monitoring capabilities. This is true for both systems specifically targeting IoT as well as systems originating from the mobile area. +Software update itself is often seen as a sub process of general device management. In fact, most device management +systems include functionality for triggering groups of devices to perform an update, usually accompanied by an artifact +repository and basic reporting and monitoring capabilities. This is true for both systems specifically targeting IoT as +well as systems originating from the mobile area. -Existing **device management systems** usually **lack** the capability to **efficiently organize roll outs at IoT scale**, e.g. splitting the roll out into sub groups, cascading them, automatically stopping the roll out after a defined error threshold etc. They are also usually restricted to a single device management protocol, either a proprietary one or one of the existing standard protocols like LWM2M, OMA-DM or TR-069. Even if they support more than one such protocol, they are often a result of the device management protocol they started with and restricted in their adoption capabilities to others. +Existing **device management systems** usually **lack** the capability to **efficiently organize roll outs at IoT scale +**, e.g. splitting the roll out into sub groups, cascading them, automatically stopping the roll out after a defined +error threshold etc. They are also usually restricted to a single device management protocol, either a proprietary one +or one of the existing standard protocols like LWM2M, OMA-DM or TR-069. Even if they support more than one such +protocol, they are often a result of the device management protocol they started with and restricted in their adoption +capabilities to others. -At the same time the wide functional scope of a full fledged **device management system introduces unnecessary (and unwanted) complexity** to many IoT projects. This is particularly true for IoT solutions working with constrained devices where requirements regarding generic device management are often very limited only but a secure & reliable software update process is still mandatory. +At the same time the wide functional scope of a full fledged **device management system introduces unnecessary (and +unwanted) complexity** to many IoT projects. This is particularly true for IoT solutions working with constrained +devices where requirements regarding generic device management are often very limited only but a secure & reliable +software update process is still mandatory. As a result we have the need for a domain independent solution -* that works for the majority of IoT projects -* that goes beyond the pure update and handles more complex **roll out strategies** needed by large scale IoT projects. -* that at the same time is **focused on software updates** in the IoT space -* and that is able to work on its own for simple scenarios while having the capability to integrate with existing device management systems and protocols. +* that works for the majority of IoT projects +* that goes beyond the pure update and handles more complex **roll out strategies** needed by large scale IoT projects. +* that at the same time is **focused on software updates** in the IoT space +* and that is able to work on its own for simple scenarios while having the capability to integrate with existing device + management systems and protocols. ## Cloud Ready @@ -40,4 +76,5 @@ As a result we have the need for a domain independent solution * **Functional Scalability**: rollouts with hundreds of thousands of individual devices in it. * **Reliability**: software update as the last line of defense against device faults and vulnerabilities. * **Managed device complexity**: device topologies inside each individual provisioning target. -* **Integration flexibility**: connect and integrate through various (non-)standardized device management protocols directly or through federated device managements. \ No newline at end of file +* **Integration flexibility**: connect and integrate through various (non-)standardized device management protocols + directly or through federated device managements. \ No newline at end of file diff --git a/site/layouts/_default/list.html b/site/layouts/_default/list.html index cbaeb5f78..da0db6041 100755 --- a/site/layouts/_default/list.html +++ b/site/layouts/_default/list.html @@ -1,54 +1,54 @@ {{ partial "head" . }} {{ if (eq (trim .Site.Params.provider " " | lower) "github") | and (isset .Site.Params "repo_url") }} - {{ $repo_id := replace .Site.Params.repo_url "https://github.com/" ""}} - {{ .Scratch.Set "repo_id" $repo_id }} +{{ $repo_id := replace .Site.Params.repo_url "https://github.com/" ""}} +{{ .Scratch.Set "repo_id" $repo_id }} {{ end }}
-
+
- - + +
- {{ partial "header" . }} + {{ partial "header" . }}
-
- {{ partial "drawer" . }} -
+
+ {{ partial "drawer" . }} +
-
-
-

Pages in {{ .Title }}

+
+
+

Pages in {{ .Title }}

- {{ range .Data.Pages }} - -

{{ .Title }}

-
+ {{ range .Data.Pages }} + +

{{ .Title }}

+
-
- {{ printf "%s" .Summary | markdownify }}
[...] +
+ {{ printf "%s" .Summary | markdownify }}
[...] -
- {{ end }} +
+ {{ end }} - {{ partial "copyright.html" . }} -
-
+ {{ partial "copyright.html" . }} +
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
{{ partial "footer_js" . }} \ No newline at end of file diff --git a/site/layouts/_default/single.html b/site/layouts/_default/single.html index 76ea3f734..ab077869f 100755 --- a/site/layouts/_default/single.html +++ b/site/layouts/_default/single.html @@ -1,49 +1,49 @@ {{ partial "head" . }} {{ if (eq (trim .Site.Params.provider " " | lower) "github") | and (isset .Site.Params "repo_url") }} - {{ $repo_id := replace .Site.Params.repo_url "https://github.com/" ""}} - {{ .Scratch.Set "repo_id" $repo_id }} +{{ $repo_id := replace .Site.Params.repo_url "https://github.com/" ""}} +{{ .Scratch.Set "repo_id" $repo_id }} {{ end }}
-
+
- - + +
- {{ partial "header" . }} + {{ partial "header" . }}
-
- {{ partial "drawer" . }} -
+
+ {{ partial "drawer" . }} +
-
-
-

{{ .Title }} {{ if .Draft }} (Draft){{ end }}

+
+
+

{{ .Title }} {{ if .Draft }} (Draft){{ end }}

- {{ .Content }} + {{ .Content }} - {{ partial "copyright.html" . }} + {{ partial "copyright.html" . }} -
- {{ partial "footer" . }} -
-
-
+
+ {{ partial "footer" . }} +
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
{{ partial "footer_js" . }} diff --git a/site/layouts/index.html b/site/layouts/index.html index 5f32f511b..38fa0c7f4 100755 --- a/site/layouts/index.html +++ b/site/layouts/index.html @@ -1,16 +1,16 @@ {{ partial "head" . }} {{ if (eq (trim .Site.Params.provider " " | lower) "github") | and (isset .Site.Params "repo_url") }} - {{ $repo_id := replace .Site.Params.repo_url "https://github.com/" ""}} - {{ .Scratch.Set "repo_id" $repo_id }} +{{ $repo_id := replace .Site.Params.repo_url "https://github.com/" ""}} +{{ .Scratch.Set "repo_id" $repo_id }} {{ end }}
- - + +
@@ -34,7 +34,7 @@ edge devices as well as more powerful controllers and gateways connected to IP based networking infrastructure.

- +

Interfaces

hawkBit offers a direct device integration via HTTP or a device management federation API @@ -63,7 +63,7 @@



- +
@@ -71,7 +71,7 @@

- +
@@ -88,7 +88,7 @@
-
+
diff --git a/site/layouts/partials/copyright.html b/site/layouts/partials/copyright.html index 17aa964b2..e0cf20ed3 100755 --- a/site/layouts/partials/copyright.html +++ b/site/layouts/partials/copyright.html @@ -1,33 +1,33 @@ diff --git a/site/layouts/partials/drawer.html b/site/layouts/partials/drawer.html index 987b721d0..7ab5c4710 100755 --- a/site/layouts/partials/drawer.html +++ b/site/layouts/partials/drawer.html @@ -1,82 +1,89 @@ diff --git a/site/layouts/partials/footer_js.html b/site/layouts/partials/footer_js.html index 8087fb6e7..5dfe8cf5a 100755 --- a/site/layouts/partials/footer_js.html +++ b/site/layouts/partials/footer_js.html @@ -1,60 +1,87 @@ - + - - {{ range .Site.Params.custom_js }} - - {{ end }} + +{{ range .Site.Params.custom_js }} + +{{ end }} - + } + - - - + + + diff --git a/site/layouts/partials/head.html b/site/layouts/partials/head.html index dee409d69..2d355ffd8 100755 --- a/site/layouts/partials/head.html +++ b/site/layouts/partials/head.html @@ -1,83 +1,103 @@ - - - - - + + + + + + - + - - + + {{ .Title }}{{ if not .IsHome }} - {{ .Site.Title }}{{ end }} {{ hugo.Generator }} {{ with .Site.Params.description }} - + {{ end }} - + {{ with .Site.Params.author }} - + {{ end }} - - {{ with .Site.Title }}{{ end }} - {{ with .Site.Params.logo }}{{ end }} - {{ with .Site.Title }}{{ end }} - - + + {{ with .Site.Title }} + + {{ end }} + {{ with .Site.Params.logo }} + + {{ end }} + {{ with .Site.Title }} + + {{ end }} + + - {{ if .Params.redirectURL }}{{ end }} + {{ if .Params.redirectURL }} + + {{ end }} - - + + - - - - + + + + {{/* set default values if no custom ones are defined */}} {{ $text := or .Site.Params.font.text "Roboto" }} {{ $code := or .Site.Params.font.code "Roboto Mono" }} - + {{ range .Site.Params.custom_css }} - + {{ end }} - + {{ with .OutputFormats.Get "RSS" }} - - + + {{ end }} - - - + + + diff --git a/site/layouts/partials/header.html b/site/layouts/partials/header.html index 3929a8ee3..36a4df2ff 100755 --- a/site/layouts/partials/header.html +++ b/site/layouts/partials/header.html @@ -1,57 +1,62 @@ \ No newline at end of file diff --git a/site/layouts/partials/nav_link.html b/site/layouts/partials/nav_link.html index 2bdd8d0c4..fa7099a25 100755 --- a/site/layouts/partials/nav_link.html +++ b/site/layouts/partials/nav_link.html @@ -2,9 +2,9 @@ {{ $isCurrent := eq .Permalink ($currentMenuEntry.URL | absURL | printf "%s") }} - - {{ $currentMenuEntry.Pre }} - {{ $currentMenuEntry.Name }} + + {{ $currentMenuEntry.Pre }} + {{ $currentMenuEntry.Name }} {{ if $isCurrent }} diff --git a/site/pom.xml b/site/pom.xml index 42f6e8afa..3469463c0 100644 --- a/site/pom.xml +++ b/site/pom.xml @@ -9,145 +9,146 @@ SPDX-License-Identifier: EPL-2.0 --> - - 4.0.0 - - org.eclipse.hawkbit - hawkbit-parent - ${revision} - + + 4.0.0 + + org.eclipse.hawkbit + hawkbit-parent + ${revision} + - site - hawkBit :: Documentation - Documentation for hawkBit + site + hawkBit :: Documentation + Documentation for hawkBit - - 1.6.0 - + + 1.6.0 + - - - unix - - - !windows - - - - /bin/bash - - sh - - - - windows - - - windows - - - - cmd - /c - bat - - - + + + unix + + + !windows + + + + /bin/bash + + sh + + + + windows + + + windows + + + + cmd + /c + bat + + + - - - - org.codehaus.mojo - exec-maven-plugin - ${exec-maven-plugin.version} - - - build-htmls - - exec - - install - - ${shell} - ${project.basedir} - - ${shell.option} - build-htmls.${batch.ext} - - - - - install-hugo-theme - - exec - - install - - ${shell} - ${project.basedir} - - ${shell.option} - install-theme.${batch.ext} - - - - - serve - - exec - - site - - hugo - ${project.basedir} - - server - - - - - cleanup - - exec - - clean - - ${shell} - ${project.basedir} - - ${shell.option} - cleanup.${batch.ext} - - - - - - - + + + + org.codehaus.mojo + exec-maven-plugin + ${exec-maven-plugin.version} + + + build-htmls + + exec + + install + + ${shell} + ${project.basedir} + + ${shell.option} + build-htmls.${batch.ext} + + + + + install-hugo-theme + + exec + + install + + ${shell} + ${project.basedir} + + ${shell.option} + install-theme.${batch.ext} + + + + + serve + + exec + + site + + hugo + ${project.basedir} + + server + + + + + cleanup + + exec + + clean + + ${shell} + ${project.basedir} + + ${shell.option} + cleanup.${batch.ext} + + + + + + + - - - org.eclipse.hawkbit - hawkbit-boot-starter - ${project.version} - + + + org.eclipse.hawkbit + hawkbit-boot-starter + ${project.version} + - - - io.qameta.allure - allure-junit5 - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.eclipse.hawkbit - hawkbit-repository-test - ${project.version} - test - - + + + io.qameta.allure + allure-junit5 + test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.eclipse.hawkbit + hawkbit-repository-test + ${project.version} + test + + \ No newline at end of file diff --git a/site/src/main/java/org/eclipse/hawkbit/doc/Start.java b/site/src/main/java/org/eclipse/hawkbit/doc/Start.java index 4ea2ccb91..b5d684a7a 100644 --- a/site/src/main/java/org/eclipse/hawkbit/doc/Start.java +++ b/site/src/main/java/org/eclipse/hawkbit/doc/Start.java @@ -16,7 +16,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; /** * A {@link SpringBootApplication} annotated class with a main method to start. * The minimal configuration for the stand alone hawkBit server. - * */ @SpringBootApplication @EnableHawkbitManagedSecurityConfiguration @@ -27,8 +26,7 @@ public class Start { /** * Main method to start the spring-boot application. * - * @param args - * the VM arguments. + * @param args the VM arguments. */ // Exception squid:S2095 - Spring boot standard behavior @SuppressWarnings({ "squid:S2095" }) diff --git a/site/src/test/java/org/eclipse/hawkbit/doc/RestApiDocTest.java b/site/src/test/java/org/eclipse/hawkbit/doc/RestApiDocTest.java index 8017e39f0..8e1af8ea5 100644 --- a/site/src/test/java/org/eclipse/hawkbit/doc/RestApiDocTest.java +++ b/site/src/test/java/org/eclipse/hawkbit/doc/RestApiDocTest.java @@ -34,8 +34,9 @@ import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -@ExtendWith({SharedSqlTestDatabaseExtension.class}) +@ExtendWith({ SharedSqlTestDatabaseExtension.class }) class RestApiDocTest { + private static final String MANAGEMENT_PREFIX = "mgmt"; private static final String DDI_PREFIX = "ddi"; private static final String TARGET_DIRECTORY = "content/rest-api/"; @@ -87,6 +88,7 @@ class RestApiDocTest { ((ObjectNode) rootNode).set("tags", modifiedTagsNode); } + private static void removePaths(final JsonNode rootNode, final boolean isMgmt) { final ObjectNode pathsNode = (ObjectNode) rootNode.get("paths"); final List fieldsToRemove = new ArrayList<>(); diff --git a/site/static/slides/community-day-2018.html b/site/static/slides/community-day-2018.html index f9c67b359..24c12a970 100644 --- a/site/static/slides/community-day-2018.html +++ b/site/static/slides/community-day-2018.html @@ -6,243 +6,275 @@ Eclipse hawkBit - + - - - + + + - - - + + + -
-
- -
-
-
-
-

Community Day - Eclipse hawkBit

-
EclipseCon Europe 2018
+
+
+ +
+
+
+
+

Community Day - Eclipse hawkBit

+
EclipseCon Europe 2018
+
+
+
+

Welcome...

+
+
+ +

Kai Zimmermann

+ Project Lead - Microsoft
-
-
-

Welcome...

-
-
- -

Kai Zimmermann

- Project Lead - Microsoft -
-
-
- -

Dominic Schabel

- Committer - Bosch -
+
+
+ +

Dominic Schabel

+ Committer - Bosch
-
-
-

About

-

- Eclipse hawkBit aims to create a domain independent back end solution for rolling out software - updates - to constrained edge devices as well as more powerful controllers and gateways connected to IP based - networking infrastructure -

-
-
-

Big picture

- -
-
-

Project update...

-
-
-

New team members

-
-
- -

Jeroen Laverman

- Project Lead - Bosch -
-
-
- -

Stefan Behl

- Committer - Bosch -
-
-
- -

Dominic Schabel

- Committer - Bosch -
+
+
+
+

About

+

+ Eclipse hawkBit aims to create a domain independent back end solution for rolling out software + updates + to constrained edge devices as well as more powerful controllers and gateways connected to IP based + networking infrastructure +

+
+
+

Big picture

+ +
+
+

Project update...

+
+
+

New team members

+
+
+ +

Jeroen Laverman

+ Project Lead - Bosch
-
-
-

Statistics (10/2018)

- -
-
-

We have been busy

- -
-
-

Roadmap...

-
-
-

Upgrades, upgrades

- -
-
-

Version overview

-
+ +

Stefan Behl

+ Committer - Bosch +
+
+
+ +

Dominic Schabel

+ Committer - Bosch +
+
+
+
+

Statistics (10/2018)

+ +
+
+

We have been busy

+ +
+
+

Roadmap...

+
+
+

Upgrades, upgrades

+ +
+
+

Version overview

+
-
hawkBit
-
 
-
Spring Boot
-
0.2.x
-
-
1.4
-
0.3.0
-
-
2.0
-
-
-
-

A few features as well

-
    -
  • Custom key/value pairs for targets (#737)
  • -
  • Small improvements of rollout management
  • -
-
-
-

Cloud PaaS extensions...

- -
-
-

Deprecations

-
We'll drop UAA extension support
-
-
-

Thank you

- -
-
+
hawkBit
+
 
+
Spring Boot
+
0.2.x
+
+
1.4
+
0.3.0
+
+
2.0
+
+ +
+

A few features as well

+
    +
  • Custom key/value pairs for targets (#737) +
  • +
  • Small improvements of rollout management
  • +
+
+
+

Cloud PaaS extensions...

+ +
+
+

Deprecations

+
We'll drop UAA extension support
+
+
+

Thank you

+ +
- - - +
+ + + - + Reveal.configure({ + slideNumber: true + }); + diff --git a/site/static/slides/community-day-2019.html b/site/static/slides/community-day-2019.html index bd51ef696..b62f6df37 100644 --- a/site/static/slides/community-day-2019.html +++ b/site/static/slides/community-day-2019.html @@ -16,225 +16,241 @@ Eclipse hawkBit - + - - - + + + - - - + + + -
-
- -
-
-
-
-

Community Day - Eclipse hawkBit

-
EclipseCon Europe 2019
+
+
+ +
+
+
+
+

Community Day - Eclipse hawkBit

+
EclipseCon Europe 2019
+
+
+
+

Welcome...

+
+
+ +

Kai Zimmermann

+ Project Lead - Microsoft
-
-
-

Welcome...

-
-
- -

Kai Zimmermann

- Project Lead - Microsoft -
-
-
- -

Jeroen Laverman

- Project Lead - Bosch -
+
+
+ +

Jeroen Laverman

+ Project Lead - Bosch
-
-
-

About

-

- Eclipse hawkBit aims to create a domain independent back end solution for rolling out - software - updates - to constrained edge devices as well as more powerful controllers and gateways connected to IP based - networking infrastructure -

-
-
-

Big picture

- -
-
-

Project update...

-
+
+
+
+

About

+

+ Eclipse hawkBit aims to create a domain independent back end solution for rolling out + software + updates + to constrained edge devices as well as more powerful controllers and gateways connected to IP based + networking infrastructure +

+
+
+

Big picture

+ +
+
+

Project update...

+
-
-

Statistics (10/2019)

- -
-
-

We have been busy

-
    -
  • Add Multi-User support (#829)
  • -
  • Introduce Multi-Assignments (#833)
  • -
  • Introduce new action-type DOWNLOAD_ONLY (#810)
  • -
  • Execute Auto-Assignments with different action-types (#789)
  • -
  • Introduce THING_REMOVED message on DMF-API (#891)
  • -
  • DDI-API supports SHA256 signature for artifacts (#869)
  • -
  • ... and many - smaller enhancements and bug fixes
  • -
-
+
+

Statistics (10/2019)

+ +
+
+

We have been busy

+
    +
  • Add Multi-User support (#829) +
  • +
  • Introduce Multi-Assignments (#833) +
  • +
  • Introduce new action-type DOWNLOAD_ONLY (#810) +
  • +
  • Execute Auto-Assignments with different action-types (#789) +
  • +
  • Introduce THING_REMOVED message on DMF-API (#891) +
  • +
  • DDI-API supports SHA256 signature for artifacts (#869) +
  • +
  • ... and many + smaller enhancements and bug fixes
  • +
+
-
-

Cloud support updates...

-
+ Resource Manager templates + +
  • More storage providers: Azure + Blob Storage, Google Cloud Storage +
  • + + + -
    -

    Roadmap...

    -
    -
    -

    Outlook

    - -
    +
    +

    Roadmap...

    +
    +
    +

    Outlook

    +
      +
    • Vaadin 8 (#880) +
    • +
    • Release 0.3.0 (#784) +
    • +
    • Prioritization of updates (#863) +
    • +
    • Integration with other device inventories (#796) +
    • +
    • Support of new Eclipse IoT Packages project +
    • +
    +
    - -
    -

    Thank you

    - -
    -
    +
    +

    Thank you

    + +
    - - - +
    + + + - + Reveal.configure({ + slideNumber: true + }); + diff --git a/site/static/slides/community-day-2020.html b/site/static/slides/community-day-2020.html index 7a8f774b1..7c2a2f936 100644 --- a/site/static/slides/community-day-2020.html +++ b/site/static/slides/community-day-2020.html @@ -16,170 +16,185 @@ Eclipse hawkBit - + - - - + + + - - - + + + -
    -
    - -
    -
    -
    -
    -

    Community Day - Eclipse hawkBit

    -
    EclipseCon Europe 2020
    -
    -
    -
    -

    About

    -

    - Eclipse hawkBit aims to create a domain independent back end solution for rolling out - software - updates - to constrained edge devices as well as more powerful controllers and gateways connected to IP based - networking infrastructure -

    -
    -
    -

    Big picture

    - -
    -
    -

    Statistics (10/2020)

    - -
    -
    -

    We have been busy

    - -
    - -
    -

    Current challenges and next steps

    -
      - -
    • Release 0.3.0 (#784)
    • -
    • Update from EPL-1.0 to EPL-2.0 (#1008)
    • -
    • Migrate hawkBit to Spring Boot 2.3.x (#999)
    • -
    • Integration with other device inventories (#796)
    • -
    -
    - - -
    -

    Thank you

    - -
    -
    +
    +
    +
    - + + + - + Reveal.configure({ + slideNumber: true + }); + diff --git a/site/static/slides/css/reveal.css b/site/static/slides/css/reveal.css index 33927531c..26e2f6c6e 100755 --- a/site/static/slides/css/reveal.css +++ b/site/static/slides/css/reveal.css @@ -21,118 +21,158 @@ html, body, .reveal div, .reveal span, .reveal applet, .reveal object, .reveal i .reveal figure, .reveal figcaption, .reveal footer, .reveal header, .reveal hgroup, .reveal menu, .reveal nav, .reveal output, .reveal ruby, .reveal section, .reveal summary, .reveal time, .reveal mark, .reveal audio, .reveal video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; } + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} .reveal article, .reveal aside, .reveal details, .reveal figcaption, .reveal figure, .reveal footer, .reveal header, .reveal hgroup, .reveal menu, .reveal nav, .reveal section { - display: block; } + display: block; +} /********************************************* * GLOBAL STYLES *********************************************/ html, body { - width: 100%; - height: 100%; - overflow: hidden; } + width: 100%; + height: 100%; + overflow: hidden; +} body { - position: relative; - line-height: 1; - background-color: #fff; - color: #000; } + position: relative; + line-height: 1; + background-color: #fff; + color: #000; +} /********************************************* * VIEW FRAGMENTS *********************************************/ .reveal .slides section .fragment { - opacity: 0; - visibility: hidden; - transition: all .2s ease; } - .reveal .slides section .fragment.visible { + opacity: 0; + visibility: hidden; + transition: all .2s ease; +} + +.reveal .slides section .fragment.visible { opacity: 1; - visibility: inherit; } + visibility: inherit; +} .reveal .slides section .fragment.grow { - opacity: 1; - visibility: inherit; } - .reveal .slides section .fragment.grow.visible { + opacity: 1; + visibility: inherit; +} + +.reveal .slides section .fragment.grow.visible { -webkit-transform: scale(1.3); - transform: scale(1.3); } + transform: scale(1.3); +} .reveal .slides section .fragment.shrink { - opacity: 1; - visibility: inherit; } - .reveal .slides section .fragment.shrink.visible { + opacity: 1; + visibility: inherit; +} + +.reveal .slides section .fragment.shrink.visible { -webkit-transform: scale(0.7); - transform: scale(0.7); } + transform: scale(0.7); +} .reveal .slides section .fragment.zoom-in { - -webkit-transform: scale(0.1); - transform: scale(0.1); } - .reveal .slides section .fragment.zoom-in.visible { + -webkit-transform: scale(0.1); + transform: scale(0.1); +} + +.reveal .slides section .fragment.zoom-in.visible { -webkit-transform: none; - transform: none; } + transform: none; +} .reveal .slides section .fragment.fade-out { - opacity: 1; - visibility: inherit; } - .reveal .slides section .fragment.fade-out.visible { + opacity: 1; + visibility: inherit; +} + +.reveal .slides section .fragment.fade-out.visible { opacity: 0; - visibility: hidden; } + visibility: hidden; +} .reveal .slides section .fragment.semi-fade-out { - opacity: 1; - visibility: inherit; } - .reveal .slides section .fragment.semi-fade-out.visible { + opacity: 1; + visibility: inherit; +} + +.reveal .slides section .fragment.semi-fade-out.visible { opacity: 0.5; - visibility: inherit; } + visibility: inherit; +} .reveal .slides section .fragment.strike { - opacity: 1; - visibility: inherit; } - .reveal .slides section .fragment.strike.visible { - text-decoration: line-through; } + opacity: 1; + visibility: inherit; +} + +.reveal .slides section .fragment.strike.visible { + text-decoration: line-through; +} .reveal .slides section .fragment.fade-up { - -webkit-transform: translate(0, 20%); - transform: translate(0, 20%); } - .reveal .slides section .fragment.fade-up.visible { + -webkit-transform: translate(0, 20%); + transform: translate(0, 20%); +} + +.reveal .slides section .fragment.fade-up.visible { -webkit-transform: translate(0, 0); - transform: translate(0, 0); } + transform: translate(0, 0); +} .reveal .slides section .fragment.fade-down { - -webkit-transform: translate(0, -20%); - transform: translate(0, -20%); } - .reveal .slides section .fragment.fade-down.visible { + -webkit-transform: translate(0, -20%); + transform: translate(0, -20%); +} + +.reveal .slides section .fragment.fade-down.visible { -webkit-transform: translate(0, 0); - transform: translate(0, 0); } + transform: translate(0, 0); +} .reveal .slides section .fragment.fade-right { - -webkit-transform: translate(-20%, 0); - transform: translate(-20%, 0); } - .reveal .slides section .fragment.fade-right.visible { + -webkit-transform: translate(-20%, 0); + transform: translate(-20%, 0); +} + +.reveal .slides section .fragment.fade-right.visible { -webkit-transform: translate(0, 0); - transform: translate(0, 0); } + transform: translate(0, 0); +} .reveal .slides section .fragment.fade-left { - -webkit-transform: translate(20%, 0); - transform: translate(20%, 0); } - .reveal .slides section .fragment.fade-left.visible { + -webkit-transform: translate(20%, 0); + transform: translate(20%, 0); +} + +.reveal .slides section .fragment.fade-left.visible { -webkit-transform: translate(0, 0); - transform: translate(0, 0); } + transform: translate(0, 0); +} .reveal .slides section .fragment.current-visible { - opacity: 0; - visibility: hidden; } - .reveal .slides section .fragment.current-visible.current-fragment { + opacity: 0; + visibility: hidden; +} + +.reveal .slides section .fragment.current-visible.current-fragment { opacity: 1; - visibility: inherit; } + visibility: inherit; +} .reveal .slides section .fragment.highlight-red, .reveal .slides section .fragment.highlight-current-red, @@ -140,109 +180,140 @@ body { .reveal .slides section .fragment.highlight-current-green, .reveal .slides section .fragment.highlight-blue, .reveal .slides section .fragment.highlight-current-blue { - opacity: 1; - visibility: inherit; } + opacity: 1; + visibility: inherit; +} .reveal .slides section .fragment.highlight-red.visible { - color: #ff2c2d; } + color: #ff2c2d; +} .reveal .slides section .fragment.highlight-green.visible { - color: #17ff2e; } + color: #17ff2e; +} .reveal .slides section .fragment.highlight-blue.visible { - color: #1b91ff; } + color: #1b91ff; +} .reveal .slides section .fragment.highlight-current-red.current-fragment { - color: #ff2c2d; } + color: #ff2c2d; +} .reveal .slides section .fragment.highlight-current-green.current-fragment { - color: #17ff2e; } + color: #17ff2e; +} .reveal .slides section .fragment.highlight-current-blue.current-fragment { - color: #1b91ff; } + color: #1b91ff; +} /********************************************* * DEFAULT ELEMENT STYLES *********************************************/ /* Fixes issue in Chrome where italic fonts did not appear when printing to PDF */ .reveal:after { - content: ''; - font-style: italic; } + content: ''; + font-style: italic; +} .reveal iframe { - z-index: 1; } + z-index: 1; +} /** Prevents layering issues in certain browser/transition combinations */ .reveal a { - position: relative; } + position: relative; +} .reveal .stretch { - max-width: none; - max-height: none; } + max-width: none; + max-height: none; +} .reveal pre.stretch code { - height: 100%; - max-height: 100%; - box-sizing: border-box; } + height: 100%; + max-height: 100%; + box-sizing: border-box; +} /********************************************* * CONTROLS *********************************************/ @-webkit-keyframes bounce-right { - 0%, 10%, 25%, 40%, 50% { - -webkit-transform: translateX(0); - transform: translateX(0); } - 20% { - -webkit-transform: translateX(10px); - transform: translateX(10px); } - 30% { - -webkit-transform: translateX(-5px); - transform: translateX(-5px); } } + 0%, 10%, 25%, 40%, 50% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + 20% { + -webkit-transform: translateX(10px); + transform: translateX(10px); + } + 30% { + -webkit-transform: translateX(-5px); + transform: translateX(-5px); + } +} + @keyframes bounce-right { - 0%, 10%, 25%, 40%, 50% { - -webkit-transform: translateX(0); - transform: translateX(0); } - 20% { - -webkit-transform: translateX(10px); - transform: translateX(10px); } - 30% { - -webkit-transform: translateX(-5px); - transform: translateX(-5px); } } + 0%, 10%, 25%, 40%, 50% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + 20% { + -webkit-transform: translateX(10px); + transform: translateX(10px); + } + 30% { + -webkit-transform: translateX(-5px); + transform: translateX(-5px); + } +} @-webkit-keyframes bounce-down { - 0%, 10%, 25%, 40%, 50% { - -webkit-transform: translateY(0); - transform: translateY(0); } - 20% { - -webkit-transform: translateY(10px); - transform: translateY(10px); } - 30% { - -webkit-transform: translateY(-5px); - transform: translateY(-5px); } } + 0%, 10%, 25%, 40%, 50% { + -webkit-transform: translateY(0); + transform: translateY(0); + } + 20% { + -webkit-transform: translateY(10px); + transform: translateY(10px); + } + 30% { + -webkit-transform: translateY(-5px); + transform: translateY(-5px); + } +} @keyframes bounce-down { - 0%, 10%, 25%, 40%, 50% { - -webkit-transform: translateY(0); - transform: translateY(0); } - 20% { - -webkit-transform: translateY(10px); - transform: translateY(10px); } - 30% { - -webkit-transform: translateY(-5px); - transform: translateY(-5px); } } + 0%, 10%, 25%, 40%, 50% { + -webkit-transform: translateY(0); + transform: translateY(0); + } + 20% { + -webkit-transform: translateY(10px); + transform: translateY(10px); + } + 30% { + -webkit-transform: translateY(-5px); + transform: translateY(-5px); + } +} .reveal .controls { - display: none; - position: absolute; - top: auto; - bottom: 12px; - right: 12px; - left: auto; - z-index: 1; - color: #000; - pointer-events: none; - font-size: 10px; } - .reveal .controls button { + display: none; + position: absolute; + top: auto; + bottom: 12px; + right: 12px; + left: auto; + z-index: 1; + color: #000; + pointer-events: none; + font-size: 10px; +} + +.reveal .controls button { position: absolute; padding: 0; background-color: transparent; @@ -251,7 +322,7 @@ body { cursor: pointer; color: currentColor; -webkit-transform: scale(0.9999); - transform: scale(0.9999); + transform: scale(0.9999); transition: color 0.2s ease, opacity 0.2s ease, -webkit-transform 0.2s ease; transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease; z-index: 2; @@ -260,9 +331,11 @@ body { visibility: hidden; opacity: 0; -webkit-appearance: none; - -webkit-tap-highlight-color: transparent; } - .reveal .controls .controls-arrow:before, - .reveal .controls .controls-arrow:after { + -webkit-tap-highlight-color: transparent; +} + +.reveal .controls .controls-arrow:before, +.reveal .controls .controls-arrow:after { content: ''; position: absolute; top: 0; @@ -273,296 +346,383 @@ body { background-color: currentColor; transition: all 0.15s ease, background-color 0.8s ease; -webkit-transform-origin: 0.2em 50%; - transform-origin: 0.2em 50%; - will-change: transform; } - .reveal .controls .controls-arrow { + transform-origin: 0.2em 50%; + will-change: transform; +} + +.reveal .controls .controls-arrow { position: relative; width: 3.6em; - height: 3.6em; } - .reveal .controls .controls-arrow:before { - -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(45deg); - transform: translateX(0.5em) translateY(1.55em) rotate(45deg); } - .reveal .controls .controls-arrow:after { - -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); - transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); } - .reveal .controls .controls-arrow:hover:before { - -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(40deg); - transform: translateX(0.5em) translateY(1.55em) rotate(40deg); } - .reveal .controls .controls-arrow:hover:after { - -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-40deg); - transform: translateX(0.5em) translateY(1.55em) rotate(-40deg); } - .reveal .controls .controls-arrow:active:before { - -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(36deg); - transform: translateX(0.5em) translateY(1.55em) rotate(36deg); } - .reveal .controls .controls-arrow:active:after { - -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-36deg); - transform: translateX(0.5em) translateY(1.55em) rotate(-36deg); } - .reveal .controls .navigate-left { + height: 3.6em; +} + +.reveal .controls .controls-arrow:before { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(45deg); + transform: translateX(0.5em) translateY(1.55em) rotate(45deg); +} + +.reveal .controls .controls-arrow:after { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); + transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); +} + +.reveal .controls .controls-arrow:hover:before { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(40deg); + transform: translateX(0.5em) translateY(1.55em) rotate(40deg); +} + +.reveal .controls .controls-arrow:hover:after { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-40deg); + transform: translateX(0.5em) translateY(1.55em) rotate(-40deg); +} + +.reveal .controls .controls-arrow:active:before { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(36deg); + transform: translateX(0.5em) translateY(1.55em) rotate(36deg); +} + +.reveal .controls .controls-arrow:active:after { + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-36deg); + transform: translateX(0.5em) translateY(1.55em) rotate(-36deg); +} + +.reveal .controls .navigate-left { right: 6.4em; bottom: 3.2em; -webkit-transform: translateX(-10px); - transform: translateX(-10px); } - .reveal .controls .navigate-right { + transform: translateX(-10px); +} + +.reveal .controls .navigate-right { right: 0; bottom: 3.2em; -webkit-transform: translateX(10px); - transform: translateX(10px); } - .reveal .controls .navigate-right .controls-arrow { - -webkit-transform: rotate(180deg); - transform: rotate(180deg); } - .reveal .controls .navigate-right.highlight { - -webkit-animation: bounce-right 2s 50 both ease-out; - animation: bounce-right 2s 50 both ease-out; } - .reveal .controls .navigate-up { + transform: translateX(10px); +} + +.reveal .controls .navigate-right .controls-arrow { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); +} + +.reveal .controls .navigate-right.highlight { + -webkit-animation: bounce-right 2s 50 both ease-out; + animation: bounce-right 2s 50 both ease-out; +} + +.reveal .controls .navigate-up { right: 3.2em; bottom: 6.4em; -webkit-transform: translateY(-10px); - transform: translateY(-10px); } - .reveal .controls .navigate-up .controls-arrow { - -webkit-transform: rotate(90deg); - transform: rotate(90deg); } - .reveal .controls .navigate-down { + transform: translateY(-10px); +} + +.reveal .controls .navigate-up .controls-arrow { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); +} + +.reveal .controls .navigate-down { right: 3.2em; bottom: 0; -webkit-transform: translateY(10px); - transform: translateY(10px); } - .reveal .controls .navigate-down .controls-arrow { - -webkit-transform: rotate(-90deg); - transform: rotate(-90deg); } - .reveal .controls .navigate-down.highlight { - -webkit-animation: bounce-down 2s 50 both ease-out; - animation: bounce-down 2s 50 both ease-out; } - .reveal .controls[data-controls-back-arrows="faded"] .navigate-left.enabled, - .reveal .controls[data-controls-back-arrows="faded"] .navigate-up.enabled { - opacity: 0.3; } - .reveal .controls[data-controls-back-arrows="faded"] .navigate-left.enabled:hover, - .reveal .controls[data-controls-back-arrows="faded"] .navigate-up.enabled:hover { - opacity: 1; } - .reveal .controls[data-controls-back-arrows="hidden"] .navigate-left.enabled, - .reveal .controls[data-controls-back-arrows="hidden"] .navigate-up.enabled { + transform: translateY(10px); +} + +.reveal .controls .navigate-down .controls-arrow { + -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); +} + +.reveal .controls .navigate-down.highlight { + -webkit-animation: bounce-down 2s 50 both ease-out; + animation: bounce-down 2s 50 both ease-out; +} + +.reveal .controls[data-controls-back-arrows="faded"] .navigate-left.enabled, +.reveal .controls[data-controls-back-arrows="faded"] .navigate-up.enabled { + opacity: 0.3; +} + +.reveal .controls[data-controls-back-arrows="faded"] .navigate-left.enabled:hover, +.reveal .controls[data-controls-back-arrows="faded"] .navigate-up.enabled:hover { + opacity: 1; +} + +.reveal .controls[data-controls-back-arrows="hidden"] .navigate-left.enabled, +.reveal .controls[data-controls-back-arrows="hidden"] .navigate-up.enabled { opacity: 0; - visibility: hidden; } - .reveal .controls .enabled { + visibility: hidden; +} + +.reveal .controls .enabled { visibility: visible; opacity: 0.9; cursor: pointer; -webkit-transform: none; - transform: none; } - .reveal .controls .enabled.fragmented { - opacity: 0.5; } - .reveal .controls .enabled:hover, - .reveal .controls .enabled.fragmented:hover { - opacity: 1; } + transform: none; +} + +.reveal .controls .enabled.fragmented { + opacity: 0.5; +} + +.reveal .controls .enabled:hover, +.reveal .controls .enabled.fragmented:hover { + opacity: 1; +} .reveal:not(.has-vertical-slides) .controls .navigate-left { - bottom: 1.4em; - right: 5.5em; } + bottom: 1.4em; + right: 5.5em; +} .reveal:not(.has-vertical-slides) .controls .navigate-right { - bottom: 1.4em; - right: 0.5em; } + bottom: 1.4em; + right: 0.5em; +} .reveal:not(.has-horizontal-slides) .controls .navigate-up { - right: 1.4em; - bottom: 5em; } + right: 1.4em; + bottom: 5em; +} .reveal:not(.has-horizontal-slides) .controls .navigate-down { - right: 1.4em; - bottom: 0.5em; } + right: 1.4em; + bottom: 0.5em; +} .reveal.has-dark-background .controls { - color: #fff; } + color: #fff; +} .reveal.has-light-background .controls { - color: #000; } + color: #000; +} .reveal.no-hover .controls .controls-arrow:hover:before, .reveal.no-hover .controls .controls-arrow:active:before { - -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(45deg); - transform: translateX(0.5em) translateY(1.55em) rotate(45deg); } + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(45deg); + transform: translateX(0.5em) translateY(1.55em) rotate(45deg); +} .reveal.no-hover .controls .controls-arrow:hover:after, .reveal.no-hover .controls .controls-arrow:active:after { - -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); - transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); } + -webkit-transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); + transform: translateX(0.5em) translateY(1.55em) rotate(-45deg); +} @media screen and (min-width: 500px) { - .reveal .controls[data-controls-layout="edges"] { - top: 0; - right: 0; - bottom: 0; - left: 0; } - .reveal .controls[data-controls-layout="edges"] .navigate-left, - .reveal .controls[data-controls-layout="edges"] .navigate-right, - .reveal .controls[data-controls-layout="edges"] .navigate-up, - .reveal .controls[data-controls-layout="edges"] .navigate-down { - bottom: auto; - right: auto; } - .reveal .controls[data-controls-layout="edges"] .navigate-left { - top: 50%; - left: 8px; - margin-top: -1.8em; } - .reveal .controls[data-controls-layout="edges"] .navigate-right { - top: 50%; - right: 8px; - margin-top: -1.8em; } - .reveal .controls[data-controls-layout="edges"] .navigate-up { - top: 8px; - left: 50%; - margin-left: -1.8em; } - .reveal .controls[data-controls-layout="edges"] .navigate-down { - bottom: 8px; - left: 50%; - margin-left: -1.8em; } } + .reveal .controls[data-controls-layout="edges"] { + top: 0; + right: 0; + bottom: 0; + left: 0; + } + + .reveal .controls[data-controls-layout="edges"] .navigate-left, + .reveal .controls[data-controls-layout="edges"] .navigate-right, + .reveal .controls[data-controls-layout="edges"] .navigate-up, + .reveal .controls[data-controls-layout="edges"] .navigate-down { + bottom: auto; + right: auto; + } + + .reveal .controls[data-controls-layout="edges"] .navigate-left { + top: 50%; + left: 8px; + margin-top: -1.8em; + } + + .reveal .controls[data-controls-layout="edges"] .navigate-right { + top: 50%; + right: 8px; + margin-top: -1.8em; + } + + .reveal .controls[data-controls-layout="edges"] .navigate-up { + top: 8px; + left: 50%; + margin-left: -1.8em; + } + + .reveal .controls[data-controls-layout="edges"] .navigate-down { + bottom: 8px; + left: 50%; + margin-left: -1.8em; + } +} /********************************************* * PROGRESS BAR *********************************************/ .reveal .progress { - position: absolute; - display: none; - height: 3px; - width: 100%; - bottom: 0; - left: 0; - z-index: 10; - background-color: rgba(0, 0, 0, 0.2); - color: #fff; } + position: absolute; + display: none; + height: 3px; + width: 100%; + bottom: 0; + left: 0; + z-index: 10; + background-color: rgba(0, 0, 0, 0.2); + color: #fff; +} .reveal .progress:after { - content: ''; - display: block; - position: absolute; - height: 10px; - width: 100%; - top: -10px; } + content: ''; + display: block; + position: absolute; + height: 10px; + width: 100%; + top: -10px; +} .reveal .progress span { - display: block; - height: 100%; - width: 0px; - background-color: currentColor; - transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + display: block; + height: 100%; + width: 0px; + background-color: currentColor; + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); +} /********************************************* * SLIDE NUMBER *********************************************/ .reveal .slide-number { - position: fixed; - display: block; - right: 8px; - bottom: 8px; - z-index: 31; - font-family: Helvetica, sans-serif; - font-size: 12px; - line-height: 1; - color: #fff; - background-color: rgba(0, 0, 0, 0.4); - padding: 5px; } + position: fixed; + display: block; + right: 8px; + bottom: 8px; + z-index: 31; + font-family: Helvetica, sans-serif; + font-size: 12px; + line-height: 1; + color: #fff; + background-color: rgba(0, 0, 0, 0.4); + padding: 5px; +} .reveal .slide-number-delimiter { - margin: 0 3px; } + margin: 0 3px; +} /********************************************* * SLIDES *********************************************/ .reveal { - position: relative; - width: 100%; - height: 100%; - overflow: hidden; - -ms-touch-action: none; - touch-action: none; } + position: relative; + width: 100%; + height: 100%; + overflow: hidden; + -ms-touch-action: none; + touch-action: none; +} @media only screen and (orientation: landscape) { - .reveal.ua-iphone { - position: fixed; } } + .reveal.ua-iphone { + position: fixed; + } +} .reveal .slides { - position: absolute; - width: 100%; - height: 100%; - top: 0; - right: 0; - bottom: 0; - left: 0; - margin: auto; - pointer-events: none; - overflow: visible; - z-index: 1; - text-align: center; - -webkit-perspective: 600px; - perspective: 600px; - -webkit-perspective-origin: 50% 40%; - perspective-origin: 50% 40%; } + position: absolute; + width: 100%; + height: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; + margin: auto; + pointer-events: none; + overflow: visible; + z-index: 1; + text-align: center; + -webkit-perspective: 600px; + perspective: 600px; + -webkit-perspective-origin: 50% 40%; + perspective-origin: 50% 40%; +} .reveal .slides > section { - -ms-perspective: 600px; } + -ms-perspective: 600px; +} .reveal .slides > section, .reveal .slides > section > section { - display: none; - position: absolute; - width: 100%; - padding: 20px 0px; - pointer-events: auto; - z-index: 10; - -webkit-transform-style: flat; - transform-style: flat; - transition: -webkit-transform-origin 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), -webkit-transform 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), visibility 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), opacity 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); - transition: transform-origin 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), transform 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), visibility 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), opacity 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + display: none; + position: absolute; + width: 100%; + padding: 20px 0px; + pointer-events: auto; + z-index: 10; + -webkit-transform-style: flat; + transform-style: flat; + transition: -webkit-transform-origin 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), -webkit-transform 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), visibility 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), opacity 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: transform-origin 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), transform 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), visibility 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985), opacity 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); +} /* Global transition speed settings */ .reveal[data-transition-speed="fast"] .slides section { - transition-duration: 400ms; } + transition-duration: 400ms; +} .reveal[data-transition-speed="slow"] .slides section { - transition-duration: 1200ms; } + transition-duration: 1200ms; +} /* Slide-specific transition speed overrides */ .reveal .slides section[data-transition-speed="fast"] { - transition-duration: 400ms; } + transition-duration: 400ms; +} .reveal .slides section[data-transition-speed="slow"] { - transition-duration: 1200ms; } + transition-duration: 1200ms; +} .reveal .slides > section.stack { - padding-top: 0; - padding-bottom: 0; } + padding-top: 0; + padding-bottom: 0; +} .reveal .slides > section.present, .reveal .slides > section > section.present { - display: block; - z-index: 11; - opacity: 1; } + display: block; + z-index: 11; + opacity: 1; +} .reveal .slides > section:empty, .reveal .slides > section > section:empty, .reveal .slides > section[data-background-interactive], .reveal .slides > section > section[data-background-interactive] { - pointer-events: none; } + pointer-events: none; +} .reveal.center, .reveal.center .slides, .reveal.center .slides section { - min-height: 0 !important; } + min-height: 0 !important; +} /* Don't allow interaction with invisible slides */ .reveal .slides > section.future, .reveal .slides > section > section.future, .reveal .slides > section.past, .reveal .slides > section > section.past { - pointer-events: none; } + pointer-events: none; +} .reveal.overview .slides > section, .reveal.overview .slides > section > section { - pointer-events: auto; } + pointer-events: auto; +} .reveal .slides > section.past, .reveal .slides > section.future, .reveal .slides > section > section.past, .reveal .slides > section > section.future { - opacity: 0; } + opacity: 0; +} /********************************************* * Mixins for readability of transitions @@ -572,60 +732,70 @@ body { * Aliased 'linear' for backwards compatibility *********************************************/ .reveal.slide section { - -webkit-backface-visibility: hidden; - backface-visibility: hidden; } + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} .reveal .slides > section[data-transition=slide].past, .reveal .slides > section[data-transition~=slide-out].past, .reveal.slide .slides > section:not([data-transition]).past { - -webkit-transform: translate(-150%, 0); - transform: translate(-150%, 0); } + -webkit-transform: translate(-150%, 0); + transform: translate(-150%, 0); +} .reveal .slides > section[data-transition=slide].future, .reveal .slides > section[data-transition~=slide-in].future, .reveal.slide .slides > section:not([data-transition]).future { - -webkit-transform: translate(150%, 0); - transform: translate(150%, 0); } + -webkit-transform: translate(150%, 0); + transform: translate(150%, 0); +} .reveal .slides > section > section[data-transition=slide].past, .reveal .slides > section > section[data-transition~=slide-out].past, .reveal.slide .slides > section > section:not([data-transition]).past { - -webkit-transform: translate(0, -150%); - transform: translate(0, -150%); } + -webkit-transform: translate(0, -150%); + transform: translate(0, -150%); +} .reveal .slides > section > section[data-transition=slide].future, .reveal .slides > section > section[data-transition~=slide-in].future, .reveal.slide .slides > section > section:not([data-transition]).future { - -webkit-transform: translate(0, 150%); - transform: translate(0, 150%); } + -webkit-transform: translate(0, 150%); + transform: translate(0, 150%); +} .reveal.linear section { - -webkit-backface-visibility: hidden; - backface-visibility: hidden; } + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} .reveal .slides > section[data-transition=linear].past, .reveal .slides > section[data-transition~=linear-out].past, .reveal.linear .slides > section:not([data-transition]).past { - -webkit-transform: translate(-150%, 0); - transform: translate(-150%, 0); } + -webkit-transform: translate(-150%, 0); + transform: translate(-150%, 0); +} .reveal .slides > section[data-transition=linear].future, .reveal .slides > section[data-transition~=linear-in].future, .reveal.linear .slides > section:not([data-transition]).future { - -webkit-transform: translate(150%, 0); - transform: translate(150%, 0); } + -webkit-transform: translate(150%, 0); + transform: translate(150%, 0); +} .reveal .slides > section > section[data-transition=linear].past, .reveal .slides > section > section[data-transition~=linear-out].past, .reveal.linear .slides > section > section:not([data-transition]).past { - -webkit-transform: translate(0, -150%); - transform: translate(0, -150%); } + -webkit-transform: translate(0, -150%); + transform: translate(0, -150%); +} .reveal .slides > section > section[data-transition=linear].future, .reveal .slides > section > section[data-transition~=linear-in].future, .reveal.linear .slides > section > section:not([data-transition]).future { - -webkit-transform: translate(0, 150%); - transform: translate(0, 150%); } + -webkit-transform: translate(0, 150%); + transform: translate(0, 150%); +} /********************************************* * CONVEX TRANSITION @@ -633,126 +803,146 @@ body { *********************************************/ .reveal .slides section[data-transition=default].stack, .reveal.default .slides section.stack { - -webkit-transform-style: preserve-3d; - transform-style: preserve-3d; } + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; +} .reveal .slides > section[data-transition=default].past, .reveal .slides > section[data-transition~=default-out].past, .reveal.default .slides > section:not([data-transition]).past { - -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); } + -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); +} .reveal .slides > section[data-transition=default].future, .reveal .slides > section[data-transition~=default-in].future, .reveal.default .slides > section:not([data-transition]).future { - -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); } + -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); +} .reveal .slides > section > section[data-transition=default].past, .reveal .slides > section > section[data-transition~=default-out].past, .reveal.default .slides > section > section:not([data-transition]).past { - -webkit-transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); - transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); } + -webkit-transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); + transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); +} .reveal .slides > section > section[data-transition=default].future, .reveal .slides > section > section[data-transition~=default-in].future, .reveal.default .slides > section > section:not([data-transition]).future { - -webkit-transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); - transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); } + -webkit-transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); + transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); +} .reveal .slides section[data-transition=convex].stack, .reveal.convex .slides section.stack { - -webkit-transform-style: preserve-3d; - transform-style: preserve-3d; } + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; +} .reveal .slides > section[data-transition=convex].past, .reveal .slides > section[data-transition~=convex-out].past, .reveal.convex .slides > section:not([data-transition]).past { - -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); } + -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); +} .reveal .slides > section[data-transition=convex].future, .reveal .slides > section[data-transition~=convex-in].future, .reveal.convex .slides > section:not([data-transition]).future { - -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); } + -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); +} .reveal .slides > section > section[data-transition=convex].past, .reveal .slides > section > section[data-transition~=convex-out].past, .reveal.convex .slides > section > section:not([data-transition]).past { - -webkit-transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); - transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); } + -webkit-transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); + transform: translate3d(0, -300px, 0) rotateX(70deg) translate3d(0, -300px, 0); +} .reveal .slides > section > section[data-transition=convex].future, .reveal .slides > section > section[data-transition~=convex-in].future, .reveal.convex .slides > section > section:not([data-transition]).future { - -webkit-transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); - transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); } + -webkit-transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); + transform: translate3d(0, 300px, 0) rotateX(-70deg) translate3d(0, 300px, 0); +} /********************************************* * CONCAVE TRANSITION *********************************************/ .reveal .slides section[data-transition=concave].stack, .reveal.concave .slides section.stack { - -webkit-transform-style: preserve-3d; - transform-style: preserve-3d; } + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; +} .reveal .slides > section[data-transition=concave].past, .reveal .slides > section[data-transition~=concave-out].past, .reveal.concave .slides > section:not([data-transition]).past { - -webkit-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); } + -webkit-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); +} .reveal .slides > section[data-transition=concave].future, .reveal .slides > section[data-transition~=concave-in].future, .reveal.concave .slides > section:not([data-transition]).future { - -webkit-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); } + -webkit-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); +} .reveal .slides > section > section[data-transition=concave].past, .reveal .slides > section > section[data-transition~=concave-out].past, .reveal.concave .slides > section > section:not([data-transition]).past { - -webkit-transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); - transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); } + -webkit-transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); + transform: translate3d(0, -80%, 0) rotateX(-70deg) translate3d(0, -80%, 0); +} .reveal .slides > section > section[data-transition=concave].future, .reveal .slides > section > section[data-transition~=concave-in].future, .reveal.concave .slides > section > section:not([data-transition]).future { - -webkit-transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); - transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); } + -webkit-transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); + transform: translate3d(0, 80%, 0) rotateX(70deg) translate3d(0, 80%, 0); +} /********************************************* * ZOOM TRANSITION *********************************************/ .reveal .slides section[data-transition=zoom], .reveal.zoom .slides section:not([data-transition]) { - transition-timing-function: ease; } + transition-timing-function: ease; +} .reveal .slides > section[data-transition=zoom].past, .reveal .slides > section[data-transition~=zoom-out].past, .reveal.zoom .slides > section:not([data-transition]).past { - visibility: hidden; - -webkit-transform: scale(16); - transform: scale(16); } + visibility: hidden; + -webkit-transform: scale(16); + transform: scale(16); +} .reveal .slides > section[data-transition=zoom].future, .reveal .slides > section[data-transition~=zoom-in].future, .reveal.zoom .slides > section:not([data-transition]).future { - visibility: hidden; - -webkit-transform: scale(0.2); - transform: scale(0.2); } + visibility: hidden; + -webkit-transform: scale(0.2); + transform: scale(0.2); +} .reveal .slides > section > section[data-transition=zoom].past, .reveal .slides > section > section[data-transition~=zoom-out].past, .reveal.zoom .slides > section > section:not([data-transition]).past { - -webkit-transform: translate(0, -150%); - transform: translate(0, -150%); } + -webkit-transform: translate(0, -150%); + transform: translate(0, -150%); +} .reveal .slides > section > section[data-transition=zoom].future, .reveal .slides > section > section[data-transition~=zoom-in].future, .reveal.zoom .slides > section > section:not([data-transition]).future { - -webkit-transform: translate(0, 150%); - transform: translate(0, 150%); } + -webkit-transform: translate(0, 150%); + transform: translate(0, 150%); +} /********************************************* * CUBE TRANSITION @@ -762,76 +952,86 @@ body { * future version. *********************************************/ .reveal.cube .slides { - -webkit-perspective: 1300px; - perspective: 1300px; } + -webkit-perspective: 1300px; + perspective: 1300px; +} .reveal.cube .slides section { - padding: 30px; - min-height: 700px; - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - box-sizing: border-box; - -webkit-transform-style: preserve-3d; - transform-style: preserve-3d; } + padding: 30px; + min-height: 700px; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + box-sizing: border-box; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; +} .reveal.center.cube .slides section { - min-height: 0; } + min-height: 0; +} .reveal.cube .slides section:not(.stack):before { - content: ''; - position: absolute; - display: block; - width: 100%; - height: 100%; - left: 0; - top: 0; - background: rgba(0, 0, 0, 0.1); - border-radius: 4px; - -webkit-transform: translateZ(-20px); - transform: translateZ(-20px); } + content: ''; + position: absolute; + display: block; + width: 100%; + height: 100%; + left: 0; + top: 0; + background: rgba(0, 0, 0, 0.1); + border-radius: 4px; + -webkit-transform: translateZ(-20px); + transform: translateZ(-20px); +} .reveal.cube .slides section:not(.stack):after { - content: ''; - position: absolute; - display: block; - width: 90%; - height: 30px; - left: 5%; - bottom: 0; - background: none; - z-index: 1; - border-radius: 4px; - box-shadow: 0px 95px 25px rgba(0, 0, 0, 0.2); - -webkit-transform: translateZ(-90px) rotateX(65deg); - transform: translateZ(-90px) rotateX(65deg); } + content: ''; + position: absolute; + display: block; + width: 90%; + height: 30px; + left: 5%; + bottom: 0; + background: none; + z-index: 1; + border-radius: 4px; + box-shadow: 0px 95px 25px rgba(0, 0, 0, 0.2); + -webkit-transform: translateZ(-90px) rotateX(65deg); + transform: translateZ(-90px) rotateX(65deg); +} .reveal.cube .slides > section.stack { - padding: 0; - background: none; } + padding: 0; + background: none; +} .reveal.cube .slides > section.past { - -webkit-transform-origin: 100% 0%; - transform-origin: 100% 0%; - -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg); - transform: translate3d(-100%, 0, 0) rotateY(-90deg); } + -webkit-transform-origin: 100% 0%; + transform-origin: 100% 0%; + -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg); + transform: translate3d(-100%, 0, 0) rotateY(-90deg); +} .reveal.cube .slides > section.future { - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg); - transform: translate3d(100%, 0, 0) rotateY(90deg); } + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg); + transform: translate3d(100%, 0, 0) rotateY(90deg); +} .reveal.cube .slides > section > section.past { - -webkit-transform-origin: 0% 100%; - transform-origin: 0% 100%; - -webkit-transform: translate3d(0, -100%, 0) rotateX(90deg); - transform: translate3d(0, -100%, 0) rotateX(90deg); } + -webkit-transform-origin: 0% 100%; + transform-origin: 0% 100%; + -webkit-transform: translate3d(0, -100%, 0) rotateX(90deg); + transform: translate3d(0, -100%, 0) rotateX(90deg); +} .reveal.cube .slides > section > section.future { - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: translate3d(0, 100%, 0) rotateX(-90deg); - transform: translate3d(0, 100%, 0) rotateX(-90deg); } + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: translate3d(0, 100%, 0) rotateX(-90deg); + transform: translate3d(0, 100%, 0) rotateX(-90deg); +} /********************************************* * PAGE TRANSITION @@ -841,74 +1041,84 @@ body { * future version. *********************************************/ .reveal.page .slides { - -webkit-perspective-origin: 0% 50%; - perspective-origin: 0% 50%; - -webkit-perspective: 3000px; - perspective: 3000px; } + -webkit-perspective-origin: 0% 50%; + perspective-origin: 0% 50%; + -webkit-perspective: 3000px; + perspective: 3000px; +} .reveal.page .slides section { - padding: 30px; - min-height: 700px; - box-sizing: border-box; - -webkit-transform-style: preserve-3d; - transform-style: preserve-3d; } + padding: 30px; + min-height: 700px; + box-sizing: border-box; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; +} .reveal.page .slides section.past { - z-index: 12; } + z-index: 12; +} .reveal.page .slides section:not(.stack):before { - content: ''; - position: absolute; - display: block; - width: 100%; - height: 100%; - left: 0; - top: 0; - background: rgba(0, 0, 0, 0.1); - -webkit-transform: translateZ(-20px); - transform: translateZ(-20px); } + content: ''; + position: absolute; + display: block; + width: 100%; + height: 100%; + left: 0; + top: 0; + background: rgba(0, 0, 0, 0.1); + -webkit-transform: translateZ(-20px); + transform: translateZ(-20px); +} .reveal.page .slides section:not(.stack):after { - content: ''; - position: absolute; - display: block; - width: 90%; - height: 30px; - left: 5%; - bottom: 0; - background: none; - z-index: 1; - border-radius: 4px; - box-shadow: 0px 95px 25px rgba(0, 0, 0, 0.2); - -webkit-transform: translateZ(-90px) rotateX(65deg); } + content: ''; + position: absolute; + display: block; + width: 90%; + height: 30px; + left: 5%; + bottom: 0; + background: none; + z-index: 1; + border-radius: 4px; + box-shadow: 0px 95px 25px rgba(0, 0, 0, 0.2); + -webkit-transform: translateZ(-90px) rotateX(65deg); +} .reveal.page .slides > section.stack { - padding: 0; - background: none; } + padding: 0; + background: none; +} .reveal.page .slides > section.past { - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: translate3d(-40%, 0, 0) rotateY(-80deg); - transform: translate3d(-40%, 0, 0) rotateY(-80deg); } + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: translate3d(-40%, 0, 0) rotateY(-80deg); + transform: translate3d(-40%, 0, 0) rotateY(-80deg); +} .reveal.page .slides > section.future { - -webkit-transform-origin: 100% 0%; - transform-origin: 100% 0%; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); } + -webkit-transform-origin: 100% 0%; + transform-origin: 100% 0%; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} .reveal.page .slides > section > section.past { - -webkit-transform-origin: 0% 0%; - transform-origin: 0% 0%; - -webkit-transform: translate3d(0, -40%, 0) rotateX(80deg); - transform: translate3d(0, -40%, 0) rotateX(80deg); } + -webkit-transform-origin: 0% 0%; + transform-origin: 0% 0%; + -webkit-transform: translate3d(0, -40%, 0) rotateX(80deg); + transform: translate3d(0, -40%, 0) rotateX(80deg); +} .reveal.page .slides > section > section.future { - -webkit-transform-origin: 0% 100%; - transform-origin: 0% 100%; - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); } + -webkit-transform-origin: 0% 100%; + transform-origin: 0% 100%; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} /********************************************* * FADE TRANSITION @@ -916,309 +1126,369 @@ body { .reveal .slides section[data-transition=fade], .reveal.fade .slides section:not([data-transition]), .reveal.fade .slides > section > section:not([data-transition]) { - -webkit-transform: none; - transform: none; - transition: opacity 0.5s; } + -webkit-transform: none; + transform: none; + transition: opacity 0.5s; +} .reveal.fade.overview .slides section, .reveal.fade.overview .slides > section > section { - transition: none; } + transition: none; +} /********************************************* * NO TRANSITION *********************************************/ .reveal .slides section[data-transition=none], .reveal.none .slides section:not([data-transition]) { - -webkit-transform: none; - transform: none; - transition: none; } + -webkit-transform: none; + transform: none; + transition: none; +} /********************************************* * PAUSED MODE *********************************************/ .reveal .pause-overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: black; - visibility: hidden; - opacity: 0; - z-index: 100; - transition: all 1s ease; } + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: black; + visibility: hidden; + opacity: 0; + z-index: 100; + transition: all 1s ease; +} .reveal.paused .pause-overlay { - visibility: visible; - opacity: 1; } + visibility: visible; + opacity: 1; +} /********************************************* * FALLBACK *********************************************/ .no-transforms { - overflow-y: auto; } + overflow-y: auto; +} .no-transforms .reveal .slides { - position: relative; - width: 80%; - height: auto !important; - top: 0; - left: 50%; - margin: 0; - text-align: center; } + position: relative; + width: 80%; + height: auto !important; + top: 0; + left: 50%; + margin: 0; + text-align: center; +} .no-transforms .reveal .controls, .no-transforms .reveal .progress { - display: none !important; } + display: none !important; +} .no-transforms .reveal .slides section { - display: block !important; - opacity: 1 !important; - position: relative !important; - height: auto; - min-height: 0; - top: 0; - left: -50%; - margin: 70px 0; - -webkit-transform: none; - transform: none; } + display: block !important; + opacity: 1 !important; + position: relative !important; + height: auto; + min-height: 0; + top: 0; + left: -50%; + margin: 70px 0; + -webkit-transform: none; + transform: none; +} .no-transforms .reveal .slides section section { - left: 0; } + left: 0; +} .reveal .no-transition, .reveal .no-transition * { - transition: none !important; } + transition: none !important; +} /********************************************* * PER-SLIDE BACKGROUNDS *********************************************/ .reveal .backgrounds { - position: absolute; - width: 100%; - height: 100%; - top: 0; - left: 0; - -webkit-perspective: 600px; - perspective: 600px; } + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + -webkit-perspective: 600px; + perspective: 600px; +} .reveal .slide-background { - display: none; - position: absolute; - width: 100%; - height: 100%; - opacity: 0; - visibility: hidden; - overflow: hidden; - background-color: transparent; - background-position: 50% 50%; - background-repeat: no-repeat; - background-size: cover; - transition: all 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } + display: none; + position: absolute; + width: 100%; + height: 100%; + opacity: 0; + visibility: hidden; + overflow: hidden; + background-color: transparent; + background-position: 50% 50%; + background-repeat: no-repeat; + background-size: cover; + transition: all 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); +} .reveal .slide-background.stack { - display: block; } + display: block; +} .reveal .slide-background.present { - opacity: 1; - visibility: visible; - z-index: 2; } + opacity: 1; + visibility: visible; + z-index: 2; +} .print-pdf .reveal .slide-background { - opacity: 1 !important; - visibility: visible !important; } + opacity: 1 !important; + visibility: visible !important; +} /* Video backgrounds */ .reveal .slide-background video { - position: absolute; - width: 100%; - height: 100%; - max-width: none; - max-height: none; - top: 0; - left: 0; - -o-object-fit: cover; - object-fit: cover; } + position: absolute; + width: 100%; + height: 100%; + max-width: none; + max-height: none; + top: 0; + left: 0; + -o-object-fit: cover; + object-fit: cover; +} .reveal .slide-background[data-background-size="contain"] video { - -o-object-fit: contain; - object-fit: contain; } + -o-object-fit: contain; + object-fit: contain; +} /* Immediate transition style */ .reveal[data-background-transition=none] > .backgrounds .slide-background, .reveal > .backgrounds .slide-background[data-background-transition=none] { - transition: none; } + transition: none; +} /* Slide */ .reveal[data-background-transition=slide] > .backgrounds .slide-background, .reveal > .backgrounds .slide-background[data-background-transition=slide] { - opacity: 1; - -webkit-backface-visibility: hidden; - backface-visibility: hidden; } + opacity: 1; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} .reveal[data-background-transition=slide] > .backgrounds .slide-background.past, .reveal > .backgrounds .slide-background.past[data-background-transition=slide] { - -webkit-transform: translate(-100%, 0); - transform: translate(-100%, 0); } + -webkit-transform: translate(-100%, 0); + transform: translate(-100%, 0); +} .reveal[data-background-transition=slide] > .backgrounds .slide-background.future, .reveal > .backgrounds .slide-background.future[data-background-transition=slide] { - -webkit-transform: translate(100%, 0); - transform: translate(100%, 0); } + -webkit-transform: translate(100%, 0); + transform: translate(100%, 0); +} .reveal[data-background-transition=slide] > .backgrounds .slide-background > .slide-background.past, .reveal > .backgrounds .slide-background > .slide-background.past[data-background-transition=slide] { - -webkit-transform: translate(0, -100%); - transform: translate(0, -100%); } + -webkit-transform: translate(0, -100%); + transform: translate(0, -100%); +} .reveal[data-background-transition=slide] > .backgrounds .slide-background > .slide-background.future, .reveal > .backgrounds .slide-background > .slide-background.future[data-background-transition=slide] { - -webkit-transform: translate(0, 100%); - transform: translate(0, 100%); } + -webkit-transform: translate(0, 100%); + transform: translate(0, 100%); +} /* Convex */ .reveal[data-background-transition=convex] > .backgrounds .slide-background.past, .reveal > .backgrounds .slide-background.past[data-background-transition=convex] { - opacity: 0; - -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); } + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(-90deg) translate3d(-100%, 0, 0); +} .reveal[data-background-transition=convex] > .backgrounds .slide-background.future, .reveal > .backgrounds .slide-background.future[data-background-transition=convex] { - opacity: 0; - -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); } + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(90deg) translate3d(100%, 0, 0); +} .reveal[data-background-transition=convex] > .backgrounds .slide-background > .slide-background.past, .reveal > .backgrounds .slide-background > .slide-background.past[data-background-transition=convex] { - opacity: 0; - -webkit-transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0); } + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0) rotateX(90deg) translate3d(0, -100%, 0); +} .reveal[data-background-transition=convex] > .backgrounds .slide-background > .slide-background.future, .reveal > .backgrounds .slide-background > .slide-background.future[data-background-transition=convex] { - opacity: 0; - -webkit-transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0); } + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0) rotateX(-90deg) translate3d(0, 100%, 0); +} /* Concave */ .reveal[data-background-transition=concave] > .backgrounds .slide-background.past, .reveal > .backgrounds .slide-background.past[data-background-transition=concave] { - opacity: 0; - -webkit-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); } + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0) rotateY(90deg) translate3d(-100%, 0, 0); +} .reveal[data-background-transition=concave] > .backgrounds .slide-background.future, .reveal > .backgrounds .slide-background.future[data-background-transition=concave] { - opacity: 0; - -webkit-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); } + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0) rotateY(-90deg) translate3d(100%, 0, 0); +} .reveal[data-background-transition=concave] > .backgrounds .slide-background > .slide-background.past, .reveal > .backgrounds .slide-background > .slide-background.past[data-background-transition=concave] { - opacity: 0; - -webkit-transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0); } + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0) rotateX(-90deg) translate3d(0, -100%, 0); +} .reveal[data-background-transition=concave] > .backgrounds .slide-background > .slide-background.future, .reveal > .backgrounds .slide-background > .slide-background.future[data-background-transition=concave] { - opacity: 0; - -webkit-transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0); } + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0) rotateX(90deg) translate3d(0, 100%, 0); +} /* Zoom */ .reveal[data-background-transition=zoom] > .backgrounds .slide-background, .reveal > .backgrounds .slide-background[data-background-transition=zoom] { - transition-timing-function: ease; } + transition-timing-function: ease; +} .reveal[data-background-transition=zoom] > .backgrounds .slide-background.past, .reveal > .backgrounds .slide-background.past[data-background-transition=zoom] { - opacity: 0; - visibility: hidden; - -webkit-transform: scale(16); - transform: scale(16); } + opacity: 0; + visibility: hidden; + -webkit-transform: scale(16); + transform: scale(16); +} .reveal[data-background-transition=zoom] > .backgrounds .slide-background.future, .reveal > .backgrounds .slide-background.future[data-background-transition=zoom] { - opacity: 0; - visibility: hidden; - -webkit-transform: scale(0.2); - transform: scale(0.2); } + opacity: 0; + visibility: hidden; + -webkit-transform: scale(0.2); + transform: scale(0.2); +} .reveal[data-background-transition=zoom] > .backgrounds .slide-background > .slide-background.past, .reveal > .backgrounds .slide-background > .slide-background.past[data-background-transition=zoom] { - opacity: 0; - visibility: hidden; - -webkit-transform: scale(16); - transform: scale(16); } + opacity: 0; + visibility: hidden; + -webkit-transform: scale(16); + transform: scale(16); +} .reveal[data-background-transition=zoom] > .backgrounds .slide-background > .slide-background.future, .reveal > .backgrounds .slide-background > .slide-background.future[data-background-transition=zoom] { - opacity: 0; - visibility: hidden; - -webkit-transform: scale(0.2); - transform: scale(0.2); } + opacity: 0; + visibility: hidden; + -webkit-transform: scale(0.2); + transform: scale(0.2); +} /* Global transition speed settings */ .reveal[data-transition-speed="fast"] > .backgrounds .slide-background { - transition-duration: 400ms; } + transition-duration: 400ms; +} .reveal[data-transition-speed="slow"] > .backgrounds .slide-background { - transition-duration: 1200ms; } + transition-duration: 1200ms; +} /********************************************* * OVERVIEW *********************************************/ .reveal.overview { - -webkit-perspective-origin: 50% 50%; - perspective-origin: 50% 50%; - -webkit-perspective: 700px; - perspective: 700px; } - .reveal.overview .slides { - -moz-transform-style: preserve-3d; } - .reveal.overview .slides section { + -webkit-perspective-origin: 50% 50%; + perspective-origin: 50% 50%; + -webkit-perspective: 700px; + perspective: 700px; +} + +.reveal.overview .slides { + -moz-transform-style: preserve-3d; +} + +.reveal.overview .slides section { height: 100%; top: 0 !important; opacity: 1 !important; overflow: hidden; visibility: visible !important; cursor: pointer; - box-sizing: border-box; } - .reveal.overview .slides section:hover, - .reveal.overview .slides section.present { + box-sizing: border-box; +} + +.reveal.overview .slides section:hover, +.reveal.overview .slides section.present { outline: 10px solid rgba(150, 150, 150, 0.4); - outline-offset: 10px; } - .reveal.overview .slides section .fragment { + outline-offset: 10px; +} + +.reveal.overview .slides section .fragment { opacity: 1; - transition: none; } - .reveal.overview .slides section:after, - .reveal.overview .slides section:before { - display: none !important; } - .reveal.overview .slides > section.stack { + transition: none; +} + +.reveal.overview .slides section:after, +.reveal.overview .slides section:before { + display: none !important; +} + +.reveal.overview .slides > section.stack { padding: 0; top: 0 !important; background: none; outline: none; - overflow: visible; } - .reveal.overview .backgrounds { + overflow: visible; +} + +.reveal.overview .backgrounds { -webkit-perspective: inherit; - perspective: inherit; - -moz-transform-style: preserve-3d; } - .reveal.overview .backgrounds .slide-background { + perspective: inherit; + -moz-transform-style: preserve-3d; +} + +.reveal.overview .backgrounds .slide-background { opacity: 1; visibility: visible; outline: 10px solid rgba(150, 150, 150, 0.1); - outline-offset: 10px; } - .reveal.overview .backgrounds .slide-background.stack { - overflow: visible; } + outline-offset: 10px; +} + +.reveal.overview .backgrounds .slide-background.stack { + overflow: visible; +} .reveal.overview .slides section, .reveal.overview-deactivating .slides section { - transition: none; } + transition: none; +} .reveal.overview .backgrounds .slide-background, .reveal.overview-deactivating .backgrounds .slide-background { - transition: none; } + transition: none; +} /********************************************* * RTL SUPPORT @@ -1230,310 +1500,368 @@ body { .reveal.rtl .slides h4, .reveal.rtl .slides h5, .reveal.rtl .slides h6 { - direction: rtl; - font-family: sans-serif; } + direction: rtl; + font-family: sans-serif; +} .reveal.rtl pre, .reveal.rtl code { - direction: ltr; } + direction: ltr; +} .reveal.rtl ol, .reveal.rtl ul { - text-align: right; } + text-align: right; +} .reveal.rtl .progress span { - float: right; } + float: right; +} /********************************************* * PARALLAX BACKGROUND *********************************************/ .reveal.has-parallax-background .backgrounds { - transition: all 0.8s ease; } + transition: all 0.8s ease; +} /* Global transition speed settings */ .reveal.has-parallax-background[data-transition-speed="fast"] .backgrounds { - transition-duration: 400ms; } + transition-duration: 400ms; +} .reveal.has-parallax-background[data-transition-speed="slow"] .backgrounds { - transition-duration: 1200ms; } + transition-duration: 1200ms; +} /********************************************* * LINK PREVIEW OVERLAY *********************************************/ .reveal .overlay { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 1000; - background: rgba(0, 0, 0, 0.9); - opacity: 0; - visibility: hidden; - transition: all 0.3s ease; } + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; + background: rgba(0, 0, 0, 0.9); + opacity: 0; + visibility: hidden; + transition: all 0.3s ease; +} .reveal .overlay.visible { - opacity: 1; - visibility: visible; } + opacity: 1; + visibility: visible; +} .reveal .overlay .spinner { - position: absolute; - display: block; - top: 50%; - left: 50%; - width: 32px; - height: 32px; - margin: -16px 0 0 -16px; - z-index: 10; - background-image: url(data:image/gif;base64,R0lGODlhIAAgAPMAAJmZmf%2F%2F%2F6%2Bvr8nJybW1tcDAwOjo6Nvb26ioqKOjo7Ozs%2FLy8vz8%2FAAAAAAAAAAAACH%2FC05FVFNDQVBFMi4wAwEAAAAh%2FhpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh%2BQQJCgAAACwAAAAAIAAgAAAE5xDISWlhperN52JLhSSdRgwVo1ICQZRUsiwHpTJT4iowNS8vyW2icCF6k8HMMBkCEDskxTBDAZwuAkkqIfxIQyhBQBFvAQSDITM5VDW6XNE4KagNh6Bgwe60smQUB3d4Rz1ZBApnFASDd0hihh12BkE9kjAJVlycXIg7CQIFA6SlnJ87paqbSKiKoqusnbMdmDC2tXQlkUhziYtyWTxIfy6BE8WJt5YJvpJivxNaGmLHT0VnOgSYf0dZXS7APdpB309RnHOG5gDqXGLDaC457D1zZ%2FV%2FnmOM82XiHRLYKhKP1oZmADdEAAAh%2BQQJCgAAACwAAAAAIAAgAAAE6hDISWlZpOrNp1lGNRSdRpDUolIGw5RUYhhHukqFu8DsrEyqnWThGvAmhVlteBvojpTDDBUEIFwMFBRAmBkSgOrBFZogCASwBDEY%2FCZSg7GSE0gSCjQBMVG023xWBhklAnoEdhQEfyNqMIcKjhRsjEdnezB%2BA4k8gTwJhFuiW4dokXiloUepBAp5qaKpp6%2BHo7aWW54wl7obvEe0kRuoplCGepwSx2jJvqHEmGt6whJpGpfJCHmOoNHKaHx61WiSR92E4lbFoq%2BB6QDtuetcaBPnW6%2BO7wDHpIiK9SaVK5GgV543tzjgGcghAgAh%2BQQJCgAAACwAAAAAIAAgAAAE7hDISSkxpOrN5zFHNWRdhSiVoVLHspRUMoyUakyEe8PTPCATW9A14E0UvuAKMNAZKYUZCiBMuBakSQKG8G2FzUWox2AUtAQFcBKlVQoLgQReZhQlCIJesQXI5B0CBnUMOxMCenoCfTCEWBsJColTMANldx15BGs8B5wlCZ9Po6OJkwmRpnqkqnuSrayqfKmqpLajoiW5HJq7FL1Gr2mMMcKUMIiJgIemy7xZtJsTmsM4xHiKv5KMCXqfyUCJEonXPN2rAOIAmsfB3uPoAK%2B%2BG%2Bw48edZPK%2BM6hLJpQg484enXIdQFSS1u6UhksENEQAAIfkECQoAAAAsAAAAACAAIAAABOcQyEmpGKLqzWcZRVUQnZYg1aBSh2GUVEIQ2aQOE%2BG%2BcD4ntpWkZQj1JIiZIogDFFyHI0UxQwFugMSOFIPJftfVAEoZLBbcLEFhlQiqGp1Vd140AUklUN3eCA51C1EWMzMCezCBBmkxVIVHBWd3HHl9JQOIJSdSnJ0TDKChCwUJjoWMPaGqDKannasMo6WnM562R5YluZRwur0wpgqZE7NKUm%2BFNRPIhjBJxKZteWuIBMN4zRMIVIhffcgojwCF117i4nlLnY5ztRLsnOk%2BaV%2BoJY7V7m76PdkS4trKcdg0Zc0tTcKkRAAAIfkECQoAAAAsAAAAACAAIAAABO4QyEkpKqjqzScpRaVkXZWQEximw1BSCUEIlDohrft6cpKCk5xid5MNJTaAIkekKGQkWyKHkvhKsR7ARmitkAYDYRIbUQRQjWBwJRzChi9CRlBcY1UN4g0%2FVNB0AlcvcAYHRyZPdEQFYV8ccwR5HWxEJ02YmRMLnJ1xCYp0Y5idpQuhopmmC2KgojKasUQDk5BNAwwMOh2RtRq5uQuPZKGIJQIGwAwGf6I0JXMpC8C7kXWDBINFMxS4DKMAWVWAGYsAdNqW5uaRxkSKJOZKaU3tPOBZ4DuK2LATgJhkPJMgTwKCdFjyPHEnKxFCDhEAACH5BAkKAAAALAAAAAAgACAAAATzEMhJaVKp6s2nIkolIJ2WkBShpkVRWqqQrhLSEu9MZJKK9y1ZrqYK9WiClmvoUaF8gIQSNeF1Er4MNFn4SRSDARWroAIETg1iVwuHjYB1kYc1mwruwXKC9gmsJXliGxc%2BXiUCby9ydh1sOSdMkpMTBpaXBzsfhoc5l58Gm5yToAaZhaOUqjkDgCWNHAULCwOLaTmzswadEqggQwgHuQsHIoZCHQMMQgQGubVEcxOPFAcMDAYUA85eWARmfSRQCdcMe0zeP1AAygwLlJtPNAAL19DARdPzBOWSm1brJBi45soRAWQAAkrQIykShQ9wVhHCwCQCACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiRMDjI0Fd30%2FiI2UA5GSS5UDj2l6NoqgOgN4gksEBgYFf0FDqKgHnyZ9OX8HrgYHdHpcHQULXAS2qKpENRg7eAMLC7kTBaixUYFkKAzWAAnLC7FLVxLWDBLKCwaKTULgEwbLA4hJtOkSBNqITT3xEgfLpBtzE%2FjiuL04RGEBgwWhShRgQExHBAAh%2BQQJCgAAACwAAAAAIAAgAAAE7xDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfZiCqGk5dTESJeaOAlClzsJsqwiJwiqnFrb2nS9kmIcgEsjQydLiIlHehhpejaIjzh9eomSjZR%2BipslWIRLAgMDOR2DOqKogTB9pCUJBagDBXR6XB0EBkIIsaRsGGMMAxoDBgYHTKJiUYEGDAzHC9EACcUGkIgFzgwZ0QsSBcXHiQvOwgDdEwfFs0sDzt4S6BK4xYjkDOzn0unFeBzOBijIm1Dgmg5YFQwsCMjp1oJ8LyIAACH5BAkKAAAALAAAAAAgACAAAATwEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GGl6NoiPOH16iZKNlH6KmyWFOggHhEEvAwwMA0N9GBsEC6amhnVcEwavDAazGwIDaH1ipaYLBUTCGgQDA8NdHz0FpqgTBwsLqAbWAAnIA4FWKdMLGdYGEgraigbT0OITBcg5QwPT4xLrROZL6AuQAPUS7bxLpoWidY0JtxLHKhwwMJBTHgPKdEQAACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GAULDJCRiXo1CpGXDJOUjY%2BYip9DhToJA4RBLwMLCwVDfRgbBAaqqoZ1XBMHswsHtxtFaH1iqaoGNgAIxRpbFAgfPQSqpbgGBqUD1wBXeCYp1AYZ19JJOYgH1KwA4UBvQwXUBxPqVD9L3sbp2BNk2xvvFPJd%2BMFCN6HAAIKgNggY0KtEBAAh%2BQQJCgAAACwAAAAAIAAgAAAE6BDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfYIDMaAFdTESJeaEDAIMxYFqrOUaNW4E4ObYcCXaiBVEgULe0NJaxxtYksjh2NLkZISgDgJhHthkpU4mW6blRiYmZOlh4JWkDqILwUGBnE6TYEbCgevr0N1gH4At7gHiRpFaLNrrq8HNgAJA70AWxQIH1%2BvsYMDAzZQPC9VCNkDWUhGkuE5PxJNwiUK4UfLzOlD4WvzAHaoG9nxPi5d%2BjYUqfAhhykOFwJWiAAAIfkECQoAAAAsAAAAACAAIAAABPAQyElpUqnqzaciSoVkXVUMFaFSwlpOCcMYlErAavhOMnNLNo8KsZsMZItJEIDIFSkLGQoQTNhIsFehRww2CQLKF0tYGKYSg%2BygsZIuNqJksKgbfgIGepNo2cIUB3V1B3IvNiBYNQaDSTtfhhx0CwVPI0UJe0%2Bbm4g5VgcGoqOcnjmjqDSdnhgEoamcsZuXO1aWQy8KAwOAuTYYGwi7w5h%2BKr0SJ8MFihpNbx%2B4Erq7BYBuzsdiH1jCAzoSfl0rVirNbRXlBBlLX%2BBP0XJLAPGzTkAuAOqb0WT5AH7OcdCm5B8TgRwSRKIHQtaLCwg1RAAAOwAAAAAAAAAAAA%3D%3D); - visibility: visible; - opacity: 0.6; - transition: all 0.3s ease; } + position: absolute; + display: block; + top: 50%; + left: 50%; + width: 32px; + height: 32px; + margin: -16px 0 0 -16px; + z-index: 10; + background-image: url(data:image/gif;base64,R0lGODlhIAAgAPMAAJmZmf%2F%2F%2F6%2Bvr8nJybW1tcDAwOjo6Nvb26ioqKOjo7Ozs%2FLy8vz8%2FAAAAAAAAAAAACH%2FC05FVFNDQVBFMi4wAwEAAAAh%2FhpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh%2BQQJCgAAACwAAAAAIAAgAAAE5xDISWlhperN52JLhSSdRgwVo1ICQZRUsiwHpTJT4iowNS8vyW2icCF6k8HMMBkCEDskxTBDAZwuAkkqIfxIQyhBQBFvAQSDITM5VDW6XNE4KagNh6Bgwe60smQUB3d4Rz1ZBApnFASDd0hihh12BkE9kjAJVlycXIg7CQIFA6SlnJ87paqbSKiKoqusnbMdmDC2tXQlkUhziYtyWTxIfy6BE8WJt5YJvpJivxNaGmLHT0VnOgSYf0dZXS7APdpB309RnHOG5gDqXGLDaC457D1zZ%2FV%2FnmOM82XiHRLYKhKP1oZmADdEAAAh%2BQQJCgAAACwAAAAAIAAgAAAE6hDISWlZpOrNp1lGNRSdRpDUolIGw5RUYhhHukqFu8DsrEyqnWThGvAmhVlteBvojpTDDBUEIFwMFBRAmBkSgOrBFZogCASwBDEY%2FCZSg7GSE0gSCjQBMVG023xWBhklAnoEdhQEfyNqMIcKjhRsjEdnezB%2BA4k8gTwJhFuiW4dokXiloUepBAp5qaKpp6%2BHo7aWW54wl7obvEe0kRuoplCGepwSx2jJvqHEmGt6whJpGpfJCHmOoNHKaHx61WiSR92E4lbFoq%2BB6QDtuetcaBPnW6%2BO7wDHpIiK9SaVK5GgV543tzjgGcghAgAh%2BQQJCgAAACwAAAAAIAAgAAAE7hDISSkxpOrN5zFHNWRdhSiVoVLHspRUMoyUakyEe8PTPCATW9A14E0UvuAKMNAZKYUZCiBMuBakSQKG8G2FzUWox2AUtAQFcBKlVQoLgQReZhQlCIJesQXI5B0CBnUMOxMCenoCfTCEWBsJColTMANldx15BGs8B5wlCZ9Po6OJkwmRpnqkqnuSrayqfKmqpLajoiW5HJq7FL1Gr2mMMcKUMIiJgIemy7xZtJsTmsM4xHiKv5KMCXqfyUCJEonXPN2rAOIAmsfB3uPoAK%2B%2BG%2Bw48edZPK%2BM6hLJpQg484enXIdQFSS1u6UhksENEQAAIfkECQoAAAAsAAAAACAAIAAABOcQyEmpGKLqzWcZRVUQnZYg1aBSh2GUVEIQ2aQOE%2BG%2BcD4ntpWkZQj1JIiZIogDFFyHI0UxQwFugMSOFIPJftfVAEoZLBbcLEFhlQiqGp1Vd140AUklUN3eCA51C1EWMzMCezCBBmkxVIVHBWd3HHl9JQOIJSdSnJ0TDKChCwUJjoWMPaGqDKannasMo6WnM562R5YluZRwur0wpgqZE7NKUm%2BFNRPIhjBJxKZteWuIBMN4zRMIVIhffcgojwCF117i4nlLnY5ztRLsnOk%2BaV%2BoJY7V7m76PdkS4trKcdg0Zc0tTcKkRAAAIfkECQoAAAAsAAAAACAAIAAABO4QyEkpKqjqzScpRaVkXZWQEximw1BSCUEIlDohrft6cpKCk5xid5MNJTaAIkekKGQkWyKHkvhKsR7ARmitkAYDYRIbUQRQjWBwJRzChi9CRlBcY1UN4g0%2FVNB0AlcvcAYHRyZPdEQFYV8ccwR5HWxEJ02YmRMLnJ1xCYp0Y5idpQuhopmmC2KgojKasUQDk5BNAwwMOh2RtRq5uQuPZKGIJQIGwAwGf6I0JXMpC8C7kXWDBINFMxS4DKMAWVWAGYsAdNqW5uaRxkSKJOZKaU3tPOBZ4DuK2LATgJhkPJMgTwKCdFjyPHEnKxFCDhEAACH5BAkKAAAALAAAAAAgACAAAATzEMhJaVKp6s2nIkolIJ2WkBShpkVRWqqQrhLSEu9MZJKK9y1ZrqYK9WiClmvoUaF8gIQSNeF1Er4MNFn4SRSDARWroAIETg1iVwuHjYB1kYc1mwruwXKC9gmsJXliGxc%2BXiUCby9ydh1sOSdMkpMTBpaXBzsfhoc5l58Gm5yToAaZhaOUqjkDgCWNHAULCwOLaTmzswadEqggQwgHuQsHIoZCHQMMQgQGubVEcxOPFAcMDAYUA85eWARmfSRQCdcMe0zeP1AAygwLlJtPNAAL19DARdPzBOWSm1brJBi45soRAWQAAkrQIykShQ9wVhHCwCQCACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiRMDjI0Fd30%2FiI2UA5GSS5UDj2l6NoqgOgN4gksEBgYFf0FDqKgHnyZ9OX8HrgYHdHpcHQULXAS2qKpENRg7eAMLC7kTBaixUYFkKAzWAAnLC7FLVxLWDBLKCwaKTULgEwbLA4hJtOkSBNqITT3xEgfLpBtzE%2FjiuL04RGEBgwWhShRgQExHBAAh%2BQQJCgAAACwAAAAAIAAgAAAE7xDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfZiCqGk5dTESJeaOAlClzsJsqwiJwiqnFrb2nS9kmIcgEsjQydLiIlHehhpejaIjzh9eomSjZR%2BipslWIRLAgMDOR2DOqKogTB9pCUJBagDBXR6XB0EBkIIsaRsGGMMAxoDBgYHTKJiUYEGDAzHC9EACcUGkIgFzgwZ0QsSBcXHiQvOwgDdEwfFs0sDzt4S6BK4xYjkDOzn0unFeBzOBijIm1Dgmg5YFQwsCMjp1oJ8LyIAACH5BAkKAAAALAAAAAAgACAAAATwEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GGl6NoiPOH16iZKNlH6KmyWFOggHhEEvAwwMA0N9GBsEC6amhnVcEwavDAazGwIDaH1ipaYLBUTCGgQDA8NdHz0FpqgTBwsLqAbWAAnIA4FWKdMLGdYGEgraigbT0OITBcg5QwPT4xLrROZL6AuQAPUS7bxLpoWidY0JtxLHKhwwMJBTHgPKdEQAACH5BAkKAAAALAAAAAAgACAAAATrEMhJaVKp6s2nIkqFZF2VIBWhUsJaTokqUCoBq%2BE71SRQeyqUToLA7VxF0JDyIQh%2FMVVPMt1ECZlfcjZJ9mIKoaTl1MRIl5o4CUKXOwmyrCInCKqcWtvadL2SYhyASyNDJ0uIiUd6GAULDJCRiXo1CpGXDJOUjY%2BYip9DhToJA4RBLwMLCwVDfRgbBAaqqoZ1XBMHswsHtxtFaH1iqaoGNgAIxRpbFAgfPQSqpbgGBqUD1wBXeCYp1AYZ19JJOYgH1KwA4UBvQwXUBxPqVD9L3sbp2BNk2xvvFPJd%2BMFCN6HAAIKgNggY0KtEBAAh%2BQQJCgAAACwAAAAAIAAgAAAE6BDISWlSqerNpyJKhWRdlSAVoVLCWk6JKlAqAavhO9UkUHsqlE6CwO1cRdCQ8iEIfzFVTzLdRAmZX3I2SfYIDMaAFdTESJeaEDAIMxYFqrOUaNW4E4ObYcCXaiBVEgULe0NJaxxtYksjh2NLkZISgDgJhHthkpU4mW6blRiYmZOlh4JWkDqILwUGBnE6TYEbCgevr0N1gH4At7gHiRpFaLNrrq8HNgAJA70AWxQIH1%2BvsYMDAzZQPC9VCNkDWUhGkuE5PxJNwiUK4UfLzOlD4WvzAHaoG9nxPi5d%2BjYUqfAhhykOFwJWiAAAIfkECQoAAAAsAAAAACAAIAAABPAQyElpUqnqzaciSoVkXVUMFaFSwlpOCcMYlErAavhOMnNLNo8KsZsMZItJEIDIFSkLGQoQTNhIsFehRww2CQLKF0tYGKYSg%2BygsZIuNqJksKgbfgIGepNo2cIUB3V1B3IvNiBYNQaDSTtfhhx0CwVPI0UJe0%2Bbm4g5VgcGoqOcnjmjqDSdnhgEoamcsZuXO1aWQy8KAwOAuTYYGwi7w5h%2BKr0SJ8MFihpNbx%2B4Erq7BYBuzsdiH1jCAzoSfl0rVirNbRXlBBlLX%2BBP0XJLAPGzTkAuAOqb0WT5AH7OcdCm5B8TgRwSRKIHQtaLCwg1RAAAOwAAAAAAAAAAAA%3D%3D); + visibility: visible; + opacity: 0.6; + transition: all 0.3s ease; +} .reveal .overlay header { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 40px; - z-index: 2; - border-bottom: 1px solid #222; } + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 40px; + z-index: 2; + border-bottom: 1px solid #222; +} .reveal .overlay header a { - display: inline-block; - width: 40px; - height: 40px; - line-height: 36px; - padding: 0 10px; - float: right; - opacity: 0.6; - box-sizing: border-box; } + display: inline-block; + width: 40px; + height: 40px; + line-height: 36px; + padding: 0 10px; + float: right; + opacity: 0.6; + box-sizing: border-box; +} .reveal .overlay header a:hover { - opacity: 1; } + opacity: 1; +} .reveal .overlay header a .icon { - display: inline-block; - width: 20px; - height: 20px; - background-position: 50% 50%; - background-size: 100%; - background-repeat: no-repeat; } + display: inline-block; + width: 20px; + height: 20px; + background-position: 50% 50%; + background-size: 100%; + background-repeat: no-repeat; +} .reveal .overlay header a.close .icon { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABkklEQVRYR8WX4VHDMAxG6wnoJrABZQPYBCaBTWAD2g1gE5gg6OOsXuxIlr40d81dfrSJ9V4c2VLK7spHuTJ/5wpM07QXuXc5X0opX2tEJcadjHuV80li/FgxTIEK/5QBCICBD6xEhSMGHgQPgBgLiYVAB1dpSqKDawxTohFw4JSEA3clzgIBPCURwE2JucBR7rhPJJv5OpJwDX+SfDjgx1wACQeJG1aChP9K/IMmdZ8DtESV1WyP3Bt4MwM6sj4NMxMYiqUWHQu4KYA/SYkIjOsm3BXYWMKFDwU2khjCQ4ELJUJ4SmClRArOCmSXGuKma0fYD5CbzHxFpCSGAhfAVSSUGDUk2BWZaff2g6GE15BsBQ9nwmpIGDiyHQddwNTMKkbZaf9fajXQca1EX44puJZUsnY0ObGmITE3GVLCbEhQUjGVt146j6oasWN+49Vph2w1pZ5EansNZqKBm1txbU57iRRcZ86RWMDdWtBJUHBHwoQPi1GV+JCbntmvok7iTX4/Up9mgyTc/FJYDTcndgH/AA5A/CHsyEkVAAAAAElFTkSuQmCC); } + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAABkklEQVRYR8WX4VHDMAxG6wnoJrABZQPYBCaBTWAD2g1gE5gg6OOsXuxIlr40d81dfrSJ9V4c2VLK7spHuTJ/5wpM07QXuXc5X0opX2tEJcadjHuV80li/FgxTIEK/5QBCICBD6xEhSMGHgQPgBgLiYVAB1dpSqKDawxTohFw4JSEA3clzgIBPCURwE2JucBR7rhPJJv5OpJwDX+SfDjgx1wACQeJG1aChP9K/IMmdZ8DtESV1WyP3Bt4MwM6sj4NMxMYiqUWHQu4KYA/SYkIjOsm3BXYWMKFDwU2khjCQ4ELJUJ4SmClRArOCmSXGuKma0fYD5CbzHxFpCSGAhfAVSSUGDUk2BWZaff2g6GE15BsBQ9nwmpIGDiyHQddwNTMKkbZaf9fajXQca1EX44puJZUsnY0ObGmITE3GVLCbEhQUjGVt146j6oasWN+49Vph2w1pZ5EansNZqKBm1txbU57iRRcZ86RWMDdWtBJUHBHwoQPi1GV+JCbntmvok7iTX4/Up9mgyTc/FJYDTcndgH/AA5A/CHsyEkVAAAAAElFTkSuQmCC); +} .reveal .overlay header a.external .icon { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAcElEQVRYR+2WSQoAIQwEzf8f7XiOMkUQxUPlGkM3hVmiQfQR9GYnH1SsAQlI4DiBqkCMoNb9y2e90IAEJPAcgdznU9+engMaeJ7Azh5Y1U67gAho4DqBqmB1buAf0MB1AlVBek83ZPkmJMGc1wAR+AAqod/B97TRpQAAAABJRU5ErkJggg==); } + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAcElEQVRYR+2WSQoAIQwEzf8f7XiOMkUQxUPlGkM3hVmiQfQR9GYnH1SsAQlI4DiBqkCMoNb9y2e90IAEJPAcgdznU9+engMaeJ7Azh5Y1U67gAho4DqBqmB1buAf0MB1AlVBek83ZPkmJMGc1wAR+AAqod/B97TRpQAAAABJRU5ErkJggg==); +} .reveal .overlay .viewport { - position: absolute; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - top: 40px; - right: 0; - bottom: 0; - left: 0; } + position: absolute; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + top: 40px; + right: 0; + bottom: 0; + left: 0; +} .reveal .overlay.overlay-preview .viewport iframe { - width: 100%; - height: 100%; - max-width: 100%; - max-height: 100%; - border: 0; - opacity: 0; - visibility: hidden; - transition: all 0.3s ease; } + width: 100%; + height: 100%; + max-width: 100%; + max-height: 100%; + border: 0; + opacity: 0; + visibility: hidden; + transition: all 0.3s ease; +} .reveal .overlay.overlay-preview.loaded .viewport iframe { - opacity: 1; - visibility: visible; } + opacity: 1; + visibility: visible; +} .reveal .overlay.overlay-preview.loaded .viewport-inner { - position: absolute; - z-index: -1; - left: 0; - top: 45%; - width: 100%; - text-align: center; - letter-spacing: normal; } + position: absolute; + z-index: -1; + left: 0; + top: 45%; + width: 100%; + text-align: center; + letter-spacing: normal; +} .reveal .overlay.overlay-preview .x-frame-error { - opacity: 0; - transition: opacity 0.3s ease 0.3s; } + opacity: 0; + transition: opacity 0.3s ease 0.3s; +} .reveal .overlay.overlay-preview.loaded .x-frame-error { - opacity: 1; } + opacity: 1; +} .reveal .overlay.overlay-preview.loaded .spinner { - opacity: 0; - visibility: hidden; - -webkit-transform: scale(0.2); - transform: scale(0.2); } + opacity: 0; + visibility: hidden; + -webkit-transform: scale(0.2); + transform: scale(0.2); +} .reveal .overlay.overlay-help .viewport { - overflow: auto; - color: #fff; } + overflow: auto; + color: #fff; +} .reveal .overlay.overlay-help .viewport .viewport-inner { - width: 600px; - margin: auto; - padding: 20px 20px 80px 20px; - text-align: center; - letter-spacing: normal; } + width: 600px; + margin: auto; + padding: 20px 20px 80px 20px; + text-align: center; + letter-spacing: normal; +} .reveal .overlay.overlay-help .viewport .viewport-inner .title { - font-size: 20px; } + font-size: 20px; +} .reveal .overlay.overlay-help .viewport .viewport-inner table { - border: 1px solid #fff; - border-collapse: collapse; - font-size: 16px; } + border: 1px solid #fff; + border-collapse: collapse; + font-size: 16px; +} .reveal .overlay.overlay-help .viewport .viewport-inner table th, .reveal .overlay.overlay-help .viewport .viewport-inner table td { - width: 200px; - padding: 14px; - border: 1px solid #fff; - vertical-align: middle; } + width: 200px; + padding: 14px; + border: 1px solid #fff; + vertical-align: middle; +} .reveal .overlay.overlay-help .viewport .viewport-inner table th { - padding-top: 20px; - padding-bottom: 20px; } + padding-top: 20px; + padding-bottom: 20px; +} /********************************************* * PLAYBACK COMPONENT *********************************************/ .reveal .playback { - position: absolute; - left: 15px; - bottom: 20px; - z-index: 30; - cursor: pointer; - transition: all 400ms ease; - -webkit-tap-highlight-color: transparent; } + position: absolute; + left: 15px; + bottom: 20px; + z-index: 30; + cursor: pointer; + transition: all 400ms ease; + -webkit-tap-highlight-color: transparent; +} .reveal.overview .playback { - opacity: 0; - visibility: hidden; } + opacity: 0; + visibility: hidden; +} /********************************************* * ROLLING LINKS *********************************************/ .reveal .roll { - display: inline-block; - line-height: 1.2; - overflow: hidden; - vertical-align: top; - -webkit-perspective: 400px; - perspective: 400px; - -webkit-perspective-origin: 50% 50%; - perspective-origin: 50% 50%; } + display: inline-block; + line-height: 1.2; + overflow: hidden; + vertical-align: top; + -webkit-perspective: 400px; + perspective: 400px; + -webkit-perspective-origin: 50% 50%; + perspective-origin: 50% 50%; +} .reveal .roll:hover { - background: none; - text-shadow: none; } + background: none; + text-shadow: none; +} .reveal .roll span { - display: block; - position: relative; - padding: 0 2px; - pointer-events: none; - transition: all 400ms ease; - -webkit-transform-origin: 50% 0%; - transform-origin: 50% 0%; - -webkit-transform-style: preserve-3d; - transform-style: preserve-3d; - -webkit-backface-visibility: hidden; - backface-visibility: hidden; } + display: block; + position: relative; + padding: 0 2px; + pointer-events: none; + transition: all 400ms ease; + -webkit-transform-origin: 50% 0%; + transform-origin: 50% 0%; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; +} .reveal .roll:hover span { - background: rgba(0, 0, 0, 0.5); - -webkit-transform: translate3d(0px, 0px, -45px) rotateX(90deg); - transform: translate3d(0px, 0px, -45px) rotateX(90deg); } + background: rgba(0, 0, 0, 0.5); + -webkit-transform: translate3d(0px, 0px, -45px) rotateX(90deg); + transform: translate3d(0px, 0px, -45px) rotateX(90deg); +} .reveal .roll span:after { - content: attr(data-title); - display: block; - position: absolute; - left: 0; - top: 0; - padding: 0 2px; - -webkit-backface-visibility: hidden; - backface-visibility: hidden; - -webkit-transform-origin: 50% 0%; - transform-origin: 50% 0%; - -webkit-transform: translate3d(0px, 110%, 0px) rotateX(-90deg); - transform: translate3d(0px, 110%, 0px) rotateX(-90deg); } + content: attr(data-title); + display: block; + position: absolute; + left: 0; + top: 0; + padding: 0 2px; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transform-origin: 50% 0%; + transform-origin: 50% 0%; + -webkit-transform: translate3d(0px, 110%, 0px) rotateX(-90deg); + transform: translate3d(0px, 110%, 0px) rotateX(-90deg); +} /********************************************* * SPEAKER NOTES *********************************************/ .reveal aside.notes { - display: none; } + display: none; +} .reveal .speaker-notes { - display: none; - position: absolute; - width: 25vw; - height: 100%; - top: 0; - left: 100%; - padding: 14px 18px 14px 18px; - z-index: 1; - font-size: 18px; - line-height: 1.4; - border: 1px solid rgba(0, 0, 0, 0.05); - color: #222; - background-color: #f5f5f5; - overflow: auto; - box-sizing: border-box; - text-align: left; - font-family: Helvetica, sans-serif; - -webkit-overflow-scrolling: touch; } - .reveal .speaker-notes .notes-placeholder { + display: none; + position: absolute; + width: 25vw; + height: 100%; + top: 0; + left: 100%; + padding: 14px 18px 14px 18px; + z-index: 1; + font-size: 18px; + line-height: 1.4; + border: 1px solid rgba(0, 0, 0, 0.05); + color: #222; + background-color: #f5f5f5; + overflow: auto; + box-sizing: border-box; + text-align: left; + font-family: Helvetica, sans-serif; + -webkit-overflow-scrolling: touch; +} + +.reveal .speaker-notes .notes-placeholder { color: #ccc; - font-style: italic; } - .reveal .speaker-notes:focus { - outline: none; } - .reveal .speaker-notes:before { + font-style: italic; +} + +.reveal .speaker-notes:focus { + outline: none; +} + +.reveal .speaker-notes:before { content: 'Speaker notes'; display: block; margin-bottom: 10px; - opacity: 0.5; } + opacity: 0.5; +} .reveal.show-notes { - max-width: 75vw; - overflow: visible; } + max-width: 75vw; + overflow: visible; +} .reveal.show-notes .speaker-notes { - display: block; } + display: block; +} @media screen and (min-width: 1600px) { - .reveal .speaker-notes { - font-size: 20px; } } + .reveal .speaker-notes { + font-size: 20px; + } +} @media screen and (max-width: 1024px) { - .reveal.show-notes { - border-left: 0; - max-width: none; - max-height: 70%; - overflow: visible; } - .reveal.show-notes .speaker-notes { - top: 100%; - left: 0; - width: 100%; - height: 42.8571428571%; } } + .reveal.show-notes { + border-left: 0; + max-width: none; + max-height: 70%; + overflow: visible; + } + + .reveal.show-notes .speaker-notes { + top: 100%; + left: 0; + width: 100%; + height: 42.8571428571%; + } +} @media screen and (max-width: 600px) { - .reveal.show-notes { - max-height: 60%; } - .reveal.show-notes .speaker-notes { - top: 100%; - height: 66.6666666667%; } - .reveal .speaker-notes { - font-size: 14px; } } + .reveal.show-notes { + max-height: 60%; + } + + .reveal.show-notes .speaker-notes { + top: 100%; + height: 66.6666666667%; + } + + .reveal .speaker-notes { + font-size: 14px; + } +} /********************************************* * ZOOM PLUGIN @@ -1541,15 +1869,19 @@ body { .zoomed .reveal *, .zoomed .reveal *:before, .zoomed .reveal *:after { - -webkit-backface-visibility: visible !important; - backface-visibility: visible !important; } + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} .zoomed .reveal .progress, .zoomed .reveal .controls { - opacity: 0; } + opacity: 0; +} .zoomed .reveal .roll span { - background: none; } + background: none; +} .zoomed .reveal .roll span:after { - visibility: hidden; } + visibility: hidden; +} diff --git a/site/static/slides/css/theme/hawkBit.css b/site/static/slides/css/theme/hawkBit.css index a7502d6f9..7d3af42bc 100644 --- a/site/static/slides/css/theme/hawkBit.css +++ b/site/static/slides/css/theme/hawkBit.css @@ -1,23 +1,22 @@ - /********************************************* * GLOBAL STYLES *********************************************/ body { - border-left: 0px solid #ffffff; - overflow: auto; - background-color: white; - background-position: center bottom; - background-repeat: no-repeat; - background-size: 100% 17px; - font-family: Helvetica, Arial, sans-serif; - font-weight: normal; - color: #2e3032 + border-left: 0px solid #ffffff; + overflow: auto; + background-color: white; + background-position: center bottom; + background-repeat: no-repeat; + background-size: 100% 17px; + font-family: Helvetica, Arial, sans-serif; + font-weight: normal; + color: #2e3032 } .header { - position: relative; - top: 5px; - right: 20px; + position: relative; + top: 5px; + right: 20px; } .footer { @@ -36,64 +35,65 @@ body { } .reveal { - font-family: Helvetica, Arial, sans-serif; - font-size: 25px; - font-weight: normal; - color: #551f62; d + font-family: Helvetica, Arial, sans-serif; + font-size: 25px; + font-weight: normal; + color: #551f62; + d } .reveal .controls { - margin-bottom: 10px + margin-bottom: 10px } .reveal .slide-number { - margin-bottom: 10px + margin-bottom: 10px } ::selection { - color: #fff; - background: #98bdef; - text-shadow: none; + color: #fff; + background: #98bdef; + text-shadow: none; } -.reveal .slides>section, .reveal .slides>section>section { - line-height: 1.1; - font-weight: inherit; - text-align: left; - /* padding-bottom: 25px; */ +.reveal .slides > section, .reveal .slides > section > section { + line-height: 1.1; + font-weight: inherit; + text-align: left; + /* padding-bottom: 25px; */ } /********************************************* * HEADERS *********************************************/ .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { - margin: 0 0 20px 0; - font-family: Helvetica, Arial, sans-serif; - font-weight: 100; - line-height: 1.0; - padding-bottom: 15px; - letter-spacing: normal; - text-shadow: none; - word-wrap: break-word; + margin: 0 0 20px 0; + font-family: Helvetica, Arial, sans-serif; + font-weight: 100; + line-height: 1.0; + padding-bottom: 15px; + letter-spacing: normal; + text-shadow: none; + word-wrap: break-word; } .reveal h1 { - font-size: 3.1em; - text-shadow: none; + font-size: 3.1em; + text-shadow: none; } .reveal h2 { - margin-top: 15px; - font-size: 1.6em; + margin-top: 15px; + font-size: 1.6em; } .reveal h3 { - font-size: 1.2em; + font-size: 1.2em; } .reveal h4 { - font-size: 1.0em; - color: #000; + font-size: 1.0em; + color: #000; } /********************************************* @@ -102,7 +102,7 @@ body { .reveal .intro { - color: #551f62; + color: #551f62; } .noborder img { @@ -119,263 +119,259 @@ body { } .reveal p { - margin: 20px 0; - line-height: 1.3; + margin: 20px 0; + line-height: 1.3; } /* Ensure certain elements are never larger than the slide itself */ .reveal img, .reveal video, .reveal iframe { - max-width: 80%; - max-height: 80% + max-width: 80%; + max-height: 80% } .reveal strong, .reveal b { - font-weight: bold; + font-weight: bold; } .reveal em { - font-style: italic; + font-style: italic; } .reveal ol, .reveal dl, .reveal ul { - display: inline-block; - text-align: left; - margin: 0 0 0 1em; + display: inline-block; + text-align: left; + margin: 0 0 0 1em; } .reveal ol { - list-style-type: decimal; + list-style-type: decimal; } .reveal ul { - list-style-type: disc; - /* margin-top: -15px; - margin-bottom: 20px; */ + list-style-type: disc; + /* margin-top: -15px; + margin-bottom: 20px; */ } .reveal ul ul { - list-style-type: disc; - margin-top: 0px; + list-style-type: disc; + margin-top: 0px; } .reveal ul ul ul { - list-style-type: disc; - margin-top: 0px; + list-style-type: disc; + margin-top: 0px; } .reveal ul ul, .reveal ul ol, .reveal ol ol, .reveal ol ul { - display: block; - margin-left: 40px; + display: block; + margin-left: 40px; } .reveal dt { - font-weight: bold; + font-weight: bold; } .reveal dd { - margin-left: 40px; + margin-left: 40px; } .reveal q, .reveal blockquote { - quotes: none; + quotes: none; } .reveal blockquote { - display: block; - position: relative; - width: 70%; - margin: 20px auto; - padding: 5px; - font-style: italic; - background: rgba(255, 255, 255, 0.05); - box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); + display: block; + position: relative; + width: 70%; + margin: 20px auto; + padding: 5px; + font-style: italic; + background: rgba(255, 255, 255, 0.05); + box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } .reveal blockquote p:first-child, .reveal blockquote p:last-child { - display: inline-block; + display: inline-block; } .reveal q { - font-style: italic; + font-style: italic; } .reveal pre { - display: block; - position: relative; - width: 90%; - margin: 20px auto; - text-align: left; - font-size: 0.55em; - font-family: monospace; - line-height: 1.2em; - word-wrap: break-word; - box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); + display: block; + position: relative; + width: 90%; + margin: 20px auto; + text-align: left; + font-size: 0.55em; + font-family: monospace; + line-height: 1.2em; + word-wrap: break-word; + box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } .reveal code { - font-family: monospace; + font-family: monospace; } .reveal pre code { - display: block; - padding: 5px; - overflow: auto; - max-height: 400px; - word-wrap: normal; - background: #3F3F3F; - color: #DCDCDC; + display: block; + padding: 5px; + overflow: auto; + max-height: 400px; + word-wrap: normal; + background: #3F3F3F; + color: #DCDCDC; } .reveal table { - margin: auto; - border-collapse: collapse; - border-spacing: 0; + margin: auto; + border-collapse: collapse; + border-spacing: 0; } .reveal table th { - font-weight: bold; + font-weight: bold; } .reveal table th, .reveal table td { - text-align: left; - padding: 0.2em 0.5em 0.2em 0.5em; - border-bottom: 1px solid; + text-align: left; + padding: 0.2em 0.5em 0.2em 0.5em; + border-bottom: 1px solid; } .reveal table th[align="center"], .reveal table td[align="center"] { - text-align: center; + text-align: center; } .reveal table th[align="right"], .reveal table td[align="right"] { - text-align: right; + text-align: right; } .reveal table tr:last-child td { - border-bottom: none; + border-bottom: none; } .reveal sup { - vertical-align: super; + vertical-align: super; } .reveal sub { - vertical-align: sub; + vertical-align: sub; } .reveal small { - display: inline-block; - font-size: 0.6em; - line-height: 1.2em; - vertical-align: top; + display: inline-block; + font-size: 0.6em; + line-height: 1.2em; + vertical-align: top; } .reveal small * { - vertical-align: top; + vertical-align: top; } /********************************************* * LINKS *********************************************/ .reveal a { - color: #6eb553; - text-decoration: none; - -webkit-transition: color 0.15s ease; - -moz-transition: color 0.15s ease; - transition: color 0.15s ease; + color: #6eb553; + text-decoration: none; + -webkit-transition: color 0.15s ease; + -moz-transition: color 0.15s ease; + transition: color 0.15s ease; } .reveal a:hover { - color: #6eb553; - text-shadow: none; - border: none; + color: #6eb553; + text-shadow: none; + border: none; } .reveal .roll span:after { - color: #fff; - background: #1a54a1; + color: #fff; + background: #1a54a1; } /********************************************* * IMAGES *********************************************/ .reveal section img { - margin: 15px 0px; - background: rgba(255, 255, 255, 0.12); - border: 1px solid #fff; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); - display: block; - margin-left: auto; - margin-right: auto; + margin: 15px 0px; + background: rgba(255, 255, 255, 0.12); + border: 1px solid #fff; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); + display: block; + margin-left: auto; + margin-right: auto; } .reveal a img { - -webkit-transition: all 0.15s linear; - -moz-transition: all 0.15s linear; - transition: all 0.15s linear; + -webkit-transition: all 0.15s linear; + -moz-transition: all 0.15s linear; + transition: all 0.15s linear; } .reveal a:hover img { - background: rgba(255, 255, 255, 0.2); - border-color: #6eb553; - box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); + background: rgba(255, 255, 255, 0.2); + border-color: #6eb553; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.55); } /********************************************* * NAVIGATION CONTROLS *********************************************/ -.reveal .controls div.navigate-left, .reveal .controls div.navigate-left.enabled - { - border-right-color: #6eb553; +.reveal .controls div.navigate-left, .reveal .controls div.navigate-left.enabled { + border-right-color: #6eb553; } -.reveal .controls div.navigate-right, .reveal .controls div.navigate-right.enabled - { - border-left-color: #6eb553; +.reveal .controls div.navigate-right, .reveal .controls div.navigate-right.enabled { + border-left-color: #6eb553; } -.reveal .controls div.navigate-up, .reveal .controls div.navigate-up.enabled - { - border-bottom-color: #6eb553; +.reveal .controls div.navigate-up, .reveal .controls div.navigate-up.enabled { + border-bottom-color: #6eb553; } -.reveal .controls div.navigate-down, .reveal .controls div.navigate-down.enabled - { - border-top-color: #6eb553; +.reveal .controls div.navigate-down, .reveal .controls div.navigate-down.enabled { + border-top-color: #6eb553; } .reveal .controls div.navigate-left.enabled:hover { - border-right-color: #6eb553; + border-right-color: #6eb553; } .reveal .controls div.navigate-right.enabled:hover { - border-left-color: #6eb553; + border-left-color: #6eb553; } .reveal .controls div.navigate-up.enabled:hover { - border-bottom-color: #6eb553; + border-bottom-color: #6eb553; } .reveal .controls div.navigate-down.enabled:hover { - border-top-color: #6eb553; + border-top-color: #6eb553; } /********************************************* * PROGRESS BAR *********************************************/ .reveal .progress { - background: rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, 0.2); } .reveal .progress span { - background: #003b6a; - -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); - -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); - transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + background: #003b6a; + -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); + transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } /********************************************* * SLIDE NUMBER *********************************************/ .reveal .slide-number { - color: #003b6a; + color: #003b6a; } diff --git a/site/static/slides/js/reveal.js b/site/static/slides/js/reveal.js index f125c5550..eeec02eaf 100755 --- a/site/static/slides/js/reveal.js +++ b/site/static/slides/js/reveal.js @@ -5,391 +5,391 @@ * * Copyright (C) 2017 Hakim El Hattab, http://hakim.se */ -(function( root, factory ) { - if( typeof define === 'function' && define.amd ) { - // AMD. Register as an anonymous module. - define( function() { - root.Reveal = factory(); - return root.Reveal; - } ); - } else if( typeof exports === 'object' ) { - // Node. Does not work with strict CommonJS. - module.exports = factory(); - } else { - // Browser globals. - root.Reveal = factory(); - } -}( this, function() { +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(function () { + root.Reveal = factory(); + return root.Reveal; + }); + } else if (typeof exports === 'object') { + // Node. Does not work with strict CommonJS. + module.exports = factory(); + } else { + // Browser globals. + root.Reveal = factory(); + } +}(this, function () { - 'use strict'; + 'use strict'; - var Reveal; + var Reveal; - // The reveal.js version - var VERSION = '3.6.0'; + // The reveal.js version + var VERSION = '3.6.0'; - var SLIDES_SELECTOR = '.slides section', - HORIZONTAL_SLIDES_SELECTOR = '.slides>section', - VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section', - HOME_SLIDE_SELECTOR = '.slides>section:first-of-type', - UA = navigator.userAgent, + var SLIDES_SELECTOR = '.slides section', + HORIZONTAL_SLIDES_SELECTOR = '.slides>section', + VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section', + HOME_SLIDE_SELECTOR = '.slides>section:first-of-type', + UA = navigator.userAgent, - // Configuration defaults, can be overridden at initialization time - config = { + // Configuration defaults, can be overridden at initialization time + config = { - // The "normal" size of the presentation, aspect ratio will be preserved - // when the presentation is scaled to fit different resolutions - width: 960, - height: 700, + // The "normal" size of the presentation, aspect ratio will be preserved + // when the presentation is scaled to fit different resolutions + width: 960, + height: 700, - // Factor of the display size that should remain empty around the content - margin: 0.04, + // Factor of the display size that should remain empty around the content + margin: 0.04, - // Bounds for smallest/largest possible scale to apply to content - minScale: 0.2, - maxScale: 2.0, + // Bounds for smallest/largest possible scale to apply to content + minScale: 0.2, + maxScale: 2.0, - // Display presentation control arrows - controls: true, + // Display presentation control arrows + controls: true, - // Help the user learn the controls by providing hints, for example by - // bouncing the down arrow when they first encounter a vertical slide - controlsTutorial: true, + // Help the user learn the controls by providing hints, for example by + // bouncing the down arrow when they first encounter a vertical slide + controlsTutorial: true, - // Determines where controls appear, "edges" or "bottom-right" - controlsLayout: 'bottom-right', + // Determines where controls appear, "edges" or "bottom-right" + controlsLayout: 'bottom-right', - // Visibility rule for backwards navigation arrows; "faded", "hidden" - // or "visible" - controlsBackArrows: 'faded', + // Visibility rule for backwards navigation arrows; "faded", "hidden" + // or "visible" + controlsBackArrows: 'faded', - // Display a presentation progress bar - progress: true, + // Display a presentation progress bar + progress: true, - // Display the page number of the current slide - slideNumber: false, + // Display the page number of the current slide + slideNumber: false, - // Determine which displays to show the slide number on - showSlideNumber: 'all', + // Determine which displays to show the slide number on + showSlideNumber: 'all', - // Push each slide change to the browser history - history: false, + // Push each slide change to the browser history + history: false, - // Enable keyboard shortcuts for navigation - keyboard: true, + // Enable keyboard shortcuts for navigation + keyboard: true, - // Optional function that blocks keyboard events when retuning false - keyboardCondition: null, + // Optional function that blocks keyboard events when retuning false + keyboardCondition: null, - // Enable the slide overview mode - overview: true, + // Enable the slide overview mode + overview: true, - // Vertical centering of slides - center: true, + // Vertical centering of slides + center: true, - // Enables touch navigation on devices with touch input - touch: true, + // Enables touch navigation on devices with touch input + touch: true, - // Loop the presentation - loop: false, + // Loop the presentation + loop: false, - // Change the presentation direction to be RTL - rtl: false, + // Change the presentation direction to be RTL + rtl: false, - // Randomizes the order of slides each time the presentation loads - shuffle: false, + // Randomizes the order of slides each time the presentation loads + shuffle: false, - // Turns fragments on and off globally - fragments: true, + // Turns fragments on and off globally + fragments: true, - // Flags if the presentation is running in an embedded mode, - // i.e. contained within a limited portion of the screen - embedded: false, + // Flags if the presentation is running in an embedded mode, + // i.e. contained within a limited portion of the screen + embedded: false, - // Flags if we should show a help overlay when the question-mark - // key is pressed - help: true, + // Flags if we should show a help overlay when the question-mark + // key is pressed + help: true, - // Flags if it should be possible to pause the presentation (blackout) - pause: true, + // Flags if it should be possible to pause the presentation (blackout) + pause: true, - // Flags if speaker notes should be visible to all viewers - showNotes: false, + // Flags if speaker notes should be visible to all viewers + showNotes: false, - // Global override for autolaying embedded media (video/audio/iframe) - // - null: Media will only autoplay if data-autoplay is present - // - true: All media will autoplay, regardless of individual setting - // - false: No media will autoplay, regardless of individual setting - autoPlayMedia: null, + // Global override for autolaying embedded media (video/audio/iframe) + // - null: Media will only autoplay if data-autoplay is present + // - true: All media will autoplay, regardless of individual setting + // - false: No media will autoplay, regardless of individual setting + autoPlayMedia: null, - // Controls automatic progression to the next slide - // - 0: Auto-sliding only happens if the data-autoslide HTML attribute - // is present on the current slide or fragment - // - 1+: All slides will progress automatically at the given interval - // - false: No auto-sliding, even if data-autoslide is present - autoSlide: 0, + // Controls automatic progression to the next slide + // - 0: Auto-sliding only happens if the data-autoslide HTML attribute + // is present on the current slide or fragment + // - 1+: All slides will progress automatically at the given interval + // - false: No auto-sliding, even if data-autoslide is present + autoSlide: 0, - // Stop auto-sliding after user input - autoSlideStoppable: true, + // Stop auto-sliding after user input + autoSlideStoppable: true, - // Use this method for navigation when auto-sliding (defaults to navigateNext) - autoSlideMethod: null, + // Use this method for navigation when auto-sliding (defaults to navigateNext) + autoSlideMethod: null, - // Enable slide navigation via mouse wheel - mouseWheel: false, + // Enable slide navigation via mouse wheel + mouseWheel: false, - // Apply a 3D roll to links on hover - rollingLinks: false, + // Apply a 3D roll to links on hover + rollingLinks: false, - // Hides the address bar on mobile devices - hideAddressBar: true, + // Hides the address bar on mobile devices + hideAddressBar: true, - // Opens links in an iframe preview overlay - previewLinks: false, + // Opens links in an iframe preview overlay + previewLinks: false, - // Exposes the reveal.js API through window.postMessage - postMessage: true, + // Exposes the reveal.js API through window.postMessage + postMessage: true, - // Dispatches all reveal.js events to the parent window through postMessage - postMessageEvents: false, + // Dispatches all reveal.js events to the parent window through postMessage + postMessageEvents: false, - // Focuses body when page changes visibility to ensure keyboard shortcuts work - focusBodyOnPageVisibilityChange: true, + // Focuses body when page changes visibility to ensure keyboard shortcuts work + focusBodyOnPageVisibilityChange: true, - // Transition style - transition: 'slide', // none/fade/slide/convex/concave/zoom + // Transition style + transition: 'slide', // none/fade/slide/convex/concave/zoom - // Transition speed - transitionSpeed: 'default', // default/fast/slow + // Transition speed + transitionSpeed: 'default', // default/fast/slow - // Transition style for full page slide backgrounds - backgroundTransition: 'fade', // none/fade/slide/convex/concave/zoom + // Transition style for full page slide backgrounds + backgroundTransition: 'fade', // none/fade/slide/convex/concave/zoom - // Parallax background image - parallaxBackgroundImage: '', // CSS syntax, e.g. "a.jpg" + // Parallax background image + parallaxBackgroundImage: '', // CSS syntax, e.g. "a.jpg" - // Parallax background size - parallaxBackgroundSize: '', // CSS syntax, e.g. "3000px 2000px" + // Parallax background size + parallaxBackgroundSize: '', // CSS syntax, e.g. "3000px 2000px" - // Amount of pixels to move the parallax background per slide step - parallaxBackgroundHorizontal: null, - parallaxBackgroundVertical: null, + // Amount of pixels to move the parallax background per slide step + parallaxBackgroundHorizontal: null, + parallaxBackgroundVertical: null, - // The maximum number of pages a single slide can expand onto when printing - // to PDF, unlimited by default - pdfMaxPagesPerSlide: Number.POSITIVE_INFINITY, + // The maximum number of pages a single slide can expand onto when printing + // to PDF, unlimited by default + pdfMaxPagesPerSlide: Number.POSITIVE_INFINITY, - // Offset used to reduce the height of content within exported PDF pages. - // This exists to account for environment differences based on how you - // print to PDF. CLI printing options, like phantomjs and wkpdf, can end - // on precisely the total height of the document whereas in-browser - // printing has to end one pixel before. - pdfPageHeightOffset: -1, + // Offset used to reduce the height of content within exported PDF pages. + // This exists to account for environment differences based on how you + // print to PDF. CLI printing options, like phantomjs and wkpdf, can end + // on precisely the total height of the document whereas in-browser + // printing has to end one pixel before. + pdfPageHeightOffset: -1, - // Number of slides away from the current that are visible - viewDistance: 3, + // Number of slides away from the current that are visible + viewDistance: 3, - // The display mode that will be used to show slides - display: 'block', + // The display mode that will be used to show slides + display: 'block', - // Script dependencies to load - dependencies: [] + // Script dependencies to load + dependencies: [] - }, + }, - // Flags if Reveal.initialize() has been called - initialized = false, + // Flags if Reveal.initialize() has been called + initialized = false, - // Flags if reveal.js is loaded (has dispatched the 'ready' event) - loaded = false, + // Flags if reveal.js is loaded (has dispatched the 'ready' event) + loaded = false, - // Flags if the overview mode is currently active - overview = false, + // Flags if the overview mode is currently active + overview = false, - // Holds the dimensions of our overview slides, including margins - overviewSlideWidth = null, - overviewSlideHeight = null, + // Holds the dimensions of our overview slides, including margins + overviewSlideWidth = null, + overviewSlideHeight = null, - // The horizontal and vertical index of the currently active slide - indexh, - indexv, + // The horizontal and vertical index of the currently active slide + indexh, + indexv, - // The previous and current slide HTML elements - previousSlide, - currentSlide, + // The previous and current slide HTML elements + previousSlide, + currentSlide, - previousBackground, + previousBackground, - // Remember which directions that the user has navigated towards - hasNavigatedRight = false, - hasNavigatedDown = false, + // Remember which directions that the user has navigated towards + hasNavigatedRight = false, + hasNavigatedDown = false, - // Slides may hold a data-state attribute which we pick up and apply - // as a class to the body. This list contains the combined state of - // all current slides. - state = [], + // Slides may hold a data-state attribute which we pick up and apply + // as a class to the body. This list contains the combined state of + // all current slides. + state = [], - // The current scale of the presentation (see width/height config) - scale = 1, + // The current scale of the presentation (see width/height config) + scale = 1, - // CSS transform that is currently applied to the slides container, - // split into two groups - slidesTransform = { layout: '', overview: '' }, + // CSS transform that is currently applied to the slides container, + // split into two groups + slidesTransform = {layout: '', overview: ''}, - // Cached references to DOM elements - dom = {}, + // Cached references to DOM elements + dom = {}, - // Features supported by the browser, see #checkCapabilities() - features = {}, + // Features supported by the browser, see #checkCapabilities() + features = {}, - // Client is a mobile device, see #checkCapabilities() - isMobileDevice, + // Client is a mobile device, see #checkCapabilities() + isMobileDevice, - // Client is a desktop Chrome, see #checkCapabilities() - isChrome, + // Client is a desktop Chrome, see #checkCapabilities() + isChrome, - // Throttles mouse wheel navigation - lastMouseWheelStep = 0, + // Throttles mouse wheel navigation + lastMouseWheelStep = 0, - // Delays updates to the URL due to a Chrome thumbnailer bug - writeURLTimeout = 0, + // Delays updates to the URL due to a Chrome thumbnailer bug + writeURLTimeout = 0, - // Flags if the interaction event listeners are bound - eventsAreBound = false, + // Flags if the interaction event listeners are bound + eventsAreBound = false, - // The current auto-slide duration - autoSlide = 0, + // The current auto-slide duration + autoSlide = 0, - // Auto slide properties - autoSlidePlayer, - autoSlideTimeout = 0, - autoSlideStartTime = -1, - autoSlidePaused = false, + // Auto slide properties + autoSlidePlayer, + autoSlideTimeout = 0, + autoSlideStartTime = -1, + autoSlidePaused = false, - // Holds information about the currently ongoing touch input - touch = { - startX: 0, - startY: 0, - startSpan: 0, - startCount: 0, - captured: false, - threshold: 40 - }, + // Holds information about the currently ongoing touch input + touch = { + startX: 0, + startY: 0, + startSpan: 0, + startCount: 0, + captured: false, + threshold: 40 + }, - // Holds information about the keyboard shortcuts - keyboardShortcuts = { - 'N , SPACE': 'Next slide', - 'P': 'Previous slide', - '← , H': 'Navigate left', - '→ , L': 'Navigate right', - '↑ , K': 'Navigate up', - '↓ , J': 'Navigate down', - 'Home': 'First slide', - 'End': 'Last slide', - 'B , .': 'Pause', - 'F': 'Fullscreen', - 'ESC, O': 'Slide overview' - }; + // Holds information about the keyboard shortcuts + keyboardShortcuts = { + 'N , SPACE': 'Next slide', + 'P': 'Previous slide', + '← , H': 'Navigate left', + '→ , L': 'Navigate right', + '↑ , K': 'Navigate up', + '↓ , J': 'Navigate down', + 'Home': 'First slide', + 'End': 'Last slide', + 'B , .': 'Pause', + 'F': 'Fullscreen', + 'ESC, O': 'Slide overview' + }; - /** - * Starts up the presentation if the client is capable. - */ - function initialize( options ) { + /** + * Starts up the presentation if the client is capable. + */ + function initialize(options) { - // Make sure we only initialize once - if( initialized === true ) return; + // Make sure we only initialize once + if (initialized === true) return; - initialized = true; + initialized = true; - checkCapabilities(); + checkCapabilities(); - if( !features.transforms2d && !features.transforms3d ) { - document.body.setAttribute( 'class', 'no-transforms' ); + if (!features.transforms2d && !features.transforms3d) { + document.body.setAttribute('class', 'no-transforms'); - // Since JS won't be running any further, we load all lazy - // loading elements upfront - var images = toArray( document.getElementsByTagName( 'img' ) ), - iframes = toArray( document.getElementsByTagName( 'iframe' ) ); - - var lazyLoadable = images.concat( iframes ); + // Since JS won't be running any further, we load all lazy + // loading elements upfront + var images = toArray(document.getElementsByTagName('img')), + iframes = toArray(document.getElementsByTagName('iframe')); + + var lazyLoadable = images.concat(iframes); - for( var i = 0, len = lazyLoadable.length; i < len; i++ ) { - var element = lazyLoadable[i]; - if( element.getAttribute( 'data-src' ) ) { - element.setAttribute( 'src', element.getAttribute( 'data-src' ) ); - element.removeAttribute( 'data-src' ); - } - } - - // If the browser doesn't support core features we won't be - // using JavaScript to control the presentation - return; - } - - // Cache references to key DOM elements - dom.wrapper = document.querySelector( '.reveal' ); - dom.slides = document.querySelector( '.reveal .slides' ); - - // Force a layout when the whole page, incl fonts, has loaded - window.addEventListener( 'load', layout, false ); - - var query = Reveal.getQueryHash(); - - // Do not accept new dependencies via query config to avoid - // the potential of malicious script injection - if( typeof query['dependencies'] !== 'undefined' ) delete query['dependencies']; - - // Copy options over to our config object - extend( config, options ); - extend( config, query ); - - // Hide the address bar in mobile browsers - hideAddressBar(); - - // Loads the dependencies and continues to #start() once done - load(); - - } - - /** - * Inspect the client to see what it's capable of, this - * should only happens once per runtime. - */ - function checkCapabilities() { - - isMobileDevice = /(iphone|ipod|ipad|android)/gi.test( UA ); - isChrome = /chrome/i.test( UA ) && !/edge/i.test( UA ); - - var testElement = document.createElement( 'div' ); - - features.transforms3d = 'WebkitPerspective' in testElement.style || - 'MozPerspective' in testElement.style || - 'msPerspective' in testElement.style || - 'OPerspective' in testElement.style || - 'perspective' in testElement.style; - - features.transforms2d = 'WebkitTransform' in testElement.style || - 'MozTransform' in testElement.style || - 'msTransform' in testElement.style || - 'OTransform' in testElement.style || - 'transform' in testElement.style; - - features.requestAnimationFrameMethod = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; - features.requestAnimationFrame = typeof features.requestAnimationFrameMethod === 'function'; - - features.canvas = !!document.createElement( 'canvas' ).getContext; - - // Transitions in the overview are disabled in desktop and - // Safari due to lag - features.overviewTransitions = !/Version\/[\d\.]+.*Safari/.test( UA ); + for (var i = 0, len = lazyLoadable.length; i < len; i++) { + var element = lazyLoadable[i]; + if (element.getAttribute('data-src')) { + element.setAttribute('src', element.getAttribute('data-src')); + element.removeAttribute('data-src'); + } + } + + // If the browser doesn't support core features we won't be + // using JavaScript to control the presentation + return; + } + + // Cache references to key DOM elements + dom.wrapper = document.querySelector('.reveal'); + dom.slides = document.querySelector('.reveal .slides'); + + // Force a layout when the whole page, incl fonts, has loaded + window.addEventListener('load', layout, false); + + var query = Reveal.getQueryHash(); + + // Do not accept new dependencies via query config to avoid + // the potential of malicious script injection + if (typeof query['dependencies'] !== 'undefined') delete query['dependencies']; + + // Copy options over to our config object + extend(config, options); + extend(config, query); + + // Hide the address bar in mobile browsers + hideAddressBar(); + + // Loads the dependencies and continues to #start() once done + load(); + + } + + /** + * Inspect the client to see what it's capable of, this + * should only happens once per runtime. + */ + function checkCapabilities() { + + isMobileDevice = /(iphone|ipod|ipad|android)/gi.test(UA); + isChrome = /chrome/i.test(UA) && !/edge/i.test(UA); + + var testElement = document.createElement('div'); + + features.transforms3d = 'WebkitPerspective' in testElement.style || + 'MozPerspective' in testElement.style || + 'msPerspective' in testElement.style || + 'OPerspective' in testElement.style || + 'perspective' in testElement.style; + + features.transforms2d = 'WebkitTransform' in testElement.style || + 'MozTransform' in testElement.style || + 'msTransform' in testElement.style || + 'OTransform' in testElement.style || + 'transform' in testElement.style; + + features.requestAnimationFrameMethod = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; + features.requestAnimationFrame = typeof features.requestAnimationFrameMethod === 'function'; + + features.canvas = !!document.createElement('canvas').getContext; + + // Transitions in the overview are disabled in desktop and + // Safari due to lag + features.overviewTransitions = !/Version\/[\d\.]+.*Safari/.test(UA); - // Flags if we should use zoom instead of transform to scale - // up slides. Zoom produces crisper results but has a lot of - // xbrowser quirks so we only use it in whitelsited browsers. - features.zoom = 'zoom' in testElement.style && !isMobileDevice && - ( isChrome || /Version\/[\d\.]+.*Safari/.test( UA ) ); + // Flags if we should use zoom instead of transform to scale + // up slides. Zoom produces crisper results but has a lot of + // xbrowser quirks so we only use it in whitelsited browsers. + features.zoom = 'zoom' in testElement.style && !isMobileDevice && + (isChrome || /Version\/[\d\.]+.*Safari/.test(UA)); - } + } /** * Loads the dependencies of reveal.js. Dependencies are @@ -398,4842 +398,4895 @@ * Some dependencies may have an 'async' flag, if so they * will load after reveal.js has been started up. */ - function load() { - - var scripts = [], - scriptsAsync = [], - scriptsToPreload = 0; - - // Called once synchronous scripts finish loading - function proceed() { - if( scriptsAsync.length ) { - // Load asynchronous scripts - head.js.apply( null, scriptsAsync ); - } - - start(); - } - - function loadScript( s ) { - head.ready( s.src.match( /([\w\d_\-]*)\.?js$|[^\\\/]*$/i )[0], function() { - // Extension may contain callback functions - if( typeof s.callback === 'function' ) { - s.callback.apply( this ); - } - - if( --scriptsToPreload === 0 ) { - proceed(); - } - }); - } - - for( var i = 0, len = config.dependencies.length; i < len; i++ ) { - var s = config.dependencies[i]; - - // Load if there's no condition or the condition is truthy - if( !s.condition || s.condition() ) { - if( s.async ) { - scriptsAsync.push( s.src ); - } - else { - scripts.push( s.src ); - } - - loadScript( s ); - } - } - - if( scripts.length ) { - scriptsToPreload = scripts.length; - - // Load synchronous scripts - head.js.apply( null, scripts ); - } - else { - proceed(); - } - - } - - /** - * Starts up reveal.js by binding input events and navigating - * to the current URL deeplink if there is one. - */ - function start() { - - loaded = true; - - // Make sure we've got all the DOM elements we need - setupDOM(); - - // Listen to messages posted to this window - setupPostMessage(); - - // Prevent the slides from being scrolled out of view - setupScrollPrevention(); - - // Resets all vertical slides so that only the first is visible - resetVerticalSlides(); - - // Updates the presentation to match the current configuration values - configure(); - - // Read the initial hash - readURL(); - - // Update all backgrounds - updateBackground( true ); - - // Notify listeners that the presentation is ready but use a 1ms - // timeout to ensure it's not fired synchronously after #initialize() - setTimeout( function() { - // Enable transitions now that we're loaded - dom.slides.classList.remove( 'no-transition' ); - - dom.wrapper.classList.add( 'ready' ); - - dispatchEvent( 'ready', { - 'indexh': indexh, - 'indexv': indexv, - 'currentSlide': currentSlide - } ); - }, 1 ); - - // Special setup and config is required when printing to PDF - if( isPrintingPDF() ) { - removeEventListeners(); - - // The document needs to have loaded for the PDF layout - // measurements to be accurate - if( document.readyState === 'complete' ) { - setupPDF(); - } - else { - window.addEventListener( 'load', setupPDF ); - } - } - - } - - /** - * Finds and stores references to DOM elements which are - * required by the presentation. If a required element is - * not found, it is created. - */ - function setupDOM() { - - // Prevent transitions while we're loading - dom.slides.classList.add( 'no-transition' ); - - if( isMobileDevice ) { - dom.wrapper.classList.add( 'no-hover' ); - } - else { - dom.wrapper.classList.remove( 'no-hover' ); - } - - if( /iphone/gi.test( UA ) ) { - dom.wrapper.classList.add( 'ua-iphone' ); - } - else { - dom.wrapper.classList.remove( 'ua-iphone' ); - } - - // Background element - dom.background = createSingletonNode( dom.wrapper, 'div', 'backgrounds', null ); - - // Progress bar - dom.progress = createSingletonNode( dom.wrapper, 'div', 'progress', '' ); - dom.progressbar = dom.progress.querySelector( 'span' ); - - // Arrow controls - dom.controls = createSingletonNode( dom.wrapper, 'aside', 'controls', - '' + - '' + - '' + - '' ); - - // Slide number - dom.slideNumber = createSingletonNode( dom.wrapper, 'div', 'slide-number', '' ); - - // Element containing notes that are visible to the audience - dom.speakerNotes = createSingletonNode( dom.wrapper, 'div', 'speaker-notes', null ); - dom.speakerNotes.setAttribute( 'data-prevent-swipe', '' ); - dom.speakerNotes.setAttribute( 'tabindex', '0' ); - - // Overlay graphic which is displayed during the paused mode - createSingletonNode( dom.wrapper, 'div', 'pause-overlay', null ); - - dom.wrapper.setAttribute( 'role', 'application' ); - - // There can be multiple instances of controls throughout the page - dom.controlsLeft = toArray( document.querySelectorAll( '.navigate-left' ) ); - dom.controlsRight = toArray( document.querySelectorAll( '.navigate-right' ) ); - dom.controlsUp = toArray( document.querySelectorAll( '.navigate-up' ) ); - dom.controlsDown = toArray( document.querySelectorAll( '.navigate-down' ) ); - dom.controlsPrev = toArray( document.querySelectorAll( '.navigate-prev' ) ); - dom.controlsNext = toArray( document.querySelectorAll( '.navigate-next' ) ); - - // The right and down arrows in the standard reveal.js controls - dom.controlsRightArrow = dom.controls.querySelector( '.navigate-right' ); - dom.controlsDownArrow = dom.controls.querySelector( '.navigate-down' ); - - dom.statusDiv = createStatusDiv(); - } - - /** - * Creates a hidden div with role aria-live to announce the - * current slide content. Hide the div off-screen to make it - * available only to Assistive Technologies. - * - * @return {HTMLElement} - */ - function createStatusDiv() { - - var statusDiv = document.getElementById( 'aria-status-div' ); - if( !statusDiv ) { - statusDiv = document.createElement( 'div' ); - statusDiv.style.position = 'absolute'; - statusDiv.style.height = '1px'; - statusDiv.style.width = '1px'; - statusDiv.style.overflow = 'hidden'; - statusDiv.style.clip = 'rect( 1px, 1px, 1px, 1px )'; - statusDiv.setAttribute( 'id', 'aria-status-div' ); - statusDiv.setAttribute( 'aria-live', 'polite' ); - statusDiv.setAttribute( 'aria-atomic','true' ); - dom.wrapper.appendChild( statusDiv ); - } - return statusDiv; - - } - - /** - * Converts the given HTML element into a string of text - * that can be announced to a screen reader. Hidden - * elements are excluded. - */ - function getStatusText( node ) { - - var text = ''; - - // Text node - if( node.nodeType === 3 ) { - text += node.textContent; - } - // Element node - else if( node.nodeType === 1 ) { - - var isAriaHidden = node.getAttribute( 'aria-hidden' ); - var isDisplayHidden = window.getComputedStyle( node )['display'] === 'none'; - if( isAriaHidden !== 'true' && !isDisplayHidden ) { - - toArray( node.childNodes ).forEach( function( child ) { - text += getStatusText( child ); - } ); - - } - - } - - return text; - - } - - /** - * Configures the presentation for printing to a static - * PDF. - */ - function setupPDF() { - - var slideSize = getComputedSlideSize( window.innerWidth, window.innerHeight ); - - // Dimensions of the PDF pages - var pageWidth = Math.floor( slideSize.width * ( 1 + config.margin ) ), - pageHeight = Math.floor( slideSize.height * ( 1 + config.margin ) ); - - // Dimensions of slides within the pages - var slideWidth = slideSize.width, - slideHeight = slideSize.height; - - // Let the browser know what page size we want to print - injectStyleSheet( '@page{size:'+ pageWidth +'px '+ pageHeight +'px; margin: 0px;}' ); - - // Limit the size of certain elements to the dimensions of the slide - injectStyleSheet( '.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: '+ slideWidth +'px; max-height:'+ slideHeight +'px}' ); - - document.body.classList.add( 'print-pdf' ); - document.body.style.width = pageWidth + 'px'; - document.body.style.height = pageHeight + 'px'; - - // Make sure stretch elements fit on slide - layoutSlideContents( slideWidth, slideHeight ); - - // Add each slide's index as attributes on itself, we need these - // indices to generate slide numbers below - toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( hslide, h ) { - hslide.setAttribute( 'data-index-h', h ); - - if( hslide.classList.contains( 'stack' ) ) { - toArray( hslide.querySelectorAll( 'section' ) ).forEach( function( vslide, v ) { - vslide.setAttribute( 'data-index-h', h ); - vslide.setAttribute( 'data-index-v', v ); - } ); - } - } ); - - // Slide and slide background layout - toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) { - - // Vertical stacks are not centred since their section - // children will be - if( slide.classList.contains( 'stack' ) === false ) { - // Center the slide inside of the page, giving the slide some margin - var left = ( pageWidth - slideWidth ) / 2, - top = ( pageHeight - slideHeight ) / 2; - - var contentHeight = slide.scrollHeight; - var numberOfPages = Math.max( Math.ceil( contentHeight / pageHeight ), 1 ); - - // Adhere to configured pages per slide limit - numberOfPages = Math.min( numberOfPages, config.pdfMaxPagesPerSlide ); - - // Center slides vertically - if( numberOfPages === 1 && config.center || slide.classList.contains( 'center' ) ) { - top = Math.max( ( pageHeight - contentHeight ) / 2, 0 ); - } - - // Wrap the slide in a page element and hide its overflow - // so that no page ever flows onto another - var page = document.createElement( 'div' ); - page.className = 'pdf-page'; - page.style.height = ( ( pageHeight + config.pdfPageHeightOffset ) * numberOfPages ) + 'px'; - slide.parentNode.insertBefore( page, slide ); - page.appendChild( slide ); - - // Position the slide inside of the page - slide.style.left = left + 'px'; - slide.style.top = top + 'px'; - slide.style.width = slideWidth + 'px'; - - if( slide.slideBackgroundElement ) { - page.insertBefore( slide.slideBackgroundElement, slide ); - } - - // Inject notes if `showNotes` is enabled - if( config.showNotes ) { - - // Are there notes for this slide? - var notes = getSlideNotes( slide ); - if( notes ) { - - var notesSpacing = 8; - var notesLayout = typeof config.showNotes === 'string' ? config.showNotes : 'inline'; - var notesElement = document.createElement( 'div' ); - notesElement.classList.add( 'speaker-notes' ); - notesElement.classList.add( 'speaker-notes-pdf' ); - notesElement.setAttribute( 'data-layout', notesLayout ); - notesElement.innerHTML = notes; - - if( notesLayout === 'separate-page' ) { - page.parentNode.insertBefore( notesElement, page.nextSibling ); - } - else { - notesElement.style.left = notesSpacing + 'px'; - notesElement.style.bottom = notesSpacing + 'px'; - notesElement.style.width = ( pageWidth - notesSpacing*2 ) + 'px'; - page.appendChild( notesElement ); - } - - } - - } - - // Inject slide numbers if `slideNumbers` are enabled - if( config.slideNumber && /all|print/i.test( config.showSlideNumber ) ) { - var slideNumberH = parseInt( slide.getAttribute( 'data-index-h' ), 10 ) + 1, - slideNumberV = parseInt( slide.getAttribute( 'data-index-v' ), 10 ) + 1; - - var numberElement = document.createElement( 'div' ); - numberElement.classList.add( 'slide-number' ); - numberElement.classList.add( 'slide-number-pdf' ); - numberElement.innerHTML = formatSlideNumber( slideNumberH, '.', slideNumberV ); - page.appendChild( numberElement ); - } - } - - } ); - - // Show all fragments - toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' .fragment' ) ).forEach( function( fragment ) { - fragment.classList.add( 'visible' ); - } ); - - // Notify subscribers that the PDF layout is good to go - dispatchEvent( 'pdf-ready' ); - - } - - /** - * This is an unfortunate necessity. Some actions – such as - * an input field being focused in an iframe or using the - * keyboard to expand text selection beyond the bounds of - * a slide – can trigger our content to be pushed out of view. - * This scrolling can not be prevented by hiding overflow in - * CSS (we already do) so we have to resort to repeatedly - * checking if the slides have been offset :( - */ - function setupScrollPrevention() { - - setInterval( function() { - if( dom.wrapper.scrollTop !== 0 || dom.wrapper.scrollLeft !== 0 ) { - dom.wrapper.scrollTop = 0; - dom.wrapper.scrollLeft = 0; - } - }, 1000 ); - - } - - /** - * Creates an HTML element and returns a reference to it. - * If the element already exists the existing instance will - * be returned. - * - * @param {HTMLElement} container - * @param {string} tagname - * @param {string} classname - * @param {string} innerHTML - * - * @return {HTMLElement} - */ - function createSingletonNode( container, tagname, classname, innerHTML ) { - - // Find all nodes matching the description - var nodes = container.querySelectorAll( '.' + classname ); - - // Check all matches to find one which is a direct child of - // the specified container - for( var i = 0; i < nodes.length; i++ ) { - var testNode = nodes[i]; - if( testNode.parentNode === container ) { - return testNode; - } - } - - // If no node was found, create it now - var node = document.createElement( tagname ); - node.className = classname; - if( typeof innerHTML === 'string' ) { - node.innerHTML = innerHTML; - } - container.appendChild( node ); - - return node; - - } - - /** - * Creates the slide background elements and appends them - * to the background container. One element is created per - * slide no matter if the given slide has visible background. - */ - function createBackgrounds() { - - var printMode = isPrintingPDF(); - - // Clear prior backgrounds - dom.background.innerHTML = ''; - dom.background.classList.add( 'no-transition' ); - - // Iterate over all horizontal slides - toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( slideh ) { - - var backgroundStack = createBackground( slideh, dom.background ); - - // Iterate over all vertical slides - toArray( slideh.querySelectorAll( 'section' ) ).forEach( function( slidev ) { - - createBackground( slidev, backgroundStack ); - - backgroundStack.classList.add( 'stack' ); - - } ); - - } ); - - // Add parallax background if specified - if( config.parallaxBackgroundImage ) { - - dom.background.style.backgroundImage = 'url("' + config.parallaxBackgroundImage + '")'; - dom.background.style.backgroundSize = config.parallaxBackgroundSize; - - // Make sure the below properties are set on the element - these properties are - // needed for proper transitions to be set on the element via CSS. To remove - // annoying background slide-in effect when the presentation starts, apply - // these properties after short time delay - setTimeout( function() { - dom.wrapper.classList.add( 'has-parallax-background' ); - }, 1 ); - - } - else { - - dom.background.style.backgroundImage = ''; - dom.wrapper.classList.remove( 'has-parallax-background' ); - - } - - } - - /** - * Creates a background for the given slide. - * - * @param {HTMLElement} slide - * @param {HTMLElement} container The element that the background - * should be appended to - * @return {HTMLElement} New background div - */ - function createBackground( slide, container ) { - - var data = { - background: slide.getAttribute( 'data-background' ), - backgroundSize: slide.getAttribute( 'data-background-size' ), - backgroundImage: slide.getAttribute( 'data-background-image' ), - backgroundVideo: slide.getAttribute( 'data-background-video' ), - backgroundIframe: slide.getAttribute( 'data-background-iframe' ), - backgroundColor: slide.getAttribute( 'data-background-color' ), - backgroundRepeat: slide.getAttribute( 'data-background-repeat' ), - backgroundPosition: slide.getAttribute( 'data-background-position' ), - backgroundTransition: slide.getAttribute( 'data-background-transition' ) - }; - - var element = document.createElement( 'div' ); - - // Carry over custom classes from the slide to the background - element.className = 'slide-background ' + slide.className.replace( /present|past|future/, '' ); - - if( data.background ) { - // Auto-wrap image urls in url(...) - if( /^(http|file|\/\/)/gi.test( data.background ) || /\.(svg|png|jpg|jpeg|gif|bmp)([?#]|$)/gi.test( data.background ) ) { - slide.setAttribute( 'data-background-image', data.background ); - } - else { - element.style.background = data.background; - } - } - - // Create a hash for this combination of background settings. - // This is used to determine when two slide backgrounds are - // the same. - if( data.background || data.backgroundColor || data.backgroundImage || data.backgroundVideo || data.backgroundIframe ) { - element.setAttribute( 'data-background-hash', data.background + - data.backgroundSize + - data.backgroundImage + - data.backgroundVideo + - data.backgroundIframe + - data.backgroundColor + - data.backgroundRepeat + - data.backgroundPosition + - data.backgroundTransition ); - } - - // Additional and optional background properties - if( data.backgroundSize ) element.style.backgroundSize = data.backgroundSize; - if( data.backgroundSize ) element.setAttribute( 'data-background-size', data.backgroundSize ); - if( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor; - if( data.backgroundRepeat ) element.style.backgroundRepeat = data.backgroundRepeat; - if( data.backgroundPosition ) element.style.backgroundPosition = data.backgroundPosition; - if( data.backgroundTransition ) element.setAttribute( 'data-background-transition', data.backgroundTransition ); - - container.appendChild( element ); - - // If backgrounds are being recreated, clear old classes - slide.classList.remove( 'has-dark-background' ); - slide.classList.remove( 'has-light-background' ); - - slide.slideBackgroundElement = element; - - // If this slide has a background color, add a class that - // signals if it is light or dark. If the slide has no background - // color, no class will be set - var computedBackgroundStyle = window.getComputedStyle( element ); - if( computedBackgroundStyle && computedBackgroundStyle.backgroundColor ) { - var rgb = colorToRgb( computedBackgroundStyle.backgroundColor ); - - // Ignore fully transparent backgrounds. Some browsers return - // rgba(0,0,0,0) when reading the computed background color of - // an element with no background - if( rgb && rgb.a !== 0 ) { - if( colorBrightness( computedBackgroundStyle.backgroundColor ) < 128 ) { - slide.classList.add( 'has-dark-background' ); - } - else { - slide.classList.add( 'has-light-background' ); - } - } - } - - return element; - - } - - /** - * Registers a listener to postMessage events, this makes it - * possible to call all reveal.js API methods from another - * window. For example: - * - * revealWindow.postMessage( JSON.stringify({ - * method: 'slide', - * args: [ 2 ] - * }), '*' ); - */ - function setupPostMessage() { - - if( config.postMessage ) { - window.addEventListener( 'message', function ( event ) { - var data = event.data; - - // Make sure we're dealing with JSON - if( typeof data === 'string' && data.charAt( 0 ) === '{' && data.charAt( data.length - 1 ) === '}' ) { - data = JSON.parse( data ); - - // Check if the requested method can be found - if( data.method && typeof Reveal[data.method] === 'function' ) { - Reveal[data.method].apply( Reveal, data.args ); - } - } - }, false ); - } - - } - - /** - * Applies the configuration settings from the config - * object. May be called multiple times. - * - * @param {object} options - */ - function configure( options ) { - - var oldTransition = config.transition; - - // New config options may be passed when this method - // is invoked through the API after initialization - if( typeof options === 'object' ) extend( config, options ); - - // Abort if reveal.js hasn't finished loading, config - // changes will be applied automatically once loading - // finishes - if( loaded === false ) return; - - var numberOfSlides = dom.wrapper.querySelectorAll( SLIDES_SELECTOR ).length; - - // Remove the previously configured transition class - dom.wrapper.classList.remove( oldTransition ); - - // Force linear transition based on browser capabilities - if( features.transforms3d === false ) config.transition = 'linear'; - - dom.wrapper.classList.add( config.transition ); - - dom.wrapper.setAttribute( 'data-transition-speed', config.transitionSpeed ); - dom.wrapper.setAttribute( 'data-background-transition', config.backgroundTransition ); - - dom.controls.style.display = config.controls ? 'block' : 'none'; - dom.progress.style.display = config.progress ? 'block' : 'none'; - - dom.controls.setAttribute( 'data-controls-layout', config.controlsLayout ); - dom.controls.setAttribute( 'data-controls-back-arrows', config.controlsBackArrows ); - - if( config.shuffle ) { - shuffle(); - } - - if( config.rtl ) { - dom.wrapper.classList.add( 'rtl' ); - } - else { - dom.wrapper.classList.remove( 'rtl' ); - } - - if( config.center ) { - dom.wrapper.classList.add( 'center' ); - } - else { - dom.wrapper.classList.remove( 'center' ); - } - - // Exit the paused mode if it was configured off - if( config.pause === false ) { - resume(); - } - - if( config.showNotes ) { - dom.speakerNotes.setAttribute( 'data-layout', typeof config.showNotes === 'string' ? config.showNotes : 'inline' ); - } - - if( config.mouseWheel ) { - document.addEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF - document.addEventListener( 'mousewheel', onDocumentMouseScroll, false ); - } - else { - document.removeEventListener( 'DOMMouseScroll', onDocumentMouseScroll, false ); // FF - document.removeEventListener( 'mousewheel', onDocumentMouseScroll, false ); - } - - // Rolling 3D links - if( config.rollingLinks ) { - enableRollingLinks(); - } - else { - disableRollingLinks(); - } - - // Iframe link previews - if( config.previewLinks ) { - enablePreviewLinks(); - disablePreviewLinks( '[data-preview-link=false]' ); - } - else { - disablePreviewLinks(); - enablePreviewLinks( '[data-preview-link]:not([data-preview-link=false])' ); - } - - // Remove existing auto-slide controls - if( autoSlidePlayer ) { - autoSlidePlayer.destroy(); - autoSlidePlayer = null; - } - - // Generate auto-slide controls if needed - if( numberOfSlides > 1 && config.autoSlide && config.autoSlideStoppable && features.canvas && features.requestAnimationFrame ) { - autoSlidePlayer = new Playback( dom.wrapper, function() { - return Math.min( Math.max( ( Date.now() - autoSlideStartTime ) / autoSlide, 0 ), 1 ); - } ); - - autoSlidePlayer.on( 'click', onAutoSlidePlayerClick ); - autoSlidePaused = false; - } - - // When fragments are turned off they should be visible - if( config.fragments === false ) { - toArray( dom.slides.querySelectorAll( '.fragment' ) ).forEach( function( element ) { - element.classList.add( 'visible' ); - element.classList.remove( 'current-fragment' ); - } ); - } - - // Slide numbers - var slideNumberDisplay = 'none'; - if( config.slideNumber && !isPrintingPDF() ) { - if( config.showSlideNumber === 'all' ) { - slideNumberDisplay = 'block'; - } - else if( config.showSlideNumber === 'speaker' && isSpeakerNotes() ) { - slideNumberDisplay = 'block'; - } - } - - dom.slideNumber.style.display = slideNumberDisplay; - - sync(); - - } - - /** - * Binds all event listeners. - */ - function addEventListeners() { - - eventsAreBound = true; - - window.addEventListener( 'hashchange', onWindowHashChange, false ); - window.addEventListener( 'resize', onWindowResize, false ); - - if( config.touch ) { - dom.wrapper.addEventListener( 'touchstart', onTouchStart, false ); - dom.wrapper.addEventListener( 'touchmove', onTouchMove, false ); - dom.wrapper.addEventListener( 'touchend', onTouchEnd, false ); - - // Support pointer-style touch interaction as well - if( window.navigator.pointerEnabled ) { - // IE 11 uses un-prefixed version of pointer events - dom.wrapper.addEventListener( 'pointerdown', onPointerDown, false ); - dom.wrapper.addEventListener( 'pointermove', onPointerMove, false ); - dom.wrapper.addEventListener( 'pointerup', onPointerUp, false ); - } - else if( window.navigator.msPointerEnabled ) { - // IE 10 uses prefixed version of pointer events - dom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false ); - dom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false ); - dom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false ); - } - } - - if( config.keyboard ) { - document.addEventListener( 'keydown', onDocumentKeyDown, false ); - document.addEventListener( 'keypress', onDocumentKeyPress, false ); - } - - if( config.progress && dom.progress ) { - dom.progress.addEventListener( 'click', onProgressClicked, false ); - } - - if( config.focusBodyOnPageVisibilityChange ) { - var visibilityChange; - - if( 'hidden' in document ) { - visibilityChange = 'visibilitychange'; - } - else if( 'msHidden' in document ) { - visibilityChange = 'msvisibilitychange'; - } - else if( 'webkitHidden' in document ) { - visibilityChange = 'webkitvisibilitychange'; - } - - if( visibilityChange ) { - document.addEventListener( visibilityChange, onPageVisibilityChange, false ); - } - } - - // Listen to both touch and click events, in case the device - // supports both - var pointerEvents = [ 'touchstart', 'click' ]; - - // Only support touch for Android, fixes double navigations in - // stock browser - if( UA.match( /android/gi ) ) { - pointerEvents = [ 'touchstart' ]; - } - - pointerEvents.forEach( function( eventName ) { - dom.controlsLeft.forEach( function( el ) { el.addEventListener( eventName, onNavigateLeftClicked, false ); } ); - dom.controlsRight.forEach( function( el ) { el.addEventListener( eventName, onNavigateRightClicked, false ); } ); - dom.controlsUp.forEach( function( el ) { el.addEventListener( eventName, onNavigateUpClicked, false ); } ); - dom.controlsDown.forEach( function( el ) { el.addEventListener( eventName, onNavigateDownClicked, false ); } ); - dom.controlsPrev.forEach( function( el ) { el.addEventListener( eventName, onNavigatePrevClicked, false ); } ); - dom.controlsNext.forEach( function( el ) { el.addEventListener( eventName, onNavigateNextClicked, false ); } ); - } ); - - } - - /** - * Unbinds all event listeners. - */ - function removeEventListeners() { - - eventsAreBound = false; - - document.removeEventListener( 'keydown', onDocumentKeyDown, false ); - document.removeEventListener( 'keypress', onDocumentKeyPress, false ); - window.removeEventListener( 'hashchange', onWindowHashChange, false ); - window.removeEventListener( 'resize', onWindowResize, false ); - - dom.wrapper.removeEventListener( 'touchstart', onTouchStart, false ); - dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false ); - dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false ); - - // IE11 - if( window.navigator.pointerEnabled ) { - dom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false ); - dom.wrapper.removeEventListener( 'pointermove', onPointerMove, false ); - dom.wrapper.removeEventListener( 'pointerup', onPointerUp, false ); - } - // IE10 - else if( window.navigator.msPointerEnabled ) { - dom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false ); - dom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false ); - dom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false ); - } - - if ( config.progress && dom.progress ) { - dom.progress.removeEventListener( 'click', onProgressClicked, false ); - } - - [ 'touchstart', 'click' ].forEach( function( eventName ) { - dom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } ); - dom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } ); - dom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } ); - dom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } ); - dom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } ); - dom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } ); - } ); - - } - - /** - * Extend object a with the properties of object b. - * If there's a conflict, object b takes precedence. - * - * @param {object} a - * @param {object} b - */ - function extend( a, b ) { - - for( var i in b ) { - a[ i ] = b[ i ]; - } - - return a; - - } - - /** - * Converts the target object to an array. - * - * @param {object} o - * @return {object[]} - */ - function toArray( o ) { - - return Array.prototype.slice.call( o ); - - } - - /** - * Utility for deserializing a value. - * - * @param {*} value - * @return {*} - */ - function deserialize( value ) { - - if( typeof value === 'string' ) { - if( value === 'null' ) return null; - else if( value === 'true' ) return true; - else if( value === 'false' ) return false; - else if( value.match( /^-?[\d\.]+$/ ) ) return parseFloat( value ); - } - - return value; - - } - - /** - * Measures the distance in pixels between point a - * and point b. - * - * @param {object} a point with x/y properties - * @param {object} b point with x/y properties - * - * @return {number} - */ - function distanceBetween( a, b ) { - - var dx = a.x - b.x, - dy = a.y - b.y; - - return Math.sqrt( dx*dx + dy*dy ); - - } - - /** - * Applies a CSS transform to the target element. - * - * @param {HTMLElement} element - * @param {string} transform - */ - function transformElement( element, transform ) { - - element.style.WebkitTransform = transform; - element.style.MozTransform = transform; - element.style.msTransform = transform; - element.style.transform = transform; - - } - - /** - * Applies CSS transforms to the slides container. The container - * is transformed from two separate sources: layout and the overview - * mode. - * - * @param {object} transforms - */ - function transformSlides( transforms ) { - - // Pick up new transforms from arguments - if( typeof transforms.layout === 'string' ) slidesTransform.layout = transforms.layout; - if( typeof transforms.overview === 'string' ) slidesTransform.overview = transforms.overview; - - // Apply the transforms to the slides container - if( slidesTransform.layout ) { - transformElement( dom.slides, slidesTransform.layout + ' ' + slidesTransform.overview ); - } - else { - transformElement( dom.slides, slidesTransform.overview ); - } - - } - - /** - * Injects the given CSS styles into the DOM. - * - * @param {string} value - */ - function injectStyleSheet( value ) { - - var tag = document.createElement( 'style' ); - tag.type = 'text/css'; - if( tag.styleSheet ) { - tag.styleSheet.cssText = value; - } - else { - tag.appendChild( document.createTextNode( value ) ); - } - document.getElementsByTagName( 'head' )[0].appendChild( tag ); - - } - - /** - * Find the closest parent that matches the given - * selector. - * - * @param {HTMLElement} target The child element - * @param {String} selector The CSS selector to match - * the parents against - * - * @return {HTMLElement} The matched parent or null - * if no matching parent was found - */ - function closestParent( target, selector ) { - - var parent = target.parentNode; - - while( parent ) { - - // There's some overhead doing this each time, we don't - // want to rewrite the element prototype but should still - // be enough to feature detect once at startup... - var matchesMethod = parent.matches || parent.matchesSelector || parent.msMatchesSelector; - - // If we find a match, we're all set - if( matchesMethod && matchesMethod.call( parent, selector ) ) { - return parent; - } - - // Keep searching - parent = parent.parentNode; - - } - - return null; - - } - - /** - * Converts various color input formats to an {r:0,g:0,b:0} object. - * - * @param {string} color The string representation of a color - * @example - * colorToRgb('#000'); - * @example - * colorToRgb('#000000'); - * @example - * colorToRgb('rgb(0,0,0)'); - * @example - * colorToRgb('rgba(0,0,0)'); - * - * @return {{r: number, g: number, b: number, [a]: number}|null} - */ - function colorToRgb( color ) { - - var hex3 = color.match( /^#([0-9a-f]{3})$/i ); - if( hex3 && hex3[1] ) { - hex3 = hex3[1]; - return { - r: parseInt( hex3.charAt( 0 ), 16 ) * 0x11, - g: parseInt( hex3.charAt( 1 ), 16 ) * 0x11, - b: parseInt( hex3.charAt( 2 ), 16 ) * 0x11 - }; - } - - var hex6 = color.match( /^#([0-9a-f]{6})$/i ); - if( hex6 && hex6[1] ) { - hex6 = hex6[1]; - return { - r: parseInt( hex6.substr( 0, 2 ), 16 ), - g: parseInt( hex6.substr( 2, 2 ), 16 ), - b: parseInt( hex6.substr( 4, 2 ), 16 ) - }; - } - - var rgb = color.match( /^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i ); - if( rgb ) { - return { - r: parseInt( rgb[1], 10 ), - g: parseInt( rgb[2], 10 ), - b: parseInt( rgb[3], 10 ) - }; - } - - var rgba = color.match( /^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*([\d]+|[\d]*.[\d]+)\s*\)$/i ); - if( rgba ) { - return { - r: parseInt( rgba[1], 10 ), - g: parseInt( rgba[2], 10 ), - b: parseInt( rgba[3], 10 ), - a: parseFloat( rgba[4] ) - }; - } - - return null; - - } - - /** - * Calculates brightness on a scale of 0-255. - * - * @param {string} color See colorToRgb for supported formats. - * @see {@link colorToRgb} - */ - function colorBrightness( color ) { - - if( typeof color === 'string' ) color = colorToRgb( color ); - - if( color ) { - return ( color.r * 299 + color.g * 587 + color.b * 114 ) / 1000; - } - - return null; - - } - - /** - * Returns the remaining height within the parent of the - * target element. - * - * remaining height = [ configured parent height ] - [ current parent height ] - * - * @param {HTMLElement} element - * @param {number} [height] - */ - function getRemainingHeight( element, height ) { - - height = height || 0; - - if( element ) { - var newHeight, oldHeight = element.style.height; - - // Change the .stretch element height to 0 in order find the height of all - // the other elements - element.style.height = '0px'; - newHeight = height - element.parentNode.offsetHeight; - - // Restore the old height, just in case - element.style.height = oldHeight + 'px'; - - return newHeight; - } - - return height; - - } - - /** - * Checks if this instance is being used to print a PDF. - */ - function isPrintingPDF() { - - return ( /print-pdf/gi ).test( window.location.search ); - - } - - /** - * Hides the address bar if we're on a mobile device. - */ - function hideAddressBar() { - - if( config.hideAddressBar && isMobileDevice ) { - // Events that should trigger the address bar to hide - window.addEventListener( 'load', removeAddressBar, false ); - window.addEventListener( 'orientationchange', removeAddressBar, false ); - } - - } - - /** - * Causes the address bar to hide on mobile devices, - * more vertical space ftw. - */ - function removeAddressBar() { - - setTimeout( function() { - window.scrollTo( 0, 1 ); - }, 10 ); - - } - - /** - * Dispatches an event of the specified type from the - * reveal DOM element. - */ - function dispatchEvent( type, args ) { + function load() { + + var scripts = [], + scriptsAsync = [], + scriptsToPreload = 0; + + // Called once synchronous scripts finish loading + function proceed() { + if (scriptsAsync.length) { + // Load asynchronous scripts + head.js.apply(null, scriptsAsync); + } + + start(); + } + + function loadScript(s) { + head.ready(s.src.match(/([\w\d_\-]*)\.?js$|[^\\\/]*$/i)[0], function () { + // Extension may contain callback functions + if (typeof s.callback === 'function') { + s.callback.apply(this); + } + + if (--scriptsToPreload === 0) { + proceed(); + } + }); + } + + for (var i = 0, len = config.dependencies.length; i < len; i++) { + var s = config.dependencies[i]; + + // Load if there's no condition or the condition is truthy + if (!s.condition || s.condition()) { + if (s.async) { + scriptsAsync.push(s.src); + } else { + scripts.push(s.src); + } + + loadScript(s); + } + } + + if (scripts.length) { + scriptsToPreload = scripts.length; + + // Load synchronous scripts + head.js.apply(null, scripts); + } else { + proceed(); + } + + } + + /** + * Starts up reveal.js by binding input events and navigating + * to the current URL deeplink if there is one. + */ + function start() { + + loaded = true; + + // Make sure we've got all the DOM elements we need + setupDOM(); + + // Listen to messages posted to this window + setupPostMessage(); + + // Prevent the slides from being scrolled out of view + setupScrollPrevention(); + + // Resets all vertical slides so that only the first is visible + resetVerticalSlides(); + + // Updates the presentation to match the current configuration values + configure(); + + // Read the initial hash + readURL(); + + // Update all backgrounds + updateBackground(true); + + // Notify listeners that the presentation is ready but use a 1ms + // timeout to ensure it's not fired synchronously after #initialize() + setTimeout(function () { + // Enable transitions now that we're loaded + dom.slides.classList.remove('no-transition'); + + dom.wrapper.classList.add('ready'); + + dispatchEvent('ready', { + 'indexh': indexh, + 'indexv': indexv, + 'currentSlide': currentSlide + }); + }, 1); + + // Special setup and config is required when printing to PDF + if (isPrintingPDF()) { + removeEventListeners(); + + // The document needs to have loaded for the PDF layout + // measurements to be accurate + if (document.readyState === 'complete') { + setupPDF(); + } else { + window.addEventListener('load', setupPDF); + } + } + + } + + /** + * Finds and stores references to DOM elements which are + * required by the presentation. If a required element is + * not found, it is created. + */ + function setupDOM() { + + // Prevent transitions while we're loading + dom.slides.classList.add('no-transition'); + + if (isMobileDevice) { + dom.wrapper.classList.add('no-hover'); + } else { + dom.wrapper.classList.remove('no-hover'); + } + + if (/iphone/gi.test(UA)) { + dom.wrapper.classList.add('ua-iphone'); + } else { + dom.wrapper.classList.remove('ua-iphone'); + } + + // Background element + dom.background = createSingletonNode(dom.wrapper, 'div', 'backgrounds', null); + + // Progress bar + dom.progress = createSingletonNode(dom.wrapper, 'div', 'progress', ''); + dom.progressbar = dom.progress.querySelector('span'); + + // Arrow controls + dom.controls = createSingletonNode(dom.wrapper, 'aside', 'controls', + '' + + '' + + '' + + ''); + + // Slide number + dom.slideNumber = createSingletonNode(dom.wrapper, 'div', 'slide-number', ''); + + // Element containing notes that are visible to the audience + dom.speakerNotes = createSingletonNode(dom.wrapper, 'div', 'speaker-notes', null); + dom.speakerNotes.setAttribute('data-prevent-swipe', ''); + dom.speakerNotes.setAttribute('tabindex', '0'); + + // Overlay graphic which is displayed during the paused mode + createSingletonNode(dom.wrapper, 'div', 'pause-overlay', null); + + dom.wrapper.setAttribute('role', 'application'); + + // There can be multiple instances of controls throughout the page + dom.controlsLeft = toArray(document.querySelectorAll('.navigate-left')); + dom.controlsRight = toArray(document.querySelectorAll('.navigate-right')); + dom.controlsUp = toArray(document.querySelectorAll('.navigate-up')); + dom.controlsDown = toArray(document.querySelectorAll('.navigate-down')); + dom.controlsPrev = toArray(document.querySelectorAll('.navigate-prev')); + dom.controlsNext = toArray(document.querySelectorAll('.navigate-next')); + + // The right and down arrows in the standard reveal.js controls + dom.controlsRightArrow = dom.controls.querySelector('.navigate-right'); + dom.controlsDownArrow = dom.controls.querySelector('.navigate-down'); + + dom.statusDiv = createStatusDiv(); + } + + /** + * Creates a hidden div with role aria-live to announce the + * current slide content. Hide the div off-screen to make it + * available only to Assistive Technologies. + * + * @return {HTMLElement} + */ + function createStatusDiv() { + + var statusDiv = document.getElementById('aria-status-div'); + if (!statusDiv) { + statusDiv = document.createElement('div'); + statusDiv.style.position = 'absolute'; + statusDiv.style.height = '1px'; + statusDiv.style.width = '1px'; + statusDiv.style.overflow = 'hidden'; + statusDiv.style.clip = 'rect( 1px, 1px, 1px, 1px )'; + statusDiv.setAttribute('id', 'aria-status-div'); + statusDiv.setAttribute('aria-live', 'polite'); + statusDiv.setAttribute('aria-atomic', 'true'); + dom.wrapper.appendChild(statusDiv); + } + return statusDiv; + + } + + /** + * Converts the given HTML element into a string of text + * that can be announced to a screen reader. Hidden + * elements are excluded. + */ + function getStatusText(node) { + + var text = ''; + + // Text node + if (node.nodeType === 3) { + text += node.textContent; + } + // Element node + else if (node.nodeType === 1) { + + var isAriaHidden = node.getAttribute('aria-hidden'); + var isDisplayHidden = window.getComputedStyle(node)['display'] === 'none'; + if (isAriaHidden !== 'true' && !isDisplayHidden) { + + toArray(node.childNodes).forEach(function (child) { + text += getStatusText(child); + }); + + } + + } + + return text; + + } + + /** + * Configures the presentation for printing to a static + * PDF. + */ + function setupPDF() { + + var slideSize = getComputedSlideSize(window.innerWidth, window.innerHeight); + + // Dimensions of the PDF pages + var pageWidth = Math.floor(slideSize.width * (1 + config.margin)), + pageHeight = Math.floor(slideSize.height * (1 + config.margin)); + + // Dimensions of slides within the pages + var slideWidth = slideSize.width, + slideHeight = slideSize.height; + + // Let the browser know what page size we want to print + injectStyleSheet('@page{size:' + pageWidth + 'px ' + pageHeight + 'px; margin: 0px;}'); + + // Limit the size of certain elements to the dimensions of the slide + injectStyleSheet('.reveal section>img, .reveal section>video, .reveal section>iframe{max-width: ' + slideWidth + 'px; max-height:' + slideHeight + 'px}'); + + document.body.classList.add('print-pdf'); + document.body.style.width = pageWidth + 'px'; + document.body.style.height = pageHeight + 'px'; + + // Make sure stretch elements fit on slide + layoutSlideContents(slideWidth, slideHeight); + + // Add each slide's index as attributes on itself, we need these + // indices to generate slide numbers below + toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR)).forEach(function (hslide, h) { + hslide.setAttribute('data-index-h', h); + + if (hslide.classList.contains('stack')) { + toArray(hslide.querySelectorAll('section')).forEach(function (vslide, v) { + vslide.setAttribute('data-index-h', h); + vslide.setAttribute('data-index-v', v); + }); + } + }); + + // Slide and slide background layout + toArray(dom.wrapper.querySelectorAll(SLIDES_SELECTOR)).forEach(function (slide) { + + // Vertical stacks are not centred since their section + // children will be + if (slide.classList.contains('stack') === false) { + // Center the slide inside of the page, giving the slide some margin + var left = (pageWidth - slideWidth) / 2, + top = (pageHeight - slideHeight) / 2; + + var contentHeight = slide.scrollHeight; + var numberOfPages = Math.max(Math.ceil(contentHeight / pageHeight), 1); + + // Adhere to configured pages per slide limit + numberOfPages = Math.min(numberOfPages, config.pdfMaxPagesPerSlide); + + // Center slides vertically + if (numberOfPages === 1 && config.center || slide.classList.contains('center')) { + top = Math.max((pageHeight - contentHeight) / 2, 0); + } + + // Wrap the slide in a page element and hide its overflow + // so that no page ever flows onto another + var page = document.createElement('div'); + page.className = 'pdf-page'; + page.style.height = ((pageHeight + config.pdfPageHeightOffset) * numberOfPages) + 'px'; + slide.parentNode.insertBefore(page, slide); + page.appendChild(slide); + + // Position the slide inside of the page + slide.style.left = left + 'px'; + slide.style.top = top + 'px'; + slide.style.width = slideWidth + 'px'; + + if (slide.slideBackgroundElement) { + page.insertBefore(slide.slideBackgroundElement, slide); + } + + // Inject notes if `showNotes` is enabled + if (config.showNotes) { + + // Are there notes for this slide? + var notes = getSlideNotes(slide); + if (notes) { + + var notesSpacing = 8; + var notesLayout = typeof config.showNotes === 'string' ? config.showNotes : 'inline'; + var notesElement = document.createElement('div'); + notesElement.classList.add('speaker-notes'); + notesElement.classList.add('speaker-notes-pdf'); + notesElement.setAttribute('data-layout', notesLayout); + notesElement.innerHTML = notes; + + if (notesLayout === 'separate-page') { + page.parentNode.insertBefore(notesElement, page.nextSibling); + } else { + notesElement.style.left = notesSpacing + 'px'; + notesElement.style.bottom = notesSpacing + 'px'; + notesElement.style.width = (pageWidth - notesSpacing * 2) + 'px'; + page.appendChild(notesElement); + } + + } + + } + + // Inject slide numbers if `slideNumbers` are enabled + if (config.slideNumber && /all|print/i.test(config.showSlideNumber)) { + var slideNumberH = parseInt(slide.getAttribute('data-index-h'), 10) + 1, + slideNumberV = parseInt(slide.getAttribute('data-index-v'), 10) + 1; + + var numberElement = document.createElement('div'); + numberElement.classList.add('slide-number'); + numberElement.classList.add('slide-number-pdf'); + numberElement.innerHTML = formatSlideNumber(slideNumberH, '.', slideNumberV); + page.appendChild(numberElement); + } + } + + }); + + // Show all fragments + toArray(dom.wrapper.querySelectorAll(SLIDES_SELECTOR + ' .fragment')).forEach(function (fragment) { + fragment.classList.add('visible'); + }); + + // Notify subscribers that the PDF layout is good to go + dispatchEvent('pdf-ready'); + + } + + /** + * This is an unfortunate necessity. Some actions – such as + * an input field being focused in an iframe or using the + * keyboard to expand text selection beyond the bounds of + * a slide – can trigger our content to be pushed out of view. + * This scrolling can not be prevented by hiding overflow in + * CSS (we already do) so we have to resort to repeatedly + * checking if the slides have been offset :( + */ + function setupScrollPrevention() { + + setInterval(function () { + if (dom.wrapper.scrollTop !== 0 || dom.wrapper.scrollLeft !== 0) { + dom.wrapper.scrollTop = 0; + dom.wrapper.scrollLeft = 0; + } + }, 1000); + + } + + /** + * Creates an HTML element and returns a reference to it. + * If the element already exists the existing instance will + * be returned. + * + * @param {HTMLElement} container + * @param {string} tagname + * @param {string} classname + * @param {string} innerHTML + * + * @return {HTMLElement} + */ + function createSingletonNode(container, tagname, classname, innerHTML) { + + // Find all nodes matching the description + var nodes = container.querySelectorAll('.' + classname); + + // Check all matches to find one which is a direct child of + // the specified container + for (var i = 0; i < nodes.length; i++) { + var testNode = nodes[i]; + if (testNode.parentNode === container) { + return testNode; + } + } + + // If no node was found, create it now + var node = document.createElement(tagname); + node.className = classname; + if (typeof innerHTML === 'string') { + node.innerHTML = innerHTML; + } + container.appendChild(node); + + return node; + + } + + /** + * Creates the slide background elements and appends them + * to the background container. One element is created per + * slide no matter if the given slide has visible background. + */ + function createBackgrounds() { + + var printMode = isPrintingPDF(); + + // Clear prior backgrounds + dom.background.innerHTML = ''; + dom.background.classList.add('no-transition'); + + // Iterate over all horizontal slides + toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR)).forEach(function (slideh) { + + var backgroundStack = createBackground(slideh, dom.background); + + // Iterate over all vertical slides + toArray(slideh.querySelectorAll('section')).forEach(function (slidev) { + + createBackground(slidev, backgroundStack); + + backgroundStack.classList.add('stack'); + + }); + + }); + + // Add parallax background if specified + if (config.parallaxBackgroundImage) { + + dom.background.style.backgroundImage = 'url("' + config.parallaxBackgroundImage + '")'; + dom.background.style.backgroundSize = config.parallaxBackgroundSize; + + // Make sure the below properties are set on the element - these properties are + // needed for proper transitions to be set on the element via CSS. To remove + // annoying background slide-in effect when the presentation starts, apply + // these properties after short time delay + setTimeout(function () { + dom.wrapper.classList.add('has-parallax-background'); + }, 1); + + } else { + + dom.background.style.backgroundImage = ''; + dom.wrapper.classList.remove('has-parallax-background'); + + } + + } + + /** + * Creates a background for the given slide. + * + * @param {HTMLElement} slide + * @param {HTMLElement} container The element that the background + * should be appended to + * @return {HTMLElement} New background div + */ + function createBackground(slide, container) { + + var data = { + background: slide.getAttribute('data-background'), + backgroundSize: slide.getAttribute('data-background-size'), + backgroundImage: slide.getAttribute('data-background-image'), + backgroundVideo: slide.getAttribute('data-background-video'), + backgroundIframe: slide.getAttribute('data-background-iframe'), + backgroundColor: slide.getAttribute('data-background-color'), + backgroundRepeat: slide.getAttribute('data-background-repeat'), + backgroundPosition: slide.getAttribute('data-background-position'), + backgroundTransition: slide.getAttribute('data-background-transition') + }; + + var element = document.createElement('div'); + + // Carry over custom classes from the slide to the background + element.className = 'slide-background ' + slide.className.replace(/present|past|future/, ''); + + if (data.background) { + // Auto-wrap image urls in url(...) + if (/^(http|file|\/\/)/gi.test(data.background) || /\.(svg|png|jpg|jpeg|gif|bmp)([?#]|$)/gi.test(data.background)) { + slide.setAttribute('data-background-image', data.background); + } else { + element.style.background = data.background; + } + } + + // Create a hash for this combination of background settings. + // This is used to determine when two slide backgrounds are + // the same. + if (data.background || data.backgroundColor || data.backgroundImage || data.backgroundVideo || data.backgroundIframe) { + element.setAttribute('data-background-hash', data.background + + data.backgroundSize + + data.backgroundImage + + data.backgroundVideo + + data.backgroundIframe + + data.backgroundColor + + data.backgroundRepeat + + data.backgroundPosition + + data.backgroundTransition); + } + + // Additional and optional background properties + if (data.backgroundSize) element.style.backgroundSize = data.backgroundSize; + if (data.backgroundSize) element.setAttribute('data-background-size', data.backgroundSize); + if (data.backgroundColor) element.style.backgroundColor = data.backgroundColor; + if (data.backgroundRepeat) element.style.backgroundRepeat = data.backgroundRepeat; + if (data.backgroundPosition) element.style.backgroundPosition = data.backgroundPosition; + if (data.backgroundTransition) element.setAttribute('data-background-transition', data.backgroundTransition); + + container.appendChild(element); + + // If backgrounds are being recreated, clear old classes + slide.classList.remove('has-dark-background'); + slide.classList.remove('has-light-background'); + + slide.slideBackgroundElement = element; + + // If this slide has a background color, add a class that + // signals if it is light or dark. If the slide has no background + // color, no class will be set + var computedBackgroundStyle = window.getComputedStyle(element); + if (computedBackgroundStyle && computedBackgroundStyle.backgroundColor) { + var rgb = colorToRgb(computedBackgroundStyle.backgroundColor); + + // Ignore fully transparent backgrounds. Some browsers return + // rgba(0,0,0,0) when reading the computed background color of + // an element with no background + if (rgb && rgb.a !== 0) { + if (colorBrightness(computedBackgroundStyle.backgroundColor) < 128) { + slide.classList.add('has-dark-background'); + } else { + slide.classList.add('has-light-background'); + } + } + } + + return element; + + } + + /** + * Registers a listener to postMessage events, this makes it + * possible to call all reveal.js API methods from another + * window. For example: + * + * revealWindow.postMessage( JSON.stringify({ + * method: 'slide', + * args: [ 2 ] + * }), '*' ); + */ + function setupPostMessage() { + + if (config.postMessage) { + window.addEventListener('message', function (event) { + var data = event.data; + + // Make sure we're dealing with JSON + if (typeof data === 'string' && data.charAt(0) === '{' && data.charAt(data.length - 1) === '}') { + data = JSON.parse(data); + + // Check if the requested method can be found + if (data.method && typeof Reveal[data.method] === 'function') { + Reveal[data.method].apply(Reveal, data.args); + } + } + }, false); + } + + } + + /** + * Applies the configuration settings from the config + * object. May be called multiple times. + * + * @param {object} options + */ + function configure(options) { + + var oldTransition = config.transition; + + // New config options may be passed when this method + // is invoked through the API after initialization + if (typeof options === 'object') extend(config, options); + + // Abort if reveal.js hasn't finished loading, config + // changes will be applied automatically once loading + // finishes + if (loaded === false) return; + + var numberOfSlides = dom.wrapper.querySelectorAll(SLIDES_SELECTOR).length; + + // Remove the previously configured transition class + dom.wrapper.classList.remove(oldTransition); + + // Force linear transition based on browser capabilities + if (features.transforms3d === false) config.transition = 'linear'; + + dom.wrapper.classList.add(config.transition); + + dom.wrapper.setAttribute('data-transition-speed', config.transitionSpeed); + dom.wrapper.setAttribute('data-background-transition', config.backgroundTransition); + + dom.controls.style.display = config.controls ? 'block' : 'none'; + dom.progress.style.display = config.progress ? 'block' : 'none'; + + dom.controls.setAttribute('data-controls-layout', config.controlsLayout); + dom.controls.setAttribute('data-controls-back-arrows', config.controlsBackArrows); + + if (config.shuffle) { + shuffle(); + } + + if (config.rtl) { + dom.wrapper.classList.add('rtl'); + } else { + dom.wrapper.classList.remove('rtl'); + } + + if (config.center) { + dom.wrapper.classList.add('center'); + } else { + dom.wrapper.classList.remove('center'); + } + + // Exit the paused mode if it was configured off + if (config.pause === false) { + resume(); + } + + if (config.showNotes) { + dom.speakerNotes.setAttribute('data-layout', typeof config.showNotes === 'string' ? config.showNotes : 'inline'); + } + + if (config.mouseWheel) { + document.addEventListener('DOMMouseScroll', onDocumentMouseScroll, false); // FF + document.addEventListener('mousewheel', onDocumentMouseScroll, false); + } else { + document.removeEventListener('DOMMouseScroll', onDocumentMouseScroll, false); // FF + document.removeEventListener('mousewheel', onDocumentMouseScroll, false); + } + + // Rolling 3D links + if (config.rollingLinks) { + enableRollingLinks(); + } else { + disableRollingLinks(); + } + + // Iframe link previews + if (config.previewLinks) { + enablePreviewLinks(); + disablePreviewLinks('[data-preview-link=false]'); + } else { + disablePreviewLinks(); + enablePreviewLinks('[data-preview-link]:not([data-preview-link=false])'); + } + + // Remove existing auto-slide controls + if (autoSlidePlayer) { + autoSlidePlayer.destroy(); + autoSlidePlayer = null; + } + + // Generate auto-slide controls if needed + if (numberOfSlides > 1 && config.autoSlide && config.autoSlideStoppable && features.canvas && features.requestAnimationFrame) { + autoSlidePlayer = new Playback(dom.wrapper, function () { + return Math.min(Math.max((Date.now() - autoSlideStartTime) / autoSlide, 0), 1); + }); + + autoSlidePlayer.on('click', onAutoSlidePlayerClick); + autoSlidePaused = false; + } + + // When fragments are turned off they should be visible + if (config.fragments === false) { + toArray(dom.slides.querySelectorAll('.fragment')).forEach(function (element) { + element.classList.add('visible'); + element.classList.remove('current-fragment'); + }); + } + + // Slide numbers + var slideNumberDisplay = 'none'; + if (config.slideNumber && !isPrintingPDF()) { + if (config.showSlideNumber === 'all') { + slideNumberDisplay = 'block'; + } else if (config.showSlideNumber === 'speaker' && isSpeakerNotes()) { + slideNumberDisplay = 'block'; + } + } + + dom.slideNumber.style.display = slideNumberDisplay; + + sync(); + + } + + /** + * Binds all event listeners. + */ + function addEventListeners() { + + eventsAreBound = true; + + window.addEventListener('hashchange', onWindowHashChange, false); + window.addEventListener('resize', onWindowResize, false); + + if (config.touch) { + dom.wrapper.addEventListener('touchstart', onTouchStart, false); + dom.wrapper.addEventListener('touchmove', onTouchMove, false); + dom.wrapper.addEventListener('touchend', onTouchEnd, false); + + // Support pointer-style touch interaction as well + if (window.navigator.pointerEnabled) { + // IE 11 uses un-prefixed version of pointer events + dom.wrapper.addEventListener('pointerdown', onPointerDown, false); + dom.wrapper.addEventListener('pointermove', onPointerMove, false); + dom.wrapper.addEventListener('pointerup', onPointerUp, false); + } else if (window.navigator.msPointerEnabled) { + // IE 10 uses prefixed version of pointer events + dom.wrapper.addEventListener('MSPointerDown', onPointerDown, false); + dom.wrapper.addEventListener('MSPointerMove', onPointerMove, false); + dom.wrapper.addEventListener('MSPointerUp', onPointerUp, false); + } + } + + if (config.keyboard) { + document.addEventListener('keydown', onDocumentKeyDown, false); + document.addEventListener('keypress', onDocumentKeyPress, false); + } + + if (config.progress && dom.progress) { + dom.progress.addEventListener('click', onProgressClicked, false); + } + + if (config.focusBodyOnPageVisibilityChange) { + var visibilityChange; + + if ('hidden' in document) { + visibilityChange = 'visibilitychange'; + } else if ('msHidden' in document) { + visibilityChange = 'msvisibilitychange'; + } else if ('webkitHidden' in document) { + visibilityChange = 'webkitvisibilitychange'; + } + + if (visibilityChange) { + document.addEventListener(visibilityChange, onPageVisibilityChange, false); + } + } + + // Listen to both touch and click events, in case the device + // supports both + var pointerEvents = ['touchstart', 'click']; + + // Only support touch for Android, fixes double navigations in + // stock browser + if (UA.match(/android/gi)) { + pointerEvents = ['touchstart']; + } + + pointerEvents.forEach(function (eventName) { + dom.controlsLeft.forEach(function (el) { + el.addEventListener(eventName, onNavigateLeftClicked, false); + }); + dom.controlsRight.forEach(function (el) { + el.addEventListener(eventName, onNavigateRightClicked, false); + }); + dom.controlsUp.forEach(function (el) { + el.addEventListener(eventName, onNavigateUpClicked, false); + }); + dom.controlsDown.forEach(function (el) { + el.addEventListener(eventName, onNavigateDownClicked, false); + }); + dom.controlsPrev.forEach(function (el) { + el.addEventListener(eventName, onNavigatePrevClicked, false); + }); + dom.controlsNext.forEach(function (el) { + el.addEventListener(eventName, onNavigateNextClicked, false); + }); + }); + + } + + /** + * Unbinds all event listeners. + */ + function removeEventListeners() { + + eventsAreBound = false; + + document.removeEventListener('keydown', onDocumentKeyDown, false); + document.removeEventListener('keypress', onDocumentKeyPress, false); + window.removeEventListener('hashchange', onWindowHashChange, false); + window.removeEventListener('resize', onWindowResize, false); + + dom.wrapper.removeEventListener('touchstart', onTouchStart, false); + dom.wrapper.removeEventListener('touchmove', onTouchMove, false); + dom.wrapper.removeEventListener('touchend', onTouchEnd, false); + + // IE11 + if (window.navigator.pointerEnabled) { + dom.wrapper.removeEventListener('pointerdown', onPointerDown, false); + dom.wrapper.removeEventListener('pointermove', onPointerMove, false); + dom.wrapper.removeEventListener('pointerup', onPointerUp, false); + } + // IE10 + else if (window.navigator.msPointerEnabled) { + dom.wrapper.removeEventListener('MSPointerDown', onPointerDown, false); + dom.wrapper.removeEventListener('MSPointerMove', onPointerMove, false); + dom.wrapper.removeEventListener('MSPointerUp', onPointerUp, false); + } + + if (config.progress && dom.progress) { + dom.progress.removeEventListener('click', onProgressClicked, false); + } + + ['touchstart', 'click'].forEach(function (eventName) { + dom.controlsLeft.forEach(function (el) { + el.removeEventListener(eventName, onNavigateLeftClicked, false); + }); + dom.controlsRight.forEach(function (el) { + el.removeEventListener(eventName, onNavigateRightClicked, false); + }); + dom.controlsUp.forEach(function (el) { + el.removeEventListener(eventName, onNavigateUpClicked, false); + }); + dom.controlsDown.forEach(function (el) { + el.removeEventListener(eventName, onNavigateDownClicked, false); + }); + dom.controlsPrev.forEach(function (el) { + el.removeEventListener(eventName, onNavigatePrevClicked, false); + }); + dom.controlsNext.forEach(function (el) { + el.removeEventListener(eventName, onNavigateNextClicked, false); + }); + }); + + } + + /** + * Extend object a with the properties of object b. + * If there's a conflict, object b takes precedence. + * + * @param {object} a + * @param {object} b + */ + function extend(a, b) { + + for (var i in b) { + a[i] = b[i]; + } + + return a; + + } + + /** + * Converts the target object to an array. + * + * @param {object} o + * @return {object[]} + */ + function toArray(o) { + + return Array.prototype.slice.call(o); + + } + + /** + * Utility for deserializing a value. + * + * @param {*} value + * @return {*} + */ + function deserialize(value) { + + if (typeof value === 'string') { + if (value === 'null') return null; + else if (value === 'true') return true; + else if (value === 'false') return false; + else if (value.match(/^-?[\d\.]+$/)) return parseFloat(value); + } + + return value; + + } + + /** + * Measures the distance in pixels between point a + * and point b. + * + * @param {object} a point with x/y properties + * @param {object} b point with x/y properties + * + * @return {number} + */ + function distanceBetween(a, b) { + + var dx = a.x - b.x, + dy = a.y - b.y; + + return Math.sqrt(dx * dx + dy * dy); + + } + + /** + * Applies a CSS transform to the target element. + * + * @param {HTMLElement} element + * @param {string} transform + */ + function transformElement(element, transform) { + + element.style.WebkitTransform = transform; + element.style.MozTransform = transform; + element.style.msTransform = transform; + element.style.transform = transform; + + } + + /** + * Applies CSS transforms to the slides container. The container + * is transformed from two separate sources: layout and the overview + * mode. + * + * @param {object} transforms + */ + function transformSlides(transforms) { + + // Pick up new transforms from arguments + if (typeof transforms.layout === 'string') slidesTransform.layout = transforms.layout; + if (typeof transforms.overview === 'string') slidesTransform.overview = transforms.overview; + + // Apply the transforms to the slides container + if (slidesTransform.layout) { + transformElement(dom.slides, slidesTransform.layout + ' ' + slidesTransform.overview); + } else { + transformElement(dom.slides, slidesTransform.overview); + } + + } + + /** + * Injects the given CSS styles into the DOM. + * + * @param {string} value + */ + function injectStyleSheet(value) { + + var tag = document.createElement('style'); + tag.type = 'text/css'; + if (tag.styleSheet) { + tag.styleSheet.cssText = value; + } else { + tag.appendChild(document.createTextNode(value)); + } + document.getElementsByTagName('head')[0].appendChild(tag); + + } + + /** + * Find the closest parent that matches the given + * selector. + * + * @param {HTMLElement} target The child element + * @param {String} selector The CSS selector to match + * the parents against + * + * @return {HTMLElement} The matched parent or null + * if no matching parent was found + */ + function closestParent(target, selector) { + + var parent = target.parentNode; + + while (parent) { + + // There's some overhead doing this each time, we don't + // want to rewrite the element prototype but should still + // be enough to feature detect once at startup... + var matchesMethod = parent.matches || parent.matchesSelector || parent.msMatchesSelector; + + // If we find a match, we're all set + if (matchesMethod && matchesMethod.call(parent, selector)) { + return parent; + } + + // Keep searching + parent = parent.parentNode; + + } + + return null; + + } + + /** + * Converts various color input formats to an {r:0,g:0,b:0} object. + * + * @param {string} color The string representation of a color + * @example + * colorToRgb('#000'); + * @example + * colorToRgb('#000000'); + * @example + * colorToRgb('rgb(0,0,0)'); + * @example + * colorToRgb('rgba(0,0,0)'); + * + * @return {{r: number, g: number, b: number, [a]: number}|null} + */ + function colorToRgb(color) { + + var hex3 = color.match(/^#([0-9a-f]{3})$/i); + if (hex3 && hex3[1]) { + hex3 = hex3[1]; + return { + r: parseInt(hex3.charAt(0), 16) * 0x11, + g: parseInt(hex3.charAt(1), 16) * 0x11, + b: parseInt(hex3.charAt(2), 16) * 0x11 + }; + } + + var hex6 = color.match(/^#([0-9a-f]{6})$/i); + if (hex6 && hex6[1]) { + hex6 = hex6[1]; + return { + r: parseInt(hex6.substr(0, 2), 16), + g: parseInt(hex6.substr(2, 2), 16), + b: parseInt(hex6.substr(4, 2), 16) + }; + } + + var rgb = color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i); + if (rgb) { + return { + r: parseInt(rgb[1], 10), + g: parseInt(rgb[2], 10), + b: parseInt(rgb[3], 10) + }; + } + + var rgba = color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*([\d]+|[\d]*.[\d]+)\s*\)$/i); + if (rgba) { + return { + r: parseInt(rgba[1], 10), + g: parseInt(rgba[2], 10), + b: parseInt(rgba[3], 10), + a: parseFloat(rgba[4]) + }; + } + + return null; + + } + + /** + * Calculates brightness on a scale of 0-255. + * + * @param {string} color See colorToRgb for supported formats. + * @see {@link colorToRgb} + */ + function colorBrightness(color) { + + if (typeof color === 'string') color = colorToRgb(color); + + if (color) { + return (color.r * 299 + color.g * 587 + color.b * 114) / 1000; + } + + return null; + + } + + /** + * Returns the remaining height within the parent of the + * target element. + * + * remaining height = [ configured parent height ] - [ current parent height ] + * + * @param {HTMLElement} element + * @param {number} [height] + */ + function getRemainingHeight(element, height) { + + height = height || 0; + + if (element) { + var newHeight, oldHeight = element.style.height; + + // Change the .stretch element height to 0 in order find the height of all + // the other elements + element.style.height = '0px'; + newHeight = height - element.parentNode.offsetHeight; + + // Restore the old height, just in case + element.style.height = oldHeight + 'px'; + + return newHeight; + } + + return height; + + } + + /** + * Checks if this instance is being used to print a PDF. + */ + function isPrintingPDF() { + + return (/print-pdf/gi).test(window.location.search); + + } + + /** + * Hides the address bar if we're on a mobile device. + */ + function hideAddressBar() { + + if (config.hideAddressBar && isMobileDevice) { + // Events that should trigger the address bar to hide + window.addEventListener('load', removeAddressBar, false); + window.addEventListener('orientationchange', removeAddressBar, false); + } + + } + + /** + * Causes the address bar to hide on mobile devices, + * more vertical space ftw. + */ + function removeAddressBar() { + + setTimeout(function () { + window.scrollTo(0, 1); + }, 10); + + } + + /** + * Dispatches an event of the specified type from the + * reveal DOM element. + */ + function dispatchEvent(type, args) { - var event = document.createEvent( 'HTMLEvents', 1, 2 ); - event.initEvent( type, true, true ); - extend( event, args ); - dom.wrapper.dispatchEvent( event ); + var event = document.createEvent('HTMLEvents', 1, 2); + event.initEvent(type, true, true); + extend(event, args); + dom.wrapper.dispatchEvent(event); - // If we're in an iframe, post each reveal.js event to the - // parent window. Used by the notes plugin - if( config.postMessageEvents && window.parent !== window.self ) { - window.parent.postMessage( JSON.stringify({ namespace: 'reveal', eventName: type, state: getState() }), '*' ); - } - - } - - /** - * Wrap all links in 3D goodness. - */ - function enableRollingLinks() { - - if( features.transforms3d && !( 'msPerspective' in document.body.style ) ) { - var anchors = dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' a' ); - - for( var i = 0, len = anchors.length; i < len; i++ ) { - var anchor = anchors[i]; - - if( anchor.textContent && !anchor.querySelector( '*' ) && ( !anchor.className || !anchor.classList.contains( anchor, 'roll' ) ) ) { - var span = document.createElement('span'); - span.setAttribute('data-title', anchor.text); - span.innerHTML = anchor.innerHTML; - - anchor.classList.add( 'roll' ); - anchor.innerHTML = ''; - anchor.appendChild(span); - } - } - } - - } - - /** - * Unwrap all 3D links. - */ - function disableRollingLinks() { - - var anchors = dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ' a.roll' ); - - for( var i = 0, len = anchors.length; i < len; i++ ) { - var anchor = anchors[i]; - var span = anchor.querySelector( 'span' ); - - if( span ) { - anchor.classList.remove( 'roll' ); - anchor.innerHTML = span.innerHTML; - } - } - - } - - /** - * Bind preview frame links. - * - * @param {string} [selector=a] - selector for anchors - */ - function enablePreviewLinks( selector ) { - - var anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) ); - - anchors.forEach( function( element ) { - if( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) { - element.addEventListener( 'click', onPreviewLinkClicked, false ); - } - } ); - - } - - /** - * Unbind preview frame links. - */ - function disablePreviewLinks( selector ) { - - var anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) ); - - anchors.forEach( function( element ) { - if( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) { - element.removeEventListener( 'click', onPreviewLinkClicked, false ); - } - } ); - - } - - /** - * Opens a preview window for the target URL. - * - * @param {string} url - url for preview iframe src - */ - function showPreview( url ) { - - closeOverlay(); - - dom.overlay = document.createElement( 'div' ); - dom.overlay.classList.add( 'overlay' ); - dom.overlay.classList.add( 'overlay-preview' ); - dom.wrapper.appendChild( dom.overlay ); - - dom.overlay.innerHTML = [ - '
    ', - '', - '', - '
    ', - '
    ', - '
    ', - '', - '', - 'Unable to load iframe. This is likely due to the site\'s policy (x-frame-options).', - '', - '
    ' - ].join(''); - - dom.overlay.querySelector( 'iframe' ).addEventListener( 'load', function( event ) { - dom.overlay.classList.add( 'loaded' ); - }, false ); - - dom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) { - closeOverlay(); - event.preventDefault(); - }, false ); - - dom.overlay.querySelector( '.external' ).addEventListener( 'click', function( event ) { - closeOverlay(); - }, false ); - - setTimeout( function() { - dom.overlay.classList.add( 'visible' ); - }, 1 ); - - } - - /** - * Open or close help overlay window. - * - * @param {Boolean} [override] Flag which overrides the - * toggle logic and forcibly sets the desired state. True means - * help is open, false means it's closed. - */ - function toggleHelp( override ){ - - if( typeof override === 'boolean' ) { - override ? showHelp() : closeOverlay(); - } - else { - if( dom.overlay ) { - closeOverlay(); - } - else { - showHelp(); - } - } - } - - /** - * Opens an overlay window with help material. - */ - function showHelp() { - - if( config.help ) { - - closeOverlay(); - - dom.overlay = document.createElement( 'div' ); - dom.overlay.classList.add( 'overlay' ); - dom.overlay.classList.add( 'overlay-help' ); - dom.wrapper.appendChild( dom.overlay ); - - var html = '

    Keyboard Shortcuts


    '; - - html += ''; - for( var key in keyboardShortcuts ) { - html += ''; - } - - html += '
    KEYACTION
    ' + key + '' + keyboardShortcuts[ key ] + '
    '; - - dom.overlay.innerHTML = [ - '
    ', - '', - '
    ', - '
    ', - '
    '+ html +'
    ', - '
    ' - ].join(''); - - dom.overlay.querySelector( '.close' ).addEventListener( 'click', function( event ) { - closeOverlay(); - event.preventDefault(); - }, false ); - - setTimeout( function() { - dom.overlay.classList.add( 'visible' ); - }, 1 ); - - } - - } - - /** - * Closes any currently open overlay. - */ - function closeOverlay() { - - if( dom.overlay ) { - dom.overlay.parentNode.removeChild( dom.overlay ); - dom.overlay = null; - } - - } - - /** - * Applies JavaScript-controlled layout rules to the - * presentation. - */ - function layout() { - - if( dom.wrapper && !isPrintingPDF() ) { - - var size = getComputedSlideSize(); - - // Layout the contents of the slides - layoutSlideContents( config.width, config.height ); - - dom.slides.style.width = size.width + 'px'; - dom.slides.style.height = size.height + 'px'; - - // Determine scale of content to fit within available space - scale = Math.min( size.presentationWidth / size.width, size.presentationHeight / size.height ); - - // Respect max/min scale settings - scale = Math.max( scale, config.minScale ); - scale = Math.min( scale, config.maxScale ); - - // Don't apply any scaling styles if scale is 1 - if( scale === 1 ) { - dom.slides.style.zoom = ''; - dom.slides.style.left = ''; - dom.slides.style.top = ''; - dom.slides.style.bottom = ''; - dom.slides.style.right = ''; - transformSlides( { layout: '' } ); - } - else { - // Prefer zoom for scaling up so that content remains crisp. - // Don't use zoom to scale down since that can lead to shifts - // in text layout/line breaks. - if( scale > 1 && features.zoom ) { - dom.slides.style.zoom = scale; - dom.slides.style.left = ''; - dom.slides.style.top = ''; - dom.slides.style.bottom = ''; - dom.slides.style.right = ''; - transformSlides( { layout: '' } ); - } - // Apply scale transform as a fallback - else { - dom.slides.style.zoom = ''; - dom.slides.style.left = '50%'; - dom.slides.style.top = '50%'; - dom.slides.style.bottom = 'auto'; - dom.slides.style.right = 'auto'; - transformSlides( { layout: 'translate(-50%, -50%) scale('+ scale +')' } ); - } - } - - // Select all slides, vertical and horizontal - var slides = toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ); - - for( var i = 0, len = slides.length; i < len; i++ ) { - var slide = slides[ i ]; - - // Don't bother updating invisible slides - if( slide.style.display === 'none' ) { - continue; - } - - if( config.center || slide.classList.contains( 'center' ) ) { - // Vertical stacks are not centred since their section - // children will be - if( slide.classList.contains( 'stack' ) ) { - slide.style.top = 0; - } - else { - slide.style.top = Math.max( ( size.height - slide.scrollHeight ) / 2, 0 ) + 'px'; - } - } - else { - slide.style.top = ''; - } - - } - - updateProgress(); - updateParallax(); - - if( isOverview() ) { - updateOverview(); - } - - } - - } - - /** - * Applies layout logic to the contents of all slides in - * the presentation. - * - * @param {string|number} width - * @param {string|number} height - */ - function layoutSlideContents( width, height ) { - - // Handle sizing of elements with the 'stretch' class - toArray( dom.slides.querySelectorAll( 'section > .stretch' ) ).forEach( function( element ) { - - // Determine how much vertical space we can use - var remainingHeight = getRemainingHeight( element, height ); - - // Consider the aspect ratio of media elements - if( /(img|video)/gi.test( element.nodeName ) ) { - var nw = element.naturalWidth || element.videoWidth, - nh = element.naturalHeight || element.videoHeight; - - var es = Math.min( width / nw, remainingHeight / nh ); - - element.style.width = ( nw * es ) + 'px'; - element.style.height = ( nh * es ) + 'px'; - - } - else { - element.style.width = width + 'px'; - element.style.height = remainingHeight + 'px'; - } - - } ); - - } - - /** - * Calculates the computed pixel size of our slides. These - * values are based on the width and height configuration - * options. - * - * @param {number} [presentationWidth=dom.wrapper.offsetWidth] - * @param {number} [presentationHeight=dom.wrapper.offsetHeight] - */ - function getComputedSlideSize( presentationWidth, presentationHeight ) { - - var size = { - // Slide size - width: config.width, - height: config.height, - - // Presentation size - presentationWidth: presentationWidth || dom.wrapper.offsetWidth, - presentationHeight: presentationHeight || dom.wrapper.offsetHeight - }; - - // Reduce available space by margin - size.presentationWidth -= ( size.presentationWidth * config.margin ); - size.presentationHeight -= ( size.presentationHeight * config.margin ); - - // Slide width may be a percentage of available width - if( typeof size.width === 'string' && /%$/.test( size.width ) ) { - size.width = parseInt( size.width, 10 ) / 100 * size.presentationWidth; - } - - // Slide height may be a percentage of available height - if( typeof size.height === 'string' && /%$/.test( size.height ) ) { - size.height = parseInt( size.height, 10 ) / 100 * size.presentationHeight; - } - - return size; - - } - - /** - * Stores the vertical index of a stack so that the same - * vertical slide can be selected when navigating to and - * from the stack. - * - * @param {HTMLElement} stack The vertical stack element - * @param {string|number} [v=0] Index to memorize - */ - function setPreviousVerticalIndex( stack, v ) { - - if( typeof stack === 'object' && typeof stack.setAttribute === 'function' ) { - stack.setAttribute( 'data-previous-indexv', v || 0 ); - } - - } - - /** - * Retrieves the vertical index which was stored using - * #setPreviousVerticalIndex() or 0 if no previous index - * exists. - * - * @param {HTMLElement} stack The vertical stack element - */ - function getPreviousVerticalIndex( stack ) { - - if( typeof stack === 'object' && typeof stack.setAttribute === 'function' && stack.classList.contains( 'stack' ) ) { - // Prefer manually defined start-indexv - var attributeName = stack.hasAttribute( 'data-start-indexv' ) ? 'data-start-indexv' : 'data-previous-indexv'; - - return parseInt( stack.getAttribute( attributeName ) || 0, 10 ); - } - - return 0; - - } - - /** - * Displays the overview of slides (quick nav) by scaling - * down and arranging all slide elements. - */ - function activateOverview() { - - // Only proceed if enabled in config - if( config.overview && !isOverview() ) { - - overview = true; - - dom.wrapper.classList.add( 'overview' ); - dom.wrapper.classList.remove( 'overview-deactivating' ); - - if( features.overviewTransitions ) { - setTimeout( function() { - dom.wrapper.classList.add( 'overview-animated' ); - }, 1 ); - } - - // Don't auto-slide while in overview mode - cancelAutoSlide(); - - // Move the backgrounds element into the slide container to - // that the same scaling is applied - dom.slides.appendChild( dom.background ); - - // Clicking on an overview slide navigates to it - toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) { - if( !slide.classList.contains( 'stack' ) ) { - slide.addEventListener( 'click', onOverviewSlideClicked, true ); - } - } ); - - // Calculate slide sizes - var margin = 70; - var slideSize = getComputedSlideSize(); - overviewSlideWidth = slideSize.width + margin; - overviewSlideHeight = slideSize.height + margin; - - // Reverse in RTL mode - if( config.rtl ) { - overviewSlideWidth = -overviewSlideWidth; - } + // If we're in an iframe, post each reveal.js event to the + // parent window. Used by the notes plugin + if (config.postMessageEvents && window.parent !== window.self) { + window.parent.postMessage(JSON.stringify({namespace: 'reveal', eventName: type, state: getState()}), '*'); + } + + } + + /** + * Wrap all links in 3D goodness. + */ + function enableRollingLinks() { + + if (features.transforms3d && !('msPerspective' in document.body.style)) { + var anchors = dom.wrapper.querySelectorAll(SLIDES_SELECTOR + ' a'); + + for (var i = 0, len = anchors.length; i < len; i++) { + var anchor = anchors[i]; + + if (anchor.textContent && !anchor.querySelector('*') && (!anchor.className || !anchor.classList.contains(anchor, 'roll'))) { + var span = document.createElement('span'); + span.setAttribute('data-title', anchor.text); + span.innerHTML = anchor.innerHTML; + + anchor.classList.add('roll'); + anchor.innerHTML = ''; + anchor.appendChild(span); + } + } + } + + } + + /** + * Unwrap all 3D links. + */ + function disableRollingLinks() { + + var anchors = dom.wrapper.querySelectorAll(SLIDES_SELECTOR + ' a.roll'); + + for (var i = 0, len = anchors.length; i < len; i++) { + var anchor = anchors[i]; + var span = anchor.querySelector('span'); + + if (span) { + anchor.classList.remove('roll'); + anchor.innerHTML = span.innerHTML; + } + } + + } + + /** + * Bind preview frame links. + * + * @param {string} [selector=a] - selector for anchors + */ + function enablePreviewLinks(selector) { + + var anchors = toArray(document.querySelectorAll(selector ? selector : 'a')); + + anchors.forEach(function (element) { + if (/^(http|www)/gi.test(element.getAttribute('href'))) { + element.addEventListener('click', onPreviewLinkClicked, false); + } + }); + + } + + /** + * Unbind preview frame links. + */ + function disablePreviewLinks(selector) { + + var anchors = toArray(document.querySelectorAll(selector ? selector : 'a')); + + anchors.forEach(function (element) { + if (/^(http|www)/gi.test(element.getAttribute('href'))) { + element.removeEventListener('click', onPreviewLinkClicked, false); + } + }); + + } + + /** + * Opens a preview window for the target URL. + * + * @param {string} url - url for preview iframe src + */ + function showPreview(url) { + + closeOverlay(); + + dom.overlay = document.createElement('div'); + dom.overlay.classList.add('overlay'); + dom.overlay.classList.add('overlay-preview'); + dom.wrapper.appendChild(dom.overlay); + + dom.overlay.innerHTML = [ + '
    ', + '', + '', + '
    ', + '
    ', + '
    ', + '', + '', + 'Unable to load iframe. This is likely due to the site\'s policy (x-frame-options).', + '', + '
    ' + ].join(''); + + dom.overlay.querySelector('iframe').addEventListener('load', function (event) { + dom.overlay.classList.add('loaded'); + }, false); + + dom.overlay.querySelector('.close').addEventListener('click', function (event) { + closeOverlay(); + event.preventDefault(); + }, false); + + dom.overlay.querySelector('.external').addEventListener('click', function (event) { + closeOverlay(); + }, false); + + setTimeout(function () { + dom.overlay.classList.add('visible'); + }, 1); + + } + + /** + * Open or close help overlay window. + * + * @param {Boolean} [override] Flag which overrides the + * toggle logic and forcibly sets the desired state. True means + * help is open, false means it's closed. + */ + function toggleHelp(override) { + + if (typeof override === 'boolean') { + override ? showHelp() : closeOverlay(); + } else { + if (dom.overlay) { + closeOverlay(); + } else { + showHelp(); + } + } + } + + /** + * Opens an overlay window with help material. + */ + function showHelp() { + + if (config.help) { + + closeOverlay(); + + dom.overlay = document.createElement('div'); + dom.overlay.classList.add('overlay'); + dom.overlay.classList.add('overlay-help'); + dom.wrapper.appendChild(dom.overlay); + + var html = '

    Keyboard Shortcuts


    '; + + html += ''; + for (var key in keyboardShortcuts) { + html += ''; + } + + html += '
    KEYACTION
    ' + key + '' + keyboardShortcuts[key] + '
    '; + + dom.overlay.innerHTML = [ + '
    ', + '', + '
    ', + '
    ', + '
    ' + html + '
    ', + '
    ' + ].join(''); + + dom.overlay.querySelector('.close').addEventListener('click', function (event) { + closeOverlay(); + event.preventDefault(); + }, false); + + setTimeout(function () { + dom.overlay.classList.add('visible'); + }, 1); + + } + + } + + /** + * Closes any currently open overlay. + */ + function closeOverlay() { + + if (dom.overlay) { + dom.overlay.parentNode.removeChild(dom.overlay); + dom.overlay = null; + } + + } + + /** + * Applies JavaScript-controlled layout rules to the + * presentation. + */ + function layout() { + + if (dom.wrapper && !isPrintingPDF()) { + + var size = getComputedSlideSize(); + + // Layout the contents of the slides + layoutSlideContents(config.width, config.height); + + dom.slides.style.width = size.width + 'px'; + dom.slides.style.height = size.height + 'px'; + + // Determine scale of content to fit within available space + scale = Math.min(size.presentationWidth / size.width, size.presentationHeight / size.height); + + // Respect max/min scale settings + scale = Math.max(scale, config.minScale); + scale = Math.min(scale, config.maxScale); + + // Don't apply any scaling styles if scale is 1 + if (scale === 1) { + dom.slides.style.zoom = ''; + dom.slides.style.left = ''; + dom.slides.style.top = ''; + dom.slides.style.bottom = ''; + dom.slides.style.right = ''; + transformSlides({layout: ''}); + } else { + // Prefer zoom for scaling up so that content remains crisp. + // Don't use zoom to scale down since that can lead to shifts + // in text layout/line breaks. + if (scale > 1 && features.zoom) { + dom.slides.style.zoom = scale; + dom.slides.style.left = ''; + dom.slides.style.top = ''; + dom.slides.style.bottom = ''; + dom.slides.style.right = ''; + transformSlides({layout: ''}); + } + // Apply scale transform as a fallback + else { + dom.slides.style.zoom = ''; + dom.slides.style.left = '50%'; + dom.slides.style.top = '50%'; + dom.slides.style.bottom = 'auto'; + dom.slides.style.right = 'auto'; + transformSlides({layout: 'translate(-50%, -50%) scale(' + scale + ')'}); + } + } + + // Select all slides, vertical and horizontal + var slides = toArray(dom.wrapper.querySelectorAll(SLIDES_SELECTOR)); + + for (var i = 0, len = slides.length; i < len; i++) { + var slide = slides[i]; + + // Don't bother updating invisible slides + if (slide.style.display === 'none') { + continue; + } + + if (config.center || slide.classList.contains('center')) { + // Vertical stacks are not centred since their section + // children will be + if (slide.classList.contains('stack')) { + slide.style.top = 0; + } else { + slide.style.top = Math.max((size.height - slide.scrollHeight) / 2, 0) + 'px'; + } + } else { + slide.style.top = ''; + } + + } + + updateProgress(); + updateParallax(); + + if (isOverview()) { + updateOverview(); + } + + } + + } + + /** + * Applies layout logic to the contents of all slides in + * the presentation. + * + * @param {string|number} width + * @param {string|number} height + */ + function layoutSlideContents(width, height) { + + // Handle sizing of elements with the 'stretch' class + toArray(dom.slides.querySelectorAll('section > .stretch')).forEach(function (element) { + + // Determine how much vertical space we can use + var remainingHeight = getRemainingHeight(element, height); + + // Consider the aspect ratio of media elements + if (/(img|video)/gi.test(element.nodeName)) { + var nw = element.naturalWidth || element.videoWidth, + nh = element.naturalHeight || element.videoHeight; + + var es = Math.min(width / nw, remainingHeight / nh); + + element.style.width = (nw * es) + 'px'; + element.style.height = (nh * es) + 'px'; + + } else { + element.style.width = width + 'px'; + element.style.height = remainingHeight + 'px'; + } + + }); + + } + + /** + * Calculates the computed pixel size of our slides. These + * values are based on the width and height configuration + * options. + * + * @param {number} [presentationWidth=dom.wrapper.offsetWidth] + * @param {number} [presentationHeight=dom.wrapper.offsetHeight] + */ + function getComputedSlideSize(presentationWidth, presentationHeight) { + + var size = { + // Slide size + width: config.width, + height: config.height, + + // Presentation size + presentationWidth: presentationWidth || dom.wrapper.offsetWidth, + presentationHeight: presentationHeight || dom.wrapper.offsetHeight + }; + + // Reduce available space by margin + size.presentationWidth -= (size.presentationWidth * config.margin); + size.presentationHeight -= (size.presentationHeight * config.margin); + + // Slide width may be a percentage of available width + if (typeof size.width === 'string' && /%$/.test(size.width)) { + size.width = parseInt(size.width, 10) / 100 * size.presentationWidth; + } + + // Slide height may be a percentage of available height + if (typeof size.height === 'string' && /%$/.test(size.height)) { + size.height = parseInt(size.height, 10) / 100 * size.presentationHeight; + } + + return size; + + } + + /** + * Stores the vertical index of a stack so that the same + * vertical slide can be selected when navigating to and + * from the stack. + * + * @param {HTMLElement} stack The vertical stack element + * @param {string|number} [v=0] Index to memorize + */ + function setPreviousVerticalIndex(stack, v) { + + if (typeof stack === 'object' && typeof stack.setAttribute === 'function') { + stack.setAttribute('data-previous-indexv', v || 0); + } + + } + + /** + * Retrieves the vertical index which was stored using + * #setPreviousVerticalIndex() or 0 if no previous index + * exists. + * + * @param {HTMLElement} stack The vertical stack element + */ + function getPreviousVerticalIndex(stack) { + + if (typeof stack === 'object' && typeof stack.setAttribute === 'function' && stack.classList.contains('stack')) { + // Prefer manually defined start-indexv + var attributeName = stack.hasAttribute('data-start-indexv') ? 'data-start-indexv' : 'data-previous-indexv'; + + return parseInt(stack.getAttribute(attributeName) || 0, 10); + } + + return 0; + + } + + /** + * Displays the overview of slides (quick nav) by scaling + * down and arranging all slide elements. + */ + function activateOverview() { + + // Only proceed if enabled in config + if (config.overview && !isOverview()) { + + overview = true; + + dom.wrapper.classList.add('overview'); + dom.wrapper.classList.remove('overview-deactivating'); + + if (features.overviewTransitions) { + setTimeout(function () { + dom.wrapper.classList.add('overview-animated'); + }, 1); + } + + // Don't auto-slide while in overview mode + cancelAutoSlide(); + + // Move the backgrounds element into the slide container to + // that the same scaling is applied + dom.slides.appendChild(dom.background); + + // Clicking on an overview slide navigates to it + toArray(dom.wrapper.querySelectorAll(SLIDES_SELECTOR)).forEach(function (slide) { + if (!slide.classList.contains('stack')) { + slide.addEventListener('click', onOverviewSlideClicked, true); + } + }); + + // Calculate slide sizes + var margin = 70; + var slideSize = getComputedSlideSize(); + overviewSlideWidth = slideSize.width + margin; + overviewSlideHeight = slideSize.height + margin; + + // Reverse in RTL mode + if (config.rtl) { + overviewSlideWidth = -overviewSlideWidth; + } - updateSlidesVisibility(); - layoutOverview(); - updateOverview(); + updateSlidesVisibility(); + layoutOverview(); + updateOverview(); - layout(); - - // Notify observers of the overview showing - dispatchEvent( 'overviewshown', { - 'indexh': indexh, - 'indexv': indexv, - 'currentSlide': currentSlide - } ); + layout(); + + // Notify observers of the overview showing + dispatchEvent('overviewshown', { + 'indexh': indexh, + 'indexv': indexv, + 'currentSlide': currentSlide + }); - } + } - } + } - /** - * Uses CSS transforms to position all slides in a grid for - * display inside of the overview mode. - */ - function layoutOverview() { + /** + * Uses CSS transforms to position all slides in a grid for + * display inside of the overview mode. + */ + function layoutOverview() { - // Layout slides - toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( hslide, h ) { - hslide.setAttribute( 'data-index-h', h ); - transformElement( hslide, 'translate3d(' + ( h * overviewSlideWidth ) + 'px, 0, 0)' ); + // Layout slides + toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR)).forEach(function (hslide, h) { + hslide.setAttribute('data-index-h', h); + transformElement(hslide, 'translate3d(' + (h * overviewSlideWidth) + 'px, 0, 0)'); - if( hslide.classList.contains( 'stack' ) ) { + if (hslide.classList.contains('stack')) { - toArray( hslide.querySelectorAll( 'section' ) ).forEach( function( vslide, v ) { - vslide.setAttribute( 'data-index-h', h ); - vslide.setAttribute( 'data-index-v', v ); + toArray(hslide.querySelectorAll('section')).forEach(function (vslide, v) { + vslide.setAttribute('data-index-h', h); + vslide.setAttribute('data-index-v', v); - transformElement( vslide, 'translate3d(0, ' + ( v * overviewSlideHeight ) + 'px, 0)' ); - } ); + transformElement(vslide, 'translate3d(0, ' + (v * overviewSlideHeight) + 'px, 0)'); + }); - } - } ); + } + }); - // Layout slide backgrounds - toArray( dom.background.childNodes ).forEach( function( hbackground, h ) { - transformElement( hbackground, 'translate3d(' + ( h * overviewSlideWidth ) + 'px, 0, 0)' ); + // Layout slide backgrounds + toArray(dom.background.childNodes).forEach(function (hbackground, h) { + transformElement(hbackground, 'translate3d(' + (h * overviewSlideWidth) + 'px, 0, 0)'); - toArray( hbackground.querySelectorAll( '.slide-background' ) ).forEach( function( vbackground, v ) { - transformElement( vbackground, 'translate3d(0, ' + ( v * overviewSlideHeight ) + 'px, 0)' ); - } ); - } ); + toArray(hbackground.querySelectorAll('.slide-background')).forEach(function (vbackground, v) { + transformElement(vbackground, 'translate3d(0, ' + (v * overviewSlideHeight) + 'px, 0)'); + }); + }); - } + } - /** - * Moves the overview viewport to the current slides. - * Called each time the current slide changes. - */ - function updateOverview() { + /** + * Moves the overview viewport to the current slides. + * Called each time the current slide changes. + */ + function updateOverview() { - var vmin = Math.min( window.innerWidth, window.innerHeight ); - var scale = Math.max( vmin / 5, 150 ) / vmin; + var vmin = Math.min(window.innerWidth, window.innerHeight); + var scale = Math.max(vmin / 5, 150) / vmin; - transformSlides( { - overview: [ - 'scale('+ scale +')', - 'translateX('+ ( -indexh * overviewSlideWidth ) +'px)', - 'translateY('+ ( -indexv * overviewSlideHeight ) +'px)' - ].join( ' ' ) - } ); - - } - - /** - * Exits the slide overview and enters the currently - * active slide. - */ - function deactivateOverview() { - - // Only proceed if enabled in config - if( config.overview ) { - - overview = false; - - dom.wrapper.classList.remove( 'overview' ); - dom.wrapper.classList.remove( 'overview-animated' ); - - // Temporarily add a class so that transitions can do different things - // depending on whether they are exiting/entering overview, or just - // moving from slide to slide - dom.wrapper.classList.add( 'overview-deactivating' ); - - setTimeout( function () { - dom.wrapper.classList.remove( 'overview-deactivating' ); - }, 1 ); - - // Move the background element back out - dom.wrapper.appendChild( dom.background ); + transformSlides({ + overview: [ + 'scale(' + scale + ')', + 'translateX(' + (-indexh * overviewSlideWidth) + 'px)', + 'translateY(' + (-indexv * overviewSlideHeight) + 'px)' + ].join(' ') + }); + + } + + /** + * Exits the slide overview and enters the currently + * active slide. + */ + function deactivateOverview() { + + // Only proceed if enabled in config + if (config.overview) { + + overview = false; + + dom.wrapper.classList.remove('overview'); + dom.wrapper.classList.remove('overview-animated'); + + // Temporarily add a class so that transitions can do different things + // depending on whether they are exiting/entering overview, or just + // moving from slide to slide + dom.wrapper.classList.add('overview-deactivating'); - // Clean up changes made to slides - toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) { - transformElement( slide, '' ); + setTimeout(function () { + dom.wrapper.classList.remove('overview-deactivating'); + }, 1); - slide.removeEventListener( 'click', onOverviewSlideClicked, true ); - } ); + // Move the background element back out + dom.wrapper.appendChild(dom.background); - // Clean up changes made to backgrounds - toArray( dom.background.querySelectorAll( '.slide-background' ) ).forEach( function( background ) { - transformElement( background, '' ); - } ); + // Clean up changes made to slides + toArray(dom.wrapper.querySelectorAll(SLIDES_SELECTOR)).forEach(function (slide) { + transformElement(slide, ''); - transformSlides( { overview: '' } ); + slide.removeEventListener('click', onOverviewSlideClicked, true); + }); - slide( indexh, indexv ); + // Clean up changes made to backgrounds + toArray(dom.background.querySelectorAll('.slide-background')).forEach(function (background) { + transformElement(background, ''); + }); - layout(); + transformSlides({overview: ''}); - cueAutoSlide(); + slide(indexh, indexv); - // Notify observers of the overview hiding - dispatchEvent( 'overviewhidden', { - 'indexh': indexh, - 'indexv': indexv, - 'currentSlide': currentSlide - } ); + layout(); - } - } + cueAutoSlide(); - /** - * Toggles the slide overview mode on and off. - * - * @param {Boolean} [override] Flag which overrides the - * toggle logic and forcibly sets the desired state. True means - * overview is open, false means it's closed. - */ - function toggleOverview( override ) { + // Notify observers of the overview hiding + dispatchEvent('overviewhidden', { + 'indexh': indexh, + 'indexv': indexv, + 'currentSlide': currentSlide + }); - if( typeof override === 'boolean' ) { - override ? activateOverview() : deactivateOverview(); - } - else { - isOverview() ? deactivateOverview() : activateOverview(); - } - - } + } + } - /** - * Checks if the overview is currently active. - * - * @return {Boolean} true if the overview is active, - * false otherwise - */ - function isOverview() { - - return overview; + /** + * Toggles the slide overview mode on and off. + * + * @param {Boolean} [override] Flag which overrides the + * toggle logic and forcibly sets the desired state. True means + * overview is open, false means it's closed. + */ + function toggleOverview(override) { - } + if (typeof override === 'boolean') { + override ? activateOverview() : deactivateOverview(); + } else { + isOverview() ? deactivateOverview() : activateOverview(); + } - /** - * Checks if the current or specified slide is vertical - * (nested within another slide). - * - * @param {HTMLElement} [slide=currentSlide] The slide to check - * orientation of - * @return {Boolean} - */ - function isVerticalSlide( slide ) { + } - // Prefer slide argument, otherwise use current slide - slide = slide ? slide : currentSlide; + /** + * Checks if the overview is currently active. + * + * @return {Boolean} true if the overview is active, + * false otherwise + */ + function isOverview() { - return slide && slide.parentNode && !!slide.parentNode.nodeName.match( /section/i ); + return overview; - } + } - /** - * Handling the fullscreen functionality via the fullscreen API - * - * @see http://fullscreen.spec.whatwg.org/ - * @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode - */ - function enterFullscreen() { + /** + * Checks if the current or specified slide is vertical + * (nested within another slide). + * + * @param {HTMLElement} [slide=currentSlide] The slide to check + * orientation of + * @return {Boolean} + */ + function isVerticalSlide(slide) { - var element = document.documentElement; + // Prefer slide argument, otherwise use current slide + slide = slide ? slide : currentSlide; - // Check which implementation is available - var requestMethod = element.requestFullscreen || - element.webkitRequestFullscreen || - element.webkitRequestFullScreen || - element.mozRequestFullScreen || - element.msRequestFullscreen; + return slide && slide.parentNode && !!slide.parentNode.nodeName.match(/section/i); - if( requestMethod ) { - requestMethod.apply( element ); - } - - } - - /** - * Enters the paused mode which fades everything on screen to - * black. - */ - function pause() { - - if( config.pause ) { - var wasPaused = dom.wrapper.classList.contains( 'paused' ); - - cancelAutoSlide(); - dom.wrapper.classList.add( 'paused' ); + } - if( wasPaused === false ) { - dispatchEvent( 'paused' ); - } - } - - } - - /** - * Exits from the paused mode. - */ - function resume() { - - var wasPaused = dom.wrapper.classList.contains( 'paused' ); - dom.wrapper.classList.remove( 'paused' ); - - cueAutoSlide(); - - if( wasPaused ) { - dispatchEvent( 'resumed' ); - } - - } - - /** - * Toggles the paused mode on and off. - */ - function togglePause( override ) { - - if( typeof override === 'boolean' ) { - override ? pause() : resume(); - } - else { - isPaused() ? resume() : pause(); - } - - } - - /** - * Checks if we are currently in the paused mode. - * - * @return {Boolean} - */ - function isPaused() { + /** + * Handling the fullscreen functionality via the fullscreen API + * + * @see http://fullscreen.spec.whatwg.org/ + * @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode + */ + function enterFullscreen() { - return dom.wrapper.classList.contains( 'paused' ); - - } - - /** - * Toggles the auto slide mode on and off. - * - * @param {Boolean} [override] Flag which sets the desired state. - * True means autoplay starts, false means it stops. - */ - - function toggleAutoSlide( override ) { + var element = document.documentElement; - if( typeof override === 'boolean' ) { - override ? resumeAutoSlide() : pauseAutoSlide(); - } - - else { - autoSlidePaused ? resumeAutoSlide() : pauseAutoSlide(); - } - - } - - /** - * Checks if the auto slide mode is currently on. - * - * @return {Boolean} - */ - function isAutoSliding() { - - return !!( autoSlide && !autoSlidePaused ); - - } - - /** - * Steps from the current point in the presentation to the - * slide which matches the specified horizontal and vertical - * indices. - * - * @param {number} [h=indexh] Horizontal index of the target slide - * @param {number} [v=indexv] Vertical index of the target slide - * @param {number} [f] Index of a fragment within the - * target slide to activate - * @param {number} [o] Origin for use in multimaster environments - */ - function slide( h, v, f, o ) { - - // Remember where we were at before - previousSlide = currentSlide; - - // Query all horizontal slides in the deck - var horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ); - - // Abort if there are no slides - if( horizontalSlides.length === 0 ) return; - - // If no vertical index is specified and the upcoming slide is a - // stack, resume at its previous vertical index - if( v === undefined && !isOverview() ) { - v = getPreviousVerticalIndex( horizontalSlides[ h ] ); - } - - // If we were on a vertical stack, remember what vertical index - // it was on so we can resume at the same position when returning - if( previousSlide && previousSlide.parentNode && previousSlide.parentNode.classList.contains( 'stack' ) ) { - setPreviousVerticalIndex( previousSlide.parentNode, indexv ); - } - - // Remember the state before this slide - var stateBefore = state.concat(); - - // Reset the state array - state.length = 0; - - var indexhBefore = indexh || 0, - indexvBefore = indexv || 0; - - // Activate and transition to the new slide - indexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, h === undefined ? indexh : h ); - indexv = updateSlides( VERTICAL_SLIDES_SELECTOR, v === undefined ? indexv : v ); - - // Update the visibility of slides now that the indices have changed - updateSlidesVisibility(); - - layout(); - - // Apply the new state - stateLoop: for( var i = 0, len = state.length; i < len; i++ ) { - // Check if this state existed on the previous slide. If it - // did, we will avoid adding it repeatedly - for( var j = 0; j < stateBefore.length; j++ ) { - if( stateBefore[j] === state[i] ) { - stateBefore.splice( j, 1 ); - continue stateLoop; - } - } - - document.documentElement.classList.add( state[i] ); - - // Dispatch custom event matching the state's name - dispatchEvent( state[i] ); - } - - // Clean up the remains of the previous state - while( stateBefore.length ) { - document.documentElement.classList.remove( stateBefore.pop() ); - } - - // Update the overview if it's currently active - if( isOverview() ) { - updateOverview(); - } - - // Find the current horizontal slide and any possible vertical slides - // within it - var currentHorizontalSlide = horizontalSlides[ indexh ], - currentVerticalSlides = currentHorizontalSlide.querySelectorAll( 'section' ); - - // Store references to the previous and current slides - currentSlide = currentVerticalSlides[ indexv ] || currentHorizontalSlide; - - // Show fragment, if specified - if( typeof f !== 'undefined' ) { - navigateFragment( f ); - } - - // Dispatch an event if the slide changed - var slideChanged = ( indexh !== indexhBefore || indexv !== indexvBefore ); - if( slideChanged ) { - dispatchEvent( 'slidechanged', { - 'indexh': indexh, - 'indexv': indexv, - 'previousSlide': previousSlide, - 'currentSlide': currentSlide, - 'origin': o - } ); - } - else { - // Ensure that the previous slide is never the same as the current - previousSlide = null; - } - - // Solves an edge case where the previous slide maintains the - // 'present' class when navigating between adjacent vertical - // stacks - if( previousSlide ) { - previousSlide.classList.remove( 'present' ); - previousSlide.setAttribute( 'aria-hidden', 'true' ); - - // Reset all slides upon navigate to home - // Issue: #285 - if ( dom.wrapper.querySelector( HOME_SLIDE_SELECTOR ).classList.contains( 'present' ) ) { - // Launch async task - setTimeout( function () { - var slides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR + '.stack') ), i; - for( i in slides ) { - if( slides[i] ) { - // Reset stack - setPreviousVerticalIndex( slides[i], 0 ); - } - } - }, 0 ); - } - } - - // Handle embedded content - if( slideChanged || !previousSlide ) { - stopEmbeddedContent( previousSlide ); - startEmbeddedContent( currentSlide ); - } - - // Announce the current slide contents, for screen readers - dom.statusDiv.textContent = getStatusText( currentSlide ); - - updateControls(); - updateProgress(); - updateBackground(); - updateParallax(); - updateSlideNumber(); - updateNotes(); - - // Update the URL hash - writeURL(); - - cueAutoSlide(); - - } - - /** - * Syncs the presentation with the current DOM. Useful - * when new slides or control elements are added or when - * the configuration has changed. - */ - function sync() { - - // Subscribe to input - removeEventListeners(); - addEventListeners(); - - // Force a layout to make sure the current config is accounted for - layout(); - - // Reflect the current autoSlide value - autoSlide = config.autoSlide; - - // Start auto-sliding if it's enabled - cueAutoSlide(); - - // Re-create the slide backgrounds - createBackgrounds(); - - // Write the current hash to the URL - writeURL(); - - sortAllFragments(); - - updateControls(); - updateProgress(); - updateSlideNumber(); - updateSlidesVisibility(); - updateBackground( true ); - updateNotesVisibility(); - updateNotes(); - - formatEmbeddedContent(); - - // Start or stop embedded content depending on global config - if( config.autoPlayMedia === false ) { - stopEmbeddedContent( currentSlide, { unloadIframes: false } ); - } - else { - startEmbeddedContent( currentSlide ); - } - - if( isOverview() ) { - layoutOverview(); - } - - } + // Check which implementation is available + var requestMethod = element.requestFullscreen || + element.webkitRequestFullscreen || + element.webkitRequestFullScreen || + element.mozRequestFullScreen || + element.msRequestFullscreen; - /** - * Resets all vertical slides so that only the first - * is visible. - */ - function resetVerticalSlides() { + if (requestMethod) { + requestMethod.apply(element); + } + + } + + /** + * Enters the paused mode which fades everything on screen to + * black. + */ + function pause() { + + if (config.pause) { + var wasPaused = dom.wrapper.classList.contains('paused'); + + cancelAutoSlide(); + dom.wrapper.classList.add('paused'); + + if (wasPaused === false) { + dispatchEvent('paused'); + } + } + + } + + /** + * Exits from the paused mode. + */ + function resume() { + + var wasPaused = dom.wrapper.classList.contains('paused'); + dom.wrapper.classList.remove('paused'); + + cueAutoSlide(); + + if (wasPaused) { + dispatchEvent('resumed'); + } + + } + + /** + * Toggles the paused mode on and off. + */ + function togglePause(override) { - var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); - horizontalSlides.forEach( function( horizontalSlide ) { + if (typeof override === 'boolean') { + override ? pause() : resume(); + } else { + isPaused() ? resume() : pause(); + } + + } + + /** + * Checks if we are currently in the paused mode. + * + * @return {Boolean} + */ + function isPaused() { + + return dom.wrapper.classList.contains('paused'); + + } + + /** + * Toggles the auto slide mode on and off. + * + * @param {Boolean} [override] Flag which sets the desired state. + * True means autoplay starts, false means it stops. + */ + + function toggleAutoSlide(override) { + + if (typeof override === 'boolean') { + override ? resumeAutoSlide() : pauseAutoSlide(); + } else { + autoSlidePaused ? resumeAutoSlide() : pauseAutoSlide(); + } + + } + + /** + * Checks if the auto slide mode is currently on. + * + * @return {Boolean} + */ + function isAutoSliding() { + + return !!(autoSlide && !autoSlidePaused); + + } + + /** + * Steps from the current point in the presentation to the + * slide which matches the specified horizontal and vertical + * indices. + * + * @param {number} [h=indexh] Horizontal index of the target slide + * @param {number} [v=indexv] Vertical index of the target slide + * @param {number} [f] Index of a fragment within the + * target slide to activate + * @param {number} [o] Origin for use in multimaster environments + */ + function slide(h, v, f, o) { + + // Remember where we were at before + previousSlide = currentSlide; + + // Query all horizontal slides in the deck + var horizontalSlides = dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR); + + // Abort if there are no slides + if (horizontalSlides.length === 0) return; + + // If no vertical index is specified and the upcoming slide is a + // stack, resume at its previous vertical index + if (v === undefined && !isOverview()) { + v = getPreviousVerticalIndex(horizontalSlides[h]); + } + + // If we were on a vertical stack, remember what vertical index + // it was on so we can resume at the same position when returning + if (previousSlide && previousSlide.parentNode && previousSlide.parentNode.classList.contains('stack')) { + setPreviousVerticalIndex(previousSlide.parentNode, indexv); + } + + // Remember the state before this slide + var stateBefore = state.concat(); + + // Reset the state array + state.length = 0; + + var indexhBefore = indexh || 0, + indexvBefore = indexv || 0; + + // Activate and transition to the new slide + indexh = updateSlides(HORIZONTAL_SLIDES_SELECTOR, h === undefined ? indexh : h); + indexv = updateSlides(VERTICAL_SLIDES_SELECTOR, v === undefined ? indexv : v); + + // Update the visibility of slides now that the indices have changed + updateSlidesVisibility(); + + layout(); + + // Apply the new state + stateLoop: for (var i = 0, len = state.length; i < len; i++) { + // Check if this state existed on the previous slide. If it + // did, we will avoid adding it repeatedly + for (var j = 0; j < stateBefore.length; j++) { + if (stateBefore[j] === state[i]) { + stateBefore.splice(j, 1); + continue stateLoop; + } + } + + document.documentElement.classList.add(state[i]); + + // Dispatch custom event matching the state's name + dispatchEvent(state[i]); + } + + // Clean up the remains of the previous state + while (stateBefore.length) { + document.documentElement.classList.remove(stateBefore.pop()); + } + + // Update the overview if it's currently active + if (isOverview()) { + updateOverview(); + } + + // Find the current horizontal slide and any possible vertical slides + // within it + var currentHorizontalSlide = horizontalSlides[indexh], + currentVerticalSlides = currentHorizontalSlide.querySelectorAll('section'); + + // Store references to the previous and current slides + currentSlide = currentVerticalSlides[indexv] || currentHorizontalSlide; + + // Show fragment, if specified + if (typeof f !== 'undefined') { + navigateFragment(f); + } + + // Dispatch an event if the slide changed + var slideChanged = (indexh !== indexhBefore || indexv !== indexvBefore); + if (slideChanged) { + dispatchEvent('slidechanged', { + 'indexh': indexh, + 'indexv': indexv, + 'previousSlide': previousSlide, + 'currentSlide': currentSlide, + 'origin': o + }); + } else { + // Ensure that the previous slide is never the same as the current + previousSlide = null; + } + + // Solves an edge case where the previous slide maintains the + // 'present' class when navigating between adjacent vertical + // stacks + if (previousSlide) { + previousSlide.classList.remove('present'); + previousSlide.setAttribute('aria-hidden', 'true'); + + // Reset all slides upon navigate to home + // Issue: #285 + if (dom.wrapper.querySelector(HOME_SLIDE_SELECTOR).classList.contains('present')) { + // Launch async task + setTimeout(function () { + var slides = toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR + '.stack')), i; + for (i in slides) { + if (slides[i]) { + // Reset stack + setPreviousVerticalIndex(slides[i], 0); + } + } + }, 0); + } + } + + // Handle embedded content + if (slideChanged || !previousSlide) { + stopEmbeddedContent(previousSlide); + startEmbeddedContent(currentSlide); + } + + // Announce the current slide contents, for screen readers + dom.statusDiv.textContent = getStatusText(currentSlide); + + updateControls(); + updateProgress(); + updateBackground(); + updateParallax(); + updateSlideNumber(); + updateNotes(); + + // Update the URL hash + writeURL(); + + cueAutoSlide(); + + } + + /** + * Syncs the presentation with the current DOM. Useful + * when new slides or control elements are added or when + * the configuration has changed. + */ + function sync() { + + // Subscribe to input + removeEventListeners(); + addEventListeners(); + + // Force a layout to make sure the current config is accounted for + layout(); + + // Reflect the current autoSlide value + autoSlide = config.autoSlide; + + // Start auto-sliding if it's enabled + cueAutoSlide(); + + // Re-create the slide backgrounds + createBackgrounds(); + + // Write the current hash to the URL + writeURL(); + + sortAllFragments(); + + updateControls(); + updateProgress(); + updateSlideNumber(); + updateSlidesVisibility(); + updateBackground(true); + updateNotesVisibility(); + updateNotes(); + + formatEmbeddedContent(); + + // Start or stop embedded content depending on global config + if (config.autoPlayMedia === false) { + stopEmbeddedContent(currentSlide, {unloadIframes: false}); + } else { + startEmbeddedContent(currentSlide); + } + + if (isOverview()) { + layoutOverview(); + } + + } - var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ); - verticalSlides.forEach( function( verticalSlide, y ) { + /** + * Resets all vertical slides so that only the first + * is visible. + */ + function resetVerticalSlides() { - if( y > 0 ) { - verticalSlide.classList.remove( 'present' ); - verticalSlide.classList.remove( 'past' ); - verticalSlide.classList.add( 'future' ); - verticalSlide.setAttribute( 'aria-hidden', 'true' ); - } + var horizontalSlides = toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR)); + horizontalSlides.forEach(function (horizontalSlide) { - } ); + var verticalSlides = toArray(horizontalSlide.querySelectorAll('section')); + verticalSlides.forEach(function (verticalSlide, y) { - } ); + if (y > 0) { + verticalSlide.classList.remove('present'); + verticalSlide.classList.remove('past'); + verticalSlide.classList.add('future'); + verticalSlide.setAttribute('aria-hidden', 'true'); + } - } + }); - /** - * Sorts and formats all of fragments in the - * presentation. - */ - function sortAllFragments() { + }); - var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); - horizontalSlides.forEach( function( horizontalSlide ) { + } - var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ); - verticalSlides.forEach( function( verticalSlide, y ) { + /** + * Sorts and formats all of fragments in the + * presentation. + */ + function sortAllFragments() { - sortFragments( verticalSlide.querySelectorAll( '.fragment' ) ); + var horizontalSlides = toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR)); + horizontalSlides.forEach(function (horizontalSlide) { - } ); + var verticalSlides = toArray(horizontalSlide.querySelectorAll('section')); + verticalSlides.forEach(function (verticalSlide, y) { - if( verticalSlides.length === 0 ) sortFragments( horizontalSlide.querySelectorAll( '.fragment' ) ); + sortFragments(verticalSlide.querySelectorAll('.fragment')); - } ); + }); - } + if (verticalSlides.length === 0) sortFragments(horizontalSlide.querySelectorAll('.fragment')); - /** - * Randomly shuffles all slides in the deck. - */ - function shuffle() { + }); - var slides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); + } - slides.forEach( function( slide ) { + /** + * Randomly shuffles all slides in the deck. + */ + function shuffle() { - // Insert this slide next to another random slide. This may - // cause the slide to insert before itself but that's fine. - dom.slides.insertBefore( slide, slides[ Math.floor( Math.random() * slides.length ) ] ); + var slides = toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR)); - } ); + slides.forEach(function (slide) { - } + // Insert this slide next to another random slide. This may + // cause the slide to insert before itself but that's fine. + dom.slides.insertBefore(slide, slides[Math.floor(Math.random() * slides.length)]); - /** - * Updates one dimension of slides by showing the slide - * with the specified index. - * - * @param {string} selector A CSS selector that will fetch - * the group of slides we are working with - * @param {number} index The index of the slide that should be - * shown - * - * @return {number} The index of the slide that is now shown, - * might differ from the passed in index if it was out of - * bounds. - */ - function updateSlides( selector, index ) { - - // Select all slides and convert the NodeList result to - // an array - var slides = toArray( dom.wrapper.querySelectorAll( selector ) ), - slidesLength = slides.length; - - var printMode = isPrintingPDF(); - - if( slidesLength ) { - - // Should the index loop? - if( config.loop ) { - index %= slidesLength; - - if( index < 0 ) { - index = slidesLength + index; - } - } - - // Enforce max and minimum index bounds - index = Math.max( Math.min( index, slidesLength - 1 ), 0 ); - - for( var i = 0; i < slidesLength; i++ ) { - var element = slides[i]; - - var reverse = config.rtl && !isVerticalSlide( element ); - - element.classList.remove( 'past' ); - element.classList.remove( 'present' ); - element.classList.remove( 'future' ); - - // http://www.w3.org/html/wg/drafts/html/master/editing.html#the-hidden-attribute - element.setAttribute( 'hidden', '' ); - element.setAttribute( 'aria-hidden', 'true' ); - - // If this element contains vertical slides - if( element.querySelector( 'section' ) ) { - element.classList.add( 'stack' ); - } + }); - // If we're printing static slides, all slides are "present" - if( printMode ) { - element.classList.add( 'present' ); - continue; - } - - if( i < index ) { - // Any element previous to index is given the 'past' class - element.classList.add( reverse ? 'future' : 'past' ); - - if( config.fragments ) { - var pastFragments = toArray( element.querySelectorAll( '.fragment' ) ); - - // Show all fragments on prior slides - while( pastFragments.length ) { - var pastFragment = pastFragments.pop(); - pastFragment.classList.add( 'visible' ); - pastFragment.classList.remove( 'current-fragment' ); - } - } - } - else if( i > index ) { - // Any element subsequent to index is given the 'future' class - element.classList.add( reverse ? 'past' : 'future' ); - - if( config.fragments ) { - var futureFragments = toArray( element.querySelectorAll( '.fragment.visible' ) ); - - // No fragments in future slides should be visible ahead of time - while( futureFragments.length ) { - var futureFragment = futureFragments.pop(); - futureFragment.classList.remove( 'visible' ); - futureFragment.classList.remove( 'current-fragment' ); - } - } - } - } - - // Mark the current slide as present - slides[index].classList.add( 'present' ); - slides[index].removeAttribute( 'hidden' ); - slides[index].removeAttribute( 'aria-hidden' ); - - // If this slide has a state associated with it, add it - // onto the current state of the deck - var slideState = slides[index].getAttribute( 'data-state' ); - if( slideState ) { - state = state.concat( slideState.split( ' ' ) ); - } - - } - else { - // Since there are no slides we can't be anywhere beyond the - // zeroth index - index = 0; - } - - return index; - - } - - /** - * Optimization method; hide all slides that are far away - * from the present slide. - */ - function updateSlidesVisibility() { - - // Select all slides and convert the NodeList result to - // an array - var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ), - horizontalSlidesLength = horizontalSlides.length, - distanceX, - distanceY; - - if( horizontalSlidesLength && typeof indexh !== 'undefined' ) { - - // The number of steps away from the present slide that will - // be visible - var viewDistance = isOverview() ? 10 : config.viewDistance; - - // Limit view distance on weaker devices - if( isMobileDevice ) { - viewDistance = isOverview() ? 6 : 2; - } - - // All slides need to be visible when exporting to PDF - if( isPrintingPDF() ) { - viewDistance = Number.MAX_VALUE; - } - - for( var x = 0; x < horizontalSlidesLength; x++ ) { - var horizontalSlide = horizontalSlides[x]; - - var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ), - verticalSlidesLength = verticalSlides.length; - - // Determine how far away this slide is from the present - distanceX = Math.abs( ( indexh || 0 ) - x ) || 0; - - // If the presentation is looped, distance should measure - // 1 between the first and last slides - if( config.loop ) { - distanceX = Math.abs( ( ( indexh || 0 ) - x ) % ( horizontalSlidesLength - viewDistance ) ) || 0; - } - - // Show the horizontal slide if it's within the view distance - if( distanceX < viewDistance ) { - loadSlide( horizontalSlide ); - } - else { - unloadSlide( horizontalSlide ); - } - - if( verticalSlidesLength ) { - - var oy = getPreviousVerticalIndex( horizontalSlide ); - - for( var y = 0; y < verticalSlidesLength; y++ ) { - var verticalSlide = verticalSlides[y]; - - distanceY = x === ( indexh || 0 ) ? Math.abs( ( indexv || 0 ) - y ) : Math.abs( y - oy ); - - if( distanceX + distanceY < viewDistance ) { - loadSlide( verticalSlide ); - } - else { - unloadSlide( verticalSlide ); - } - } - - } - } - - // Flag if there are ANY vertical slides, anywhere in the deck - if( dom.wrapper.querySelectorAll( '.slides>section>section' ).length ) { - dom.wrapper.classList.add( 'has-vertical-slides' ); - } - else { - dom.wrapper.classList.remove( 'has-vertical-slides' ); - } - - // Flag if there are ANY horizontal slides, anywhere in the deck - if( dom.wrapper.querySelectorAll( '.slides>section' ).length > 1 ) { - dom.wrapper.classList.add( 'has-horizontal-slides' ); - } - else { - dom.wrapper.classList.remove( 'has-horizontal-slides' ); - } - - } - - } - - /** - * Pick up notes from the current slide and display them - * to the viewer. - * - * @see {@link config.showNotes} - */ - function updateNotes() { - - if( config.showNotes && dom.speakerNotes && currentSlide && !isPrintingPDF() ) { - - dom.speakerNotes.innerHTML = getSlideNotes() || 'No notes on this slide.'; - - } - - } - - /** - * Updates the visibility of the speaker notes sidebar that - * is used to share annotated slides. The notes sidebar is - * only visible if showNotes is true and there are notes on - * one or more slides in the deck. - */ - function updateNotesVisibility() { - - if( config.showNotes && hasNotes() ) { - dom.wrapper.classList.add( 'show-notes' ); - } - else { - dom.wrapper.classList.remove( 'show-notes' ); - } - - } - - /** - * Checks if there are speaker notes for ANY slide in the - * presentation. - */ - function hasNotes() { - - return dom.slides.querySelectorAll( '[data-notes], aside.notes' ).length > 0; - - } - - /** - * Updates the progress bar to reflect the current slide. - */ - function updateProgress() { - - // Update progress if enabled - if( config.progress && dom.progressbar ) { - - dom.progressbar.style.width = getProgress() * dom.wrapper.offsetWidth + 'px'; - - } - - } - - /** - * Updates the slide number div to reflect the current slide. - * - * The following slide number formats are available: - * "h.v": horizontal . vertical slide number (default) - * "h/v": horizontal / vertical slide number - * "c": flattened slide number - * "c/t": flattened slide number / total slides - */ - function updateSlideNumber() { - - // Update slide number if enabled - if( config.slideNumber && dom.slideNumber ) { - - var value = []; - var format = 'h.v'; - - // Check if a custom number format is available - if( typeof config.slideNumber === 'string' ) { - format = config.slideNumber; - } - - switch( format ) { - case 'c': - value.push( getSlidePastCount() + 1 ); - break; - case 'c/t': - value.push( getSlidePastCount() + 1, '/', getTotalSlides() ); - break; - case 'h/v': - value.push( indexh + 1 ); - if( isVerticalSlide() ) value.push( '/', indexv + 1 ); - break; - default: - value.push( indexh + 1 ); - if( isVerticalSlide() ) value.push( '.', indexv + 1 ); - } - - dom.slideNumber.innerHTML = formatSlideNumber( value[0], value[1], value[2] ); - } - - } - - /** - * Applies HTML formatting to a slide number before it's - * written to the DOM. - * - * @param {number} a Current slide - * @param {string} delimiter Character to separate slide numbers - * @param {(number|*)} b Total slides - * @return {string} HTML string fragment - */ - function formatSlideNumber( a, delimiter, b ) { - - if( typeof b === 'number' && !isNaN( b ) ) { - return ''+ a +'' + - ''+ delimiter +'' + - ''+ b +''; - } - else { - return ''+ a +''; - } - - } - - /** - * Updates the state of all control/navigation arrows. - */ - function updateControls() { - - var routes = availableRoutes(); - var fragments = availableFragments(); - - // Remove the 'enabled' class from all directions - dom.controlsLeft.concat( dom.controlsRight ) - .concat( dom.controlsUp ) - .concat( dom.controlsDown ) - .concat( dom.controlsPrev ) - .concat( dom.controlsNext ).forEach( function( node ) { - node.classList.remove( 'enabled' ); - node.classList.remove( 'fragmented' ); - - // Set 'disabled' attribute on all directions - node.setAttribute( 'disabled', 'disabled' ); - } ); - - // Add the 'enabled' class to the available routes; remove 'disabled' attribute to enable buttons - if( routes.left ) dom.controlsLeft.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); - if( routes.right ) dom.controlsRight.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); - if( routes.up ) dom.controlsUp.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); - if( routes.down ) dom.controlsDown.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); - - // Prev/next buttons - if( routes.left || routes.up ) dom.controlsPrev.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); - if( routes.right || routes.down ) dom.controlsNext.forEach( function( el ) { el.classList.add( 'enabled' ); el.removeAttribute( 'disabled' ); } ); - - // Highlight fragment directions - if( currentSlide ) { - - // Always apply fragment decorator to prev/next buttons - if( fragments.prev ) dom.controlsPrev.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); - if( fragments.next ) dom.controlsNext.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); - - // Apply fragment decorators to directional buttons based on - // what slide axis they are in - if( isVerticalSlide( currentSlide ) ) { - if( fragments.prev ) dom.controlsUp.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); - if( fragments.next ) dom.controlsDown.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); - } - else { - if( fragments.prev ) dom.controlsLeft.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); - if( fragments.next ) dom.controlsRight.forEach( function( el ) { el.classList.add( 'fragmented', 'enabled' ); el.removeAttribute( 'disabled' ); } ); - } - - } - - if( config.controlsTutorial ) { - - // Highlight control arrows with an animation to ensure - // that the viewer knows how to navigate - if( !hasNavigatedDown && routes.down ) { - dom.controlsDownArrow.classList.add( 'highlight' ); - } - else { - dom.controlsDownArrow.classList.remove( 'highlight' ); - - if( !hasNavigatedRight && routes.right && indexv === 0 ) { - dom.controlsRightArrow.classList.add( 'highlight' ); - } - else { - dom.controlsRightArrow.classList.remove( 'highlight' ); - } - } - - } - - } - - /** - * Updates the background elements to reflect the current - * slide. - * - * @param {boolean} includeAll If true, the backgrounds of - * all vertical slides (not just the present) will be updated. - */ - function updateBackground( includeAll ) { - - var currentBackground = null; - - // Reverse past/future classes when in RTL mode - var horizontalPast = config.rtl ? 'future' : 'past', - horizontalFuture = config.rtl ? 'past' : 'future'; - - // Update the classes of all backgrounds to match the - // states of their slides (past/present/future) - toArray( dom.background.childNodes ).forEach( function( backgroundh, h ) { - - backgroundh.classList.remove( 'past' ); - backgroundh.classList.remove( 'present' ); - backgroundh.classList.remove( 'future' ); - - if( h < indexh ) { - backgroundh.classList.add( horizontalPast ); - } - else if ( h > indexh ) { - backgroundh.classList.add( horizontalFuture ); - } - else { - backgroundh.classList.add( 'present' ); - - // Store a reference to the current background element - currentBackground = backgroundh; - } - - if( includeAll || h === indexh ) { - toArray( backgroundh.querySelectorAll( '.slide-background' ) ).forEach( function( backgroundv, v ) { - - backgroundv.classList.remove( 'past' ); - backgroundv.classList.remove( 'present' ); - backgroundv.classList.remove( 'future' ); - - if( v < indexv ) { - backgroundv.classList.add( 'past' ); - } - else if ( v > indexv ) { - backgroundv.classList.add( 'future' ); - } - else { - backgroundv.classList.add( 'present' ); - - // Only if this is the present horizontal and vertical slide - if( h === indexh ) currentBackground = backgroundv; - } - - } ); - } - - } ); - - // Stop content inside of previous backgrounds - if( previousBackground ) { - - stopEmbeddedContent( previousBackground ); - - } - - // Start content in the current background - if( currentBackground ) { - - startEmbeddedContent( currentBackground ); - - var backgroundImageURL = currentBackground.style.backgroundImage || ''; - - // Restart GIFs (doesn't work in Firefox) - if( /\.gif/i.test( backgroundImageURL ) ) { - currentBackground.style.backgroundImage = ''; - window.getComputedStyle( currentBackground ).opacity; - currentBackground.style.backgroundImage = backgroundImageURL; - } - - // Don't transition between identical backgrounds. This - // prevents unwanted flicker. - var previousBackgroundHash = previousBackground ? previousBackground.getAttribute( 'data-background-hash' ) : null; - var currentBackgroundHash = currentBackground.getAttribute( 'data-background-hash' ); - if( currentBackgroundHash && currentBackgroundHash === previousBackgroundHash && currentBackground !== previousBackground ) { - dom.background.classList.add( 'no-transition' ); - } - - previousBackground = currentBackground; - - } - - // If there's a background brightness flag for this slide, - // bubble it to the .reveal container - if( currentSlide ) { - [ 'has-light-background', 'has-dark-background' ].forEach( function( classToBubble ) { - if( currentSlide.classList.contains( classToBubble ) ) { - dom.wrapper.classList.add( classToBubble ); - } - else { - dom.wrapper.classList.remove( classToBubble ); - } - } ); - } - - // Allow the first background to apply without transition - setTimeout( function() { - dom.background.classList.remove( 'no-transition' ); - }, 1 ); - - } - - /** - * Updates the position of the parallax background based - * on the current slide index. - */ - function updateParallax() { - - if( config.parallaxBackgroundImage ) { - - var horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ), - verticalSlides = dom.wrapper.querySelectorAll( VERTICAL_SLIDES_SELECTOR ); - - var backgroundSize = dom.background.style.backgroundSize.split( ' ' ), - backgroundWidth, backgroundHeight; - - if( backgroundSize.length === 1 ) { - backgroundWidth = backgroundHeight = parseInt( backgroundSize[0], 10 ); - } - else { - backgroundWidth = parseInt( backgroundSize[0], 10 ); - backgroundHeight = parseInt( backgroundSize[1], 10 ); - } - - var slideWidth = dom.background.offsetWidth, - horizontalSlideCount = horizontalSlides.length, - horizontalOffsetMultiplier, - horizontalOffset; - - if( typeof config.parallaxBackgroundHorizontal === 'number' ) { - horizontalOffsetMultiplier = config.parallaxBackgroundHorizontal; - } - else { - horizontalOffsetMultiplier = horizontalSlideCount > 1 ? ( backgroundWidth - slideWidth ) / ( horizontalSlideCount-1 ) : 0; - } - - horizontalOffset = horizontalOffsetMultiplier * indexh * -1; - - var slideHeight = dom.background.offsetHeight, - verticalSlideCount = verticalSlides.length, - verticalOffsetMultiplier, - verticalOffset; - - if( typeof config.parallaxBackgroundVertical === 'number' ) { - verticalOffsetMultiplier = config.parallaxBackgroundVertical; - } - else { - verticalOffsetMultiplier = ( backgroundHeight - slideHeight ) / ( verticalSlideCount-1 ); - } - - verticalOffset = verticalSlideCount > 0 ? verticalOffsetMultiplier * indexv : 0; - - dom.background.style.backgroundPosition = horizontalOffset + 'px ' + -verticalOffset + 'px'; - - } - - } - - /** - * Called when the given slide is within the configured view - * distance. Shows the slide element and loads any content - * that is set to load lazily (data-src). - * - * @param {HTMLElement} slide Slide to show - */ - function loadSlide( slide, options ) { - - options = options || {}; - - // Show the slide element - slide.style.display = config.display; - - // Media elements with data-src attributes - toArray( slide.querySelectorAll( 'img[data-src], video[data-src], audio[data-src]' ) ).forEach( function( element ) { - element.setAttribute( 'src', element.getAttribute( 'data-src' ) ); - element.setAttribute( 'data-lazy-loaded', '' ); - element.removeAttribute( 'data-src' ); - } ); - - // Media elements with children - toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( media ) { - var sources = 0; - - toArray( media.querySelectorAll( 'source[data-src]' ) ).forEach( function( source ) { - source.setAttribute( 'src', source.getAttribute( 'data-src' ) ); - source.removeAttribute( 'data-src' ); - source.setAttribute( 'data-lazy-loaded', '' ); - sources += 1; - } ); - - // If we rewrote sources for this video/audio element, we need - // to manually tell it to load from its new origin - if( sources > 0 ) { - media.load(); - } - } ); - - - // Show the corresponding background element - var indices = getIndices( slide ); - var background = getSlideBackground( indices.h, indices.v ); - if( background ) { - background.style.display = 'block'; - - // If the background contains media, load it - if( background.hasAttribute( 'data-loaded' ) === false ) { - background.setAttribute( 'data-loaded', 'true' ); - - var backgroundImage = slide.getAttribute( 'data-background-image' ), - backgroundVideo = slide.getAttribute( 'data-background-video' ), - backgroundVideoLoop = slide.hasAttribute( 'data-background-video-loop' ), - backgroundVideoMuted = slide.hasAttribute( 'data-background-video-muted' ), - backgroundIframe = slide.getAttribute( 'data-background-iframe' ); - - // Images - if( backgroundImage ) { - background.style.backgroundImage = 'url('+ backgroundImage +')'; - } - // Videos - else if ( backgroundVideo && !isSpeakerNotes() ) { - var video = document.createElement( 'video' ); - - if( backgroundVideoLoop ) { - video.setAttribute( 'loop', '' ); - } - - if( backgroundVideoMuted ) { - video.muted = true; - } - - // Inline video playback works (at least in Mobile Safari) as - // long as the video is muted and the `playsinline` attribute is - // present - if( isMobileDevice ) { - video.muted = true; - video.autoplay = true; - video.setAttribute( 'playsinline', '' ); - } - - // Support comma separated lists of video sources - backgroundVideo.split( ',' ).forEach( function( source ) { - video.innerHTML += ''; - } ); - - background.appendChild( video ); - } - // Iframes - else if( backgroundIframe && options.excludeIframes !== true ) { - var iframe = document.createElement( 'iframe' ); - iframe.setAttribute( 'allowfullscreen', '' ); - iframe.setAttribute( 'mozallowfullscreen', '' ); - iframe.setAttribute( 'webkitallowfullscreen', '' ); - - // Only load autoplaying content when the slide is shown to - // avoid having it play in the background - if( /autoplay=(1|true|yes)/gi.test( backgroundIframe ) ) { - iframe.setAttribute( 'data-src', backgroundIframe ); - } - else { - iframe.setAttribute( 'src', backgroundIframe ); - } - - iframe.style.width = '100%'; - iframe.style.height = '100%'; - iframe.style.maxHeight = '100%'; - iframe.style.maxWidth = '100%'; - - background.appendChild( iframe ); - } - } - - } - - } - - /** - * Unloads and hides the given slide. This is called when the - * slide is moved outside of the configured view distance. - * - * @param {HTMLElement} slide - */ - function unloadSlide( slide ) { - - // Hide the slide element - slide.style.display = 'none'; - - // Hide the corresponding background element - var indices = getIndices( slide ); - var background = getSlideBackground( indices.h, indices.v ); - if( background ) { - background.style.display = 'none'; - } - - // Reset lazy-loaded media elements with src attributes - toArray( slide.querySelectorAll( 'video[data-lazy-loaded][src], audio[data-lazy-loaded][src]' ) ).forEach( function( element ) { - element.setAttribute( 'data-src', element.getAttribute( 'src' ) ); - element.removeAttribute( 'src' ); - } ); - - // Reset lazy-loaded media elements with children - toArray( slide.querySelectorAll( 'video[data-lazy-loaded] source[src], audio source[src]' ) ).forEach( function( source ) { - source.setAttribute( 'data-src', source.getAttribute( 'src' ) ); - source.removeAttribute( 'src' ); - } ); - - } - - /** - * Determine what available routes there are for navigation. - * - * @return {{left: boolean, right: boolean, up: boolean, down: boolean}} - */ - function availableRoutes() { - - var horizontalSlides = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ), - verticalSlides = dom.wrapper.querySelectorAll( VERTICAL_SLIDES_SELECTOR ); - - var routes = { - left: indexh > 0 || config.loop, - right: indexh < horizontalSlides.length - 1 || config.loop, - up: indexv > 0, - down: indexv < verticalSlides.length - 1 - }; - - // reverse horizontal controls for rtl - if( config.rtl ) { - var left = routes.left; - routes.left = routes.right; - routes.right = left; - } - - return routes; - - } - - /** - * Returns an object describing the available fragment - * directions. - * - * @return {{prev: boolean, next: boolean}} - */ - function availableFragments() { - - if( currentSlide && config.fragments ) { - var fragments = currentSlide.querySelectorAll( '.fragment' ); - var hiddenFragments = currentSlide.querySelectorAll( '.fragment:not(.visible)' ); - - return { - prev: fragments.length - hiddenFragments.length > 0, - next: !!hiddenFragments.length - }; - } - else { - return { prev: false, next: false }; - } - - } - - /** - * Enforces origin-specific format rules for embedded media. - */ - function formatEmbeddedContent() { - - var _appendParamToIframeSource = function( sourceAttribute, sourceURL, param ) { - toArray( dom.slides.querySelectorAll( 'iframe['+ sourceAttribute +'*="'+ sourceURL +'"]' ) ).forEach( function( el ) { - var src = el.getAttribute( sourceAttribute ); - if( src && src.indexOf( param ) === -1 ) { - el.setAttribute( sourceAttribute, src + ( !/\?/.test( src ) ? '?' : '&' ) + param ); - } - }); - }; - - // YouTube frames must include "?enablejsapi=1" - _appendParamToIframeSource( 'src', 'youtube.com/embed/', 'enablejsapi=1' ); - _appendParamToIframeSource( 'data-src', 'youtube.com/embed/', 'enablejsapi=1' ); - - // Vimeo frames must include "?api=1" - _appendParamToIframeSource( 'src', 'player.vimeo.com/', 'api=1' ); - _appendParamToIframeSource( 'data-src', 'player.vimeo.com/', 'api=1' ); - - // Always show media controls on mobile devices - if( isMobileDevice ) { - toArray( dom.slides.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { - el.controls = true; - } ); - } - - } - - /** - * Start playback of any embedded content inside of - * the given element. - * - * @param {HTMLElement} element - */ - function startEmbeddedContent( element ) { - - if( element && !isSpeakerNotes() ) { - - // Restart GIFs - toArray( element.querySelectorAll( 'img[src$=".gif"]' ) ).forEach( function( el ) { - // Setting the same unchanged source like this was confirmed - // to work in Chrome, FF & Safari - el.setAttribute( 'src', el.getAttribute( 'src' ) ); - } ); - - // HTML5 media elements - toArray( element.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { - if( closestParent( el, '.fragment' ) && !closestParent( el, '.fragment.visible' ) ) { - return; - } - - // Prefer an explicit global autoplay setting - var autoplay = config.autoPlayMedia; - - // If no global setting is available, fall back on the element's - // own autoplay setting - if( typeof autoplay !== 'boolean' ) { - autoplay = el.hasAttribute( 'data-autoplay' ) || !!closestParent( el, '.slide-background' ); - } - - if( autoplay && typeof el.play === 'function' ) { - - if( el.readyState > 1 ) { - startEmbeddedMedia( { target: el } ); - } - else { - el.removeEventListener( 'loadeddata', startEmbeddedMedia ); // remove first to avoid dupes - el.addEventListener( 'loadeddata', startEmbeddedMedia ); - } - - } - } ); - - // Normal iframes - toArray( element.querySelectorAll( 'iframe[src]' ) ).forEach( function( el ) { - if( closestParent( el, '.fragment' ) && !closestParent( el, '.fragment.visible' ) ) { - return; - } - - startEmbeddedIframe( { target: el } ); - } ); - - // Lazy loading iframes - toArray( element.querySelectorAll( 'iframe[data-src]' ) ).forEach( function( el ) { - if( closestParent( el, '.fragment' ) && !closestParent( el, '.fragment.visible' ) ) { - return; - } - - if( el.getAttribute( 'src' ) !== el.getAttribute( 'data-src' ) ) { - el.removeEventListener( 'load', startEmbeddedIframe ); // remove first to avoid dupes - el.addEventListener( 'load', startEmbeddedIframe ); - el.setAttribute( 'src', el.getAttribute( 'data-src' ) ); - } - } ); - - } - - } - - /** - * Starts playing an embedded video/audio element after - * it has finished loading. - * - * @param {object} event - */ - function startEmbeddedMedia( event ) { - - var isAttachedToDOM = !!closestParent( event.target, 'html' ), - isVisible = !!closestParent( event.target, '.present' ); - - if( isAttachedToDOM && isVisible ) { - event.target.currentTime = 0; - event.target.play(); - } - - event.target.removeEventListener( 'loadeddata', startEmbeddedMedia ); - - } - - /** - * "Starts" the content of an embedded iframe using the - * postMessage API. - * - * @param {object} event - */ - function startEmbeddedIframe( event ) { - - var iframe = event.target; - - if( iframe && iframe.contentWindow ) { - - var isAttachedToDOM = !!closestParent( event.target, 'html' ), - isVisible = !!closestParent( event.target, '.present' ); - - if( isAttachedToDOM && isVisible ) { - - // Prefer an explicit global autoplay setting - var autoplay = config.autoPlayMedia; - - // If no global setting is available, fall back on the element's - // own autoplay setting - if( typeof autoplay !== 'boolean' ) { - autoplay = iframe.hasAttribute( 'data-autoplay' ) || !!closestParent( iframe, '.slide-background' ); - } - - // YouTube postMessage API - if( /youtube\.com\/embed\//.test( iframe.getAttribute( 'src' ) ) && autoplay ) { - iframe.contentWindow.postMessage( '{"event":"command","func":"playVideo","args":""}', '*' ); - } - // Vimeo postMessage API - else if( /player\.vimeo\.com\//.test( iframe.getAttribute( 'src' ) ) && autoplay ) { - iframe.contentWindow.postMessage( '{"method":"play"}', '*' ); - } - // Generic postMessage API - else { - iframe.contentWindow.postMessage( 'slide:start', '*' ); - } - - } - - } - - } - - /** - * Stop playback of any embedded content inside of - * the targeted slide. - * - * @param {HTMLElement} element - */ - function stopEmbeddedContent( element, options ) { - - options = extend( { - // Defaults - unloadIframes: true - }, options || {} ); - - if( element && element.parentNode ) { - // HTML5 media elements - toArray( element.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { - if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) { - el.setAttribute('data-paused-by-reveal', ''); - el.pause(); - } - } ); - - // Generic postMessage API for non-lazy loaded iframes - toArray( element.querySelectorAll( 'iframe' ) ).forEach( function( el ) { - if( el.contentWindow ) el.contentWindow.postMessage( 'slide:stop', '*' ); - el.removeEventListener( 'load', startEmbeddedIframe ); - }); - - // YouTube postMessage API - toArray( element.querySelectorAll( 'iframe[src*="youtube.com/embed/"]' ) ).forEach( function( el ) { - if( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) { - el.contentWindow.postMessage( '{"event":"command","func":"pauseVideo","args":""}', '*' ); - } - }); - - // Vimeo postMessage API - toArray( element.querySelectorAll( 'iframe[src*="player.vimeo.com/"]' ) ).forEach( function( el ) { - if( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) { - el.contentWindow.postMessage( '{"method":"pause"}', '*' ); - } - }); - - if( options.unloadIframes === true ) { - // Unload lazy-loaded iframes - toArray( element.querySelectorAll( 'iframe[data-src]' ) ).forEach( function( el ) { - // Only removing the src doesn't actually unload the frame - // in all browsers (Firefox) so we set it to blank first - el.setAttribute( 'src', 'about:blank' ); - el.removeAttribute( 'src' ); - } ); - } - } - - } - - /** - * Returns the number of past slides. This can be used as a global - * flattened index for slides. - * - * @return {number} Past slide count - */ - function getSlidePastCount() { - - var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); - - // The number of past slides - var pastCount = 0; - - // Step through all slides and count the past ones - mainLoop: for( var i = 0; i < horizontalSlides.length; i++ ) { - - var horizontalSlide = horizontalSlides[i]; - var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) ); - - for( var j = 0; j < verticalSlides.length; j++ ) { - - // Stop as soon as we arrive at the present - if( verticalSlides[j].classList.contains( 'present' ) ) { - break mainLoop; - } - - pastCount++; - - } - - // Stop as soon as we arrive at the present - if( horizontalSlide.classList.contains( 'present' ) ) { - break; - } - - // Don't count the wrapping section for vertical slides - if( horizontalSlide.classList.contains( 'stack' ) === false ) { - pastCount++; - } - - } - - return pastCount; - - } - - /** - * Returns a value ranging from 0-1 that represents - * how far into the presentation we have navigated. - * - * @return {number} - */ - function getProgress() { - - // The number of past and total slides - var totalCount = getTotalSlides(); - var pastCount = getSlidePastCount(); - - if( currentSlide ) { - - var allFragments = currentSlide.querySelectorAll( '.fragment' ); - - // If there are fragments in the current slide those should be - // accounted for in the progress. - if( allFragments.length > 0 ) { - var visibleFragments = currentSlide.querySelectorAll( '.fragment.visible' ); - - // This value represents how big a portion of the slide progress - // that is made up by its fragments (0-1) - var fragmentWeight = 0.9; - - // Add fragment progress to the past slide count - pastCount += ( visibleFragments.length / allFragments.length ) * fragmentWeight; - } - - } - - return pastCount / ( totalCount - 1 ); - - } - - /** - * Checks if this presentation is running inside of the - * speaker notes window. - * - * @return {boolean} - */ - function isSpeakerNotes() { - - return !!window.location.search.match( /receiver/gi ); - - } - - /** - * Reads the current URL (hash) and navigates accordingly. - */ - function readURL() { - - var hash = window.location.hash; - - // Attempt to parse the hash as either an index or name - var bits = hash.slice( 2 ).split( '/' ), - name = hash.replace( /#|\//gi, '' ); - - // If the first bit is invalid and there is a name we can - // assume that this is a named link - if( isNaN( parseInt( bits[0], 10 ) ) && name.length ) { - var element; - - // Ensure the named link is a valid HTML ID attribute - if( /^[a-zA-Z][\w:.-]*$/.test( name ) ) { - // Find the slide with the specified ID - element = document.getElementById( name ); - } - - if( element ) { - // Find the position of the named slide and navigate to it - var indices = Reveal.getIndices( element ); - slide( indices.h, indices.v ); - } - // If the slide doesn't exist, navigate to the current slide - else { - slide( indexh || 0, indexv || 0 ); - } - } - else { - // Read the index components of the hash - var h = parseInt( bits[0], 10 ) || 0, - v = parseInt( bits[1], 10 ) || 0; - - if( h !== indexh || v !== indexv ) { - slide( h, v ); - } - } - - } - - /** - * Updates the page URL (hash) to reflect the current - * state. - * - * @param {number} delay The time in ms to wait before - * writing the hash - */ - function writeURL( delay ) { - - if( config.history ) { - - // Make sure there's never more than one timeout running - clearTimeout( writeURLTimeout ); - - // If a delay is specified, timeout this call - if( typeof delay === 'number' ) { - writeURLTimeout = setTimeout( writeURL, delay ); - } - else if( currentSlide ) { - var url = '/'; - - // Attempt to create a named link based on the slide's ID - var id = currentSlide.getAttribute( 'id' ); - if( id ) { - id = id.replace( /[^a-zA-Z0-9\-\_\:\.]/g, '' ); - } - - // If the current slide has an ID, use that as a named link - if( typeof id === 'string' && id.length ) { - url = '/' + id; - } - // Otherwise use the /h/v index - else { - if( indexh > 0 || indexv > 0 ) url += indexh; - if( indexv > 0 ) url += '/' + indexv; - } - - window.location.hash = url; - } - } - - } - /** - * Retrieves the h/v location and fragment of the current, - * or specified, slide. - * - * @param {HTMLElement} [slide] If specified, the returned - * index will be for this slide rather than the currently - * active one - * - * @return {{h: number, v: number, f: number}} - */ - function getIndices( slide ) { - - // By default, return the current indices - var h = indexh, - v = indexv, - f; - - // If a slide is specified, return the indices of that slide - if( slide ) { - var isVertical = isVerticalSlide( slide ); - var slideh = isVertical ? slide.parentNode : slide; - - // Select all horizontal slides - var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); - - // Now that we know which the horizontal slide is, get its index - h = Math.max( horizontalSlides.indexOf( slideh ), 0 ); - - // Assume we're not vertical - v = undefined; - - // If this is a vertical slide, grab the vertical index - if( isVertical ) { - v = Math.max( toArray( slide.parentNode.querySelectorAll( 'section' ) ).indexOf( slide ), 0 ); - } - } - - if( !slide && currentSlide ) { - var hasFragments = currentSlide.querySelectorAll( '.fragment' ).length > 0; - if( hasFragments ) { - var currentFragment = currentSlide.querySelector( '.current-fragment' ); - if( currentFragment && currentFragment.hasAttribute( 'data-fragment-index' ) ) { - f = parseInt( currentFragment.getAttribute( 'data-fragment-index' ), 10 ); - } - else { - f = currentSlide.querySelectorAll( '.fragment.visible' ).length - 1; - } - } - } - - return { h: h, v: v, f: f }; - - } - - /** - * Retrieves all slides in this presentation. - */ - function getSlides() { - - return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' )); - - } - - /** - * Retrieves the total number of slides in this presentation. - * - * @return {number} - */ - function getTotalSlides() { - - return getSlides().length; - - } - - /** - * Returns the slide element matching the specified index. - * - * @return {HTMLElement} - */ - function getSlide( x, y ) { - - var horizontalSlide = dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR )[ x ]; - var verticalSlides = horizontalSlide && horizontalSlide.querySelectorAll( 'section' ); - - if( verticalSlides && verticalSlides.length && typeof y === 'number' ) { - return verticalSlides ? verticalSlides[ y ] : undefined; - } - - return horizontalSlide; - - } - - /** - * Returns the background element for the given slide. - * All slides, even the ones with no background properties - * defined, have a background element so as long as the - * index is valid an element will be returned. - * - * @param {number} x Horizontal background index - * @param {number} y Vertical background index - * @return {(HTMLElement[]|*)} - */ - function getSlideBackground( x, y ) { - - var slide = getSlide( x, y ); - if( slide ) { - return slide.slideBackgroundElement; - } - - return undefined; - - } - - /** - * Retrieves the speaker notes from a slide. Notes can be - * defined in two ways: - * 1. As a data-notes attribute on the slide
    - * 2. As an