brightcontent-attachments 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f769f955d59cd97b6d9f32d7c08b72837d9934e
4
- data.tar.gz: 64929656a9481e7379b1d35f52f26785152240fd
3
+ metadata.gz: e5fdc34f41c4c7f4dcb884c3ea3f317707b8f882
4
+ data.tar.gz: 4f6b6840592d60a6a4e1b8c3f610fa7d703615fb
5
5
  SHA512:
6
- metadata.gz: 406f79e682ece2ba18b067624012c751360dff72b24d9007a482948040d6d2ca91d1466e0c2bc1d818f09a90c36a129dc102411b0b2187f35d9e437a4f102b99
7
- data.tar.gz: 502cef5428231c9ac4b025561fde872ffabbeb92be0ff3f101d022a4fafd1abfc6cb212999a4819cb575d7c7bb4df299d1297bce1f5bab17fd54809bd7b48986
6
+ metadata.gz: bf821102f7280df10d5f8a7eae57c26da07e42325408c7b80a907a61c4dfcf522ef6e5e67ceaf9efd23a47977cd6a31215bebd735e52ca200906a948e46c7158
7
+ data.tar.gz: dbf29736c369161493fb37d5a60f719172ff294a4e738e02e618b4efe6d29a8027b8a46afa8f7408fa6804e86648f0b449828cdf6ea5c8d719ede4094cf22850
@@ -3,6 +3,7 @@
3
3
 
4
4
  $ ->
5
5
  request_url = $("#attachable_url").val()
6
+ editor = $("#insertable").data("wysihtml5").editor
6
7
 
7
8
  spinner = new Spinner().spin()
8
9
  $('#fileupload').fileupload
@@ -20,8 +21,20 @@ $ ->
20
21
  $("#fileupload").attr disabled: false
21
22
  $("#attachments-controls").css opacity: 1
22
23
 
24
+ $("#attachments").on "click", ".insert-image", (e) ->
25
+ e.preventDefault()
26
+ editor.composer.commands.exec "insertImage",
27
+ src: $(this).attr "href"
23
28
 
24
- $("#attachments").on "click", ".delete", ->
29
+ $("#attachments").on "click", ".insert-link", (e) ->
30
+ e.preventDefault()
31
+ editor.composer.commands.exec "createLink",
32
+ href: $(this).attr "href"
33
+ target: "_blank"
34
+ rel: "nofollow"
35
+ text: $(this).data("name")
36
+
37
+ $("#attachments").on "click", ".delete", (e) ->
25
38
  el = $(this).parents(".attachment")
26
39
  spinner.spin el[0]
27
40
  el.css opacity: 0.5
@@ -6,11 +6,11 @@
6
6
  <div class="media-body">
7
7
  <h4 class="attachment-file media-heading"><%= attachment.asset_file_name %></h4>
8
8
  <% if attachment.image? %>
9
- <%= link_to "Insert", nil, class: "insert insert_image btn btn-primary btn-xs", data: { insert_image: attachment.url(:main) } %>
9
+ <%= link_to "Insert", attachment.url(:main), class: "insert insert-image btn btn-primary btn-xs" %>
10
10
  <% else %>
11
- <%= link_to "Insert", nil, class: "insert insert_link btn btn-primary btn-xs", data: { insert_url: attachment.url(:original), insert_name: attachment.asset_file_name } %>
11
+ <%= link_to "Insert", attachment.url(:original), class: "insert insert-link btn btn-primary btn-xs", data: { name: attachment.asset_file_name } %>
12
12
  <% end %>
13
- <%= link_to "Delete", destroy_attachment_path(attachment.id), class: "delete btn btn-danger btn-xs", method: "delete" %>
13
+ <%= link_to "Delete", destroy_attachment_path(attachment.id), class: "delete btn btn-danger btn-xs" %>
14
14
  </div>
15
15
  </div>
16
16
  </li>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brightcontent-attachments
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Developers at Brightin
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.0
19
+ version: 2.3.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.3.0
26
+ version: 2.3.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: paperclip
29
29
  requirement: !ruby/object:Gem::Requirement