glimpse-performance_bar 1.1.0 → 1.1.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.
@@ -4,4 +4,13 @@
4
4
 
5
5
  # 1.1.0
6
6
 
7
- - Add support for Turbolinks.
7
+ - Add support for Turbolinks. (#2)
8
+
9
+ # 1.1.1
10
+
11
+ - Remove HTML from tooltips to remove any text artifacts. (#4)
12
+
13
+ # 1.1.2
14
+
15
+ - Namespace the tooltips to not conflict with application styles. (#8)
16
+ - Don't render the performance bar when `window.performance` doesn't exist. (#10)
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Provide a glimpse into `window.performance` timing.
4
4
 
5
+ ![image](https://f.cloud.github.com/assets/79995/268624/14d9df90-8f47-11e2-9718-111c7c367974.png)
6
+
5
7
  Things this glimpse view provides:
6
8
 
7
9
  - Frontend
@@ -29,7 +29,7 @@ class PerformanceBar
29
29
  # Create a new PerformanceBar view bound to a given element. The el and width
30
30
  # options should be provided here.
31
31
  constructor: (options={}) ->
32
- @el = $('.performance-bar')
32
+ @el = $('#glimpse-view-performance-bar .performance-bar')
33
33
  @[k] = v for k, v of options
34
34
  @width ?= @el.width()
35
35
  @timing ?= window.performance.timing
@@ -94,15 +94,13 @@ class PerformanceBar
94
94
  left = @mapH(offset)
95
95
  width = @mapH(time)
96
96
 
97
- bar = $("<li class='tooltip'>#{name}</li>")
98
97
  title = "#{name}: #{PerformanceBar.formatTime(time)}"
99
- title += "\n\n#{info}".replace(/\n/g, '<br/>') if info
100
- bar.attr 'title', title
98
+ bar = $ '<li></li>', title: title, class: 'glimpse-tooltip'
101
99
  bar.css
102
100
  width: "#{width}px"
103
101
  left: "#{left}px"
104
102
  background: color
105
- bar.tipsy gravity: 'n', html: true
103
+ bar.tipsy gravity: 'n'
106
104
  @el.append bar
107
105
 
108
106
  # Map a time offset value to a horizontal pixel offset.
@@ -116,7 +114,7 @@ renderPerformanceBar = ->
116
114
  bar = new PerformanceBar
117
115
  bar.render time
118
116
 
119
- span = $('<span>', {'class': 'tooltip', title: 'Total navigation time for this page.'})
117
+ span = $('<span>', {'class': 'glimpse-tooltip', title: 'Total navigation time for this page.'})
120
118
  .text(PerformanceBar.formatTime(bar.total()))
121
119
  span.tipsy({ gravity: 'n' })
122
120
  updateStatus span
@@ -125,7 +123,7 @@ renderPerformanceBar = ->
125
123
  updateStatus = (html) ->
126
124
  $('#serverstats').html html
127
125
 
128
- ajaxStart = null
126
+ ajaxStart = null
129
127
  $(document).on 'pjax:start page:fetch', (event) ->
130
128
  ajaxStart = event.timeStamp
131
129
 
@@ -154,7 +152,7 @@ $(document).on 'pjax:end page:change', (event, xhr) ->
154
152
  else
155
153
  tech = 'Turbolinks'
156
154
 
157
- span = $('<span>', {'class': 'tooltip', title: "#{tech} navigation time"})
155
+ span = $('<span>', {'class': 'glimpse-tooltip', title: "#{tech} navigation time"})
158
156
  .text(PerformanceBar.formatTime(total))
159
157
  span.tipsy({ gravity: 'n' })
160
158
  updateStatus span
@@ -163,4 +161,7 @@ $(document).on 'pjax:end page:change', (event, xhr) ->
163
161
  , 0
164
162
 
165
163
  $ ->
166
- renderPerformanceBar()
164
+ if window.performance
165
+ renderPerformanceBar()
166
+ else
167
+ $('#glimpse-view-performance-bar').remove()
@@ -17,5 +17,5 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ['lib']
19
19
 
20
- gem.add_dependency 'glimpse'
20
+ gem.add_dependency 'glimpse', '>= 0.0.5'
21
21
  end
@@ -1,5 +1,5 @@
1
1
  module Glimpse
2
2
  module PerformanceBar
3
- VERSION = '1.1.0'
3
+ VERSION = '1.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimpse-performance_bar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
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: 2013-03-17 00:00:00.000000000 Z
12
+ date: 2013-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: glimpse
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: 0.0.5
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: '0'
29
+ version: 0.0.5
30
30
  description: Provide a glimpse into the MySQL queries made during your application's
31
31
  requests.
32
32
  email: