simple_lightbox 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.idea/workspace.xml CHANGED
@@ -37,7 +37,7 @@
37
37
  <file leaf-file-name="simple_lightbox.rb" pinned="false" current="false" current-in-tab="false">
38
38
  <entry file="file://$PROJECT_DIR$/lib/simple_lightbox.rb">
39
39
  <provider selected="true" editor-type-id="text-editor">
40
- <state line="7" column="0" selection-start="133" selection-end="133" vertical-scroll-proportion="0.0">
40
+ <state line="1" column="0" selection-start="53" selection-end="53" vertical-scroll-proportion="0.0">
41
41
  <folding />
42
42
  </state>
43
43
  </provider>
@@ -46,7 +46,16 @@
46
46
  <file leaf-file-name="simple_lightbox_helper.rb" pinned="false" current="false" current-in-tab="false">
47
47
  <entry file="file://$PROJECT_DIR$/lib/simple_lightbox/simple_lightbox_helper.rb">
48
48
  <provider selected="true" editor-type-id="text-editor">
49
- <state line="10" column="0" selection-start="295" selection-end="295" vertical-scroll-proportion="0.0">
49
+ <state line="11" column="7" selection-start="333" selection-end="333" vertical-scroll-proportion="0.0">
50
+ <folding />
51
+ </state>
52
+ </provider>
53
+ </entry>
54
+ </file>
55
+ <file leaf-file-name="railtie.rb" pinned="false" current="false" current-in-tab="false">
56
+ <entry file="file://$PROJECT_DIR$/lib/simple_lightbox/railtie.rb">
57
+ <provider selected="true" editor-type-id="text-editor">
58
+ <state line="4" column="32" selection-start="105" selection-end="105" vertical-scroll-proportion="0.0">
50
59
  <folding />
51
60
  </state>
52
61
  </provider>
@@ -101,10 +110,10 @@
101
110
  <option value="$PROJECT_DIR$/Rakefile" />
102
111
  <option value="$PROJECT_DIR$/lib/app/helpers/simple_lightbox/simple_lightbox_helper.rb" />
103
112
  <option value="$PROJECT_DIR$/.gitignore" />
104
- <option value="$PROJECT_DIR$/lib/simple_lightbox/railtie.rb" />
105
113
  <option value="$PROJECT_DIR$/lib/simple_lightbox/simple_lightbox.rb" />
106
- <option value="$PROJECT_DIR$/lib/simple_lightbox/simple_lightbox_helper.rb" />
107
114
  <option value="$PROJECT_DIR$/simple_lightbox.gemspec" />
115
+ <option value="$PROJECT_DIR$/lib/simple_lightbox/simple_lightbox_helper.rb" />
116
+ <option value="$PROJECT_DIR$/lib/simple_lightbox/railtie.rb" />
108
117
  <option value="$PROJECT_DIR$/lib/simple_lightbox.rb" />
109
118
  <option value="$PROJECT_DIR$/lib/simple_lightbox/version.rb" />
110
119
  </list>
@@ -286,23 +295,30 @@
286
295
  </state>
287
296
  </provider>
288
297
  </entry>
298
+ <entry file="file://$PROJECT_DIR$/simple_lightbox.gemspec">
299
+ <provider selected="true" editor-type-id="text-editor">
300
+ <state line="21" column="0" selection-start="807" selection-end="807" vertical-scroll-proportion="0.0">
301
+ <folding />
302
+ </state>
303
+ </provider>
304
+ </entry>
289
305
  <entry file="file://$PROJECT_DIR$/lib/simple_lightbox/simple_lightbox_helper.rb">
290
306
  <provider selected="true" editor-type-id="text-editor">
291
- <state line="10" column="0" selection-start="295" selection-end="295" vertical-scroll-proportion="0.0">
307
+ <state line="11" column="7" selection-start="333" selection-end="333" vertical-scroll-proportion="0.0">
292
308
  <folding />
293
309
  </state>
294
310
  </provider>
295
311
  </entry>
296
- <entry file="file://$PROJECT_DIR$/simple_lightbox.gemspec">
312
+ <entry file="file://$PROJECT_DIR$/lib/simple_lightbox/railtie.rb">
297
313
  <provider selected="true" editor-type-id="text-editor">
298
- <state line="21" column="0" selection-start="807" selection-end="807" vertical-scroll-proportion="0.0">
314
+ <state line="4" column="32" selection-start="105" selection-end="105" vertical-scroll-proportion="0.0">
299
315
  <folding />
300
316
  </state>
301
317
  </provider>
302
318
  </entry>
303
319
  <entry file="file://$PROJECT_DIR$/lib/simple_lightbox.rb">
304
320
  <provider selected="true" editor-type-id="text-editor">
305
- <state line="7" column="0" selection-start="133" selection-end="133" vertical-scroll-proportion="0.0">
321
+ <state line="1" column="0" selection-start="53" selection-end="53" vertical-scroll-proportion="0.0">
306
322
  <folding />
307
323
  </state>
308
324
  </provider>
@@ -1,7 +1 @@
1
- require "simple_lightbox/simple_lightbox_helper"
2
-
3
- module SimpleLightbox
4
-
5
- ActionView::Base.send :include, SimpleLightboxHelper
6
-
7
- end
1
+ require "simple_lightbox/railtie" if defined?(Rails)
@@ -0,0 +1,13 @@
1
+ require 'simple_lightbox/simple_lightbox_helper'
2
+
3
+ module SimpleLightbox
4
+
5
+ class Railtie < Rails::Railtie
6
+
7
+ initializer "simple_lightbox.simple_lightbox_helper" do
8
+ ActionView::Base.send :include, SimpleLightboxHelper
9
+ end
10
+
11
+ end
12
+
13
+ end
@@ -1,17 +1,21 @@
1
- module SimpleLightboxHelper
1
+ module SimpleLightbox
2
2
 
3
- def display_lightbox(partial, title, opts={})
4
- contents = render :partial=>partial
5
- page << "lightboxContainer.add(new Lightbox(#{contents.to_json}, #{title.to_json}, #{opts.to_json}))"
6
- end
3
+ module SimpleLightboxHelper
7
4
 
8
- def close_lightbox
9
- page << "lightboxContainer.pop()"
10
- end
5
+ def display_lightbox(partial, title, opts={})
6
+ contents = render :partial=>partial
7
+ page << "lightboxContainer.add(new Lightbox(#{contents.to_json}, #{title.to_json}, #{opts.to_json}))"
8
+ end
11
9
 
12
- def lightbox_error_container
13
- "<div class=\"lightbox-error\"></div>".html_safe
14
- end
10
+ def close_lightbox
11
+ page << "lightboxContainer.pop()"
12
+ end
15
13
 
14
+ def lightbox_error_container
15
+ "<div class=\"lightbox-error\"></div>".html_safe
16
+ end
17
+
18
+
19
+ end
16
20
 
17
- end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module SimpleLightbox
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: simple_lightbox
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Edward Taupier
@@ -28,6 +28,7 @@ files:
28
28
  - Gemfile
29
29
  - Rakefile
30
30
  - lib/simple_lightbox.rb
31
+ - lib/simple_lightbox/railtie.rb
31
32
  - lib/simple_lightbox/simple_lightbox_helper.rb
32
33
  - lib/simple_lightbox/version.rb
33
34
  - simple_lightbox.gemspec