├── .gitignore ├── assets ├── .travis.yml ├── docs │ ├── assets │ │ ├── img │ │ │ ├── bird.png │ │ │ ├── browsers.png │ │ │ ├── icon-css3.png │ │ │ ├── icon-html5.png │ │ │ ├── less-small.png │ │ │ ├── github-16px.png │ │ │ ├── icon-github.png │ │ │ ├── icon-twitter.png │ │ │ ├── less-logo-large.png │ │ │ ├── grid-18px-masked.png │ │ │ ├── example-sites │ │ │ │ ├── jshint.png │ │ │ │ ├── kippt.png │ │ │ │ ├── fleetio.png │ │ │ │ └── soundready.png │ │ │ ├── glyphicons-halflings.png │ │ │ ├── bootstrap-mdo-sfmoma-01.jpg │ │ │ ├── bootstrap-mdo-sfmoma-02.jpg │ │ │ ├── bootstrap-mdo-sfmoma-03.jpg │ │ │ ├── responsive-illustrations.png │ │ │ ├── glyphicons-halflings-white.png │ │ │ ├── examples │ │ │ │ ├── bootstrap-example-fluid.jpg │ │ │ │ ├── bootstrap-example-hero.jpg │ │ │ │ └── bootstrap-example-starter.jpg │ │ │ └── glyphicons │ │ │ │ ├── glyphicons_009_magic.png │ │ │ │ ├── glyphicons_042_group.png │ │ │ │ ├── glyphicons_079_podium.png │ │ │ │ ├── glyphicons_163_iphone.png │ │ │ │ ├── glyphicons_266_book_open.png │ │ │ │ ├── glyphicons_082_roundabout.png │ │ │ │ ├── glyphicons_214_resize_small.png │ │ │ │ └── glyphicons_155_show_thumbnails.png │ │ ├── ico │ │ │ ├── favicon.ico │ │ │ ├── apple-touch-icon-114-precomposed.png │ │ │ ├── apple-touch-icon-144-precomposed.png │ │ │ ├── apple-touch-icon-57-precomposed.png │ │ │ └── apple-touch-icon-72-precomposed.png │ │ └── js │ │ │ ├── google-code-prettify │ │ │ └── prettify.css │ │ │ ├── bootstrap-transition.js │ │ │ ├── bootstrap-alert.js │ │ │ ├── bootstrap-button.js │ │ │ ├── bootstrap-dropdown.js │ │ │ ├── bootstrap-popover.js │ │ │ ├── README.md │ │ │ ├── bootstrap-tab.js │ │ │ ├── bootstrap-scrollspy.js │ │ │ └── bootstrap-collapse.js │ ├── build │ │ ├── package.json │ │ └── index.js │ ├── templates │ │ └── pages │ │ │ └── examples.mustache │ └── examples │ │ └── starter-template.html ├── img │ ├── glyphicons-halflings.png │ └── glyphicons-halflings-white.png ├── less │ ├── grid.less │ ├── utilities.less │ ├── component-animations.less │ ├── layouts.less │ ├── responsive-768px-979px.less │ ├── hero-unit.less │ ├── responsive-1200px-min.less │ ├── breadcrumbs.less │ ├── wells.less │ ├── scaffolding.less │ ├── close.less │ ├── pager.less │ ├── accordion.less │ ├── tooltip.less │ ├── tests │ │ ├── css-tests.css │ │ ├── navbar.html │ │ └── forms.html │ ├── thumbnails.less │ ├── responsive.less │ ├── pagination.less │ ├── alerts.less │ ├── popovers.less │ ├── responsive-utilities.less │ ├── code.less │ ├── bootstrap.less │ ├── labels-badges.less │ ├── modals.less │ ├── carousel.less │ ├── progress-bars.less │ ├── reset.less │ ├── responsive-767px-max.less │ ├── dropdowns.less │ ├── responsive-navbar.less │ ├── type.less │ ├── tables.less │ └── buttons.less ├── js │ ├── .jshintrc │ ├── tests │ │ ├── server.js │ │ ├── unit │ │ │ ├── bootstrap-transition.js │ │ │ ├── bootstrap-phantom.js │ │ │ ├── bootstrap-carousel.js │ │ │ ├── bootstrap-scrollspy.js │ │ │ ├── bootstrap-collapse.js │ │ │ ├── bootstrap-alert.js │ │ │ ├── bootstrap-tab.js │ │ │ ├── bootstrap-button.js │ │ │ ├── bootstrap-popover.js │ │ │ ├── bootstrap-dropdown.js │ │ │ └── bootstrap-modal.js │ │ ├── index.html │ │ └── phantom.js │ ├── bootstrap-transition.js │ ├── bootstrap-alert.js │ ├── bootstrap-button.js │ ├── bootstrap-dropdown.js │ ├── bootstrap-popover.js │ ├── bootstrap-tab.js │ ├── README.md │ ├── bootstrap-scrollspy.js │ └── bootstrap-collapse.js ├── .gitignore ├── package.json ├── css │ └── pygments.css ├── Makefile └── README.md ├── Rakefile ├── workers ├── email_worker.worker ├── schedule_lead_worker.rb ├── schedule_converted_worker.rb ├── lead_worker.rb ├── email_worker.rb └── converted_worker.rb ├── config.ru ├── models ├── idable.rb ├── contact.rb └── cache_orm.rb ├── Gemfile ├── config_sample.yml ├── views ├── index.erb ├── contacts.erb └── layout.erb ├── test_email.rb ├── config_pusher.rb ├── app.rb ├── controllers └── main.rb ├── README.md ├── Gemfile.lock └── config.rb /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | config.yml 3 | iron.json 4 | -------------------------------------------------------------------------------- /assets/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.6 -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | task :push_config do 2 | require_relative 'config_pusher' 3 | cp = ConfigPusher.new 4 | cp.push 5 | end 6 | -------------------------------------------------------------------------------- /workers/email_worker.worker: -------------------------------------------------------------------------------- 1 | runtime "ruby" 2 | exec "email_worker.rb" 3 | gem "mail" 4 | gem "rest" 5 | gem "iron_cache" 6 | -------------------------------------------------------------------------------- /assets/docs/assets/img/bird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/bird.png -------------------------------------------------------------------------------- /assets/docs/assets/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/ico/favicon.ico -------------------------------------------------------------------------------- /assets/docs/assets/img/browsers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/browsers.png -------------------------------------------------------------------------------- /assets/docs/assets/img/icon-css3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/icon-css3.png -------------------------------------------------------------------------------- /assets/docs/assets/img/icon-html5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/icon-html5.png -------------------------------------------------------------------------------- /assets/docs/assets/img/less-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/less-small.png -------------------------------------------------------------------------------- /assets/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /assets/docs/assets/img/github-16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/github-16px.png -------------------------------------------------------------------------------- /assets/docs/assets/img/icon-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/icon-github.png -------------------------------------------------------------------------------- /assets/docs/assets/img/icon-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/icon-twitter.png -------------------------------------------------------------------------------- /assets/docs/assets/img/less-logo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/less-logo-large.png -------------------------------------------------------------------------------- /assets/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /assets/docs/assets/img/grid-18px-masked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/grid-18px-masked.png -------------------------------------------------------------------------------- /assets/docs/assets/img/example-sites/jshint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/example-sites/jshint.png -------------------------------------------------------------------------------- /assets/docs/assets/img/example-sites/kippt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/example-sites/kippt.png -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /assets/docs/assets/img/example-sites/fleetio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/example-sites/fleetio.png -------------------------------------------------------------------------------- /assets/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg -------------------------------------------------------------------------------- /assets/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg -------------------------------------------------------------------------------- /assets/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg -------------------------------------------------------------------------------- /assets/docs/assets/img/example-sites/soundready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/example-sites/soundready.png -------------------------------------------------------------------------------- /assets/docs/assets/img/responsive-illustrations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/responsive-illustrations.png -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /assets/less/grid.less: -------------------------------------------------------------------------------- 1 | // Fixed (940px) 2 | #grid > .core(@gridColumnWidth, @gridGutterWidth); 3 | 4 | // Fluid (940px) 5 | #grid > .fluid(@fluidGridColumnWidth, @fluidGridGutterWidth); -------------------------------------------------------------------------------- /assets/docs/assets/ico/apple-touch-icon-114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/ico/apple-touch-icon-114-precomposed.png -------------------------------------------------------------------------------- /assets/docs/assets/ico/apple-touch-icon-144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/ico/apple-touch-icon-144-precomposed.png -------------------------------------------------------------------------------- /assets/docs/assets/ico/apple-touch-icon-57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/ico/apple-touch-icon-57-precomposed.png -------------------------------------------------------------------------------- /assets/docs/assets/ico/apple-touch-icon-72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/ico/apple-touch-icon-72-precomposed.png -------------------------------------------------------------------------------- /assets/docs/assets/img/examples/bootstrap-example-fluid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/examples/bootstrap-example-fluid.jpg -------------------------------------------------------------------------------- /assets/docs/assets/img/examples/bootstrap-example-hero.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/examples/bootstrap-example-hero.jpg -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons/glyphicons_009_magic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons/glyphicons_009_magic.png -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons/glyphicons_042_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons/glyphicons_042_group.png -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons/glyphicons_079_podium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons/glyphicons_079_podium.png -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons/glyphicons_163_iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons/glyphicons_163_iphone.png -------------------------------------------------------------------------------- /assets/docs/assets/img/examples/bootstrap-example-starter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/examples/bootstrap-example-starter.jpg -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons/glyphicons_266_book_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons/glyphicons_266_book_open.png -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | require 'bundler' 3 | Bundler.require 4 | 5 | $: << File.expand_path(File.dirname(__FILE__)) 6 | 7 | require 'app' 8 | 9 | run Sinatra::Application 10 | -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons/glyphicons_082_roundabout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons/glyphicons_082_roundabout.png -------------------------------------------------------------------------------- /assets/docs/build/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap-doc-builder" 3 | , "version": "0.0.1" 4 | , "description": "build bootstrap docs" 5 | , "dependencies": { "hogan.js": "1.0.5-dev" } 6 | } 7 | -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons/glyphicons_214_resize_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons/glyphicons_214_resize_small.png -------------------------------------------------------------------------------- /assets/docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iron-io/heroku_iron_boomi_salesforce/master/assets/docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png -------------------------------------------------------------------------------- /models/idable.rb: -------------------------------------------------------------------------------- 1 | require 'uuid' 2 | 3 | module Idable 4 | 5 | def id 6 | @id 7 | end 8 | 9 | def id=(id) 10 | @id = id 11 | end 12 | 13 | def self.generate_id 14 | UUID.new.generate 15 | end 16 | 17 | end 18 | -------------------------------------------------------------------------------- /assets/js/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "validthis": true, 3 | "laxcomma" : true, 4 | "laxbreak" : true, 5 | "browser" : true, 6 | "debug" : true, 7 | "boss" : true, 8 | "expr" : true, 9 | "asi" : true 10 | } -------------------------------------------------------------------------------- /models/contact.rb: -------------------------------------------------------------------------------- 1 | class Contact 2 | include Jsonable 3 | include Idable 4 | 5 | attr_accessor :email, 6 | :name, 7 | :company, 8 | :salesforce_id, 9 | :status, 10 | :action, 11 | :result 12 | end 13 | 14 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://rubygems.org' 2 | 3 | gem 'sinatra', :require=>'sinatra/base' 4 | 5 | gem 'iron_worker_ng' 6 | gem 'iron_mq' 7 | gem 'iron_cache' 8 | 9 | gem 'rack-flash3' # Fixes issues with new rack 10 | gem 'jsonable' # serializing classes 11 | gem 'uuid' 12 | gem 'rest' 13 | gem 'uber_config' 14 | -------------------------------------------------------------------------------- /assets/less/utilities.less: -------------------------------------------------------------------------------- 1 | // UTILITY CLASSES 2 | // --------------- 3 | 4 | // Quick floats 5 | .pull-right { 6 | float: right; 7 | } 8 | .pull-left { 9 | float: left; 10 | } 11 | 12 | // Toggling content 13 | .hide { 14 | display: none; 15 | } 16 | .show { 17 | display: block; 18 | } 19 | 20 | // Visibility 21 | .invisible { 22 | visibility: hidden; 23 | } 24 | -------------------------------------------------------------------------------- /assets/less/component-animations.less: -------------------------------------------------------------------------------- 1 | // COMPONENT ANIMATIONS 2 | // -------------------- 3 | 4 | .fade { 5 | opacity: 0; 6 | .transition(opacity .15s linear); 7 | &.in { 8 | opacity: 1; 9 | } 10 | } 11 | 12 | .collapse { 13 | position: relative; 14 | height: 0; 15 | overflow: hidden; 16 | .transition(height .35s ease); 17 | &.in { 18 | height: auto; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /assets/js/tests/server.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple connect server for phantom.js 3 | * Adapted from Modernizr 4 | */ 5 | 6 | var connect = require('connect') 7 | , http = require('http') 8 | , fs = require('fs') 9 | , app = connect() 10 | .use(connect.static(__dirname + '/../../')); 11 | 12 | http.createServer(app).listen(3000); 13 | 14 | fs.writeFileSync(__dirname + '/pid.txt', process.pid, 'utf-8') -------------------------------------------------------------------------------- /config_sample.yml: -------------------------------------------------------------------------------- 1 | # app_name will be used for cache naming and other things 2 | app_name: "irondream.herokuapp.com" 3 | 4 | iron: 5 | token: MY IRON.IO TOKEN 6 | project_id: MY IRON.IO PROJECT ID 7 | 8 | email: 9 | host: smtp.sendgrid.net 10 | domain: YOUR DOMAIN, eg: yourbiz.com 11 | port: 587 12 | username: USERNAME 13 | password: PASS 14 | from: ADDRESS MESSAGES WILL BE SENT FROM 15 | 16 | -------------------------------------------------------------------------------- /assets/less/layouts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Layouts 3 | // Fixed-width and fluid (with sidebar) layouts 4 | // -------------------------------------------- 5 | 6 | 7 | // Container (centered, fixed-width layouts) 8 | .container { 9 | .container-fixed(); 10 | } 11 | 12 | // Fluid layouts (left aligned, with sidebar, min- & max-width content) 13 | .container-fluid { 14 | padding-right: @gridGutterWidth; 15 | padding-left: @gridGutterWidth; 16 | .clearfix(); 17 | } -------------------------------------------------------------------------------- /assets/js/tests/unit/bootstrap-transition.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-transition") 4 | 5 | test("should be defined on jquery support object", function () { 6 | ok($.support.transition !== undefined, 'transition object is defined') 7 | }) 8 | 9 | test("should provide an end object", function () { 10 | ok($.support.transition ? $.support.transition.end : true, 'end string is defined') 11 | }) 12 | 13 | }) -------------------------------------------------------------------------------- /assets/less/responsive-768px-979px.less: -------------------------------------------------------------------------------- 1 | // PORTRAIT TABLET TO DEFAULT DESKTOP 2 | // ---------------------------------- 3 | 4 | @media (min-width: 768px) and (max-width: 979px) { 5 | 6 | // Fixed grid 7 | #grid > .core(42px, 20px); 8 | 9 | // Fluid grid 10 | #grid > .fluid(5.801104972%, 2.762430939%); 11 | 12 | // Input grid 13 | #grid > .input(42px, 20px); 14 | 15 | // No need to reset .thumbnails here since it's the same @gridGutterWidth 16 | 17 | } 18 | -------------------------------------------------------------------------------- /views/index.erb: -------------------------------------------------------------------------------- 1 |
6 | Please fill out the form below. 7 |
8 | 9 | 21 || ID | 16 |Name | 17 |Company | 19 |Action | 20 |To | 21 |Status | 22 |Salesforce ID | 23 ||
|---|---|---|---|---|---|---|---|
| <%= c.id %> | 27 |<%= c.name %> | 28 |<%= c.email %> | 29 |<%= c.company %> | 30 |<%= c.action %> | 31 |<%= c.result %> | 32 |<%= c.status %> | 33 |<%= c.salesforce_id %> | 34 |
and elements
3 | // --------------------------------------------------------
4 |
5 | // Inline and block code styles
6 | code,
7 | pre {
8 | padding: 0 3px 2px;
9 | #font > #family > .monospace;
10 | font-size: @baseFontSize - 1;
11 | color: @grayDark;
12 | .border-radius(3px);
13 | }
14 |
15 | // Inline code
16 | code {
17 | padding: 2px 4px;
18 | color: #d14;
19 | background-color: #f7f7f9;
20 | border: 1px solid #e1e1e8;
21 | }
22 |
23 | // Blocks of code
24 | pre {
25 | display: block;
26 | padding: (@baseLineHeight - 1) / 2;
27 | margin: 0 0 @baseLineHeight / 2;
28 | font-size: @baseFontSize * .925; // 13px to 12px
29 | line-height: @baseLineHeight;
30 | word-break: break-all;
31 | word-wrap: break-word;
32 | white-space: pre;
33 | white-space: pre-wrap;
34 | background-color: #f5f5f5;
35 | border: 1px solid #ccc; // fallback for IE7-8
36 | border: 1px solid rgba(0,0,0,.15);
37 | .border-radius(4px);
38 |
39 | // Make prettyprint styles more spaced out for readability
40 | &.prettyprint {
41 | margin-bottom: @baseLineHeight;
42 | }
43 |
44 | // Account for some code outputs that place code tags in pre tags
45 | code {
46 | padding: 0;
47 | color: inherit;
48 | background-color: transparent;
49 | border: 0;
50 | }
51 | }
52 |
53 | // Enable scrollable blocks of code
54 | .pre-scrollable {
55 | max-height: 340px;
56 | overflow-y: scroll;
57 | }
--------------------------------------------------------------------------------
/assets/docs/templates/pages/examples.mustache:
--------------------------------------------------------------------------------
1 |
3 |
4 | {{_i}}Bootstrap examples{{/i}}
5 | {{_i}}We've included a few basic examples as starting points for your work with Bootstrap. We encourage folks to iterate on these examples and not simply use them as an end result.{{/i}}
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 | {{_i}}Basic marketing site{{/i}}
15 | {{_i}}Featuring a hero unit for a primary message and three supporting elements.{{/i}}
16 |
17 | -
18 |
19 |
20 |
21 | {{_i}}Fluid layout{{/i}}
22 | {{_i}}Uses our new responsive, fluid grid system to create a seamless liquid layout.{{/i}}
23 |
24 | -
25 |
26 |
27 |
28 | {{_i}}Starter template{{/i}}
29 | {{_i}}A barebones HTML document with all the Bootstrap CSS and javascript included.{{/i}}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/workers/lead_worker.rb:
--------------------------------------------------------------------------------
1 | require 'iron_worker'
2 |
3 | class LeadWorker < IronWorker::Base
4 | attr_accessor :iron_project_id
5 | attr_accessor :iron_token
6 |
7 | attr_accessor :mongodb_uri
8 | attr_accessor :mongodb_database
9 |
10 | merge_gem 'iron_mq'
11 | merge_gem 'mongoid'
12 |
13 | merge '../models/contact'
14 |
15 | def run
16 | mq = IronMQ::Client.new('token' => @iron_token, 'project_id' => @iron_project_id)
17 | mq.queue_name = 'lead_created'
18 |
19 | Mongoid.configure do |config|
20 | config.master = Mongo::Connection.from_uri(@mongodb_uri + '/' + @mongodb_database)[@mongodb_database]
21 | end
22 |
23 | while true
24 | msg = mq.messages.get
25 | if msg.nil?
26 | puts 'No more messages'
27 | break
28 | end
29 |
30 | p msg
31 | p msg.body
32 | if msg.body.nil? || msg.body == ""
33 | puts "Body is null, deleting."
34 | msg.delete
35 | next
36 | end
37 |
38 | body = JSON.parse(msg.body)
39 |
40 | puts "got salesforce_id #{body['salesforce_id']} for contact id #{body['id']}"
41 |
42 | begin
43 | c = Contact.find(BSON::ObjectId(body['id']))
44 | rescue => ex
45 | puts "Couldn't find contact! #{ex.message}"
46 | p msg.delete
47 | next
48 | end
49 | c.salesforce_id = body['salesforce_id']
50 | c.save!
51 |
52 | puts "set salesforce_id for contact id #{c.id} email #{c.email}"
53 |
54 | p msg.delete
55 | end
56 | end
57 | end
58 |
--------------------------------------------------------------------------------
/workers/email_worker.rb:
--------------------------------------------------------------------------------
1 | require 'mail'
2 |
3 | # Configures smtp settings to send email.
4 | def init_mail(params)
5 | username = params['username']
6 | password = params['password']
7 | domain = params['domain']
8 | host = params['host']
9 | port = params['port']
10 |
11 | puts "Preparing mail configuration"
12 | mail_conf = {:address => host,
13 | :port => port,
14 | :domain => domain, #custom domain
15 | :user_name => username,
16 | :password => password,
17 | :authentication => 'plain',
18 | :enable_starttls_auto => true} #gmail require this option
19 | Mail.defaults do
20 | delivery_method :smtp, mail_conf
21 | end
22 | puts "Mail service configured"
23 | end
24 |
25 | def send_mail(to, from, subject, content)
26 | puts "Preparing email from: #{from}, to: #{to}, subject: #{subject}, body: #{content}"
27 | msg = Mail.new do
28 | to to
29 | from from
30 | subject subject
31 | html_part do |m|
32 | content_type 'text/html'
33 | body content
34 | end
35 | end
36 | puts "Mail ready, delivering"
37 | details = msg.deliver
38 | puts "Mail delivered!"
39 | details
40 | end
41 |
42 | # Sample worker that sends an email.
43 | puts "Worker started"
44 |
45 | init_mail(params['email'])
46 |
47 | to = params['to']
48 | unless to.is_a?(Array)
49 | to = [to]
50 | end
51 |
52 | to.each do |email|
53 | message_details = send_mail(email, params['from'], params['subject'], params['body'])
54 | end
55 |
56 | puts "Worker finished"
57 |
--------------------------------------------------------------------------------
/workers/converted_worker.rb:
--------------------------------------------------------------------------------
1 | require 'iron_worker'
2 |
3 | class ConvertedWorker < IronWorker::Base
4 | attr_accessor :iron_project_id
5 | attr_accessor :iron_token
6 |
7 | attr_accessor :mongodb_uri
8 | attr_accessor :mongodb_database
9 |
10 | merge_gem 'iron_mq'
11 | merge_gem 'mongoid'
12 |
13 | merge '../models/contact'
14 |
15 | def run
16 | mq = IronMQ::Client.new('token' => @iron_token, 'project_id' => @iron_project_id)
17 | mq.queue_name = 'converted'
18 |
19 | Mongoid.configure do |config|
20 | config.master = Mongo::Connection.from_uri(@mongodb_uri + '/' + @mongodb_database)[@mongodb_database]
21 | end
22 |
23 | while true
24 | msg = mq.messages.get
25 | if msg.nil?
26 | puts 'No more messages'
27 | break
28 | end
29 |
30 | p msg
31 | p msg.body
32 | if msg.body.nil? || msg.body == ""
33 | puts "Body is null, deleting."
34 | msg.delete
35 | next
36 | end
37 |
38 | body = JSON.parse(msg.body)
39 |
40 | salesforce_id = body['salesforce_id']
41 | puts "got salesforce_id #{salesforce_id}"
42 |
43 | c = nil
44 | begin
45 | c = Contact.where(salesforce_id: salesforce_id).first
46 | rescue => ex
47 | puts "Error finding contact! #{ex.message}"
48 | end
49 | if c.nil?
50 | puts "Couldn't find contact! #{salesforce_id}"
51 | # p msg.delete
52 | next
53 | end
54 | c.action = body['action']
55 | c.status = body['to'] # opportunity
56 | c.save!
57 |
58 | puts "set salesforce_id for contact id #{c.id} email #{c.email}"
59 |
60 | #p msg.delete
61 | end
62 | end
63 | end
64 |
--------------------------------------------------------------------------------
/assets/less/bootstrap.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * Bootstrap v2.0.4
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 | // CSS Reset
12 | @import "reset.less";
13 |
14 | // Core variables and mixins
15 | @import "variables.less"; // Modify this for custom colors, font-sizes, etc
16 | @import "mixins.less";
17 |
18 | // Grid system and page structure
19 | @import "scaffolding.less";
20 | @import "grid.less";
21 | @import "layouts.less";
22 |
23 | // Base CSS
24 | @import "type.less";
25 | @import "code.less";
26 | @import "forms.less";
27 | @import "tables.less";
28 |
29 | // Components: common
30 | @import "sprites.less";
31 | @import "dropdowns.less";
32 | @import "wells.less";
33 | @import "component-animations.less";
34 | @import "close.less";
35 |
36 | // Components: Buttons & Alerts
37 | @import "buttons.less";
38 | @import "button-groups.less";
39 | @import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
40 |
41 | // Components: Nav
42 | @import "navs.less";
43 | @import "navbar.less";
44 | @import "breadcrumbs.less";
45 | @import "pagination.less";
46 | @import "pager.less";
47 |
48 | // Components: Popovers
49 | @import "modals.less";
50 | @import "tooltip.less";
51 | @import "popovers.less";
52 |
53 | // Components: Misc
54 | @import "thumbnails.less";
55 | @import "labels-badges.less";
56 | @import "progress-bars.less";
57 | @import "accordion.less";
58 | @import "carousel.less";
59 | @import "hero-unit.less";
60 |
61 | // Utility classes
62 | @import "utilities.less"; // Has to be last to override when necessary
63 |
--------------------------------------------------------------------------------
/assets/less/labels-badges.less:
--------------------------------------------------------------------------------
1 | // LABELS & BADGES
2 | // ---------------
3 |
4 | // Base classes
5 | .label,
6 | .badge {
7 | font-size: @baseFontSize * .846;
8 | font-weight: bold;
9 | line-height: 14px; // ensure proper line-height if floated
10 | color: @white;
11 | vertical-align: baseline;
12 | white-space: nowrap;
13 | text-shadow: 0 -1px 0 rgba(0,0,0,.25);
14 | background-color: @grayLight;
15 | }
16 | // Set unique padding and border-radii
17 | .label {
18 | padding: 1px 4px 2px;
19 | .border-radius(3px);
20 | }
21 | .badge {
22 | padding: 1px 9px 2px;
23 | .border-radius(9px);
24 | }
25 |
26 | // Hover state, but only for links
27 | a {
28 | &.label:hover,
29 | &.badge:hover {
30 | color: @white;
31 | text-decoration: none;
32 | cursor: pointer;
33 | }
34 | }
35 |
36 | // Colors
37 | // Only give background-color difference to links (and to simplify, we don't qualifty with `a` but [href] attribute)
38 | .label,
39 | .badge {
40 | // Important (red)
41 | &-important { background-color: @errorText; }
42 | &-important[href] { background-color: darken(@errorText, 10%); }
43 | // Warnings (orange)
44 | &-warning { background-color: @orange; }
45 | &-warning[href] { background-color: darken(@orange, 10%); }
46 | // Success (green)
47 | &-success { background-color: @successText; }
48 | &-success[href] { background-color: darken(@successText, 10%); }
49 | // Info (turquoise)
50 | &-info { background-color: @infoText; }
51 | &-info[href] { background-color: darken(@infoText, 10%); }
52 | // Inverse (black)
53 | &-inverse { background-color: @grayDark; }
54 | &-inverse[href] { background-color: darken(@grayDark, 10%); }
55 | }
56 |
--------------------------------------------------------------------------------
/assets/js/tests/unit/bootstrap-collapse.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | module("bootstrap-collapse")
4 |
5 | test("should be defined on jquery object", function () {
6 | ok($(document.body).collapse, 'collapse method is defined')
7 | })
8 |
9 | test("should return element", function () {
10 | ok($(document.body).collapse()[0] == document.body, 'document.body returned')
11 | })
12 |
13 | test("should show a collapsed element", function () {
14 | var el = $('').collapse('show')
15 | ok(el.hasClass('in'), 'has class in')
16 | ok(/height/.test(el.attr('style')), 'has height set')
17 | })
18 |
19 | test("should hide a collapsed element", function () {
20 | var el = $('').collapse('hide')
21 | ok(!el.hasClass('in'), 'does not have class in')
22 | ok(/height/.test(el.attr('style')), 'has height set')
23 | })
24 |
25 | test("should not fire shown when show is prevented", function () {
26 | $.support.transition = false
27 | stop();
28 | $('')
29 | .bind('show', function (e) {
30 | e.preventDefault();
31 | ok(true);
32 | start();
33 | })
34 | .bind('shown', function () {
35 | ok(false);
36 | })
37 | .collapse('show')
38 | })
39 |
40 | test("should reset style to auto after finishing opening collapse", function () {
41 | $.support.transition = false
42 | stop();
43 | $('')
44 | .bind('show', function () {
45 | ok(this.style.height == '0px')
46 | })
47 | .bind('shown', function () {
48 | ok(this.style.height == 'auto')
49 | start()
50 | })
51 | .collapse('show')
52 | })
53 |
54 | })
--------------------------------------------------------------------------------
/assets/js/bootstrap-transition.js:
--------------------------------------------------------------------------------
1 | /* ===================================================
2 | * bootstrap-transition.js v2.0.4
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'
40 | , 'msTransition' : 'MSTransitionEnd'
41 | , 'transition' : 'transitionend'
42 | }
43 | , name
44 |
45 | for (name in transEndEventNames){
46 | if (el.style[name] !== undefined) {
47 | return transEndEventNames[name]
48 | }
49 | }
50 |
51 | }())
52 |
53 | return transitionEnd && {
54 | end: transitionEnd
55 | }
56 |
57 | })()
58 |
59 | })
60 |
61 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/docs/assets/js/bootstrap-transition.js:
--------------------------------------------------------------------------------
1 | /* ===================================================
2 | * bootstrap-transition.js v2.0.4
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'
40 | , 'msTransition' : 'MSTransitionEnd'
41 | , 'transition' : 'transitionend'
42 | }
43 | , name
44 |
45 | for (name in transEndEventNames){
46 | if (el.style[name] !== undefined) {
47 | return transEndEventNames[name]
48 | }
49 | }
50 |
51 | }())
52 |
53 | return transitionEnd && {
54 | end: transitionEnd
55 | }
56 |
57 | })()
58 |
59 | })
60 |
61 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/js/tests/unit/bootstrap-alert.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | module("bootstrap-alerts")
4 |
5 | test("should be defined on jquery object", function () {
6 | ok($(document.body).alert, 'alert method is defined')
7 | })
8 |
9 | test("should return element", function () {
10 | ok($(document.body).alert()[0] == document.body, 'document.body returned')
11 | })
12 |
13 | test("should fade element out on clicking .close", function () {
14 | var alertHTML = ''
18 | , alert = $(alertHTML).alert()
19 |
20 | alert.find('.close').click()
21 |
22 | ok(!alert.hasClass('in'), 'remove .in class on .close click')
23 | })
24 |
25 | test("should remove element when clicking .close", function () {
26 | $.support.transition = false
27 |
28 | var alertHTML = ''
32 | , alert = $(alertHTML).appendTo('#qunit-fixture').alert()
33 |
34 | ok($('#qunit-fixture').find('.alert-message').length, 'element added to dom')
35 |
36 | alert.find('.close').click()
37 |
38 | ok(!$('#qunit-fixture').find('.alert-message').length, 'element removed from dom')
39 | })
40 |
41 | test("should not fire closed when close is prevented", function () {
42 | $.support.transition = false
43 | stop();
44 | $('')
45 | .bind('close', function (e) {
46 | e.preventDefault();
47 | ok(true);
48 | start();
49 | })
50 | .bind('closed', function () {
51 | ok(false);
52 | })
53 | .alert('close')
54 | })
55 |
56 | })
--------------------------------------------------------------------------------
/assets/js/tests/unit/bootstrap-tab.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | module("bootstrap-tabs")
4 |
5 | test("should be defined on jquery object", function () {
6 | ok($(document.body).tab, 'tabs method is defined')
7 | })
8 |
9 | test("should return element", function () {
10 | ok($(document.body).tab()[0] == document.body, 'document.body returned')
11 | })
12 |
13 | test("should activate element by tab id", function () {
14 | var tabsHTML =
15 | ''
19 |
20 | $('
').appendTo("#qunit-fixture")
21 |
22 | $(tabsHTML).find('li:last a').tab('show')
23 | equals($("#qunit-fixture").find('.active').attr('id'), "profile")
24 |
25 | $(tabsHTML).find('li:first a').tab('show')
26 | equals($("#qunit-fixture").find('.active').attr('id'), "home")
27 | })
28 |
29 | test("should activate element by tab id", function () {
30 | var pillsHTML =
31 | ''
35 |
36 | $('
').appendTo("#qunit-fixture")
37 |
38 | $(pillsHTML).find('li:last a').tab('show')
39 | equals($("#qunit-fixture").find('.active').attr('id'), "profile")
40 |
41 | $(pillsHTML).find('li:first a').tab('show')
42 | equals($("#qunit-fixture").find('.active').attr('id'), "home")
43 | })
44 |
45 |
46 | test("should not fire closed when close is prevented", function () {
47 | $.support.transition = false
48 | stop();
49 | $('')
50 | .bind('show', function (e) {
51 | e.preventDefault();
52 | ok(true);
53 | start();
54 | })
55 | .bind('shown', function () {
56 | ok(false);
57 | })
58 | .tab('show')
59 | })
60 |
61 | })
--------------------------------------------------------------------------------
/assets/js/tests/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Bootstrap Plugin Test Suite
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | Bootstrap Plugin Test Suite
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/models/cache_orm.rb:
--------------------------------------------------------------------------------
1 | class CacheOrm
2 |
3 | def initialize(ironcache)
4 | @cache = ironcache
5 | end
6 |
7 |
8 | def key_for(idable, id=nil)
9 | if id
10 | # idable should be a class
11 | "#{idable.name.downcase}_#{id}"
12 | else
13 | "#{idable.class.name.downcase}_#{idable.id}"
14 | end
15 | end
16 |
17 | def save(idable)
18 | unless idable.id
19 | idable.id = Idable.generate_id
20 | end
21 | put(key_for(idable), idable)
22 |
23 | end
24 |
25 | def get_list(key)
26 | messages = get(key)
27 | #puts 'got messages: ' + messages.inspect
28 | if messages.nil?
29 | messages = []
30 | end
31 | messages
32 | end
33 |
34 | def add_to_list(key, item)
35 | messages = get_list(key)
36 | messages.unshift(item)
37 | put(key, messages)
38 | end
39 |
40 | def get(key)
41 | val = @cache.get(key)
42 | #puts 'got val: ' + val.inspect
43 | if val.nil?
44 | puts "GOT NIL for key #{key}"
45 | return nil
46 | end
47 | val = val.value
48 | #puts "got from cache #{val}"
49 | begin
50 | val = JSON.parse(val)
51 | if val.is_a?(Hash) && val['string']
52 | val = val['string']
53 | end
54 | rescue => ex
55 | puts "CAUGHT: #{ex.message}"
56 | end
57 | val
58 | end
59 |
60 | def put(key, value, options={})
61 | if value.is_a?(String)
62 | # need to wrap it
63 | value = {string: value}.to_json
64 | else
65 | value = value.to_json
66 | end
67 | #puts 'value jsoned: ' + value.inspect
68 | @cache.put(key, value, options)
69 | end
70 |
71 | def delete(key)
72 | @cache.delete(key)
73 | end
74 |
75 | def increment(key, value=1)
76 | puts 'INC'
77 | begin
78 | ret = @cache.increment(key)
79 | puts 'INC RET ' + ret.inspect
80 | return ret.value
81 | rescue Rest::HttpError, IronCore::ResponseError => ex
82 | p ex
83 | puts "couldn't increment #{key}"
84 | puts ex.message
85 | p ex.backtrace
86 | if ex.code == 404
87 | puts "setting value in cache"
88 | settings.iron_cache.put(key, 1)
89 | end
90 | puts "done increment"
91 | return 1
92 | end
93 | puts 'end inc'
94 | end
95 |
96 | end
97 |
--------------------------------------------------------------------------------
/assets/js/tests/phantom.js:
--------------------------------------------------------------------------------
1 | // Simple phantom.js integration script
2 | // Adapted from Modernizr
3 |
4 | function waitFor(testFx, onReady, timeOutMillis) {
5 | var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 5001 //< Default Max Timout is 5s
6 | , start = new Date().getTime()
7 | , condition = false
8 | , interval = setInterval(function () {
9 | if ((new Date().getTime() - start < maxtimeOutMillis) && !condition) {
10 | // If not time-out yet and condition not yet fulfilled
11 | condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()) //< defensive code
12 | } else {
13 | if (!condition) {
14 | // If condition still not fulfilled (timeout but condition is 'false')
15 | console.log("'waitFor()' timeout")
16 | phantom.exit(1)
17 | } else {
18 | // Condition fulfilled (timeout and/or condition is 'true')
19 | typeof(onReady) === "string" ? eval(onReady) : onReady() //< Do what it's supposed to do once the condition is fulfilled
20 | clearInterval(interval) //< Stop this interval
21 | }
22 | }
23 | }, 100) //< repeat check every 100ms
24 | }
25 |
26 |
27 | if (phantom.args.length === 0 || phantom.args.length > 2) {
28 | console.log('Usage: phantom.js URL')
29 | phantom.exit()
30 | }
31 |
32 | var page = new WebPage()
33 |
34 | // Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this")
35 | page.onConsoleMessage = function(msg) {
36 | console.log(msg)
37 | };
38 |
39 | page.open(phantom.args[0], function(status){
40 | if (status !== "success") {
41 | console.log("Unable to access network")
42 | phantom.exit()
43 | } else {
44 | waitFor(function(){
45 | return page.evaluate(function(){
46 | var el = document.getElementById('qunit-testresult')
47 | if (el && el.innerText.match('completed')) {
48 | return true
49 | }
50 | return false
51 | })
52 | }, function(){
53 | var failedNum = page.evaluate(function(){
54 | var el = document.getElementById('qunit-testresult')
55 | try {
56 | return el.getElementsByClassName('failed')[0].innerHTML
57 | } catch (e) { }
58 | return 10000
59 | });
60 | phantom.exit((parseInt(failedNum, 10) > 0) ? 1 : 0)
61 | })
62 | }
63 | })
--------------------------------------------------------------------------------
/assets/less/modals.less:
--------------------------------------------------------------------------------
1 | // MODALS
2 | // ------
3 |
4 | // Recalculate z-index where appropriate
5 | .modal-open {
6 | .dropdown-menu { z-index: @zindexDropdown + @zindexModal; }
7 | .dropdown.open { *z-index: @zindexDropdown + @zindexModal; }
8 | .popover { z-index: @zindexPopover + @zindexModal; }
9 | .tooltip { z-index: @zindexTooltip + @zindexModal; }
10 | }
11 |
12 | // Background
13 | .modal-backdrop {
14 | position: fixed;
15 | top: 0;
16 | right: 0;
17 | bottom: 0;
18 | left: 0;
19 | z-index: @zindexModalBackdrop;
20 | background-color: @black;
21 | // Fade for backdrop
22 | &.fade { opacity: 0; }
23 | }
24 |
25 | .modal-backdrop,
26 | .modal-backdrop.fade.in {
27 | .opacity(80);
28 | }
29 |
30 | // Base modal
31 | .modal {
32 | position: fixed;
33 | top: 50%;
34 | left: 50%;
35 | z-index: @zindexModal;
36 | overflow: auto;
37 | width: 560px;
38 | margin: -250px 0 0 -280px;
39 | background-color: @white;
40 | border: 1px solid #999;
41 | border: 1px solid rgba(0,0,0,.3);
42 | *border: 1px solid #999; /* IE6-7 */
43 | .border-radius(6px);
44 | .box-shadow(0 3px 7px rgba(0,0,0,0.3));
45 | .background-clip(padding-box);
46 | &.fade {
47 | .transition(e('opacity .3s linear, top .3s ease-out'));
48 | top: -25%;
49 | }
50 | &.fade.in { top: 50%; }
51 | }
52 | .modal-header {
53 | padding: 9px 15px;
54 | border-bottom: 1px solid #eee;
55 | // Close icon
56 | .close { margin-top: 2px; }
57 | }
58 |
59 | // Body (where all modal content resides)
60 | .modal-body {
61 | overflow-y: auto;
62 | max-height: 400px;
63 | padding: 15px;
64 | }
65 | // Remove bottom margin if need be
66 | .modal-form {
67 | margin-bottom: 0;
68 | }
69 |
70 | // Footer (for actions)
71 | .modal-footer {
72 | padding: 14px 15px 15px;
73 | margin-bottom: 0;
74 | text-align: right; // right align buttons
75 | background-color: #f5f5f5;
76 | border-top: 1px solid #ddd;
77 | .border-radius(0 0 6px 6px);
78 | .box-shadow(inset 0 1px 0 @white);
79 | .clearfix(); // clear it in case folks use .pull-* classes on buttons
80 |
81 | // Properly space out buttons
82 | .btn + .btn {
83 | margin-left: 5px;
84 | margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
85 | }
86 | // but override that for button groups
87 | .btn-group .btn + .btn {
88 | margin-left: -1px;
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/assets/less/carousel.less:
--------------------------------------------------------------------------------
1 | // CAROUSEL
2 | // --------
3 |
4 | .carousel {
5 | position: relative;
6 | margin-bottom: @baseLineHeight;
7 | line-height: 1;
8 | }
9 |
10 | .carousel-inner {
11 | overflow: hidden;
12 | width: 100%;
13 | position: relative;
14 | }
15 |
16 | .carousel {
17 |
18 | .item {
19 | display: none;
20 | position: relative;
21 | .transition(.6s ease-in-out left);
22 | }
23 |
24 | // Account for jankitude on images
25 | .item > img {
26 | display: block;
27 | line-height: 1;
28 | }
29 |
30 | .active,
31 | .next,
32 | .prev { display: block; }
33 |
34 | .active {
35 | left: 0;
36 | }
37 |
38 | .next,
39 | .prev {
40 | position: absolute;
41 | top: 0;
42 | width: 100%;
43 | }
44 |
45 | .next {
46 | left: 100%;
47 | }
48 | .prev {
49 | left: -100%;
50 | }
51 | .next.left,
52 | .prev.right {
53 | left: 0;
54 | }
55 |
56 | .active.left {
57 | left: -100%;
58 | }
59 | .active.right {
60 | left: 100%;
61 | }
62 |
63 | }
64 |
65 | // Left/right controls for nav
66 | // ---------------------------
67 |
68 | .carousel-control {
69 | position: absolute;
70 | top: 40%;
71 | left: 15px;
72 | width: 40px;
73 | height: 40px;
74 | margin-top: -20px;
75 | font-size: 60px;
76 | font-weight: 100;
77 | line-height: 30px;
78 | color: @white;
79 | text-align: center;
80 | background: @grayDarker;
81 | border: 3px solid @white;
82 | .border-radius(23px);
83 | .opacity(50);
84 |
85 | // we can't have this transition here
86 | // because webkit cancels the carousel
87 | // animation if you trip this while
88 | // in the middle of another animation
89 | // ;_;
90 | // .transition(opacity .2s linear);
91 |
92 | // Reposition the right one
93 | &.right {
94 | left: auto;
95 | right: 15px;
96 | }
97 |
98 | // Hover state
99 | &:hover {
100 | color: @white;
101 | text-decoration: none;
102 | .opacity(90);
103 | }
104 | }
105 |
106 | // Caption for text below images
107 | // -----------------------------
108 |
109 | .carousel-caption {
110 | position: absolute;
111 | left: 0;
112 | right: 0;
113 | bottom: 0;
114 | padding: 10px 15px 5px;
115 | background: @grayDark;
116 | background: rgba(0,0,0,.75);
117 | }
118 | .carousel-caption h4,
119 | .carousel-caption p {
120 | color: @white;
121 | }
122 |
--------------------------------------------------------------------------------
/assets/js/bootstrap-alert.js:
--------------------------------------------------------------------------------
1 | /* ==========================================================
2 | * bootstrap-alert.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#alerts
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* ALERT CLASS DEFINITION
27 | * ====================== */
28 |
29 | var dismiss = '[data-dismiss="alert"]'
30 | , Alert = function (el) {
31 | $(el).on('click', dismiss, this.close)
32 | }
33 |
34 | Alert.prototype.close = function (e) {
35 | var $this = $(this)
36 | , selector = $this.attr('data-target')
37 | , $parent
38 |
39 | if (!selector) {
40 | selector = $this.attr('href')
41 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
42 | }
43 |
44 | $parent = $(selector)
45 |
46 | e && e.preventDefault()
47 |
48 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
49 |
50 | $parent.trigger(e = $.Event('close'))
51 |
52 | if (e.isDefaultPrevented()) return
53 |
54 | $parent.removeClass('in')
55 |
56 | function removeElement() {
57 | $parent
58 | .trigger('closed')
59 | .remove()
60 | }
61 |
62 | $.support.transition && $parent.hasClass('fade') ?
63 | $parent.on($.support.transition.end, removeElement) :
64 | removeElement()
65 | }
66 |
67 |
68 | /* ALERT PLUGIN DEFINITION
69 | * ======================= */
70 |
71 | $.fn.alert = function (option) {
72 | return this.each(function () {
73 | var $this = $(this)
74 | , data = $this.data('alert')
75 | if (!data) $this.data('alert', (data = new Alert(this)))
76 | if (typeof option == 'string') data[option].call($this)
77 | })
78 | }
79 |
80 | $.fn.alert.Constructor = Alert
81 |
82 |
83 | /* ALERT DATA-API
84 | * ============== */
85 |
86 | $(function () {
87 | $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
88 | })
89 |
90 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/docs/assets/js/bootstrap-alert.js:
--------------------------------------------------------------------------------
1 | /* ==========================================================
2 | * bootstrap-alert.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#alerts
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* ALERT CLASS DEFINITION
27 | * ====================== */
28 |
29 | var dismiss = '[data-dismiss="alert"]'
30 | , Alert = function (el) {
31 | $(el).on('click', dismiss, this.close)
32 | }
33 |
34 | Alert.prototype.close = function (e) {
35 | var $this = $(this)
36 | , selector = $this.attr('data-target')
37 | , $parent
38 |
39 | if (!selector) {
40 | selector = $this.attr('href')
41 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
42 | }
43 |
44 | $parent = $(selector)
45 |
46 | e && e.preventDefault()
47 |
48 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
49 |
50 | $parent.trigger(e = $.Event('close'))
51 |
52 | if (e.isDefaultPrevented()) return
53 |
54 | $parent.removeClass('in')
55 |
56 | function removeElement() {
57 | $parent
58 | .trigger('closed')
59 | .remove()
60 | }
61 |
62 | $.support.transition && $parent.hasClass('fade') ?
63 | $parent.on($.support.transition.end, removeElement) :
64 | removeElement()
65 | }
66 |
67 |
68 | /* ALERT PLUGIN DEFINITION
69 | * ======================= */
70 |
71 | $.fn.alert = function (option) {
72 | return this.each(function () {
73 | var $this = $(this)
74 | , data = $this.data('alert')
75 | if (!data) $this.data('alert', (data = new Alert(this)))
76 | if (typeof option == 'string') data[option].call($this)
77 | })
78 | }
79 |
80 | $.fn.alert.Constructor = Alert
81 |
82 |
83 | /* ALERT DATA-API
84 | * ============== */
85 |
86 | $(function () {
87 | $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
88 | })
89 |
90 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/less/progress-bars.less:
--------------------------------------------------------------------------------
1 | // PROGRESS BARS
2 | // -------------
3 |
4 |
5 | // ANIMATIONS
6 | // ----------
7 |
8 | // Webkit
9 | @-webkit-keyframes progress-bar-stripes {
10 | from { background-position: 40px 0; }
11 | to { background-position: 0 0; }
12 | }
13 |
14 | // Firefox
15 | @-moz-keyframes progress-bar-stripes {
16 | from { background-position: 40px 0; }
17 | to { background-position: 0 0; }
18 | }
19 |
20 | // IE9
21 | @-ms-keyframes progress-bar-stripes {
22 | from { background-position: 40px 0; }
23 | to { background-position: 0 0; }
24 | }
25 |
26 | // Opera
27 | @-o-keyframes progress-bar-stripes {
28 | from { background-position: 0 0; }
29 | to { background-position: 40px 0; }
30 | }
31 |
32 | // Spec
33 | @keyframes progress-bar-stripes {
34 | from { background-position: 40px 0; }
35 | to { background-position: 0 0; }
36 | }
37 |
38 |
39 |
40 | // THE BARS
41 | // --------
42 |
43 | // Outer container
44 | .progress {
45 | overflow: hidden;
46 | height: 18px;
47 | margin-bottom: 18px;
48 | #gradient > .vertical(#f5f5f5, #f9f9f9);
49 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1));
50 | .border-radius(4px);
51 | }
52 |
53 | // Bar of progress
54 | .progress .bar {
55 | width: 0%;
56 | height: 18px;
57 | color: @white;
58 | font-size: 12px;
59 | text-align: center;
60 | text-shadow: 0 -1px 0 rgba(0,0,0,.25);
61 | #gradient > .vertical(#149bdf, #0480be);
62 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));
63 | .box-sizing(border-box);
64 | .transition(width .6s ease);
65 | }
66 |
67 | // Striped bars
68 | .progress-striped .bar {
69 | #gradient > .striped(#149bdf);
70 | .background-size(40px 40px);
71 | }
72 |
73 | // Call animation for the active one
74 | .progress.active .bar {
75 | -webkit-animation: progress-bar-stripes 2s linear infinite;
76 | -moz-animation: progress-bar-stripes 2s linear infinite;
77 | -ms-animation: progress-bar-stripes 2s linear infinite;
78 | -o-animation: progress-bar-stripes 2s linear infinite;
79 | animation: progress-bar-stripes 2s linear infinite;
80 | }
81 |
82 |
83 |
84 | // COLORS
85 | // ------
86 |
87 | // Danger (red)
88 | .progress-danger .bar {
89 | #gradient > .vertical(#ee5f5b, #c43c35);
90 | }
91 | .progress-danger.progress-striped .bar {
92 | #gradient > .striped(#ee5f5b);
93 | }
94 |
95 | // Success (green)
96 | .progress-success .bar {
97 | #gradient > .vertical(#62c462, #57a957);
98 | }
99 | .progress-success.progress-striped .bar {
100 | #gradient > .striped(#62c462);
101 | }
102 |
103 | // Info (teal)
104 | .progress-info .bar {
105 | #gradient > .vertical(#5bc0de, #339bb9);
106 | }
107 | .progress-info.progress-striped .bar {
108 | #gradient > .striped(#5bc0de);
109 | }
110 |
111 | // Warning (orange)
112 | .progress-warning .bar {
113 | #gradient > .vertical(lighten(@orange, 15%), @orange);
114 | }
115 | .progress-warning.progress-striped .bar {
116 | #gradient > .striped(lighten(@orange, 15%));
117 | }
118 |
--------------------------------------------------------------------------------
/assets/js/bootstrap-button.js:
--------------------------------------------------------------------------------
1 | /* ============================================================
2 | * bootstrap-button.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#buttons
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* BUTTON PUBLIC CLASS DEFINITION
27 | * ============================== */
28 |
29 | var Button = function (element, options) {
30 | this.$element = $(element)
31 | this.options = $.extend({}, $.fn.button.defaults, options)
32 | }
33 |
34 | Button.prototype.setState = function (state) {
35 | var d = 'disabled'
36 | , $el = this.$element
37 | , data = $el.data()
38 | , val = $el.is('input') ? 'val' : 'html'
39 |
40 | state = state + 'Text'
41 | data.resetText || $el.data('resetText', $el[val]())
42 |
43 | $el[val](data[state] || this.options[state])
44 |
45 | // push to event loop to allow forms to submit
46 | setTimeout(function () {
47 | state == 'loadingText' ?
48 | $el.addClass(d).attr(d, d) :
49 | $el.removeClass(d).removeAttr(d)
50 | }, 0)
51 | }
52 |
53 | Button.prototype.toggle = function () {
54 | var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
55 |
56 | $parent && $parent
57 | .find('.active')
58 | .removeClass('active')
59 |
60 | this.$element.toggleClass('active')
61 | }
62 |
63 |
64 | /* BUTTON PLUGIN DEFINITION
65 | * ======================== */
66 |
67 | $.fn.button = function (option) {
68 | return this.each(function () {
69 | var $this = $(this)
70 | , data = $this.data('button')
71 | , options = typeof option == 'object' && option
72 | if (!data) $this.data('button', (data = new Button(this, options)))
73 | if (option == 'toggle') data.toggle()
74 | else if (option) data.setState(option)
75 | })
76 | }
77 |
78 | $.fn.button.defaults = {
79 | loadingText: 'loading...'
80 | }
81 |
82 | $.fn.button.Constructor = Button
83 |
84 |
85 | /* BUTTON DATA-API
86 | * =============== */
87 |
88 | $(function () {
89 | $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
90 | var $btn = $(e.target)
91 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
92 | $btn.button('toggle')
93 | })
94 | })
95 |
96 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/docs/assets/js/bootstrap-button.js:
--------------------------------------------------------------------------------
1 | /* ============================================================
2 | * bootstrap-button.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#buttons
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* BUTTON PUBLIC CLASS DEFINITION
27 | * ============================== */
28 |
29 | var Button = function (element, options) {
30 | this.$element = $(element)
31 | this.options = $.extend({}, $.fn.button.defaults, options)
32 | }
33 |
34 | Button.prototype.setState = function (state) {
35 | var d = 'disabled'
36 | , $el = this.$element
37 | , data = $el.data()
38 | , val = $el.is('input') ? 'val' : 'html'
39 |
40 | state = state + 'Text'
41 | data.resetText || $el.data('resetText', $el[val]())
42 |
43 | $el[val](data[state] || this.options[state])
44 |
45 | // push to event loop to allow forms to submit
46 | setTimeout(function () {
47 | state == 'loadingText' ?
48 | $el.addClass(d).attr(d, d) :
49 | $el.removeClass(d).removeAttr(d)
50 | }, 0)
51 | }
52 |
53 | Button.prototype.toggle = function () {
54 | var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
55 |
56 | $parent && $parent
57 | .find('.active')
58 | .removeClass('active')
59 |
60 | this.$element.toggleClass('active')
61 | }
62 |
63 |
64 | /* BUTTON PLUGIN DEFINITION
65 | * ======================== */
66 |
67 | $.fn.button = function (option) {
68 | return this.each(function () {
69 | var $this = $(this)
70 | , data = $this.data('button')
71 | , options = typeof option == 'object' && option
72 | if (!data) $this.data('button', (data = new Button(this, options)))
73 | if (option == 'toggle') data.toggle()
74 | else if (option) data.setState(option)
75 | })
76 | }
77 |
78 | $.fn.button.defaults = {
79 | loadingText: 'loading...'
80 | }
81 |
82 | $.fn.button.Constructor = Button
83 |
84 |
85 | /* BUTTON DATA-API
86 | * =============== */
87 |
88 | $(function () {
89 | $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
90 | var $btn = $(e.target)
91 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
92 | $btn.button('toggle')
93 | })
94 | })
95 |
96 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/js/tests/unit/bootstrap-button.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | module("bootstrap-buttons")
4 |
5 | test("should be defined on jquery object", function () {
6 | ok($(document.body).button, 'button method is defined')
7 | })
8 |
9 | test("should return element", function () {
10 | ok($(document.body).button()[0] == document.body, 'document.body returned')
11 | })
12 |
13 | test("should return set state to loading", function () {
14 | var btn = $('')
15 | equals(btn.html(), 'mdo', 'btn text equals mdo')
16 | btn.button('loading')
17 | equals(btn.html(), 'fat', 'btn text equals fat')
18 | stop()
19 | setTimeout(function () {
20 | ok(btn.attr('disabled'), 'btn is disabled')
21 | ok(btn.hasClass('disabled'), 'btn has disabled class')
22 | start()
23 | }, 0)
24 | })
25 |
26 | test("should return reset state", function () {
27 | var btn = $('')
28 | equals(btn.html(), 'mdo', 'btn text equals mdo')
29 | btn.button('loading')
30 | equals(btn.html(), 'fat', 'btn text equals fat')
31 | stop()
32 | setTimeout(function () {
33 | ok(btn.attr('disabled'), 'btn is disabled')
34 | ok(btn.hasClass('disabled'), 'btn has disabled class')
35 | start()
36 | stop()
37 | }, 0)
38 | btn.button('reset')
39 | equals(btn.html(), 'mdo', 'btn text equals mdo')
40 | setTimeout(function () {
41 | ok(!btn.attr('disabled'), 'btn is not disabled')
42 | ok(!btn.hasClass('disabled'), 'btn does not have disabled class')
43 | start()
44 | }, 0)
45 | })
46 |
47 | test("should toggle active", function () {
48 | var btn = $('')
49 | ok(!btn.hasClass('active'), 'btn does not have active class')
50 | btn.button('toggle')
51 | ok(btn.hasClass('active'), 'btn has class active')
52 | })
53 |
54 | test("should toggle active when btn children are clicked", function () {
55 | var btn = $('')
56 | , inner = $('')
57 | btn
58 | .append(inner)
59 | .appendTo($('#qunit-fixture'))
60 | ok(!btn.hasClass('active'), 'btn does not have active class')
61 | inner.click()
62 | ok(btn.hasClass('active'), 'btn has class active')
63 | })
64 |
65 | test("should toggle active when btn children are clicked within btn-group", function () {
66 | var btngroup = $('')
67 | , btn = $('')
68 | , inner = $('')
69 | btngroup
70 | .append(btn.append(inner))
71 | .appendTo($('#qunit-fixture'))
72 | ok(!btn.hasClass('active'), 'btn does not have active class')
73 | inner.click()
74 | ok(btn.hasClass('active'), 'btn has class active')
75 | })
76 |
77 | })
--------------------------------------------------------------------------------
/assets/js/bootstrap-dropdown.js:
--------------------------------------------------------------------------------
1 | /* ============================================================
2 | * bootstrap-dropdown.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* DROPDOWN CLASS DEFINITION
27 | * ========================= */
28 |
29 | var toggle = '[data-toggle="dropdown"]'
30 | , Dropdown = function (element) {
31 | var $el = $(element).on('click.dropdown.data-api', this.toggle)
32 | $('html').on('click.dropdown.data-api', function () {
33 | $el.parent().removeClass('open')
34 | })
35 | }
36 |
37 | Dropdown.prototype = {
38 |
39 | constructor: Dropdown
40 |
41 | , toggle: function (e) {
42 | var $this = $(this)
43 | , $parent
44 | , selector
45 | , isActive
46 |
47 | if ($this.is('.disabled, :disabled')) return
48 |
49 | selector = $this.attr('data-target')
50 |
51 | if (!selector) {
52 | selector = $this.attr('href')
53 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
54 | }
55 |
56 | $parent = $(selector)
57 | $parent.length || ($parent = $this.parent())
58 |
59 | isActive = $parent.hasClass('open')
60 |
61 | clearMenus()
62 |
63 | if (!isActive) $parent.toggleClass('open')
64 |
65 | return false
66 | }
67 |
68 | }
69 |
70 | function clearMenus() {
71 | $(toggle).parent().removeClass('open')
72 | }
73 |
74 |
75 | /* DROPDOWN PLUGIN DEFINITION
76 | * ========================== */
77 |
78 | $.fn.dropdown = function (option) {
79 | return this.each(function () {
80 | var $this = $(this)
81 | , data = $this.data('dropdown')
82 | if (!data) $this.data('dropdown', (data = new Dropdown(this)))
83 | if (typeof option == 'string') data[option].call($this)
84 | })
85 | }
86 |
87 | $.fn.dropdown.Constructor = Dropdown
88 |
89 |
90 | /* APPLY TO STANDARD DROPDOWN ELEMENTS
91 | * =================================== */
92 |
93 | $(function () {
94 | $('html').on('click.dropdown.data-api', clearMenus)
95 | $('body')
96 | .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
97 | .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
98 | })
99 |
100 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/docs/assets/js/bootstrap-dropdown.js:
--------------------------------------------------------------------------------
1 | /* ============================================================
2 | * bootstrap-dropdown.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* DROPDOWN CLASS DEFINITION
27 | * ========================= */
28 |
29 | var toggle = '[data-toggle="dropdown"]'
30 | , Dropdown = function (element) {
31 | var $el = $(element).on('click.dropdown.data-api', this.toggle)
32 | $('html').on('click.dropdown.data-api', function () {
33 | $el.parent().removeClass('open')
34 | })
35 | }
36 |
37 | Dropdown.prototype = {
38 |
39 | constructor: Dropdown
40 |
41 | , toggle: function (e) {
42 | var $this = $(this)
43 | , $parent
44 | , selector
45 | , isActive
46 |
47 | if ($this.is('.disabled, :disabled')) return
48 |
49 | selector = $this.attr('data-target')
50 |
51 | if (!selector) {
52 | selector = $this.attr('href')
53 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
54 | }
55 |
56 | $parent = $(selector)
57 | $parent.length || ($parent = $this.parent())
58 |
59 | isActive = $parent.hasClass('open')
60 |
61 | clearMenus()
62 |
63 | if (!isActive) $parent.toggleClass('open')
64 |
65 | return false
66 | }
67 |
68 | }
69 |
70 | function clearMenus() {
71 | $(toggle).parent().removeClass('open')
72 | }
73 |
74 |
75 | /* DROPDOWN PLUGIN DEFINITION
76 | * ========================== */
77 |
78 | $.fn.dropdown = function (option) {
79 | return this.each(function () {
80 | var $this = $(this)
81 | , data = $this.data('dropdown')
82 | if (!data) $this.data('dropdown', (data = new Dropdown(this)))
83 | if (typeof option == 'string') data[option].call($this)
84 | })
85 | }
86 |
87 | $.fn.dropdown.Constructor = Dropdown
88 |
89 |
90 | /* APPLY TO STANDARD DROPDOWN ELEMENTS
91 | * =================================== */
92 |
93 | $(function () {
94 | $('html').on('click.dropdown.data-api', clearMenus)
95 | $('body')
96 | .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
97 | .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
98 | })
99 |
100 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/js/bootstrap-popover.js:
--------------------------------------------------------------------------------
1 | /* ===========================================================
2 | * bootstrap-popover.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#popovers
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* POPOVER PUBLIC CLASS DEFINITION
27 | * =============================== */
28 |
29 | var Popover = function ( element, options ) {
30 | this.init('popover', element, options)
31 | }
32 |
33 |
34 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
35 | ========================================== */
36 |
37 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
38 |
39 | constructor: Popover
40 |
41 | , setContent: function () {
42 | var $tip = this.tip()
43 | , title = this.getTitle()
44 | , content = this.getContent()
45 |
46 | $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
47 | $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
48 |
49 | $tip.removeClass('fade top bottom left right in')
50 | }
51 |
52 | , hasContent: function () {
53 | return this.getTitle() || this.getContent()
54 | }
55 |
56 | , getContent: function () {
57 | var content
58 | , $e = this.$element
59 | , o = this.options
60 |
61 | content = $e.attr('data-content')
62 | || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
63 |
64 | return content
65 | }
66 |
67 | , tip: function () {
68 | if (!this.$tip) {
69 | this.$tip = $(this.options.template)
70 | }
71 | return this.$tip
72 | }
73 |
74 | })
75 |
76 |
77 | /* POPOVER PLUGIN DEFINITION
78 | * ======================= */
79 |
80 | $.fn.popover = function (option) {
81 | return this.each(function () {
82 | var $this = $(this)
83 | , data = $this.data('popover')
84 | , options = typeof option == 'object' && option
85 | if (!data) $this.data('popover', (data = new Popover(this, options)))
86 | if (typeof option == 'string') data[option]()
87 | })
88 | }
89 |
90 | $.fn.popover.Constructor = Popover
91 |
92 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
93 | placement: 'right'
94 | , content: ''
95 | , template: ''
96 | })
97 |
98 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/less/reset.less:
--------------------------------------------------------------------------------
1 | // Reset.less
2 | // Adapted from Normalize.css http://github.com/necolas/normalize.css
3 | // ------------------------------------------------------------------------
4 |
5 | // Display in IE6-9 and FF3
6 | // -------------------------
7 |
8 | article,
9 | aside,
10 | details,
11 | figcaption,
12 | figure,
13 | footer,
14 | header,
15 | hgroup,
16 | nav,
17 | section {
18 | display: block;
19 | }
20 |
21 | // Display block in IE6-9 and FF3
22 | // -------------------------
23 |
24 | audio,
25 | canvas,
26 | video {
27 | display: inline-block;
28 | *display: inline;
29 | *zoom: 1;
30 | }
31 |
32 | // Prevents modern browsers from displaying 'audio' without controls
33 | // -------------------------
34 |
35 | audio:not([controls]) {
36 | display: none;
37 | }
38 |
39 | // Base settings
40 | // -------------------------
41 |
42 | html {
43 | font-size: 100%;
44 | -webkit-text-size-adjust: 100%;
45 | -ms-text-size-adjust: 100%;
46 | }
47 | // Focus states
48 | a:focus {
49 | .tab-focus();
50 | }
51 | // Hover & Active
52 | a:hover,
53 | a:active {
54 | outline: 0;
55 | }
56 |
57 | // Prevents sub and sup affecting line-height in all browsers
58 | // -------------------------
59 |
60 | sub,
61 | sup {
62 | position: relative;
63 | font-size: 75%;
64 | line-height: 0;
65 | vertical-align: baseline;
66 | }
67 | sup {
68 | top: -0.5em;
69 | }
70 | sub {
71 | bottom: -0.25em;
72 | }
73 |
74 | // Img border in a's and image quality
75 | // -------------------------
76 |
77 | img {
78 | max-width: 100%; // Make images inherently responsive
79 | vertical-align: middle;
80 | border: 0;
81 | -ms-interpolation-mode: bicubic;
82 | }
83 |
84 | // Prevent max-width from affecting Google Maps
85 | #map_canvas img {
86 | max-width: none;
87 | }
88 |
89 | // Forms
90 | // -------------------------
91 |
92 | // Font size in all browsers, margin changes, misc consistency
93 | button,
94 | input,
95 | select,
96 | textarea {
97 | margin: 0;
98 | font-size: 100%;
99 | vertical-align: middle;
100 | }
101 | button,
102 | input {
103 | *overflow: visible; // Inner spacing ie IE6/7
104 | line-height: normal; // FF3/4 have !important on line-height in UA stylesheet
105 | }
106 | button::-moz-focus-inner,
107 | input::-moz-focus-inner { // Inner padding and border oddities in FF3/4
108 | padding: 0;
109 | border: 0;
110 | }
111 | button,
112 | input[type="button"],
113 | input[type="reset"],
114 | input[type="submit"] {
115 | cursor: pointer; // Cursors on all buttons applied consistently
116 | -webkit-appearance: button; // Style clickable inputs in iOS
117 | }
118 | input[type="search"] { // Appearance in Safari/Chrome
119 | -webkit-box-sizing: content-box;
120 | -moz-box-sizing: content-box;
121 | box-sizing: content-box;
122 | -webkit-appearance: textfield;
123 | }
124 | input[type="search"]::-webkit-search-decoration,
125 | input[type="search"]::-webkit-search-cancel-button {
126 | -webkit-appearance: none; // Inner-padding issues in Chrome OSX, Safari 5
127 | }
128 | textarea {
129 | overflow: auto; // Remove vertical scrollbar in IE6-9
130 | vertical-align: top; // Readability and alignment cross-browser
131 | }
132 |
--------------------------------------------------------------------------------
/views/layout.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Leadly
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
21 |
22 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
53 |
54 |
55 |
56 |
57 | <%= flash[:notice] %>
58 |
59 |
60 | <%= yield %>
61 |
62 |
63 |
64 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/assets/docs/assets/js/bootstrap-popover.js:
--------------------------------------------------------------------------------
1 | /* ===========================================================
2 | * bootstrap-popover.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#popovers
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* POPOVER PUBLIC CLASS DEFINITION
27 | * =============================== */
28 |
29 | var Popover = function ( element, options ) {
30 | this.init('popover', element, options)
31 | }
32 |
33 |
34 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
35 | ========================================== */
36 |
37 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
38 |
39 | constructor: Popover
40 |
41 | , setContent: function () {
42 | var $tip = this.tip()
43 | , title = this.getTitle()
44 | , content = this.getContent()
45 |
46 | $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
47 | $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
48 |
49 | $tip.removeClass('fade top bottom left right in')
50 | }
51 |
52 | , hasContent: function () {
53 | return this.getTitle() || this.getContent()
54 | }
55 |
56 | , getContent: function () {
57 | var content
58 | , $e = this.$element
59 | , o = this.options
60 |
61 | content = $e.attr('data-content')
62 | || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
63 |
64 | return content
65 | }
66 |
67 | , tip: function () {
68 | if (!this.$tip) {
69 | this.$tip = $(this.options.template)
70 | }
71 | return this.$tip
72 | }
73 |
74 | })
75 |
76 |
77 | /* POPOVER PLUGIN DEFINITION
78 | * ======================= */
79 |
80 | $.fn.popover = function (option) {
81 | return this.each(function () {
82 | var $this = $(this)
83 | , data = $this.data('popover')
84 | , options = typeof option == 'object' && option
85 | if (!data) $this.data('popover', (data = new Popover(this, options)))
86 | if (typeof option == 'string') data[option]()
87 | })
88 | }
89 |
90 | $.fn.popover.Constructor = Popover
91 |
92 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
93 | placement: 'right'
94 | , content: ''
95 | , template: ''
96 | })
97 |
98 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/css/pygments.css:
--------------------------------------------------------------------------------
1 | .hll { background-color: #ffffcc }
2 | .c { color: #408080; font-style: italic } /* Comment */
3 | .err { border: 1px solid #FF0000 } /* Error */
4 | .k { color: #008000; font-weight: bold } /* Keyword */
5 | .o { color: #666666 } /* Operator */
6 | .cm { color: #408080; font-style: italic } /* Comment.Multiline */
7 | .cp { color: #BC7A00 } /* Comment.Preproc */
8 | .c1 { color: #408080; font-style: italic } /* Comment.Single */
9 | .cs { color: #408080; font-style: italic } /* Comment.Special */
10 | .gd { color: #A00000 } /* Generic.Deleted */
11 | .ge { font-style: italic } /* Generic.Emph */
12 | .gr { color: #FF0000 } /* Generic.Error */
13 | .gh { color: #000080; font-weight: bold } /* Generic.Heading */
14 | .gi { color: #00A000 } /* Generic.Inserted */
15 | .go { color: #808080 } /* Generic.Output */
16 | .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
17 | .gs { font-weight: bold } /* Generic.Strong */
18 | .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
19 | .gt { color: #0040D0 } /* Generic.Traceback */
20 | .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
21 | .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
22 | .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
23 | .kp { color: #008000 } /* Keyword.Pseudo */
24 | .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
25 | .kt { color: #B00040 } /* Keyword.Type */
26 | .m { color: #666666 } /* Literal.Number */
27 | .s { color: #BA2121 } /* Literal.String */
28 | .na { color: #7D9029 } /* Name.Attribute */
29 | .nb { color: #008000 } /* Name.Builtin */
30 | .nc { color: #0000FF; font-weight: bold } /* Name.Class */
31 | .no { color: #880000 } /* Name.Constant */
32 | .nd { color: #AA22FF } /* Name.Decorator */
33 | .ni { color: #999999; font-weight: bold } /* Name.Entity */
34 | .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
35 | .nf { color: #0000FF } /* Name.Function */
36 | .nl { color: #A0A000 } /* Name.Label */
37 | .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
38 | .nt { color: #008000; font-weight: bold } /* Name.Tag */
39 | .nv { color: #19177C } /* Name.Variable */
40 | .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
41 | .w { color: #bbbbbb } /* Text.Whitespace */
42 | .mf { color: #666666 } /* Literal.Number.Float */
43 | .mh { color: #666666 } /* Literal.Number.Hex */
44 | .mi { color: #666666 } /* Literal.Number.Integer */
45 | .mo { color: #666666 } /* Literal.Number.Oct */
46 | .sb { color: #BA2121 } /* Literal.String.Backtick */
47 | .sc { color: #BA2121 } /* Literal.String.Char */
48 | .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
49 | .s2 { color: #BA2121 } /* Literal.String.Double */
50 | .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
51 | .sh { color: #BA2121 } /* Literal.String.Heredoc */
52 | .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
53 | .sx { color: #008000 } /* Literal.String.Other */
54 | .sr { color: #BB6688 } /* Literal.String.Regex */
55 | .s1 { color: #BA2121 } /* Literal.String.Single */
56 | .ss { color: #19177C } /* Literal.String.Symbol */
57 | .bp { color: #008000 } /* Name.Builtin.Pseudo */
58 | .vc { color: #19177C } /* Name.Variable.Class */
59 | .vg { color: #19177C } /* Name.Variable.Global */
60 | .vi { color: #19177C } /* Name.Variable.Instance */
61 | .il { color: #666666 } /* Literal.Number.Integer.Long */
62 |
--------------------------------------------------------------------------------
/assets/docs/examples/starter-template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Bootstrap, from Twitter
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
53 |
54 |
55 |
56 | Bootstrap starter template
57 | Use this document as a way to quick start any new project.
All you get is this message and a barebones HTML document.
58 |
59 |
60 |
61 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/assets/js/tests/unit/bootstrap-popover.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | module("bootstrap-popover")
4 |
5 | test("should be defined on jquery object", function () {
6 | var div = $('')
7 | ok(div.popover, 'popover method is defined')
8 | })
9 |
10 | test("should return element", function () {
11 | var div = $('')
12 | ok(div.popover() == div, 'document.body returned')
13 | })
14 |
15 | test("should render popover element", function () {
16 | $.support.transition = false
17 | var popover = $('@mdo')
18 | .appendTo('#qunit-fixture')
19 | .popover('show')
20 |
21 | ok($('.popover').length, 'popover was inserted')
22 | popover.popover('hide')
23 | ok(!$(".popover").length, 'popover removed')
24 | })
25 |
26 | test("should store popover instance in popover data object", function () {
27 | $.support.transition = false
28 | var popover = $('@mdo')
29 | .popover()
30 |
31 | ok(!!popover.data('popover'), 'popover instance exists')
32 | })
33 |
34 | test("should get title and content from options", function () {
35 | $.support.transition = false
36 | var popover = $('@fat')
37 | .appendTo('#qunit-fixture')
38 | .popover({
39 | title: function () {
40 | return '@fat'
41 | }
42 | , content: function () {
43 | return 'loves writing tests (╯°□°)╯︵ ┻━┻'
44 | }
45 | })
46 |
47 | popover.popover('show')
48 |
49 | ok($('.popover').length, 'popover was inserted')
50 | equals($('.popover .popover-title').text(), '@fat', 'title correctly inserted')
51 | equals($('.popover .popover-content').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted')
52 |
53 | popover.popover('hide')
54 | ok(!$('.popover').length, 'popover was removed')
55 | $('#qunit-fixture').empty()
56 | })
57 |
58 | test("should get title and content from attributes", function () {
59 | $.support.transition = false
60 | var popover = $('@mdo')
61 | .appendTo('#qunit-fixture')
62 | .popover()
63 | .popover('show')
64 |
65 | ok($('.popover').length, 'popover was inserted')
66 | equals($('.popover .popover-title').text(), '@mdo', 'title correctly inserted')
67 | equals($('.popover .popover-content').text(), "loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻", 'content correctly inserted')
68 |
69 | popover.popover('hide')
70 | ok(!$('.popover').length, 'popover was removed')
71 | $('#qunit-fixture').empty()
72 | })
73 |
74 | test("should respect custom classes", function() {
75 | $.support.transition = false
76 | var popover = $('@fat')
77 | .appendTo('#qunit-fixture')
78 | .popover({
79 | title: 'Test'
80 | , content: 'Test'
81 | , template: ''
82 | })
83 |
84 | popover.popover('show')
85 |
86 | ok($('.popover').length, 'popover was inserted')
87 | ok($('.popover').hasClass('foobar'), 'custom class is present')
88 |
89 | popover.popover('hide')
90 | ok(!$('.popover').length, 'popover was removed')
91 | $('#qunit-fixture').empty()
92 | })
93 | })
--------------------------------------------------------------------------------
/assets/docs/assets/js/README.md:
--------------------------------------------------------------------------------
1 | ## 2.0 BOOTSTRAP JS PHILOSOPHY
2 | These are the high-level design rules which guide the development of Bootstrap's plugin apis.
3 |
4 | ---
5 |
6 | ### DATA-ATTRIBUTE API
7 |
8 | We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript.
9 |
10 | We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this:
11 |
12 | $('body').off('.data-api')
13 |
14 | To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this:
15 |
16 | $('body').off('.alert.data-api')
17 |
18 | ---
19 |
20 | ### PROGRAMATIC API
21 |
22 | We also believe you should be able to use all plugins provided by Bootstrap purely through the JS API.
23 |
24 | All public APIs should be single, chainable methods, and return the collection acted upon.
25 |
26 | $(".btn.danger").button("toggle").addClass("fat")
27 |
28 | All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior:
29 |
30 | $("#myModal").modal() // initialized with defaults
31 | $("#myModal").modal({ keyboard: false }) // initialized with now keyboard
32 | $("#myModal").modal('show') // initializes and invokes show immediately afterqwe2
33 |
34 | ---
35 |
36 | ### OPTIONS
37 |
38 | Options should be sparse and add universal value. We should pick the right defaults.
39 |
40 | All plugins should have a default object which can be modified to effect all instance's default options. The defaults object should be available via `$.fn.plugin.defaults`.
41 |
42 | $.fn.modal.defaults = { … }
43 |
44 | An options definition should take the following form:
45 |
46 | *noun*: *adjective* - describes or modifies a quality of an instance
47 |
48 | examples:
49 |
50 | backdrop: true
51 | keyboard: false
52 | placement: 'top'
53 |
54 | ---
55 |
56 | ### EVENTS
57 |
58 | All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action.
59 |
60 | show | shown
61 | hide | hidden
62 |
63 | ---
64 |
65 | ### CONSTRUCTORS
66 |
67 | Each plugin should expose it's raw constructor on a `Constructor` property -- accessed in the following way:
68 |
69 |
70 | $.fn.popover.Constructor
71 |
72 | ---
73 |
74 | ### DATA ACCESSOR
75 |
76 | Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this:
77 |
78 | $('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor
79 |
80 | ---
81 |
82 | ### DATA ATTRIBUTES
83 |
84 | Data attributes should take the following form:
85 |
86 | - data-{{verb}}={{plugin}} - defines main interaction
87 | - data-target || href^=# - defined on "control" element (if element controls an element other than self)
88 | - data-{{noun}} - defines class instance options
89 |
90 | examples:
91 |
92 | // control other targets
93 | data-toggle="modal" data-target="#foo"
94 | data-toggle="collapse" data-target="#foo" data-parent="#bar"
95 |
96 | // defined on element they control
97 | data-spy="scroll"
98 |
99 | data-dismiss="modal"
100 | data-dismiss="alert"
101 |
102 | data-toggle="dropdown"
103 |
104 | data-toggle="button"
105 | data-toggle="buttons-checkbox"
106 | data-toggle="buttons-radio"
--------------------------------------------------------------------------------
/assets/less/responsive-767px-max.less:
--------------------------------------------------------------------------------
1 | // UP TO LANDSCAPE PHONE
2 | // ---------------------
3 |
4 | @media (max-width: 480px) {
5 |
6 | // Smooth out the collapsing/expanding nav
7 | .nav-collapse {
8 | -webkit-transform: translate3d(0, 0, 0); // activate the GPU
9 | }
10 |
11 | // Block level the page header small tag for readability
12 | .page-header h1 small {
13 | display: block;
14 | line-height: @baseLineHeight;
15 | }
16 |
17 | // Update checkboxes for iOS
18 | input[type="checkbox"],
19 | input[type="radio"] {
20 | border: 1px solid #ccc;
21 | }
22 |
23 | // Remove the horizontal form styles
24 | .form-horizontal .control-group > label {
25 | float: none;
26 | width: auto;
27 | padding-top: 0;
28 | text-align: left;
29 | }
30 | // Move over all input controls and content
31 | .form-horizontal .controls {
32 | margin-left: 0;
33 | }
34 | // Move the options list down to align with labels
35 | .form-horizontal .control-list {
36 | padding-top: 0; // has to be padding because margin collaspes
37 | }
38 | // Move over buttons in .form-actions to align with .controls
39 | .form-horizontal .form-actions {
40 | padding-left: 10px;
41 | padding-right: 10px;
42 | }
43 |
44 | // Modals
45 | .modal {
46 | position: absolute;
47 | top: 10px;
48 | left: 10px;
49 | right: 10px;
50 | width: auto;
51 | margin: 0;
52 | &.fade.in { top: auto; }
53 | }
54 | .modal-header .close {
55 | padding: 10px;
56 | margin: -10px;
57 | }
58 |
59 | // Carousel
60 | .carousel-caption {
61 | position: static;
62 | }
63 |
64 | }
65 |
66 |
67 |
68 | // LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET
69 | // --------------------------------------------------
70 |
71 | @media (max-width: 767px) {
72 |
73 | // Padding to set content in a bit
74 | body {
75 | padding-left: 20px;
76 | padding-right: 20px;
77 | }
78 | // Negative indent the now static "fixed" navbar
79 | .navbar-fixed-top,
80 | .navbar-fixed-bottom {
81 | margin-left: -20px;
82 | margin-right: -20px;
83 | }
84 | // Remove padding on container given explicit padding set on body
85 | .container-fluid {
86 | padding: 0;
87 | }
88 |
89 | // TYPOGRAPHY
90 | // ----------
91 | // Reset horizontal dl
92 | .dl-horizontal {
93 | dt {
94 | float: none;
95 | clear: none;
96 | width: auto;
97 | text-align: left;
98 | }
99 | dd {
100 | margin-left: 0;
101 | }
102 | }
103 |
104 | // GRID & CONTAINERS
105 | // -----------------
106 | // Remove width from containers
107 | .container {
108 | width: auto;
109 | }
110 | // Fluid rows
111 | .row-fluid {
112 | width: 100%;
113 | }
114 | // Undo negative margin on rows and thumbnails
115 | .row,
116 | .thumbnails {
117 | margin-left: 0;
118 | }
119 | // Make all grid-sized elements block level again
120 | [class*="span"],
121 | .row-fluid [class*="span"] {
122 | float: none;
123 | display: block;
124 | width: auto;
125 | margin-left: 0;
126 | }
127 |
128 | // FORM FIELDS
129 | // -----------
130 | // Make span* classes full width
131 | .input-large,
132 | .input-xlarge,
133 | .input-xxlarge,
134 | input[class*="span"],
135 | select[class*="span"],
136 | textarea[class*="span"],
137 | .uneditable-input {
138 | .input-block-level();
139 | }
140 | // But don't let it screw up prepend/append inputs
141 | .input-prepend input,
142 | .input-append input,
143 | .input-prepend input[class*="span"],
144 | .input-append input[class*="span"] {
145 | display: inline-block; // redeclare so they don't wrap to new lines
146 | width: auto;
147 | }
148 |
149 | }
150 |
--------------------------------------------------------------------------------
/assets/js/tests/unit/bootstrap-dropdown.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | module("bootstrap-dropdowns")
4 |
5 | test("should be defined on jquery object", function () {
6 | ok($(document.body).dropdown, 'dropdown method is defined')
7 | })
8 |
9 | test("should return element", function () {
10 | ok($(document.body).dropdown()[0] == document.body, 'document.body returned')
11 | })
12 |
13 | test("should not open dropdown if target is disabled", function () {
14 | var dropdownHTML = ''
15 | + '- '
16 | + ''
17 | + ''
23 | + '
'
24 | + '
'
25 | , dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
26 |
27 | ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
28 | })
29 |
30 | test("should not open dropdown if target is disabled", function () {
31 | var dropdownHTML = ''
32 | + '- '
33 | + ''
34 | + ''
40 | + '
'
41 | + '
'
42 | , dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
43 |
44 | ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
45 | })
46 |
47 | test("should add class open to menu if clicked", function () {
48 | var dropdownHTML = ''
49 | + '- '
50 | + 'Dropdown'
51 | + ''
57 | + '
'
58 | + '
'
59 | , dropdown = $(dropdownHTML).find('[data-toggle="dropdown"]').dropdown().click()
60 |
61 | ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
62 | })
63 |
64 | test("should remove open class if body clicked", function () {
65 | var dropdownHTML = ''
66 | + '- '
67 | + 'Dropdown'
68 | + ''
74 | + '
'
75 | + '
'
76 | , dropdown = $(dropdownHTML)
77 | .appendTo('#qunit-fixture')
78 | .find('[data-toggle="dropdown"]')
79 | .dropdown()
80 | .click()
81 | ok(dropdown.parent('.dropdown').hasClass('open'), 'open class added on click')
82 | $('body').click()
83 | ok(!dropdown.parent('.dropdown').hasClass('open'), 'open class removed')
84 | dropdown.remove()
85 | })
86 |
87 | })
--------------------------------------------------------------------------------
/assets/less/dropdowns.less:
--------------------------------------------------------------------------------
1 | // DROPDOWN MENUS
2 | // --------------
3 |
4 | // Use the .menu class on any element within the topbar or ul.tabs and you'll get some superfancy dropdowns
5 | .dropup,
6 | .dropdown {
7 | position: relative;
8 | }
9 | .dropdown-toggle {
10 | // The caret makes the toggle a bit too tall in IE7
11 | *margin-bottom: -3px;
12 | }
13 | .dropdown-toggle:active,
14 | .open .dropdown-toggle {
15 | outline: 0;
16 | }
17 |
18 | // Dropdown arrow/caret
19 | // --------------------
20 | .caret {
21 | display: inline-block;
22 | width: 0;
23 | height: 0;
24 | vertical-align: top;
25 | border-top: 4px solid @black;
26 | border-right: 4px solid transparent;
27 | border-left: 4px solid transparent;
28 | content: "";
29 | .opacity(30);
30 | }
31 |
32 | // Place the caret
33 | .dropdown .caret {
34 | margin-top: 8px;
35 | margin-left: 2px;
36 | }
37 | .dropdown:hover .caret,
38 | .open .caret {
39 | .opacity(100);
40 | }
41 |
42 | // The dropdown menu (ul)
43 | // ----------------------
44 | .dropdown-menu {
45 | position: absolute;
46 | top: 100%;
47 | left: 0;
48 | z-index: @zindexDropdown;
49 | display: none; // none by default, but block on "open" of the menu
50 | float: left;
51 | min-width: 160px;
52 | padding: 4px 0;
53 | margin: 1px 0 0; // override default ul
54 | list-style: none;
55 | background-color: @dropdownBackground;
56 | border: 1px solid #ccc;
57 | border: 1px solid rgba(0,0,0,.2);
58 | *border-right-width: 2px;
59 | *border-bottom-width: 2px;
60 | .border-radius(5px);
61 | .box-shadow(0 5px 10px rgba(0,0,0,.2));
62 | -webkit-background-clip: padding-box;
63 | -moz-background-clip: padding;
64 | background-clip: padding-box;
65 |
66 | // Aligns the dropdown menu to right
67 | &.pull-right {
68 | right: 0;
69 | left: auto;
70 | }
71 |
72 | // Dividers (basically an hr) within the dropdown
73 | .divider {
74 | .nav-divider(@dropdownDividerTop, @dropdownDividerBottom);
75 | }
76 |
77 | // Links within the dropdown menu
78 | a {
79 | display: block;
80 | padding: 3px 15px;
81 | clear: both;
82 | font-weight: normal;
83 | line-height: @baseLineHeight;
84 | color: @dropdownLinkColor;
85 | white-space: nowrap;
86 | }
87 | }
88 |
89 | // Hover state
90 | // -----------
91 | .dropdown-menu li > a:hover,
92 | .dropdown-menu .active > a,
93 | .dropdown-menu .active > a:hover {
94 | color: @dropdownLinkColorHover;
95 | text-decoration: none;
96 | background-color: @dropdownLinkBackgroundHover;
97 | }
98 |
99 | // Open state for the dropdown
100 | // ---------------------------
101 | .open {
102 | // IE7's z-index only goes to the nearest positioned ancestor, which would
103 | // make the menu appear below buttons that appeared later on the page
104 | *z-index: @zindexDropdown;
105 |
106 | & > .dropdown-menu {
107 | display: block;
108 | }
109 | }
110 |
111 | // Right aligned dropdowns
112 | // ---------------------------
113 | .pull-right > .dropdown-menu {
114 | right: 0;
115 | left: auto;
116 | }
117 |
118 | // Allow for dropdowns to go bottom up (aka, dropup-menu)
119 | // ------------------------------------------------------
120 | // Just add .dropup after the standard .dropdown class and you're set, bro.
121 | // TODO: abstract this so that the navbar fixed styles are not placed here?
122 | .dropup,
123 | .navbar-fixed-bottom .dropdown {
124 | // Reverse the caret
125 | .caret {
126 | border-top: 0;
127 | border-bottom: 4px solid @black;
128 | content: "\2191";
129 | }
130 | // Different positioning for bottom up menu
131 | .dropdown-menu {
132 | top: auto;
133 | bottom: 100%;
134 | margin-bottom: 1px;
135 | }
136 | }
137 |
138 | // Typeahead
139 | // ---------
140 | .typeahead {
141 | margin-top: 2px; // give it some space to breathe
142 | .border-radius(4px);
143 | }
144 |
--------------------------------------------------------------------------------
/assets/js/bootstrap-tab.js:
--------------------------------------------------------------------------------
1 | /* ========================================================
2 | * bootstrap-tab.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#tabs
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* TAB CLASS DEFINITION
27 | * ==================== */
28 |
29 | var Tab = function ( element ) {
30 | this.element = $(element)
31 | }
32 |
33 | Tab.prototype = {
34 |
35 | constructor: Tab
36 |
37 | , show: function () {
38 | var $this = this.element
39 | , $ul = $this.closest('ul:not(.dropdown-menu)')
40 | , selector = $this.attr('data-target')
41 | , previous
42 | , $target
43 | , e
44 |
45 | if (!selector) {
46 | selector = $this.attr('href')
47 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
48 | }
49 |
50 | if ( $this.parent('li').hasClass('active') ) return
51 |
52 | previous = $ul.find('.active a').last()[0]
53 |
54 | e = $.Event('show', {
55 | relatedTarget: previous
56 | })
57 |
58 | $this.trigger(e)
59 |
60 | if (e.isDefaultPrevented()) return
61 |
62 | $target = $(selector)
63 |
64 | this.activate($this.parent('li'), $ul)
65 | this.activate($target, $target.parent(), function () {
66 | $this.trigger({
67 | type: 'shown'
68 | , relatedTarget: previous
69 | })
70 | })
71 | }
72 |
73 | , activate: function ( element, container, callback) {
74 | var $active = container.find('> .active')
75 | , transition = callback
76 | && $.support.transition
77 | && $active.hasClass('fade')
78 |
79 | function next() {
80 | $active
81 | .removeClass('active')
82 | .find('> .dropdown-menu > .active')
83 | .removeClass('active')
84 |
85 | element.addClass('active')
86 |
87 | if (transition) {
88 | element[0].offsetWidth // reflow for transition
89 | element.addClass('in')
90 | } else {
91 | element.removeClass('fade')
92 | }
93 |
94 | if ( element.parent('.dropdown-menu') ) {
95 | element.closest('li.dropdown').addClass('active')
96 | }
97 |
98 | callback && callback()
99 | }
100 |
101 | transition ?
102 | $active.one($.support.transition.end, next) :
103 | next()
104 |
105 | $active.removeClass('in')
106 | }
107 | }
108 |
109 |
110 | /* TAB PLUGIN DEFINITION
111 | * ===================== */
112 |
113 | $.fn.tab = function ( option ) {
114 | return this.each(function () {
115 | var $this = $(this)
116 | , data = $this.data('tab')
117 | if (!data) $this.data('tab', (data = new Tab(this)))
118 | if (typeof option == 'string') data[option]()
119 | })
120 | }
121 |
122 | $.fn.tab.Constructor = Tab
123 |
124 |
125 | /* TAB DATA-API
126 | * ============ */
127 |
128 | $(function () {
129 | $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
130 | e.preventDefault()
131 | $(this).tab('show')
132 | })
133 | })
134 |
135 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/docs/assets/js/bootstrap-tab.js:
--------------------------------------------------------------------------------
1 | /* ========================================================
2 | * bootstrap-tab.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#tabs
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* TAB CLASS DEFINITION
27 | * ==================== */
28 |
29 | var Tab = function ( element ) {
30 | this.element = $(element)
31 | }
32 |
33 | Tab.prototype = {
34 |
35 | constructor: Tab
36 |
37 | , show: function () {
38 | var $this = this.element
39 | , $ul = $this.closest('ul:not(.dropdown-menu)')
40 | , selector = $this.attr('data-target')
41 | , previous
42 | , $target
43 | , e
44 |
45 | if (!selector) {
46 | selector = $this.attr('href')
47 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
48 | }
49 |
50 | if ( $this.parent('li').hasClass('active') ) return
51 |
52 | previous = $ul.find('.active a').last()[0]
53 |
54 | e = $.Event('show', {
55 | relatedTarget: previous
56 | })
57 |
58 | $this.trigger(e)
59 |
60 | if (e.isDefaultPrevented()) return
61 |
62 | $target = $(selector)
63 |
64 | this.activate($this.parent('li'), $ul)
65 | this.activate($target, $target.parent(), function () {
66 | $this.trigger({
67 | type: 'shown'
68 | , relatedTarget: previous
69 | })
70 | })
71 | }
72 |
73 | , activate: function ( element, container, callback) {
74 | var $active = container.find('> .active')
75 | , transition = callback
76 | && $.support.transition
77 | && $active.hasClass('fade')
78 |
79 | function next() {
80 | $active
81 | .removeClass('active')
82 | .find('> .dropdown-menu > .active')
83 | .removeClass('active')
84 |
85 | element.addClass('active')
86 |
87 | if (transition) {
88 | element[0].offsetWidth // reflow for transition
89 | element.addClass('in')
90 | } else {
91 | element.removeClass('fade')
92 | }
93 |
94 | if ( element.parent('.dropdown-menu') ) {
95 | element.closest('li.dropdown').addClass('active')
96 | }
97 |
98 | callback && callback()
99 | }
100 |
101 | transition ?
102 | $active.one($.support.transition.end, next) :
103 | next()
104 |
105 | $active.removeClass('in')
106 | }
107 | }
108 |
109 |
110 | /* TAB PLUGIN DEFINITION
111 | * ===================== */
112 |
113 | $.fn.tab = function ( option ) {
114 | return this.each(function () {
115 | var $this = $(this)
116 | , data = $this.data('tab')
117 | if (!data) $this.data('tab', (data = new Tab(this)))
118 | if (typeof option == 'string') data[option]()
119 | })
120 | }
121 |
122 | $.fn.tab.Constructor = Tab
123 |
124 |
125 | /* TAB DATA-API
126 | * ============ */
127 |
128 | $(function () {
129 | $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
130 | e.preventDefault()
131 | $(this).tab('show')
132 | })
133 | })
134 |
135 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/js/README.md:
--------------------------------------------------------------------------------
1 | ## 2.0 BOOTSTRAP JS PHILOSOPHY
2 | These are the high-level design rules which guide the development of Bootstrap's plugin apis.
3 |
4 | ---
5 |
6 | ### DATA-ATTRIBUTE API
7 |
8 | We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of JavaScript. This is Bootstrap's first class API.
9 |
10 | We acknowledge that this isn't always the most performant and it may sometimes be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this:
11 |
12 | $('body').off('.data-api')
13 |
14 | To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this:
15 |
16 | $('body').off('.alert.data-api')
17 |
18 | ---
19 |
20 | ### PROGRAMATIC API
21 |
22 | We also believe you should be able to use all plugins provided by Bootstrap purely through the JavaScript API.
23 |
24 | All public APIs should be single, chainable methods, and return the collection acted upon.
25 |
26 | $(".btn.danger").button("toggle").addClass("fat")
27 |
28 | All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior:
29 |
30 | $("#myModal").modal() // initialized with defaults
31 | $("#myModal").modal({ keyboard: false }) // initialized with no keyboard
32 | $("#myModal").modal('show') // initializes and invokes show immediately
33 |
34 | ---
35 |
36 | ### OPTIONS
37 |
38 | Options should be sparse and add universal value. We should pick the right defaults.
39 |
40 | All plugins should have a default object which can be modified to affect all instances' default options. The defaults object should be available via `$.fn.plugin.defaults`.
41 |
42 | $.fn.modal.defaults = { … }
43 |
44 | An options definition should take the following form:
45 |
46 | *noun*: *adjective* - describes or modifies a quality of an instance
47 |
48 | Examples:
49 |
50 | backdrop: true
51 | keyboard: false
52 | placement: 'top'
53 |
54 | ---
55 |
56 | ### EVENTS
57 |
58 | All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action.
59 |
60 | show | shown
61 | hide | hidden
62 |
63 | All infinitive events should provide preventDefault functionality. This provides the abililty to stop the execution of an action.
64 |
65 | $('#myModal').on('show', function (e) {
66 | if (!data) return e.preventDefault() // stops modal from being shown
67 | })
68 |
69 | ---
70 |
71 | ### CONSTRUCTORS
72 |
73 | Each plugin should expose its raw constructor on a `Constructor` property -- accessed in the following way:
74 |
75 |
76 | $.fn.popover.Constructor
77 |
78 | ---
79 |
80 | ### DATA ACCESSOR
81 |
82 | Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this:
83 |
84 | $('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor
85 |
86 | ---
87 |
88 | ### DATA ATTRIBUTES
89 |
90 | Data attributes should take the following form:
91 |
92 | - data-{{verb}}={{plugin}} - defines main interaction
93 | - data-target || href^=# - defined on "control" element (if element controls an element other than self)
94 | - data-{{noun}} - defines class instance options
95 |
96 | Examples:
97 |
98 | // control other targets
99 | data-toggle="modal" data-target="#foo"
100 | data-toggle="collapse" data-target="#foo" data-parent="#bar"
101 |
102 | // defined on element they control
103 | data-spy="scroll"
104 |
105 | data-dismiss="modal"
106 | data-dismiss="alert"
107 |
108 | data-toggle="dropdown"
109 |
110 | data-toggle="button"
111 | data-toggle="buttons-checkbox"
112 | data-toggle="buttons-radio"
--------------------------------------------------------------------------------
/assets/less/responsive-navbar.less:
--------------------------------------------------------------------------------
1 | // TABLETS AND BELOW
2 | // -----------------
3 | @media (max-width: 979px) {
4 |
5 | // UNFIX THE TOPBAR
6 | // ----------------
7 | // Remove any padding from the body
8 | body {
9 | padding-top: 0;
10 | }
11 | // Unfix the navbar
12 | .navbar-fixed-top,
13 | .navbar-fixed-bottom {
14 | position: static;
15 | }
16 | .navbar-fixed-top {
17 | margin-bottom: @baseLineHeight;
18 | }
19 | .navbar-fixed-bottom {
20 | margin-top: @baseLineHeight;
21 | }
22 | .navbar-fixed-top .navbar-inner,
23 | .navbar-fixed-bottom .navbar-inner {
24 | padding: 5px;
25 | }
26 | .navbar .container {
27 | width: auto;
28 | padding: 0;
29 | }
30 | // Account for brand name
31 | .navbar .brand {
32 | padding-left: 10px;
33 | padding-right: 10px;
34 | margin: 0 0 0 -5px;
35 | }
36 |
37 | // COLLAPSIBLE NAVBAR
38 | // ------------------
39 | // Nav collapse clears brand
40 | .nav-collapse {
41 | clear: both;
42 | }
43 | // Block-level the nav
44 | .nav-collapse .nav {
45 | float: none;
46 | margin: 0 0 (@baseLineHeight / 2);
47 | }
48 | .nav-collapse .nav > li {
49 | float: none;
50 | }
51 | .nav-collapse .nav > li > a {
52 | margin-bottom: 2px;
53 | }
54 | .nav-collapse .nav > .divider-vertical {
55 | display: none;
56 | }
57 | .nav-collapse .nav .nav-header {
58 | color: @navbarText;
59 | text-shadow: none;
60 | }
61 | // Nav and dropdown links in navbar
62 | .nav-collapse .nav > li > a,
63 | .nav-collapse .dropdown-menu a {
64 | padding: 6px 15px;
65 | font-weight: bold;
66 | color: @navbarLinkColor;
67 | .border-radius(3px);
68 | }
69 | // Buttons
70 | .nav-collapse .btn {
71 | padding: 4px 10px 4px;
72 | font-weight: normal;
73 | .border-radius(4px);
74 | }
75 | .nav-collapse .dropdown-menu li + li a {
76 | margin-bottom: 2px;
77 | }
78 | .nav-collapse .nav > li > a:hover,
79 | .nav-collapse .dropdown-menu a:hover {
80 | background-color: @navbarBackground;
81 | }
82 | // Buttons in the navbar
83 | .nav-collapse.in .btn-group {
84 | margin-top: 5px;
85 | padding: 0;
86 | }
87 | // Dropdowns in the navbar
88 | .nav-collapse .dropdown-menu {
89 | position: static;
90 | top: auto;
91 | left: auto;
92 | float: none;
93 | display: block;
94 | max-width: none;
95 | margin: 0 15px;
96 | padding: 0;
97 | background-color: transparent;
98 | border: none;
99 | .border-radius(0);
100 | .box-shadow(none);
101 | }
102 | .nav-collapse .dropdown-menu:before,
103 | .nav-collapse .dropdown-menu:after {
104 | display: none;
105 | }
106 | .nav-collapse .dropdown-menu .divider {
107 | display: none;
108 | }
109 | // Forms in navbar
110 | .nav-collapse .navbar-form,
111 | .nav-collapse .navbar-search {
112 | float: none;
113 | padding: (@baseLineHeight / 2) 15px;
114 | margin: (@baseLineHeight / 2) 0;
115 | border-top: 1px solid @navbarBackground;
116 | border-bottom: 1px solid @navbarBackground;
117 | .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1)");
118 | }
119 | // Pull right (secondary) nav content
120 | .navbar .nav-collapse .nav.pull-right {
121 | float: none;
122 | margin-left: 0;
123 | }
124 | // Hide everything in the navbar save .brand and toggle button */
125 | .nav-collapse,
126 | .nav-collapse.collapse {
127 | overflow: hidden;
128 | height: 0;
129 | }
130 | // Navbar button
131 | .navbar .btn-navbar {
132 | display: block;
133 | }
134 |
135 | // STATIC NAVBAR
136 | // -------------
137 | .navbar-static .navbar-inner {
138 | padding-left: 10px;
139 | padding-right: 10px;
140 | }
141 | }
142 |
143 |
144 | // DEFAULT DESKTOP
145 | // ---------------
146 |
147 | // Required to make the collapsing navbar work on regular desktops
148 | @media (min-width: 980px) {
149 | .nav-collapse.collapse {
150 | height: auto !important;
151 | overflow: visible !important;
152 | }
153 | }
--------------------------------------------------------------------------------
/assets/js/tests/unit/bootstrap-modal.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 |
3 | module("bootstrap-modal")
4 |
5 | test("should be defined on jquery object", function () {
6 | var div = $("")
7 | ok(div.modal, 'modal method is defined')
8 | })
9 |
10 | test("should return element", function () {
11 | var div = $("")
12 | ok(div.modal() == div, 'document.body returned')
13 | $('#modal-test').remove()
14 | })
15 |
16 | test("should expose defaults var for settings", function () {
17 | ok($.fn.modal.defaults, 'default object exposed')
18 | })
19 |
20 | test("should insert into dom when show method is called", function () {
21 | stop()
22 | $.support.transition = false
23 | $("")
24 | .bind("shown", function () {
25 | ok($('#modal-test').length, 'modal insterted into dom')
26 | $(this).remove()
27 | start()
28 | })
29 | .modal("show")
30 | })
31 |
32 | test("should fire show event", function () {
33 | stop()
34 | $.support.transition = false
35 | $("")
36 | .bind("show", function () {
37 | ok(true, "show was called")
38 | })
39 | .bind("shown", function () {
40 | $(this).remove()
41 | start()
42 | })
43 | .modal("show")
44 | })
45 |
46 | test("should not fire shown when default prevented", function () {
47 | stop()
48 | $.support.transition = false
49 | $("")
50 | .bind("show", function (e) {
51 | e.preventDefault()
52 | ok(true, "show was called")
53 | start()
54 | })
55 | .bind("shown", function () {
56 | ok(false, "shown was called")
57 | })
58 | .modal("show")
59 | })
60 |
61 | test("should hide modal when hide is called", function () {
62 | stop()
63 | $.support.transition = false
64 |
65 | $("")
66 | .bind("shown", function () {
67 | ok($('#modal-test').is(":visible"), 'modal visible')
68 | ok($('#modal-test').length, 'modal insterted into dom')
69 | $(this).modal("hide")
70 | })
71 | .bind("hidden", function() {
72 | ok(!$('#modal-test').is(":visible"), 'modal hidden')
73 | $('#modal-test').remove()
74 | start()
75 | })
76 | .modal("show")
77 | })
78 |
79 | test("should toggle when toggle is called", function () {
80 | stop()
81 | $.support.transition = false
82 | var div = $("")
83 | div
84 | .bind("shown", function () {
85 | ok($('#modal-test').is(":visible"), 'modal visible')
86 | ok($('#modal-test').length, 'modal insterted into dom')
87 | div.modal("toggle")
88 | })
89 | .bind("hidden", function() {
90 | ok(!$('#modal-test').is(":visible"), 'modal hidden')
91 | div.remove()
92 | start()
93 | })
94 | .modal("toggle")
95 | })
96 |
97 | test("should remove from dom when click [data-dismiss=modal]", function () {
98 | stop()
99 | $.support.transition = false
100 | var div = $("")
101 | div
102 | .bind("shown", function () {
103 | ok($('#modal-test').is(":visible"), 'modal visible')
104 | ok($('#modal-test').length, 'modal insterted into dom')
105 | div.find('.close').click()
106 | })
107 | .bind("hidden", function() {
108 | ok(!$('#modal-test').is(":visible"), 'modal hidden')
109 | div.remove()
110 | start()
111 | })
112 | .modal("toggle")
113 | })
114 | })
--------------------------------------------------------------------------------
/assets/Makefile:
--------------------------------------------------------------------------------
1 | BOOTSTRAP = ./docs/assets/css/bootstrap.css
2 | BOOTSTRAP_LESS = ./less/bootstrap.less
3 | BOOTSTRAP_RESPONSIVE = ./docs/assets/css/bootstrap-responsive.css
4 | BOOTSTRAP_RESPONSIVE_LESS = ./less/responsive.less
5 | DATE=$(shell date +%I:%M%p)
6 | CHECK=\033[32m✔\033[39m
7 | HR=\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#
8 |
9 |
10 | #
11 | # BUILD DOCS
12 | #
13 |
14 | build:
15 | @echo "\n${HR}"
16 | @echo "Building Bootstrap..."
17 | @echo "${HR}\n"
18 | @jshint js/*.js --config js/.jshintrc
19 | @jshint js/tests/unit/*.js --config js/.jshintrc
20 | @echo "Running JSHint on javascript... ${CHECK} Done"
21 | @recess --compile ${BOOTSTRAP_LESS} > ${BOOTSTRAP}
22 | @recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > ${BOOTSTRAP_RESPONSIVE}
23 | @echo "Compiling LESS with Recess... ${CHECK} Done"
24 | @node docs/build
25 | @cp img/* docs/assets/img/
26 | @cp js/*.js docs/assets/js/
27 | @cp js/tests/vendor/jquery.js docs/assets/js/
28 | @echo "Compiling documentation... ${CHECK} Done"
29 | @cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > docs/assets/js/bootstrap.js
30 | @uglifyjs -nc docs/assets/js/bootstrap.js > docs/assets/js/bootstrap.min.tmp.js
31 | @echo "/**\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js
32 | @cat docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js > docs/assets/js/bootstrap.min.js
33 | @rm docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js
34 | @echo "Compiling and minifying javascript... ${CHECK} Done"
35 | @echo "\n${HR}"
36 | @echo "Bootstrap successfully built at ${DATE}."
37 | @echo "${HR}\n"
38 | @echo "Thanks for using Bootstrap,"
39 | @echo "<3 @mdo and @fat\n"
40 |
41 | #
42 | # RUN JSHINT & QUNIT TESTS IN PHANTOMJS
43 | #
44 |
45 | test:
46 | jshint js/*.js --config js/.jshintrc
47 | jshint js/tests/unit/*.js --config js/.jshintrc
48 | node js/tests/server.js &
49 | phantomjs js/tests/phantom.js "http://localhost:3000/js/tests"
50 | kill -9 `cat js/tests/pid.txt`
51 | rm js/tests/pid.txt
52 |
53 | #
54 | # BUILD SIMPLE BOOTSTRAP DIRECTORY
55 | # recess & uglifyjs are required
56 | #
57 |
58 | bootstrap:
59 | mkdir -p bootstrap/img
60 | mkdir -p bootstrap/css
61 | mkdir -p bootstrap/js
62 | cp img/* bootstrap/img/
63 | recess --compile ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.css
64 | recess --compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
65 | recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css
66 | recess --compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css
67 | cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > bootstrap/js/bootstrap.js
68 | uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
69 | echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2012 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
70 | cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
71 | rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js
72 |
73 | #
74 | # MAKE FOR GH-PAGES 4 FAT & MDO ONLY (O_O )
75 | #
76 |
77 | gh-pages: bootstrap docs
78 | rm -f docs/assets/bootstrap.zip
79 | zip -r docs/assets/bootstrap.zip bootstrap
80 | rm -r bootstrap
81 | rm -f ../bootstrap-gh-pages/assets/bootstrap.zip
82 | node docs/build production
83 | cp -r docs/* ../bootstrap-gh-pages
84 |
85 | #
86 | # WATCH LESS FILES
87 | #
88 |
89 | watch:
90 | echo "Watching less files..."; \
91 | watchr -e "watch('less/.*\.less') { system 'make' }"
92 |
93 |
94 | .PHONY: docs watch gh-pages
--------------------------------------------------------------------------------
/assets/README.md:
--------------------------------------------------------------------------------
1 | [Twitter Bootstrap](http://twitter.github.com/bootstrap) [](http://travis-ci.org/twitter/bootstrap)
2 | =================
3 |
4 | Bootstrap provides simple and flexible HTML, CSS, and Javascript for popular user interface components and interactions. In other words, it's a front-end toolkit for faster, more beautiful web development. It's created and maintained by [Mark Otto](http://twitter.com/mdo) and [Jacob Thornton](http://twitter.com/fat) at Twitter.
5 |
6 | To get started, checkout http://twitter.github.com/bootstrap!
7 |
8 |
9 |
10 | Quick start
11 | -----------
12 |
13 | Clone the repo, `git clone git://github.com/twitter/bootstrap.git`, or [download the latest release](https://github.com/twitter/bootstrap/zipball/master).
14 |
15 |
16 |
17 | Versioning
18 | ----------
19 |
20 | For transparency and insight into our release cycle, and for striving to maintain backward compatibility, Bootstrap will be maintained under the Semantic Versioning guidelines as much as possible.
21 |
22 | Releases will be numbered with the follow format:
23 |
24 | `..`
25 |
26 | And constructed with the following guidelines:
27 |
28 | * Breaking backward compatibility bumps the major (and resets the minor and patch)
29 | * New additions without breaking backward compatibility bumps the minor (and resets the patch)
30 | * Bug fixes and misc changes bumps the patch
31 |
32 | For more information on SemVer, please visit http://semver.org/.
33 |
34 |
35 |
36 | Bug tracker
37 | -----------
38 |
39 | Have a bug? Please create an issue here on GitHub! Also, when filing please make sure you're familiar with [necolas's guidelines](https://github.com/necolas/issue-guidelines). thanks! <3
40 |
41 | https://github.com/twitter/bootstrap/issues
42 |
43 |
44 |
45 | Twitter account
46 | ---------------
47 |
48 | Keep up to date on announcements and more by following Bootstrap on Twitter, [@TwBootstrap](http://twitter.com/TwBootstrap).
49 |
50 |
51 |
52 | Blog
53 | ----
54 |
55 | Read more detailed announcements, discussions, and more on [The Official Twitter Bootstrap Blog](http://blog.getbootstrap.com).
56 |
57 |
58 |
59 | Mailing list
60 | ------------
61 |
62 | Have a question? Ask on our mailing list!
63 |
64 | twitter-bootstrap@googlegroups.com
65 |
66 | http://groups.google.com/group/twitter-bootstrap
67 |
68 |
69 |
70 | IRC
71 | ---
72 |
73 | Server: irc.freenode.net
74 |
75 | Channel: ##twitter-bootstrap (the double ## is not a typo)
76 |
77 |
78 |
79 | Developers
80 | ----------
81 |
82 | We have included a makefile with convenience methods for working with the Bootstrap library.
83 |
84 | + **dependencies**
85 | Our makefile depends on you having recess, uglify.js, and jshint installed. To install, just run the following command in npm:
86 |
87 | ```
88 | $ npm install recess uglify-js jshint -g
89 | ```
90 |
91 | + **build** - `make`
92 | Runs the recess compiler to rebuild the `/less` files and compiles the docs pages. Requires recess and uglify-js. Read more in our docs »
93 |
94 | + **test** - `make test`
95 | Runs jshint and qunit tests headlessly in phantom js (used for ci). Depends on having phatomjs installed.
96 |
97 | + **watch** - `make watch`
98 | This is a convenience method for watching just Less files and automatically building them whenever you save. Requires the Watchr gem.
99 |
100 |
101 | Contributing
102 | ------------
103 |
104 | Please make all pull requests against wip-* branches. Also, if your unit test contains javascript patches or features - you must include relevant unit tests. Thanks!
105 |
106 |
107 | Authors
108 | -------
109 |
110 | **Mark Otto**
111 |
112 | + http://twitter.com/mdo
113 | + http://github.com/markdotto
114 |
115 | **Jacob Thornton**
116 |
117 | + http://twitter.com/fat
118 | + http://github.com/fat
119 |
120 |
121 |
122 | Copyright and license
123 | ---------------------
124 |
125 | Copyright 2012 Twitter, Inc.
126 |
127 | Licensed under the Apache License, Version 2.0 (the "License");
128 | you may not use this work except in compliance with the License.
129 | You may obtain a copy of the License in the LICENSE file, or at:
130 |
131 | http://www.apache.org/licenses/LICENSE-2.0
132 |
133 | Unless required by applicable law or agreed to in writing, software
134 | distributed under the License is distributed on an "AS IS" BASIS,
135 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
136 | See the License for the specific language governing permissions and
137 | limitations under the License.
138 |
--------------------------------------------------------------------------------
/assets/less/type.less:
--------------------------------------------------------------------------------
1 | // Typography.less
2 | // Headings, body text, lists, code, and more for a versatile and durable typography system
3 | // ----------------------------------------------------------------------------------------
4 |
5 |
6 | // BODY TEXT
7 | // ---------
8 |
9 | p {
10 | margin: 0 0 @baseLineHeight / 2;
11 | small {
12 | font-size: @baseFontSize - 2;
13 | color: @grayLight;
14 | }
15 | }
16 | .lead {
17 | margin-bottom: @baseLineHeight;
18 | font-size: 20px;
19 | font-weight: 200;
20 | line-height: @baseLineHeight * 1.5;
21 | }
22 |
23 | // HEADINGS
24 | // --------
25 |
26 | h1, h2, h3, h4, h5, h6 {
27 | margin: 0;
28 | font-family: @headingsFontFamily;
29 | font-weight: @headingsFontWeight;
30 | color: @headingsColor;
31 | text-rendering: optimizelegibility; // Fix the character spacing for headings
32 | small {
33 | font-weight: normal;
34 | color: @grayLight;
35 | }
36 | }
37 | h1 {
38 | font-size: 30px;
39 | line-height: @baseLineHeight * 2;
40 | small {
41 | font-size: 18px;
42 | }
43 | }
44 | h2 {
45 | font-size: 24px;
46 | line-height: @baseLineHeight * 2;
47 | small {
48 | font-size: 18px;
49 | }
50 | }
51 | h3 {
52 | font-size: 18px;
53 | line-height: @baseLineHeight * 1.5;
54 | small {
55 | font-size: 14px;
56 | }
57 | }
58 | h4, h5, h6 {
59 | line-height: @baseLineHeight;
60 | }
61 | h4 {
62 | font-size: 14px;
63 | small {
64 | font-size: 12px;
65 | }
66 | }
67 | h5 {
68 | font-size: 12px;
69 | }
70 | h6 {
71 | font-size: 11px;
72 | color: @grayLight;
73 | text-transform: uppercase;
74 | }
75 |
76 | // Page header
77 | .page-header {
78 | padding-bottom: @baseLineHeight - 1;
79 | margin: @baseLineHeight 0;
80 | border-bottom: 1px solid @grayLighter;
81 | }
82 | .page-header h1 {
83 | line-height: 1;
84 | }
85 |
86 |
87 |
88 | // LISTS
89 | // -----
90 |
91 | // Unordered and Ordered lists
92 | ul, ol {
93 | padding: 0;
94 | margin: 0 0 @baseLineHeight / 2 25px;
95 | }
96 | ul ul,
97 | ul ol,
98 | ol ol,
99 | ol ul {
100 | margin-bottom: 0;
101 | }
102 | ul {
103 | list-style: disc;
104 | }
105 | ol {
106 | list-style: decimal;
107 | }
108 | li {
109 | line-height: @baseLineHeight;
110 | }
111 | ul.unstyled,
112 | ol.unstyled {
113 | margin-left: 0;
114 | list-style: none;
115 | }
116 |
117 | // Description Lists
118 | dl {
119 | margin-bottom: @baseLineHeight;
120 | }
121 | dt,
122 | dd {
123 | line-height: @baseLineHeight;
124 | }
125 | dt {
126 | font-weight: bold;
127 | line-height: @baseLineHeight - 1; // fix jank Helvetica Neue font bug
128 | }
129 | dd {
130 | margin-left: @baseLineHeight / 2;
131 | }
132 | // Horizontal layout (like forms)
133 | .dl-horizontal {
134 | dt {
135 | float: left;
136 | width: 120px;
137 | clear: left;
138 | text-align: right;
139 | .text-overflow();
140 | }
141 | dd {
142 | margin-left: 130px;
143 | }
144 | }
145 |
146 | // MISC
147 | // ----
148 |
149 | // Horizontal rules
150 | hr {
151 | margin: @baseLineHeight 0;
152 | border: 0;
153 | border-top: 1px solid @hrBorder;
154 | border-bottom: 1px solid @white;
155 | }
156 |
157 | // Emphasis
158 | strong {
159 | font-weight: bold;
160 | }
161 | em {
162 | font-style: italic;
163 | }
164 | .muted {
165 | color: @grayLight;
166 | }
167 |
168 | // Abbreviations and acronyms
169 | abbr[title] {
170 | cursor: help;
171 | border-bottom: 1px dotted @grayLight;
172 | }
173 | abbr.initialism {
174 | font-size: 90%;
175 | text-transform: uppercase;
176 | }
177 |
178 | // Blockquotes
179 | blockquote {
180 | padding: 0 0 0 15px;
181 | margin: 0 0 @baseLineHeight;
182 | border-left: 5px solid @grayLighter;
183 | p {
184 | margin-bottom: 0;
185 | #font > .shorthand(16px,300,@baseLineHeight * 1.25);
186 | }
187 | small {
188 | display: block;
189 | line-height: @baseLineHeight;
190 | color: @grayLight;
191 | &:before {
192 | content: '\2014 \00A0';
193 | }
194 | }
195 |
196 | // Float right with text-align: right
197 | &.pull-right {
198 | float: right;
199 | padding-right: 15px;
200 | padding-left: 0;
201 | border-right: 5px solid @grayLighter;
202 | border-left: 0;
203 | p,
204 | small {
205 | text-align: right;
206 | }
207 | }
208 | }
209 |
210 | // Quotes
211 | q:before,
212 | q:after,
213 | blockquote:before,
214 | blockquote:after {
215 | content: "";
216 | }
217 |
218 | // Addresses
219 | address {
220 | display: block;
221 | margin-bottom: @baseLineHeight;
222 | font-style: normal;
223 | line-height: @baseLineHeight;
224 | }
225 |
226 | // Misc
227 | small {
228 | font-size: 100%;
229 | }
230 | cite {
231 | font-style: normal;
232 | }
233 |
--------------------------------------------------------------------------------
/assets/less/tests/navbar.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Bootstrap, from Twitter
6 |
7 |
8 |
9 |
10 |
11 |
12 |
18 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
55 |
56 |
57 |
58 |
59 |
78 |
79 |
80 |
81 | Navbar example
82 | This example is a quick exercise to illustrate how the default, static navbar and fixed to top navbar work. It includes the responsive CSS and HTML, so it also adapts to your viewport and device.
83 |
84 | View navbar docs »
85 |
86 |
87 |
88 |
89 |
90 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/assets/less/tests/forms.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Bootstrap, from Twitter
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
19 |
20 |
21 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
177 |
178 |
179 |
180 |
--------------------------------------------------------------------------------
/assets/js/bootstrap-scrollspy.js:
--------------------------------------------------------------------------------
1 | /* =============================================================
2 | * bootstrap-scrollspy.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#scrollspy
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* SCROLLSPY CLASS DEFINITION
27 | * ========================== */
28 |
29 | function ScrollSpy( element, options) {
30 | var process = $.proxy(this.process, this)
31 | , $element = $(element).is('body') ? $(window) : $(element)
32 | , href
33 | this.options = $.extend({}, $.fn.scrollspy.defaults, options)
34 | this.$scrollElement = $element.on('scroll.scroll.data-api', process)
35 | this.selector = (this.options.target
36 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
37 | || '') + ' .nav li > a'
38 | this.$body = $('body')
39 | this.refresh()
40 | this.process()
41 | }
42 |
43 | ScrollSpy.prototype = {
44 |
45 | constructor: ScrollSpy
46 |
47 | , refresh: function () {
48 | var self = this
49 | , $targets
50 |
51 | this.offsets = $([])
52 | this.targets = $([])
53 |
54 | $targets = this.$body
55 | .find(this.selector)
56 | .map(function () {
57 | var $el = $(this)
58 | , href = $el.data('target') || $el.attr('href')
59 | , $href = /^#\w/.test(href) && $(href)
60 | return ( $href
61 | && href.length
62 | && [[ $href.position().top, href ]] ) || null
63 | })
64 | .sort(function (a, b) { return a[0] - b[0] })
65 | .each(function () {
66 | self.offsets.push(this[0])
67 | self.targets.push(this[1])
68 | })
69 | }
70 |
71 | , process: function () {
72 | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
73 | , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
74 | , maxScroll = scrollHeight - this.$scrollElement.height()
75 | , offsets = this.offsets
76 | , targets = this.targets
77 | , activeTarget = this.activeTarget
78 | , i
79 |
80 | if (scrollTop >= maxScroll) {
81 | return activeTarget != (i = targets.last()[0])
82 | && this.activate ( i )
83 | }
84 |
85 | for (i = offsets.length; i--;) {
86 | activeTarget != targets[i]
87 | && scrollTop >= offsets[i]
88 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
89 | && this.activate( targets[i] )
90 | }
91 | }
92 |
93 | , activate: function (target) {
94 | var active
95 | , selector
96 |
97 | this.activeTarget = target
98 |
99 | $(this.selector)
100 | .parent('.active')
101 | .removeClass('active')
102 |
103 | selector = this.selector
104 | + '[data-target="' + target + '"],'
105 | + this.selector + '[href="' + target + '"]'
106 |
107 | active = $(selector)
108 | .parent('li')
109 | .addClass('active')
110 |
111 | if (active.parent('.dropdown-menu')) {
112 | active = active.closest('li.dropdown').addClass('active')
113 | }
114 |
115 | active.trigger('activate')
116 | }
117 |
118 | }
119 |
120 |
121 | /* SCROLLSPY PLUGIN DEFINITION
122 | * =========================== */
123 |
124 | $.fn.scrollspy = function ( option ) {
125 | return this.each(function () {
126 | var $this = $(this)
127 | , data = $this.data('scrollspy')
128 | , options = typeof option == 'object' && option
129 | if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
130 | if (typeof option == 'string') data[option]()
131 | })
132 | }
133 |
134 | $.fn.scrollspy.Constructor = ScrollSpy
135 |
136 | $.fn.scrollspy.defaults = {
137 | offset: 10
138 | }
139 |
140 |
141 | /* SCROLLSPY DATA-API
142 | * ================== */
143 |
144 | $(function () {
145 | $('[data-spy="scroll"]').each(function () {
146 | var $spy = $(this)
147 | $spy.scrollspy($spy.data())
148 | })
149 | })
150 |
151 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/docs/assets/js/bootstrap-scrollspy.js:
--------------------------------------------------------------------------------
1 | /* =============================================================
2 | * bootstrap-scrollspy.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#scrollspy
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* SCROLLSPY CLASS DEFINITION
27 | * ========================== */
28 |
29 | function ScrollSpy( element, options) {
30 | var process = $.proxy(this.process, this)
31 | , $element = $(element).is('body') ? $(window) : $(element)
32 | , href
33 | this.options = $.extend({}, $.fn.scrollspy.defaults, options)
34 | this.$scrollElement = $element.on('scroll.scroll.data-api', process)
35 | this.selector = (this.options.target
36 | || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
37 | || '') + ' .nav li > a'
38 | this.$body = $('body')
39 | this.refresh()
40 | this.process()
41 | }
42 |
43 | ScrollSpy.prototype = {
44 |
45 | constructor: ScrollSpy
46 |
47 | , refresh: function () {
48 | var self = this
49 | , $targets
50 |
51 | this.offsets = $([])
52 | this.targets = $([])
53 |
54 | $targets = this.$body
55 | .find(this.selector)
56 | .map(function () {
57 | var $el = $(this)
58 | , href = $el.data('target') || $el.attr('href')
59 | , $href = /^#\w/.test(href) && $(href)
60 | return ( $href
61 | && href.length
62 | && [[ $href.position().top, href ]] ) || null
63 | })
64 | .sort(function (a, b) { return a[0] - b[0] })
65 | .each(function () {
66 | self.offsets.push(this[0])
67 | self.targets.push(this[1])
68 | })
69 | }
70 |
71 | , process: function () {
72 | var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
73 | , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
74 | , maxScroll = scrollHeight - this.$scrollElement.height()
75 | , offsets = this.offsets
76 | , targets = this.targets
77 | , activeTarget = this.activeTarget
78 | , i
79 |
80 | if (scrollTop >= maxScroll) {
81 | return activeTarget != (i = targets.last()[0])
82 | && this.activate ( i )
83 | }
84 |
85 | for (i = offsets.length; i--;) {
86 | activeTarget != targets[i]
87 | && scrollTop >= offsets[i]
88 | && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
89 | && this.activate( targets[i] )
90 | }
91 | }
92 |
93 | , activate: function (target) {
94 | var active
95 | , selector
96 |
97 | this.activeTarget = target
98 |
99 | $(this.selector)
100 | .parent('.active')
101 | .removeClass('active')
102 |
103 | selector = this.selector
104 | + '[data-target="' + target + '"],'
105 | + this.selector + '[href="' + target + '"]'
106 |
107 | active = $(selector)
108 | .parent('li')
109 | .addClass('active')
110 |
111 | if (active.parent('.dropdown-menu')) {
112 | active = active.closest('li.dropdown').addClass('active')
113 | }
114 |
115 | active.trigger('activate')
116 | }
117 |
118 | }
119 |
120 |
121 | /* SCROLLSPY PLUGIN DEFINITION
122 | * =========================== */
123 |
124 | $.fn.scrollspy = function ( option ) {
125 | return this.each(function () {
126 | var $this = $(this)
127 | , data = $this.data('scrollspy')
128 | , options = typeof option == 'object' && option
129 | if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
130 | if (typeof option == 'string') data[option]()
131 | })
132 | }
133 |
134 | $.fn.scrollspy.Constructor = ScrollSpy
135 |
136 | $.fn.scrollspy.defaults = {
137 | offset: 10
138 | }
139 |
140 |
141 | /* SCROLLSPY DATA-API
142 | * ================== */
143 |
144 | $(function () {
145 | $('[data-spy="scroll"]').each(function () {
146 | var $spy = $(this)
147 | $spy.scrollspy($spy.data())
148 | })
149 | })
150 |
151 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/js/bootstrap-collapse.js:
--------------------------------------------------------------------------------
1 | /* =============================================================
2 | * bootstrap-collapse.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#collapse
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* COLLAPSE PUBLIC CLASS DEFINITION
27 | * ================================ */
28 |
29 | var Collapse = function (element, options) {
30 | this.$element = $(element)
31 | this.options = $.extend({}, $.fn.collapse.defaults, options)
32 |
33 | if (this.options.parent) {
34 | this.$parent = $(this.options.parent)
35 | }
36 |
37 | this.options.toggle && this.toggle()
38 | }
39 |
40 | Collapse.prototype = {
41 |
42 | constructor: Collapse
43 |
44 | , dimension: function () {
45 | var hasWidth = this.$element.hasClass('width')
46 | return hasWidth ? 'width' : 'height'
47 | }
48 |
49 | , show: function () {
50 | var dimension
51 | , scroll
52 | , actives
53 | , hasData
54 |
55 | if (this.transitioning) return
56 |
57 | dimension = this.dimension()
58 | scroll = $.camelCase(['scroll', dimension].join('-'))
59 | actives = this.$parent && this.$parent.find('> .accordion-group > .in')
60 |
61 | if (actives && actives.length) {
62 | hasData = actives.data('collapse')
63 | if (hasData && hasData.transitioning) return
64 | actives.collapse('hide')
65 | hasData || actives.data('collapse', null)
66 | }
67 |
68 | this.$element[dimension](0)
69 | this.transition('addClass', $.Event('show'), 'shown')
70 | this.$element[dimension](this.$element[0][scroll])
71 | }
72 |
73 | , hide: function () {
74 | var dimension
75 | if (this.transitioning) return
76 | dimension = this.dimension()
77 | this.reset(this.$element[dimension]())
78 | this.transition('removeClass', $.Event('hide'), 'hidden')
79 | this.$element[dimension](0)
80 | }
81 |
82 | , reset: function (size) {
83 | var dimension = this.dimension()
84 |
85 | this.$element
86 | .removeClass('collapse')
87 | [dimension](size || 'auto')
88 | [0].offsetWidth
89 |
90 | this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
91 |
92 | return this
93 | }
94 |
95 | , transition: function (method, startEvent, completeEvent) {
96 | var that = this
97 | , complete = function () {
98 | if (startEvent.type == 'show') that.reset()
99 | that.transitioning = 0
100 | that.$element.trigger(completeEvent)
101 | }
102 |
103 | this.$element.trigger(startEvent)
104 |
105 | if (startEvent.isDefaultPrevented()) return
106 |
107 | this.transitioning = 1
108 |
109 | this.$element[method]('in')
110 |
111 | $.support.transition && this.$element.hasClass('collapse') ?
112 | this.$element.one($.support.transition.end, complete) :
113 | complete()
114 | }
115 |
116 | , toggle: function () {
117 | this[this.$element.hasClass('in') ? 'hide' : 'show']()
118 | }
119 |
120 | }
121 |
122 |
123 | /* COLLAPSIBLE PLUGIN DEFINITION
124 | * ============================== */
125 |
126 | $.fn.collapse = function (option) {
127 | return this.each(function () {
128 | var $this = $(this)
129 | , data = $this.data('collapse')
130 | , options = typeof option == 'object' && option
131 | if (!data) $this.data('collapse', (data = new Collapse(this, options)))
132 | if (typeof option == 'string') data[option]()
133 | })
134 | }
135 |
136 | $.fn.collapse.defaults = {
137 | toggle: true
138 | }
139 |
140 | $.fn.collapse.Constructor = Collapse
141 |
142 |
143 | /* COLLAPSIBLE DATA-API
144 | * ==================== */
145 |
146 | $(function () {
147 | $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
148 | var $this = $(this), href
149 | , target = $this.attr('data-target')
150 | || e.preventDefault()
151 | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
152 | , option = $(target).data('collapse') ? 'toggle' : $this.data()
153 | $(target).collapse(option)
154 | })
155 | })
156 |
157 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/docs/assets/js/bootstrap-collapse.js:
--------------------------------------------------------------------------------
1 | /* =============================================================
2 | * bootstrap-collapse.js v2.0.4
3 | * http://twitter.github.com/bootstrap/javascript.html#collapse
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 | "use strict"; // jshint ;_;
24 |
25 |
26 | /* COLLAPSE PUBLIC CLASS DEFINITION
27 | * ================================ */
28 |
29 | var Collapse = function (element, options) {
30 | this.$element = $(element)
31 | this.options = $.extend({}, $.fn.collapse.defaults, options)
32 |
33 | if (this.options.parent) {
34 | this.$parent = $(this.options.parent)
35 | }
36 |
37 | this.options.toggle && this.toggle()
38 | }
39 |
40 | Collapse.prototype = {
41 |
42 | constructor: Collapse
43 |
44 | , dimension: function () {
45 | var hasWidth = this.$element.hasClass('width')
46 | return hasWidth ? 'width' : 'height'
47 | }
48 |
49 | , show: function () {
50 | var dimension
51 | , scroll
52 | , actives
53 | , hasData
54 |
55 | if (this.transitioning) return
56 |
57 | dimension = this.dimension()
58 | scroll = $.camelCase(['scroll', dimension].join('-'))
59 | actives = this.$parent && this.$parent.find('> .accordion-group > .in')
60 |
61 | if (actives && actives.length) {
62 | hasData = actives.data('collapse')
63 | if (hasData && hasData.transitioning) return
64 | actives.collapse('hide')
65 | hasData || actives.data('collapse', null)
66 | }
67 |
68 | this.$element[dimension](0)
69 | this.transition('addClass', $.Event('show'), 'shown')
70 | this.$element[dimension](this.$element[0][scroll])
71 | }
72 |
73 | , hide: function () {
74 | var dimension
75 | if (this.transitioning) return
76 | dimension = this.dimension()
77 | this.reset(this.$element[dimension]())
78 | this.transition('removeClass', $.Event('hide'), 'hidden')
79 | this.$element[dimension](0)
80 | }
81 |
82 | , reset: function (size) {
83 | var dimension = this.dimension()
84 |
85 | this.$element
86 | .removeClass('collapse')
87 | [dimension](size || 'auto')
88 | [0].offsetWidth
89 |
90 | this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
91 |
92 | return this
93 | }
94 |
95 | , transition: function (method, startEvent, completeEvent) {
96 | var that = this
97 | , complete = function () {
98 | if (startEvent.type == 'show') that.reset()
99 | that.transitioning = 0
100 | that.$element.trigger(completeEvent)
101 | }
102 |
103 | this.$element.trigger(startEvent)
104 |
105 | if (startEvent.isDefaultPrevented()) return
106 |
107 | this.transitioning = 1
108 |
109 | this.$element[method]('in')
110 |
111 | $.support.transition && this.$element.hasClass('collapse') ?
112 | this.$element.one($.support.transition.end, complete) :
113 | complete()
114 | }
115 |
116 | , toggle: function () {
117 | this[this.$element.hasClass('in') ? 'hide' : 'show']()
118 | }
119 |
120 | }
121 |
122 |
123 | /* COLLAPSIBLE PLUGIN DEFINITION
124 | * ============================== */
125 |
126 | $.fn.collapse = function (option) {
127 | return this.each(function () {
128 | var $this = $(this)
129 | , data = $this.data('collapse')
130 | , options = typeof option == 'object' && option
131 | if (!data) $this.data('collapse', (data = new Collapse(this, options)))
132 | if (typeof option == 'string') data[option]()
133 | })
134 | }
135 |
136 | $.fn.collapse.defaults = {
137 | toggle: true
138 | }
139 |
140 | $.fn.collapse.Constructor = Collapse
141 |
142 |
143 | /* COLLAPSIBLE DATA-API
144 | * ==================== */
145 |
146 | $(function () {
147 | $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
148 | var $this = $(this), href
149 | , target = $this.attr('data-target')
150 | || e.preventDefault()
151 | || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
152 | , option = $(target).data('collapse') ? 'toggle' : $this.data()
153 | $(target).collapse(option)
154 | })
155 | })
156 |
157 | }(window.jQuery);
--------------------------------------------------------------------------------
/assets/less/tables.less:
--------------------------------------------------------------------------------
1 | //
2 | // Tables.less
3 | // Tables for, you guessed it, tabular data
4 | // ----------------------------------------
5 |
6 |
7 | // BASE TABLES
8 | // -----------------
9 |
10 | table {
11 | max-width: 100%;
12 | background-color: @tableBackground;
13 | border-collapse: collapse;
14 | border-spacing: 0;
15 | }
16 |
17 | // BASELINE STYLES
18 | // ---------------
19 |
20 | .table {
21 | width: 100%;
22 | margin-bottom: @baseLineHeight;
23 | // Cells
24 | th,
25 | td {
26 | padding: 8px;
27 | line-height: @baseLineHeight;
28 | text-align: left;
29 | vertical-align: top;
30 | border-top: 1px solid @tableBorder;
31 | }
32 | th {
33 | font-weight: bold;
34 | }
35 | // Bottom align for column headings
36 | thead th {
37 | vertical-align: bottom;
38 | }
39 | // Remove top border from thead by default
40 | caption + thead tr:first-child th,
41 | caption + thead tr:first-child td,
42 | colgroup + thead tr:first-child th,
43 | colgroup + thead tr:first-child td,
44 | thead:first-child tr:first-child th,
45 | thead:first-child tr:first-child td {
46 | border-top: 0;
47 | }
48 | // Account for multiple tbody instances
49 | tbody + tbody {
50 | border-top: 2px solid @tableBorder;
51 | }
52 | }
53 |
54 |
55 |
56 | // CONDENSED TABLE W/ HALF PADDING
57 | // -------------------------------
58 |
59 | .table-condensed {
60 | th,
61 | td {
62 | padding: 4px 5px;
63 | }
64 | }
65 |
66 |
67 | // BORDERED VERSION
68 | // ----------------
69 |
70 | .table-bordered {
71 | border: 1px solid @tableBorder;
72 | border-collapse: separate; // Done so we can round those corners!
73 | *border-collapse: collapsed; // IE7 can't round corners anyway
74 | border-left: 0;
75 | .border-radius(4px);
76 | th,
77 | td {
78 | border-left: 1px solid @tableBorder;
79 | }
80 | // Prevent a double border
81 | caption + thead tr:first-child th,
82 | caption + tbody tr:first-child th,
83 | caption + tbody tr:first-child td,
84 | colgroup + thead tr:first-child th,
85 | colgroup + tbody tr:first-child th,
86 | colgroup + tbody tr:first-child td,
87 | thead:first-child tr:first-child th,
88 | tbody:first-child tr:first-child th,
89 | tbody:first-child tr:first-child td {
90 | border-top: 0;
91 | }
92 | // For first th or td in the first row in the first thead or tbody
93 | thead:first-child tr:first-child th:first-child,
94 | tbody:first-child tr:first-child td:first-child {
95 | -webkit-border-top-left-radius: 4px;
96 | border-top-left-radius: 4px;
97 | -moz-border-radius-topleft: 4px;
98 | }
99 | thead:first-child tr:first-child th:last-child,
100 | tbody:first-child tr:first-child td:last-child {
101 | -webkit-border-top-right-radius: 4px;
102 | border-top-right-radius: 4px;
103 | -moz-border-radius-topright: 4px;
104 | }
105 | // For first th or td in the first row in the first thead or tbody
106 | thead:last-child tr:last-child th:first-child,
107 | tbody:last-child tr:last-child td:first-child {
108 | .border-radius(0 0 0 4px);
109 | -webkit-border-bottom-left-radius: 4px;
110 | border-bottom-left-radius: 4px;
111 | -moz-border-radius-bottomleft: 4px;
112 | }
113 | thead:last-child tr:last-child th:last-child,
114 | tbody:last-child tr:last-child td:last-child {
115 | -webkit-border-bottom-right-radius: 4px;
116 | border-bottom-right-radius: 4px;
117 | -moz-border-radius-bottomright: 4px;
118 | }
119 | }
120 |
121 |
122 | // ZEBRA-STRIPING
123 | // --------------
124 |
125 | // Default zebra-stripe styles (alternating gray and transparent backgrounds)
126 | .table-striped {
127 | tbody {
128 | tr:nth-child(odd) td,
129 | tr:nth-child(odd) th {
130 | background-color: @tableBackgroundAccent;
131 | }
132 | }
133 | }
134 |
135 |
136 | // HOVER EFFECT
137 | // ------------
138 | // Placed here since it has to come after the potential zebra striping
139 | .table {
140 | tbody tr:hover td,
141 | tbody tr:hover th {
142 | background-color: @tableBackgroundHover;
143 | }
144 | }
145 |
146 |
147 | // TABLE CELL SIZING
148 | // -----------------
149 |
150 | // Change the columns
151 | table {
152 | .span1 { .tableColumns(1); }
153 | .span2 { .tableColumns(2); }
154 | .span3 { .tableColumns(3); }
155 | .span4 { .tableColumns(4); }
156 | .span5 { .tableColumns(5); }
157 | .span6 { .tableColumns(6); }
158 | .span7 { .tableColumns(7); }
159 | .span8 { .tableColumns(8); }
160 | .span9 { .tableColumns(9); }
161 | .span10 { .tableColumns(10); }
162 | .span11 { .tableColumns(11); }
163 | .span12 { .tableColumns(12); }
164 | .span13 { .tableColumns(13); }
165 | .span14 { .tableColumns(14); }
166 | .span15 { .tableColumns(15); }
167 | .span16 { .tableColumns(16); }
168 | .span17 { .tableColumns(17); }
169 | .span18 { .tableColumns(18); }
170 | .span19 { .tableColumns(19); }
171 | .span20 { .tableColumns(20); }
172 | .span21 { .tableColumns(21); }
173 | .span22 { .tableColumns(22); }
174 | .span23 { .tableColumns(23); }
175 | .span24 { .tableColumns(24); }
176 | }
177 |
--------------------------------------------------------------------------------
/assets/less/buttons.less:
--------------------------------------------------------------------------------
1 | // BUTTON STYLES
2 | // -------------
3 |
4 |
5 | // Base styles
6 | // --------------------------------------------------
7 |
8 | // Core
9 | .btn {
10 | display: inline-block;
11 | .ie7-inline-block();
12 | padding: 4px 10px 4px;
13 | margin-bottom: 0; // For input.btn
14 | font-size: @baseFontSize;
15 | line-height: @baseLineHeight;
16 | *line-height: 20px;
17 | color: @grayDark;
18 | text-align: center;
19 | text-shadow: 0 1px 1px rgba(255,255,255,.75);
20 | vertical-align: middle;
21 | cursor: pointer;
22 | .buttonBackground(@btnBackground, @btnBackgroundHighlight);
23 | border: 1px solid @btnBorder;
24 | *border: 0; // Remove the border to prevent IE7's black border on input:focus
25 | border-bottom-color: darken(@btnBorder, 10%);
26 | .border-radius(4px);
27 | .ie7-restore-left-whitespace(); // Give IE7 some love
28 | .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
29 | }
30 |
31 | // Hover state
32 | .btn:hover {
33 | color: @grayDark;
34 | text-decoration: none;
35 | background-color: darken(@white, 10%);
36 | *background-color: darken(@white, 15%); /* Buttons in IE7 don't get borders, so darken on hover */
37 | background-position: 0 -15px;
38 |
39 | // transition is only when going to hover, otherwise the background
40 | // behind the gradient (there for IE<=9 fallback) gets mismatched
41 | .transition(background-position .1s linear);
42 | }
43 |
44 | // Focus state for keyboard and accessibility
45 | .btn:focus {
46 | .tab-focus();
47 | }
48 |
49 | // Active state
50 | .btn.active,
51 | .btn:active {
52 | background-color: darken(@white, 10%);
53 | background-color: darken(@white, 15%) e("\9");
54 | background-image: none;
55 | outline: 0;
56 | .box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
57 | }
58 |
59 | // Disabled state
60 | .btn.disabled,
61 | .btn[disabled] {
62 | cursor: default;
63 | background-color: darken(@white, 10%);
64 | background-image: none;
65 | .opacity(65);
66 | .box-shadow(none);
67 | }
68 |
69 |
70 | // Button Sizes
71 | // --------------------------------------------------
72 |
73 | // Large
74 | .btn-large {
75 | padding: 9px 14px;
76 | font-size: @baseFontSize + 2px;
77 | line-height: normal;
78 | .border-radius(5px);
79 | }
80 | .btn-large [class^="icon-"] {
81 | margin-top: 1px;
82 | }
83 |
84 | // Small
85 | .btn-small {
86 | padding: 5px 9px;
87 | font-size: @baseFontSize - 2px;
88 | line-height: @baseLineHeight - 2px;
89 | }
90 | .btn-small [class^="icon-"] {
91 | margin-top: -1px;
92 | }
93 |
94 | // Mini
95 | .btn-mini {
96 | padding: 2px 6px;
97 | font-size: @baseFontSize - 2px;
98 | line-height: @baseLineHeight - 4px;
99 | }
100 |
101 |
102 | // Alternate buttons
103 | // --------------------------------------------------
104 |
105 | // Set text color
106 | // -------------------------
107 | .btn-primary,
108 | .btn-primary:hover,
109 | .btn-warning,
110 | .btn-warning:hover,
111 | .btn-danger,
112 | .btn-danger:hover,
113 | .btn-success,
114 | .btn-success:hover,
115 | .btn-info,
116 | .btn-info:hover,
117 | .btn-inverse,
118 | .btn-inverse:hover {
119 | color: @white;
120 | text-shadow: 0 -1px 0 rgba(0,0,0,.25);
121 | }
122 | // Provide *some* extra contrast for those who can get it
123 | .btn-primary.active,
124 | .btn-warning.active,
125 | .btn-danger.active,
126 | .btn-success.active,
127 | .btn-info.active,
128 | .btn-inverse.active {
129 | color: rgba(255,255,255,.75);
130 | }
131 |
132 | // Set the backgrounds
133 | // -------------------------
134 | .btn {
135 | // reset here as of 2.0.3 due to Recess property order
136 | border-color: #ccc;
137 | border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);
138 | }
139 | .btn-primary {
140 | .buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
141 | }
142 | // Warning appears are orange
143 | .btn-warning {
144 | .buttonBackground(@btnWarningBackground, @btnWarningBackgroundHighlight);
145 | }
146 | // Danger and error appear as red
147 | .btn-danger {
148 | .buttonBackground(@btnDangerBackground, @btnDangerBackgroundHighlight);
149 | }
150 | // Success appears as green
151 | .btn-success {
152 | .buttonBackground(@btnSuccessBackground, @btnSuccessBackgroundHighlight);
153 | }
154 | // Info appears as a neutral blue
155 | .btn-info {
156 | .buttonBackground(@btnInfoBackground, @btnInfoBackgroundHighlight);
157 | }
158 | // Inverse appears as dark gray
159 | .btn-inverse {
160 | .buttonBackground(@btnInverseBackground, @btnInverseBackgroundHighlight);
161 | }
162 |
163 |
164 | // Cross-browser Jank
165 | // --------------------------------------------------
166 |
167 | button.btn,
168 | input[type="submit"].btn {
169 |
170 | // Firefox 3.6 only I believe
171 | &::-moz-focus-inner {
172 | padding: 0;
173 | border: 0;
174 | }
175 |
176 | // IE7 has some default padding on button controls
177 | *padding-top: 2px;
178 | *padding-bottom: 2px;
179 | &.btn-large {
180 | *padding-top: 7px;
181 | *padding-bottom: 7px;
182 | }
183 | &.btn-small {
184 | *padding-top: 3px;
185 | *padding-bottom: 3px;
186 | }
187 | &.btn-mini {
188 | *padding-top: 1px;
189 | *padding-bottom: 1px;
190 | }
191 | }
192 |
--------------------------------------------------------------------------------