Permalink
Browse files

add bootstrap

  • Loading branch information...
machida committed Oct 1, 2012
1 parent e867b85 commit b7d26a9cffd2afbba9b0cf33977c58be9848b425
Showing with 7,540 additions and 6 deletions.
  1. +1 −2 Gemfile
  2. +0 −2 Gemfile.lock
  3. +4 −2 views/stylesheets/application.sass
  4. BIN views/vendor/images/glyphicons-halflings-white.png
  5. BIN views/vendor/images/glyphicons-halflings.png
  6. +104 −0 views/vendor/javascripts/bootstrap-affix.js
  7. +90 −0 views/vendor/javascripts/bootstrap-alert.js
  8. +96 −0 views/vendor/javascripts/bootstrap-button.js
  9. +176 −0 views/vendor/javascripts/bootstrap-carousel.js
  10. +158 −0 views/vendor/javascripts/bootstrap-collapse.js
  11. +150 −0 views/vendor/javascripts/bootstrap-dropdown.js
  12. +239 −0 views/vendor/javascripts/bootstrap-modal.js
  13. +103 −0 views/vendor/javascripts/bootstrap-popover.js
  14. +151 −0 views/vendor/javascripts/bootstrap-scrollspy.js
  15. +135 −0 views/vendor/javascripts/bootstrap-tab.js
  16. +275 −0 views/vendor/javascripts/bootstrap-tooltip.js
  17. +60 −0 views/vendor/javascripts/bootstrap-transition.js
  18. +300 −0 views/vendor/javascripts/bootstrap-typeahead.js
  19. +13 −0 views/vendor/javascripts/bootstrap.js
  20. +42 −0 views/vendor/stylesheets/_bootstrap-responsive.scss
  21. +62 −0 views/vendor/stylesheets/_bootstrap.scss
  22. +34 −0 views/vendor/stylesheets/bootstrap/_accordion.scss
  23. +65 −0 views/vendor/stylesheets/bootstrap/_alerts.scss
  24. +24 −0 views/vendor/stylesheets/bootstrap/_breadcrumbs.scss
  25. +244 −0 views/vendor/stylesheets/bootstrap/_button-groups.scss
  26. +211 −0 views/vendor/stylesheets/bootstrap/_buttons.scss
  27. +131 −0 views/vendor/stylesheets/bootstrap/_carousel.scss
  28. +31 −0 views/vendor/stylesheets/bootstrap/_close.scss
  29. +58 −0 views/vendor/stylesheets/bootstrap/_code.scss
  30. +23 −0 views/vendor/stylesheets/bootstrap/_component-animations.scss
  31. +210 −0 views/vendor/stylesheets/bootstrap/_dropdowns.scss
  32. +635 −0 views/vendor/stylesheets/bootstrap/_forms.scss
  33. +20 −0 views/vendor/stylesheets/bootstrap/_grid.scss
  34. +24 −0 views/vendor/stylesheets/bootstrap/_hero-unit.scss
  35. +70 −0 views/vendor/stylesheets/bootstrap/_labels-badges.scss
  36. +16 −0 views/vendor/stylesheets/bootstrap/_layouts.scss
  37. +634 −0 views/vendor/stylesheets/bootstrap/_mixins.scss
  38. +97 −0 views/vendor/stylesheets/bootstrap/_modals.scss
  39. +466 −0 views/vendor/stylesheets/bootstrap/_navbar.scss
  40. +384 −0 views/vendor/stylesheets/bootstrap/_navs.scss
  41. +37 −0 views/vendor/stylesheets/bootstrap/_pager.scss
  42. +64 −0 views/vendor/stylesheets/bootstrap/_pagination.scss
  43. +117 −0 views/vendor/stylesheets/bootstrap/_popovers.scss
  44. +122 −0 views/vendor/stylesheets/bootstrap/_progress-bars.scss
  45. +134 −0 views/vendor/stylesheets/bootstrap/_reset.scss
  46. +28 −0 views/vendor/stylesheets/bootstrap/_responsive-1200px-min.scss
  47. +167 −0 views/vendor/stylesheets/bootstrap/_responsive-767px-max.scss
  48. +19 −0 views/vendor/stylesheets/bootstrap/_responsive-768px-979px.scss
  49. +164 −0 views/vendor/stylesheets/bootstrap/_responsive-navbar.scss
  50. +43 −0 views/vendor/stylesheets/bootstrap/_responsive-utilities.scss
  51. +51 −0 views/vendor/stylesheets/bootstrap/_scaffolding.scss
  52. +187 −0 views/vendor/stylesheets/bootstrap/_sprites.scss
  53. +207 −0 views/vendor/stylesheets/bootstrap/_tables.scss
  54. +52 −0 views/vendor/stylesheets/bootstrap/_thumbnails.scss
  55. +70 −0 views/vendor/stylesheets/bootstrap/_tooltip.scss
  56. +206 −0 views/vendor/stylesheets/bootstrap/_type.scss
  57. +30 −0 views/vendor/stylesheets/bootstrap/_utilities.scss
  58. +277 −0 views/vendor/stylesheets/bootstrap/_variables.scss
  59. +29 −0 views/vendor/stylesheets/bootstrap/_wells.scss
  60. 0 views/{vender → vendor}/stylesheets/font-awesome.sass
  61. 0 views/{vender → vendor}/stylesheets/yui_fonts.sass
