Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first swag at updating to h5bp 2.0

  • Loading branch information...
commit d34fd4796b741a962a9958b011e8b847cf60bdd2 1 parent 405f9dd
@heygrady authored
Showing with 1,236 additions and 896 deletions.
  1. +1 −0  lib/app/helpers/html5_boilerplate_helper.rb
  2. +10 −13 stylesheets/_html5-boilerplate.scss
  3. +0 −42 stylesheets/html5-boilerplate/_fonts.scss
  4. +52 −41 stylesheets/html5-boilerplate/_helpers.scss
  5. +0 −35 stylesheets/html5-boilerplate/_media.scss
  6. +379 −0 stylesheets/html5-boilerplate/_normalize.scss
  7. +21 −0 stylesheets/html5-boilerplate/_print.scss
  8. +0 −43 stylesheets/html5-boilerplate/_reset.scss
  9. +0 −126 stylesheets/html5-boilerplate/_styles.scss
  10. +8 −5 templates/project/_head.html.haml
  11. +12 −3 templates/project/_javascripts.html.haml
  12. +1 −1  templates/project/_stylesheets.html.haml
  13. +1 −1  templates/project/application.html.haml
  14. BIN  templates/project/files/apple-touch-icon-114x114-precomposed.png
  15. BIN  templates/project/files/apple-touch-icon-57x57-precomposed.png
  16. BIN  templates/project/files/apple-touch-icon-72x72-precomposed.png
  17. BIN  templates/project/files/apple-touch-icon-precomposed.png
  18. BIN  templates/project/files/apple-touch-icon.png
  19. +135 −110 templates/project/files/htaccess
  20. +0 −8 templates/project/handheld.scss
  21. +32 −16 templates/project/index.html.haml
  22. +369 −253 templates/project/javascripts/{jquery-1.6.js → jquery-1.6.2.js}
  23. +18 −0 templates/project/javascripts/jquery-1.6.2.min.js
  24. +0 −16 templates/project/javascripts/jquery-1.6.min.js
  25. +0 −2  templates/project/javascripts/modernizr-1.7.min.js
  26. +4 −0 templates/project/javascripts/modernizr-2.0.6.min.js
  27. +7 −3 templates/project/javascripts/plugins.js
  28. +90 −37 templates/project/javascripts/rails.js
  29. +0 −7 templates/project/javascripts/respond.min.js
  30. +10 −7 templates/project/manifest.rb
  31. +13 −21 templates/project/partials/_base.scss
  32. +19 −14 templates/project/partials/_media.scss
  33. +53 −57 templates/project/partials/_overrides.scss
  34. +0 −32 templates/project/partials/_page.scss
  35. +1 −3 templates/project/style.scss
