├── css ├── admin.css └── slider.css ├── images ├── toll.png ├── wordpress.png └── headers │ ├── fern.jpg │ ├── path.jpg │ ├── sunset.jpg │ ├── berries.jpg │ ├── concave.jpg │ ├── inkwell.jpg │ ├── forestfloor.jpg │ ├── cherryblossoms.jpg │ ├── fern-thumbnail.jpg │ ├── path-thumbnail.jpg │ ├── sunset-thumbnail.jpg │ ├── berries-thumbnail.jpg │ ├── concave-thumbnail.jpg │ ├── inkwell-thumbnail.jpg │ ├── forestfloor-thumbnail.jpg │ └── cherryblossoms-thumbnail.jpg ├── screenshot.png ├── README ├── js ├── cycle.js ├── addbox.js └── jquery.cycle.all.js ├── index.php ├── page.php ├── single.php ├── attachment.php ├── onecolumn-page.php ├── tag.php ├── sidebar.php ├── 404.php ├── editor-style-rtl.css ├── loop-page.php ├── category.php ├── footer.php ├── search.php ├── archive.php ├── sidebar-footer.php ├── header.php ├── author.php ├── loop-single.php ├── comments.php ├── loop-attachment.php ├── editor-style.css ├── rtl.css ├── loop.php ├── languages └── twentyten.pot ├── inc └── theme-options.php ├── license.txt ├── functions.php └── style.css /css/admin.css: -------------------------------------------------------------------------------- 1 | /*@todo Put Admin CSS HERE*/ -------------------------------------------------------------------------------- /images/toll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/toll.png -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/screenshot.png -------------------------------------------------------------------------------- /images/wordpress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/wordpress.png -------------------------------------------------------------------------------- /images/headers/fern.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/fern.jpg -------------------------------------------------------------------------------- /images/headers/path.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/path.jpg -------------------------------------------------------------------------------- /images/headers/sunset.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/sunset.jpg -------------------------------------------------------------------------------- /images/headers/berries.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/berries.jpg -------------------------------------------------------------------------------- /images/headers/concave.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/concave.jpg -------------------------------------------------------------------------------- /images/headers/inkwell.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/inkwell.jpg -------------------------------------------------------------------------------- /images/headers/forestfloor.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/forestfloor.jpg -------------------------------------------------------------------------------- /images/headers/cherryblossoms.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/cherryblossoms.jpg -------------------------------------------------------------------------------- /images/headers/fern-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/fern-thumbnail.jpg -------------------------------------------------------------------------------- /images/headers/path-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/path-thumbnail.jpg -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | This is a wordpress theme for Toll Brothers Inc 2 | with custom theme options created 10/2/2011 by 3 | Toll Brothers Dev -------------------------------------------------------------------------------- /images/headers/sunset-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/sunset-thumbnail.jpg -------------------------------------------------------------------------------- /images/headers/berries-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/berries-thumbnail.jpg -------------------------------------------------------------------------------- /images/headers/concave-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/concave-thumbnail.jpg -------------------------------------------------------------------------------- /images/headers/inkwell-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/inkwell-thumbnail.jpg -------------------------------------------------------------------------------- /js/cycle.js: -------------------------------------------------------------------------------- 1 | // Slider here jquery 2 | (function($) { 3 | $('.header_slider').cycle({ 4 | fx: 'fade' 5 | }); 6 | })(jQuery); -------------------------------------------------------------------------------- /images/headers/forestfloor-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/forestfloor-thumbnail.jpg -------------------------------------------------------------------------------- /images/headers/cherryblossoms-thumbnail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davidchase/tollbros/master/images/headers/cherryblossoms-thumbnail.jpg -------------------------------------------------------------------------------- /css/slider.css: -------------------------------------------------------------------------------- 1 | .header_slider { margin-top: 30px; clear: both;} 2 | .header_slider img { padding: 5px; border: 1px solid #ccc; background-color: #eee; } 3 | -------------------------------------------------------------------------------- /js/addbox.js: -------------------------------------------------------------------------------- 1 | //This function will add a textbox to the theme options page 2 | jQuery(document).ready(function(){ 3 | var num = 4; 4 | jQuery("a#add").click(function(){ 5 | var totalNum = num++; 6 | var $box = jQuery('') 7 | .attr({ type: 'text', name: 'tollbros_theme_options[slider' + totalNum + ']' , value:'',id:'tollbros_theme_options[slider' + totalNum + ']'}) 8 | .addClass("regular-text"); 9 | jQuery("#holder").append($box,'
'); 10 | jQuery("#options").submit(); 11 | }); 12 | }); -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 | 21 |
22 |
23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /page.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /single.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 | 21 | 22 |
23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /attachment.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 | 21 | 22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /onecolumn-page.php: -------------------------------------------------------------------------------- 1 | 13 | 14 |
15 |
16 | 17 | 24 | 25 |
26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /tag.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 |

' . single_tag_title( '', false ) . '' ); 16 | ?>

17 | 18 | 25 |
26 |
27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sidebar.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 20 | 21 | 24 | 25 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /404.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 |
15 |

16 |
17 |

18 | 19 |
20 |
21 | 22 |
23 |
24 | 28 | 29 | -------------------------------------------------------------------------------- /editor-style-rtl.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Toll Bros Base 3 | */ 4 | /* 5 | Used to style the TinyMCE editor. 6 | */ 7 | html .mceContentBody{ 8 | direction:rtl; 9 | unicode-bidi:embed; 10 | float:right; 11 | } 12 | * { 13 | font-family: Arial, Tahoma, sans-serif; 14 | } 15 | /* Text elements */ 16 | ul { 17 | margin: 0 -18px 18px 0; 18 | } 19 | ol { 20 | margin: 0 -18px 18px 0; 21 | } 22 | dd { 23 | margin-right: 0; 24 | } 25 | blockquote { 26 | font-style: normal; 27 | } 28 | table { 29 | text-align: right; 30 | margin: 0 0 24px -1px; 31 | } 32 | html .mceContentBody{ 33 | direction:rtl; 34 | unicode-bidi:embed; 35 | float:right; 36 | } 37 | * { 38 | font-family: Arial, Tahoma, sans-serif; 39 | } 40 | /* Text elements */ 41 | ul { 42 | margin: 0 -18px 18px 0; 43 | } 44 | ol { 45 | margin: 0 -18px 18px 0; 46 | } 47 | dd { 48 | margin-right: 0; 49 | } 50 | blockquote { 51 | font-style: normal; 52 | } 53 | table { 54 | text-align: right; 55 | margin: 0 0 24px -1px; 56 | } -------------------------------------------------------------------------------- /loop-page.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 |
> 14 | 15 |

16 | 17 |

18 | 19 | 20 |
21 | 22 | '' ) ); ?> 23 | ', '' ); ?> 24 |
25 |
26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /category.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 |

' . single_cat_title( '', false ) . '' ); 16 | ?>

17 | ' . $category_description . '
'; 21 | 22 | /* Run the loop for the category page to output the posts. 23 | * If you want to overload this in a child theme then include a file 24 | * called loop-category.php and that will be used instead. 25 | */ 26 | get_template_part( 'loop', 'category' ); 27 | ?> 28 | 29 |
30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /footer.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /search.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 | 15 |

' . get_search_query() . '' ); ?>

16 | 23 | 24 |
25 |

26 |
27 |

28 | 29 |
30 |
31 | 32 |
33 |
34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /archive.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 | 24 | 25 |

26 | 27 | %s', 'tollbros' ), get_the_date() ); ?> 28 | 29 | %s', 'tollbros' ), get_the_date( 'F Y' ) ); ?> 30 | 31 | %s', 'tollbros' ), get_the_date( 'Y' ) ); ?> 32 | 33 | 34 | 35 |

36 | 37 | 50 | 51 |
52 |
53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /sidebar-footer.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 24 | 25 | 60 | -------------------------------------------------------------------------------- /header.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | > 11 | 12 | 13 | 14 | <?php 15 | global $page, $paged; 16 | 17 | wp_title( '|', true, 'right' ); 18 | 19 | // Add the blog name. 20 | bloginfo( 'name' ); 21 | 22 | // Add the blog description for the home page 23 | $site_description = get_bloginfo( 'description', 'display' ); 24 | if ( $site_description && ( is_home() || is_front_page() ) ) 25 | echo " | $site_description"; 26 | 27 | ?> 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | > 43 |
44 | 60 | 61 |
62 | -------------------------------------------------------------------------------- /author.php: -------------------------------------------------------------------------------- 1 | 10 | 11 |
12 |
13 | 14 | 25 | 26 |

" . get_the_author() . "" ); ?>

27 | 28 | 31 |
32 |
33 | 34 |
35 |
36 |

37 | 38 |
39 |
40 | 41 | 42 | 55 |
56 |
57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /loop-single.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 17 | 18 |
> 19 |

20 | 21 | 24 | 25 |
26 | 27 | '' ) ); ?> 28 |
29 | 30 | 31 |
32 |
33 | 34 |
35 | 44 |
45 | 46 | 47 |
48 | 49 | ', '' ); ?> 50 |
51 |
52 | 53 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /comments.php: -------------------------------------------------------------------------------- 1 | 9 | 10 |
11 | 12 | 13 |
14 | 15 |

16 |
17 | 25 | 26 | 29 | 30 | 31 |

' . get_the_title() . '' ); 34 | ?>

35 | 36 | 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> 37 | 41 | 42 | 43 |
    44 | 'tollbros_comment' ) ); 52 | ?> 53 |
54 | 55 | 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?> 56 | 60 | 61 | 62 | 69 |

70 | 71 | 72 | 73 | 74 | 75 | 76 |
77 |
78 | -------------------------------------------------------------------------------- /loop-attachment.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | post_parent ) ) : ?> 14 |

← %s', 'tollbros' ), get_the_title( $post->post_parent ) ); 17 | ?>

18 | 19 | 20 |
> 21 |

22 | 23 | 58 | 59 |
60 |
61 | $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) ); 63 | foreach ( $attachments as $k => $attachment ) { 64 | if ( $attachment->ID == $post->ID ) 65 | break; 66 | } 67 | $k++; 68 | // If there is more than 1 image attachment in a gallery 69 | if ( count( $attachments ) > 1 ) { 70 | if ( isset( $attachments[ $k ] ) ) 71 | // get the URL of the next image attachment 72 | $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); 73 | else 74 | // or get the URL of the first image attachment 75 | $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID ); 76 | } else { 77 | // or, if there's only 1 image attachment, get the URL of the image 78 | $next_attachment_url = wp_get_attachment_url(); 79 | } 80 | ?> 81 |

ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height. 85 | ?>

86 | 87 | 91 | 92 | 93 | 94 |
95 |
post_excerpt ) ) the_excerpt(); ?>
96 | 97 | →', 'tollbros' ) ); ?> 98 | '' ) ); ?> 99 | 100 |
101 | 102 |
103 | 104 | ', '' ); ?> 105 |
106 |
107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /editor-style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Toll Bros Base 3 | Description: Used to style the TinyMCE editor. 4 | */ 5 | html .mceContentBody { 6 | max-width: 640px; 7 | } 8 | * { 9 | color: #444; 10 | font-family: Georgia, "Bitstream Charter", serif; 11 | line-height: 1.5; 12 | } 13 | p, 14 | dl, 15 | td, 16 | th, 17 | ul, 18 | ol, 19 | blockquote { 20 | font-size: 16px; 21 | } 22 | tr th, 23 | thead th, 24 | label, 25 | tr th, 26 | thead th { 27 | font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; 28 | } 29 | pre { 30 | font-family: "Courier 10 Pitch", Courier, monospace; 31 | } 32 | code, code var { 33 | font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; 34 | } 35 | body, input, textarea { 36 | font-size: 12px; 37 | line-height: 18px; 38 | } 39 | hr { 40 | background-color: #e7e7e7; 41 | border: 0; 42 | clear: both; 43 | height: 1px; 44 | margin-bottom: 18px; 45 | } 46 | /* Text elements */ 47 | p { 48 | margin-bottom: 18px; 49 | } 50 | ul { 51 | list-style: square; 52 | margin: 0 0 18px 1.5em; 53 | } 54 | ol { 55 | list-style: decimal; 56 | margin: 0 0 18px 1.5em; 57 | } 58 | ol ol { 59 | list-style: upper-alpha; 60 | } 61 | ol ol ol { 62 | list-style: lower-roman; 63 | } 64 | ol ol ol ol { 65 | list-style: lower-alpha; 66 | } 67 | ul ul, 68 | ol ol, 69 | ul ol, 70 | ol ul { 71 | margin-bottom: 0; 72 | } 73 | dl { 74 | margin: 0 0 24px 0; 75 | } 76 | dt { 77 | font-weight: bold; 78 | } 79 | dd { 80 | margin-bottom: 18px; 81 | } 82 | strong { 83 | color: #000; 84 | font-weight: bold; 85 | } 86 | cite, 87 | em, 88 | i { 89 | border: none; 90 | font-style: italic; 91 | } 92 | big { 93 | font-size: 131.25%; 94 | } 95 | ins { 96 | background: #ffc; 97 | border: none; 98 | color: #333; 99 | } 100 | del { 101 | text-decoration: line-through; 102 | color: #555; 103 | } 104 | blockquote { 105 | font-style: italic; 106 | padding: 0 3em; 107 | } 108 | blockquote cite, 109 | blockquote em, 110 | blockquote i { 111 | font-style: normal; 112 | } 113 | pre { 114 | background: #f7f7f7; 115 | color: #222; 116 | line-height: 18px; 117 | margin-bottom: 18px; 118 | padding: 1.5em; 119 | } 120 | abbr, 121 | acronym { 122 | border-bottom: 1px dotted #666; 123 | cursor: help; 124 | } 125 | ins { 126 | text-decoration: none; 127 | } 128 | sup, 129 | sub { 130 | font-size: 10px; 131 | height: 0; 132 | line-height: 1; 133 | position: relative; 134 | vertical-align: baseline; 135 | } 136 | sup { 137 | bottom: 1ex; 138 | } 139 | sub { 140 | top: .5ex; 141 | } 142 | a:link { 143 | color: #06c; 144 | } 145 | a:visited { 146 | color: #743399; 147 | } 148 | a:active, 149 | a:hover { 150 | color: #ff4b33; 151 | } 152 | p, 153 | ul, 154 | ol, 155 | dd, 156 | pre, 157 | hr { 158 | margin-bottom: 24px; 159 | } 160 | ul ul, 161 | ol ol, 162 | ul ol, 163 | ol ul { 164 | margin-bottom: 0; 165 | } 166 | pre, 167 | kbd, 168 | tt, 169 | var { 170 | font-size: 15px; 171 | line-height: 21px; 172 | } 173 | code { 174 | font-size: 13px; 175 | } 176 | strong, 177 | b, 178 | dt, 179 | th { 180 | color: #000; 181 | } 182 | h1, 183 | h2, 184 | h3, 185 | h4, 186 | h5, 187 | h6 { 188 | color: #000; 189 | font-weight: normal; 190 | line-height: 1.5em; 191 | margin: 0 0 20px 0; 192 | } 193 | h1 { 194 | font-size: 2.4em; 195 | } 196 | h2 { 197 | font-size: 1.8em; 198 | } 199 | h3 { 200 | font-size: 1.4em; 201 | } 202 | h4 { 203 | font-size: 1.2em; 204 | } 205 | h5 { 206 | font-size: 1em; 207 | } 208 | h6 { 209 | font-size: 0.9em; 210 | } 211 | table { 212 | border: 1px solid #e7e7e7 !important; 213 | border-collapse: collapse; 214 | border-spacing: 0; 215 | margin: 0 -1px 24px 0; 216 | text-align: left; 217 | width: 100%; 218 | } 219 | tr th, 220 | thead th { 221 | border: none !important; 222 | color: #888; 223 | font-size: 12px; 224 | font-weight: bold; 225 | line-height: 18px; 226 | padding: 9px 24px; 227 | } 228 | tr td { 229 | border: none !important; 230 | border-top: 1px solid #e7e7e7 !important; 231 | padding: 6px 24px; 232 | } 233 | img { 234 | margin: 0; 235 | } 236 | img.size-auto, 237 | img.size-large, 238 | img.size-full, 239 | img.size-medium { 240 | max-width: 100%; 241 | height: auto; 242 | } 243 | .alignleft, 244 | img.alignleft { 245 | display: inline; 246 | float: left; 247 | margin-right: 24px; 248 | margin-top: 4px; 249 | } 250 | .alignright, 251 | img.alignright { 252 | display: inline; 253 | float: right; 254 | margin-left: 24px; 255 | margin-top: 4px; 256 | } 257 | .aligncenter, 258 | img.aligncenter { 259 | clear: both; 260 | display: block; 261 | margin-left: auto; 262 | margin-right: auto; 263 | } 264 | img.alignleft, 265 | img.alignright, 266 | img.aligncenter { 267 | margin-bottom: 12px; 268 | } 269 | .wp-caption { 270 | background: #f1f1f1; 271 | border: none; 272 | -khtml-border-radius: 0; 273 | -moz-border-radius: 0; 274 | -webkit-border-radius: 0; 275 | border-radius: 0; 276 | color: #888; 277 | font-size: 12px; 278 | line-height: 18px; 279 | margin-bottom: 20px; 280 | max-width: 632px !important; /* prevent too-wide images from breaking layout */ 281 | padding: 4px; 282 | text-align: center; 283 | } 284 | .wp-caption img { 285 | margin: 5px; 286 | } 287 | .wp-caption p.wp-caption-text { 288 | margin: 0 0 4px; 289 | } 290 | .wp-smiley { 291 | margin: 0; 292 | } -------------------------------------------------------------------------------- /rtl.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Toll Bros Base 3 | */ 4 | 5 | 6 | /* 7 | RTL Basics 8 | */ 9 | 10 | 11 | body { 12 | direction:rtl; 13 | unicode-bidi:embed; 14 | } 15 | 16 | 17 | /* 18 | LAYOUT: Two-Column (Right) 19 | DESCRIPTION: Two-column fixed layout with one sidebar right of content 20 | */ 21 | 22 | #container { 23 | float: right; 24 | margin: 0 0 0 -240px; 25 | } 26 | #content { 27 | margin: 0 20px 36px 280px; 28 | } 29 | #primary, 30 | #secondary { 31 | float: left; 32 | } 33 | #secondary { 34 | clear: left; 35 | } 36 | 37 | 38 | /* =Fonts 39 | -------------------------------------------------------------- */ 40 | body, 41 | input, 42 | textarea, 43 | .page-title span, 44 | .pingback a.url, 45 | h3#comments-title, 46 | h3#reply-title, 47 | #access .menu, 48 | #access div.menu ul, 49 | #cancel-comment-reply-link, 50 | .form-allowed-tags, 51 | #site-info, 52 | #site-title, 53 | #wp-calendar, 54 | .comment-meta, 55 | .comment-body tr th, 56 | .comment-body thead th, 57 | .entry-content label, 58 | .entry-content tr th, 59 | .entry-content thead th, 60 | .entry-meta, 61 | .entry-title, 62 | .entry-utility, 63 | #respond label, 64 | .navigation, 65 | .page-title, 66 | .pingback p, 67 | .reply, 68 | .widget-title, 69 | input[type=submit] { 70 | font-family: Arial, Tahoma, sans-serif; 71 | } 72 | 73 | /* =Structure 74 | -------------------------------------------------------------- */ 75 | 76 | /* The main theme structure */ 77 | #footer-widget-area .widget-area { 78 | float: right; 79 | margin-left: 20px; 80 | margin-right: 0; 81 | } 82 | #footer-widget-area #fourth { 83 | margin-left: 0; 84 | } 85 | #site-info { 86 | float: right; 87 | } 88 | #site-generator { 89 | float: left; 90 | } 91 | 92 | 93 | /* =Global Elements 94 | -------------------------------------------------------------- */ 95 | 96 | /* Text elements */ 97 | ul, ol { 98 | margin: 0 1.5em 18px 0; 99 | } 100 | blockquote { 101 | font-style: normal; 102 | } 103 | 104 | /* Text meant only for screen readers */ 105 | .screen-reader-text { 106 | left: auto; 107 | text-indent:-9000px; 108 | overflow:hidden; 109 | } 110 | 111 | 112 | /* =Header 113 | -------------------------------------------------------------- */ 114 | 115 | #site-title { 116 | float: right; 117 | } 118 | #site-description { 119 | clear: left; 120 | float: left; 121 | font-style: normal; 122 | } 123 | #branding img { 124 | float: right; 125 | } 126 | 127 | /* =Menu 128 | -------------------------------------------------------------- */ 129 | 130 | #access { 131 | float:right; 132 | } 133 | 134 | #access .menu-header, 135 | div.menu { 136 | margin-right: 12px; 137 | margin-left: 0; 138 | } 139 | 140 | #access .menu-header li, 141 | div.menu li{ 142 | float:right; 143 | } 144 | 145 | #access ul ul { 146 | left:auto; 147 | right:0; 148 | float:right; 149 | } 150 | #access ul ul ul { 151 | left:auto; 152 | right:100%; 153 | } 154 | 155 | /* =Content 156 | -------------------------------------------------------------- */ 157 | 158 | #content table { 159 | text-align: right; 160 | margin: 0 0 24px -1px; 161 | } 162 | .page-title span { 163 | font-style:normal; 164 | } 165 | .entry-title, 166 | .entry-meta { 167 | clear: right; 168 | float: right; 169 | margin-left: 68px; 170 | margin-right: 0; 171 | } 172 | 173 | .entry-content input.file, 174 | .entry-content input.button { 175 | margin-left: 24px; 176 | margin-right:0; 177 | } 178 | .entry-content blockquote.left { 179 | float: right; 180 | margin-right: 0; 181 | margin-left: 24px; 182 | text-align: left; 183 | } 184 | .entry-content blockquote.right { 185 | float: left; 186 | margin-right: 24px; 187 | margin-left: 0; 188 | text-align: right; 189 | } 190 | #entry-author-info #author-avatar { 191 | float: right; 192 | margin: 0 0 0 -104px; 193 | } 194 | #entry-author-info #author-description { 195 | float: right; 196 | margin: 0 104px 0 0; 197 | } 198 | 199 | /* Gallery listing 200 | -------------------------------------------------------------- */ 201 | 202 | .category-gallery .gallery-thumb { 203 | float: right; 204 | margin-left:20px; 205 | margin-right:0; 206 | } 207 | 208 | 209 | /* Images 210 | -------------------------------------------------------------- */ 211 | 212 | #content .gallery .gallery-caption { 213 | margin-right: 0; 214 | } 215 | 216 | #content .gallery .gallery-item { 217 | float: right; 218 | } 219 | 220 | /* =Navigation 221 | -------------------------------------------------------------- */ 222 | .nav-previous { 223 | float: right; 224 | } 225 | .nav-next { 226 | float: left; 227 | text-align:left; 228 | } 229 | 230 | /* =Comments 231 | -------------------------------------------------------------- */ 232 | 233 | .commentlist li.comment { 234 | padding: 0 56px 0 0; 235 | } 236 | .commentlist .avatar { 237 | right: 0; 238 | left: auto; 239 | } 240 | .comment-author .says, #comments .pingback .url { 241 | font-style: normal; 242 | } 243 | 244 | /* Comments form */ 245 | .children #respond { 246 | margin: 0 0 0 48px; 247 | } 248 | 249 | /* =Widget Areas 250 | -------------------------------------------------------------- */ 251 | 252 | .widget-area ul { 253 | margin-right: 0; 254 | } 255 | .widget-area ul ul { 256 | margin-right: 1.3em; 257 | margin-left: 0; 258 | } 259 | #wp-calendar caption { 260 | text-align: right; 261 | } 262 | #wp-calendar tfoot #next { 263 | text-align: left; 264 | } 265 | 266 | /* Main sidebars */ 267 | #main .widget-area ul { 268 | margin-right: 0; 269 | padding: 0 0 0 20px; 270 | } 271 | #main .widget-area ul ul { 272 | margin-right: 1.3em; 273 | margin-left: 0; 274 | } 275 | 276 | /* =Footer 277 | -------------------------------------------------------------- */ 278 | #site-generator { 279 | font-style:normal; 280 | } 281 | #site-generator a { 282 | background-position: right center; 283 | padding-right: 20px; 284 | padding-left: 0; 285 | } -------------------------------------------------------------------------------- /loop.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | max_num_pages > 1 ) : ?> 13 | 17 | 18 | 19 | 20 | 21 |
22 |

23 |
24 |

25 | 26 |
27 |
28 | 29 | 30 | 45 | 46 | 47 | 48 | 49 | ID ) ) || in_category( _x( 'gallery', 'gallery category slug', 'tollbros' ) ) ) : ?> 50 |
> 51 |

