Project

General

Profile

Actions

Feature #4037

open

adhoc hide inline images

Added by Stefan R about 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
07/15/2018
Due date:
% Done:

0%

Estimated time:
Operative System:
All

Description

Would be great to have an option to hide displayed inline images.

Somthing like an "x" or right mouse button "hide" would be great. Maybe with a possibility to show them again.

Actions #1

Updated by Per Amundsen about 6 years ago

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 /inlineimage command with the -r parameter to remove the image.

The -r parameter was added in 3.2 beta though.

Due to the complexity calculating line and text positions, it's not possible to have a "hidden" line in the text buffer.

Actions #2

Updated by Per Amundsen about 6 years ago

On second thought, there should be an $inlineimage(url) to check whether the url is currently in the cache, I'll add that.

Then the menu could be $iif($inlineimage($1), Remove,):/inlineimage -r $1

Actions #3

Updated by Per Amundsen about 6 years ago

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.

Would also just like to mention the OnMenu API for manipulating the menus through plugins.

Actions #4

Updated by westor (GR) about 6 years ago

I made something related if you wanna give a try then ok, i would like also the option to have $inlineimage(url) 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.

(Place this code under Edit Scripts section)

Code:

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 }

- Thanks!

Actions

Also available in: Atom PDF