tenon 1.0.19 → 1.0.20
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/assets/javascripts/tenon/features/record_list_updater.js.coffee +15 -5
 - data/app/assets/javascripts/tenon/features/tenon_content/base.js.coffee +1 -0
 - data/app/assets/javascripts/tenon/features/tenon_content/stretch_to_fill.js.coffee +50 -0
 - data/app/assets/stylesheets/tenon/typography.css.scss +5 -0
 - data/app/assets/stylesheets/tenon/ui/tenon-content.css.scss +4 -1
 - data/app/views/tenon/tenon_content/piece_types/display/_image.html.haml +1 -1
 - data/app/views/tenon/tenon_content/piece_types/form/_image.html.haml +6 -5
 - data/db/migrate/20140619135927_add_stretch_boolean_to_tenon_tenon_content_pieces.rb +6 -0
 - data/lib/tenon/version.rb +1 -1
 - metadata +5 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: c3848f32e34e0f1e0460ade450a9efd9aa35d13a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 2f2ee2e3c2d31c33116a4bde4cea1be713c708fd
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: f33bc073e606b9e340bd17c756717690a45ab36fe9f71e0e3023a1f203108be2cceb2057cc39b9e30b3f7dfcaab906a6f5e31499ac080fc45905933f92c281cc
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 44be645d288dc1d361b32017133844d056526f2f6670bb666b193196eff81e9db0d9e6f49fecac45c45a5c675552f7c48ea1bbbe2c1228a77c21972cbe45eeed
         
     | 
| 
         @@ -9,7 +9,7 @@ class Tenon.features.RecordListUpdater 
     | 
|
| 
       9 
9 
     | 
    
         
             
                $el = $(e.currentTarget)
         
     | 
| 
       10 
10 
     | 
    
         
             
                @clearQuery = $el.attr('data-clear-record-list-params')
         
     | 
| 
       11 
11 
     | 
    
         
             
                if $el.prop("tagName").toLowerCase() == 'form'
         
     | 
| 
       12 
     | 
    
         
            -
                  @_updateWithQuery(@_processFormData($el), 'Search')
         
     | 
| 
      
 12 
     | 
    
         
            +
                  @_updateWithQuery(@_processFormData($el), 'Search', $el)
         
     | 
| 
       13 
13 
     | 
    
         
             
                else
         
     | 
| 
       14 
14 
     | 
    
         
             
                  @_updateWithQuery(URI($el.attr('href')).query(true), $el.textContent)
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
         @@ -20,8 +20,8 @@ class Tenon.features.RecordListUpdater 
     | 
|
| 
       20 
20 
     | 
    
         
             
                    formData[@.name] = "0"
         
     | 
| 
       21 
21 
     | 
    
         
             
                formData
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
              _updateWithQuery: (query, title) =>
         
     | 
| 
       24 
     | 
    
         
            -
                query = if @clearQuery then query else @_mergedQuery(query)
         
     | 
| 
      
 23 
     | 
    
         
            +
              _updateWithQuery: (query, title, form = null) =>
         
     | 
| 
      
 24 
     | 
    
         
            +
                query = if @clearQuery then query else @_mergedQuery(query, form)
         
     | 
| 
       25 
25 
     | 
    
         
             
                state = if $.isEmptyObject(query) then "?" else "?#{query.toString()}"
         
     | 
| 
       26 
26 
     | 
    
         
             
                history.pushState({recordListUpdate: true}, title, state)
         
     | 
| 
       27 
27 
     | 
    
         
             
                Tenon.refreshed = false
         
     | 
| 
         @@ -31,9 +31,19 @@ class Tenon.features.RecordListUpdater 
     | 
|
| 
       31 
31 
     | 
    
         
             
              # the link or form is adding.  This allows us to, for example, submit
         
     | 
| 
       32 
32 
     | 
    
         
             
              # an advanced search form and then change the sort order with a link.
         
     | 
| 
       33 
33 
     | 
    
         
             
              # Add data-clear-record-list-params to prevent this merge.
         
     | 
| 
       34 
     | 
    
         
            -
              _mergedQuery: (newQueryObj) =>
         
     | 
| 
      
 34 
     | 
    
         
            +
              _mergedQuery: (newQueryObj, form = null) =>
         
     | 
| 
       35 
35 
     | 
    
         
             
                oldQueryObj = URI(location.href).query(true)
         
     | 
