loft 0.3.1 → 0.4.0

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: 35d974bd9cf0bbb027b139f1fdde3650368fa0e7
4
- data.tar.gz: 9ed9c4f737df7a62f5ec3036d91e4811abec8be9
3
+ metadata.gz: 523861138105d45da2f415abcce810c7db3264b7
4
+ data.tar.gz: c424e92dbf6d06e32c9afb835c7ee417d16e0af8
5
5
  SHA512:
6
- metadata.gz: 9efca926bf5d610f4a807a6f9c435d2fee197e014042d95a8fd111f7318c253eafc8b79f4c03a23142ae854efc4c57a0da75e33c7ead7532c30c7d868e6ec8bd
7
- data.tar.gz: 2fad8c539b3247218ff1fa911246a7b29cf969e36e20b88b09acc75c3a22d20d68aeefd9b56e5460d4a9e6f7c604c4505d4ac25ee26533ecdd3e790e33f520ca
6
+ metadata.gz: 15f5d2447dddb59cb49d4553c574bc49c3418c99e80874ec716d0364daf29e9b52d7dfc51284f2fecb4c4adb3915ae33c1edead49086bcd96ed54f926e0068b8
7
+ data.tar.gz: 41bd0933ab33c0a07c5db72c762d7d2b0eceff99b6b407f01453b6e8b1b48f91ec0c2555fd8c8d0814049192b85bd4fdc85137c353c0b8103caaf9f8413d4f77
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- loft (0.3.1)
4
+ loft (0.4.0)
5
5
  ants (>= 0.3.10)
6
6
  carrierwave-mongoid (>= 0.7.1)
7
7
  chr (>= 0.5.4)
@@ -49,7 +49,7 @@ GEM
49
49
  minitest (~> 5.1)
50
50
  thread_safe (~> 0.3, >= 0.3.4)
51
51
  tzinfo (~> 1.1)
52
- ants (0.3.10)
52
+ ants (0.3.13)
53
53
  devise
54
54
  meta-tags
55
55
  mongoid (>= 4.0)
@@ -70,11 +70,11 @@ GEM
70
70
  carrierwave (>= 0.8.0, < 0.11.0)
71
71
  mongoid (>= 3.0, < 6.0)
72
72
  mongoid-grid_fs (>= 1.3, < 3.0)
73
- chr (0.5.4)
73
+ chr (0.5.7)
74
74
  bourbon
75
75
  coffee-rails (>= 4.0)
76
76
  font-awesome-rails
77
- formagic (>= 0.3.7)
77
+ formagic (>= 0.3.9)
78
78
  jquery-rails
79
79
  rails (~> 4.2.5)
80
80
  sass-rails
@@ -99,7 +99,7 @@ GEM
99
99
  fast-stemmer (1.0.2)
100
100
  font-awesome-rails (4.5.0.0)
101
101
  railties (>= 3.2, < 5.0)
102
- formagic (0.3.7)
102
+ formagic (0.3.9)
103
103
  bourbon (>= 3.2)
104
104
  normalize-rails (>= 3.0)
105
105
  globalid (0.3.6)
@@ -133,7 +133,7 @@ GEM
133
133
  minitest (5.8.3)
134
134
  mongo (2.2.1)
135
135
  bson (~> 4.0)
136
- mongoid (5.0.1)
136
+ mongoid (5.0.2)
137
137
  activemodel (~> 4.0)
138
138
  mongo (~> 2.1)
139
139
  origin (~> 2.1)
@@ -198,8 +198,8 @@ GEM
198
198
  rake (>= 0.8.7)
199
199
  thor (>= 0.18.1, < 2.0)
200
200
  rake (10.4.2)
201
- responders (2.1.0)
202
- railties (>= 4.2.0, < 5)
201
+ responders (2.1.1)
202
+ railties (>= 4.2.0, < 5.1)
203
203
  sass (3.4.20)
204
204
  sass-rails (5.0.4)
