├── .gitignore ├── sample ├── extensions │ ├── hash │ │ ├── deck.hash.html │ │ ├── deck.hash.css │ │ ├── deck.hash.scss │ │ └── deck.hash.js │ ├── status │ │ ├── deck.status.html │ │ ├── deck.status.css │ │ ├── deck.status.scss │ │ └── deck.status.js │ ├── navigation │ │ ├── deck.navigation.html │ │ ├── deck.navigation.scss │ │ ├── deck.navigation.css │ │ └── deck.navigation.js │ ├── goto │ │ ├── deck.goto.html │ │ ├── deck.goto.scss │ │ ├── deck.goto.css │ │ └── deck.goto.js │ ├── scale │ │ ├── deck.scale.scss │ │ ├── deck.scale.css │ │ └── deck.scale.js │ ├── menu │ │ ├── deck.menu.scss │ │ ├── deck.menu.css │ │ └── deck.menu.js │ └── markdown │ │ └── deck.markdown.js ├── js │ ├── test.js │ └── modernizr.custom.js ├── core │ ├── deck.core.html │ ├── deck.core.scss │ ├── deck.core.css │ └── deck.core.js ├── themes │ ├── style │ │ ├── swiss.scss │ │ ├── swiss.css │ │ ├── neon.scss │ │ ├── neon.css │ │ ├── web-2.0.scss │ │ └── web-2.0.css │ └── transition │ │ ├── fade.scss │ │ ├── fade.css │ │ ├── horizontal-slide.scss │ │ ├── vertical-slide.scss │ │ ├── horizontal-slide.css │ │ └── vertical-slide.css └── testdeck.html ├── deck.markdown.js ├── deck.markdown.js └── Markdown.Converter.js └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .sass-cache/ 3 | progress/ 4 | .idea/ -------------------------------------------------------------------------------- /sample/extensions/hash/deck.hash.html: -------------------------------------------------------------------------------- 1 | 2 | # -------------------------------------------------------------------------------- /sample/extensions/status/deck.status.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | / 5 | 6 |
-------------------------------------------------------------------------------- /sample/extensions/navigation/deck.navigation.html: -------------------------------------------------------------------------------- 1 | 2 | ← 3 | → -------------------------------------------------------------------------------- /sample/extensions/status/deck.status.css: -------------------------------------------------------------------------------- 1 | .deck-container .deck-status { 2 | position: absolute; 3 | bottom: 10px; 4 | right: 5px; 5 | color: #888; 6 | z-index: 3; 7 | margin: 0; 8 | } 9 | 10 | @media print { 11 | .deck-status { 12 | display: none; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sample/extensions/status/deck.status.scss: -------------------------------------------------------------------------------- 1 | .deck-container { 2 | .deck-status { 3 | position:absolute; 4 | bottom:10px; 5 | right:5px; 6 | color:#888; 7 | z-index:3; 8 | margin:0; 9 | } 10 | } 11 | 12 | @media print { 13 | .deck-status { 14 | display:none; 15 | } 16 | } -------------------------------------------------------------------------------- /sample/extensions/goto/deck.goto.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/extensions/hash/deck.hash.css: -------------------------------------------------------------------------------- 1 | .deck-container .deck-permalink { 2 | display: none; 3 | position: absolute; 4 | z-index: 4; 5 | bottom: 30px; 6 | right: 0; 7 | width: 48px; 8 | text-align: center; 9 | } 10 | 11 | .no-history .deck-container:hover .deck-permalink { 12 | display: block; 13 | } 14 | -------------------------------------------------------------------------------- /sample/extensions/hash/deck.hash.scss: -------------------------------------------------------------------------------- 1 | .deck-container { 2 | .deck-permalink { 3 | display:none; 4 | position:absolute; 5 | z-index:4; 6 | bottom:30px; 7 | right:0; 8 | width:48px; 9 | text-align:center; 10 | } 11 | } 12 | 13 | .no-history .deck-container:hover .deck-permalink { 14 | display:block; 15 | } -------------------------------------------------------------------------------- /sample/js/test.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $.deck('.slide'); 3 | 4 | $('#style-themes').change(function() { 5 | $('#style-theme-link').attr('href', $(this).val()); 6 | }); 7 | 8 | $('#transition-themes').change(function() { 9 | $('#transition-theme-link').attr('href', $(this).val()); 10 | }); 11 | }); 12 | 13 | -------------------------------------------------------------------------------- /sample/extensions/scale/deck.scale.scss: -------------------------------------------------------------------------------- 1 | .csstransforms .deck-container.deck-scale { 2 | width:auto; 3 | -webkit-transform-origin: 50% 0; 4 | -moz-transform-origin: 50% 0; 5 | -o-transform-origin: 50% 0; 6 | -ms-transform-origin: 50% 0; 7 | transform-origin: 50% 0; 8 | 9 | &.deck-menu { 10 | width:70%; 11 | -webkit-transform:none !important; 12 | -moz-transform:none !important; 13 | -o-transform:none !important; 14 | -ms-transform:none !important; 15 | transform:none !important; 16 | } 17 | } -------------------------------------------------------------------------------- /sample/extensions/menu/deck.menu.scss: -------------------------------------------------------------------------------- 1 | .deck-menu { 2 | > .slide { 3 | float:left; 4 | width:22%; 5 | height:22%; 6 | min-height:0; 7 | margin:1%; 8 | font-size:0.22em; 9 | overflow:hidden; 10 | padding:0 0.5%; 11 | } 12 | 13 | .slide { 14 | background:#eee; 15 | position:relative; 16 | left:0; 17 | top:0; 18 | visibility:visible; 19 | cursor:pointer; 20 | } 21 | 22 | iframe, img, video { 23 | max-width:100%; 24 | } 25 | 26 | .deck-current, .no-touch & .slide:hover { 27 | background:#ddf; 28 | } 29 | } -------------------------------------------------------------------------------- /sample/extensions/scale/deck.scale.css: -------------------------------------------------------------------------------- 1 | .csstransforms .deck-container.deck-scale { 2 | width: auto; 3 | -webkit-transform-origin: 50% 0; 4 | -moz-transform-origin: 50% 0; 5 | -o-transform-origin: 50% 0; 6 | -ms-transform-origin: 50% 0; 7 | transform-origin: 50% 0; 8 | } 9 | .csstransforms .deck-container.deck-scale.deck-menu { 10 | width: 70%; 11 | -webkit-transform: none !important; 12 | -moz-transform: none !important; 13 | -o-transform: none !important; 14 | -ms-transform: none !important; 15 | transform: none !important; 16 | } 17 | -------------------------------------------------------------------------------- /sample/extensions/menu/deck.menu.css: -------------------------------------------------------------------------------- 1 | .deck-menu > .slide { 2 | float: left; 3 | width: 22%; 4 | height: 22%; 5 | min-height: 0; 6 | margin: 1%; 7 | font-size: 0.22em; 8 | overflow: hidden; 9 | padding: 0 0.5%; 10 | } 11 | .deck-menu .slide { 12 | background: #eee; 13 | position: relative; 14 | left: 0; 15 | top: 0; 16 | visibility: visible; 17 | cursor: pointer; 18 | } 19 | .deck-menu iframe, .deck-menu img, .deck-menu video { 20 | max-width: 100%; 21 | } 22 | .deck-menu .deck-current, .no-touch .deck-menu .slide:hover { 23 | background: #ddf; 24 | } 25 | -------------------------------------------------------------------------------- /sample/extensions/goto/deck.goto.scss: -------------------------------------------------------------------------------- 1 | .deck-container { 2 | .goto-form { 3 | position:absolute; 4 | z-index:3; 5 | bottom:10px; 6 | left:50%; 7 | height:1.75em; 8 | margin:0 0 0 -7.125em; 9 | line-height:1.75em; 10 | padding:0.625em; 11 | display:none; 12 | background:#ccc; 13 | overflow:hidden; 14 | 15 | .borderradius & { 16 | -webkit-border-radius:10px; 17 | -moz-border-radius:10px; 18 | border-radius:10px; 19 | } 20 | 21 | label { 22 | font-weight:bold; 23 | } 24 | 25 | label, input { 26 | display:inline-block; 27 | font-family:inherit; 28 | } 29 | } 30 | } 31 | 32 | .deck-goto .goto-form { 33 | display:block; 34 | } 35 | 36 | #goto-slide { 37 | width:4.375em; 38 | margin:0 0.625em; 39 | height:1.4375em; 40 | } 41 | 42 | @media print { 43 | .goto-form, #goto-slide { 44 | display:none !important; 45 | } 46 | } -------------------------------------------------------------------------------- /sample/extensions/goto/deck.goto.css: -------------------------------------------------------------------------------- 1 | .deck-container .goto-form { 2 | position: absolute; 3 | z-index: 3; 4 | bottom: 10px; 5 | left: 50%; 6 | height: 1.75em; 7 | margin: 0 0 0 -7.125em; 8 | line-height: 1.75em; 9 | padding: 0.625em; 10 | display: none; 11 | background: #ccc; 12 | overflow: hidden; 13 | } 14 | .borderradius .deck-container .goto-form { 15 | -webkit-border-radius: 10px; 16 | -moz-border-radius: 10px; 17 | border-radius: 10px; 18 | } 19 | .deck-container .goto-form label { 20 | font-weight: bold; 21 | } 22 | .deck-container .goto-form label, .deck-container .goto-form input { 23 | display: inline-block; 24 | font-family: inherit; 25 | } 26 | 27 | .deck-goto .goto-form { 28 | display: block; 29 | } 30 | 31 | #goto-slide { 32 | width: 4.375em; 33 | margin: 0 0.625em; 34 | height: 1.4375em; 35 | } 36 | 37 | @media print { 38 | .goto-form, #goto-slide { 39 | display: none !important; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /sample/extensions/navigation/deck.navigation.scss: -------------------------------------------------------------------------------- 1 | @mixin border-radius($r) { 2 | -webkit-border-radius:$r; 3 | -moz-border-radius:$r; 4 | border-radius:$r; 5 | } 6 | 7 | .deck-container { 8 | .deck-prev-link, .deck-next-link { 9 | display:none; 10 | position:absolute; 11 | z-index:3; 12 | top:50%; 13 | width:32px; 14 | height:32px; 15 | margin-top:-16px; 16 | font-size:20px; 17 | font-weight:bold; 18 | line-height:32px; 19 | vertical-align:middle; 20 | text-align:center; 21 | text-decoration:none; 22 | color:#fff; 23 | background:#888; 24 | 25 | .borderradius & { 26 | @include border-radius(16px); 27 | } 28 | 29 | &:hover, &:focus, &:active, &:visited { 30 | color:#fff; 31 | } 32 | } 33 | 34 | .deck-prev-link { 35 | left:8px; 36 | } 37 | 38 | .deck-next-link { 39 | right:8px; 40 | } 41 | 42 | &:hover .deck-prev-link, &:hover .deck-next-link { 43 | display:block; 44 | 45 | &.deck-nav-disabled, .touch & { 46 | display:none; 47 | } 48 | } 49 | } 50 | 51 | 52 | @media print { 53 | .deck-prev-link, .deck-next-link { 54 | display:none !important; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /deck.markdown.js/deck.markdown.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Deck JS - deck.markdown - v1.0 3 | * Copyright (c) 2011 Tom Bruggeman 4 | * 5 | * Dependencie(s): 6 | * 1. PageDown Converter (http://code.google.com/p/pagedown/) 7 | * 8 | * This extension presumes that the content of a deck.js151 | 152 | / 153 | 154 |
155 | 156 | 161 | 162 | # 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /sample/themes/style/web-2.0.css: -------------------------------------------------------------------------------- 1 | .deck-container { 2 | font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif; 3 | font-size: 1.25em; 4 | background: #f4fafe; 5 | /* Old browsers */ 6 | background: -moz-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); 7 | /* FF3.6+ */ 8 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f4fafe), color-stop(100%, #ccf0f0)); 9 | /* Chrome,Safari4+ */ 10 | background: -webkit-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); 11 | /* Chrome10+,Safari5.1+ */ 12 | background: -o-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); 13 | /* Opera11.10+ */ 14 | background: -ms-linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); 15 | /* IE10+ */ 16 | background: linear-gradient(top, #f4fafe 0%, #ccf0f0 100%); 17 | /* W3C */ 18 | background-attachment: fixed; 19 | } 20 | .deck-container > .slide { 21 | text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5); 22 | } 23 | .deck-container h1, .deck-container h2, .deck-container h3, .deck-container h4, .deck-container h5, .deck-container h6 { 24 | font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif; 25 | } 26 | .deck-container h1 { 27 | color: #08455f; 28 | } 29 | .deck-container h2 { 30 | color: #0b7495; 31 | border-bottom: 0; 32 | } 33 | .cssreflections .deck-container h2 { 34 | line-height: 1; 35 | -webkit-box-reflect: below -0.556em -webkit-gradient(linear, left top, left bottom, from(transparent), color-stop(0.3, transparent), color-stop(0.7, rgba(255, 255, 255, 0.1)), to(transparent)); 36 | -moz-box-reflect: below -0.556em -moz-linear-gradient(top, transparent 0%, transparent 30%, rgba(255, 255, 255, 0.3) 100%); 37 | } 38 | .deck-container h3 { 39 | color: #000; 40 | } 41 | .deck-container pre { 42 | border-color: #cde; 43 | background: #fff; 44 | position: relative; 45 | /* http://nicolasgallagher.com/css-drop-shadows-without-images/ */ 46 | } 47 | .borderradius .deck-container pre { 48 | -webkit-border-radius: 5px; 49 | -moz-border-radius: 5px; 50 | border-radius: 5px; 51 | } 52 | .csstransforms.boxshadow .deck-container pre:before, .csstransforms.boxshadow .deck-container pre:after { 53 | content: ""; 54 | position: absolute; 55 | z-index: -1; 56 | bottom: 15px; 57 | width: 50%; 58 | height: 20%; 59 | max-width: 300px; 60 | -webkit-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7); 61 | -moz-box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7); 62 | box-shadow: 0 15px 10px rgba(0, 0, 0, 0.7); 63 | } 64 | .csstransforms.boxshadow .deck-container pre:before { 65 | left: 10px; 66 | -webkit-transform: rotate(-3deg); 67 | -moz-transform: rotate(-3deg); 68 | -ms-transform: rotate(-3deg); 69 | -o-transform: rotate(-3deg); 70 | transform: rotate(-3deg); 71 | } 72 | .csstransforms.boxshadow .deck-container pre:after { 73 | right: 10px; 74 | -webkit-transform: rotate(3deg); 75 | -moz-transform: rotate(3deg); 76 | -ms-transform: rotate(3deg); 77 | -o-transform: rotate(3deg); 78 | transform: rotate(3deg); 79 | } 80 | .deck-container code { 81 | color: #789; 82 | } 83 | .deck-container blockquote { 84 | font-family: "Hoefler Text", Constantia, Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif; 85 | font-size: 2em; 86 | padding: 1em 2em .5em 2em; 87 | color: #000; 88 | background: #fff; 89 | position: relative; 90 | border: 1px solid #cde; 91 | } 92 | .borderradius .deck-container blockquote { 93 | -webkit-border-radius: 5px; 94 | -moz-border-radius: 5px; 95 | border-radius: 5px; 96 | } 97 | .boxshadow .deck-container blockquote:after { 98 | content: ""; 99 | position: absolute; 100 | z-index: -1; 101 | top: 10px; 102 | bottom: 10px; 103 | left: 0; 104 | right: 50%; 105 | -moz-border-radius: 10px/100px; 106 | border-radius: 10px/100px; 107 | -webkit-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6); 108 | -moz-box-shadow: 0 0 15px rgba(0, 0, 0, 0.6); 109 | box-shadow: 0 0 15px rgba(0, 0, 0, 0.6); 110 | } 111 | .deck-container blockquote p { 112 | margin: 0; 113 | } 114 | .deck-container blockquote cite { 115 | font-size: .5em; 116 | font-style: normal; 117 | font-weight: bold; 118 | color: #888; 119 | } 120 | .deck-container blockquote:before { 121 | content: "“"; 122 | position: absolute; 123 | top: 0; 124 | left: 0; 125 | font-size: 5em; 126 | line-height: 1; 127 | color: #ccf0f0; 128 | z-index: 1; 129 | } 130 | .deck-container .borderradius img { 131 | -webkit-border-radius: 5px; 132 | -moz-border-radius: 5px; 133 | border-radius: 5px; 134 | } 135 | .deck-container ::-moz-selection { 136 | background: #08455f; 137 | color: #fff; 138 | } 139 | .deck-container ::selection { 140 | background: #08455f; 141 | color: #fff; 142 | } 143 | .deck-container a, .deck-container a:hover, .deck-container a:focus, .deck-container a:active, .deck-container a:visited { 144 | color: #599; 145 | text-decoration: none; 146 | } 147 | .deck-container a:hover, .deck-container a:focus { 148 | text-decoration: underline; 149 | } 150 | .deck-container .deck-prev-link, .deck-container .deck-next-link { 151 | background: #fff; 152 | opacity: 0.5; 153 | } 154 | .deck-container .deck-prev-link, .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-prev-link:active, .deck-container .deck-prev-link:visited, .deck-container .deck-next-link, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus, .deck-container .deck-next-link:active, .deck-container .deck-next-link:visited { 155 | color: #599; 156 | } 157 | .deck-container .deck-prev-link:hover, .deck-container .deck-prev-link:focus, .deck-container .deck-next-link:hover, .deck-container .deck-next-link:focus { 158 | opacity: 1; 159 | text-decoration: none; 160 | } 161 | .deck-container .deck-status { 162 | font-size: 0.6666em; 163 | } 164 | .deck-container.deck-menu .slide { 165 | background: transparent; 166 | -webkit-border-radius: 5px; 167 | -moz-border-radius: 5px; 168 | border-radius: 5px; 169 | } 170 | .rgba .deck-container.deck-menu .slide { 171 | background: rgba(0, 0, 0, 0.1); 172 | } 173 | .deck-container.deck-menu .slide.deck-current, .rgba .deck-container.deck-menu .slide.deck-current, .no-touch .deck-container.deck-menu .slide:hover { 174 | background: #fff; 175 | } 176 | .deck-container .goto-form { 177 | background: #fff; 178 | border: 1px solid #cde; 179 | -webkit-border-radius: 5px; 180 | -moz-border-radius: 5px; 181 | border-radius: 5px; 182 | } 183 | .boxshadow .deck-container .goto-form { 184 | -webkit-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; 185 | -moz-box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; 186 | box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; 187 | } 188 | -------------------------------------------------------------------------------- /sample/core/deck.core.scss: -------------------------------------------------------------------------------- 1 | html { 2 | height:100%; 3 | } 4 | 5 | .deck-container { 6 | position:relative; 7 | height:100%; 8 | width:70%; 9 | margin:0 auto; 10 | padding:0 48px; 11 | font-size:16px; 12 | line-height:1.25; 13 | overflow:hidden; 14 | 15 | .js & { 16 | visibility:hidden; 17 | } 18 | 19 | .ready & { 20 | visibility:visible; 21 | } 22 | 23 | .touch & { 24 | -webkit-text-size-adjust:none; 25 | } 26 | 27 | /* Resets and base styles from HTML5 Boilerplate */ 28 | div, span, object, iframe, 29 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 30 | abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, 31 | small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, 32 | fieldset, form, label, legend, 33 | table, caption, tbody, tfoot, thead, tr, th, td, 34 | article, aside, canvas, details, figcaption, figure, 35 | footer, header, hgroup, menu, nav, section, summary, 36 | time, mark, audio, video { 37 | margin: 0; 38 | padding: 0; 39 | border: 0; 40 | font-size: 100%; 41 | font: inherit; 42 | vertical-align: baseline; 43 | } 44 | 45 | article, aside, details, figcaption, figure, 46 | footer, header, hgroup, menu, nav, section { 47 | display: block; 48 | } 49 | 50 | blockquote, q { 51 | quotes:none; 52 | 53 | &:before, &:after { 54 | content:""; 55 | content:none; 56 | } 57 | } 58 | 59 | ins { 60 | background-color:#ff9; 61 | color:#000; 62 | text-decoration:none; 63 | } 64 | 65 | mark { 66 | background-color:#ff9; 67 | color:#000; 68 | font-style:italic; 69 | font-weight:bold; 70 | } 71 | 72 | del { 73 | text-decoration:line-through; 74 | } 75 | 76 | abbr[title], dfn[title] { 77 | border-bottom:1px dotted; 78 | cursor:help; 79 | } 80 | 81 | table { 82 | border-collapse:collapse; 83 | border-spacing:0; 84 | } 85 | 86 | hr { 87 | display:block; 88 | height:1px; 89 | border:0; 90 | border-top:1px solid #ccc; 91 | margin:1em 0; 92 | padding:0; 93 | } 94 | 95 | input, select { 96 | vertical-align:middle; 97 | } 98 | 99 | select, input, textarea, button { 100 | font:99% sans-serif; 101 | } 102 | 103 | pre, code, kbd, samp { 104 | font-family:monospace, sans-serif; 105 | } 106 | 107 | a { 108 | -webkit-tap-highlight-color:rgba(0,0,0,0); 109 | 110 | &:hover, &:active { 111 | outline:none; 112 | } 113 | } 114 | 115 | ul, ol { 116 | margin-left:2em; 117 | vertical-align:top; 118 | } 119 | 120 | ol { 121 | list-style-type:decimal; 122 | } 123 | 124 | nav { 125 | ul, li { 126 | margin:0; 127 | list-style:none; 128 | list-style-image:none; 129 | } 130 | } 131 | 132 | small { 133 | font-size:85%; 134 | } 135 | 136 | strong, th { 137 | font-weight:bold; 138 | } 139 | 140 | td { 141 | vertical-align:top; 142 | } 143 | 144 | sub, sup { 145 | font-size:75%; 146 | line-height:0; 147 | position:relative; 148 | } 149 | 150 | sup { 151 | top:-0.5em; 152 | } 153 | 154 | sub { bottom: -0.25em; } 155 | 156 | textarea { 157 | overflow:auto; 158 | } 159 | 160 | legend { 161 | .ie6 &, .ie7 & { 162 | margin-left:-7px; 163 | } 164 | } 165 | 166 | input[type="radio"] { 167 | vertical-align:text-bottom; 168 | } 169 | 170 | input[type="checkbox"] { 171 | vertical-align:bottom; 172 | } 173 | 174 | .ie7 input[type="checkbox"] { 175 | vertical-align:baseline; 176 | } 177 | 178 | .ie6 input { 179 | vertical-align:text-bottom; 180 | } 181 | 182 | label, input[type="button"], input[type="submit"], input[type="image"], button { 183 | cursor:pointer; 184 | } 185 | 186 | button, input, select, textarea { 187 | margin: 0; 188 | } 189 | 190 | input, textarea { 191 | &:invalid { 192 | border-radius:1px; 193 | -moz-box-shadow:0px 0px 5px red; 194 | -webkit-box-shadow:0px 0px 5px red; 195 | box-shadow: 0px 0px 5px red; 196 | 197 | .no-boxshadow { 198 | background-color: #f0dddd; 199 | } 200 | } 201 | } 202 | 203 | button { 204 | width:auto; 205 | overflow:visible; 206 | } 207 | 208 | .ie7 & img { 209 | -ms-interpolation-mode: bicubic; } 210 | 211 | &, select, input, textarea { 212 | color:#444; 213 | } 214 | 215 | a { 216 | color:#607890; 217 | 218 | &:hover, &:focus { 219 | color:#036; 220 | } 221 | 222 | &:link { 223 | -webkit-tap-highlight-color: #fff; 224 | } 225 | } 226 | /* End HTML5 Boilerplate adaptations */ 227 | 228 | h1 { 229 | font-size:4.5em; 230 | font-weight:bold; 231 | text-align:center; 232 | padding-top:1em; 233 | 234 | .csstransforms & { 235 | padding:0 48px; 236 | position:absolute; 237 | left:0; 238 | right:0; 239 | top:50%; 240 | -webkit-transform:translate3d(0, -50%, 0); 241 | -moz-transform:translate(0, -50%); 242 | -ms-transform:translate(0, -50%); 243 | -o-transform:translate(0, -50%); 244 | transform:translate3d(0, -50%, 0); 245 | } 246 | } 247 | 248 | h2 { 249 | font-size:2.25em; 250 | font-weight:bold; 251 | padding-top:.5em; 252 | margin:0 0 .66666em 0; 253 | border-bottom:3px solid #888; 254 | } 255 | 256 | h3 { 257 | font-size:1.4375em; 258 | font-weight:bold; 259 | margin-bottom:.30435em; 260 | } 261 | 262 | h4 { 263 | font-size:1.25em; 264 | font-weight:bold; 265 | margin-bottom:.25em; 266 | } 267 | 268 | h5 { 269 | font-size:1.125em; 270 | font-weight:bold; 271 | margin-bottom:.2222em; 272 | } 273 | 274 | h6 { 275 | font-size:1em; 276 | font-weight:bold; 277 | } 278 | 279 | img, iframe, video { 280 | display:block; 281 | max-width:100%; 282 | } 283 | 284 | video, iframe, img { 285 | display:block; 286 | margin:0 auto; 287 | } 288 | 289 | p, blockquote, iframe, img, ul, ol, pre, video { 290 | margin-bottom:1em; 291 | } 292 | 293 | pre { 294 | white-space:pre; 295 | white-space:pre-wrap; 296 | word-wrap:break-word; 297 | padding: 1em; 298 | border:1px solid #888; 299 | } 300 | 301 | em { 302 | font-style:italic; 303 | } 304 | 305 | li { 306 | padding:.25em 0; 307 | vertical-align:middle; 308 | } 309 | 310 | &.deck-loading { 311 | display:none; 312 | } 313 | } 314 | 315 | .slide { 316 | width:auto; 317 | min-height:100%; 318 | position:relative; 319 | } 320 | 321 | .deck-before, .deck-previous, .deck-next, .deck-after { 322 | position:absolute; 323 | left:-999em; 324 | top:-999em; 325 | } 326 | 327 | .deck-current { 328 | z-index:2; 329 | } 330 | 331 | .slide .slide { 332 | visibility:hidden; 333 | position:static; 334 | min-height:0; 335 | } 336 | 337 | .deck-child-current { 338 | position:static; 339 | z-index:2; 340 | 341 | .slide { 342 | visibility:hidden; 343 | } 344 | 345 | .deck-previous, .deck-before, .deck-current { 346 | visibility:visible; 347 | } 348 | } 349 | 350 | body.deck-container { 351 | overflow:visible; 352 | } 353 | 354 | @media all and (orientation:portrait) { 355 | 356 | } 357 | 358 | @media all and (orientation:landscape) { 359 | 360 | } 361 | 362 | @media screen and (max-device-width: 480px) { 363 | 364 | /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */ 365 | } 366 | 367 | 368 | @media print { 369 | * { 370 | background: transparent !important; 371 | color: black !important; 372 | text-shadow: none !important; 373 | filter:none !important; 374 | -ms-filter: none !important; 375 | -webkit-box-reflect:none !important; 376 | -moz-box-reflect:none !important; 377 | -webkit-box-shadow:none !important; 378 | -moz-box-shadow:none !important; 379 | box-shadow:none !important; 380 | 381 | :before, :after { 382 | display:none !important; 383 | } 384 | } 385 | a, a:visited { color: #444 !important; text-decoration: underline; } 386 | a[href]:after { content: " (" attr(href) ")"; } 387 | abbr[title]:after { content: " (" attr(title) ")"; } 388 | .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } 389 | pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } 390 | thead { display: table-header-group; } 391 | tr, img { page-break-inside: avoid; } 392 | @page { margin: 0.5cm; } 393 | p, h2, h3 { orphans: 3; widows: 3; } 394 | h2, h3{ page-break-after: avoid; } 395 | 396 | .slide { 397 | position:static !important; 398 | visibility:visible !important; 399 | display:block !important; 400 | -webkit-transform:none !important; 401 | -moz-transform:none !important; 402 | -o-transform:none !important; 403 | -ms-transform:none !important; 404 | transform:none !important; 405 | opacity:1 !important; 406 | } 407 | 408 | h1 { 409 | -webkit-transform:none !important; 410 | -moz-transform:none !important; 411 | -o-transform:none !important; 412 | -ms-transform:none !important; 413 | transform:none !important; 414 | padding:0 !important; 415 | position:static !important; 416 | } 417 | 418 | .deck-container > .slide { 419 | page-break-after: always; 420 | } 421 | 422 | .deck-container { 423 | width:100% !important; 424 | height:auto !important; 425 | padding:0 !important; 426 | display:block !important; 427 | } 428 | 429 | script { 430 | display:none; 431 | } 432 | } 433 | -------------------------------------------------------------------------------- /sample/core/deck.core.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100%; 3 | } 4 | 5 | .deck-container { 6 | position: relative; 7 | height: 100%; 8 | width: 70%; 9 | margin: 0 auto; 10 | padding: 0 48px; 11 | font-size: 16px; 12 | line-height: 1.25; 13 | overflow: hidden; 14 | /* Resets and base styles from HTML5 Boilerplate */ 15 | /* End HTML5 Boilerplate adaptations */ 16 | } 17 | .js .deck-container { 18 | visibility: hidden; 19 | } 20 | .ready .deck-container { 21 | visibility: visible; 22 | } 23 | .touch .deck-container { 24 | -webkit-text-size-adjust: none; 25 | } 26 | .deck-container div, .deck-container span, .deck-container object, .deck-container iframe, 27 | .deck-container h1, .deck-container h2, .deck-container h3, .deck-container h4, .deck-container h5, .deck-container h6, .deck-container p, .deck-container blockquote, .deck-container pre, 28 | .deck-container abbr, .deck-container address, .deck-container cite, .deck-container code, .deck-container del, .deck-container dfn, .deck-container em, .deck-container img, .deck-container ins, .deck-container kbd, .deck-container q, .deck-container samp, 29 | .deck-container small, .deck-container strong, .deck-container sub, .deck-container sup, .deck-container var, .deck-container b, .deck-container i, .deck-container dl, .deck-container dt, .deck-container dd, .deck-container ol, .deck-container ul, .deck-container li, 30 | .deck-container fieldset, .deck-container form, .deck-container label, .deck-container legend, 31 | .deck-container table, .deck-container caption, .deck-container tbody, .deck-container tfoot, .deck-container thead, .deck-container tr, .deck-container th, .deck-container td, 32 | .deck-container article, .deck-container aside, .deck-container canvas, .deck-container details, .deck-container figcaption, .deck-container figure, 33 | .deck-container footer, .deck-container header, .deck-container hgroup, .deck-container menu, .deck-container nav, .deck-container section, .deck-container summary, 34 | .deck-container time, .deck-container mark, .deck-container audio, .deck-container video { 35 | margin: 0; 36 | padding: 0; 37 | border: 0; 38 | font-size: 100%; 39 | font: inherit; 40 | vertical-align: baseline; 41 | } 42 | .deck-container article, .deck-container aside, .deck-container details, .deck-container figcaption, .deck-container figure, 43 | .deck-container footer, .deck-container header, .deck-container hgroup, .deck-container menu, .deck-container nav, .deck-container section { 44 | display: block; 45 | } 46 | .deck-container blockquote, .deck-container q { 47 | quotes: none; 48 | } 49 | .deck-container blockquote:before, .deck-container blockquote:after, .deck-container q:before, .deck-container q:after { 50 | content: ""; 51 | content: none; 52 | } 53 | .deck-container ins { 54 | background-color: #ff9; 55 | color: #000; 56 | text-decoration: none; 57 | } 58 | .deck-container mark { 59 | background-color: #ff9; 60 | color: #000; 61 | font-style: italic; 62 | font-weight: bold; 63 | } 64 | .deck-container del { 65 | text-decoration: line-through; 66 | } 67 | .deck-container abbr[title], .deck-container dfn[title] { 68 | border-bottom: 1px dotted; 69 | cursor: help; 70 | } 71 | .deck-container table { 72 | border-collapse: collapse; 73 | border-spacing: 0; 74 | } 75 | .deck-container hr { 76 | display: block; 77 | height: 1px; 78 | border: 0; 79 | border-top: 1px solid #ccc; 80 | margin: 1em 0; 81 | padding: 0; 82 | } 83 | .deck-container input, .deck-container select { 84 | vertical-align: middle; 85 | } 86 | .deck-container select, .deck-container input, .deck-container textarea, .deck-container button { 87 | font: 99% sans-serif; 88 | } 89 | .deck-container pre, .deck-container code, .deck-container kbd, .deck-container samp { 90 | font-family: monospace, sans-serif; 91 | } 92 | .deck-container a { 93 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 94 | } 95 | .deck-container a:hover, .deck-container a:active { 96 | outline: none; 97 | } 98 | .deck-container ul, .deck-container ol { 99 | margin-left: 2em; 100 | vertical-align: top; 101 | } 102 | .deck-container ol { 103 | list-style-type: decimal; 104 | } 105 | .deck-container nav ul, .deck-container nav li { 106 | margin: 0; 107 | list-style: none; 108 | list-style-image: none; 109 | } 110 | .deck-container small { 111 | font-size: 85%; 112 | } 113 | .deck-container strong, .deck-container th { 114 | font-weight: bold; 115 | } 116 | .deck-container td { 117 | vertical-align: top; 118 | } 119 | .deck-container sub, .deck-container sup { 120 | font-size: 75%; 121 | line-height: 0; 122 | position: relative; 123 | } 124 | .deck-container sup { 125 | top: -0.5em; 126 | } 127 | .deck-container sub { 128 | bottom: -0.25em; 129 | } 130 | .deck-container textarea { 131 | overflow: auto; 132 | } 133 | .ie6 .deck-container legend, .ie7 .deck-container legend { 134 | margin-left: -7px; 135 | } 136 | .deck-container input[type="radio"] { 137 | vertical-align: text-bottom; 138 | } 139 | .deck-container input[type="checkbox"] { 140 | vertical-align: bottom; 141 | } 142 | .deck-container .ie7 input[type="checkbox"] { 143 | vertical-align: baseline; 144 | } 145 | .deck-container .ie6 input { 146 | vertical-align: text-bottom; 147 | } 148 | .deck-container label, .deck-container input[type="button"], .deck-container input[type="submit"], .deck-container input[type="image"], .deck-container button { 149 | cursor: pointer; 150 | } 151 | .deck-container button, .deck-container input, .deck-container select, .deck-container textarea { 152 | margin: 0; 153 | } 154 | .deck-container input:invalid, .deck-container textarea:invalid { 155 | border-radius: 1px; 156 | -moz-box-shadow: 0px 0px 5px red; 157 | -webkit-box-shadow: 0px 0px 5px red; 158 | box-shadow: 0px 0px 5px red; 159 | } 160 | .deck-container input:invalid .no-boxshadow, .deck-container textarea:invalid .no-boxshadow { 161 | background-color: #f0dddd; 162 | } 163 | .deck-container button { 164 | width: auto; 165 | overflow: visible; 166 | } 167 | .ie7 .deck-container img { 168 | -ms-interpolation-mode: bicubic; 169 | } 170 | .deck-container, .deck-container select, .deck-container input, .deck-container textarea { 171 | color: #444; 172 | } 173 | .deck-container a { 174 | color: #607890; 175 | } 176 | .deck-container a:hover, .deck-container a:focus { 177 | color: #036; 178 | } 179 | .deck-container a:link { 180 | -webkit-tap-highlight-color: #fff; 181 | } 182 | .deck-container h1 { 183 | font-size: 4.5em; 184 | font-weight: bold; 185 | text-align: center; 186 | padding-top: 1em; 187 | } 188 | .csstransforms .deck-container h1 { 189 | padding: 0 48px; 190 | position: absolute; 191 | left: 0; 192 | right: 0; 193 | top: 50%; 194 | -webkit-transform: translate3d(0, -50%, 0); 195 | -moz-transform: translate(0, -50%); 196 | -ms-transform: translate(0, -50%); 197 | -o-transform: translate(0, -50%); 198 | transform: translate3d(0, -50%, 0); 199 | } 200 | .deck-container h2 { 201 | font-size: 2.25em; 202 | font-weight: bold; 203 | padding-top: .5em; 204 | margin: 0 0 .66666em 0; 205 | border-bottom: 3px solid #888; 206 | } 207 | .deck-container h3 { 208 | font-size: 1.4375em; 209 | font-weight: bold; 210 | margin-bottom: .30435em; 211 | } 212 | .deck-container h4 { 213 | font-size: 1.25em; 214 | font-weight: bold; 215 | margin-bottom: .25em; 216 | } 217 | .deck-container h5 { 218 | font-size: 1.125em; 219 | font-weight: bold; 220 | margin-bottom: .2222em; 221 | } 222 | .deck-container h6 { 223 | font-size: 1em; 224 | font-weight: bold; 225 | } 226 | .deck-container img, .deck-container iframe, .deck-container video { 227 | display: block; 228 | max-width: 100%; 229 | } 230 | .deck-container video, .deck-container iframe, .deck-container img { 231 | display: block; 232 | margin: 0 auto; 233 | } 234 | .deck-container p, .deck-container blockquote, .deck-container iframe, .deck-container img, .deck-container ul, .deck-container ol, .deck-container pre, .deck-container video { 235 | margin-bottom: 1em; 236 | } 237 | .deck-container pre { 238 | white-space: pre; 239 | white-space: pre-wrap; 240 | word-wrap: break-word; 241 | padding: 1em; 242 | border: 1px solid #888; 243 | } 244 | .deck-container em { 245 | font-style: italic; 246 | } 247 | .deck-container li { 248 | padding: .25em 0; 249 | vertical-align: middle; 250 | } 251 | .deck-container.deck-loading { 252 | display: none; 253 | } 254 | 255 | .slide { 256 | width: auto; 257 | min-height: 100%; 258 | position: relative; 259 | } 260 | 261 | .deck-before, .deck-previous, .deck-next, .deck-after { 262 | position: absolute; 263 | left: -999em; 264 | top: -999em; 265 | } 266 | 267 | .deck-current { 268 | z-index: 2; 269 | } 270 | 271 | .slide .slide { 272 | visibility: hidden; 273 | position: static; 274 | min-height: 0; 275 | } 276 | 277 | .deck-child-current { 278 | position: static; 279 | z-index: 2; 280 | } 281 | .deck-child-current .slide { 282 | visibility: hidden; 283 | } 284 | .deck-child-current .deck-previous, .deck-child-current .deck-before, .deck-child-current .deck-current { 285 | visibility: visible; 286 | } 287 | 288 | body.deck-container { 289 | overflow: visible; 290 | } 291 | 292 | @media all and (orientation:portrait) {} 293 | @media all and (orientation:landscape) {} 294 | @media screen and (max-device-width: 480px) { 295 | /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */ 296 | } 297 | 298 | @media print { 299 | * { 300 | background: transparent !important; 301 | color: black !important; 302 | text-shadow: none !important; 303 | filter: none !important; 304 | -ms-filter: none !important; 305 | -webkit-box-reflect: none !important; 306 | -moz-box-reflect: none !important; 307 | -webkit-box-shadow: none !important; 308 | -moz-box-shadow: none !important; 309 | box-shadow: none !important; 310 | } 311 | * :before, * :after { 312 | display: none !important; 313 | } 314 | 315 | a, a:visited { 316 | color: #444 !important; 317 | text-decoration: underline; 318 | } 319 | 320 | a[href]:after { 321 | content: " (" attr(href) ")"; 322 | } 323 | 324 | abbr[title]:after { 325 | content: " (" attr(title) ")"; 326 | } 327 | 328 | .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { 329 | content: ""; 330 | } 331 | 332 | pre, blockquote { 333 | border: 1px solid #999; 334 | page-break-inside: avoid; 335 | } 336 | 337 | thead { 338 | display: table-header-group; 339 | } 340 | 341 | tr, img { 342 | page-break-inside: avoid; 343 | } 344 | 345 | @page { 346 | margin: 0.5cm; 347 | } 348 | 349 | p, h2, h3 { 350 | orphans: 3; 351 | widows: 3; 352 | } 353 | 354 | h2, h3 { 355 | page-break-after: avoid; 356 | } 357 | 358 | .slide { 359 | position: static !important; 360 | visibility: visible !important; 361 | display: block !important; 362 | -webkit-transform: none !important; 363 | -moz-transform: none !important; 364 | -o-transform: none !important; 365 | -ms-transform: none !important; 366 | transform: none !important; 367 | opacity:1 !important; 368 | } 369 | 370 | h1 { 371 | -webkit-transform: none !important; 372 | -moz-transform: none !important; 373 | -o-transform: none !important; 374 | -ms-transform: none !important; 375 | transform: none !important; 376 | padding: 0 !important; 377 | position: static !important; 378 | } 379 | 380 | .deck-container > .slide { 381 | page-break-after: always; 382 | } 383 | 384 | .deck-container { 385 | width: 100% !important; 386 | height: auto !important; 387 | padding: 0 !important; 388 | display: block !important; 389 | } 390 | 391 | script { 392 | display: none; 393 | } 394 | } 395 | -------------------------------------------------------------------------------- /sample/js/modernizr.custom.js: -------------------------------------------------------------------------------- 1 | /* Modernizr 2.0.6 (Custom Build) | MIT & BSD 2 | * Contains: fontface | backgroundsize | borderimage | borderradius | boxshadow | flexbox | hsla | multiplebgs | opacity | rgba | textshadow | cssanimations | csscolumns | generatedcontent | cssgradients | cssreflections | csstransforms | csstransforms3d | csstransitions | applicationcache | canvas | canvastext | draganddrop | hashchange | history | audio | video | indexeddb | input | inputtypes | localstorage | postmessage | sessionstorage | websockets | websqldatabase | webworkers | geolocation | inlinesvg | smil | svg | svgclippaths | touch | webgl | iepp | cssclasses | addtest | teststyles | testprop | testallprops | hasevent | prefixes | domprefixes | load 3 | */ 4 | ;window.Modernizr=function(a,b,c){function H(){e.input=function(a){for(var b=0,c=a.length;bs around 251 | // "paragraphs" that are wrapped in non-block-level tags, such as anchors, 252 | // phrase emphasis, and spans. The list of tags we're looking for is 253 | // hard-coded: 254 | var block_tags_a = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del" 255 | var block_tags_b = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math" 256 | 257 | // First, look for nested blocks, e.g.: 258 | //
tags around block-level tags.
403 | text = _HashHTMLBlocks(text);
404 | text = _FormParagraphs(text, doNotUnhash);
405 |
406 | return text;
407 | }
408 |
409 | function _RunSpanGamut(text) {
410 | //
411 | // These are all the transformations that occur *within* block-level
412 | // tags like paragraphs, headers, and list items.
413 | //
414 |
415 | text = _DoCodeSpans(text);
416 | text = _EscapeSpecialCharsWithinTagAttributes(text);
417 | text = _EncodeBackslashEscapes(text);
418 |
419 | // Process anchor and image tags. Images must come first,
420 | // because ![foo][f] looks like an anchor.
421 | text = _DoImages(text);
422 | text = _DoAnchors(text);
423 |
424 | // Make links out of things like `
\n");
436 |
437 | return text;
438 | }
439 |
440 | function _EscapeSpecialCharsWithinTagAttributes(text) {
441 | //
442 | // Within tags -- meaning between < and > -- encode [\ ` * _] so they
443 | // don't conflict with their use in Markdown for code, italics and strong.
444 | //
445 |
446 | // Build a regex to find HTML tags and comments. See Friedl's
447 | // "Mastering Regular Expressions", 2nd Ed., pp. 200-201.
448 |
449 | // SE: changed the comment part of the regex
450 |
451 | var regex = /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|-]|-[^>])(?:[^-]|-[^-])*)--)>)/gi;
452 |
453 | text = text.replace(regex, function (wholeMatch) {
454 | var tag = wholeMatch.replace(/(.)<\/?code>(?=.)/g, "$1`");
455 | tag = escapeCharacters(tag, wholeMatch.charAt(1) == "!" ? "\\`*_/" : "\\`*_"); // also escape slashes in comments to prevent autolinking there -- http://meta.stackoverflow.com/questions/95987
456 | return tag;
457 | });
458 |
459 | return text;
460 | }
461 |
462 | function _DoAnchors(text) {
463 | //
464 | // Turn Markdown link shortcuts into XHTML tags.
465 | //
466 | //
467 | // First, handle reference-style links: [link text] [id]
468 | //
469 |
470 | /*
471 | text = text.replace(/
472 | ( // wrap whole match in $1
473 | \[
474 | (
475 | (?:
476 | \[[^\]]*\] // allow brackets nested one level
477 | |
478 | [^\[] // or anything else
479 | )*
480 | )
481 | \]
482 |
483 | [ ]? // one optional space
484 | (?:\n[ ]*)? // one optional newline followed by spaces
485 |
486 | \[
487 | (.*?) // id = $3
488 | \]
489 | )
490 | ()()()() // pad remaining backreferences
491 | /g, writeAnchorTag);
492 | */
493 | text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, writeAnchorTag);
494 |
495 | //
496 | // Next, inline-style links: [link text](url "optional title")
497 | //
498 |
499 | /*
500 | text = text.replace(/
501 | ( // wrap whole match in $1
502 | \[
503 | (
504 | (?:
505 | \[[^\]]*\] // allow brackets nested one level
506 | |
507 | [^\[\]] // or anything else
508 | )*
509 | )
510 | \]
511 | \( // literal paren
512 | [ \t]*
513 | () // no id, so leave $3 empty
514 | ( // href = $4
515 | (?:
516 | \([^)]*\) // allow one level of (correctly nested) parens (think MSDN)
517 | |
518 | [^()]
519 | )*?
520 | )>?
521 | [ \t]*
522 | ( // $5
523 | (['"]) // quote char = $6
524 | (.*?) // Title = $7
525 | \6 // matching quote
526 | [ \t]* // ignore any spaces/tabs between closing quote and )
527 | )? // title is optional
528 | \)
529 | )
530 | /g, writeAnchorTag);
531 | */
532 |
533 | text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()((?:\([^)]*\)|[^()])*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, writeAnchorTag);
534 |
535 | //
536 | // Last, handle reference-style shortcuts: [link text]
537 | // These must come last in case you've also got [link test][1]
538 | // or [link test](/foo)
539 | //
540 |
541 | /*
542 | text = text.replace(/
543 | ( // wrap whole match in $1
544 | \[
545 | ([^\[\]]+) // link text = $2; can't contain '[' or ']'
546 | \]
547 | )
548 | ()()()()() // pad rest of backreferences
549 | /g, writeAnchorTag);
550 | */
551 | text = text.replace(/(\[([^\[\]]+)\])()()()()()/g, writeAnchorTag);
552 |
553 | return text;
554 | }
555 |
556 | function writeAnchorTag(wholeMatch, m1, m2, m3, m4, m5, m6, m7) {
557 | if (m7 == undefined) m7 = "";
558 | var whole_match = m1;
559 | var link_text = m2.replace(/:\/\//g, "~P"); // to prevent auto-linking withing the link. will be converted back after the auto-linker runs
560 | var link_id = m3.toLowerCase();
561 | var url = m4;
562 | var title = m7;
563 |
564 | if (url == "") {
565 | if (link_id == "") {
566 | // lower-case and turn embedded newlines into spaces
567 | link_id = link_text.toLowerCase().replace(/ ?\n/g, " ");
568 | }
569 | url = "#" + link_id;
570 |
571 | if (g_urls.get(link_id) != undefined) {
572 | url = g_urls.get(link_id);
573 | if (g_titles.get(link_id) != undefined) {
574 | title = g_titles.get(link_id);
575 | }
576 | }
577 | else {
578 | if (whole_match.search(/\(\s*\)$/m) > -1) {
579 | // Special case for explicit empty url
580 | url = "";
581 | } else {
582 | return whole_match;
583 | }
584 | }
585 | }
586 | url = encodeProblemUrlChars(url);
587 | url = escapeCharacters(url, "*_");
588 | var result = "" + link_text + "";
597 |
598 | return result;
599 | }
600 |
601 | function _DoImages(text) {
602 | //
603 | // Turn Markdown image shortcuts into tags.
604 | //
605 |
606 | //
607 | // First, handle reference-style labeled images: ![alt text][id]
608 | //
609 |
610 | /*
611 | text = text.replace(/
612 | ( // wrap whole match in $1
613 | !\[
614 | (.*?) // alt text = $2
615 | \]
616 |
617 | [ ]? // one optional space
618 | (?:\n[ ]*)? // one optional newline followed by spaces
619 |
620 | \[
621 | (.*?) // id = $3
622 | \]
623 | )
624 | ()()()() // pad rest of backreferences
625 | /g, writeImageTag);
626 | */
627 | text = text.replace(/(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g, writeImageTag);
628 |
629 | //
630 | // Next, handle inline images: 
631 | // Don't forget: encode * and _
632 |
633 | /*
634 | text = text.replace(/
635 | ( // wrap whole match in $1
636 | !\[
637 | (.*?) // alt text = $2
638 | \]
639 | \s? // One optional whitespace character
640 | \( // literal paren
641 | [ \t]*
642 | () // no id, so leave $3 empty
643 | (\S+?)>? // src url = $4
644 | [ \t]*
645 | ( // $5
646 | (['"]) // quote char = $6
647 | (.*?) // title = $7
648 | \6 // matching quote
649 | [ \t]*
650 | )? // title is optional
651 | \)
652 | )
653 | /g, writeImageTag);
654 | */
655 | text = text.replace(/(!\[(.*?)\]\s?\([ \t]*()(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g, writeImageTag);
656 |
657 | return text;
658 | }
659 |
660 | function attributeEncode(text) {
661 | // unconditionally replace angle brackets here -- what ends up in an attribute (e.g. alt or title)
662 | // never makes sense to have verbatim HTML in it (and the sanitizer would totally break it)
663 | return text.replace(/>/g, ">").replace(/
` blocks.
923 | //
924 |
925 | /*
926 | text = text.replace(/
927 | (?:\n\n|^)
928 | ( // $1 = the code block -- one or more lines, starting with a space/tab
929 | (?:
930 | (?:[ ]{4}|\t) // Lines must start with a tab or a tab-width of spaces - attacklab: g_tab_width
931 | .*\n+
932 | )+
933 | )
934 | (\n*[ ]{0,3}[^ \t\n]|(?=~0)) // attacklab: g_tab_width
935 | /g ,function(){...});
936 | */
937 |
938 | // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
939 | text += "~0";
940 |
941 | text = text.replace(/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g,
942 | function (wholeMatch, m1, m2) {
943 | var codeblock = m1;
944 | var nextChar = m2;
945 |
946 | codeblock = _EncodeCode(_Outdent(codeblock));
947 | codeblock = _Detab(codeblock);
948 | codeblock = codeblock.replace(/^\n+/g, ""); // trim leading newlines
949 | codeblock = codeblock.replace(/\n+$/g, ""); // trim trailing whitespace
950 |
951 | codeblock = "" + codeblock + "\n
";
952 |
953 | return "\n\n" + codeblock + "\n\n" + nextChar;
954 | }
955 | );
956 |
957 | // attacklab: strip sentinel
958 | text = text.replace(/~0/, "");
959 |
960 | return text;
961 | }
962 |
963 | function hashBlock(text) {
964 | text = text.replace(/(^\n+|\n+$)/g, "");
965 | return "\n\n~K" + (g_html_blocks.push(text) - 1) + "K\n\n";
966 | }
967 |
968 | function _DoCodeSpans(text) {
969 | //
970 | // * Backtick quotes are used for spans.
971 | //
972 | // * You can use multiple backticks as the delimiters if you want to
973 | // include literal backticks in the code span. So, this input:
974 | //
975 | // Just type ``foo `bar` baz`` at the prompt.
976 | //
977 | // Will translate to:
978 | //
979 | // Just type foo `bar` baz at the prompt.
980 | //
981 | // There's no arbitrary limit to the number of backticks you
982 | // can use as delimters. If you need three consecutive backticks
983 | // in your code, use four for delimiters, etc.
984 | //
985 | // * You can use spaces to get literal backticks at the edges:
986 | //
987 | // ... type `` `bar` `` ...
988 | //
989 | // Turns to:
990 | //
991 | // ... type `bar` ...
992 | //
993 |
994 | /*
995 | text = text.replace(/
996 | (^|[^\\]) // Character before opening ` can't be a backslash
997 | (`+) // $2 = Opening run of `
998 | ( // $3 = The code block
999 | [^\r]*?
1000 | [^`] // attacklab: work around lack of lookbehind
1001 | )
1002 | \2 // Matching closer
1003 | (?!`)
1004 | /gm, function(){...});
1005 | */
1006 |
1007 | text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,
1008 | function (wholeMatch, m1, m2, m3, m4) {
1009 | var c = m3;
1010 | c = c.replace(/^([ \t]*)/g, ""); // leading whitespace
1011 | c = c.replace(/[ \t]*$/g, ""); // trailing whitespace
1012 | c = _EncodeCode(c);
1013 | c = c.replace(/:\/\//g, "~P"); // to prevent auto-linking. Not necessary in code *blocks*, but in code spans. Will be converted back after the auto-linker runs.
1014 | return m1 + "" + c + "";
1015 | }
1016 | );
1017 |
1018 | return text;
1019 | }
1020 |
1021 | function _EncodeCode(text) {
1022 | //
1023 | // Encode/escape certain characters inside Markdown code runs.
1024 | // The point is that in code, these characters are literals,
1025 | // and lose their special Markdown meanings.
1026 | //
1027 | // Encode all ampersands; HTML entities are not
1028 | // entities within a Markdown code span.
1029 | text = text.replace(/&/g, "&");
1030 |
1031 | // Do the angle bracket song and dance:
1032 | text = text.replace(//g, ">");
1034 |
1035 | // Now, escape characters that are magic in Markdown:
1036 | text = escapeCharacters(text, "\*_{}[]\\", false);
1037 |
1038 | // jj the line above breaks this:
1039 | //---
1040 |
1041 | //* Item
1042 |
1043 | // 1. Subitem
1044 |
1045 | // special char: *
1046 | //---
1047 |
1048 | return text;
1049 | }
1050 |
1051 | function _DoItalicsAndBold(text) {
1052 |
1053 | // must go first:
1054 | text = text.replace(/([\W_]|^)(\*\*|__)(?=\S)([^\r]*?\S[\*_]*)\2([\W_]|$)/g,
1055 | "$1$3$4");
1056 |
1057 | text = text.replace(/([\W_]|^)(\*|_)(?=\S)([^\r\*_]*?\S)\2([\W_]|$)/g,
1058 | "$1$3$4");
1059 |
1060 | return text;
1061 | }
1062 |
1063 | function _DoBlockQuotes(text) {
1064 |
1065 | /*
1066 | text = text.replace(/
1067 | ( // Wrap whole match in $1
1068 | (
1069 | ^[ \t]*>[ \t]? // '>' at the start of a line
1070 | .+\n // rest of the first line
1071 | (.+\n)* // subsequent consecutive lines
1072 | \n* // blanks
1073 | )+
1074 | )
1075 | /gm, function(){...});
1076 | */
1077 |
1078 | text = text.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,
1079 | function (wholeMatch, m1) {
1080 | var bq = m1;
1081 |
1082 | // attacklab: hack around Konqueror 3.5.4 bug:
1083 | // "----------bug".replace(/^-/g,"") == "bug"
1084 |
1085 | bq = bq.replace(/^[ \t]*>[ \t]?/gm, "~0"); // trim one level of quoting
1086 |
1087 | // attacklab: clean up hack
1088 | bq = bq.replace(/~0/g, "");
1089 |
1090 | bq = bq.replace(/^[ \t]+$/gm, ""); // trim whitespace-only lines
1091 | bq = _RunBlockGamut(bq); // recurse
1092 |
1093 | bq = bq.replace(/(^|\n)/g, "$1 ");
1094 | // These leading spaces screw with content, so we need to fix that:
1095 | bq = bq.replace(
1096 | /(\s*[^\r]+?<\/pre>)/gm,
1097 | function (wholeMatch, m1) {
1098 | var pre = m1;
1099 | // attacklab: hack around Konqueror 3.5.4 bug:
1100 | pre = pre.replace(/^ /mg, "~0");
1101 | pre = pre.replace(/~0/g, "");
1102 | return pre;
1103 | });
1104 |
1105 | return hashBlock("\n" + bq + "\n
");
1106 | }
1107 | );
1108 | return text;
1109 | }
1110 |
1111 | function _FormParagraphs(text, doNotUnhash) {
1112 | //
1113 | // Params:
1114 | // $text - string to process with html tags
1115 | //
1116 |
1117 | // Strip leading and trailing lines:
1118 | text = text.replace(/^\n+/g, "");
1119 | text = text.replace(/\n+$/g, "");
1120 |
1121 | var grafs = text.split(/\n{2,}/g);
1122 | var grafsOut = [];
1123 |
1124 | var markerRe = /~K(\d+)K/;
1125 |
1126 | //
1127 | // Wrap
tags.
1128 | //
1129 | var end = grafs.length;
1130 | for (var i = 0; i < end; i++) {
1131 | var str = grafs[i];
1132 |
1133 | // if this is an HTML marker, copy it
1134 | if (markerRe.test(str)) {
1135 | grafsOut.push(str);
1136 | }
1137 | else if (/\S/.test(str)) {
1138 | str = _RunSpanGamut(str);
1139 | str = str.replace(/^([ \t]*)/g, "
");
1140 | str += "
"
1141 | grafsOut.push(str);
1142 | }
1143 |
1144 | }
1145 | //
1146 | // Unhashify HTML blocks
1147 | //
1148 | if (!doNotUnhash) {
1149 | end = grafsOut.length;
1150 | for (var i = 0; i < end; i++) {
1151 | var foundAny = true;
1152 | while (foundAny) { // we may need several runs, since the data may be nested
1153 | foundAny = false;
1154 | grafsOut[i] = grafsOut[i].replace(/~K(\d+)K/g, function (wholeMatch, id) {
1155 | foundAny = true;
1156 | return g_html_blocks[id];
1157 | });
1158 | }
1159 | }
1160 | }
1161 | return grafsOut.join("\n\n");
1162 | }
1163 |
1164 | function _EncodeAmpsAndAngles(text) {
1165 | // Smart processing for ampersands and angle brackets that need to be encoded.
1166 |
1167 | // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
1168 | // http://bumppo.net/projects/amputator/
1169 | text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, "&");
1170 |
1171 | // Encode naked <'s
1172 | text = text.replace(/<(?![a-z\/?\$!])/gi, "<");
1173 |
1174 | return text;
1175 | }
1176 |
1177 | function _EncodeBackslashEscapes(text) {
1178 | //
1179 | // Parameter: String.
1180 | // Returns: The string, with after processing the following backslash
1181 | // escape sequences.
1182 | //
1183 |
1184 | // attacklab: The polite way to do this is with the new
1185 | // escapeCharacters() function:
1186 | //
1187 | // text = escapeCharacters(text,"\\",true);
1188 | // text = escapeCharacters(text,"`*_{}[]()>#+-.!",true);
1189 | //
1190 | // ...but we're sidestepping its use of the (slow) RegExp constructor
1191 | // as an optimization for Firefox. This function gets called a LOT.
1192 |
1193 | text = text.replace(/\\(\\)/g, escapeCharacters_callback);
1194 | text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g, escapeCharacters_callback);
1195 | return text;
1196 | }
1197 |
1198 | function _DoAutoLinks(text) {
1199 |
1200 | // note that at this point, all other URL in the text are already hyperlinked as
1201 | // *except* for the case
1202 |
1203 | // automatically add < and > around unadorned raw hyperlinks
1204 | // must be preceded by space/BOF and followed by non-word/EOF character
1205 | text = text.replace(/(^|\s)(https?|ftp)(:\/\/[-A-Z0-9+&@#\/%?=~_|\[\]\(\)!:,\.;]*[-A-Z0-9+&@#\/%=~_|\[\]])($|\W)/gi, "$1<$2$3>$4");
1206 |
1207 | // autolink anything like
1208 |
1209 | var replacer = function (wholematch, m1) { return "" + pluginHooks.plainLinkText(m1) + ""; }
1210 | text = text.replace(/<((https?|ftp):[^'">\s]+)>/gi, replacer);
1211 |
1212 | // Email addresses:
1213 | /*
1214 | text = text.replace(/
1215 | <
1216 | (?:mailto:)?
1217 | (
1218 | [-.\w]+
1219 | \@
1220 | [-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+
1221 | )
1222 | >
1223 | /gi, _DoAutoLinks_callback());
1224 | */
1225 |
1226 | /* disabling email autolinking, since we don't do that on the server, either
1227 | text = text.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,
1228 | function(wholeMatch,m1) {
1229 | return _EncodeEmailAddress( _UnescapeSpecialChars(m1) );
1230 | }
1231 | );
1232 | */
1233 | return text;
1234 | }
1235 |
1236 | function _UnescapeSpecialChars(text) {
1237 | //
1238 | // Swap back in all the special characters we've hidden.
1239 | //
1240 | text = text.replace(/~E(\d+)E/g,
1241 | function (wholeMatch, m1) {
1242 | var charCodeToReplace = parseInt(m1);
1243 | return String.fromCharCode(charCodeToReplace);
1244 | }
1245 | );
1246 | return text;
1247 | }
1248 |
1249 | function _Outdent(text) {
1250 | //
1251 | // Remove one level of line-leading tabs or spaces
1252 | //
1253 |
1254 | // attacklab: hack around Konqueror 3.5.4 bug:
1255 | // "----------bug".replace(/^-/g,"") == "bug"
1256 |
1257 | text = text.replace(/^(\t|[ ]{1,4})/gm, "~0"); // attacklab: g_tab_width
1258 |
1259 | // attacklab: clean up hack
1260 | text = text.replace(/~0/g, "")
1261 |
1262 | return text;
1263 | }
1264 |
1265 | function _Detab(text) {
1266 | if (!/\t/.test(text))
1267 | return text;
1268 |
1269 | var spaces = [" ", " ", " ", " "],
1270 | skew = 0,
1271 | v;
1272 |
1273 | return text.replace(/[\n\t]/g, function (match, offset) {
1274 | if (match === "\n") {
1275 | skew = offset + 1;
1276 | return match;
1277 | }
1278 | v = (offset - skew) % 4;
1279 | skew = offset + 1;
1280 | return spaces[v];
1281 | });
1282 | }
1283 |
1284 | //
1285 | // attacklab: Utility functions
1286 | //
1287 |
1288 | var _problemUrlChars = /(?:["'*()[\]:]|~D)/g;
1289 |
1290 | // hex-encodes some unusual "problem" chars in URLs to avoid URL detection problems
1291 | function encodeProblemUrlChars(url) {
1292 | if (!url)
1293 | return "";
1294 |
1295 | var len = url.length;
1296 |
1297 | return url.replace(_problemUrlChars, function (match, offset) {
1298 | if (match == "~D") // escape for dollar
1299 | return "%24";
1300 | if (match == ":") {
1301 | if (offset == len - 1 || /[0-9\/]/.test(url.charAt(offset + 1)))
1302 | return ":"
1303 | }
1304 | return "%" + match.charCodeAt(0).toString(16);
1305 | });
1306 | }
1307 |
1308 |
1309 | function escapeCharacters(text, charsToEscape, afterBackslash) {
1310 | // First we have to escape the escape characters so that
1311 | // we can build a character class out of them
1312 | var regexString = "([" + charsToEscape.replace(/([\[\]\\])/g, "\\$1") + "])";
1313 |
1314 | if (afterBackslash) {
1315 | regexString = "\\\\" + regexString;
1316 | }
1317 |
1318 | var regex = new RegExp(regexString, "g");
1319 | text = text.replace(regex, escapeCharacters_callback);
1320 |
1321 | return text;
1322 | }
1323 |
1324 |
1325 | function escapeCharacters_callback(wholeMatch, m1) {
1326 | var charCodeToEscape = m1.charCodeAt(0);
1327 | return "~E" + charCodeToEscape + "E";
1328 | }
1329 |
1330 | }; // end of the Markdown.Converter constructor
1331 |
1332 | })();
1333 |
--------------------------------------------------------------------------------