hyla 1.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Gemfile.lock +35 -7
- data/README.adoc +10 -2
- data/bin/hyla +16 -13
- data/hyla.gemspec +6 -3
- data/lib/hyla.rb +5 -1
- data/lib/hyla/command.rb +12 -10
- data/lib/hyla/commands/create.rb +21 -12
- data/lib/hyla/commands/generate.rb +168 -59
- data/lib/hyla/commands/new.rb +36 -15
- data/lib/hyla/commands/watch.rb +6 -2
- data/lib/hyla/configuration.rb +169 -27
- data/lib/hyla/core_ext.rb +24 -0
- data/lib/hyla/project.rb +1 -1
- data/lib/resources/backends/haml/deckjs/block_admonition.html.haml +14 -0
- data/lib/resources/backends/haml/deckjs/block_audio.html.haml +7 -0
- data/lib/resources/backends/haml/deckjs/block_colist.html.haml +21 -0
- data/lib/resources/backends/haml/deckjs/block_dlist.html.haml +54 -0
- data/lib/resources/backends/haml/deckjs/block_example.haml.haml +5 -0
- data/lib/resources/backends/haml/deckjs/block_floating_title.html.haml +1 -0
- data/lib/resources/backends/haml/deckjs/block_image.html.haml +11 -0
- data/lib/resources/backends/haml/deckjs/block_listing.html.haml +32 -0
- data/lib/resources/backends/haml/deckjs/block_literal.html.haml +5 -0
- data/lib/resources/backends/haml/deckjs/block_olist.html.haml +11 -0
- data/lib/resources/backends/haml/deckjs/block_open.html.haml +5 -0
- data/lib/resources/backends/haml/deckjs/block_page_break.html.haml +1 -0
- data/lib/resources/backends/haml/deckjs/block_paragraph.html.haml +4 -0
- data/lib/resources/backends/haml/deckjs/block_pass.html.haml +1 -0
- data/lib/resources/backends/haml/deckjs/block_preamble.html.haml +3 -0
- data/lib/resources/backends/haml/deckjs/block_quote.html.haml +12 -0
- data/lib/resources/backends/haml/deckjs/block_ruler.html.haml +1 -0
- data/lib/resources/backends/haml/deckjs/block_sidebar.html.haml +5 -0
- data/lib/resources/backends/haml/deckjs/block_table.html.haml +48 -0
- data/lib/resources/backends/haml/deckjs/block_ulist.html.haml +25 -0
- data/lib/resources/backends/haml/deckjs/block_verse.html.haml +13 -0
- data/lib/resources/backends/haml/deckjs/block_video.html.haml +24 -0
- data/lib/resources/backends/haml/deckjs/document.html.haml +182 -0
- data/lib/resources/backends/haml/deckjs/embedded.html.haml +10 -0
- data/lib/resources/backends/haml/deckjs/inline_anchor.html.haml +12 -0
- data/lib/resources/backends/haml/deckjs/inline_break.html.haml +2 -0
- data/lib/resources/backends/haml/deckjs/inline_callout.html.haml +7 -0
- data/lib/resources/backends/haml/deckjs/inline_footnote.html.haml +8 -0
- data/lib/resources/backends/haml/deckjs/inline_image.html.haml +24 -0
- data/lib/resources/backends/haml/deckjs/inline_indexterm.html.haml +2 -0
- data/lib/resources/backends/haml/deckjs/inline_quoted.html.haml +19 -0
- data/lib/resources/backends/haml/deckjs/section.html.haml +7 -0
- data/lib/resources/backends/haml/docbook45/block_admonition.xml.haml +7 -0
- data/lib/resources/backends/haml/docbook45/block_colist.xml.haml +8 -0
- data/lib/resources/backends/haml/docbook45/block_dlist.xml.haml +61 -0
- data/lib/resources/backends/haml/docbook45/block_example.xml.haml +14 -0
- data/lib/resources/backends/haml/docbook45/block_floating_title.xml.haml +1 -0
- data/lib/resources/backends/haml/docbook45/block_image.xml.haml +8 -0
- data/lib/resources/backends/haml/docbook45/block_listing.xml.haml +14 -0
- data/lib/resources/backends/haml/docbook45/block_literal.xml.haml +7 -0
- data/lib/resources/backends/haml/docbook45/block_olist.xml.haml +8 -0
- data/lib/resources/backends/haml/docbook45/block_open.xml.haml +25 -0
- data/lib/resources/backends/haml/docbook45/block_page_break.xml.haml +1 -0
- data/lib/resources/backends/haml/docbook45/block_paragraph.xml.haml +6 -0
- data/lib/resources/backends/haml/docbook45/block_pass.xml.haml +1 -0
- data/lib/resources/backends/haml/docbook45/block_preamble.xml.haml +7 -0
- data/lib/resources/backends/haml/docbook45/block_quote.xml.haml +13 -0
- data/lib/resources/backends/haml/docbook45/block_ruler.xml.haml +2 -0
- data/lib/resources/backends/haml/docbook45/block_sidebar.xml.haml +7 -0
- data/lib/resources/backends/haml/docbook45/block_table.xml.haml +37 -0
- data/lib/resources/backends/haml/docbook45/block_ulist.xml.haml +18 -0
- data/lib/resources/backends/haml/docbook45/block_verse.xml.haml +10 -0
- data/lib/resources/backends/haml/docbook45/document.xml.haml +63 -0
- data/lib/resources/backends/haml/docbook45/embedded.xml.haml +1 -0
- data/lib/resources/backends/haml/docbook45/helpers.rb +7 -0
- data/lib/resources/backends/haml/docbook45/inline_anchor.xml.haml +13 -0
- data/lib/resources/backends/haml/docbook45/inline_break.xml.haml +2 -0
- data/lib/resources/backends/haml/docbook45/inline_callout.xml.haml +1 -0
- data/lib/resources/backends/haml/docbook45/inline_footnote.xml.haml +5 -0
- data/lib/resources/backends/haml/docbook45/inline_image.xml.haml +5 -0
- data/lib/resources/backends/haml/docbook45/inline_indexterm.xml.haml +18 -0
- data/lib/resources/backends/haml/docbook45/inline_quoted.xml.haml +21 -0
- data/lib/resources/backends/haml/docbook45/section.xml.haml +5 -0
- data/lib/resources/backends/haml/html5/block_admonition.html.haml +14 -0
- data/lib/resources/backends/haml/html5/block_audio.html.haml +7 -0
- data/lib/resources/backends/haml/html5/block_colist.html.haml +21 -0
- data/lib/resources/backends/haml/html5/block_dlist.html.haml +54 -0
- data/lib/resources/backends/haml/html5/block_example.haml.haml +5 -0
- data/lib/resources/backends/haml/html5/block_floating_title.html.haml +1 -0
- data/lib/resources/backends/haml/html5/block_image.html.haml +11 -0
- data/lib/resources/backends/haml/html5/block_listing.html.haml +31 -0
- data/lib/resources/backends/haml/html5/block_literal.html.haml +5 -0
- data/lib/resources/backends/haml/html5/block_math.html.haml +10 -0
- data/lib/resources/backends/haml/html5/block_olist.html.haml +9 -0
- data/lib/resources/backends/haml/html5/block_open.html.haml +15 -0
- data/lib/resources/backends/haml/html5/block_page_break.html.haml +1 -0
- data/lib/resources/backends/haml/html5/block_paragraph.html.haml +4 -0
- data/lib/resources/backends/haml/html5/block_pass.html.haml +1 -0
- data/lib/resources/backends/haml/html5/block_preamble.html.haml +6 -0
- data/lib/resources/backends/haml/html5/block_quote.html.haml +12 -0
- data/lib/resources/backends/haml/html5/block_ruler.html.haml +1 -0
- data/lib/resources/backends/haml/html5/block_sidebar.html.haml +5 -0
- data/lib/resources/backends/haml/html5/block_table.html.haml +47 -0
- data/lib/resources/backends/haml/html5/block_toc.html.haml +11 -0
- data/lib/resources/backends/haml/html5/block_ulist.html.haml +25 -0
- data/lib/resources/backends/haml/html5/block_verse.html.haml +13 -0
- data/lib/resources/backends/haml/html5/block_video.html.haml +27 -0
- data/lib/resources/backends/haml/html5/document.html.haml +114 -0
- data/lib/resources/backends/haml/html5/embedded.html.haml +10 -0
- data/lib/resources/backends/haml/html5/helpers.rb +7 -0
- data/lib/resources/backends/haml/html5/inline_anchor.html.haml +11 -0
- data/lib/resources/backends/haml/html5/inline_break.html.haml +2 -0
- data/lib/resources/backends/haml/html5/inline_button.html.haml +1 -0
- data/lib/resources/backends/haml/html5/inline_callout.html.haml +7 -0
- data/lib/resources/backends/haml/html5/inline_footnote.html.haml +8 -0
- data/lib/resources/backends/haml/html5/inline_image.html.haml +24 -0
- data/lib/resources/backends/haml/html5/inline_indexterm.html.haml +2 -0
- data/lib/resources/backends/haml/html5/inline_kbd.html.haml +8 -0
- data/lib/resources/backends/haml/html5/inline_menu.html.haml +15 -0
- data/lib/resources/backends/haml/html5/inline_quoted.html.haml +22 -0
- data/lib/resources/backends/haml/html5/section.html.haml +21 -0
- data/lib/resources/backends/haml/revealjs/block_image.html.haml +11 -0
- data/lib/resources/backends/haml/revealjs/block_olist.html.haml +8 -0
- data/lib/resources/backends/haml/revealjs/block_ulist.html.haml +8 -0
- data/lib/resources/backends/haml/revealjs/document.html.haml +61 -0
- data/lib/resources/backends/haml/revealjs/section.html.haml +10 -0
- data/lib/resources/backends/slim/docbook45/block_admonition.xml.slim +7 -0
- data/lib/resources/backends/slim/docbook45/block_colist.xml.slim +8 -0
- data/lib/resources/backends/slim/docbook45/block_dlist.xml.slim +61 -0
- data/lib/resources/backends/slim/docbook45/block_example.xml.slim +13 -0
- data/lib/resources/backends/slim/docbook45/block_floating_title.xml.slim +1 -0
- data/lib/resources/backends/slim/docbook45/block_image.xml.slim +7 -0
- data/lib/resources/backends/slim/docbook45/block_listing.xml.slim +14 -0
- data/lib/resources/backends/slim/docbook45/block_literal.xml.slim +7 -0
- data/lib/resources/backends/slim/docbook45/block_olist.xml.slim +8 -0
- data/lib/resources/backends/slim/docbook45/block_open.xml.slim +25 -0
- data/lib/resources/backends/slim/docbook45/block_page_break.xml.slim +1 -0
- data/lib/resources/backends/slim/docbook45/block_paragraph.xml.slim +6 -0
- data/lib/resources/backends/slim/docbook45/block_pass.xml.slim +1 -0
- data/lib/resources/backends/slim/docbook45/block_preamble.xml.slim +7 -0
- data/lib/resources/backends/slim/docbook45/block_quote.xml.slim +13 -0
- data/lib/resources/backends/slim/docbook45/block_ruler.xml.slim +2 -0
- data/lib/resources/backends/slim/docbook45/block_sidebar.xml.slim +7 -0
- data/lib/resources/backends/slim/docbook45/block_table.xml.slim +36 -0
- data/lib/resources/backends/slim/docbook45/block_ulist.xml.slim +18 -0
- data/lib/resources/backends/slim/docbook45/block_verse.xml.slim +10 -0
- data/lib/resources/backends/slim/docbook45/document.xml.slim +63 -0
- data/lib/resources/backends/slim/docbook45/embedded.xml.slim +1 -0
- data/lib/resources/backends/slim/docbook45/helpers.rb +9 -0
- data/lib/resources/backends/slim/docbook45/inline_anchor.xml.slim +13 -0
- data/lib/resources/backends/slim/docbook45/inline_break.xml.slim +2 -0
- data/lib/resources/backends/slim/docbook45/inline_callout.xml.slim +1 -0
- data/lib/resources/backends/slim/docbook45/inline_footnote.xml.slim +4 -0
- data/lib/resources/backends/slim/docbook45/inline_image.xml.slim +4 -0
- data/lib/resources/backends/slim/docbook45/inline_indexterm.xml.slim +16 -0
- data/lib/resources/backends/slim/docbook45/inline_quoted.xml.slim +21 -0
- data/lib/resources/backends/slim/docbook45/section.xml.slim +5 -0
- data/lib/resources/backends/slim/document.html.bk.slim +335 -0
- data/lib/resources/backends/slim/dzslides/block_admonition.html.slim +19 -0
- data/lib/resources/backends/slim/dzslides/block_colist.html.slim +20 -0
- data/lib/resources/backends/slim/dzslides/block_dlist.html.slim +10 -0
- data/lib/resources/backends/slim/dzslides/block_example.html.slim +4 -0
- data/lib/resources/backends/slim/dzslides/block_floating_title.html.slim +1 -0
- data/lib/resources/backends/slim/dzslides/block_image.html.slim +14 -0
- data/lib/resources/backends/slim/dzslides/block_listing.html.slim +8 -0
- data/lib/resources/backends/slim/dzslides/block_literal.html.slim +11 -0
- data/lib/resources/backends/slim/dzslides/block_olist.html.slim +6 -0
- data/lib/resources/backends/slim/dzslides/block_open.html.slim +4 -0
- data/lib/resources/backends/slim/dzslides/block_paragraph.html.slim +1 -0
- data/lib/resources/backends/slim/dzslides/block_pass.html.slim +1 -0
- data/lib/resources/backends/slim/dzslides/block_quote.html.slim +11 -0
- data/lib/resources/backends/slim/dzslides/block_ruler.html.slim +1 -0
- data/lib/resources/backends/slim/dzslides/block_table.html.slim +45 -0
- data/lib/resources/backends/slim/dzslides/block_ulist.html.slim +6 -0
- data/lib/resources/backends/slim/dzslides/block_verse.html.slim +12 -0
- data/lib/resources/backends/slim/dzslides/block_video.html.slim +6 -0
- data/lib/resources/backends/slim/dzslides/document.html.slim +67 -0
- data/lib/resources/backends/slim/dzslides/embedded.html.slim +1 -0
- data/lib/resources/backends/slim/dzslides/helpers.rb +9 -0
- data/lib/resources/backends/slim/dzslides/inline_anchor.html.slim +11 -0
- data/lib/resources/backends/slim/dzslides/inline_break.html.slim +2 -0
- data/lib/resources/backends/slim/dzslides/inline_callout.html.slim +7 -0
- data/lib/resources/backends/slim/dzslides/inline_footnote.html.slim +6 -0
- data/lib/resources/backends/slim/dzslides/inline_image.html.slim +24 -0
- data/lib/resources/backends/slim/dzslides/inline_indexterm.html.slim +2 -0
- data/lib/resources/backends/slim/dzslides/inline_kbd.html.slim +8 -0
- data/lib/resources/backends/slim/dzslides/inline_quoted.html.slim +23 -0
- data/lib/resources/backends/slim/dzslides/section.html.slim +4 -0
- data/lib/resources/backends/slim/html5/block_admonition.html.slim +13 -0
- data/lib/resources/backends/slim/html5/block_audio.html.slim +6 -0
- data/lib/resources/backends/slim/html5/block_colist.html.slim +20 -0
- data/lib/resources/backends/slim/html5/block_dlist.html.slim +53 -0
- data/lib/resources/backends/slim/html5/block_example.html.slim +4 -0
- data/lib/resources/backends/slim/html5/block_floating_title.html.slim +1 -0
- data/lib/resources/backends/slim/html5/block_image.html.slim +10 -0
- data/lib/resources/backends/slim/html5/block_listing.html.slim +31 -0
- data/lib/resources/backends/slim/html5/block_literal.html.slim +4 -0
- data/lib/resources/backends/slim/html5/block_math.html.slim +10 -0
- data/lib/resources/backends/slim/html5/block_olist.html.slim +9 -0
- data/lib/resources/backends/slim/html5/block_open.html.slim +15 -0
- data/lib/resources/backends/slim/html5/block_page_break.html.slim +1 -0
- data/lib/resources/backends/slim/html5/block_paragraph.html.slim +4 -0
- data/lib/resources/backends/slim/html5/block_pass.html.slim +1 -0
- data/lib/resources/backends/slim/html5/block_preamble.html.slim +6 -0
- data/lib/resources/backends/slim/html5/block_quote.html.slim +14 -0
- data/lib/resources/backends/slim/html5/block_ruler.html.slim +1 -0
- data/lib/resources/backends/slim/html5/block_sidebar.html.slim +5 -0
- data/lib/resources/backends/slim/html5/block_table.html.slim +45 -0
- data/lib/resources/backends/slim/html5/block_toc.html.slim +12 -0
- data/lib/resources/backends/slim/html5/block_ulist.html.slim +25 -0
- data/lib/resources/backends/slim/html5/block_verse.html.slim +14 -0
- data/lib/resources/backends/slim/html5/block_video.html.slim +27 -0
- data/lib/resources/backends/slim/html5/document.html.slim +112 -0
- data/lib/resources/backends/slim/html5/embedded.html.slim +9 -0
- data/lib/resources/backends/slim/html5/helpers.rb +8 -0
- data/lib/resources/backends/slim/html5/inline_anchor.html.slim +11 -0
- data/lib/resources/backends/slim/html5/inline_break.html.slim +2 -0
- data/lib/resources/backends/slim/html5/inline_button.html.slim +1 -0
- data/lib/resources/backends/slim/html5/inline_callout.html.slim +7 -0
- data/lib/resources/backends/slim/html5/inline_footnote.html.slim +6 -0
- data/lib/resources/backends/slim/html5/inline_image.html.slim +24 -0
- data/lib/resources/backends/slim/html5/inline_indexterm.html.slim +2 -0
- data/lib/resources/backends/slim/html5/inline_kbd.html.slim +8 -0
- data/lib/resources/backends/slim/html5/inline_menu.html.slim +15 -0
- data/lib/resources/backends/slim/html5/inline_quoted.html.slim +22 -0
- data/lib/resources/backends/slim/html5/section.html.slim +20 -0
- data/lib/resources/backends/slim/revealjs/block_admonition.html.slim +13 -0
- data/lib/resources/backends/slim/revealjs/block_audio.html.slim +6 -0
- data/lib/resources/backends/slim/revealjs/block_colist.html.slim +20 -0
- data/lib/resources/backends/slim/revealjs/block_dlist.html.slim +53 -0
- data/lib/resources/backends/slim/revealjs/block_example.html.slim +4 -0
- data/lib/resources/backends/slim/revealjs/block_floating_title.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs/block_image.html.slim +10 -0
- data/lib/resources/backends/slim/revealjs/block_listing.html.slim +31 -0
- data/lib/resources/backends/slim/revealjs/block_literal.html.slim +4 -0
- data/lib/resources/backends/slim/revealjs/block_math.html.slim +10 -0
- data/lib/resources/backends/slim/revealjs/block_olist.html.slim +9 -0
- data/lib/resources/backends/slim/revealjs/block_open.html.slim +15 -0
- data/lib/resources/backends/slim/revealjs/block_page_break.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs/block_paragraph.html.slim +4 -0
- data/lib/resources/backends/slim/revealjs/block_pass.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs/block_preamble.html.slim +6 -0
- data/lib/resources/backends/slim/revealjs/block_quote.html.slim +14 -0
- data/lib/resources/backends/slim/revealjs/block_ruler.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs/block_sidebar.html.slim +5 -0
- data/lib/resources/backends/slim/revealjs/block_table.html.slim +45 -0
- data/lib/resources/backends/slim/revealjs/block_toc.html.slim +12 -0
- data/lib/resources/backends/slim/revealjs/block_ulist.html.slim +25 -0
- data/lib/resources/backends/slim/revealjs/block_verse.html.slim +14 -0
- data/lib/resources/backends/slim/revealjs/block_video.html.slim +27 -0
- data/lib/resources/backends/slim/revealjs/document.html.slim +87 -0
- data/lib/resources/backends/slim/revealjs/embedded.html.slim +9 -0
- data/lib/resources/backends/slim/revealjs/helpers.rb +8 -0
- data/lib/resources/backends/slim/revealjs/inline_anchor.html.slim +11 -0
- data/lib/resources/backends/slim/revealjs/inline_break.html.slim +2 -0
- data/lib/resources/backends/slim/revealjs/inline_button.html.slim +1 -0
- data/lib/resources/backends/slim/revealjs/inline_callout.html.slim +7 -0
- data/lib/resources/backends/slim/revealjs/inline_footnote.html.slim +6 -0
- data/lib/resources/backends/slim/revealjs/inline_image.html.slim +24 -0
- data/lib/resources/backends/slim/revealjs/inline_indexterm.html.slim +2 -0
- data/lib/resources/backends/slim/revealjs/inline_kbd.html.slim +8 -0
- data/lib/resources/backends/slim/revealjs/inline_menu.html.slim +15 -0
- data/lib/resources/backends/slim/revealjs/inline_quoted.html.slim +22 -0
- data/lib/resources/backends/slim/revealjs/section.html.slim +3 -0
- data/lib/resources/deck.js/core/deck.core.css +407 -0
- data/lib/resources/deck.js/core/deck.core.js +498 -0
- data/lib/resources/deck.js/extensions/deck.js-blank/README.md +10 -0
- data/lib/resources/deck.js/extensions/deck.js-blank/deck.blank.js +33 -0
- data/lib/resources/deck.js/extensions/goto/deck.goto.css +41 -0
- data/lib/resources/deck.js/extensions/goto/deck.goto.html +7 -0
- data/lib/resources/deck.js/extensions/goto/deck.goto.js +170 -0
- data/lib/resources/deck.js/extensions/hash/deck.hash.css +13 -0
- data/lib/resources/deck.js/extensions/hash/deck.hash.html +2 -0
- data/lib/resources/deck.js/extensions/hash/deck.hash.js +142 -0
- data/lib/resources/deck.js/extensions/menu/deck.menu.css +47 -0
- data/lib/resources/deck.js/extensions/menu/deck.menu.js +187 -0
- data/lib/resources/deck.js/extensions/navigation/deck.navigation.css +43 -0
- data/lib/resources/deck.js/extensions/navigation/deck.navigation.html +3 -0
- data/lib/resources/deck.js/extensions/navigation/deck.navigation.js +92 -0
- data/lib/resources/deck.js/extensions/scale/deck.scale.css +28 -0
- data/lib/resources/deck.js/extensions/scale/deck.scale.js +170 -0
- data/lib/resources/deck.js/extensions/split/README.md +30 -0
- data/lib/resources/deck.js/extensions/split/deck.split.js +59 -0
- data/lib/resources/deck.js/extensions/status/deck.status.css +18 -0
- data/lib/resources/deck.js/extensions/status/deck.status.html +6 -0
- data/lib/resources/deck.js/extensions/status/deck.status.js +95 -0
- data/lib/resources/deck.js/extensions/toc/deck.toc.css +40 -0
- data/lib/resources/deck.js/extensions/toc/deck.toc.html +12 -0
- data/lib/resources/deck.js/extensions/toc/deck.toc.js +271 -0
- data/lib/resources/deck.js/jquery-1.7.2.min.js +4 -0
- data/lib/resources/deck.js/jquery.min.js +4 -0
- data/lib/resources/deck.js/modernizr.custom.js +4 -0
- data/lib/resources/deck.js/themes/style/beamer.css +286 -0
- data/lib/resources/deck.js/themes/style/neon.css +123 -0
- data/lib/resources/deck.js/themes/style/swiss.css +84 -0
- data/lib/resources/deck.js/themes/style/web-2.0.css +214 -0
- data/lib/resources/deck.js/themes/transition/beamer.css +66 -0
- data/lib/resources/deck.js/themes/transition/fade.css +43 -0
- data/lib/resources/deck.js/themes/transition/horizontal-slide.css +76 -0
- data/lib/resources/deck.js/themes/transition/vertical-slide.css +94 -0
- data/lib/resources/revealjs/LICENSE +19 -0
- data/lib/resources/revealjs/css/print/paper.css +176 -0
- data/lib/resources/revealjs/css/print/pdf.css +190 -0
- data/lib/resources/revealjs/css/reveal.css +1880 -0
- data/lib/resources/revealjs/css/reveal.min.css +7 -0
- data/lib/resources/revealjs/css/theme/README.md +25 -0
- data/lib/resources/revealjs/css/theme/beige.css +148 -0
- data/lib/resources/revealjs/css/theme/blood.css +175 -0
- data/lib/resources/revealjs/css/theme/default.css +148 -0
- data/lib/resources/revealjs/css/theme/moon.css +148 -0
- data/lib/resources/revealjs/css/theme/night.css +136 -0
- data/lib/resources/revealjs/css/theme/serif.css +138 -0
- data/lib/resources/revealjs/css/theme/simple.css +138 -0
- data/lib/resources/revealjs/css/theme/sky.css +145 -0
- data/lib/resources/revealjs/css/theme/solarized.css +148 -0
- data/lib/resources/revealjs/css/theme/source/beige.scss +50 -0
- data/lib/resources/revealjs/css/theme/source/blood.scss +91 -0
- data/lib/resources/revealjs/css/theme/source/default.scss +42 -0
- data/lib/resources/revealjs/css/theme/source/moon.scss +68 -0
- data/lib/resources/revealjs/css/theme/source/night.scss +35 -0
- data/lib/resources/revealjs/css/theme/source/serif.scss +35 -0
- data/lib/resources/revealjs/css/theme/source/simple.scss +38 -0
- data/lib/resources/revealjs/css/theme/source/sky.scss +46 -0
- data/lib/resources/revealjs/css/theme/source/solarized.scss +74 -0
- data/lib/resources/revealjs/css/theme/template/mixins.scss +29 -0
- data/lib/resources/revealjs/css/theme/template/settings.scss +34 -0
- data/lib/resources/revealjs/css/theme/template/theme.scss +170 -0
- data/lib/resources/revealjs/js/reveal.js +3382 -0
- data/lib/resources/revealjs/js/reveal.min.js +9 -0
- data/lib/resources/revealjs/lib/css/zenburn.css +114 -0
- data/lib/resources/revealjs/lib/font/league_gothic-webfont.eot +0 -0
- data/lib/resources/revealjs/lib/font/league_gothic-webfont.svg +230 -0
- data/lib/resources/revealjs/lib/font/league_gothic-webfont.ttf +0 -0
- data/lib/resources/revealjs/lib/font/league_gothic-webfont.woff +0 -0
- data/lib/resources/revealjs/lib/font/league_gothic_license +2 -0
- data/lib/resources/revealjs/lib/js/classList.js +2 -0
- data/lib/resources/revealjs/lib/js/head.min.js +8 -0
- data/lib/resources/revealjs/lib/js/html5shiv.js +7 -0
- data/lib/resources/revealjs/plugin/highlight/highlight.js +32 -0
- data/lib/resources/revealjs/plugin/leap/leap.js +157 -0
- data/lib/resources/revealjs/plugin/markdown/example.html +129 -0
- data/lib/resources/revealjs/plugin/markdown/example.md +31 -0
- data/lib/resources/revealjs/plugin/markdown/markdown.js +392 -0
- data/lib/resources/revealjs/plugin/markdown/marked.js +37 -0
- data/lib/resources/revealjs/plugin/math/math.js +64 -0
- data/lib/resources/revealjs/plugin/multiplex/client.js +13 -0
- data/lib/resources/revealjs/plugin/multiplex/index.js +56 -0
- data/lib/resources/revealjs/plugin/multiplex/master.js +51 -0
- data/lib/resources/revealjs/plugin/notes-server/client.js +57 -0
- data/lib/resources/revealjs/plugin/notes-server/index.js +59 -0
- data/lib/resources/revealjs/plugin/notes-server/notes.html +142 -0
- data/lib/resources/revealjs/plugin/notes/notes.html +267 -0
- data/lib/resources/revealjs/plugin/notes/notes.js +78 -0
- data/lib/resources/revealjs/plugin/postmessage/example.html +39 -0
- data/lib/resources/revealjs/plugin/postmessage/postmessage.js +42 -0
- data/lib/resources/revealjs/plugin/print-pdf/print-pdf.js +44 -0
- data/lib/resources/revealjs/plugin/remotes/remotes.js +39 -0
- data/lib/resources/revealjs/plugin/search/search.js +196 -0
- data/lib/resources/revealjs/plugin/zoom-js/zoom.js +258 -0
- data/lib/resources/styles/asciidoctor.css +652 -0
- data/lib/resources/styles/colony.css +660 -0
- data/lib/resources/styles/foundation-lime.css +657 -0
- data/lib/resources/styles/foundation-potion.css +657 -0
- data/lib/resources/styles/foundation.css +648 -0
- data/lib/resources/styles/github.css +669 -0
- data/lib/resources/styles/golo.css +669 -0
- data/lib/resources/styles/iconic.css +692 -0
- data/lib/resources/styles/maker.css +668 -0
- data/lib/resources/styles/readthedocs.css +669 -0
- data/lib/resources/styles/redhat.css +654 -0
- data/lib/resources/styles/riak.css +689 -0
- data/lib/resources/styles/rocket-panda.css +662 -0
- data/lib/resources/styles/rubygems.css +650 -0
- data/lib/templates/_config.yml +27 -0
- data/lib/templates/{training → book}/GemFile +2 -1
- data/lib/templates/{training → book}/development/audio/ocean_waves.mp3 +0 -0
- data/lib/templates/book/development/book.adoc +121 -0
- data/lib/templates/{training → book}/development/image/hyla_frog.jpg +0 -0
- data/lib/templates/{training → book}/development/video/small.ogv +0 -0
- data/lib/templates/{training → book}/introduction/audio/ocean_waves.mp3 +0 -0
- data/lib/templates/book/introduction/book.adoc +121 -0
- data/lib/templates/{training → book}/introduction/image/hyla_frog.jpg +0 -0
- data/lib/templates/{training → book}/introduction/video/small.ogv +0 -0
- data/lib/templates/book/readme.adoc +10 -0
- data/lib/templates/sample/asciidoc_article.adoc +101 -10
- data/lib/templates/sample/asciidoc_audio.adoc +1 -1
- data/lib/templates/sample/asciidoc_book.adoc +125 -0
- data/lib/templates/sample/asciidoc_image.adoc +26 -0
- data/lib/templates/sample/asciidoc_report.adoc +66 -0
- data/lib/templates/sample/asciidoc_source.adoc +53 -0
- data/lib/templates/sample/asciidoc_table.adoc +36 -0
- data/lib/templates/sample/asciidoc_video.adoc +9 -1
- data/lib/templates/sample/slideshow_revealjs.adoc +26 -0
- data/lib/templates/training-exercises/_config.yml +3 -0
- data/lib/templates/training/{introduction → module-1}/article.adoc +7 -2
- data/lib/templates/training/module-1/audio/ocean_waves.mp3 +0 -0
- data/lib/templates/training/module-1/image/hyla_arborea.jpg +0 -0
- data/lib/templates/training/module-1/video/small.ogv +0 -0
- data/lib/templates/training/{development → module-2}/article.adoc +7 -2
- data/lib/templates/training/module-2/audio/ocean_waves.mp3 +0 -0
- data/lib/templates/training/module-2/image/hyla_arborea.jpg +0 -0
- data/lib/templates/training/module-2/video/small.ogv +0 -0
- data/lib/templates/training/readme.adoc +10 -1
- data/scenario.adoc +113 -20
- data/test/reports/test-1.0.x-11-12-2013.txt +123 -0
- data/todo.adoc +39 -0
- metadata +473 -51
- data/lib/hyla/training.rb +0 -25
- data/lib/templates/sample/asciidoc_source_highlight.adoc +0 -37
- data/lib/templates/training-exercises/Gemfile +0 -4
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* Touch-based remote controller for your presentation courtesy
|
3
|
+
* of the folks at http://remotes.io
|
4
|
+
*/
|
5
|
+
|
6
|
+
(function(window){
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Detects if we are dealing with a touch enabled device (with some false positives)
|
10
|
+
* Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js
|
11
|
+
*/
|
12
|
+
var hasTouch = (function(){
|
13
|
+
return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
|
14
|
+
})();
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Detects if notes are enable and the current page is opened inside an /iframe
|
18
|
+
* this prevents loading Remotes.io several times
|
19
|
+
*/
|
20
|
+
var isNotesAndIframe = (function(){
|
21
|
+
return window.RevealNotes && !(self == top);
|
22
|
+
})();
|
23
|
+
|
24
|
+
if(!hasTouch && !isNotesAndIframe){
|
25
|
+
head.ready( 'remotes.ne.min.js', function() {
|
26
|
+
new Remotes("preview")
|
27
|
+
.on("swipe-left", function(e){ Reveal.right(); })
|
28
|
+
.on("swipe-right", function(e){ Reveal.left(); })
|
29
|
+
.on("swipe-up", function(e){ Reveal.down(); })
|
30
|
+
.on("swipe-down", function(e){ Reveal.up(); })
|
31
|
+
.on("tap", function(e){ Reveal.next(); })
|
32
|
+
.on("zoom-out", function(e){ Reveal.toggleOverview(true); })
|
33
|
+
.on("zoom-in", function(e){ Reveal.toggleOverview(false); })
|
34
|
+
;
|
35
|
+
} );
|
36
|
+
|
37
|
+
head.js('https://hakim-static.s3.amazonaws.com/reveal-js/remotes.ne.min.js');
|
38
|
+
}
|
39
|
+
})(window);
|
@@ -0,0 +1,196 @@
|
|
1
|
+
/*
|
2
|
+
* Handles finding a text string anywhere in the slides and showing the next occurrence to the user
|
3
|
+
* by navigatating to that slide and highlighting it.
|
4
|
+
*
|
5
|
+
* By Jon Snyder <snyder.jon@gmail.com>, February 2013
|
6
|
+
*/
|
7
|
+
|
8
|
+
var RevealSearch = (function() {
|
9
|
+
|
10
|
+
var matchedSlides;
|
11
|
+
var currentMatchedIndex;
|
12
|
+
var searchboxDirty;
|
13
|
+
var myHilitor;
|
14
|
+
|
15
|
+
// Original JavaScript code by Chirp Internet: www.chirp.com.au
|
16
|
+
// Please acknowledge use of this code by including this header.
|
17
|
+
// 2/2013 jon: modified regex to display any match, not restricted to word boundaries.
|
18
|
+
|
19
|
+
function Hilitor(id, tag)
|
20
|
+
{
|
21
|
+
|
22
|
+
var targetNode = document.getElementById(id) || document.body;
|
23
|
+
var hiliteTag = tag || "EM";
|
24
|
+
var skipTags = new RegExp("^(?:" + hiliteTag + "|SCRIPT|FORM|SPAN)$");
|
25
|
+
var colors = ["#ff6", "#a0ffff", "#9f9", "#f99", "#f6f"];
|
26
|
+
var wordColor = [];
|
27
|
+
var colorIdx = 0;
|
28
|
+
var matchRegex = "";
|
29
|
+
var matchingSlides = [];
|
30
|
+
|
31
|
+
this.setRegex = function(input)
|
32
|
+
{
|
33
|
+
input = input.replace(/^[^\w]+|[^\w]+$/g, "").replace(/[^\w'-]+/g, "|");
|
34
|
+
matchRegex = new RegExp("(" + input + ")","i");
|
35
|
+
}
|
36
|
+
|
37
|
+
this.getRegex = function()
|
38
|
+
{
|
39
|
+
return matchRegex.toString().replace(/^\/\\b\(|\)\\b\/i$/g, "").replace(/\|/g, " ");
|
40
|
+
}
|
41
|
+
|
42
|
+
// recursively apply word highlighting
|
43
|
+
this.hiliteWords = function(node)
|
44
|
+
{
|
45
|
+
if(node == undefined || !node) return;
|
46
|
+
if(!matchRegex) return;
|
47
|
+
if(skipTags.test(node.nodeName)) return;
|
48
|
+
|
49
|
+
if(node.hasChildNodes()) {
|
50
|
+
for(var i=0; i < node.childNodes.length; i++)
|
51
|
+
this.hiliteWords(node.childNodes[i]);
|
52
|
+
}
|
53
|
+
if(node.nodeType == 3) { // NODE_TEXT
|
54
|
+
if((nv = node.nodeValue) && (regs = matchRegex.exec(nv))) {
|
55
|
+
//find the slide's section element and save it in our list of matching slides
|
56
|
+
var secnode = node.parentNode;
|
57
|
+
while (secnode.nodeName != 'SECTION') {
|
58
|
+
secnode = secnode.parentNode;
|
59
|
+
}
|
60
|
+
|
61
|
+
var slideIndex = Reveal.getIndices(secnode);
|
62
|
+
var slidelen = matchingSlides.length;
|
63
|
+
var alreadyAdded = false;
|
64
|
+
for (var i=0; i < slidelen; i++) {
|
65
|
+
if ( (matchingSlides[i].h === slideIndex.h) && (matchingSlides[i].v === slideIndex.v) ) {
|
66
|
+
alreadyAdded = true;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
if (! alreadyAdded) {
|
70
|
+
matchingSlides.push(slideIndex);
|
71
|
+
}
|
72
|
+
|
73
|
+
if(!wordColor[regs[0].toLowerCase()]) {
|
74
|
+
wordColor[regs[0].toLowerCase()] = colors[colorIdx++ % colors.length];
|
75
|
+
}
|
76
|
+
|
77
|
+
var match = document.createElement(hiliteTag);
|
78
|
+
match.appendChild(document.createTextNode(regs[0]));
|
79
|
+
match.style.backgroundColor = wordColor[regs[0].toLowerCase()];
|
80
|
+
match.style.fontStyle = "inherit";
|
81
|
+
match.style.color = "#000";
|
82
|
+
|
83
|
+
var after = node.splitText(regs.index);
|
84
|
+
after.nodeValue = after.nodeValue.substring(regs[0].length);
|
85
|
+
node.parentNode.insertBefore(match, after);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
};
|
89
|
+
|
90
|
+
// remove highlighting
|
91
|
+
this.remove = function()
|
92
|
+
{
|
93
|
+
var arr = document.getElementsByTagName(hiliteTag);
|
94
|
+
while(arr.length && (el = arr[0])) {
|
95
|
+
el.parentNode.replaceChild(el.firstChild, el);
|
96
|
+
}
|
97
|
+
};
|
98
|
+
|
99
|
+
// start highlighting at target node
|
100
|
+
this.apply = function(input)
|
101
|
+
{
|
102
|
+
if(input == undefined || !input) return;
|
103
|
+
this.remove();
|
104
|
+
this.setRegex(input);
|
105
|
+
this.hiliteWords(targetNode);
|
106
|
+
return matchingSlides;
|
107
|
+
};
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
function openSearch() {
|
112
|
+
//ensure the search term input dialog is visible and has focus:
|
113
|
+
var inputbox = document.getElementById("searchinput");
|
114
|
+
inputbox.style.display = "inline";
|
115
|
+
inputbox.focus();
|
116
|
+
inputbox.select();
|
117
|
+
}
|
118
|
+
|
119
|
+
function toggleSearch() {
|
120
|
+
var inputbox = document.getElementById("searchinput");
|
121
|
+
if (inputbox.style.display !== "inline") {
|
122
|
+
openSearch();
|
123
|
+
}
|
124
|
+
else {
|
125
|
+
inputbox.style.display = "none";
|
126
|
+
myHilitor.remove();
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
function doSearch() {
|
131
|
+
//if there's been a change in the search term, perform a new search:
|
132
|
+
if (searchboxDirty) {
|
133
|
+
var searchstring = document.getElementById("searchinput").value;
|
134
|
+
|
135
|
+
//find the keyword amongst the slides
|
136
|
+
myHilitor = new Hilitor("slidecontent");
|
137
|
+
matchedSlides = myHilitor.apply(searchstring);
|
138
|
+
currentMatchedIndex = 0;
|
139
|
+
}
|
140
|
+
|
141
|
+
//navigate to the next slide that has the keyword, wrapping to the first if necessary
|
142
|
+
if (matchedSlides.length && (matchedSlides.length <= currentMatchedIndex)) {
|
143
|
+
currentMatchedIndex = 0;
|
144
|
+
}
|
145
|
+
if (matchedSlides.length > currentMatchedIndex) {
|
146
|
+
Reveal.slide(matchedSlides[currentMatchedIndex].h, matchedSlides[currentMatchedIndex].v);
|
147
|
+
currentMatchedIndex++;
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
var dom = {};
|
152
|
+
dom.wrapper = document.querySelector( '.reveal' );
|
153
|
+
|
154
|
+
if( !dom.wrapper.querySelector( '.searchbox' ) ) {
|
155
|
+
var searchElement = document.createElement( 'div' );
|
156
|
+
searchElement.id = "searchinputdiv";
|
157
|
+
searchElement.classList.add( 'searchdiv' );
|
158
|
+
searchElement.style.position = 'absolute';
|
159
|
+
searchElement.style.top = '10px';
|
160
|
+
searchElement.style.left = '10px';
|
161
|
+
//embedded base64 search icon Designed by Sketchdock - http://www.sketchdock.com/:
|
162
|
+
searchElement.innerHTML = '<span><input type="search" id="searchinput" class="searchinput" style="vertical-align: top;"/><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJiSURBVHjatFZNaxNBGH5md+Mmu92NVdKDRipSAyqCghgQD4L4cRe86UUtAQ+eFCxoa4/25EXBFi8eBE+eRPoDhB6KgiiixdAPCEkx2pjvTXadd9yNsflwuyUDD/O+u8PzzDPvzOwyx3EwyCZhwG3gAkp7MnpjgbopjsltcD4gjuXZZKeAR348MYLYTm3LzOs/y3j3JTfZxgXWXmTuwPHIc4VmoOmv5IrI53+AO2DdHLjkDWQ3GoEEVFXtXQOvkSnPWcyUceviLhwbDYv8/XIVj97kse7TodLvZXxYxrPUHkQ1ufXs3FEdybEIxucySOesoNvUgWU1cP3MkCBfTFdw9fGaAMVmRELq7LBw2Q3/FaAxxWIRpw+ZIr/7IouPqzUBiqmdHAv7EuhRAwf1er2Vy4x1jW3b2d5Jfvu5IPp7l2LYbcgCFFNb+FoJ7oBqEAqFMPNqFcmEgVMJDfMT+1tvN0pNjERlMS6QA5pFOKxiKVPFhakPeL3It+WGJUDxt2wFR+JhzI7v5ctkd8DXOZAkCYYxhO+lKm4+Xfqz/rIixBuNBl7eOYzkQQNzqX249mRl6zUgEcYkaJrGhUwBinVdh6IouPzwE6/DL5w4oLkH8y981aDf+uq6hlKpJESiUdNfDZi7/ehG9K6KfiA3pml0PLcsq+cSMTj2NL9ukc4UOmz7AZ3+crkC4mHujFvXNaMFB3bEr8xPS6p5O+jXxq4VZtaen7/PwzrntjcLUE0iHPS1Ud1cdiEJl/8WivZk0wXd7zWOMkeF8s0CcAmkNrC2nvXZDbbbN73ccYnZoH9bfgswAFzAe9/h3dbKAAAAAElFTkSuQmCC" id="searchbutton" class="searchicon" style="vertical-align: top; margin-top: -1px;"/></span>';
|
163
|
+
dom.wrapper.appendChild( searchElement );
|
164
|
+
}
|
165
|
+
|
166
|
+
document.getElementById("searchbutton").addEventListener( 'click', function(event) {
|
167
|
+
doSearch();
|
168
|
+
}, false );
|
169
|
+
|
170
|
+
document.getElementById("searchinput").addEventListener( 'keyup', function( event ) {
|
171
|
+
switch (event.keyCode) {
|
172
|
+
case 13:
|
173
|
+
event.preventDefault();
|
174
|
+
doSearch();
|
175
|
+
searchboxDirty = false;
|
176
|
+
break;
|
177
|
+
default:
|
178
|
+
searchboxDirty = true;
|
179
|
+
}
|
180
|
+
}, false );
|
181
|
+
|
182
|
+
// Open the search when the 's' key is hit (yes, this conflicts with the notes plugin, disabling for now)
|
183
|
+
/*
|
184
|
+
document.addEventListener( 'keydown', function( event ) {
|
185
|
+
// Disregard the event if the target is editable or a
|
186
|
+
// modifier is present
|
187
|
+
if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
|
188
|
+
|
189
|
+
if( event.keyCode === 83 ) {
|
190
|
+
event.preventDefault();
|
191
|
+
openSearch();
|
192
|
+
}
|
193
|
+
}, false );
|
194
|
+
*/
|
195
|
+
return { open: openSearch };
|
196
|
+
})();
|
@@ -0,0 +1,258 @@
|
|
1
|
+
// Custom reveal.js integration
|
2
|
+
(function(){
|
3
|
+
var isEnabled = true;
|
4
|
+
|
5
|
+
document.querySelector( '.reveal' ).addEventListener( 'mousedown', function( event ) {
|
6
|
+
var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : 'alt' ) + 'Key';
|
7
|
+
|
8
|
+
if( event[ modifier ] && isEnabled ) {
|
9
|
+
event.preventDefault();
|
10
|
+
zoom.to({ element: event.target, pan: false });
|
11
|
+
}
|
12
|
+
} );
|
13
|
+
|
14
|
+
Reveal.addEventListener( 'overviewshown', function() { isEnabled = false; } );
|
15
|
+
Reveal.addEventListener( 'overviewhidden', function() { isEnabled = true; } );
|
16
|
+
})();
|
17
|
+
|
18
|
+
/*!
|
19
|
+
* zoom.js 0.2 (modified version for use with reveal.js)
|
20
|
+
* http://lab.hakim.se/zoom-js
|
21
|
+
* MIT licensed
|
22
|
+
*
|
23
|
+
* Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
|
24
|
+
*/
|
25
|
+
var zoom = (function(){
|
26
|
+
|
27
|
+
// The current zoom level (scale)
|
28
|
+
var level = 1;
|
29
|
+
|
30
|
+
// The current mouse position, used for panning
|
31
|
+
var mouseX = 0,
|
32
|
+
mouseY = 0;
|
33
|
+
|
34
|
+
// Timeout before pan is activated
|
35
|
+
var panEngageTimeout = -1,
|
36
|
+
panUpdateInterval = -1;
|
37
|
+
|
38
|
+
var currentOptions = null;
|
39
|
+
|
40
|
+
// Check for transform support so that we can fallback otherwise
|
41
|
+
var supportsTransforms = 'WebkitTransform' in document.body.style ||
|
42
|
+
'MozTransform' in document.body.style ||
|
43
|
+
'msTransform' in document.body.style ||
|
44
|
+
'OTransform' in document.body.style ||
|
45
|
+
'transform' in document.body.style;
|
46
|
+
|
47
|
+
if( supportsTransforms ) {
|
48
|
+
// The easing that will be applied when we zoom in/out
|
49
|
+
document.body.style.transition = 'transform 0.8s ease';
|
50
|
+
document.body.style.OTransition = '-o-transform 0.8s ease';
|
51
|
+
document.body.style.msTransition = '-ms-transform 0.8s ease';
|
52
|
+
document.body.style.MozTransition = '-moz-transform 0.8s ease';
|
53
|
+
document.body.style.WebkitTransition = '-webkit-transform 0.8s ease';
|
54
|
+
}
|
55
|
+
|
56
|
+
// Zoom out if the user hits escape
|
57
|
+
document.addEventListener( 'keyup', function( event ) {
|
58
|
+
if( level !== 1 && event.keyCode === 27 ) {
|
59
|
+
zoom.out();
|
60
|
+
}
|
61
|
+
}, false );
|
62
|
+
|
63
|
+
// Monitor mouse movement for panning
|
64
|
+
document.addEventListener( 'mousemove', function( event ) {
|
65
|
+
if( level !== 1 ) {
|
66
|
+
mouseX = event.clientX;
|
67
|
+
mouseY = event.clientY;
|
68
|
+
}
|
69
|
+
}, false );
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Applies the CSS required to zoom in, prioritizes use of CSS3
|
73
|
+
* transforms but falls back on zoom for IE.
|
74
|
+
*
|
75
|
+
* @param {Number} pageOffsetX
|
76
|
+
* @param {Number} pageOffsetY
|
77
|
+
* @param {Number} elementOffsetX
|
78
|
+
* @param {Number} elementOffsetY
|
79
|
+
* @param {Number} scale
|
80
|
+
*/
|
81
|
+
function magnify( pageOffsetX, pageOffsetY, elementOffsetX, elementOffsetY, scale ) {
|
82
|
+
|
83
|
+
if( supportsTransforms ) {
|
84
|
+
var origin = pageOffsetX +'px '+ pageOffsetY +'px',
|
85
|
+
transform = 'translate('+ -elementOffsetX +'px,'+ -elementOffsetY +'px) scale('+ scale +')';
|
86
|
+
|
87
|
+
document.body.style.transformOrigin = origin;
|
88
|
+
document.body.style.OTransformOrigin = origin;
|
89
|
+
document.body.style.msTransformOrigin = origin;
|
90
|
+
document.body.style.MozTransformOrigin = origin;
|
91
|
+
document.body.style.WebkitTransformOrigin = origin;
|
92
|
+
|
93
|
+
document.body.style.transform = transform;
|
94
|
+
document.body.style.OTransform = transform;
|
95
|
+
document.body.style.msTransform = transform;
|
96
|
+
document.body.style.MozTransform = transform;
|
97
|
+
document.body.style.WebkitTransform = transform;
|
98
|
+
}
|
99
|
+
else {
|
100
|
+
// Reset all values
|
101
|
+
if( scale === 1 ) {
|
102
|
+
document.body.style.position = '';
|
103
|
+
document.body.style.left = '';
|
104
|
+
document.body.style.top = '';
|
105
|
+
document.body.style.width = '';
|
106
|
+
document.body.style.height = '';
|
107
|
+
document.body.style.zoom = '';
|
108
|
+
}
|
109
|
+
// Apply scale
|
110
|
+
else {
|
111
|
+
document.body.style.position = 'relative';
|
112
|
+
document.body.style.left = ( - ( pageOffsetX + elementOffsetX ) / scale ) + 'px';
|
113
|
+
document.body.style.top = ( - ( pageOffsetY + elementOffsetY ) / scale ) + 'px';
|
114
|
+
document.body.style.width = ( scale * 100 ) + '%';
|
115
|
+
document.body.style.height = ( scale * 100 ) + '%';
|
116
|
+
document.body.style.zoom = scale;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
level = scale;
|
121
|
+
|
122
|
+
if( level !== 1 && document.documentElement.classList ) {
|
123
|
+
document.documentElement.classList.add( 'zoomed' );
|
124
|
+
}
|
125
|
+
else {
|
126
|
+
document.documentElement.classList.remove( 'zoomed' );
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Pan the document when the mosue cursor approaches the edges
|
132
|
+
* of the window.
|
133
|
+
*/
|
134
|
+
function pan() {
|
135
|
+
var range = 0.12,
|
136
|
+
rangeX = window.innerWidth * range,
|
137
|
+
rangeY = window.innerHeight * range,
|
138
|
+
scrollOffset = getScrollOffset();
|
139
|
+
|
140
|
+
// Up
|
141
|
+
if( mouseY < rangeY ) {
|
142
|
+
window.scroll( scrollOffset.x, scrollOffset.y - ( 1 - ( mouseY / rangeY ) ) * ( 14 / level ) );
|
143
|
+
}
|
144
|
+
// Down
|
145
|
+
else if( mouseY > window.innerHeight - rangeY ) {
|
146
|
+
window.scroll( scrollOffset.x, scrollOffset.y + ( 1 - ( window.innerHeight - mouseY ) / rangeY ) * ( 14 / level ) );
|
147
|
+
}
|
148
|
+
|
149
|
+
// Left
|
150
|
+
if( mouseX < rangeX ) {
|
151
|
+
window.scroll( scrollOffset.x - ( 1 - ( mouseX / rangeX ) ) * ( 14 / level ), scrollOffset.y );
|
152
|
+
}
|
153
|
+
// Right
|
154
|
+
else if( mouseX > window.innerWidth - rangeX ) {
|
155
|
+
window.scroll( scrollOffset.x + ( 1 - ( window.innerWidth - mouseX ) / rangeX ) * ( 14 / level ), scrollOffset.y );
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
function getScrollOffset() {
|
160
|
+
return {
|
161
|
+
x: window.scrollX !== undefined ? window.scrollX : window.pageXOffset,
|
162
|
+
y: window.scrollY !== undefined ? window.scrollY : window.pageXYffset
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
return {
|
167
|
+
/**
|
168
|
+
* Zooms in on either a rectangle or HTML element.
|
169
|
+
*
|
170
|
+
* @param {Object} options
|
171
|
+
* - element: HTML element to zoom in on
|
172
|
+
* OR
|
173
|
+
* - x/y: coordinates in non-transformed space to zoom in on
|
174
|
+
* - width/height: the portion of the screen to zoom in on
|
175
|
+
* - scale: can be used instead of width/height to explicitly set scale
|
176
|
+
*/
|
177
|
+
to: function( options ) {
|
178
|
+
// Due to an implementation limitation we can't zoom in
|
179
|
+
// to another element without zooming out first
|
180
|
+
if( level !== 1 ) {
|
181
|
+
zoom.out();
|
182
|
+
}
|
183
|
+
else {
|
184
|
+
options.x = options.x || 0;
|
185
|
+
options.y = options.y || 0;
|
186
|
+
|
187
|
+
// If an element is set, that takes precedence
|
188
|
+
if( !!options.element ) {
|
189
|
+
// Space around the zoomed in element to leave on screen
|
190
|
+
var padding = 20;
|
191
|
+
|
192
|
+
options.width = options.element.getBoundingClientRect().width + ( padding * 2 );
|
193
|
+
options.height = options.element.getBoundingClientRect().height + ( padding * 2 );
|
194
|
+
options.x = options.element.getBoundingClientRect().left - padding;
|
195
|
+
options.y = options.element.getBoundingClientRect().top - padding;
|
196
|
+
}
|
197
|
+
|
198
|
+
// If width/height values are set, calculate scale from those values
|
199
|
+
if( options.width !== undefined && options.height !== undefined ) {
|
200
|
+
options.scale = Math.max( Math.min( window.innerWidth / options.width, window.innerHeight / options.height ), 1 );
|
201
|
+
}
|
202
|
+
|
203
|
+
if( options.scale > 1 ) {
|
204
|
+
options.x *= options.scale;
|
205
|
+
options.y *= options.scale;
|
206
|
+
|
207
|
+
var scrollOffset = getScrollOffset();
|
208
|
+
|
209
|
+
if( options.element ) {
|
210
|
+
scrollOffset.x -= ( window.innerWidth - ( options.width * options.scale ) ) / 2;
|
211
|
+
}
|
212
|
+
|
213
|
+
magnify( scrollOffset.x, scrollOffset.y, options.x, options.y, options.scale );
|
214
|
+
|
215
|
+
if( options.pan !== false ) {
|
216
|
+
|
217
|
+
// Wait with engaging panning as it may conflict with the
|
218
|
+
// zoom transition
|
219
|
+
panEngageTimeout = setTimeout( function() {
|
220
|
+
panUpdateInterval = setInterval( pan, 1000 / 60 );
|
221
|
+
}, 800 );
|
222
|
+
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
currentOptions = options;
|
227
|
+
}
|
228
|
+
},
|
229
|
+
|
230
|
+
/**
|
231
|
+
* Resets the document zoom state to its default.
|
232
|
+
*/
|
233
|
+
out: function() {
|
234
|
+
clearTimeout( panEngageTimeout );
|
235
|
+
clearInterval( panUpdateInterval );
|
236
|
+
|
237
|
+
var scrollOffset = getScrollOffset();
|
238
|
+
|
239
|
+
if( currentOptions && currentOptions.element ) {
|
240
|
+
scrollOffset.x -= ( window.innerWidth - ( currentOptions.width * currentOptions.scale ) ) / 2;
|
241
|
+
}
|
242
|
+
|
243
|
+
magnify( scrollOffset.x, scrollOffset.y, 0, 0, 1 );
|
244
|
+
|
245
|
+
level = 1;
|
246
|
+
},
|
247
|
+
|
248
|
+
// Alias
|
249
|
+
magnify: function( options ) { this.to( options ) },
|
250
|
+
reset: function() { this.out() },
|
251
|
+
|
252
|
+
zoomLevel: function() {
|
253
|
+
return level;
|
254
|
+
}
|
255
|
+
}
|
256
|
+
|
257
|
+
})();
|
258
|
+
|