This repository has been archived by the owner on Jan 26, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loader.min.js
12 lines (12 loc) · 2.24 KB
/
loader.min.js
1
2
3
4
5
6
7
8
9
10
11
12
/**
* Description: Magnific Popup support for phpBBex
* URI: https://github.com/vralle/mfp
* Author: Vitaliy Ralle
* Email: email4vit [] gmail.com
* License: MIT
*/
!function(d){d(function(){function k(b){for(var a=[],c=0;c<b.length;c++){var e=b[c],g=e.parentNode;if(g.tagName&&"a"!==g.tagName.toLowerCase()){var f=e,d=new Image;d.src=(f.getAttribute?f.getAttribute("src"):!1)||f.src;400<d.width&&(f=document.createElement("a"),f.href=e.src,f.appendChild(e.cloneNode(!0)),g.replaceChild(f,e),a.push(f))}else g.tagName&&"a"===g.tagName.toLowerCase()&&/\.(jpe?g|png|gif|bmp)(&.*)?$/ig.test(g.href)&&a.push(g)}return a}function l(b){for(i in b){var a=b[i].style;a.position=
"relative";a.display="inline-block";a=document.createElement("i");a.classList?a.classList.add("icon-zoom-large"):a.className+="icon-zoom-large";b[i].appendChild(a)}}var h=function(b){var a,c,e=b.getElementsByTagName("script")[0];return{addCss:function(a){c=b.createElement("link");c.rel="stylesheet";c.href=a;e.parentNode.insertBefore(c,e)},addJs:function(c,f){var d;a=b.createElement("script");a.onreadystatechange=a.onload=function(){var c;if(c=!d)c=a.readyState,c=!c||"loaded"==c||"complete"==c||"uninitialized"==
c;c&&(d=1,f(),a.onload=a.onreadystatechange=null)};a.src=c;e.parentNode.insertBefore(a,e)}}}(document);d(window).on("load",function(){var b=k(document.getElementById("page-body").getElementsByTagName("img"));if("undefined"!==typeof b&&0<b.length){l(b);var a=document.getElementById("mfp-loader").getAttribute("data-path")+"mfp/";h.addCss(a+"mfp.min.css");h.addJs(a+"jquery.magnific-popup.min.js",function(){"ru"==document.documentElement.lang&&d.extend(!0,d.magnificPopup.defaults,{tClose:"Закрыть (Esc)",
tLoading:"Загрузка...",gallery:{tPrev:"Назад (Клв. Влево)",tNext:"Вперед (Клв. Вправо)",tCounter:"%curr% из %total%"},image:{tError:'<a href="%url%">Изображение</a> не загружено.'}});d(b).magnificPopup({gallery:{enabled:!0},
image:{titleSrc:function(a){var b="picture";a.el.find("img").attr("title")?b=a.el.find("img").attr("title"):a.el.find("img").attr("alt")&&(b=a.el.find("img").attr("alt"));return b+' <a href="'+a.src+'" target="_blank"><i class="icon-link-ext-white"></i></a>'}},type:"image"})})}})})}(window.jQuery);