52 | 53 | 56 | 57 |
58 | 59 | 60 | 61 | $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) ); 63 | if ( $images ) : 64 | $total_images = count( $images ); 65 | $image = array_shift( $images ); 66 | $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' ); 67 | ?> 68 | 71 |

%2$s photo.', 'This gallery contains %2$s photos.', $total_images, 'tollbros' ), 72 | 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'tollbros' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"', 73 | number_format_i18n( $total_images ) 74 | ); ?>

75 | 76 | 77 | 78 |
79 | 80 |
81 | ID ) ) : ?> 82 | 83 | | 84 | 85 | 86 | | 87 | 88 | 89 | | ', '' ); ?> 90 |
91 |
92 | 93 | 94 | 95 | ID ) ) || in_category( _x( 'asides', 'asides category slug', 'tollbros' ) ) ) : ?> 96 |
> 97 | 98 | 99 |
100 | 101 |
102 | 103 |
104 | →', 'tollbros' ) ); ?> 105 |
106 | 107 | 108 |
109 | 110 | | 111 | 112 | | ', '' ); ?> 113 |
114 |
115 | 116 | 117 | 118 | 119 |
> 120 |

121 | 122 | 125 | 126 | 127 |
128 | 129 |
130 | 131 |
132 | →', 'tollbros' ) ); ?> 133 | '' ) ); ?> 134 |
135 | 136 | 137 |
138 | 139 | 140 | Posted in %2$s', 'tollbros' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?> 141 | 142 | | 143 | 144 | 148 | 149 | Tagged %2$s', 'tollbros' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> 150 | 151 | | 152 | 153 | 154 | | ', '' ); ?> 155 |
156 |
157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | max_num_pages > 1 ) : ?> 166 | 170 | 171 | -------------------------------------------------------------------------------- /languages/twentyten.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2010 Twenty Ten 2 | # This file is distributed under the same license as the Twenty Ten package. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Twenty Ten 1.2\n" 6 | "Report-Msgid-Bugs-To: http://wordpress.org/tag/twentyten\n" 7 | "POT-Creation-Date: 2011-06-13 13:27:43+00:00\n" 8 | "MIME-Version: 1.0\n" 9 | "Content-Type: text/plain; charset=UTF-8\n" 10 | "Content-Transfer-Encoding: 8bit\n" 11 | "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n" 12 | "Last-Translator: FULL NAME \n" 13 | "Language-Team: LANGUAGE \n" 14 | 15 | #: loop-attachment.php:21 16 | msgid "Return to %s" 17 | msgstr "" 18 | 19 | #. translators: %s - title of parent post 20 | #: loop-attachment.php:23 21 | msgid " %s" 22 | msgstr "" 23 | 24 | #: loop-attachment.php:32 25 | msgid "By %2$s" 26 | msgstr "" 27 | 28 | #: loop-attachment.php:36 functions.php:476 29 | msgid "View all posts by %s" 30 | msgstr "" 31 | 32 | #: loop-attachment.php:43 33 | msgid "Published %2$s" 34 | msgstr "" 35 | 36 | #: loop-attachment.php:53 37 | msgid "Full size is %s pixels" 38 | msgstr "" 39 | 40 | #: loop-attachment.php:56 41 | msgid "Link to full-size image" 42 | msgstr "" 43 | 44 | #: loop-attachment.php:63 loop-attachment.php:111 loop.php:100 loop.php:123 45 | #: loop.php:165 loop-page.php:30 loop-single.php:56 46 | msgid "Edit" 47 | msgstr "" 48 | 49 | #: loop-attachment.php:104 loop.php:115 loop.php:143 functions.php:248 50 | msgid "Continue reading " 51 | msgstr "" 52 | 53 | #: loop-attachment.php:105 loop.php:144 loop-page.php:29 loop-single.php:34 54 | msgid "Pages:" 55 | msgstr "" 56 | 57 | #. #-#-#-#-# twentyten.pot (Twenty Ten 1.2) #-#-#-#-# 58 | #. Theme URI of the plugin/theme 59 | #: footer.php:33 60 | msgid "http://wordpress.org/" 61 | msgstr "" 62 | 63 | #: footer.php:33 64 | msgid "Semantic Personal Publishing Platform" 65 | msgstr "" 66 | 67 | #: footer.php:33 68 | msgid "Proudly powered by %s." 69 | msgstr "" 70 | 71 | #: category.php:16 72 | msgid "Category Archives: %s" 73 | msgstr "" 74 | 75 | #: sidebar.php:27 76 | msgid "Archives" 77 | msgstr "" 78 | 79 | #: sidebar.php:34 80 | msgid "Meta" 81 | msgstr "" 82 | 83 | #: tag.php:16 84 | msgid "Tag Archives: %s" 85 | msgstr "" 86 | 87 | #: comments.php:18 88 | msgid "" 89 | "This post is password protected. Enter the password to view any comments." 90 | msgstr "" 91 | 92 | #: comments.php:35 93 | msgid "One Response to %2$s" 94 | msgid_plural "%1$s Responses to %2$s" 95 | msgstr[0] "" 96 | msgstr[1] "" 97 | 98 | #: comments.php:41 comments.php:60 99 | msgid " Older Comments" 100 | msgstr "" 101 | 102 | #: comments.php:42 comments.php:61 103 | msgid "Newer Comments " 104 | msgstr "" 105 | 106 | #: comments.php:72 107 | msgid "Comments are closed." 108 | msgstr "" 109 | 110 | #: 404.php:16 loop.php:33 111 | msgid "Not Found" 112 | msgstr "" 113 | 114 | #: 404.php:18 115 | msgid "" 116 | "Apologies, but the page you requested could not be found. Perhaps searching " 117 | "will help." 118 | msgstr "" 119 | 120 | #: loop.php:25 loop.php:178 121 | msgid " Older posts" 122 | msgstr "" 123 | 124 | #: loop.php:26 loop.php:179 125 | msgid "Newer posts " 126 | msgstr "" 127 | 128 | #: loop.php:35 129 | msgid "" 130 | "Apologies, but no results were found for the requested archive. Perhaps " 131 | "searching will help find a related post." 132 | msgstr "" 133 | 134 | #: loop.php:60 loop.php:95 loop.php:96 135 | msgctxt "gallery category slug" 136 | msgid "gallery" 137 | msgstr "" 138 | 139 | #: loop.php:62 loop.php:83 loop.php:131 140 | msgid "Permalink to %s" 141 | msgstr "" 142 | 143 | #: loop.php:82 144 | msgid "This gallery contains %2$s photo." 145 | msgid_plural "This gallery contains %2$s photos." 146 | msgstr[0] "" 147 | msgstr[1] "" 148 | 149 | #: loop.php:93 150 | msgid "View Galleries" 151 | msgstr "" 152 | 153 | #: loop.php:93 loop.php:96 154 | msgid "More Galleries" 155 | msgstr "" 156 | 157 | #: loop.php:96 158 | msgid "View posts in the Gallery category" 159 | msgstr "" 160 | 161 | #: loop.php:99 loop.php:122 loop.php:164 162 | msgid "Leave a comment" 163 | msgstr "" 164 | 165 | #: loop.php:99 loop.php:122 loop.php:164 166 | msgid "1 Comment" 167 | msgstr "" 168 | 169 | #: loop.php:99 loop.php:122 loop.php:164 170 | msgid "% Comments" 171 | msgstr "" 172 | 173 | #: loop.php:106 174 | msgctxt "asides category slug" 175 | msgid "asides" 176 | msgstr "" 177 | 178 | #: loop.php:151 179 | msgid "Posted in %2$s" 180 | msgstr "" 181 | 182 | #: loop.php:160 183 | msgid "Tagged %2$s" 184 | msgstr "" 185 | 186 | #: functions.php:100 187 | msgid "Primary Navigation" 188 | msgstr "" 189 | 190 | #. translators: header image description 191 | #: functions.php:140 192 | msgid "Berries" 193 | msgstr "" 194 | 195 | #. translators: header image description 196 | #: functions.php:146 197 | msgid "Cherry Blossoms" 198 | msgstr "" 199 | 200 | #. translators: header image description 201 | #: functions.php:152 202 | msgid "Concave" 203 | msgstr "" 204 | 205 | #. translators: header image description 206 | #: functions.php:158 207 | msgid "Fern" 208 | msgstr "" 209 | 210 | #. translators: header image description 211 | #: functions.php:164 212 | msgid "Forest Floor" 213 | msgstr "" 214 | 215 | #. translators: header image description 216 | #: functions.php:170 217 | msgid "Inkwell" 218 | msgstr "" 219 | 220 | #. translators: header image description 221 | #: functions.php:176 222 | msgid "Path" 223 | msgstr "" 224 | 225 | #. translators: header image description 226 | #: functions.php:182 227 | msgid "Sunset" 228 | msgstr "" 229 | 230 | #: functions.php:330 231 | msgid "%s says:" 232 | msgstr "" 233 | 234 | #: functions.php:333 235 | msgid "Your comment is awaiting moderation." 236 | msgstr "" 237 | 238 | #. translators: 1: date, 2: time 239 | #: functions.php:340 240 | msgid "%1$s at %2$s" 241 | msgstr "" 242 | 243 | #: functions.php:340 functions.php:357 244 | msgid "(Edit)" 245 | msgstr "" 246 | 247 | #: functions.php:357 248 | msgid "Pingback:" 249 | msgstr "" 250 | 251 | #: functions.php:376 252 | msgid "Primary Widget Area" 253 | msgstr "" 254 | 255 | #: functions.php:378 256 | msgid "The primary widget area" 257 | msgstr "" 258 | 259 | #: functions.php:387 260 | msgid "Secondary Widget Area" 261 | msgstr "" 262 | 263 | #: functions.php:389 264 | msgid "The secondary widget area" 265 | msgstr "" 266 | 267 | #: functions.php:398 268 | msgid "First Footer Widget Area" 269 | msgstr "" 270 | 271 | #: functions.php:400 272 | msgid "The first footer widget area" 273 | msgstr "" 274 | 275 | #: functions.php:409 276 | msgid "Second Footer Widget Area" 277 | msgstr "" 278 | 279 | #: functions.php:411 280 | msgid "The second footer widget area" 281 | msgstr "" 282 | 283 | #: functions.php:420 284 | msgid "Third Footer Widget Area" 285 | msgstr "" 286 | 287 | #: functions.php:422 288 | msgid "The third footer widget area" 289 | msgstr "" 290 | 291 | #: functions.php:431 292 | msgid "Fourth Footer Widget Area" 293 | msgstr "" 294 | 295 | #: functions.php:433 296 | msgid "The fourth footer widget area" 297 | msgstr "" 298 | 299 | #: functions.php:467 300 | msgid "" 301 | "Posted on %2$s by %3$s" 303 | msgstr "" 304 | 305 | #: functions.php:493 306 | msgid "" 307 | "This entry was posted in %1$s and tagged %2$s. Bookmark the permalink." 309 | msgstr "" 310 | 311 | #: functions.php:495 312 | msgid "" 313 | "This entry was posted in %1$s. Bookmark the permalink." 315 | msgstr "" 316 | 317 | #: functions.php:497 318 | msgid "" 319 | "Bookmark the permalink." 321 | msgstr "" 322 | 323 | #: header.php:33 324 | msgid "Page %s" 325 | msgstr "" 326 | 327 | #: header.php:83 328 | msgid "Skip to content" 329 | msgstr "" 330 | 331 | #: author.php:27 332 | msgid "Author Archives: %s" 333 | msgstr "" 334 | 335 | #: author.php:37 loop-single.php:43 336 | msgid "About %s" 337 | msgstr "" 338 | 339 | #: search.php:16 340 | msgid "Search Results for: %s" 341 | msgstr "" 342 | 343 | #: search.php:26 344 | msgid "Nothing Found" 345 | msgstr "" 346 | 347 | #: search.php:28 348 | msgid "" 349 | "Sorry, but nothing matched your search criteria. Please try again with some " 350 | "different keywords." 351 | msgstr "" 352 | 353 | #: loop-single.php:21 loop-single.php:61 354 | msgctxt "Previous post link" 355 | msgid "←" 356 | msgstr "" 357 | 358 | #: loop-single.php:22 loop-single.php:62 359 | msgctxt "Next post link" 360 | msgid "→" 361 | msgstr "" 362 | 363 | #: loop-single.php:47 364 | msgid "View all posts by %s " 365 | msgstr "" 366 | 367 | #: archive.php:33 368 | msgid "Daily Archives: %s" 369 | msgstr "" 370 | 371 | #: archive.php:35 372 | msgid "Monthly Archives: %s" 373 | msgstr "" 374 | 375 | #: archive.php:37 376 | msgid "Yearly Archives: %s" 377 | msgstr "" 378 | 379 | #: archive.php:39 380 | msgid "Blog Archives" 381 | msgstr "" 382 | 383 | #. Theme Name of the plugin/theme 384 | msgid "Twenty Ten" 385 | msgstr "" 386 | 387 | #. Description of the plugin/theme 388 | msgid "" 389 | "The 2010 theme for WordPress is stylish, customizable, simple, and readable " 390 | "-- make it yours with a custom menu, header image, and background. Twenty " 391 | "Ten supports six widgetized areas (two in the sidebar, four in the footer) " 392 | "and featured images (thumbnails for gallery posts and custom header images " 393 | "for posts and pages). It includes stylesheets for print and the admin Visual " 394 | "Editor, special styles for posts in the \"Asides\" and \"Gallery\" " 395 | "categories, and has an optional one-column page template that removes the " 396 | "sidebar." 397 | msgstr "" 398 | 399 | #. Author of the plugin/theme 400 | msgid "the WordPress team" 401 | msgstr "" 402 | 403 | #. Tags of the plugin/theme 404 | msgid "" 405 | "black, blue, white, two-columns, fixed-width, custom-header, custom-" 406 | "background, threaded-comments, sticky-post, translation-ready, microformats, " 407 | "rtl-language-support, editor-style, custom-menu" 408 | msgstr "" 409 | -------------------------------------------------------------------------------- /inc/theme-options.php: -------------------------------------------------------------------------------- 1 | array( 45 | 'value' => '0', 46 | 'label' => __( 'Zero', 'tollbrostheme' ) 47 | ), 48 | '1' => array( 49 | 'value' => '1', 50 | 'label' => __( 'One', 'tollbrostheme' ) 51 | ), 52 | '2' => array( 53 | 'value' => '2', 54 | 'label' => __( 'Two', 'tollbrostheme' ) 55 | ), 56 | '3' => array( 57 | 'value' => '3', 58 | 'label' => __( 'Three', 'tollbrostheme' ) 59 | ), 60 | '4' => array( 61 | 'value' => '4', 62 | 'label' => __( 'Four', 'tollbrostheme' ) 63 | ), 64 | '5' => array( 65 | 'value' => '3', 66 | 'label' => __( 'Five', 'tollbrostheme' ) 67 | ) 68 | ); 69 | 70 | $radio_options = array( 71 | 'yes' => array( 72 | 'value' => 'yes', 73 | 'label' => __( 'Yes', 'tollbrostheme' ) 74 | ), 75 | 'no' => array( 76 | 'value' => 'no', 77 | 'label' => __( 'No', 'tollbrostheme' ) 78 | ) 79 | ); 80 | 81 | /** 82 | * Create the options page 83 | */ 84 | function theme_options_do_page() { 85 | global $select_options, $radio_options; 86 | 87 | if ( ! isset( $_REQUEST['settings-updated'] ) ) 88 | $_REQUEST['settings-updated'] = false; 89 | 90 | ?> 91 |
92 | " . get_current_theme() . __( ' Theme Options', 'tollbrostheme' ) . ""; ?> 93 | 94 | 95 |

