bootstrap-tabdrop-rails 0.0.1

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.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmJmYWRjODZhYjAyMGU4N2U1MzYyNzFiNWVkODhiNzY4Y2ZmODc1OQ==
5
+ data.tar.gz: !binary |-
6
+ NjNhZDE3ZmJlOTBmZjgxZjRlMDdkOWQxNTQ3ZGJjZTQ3YzgyMTZiMg==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YjRmOGQyNjgzODZmYjBiYTk3ZDgzNzM2MjRkZjM5NTU0YTA1YzIyYTBkOWIz
10
+ YTgzMzRmZmQzZjIxOGI1NDNkNGZmMTYxOThhZDE5NTg4ZGJjNDk4YzAxYmEw
11
+ MGVhZTE3NGQ4OGEzYWVmMWU4YjQ2MTIwMWQxNzE0M2M1NWRiMTU=
12
+ data.tar.gz: !binary |-
13
+ MTAzYTZkZTIyODg2MDFiZTVmM2Q4MTRlYTM3YjRlOTZhMmI5MDI3ZGY4MTg3
14
+ OGFhMTI3ZjU1ZGIxOTNhYWRhZTA3Y2Q2OWRlY2U3ZGIwOTE4MjhiZTRmZDYx
15
+ YWY1YzRjOTY0YTVjNGI5NzIwMDJhNDk3YWNiN2Y4ODY0NGUwYTY=
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Thomas Floyd Wright
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,13 @@
1
+ # bootstrap-tabdrop-rails
2
+
3
+ bootstrap-tabdrop-rails wraps the [bootstrap-tabdrop.js](http://www.eyecon.ro/bootstrap-tabdrop/) library in a rails engine for simple use with the Rails asset pipeline. The gem includes the development (non-minified) source for ease of exploration. The asset pipeline will minify in production.
4
+
5
+ ## Installation
6
+
7
+ Add the following to your gemfile:
8
+
9
+ gem 'bootstrap-tabdrop-rails'
10
+
11
+ Add the following directive to your Javascript manifest file (application.js):
12
+
13
+ //= require bootstrap-tabdrop
@@ -0,0 +1,10 @@
1
+ require "bootstrap/tabdrop/rails/version"
2
+
3
+ module Bootstrap
4
+ module Tabdrop
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ module Bootstrap
2
+ module Tabdrop
3
+ module Rails
4
+ VERSION = "0.0.1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,117 @@
1
+ /* =========================================================
2
+ * bootstrap-tabdrop.js
3
+ * http://www.eyecon.ro/bootstrap-tabdrop
4
+ * =========================================================
5
+ * Copyright 2012 Stefan Petre
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
+ !function( $ ) {
21
+
22
+ var WinReszier = (function(){
23
+ var registered = [];
24
+ var inited = false;
25
+ var timer;
26
+ var resize = function(ev) {
27
+ clearTimeout(timer);
28
+ timer = setTimeout(notify, 100);
29
+ };
30
+ var notify = function() {
31
+ for(var i=0, cnt=registered.length; i<cnt; i++) {
32
+ registered[i].apply();
33
+ }
34
+ };
35
+ return {
36
+ register: function(fn) {
37
+ registered.push(fn);
38
+ if (inited === false) {
39
+ $(window).bind('resize', resize);
40
+ inited = true;
41
+ }
42
+ },
43
+ unregister: function(fn) {
44
+ for(var i=0, cnt=registered.length; i<cnt; i++) {
45
+ if (registered[i] == fn) {
46
+ delete registered[i];
47
+ break;
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }());
53
+
54
+ var TabDrop = function(element, options) {
55
+ this.element = $(element);
56
+ this.dropdown = $('<li class="dropdown hide pull-right tabdrop"><a class="dropdown-toggle" data-toggle="dropdown" href="#">'+options.text+' <b class="caret"></b></a><ul class="dropdown-menu"></ul></li>')
57
+ .prependTo(this.element);
58
+ if (this.element.parent().is('.tabs-below')) {
59
+ this.dropdown.addClass('dropup');
60
+ }
61
+ WinReszier.register($.proxy(this.layout, this));
62
+ this.layout();
63
+ };
64
+
65
+ TabDrop.prototype = {
66
+ constructor: TabDrop,
67
+
68
+ layout: function() {
69
+ var collection = [];
70
+ this.dropdown.removeClass('hide');
71
+ this.element
72
+ .append(this.dropdown.find('li'))
73
+ .find('>li')
74
+ .not('.tabdrop')
75
+ .each(function(){
76
+ if(this.offsetTop > 0) {
77
+ collection.push(this);
78
+ }
79
+ });
80
+ if (collection.length > 0) {
81
+ collection = $(collection);
82
+ this.dropdown
83
+ .find('ul')
84
+ .empty()
85
+ .append(collection);
86
+ if (this.dropdown.find('.active').length == 1) {
87
+ this.dropdown.addClass('active');
88
+ } else {
89
+ this.dropdown.removeClass('active');
90
+ }
91
+ } else {
92
+ this.dropdown.addClass('hide');
93
+ }
94
+ }
95
+ }
96
+
97
+ $.fn.tabdrop = function ( option ) {
98
+ return this.each(function () {
99
+ var $this = $(this),
100
+ data = $this.data('tabdrop'),
101
+ options = typeof option === 'object' && option;
102
+ if (!data) {
103
+ $this.data('tabdrop', (data = new TabDrop(this, $.extend({}, $.fn.tabdrop.defaults,options))));
104
+ }
105
+ if (typeof option == 'string') {
106
+ data[option]();
107
+ }
108
+ })
109
+ };
110
+
111
+ $.fn.tabdrop.defaults = {
112
+ text: '<i class="icon-align-justify"></i>'
113
+ };
114
+
115
+ $.fn.tabdrop.Constructor = TabDrop;
116
+
117
+ }( window.jQuery );
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * Tab drop for Bootstrap
3
+ *
4
+ * Copyright 2012 Stefan Petre
5
+ * Licensed under the Apache License v2.0
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ *
8
+ */
9
+ .nav-tabs,
10
+ .nav-pills {
11
+ position: relative;
12
+ }
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bootstrap-tabdrop-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Thomas Floyd Wright
8
+ - Stefan Petre
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-04-20 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: '1.3'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: '1.3'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: railties
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ~>
47
+ - !ruby/object:Gem::Version
48
+ version: '4'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '4'
56
+ description: bootstrap-tabdrop plugin packaged as a Rails engine
57
+ email:
58
+ - tfwright@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - lib/bootstrap/tabdrop/rails/version.rb
64
+ - lib/bootstrap/tabdrop/rails.rb
65
+ - vendor/assets/javascripts/bootstrap-tabdrop.js
66
+ - vendor/assets/stylesheets/tabdrop.css
67
+ - LICENSE.txt
68
+ - README.md
69
+ homepage: http://github.com/tfwright/bootstrap-tabdrop-rails
70
+ licenses:
71
+ - MIT
72
+ metadata: {}
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubyforge_project:
89
+ rubygems_version: 2.1.0
90
+ signing_key:
91
+ specification_version: 4
92
+ summary: bootstrap-tabdrop plugin packaged as a Rails engine
93
+ test_files: []
94
+ has_rdoc: