fancybox-rails 0.2.0 → 0.2.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b842494b32d68217ee239598c61c110a4e0a72cf
4
- data.tar.gz: 7706afaae0dc2783fbff61cffedf8b52e92eb288
3
+ metadata.gz: 5ce14c86817a4be6f950323854118cdd5908cfe6
4
+ data.tar.gz: cb0b832abf4d37f19a57797c67fc922410b79719
5
5
  SHA512:
6
- metadata.gz: 7b7994d5a8f7d9ecdc35b90207f79a837e3c680ec19d61023c21f1c03ee874bdd1c542c4f7ba82f2285528c49e8371b337de64eb316043bad311949a02aea187
7
- data.tar.gz: ce574e77167b3ef5af9ccc0ab3cb7890d2fbfd54e849b8e69d7711b12a27cca6e9d404c9a085f96c2615b2ae8076ad6d64308ebcc16768bce599c935ed52e694
6
+ metadata.gz: a389852fe528f7d6bc3306591c744228e31ea406abda7dfb85e1455e4fb269445f209606b2ab1b6c24b01f932ff00f7a2e3afbd047c3b4bf09ebf6ea7edb27ea
7
+ data.tar.gz: 615454594f4cd06b3f61a82867e5205408024bbbd28bcfcb2e68a40f9c7573c7cf43df1276e1f038b131198a42ad13c20d570dcf78150e34b458747573b757c1
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
- fancybox-rails
2
- ==============
1
+ # fancybox-rails
3
2
 
4
-
5
- Use [fancybox 1.3.4](http://fancybox.net/) with rails 3.1 asset pipeline.
3
+ Use [fancybox 1.3.4](http://fancybox.net/) with rails 3.1+ asset pipeline.
6
4
 
7
5
  ## Installation
8
6
 
@@ -37,28 +35,40 @@ look something like:
37
35
  */
38
36
  ```
39
37
 
40
- That's it!
41
-
42
38
  ## Usage
43
39
 
44
40
  With the gem installed and included in your asset manifests, you can now
45
41
  use fancybox as you normally would.
46
42
 
47
43
  ``` javascript
48
- $(document).ready(function() {
44
+ jQuery(function() {
49
45
  $("a.fancybox").fancybox();
50
46
  });
51
47
  ```
52
48
 
49
+ If you're using [CoffeeScript](http://coffeescript.org/) you can use the
50
+ plugin in the same way.
51
+
52
+ ```coffeescript
53
+ jQuery ->
54
+ $('a.fancybox').fancybox()
55
+ ```
56
+
57
+ ## Customization
58
+
59
+ If you want to customize the fancybox assets you can copy the assets
60
+ from the gem into your application's `lib/assets/` directory.
61
+
62
+ $ rails generate fancybox_rails
63
+
64
+ If you want to see what files will be created without actually creating
65
+ them, run the generator with the `--pretend` option.
66
+
53
67
  ## fancyBox 2.0
54
68
 
55
69
  If you want to use [fancyBox 2.0](http://fancyapps.com/fancybox/) then
56
70
  check out [fancybox2-rails](https://github.com/kyparn/fancybox2-rails).
57
71
 
58
- ```ruby
59
- gem 'fancybox-rails', :git => 'https://github.com/sverigemeny/fancybox-rails'
60
- ```
61
-
62
72
  Please be aware that the [license](http://fancyapps.com/fancybox/#license) has changed in the new version and
63
73
  you'll need to purchase one if you intend to use *that fork* for
64
74
  commercial purposes.
@@ -0,0 +1,13 @@
1
+ class FancyboxRailsGenerator < Rails::Generators::Base
2
+ source_root File.expand_path("../../../vendor/assets", __FILE__)
3
+
4
+ desc "Copy FancyBox into lib/ for customization"
5
+ def copy_assets
6
+ dir = Pathname.new(self.class.source_root)
7
+ Dir[self.class.source_root + '/**/*'].each do |entry|
8
+ next if File.directory?(entry)
9
+ file = Pathname.new(entry).relative_path_from(dir)
10
+ copy_file file, "lib/assets/#{file}"
11
+ end
12
+ end
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fancybox-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Mytton
@@ -35,6 +35,7 @@ extra_rdoc_files: []
35
35
  files:
36
36
  - lib/fancybox-rails/engine.rb
37
37
  - lib/fancybox-rails.rb
38
+ - lib/generators/fancybox_rails_generator.rb
38
39
  - vendor/assets/images/blank.gif
39
40
  - vendor/assets/images/fancy_close.png
40
41
  - vendor/assets/images/fancy_loading.png