diff --git a/.gitattributes b/.gitattributes index 5b221be79..45f37b485 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,3 @@ *.nims linguist-language=Nim *.nim linguist-language=Nim -*.* linguist-language=Nim +# *.* linguist-language=Nim diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94b77d10e..b79d13835 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,4 +44,4 @@ jobs: run: nimble build -d:release - name: Nimble install - run: nimble install \ No newline at end of file + run: nimble install diff --git a/CHANGELOG.md b/CHANGELOG.md index 1df33ac37..97d1cb91f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## v6.0.6 +## Changes +- Fixes and updates for Nim >= 1.2.4. +- Clean out and optimizations. + ## v6.0.3 ## Changes - Fix #121, #122 and #123 diff --git a/README.md b/README.md index fbf88f49d..f6d626ea7 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,13 @@ A quick website tool. Run the nim file and access your webpage. Website: [https: -![](https://img.shields.io/github/languages/top/ThomasTJdev/nim_websitecreator?style=for-the-badge) -![](https://img.shields.io/github/stars/ThomasTJdev/nim_websitecreator?style=for-the-badge) +![](https://img.shields.io/github/languages/top/ThomasTJdev/nim_websitecreator?style=for-the-badge) +![](https://img.shields.io/github/stars/ThomasTJdev/nim_websitecreator?style=for-the-badge) ![](https://img.shields.io/maintenance/yes/2019?style=for-the-badge) -![](https://img.shields.io/github/languages/code-size/ThomasTJdev/nim_websitecreator?style=for-the-badge) -![](https://img.shields.io/github/issues-raw/ThomasTJdev/nim_websitecreator?style=for-the-badge) -![](https://img.shields.io/github/issues-pr-raw/ThomasTJdev/nim_websitecreator?style=for-the-badge) -![](https://img.shields.io/github/last-commit/ThomasTJdev/nim_websitecreator?style=for-the-badge) +![](https://img.shields.io/github/languages/code-size/ThomasTJdev/nim_websitecreator?style=for-the-badge) +![](https://img.shields.io/github/issues-raw/ThomasTJdev/nim_websitecreator?style=for-the-badge) +![](https://img.shields.io/github/issues-pr-raw/ThomasTJdev/nim_websitecreator?style=for-the-badge) +![](https://img.shields.io/github/last-commit/ThomasTJdev/nim_websitecreator?style=for-the-badge) Recent Commits to NimWC @@ -30,7 +30,6 @@ A quick website tool. Run the nim file and access your webpage. Website: [https: ## Security - Self-Firejailing Web Framework (It Firejails itself) Best Linux Security integrated on the Core. - 2 Factor Athentication TOTP -- [Design by Contract, Contract Programming](https://dev.to/juancarlospaco/design-by-contract-immutability-side-effects-and-gulag-44fk). - Security Hardened by default (based from [Gentoo Hardened](https://wiki.gentoo.org/wiki/Hardened_Gentoo) and [Debian Hardened](https://wiki.debian.org/Hardening), checked with [`hardening-check`](https://bitbucket.org/Alexander-Shukaev/hardening-check)). - Coded following the [Power of 10: NASA Coding guidelines for safety-critical code](https://en.wikipedia.org/wiki/The_Power_of_10:_Rules_for_Developing_Safety-Critical_Code#Rules) (as much as possible). - ReCAPTCHA (Optional) @@ -79,7 +78,7 @@ As alternative, [try AndOTP](https://github.com/andOTP/andOTP) (5Mb size). - No Global Interpreter Lock, no single-Thread, no single-Core, no Interpreter. Use all your 32 CPU Cores. ## Responsive -- Uses responsive [Bulma CSS framework](https://bulma.io), supports [Bootstrap CSS framework](https://getbootstrap.com). +- Uses responsive [Bulma CSS framework](https://bulma.io). - JavaScript framework agnostic, use Nim, [Karax](https://github.com/pragmagic/karax), vanilla JS, you choose. ## Other @@ -99,15 +98,9 @@ To get started you only need: Development dependencies (automatically installed by Nimble): -- [bCrypt](https://github.com/runvnc/bcryptnim) >= `0.2.1` -- [Contra](https://github.com/juancarlospaco/nim-contra) >= `0.2.0` -- [datetime2human](https://github.com/juancarlospaco/nim-datetime2human) >= `0.2.2` - [Jester](https://github.com/dom96/jester/) >= `0.4.1` -- [Libravatar](https://github.com/juancarlospaco/nim-libravatar#nim-libravatar) >= `0.4.0` - [otp](https://github.com/OpenSystemsLab/otp.nim) >= `0.1.1` -- [Firejail](https://github.com/juancarlospaco/nim-firejail) >= `0.5.0` (optional) - [reCAPTCHA](https://github.com/euantorano/recaptcha.nim) >= `1.0.2` (optional) -- [WebP](https://github.com/juancarlospaco/nim-webp-tools) >= `0.2.0` (optional) - [PackedJSON](https://github.com/Araq/packedjson#packedjson) >= `0.1.0` (optional) Foreing optional dependencies: @@ -177,7 +170,7 @@ cp config/config_default.cfg config/config.cfg nano config/config.cfg # Install dependencies -nimble install jester recaptcha bcrypt datetime2human otp firejail webp, contra +nimble install jester recaptcha otp firejail # Compile nimwc nim c nimwc.nim @@ -225,7 +218,7 @@ These arguments should be prepended to executable file, e.g. `./nimwc cdata` * `--newdb` = Generates the database with standard tables (does **not** override or delete tables). `newdb` will be initialized automatic, if no database exists. * `--insertdata` = Insert standard data, e.g `--insertdata bulma` (this will override existing data) * `bulma` = Use Bulma CSS, No JS required - * `bootstrap` = Use Bootstrap and jQuery + * `official` = Use Official CSS Themes * `water` = Water CSS framework, No JS, HTML Classless (No classes on HTML required) @@ -240,8 +233,7 @@ These options are only available at compiletime: * `-d:demo` = Used on public test site [Nim Website Creator](https://nimwc.org). This option will override the database every 1 hour with the standard data. * `-d:gitupdate` = Updates directly from Git and force a hard reset. * `-d:postgres` = Use Postgres database instead of SQLite. -* `-d:contracts` = Checks pre- and post-conditions when compiled with `-d:release`. -* `-d:hardened` = Hardens security, requires `-d:contracts`. Performance cost ~20% max. +* `-d:hardened` = Hardens security. Performance cost ~20% max. * `-d:packedjson` = Use [PackedJSON](https://github.com/Araq/packedjson#packedjson) instead of [std lib JSON](https://nim-lang.github.io/Nim/json.html). Performance optimization. @@ -302,7 +294,7 @@ When editing a blogpage or a normal page press Ctrl+S to save. # GrapesJS -GrapesJS is a Web Builder Framework. To use GrapeJS with a CSS framework (Bulma or Bootstrap), you have to edit `public/js/grapejs_custom.js` and `public/js/grapejsbs4.min.js`. Bootstrap support in `public/js/grapejs_custom.js` is commented out. +GrapesJS is a Web Builder Framework. To use GrapeJS with a CSS framework (Bulma), you have to edit `public/js/grapejs_custom.js` and `public/js/grapejsbs4.min.js`. # DevOps diff --git a/devops/autoinstall.sh b/devops/autoinstall.sh index 5221a2a7d..8dd15a17c 100755 --- a/devops/autoinstall.sh +++ b/devops/autoinstall.sh @@ -313,7 +313,6 @@ setStandardData() { ToggleCommand=(whiptail --separate-output --radiolist "Insert standard data?" ${r} ${c} 6) ChooseOptions=("Bulma (Recommended)" "" on - Bootstrap "" off Water "" off Off "" off) Choices=$("${ToggleCommand[@]}" "${ChooseOptions[@]}" 2>&1 >/dev/tty) || (printf " %bCancel was selected, exiting installer%b\\n" "${COL_LIGHT_RED}" "${COL_NC}" && exit 1) @@ -322,10 +321,6 @@ setStandardData() { printf " %b Bulma standard data On\\n" "${INFO}" CFG_STANDARDDATA="--insertdata bulma" ;; - Bootstrap) - printf " %b Bootstrap standard data\\n" "${INFO}" - CFG_STANDARDDATA="--insertdata bootstrap" - ;; Water) printf " %b Water standard data (HTML Classless)\\n" "${INFO}" CFG_STANDARDDATA="--insertdata water" diff --git a/devops/sourcehut/alpine/edge.yml b/devops/sourcehut/alpine/edge.yml index 9b698972a..bf3596349 100644 --- a/devops/sourcehut/alpine/edge.yml +++ b/devops/sourcehut/alpine/edge.yml @@ -12,7 +12,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: /home/build/nim-$CHOOSENIM_CHOOSE_VERSION/bin:$PATH @@ -25,7 +25,7 @@ tasks: bin/nim c koch ./koch tools bin/nimble -y refresh - bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + bin/nimble -y install jester recaptcha otp firejail - build: | cd diff --git a/devops/sourcehut/alpine/latest.yml b/devops/sourcehut/alpine/latest.yml index 551eb21e5..f67a797e1 100644 --- a/devops/sourcehut/alpine/latest.yml +++ b/devops/sourcehut/alpine/latest.yml @@ -12,7 +12,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: /home/build/nim-$CHOOSENIM_CHOOSE_VERSION/bin:$PATH @@ -25,7 +25,7 @@ tasks: bin/nim c koch ./koch tools bin/nimble -y refresh - bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + bin/nimble -y install jester recaptcha otp firejail - build: | cd diff --git a/devops/sourcehut/arch/rolling_release.yml b/devops/sourcehut/arch/rolling_release.yml index 86eba653d..33d1f132f 100644 --- a/devops/sourcehut/arch/rolling_release.yml +++ b/devops/sourcehut/arch/rolling_release.yml @@ -9,7 +9,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: $HOME/.nimble/bin:$PATH @@ -18,7 +18,7 @@ tasks: curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh sh init.sh -y /home/build/.nimble/bin/nimble -y refresh - /home/build/.nimble/bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + /home/build/.nimble/bin/nimble -y install jester recaptcha otp firejail - build: | cd nim_websitecreator diff --git a/devops/sourcehut/debian/stable.yml b/devops/sourcehut/debian/stable.yml index 4f815e23d..634c92e78 100644 --- a/devops/sourcehut/debian/stable.yml +++ b/devops/sourcehut/debian/stable.yml @@ -9,7 +9,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: $HOME/.nimble/bin:$PATH @@ -18,7 +18,7 @@ tasks: curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh sh init.sh -y /home/build/.nimble/bin/nimble -y refresh - /home/build/.nimble/bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + /home/build/.nimble/bin/nimble -y install jester recaptcha otp firejail - build: | cd nim_websitecreator diff --git a/devops/sourcehut/debian/testing.yml b/devops/sourcehut/debian/testing.yml index b5d3207a5..e216be431 100644 --- a/devops/sourcehut/debian/testing.yml +++ b/devops/sourcehut/debian/testing.yml @@ -10,7 +10,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: $HOME/.nimble/bin:$PATH @@ -19,7 +19,7 @@ tasks: curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh sh init.sh -y /home/build/.nimble/bin/nimble -y refresh - /home/build/.nimble/bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + /home/build/.nimble/bin/nimble -y install jester recaptcha otp firejail - build: | cd nim_websitecreator diff --git a/devops/sourcehut/debian/unstable.yml b/devops/sourcehut/debian/unstable.yml index fbc6e5b94..3fd19f3c9 100644 --- a/devops/sourcehut/debian/unstable.yml +++ b/devops/sourcehut/debian/unstable.yml @@ -10,7 +10,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: $HOME/.nimble/bin:$PATH @@ -19,7 +19,7 @@ tasks: curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh sh init.sh -y /home/build/.nimble/bin/nimble -y refresh - /home/build/.nimble/bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + /home/build/.nimble/bin/nimble -y install jester recaptcha otp firejail - build: | cd nim_websitecreator diff --git a/devops/sourcehut/fedora/latest.yml b/devops/sourcehut/fedora/latest.yml index 941564ffc..74eaa5a52 100644 --- a/devops/sourcehut/fedora/latest.yml +++ b/devops/sourcehut/fedora/latest.yml @@ -10,7 +10,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: $HOME/.nimble/bin:$PATH @@ -19,7 +19,7 @@ tasks: curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh sh init.sh -y /home/build/.nimble/bin/nimble -y refresh - /home/build/.nimble/bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + /home/build/.nimble/bin/nimble -y install jester recaptcha otp firejail - build: | cd nim_websitecreator diff --git a/devops/sourcehut/fedora/rawhide.yml b/devops/sourcehut/fedora/rawhide.yml index 941564ffc..74eaa5a52 100644 --- a/devops/sourcehut/fedora/rawhide.yml +++ b/devops/sourcehut/fedora/rawhide.yml @@ -10,7 +10,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: $HOME/.nimble/bin:$PATH @@ -19,7 +19,7 @@ tasks: curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh sh init.sh -y /home/build/.nimble/bin/nimble -y refresh - /home/build/.nimble/bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + /home/build/.nimble/bin/nimble -y install jester recaptcha otp firejail - build: | cd nim_websitecreator diff --git a/devops/sourcehut/ubuntu/latest.yml b/devops/sourcehut/ubuntu/latest.yml index c3c2abd40..f5a769e19 100644 --- a/devops/sourcehut/ubuntu/latest.yml +++ b/devops/sourcehut/ubuntu/latest.yml @@ -10,7 +10,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: $HOME/.nimble/bin:$PATH @@ -19,7 +19,7 @@ tasks: curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh sh init.sh -y /home/build/.nimble/bin/nimble -y refresh - /home/build/.nimble/bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + /home/build/.nimble/bin/nimble -y install jester recaptcha otp firejail - build: | cd nim_websitecreator diff --git a/devops/sourcehut/ubuntu/lts.yml b/devops/sourcehut/ubuntu/lts.yml index bb9e28257..2c243782d 100644 --- a/devops/sourcehut/ubuntu/lts.yml +++ b/devops/sourcehut/ubuntu/lts.yml @@ -10,7 +10,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: $HOME/.nimble/bin:$PATH @@ -19,7 +19,7 @@ tasks: curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh sh init.sh -y /home/build/.nimble/bin/nimble -y refresh - /home/build/.nimble/bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + /home/build/.nimble/bin/nimble -y install jester recaptcha otp firejail - build: | cd nim_websitecreator diff --git a/devops/sourcehut/ubuntu/next.yml b/devops/sourcehut/ubuntu/next.yml index cce3f8352..e7e817d21 100644 --- a/devops/sourcehut/ubuntu/next.yml +++ b/devops/sourcehut/ubuntu/next.yml @@ -10,7 +10,7 @@ sources: - https://github.com/ThomasTJdev/nim_websitecreator environment: - CHOOSENIM_CHOOSE_VERSION: "0.19.6" + CHOOSENIM_CHOOSE_VERSION: "1.2.4" CHOOSENIM_NO_ANALYTICS: 1 PATH: $HOME/.nimble/bin:$PATH @@ -19,7 +19,7 @@ tasks: curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh sh init.sh -y /home/build/.nimble/bin/nimble -y refresh - /home/build/.nimble/bin/nimble -y install jester recaptcha bcrypt datetime2human otp firejail webp libravatar + /home/build/.nimble/bin/nimble -y install jester recaptcha otp firejail - build: | cd nim_websitecreator diff --git a/docs/nimwc-presentation-es-presentation.html b/docs/nimwc-presentation-es-presentation.html index 9df5a1638..04356bfd6 100644 --- a/docs/nimwc-presentation-es-presentation.html +++ b/docs/nimwc-presentation-es-presentation.html @@ -32,7 +32,7 @@ - +

