refinerycms-page-images 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,10 @@
26
26
  </div>
27
27
  </div>
28
28
 
29
- <% content_for :head do %>
30
- <%= javascript_include_tag 'page-image-picker' %>
29
+ <% content_for :stylesheets do %>
31
30
  <%= stylesheet_link_tag 'page-image-picker' %>
31
+ <% end %>
32
+
33
+ <% content_for :javascripts do %>
34
+ <%= javascript_include_tag 'page-image-picker' %>
32
35
  <% end %>
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- version = '0.9.6'
2
+ version = '0.9.7'
3
3
  raise "Could not get version so gemspec can not be built" if version.nil?
4
4
  files = (Dir.glob("*") | Dir.glob("**/*")).reject{|f| f =~ %r{.gem(spec)?$}}
5
5
 
@@ -17,7 +17,7 @@ $(document).ready(function(){
17
17
  });
18
18
  }
19
19
  });
20
-
20
+
21
21
  reset_functionality();
22
22
  });
23
23
 
@@ -57,34 +57,12 @@ image_added = function(image) {
57
57
  new_list_item = (current_list_item = $('li.empty')).clone();
58
58
  image_id = $(image).attr('id').replace('image_', '');
59
59
  current_list_item.find('input:hidden').val(image_id);
60
- $.ajax({
61
- async: false,
62
- url: '/refinery/images/'+image_id+'/url',
63
- data: {size: '135x135#c'},
64
- success: function (result, status, xhr) {
65
- if (result.error) {
66
- if (console && console.log) {
67
- console.log("Something went wrong with the image insertion!");
68
- console.log(result);
69
- }
70
- } else {
71
- (img = $("<img />")).attr({
72
- title: $(image).attr('title')
73
- , alt: $(image).attr('alt')
74
- , src: result.url
75
- }).appendTo(current_list_item);
76
- }
77
-
78
- },
79
- error: function(xhr, txt, status) {
80
- if (console && console.log) {
81
- console.log("Something went wrong with the image insertion!");
82
- console.log(xhr);
83
- console.log(txt);
84
- console.log(status);
85
- }
86
- }
87
- });
60
+
61
+ $("<img />").attr({
62
+ title: $(image).attr('title')
63
+ , alt: $(image).attr('alt')
64
+ , src: $(image).attr('data-grid'); // use 'grid' size that is built into Refinery CMS (135x135#c).
65
+ }).appendTo(current_list_item);
88
66
 
89
67
  current_list_item.attr('id', 'image_' + image_id).removeClass('empty');
90
68
 
@@ -94,7 +72,7 @@ image_added = function(image) {
94
72
 
95
73
  reindex_images = function() {
96
74
  $('#page_images li input:hidden').each(function(i, input){
97
-
75
+
98
76
  // make the image's name consistent with its position.
99
77
  parts = $(input).attr('name').split(']');
100
78
  parts[1] = ('[' + i);
data/readme.md CHANGED
@@ -17,7 +17,7 @@ Page Images allows you to relate one or more images to any page in Refinery whic
17
17
 
18
18
  Add this line to your applications `Gemfile`
19
19
 
20
- gem 'refinerycms-page-images', '~> 0.9.6'
20
+ gem 'refinerycms-page-images', '~> 0.9.7'
21
21
 
22
22
  Next run
23
23
 
@@ -27,6 +27,22 @@ Next run
27
27
 
28
28
  Now when you start up your Refinery application, edit a page and there should be a new "Images" tab.
29
29
 
30
+ If you get an error like
31
+
32
+ uninitialized constant Refinery::Pages::Tab
33
+
34
+ It means your Refinery version isn't new enough. To fix that you need to update the Refinery CMS `Gemfile` line to this
35
+
36
+ gem 'refinerycms', :git => "git://github.com/resolve/refinerycms.git"
37
+
38
+ Then run:
39
+
40
+ bundle install
41
+ rake refinery:update
42
+
43
+ And then try again. Note that doing this will likely mean that you need to fix your application
44
+ for any changes that have happened since the version of Refinery CMS that you were using.
45
+
30
46
  ## Usage
31
47
 
32
48
  `app/views/pages/show.html.erb`
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-page-images
3
3
  version: !ruby/object:Gem::Version
4
- hash: 55
4
+ hash: 53
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 6
10
- version: 0.9.6
9
+ - 7
10
+ version: 0.9.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Resolve Digital
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-26 00:00:00 +13:00
19
+ date: 2010-11-15 00:00:00 +13:00
20
20
  default_executable:
21
21
  dependencies: []
22
22