| 
       36 
     | 
    
         
            -
                $. 
     | 
| 
      
 36 
     | 
    
         
            +
                mergedQuery = $.extend(oldQueryObj, newQueryObj)
         
     | 
| 
      
 37 
     | 
    
         
            +
                mergedQuery = @_removeEmptyMultiSelects(mergedQuery, form) if form
         
     | 
| 
      
 38 
     | 
    
         
            +
                $.param(mergedQuery)
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
              # multi-selects are handled as arrays, which causes problems with merging if
         
     | 
| 
      
 41 
     | 
    
         
            +
              # you have unselected items
         
     | 
| 
      
 42 
     | 
    
         
            +
              _removeEmptyMultiSelects: (query, form) =>
         
     | 
| 
      
 43 
     | 
    
         
            +
                form.find("select[multiple='multiple']").each ->
         
     | 
| 
      
 44 
     | 
    
         
            +
                  if (@.selectedOptions.length == 0)
         
     | 
| 
      
 45 
     | 
    
         
            +
                    delete query[@.name]
         
     | 
| 
      
 46 
     | 
    
         
            +
                query
         
     | 
| 
       37 
47 
     | 
    
         | 
| 
       38 
48 
     | 
    
         
             
              popUpdate: (e) =>
         
     | 
| 
       39 
49 
     | 
    
         
             
                # Chrome triggers window.onpopstate on page load, so elsewhere
         
     | 
| 
         @@ -6,6 +6,7 @@ class Tenon.features.tenonContent.Base 
     | 
|
| 
       6 
6 
     | 
    
         
             
                new Tenon.features.tenonContent.CaptionToggler($container)
         
     | 
| 
       7 
7 
     | 
    
         
             
                new Tenon.features.tenonContent.ColumnSizing($container)
         
     | 
| 
       8 
8 
     | 
    
         
             
                new Tenon.features.tenonContent.ColumnSwap($container)
         
     | 
| 
      
 9 
     | 
    
         
            +
                new Tenon.features.tenonContent.StretchToFill($container)
         
     | 
| 
       9 
10 
     | 
    
         
             
                new Tenon.features.tenonContent.Editor($container)
         
     | 
| 
       10 
11 
     | 
    
         
             
                new Tenon.features.tenonContent.ImageControls($container)
         
     | 
| 
       11 
12 
     | 
    
         
             
                new Tenon.features.tenonContent.LibraryFilter($container)
         
     | 
| 
         @@ -0,0 +1,50 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            class Tenon.features.tenonContent.StretchToFill
         
     | 
| 
      
 2 
     | 
    
         
            +
              constructor: (@$container) ->
         
     | 
| 
      
 3 
     | 
    
         
            +
                $(document).on('click', '.medium-editor-action.stretch-to-fill', @stretchImage)
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              stretchImage: (e) =>
         
     | 
| 
      
 6 
     | 
    
         
            +
                e.preventDefault()
         
     | 
| 
      
 7 
     | 
    
         
            +
                @$button = $(e.currentTarget)
         
     | 
| 
      
 8 
     | 
    
         
            +
                @$piece = @_getPiece()
         
     | 
| 
      
 9 
     | 
    
         
            +
                @$image = @_getImage()
         
     | 
| 
      
 10 
     | 
    
         
            +
                @_setState()
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              _setState: () =>
         
     | 
| 
      
 13 
     | 
    
         
            +
                if @$image.hasClass('stretch')
         
     | 
| 
      
 14 
     | 
    
         
            +
                  @state = false
         
     | 
| 
      
 15 
     | 
    
         
            +
                else
         
     | 
| 
      
 16 
     | 
    
         
            +
                  @state = true
         
     | 
| 
      
 17 
     | 
    
         
            +
                @_saveState()
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              _saveState: () =>
         
     | 
| 
      
 20 
     | 
    
         
            +
                @_setFormFieldState()
         
     | 
| 
      
 21 
     | 
    
         
            +
                @_setImageState()
         
     | 
| 
      
 22 
     | 
    
         
            +
                @_setButtonActiveState()
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              _setFormFieldState: () =>
         
     | 
| 
      
 25 
     | 
    
         
            +
                @$piece.find('input[name$="[stretch_to_fill]"]').val(@state)
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
              _setImageState: () =>
         
     | 
| 
      
 28 
     | 
    
         
            +
                if @state == true
         
     | 