WAT?

@@ -48,7 +48,7 @@

WAT?

- +

Whats in the box?

@@ -68,14 +68,13 @@

Whats in the box?

- +

Stack

- +

Nim Power

@@ -110,7 +109,7 @@

Nim Power

- +

Admin Power

@@ -132,7 +131,7 @@

Admin Power

- +

Screenshots

@@ -141,42 +140,42 @@

Screenshots

- +

File Upload

- +

User Reset

- +

- +

- +

- +
CPU, Cores, RAM, SubProcesos
@@ -184,14 +183,14 @@
CPU, Cores, RAM, SubProcesos
- +

Libravatar

- +
Plugin Store
@@ -199,7 +198,7 @@
Plugin Store
- +

Futuro

@@ -214,7 +213,7 @@

Futuro

- +

Nim necesita mas Comunidad

@@ -223,7 +222,7 @@

Nim necesita mas Comunidad

- +

Gracias

@@ -246,7 +245,7 @@

Gracias

- +
@@ -307,7 +306,6 @@

Gracias

- SQLite o Postgres - Bulma CSS framework por defecto (No usa JS) -- Bootstrap CSS framework soportado - Agnostico de JavaScript framework - No JavaScript framework empaquetado - HTTP-Beast & Jester @@ -693,24 +691,24 @@

Gracias

// Let me show you the cogs that make impress.js run... (function ( document, window ) { 'use strict'; - + // HELPER FUNCTIONS - + // `pfx` is a function that takes a standard CSS property name as a parameter // and returns it's prefixed version valid for current browser it runs in. // The code is heavily inspired by Modernizr http://www.modernizr.com/ var pfx = (function () { - + var style = document.createElement('dummy').style, prefixes = 'Webkit Moz O ms Khtml'.split(' '), memory = {}; - + return function ( prop ) { if ( typeof memory[ prop ] === "undefined" ) { - + var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1), props = (prop + ' ' + prefixes.join(ucProp + ' ') + ucProp).split(' '); - + memory[ prop ] = null; for ( var i in props ) { if ( style[ props[i] ] !== undefined ) { @@ -718,20 +716,20 @@

Gracias

break; } } - + } - + return memory[ prop ]; }; - + })(); - + // `arraify` takes an array-like object and turns it into real Array // to make all the Array.prototype goodness available. var arrayify = function ( a ) { return [].slice.call( a ); }; - + // `css` function applies the styles given in `props` object to the element // given as `el`. It runs all property names through `pfx` function to make // sure proper prefixed version of the property is used. @@ -747,14 +745,14 @@

Gracias

} return el; }; - + // `toNumber` takes a value given as `numeric` parameter and tries to turn // it into a number. If it is not possible it returns 0 (or other value // given as `fallback`). var toNumber = function (numeric, fallback) { return isNaN(numeric) ? (fallback || 0) : Number(numeric); }; - + var validateOrder = function ( order, fallback ) { var validChars = "xyz"; var returnStr = ""; @@ -774,26 +772,26 @@

