flammarion 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Flammarion
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -185,16 +185,27 @@ void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?voi
185
185
  (function() {
186
186
  $.extend(WSClient.prototype.actions, {
187
187
  append: function(data) {
188
- var atBottom, element, marginSize;
188
+ var atBottom, atBottomStack, element, marginSize, results;
189
189
  this.__parent.check_target(data);
190
190
  element = $("#console-" + data.target);
191
191
  marginSize = 16;
192
- atBottom = element.scrollTop() >= element[0].scrollHeight - element.height() - marginSize - 2 || element[0].scrollHeight - marginSize < element.height();
193
- console.log("top: " + (element.scrollTop()) + " height: " + (element[0].scrollHeight - element.height() - marginSize) + " marginSize: " + marginSize + " atBottom: " + atBottom);
192
+ atBottomStack = [];
193
+ while (element.hasClass("pane")) {
194
+ atBottom = element.scrollTop() >= element[0].scrollHeight - element.height() - marginSize - 2 || element[0].scrollHeight - marginSize < element.height();
195
+ atBottomStack.push(atBottom);
196
+ element = element.parent();
197
+ }
198
+ element = $("#console-" + data.target);
194
199
  element.append(this.__parent.escape(data.text, data));
195
- if (atBottom) {
196
- return element.scrollTop(element[0].scrollHeight - element.height() - marginSize);
200
+ results = [];
201
+ while (element.hasClass("pane")) {
202
+ atBottom = atBottomStack.pop();
203
+ if (atBottom) {
204
+ element.scrollTop(element[0].scrollHeight - element.height() - marginSize);
205
+ }
206
+ results.push(element = element.parent());
197
207
  }
208
+ return results;
198
209
  },
199
210
  replace: function(data) {
200
211
  this.__parent.check_target(data);
@@ -339,7 +350,10 @@ void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?voi
339
350
  if (data.keep_label) {
340
351
  replaceText = "" + data.label + replaceText;
341
352
  }
342
- return element.replaceWith(replaceText);
353
+ element.replaceWith(replaceText);
354
+ }
355
+ if (data.autoclear) {
356
+ return element[0].value = "";
343
357
  }
344
358
  }
345
359
  };
@@ -6806,16 +6806,27 @@ if (typeof module !== 'undefined') {
6806
6806
  (function() {
6807
6807
  $.extend(WSClient.prototype.actions, {
6808
6808
  append: function(data) {
6809
- var atBottom, element, marginSize;
6809
+ var atBottom, atBottomStack, element, marginSize, results;
6810
6810
  this.__parent.check_target(data);
6811
6811
  element = $("#console-" + data.target);
6812
6812
  marginSize = 16;
6813
- atBottom = element.scrollTop() >= element[0].scrollHeight - element.height() - marginSize - 2 || element[0].scrollHeight - marginSize < element.height();
6814
- console.log("top: " + (element.scrollTop()) + " height: " + (element[0].scrollHeight - element.height() - marginSize) + " marginSize: " + marginSize + " atBottom: " + atBottom);
6813
+ atBottomStack = [];
6814
+ while (element.hasClass("pane")) {
6815
+ atBottom = element.scrollTop() >= element[0].scrollHeight - element.height() - marginSize - 2 || element[0].scrollHeight - marginSize < element.height();
6816
+ atBottomStack.push(atBottom);
6817
+ element = element.parent();
6818
+ }
6819
+ element = $("#console-" + data.target);
6815
6820
  element.append(this.__parent.escape(data.text, data));
6816
- if (atBottom) {
6817
- return element.scrollTop(element[0].scrollHeight - element.height() - marginSize);
6821
+ results = [];
6822
+ while (element.hasClass("pane")) {
6823
+ atBottom = atBottomStack.pop();
6824
+ if (atBottom) {
6825
+ element.scrollTop(element[0].scrollHeight - element.height() - marginSize);
6826
+ }
6827
+ results.push(element = element.parent());
6818
6828
  }
6829
+ return results;
6819
6830
  },
6820
6831
  replace: function(data) {
6821
6832
  this.__parent.check_target(data);
@@ -6960,7 +6971,10 @@ if (typeof module !== 'undefined') {
6960
6971
  if (data.keep_label) {
6961
6972
  replaceText = "" + data.label + replaceText;
6962
6973
  }
6963
- return element.replaceWith(replaceText);
6974
+ element.replaceWith(replaceText);
6975
+ }
6976
+ if (data.autoclear) {
6977
+ return element[0].value = "";
6964
6978
  }
6965
6979
  }
6966
6980
  };
@@ -4,10 +4,20 @@ $.extend WSClient.prototype.actions,
4
4
  @__parent.check_target(data)
5
5
  element = $("#console-#{data.target}")
6
6
  marginSize = 16
7
- atBottom = element.scrollTop() >= element[0].scrollHeight - element.height() - marginSize - 2 or element[0].scrollHeight - marginSize < element.height()
8
- console.log "top: #{element.scrollTop()} height: #{element[0].scrollHeight - element.height() - marginSize} marginSize: #{marginSize} atBottom: #{atBottom}"
7
+
8
+ atBottomStack = []
9
+ while element.hasClass("pane")
10
+ atBottom = element.scrollTop() >= element[0].scrollHeight - element.height() - marginSize - 2 or element[0].scrollHeight - marginSize < element.height()
11
+ atBottomStack.push atBottom
12
+ element = element.parent()
13
+
14
+ element = $("#console-#{data.target}")
9
15
  element.append(@__parent.escape(data.text, data))
10
- element.scrollTop(element[0].scrollHeight - element.height() - marginSize) if atBottom
16
+
17
+ while element.hasClass("pane")
18
+ atBottom = atBottomStack.pop()
19
+ element.scrollTop(element[0].scrollHeight - element.height() - marginSize) if atBottom
20
+ element = element.parent()
11
21
 
12
22
  replace: (data) ->
13
23
  @__parent.check_target(data)
@@ -124,6 +134,8 @@ $.extend WSClient.prototype.actions,
124
134
  replaceText = @__parent.escape("#{element[0].value}\n")
125
135
  replaceText = "#{data.label}#{replaceText}" if data.keep_label
126
136
  element.replaceWith(replaceText)
137
+ if data.autoclear
138
+ element[0].value = ""
127
139
 
128
140
  target.append(element)
129
141
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flammarion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -155,7 +155,8 @@ dependencies:
155
155
  - - ~>
156
156
  - !ruby/object:Gem::Version
157
157
  version: '3.3'
158
- description: An easy to use gui toolkit for Ruby
158
+ description: The nifty Ruby gui toolkit. An easy to use gui toolkit built with scripting
159
+ in mind.
159
160
  email: zach.geek@gmail.com
160
161
  executables: []
161
162
  extensions: []