View
1  lib/app/helpers/html5_boilerplate_helper.rb
@@ -1,6 +1,7 @@
module Html5BoilerplateHelper
# Create a named haml tag to wrap IE conditional around a block
# http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
+ # Consider adding an manifest.appcache: h5bp.com/d/Offline
def ie_tag(name=:body, attrs={}, &block)
attrs.symbolize_keys!
haml_concat("<!--[if lt IE 7]> #{ tag(name, add_class('ie6', attrs), true) } <![endif]-->".html_safe)
View
23 stylesheets/_html5-boilerplate.scss
@@ -1,20 +1,17 @@
-// HTML5 Boilerplate
//
-// Credit is left where credit is due.
-// Much inspiration was taken from these projects:
-// - yui.yahooapis.com/2.8.1/build/base/base.css
-// - camendesign.com/design/
-// - praegnanz.de/weblog/htmlcssjs-kickstart
+// HTML5 Boilerplate
+//
+// What follows is the result of much research on cross-browser styling.
+// Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
+// Kroc Camen, and the H5BP dev community and team.
+//
+// Detailed information about this CSS: h5bp.com/css
-@import "html5-boilerplate/reset";
-@import "html5-boilerplate/fonts";
-@import "html5-boilerplate/styles";
+@import "html5-boilerplate/normalize";
@import "html5-boilerplate/helpers";
-@import "html5-boilerplate/media";
+@import "html5-boilerplate/print";
@mixin html5-boilerplate {
- @include html5-boilerplate-reset;
- @include html5-boilerplate-fonts;
- @include html5-boilerplate-styles;
+ @include html5-boilerplate-normalize;
@include html5-boilerplate-helpers;
}
View
42 stylesheets/html5-boilerplate/_fonts.scss
@@ -1,42 +0,0 @@
-$base-font-family: unquote("sans-serif") !default;
-$base-font-size: 13px !default;
-$base-line-height: 1.231 !default;
-
-//
-// Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/
-// Whatever parts of this port of YUI to Sass that are copyrightable, are Copyright (c) 2008, Christopher Eppstein. All Rights Reserved.
-//
-
-@mixin html5-boilerplate-fonts($family: $base-font-family, $size: $base-font-size, $line-height: $base-line-height) {
- body {
- font-size: $size;
- font-family: $family;
- line-height: $line-height; // hack retained to preserve specificity
- *font-size: small;
- }
-
- // Normalize monospace sizing:
- // en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome
- pre, code, kbd, samp { font-family: monospace, sans-serif; }
-}
-
-@mixin font-smoothing {
- @warn "The 'font-smoothing' mixin has been deprecated as it made monospace too thin.";
-}
-
-// Sets the font size specified in pixels using percents so that the base
-// font size changes and 1em has the correct value. When nesting font size
-// declarations, within the DOM tree, the base_font_size must be the parent's
-// effective font-size in pixels.
-// Usage Examples:
-// .big
-// +font-size(16px)
-// .bigger
-// +font-size(18px)
-// .big .bigger
-// +font-size(18px, 16px)
-//
-// For more information see the table found at http://developer.yahoo.com/yui/3/cssfonts/#fontsize
-@mixin font-size($size, $base-font-size: $base-font-size) {
- font-size: ceil(percentage($size / $base-font-size));
-}
View
93 stylesheets/html5-boilerplate/_helpers.scss
@@ -1,27 +1,29 @@
-@import "compass/typography/text/replacement";
-@import "compass/utilities/general/clearfix";
-
-//
-// Non-semantic helper classes
-// It's better to include these mixins in your own styles
-//
+// ==|== non-semantic helper classes ========================================
+// Please define your styles before this section.
+// ==========================================================================
@mixin html5-boilerplate-helpers {
.ir { @include image-replacement; }
-
.hidden { @include hidden; }
-
- .visuallyhidden { @include visually-hidden; }
-
- .clearfix { @include micro-clearfix; }
+ .visuallyhidden { @include visuallyhidden; }
+ .invisible { @include invisible; }
+ .clearfix { @include h5bp-clearfix; }
}
-// Almost the same as compass replace-text
-// but adding direction: ltr
-@mixin image-replacement($img: none, $x: 50%, $y: 50%) {
- @include hide-text;
- direction: ltr;
+//For image replacement
+@mixin image-replacement($img, $x: 50%, $y: 50%) {
+ background-color: transparent;
background-repeat: no-repeat;
+ border: 0;
+ direction: ltr;
+ display: block;
+ overflow: hidden;
+ text-align: left;
+ text-indent: -999em;
+ br {
+ display: none;
+ }
+
@if $img != none {
background-image: image-url($img);
background-position: $x $y;
@@ -34,38 +36,47 @@
height: image-height($img);
}
-// Hide for both screenreaders and browsers
-// css-discuss.incutio.com/wiki/Screenreader_Visibility
+// Hide from both screenreaders and browsers: h5bp.com/u
@mixin hidden {
- display:none;
+ display: none !important;
visibility: hidden;
}
-// Hide only visually, but have it available for screenreaders: by Jon Neal
-// www.webaim.org/techniques/css/invisiblecontent/ & j.mp/visuallyhidden
-@mixin visually-hidden {
- border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;
- // Extends the .visuallyhidden class to allow the element to be focusable
- // when navigated to via the keyboard: drupal.org/node/897638
+// Hide only visually, but have it available for screenreaders: h5bp.com/v
+@mixin visuallyhidden {
+ border: 0;
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+
+ // Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p
&.focusable:active, &.focusable:focus {
- clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto;
+ clip: auto;
+ height: auto;
+ margin: 0;
+ overflow: visible;
+ position: static;
+ width: auto;
}
}
// Hide visually and from screenreaders, but maintain layout
-@mixin invisible { visibility: hidden; }
-
-// The Magnificent Clearfix: Updated to prevent margin-collapsing on child elements in most situations.
-// nicolasgallagher.com/micro-clearfix-hack/
-@mixin micro-clearfix {
- &:before, &:after { content: ""; display: table; }
- &:after { clear: both; }
- zoom: 1;
+@mixin invisible {
+ visibility: hidden;
}
-
-// The Magnificent CLEARFIX << j.mp/phayesclearfix
-@mixin magnificent-clearfix {
- @warn "The 'magnificent-clearfix' mixin has been deprecated. Use 'pie-clearfix' in compass core instead.";
- @include pie-clearfix;
-}
+// Contain floats: h5bp.com/q
+@mixin h5bp-clearfix {
+ &:before, &:after {
+ content: "";
+ display: table;
+ }
+ &:after {
+ clear: both;
+ }
+ zoom: 1;
+}
View
35 stylesheets/html5-boilerplate/_media.scss
@@ -1,35 +0,0 @@
-@mixin html5-boilerplate-media {
- @warn "The 'html5-boilerplate-media' mixin has been deprecated.";
-}
-
-//
-// Print styles
-// Inlined to avoid required HTTP connection www.phpied.com/delay-loading-your-print-css/
-
-@mixin media-print {
- * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
- -ms-filter: none !important; } // Black prints faster: sanbeiji.com/archives/953
- a, a:visited { color: #444 !important; text-decoration: underline; }
- a[href]:after { content: " (" attr(href) ")"; }
- abbr[title]:after { content: " (" attr(title) ")"; }
- .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } // Don't show links for images, or javascript/internal links
- pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
- thead { display: table-header-group; } // css-discuss.incutio.com/wiki/Printing_Tables
- tr, img { page-break-inside: avoid; }
- img { max-width: 100% !important; }
- @page { margin: 0.5cm; }
- p, h2, h3 { orphans: 3; widows: 3; }
- h2, h3{ page-break-after: avoid; }
-}
-
-@mixin media-orientation-portrait {
- @warn "The 'media-orientation-portrait' mixin has been deprecated.";
-}
-
-@mixin media-orientation-landscape {
- @warn "The 'media-orientation-landscape' mixin has been deprecated.";
-}
-
-@mixin media-mobile($optimize: true) {
- @warn "The 'media-mobile' mixin has been deprecated.";
-}
View
379 stylesheets/html5-boilerplate/_normalize.scss
@@ -0,0 +1,379 @@
+// ==|== normalize =======================================================
+@mixin html5-boilerplate-normalize {
+ @include h5bp-normalize-html5;
+ @include h5bp-normalize-base;
+ @include h5bp-normalize-selection;
+ @include h5bp-normalize-links;
+ @include h5bp-normalize-typography;
+ @include h5bp-normalize-lists;
+ @include h5bp-normalize-images;
+ @include h5bp-normalize-svg;
+ @include h5bp-normalize-figures;
+ @include h5bp-normalize-forms;
+ @include h5bp-normalize-tables;
+}
+
+@function in-list($list, $value) {
+ @each $item in $list {
+ @if $item == $value {
+ @return true;
+ }
+ }
+ @return false;
+};
+
+// =============================================================================
+// HTML5 display definitions
+// =============================================================================
+@mixin h5bp-normalize-html5 {
+ article, aside, details, figcaption, figure, footer, header, hgroup, nav, section {
+ display: block;
+ }
+
+ audio, canvas, video {
+ display: inline-block;
+ *display: inline;
+ *zoom: 1;
+ }
+
+ audio:not([controls]) {
+ display: none;
+ }
+
+ [hidden] {
+ display: none;
+ }
+}
+
+// =============================================================================
+// Base
+// =============================================================================
+$base-font-family: unquote("sans-serif") !default;
+$base-font-size: 13px !default;
+$base-line-height: 1.231 !default;
+$font-color: #222 !default;
+@mixin h5bp-normalize-base($base-font-family: $base-font-family, $base-font-size: $base-font-size, $base-line-height: $base-line-height, $font-color: $font-color) {
+ // 1. Correct text resizing oddly in IE6/7 when body font-size is set using em units
+ // 2. Force vertical scrollbar in non-IE
+ // 3. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g
+
+ html {
+ font-size: 100%;
+ overflow-y: scroll;
+ -webkit-text-size-adjust: 100%;
+ -ms-text-size-adjust: 100%;
+ }
+
+ body {
+ margin: 0;
+ font-size: $base-font-size;
+ line-height: $base-line-height;
+ }
+
+ body, button, input, select, textarea {
+ font-family: $base-font-family
+ color: $font-color;
+ }
+}
+
+// Remove text-shadow in selection highlight: h5bp.com/i
+// These selection declarations have to be separate
+// Also: hot pink! (or customize the background color to match your design)
+$selected-background-color: #fe57a1 !default;
+$selected-font-color: #fff !default;
+@mixin h5bp-normalize-selection( $selected-background-color: $selected-background-color, $selected-font-color: $selected-font-color ) {
+ ::-moz-selection {
+ background: $selected-background-color;
+ color: $selected-font-color;
+ text-shadow: none;
+ }
+
+ ::selection {
+ background: $selected-background-color;
+ color: $selected-font-color;
+ text-shadow: none;
+ }
+}
+
+// =============================================================================
+// Links
+// =============================================================================
+$link-color: #00e !default;
+$link-visited-color: #551a8b !default;
+$link-hover-color: #06e !default;
+@mixin h5bp-normalize-links( $link-color: $link-color, $link-visited-color: $link-visited-color, $link-hover-color: $link-hover-color ) {
+ a {
+ color: $link-color;
+ }
+
+ a:visited {
+ color: $link-visited-color;
+ }
+
+ a:hover {
+ color: $link-hover-color;
+ }
+
+ a:focus {
+ outline: thin dotted;
+ }
+
+ // Improve readability when focused and hovered in all browsers: h5bp.com/h
+ a:hover, a:active {
+ outline: 0;
+ }
+}
+
+// =============================================================================
+// Typography
+// =============================================================================
+@mixin h5bp-normalize-typography($list: false) {
+ @if !$list || in-list($list, abbr) {
+ abbr[title] {
+ border-bottom: 1px dotted;
+ }
+ }
+
+ @if !$list || in-list($list, bold) {
+ b, strong {
+ font-weight: bold;
+ }
+ }
+
+ @if !$list || in-list($list, blockquote) {
+ blockquote {
+ margin: 1em 40px;
+ }
+ }
+
+ @if !$list || in-list($list, dfn) {
+ dfn {
+ font-style: italic;
+ }
+ }
+ @if !$list || in-list($list, hr) {
+ hr {
+ display: block;
+ height: 1px;
+ border: 0;
+ border-top: 1px solid #ccc;
+ margin: 1em 0;
+ padding: 0;
+ }
+ }
+
+ @if !$list || in-list($list, ins) {
+ ins {
+ background: #ff9;
+ color: #000;
+ text-decoration: none;
+ }
+ }
+
+ @if !$list || in-list($list, mark) {
+ mark {
+ background: #ff0;
+ color: #000;
+ font-style: italic;
+ font-weight: bold;
+ }
+ }
+
+ // Redeclare monospace font family: h5bp.com/j
+ @if !$list || in-list($list, monospace) {
+ pre, code, kbd, samp {
+ font-family: monospace, monospace;
+ _font-family: 'courier new', monospace;
+ font-size: 1em;
+ }
+ }
+
+ // Improve readability of pre-formatted text in all browsers
+ @if !$list || in-list($list, pre) {
+ pre {
+ white-space: pre;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+ }
+ }
+
+ @if !$list || in-list($list, quotes) {
+ q {
+ quotes: none;
+ }
+
+ q:before, q:after {
+ content: "";
+ content: none;
+ }
+ }
+
+ @if !$list || in-list($list, small) {
+ small {
+ font-size: 85%;
+ }
+ }
+
+ // Position subscript and superscript content without affecting line-height: h5bp.com/k
+ @if !$list || in-list($list, subsup) {
+ sub, sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+ }
+
+ sup {
+ top: -0.5em;
+ }
+
+ sub {
+ bottom: -0.25em;
+ }
+ }
+}
+
+// =============================================================================
+// Lists
+// =============================================================================
+$list-left-margin: 40px !default;
+@mixin h5bp-normalize-lists {
+ ul, ol {
+ margin: 1em 0;
+ padding: 0 0 0 $list-left-margin;
+ }
+
+ dd { margin: 0 0 0 $list-left-margin; }
+
+ nav ul, nav ol {
+ list-style: none;
+ list-style-image: none;
+ margin: 0;
+ padding: 0;
+ }
+}
+
+// =============================================================================
+// Embedded content
+// =============================================================================
+@mixin h5bp-normalize-images {
+ // 1. Improve image quality when scaled in IE7: h5bp.com/d
+ // 2. Remove the gap between images and borders on image containers: h5bp.com/e
+
+ img {
+ border: 0;
+ -ms-interpolation-mode: bicubic;
+ vertical-align: middle;
+ }
+}
+
+@mixin h5bp-normalize-svg {
+ // Correct overflow not hidden in IE9
+
+ svg:not(:root) { overflow: hidden; }
+}
+
+// =============================================================================
+// Figures
+// =============================================================================
+@mixin h5bp-normalize-figures {
+ figure { margin: 0; }
+}
+
+// =============================================================================
+// Forms
+// =============================================================================
+@mixin h5bp-normalize-forms($list: false) {
+ form { margin: 0; }
+
+ fieldset { border: 0; margin: 0; padding: 0; }
+
+ // Indicate that 'label' will shift focus to the associated form element
+ label { cursor: pointer; }
+
+ // 1. Correct color not inheriting in IE6/7/8/9
+ // 2. Correct alignment displayed oddly in IE6/7
+
+ legend { border: 0; *margin-left: -7px; padding: 0; }
+
+ // 1. Correct font-size not inheriting in all browsers
+ // 2. Remove margins in FF3/4 S5 Chrome
+ // 3. Define consistent vertical alignment display in all browsers
+
+ button, input, select, textarea {
+ font-size: 100%;
+ margin: 0;
+ vertical-align: baseline;
+ *vertical-align: middle;
+ }
+
+ // 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet)
+ // 2. Correct inner spacing displayed oddly in IE6/7
+
+ button, input {
+ line-height: normal;
+ *overflow: visible;
+ }
+
+ // Reintroduce inner spacing in 'table' to avoid overlap and whitespace issues in IE6/7
+
+ table button, table input { *overflow: auto; }
+
+ // 1. Display hand cursor for clickable form elements
+ // 2. Allow styling of clickable form elements in iOS
+
+ button, input[type="button"], input[type="reset"], input[type="submit"] {
+ cursor: pointer;
+ -webkit-appearance: button;
+ }
+
+ // Consistent box sizing and appearance
+
+ input[type="checkbox"], input[type="radio"] {
+ box-sizing: border-box;
+ }
+ input[type="search"] {
+ -webkit-appearance: textfield;
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box;
+ box-sizing: content-box;
+ }
+ input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+ }
+
+ // Remove inner padding and border in FF3/4: h5bp.com/l
+
+ button::-moz-focus-inner, input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+ }
+
+ // 1. Remove default vertical scrollbar in IE6/7/8/9
+ // 2. Allow only vertical resizing
+
+ textarea {
+ overflow: auto;
+ vertical-align: top;
+ resize: vertical;
+ }
+
+ // Colors for form validity
+ input:valid, textarea:valid {}
+ input:invalid, textarea:invalid {
+ background-color: #f0dddd;
+ }
+}
+
+// =============================================================================
+// Tables
+// =============================================================================
+@mixin h5bp-normalize-tables {
+ table {
+ border-collapse: collapse;
+ border-spacing: 0;
+ }
+ td {
+ vertical-align: top;
+ }
+}
View
21 stylesheets/html5-boilerplate/_print.scss
@@ -0,0 +1,21 @@
+// ==|== print styles =======================================================
+// Print styles.
+// Inlined to avoid required HTTP connection: h5bp.com/r
+// ========================================================================== */
+
+@mixin html5-boilerplate-print {
+ @media print {
+ * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } /* Black prints faster: h5bp.com/s */
+ a, a:visited { text-decoration: underline; }
+ a[href]:after { content: " (" attr(href) ")"; }
+ abbr[title]:after { content: " (" attr(title) ")"; }
+ .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
+ pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
+ thead { display: table-header-group; } /* h5bp.com/t */
+ tr, img { page-break-inside: avoid; }
+ img { max-width: 100% !important; }
+ @page { margin: 0.5cm; }
+ p, h2, h3 { orphans: 3; widows: 3; }
+ h2, h3 { page-break-after: avoid; }
+ }
+}
View
43 stylesheets/html5-boilerplate/_reset.scss
@@ -1,43 +0,0 @@
-// html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
-// v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark
-// html5doctor.com/html-5-reset-stylesheet/
-
-@mixin html5-boilerplate-reset {
- html, body, div, span, object, iframe,
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
- abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
- small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
- fieldset, form, label, legend,
- table, caption, tbody, tfoot, thead, tr, th, td,
- article, aside, canvas, details, figcaption, figure,
- footer, header, hgroup, menu, nav, section, summary,
- time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- vertical-align: baseline;
- }
-
- article, aside, details, figcaption, figure,
- footer, header, hgroup, menu, nav, section {
- display: block;
- }
-
- blockquote, q { quotes: none; }
-
- blockquote:before, blockquote:after,
- q:before, q:after { content: ""; content: none; }
-
- ins { background-color: #ff9; color: #000; text-decoration: none; }
-
- mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
-
- del { text-decoration: line-through; }
-
- abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
-
- table { border-collapse: collapse; border-spacing: 0; }
-
- hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
-}
View
126 stylesheets/html5-boilerplate/_styles.scss
@@ -1,126 +0,0 @@
-$font-color: #444 !default; //looks better than black: twitter.com/H_FJ/statuses/11800719859
-$link-color: #607890 !default;
-$link-hover-color: #036 !default;
-$link-active-color: #607890 !default;
-$link-visited-color: #607890 !default;
-$selected-font-color: #fff !default;
-$selected-background-color: #ff5e99 !default;
-$list-left-margin: 1.8em !default;
-
-//
-// Minimal base styles
-//
-
-@mixin html5-boilerplate-styles {
- html { @include force-scrollbar; }
-
- ul, ol { margin-left: $list-left-margin; }
- ol { list-style-type: decimal; }
-
- td { vertical-align: top; }
-
- sub { @include sub; }
-
- sup { @include sup; }
-
- @include accessible-focus;
-
- @include quoted-pre;
-
- @include hand-cursor-inputs;
-
- @include reset-form-elements;
-
- @include selected-text;
-
- @include webkit-tap-highlight;
-
- @include ie-hacks;
-
- @include no-nav-margins;
-}
-
-// set sub, sup without affecting line-height: gist.github.com/413930
-@mixin sub{
- font-size: 75%; line-height: 0; position: relative; bottom: -0.25em;
-}
-@mixin sup{
- font-size: 75%; line-height: 0; position: relative; top: -0.5em;
-}
-
-// accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test
-@mixin accessible-focus {
- a:hover, a:active { outline: none; }
-}
-
-// www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap
-@mixin quoted-pre {
- pre {
- white-space: pre; white-space: pre-wrap; word-wrap: break-word;
- padding: 15px;
- }
-}
-
-// Align checkboxes, radios, text inputs with their label by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css
-@mixin align-input-labels {
- @warn "The 'align-input-labels' mixin has been deprecated.";
-}
-
-// Hand cursor on clickable input elements
-@mixin hand-cursor-inputs {
- label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
-}
-
-@mixin reset-form-elements {
- // 1) Make inputs and buttons play nice in IE: www.viget.com/inspire/styling-the-button-element-in-internet-explorer/
- // 2) WebKit browsers add a 2px margin outside the chrome of form elements.
- // Firefox adds a 1px margin above and below textareas
- // 3) Set font-size to match <body>'s, and font-family to sans-serif
- // 4) Align to baseline
- button, input, select, textarea { width: auto; overflow: visible; margin: 0; font-size: 100%; font-family: sans-serif; vertical-align: baseline; }
-
- // 1) Remove default scrollbar in IE: www.sitepoint.com/blogs/2010/08/20/ie-remove-textarea-scrollbars/
- // 2) Align to text-top
- textarea { overflow: auto; vertical-align: text-top; }
-
- // Remove extra padding and inner border in Firefox
- input::-moz-focus-inner,
- button::-moz-focus-inner { border: 0; padding: 0; }
-}
-
-@mixin webkit-reset-form-elements {
- @warn "The 'webkit-reset-form-elements' mixin has been deprecated. Use 'reset-form-elements' instead.";
-}
-
-// These selection declarations have to be separate.
-// No text-shadow: twitter.com/miketaylr/status/12228805301
-// Also: hot pink!
-@mixin selected-text {
- ::-moz-selection{ background:$selected-background-color; color: $selected-font-color; text-shadow: none; }
- ::selection { background: $selected-background-color; color: $selected-font-color; text-shadow: none; }
-}
-
-// j.mp/webkit-tap-highlight-color
-@mixin webkit-tap-highlight {
- a:link { -webkit-tap-highlight-color: $selected-background-color; }
-}
-
-// 1) Always force a scrollbar in non-IE
-// 2) Remove iOS text size adjust without disabling user zoom:
-// www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
-@mixin force-scrollbar {
- overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%;
-}
-
-@mixin ie-hacks {
- // Bicubic resizing for non-native sized IMG:
- // code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
- .ie7 img { -ms-interpolation-mode: bicubic; }
-
- .ie6 legend, .ie7 legend { margin-left: -7px; }
-}
-
-@mixin no-nav-margins {
- // remove margins for navigation lists
- nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
-}
View
13 templates/project/_head.html.haml
@@ -1,7 +1,8 @@
%meta{ :charset => "utf-8" }/
--# Always force latest IE rendering engine (even in intranet) & Chrome Frame
--# Remove this if you use the .htaccess
+-#
+ Use the .htaccess and remove these lines to avoid edge case issues.
+ More info: h5bp.com/b/378
%meta{ "http-equiv" => "X-UA-Compatible", :content => "IE=edge,chrome=1" }/
%title
@@ -19,8 +20,10 @@
- if local_assigns[:stylesheet_partial]
= render :partial => local_assigns[:stylesheet_partial]
--# All JavaScript at the bottom, except for Modernizr and Respond.
--# Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
-= javascript_include_tag 'modernizr.min', 'respond.min'
+-#
+ All JavaScript at the bottom, except for Modernizr / Respond.
+ Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
+ For optimal performance, use a custom Modernizr build: www.modernizr.com/download/
+= javascript_include_tag 'modernizr.min'
= csrf_meta_tag
View
15 templates/project/_javascripts.html.haml
@@ -4,9 +4,9 @@
- if !google_api_key.blank?
= javascript_include_tag "//www.google.com/jsapi?key=#{google_api_key}"
:javascript
- google.load(#{ remote_jquery("1.6") });
+ google.load(#{ remote_jquery("1.6.2") });
- else
- = javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/#{ local_jquery("1.6") }"
+ = javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/#{ local_jquery("1.6.2") }"
-# fall back to local jQuery if necessary
:javascript
@@ -24,4 +24,13 @@
var _gaq=[["_setAccount","#{google_account_id}"],["_trackPageview"],["_trackPageLoadTime"]];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
- s.parentNode.insertBefore(g,s)}(document,"script"));
+ s.parentNode.insertBefore(g,s)}(document,"script"));
+
+-#
+ Prompt IE 6 users to install Chrome Frame. Remove this if you want to support IE 6.
+ chromium.org/developers/how-tos/chrome-frame-getting-started
+
+<!--[if lt IE 7]>
+ <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
+ <script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
+<![endif]-->
View
2  templates/project/_stylesheets.html.haml
@@ -1,5 +1,5 @@
-# CSS: implied media="all"
-= stylesheet_link_tag 'style', :media => 'all'
+= stylesheet_link_tag 'style'
-# Append your own using content_for :stylesheets
= yield :stylesheets
View
2  templates/project/application.html.haml
@@ -1,6 +1,6 @@
!!! 5
-# http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither
--ie_html :class => 'no-js', :lang => 'en' do
+-ie_html :class => 'no-js oldie', :lang => 'en' do
%head
-# To render a different stylesheet partial inside the head (i.e. for admin layout)
-# just copy _stylesheets.html.haml, and point to that partial instead.
View
BIN  templates/project/files/apple-touch-icon-114x114-precomposed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  templates/project/files/apple-touch-icon-57x57-precomposed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  templates/project/files/apple-touch-icon-72x72-precomposed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  templates/project/files/apple-touch-icon-precomposed.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  templates/project/files/apple-touch-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
245 templates/project/files/htaccess
@@ -25,18 +25,12 @@
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
-<IfModule mod_setenvif.c>
- <IfModule mod_headers.c>
- BrowserMatch MSIE ie
- Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
- </IfModule>
-</IfModule>
-
<IfModule mod_headers.c>
-# Because X-UA-Compatible isn't sent to non-IE (to save header bytes),
-# We need to inform proxies that content changes based on UA
- Header append Vary User-Agent
-# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
+ Header set X-UA-Compatible "IE=Edge,chrome=1"
+ # mod_headers can't match by content-type, but we don't want to send this header on *everything*...
+ <FilesMatch "\.(js|css|gif|png|jpe?g|pdf|xml|oga|ogg|m4a|ogv|mp4|m4v|webm|svg|svgz|eot|ttf|otf|woff|ico|webp|appcache|manifest|htc|crx|xpi|safariextz|vcf)$" >
+ Header unset X-UA-Compatible
+ </FilesMatch>
</IfModule>
@@ -58,11 +52,11 @@
# Webfont access
# ----------------------------------------------------------------------
-# allow access from all domains for webfonts
-# alternatively you could only whitelist
-# your subdomains like "sub.domain.com"
+# Allow access from all domains for webfonts.
+# Alternatively you could only whitelist your
+# subdomains like "subdomain.example.com".
-<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
+<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
@@ -74,26 +68,34 @@
# Proper MIME type for all files
# ----------------------------------------------------------------------
-# audio
+
+# JavaScript
+# Normalize to standard type (it's sniffed in IE anyways)
+# tools.ietf.org/html/rfc4329#section-7.2
+AddType application/javascript js
+
+# Audio
AddType audio/ogg oga ogg
+AddType audio/mp4 m4a
-# video
+# Video
AddType video/ogg ogv
-AddType video/mp4 mp4
+AddType video/mp4 mp4 m4v
AddType video/webm webm
-# Proper svg serving. Required for svg webfonts on iPad
+# SVG.
+# Required for svg webfonts on iPad
# twitter.com/FontSquirrel/status/14855840545
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
-# webfonts
+# Webfonts
AddType application/vnd.ms-fontobject eot
-AddType font/truetype ttf
+AddType application/x-font-ttf ttf ttc
AddType font/opentype otf
AddType application/x-font-woff woff
-# assorted types
+# Assorted types
AddType image/x-icon ico
AddType image/webp webp
AddType text/cache-manifest appcache manifest
@@ -101,6 +103,7 @@ AddType text/x-component htc
AddType application/x-chrome-extension crx
AddType application/x-xpinstall xpi
AddType application/octet-stream safariextz
+AddType text/x-vcard vcf
@@ -111,54 +114,69 @@ AddType application/octet-stream safariextz
# e.g. Inside of script.combined.js you could have
# <!--#include file="libs/jquery-1.5.0.min.js" -->
# <!--#include file="plugins/jquery.idletimer.js" -->
-# and they would be included into this single file
+# and they would be included into this single file.
-# this is not in use in the boilerplate as it stands. you may
-# choose to name your files in this way for this advantage
-# or concatenate and minify them manually.
+# This is not in use in the boilerplate as it stands. You may
+# choose to name your files in this way for this advantage or
+# concatenate and minify them manually.
# Disabled by default.
-# <FilesMatch "\.combined\.(js|css)$">
-# Options +Includes
-# SetOutputFilter INCLUDES
-# </FilesMatch>
-
+#<FilesMatch "\.combined\.js$">
+# Options +Includes
+# AddOutputFilterByType INCLUDES application/javascript application/json
+# SetOutputFilter INCLUDES
+#</FilesMatch>
+#<FilesMatch "\.combined\.css$">
+# Options +Includes
+# AddOutputFilterByType INCLUDES text/css
+# SetOutputFilter INCLUDES
+#</FilesMatch>
# ----------------------------------------------------------------------
-# gzip compression
+# Gzip compression
# ----------------------------------------------------------------------
<IfModule mod_deflate.c>
-
-# force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
+# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
- SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s,?\s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding
+ SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
-# html, txt, css, js, json, xml, htc:
+
+# HTML, TXT, CSS, JavaScript, JSON, XML, HTC:
<IfModule filter_module>
FilterDeclare COMPRESS
- FilterProvider COMPRESS DEFLATE resp=Content-Type /text/(html|css|javascript|plain|x(ml|-component))/
- FilterProvider COMPRESS DEFLATE resp=Content-Type /application/(javascript|json|xml|x-javascript)/
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
+ FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
FilterChain COMPRESS
- FilterProtocol COMPRESS change=yes;byteranges=no
+ FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no
</IfModule>
<IfModule !mod_filter.c>
# Legacy versions of Apache
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
- AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
+ AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
+ AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
+ AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</IfModule>
-
-# webfonts and svg:
- <FilesMatch "\.(ttf|otf|eot|svg)$" >
- SetOutputFilter DEFLATE
- </FilesMatch>
</IfModule>
@@ -167,14 +185,14 @@ AddType application/octet-stream safariextz
# Expires headers (for better cache control)
# ----------------------------------------------------------------------
-# these are pretty far-future expires headers
-# they assume you control versioning with cachebusting query params like
+# These are pretty far-future expires headers.
+# They assume you control versioning with cachebusting query params like
# <script src="application.js?20100608">
-# additionally, consider that outdated proxies may miscache
+# Additionally, consider that outdated proxies may miscache
# www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
-# if you don't use filenames to version, lower the css and js to something like
-# "access plus 1 week" or so
+# If you don't use filenames to version, lower the CSS and JS to something like
+# "access plus 1 week" or so.
<IfModule mod_expires.c>
ExpiresActive on
@@ -182,24 +200,25 @@ AddType application/octet-stream safariextz
# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault "access plus 1 month"
-# cache.appcache needs re-requests in FF 3.6 (thx Remy ~Introducing HTML5)
+# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest "access plus 0 seconds"
-# your document html
+# Your document html
ExpiresByType text/html "access plus 0 seconds"
-# data
+# Data
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType application/json "access plus 0 seconds"
-# rss feed
+# Feed
ExpiresByType application/rss+xml "access plus 1 hour"
+ ExpiresByType application/atom+xml "access plus 1 hour"
-# favicon (cannot be renamed)
+# Favicon (cannot be renamed)
ExpiresByType image/x-icon "access plus 1 week"
-# media: images, video, audio
+# Media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
@@ -209,20 +228,19 @@ AddType application/octet-stream safariextz
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
-# htc files (css3pie)
+# HTC files (css3pie)
ExpiresByType text/x-component "access plus 1 month"
-# webfonts
+# Webfonts
ExpiresByType font/truetype "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
-# css and javascript
- ExpiresByType text/css "access plus 2 months"
- ExpiresByType application/javascript "access plus 2 months"
- ExpiresByType text/javascript "access plus 2 months"
+# CSS and JavaScript
+ ExpiresByType text/css "access plus 1 year"
+ ExpiresByType application/javascript "access plus 1 year"
<IfModule mod_headers.c>
Header append Cache-Control "public"
@@ -236,6 +254,11 @@ AddType application/octet-stream safariextz
# ETag removal
# ----------------------------------------------------------------------
+# FileETag None is not enough for every server.
+<IfModule mod_headers.c>
+ Header unset ETag
+</IfModule>
+
# Since we're sending far-future expires, we don't need ETags for
# static content.
# developer.yahoo.com/performance/rules.html#etags
@@ -278,8 +301,10 @@ FileETag None
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and features.
+# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
+ Options +FollowSymlinks
RewriteEngine On
</IfModule>
@@ -303,66 +328,30 @@ FileETag None
# ----------------------------------------------------------------------
# Option 1:
-# Rewrite "www.domain.com -> domain.com"
+# Rewrite "www.example.com -> example.com"
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
- RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
+ RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>
# ----------------------------------------------------------------------
# Option 2:
-# To rewrite "domain.com -> www.domain.com" uncomment the following lines.
+# To rewrite "example.com -> www.example.com" uncomment the following lines.
# Be aware that the following rule might not be a good idea if you
# use "real" subdomains for certain parts of your website.
# <IfModule mod_rewrite.c>
# RewriteCond %{HTTPS} !=on
# RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
-# RewriteCond %{HTTP_HOST} (.+)$ [NC]
-# RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
+# RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# </IfModule>
# ----------------------------------------------------------------------
-# Add/remove trailing slash to (non-file) URLs
-# ----------------------------------------------------------------------
-
-# Google treats URLs with and without trailing slashes separately.
-# Forcing a trailing slash is usually preferred, but all that's really
-# important is that one correctly redirects to the other.
-
-# By default option 1 (force trailing slash) is activated.
-# http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html
-# http://www.alistapart.com/articles/slashforward/
-# http://httpd.apache.org/docs/2.0/misc/rewriteguide.html#url Trailing Slash Problem
-
-# ----------------------------------------------------------------------
-
-# Option 1:
-# Rewrite "domain.com/foo -> domain.com/foo/"
-
-#<IfModule mod_rewrite.c>
-# RewriteCond %{REQUEST_FILENAME} !-f
-# RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/|#(.*))$
-# RewriteRule ^(.*)$ /$1/ [R=301,L]
-#</IfModule>
-
-# ----------------------------------------------------------------------
-
-# Option 2:
-# Rewrite "domain.com/foo/ -> domain.com/foo"
-
-#<IfModule mod_rewrite.c>
-# RewriteRule ^(.*)/$ /$1 [R=301,L]
-#</IfModule>
-
-
-
-# ----------------------------------------------------------------------
# Built-in filename-based cache busting
# ----------------------------------------------------------------------
@@ -387,12 +376,12 @@ FileETag None
# ----------------------------------------------------------------------
# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent
-# https://www.domain.com when your cert only allows https://secure.domain.com
+# https://www.example.com when your cert only allows https://secure.example.com
# Uncomment the following lines to use this feature.
# <IfModule mod_rewrite.c>
# RewriteCond %{SERVER_PORT} !^443
-# RewriteRule (.*) https://example-domain-please-change-me.com/$1 [R=301,L]
+# RewriteRule ^ https://example-domain-please-change-me.com%{REQUEST_URI} [R=301,L]
# </IfModule>
@@ -409,7 +398,7 @@ Options -MultiViews
# ----------------------------------------------------------------------
-# custom 404 page
+# Custom 404 page
# ----------------------------------------------------------------------
# You can add custom pages to handle 500 or 403 pretty easily, if you like.
@@ -421,11 +410,11 @@ ErrorDocument 404 /404.html
# UTF-8 encoding
# ----------------------------------------------------------------------
-# use utf-8 encoding for anything served text/plain or text/html
+# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8
-# force utf-8 for a number of file formats
-AddCharset utf-8 .html .css .js .xml .json .rss
+# Force UTF-8 for a number of file formats
+AddCharset utf-8 .html .css .js .xml .json .rss .atom
@@ -470,9 +459,45 @@ Options -Indexes
# php_flag register_globals Off
+# Rename session cookie to something else, than PHPSESSID
+# php_value session.name sid
+
+# Do not show you are using PHP
+# Note: Move this line to php.ini since it won't work in .htaccess
+# php_flag expose_php Off
+
+# Level of log detail - log all errors
+# php_value error_reporting -1
+
+# Write errors to log file
+# php_flag log_errors On
+
+# Do not display errors in browser (production - Off, development - On)
+# php_flag display_errors Off
+
+# Do not display startup errors (production - Off, development - On)
+# php_flag display_startup_errors Off
+
+# Format errors in plain text
+# Note: Leave this setting 'On' for xdebug's var_dump() output
+# php_flag html_errors Off
+
+# Show multiple occurrence of error
+# php_flag ignore_repeated_errors Off
+
+# Show same errors from different sources
+# php_flag ignore_repeated_source Off
+
+# Size limit for error messages
+# php_value log_errors_max_len 1024
+
+# Don't precede error with string (doesn't accept empty string, use whitespace if you need)
+# php_value error_prepend_string " "
+
+# Don't prepend to error (doesn't accept empty string, use whitespace if you need)
+# php_value error_append_string " "
# Increase cookie security
<IfModule php5_module>
-php_value session.cookie_httponly true
+ php_value session.cookie_httponly true
</IfModule>
-
View
8 templates/project/handheld.scss
@@ -1,8 +0,0 @@
-* {
- float: none; // Screens are not big enough to account for floats
- background: #fff; // As much contrast as possible */
- color: #000;
-}
-
-// Slightly reducing font size to reduce need to scroll
-body { font-size: 80%; }
View
48 templates/project/index.html.haml
@@ -1,16 +1,18 @@
!!! 5
-# paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
-<!--[if lt IE 7]> <html lang="en" class="no-js ie6"> <![endif]-->
-<!--[if IE 7]> <html lang="en" class="no-js ie7"> <![endif]-->
-<!--[if IE 8]> <html lang="en" class="no-js ie8"> <![endif]-->
+<!--[if lt IE 7]> <html lang="en" class="no-js ie6 oldie"> <![endif]-->
+<!--[if IE 7]> <html lang="en" class="no-js ie7 oldie"> <![endif]-->
+<!--[if IE 8]> <html lang="en" class="no-js ie8 oldie"> <![endif]-->
+-# Consider adding an manifest.appcache: h5bp.com/d/Offline
<!--[if gt IE 8]><!-->
%html.no-js{ :lang => "en" }
<!--<![endif]-->
%head
%meta{ :charset => "utf-8" }/
- -# Always force latest IE rendering engine (even in intranet) & Chrome Frame
- -# Remove this if you use the .htaccess
+ -#
+ Use the .htaccess and remove these lines to avoid edge case issues.
+ More info: h5bp.com/b/378
%meta{ "http-equiv" => "X-UA-Compatible", :content => "IE=edge,chrome=1" }/
%title
@@ -23,28 +25,33 @@
-# Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons
-# CSS: implied media="all"
- %link{ :href => "css/style.css?v=1", :media => "all", :rel => "stylesheet" }/
+ -# CSS concatenated and minified via ant build script
+ %link{ :rel => "stylesheet", :href => "css/style.css"}/
- -# All JavaScript at the bottom, except for Modernizr and Respond.
- -# Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
- %script{ :src => "js/modernizr.min.js" }
- %script{ :src => "js/respond.min.js" }
+ -#
+ All JavaScript at the bottom, except for Modernizr / Respond.
+ Modernizr enables HTML5 elements & feature detects; Respond is a polyfill for min/max-width CSS3 Media Queries
+ For optimal performance, use a custom Modernizr build: www.modernizr.com/download/
+ %script{ :src => "js/modernizr-2.0.6.min.js" }
%body
#container
%header
#main{ :role => 'main' }
%footer
-
- -#
- Javascript at the bottom for fast page loading
- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if necessary
+ -# end of #container
+
+ -# Javascript at the bottom for fast page loading
+
+ -# Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline
%script{ :src => "//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.js" }
:javascript
window.jQuery || document.write("<script src='js/jquery.min.js'>\x3C/script>")
- %script{ :src => "js/plugins.js?v=1" }
- %script{ :src => "js/script.js?v=1" }
+ -# scripts concatenated and minified via ant build script
+ %script{ :src => "js/plugins.js" }
+ %script{ :src => "js/script.js" }
+ -# end scripts
-# asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet
-# change the UA-XXXXX-X to be your site's ID
@@ -53,3 +60,12 @@
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
s.parentNode.insertBefore(g,s)}(document,"script"));
+
+ -#
+ Prompt IE 6 users to install Chrome Frame. Remove this if you want to support IE 6.
+ chromium.org/developers/how-tos/chrome-frame-getting-started
+
+ <!--[if lt IE 7]>
+ <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
+ <script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
+ <![endif]-->
View
622 templates/project/javascripts/jquery-1.6.js → templates/project/javascripts/jquery-1.6.2.js
@@ -1,5 +1,5 @@
/*!
- * jQuery JavaScript Library v1.6
+ * jQuery JavaScript Library v1.6.2
* http://jquery.com/
*
* Copyright 2011, John Resig
@@ -11,7 +11,7 @@
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
- * Date: Mon May 2 13:50:00 2011 -0400
+ * Date: Thu Jun 30 14:16:56 2011 -0400
*/
(function( window, undefined ) {
@@ -65,6 +65,14 @@ var jQuery = function( selector, context ) {
rmsie = /(msie) ([\w.]+)/,
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+ // Matches dashed string for camelizing
+ rdashAlpha = /-([a-z])/ig,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ },
+
// Keep a UserAgent string for use with jQuery.browser
userAgent = navigator.userAgent,
@@ -204,7 +212,7 @@ jQuery.fn = jQuery.prototype = {
selector: "",
// The current version of jQuery being used
- jquery: "1.6",
+ jquery: "1.6.2",
// The default length of a jQuery object is 0
length: 0,
@@ -603,6 +611,12 @@ jQuery.extend({
}
},
+ // Converts a dashed string to camelCased string;
+ // Used by both the css and data modules
+ camelCase: function( string ) {
+ return string.replace( rdashAlpha, fcamelCase );
+ },
+
nodeName: function( elem, name ) {
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
},
@@ -799,7 +813,7 @@ jQuery.extend({
},
// Mutifunctional method to get and set values to a collection
- // The value/s can be optionally by executed if its a function
+ // The value/s can optionally be executed if it's a function
access: function( elems, key, value, exec, fn, pass ) {
var length = elems.length;
@@ -930,7 +944,6 @@ function doScrollCheck() {
jQuery.ready();
}
-// Expose jQuery to the global object
return jQuery;
})();
@@ -1055,7 +1068,7 @@ jQuery.extend({
if ( jQuery.isFunction( fn ) ) {
deferred[ handler ](function() {
returned = fn.apply( this, arguments );
- if ( jQuery.isFunction( returned.promise ) ) {
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise().then( newDefer.resolve, newDefer.reject );
} else {
newDefer[ action ]( returned );
@@ -1137,6 +1150,7 @@ jQuery.extend({
jQuery.support = (function() {
var div = document.createElement( "div" ),
+ documentElement = document.documentElement,
all,
a,
select,
@@ -1146,7 +1160,9 @@ jQuery.support = (function() {
support,
fragment,
body,
- bodyStyle,
+ testElementParent,
+ testElement,
+ testElementStyle,
tds,
events,
eventName,
@@ -1240,11 +1256,10 @@ jQuery.support = (function() {
}
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
- div.attachEvent( "onclick", function click() {
+ div.attachEvent( "onclick", function() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
support.noCloneEvent = false;
- div.detachEvent( "onclick", click );
});
div.cloneNode( true ).fireEvent( "onclick" );
}
@@ -1269,22 +1284,30 @@ jQuery.support = (function() {
// Figure out if the W3C box model works as expected
div.style.width = div.style.paddingLeft = "1px";
- // We use our own, invisible, body
- body = document.createElement( "body" );
- bodyStyle = {
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ // We use our own, invisible, body unless the body is already present
+ // in which case we use a div (#9239)
+ testElement = document.createElement( body ? "div" : "body" );
+ testElementStyle = {
visibility: "hidden",
width: 0,
height: 0,
border: 0,
- margin: 0,
- // Set background to avoid IE crashes when removing (#9028)
- background: "none"
+ margin: 0
};
- for ( i in bodyStyle ) {
- body.style[ i ] = bodyStyle[ i ];
+ if ( body ) {
+ jQuery.extend( testElementStyle, {
+ position: "absolute",
+ left: -1000,
+ top: -1000
+ });
+ }
+ for ( i in testElementStyle ) {
+ testElement.style[ i ] = testElementStyle[ i ];
}
- body.appendChild( div );
- document.documentElement.appendChild( body );
+ testElement.appendChild( div );
+ testElementParent = body || documentElement;
+ testElementParent.insertBefore( testElement, testElementParent.firstChild );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
@@ -1339,12 +1362,12 @@ jQuery.support = (function() {
marginDiv.style.marginRight = "0";
div.appendChild( marginDiv );
support.reliableMarginRight =
- ( parseInt( document.defaultView.getComputedStyle( marginDiv, null ).marginRight, 10 ) || 0 ) === 0;
+ ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
}
// Remove the body element we added
- body.innerHTML = "";
- document.documentElement.removeChild( body );
+ testElement.innerHTML = "";
+ testElementParent.removeChild( testElement );
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
@@ -1368,6 +1391,9 @@ jQuery.support = (function() {
}
}
+ // Null connected elements to avoid leaks in IE
+ testElement = fragment = select = opt = body = marginDiv = div = input = null;
+
return support;
})();
@@ -1475,7 +1501,7 @@ jQuery.extend({
}
if ( data !== undefined ) {
- thisCache[ name ] = data;
+ thisCache[ jQuery.camelCase( name ) ] = data;
}
// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
@@ -1485,7 +1511,10 @@ jQuery.extend({
return thisCache[ internalKey ] && thisCache[ internalKey ].events;
}
- return getByName ? thisCache[ name ] : thisCache;
+ return getByName ?
+ // Check for both converted-to-camel and non-converted data property names
+ thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] :
+ thisCache;
},
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
@@ -1661,7 +1690,7 @@ function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
- name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
+ var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
data = elem.getAttribute( name );
@@ -1850,7 +1879,8 @@ jQuery.fn.extend({
count = 1,
deferDataKey = type + "defer",
queueDataKey = type + "queue",
- markDataKey = type + "mark";
+ markDataKey = type + "mark",
+ tmp;
function resolve() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
@@ -1879,9 +1909,9 @@ var rclass = /[\n\t\r]/g,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea)?$/i,
- rspecial = /^(?:data-|aria-)/,
- rinvalidChar = /\:/,
- formHook;
+ rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
+ rinvalidChar = /\:|^on/,
+ formHook, boolHook;
jQuery.fn.extend({
attr: function( name, value ) {
@@ -1899,6 +1929,7 @@ jQuery.fn.extend({
},
removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
return this.each(function() {
// try/catch handles cases where IE balks (such as removing a property on window)
try {
@@ -1909,30 +1940,31 @@ jQuery.fn.extend({
},
addClass: function( value ) {
+ var classNames, i, l, elem,
+ setClass, c, cl;
+
if ( jQuery.isFunction( value ) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.addClass( value.call(this, i, self.attr("class") || "") );
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call(this, j, this.className) );
});
}
if ( value && typeof value === "string" ) {
- var classNames = (value || "").split( rspace );
+ classNames = value.split( rspace );
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var elem = this[i];
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
if ( elem.nodeType === 1 ) {
- if ( !elem.className ) {
+ if ( !elem.className && classNames.length === 1 ) {
elem.className = value;
} else {
- var className = " " + elem.className + " ",
- setClass = elem.className;
+ setClass = " " + elem.className + " ";
- for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
- setClass += " " + classNames[c];
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
+ setClass += classNames[ c ] + " ";
}
}
elem.className = jQuery.trim( setClass );
@@ -1945,24 +1977,25 @@ jQuery.fn.extend({
},
removeClass: function( value ) {
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.removeClass( value.call(this, i, self.attr("class")) );
+ var classNames, i, l, elem, className, c, cl;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call(this, j, this.className) );
});
}
if ( (value && typeof value === "string") || value === undefined ) {
- var classNames = (value || "").split( rspace );
+ classNames = (value || "").split( rspace );
- for ( var i = 0, l = this.length; i < l; i++ ) {
- var elem = this[i];
+ for ( i = 0, l = this.length; i < l; i++ ) {
+ elem = this[ i ];
if ( elem.nodeType === 1 && elem.className ) {
if ( value ) {
- var className = (" " + elem.className + " ").replace(rclass, " ");
- for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
- className = className.replace(" " + classNames[c] + " ", " ");
+ className = (" " + elem.className + " ").replace( rclass, " " );
+ for ( c = 0, cl = classNames.length; c < cl; c++ ) {
+ className = className.replace(" " + classNames[ c ] + " ", " ");
}
elem.className = jQuery.trim( className );
@@ -1981,9 +2014,8 @@ jQuery.fn.extend({
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
@@ -2037,7 +2069,13 @@ jQuery.fn.extend({
return ret;
}
- return (elem.value || "").replace(rreturn, "");
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
}
return undefined;
@@ -2072,7 +2110,7 @@ jQuery.fn.extend({
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
// If set returns undefined, fall back to normal setting
- if ( !hooks || ("set" in hooks && hooks.set( this, val, "value" ) === undefined) ) {
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
});
@@ -2091,7 +2129,8 @@ jQuery.extend({
},
select: {
get: function( elem ) {
- var index = elem.selectedIndex,
+ var value,
+ index = elem.selectedIndex,
values = [],
options = elem.options,
one = elem.type === "select-one";
@@ -2158,8 +2197,7 @@ jQuery.extend({
attrFix: {
// Always normalize to ensure hook usage
- tabindex: "tabIndex",
- readonly: "readOnly"
+ tabindex: "tabIndex"
},
attr: function( elem, name, value, pass ) {
@@ -2173,23 +2211,39 @@ jQuery.extend({
if ( pass && name in jQuery.attrFn ) {
return jQuery( elem )[ name ]( value );
}
-
+
+ // Fallback to prop when attributes are not supported
+ if ( !("getAttribute" in elem) ) {
+ return jQuery.prop( elem, name, value );
+ }
+
var ret, hooks,
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
+
// Normalize the name if needed
- name = notxml && jQuery.attrFix[ name ] || name;
+ if ( notxml ) {
+ name = jQuery.attrFix[ name ] || name;
+
+ hooks = jQuery.attrHooks[ name ];
- // Get the appropriate hook, or the formHook
- // if getSetAttribute is not supported and we have form objects in IE6/7
- hooks = jQuery.attrHooks[ name ] ||
- ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ?
- formHook :
- undefined );
+ if ( !hooks ) {
+ // Use boolHook for boolean attributes
+ if ( rboolean.test( name ) ) {
+
+ hooks = boolHook;
+
+ // Use formHook for forms and if the name contains certain characters
+ } else if ( formHook && name !== "className" &&
+ (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
+
+ hooks = formHook;
+ }
+ }
+ }
if ( value !== undefined ) {
- if ( value === null || (value === false && !rspecial.test( name )) ) {
+ if ( value === null ) {
jQuery.removeAttr( elem, name );
return undefined;
@@ -2197,34 +2251,26 @@ jQuery.extend({
return ret;
} else {
-
- // Set boolean attributes to the same name
- if ( value === true && !rspecial.test( name ) ) {
- value = name;
- }
-
elem.setAttribute( name, "" + value );
return value;
}
- } else {
-
- if ( hooks && "get" in hooks && notxml ) {
- return hooks.get( elem, name );
+ } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
- } else {
+ } else {
- ret = elem.getAttribute( name );
+ ret = elem.getAttribute( name );
- // Non-existent attributes return null, we normalize to undefined
- return ret === null ?
- undefined :
- ret;
- }
+ // Non-existent attributes return null, we normalize to undefined
+ return ret === null ?
+ undefined :
+ ret;
}
},
-
+
removeAttr: function( elem, name ) {
+ var propName;
if ( elem.nodeType === 1 ) {
name = jQuery.attrFix[ name ] || name;
@@ -2235,6 +2281,11 @@ jQuery.extend({
jQuery.attr( elem, name, "" );
elem.removeAttributeNode( elem.getAttributeNode( name ) );
}
+
+ // Set corresponding property to false for boolean attributes
+ if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
+ elem[ propName ] = false;
+ }
}
},
@@ -2248,7 +2299,7 @@ jQuery.extend({
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to it's default in case type is set after value
// This is for element creation
- var val = elem.getAttribute("value");
+ var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
@@ -2269,39 +2320,72 @@ jQuery.extend({
0 :
undefined;
}
+ },
+ // Use the value property for back compat
+ // Use the formHook for button elements in IE6/7 (#1954)
+ value: {
+ get: function( elem, name ) {
+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+ return formHook.get( elem, name );
+ }
+ return name in elem ?
+ elem.value :
+ null;
+ },
+ set: function( elem, value, name ) {
+ if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+ return formHook.set( elem, value, name );
+ }
+ // Does not return so that setAttribute is also used
+ elem.value = value;
+ }
}
},
-
- propFix: {},
+
+ propFix: {
+ tabindex: "tabIndex",
+ readonly: "readOnly",
+ "for": "htmlFor",
+ "class": "className",
+ maxlength: "maxLength",
+ cellspacing: "cellSpacing",
+ cellpadding: "cellPadding",
+ rowspan: "rowSpan",
+ colspan: "colSpan",
+ usemap: "useMap",
+ frameborder: "frameBorder",
+ contenteditable: "contentEditable"
+ },
prop: function( elem, name, value ) {
var nType = elem.nodeType;
-
+
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return undefined;
}
-
+
var ret, hooks,
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- // Try to normalize/fix the name
- name = notxml && jQuery.propFix[ name ] || name;
-
- hooks = jQuery.propHooks[ name ];
-
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
if ( value !== undefined ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
-
+
} else {
return (elem[ name ] = value);
}
-
+
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
return ret;
-
+
} else {
return elem[ name ];
}
@@ -2311,30 +2395,47 @@ jQuery.extend({
propHooks: {}
});
+// Hook for boolean attributes
+boolHook = {
+ get: function( elem, name ) {
+ // Align boolean attributes with corresponding properties
+ return jQuery.prop( elem, name ) ?
+ name.toLowerCase() :
+ undefined;
+ },
+ set: function( elem, value, name ) {
+ var propName;
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ // value is true since we know at this point it's type boolean and not false
+ // Set boolean attributes to the same name and set the DOM property
+ propName = jQuery.propFix[ name ] || name;
+ if ( propName in elem ) {
+ // Only set the IDL specifically if it already exists on the element
+ elem[ propName ] = true;
+ }
+
+ elem.setAttribute( name, name.toLowerCase() );
+ }
+ return name;
+ }
+};
+
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !jQuery.support.getSetAttribute ) {
- jQuery.attrFix = jQuery.extend( jQuery.attrFix, {
- "for": "htmlFor",
- "class": "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder"
- });
+
+ // propFix is more comprehensive and contains all fixes
+ jQuery.attrFix = jQuery.propFix;
// Use this for any attribute on a form in IE6/7
- formHook = jQuery.attrHooks.name = jQuery.attrHooks.value = jQuery.valHooks.button = {
+ formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret;
- if ( name === "value" && !jQuery.nodeName( elem, "button" ) ) {
- return elem.getAttribute( name );
- }
ret = elem.getAttributeNode( name );
- // Return undefined if not specified instead of empty string
- return ret && ret.specified ?
+ // Return undefined if nodeValue is empty string
+ return ret && ret.nodeValue !== "" ?
ret.nodeValue :
undefined;
},
@@ -2432,8 +2533,7 @@ jQuery.each([ "radio", "checkbox" ], function() {
-var hasOwn = Object.prototype.hasOwnProperty,
- rnamespaces = /\.(.*)$/,
+var rnamespaces = /\.(.*)$/,
rformElems = /^(?:textarea|input|select)$/i,
rperiod = /\./g,
rspaces = / /g,
@@ -2777,7 +2877,7 @@ jQuery.event = {
event.target = elem;
// Clone any incoming data and prepend the event, creating the handler arg list
- data = data ? jQuery.makeArray( data ) : [];
+ data = data != null ? jQuery.makeArray( data ) : [];
data.unshift( event );
var cur = elem,
@@ -3083,33 +3183,27 @@ jQuery.Event.prototype = {
// Checks if an event happened on an element within another element
// Used in jQuery.event.special.mouseenter and mouseleave handlers
var withinElement = function( event ) {
+
// Check if mouse(over|out) are still within the same parent element
- var parent = event.relatedTarget;
+ var related = event.relatedTarget,
+ inside = false,
+ eventType = event.type;
- // Firefox sometimes assigns relatedTarget a XUL element
- // which we cannot access the parentNode property of
- try {
+ event.type = event.data;
- // Chrome does something similar, the parentNode property
- // can be accessed but is null.
- if ( parent && parent !== document && !parent.parentNode ) {
- return;
- }
- // Traverse up the tree
- while ( parent && parent !== this ) {
- parent = parent.parentNode;
+ if ( related !== this ) {
+
+ if ( related ) {
+ inside = jQuery.contains( this, related );
}
- if ( parent !== this ) {
- // set the correct event type
- event.type = event.data;
+ if ( !inside ) {
- // handle event if we actually just moused on to a non sub-element
jQuery.event.handle.apply( this, arguments );
- }
- // assuming we've left the element since we most likely mousedover a xul element
- } catch(e) { }
+ event.type = eventType;
+ }
+ }
},
// In case of event delegation, we only need to rename the event.type,
@@ -4291,7 +4385,8 @@ var Expr = Sizzle.selectors = {
},
reset: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "reset" === elem.type;
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && "reset" === elem.type;
},
button: function( elem ) {
@@ -4557,6 +4652,16 @@ if ( document.documentElement.compareDocumentPosition ) {
} else {
sortOrder = function( a, b ) {
+ // The nodes are identical, we can exit early
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+
+ // Fallback to using sourceIndex (in IE) if it's available on both nodes
+ } else if ( a.sourceIndex && b.sourceIndex ) {
+ return a.sourceIndex - b.sourceIndex;
+ }
+
var al, bl,
ap = [],
bp = [],
@@ -4564,13 +4669,8 @@ if ( document.documentElement.compareDocumentPosition ) {
bup = b.parentNode,
cur = aup;
- // The nodes are identical, we can exit early
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
-
// If the nodes are siblings (or identical) we can do a quick check
- } else if ( aup === bup ) {
+ if ( aup === bup ) {
return siblingCheck( a, b );
// If no parents were found then the nodes are disconnected
@@ -5394,6 +5494,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /\/(java|ecma)script/i,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
@@ -5821,8 +5922,21 @@ function cloneFixAttributes( src, dest ) {
}
jQuery.buildFragment = function( args, nodes, scripts ) {
- var fragment, cacheable, cacheresults,
- doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
+ var fragment, cacheable, cacheresults, doc;
+
+ // nodes may contain either an explicit document object,
+ // a jQuery collection or context object.
+ // If nodes[0] contains a valid object to assign to doc
+ if ( nodes && nodes[0] ) {
+ doc = nodes[0].ownerDocument || nodes[0];
+ }
+
+ // Ensure that an attr object doesn't incorrectly stand in as a document object
+ // Chrome and Firefox seem to allow this to occur and will throw exception
+ // Fixes #8950
+ if ( !doc.createDocumentFragment ) {
+ doc = document;
+ }
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
// Cloning options loses the selected state, so don't cache them
@@ -5884,7 +5998,7 @@ jQuery.each({
function getAll( elem ) {
if ( "getElementsByTagName" in elem ) {
return elem.getElementsByTagName( "*" );
-
+
} else if ( "querySelectorAll" in elem ) {
return elem.querySelectorAll( "*" );
@@ -5903,7 +6017,7 @@ function fixDefaultChecked( elem ) {
function findInputs( elem ) {
if ( jQuery.nodeName( elem, "input" ) ) {
fixDefaultChecked( elem );
- } else if ( elem.getElementsByTagName ) {
+ } else if ( "getElementsByTagName" in elem ) {
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
}
}
@@ -5952,6 +6066,8 @@ jQuery.extend({
}
}
+ srcElements = destElements = null;
+
// Return the cloned set
return clone;
},
@@ -5966,7 +6082,7 @@ jQuery.extend({
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
}
- var ret = [];
+ var ret = [], j;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( typeof elem === "number" ) {
@@ -6012,7 +6128,7 @@ jQuery.extend({
div.childNodes :
[];
- for ( var j = tbody.length - 1; j >= 0 ; --j ) {
+ for ( j = tbody.length - 1; j >= 0 ; --j ) {
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
tbody[ j ].parentNode.removeChild( tbody[ j ] );
}
@@ -6033,8 +6149,8 @@ jQuery.extend({
var len;
if ( !jQuery.support.appendChecked ) {
if ( elem[0] && typeof (len = elem.length) === "number" ) {
- for ( i = 0; i < len; i++ ) {
- findInputs( elem[i] );
+ for ( j = 0; j < len; j++ ) {
+ findInputs( elem[j] );
}
} else {
findInputs( elem );