dj_mon 0.0.3 → 0.0.4

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.
@@ -1,5 +1,5 @@
1
- //= require bootstrap-tab
2
- //= require mustache
1
+ //= require dj_mon_bootstrap_tab
2
+ //= require dj_mon_mustache
3
3
 
4
4
  $(function(){
5
5
 
@@ -0,0 +1,136 @@
1
+ /* ========================================================
2
+ * bootstrap-tab.js v2.0.3
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
+
22
+ !function ($) {
23
+
24
+ "use strict"; // jshint ;_;
25
+
26
+
27
+ /* TAB CLASS DEFINITION
28
+ * ==================== */
29
+
30
+ var Tab = function ( element ) {
31
+ this.element = $(element)
32
+ }
33
+
34
+ Tab.prototype = {
35
+
36
+ constructor: Tab
37
+
38
+ , show: function () {
39
+ var $this = this.element
40
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
41
+ , selector = $this.attr('data-target')
42
+ , previous
43
+ , $target
44
+ , e
45
+
46
+ if (!selector) {
47
+ selector = $this.attr('href')
48
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
49
+ }
50
+
51
+ if ( $this.parent('li').hasClass('active') ) return
52
+
53
+ previous = $ul.find('.active a').last()[0]
54
+
55
+ e = $.Event('show', {
56
+ relatedTarget: previous
57
+ })
58
+
59
+ $this.trigger(e)
60
+
61
+ if (e.isDefaultPrevented()) return
62
+
63
+ $target = $(selector)
64
+
65
+ this.activate($this.parent('li'), $ul)
66
+ this.activate($target, $target.parent(), function () {
67
+ $this.trigger({
68
+ type: 'shown'
69
+ , relatedTarget: previous
70
+ })
71
+ })
72
+ }
73
+
74
+ , activate: function ( element, container, callback) {
75
+ var $active = container.find('> .active')
76
+ , transition = callback
77
+ && $.support.transition
78
+ && $active.hasClass('fade')
79
+
80
+ function next() {
81
+ $active
82
+ .removeClass('active')
83
+ .find('> .dropdown-menu > .active')
84
+ .removeClass('active')
85
+
86
+ element.addClass('active')
87
+
88
+ if (transition) {
89
+ element[0].offsetWidth // reflow for transition
90
+ element.addClass('in')
91
+ } else {
92
+ element.removeClass('fade')
93
+ }
94
+
95
+ if ( element.parent('.dropdown-menu') ) {
96
+ element.closest('li.dropdown').addClass('active')
97
+ }
98
+
99
+ callback && callback()
100
+ }
101
+
102
+ transition ?
103
+ $active.one($.support.transition.end, next) :
104
+ next()
105
+
106
+ $active.removeClass('in')
107
+ }
108
+ }
109
+
110
+
111
+ /* TAB PLUGIN DEFINITION
112
+ * ===================== */
113
+
114
+ $.fn.tab = function ( option ) {
115
+ return this.each(function () {
116
+ var $this = $(this)
117
+ , data = $this.data('tab')
118
+ if (!data) $this.data('tab', (data = new Tab(this)))
119
+ if (typeof option == 'string') data[option]()
120
+ })
121
+ }
122
+
123
+ $.fn.tab.Constructor = Tab
124
+
125
+
126
+ /* TAB DATA-API
127
+ * ============ */
128
+
129
+ $(function () {
130
+ $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
131
+ e.preventDefault()
132
+ $(this).tab('show')
133
+ })
134
+ })
135
+
136
+ }(window.jQuery);
@@ -1,4 +1,4 @@
1
- /*= require 'bootstrap' */
1
+ /*= require 'dj_mon_bootstrap' */
2
2
 
3
3
  body {
4
4
  padding: 90px;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dj_mon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-29 00:00:00.000000000 Z
12
+ date: 2012-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -51,9 +51,10 @@ extensions: []
51
51
  extra_rdoc_files: []
52
52
  files:
53
53
  - app/assets/javascripts/dj_mon.js
54
- - app/assets/javascripts/mustache.js
55
- - app/assets/stylesheets/bootstrap.css
54
+ - app/assets/javascripts/dj_mon_bootstrap_tab.js
55
+ - app/assets/javascripts/dj_mon_mustache.js
56
56
  - app/assets/stylesheets/dj_mon.css
57
+ - app/assets/stylesheets/dj_mon_bootstrap.css
57
58
  - app/controllers/dj_mon/dj_reports_controller.rb
58
59
  - app/models/dj_mon/dj_report.rb
59
60
  - app/views/dj_mon/dj_reports/index.html.haml