tb_media 1.2.0 → 1.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.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/admin/media/application.js +0 -1
  3. data/app/assets/javascripts/admin/media/picker.js +47 -13
  4. data/app/assets/javascripts/admin/media/plugin.js.erb +5 -3
  5. data/app/models/spud_media.rb +1 -1
  6. data/app/views/admin/media_picker/index.html.erb +5 -1
  7. data/lib/spud_media/version.rb +1 -1
  8. data/spec/dummy/db/migrate/20151012194530_create_spud_roles.tb_core.rb +11 -0
  9. data/spec/dummy/db/migrate/20151012194531_create_spud_permissions.tb_core.rb +11 -0
  10. data/spec/dummy/db/migrate/20151012194532_create_spud_role_permissions.tb_core.rb +12 -0
  11. data/spec/dummy/db/migrate/20151012194533_drop_spud_admin_permissions.tb_core.rb +16 -0
  12. data/spec/dummy/db/migrate/20151012194534_add_requires_password_change_to_spud_users.tb_core.rb +6 -0
  13. data/spec/dummy/db/schema.rb +67 -48
  14. data/spec/dummy/public/system/spud_media/1/cropped/test_img1.png +0 -0
  15. data/spec/dummy/public/system/spud_media/1/small/test_img1.png +0 -0
  16. data/spec/dummy/public/system/spud_media/2/cropped/test_img1.png +0 -0
  17. data/spec/dummy/public/system/spud_media/2/small/test_img1.png +0 -0
  18. data/spec/dummy/public/system/spud_media/3/cropped/test_img1.png +0 -0
  19. data/spec/dummy/public/system/spud_media/3/small/test_img1.png +0 -0
  20. data/spec/dummy/public/system/spud_media/4/cropped/test_img1.png +0 -0
  21. data/spec/dummy/public/system/spud_media/4/small/test_img1.png +0 -0
  22. data/spec/dummy/public/system/spud_media/5/cropped/test_img1.png +0 -0
  23. data/spec/dummy/public/system/spud_media/5/small/test_img1.png +0 -0
  24. metadata +23 -4
  25. data/app/assets/javascripts/admin/media/utils.js +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2346e4b40486aa8457024ae860e82ddd2f967b23
4
- data.tar.gz: e7520766aa0f18b3d68a28c7f7eba0f4234fc70c
3
+ metadata.gz: 16f0a55ec656f1ee487ff39fcb9a93230854cf8e
4
+ data.tar.gz: 16f7960348f0918610608ab85079eccbe95dacd2
5
5
  SHA512:
6
- metadata.gz: 80ba5cd98b543017db866a4703ff66ec08833cb041f07e4712d71ba3c7940aaacc58b7140b84a74b1de74f6e81f764f0a5ab6337ce5404935829c95b55ec3dba
7
- data.tar.gz: cc9edb5f94db9708bdb85c909b7966a8b0cda9895c6f1f51d0466490179b6214e161bdc71198cea71ef09f1a642e95808501395eb035f9e297aa3eadea173de2
6
+ metadata.gz: 4e59f606e31de84bad6bafbc05a216184da92d610734b14b6342dda668b1ae99908e259cfddf86e72e5e13edd840e6fea5d9dd31c0ec3135b59bdfd21265f68d
7
+ data.tar.gz: 6800dd0b04f58df98b2a203356503f5720bbe05afb55042a08b4c249d3f135bb5aa75993628016f92c62485b4e3e1a26b53ec74c59d8922b3a01c8690b6d43ef
@@ -1,7 +1,6 @@
1
1
  //= require jcrop/js/jquery.Jcrop
2
2
  //= require admin/media/plugin
3
3
  //= require_self
4
- //= require admin/media/utils
5
4
 