| 
      
 29 
     | 
    
         
            +
                  @$image.addClass('stretch')
         
     | 
| 
      
 30 
     | 
    
         
            +
                else
         
     | 
| 
      
 31 
     | 
    
         
            +
                  @$image.removeClass('stretch')
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
              _setButtonActiveState: () =>
         
     | 
| 
      
 34 
     | 
    
         
            +
                if @state == true
         
     | 
| 
      
 35 
     | 
    
         
            +
                  @$button.addClass('medium-editor-button-active')
         
     | 
| 
      
 36 
     | 
    
         
            +
                  @$image.find('.stretch-to-fill').addClass('medium-editor-button-active')
         
     | 
| 
      
 37 
     | 
    
         
            +
                else
         
     | 
| 
      
 38 
     | 
    
         
            +
                  @$button.removeClass('medium-editor-button-active')
         
     | 
| 
      
 39 
     | 
    
         
            +
                  @$image.find('.stretch-to-fill').removeClass('medium-editor-button-active')
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
              _getImage: () =>
         
     | 
| 
      
 42 
     | 
    
         
            +
                @$button
         
     | 
| 
      
 43 
     | 
    
         
            +
                  .closest('.image-controls')
         
     | 
| 
      
 44 
     | 
    
         
            +
                  .data('image')
         
     | 
| 
      
 45 
     | 
    
         
            +
             
     | 
| 
      
 46 
     | 
    
         
            +
              _getPiece: () =>
         
     | 
| 
      
 47 
     | 
    
         
            +
                @$button
         
     | 
| 
      
 48 
     | 
    
         
            +
                  .closest('.image-controls')
         
     | 
| 
      
 49 
     | 
    
         
            +
                  .data('image')
         
     | 
| 
      
 50 
     | 
    
         
            +
                  .closest('.tn-tc-piece')
         
     | 
| 
         @@ -1,7 +1,8 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            = f.hidden_field :image_id, class: 'asset-id-field'
         
     | 
| 
       2 
2 
     | 
    
         
             
            = f.hidden_field :position
         
     | 
| 
       3 
3 
     | 
    
         
             
            = f.hidden_field :size
         
     | 
| 
       4 
     | 
    
         
            -
            . 
     | 
| 
      
 4 
     | 
    
         
            +
            = f.hidden_field :stretch_to_fill
         
     | 
| 
      
 5 
     | 
    
         
            +
            .image{class: f.object.stretch_to_fill? ? 'stretch' : ''}
         
     | 
| 
       5 
6 
     | 
    
         
             
              - if f.object.image
         
     | 
| 
       6 
7 
     | 
    
         
             
                = image_tag(f.object.image.url(:_medium))
         
     | 
| 
       7 
8 
     | 
    
         
             
              - else
         
     | 
| 
         @@ -22,7 +23,6 @@ 
     | 
|
| 
       22 
23 
     | 
    
         
             
                  %li
         
     | 
| 
       23 
24 
     | 
    
         
             
                    %button{title: 'Crop', class: 'asset-crop medium-editor-action medium-editor-button-first', data: {'tooltip' => true, 'post-crop-handler' => 'Tenon.features.tenonContent.PostCropHandler', 'asset-id' => f.object.image_id}}
         
     | 
| 
       24 
25 
     | 
    
         
             
                      %i.fa.fa-crop
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
26 
     | 
    
         
             
                  %li
         
     | 
| 
       27 
27 
     | 
    
         
             
                    %button{title: 'Grow', class: 'grow-image medium-editor-action', data: {'column-resize-operation' => 'increase', 'tooltip' => true}}
         
     | 
| 
       28 
28 
     | 
    
         
             
                      %i.fa.fa-plus
         
     | 
| 
         @@ -34,12 +34,13 @@ 
     | 
|
| 
       34 
34 
     | 
    
         
             
                      %i.fa.fa-comment
         
     | 
| 
       35 
35 
     | 
    
         
             
                  %li
         
     | 
| 
       36 
36 
     | 
    
         
             
                    %button{title: 'Swap Sides', class: 'swap-sides medium-editor-action', data: {tooltip: true}}
         
     | 
| 
       37 
     | 
    
         
            -
                      %i.fa.fa- 
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
      
 37 
     | 
    
         
            +
                      %i.fa.fa-exchange
         
     | 
| 
      
 38 
     | 
    
         
            +
                  %li
         
     | 
