Brettflan
Active member
I took another pass at fixing Imgur display myself (since the addon dev is ignoring this specific addon for whatever reason) and came up with a solution.
For anyone else who wants to fix it themselves and has a moderate amount of ability (know how to create template modifications), the first thing to do is to add /gallery/ URL support. Save this as an XML file and import it under Services for the addon:
Then, add a template modification (if you don't know about this section of the Admin panel, maybe this isn't for you) for one of the ".less" templates; I'll be going for a random spot within "EWRmedio_media.less". I'll assume you're modifying that one, in which case have it Find:
and Replace with:
Then, a set of template modifications to add a class to all instances of "medio-aspect-box" so they reference the service name, so the above CSS can properly apply to them. For all 4 template modifications, you will have it Find:
Modification for Template "EWRmedio_media_macros", Replace with:
Modification for Template "EWRmedio_media_edit_macros", Replace with:
Modification for Template "approval_item_ewr_medio_media", Replace with:
Modification for Template "report_content_ewr_medio_media", Replace with:
After all of that, you'll have Imgur /gallery/ URLs also accepted, and for either those or the existing /a/ URLs you'll no longer have the "underflow" display problem.
For anyone else who wants to fix it themselves and has a moderate amount of ability (know how to create template modifications), the first thing to do is to add /gallery/ URL support. Save this as an XML file and import it under Services for the addon:
XML:
<?xml version="1.0" encoding="utf-8"?>
<service>
<key>imgur_gallery</key>
<type>gallery</type>
<name>Imgur Gallery</name>
<url><![CDATA[https://www.imgur.com/gallery/{sval1}]]></url>
<regex><![CDATA[https?://[\w\.]*?imgur\.com/gallery/(?P<sval1>[\w%]+)]]></regex>
<playlist><![CDATA[]]></playlist>
<embed><![CDATA[<blockquote class="imgur-embed-pub" lang="en" data-id="a/{sval1}"></blockquote>
<script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>]]></embed>
<callback>EWR\Medio\Api\Imgur</callback>
</service>
Then, add a template modification (if you don't know about this section of the Admin panel, maybe this isn't for you) for one of the ".less" templates; I'll be going for a random spot within "EWRmedio_media.less". I'll assume you're modifying that one, in which case have it Find:
CSS:
.input.medio-duration {
CSS:
/* fix XenMedio imgur iframe underflow */
div.medio-aspect-box.medio-svc-imgur, div.medio-aspect-box.medio-svc-imgur_gallery {
padding-top: 5px;
div.medio-aspect-body { top: auto; bottom: auto; left: auto; right: auto; position: relative; }
}
$0
Then, a set of template modifications to add a class to all instances of "medio-aspect-box" so they reference the service name, so the above CSS can properly apply to them. For all 4 template modifications, you will have it Find:
HTML:
<div class="medio-aspect-box">
HTML:
<div class="medio-aspect-box medio-svc-{$media.Service.service_key}">
HTML:
<div class="medio-aspect-box medio-svc-{$media.Service.service_key}">
HTML:
<div class="medio-aspect-box medio-svc-{$content.Service.service_key}">
HTML:
<div class="medio-aspect-box medio-svc-{$content.Service.service_key}">
After all of that, you'll have Imgur /gallery/ URLs also accepted, and for either those or the existing /a/ URLs you'll no longer have the "underflow" display problem.