showoff 0.16.0 → 0.16.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.
data/views/header.erb CHANGED
@@ -15,7 +15,6 @@
15
15
  <script type="text/javascript" src="<%= @asset_path %>/js/jquery-2.1.4.min.js"></script>
16
16
 
17
17
  <script type="text/javascript" src="<%= @asset_path %>/js/jquery.cycle.all-2.8.0.js"></script>
18
- <script type="text/javascript" src="<%= @asset_path %>/js/jquery-print.js"></script>
19
18
  <script type="text/javascript" src="<%= @asset_path %>/js/jquery.batchImageLoad-1.0.0.js"></script>
20
19
  <script type="text/javascript" src="<%= @asset_path %>/js/jquery.parsequery.min-6a20f83.js"></script>
21
20
  <script type="text/javascript" src="<%= @asset_path %>/js/jquery.doubletap-4ff02c5.js"></script>
data/views/presenter.erb CHANGED
@@ -122,9 +122,7 @@
122
122
  </div>
123
123
 
124
124
  <div id="statusbar">
125
- <span id="progress" class="no-mobile">
126
- Slide: <span id="slideInfo"></span>
127
- </span>
125
+ <div id="progress" class="no-mobile"><span class="label">Slide: <span id="slideInfo"></span></span></div>
128
126
  <div id="debugInfo"></div>
129
127
 
130
128
  <div class="controls">
@@ -0,0 +1,70 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <%= erb :header_mini %>
6
+
7
+ <script type="text/javascript">
8
+ $(document).ready(function(){ setupStats(); });
9
+ </script>
10
+ </head>
11
+
12
+ <body id="stats">
13
+ <div id="wrapper">
14
+ <h1>Viewing Statistics</h1>
15
+
16
+ <div id="least">
17
+ <h3>Least viewed slides</h3>
18
+ <% if @least.size > 0 %>
19
+ <% max = @least.sort_by {|slide, time| -time}[0][1].to_f %>
20
+ <% timestr = (max > 3599) ? '%H:%M:%S' : '%M:%S' %>
21
+ <% @least.each do |slide, time| %>
22
+ <div class="row">
23
+ <span class="label"><%= slide %></span>
24
+ <div class="bar" style="width: <%= (time/max)*100 %>%;"> </div>
25
+ <div class="time"><%= Time.at(time).gmtime.strftime(timestr) %></div>
26
+ </div>
27
+ <% end %>
28
+ <% end %>
29
+ </div>
30
+
31
+ <div id="most">
32
+ <h3>Most viewed slides</h3>
33
+ <% if @least.size > 0 %>
34
+ <% max = @most[0][1].to_f %>
35
+ <% timestr = (max > 3599) ? '%H:%M:%S' : '%M:%S' %>
36
+ <% @most.each do |slide, time| %>
37
+ <div class="row">
38
+ <span class="label"><%= slide %></span>
39
+ <div class="bar" style="width: <%= (time/max)*100 %>%;"> </div>
40
+ <div class="time"><%= Time.at(time).gmtime.strftime(timestr) %></div>
41
+ </div>
42
+ <% end %>
43
+ <% end %>
44
+ </div>
45
+
46
+ <div id="all">
47
+ <h3>All slides</h3>
48
+ <%# We reuse the max value calculated from the above step. %>
49
+ <% @all.sort.map do |slide, time| %>
50
+ <div class="row">
51
+ <span class="label"><%= slide %></span>
52
+ <div class="bar" style="width: <%= (time/max)*100 %>%;"> </div>
53
+ <div class="time"><%= Time.at(time).gmtime.strftime(timestr) %></div>
54
+ <% if @counter %>
55
+ <div class="detail">
56
+ <% @counter[slide].each do |host, count| %>
57
+ <div class="row">
58
+ <span class="label"><%= host %>:</span>
59
+ <div class="bar" style="width: <%= (count/max)*100 %>%;"> </div>
60
+ <div class="time"><%= Time.at(count).gmtime.strftime(timestr) %></div>
61
+ </div>
62
+ <% end %>
63
+ </div>
64
+ <% end %>
65
+ </div>
66
+ <% end %>
67
+ </div>
68
+ </div>
69
+ </body>
70
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showoff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Chacon
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-06 00:00:00.000000000 Z
12
+ date: 2017-01-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sinatra
@@ -198,6 +198,7 @@ files:
198
198
  - views/index.erb
199
199
  - views/onepage.erb
200
200
  - views/presenter.erb
201
+ - views/stats copy.erb
201
202
  - views/stats.erb
202
203
  - public/css/TimeCircles-89ac5ae.css
203
204
  - public/css/disconnected-large.png
@@ -327,6 +328,7 @@ files:
327
328
  - public/css/titlebar/powershell-controls.png
328
329
  - public/css/titlebar/powershell.png
329
330
  - public/css/titlebar/right.png
331
+ - public/css/zoomline-0.0.1.css
330
332
  - public/favicon.ico
331
333
  - public/js/TimeCircles-89ac5ae.js
332
334
  - public/js/annotations.js