Gracias

else return "xyz"; }; - + // `byId` returns element with given `id` - you probably have guessed that ;) var byId = function ( id ) { return document.getElementById(id); }; - + // `$` returns first element for given CSS `selector` in the `context` of // the given element or whole document. var $ = function ( selector, context ) { context = context || document; return context.querySelector(selector); }; - + // `$$` return an array of elements for given CSS `selector` in the `context` of // the given element or whole document. var $$ = function ( selector, context ) { context = context || document; return arrayify( context.querySelectorAll(selector) ); }; - + // `triggerEvent` builds a custom DOM event with given `eventName` and `detail` data // and triggers it on element given as `el`. var triggerEvent = function (el, eventName, detail) { @@ -801,12 +799,12 @@

Gracias

event.initCustomEvent(eventName, true, true, detail); el.dispatchEvent(event); }; - + // `translate` builds a translate transform string for given data. var translate = function ( t ) { return " translate3d(" + t.x + "px," + t.y + "px," + t.z + "px) "; }; - + // `rotate` builds a rotate transform string for given data. // By default the rotations are in X Y Z order that can be reverted by passing `true` // as second parameter. @@ -823,17 +821,17 @@

Gracias

} return css; }; - + // `scale` builds a scale transform string for given data. var scale = function ( s ) { return " scale(" + s + ") "; }; - + // `perspective` builds a perspective transform string for given data. var perspective = function ( p ) { return " perspective(" + p + "px) "; }; - + // `getElementFromHash` returns an element located by id from hash part of // window location. var getElementFromHash = function () { @@ -841,37 +839,37 @@

Gracias

// so both "fallback" `#slide-id` and "enhanced" `#/slide-id` will work return byId( window.location.hash.replace(/^#\/?/,"") ); }; - + // `computeWindowScale` counts the scale factor between window size and size // defined for the presentation in the config. var computeWindowScale = function ( config ) { var hScale = window.innerHeight / config.height, wScale = window.innerWidth / config.width, scale = hScale > wScale ? wScale : hScale; - + if (config.maxScale && scale > config.maxScale) { scale = config.maxScale; } - + if (config.minScale && scale < config.minScale) { scale = config.minScale; } - + return scale; }; - + // CHECK SUPPORT var body = document.body; - + var ua = navigator.userAgent.toLowerCase(); - var impressSupported = - // browser should support CSS 3D transtorms + var impressSupported = + // browser should support CSS 3D transtorms ( pfx("perspective") !== null ) && - + // and `classList` and `dataset` APIs ( body.classList ) && ( body.dataset ); - + if (!impressSupported) { // we can't be sure that `classList` is supported body.className += " impress-not-supported "; @@ -879,40 +877,40 @@

Gracias

body.classList.remove("impress-not-supported"); body.classList.add("impress-supported"); } - + // GLOBALS AND DEFAULTS - + // This is where the root elements of all impress.js instances will be kept. // Yes, this means you can have more than one instance on a page, but I'm not // sure if it makes any sense in practice ;) var roots = {}; - + var preInitPlugins = []; var preStepLeavePlugins = []; - + // some default config values. var defaults = { width: 1024, height: 768, maxScale: 1, minScale: 0, - + perspective: 1000, - + transitionDuration: 1000 }; - + // it's just an empty function ... and a useless comment. var empty = function () { return false; }; - + // IMPRESS.JS API - + // And that's where interesting things will start to happen. // It's the core `impress` function that returns the impress.js API // for a presentation based on the element with given id ('impress' // by default). var impress = window.impress = function ( rootId ) { - + // If impress.js is not supported by the browser return a dummy API // it may not be a perfect solution but we return early and avoid // running code that may use features not implemented in the browser. @@ -926,49 +924,49 @@

Gracias

addPreStepLeavePlugin: empty }; } - + rootId = rootId || "impress"; - + // if given root is already initialized just return the API if (roots["impress-root-" + rootId]) { return roots["impress-root-" + rootId]; } - + // data of all presentation steps var stepsData = {}; - + // element of currently active step var activeStep = null; - + // current state (position, rotation and scale) of the presentation var currentState = null; - + // array of step elements var steps = null; - + // configuration options var config = null; - + // scale factor of the browser window - var windowScale = null; - + var windowScale = null; + // root presentation elements var root = byId( rootId ); var canvas = document.createElement("div"); - + var initialized = false; - + // STEP EVENTS // // There are currently two step events triggered by impress.js - // `impress:stepenter` is triggered when the step is shown on the + // `impress:stepenter` is triggered when the step is shown on the // screen (the transition from the previous one is finished) and // `impress:stepleave` is triggered when the step is left (the // transition to next step just starts). - + // reference to last entered step var lastEntered = null; - + // `onStepEnter` is called whenever the step element is entered // but the event is triggered only if the step is different than // last entered step. @@ -978,7 +976,7 @@

Gracias

lastEntered = step; } }; - + // `onStepLeave` is called whenever the step element is left // but the event is triggered only if the step is the same as // last entered step. @@ -988,9 +986,9 @@

Gracias

lastEntered = null; } }; - + // `addPreInitPlugin` allows plugins to register a function that should - // be run (synchronously) at the beginning of init, before + // be run (synchronously) at the beginning of init, before // impress().init() itself executes. var addPreInitPlugin = function( plugin, weight ) { weight = toNumber(weight,10); @@ -999,7 +997,7 @@

Gracias

} preInitPlugins[weight].push( plugin ); }; - + // Called at beginning of init, to execute all pre-init plugins. var execPreInitPlugins = function() { for( var i = 0; i < preInitPlugins.length; i++ ) { @@ -1011,7 +1009,7 @@

