├── exampleSite ├── static │ └── .gitkeep ├── content │ ├── about.md │ └── post │ │ ├── hello-hugo.md │ │ └── first.md └── config.toml ├── archetypes └── default.md ├── images ├── tn.png └── screenshot.png ├── static ├── img │ ├── author.jpg │ ├── pacman.jpg │ ├── favicon.ico │ └── logo.svg ├── fancybox │ ├── blank.gif │ ├── fancybox_loading.gif │ ├── fancybox_overlay.png │ ├── fancybox_sprite.png │ ├── fancybox_sprite@2x.png │ ├── fancybox_loading@2x.gif │ ├── helpers │ │ ├── fancybox_buttons.png │ │ ├── jquery.fancybox-thumbs.css │ │ ├── jquery.fancybox-buttons.css │ │ ├── jquery.fancybox-buttons.js │ │ ├── jquery.fancybox-thumbs.js │ │ └── jquery.fancybox-media.js │ ├── jquery.fancybox.css │ ├── jquery.fancybox.pack.js │ └── jquery.fancybox.js ├── font │ ├── FontAwesome.otf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ └── hack │ │ ├── fonts │ │ ├── eot │ │ │ ├── hack-bold-webfont.eot │ │ │ ├── hack-regular-webfont.eot │ │ │ ├── hack-boldoblique-webfont.eot │ │ │ ├── hack-regularoblique-webfont.eot │ │ │ └── latin │ │ │ │ ├── hack-bold-latin-webfont.eot │ │ │ │ ├── hack-regular-latin-webfont.eot │ │ │ │ ├── hack-boldoblique-latin-webfont.eot │ │ │ │ └── hack-regularoblique-latin-webfont.eot │ │ ├── ttf │ │ │ ├── hack-bold-webfont.ttf │ │ │ ├── hack-regular-webfont.ttf │ │ │ ├── hack-boldoblique-webfont.ttf │ │ │ ├── hack-regularoblique-webfont.ttf │ │ │ └── latin │ │ │ │ ├── hack-bold-latin-webfont.ttf │ │ │ │ ├── hack-regular-latin-webfont.ttf │ │ │ │ ├── hack-boldoblique-latin-webfont.ttf │ │ │ │ └── hack-regularoblique-latin-webfont.ttf │ │ ├── woff │ │ │ ├── hack-bold-webfont.woff │ │ │ ├── hack-regular-webfont.woff │ │ │ ├── hack-boldoblique-webfont.woff │ │ │ ├── hack-regularoblique-webfont.woff │ │ │ └── latin │ │ │ │ ├── hack-bold-latin-webfont.woff │ │ │ │ ├── hack-regular-latin-webfont.woff │ │ │ │ ├── hack-boldoblique-latin-webfont.woff │ │ │ │ └── hack-regularoblique-latin-webfont.woff │ │ └── woff2 │ │ │ ├── hack-bold-webfont.woff2 │ │ │ ├── hack-regular-webfont.woff2 │ │ │ ├── hack-boldoblique-webfont.woff2 │ │ │ ├── hack-regularoblique-webfont.woff2 │ │ │ └── latin │ │ │ ├── hack-bold-latin-webfont.woff2 │ │ │ ├── hack-regular-latin-webfont.woff2 │ │ │ ├── hack-boldoblique-latin-webfont.woff2 │ │ │ └── hack-regularoblique-latin-webfont.woff2 │ │ └── css │ │ ├── hack-extended.min.css │ │ ├── hack.min.css │ │ ├── hack-extended.css │ │ └── hack.css ├── highlight │ ├── styles │ │ └── github.css │ └── highlight.pack.js └── css │ └── style.css ├── layouts ├── partials │ ├── widgets │ │ ├── rss.html │ │ ├── tagcloud.html │ │ ├── tags.html │ │ ├── categories.html │ │ └── archive.html │ ├── article_footer.html │ ├── article.html │ ├── gtag_google_analytics.html │ ├── sidebar.html │ ├── google_analytics.html │ ├── article_catetags.html │ ├── article_header.html │ ├── article_content.html │ ├── header.html │ ├── footer.html │ ├── comment.html │ ├── head.html │ └── after_footer.html ├── _default │ ├── single.html │ └── list.html ├── 404.html └── index.html ├── theme.toml ├── LICENSE.md └── README.md /exampleSite/static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /archetypes/default.md: -------------------------------------------------------------------------------- 1 | +++ 2 | +++ 3 | -------------------------------------------------------------------------------- /images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/images/tn.png -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/images/screenshot.png -------------------------------------------------------------------------------- /static/img/author.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/img/author.jpg -------------------------------------------------------------------------------- /static/img/pacman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/img/pacman.jpg -------------------------------------------------------------------------------- /static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/img/favicon.ico -------------------------------------------------------------------------------- /static/fancybox/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/fancybox/blank.gif -------------------------------------------------------------------------------- /static/font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/FontAwesome.otf -------------------------------------------------------------------------------- /static/fancybox/fancybox_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/fancybox/fancybox_loading.gif -------------------------------------------------------------------------------- /static/fancybox/fancybox_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/fancybox/fancybox_overlay.png -------------------------------------------------------------------------------- /static/fancybox/fancybox_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/fancybox/fancybox_sprite.png -------------------------------------------------------------------------------- /static/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /static/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /static/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /static/fancybox/fancybox_sprite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/fancybox/fancybox_sprite@2x.png -------------------------------------------------------------------------------- /static/fancybox/fancybox_loading@2x.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/fancybox/fancybox_loading@2x.gif -------------------------------------------------------------------------------- /static/fancybox/helpers/fancybox_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/fancybox/helpers/fancybox_buttons.png -------------------------------------------------------------------------------- /static/font/hack/fonts/eot/hack-bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/eot/hack-bold-webfont.eot -------------------------------------------------------------------------------- /static/font/hack/fonts/ttf/hack-bold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/ttf/hack-bold-webfont.ttf -------------------------------------------------------------------------------- /static/font/hack/fonts/eot/hack-regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/eot/hack-regular-webfont.eot -------------------------------------------------------------------------------- /static/font/hack/fonts/ttf/hack-regular-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/ttf/hack-regular-webfont.ttf -------------------------------------------------------------------------------- /static/font/hack/fonts/woff/hack-bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff/hack-bold-webfont.woff -------------------------------------------------------------------------------- /static/font/hack/fonts/woff/hack-regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff/hack-regular-webfont.woff -------------------------------------------------------------------------------- /static/font/hack/fonts/woff2/hack-bold-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff2/hack-bold-webfont.woff2 -------------------------------------------------------------------------------- /static/font/hack/fonts/eot/hack-boldoblique-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/eot/hack-boldoblique-webfont.eot -------------------------------------------------------------------------------- /static/font/hack/fonts/ttf/hack-boldoblique-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/ttf/hack-boldoblique-webfont.ttf -------------------------------------------------------------------------------- /static/font/hack/fonts/woff2/hack-regular-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff2/hack-regular-webfont.woff2 -------------------------------------------------------------------------------- /static/font/hack/fonts/eot/hack-regularoblique-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/eot/hack-regularoblique-webfont.eot -------------------------------------------------------------------------------- /static/font/hack/fonts/ttf/hack-regularoblique-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/ttf/hack-regularoblique-webfont.ttf -------------------------------------------------------------------------------- /static/font/hack/fonts/woff/hack-boldoblique-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff/hack-boldoblique-webfont.woff -------------------------------------------------------------------------------- /static/font/hack/fonts/eot/latin/hack-bold-latin-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/eot/latin/hack-bold-latin-webfont.eot -------------------------------------------------------------------------------- /static/font/hack/fonts/ttf/latin/hack-bold-latin-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/ttf/latin/hack-bold-latin-webfont.ttf -------------------------------------------------------------------------------- /static/font/hack/fonts/woff/hack-regularoblique-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff/hack-regularoblique-webfont.woff -------------------------------------------------------------------------------- /static/font/hack/fonts/woff2/hack-boldoblique-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff2/hack-boldoblique-webfont.woff2 -------------------------------------------------------------------------------- /static/font/hack/fonts/eot/latin/hack-regular-latin-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/eot/latin/hack-regular-latin-webfont.eot -------------------------------------------------------------------------------- /static/font/hack/fonts/ttf/latin/hack-regular-latin-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/ttf/latin/hack-regular-latin-webfont.ttf -------------------------------------------------------------------------------- /static/font/hack/fonts/woff/latin/hack-bold-latin-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff/latin/hack-bold-latin-webfont.woff -------------------------------------------------------------------------------- /static/font/hack/fonts/woff2/hack-regularoblique-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff2/hack-regularoblique-webfont.woff2 -------------------------------------------------------------------------------- /static/font/hack/fonts/woff/latin/hack-regular-latin-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff/latin/hack-regular-latin-webfont.woff -------------------------------------------------------------------------------- /static/font/hack/fonts/woff2/latin/hack-bold-latin-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff2/latin/hack-bold-latin-webfont.woff2 -------------------------------------------------------------------------------- /static/font/hack/fonts/eot/latin/hack-boldoblique-latin-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/eot/latin/hack-boldoblique-latin-webfont.eot -------------------------------------------------------------------------------- /static/font/hack/fonts/ttf/latin/hack-boldoblique-latin-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/ttf/latin/hack-boldoblique-latin-webfont.ttf -------------------------------------------------------------------------------- /static/font/hack/fonts/woff2/latin/hack-regular-latin-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff2/latin/hack-regular-latin-webfont.woff2 -------------------------------------------------------------------------------- /static/font/hack/fonts/eot/latin/hack-regularoblique-latin-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/eot/latin/hack-regularoblique-latin-webfont.eot -------------------------------------------------------------------------------- /static/font/hack/fonts/ttf/latin/hack-regularoblique-latin-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/ttf/latin/hack-regularoblique-latin-webfont.ttf -------------------------------------------------------------------------------- /static/font/hack/fonts/woff/latin/hack-boldoblique-latin-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff/latin/hack-boldoblique-latin-webfont.woff -------------------------------------------------------------------------------- /static/font/hack/fonts/woff2/latin/hack-boldoblique-latin-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff2/latin/hack-boldoblique-latin-webfont.woff2 -------------------------------------------------------------------------------- /static/font/hack/fonts/woff/latin/hack-regularoblique-latin-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff/latin/hack-regularoblique-latin-webfont.woff -------------------------------------------------------------------------------- /exampleSite/content/about.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-03-20T23:28:02+08:00" 3 | title = "about" 4 | 5 | +++ 6 | 7 | ## 关于 8 | 9 | ### Hugo 10 | 11 | ### 主题 12 | 13 | balabalbalbalbal... 14 | 15 | 16 | -------------------------------------------------------------------------------- /static/font/hack/fonts/woff2/latin/hack-regularoblique-latin-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/HEAD/static/font/hack/fonts/woff2/latin/hack-regularoblique-latin-webfont.woff2 -------------------------------------------------------------------------------- /layouts/partials/widgets/rss.html: -------------------------------------------------------------------------------- 1 | {{ if .RSSLink }} 2 |
3 | {{ .Site.Params.Strings.Rss }} 4 |
5 | {{ end }} 6 | -------------------------------------------------------------------------------- /exampleSite/content/post/hello-hugo.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-02-20T15:34:05+08:00" 3 | title = "hello hugo" 4 | categories = ["思考感悟"] 5 | tags = ["Test", "Bar"] 6 | toc = true 7 | 8 | +++ 9 | 10 | # Hello Hugo 11 | 12 | Balalala... 13 | 14 | Balalala... 15 | 16 | Balalala... 17 | -------------------------------------------------------------------------------- /layouts/partials/article_footer.html: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ partial "head.html" . }} 2 | 3 |
4 | {{ partial "header.html" . }} 5 |
6 |
7 | {{ partial "article_content.html" . }} 8 | {{ partial "sidebar.html" . }} 9 |
10 | 11 | {{ partial "after_footer.html" .}} 12 | 13 | 14 | -------------------------------------------------------------------------------- /layouts/partials/article.html: -------------------------------------------------------------------------------- 1 |
2 | 7 |
8 | -------------------------------------------------------------------------------- /layouts/partials/gtag_google_analytics.html: -------------------------------------------------------------------------------- 1 | {{ if .Site.Params.GoogleAnalytics.gtag_ID }} 2 | 3 | 4 | 11 | {{ end }} 12 | -------------------------------------------------------------------------------- /layouts/partials/sidebar.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 11 |
12 | -------------------------------------------------------------------------------- /layouts/partials/widgets/tagcloud.html: -------------------------------------------------------------------------------- 1 | {{ if isset .Site.Taxonomies "tags" }} 2 | {{ if not (eq (len .Site.Taxonomies.tags) 0) }} 3 |
4 |

{{ .Site.Params.Strings.TagCloud | default "Tags Cloud" }}

5 |
6 | {{ range $name, $items := .Site.Taxonomies.tags }} 7 | {{ $name }} 8 | {{ end }} 9 |
10 |
11 | {{ end }} 12 | {{ end }} 13 | -------------------------------------------------------------------------------- /layouts/partials/widgets/tags.html: -------------------------------------------------------------------------------- 1 | {{ if isset .Site.Taxonomies "tags" }} 2 | {{ if not (eq (len .Site.Taxonomies.tags) 0) }} 3 |
4 |

{{ .Site.Params.Strings.Tags | default "Tags" }}

5 | 10 |
11 | {{ end }} 12 | {{ end }} 13 | -------------------------------------------------------------------------------- /layouts/404.html: -------------------------------------------------------------------------------- 1 | {{ partial "head.html" . }} 2 | 3 |
4 | {{ partial "header.html" . }} 5 |
6 |
7 |
8 | {{ if .Site.Params.Strings.PageNotFound }} 9 | {{ .Site.Params.Strings.PageNotFound }} 10 | {{ else }} 11 | Page Not Found! 12 | {{ end }} 13 |
14 | {{ partial "sidebar.html" . }} 15 |
16 | 17 | {{ partial "after_footer.html" .}} 18 | 19 | 20 | -------------------------------------------------------------------------------- /layouts/partials/widgets/categories.html: -------------------------------------------------------------------------------- 1 | {{ if isset .Site.Taxonomies "categories" }} 2 | {{ if not (eq (len .Site.Taxonomies.categories) 0) }} 3 |
4 |

{{ .Site.Params.Strings.Categories | default "Categories" }}

5 | 10 |
11 | {{ end }} 12 | {{ end }} 13 | -------------------------------------------------------------------------------- /layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ partial "head.html" . }} 2 | 3 |
4 | {{ partial "header.html" . }} 5 |
6 |
7 |
8 | {{ range .Data.Pages.GroupByDate "2006-01" }} 9 |

{{ .Key }}

10 | {{ range .Pages }} 11 | {{ partial "article.html" . }} 12 | {{ end }} 13 | {{ end }} 14 |
15 | {{ partial "sidebar.html" . }} 16 |
17 | 18 | {{ partial "after_footer.html" .}} 19 | 20 | 21 | -------------------------------------------------------------------------------- /layouts/partials/google_analytics.html: -------------------------------------------------------------------------------- 1 | {{ if .Site.Params.GoogleAnalytics.ID }} 2 | 11 | {{ end }} 12 | -------------------------------------------------------------------------------- /layouts/index.html: -------------------------------------------------------------------------------- 1 | {{ partial "head.html" . }} 2 | 3 |
4 | {{ partial "header.html" . }} 5 |
6 |
7 |
8 | {{ range $index,$data := first 10 (where site.RegularPages "Type" "post") }} 9 | {{ partial "article.html" $data }} 10 | {{ end }} 11 | 14 |
15 | {{ partial "sidebar.html" . }} 16 |
17 | 18 | {{ partial "after_footer.html" .}} 19 | 20 | 21 | -------------------------------------------------------------------------------- /layouts/partials/article_catetags.html: -------------------------------------------------------------------------------- 1 | {{ if isset .Params "tags" }} 2 | {{ if not (eq (len .Params.tags) 0) }} 3 |
4 | 5 | {{ range .Params.tags }} 6 | {{ . }} 7 | {{ end }} 8 |
9 | {{ end }} 10 | {{ end }} 11 | 12 | {{ if isset .Params "categories" }} 13 | {{ if not (eq (len .Params.categories) 0) }} 14 |
15 | 16 | {{ range .Params.categories }} 17 | {{ . }} 18 | {{ end }} 19 |
20 | {{ end }} 21 | {{ end }} 22 | -------------------------------------------------------------------------------- /theme.toml: -------------------------------------------------------------------------------- 1 | # theme.toml template for a Hugo theme 2 | # See https://github.com/spf13/hugoThemes#themetoml for an example 3 | 4 | name = "Hugo Pacman Theme" 5 | license = "MIT" 6 | licenselink = "https://github.com/coderzh/hugo-pacman-theme/blob/master/LICENSE.md" 7 | description = "" 8 | homepage = "https://github.com/coderzh/hugo-pacman-theme" 9 | tags = ["Pacman", "Blog", "Responsive"] 10 | features = ["", ""] 11 | min_version = 0.15 12 | 13 | [author] 14 | name = "coderzh" 15 | homepage = "https://github.com/coderzh/hugo-pacman-theme" 16 | 17 | # If porting an existing theme 18 | [original] 19 | name = "pacman" 20 | homepage = "https://github.com/A-limon/pacman" 21 | repo = "https://github.com/A-limon/pacman" 22 | -------------------------------------------------------------------------------- /layouts/partials/widgets/archive.html: -------------------------------------------------------------------------------- 1 | {{ if not (eq (len site.RegularPages) 0) }} 2 |
3 |

{{ .Site.Params.Strings.Archive | default "Archives" }}

4 | 12 | 13 |
14 | {{ end }} 15 | -------------------------------------------------------------------------------- /layouts/partials/article_header.html: -------------------------------------------------------------------------------- 1 |
2 |

3 | 4 |

5 |

By 6 | {{ if and (isset .Params "author") (isset .Params "author_homepage") }} 7 | {{ .Params.author }} 8 | {{ else }} 9 | {{ .Site.Author.Name | default "you" }} 10 | {{ end }} 11 |

12 |

13 | 14 |

