SHARE
TWEET

Untitled

a guest Oct 21st, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //1
  2. if (window.location.search.indexOf('no-cf-resize') < 0) {
  3.     $('.cf-resize-2 .image img').each(function() {  
  4.         var src = $(this).attr('data-src');
  5.         var resize2 = $(".row").find("cf-resize-2");
  6.         var datasrcResize2 =
  7.         ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 360w,' : '') +
  8.         ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=600,quality=75/') + ' 640w,' : '') +
  9.         ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=405,quality=75/') + ' 960w,' : '');    
  10.         $(this).attr('data-srcset', datasrcResize2.substring(0, datasrcResize2.length - 1));
  11.     });
  12.  
  13.     $('.cf-resize-3 .image img').each(function() {
  14.         var src = $(this).attr('data-src');
  15.         var resize3 = $(".row").find("cf-resize-3");
  16.         $(this).attr('data-srcset', datasrcResize3.substring(0, datasrcResize3.length - 1));
  17.         var datasrcResize3 =
  18.         ((typeof resize3 !== typeof undefined && resize3 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 360w,' : '') +
  19.         ((typeof resize3 !== typeof undefined && resize3 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=600,quality=75/') + ' 640w,' : '') +
  20.         ((typeof resize3 !== typeof undefined && resize3 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 960w,' : '');
  21.         $(this).attr('data-srcset', datasrcResize3.substring(0, datasrcResize3.length - 1));
  22.     });    
  23.  
  24.     $('.cf-resize-4 .image img').each(function() {
  25.         var src = $(this).attr('data-src');
  26.          var resize4 = $(".row").find("cf-resize-4");
  27.          var datasrcResize4 =
  28.          ((typeof resize4 !== typeof undefined && resize4 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 360w,' : '') +
  29.          ((typeof resize4 !== typeof undefined && resize4 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=600,quality=75/') + ' 640w,' : '') +
  30.          ((typeof resize4 !== typeof undefined && resize4 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=200,quality=75/') + ' 960w,' : '');
  31.         $(this).attr('data-srcset', datasrcResize4.substring(0, datasrcResize4.length - 1));
  32.     });
  33. }
  34.  
  35.  
  36. //2 Not working
  37. if (window.location.search.indexOf('no-cf-resize') < 0) {
  38.     var src = $(this).attr('data-src');
  39.     var resize2 = $(".row").find("cf-resize-2");
  40.     var datasrcResize2 =
  41.     ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=280,quality=75/') + ' 360w,' : '') +
  42.     ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=600,quality=75/') + ' 640w,' : '') +
  43.     ((typeof resize2 !== typeof undefined && resize2 !== false) ? src.replace('media.mercola.com/', 'media.mercola.com/cdn-cgi/image/format=auto,fit=contain,width=405,quality=75/') + ' 960w,' : '');
  44.  
  45.     $('.cf-resize-2 .image img').each(function() {  
  46.         $(this).attr('data-srcset', datasrcResize2.substring(0, datasrcResize2.length - 1));
  47.     });
  48.  
  49.     $('.cf-resize-3 .image img').each(function() {
  50.         $(this).attr('data-srcset', datasrcResize3.substring(0, datasrcResize3.length - 1));
  51.     });    
  52.  
  53.     $('.cf-resize-4 .image img').each(function() {
  54.         $(this).attr('data-srcset', datasrcResize4.substring(0, datasrcResize4.length - 1));
  55.     });
  56. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top