205
205
  railties (>= 4.0.0, < 5.0)
@@ -49,7 +49,7 @@ class @InputLoftImage extends InputString
49
49
  @$actions.append @$chooseBtn
50
50
 
51
51
  @$chooseBtn.on 'click', (e) =>
52
- chr.modules.loft.showModal 'images', false, (objects) =>
52
+ chr.modules.loft.showImages false, (objects) =>
53
53
  asset = objects[0]
54
54
  @updateValue(asset.file.url)
55
55
 
@@ -6,7 +6,9 @@
6
6
  # -----------------------------------------------------------------------------
7
7
  # Public methods:
8
8
  # new Loft(title, resource, resourcePath)
9
- # showModal(assetType, @selectMultipleAssets, @onAcceptCallback, @closeOnAccept)
9
+ # showAll(@selectMultipleAssets, @onAcceptCallback, @closeOnAccept)
10
+ # showImages(@selectMultipleAssets, @onAcceptCallback, @closeOnAccept)
11
+ # showDocuments(@selectMultipleAssets, @onAcceptCallback, @closeOnAccept)
10
12
  # closeModal()
11
13
  # -----------------------------------------------------------------------------
12
14
  class @Loft
@@ -48,12 +50,13 @@ class @Loft
48
50
  @selectMultipleAssets = true
49
51
  @store = @module.rootList.config.arrayStore
50
52
 
51
- @module.showModal = (assetType, selectMultipleAssets, callback, closeOnAccept) =>
52
- @showModal(assetType, selectMultipleAssets, callback, closeOnAccept)
53
-
54
53
  @_add_close_button()
55
54
  @_enable_grid_mode()
56
55
 
56
+ @module.showAll = $.proxy(@showAll, this)
57
+ @module.showImages = $.proxy(@showImages, this)
58
+ @module.showDocuments = $.proxy(@showDocuments, this)
59
+
57
60
  _add_close_button: ->
