goat 0.3.21 → 0.3.23

Sign up to get free protection for your applications and to get access to all the features.
data/goat.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'goat'
3
- s.version = '0.3.21'
3
+ s.version = '0.3.23'
4
4
  s.summary = 'Pre-release beta version of Goat'
5
5
  s.author = 'Patrick Collison'
6
6
  s.email = 'patrick@collison.ie'
data/lib/goat/dynamic.rb CHANGED
@@ -66,9 +66,9 @@ module Dynamic
66
66
  def let(bindings, &block)
67
67
  save = {}
68
68
  save_keys = variables.keys
69
+ save_keys.each {|k, v| save[k] = self[k]}
69
70
  bindings.to_hash.collect { |key, value|
70
71
  self.variable(key)
71
- save[key] = self[key]
72
72
  self[key] = value
73
73
  }
74
74
  block.call
data/lib/goat/goat.js CHANGED
@@ -197,8 +197,12 @@ Goat.LoadingIndicator = {
197
197
 
198
198
  (function(ld) {
199
199
  function initIndicator() {
200
- if(!ld.url || !ld.where) console.error("Loading indicator not configured");
200
+ if(!ld.url || !ld.where) {
201
+ console.error("Loading indicator not configured");
202
+ return;
203
+ }
201
204
  ld.indicator = $("<img id=\"loading_indicator\" src=\"" + ld.url + "\">");
205
+ new Image(ld.url);
202
206
  }
203
207
 
204
208
  function show() {
@@ -213,7 +217,6 @@ Goat.LoadingIndicator = {
213
217
 
214
218
  $(document).ready(function() {
215
219
  initIndicator();
216
- new Image(ld.url);
217
220
  });
218
221
 
219
222
  ld.show = show;
@@ -369,9 +372,13 @@ $.extend(Goat, {
369
372
  if(t == 'component_updated') {
370
373
  Goat.RT.updateReceived(m);
371
374
  } else if(t == 'redirect') {
372
- console.log("Redirecting to " + m['location']);
373
- sleep(2);
374
- window.location = m['location'];
375
+ if(m["location"]) {
376
+ console.log("Redirecting to " + m['location']);
377
+ sleep(2);
378
+ window.location = m['location'];
379
+ } else {
380
+ console.error("Tried to redirect to null. Buggy message: " + m);
381
+ }
375
382
  } else if(t == 'page_expired') {
376
383
  alert("Due to inactivity, you'll need to refresh this page.");
377
384
  Goat.setPageDead();
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 61
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 21
10
- version: 0.3.21
9
+ - 23
10
+ version: 0.3.23
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick Collison
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-08 00:00:00 +00:00
18
+ date: 2010-12-17 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21