tailog 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 841c8ef5da7bab87b34f2f7f5c7937c177aae71c
4
- data.tar.gz: 85b2c056f8df7364ed7c1676344c5718bd4d138e
3
+ metadata.gz: d80f553a201e53ca0f79e92c0d19a8e2ea856cd7
4
+ data.tar.gz: d6b53865fb32612771a23afe359b078496e61042
5
5
  SHA512:
6
- metadata.gz: 4c5463cd1b82ba4e2937dcc21f18aeea48d8952c62df8c5b7e7a125a13302e23f28fcb0fe24956b74edda8c5a5d8b2cc1f93587c51bf003d6be4b475c748f5e1
7
- data.tar.gz: 125bcb76f356bd2ee3508d7497dfb7639d31be64d8625d38f40a2047c3b0fd01cba5e7b3c0c27c2dbb95196b5804ef820a3fe2251f97f8be9a2de9973830f762
6
+ metadata.gz: ef66c3e7ba6467a068591340e099341f0d91997b7ac78caf95ba34d1e6080bc994cd48f3eaf58112d8e245232dcb8e86488c58ec22f06dcb20b390ad992b89f0
7
+ data.tar.gz: da5faafe1df5a06afe2b1b2bcec3b644497b38aaae88d659a9d54de42e4f1d29e7bf4153e87d81252216935eaf4da8b6162a4a429a6c9d26833a213cc3bedc25
@@ -10,6 +10,10 @@ p {
10
10
  margin: 0;
11
11
  }
12
12
 
13
+ * {
14
+ outline: 0 !important;
15
+ }
16
+
13
17
  .fixed-top-right {
14
18
  position: fixed;
15
19
  top: 25px;
@@ -60,3 +64,9 @@ p {
60
64
  .highlight {
61
65
  background: #FFFF88;
62
66
  }
67
+
68
+ .progress-bar {
69
+ -webkit-transition: width .6s ease, background-color .6s ease;
70
+ -o-transition: width .6s ease, background-color .6s ease;
71
+ transition: width .6s ease, background-color .6s ease;
72
+ }
@@ -45,9 +45,12 @@
45
45
  });
46
46
 
47
47
  var $content = $("#content"),
48
- $script = $("#script");
48
+ $script = $("#script"),
49
+ $submitButton = $("#submit-button"),
50
+ $broadcastButton = $("#broadcast-button"),
51
+ $buttons = $("#submit-button, #broadcast-button");
49
52
 
50
- $("#submit-button").click(function(event) {
53
+ $submitButton.click(function(event) {
51
54
  event.preventDefault();
52
55
  editor.save();
53
56
 
@@ -56,6 +59,7 @@
56
59
  $content
57
60
  .html("<hr/>")
58
61
  .append('<span class="text-info">Loading...</span>');
62
+ $buttons.attr("disabled", true);
59
63
  },
60
64
  error: function() {
61
65
  $content
@@ -72,17 +76,39 @@
72
76
  } catch (error) {
73
77
  console.error(error);
74
78
  }
79
+ },
80
+ complete: function() {
81
+ $buttons.attr("disabled", false);
75
82
  }
76
83
  });
77
84
  });
78
85
 
79
- $("#broadcast-button").click(function(event) {
86
+ var ajaxInterval = null;
87
+ $broadcastButton.click(function(event) {
80
88
  event.preventDefault();
81
89
  editor.save();
82
90
 
91
+ function onComplete() {
92
+ $submitButton.attr("disabled", false);
93
+ $broadcastButton.text("Broadcast");
94
+ clearInterval(ajaxInterval);
95
+ ajaxInterval = null;
96
+ }
97
+
98
+ if (ajaxInterval) {
99
+ onComplete();
100
+ $(".progress-bar")
101
+ .removeClass("progress-bar-info active")
102
+ .addClass("progress-bar-danger");
103
+ return;
104
+ }
105
+
83
106
  $content
84
107
  .html("<hr/>")
85
- .append('<div class="progress"><div class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" style="width: 0%"><span class="progress-bar-indicator">0 / 1 Requests, 0 Instances (0%)</span></div></div>');
108
+ .append('<div class="progress"><div class="progress-bar progress-bar-info progress-bar-striped active" role="progressbar" style="width: 0%"><span class="progress-bar-indicator">0 / 1 Requests, 0 Instances (0%)</span></div></div>');
109
+ $submitButton.attr("disabled", true);
110
+ $broadcastButton.text("Stop broadcasting!");
111
+
86
112
  var $progressBar = $(".progress-bar"),
87
113
  $indicator = $(".progress-bar-indicator");
88
114
 
@@ -92,7 +118,7 @@
92
118
  currentTries = 0,
93
119
  concurrent = 0;
94
120
 
95
- var ajaxInterval = setInterval(function() {
121
+ ajaxInterval = setInterval(function() {
96
122
  if (currentTries < totalEstimate) {
97
123
  if (concurrent < MaxCurrent) {
98
124
  $script.ajaxSubmit({
@@ -136,7 +162,10 @@
136
162
  });
137
163
  }
138
164
  } else if (concurrent === 0) {
139
- clearInterval(ajaxInterval);
165
+ onComplete();
166
+ $progressBar
167
+ .removeClass("progress-bar-info active")
168
+ .addClass("progress-bar-success");
140
169
  }
141
170
  }, 100);
142
171
  });
@@ -1,3 +1,3 @@
1
1
  module Tailog
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - bbtfr