filestack-rails 5.5.2 → 5.5.4
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 +4 -4
- data/app/helpers/filestack_rails/application_helper.rb +26 -4
- data/lib/filestack_rails/version.rb +1 -1
- metadata +20 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: edbd5530dcccdbad550f092c4847a34cd3725ce5c56b1a85ac95d9f77381aea3
         | 
| 4 | 
            +
              data.tar.gz: b3516d62ee5eed53f42852a1d0f5ce69d2ae414b8a382f3c162156c25cca35b6
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e80e5ac5d67a8af19f4669432f4bde167b39ddfafce395dd5b4cea5b2e3d92778310020e4872711097608d9ac9b5d6f6fe123b858f2469b7ff3dbc035f670189
         | 
| 7 | 
            +
              data.tar.gz: 58973ec991cc9317f35d80df5d08eab6615ead3aa88dde58d82b1d2017bfd467ee125bd65a856f05d0a8c8b6159cab4233a629ee17867465abbbe2b74a652263
         | 
| @@ -10,8 +10,21 @@ module FilestackRails | |
| 10 10 |  | 
| 11 11 | 
             
                def filestack_js_init_tag
         | 
| 12 12 | 
             
                  client_name, apikey = get_client_and_api_key
         | 
| 13 | 
            -
                   | 
| 14 | 
            -
             | 
| 13 | 
            +
                  javascript_string =
         | 
| 14 | 
            +
                    if filestack_js_v3?
         | 
| 15 | 
            +
                      options = { cname: cname }
         | 
| 16 | 
            +
                      policy, signature = get_policy_and_signature
         | 
| 17 | 
            +
                      if policy && signature
         | 
| 18 | 
            +
                        options[:security] = {
         | 
| 19 | 
            +
                          policy: policy,
         | 
| 20 | 
            +
                          signature: signature
         | 
| 21 | 
            +
                        }
         | 
| 22 | 
            +
                      end
         | 
| 23 | 
            +
                      "var #{client_name} = filestack.init('#{apikey}', #{options.to_json});"
         | 
| 24 | 
            +
                    else
         | 
| 25 | 
            +
                      signature_and_policy = get_policy_and_signature_string
         | 
| 26 | 
            +
                      "var #{client_name} = filestack.init('#{apikey}', #{signature_and_policy}, '#{cname}');"
         | 
| 27 | 
            +
                    end
         | 
| 15 28 | 
             
                  javascript_tag javascript_string
         | 
| 16 29 | 
             
                end
         | 
| 17 30 |  | 
| @@ -42,6 +55,10 @@ module FilestackRails | |
| 42 55 |  | 
| 43 56 | 
             
                private
         | 
| 44 57 |  | 
| 58 | 
            +
                def filestack_js_v3?
         | 
| 59 | 
            +
                  get_filestack_js.version.to_s[0] == '3'
         | 
| 60 | 
            +
                end
         | 
| 61 | 
            +
             | 
| 45 62 | 
             
                def cname
         | 
| 46 63 | 
             
                  ::Rails.application.config.filestack_rails.cname
         | 
| 47 64 | 
             
                end
         | 
| @@ -59,12 +76,17 @@ module FilestackRails | |
| 59 76 | 
             
                end
         | 
| 60 77 |  | 
| 61 78 | 
             
                def build_callbacks_js(options)
         | 
| 62 | 
            -
                  string =  | 
| 79 | 
            +
                  string = ''
         | 
| 63 80 | 
             
                  string << ", onOpen: data => #{options.delete(:onOpen)}(data)" unless options[:onOpen].blank?
         | 
| 81 | 
            +
                  string << ", onCancel: data => #{options.delete(:onCancel)}(data)" unless options[:onCancel].blank?
         | 
| 64 82 | 
             
                  string << ", onClose: () => #{options.delete(:onClose)}()" unless options[:onClose].blank?
         | 
| 65 | 
            -
                  string << ",  | 
| 83 | 
            +
                  string << ", onFileUploadProgress: data => #{options.delete(:onFileUploadProgress)}(data)" unless options[:onFileUploadProgress].blank?
         | 
| 66 84 | 
             
                  string << ", onFileSelected: data => #{options.delete(:onFileSelected)}(data)" unless options[:onFileSelected].blank?
         | 
| 67 85 | 
             
                  string << ", onUploadStarted: data => #{options.delete(:onUploadStarted)}(data)" unless options[:onUploadStarted].blank?
         | 
| 86 | 
            +
                  string << ", onUploadDone: data => #{options.delete(:onUploadDone)}(data)" unless options[:onUploadDone].blank?
         | 
| 87 | 
            +
                  string << ", onFileUploadFinished: data => #{options.delete(:onFileUploadFinished)}(data)"   unless options[:onFileUploadFinished].blank?
         | 
| 88 | 
            +
                  string << ", onFileUploadFailed: data => #{options.delete(:onFileUploadFailed)}(data)"  unless options[:onFileUploadFailed].blank?
         | 
| 89 | 
            +
                  string << ", onFileUploadStarted: data => #{options.delete(:onFileUploadStarted)}(data)" unless options[:onFileUploadStarted].blank?
         | 
| 68 90 | 
             
                  string
         | 
| 69 91 | 
             
                end
         | 
| 70 92 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: filestack-rails
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 5.5. | 
| 4 | 
            +
              version: 5.5.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - filestack
         | 
| 8 | 
            -
            autorequire:
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2024-06-11 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         | 
| @@ -106,6 +106,20 @@ dependencies: | |
| 106 106 | 
             
                - - ">="
         | 
| 107 107 | 
             
                  - !ruby/object:Gem::Version
         | 
| 108 108 | 
             
                    version: '0'
         | 
| 109 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 110 | 
            +
              name: sprockets-rails
         | 
| 111 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 112 | 
            +
                requirements:
         | 
| 113 | 
            +
                - - ">="
         | 
| 114 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 115 | 
            +
                    version: '0'
         | 
| 116 | 
            +
              type: :development
         | 
| 117 | 
            +
              prerelease: false
         | 
| 118 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 119 | 
            +
                requirements:
         | 
| 120 | 
            +
                - - ">="
         | 
| 121 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 122 | 
            +
                    version: '0'
         | 
| 109 123 | 
             
            description: Allows easy integraiton of Filestack's File Picker through dynamic button
         | 
| 110 124 | 
             
              tags and form helpers
         | 
| 111 125 | 
             
            email:
         | 
| @@ -129,7 +143,7 @@ homepage: https://www.filestack.com | |
| 129 143 | 
             
            licenses:
         | 
| 130 144 | 
             
            - MIT
         | 
| 131 145 | 
             
            metadata: {}
         | 
| 132 | 
            -
            post_install_message:
         | 
| 146 | 
            +
            post_install_message: 
         | 
| 133 147 | 
             
            rdoc_options: []
         | 
| 134 148 | 
             
            require_paths:
         | 
| 135 149 | 
             
            - lib
         | 
| @@ -144,8 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 144 158 | 
             
                - !ruby/object:Gem::Version
         | 
| 145 159 | 
             
                  version: '0'
         | 
| 146 160 | 
             
            requirements: []
         | 
| 147 | 
            -
            rubygems_version: 3. | 
| 148 | 
            -
            signing_key:
         | 
| 161 | 
            +
            rubygems_version: 3.5.3
         | 
| 162 | 
            +
            signing_key: 
         | 
| 149 163 | 
             
            specification_version: 4
         | 
| 150 164 | 
             
            summary: Filestack plugin for Rails 4+
         | 
| 151 165 | 
             
            test_files: []
         |