FEATURE: bump onebox version, add styling for new reddit image onebox

FEATURE: bump onebox version, add styling for new reddit image onebox

diff --git a/Gemfile b/Gemfile
index 0ab6354..c73bd3f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -44,7 +44,7 @@ gem 'redis-namespace'
 
 gem 'active_model_serializers', '~> 0.8.3'
 
-gem 'onebox', '1.8.82'
+gem 'onebox', '1.8.83'
 
 gem 'http_accept_language', '~>2.0.5', require: false
 
diff --git a/Gemfile.lock b/Gemfile.lock
index 322daf1..df5b35e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -214,7 +214,7 @@ GEM
     mocha (1.5.0)
       metaclass (~> 0.0.1)
     mock_redis (0.18.0)
-    moneta (1.0.0)
+    moneta (1.1.0)
     msgpack (1.2.6)
     multi_json (1.13.1)
     multi_xml (0.6.0)
@@ -263,7 +263,7 @@ GEM
     omniauth-twitter (1.4.0)
       omniauth-oauth (~> 1.1)
       rack
-    onebox (1.8.82)
+    onebox (1.8.83)
       htmlentities (~> 4.3)
       moneta (~> 1.0)
       multi_json (~> 1.11)
@@ -524,7 +524,7 @@ DEPENDENCIES
   omniauth-oauth2
   omniauth-openid
   omniauth-twitter
-  onebox (= 1.8.82)
+  onebox (= 1.8.83)
   openid-redis-store
   parallel_tests
   pg
diff --git a/app/assets/stylesheets/common/base/onebox.scss b/app/assets/stylesheets/common/base/onebox.scss
index 2a9eaa8..f0f833a 100644
--- a/app/assets/stylesheets/common/base/onebox.scss
+++ b/app/assets/stylesheets/common/base/onebox.scss
@@ -244,8 +244,9 @@ aside.onebox {
       }
     }
 
-    // instagram fixes
-    .instagram-images {
+    // instagram + reddit fixes
+    .instagram-images,
+    .scale-images {
       clear: both;
       position: relative;
 
@@ -262,7 +263,8 @@ aside.onebox {
         position: absolute;
       }
 
-      .instagram-image {
+      .instagram-image,
+      .scale-image {
         padding: 5px 5px 5px 5px;
         max-width: 100%;
         max-height: 100%;
diff --git a/lib/cooked_post_processor.rb b/lib/cooked_post_processor.rb
index 68a3055..17ae738 100644
--- a/lib/cooked_post_processor.rb
+++ b/lib/cooked_post_processor.rb
@@ -568,7 +568,7 @@ class CookedPostProcessor
           new_parent = img.add_next_sibling("<div class='aspect-image' style='--aspect-ratio:#{width}/#{height};'/>")
           new_parent.first.add_child(img)
         end
-      elsif (parent_class&.include?("instagram-images") || parent_class&.include?("tweet-images")) && width > 0 && height > 0
+      elsif (parent_class&.include?("instagram-images") || parent_class&.include?("tweet-images") || parent_class&.include?("scale-images")) && width > 0 && height > 0
         img.remove_attribute("width")
         img.remove_attribute("height")
         img.parent["class"] = "aspect-image-full-size"

GitHub sha: b0053f3a

1 Like