https://dev.adiirc.com/https://dev.adiirc.com/favicon.ico?14868454782018-07-15T20:18:32ZAdiIRC Support/Bugs/Feature RequestsAdiIRC - Feature #4037: adhoc hide inline imageshttps://dev.adiirc.com/issues/4037?journal_id=76662018-07-15T20:18:32ZPer Amundsenamundsen@gmail.com
<ul></ul><p>In AdiIRC all menus are scriptable in Menubar -> Tools -> Edit Menus, you could add one with a check for whether the clicked word is a link, and if so execute the <a class="wiki-page" href="https://dev.adiirc.com/projects/adiirc/wiki/Inlineimage">/inlineimage</a> command with the -r parameter to remove the image.</p>
<p>The -r parameter was added in 3.2 beta though.</p>
<p>Due to the complexity calculating line and text positions, it's not possible to have a "hidden" line in the text buffer.</p> AdiIRC - Feature #4037: adhoc hide inline imageshttps://dev.adiirc.com/issues/4037?journal_id=76672018-07-15T20:21:30ZPer Amundsenamundsen@gmail.com
<ul></ul><p>On second thought, there should be an $inlineimage(url) to check whether the url is currently in the cache, I'll add that.</p>
<p>Then the menu could be $iif($inlineimage($1), Remove,):/inlineimage -r $1</p> AdiIRC - Feature #4037: adhoc hide inline imageshttps://dev.adiirc.com/issues/4037?journal_id=76682018-07-15T20:38:01ZPer Amundsenamundsen@gmail.com
<ul></ul><p>On further thoughts, I think an option for a close/remove image button appearing when hovering the image makes sense, I'll add that for next beta.</p>
<p>Would also just like to mention the <a href="https://adiirc.github.io/apiv2/generated/html/96f5bbe7-7a4d-6cbb-57ea-06e97aa51bda.htm" class="external">OnMenu</a> API for manipulating the menus through plugins.</p> AdiIRC - Feature #4037: adhoc hide inline imageshttps://dev.adiirc.com/issues/4037?journal_id=76692018-07-16T05:36:46Zwestor (GR)westor7@gmail.com
<ul></ul><p>I made something related if you wanna give a try then ok, i would like also the option to have <strong>$inlineimage(url)</strong> to check whether the url is currently in the cache because inlineimage saves the files names using MD5, and that extra close/remove option would be good also.</p>
<p>(Place this code under <ins>Edit Scripts</ins> section)</p>
<p>Code:</p>
<pre>
menu link {
$iif($regex($$1,$img_pattern),Parse Inline Image): {
var %line_last = $fline($active,* $+ $1 $+ *,0)
var %line = $fline($active,* $+ $1 $+ *,%line_last)
inlineimage -ai $+ $calc(%line +1) $1
}
$iif($regex($$1,$img_pattern),Hide Inline Image): { inlineimage -ra $1 }
}
alias -l img_pattern { return /.*\.(?:jpe?g|gif|png|tiff|ico)$/i }
</pre>
<p>- Thanks!</p>