Gracias

} } }; - + // `addPreStepLeavePlugin` allows plugins to register a function that should // be run (synchronously) at the beginning of goto() var addPreStepLeavePlugin = function( plugin, weight ) { @@ -1021,7 +1019,7 @@

Gracias

} preStepLeavePlugins[weight].push( plugin ); }; - + // Called at beginning of goto(), to execute all preStepLeave plugins. var execPreStepLeavePlugins = function(event) { for( var i = 0; i < preStepLeavePlugins.length; i++ ) { @@ -1054,13 +1052,13 @@

Gracias

transitionDuration: toNumber(data.transitionDuration, config.transitionDuration), el: el }; - + if ( !el.id ) { el.id = "step-" + (idx + 1); } - + stepsData["impress-" + el.id] = step; - + css(el, { position: "absolute", transform: "translate(-50%,-50%)" + @@ -1070,12 +1068,12 @@

Gracias

transformStyle: "preserve-3d" }); }; - + // `init` API function that initializes (and runs) the presentation. var init = function () { if (initialized) { return; } execPreInitPlugins(); - + // First we set up the viewport for mobile devices. // For some reason iPad goes nuts when it is not done properly. var meta = $("meta[name='viewport']") || document.createElement("meta"); @@ -1084,41 +1082,41 @@

Gracias

meta.name = 'viewport'; document.head.appendChild(meta); } - + // initialize configuration object var rootData = root.dataset; config = { width: toNumber( rootData.width, defaults.width ), height: toNumber( rootData.height, defaults.height ), maxScale: toNumber( rootData.maxScale, defaults.maxScale ), - minScale: toNumber( rootData.minScale, defaults.minScale ), + minScale: toNumber( rootData.minScale, defaults.minScale ), perspective: toNumber( rootData.perspective, defaults.perspective ), transitionDuration: toNumber( rootData.transitionDuration, defaults.transitionDuration ) }; - + windowScale = computeWindowScale( config ); - + // wrap steps with "canvas" element arrayify( root.childNodes ).forEach(function ( el ) { canvas.appendChild( el ); }); root.appendChild(canvas); - + // set initial styles document.documentElement.style.height = "100%"; - + css(body, { height: "100%", overflow: "hidden" }); - + var rootStyles = { position: "absolute", transformOrigin: "top left", transition: "all 0s ease-in-out", transformStyle: "preserve-3d" }; - + css(root, rootStyles); css(root, { top: "50%", @@ -1126,26 +1124,26 @@

Gracias

transform: perspective( config.perspective/windowScale ) + scale( windowScale ) }); css(canvas, rootStyles); - + body.classList.remove("impress-disabled"); body.classList.add("impress-enabled"); - + // get and init steps steps = $$(".step", root); steps.forEach( initStep ); - + // set a default initial state of the canvas currentState = { translate: { x: 0, y: 0, z: 0 }, rotate: { x: 0, y: 0, z: 0, order: "xyz" }, scale: 1 }; - + initialized = true; - + triggerEvent(root, "impress:init", { api: roots[ "impress-root-" + rootId ] }); }; - + // `getStep` is a helper function that returns a step element defined by parameter. // If a number is given, step with index given by the number is returned, if a string // is given step element with such id is returned, if DOM element is given it is returned @@ -1158,19 +1156,19 @@

Gracias

} return (step && step.id && stepsData["impress-" + step.id]) ? step : null; }; - + // used to reset timeout for `impress:stepenter` event var stepEnterTimeout = null; - + // `goto` API function that moves to step given with `el` parameter (by index, id or element), // with a transition `duration` optionally given as second parameter. var goto = function ( el, duration, reason = "goto" ) { - + if ( !initialized || !(el = getStep(el)) ) { // presentation not initialized or given element is not a step return false; } - + // Sometimes it's possible to trigger focus on first link with some keyboard action. // Browser in such a case tries to scroll the page to make this element visible // (even that body overflow is set to hidden) and it breaks our careful positioning. @@ -1180,9 +1178,9 @@

Gracias

// // If you are reading this and know any better way to handle it, I'll be glad to hear about it! window.scrollTo(0, 0); - + var step = stepsData["impress-" + el.id]; - + // If we are in fact moving to another step, start with executing the registered preStepLeave plugins. if (activeStep && activeStep !== el) { var event = { target: activeStep, detail : {} }; @@ -1195,15 +1193,15 @@

Gracias

step = stepsData["impress-" + el.id]; duration = event.detail.transitionDuration; } - + if ( activeStep ) { activeStep.classList.remove("active"); body.classList.remove("impress-on-" + activeStep.id); } el.classList.add("active"); - + body.classList.add("impress-on-" + el.id); - + // compute target state of the canvas based on given step var target = { rotate: { @@ -1219,7 +1217,7 @@

Gracias

}, scale: 1 / step.scale }; - + // Check if the transition is zooming in or not. // // This information is used to alter the transition style: @@ -1227,23 +1225,23 @@

Gracias

// and the scaling is delayed, but when we are zooming out we start // with scaling down and move and rotation are delayed. var zoomin = target.scale >= currentState.scale; - + duration = toNumber(duration, config.transitionDuration); var delay = (duration / 2); - + // if the same step is re-selected, force computing window scaling, // because it is likely to be caused by window resize if (el === activeStep) { windowScale = computeWindowScale(config); } - + var targetScale = target.scale * windowScale; - + // trigger leave of currently active element (if it's not the same step again) if (activeStep && activeStep !== el) { onStepLeave(activeStep, el); } - + // Now we alter transforms of `root` and `canvas` to trigger transitions. // // And here is why there are two elements: `root` and `canvas` - they are @@ -1259,13 +1257,13 @@

Gracias

transitionDuration: duration + "ms", transitionDelay: (zoomin ? delay : 0) + "ms" }); - + css(canvas, { transform: rotate(target.rotate, true) + translate(target.translate), transitionDuration: duration + "ms", transitionDelay: (zoomin ? 0 : delay) + "ms" }); - + // Here is a tricky part... // // If there is no change in scale or no change in rotation and translation, it means there was actually @@ -1281,17 +1279,17 @@

Gracias

