diff --git a/_config.yml b/_config.yml index fb296841db8..759babaa536 100644 --- a/_config.yml +++ b/_config.yml @@ -2,10 +2,10 @@ # Main Configs # # ----------------------- # -url: http://yoursite.com -title: My Octopress Blog -subtitle: A blogging framework for hackers. -author: Your Name +url: http://benzhang.me +title: BenZhang' Home +subtitle: My coding Journal +author: Benzhang simple_search: http://google.com/search description: @@ -27,7 +27,7 @@ email: # If publishing to a subdirectory as in http://site.com/project set 'root: /project' root: / -permalink: /blog/:year/:month/:day/:title/ +permalink: /blog/:title/ source: source destination: public plugins: plugins @@ -58,7 +58,7 @@ default_asides: [asides/recent_posts.html, asides/github.html, asides/twitter.ht # ----------------------- # # Github repositories -github_user: +github_user: BenZhang github_repo_count: 0 github_show_profile_link: true github_skip_forks: true diff --git a/sass/_base.scss b/sass/_base.scss new file mode 100644 index 00000000000..05fdd005cbe --- /dev/null +++ b/sass/_base.scss @@ -0,0 +1,5 @@ +@import "base/utilities"; +@import "base/solarized"; +@import "base/theme"; +@import "base/typography"; +@import "base/layout"; diff --git a/sass/_partials.scss b/sass/_partials.scss new file mode 100644 index 00000000000..99c28b6378c --- /dev/null +++ b/sass/_partials.scss @@ -0,0 +1,8 @@ +@import "partials/header"; +@import "partials/navigation"; +@import "partials/blog"; +@import "partials/sharing"; +@import "partials/syntax"; +@import "partials/archive"; +@import "partials/sidebar"; +@import "partials/footer"; diff --git a/sass/base/_layout.scss b/sass/base/_layout.scss new file mode 100644 index 00000000000..81903428f5c --- /dev/null +++ b/sass/base/_layout.scss @@ -0,0 +1,192 @@ +$max-width: 1200px !default; + +// Padding used for layout margins +$pad-min: 18px !default; +$pad-narrow: 25px !default; +$pad-medium: 35px !default; +$pad-wide: 55px !default; + +// Sidebar widths used in media queries +$sidebar-width-medium: 240px !default; +$sidebar-pad-medium: 15px !default; +$sidebar-pad-wide: 20px !default; +$sidebar-width-wide: 300px !default; + +$indented-lists: false !default; + +$header-font-size: 1em !default; +$header-padding-top: 1.5em !default; +$header-padding-bottom: 1.5em !default; + +.group { @include pie-clearfix; } + +@mixin collapse-sidebar { + float: none; + width: auto; + clear: left; + margin: 0; + padding: 0 $pad-medium 1px; + background-color: lighten($sidebar-bg, 2); + border-top: 1px solid lighten($sidebar-border, 4); + section { + &.odd, &.even { float: left; width: 48%; } + &.odd { margin-left: 0; } + &.even { margin-left: 4%; } + } + &.thirds section { + width: 30%; + margin-left: 5%; + &.first { + margin-left: 0; + clear: both; + } + } +} + +body { + -webkit-text-size-adjust: none; + max-width: $max-width; + position: relative; + margin: 0 auto; + > header, > nav, > footer, #content > article, #content > div > article, #content > div > section { + @extend .group; + padding-left: $pad-min; + padding-right: $pad-min; + @media only screen and (min-width: 480px) { + padding-left: $pad-narrow; + padding-right: $pad-narrow; + } + @media only screen and (min-width: 768px) { + padding-left: $pad-medium; + padding-right: $pad-medium; + } + @media only screen and (min-width: 992px) { + padding-left: $pad-wide; + padding-right: $pad-wide; + } + } + div.pagination { + @extend .group; + margin-left: $pad-min; + margin-right: $pad-min; + @media only screen and (min-width: 480px) { + margin-left: $pad-narrow; + margin-right: $pad-narrow; + } + @media only screen and (min-width: 768px) { + margin-left: $pad-medium; + margin-right: $pad-medium; + } + @media only screen and (min-width: 992px) { + margin-left: $pad-wide; + margin-right: $pad-wide; + } + } + > header { + font-size: $header-font-size; + padding-top: $header-padding-top; + padding-bottom: $header-padding-bottom; + } +} + +#content { + overflow: hidden; + > div, > article { width: 100%; } +} + +aside.sidebar { + float: none; + padding: 0 $pad-min 1px; + background-color: lighten($sidebar-bg, 2); + border-top: 1px solid $sidebar-border; + @extend .group; +} + +.flex-content { max-width: 100%; height: auto; } + +.basic-alignment { + &.left { float: left; margin-right: 1.5em; } + &.right { float: right; margin-left: 1.5em; } + &.center { display:block; margin: 0 auto 1.5em; } + &.left, &.right { margin-bottom: .8em; } +} + +.toggle-sidebar { &, .no-sidebar & { display: none; }} + +body.sidebar-footer { + @media only screen and (min-width: 750px) { + aside.sidebar{ @include collapse-sidebar; } + } + #content { margin-right: 0px; } + .toggle-sidebar { display: none; } +} + +@media only screen and (min-width: 550px) { + body > header { font-size: $header-font-size; } +} +@media only screen and (min-width: 750px) { + aside.sidebar { @include collapse-sidebar; } +} +#main, #content, .sidebar { + @extend .group; +} +@media only screen and (min-width: 768px) { + body { -webkit-text-size-adjust: auto; } + body > header { font-size: $header-font-size * 1.2; } + #main { + padding: 0; + margin: 0 auto; + } + #content { + overflow: visible; + margin-right: $sidebar-width-medium; + position: relative; + .no-sidebar & { margin-right: 0; border-right: 0; } + .collapse-sidebar & { margin-right: 20px; } + > div, > article { + padding-top: $pad-medium/2; + padding-bottom: $pad-medium/2; + float: left; + } + } + aside.sidebar { + width: $sidebar-width-medium - $sidebar-pad-medium*2; + padding: 0 $sidebar-pad-medium $sidebar-pad-medium; + background: none; + clear: none; + float: left; + margin: 0 -100% 0 0; + section { + width: auto; margin-left: 0; + &.odd, &.even { float: none; width: auto; margin-left: 0; } + } + .collapse-sidebar & { + @include collapse-sidebar; + } + } +} + +@media only screen and (min-width: 992px) { + body > header { font-size: $header-font-size * 1.3; } + #content { margin-right: $sidebar-width-wide; } + #content { + > div, > article { + padding-top: $pad-wide/2; + padding-bottom: $pad-wide/2; + } + } + aside.sidebar { + width: $sidebar-width-wide - $sidebar-pad-wide*2; + padding: 1.2em $sidebar-pad-wide $sidebar-pad-wide; + .collapse-sidebar & { + padding: { left: $pad-wide; right: $pad-wide; } + } + } +} + +@if $indented-lists == false { + @media only screen and (min-width: 768px) { + ul, ol { margin-left: 0; } + } +} + diff --git a/sass/base/_solarized.scss b/sass/base/_solarized.scss new file mode 100644 index 00000000000..45d8fc5eff3 --- /dev/null +++ b/sass/base/_solarized.scss @@ -0,0 +1,46 @@ +$base03: #002b36 !default; //darkest blue +$base02: #073642 !default; //dark blue +$base01: #586e75 !default; //darkest gray +$base00: #657b83 !default; //dark gray +$base0: #839496 !default; //medium gray +$base1: #93a1a1 !default; //medium light gray +$base2: #eee8d5 !default; //cream +$base3: #fdf6e3 !default; //white +$solar-yellow: #b58900 !default; +$solar-orange: #cb4b16 !default; +$solar-red: #dc322f !default; +$solar-magenta: #d33682 !default; +$solar-violet: #6c71c4 !default; +$solar-blue: #268bd2 !default; +$solar-cyan: #2aa198 !default; +$solar-green: #859900 !default; + +$solarized: dark !default; + +@if $solarized == light { + + $_base03: $base03; + $_base02: $base02; + $_base01: $base01; + $_base00: $base00; + $_base0: $base0; + $_base1: $base1; + $_base2: $base2; + $_base3: $base3; + + $base03: $_base3; + $base02: $_base2; + $base01: $_base1; + $base00: $_base0; + $base0: $_base00; + $base1: $_base01; + $base2: $_base02; + $base3: $_base03; +} + +/* non highlighted code colors */ +$pre-bg: $base03 !default; +$pre-border: darken($base02, 5) !default; +$pre-color: $base1 !default; + + diff --git a/sass/base/_theme.scss b/sass/base/_theme.scss new file mode 100644 index 00000000000..9a50a8b438f --- /dev/null +++ b/sass/base/_theme.scss @@ -0,0 +1,86 @@ +$noise-bg: image-url('noise.png') top left !default; +$img-border: inline-image('dotted-border.png'); + +// Main Link Colors +$link-color: lighten(#165b94, 3) !default; +$link-color-hover: adjust-color($link-color, $lightness: 10, $saturation: 25) !default; +$link-color-visited: adjust-color($link-color, $hue: 80, $lightness: -4) !default; +$link-color-active: adjust-color($link-color-hover, $lightness: -15) !default; + +// Main Section Colors +$main-bg: #f8f8f8 !default; +$page-bg: #252525 !default; +$article-border: #eeeeee !default; + +$header-bg: #333 !default; +$header-border: lighten($header-bg, 15) !default; +$title-color: #f2f2f2 !default; +$subtitle-color: #aaa !default; + +$text-color: #222 !default; +$text-color-light: #aaa !default; +$type-border: #ddd !default; + +/* Navigation */ +$nav-bg: #ccc !default; +$nav-bg-front: image-url('noise.png') !default; +$nav-bg-back: linear-gradient(lighten($nav-bg, 8), $nav-bg, darken($nav-bg, 11)) !default; +$nav-color: darken($nav-bg, 38) !default; +$nav-color-hover: darken($nav-color, 25) !default; +$nav-placeholder: desaturate(darken($nav-bg, 10), 15) !default; +$nav-border: darken($nav-bg, 10) !default; +$nav-border-top: lighten($nav-bg, 15) !default; +$nav-border-bottom: darken($nav-bg, 25) !default; +$nav-border-left: darken($nav-bg, 11) !default; +$nav-border-right: lighten($nav-bg, 7) !default; + +/* Sidebar colors */ +$sidebar-bg: #f2f2f2 !default; +$sidebar-link-color: $link-color !default; +$sidebar-link-color-hover: $link-color-hover !default; +$sidebar-link-color-active: $link-color-active !default; +$sidebar-color: change-color(mix($text-color, $sidebar-bg, 80), $hue: hue($sidebar-bg), $saturation: saturation($sidebar-bg)/2) !default; +$sidebar-border: desaturate(darken($sidebar-bg, 7), 10) !default; +$sidebar-border-hover: darken($sidebar-bg, 7) !default; +$sidebar-link-color-subdued: lighten($sidebar-color, 20) !default; +$sidebar-link-color-subdued-hover: $sidebar-link-color-hover !default; +$twitter-status-link: lighten($sidebar-link-color-subdued, 15) !default; + +$footer-color: #888 !default; +$footer-bg: #ccc !default; +$footer-bg-front: image-url('noise.png') !default; +$footer-bg-back: linear-gradient(lighten($footer-bg, 8), $footer-bg, darken($footer-bg, 11)) !default; +$footer-color: darken($footer-bg, 38) !default; +$footer-color-hover: darken($footer-color, 10) !default; +$footer-border-top: lighten($footer-bg, 15) !default; +$footer-border-bottom: darken($footer-bg, 15) !default; +$footer-link-color: darken($footer-bg, 38) !default; +$footer-link-color-hover: darken($footer-color, 25) !default; +$page-border-bottom: darken($footer-bg, 5) !default; + + +/* Core theme application */ + +a { + @include link-colors($link-color, $hover: $link-color-hover, $focus: $link-color-hover, $visited: $link-color-visited, $active: $link-color-active); +} +aside.sidebar a { + @include link-colors($sidebar-link-color, $hover: $sidebar-link-color-hover, $focus: $sidebar-link-color-hover, $active: $sidebar-link-color-active); +} +a { + @include transition(color .3s); +} + +html { + background: $page-bg image-url('line-tile.png') top left; +} +body { + > div { + background: $sidebar-bg $noise-bg; + border-bottom: 1px solid $page-border-bottom; + > div { + background: $main-bg $noise-bg; + border-right: 1px solid $sidebar-border; + } + } +} diff --git a/sass/base/_typography.scss b/sass/base/_typography.scss new file mode 100644 index 00000000000..b68753fa5a9 --- /dev/null +++ b/sass/base/_typography.scss @@ -0,0 +1,161 @@ +$blockquote: $type-border !default; +$sans: "PT Sans", "Helvetica Neue", Arial, sans-serif !default; +$serif: "PT Serif", Georgia, Times, "Times New Roman", serif !default; +$mono: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace !default; +$heading-font-family: "PT Serif", "Georgia", "Helvetica Neue", Arial, sans-serif !default; +$header-title-font-family: $heading-font-family !default; +$header-subtitle-font-family: $heading-font-family !default; + +// Fonts +.heading { + font-family: $heading-font-family; +} +.sans { font-family: $sans; } +.serif { font-family: $serif; } +.mono { font-family: $mono; } + +body > header h1 { + font-size: 2.2em; + @extend .heading; + font-family: $header-title-font-family; + font-weight: normal; + line-height: 1.2em; + margin-bottom: 0.6667em; +} +body > header h2 { + font-family: $header-subtitle-font-family; +} + +body { + line-height: 1.5em; + color: $text-color; + @extend .serif; +} +h1 { + font-size: 2.2em; + line-height: 1.2em; +} + +@media only screen and (min-width: 992px) { + body { font-size: 1.15em; } + h1 { font-size: 2.6em; line-height: 1.2em; } +} + +#{headings()}{ + @extend .heading; + text-rendering: optimizelegibility; + margin-bottom: 1em; + font-weight: bold; +} +h2, section h1 { + font-size: 1.5em; +} +h3, section h2, section section h1 { + font-size: 1.3em; +} +h4, section h3, section section h2, section section section h1 { + font-size: 1em; +} +h5, section h4, section section h3 { + font-size: .9em; +} +h6, section h5, section section h4, section section section h3 { + font-size: .8em; +} +p, blockquote, ul, ol { margin-bottom: 1.5em; } + +ul { list-style-type: disc; + ul { list-style-type: circle; margin-bottom: 0px; + ul { list-style-type: square; margin-bottom: 0px; }}} + +ol { list-style-type: decimal; + ol { list-style-type: lower-alpha; margin-bottom: 0px; + ol { list-style-type: lower-roman; margin-bottom: 0px; }}} + +ul, ol { &, ul, ol { margin-left: 1.3em; }} + +strong { font-weight: bold; } + +em { font-style: italic; } + +sup, sub { font-size: 0.8em; position: relative; display: inline-block; } +sup { top: -.5em; } +sub { bottom: -.5em; } + +q { font-style: italic; + &:before { content: "\201C"; } + &:after { content: "\201D"; } +} + +em, dfn { font-style: italic; } + +strong, dfn { font-weight: bold; } + +del, s { text-decoration: line-through; } + +abbr, acronym { border-bottom: 1px dotted; cursor: help; } + +pre, code, tt { @extend .mono; } + +sub, sup { line-height: 0; } + +hr { margin-bottom: 0.2em; } + +small { font-size: .8em; } + +big { font-size: 1.2em; } + +blockquote { + $bq-margin: 1.2em; + font-style: italic; + position: relative; + font-size: 1.2em; + line-height: 1.5em; + padding-left: 1em; + border-left: 4px solid rgba($text-color-light, .5); + cite { + font-style: italic; + a { color: $text-color-light !important; word-wrap: break-word; } + &:before { content: '\2014'; padding:{right: .3em; left: .3em;} color: $text-color-light; } + } + @media only screen and (min-width: 992px) { + padding-left: 1.5em; + border-left-width: 4px; + } +} + +.pullquote-right:before, +.pullquote-left:before { + /* Reset metrics. */ + padding: 0; + border: none; + + /* Content */ + content: attr(data-pullquote); + + /* Pull out to the right, modular scale based margins. */ + float: right; + width: 45%; + margin: .5em 0 1em 1.5em; + + /* Baseline correction */ + position: relative; + top: 7px; + font-size: 1.4em; + line-height: 1.45em; +} + +.pullquote-left:before { + /* Make left pullquotes align properly. */ + float: left; + margin: .5em 1.5em 1em 0; +} + +/* @extend this to force long lines of continuous text to wrap */ +.force-wrap { + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + white-space: pre-wrap; + word-wrap: break-word; +} diff --git a/sass/base/_utilities.scss b/sass/base/_utilities.scss new file mode 100644 index 00000000000..2d49e659e74 --- /dev/null +++ b/sass/base/_utilities.scss @@ -0,0 +1,28 @@ +@mixin mask-image($img, $repeat: no-repeat){ + @include experimental(mask-image, image-url($img), -webkit, -moz, -o, -ms); + @include experimental(mask-repeat, $repeat, -webkit, -moz, -o, -ms); + width: image-width($img); + height: image-height($img); +} + +@mixin shadow-box($border: #fff .5em solid, $shadow: rgba(#000, .15) 0 1px 4px, $border-radius: .3em) { + @include border-radius($border-radius); + @include box-shadow($shadow); + @include box-sizing(border-box); + border: $border; +} + +@mixin selection($bg, $color: inherit, $text-shadow: none){ + * { + &::-moz-selection { background: $bg; color: $color; text-shadow: $text-shadow; } + &::-webkit-selection { background: $bg; color: $color; text-shadow: $text-shadow; } + &::selection { background: $bg; color: $color; text-shadow: $text-shadow; } + } +} + +@function text-color($color, $dark: dark, $light: light){ + $text-color: ( (red($color)*299) + (green($color)*587) + (blue($color)*114) ) / 1000; + $text-color: if($text-color >= 150, $dark, $light); + @return $text-color; +} + diff --git a/sass/custom/_colors.scss b/sass/custom/_colors.scss new file mode 100644 index 00000000000..740266a8101 --- /dev/null +++ b/sass/custom/_colors.scss @@ -0,0 +1,43 @@ +// Here you can easily change your sites's color scheme. +// To give it a try, uncomment some of the lines below rebuild your blog, and see how it works. +// If you need a handy color picker try http://hslpicker.com + +//$header-bg: #263347; +//$subtitle-color: lighten($header-bg, 58); +//$nav-bg: desaturate(lighten(#8fc17a, 18), 5); +//$nav-bg-front: image-url('noise.png'); +//$nav-bg-back: linear-gradient(lighten($nav-bg, 8), $nav-bg, darken($nav-bg, 11)); +//$sidebar-bg: desaturate(#eceff5, 8); +//$sidebar-link-color: saturate(#526f9a, 10); +//$sidebar-link-color-hover: darken(#7ab662, 9); +//$footer-bg: #ccc !default; +//$footer-bg-front: image-url('noise.png'); +//$footer-bg-back: linear-gradient(lighten($footer-bg, 8), $footer-bg, darken($footer-bg, 11)); + + +/* To use the light Solarized highlighting theme uncomment the following line */ +//$solarized: light; + +/* If you want to tweak the Solarized colors you can do that here */ +//$base03: #002b36; //darkest blue +//$base02: #073642; //dark blue +//$base01: #586e75; //darkest gray +//$base00: #657b83; //dark gray +//$base0: #839496; //medium gray +//$base1: #93a1a1; //medium light gray +//$base2: #eee8d5; //cream +//$base3: #fdf6e3; //white +//$solar-yellow: #b58900; +//$solar-orange: #cb4b16; +//$solar-red: #dc322f; +//$solar-magenta: #d33682; +//$solar-violet: #6c71c4; +//$solar-blue: #268bd2; +//$solar-cyan: #2aa198; +//$solar-green: #859900; + + +/* Non highlighted code colors */ +//$pre-bg: $base03; +//$pre-border: darken($base02, 5); +//$pre-color: $base1; diff --git a/sass/custom/_fonts.scss b/sass/custom/_fonts.scss new file mode 100644 index 00000000000..1a6b2a06281 --- /dev/null +++ b/sass/custom/_fonts.scss @@ -0,0 +1,10 @@ +// Here you can easily change font faces which are used in your site. +// To give it a try, uncomment some of the lines below rebuild your blog, and see how it works. your sites's. +// If you love to use Web Fonts, you also need to add some lines to source/_includes/custom/head.html + +//$sans: "Optima", sans-serif; +//$serif: "Baskerville", serif; +//$mono: "Courier", monospace; +//$heading-font-family: "Verdana", sans-serif; +//$header-title-font-family: "Futura", sans-serif; +//$header-subtitle-font-family: "Futura", sans-serif; diff --git a/sass/custom/_layout.scss b/sass/custom/_layout.scss new file mode 100644 index 00000000000..74c7de9d429 --- /dev/null +++ b/sass/custom/_layout.scss @@ -0,0 +1,21 @@ +// Here you can easily change your sites's layout. +// To give it a try, uncomment some of the lines below, make changes, rebuild your blog, and see how it works. + +//$header-font-size: 1em; +//$header-padding-top: 1.5em; +//$header-padding-bottom: 1.5em; + +//$max-width: 1350px; +//$indented-lists: true; + +// Padding used for layout margins +//$pad-min: 18px; +//$pad-narrow: 25px; +//$pad-medium: 35px; +//$pad-wide: 55px; + +// Sidebar widths used in media queries +//$sidebar-width-medium: 240px; +//$sidebar-pad-medium: 15px; +//$sidebar-pad-wide: 20px; +//$sidebar-width-wide: 300px; diff --git a/sass/custom/_styles.scss b/sass/custom/_styles.scss new file mode 100644 index 00000000000..91ffcccf6cf --- /dev/null +++ b/sass/custom/_styles.scss @@ -0,0 +1,2 @@ +// This File is imported last, and will override other styles in the cascade +// Add styles here to make changes without digging in too much diff --git a/sass/partials/_archive.scss b/sass/partials/_archive.scss new file mode 100644 index 00000000000..9ef1e824492 --- /dev/null +++ b/sass/partials/_archive.scss @@ -0,0 +1,72 @@ +#archive { + #content > div { &, > article { padding-top: 0; } } +} +#blog-archives { + article { + padding: 1em 0 1em; + position: relative; + background: $img-border bottom left repeat-x; + &:last-child { + background: none; + } + footer { padding: 0; margin: 0;} + } + h1 { color: $text-color; margin-bottom: .3em; } + h2 { display: none; } + h1 { + font-size: 1.5em; + a { + @include hover-link; + color: inherit; + &:hover { color: $link-color-hover; } + font-weight: normal; + display: inline-block; + } + } + a.category, time { + @extend .sans; + color: $text-color-light; + } + color: $text-color-light; + .entry-content { display: none; } + time { + font-size: .9em; + line-height: 1.2em; + .month, .day { display: inline-block; } + .month { text-transform: uppercase; } + } + p { margin-bottom: 1em; } + &, .entry-content { a { @include link-colors(inherit, $link-color-hover); }} + a:hover { color: $link-color-hover; } + @media only screen and (min-width: 550px) { + article { margin-left: 5em; } + h2 { + margin-bottom: .3em; + font-weight: normal; + display: inline-block; + position: relative; top: -1px; + float: left; + &:first-child { padding-top: .75em; } + } + time { + position: absolute; + text-align: right; + left: 0em; + top: 1.8em; + } + .year { display: none; } + article { + padding:{left: 4.5em; bottom: .7em;} + } + a.category { + line-height: 1.1em; + } + } +} +#content > .category { + article { + margin-left: 0; + padding-left: 6.8em; + } + .year { display: inline; } +} diff --git a/sass/partials/_blog.scss b/sass/partials/_blog.scss new file mode 100644 index 00000000000..57fe7a8aec1 --- /dev/null +++ b/sass/partials/_blog.scss @@ -0,0 +1,141 @@ +article { + padding-top: 1em; + a { @extend .force-wrap; } + header { + position: relative; + padding-top: 2em; + padding-bottom: 1em; + margin-bottom: 1em; + background: $img-border bottom left repeat-x; + h1 { + margin: 0; + a { text-decoration: none; + &:hover { text-decoration: underline; } } + } + p { + font-size: .9em; + color: $text-color-light; + margin: 0; + &.meta { + @extend .sans; + text-transform: uppercase; + position: absolute; top: 0; + } + } + @media only screen and (min-width: 768px) { + margin-bottom: 1.5em; + padding-bottom: 1em; + background: $img-border bottom left repeat-x; + } + } + h2 { + padding-top: 0.8em; + background: $img-border top left repeat-x; + } + .entry-content & h2:first-child, header + h2 { padding-top: 0; } + h2:first-child, header + h2 { background: none; } + .feature { + padding-top: .5em; + margin-bottom: 1em; + padding-bottom: 1em; + background: $img-border bottom left repeat-x; + font-size: 2.0em; font-style: italic; + line-height: 1.3em; + } + img, video, .flash-video { + @extend .flex-content; + @extend .basic-alignment; + @include shadow-box; + } + video, .flash-video { margin: 0 auto 1.5em; } + video { display: block; width: 100%; } + .flash-video { + > div { + position: relative; + display: block; + padding-bottom: 56.25%; + padding-top: 1px; + height: 0; + overflow: hidden; + iframe, object, embed { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + } + } + } + > footer { + padding-bottom: 2.5em; + margin-top: 2em; + @extend .sans; + p.meta { + margin-bottom: .8em; + font-size: .85em; + clear: both; + overflow: hidden; + } + .byline + time:before, time +time:before, .comments:before, .byline ~ .categories:before { + @extend .separator; + } + } + +} +article + article { + .blog-index & { + background: $img-border top left repeat-x; + } +} +#content .blog-index { + padding: { top: 0; bottom: 0; } + article { padding-top: 2em; } + article header { background: none; padding-bottom: 0; } + article h1 { + font-size: 2.2em; + a { color: inherit; &:hover { color: $link-color-hover; } } + } + a[rel=full-article] { + background: darken($main-bg, 5); + display: inline-block; + padding: .4em .8em; + margin-right: .5em; + text-decoration: none; + color: mix($text-color, $text-color-light); + @extend .serif; + @include transition(background-color .5s); + &:hover { + background: $link-color-hover; + text-shadow: none; + color: $main-bg; + } + } + footer { + @extend .sans; + margin-top: 1em; + } +} + +.separator { + content: "\2022 "; + padding: 0 .4em 0 .2em; + display: inline-block; +} + +#content div.pagination { + text-align: center; + font-size: .95em; + position: relative; + background: $img-border top left repeat-x; + padding: {top: 1.5em; bottom: 1.5em;} + a { + text-decoration: none; + color: $text-color-light; + &.prev { position: absolute; left: 0; } + &.next { position: absolute; right: 0; } + &:hover { color: $link-color-hover; } + &[href*=archive] { + &:before, &:after { content: '\2014'; padding: 0 .3em; } + } + } +} diff --git a/sass/partials/_footer.scss b/sass/partials/_footer.scss new file mode 100644 index 00000000000..37411225120 --- /dev/null +++ b/sass/partials/_footer.scss @@ -0,0 +1,19 @@ +body > footer { + @extend .sans; + font-size: .8em; + color: $footer-color; + text-shadow: lighten($footer-bg, 5) 0 1px; + background-color: $footer-bg; + @include background($footer-bg-front, $footer-bg-back); + border-top: 1px solid $footer-border-top; + position: relative; + padding-top: 1em; + padding-bottom: 1em; + margin-bottom: 3em; + @include border-bottom-radius(.4em); + z-index: 1; + a { + @include link-colors($footer-link-color, $footer-link-color-hover, $visited: $footer-link-color); + } + p:last-child { margin-bottom: 0; } +} diff --git a/sass/partials/_header.scss b/sass/partials/_header.scss new file mode 100644 index 00000000000..e3c6c020c2c --- /dev/null +++ b/sass/partials/_header.scss @@ -0,0 +1,18 @@ +body > header { + background: $header-bg; + h1 { + display: inline-block; + margin: 0; + a, a:visited, a:hover { + color: $title_color; + text-decoration: none; + } + } + h2 { + margin: .2em 0 0; + @extend .sans; + font-size: 1em; + color: $subtitle-color; + font-weight: normal; + } +} diff --git a/sass/partials/_navigation.scss b/sass/partials/_navigation.scss new file mode 100644 index 00000000000..30fa011d18c --- /dev/null +++ b/sass/partials/_navigation.scss @@ -0,0 +1,137 @@ +body > nav { + position: relative; + background-color: $nav-bg; + @include background($nav-bg-front, $nav-bg-back); + border: { + top: 1px solid $nav-border-top; + bottom: 1px solid $nav-border-bottom; } + padding-top: .35em; + padding-bottom: .35em; + form { + @include background-clip(padding-box); + margin: 0; padding: 0; + .search { + padding: .3em .5em 0; + font-size: .85em; + font-family: $sans; + line-height: 1.1em; + width: 95%; + @include border-radius(.5em); + @include background-clip(padding-box); + @include box-shadow(lighten($nav-bg, 2) 0 1px); + background-color: lighten($nav-bg, 15); + border: 1px solid $nav-border; + color: #888; + &:focus { + color: #444; + border-color: #80b1df; + @include box-shadow(#80b1df 0 0 4px, #80b1df 0 0 3px inset); + background-color: #fff; + outline: none; + } + } + } + fieldset[role=search]{ float: right; width: 48%; } + fieldset.mobile-nav{ float: left; width: 48%; + select{ width: 100%; font-size: .8em; border: 1px solid #888;} + } + ul { display: none; } + @media only screen and (min-width: 550px) { + font-size: .9em; + ul { + @include horizontal-list(0); + float: left; + display: block; + padding-top: .15em; + } + ul.subscription { + margin-left: .8em; + float: right; + li:last-child a { padding-right: 0; } + } + ul li { + margin: 0; + } + a { + @include link-colors($nav-color, $nav-color-hover, $visited: $nav-color); + font-family: $sans; + text-shadow: lighten($nav-bg, 12) 0 1px; + float: left; + text-decoration: none; + font-size: 1.1em; + padding: .1em 0; + line-height: 1.5em; + } + li + li { + border-left: 1px solid $nav-border-left; + margin-left: .8em; + a { + padding-left: .8em; + border-left: 1px solid $nav-border-right; + } + } + form { + float: right; + text-align: left; + padding-left: .8em; + width: $sidebar-width-medium - $pad-medium*2 - $sidebar-pad-medium + 20px; + .search { + width: 93%; + font-size: .95em; + line-height: 1.2em; + } + } + ul[data-subscription$=email] + form { + width: $sidebar-width-medium - $pad-medium*2 - $sidebar-pad-medium - 58px; + .search { width: 91%; } + } + fieldset.mobile-nav { display: none; } + fieldset[role=search]{ width: 99%; } + } + @media only screen and (min-width: 992px) { + form { + width: $sidebar-width-wide - $pad-wide - $sidebar-pad-wide*2 + 10px; + } + ul[data-subscription$=email] + form { + width: $sidebar-width-wide - $pad-wide - $sidebar-pad-wide*2 - 58px; + } + } +} +.no-placeholder { + body > nav .search { + background: lighten($nav-bg, 15) image-url('search.png') .3em .25em no-repeat; + text-indent: 1.3em; + } +} +@mixin mask-subscription-nav($feed: 'rss.png'){ + position: relative; top: 0px; + text-indent: -999999em; + background-color: $nav-border-right; + border: 0; + padding: 0; + &,&:after { @include mask-image($feed); } + &:after { + content: ""; + position: absolute; top: -1px; left: 0; + background-color: lighten($nav-color, 25); + } + &:hover:after { background-color: lighten($nav-color, 20); } +} +.maskImage { + body > nav { + @media only screen and (min-width: 550px) { + ul[data-subscription$=email] + form { + width: $sidebar-width-medium - $pad-medium*2 - $sidebar-pad-medium - 32px; + } + } + @media only screen and (min-width: 992px) { + ul[data-subscription$=email] + form { + width: $sidebar-width-wide - $pad-wide - $sidebar-pad-wide*2 - 32px; + } + } + } + ul.subscription { position: relative; top: .2em; li, a { border: 0; padding: 0; }} + a[rel=subscribe-rss]{ @include mask-subscription-nav('rss.png'); } + a[rel=subscribe-email]{ @include mask-subscription-nav('email.png'); } +} + diff --git a/sass/partials/_sharing.scss b/sass/partials/_sharing.scss new file mode 100644 index 00000000000..3eecb488e82 --- /dev/null +++ b/sass/partials/_sharing.scss @@ -0,0 +1,8 @@ +.sharing { + p.meta + & { + padding: { top: 1em; left: 0; } + background: $img-border top left repeat-x; + } +} + +#fb-root { display: none; } diff --git a/sass/partials/_sidebar.scss b/sass/partials/_sidebar.scss new file mode 100644 index 00000000000..eec540ba778 --- /dev/null +++ b/sass/partials/_sidebar.scss @@ -0,0 +1,5 @@ +@import "sidebar/base"; +@import "sidebar/twitter"; +@import "sidebar/googleplus"; +@import "sidebar/pinboard"; +@import "sidebar/delicious"; diff --git a/sass/partials/_syntax.scss b/sass/partials/_syntax.scss new file mode 100644 index 00000000000..77ac8d78574 --- /dev/null +++ b/sass/partials/_syntax.scss @@ -0,0 +1,253 @@ +.highlight, html .gist .gist-file .gist-syntax .gist-highlight { + table td.code { width: 100%; } + .line-numbers { + text-align: right; + font-size: 13px; + line-height: 1.45em; + @if $solarized == light { + background: lighten($base03, 1) $noise-bg !important; + border-right: 1px solid darken($base02, 2) !important; + @include box-shadow(lighten($base03, 2) -1px 0 inset); + text-shadow: lighten($base02, 2) 0 -1px; + } @else { + background: $base02 $noise-bg !important; + border-right: 1px solid darken($base03, 2) !important; + @include box-shadow(lighten($base02, 2) -1px 0 inset); + text-shadow: darken($base02, 10) 0 -1px; + } + span { color: $base01 !important; } + padding: .8em !important; + @include border-radius(0); + } + border: 1px solid $pre-border !important; +} +figure.code, .gist-file, pre { + @include box-shadow(rgba(#000, .06) 0 0 10px); + .highlight pre { @include box-shadow(none); } +} + +html .gist .gist-file { + margin-bottom: 1.8em; + position: relative; + border: none; + padding-top: image-height("code_bg.png") !important; + .gist-syntax { + border-bottom: 0 !important; + background: none !important; + .gist-highlight{ + background: $base03 !important; + pre { + @extend .pre-code; + } + } + } + .gist-meta { + padding: .6em 0.8em; + border: 1px solid lighten($base02, 2) !important; + color: $base01; + font-size: .7em !important; + @if $solarized == light { + background: lighten($base03, 2) $noise-bg; + border: 1px solid $pre-border !important; + border-top: 1px solid lighten($base03, 2) !important; + } @else { + background: $base02 $noise-bg; + } + @extend .sans; + line-height: 1.5em; + a { + color: mix($base1, $base01) !important; + @include hover-link; + &:hover { color: $base1 !important; } + } + a[href*='#file'] { + position: absolute; top: 0; left:0; right:-10px; + color: #474747 !important; + @extend .code-title; + &:hover { color: $link-color !important; } + } + a[href*=raw]{ + @extend .download-source; + top: .4em; + } + } +} +pre { + background: $pre-bg $noise-bg; + @include border-radius(.4em); + @extend .mono; + border: 1px solid $pre-border; + line-height: 1.45em; + font-size: 13px; + margin-bottom: 2.1em; + padding: .8em 1em; + color: $pre-color; + overflow: auto; +} +h3.filename { + @extend .code-title; + + pre { @include border-top-radius(0px); } +} + +p, li { + code { + @extend .mono; + display: inline-block; + white-space: no-wrap; + background: #fff; + font-size: .8em; + line-height: 1.5em; + color: #555; + border: 1px solid #ddd; + @include border-radius(.4em); + padding: 0 .3em; + margin: -1px 0; + } + pre code { font-size: 1em !important; background: none; border: none; } +} + +.pre-code { + @include selection(adjust-color($base03, $lightness: 23%, $saturation: -65%), $text-shadow: $base03 0 1px); + font-family: $mono !important; + overflow: scroll; + overflow-y: hidden; + display: block; + padding: .8em !important; + overflow-x: auto; + line-height: 1.45em; + background: $base03 $noise-bg !important; + color: $base1 !important; + span { color: $base1 !important; } + span { font-style: normal !important; font-weight: normal !important; } + + .c { color: $base01 !important; font-style: italic !important; } /* Comment */ + .cm { color: $base01 !important; font-style: italic !important; } /* Comment.Multiline */ + .cp { color: $base01 !important; font-style: italic !important; } /* Comment.Preproc */ + .c1 { color: $base01 !important; font-style: italic !important; } /* Comment.Single */ + .cs { color: $base01 !important; font-weight: bold !important; font-style: italic !important; } /* Comment.Special */ + .err { color: $solar-red !important; background: none !important; } /* Error */ + .k { color: $solar-orange !important; } /* Keyword */ + .o { color: $base1 !important; font-weight: bold !important; } /* Operator */ + .p { color: $base1 !important; } /* Operator */ + .ow { color: $solar-cyan !important; font-weight: bold !important; } /* Operator.Word */ + .gd { color: $base1 !important; background-color: mix($solar-red, $base03, 25%) !important; display: inline-block; } /* Generic.Deleted */ + .gd .x { color: $base1 !important; background-color: mix($solar-red, $base03, 35%) !important; display: inline-block; } /* Generic.Deleted.Specific */ + .ge { color: $base1 !important; font-style: italic !important; } /* Generic.Emph */ + //.gr { color: #aa0000 } /* Generic.Error */ + .gh { color: $base01 !important; } /* Generic.Heading */ + .gi { color: $base1 !important; background-color: mix($solar-green, $base03, 20%) !important; display: inline-block; } /* Generic.Inserted */ + .gi .x { color: $base1 !important; background-color: mix($solar-green, $base03, 40%) !important; display: inline-block; } /* Generic.Inserted.Specific */ + //.go { color: #888888 } /* Generic.Output */ + //.gp { color: #555555 } /* Generic.Prompt */ + .gs { color: $base1 !important; font-weight: bold !important; } /* Generic.Strong */ + .gu { color: $solar-violet !important; } /* Generic.Subheading */ + //.gt { color: #aa0000 } /* Generic.Traceback */ + .kc { color: $solar-green !important; font-weight: bold !important; } /* Keyword.Constant */ + .kd { color: $solar-blue !important; } /* Keyword.Declaration */ + .kp { color: $solar-orange !important; font-weight: bold !important; } /* Keyword.Pseudo */ + .kr { color: $solar-magenta !important; font-weight: bold !important; } /* Keyword.Reserved */ + .kt { color: $solar-cyan !important; } /* Keyword.Type */ + .n { color: $solar-blue !important; } + .na { color: $solar-blue !important; } /* Name.Attribute */ + .nb { color: $solar-green !important; } /* Name.Builtin */ + .nc { color: $solar-magenta !important;} /* Name.Class */ + .no { color: $solar-yellow !important; } /* Name.Constant */ + //.ni { color: #800080 } /* Name.Entity */ + .nl { color: $solar-green !important; } + .ne { color: $solar-blue !important; font-weight: bold !important; } /* Name.Exception */ + .nf { color: $solar-blue !important; font-weight: bold !important; } /* Name.Function */ + .nn { color: $solar-yellow !important; } /* Name.Namespace */ + .nt { color: $solar-blue !important; font-weight: bold !important; } /* Name.Tag */ + .nx { color: $solar-yellow !Important; } + //.bp { color: #999999 } /* Name.Builtin.Pseudo */ + //.vc { color: #008080 } /* Name.Variable.Class */ + .vg { color: $solar-blue !important; } /* Name.Variable.Global */ + .vi { color: $solar-blue !important; } /* Name.Variable.Instance */ + .nv { color: $solar-blue !important; } /* Name.Variable */ + //.w { color: #bbbbbb } /* Text.Whitespace */ + .mf { color: $solar-cyan !important; } /* Literal.Number.Float */ + .m { color: $solar-cyan !important; } /* Literal.Number */ + .mh { color: $solar-cyan !important; } /* Literal.Number.Hex */ + .mi { color: $solar-cyan !important; } /* Literal.Number.Integer */ + //.mo { color: #009999 } /* Literal.Number.Oct */ + .s { color: $solar-cyan !important; } /* Literal.String */ + //.sb { color: #d14 } /* Literal.String.Backtick */ + //.sc { color: #d14 } /* Literal.String.Char */ + .sd { color: $solar-cyan !important; } /* Literal.String.Doc */ + .s2 { color: $solar-cyan !important; } /* Literal.String.Double */ + .se { color: $solar-red !important; } /* Literal.String.Escape */ + //.sh { color: #d14 } /* Literal.String.Heredoc */ + .si { color: $solar-blue !important; } /* Literal.String.Interpol */ + //.sx { color: #d14 } /* Literal.String.Other */ + .sr { color: $solar-cyan !important; } /* Literal.String.Regex */ + .s1 { color: $solar-cyan !important; } /* Literal.String.Single */ + //.ss { color: #990073 } /* Literal.String.Symbol */ + //.il { color: #009999 } /* Literal.Number.Integer.Long */ + div { .gd, .gd .x, .gi, .gi .x { display: inline-block; width: 100%; }} +} + +.highlight, .gist-highlight { + pre { background: none; @include border-radius(none); border: none; padding: 0; margin-bottom: 0; } + margin-bottom: 1.8em; + background: $base03; + overflow-y: hidden; + overflow-x: auto; +} + +$solar-scroll-bg: rgba(#fff, .15); +$solar-scroll-thumb: rgba(#fff, .2); +@if $solarized == light { + $solar-scroll-bg: rgba(#000, .15); + $solar-scroll-thumb: rgba(#000, .15); +} + +pre, .highlight, .gist-highlight { + &::-webkit-scrollbar { height: .5em; background: $solar-scroll-bg; } + &::-webkit-scrollbar-thumb:horizontal { background: $solar-scroll-thumb; -webkit-border-radius: 4px; border-radius: 4px } +} + +.highlight code { @extend .pre-code; background: #000;} +figure.code { + background: none; + padding: 0; + border: 0; + margin-bottom: 1.5em; + pre { margin-bottom: 0; } + figcaption { + position: relative; + @extend .code-title; + a { @extend .download-source; } + } + .highlight { + margin-bottom: 0; + } +} + +.code-title { + text-align: center; + font-size: 13px; + line-height: 2em; + text-shadow: #cbcccc 0 1px 0; + color: #474747; + font-weight: normal; + margin-bottom: 0; + @include border-top-radius(5px); + font-family: "Helvetica Neue", Arial, "Lucida Grande", "Lucida Sans Unicode", Lucida, sans-serif; + background: #aaaaaa image-url("code_bg.png") top repeat-x; + border: 1px solid #565656; + border-top-color: #cbcbcb; + border-left-color: #a5a5a5; + border-right-color: #a5a5a5; + border-bottom: 0; +} + +.download-source { + position: absolute; right: .8em; + @include hover-link; + color: #666 !important; + z-index: 1; + font-size: 13px; + text-shadow: #cbcccc 0 1px 0; + padding-left: 3em; +} + diff --git a/sass/partials/sidebar/_base.scss b/sass/partials/sidebar/_base.scss new file mode 100644 index 00000000000..5441304e279 --- /dev/null +++ b/sass/partials/sidebar/_base.scss @@ -0,0 +1,106 @@ +.side-shadow-border { + @include box-shadow(lighten($sidebar-bg, 5) 0 1px); +} +aside.sidebar { + overflow: hidden; + color: $sidebar-color; + text-shadow: lighten($sidebar-bg, 8) 0 1px; + a { @extend .force-wrap; } + section { + @extend .sans; + font-size: .8em; + line-height: 1.4em; + margin-bottom: 1.5em; + h1 { + margin: 1.5em 0 0; + padding-bottom: .2em; + border-bottom: 1px solid $sidebar-border; + @extend .side-shadow-border; + + p { + padding-top: .4em; + } + } + } + img { + @extend .flex-content; + @extend .basic-alignment; + @include shadow-box($border: #fff .3em solid); + } + ul { + margin-bottom: 0.5em; + margin-left: 0; + } + li { + list-style: none; + padding: .5em 0; + margin: 0; + border-bottom: 1px solid $sidebar-border; + @extend .side-shadow-border; + p:last-child { + margin-bottom: 0; + } + } + a { + color: inherit; + @include transition(color .5s); + } + &:hover a { + color: $sidebar-link-color; + &:hover { color: $sidebar-link-color-hover; } + } +} +.aside-alt-link { + color: $sidebar-link-color-subdued; + &:hover { + color: $sidebar-link-color-subdued-hover; + } +} + +@media only screen and (min-width: 768px) { + .toggle-sidebar { + outline: none; + position: absolute; right: -10px; top: 0; bottom: 0; + display: inline-block; + text-decoration: none; + color: mix($text-color-light, $sidebar-bg); + width: 9px; + cursor: pointer; + &:hover { + background: mix($sidebar-border, $sidebar-bg); + @include background(linear-gradient(left, rgba($sidebar-border, .5), rgba($sidebar-border, 0))); + } + &:after { + position: absolute; right: -11px; top: 0; + width: 20px; + font-size: 1.2em; + line-height: 1.1em; + padding-bottom: .15em; + @include border-bottom-right-radius(.3em); + text-align: center; + background: $main-bg $noise-bg; + border-bottom: 1px solid $sidebar-border; + border-right: 1px solid $sidebar-border; + content: "\00BB"; + text-indent: -1px; + } + .collapse-sidebar & { + text-indent: 0px; + right: -20px; + width: 19px; + &:hover { + background: mix($sidebar-border, $sidebar-bg); + } + &:after { + border-left: 1px solid $sidebar-border; + text-shadow: #fff 0 1px; + content: "\00AB"; + left: 0px; right: 0; + text-align: center; + text-indent: 0; + border: 0; + border-right-width: 0; + background: none; + } + } + } +} diff --git a/sass/partials/sidebar/_delicious.scss b/sass/partials/sidebar/_delicious.scss new file mode 100644 index 00000000000..e962702e5fa --- /dev/null +++ b/sass/partials/sidebar/_delicious.scss @@ -0,0 +1,4 @@ +.delicious-posts { + a.delicious-link { margin-bottom: .5em; display: block; } + p { font-size: 1em; } +} diff --git a/sass/partials/sidebar/_googleplus.scss b/sass/partials/sidebar/_googleplus.scss new file mode 100644 index 00000000000..c2a693ee7f2 --- /dev/null +++ b/sass/partials/sidebar/_googleplus.scss @@ -0,0 +1,26 @@ +.googleplus { + h1 { + -moz-box-shadow: none !important; + -webkit-box-shadow: none !important; + -o-box-shadow: none !important; + box-shadow: none !important; + border-bottom: 0px none !important; + } + a { + text-decoration: none; + white-space: normal !important; + line-height: 32px; + + img { + float: left; + margin-right: 0.5em; + border: 0 none; + } + } +} + +.googleplus-hidden { + position: absolute; + top: -1000em; + left: -1000em; +} diff --git a/sass/partials/sidebar/_pinboard.scss b/sass/partials/sidebar/_pinboard.scss new file mode 100644 index 00000000000..9f9ab46114d --- /dev/null +++ b/sass/partials/sidebar/_pinboard.scss @@ -0,0 +1,12 @@ +#pinboard_linkroll { + .pin-title, .pin-description { + display: block; + margin-bottom: .5em; + } + .pin-tag { + @include hover-link; + @extend .aside-alt-link; + &:after { content: ','; } + &:last-child:after { content: ''; } + } +} diff --git a/sass/partials/sidebar/_twitter.scss b/sass/partials/sidebar/_twitter.scss new file mode 100644 index 00000000000..dfd49b55d2a --- /dev/null +++ b/sass/partials/sidebar/_twitter.scss @@ -0,0 +1,34 @@ +#tweets { + .loading { + background: inline-image('bird_32_gray.png') no-repeat center .5em; + color: darken($sidebar-bg, 18); + text-shadow: $main-bg 0 1px; + text-align: center; + padding: 2.5em 0 .5em; + &.error { + background: inline-image('bird_32_gray_fail.png') no-repeat center .5em; + } + } + p { + position: relative; + padding-right: 1em; + } + a[href*=status]:first-child { + color: $twitter-status-link; + float: right; + padding: 0 0 .1em 1em; + position: relative; right: -1.3em; + text-shadow: #fff 0 1px; + font-size: .7em; + span { font-size: 1.5em; } + text-decoration: none; + &:hover { + color: $sidebar-link-color-subdued-hover; + text-decoration: none; + } + } + a[href*='twitter.com/search']{ + @extend .aside-alt-link; + @include hover-link; + } +} diff --git a/sass/screen.scss b/sass/screen.scss new file mode 100644 index 00000000000..1899f608428 --- /dev/null +++ b/sass/screen.scss @@ -0,0 +1,10 @@ +@import "compass"; +@include global-reset; +@include reset-html5; + +@import "custom/colors"; +@import "custom/fonts"; +@import "custom/layout"; +@import "base"; +@import "partials"; +@import "custom/styles"; diff --git a/source/_includes/after_footer.html b/source/_includes/after_footer.html new file mode 100644 index 00000000000..08b8e3400a8 --- /dev/null +++ b/source/_includes/after_footer.html @@ -0,0 +1,5 @@ +{% include disqus.html %} +{% include facebook_like.html %} +{% include google_plus_one.html %} +{% include twitter_sharing.html %} +{% include custom/after_footer.html %} diff --git a/source/_includes/archive_post.html b/source/_includes/archive_post.html new file mode 100644 index 00000000000..fef3328e2b2 --- /dev/null +++ b/source/_includes/archive_post.html @@ -0,0 +1,8 @@ +{% capture category %}{{ post.categories | size }}{% endcapture %} +
Follow @{{ site.twitter_user }}
+ {% endif %} +A little something about me.
++ Copyright © {{ site.time | date: "%Y" }} - {{ site.author }} - + Powered by Octopress +
diff --git a/source/_includes/custom/head.html b/source/_includes/custom/head.html new file mode 100644 index 00000000000..85879f4a229 --- /dev/null +++ b/source/_includes/custom/head.html @@ -0,0 +1,3 @@ + + + diff --git a/source/_includes/custom/header.html b/source/_includes/custom/header.html new file mode 100644 index 00000000000..35f9c0595d8 --- /dev/null +++ b/source/_includes/custom/header.html @@ -0,0 +1,6 @@ + +'+repos[i].description+'
'; + } + t.innerHTML = fragment; + } + return { + showRepos: function(options){ + $.ajax({ + url: "http://github.com/api/v2/json/repos/show/"+options.user+"?callback=?" + , type: 'jsonp' + , error: function (err) { $(options.target + ' li.loading').addClass('error').text("Error loading feed"); } + , success: function(data) { + var repos = []; + if (!data || !data.repositories) { return; } + for (var i = 0; i < data.repositories.length; i++) { + if (options.skip_forks && data.repositories[i].fork) { continue; } + repos.push(data.repositories[i]); + } + repos.sort(function(a, b) { + var aDate = new Date(a.pushed_at).valueOf(), + bDate = new Date(b.pushed_at).valueOf(); + + if (aDate === bDate) { return 0; } + return aDate > bDate ? -1 : 1; + }); + + if (options.count) { repos.splice(options.count); } + render(options.target, repos); + } + }); + } + }; +})(); diff --git a/source/javascripts/libs/ender.js b/source/javascripts/libs/ender.js new file mode 100644 index 00000000000..5e56fd8971e --- /dev/null +++ b/source/javascripts/libs/ender.js @@ -0,0 +1,1497 @@ +/*! + * Ender: open module JavaScript framework + * copyright Dustin Diaz & Jacob Thornton 2011 (@ded @fat) + * https://ender.no.de + * License MIT + * Build: ender -b jeesh + */ +!function (context) { + + function aug(o, o2) { + for (var k in o2) { + k != 'noConflict' && k != '_VERSION' && (o[k] = o2[k]); + } + return o; + } + + function boosh(s, r) { + var els; + if (ender._select && typeof s == 'string' || s.nodeName || s.length && 'item' in s || s == window) { //string || node || nodelist || window + els = ender._select(s, r); + els.selector = s; + } else { + els = isFinite(s.length) ? s : [s]; + } + return aug(els, boosh); + } + + function ender(s, r) { + return boosh(s, r); + } + + aug(ender, { + _VERSION: '0.2.0', + ender: function (o, chain) { + aug(chain ? boosh : ender, o); + } + }); + + aug(boosh, { + forEach: function (fn, scope) { + // opt out of native forEach so we can intentionally call our own scope + // defaulting to the current item + for (var i = 0, l = this.length; i < l; ++i) { + i in this && fn.call(scope || this[i], this[i], i, this); + } + // return self for chaining + return this; + } + }); + + var old = context.$; + ender.noConflict = function () { + context.$ = old; + return this; + }; + + (typeof module !== 'undefined') && module.exports && (module.exports = ender); + // use subscript notation as extern for Closure compilation + context['ender'] = context['$'] = ender; + +}(this); +/*! + * bean.js - copyright Jacob Thornton 2011 + * https://github.com/fat/bean + * MIT License + * special thanks to: + * dean edwards: http://dean.edwards.name/ + * dperini: https://github.com/dperini/nwevents + * the entire mootools team: github.com/mootools/mootools-core + */ +!function (context) { + var __uid = 1, registry = {}, collected = {}, + overOut = /over|out/, + namespace = /[^\.]*(?=\..*)\.|.*/, + stripName = /\..*/, + addEvent = 'addEventListener', + attachEvent = 'attachEvent', + removeEvent = 'removeEventListener', + detachEvent = 'detachEvent', + doc = context.document || {}, + root = doc.documentElement || {}, + W3C_MODEL = root[addEvent], + eventSupport = W3C_MODEL ? addEvent : attachEvent, + + isDescendant = function (parent, child) { + var node = child.parentNode; + while (node != null) { + if (node == parent) { + return true; + } + node = node.parentNode; + } + }, + + retrieveUid = function (obj, uid) { + return (obj.__uid = uid || obj.__uid || __uid++); + }, + + retrieveEvents = function (element) { + var uid = retrieveUid(element); + return (registry[uid] = registry[uid] || {}); + }, + + listener = W3C_MODEL ? function (element, type, fn, add) { + element[add ? addEvent : removeEvent](type, fn, false); + } : function (element, type, fn, add, custom) { + custom && add && (element['_on' + custom] = element['_on' + custom] || 0); + element[add ? attachEvent : detachEvent]('on' + type, fn); + }, + + nativeHandler = function (element, fn, args) { + return function (event) { + event = fixEvent(event || ((this.ownerDocument || this.document || this).parentWindow || context).event); + return fn.apply(element, [event].concat(args)); + }; + }, + + customHandler = function (element, fn, type, condition, args) { + return function (event) { + if (condition ? condition.call(this, event) : W3C_MODEL ? true : event && event.propertyName == '_on' + type || !event) { + fn.apply(element, [event].concat(args)); + } + }; + }, + + addListener = function (element, orgType, fn, args) { + var type = orgType.replace(stripName, ''), + events = retrieveEvents(element), + handlers = events[type] || (events[type] = {}), + uid = retrieveUid(fn, orgType.replace(namespace, '')); + if (handlers[uid]) { + return element; + } + var custom = customEvents[type]; + if (custom) { + fn = custom.condition ? customHandler(element, fn, type, custom.condition) : fn; + type = custom.base || type; + } + var isNative = nativeEvents[type]; + fn = isNative ? nativeHandler(element, fn, args) : customHandler(element, fn, type, false, args); + isNative = W3C_MODEL || isNative; + if (type == 'unload') { + var org = fn; + fn = function () { + removeListener(element, type, fn) && org(); + }; + } + element[eventSupport] && listener(element, isNative ? type : 'propertychange', fn, true, !isNative && type); + handlers[uid] = fn; + fn.__uid = uid; + return type == 'unload' ? element : (collected[retrieveUid(element)] = element); + }, + + removeListener = function (element, orgType, handler) { + var uid, names, uids, i, events = retrieveEvents(element), type = orgType.replace(stripName, ''); + if (!events || !events[type]) { + return element; + } + names = orgType.replace(namespace, ''); + uids = names ? names.split('.') : [handler.__uid]; + for (i = uids.length; i--;) { + uid = uids[i]; + handler = events[type][uid]; + delete events[type][uid]; + if (element[eventSupport]) { + type = customEvents[type] ? customEvents[type].base : type; + var isNative = W3C_MODEL || nativeEvents[type]; + listener(element, isNative ? type : 'propertychange', handler, false, !isNative && type); + } + } + return element; + }, + + del = function (selector, fn, $) { + return function (e) { + var array = typeof selector == 'string' ? $(selector, this) : selector; + for (var target = e.target; target && target != this; target = target.parentNode) { + for (var i = array.length; i--;) { + if (array[i] == target) { + return fn.apply(target, arguments); + } + } + } + }; + }, + + add = function (element, events, fn, delfn, $) { + if (typeof events == 'object' && !fn) { + for (var type in events) { + events.hasOwnProperty(type) && add(element, type, events[type]); + } + } else { + var isDel = typeof fn == 'string', types = (isDel ? fn : events).split(' '); + fn = isDel ? del(events, delfn, $) : fn; + for (var i = types.length; i--;) { + addListener(element, types[i], fn, Array.prototype.slice.call(arguments, isDel ? 4 : 3)); + } + } + return element; + }, + + remove = function (element, orgEvents, fn) { + var k, type, events, + isString = typeof(orgEvents) == 'string', + names = isString && orgEvents.replace(namespace, ''), + rm = removeListener, + attached = retrieveEvents(element); + if (isString && /\s/.test(orgEvents)) { + orgEvents = orgEvents.split(' '); + var i = orgEvents.length - 1; + while (remove(element, orgEvents[i]) && i--) {} + return element; + } + events = isString ? orgEvents.replace(stripName, '') : orgEvents; + if (!attached || (isString && !attached[events])) { + return element; + } + if (typeof fn == 'function') { + rm(element, events, fn); + } else if (names) { + rm(element, orgEvents); + } else { + rm = events ? rm : remove; + type = isString && events; + events = events ? (fn || attached[events] || events) : attached; + for (k in events) { + events.hasOwnProperty(k) && rm(element, type || k, events[k]); + } + } + return element; + }, + + fire = function (element, type, args) { + var evt, k, i, types = type.split(' '); + for (i = types.length; i--;) { + type = types[i].replace(stripName, ''); + var isNative = nativeEvents[type], + isNamespace = types[i].replace(namespace, ''), + handlers = retrieveEvents(element)[type]; + if (isNamespace) { + isNamespace = isNamespace.split('.'); + for (k = isNamespace.length; k--;) { + handlers[isNamespace[k]] && handlers[isNamespace[k]].apply(element, args); + } + } else if (!args && element[eventSupport]) { + fireListener(isNative, type, element); + } else { + for (k in handlers) { + handlers.hasOwnProperty(k) && handlers[k].apply(element, args); + } + } + } + return element; + }, + + fireListener = W3C_MODEL ? function (isNative, type, element) { + evt = document.createEvent(isNative ? "HTMLEvents" : "UIEvents"); + evt[isNative ? 'initEvent' : 'initUIEvent'](type, true, true, context, 1); + element.dispatchEvent(evt); + } : function (isNative, type, element) { + isNative ? element.fireEvent('on' + type, document.createEventObject()) : element['_on' + type]++; + }, + + clone = function (element, from, type) { + var events = retrieveEvents(from), obj, k; + obj = type ? events[type] : events; + for (k in obj) { + obj.hasOwnProperty(k) && (type ? add : clone)(element, type || from, type ? obj[k] : k); + } + return element; + }, + + fixEvent = function (e) { + var result = {}; + if (!e) { + return result; + } + var type = e.type, target = e.target || e.srcElement; + result.preventDefault = fixEvent.preventDefault(e); + result.stopPropagation = fixEvent.stopPropagation(e); + result.target = target && target.nodeType == 3 ? target.parentNode : target; + if (~type.indexOf('key')) { + result.keyCode = e.which || e.keyCode; + } else if ((/click|mouse|menu/i).test(type)) { + result.rightClick = e.which == 3 || e.button == 2; + result.pos = { x: 0, y: 0 }; + if (e.pageX || e.pageY) { + result.clientX = e.pageX; + result.clientY = e.pageY; + } else if (e.clientX || e.clientY) { + result.clientX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; + result.clientY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; + } + overOut.test(type) && (result.relatedTarget = e.relatedTarget || e[(type == 'mouseover' ? 'from' : 'to') + 'Element']); + } + for (var k in e) { + if (!(k in result)) { + result[k] = e[k]; + } + } + return result; + }; + + fixEvent.preventDefault = function (e) { + return function () { + if (e.preventDefault) { + e.preventDefault(); + } + else { + e.returnValue = false; + } + }; + }; + + fixEvent.stopPropagation = function (e) { + return function () { + if (e.stopPropagation) { + e.stopPropagation(); + } else { + e.cancelBubble = true; + } + }; + }; + + var nativeEvents = { click: 1, dblclick: 1, mouseup: 1, mousedown: 1, contextmenu: 1, //mouse buttons + mousewheel: 1, DOMMouseScroll: 1, //mouse wheel + mouseover: 1, mouseout: 1, mousemove: 1, selectstart: 1, selectend: 1, //mouse movement + keydown: 1, keypress: 1, keyup: 1, //keyboard + orientationchange: 1, // mobile + touchstart: 1, touchmove: 1, touchend: 1, touchcancel: 1, // touch + gesturestart: 1, gesturechange: 1, gestureend: 1, // gesture + focus: 1, blur: 1, change: 1, reset: 1, select: 1, submit: 1, //form elements + load: 1, unload: 1, beforeunload: 1, resize: 1, move: 1, DOMContentLoaded: 1, readystatechange: 1, //window + error: 1, abort: 1, scroll: 1 }; //misc + + function check(event) { + var related = event.relatedTarget; + if (!related) { + return related == null; + } + return (related != this && related.prefix != 'xul' && !/document/.test(this.toString()) && !isDescendant(this, related)); + } + + var customEvents = { + mouseenter: { base: 'mouseover', condition: check }, + mouseleave: { base: 'mouseout', condition: check }, + mousewheel: { base: /Firefox/.test(navigator.userAgent) ? 'DOMMouseScroll' : 'mousewheel' } + }; + + var bean = { add: add, remove: remove, clone: clone, fire: fire }; + + var clean = function (el) { + var uid = remove(el).__uid; + if (uid) { + delete collected[uid]; + delete registry[uid]; + } + }; + + if (context[attachEvent]) { + add(context, 'unload', function () { + for (var k in collected) { + collected.hasOwnProperty(k) && clean(collected[k]); + } + context.CollectGarbage && CollectGarbage(); + }); + } + + var oldBean = context.bean; + bean.noConflict = function () { + context.bean = oldBean; + return this; + }; + + (typeof module !== 'undefined' && module.exports) ? + (module.exports = bean) : + (context['bean'] = bean); + +}(this);!function ($) { + var b = bean.noConflict(), + integrate = function (method, type, method2) { + var _args = type ? [type] : []; + return function () { + for (var args, i = 0, l = this.length; i < l; i++) { + args = [this[i]].concat(_args, Array.prototype.slice.call(arguments, 0)); + args.length == 4 && args.push($); + !arguments.length && method == 'add' && type && (method = 'fire'); + b[method].apply(this, args); + } + return this; + }; + }; + + var add = integrate('add'), + remove = integrate('remove'), + fire = integrate('fire'); + + var methods = { + + on: add, + addListener: add, + bind: add, + listen: add, + delegate: add, + + unbind: remove, + unlisten: remove, + removeListener: remove, + undelegate: remove, + + emit: fire, + trigger: fire, + + cloneEvents: integrate('clone'), + + hover: function (enter, leave) { + for (var i = 0, l = this.length; i < l; i++) { + b.add.call(this, this[i], 'mouseenter', enter); + b.add.call(this, this[i], 'mouseleave', leave); + } + return this; + } + }; + + var shortcuts = [ + 'blur', 'change', 'click', 'dblclick', 'error', 'focus', 'focusin', + 'focusout', 'keydown', 'keypress', 'keyup', 'load', 'mousedown', + 'mouseenter', 'mouseleave', 'mouseout', 'mouseover', 'mouseup', + 'resize', 'scroll', 'select', 'submit', 'unload' + ]; + + for (var i = shortcuts.length; i--;) { + var shortcut = shortcuts[i]; + methods[shortcut] = integrate('add', shortcut); + } + + $.ender(methods, true); +}(ender); +/*! + * bonzo.js - copyright @dedfat 2011 + * https://github.com/ded/bonzo + * Follow our software http://twitter.com/dedfat + * MIT License + */ +!function (context) { + + var doc = context.document, + html = doc.documentElement, + query = null, + byTag = 'getElementsByTagName', + specialAttributes = /^checked|value|selected$/, + specialTags = /select|map|fieldset|table|tbody|tr|colgroup/i, + tagMap = { select: 'option', table: 'tbody', tr: 'td' }, + stateAttributes = /^checked|selected$/, + ie = /msie/i.test(navigator.userAgent), + uidList = [], + uuids = 0, + digit = /^-?[\d\.]+$/, + px = 'px', + // commonly used methods + setAttribute = 'setAttribute', + getAttribute = 'getAttribute', + trimReplace = /(^\s*|\s*$)/g, + unitless = { lineHeight: 1, zoom: 1, zIndex: 1, opacity: 1 }; + + function classReg(c) { + return new RegExp("(^|\\s+)" + c + "(\\s+|$)"); + } + + function each(ar, fn, scope) { + for (var i = 0, l = ar.length; i < l; i++) { + fn.call(scope || ar[i], ar[i], i, ar); + } + return ar; + } + + var trim = String.prototype.trim ? + function (s) { + return s.trim(); + } : + function (s) { + return s.replace(trimReplace, ''); + }; + + function camelize(s) { + return s.replace(/-(.)/g, function (m, m1) { + return m1.toUpperCase(); + }); + } + + function is(node) { + return node && node.nodeName && node.nodeType == 1; + } + + function some(ar, fn, scope) { + for (var i = 0, j = ar.length; i < j; ++i) { + if (fn.call(scope, ar[i], i, ar)) { + return true; + } + } + return false; + } + + var getStyle = doc.defaultView && doc.defaultView.getComputedStyle ? + function (el, property) { + var value = null; + if (property == 'float') { + property = 'cssFloat'; + } + var computed = doc.defaultView.getComputedStyle(el, ''); + computed && (value = computed[camelize(property)]); + return el.style[property] || value; + + } : (ie && html.currentStyle) ? + + function (el, property) { + property = camelize(property); + property = property == 'float' ? 'styleFloat' : property; + + if (property == 'opacity') { + var val = 100; + try { + val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity; + } catch (e1) { + try { + val = el.filters('alpha').opacity; + } catch (e2) {} + } + return val / 100; + } + var value = el.currentStyle ? el.currentStyle[property] : null; + return el.style[property] || value; + } : + + function (el, property) { + return el.style[camelize(property)]; + }; + + function insert(target, host, fn) { + var i = 0, self = host || this, r = []; + each(normalize(query ? query(target) : target), function (t) { + each(self, function (el) { + var n = el.cloneNode(true); + fn(t, n); + r[i] = n; + i++; + }); + }, this); + each(r, function (e, i) { + self[i] = e; + }); + self.length = i; + return self; + } + + function xy(el, x, y) { + var $el = bonzo(el), + style = $el.css('position'), + offset = $el.offset(), + rel = 'relative', + isRel = style == rel, + delta = [parseInt($el.css('left'), 10), parseInt($el.css('top'), 10)]; + + if (style == 'static') { + $el.css('position', rel); + style = rel; + } + + isNaN(delta[0]) && (delta[0] = isRel ? 0 : el.offsetLeft); + isNaN(delta[1]) && (delta[1] = isRel ? 0 : el.offsetTop); + + x !== null && (el.style.left = x - offset.left + delta[0] + 'px'); + y !== null && (el.style.top = y - offset.top + delta[1] + 'px'); + + } + + function Bonzo(elements) { + this.length = 0; + this.original = elements; + if (elements) { + elements = typeof elements !== 'string' && + !elements.nodeType && + typeof elements.length !== 'undefined' ? + elements : + [elements]; + this.length = elements.length; + for (var i = 0; i < elements.length; i++) { + this[i] = elements[i]; + } + } + } + + Bonzo.prototype = { + + each: function (fn, scope) { + return each(this, fn, scope); + }, + + map: function (fn, reject) { + var m = [], n, i; + for (i = 0; i < this.length; i++) { + n = fn.call(this, this[i]); + reject ? (reject(n) && m.push(n)) : m.push(n); + } + return m; + }, + + first: function () { + return bonzo(this[0]); + }, + + last: function () { + return bonzo(this[this.length - 1]); + }, + + html: function (h, text) { + var method = text ? + html.textContent == null ? + 'innerText' : + 'textContent' : + 'innerHTML', m; + function append(el, tag) { + while (el.firstChild) { + el.removeChild(el.firstChild); + } + each(normalize(h, tag), function (node) { + el.appendChild(node); + }); + } + return typeof h !== 'undefined' ? + this.each(function (el) { + (m = el.tagName.match(specialTags)) ? + append(el, m[0]) : + (el[method] = h); + }) : + this[0] ? this[0][method] : ''; + }, + + text: function (text) { + return this.html(text, 1); + }, + + addClass: function (c) { + return this.each(function (el) { + this.hasClass(el, c) || (el.className = trim(el.className + ' ' + c)); + }, this); + }, + + removeClass: function (c) { + return this.each(function (el) { + this.hasClass(el, c) && (el.className = trim(el.className.replace(classReg(c), ' '))); + }, this); + }, + + hasClass: function (el, c) { + return typeof c == 'undefined' ? + some(this, function (i) { + return classReg(el).test(i.className); + }) : + classReg(c).test(el.className); + }, + + toggleClass: function (c, condition) { + if (typeof condition !== 'undefined' && !condition) { + return this; + } + return this.each(function (el) { + this.hasClass(el, c) ? + (el.className = trim(el.className.replace(classReg(c), ' '))) : + (el.className = trim(el.className + ' ' + c)); + }, this); + }, + + show: function (type) { + return this.each(function (el) { + el.style.display = type || ''; + }); + }, + + hide: function (elements) { + return this.each(function (el) { + el.style.display = 'none'; + }); + }, + + append: function (node) { + return this.each(function (el) { + each(normalize(node), function (i) { + el.appendChild(i); + }); + }); + }, + + prepend: function (node) { + return this.each(function (el) { + var first = el.firstChild; + each(normalize(node), function (i) { + el.insertBefore(i, first); + }); + }); + }, + + appendTo: function (target, host) { + return insert.call(this, target, host, function (t, el) { + t.appendChild(el); + }); + }, + + prependTo: function (target, host) { + return insert.call(this, target, host, function (t, el) { + t.insertBefore(el, t.firstChild); + }); + }, + + next: function () { + return this.related('nextSibling'); + }, + + previous: function () { + return this.related('previousSibling'); + }, + + related: function (method) { + return this.map( + function (el) { + el = el[method]; + while (el && el.nodeType !== 1) { + el = el[method]; + } + return el || 0; + }, + function (el) { + return el; + } + ); + }, + + before: function (node) { + return this.each(function (el) { + each(bonzo.create(node), function (i) { + el.parentNode.insertBefore(i, el); + }); + }); + }, + + after: function (node) { + return this.each(function (el) { + each(bonzo.create(node), function (i) { + el.parentNode.insertBefore(i, el.nextSibling); + }); + }); + }, + + insertBefore: function (target, host) { + return insert.call(this, target, host, function (t, el) { + t.parentNode.insertBefore(el, t); + }); + }, + + insertAfter: function (target, host) { + return insert.call(this, target, host, function (t, el) { + var sibling = t.nextSibling; + if (sibling) { + t.parentNode.insertBefore(el, sibling); + } + else { + t.parentNode.appendChild(el); + } + }); + }, + + css: function (o, v) { + // is this a request for just getting a style? + if (v === undefined && typeof o == 'string') { + return getStyle(this[0], o); + } + var iter = o; + if (typeof o == 'string') { + iter = {}; + iter[o] = v; + } + + if (ie && iter.opacity) { + // oh this 'ol gamut + iter.filter = 'alpha(opacity=' + (iter.opacity * 100) + ')'; + // give it layout + iter.zoom = o.zoom || 1; + delete iter.opacity; + } + + if (v = iter['float']) { + // float is a reserved style word. w3 uses cssFloat, ie uses styleFloat + ie ? (iter.styleFloat = v) : (iter.cssFloat = v); + delete iter['float']; + } + + var fn = function (el, p, v) { + for (var k in iter) { + if (iter.hasOwnProperty(k)) { + v = iter[k]; + // change "5" to "5px" - unless you're line-height, which is allowed + (p = camelize(k)) && digit.test(v) && !(p in unitless) && (v += px); + el.style[p] = v; + } + } + }; + return this.each(fn); + }, + + offset: function (x, y) { + if (x || y) { + return this.each(function (el) { + xy(el, x, y); + }); + } + var el = this[0]; + var width = el.offsetWidth; + var height = el.offsetHeight; + var top = el.offsetTop; + var left = el.offsetLeft; + while (el = el.offsetParent) { + top = top + el.offsetTop; + left = left + el.offsetLeft; + } + + return { + top: top, + left: left, + height: height, + width: width + }; + }, + + attr: function (k, v) { + var el = this[0]; + return typeof v == 'undefined' ? + specialAttributes.test(k) ? + stateAttributes.test(k) && typeof el[k] == 'string' ? + true : el[k] : el[getAttribute](k) : + this.each(function (el) { + k == 'value' ? (el.value = v) : el[setAttribute](k, v); + }); + }, + + val: function (s) { + return (typeof s == 'string') ? this.attr('value', s) : this[0].value; + }, + + removeAttr: function (k) { + return this.each(function (el) { + el.removeAttribute(k); + }); + }, + + data: function (k, v) { + var el = this[0]; + if (typeof v === 'undefined') { + el[getAttribute]('data-node-uid') || el[setAttribute]('data-node-uid', ++uuids); + var uid = el[getAttribute]('data-node-uid'); + uidList[uid] || (uidList[uid] = {}); + return uidList[uid][k]; + } else { + return this.each(function (el) { + el[getAttribute]('data-node-uid') || el[setAttribute]('data-node-uid', ++uuids); + var uid = el[getAttribute]('data-node-uid'); + var o = {}; + o[k] = v; + uidList[uid] = o; + }); + } + }, + + remove: function () { + return this.each(function (el) { + el.parentNode && el.parentNode.removeChild(el); + }); + }, + + empty: function () { + return this.each(function (el) { + while (el.firstChild) { + el.removeChild(el.firstChild); + } + }); + }, + + detach: function () { + return this.map(function (el) { + return el.parentNode.removeChild(el); + }); + }, + + scrollTop: function (y) { + return scroll.call(this, null, y, 'y'); + }, + + scrollLeft: function (x) { + return scroll.call(this, x, null, 'x'); + } + }; + + function normalize(node, tag) { + return typeof node == 'string' ? bonzo.create(node, tag) : is(node) ? [node] : node; + } + + function scroll(x, y, type) { + var el = this[0]; + if (x == null && y == null) { + return (isBody(el) ? getWindowScroll() : { x: el.scrollLeft, y: el.scrollTop })[type]; + } + if (isBody(el)) { + window.scrollTo(x, y); + } else { + x != null && (el.scrollLeft = x); + y != null && (el.scrollTop = y); + } + return this; + } + + function isBody(element) { + return element === window || (/^(?:body|html)$/i).test(element.tagName); + } + + function getWindowScroll() { + return { x: window.pageXOffset || html.scrollLeft, y: window.pageYOffset || html.scrollTop }; + } + + function bonzo(els, host) { + return new Bonzo(els, host); + } + + bonzo.setQueryEngine = function (q) { + query = q; + delete bonzo.setQueryEngine; + }; + + bonzo.aug = function (o, target) { + for (var k in o) { + o.hasOwnProperty(k) && ((target || Bonzo.prototype)[k] = o[k]); + } + }; + + bonzo.create = function (node, tag) { + return typeof node == 'string' ? + function () { + var t = tag ? tagMap[tag.toLowerCase()] : null; + var el = doc.createElement(t || 'div'), els = []; + if (tag) { + var bitches = node.match(new RegExp("<" + t + ">.+?<\\/" + t + ">", "g")); + each(bitches, function (m) { + m = m.replace(/<(.+)>(.+?)<\/\1>/, '$2'); + var bah = doc.createElement(t); + bah.appendChild(doc.createDocumentFragment(m)); + el.appendChild(bah); + }); + } else { + el.innerHTML = node; + } + var nodes = el.childNodes; + el = el.firstChild; + els.push(el); + while (el = el.nextSibling) { + (el.nodeType == 1) && els.push(el); + } + return els; + + }() : is(node) ? [node.cloneNode(true)] : []; + }; + + bonzo.doc = function () { + var w = html.scrollWidth, + h = html.scrollHeight, + vp = this.viewport(); + return { + width: Math.max(w, vp.width), + height: Math.max(h, vp.height) + }; + }; + + bonzo.firstChild = function (el) { + for (var c = el.childNodes, i = 0, j = (c && c.length) || 0, e; i < j; i++) { + if (c[i].nodeType === 1) { + e = c[j = i]; + } + } + return e; + }; + + bonzo.viewport = function () { + var h = self.innerHeight, + w = self.innerWidth; + ie && (h = html.clientHeight) && (w = html.clientWidth); + return { + width: w, + height: h + }; + }; + + bonzo.isAncestor = 'compareDocumentPosition' in html ? + function (container, element) { + return (container.compareDocumentPosition(element) & 16) == 16; + } : 'contains' in html ? + function (container, element) { + return container !== element && container.contains(element); + } : + function (container, element) { + while (element = element.parentNode) { + if (element === container) { + return true; + } + } + return false; + }; + + var old = context.bonzo; + bonzo.noConflict = function () { + context.bonzo = old; + return this; + }; + context['bonzo'] = bonzo; + +}(this);!function ($) { + + var b = bonzo; + b.setQueryEngine($); + $.ender(b); + $.ender(b(), true); + $.ender({ + create: function (node) { + return $(b.create(node)); + } + }); + + $.id = function (id) { + return $([document.getElementById(id)]); + }; + + function indexOf(ar, val) { + for (var i = 0; i < ar.length; i++) { + if (ar[i] === val) { + return i; + } + } + return -1; + } + + function uniq(ar) { + var a = [], i, j; + label: + for (i = 0; i < ar.length; i++) { + for (j = 0; j < a.length; j++) { + if (a[j] == ar[i]) { + continue label; + } + } + a[a.length] = ar[i]; + } + return a; + } + + $.ender({ + parents: function (selector, closest) { + var collection = $(selector), j, k, p, r = []; + for (j = 0, k = this.length; j < k; j++) { + p = this[j]; + while (p = p.parentNode) { + if (indexOf(collection, p) !== -1) { + r.push(p); + if (closest) break; + } + } + } + return $(uniq(r)); + }, + + closest: function (selector) { + return this.parents(selector, true); + }, + + first: function () { + return $(this[0]); + }, + + last: function () { + return $(this[this.length - 1]); + }, + + next: function () { + return $(b(this).next()); + }, + + previous: function () { + return $(b(this).previous()); + }, + + appendTo: function (t) { + return b(this.selector).appendTo(t, this); + }, + + prependTo: function (t) { + return b(this.selector).prependTo(t, this); + }, + + insertAfter: function (t) { + return b(this.selector).insertAfter(t, this); + }, + + insertBefore: function (t) { + return b(this.selector).insertBefore(t, this); + }, + + siblings: function () { + var i, l, p, r = []; + for (i = 0, l = this.length; i < l; i++) { + p = this[i]; + while (p = p.previousSibling) { + p.nodeType == 1 && r.push(p); + } + p = this[i]; + while (p = p.nextSibling) { + p.nodeType == 1 && r.push(p); + } + } + return $(r); + }, + + children: function () { + var el, r = []; + for (i = 0, l = this.length; i < l; i++) { + if (!(el = b.firstChild(this[i]))) { + continue; + } + r.push(el); + while (el = el.nextSibling) { + el.nodeType == 1 && r.push(el); + } + } + return $(uniq(r)); + }, + + height: function (v) { + return v ? this.css('height', v) : parseInt(this.css('height'), 10); + }, + + width: function (v) { + return v ? this.css('width', v) : parseInt(this.css('width'), 10); + } + }, true); + +}(ender || $); + +!function () { var exports = {}, module = { exports: exports }; !function (doc) { + var loaded = 0, fns = [], ol, f = false, + testEl = doc.createElement('a'), + domContentLoaded = 'DOMContentLoaded', + addEventListener = 'addEventListener', + onreadystatechange = 'onreadystatechange'; + + /^loade|c/.test(doc.readyState) && (loaded = 1); + + function flush() { + loaded = 1; + for (var i = 0, l = fns.length; i < l; i++) { + fns[i](); + } + } + doc[addEventListener] && doc[addEventListener](domContentLoaded, function fn() { + doc.removeEventListener(domContentLoaded, fn, f); + flush(); + }, f); + + + testEl.doScroll && doc.attachEvent(onreadystatechange, (ol = function ol() { + if (/^c/.test(doc.readyState)) { + doc.detachEvent(onreadystatechange, ol); + flush(); + } + })); + + var domReady = testEl.doScroll ? + function (fn) { + self != top ? + !loaded ? + fns.push(fn) : + fn() : + !function () { + try { + testEl.doScroll('left'); + } catch (e) { + return setTimeout(function() { + domReady(fn); + }, 50); + } + fn(); + }(); + } : + function (fn) { + loaded ? fn() : fns.push(fn); + }; + + (typeof module !== 'undefined') && module.exports ? + (module.exports = {domReady: domReady}) : + (window.domReady = domReady); + +}(document); $.ender(module.exports); }.call($); +/*! + * qwery.js - copyright @dedfat + * https://github.com/ded/qwery + * Follow our software http://twitter.com/dedfat + * MIT License + */ + +!function (context, doc) { + + var c, i, j, k, l, m, o, p, r, v, + el, node, len, found, classes, item, items, token, + id = /#([\w\-]+)/, + clas = /\.[\w\-]+/g, + idOnly = /^#([\w\-]+$)/, + classOnly = /^\.([\w\-]+)$/, + tagOnly = /^([\w\-]+)$/, + tagAndOrClass = /^([\w]+)?\.([\w\-]+)$/, + html = doc.documentElement, + tokenizr = /\s(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\])/, + specialChars = /([.*+?\^=!:${}()|\[\]\/\\])/g, + simple = /^([a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/, + attr = /\[([\w\-]+)(?:([\|\^\$\*\~]?\=)['"]?([ \w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^]+)["']?)?\]/, + chunker = new RegExp(simple.source + '(' + attr.source + ')?'); + + function array(ar) { + r = []; + for (i = 0, len = ar.length; i < len; i++) { + r[i] = ar[i]; + } + return r; + } + + var cache = function () { + this.c = {}; + }; + cache.prototype = { + g: function (k) { + return this.c[k] || undefined; + }, + s: function (k, v) { + this.c[k] = v; + return v; + } + }; + + var classCache = new cache(), + cleanCache = new cache(), + attrCache = new cache(), + tokenCache = new cache(); + + function q(query) { + return query.match(chunker); + } + + function interpret(whole, tag, idsAndClasses, wholeAttribute, attribute, qualifier, value) { + var m, c, k; + if (tag && this.tagName.toLowerCase() !== tag) { + return false; + } + if (idsAndClasses && (m = idsAndClasses.match(id)) && m[1] !== this.id) { + return false; + } + if (idsAndClasses && (classes = idsAndClasses.match(clas))) { + for (i = classes.length; i--;) { + c = classes[i].slice(1); + if (!(classCache.g(c) || classCache.s(c, new RegExp('(^|\\s+)' + c + '(\\s+|$)'))).test(this.className)) { + return false; + } + } + } + if (wholeAttribute && !value) { + o = this.attributes; + for (k in o) { + if (Object.prototype.hasOwnProperty.call(o, k) && (o[k].name || k) == attribute) { + return this; + } + } + } + if (wholeAttribute && !checkAttr(qualifier, this.getAttribute(attribute) || '', value)) { + return false; + } + return this; + } + + function loopAll(tokens) { + var r = [], token = tokens.pop(), intr = q(token), tag = intr[1] || '*', i, l, els, + root = tokens.length && (m = tokens[0].match(idOnly)) ? doc.getElementById(m[1]) : doc; + if (!root) { + return r; + } + els = root.getElementsByTagName(tag); + for (i = 0, l = els.length; i < l; i++) { + el = els[i]; + if (item = interpret.apply(el, intr)) { + r.push(item); + } + } + return r; + } + + function clean(s) { + return cleanCache.g(s) || cleanCache.s(s, s.replace(specialChars, '\\$1')); + } + + function checkAttr(qualify, actual, val) { + switch (qualify) { + case '=': + return actual == val; + case '^=': + return actual.match(attrCache.g('^=' + val) || attrCache.s('^=' + val, new RegExp('^' + clean(val)))); + case '$=': + return actual.match(attrCache.g('$=' + val) || attrCache.s('$=' + val, new RegExp(clean(val) + '$'))); + case '*=': + return actual.match(attrCache.g(val) || attrCache.s(val, new RegExp(clean(val)))); + case '~=': + return actual.match(attrCache.g('~=' + val) || attrCache.s('~=' + val, new RegExp('(?:^|\\s+)' + clean(val) + '(?:\\s+|$)'))); + case '|=': + return actual.match(attrCache.g('|=' + val) || attrCache.s('|=' + val, new RegExp('^' + clean(val) + '(-|$)'))); + } + return false; + } + + function _qwery(selector) { + var r = [], ret = [], i, l, + tokens = tokenCache.g(selector) || tokenCache.s(selector, selector.split(tokenizr)); + tokens = tokens.slice(0); + if (!tokens.length) { + return r; + } + r = loopAll(tokens); + if (!tokens.length) { + return r; + } + // loop through all descendent tokens + for (j = 0, l = r.length, k = 0; j < l; j++) { + node = r[j]; + p = node; + // loop through each token + for (i = tokens.length; i--;) { + z: // loop through parent nodes + while (p !== html && (p = p.parentNode)) { + if (found = interpret.apply(p, q(tokens[i]))) { + break z; + } + } + } + found && (ret[k++] = node); + } + return ret; + } + + function boilerPlate(selector, _root, fn) { + var root = (typeof _root == 'string') ? fn(_root)[0] : (_root || doc); + if (selector === window || isNode(selector)) { + return !_root || (selector !== window && isNode(root) && isAncestor(selector, root)) ? [selector] : []; + } + if (selector && typeof selector === 'object' && isFinite(selector.length)) { + return array(selector); + } + if (m = selector.match(idOnly)) { + return (el = doc.getElementById(m[1])) ? [el] : []; + } + if (m = selector.match(tagOnly)) { + return array(root.getElementsByTagName(m[1])); + } + return false; + } + + function isNode(el) { + return (el && el.nodeType && (el.nodeType == 1 || el.nodeType == 9)); + } + + function uniq(ar) { + var a = [], i, j; + label: + for (i = 0; i < ar.length; i++) { + for (j = 0; j < a.length; j++) { + if (a[j] == ar[i]) { + continue label; + } + } + a[a.length] = ar[i]; + } + return a; + } + + function qwery(selector, _root) { + var root = (typeof _root == 'string') ? qwery(_root)[0] : (_root || doc); + if (!root || !selector) { + return []; + } + if (m = boilerPlate(selector, _root, qwery)) { + return m; + } + return select(selector, root); + } + + var isAncestor = 'compareDocumentPosition' in html ? + function (element, container) { + return (container.compareDocumentPosition(element) & 16) == 16; + } : 'contains' in html ? + function (element, container) { + container = container == doc || container == window ? html : container; + return container !== element && container.contains(element); + } : + function (element, container) { + while (element = element.parentNode) { + if (element === container) { + return 1; + } + } + return 0; + }, + + select = (doc.querySelector && doc.querySelectorAll) ? + function (selector, root) { + if (doc.getElementsByClassName && (m = selector.match(classOnly))) { + return array((root).getElementsByClassName(m[1])); + } + return array((root).querySelectorAll(selector)); + } : + function (selector, root) { + var result = [], collection, collections = [], i; + if (m = selector.match(tagAndOrClass)) { + items = root.getElementsByTagName(m[1] || '*'); + r = classCache.g(m[2]) || classCache.s(m[2], new RegExp('(^|\\s+)' + m[2] + '(\\s+|$)')); + for (i = 0, l = items.length, j = 0; i < l; i++) { + r.test(items[i].className) && (result[j++] = items[i]); + } + return result; + } + for (i = 0, items = selector.split(','), l = items.length; i < l; i++) { + collections[i] = _qwery(items[i]); + } + for (i = 0, l = collections.length; i < l && (collection = collections[i]); i++) { + var ret = collection; + if (root !== doc) { + ret = []; + for (j = 0, m = collection.length; j < m && (element = collection[j]); j++) { + // make sure element is a descendent of root + isAncestor(element, root) && ret.push(element); + } + } + result = result.concat(ret); + } + return uniq(result); + }; + + qwery.uniq = uniq; + var oldQwery = context.qwery; + qwery.noConflict = function () { + context.qwery = oldQwery; + return this; + }; + context['qwery'] = qwery; + +}(this, document);!function (doc) { + var q = qwery.noConflict(); + function create(node, root) { + var el = (root || doc).createElement('div'), els = []; + el.innerHTML = node; + var nodes = el.childNodes; + el = el.firstChild; + els.push(el); + while (el = el.nextSibling) { + (el.nodeType == 1) && els.push(el); + } + return els; + }; + $._select = function (s, r) { + return /^\s* + is released under the MIT License',
+ lineNumbers = '', + tableMiddle = ' | ', + tableEnd = ' |
'+$('pre', code).html()+'' + tableEnd; + $(code).html(table); + }); +} + +function flashVideoFallback(){ + var flashplayerlocation = "/assets/jwplayer/player.swf", + flashplayerskin = "/assets/jwplayer/glow/glow.xml"; + $('video').each(function(video){ + video = $(video); + if (!Modernizr.video.h264 && swfobject.getFlashPlayerVersion() || window.location.hash.indexOf("flash-test") !== -1){ + video.children('source[src$=mp4]').first().map(function(source){ + var src = $(source).attr('src'), + id = 'video_'+Math.round(1 + Math.random()*(100000)), + width = video.attr('width'), + height = parseInt(video.attr('height'), 10) + 30; + video.after('
" + this.cook(it.d) + ""; + if (it.n) { + str += "" + this.cook(it.n) + "\n"; + } + if (it.t.length > 0) { + for (var i = 0; i < it.t.length; i++) { + var tag = it.t[i]; + str += " " + this.cook(tag).replace(/^\s+|\s+$/g, '') + " "; + } + } + str += "
'+''+prettyDate(tweets[t].created_at)+''+linkifyTweet(tweets[t].text.replace(/\n/g, '
'), tweets[t].entities.urls)+'