twitter_bootstrap_sass 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. data/.gitignore +4 -0
  2. data/CHANGELOG.md +8 -0
  3. data/Gemfile +4 -0
  4. data/Rakefile +1 -0
  5. data/lib/twitter_bootstrap_sass.rb +9 -0
  6. data/lib/twitter_bootstrap_sass/engine.rb +5 -0
  7. data/lib/twitter_bootstrap_sass/sass_extensions.rb +6 -0
  8. data/lib/twitter_bootstrap_sass/sass_extensions/functions.rb +13 -0
  9. data/lib/twitter_bootstrap_sass/sass_extensions/functions/compact.rb +13 -0
  10. data/lib/twitter_bootstrap_sass/version.rb +3 -0
  11. data/twitter_bootstrap_sass.gemspec +25 -0
  12. data/vendor/assets/javascripts/bootstrap-alerts.js +111 -0
  13. data/vendor/assets/javascripts/bootstrap-dropdown.js +53 -0
  14. data/vendor/assets/javascripts/bootstrap-modal.js +244 -0
  15. data/vendor/assets/javascripts/bootstrap-popover.js +77 -0
  16. data/vendor/assets/javascripts/bootstrap-scrollspy.js +105 -0
  17. data/vendor/assets/javascripts/bootstrap-tabs.js +77 -0
  18. data/vendor/assets/javascripts/bootstrap-twipsy.js +303 -0
  19. data/vendor/assets/stylesheets/_twitter_bootstrap_sass.scss +26 -0
  20. data/vendor/assets/stylesheets/twitter_bootstrap_sass/_forms.scss +465 -0
  21. data/vendor/assets/stylesheets/twitter_bootstrap_sass/_mixins.scss +219 -0
  22. data/vendor/assets/stylesheets/twitter_bootstrap_sass/_patterns.scss +1003 -0
  23. data/vendor/assets/stylesheets/twitter_bootstrap_sass/_reset.scss +141 -0
  24. data/vendor/assets/stylesheets/twitter_bootstrap_sass/_scaffolding.scss +135 -0
  25. data/vendor/assets/stylesheets/twitter_bootstrap_sass/_tables.scss +171 -0
  26. data/vendor/assets/stylesheets/twitter_bootstrap_sass/_type.scss +187 -0
  27. data/vendor/assets/stylesheets/twitter_bootstrap_sass/_variables.scss +60 -0
  28. metadata +85 -0
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ ## v0.0.1
2
+
3
+ * initial release
4
+
5
+ ## v0.0.2
6
+
7
+ * Rename the 'app' folder 'vendor' since this is more technically
8
+ correct.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in twitter_bootstrap_sass.gemspec
4
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,9 @@
1
+ module TwitterBootstrapSass
2
+ if defined?(Rails)
3
+ class Engine < ::Rails::Engine
4
+ require 'twitter_bootstrap_sass/engine'
5
+ end
6
+ end
7
+ end
8
+
9
+ require File.join(File.dirname(__FILE__), "/twitter_bootstrap_sass/sass_extensions")
@@ -0,0 +1,5 @@
1
+ module TwitterBootstrapSass
2
+ class Engine < Rails::Engine
3
+ # auto wire
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module TwitterBootstrapSass::SassExtensions
2
+ end
3
+
4
+ require "sass"
5
+
6
+ require File.join(File.dirname(__FILE__), "/sass_extensions/functions")
@@ -0,0 +1,13 @@
1
+ module TwitterBootstrapSass::SassExtensions::Functions
2
+ end
3
+
4
+ require File.join(File.dirname(__FILE__), "/functions/compact")
5
+
6
+ module Sass::Script::Functions
7
+ include TwitterBootstrapSass::SassExtensions::Functions::Compact
8
+ end
9
+
10
+ # Wierd that this has to be re-included to pick up sub-modules. Ruby bug?
11
+ class Sass::Script::Functions::EvaluationContext
12
+ include Sass::Script::Functions
13
+ end
@@ -0,0 +1,13 @@
1
+ # Compact function pulled from compass
2
+ module TwitterBootstrapSass::SassExtensions::Functions::Compact
3
+
4
+ def compact(*args)
5
+ sep = :comma
6
+ if args.size == 1 && args.first.is_a?(Sass::Script::List)
7
+ args = args.first.value
8
+ sep = args.first.separator
9
+ end
10
+ Sass::Script::List.new(args.reject{|a| !a.to_bool}, sep)
11
+ end
12
+
13
+ end
@@ -0,0 +1,3 @@
1
+ module TwitterBootstrapSass
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,25 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "twitter_bootstrap_sass/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "twitter_bootstrap_sass"
7
+ s.version = TwitterBootstrapSass::VERSION
8
+ s.authors = ["Joseph DelCioppio"]
9
+ s.email = ["Joseph.DelCioppio@gmail.com"]
10
+ s.homepage = "https://github.com/thedelchop/twitter_bootstrap_sass"
11
+ s.summary = %q{This gem is meant to be a simple port of Twitter Bootsrap into SCSS, with more semantic use of the grid system}
12
+ s.description = %q{To use this gem, simply import 'twitter-bootstrap-sass' into your scss stylesheet.}
13
+
14
+ s.rubyforge_project = "twitter_bootstrap_sass"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency('sass', '>= 3.1')
22
+ # specify any dependencies here; for example:
23
+ # s.add_development_dependency "rspec"
24
+ # s.add_runtime_dependency "rest-client"
25
+ end
@@ -0,0 +1,111 @@
1
+ /* ==========================================================
2
+ * bootstrap-alerts.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
4
+ * ==========================================================
5
+ * Copyright 2011 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
+ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
24
+ * ======================================================= */
25
+
26
+ var transitionEnd
27
+
28
+ $(document).ready(function () {
29
+
30
+ $.support.transition = (function () {
31
+ var thisBody = document.body || document.documentElement
32
+ , thisStyle = thisBody.style
33
+ , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
34
+ return support
35
+ })()
36
+
37
+ // set CSS transition event type
38
+ if ( $.support.transition ) {
39
+ transitionEnd = "TransitionEnd"
40
+ if ( $.browser.webkit ) {
41
+ transitionEnd = "webkitTransitionEnd"
42
+ } else if ( $.browser.mozilla ) {
43
+ transitionEnd = "transitionend"
44
+ } else if ( $.browser.opera ) {
45
+ transitionEnd = "oTransitionEnd"
46
+ }
47
+ }
48
+
49
+ })
50
+
51
+ /* ALERT CLASS DEFINITION
52
+ * ====================== */
53
+
54
+ var Alert = function ( content, options ) {
55
+ this.settings = $.extend({}, $.fn.alert.defaults, options)
56
+ this.$element = $(content)
57
+ .delegate(this.settings.selector, 'click', this.close)
58
+ }
59
+
60
+ Alert.prototype = {
61
+
62
+ close: function (e) {
63
+ var $element = $(this).parent('.alert-message')
64
+
65
+ e && e.preventDefault()
66
+ $element.removeClass('in')
67
+
68
+ function removeElement () {
69
+ $element.remove()
70
+ }
71
+
72
+ $.support.transition && $element.hasClass('fade') ?
73
+ $element.bind(transitionEnd, removeElement) :
74
+ removeElement()
75
+ }
76
+
77
+ }
78
+
79
+
80
+ /* ALERT PLUGIN DEFINITION
81
+ * ======================= */
82
+
83
+ $.fn.alert = function ( options ) {
84
+
85
+ if ( options === true ) {
86
+ return this.data('alert')
87
+ }
88
+
89
+ return this.each(function () {
90
+ var $this = $(this)
91
+
92
+ if ( typeof options == 'string' ) {
93
+ return $this.data('alert')[options]()
94
+ }
95
+
96
+ $(this).data('alert', new Alert( this, options ))
97
+
98
+ })
99
+ }
100
+
101
+ $.fn.alert.defaults = {
102
+ selector: '.close'
103
+ }
104
+
105
+ $(document).ready(function () {
106
+ new Alert($('body'), {
107
+ selector: '.alert-message[data-alert] .close'
108
+ })
109
+ })
110
+
111
+ }( window.jQuery || window.ender );
@@ -0,0 +1,53 @@
1
+ /* ============================================================
2
+ * bootstrap-dropdown.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#dropdown
4
+ * ============================================================
5
+ * Copyright 2011 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
+ /* DROPDOWN PLUGIN DEFINITION
24
+ * ========================== */
25
+
26
+ $.fn.dropdown = function ( selector ) {
27
+ return this.each(function () {
28
+ $(this).delegate(selector || d, 'click', function (e) {
29
+ var li = $(this).parent('li')
30
+ , isActive = li.hasClass('open')
31
+
32
+ clearMenus()
33
+ !isActive && li.toggleClass('open')
34
+ return false
35
+ })
36
+ })
37
+ }
38
+
39
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
40
+ * =================================== */
41
+
42
+ var d = 'a.menu, .dropdown-toggle'
43
+
44
+ function clearMenus() {
45
+ $(d).parent('li').removeClass('open')
46
+ }
47
+
48
+ $(function () {
49
+ $('html').bind("click", clearMenus)
50
+ $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
51
+ })
52
+
53
+ }( window.jQuery || window.ender );
@@ -0,0 +1,244 @@
1
+ /* =========================================================
2
+ * bootstrap-modal.js v1.3.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#modal
4
+ * =========================================================
5
+ * Copyright 2011 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
+ /* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
24
+ * ======================================================= */
25
+
26
+ var transitionEnd
27
+
28
+ $(document).ready(function () {
29
+
30
+ $.support.transition = (function () {
31
+ var thisBody = document.body || document.documentElement
32
+ , thisStyle = thisBody.style
33
+ , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined
34
+ return support
35
+ })()
36
+
37
+ // set CSS transition event type
38
+ if ( $.support.transition ) {
39
+ transitionEnd = "TransitionEnd"
40
+ if ( $.browser.webkit ) {
41
+ transitionEnd = "webkitTransitionEnd"
42
+ } else if ( $.browser.mozilla ) {
43
+ transitionEnd = "transitionend"
44
+ } else if ( $.browser.opera ) {
45
+ transitionEnd = "oTransitionEnd"
46
+ }
47
+ }
48
+
49
+ })
50
+
51
+
52
+ /* MODAL PUBLIC CLASS DEFINITION
53
+ * ============================= */
54
+
55
+ var Modal = function ( content, options ) {
56
+ this.settings = $.extend({}, $.fn.modal.defaults, options)
57
+ this.$element = $(content)
58
+ .delegate('.close', 'click.modal', $.proxy(this.hide, this))
59
+
60
+ if ( this.settings.show ) {
61
+ this.show()
62
+ }
63
+
64
+ return this
65
+ }
66
+
67
+ Modal.prototype = {
68
+
69
+ toggle: function () {
70
+ return this[!this.isShown ? 'show' : 'hide']()
71
+ }
72
+
73
+ , show: function () {
74
+ var that = this
75
+ this.isShown = true
76
+ this.$element.trigger('show')
77
+
78
+ escape.call(this)
79
+ backdrop.call(this, function () {
80
+ var transition = $.support.transition && that.$element.hasClass('fade')
81
+
82
+ that.$element
83
+ .appendTo(document.body)
84
+ .show()
85
+
86
+ if (transition) {
87
+ that.$element[0].offsetWidth // force reflow
88
+ }
89
+
90
+ that.$element
91
+ .addClass('in')
92
+
93
+ transition ?
94
+ that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
95
+ that.$element.trigger('shown')
96
+
97
+ })
98
+
99
+ return this
100
+ }
101
+
102
+ , hide: function (e) {
103
+ e && e.preventDefault()
104
+
105
+ if ( !this.isShown ) {
106
+ return this
107
+ }
108
+
109
+ var that = this
110
+ this.isShown = false
111
+
112
+ escape.call(this)
113
+
114
+ this.$element
115
+ .trigger('hide')
116
+ .removeClass('in')
117
+
118
+ function removeElement () {
119
+ that.$element
120
+ .hide()
121
+ .trigger('hidden')
122
+
123
+ backdrop.call(that)
124
+ }
125
+
126
+ $.support.transition && this.$element.hasClass('fade') ?
127
+ this.$element.one(transitionEnd, removeElement) :
128
+ removeElement()
129
+
130
+ return this
131
+ }
132
+
133
+ }
134
+
135
+
136
+ /* MODAL PRIVATE METHODS
137
+ * ===================== */
138
+
139
+ function backdrop ( callback ) {
140
+ var that = this
141
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
142
+ if ( this.isShown && this.settings.backdrop ) {
143
+ var doAnimate = $.support.transition && animate
144
+
145
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
146
+ .appendTo(document.body)
147
+
148
+ if ( this.settings.backdrop != 'static' ) {
149
+ this.$backdrop.click($.proxy(this.hide, this))
150
+ }
151
+
152
+ if ( doAnimate ) {
153
+ this.$backdrop[0].offsetWidth // force reflow
154
+ }
155
+
156
+ this.$backdrop.addClass('in')
157
+
158
+ doAnimate ?
159
+ this.$backdrop.one(transitionEnd, callback) :
160
+ callback()
161
+
162
+ } else if ( !this.isShown && this.$backdrop ) {
163
+ this.$backdrop.removeClass('in')
164
+
165
+ function removeElement() {
166
+ that.$backdrop.remove()
167
+ that.$backdrop = null
168
+ }
169
+
170
+ $.support.transition && this.$element.hasClass('fade')?
171
+ this.$backdrop.one(transitionEnd, removeElement) :
172
+ removeElement()
173
+ } else if ( callback ) {
174
+ callback()
175
+ }
176
+ }
177
+
178
+ function escape() {
179
+ var that = this
180
+ if ( this.isShown && this.settings.keyboard ) {
181
+ $(document).bind('keyup.modal', function ( e ) {
182
+ if ( e.which == 27 ) {
183
+ that.hide()
184
+ }
185
+ })
186
+ } else if ( !this.isShown ) {
187
+ $(document).unbind('keyup.modal')
188
+ }
189
+ }
190
+
191
+
192
+ /* MODAL PLUGIN DEFINITION
193
+ * ======================= */
194
+
195
+ $.fn.modal = function ( options ) {
196
+ var modal = this.data('modal')
197
+
198
+ if (!modal) {
199
+
200
+ if (typeof options == 'string') {
201
+ options = {
202
+ show: /show|toggle/.test(options)
203
+ }
204
+ }
205
+
206
+ return this.each(function () {
207
+ $(this).data('modal', new Modal(this, options))
208
+ })
209
+ }
210
+
211
+ if ( options === true ) {
212
+ return modal
213
+ }
214
+
215
+ if ( typeof options == 'string' ) {
216
+ modal[options]()
217
+ } else if ( modal ) {
218
+ modal.toggle()
219
+ }
220
+
221
+ return this
222
+ }
223
+
224
+ $.fn.modal.Modal = Modal
225
+
226
+ $.fn.modal.defaults = {
227
+ backdrop: false
228
+ , keyboard: false
229
+ , show: false
230
+ }
231
+
232
+
233
+ /* MODAL DATA- IMPLEMENTATION
234
+ * ========================== */
235
+
236
+ $(document).ready(function () {
237
+ $('body').delegate('[data-controls-modal]', 'click', function (e) {
238
+ e.preventDefault()
239
+ var $this = $(this).data('show', true)
240
+ $('#' + $this.attr('data-controls-modal')).modal( $this.data() )
241
+ })
242
+ })
243
+
244
+ }( window.jQuery || window.ender );