15 |
16 | -------------------------------------------------------------------------------- /layouts/partials/article_content.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ partial "article_header.html" . }} 4 |
5 | {{ if isset .Params "toc"}} 6 |
7 | {{ .Site.Params.Strings.TableOfContents }} 8 | {{ .TableOfContents }} 9 |
10 | {{ end }} 11 | {{ .Content }} 12 | {{ if .Params.CreativeCommons }} 13 |
14 | 知识共享许可协议 18 |
19 |
20 | {{ end }} 21 |
22 | {{ partial "article_footer.html" . }} 23 |
24 | {{ partial "comment.html" . }} 25 |
26 | -------------------------------------------------------------------------------- /static/fancybox/helpers/jquery.fancybox-thumbs.css: -------------------------------------------------------------------------------- 1 | #fancybox-thumbs { 2 | position: fixed; 3 | left: 0; 4 | width: 100%; 5 | overflow: hidden; 6 | z-index: 8050; 7 | } 8 | 9 | #fancybox-thumbs.bottom { 10 | bottom: 2px; 11 | } 12 | 13 | #fancybox-thumbs.top { 14 | top: 2px; 15 | } 16 | 17 | #fancybox-thumbs ul { 18 | position: relative; 19 | list-style: none; 20 | margin: 0; 21 | padding: 0; 22 | } 23 | 24 | #fancybox-thumbs ul li { 25 | float: left; 26 | padding: 1px; 27 | opacity: 0.5; 28 | } 29 | 30 | #fancybox-thumbs ul li.active { 31 | opacity: 0.75; 32 | padding: 0; 33 | border: 1px solid #fff; 34 | } 35 | 36 | #fancybox-thumbs ul li:hover { 37 | opacity: 1; 38 | } 39 | 40 | #fancybox-thumbs ul li a { 41 | display: block; 42 | position: relative; 43 | overflow: hidden; 44 | border: 1px solid #222; 45 | background: #111; 46 | outline: none; 47 | } 48 | 49 | #fancybox-thumbs ul li img { 50 | display: block; 51 | position: relative; 52 | border: 0; 53 | padding: 0; 54 | max-width: none; 55 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 YOUR_NAME_HERE 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /layouts/partials/header.html: -------------------------------------------------------------------------------- 1 |
2 | 5 | 9 | 10 | 28 |
29 | -------------------------------------------------------------------------------- /exampleSite/content/post/first.md: -------------------------------------------------------------------------------- 1 | +++ 2 | date = "2016-03-20T12:13:19+08:00" 3 | title = "first" 4 | categories = ["技术文章"] 5 | tags = ["Foo", "Bar"] 6 | toc = true 7 | author = "coderzh" 8 | author_homepage = "http://blog.coderzh.com/post/" 9 | 10 | +++ 11 | 12 | ## 主题概况 13 | 14 | Balalalalala... 15 | 16 | Balalalalala... 17 | 18 | ## 安装指南 19 | 20 | 1. aaaaaaa 21 | 1. bbbbbbb 22 | 1. ccccccc 23 | 24 | ### 安装 25 | 26 | **bold** 27 | 28 | ### 启用 29 | 30 | 31 | ``` 32 | print('hello world!') 33 | ``` 34 | 35 | ### 更新 36 | 37 | > Blockquotes are very handy in email to emulate reply text. 38 | > This line is part of the same quote. 39 | 40 | ## 配置指南 41 | 42 | | Tables | Are | Cool | 43 | | ------------- |:-------------:| -----:| 44 | | col 3 is | right-aligned | $1600 | 45 | | col 2 is | centered | $12 | 46 | | zebra stripes | are neat | $1 | 47 | 48 | ### 属性 49 | 50 | [link text itself]: http://blog.coderzh.com 51 | 52 | ![qrcode](http://blog.coderzh.com/public/qrcode.jpg) 53 | 54 | ### 说明 55 | 56 | 1. First ordered list item 57 | 2. Another item 58 | * Unordered sub-list. 59 | 1. Actual numbers don't matter, just that it's a number 60 | 1. Ordered sub-list 61 | 4. And another item. 62 | 63 | ## Q&A 64 | 65 | Balabalabalabala... 66 | -------------------------------------------------------------------------------- /exampleSite/config.toml: -------------------------------------------------------------------------------- 1 | BaseURL = "http://coderzh.github.io/hugo-pacman-theme/" 2 | LanguageCode = "zh-CN" 3 | HasCJKLanguage = true 4 | Title = "Hugo PacMan Theme Demo" 5 | Theme = "hugo-pacman-theme" 6 | pygmentsStyle = "default" 7 | pygmentsUseClasses = true 8 | 9 | [Author] 10 | Name = "your-name" 11 | 12 | [outputs] 13 | home = [ "RSS", "HTML" ] 14 | 15 | [outputFormats] 16 | [outputFormats.RSS] 17 | mediatype = "application/rss" 18 | baseName = "feed" 19 | 20 | [Params] 21 | AuthorHomepage = "your-home-page" 22 | BottomIntroduce = "Introduce1
Introduce2" 23 | Description = "" 24 | Subtitle = "subtitle" 25 | Weibo = "" 26 | WeiboID = 123 27 | Twitter = "" 28 | GitHub = "" 29 | Facebook = "" 30 | LinkIn = "" 31 | Imglogo = "img/logo.svg" 32 | AuthorImg = "img/author.jpg" 33 | DateFormat = "2006年01月02日" 34 | MonthFormat = "2006年01月" 35 | FancyBox = true 36 | CreativeCommons = true 37 | MathJax = false 38 | 39 | [Params.GoogleAnalytics] 40 | ID = "" 41 | gtag_ID = "" 42 | 43 | [Params.Disqus] 44 | ShortName = "" 45 | 46 | [Params.Strings] 47 | Search = "搜索" 48 | PageNotFound = "你访问的页面不存在" 49 | ShowSideBar = "显示侧边栏" 50 | HideSideBar = "隐藏侧边栏" 51 | Categories = "分类" 52 | Archive = "归档" 53 | Tags = "标签" 54 | TagCloud = "标签云" 55 | Rss = "RSS 订阅" 56 | TableOfContents = "文章目录" 57 | 58 | [Menu] 59 | [[Menu.Main]] 60 | Name = "首页" 61 | URL = "/" 62 | Weight = 1 63 | [[Menu.Main]] 64 | Name = "关于" 65 | URL = "/about" 66 | Weight = 2 67 | -------------------------------------------------------------------------------- /layouts/partials/footer.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # hugo-pacman-theme 2 | 3 | Demo: http://coderzh.github.io/hugo-pacman-theme/ 4 | 5 | ## config.toml 6 | 7 | ```toml 8 | BaseURL = "http://coderzh.github.io/hugo-pacman-theme/" 9 | LanguageCode = "zh-CN" 10 | HasCJKLanguage = true 11 | Title = "Hugo PacMan Theme Demo" 12 | Theme = "hugo-pacman-theme" 13 | pygmentsStyle = "default" 14 | pygmentsUseClasses = true 15 | 16 | [Author] 17 | Name = "coderzh" 18 | 19 | [outputs] 20 | home = [ "RSS", "HTML" ] 21 | 22 | [outputFormats] 23 | [outputFormats.RSS] 24 | mediatype = "application/rss" 25 | baseName = "feed" 26 | 27 | [Params] 28 | AuthorHomepage = "https://blog.coderzh.com" 29 | BottomIntroduce = "Introduce1
Introduce2" 30 | Description = "" 31 | Subtitle = "subtitle" 32 | Weibo = "coderzh" 33 | WeiboID = 1816308191 34 | Twitter = "coderzh" 35 | GitHub = "coderzh" 36 | Facebook = "coderzh" 37 | LinkIn = "coderzh" 38 | Imglogo = "img/logo.svg" 39 | AuthorImg = "img/author.jpg" 40 | DateFormat = "2006年01月02日" 41 | MonthFormat = "2006年01月" 42 | FancyBox = true 43 | 44 | [Params.GoogleAnalytics] 45 | ID = "UA-10147768-2" 46 | 47 | [Params.Disqus] 48 | ShortName = "coderzh" 49 | 50 | [Params.Strings] 51 | Search = "搜索" 52 | PageNotFound = "你访问的页面不存在" 53 | ShowSideBar = "显示侧边栏" 54 | HideSideBar = "隐藏侧边栏" 55 | Categories = "分类" 56 | Archive = "归档" 57 | Tags = "标签" 58 | TagCloud = "标签云" 59 | Rss = "RSS 订阅" 60 | TableOfContents = "文章目录" 61 | 62 | [Menu] 63 | [[Menu.Main]] 64 | Name = "首页" 65 | URL = "/" 66 | Weight = 1 67 | [[Menu.Main]] 68 | Name = "关于" 69 | URL = "/about" 70 | Weight = 2 71 | ``` 72 | 73 | ## ScreenShot 74 | 75 | ![hugo-pacman-theme](https://raw.githubusercontent.com/coderzh/hugo-pacman-theme/eda9c351a538558f42a0b086a9320c99dd98e579/images/screenshot.png) 76 | -------------------------------------------------------------------------------- /layouts/partials/comment.html: -------------------------------------------------------------------------------- 1 | {{ if .Site.Params.DuoShuo.ShortName }} 2 |
3 |
5 |
6 | 17 | {{ end }} 18 | 19 | {{ if .Site.Params.Disqus.ShortName }} 20 |
21 |
22 |
23 | 53 | 54 | {{ end }} 55 | -------------------------------------------------------------------------------- /static/font/hack/css/hack-extended.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Hack v2.010 by Chris Simpkins - https://sourcefoundry.org/hack/ 3 | * Licenses - Fonts: Modified SIL OFL 1.1 + Bitstream Vera license, CSS: MIT License 4 | */@font-face{font-family:'Hack';src:url('../fonts/eot/hack-regular-webfont.eot?v=2.010');src:url('../fonts/eot/hack-regular-webfont.eot?#iefix&v=2.010') format('embedded-opentype'),url('../fonts/woff2/hack-regular-webfont.woff2?v=2.010') format('woff2'),url('../fonts/woff/hack-regular-webfont.woff?v=2.010') format('woff'),url('../fonts/ttf/hack-regular-webfont.ttf?v=2.010') format('truetype'),url('../fonts/svg/hack-regular-webfont.svg?v=2.010#hackregular') format('svg');font-weight:400;font-style:normal}@font-face{font-family:'Hack';src:url('../fonts/eot/hack-bold-webfont.eot?v=2.010');src:url('../fonts/eot/hack-bold-webfont.eot?#iefix&v=2.010') format('embedded-opentype'),url('../fonts/woff2/hack-bold-webfont.woff2?v=2.010') format('woff2'),url('../fonts/woff/hack-bold-webfont.woff?v=2.010') format('woff'),url('../fonts/ttf/hack-bold-webfont.ttf?v=2.010') format('truetype'),url('../fonts/svg/hack-bold-webfont.svg?v=2.010#hackbold') format('svg');font-weight:700;font-style:normal}@font-face{font-family:'Hack';src:url('../fonts/eot/hack-regularoblique-webfont.eot?v=2.010');src:url('../fonts/eot/hack-regularoblique-webfont.eot?#iefix&v=2.010') format('embedded-opentype'),url('../fonts/woff2/hack-regularoblique-webfont.woff2?v=2.010') format('woff2'),url('../fonts/woff/hack-regularoblique-webfont.woff?v=2.010') format('woff'),url('../fonts/ttf/hack-regularoblique-webfont.ttf?v=2.010') format('truetype'),url('../fonts/svg/hack-regularoblique-webfont.svg?v=2.010#hackregularoblique') format('svg');font-weight:400;font-style:italic}@font-face{font-family:'Hack';src:url('../fonts/eot/hack-boldoblique-webfont.eot?v=2.010');src:url('../fonts/eot/hack-boldoblique-webfont.eot?#iefix&v=2.010') format('embedded-opentype'),url('../fonts/woff2/hack-boldoblique-webfont.woff2?v=2.010') format('woff2'),url('../fonts/woff/hack-boldoblique-webfont.woff?v=2.010') format('woff'),url('../fonts/ttf/hack-boldoblique-webfont.ttf?v=2.010') format('truetype'),url('../fonts/svg/hack-boldoblique-webfont.svg?v=2.010#hackboldoblique') format('svg');font-weight:700;font-style:italic} -------------------------------------------------------------------------------- /static/highlight/styles/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | color: #333; 12 | background: #f8f8f8; 13 | -webkit-text-size-adjust: none; 14 | } 15 | 16 | .hljs-comment, 17 | .diff .hljs-header { 18 | color: #998; 19 | } 20 | 21 | .hljs-keyword, 22 | .css .rule .hljs-keyword, 23 | .hljs-winutils, 24 | .nginx .hljs-title, 25 | .hljs-subst, 26 | .hljs-request, 27 | .hljs-status { 28 | color: #333; 29 | font-weight: bold; 30 | } 31 | 32 | .hljs-number, 33 | .hljs-hexcolor, 34 | .ruby .hljs-constant { 35 | color: #008080; 36 | } 37 | 38 | .hljs-string, 39 | .hljs-tag .hljs-value, 40 | .hljs-doctag, 41 | .tex .hljs-formula { 42 | color: #d14; 43 | } 44 | 45 | .hljs-title, 46 | .hljs-id, 47 | .scss .hljs-preprocessor { 48 | color: #900; 49 | font-weight: bold; 50 | } 51 | 52 | .hljs-list .hljs-keyword, 53 | .hljs-subst { 54 | font-weight: normal; 55 | } 56 | 57 | .hljs-class .hljs-title, 58 | .hljs-type, 59 | .vhdl .hljs-literal, 60 | .tex .hljs-command { 61 | color: #458; 62 | font-weight: bold; 63 | } 64 | 65 | .hljs-tag, 66 | .hljs-tag .hljs-title, 67 | .hljs-rule .hljs-property, 68 | .django .hljs-tag .hljs-keyword { 69 | color: #000080; 70 | font-weight: normal; 71 | } 72 | 73 | .hljs-attribute, 74 | .hljs-variable, 75 | .lisp .hljs-body, 76 | .hljs-name { 77 | color: #008080; 78 | } 79 | 80 | .hljs-regexp { 81 | color: #009926; 82 | } 83 | 84 | .hljs-symbol, 85 | .ruby .hljs-symbol .hljs-string, 86 | .lisp .hljs-keyword, 87 | .clojure .hljs-keyword, 88 | .scheme .hljs-keyword, 89 | .tex .hljs-special, 90 | .hljs-prompt { 91 | color: #990073; 92 | } 93 | 94 | .hljs-built_in { 95 | color: #0086b3; 96 | } 97 | 98 | .hljs-preprocessor, 99 | .hljs-pragma, 100 | .hljs-pi, 101 | .hljs-doctype, 102 | .hljs-shebang, 103 | .hljs-cdata { 104 | color: #999; 105 | font-weight: bold; 106 | } 107 | 108 | .hljs-deletion { 109 | background: #fdd; 110 | } 111 | 112 | .hljs-addition { 113 | background: #dfd; 114 | } 115 | 116 | .diff .hljs-change { 117 | background: #0086b3; 118 | } 119 | 120 | .hljs-chunk { 121 | color: #aaa; 122 | } 123 | -------------------------------------------------------------------------------- /static/font/hack/css/hack.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Hack v2.010 by Chris Simpkins - https://sourcefoundry.org/hack/ 3 | * Licenses - Fonts: Modified SIL OFL 1.1 + Bitstream Vera license, CSS: MIT License 4 | */@font-face{font-family:'Hack';src:url('../fonts/eot/latin/hack-regular-latin-webfont.eot?v=2.010');src:url('../fonts/eot/latin/hack-regular-latin-webfont.eot?#iefix&v=2.010') format('embedded-opentype'),url('../fonts/woff2/latin/hack-regular-latin-webfont.woff2?v=2.010') format('woff2'),url('../fonts/woff/latin/hack-regular-latin-webfont.woff?v=2.010') format('woff'),url('../fonts/ttf/latin/hack-regular-latin-webfont.ttf?v=2.010') format('truetype'),url('../fonts/svg/latin/hack-regular-latin-webfont.svg?v=2.010#hackregular') format('svg');font-weight:400;font-style:normal}@font-face{font-family:'Hack';src:url('../fonts/eot/latin/hack-bold-latin-webfont.eot?v=2.010');src:url('../fonts/eot/latin/hack-bold-latin-webfont.eot?#iefix&v=2.010') format('embedded-opentype'),url('../fonts/woff2/latin/hack-bold-latin-webfont.woff2?v=2.010') format('woff2'),url('../fonts/woff/latin/hack-bold-latin-webfont.woff?v=2.010') format('woff'),url('../fonts/ttf/latin/hack-bold-latin-webfont.ttf?v=2.010') format('truetype'),url('../fonts/svg/latin/hack-bold-latin-webfont.svg?v=2.010#hackbold') format('svg');font-weight:700;font-style:normal}@font-face{font-family:'Hack';src:url('../fonts/eot/latin/hack-regularoblique-latin-webfont.eot?v=2.010');src:url('../fonts/eot/latin/hack-regularoblique-latin-webfont.eot?#iefix&v=2.010') format('embedded-opentype'),url('../fonts/woff2/latin/hack-regularoblique-latin-webfont.woff2?v=2.010') format('woff2'),url('../fonts/woff/latin/hack-regularoblique-latin-webfont.woff?v=2.010') format('woff'),url('../fonts/ttf/latin/hack-regularoblique-latin-webfont.ttf?v=2.010') format('truetype'),url('../fonts/svg/latin/hack-regularoblique-latin-webfont.svg?v=2.010#hackoblique') format('svg');font-weight:400;font-style:italic}@font-face{font-family:'Hack';src:url('../fonts/eot/latin/hack-boldoblique-latin-webfont.eot?v=2.010');src:url('../fonts/eot/latin/hack-boldoblique-latin-webfont.eot?#iefix&v=2.010') format('embedded-opentype'),url('../fonts/woff2/latin/hack-boldoblique-latin-webfont.woff2?v=2.010') format('woff2'),url('../fonts/woff/latin/hack-boldoblique-latin-webfont.woff?v=2.010') format('woff'),url('../fonts/ttf/latin/hack-boldoblique-latin-webfont.ttf?v=2.010') format('truetype'),url('../fonts/svg/latin/hack-boldoblique-latin-webfont.svg?v=2.010#hackboldoblique') format('svg');font-weight:700;font-style:italic} 5 | -------------------------------------------------------------------------------- /layouts/partials/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ if ne .URL "/" }}{{ .Title }} - {{ end }}{{ .Site.Title }} 6 | 7 | {{ if .Keywords }}{{ else if eq .URL "/" }}{{ end }} 8 | 9 | {{ with .Site.Author.Name }}{{ end }} 10 | 11 | 12 | 13 | {{ if .Site.Params.Twitter }} 14 | 15 | {{ end }} 16 | {{ with .Description }}{{ else }} 17 | {{ end }} 18 | {{ if .RSSLink }}{{ end }} 19 | 20 | 21 | 22 | 23 | 24 | 25 | {{ partial "gtag_google_analytics.html" . }} 26 | {{ if .Site.Params.MathJax }}{{ end }} 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /static/font/hack/css/hack-extended.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Hack v2.010 by Chris Simpkins - https://sourcefoundry.org/hack/ 3 | * Licenses - Fonts: Modified SIL OFL 1.1 + Bitstream Vera license, CSS: MIT License 4 | */ 5 | /* FONT PATHS 6 | * -------------------------- */ 7 | @font-face { 8 | font-family: 'Hack'; 9 | src: url('../fonts/eot/hack-regular-webfont.eot?v=2.010'); 10 | src: url('../fonts/eot/hack-regular-webfont.eot?#iefix&v=2.010') format('embedded-opentype'), url('../fonts/woff2/hack-regular-webfont.woff2?v=2.010') format('woff2'), url('../fonts/woff/hack-regular-webfont.woff?v=2.010') format('woff'), url('../fonts/ttf/hack-regular-webfont.ttf?v=2.010') format('truetype'), url('../fonts/svg/hack-regular-webfont.svg?v=2.010#hackregular') format('svg'); 11 | font-weight: 400; 12 | font-style: normal; 13 | } 14 | 15 | @font-face { 16 | font-family: 'Hack'; 17 | src: url('../fonts/eot/hack-bold-webfont.eot?v=2.010'); 18 | src: url('../fonts/eot/hack-bold-webfont.eot?#iefix&v=2.010') format('embedded-opentype'), url('../fonts/woff2/hack-bold-webfont.woff2?v=2.010') format('woff2'), url('../fonts/woff/hack-bold-webfont.woff?v=2.010') format('woff'), url('../fonts/ttf/hack-bold-webfont.ttf?v=2.010') format('truetype'), url('../fonts/svg/hack-bold-webfont.svg?v=2.010#hackbold') format('svg'); 19 | font-weight: 700; 20 | font-style: normal; 21 | } 22 | 23 | @font-face { 24 | font-family: 'Hack'; 25 | src: url('../fonts/eot/hack-regularoblique-webfont.eot?v=2.010'); 26 | src: url('../fonts/eot/hack-regularoblique-webfont.eot?#iefix&v=2.010') format('embedded-opentype'), url('../fonts/woff2/hack-regularoblique-webfont.woff2?v=2.010') format('woff2'), url('../fonts/woff/hack-regularoblique-webfont.woff?v=2.010') format('woff'), url('../fonts/ttf/hack-regularoblique-webfont.ttf?v=2.010') format('truetype'), url('../fonts/svg/hack-regularoblique-webfont.svg?v=2.010#hackregularoblique') format('svg'); 27 | font-weight: 400; 28 | font-style: italic; 29 | } 30 | 31 | @font-face { 32 | font-family: 'Hack'; 33 | src: url('../fonts/eot/hack-boldoblique-webfont.eot?v=2.010'); 34 | src: url('../fonts/eot/hack-boldoblique-webfont.eot?#iefix&v=2.010') format('embedded-opentype'), url('../fonts/woff2/hack-boldoblique-webfont.woff2?v=2.010') format('woff2'), url('../fonts/woff/hack-boldoblique-webfont.woff?v=2.010') format('woff'), url('../fonts/ttf/hack-boldoblique-webfont.ttf?v=2.010') format('truetype'), url('../fonts/svg/hack-boldoblique-webfont.svg?v=2.010#hackboldoblique') format('svg'); 35 | font-weight: 700; 36 | font-style: italic; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /static/font/hack/css/hack.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Hack v2.010 by Chris Simpkins - https://sourcefoundry.org/hack/ 3 | * Licenses - Fonts: Modified SIL OFL 1.1 + Bitstream Vera license, CSS: MIT License 4 | */ 5 | /* FONT PATHS 6 | * -------------------------- */ 7 | @font-face { 8 | font-family: 'Hack'; 9 | src: url('../fonts/eot/latin/hack-regular-latin-webfont.eot?v=2.010'); 10 | src: url('../fonts/eot/latin/hack-regular-latin-webfont.eot?#iefix&v=2.010') format('embedded-opentype'), url('../fonts/woff2/latin/hack-regular-latin-webfont.woff2?v=2.010') format('woff2'), url('../fonts/woff/latin/hack-regular-latin-webfont.woff?v=2.010') format('woff'), url('../fonts/ttf/latin/hack-regular-latin-webfont.ttf?v=2.010') format('truetype'), url('../fonts/svg/latin/hack-regular-latin-webfont.svg?v=2.010#hackregular') format('svg'); 11 | font-weight: 400; 12 | font-style: normal; 13 | } 14 | 15 | @font-face { 16 | font-family: 'Hack'; 17 | src: url('../fonts/eot/latin/hack-bold-latin-webfont.eot?v=2.010'); 18 | src: url('../fonts/eot/latin/hack-bold-latin-webfont.eot?#iefix&v=2.010') format('embedded-opentype'), url('../fonts/woff2/latin/hack-bold-latin-webfont.woff2?v=2.010') format('woff2'), url('../fonts/woff/latin/hack-bold-latin-webfont.woff?v=2.010') format('woff'), url('../fonts/ttf/latin/hack-bold-latin-webfont.ttf?v=2.010') format('truetype'), url('../fonts/svg/latin/hack-bold-latin-webfont.svg?v=2.010#hackbold') format('svg'); 19 | font-weight: 700; 20 | font-style: normal; 21 | } 22 | 23 | @font-face { 24 | font-family: 'Hack'; 25 | src: url('../fonts/eot/latin/hack-regularoblique-latin-webfont.eot?v=2.010'); 26 | src: url('../fonts/eot/latin/hack-regularoblique-latin-webfont.eot?#iefix&v=2.010') format('embedded-opentype'), url('../fonts/woff2/latin/hack-regularoblique-latin-webfont.woff2?v=2.010') format('woff2'), url('../fonts/woff/latin/hack-regularoblique-latin-webfont.woff?v=2.010') format('woff'), url('../fonts/ttf/latin/hack-regularoblique-latin-webfont.ttf?v=2.010') format('truetype'), url('../fonts/svg/latin/hack-regularoblique-latin-webfont.svg?v=2.010#hackoblique') format('svg'); 27 | font-weight: 400; 28 | font-style: italic; 29 | } 30 | 31 | @font-face { 32 | font-family: 'Hack'; 33 | src: url('../fonts/eot/latin/hack-boldoblique-latin-webfont.eot?v=2.010'); 34 | src: url('../fonts/eot/latin/hack-boldoblique-latin-webfont.eot?#iefix&v=2.010') format('embedded-opentype'), url('../fonts/woff2/latin/hack-boldoblique-latin-webfont.woff2?v=2.010') format('woff2'), url('../fonts/woff/latin/hack-boldoblique-latin-webfont.woff?v=2.010') format('woff'), url('../fonts/ttf/latin/hack-boldoblique-latin-webfont.ttf?v=2.010') format('truetype'), url('../fonts/svg/latin/hack-boldoblique-latin-webfont.svg?v=2.010#hackboldoblique') format('svg'); 35 | font-weight: 700; 36 | font-style: italic; 37 | } 38 | -------------------------------------------------------------------------------- /static/fancybox/helpers/jquery.fancybox-buttons.css: -------------------------------------------------------------------------------- 1 | #fancybox-buttons { 2 | position: fixed; 3 | left: 0; 4 | width: 100%; 5 | z-index: 8050; 6 | } 7 | 8 | #fancybox-buttons.top { 9 | top: 10px; 10 | } 11 | 12 | #fancybox-buttons.bottom { 13 | bottom: 10px; 14 | } 15 | 16 | #fancybox-buttons ul { 17 | display: block; 18 | width: 166px; 19 | height: 30px; 20 | margin: 0 auto; 21 | padding: 0; 22 | list-style: none; 23 | border: 1px solid #111; 24 | border-radius: 3px; 25 | -webkit-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); 26 | -moz-box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); 27 | box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); 28 | background: rgb(50,50,50); 29 | background: -moz-linear-gradient(top, rgb(68,68,68) 0%, rgb(52,52,52) 50%, rgb(41,41,41) 50%, rgb(51,51,51) 100%); 30 | background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(68,68,68)), color-stop(50%,rgb(52,52,52)), color-stop(50%,rgb(41,41,41)), color-stop(100%,rgb(51,51,51))); 31 | background: -webkit-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 32 | background: -o-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 33 | background: -ms-linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 34 | background: linear-gradient(top, rgb(68,68,68) 0%,rgb(52,52,52) 50%,rgb(41,41,41) 50%,rgb(51,51,51) 100%); 35 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#222222',GradientType=0 ); 36 | } 37 | 38 | #fancybox-buttons ul li { 39 | float: left; 40 | margin: 0; 41 | padding: 0; 42 | } 43 | 44 | #fancybox-buttons a { 45 | display: block; 46 | width: 30px; 47 | height: 30px; 48 | text-indent: -9999px; 49 | background-color: transparent; 50 | background-image: url('fancybox_buttons.png'); 51 | background-repeat: no-repeat; 52 | outline: none; 53 | opacity: 0.8; 54 | } 55 | 56 | #fancybox-buttons a:hover { 57 | opacity: 1; 58 | } 59 | 60 | #fancybox-buttons a.btnPrev { 61 | background-position: 5px 0; 62 | } 63 | 64 | #fancybox-buttons a.btnNext { 65 | background-position: -33px 0; 66 | border-right: 1px solid #3e3e3e; 67 | } 68 | 69 | #fancybox-buttons a.btnPlay { 70 | background-position: 0 -30px; 71 | } 72 | 73 | #fancybox-buttons a.btnPlayOn { 74 | background-position: -30px -30px; 75 | } 76 | 77 | #fancybox-buttons a.btnToggle { 78 | background-position: 3px -60px; 79 | border-left: 1px solid #111; 80 | border-right: 1px solid #3e3e3e; 81 | width: 35px 82 | } 83 | 84 | #fancybox-buttons a.btnToggleOn { 85 | background-position: -27px -60px; 86 | } 87 | 88 | #fancybox-buttons a.btnClose { 89 | border-left: 1px solid #111; 90 | width: 35px; 91 | background-position: -56px 0px; 92 | } 93 | 94 | #fancybox-buttons a.btnDisabled { 95 | opacity : 0.4; 96 | cursor: default; 97 | } -------------------------------------------------------------------------------- /static/img/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 33 | -------------------------------------------------------------------------------- /static/fancybox/helpers/jquery.fancybox-buttons.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Buttons helper for fancyBox 3 | * version: 1.0.5 (Mon, 15 Oct 2012) 4 | * @requires fancyBox v2.0 or later 5 | * 6 | * Usage: 7 | * $(".fancybox").fancybox({ 8 | * helpers : { 9 | * buttons: { 10 | * position : 'top' 11 | * } 12 | * } 13 | * }); 14 | * 15 | */ 16 | ;(function ($) { 17 | //Shortcut for fancyBox object 18 | var F = $.fancybox; 19 | 20 | //Add helper object 21 | F.helpers.buttons = { 22 | defaults : { 23 | skipSingle : false, // disables if gallery contains single image 24 | position : 'top', // 'top' or 'bottom' 25 | tpl : '
' 26 | }, 27 | 28 | list : null, 29 | buttons: null, 30 | 31 | beforeLoad: function (opts, obj) { 32 | //Remove self if gallery do not have at least two items 33 | 34 | if (opts.skipSingle && obj.group.length < 2) { 35 | obj.helpers.buttons = false; 36 | obj.closeBtn = true; 37 | 38 | return; 39 | } 40 | 41 | //Increase top margin to give space for buttons 42 | obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30; 43 | }, 44 | 45 | onPlayStart: function () { 46 | if (this.buttons) { 47 | this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn'); 48 | } 49 | }, 50 | 51 | onPlayEnd: function () { 52 | if (this.buttons) { 53 | this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn'); 54 | } 55 | }, 56 | 57 | afterShow: function (opts, obj) { 58 | var buttons = this.buttons; 59 | 60 | if (!buttons) { 61 | this.list = $(opts.tpl).addClass(opts.position).appendTo('body'); 62 | 63 | buttons = { 64 | prev : this.list.find('.btnPrev').click( F.prev ), 65 | next : this.list.find('.btnNext').click( F.next ), 66 | play : this.list.find('.btnPlay').click( F.play ), 67 | toggle : this.list.find('.btnToggle').click( F.toggle ), 68 | close : this.list.find('.btnClose').click( F.close ) 69 | } 70 | } 71 | 72 | //Prev 73 | if (obj.index > 0 || obj.loop) { 74 | buttons.prev.removeClass('btnDisabled'); 75 | } else { 76 | buttons.prev.addClass('btnDisabled'); 77 | } 78 | 79 | //Next / Play 80 | if (obj.loop || obj.index < obj.group.length - 1) { 81 | buttons.next.removeClass('btnDisabled'); 82 | buttons.play.removeClass('btnDisabled'); 83 | 84 | } else { 85 | buttons.next.addClass('btnDisabled'); 86 | buttons.play.addClass('btnDisabled'); 87 | } 88 | 89 | this.buttons = buttons; 90 | 91 | this.onUpdate(opts, obj); 92 | }, 93 | 94 | onUpdate: function (opts, obj) { 95 | var toggle; 96 | 97 | if (!this.buttons) { 98 | return; 99 | } 100 | 101 | toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn'); 102 | 103 | //Size toggle button 104 | if (obj.canShrink) { 105 | toggle.addClass('btnToggleOn'); 106 | 107 | } else if (!obj.canExpand) { 108 | toggle.addClass('btnDisabled'); 109 | } 110 | }, 111 | 112 | beforeClose: function () { 113 | if (this.list) { 114 | this.list.remove(); 115 | } 116 | 117 | this.list = null; 118 | this.buttons = null; 119 | } 120 | }; 121 | 122 | }(jQuery)); 123 | -------------------------------------------------------------------------------- /static/fancybox/helpers/jquery.fancybox-thumbs.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Thumbnail helper for fancyBox 3 | * version: 1.0.7 (Mon, 01 Oct 2012) 4 | * @requires fancyBox v2.0 or later 5 | * 6 | * Usage: 7 | * $(".fancybox").fancybox({ 8 | * helpers : { 9 | * thumbs: { 10 | * width : 50, 11 | * height : 50 12 | * } 13 | * } 14 | * }); 15 | * 16 | */ 17 | ;(function ($) { 18 | //Shortcut for fancyBox object 19 | var F = $.fancybox; 20 | 21 | //Add helper object 22 | F.helpers.thumbs = { 23 | defaults : { 24 | width : 50, // thumbnail width 25 | height : 50, // thumbnail height 26 | position : 'bottom', // 'top' or 'bottom' 27 | source : function ( item ) { // function to obtain the URL of the thumbnail image 28 | var href; 29 | 30 | if (item.element) { 31 | href = $(item.element).find('img').attr('src'); 32 | } 33 | 34 | if (!href && item.type === 'image' && item.href) { 35 | href = item.href; 36 | } 37 | 38 | return href; 39 | } 40 | }, 41 | 42 | wrap : null, 43 | list : null, 44 | width : 0, 45 | 46 | init: function (opts, obj) { 47 | var that = this, 48 | list, 49 | thumbWidth = opts.width, 50 | thumbHeight = opts.height, 51 | thumbSource = opts.source; 52 | 53 | //Build list structure 54 | list = ''; 55 | 56 | for (var n = 0; n < obj.group.length; n++) { 57 | list += '
  • '; 58 | } 59 | 60 | this.wrap = $('
    ').addClass(opts.position).appendTo('body'); 61 | this.list = $('').appendTo(this.wrap); 62 | 63 | //Load each thumbnail 64 | $.each(obj.group, function (i) { 65 | var el = obj.group[ i ], 66 | href = thumbSource( el ); 67 | 68 | if (!href) { 69 | return; 70 | } 71 | 72 | $("").load(function () { 73 | var width = this.width, 74 | height = this.height, 75 | widthRatio, heightRatio, parent; 76 | 77 | if (!that.list || !width || !height) { 78 | return; 79 | } 80 | 81 | //Calculate thumbnail width/height and center it 82 | widthRatio = width / thumbWidth; 83 | heightRatio = height / thumbHeight; 84 | 85 | parent = that.list.children().eq(i).find('a'); 86 | 87 | if (widthRatio >= 1 && heightRatio >= 1) { 88 | if (widthRatio > heightRatio) { 89 | width = Math.floor(width / heightRatio); 90 | height = thumbHeight; 91 | 92 | } else { 93 | width = thumbWidth; 94 | height = Math.floor(height / widthRatio); 95 | } 96 | } 97 | 98 | $(this).css({ 99 | width : width, 100 | height : height, 101 | top : Math.floor(thumbHeight / 2 - height / 2), 102 | left : Math.floor(thumbWidth / 2 - width / 2) 103 | }); 104 | 105 | parent.width(thumbWidth).height(thumbHeight); 106 | 107 | $(this).hide().appendTo(parent).fadeIn(300); 108 | 109 | }) 110 | .attr('src', href) 111 | .attr('title', el.title); 112 | }); 113 | 114 | //Set initial width 115 | this.width = this.list.children().eq(0).outerWidth(true); 116 | 117 | this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))); 118 | }, 119 | 120 | beforeLoad: function (opts, obj) { 121 | //Remove self if gallery do not have at least two items 122 | if (obj.group.length < 2) { 123 | obj.helpers.thumbs = false; 124 | 125 | return; 126 | } 127 | 128 | //Increase bottom margin to give space for thumbs 129 | obj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15); 130 | }, 131 | 132 | afterShow: function (opts, obj) { 133 | //Check if exists and create or update list 134 | if (this.list) { 135 | this.onUpdate(opts, obj); 136 | 137 | } else { 138 | this.init(opts, obj); 139 | } 140 | 141 | //Set active element 142 | this.list.children().removeClass('active').eq(obj.index).addClass('active'); 143 | }, 144 | 145 | //Center list 146 | onUpdate: function (opts, obj) { 147 | if (this.list) { 148 | this.list.stop(true).animate({ 149 | 'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)) 150 | }, 150); 151 | } 152 | }, 153 | 154 | beforeClose: function () { 155 | if (this.wrap) { 156 | this.wrap.remove(); 157 | } 158 | 159 | this.wrap = null; 160 | this.list = null; 161 | this.width = 0; 162 | } 163 | } 164 | 165 | }(jQuery)); -------------------------------------------------------------------------------- /layouts/partials/after_footer.html: -------------------------------------------------------------------------------- 1 | 2 | 55 | {{ if eq .Section "post" }} 56 | 87 | {{ end }} 88 | 115 | {{ if or (eq .Section "tag") (eq .Section "category") }} 116 | 133 | {{ end }} 134 | {{ if and (eq .Section "post") (.Site.Params.FancyBox) }} 135 | 136 | 137 | 155 | {{ end }} 156 | {{ partial "google_analytics.html" . }} 157 | -------------------------------------------------------------------------------- /static/fancybox/jquery.fancybox.css: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 2 | .fancybox-wrap, 3 | .fancybox-skin, 4 | .fancybox-outer, 5 | .fancybox-inner, 6 | .fancybox-image, 7 | .fancybox-wrap iframe, 8 | .fancybox-wrap object, 9 | .fancybox-nav, 10 | .fancybox-nav span, 11 | .fancybox-tmp 12 | { 13 | padding: 0; 14 | margin: 0; 15 | border: 0; 16 | outline: none; 17 | vertical-align: top; 18 | } 19 | 20 | .fancybox-wrap { 21 | position: absolute; 22 | top: 0; 23 | left: 0; 24 | z-index: 8020; 25 | } 26 | 27 | .fancybox-skin { 28 | position: relative; 29 | background: #f9f9f9; 30 | color: #444; 31 | text-shadow: none; 32 | -webkit-border-radius: 4px; 33 | -moz-border-radius: 4px; 34 | border-radius: 4px; 35 | } 36 | 37 | .fancybox-opened { 38 | z-index: 8030; 39 | } 40 | 41 | .fancybox-opened .fancybox-skin { 42 | -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 43 | -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 44 | box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 45 | } 46 | 47 | .fancybox-outer, .fancybox-inner { 48 | position: relative; 49 | } 50 | 51 | .fancybox-inner { 52 | overflow: hidden; 53 | } 54 | 55 | .fancybox-type-iframe .fancybox-inner { 56 | -webkit-overflow-scrolling: touch; 57 | } 58 | 59 | .fancybox-error { 60 | color: #444; 61 | font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; 62 | margin: 0; 63 | padding: 15px; 64 | white-space: nowrap; 65 | } 66 | 67 | .fancybox-image, .fancybox-iframe { 68 | display: block; 69 | width: 100%; 70 | height: 100%; 71 | } 72 | 73 | .fancybox-image { 74 | max-width: 100%; 75 | max-height: 100%; 76 | } 77 | 78 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { 79 | background-image: url(fancybox_sprite.png); 80 | } 81 | 82 | #fancybox-loading { 83 | position: fixed; 84 | top: 50%; 85 | left: 50%; 86 | margin-top: -22px; 87 | margin-left: -22px; 88 | background-position: 0 -108px; 89 | opacity: 0.8; 90 | cursor: pointer; 91 | z-index: 8060; 92 | } 93 | 94 | #fancybox-loading div { 95 | width: 44px; 96 | height: 44px; 97 | background: url(fancybox_loading.gif) center center no-repeat; 98 | } 99 | 100 | .fancybox-close { 101 | position: absolute; 102 | top: -18px; 103 | right: -18px; 104 | width: 36px; 105 | height: 36px; 106 | cursor: pointer; 107 | z-index: 8040; 108 | } 109 | 110 | .fancybox-nav { 111 | position: absolute; 112 | top: 0; 113 | width: 40%; 114 | height: 100%; 115 | cursor: pointer; 116 | text-decoration: none; 117 | background: transparent url(blank.gif); /* helps IE */ 118 | -webkit-tap-highlight-color: rgba(0,0,0,0); 119 | z-index: 8040; 120 | } 121 | 122 | .fancybox-prev { 123 | left: 0; 124 | } 125 | 126 | .fancybox-next { 127 | right: 0; 128 | } 129 | 130 | .fancybox-nav span { 131 | position: absolute; 132 | top: 50%; 133 | width: 36px; 134 | height: 34px; 135 | margin-top: -18px; 136 | cursor: pointer; 137 | z-index: 8040; 138 | visibility: hidden; 139 | } 140 | 141 | .fancybox-prev span { 142 | left: 10px; 143 | background-position: 0 -36px; 144 | } 145 | 146 | .fancybox-next span { 147 | right: 10px; 148 | background-position: 0 -72px; 149 | } 150 | 151 | .fancybox-nav:hover span { 152 | visibility: visible; 153 | } 154 | 155 | .fancybox-tmp { 156 | position: absolute; 157 | top: -99999px; 158 | left: -99999px; 159 | max-width: 99999px; 160 | max-height: 99999px; 161 | overflow: visible !important; 162 | } 163 | 164 | /* Overlay helper */ 165 | 166 | .fancybox-lock { 167 | overflow: visible !important; 168 | width: auto; 169 | } 170 | 171 | .fancybox-lock body { 172 | overflow: hidden !important; 173 | } 174 | 175 | .fancybox-lock-test { 176 | overflow-y: hidden !important; 177 | } 178 | 179 | .fancybox-overlay { 180 | position: absolute; 181 | top: 0; 182 | left: 0; 183 | overflow: hidden; 184 | display: none; 185 | z-index: 8010; 186 | background: url(fancybox_overlay.png); 187 | } 188 | 189 | .fancybox-overlay-fixed { 190 | position: fixed; 191 | bottom: 0; 192 | right: 0; 193 | } 194 | 195 | .fancybox-lock .fancybox-overlay { 196 | overflow: auto; 197 | overflow-y: scroll; 198 | } 199 | 200 | /* Title helper */ 201 | 202 | .fancybox-title { 203 | visibility: hidden; 204 | font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; 205 | position: relative; 206 | text-shadow: none; 207 | z-index: 8050; 208 | } 209 | 210 | .fancybox-opened .fancybox-title { 211 | visibility: visible; 212 | } 213 | 214 | .fancybox-title-float-wrap { 215 | position: absolute; 216 | bottom: 0; 217 | right: 50%; 218 | margin-bottom: -35px; 219 | z-index: 8050; 220 | text-align: center; 221 | } 222 | 223 | .fancybox-title-float-wrap .child { 224 | display: inline-block; 225 | margin-right: -100%; 226 | padding: 2px 20px; 227 | background: transparent; /* Fallback for web browsers that doesn't support RGBa */ 228 | background: rgba(0, 0, 0, 0.8); 229 | -webkit-border-radius: 15px; 230 | -moz-border-radius: 15px; 231 | border-radius: 15px; 232 | text-shadow: 0 1px 2px #222; 233 | color: #FFF; 234 | font-weight: bold; 235 | line-height: 24px; 236 | white-space: nowrap; 237 | } 238 | 239 | .fancybox-title-outside-wrap { 240 | position: relative; 241 | margin-top: 10px; 242 | color: #fff; 243 | } 244 | 245 | .fancybox-title-inside-wrap { 246 | padding-top: 10px; 247 | } 248 | 249 | .fancybox-title-over-wrap { 250 | position: absolute; 251 | bottom: 0; 252 | left: 0; 253 | color: #fff; 254 | padding: 10px; 255 | background: #000; 256 | background: rgba(0, 0, 0, .8); 257 | } 258 | 259 | /*Retina graphics!*/ 260 | @media only screen and (-webkit-min-device-pixel-ratio: 1.5), 261 | only screen and (min--moz-device-pixel-ratio: 1.5), 262 | only screen and (min-device-pixel-ratio: 1.5){ 263 | 264 | #fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { 265 | background-image: url(fancybox_sprite@2x.png); 266 | background-size: 44px 152px; /*The size of the normal image, half the size of the hi-res image*/ 267 | } 268 | 269 | #fancybox-loading div { 270 | background-image: url(fancybox_loading@2x.gif); 271 | background-size: 24px 24px; /*The size of the normal image, half the size of the hi-res image*/ 272 | } 273 | } -------------------------------------------------------------------------------- /static/fancybox/helpers/jquery.fancybox-media.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Media helper for fancyBox 3 | * version: 1.0.6 (Fri, 14 Jun 2013) 4 | * @requires fancyBox v2.0 or later 5 | * 6 | * Usage: 7 | * $(".fancybox").fancybox({ 8 | * helpers : { 9 | * media: true 10 | * } 11 | * }); 12 | * 13 | * Set custom URL parameters: 14 | * $(".fancybox").fancybox({ 15 | * helpers : { 16 | * media: { 17 | * youtube : { 18 | * params : { 19 | * autoplay : 0 20 | * } 21 | * } 22 | * } 23 | * } 24 | * }); 25 | * 26 | * Or: 27 | * $(".fancybox").fancybox({, 28 | * helpers : { 29 | * media: true 30 | * }, 31 | * youtube : { 32 | * autoplay: 0 33 | * } 34 | * }); 35 | * 36 | * Supports: 37 | * 38 | * Youtube 39 | * http://www.youtube.com/watch?v=opj24KnzrWo 40 | * http://www.youtube.com/embed/opj24KnzrWo 41 | * http://youtu.be/opj24KnzrWo 42 | * http://www.youtube-nocookie.com/embed/opj24KnzrWo 43 | * Vimeo 44 | * http://vimeo.com/40648169 45 | * http://vimeo.com/channels/staffpicks/38843628 46 | * http://vimeo.com/groups/surrealism/videos/36516384 47 | * http://player.vimeo.com/video/45074303 48 | * Metacafe 49 | * http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/ 50 | * http://www.metacafe.com/watch/7635964/ 51 | * Dailymotion 52 | * http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people 53 | * Twitvid 54 | * http://twitvid.com/QY7MD 55 | * Twitpic 56 | * http://twitpic.com/7p93st 57 | * Instagram 58 | * http://instagr.am/p/IejkuUGxQn/ 59 | * http://instagram.com/p/IejkuUGxQn/ 60 | * Google maps 61 | * http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17 62 | * http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16 63 | * http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56 64 | */ 65 | ;(function ($) { 66 | "use strict"; 67 | 68 | //Shortcut for fancyBox object 69 | var F = $.fancybox, 70 | format = function( url, rez, params ) { 71 | params = params || ''; 72 | 73 | if ( $.type( params ) === "object" ) { 74 | params = $.param(params, true); 75 | } 76 | 77 | $.each(rez, function(key, value) { 78 | url = url.replace( '$' + key, value || '' ); 79 | }); 80 | 81 | if (params.length) { 82 | url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params; 83 | } 84 | 85 | return url; 86 | }; 87 | 88 | //Add helper object 89 | F.helpers.media = { 90 | defaults : { 91 | youtube : { 92 | matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i, 93 | params : { 94 | autoplay : 1, 95 | autohide : 1, 96 | fs : 1, 97 | rel : 0, 98 | hd : 1, 99 | wmode : 'opaque', 100 | enablejsapi : 1 101 | }, 102 | type : 'iframe', 103 | url : '//www.youtube.com/embed/$3' 104 | }, 105 | vimeo : { 106 | matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/, 107 | params : { 108 | autoplay : 1, 109 | hd : 1, 110 | show_title : 1, 111 | show_byline : 1, 112 | show_portrait : 0, 113 | fullscreen : 1 114 | }, 115 | type : 'iframe', 116 | url : '//player.vimeo.com/video/$1' 117 | }, 118 | metacafe : { 119 | matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/, 120 | params : { 121 | autoPlay : 'yes' 122 | }, 123 | type : 'swf', 124 | url : function( rez, params, obj ) { 125 | obj.swf.flashVars = 'playerVars=' + $.param( params, true ); 126 | 127 | return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf'; 128 | } 129 | }, 130 | dailymotion : { 131 | matcher : /dailymotion.com\/video\/(.*)\/?(.*)/, 132 | params : { 133 | additionalInfos : 0, 134 | autoStart : 1 135 | }, 136 | type : 'swf', 137 | url : '//www.dailymotion.com/swf/video/$1' 138 | }, 139 | twitvid : { 140 | matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i, 141 | params : { 142 | autoplay : 0 143 | }, 144 | type : 'iframe', 145 | url : '//www.twitvid.com/embed.php?guid=$1' 146 | }, 147 | twitpic : { 148 | matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i, 149 | type : 'image', 150 | url : '//twitpic.com/show/full/$1/' 151 | }, 152 | instagram : { 153 | matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i, 154 | type : 'image', 155 | url : '//$1/p/$2/media/?size=l' 156 | }, 157 | google_maps : { 158 | matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i, 159 | type : 'iframe', 160 | url : function( rez ) { 161 | return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed'); 162 | } 163 | } 164 | }, 165 | 166 | beforeLoad : function(opts, obj) { 167 | var url = obj.href || '', 168 | type = false, 169 | what, 170 | item, 171 | rez, 172 | params; 173 | 174 | for (what in opts) { 175 | if (opts.hasOwnProperty(what)) { 176 | item = opts[ what ]; 177 | rez = url.match( item.matcher ); 178 | 179 | if (rez) { 180 | type = item.type; 181 | params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null)); 182 | 183 | url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params ); 184 | 185 | break; 186 | } 187 | } 188 | } 189 | 190 | if (type) { 191 | obj.href = url; 192 | obj.type = type; 193 | 194 | obj.autoHeight = false; 195 | } 196 | } 197 | }; 198 | 199 | }(jQuery)); -------------------------------------------------------------------------------- /static/fancybox/jquery.fancybox.pack.js: -------------------------------------------------------------------------------- 1 | /*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */ 2 | (function(s,H,f,w){var K=f("html"),q=f(s),p=f(H),b=f.fancybox=function(){b.open.apply(this,arguments)},J=navigator.userAgent.match(/msie/i),C=null,t=H.createTouch!==w,u=function(a){return a&&a.hasOwnProperty&&a instanceof f},r=function(a){return a&&"string"===f.type(a)},F=function(a){return r(a)&&0
    ',image:'',iframe:'",error:'

    The requested content cannot be loaded.
    Please try again later.

    ',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0, 6 | openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1, 7 | isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=u(a)?f(a).get():[a]),f.each(a,function(e,c){var l={},g,h,k,n,m;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),u(c)?(l={href:c.data("fancybox-href")||c.attr("href"),title:f("
    ").text(c.data("fancybox-title")||c.attr("title")).html(),isDom:!0,element:c}, 8 | f.metadata&&f.extend(!0,l,c.metadata())):l=c);g=d.href||l.href||(r(c)?c:null);h=d.title!==w?d.title:l.title||"";n=(k=d.content||l.content)?"html":d.type||l.type;!n&&l.isDom&&(n=c.data("fancybox-type"),n||(n=(n=c.prop("class").match(/fancybox\.(\w+)/))?n[1]:null));r(g)&&(n||(b.isImage(g)?n="image":b.isSWF(g)?n="swf":"#"===g.charAt(0)?n="inline":r(c)&&(n="html",k=c)),"ajax"===n&&(m=g.split(/\s+/,2),g=m.shift(),m=m.shift()));k||("inline"===n?g?k=f(r(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):l.isDom&&(k=c): 9 | "html"===n?k=g:n||g||!l.isDom||(n="inline",k=c));f.extend(l,{href:g,type:n,content:k,title:h,selector:m});a[e]=l}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==w&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1===b.trigger("onCancel")||(b.hideLoading(),a&&(b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(), 10 | b.coming=null,b.current||b._afterZoomOut(a)))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(b.isOpen&&!0!==a?(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]()):(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&& 11 | (b.player.timer=setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};!0===a||!b.player.isActive&&!1!==a?b.current&&(b.current.loop||b.current.index=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==w&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,l;c&&(l=b._getPosition(d),a&&"scroll"===a.type?(delete l.position,c.stop(!0,!0).animate(l,200)):(c.css(l),e.pos=f.extend({},e.dim,l)))}, 13 | update:function(a){var d=a&&a.originalEvent&&a.originalEvent.type,e=!d||"orientationchange"===d;e&&(clearTimeout(C),C=null);b.isOpen&&!C&&(C=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),C=null)},e&&!t?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,t&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"), 14 | b.trigger("onUpdate")),b.update())},hideLoading:function(){p.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('
    ').click(b.cancel).appendTo("body");p.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),b.cancel())});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}));b.trigger("onLoading")},getViewport:function(){var a=b.current&& 15 | b.current.locked||!1,d={x:q.scrollLeft(),y:q.scrollTop()};a&&a.length?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=t&&s.innerWidth?s.innerWidth:q.width(),d.h=t&&s.innerHeight?s.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&u(b.wrap)&&b.wrap.unbind(".fb");p.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(t?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c= 16 | e.which||e.keyCode,l=e.target||e.srcElement;if(27===c&&b.coming)return!1;e.ctrlKey||e.altKey||e.shiftKey||e.metaKey||l&&(l.type||f(l).is("[contenteditable]"))||f.each(d,function(d,l){if(1h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();0!==c&&!k&&1g||0>l)&&b.next(0>g?"up":"right"),d.preventDefault())}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){if(e&& 18 | b.helpers[d]&&f.isFunction(b.helpers[d][a]))b.helpers[d][a](f.extend(!0,{},b.helpers[d].defaults,e),c)})}p.trigger(a)},isImage:function(a){return r(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return r(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=m(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&(d.padding=[c,c, 19 | c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=!0;if("image"=== 20 | c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&t&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(t?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady"); 21 | if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width= 22 | this.width/b.opts.pixelRatio;b.coming.height=this.height/b.opts.pixelRatio;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming, 23 | d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",t?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);t||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload|| 24 | b._afterLoad()},_preloadImages:function(){var a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,l,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()); 25 | b.unbindEvents();e=a.content;c=a.type;l=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("
    ").html(e).find(a.selector):u(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('
    ').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", 26 | !1)}));break;case "image":e=a.tpl.image.replace(/\{href\}/g,g);break;case "swf":e='',h="",f.each(a.swf,function(a,b){e+='';h+=" "+a+'="'+b+'"'}),e+='"}u(e)&&e.parent().is(a.inner)||a.inner.append(e);b.trigger("beforeShow"); 27 | a.inner.css("overflow","yes"===l?"scroll":"no"===l?"hidden":l);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(!b.isOpened)f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();else if(d.prevMethod)b.transitions[d.prevMethod]();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,l=b.skin,g=b.inner,h=b.current,c=h.width,k=h.height,n=h.minWidth,v=h.minHeight,p=h.maxWidth, 28 | q=h.maxHeight,t=h.scrolling,r=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,z=m(y[1]+y[3]),s=m(y[0]+y[2]),w,A,u,D,B,G,C,E,I;e.add(l).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=m(l.outerWidth(!0)-l.width());w=m(l.outerHeight(!0)-l.height());A=z+y;u=s+w;D=F(c)?(a.w-A)*m(c)/100:c;B=F(k)?(a.h-u)*m(k)/100:k;if("iframe"===h.type){if(I=h.content,h.autoHeight&&1===I.data("ready"))try{I[0].contentWindow.document.location&&(g.width(D).height(9999),G=I.contents().find("body"),r&&G.css("overflow-x", 29 | "hidden"),B=G.outerHeight(!0))}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=m(D);k=m(B);E=D/B;n=m(F(n)?m(n,"w")-A:n);p=m(F(p)?m(p,"w")-A:p);v=m(F(v)?m(v,"h")-u:v);q=m(F(q)?m(q,"h")-u:q);G=p;C=q;h.fitToView&&(p=Math.min(a.w-A,p),q=Math.min(a.h-u,q));A=a.w-z;s=a.h-s;h.aspectRatio?(c>p&&(c=p,k=m(c/E)),k>q&&(k=q,c=m(k*E)),cA||z>s)&&c>n&&k>v&&!(19p&&(c=p,k=m(c/E)),g.width(c).height(k),e.width(c+y),a=e.width(),z=e.height();else c=Math.max(n,Math.min(c,c-(a-A))),k=Math.max(v,Math.min(k,k-(z-s)));r&&"auto"===t&&kA||z>s)&&c>n&&k>v;c=h.aspectRatio?cv&&k
    ').appendTo(d&&d.lenth?d:"body");this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay", 40 | function(a){if(f(a.target).hasClass("fancybox-overlay"))return b.isActive?b.close():d.close(),!1});this.overlay.css(a.css).show()},close:function(){q.unbind("resize.overlay");this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),this.el.removeClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));f(".fancybox-overlay").remove().hide();f.extend(this,{overlay:null,fixed:!1})},update:function(){var a="100%",b;this.overlay.width(a).height("100%"); 41 | J?(b=Math.max(H.documentElement.offsetWidth,H.body.offsetWidth),p.width()>b&&(a=p.width())):p.width()>q.width()&&(a=p.width());this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0);e||this.create(a);a.locked&&this.fixed&&b.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&!this.el.hasClass("fancybox-lock")&&(!1!==this.fixPosition&&f("*").filter(function(){return"fixed"=== 42 | f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin"),this.scrollV=q.scrollTop(),this.scrollH=q.scrollLeft(),this.el.addClass("fancybox-lock"),q.scrollTop(this.scrollV).scrollLeft(this.scrollH));this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float", 43 | position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(r(e)&&""!==f.trim(e)){d=f('
    '+e+"
    ");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),J&&d.width(d.width()),d.wrapInner(''),b.current.margin[2]+=Math.abs(m(d.css("margin-bottom")))}d["top"===a.position?"prependTo": 44 | "appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",l=function(g){var h=f(this).blur(),k=d,l,m;g.ctrlKey||g.altKey||g.shiftKey||g.metaKey||h.is(".fancybox-wrap")||(l=a.groupAttr||"data-fancybox-group",m=h.attr(l),m||(l="rel",m=h.get(0)[l]),m&&""!==m&&"nofollow"!==m&&(h=c.length?f(c):e,h=h.filter("["+l+'="'+m+'"]'),k=h.index(this)),a.index=k,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;c&&!1!==a.live?p.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')", 45 | "click.fb-start",l):e.unbind("click.fb-start").bind("click.fb-start",l);this.filter("[data-fancybox-start=1]").trigger("click");return this};p.ready(function(){var a,d;f.scrollbarWidth===w&&(f.scrollbarWidth=function(){var a=f('
    ').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});f.support.fixedPosition===w&&(f.support.fixedPosition=function(){var a=f('
    ').appendTo("body"), 46 | b=20===a[0].offsetTop||15===a[0].offsetTop;a.remove();return b}());f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")});a=f(s).width();K.addClass("fancybox-lock-test");d=f(s).width();K.removeClass("fancybox-lock-test");f("").appendTo("head")})})(window,document,jQuery); -------------------------------------------------------------------------------- /static/highlight/highlight.pack.js: -------------------------------------------------------------------------------- 1 | !function(e){"undefined"!=typeof exports?e(exports):(window.hljs=e({}),"function"==typeof define&&define.amd&&define("hljs",[],function(){return window.hljs}))}(function(e){function n(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0==t.index}function a(e){return/no-?highlight|plain|text/.test(e)}function i(e){var n,t,r,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=/\blang(?:uage)?-([\w-]+)\b/.exec(i))return E(t[1])?t[1]:"no-highlight";for(i=i.split(/\s+/),n=0,r=i.length;r>n;n++)if(E(i[n])||a(i[n]))return i[n]}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,a){for(var i=e.firstChild;i;i=i.nextSibling)3==i.nodeType?a+=i.nodeValue.length:1==i.nodeType&&(n.push({event:"start",offset:a,node:i}),a=r(i,a),t(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:a,node:i}));return a}(e,0),n}function c(e,r,a){function i(){return e.length&&r.length?e[0].offset!=r[0].offset?e[0].offset"}function u(e){f+=""}function c(e){("start"==e.event?o:u)(e.node)}for(var s=0,f="",l=[];e.length||r.length;){var g=i();if(f+=n(a.substr(s,g[0].offset-s)),s=g[0].offset,g==e){l.reverse().forEach(u);do c(g.splice(0,1)[0]),g=i();while(g==e&&g.length&&g[0].offset==s);l.reverse().forEach(o)}else"start"==g[0].event?l.push(g[0].node):l.pop(),c(g.splice(0,1)[0])}return f+n(a.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(a,i){if(!a.compiled){if(a.compiled=!0,a.k=a.k||a.bK,a.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof a.k?c("keyword",a.k):Object.keys(a.k).forEach(function(e){c(e,a.k[e])}),a.k=u}a.lR=t(a.l||/\b\w+\b/,!0),i&&(a.bK&&(a.b="\\b("+a.bK.split(" ").join("|")+")\\b"),a.b||(a.b=/\B|\b/),a.bR=t(a.b),a.e||a.eW||(a.e=/\B|\b/),a.e&&(a.eR=t(a.e)),a.tE=n(a.e)||"",a.eW&&i.tE&&(a.tE+=(a.e?"|":"")+i.tE)),a.i&&(a.iR=t(a.i)),void 0===a.r&&(a.r=1),a.c||(a.c=[]);var s=[];a.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"==e?a:e)}),a.c=s,a.c.forEach(function(e){r(e,a)}),a.starts&&r(a.starts,i);var f=a.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([a.tE,a.i]).map(n).filter(Boolean);a.t=f.length?t(f.join("|"),!0):{exec:function(){return null}}}}r(e)}function f(e,t,a,i){function o(e,n){for(var t=0;t";return i+=e+'">',i+n+o}function p(){if(!L.k)return n(y);var e="",t=0;L.lR.lastIndex=0;for(var r=L.lR.exec(y);r;){e+=n(y.substr(t,r.index-t));var a=g(L,r);a?(B+=a[1],e+=h(a[0],n(r[0]))):e+=n(r[0]),t=L.lR.lastIndex,r=L.lR.exec(y)}return e+n(y.substr(t))}function d(){var e="string"==typeof L.sL;if(e&&!x[L.sL])return n(y);var t=e?f(L.sL,y,!0,M[L.sL]):l(y,L.sL.length?L.sL:void 0);return L.r>0&&(B+=t.r),e&&(M[L.sL]=t.top),h(t.language,t.value,!1,!0)}function b(){return void 0!==L.sL?d():p()}function v(e,t){var r=e.cN?h(e.cN,"",!0):"";e.rB?(k+=r,y=""):e.eB?(k+=n(t)+r,y=""):(k+=r,y=t),L=Object.create(e,{parent:{value:L}})}function m(e,t){if(y+=e,void 0===t)return k+=b(),0;var r=o(t,L);if(r)return k+=b(),v(r,t),r.rB?0:t.length;var a=u(L,t);if(a){var i=L;i.rE||i.eE||(y+=t),k+=b();do L.cN&&(k+=""),B+=L.r,L=L.parent;while(L!=a.parent);return i.eE&&(k+=n(t)),y="",a.starts&&v(a.starts,""),i.rE?0:t.length}if(c(t,L))throw new Error('Illegal lexeme "'+t+'" for mode "'+(L.cN||"")+'"');return y+=t,t.length||1}var N=E(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var R,L=i||N,M={},k="";for(R=L;R!=N;R=R.parent)R.cN&&(k=h(R.cN,"",!0)+k);var y="",B=0;try{for(var C,j,I=0;;){if(L.t.lastIndex=I,C=L.t.exec(t),!C)break;j=m(t.substr(I,C.index-I),C[0]),I=C.index+j}for(m(t.substr(I)),R=L;R.parent;R=R.parent)R.cN&&(k+="");return{r:B,value:k,language:e,top:L}}catch(O){if(-1!=O.message.indexOf("Illegal"))return{r:0,value:n(t)};throw O}}function l(e,t){t=t||w.languages||Object.keys(x);var r={r:0,value:n(e)},a=r;return t.forEach(function(n){if(E(n)){var t=f(n,e,!1);t.language=n,t.r>a.r&&(a=t),t.r>r.r&&(a=r,r=t)}}),a.language&&(r.second_best=a),r}function g(e){return w.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,n){return n.replace(/\t/g,w.tabReplace)})),w.useBR&&(e=e.replace(/\n/g,"
    ")),e}function h(e,n,t){var r=n?R[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),-1===e.indexOf(r)&&a.push(r),a.join(" ").trim()}function p(e){var n=i(e);if(!a(n)){var t;w.useBR?(t=document.createElementNS("http://www.w3.org/1999/xhtml","div"),t.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):t=e;var r=t.textContent,o=n?f(n,r,!0):l(r),s=u(t);if(s.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=o.value,o.value=c(s,u(p),r)}o.value=g(o.value),e.innerHTML=o.value,e.className=h(e.className,n,o.language),e.result={language:o.language,re:o.r},o.second_best&&(e.second_best={language:o.second_best.language,re:o.second_best.r})}}function d(e){w=o(w,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",b,!1),addEventListener("load",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){R[e]=n})}function N(){return Object.keys(x)}function E(e){return x[e]||x[R[e]]}var w={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},x={},R={};return e.highlight=f,e.highlightAuto=l,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=E,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},e.C=function(n,t,r){var a=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return a.c.push(e.PWM),a.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),a},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e});hljs.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"(AV|CA|CF|CG|CI|MK|MP|NS|UI)\\w+"},i={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},o=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["mm","objc","obj-c"],k:i,l:o,i:""}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:o,c:[e.UTM]},{cN:"variable",b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("ini",function(e){var c={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"title",b:/^\s*\[+/,e:/\]+/},{cN:"setting",b:/^[a-z0-9\[\]_-]+\s*=\s*/,e:"$",c:[{cN:"value",eW:!0,k:"on off true false yes no",c:[{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},c,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM],r:0}]}]}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,s,a,t]}});hljs.registerLanguage("php",function(e){var c={cN:"variable",b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},a={cN:"preprocessor",b:/<\?(php)?|\?>/},i={cN:"string",c:[e.BE,a],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},n={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.CLCM,e.HCM,e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"},a]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[e.BE]},a,c,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,i,n]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},i,n]}});hljs.registerLanguage("javascript",function(e){return{aliases:["js"],k:{keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},c:[{cN:"pi",r:10,b:/^\s*['"]use (strict|asm)['"]/},e.ASM,e.QSM,{cN:"string",b:"`",e:"`",c:[e.BE,{cN:"subst",b:"\\$\\{",e:"\\}"}]},e.CLCM,e.CBCM,{cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{b:/\s*[);\]]/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:[e.CLCM,e.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+e.IR,r:0},{bK:"import",e:"[;$]",k:"import from as",c:[e.ASM,e.QSM]},{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]}],i:/#/}});hljs.registerLanguage("java",function(e){var a=e.UIR+"(<"+e.UIR+">)?",t="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",c="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",r={cN:"number",b:c,r:0};return{aliases:["jsp"],k:t,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+a+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:t,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:t,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},r,{cN:"annotation",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("go",function(e){var t={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer",constant:"true false iota nil",typename:"bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{aliases:["golang"],k:t,i:">|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",b={cN:"doctag",b:"@[A-Za-z]+"},a={cN:"value",b:"#<",e:">"},n=[e.C("#","$",{c:[b]}),e.C("^\\=begin","^\\=end",{c:[b],r:10}),e.C("^__END__","\\n$")],s={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,s],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},i={cN:"params",b:"\\(",e:"\\)",k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]}].concat(n)},{cN:"function",bK:"def",e:"$|;",r:0,c:[e.inherit(e.TM,{b:c}),i].concat(n)},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[t,{b:c}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[a,{cN:"regexp",c:[e.BE,s],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(n),r:0}].concat(n);s.c=d,i.c=d;var o="[>?]>",l="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",N=[{b:/^\s*=>/,cN:"status",starts:{e:"$",c:d}},{cN:"prompt",b:"^("+o+"|"+l+"|"+u+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,c:n.concat(N).concat(d)}});hljs.registerLanguage("xml",function(t){var s="[A-Za-z0-9\\._:-]+",c={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php"},e={eW:!0,i:/]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},t.C("",{r:10}),{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[e],starts:{e:"",rE:!0,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[e],starts:{e:"",rE:!0,sL:["actionscript","javascript","handlebars"]}},c,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},e]}]}});hljs.registerLanguage("lua",function(e){var t="\\[=*\\[",a="\\]=*\\]",r={b:t,e:a,c:["self"]},n=[e.C("--(?!"+t+")","$"),e.C("--"+t,a,{c:[r],r:10})];return{l:e.UIR,k:{keyword:"and break do else elseif end false for if in local nil not or repeat return then true until while",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},c:n.concat([{cN:"function",bK:"function",e:"\\)",c:[e.inherit(e.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{cN:"params",b:"\\(",eW:!0,c:n}].concat(n)},e.CNM,e.ASM,e.QSM,{cN:"string",b:t,e:a,c:[r],r:5}])}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",rB:!0,c:[{cN:"link_reference",b:"\\[",e:"\\]:",eB:!0,eE:!0,starts:{cN:"link_url",e:"$"}}]}]}});hljs.registerLanguage("python",function(e){var r={cN:"prompt",b:/^(>>>|\.\.\.) /},b={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[r],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[r],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},l={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},c={cN:"params",b:/\(/,e:/\)/,c:["self",r,l,b]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[r,l,b,e.HCM,{v:[{cN:"function",bK:"def",r:10},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,c]},{cN:"decorator",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("cs",function(e){var r="abstract as base bool break byte case catch char checked const continue decimal dynamic default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long null when object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async protected public private internal ascending descending from get group into join let orderby partial select set value var where yield",t=e.IR+"(<"+e.IR+">)?";return{aliases:["csharp"],k:r,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"xmlDocTag",v:[{b:"///",r:0},{b:""},{b:""}]}]}),e.CLCM,e.CBCM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},e.ASM,e.QSM,e.CNM,{bK:"class interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[{cN:"title",b:"[a-zA-Z](\\.?\\w)*",r:0},e.CLCM,e.CBCM]},{bK:"new return throw await",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",a={cN:"function",b:c+"\\(",rB:!0,eE:!0,e:"\\("},r={cN:"rule",b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{cN:"value",eW:!0,eE:!0,c:[a,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,r,{cN:"id",b:/\#[A-Za-z0-9_-]+/},{cN:"class",b:/\.[A-Za-z0-9_-]+/},{cN:"attr_selector",b:/\[/,e:/\]/,i:"$"},{cN:"pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"']+/},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[a,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:c,r:0},{cN:"rules",b:"{",e:"}",i:/\S/,c:[e.CBCM,r]}]}});hljs.registerLanguage("cpp",function(t){var e={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[t.inherit(t.QSM,{b:'((u8?|U)|L)?"'}),{b:'(u8?|U)?R"',e:'"',c:[t.BE]},{b:"'\\\\?.",e:"'",i:"."}]},s={cN:"number",v:[{b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},{b:t.CNR}]},i=t.IR+"\\s*\\(",a={keyword:"int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf",literal:"true false nullptr NULL"};return{aliases:["c","cc","h","c++","h++","hpp"],k:a,i:"",i:"\\n"}]},r,s,t.CLCM,t.CBCM]},{b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:a,c:["self",e]},{b:t.IR+"::",k:a},{bK:"new throw return else",r:0},{cN:"function",b:"("+t.IR+"[\\*&\\s]+)+"+i,rB:!0,e:/[{;=]/,eE:!0,k:a,c:[{b:i,rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:a,r:0,c:[t.CLCM,t.CBCM,r,s]},t.CLCM,t.CBCM]}]}});hljs.registerLanguage("makefile",function(e){var a={cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]};return{aliases:["mk","mak"],c:[e.HCM,{b:/^\w+\s*\W*=/,rB:!0,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:!0,starts:{e:/$/,r:0,c:[a]}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,r:0,c:[e.QSM,a]}]}});hljs.registerLanguage("json",function(e){var t={literal:"true false null"},i=[e.QSM,e.CNM],l={cN:"value",e:",",eW:!0,eE:!0,c:i,k:t},c={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:l}],i:"\\S"},n={b:"\\[",e:"\\]",c:[e.inherit(l,{cN:null})],i:"\\S"};return i.splice(i.length,0,c,n),{c:i,k:t,i:"\\S"}}); -------------------------------------------------------------------------------- /static/css/style.css: -------------------------------------------------------------------------------- 1 | html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-family:inherit;font-size:100%;vertical-align:baseline} 2 | body{line-height:1;color:#000;background:#fff} 3 | ol,ul{list-style:none} 4 | table{border-collapse:separate;border-spacing:0;vertical-align:middle} 5 | caption,th,td{text-align:left;font-weight:normal;vertical-align:middle} 6 | a img{border:none} 7 | /* icon Font */ 8 | @font-face{font-family:"FontAwesome";font-style:normal;font-weight:normal;src:url("../font/fontawesome-webfont.eot?v=#4.0.3");src:url("../font/fontawesome-webfont.eot?#iefix&v=#4.0.3") format("embedded-opentype"),url("../font/fontawesome-webfont.woff?v=#4.0.3") format("woff"),url("../font/fontawesome-webfont.ttf?v=#4.0.3") format("truetype"),url("../font/fontawesome-webfont.svg#fontawesomeregular?v=#4.0.3") format("svg")} 9 | /* Public style */ 10 | *{-webkit-margin-before:0;-webkit-margin-after:0} 11 | body{background:#ddd;font-family:"Helvetica Neue","Helvetica","Microsoft YaHei","WenQuanYi Micro Hei",Arial,sans-serif;font-size:100%;color:#817c7c;line-height:1.5} 12 | small{font-size:80%} 13 | sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} 14 | sup{top:-.5em;padding-left:.3em} 15 | sub{bottom:-.25em} 16 | a{text-decoration:none;color:#817c7c;} 17 | a:hover,a:focus{outline:0;text-decoration:none;-webkit-transition:color 0.25s, background 0.5s;-moz-transition:color 0.25s, background 0.5s;-o-transition:color 0.25s, background 0.5s;-ms-transition:color 0.25s, background 0.5s;transition:color 0.25s, background 0.5s} 18 | a:hover:before{-webkit-transition:color 0.25s, background 0.5s;-moz-transition:color 0.25s, background 0.5s;-o-transition:color 0.25s, background 0.5s;-ms-transition:color 0.25s, background 0.5s;transition:color 0.25s, background 0.5s} 19 | input:focus{outline:none} 20 | input,button{margin:0;padding:0;} 21 | input::-moz-focus-inner,button::-moz-focus-inner{border:0;padding:0} 22 | h1{font-size:1.5em} 23 | .fa{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale} 24 | .clearfix{zoom:1} 25 | .clearfix:before,.clearfix:after{content:"";display:table} 26 | .clearfix:after{clear:both} 27 | ::-webkit-input-placeholder{color:#fff;padding:2px 0 0 4px} 28 | ::-moz-placeholder{color:#fff;padding:2px 0 0 4px} 29 | :-ms-input-placeholder{color:#fff;padding:2px 0 0 4px} 30 | ::-webkit-input-placeholder::before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f002";padding-right:4px} 31 | ::-moz-placeholder:before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f002";padding-right:4px} 32 | :-ms-input-placeholder::before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f002";padding-right:4px} 33 | input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none} 34 | ::-webkit-search-cancel-button:after{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:'\f00d';color:#fff;padding-right:4px} 35 | /* css3 animate */ 36 | .animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-o-animation-fill-mode:both;-ms-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:1s;-moz-animation-duration:1s;-o-animation-duration:1s;-ms-animation-duration:1s;animation-duration:1s} 37 | @-webkit-keyframes fadeIn{0%{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0)} 38 | 100%{opacity:1;-ms-filter:none;filter:none} 39 | }.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;-ms-animation-name:fadeIn;animation-name:fadeIn} 40 | .fadeOut{-webkit-animation-name:fadeOut;-moz-animation-name:fadeOut;-o-animation-name:fadeOut;-ms-animation-name:fadeOut;animation-name:fadeOut} 41 | @-moz-keyframes fadeInDown{0%{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transform:translateY(-20px);-moz-transform:translateY(-20px);-o-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)} 42 | 100%{opacity:1;-ms-filter:none;filter:none;-webkit-transform:translateY(0);-moz-transform:translateY(0);-o-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)} 43 | }@-webkit-keyframes fadeInDown{0%{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transform:translateY(-20px);-moz-transform:translateY(-20px);-o-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)} 44 | 100%{opacity:1;-ms-filter:none;filter:none;-webkit-transform:translateY(0);-moz-transform:translateY(0);-o-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)} 45 | }@-o-keyframes fadeInDown{0%{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transform:translateY(-20px);-moz-transform:translateY(-20px);-o-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)} 46 | 100%{opacity:1;-ms-filter:none;filter:none;-webkit-transform:translateY(0);-moz-transform:translateY(0);-o-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)} 47 | }@-ms-keyframes fadeInDown{0%{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transform:translateY(-20px);-moz-transform:translateY(-20px);-o-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)} 48 | 100%{opacity:1;-ms-filter:none;filter:none;-webkit-transform:translateY(0);-moz-transform:translateY(0);-o-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)} 49 | }@keyframes fadeInDown{0%{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);-webkit-transform:translateY(-20px);-moz-transform:translateY(-20px);-o-transform:translateY(-20px);-ms-transform:translateY(-20px);transform:translateY(-20px)} 50 | 100%{opacity:1;-ms-filter:none;filter:none;-webkit-transform:translateY(0);-moz-transform:translateY(0);-o-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)} 51 | }body >header{width:100%;-webkit-box-shadow:2px 4px 5px rgba(3,3,3,0.2);box-shadow:2px 4px 5px rgba(3,3,3,0.2);background:#ea6753;color:#fff;padding:1em 0 .8em;} 52 | @media only screen and (min-width: 1024px){body >header{padding:1.8em 0 1.5em} 53 | }body >header >div{width:95%;margin:0 auto;position:relative;overflow:hidden;} 54 | @media only screen and (min-width: 1024px){body >header >div{width:93%} 55 | }body >header a{display:block;color:#fff} 56 | #imglogo{float:left;width:4em;height:4em;} 57 | @media only screen and (min-width: 768px){#imglogo{width:5em} 58 | }@media only screen and (min-width: 1024px){#imglogo{width:5.5em} 59 | }#imglogo img{width:4em;} 60 | @media only screen and (min-width: 768px){#imglogo img{width:5em} 61 | }@media only screen and (min-width: 1024px){#imglogo img{width:5.5em} 62 | }#textlogo{float:left;width:75%;margin-left:.5em;} 63 | #textlogo h1.site-name{width:86%;font-size:200%;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;} 64 | @media only screen and (min-width: 768px){#textlogo h1.site-name{font-size:240%} 65 | }@media only screen and (min-width: 1024px){#textlogo h1.site-name{font-size:280%} 66 | }#textlogo h2.blog-motto{font-size:.7em;font-weight:normal;} 67 | @media only screen and (min-width: 768px){#textlogo h2.blog-motto{font-size:100%} 68 | }@media only screen and (min-width: 1024px){#textlogo h2.blog-motto{font-size:110%} 69 | }.navbar{position:absolute;width:2em;right:0;top:1em;padding:.5em;} 70 | @media only screen and (min-width: 1024px){.navbar{display:none} 71 | }.navbutton::before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f0c9"} 72 | .navmobile::before{padding-left:1em} 73 | header nav{float:left;width:100%;font-size:112.5%;padding-top:.5em;max-height:.01em;-webkit-transition:max-height 1s ease-out;-moz-transition:max-height 1s ease-out;-o-transition:max-height 1s ease-out;-ms-transition:max-height 1s ease-out;transition:max-height 1s ease-out;} 74 | @media only screen and (min-width: 568px){header nav{width:50%} 75 | }@media only screen and (min-width: 1024px){header nav{float:right;width:auto;margin-top:1em;max-height:none} 76 | }@media only screen and (min-width: 1024px){header nav ul{float:right} 77 | }@media only screen and (min-width: 1024px){header nav ul li{float:left} 78 | }header nav ul li a{padding:.2em 0 .2em 1em;} 79 | @media only screen and (min-width: 1024px){header nav ul li a{padding:.2em 1.5em} 80 | }header nav ul li a:hover{background:#dd2c11;color:#e9cd4c} 81 | .shownav{max-height:40em} 82 | .search{padding:.1em 0 0 1em;} 83 | .search input{line-height:1.8;font-size:15px;border:1px solid #fff;color:#fff;background:transparent;width:80%;padding-left:.5em;} 84 | @media only screen and (min-width: 1024px){.search input{width:8em;-webkit-transition:0.5s width;-moz-transition:0.5s width;-o-transition:0.5s width;-ms-transition:0.5s width;transition:0.5s width} 85 | .search input:focus{width:15em} 86 | }.search label{display:none} 87 | /* index layout */ 88 | #container{width:95%;margin:0 auto;overflow:hidden;} 89 | @media only screen and (min-width: 768px){#container{width:96%} 90 | }@media only screen and (min-width: 1024px){#container{width:94%} 91 | }@media only screen and (min-width: 1560px){#container{width:82%} 92 | }#main{margin:1em 0 0;line-height:1.8;} 93 | @media only screen and (min-width: 1024px){#main{margin:2em 0 0;width:75%;float:left;-webkit-transition:margin 0.5s ease-out;-moz-transition:margin 0.5s ease-out;-o-transition:margin 0.5s ease-out;-ms-transition:margin 0.5s ease-out;transition:margin 0.5s ease-out} 94 | }#main section.post{background:#fafafa;margin-bottom:.125em;} 95 | #main section.post a{display:block;border-left:.5em solid #ccc;-webkit-transition:border-left 0.45s;-moz-transition:border-left 0.45s;-o-transition:border-left 0.45s;-ms-transition:border-left 0.45s;transition:border-left 0.45s;padding:.5em;} 96 | @media only screen and (min-width: 768px){#main section.post a{padding:1em} 97 | }#main section.post a:hover{border-left:.5em solid #ea6753} 98 | #main section.post a h1{color:#2ca6cb;line-height:2} 99 | #main section.post a p{color:#817c7c} 100 | #main section.post a time{color:#817c7c;display:block;margin:.5em 0;font-size:.5em} 101 | .moveMain{margin-left:10% !important} 102 | #page-nav{background:#fafafa;text-align:center;overflow:hidden;} 103 | #page-nav a,#page-nav span{display:inline-block;padding:.5em 1em} 104 | #page-nav a{color:#2ca6cb;} 105 | #page-nav a:hover{background:#ccc;color:#ea6753} 106 | #page-nav .prev{float:left;border-left:.5em solid #ccc;-webkit-transition:border-left 0.5s;-moz-transition:border-left 0.5s;-o-transition:border-left 0.5s;-ms-transition:border-left 0.5s;transition:border-left 0.5s;} 107 | #page-nav .prev:hover{border-left:.5em solid #ea6753} 108 | #page-nav .next{float:right} 109 | #page-nav .page-number{display:none;} 110 | @media only screen and (min-width: 768px){#page-nav .page-number{display:inline-block} 111 | }#page-nav .current{color:#b8b8b8;font-weight:bold} 112 | #page-nav .space{color:#2ca6cb} 113 | /* page layout */ 114 | @media only screen and (min-width: 1024px){.page{margin-left:10% !important} 115 | }/* archive layout */ 116 | .category-icon:before,.tag-icon:before,.archive-icon:before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#ccc;font-size:100%;padding-right:.3em} 117 | .category-icon:before{content:"\f07b"} 118 | .tag-icon:before{content:"\f02c"} 119 | .archive-icon:before{content:"\f187"} 120 | .archive-title{margin:1em 0;width:97%;padding:2em 0 2em 3%;background:#fafafa;border-left:.5em solid #ccc;} 121 | @media only screen and (min-width: 1024px){.archive-title{margin:2em 0;width:18.5%;padding-left:.5%;float:left} 122 | }.archive-title h2{width:90%;color:#2ca6cb;font-size:120%} 123 | .archive-title a{color:#2ca6cb;-webkit-transition:color 0.5s;-moz-transition:color 0.5s;-o-transition:color 0.5s;-ms-transition:color 0.5s;transition:color 0.5s;} 124 | .archive-title a:hover{color:#ea6753;-webkit-transition:color 0.5s;-moz-transition:color 0.5s;-o-transition:color 0.5s;-ms-transition:color 0.5s;transition:color 0.5s} 125 | .current{color:#ea6753 !important} 126 | @media only screen and (min-width: 768px){.archive-part{min-height:200px} 127 | }@media only screen and (min-width: 1024px){.archive-part{width:78% !important;float:right;margin-left:2% !important} 128 | }.archive-part section.post{width:100%;} 129 | @media only screen and (min-width: 768px){.archive-part section.post{float:left;width:50%} 130 | }@media only screen and (min-width: 1024px){.archive-part section.post{width:33.333%} 131 | }@media only screen and (min-width: 768px){.archive-nav{width:100%;float:left;margin-top:1em} 132 | }/* tags&categories layout */ 133 | .all-list-box{min-height:400px} 134 | .post,.page{background:#fafafa;} 135 | .post a,.page a{color:#2ca6cb;} 136 | .post a:hover,.page a:hover{color:#ea6753} 137 | @media only screen and (min-width: 768px){article header.article-info{border-bottom:1px solid #dbdbdb} 138 | }article header.article-info >h1{padding:.2em 3%;font-size:170%;line-height:1.5;word-wrap:break-word;word-break:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;border-left:5px solid #ea6753} 139 | @media only screen and (min-width: 1024px){article header.article-info >h1{font-size:200%;padding-top:.3em} 140 | }article header.article-info >p.article-author{padding:.3em 4% .3em 0;text-align:right;border-bottom:1px solid #dbdbdb;} 141 | @media only screen and (min-width: 768px){article header.article-info >p.article-author{float:right;border-bottom:none} 142 | }article header.article-info >p.article-time{padding-top:.5em;font-size:.8em;text-align:center;} 143 | @media only screen and (min-width: 768px){article header.article-info >p.article-time{float:right;margin-right:1em;padding-top:.1em;font-size:.9em} 144 | }article header.article-info >p.article-time:before{font-family:"FontAwesome";font-size:130%;content:"\f017";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale} 145 | article .article-content{padding:1.5em 4%;} 146 | article .article-content .kb{padding:.1em .6em;border:1px solid #ccc;background-color:code-color;color:#8f8f8f;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;box-shadow:0 1px 0 rgba(0,0,0,0.2),0 0 0 2px #fff inset;-webkit-border-radius:3px;border-radius:3px;display:inline-block;margin:0 .1em;text-shadow:0 1px 0 #fff;line-height:1.5;white-space:nowrap} 147 | article .article-content h1,article .article-content h2{font-size:180%;line-height:1.2em} 148 | article .article-content h3,article .article-content h4,article .article-content h5,article .article-content h6{font-size:140%} 149 | article .article-content h1,article .article-content h2,article .article-content h3,article .article-content h4,article .article-content h5,article .article-content h6{color:#333;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;padding:.3em 0;margin:.5em 0;} 150 | article .article-content h1 >code,article .article-content h2 >code,article .article-content h3 >code,article .article-content h4 >code,article .article-content h5 >code,article .article-content h6 >code{color:#a3a3a3} 151 | article .article-content hr{border:1px solid #dbdbdb} 152 | article .article-content strong,article .article-content em{font-weight:bold} 153 | article .article-content acronym,article .article-content abbr{border-bottom:1px dotted} 154 | article .article-content blockquote{border-left:.2em solid #ea6753;margin:.65em 0 .65em 4%;padding-left:1%;line-height:1.5;font-size:110%;} 155 | article .article-content blockquote footer{background:#fafafa;padding:0;margin:0;font-size:80%;line-height:1em} 156 | article .article-content blockquote cite{font-style:italic;padding-left:.5em} 157 | article .article-content ul,article .article-content ol{padding-left:2em;font-size:105%;} 158 | @media only screen and (min-width: 768px){article .article-content ul,article .article-content ol{padding-left:3em} 159 | }article .article-content ul li{list-style:disc;text-align:match-parent;margin:.5em 0} 160 | article .article-content ol li{list-style-type:decimal;margin:.5em 0} 161 | article .article-content dl dt{font-weight:blod} 162 | article .article-content ul li>code,article .article-content ol li>code,article .article-content p code,article .article-content strong code,article .article-content em code{font-family:Monaco,Menlo,Consolas,Courier New,monospace;background:#eee;color:#747070;border:1px solid #d6d6d6;padding:0 5px;margin:0 2px;font-size:90%;white-space:nowrap;text-shadow:0 1px #fff} 163 | article .article-content p{font-size:105%;line-height:1.7;margin:.7em 0;} 164 | @media only screen and (min-width: 1024px){article .article-content p{margin:1.2em 0} 165 | }article .article-content img,article .article-content video,article .article-content figure img{max-width:100%;display:block;margin:auto;height:auto;vertical-align:middle;padding-top:.5em;} 166 | @media only screen and (min-width: 1024px){article .article-content img,article .article-content video,article .article-content figure img{padding-top:.7em} 167 | }article .article-content figcaption,article .article-content .caption{text-align:center;display:block;font-size:.9em;font-weight:blod} 168 | article .article-content .video-container{position:relative;padding-top:56%;height:0;overflow:hidden;} 169 | article .article-content .video-container iframe,article .article-content .video-container object,article .article-content .video-container embed{position:absolute;top:0;left:0;width:100%;height:100%;margin-top:0} 170 | article .article-content table{width:100%;border-collapse:collapse;border-spacing:0;} 171 | article .article-content table th{font-weight:bold;border-bottom:3px solid #dbdbdb;padding-bottom:.5em} 172 | article .article-content table td{border-bottom:1px solid #dbdbdb;padding:10px 0} 173 | article .article-content .pullquote{text-align:left;width:45%;margin:0;border:none} 174 | article .article-content .left{margin-left:.5em;margin-right:1em;float:left} 175 | article .article-content .right{margin-right:.5em;margin-left:1em;float:right} 176 | footer.article-footer{background:#fafafa;padding:0 4%;margin:0;border-top:1px solid #dbdbdb} 177 | .article-share{float:right;width:100%;} 178 | @media only screen and (min-width: 568px){.article-share{width:60%} 179 | }@media only screen and (min-width: 768px){.article-share{width:40%} 180 | }.share span{float:right;height:3em;width:1em;margin-right:.5em;position:relative;color:#d6d6d6;} 181 | .share span:before{font-family:"FontAwesome";content:"\f064";font-size:1em;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:1.5em;height:1.5em;position:absolute;top:50%;left:50%;margin-top:-.75em;margin-left:-.75em} 182 | .share a{float:right;width:3em;height:3em;display:block;position:relative;} 183 | .share a:before{font-size:100%;font-family:"FontAwesome";text-align:center;color:#817c7c;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:1.5em;height:1.5em;position:absolute;top:50%;left:50%;margin-top:-.75em;margin-left:-.75em} 184 | .share a:hover:before{color:#fff} 185 | .article-share-twitter:before{content:"\f099"} 186 | .article-share-twitter:hover{background:#00aced;text-shadow:0 1px #008abe} 187 | .article-share-facebook:before{content:"\f09a"} 188 | .article-share-facebook:hover{background:#3b5998;text-shadow:0 1px #2f477a} 189 | .article-share-weibo:before{content:"\f18a"} 190 | .article-share-weibo:hover{background:#eb182c;text-shadow:0 1px #bf1121} 191 | .article-share-qrcode:before{content:"\f029"} 192 | .article-share-qrcode:hover{background:#49ae0f;text-shadow:0 1px #3a8b0c} 193 | .article-back-to-top:before{content:"\f062"} 194 | .article-back-to-top:hover{background:#762c54;text-shadow:0 1px #5e2343} 195 | .qrcode{width:15em;height:15em;position:absolute;top:50%;left:50%;margin-top:-7.5em;margin-left:-7.5em;background:#fff;border:2px solid #ccc;-webkit-border-radius:3px;border-radius:3px;display:inline-block;opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);position:fixed;text-align:center;visibility:hidden;z-index:10;-webkit-transition:opacity 0.5s;-moz-transition:opacity 0.5s;-o-transition:opacity 0.5s;-ms-transition:opacity 0.5s;transition:opacity 0.5s;} 196 | @media only screen and (min-width: 1024px){.qrcode{width:20em;height:20em;position:absolute;top:50%;left:50%;margin-top:-10em;margin-left:-10em;position:fixed} 197 | }.qrcode span{display:block;width:80%;height:1.5em;font-size:80%;float:left;} 198 | .qrcode span:before{content:none} 199 | .qrcode a{display:block;width:16%;height:1.5em;float:left} 200 | .qrcode img{width:90%;height:90%} 201 | .qrclose:before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f057";color:#ccc} 202 | .qrclose:hover:before{color:#2ca6cb !important} 203 | .overlay{display:none !important} 204 | .overlay:target+.qrcode{opacity:1;-ms-filter:none;filter:none;visibility:visible} 205 | .article-tags,.article-categories{padding:.5em 0;float:left;width:100%;} 206 | @media only screen and (min-width: 568px){.article-tags,.article-categories{width:50%} 207 | }@media only screen and (min-width: 768px){.article-tags,.article-categories{width:30%} 208 | }.article-tags{color:#d6d6d6;} 209 | .article-tags span{position:relative;float:left;width:1em;height:2em;margin-right:.5em;} 210 | .article-tags span:before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:1.2em;height:1.2em;position:absolute;top:50%;left:50%;margin-top:-.6em;margin-left:-.6em;content:"\f02c"} 211 | .article-tags a{float:left;padding:0 .3em;margin:.3em;background:#e6e6e6;} 212 | .article-tags a:hover{color:#fff;background:#2ca6cb} 213 | .article-categories{color:#d6d6d6;margin-top:.3em;} 214 | .article-categories span:before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f07b"} 215 | .article-category-link{padding:.5em;margin:0 .3em;} 216 | .article-category-link:hover{color:#fff !important;background:#2ca6cb} 217 | .article-nav{padding:0 10%;} 218 | @media only screen and (min-width: 768px){.article-nav{padding:0 4%} 219 | }.article-nav strong{font-size:.6em} 220 | .article-nav a{display:block;overflow:hidden} 221 | .article-nav .prev a:hover,.article-nav .next a:hover{background:#2ca6cb;color:#fff} 222 | .article-nav .prev{width:100%;float:left;} 223 | .article-nav .prev strong{padding-left:1.8em} 224 | .article-nav .prev span:before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f100";padding-right:.5em} 225 | @media only screen and (min-width: 768px){.article-nav .prev{width:45%;float:left} 226 | }.article-nav .next{width:100%;float:left;text-align:left;} 227 | .article-nav .next strong{padding-left:1.5em} 228 | .article-nav .next span:before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f101";padding-right:.5em} 229 | @media only screen and (min-width: 768px){.article-nav .next{width:45%;float:right;text-align:right} 230 | .article-nav .next strong{padding-right:1.8em} 231 | .article-nav .next span:before{content:none} 232 | .article-nav .next span:after{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f101";padding-left:.5em} 233 | }section.comment{padding:0 4%;margin:1em 0} 234 | 235 | .toc-article{background:#eee;margin:2em 0 0 .5em;padding:1em 1em 1em 2.5em;line-height:1em;font-size:.8em;float:right;} 236 | 237 | #TableOfContents { margin: 1em 0 0 0; } 238 | #TableOfContents ul { list-style-type:decimal; margin: 0; padding: 0 25px; } 239 | #TableOfContents ul li { list-style-type:decimal; } 240 | #TableOfContents > ul { padding: 0; } 241 | #TableOfContents > ul > li > ul { padding: 0; } 242 | 243 | #toc{line-height:1em;font-size:.8em;float:right;} 244 | #toc .toc{padding:0;} 245 | #toc .toc li{list-style-type:none} 246 | #toc .toc-child{padding-left:1.5em} 247 | #toc.toc-aside{display:none;width:13%;position:fixed;right:2%;top:320px;overflow:hidden;line-height:1.5em;font-size:1em;color:#333;opacity:.6;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";filter:alpha(opacity=60);-webkit-transition:opacity 1s ease-out;-moz-transition:opacity 1s ease-out;-o-transition:opacity 1s ease-out;-ms-transition:opacity 1s ease-out;transition:opacity 1s ease-out;} 248 | #toc.toc-aside strong{padding:.3em 0;color:#817c7c} 249 | #toc.toc-aside:hover{-webkit-transition:opacity 0.3s ease-out;-moz-transition:opacity 0.3s ease-out;-o-transition:opacity 0.3s ease-out;-ms-transition:opacity 0.3s ease-out;transition:opacity 0.3s ease-out;opacity:1;-ms-filter:none;filter:none} 250 | #toc.toc-aside a{-webkit-transition:color 1s ease-out;-moz-transition:color 1s ease-out;-o-transition:color 1s ease-out;-ms-transition:color 1s ease-out;transition:color 1s ease-out;} 251 | #toc.toc-aside a:hover{color:#ea6753;-webkit-transition:color 0.3s ease-out;-moz-transition:color 0.3s ease-out;-o-transition:color 0.3s ease-out;-ms-transition:color 0.3s ease-out;transition:color 0.3s ease-out} 252 | .active{color:#ea6753 !important} 253 | .openaside{display:none;position:fixed;right:7.5%;top:260px;} 254 | .openaside a{display:block;color:#fff;border:1px solid #fff;-webkit-border-radius:5px;border-radius:5px;background:#ea6753;padding:.2em .55em;} 255 | .openaside a::before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f0c9"} 256 | .closeaside{display:none;} 257 | .closeaside a{color:#ea6753;} 258 | .closeaside a:hover{color:#2ca6cb} 259 | .closeaside a::before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f0c9"} 260 | @media only screen and (min-width: 1024px){.closeaside{display:block;position:absolute;right:25px;top:22px} 261 | }#asidepart{background:#fafafa;margin:1em 0 0;padding:.5em 2% 1em;} 262 | @media only screen and (min-width: 1024px){#asidepart{position:relative;float:left;width:18%;margin:2em 0 0 3%} 263 | }.asidetitle{font-size:1.1em;color:#2ca6cb;padding:0 0 .3125em 0;border-bottom:.1875em solid #ccc;} 264 | .asidetitle a{color:#2ca6cb;} 265 | .asidetitle a:hover{color:#ea6753;-webkit-transition:color 0.5s;-moz-transition:color 0.5s;-o-transition:color 0.5s;-ms-transition:color 0.5s;transition:color 0.5s} 266 | @media only screen and (min-width: 768px){.categorieslist{width:45%;float:left;margin:0 5% 0 0} 267 | }@media only screen and (min-width: 1024px){.categorieslist{width:100%;float:none;margin:1em 0 0} 268 | }.categorieslist li{border-bottom:1px solid #ccc;} 269 | .categorieslist li a{display:block;padding:.5em 5%;} 270 | .categorieslist li a:hover{color:#ea6753} 271 | .tagslist{margin:1em 0 0;} 272 | @media only screen and (min-width: 768px){.tagslist{width:45%;float:left;margin:0 5% 0 0} 273 | }@media only screen and (min-width: 1024px){.tagslist{width:100%;float:none;margin:1em 0 0} 274 | }.tagslist ul{padding:.5em 0} 275 | .tagslist ul li{float:left;} 276 | .tagslist ul li a{display:block;margin:.3125em;padding:.125em .3125em;background:#dbdbdb;} 277 | .tagslist ul li a:hover{color:#ea6753;background:#e6e6e6} 278 | .rsspart{background:#ea6753;width:100%;} 279 | @media only screen and (min-width: 768px){.rsspart{float:left;width:45%;margin:0 5% 0 0} 280 | }@media only screen and (min-width: 1024px){.rsspart{width:100%;float:none;margin:1em 0 0} 281 | }.rsspart a{color:#fff;display:block;padding:.625em 0;text-align:center;} 282 | .rsspart a:hover{color:#ea6753;background:#fafafa} 283 | .rsspart a::before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;padding-right:.5em;content:"\f09e"} 284 | @media only screen and (min-width: 768px){.archiveslist{width:45%;float:left;margin:0 5% 0 0} 285 | }@media only screen and (min-width: 1024px){.archiveslist{width:100%;float:none;margin:1em 0 0} 286 | }.archiveslist li{font-size:.8em;line-height:2em;} 287 | .archiveslist li a{padding:.5em;} 288 | .archiveslist li a:hover{color:#ea6753;-webkit-transition:color 0.25s;-moz-transition:color 0.25s;-o-transition:color 0.25s;-ms-transition:color 0.25s;transition:color 0.25s} 289 | .archiveslist .archive-list-count:before{content:"("} 290 | .archiveslist .archive-list-count:after{content:")"} 291 | .archive-list{padding:.5em 0} 292 | .archive-float ul{padding:0} 293 | .archive-float li{float:left;margin:.3em;} 294 | @media only screen and (min-width: 1024px){.archive-float li{float:none} 295 | }@media only screen and (min-width: 768px){.tagcloudlist{width:45%;float:left;margin:0 5% 0 0} 296 | }@media only screen and (min-width: 1024px){.tagcloudlist{width:100%;float:none;margin:1em 0 0} 297 | }.tagcloudlist .tagcloudlist a{padding:.2em;display:block;float:left;} 298 | .tagcloudlist .tagcloudlist a:hover{color:#ea6753;-webkit-transition:color 0.25s;-moz-transition:color 0.25s;-o-transition:color 0.25s;-ms-transition:color 0.25s;transition:color 0.25s} 299 | .linkslist{margin-top:.5em;} 300 | @media only screen and (min-width: 768px){.linkslist{width:45%;float:left;margin:0 5% 0 0} 301 | }@media only screen and (min-width: 1024px){.linkslist{width:100%;float:none;margin:1em 0 0} 302 | }.linkslist ul{padding:.5em 0;} 303 | .linkslist ul a{font-size:1em;line-height:1.5;display:block;padding:0 3%;} 304 | .linkslist ul a:hover{color:#ea6753;-webkit-transition:color 0.25s;-moz-transition:color 0.25s;-o-transition:color 0.25s;-ms-transition:color 0.25s;transition:color 0.25s} 305 | footer{margin-top:1em;background:#1f1f1f;padding:0 2% .5em} 306 | #footer{width:95%;margin:0 auto;overflow:hidden;position:relative;} 307 | #footer .line{width:100%;height:14em;margin:0 auto;} 308 | @media only screen and (min-width: 768px){#footer .line{width:10em;float:left;position:relative} 309 | }#footer .line span{display:block;width:.5em;height:6.25em;border-right:.125em solid #fff;margin:0 auto;} 310 | @media only screen and (min-width: 768px){#footer .line span{position:absolute;left:3em;margin:0 0 1.5em} 311 | }.author{width:6.875em;height:6.875em;margin:0 auto;-webkit-border-radius:3.4375em;border-radius:3.4375em;-webkit-transition:-webkit-transform 2s ease-out;-moz-transition:-moz-transform 2s ease-out;-o-transition:-o-transform 2s ease-out;-ms-transition:-ms-transform 2s ease-out;transition:transform 2s ease-out;} 312 | .author:hover{-webkit-transform:rotateZ(360deg);-moz-transform:rotateZ(360deg);-o-transform:rotateZ(360deg);-ms-transform:rotateZ(360deg);transform:rotateZ(360deg)} 313 | @media only screen and (min-width: 768px){.author{position:absolute;top:6em;margin:0 0 1.5em} 314 | }.info{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:150%;line-height:1.3em;width:90%;margin:0 auto;color:#fff;} 315 | @media only screen and (min-width: 768px){.info{margin:4.5em 0 2em 0;float:left;width:75%} 316 | }.social-font{width:100%;margin:0 auto;float:left;padding-left:3%;} 317 | @media only screen and (min-width: 568px){.social-font{padding-left:20%} 318 | }@media only screen and (min-width: 768px){.social-font{width:18em;position:absolute;right:-3em;top:3em} 319 | }.social-font a{float:left;display:block;width:12;color:#fff;font-size:180%;padding:.5em;} 320 | @media only screen and (min-width: 1024px){.social-font a{padding:.3em} 321 | }.social-font a:hover:before{color:#2ca6cb} 322 | .social-font a[title="weibo"]::before,.social-font a[title="twitter"]::before,.social-font a[title="github"]::before,.social-font a[title="facebook"]::before,.social-font a[title="linkedin"]::before{font-family:"FontAwesome";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale} 323 | .social-font a[title="weibo"]::before{content:"\f18a"} 324 | .social-font a[title="twitter"]::before{content:"\f099"} 325 | .social-font a[title="github"]::before{content:"\f09b"} 326 | .social-font a[title="facebook"]::before{content:"\f09a"} 327 | .social-font a[title="linkedin"]::before{content:"\f08c"} 328 | .copyright{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;width:100%;color:#fff;text-align:center;} 329 | @media only screen and (min-width: 768px){.copyright{float:left} 330 | }.copyright a{color:#fff;} 331 | .copyright a:hover{color:#2ca6cb} 332 | .article-content code, .entry pre { font-family: Hack, monospace; font-size: 14px; } 333 | .article-content pre { margin: 10px 0 15px 0; border: 1px solid #ddd; line-height: 19px; white-space: pre-wrap; word-wrap: break-word; overflow-x: auto; overflow-y: hidden; } 334 | .ds-highlight{color:#2ca6cb !important;} 335 | .ds-highlight:hover{color:#ea6753 !important} 336 | .ds-avatar{background:#fafafa !important;} 337 | .ds-avatar img{width:54px !important;height:54px !important;border:2px solid #dbdbdb !important;-webkit-border-radius:27px !important;border-radius:27px !important;-webkit-transition:-webkit-transform 0.5s ease-out !important;-moz-transition:-moz-transform 0.5s ease-out !important;-o-transition:-o-transform 0.5s ease-out !important;-ms-transition:-ms-transform 0.5s ease-out !important;transition:transform 0.5s ease-out !important;} 338 | .ds-avatar img:hover{-webkit-transform:rotateZ(360deg) !important;-moz-transform:rotateZ(360deg) !important;-o-transform:rotateZ(360deg) !important;-ms-transform:rotateZ(360deg) !important;transform:rotateZ(360deg) !important;-webkit-box-shadow:inset 0 -1px 0 rgba(51,51,51,0.2) sf !important;box-shadow:inset 0 -1px 0 rgba(51,51,51,0.2) sf !important} 339 | .ds-children .ds-avatar img{width:30px !important;height:30px !important;-webkit-border-radius:15px !important;border-radius:15px !important;-webkit-transition:-webkit-transform 0.5s ease-out !important;-moz-transition:-moz-transform 0.5s ease-out !important;-o-transition:-o-transform 0.5s ease-out !important;-ms-transition:-ms-transform 0.5s ease-out !important;transition:transform 0.5s ease-out !important;border:1px solid #dbdbdb !important;} 340 | .ds-children .ds-avatar img:hover{-webkit-transform:rotateZ(360deg) !important;-moz-transform:rotateZ(360deg) !important;-o-transform:rotateZ(360deg) !important;-ms-transform:rotateZ(360deg) !important;transform:rotateZ(360deg) !important;-webkit-box-shadow:inset 0 -1px 0 rgba(51,51,51,0.2) sf !important;box-shadow:inset 0 -1px 0 rgba(51,51,51,0.2) sf !important} 341 | .ds-replybox img{width:30px !important;height:30px !important} 342 | .ds-comment-body{padding-left:80px !important} 343 | .ds-children .ds-comment-body{padding-left:60px !important} 344 | .ds-post{border-top:none !important;margin-top:.5em !important} 345 | .ds-comments{padding-bottom:1em !important} 346 | textarea{color:#817c7c !important;background:#fff !important;} 347 | textarea::-webkit-input-placeholder{color:#817c7c !important} 348 | textarea::-moz-placeholder{color:#817c7c !important} 349 | .article-gallery{background:#fafafa;position:relative} 350 | .article-gallery-photos{position:relative;overflow:hidden} 351 | .article-gallery-img{display:none;max-width:100%;imgdisplay:block;max-width:100%;margin:0 auto} 352 | .article-gallery-img:first-child{display:block} 353 | .article-gallery-img .loaded{position:absolute;display:block} 354 | -------------------------------------------------------------------------------- /static/fancybox/jquery.fancybox.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * fancyBox - jQuery Plugin 3 | * version: 2.1.5 (Fri, 14 Jun 2013) 4 | * requires jQuery v1.6 or later 5 | * 6 | * Examples at http://fancyapps.com/fancybox/ 7 | * License: www.fancyapps.com/fancybox/#license 8 | * 9 | * Copyright 2012 Janis Skarnelis - janis@fancyapps.com 10 | * 11 | */ 12 | 13 | ;(function (window, document, $, undefined) { 14 | "use strict"; 15 | 16 | var H = $("html"), 17 | W = $(window), 18 | D = $(document), 19 | F = $.fancybox = function () { 20 | F.open.apply( this, arguments ); 21 | }, 22 | IE = navigator.userAgent.match(/msie/i), 23 | didUpdate = null, 24 | isTouch = document.createTouch !== undefined, 25 | 26 | isQuery = function(obj) { 27 | return obj && obj.hasOwnProperty && obj instanceof $; 28 | }, 29 | isString = function(str) { 30 | return str && $.type(str) === "string"; 31 | }, 32 | isPercentage = function(str) { 33 | return isString(str) && str.indexOf('%') > 0; 34 | }, 35 | isScrollable = function(el) { 36 | return (el && !(el.style.overflow && el.style.overflow === 'hidden') && ((el.clientWidth && el.scrollWidth > el.clientWidth) || (el.clientHeight && el.scrollHeight > el.clientHeight))); 37 | }, 38 | getScalar = function(orig, dim) { 39 | var value = parseInt(orig, 10) || 0; 40 | 41 | if (dim && isPercentage(orig)) { 42 | value = F.getViewport()[ dim ] / 100 * value; 43 | } 44 | 45 | return Math.ceil(value); 46 | }, 47 | getValue = function(value, dim) { 48 | return getScalar(value, dim) + 'px'; 49 | }; 50 | 51 | $.extend(F, { 52 | // The current version of fancyBox 53 | version: '2.1.5', 54 | 55 | defaults: { 56 | padding : 15, 57 | margin : 20, 58 | 59 | width : 800, 60 | height : 600, 61 | minWidth : 100, 62 | minHeight : 100, 63 | maxWidth : 9999, 64 | maxHeight : 9999, 65 | pixelRatio: 1, // Set to 2 for retina display support 66 | 67 | autoSize : true, 68 | autoHeight : false, 69 | autoWidth : false, 70 | 71 | autoResize : true, 72 | autoCenter : !isTouch, 73 | fitToView : true, 74 | aspectRatio : false, 75 | topRatio : 0.5, 76 | leftRatio : 0.5, 77 | 78 | scrolling : 'auto', // 'auto', 'yes' or 'no' 79 | wrapCSS : '', 80 | 81 | arrows : true, 82 | closeBtn : true, 83 | closeClick : false, 84 | nextClick : false, 85 | mouseWheel : true, 86 | autoPlay : false, 87 | playSpeed : 3000, 88 | preload : 3, 89 | modal : false, 90 | loop : true, 91 | 92 | ajax : { 93 | dataType : 'html', 94 | headers : { 'X-fancyBox': true } 95 | }, 96 | iframe : { 97 | scrolling : 'auto', 98 | preload : true 99 | }, 100 | swf : { 101 | wmode: 'transparent', 102 | allowfullscreen : 'true', 103 | allowscriptaccess : 'always' 104 | }, 105 | 106 | keys : { 107 | next : { 108 | 13 : 'left', // enter 109 | 34 : 'up', // page down 110 | 39 : 'left', // right arrow 111 | 40 : 'up' // down arrow 112 | }, 113 | prev : { 114 | 8 : 'right', // backspace 115 | 33 : 'down', // page up 116 | 37 : 'right', // left arrow 117 | 38 : 'down' // up arrow 118 | }, 119 | close : [27], // escape key 120 | play : [32], // space - start/stop slideshow 121 | toggle : [70] // letter "f" - toggle fullscreen 122 | }, 123 | 124 | direction : { 125 | next : 'left', 126 | prev : 'right' 127 | }, 128 | 129 | scrollOutside : true, 130 | 131 | // Override some properties 132 | index : 0, 133 | type : null, 134 | href : null, 135 | content : null, 136 | title : null, 137 | 138 | // HTML templates 139 | tpl: { 140 | wrap : '
    ', 141 | image : '', 142 | iframe : '', 143 | error : '

    The requested content cannot be loaded.
    Please try again later.

    ', 144 | closeBtn : '', 145 | next : '', 146 | prev : '' 147 | }, 148 | 149 | // Properties for each animation type 150 | // Opening fancyBox 151 | openEffect : 'fade', // 'elastic', 'fade' or 'none' 152 | openSpeed : 250, 153 | openEasing : 'swing', 154 | openOpacity : true, 155 | openMethod : 'zoomIn', 156 | 157 | // Closing fancyBox 158 | closeEffect : 'fade', // 'elastic', 'fade' or 'none' 159 | closeSpeed : 250, 160 | closeEasing : 'swing', 161 | closeOpacity : true, 162 | closeMethod : 'zoomOut', 163 | 164 | // Changing next gallery item 165 | nextEffect : 'elastic', // 'elastic', 'fade' or 'none' 166 | nextSpeed : 250, 167 | nextEasing : 'swing', 168 | nextMethod : 'changeIn', 169 | 170 | // Changing previous gallery item 171 | prevEffect : 'elastic', // 'elastic', 'fade' or 'none' 172 | prevSpeed : 250, 173 | prevEasing : 'swing', 174 | prevMethod : 'changeOut', 175 | 176 | // Enable default helpers 177 | helpers : { 178 | overlay : true, 179 | title : true 180 | }, 181 | 182 | // Callbacks 183 | onCancel : $.noop, // If canceling 184 | beforeLoad : $.noop, // Before loading 185 | afterLoad : $.noop, // After loading 186 | beforeShow : $.noop, // Before changing in current item 187 | afterShow : $.noop, // After opening 188 | beforeChange : $.noop, // Before changing gallery item 189 | beforeClose : $.noop, // Before closing 190 | afterClose : $.noop // After closing 191 | }, 192 | 193 | //Current state 194 | group : {}, // Selected group 195 | opts : {}, // Group options 196 | previous : null, // Previous element 197 | coming : null, // Element being loaded 198 | current : null, // Currently loaded element 199 | isActive : false, // Is activated 200 | isOpen : false, // Is currently open 201 | isOpened : false, // Have been fully opened at least once 202 | 203 | wrap : null, 204 | skin : null, 205 | outer : null, 206 | inner : null, 207 | 208 | player : { 209 | timer : null, 210 | isActive : false 211 | }, 212 | 213 | // Loaders 214 | ajaxLoad : null, 215 | imgPreload : null, 216 | 217 | // Some collections 218 | transitions : {}, 219 | helpers : {}, 220 | 221 | /* 222 | * Static methods 223 | */ 224 | 225 | open: function (group, opts) { 226 | if (!group) { 227 | return; 228 | } 229 | 230 | if (!$.isPlainObject(opts)) { 231 | opts = {}; 232 | } 233 | 234 | // Close if already active 235 | if (false === F.close(true)) { 236 | return; 237 | } 238 | 239 | // Normalize group 240 | if (!$.isArray(group)) { 241 | group = isQuery(group) ? $(group).get() : [group]; 242 | } 243 | 244 | // Recheck if the type of each element is `object` and set content type (image, ajax, etc) 245 | $.each(group, function(i, element) { 246 | var obj = {}, 247 | href, 248 | title, 249 | content, 250 | type, 251 | rez, 252 | hrefParts, 253 | selector; 254 | 255 | if ($.type(element) === "object") { 256 | // Check if is DOM element 257 | if (element.nodeType) { 258 | element = $(element); 259 | } 260 | 261 | if (isQuery(element)) { 262 | obj = { 263 | href : element.data('fancybox-href') || element.attr('href'), 264 | title : $('
    ').text( element.data('fancybox-title') || element.attr('title') ).html(), 265 | isDom : true, 266 | element : element 267 | }; 268 | 269 | if ($.metadata) { 270 | $.extend(true, obj, element.metadata()); 271 | } 272 | 273 | } else { 274 | obj = element; 275 | } 276 | } 277 | 278 | href = opts.href || obj.href || (isString(element) ? element : null); 279 | title = opts.title !== undefined ? opts.title : obj.title || ''; 280 | 281 | content = opts.content || obj.content; 282 | type = content ? 'html' : (opts.type || obj.type); 283 | 284 | if (!type && obj.isDom) { 285 | type = element.data('fancybox-type'); 286 | 287 | if (!type) { 288 | rez = element.prop('class').match(/fancybox\.(\w+)/); 289 | type = rez ? rez[1] : null; 290 | } 291 | } 292 | 293 | if (isString(href)) { 294 | // Try to guess the content type 295 | if (!type) { 296 | if (F.isImage(href)) { 297 | type = 'image'; 298 | 299 | } else if (F.isSWF(href)) { 300 | type = 'swf'; 301 | 302 | } else if (href.charAt(0) === '#') { 303 | type = 'inline'; 304 | 305 | } else if (isString(element)) { 306 | type = 'html'; 307 | content = element; 308 | } 309 | } 310 | 311 | // Split url into two pieces with source url and content selector, e.g, 312 | // "/mypage.html #my_id" will load "/mypage.html" and display element having id "my_id" 313 | if (type === 'ajax') { 314 | hrefParts = href.split(/\s+/, 2); 315 | href = hrefParts.shift(); 316 | selector = hrefParts.shift(); 317 | } 318 | } 319 | 320 | if (!content) { 321 | if (type === 'inline') { 322 | if (href) { 323 | content = $( isString(href) ? href.replace(/.*(?=#[^\s]+$)/, '') : href ); //strip for ie7 324 | 325 | } else if (obj.isDom) { 326 | content = element; 327 | } 328 | 329 | } else if (type === 'html') { 330 | content = href; 331 | 332 | } else if (!type && !href && obj.isDom) { 333 | type = 'inline'; 334 | content = element; 335 | } 336 | } 337 | 338 | $.extend(obj, { 339 | href : href, 340 | type : type, 341 | content : content, 342 | title : title, 343 | selector : selector 344 | }); 345 | 346 | group[ i ] = obj; 347 | }); 348 | 349 | // Extend the defaults 350 | F.opts = $.extend(true, {}, F.defaults, opts); 351 | 352 | // All options are merged recursive except keys 353 | if (opts.keys !== undefined) { 354 | F.opts.keys = opts.keys ? $.extend({}, F.defaults.keys, opts.keys) : false; 355 | } 356 | 357 | F.group = group; 358 | 359 | return F._start(F.opts.index); 360 | }, 361 | 362 | // Cancel image loading or abort ajax request 363 | cancel: function () { 364 | var coming = F.coming; 365 | 366 | if (coming && false === F.trigger('onCancel')) { 367 | return; 368 | } 369 | 370 | F.hideLoading(); 371 | 372 | if (!coming) { 373 | return; 374 | } 375 | 376 | if (F.ajaxLoad) { 377 | F.ajaxLoad.abort(); 378 | } 379 | 380 | F.ajaxLoad = null; 381 | 382 | if (F.imgPreload) { 383 | F.imgPreload.onload = F.imgPreload.onerror = null; 384 | } 385 | 386 | if (coming.wrap) { 387 | coming.wrap.stop(true, true).trigger('onReset').remove(); 388 | } 389 | 390 | F.coming = null; 391 | 392 | // If the first item has been canceled, then clear everything 393 | if (!F.current) { 394 | F._afterZoomOut( coming ); 395 | } 396 | }, 397 | 398 | // Start closing animation if is open; remove immediately if opening/closing 399 | close: function (event) { 400 | F.cancel(); 401 | 402 | if (false === F.trigger('beforeClose')) { 403 | return; 404 | } 405 | 406 | F.unbindEvents(); 407 | 408 | if (!F.isActive) { 409 | return; 410 | } 411 | 412 | if (!F.isOpen || event === true) { 413 | $('.fancybox-wrap').stop(true).trigger('onReset').remove(); 414 | 415 | F._afterZoomOut(); 416 | 417 | } else { 418 | F.isOpen = F.isOpened = false; 419 | F.isClosing = true; 420 | 421 | $('.fancybox-item, .fancybox-nav').remove(); 422 | 423 | F.wrap.stop(true, true).removeClass('fancybox-opened'); 424 | 425 | F.transitions[ F.current.closeMethod ](); 426 | } 427 | }, 428 | 429 | // Manage slideshow: 430 | // $.fancybox.play(); - toggle slideshow 431 | // $.fancybox.play( true ); - start 432 | // $.fancybox.play( false ); - stop 433 | play: function ( action ) { 434 | var clear = function () { 435 | clearTimeout(F.player.timer); 436 | }, 437 | set = function () { 438 | clear(); 439 | 440 | if (F.current && F.player.isActive) { 441 | F.player.timer = setTimeout(F.next, F.current.playSpeed); 442 | } 443 | }, 444 | stop = function () { 445 | clear(); 446 | 447 | D.unbind('.player'); 448 | 449 | F.player.isActive = false; 450 | 451 | F.trigger('onPlayEnd'); 452 | }, 453 | start = function () { 454 | if (F.current && (F.current.loop || F.current.index < F.group.length - 1)) { 455 | F.player.isActive = true; 456 | 457 | D.bind({ 458 | 'onCancel.player beforeClose.player' : stop, 459 | 'onUpdate.player' : set, 460 | 'beforeLoad.player' : clear 461 | }); 462 | 463 | set(); 464 | 465 | F.trigger('onPlayStart'); 466 | } 467 | }; 468 | 469 | if (action === true || (!F.player.isActive && action !== false)) { 470 | start(); 471 | } else { 472 | stop(); 473 | } 474 | }, 475 | 476 | // Navigate to next gallery item 477 | next: function ( direction ) { 478 | var current = F.current; 479 | 480 | if (current) { 481 | if (!isString(direction)) { 482 | direction = current.direction.next; 483 | } 484 | 485 | F.jumpto(current.index + 1, direction, 'next'); 486 | } 487 | }, 488 | 489 | // Navigate to previous gallery item 490 | prev: function ( direction ) { 491 | var current = F.current; 492 | 493 | if (current) { 494 | if (!isString(direction)) { 495 | direction = current.direction.prev; 496 | } 497 | 498 | F.jumpto(current.index - 1, direction, 'prev'); 499 | } 500 | }, 501 | 502 | // Navigate to gallery item by index 503 | jumpto: function ( index, direction, router ) { 504 | var current = F.current; 505 | 506 | if (!current) { 507 | return; 508 | } 509 | 510 | index = getScalar(index); 511 | 512 | F.direction = direction || current.direction[ (index >= current.index ? 'next' : 'prev') ]; 513 | F.router = router || 'jumpto'; 514 | 515 | if (current.loop) { 516 | if (index < 0) { 517 | index = current.group.length + (index % current.group.length); 518 | } 519 | 520 | index = index % current.group.length; 521 | } 522 | 523 | if (current.group[ index ] !== undefined) { 524 | F.cancel(); 525 | 526 | F._start(index); 527 | } 528 | }, 529 | 530 | // Center inside viewport and toggle position type to fixed or absolute if needed 531 | reposition: function (e, onlyAbsolute) { 532 | var current = F.current, 533 | wrap = current ? current.wrap : null, 534 | pos; 535 | 536 | if (wrap) { 537 | pos = F._getPosition(onlyAbsolute); 538 | 539 | if (e && e.type === 'scroll') { 540 | delete pos.position; 541 | 542 | wrap.stop(true, true).animate(pos, 200); 543 | 544 | } else { 545 | wrap.css(pos); 546 | 547 | current.pos = $.extend({}, current.dim, pos); 548 | } 549 | } 550 | }, 551 | 552 | update: function (e) { 553 | var type = (e && e.originalEvent && e.originalEvent.type), 554 | anyway = !type || type === 'orientationchange'; 555 | 556 | if (anyway) { 557 | clearTimeout(didUpdate); 558 | 559 | didUpdate = null; 560 | } 561 | 562 | if (!F.isOpen || didUpdate) { 563 | return; 564 | } 565 | 566 | didUpdate = setTimeout(function() { 567 | var current = F.current; 568 | 569 | if (!current || F.isClosing) { 570 | return; 571 | } 572 | 573 | F.wrap.removeClass('fancybox-tmp'); 574 | 575 | if (anyway || type === 'load' || (type === 'resize' && current.autoResize)) { 576 | F._setDimension(); 577 | } 578 | 579 | if (!(type === 'scroll' && current.canShrink)) { 580 | F.reposition(e); 581 | } 582 | 583 | F.trigger('onUpdate'); 584 | 585 | didUpdate = null; 586 | 587 | }, (anyway && !isTouch ? 0 : 300)); 588 | }, 589 | 590 | // Shrink content to fit inside viewport or restore if resized 591 | toggle: function ( action ) { 592 | if (F.isOpen) { 593 | F.current.fitToView = $.type(action) === "boolean" ? action : !F.current.fitToView; 594 | 595 | // Help browser to restore document dimensions 596 | if (isTouch) { 597 | F.wrap.removeAttr('style').addClass('fancybox-tmp'); 598 | 599 | F.trigger('onUpdate'); 600 | } 601 | 602 | F.update(); 603 | } 604 | }, 605 | 606 | hideLoading: function () { 607 | D.unbind('.loading'); 608 | 609 | $('#fancybox-loading').remove(); 610 | }, 611 | 612 | showLoading: function () { 613 | var el, viewport; 614 | 615 | F.hideLoading(); 616 | 617 | el = $('
    ').click(F.cancel).appendTo('body'); 618 | 619 | // If user will press the escape-button, the request will be canceled 620 | D.bind('keydown.loading', function(e) { 621 | if ((e.which || e.keyCode) === 27) { 622 | e.preventDefault(); 623 | 624 | F.cancel(); 625 | } 626 | }); 627 | 628 | if (!F.defaults.fixed) { 629 | viewport = F.getViewport(); 630 | 631 | el.css({ 632 | position : 'absolute', 633 | top : (viewport.h * 0.5) + viewport.y, 634 | left : (viewport.w * 0.5) + viewport.x 635 | }); 636 | } 637 | 638 | F.trigger('onLoading'); 639 | }, 640 | 641 | getViewport: function () { 642 | var locked = (F.current && F.current.locked) || false, 643 | rez = { 644 | x: W.scrollLeft(), 645 | y: W.scrollTop() 646 | }; 647 | 648 | if (locked && locked.length) { 649 | rez.w = locked[0].clientWidth; 650 | rez.h = locked[0].clientHeight; 651 | 652 | } else { 653 | // See http://bugs.jquery.com/ticket/6724 654 | rez.w = isTouch && window.innerWidth ? window.innerWidth : W.width(); 655 | rez.h = isTouch && window.innerHeight ? window.innerHeight : W.height(); 656 | } 657 | 658 | return rez; 659 | }, 660 | 661 | // Unbind the keyboard / clicking actions 662 | unbindEvents: function () { 663 | if (F.wrap && isQuery(F.wrap)) { 664 | F.wrap.unbind('.fb'); 665 | } 666 | 667 | D.unbind('.fb'); 668 | W.unbind('.fb'); 669 | }, 670 | 671 | bindEvents: function () { 672 | var current = F.current, 673 | keys; 674 | 675 | if (!current) { 676 | return; 677 | } 678 | 679 | // Changing document height on iOS devices triggers a 'resize' event, 680 | // that can change document height... repeating infinitely 681 | W.bind('orientationchange.fb' + (isTouch ? '' : ' resize.fb') + (current.autoCenter && !current.locked ? ' scroll.fb' : ''), F.update); 682 | 683 | keys = current.keys; 684 | 685 | if (keys) { 686 | D.bind('keydown.fb', function (e) { 687 | var code = e.which || e.keyCode, 688 | target = e.target || e.srcElement; 689 | 690 | // Skip esc key if loading, because showLoading will cancel preloading 691 | if (code === 27 && F.coming) { 692 | return false; 693 | } 694 | 695 | // Ignore key combinations and key events within form elements 696 | if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) { 697 | $.each(keys, function(i, val) { 698 | if (current.group.length > 1 && val[ code ] !== undefined) { 699 | F[ i ]( val[ code ] ); 700 | 701 | e.preventDefault(); 702 | return false; 703 | } 704 | 705 | if ($.inArray(code, val) > -1) { 706 | F[ i ] (); 707 | 708 | e.preventDefault(); 709 | return false; 710 | } 711 | }); 712 | } 713 | }); 714 | } 715 | 716 | if ($.fn.mousewheel && current.mouseWheel) { 717 | F.wrap.bind('mousewheel.fb', function (e, delta, deltaX, deltaY) { 718 | var target = e.target || null, 719 | parent = $(target), 720 | canScroll = false; 721 | 722 | while (parent.length) { 723 | if (canScroll || parent.is('.fancybox-skin') || parent.is('.fancybox-wrap')) { 724 | break; 725 | } 726 | 727 | canScroll = isScrollable( parent[0] ); 728 | parent = $(parent).parent(); 729 | } 730 | 731 | if (delta !== 0 && !canScroll) { 732 | if (F.group.length > 1 && !current.canShrink) { 733 | if (deltaY > 0 || deltaX > 0) { 734 | F.prev( deltaY > 0 ? 'down' : 'left' ); 735 | 736 | } else if (deltaY < 0 || deltaX < 0) { 737 | F.next( deltaY < 0 ? 'up' : 'right' ); 738 | } 739 | 740 | e.preventDefault(); 741 | } 742 | } 743 | }); 744 | } 745 | }, 746 | 747 | trigger: function (event, o) { 748 | var ret, obj = o || F.coming || F.current; 749 | 750 | if (obj) { 751 | if ($.isFunction( obj[event] )) { 752 | ret = obj[event].apply(obj, Array.prototype.slice.call(arguments, 1)); 753 | } 754 | 755 | if (ret === false) { 756 | return false; 757 | } 758 | 759 | if (obj.helpers) { 760 | $.each(obj.helpers, function (helper, opts) { 761 | if (opts && F.helpers[helper] && $.isFunction(F.helpers[helper][event])) { 762 | F.helpers[helper][event]($.extend(true, {}, F.helpers[helper].defaults, opts), obj); 763 | } 764 | }); 765 | } 766 | } 767 | 768 | D.trigger(event); 769 | }, 770 | 771 | isImage: function (str) { 772 | return isString(str) && str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i); 773 | }, 774 | 775 | isSWF: function (str) { 776 | return isString(str) && str.match(/\.(swf)((\?|#).*)?$/i); 777 | }, 778 | 779 | _start: function (index) { 780 | var coming = {}, 781 | obj, 782 | href, 783 | type, 784 | margin, 785 | padding; 786 | 787 | index = getScalar( index ); 788 | obj = F.group[ index ] || null; 789 | 790 | if (!obj) { 791 | return false; 792 | } 793 | 794 | coming = $.extend(true, {}, F.opts, obj); 795 | 796 | // Convert margin and padding properties to array - top, right, bottom, left 797 | margin = coming.margin; 798 | padding = coming.padding; 799 | 800 | if ($.type(margin) === 'number') { 801 | coming.margin = [margin, margin, margin, margin]; 802 | } 803 | 804 | if ($.type(padding) === 'number') { 805 | coming.padding = [padding, padding, padding, padding]; 806 | } 807 | 808 | // 'modal' propery is just a shortcut 809 | if (coming.modal) { 810 | $.extend(true, coming, { 811 | closeBtn : false, 812 | closeClick : false, 813 | nextClick : false, 814 | arrows : false, 815 | mouseWheel : false, 816 | keys : null, 817 | helpers: { 818 | overlay : { 819 | closeClick : false 820 | } 821 | } 822 | }); 823 | } 824 | 825 | // 'autoSize' property is a shortcut, too 826 | if (coming.autoSize) { 827 | coming.autoWidth = coming.autoHeight = true; 828 | } 829 | 830 | if (coming.width === 'auto') { 831 | coming.autoWidth = true; 832 | } 833 | 834 | if (coming.height === 'auto') { 835 | coming.autoHeight = true; 836 | } 837 | 838 | /* 839 | * Add reference to the group, so it`s possible to access from callbacks, example: 840 | * afterLoad : function() { 841 | * this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); 842 | * } 843 | */ 844 | 845 | coming.group = F.group; 846 | coming.index = index; 847 | 848 | // Give a chance for callback or helpers to update coming item (type, title, etc) 849 | F.coming = coming; 850 | 851 | if (false === F.trigger('beforeLoad')) { 852 | F.coming = null; 853 | 854 | return; 855 | } 856 | 857 | type = coming.type; 858 | href = coming.href; 859 | 860 | if (!type) { 861 | F.coming = null; 862 | 863 | //If we can not determine content type then drop silently or display next/prev item if looping through gallery 864 | if (F.current && F.router && F.router !== 'jumpto') { 865 | F.current.index = index; 866 | 867 | return F[ F.router ]( F.direction ); 868 | } 869 | 870 | return false; 871 | } 872 | 873 | F.isActive = true; 874 | 875 | if (type === 'image' || type === 'swf') { 876 | coming.autoHeight = coming.autoWidth = false; 877 | coming.scrolling = 'visible'; 878 | } 879 | 880 | if (type === 'image') { 881 | coming.aspectRatio = true; 882 | } 883 | 884 | if (type === 'iframe' && isTouch) { 885 | coming.scrolling = 'scroll'; 886 | } 887 | 888 | // Build the neccessary markup 889 | coming.wrap = $(coming.tpl.wrap).addClass('fancybox-' + (isTouch ? 'mobile' : 'desktop') + ' fancybox-type-' + type + ' fancybox-tmp ' + coming.wrapCSS).appendTo( coming.parent || 'body' ); 890 | 891 | $.extend(coming, { 892 | skin : $('.fancybox-skin', coming.wrap), 893 | outer : $('.fancybox-outer', coming.wrap), 894 | inner : $('.fancybox-inner', coming.wrap) 895 | }); 896 | 897 | $.each(["Top", "Right", "Bottom", "Left"], function(i, v) { 898 | coming.skin.css('padding' + v, getValue(coming.padding[ i ])); 899 | }); 900 | 901 | F.trigger('onReady'); 902 | 903 | // Check before try to load; 'inline' and 'html' types need content, others - href 904 | if (type === 'inline' || type === 'html') { 905 | if (!coming.content || !coming.content.length) { 906 | return F._error( 'content' ); 907 | } 908 | 909 | } else if (!href) { 910 | return F._error( 'href' ); 911 | } 912 | 913 | if (type === 'image') { 914 | F._loadImage(); 915 | 916 | } else if (type === 'ajax') { 917 | F._loadAjax(); 918 | 919 | } else if (type === 'iframe') { 920 | F._loadIframe(); 921 | 922 | } else { 923 | F._afterLoad(); 924 | } 925 | }, 926 | 927 | _error: function ( type ) { 928 | $.extend(F.coming, { 929 | type : 'html', 930 | autoWidth : true, 931 | autoHeight : true, 932 | minWidth : 0, 933 | minHeight : 0, 934 | scrolling : 'no', 935 | hasError : type, 936 | content : F.coming.tpl.error 937 | }); 938 | 939 | F._afterLoad(); 940 | }, 941 | 942 | _loadImage: function () { 943 | // Reset preload image so it is later possible to check "complete" property 944 | var img = F.imgPreload = new Image(); 945 | 946 | img.onload = function () { 947 | this.onload = this.onerror = null; 948 | 949 | F.coming.width = this.width / F.opts.pixelRatio; 950 | F.coming.height = this.height / F.opts.pixelRatio; 951 | 952 | F._afterLoad(); 953 | }; 954 | 955 | img.onerror = function () { 956 | this.onload = this.onerror = null; 957 | 958 | F._error( 'image' ); 959 | }; 960 | 961 | img.src = F.coming.href; 962 | 963 | if (img.complete !== true) { 964 | F.showLoading(); 965 | } 966 | }, 967 | 968 | _loadAjax: function () { 969 | var coming = F.coming; 970 | 971 | F.showLoading(); 972 | 973 | F.ajaxLoad = $.ajax($.extend({}, coming.ajax, { 974 | url: coming.href, 975 | error: function (jqXHR, textStatus) { 976 | if (F.coming && textStatus !== 'abort') { 977 | F._error( 'ajax', jqXHR ); 978 | 979 | } else { 980 | F.hideLoading(); 981 | } 982 | }, 983 | success: function (data, textStatus) { 984 | if (textStatus === 'success') { 985 | coming.content = data; 986 | 987 | F._afterLoad(); 988 | } 989 | } 990 | })); 991 | }, 992 | 993 | _loadIframe: function() { 994 | var coming = F.coming, 995 | iframe = $(coming.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime())) 996 | .attr('scrolling', isTouch ? 'auto' : coming.iframe.scrolling) 997 | .attr('src', coming.href); 998 | 999 | // This helps IE 1000 | $(coming.wrap).bind('onReset', function () { 1001 | try { 1002 | $(this).find('iframe').hide().attr('src', '//about:blank').end().empty(); 1003 | } catch (e) {} 1004 | }); 1005 | 1006 | if (coming.iframe.preload) { 1007 | F.showLoading(); 1008 | 1009 | iframe.one('load', function() { 1010 | $(this).data('ready', 1); 1011 | 1012 | // iOS will lose scrolling if we resize 1013 | if (!isTouch) { 1014 | $(this).bind('load.fb', F.update); 1015 | } 1016 | 1017 | // Without this trick: 1018 | // - iframe won't scroll on iOS devices 1019 | // - IE7 sometimes displays empty iframe 1020 | $(this).parents('.fancybox-wrap').width('100%').removeClass('fancybox-tmp').show(); 1021 | 1022 | F._afterLoad(); 1023 | }); 1024 | } 1025 | 1026 | coming.content = iframe.appendTo( coming.inner ); 1027 | 1028 | if (!coming.iframe.preload) { 1029 | F._afterLoad(); 1030 | } 1031 | }, 1032 | 1033 | _preloadImages: function() { 1034 | var group = F.group, 1035 | current = F.current, 1036 | len = group.length, 1037 | cnt = current.preload ? Math.min(current.preload, len - 1) : 0, 1038 | item, 1039 | i; 1040 | 1041 | for (i = 1; i <= cnt; i += 1) { 1042 | item = group[ (current.index + i ) % len ]; 1043 | 1044 | if (item.type === 'image' && item.href) { 1045 | new Image().src = item.href; 1046 | } 1047 | } 1048 | }, 1049 | 1050 | _afterLoad: function () { 1051 | var coming = F.coming, 1052 | previous = F.current, 1053 | placeholder = 'fancybox-placeholder', 1054 | current, 1055 | content, 1056 | type, 1057 | scrolling, 1058 | href, 1059 | embed; 1060 | 1061 | F.hideLoading(); 1062 | 1063 | if (!coming || F.isActive === false) { 1064 | return; 1065 | } 1066 | 1067 | if (false === F.trigger('afterLoad', coming, previous)) { 1068 | coming.wrap.stop(true).trigger('onReset').remove(); 1069 | 1070 | F.coming = null; 1071 | 1072 | return; 1073 | } 1074 | 1075 | if (previous) { 1076 | F.trigger('beforeChange', previous); 1077 | 1078 | previous.wrap.stop(true).removeClass('fancybox-opened') 1079 | .find('.fancybox-item, .fancybox-nav') 1080 | .remove(); 1081 | } 1082 | 1083 | F.unbindEvents(); 1084 | 1085 | current = coming; 1086 | content = coming.content; 1087 | type = coming.type; 1088 | scrolling = coming.scrolling; 1089 | 1090 | $.extend(F, { 1091 | wrap : current.wrap, 1092 | skin : current.skin, 1093 | outer : current.outer, 1094 | inner : current.inner, 1095 | current : current, 1096 | previous : previous 1097 | }); 1098 | 1099 | href = current.href; 1100 | 1101 | switch (type) { 1102 | case 'inline': 1103 | case 'ajax': 1104 | case 'html': 1105 | if (current.selector) { 1106 | content = $('
    ').html(content).find(current.selector); 1107 | 1108 | } else if (isQuery(content)) { 1109 | if (!content.data(placeholder)) { 1110 | content.data(placeholder, $('
    ').insertAfter( content ).hide() ); 1111 | } 1112 | 1113 | content = content.show().detach(); 1114 | 1115 | current.wrap.bind('onReset', function () { 1116 | if ($(this).find(content).length) { 1117 | content.hide().replaceAll( content.data(placeholder) ).data(placeholder, false); 1118 | } 1119 | }); 1120 | } 1121 | break; 1122 | 1123 | case 'image': 1124 | content = current.tpl.image.replace(/\{href\}/g, href); 1125 | break; 1126 | 1127 | case 'swf': 1128 | content = ''; 1129 | embed = ''; 1130 | 1131 | $.each(current.swf, function(name, val) { 1132 | content += ''; 1133 | embed += ' ' + name + '="' + val + '"'; 1134 | }); 1135 | 1136 | content += ''; 1137 | break; 1138 | } 1139 | 1140 | if (!(isQuery(content) && content.parent().is(current.inner))) { 1141 | current.inner.append( content ); 1142 | } 1143 | 1144 | // Give a chance for helpers or callbacks to update elements 1145 | F.trigger('beforeShow'); 1146 | 1147 | // Set scrolling before calculating dimensions 1148 | current.inner.css('overflow', scrolling === 'yes' ? 'scroll' : (scrolling === 'no' ? 'hidden' : scrolling)); 1149 | 1150 | // Set initial dimensions and start position 1151 | F._setDimension(); 1152 | 1153 | F.reposition(); 1154 | 1155 | F.isOpen = false; 1156 | F.coming = null; 1157 | 1158 | F.bindEvents(); 1159 | 1160 | if (!F.isOpened) { 1161 | $('.fancybox-wrap').not( current.wrap ).stop(true).trigger('onReset').remove(); 1162 | 1163 | } else if (previous.prevMethod) { 1164 | F.transitions[ previous.prevMethod ](); 1165 | } 1166 | 1167 | F.transitions[ F.isOpened ? current.nextMethod : current.openMethod ](); 1168 | 1169 | F._preloadImages(); 1170 | }, 1171 | 1172 | _setDimension: function () { 1173 | var viewport = F.getViewport(), 1174 | steps = 0, 1175 | canShrink = false, 1176 | canExpand = false, 1177 | wrap = F.wrap, 1178 | skin = F.skin, 1179 | inner = F.inner, 1180 | current = F.current, 1181 | width = current.width, 1182 | height = current.height, 1183 | minWidth = current.minWidth, 1184 | minHeight = current.minHeight, 1185 | maxWidth = current.maxWidth, 1186 | maxHeight = current.maxHeight, 1187 | scrolling = current.scrolling, 1188 | scrollOut = current.scrollOutside ? current.scrollbarWidth : 0, 1189 | margin = current.margin, 1190 | wMargin = getScalar(margin[1] + margin[3]), 1191 | hMargin = getScalar(margin[0] + margin[2]), 1192 | wPadding, 1193 | hPadding, 1194 | wSpace, 1195 | hSpace, 1196 | origWidth, 1197 | origHeight, 1198 | origMaxWidth, 1199 | origMaxHeight, 1200 | ratio, 1201 | width_, 1202 | height_, 1203 | maxWidth_, 1204 | maxHeight_, 1205 | iframe, 1206 | body; 1207 | 1208 | // Reset dimensions so we could re-check actual size 1209 | wrap.add(skin).add(inner).width('auto').height('auto').removeClass('fancybox-tmp'); 1210 | 1211 | wPadding = getScalar(skin.outerWidth(true) - skin.width()); 1212 | hPadding = getScalar(skin.outerHeight(true) - skin.height()); 1213 | 1214 | // Any space between content and viewport (margin, padding, border, title) 1215 | wSpace = wMargin + wPadding; 1216 | hSpace = hMargin + hPadding; 1217 | 1218 | origWidth = isPercentage(width) ? (viewport.w - wSpace) * getScalar(width) / 100 : width; 1219 | origHeight = isPercentage(height) ? (viewport.h - hSpace) * getScalar(height) / 100 : height; 1220 | 1221 | if (current.type === 'iframe') { 1222 | iframe = current.content; 1223 | 1224 | if (current.autoHeight && iframe.data('ready') === 1) { 1225 | try { 1226 | if (iframe[0].contentWindow.document.location) { 1227 | inner.width( origWidth ).height(9999); 1228 | 1229 | body = iframe.contents().find('body'); 1230 | 1231 | if (scrollOut) { 1232 | body.css('overflow-x', 'hidden'); 1233 | } 1234 | 1235 | origHeight = body.outerHeight(true); 1236 | } 1237 | 1238 | } catch (e) {} 1239 | } 1240 | 1241 | } else if (current.autoWidth || current.autoHeight) { 1242 | inner.addClass( 'fancybox-tmp' ); 1243 | 1244 | // Set width or height in case we need to calculate only one dimension 1245 | if (!current.autoWidth) { 1246 | inner.width( origWidth ); 1247 | } 1248 | 1249 | if (!current.autoHeight) { 1250 | inner.height( origHeight ); 1251 | } 1252 | 1253 | if (current.autoWidth) { 1254 | origWidth = inner.width(); 1255 | } 1256 | 1257 | if (current.autoHeight) { 1258 | origHeight = inner.height(); 1259 | } 1260 | 1261 | inner.removeClass( 'fancybox-tmp' ); 1262 | } 1263 | 1264 | width = getScalar( origWidth ); 1265 | height = getScalar( origHeight ); 1266 | 1267 | ratio = origWidth / origHeight; 1268 | 1269 | // Calculations for the content 1270 | minWidth = getScalar(isPercentage(minWidth) ? getScalar(minWidth, 'w') - wSpace : minWidth); 1271 | maxWidth = getScalar(isPercentage(maxWidth) ? getScalar(maxWidth, 'w') - wSpace : maxWidth); 1272 | 1273 | minHeight = getScalar(isPercentage(minHeight) ? getScalar(minHeight, 'h') - hSpace : minHeight); 1274 | maxHeight = getScalar(isPercentage(maxHeight) ? getScalar(maxHeight, 'h') - hSpace : maxHeight); 1275 | 1276 | // These will be used to determine if wrap can fit in the viewport 1277 | origMaxWidth = maxWidth; 1278 | origMaxHeight = maxHeight; 1279 | 1280 | if (current.fitToView) { 1281 | maxWidth = Math.min(viewport.w - wSpace, maxWidth); 1282 | maxHeight = Math.min(viewport.h - hSpace, maxHeight); 1283 | } 1284 | 1285 | maxWidth_ = viewport.w - wMargin; 1286 | maxHeight_ = viewport.h - hMargin; 1287 | 1288 | if (current.aspectRatio) { 1289 | if (width > maxWidth) { 1290 | width = maxWidth; 1291 | height = getScalar(width / ratio); 1292 | } 1293 | 1294 | if (height > maxHeight) { 1295 | height = maxHeight; 1296 | width = getScalar(height * ratio); 1297 | } 1298 | 1299 | if (width < minWidth) { 1300 | width = minWidth; 1301 | height = getScalar(width / ratio); 1302 | } 1303 | 1304 | if (height < minHeight) { 1305 | height = minHeight; 1306 | width = getScalar(height * ratio); 1307 | } 1308 | 1309 | } else { 1310 | width = Math.max(minWidth, Math.min(width, maxWidth)); 1311 | 1312 | if (current.autoHeight && current.type !== 'iframe') { 1313 | inner.width( width ); 1314 | 1315 | height = inner.height(); 1316 | } 1317 | 1318 | height = Math.max(minHeight, Math.min(height, maxHeight)); 1319 | } 1320 | 1321 | // Try to fit inside viewport (including the title) 1322 | if (current.fitToView) { 1323 | inner.width( width ).height( height ); 1324 | 1325 | wrap.width( width + wPadding ); 1326 | 1327 | // Real wrap dimensions 1328 | width_ = wrap.width(); 1329 | height_ = wrap.height(); 1330 | 1331 | if (current.aspectRatio) { 1332 | while ((width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight) { 1333 | if (steps++ > 19) { 1334 | break; 1335 | } 1336 | 1337 | height = Math.max(minHeight, Math.min(maxHeight, height - 10)); 1338 | width = getScalar(height * ratio); 1339 | 1340 | if (width < minWidth) { 1341 | width = minWidth; 1342 | height = getScalar(width / ratio); 1343 | } 1344 | 1345 | if (width > maxWidth) { 1346 | width = maxWidth; 1347 | height = getScalar(width / ratio); 1348 | } 1349 | 1350 | inner.width( width ).height( height ); 1351 | 1352 | wrap.width( width + wPadding ); 1353 | 1354 | width_ = wrap.width(); 1355 | height_ = wrap.height(); 1356 | } 1357 | 1358 | } else { 1359 | width = Math.max(minWidth, Math.min(width, width - (width_ - maxWidth_))); 1360 | height = Math.max(minHeight, Math.min(height, height - (height_ - maxHeight_))); 1361 | } 1362 | } 1363 | 1364 | if (scrollOut && scrolling === 'auto' && height < origHeight && (width + wPadding + scrollOut) < maxWidth_) { 1365 | width += scrollOut; 1366 | } 1367 | 1368 | inner.width( width ).height( height ); 1369 | 1370 | wrap.width( width + wPadding ); 1371 | 1372 | width_ = wrap.width(); 1373 | height_ = wrap.height(); 1374 | 1375 | canShrink = (width_ > maxWidth_ || height_ > maxHeight_) && width > minWidth && height > minHeight; 1376 | canExpand = current.aspectRatio ? (width < origMaxWidth && height < origMaxHeight && width < origWidth && height < origHeight) : ((width < origMaxWidth || height < origMaxHeight) && (width < origWidth || height < origHeight)); 1377 | 1378 | $.extend(current, { 1379 | dim : { 1380 | width : getValue( width_ ), 1381 | height : getValue( height_ ) 1382 | }, 1383 | origWidth : origWidth, 1384 | origHeight : origHeight, 1385 | canShrink : canShrink, 1386 | canExpand : canExpand, 1387 | wPadding : wPadding, 1388 | hPadding : hPadding, 1389 | wrapSpace : height_ - skin.outerHeight(true), 1390 | skinSpace : skin.height() - height 1391 | }); 1392 | 1393 | if (!iframe && current.autoHeight && height > minHeight && height < maxHeight && !canExpand) { 1394 | inner.height('auto'); 1395 | } 1396 | }, 1397 | 1398 | _getPosition: function (onlyAbsolute) { 1399 | var current = F.current, 1400 | viewport = F.getViewport(), 1401 | margin = current.margin, 1402 | width = F.wrap.width() + margin[1] + margin[3], 1403 | height = F.wrap.height() + margin[0] + margin[2], 1404 | rez = { 1405 | position: 'absolute', 1406 | top : margin[0], 1407 | left : margin[3] 1408 | }; 1409 | 1410 | if (current.autoCenter && current.fixed && !onlyAbsolute && height <= viewport.h && width <= viewport.w) { 1411 | rez.position = 'fixed'; 1412 | 1413 | } else if (!current.locked) { 1414 | rez.top += viewport.y; 1415 | rez.left += viewport.x; 1416 | } 1417 | 1418 | rez.top = getValue(Math.max(rez.top, rez.top + ((viewport.h - height) * current.topRatio))); 1419 | rez.left = getValue(Math.max(rez.left, rez.left + ((viewport.w - width) * current.leftRatio))); 1420 | 1421 | return rez; 1422 | }, 1423 | 1424 | _afterZoomIn: function () { 1425 | var current = F.current; 1426 | 1427 | if (!current) { 1428 | return; 1429 | } 1430 | 1431 | F.isOpen = F.isOpened = true; 1432 | 1433 | F.wrap.css('overflow', 'visible').addClass('fancybox-opened').hide().show(0); 1434 | 1435 | F.update(); 1436 | 1437 | // Assign a click event 1438 | if ( current.closeClick || (current.nextClick && F.group.length > 1) ) { 1439 | F.inner.css('cursor', 'pointer').bind('click.fb', function(e) { 1440 | if (!$(e.target).is('a') && !$(e.target).parent().is('a')) { 1441 | e.preventDefault(); 1442 | 1443 | F[ current.closeClick ? 'close' : 'next' ](); 1444 | } 1445 | }); 1446 | } 1447 | 1448 | // Create a close button 1449 | if (current.closeBtn) { 1450 | $(current.tpl.closeBtn).appendTo(F.skin).bind('click.fb', function(e) { 1451 | e.preventDefault(); 1452 | 1453 | F.close(); 1454 | }); 1455 | } 1456 | 1457 | // Create navigation arrows 1458 | if (current.arrows && F.group.length > 1) { 1459 | if (current.loop || current.index > 0) { 1460 | $(current.tpl.prev).appendTo(F.outer).bind('click.fb', F.prev); 1461 | } 1462 | 1463 | if (current.loop || current.index < F.group.length - 1) { 1464 | $(current.tpl.next).appendTo(F.outer).bind('click.fb', F.next); 1465 | } 1466 | } 1467 | 1468 | F.trigger('afterShow'); 1469 | 1470 | // Stop the slideshow if this is the last item 1471 | if (!current.loop && current.index === current.group.length - 1) { 1472 | 1473 | F.play( false ); 1474 | 1475 | } else if (F.opts.autoPlay && !F.player.isActive) { 1476 | F.opts.autoPlay = false; 1477 | 1478 | F.play(true); 1479 | } 1480 | }, 1481 | 1482 | _afterZoomOut: function ( obj ) { 1483 | obj = obj || F.current; 1484 | 1485 | $('.fancybox-wrap').trigger('onReset').remove(); 1486 | 1487 | $.extend(F, { 1488 | group : {}, 1489 | opts : {}, 1490 | router : false, 1491 | current : null, 1492 | isActive : false, 1493 | isOpened : false, 1494 | isOpen : false, 1495 | isClosing : false, 1496 | wrap : null, 1497 | skin : null, 1498 | outer : null, 1499 | inner : null 1500 | }); 1501 | 1502 | F.trigger('afterClose', obj); 1503 | } 1504 | }); 1505 | 1506 | /* 1507 | * Default transitions 1508 | */ 1509 | 1510 | F.transitions = { 1511 | getOrigPosition: function () { 1512 | var current = F.current, 1513 | element = current.element, 1514 | orig = current.orig, 1515 | pos = {}, 1516 | width = 50, 1517 | height = 50, 1518 | hPadding = current.hPadding, 1519 | wPadding = current.wPadding, 1520 | viewport = F.getViewport(); 1521 | 1522 | if (!orig && current.isDom && element.is(':visible')) { 1523 | orig = element.find('img:first'); 1524 | 1525 | if (!orig.length) { 1526 | orig = element; 1527 | } 1528 | } 1529 | 1530 | if (isQuery(orig)) { 1531 | pos = orig.offset(); 1532 | 1533 | if (orig.is('img')) { 1534 | width = orig.outerWidth(); 1535 | height = orig.outerHeight(); 1536 | } 1537 | 1538 | } else { 1539 | pos.top = viewport.y + (viewport.h - height) * current.topRatio; 1540 | pos.left = viewport.x + (viewport.w - width) * current.leftRatio; 1541 | } 1542 | 1543 | if (F.wrap.css('position') === 'fixed' || current.locked) { 1544 | pos.top -= viewport.y; 1545 | pos.left -= viewport.x; 1546 | } 1547 | 1548 | pos = { 1549 | top : getValue(pos.top - hPadding * current.topRatio), 1550 | left : getValue(pos.left - wPadding * current.leftRatio), 1551 | width : getValue(width + wPadding), 1552 | height : getValue(height + hPadding) 1553 | }; 1554 | 1555 | return pos; 1556 | }, 1557 | 1558 | step: function (now, fx) { 1559 | var ratio, 1560 | padding, 1561 | value, 1562 | prop = fx.prop, 1563 | current = F.current, 1564 | wrapSpace = current.wrapSpace, 1565 | skinSpace = current.skinSpace; 1566 | 1567 | if (prop === 'width' || prop === 'height') { 1568 | ratio = fx.end === fx.start ? 1 : (now - fx.start) / (fx.end - fx.start); 1569 | 1570 | if (F.isClosing) { 1571 | ratio = 1 - ratio; 1572 | } 1573 | 1574 | padding = prop === 'width' ? current.wPadding : current.hPadding; 1575 | value = now - padding; 1576 | 1577 | F.skin[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) ) ); 1578 | F.inner[ prop ]( getScalar( prop === 'width' ? value : value - (wrapSpace * ratio) - (skinSpace * ratio) ) ); 1579 | } 1580 | }, 1581 | 1582 | zoomIn: function () { 1583 | var current = F.current, 1584 | startPos = current.pos, 1585 | effect = current.openEffect, 1586 | elastic = effect === 'elastic', 1587 | endPos = $.extend({opacity : 1}, startPos); 1588 | 1589 | // Remove "position" property that breaks older IE 1590 | delete endPos.position; 1591 | 1592 | if (elastic) { 1593 | startPos = this.getOrigPosition(); 1594 | 1595 | if (current.openOpacity) { 1596 | startPos.opacity = 0.1; 1597 | } 1598 | 1599 | } else if (effect === 'fade') { 1600 | startPos.opacity = 0.1; 1601 | } 1602 | 1603 | F.wrap.css(startPos).animate(endPos, { 1604 | duration : effect === 'none' ? 0 : current.openSpeed, 1605 | easing : current.openEasing, 1606 | step : elastic ? this.step : null, 1607 | complete : F._afterZoomIn 1608 | }); 1609 | }, 1610 | 1611 | zoomOut: function () { 1612 | var current = F.current, 1613 | effect = current.closeEffect, 1614 | elastic = effect === 'elastic', 1615 | endPos = {opacity : 0.1}; 1616 | 1617 | if (elastic) { 1618 | endPos = this.getOrigPosition(); 1619 | 1620 | if (current.closeOpacity) { 1621 | endPos.opacity = 0.1; 1622 | } 1623 | } 1624 | 1625 | F.wrap.animate(endPos, { 1626 | duration : effect === 'none' ? 0 : current.closeSpeed, 1627 | easing : current.closeEasing, 1628 | step : elastic ? this.step : null, 1629 | complete : F._afterZoomOut 1630 | }); 1631 | }, 1632 | 1633 | changeIn: function () { 1634 | var current = F.current, 1635 | effect = current.nextEffect, 1636 | startPos = current.pos, 1637 | endPos = { opacity : 1 }, 1638 | direction = F.direction, 1639 | distance = 200, 1640 | field; 1641 | 1642 | startPos.opacity = 0.1; 1643 | 1644 | if (effect === 'elastic') { 1645 | field = direction === 'down' || direction === 'up' ? 'top' : 'left'; 1646 | 1647 | if (direction === 'down' || direction === 'right') { 1648 | startPos[ field ] = getValue(getScalar(startPos[ field ]) - distance); 1649 | endPos[ field ] = '+=' + distance + 'px'; 1650 | 1651 | } else { 1652 | startPos[ field ] = getValue(getScalar(startPos[ field ]) + distance); 1653 | endPos[ field ] = '-=' + distance + 'px'; 1654 | } 1655 | } 1656 | 1657 | // Workaround for http://bugs.jquery.com/ticket/12273 1658 | if (effect === 'none') { 1659 | F._afterZoomIn(); 1660 | 1661 | } else { 1662 | F.wrap.css(startPos).animate(endPos, { 1663 | duration : current.nextSpeed, 1664 | easing : current.nextEasing, 1665 | complete : F._afterZoomIn 1666 | }); 1667 | } 1668 | }, 1669 | 1670 | changeOut: function () { 1671 | var previous = F.previous, 1672 | effect = previous.prevEffect, 1673 | endPos = { opacity : 0.1 }, 1674 | direction = F.direction, 1675 | distance = 200; 1676 | 1677 | if (effect === 'elastic') { 1678 | endPos[ direction === 'down' || direction === 'up' ? 'top' : 'left' ] = ( direction === 'up' || direction === 'left' ? '-' : '+' ) + '=' + distance + 'px'; 1679 | } 1680 | 1681 | previous.wrap.animate(endPos, { 1682 | duration : effect === 'none' ? 0 : previous.prevSpeed, 1683 | easing : previous.prevEasing, 1684 | complete : function () { 1685 | $(this).trigger('onReset').remove(); 1686 | } 1687 | }); 1688 | } 1689 | }; 1690 | 1691 | /* 1692 | * Overlay helper 1693 | */ 1694 | 1695 | F.helpers.overlay = { 1696 | defaults : { 1697 | closeClick : true, // if true, fancyBox will be closed when user clicks on the overlay 1698 | speedOut : 200, // duration of fadeOut animation 1699 | showEarly : true, // indicates if should be opened immediately or wait until the content is ready 1700 | css : {}, // custom CSS properties 1701 | locked : !isTouch, // if true, the content will be locked into overlay 1702 | fixed : true // if false, the overlay CSS position property will not be set to "fixed" 1703 | }, 1704 | 1705 | overlay : null, // current handle 1706 | fixed : false, // indicates if the overlay has position "fixed" 1707 | el : $('html'), // element that contains "the lock" 1708 | 1709 | // Public methods 1710 | create : function(opts) { 1711 | var parent; 1712 | 1713 | opts = $.extend({}, this.defaults, opts); 1714 | 1715 | if (this.overlay) { 1716 | this.close(); 1717 | } 1718 | 1719 | parent = F.coming ? F.coming.parent : opts.parent; 1720 | 1721 | this.overlay = $('
    ').appendTo( parent && parent.lenth ? parent : 'body' ); 1722 | this.fixed = false; 1723 | 1724 | if (opts.fixed && F.defaults.fixed) { 1725 | this.overlay.addClass('fancybox-overlay-fixed'); 1726 | 1727 | this.fixed = true; 1728 | } 1729 | }, 1730 | 1731 | open : function(opts) { 1732 | var that = this; 1733 | 1734 | opts = $.extend({}, this.defaults, opts); 1735 | 1736 | if (this.overlay) { 1737 | this.overlay.unbind('.overlay').width('auto').height('auto'); 1738 | 1739 | } else { 1740 | this.create(opts); 1741 | } 1742 | 1743 | if (!this.fixed) { 1744 | W.bind('resize.overlay', $.proxy( this.update, this) ); 1745 | 1746 | this.update(); 1747 | } 1748 | 1749 | if (opts.closeClick) { 1750 | this.overlay.bind('click.overlay', function(e) { 1751 | if ($(e.target).hasClass('fancybox-overlay')) { 1752 | if (F.isActive) { 1753 | F.close(); 1754 | } else { 1755 | that.close(); 1756 | } 1757 | 1758 | return false; 1759 | } 1760 | }); 1761 | } 1762 | 1763 | this.overlay.css( opts.css ).show(); 1764 | }, 1765 | 1766 | close : function() { 1767 | W.unbind('resize.overlay'); 1768 | 1769 | if (this.el.hasClass('fancybox-lock')) { 1770 | $('.fancybox-margin').removeClass('fancybox-margin'); 1771 | 1772 | this.el.removeClass('fancybox-lock'); 1773 | 1774 | W.scrollTop( this.scrollV ).scrollLeft( this.scrollH ); 1775 | } 1776 | 1777 | $('.fancybox-overlay').remove().hide(); 1778 | 1779 | $.extend(this, { 1780 | overlay : null, 1781 | fixed : false 1782 | }); 1783 | }, 1784 | 1785 | // Private, callbacks 1786 | 1787 | update : function () { 1788 | var width = '100%', offsetWidth; 1789 | 1790 | // Reset width/height so it will not mess 1791 | this.overlay.width(width).height('100%'); 1792 | 1793 | // jQuery does not return reliable result for IE 1794 | if (IE) { 1795 | offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth); 1796 | 1797 | if (D.width() > offsetWidth) { 1798 | width = D.width(); 1799 | } 1800 | 1801 | } else if (D.width() > W.width()) { 1802 | width = D.width(); 1803 | } 1804 | 1805 | this.overlay.width(width).height(D.height()); 1806 | }, 1807 | 1808 | // This is where we can manipulate DOM, because later it would cause iframes to reload 1809 | onReady : function (opts, obj) { 1810 | var overlay = this.overlay; 1811 | 1812 | $('.fancybox-overlay').stop(true, true); 1813 | 1814 | if (!overlay) { 1815 | this.create(opts); 1816 | } 1817 | 1818 | if (opts.locked && this.fixed && obj.fixed) { 1819 | obj.locked = this.overlay.append( obj.wrap ); 1820 | obj.fixed = false; 1821 | } 1822 | 1823 | if (opts.showEarly === true) { 1824 | this.beforeShow.apply(this, arguments); 1825 | } 1826 | }, 1827 | 1828 | beforeShow : function(opts, obj) { 1829 | if (obj.locked && !this.el.hasClass('fancybox-lock')) { 1830 | if (this.fixPosition !== false) { 1831 | $('*').filter(function(){ 1832 | return ($(this).css('position') === 'fixed' && !$(this).hasClass("fancybox-overlay") && !$(this).hasClass("fancybox-wrap") ); 1833 | }).addClass('fancybox-margin'); 1834 | } 1835 | 1836 | this.el.addClass('fancybox-margin'); 1837 | 1838 | this.scrollV = W.scrollTop(); 1839 | this.scrollH = W.scrollLeft(); 1840 | 1841 | this.el.addClass('fancybox-lock'); 1842 | 1843 | W.scrollTop( this.scrollV ).scrollLeft( this.scrollH ); 1844 | } 1845 | 1846 | this.open(opts); 1847 | }, 1848 | 1849 | onUpdate : function() { 1850 | if (!this.fixed) { 1851 | this.update(); 1852 | } 1853 | }, 1854 | 1855 | afterClose: function (opts) { 1856 | // Remove overlay if exists and fancyBox is not opening 1857 | // (e.g., it is not being open using afterClose callback) 1858 | if (this.overlay && !F.coming) { 1859 | this.overlay.fadeOut(opts.speedOut, $.proxy( this.close, this )); 1860 | } 1861 | } 1862 | }; 1863 | 1864 | /* 1865 | * Title helper 1866 | */ 1867 | 1868 | F.helpers.title = { 1869 | defaults : { 1870 | type : 'float', // 'float', 'inside', 'outside' or 'over', 1871 | position : 'bottom' // 'top' or 'bottom' 1872 | }, 1873 | 1874 | beforeShow: function (opts) { 1875 | var current = F.current, 1876 | text = current.title, 1877 | type = opts.type, 1878 | title, 1879 | target; 1880 | 1881 | if ($.isFunction(text)) { 1882 | text = text.call(current.element, current); 1883 | } 1884 | 1885 | if (!isString(text) || $.trim(text) === '') { 1886 | return; 1887 | } 1888 | 1889 | title = $('
    ' + text + '
    '); 1890 | 1891 | switch (type) { 1892 | case 'inside': 1893 | target = F.skin; 1894 | break; 1895 | 1896 | case 'outside': 1897 | target = F.wrap; 1898 | break; 1899 | 1900 | case 'over': 1901 | target = F.inner; 1902 | break; 1903 | 1904 | default: // 'float' 1905 | target = F.skin; 1906 | 1907 | title.appendTo('body'); 1908 | 1909 | if (IE) { 1910 | title.width( title.width() ); 1911 | } 1912 | 1913 | title.wrapInner(''); 1914 | 1915 | //Increase bottom margin so this title will also fit into viewport 1916 | F.current.margin[2] += Math.abs( getScalar(title.css('margin-bottom')) ); 1917 | break; 1918 | } 1919 | 1920 | title[ (opts.position === 'top' ? 'prependTo' : 'appendTo') ](target); 1921 | } 1922 | }; 1923 | 1924 | // jQuery plugin initialization 1925 | $.fn.fancybox = function (options) { 1926 | var index, 1927 | that = $(this), 1928 | selector = this.selector || '', 1929 | run = function(e) { 1930 | var what = $(this).blur(), idx = index, relType, relVal; 1931 | 1932 | if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) { 1933 | relType = options.groupAttr || 'data-fancybox-group'; 1934 | relVal = what.attr(relType); 1935 | 1936 | if (!relVal) { 1937 | relType = 'rel'; 1938 | relVal = what.get(0)[ relType ]; 1939 | } 1940 | 1941 | if (relVal && relVal !== '' && relVal !== 'nofollow') { 1942 | what = selector.length ? $(selector) : that; 1943 | what = what.filter('[' + relType + '="' + relVal + '"]'); 1944 | idx = what.index(this); 1945 | } 1946 | 1947 | options.index = idx; 1948 | 1949 | // Stop an event from bubbling if everything is fine 1950 | if (F.open(what, options) !== false) { 1951 | e.preventDefault(); 1952 | } 1953 | } 1954 | }; 1955 | 1956 | options = options || {}; 1957 | index = options.index || 0; 1958 | 1959 | if (!selector || options.live === false) { 1960 | that.unbind('click.fb-start').bind('click.fb-start', run); 1961 | 1962 | } else { 1963 | D.undelegate(selector, 'click.fb-start').delegate(selector + ":not('.fancybox-item, .fancybox-nav')", 'click.fb-start', run); 1964 | } 1965 | 1966 | this.filter('[data-fancybox-start=1]').trigger('click'); 1967 | 1968 | return this; 1969 | }; 1970 | 1971 | // Tests that need a body at doc ready 1972 | D.ready(function() { 1973 | var w1, w2; 1974 | 1975 | if ( $.scrollbarWidth === undefined ) { 1976 | // http://benalman.com/projects/jquery-misc-plugins/#scrollbarwidth 1977 | $.scrollbarWidth = function() { 1978 | var parent = $('
    ').appendTo('body'), 1979 | child = parent.children(), 1980 | width = child.innerWidth() - child.height( 99 ).innerWidth(); 1981 | 1982 | parent.remove(); 1983 | 1984 | return width; 1985 | }; 1986 | } 1987 | 1988 | if ( $.support.fixedPosition === undefined ) { 1989 | $.support.fixedPosition = (function() { 1990 | var elem = $('
    ').appendTo('body'), 1991 | fixed = ( elem[0].offsetTop === 20 || elem[0].offsetTop === 15 ); 1992 | 1993 | elem.remove(); 1994 | 1995 | return fixed; 1996 | }()); 1997 | } 1998 | 1999 | $.extend(F.defaults, { 2000 | scrollbarWidth : $.scrollbarWidth(), 2001 | fixed : $.support.fixedPosition, 2002 | parent : $('body') 2003 | }); 2004 | 2005 | //Get real width of page scroll-bar 2006 | w1 = $(window).width(); 2007 | 2008 | H.addClass('fancybox-lock-test'); 2009 | 2010 | w2 = $(window).width(); 2011 | 2012 | H.removeClass('fancybox-lock-test'); 2013 | 2014 | $("").appendTo("head"); 2015 | }); 2016 | 2017 | }(window, document, jQuery)); --------------------------------------------------------------------------------