6
5
  spud.admin.media = new function(){
7
6
 
@@ -1,7 +1,6 @@
1
1
  //= require jquery
2
2
  //= require jquery_ujs
3
3
  //= require_self
4
- //= require admin/media/utils
5
4
 
6
5
  if(typeof(spud) === 'undefined'){
7
6
  spud = {admin:{media:{}}};
@@ -31,6 +30,25 @@ spud.admin.mediapicker = new function(){
31
30
  $('.spud_media_picker_option_dimensions').on('blur', 'input', self.dimensionsChanged);
32
31
  $('.spud_media_picker_option').on('keyup', 'input[type=text]', self.pickerOptionKeyDown);
33
32
  $('.spud_media_picker_list').on('scroll', onListScroll);
33
+ self.loadSelectedImage();
34
+ };
35
+
36
+ self.loadSelectedImage = function(){
37
+ var node = parent.tinyMCE.activeEditor.selection.getNode();
38
+ if(node.nodeName == 'IMG' && !node.getAttribute('data-mce-object') && !node.getAttribute('data-mce-placeholder')){
39
+ var $img = $(node);
40
+ selectedFile = {
41
+ type: 'img',
42
+ name: node.src.split('/').pop(),
43
+ url: node.src,
44
+ alt: $img.attr('alt'),
45
+ title: $img.attr('title'),
46
+ width: $img.attr('width'),
47
+ height: $img.attr('height'),
48
+ float: $img.css('float')
49
+ };
50
+ self.goToTab('#spud_media_picker_tab_advanced');
51
+ }
34
52
  };
35
53
 
36
54
  var onListScroll = function(e){
@@ -100,6 +118,13 @@ spud.admin.mediapicker = new function(){
100
118
 
101
119
  self.clickedUseSelected = function(e){
102
120
  e.preventDefault();
121
+ var $selected = $('.spud_media_picker_item_selected');
122
+ selectedFile = {
123
+ id: $selected.attr('data-id'),
124
+ type: $selected.attr('data-type'),
125
+ url: $selected.attr('data-url'),
126
+ name: $selected.attr('data-name')
127
+ };
103
128
  self.goToTab('#spud_media_picker_tab_advanced');
104
129
  };
105
130
 
@@ -185,23 +210,20 @@ spud.admin.mediapicker = new function(){
185
210
  };
186
211
 
187
212
  this.activatedAdvancedTab = function(){
188
- var selected = $('.spud_media_picker_item_selected');
189
- selectedFile = {
190
- id: selected.attr('data-id'),
191
- type: selected.attr('data-type'),
192
- url: selected.attr('data-url'),
193
- name: selected.attr('data-name'),
194
- size: selected.attr('data-size'),
195
- lastmod: selected.attr('data-lastmod'),
196
- isprotected: selected.attr('data-protected')
197
- };
198
213
  $('input[name="spud_media_picker_option_selected_file"]').val(selectedFile.name);
214
+ $('input[name="spud_media_picker_option_title"]').val(selectedFile.title);
215
+ $('input[name="spud_media_picker_option_alt"]').val(selectedFile.alt);
216
+ $('input[name="spud_media_picker_option_dimension_w"]').val(selectedFile.width);
217
+ $('input[name="spud_media_picker_option_dimension_h"]').val(selectedFile.height);
218
+ $('select[name="spud_media_picker_option_float"]').val(selectedFile.float);
219
+
199
220
  $('input[name="spud_media_picker_option_type"]').val(selectedFile.type == 'img' ? 'Image' : 'File');
200
221
  if(selectedFile.type == 'img'){
201
222
  $('.spud_media_picker_option_target').hide();
202
223
  $('.spud_media_picker_option_text').hide();
203
224
  $('.spud_media_picker_option_float').show();
204
225
  $('.spud_media_picker_option_title').show();
226
+ $('.spud_media_picker_option_alt').show();
205
227
  $('.spud_media_picker_option_dimensions').show();
206
228
  self.getOriginalImageDimensions(selectedFile.url);
207
229
  }
@@ -211,6 +233,7 @@ spud.admin.mediapicker = new function(){
211
233
  $('.spud_media_picker_option_text input').val(parent.tinyMCE.activeEditor.selection.getContent());
212
234
  $('.spud_media_picker_option_float').hide();
213
235
  $('.spud_media_picker_option_title').hide();
236
+ $('.spud_media_picker_option_alt').hide();
214
237
  $('.spud_media_picker_option_dimensions').hide();
215
238
  }
216
239
  };
@@ -247,8 +270,9 @@ spud.admin.mediapicker = new function(){
247
270
  e.preventDefault();
248
271
  if(selectedFile.type == 'img'){
249
272
  selectedFile.title = $('input[name="spud_media_picker_option_title"]').val();
250
- selectedFile.width = spud.admin.media.parseIntOrDefault({value: $('input[name="spud_media_picker_option_dimension_w"]').val(), defVal: ""});
251
- selectedFile.height = spud.admin.media.parseIntOrDefault({value: $('input[name="spud_media_picker_option_dimension_h"]').val(), defVal: ""});
273
+ selectedFile.alt = $('input[name="spud_media_picker_option_alt"]').val();
274
+ selectedFile.width = parseIntOrDefault($('input[name="spud_media_picker_option_dimension_w"]').val());
275
+ selectedFile.height = parseIntOrDefault($('input[name="spud_media_picker_option_dimension_h"]').val());
252
276
  var float = $('select[name="spud_media_picker_option_float"]').val();
253
277
  var style = "";
254
278
  if(float){
@@ -268,6 +292,16 @@ spud.admin.mediapicker = new function(){
268
292
  parent.tinyMCE.activeEditor.windowManager.close();
269
293
  };
270
294
 
295
+ var parseIntOrDefault = function(value) {
296
+ var result = parseInt(value, 10);
297
+ if(isNaN(result)) {
298
+ return '';
299
+ }
300
+ else{
301
+ return result;
302
+ }
303
+ };
304
+
271
305
  self.pickerOptionKeyDown = function(e){
272
306
  if(e.keyCode == 13){
273
307
  self.clickedInsert(e);
@@ -27,7 +27,7 @@
27
27
  // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
28
28
  ed.addCommand('spudMediaShowPicker', function(){
29
29
  ed.windowManager.open({
30
- title: 'Spud Media Picker',
30
+ title: 'Media Picker',
31
31
  file: '/admin/media_picker',
32
32
  width: 450 + parseInt(ed.getLang('example.delta_width', 0), 10),
33
33
  height: 300 + parseInt(ed.getLang('example.delta_height', 0), 10),
@@ -41,9 +41,10 @@
41
41
 
42
42
  // Register picker button
43
43
  ed.addButton('spud_media_picker', {
44
- title: 'Insert Spud Media',
44
+ title: 'Insert Media',
45
45
  cmd: 'spudMediaShowPicker',
46
- image: '<%= asset_path('admin/media_tiny.png') %>'
46
+ image: '<%= asset_path('admin/media_tiny.png') %>',
47
+ stateSelector: 'img:not([data-mce-object],[data-mce-placeholder])'
47
48
  });
48
49
 
49
50
  ed.addCommand('spudMediaInsertSelected', function(ui, data){
@@ -51,6 +52,7 @@
51
52
  var img = ed.dom.createHTML('img', {
52
53
  src: data.url,
53
54
  title: data.title,
55
+ alt: data.alt,
54
56
  style: data.style,
55
57
  width: data.width,
56
58
  height: data.height
@@ -102,7 +102,7 @@ class SpudMedia < ActiveRecord::Base
102
102
  if has_custom_crop?
103
103
  styles[:cropped] = {:geometry => '', :convert_options => "-strip -resize #{crop_s}% -crop #{crop_w}x#{crop_h}+#{crop_x}+#{crop_y}"}
104
104
  else
105
- styles[:cropped] = {:geometry => '1280x1280>', :format => :jpg, :convert_options => '-strip -quality 85', :source_file_options => '-density 72'}
105
+ styles[:cropped] = {:geometry => '1280x1280>', :convert_options => '-strip -quality 85', :source_file_options => '-density 72'}
106
106
  end
107
107
  end
108
108
  return styles
@@ -1,6 +1,6 @@
1
1
  <html>
2
2
  <head>
3
- <title>Spud Media Picker</title>
3
+ <title>Media Picker</title>
4
4
  <%= stylesheet_link_tag 'admin/core/application' %>
5
5
  <%= stylesheet_link_tag 'admin/media/application' %>
6
6
  <%= javascript_include_tag 'admin/media/picker' %>
@@ -81,6 +81,10 @@
81
81
  <label>Title:</label>
82
82
  <input name="spud_media_picker_option_title" type="text" />
83
83
  </div>
84
+ <div class="spud_media_picker_option spud_media_picker_option_alt">
85
+ <label>Alt Text:</label>
86
+ <input name="spud_media_picker_option_alt" type="text" />
87
+ </div>
84
88
  <div class="spud_media_picker_option spud_media_picker_option_dimensions">
85
89
  <label>Dimensions:</label>
86
90
  <input name="spud_media_picker_option_dimension_w" type="text" placeholder="auto" /> px by <input name="spud_media_picker_option_dimension_h" type="text" placeholder="auto" /> px
@@ -1,5 +1,5 @@
1
1
  module Spud
2
2
  module Media
3
- VERSION = "1.2.0"
3
+ VERSION = "1.2.1"
4
4
  end
5
5
  end
@@ -0,0 +1,11 @@
1
+ # This migration comes from tb_core (originally 20130620143010)
2
+ class CreateSpudRoles < ActiveRecord::Migration
3
+ def change
4
+ create_table :spud_roles do |t|
5
+ t.string :name
6
+ t.timestamps
7
+ end
8
+ add_column :spud_users, :spud_role_id, :integer
9
+ add_index :spud_users, :spud_role_id
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # This migration comes from tb_core (originally 20130620143941)
2
+ class CreateSpudPermissions < ActiveRecord::Migration
3
+ def change
4
+ create_table :spud_permissions do |t|
5
+ t.string :name, :null => false
6
+ t.string :tag, :null => false
7
+ t.timestamps
8
+ end
9
+ add_index :spud_permissions, :tag, :unique => true
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ # This migration comes from tb_core (originally 20130620151132)
2
+ class CreateSpudRolePermissions < ActiveRecord::Migration
3
+ def change
4
+ create_table :spud_role_permissions do |t|
5
+ t.integer :spud_role_id, :null => false
6
+ t.string :spud_permission_tag, :null => false
7
+ t.timestamps
8
+ end
9
+ add_index :spud_role_permissions, :spud_role_id
10
+ add_index :spud_role_permissions, :spud_permission_tag
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ # This migration comes from tb_core (originally 20130620163144)
2
+ class DropSpudAdminPermissions < ActiveRecord::Migration
3
+ def up
4
+ drop_table :spud_admin_permissions
5
+ end
6
+
7
+ def down
8
+ create_table :spud_admin_permissions do |t|
9
+ t.integer :user_id
10
+ t.string :name
11
+ t.boolean :access
12
+ t.string :scope
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,6 @@
1
+ # This migration comes from tb_core (originally 20150610143438)
2
+ class AddRequiresPasswordChangeToSpudUsers < ActiveRecord::Migration
3
+ def change
4
+ add_column :spud_users, :requires_password_change, :boolean, :default => false
5
+ end
6
+ end
@@ -9,66 +9,85 @@
9
9
  # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
10
  # you'll amass, the slower it'll run and the greater likelihood for issues).
11
11
  #
12
- # It's strongly recommended to check this file into your version control system.
12
+ # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20130904141448) do
14
+ ActiveRecord::Schema.define(version: 20151012194534) do
15
15
 
16
- create_table "spud_admin_permissions", :force => true do |t|
17
- t.integer "user_id"
18
- t.string "name"
19
- t.boolean "access"
20
- t.datetime "created_at", :null => false
21
- t.datetime "updated_at", :null => false
22
- t.string "scope"
16
+ create_table "spud_media", force: :cascade do |t|
17
+ t.string "attachment_content_type", limit: 255
18
+ t.integer "attachment_file_size", limit: 4
19
+ t.string "attachment_file_name", limit: 255
20
+ t.datetime "created_at"
21
+ t.datetime "updated_at"
22
+ t.boolean "is_protected", limit: 1, default: false
23
+ t.datetime "attachment_updated_at"
24
+ t.integer "crop_x", limit: 4, default: 0
25
+ t.integer "crop_y", limit: 4, default: 0
26
+ t.integer "crop_w", limit: 4
27
+ t.integer "crop_h", limit: 4
28
+ t.integer "crop_s", limit: 4, default: 100
23
29
  end
24
30
 
25
- create_table "spud_media", :force => true do |t|
26
- t.string "attachment_content_type"
27
- t.integer "attachment_file_size"
28
- t.string "attachment_file_name"
29
- t.datetime "created_at", :null => false
30
- t.datetime "updated_at", :null => false
31
- t.boolean "is_protected", :default => false
32
- t.datetime "attachment_updated_at"
33
- t.integer "crop_x", :default => 0
34
- t.integer "crop_y", :default => 0
35
- t.integer "crop_w"
36
- t.integer "crop_h"
37
- t.integer "crop_s", :default => 100
31
+ create_table "spud_permissions", force: :cascade do |t|
32
+ t.string "name", limit: 255, null: false
33
+ t.string "tag", limit: 255, null: false
34
+ t.datetime "created_at"
35
+ t.datetime "updated_at"
36
+ end
37
+
38
+ add_index "spud_permissions", ["tag"], name: "index_spud_permissions_on_tag", unique: true, using: :btree
39
+
40
+ create_table "spud_role_permissions", force: :cascade do |t|
41
+ t.integer "spud_role_id", limit: 4, null: false
42
+ t.string "spud_permission_tag", limit: 255, null: false
43
+ t.datetime "created_at"
44
+ t.datetime "updated_at"
45
+ end
46
+
47
+ add_index "spud_role_permissions", ["spud_permission_tag"], name: "index_spud_role_permissions_on_spud_permission_tag", using: :btree
48
+ add_index "spud_role_permissions", ["spud_role_id"], name: "index_spud_role_permissions_on_spud_role_id", using: :btree
49
+
50
+ create_table "spud_roles", force: :cascade do |t|
51
+ t.string "name", limit: 255
52
+ t.datetime "created_at"
53
+ t.datetime "updated_at"
38
54
  end
39
55
 
40
- create_table "spud_user_settings", :force => true do |t|
41
- t.integer "spud_user_id"
42
- t.string "key"
43
- t.string "value"
44
- t.datetime "created_at", :null => false
45
- t.datetime "updated_at", :null => false
56
+ create_table "spud_user_settings", force: :cascade do |t|
57
+ t.integer "spud_user_id", limit: 4
58
+ t.string "key", limit: 255
59
+ t.string "value", limit: 255
60
+ t.datetime "created_at"
61
+ t.datetime "updated_at"
46
62
  end
47
63
 
48
- create_table "spud_users", :force => true do |t|
49
- t.string "first_name"
50
- t.string "last_name"
51
- t.boolean "super_admin"
52
- t.string "login", :null => false
53
- t.string "email", :null => false
54
- t.string "crypted_password", :null => false
55
- t.string "password_salt", :null => false
56
- t.string "persistence_token", :null => false
57
- t.string "single_access_token", :null => false
58
- t.string "perishable_token", :null => false
59
- t.integer "login_count", :default => 0, :null => false
60
- t.integer "failed_login_count", :default => 0, :null => false
64
+ create_table "spud_users", force: :cascade do |t|
65
+ t.string "first_name", limit: 255
66
+ t.string "last_name", limit: 255
67
+ t.boolean "super_admin", limit: 1
68
+ t.string "login", limit: 255, null: false
69
+ t.string "email", limit: 255, null: false
70
+ t.string "crypted_password", limit: 255, null: false
71
+ t.string "password_salt", limit: 255, null: false
72
+ t.string "persistence_token", limit: 255, null: false
73
+ t.string "single_access_token", limit: 255, null: false
74
+ t.string "perishable_token", limit: 255, null: false
75
+ t.integer "login_count", limit: 4, default: 0, null: false
76
+ t.integer "failed_login_count", limit: 4, default: 0, null: false
61
77
  t.datetime "last_request_at"
62
78
  t.datetime "current_login_at"
63
79
  t.datetime "last_login_at"
64
- t.string "current_login_ip"
65
- t.string "last_login_ip"
66
- t.datetime "created_at", :null => false
67
- t.datetime "updated_at", :null => false
68
- t.string "time_zone"
80
+ t.string "current_login_ip", limit: 255
81
+ t.string "last_login_ip", limit: 255
82
+ t.datetime "created_at"
83
+ t.datetime "updated_at"
84
+ t.string "time_zone", limit: 255
85
+ t.integer "spud_role_id", limit: 4
86
+ t.boolean "requires_password_change", limit: 1, default: false
69
87
  end
70
88
 
71
- add_index "spud_users", ["email"], :name => "index_spud_users_on_email"
72
- add_index "spud_users", ["login"], :name => "index_spud_users_on_login"
89
+ add_index "spud_users", ["email"], name: "index_spud_users_on_email", using: :btree
90
+ add_index "spud_users", ["login"], name: "index_spud_users_on_login", using: :btree
91
+ add_index "spud_users", ["spud_role_id"], name: "index_spud_users_on_spud_role_id", using: :btree
73
92
 
74
93
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tb_media
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Westlake Design
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-26 00:00:00.000000000 Z
11
+ date: 2015-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tb_core
@@ -163,7 +163,6 @@ files:
163
163
  - app/assets/javascripts/admin/media/application.js
164
164
  - app/assets/javascripts/admin/media/picker.js
165
165
  - app/assets/javascripts/admin/media/plugin.js.erb
166
- - app/assets/javascripts/admin/media/utils.js
167
166
  - app/assets/libs/jcrop/css/Jcrop.gif
168
167
  - app/assets/libs/jcrop/css/jquery.Jcrop.css
169
168
  - app/assets/libs/jcrop/css/jquery.Jcrop.min.css
@@ -235,24 +234,34 @@ files:
235
234
  - spec/dummy/db/migrate/20130904141446_create_spud_media.tb_media.rb
236
235
  - spec/dummy/db/migrate/20130904141447_add_protected_to_spud_media.tb_media.rb
237
236
  - spec/dummy/db/migrate/20130904141448_add_cropping_to_spud_media.tb_media.rb
237
+ - spec/dummy/db/migrate/20151012194530_create_spud_roles.tb_core.rb
238
+ - spec/dummy/db/migrate/20151012194531_create_spud_permissions.tb_core.rb
239
+ - spec/dummy/db/migrate/20151012194532_create_spud_role_permissions.tb_core.rb
240
+ - spec/dummy/db/migrate/20151012194533_drop_spud_admin_permissions.tb_core.rb
241
+ - spec/dummy/db/migrate/20151012194534_add_requires_password_change_to_spud_users.tb_core.rb
238
242
  - spec/dummy/db/schema.rb
239
243
  - spec/dummy/public/404.html
240
244
  - spec/dummy/public/422.html
241
245
  - spec/dummy/public/500.html
242
246
  - spec/dummy/public/favicon.ico
243
247
  - spec/dummy/public/system/spud_media/1/cropped/test_img1.jpg
248
+ - spec/dummy/public/system/spud_media/1/cropped/test_img1.png
244
249
  - spec/dummy/public/system/spud_media/1/original/test_img1.png
245
250
  - spec/dummy/public/system/spud_media/1/small/test_img1.png
246
251
  - spec/dummy/public/system/spud_media/2/cropped/test_img1.jpg
252
+ - spec/dummy/public/system/spud_media/2/cropped/test_img1.png
247
253
  - spec/dummy/public/system/spud_media/2/original/test_img1.png
248
254
  - spec/dummy/public/system/spud_media/2/small/test_img1.png
249
255
  - spec/dummy/public/system/spud_media/3/cropped/test_img1.jpg
256
+ - spec/dummy/public/system/spud_media/3/cropped/test_img1.png
250
257
  - spec/dummy/public/system/spud_media/3/original/test_img1.png
251
258
  - spec/dummy/public/system/spud_media/3/small/test_img1.png
252
259
  - spec/dummy/public/system/spud_media/4/cropped/test_img1.jpg
260
+ - spec/dummy/public/system/spud_media/4/cropped/test_img1.png
253
261
  - spec/dummy/public/system/spud_media/4/original/test_img1.png
254
262
  - spec/dummy/public/system/spud_media/4/small/test_img1.png
255
263
  - spec/dummy/public/system/spud_media/5/cropped/test_img1.jpg
264
+ - spec/dummy/public/system/spud_media/5/cropped/test_img1.png
256
265
  - spec/dummy/public/system/spud_media/5/original/test_img1.png
257
266
  - spec/dummy/public/system/spud_media/5/small/test_img1.png
258
267
  - spec/dummy/script/rails
@@ -284,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
284
293
  version: '0'
285
294
  requirements: []
286
295
  rubyforge_project:
287
- rubygems_version: 2.4.2
296
+ rubygems_version: 2.4.6
288
297
  signing_key:
289
298
  specification_version: 4
290
299
  summary: TB File upload/management module
@@ -319,24 +328,34 @@ test_files:
319
328
  - spec/dummy/db/migrate/20130904141446_create_spud_media.tb_media.rb
320
329
  - spec/dummy/db/migrate/20130904141447_add_protected_to_spud_media.tb_media.rb
321
330
  - spec/dummy/db/migrate/20130904141448_add_cropping_to_spud_media.tb_media.rb
331
+ - spec/dummy/db/migrate/20151012194530_create_spud_roles.tb_core.rb
332
+ - spec/dummy/db/migrate/20151012194531_create_spud_permissions.tb_core.rb
333
+ - spec/dummy/db/migrate/20151012194532_create_spud_role_permissions.tb_core.rb
334
+ - spec/dummy/db/migrate/20151012194533_drop_spud_admin_permissions.tb_core.rb
335
+ - spec/dummy/db/migrate/20151012194534_add_requires_password_change_to_spud_users.tb_core.rb
322
336
  - spec/dummy/db/schema.rb
323
337
  - spec/dummy/public/404.html
324
338
  - spec/dummy/public/422.html
325
339
  - spec/dummy/public/500.html
326
340
  - spec/dummy/public/favicon.ico
327
341
  - spec/dummy/public/system/spud_media/1/cropped/test_img1.jpg
342
+ - spec/dummy/public/system/spud_media/1/cropped/test_img1.png
328
343
  - spec/dummy/public/system/spud_media/1/original/test_img1.png
329
344
  - spec/dummy/public/system/spud_media/1/small/test_img1.png
330
345
  - spec/dummy/public/system/spud_media/2/cropped/test_img1.jpg
346
+ - spec/dummy/public/system/spud_media/2/cropped/test_img1.png
331
347
  - spec/dummy/public/system/spud_media/2/original/test_img1.png
332
348
  - spec/dummy/public/system/spud_media/2/small/test_img1.png
333
349
  - spec/dummy/public/system/spud_media/3/cropped/test_img1.jpg
350
+ - spec/dummy/public/system/spud_media/3/cropped/test_img1.png
334
351
  - spec/dummy/public/system/spud_media/3/original/test_img1.png
335
352
  - spec/dummy/public/system/spud_media/3/small/test_img1.png
336
353
  - spec/dummy/public/system/spud_media/4/cropped/test_img1.jpg
354
+ - spec/dummy/public/system/spud_media/4/cropped/test_img1.png
337
355
  - spec/dummy/public/system/spud_media/4/original/test_img1.png
338
356
  - spec/dummy/public/system/spud_media/4/small/test_img1.png
339
357
  - spec/dummy/public/system/spud_media/5/cropped/test_img1.jpg
358
+ - spec/dummy/public/system/spud_media/5/cropped/test_img1.png
340
359
  - spec/dummy/public/system/spud_media/5/original/test_img1.png
341
360
  - spec/dummy/public/system/spud_media/5/small/test_img1.png
342
361
  - spec/dummy/Rakefile
@@ -1,18 +0,0 @@
1
- /* parseIntOrDefault
2
- * @params
3
- * val {required} = value to be parsed
4
- * defVal {required} = default return value if parsing fails
5
- * radix {optional} = base
6
- */
7
- spud.admin.media.parseIntOrDefault = function(params) {
8
- var radix = params.radix || 10;
9
- var val = params.val;
10
- var result = parseInt(val, radix);
11
- if(isNaN(result)) {
12
- result = 0;
13
- if(params.hasOwnProperty('defVal')) {
14
- result = params.defVal;
15
- }
16
- }
17
- return result;
18
- };