social_stream-documents 2.0.2 → 2.0.3

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: 14eb2d33b7fcbdd79dd2829dc0f7f552d197248d
4
- data.tar.gz: 581cb6aa512adc9c8418b0191a43ea093a180c2f
3
+ metadata.gz: c42c03de98964b570e7f81e554ee5156c2b44661
4
+ data.tar.gz: be71420001a10117f803d34188088edc9b05e6c5
5
5
  SHA512:
6
- metadata.gz: 9c9afbeb4fcf282ec2971e63afa3469a1e619c1ca1f5da6222463926fe9edf59943a3280c84e1198f32d233c3d8d830b4ea8d15abfcdb62c258724b86b79c812
7
- data.tar.gz: ea3f6f9bf048bf057601125f1220235e1b1fe4f9872c970d1adb2ace3af205332e4d207c54eeec7568f6abd9eb79226f8570b7807072717d9ac932ac70eb334b
6
+ metadata.gz: 2741931d8eb58d2ebfd0d05610c5be302d6d4603bb9996eb8659eb00df78fdae40b81ef6f99f127415f406827db4834a3dd0194d5967bd8d6545417292122e25
7
+ data.tar.gz: 5b84399cc4554171f7295946a7e3985dbaddb109c972f4b008c4da389e77f96e7fabce06421982dd2f2370d4b3e37ab008f0f3d5d927277205c72594f7b122da
@@ -28,22 +28,37 @@ SocialStream.Documents.Wall = (function(SS, $, undefined) {
28
28
  $('.wall_input button.new_document').click(function(event){
29
29
  event.preventDefault();
30
30
 
31
- $('label[for="new_document_title"]').show();
31
+ $('.wall_input input[type=file]').trigger('click');
32
+ });
32
33
 
33
- $('#post_text').
34
- attr('name', 'document[title]').
35
- attr('placeholder', I18n.t('document.title.input'));
34
+ $('.wall_input input[type=file]').change(function(){
35
+ if ($(this).val()) {
36
+ $('label[for="new_document_title"]').show();
36
37
 
37
- $('#new_document_description').show().val($('#post_text').val());
38
+ $('#post_text').
39
+ attr('name', 'document[title]').
40
+ attr('placeholder', I18n.t('document.title.input'));
38
41
 
39
- SocialStream.Wall.changeAction($(this).attr('data-path'));
40
- SocialStream.Wall.changeParams('document');
42
+ $('#new_document_description').show().val($('#post_text').val());
41
43
 
42
- $('.wall_input input[type=file]').trigger('click');
43
- });
44
+ SocialStream.Wall.changeAction($(this).closest('form').find('button.new_document').attr('data-path'));
45
+ SocialStream.Wall.changeParams('document');
44
46
 
45
- $('.wall_input input[type=file]').change(function(){
46
- $("#post_text").val($(this).val().replace(/C:\\fakepath\\/i, ''));
47
+ $("#post_text").val($(this).val().replace(/C:\\fakepath\\/i, ''));
48
+ } else {
49
+ $('label[for="new_document_title"]').hide();
50
+
51
+ $('#post_text').
52
+ attr('name', 'post[text]').
53
+ attr('placeholder', I18n.t('post.input'));
54
+
55
+ $('#new_document_description').hide();
56
+
57
+ SocialStream.Wall.changeAction();
58
+ SocialStream.Wall.changeParams();
59
+
60
+ $("#post_text").val($('#new_document_description').val());
61
+ }
47
62
  });
48
63
  };
49
64
 
@@ -36,7 +36,11 @@ module SocialStream
36
36
  Mime::Type.register "image/png", :png, [ "image/x-png" ]
37
37
  end
38
38
  unless defined? Mime::BMP
39
- Mime::Type.register "image/bmp", :bmp
39
+ Mime::Type.register "image/bmp", :bmp, [ "image/x-ms-bmp" ]
40
+ else
41
+ # Manually register synonym
42
+ Mime::BMP.instance_variable_get("@synonyms") << "image/x-ms-bmp"
43
+ Mime::LOOKUP["image/x-ms-bmp"] = Mime::BMP
40
44
  end
41
45
 
42
46
  # Audio
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Documents
3
- VERSION = "2.0.2".freeze
3
+ VERSION = "2.0.3".freeze
4
4
  end
5
5
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.files = `git ls-files`.split("\n")
13
13
 
14
14
  # Gem dependencies
15
- s.add_runtime_dependency('social_stream-base', '~> 2.0.2')
15
+ s.add_runtime_dependency('social_stream-base', '~> 2.0.3')
16
16
 
17
17
  s.add_runtime_dependency('paperclip','~> 3.3.0')
18
18
  s.add_runtime_dependency('paperclip-ffmpeg', '~> 0.9.0')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-documents
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Víctor Sánchez Belmar
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-29 00:00:00.000000000 Z
12
+ date: 2013-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: social_stream-base
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
- version: 2.0.2
20
+ version: 2.0.3
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- version: 2.0.2
27
+ version: 2.0.3
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: paperclip
30
30
  requirement: !ruby/object:Gem::Requirement