58
61
  @module.rootList.$modalCloseBtn =$ """<a href='#' class='modal-close'>
59
62
  <i class='fa fa-times'></i>
@@ -121,15 +124,24 @@ class @Loft
121
124
  list.groupActions.hide()
122
125
  list.$items.find(".asset-checkbox").prop("checked", false)
123
126
 
127
+ _show_modal: ($tab) ->
128
+ @module.$el.addClass("module-modal")
129
+ @module.show()
130
+ @module.activeList.selectTab($tab, true)
131
+
124
132
  # PUBLIC ====================================================================
125
133
 
134
+ showAll: (@selectMultipleAssets=false, @onAcceptCallback=$.noop, @closeOnAccept=true) ->
135
+ @_show_modal(@module.rootList.tabLinks[0])
136
+
137
+ showImages: (@selectMultipleAssets=false, @onAcceptCallback=$.noop, @closeOnAccept=true) ->
138
+ @_show_modal(@module.rootList.tabLinks[1])
139
+
140
+ showDocuments: (@selectMultipleAssets=false, @onAcceptCallback=$.noop, @closeOnAccept=true) ->
141
+ @_show_modal(@module.rootList.tabLinks[2])
142
+
126
143
  closeModal: ->
127
144
  @selectMultipleAssets = true
128
145
  @_clear_assets_selection(@module.activeList)
129
146
  @module.$el.removeClass("module-modal")
130
147
  @module.hide()
131
-
132
- showModal: (assetType="all", @selectMultipleAssets=false, @onAcceptCallback=$.noop, @closeOnAccept=true) ->
133
- @module.$el.addClass("module-modal")
134
- @module.show()
135
- @module.activeList.updateItems()
@@ -21,16 +21,15 @@ RedactorPlugins.loft = ->
21
21
  fileButton = @button.add('file', 'Insert File')
22
22
  @button.addCallback(fileButton, @loft.showAllModal)
23
23
 
24
-
25
24
  showImagesModal: ->
26
- chr.modules.loft.showModal 'images', true, (objects) => @loft.insertImages(objects)
27
-
25
+ chr.modules.loft.showImages true, (objects) =>
26
+ @loft.insertImages(objects)
28
27
 
29
28
  # allow multiple assets when no text is selected
30
29
  showAllModal: ->
31
30
  multipleAssets = this.selection.getText() == ''
32
- chr.modules.loft.showModal 'all', multipleAssets, (objects) => @loft.insertFiles(objects)
33
-
31
+ chr.modules.loft.showAll multipleAssets, (objects) =>
32
+ @loft.insertFiles(objects)
34
33
 
35
34
  # if text is selected replace text with <a>{{ text }}</a>
36
35
  # otherwise add link(s) split by <br/> tag
@@ -48,7 +47,6 @@ RedactorPlugins.loft = ->
48
47
 
49
48
  this.insert.html(html, false)
50
49
 
51
-
52
50
  insertImages: (objects) ->
53
51
  if objects.length > 0
54
52
  images = []
@@ -59,9 +57,4 @@ RedactorPlugins.loft = ->
59
57
 
60
58
  this.insert.html(html, false)
61
59
 
62
-
63
60
  return methods
64
-
65
-
66
-
67
-
@@ -8,16 +8,29 @@ module LoftAssetFileUploader
8
8
  "loft/#{ model._number }"
9
9
  end
10
10
 
11
+ version :_40x40_2x, if: :is_image? do
12
+ process :resize_to_fill => [80, 80]
13
+ end
11
14
 
12
15
  version :_200x150_2x, if: :is_image? do
13
16
  process :resize_to_fill => [400, 300]
14
17
  end
15
18
 
19
+ version :thumbnail, if: :is_image? do
20
+ process :resize_to_fill => [320, 320]
21
+ end
16
22
 
17
- version :_40x40_2x, if: :is_image? do
18
- process :resize_to_fill => [80, 80]
23
+ version :small, if: :is_image? do
24
+ process :resize_to_fit => [320, 320]
25
+ end
26
+
27
+ version :medium, if: :is_image? do
28
+ process :resize_to_fit => [640, 640]
19
29
  end
20
30
 
31
+ version :large, if: :is_image? do
32
+ process :resize_to_fit => [1280, 1280]
33
+ end
21
34
 
22
35
  def is_image? new_file
23
36
  model.is_image?
@@ -1,3 +1,3 @@
1
1
  module Loft
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -0,0 +1,12 @@
1
+ namespace :loft do
2
+ desc "Recreate Loft asset versions"
3
+ task :recreate_versions => :environment do
4
+ ::Asset.all.to_a.each do |a|
5
+ begin
6
+ a.file.recreate_versions!
7
+ rescue Errno::ENOENT
8
+ puts "Skip #{a._number}: source file not found"
9
+ end
10
+ end
11
+ end
12
+ end
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.summary = "Media assets manager for Character CMS"
14
14
  s.description = <<-DESC
15
15
  This plugin adds an assets library that provides an easy way
16
- to upload, manage and insert files into documents.
16
+ to upload, manage and insert file links to documents.
17
17
  DESC
18
18
 
19
19
  s.rubyforge_project = "loft"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kravets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-19 00:00:00.000000000 Z
11
+ date: 2015-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chr
@@ -152,7 +152,7 @@ dependencies:
152
152
  version: '10.0'
153
153
  description: |
154
154
  This plugin adds an assets library that provides an easy way
155
- to upload, manage and insert files into documents.
155
+ to upload, manage and insert file links to documents.
156
156
  email: alex@slatestudio.com
157
157
  executables: []
158
158
  extensions: []
@@ -183,6 +183,7 @@ files:
183
183
  - lib/loft/engine.rb
184
184
  - lib/loft/routing.rb
185
185
  - lib/loft/version.rb
186
+ - lib/tasks/recreate_versions.rake
186
187
  - loft.gemspec
187
188
  homepage: http://slatestudio.com
188
189
  licenses: