goat 0.3.30 → 0.3.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/goat.gemspec +1 -1
  2. data/lib/goat/goat.js +1 -1
  3. data/lib/goat/html.rb +17 -0
  4. metadata +4 -4
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'goat'
3
- s.version = '0.3.30'
3
+ s.version = '0.3.31'
4
4
  s.summary = 'Pre-release beta version of Goat'
5
5
  s.author = 'Patrick Collison'
6
6
  s.email = 'patrick@collison.ie'
@@ -350,7 +350,7 @@ $.extend(Goat, {
350
350
  closure: function(fn) { return closure(this, fn); },
351
351
 
352
352
  channelURL: function() {
353
- if(window.location.host.match(/127\./))
353
+ if(window.location.host.match(/127\.0\.0\.1/) || window.location.host.match(/localhost/))
354
354
  return 'http://127.0.0.1:8050/channel';
355
355
  else
356
356
  return '/channel';
@@ -229,6 +229,23 @@ module Goat
229
229
  build_node
230
230
  end
231
231
 
232
+ def input_tag
233
+ unless @attrs.include?(:name)
234
+ $stderr.puts "Warning: no name for <#{@tag} #{@attrs.inspect}>#{@body.inspect}</#{@tag}>"
235
+
236
+ # this is somewhat ungainly: we generate a name automatically by hashing the values of the
237
+ # other attrs. this may conflict - ideally would track per-page state for these.
238
+ # purpose is to have name-less inputs preserve their values when user goes back to page.
239
+ # webkit in safari 5 gets confused when inputs are nameless.
240
+ unless (vals = @attrs.values{|k, v| v.kind_of?(String)}).empty?
241
+ $stderr.puts "Generating a name automatically..."
242
+ @attrs[:name] = vals.join.md5[0..10]
243
+ end
244
+ end
245
+
246
+ build_node
247
+ end
248
+
232
249
  def dispatch
233
250
  meth = "#{@tag}_tag".to_sym
234
251
 
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: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 30
10
- version: 0.3.30
9
+ - 31
10
+ version: 0.3.31
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: 2011-01-04 00:00:00 +00:00
18
+ date: 2011-01-07 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21