currentState.translate.y === target.translate.y && currentState.translate.z === target.translate.z) ) { delay = 0; } - + // store current state currentState = target; activeStep = el; - + // And here is where we trigger `impress:stepenter` event. // We simply set up a timeout to fire it taking transition duration (and possible delay) into account. // // I really wanted to make it in more elegant way. The `transitionend` event seemed to be the best way // to do it, but the fact that I'm using transitions on two separate elements and that the `transitionend` - // event is only triggered when there was a transition (change in the values) caused some bugs and + // event is only triggered when there was a transition (change in the values) caused some bugs and // made the code really complicated, cause I had to handle all the conditions separately. And it still // needed a `setTimeout` fallback for the situations when there is no transition at all. // So I decided that I'd rather make the code simpler than use shiny new `transitionend`. @@ -1302,46 +1300,46 @@

Gracias

stepEnterTimeout = window.setTimeout(function() { onStepEnter(activeStep); }, duration + delay); - + return el; }; - + // `prev` API function goes to previous step (in document order) var prev = function () { var prev = steps.indexOf( activeStep ) - 1; prev = prev >= 0 ? steps[ prev ] : steps[ steps.length-1 ]; - + return goto(prev, undefined, "prev"); }; - + // `next` API function goes to next step (in document order) var next = function () { var next = steps.indexOf( activeStep ) + 1; next = next < steps.length ? steps[ next ] : steps[ 0 ]; - + return goto(next, undefined, "next"); }; - + // Swipe for touch devices by @and3rson. // Below we extend the api to control the animation between the currently // active step and a presumed next/prev step. See touch plugin for // an example of using this api. - + // Helper function var interpolate = function(a, b, k) { return a + (b - a) * k; }; - - // Animate a swipe. + + // Animate a swipe. // // pct is a value between -1.0 and +1.0, designating the current length // of the swipe. // - // If pct is negative, swipe towards the next() step, if positive, - // towards the prev() step. + // If pct is negative, swipe towards the next() step, if positive, + // towards the prev() step. // - // Note that pre-stepleave plugins such as goto can mess with what is a - // next() and prev() step, so we need to trigger the pre-stepleave event + // Note that pre-stepleave plugins such as goto can mess with what is a + // next() and prev() step, so we need to trigger the pre-stepleave event // here, even if a swipe doesn't guarantee that the transition will // actually happen. // @@ -1369,7 +1367,7 @@

Gracias

} execPreStepLeavePlugins(event); var nextElement = event.detail.next; - + var nextStep = stepsData['impress-' + nextElement.id]; var zoomin = nextStep.scale >= currentState.scale; // if the same step is re-selected, force computing window scaling, @@ -1426,26 +1424,26 @@

Gracias

steps.forEach(function (step) { step.classList.add("future"); }); - + root.addEventListener("impress:stepenter", function (event) { event.target.classList.remove("past"); event.target.classList.remove("future"); event.target.classList.add("present"); }, false); - + root.addEventListener("impress:stepleave", function (event) { event.target.classList.remove("present"); event.target.classList.add("past"); }, false); - + }, false); - + // Adding hash change support. root.addEventListener("impress:init", function(){ - + // last hash detected var lastHash = ""; - + // `#/step-id` is used instead of `#step-id` to prevent default browser // scrolling to element in hash. // @@ -1455,10 +1453,10 @@

Gracias

root.addEventListener("impress:stepenter", function (event) { window.location.hash = lastHash = "#/" + event.target.id; }, false); - + window.addEventListener("hashchange", function () { // When the step is entered hash in the location is updated - // (just few lines above from here), so the hash change is + // (just few lines above from here), so the hash change is // triggered and we would call `goto` again on the same element. // // To avoid this we store last entered hash and compare. @@ -1466,14 +1464,14 @@

Gracias

goto( getElementFromHash() ); } }, false); - - // START + + // START // by selecting step defined in url or first step of the presentation goto(getElementFromHash() || steps[0], 0); }, false); - + body.classList.add("impress-disabled"); - + // store and return API for given impress.js root element return (roots[ "impress-root-" + rootId ] = { init: init, @@ -1486,7 +1484,7 @@

Gracias

}); }; - + // flag that can be used in JS to check if browser have passed the support test impress.supported = impressSupported; @@ -1521,19 +1519,19 @@

Gracias

return isNaN(numeric) ? (fallback || 0) : Number(numeric); }; - // On impress:init, check whether there is a default setting, as well as + // On impress:init, check whether there is a default setting, as well as // handle step-1. document.addEventListener("impress:init", function (event) { // Getting API from event data instead of global impress().init(). // You don't even need to know what is the id of the root element - // or anything. `impress:init` event data gives you everything you + // or anything. `impress:init` event data gives you everything you // need to control the presentation that was just initialized. api = event.detail.api; root = event.target; // Element attributes starting with 'data-', become available under // element.dataset. In addition hyphenized words become camelCased. var data = root.dataset; - + if (data.autoplay) { autoplayDefault = toNumber(data.autoplay, 0); } @@ -1546,7 +1544,7 @@

Gracias

// Note that right after impress:init event, also impress:stepenter is // triggered for the first slide, so that's where code flow continues. }, false); - + // If default autoplay time was defined in the presentation root, or // in this step, set timeout. document.addEventListener("impress:stepenter", function (event) { @@ -1567,13 +1565,13 @@

Gracias

if ( timeoutHandle ) { clearTimeout(timeoutHandle); } - + if ( timeout > 0) { timeoutHandle = setTimeout( function() { api.next(); }, timeout*1000 ); } setButtonText(); }; - + /*** Toolbar plugin integration *******************************************/ var status = "not clicked"; @@ -1609,7 +1607,7 @@

Gracias

return "▶"; // play } }; - + var setButtonText = function() { if (toolbarButton) { // Keep button size the same even if label content is changing @@ -1652,16 +1650,16 @@

Gracias

* * Press Ctrl+b to hide all slides, and Ctrl+b again to show them. * Also navigating to a different slide will show them again (impress:stepleave). - * + * * Copyright 2014 @Strikeskids * Released under the MIT license. */ (function ( document, window ) { 'use strict'; - + var canvas = null; var blackedOut = false; - + // While waiting for a shared library of utilities, copying these 2 from main impress.js var css = function ( el, props ) { var key, pkey; @@ -1677,17 +1675,17 @@

Gracias

}; var pfx = (function () { - + var style = document.createElement('dummy').style, prefixes = 'Webkit Moz O ms Khtml'.split(' '), memory = {}; - + return function ( prop ) { if ( typeof memory[ prop ] === "undefined" ) { - + var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1), props = (prop + ' ' + prefixes.join(ucProp + ' ') + ucProp).split(' '); - + memory[ prop ] = null; for ( var i in props ) { if ( style[ props[i] ] !== undefined ) { @@ -1695,14 +1693,14 @@

Gracias

break; } } - + } - + return memory[ prop ]; }; - + })(); - + var removeBlackout = function() { @@ -1731,7 +1729,7 @@

Gracias

var api = event.detail.api; var root = event.target; canvas = root.firstElementChild; - + document.addEventListener("keydown", function ( event ) { if ( event.ctrlKey && event.keyCode === 66 ) { event.preventDefault(); @@ -1746,7 +1744,7 @@

Gracias

} } }, false); - + document.addEventListener("keyup", function ( event ) { if ( event.ctrlKey && event.keyCode === 66 ) { event.preventDefault(); @@ -1754,7 +1752,7 @@

Gracias

}, false); }, false); - + document.addEventListener("impress:stepleave", function (event) { removeBlackout(); }, false); @@ -1797,7 +1795,7 @@

Gracias

var markdownDivs = document.querySelectorAll(".markdown"); for (var element of markdownDivs) { - // Note: unlike the previous two, markdown.js doesn't automatically find or convert anything in + // Note: unlike the previous two, markdown.js doesn't automatically find or convert anything in var slides = element.textContent.split(/^-----$/m); var i = slides.length - 1; element.innerHTML = markdown.toHTML(slides[i]); @@ -1817,11 +1815,11 @@

Gracias

element.id = id; } } // markdown - + if(window.hljs){ - hljs.initHighlightingOnLoad(); + hljs.initHighlightingOnLoad(); } - + if(window.mermaid){ mermaid.initialize({startOnLoad:true}); } @@ -1830,7 +1828,7 @@

Gracias

var postInit = function(event){ if(window.impressConsole){ // Init impressConsole.js. - // This does not yet show the window, just activates the plugin. + // This does not yet show the window, just activates the plugin. // Press 'P' to show the console. // Note that we must pass the correct path to css file as well. // See https://github.com/regebro/impress-console/issues/19 @@ -1840,7 +1838,7 @@

Gracias

else{ impressConsole().init(); } - + // Add 'P' to the help popup triggerEvent(document, "impress:help:add", { command : "P", text : "Presenter console", row : 10} ); @@ -1886,11 +1884,11 @@

Gracias

*/ (function ( document, window ) { 'use strict'; - + document.addEventListener("impress:stepleave", function (event) { document.activeElement.blur() }, false); - + })(document, window); @@ -1901,14 +1899,14 @@

Gracias

* and will alter the destination where to transition next. * * Example: - * + * * *
- * + * * *
- * + * * Copyright 2016 Henrik Ingo (@henrikingo) * Released under the MIT license. */ @@ -1919,14 +1917,14 @@

Gracias

return isNaN(numeric) ? (fallback || 0) : Number(numeric); }; - + var goto = function(event) { if ( (!event) || (!event.target) ) return; - + var data = event.target.dataset; var steps = document.querySelectorAll(".step"); - + // Handle event.target data-goto-next attribute if ( !isNaN(data.gotoNext) && event.detail.reason == "next" ) { event.detail.next = steps[data.gotoNext]; @@ -1982,10 +1980,10 @@

Gracias

} } }; - + // Register the plugin to be called in pre-stepleave phase impress().addPreStepLeavePlugin( goto ); - + })(document, window); @@ -1993,7 +1991,7 @@

Gracias

* Help popup plugin * * Example: - * + * * *
* @@ -2030,7 +2028,7 @@

Gracias

} } }; - + var toggleHelp = function() { var helpDiv = document.getElementById("impress-help"); if(helpDiv.style.display == 'block') { @@ -2086,10 +2084,10 @@

Gracias

}, 7000); } }); - + // Use our own API to register the help text for 'h' triggerEvent(document, "impress:help:add", { command : "H", text : "Show this help", row : 0} ); - + })(document, window); @@ -2135,7 +2133,7 @@

Gracias

// Detect mobile browsers & add CSS class as appropriate. document.addEventListener("impress:init", function (event) { var body = document.body; - if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ + if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){ body.classList.add('impress-mobile'); } }); @@ -2164,7 +2162,7 @@

Gracias

/** * Mouse timeout plugin * - * After 3 seconds of mouse inactivity, add the css class + * After 3 seconds of mouse inactivity, add the css class * `body.impress-mouse-timeout`. On `mousemove`, `click` or `touch`, remove the * class. * @@ -2241,7 +2239,7 @@

Gracias

*/ (function ( document, window ) { 'use strict'; - + var triggerEvent = function (el, eventName, detail) { var event = document.createEvent("CustomEvent"); event.initCustomEvent(eventName, true, true, detail); @@ -2252,7 +2250,7 @@

Gracias

document.addEventListener("impress:init", function (event) { // Getting API from event data. // So you don't event need to know what is the id of the root element - // or anything. `impress:init` event data gives you everything you + // or anything. `impress:init` event data gives you everything you // need to control the presentation that was just initialized. var api = event.detail.api; var tab = 9; @@ -2275,13 +2273,13 @@

Gracias

if ( event.altKey || event.ctrlKey || event.metaKey ){ return false; } - + // In the case of TAB, we force step navigation always, overriding the browser navigation between // input elements, buttons and links. if ( event.keyCode === 9 ) { return true; } - + // With the sole exception of TAB, we also ignore keys pressed if shift is down. if ( event.shiftKey ){ return false; @@ -2297,17 +2295,17 @@

Gracias

return true; } }; - - + + // KEYBOARD NAVIGATION HANDLERS - + // Prevent default keydown action when one of supported key is pressed. document.addEventListener("keydown", function ( event ) { if ( isNavigationEvent(event) ) { event.preventDefault(); } }, false); - + // Trigger impress action (next or prev) on keyup. document.addEventListener("keyup", function ( event ) { if ( isNavigationEvent(event) ) { @@ -2337,7 +2335,7 @@

Gracias

event.preventDefault(); } }, false); - + // delegated handler for clicking on the links to presentation steps document.addEventListener("click", function ( event ) { // event delegation with "bubbling" @@ -2347,22 +2345,22 @@

