Version Description
(2014-09-14) =
* Add: option to disable related videos (not supported by chromeless player)
* Enhance: added support for YouTube rel
parameter in Magnific PopUp IFRAME module
* Minified assets
* Add plugin icon for WordPress 4.x plugin installer
* Update plugin banner
Download this release
Release Info
Developer | urkekg |
Plugin | YouTube Channel |
Version | 2.2.3 |
Comparing to | |
See all releases |
Code changes from version 2.2.2 to 2.2.3
- assets/css/youtube-channel.css +1 -1
- assets/css/youtube-channel.min.css +1 -0
- assets/img/play.png +0 -0
- assets/img/play.svg +163 -0
- assets/js/youtube-channel.min.js +1 -0
- assets/lib/magnific-popup/jquery.magnific-popup.min.js +4 -4
- assets/lib/magnific-popup/magnific-popup.min.css +20 -0
- assets/settings.php +13 -0
- assets/settings_help.php +1 -0
- readme.txt +8 -1
- youtube-channel.php +31 -34
assets/css/youtube-channel.css
CHANGED
@@ -22,7 +22,7 @@
|
|
22 |
content: "";
|
23 |
display: block;
|
24 |
width: 100%;
|
25 |
-
height: 0;
|
26 |
background-image: url(../img/play.png);
|
27 |
background-position: center center;
|
28 |
background-repeat: no-repeat;
|
22 |
content: "";
|
23 |
display: block;
|
24 |
width: 100%;
|
25 |
+
height: 0;
|
26 |
background-image: url(../img/play.png);
|
27 |
background-position: center center;
|
28 |
background-repeat: no-repeat;
|
assets/css/youtube-channel.min.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.ytc_thumb{display:block;overflow:hidden;position:relative;height:0;width:100%;top:0;right:0;bottom:0;left:0}.ytc_thumb>span{height:0;width:100%;display:block;-webkit-background-size:cover;background-size:cover;background-position:center center;background-repeat:no-repeat}.ytc_thumb>span:before{content:"";display:block;width:100%;height:0;background-image:url(../img/play.png);background-position:center center;background-repeat:no-repeat;background-color:transparent;opacity:.6;transition:.4s}.ytc_thumb:hover>span:before{opacity:1}.ytc_thumb.ar16_9,.ytc_thumb.ar16_9>span,.ytc_thumb.ar16_9>span:before{padding-bottom:56.26%}.ytc_thumb.ar16_10,.ytc_thumb.ar16_10>span,.ytc_thumb.ar16_10>span:before{padding-bottom:62.5%}.ytc_thumb.ar4_3,.ytc_thumb.ar4_3>span,.ytc_thumb.ar4_3>span:before{padding-bottom:75%}
|
assets/img/play.png
CHANGED
Binary file
|
assets/img/play.svg
ADDED
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2 |
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
3 |
+
|
4 |
+
<svg
|
5 |
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
6 |
+
xmlns:cc="http://creativecommons.org/ns#"
|
7 |
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
8 |
+
xmlns:svg="http://www.w3.org/2000/svg"
|
9 |
+
xmlns="http://www.w3.org/2000/svg"
|
10 |
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
11 |
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
12 |
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
13 |
+
width="48"
|
14 |
+
height="48"
|
15 |
+
id="svg2"
|
16 |
+
version="1.1"
|
17 |
+
inkscape:version="0.91pre2 r13516"
|
18 |
+
viewBox="0 0 48 48.000001"
|
19 |
+
sodipodi:docname="play.svg"
|
20 |
+
inkscape:export-filename="X:\devel\svn\wordpress\youtube-channel\trunk\assets\img\play.png"
|
21 |
+
inkscape:export-xdpi="90"
|
22 |
+
inkscape:export-ydpi="90">
|
23 |
+
<title
|
24 |
+
id="title3387">Play Now</title>
|
25 |
+
<defs
|
26 |
+
id="defs4">
|
27 |
+
<linearGradient
|
28 |
+
id="linearGradient3362"
|
29 |
+
inkscape:collect="always">
|
30 |
+
<stop
|
31 |
+
id="stop3364"
|
32 |
+
offset="0"
|
33 |
+
style="stop-color:#b63b3b;stop-opacity:1" />
|
34 |
+
<stop
|
35 |
+
id="stop3366"
|
36 |
+
offset="1"
|
37 |
+
style="stop-color:#b00808;stop-opacity:1" />
|
38 |
+
</linearGradient>
|
39 |
+
<linearGradient
|
40 |
+
inkscape:collect="always"
|
41 |
+
id="linearGradient3350">
|
42 |
+
<stop
|
43 |
+
style="stop-color:#f85252;stop-opacity:1"
|
44 |
+
offset="0"
|
45 |
+
id="stop3352" />
|
46 |
+
<stop
|
47 |
+
style="stop-color:#b00808;stop-opacity:1"
|
48 |
+
offset="1"
|
49 |
+
id="stop3354" />
|
50 |
+
</linearGradient>
|
51 |
+
<linearGradient
|
52 |
+
inkscape:collect="always"
|
53 |
+
xlink:href="#linearGradient3362"
|
54 |
+
id="linearGradient3356"
|
55 |
+
x1="84.347733"
|
56 |
+
y1="1005.3901"
|
57 |
+
x2="84.347733"
|
58 |
+
y2="1051.4783"
|
59 |
+
gradientUnits="userSpaceOnUse" />
|
60 |
+
<linearGradient
|
61 |
+
inkscape:collect="always"
|
62 |
+
xlink:href="#linearGradient3350"
|
63 |
+
id="linearGradient3360"
|
64 |
+
gradientUnits="userSpaceOnUse"
|
65 |
+
x1="84.347733"
|
66 |
+
y1="1005.3901"
|
67 |
+
x2="84.347733"
|
68 |
+
y2="1051.4783"
|
69 |
+
gradientTransform="matrix(0.95833335,0,0,0.95833335,3.4999987,42.848408)" />
|
70 |
+
</defs>
|
71 |
+
<sodipodi:namedview
|
72 |
+
id="base"
|
73 |
+
pagecolor="#ffffff"
|
74 |
+
bordercolor="#666666"
|
75 |
+
borderopacity="1.0"
|
76 |
+
inkscape:pageopacity="0"
|
77 |
+
inkscape:pageshadow="2"
|
78 |
+
inkscape:zoom="11.895833"
|
79 |
+
inkscape:cx="24"
|
80 |
+
inkscape:cy="24"
|
81 |
+
inkscape:document-units="px"
|
82 |
+
inkscape:current-layer="layer1"
|
83 |
+
showgrid="false"
|
84 |
+
inkscape:window-width="1366"
|
85 |
+
inkscape:window-height="706"
|
86 |
+
inkscape:window-x="-8"
|
87 |
+
inkscape:window-y="-8"
|
88 |
+
inkscape:window-maximized="1" />
|
89 |
+
<metadata
|
90 |
+
id="metadata7">
|
91 |
+
<rdf:RDF>
|
92 |
+
<cc:Work
|
93 |
+
rdf:about="">
|
94 |
+
<dc:format>image/svg+xml</dc:format>
|
95 |
+
<dc:type
|
96 |
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
97 |
+
<dc:title>Play Now</dc:title>
|
98 |
+
<dc:date>2014-09-14</dc:date>
|
99 |
+
<dc:creator>
|
100 |
+
<cc:Agent>
|
101 |
+
<dc:title>Aleksandar Urosevic</dc:title>
|
102 |
+
</cc:Agent>
|
103 |
+
</dc:creator>
|
104 |
+
<cc:license
|
105 |
+
rdf:resource="http://creativecommons.org/licenses/by-nc-sa/3.0/" />
|
106 |
+
<dc:description>Play button for WordPress plugin YouTube Channel</dc:description>
|
107 |
+
</cc:Work>
|
108 |
+
<cc:License
|
109 |
+
rdf:about="http://creativecommons.org/licenses/by-nc-sa/3.0/">
|
110 |
+
<cc:permits
|
111 |
+
rdf:resource="http://creativecommons.org/ns#Reproduction" />
|
112 |
+
<cc:permits
|
113 |
+
rdf:resource="http://creativecommons.org/ns#Distribution" />
|
114 |
+
<cc:requires
|
115 |
+
rdf:resource="http://creativecommons.org/ns#Notice" />
|
116 |
+
<cc:requires
|
117 |
+
rdf:resource="http://creativecommons.org/ns#Attribution" />
|
118 |
+
<cc:prohibits
|
119 |
+
rdf:resource="http://creativecommons.org/ns#CommercialUse" />
|
120 |
+
<cc:permits
|
121 |
+
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
|
122 |
+
<cc:requires
|
123 |
+
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
|
124 |
+
</cc:License>
|
125 |
+
</rdf:RDF>
|
126 |
+
</metadata>
|
127 |
+
<g
|
128 |
+
inkscape:label="Layer 1"
|
129 |
+
inkscape:groupmode="layer"
|
130 |
+
id="layer1"
|
131 |
+
transform="translate(0,-1004.3622)">
|
132 |
+
<g
|
133 |
+
id="g3377"
|
134 |
+
transform="translate(-60,0)">
|
135 |
+
<path
|
136 |
+
style="opacity:1;fill:url(#linearGradient3356);fill-opacity:1;stroke:none"
|
137 |
+
d="m 63.999992,1004.3622 39.999998,0 c 2.216,0 4,1.784 4,4 l 0,40 c 0,2.216 -1.784,4 -4,4 l -39.999998,0 c -2.216,0 -4,-1.784 -4,-4 l 0,-40 c 0,-2.216 1.784,-4 4,-4 z"
|
138 |
+
id="rect3348" />
|
139 |
+
<path
|
140 |
+
style="opacity:1;fill:url(#linearGradient3360);fill-opacity:1;stroke:none"
|
141 |
+
d="m 63.999992,1005.3622 39.999998,0 c 1.662,0 3,1.338 3,3 l 0,40 c 0,1.662 -1.338,3 -3,3 l -39.999998,0 c -1.662,0 -3,-1.338 -3,-3 l 0,-40 c 0,-1.662 1.338,-3 3,-3 z"
|
142 |
+
id="rect3358" />
|
143 |
+
<path
|
144 |
+
id="rect3368"
|
145 |
+
transform="translate(-7.3563764e-6,0)"
|
146 |
+
d="m 64,1005.3613 c -1.662,0 -3,1.338 -3,3 l 0,40 c 0,1.662 1.338,3 3,3 l 40,0 c 1.662,0 3,-1.338 3,-3 l 0,-40 c 0,-1.662 -1.338,-3 -3,-3 l -40,0 z m 0,1 40,0 c 1.108,0 2,0.892 2,2 l 0,40 c 0,1.108 -0.892,2 -2,2 l -40,0 c -1.108,0 -2,-0.892 -2,-2 l 0,-40 c 0,-1.108 0.892,-2 2,-2 z"
|
147 |
+
style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:none"
|
148 |
+
inkscape:connector-curvature="0" />
|
149 |
+
<path
|
150 |
+
style="opacity:1;fill:#b63b3b;fill-opacity:1;stroke:none"
|
151 |
+
inkscape:transform-center-x="-3.9999989"
|
152 |
+
inkscape:transform-center-y="-0.0001121416"
|
153 |
+
d="m 98.999992,1027.3622 -12,6.9282 -12,6.9282 0,-13.8564 0,-13.8564 12.000001,6.9282 z"
|
154 |
+
id="path3375" />
|
155 |
+
<path
|
156 |
+
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none"
|
157 |
+
inkscape:transform-center-x="-3.9999989"
|
158 |
+
inkscape:transform-center-y="-0.0001121416"
|
159 |
+
d="m 97.999992,1028.3622 -12,6.9282 -12,6.9282 0,-13.8564 0,-13.8564 12.000001,6.9282 z"
|
160 |
+
id="path3373" />
|
161 |
+
</g>
|
162 |
+
</g>
|
163 |
+
</svg>
|
assets/js/youtube-channel.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
jQuery(document).ready(function(e){e(".ytc-lightbox").magnificPopup({disableOn:700,type:"iframe",mainClass:"mfp-fade",removalDelay:160,preloader:!1,fixedContentPos:!1})});
|
assets/lib/magnific-popup/jquery.magnific-popup.min.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*! Magnific Popup - v0.9.9 -
|
2 |
-
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
-
* Copyright (c) 2013 Dmitry Semenov; */
|
4 |
-
(function(e){var t,n,i,o,r,a,s,l="Close",c="BeforeClose",d="AfterClose",u="BeforeAppend",p="MarkupParse",f="Open",m="Change",g="mfp",h="."+g,v="mfp-ready",C="mfp-removing",y="mfp-prevent-close",w=function(){},b=!!window.jQuery,I=e(window),x=function(e,n){t.ev.on(g+e+h,n)},k=function(t,n,i,o){var r=document.createElement("div");return r.className="mfp-"+t,i&&(r.innerHTML=i),o?n&&n.appendChild(r):(r=e(r),n&&r.appendTo(n)),r},T=function(n,i){t.ev.triggerHandler(g+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},E=function(n){return n===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=n),t.currTemplate.closeBtn},_=function(){e.magnificPopup.instance||(t=new w,t.init(),e.magnificPopup.instance=t)},S=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};w.prototype={constructor:w,init:function(){var n=navigator.appVersion;t.isIE7=-1!==n.indexOf("MSIE 7."),t.isIE8=-1!==n.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=S(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),o=e(document),t.popupsCache={}},open:function(n){i||(i=e(document.body));var r;if(n.isObj===!1){t.items=n.items.toArray(),t.index=0;var s,l=n.items;for(r=0;l.length>r;r++)if(s=l[r],s.parsed&&(s=s.el[0]),s===n.el[0]){t.index=r;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;if(t.isOpen)return t.updateItemHTML(),void 0;t.types=[],a="",t.ev=n.mainEl&&n.mainEl.length?n.mainEl.eq(0):o,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=k("bg").on("click"+h,function(){t.close()}),t.wrap=k("wrap").attr("tabindex",-1).on("click"+h,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=k("container",t.wrap)),t.contentContainer=k("content"),t.st.preloader&&(t.preloader=k("preloader",t.container,t.st.tLoading));var c=e.magnificPopup.modules;for(r=0;c.length>r;r++){var d=c[r];d=d.charAt(0).toUpperCase()+d.slice(1),t["init"+d].call(t)}T("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(p,function(e,t,n,i){n.close_replaceWith=E(i.type)}),a+=" mfp-close-btn-in"):t.wrap.append(E())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:I.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:o.height(),position:"absolute"}),t.st.enableEscapeKey&&o.on("keyup"+h,function(e){27===e.keyCode&&t.close()}),I.on("resize"+h,function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var u=t.wH=I.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(u)){var g=t._getScrollbarSize();g&&(m.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var C=t.st.mainClass;return t.isIE7&&(C+=" mfp-ie7"),C&&t._addClassToMFP(C),t.updateItemHTML(),T("BuildControls"),e("html").css(m),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||i),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(v),t._setFocus()):t.bgOverlay.addClass(v),o.on("focusin"+h,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(u),T(f),n},close:function(){t.isOpen&&(T(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(C),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){T(l);var n=C+" "+v+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var i={marginRight:""};t.isIE7?e("body, html").css("overflow",""):i.overflow="",e("html").css(i)}o.off("keyup"+h+" focusin"+h),t.ev.off(h),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,T(d)},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||I.height();t.fixedContentPos||t.wrap.css("height",t.wH),T("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(T("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var o=t.st[i]?t.st[i].markup:!1;T("FirstMarkupParse",o),t.currTemplate[i]=o?e(o):!0}r&&r!==n.type&&t.container.removeClass("mfp-"+r+"-holder");var a=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(a,i),n.preloaded=!0,T(m,n),r=n.type,t.container.prepend(t.contentContainer),T("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[n]===!0?t.content.find(".mfp-close").length||t.content.append(E()):t.content=e:t.content="",T(u),t.container.addClass("mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i,o=t.items[n];if(o.tagName?o={el:e(o)}:(i=o.type,o={data:o,src:o.src}),o.el){for(var r=t.types,a=0;r.length>a;a++)if(o.el.hasClass("mfp-"+r[a])){i=r[a];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=i||t.st.type||"inline",o.index=n,o.parsed=!0,t.items[n]=o,T("ElementParse",o),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var o="click.magnificPopup";n.mainEl=e,n.items?(n.isObj=!0,e.off(o).on(o,i)):(n.isObj=!1,n.delegate?e.off(o).on(o,n.delegate,i):(n.items=e,e.off(o).on(o,i)))},_openClick:function(n,i,o){var r=void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick;if(r||2!==n.which&&!n.ctrlKey&&!n.metaKey){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(a>I.width())return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),o.el=e(n.mfpEl),o.delegate&&(o.items=i.find(o.delegate)),t.open(o)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var o={status:e,text:i};T("UpdateStatus",o),e=o.status,i=o.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass(y)){var i=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(i&&o)return!0;if(!t.content||e(n).hasClass("mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(o&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?o.height():document.body.scrollHeight)>(e||I.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){return n.target===t.wrap[0]||e.contains(t.wrap[0],n.target)?void 0:(t._setFocus(),!1)},_parseMarkup:function(t,n,i){var o;i.data&&(n=e.extend(i.data,n)),T(p,[t,n,i]),e.each(n,function(e,n){if(void 0===n||n===!1)return!0;if(o=e.split("_"),o.length>1){var i=t.find(h+"-"+o[0]);if(i.length>0){var r=o[1];"replaceWith"===r?i[0]!==n[0]&&i.replaceWith(n):"img"===r?i.is("img")?i.attr("src",n):i.replaceWith('<img src="'+n+'" class="'+i.attr("class")+'" />'):i.attr(o[1],n)}}else t.find(h+"-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:w.prototype,modules:[],open:function(t,n){return _(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(n){_();var i=e(this);if("string"==typeof n)if("open"===n){var o,r=b?i.data("magnificPopup"):i[0].magnificPopup,a=parseInt(arguments[1],10)||0;r.items?o=r.items[a]:(o=i,r.delegate&&(o=o.find(r.delegate)),o=o.eq(a)),t._openClick({mfpEl:o},i,r)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),b?i.data("magnificPopup",n):i[0].magnificPopup=n,t.addGroup(i,n);return i};var P,O,z,M="inline",B=function(){z&&(O.after(z.addClass(P)).detach(),z=null)};e.magnificPopup.registerModule(M,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(M),x(l+"."+M,function(){B()})},getInline:function(n,i){if(B(),n.src){var o=t.st.inline,r=e(n.src);if(r.length){var a=r[0].parentNode;a&&a.tagName&&(O||(P=o.hiddenClass,O=k(P),P="mfp-"+P),z=r.after(O).detach().removeClass(P)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),r=e("<div>");return n.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var F,H="ajax",L=function(){F&&i.removeClass(F)},A=function(){L(),t.req&&t.req.abort()};e.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(H),F=t.st.ajax.cursor,x(l+"."+H,A),x("BeforeChange."+H,A)},getAjax:function(n){F&&i.addClass(F),t.updateStatus("loading");var o=e.extend({url:n.src,success:function(i,o,r){var a={data:i,xhr:r};T("ParseAjax",a),t.appendContent(e(a.data),H),n.finished=!0,L(),t._setFocus(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),T("AjaxContentAdded")},error:function(){L(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(o),""}}});var j,N=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=t.st.image,n=".image";t.types.push("image"),x(f+n,function(){"image"===t.currItem.type&&e.cursor&&i.addClass(e.cursor)}),x(l+n,function(){e.cursor&&i.removeClass(e.cursor),I.off("resize"+h)}),x("Resize"+n,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,j&&clearInterval(j),e.isCheckingImgSize=!1,T("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],o=function(r){j&&clearInterval(j),j=setInterval(function(){return i.naturalWidth>0?(t._onImageHasSize(e),void 0):(n>200&&clearInterval(j),n++,3===n?o(10):40===n?o(50):100===n&&o(500),void 0)},r)};o(1)},getImage:function(n,i){var o=0,r=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,T("ImageLoadComplete")):(o++,200>o?setTimeout(r,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,l=i.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",n.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=n.src,l.is("img")&&(n.img=n.img.clone()),c=n.img[0],c.naturalWidth>0?n.hasSize=!0:c.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:N(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(j&&clearInterval(j),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var W,R=function(){return void 0===W&&(W=void 0!==document.createElement("p").style.MozTransform),W};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var o,r,a=n.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=i,t.css(o),t},d=function(){t.content.css("visibility","visible")};x("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return d(),void 0;r=s(e),r.css(t._getOffset()),t.wrap.append(r),o=setTimeout(function(){r.css(t._getOffset(!0)),o=setTimeout(function(){d(),setTimeout(function(){r.remove(),e=r=null,T("ZoomAnimationEnded")},16)},a)},16)}}),x(c+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(e=t._getItemToZoom(),!e)return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),x(l+i,function(){t._allowZoom()&&(d(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=i.offset(),r=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:i.width(),height:(b?i.innerHeight():i[0].offsetHeight)-a-r};return R()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var Z="iframe",q="//about:blank",D=function(e){if(t.currTemplate[Z]){var n=t.currTemplate[Z].find("iframe");n.length&&(e||(n[0].src=q),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(Z,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(Z),x("BeforeChange",function(e,t,n){t!==n&&(t===Z?D():n===Z&&D(!0))}),x(l+"."+Z,function(){D()})},getIframe:function(n,i){var o=n.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var K=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},Y=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,i=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",x(f+i,function(){n.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+i,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+i,function(e,n){n.text&&(n.text=Y(n.text,t.currItem.index,t.items.length))}),x(p+i,function(e,i,o,r){var a=t.items.length;o.counter=a>1?Y(n.tCounter,r.index,a):""}),x("BuildControls"+i,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,o=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";o[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(o.add(a))}}),x(m+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),x(l+i,function(){o.off(i),t.wrap.off("click"+i),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}),void 0):!1},next:function(){t.direction=!0,t.index=K(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=K(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),o=Math.min(n[1],t.items.length);for(e=1;(t.direction?o:i)>=e;e++)t._preloadItem(t.index+e);for(e=1;(t.direction?i:o)>=e;e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=K(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),T("LazyLoad",i),"image"===i.type&&(i.img=e('<img class="mfp-img" />').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,T("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var U="retina";e.magnificPopup.registerModule(U,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(x("ImageHasSize."+U,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),x("ElementParse."+U,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,i=function(){I.off("touchmove"+r+" touchend"+r)},o="mfpFastClick",r="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var a,s=e(this);if(n){var l,c,d,u,p,f;s.on("touchstart"+r,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,i())}).on("touchend"+r,function(e){i(),u||f>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),o())})})}s.on("click"+r,function(){a||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),n&&I.off("touchmove"+r+" touchend"+r)}}(),_()})(window.jQuery||window.Zepto);
|
1 |
+
/*! Magnific Popup - v0.9.9.1 - 2014-07-27
|
2 |
+
* http://dimsemenov.com/plugins/magnific-popup/
|
3 |
+
* Copyright (c) 2013 Dmitry Semenov; */
|
4 |
+
!function(e){var t,n,i,o,r,a,s,l="Close",c="BeforeClose",d="AfterClose",u="BeforeAppend",p="MarkupParse",f="Open",m="Change",g="mfp",h="."+g,v="mfp-ready",C="mfp-removing",y="mfp-prevent-close",w=function(){},b=!!window.jQuery,I=e(window),x=function(e,n){t.ev.on(g+e+h,n)},k=function(t,n,i,o){var r=document.createElement("div");return r.className="mfp-"+t,i&&(r.innerHTML=i),o?n&&n.appendChild(r):(r=e(r),n&&r.appendTo(n)),r},T=function(n,i){t.ev.triggerHandler(g+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},E=function(n){return n===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=n),t.currTemplate.closeBtn},_=function(){e.magnificPopup.instance||(t=new w,t.init(),e.magnificPopup.instance=t)},S=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};w.prototype={constructor:w,init:function(){var n=navigator.appVersion;t.isIE7=-1!==n.indexOf("MSIE 7."),t.isIE8=-1!==n.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=S(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),o=e(document),t.popupsCache={}},open:function(n){i||(i=e(document.body));var r;if(n.isObj===!1){t.items=n.items.toArray(),t.index=0;var s,l=n.items;for(r=0;r<l.length;r++)if(s=l[r],s.parsed&&(s=s.el[0]),s===n.el[0]){t.index=r;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;if(t.isOpen)return void t.updateItemHTML();t.types=[],a="",t.ev=n.mainEl&&n.mainEl.length?n.mainEl.eq(0):o,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=k("bg").on("click"+h,function(){t.close()}),t.wrap=k("wrap").attr("tabindex",-1).on("click"+h,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=k("container",t.wrap)),t.contentContainer=k("content"),t.st.preloader&&(t.preloader=k("preloader",t.container,t.st.tLoading));var c=e.magnificPopup.modules;for(r=0;r<c.length;r++){var d=c[r];d=d.charAt(0).toUpperCase()+d.slice(1),t["init"+d].call(t)}T("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(p,function(e,t,n,i){n.close_replaceWith=E(i.type)}),a+=" mfp-close-btn-in"):t.wrap.append(E())),t.st.alignTop&&(a+=" mfp-align-top"),t.wrap.css(t.fixedContentPos?{overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}:{top:I.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:o.height(),position:"absolute"}),t.st.enableEscapeKey&&o.on("keyup"+h,function(e){27===e.keyCode&&t.close()}),I.on("resize"+h,function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var u=t.wH=I.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(u)){var g=t._getScrollbarSize();g&&(m.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var C=t.st.mainClass;return t.isIE7&&(C+=" mfp-ie7"),C&&t._addClassToMFP(C),t.updateItemHTML(),T("BuildControls"),e("html").css(m),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||i),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(v),t._setFocus()):t.bgOverlay.addClass(v),o.on("focusin"+h,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(u),T(f),n},close:function(){t.isOpen&&(T(c),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(C),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){T(l);var n=C+" "+v+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var i={marginRight:""};t.isIE7?e("body, html").css("overflow",""):i.overflow="",e("html").css(i)}o.off("keyup"+h+" focusin"+h),t.ev.off(h),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,T(d)},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||I.height();t.fixedContentPos||t.wrap.css("height",t.wH),T("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(T("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var o=t.st[i]?t.st[i].markup:!1;T("FirstMarkupParse",o),t.currTemplate[i]=o?e(o):!0}r&&r!==n.type&&t.container.removeClass("mfp-"+r+"-holder");var a=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(a,i),n.preloaded=!0,T(m,n),r=n.type,t.container.prepend(t.contentContainer),T("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[n]===!0?t.content.find(".mfp-close").length||t.content.append(E()):t.content=e:t.content="",T(u),t.container.addClass("mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i,o=t.items[n];if(o.tagName?o={el:e(o)}:(i=o.type,o={data:o,src:o.src}),o.el){for(var r=t.types,a=0;a<r.length;a++)if(o.el.hasClass("mfp-"+r[a])){i=r[a];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=i||t.st.type||"inline",o.index=n,o.parsed=!0,t.items[n]=o,T("ElementParse",o),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var o="click.magnificPopup";n.mainEl=e,n.items?(n.isObj=!0,e.off(o).on(o,i)):(n.isObj=!1,n.delegate?e.off(o).on(o,n.delegate,i):(n.items=e,e.off(o).on(o,i)))},_openClick:function(n,i,o){var r=void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick;if(r||2!==n.which&&!n.ctrlKey&&!n.metaKey){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(I.width()<a)return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),o.el=e(n.mfpEl),o.delegate&&(o.items=i.find(o.delegate)),t.open(o)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var o={status:e,text:i};T("UpdateStatus",o),e=o.status,i=o.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass(y)){var i=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(i&&o)return!0;if(!t.content||e(n).hasClass("mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(o&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?o.height():document.body.scrollHeight)>(e||I.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){return n.target===t.wrap[0]||e.contains(t.wrap[0],n.target)?void 0:(t._setFocus(),!1)},_parseMarkup:function(t,n,i){var o;i.data&&(n=e.extend(i.data,n)),T(p,[t,n,i]),e.each(n,function(e,n){if(void 0===n||n===!1)return!0;if(o=e.split("_"),o.length>1){var i=t.find(h+"-"+o[0]);if(i.length>0){var r=o[1];"replaceWith"===r?i[0]!==n[0]&&i.replaceWith(n):"img"===r?i.is("img")?i.attr("src",n):i.replaceWith('<img src="'+n+'" class="'+i.attr("class")+'" />'):i.attr(o[1],n)}}else t.find(h+"-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:w.prototype,modules:[],open:function(t,n){return _(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(n){_();var i=e(this);if("string"==typeof n)if("open"===n){var o,r=b?i.data("magnificPopup"):i[0].magnificPopup,a=parseInt(arguments[1],10)||0;r.items?o=r.items[a]:(o=i,r.delegate&&(o=o.find(r.delegate)),o=o.eq(a)),t._openClick({mfpEl:o},i,r)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),b?i.data("magnificPopup",n):i[0].magnificPopup=n,t.addGroup(i,n);return i};var P,O,z,M="inline",B=function(){z&&(O.after(z.addClass(P)).detach(),z=null)};e.magnificPopup.registerModule(M,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(M),x(l+"."+M,function(){B()})},getInline:function(n,i){if(B(),n.src){var o=t.st.inline,r=e(n.src);if(r.length){var a=r[0].parentNode;a&&a.tagName&&(O||(P=o.hiddenClass,O=k(P),P="mfp-"+P),z=r.after(O).detach().removeClass(P)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),r=e("<div>");return n.inlineElement=r,r}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var F,H="ajax",L=function(){F&&i.removeClass(F)},A=function(){L(),t.req&&t.req.abort()};e.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(H),F=t.st.ajax.cursor,x(l+"."+H,A),x("BeforeChange."+H,A)},getAjax:function(n){F&&i.addClass(F),t.updateStatus("loading");var o=e.extend({url:n.src,success:function(i,o,r){var a={data:i,xhr:r};T("ParseAjax",a),t.appendContent(e(a.data),H),n.finished=!0,L(),t._setFocus(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),T("AjaxContentAdded")},error:function(){L(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(o),""}}});var j,N=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=t.st.image,n=".image";t.types.push("image"),x(f+n,function(){"image"===t.currItem.type&&e.cursor&&i.addClass(e.cursor)}),x(l+n,function(){e.cursor&&i.removeClass(e.cursor),I.off("resize"+h)}),x("Resize"+n,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,j&&clearInterval(j),e.isCheckingImgSize=!1,T("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],o=function(r){j&&clearInterval(j),j=setInterval(function(){return i.naturalWidth>0?void t._onImageHasSize(e):(n>200&&clearInterval(j),n++,void(3===n?o(10):40===n?o(50):100===n&&o(500)))},r)};o(1)},getImage:function(n,i){var o=0,r=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,T("ImageLoadComplete")):(o++,200>o?setTimeout(r,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,l=i.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",n.img=e(c).on("load.mfploader",r).on("error.mfploader",a),c.src=n.src,l.is("img")&&(n.img=n.img.clone()),c=n.img[0],c.naturalWidth>0?n.hasSize=!0:c.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:N(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(j&&clearInterval(j),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var W,R=function(){return void 0===W&&(W=void 0!==document.createElement("p").style.MozTransform),W};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var o,r,a=n.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},r="transition";return o["-webkit-"+r]=o["-moz-"+r]=o["-o-"+r]=o[r]=i,t.css(o),t},d=function(){t.content.css("visibility","visible")};x("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return void d();r=s(e),r.css(t._getOffset()),t.wrap.append(r),o=setTimeout(function(){r.css(t._getOffset(!0)),o=setTimeout(function(){d(),setTimeout(function(){r.remove(),e=r=null,T("ZoomAnimationEnded")},16)},a)},16)}}),x(c+i,function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=a,!e){if(e=t._getItemToZoom(),!e)return;r=s(e)}r.css(t._getOffset(!0)),t.wrap.append(r),t.content.css("visibility","hidden"),setTimeout(function(){r.css(t._getOffset())},16)}}),x(l+i,function(){t._allowZoom()&&(d(),r&&r.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return t.currItem.hasSize?t.currItem.img:!1},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var o=i.offset(),r=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);o.top-=e(window).scrollTop()-r;var s={width:i.width(),height:(b?i.innerHeight():i[0].offsetHeight)-a-r};return R()?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var Z="iframe",q="//about:blank",D=function(e){if(t.currTemplate[Z]){var n=t.currTemplate[Z].find("iframe");n.length&&(e||(n[0].src=q),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(Z,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",rel:"rel=",src:"//www.youtube.com/embed/%id%?autoplay=1&rel=%rel%"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(Z),x("BeforeChange",function(e,t,n){t!==n&&(t===Z?D():n===Z&&D(!0))}),x(l+"."+Z,function(){D()})},getIframe:function(n,i){var o=n.src,r=t.st.iframe;e.each(r.patterns,function(){return o.indexOf(this.index)>-1?(this.id&&("string"==typeof this.rel&&(embedRel=o.substr(o.lastIndexOf(this.rel)+this.rel.length,o.length)),"string"==typeof this.id?(o=o.substr(o.lastIndexOf(this.id)+this.id.length,o.length),o=o.substr(0,o.indexOf("&"))):o=this.id.call(this,o)),o=this.src.replace("%id%",o).replace("%rel%",embedRel),!1):void 0});var a={};return r.srcAction&&(a[r.srcAction]=o),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var K=function(e){var n=t.items.length;return e>n-1?e-n:0>e?n+e:e},Y=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,i=".mfp-gallery",r=Boolean(e.fn.mfpFastClick);return t.direction=!0,n&&n.enabled?(a+=" mfp-gallery",x(f+i,function(){n.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){return t.items.length>1?(t.next(),!1):void 0}),o.on("keydown"+i,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+i,function(e,n){n.text&&(n.text=Y(n.text,t.currItem.index,t.items.length))}),x(p+i,function(e,i,o,r){var a=t.items.length;o.counter=a>1?Y(n.tCounter,r.index,a):""}),x("BuildControls"+i,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,o=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(y),a=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(y),s=r?"mfpFastClick":"click";o[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(k("b",o[0],!1,!0),k("a",o[0],!1,!0),k("b",a[0],!1,!0),k("a",a[0],!1,!0)),t.container.append(o.add(a))}}),x(m+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),void x(l+i,function(){o.off(i),t.wrap.off("click"+i),t.arrowLeft&&r&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null})):!1},next:function(){t.direction=!0,t.index=K(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=K(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),o=Math.min(n[1],t.items.length);for(e=1;e<=(t.direction?o:i);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?i:o);e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=K(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),T("LazyLoad",i),"image"===i.type&&(i.img=e('<img class="mfp-img" />').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,T("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var U="retina";e.magnificPopup.registerModule(U,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(x("ImageHasSize."+U,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),x("ElementParse."+U,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,i=function(){I.off("touchmove"+r+" touchend"+r)},o="mfpFastClick",r="."+o;e.fn.mfpFastClick=function(o){return e(this).each(function(){var a,s=e(this);if(n){var l,c,d,u,p,f;s.on("touchstart"+r,function(e){u=!1,f=1,p=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],c=p.clientX,d=p.clientY,I.on("touchmove"+r,function(e){p=e.originalEvent?e.originalEvent.touches:e.touches,f=p.length,p=p[0],(Math.abs(p.clientX-c)>10||Math.abs(p.clientY-d)>10)&&(u=!0,i())}).on("touchend"+r,function(e){i(),u||f>1||(a=!0,e.preventDefault(),clearTimeout(l),l=setTimeout(function(){a=!1},t),o())})})}s.on("click"+r,function(){a||o()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+r+" click"+r),n&&I.off("touchmove"+r+" touchend"+r)}}(),_()}(window.jQuery||window.Zepto);
|
assets/lib/magnific-popup/magnific-popup.min.css
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.mfp-bg{top:0;left:0;width:100%;height:100%;z-index:1042;overflow:hidden;position:fixed;background:#0b0b0b;opacity:.8;filter:alpha(opacity=80)}.mfp-wrap{top:0;left:0;width:100%;height:100%;z-index:1043;position:fixed;outline:none!important;-webkit-backface-visibility:hidden}
|
2 |
+
.mfp-container{text-align:center;position:absolute;width:100%;height:100%;left:0;top:0;padding:0 8px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.mfp-container:before{content:'';display:inline-block;height:100%;vertical-align:middle}
|
3 |
+
.mfp-align-top .mfp-container:before{display:none}.mfp-content{position:relative;display:inline-block;vertical-align:middle;margin:0 auto;text-align:left;z-index:1045}.mfp-inline-holder .mfp-content,.mfp-ajax-holder .mfp-content{width:100%;cursor:auto}
|
4 |
+
.mfp-ajax-cur{cursor:progress}.mfp-zoom-out-cur,.mfp-zoom-out-cur .mfp-image-holder .mfp-close{cursor:-moz-zoom-out;cursor:-webkit-zoom-out;cursor:zoom-out}.mfp-zoom{cursor:pointer;cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.mfp-auto-cursor .mfp-content{cursor:auto}
|
5 |
+
.mfp-close,.mfp-arrow,.mfp-preloader,.mfp-counter{-webkit-user-select:none;-moz-user-select:none;user-select:none}.mfp-loading.mfp-figure{display:none}.mfp-hide{display:none!important}.mfp-preloader{color:#ccc;position:absolute;top:50%;width:auto;text-align:center;margin-top:-0.8em;left:8px;right:8px;z-index:1044}
|
6 |
+
.mfp-preloader a{color:#ccc}.mfp-preloader a:hover{color:white}.mfp-s-ready .mfp-preloader{display:none}.mfp-s-error .mfp-content{display:none}button.mfp-close,button.mfp-arrow{overflow:visible;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;display:block;outline:0;padding:0;z-index:1046;-webkit-box-shadow:none;box-shadow:none}
|
7 |
+
button::-moz-focus-inner{padding:0;border:0}.mfp-close{width:44px;height:44px;line-height:44px;position:absolute;right:0;top:0;text-decoration:none;text-align:center;opacity:.65;filter:alpha(opacity=65);padding:0 0 18px 10px;color:white;font-style:normal;font-size:28px;font-family:Arial,Baskerville,monospace}
|
8 |
+
.mfp-close:hover,.mfp-close:focus{opacity:1;filter:alpha(opacity=100);background:transparent}.mfp-close:active{top:1px}.mfp-close-btn-in .mfp-close{color:#333}.mfp-image-holder .mfp-close,.mfp-iframe-holder .mfp-close{color:white;right:-6px;text-align:right;padding-right:6px;width:100%}
|
9 |
+
.mfp-counter{position:absolute;top:0;right:0;color:#ccc;font-size:12px;line-height:18px}.mfp-arrow{position:absolute;opacity:.65;filter:alpha(opacity=65);margin:0;top:50%;margin-top:-55px;padding:0;width:90px;height:110px;-webkit-tap-highlight-color:rgba(0,0,0,0)}
|
10 |
+
.mfp-arrow:active{margin-top:-54px}.mfp-arrow:hover,.mfp-arrow:focus{opacity:1;filter:alpha(opacity=100)}.mfp-arrow:before,.mfp-arrow:after,.mfp-arrow .mfp-b,.mfp-arrow .mfp-a{content:'';display:block;width:0;height:0;position:absolute;left:0;top:0;margin-top:35px;margin-left:35px;border:medium inset transparent}
|
11 |
+
.mfp-arrow:after,.mfp-arrow .mfp-a{border-top-width:13px;border-bottom-width:13px;top:8px}.mfp-arrow:before,.mfp-arrow .mfp-b{border-top-width:21px;border-bottom-width:21px;opacity:.7}.mfp-arrow-left{left:0}.mfp-arrow-left:after,.mfp-arrow-left .mfp-a{border-right:17px solid white;margin-left:31px}
|
12 |
+
.mfp-arrow-left:before,.mfp-arrow-left .mfp-b{margin-left:25px;border-right:27px solid #3f3f3f}.mfp-arrow-right{right:0}.mfp-arrow-right:after,.mfp-arrow-right .mfp-a{border-left:17px solid white;margin-left:39px}.mfp-arrow-right:before,.mfp-arrow-right .mfp-b{border-left:27px solid #3f3f3f}
|
13 |
+
.mfp-iframe-holder{padding-top:40px;padding-bottom:40px}.mfp-iframe-holder .mfp-content{line-height:0;width:100%;max-width:900px}.mfp-iframe-holder .mfp-close{top:-40px}.mfp-iframe-scaler{width:100%;height:0;overflow:hidden;padding-top:56.25%}.mfp-iframe-scaler iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;box-shadow:0 0 8px rgba(0,0,0,0.6);background:black}
|
14 |
+
img.mfp-img{width:auto;max-width:100%;height:auto;display:block;line-height:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:40px 0 40px;margin:0 auto}.mfp-figure{line-height:0}.mfp-figure:after{content:'';position:absolute;left:0;top:40px;bottom:40px;display:block;right:0;width:auto;height:auto;z-index:-1;box-shadow:0 0 8px rgba(0,0,0,0.6);background:#444}
|
15 |
+
.mfp-figure small{color:#bdbdbd;display:block;font-size:12px;line-height:14px}.mfp-figure figure{margin:0}.mfp-bottom-bar{margin-top:-36px;position:absolute;top:100%;left:0;width:100%;cursor:auto}.mfp-title{text-align:left;line-height:18px;color:#f3f3f3;word-wrap:break-word;padding-right:36px}
|
16 |
+
.mfp-image-holder .mfp-content{max-width:100%}.mfp-gallery .mfp-image-holder .mfp-figure{cursor:pointer}@media screen and (max-width:800px) and (orientation:landscape),screen and (max-height:300px){.mfp-img-mobile .mfp-image-holder{padding-left:0;padding-right:0}
|
17 |
+
.mfp-img-mobile img.mfp-img{padding:0}.mfp-img-mobile .mfp-figure:after{top:0;bottom:0}.mfp-img-mobile .mfp-figure small{display:inline;margin-left:5px}.mfp-img-mobile .mfp-bottom-bar{background:rgba(0,0,0,0.6);bottom:0;margin:0;top:auto;padding:3px 5px;position:fixed;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
|
18 |
+
.mfp-img-mobile .mfp-bottom-bar:empty{padding:0}.mfp-img-mobile .mfp-counter{right:5px;top:3px}.mfp-img-mobile .mfp-close{top:0;right:0;width:35px;height:35px;line-height:35px;background:rgba(0,0,0,0.6);position:fixed;text-align:center;padding:0}}@media all and (max-width:900px){.mfp-arrow{-webkit-transform:scale(0.75);transform:scale(0.75)}
|
19 |
+
.mfp-arrow-left{-webkit-transform-origin:0 0;transform-origin:0 0}.mfp-arrow-right{-webkit-transform-origin:100%;transform-origin:100%}.mfp-container{padding-left:6px;padding-right:6px}}.mfp-ie7 .mfp-img{padding:0}.mfp-ie7 .mfp-bottom-bar{width:600px;left:50%;margin-left:-300px;margin-top:5px;padding-bottom:5px}
|
20 |
+
.mfp-ie7 .mfp-container{padding:0}.mfp-ie7 .mfp-content{padding-top:44px}.mfp-ie7 .mfp-close{top:0;right:0;padding-top:0}
|
assets/settings.php
CHANGED
@@ -341,6 +341,19 @@ if(class_exists('WPAU_YOUTUBE_CHANNEL') && !class_exists('WPAU_YOUTUBE_CHANNEL_S
|
|
341 |
'value' => $this->defaults['autoplay_mute'],
|
342 |
)
|
343 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
} // END register_video_settings()
|
345 |
|
346 |
function register_content_settings()
|
341 |
'value' => $this->defaults['autoplay_mute'],
|
342 |
)
|
343 |
);
|
344 |
+
add_settings_field(
|
345 |
+
'wpau_youtube_channel-norel',
|
346 |
+
__('Hide related videos',YTCTDOM),
|
347 |
+
array(&$this, 'settings_field_checkbox'),
|
348 |
+
$this->video_settings_key,
|
349 |
+
'video_settings',
|
350 |
+
array(
|
351 |
+
'field' => "youtube_channel_defaults[norel]",
|
352 |
+
'description' => __('Enable this option to hide related videos after finished playback',YTCTDOM),
|
353 |
+
'class' => 'checkbox',
|
354 |
+
'value' => $this->defaults['norel'],
|
355 |
+
)
|
356 |
+
);
|
357 |
} // END register_video_settings()
|
358 |
|
359 |
function register_content_settings()
|
assets/settings_help.php
CHANGED
@@ -41,6 +41,7 @@
|
|
41 |
<li><code>fix_h</code> <em>(bool)</em> If you did not set to hide player controls, you can set this option to <code>1</code> or <code>true</code> to fix video height taken by controls</li>
|
42 |
<li><code>autoplay</code> <em>(bool)</em> Enable autoplay of first video in YTC video stack by setting this option to <code>1</code> or <code>true</code></li>
|
43 |
<li><code>mute</code> <em>(bool)</em> Set this option to <code>1</code> or <code>true</code> to mute videos set to autoplay on load</li>
|
|
|
44 |
</ul>
|
45 |
<h3>Content Layout</h3>
|
46 |
<ul>
|
41 |
<li><code>fix_h</code> <em>(bool)</em> If you did not set to hide player controls, you can set this option to <code>1</code> or <code>true</code> to fix video height taken by controls</li>
|
42 |
<li><code>autoplay</code> <em>(bool)</em> Enable autoplay of first video in YTC video stack by setting this option to <code>1</code> or <code>true</code></li>
|
43 |
<li><code>mute</code> <em>(bool)</em> Set this option to <code>1</code> or <code>true</code> to mute videos set to autoplay on load</li>
|
44 |
+
<li><code>norel</code> <em>(bool)</em> Set this option to <code>1</code> or <code>true</code> to hire related videos after finished playbak</li>
|
45 |
</ul>
|
46 |
<h3>Content Layout</h3>
|
47 |
<ul>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: youtube, channel, playlist, single, widget, widgets, youtube player, flash player, rss, feed, video, thumbnail, embed, sidebar, chromeless, iframe, html5
|
5 |
Requires at least: 3.8.0
|
6 |
Tested up to: 4.0
|
7 |
-
Stable tag: 2.2.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -120,6 +120,13 @@ Video feed for YTC has been retreived with standard youtube feed [uploads by spe
|
|
120 |
If you does not see your latest video in your uplaods feed (which you can access at https://gdata.youtube.com/feeds/api/users/YOUR_YT_USERID/uploads by replacing YOUR_YT_USERID with your real youtube user ID), then YTC will not see it too.
|
121 |
|
122 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
= 2.2.2 (2014-07-25) =
|
124 |
* Add: admin notices after upgrade to prevent errors and avare users to do ReCache and prevent mixed json_decode / base64_encode strings for cached feeds
|
125 |
* Change: moved ReCache part to Tools tab on settings page
|
4 |
Tags: youtube, channel, playlist, single, widget, widgets, youtube player, flash player, rss, feed, video, thumbnail, embed, sidebar, chromeless, iframe, html5
|
5 |
Requires at least: 3.8.0
|
6 |
Tested up to: 4.0
|
7 |
+
Stable tag: 2.2.3
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
120 |
If you does not see your latest video in your uplaods feed (which you can access at https://gdata.youtube.com/feeds/api/users/YOUR_YT_USERID/uploads by replacing YOUR_YT_USERID with your real youtube user ID), then YTC will not see it too.
|
121 |
|
122 |
== Changelog ==
|
123 |
+
= 2.2.3 (2014-09-14) =
|
124 |
+
* Add: option to disable related videos (not supported by chromeless player)
|
125 |
+
* Enhance: added support for YouTube `rel` parameter in Magnific PopUp IFRAME module
|
126 |
+
* Minified assets
|
127 |
+
* Add plugin icon for WordPress 4.x plugin installer
|
128 |
+
* Update plugin banner
|
129 |
+
|
130 |
= 2.2.2 (2014-07-25) =
|
131 |
* Add: admin notices after upgrade to prevent errors and avare users to do ReCache and prevent mixed json_decode / base64_encode strings for cached feeds
|
132 |
* Change: moved ReCache part to Tools tab on settings page
|
youtube-channel.php
CHANGED
@@ -4,10 +4,10 @@ Plugin Name: YouTube Channel
|
|
4 |
Plugin URI: http://urosevic.net/wordpress/plugins/youtube-channel/
|
5 |
Description: <a href="widgets.php">Widget</a> that display latest video thumbnail, iframe (HTML5 video), object (Flash video) or chromeless video from YouTube Channel or Playlist.
|
6 |
Author: Aleksandar Urošević
|
7 |
-
Version: 2.2.
|
8 |
Author URI: http://urosevic.net/
|
9 |
*/
|
10 |
-
define( 'YTCVER', '2.2.
|
11 |
define( 'YOUTUBE_CHANNEL_URL', plugin_dir_url(__FILE__) );
|
12 |
define( 'YTCPLID', 'PLEC850BE962234400' );
|
13 |
define( 'YTCUID', 'urkekg' );
|
@@ -76,6 +76,7 @@ class WPAU_YOUTUBE_CHANNEL extends WP_Widget {
|
|
76 |
'fixyt' => false,
|
77 |
'autoplay' => false,
|
78 |
'autoplay_mute' => false,
|
|
|
79 |
|
80 |
'showtitle' => false,
|
81 |
'showvidesc' => false,
|
@@ -272,6 +273,7 @@ class WPAU_YOUTUBE_CHANNEL extends WP_Widget {
|
|
272 |
$fixyt = (!empty($instance['fixyt'])) ? esc_attr($instance['fixyt']) : '';
|
273 |
$autoplay = (!empty($instance['autoplay'])) ? esc_attr($instance['autoplay']) : '';
|
274 |
$autoplay_mute = (!empty($instance['autoplay_mute'])) ? esc_attr($instance['autoplay_mute']) : '';
|
|
|
275 |
|
276 |
// Content Layout
|
277 |
$showtitle = (!empty($instance['showtitle'])) ? esc_attr($instance['showtitle']) : '';
|
@@ -372,7 +374,8 @@ class WPAU_YOUTUBE_CHANNEL extends WP_Widget {
|
|
372 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $controls, true ); ?> id="<?php echo $this->get_field_id( 'controls' ); ?>" name="<?php echo $this->get_field_name( 'controls' ); ?>" /> <label for="<?php echo $this->get_field_id( 'controls' ); ?>"><?php _e('Hide player controls', YTCTDOM); ?></label><br />
|
373 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $fixyt, true ); ?> id="<?php echo $this->get_field_id( 'fixyt' ); ?>" name="<?php echo $this->get_field_name( 'fixyt' ); ?>" /> <label for="<?php echo $this->get_field_id( 'fixyt' ); ?>"><?php _e('Fix height taken by controls', YTCTDOM); ?></label><br />
|
374 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $autoplay, true ); ?> id="<?php echo $this->get_field_id( 'autoplay' ); ?>" name="<?php echo $this->get_field_name( 'autoplay' ); ?>" /> <label for="<?php echo $this->get_field_id( 'autoplay' ); ?>"><?php _e('Autoplay video or playlist', YTCTDOM); ?></label><br />
|
375 |
-
<input class="checkbox" type="checkbox" <?php checked( (bool) $autoplay_mute, true ); ?> id="<?php echo $this->get_field_id( 'autoplay_mute' ); ?>" name="<?php echo $this->get_field_name( 'autoplay_mute' ); ?>" /> <label for="<?php echo $this->get_field_id( 'autoplay_mute' ); ?>"><?php _e('Mute video on autoplay', YTCTDOM); ?></label
|
|
|
376 |
</p>
|
377 |
|
378 |
<h4><?php _e('Content Layout', YTCTDOM); ?></h4>
|
@@ -454,6 +457,7 @@ if ( $debugon == 'on' ) {
|
|
454 |
$instance['to_show'] = strip_tags($new_instance['to_show']);
|
455 |
$instance['autoplay'] = (isset($new_instance['autoplay'])) ? $new_instance['autoplay'] : false;
|
456 |
$instance['autoplay_mute'] = (isset($new_instance['autoplay_mute'])) ? $new_instance['autoplay_mute'] : false;
|
|
|
457 |
|
458 |
$instance['controls'] = (isset($new_instance['controls'])) ? $new_instance['controls'] : false;
|
459 |
$instance['fixnoitem'] = (isset($new_instance['fixnoitem'])) ? $new_instance['fixnoitem'] : false;
|
@@ -497,6 +501,7 @@ if ( $debugon == 'on' ) {
|
|
497 |
$instance['fixyt'] = (empty($fix_h)) ? $defaults['fixyt'] : $fix_h; // fix youtube height, disabled by default
|
498 |
$instance['autoplay'] = (empty($autoplay)) ? $defaults['autoplay'] : $autoplay; // autoplay disabled by default
|
499 |
$instance['autoplay_mute'] = (empty($mute)) ? $defaults['autoplay_mute'] : $mute; // mute sound on autoplay - disabled by default
|
|
|
500 |
|
501 |
// Content Layout
|
502 |
$instance['showtitle'] = (empty($showtitle)) ? $defaults['showtitle'] : $showtitle; // show video title, disabled by default
|
@@ -689,19 +694,12 @@ if( class_exists('WPAU_YOUTUBE_CHANNEL'))
|
|
689 |
|
690 |
/* Load YTC player script */
|
691 |
function ytc_enqueue_scripts() {
|
692 |
-
|
693 |
-
wp_enqueue_style( 'youtube-channel', plugins_url('assets/css/youtube-channel.css', __FILE__), array(), YTCVER );
|
694 |
-
// enqueue fancybox
|
695 |
-
// wp_enqueue_script( 'fancybox', plugins_url('assets/lib/fancybox/jquery.fancybox.pack.js', __FILE__), array('jquery'), YTCVER, true );
|
696 |
-
// wp_enqueue_style( 'fancybox', plugins_url('assets/lib/fancybox/jquery.fancybox.css', __FILE__), array(), YTCVER );
|
697 |
-
// wp_enqueue_script( 'fancybox-media', plugins_url('assets/lib/fancybox/jquery.fancybox-media.js', __FILE__), array('jquery'), YTCVER, true );
|
698 |
-
// wp_enqueue_script( 'youtube-channel', plugins_url('assets/js/youtube-channel.js', __FILE__), array(), YTCVER, true );
|
699 |
|
700 |
// enqueue magnific-popup
|
701 |
wp_enqueue_script( 'magnific-popup', plugins_url('assets/lib/magnific-popup/jquery.magnific-popup.min.js', __FILE__), array('jquery'), YTCVER, true );
|
702 |
-
wp_enqueue_style( 'magnific-popup', plugins_url('assets/lib/magnific-popup/magnific-popup.css', __FILE__), array(), YTCVER );
|
703 |
-
|
704 |
-
wp_enqueue_script( 'youtube-channel', plugins_url('assets/js/youtube-channel.js', __FILE__), array(), YTCVER, true );
|
705 |
}
|
706 |
add_action( 'wp_enqueue_scripts', 'ytc_enqueue_scripts' );
|
707 |
|
@@ -735,9 +733,7 @@ function ytc_only_pl($instance) {
|
|
735 |
if ( empty($width) )
|
736 |
$width = 220;
|
737 |
|
738 |
-
$playlist = $instance['playlist'];
|
739 |
-
if ( empty($playlist) )
|
740 |
-
$playlist = YTCPLID;
|
741 |
|
742 |
$height = height_ratio($width, $instance['ratio']);
|
743 |
// $height = height_ratio($width, $instance['height'], $instance['ratio']);
|
@@ -746,14 +742,14 @@ function ytc_only_pl($instance) {
|
|
746 |
|
747 |
$playlist = ytc_clean_playlist_id($playlist);
|
748 |
|
749 |
-
$autoplay = $instance['autoplay'];
|
750 |
-
if ( $autoplay )
|
751 |
-
$autoplay = '&autoplay=1';
|
752 |
|
|
|
|
|
753 |
// enhanced privacy
|
754 |
-
$yt_domain = yt_domain($instance);
|
755 |
$output[] = '<div class="ytc_video_container ytc_video_1 ytc_video_single">
|
756 |
-
<iframe src="http://'.$yt_domain.'/embed/videoseries?list=PL'.$playlist.$autoplay.'"
|
757 |
width="'.$width.'" height="'.$height.'" frameborder="0"></iframe></div>';
|
758 |
return $output;
|
759 |
}
|
@@ -767,20 +763,17 @@ function ytc_print_video($item, $instance, $y) {
|
|
767 |
$autoplay = $instance['autoplay'];
|
768 |
$autoplay_mute = $instance['autoplay_mute'];
|
769 |
$controls = $instance['controls'];
|
|
|
770 |
|
771 |
// set width and height
|
772 |
-
$width
|
773 |
-
|
774 |
-
$height = height_ratio($width, $instance['ratio']);
|
775 |
-
// $height = height_ratio($width, $instance['height'], $instance['ratio']);
|
776 |
|
777 |
// calculate image height based on width for 4:3 thumbnail
|
778 |
$imgfixedheight = $width / 4 * 3;
|
779 |
|
780 |
// which type to show
|
781 |
-
$to_show = $instance['to_show'];
|
782 |
-
if ( $to_show == "" )
|
783 |
-
$to_show = "object";
|
784 |
|
785 |
// if not thumbnail, increase video height for 25px taken by video controls
|
786 |
if ( $to_show != 'thumbnail' && !$controls && $instance['fixyt'] )
|
@@ -797,6 +790,7 @@ function ytc_print_video($item, $instance, $y) {
|
|
797 |
$yt_thumb = "http://img.youtube.com/vi/$yt_id/0.jpg"; // zero for HD thumb
|
798 |
$yt_video = $item->link[0]->href;
|
799 |
$yt_video = preg_replace('/\&.*$/','',$yt_video);
|
|
|
800 |
$yt_title = $item->title->{'$t'};
|
801 |
$yt_date = $item->published->{'$t'};
|
802 |
//$yt_date = $item->get_date('j F Y | g:i a');
|
@@ -837,12 +831,13 @@ function ytc_print_video($item, $instance, $y) {
|
|
837 |
default: $arclass = 'ar16_9';
|
838 |
}
|
839 |
$title = sprintf( __( 'Watch video %1$s published on %2$s' , YTCTDOM ), $yt_title, $yt_date );
|
840 |
-
$
|
|
|
841 |
} else if ( $to_show == "chromeless" ) {
|
842 |
ob_start();
|
843 |
?>
|
844 |
<object type="application/x-shockwave-flash" data="<?php echo YOUTUBE_CHANNEL_URL . 'chromeless.swf'; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" id="<?php echo $ytc_vid; ?>">
|
845 |
-
<param name="flashVars" value="video_source=<?php echo $yt_id; ?>&video_width=<?php echo $width; ?>&video_height=<?php echo $height; ?><?php if ( $autoplay ) echo "&autoplay=Yes"; if ( !$controls ) echo "&youtube_controls=Yes"; if ( $hideanno ) echo "&iv_load_policy=3"; if ( $themelight ) echo "&theme=light"; ?>" />
|
846 |
<param name="quality" value="high" />
|
847 |
<param name="wmode" value="opaque" />
|
848 |
<param name="swfversion" value="6.0.65.0" />
|
@@ -860,17 +855,20 @@ function ytc_print_video($item, $instance, $y) {
|
|
860 |
if ( $autoplay ) $output[] = "&autoplay=1";
|
861 |
if ( $hideanno ) $output[] = "&iv_load_policy=3";
|
862 |
if ( $themelight ) $output[] = "&theme=light";
|
|
|
|
|
863 |
|
864 |
$output[] = '" style="border: 0;" allowfullscreen id="'.$ytc_vid.'"></iframe>';
|
865 |
} else if ( $to_show == "iframe2" ) {
|
866 |
// youtube API async
|
867 |
if ( empty($usepl) ) $yt_url = $yt_id;
|
868 |
|
|
|
869 |
$js_controls = ( $controls ) ? "controls: 0," : '';
|
870 |
$js_showinfo = ( $hideinfo ) ? "showinfo: 0," : '';
|
871 |
-
$js_autoplay = ( $autoplay ) ? "autoplay: 1," : '';
|
872 |
$js_iv_load_policy = ( $hideanno ) ? "iv_load_policy: 3," : '';
|
873 |
$js_theme = ( $themelight ) ? "theme: 'light'," : '';
|
|
|
874 |
$js_autoplay_mute = ( $autoplay && $autoplay_mute ) ? "events: {'onReady': ytc_mute}" : '';
|
875 |
$js_player_id = str_replace('-', '_', $yt_url);
|
876 |
|
@@ -884,7 +882,7 @@ function ytc_print_video($item, $instance, $y) {
|
|
884 |
videoId: '$yt_url',
|
885 |
enablejsapi: 1,
|
886 |
playerVars: {
|
887 |
-
$js_autoplay $js_showinfo $js_controls $js_theme wmmode: 'opaque'
|
888 |
},
|
889 |
origin: '$site_domain',
|
890 |
$js_iv_load_policy $js_autoplay_mute
|
@@ -904,6 +902,7 @@ JS;
|
|
904 |
$obj_url .= ( $autoplay ) ? '&autoplay=1' : '';
|
905 |
$obj_url .= ( $hideanno ) ? '&iv_load_policy=3' : '';
|
906 |
$obj_url .= ( $themelight ) ? '&theme=light' : '';
|
|
|
907 |
ob_start();
|
908 |
?>
|
909 |
<object width="<?php echo $width; ?>" height="<?php echo $height; ?>" type="application/x-shockwave-flash" data="<?php echo $obj_url; ?>">
|
@@ -960,8 +959,6 @@ JS;
|
|
960 |
|
961 |
// function to calculate height by width and ratio
|
962 |
function height_ratio($width=220, $ratio) {
|
963 |
-
// if ( $width == "" ) $width = 220;
|
964 |
-
|
965 |
switch ($ratio)
|
966 |
{
|
967 |
case 1:
|
4 |
Plugin URI: http://urosevic.net/wordpress/plugins/youtube-channel/
|
5 |
Description: <a href="widgets.php">Widget</a> that display latest video thumbnail, iframe (HTML5 video), object (Flash video) or chromeless video from YouTube Channel or Playlist.
|
6 |
Author: Aleksandar Urošević
|
7 |
+
Version: 2.2.3
|
8 |
Author URI: http://urosevic.net/
|
9 |
*/
|
10 |
+
define( 'YTCVER', '2.2.3' );
|
11 |
define( 'YOUTUBE_CHANNEL_URL', plugin_dir_url(__FILE__) );
|
12 |
define( 'YTCPLID', 'PLEC850BE962234400' );
|
13 |
define( 'YTCUID', 'urkekg' );
|
76 |
'fixyt' => false,
|
77 |
'autoplay' => false,
|
78 |
'autoplay_mute' => false,
|
79 |
+
'norel' => false,
|
80 |
|
81 |
'showtitle' => false,
|
82 |
'showvidesc' => false,
|
273 |
$fixyt = (!empty($instance['fixyt'])) ? esc_attr($instance['fixyt']) : '';
|
274 |
$autoplay = (!empty($instance['autoplay'])) ? esc_attr($instance['autoplay']) : '';
|
275 |
$autoplay_mute = (!empty($instance['autoplay_mute'])) ? esc_attr($instance['autoplay_mute']) : '';
|
276 |
+
$norel = (!empty($instance['norel'])) ? esc_attr($instance['norel']) : '';
|
277 |
|
278 |
// Content Layout
|
279 |
$showtitle = (!empty($instance['showtitle'])) ? esc_attr($instance['showtitle']) : '';
|
374 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $controls, true ); ?> id="<?php echo $this->get_field_id( 'controls' ); ?>" name="<?php echo $this->get_field_name( 'controls' ); ?>" /> <label for="<?php echo $this->get_field_id( 'controls' ); ?>"><?php _e('Hide player controls', YTCTDOM); ?></label><br />
|
375 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $fixyt, true ); ?> id="<?php echo $this->get_field_id( 'fixyt' ); ?>" name="<?php echo $this->get_field_name( 'fixyt' ); ?>" /> <label for="<?php echo $this->get_field_id( 'fixyt' ); ?>"><?php _e('Fix height taken by controls', YTCTDOM); ?></label><br />
|
376 |
<input class="checkbox" type="checkbox" <?php checked( (bool) $autoplay, true ); ?> id="<?php echo $this->get_field_id( 'autoplay' ); ?>" name="<?php echo $this->get_field_name( 'autoplay' ); ?>" /> <label for="<?php echo $this->get_field_id( 'autoplay' ); ?>"><?php _e('Autoplay video or playlist', YTCTDOM); ?></label><br />
|
377 |
+
<input class="checkbox" type="checkbox" <?php checked( (bool) $autoplay_mute, true ); ?> id="<?php echo $this->get_field_id( 'autoplay_mute' ); ?>" name="<?php echo $this->get_field_name( 'autoplay_mute' ); ?>" /> <label for="<?php echo $this->get_field_id( 'autoplay_mute' ); ?>"><?php _e('Mute video on autoplay', YTCTDOM); ?></label><br />
|
378 |
+
<input class="checkbox" type="checkbox" <?php checked( (bool) $norel, true ); ?> id="<?php echo $this->get_field_id( 'norel' ); ?>" name="<?php echo $this->get_field_name( 'norel' ); ?>" /> <label for="<?php echo $this->get_field_id( 'norel' ); ?>"><?php _e('Hide related videos', YTCTDOM); ?></label>
|
379 |
</p>
|
380 |
|
381 |
<h4><?php _e('Content Layout', YTCTDOM); ?></h4>
|
457 |
$instance['to_show'] = strip_tags($new_instance['to_show']);
|
458 |
$instance['autoplay'] = (isset($new_instance['autoplay'])) ? $new_instance['autoplay'] : false;
|
459 |
$instance['autoplay_mute'] = (isset($new_instance['autoplay_mute'])) ? $new_instance['autoplay_mute'] : false;
|
460 |
+
$instance['norel'] = (isset($new_instance['norel'])) ? $new_instance['norel'] : false;
|
461 |
|
462 |
$instance['controls'] = (isset($new_instance['controls'])) ? $new_instance['controls'] : false;
|
463 |
$instance['fixnoitem'] = (isset($new_instance['fixnoitem'])) ? $new_instance['fixnoitem'] : false;
|
501 |
$instance['fixyt'] = (empty($fix_h)) ? $defaults['fixyt'] : $fix_h; // fix youtube height, disabled by default
|
502 |
$instance['autoplay'] = (empty($autoplay)) ? $defaults['autoplay'] : $autoplay; // autoplay disabled by default
|
503 |
$instance['autoplay_mute'] = (empty($mute)) ? $defaults['autoplay_mute'] : $mute; // mute sound on autoplay - disabled by default
|
504 |
+
$instance['norel'] = (empty($norel)) ? $defaults['norel'] : $norel; // hide related videos
|
505 |
|
506 |
// Content Layout
|
507 |
$instance['showtitle'] = (empty($showtitle)) ? $defaults['showtitle'] : $showtitle; // show video title, disabled by default
|
694 |
|
695 |
/* Load YTC player script */
|
696 |
function ytc_enqueue_scripts() {
|
697 |
+
wp_enqueue_style( 'youtube-channel', plugins_url('assets/css/youtube-channel.min.css', __FILE__), array(), YTCVER );
|
|
|
|
|
|
|
|
|
|
|
|
|
698 |
|
699 |
// enqueue magnific-popup
|
700 |
wp_enqueue_script( 'magnific-popup', plugins_url('assets/lib/magnific-popup/jquery.magnific-popup.min.js', __FILE__), array('jquery'), YTCVER, true );
|
701 |
+
wp_enqueue_style( 'magnific-popup', plugins_url('assets/lib/magnific-popup/magnific-popup.min.css', __FILE__), array(), YTCVER );
|
702 |
+
wp_enqueue_script( 'youtube-channel', plugins_url('assets/js/youtube-channel.min.js', __FILE__), array(), YTCVER, true );
|
|
|
703 |
}
|
704 |
add_action( 'wp_enqueue_scripts', 'ytc_enqueue_scripts' );
|
705 |
|
733 |
if ( empty($width) )
|
734 |
$width = 220;
|
735 |
|
736 |
+
$playlist = (empty($instance['playlist'])) ? YTCPLID : $instance['playlist'];
|
|
|
|
|
737 |
|
738 |
$height = height_ratio($width, $instance['ratio']);
|
739 |
// $height = height_ratio($width, $instance['height'], $instance['ratio']);
|
742 |
|
743 |
$playlist = ytc_clean_playlist_id($playlist);
|
744 |
|
745 |
+
$autoplay = (empty($instance['autoplay'])) ? '' : '&autoplay=1';
|
|
|
|
|
746 |
|
747 |
+
$rel = (empty($instance['norel'])) ? '' : '&rel=0';
|
748 |
+
|
749 |
// enhanced privacy
|
750 |
+
$yt_domain = yt_domain($instance);
|
751 |
$output[] = '<div class="ytc_video_container ytc_video_1 ytc_video_single">
|
752 |
+
<iframe src="http://'.$yt_domain.'/embed/videoseries?list=PL'.$playlist.$autoplay.$rel.'"
|
753 |
width="'.$width.'" height="'.$height.'" frameborder="0"></iframe></div>';
|
754 |
return $output;
|
755 |
}
|
763 |
$autoplay = $instance['autoplay'];
|
764 |
$autoplay_mute = $instance['autoplay_mute'];
|
765 |
$controls = $instance['controls'];
|
766 |
+
$norel = $instance['norel'];
|
767 |
|
768 |
// set width and height
|
769 |
+
$width = ( empty($instance['width']) ) ? 220 : $instance['width'];
|
770 |
+
$height = height_ratio($width, $instance['ratio']);
|
|
|
|
|
771 |
|
772 |
// calculate image height based on width for 4:3 thumbnail
|
773 |
$imgfixedheight = $width / 4 * 3;
|
774 |
|
775 |
// which type to show
|
776 |
+
$to_show = (empty($instance['to_show'])) ? 'object' : $instance['to_show'];
|
|
|
|
|
777 |
|
778 |
// if not thumbnail, increase video height for 25px taken by video controls
|
779 |
if ( $to_show != 'thumbnail' && !$controls && $instance['fixyt'] )
|
790 |
$yt_thumb = "http://img.youtube.com/vi/$yt_id/0.jpg"; // zero for HD thumb
|
791 |
$yt_video = $item->link[0]->href;
|
792 |
$yt_video = preg_replace('/\&.*$/','',$yt_video);
|
793 |
+
|
794 |
$yt_title = $item->title->{'$t'};
|
795 |
$yt_date = $item->published->{'$t'};
|
796 |
//$yt_date = $item->get_date('j F Y | g:i a');
|
831 |
default: $arclass = 'ar16_9';
|
832 |
}
|
833 |
$title = sprintf( __( 'Watch video %1$s published on %2$s' , YTCTDOM ), $yt_title, $yt_date );
|
834 |
+
$rel = ( $norel ) ? "0" : "1";
|
835 |
+
$output[] = '<a href="'.$yt_video.'&rel='.$rel.'" title="'.$yt_title.'" class="ytc_thumb ytc-lightbox '.$arclass.'"><span style="background-image: url('.$yt_thumb.');" title="'.$title.'" id="'.$ytc_vid.'"></span></a>';
|
836 |
} else if ( $to_show == "chromeless" ) {
|
837 |
ob_start();
|
838 |
?>
|
839 |
<object type="application/x-shockwave-flash" data="<?php echo YOUTUBE_CHANNEL_URL . 'chromeless.swf'; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" id="<?php echo $ytc_vid; ?>">
|
840 |
+
<param name="flashVars" value="video_source=<?php echo $yt_id; ?>&video_width=<?php echo $width; ?>&video_height=<?php echo $height; ?><?php if ( $autoplay ) echo "&autoplay=Yes"; if ( !$controls ) echo "&youtube_controls=Yes"; if ( $hideanno ) echo "&iv_load_policy=3"; if ( $themelight ) echo "&theme=light"; if ( $norel ) echo "&rel=0"; ?>" />
|
841 |
<param name="quality" value="high" />
|
842 |
<param name="wmode" value="opaque" />
|
843 |
<param name="swfversion" value="6.0.65.0" />
|
855 |
if ( $autoplay ) $output[] = "&autoplay=1";
|
856 |
if ( $hideanno ) $output[] = "&iv_load_policy=3";
|
857 |
if ( $themelight ) $output[] = "&theme=light";
|
858 |
+
// disable related videos
|
859 |
+
if ( $norel ) $output[] = "&rel=0";
|
860 |
|
861 |
$output[] = '" style="border: 0;" allowfullscreen id="'.$ytc_vid.'"></iframe>';
|
862 |
} else if ( $to_show == "iframe2" ) {
|
863 |
// youtube API async
|
864 |
if ( empty($usepl) ) $yt_url = $yt_id;
|
865 |
|
866 |
+
$js_rel = ( $norel ) ? "rel: 0," : '';
|
867 |
$js_controls = ( $controls ) ? "controls: 0," : '';
|
868 |
$js_showinfo = ( $hideinfo ) ? "showinfo: 0," : '';
|
|
|
869 |
$js_iv_load_policy = ( $hideanno ) ? "iv_load_policy: 3," : '';
|
870 |
$js_theme = ( $themelight ) ? "theme: 'light'," : '';
|
871 |
+
$js_autoplay = ( $autoplay ) ? "autoplay: 1," : '';
|
872 |
$js_autoplay_mute = ( $autoplay && $autoplay_mute ) ? "events: {'onReady': ytc_mute}" : '';
|
873 |
$js_player_id = str_replace('-', '_', $yt_url);
|
874 |
|
882 |
videoId: '$yt_url',
|
883 |
enablejsapi: 1,
|
884 |
playerVars: {
|
885 |
+
$js_autoplay $js_showinfo $js_controls $js_theme $js_rel wmmode: 'opaque'
|
886 |
},
|
887 |
origin: '$site_domain',
|
888 |
$js_iv_load_policy $js_autoplay_mute
|
902 |
$obj_url .= ( $autoplay ) ? '&autoplay=1' : '';
|
903 |
$obj_url .= ( $hideanno ) ? '&iv_load_policy=3' : '';
|
904 |
$obj_url .= ( $themelight ) ? '&theme=light' : '';
|
905 |
+
$obj_url .= ( $norel ) ? '&rel=0' : '';
|
906 |
ob_start();
|
907 |
?>
|
908 |
<object width="<?php echo $width; ?>" height="<?php echo $height; ?>" type="application/x-shockwave-flash" data="<?php echo $obj_url; ?>">
|
959 |
|
960 |
// function to calculate height by width and ratio
|
961 |
function height_ratio($width=220, $ratio) {
|
|
|
|
|
962 |
switch ($ratio)
|
963 |
{
|
964 |
case 1:
|