├── .gitignore ├── .gitmodules ├── Daemon ├── ParallelTasks.php ├── SendPostTask.php ├── config.php └── run.php ├── LICENSE ├── README.md ├── api ├── .htaccess ├── CustomSessionHandler.php ├── composer.json ├── composer.lock ├── config.php.sample ├── index.php ├── models │ ├── Account.php │ └── Post.php └── oauth.php ├── bootstrap ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap-responsive.min.css │ ├── bootstrap.css │ └── bootstrap.min.css ├── img │ ├── glyphicons-halflings-white.png │ └── glyphicons-halflings.png ├── js │ ├── bootstrap.js │ └── bootstrap.min.js └── src │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── docs │ ├── assets │ │ ├── css │ │ │ ├── bootstrap-responsive.css │ │ │ ├── bootstrap.css │ │ │ └── docs.css │ │ ├── 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 │ │ │ └── favicon.ico │ │ ├── img │ │ │ ├── bird.png │ │ │ ├── bootstrap-mdo-sfmoma-01.jpg │ │ │ ├── bootstrap-mdo-sfmoma-02.jpg │ │ │ ├── bootstrap-mdo-sfmoma-03.jpg │ │ │ ├── browsers.png │ │ │ ├── example-sites │ │ │ │ ├── fleetio.png │ │ │ │ ├── jshint.png │ │ │ │ ├── kippt.png │ │ │ │ └── soundready.png │ │ │ ├── examples │ │ │ │ ├── bootstrap-example-fluid.jpg │ │ │ │ ├── bootstrap-example-hero.jpg │ │ │ │ └── bootstrap-example-starter.jpg │ │ │ ├── github-16px.png │ │ │ ├── glyphicons-halflings-white.png │ │ │ ├── glyphicons-halflings.png │ │ │ ├── glyphicons │ │ │ │ ├── glyphicons_009_magic.png │ │ │ │ ├── glyphicons_042_group.png │ │ │ │ ├── glyphicons_079_podium.png │ │ │ │ ├── glyphicons_082_roundabout.png │ │ │ │ ├── glyphicons_155_show_thumbnails.png │ │ │ │ ├── glyphicons_163_iphone.png │ │ │ │ ├── glyphicons_214_resize_small.png │ │ │ │ └── glyphicons_266_book_open.png │ │ │ ├── grid-18px-masked.png │ │ │ ├── icon-css3.png │ │ │ ├── icon-github.png │ │ │ ├── icon-html5.png │ │ │ ├── icon-twitter.png │ │ │ ├── less-logo-large.png │ │ │ ├── less-small.png │ │ │ └── responsive-illustrations.png │ │ └── js │ │ │ ├── README.md │ │ │ ├── application.js │ │ │ ├── bootstrap-alert.js │ │ │ ├── bootstrap-button.js │ │ │ ├── bootstrap-carousel.js │ │ │ ├── bootstrap-collapse.js │ │ │ ├── bootstrap-dropdown.js │ │ │ ├── bootstrap-modal.js │ │ │ ├── bootstrap-popover.js │ │ │ ├── bootstrap-scrollspy.js │ │ │ ├── bootstrap-tab.js │ │ │ ├── bootstrap-tooltip.js │ │ │ ├── bootstrap-transition.js │ │ │ ├── bootstrap-typeahead.js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ ├── google-code-prettify │ │ │ ├── prettify.css │ │ │ └── prettify.js │ │ │ └── jquery.js │ ├── base-css.html │ ├── build │ │ ├── index.js │ │ └── package.json │ ├── components.html │ ├── download.html │ ├── examples.html │ ├── examples │ │ ├── fluid.html │ │ ├── hero.html │ │ └── starter-template.html │ ├── index.html │ ├── javascript.html │ ├── less.html │ ├── scaffolding.html │ ├── templates │ │ ├── layout.mustache │ │ └── pages │ │ │ ├── base-css.mustache │ │ │ ├── components.mustache │ │ │ ├── download.mustache │ │ │ ├── examples.mustache │ │ │ ├── index.mustache │ │ │ ├── javascript.mustache │ │ │ ├── less.mustache │ │ │ ├── scaffolding.mustache │ │ │ └── upgrading.mustache │ └── upgrading.html │ ├── img │ ├── glyphicons-halflings-white.png │ └── glyphicons-halflings.png │ ├── js │ ├── .jshintrc │ ├── README.md │ ├── bootstrap-alert.js │ ├── bootstrap-button.js │ ├── bootstrap-carousel.js │ ├── bootstrap-collapse.js │ ├── bootstrap-dropdown.js │ ├── bootstrap-modal.js │ ├── bootstrap-popover.js │ ├── bootstrap-scrollspy.js │ ├── bootstrap-tab.js │ ├── bootstrap-tooltip.js │ ├── bootstrap-transition.js │ ├── bootstrap-typeahead.js │ └── tests │ │ ├── index.html │ │ ├── phantom.js │ │ ├── server.js │ │ ├── unit │ │ ├── bootstrap-alert.js │ │ ├── bootstrap-button.js │ │ ├── bootstrap-carousel.js │ │ ├── bootstrap-collapse.js │ │ ├── bootstrap-dropdown.js │ │ ├── bootstrap-modal.js │ │ ├── bootstrap-phantom.js │ │ ├── bootstrap-popover.js │ │ ├── bootstrap-scrollspy.js │ │ ├── bootstrap-tab.js │ │ ├── bootstrap-tooltip.js │ │ ├── bootstrap-transition.js │ │ └── bootstrap-typeahead.js │ │ └── vendor │ │ ├── jquery.js │ │ ├── qunit.css │ │ └── qunit.js │ ├── less │ ├── accordion.less │ ├── alerts.less │ ├── bootstrap.less │ ├── breadcrumbs.less │ ├── button-groups.less │ ├── buttons.less │ ├── carousel.less │ ├── close.less │ ├── code.less │ ├── component-animations.less │ ├── dropdowns.less │ ├── forms.less │ ├── grid.less │ ├── hero-unit.less │ ├── labels-badges.less │ ├── layouts.less │ ├── mixins.less │ ├── modals.less │ ├── navbar.less │ ├── navs.less │ ├── pager.less │ ├── pagination.less │ ├── popovers.less │ ├── progress-bars.less │ ├── reset.less │ ├── responsive-1200px-min.less │ ├── responsive-767px-max.less │ ├── responsive-768px-979px.less │ ├── responsive-navbar.less │ ├── responsive-utilities.less │ ├── responsive.less │ ├── scaffolding.less │ ├── sprites.less │ ├── tables.less │ ├── tests │ │ ├── css-tests.css │ │ ├── css-tests.html │ │ ├── forms.html │ │ └── navbar.html │ ├── thumbnails.less │ ├── tooltip.less │ ├── type.less │ ├── utilities.less │ ├── variables.less │ └── wells.less │ └── package.json ├── chrome-extension ├── background.js ├── icon_100.png ├── icon_128.png └── manifest.json ├── chrome ├── icon_128.png └── manifest.json ├── css └── circular.css ├── images ├── add_account.png ├── background.jpg ├── circular-header.png ├── circular-large.png ├── circular-logo.png ├── circular.png ├── empty-timeline.png ├── github-ribbon.png ├── network-icons.png ├── screenshot1-new.png ├── screenshot1.png ├── screenshot2-new.png ├── screenshot3.png └── twitter-bird.png ├── index.html └── js ├── bookmarklet-src.js ├── circular.js ├── circular.min.js ├── grunt.js ├── src ├── app.js ├── bootstrap.js ├── collections │ └── posts.js ├── models │ ├── post.js │ ├── poststimes.js │ └── settings.js ├── start.js ├── utils.js └── views │ ├── alert.js │ ├── composer.js │ ├── posts.js │ └── settings.js └── vendor ├── backbone.js ├── jquery-1.7.2.min.js ├── jquery-ui-1.8.22.custom.min.js ├── jquery.filedrop.js ├── jquery.hotkeys.js ├── jstz.min.js ├── mustache.js ├── spin.min.js ├── twitter-text-1.11.0.min.js └── underscore.js /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | Daemon/logs/daemon.log 3 | 4 | api/config.php 5 | 6 | *.daemon_lock 7 | 8 | uploads/ 9 | 10 | api/vendor/ 11 | api/oauth-fake.php 12 | 13 | node_modules/ 14 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "extlib/tmhOAuth"] 2 | path = extlib/tmhOAuth 3 | url = git://github.com/themattharris/tmhOAuth.git 4 | [submodule "extlib/PHP-Daemon"] 5 | path = extlib/PHP-Daemon 6 | url = git://github.com/shaneharter/PHP-Daemon.git 7 | -------------------------------------------------------------------------------- /Daemon/SendPostTask.php: -------------------------------------------------------------------------------- 1 | post = $post; 40 | } 41 | 42 | /** 43 | * Called on Construct or Init 44 | * @return void 45 | */ 46 | public function setup() 47 | { 48 | $this->daemon = ParallelTasks::getInstance(); 49 | } 50 | 51 | /** 52 | * Called on Destruct 53 | * @return void 54 | */ 55 | public function teardown() 56 | { 57 | // Satisfy Interface 58 | } 59 | 60 | /** 61 | * This is called after setup() returns 62 | * @return void 63 | */ 64 | public function start() 65 | { 66 | $post = $this->post; 67 | 68 | // Send to Twitter: 69 | $tmhOAuth = new \tmhOAuth(array( 70 | /* Credentials */ 71 | )); 72 | 73 | $code = $tmhOAuth->request('POST', $tmhOAuth->url('1/statuses/update'), array( 74 | 'status' => $post['content'] 75 | )); 76 | 77 | // There is no special handling of API errors. 78 | // Right now we just dump the response to MongoDB 79 | 80 | $post['code'] = $code; 81 | $post['response'] = json_decode($tmhOAuth->response['response'], true); 82 | 83 | // Move this post to another collection named archive: 84 | unset($post['processing']); 85 | unset($post['processing_time']); 86 | $m = new \Mongo(); 87 | $m->circular->archive->insert($post); 88 | $m->circular->posts->remove(array('_id' => $post['_id'])); 89 | 90 | if ($code == 200) { 91 | $this->daemon->log(sprintf( 92 | "Sent post %s to Twitter, Twitter id: %s by user %s", 93 | $post['_id'], 94 | (string) $post['response']['id'], 95 | $post['response']['screen_name'] 96 | )); 97 | } 98 | else { 99 | $this->daemon->log(sprintf( 100 | "Failed sending post %s to Twitter, error code %s: %s", 101 | $post['_id'], 102 | (string) $code, 103 | $post['response']['error'] 104 | ), "warning"); 105 | } 106 | 107 | } 108 | } 109 | 110 | 111 | -------------------------------------------------------------------------------- /Daemon/config.php: -------------------------------------------------------------------------------- 1 | run(); 11 | 12 | 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Julien Chaumond 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Circular 2 | 3 | #### An open source Buffer app built on Backbone, Bootstrap and MongoDB 4 | 5 | http://circular.io 6 | 7 | --- 8 | 9 | Circular is built as a Backbone.js application that communicates with a MongoDB datastore through a REST API written in PHP. 10 | 11 | The server part, based on the [Silex](http://silex.sensiolabs.org) PHP micro-framework and the [Mongovel](http://github.com/julien-c/Mongovel) wrapper to MongoDB, is intended to be the *dumbest possible*, i.e. we tried to put most "intelligence" in the Backbone app, not in the API. (For example, the API only takes UNIX timestamps and posts' content, while the Backbone app computes the scheduled timestamps). 12 | 13 | A daemon based on [PHP-Daemon](https://github.com/shaneharter/PHP-Daemon) then runs in the background and is responsible for sending your posts to Twitter when they're due. 14 | 15 | 16 | ### Installation 17 | --- 18 | 19 | Prerequisites: 20 | 21 | * MongoDB, and PHP's [MongoDB driver](http://www.mongodb.org/display/DOCS/PHP+Language+Center) 22 | * To run the background daemon based on [PHP-Daemon](https://github.com/shaneharter/PHP-Daemon), you need the POSIX and PCNTL extensions for PHP. 23 | * [Composer](http://getcomposer.org) 24 | 25 | Installation: 26 | 27 | * Make sure you cloned this repo recursively, i.e. with submodules that are in `extlib` 28 | * Create a new Twitter application on dev.twitter.com, then copy your credentials into `api/config.php.sample` and rename it to `api/config.php` 29 | * Make sure to specify an OAuth callback URL in your Twitter application settings. Use `http://[server_name]/[path to buffer]/api/oauth.php` 30 | * Install the Silex application dependencies using Composer: `cd api && composer install` 31 | * Create an `uploads` directory and make it writable by the Web server 32 | * Your application's frontend should now be accessible where you set it up, for instance at `http://localhost/Circular`. The MongoDB datastore's name will be `circular` (you don't have to explicitly create it). 33 | * Start the daemon with `php Daemon/run.php` 34 | * Use option `-d` to run as daemon, i.e. detach and run in the background 35 | * Your daemon's log will be in `/var/log/daemons/circular`, or if this is not writable, in `Daemon/logs`. You can use/rotate this log to monitor your daemon. 36 | * That's it! 37 | 38 | 39 | ### License 40 | --- 41 | * Copyright 2012 [Julien Chaumond](http://julien-c.fr) 42 | * Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/) 43 | -------------------------------------------------------------------------------- /api/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteBase /api 4 | RewriteCond %{REQUEST_FILENAME} !-f 5 | RewriteRule ^ index.php [L] 6 | -------------------------------------------------------------------------------- /api/CustomSessionHandler.php: -------------------------------------------------------------------------------- 1 | circular->sessions, $logger); 12 | } 13 | 14 | public function gc($maxlifetime) { 15 | // NOOP 16 | return; 17 | } 18 | 19 | 20 | 21 | public function setup() { 22 | session_set_save_handler($this); 23 | session_set_cookie_params(60*60*24*365*20); 24 | session_start(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "silex/silex": "~1.3", 4 | "julien-c/simple-resize": "*", 5 | "julien-c/mongovel": "*", 6 | "altmetric/mongo-session-handler": "^1.0", 7 | "psr/log": "^1.0" 8 | }, 9 | "autoload": { 10 | "classmap": ["models/", "CustomSessionHandler.php"] 11 | }, 12 | "minimum-stability": "dev" 13 | } 14 | -------------------------------------------------------------------------------- /api/config.php.sample: -------------------------------------------------------------------------------- 1 | ${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 -------------------------------------------------------------------------------- /bootstrap/src/README.md: -------------------------------------------------------------------------------- 1 | [Twitter Bootstrap](http://twitter.github.com/bootstrap) [![Build Status](https://secure.travis-ci.org/twitter/bootstrap.png)](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 | -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/ico/apple-touch-icon-114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/ico/apple-touch-icon-114-precomposed.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/ico/apple-touch-icon-144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/ico/apple-touch-icon-144-precomposed.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/ico/apple-touch-icon-57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/ico/apple-touch-icon-57-precomposed.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/ico/apple-touch-icon-72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/ico/apple-touch-icon-72-precomposed.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/ico/favicon.ico -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/bird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/bird.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/browsers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/browsers.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/example-sites/fleetio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/example-sites/fleetio.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/example-sites/jshint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/example-sites/jshint.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/example-sites/kippt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/example-sites/kippt.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/example-sites/soundready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/example-sites/soundready.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/examples/bootstrap-example-fluid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/examples/bootstrap-example-fluid.jpg -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/examples/bootstrap-example-hero.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/examples/bootstrap-example-hero.jpg -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/examples/bootstrap-example-starter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/examples/bootstrap-example-starter.jpg -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/github-16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/github-16px.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons/glyphicons_009_magic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons/glyphicons_009_magic.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons/glyphicons_042_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons/glyphicons_042_group.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons/glyphicons_079_podium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons/glyphicons_079_podium.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons/glyphicons_082_roundabout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons/glyphicons_082_roundabout.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons/glyphicons_163_iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons/glyphicons_163_iphone.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons/glyphicons_214_resize_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons/glyphicons_214_resize_small.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/glyphicons/glyphicons_266_book_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/glyphicons/glyphicons_266_book_open.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/grid-18px-masked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/grid-18px-masked.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/icon-css3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/icon-css3.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/icon-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/icon-github.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/icon-html5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/icon-html5.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/icon-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/icon-twitter.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/less-logo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/less-logo-large.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/less-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/less-small.png -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/img/responsive-illustrations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/docs/assets/img/responsive-illustrations.png -------------------------------------------------------------------------------- /bootstrap/src/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" -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/docs/assets/js/google-code-prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .linenums .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 18px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /bootstrap/src/docs/build/index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var hogan = require('hogan.js') 3 | , fs = require('fs') 4 | , prod = process.argv[2] == 'production' 5 | , title = 'Twitter Bootstrap' 6 | 7 | var layout, pages 8 | 9 | // compile layout template 10 | layout = fs.readFileSync(__dirname + '/../templates/layout.mustache', 'utf-8') 11 | layout = hogan.compile(layout, { sectionTags: [{o:'_i', c:'i'}] }) 12 | 13 | // retrieve pages 14 | pages = fs.readdirSync(__dirname + '/../templates/pages') 15 | 16 | // iterate over pages 17 | pages.forEach(function (name) { 18 | 19 | if (!name.match(/\.mustache$/)) return 20 | 21 | var page = fs.readFileSync(__dirname + '/../templates/pages/' + name, 'utf-8') 22 | , context = {} 23 | 24 | context[name.replace(/\.mustache$/, '')] = 'active' 25 | context._i = true 26 | context.production = prod 27 | context.title = name 28 | .replace(/\.mustache/, '') 29 | .replace(/\-.*/, '') 30 | .replace(/(.)/, function ($1) { return $1.toUpperCase() }) 31 | 32 | if (context.title == 'Index') { 33 | context.title = title 34 | } else { 35 | context.title += ' · ' + title 36 | } 37 | 38 | page = hogan.compile(page, { sectionTags: [{o:'_i', c:'i'}] }) 39 | page = layout.render(context, { 40 | body: page 41 | }) 42 | 43 | fs.writeFileSync(__dirname + '/../' + name.replace(/mustache$/, 'html'), page, 'utf-8') 44 | }) -------------------------------------------------------------------------------- /bootstrap/src/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 | -------------------------------------------------------------------------------- /bootstrap/src/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 | -------------------------------------------------------------------------------- /bootstrap/src/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 | -------------------------------------------------------------------------------- /bootstrap/src/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /bootstrap/src/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julien-c/Circular/10baba5552703eccf2a035133d39bd3540682744/bootstrap/src/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /bootstrap/src/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 | } -------------------------------------------------------------------------------- /bootstrap/src/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" -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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); -------------------------------------------------------------------------------- /bootstrap/src/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 | -------------------------------------------------------------------------------- /bootstrap/src/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 | }) -------------------------------------------------------------------------------- /bootstrap/src/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') -------------------------------------------------------------------------------- /bootstrap/src/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 = '
    ' 15 | + '×' 16 | + '

    Holy guacamole! Best check yo self, you\'re not looking too good.

    ' 17 | + '
    ' 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 = '
    ' 29 | + '×' 30 | + '

    Holy guacamole! Best check yo self, you\'re not looking too good.

    ' 31 | + '
    ' 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 | }) -------------------------------------------------------------------------------- /bootstrap/src/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 | }) -------------------------------------------------------------------------------- /bootstrap/src/js/tests/unit/bootstrap-carousel.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | 3 | module("bootstrap-carousel") 4 | 5 | test("should be defined on jquery object", function () { 6 | ok($(document.body).carousel, 'carousel method is defined') 7 | }) 8 | 9 | test("should return element", function () { 10 | ok($(document.body).carousel()[0] == document.body, 'document.body returned') 11 | }) 12 | 13 | test("should not fire sliden when slide is prevented", function () { 14 | $.support.transition = false 15 | stop(); 16 | $('