@@ -335,7 +337,6 @@ files:
335
337
  - public/js/highlight.pack-9.2.0.js
336
338
  - public/js/jTypeWriter-1.1.js
337
339
  - public/js/jquery-2.1.4.min.js
338
- - public/js/jquery-print.js
339
340
  - public/js/jquery-ui-1.12.1.js
340
341
  - public/js/jquery.batchImageLoad-1.0.0.js
341
342
  - public/js/jquery.cycle.all-2.8.0.js
@@ -344,7 +345,9 @@ files:
344
345
  - public/js/mermaid-6.0.0-min.js
345
346
  - public/js/presenter.js
346
347
  - public/js/showoff.js
348
+ - public/js/zoomline-0.0.1.js
347
349
  - public/unsupported.html
350
+ - public/zoomline-0.0.1.html
348
351
  homepage: https://puppetlabs.github.io/showoff
349
352
  licenses:
350
353
  - MIT
@@ -1,110 +0,0 @@
1
- /* https://github.com/smparkes/jquery.print/blob/master/src/jquery.print.js */
2
- (function($) {
3
-
4
- function print_array(obj, opts) {
5
- var result = [];
6
- for (var i = 0; i < Math.min(opts.max_array, obj.length); i++)
7
- result.push($.print(obj[i], $.extend({}, opts, { max_array: 3, max_string: 40 })));
8
-
9
- if (obj.length > opts.max_array)
10
- result.push((obj.length - opts.max_array) + ' more...');
11
- if (result.length == 0) return "[]"
12
- return "[ " + result.join(", ") + " ]";
13
- }
14
-
15
- function print_element(obj) {
16
- if (obj.nodeType == 1) {
17
- var result = [];
18
- var properties = [ 'className', 'id' ];
19
- var extra = {
20
- 'input': ['type', 'name', 'value'],
21
- 'a': ['href', 'target'],
22
- 'form': ['method', 'action'],
23
- 'script': ['src'],
24
- 'link': ['href'],
25
- 'img': ['src']
26
- };
27
-
28
- $.each(properties.concat(extra[obj.tagName.toLowerCase()] || []), function(){
29
- if (obj[this])
30
- result.push(' ' + this.replace('className', 'class') + "=" + $.print(obj[this]))
31
- });
32
- return "<" + obj.tagName.toLowerCase()
33
- + result.join('') + ">";
34
- }
35
- }
36
-
37
- function print_object(obj, opts) {
38
- var seen = opts.seen || [ obj ];
39
-
40
- var result = [], key, value;
41
- for (var k in obj) {
42
- if (obj.hasOwnProperty(k) && $.inArray(obj[k], seen) < 0) {
43
- seen.push(obj[k]);
44
- value = $.print(obj[k], $.extend({}, opts, { max_array: 6, max_string: 40, seen: seen }));
45
- } else
46
- value = "...";
47
- result.push(k + ": " + value);
48
- }
49
- if (result.length == 0) return "{}";
50
- return "{ " + result.join(", ") + " }";
51
- }
52
-
53
- function print_string(value, opts) {
54
- var character_substitutions = {
55
- '\b': '\\b',
56
- '\t': '\\t',
57
- '\n': '\\n',
58
- '\f': '\\f',
59
- '\r': '\\r',
60
- '"' : '\\"',
61
- '\\': '\\\\'
62
- };
63
- var r = /["\\\x00-\x1f\x7f-\x9f]/g;
64
-
65
- var str = r.test(value)
66
- ? value.replace(r, function (a) {
67
- var c = character_substitutions[a];
68
- if (c) return c;
69
- c = a.charCodeAt();
70
- return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
71
- })
72
- : value ;
73
- if (str.length > opts.max_string)
74
- return str.slice(0, opts.max_string + 1) + '..."';
75
- else
76
- return str;
77
- }
78
-
79
- $.print = function(obj, options) {
80
- var opts = $.extend({}, { max_array: 10, max_string: 100 }, options);
81
-
82
- if (typeof obj == 'undefined')
83
- return "undefined";
84
- else if (typeof obj == 'boolean')
85
- return obj.toString();
86
- else if (typeof obj == 'number')
87
- return obj.toString();
88
- else if (!obj)
89
- return "null";
90
- else if (typeof obj == 'string')
91
- return print_string(obj, opts);
92
- else if (obj instanceof RegExp)
93
- return obj.toString();
94
- else if (obj instanceof Array || obj.callee || obj.item)
95
- return print_array(obj, opts);
96
- else if (typeof obj == 'function' || obj instanceof Function)
97
- return obj.toString().match(/^([^)]*\))/)[1];
98
- else if (obj.nodeType)
99
- return print_element(obj);
100
- else if (obj instanceof jQuery)
101
- return "$(" + $.print(obj.get()) + ")";
102
- else if (obj instanceof Error)
103
- return print_object(obj, $.extend({}, options, { max_string: 200 }));
104
- else if (obj instanceof Object)
105
- return print_object(obj, opts);
106
- else
107
- return obj.toString().replace(/\n\s*/g, '');
108
- }
109
-
110
- })(jQuery);