lnx4 2 years ago
parent
commit
d540cf97a4
  1. 5
      README.md
  2. BIN
      chromium-lorpic/128-icon.png
  3. BIN
      chromium-lorpic/32-icon.png
  4. BIN
      chromium-lorpic/64-icon.png
  5. 28
      chromium-lorpic/app.js
  6. 21
      chromium-lorpic/manifest.json
  7. 5
      chromium-lorpic/style.css
  8. BIN
      firefox-lorpic/128-icon.png
  9. BIN
      firefox-lorpic/32-icon.png
  10. BIN
      firefox-lorpic/64-icon.png
  11. 28
      firefox-lorpic/app.js
  12. 21
      firefox-lorpic/manifest.json
  13. 5
      firefox-lorpic/style.css
  14. BIN
      screenshot.png

5
README.md

@ -1,2 +1,5 @@
# lorpic
# LORPic: Плагин для браузеров Mozilla Firefox и Chrome/Chromium
![screenshot](https://git.lnx4.ru/lnx4/lorpic/screenshot.png)
Подробнее:

BIN
chromium-lorpic/128-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
chromium-lorpic/32-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
chromium-lorpic/64-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

28
chromium-lorpic/app.js

@ -0,0 +1,28 @@
(function() {
// Code Here
const formats = ['jpeg', 'jpg', 'png']
let links = document.querySelectorAll('a[href]:not([itemprop])');
links.forEach(function(link){
let url = link.getAttribute('href');
let ext = _getUrlExt(url);
if(formats.includes(ext)){
let content = link.textContent;
if(content != 'Просмотр'){
let image = document.createElement("img");
image.setAttribute('class', 'lorpic');
image.setAttribute('src', url);
//link.replaceWith(image);
link.appendChild(image);
link.setAttribute('target', '_blank');
}
}
});
function _getUrlExt(url){
return url.split('.').pop();
}
})();

21
chromium-lorpic/manifest.json

@ -0,0 +1,21 @@
{
"manifest_version": 3,
"name": "LORPic",
"version": "1.0",
"description": "Плагин отображения картинок для LOR",
"icons": {
"32": "32-icon.png",
"64": "64-icon.png",
"128": "128-icon.png"
},
"content_scripts": [
{
"matches": [ "*://*.linux.org.ru/gallery/*/*",
"*://*.linux.org.ru/articles/*/*",
"*://*.linux.org.ru/news/*/*",
"*://*.linux.org.ru/forum/*/*" ],
"js": [ "app.js" ],
"css": [ "style.css" ]
}
]
}

5
chromium-lorpic/style.css

@ -0,0 +1,5 @@
a img.lorpic {
display: block;
max-width: 33%;
height: auto;
}

BIN
firefox-lorpic/128-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
firefox-lorpic/32-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
firefox-lorpic/64-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

28
firefox-lorpic/app.js

@ -0,0 +1,28 @@
(function() {
// Code Here
const formats = ['jpeg', 'jpg', 'png']
let links = document.querySelectorAll('a[href]:not([itemprop])');
links.forEach(function(link){
let url = link.getAttribute('href');
let ext = _getUrlExt(url);
if(formats.includes(ext)){
let content = link.textContent;
if(content != 'Просмотр'){
let image = document.createElement("img");
image.setAttribute('class', 'lorpic');
image.setAttribute('src', url);
//link.replaceWith(image);
link.appendChild(image);
link.setAttribute('target', '_blank');
}
}
});
function _getUrlExt(url){
return url.split('.').pop();
}
})();

21
firefox-lorpic/manifest.json

@ -0,0 +1,21 @@
{
"manifest_version": 2,
"name": "LORPic",
"version": "1.0",
"description": "Плагин отображения картинок для LOR",
"icons": {
"32": "32-icon.png",
"64": "64-icon.png",
"128": "128-icon.png"
},
"content_scripts": [
{
"matches": [ "*://*.linux.org.ru/gallery/*/*",
"*://*.linux.org.ru/articles/*/*",
"*://*.linux.org.ru/news/*/*",
"*://*.linux.org.ru/forum/*/*" ],
"js": [ "app.js" ],
"css": [ "style.css" ]
}
]
}

5
firefox-lorpic/style.css

@ -0,0 +1,5 @@
a img.lorpic {
display: block;
max-width: 33%;
height: auto;
}

BIN
screenshot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

Loading…
Cancel
Save