window_rails 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == v0.2.9
2
+ * Let #window return raw string when passed :raw argument
3
+ * Check for window before attempting to close a window
4
+
1
5
  == v0.2.8
2
6
  * Request content as HTML when loading window
3
7
 
@@ -13,5 +13,5 @@ module WindowRails
13
13
  end
14
14
  end
15
15
 
16
- VERSION = Version.new('0.2.8')
16
+ VERSION = Version.new('0.2.9')
17
17
  end
@@ -105,16 +105,21 @@ module WindowRailsGenerators
105
105
  nil
106
106
  end
107
107
 
108
- def window(dom_id)
108
+ def window(dom_id, *args)
109
109
  window_setup
110
110
  unless(dom_id.blank?)
111
111
  dom_id = dom_id.to_s.dup
112
112
  dom_id.slice!(0) if dom_id.start_with?('#')
113
- self << "window.window_rails_windows['#{dom_id}']"
113
+ output = "window.window_rails_windows['#{dom_id}']"
114
114
  else
115
- self << "window.window_rails_windows[window.window_rails_windows_array[0]]"
115
+ output = "window.window_rails_windows[window.window_rails_windows_array[0]]"
116
+ end
117
+ if(args.include?(:raw))
118
+ output
119
+ else
120
+ self << output
121
+ self
116
122
  end
117
- self
118
123
  end
119
124
 
120
125
  # content:: content
@@ -376,7 +381,7 @@ module WindowRailsGenerators
376
381
  [options.to_s]
377
382
  end
378
383
  win_name.each do |win|
379
- window(win) << '.dialog("close");'
384
+ self << check_for_window(win, false){ "#{window(win, :raw)}.dialog('close');"}
380
385
  end
381
386
  end
382
387
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: window_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 8
10
- version: 0.2.8
9
+ - 9
10
+ version: 0.2.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Roberts
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-02 00:00:00 -08:00
18
+ date: 2011-12-21 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency