brightcontent-attachments 2.3.2 → 2.3.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:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e9e263df1f00e6f0657dea17835f4a15277e6583
         | 
| 4 | 
            +
              data.tar.gz: a62fbc90cb1a9ff647d7ec1578d1c17b26546009
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: bc934c36eea8d60306df10b7369215adf99c9e2afe73a67b37a85d7d5c609c76ad093cb774e071e8bd4375b4e65a98ca8c426f0d490a3b6a2c15b1febdededc9
         | 
| 7 | 
            +
              data.tar.gz: f4f8525320c75319f19c9f9c7285b8c880d9584a793f3ca01059e541f297acb4b918dfa820490645226edbca41c397239d12e25a6400eb922dee749b55ffa060
         | 
| @@ -0,0 +1,88 @@ | |
| 1 | 
            +
            //= require jquery-fileupload/basic
         | 
| 2 | 
            +
            //= require spin
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            $(function() {
         | 
| 5 | 
            +
              var request_url = $("#attachable_url").val();
         | 
| 6 | 
            +
              var spinner = new Spinner().spin();
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              $('#fileupload').fileupload({
         | 
| 9 | 
            +
                method: "PUT",
         | 
| 10 | 
            +
                send: function() {
         | 
| 11 | 
            +
                  spinner.spin($("#attachments-controls")[0]);
         | 
| 12 | 
            +
                  $("#attachments *").attr({
         | 
| 13 | 
            +
                    disabled: true
         | 
| 14 | 
            +
                  });
         | 
| 15 | 
            +
                  $("#fileupload").attr({
         | 
| 16 | 
            +
                    disabled: true
         | 
| 17 | 
            +
                  });
         | 
| 18 | 
            +
                  $("#attachments-controls").css({
         | 
| 19 | 
            +
                    opacity: 0.5
         | 
| 20 | 
            +
                  });
         | 
| 21 | 
            +
                },
         | 
| 22 | 
            +
                done: function(e, data) {
         | 
| 23 | 
            +
                  $.get(request_url, function(attachments_view) {
         | 
| 24 | 
            +
                    $('#attachments').html(attachments_view);
         | 
| 25 | 
            +
                    spinner.stop();
         | 
| 26 | 
            +
                    $("#fileupload").attr({
         | 
| 27 | 
            +
                      disabled: false
         | 
| 28 | 
            +
                    });
         | 
| 29 | 
            +
                    $("#attachments-controls").css({
         | 
| 30 | 
            +
                      opacity: 1
         | 
| 31 | 
            +
                    });
         | 
| 32 | 
            +
                  });
         | 
| 33 | 
            +
                }
         | 
| 34 | 
            +
              });
         | 
| 35 | 
            +
             | 
| 36 | 
            +
              $("#attachments").on("click", ".insert-image", function(e) {
         | 
| 37 | 
            +
                e.preventDefault();
         | 
| 38 | 
            +
                var editor = $("#insertable").data("wysihtml5").editor;
         | 
| 39 | 
            +
                editor.composer.commands.exec("insertImage", {
         | 
| 40 | 
            +
                  src: $(this).attr("href")
         | 
| 41 | 
            +
                });
         | 
| 42 | 
            +
              });
         | 
| 43 | 
            +
             | 
| 44 | 
            +
              $("#attachments").on("click", ".insert-link", function(e) {
         | 
| 45 | 
            +
                e.preventDefault();
         | 
| 46 | 
            +
                var editor = $("#insertable").data("wysihtml5").editor;
         | 
| 47 | 
            +
                editor.composer.commands.exec("createLink", {
         | 
| 48 | 
            +
                  href: $(this).attr("href"),
         | 
| 49 | 
            +
                  target: "_blank",
         | 
| 50 | 
            +
                  rel: "nofollow",
         | 
| 51 | 
            +
                  text: $(this).data("name")
         | 
| 52 | 
            +
                });
         | 
| 53 | 
            +
              });
         | 
| 54 | 
            +
             | 
| 55 | 
            +
              $("#attachments").on("click", ".delete", function(e) {
         | 
| 56 | 
            +
                var el = $(this).parents(".attachment");
         | 
| 57 | 
            +
                spinner.spin(el[0]);
         | 
| 58 | 
            +
                el.css({
         | 
| 59 | 
            +
                  opacity: 0.5
         | 
| 60 | 
            +
                });
         | 
| 61 | 
            +
                el.find("*").attr({
         | 
| 62 | 
            +
                  disabled: true
         | 
| 63 | 
            +
                });
         | 
| 64 | 
            +
                $.ajax({
         | 
| 65 | 
            +
                  method: "DELETE",
         | 
| 66 | 
            +
                  url: $(this).attr("href"),
         | 
| 67 | 
            +
                  success: function() {
         | 
| 68 | 
            +
                    el.remove();
         | 
| 69 | 
            +
                  }
         | 
| 70 | 
            +
                });
         | 
| 71 | 
            +
                return false;
         | 
| 72 | 
            +
              });
         | 
| 73 | 
            +
             | 
| 74 | 
            +
              $("#attachments").sortable({
         | 
| 75 | 
            +
                axis: "y",
         | 
| 76 | 
            +
                cancel: "input,textarea,button,select,option,a",
         | 
| 77 | 
            +
                distance: 5,
         | 
| 78 | 
            +
                update: function() {
         | 
| 79 | 
            +
                  $.post(request_url + "/reposition", {
         | 
| 80 | 
            +
                    positions: ($("#attachments > *").map(function() {
         | 
| 81 | 
            +
                      $(this).data("attachment-id");
         | 
| 82 | 
            +
                    })).toArray()
         | 
| 83 | 
            +
                  });
         | 
| 84 | 
            +
                }
         | 
| 85 | 
            +
              });
         | 
| 86 | 
            +
             | 
| 87 | 
            +
              $("#attachments").disableSelection();
         | 
| 88 | 
            +
            });
         | 
| @@ -10,7 +10,7 @@ | |
| 10 10 | 
             
                  <% else %>
         | 
| 11 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" %>
         | 
| 13 | 
            +
                  <%= link_to "Delete", destroy_attachment_path(attachment.id), class: "delete btn btn-danger btn-xs", method: :delete %>
         | 
| 14 14 | 
             
                </div>
         | 
| 15 15 | 
             
              </div>
         | 
| 16 16 | 
             
            </li>
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: brightcontent-attachments
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2.3. | 
| 4 | 
            +
              version: 2.3.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Developers at Brightin
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2016-03-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: brightcontent-core
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - '='
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: 2.3. | 
| 19 | 
            +
                    version: 2.3.3
         | 
| 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. | 
| 26 | 
            +
                    version: 2.3.3
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: paperclip
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -147,7 +147,7 @@ files: | |
| 147 147 | 
             
            - README.md
         | 
| 148 148 | 
             
            - Rakefile
         | 
| 149 149 | 
             
            - app/assets/javascripts/brightcontent/.gitkeep
         | 
| 150 | 
            -
            - app/assets/javascripts/brightcontent/attachments.js | 
| 150 | 
            +
            - app/assets/javascripts/brightcontent/attachments.js
         | 
| 151 151 | 
             
            - app/assets/stylesheets/brightcontent/attachments.css.scss
         | 
| 152 152 | 
             
            - app/controllers/brightcontent/attachments_controller.rb
         | 
| 153 153 | 
             
            - app/models/brightcontent/attachment.rb
         | 
| @@ -243,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 243 243 | 
             
                  version: '0'
         | 
| 244 244 | 
             
            requirements: []
         | 
| 245 245 | 
             
            rubyforge_project: 
         | 
| 246 | 
            -
            rubygems_version: 2. | 
| 246 | 
            +
            rubygems_version: 2.5.1
         | 
| 247 247 | 
             
            signing_key: 
         | 
