tenon 1.0.19 → 1.0.20

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: 26fe2e2693358e70f326dc57a7dbd7dfdd3cb226
4
- data.tar.gz: 2327627cafbf3bb52a11d5e6b15ec4f22389e41c
3
+ metadata.gz: c3848f32e34e0f1e0460ade450a9efd9aa35d13a
4
+ data.tar.gz: 2f2ee2e3c2d31c33116a4bde4cea1be713c708fd
5
5
  SHA512:
6
- metadata.gz: e29b905edcca21eea4fc5c67e44ad2130440817ebaebea716c2e9d34d70173e41f7f8939a8315c60bc16cd7963e5882a24b31b203ccfd203a2f0bb6a505fb22b
7
- data.tar.gz: 745254829fe6c1fac1fbc26774889813a421b8506caaf7404dced70001d897cf262ff07849b6af43ff4b6b26765d95ef4558bc3795f71c1afde019f6d100623d
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
- $.param($.extend(oldQueryObj, newQueryObj))
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')
@@ -27,6 +27,11 @@ a {
27
27
  }
28
28
 
29
29
  // Headers
30
+ h1, h2, h3, h4, h5, h6, p {
31
+ opacity:0.99;
32
+ -webkit-font-smoothing: antialiased;
33
+ -moz-osx-font-smoothing: grayscale;
34
+ }
30
35
 
31
36
  h1 {
32
37
  font-size: 28px;
@@ -191,8 +191,11 @@
191
191
  overflow: hidden;
192
192
  img {
193
193
  display: block;
194
- width: 100%;
194
+ max-width: 100%;
195
+ margin: 0 auto;
196
+ width: auto;
195
197
  }
198
+ &.stretch img { width: 100%; }
196
199
  }
197
200
  textarea.caption, div.tn-tc-caption {
198
201
  margin: 0;
@@ -1,4 +1,4 @@
1
- .tn-tc-image
1
+ .tn-tc-image{class: piece.stretch_to_fill? ? 'stretch' : ''}
2
2
  - if piece.link_url.blank?
3
3
  = image_tag(piece.image.url(:_medium))
4
4
  - else
@@ -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
- .image
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-arrows-h
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
@@ -0,0 +1,6 @@
1
+ class AddStretchBooleanToTenonTenonContentPieces < ActiveRecord::Migration
2
+ def change
3
+ add_column :tenon_tenon_content_pieces, :stretch_to_fill, :boolean, default: false
4
+ remove_column :tenon_tenon_content_pieces, :dimenstions
5
+ end
6
+ end
data/lib/tenon/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tenon
2
- VERSION = '1.0.19'
2
+ VERSION = '1.0.20'
3
3
  end
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.19
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-18 00:00:00.000000000 Z
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.3.0
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.