Include links to images in page as images
Inline Mantis Images Extension
Inline Mantis Images
The Mantis system attaches file as
http://*/mantis/file_download.php?file_id=55882&type=bug
with a name \"xyz.gif\"
This extension inlines the attached images to see them directly and need not to click on each image.
Your URL needs to match
\"http://*/*\"
or
\"\"
Version History:
1.2: Match all_urls (as our system changed to from http://.../mantis to http://mantis.domain.com/
1.1: Detect images case insensitive.
Here is the JavaScript source:
for ( var i = 0; i < document.links.length; ++i) {
\tmyHref = document.links[i].href;
\tlinkText = document.links[i].firstChild.data;
\tif (linkText != null) {
\t\tlinkText = linkText.toLowerCase();
\t\tif (linkText.indexOf(\".gif\") >= 0 || linkText.indexOf(\".png\") >= 0
\t\t\t\t|| linkText.indexOf(\".jpeg\") >= 0
\t\t\t\t|| linkText.indexOf(\".jpg\") >= 0
\t\t\t\t|| linkText.indexOf(\".bmp\") >= 0)
\t\t{
\t\t\tvar myIMG = document.createElement(\"img\");
\t\t\tmyIMG.src = document.links[i].href;
\t\t\tmyIMG.alt = linkText;
\t\t\tmyIMG.title = linkText;
\t\t\tdocument.links[i].appendChild(document.createElement(\"br\"));
\t\t\tdocument.links[i].appendChild(myIMG);
\t\t\tdocument.links[i].appendChild(document.createElement(\"br\"));
\t\t}
\t}
}
Read more
The Mantis system attaches file as
http://*/mantis/file_download.php?file_id=55882&type=bug
with a name \"xyz.gif\"
This extension inlines the attached images to see them directly and need not to click on each image.
Your URL needs to match
\"http://*/*\"
or
\"
Version History:
1.2: Match all_urls (as our system changed to from http://.../mantis to http://mantis.domain.com/
1.1: Detect images case insensitive.
Here is the JavaScript source:
for ( var i = 0; i < document.links.length; ++i) {
\tmyHref = document.links[i].href;
\tlinkText = document.links[i].firstChild.data;
\tif (linkText != null) {
\t\tlinkText = linkText.toLowerCase();
\t\tif (linkText.indexOf(\".gif\") >= 0 || linkText.indexOf(\".png\") >= 0
\t\t\t\t|| linkText.indexOf(\".jpeg\") >= 0
\t\t\t\t|| linkText.indexOf(\".jpg\") >= 0
\t\t\t\t|| linkText.indexOf(\".bmp\") >= 0)
\t\t{
\t\t\tvar myIMG = document.createElement(\"img\");
\t\t\tmyIMG.src = document.links[i].href;
\t\t\tmyIMG.alt = linkText;
\t\t\tmyIMG.title = linkText;
\t\t\tdocument.links[i].appendChild(document.createElement(\"br\"));
\t\t\tdocument.links[i].appendChild(myIMG);
\t\t\tdocument.links[i].appendChild(document.createElement(\"br\"));
\t\t}
\t}
}
Source Manifest.json
{"update_url": "https://clients2.google.com/service/update2/crx",\t"manifest_version": 2,\t"name": "Inline Mantis Images",\t"version": "1.3",\t"description": "Include links to images in page as images",\t"icons": {\t\t"48": "icon48.png",\t\t"128": "icon128.png"\t},\t"author": "Stefan Cordes",\t"content_scripts": [\t\t{\t\t\t"matches": [\t\t\t\t"http://*/*",\t\t\t\t"" \t\t\t],\t\t\t"js": [\t\t\t\t"inlineImages.js"\t\t\t],\t\t\t"run_at": "document_end"\t\t}\t],\t"homepage_url":"https://github.com/rscadrde/inline-mantis-images"}
Read more