96 | 97 | 98 |
99 | 100 | 101 | 102 | 103 | 104 | 109 | 110 | 119 | 120 | 121 | 126 | 127 | 146 | 147 | 148 | 153 | 154 | 176 | 177 | 178 | 183 | 184 | 185 | 186 | 187 | 201 | 202 | 203 | 208 | 209 | 210 | 215 | 216 | 221 | 222 | 223 | 228 | 229 | 230 | 235 | 236 |
111 | /> 112 |
113 | 114 |
115 | /> 116 |
117 | 118 |
128 | 144 | 145 |
155 |
156 | 170 |
171 | 174 |
175 |

188 | 189 |
190 | 191 | 192 |
193 | 194 | 195 |
196 | 197 |
198 | Add 199 | 200 |
204 | 205 |
206 | 207 |
211 | 212 |
213 | 214 |

224 | 225 |
226 | 227 |
231 | 232 |
233 | 234 |
237 | 238 |

239 | 240 |

241 |
242 |
243 | __( 'Primary Navigation', 'tollbros' ), 70 | ) ); 71 | 72 | 73 | } 74 | endif; 75 | 76 | if ( ! function_exists( 'tollbros_admin_header_style' ) ) : 77 | /** 78 | * Styles the header image displayed on the Appearance > Header admin panel. 79 | * 80 | * Referenced via add_custom_image_header() in tollbros_setup(). 81 | * 82 | */ 83 | function tollbros_admin_header_style() { 84 | ?> 85 | 96 | ' . __( 'Continue reading ', 'tollbros' ) . ''; 138 | } 139 | 140 | /** 141 | * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and tollbros_continue_reading_link(). 142 | * 143 | * To override this in a child theme, remove the filter and add your own 144 | * function tied to the excerpt_more filter hook. 145 | * 146 | * @return string An ellipsis 147 | */ 148 | function tollbros_auto_excerpt_more( $more ) { 149 | return ' …' . tollbros_continue_reading_link(); 150 | } 151 | add_filter( 'excerpt_more', 'tollbros_auto_excerpt_more' ); 152 | 153 | /** 154 | * Adds a pretty "Continue Reading" link to custom post excerpts. 155 | * 156 | * To override this link in a child theme, remove the filter and add your own 157 | * function tied to the get_the_excerpt filter hook. 158 | * 159 | * @return string Excerpt with a pretty "Continue Reading" link 160 | */ 161 | function tollbros_custom_excerpt_more( $output ) { 162 | if ( has_excerpt() && ! is_attachment() ) { 163 | $output .= tollbros_continue_reading_link(); 164 | } 165 | return $output; 166 | } 167 | add_filter( 'get_the_excerpt', 'tollbros_custom_excerpt_more' ); 168 | 169 | /** 170 | * Remove inline styles printed when the gallery shortcode is used. 171 | * 172 | * Galleries are styled by the theme in Twenty Ten's style.css. This is just 173 | * a simple filter call that tells WordPress to not use the default styles. 174 | * 175 | * 176 | */ 177 | add_filter( 'use_default_gallery_style', '__return_false' ); 178 | 179 | /** 180 | * Deprecated way to remove inline styles printed when the gallery shortcode is used. 181 | * 182 | * This function is no longer needed or used. Use the use_default_gallery_style 183 | * filter instead, as seen above. 184 | * 185 | * 186 | * @return string The gallery style filter, with the styles themselves removed. 187 | */ 188 | function tollbros_remove_gallery_css( $css ) { 189 | return preg_replace( "##s", '', $css ); 190 | } 191 | // Backwards compatibility with WordPress 3.0. 192 | if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) ) 193 | add_filter( 'gallery_style', 'tollbros_remove_gallery_css' ); 194 | 195 | if ( ! function_exists( 'tollbros_comment' ) ) : 196 | /** 197 | * Template for comments and pingbacks. 198 | * 199 | * To override this walker in a child theme without modifying the comments template 200 | * simply create your own tollbros_comment(), and that function will be used instead. 201 | * 202 | * Used as a callback by wp_list_comments() for displaying the comments. 203 | * 204 | */ 205 | function tollbros_comment( $comment, $args, $depth ) { 206 | $GLOBALS['comment'] = $comment; 207 | switch ( $comment->comment_type ) : 208 | case '' : 209 | ?> 210 |
  • id="li-comment-"> 211 |
    212 |
    213 | 214 | says:', 'tollbros' ), sprintf( '%s', get_comment_author_link() ) ); ?> 215 |
    216 | comment_approved == '0' ) : ?> 217 | 218 |
    219 | 220 | 221 | 227 | 228 |
    229 | 230 |
    231 | $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> 232 |
    233 |
    234 | 235 | 240 |
  • 241 |

    242 | __( 'Primary Widget Area', 'tollbros' ), 261 | 'id' => 'primary-widget-area', 262 | 'description' => __( 'The primary widget area', 'tollbros' ), 263 | 'before_widget' => '
  • ', 264 | 'after_widget' => '
  • ', 265 | 'before_title' => '

    ', 266 | 'after_title' => '

    ', 267 | ) ); 268 | 269 | // Area 2, located below the Primary Widget Area in the sidebar. Empty by default. 270 | register_sidebar( array( 271 | 'name' => __( 'Secondary Widget Area', 'tollbros' ), 272 | 'id' => 'secondary-widget-area', 273 | 'description' => __( 'The secondary widget area', 'tollbros' ), 274 | 'before_widget' => '
  • ', 275 | 'after_widget' => '
  • ', 276 | 'before_title' => '

    ', 277 | 'after_title' => '

    ', 278 | ) ); 279 | 280 | // Area 3, located in the footer. Empty by default. 281 | register_sidebar( array( 282 | 'name' => __( 'First Footer Widget Area', 'tollbros' ), 283 | 'id' => 'first-footer-widget-area', 284 | 'description' => __( 'The first footer widget area', 'tollbros' ), 285 | 'before_widget' => '
  • ', 286 | 'after_widget' => '
  • ', 287 | 'before_title' => '

    ', 288 | 'after_title' => '

    ', 289 | ) ); 290 | 291 | // Area 4, located in the footer. Empty by default. 292 | register_sidebar( array( 293 | 'name' => __( 'Second Footer Widget Area', 'tollbros' ), 294 | 'id' => 'second-footer-widget-area', 295 | 'description' => __( 'The second footer widget area', 'tollbros' ), 296 | 'before_widget' => '
  • ', 297 | 'after_widget' => '
  • ', 298 | 'before_title' => '

    ', 299 | 'after_title' => '

    ', 300 | ) ); 301 | 302 | // Area 5, located in the footer. Empty by default. 303 | register_sidebar( array( 304 | 'name' => __( 'Third Footer Widget Area', 'tollbros' ), 305 | 'id' => 'third-footer-widget-area', 306 | 'description' => __( 'The third footer widget area', 'tollbros' ), 307 | 'before_widget' => '
  • ', 308 | 'after_widget' => '
  • ', 309 | 'before_title' => '

    ', 310 | 'after_title' => '

    ', 311 | ) ); 312 | 313 | // Area 6, located in the footer. Empty by default. 314 | register_sidebar( array( 315 | 'name' => __( 'Fourth Footer Widget Area', 'tollbros' ), 316 | 'id' => 'fourth-footer-widget-area', 317 | 'description' => __( 'The fourth footer widget area', 'tollbros' ), 318 | 'before_widget' => '
  • ', 319 | 'after_widget' => '
  • ', 320 | 'before_title' => '

    ', 321 | 'after_title' => '

    ', 322 | ) ); 323 | } 324 | /** Register sidebars by running tollbros_widgets_init() on the widgets_init hook. */ 325 | add_action( 'widgets_init', 'tollbros_widgets_init' ); 326 | 327 | /** 328 | * Removes the default styles that are packaged with the Recent Comments widget. 329 | * 330 | * To override this in a child theme, remove the filter and optionally add your own 331 | * function tied to the widgets_init action hook. 332 | * 333 | * This function uses a filter (show_recent_comments_widget_style) new in WordPress 3.1 334 | * to remove the default style. Using Twenty Ten 1.2 in WordPress 3.0 will show the styles, 335 | * but they won't have any effect on the widget in default Twenty Ten styling. 336 | * 337 | * 338 | */ 339 | function tollbros_remove_recent_comments_style() { 340 | add_filter( 'show_recent_comments_widget_style', '__return_false' ); 341 | } 342 | add_action( 'widgets_init', 'tollbros_remove_recent_comments_style' ); 343 | 344 | if ( ! function_exists( 'tollbros_posted_on' ) ) : 345 | /** 346 | * Prints HTML with meta information for the current post-date/time and author. 347 | * 348 | * 349 | */ 350 | function tollbros_posted_on() { 351 | printf( __( 'Posted on %2$s by %3$s', 'tollbros' ), 352 | 'meta-prep meta-prep-author', 353 | sprintf( '', 354 | get_permalink(), 355 | esc_attr( get_the_time() ), 356 | get_the_date() 357 | ), 358 | sprintf( '%3$s', 359 | get_author_posts_url( get_the_author_meta( 'ID' ) ), 360 | sprintf( esc_attr__( 'View all posts by %s', 'tollbros' ), get_the_author() ), 361 | get_the_author() 362 | ) 363 | ); 364 | } 365 | endif; 366 | 367 | if ( ! function_exists( 'tollbros_posted_in' ) ) : 368 | /** 369 | * Prints HTML with meta information for the current post (category, tags and permalink). 370 | * 371 | * 372 | */ 373 | function tollbros_posted_in() { 374 | // Retrieves tag list of current post, separated by commas. 375 | $tag_list = get_the_tag_list( '', ', ' ); 376 | if ( $tag_list ) { 377 | $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the permalink.', 'tollbros' ); 378 | } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { 379 | $posted_in = __( 'This entry was posted in %1$s. Bookmark the permalink.', 'tollbros' ); 380 | } else { 381 | $posted_in = __( 'Bookmark the permalink.', 'tollbros' ); 382 | } 383 | // Prints the string, replacing the placeholders. 384 | printf( 385 | $posted_in, 386 | get_the_category_list( ', ' ), 387 | $tag_list, 388 | get_permalink(), 389 | the_title_attribute( 'echo=0' ) 390 | ); 391 | } 392 | endif; 393 | 394 | // Kills off appearance and plugin editor in the backend 395 | function tollbros_remove_editor() { 396 | define( 'DISALLOW_FILE_EDIT', true ); 397 | } 398 | add_action('admin_menu','tollbros_remove_editor'); 399 | 400 | function tollbros_header_option() { 401 | $options = get_option('tollbros_theme_options'); 402 | echo $options['headeroption']; 403 | } 404 | 405 | function tollbros_footer_option() { 406 | $options = get_option('tollbros_theme_options'); 407 | echo $options['footeroption']; 408 | } 409 | 410 | function tollbros_footer_copy() { 411 | $options = get_option('tollbros_theme_options'); 412 | echo $options['footercopy']; 413 | } 414 | 415 | 416 | function tollbros_keywords() { 417 | $options = get_option('tollbros_theme_options'); 418 | echo $options['keywords']; 419 | } 420 | 421 | function tollbros_comments() { 422 | $options = get_option('tollbros_theme_options'); 423 | if ($options['radioinput'] === 'yes'){ 424 | return TRUE; 425 | } else { 426 | return FALSE; 427 | } 428 | } 429 | 430 | function tollbros_slider() { 431 | $options = get_option('tollbros_theme_options'); 432 | $sliders = array($options['slider'],$options['slider2'],$options['slider3']); 433 | foreach ($sliders as $slider) { 434 | echo 'Slider Images'; 435 | } 436 | 437 | } 438 | 439 | 440 | 441 | 442 | 443 | // Function/Hook to remove unnecessary stuff from wp_head() 444 | 445 | add_action('init','tollbros_rmheadlink'); 446 | 447 | function tollbros_rmheadlink() { 448 | remove_action('wp_head', 'rsd_link'); 449 | remove_action('wp_head', 'wlwmanifest_link'); 450 | remove_action('wp_head', 'wp_generator'); 451 | remove_action('wp_head', 'start_post_rel_link'); 452 | remove_action('wp_head', 'index_rel_link'); 453 | remove_action('wp_head', 'adjacent_posts_rel_link'); 454 | } 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* 2 | Theme Name: Toll Bros Base 3 | Theme URI: http://www.tollbrothers.com 4 | Description: The Toll Brother's Base Theme For All Projects 5 | Author: Toll Bros Dev 6 | Version: 1.0 7 | License: GNU General Public License 8 | License URI: license.txt 9 | Tags: custom menu, theme options,boilerplate 10 | */ 11 | 12 | 13 | /* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html 14 | -------------------------------------------------------------- */ 15 | 16 | html, body, div, span, applet, object, iframe, 17 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 18 | a, abbr, acronym, address, big, cite, code, 19 | del, dfn, em, font, img, ins, kbd, q, s, samp, 20 | small, strike, strong, sub, sup, tt, var, 21 | b, u, i, center, 22 | dl, dt, dd, ol, ul, li, 23 | fieldset, form, label, legend, 24 | table, caption, tbody, tfoot, thead, tr, th, td { 25 | background: transparent; 26 | border: 0; 27 | margin: 0; 28 | padding: 0; 29 | vertical-align: baseline; 30 | } 31 | body { 32 | line-height: 1; 33 | } 34 | h1, h2, h3, h4, h5, h6 { 35 | clear: both; 36 | font-weight: normal; 37 | } 38 | ol, ul { 39 | list-style: none; 40 | } 41 | blockquote { 42 | quotes: none; 43 | } 44 | blockquote:before, blockquote:after { 45 | content: ''; 46 | content: none; 47 | } 48 | del { 49 | text-decoration: line-through; 50 | } 51 | /* tables still need 'cellspacing="0"' in the markup */ 52 | table { 53 | border-collapse: collapse; 54 | border-spacing: 0; 55 | } 56 | a img { 57 | border: none; 58 | } 59 | 60 | 61 | /* =Layout 62 | -------------------------------------------------------------- */ 63 | 64 | /* 65 | LAYOUT: Two columns 66 | DESCRIPTION: Two-column fixed layout with one sidebar right of content 67 | */ 68 | 69 | #container { 70 | float: left; 71 | margin: 0 -240px 0 0; 72 | width: 100%; 73 | } 74 | #content { 75 | margin: 0 280px 0 20px; 76 | } 77 | #primary, 78 | #secondary { 79 | float: right; 80 | overflow: hidden; 81 | width: 220px; 82 | } 83 | #secondary { 84 | clear: right; 85 | } 86 | #footer { 87 | clear: both; 88 | width: 100%; 89 | } 90 | 91 | /* 92 | LAYOUT: One column, no sidebar 93 | DESCRIPTION: One centered column with no sidebar 94 | */ 95 | 96 | .one-column #content { 97 | margin: 0 auto; 98 | width: 640px; 99 | } 100 | 101 | /* 102 | LAYOUT: Full width, no sidebar 103 | DESCRIPTION: Full width content with no sidebar; used for attachment pages 104 | */ 105 | 106 | .single-attachment #content { 107 | margin: 0 auto; 108 | width: 900px; 109 | } 110 | 111 | 112 | /* =Fonts 113 | -------------------------------------------------------------- */ 114 | body, 115 | input, 116 | textarea, 117 | .page-title span, 118 | .pingback a.url { 119 | font-family: Georgia, "Bitstream Charter", serif; 120 | } 121 | h3#comments-title, 122 | h3#reply-title, 123 | #navi .menu, 124 | #navi div.menu ul, 125 | #cancel-comment-reply-link, 126 | .form-allowed-tags, 127 | #site-info, 128 | #site-title, 129 | #wp-calendar, 130 | .comment-meta, 131 | .comment-body tr th, 132 | .comment-body thead th, 133 | .entry-content label, 134 | .entry-content tr th, 135 | .entry-content thead th, 136 | .entry-meta, 137 | .entry-title, 138 | .entry-utility, 139 | #respond label, 140 | .navigation, 141 | .page-title, 142 | .pingback p, 143 | .reply, 144 | .widget-title, 145 | .wp-caption-text { 146 | font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; 147 | } 148 | input[type=submit] { 149 | font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif; 150 | } 151 | pre { 152 | font-family: "Courier 10 Pitch", Courier, monospace; 153 | } 154 | code { 155 | font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace; 156 | } 157 | 158 | 159 | /* =Structure 160 | -------------------------------------------------------------- */ 161 | 162 | /* The main theme structure */ 163 | #navi .menu-header, 164 | div.menu, 165 | #copyright, 166 | #logo, 167 | #main, 168 | #wrapper { 169 | margin: 0 auto; 170 | width: 960px; 171 | } 172 | #wrapper { 173 | background: #fff; 174 | margin-top: 20px; 175 | padding: 0 20px; 176 | -moz-border-radius: 10px; 177 | border-radius: 10px; 178 | -webkit-border-radius: 10px; 179 | } 180 | 181 | /* Structure the footer area */ 182 | #footer-widget-area { 183 | overflow: hidden; 184 | } 185 | #footer-widget-area .widget-area { 186 | float: left; 187 | margin-right: 20px; 188 | width: 220px; 189 | } 190 | #footer-widget-area #fourth { 191 | margin-right: 0; 192 | } 193 | #site-info { 194 | float: left; 195 | font-size: 14px; 196 | font-weight: bold; 197 | width: 700px; 198 | } 199 | #credits { 200 | float: left; 201 | width: 220px; 202 | } 203 | 204 | 205 | /* Theme Options */ 206 | 207 | 208 | 209 | 210 | /* =Global Elements 211 | -------------------------------------------------------------- */ 212 | 213 | /* Main global 'theme' and typographic styles */ 214 | body { 215 | background: #f1f1f1; 216 | } 217 | body, 218 | input, 219 | textarea { 220 | color: #666; 221 | font-size: 12px; 222 | line-height: 18px; 223 | } 224 | hr { 225 | background-color: #e7e7e7; 226 | border: 0; 227 | clear: both; 228 | height: 1px; 229 | margin-bottom: 18px; 230 | } 231 | 232 | /* Text elements */ 233 | p { 234 | margin-bottom: 18px; 235 | } 236 | ul { 237 | list-style: square; 238 | margin: 0 0 18px 1.5em; 239 | } 240 | ol { 241 | list-style: decimal; 242 | margin: 0 0 18px 1.5em; 243 | } 244 | ol ol { 245 | list-style: upper-alpha; 246 | } 247 | ol ol ol { 248 | list-style: lower-roman; 249 | } 250 | ol ol ol ol { 251 | list-style: lower-alpha; 252 | } 253 | ul ul, 254 | ol ol, 255 | ul ol, 256 | ol ul { 257 | margin-bottom: 0; 258 | } 259 | dl { 260 | margin: 0 0 24px 0; 261 | } 262 | dt { 263 | font-weight: bold; 264 | } 265 | dd { 266 | margin-bottom: 18px; 267 | } 268 | strong { 269 | font-weight: bold; 270 | } 271 | cite, 272 | em, 273 | i { 274 | font-style: italic; 275 | } 276 | big { 277 | font-size: 131.25%; 278 | } 279 | ins { 280 | background: #ffc; 281 | text-decoration: none; 282 | } 283 | blockquote { 284 | font-style: italic; 285 | padding: 0 3em; 286 | } 287 | blockquote cite, 288 | blockquote em, 289 | blockquote i { 290 | font-style: normal; 291 | } 292 | pre { 293 | background: #f7f7f7; 294 | color: #222; 295 | line-height: 18px; 296 | margin-bottom: 18px; 297 | padding: 1.5em; 298 | } 299 | abbr, 300 | acronym { 301 | border-bottom: 1px dotted #666; 302 | cursor: help; 303 | } 304 | sup, 305 | sub { 306 | height: 0; 307 | line-height: 1; 308 | position: relative; 309 | vertical-align: baseline; 310 | } 311 | sup { 312 | bottom: 1ex; 313 | } 314 | sub { 315 | top: .5ex; 316 | } 317 | input[type="text"], 318 | textarea { 319 | background: #f9f9f9; 320 | border: 1px solid #ccc; 321 | box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); 322 | -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); 323 | -webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); 324 | padding: 2px; 325 | } 326 | a:link { 327 | color: #0066cc; 328 | } 329 | a:visited { 330 | color: #743399; 331 | } 332 | a:active, 333 | a:hover { 334 | color: #ff4b33; 335 | } 336 | 337 | /* Text meant only for screen readers */ 338 | .screen-reader-text { 339 | position: absolute; 340 | left: -9000px; 341 | } 342 | 343 | 344 | /* =Header 345 | -------------------------------------------------------------- */ 346 | 347 | #header { 348 | padding: 30px 0 0 0; 349 | } 350 | #site-title { 351 | float: left; 352 | font-size: 30px; 353 | line-height: 36px; 354 | margin: 0 0 18px 0; 355 | width: 700px; 356 | } 357 | #site-title a { 358 | color: #000; 359 | font-weight: bold; 360 | text-decoration: none; 361 | } 362 | #site-description { 363 | clear: right; 364 | float: right; 365 | font-style: italic; 366 | margin: 15px 0 18px 0; 367 | width: 220px; 368 | } 369 | 370 | /* This is the custom header image */ 371 | #logo img { 372 | display: block; 373 | float: left; 374 | } 375 | 376 | 377 | /* =Menu 378 | -------------------------------------------------------------- */ 379 | 380 | #navi { 381 | background: #555; 382 | display: block; 383 | float: left; 384 | margin: 0 auto; 385 | width: 960px; 386 | } 387 | #navi .menu-header, 388 | div.menu { 389 | font-size: 13px; 390 | margin-left: 12px; 391 | width: 928px; 392 | } 393 | #navi .menu-header ul, 394 | div.menu ul { 395 | list-style: none; 396 | margin: 0; 397 | } 398 | #navi .menu-header li, 399 | div.menu li { 400 | float: left; 401 | position: relative; 402 | } 403 | #navi a { 404 | color: #aaa; 405 | display: block; 406 | line-height: 38px; 407 | padding: 0 10px; 408 | text-decoration: none; 409 | } 410 | #navi ul ul { 411 | box-shadow: 0px 3px 3px rgba(0,0,0,0.2); 412 | -moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); 413 | -webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2); 414 | display: none; 415 | position: absolute; 416 | top: 38px; 417 | left: 0; 418 | float: left; 419 | width: 180px; 420 | z-index: 99999; 421 | } 422 | #navi ul ul li { 423 | min-width: 180px; 424 | } 425 | #navi ul ul ul { 426 | left: 100%; 427 | top: 0; 428 | } 429 | #navi ul ul a { 430 | background: #333; 431 | line-height: 1em; 432 | padding: 10px; 433 | width: 160px; 434 | height: auto; 435 | } 436 | #navi li:hover > a, 437 | #navi ul ul :hover > a { 438 | background: #333; 439 | color: #fff; 440 | } 441 | #navi ul li:hover > ul { 442 | display: block; 443 | } 444 | #navi ul li.current_page_item > a, 445 | #navi ul li.current-menu-ancestor > a, 446 | #navi ul li.current-menu-item > a, 447 | #navi ul li.current-menu-parent > a { 448 | color: #fff; 449 | } 450 | * html #navi ul li.current_page_item a, 451 | * html #navi ul li.current-menu-ancestor a, 452 | * html #navi ul li.current-menu-item a, 453 | * html #navi ul li.current-menu-parent a, 454 | * html #navi ul li a:hover { 455 | color: #fff; 456 | } 457 | 458 | 459 | /* =Content 460 | -------------------------------------------------------------- */ 461 | 462 | #main { 463 | clear: both; 464 | overflow: hidden; 465 | padding: 40px 0 0 0; 466 | } 467 | #content { 468 | margin-bottom: 36px; 469 | } 470 | #content, 471 | #content input, 472 | #content textarea { 473 | color: #333; 474 | font-size: 16px; 475 | line-height: 24px; 476 | } 477 | #content p, 478 | #content ul, 479 | #content ol, 480 | #content dd, 481 | #content pre, 482 | #content hr { 483 | margin-bottom: 24px; 484 | } 485 | #content ul ul, 486 | #content ol ol, 487 | #content ul ol, 488 | #content ol ul { 489 | margin-bottom: 0; 490 | } 491 | #content pre, 492 | #content kbd, 493 | #content tt, 494 | #content var { 495 | font-size: 15px; 496 | line-height: 21px; 497 | } 498 | #content code { 499 | font-size: 13px; 500 | } 501 | #content dt, 502 | #content th { 503 | color: #000; 504 | } 505 | #content h1, 506 | #content h2, 507 | #content h3, 508 | #content h4, 509 | #content h5, 510 | #content h6 { 511 | color: #000; 512 | line-height: 1.5em; 513 | margin: 0 0 20px 0; 514 | } 515 | #content table { 516 | border: 1px solid #e7e7e7; 517 | margin: 0 -1px 24px 0; 518 | text-align: left; 519 | width: 100%; 520 | } 521 | #content tr th, 522 | #content thead th { 523 | color: #888; 524 | font-size: 12px; 525 | font-weight: bold; 526 | line-height: 18px; 527 | padding: 9px 24px; 528 | } 529 | #content tr td { 530 | border-top: 1px solid #e7e7e7; 531 | padding: 6px 24px; 532 | } 533 | #content tr.odd td { 534 | background: #f2f7fc; 535 | } 536 | .hentry { 537 | margin: 0 0 48px 0; 538 | } 539 | .home .sticky { 540 | background: #f2f7fc; 541 | border-top: 4px solid #000; 542 | margin-left: -20px; 543 | margin-right: -20px; 544 | padding: 18px 20px; 545 | } 546 | .single .hentry { 547 | margin: 0 0 36px 0; 548 | } 549 | .page-title { 550 | color: #000; 551 | font-size: 14px; 552 | font-weight: bold; 553 | margin: 0 0 36px 0; 554 | } 555 | .page-title span { 556 | color: #333; 557 | font-size: 16px; 558 | font-style: italic; 559 | font-weight: normal; 560 | } 561 | .page-title a:link, 562 | .page-title a:visited { 563 | color: #888; 564 | text-decoration: none; 565 | } 566 | .page-title a:active, 567 | .page-title a:hover { 568 | color: #ff4b33; 569 | } 570 | #content .entry-title { 571 | color: #000; 572 | font-size: 21px; 573 | font-weight: bold; 574 | line-height: 1.3em; 575 | margin-bottom: 0; 576 | } 577 | .entry-title a:link, 578 | .entry-title a:visited { 579 | color: #000; 580 | text-decoration: none; 581 | } 582 | .entry-title a:active, 583 | .entry-title a:hover { 584 | color: #ff4b33; 585 | } 586 | .entry-meta { 587 | color: #888; 588 | font-size: 12px; 589 | } 590 | .entry-meta abbr, 591 | .entry-utility abbr { 592 | border: none; 593 | } 594 | .entry-meta abbr:hover, 595 | .entry-utility abbr:hover { 596 | border-bottom: 1px dotted #666; 597 | } 598 | .entry-content, 599 | .entry-summary { 600 | clear: both; 601 | padding: 12px 0 0 0; 602 | } 603 | #content .entry-summary p:last-child { 604 | margin-bottom: 12px; 605 | } 606 | .entry-content fieldset { 607 | border: 1px solid #e7e7e7; 608 | margin: 0 0 24px 0; 609 | padding: 24px; 610 | } 611 | .entry-content fieldset legend { 612 | background: #fff; 613 | color: #000; 614 | font-weight: bold; 615 | padding: 0 24px; 616 | } 617 | .entry-content input { 618 | margin: 0 0 24px 0; 619 | } 620 | .entry-content input.file, 621 | .entry-content input.button { 622 | margin-right: 24px; 623 | } 624 | .entry-content label { 625 | color: #888; 626 | font-size: 12px; 627 | } 628 | .entry-content select { 629 | margin: 0 0 24px 0; 630 | } 631 | .entry-content sup, 632 | .entry-content sub { 633 | font-size: 10px; 634 | } 635 | .entry-content blockquote.left { 636 | float: left; 637 | margin-left: 0; 638 | margin-right: 24px; 639 | text-align: right; 640 | width: 33%; 641 | } 642 | .entry-content blockquote.right { 643 | float: right; 644 | margin-left: 24px; 645 | margin-right: 0; 646 | text-align: left; 647 | width: 33%; 648 | } 649 | .page-link { 650 | clear: both; 651 | color: #000; 652 | font-weight: bold; 653 | margin: 0 0 22px 0; 654 | word-spacing: 0.5em; 655 | } 656 | .page-link a:link, 657 | .page-link a:visited { 658 | background: #f1f1f1; 659 | color: #333; 660 | font-weight: normal; 661 | padding: 0.5em 0.75em; 662 | text-decoration: none; 663 | } 664 | .home .sticky .page-link a { 665 | background: #d9e8f7; 666 | } 667 | .page-link a:active, 668 | .page-link a:hover { 669 | color: #ff4b33; 670 | } 671 | body.page .edit-link { 672 | clear: both; 673 | display: block; 674 | } 675 | #entry-author-info { 676 | background: #f2f7fc; 677 | border-top: 4px solid #000; 678 | clear: both; 679 | font-size: 14px; 680 | line-height: 20px; 681 | margin: 24px 0; 682 | overflow: hidden; 683 | padding: 18px 20px; 684 | } 685 | #entry-author-info #author-avatar { 686 | background: #fff; 687 | border: 1px solid #e7e7e7; 688 | float: left; 689 | height: 60px; 690 | margin: 0 -104px 0 0; 691 | padding: 11px; 692 | } 693 | #entry-author-info #author-description { 694 | float: left; 695 | margin: 0 0 0 104px; 696 | } 697 | #entry-author-info h2 { 698 | color: #000; 699 | font-size: 100%; 700 | font-weight: bold; 701 | margin-bottom: 0; 702 | } 703 | .entry-utility { 704 | clear: both; 705 | color: #888; 706 | font-size: 12px; 707 | line-height: 18px; 708 | } 709 | .entry-meta a, 710 | .entry-utility a { 711 | color: #888; 712 | } 713 | .entry-meta a:hover, 714 | .entry-utility a:hover { 715 | color: #ff4b33; 716 | } 717 | #content .video-player { 718 | padding: 0; 719 | } 720 | 721 | 722 | /* =Asides 723 | -------------------------------------------------------------- */ 724 | 725 | .home #content .format-aside p, 726 | .home #content .category-asides p { 727 | font-size: 14px; 728 | line-height: 20px; 729 | margin-bottom: 10px; 730 | margin-top: 0; 731 | } 732 | .home .hentry.format-aside, 733 | .home .hentry.category-asides { 734 | padding: 0; 735 | } 736 | .home #content .format-aside .entry-content, 737 | .home #content .category-asides .entry-content { 738 | padding-top: 0; 739 | } 740 | 741 | 742 | /* =Gallery listing 743 | -------------------------------------------------------------- */ 744 | 745 | .format-gallery .size-thumbnail img, 746 | .category-gallery .size-thumbnail img { 747 | border: 10px solid #f1f1f1; 748 | margin-bottom: 0; 749 | } 750 | .format-gallery .gallery-thumb, 751 | .category-gallery .gallery-thumb { 752 | float: left; 753 | margin-right: 20px; 754 | margin-top: -4px; 755 | } 756 | .home #content .format-gallery .entry-utility, 757 | .home #content .category-gallery .entry-utility { 758 | padding-top: 4px; 759 | } 760 | 761 | 762 | /* =Attachment pages 763 | -------------------------------------------------------------- */ 764 | 765 | .attachment .entry-content .entry-caption { 766 | font-size: 140%; 767 | margin-top: 24px; 768 | } 769 | .attachment .entry-content .nav-previous a:before { 770 | content: '\2190\00a0'; 771 | } 772 | .attachment .entry-content .nav-next a:after { 773 | content: '\00a0\2192'; 774 | } 775 | 776 | 777 | /* =Images 778 | -------------------------------------------------------------- */ 779 | 780 | /* 781 | Resize images to fit the main content area. 782 | - Applies only to images uploaded via WordPress by targeting size-* classes. 783 | - Other images will be left alone. Use "size-auto" class to apply to other images. 784 | */ 785 | img.size-auto, 786 | img.size-full, 787 | img.size-large, 788 | img.size-medium, 789 | .attachment img { 790 | max-width: 100%; /* When images are too wide for containing element, force them to fit. */ 791 | height: auto; /* Override height to match resized width for correct aspect ratio. */ 792 | } 793 | .alignleft, 794 | img.alignleft { 795 | display: inline; 796 | float: left; 797 | margin-right: 24px; 798 | margin-top: 4px; 799 | } 800 | .alignright, 801 | img.alignright { 802 | display: inline; 803 | float: right; 804 | margin-left: 24px; 805 | margin-top: 4px; 806 | } 807 | .aligncenter, 808 | img.aligncenter { 809 | clear: both; 810 | display: block; 811 | margin-left: auto; 812 | margin-right: auto; 813 | } 814 | img.alignleft, 815 | img.alignright, 816 | img.aligncenter { 817 | margin-bottom: 12px; 818 | } 819 | .wp-caption { 820 | background: #f1f1f1; 821 | line-height: 18px; 822 | margin-bottom: 20px; 823 | max-width: 632px !important; /* prevent too-wide images from breaking layout */ 824 | padding: 4px; 825 | text-align: center; 826 | } 827 | .wp-caption img { 828 | margin: 5px 5px 0; 829 | } 830 | .wp-caption p.wp-caption-text { 831 | color: #888; 832 | font-size: 12px; 833 | margin: 5px; 834 | } 835 | .wp-smiley { 836 | margin: 0; 837 | } 838 | .gallery { 839 | margin: 0 auto 18px; 840 | } 841 | .gallery .gallery-item { 842 | float: left; 843 | margin-top: 0; 844 | text-align: center; 845 | width: 33%; 846 | } 847 | .gallery-columns-2 .gallery-item { 848 | width: 50%; 849 | } 850 | .gallery-columns-4 .gallery-item { 851 | width: 25%; 852 | } 853 | .gallery img { 854 | border: 2px solid #cfcfcf; 855 | } 856 | .gallery-columns-2 .attachment-medium { 857 | max-width: 92%; 858 | height: auto; 859 | } 860 | .gallery-columns-4 .attachment-thumbnail { 861 | max-width: 84%; 862 | height: auto; 863 | } 864 | .gallery .gallery-caption { 865 | color: #888; 866 | font-size: 12px; 867 | margin: 0 0 12px; 868 | } 869 | .gallery dl { 870 | margin: 0; 871 | } 872 | .gallery img { 873 | border: 10px solid #f1f1f1; 874 | } 875 | .gallery br+br { 876 | display: none; 877 | } 878 | #content .attachment img {/* single attachment images should be centered */ 879 | display: block; 880 | margin: 0 auto; 881 | } 882 | 883 | 884 | /* =Navigation 885 | -------------------------------------------------------------- */ 886 | 887 | .navigation { 888 | color: #888; 889 | font-size: 12px; 890 | line-height: 18px; 891 | overflow: hidden; 892 | } 893 | .navigation a:link, 894 | .navigation a:visited { 895 | color: #888; 896 | text-decoration: none; 897 | } 898 | .navigation a:active, 899 | .navigation a:hover { 900 | color: #ff4b33; 901 | } 902 | .nav-previous { 903 | float: left; 904 | width: 50%; 905 | } 906 | .nav-next { 907 | float: right; 908 | text-align: right; 909 | width: 50%; 910 | } 911 | #nav-above { 912 | margin: 0 0 18px 0; 913 | } 914 | #nav-above { 915 | display: none; 916 | } 917 | .paged #nav-above, 918 | .single #nav-above { 919 | display: block; 920 | } 921 | #nav-below { 922 | margin: -18px 0 0 0; 923 | } 924 | 925 | 926 | /* =Comments 927 | -------------------------------------------------------------- */ 928 | #comments { 929 | clear: both; 930 | } 931 | #comments .navigation { 932 | padding: 0 0 18px 0; 933 | } 934 | h3#comments-title, 935 | h3#reply-title { 936 | color: #000; 937 | font-size: 20px; 938 | font-weight: bold; 939 | margin-bottom: 0; 940 | } 941 | h3#comments-title { 942 | padding: 24px 0; 943 | } 944 | .commentlist { 945 | list-style: none; 946 | margin: 0; 947 | } 948 | .commentlist li.comment { 949 | border-bottom: 1px solid #e7e7e7; 950 | line-height: 24px; 951 | margin: 0 0 24px 0; 952 | padding: 0 0 0 56px; 953 | position: relative; 954 | } 955 | .commentlist li:last-child { 956 | border-bottom: none; 957 | margin-bottom: 0; 958 | } 959 | #comments .comment-body ul, 960 | #comments .comment-body ol { 961 | margin-bottom: 18px; 962 | } 963 | #comments .comment-body p:last-child { 964 | margin-bottom: 6px; 965 | } 966 | #comments .comment-body blockquote p:last-child { 967 | margin-bottom: 24px; 968 | } 969 | .commentlist ol { 970 | list-style: decimal; 971 | } 972 | .commentlist .avatar { 973 | position: absolute; 974 | top: 4px; 975 | left: 0; 976 | } 977 | .comment-author { 978 | } 979 | .comment-author cite { 980 | color: #000; 981 | font-style: normal; 982 | font-weight: bold; 983 | } 984 | .comment-author .says { 985 | font-style: italic; 986 | } 987 | .comment-meta { 988 | font-size: 12px; 989 | margin: 0 0 18px 0; 990 | } 991 | .comment-meta a:link, 992 | .comment-meta a:visited { 993 | color: #888; 994 | text-decoration: none; 995 | } 996 | .comment-meta a:active, 997 | .comment-meta a:hover { 998 | color: #ff4b33; 999 | } 1000 | .commentlist .even { 1001 | } 1002 | .commentlist .bypostauthor { 1003 | } 1004 | .reply { 1005 | font-size: 12px; 1006 | padding: 0 0 24px 0; 1007 | } 1008 | .reply a, 1009 | a.comment-edit-link { 1010 | color: #888; 1011 | } 1012 | .reply a:hover, 1013 | a.comment-edit-link:hover { 1014 | color: #ff4b33; 1015 | } 1016 | .commentlist .children { 1017 | list-style: none; 1018 | margin: 0; 1019 | } 1020 | .commentlist .children li { 1021 | border: none; 1022 | margin: 0; 1023 | } 1024 | .nopassword, 1025 | .nocomments { 1026 | display: none; 1027 | } 1028 | #comments .pingback { 1029 | border-bottom: 1px solid #e7e7e7; 1030 | margin-bottom: 18px; 1031 | padding-bottom: 18px; 1032 | } 1033 | .commentlist li.comment+li.pingback { 1034 | margin-top: -6px; 1035 | } 1036 | #comments .pingback p { 1037 | color: #888; 1038 | display: block; 1039 | font-size: 12px; 1040 | line-height: 18px; 1041 | margin: 0; 1042 | } 1043 | #comments .pingback .url { 1044 | font-size: 13px; 1045 | font-style: italic; 1046 | } 1047 | 1048 | /* Comments form */ 1049 | input[type=submit] { 1050 | color: #333; 1051 | } 1052 | #respond { 1053 | border-top: 1px solid #e7e7e7; 1054 | margin: 24px 0; 1055 | overflow: hidden; 1056 | position: relative; 1057 | } 1058 | #respond p { 1059 | margin: 0; 1060 | } 1061 | #respond .comment-notes { 1062 | margin-bottom: 1em; 1063 | } 1064 | .form-allowed-tags { 1065 | line-height: 1em; 1066 | } 1067 | .children #respond { 1068 | margin: 0 48px 0 0; 1069 | } 1070 | h3#reply-title { 1071 | margin: 18px 0; 1072 | } 1073 | #comments-list #respond { 1074 | margin: 0 0 18px 0; 1075 | } 1076 | #comments-list ul #respond { 1077 | margin: 0; 1078 | } 1079 | #cancel-comment-reply-link { 1080 | font-size: 12px; 1081 | font-weight: normal; 1082 | line-height: 18px; 1083 | } 1084 | #respond .required { 1085 | color: #ff4b33; 1086 | font-weight: bold; 1087 | } 1088 | #respond label { 1089 | color: #888; 1090 | font-size: 12px; 1091 | } 1092 | #respond input { 1093 | margin: 0 0 9px; 1094 | width: 98%; 1095 | } 1096 | #respond textarea { 1097 | width: 98%; 1098 | } 1099 | #respond .form-allowed-tags { 1100 | color: #888; 1101 | font-size: 12px; 1102 | line-height: 18px; 1103 | } 1104 | #respond .form-allowed-tags code { 1105 | font-size: 11px; 1106 | } 1107 | #respond .form-submit { 1108 | margin: 12px 0; 1109 | } 1110 | #respond .form-submit input { 1111 | font-size: 14px; 1112 | width: auto; 1113 | } 1114 | 1115 | 1116 | /* =Widget Areas 1117 | -------------------------------------------------------------- */ 1118 | 1119 | .widget-area ul { 1120 | list-style: none; 1121 | margin-left: 0; 1122 | } 1123 | .widget-area ul ul { 1124 | list-style: square; 1125 | margin-left: 1.3em; 1126 | } 1127 | .widget-area select { 1128 | max-width: 100%; 1129 | } 1130 | .widget_search #s {/* This keeps the search inputs in line */ 1131 | width: 60%; 1132 | } 1133 | .widget_search label { 1134 | display: none; 1135 | } 1136 | .widget-container { 1137 | margin: 0 0 18px 0; 1138 | } 1139 | .widget-title { 1140 | color: #222; 1141 | font-weight: bold; 1142 | } 1143 | .widget-area a:link, 1144 | .widget-area a:visited { 1145 | text-decoration: none; 1146 | } 1147 | .widget-area a:active, 1148 | .widget-area a:hover { 1149 | text-decoration: underline; 1150 | } 1151 | .widget-area .entry-meta { 1152 | font-size: 11px; 1153 | } 1154 | #wp_tag_cloud div { 1155 | line-height: 1.6em; 1156 | } 1157 | #wp-calendar { 1158 | width: 100%; 1159 | } 1160 | #wp-calendar caption { 1161 | color: #222; 1162 | font-size: 14px; 1163 | font-weight: bold; 1164 | padding-bottom: 4px; 1165 | text-align: left; 1166 | } 1167 | #wp-calendar thead { 1168 | font-size: 11px; 1169 | } 1170 | #wp-calendar thead th { 1171 | } 1172 | #wp-calendar tbody { 1173 | color: #aaa; 1174 | } 1175 | #wp-calendar tbody td { 1176 | background: #f5f5f5; 1177 | border: 1px solid #fff; 1178 | padding: 3px 0 2px; 1179 | text-align: center; 1180 | } 1181 | #wp-calendar tbody .pad { 1182 | background: none; 1183 | } 1184 | #wp-calendar tfoot #next { 1185 | text-align: right; 1186 | } 1187 | .widget_rss a.rsswidget { 1188 | color: #000; 1189 | } 1190 | .widget_rss a.rsswidget:hover { 1191 | color: #ff4b33; 1192 | } 1193 | .widget_rss .widget-title img { 1194 | width: 11px; 1195 | height: 11px; 1196 | } 1197 | 1198 | /* Main sidebars */ 1199 | #main .widget-area ul { 1200 | margin-left: 0; 1201 | padding: 0 20px 0 0; 1202 | } 1203 | #main .widget-area ul ul { 1204 | border: none; 1205 | margin-left: 1.3em; 1206 | padding: 0; 1207 | } 1208 | #primary { 1209 | } 1210 | #secondary { 1211 | } 1212 | 1213 | /* Footer widget areas */ 1214 | #footer-widget-area { 1215 | } 1216 | 1217 | 1218 | /* =Footer 1219 | -------------------------------------------------------------- */ 1220 | 1221 | #footer { 1222 | margin-bottom: 20px; 1223 | } 1224 | #copyright { 1225 | margin-top: -4px; 1226 | overflow: hidden; 1227 | padding: 18px 0; 1228 | } 1229 | #site-info { 1230 | font-weight: bold; 1231 | } 1232 | #site-info a { 1233 | color: #000; 1234 | text-decoration: none; 1235 | } 1236 | #credits { 1237 | font-style: italic; 1238 | position: relative; 1239 | } 1240 | #credits a { 1241 | /*background: url(images/toll.png) center left no-repeat;*/ 1242 | color: #666; 1243 | display: inline-block; 1244 | line-height: 16px; 1245 | padding-left: 20px; 1246 | text-decoration: none; 1247 | } 1248 | #credits a:hover { 1249 | text-decoration: underline; 1250 | } 1251 | img#wpstats { 1252 | display: block; 1253 | margin: 0 auto 10px; 1254 | } 1255 | 1256 | 1257 | /* =Mobile Safari ( iPad, iPhone and iPod Touch ) 1258 | -------------------------------------------------------------- */ 1259 | 1260 | pre { 1261 | -webkit-text-size-adjust: 140%; 1262 | } 1263 | code { 1264 | -webkit-text-size-adjust: 160%; 1265 | } 1266 | #navi, 1267 | .entry-meta, 1268 | .entry-utility, 1269 | .navigation, 1270 | .widget-area { 1271 | -webkit-text-size-adjust: 120%; 1272 | } 1273 | #site-description { 1274 | -webkit-text-size-adjust: none; 1275 | } 1276 | 1277 | 1278 | /* =Print Style 1279 | -------------------------------------------------------------- */ 1280 | 1281 | @media print { 1282 | body { 1283 | background: none !important; 1284 | } 1285 | #wrapper { 1286 | clear: both !important; 1287 | display: block !important; 1288 | float: none !important; 1289 | position: relative !important; 1290 | } 1291 | #header { 1292 | border-bottom: 2pt solid #000; 1293 | padding-bottom: 18pt; 1294 | } 1295 | #copyright { 1296 | border-top: 2pt solid #000; 1297 | } 1298 | #site-title, 1299 | #site-description { 1300 | float: none; 1301 | line-height: 1.4em; 1302 | margin: 0; 1303 | padding: 0; 1304 | } 1305 | #site-title { 1306 | font-size: 13pt; 1307 | } 1308 | .entry-content { 1309 | font-size: 14pt; 1310 | line-height: 1.6em; 1311 | } 1312 | .entry-title { 1313 | font-size: 21pt; 1314 | } 1315 | #navi, 1316 | #logo img, 1317 | #respond, 1318 | .comment-edit-link, 1319 | .edit-link, 1320 | .navigation, 1321 | .page-link, 1322 | .widget-area { 1323 | display: none !important; 1324 | } 1325 | #container, 1326 | #header, 1327 | #footer { 1328 | margin: 0; 1329 | width: 100%; 1330 | } 1331 | #content, 1332 | .one-column #content { 1333 | margin: 24pt 0 0; 1334 | width: 100%; 1335 | } 1336 | .wp-caption p { 1337 | font-size: 11pt; 1338 | } 1339 | #site-info, 1340 | #credits { 1341 | float: none; 1342 | width: auto; 1343 | } 1344 | #copyright { 1345 | width: auto; 1346 | } 1347 | img#wpstats { 1348 | display: none; 1349 | } 1350 | #credits a { 1351 | margin: 0; 1352 | padding: 0; 1353 | } 1354 | #entry-author-info { 1355 | border: 1px solid #e7e7e7; 1356 | } 1357 | #main { 1358 | display: inline; 1359 | } 1360 | .home .sticky { 1361 | border: none; 1362 | } 1363 | } -------------------------------------------------------------------------------- /js/jquery.cycle.all.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery Cycle Plugin (with Transition Definitions) 3 | * Examples and documentation at: http://jquery.malsup.com/cycle/ 4 | * Copyright (c) 2007-2010 M. Alsup 5 | * Version: 2.9995 (09-AUG-2011) 6 | * Dual licensed under the MIT and GPL licenses. 7 | * http://jquery.malsup.com/license.html 8 | * Requires: jQuery v1.3.2 or later 9 | */ 10 | ;(function($) { 11 | 12 | var ver = '2.9995'; 13 | 14 | // if $.support is not defined (pre jQuery 1.3) add what I need 15 | if ($.support == undefined) { 16 | $.support = { 17 | opacity: !($.browser.msie) 18 | }; 19 | } 20 | 21 | function debug(s) { 22 | $.fn.cycle.debug && log(s); 23 | } 24 | function log() { 25 | window.console && console.log && console.log('[cycle] ' + Array.prototype.join.call(arguments,' ')); 26 | } 27 | $.expr[':'].paused = function(el) { 28 | return el.cyclePause; 29 | } 30 | 31 | 32 | // the options arg can be... 33 | // a number - indicates an immediate transition should occur to the given slide index 34 | // a string - 'pause', 'resume', 'toggle', 'next', 'prev', 'stop', 'destroy' or the name of a transition effect (ie, 'fade', 'zoom', etc) 35 | // an object - properties to control the slideshow 36 | // 37 | // the arg2 arg can be... 38 | // the name of an fx (only used in conjunction with a numeric value for 'options') 39 | // the value true (only used in first arg == 'resume') and indicates 40 | // that the resume should occur immediately (not wait for next timeout) 41 | 42 | $.fn.cycle = function(options, arg2) { 43 | var o = { s: this.selector, c: this.context }; 44 | 45 | // in 1.3+ we can fix mistakes with the ready state 46 | if (this.length === 0 && options != 'stop') { 47 | if (!$.isReady && o.s) { 48 | log('DOM not ready, queuing slideshow'); 49 | $(function() { 50 | $(o.s,o.c).cycle(options,arg2); 51 | }); 52 | return this; 53 | } 54 | // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() 55 | log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); 56 | return this; 57 | } 58 | 59 | // iterate the matched nodeset 60 | return this.each(function() { 61 | var opts = handleArguments(this, options, arg2); 62 | if (opts === false) 63 | return; 64 | 65 | opts.updateActivePagerLink = opts.updateActivePagerLink || $.fn.cycle.updateActivePagerLink; 66 | 67 | // stop existing slideshow for this container (if there is one) 68 | if (this.cycleTimeout) 69 | clearTimeout(this.cycleTimeout); 70 | this.cycleTimeout = this.cyclePause = 0; 71 | 72 | var $cont = $(this); 73 | var $slides = opts.slideExpr ? $(opts.slideExpr, this) : $cont.children(); 74 | var els = $slides.get(); 75 | 76 | var opts2 = buildOptions($cont, $slides, els, opts, o); 77 | if (opts2 === false) 78 | return; 79 | 80 | if (els.length < 2) { 81 | log('terminating; too few slides: ' + els.length); 82 | return; 83 | } 84 | 85 | var startTime = opts2.continuous ? 10 : getTimeout(els[opts2.currSlide], els[opts2.nextSlide], opts2, !opts2.backwards); 86 | 87 | // if it's an auto slideshow, kick it off 88 | if (startTime) { 89 | startTime += (opts2.delay || 0); 90 | if (startTime < 10) 91 | startTime = 10; 92 | debug('first timeout: ' + startTime); 93 | this.cycleTimeout = setTimeout(function(){go(els,opts2,0,!opts.backwards)}, startTime); 94 | } 95 | }); 96 | }; 97 | 98 | function triggerPause(cont, byHover, onPager) { 99 | var opts = $(cont).data('cycle.opts'); 100 | var paused = !!cont.cyclePause; 101 | if (paused && opts.paused) 102 | opts.paused(cont, opts, byHover, onPager); 103 | else if (!paused && opts.resumed) 104 | opts.resumed(cont, opts, byHover, onPager); 105 | } 106 | 107 | // process the args that were passed to the plugin fn 108 | function handleArguments(cont, options, arg2) { 109 | if (cont.cycleStop == undefined) 110 | cont.cycleStop = 0; 111 | if (options === undefined || options === null) 112 | options = {}; 113 | if (options.constructor == String) { 114 | switch(options) { 115 | case 'destroy': 116 | case 'stop': 117 | var opts = $(cont).data('cycle.opts'); 118 | if (!opts) 119 | return false; 120 | cont.cycleStop++; // callbacks look for change 121 | if (cont.cycleTimeout) 122 | clearTimeout(cont.cycleTimeout); 123 | cont.cycleTimeout = 0; 124 | opts.elements && $(opts.elements).stop(); 125 | $(cont).removeData('cycle.opts'); 126 | if (options == 'destroy') 127 | destroy(opts); 128 | return false; 129 | case 'toggle': 130 | cont.cyclePause = (cont.cyclePause === 1) ? 0 : 1; 131 | checkInstantResume(cont.cyclePause, arg2, cont); 132 | triggerPause(cont); 133 | return false; 134 | case 'pause': 135 | cont.cyclePause = 1; 136 | triggerPause(cont); 137 | return false; 138 | case 'resume': 139 | cont.cyclePause = 0; 140 | checkInstantResume(false, arg2, cont); 141 | triggerPause(cont); 142 | return false; 143 | case 'prev': 144 | case 'next': 145 | var opts = $(cont).data('cycle.opts'); 146 | if (!opts) { 147 | log('options not found, "prev/next" ignored'); 148 | return false; 149 | } 150 | $.fn.cycle[options](opts); 151 | return false; 152 | default: 153 | options = { fx: options }; 154 | }; 155 | return options; 156 | } 157 | else if (options.constructor == Number) { 158 | // go to the requested slide 159 | var num = options; 160 | options = $(cont).data('cycle.opts'); 161 | if (!options) { 162 | log('options not found, can not advance slide'); 163 | return false; 164 | } 165 | if (num < 0 || num >= options.elements.length) { 166 | log('invalid slide index: ' + num); 167 | return false; 168 | } 169 | options.nextSlide = num; 170 | if (cont.cycleTimeout) { 171 | clearTimeout(cont.cycleTimeout); 172 | cont.cycleTimeout = 0; 173 | } 174 | if (typeof arg2 == 'string') 175 | options.oneTimeFx = arg2; 176 | go(options.elements, options, 1, num >= options.currSlide); 177 | return false; 178 | } 179 | return options; 180 | 181 | function checkInstantResume(isPaused, arg2, cont) { 182 | if (!isPaused && arg2 === true) { // resume now! 183 | var options = $(cont).data('cycle.opts'); 184 | if (!options) { 185 | log('options not found, can not resume'); 186 | return false; 187 | } 188 | if (cont.cycleTimeout) { 189 | clearTimeout(cont.cycleTimeout); 190 | cont.cycleTimeout = 0; 191 | } 192 | go(options.elements, options, 1, !options.backwards); 193 | } 194 | } 195 | }; 196 | 197 | function removeFilter(el, opts) { 198 | if (!$.support.opacity && opts.cleartype && el.style.filter) { 199 | try { el.style.removeAttribute('filter'); } 200 | catch(smother) {} // handle old opera versions 201 | } 202 | }; 203 | 204 | // unbind event handlers 205 | function destroy(opts) { 206 | if (opts.next) 207 | $(opts.next).unbind(opts.prevNextEvent); 208 | if (opts.prev) 209 | $(opts.prev).unbind(opts.prevNextEvent); 210 | 211 | if (opts.pager || opts.pagerAnchorBuilder) 212 | $.each(opts.pagerAnchors || [], function() { 213 | this.unbind().remove(); 214 | }); 215 | opts.pagerAnchors = null; 216 | if (opts.destroy) // callback 217 | opts.destroy(opts); 218 | }; 219 | 220 | // one-time initialization 221 | function buildOptions($cont, $slides, els, options, o) { 222 | // support metadata plugin (v1.0 and v2.0) 223 | var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {}); 224 | var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null; 225 | if (meta) 226 | opts = $.extend(opts, meta); 227 | if (opts.autostop) 228 | opts.countdown = opts.autostopCount || els.length; 229 | 230 | var cont = $cont[0]; 231 | $cont.data('cycle.opts', opts); 232 | opts.$cont = $cont; 233 | opts.stopCount = cont.cycleStop; 234 | opts.elements = els; 235 | opts.before = opts.before ? [opts.before] : []; 236 | opts.after = opts.after ? [opts.after] : []; 237 | 238 | // push some after callbacks 239 | if (!$.support.opacity && opts.cleartype) 240 | opts.after.push(function() { removeFilter(this, opts); }); 241 | if (opts.continuous) 242 | opts.after.push(function() { go(els,opts,0,!opts.backwards); }); 243 | 244 | saveOriginalOpts(opts); 245 | 246 | // clearType corrections 247 | if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) 248 | clearTypeFix($slides); 249 | 250 | // container requires non-static position so that slides can be position within 251 | if ($cont.css('position') == 'static') 252 | $cont.css('position', 'relative'); 253 | if (opts.width) 254 | $cont.width(opts.width); 255 | if (opts.height && opts.height != 'auto') 256 | $cont.height(opts.height); 257 | 258 | if (opts.startingSlide) 259 | opts.startingSlide = parseInt(opts.startingSlide,10); 260 | else if (opts.backwards) 261 | opts.startingSlide = els.length - 1; 262 | 263 | // if random, mix up the slide array 264 | if (opts.random) { 265 | opts.randomMap = []; 266 | for (var i = 0; i < els.length; i++) 267 | opts.randomMap.push(i); 268 | opts.randomMap.sort(function(a,b) {return Math.random() - 0.5;}); 269 | opts.randomIndex = 1; 270 | opts.startingSlide = opts.randomMap[1]; 271 | } 272 | else if (opts.startingSlide >= els.length) 273 | opts.startingSlide = 0; // catch bogus input 274 | opts.currSlide = opts.startingSlide || 0; 275 | var first = opts.startingSlide; 276 | 277 | // set position and zIndex on all the slides 278 | $slides.css({position: 'absolute', top:0, left:0}).hide().each(function(i) { 279 | var z; 280 | if (opts.backwards) 281 | z = first ? i <= first ? els.length + (i-first) : first-i : els.length-i; 282 | else 283 | z = first ? i >= first ? els.length - (i-first) : first-i : els.length-i; 284 | $(this).css('z-index', z) 285 | }); 286 | 287 | // make sure first slide is visible 288 | $(els[first]).css('opacity',1).show(); // opacity bit needed to handle restart use case 289 | removeFilter(els[first], opts); 290 | 291 | // stretch slides 292 | if (opts.fit) { 293 | if (!opts.aspect) { 294 | if (opts.width) 295 | $slides.width(opts.width); 296 | if (opts.height && opts.height != 'auto') 297 | $slides.height(opts.height); 298 | } else { 299 | $slides.each(function(){ 300 | var $slide = $(this); 301 | var ratio = (opts.aspect === true) ? $slide.width()/$slide.height() : opts.aspect; 302 | if( opts.width && $slide.width() != opts.width ) { 303 | $slide.width( opts.width ); 304 | $slide.height( opts.width / ratio ); 305 | } 306 | 307 | if( opts.height && $slide.height() < opts.height ) { 308 | $slide.height( opts.height ); 309 | $slide.width( opts.height * ratio ); 310 | } 311 | }); 312 | } 313 | } 314 | 315 | if (opts.center && ((!opts.fit) || opts.aspect)) { 316 | $slides.each(function(){ 317 | var $slide = $(this); 318 | $slide.css({ 319 | "margin-left": opts.width ? 320 | ((opts.width - $slide.width()) / 2) + "px" : 321 | 0, 322 | "margin-top": opts.height ? 323 | ((opts.height - $slide.height()) / 2) + "px" : 324 | 0 325 | }); 326 | }); 327 | } 328 | 329 | if (opts.center && !opts.fit && !opts.slideResize) { 330 | $slides.each(function(){ 331 | var $slide = $(this); 332 | $slide.css({ 333 | "margin-left": opts.width ? ((opts.width - $slide.width()) / 2) + "px" : 0, 334 | "margin-top": opts.height ? ((opts.height - $slide.height()) / 2) + "px" : 0 335 | }); 336 | }); 337 | } 338 | 339 | // stretch container 340 | var reshape = opts.containerResize && !$cont.innerHeight(); 341 | if (reshape) { // do this only if container has no size http://tinyurl.com/da2oa9 342 | var maxw = 0, maxh = 0; 343 | for(var j=0; j < els.length; j++) { 344 | var $e = $(els[j]), e = $e[0], w = $e.outerWidth(), h = $e.outerHeight(); 345 | if (!w) w = e.offsetWidth || e.width || $e.attr('width'); 346 | if (!h) h = e.offsetHeight || e.height || $e.attr('height'); 347 | maxw = w > maxw ? w : maxw; 348 | maxh = h > maxh ? h : maxh; 349 | } 350 | if (maxw > 0 && maxh > 0) 351 | $cont.css({width:maxw+'px',height:maxh+'px'}); 352 | } 353 | 354 | var pauseFlag = false; // https://github.com/malsup/cycle/issues/44 355 | if (opts.pause) 356 | $cont.hover( 357 | function(){ 358 | pauseFlag = true; 359 | this.cyclePause++; 360 | triggerPause(cont, true); 361 | }, 362 | function(){ 363 | pauseFlag && this.cyclePause--; 364 | triggerPause(cont, true); 365 | } 366 | ); 367 | 368 | if (supportMultiTransitions(opts) === false) 369 | return false; 370 | 371 | // apparently a lot of people use image slideshows without height/width attributes on the images. 372 | // Cycle 2.50+ requires the sizing info for every slide; this block tries to deal with that. 373 | var requeue = false; 374 | options.requeueAttempts = options.requeueAttempts || 0; 375 | $slides.each(function() { 376 | // try to get height/width of each slide 377 | var $el = $(this); 378 | this.cycleH = (opts.fit && opts.height) ? opts.height : ($el.height() || this.offsetHeight || this.height || $el.attr('height') || 0); 379 | this.cycleW = (opts.fit && opts.width) ? opts.width : ($el.width() || this.offsetWidth || this.width || $el.attr('width') || 0); 380 | 381 | if ( $el.is('img') ) { 382 | // sigh.. sniffing, hacking, shrugging... this crappy hack tries to account for what browsers do when 383 | // an image is being downloaded and the markup did not include sizing info (height/width attributes); 384 | // there seems to be some "default" sizes used in this situation 385 | var loadingIE = ($.browser.msie && this.cycleW == 28 && this.cycleH == 30 && !this.complete); 386 | var loadingFF = ($.browser.mozilla && this.cycleW == 34 && this.cycleH == 19 && !this.complete); 387 | var loadingOp = ($.browser.opera && ((this.cycleW == 42 && this.cycleH == 19) || (this.cycleW == 37 && this.cycleH == 17)) && !this.complete); 388 | var loadingOther = (this.cycleH == 0 && this.cycleW == 0 && !this.complete); 389 | // don't requeue for images that are still loading but have a valid size 390 | if (loadingIE || loadingFF || loadingOp || loadingOther) { 391 | if (o.s && opts.requeueOnImageNotLoaded && ++options.requeueAttempts < 100) { // track retry count so we don't loop forever 392 | log(options.requeueAttempts,' - img slide not loaded, requeuing slideshow: ', this.src, this.cycleW, this.cycleH); 393 | setTimeout(function() {$(o.s,o.c).cycle(options)}, opts.requeueTimeout); 394 | requeue = true; 395 | return false; // break each loop 396 | } 397 | else { 398 | log('could not determine size of image: '+this.src, this.cycleW, this.cycleH); 399 | } 400 | } 401 | } 402 | return true; 403 | }); 404 | 405 | if (requeue) 406 | return false; 407 | 408 | opts.cssBefore = opts.cssBefore || {}; 409 | opts.cssAfter = opts.cssAfter || {}; 410 | opts.cssFirst = opts.cssFirst || {}; 411 | opts.animIn = opts.animIn || {}; 412 | opts.animOut = opts.animOut || {}; 413 | 414 | $slides.not(':eq('+first+')').css(opts.cssBefore); 415 | $($slides[first]).css(opts.cssFirst); 416 | 417 | if (opts.timeout) { 418 | opts.timeout = parseInt(opts.timeout,10); 419 | // ensure that timeout and speed settings are sane 420 | if (opts.speed.constructor == String) 421 | opts.speed = $.fx.speeds[opts.speed] || parseInt(opts.speed,10); 422 | if (!opts.sync) 423 | opts.speed = opts.speed / 2; 424 | 425 | var buffer = opts.fx == 'none' ? 0 : opts.fx == 'shuffle' ? 500 : 250; 426 | while((opts.timeout - opts.speed) < buffer) // sanitize timeout 427 | opts.timeout += opts.speed; 428 | } 429 | if (opts.easing) 430 | opts.easeIn = opts.easeOut = opts.easing; 431 | if (!opts.speedIn) 432 | opts.speedIn = opts.speed; 433 | if (!opts.speedOut) 434 | opts.speedOut = opts.speed; 435 | 436 | opts.slideCount = els.length; 437 | opts.currSlide = opts.lastSlide = first; 438 | if (opts.random) { 439 | if (++opts.randomIndex == els.length) 440 | opts.randomIndex = 0; 441 | opts.nextSlide = opts.randomMap[opts.randomIndex]; 442 | } 443 | else if (opts.backwards) 444 | opts.nextSlide = opts.startingSlide == 0 ? (els.length-1) : opts.startingSlide-1; 445 | else 446 | opts.nextSlide = opts.startingSlide >= (els.length-1) ? 0 : opts.startingSlide+1; 447 | 448 | // run transition init fn 449 | if (!opts.multiFx) { 450 | var init = $.fn.cycle.transitions[opts.fx]; 451 | if ($.isFunction(init)) 452 | init($cont, $slides, opts); 453 | else if (opts.fx != 'custom' && !opts.multiFx) { 454 | log('unknown transition: ' + opts.fx,'; slideshow terminating'); 455 | return false; 456 | } 457 | } 458 | 459 | // fire artificial events 460 | var e0 = $slides[first]; 461 | if (!opts.skipInitializationCallbacks) { 462 | if (opts.before.length) 463 | opts.before[0].apply(e0, [e0, e0, opts, true]); 464 | if (opts.after.length) 465 | opts.after[0].apply(e0, [e0, e0, opts, true]); 466 | } 467 | if (opts.next) 468 | $(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,1)}); 469 | if (opts.prev) 470 | $(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,0)}); 471 | if (opts.pager || opts.pagerAnchorBuilder) 472 | buildPager(els,opts); 473 | 474 | exposeAddSlide(opts, els); 475 | 476 | return opts; 477 | }; 478 | 479 | // save off original opts so we can restore after clearing state 480 | function saveOriginalOpts(opts) { 481 | opts.original = { before: [], after: [] }; 482 | opts.original.cssBefore = $.extend({}, opts.cssBefore); 483 | opts.original.cssAfter = $.extend({}, opts.cssAfter); 484 | opts.original.animIn = $.extend({}, opts.animIn); 485 | opts.original.animOut = $.extend({}, opts.animOut); 486 | $.each(opts.before, function() { opts.original.before.push(this); }); 487 | $.each(opts.after, function() { opts.original.after.push(this); }); 488 | }; 489 | 490 | function supportMultiTransitions(opts) { 491 | var i, tx, txs = $.fn.cycle.transitions; 492 | // look for multiple effects 493 | if (opts.fx.indexOf(',') > 0) { 494 | opts.multiFx = true; 495 | opts.fxs = opts.fx.replace(/\s*/g,'').split(','); 496 | // discard any bogus effect names 497 | for (i=0; i < opts.fxs.length; i++) { 498 | var fx = opts.fxs[i]; 499 | tx = txs[fx]; 500 | if (!tx || !txs.hasOwnProperty(fx) || !$.isFunction(tx)) { 501 | log('discarding unknown transition: ',fx); 502 | opts.fxs.splice(i,1); 503 | i--; 504 | } 505 | } 506 | // if we have an empty list then we threw everything away! 507 | if (!opts.fxs.length) { 508 | log('No valid transitions named; slideshow terminating.'); 509 | return false; 510 | } 511 | } 512 | else if (opts.fx == 'all') { // auto-gen the list of transitions 513 | opts.multiFx = true; 514 | opts.fxs = []; 515 | for (p in txs) { 516 | tx = txs[p]; 517 | if (txs.hasOwnProperty(p) && $.isFunction(tx)) 518 | opts.fxs.push(p); 519 | } 520 | } 521 | if (opts.multiFx && opts.randomizeEffects) { 522 | // munge the fxs array to make effect selection random 523 | var r1 = Math.floor(Math.random() * 20) + 30; 524 | for (i = 0; i < r1; i++) { 525 | var r2 = Math.floor(Math.random() * opts.fxs.length); 526 | opts.fxs.push(opts.fxs.splice(r2,1)[0]); 527 | } 528 | debug('randomized fx sequence: ',opts.fxs); 529 | } 530 | return true; 531 | }; 532 | 533 | // provide a mechanism for adding slides after the slideshow has started 534 | function exposeAddSlide(opts, els) { 535 | opts.addSlide = function(newSlide, prepend) { 536 | var $s = $(newSlide), s = $s[0]; 537 | if (!opts.autostopCount) 538 | opts.countdown++; 539 | els[prepend?'unshift':'push'](s); 540 | if (opts.els) 541 | opts.els[prepend?'unshift':'push'](s); // shuffle needs this 542 | opts.slideCount = els.length; 543 | 544 | $s.css('position','absolute'); 545 | $s[prepend?'prependTo':'appendTo'](opts.$cont); 546 | 547 | if (prepend) { 548 | opts.currSlide++; 549 | opts.nextSlide++; 550 | } 551 | 552 | if (!$.support.opacity && opts.cleartype && !opts.cleartypeNoBg) 553 | clearTypeFix($s); 554 | 555 | if (opts.fit && opts.width) 556 | $s.width(opts.width); 557 | if (opts.fit && opts.height && opts.height != 'auto') 558 | $s.height(opts.height); 559 | s.cycleH = (opts.fit && opts.height) ? opts.height : $s.height(); 560 | s.cycleW = (opts.fit && opts.width) ? opts.width : $s.width(); 561 | 562 | $s.css(opts.cssBefore); 563 | 564 | if (opts.pager || opts.pagerAnchorBuilder) 565 | $.fn.cycle.createPagerAnchor(els.length-1, s, $(opts.pager), els, opts); 566 | 567 | if ($.isFunction(opts.onAddSlide)) 568 | opts.onAddSlide($s); 569 | else 570 | $s.hide(); // default behavior 571 | }; 572 | } 573 | 574 | // reset internal state; we do this on every pass in order to support multiple effects 575 | $.fn.cycle.resetState = function(opts, fx) { 576 | fx = fx || opts.fx; 577 | opts.before = []; opts.after = []; 578 | opts.cssBefore = $.extend({}, opts.original.cssBefore); 579 | opts.cssAfter = $.extend({}, opts.original.cssAfter); 580 | opts.animIn = $.extend({}, opts.original.animIn); 581 | opts.animOut = $.extend({}, opts.original.animOut); 582 | opts.fxFn = null; 583 | $.each(opts.original.before, function() { opts.before.push(this); }); 584 | $.each(opts.original.after, function() { opts.after.push(this); }); 585 | 586 | // re-init 587 | var init = $.fn.cycle.transitions[fx]; 588 | if ($.isFunction(init)) 589 | init(opts.$cont, $(opts.elements), opts); 590 | }; 591 | 592 | // this is the main engine fn, it handles the timeouts, callbacks and slide index mgmt 593 | function go(els, opts, manual, fwd) { 594 | // opts.busy is true if we're in the middle of an animation 595 | if (manual && opts.busy && opts.manualTrump) { 596 | // let manual transitions requests trump active ones 597 | debug('manualTrump in go(), stopping active transition'); 598 | $(els).stop(true,true); 599 | opts.busy = 0; 600 | } 601 | // don't begin another timeout-based transition if there is one active 602 | if (opts.busy) { 603 | debug('transition active, ignoring new tx request'); 604 | return; 605 | } 606 | 607 | var p = opts.$cont[0], curr = els[opts.currSlide], next = els[opts.nextSlide]; 608 | 609 | // stop cycling if we have an outstanding stop request 610 | if (p.cycleStop != opts.stopCount || p.cycleTimeout === 0 && !manual) 611 | return; 612 | 613 | // check to see if we should stop cycling based on autostop options 614 | if (!manual && !p.cyclePause && !opts.bounce && 615 | ((opts.autostop && (--opts.countdown <= 0)) || 616 | (opts.nowrap && !opts.random && opts.nextSlide < opts.currSlide))) { 617 | if (opts.end) 618 | opts.end(opts); 619 | return; 620 | } 621 | 622 | // if slideshow is paused, only transition on a manual trigger 623 | var changed = false; 624 | if ((manual || !p.cyclePause) && (opts.nextSlide != opts.currSlide)) { 625 | changed = true; 626 | var fx = opts.fx; 627 | // keep trying to get the slide size if we don't have it yet 628 | curr.cycleH = curr.cycleH || $(curr).height(); 629 | curr.cycleW = curr.cycleW || $(curr).width(); 630 | next.cycleH = next.cycleH || $(next).height(); 631 | next.cycleW = next.cycleW || $(next).width(); 632 | 633 | // support multiple transition types 634 | if (opts.multiFx) { 635 | if (fwd && (opts.lastFx == undefined || ++opts.lastFx >= opts.fxs.length)) 636 | opts.lastFx = 0; 637 | else if (!fwd && (opts.lastFx == undefined || --opts.lastFx < 0)) 638 | opts.lastFx = opts.fxs.length - 1; 639 | fx = opts.fxs[opts.lastFx]; 640 | } 641 | 642 | // one-time fx overrides apply to: $('div').cycle(3,'zoom'); 643 | if (opts.oneTimeFx) { 644 | fx = opts.oneTimeFx; 645 | opts.oneTimeFx = null; 646 | } 647 | 648 | $.fn.cycle.resetState(opts, fx); 649 | 650 | // run the before callbacks 651 | if (opts.before.length) 652 | $.each(opts.before, function(i,o) { 653 | if (p.cycleStop != opts.stopCount) return; 654 | o.apply(next, [curr, next, opts, fwd]); 655 | }); 656 | 657 | // stage the after callacks 658 | var after = function() { 659 | opts.busy = 0; 660 | $.each(opts.after, function(i,o) { 661 | if (p.cycleStop != opts.stopCount) return; 662 | o.apply(next, [curr, next, opts, fwd]); 663 | }); 664 | }; 665 | 666 | debug('tx firing('+fx+'); currSlide: ' + opts.currSlide + '; nextSlide: ' + opts.nextSlide); 667 | 668 | // get ready to perform the transition 669 | opts.busy = 1; 670 | if (opts.fxFn) // fx function provided? 671 | opts.fxFn(curr, next, opts, after, fwd, manual && opts.fastOnEvent); 672 | else if ($.isFunction($.fn.cycle[opts.fx])) // fx plugin ? 673 | $.fn.cycle[opts.fx](curr, next, opts, after, fwd, manual && opts.fastOnEvent); 674 | else 675 | $.fn.cycle.custom(curr, next, opts, after, fwd, manual && opts.fastOnEvent); 676 | } 677 | 678 | if (changed || opts.nextSlide == opts.currSlide) { 679 | // calculate the next slide 680 | opts.lastSlide = opts.currSlide; 681 | if (opts.random) { 682 | opts.currSlide = opts.nextSlide; 683 | if (++opts.randomIndex == els.length) 684 | opts.randomIndex = 0; 685 | opts.nextSlide = opts.randomMap[opts.randomIndex]; 686 | if (opts.nextSlide == opts.currSlide) 687 | opts.nextSlide = (opts.currSlide == opts.slideCount - 1) ? 0 : opts.currSlide + 1; 688 | } 689 | else if (opts.backwards) { 690 | var roll = (opts.nextSlide - 1) < 0; 691 | if (roll && opts.bounce) { 692 | opts.backwards = !opts.backwards; 693 | opts.nextSlide = 1; 694 | opts.currSlide = 0; 695 | } 696 | else { 697 | opts.nextSlide = roll ? (els.length-1) : opts.nextSlide-1; 698 | opts.currSlide = roll ? 0 : opts.nextSlide+1; 699 | } 700 | } 701 | else { // sequence 702 | var roll = (opts.nextSlide + 1) == els.length; 703 | if (roll && opts.bounce) { 704 | opts.backwards = !opts.backwards; 705 | opts.nextSlide = els.length-2; 706 | opts.currSlide = els.length-1; 707 | } 708 | else { 709 | opts.nextSlide = roll ? 0 : opts.nextSlide+1; 710 | opts.currSlide = roll ? els.length-1 : opts.nextSlide-1; 711 | } 712 | } 713 | } 714 | if (changed && opts.pager) 715 | opts.updateActivePagerLink(opts.pager, opts.currSlide, opts.activePagerClass); 716 | 717 | // stage the next transition 718 | var ms = 0; 719 | if (opts.timeout && !opts.continuous) 720 | ms = getTimeout(els[opts.currSlide], els[opts.nextSlide], opts, fwd); 721 | else if (opts.continuous && p.cyclePause) // continuous shows work off an after callback, not this timer logic 722 | ms = 10; 723 | if (ms > 0) 724 | p.cycleTimeout = setTimeout(function(){ go(els, opts, 0, !opts.backwards) }, ms); 725 | }; 726 | 727 | // invoked after transition 728 | $.fn.cycle.updateActivePagerLink = function(pager, currSlide, clsName) { 729 | $(pager).each(function() { 730 | $(this).children().removeClass(clsName).eq(currSlide).addClass(clsName); 731 | }); 732 | }; 733 | 734 | // calculate timeout value for current transition 735 | function getTimeout(curr, next, opts, fwd) { 736 | if (opts.timeoutFn) { 737 | // call user provided calc fn 738 | var t = opts.timeoutFn.call(curr,curr,next,opts,fwd); 739 | while (opts.fx != 'none' && (t - opts.speed) < 250) // sanitize timeout 740 | t += opts.speed; 741 | debug('calculated timeout: ' + t + '; speed: ' + opts.speed); 742 | if (t !== false) 743 | return t; 744 | } 745 | return opts.timeout; 746 | }; 747 | 748 | // expose next/prev function, caller must pass in state 749 | $.fn.cycle.next = function(opts) { advance(opts,1); }; 750 | $.fn.cycle.prev = function(opts) { advance(opts,0);}; 751 | 752 | // advance slide forward or back 753 | function advance(opts, moveForward) { 754 | var val = moveForward ? 1 : -1; 755 | var els = opts.elements; 756 | var p = opts.$cont[0], timeout = p.cycleTimeout; 757 | if (timeout) { 758 | clearTimeout(timeout); 759 | p.cycleTimeout = 0; 760 | } 761 | if (opts.random && val < 0) { 762 | // move back to the previously display slide 763 | opts.randomIndex--; 764 | if (--opts.randomIndex == -2) 765 | opts.randomIndex = els.length-2; 766 | else if (opts.randomIndex == -1) 767 | opts.randomIndex = els.length-1; 768 | opts.nextSlide = opts.randomMap[opts.randomIndex]; 769 | } 770 | else if (opts.random) { 771 | opts.nextSlide = opts.randomMap[opts.randomIndex]; 772 | } 773 | else { 774 | opts.nextSlide = opts.currSlide + val; 775 | if (opts.nextSlide < 0) { 776 | if (opts.nowrap) return false; 777 | opts.nextSlide = els.length - 1; 778 | } 779 | else if (opts.nextSlide >= els.length) { 780 | if (opts.nowrap) return false; 781 | opts.nextSlide = 0; 782 | } 783 | } 784 | 785 | var cb = opts.onPrevNextEvent || opts.prevNextClick; // prevNextClick is deprecated 786 | if ($.isFunction(cb)) 787 | cb(val > 0, opts.nextSlide, els[opts.nextSlide]); 788 | go(els, opts, 1, moveForward); 789 | return false; 790 | }; 791 | 792 | function buildPager(els, opts) { 793 | var $p = $(opts.pager); 794 | $.each(els, function(i,o) { 795 | $.fn.cycle.createPagerAnchor(i,o,$p,els,opts); 796 | }); 797 | opts.updateActivePagerLink(opts.pager, opts.startingSlide, opts.activePagerClass); 798 | }; 799 | 800 | $.fn.cycle.createPagerAnchor = function(i, el, $p, els, opts) { 801 | var a; 802 | if ($.isFunction(opts.pagerAnchorBuilder)) { 803 | a = opts.pagerAnchorBuilder(i,el); 804 | debug('pagerAnchorBuilder('+i+', el) returned: ' + a); 805 | } 806 | else 807 | a = ''+(i+1)+''; 808 | 809 | if (!a) 810 | return; 811 | var $a = $(a); 812 | // don't reparent if anchor is in the dom 813 | if ($a.parents('body').length === 0) { 814 | var arr = []; 815 | if ($p.length > 1) { 816 | $p.each(function() { 817 | var $clone = $a.clone(true); 818 | $(this).append($clone); 819 | arr.push($clone[0]); 820 | }); 821 | $a = $(arr); 822 | } 823 | else { 824 | $a.appendTo($p); 825 | } 826 | } 827 | 828 | opts.pagerAnchors = opts.pagerAnchors || []; 829 | opts.pagerAnchors.push($a); 830 | 831 | var pagerFn = function(e) { 832 | e.preventDefault(); 833 | opts.nextSlide = i; 834 | var p = opts.$cont[0], timeout = p.cycleTimeout; 835 | if (timeout) { 836 | clearTimeout(timeout); 837 | p.cycleTimeout = 0; 838 | } 839 | var cb = opts.onPagerEvent || opts.pagerClick; // pagerClick is deprecated 840 | if ($.isFunction(cb)) 841 | cb(opts.nextSlide, els[opts.nextSlide]); 842 | go(els,opts,1,opts.currSlide < i); // trigger the trans 843 | // return false; // <== allow bubble 844 | } 845 | 846 | if ( /mouseenter|mouseover/i.test(opts.pagerEvent) ) { 847 | $a.hover(pagerFn, function(){/* no-op */} ); 848 | } 849 | else { 850 | $a.bind(opts.pagerEvent, pagerFn); 851 | } 852 | 853 | if ( ! /^click/.test(opts.pagerEvent) && !opts.allowPagerClickBubble) 854 | $a.bind('click.cycle', function(){return false;}); // suppress click 855 | 856 | var cont = opts.$cont[0]; 857 | var pauseFlag = false; // https://github.com/malsup/cycle/issues/44 858 | if (opts.pauseOnPagerHover) { 859 | $a.hover( 860 | function() { 861 | pauseFlag = true; 862 | cont.cyclePause++; 863 | triggerPause(cont,true,true); 864 | }, function() { 865 | pauseFlag && cont.cyclePause--; 866 | triggerPause(cont,true,true); 867 | } 868 | ); 869 | } 870 | }; 871 | 872 | // helper fn to calculate the number of slides between the current and the next 873 | $.fn.cycle.hopsFromLast = function(opts, fwd) { 874 | var hops, l = opts.lastSlide, c = opts.currSlide; 875 | if (fwd) 876 | hops = c > l ? c - l : opts.slideCount - l; 877 | else 878 | hops = c < l ? l - c : l + opts.slideCount - c; 879 | return hops; 880 | }; 881 | 882 | // fix clearType problems in ie6 by setting an explicit bg color 883 | // (otherwise text slides look horrible during a fade transition) 884 | function clearTypeFix($slides) { 885 | debug('applying clearType background-color hack'); 886 | function hex(s) { 887 | s = parseInt(s,10).toString(16); 888 | return s.length < 2 ? '0'+s : s; 889 | }; 890 | function getBg(e) { 891 | for ( ; e && e.nodeName.toLowerCase() != 'html'; e = e.parentNode) { 892 | var v = $.css(e,'background-color'); 893 | if (v && v.indexOf('rgb') >= 0 ) { 894 | var rgb = v.match(/\d+/g); 895 | return '#'+ hex(rgb[0]) + hex(rgb[1]) + hex(rgb[2]); 896 | } 897 | if (v && v != 'transparent') 898 | return v; 899 | } 900 | return '#ffffff'; 901 | }; 902 | $slides.each(function() { $(this).css('background-color', getBg(this)); }); 903 | }; 904 | 905 | // reset common props before the next transition 906 | $.fn.cycle.commonReset = function(curr,next,opts,w,h,rev) { 907 | $(opts.elements).not(curr).hide(); 908 | if (typeof opts.cssBefore.opacity == 'undefined') 909 | opts.cssBefore.opacity = 1; 910 | opts.cssBefore.display = 'block'; 911 | if (opts.slideResize && w !== false && next.cycleW > 0) 912 | opts.cssBefore.width = next.cycleW; 913 | if (opts.slideResize && h !== false && next.cycleH > 0) 914 | opts.cssBefore.height = next.cycleH; 915 | opts.cssAfter = opts.cssAfter || {}; 916 | opts.cssAfter.display = 'none'; 917 | $(curr).css('zIndex',opts.slideCount + (rev === true ? 1 : 0)); 918 | $(next).css('zIndex',opts.slideCount + (rev === true ? 0 : 1)); 919 | }; 920 | 921 | // the actual fn for effecting a transition 922 | $.fn.cycle.custom = function(curr, next, opts, cb, fwd, speedOverride) { 923 | var $l = $(curr), $n = $(next); 924 | var speedIn = opts.speedIn, speedOut = opts.speedOut, easeIn = opts.easeIn, easeOut = opts.easeOut; 925 | $n.css(opts.cssBefore); 926 | if (speedOverride) { 927 | if (typeof speedOverride == 'number') 928 | speedIn = speedOut = speedOverride; 929 | else 930 | speedIn = speedOut = 1; 931 | easeIn = easeOut = null; 932 | } 933 | var fn = function() { 934 | $n.animate(opts.animIn, speedIn, easeIn, function() { 935 | cb(); 936 | }); 937 | }; 938 | $l.animate(opts.animOut, speedOut, easeOut, function() { 939 | $l.css(opts.cssAfter); 940 | if (!opts.sync) 941 | fn(); 942 | }); 943 | if (opts.sync) fn(); 944 | }; 945 | 946 | // transition definitions - only fade is defined here, transition pack defines the rest 947 | $.fn.cycle.transitions = { 948 | fade: function($cont, $slides, opts) { 949 | $slides.not(':eq('+opts.currSlide+')').css('opacity',0); 950 | opts.before.push(function(curr,next,opts) { 951 | $.fn.cycle.commonReset(curr,next,opts); 952 | opts.cssBefore.opacity = 0; 953 | }); 954 | opts.animIn = { opacity: 1 }; 955 | opts.animOut = { opacity: 0 }; 956 | opts.cssBefore = { top: 0, left: 0 }; 957 | } 958 | }; 959 | 960 | $.fn.cycle.ver = function() { return ver; }; 961 | 962 | // override these globally if you like (they are all optional) 963 | $.fn.cycle.defaults = { 964 | activePagerClass: 'activeSlide', // class name used for the active pager link 965 | after: null, // transition callback (scope set to element that was shown): function(currSlideElement, nextSlideElement, options, forwardFlag) 966 | allowPagerClickBubble: false, // allows or prevents click event on pager anchors from bubbling 967 | animIn: null, // properties that define how the slide animates in 968 | animOut: null, // properties that define how the slide animates out 969 | aspect: false, // preserve aspect ratio during fit resizing, cropping if necessary (must be used with fit option) 970 | autostop: 0, // true to end slideshow after X transitions (where X == slide count) 971 | autostopCount: 0, // number of transitions (optionally used with autostop to define X) 972 | backwards: false, // true to start slideshow at last slide and move backwards through the stack 973 | before: null, // transition callback (scope set to element to be shown): function(currSlideElement, nextSlideElement, options, forwardFlag) 974 | center: null, // set to true to have cycle add top/left margin to each slide (use with width and height options) 975 | cleartype: !$.support.opacity, // true if clearType corrections should be applied (for IE) 976 | cleartypeNoBg: false, // set to true to disable extra cleartype fixing (leave false to force background color setting on slides) 977 | containerResize: 1, // resize container to fit largest slide 978 | continuous: 0, // true to start next transition immediately after current one completes 979 | cssAfter: null, // properties that defined the state of the slide after transitioning out 980 | cssBefore: null, // properties that define the initial state of the slide before transitioning in 981 | delay: 0, // additional delay (in ms) for first transition (hint: can be negative) 982 | easeIn: null, // easing for "in" transition 983 | easeOut: null, // easing for "out" transition 984 | easing: null, // easing method for both in and out transitions 985 | end: null, // callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) 986 | fastOnEvent: 0, // force fast transitions when triggered manually (via pager or prev/next); value == time in ms 987 | fit: 0, // force slides to fit container 988 | fx: 'fade', // name of transition effect (or comma separated names, ex: 'fade,scrollUp,shuffle') 989 | fxFn: null, // function used to control the transition: function(currSlideElement, nextSlideElement, options, afterCalback, forwardFlag) 990 | height: 'auto', // container height (if the 'fit' option is true, the slides will be set to this height as well) 991 | manualTrump: true, // causes manual transition to stop an active transition instead of being ignored 992 | metaAttr: 'cycle',// data- attribute that holds the option data for the slideshow 993 | next: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for next slide 994 | nowrap: 0, // true to prevent slideshow from wrapping 995 | onPagerEvent: null, // callback fn for pager events: function(zeroBasedSlideIndex, slideElement) 996 | onPrevNextEvent: null,// callback fn for prev/next events: function(isNext, zeroBasedSlideIndex, slideElement) 997 | pager: null, // element, jQuery object, or jQuery selector string for the element to use as pager container 998 | pagerAnchorBuilder: null, // callback fn for building anchor links: function(index, DOMelement) 999 | pagerEvent: 'click.cycle', // name of event which drives the pager navigation 1000 | pause: 0, // true to enable "pause on hover" 1001 | pauseOnPagerHover: 0, // true to pause when hovering over pager link 1002 | prev: null, // element, jQuery object, or jQuery selector string for the element to use as event trigger for previous slide 1003 | prevNextEvent:'click.cycle',// event which drives the manual transition to the previous or next slide 1004 | random: 0, // true for random, false for sequence (not applicable to shuffle fx) 1005 | randomizeEffects: 1, // valid when multiple effects are used; true to make the effect sequence random 1006 | requeueOnImageNotLoaded: true, // requeue the slideshow if any image slides are not yet loaded 1007 | requeueTimeout: 250, // ms delay for requeue 1008 | rev: 0, // causes animations to transition in reverse (for effects that support it such as scrollHorz/scrollVert/shuffle) 1009 | shuffle: null, // coords for shuffle animation, ex: { top:15, left: 200 } 1010 | skipInitializationCallbacks: false, // set to true to disable the first before/after callback that occurs prior to any transition 1011 | slideExpr: null, // expression for selecting slides (if something other than all children is required) 1012 | slideResize: 1, // force slide width/height to fixed size before every transition 1013 | speed: 1000, // speed of the transition (any valid fx speed value) 1014 | speedIn: null, // speed of the 'in' transition 1015 | speedOut: null, // speed of the 'out' transition 1016 | startingSlide: 0, // zero-based index of the first slide to be displayed 1017 | sync: 1, // true if in/out transitions should occur simultaneously 1018 | timeout: 4000, // milliseconds between slide transitions (0 to disable auto advance) 1019 | timeoutFn: null, // callback for determining per-slide timeout value: function(currSlideElement, nextSlideElement, options, forwardFlag) 1020 | updateActivePagerLink: null, // callback fn invoked to update the active pager link (adds/removes activePagerClass style) 1021 | width: null // container width (if the 'fit' option is true, the slides will be set to this width as well) 1022 | }; 1023 | 1024 | })(jQuery); 1025 | 1026 | 1027 | /*! 1028 | * jQuery Cycle Plugin Transition Definitions 1029 | * This script is a plugin for the jQuery Cycle Plugin 1030 | * Examples and documentation at: http://malsup.com/jquery/cycle/ 1031 | * Copyright (c) 2007-2010 M. Alsup 1032 | * Version: 2.73 1033 | * Dual licensed under the MIT and GPL licenses: 1034 | * http://www.opensource.org/licenses/mit-license.php 1035 | * http://www.gnu.org/licenses/gpl.html 1036 | */ 1037 | (function($) { 1038 | 1039 | // 1040 | // These functions define slide initialization and properties for the named 1041 | // transitions. To save file size feel free to remove any of these that you 1042 | // don't need. 1043 | // 1044 | $.fn.cycle.transitions.none = function($cont, $slides, opts) { 1045 | opts.fxFn = function(curr,next,opts,after){ 1046 | $(next).show(); 1047 | $(curr).hide(); 1048 | after(); 1049 | }; 1050 | }; 1051 | 1052 | // not a cross-fade, fadeout only fades out the top slide 1053 | $.fn.cycle.transitions.fadeout = function($cont, $slides, opts) { 1054 | $slides.not(':eq('+opts.currSlide+')').css({ display: 'block', 'opacity': 1 }); 1055 | opts.before.push(function(curr,next,opts,w,h,rev) { 1056 | $(curr).css('zIndex',opts.slideCount + (!rev === true ? 1 : 0)); 1057 | $(next).css('zIndex',opts.slideCount + (!rev === true ? 0 : 1)); 1058 | }); 1059 | opts.animIn.opacity = 1; 1060 | opts.animOut.opacity = 0; 1061 | opts.cssBefore.opacity = 1; 1062 | opts.cssBefore.display = 'block'; 1063 | opts.cssAfter.zIndex = 0; 1064 | }; 1065 | 1066 | // scrollUp/Down/Left/Right 1067 | $.fn.cycle.transitions.scrollUp = function($cont, $slides, opts) { 1068 | $cont.css('overflow','hidden'); 1069 | opts.before.push($.fn.cycle.commonReset); 1070 | var h = $cont.height(); 1071 | opts.cssBefore.top = h; 1072 | opts.cssBefore.left = 0; 1073 | opts.cssFirst.top = 0; 1074 | opts.animIn.top = 0; 1075 | opts.animOut.top = -h; 1076 | }; 1077 | $.fn.cycle.transitions.scrollDown = function($cont, $slides, opts) { 1078 | $cont.css('overflow','hidden'); 1079 | opts.before.push($.fn.cycle.commonReset); 1080 | var h = $cont.height(); 1081 | opts.cssFirst.top = 0; 1082 | opts.cssBefore.top = -h; 1083 | opts.cssBefore.left = 0; 1084 | opts.animIn.top = 0; 1085 | opts.animOut.top = h; 1086 | }; 1087 | $.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) { 1088 | $cont.css('overflow','hidden'); 1089 | opts.before.push($.fn.cycle.commonReset); 1090 | var w = $cont.width(); 1091 | opts.cssFirst.left = 0; 1092 | opts.cssBefore.left = w; 1093 | opts.cssBefore.top = 0; 1094 | opts.animIn.left = 0; 1095 | opts.animOut.left = 0-w; 1096 | }; 1097 | $.fn.cycle.transitions.scrollRight = function($cont, $slides, opts) { 1098 | $cont.css('overflow','hidden'); 1099 | opts.before.push($.fn.cycle.commonReset); 1100 | var w = $cont.width(); 1101 | opts.cssFirst.left = 0; 1102 | opts.cssBefore.left = -w; 1103 | opts.cssBefore.top = 0; 1104 | opts.animIn.left = 0; 1105 | opts.animOut.left = w; 1106 | }; 1107 | $.fn.cycle.transitions.scrollHorz = function($cont, $slides, opts) { 1108 | $cont.css('overflow','hidden').width(); 1109 | opts.before.push(function(curr, next, opts, fwd) { 1110 | if (opts.rev) 1111 | fwd = !fwd; 1112 | $.fn.cycle.commonReset(curr,next,opts); 1113 | opts.cssBefore.left = fwd ? (next.cycleW-1) : (1-next.cycleW); 1114 | opts.animOut.left = fwd ? -curr.cycleW : curr.cycleW; 1115 | }); 1116 | opts.cssFirst.left = 0; 1117 | opts.cssBefore.top = 0; 1118 | opts.animIn.left = 0; 1119 | opts.animOut.top = 0; 1120 | }; 1121 | $.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) { 1122 | $cont.css('overflow','hidden'); 1123 | opts.before.push(function(curr, next, opts, fwd) { 1124 | if (opts.rev) 1125 | fwd = !fwd; 1126 | $.fn.cycle.commonReset(curr,next,opts); 1127 | opts.cssBefore.top = fwd ? (1-next.cycleH) : (next.cycleH-1); 1128 | opts.animOut.top = fwd ? curr.cycleH : -curr.cycleH; 1129 | }); 1130 | opts.cssFirst.top = 0; 1131 | opts.cssBefore.left = 0; 1132 | opts.animIn.top = 0; 1133 | opts.animOut.left = 0; 1134 | }; 1135 | 1136 | // slideX/slideY 1137 | $.fn.cycle.transitions.slideX = function($cont, $slides, opts) { 1138 | opts.before.push(function(curr, next, opts) { 1139 | $(opts.elements).not(curr).hide(); 1140 | $.fn.cycle.commonReset(curr,next,opts,false,true); 1141 | opts.animIn.width = next.cycleW; 1142 | }); 1143 | opts.cssBefore.left = 0; 1144 | opts.cssBefore.top = 0; 1145 | opts.cssBefore.width = 0; 1146 | opts.animIn.width = 'show'; 1147 | opts.animOut.width = 0; 1148 | }; 1149 | $.fn.cycle.transitions.slideY = function($cont, $slides, opts) { 1150 | opts.before.push(function(curr, next, opts) { 1151 | $(opts.elements).not(curr).hide(); 1152 | $.fn.cycle.commonReset(curr,next,opts,true,false); 1153 | opts.animIn.height = next.cycleH; 1154 | }); 1155 | opts.cssBefore.left = 0; 1156 | opts.cssBefore.top = 0; 1157 | opts.cssBefore.height = 0; 1158 | opts.animIn.height = 'show'; 1159 | opts.animOut.height = 0; 1160 | }; 1161 | 1162 | // shuffle 1163 | $.fn.cycle.transitions.shuffle = function($cont, $slides, opts) { 1164 | var i, w = $cont.css('overflow', 'visible').width(); 1165 | $slides.css({left: 0, top: 0}); 1166 | opts.before.push(function(curr,next,opts) { 1167 | $.fn.cycle.commonReset(curr,next,opts,true,true,true); 1168 | }); 1169 | // only adjust speed once! 1170 | if (!opts.speedAdjusted) { 1171 | opts.speed = opts.speed / 2; // shuffle has 2 transitions 1172 | opts.speedAdjusted = true; 1173 | } 1174 | opts.random = 0; 1175 | opts.shuffle = opts.shuffle || {left:-w, top:15}; 1176 | opts.els = []; 1177 | for (i=0; i < $slides.length; i++) 1178 | opts.els.push($slides[i]); 1179 | 1180 | for (i=0; i < opts.currSlide; i++) 1181 | opts.els.push(opts.els.shift()); 1182 | 1183 | // custom transition fn (hat tip to Benjamin Sterling for this bit of sweetness!) 1184 | opts.fxFn = function(curr, next, opts, cb, fwd) { 1185 | if (opts.rev) 1186 | fwd = !fwd; 1187 | var $el = fwd ? $(curr) : $(next); 1188 | $(next).css(opts.cssBefore); 1189 | var count = opts.slideCount; 1190 | $el.animate(opts.shuffle, opts.speedIn, opts.easeIn, function() { 1191 | var hops = $.fn.cycle.hopsFromLast(opts, fwd); 1192 | for (var k=0; k < hops; k++) 1193 | fwd ? opts.els.push(opts.els.shift()) : opts.els.unshift(opts.els.pop()); 1194 | if (fwd) { 1195 | for (var i=0, len=opts.els.length; i < len; i++) 1196 | $(opts.els[i]).css('z-index', len-i+count); 1197 | } 1198 | else { 1199 | var z = $(curr).css('z-index'); 1200 | $el.css('z-index', parseInt(z,10)+1+count); 1201 | } 1202 | $el.animate({left:0, top:0}, opts.speedOut, opts.easeOut, function() { 1203 | $(fwd ? this : curr).hide(); 1204 | if (cb) cb(); 1205 | }); 1206 | }); 1207 | }; 1208 | $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 }); 1209 | }; 1210 | 1211 | // turnUp/Down/Left/Right 1212 | $.fn.cycle.transitions.turnUp = function($cont, $slides, opts) { 1213 | opts.before.push(function(curr, next, opts) { 1214 | $.fn.cycle.commonReset(curr,next,opts,true,false); 1215 | opts.cssBefore.top = next.cycleH; 1216 | opts.animIn.height = next.cycleH; 1217 | opts.animOut.width = next.cycleW; 1218 | }); 1219 | opts.cssFirst.top = 0; 1220 | opts.cssBefore.left = 0; 1221 | opts.cssBefore.height = 0; 1222 | opts.animIn.top = 0; 1223 | opts.animOut.height = 0; 1224 | }; 1225 | $.fn.cycle.transitions.turnDown = function($cont, $slides, opts) { 1226 | opts.before.push(function(curr, next, opts) { 1227 | $.fn.cycle.commonReset(curr,next,opts,true,false); 1228 | opts.animIn.height = next.cycleH; 1229 | opts.animOut.top = curr.cycleH; 1230 | }); 1231 | opts.cssFirst.top = 0; 1232 | opts.cssBefore.left = 0; 1233 | opts.cssBefore.top = 0; 1234 | opts.cssBefore.height = 0; 1235 | opts.animOut.height = 0; 1236 | }; 1237 | $.fn.cycle.transitions.turnLeft = function($cont, $slides, opts) { 1238 | opts.before.push(function(curr, next, opts) { 1239 | $.fn.cycle.commonReset(curr,next,opts,false,true); 1240 | opts.cssBefore.left = next.cycleW; 1241 | opts.animIn.width = next.cycleW; 1242 | }); 1243 | opts.cssBefore.top = 0; 1244 | opts.cssBefore.width = 0; 1245 | opts.animIn.left = 0; 1246 | opts.animOut.width = 0; 1247 | }; 1248 | $.fn.cycle.transitions.turnRight = function($cont, $slides, opts) { 1249 | opts.before.push(function(curr, next, opts) { 1250 | $.fn.cycle.commonReset(curr,next,opts,false,true); 1251 | opts.animIn.width = next.cycleW; 1252 | opts.animOut.left = curr.cycleW; 1253 | }); 1254 | $.extend(opts.cssBefore, { top: 0, left: 0, width: 0 }); 1255 | opts.animIn.left = 0; 1256 | opts.animOut.width = 0; 1257 | }; 1258 | 1259 | // zoom 1260 | $.fn.cycle.transitions.zoom = function($cont, $slides, opts) { 1261 | opts.before.push(function(curr, next, opts) { 1262 | $.fn.cycle.commonReset(curr,next,opts,false,false,true); 1263 | opts.cssBefore.top = next.cycleH/2; 1264 | opts.cssBefore.left = next.cycleW/2; 1265 | $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH }); 1266 | $.extend(opts.animOut, { width: 0, height: 0, top: curr.cycleH/2, left: curr.cycleW/2 }); 1267 | }); 1268 | opts.cssFirst.top = 0; 1269 | opts.cssFirst.left = 0; 1270 | opts.cssBefore.width = 0; 1271 | opts.cssBefore.height = 0; 1272 | }; 1273 | 1274 | // fadeZoom 1275 | $.fn.cycle.transitions.fadeZoom = function($cont, $slides, opts) { 1276 | opts.before.push(function(curr, next, opts) { 1277 | $.fn.cycle.commonReset(curr,next,opts,false,false); 1278 | opts.cssBefore.left = next.cycleW/2; 1279 | opts.cssBefore.top = next.cycleH/2; 1280 | $.extend(opts.animIn, { top: 0, left: 0, width: next.cycleW, height: next.cycleH }); 1281 | }); 1282 | opts.cssBefore.width = 0; 1283 | opts.cssBefore.height = 0; 1284 | opts.animOut.opacity = 0; 1285 | }; 1286 | 1287 | // blindX 1288 | $.fn.cycle.transitions.blindX = function($cont, $slides, opts) { 1289 | var w = $cont.css('overflow','hidden').width(); 1290 | opts.before.push(function(curr, next, opts) { 1291 | $.fn.cycle.commonReset(curr,next,opts); 1292 | opts.animIn.width = next.cycleW; 1293 | opts.animOut.left = curr.cycleW; 1294 | }); 1295 | opts.cssBefore.left = w; 1296 | opts.cssBefore.top = 0; 1297 | opts.animIn.left = 0; 1298 | opts.animOut.left = w; 1299 | }; 1300 | // blindY 1301 | $.fn.cycle.transitions.blindY = function($cont, $slides, opts) { 1302 | var h = $cont.css('overflow','hidden').height(); 1303 | opts.before.push(function(curr, next, opts) { 1304 | $.fn.cycle.commonReset(curr,next,opts); 1305 | opts.animIn.height = next.cycleH; 1306 | opts.animOut.top = curr.cycleH; 1307 | }); 1308 | opts.cssBefore.top = h; 1309 | opts.cssBefore.left = 0; 1310 | opts.animIn.top = 0; 1311 | opts.animOut.top = h; 1312 | }; 1313 | // blindZ 1314 | $.fn.cycle.transitions.blindZ = function($cont, $slides, opts) { 1315 | var h = $cont.css('overflow','hidden').height(); 1316 | var w = $cont.width(); 1317 | opts.before.push(function(curr, next, opts) { 1318 | $.fn.cycle.commonReset(curr,next,opts); 1319 | opts.animIn.height = next.cycleH; 1320 | opts.animOut.top = curr.cycleH; 1321 | }); 1322 | opts.cssBefore.top = h; 1323 | opts.cssBefore.left = w; 1324 | opts.animIn.top = 0; 1325 | opts.animIn.left = 0; 1326 | opts.animOut.top = h; 1327 | opts.animOut.left = w; 1328 | }; 1329 | 1330 | // growX - grow horizontally from centered 0 width 1331 | $.fn.cycle.transitions.growX = function($cont, $slides, opts) { 1332 | opts.before.push(function(curr, next, opts) { 1333 | $.fn.cycle.commonReset(curr,next,opts,false,true); 1334 | opts.cssBefore.left = this.cycleW/2; 1335 | opts.animIn.left = 0; 1336 | opts.animIn.width = this.cycleW; 1337 | opts.animOut.left = 0; 1338 | }); 1339 | opts.cssBefore.top = 0; 1340 | opts.cssBefore.width = 0; 1341 | }; 1342 | // growY - grow vertically from centered 0 height 1343 | $.fn.cycle.transitions.growY = function($cont, $slides, opts) { 1344 | opts.before.push(function(curr, next, opts) { 1345 | $.fn.cycle.commonReset(curr,next,opts,true,false); 1346 | opts.cssBefore.top = this.cycleH/2; 1347 | opts.animIn.top = 0; 1348 | opts.animIn.height = this.cycleH; 1349 | opts.animOut.top = 0; 1350 | }); 1351 | opts.cssBefore.height = 0; 1352 | opts.cssBefore.left = 0; 1353 | }; 1354 | 1355 | // curtainX - squeeze in both edges horizontally 1356 | $.fn.cycle.transitions.curtainX = function($cont, $slides, opts) { 1357 | opts.before.push(function(curr, next, opts) { 1358 | $.fn.cycle.commonReset(curr,next,opts,false,true,true); 1359 | opts.cssBefore.left = next.cycleW/2; 1360 | opts.animIn.left = 0; 1361 | opts.animIn.width = this.cycleW; 1362 | opts.animOut.left = curr.cycleW/2; 1363 | opts.animOut.width = 0; 1364 | }); 1365 | opts.cssBefore.top = 0; 1366 | opts.cssBefore.width = 0; 1367 | }; 1368 | // curtainY - squeeze in both edges vertically 1369 | $.fn.cycle.transitions.curtainY = function($cont, $slides, opts) { 1370 | opts.before.push(function(curr, next, opts) { 1371 | $.fn.cycle.commonReset(curr,next,opts,true,false,true); 1372 | opts.cssBefore.top = next.cycleH/2; 1373 | opts.animIn.top = 0; 1374 | opts.animIn.height = next.cycleH; 1375 | opts.animOut.top = curr.cycleH/2; 1376 | opts.animOut.height = 0; 1377 | }); 1378 | opts.cssBefore.height = 0; 1379 | opts.cssBefore.left = 0; 1380 | }; 1381 | 1382 | // cover - curr slide covered by next slide 1383 | $.fn.cycle.transitions.cover = function($cont, $slides, opts) { 1384 | var d = opts.direction || 'left'; 1385 | var w = $cont.css('overflow','hidden').width(); 1386 | var h = $cont.height(); 1387 | opts.before.push(function(curr, next, opts) { 1388 | $.fn.cycle.commonReset(curr,next,opts); 1389 | if (d == 'right') 1390 | opts.cssBefore.left = -w; 1391 | else if (d == 'up') 1392 | opts.cssBefore.top = h; 1393 | else if (d == 'down') 1394 | opts.cssBefore.top = -h; 1395 | else 1396 | opts.cssBefore.left = w; 1397 | }); 1398 | opts.animIn.left = 0; 1399 | opts.animIn.top = 0; 1400 | opts.cssBefore.top = 0; 1401 | opts.cssBefore.left = 0; 1402 | }; 1403 | 1404 | // uncover - curr slide moves off next slide 1405 | $.fn.cycle.transitions.uncover = function($cont, $slides, opts) { 1406 | var d = opts.direction || 'left'; 1407 | var w = $cont.css('overflow','hidden').width(); 1408 | var h = $cont.height(); 1409 | opts.before.push(function(curr, next, opts) { 1410 | $.fn.cycle.commonReset(curr,next,opts,true,true,true); 1411 | if (d == 'right') 1412 | opts.animOut.left = w; 1413 | else if (d == 'up') 1414 | opts.animOut.top = -h; 1415 | else if (d == 'down') 1416 | opts.animOut.top = h; 1417 | else 1418 | opts.animOut.left = -w; 1419 | }); 1420 | opts.animIn.left = 0; 1421 | opts.animIn.top = 0; 1422 | opts.cssBefore.top = 0; 1423 | opts.cssBefore.left = 0; 1424 | }; 1425 | 1426 | // toss - move top slide and fade away 1427 | $.fn.cycle.transitions.toss = function($cont, $slides, opts) { 1428 | var w = $cont.css('overflow','visible').width(); 1429 | var h = $cont.height(); 1430 | opts.before.push(function(curr, next, opts) { 1431 | $.fn.cycle.commonReset(curr,next,opts,true,true,true); 1432 | // provide default toss settings if animOut not provided 1433 | if (!opts.animOut.left && !opts.animOut.top) 1434 | $.extend(opts.animOut, { left: w*2, top: -h/2, opacity: 0 }); 1435 | else 1436 | opts.animOut.opacity = 0; 1437 | }); 1438 | opts.cssBefore.left = 0; 1439 | opts.cssBefore.top = 0; 1440 | opts.animIn.left = 0; 1441 | }; 1442 | 1443 | // wipe - clip animation 1444 | $.fn.cycle.transitions.wipe = function($cont, $slides, opts) { 1445 | var w = $cont.css('overflow','hidden').width(); 1446 | var h = $cont.height(); 1447 | opts.cssBefore = opts.cssBefore || {}; 1448 | var clip; 1449 | if (opts.clip) { 1450 | if (/l2r/.test(opts.clip)) 1451 | clip = 'rect(0px 0px '+h+'px 0px)'; 1452 | else if (/r2l/.test(opts.clip)) 1453 | clip = 'rect(0px '+w+'px '+h+'px '+w+'px)'; 1454 | else if (/t2b/.test(opts.clip)) 1455 | clip = 'rect(0px '+w+'px 0px 0px)'; 1456 | else if (/b2t/.test(opts.clip)) 1457 | clip = 'rect('+h+'px '+w+'px '+h+'px 0px)'; 1458 | else if (/zoom/.test(opts.clip)) { 1459 | var top = parseInt(h/2,10); 1460 | var left = parseInt(w/2,10); 1461 | clip = 'rect('+top+'px '+left+'px '+top+'px '+left+'px)'; 1462 | } 1463 | } 1464 | 1465 | opts.cssBefore.clip = opts.cssBefore.clip || clip || 'rect(0px 0px 0px 0px)'; 1466 | 1467 | var d = opts.cssBefore.clip.match(/(\d+)/g); 1468 | var t = parseInt(d[0],10), r = parseInt(d[1],10), b = parseInt(d[2],10), l = parseInt(d[3],10); 1469 | 1470 | opts.before.push(function(curr, next, opts) { 1471 | if (curr == next) return; 1472 | var $curr = $(curr), $next = $(next); 1473 | $.fn.cycle.commonReset(curr,next,opts,true,true,false); 1474 | opts.cssAfter.display = 'block'; 1475 | 1476 | var step = 1, count = parseInt((opts.speedIn / 13),10) - 1; 1477 | (function f() { 1478 | var tt = t ? t - parseInt(step * (t/count),10) : 0; 1479 | var ll = l ? l - parseInt(step * (l/count),10) : 0; 1480 | var bb = b < h ? b + parseInt(step * ((h-b)/count || 1),10) : h; 1481 | var rr = r < w ? r + parseInt(step * ((w-r)/count || 1),10) : w; 1482 | $next.css({ clip: 'rect('+tt+'px '+rr+'px '+bb+'px '+ll+'px)' }); 1483 | (step++ <= count) ? setTimeout(f, 13) : $curr.css('display', 'none'); 1484 | })(); 1485 | }); 1486 | $.extend(opts.cssBefore, { display: 'block', opacity: 1, top: 0, left: 0 }); 1487 | opts.animIn = { left: 0 }; 1488 | opts.animOut = { left: 0 }; 1489 | }; 1490 | 1491 | })(jQuery); 1492 | --------------------------------------------------------------------------------