caboose-cms 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWMwNGE5MzMwM2M5YzliNTA3ZDcyNDQwMTljZGZlMTQxMTZkOWE2MA==
4
+ OTIzN2Y4OGIxMGM5NTU5MDEzN2UxZmEyZGY3Nzc1ZWFkMTY2MWQ4ZQ==
5
5
  data.tar.gz: !binary |-
6
- NTk3NDg3MDlmMTVhZWFlY2E1MmJiY2MwZWI2YWViMzk1MWM1NDZkNQ==
6
+ YjhlYjk4ODE3NDIyYzNjYmU5ZWM1YjI4MzU2NDk3NzJkOTMzMGM1OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmM0ZjE0NmI3MjI2ZmUyMzJhM2FlYmQ0YmNkZmQ5ZGIzZDZmNmMyMDA3ZmUw
10
- NmI1YzI3ODJhMDhhMWM4MjJkOGUxOTE0ODJmZGNkNWJlZGU3NWVmZWU2Yjk1
11
- MTNmOGEwZTUxNDBjODY4ODUxYTU0NDcxYThiMDkzZDUzM2QyNzA=
9
+ MzRjYjNkNWIwYjk2MDUxODM3YmQyZDZhMjFkNTMwN2EwOGQ0Mzc3NjMzMTJl
10
+ Yjc5Mzk1NjUzMDgxZTUxMDRmMzI5NGNkZWQzM2E2MjY0ZjU0NGM2MjBhZWMw
11
+ ZDViYjVjNjU5MmE0ZWI1ZTYyMjQxNGZiOWNlM2YzYTc1M2JmN2Y=
12
12
  data.tar.gz: !binary |-
13
- M2ZkMmIzMjNkMTk1MjI5MzAwMzk3N2UzM2I2ZDY2ZTk4ZTQ5M2ExZmE3OTJj
14
- Mzg5MDIwY2RkNDNmM2YxNmYyYTlhMDQzMzczYWVmY2IzNmJlZmZmNDc3MzFk
15
- NDRiYTNkNmViNGFmMWNlNzVmYTUxNTZkODQ5ZmQ4MjFiNDlkYzc=
13
+ NGQ0NjI2OTZjZWYwYjFiOGY2ZDY4ZWVjYmRkZTFhZTdiOWMyZDM2MzE1MjMy
14
+ ODRkMjVkYmZmZWNiYTZmMWMzMmEzOWY1ZjMxY2Q5NDQzNTkxMTU2MjAyNWFl
15
+ Mjg0MGE1NmRmMjMzYzU0YjMwYmI2ZGQzNTdiZDZiMWI0Y2Q2MDA=
@@ -230,7 +230,7 @@ MediaController.prototype = {
230
230
  if (that.cat.media.length > 0)
231
231
  {
232
232
  $.each(that.cat.media, function(i, m) {
233
- if (m.image_urls && m.processed == false)
233
+ if (m.media_type == 'image' && m.processed == false)
234
234
  processing = true
235
235
  var li = $('<li/>')
236
236
  .attr('id', 'media' + m.id)
@@ -261,7 +261,7 @@ MediaController.prototype = {
261
261
  start: function() { $(this).data("origPosition", $(this).position()); }
262
262
  });
263
263
  });
264
- },
264
+ },
265
265
 
266
266
  //============================================================================
267
267
 
@@ -74,10 +74,18 @@ class Caboose::Media < ActiveRecord::Base
74
74
  :description => self.description,
75
75
  :processed => self.processed,
76
76
  :image_urls => self.image_urls,
77
- :file_url => self.file ? self.file.url : nil
77
+ :file_url => self.file ? self.file.url : nil,
78
+ :media_type => self.is_image? ? 'image' : 'file'
78
79
  }
79
80
  end
80
81
 
82
+ def is_image?
83
+ image_extensions = ['.jpg', '.jpeg', '.gif', '.png', '.tif']
84
+ ext = File.extname(self.original_name).downcase
85
+ return true if image_extensions.include?(ext)
86
+ return false
87
+ end
88
+
81
89
  def image_urls
82
90
  return nil if self.image.nil? || self.image.url(:tiny).starts_with?('http://placehold.it')
83
91
  return {
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.6.5'
2
+ VERSION = '0.6.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caboose-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Barry