View
@@ -11,5 +11,4 @@ gem 'compass', '~> 0.12.2'
# Sass libraries
gem 'grid-coordinates', '~> 1.1.4'
-gem 'sassy-buttons'
-gem 'bootstrap-sass'
+gem 'sassy-buttons'
View
@@ -1,7 +1,6 @@
GEM
remote: http://rubygems.org/
specs:
- bootstrap-sass (2.1.0.0)
chunky_png (1.2.6)
compass (0.12.2)
chunky_png (~> 1.2)
@@ -31,7 +30,6 @@ PLATFORMS
ruby
DEPENDENCIES
- bootstrap-sass
compass (~> 0.12.2)
grid-coordinates (~> 1.1.4)
haml (~> 3.1)
@@ -1,9 +1,11 @@
@import compass/reset
@import compass/utilities
@import compass/css3
-@import ../vender/stylesheets/yui_fonts
-@import ../vender/stylesheets/font-awesome
+@import ../vendor/stylesheets/yui_fonts
+@import ../vendor/stylesheets/font-awesome
@import sassy-buttons
+@import ../vendor/stylesheets/bootstrap
+@import ../vendor/stylesheets/bootstrap-responsive
// Links
a
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,104 @@
+/* ==========================================================
+ * bootstrap-affix.js v2.1.0
+ * http://twitter.github.com/bootstrap/javascript.html#affix
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* AFFIX CLASS DEFINITION
+ * ====================== */
+
+ var Affix = function (element, options) {
+ this.options = $.extend({}, $.fn.affix.defaults, options)
+ this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
+ this.$element = $(element)
+ this.checkPosition()
+ }
+
+ Affix.prototype.checkPosition = function () {
+ if (!this.$element.is(':visible')) return
+
+ var scrollHeight = $(document).height()
+ , scrollTop = this.$window.scrollTop()
+ , position = this.$element.offset()
+ , offset = this.options.offset
+ , offsetBottom = offset.bottom
+ , offsetTop = offset.top
+ , reset = 'affix affix-top affix-bottom'
+ , affix
+
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
+ if (typeof offsetTop == 'function') offsetTop = offset.top()
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
+
+ affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
+ false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
+ 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
+ 'top' : false
+
+ if (this.affixed === affix) return
+
+ this.affixed = affix
+ this.unpin = affix == 'bottom' ? position.top - scrollTop : null
+
+ this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
+ }
+
+
+ /* AFFIX PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.affix = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('affix')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('affix', (data = new Affix(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.affix.Constructor = Affix
+
+ $.fn.affix.defaults = {
+ offset: 0
+ }
+
+
+ /* AFFIX DATA-API
+ * ============== */
+
+ $(window).on('load', function () {
+ $('[data-spy="affix"]').each(function () {
+ var $spy = $(this)
+ , data = $spy.data()
+
+ data.offset = data.offset || {}
+
+ data.offsetBottom && (data.offset.bottom = data.offsetBottom)
+ data.offsetTop && (data.offset.top = data.offsetTop)
+
+ $spy.affix(data)
+ })
+ })
+
+
+}(window.jQuery);
@@ -0,0 +1,90 @@
+/* ==========================================================
+ * bootstrap-alert.js v2.1.0
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* ALERT CLASS DEFINITION
+ * ====================== */
+
+ var dismiss = '[data-dismiss="alert"]'
+ , Alert = function (el) {
+ $(el).on('click', dismiss, this.close)
+ }
+
+ Alert.prototype.close = function (e) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
+
+ e && e.preventDefault()
+
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+
+ $parent.trigger(e = $.Event('close'))
+
+ if (e.isDefaultPrevented()) return
+
+ $parent.removeClass('in')
+
+ function removeElement() {
+ $parent
+ .trigger('closed')
+ .remove()
+ }
+
+ $.support.transition && $parent.hasClass('fade') ?
+ $parent.on($.support.transition.end, removeElement) :
+ removeElement()
+ }
+
+
+ /* ALERT PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.alert = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('alert')
+ if (!data) $this.data('alert', (data = new Alert(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ $.fn.alert.Constructor = Alert
+
+
+ /* ALERT DATA-API
+ * ============== */
+
+ $(function () {
+ $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
+ })
+
+}(window.jQuery);
@@ -0,0 +1,96 @@
+/* ============================================================
+ * bootstrap-button.js v2.1.0
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* BUTTON PUBLIC CLASS DEFINITION
+ * ============================== */
+
+ var Button = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.button.defaults, options)
+ }
+
+ Button.prototype.setState = function (state) {
+ var d = 'disabled'
+ , $el = this.$element
+ , data = $el.data()
+ , val = $el.is('input') ? 'val' : 'html'
+
+ state = state + 'Text'
+ data.resetText || $el.data('resetText', $el[val]())
+
+ $el[val](data[state] || this.options[state])
+
+ // push to event loop to allow forms to submit
+ setTimeout(function () {
+ state == 'loadingText' ?
+ $el.addClass(d).attr(d, d) :
+ $el.removeClass(d).removeAttr(d)
+ }, 0)
+ }
+
+ Button.prototype.toggle = function () {
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
+
+ $parent && $parent
+ .find('.active')
+ .removeClass('active')
+
+ this.$element.toggleClass('active')
+ }
+
+
+ /* BUTTON PLUGIN DEFINITION
+ * ======================== */
+
+ $.fn.button = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('button')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('button', (data = new Button(this, options)))
+ if (option == 'toggle') data.toggle()
+ else if (option) data.setState(option)
+ })
+ }
+
+ $.fn.button.defaults = {
+ loadingText: 'loading...'
+ }
+
+ $.fn.button.Constructor = Button
+
+
+ /* BUTTON DATA-API
+ * =============== */
+
+ $(function () {
+ $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
+ var $btn = $(e.target)
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+ $btn.button('toggle')
+ })
+ })
+
+}(window.jQuery);
Oops, something went wrong.

0 comments on commit b7d26a9

Please sign in to comment.