| 
      
 39 
     | 
    
         
            +
                    %button{title: 'Stretch to Fill', class: "stretch-to-fill medium-editor-action #{f.object.stretch_to_fill? ? 'medium-editor-button-active' : ''}", data: {tooltip: true}}
         
     | 
| 
      
 40 
     | 
    
         
            +
                      %i.fa.fa-arrows-alt
         
     | 
| 
       39 
41 
     | 
    
         
             
                  %li
         
     | 
| 
       40 
42 
     | 
    
         
             
                    %button.add-link.medium-editor-action{title: 'Add Link', class: ('medium-editor-button-active' unless f.object.link_url.blank?), data: {tooltip: true}}
         
     | 
| 
       41 
43 
     | 
    
         
             
                      %i.fa.fa-link
         
     | 
| 
       42 
     | 
    
         
            -
             
     | 
| 
       43 
44 
     | 
    
         
             
                  %li
         
     | 
| 
       44 
45 
     | 
    
         
             
                    %button{href: new_item_asset_path, title: 'Replace Image', class: 'replace-image medium-editor-action  medium-editor-button-last', data: {'modal-remote' => 'true', 'modal-title' => "Select Image", 'modal-handler' => 'Tenon.features.tenonContent.AssetAttachment', 'tooltip' => true}}
         
     | 
| 
       45 
46 
     | 
    
         
             
                      %i.fa.fa-picture-o
         
     | 
    
        data/lib/tenon/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: tenon
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.20
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - factor[e] design initiative
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-06- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-06-19 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: better_errors
         
     | 
| 
         @@ -975,6 +975,7 @@ files: 
     | 
|
| 
       975 
975 
     | 
    
         
             
            - app/assets/javascripts/tenon/features/tenon_content/post_crop_handler.js.coffee
         
     | 
| 
       976 
976 
     | 
    
         
             
            - app/assets/javascripts/tenon/features/tenon_content/sidebar_navigation.js.coffee
         
     | 
| 
       977 
977 
     | 
    
         
             
            - app/assets/javascripts/tenon/features/tenon_content/sortable.js.coffee
         
     | 
| 
      
 978 
     | 
    
         
            +
            - app/assets/javascripts/tenon/features/tenon_content/stretch_to_fill.js.coffee
         
     | 
| 
       978 
979 
     | 
    
         
             
            - app/assets/javascripts/tenon/features/tenon_content/wrapped_sizing.js.coffee
         
     | 
| 
       979 
980 
     | 
    
         
             
            - app/assets/javascripts/tenon/features/video_feeds.js.coffee
         
     | 
| 
       980 
981 
     | 
    
         
             
            - app/assets/javascripts/tenon/medium_customizations.js
         
     | 
| 
         @@ -1287,6 +1288,7 @@ files: 
     | 
|
| 
       1287 
1288 
     | 
    
         
             
            - db/migrate/20140516135347_add_index_to_item_versions.rb
         
     | 
| 
       1288 
1289 
     | 
    
         
             
            - db/migrate/20140520150508_add_publish_at_and_remove_published_from_tenon_posts.rb
         
     | 
| 
       1289 
1290 
     | 
    
         
             
            - db/migrate/20140520161213_remove_published_feld_from_tenon_pages.rb
         
     | 
| 
      
 1291 
     | 
    
         
            +
            - db/migrate/20140619135927_add_stretch_boolean_to_tenon_tenon_content_pieces.rb
         
     | 
| 
       1290 
1292 
     | 
    
         
             
            - db/seeds.rb
         
     | 
| 
       1291 
1293 
     | 
    
         
             
            - lib/generators/tenon/i18n_migrations/i18n_migrations_generator.rb
         
     | 
| 
       1292 
1294 
     | 
    
         
             
            - lib/generators/tenon/i18n_migrations/templates/migration.rb
         
     | 
| 
         @@ -1452,7 +1454,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       1452 
1454 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       1453 
1455 
     | 
    
         
             
            requirements: []
         
     | 
| 
       1454 
1456 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       1455 
     | 
    
         
            -
            rubygems_version: 2. 
     | 
| 
      
 1457 
     | 
    
         
            +
            rubygems_version: 2.2.2
         
     | 
| 
       1456 
1458 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       1457 
1459 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       1458 
1460 
     | 
    
         
             
            summary: A highly flexible mountable Rails CMS built for rapid application development.
         
     |