Gracias

(target !== document.documentElement) ) { target = target.parentNode; } - + if ( target.tagName === "A" ) { var href = target.getAttribute("href"); - + // if it's a link to presentation step, target this step if ( href && href[0] === '#' ) { target = document.getElementById( href.slice(1) ); } } - + if ( api.goto(target) ) { event.stopImmediatePropagation(); event.preventDefault(); } }, false); - + // delegated handler for clicking on step elements document.addEventListener("click", function ( event ) { var target = event.target; @@ -2371,17 +2369,17 @@

Gracias

(target !== document.documentElement) ) { target = target.parentNode; } - + if ( api.goto(target) ) { event.preventDefault(); } }, false); - + // Add a line to the help popup triggerEvent(document, "impress:help:add", { command : "Left & Right", text : "Previous & Next step", row : 1} ); - + }, false); - + })(document, window); @@ -2419,7 +2417,7 @@

Gracias

tempDiv.innerHTML = html; return tempDiv.firstChild; }; - + var selectOptionsHtml = function(){ var options = ""; for ( var i = 0; i < steps.length; i++ ) { @@ -2428,7 +2426,7 @@

Gracias

options = options + '' + "\n"; } } - return options; + return options; }; var addNavigationControls = function( event ) { @@ -2460,12 +2458,12 @@

Gracias

function() { api.next(); }); - + triggerEvent(toolbar, "impress:toolbar:appendChild", { group : 0, element : prev } ); triggerEvent(toolbar, "impress:toolbar:appendChild", { group : 0, element : select } ); triggerEvent(toolbar, "impress:toolbar:appendChild", { group : 0, element : next } ); }; - + // API for not listing given step in the select widget. // For example, if you set class="skip" on some element, you may not want it to show up in the list either. // Otoh we cannot assume that, or anything else, so steps that user wants omitted must be specifically added with this API call. @@ -2475,7 +2473,7 @@

Gracias

select.innerHTML = selectOptionsHtml(); } }, false); - + // wait for impress.js to be initialized document.addEventListener("impress:init", function (event) { toolbar = document.querySelector("#impress-toolbar"); @@ -2483,13 +2481,13 @@

Gracias

addNavigationControls( event ); } }, false); - + })(document, window); (function ( document, window ) { 'use strict'; - + var stepids = []; // wait for impress.js to be initialized document.addEventListener("impress:init", function (event) { @@ -2502,12 +2500,12 @@

Gracias

}); var progressbar = document.querySelector('div.impress-progressbar div'); var progress = document.querySelector('div.impress-progress'); - - if (null !== progressbar || null !== progress) { + + if (null !== progressbar || null !== progress) { document.addEventListener("impress:stepleave", function (event) { updateProgressbar(event.detail.next.id); }); - + document.addEventListener("impress:stepenter", function (event) { updateProgressbar(event.target.id); }); @@ -2532,26 +2530,26 @@

Gracias

* since as you add, remove or move steps, you may not need to edit the positions * as much as is the case with the absolute coordinates supported by impress.js * core. - * + * * Example: - * + * * *
- * + * * Following html attributes are supported for step elements: - * + * * data-rel-x * data-rel-y * data-rel-z - * - * These values are also inherited from the previous step. This makes it easy to - * create a boring presentation where each slide shifts for example 1000px down + * + * These values are also inherited from the previous step. This makes it easy to + * create a boring presentation where each slide shifts for example 1000px down * from the previous. - * + * * In addition to plain numbers, which are pixel values, it is also possible to * define relative positions as a multiple of screen height and width, using * a unit of "h" and "w", respectively, appended to the number. - * + * * Example: * *
@@ -2560,7 +2558,7 @@

Gracias

* core at the beginning of `impress().init()`. This allows it to process its own * data attributes first, and possibly alter the data-x, data-y and data-z attributes * that will then be processed by `impress().init()`. - * + * * (Another name for this kind of plugin might be called a *filter plugin*, but * *pre-init plugin* is more generic, as a plugin might do whatever it wants in * the pre-init stage.) @@ -2600,7 +2598,7 @@

Gracias

var computeRelativePositions = function ( el, prev ) { var data = el.dataset; - + if( !prev ) { // For the first step, inherit these defaults var prev = { x:0, y:0, z:0, relative: {x:0, y:0, z:0} }; @@ -2621,16 +2619,16 @@

Gracias

if(data.x !== undefined) step.relative.x = 0; if(data.y !== undefined) step.relative.y = 0; if(data.z !== undefined) step.relative.z = 0; - + // Apply relative position to absolute position, if non-zero // Note that at this point, the relative values contain a number value of pixels. step.x = step.x + step.relative.x; step.y = step.y + step.relative.y; step.z = step.z + step.relative.z; - - return step; + + return step; }; - + var rel = function() { var root = document.querySelector("#impress"); var steps = root.querySelectorAll(".step"); @@ -2645,10 +2643,10 @@

Gracias

prev = step; } }; - + // Register the plugin to be called in pre-init phase impress().addPreInitPlugin( rel ); - + })(document, window); @@ -2668,7 +2666,7 @@

Gracias

*/ (function ( document, window ) { 'use strict'; - + // throttling function calls, by Remy Sharp // http://remysharp.com/2010/07/21/throttling-function-calls/ var throttle = function (fn, delay) { @@ -2681,7 +2679,7 @@

Gracias

}, delay); }; }; - + // wait for impress.js to be initialized document.addEventListener("impress:init", function (event) { var api = event.detail.api; @@ -2691,7 +2689,7 @@

Gracias

api.goto( document.querySelector(".step.active"), 500 ); }, 250), false); }, false); - + })(document, window); @@ -2699,12 +2697,12 @@

Gracias

* Skip Plugin * * Example: - * + * * *