| 248 248 | 
             
            specification_version: 4
         | 
| 249 249 | 
             
            summary: Assets resource for brightcontent
         | 
| @@ -1,56 +0,0 @@ | |
| 1 | 
            -
            #= require jquery-fileupload/basic
         | 
| 2 | 
            -
            #= require spin
         | 
| 3 | 
            -
             | 
| 4 | 
            -
            $ ->
         | 
| 5 | 
            -
              request_url = $("#attachable_url").val()
         | 
| 6 | 
            -
             | 
| 7 | 
            -
              spinner = new Spinner().spin()
         | 
| 8 | 
            -
              $('#fileupload').fileupload
         | 
| 9 | 
            -
                method: "PUT"
         | 
| 10 | 
            -
                send: ->
         | 
| 11 | 
            -
                  spinner.spin $("#attachments-controls")[0]
         | 
| 12 | 
            -
                  $("#attachments *").attr disabled: true
         | 
| 13 | 
            -
                  $("#fileupload").attr disabled: true
         | 
| 14 | 
            -
                  $("#attachments-controls").css opacity: 0.5
         | 
| 15 | 
            -
             | 
| 16 | 
            -
                done: (e, data) ->
         | 
| 17 | 
            -
                  $.get request_url, (attachments_view) ->
         | 
| 18 | 
            -
                    $('#attachments').html attachments_view
         | 
| 19 | 
            -
                    spinner.stop()
         | 
| 20 | 
            -
                    $("#fileupload").attr disabled: false
         | 
| 21 | 
            -
                    $("#attachments-controls").css opacity: 1
         | 
| 22 | 
            -
             | 
| 23 | 
            -
              $("#attachments").on "click", ".insert-image", (e) ->
         | 
| 24 | 
            -
                e.preventDefault()
         | 
| 25 | 
            -
                editor = $("#insertable").data("wysihtml5").editor
         | 
| 26 | 
            -
                editor.composer.commands.exec "insertImage",
         | 
| 27 | 
            -
                  src: $(this).attr "href"
         | 
| 28 | 
            -
             | 
| 29 | 
            -
              $("#attachments").on "click", ".insert-link", (e) ->
         | 
| 30 | 
            -
                e.preventDefault()
         | 
| 31 | 
            -
                editor = $("#insertable").data("wysihtml5").editor
         | 
| 32 | 
            -
                editor.composer.commands.exec "createLink",
         | 
| 33 | 
            -
                  href: $(this).attr "href"
         | 
| 34 | 
            -
                  target: "_blank"
         | 
| 35 | 
            -
                  rel: "nofollow"
         | 
| 36 | 
            -
                  text: $(this).data("name")
         | 
| 37 | 
            -
             | 
| 38 | 
            -
              $("#attachments").on "click", ".delete", (e) ->
         | 
| 39 | 
            -
                el = $(this).parents(".attachment")
         | 
| 40 | 
            -
                spinner.spin el[0]
         | 
| 41 | 
            -
                el.css opacity: 0.5
         | 
| 42 | 
            -
                el.find("*").attr disabled: true
         | 
| 43 | 
            -
                $.ajax
         | 
| 44 | 
            -
                  method: "DELETE"
         | 
| 45 | 
            -
                  url: $(this).attr "href"
         | 
| 46 | 
            -
                  success: -> el.remove()
         | 
| 47 | 
            -
                false
         | 
| 48 | 
            -
             | 
| 49 | 
            -
              $("#attachments").sortable
         | 
| 50 | 
            -
                axis: "y"
         | 
| 51 | 
            -
                cancel: "input,textarea,button,select,option,a"
         | 
| 52 | 
            -
                distance: 5
         | 
| 53 | 
            -
                update: ->
         | 
| 54 | 
            -
                  $.post "#{request_url}/reposition", positions: ($("#attachments > *").map -> $(this).data "attachment-id").toArray()
         | 
| 55 | 
            -
             | 
| 56 | 
            -
              $("#attachments").disableSelection()
         |