├── .gitignore ├── .npmignore ├── .travis.yml ├── Makefile ├── example ├── app.js ├── public │ ├── css │ │ ├── boilerplate.css │ │ ├── bootstrap-responsive.css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.min.css │ │ └── style.css │ ├── favicon.ico │ ├── img │ │ ├── glyphicons-halflings-white.png │ │ └── glyphicons-halflings.png │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── jquery-1.8.0.min.js └── views │ ├── index.jade │ └── layout.jade ├── index.js ├── lib └── express-flash.js ├── package.json ├── readme.md └── test ├── flash.spec.js └── flash.test.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | *.tmproj 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .git* 2 | .travis* 3 | Makefile 4 | test/ 5 | example/ 6 | .DS_Store 7 | *.tmproj -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.8" -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | UNITS = $(shell find test -name "*.test.js") 2 | SPECS = $(shell find test -name "*.spec.js") 3 | 4 | unit: 5 | NODE_ENV=test ./node_modules/.bin/mocha $(UNITS) 6 | 7 | spec: 8 | NODE_ENV=test ./node_modules/.bin/mocha $(SPECS) 9 | 10 | test: 11 | NODE_ENV=test ./node_modules/.bin/mocha $(UNITS) $(SPECS) 12 | 13 | .PHONY: test unit spec -------------------------------------------------------------------------------- /example/app.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * express-flash example 3 | */ 4 | 5 | /** 6 | * Module dependencies. 7 | */ 8 | 9 | var express = require('express'), 10 | app = module.exports = express(), 11 | flash = require('../index'); 12 | 13 | // Views 14 | app.set('views', __dirname + '/views'); 15 | app.set('view engine', 'jade'); 16 | app.set('view options', { layout: false }); 17 | 18 | // Configuration 19 | app.use(express.bodyParser()); 20 | app.use(express.static(__dirname + '/public')); 21 | 22 | app.use(express.cookieParser('keyboard cat')); 23 | app.use(express.session({ cookie: { maxAge: 60000 }})); 24 | 25 | // Flash 26 | app.use(flash()); 27 | 28 | // Routes 29 | app.get('/', function (req, res) { 30 | res.render('index', { 31 | title: 'Home' 32 | }); 33 | }); 34 | 35 | // You can add single messages 36 | app.get('/add-message', function (req, res) { 37 | req.flash('info', 'Flash Message Added'); 38 | res.redirect('/'); 39 | }); 40 | 41 | // You can add multiple messages 42 | app.get('/add-messages', function (req, res) { 43 | req.flash('info', 'Flash Message 1 Added'); 44 | req.flash('info', 'Flash Message 2 Added'); 45 | req.flash('info', 'Flash Message 3 Added'); 46 | res.redirect('/'); 47 | }); 48 | 49 | // You can also add and show a flash message within the same route. 50 | app.get('/add-and-show-message', function (req, res) { 51 | req.flash('info', 'Flash Message Added'); 52 | res.render('index', { 53 | title: 'Add and Show Message' 54 | }); 55 | }); 56 | 57 | // Error Handler 58 | app.use(express.errorHandler()); 59 | 60 | /** 61 | * Module exports. 62 | */ 63 | 64 | if (!module.parent) { 65 | app.listen(8000); 66 | console.log('Express app started on port 8000'); 67 | }; -------------------------------------------------------------------------------- /example/public/css/boilerplate.css: -------------------------------------------------------------------------------- 1 | /* 2 | * HTML5 Boilerplate 3 | * 4 | * What follows is the result of much research on cross-browser styling. 5 | * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal, 6 | * Kroc Camen, and the H5BP dev community and team. 7 | * 8 | * Detailed information about this CSS: h5bp.com/css 9 | * 10 | * ==|== normalize ========================================================== 11 | */ 12 | 13 | 14 | /* ============================================================================= 15 | HTML5 display definitions 16 | ========================================================================== */ 17 | 18 | article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; } 19 | audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; } 20 | audio:not([controls]) { display: none; } 21 | [hidden] { display: none; } 22 | 23 | 24 | /* ============================================================================= 25 | Base 26 | ========================================================================== */ 27 | 28 | /* 29 | * 1. Correct text resizing oddly in IE6/7 when body font-size is set using em units 30 | * 2. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g 31 | */ 32 | 33 | html { font-size: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } 34 | 35 | html, button, input, select, textarea { font-family: sans-serif; color: #222; } 36 | 37 | body { margin: 0; font-size: 1em; line-height: 1.4; } 38 | 39 | /* 40 | * Remove text-shadow in selection highlight: h5bp.com/i 41 | * These selection declarations have to be separate 42 | * Also: hot pink! (or customize the background color to match your design) 43 | */ 44 | 45 | ::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; } 46 | ::selection { background: #fe57a1; color: #fff; text-shadow: none; } 47 | 48 | 49 | /* ============================================================================= 50 | Links 51 | ========================================================================== */ 52 | 53 | a { color: #00e; } 54 | a:visited { color: #551a8b; } 55 | a:hover { color: #06e; } 56 | a:focus { outline: thin dotted; } 57 | 58 | /* Improve readability when focused and hovered in all browsers: h5bp.com/h */ 59 | a:hover, a:active { outline: 0; } 60 | 61 | 62 | /* ============================================================================= 63 | Typography 64 | ========================================================================== */ 65 | 66 | abbr[title] { border-bottom: 1px dotted; } 67 | 68 | b, strong { font-weight: bold; } 69 | 70 | blockquote { margin: 1em 40px; } 71 | 72 | dfn { font-style: italic; } 73 | 74 | hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } 75 | 76 | ins { background: #ff9; color: #000; text-decoration: none; } 77 | 78 | mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; } 79 | 80 | /* Redeclare monospace font family: h5bp.com/j */ 81 | pre, code, kbd, samp { font-family: monospace, serif; _font-family: 'courier new', monospace; font-size: 1em; } 82 | 83 | /* Improve readability of pre-formatted text in all browsers */ 84 | pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; } 85 | 86 | q { quotes: none; } 87 | q:before, q:after { content: ""; content: none; } 88 | 89 | small { font-size: 85%; } 90 | 91 | /* Position subscript and superscript content without affecting line-height: h5bp.com/k */ 92 | sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } 93 | sup { top: -0.5em; } 94 | sub { bottom: -0.25em; } 95 | 96 | 97 | /* ============================================================================= 98 | Lists 99 | ========================================================================== */ 100 | 101 | ul, ol { margin: 1em 0; padding: 0 0 0 40px; } 102 | dd { margin: 0 0 0 40px; } 103 | nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; } 104 | 105 | 106 | /* ============================================================================= 107 | Embedded content 108 | ========================================================================== */ 109 | 110 | /* 111 | * 1. Improve image quality when scaled in IE7: h5bp.com/d 112 | * 2. Remove the gap between images and borders on image containers: h5bp.com/i/440 113 | */ 114 | 115 | img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; } 116 | 117 | /* 118 | * Correct overflow not hidden in IE9 119 | */ 120 | 121 | svg:not(:root) { overflow: hidden; } 122 | 123 | 124 | /* ============================================================================= 125 | Figures 126 | ========================================================================== */ 127 | 128 | figure { margin: 0; } 129 | 130 | 131 | /* ============================================================================= 132 | Forms 133 | ========================================================================== */ 134 | 135 | form { margin: 0; } 136 | fieldset { border: 0; margin: 0; padding: 0; } 137 | 138 | /* Indicate that 'label' will shift focus to the associated form element */ 139 | label { cursor: pointer; } 140 | 141 | /* 142 | * 1. Correct color not inheriting in IE6/7/8/9 143 | * 2. Correct alignment displayed oddly in IE6/7 144 | */ 145 | 146 | legend { border: 0; *margin-left: -7px; padding: 0; white-space: normal; } 147 | 148 | /* 149 | * 1. Correct font-size not inheriting in all browsers 150 | * 2. Remove margins in FF3/4 S5 Chrome 151 | * 3. Define consistent vertical alignment display in all browsers 152 | */ 153 | 154 | button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; } 155 | 156 | /* 157 | * 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet) 158 | */ 159 | 160 | button, input { line-height: normal; } 161 | 162 | /* 163 | * 1. Display hand cursor for clickable form elements 164 | * 2. Allow styling of clickable form elements in iOS 165 | * 3. Correct inner spacing displayed oddly in IE7 (doesn't effect IE6) 166 | */ 167 | 168 | button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; -webkit-appearance: button; *overflow: visible; } 169 | 170 | /* 171 | * Re-set default cursor for disabled elements 172 | */ 173 | 174 | button[disabled], input[disabled] { cursor: default; } 175 | 176 | /* 177 | * Consistent box sizing and appearance 178 | */ 179 | 180 | input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; *width: 13px; *height: 13px; } 181 | input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } 182 | input[type="search"]::-webkit-search-decoration, input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; } 183 | 184 | /* 185 | * Remove inner padding and border in FF3/4: h5bp.com/l 186 | */ 187 | 188 | button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } 189 | 190 | /* 191 | * 1. Remove default vertical scrollbar in IE6/7/8/9 192 | * 2. Allow only vertical resizing 193 | */ 194 | 195 | textarea { overflow: auto; vertical-align: top; resize: vertical; } 196 | 197 | /* Colors for form validity */ 198 | input:valid, textarea:valid { } 199 | input:invalid, textarea:invalid { background-color: #f0dddd; } 200 | 201 | 202 | /* ============================================================================= 203 | Tables 204 | ========================================================================== */ 205 | 206 | table { border-collapse: collapse; border-spacing: 0; } 207 | td { vertical-align: top; } 208 | 209 | 210 | /* ============================================================================= 211 | Chrome Frame Prompt 212 | ========================================================================== */ 213 | 214 | .chromeframe { margin: 0.2em 0; background: #ccc; color: black; padding: 0.2em 0; } 215 | 216 | 217 | /* ==|== primary styles ===================================================== 218 | Author: 219 | ========================================================================== */ 220 | 221 | .main { 222 | width: 800px; 223 | margin: 0px auto; 224 | color:#444444; 225 | } 226 | 227 | thead { 228 | background:#F8F8F8; 229 | font-weight:bold; 230 | } 231 | 232 | td { 233 | border:1px solid #DDDDDD; 234 | padding:10px; 235 | } 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | /* ==|== media queries ====================================================== 249 | EXAMPLE Media Query for Responsive Design. 250 | This example overrides the primary ('mobile first') styles 251 | Modify as content requires. 252 | ========================================================================== */ 253 | 254 | @media only screen and (min-width: 35em) { 255 | /* Style adjustments for viewports that meet the condition */ 256 | } 257 | 258 | 259 | 260 | /* ==|== non-semantic helper classes ======================================== 261 | Please define your styles before this section. 262 | ========================================================================== */ 263 | 264 | /* For image replacement */ 265 | .ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; *line-height: 0; } 266 | .ir br { display: none; } 267 | 268 | /* Hide from both screenreaders and browsers: h5bp.com/u */ 269 | .hidden { display: none !important; visibility: hidden; } 270 | 271 | /* Hide only visually, but have it available for screenreaders: h5bp.com/v */ 272 | .visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } 273 | 274 | /* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p */ 275 | .visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; } 276 | 277 | /* Hide visually and from screenreaders, but maintain layout */ 278 | .invisible { visibility: hidden; } 279 | 280 | /* Contain floats: h5bp.com/q */ 281 | .clearfix:before, .clearfix:after { content: ""; display: table; } 282 | .clearfix:after { clear: both; } 283 | .clearfix { *zoom: 1; } 284 | 285 | 286 | 287 | /* ==|== print styles ======================================================= 288 | Print styles. 289 | Inlined to avoid required HTTP connection: h5bp.com/r 290 | ========================================================================== */ 291 | 292 | @media print { 293 | * { background: transparent !important; color: black !important; box-shadow:none !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } /* Black prints faster: h5bp.com/s */ 294 | a, a:visited { text-decoration: underline; } 295 | a[href]:after { content: " (" attr(href) ")"; } 296 | abbr[title]:after { content: " (" attr(title) ")"; } 297 | .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */ 298 | pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } 299 | thead { display: table-header-group; } /* h5bp.com/t */ 300 | tr, img { page-break-inside: avoid; } 301 | img { max-width: 100% !important; } 302 | @page { margin: 0.5cm; } 303 | p, h2, h3 { orphans: 3; widows: 3; } 304 | h2, h3 { page-break-after: avoid; } 305 | } 306 | -------------------------------------------------------------------------------- /example/public/css/bootstrap-responsive.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.1.0 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */ 10 | 11 | .clearfix { 12 | *zoom: 1; 13 | } 14 | 15 | .clearfix:before, 16 | .clearfix:after { 17 | display: table; 18 | line-height: 0; 19 | content: ""; 20 | } 21 | 22 | .clearfix:after { 23 | clear: both; 24 | } 25 | 26 | .hide-text { 27 | font: 0/0 a; 28 | color: transparent; 29 | text-shadow: none; 30 | background-color: transparent; 31 | border: 0; 32 | } 33 | 34 | .input-block-level { 35 | display: block; 36 | width: 100%; 37 | min-height: 30px; 38 | -webkit-box-sizing: border-box; 39 | -moz-box-sizing: border-box; 40 | box-sizing: border-box; 41 | } 42 | 43 | .hidden { 44 | display: none; 45 | visibility: hidden; 46 | } 47 | 48 | .visible-phone { 49 | display: none !important; 50 | } 51 | 52 | .visible-tablet { 53 | display: none !important; 54 | } 55 | 56 | .hidden-desktop { 57 | display: none !important; 58 | } 59 | 60 | .visible-desktop { 61 | display: inherit !important; 62 | } 63 | 64 | @media (min-width: 768px) and (max-width: 979px) { 65 | .hidden-desktop { 66 | display: inherit !important; 67 | } 68 | .visible-desktop { 69 | display: none !important ; 70 | } 71 | .visible-tablet { 72 | display: inherit !important; 73 | } 74 | .hidden-tablet { 75 | display: none !important; 76 | } 77 | } 78 | 79 | @media (max-width: 767px) { 80 | .hidden-desktop { 81 | display: inherit !important; 82 | } 83 | .visible-desktop { 84 | display: none !important; 85 | } 86 | .visible-phone { 87 | display: inherit !important; 88 | } 89 | .hidden-phone { 90 | display: none !important; 91 | } 92 | } 93 | 94 | @media (min-width: 1200px) { 95 | .row { 96 | margin-left: -30px; 97 | *zoom: 1; 98 | } 99 | .row:before, 100 | .row:after { 101 | display: table; 102 | line-height: 0; 103 | content: ""; 104 | } 105 | .row:after { 106 | clear: both; 107 | } 108 | [class*="span"] { 109 | float: left; 110 | margin-left: 30px; 111 | } 112 | .container, 113 | .navbar-static-top .container, 114 | .navbar-fixed-top .container, 115 | .navbar-fixed-bottom .container { 116 | width: 1170px; 117 | } 118 | .span12 { 119 | width: 1170px; 120 | } 121 | .span11 { 122 | width: 1070px; 123 | } 124 | .span10 { 125 | width: 970px; 126 | } 127 | .span9 { 128 | width: 870px; 129 | } 130 | .span8 { 131 | width: 770px; 132 | } 133 | .span7 { 134 | width: 670px; 135 | } 136 | .span6 { 137 | width: 570px; 138 | } 139 | .span5 { 140 | width: 470px; 141 | } 142 | .span4 { 143 | width: 370px; 144 | } 145 | .span3 { 146 | width: 270px; 147 | } 148 | .span2 { 149 | width: 170px; 150 | } 151 | .span1 { 152 | width: 70px; 153 | } 154 | .offset12 { 155 | margin-left: 1230px; 156 | } 157 | .offset11 { 158 | margin-left: 1130px; 159 | } 160 | .offset10 { 161 | margin-left: 1030px; 162 | } 163 | .offset9 { 164 | margin-left: 930px; 165 | } 166 | .offset8 { 167 | margin-left: 830px; 168 | } 169 | .offset7 { 170 | margin-left: 730px; 171 | } 172 | .offset6 { 173 | margin-left: 630px; 174 | } 175 | .offset5 { 176 | margin-left: 530px; 177 | } 178 | .offset4 { 179 | margin-left: 430px; 180 | } 181 | .offset3 { 182 | margin-left: 330px; 183 | } 184 | .offset2 { 185 | margin-left: 230px; 186 | } 187 | .offset1 { 188 | margin-left: 130px; 189 | } 190 | .row-fluid { 191 | width: 100%; 192 | *zoom: 1; 193 | } 194 | .row-fluid:before, 195 | .row-fluid:after { 196 | display: table; 197 | line-height: 0; 198 | content: ""; 199 | } 200 | .row-fluid:after { 201 | clear: both; 202 | } 203 | .row-fluid [class*="span"] { 204 | display: block; 205 | float: left; 206 | width: 100%; 207 | min-height: 30px; 208 | margin-left: 2.564102564102564%; 209 | *margin-left: 2.5109110747408616%; 210 | -webkit-box-sizing: border-box; 211 | -moz-box-sizing: border-box; 212 | box-sizing: border-box; 213 | } 214 | .row-fluid [class*="span"]:first-child { 215 | margin-left: 0; 216 | } 217 | .row-fluid .span12 { 218 | width: 100%; 219 | *width: 99.94680851063829%; 220 | } 221 | .row-fluid .span11 { 222 | width: 91.45299145299145%; 223 | *width: 91.39979996362975%; 224 | } 225 | .row-fluid .span10 { 226 | width: 82.90598290598291%; 227 | *width: 82.8527914166212%; 228 | } 229 | .row-fluid .span9 { 230 | width: 74.35897435897436%; 231 | *width: 74.30578286961266%; 232 | } 233 | .row-fluid .span8 { 234 | width: 65.81196581196582%; 235 | *width: 65.75877432260411%; 236 | } 237 | .row-fluid .span7 { 238 | width: 57.26495726495726%; 239 | *width: 57.21176577559556%; 240 | } 241 | .row-fluid .span6 { 242 | width: 48.717948717948715%; 243 | *width: 48.664757228587014%; 244 | } 245 | .row-fluid .span5 { 246 | width: 40.17094017094017%; 247 | *width: 40.11774868157847%; 248 | } 249 | .row-fluid .span4 { 250 | width: 31.623931623931625%; 251 | *width: 31.570740134569924%; 252 | } 253 | .row-fluid .span3 { 254 | width: 23.076923076923077%; 255 | *width: 23.023731587561375%; 256 | } 257 | .row-fluid .span2 { 258 | width: 14.52991452991453%; 259 | *width: 14.476723040552828%; 260 | } 261 | .row-fluid .span1 { 262 | width: 5.982905982905983%; 263 | *width: 5.929714493544281%; 264 | } 265 | .row-fluid .offset12 { 266 | margin-left: 105.12820512820512%; 267 | *margin-left: 105.02182214948171%; 268 | } 269 | .row-fluid .offset12:first-child { 270 | margin-left: 102.56410256410257%; 271 | *margin-left: 102.45771958537915%; 272 | } 273 | .row-fluid .offset11 { 274 | margin-left: 96.58119658119658%; 275 | *margin-left: 96.47481360247316%; 276 | } 277 | .row-fluid .offset11:first-child { 278 | margin-left: 94.01709401709402%; 279 | *margin-left: 93.91071103837061%; 280 | } 281 | .row-fluid .offset10 { 282 | margin-left: 88.03418803418803%; 283 | *margin-left: 87.92780505546462%; 284 | } 285 | .row-fluid .offset10:first-child { 286 | margin-left: 85.47008547008548%; 287 | *margin-left: 85.36370249136206%; 288 | } 289 | .row-fluid .offset9 { 290 | margin-left: 79.48717948717949%; 291 | *margin-left: 79.38079650845607%; 292 | } 293 | .row-fluid .offset9:first-child { 294 | margin-left: 76.92307692307693%; 295 | *margin-left: 76.81669394435352%; 296 | } 297 | .row-fluid .offset8 { 298 | margin-left: 70.94017094017094%; 299 | *margin-left: 70.83378796144753%; 300 | } 301 | .row-fluid .offset8:first-child { 302 | margin-left: 68.37606837606839%; 303 | *margin-left: 68.26968539734497%; 304 | } 305 | .row-fluid .offset7 { 306 | margin-left: 62.393162393162385%; 307 | *margin-left: 62.28677941443899%; 308 | } 309 | .row-fluid .offset7:first-child { 310 | margin-left: 59.82905982905982%; 311 | *margin-left: 59.72267685033642%; 312 | } 313 | .row-fluid .offset6 { 314 | margin-left: 53.84615384615384%; 315 | *margin-left: 53.739770867430444%; 316 | } 317 | .row-fluid .offset6:first-child { 318 | margin-left: 51.28205128205128%; 319 | *margin-left: 51.175668303327875%; 320 | } 321 | .row-fluid .offset5 { 322 | margin-left: 45.299145299145295%; 323 | *margin-left: 45.1927623204219%; 324 | } 325 | .row-fluid .offset5:first-child { 326 | margin-left: 42.73504273504273%; 327 | *margin-left: 42.62865975631933%; 328 | } 329 | .row-fluid .offset4 { 330 | margin-left: 36.75213675213675%; 331 | *margin-left: 36.645753773413354%; 332 | } 333 | .row-fluid .offset4:first-child { 334 | margin-left: 34.18803418803419%; 335 | *margin-left: 34.081651209310785%; 336 | } 337 | .row-fluid .offset3 { 338 | margin-left: 28.205128205128204%; 339 | *margin-left: 28.0987452264048%; 340 | } 341 | .row-fluid .offset3:first-child { 342 | margin-left: 25.641025641025642%; 343 | *margin-left: 25.53464266230224%; 344 | } 345 | .row-fluid .offset2 { 346 | margin-left: 19.65811965811966%; 347 | *margin-left: 19.551736679396257%; 348 | } 349 | .row-fluid .offset2:first-child { 350 | margin-left: 17.094017094017094%; 351 | *margin-left: 16.98763411529369%; 352 | } 353 | .row-fluid .offset1 { 354 | margin-left: 11.11111111111111%; 355 | *margin-left: 11.004728132387708%; 356 | } 357 | .row-fluid .offset1:first-child { 358 | margin-left: 8.547008547008547%; 359 | *margin-left: 8.440625568285142%; 360 | } 361 | input, 362 | textarea, 363 | .uneditable-input { 364 | margin-left: 0; 365 | } 366 | .controls-row [class*="span"] + [class*="span"] { 367 | margin-left: 30px; 368 | } 369 | input.span12, 370 | textarea.span12, 371 | .uneditable-input.span12 { 372 | width: 1156px; 373 | } 374 | input.span11, 375 | textarea.span11, 376 | .uneditable-input.span11 { 377 | width: 1056px; 378 | } 379 | input.span10, 380 | textarea.span10, 381 | .uneditable-input.span10 { 382 | width: 956px; 383 | } 384 | input.span9, 385 | textarea.span9, 386 | .uneditable-input.span9 { 387 | width: 856px; 388 | } 389 | input.span8, 390 | textarea.span8, 391 | .uneditable-input.span8 { 392 | width: 756px; 393 | } 394 | input.span7, 395 | textarea.span7, 396 | .uneditable-input.span7 { 397 | width: 656px; 398 | } 399 | input.span6, 400 | textarea.span6, 401 | .uneditable-input.span6 { 402 | width: 556px; 403 | } 404 | input.span5, 405 | textarea.span5, 406 | .uneditable-input.span5 { 407 | width: 456px; 408 | } 409 | input.span4, 410 | textarea.span4, 411 | .uneditable-input.span4 { 412 | width: 356px; 413 | } 414 | input.span3, 415 | textarea.span3, 416 | .uneditable-input.span3 { 417 | width: 256px; 418 | } 419 | input.span2, 420 | textarea.span2, 421 | .uneditable-input.span2 { 422 | width: 156px; 423 | } 424 | input.span1, 425 | textarea.span1, 426 | .uneditable-input.span1 { 427 | width: 56px; 428 | } 429 | .thumbnails { 430 | margin-left: -30px; 431 | } 432 | .thumbnails > li { 433 | margin-left: 30px; 434 | } 435 | .row-fluid .thumbnails { 436 | margin-left: 0; 437 | } 438 | } 439 | 440 | @media (min-width: 768px) and (max-width: 979px) { 441 | .row { 442 | margin-left: -20px; 443 | *zoom: 1; 444 | } 445 | .row:before, 446 | .row:after { 447 | display: table; 448 | line-height: 0; 449 | content: ""; 450 | } 451 | .row:after { 452 | clear: both; 453 | } 454 | [class*="span"] { 455 | float: left; 456 | margin-left: 20px; 457 | } 458 | .container, 459 | .navbar-static-top .container, 460 | .navbar-fixed-top .container, 461 | .navbar-fixed-bottom .container { 462 | width: 724px; 463 | } 464 | .span12 { 465 | width: 724px; 466 | } 467 | .span11 { 468 | width: 662px; 469 | } 470 | .span10 { 471 | width: 600px; 472 | } 473 | .span9 { 474 | width: 538px; 475 | } 476 | .span8 { 477 | width: 476px; 478 | } 479 | .span7 { 480 | width: 414px; 481 | } 482 | .span6 { 483 | width: 352px; 484 | } 485 | .span5 { 486 | width: 290px; 487 | } 488 | .span4 { 489 | width: 228px; 490 | } 491 | .span3 { 492 | width: 166px; 493 | } 494 | .span2 { 495 | width: 104px; 496 | } 497 | .span1 { 498 | width: 42px; 499 | } 500 | .offset12 { 501 | margin-left: 764px; 502 | } 503 | .offset11 { 504 | margin-left: 702px; 505 | } 506 | .offset10 { 507 | margin-left: 640px; 508 | } 509 | .offset9 { 510 | margin-left: 578px; 511 | } 512 | .offset8 { 513 | margin-left: 516px; 514 | } 515 | .offset7 { 516 | margin-left: 454px; 517 | } 518 | .offset6 { 519 | margin-left: 392px; 520 | } 521 | .offset5 { 522 | margin-left: 330px; 523 | } 524 | .offset4 { 525 | margin-left: 268px; 526 | } 527 | .offset3 { 528 | margin-left: 206px; 529 | } 530 | .offset2 { 531 | margin-left: 144px; 532 | } 533 | .offset1 { 534 | margin-left: 82px; 535 | } 536 | .row-fluid { 537 | width: 100%; 538 | *zoom: 1; 539 | } 540 | .row-fluid:before, 541 | .row-fluid:after { 542 | display: table; 543 | line-height: 0; 544 | content: ""; 545 | } 546 | .row-fluid:after { 547 | clear: both; 548 | } 549 | .row-fluid [class*="span"] { 550 | display: block; 551 | float: left; 552 | width: 100%; 553 | min-height: 30px; 554 | margin-left: 2.7624309392265194%; 555 | *margin-left: 2.709239449864817%; 556 | -webkit-box-sizing: border-box; 557 | -moz-box-sizing: border-box; 558 | box-sizing: border-box; 559 | } 560 | .row-fluid [class*="span"]:first-child { 561 | margin-left: 0; 562 | } 563 | .row-fluid .span12 { 564 | width: 100%; 565 | *width: 99.94680851063829%; 566 | } 567 | .row-fluid .span11 { 568 | width: 91.43646408839778%; 569 | *width: 91.38327259903608%; 570 | } 571 | .row-fluid .span10 { 572 | width: 82.87292817679558%; 573 | *width: 82.81973668743387%; 574 | } 575 | .row-fluid .span9 { 576 | width: 74.30939226519337%; 577 | *width: 74.25620077583166%; 578 | } 579 | .row-fluid .span8 { 580 | width: 65.74585635359117%; 581 | *width: 65.69266486422946%; 582 | } 583 | .row-fluid .span7 { 584 | width: 57.18232044198895%; 585 | *width: 57.12912895262725%; 586 | } 587 | .row-fluid .span6 { 588 | width: 48.61878453038674%; 589 | *width: 48.56559304102504%; 590 | } 591 | .row-fluid .span5 { 592 | width: 40.05524861878453%; 593 | *width: 40.00205712942283%; 594 | } 595 | .row-fluid .span4 { 596 | width: 31.491712707182323%; 597 | *width: 31.43852121782062%; 598 | } 599 | .row-fluid .span3 { 600 | width: 22.92817679558011%; 601 | *width: 22.87498530621841%; 602 | } 603 | .row-fluid .span2 { 604 | width: 14.3646408839779%; 605 | *width: 14.311449394616199%; 606 | } 607 | .row-fluid .span1 { 608 | width: 5.801104972375691%; 609 | *width: 5.747913483013988%; 610 | } 611 | .row-fluid .offset12 { 612 | margin-left: 105.52486187845304%; 613 | *margin-left: 105.41847889972962%; 614 | } 615 | .row-fluid .offset12:first-child { 616 | margin-left: 102.76243093922652%; 617 | *margin-left: 102.6560479605031%; 618 | } 619 | .row-fluid .offset11 { 620 | margin-left: 96.96132596685082%; 621 | *margin-left: 96.8549429881274%; 622 | } 623 | .row-fluid .offset11:first-child { 624 | margin-left: 94.1988950276243%; 625 | *margin-left: 94.09251204890089%; 626 | } 627 | .row-fluid .offset10 { 628 | margin-left: 88.39779005524862%; 629 | *margin-left: 88.2914070765252%; 630 | } 631 | .row-fluid .offset10:first-child { 632 | margin-left: 85.6353591160221%; 633 | *margin-left: 85.52897613729868%; 634 | } 635 | .row-fluid .offset9 { 636 | margin-left: 79.8342541436464%; 637 | *margin-left: 79.72787116492299%; 638 | } 639 | .row-fluid .offset9:first-child { 640 | margin-left: 77.07182320441989%; 641 | *margin-left: 76.96544022569647%; 642 | } 643 | .row-fluid .offset8 { 644 | margin-left: 71.2707182320442%; 645 | *margin-left: 71.16433525332079%; 646 | } 647 | .row-fluid .offset8:first-child { 648 | margin-left: 68.50828729281768%; 649 | *margin-left: 68.40190431409427%; 650 | } 651 | .row-fluid .offset7 { 652 | margin-left: 62.70718232044199%; 653 | *margin-left: 62.600799341718584%; 654 | } 655 | .row-fluid .offset7:first-child { 656 | margin-left: 59.94475138121547%; 657 | *margin-left: 59.838368402492065%; 658 | } 659 | .row-fluid .offset6 { 660 | margin-left: 54.14364640883978%; 661 | *margin-left: 54.037263430116376%; 662 | } 663 | .row-fluid .offset6:first-child { 664 | margin-left: 51.38121546961326%; 665 | *margin-left: 51.27483249088986%; 666 | } 667 | .row-fluid .offset5 { 668 | margin-left: 45.58011049723757%; 669 | *margin-left: 45.47372751851417%; 670 | } 671 | .row-fluid .offset5:first-child { 672 | margin-left: 42.81767955801105%; 673 | *margin-left: 42.71129657928765%; 674 | } 675 | .row-fluid .offset4 { 676 | margin-left: 37.01657458563536%; 677 | *margin-left: 36.91019160691196%; 678 | } 679 | .row-fluid .offset4:first-child { 680 | margin-left: 34.25414364640884%; 681 | *margin-left: 34.14776066768544%; 682 | } 683 | .row-fluid .offset3 { 684 | margin-left: 28.45303867403315%; 685 | *margin-left: 28.346655695309746%; 686 | } 687 | .row-fluid .offset3:first-child { 688 | margin-left: 25.69060773480663%; 689 | *margin-left: 25.584224756083227%; 690 | } 691 | .row-fluid .offset2 { 692 | margin-left: 19.88950276243094%; 693 | *margin-left: 19.783119783707537%; 694 | } 695 | .row-fluid .offset2:first-child { 696 | margin-left: 17.12707182320442%; 697 | *margin-left: 17.02068884448102%; 698 | } 699 | .row-fluid .offset1 { 700 | margin-left: 11.32596685082873%; 701 | *margin-left: 11.219583872105325%; 702 | } 703 | .row-fluid .offset1:first-child { 704 | margin-left: 8.56353591160221%; 705 | *margin-left: 8.457152932878806%; 706 | } 707 | input, 708 | textarea, 709 | .uneditable-input { 710 | margin-left: 0; 711 | } 712 | .controls-row [class*="span"] + [class*="span"] { 713 | margin-left: 20px; 714 | } 715 | input.span12, 716 | textarea.span12, 717 | .uneditable-input.span12 { 718 | width: 710px; 719 | } 720 | input.span11, 721 | textarea.span11, 722 | .uneditable-input.span11 { 723 | width: 648px; 724 | } 725 | input.span10, 726 | textarea.span10, 727 | .uneditable-input.span10 { 728 | width: 586px; 729 | } 730 | input.span9, 731 | textarea.span9, 732 | .uneditable-input.span9 { 733 | width: 524px; 734 | } 735 | input.span8, 736 | textarea.span8, 737 | .uneditable-input.span8 { 738 | width: 462px; 739 | } 740 | input.span7, 741 | textarea.span7, 742 | .uneditable-input.span7 { 743 | width: 400px; 744 | } 745 | input.span6, 746 | textarea.span6, 747 | .uneditable-input.span6 { 748 | width: 338px; 749 | } 750 | input.span5, 751 | textarea.span5, 752 | .uneditable-input.span5 { 753 | width: 276px; 754 | } 755 | input.span4, 756 | textarea.span4, 757 | .uneditable-input.span4 { 758 | width: 214px; 759 | } 760 | input.span3, 761 | textarea.span3, 762 | .uneditable-input.span3 { 763 | width: 152px; 764 | } 765 | input.span2, 766 | textarea.span2, 767 | .uneditable-input.span2 { 768 | width: 90px; 769 | } 770 | input.span1, 771 | textarea.span1, 772 | .uneditable-input.span1 { 773 | width: 28px; 774 | } 775 | } 776 | 777 | @media (max-width: 767px) { 778 | body { 779 | padding-right: 20px; 780 | padding-left: 20px; 781 | } 782 | .navbar-fixed-top, 783 | .navbar-fixed-bottom { 784 | margin-right: -20px; 785 | margin-left: -20px; 786 | } 787 | .container-fluid { 788 | padding: 0; 789 | } 790 | .dl-horizontal dt { 791 | float: none; 792 | width: auto; 793 | clear: none; 794 | text-align: left; 795 | } 796 | .dl-horizontal dd { 797 | margin-left: 0; 798 | } 799 | .container { 800 | width: auto; 801 | } 802 | .row-fluid { 803 | width: 100%; 804 | } 805 | .row, 806 | .thumbnails { 807 | margin-left: 0; 808 | } 809 | .thumbnails > li { 810 | float: none; 811 | margin-left: 0; 812 | } 813 | [class*="span"], 814 | .row-fluid [class*="span"] { 815 | display: block; 816 | float: none; 817 | width: auto; 818 | margin-left: 0; 819 | } 820 | .span12, 821 | .row-fluid .span12 { 822 | width: 100%; 823 | -webkit-box-sizing: border-box; 824 | -moz-box-sizing: border-box; 825 | box-sizing: border-box; 826 | } 827 | .input-large, 828 | .input-xlarge, 829 | .input-xxlarge, 830 | input[class*="span"], 831 | select[class*="span"], 832 | textarea[class*="span"], 833 | .uneditable-input { 834 | display: block; 835 | width: 100%; 836 | min-height: 30px; 837 | -webkit-box-sizing: border-box; 838 | -moz-box-sizing: border-box; 839 | box-sizing: border-box; 840 | } 841 | .input-prepend input, 842 | .input-append input, 843 | .input-prepend input[class*="span"], 844 | .input-append input[class*="span"] { 845 | display: inline-block; 846 | width: auto; 847 | } 848 | .modal { 849 | position: fixed; 850 | top: 20px; 851 | right: 20px; 852 | left: 20px; 853 | width: auto; 854 | margin: 0; 855 | } 856 | .modal.fade.in { 857 | top: auto; 858 | } 859 | } 860 | 861 | @media (max-width: 480px) { 862 | .nav-collapse { 863 | -webkit-transform: translate3d(0, 0, 0); 864 | } 865 | .page-header h1 small { 866 | display: block; 867 | line-height: 20px; 868 | } 869 | input[type="checkbox"], 870 | input[type="radio"] { 871 | border: 1px solid #ccc; 872 | } 873 | .form-horizontal .control-group > label { 874 | float: none; 875 | width: auto; 876 | padding-top: 0; 877 | text-align: left; 878 | } 879 | .form-horizontal .controls { 880 | margin-left: 0; 881 | } 882 | .form-horizontal .control-list { 883 | padding-top: 0; 884 | } 885 | .form-horizontal .form-actions { 886 | padding-right: 10px; 887 | padding-left: 10px; 888 | } 889 | .modal { 890 | top: 10px; 891 | right: 10px; 892 | left: 10px; 893 | } 894 | .modal-header .close { 895 | padding: 10px; 896 | margin: -10px; 897 | } 898 | .carousel-caption { 899 | position: static; 900 | } 901 | } 902 | 903 | @media (max-width: 979px) { 904 | body { 905 | padding-top: 0; 906 | } 907 | .navbar-fixed-top, 908 | .navbar-fixed-bottom { 909 | position: static; 910 | } 911 | .navbar-fixed-top { 912 | margin-bottom: 20px; 913 | } 914 | .navbar-fixed-bottom { 915 | margin-top: 20px; 916 | } 917 | .navbar-fixed-top .navbar-inner, 918 | .navbar-fixed-bottom .navbar-inner { 919 | padding: 5px; 920 | } 921 | .navbar .container { 922 | width: auto; 923 | padding: 0; 924 | } 925 | .navbar .brand { 926 | padding-right: 10px; 927 | padding-left: 10px; 928 | margin: 0 0 0 -5px; 929 | } 930 | .nav-collapse { 931 | clear: both; 932 | } 933 | .nav-collapse .nav { 934 | float: none; 935 | margin: 0 0 10px; 936 | } 937 | .nav-collapse .nav > li { 938 | float: none; 939 | } 940 | .nav-collapse .nav > li > a { 941 | margin-bottom: 2px; 942 | } 943 | .nav-collapse .nav > .divider-vertical { 944 | display: none; 945 | } 946 | .nav-collapse .nav .nav-header { 947 | color: #555555; 948 | text-shadow: none; 949 | } 950 | .nav-collapse .nav > li > a, 951 | .nav-collapse .dropdown-menu a { 952 | padding: 9px 15px; 953 | font-weight: bold; 954 | color: #555555; 955 | -webkit-border-radius: 3px; 956 | -moz-border-radius: 3px; 957 | border-radius: 3px; 958 | } 959 | .nav-collapse .btn { 960 | padding: 4px 10px 4px; 961 | font-weight: normal; 962 | -webkit-border-radius: 4px; 963 | -moz-border-radius: 4px; 964 | border-radius: 4px; 965 | } 966 | .nav-collapse .dropdown-menu li + li a { 967 | margin-bottom: 2px; 968 | } 969 | .nav-collapse .nav > li > a:hover, 970 | .nav-collapse .dropdown-menu a:hover { 971 | background-color: #f2f2f2; 972 | } 973 | .navbar-inverse .nav-collapse .nav > li > a:hover, 974 | .navbar-inverse .nav-collapse .dropdown-menu a:hover { 975 | background-color: #111111; 976 | } 977 | .nav-collapse.in .btn-group { 978 | padding: 0; 979 | margin-top: 5px; 980 | } 981 | .nav-collapse .dropdown-menu { 982 | position: static; 983 | top: auto; 984 | left: auto; 985 | display: block; 986 | float: none; 987 | max-width: none; 988 | padding: 0; 989 | margin: 0 15px; 990 | background-color: transparent; 991 | border: none; 992 | -webkit-border-radius: 0; 993 | -moz-border-radius: 0; 994 | border-radius: 0; 995 | -webkit-box-shadow: none; 996 | -moz-box-shadow: none; 997 | box-shadow: none; 998 | } 999 | .nav-collapse .dropdown-menu:before, 1000 | .nav-collapse .dropdown-menu:after { 1001 | display: none; 1002 | } 1003 | .nav-collapse .dropdown-menu .divider { 1004 | display: none; 1005 | } 1006 | .nav-collapse .navbar-form, 1007 | .nav-collapse .navbar-search { 1008 | float: none; 1009 | padding: 10px 15px; 1010 | margin: 10px 0; 1011 | border-top: 1px solid #f2f2f2; 1012 | border-bottom: 1px solid #f2f2f2; 1013 | -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1014 | -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1015 | box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); 1016 | } 1017 | .navbar .nav-collapse .nav.pull-right { 1018 | float: none; 1019 | margin-left: 0; 1020 | } 1021 | .nav-collapse, 1022 | .nav-collapse.collapse { 1023 | height: 0; 1024 | overflow: hidden; 1025 | } 1026 | .navbar .btn-navbar { 1027 | display: block; 1028 | } 1029 | .navbar-static .navbar-inner { 1030 | padding-right: 10px; 1031 | padding-left: 10px; 1032 | } 1033 | } 1034 | 1035 | @media (min-width: 980px) { 1036 | .nav-collapse.collapse { 1037 | height: auto !important; 1038 | overflow: visible !important; 1039 | } 1040 | } 1041 | -------------------------------------------------------------------------------- /example/public/css/bootstrap-responsive.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.1.0 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:auto;margin-left:0}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade.in{top:auto}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-group>label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#555;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#555;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:block;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} 10 | -------------------------------------------------------------------------------- /example/public/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top:20px; 3 | } -------------------------------------------------------------------------------- /example/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RGBboy/express-flash/4639761a3dbed98be9a9f6994dc719836d26b4ff/example/public/favicon.ico -------------------------------------------------------------------------------- /example/public/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RGBboy/express-flash/4639761a3dbed98be9a9f6994dc719836d26b4ff/example/public/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /example/public/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RGBboy/express-flash/4639761a3dbed98be9a9f6994dc719836d26b4ff/example/public/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /example/public/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /* =================================================== 2 | * bootstrap-transition.js v2.1.0 3 | * http://twitter.github.com/bootstrap/javascript.html#transitions 4 | * =================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | $(function () { 24 | 25 | "use strict"; // jshint ;_; 26 | 27 | 28 | /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) 29 | * ======================================================= */ 30 | 31 | $.support.transition = (function () { 32 | 33 | var transitionEnd = (function () { 34 | 35 | var el = document.createElement('bootstrap') 36 | , transEndEventNames = { 37 | 'WebkitTransition' : 'webkitTransitionEnd' 38 | , 'MozTransition' : 'transitionend' 39 | , 'OTransition' : 'oTransitionEnd otransitionend' 40 | , 'transition' : 'transitionend' 41 | } 42 | , name 43 | 44 | for (name in transEndEventNames){ 45 | if (el.style[name] !== undefined) { 46 | return transEndEventNames[name] 47 | } 48 | } 49 | 50 | }()) 51 | 52 | return transitionEnd && { 53 | end: transitionEnd 54 | } 55 | 56 | })() 57 | 58 | }) 59 | 60 | }(window.jQuery);/* ========================================================== 61 | * bootstrap-alert.js v2.1.0 62 | * http://twitter.github.com/bootstrap/javascript.html#alerts 63 | * ========================================================== 64 | * Copyright 2012 Twitter, Inc. 65 | * 66 | * Licensed under the Apache License, Version 2.0 (the "License"); 67 | * you may not use this file except in compliance with the License. 68 | * You may obtain a copy of the License at 69 | * 70 | * http://www.apache.org/licenses/LICENSE-2.0 71 | * 72 | * Unless required by applicable law or agreed to in writing, software 73 | * distributed under the License is distributed on an "AS IS" BASIS, 74 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 75 | * See the License for the specific language governing permissions and 76 | * limitations under the License. 77 | * ========================================================== */ 78 | 79 | 80 | !function ($) { 81 | 82 | "use strict"; // jshint ;_; 83 | 84 | 85 | /* ALERT CLASS DEFINITION 86 | * ====================== */ 87 | 88 | var dismiss = '[data-dismiss="alert"]' 89 | , Alert = function (el) { 90 | $(el).on('click', dismiss, this.close) 91 | } 92 | 93 | Alert.prototype.close = function (e) { 94 | var $this = $(this) 95 | , selector = $this.attr('data-target') 96 | , $parent 97 | 98 | if (!selector) { 99 | selector = $this.attr('href') 100 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 101 | } 102 | 103 | $parent = $(selector) 104 | 105 | e && e.preventDefault() 106 | 107 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) 108 | 109 | $parent.trigger(e = $.Event('close')) 110 | 111 | if (e.isDefaultPrevented()) return 112 | 113 | $parent.removeClass('in') 114 | 115 | function removeElement() { 116 | $parent 117 | .trigger('closed') 118 | .remove() 119 | } 120 | 121 | $.support.transition && $parent.hasClass('fade') ? 122 | $parent.on($.support.transition.end, removeElement) : 123 | removeElement() 124 | } 125 | 126 | 127 | /* ALERT PLUGIN DEFINITION 128 | * ======================= */ 129 | 130 | $.fn.alert = function (option) { 131 | return this.each(function () { 132 | var $this = $(this) 133 | , data = $this.data('alert') 134 | if (!data) $this.data('alert', (data = new Alert(this))) 135 | if (typeof option == 'string') data[option].call($this) 136 | }) 137 | } 138 | 139 | $.fn.alert.Constructor = Alert 140 | 141 | 142 | /* ALERT DATA-API 143 | * ============== */ 144 | 145 | $(function () { 146 | $('body').on('click.alert.data-api', dismiss, Alert.prototype.close) 147 | }) 148 | 149 | }(window.jQuery);/* ============================================================ 150 | * bootstrap-button.js v2.1.0 151 | * http://twitter.github.com/bootstrap/javascript.html#buttons 152 | * ============================================================ 153 | * Copyright 2012 Twitter, Inc. 154 | * 155 | * Licensed under the Apache License, Version 2.0 (the "License"); 156 | * you may not use this file except in compliance with the License. 157 | * You may obtain a copy of the License at 158 | * 159 | * http://www.apache.org/licenses/LICENSE-2.0 160 | * 161 | * Unless required by applicable law or agreed to in writing, software 162 | * distributed under the License is distributed on an "AS IS" BASIS, 163 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 164 | * See the License for the specific language governing permissions and 165 | * limitations under the License. 166 | * ============================================================ */ 167 | 168 | 169 | !function ($) { 170 | 171 | "use strict"; // jshint ;_; 172 | 173 | 174 | /* BUTTON PUBLIC CLASS DEFINITION 175 | * ============================== */ 176 | 177 | var Button = function (element, options) { 178 | this.$element = $(element) 179 | this.options = $.extend({}, $.fn.button.defaults, options) 180 | } 181 | 182 | Button.prototype.setState = function (state) { 183 | var d = 'disabled' 184 | , $el = this.$element 185 | , data = $el.data() 186 | , val = $el.is('input') ? 'val' : 'html' 187 | 188 | state = state + 'Text' 189 | data.resetText || $el.data('resetText', $el[val]()) 190 | 191 | $el[val](data[state] || this.options[state]) 192 | 193 | // push to event loop to allow forms to submit 194 | setTimeout(function () { 195 | state == 'loadingText' ? 196 | $el.addClass(d).attr(d, d) : 197 | $el.removeClass(d).removeAttr(d) 198 | }, 0) 199 | } 200 | 201 | Button.prototype.toggle = function () { 202 | var $parent = this.$element.parent('[data-toggle="buttons-radio"]') 203 | 204 | $parent && $parent 205 | .find('.active') 206 | .removeClass('active') 207 | 208 | this.$element.toggleClass('active') 209 | } 210 | 211 | 212 | /* BUTTON PLUGIN DEFINITION 213 | * ======================== */ 214 | 215 | $.fn.button = function (option) { 216 | return this.each(function () { 217 | var $this = $(this) 218 | , data = $this.data('button') 219 | , options = typeof option == 'object' && option 220 | if (!data) $this.data('button', (data = new Button(this, options))) 221 | if (option == 'toggle') data.toggle() 222 | else if (option) data.setState(option) 223 | }) 224 | } 225 | 226 | $.fn.button.defaults = { 227 | loadingText: 'loading...' 228 | } 229 | 230 | $.fn.button.Constructor = Button 231 | 232 | 233 | /* BUTTON DATA-API 234 | * =============== */ 235 | 236 | $(function () { 237 | $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) { 238 | var $btn = $(e.target) 239 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 240 | $btn.button('toggle') 241 | }) 242 | }) 243 | 244 | }(window.jQuery);/* ========================================================== 245 | * bootstrap-carousel.js v2.1.0 246 | * http://twitter.github.com/bootstrap/javascript.html#carousel 247 | * ========================================================== 248 | * Copyright 2012 Twitter, Inc. 249 | * 250 | * Licensed under the Apache License, Version 2.0 (the "License"); 251 | * you may not use this file except in compliance with the License. 252 | * You may obtain a copy of the License at 253 | * 254 | * http://www.apache.org/licenses/LICENSE-2.0 255 | * 256 | * Unless required by applicable law or agreed to in writing, software 257 | * distributed under the License is distributed on an "AS IS" BASIS, 258 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 259 | * See the License for the specific language governing permissions and 260 | * limitations under the License. 261 | * ========================================================== */ 262 | 263 | 264 | !function ($) { 265 | 266 | "use strict"; // jshint ;_; 267 | 268 | 269 | /* CAROUSEL CLASS DEFINITION 270 | * ========================= */ 271 | 272 | var Carousel = function (element, options) { 273 | this.$element = $(element) 274 | this.options = options 275 | this.options.slide && this.slide(this.options.slide) 276 | this.options.pause == 'hover' && this.$element 277 | .on('mouseenter', $.proxy(this.pause, this)) 278 | .on('mouseleave', $.proxy(this.cycle, this)) 279 | } 280 | 281 | Carousel.prototype = { 282 | 283 | cycle: function (e) { 284 | if (!e) this.paused = false 285 | this.options.interval 286 | && !this.paused 287 | && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) 288 | return this 289 | } 290 | 291 | , to: function (pos) { 292 | var $active = this.$element.find('.item.active') 293 | , children = $active.parent().children() 294 | , activePos = children.index($active) 295 | , that = this 296 | 297 | if (pos > (children.length - 1) || pos < 0) return 298 | 299 | if (this.sliding) { 300 | return this.$element.one('slid', function () { 301 | that.to(pos) 302 | }) 303 | } 304 | 305 | if (activePos == pos) { 306 | return this.pause().cycle() 307 | } 308 | 309 | return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) 310 | } 311 | 312 | , pause: function (e) { 313 | if (!e) this.paused = true 314 | if (this.$element.find('.next, .prev').length && $.support.transition.end) { 315 | this.$element.trigger($.support.transition.end) 316 | this.cycle() 317 | } 318 | clearInterval(this.interval) 319 | this.interval = null 320 | return this 321 | } 322 | 323 | , next: function () { 324 | if (this.sliding) return 325 | return this.slide('next') 326 | } 327 | 328 | , prev: function () { 329 | if (this.sliding) return 330 | return this.slide('prev') 331 | } 332 | 333 | , slide: function (type, next) { 334 | var $active = this.$element.find('.item.active') 335 | , $next = next || $active[type]() 336 | , isCycling = this.interval 337 | , direction = type == 'next' ? 'left' : 'right' 338 | , fallback = type == 'next' ? 'first' : 'last' 339 | , that = this 340 | , e = $.Event('slide', { 341 | relatedTarget: $next[0] 342 | }) 343 | 344 | this.sliding = true 345 | 346 | isCycling && this.pause() 347 | 348 | $next = $next.length ? $next : this.$element.find('.item')[fallback]() 349 | 350 | if ($next.hasClass('active')) return 351 | 352 | if ($.support.transition && this.$element.hasClass('slide')) { 353 | this.$element.trigger(e) 354 | if (e.isDefaultPrevented()) return 355 | $next.addClass(type) 356 | $next[0].offsetWidth // force reflow 357 | $active.addClass(direction) 358 | $next.addClass(direction) 359 | this.$element.one($.support.transition.end, function () { 360 | $next.removeClass([type, direction].join(' ')).addClass('active') 361 | $active.removeClass(['active', direction].join(' ')) 362 | that.sliding = false 363 | setTimeout(function () { that.$element.trigger('slid') }, 0) 364 | }) 365 | } else { 366 | this.$element.trigger(e) 367 | if (e.isDefaultPrevented()) return 368 | $active.removeClass('active') 369 | $next.addClass('active') 370 | this.sliding = false 371 | this.$element.trigger('slid') 372 | } 373 | 374 | isCycling && this.cycle() 375 | 376 | return this 377 | } 378 | 379 | } 380 | 381 | 382 | /* CAROUSEL PLUGIN DEFINITION 383 | * ========================== */ 384 | 385 | $.fn.carousel = function (option) { 386 | return this.each(function () { 387 | var $this = $(this) 388 | , data = $this.data('carousel') 389 | , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) 390 | , action = typeof option == 'string' ? option : options.slide 391 | if (!data) $this.data('carousel', (data = new Carousel(this, options))) 392 | if (typeof option == 'number') data.to(option) 393 | else if (action) data[action]() 394 | else if (options.interval) data.cycle() 395 | }) 396 | } 397 | 398 | $.fn.carousel.defaults = { 399 | interval: 5000 400 | , pause: 'hover' 401 | } 402 | 403 | $.fn.carousel.Constructor = Carousel 404 | 405 | 406 | /* CAROUSEL DATA-API 407 | * ================= */ 408 | 409 | $(function () { 410 | $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) { 411 | var $this = $(this), href 412 | , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 413 | , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data()) 414 | $target.carousel(options) 415 | e.preventDefault() 416 | }) 417 | }) 418 | 419 | }(window.jQuery);/* ============================================================= 420 | * bootstrap-collapse.js v2.1.0 421 | * http://twitter.github.com/bootstrap/javascript.html#collapse 422 | * ============================================================= 423 | * Copyright 2012 Twitter, Inc. 424 | * 425 | * Licensed under the Apache License, Version 2.0 (the "License"); 426 | * you may not use this file except in compliance with the License. 427 | * You may obtain a copy of the License at 428 | * 429 | * http://www.apache.org/licenses/LICENSE-2.0 430 | * 431 | * Unless required by applicable law or agreed to in writing, software 432 | * distributed under the License is distributed on an "AS IS" BASIS, 433 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 434 | * See the License for the specific language governing permissions and 435 | * limitations under the License. 436 | * ============================================================ */ 437 | 438 | 439 | !function ($) { 440 | 441 | "use strict"; // jshint ;_; 442 | 443 | 444 | /* COLLAPSE PUBLIC CLASS DEFINITION 445 | * ================================ */ 446 | 447 | var Collapse = function (element, options) { 448 | this.$element = $(element) 449 | this.options = $.extend({}, $.fn.collapse.defaults, options) 450 | 451 | if (this.options.parent) { 452 | this.$parent = $(this.options.parent) 453 | } 454 | 455 | this.options.toggle && this.toggle() 456 | } 457 | 458 | Collapse.prototype = { 459 | 460 | constructor: Collapse 461 | 462 | , dimension: function () { 463 | var hasWidth = this.$element.hasClass('width') 464 | return hasWidth ? 'width' : 'height' 465 | } 466 | 467 | , show: function () { 468 | var dimension 469 | , scroll 470 | , actives 471 | , hasData 472 | 473 | if (this.transitioning) return 474 | 475 | dimension = this.dimension() 476 | scroll = $.camelCase(['scroll', dimension].join('-')) 477 | actives = this.$parent && this.$parent.find('> .accordion-group > .in') 478 | 479 | if (actives && actives.length) { 480 | hasData = actives.data('collapse') 481 | if (hasData && hasData.transitioning) return 482 | actives.collapse('hide') 483 | hasData || actives.data('collapse', null) 484 | } 485 | 486 | this.$element[dimension](0) 487 | this.transition('addClass', $.Event('show'), 'shown') 488 | $.support.transition && this.$element[dimension](this.$element[0][scroll]) 489 | } 490 | 491 | , hide: function () { 492 | var dimension 493 | if (this.transitioning) return 494 | dimension = this.dimension() 495 | this.reset(this.$element[dimension]()) 496 | this.transition('removeClass', $.Event('hide'), 'hidden') 497 | this.$element[dimension](0) 498 | } 499 | 500 | , reset: function (size) { 501 | var dimension = this.dimension() 502 | 503 | this.$element 504 | .removeClass('collapse') 505 | [dimension](size || 'auto') 506 | [0].offsetWidth 507 | 508 | this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') 509 | 510 | return this 511 | } 512 | 513 | , transition: function (method, startEvent, completeEvent) { 514 | var that = this 515 | , complete = function () { 516 | if (startEvent.type == 'show') that.reset() 517 | that.transitioning = 0 518 | that.$element.trigger(completeEvent) 519 | } 520 | 521 | this.$element.trigger(startEvent) 522 | 523 | if (startEvent.isDefaultPrevented()) return 524 | 525 | this.transitioning = 1 526 | 527 | this.$element[method]('in') 528 | 529 | $.support.transition && this.$element.hasClass('collapse') ? 530 | this.$element.one($.support.transition.end, complete) : 531 | complete() 532 | } 533 | 534 | , toggle: function () { 535 | this[this.$element.hasClass('in') ? 'hide' : 'show']() 536 | } 537 | 538 | } 539 | 540 | 541 | /* COLLAPSIBLE PLUGIN DEFINITION 542 | * ============================== */ 543 | 544 | $.fn.collapse = function (option) { 545 | return this.each(function () { 546 | var $this = $(this) 547 | , data = $this.data('collapse') 548 | , options = typeof option == 'object' && option 549 | if (!data) $this.data('collapse', (data = new Collapse(this, options))) 550 | if (typeof option == 'string') data[option]() 551 | }) 552 | } 553 | 554 | $.fn.collapse.defaults = { 555 | toggle: true 556 | } 557 | 558 | $.fn.collapse.Constructor = Collapse 559 | 560 | 561 | /* COLLAPSIBLE DATA-API 562 | * ==================== */ 563 | 564 | $(function () { 565 | $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { 566 | var $this = $(this), href 567 | , target = $this.attr('data-target') 568 | || e.preventDefault() 569 | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 570 | , option = $(target).data('collapse') ? 'toggle' : $this.data() 571 | $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') 572 | $(target).collapse(option) 573 | }) 574 | }) 575 | 576 | }(window.jQuery);/* ============================================================ 577 | * bootstrap-dropdown.js v2.1.0 578 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns 579 | * ============================================================ 580 | * Copyright 2012 Twitter, Inc. 581 | * 582 | * Licensed under the Apache License, Version 2.0 (the "License"); 583 | * you may not use this file except in compliance with the License. 584 | * You may obtain a copy of the License at 585 | * 586 | * http://www.apache.org/licenses/LICENSE-2.0 587 | * 588 | * Unless required by applicable law or agreed to in writing, software 589 | * distributed under the License is distributed on an "AS IS" BASIS, 590 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 591 | * See the License for the specific language governing permissions and 592 | * limitations under the License. 593 | * ============================================================ */ 594 | 595 | 596 | !function ($) { 597 | 598 | "use strict"; // jshint ;_; 599 | 600 | 601 | /* DROPDOWN CLASS DEFINITION 602 | * ========================= */ 603 | 604 | var toggle = '[data-toggle=dropdown]' 605 | , Dropdown = function (element) { 606 | var $el = $(element).on('click.dropdown.data-api', this.toggle) 607 | $('html').on('click.dropdown.data-api', function () { 608 | $el.parent().removeClass('open') 609 | }) 610 | } 611 | 612 | Dropdown.prototype = { 613 | 614 | constructor: Dropdown 615 | 616 | , toggle: function (e) { 617 | var $this = $(this) 618 | , $parent 619 | , isActive 620 | 621 | if ($this.is('.disabled, :disabled')) return 622 | 623 | $parent = getParent($this) 624 | 625 | isActive = $parent.hasClass('open') 626 | 627 | clearMenus() 628 | 629 | if (!isActive) { 630 | $parent.toggleClass('open') 631 | $this.focus() 632 | } 633 | 634 | return false 635 | } 636 | 637 | , keydown: function (e) { 638 | var $this 639 | , $items 640 | , $active 641 | , $parent 642 | , isActive 643 | , index 644 | 645 | if (!/(38|40|27)/.test(e.keyCode)) return 646 | 647 | $this = $(this) 648 | 649 | e.preventDefault() 650 | e.stopPropagation() 651 | 652 | if ($this.is('.disabled, :disabled')) return 653 | 654 | $parent = getParent($this) 655 | 656 | isActive = $parent.hasClass('open') 657 | 658 | if (!isActive || (isActive && e.keyCode == 27)) return $this.click() 659 | 660 | $items = $('[role=menu] li:not(.divider) a', $parent) 661 | 662 | if (!$items.length) return 663 | 664 | index = $items.index($items.filter(':focus')) 665 | 666 | if (e.keyCode == 38 && index > 0) index-- // up 667 | if (e.keyCode == 40 && index < $items.length - 1) index++ // down 668 | if (!~index) index = 0 669 | 670 | $items 671 | .eq(index) 672 | .focus() 673 | } 674 | 675 | } 676 | 677 | function clearMenus() { 678 | getParent($(toggle)) 679 | .removeClass('open') 680 | } 681 | 682 | function getParent($this) { 683 | var selector = $this.attr('data-target') 684 | , $parent 685 | 686 | if (!selector) { 687 | selector = $this.attr('href') 688 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 689 | } 690 | 691 | $parent = $(selector) 692 | $parent.length || ($parent = $this.parent()) 693 | 694 | return $parent 695 | } 696 | 697 | 698 | /* DROPDOWN PLUGIN DEFINITION 699 | * ========================== */ 700 | 701 | $.fn.dropdown = function (option) { 702 | return this.each(function () { 703 | var $this = $(this) 704 | , data = $this.data('dropdown') 705 | if (!data) $this.data('dropdown', (data = new Dropdown(this))) 706 | if (typeof option == 'string') data[option].call($this) 707 | }) 708 | } 709 | 710 | $.fn.dropdown.Constructor = Dropdown 711 | 712 | 713 | /* APPLY TO STANDARD DROPDOWN ELEMENTS 714 | * =================================== */ 715 | 716 | $(function () { 717 | $('html') 718 | .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) 719 | $('body') 720 | .on('click.dropdown touchstart.dropdown.data-api', '.dropdown', function (e) { e.stopPropagation() }) 721 | .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) 722 | .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) 723 | }) 724 | 725 | }(window.jQuery);/* ========================================================= 726 | * bootstrap-modal.js v2.1.0 727 | * http://twitter.github.com/bootstrap/javascript.html#modals 728 | * ========================================================= 729 | * Copyright 2012 Twitter, Inc. 730 | * 731 | * Licensed under the Apache License, Version 2.0 (the "License"); 732 | * you may not use this file except in compliance with the License. 733 | * You may obtain a copy of the License at 734 | * 735 | * http://www.apache.org/licenses/LICENSE-2.0 736 | * 737 | * Unless required by applicable law or agreed to in writing, software 738 | * distributed under the License is distributed on an "AS IS" BASIS, 739 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 740 | * See the License for the specific language governing permissions and 741 | * limitations under the License. 742 | * ========================================================= */ 743 | 744 | 745 | !function ($) { 746 | 747 | "use strict"; // jshint ;_; 748 | 749 | 750 | /* MODAL CLASS DEFINITION 751 | * ====================== */ 752 | 753 | var Modal = function (element, options) { 754 | this.options = options 755 | this.$element = $(element) 756 | .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) 757 | this.options.remote && this.$element.find('.modal-body').load(this.options.remote) 758 | } 759 | 760 | Modal.prototype = { 761 | 762 | constructor: Modal 763 | 764 | , toggle: function () { 765 | return this[!this.isShown ? 'show' : 'hide']() 766 | } 767 | 768 | , show: function () { 769 | var that = this 770 | , e = $.Event('show') 771 | 772 | this.$element.trigger(e) 773 | 774 | if (this.isShown || e.isDefaultPrevented()) return 775 | 776 | $('body').addClass('modal-open') 777 | 778 | this.isShown = true 779 | 780 | this.escape() 781 | 782 | this.backdrop(function () { 783 | var transition = $.support.transition && that.$element.hasClass('fade') 784 | 785 | if (!that.$element.parent().length) { 786 | that.$element.appendTo(document.body) //don't move modals dom position 787 | } 788 | 789 | that.$element 790 | .show() 791 | 792 | if (transition) { 793 | that.$element[0].offsetWidth // force reflow 794 | } 795 | 796 | that.$element 797 | .addClass('in') 798 | .attr('aria-hidden', false) 799 | .focus() 800 | 801 | that.enforceFocus() 802 | 803 | transition ? 804 | that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) : 805 | that.$element.trigger('shown') 806 | 807 | }) 808 | } 809 | 810 | , hide: function (e) { 811 | e && e.preventDefault() 812 | 813 | var that = this 814 | 815 | e = $.Event('hide') 816 | 817 | this.$element.trigger(e) 818 | 819 | if (!this.isShown || e.isDefaultPrevented()) return 820 | 821 | this.isShown = false 822 | 823 | $('body').removeClass('modal-open') 824 | 825 | this.escape() 826 | 827 | $(document).off('focusin.modal') 828 | 829 | this.$element 830 | .removeClass('in') 831 | .attr('aria-hidden', true) 832 | 833 | $.support.transition && this.$element.hasClass('fade') ? 834 | this.hideWithTransition() : 835 | this.hideModal() 836 | } 837 | 838 | , enforceFocus: function () { 839 | var that = this 840 | $(document).on('focusin.modal', function (e) { 841 | if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { 842 | that.$element.focus() 843 | } 844 | }) 845 | } 846 | 847 | , escape: function () { 848 | var that = this 849 | if (this.isShown && this.options.keyboard) { 850 | this.$element.on('keyup.dismiss.modal', function ( e ) { 851 | e.which == 27 && that.hide() 852 | }) 853 | } else if (!this.isShown) { 854 | this.$element.off('keyup.dismiss.modal') 855 | } 856 | } 857 | 858 | , hideWithTransition: function () { 859 | var that = this 860 | , timeout = setTimeout(function () { 861 | that.$element.off($.support.transition.end) 862 | that.hideModal() 863 | }, 500) 864 | 865 | this.$element.one($.support.transition.end, function () { 866 | clearTimeout(timeout) 867 | that.hideModal() 868 | }) 869 | } 870 | 871 | , hideModal: function (that) { 872 | this.$element 873 | .hide() 874 | .trigger('hidden') 875 | 876 | this.backdrop() 877 | } 878 | 879 | , removeBackdrop: function () { 880 | this.$backdrop.remove() 881 | this.$backdrop = null 882 | } 883 | 884 | , backdrop: function (callback) { 885 | var that = this 886 | , animate = this.$element.hasClass('fade') ? 'fade' : '' 887 | 888 | if (this.isShown && this.options.backdrop) { 889 | var doAnimate = $.support.transition && animate 890 | 891 | this.$backdrop = $('
') 892 | .appendTo(document.body) 893 | 894 | if (this.options.backdrop != 'static') { 895 | this.$backdrop.click($.proxy(this.hide, this)) 896 | } 897 | 898 | if (doAnimate) this.$backdrop[0].offsetWidth // force reflow 899 | 900 | this.$backdrop.addClass('in') 901 | 902 | doAnimate ? 903 | this.$backdrop.one($.support.transition.end, callback) : 904 | callback() 905 | 906 | } else if (!this.isShown && this.$backdrop) { 907 | this.$backdrop.removeClass('in') 908 | 909 | $.support.transition && this.$element.hasClass('fade')? 910 | this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) : 911 | this.removeBackdrop() 912 | 913 | } else if (callback) { 914 | callback() 915 | } 916 | } 917 | } 918 | 919 | 920 | /* MODAL PLUGIN DEFINITION 921 | * ======================= */ 922 | 923 | $.fn.modal = function (option) { 924 | return this.each(function () { 925 | var $this = $(this) 926 | , data = $this.data('modal') 927 | , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option) 928 | if (!data) $this.data('modal', (data = new Modal(this, options))) 929 | if (typeof option == 'string') data[option]() 930 | else if (options.show) data.show() 931 | }) 932 | } 933 | 934 | $.fn.modal.defaults = { 935 | backdrop: true 936 | , keyboard: true 937 | , show: true 938 | } 939 | 940 | $.fn.modal.Constructor = Modal 941 | 942 | 943 | /* MODAL DATA-API 944 | * ============== */ 945 | 946 | $(function () { 947 | $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) { 948 | var $this = $(this) 949 | , href = $this.attr('href') 950 | , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 951 | , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) 952 | 953 | e.preventDefault() 954 | 955 | $target 956 | .modal(option) 957 | .one('hide', function () { 958 | $this.focus() 959 | }) 960 | }) 961 | }) 962 | 963 | }(window.jQuery);/* =========================================================== 964 | * bootstrap-tooltip.js v2.1.0 965 | * http://twitter.github.com/bootstrap/javascript.html#tooltips 966 | * Inspired by the original jQuery.tipsy by Jason Frame 967 | * =========================================================== 968 | * Copyright 2012 Twitter, Inc. 969 | * 970 | * Licensed under the Apache License, Version 2.0 (the "License"); 971 | * you may not use this file except in compliance with the License. 972 | * You may obtain a copy of the License at 973 | * 974 | * http://www.apache.org/licenses/LICENSE-2.0 975 | * 976 | * Unless required by applicable law or agreed to in writing, software 977 | * distributed under the License is distributed on an "AS IS" BASIS, 978 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 979 | * See the License for the specific language governing permissions and 980 | * limitations under the License. 981 | * ========================================================== */ 982 | 983 | 984 | !function ($) { 985 | 986 | "use strict"; // jshint ;_; 987 | 988 | 989 | /* TOOLTIP PUBLIC CLASS DEFINITION 990 | * =============================== */ 991 | 992 | var Tooltip = function (element, options) { 993 | this.init('tooltip', element, options) 994 | } 995 | 996 | Tooltip.prototype = { 997 | 998 | constructor: Tooltip 999 | 1000 | , init: function (type, element, options) { 1001 | var eventIn 1002 | , eventOut 1003 | 1004 | this.type = type 1005 | this.$element = $(element) 1006 | this.options = this.getOptions(options) 1007 | this.enabled = true 1008 | 1009 | if (this.options.trigger == 'click') { 1010 | this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 1011 | } else if (this.options.trigger != 'manual') { 1012 | eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus' 1013 | eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur' 1014 | this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 1015 | this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 1016 | } 1017 | 1018 | this.options.selector ? 1019 | (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 1020 | this.fixTitle() 1021 | } 1022 | 1023 | , getOptions: function (options) { 1024 | options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data()) 1025 | 1026 | if (options.delay && typeof options.delay == 'number') { 1027 | options.delay = { 1028 | show: options.delay 1029 | , hide: options.delay 1030 | } 1031 | } 1032 | 1033 | return options 1034 | } 1035 | 1036 | , enter: function (e) { 1037 | var self = $(e.currentTarget)[this.type](this._options).data(this.type) 1038 | 1039 | if (!self.options.delay || !self.options.delay.show) return self.show() 1040 | 1041 | clearTimeout(this.timeout) 1042 | self.hoverState = 'in' 1043 | this.timeout = setTimeout(function() { 1044 | if (self.hoverState == 'in') self.show() 1045 | }, self.options.delay.show) 1046 | } 1047 | 1048 | , leave: function (e) { 1049 | var self = $(e.currentTarget)[this.type](this._options).data(this.type) 1050 | 1051 | if (this.timeout) clearTimeout(this.timeout) 1052 | if (!self.options.delay || !self.options.delay.hide) return self.hide() 1053 | 1054 | self.hoverState = 'out' 1055 | this.timeout = setTimeout(function() { 1056 | if (self.hoverState == 'out') self.hide() 1057 | }, self.options.delay.hide) 1058 | } 1059 | 1060 | , show: function () { 1061 | var $tip 1062 | , inside 1063 | , pos 1064 | , actualWidth 1065 | , actualHeight 1066 | , placement 1067 | , tp 1068 | 1069 | if (this.hasContent() && this.enabled) { 1070 | $tip = this.tip() 1071 | this.setContent() 1072 | 1073 | if (this.options.animation) { 1074 | $tip.addClass('fade') 1075 | } 1076 | 1077 | placement = typeof this.options.placement == 'function' ? 1078 | this.options.placement.call(this, $tip[0], this.$element[0]) : 1079 | this.options.placement 1080 | 1081 | inside = /in/.test(placement) 1082 | 1083 | $tip 1084 | .remove() 1085 | .css({ top: 0, left: 0, display: 'block' }) 1086 | .appendTo(inside ? this.$element : document.body) 1087 | 1088 | pos = this.getPosition(inside) 1089 | 1090 | actualWidth = $tip[0].offsetWidth 1091 | actualHeight = $tip[0].offsetHeight 1092 | 1093 | switch (inside ? placement.split(' ')[1] : placement) { 1094 | case 'bottom': 1095 | tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} 1096 | break 1097 | case 'top': 1098 | tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} 1099 | break 1100 | case 'left': 1101 | tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} 1102 | break 1103 | case 'right': 1104 | tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width} 1105 | break 1106 | } 1107 | 1108 | $tip 1109 | .css(tp) 1110 | .addClass(placement) 1111 | .addClass('in') 1112 | } 1113 | } 1114 | 1115 | , setContent: function () { 1116 | var $tip = this.tip() 1117 | , title = this.getTitle() 1118 | 1119 | $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) 1120 | $tip.removeClass('fade in top bottom left right') 1121 | } 1122 | 1123 | , hide: function () { 1124 | var that = this 1125 | , $tip = this.tip() 1126 | 1127 | $tip.removeClass('in') 1128 | 1129 | function removeWithAnimation() { 1130 | var timeout = setTimeout(function () { 1131 | $tip.off($.support.transition.end).remove() 1132 | }, 500) 1133 | 1134 | $tip.one($.support.transition.end, function () { 1135 | clearTimeout(timeout) 1136 | $tip.remove() 1137 | }) 1138 | } 1139 | 1140 | $.support.transition && this.$tip.hasClass('fade') ? 1141 | removeWithAnimation() : 1142 | $tip.remove() 1143 | 1144 | return this 1145 | } 1146 | 1147 | , fixTitle: function () { 1148 | var $e = this.$element 1149 | if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { 1150 | $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title') 1151 | } 1152 | } 1153 | 1154 | , hasContent: function () { 1155 | return this.getTitle() 1156 | } 1157 | 1158 | , getPosition: function (inside) { 1159 | return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), { 1160 | width: this.$element[0].offsetWidth 1161 | , height: this.$element[0].offsetHeight 1162 | }) 1163 | } 1164 | 1165 | , getTitle: function () { 1166 | var title 1167 | , $e = this.$element 1168 | , o = this.options 1169 | 1170 | title = $e.attr('data-original-title') 1171 | || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 1172 | 1173 | return title 1174 | } 1175 | 1176 | , tip: function () { 1177 | return this.$tip = this.$tip || $(this.options.template) 1178 | } 1179 | 1180 | , validate: function () { 1181 | if (!this.$element[0].parentNode) { 1182 | this.hide() 1183 | this.$element = null 1184 | this.options = null 1185 | } 1186 | } 1187 | 1188 | , enable: function () { 1189 | this.enabled = true 1190 | } 1191 | 1192 | , disable: function () { 1193 | this.enabled = false 1194 | } 1195 | 1196 | , toggleEnabled: function () { 1197 | this.enabled = !this.enabled 1198 | } 1199 | 1200 | , toggle: function () { 1201 | this[this.tip().hasClass('in') ? 'hide' : 'show']() 1202 | } 1203 | 1204 | , destroy: function () { 1205 | this.hide().$element.off('.' + this.type).removeData(this.type) 1206 | } 1207 | 1208 | } 1209 | 1210 | 1211 | /* TOOLTIP PLUGIN DEFINITION 1212 | * ========================= */ 1213 | 1214 | $.fn.tooltip = function ( option ) { 1215 | return this.each(function () { 1216 | var $this = $(this) 1217 | , data = $this.data('tooltip') 1218 | , options = typeof option == 'object' && option 1219 | if (!data) $this.data('tooltip', (data = new Tooltip(this, options))) 1220 | if (typeof option == 'string') data[option]() 1221 | }) 1222 | } 1223 | 1224 | $.fn.tooltip.Constructor = Tooltip 1225 | 1226 | $.fn.tooltip.defaults = { 1227 | animation: true 1228 | , placement: 'top' 1229 | , selector: false 1230 | , template: '