Version Description
- updated LYTE-player UI: larger display of preview image, changed look of title placeholder, updated controls image
- new: added support for "Infinite Scroll" as proposed by "der Tuxman" and Olivier
- new: added beta-support for YouTube's JS API as requested by Yun
- performance: remove double DOM-lookups in javascript, hat tip Yun
- annoyance-avoidance: check for "Karma Blocker" addon and warn, based on feedback from Leona
- translation: added Romanian, thanks to Alexander and Web Hosting Geeks
- bugfix: 2nd video with start or showinfo parameters inherited the ones from the 1st one as well as reported by Josh D
- bugfix: marked lyte img border css as !important
- bugfix: moved inline javascript (for each lyte-div) to the footer of the page to solve conflict with some jQuery plugins in MSIE as reported by Yun
- bugfix: set autohide to false for audio-only embeds
Download this release
Release Info
Developer | futtta |
Plugin | WP YouTube Lyte |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.0
- languages/wp-youtube-lyte-ro_RO.mo +0 -0
- languages/wp-youtube-lyte-ro_RO.po +202 -0
- lyte/controls-1280.png +0 -0
- lyte/controls-150.png +0 -0
- lyte/controls-160.png +0 -0
- lyte/controls-180.png +0 -0
- lyte/controls-420.png +0 -0
- lyte/controls-480.png +0 -0
- lyte/controls-560.png +0 -0
- lyte/controls-640.png +0 -0
- lyte/controls-853.png +0 -0
- lyte/controls-960.png +0 -0
- lyte/lyte-min.js +1 -1
- lyte/lyte.css +1 -1
- lyte/lyte.js +56 -60
- readme.txt +25 -14
- widget.php +14 -10
- wp-youtube-lyte.php +33 -11
languages/wp-youtube-lyte-ro_RO.mo
ADDED
Binary file
|
languages/wp-youtube-lyte-ro_RO.po
ADDED
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: \n"
|
4 |
+
"POT-Creation-Date: \n"
|
5 |
+
"PO-Revision-Date: \n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: \n"
|
8 |
+
"MIME-Version: 1.0\n"
|
9 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
+
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
|
12 |
+
# This file is distributed under the same license as the WP YouTube Lyte package.
|
13 |
+
#: widget.php:74
|
14 |
+
msgid "Title:"
|
15 |
+
msgstr "Titlu:"
|
16 |
+
|
17 |
+
#: widget.php:75
|
18 |
+
msgid "Size:"
|
19 |
+
msgstr "Dimensiune:"
|
20 |
+
|
21 |
+
#: widget.php:91
|
22 |
+
msgid "Type:"
|
23 |
+
msgstr "Tip:"
|
24 |
+
|
25 |
+
#: widget.php:99
|
26 |
+
msgid "audio"
|
27 |
+
msgstr "audio"
|
28 |
+
|
29 |
+
#: widget.php:100
|
30 |
+
msgid "video"
|
31 |
+
msgstr "video"
|
32 |
+
|
33 |
+
#: widget.php:104
|
34 |
+
msgid "Youtube-URL:"
|
35 |
+
msgstr "YouTube-URL:"
|
36 |
+
|
37 |
+
#: widget.php:105
|
38 |
+
msgid "Text:"
|
39 |
+
msgstr "Text:"
|
40 |
+
|
41 |
+
#: player_sizes.inc.php:11
|
42 |
+
msgid "Smaller 4:3 player"
|
43 |
+
msgstr "Mai mic player de 4: 3"
|
44 |
+
|
45 |
+
#: player_sizes.inc.php:16
|
46 |
+
msgid "Smaller 16:9 player"
|
47 |
+
msgstr "Mai mic 16:9 jucător"
|
48 |
+
|
49 |
+
#: player_sizes.inc.php:21
|
50 |
+
msgid "Standard value, YouTube default for 4:3-ratio video"
|
51 |
+
msgstr "Valoarea standard, YouTube implicit pentru 4: 3-raportul video"
|
52 |
+
|
53 |
+
#: player_sizes.inc.php:26
|
54 |
+
msgid "YouTube default for 16:9-ratio video"
|
55 |
+
msgstr "YouTube implicit pentru 16: 9-raportul video"
|
56 |
+
|
57 |
+
#: player_sizes.inc.php:31
|
58 |
+
msgid "Larger 4:3 player"
|
59 |
+
msgstr "Mai mare jucator 04:03"
|
60 |
+
|
61 |
+
#: player_sizes.inc.php:36
|
62 |
+
msgid "Larger 16:9 player"
|
63 |
+
msgstr "Mai mare jucător 16:9"
|
64 |
+
|
65 |
+
#: player_sizes.inc.php:41
|
66 |
+
msgid "Maxi 4:3 player"
|
67 |
+
msgstr "Player maxi 4: 3"
|
68 |
+
|
69 |
+
#: player_sizes.inc.php:46
|
70 |
+
msgid "Maxi 16:9 player"
|
71 |
+
msgstr "Player maxi 16: 9"
|
72 |
+
|
73 |
+
#: wp-youtube-lyte.php:60
|
74 |
+
#: wp-youtube-lyte.php:64
|
75 |
+
msgid "Watch this playlist on YouTube"
|
76 |
+
msgstr "Uita-te la acest playlist pe YouTube"
|
77 |
+
|
78 |
+
#: wp-youtube-lyte.php:65
|
79 |
+
msgid "Watch this playlist"
|
80 |
+
msgstr "Uita-te la această listă de redare"
|
81 |
+
|
82 |
+
#: wp-youtube-lyte.php:65
|
83 |
+
#: wp-youtube-lyte.php:78
|
84 |
+
#: wp-youtube-lyte.php:82
|
85 |
+
msgid "on YouTube"
|
86 |
+
msgstr "pe YouTube"
|
87 |
+
|
88 |
+
#: wp-youtube-lyte.php:73
|
89 |
+
msgid "Watch this video on YouTube"
|
90 |
+
msgstr "Uita-te la acest video de pe YouTube"
|
91 |
+
|
92 |
+
#: wp-youtube-lyte.php:78
|
93 |
+
#: wp-youtube-lyte.php:82
|
94 |
+
msgid "Watch this video"
|
95 |
+
msgstr "Uita-te la acest video"
|
96 |
+
|
97 |
+
#: wp-youtube-lyte.php:78
|
98 |
+
msgid "or on"
|
99 |
+
msgstr "sau pe"
|
100 |
+
|
101 |
+
#: options.php:37
|
102 |
+
msgid "WP YouTube Lyte Settings"
|
103 |
+
msgstr "WP YouTube Lyte Setări"
|
104 |
+
|
105 |
+
#: options.php:39
|
106 |
+
msgid "WP YouTube Lyte inserts \"Lite YouTube Embeds\" in your blog. These look and feel like normal embedded YouTube, but don't use Flash unless clicked on, thereby <a href=\"http://blog.futtta.be/2010/08/30/the-state-of-wp-youtube-lyte/\" target=\"_blank\">reducing download size & rendering time substantially</a>. When a video is played, WP-YouTube-Lyte can either activate <a href=\"http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html\" target=\"_blank\">YouTube's embedded html5-player</a> or the older Flash-version, depending on the settings below."
|
107 |
+
msgstr "WP YouTube introduce Lyte \"Lite YouTube Încorporează\" în blog. Aceste aspect si simt ca normală Embedded YouTube, dar nu folosi Flash excepţia cazului în care a făcut clic pe, astfel <a href=\"http://blog.futtta.be/2010/08/30/the-state-of-wp-youtube-lyte/\" target=\"_blank\"> reducerea dimensiunii de descărcare şi redare de timp în mod substanţial </a>. Când un film este jucat, WP-YouTube-Lyte poate activa fie <a href=\"http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html\" target=\"_blank\"> YouTube încorporat HTML5-player-ul </a> sau mai vechi Flash-versiune, în funcţie de setările de mai jos."
|
108 |
+
|
109 |
+
#: options.php:40
|
110 |
+
msgid "You can place video and audio in your posts and pages by adding one or more http<strong>v</strong> or http<strong>a</strong> YouTube-links to your post. These will automatically be replaced by WP YouTube Lyte with the correct (flash-less) code. To add a video for example, you type a URL like <em>http<strong>v</strong>://www.youtube.com/watch?v=QQPSMRQnNlU</em> or <em>http<strong>v</strong>://www.youtube.com/playlist?list=PLA486E741B25F8E00</em> for a playlist. If you want an audio-only player, you enter <em>http<strong>a</strong>://www.youtube.com/watch?v=BIQIGR-kWtc</em>. There's more info on the <a href=\"http://wordpress.org/extend/plugins/wp-youtube-lyte/faq/\" target=\"_blank\">wordpress.org WP YouTube Lyte FAQ page</a>."
|
111 |
+
msgstr "Puteţi pune video şi audio in mesajele dumneavoastră şi pagini prin adăugarea uneia sau mai multor http </strong>://www.youtube.com/watch?v=QQPSMRQnNlU</em> or <em>http<strong>v</strong>://www.youtube.com/playlist?list=PLA486E741B25F8E00</em> YouTube-link-uri pentru a posta dvs.. Acestea vor fi înlocuite automat cu WP . YouTube Lyte cu corectă (flash-mai puţin) cod pentru a adauga un film de exemplu, tastaţi un URL ca <em>http<strong>a</strong>://www.youtube.com/watch?v=BIQIGR-kWtc</em> wordpress.org <a href=\"http://wordpress.org/extend/plugins/wp-youtube-lyte/faq/\" target=\"_blank\">wordpress.org WP YouTube Lyte FAQ page</a>.\"WP YouTube lyte Întrebări frecvente pagina </ a>."
|
112 |
+
|
113 |
+
#: options.php:41
|
114 |
+
msgid "You can modify WP-YouTube-Lyte's behaviour by changing the following settings:"
|
115 |
+
msgstr "Puteţi modifica comportamentul WP-YouTube-Lyte prin schimbarea următoarele setări:"
|
116 |
+
|
117 |
+
#: options.php:48
|
118 |
+
msgid "Player size"
|
119 |
+
msgstr "Player size"
|
120 |
+
|
121 |
+
#: options.php:65
|
122 |
+
msgid "Add links below the embedded videos?"
|
123 |
+
msgstr "Adauga linkurile de mai jos clipurile video încorporate?"
|
124 |
+
|
125 |
+
#: options.php:67
|
126 |
+
msgid "Show links?"
|
127 |
+
msgstr "Afişare link-uri?"
|
128 |
+
|
129 |
+
#: options.php:68
|
130 |
+
msgid " Add YouTube-link."
|
131 |
+
msgstr "Adăugaţi YouTube-link."
|
132 |
+
|
133 |
+
#: options.php:69
|
134 |
+
msgid " Add both a YouTube and an <a href=\"http://icant.co.uk/easy-youtube/docs/index.html\" target=\"_blank\">Easy YouTube</a>-link."
|
135 |
+
msgstr "Adăugaţi atât o pe YouTube şi un <a href=\"http://icant.co.uk/easy-youtube/docs/index.html\" target=\"_blank\">Easy YouTube</a>-link."
|
136 |
+
|
137 |
+
#: options.php:70
|
138 |
+
msgid " Don't add any links."
|
139 |
+
msgstr "Nu adăuga orice link-uri."
|
140 |
+
|
141 |
+
#: options.php:75
|
142 |
+
msgid "Play video in HD if possible?"
|
143 |
+
msgstr "Redare video în format HD, dacă este posibil?"
|
144 |
+
|
145 |
+
#: options.php:79
|
146 |
+
msgid "Enable HD"
|
147 |
+
msgstr "Permite HD"
|
148 |
+
|
149 |
+
#: options.php:80
|
150 |
+
msgid "No HD, we're smallband!"
|
151 |
+
msgstr "Nu HD, suntem smallband!"
|
152 |
+
|
153 |
+
#: options.php:85
|
154 |
+
msgid "Bonus feature: "
|
155 |
+
msgstr "Caracteristica bonus: "
|
156 |
+
|
157 |
+
#: options.php:89
|
158 |
+
msgid "Disable 3rd party tracking."
|
159 |
+
msgstr "Dezactivaţi urmărirea 3rd party."
|
160 |
+
|
161 |
+
#: options.php:90
|
162 |
+
msgid "I don't mind 3rd party tracking (default)"
|
163 |
+
msgstr "Nu ma deranjeaza de urmărire 3rd party (implicit)"
|
164 |
+
|
165 |
+
#: options.php:97
|
166 |
+
msgid "Save Changes"
|
167 |
+
msgstr "Salvaţi Modificările"
|
168 |
+
|
169 |
+
#: options.php:105
|
170 |
+
msgid "futtta about"
|
171 |
+
msgstr "futtta despre"
|
172 |
+
|
173 |
+
#. #-#-#-#-# plugin.pot (WP YouTube Lyte 0.8.0) #-#-#-#-#
|
174 |
+
#. Plugin Name of the plugin/theme
|
175 |
+
#: options.php:107
|
176 |
+
msgid "WP YouTube Lyte"
|
177 |
+
msgstr "WP YouTube Lyte"
|
178 |
+
|
179 |
+
#: options.php:108
|
180 |
+
msgid "WordPress"
|
181 |
+
msgstr "WordPress"
|
182 |
+
|
183 |
+
#: options.php:109
|
184 |
+
msgid "Web Technology"
|
185 |
+
msgstr "Web Tehnologie"
|
186 |
+
|
187 |
+
#. Plugin URI of the plugin/theme
|
188 |
+
msgid "http://blog.futtta.be/tag/lyte"
|
189 |
+
msgstr "http://blog.futtta.be/Tag/lyte"
|
190 |
+
|
191 |
+
#. Description of the plugin/theme
|
192 |
+
msgid "Lite and accessible YouTube audio and video embedding."
|
193 |
+
msgstr "Lite şi accesibile pe YouTube audio şi video de încorporare."
|
194 |
+
|
195 |
+
#. Author of the plugin/theme
|
196 |
+
msgid "Frank Goossens (futtta)"
|
197 |
+
msgstr "Frank Goossens (futtta)"
|
198 |
+
|
199 |
+
#. Author URI of the plugin/theme
|
200 |
+
msgid "http://blog.futtta.be/"
|
201 |
+
msgstr "http://blog.futtta.be/"
|
202 |
+
|
lyte/controls-1280.png
CHANGED
Binary file
|
lyte/controls-150.png
CHANGED
Binary file
|
lyte/controls-160.png
CHANGED
Binary file
|
lyte/controls-180.png
CHANGED
Binary file
|
lyte/controls-420.png
CHANGED
Binary file
|
lyte/controls-480.png
CHANGED
Binary file
|
lyte/controls-560.png
CHANGED
Binary file
|
lyte/controls-640.png
CHANGED
Binary file
|
lyte/controls-853.png
CHANGED
Binary file
|
lyte/controls-960.png
CHANGED
Binary file
|
lyte/lyte-min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function loadSC(a){scr=d.createElement("script");scr.src=a;scr.type="text/javascript";d.getElementsByTagName("head")[0].appendChild(scr)}function setST(a,b){if(typeof a.setAttribute==="function")a.setAttribute("style",b);else if(typeof a.style.setAttribute==="object")a.style.setAttribute("cssText",b)}function drawT(a,b){p=d.getElementById(a);c=d.createElement("div");c.className="tC";
|
1 |
+
function loadSC(a){scr=d.createElement("script");scr.src=a;scr.type="text/javascript";d.getElementsByTagName("head")[0].appendChild(scr)}function setST(a,b){if(typeof a.setAttribute==="function")a.setAttribute("style",b);else if(typeof a.style.setAttribute==="object")a.style.setAttribute("cssText",b)}function drawT(a,b){p=d.getElementById(a);c=d.createElement("div");c.className="tC";t=d.createElement("div");t.className="tT";c.appendChild(t);t.innerHTML=b;p.appendChild(c)}function parsePL(a){thumb=a.feed.entry[0].media$group.media$thumbnail[1].url;idu=a.feed.id.$t;id="lyte_"+idu.substring(idu.length-16);title="Playlist: "+a.feed.title.$t;pl=d.getElementById(id);pH=pl.style.height;pW=pl.style.width;if(sch=="https"&&thumb.indexOf("https"==-1)){thumb=thumb.replace("http://","https://")}setST(pl,"height:"+pH+";width:"+pW+";background:url('"+thumb+"') no-repeat scroll center -50px rgb(0, 0, 0); background-size:cover;");drawT(id,title)}function parseV(a){tI=a.entry.title.$t;idu=a.entry.id.$t;id="lyte_"+idu.substring(idu.length-11);drawT(id,tI)}function plaYT(){tH=this;tH.onclick="";vid=tH.id.substring(4);if(tH.className.indexOf("hidef")===-1){hidef=0}else{hidef=1}if(tH.className.indexOf("playlist")===-1){eU=sch+"://www.youtube.com/embed/"+vid}else{eU=sch+"://www.youtube.com/embed/p/"+vid}qsa=getQ(tH);if(tH.className.indexOf("audio")!==-1){qsa+="&autohide=0"}tH.innerHTML='<iframe id="iF_'+vid+'" width="'+tH.clientWidth+'" height="'+tH.clientHeight+'" src="'+eU+"?autoplay=1&wmode=opaque&rel=0&egm=0&iv_load_policy=3&hd="+hidef+qsa+'" frameborder="0"></iframe>';if(typeof tH.firstChild.getAttribute("kabl")=="string")tH.innerHTML="Please check Karma Blocker's config."}function getQ(a){qsa="";if(rqs=a.className.match(/qsa_(.*)\s/,"$1"))qsa=rqs[1].replace(/\\([\&\=\?])/g,"$1");return qsa}function lyte(){if(!a){var a=1;lts=getElementsByClassName("lyte","div");for(var b=0,c=lts.length;b<c;b+=1){p=lts[b];vid=p.id.substring(4);cN=p.className.replace(/lyte/,"")+" lP";p.className=cN;pW=p.clientWidth;pH=p.clientHeight;pl=d.createElement("div");p.appendChild(pl);p.onclick=plaYT;pl.id="lyte_"+vid;pl.className="pL";bgA="-60px";if(cN.indexOf("widget")!==-1||pW/pH<1.7)bgA="-10px";qsa=getQ(p);if(cN.indexOf("audio")!==-1){setST(pl,"height:"+pH+"px;width:"+pW);pl.innerHTML='<img src="'+bU+"controls-"+pW+'.png" class="ctrl" alt="" style="max-width:'+pW+'px;"/>'}else if(cN.indexOf("playlist")!==-1){setST(pl,"height:"+pH+"px;width:"+pW+"px;");pl.innerHTML='<img src="'+bU+'play.png" alt="Click to play this playlist" style="margin-top:'+(pH/2-30)+'px;opacity:0.7;" onmouseover="this.style.opacity=1;" onmouseout="this.style.opacity=0.8;"/><img src="'+bU+"controls-"+pW+'.png" width="100%" class="ctrl" alt="" style="max-width:'+pW+'px;"/>';joU=sch+"://gdata.youtube.com/feeds/api/playlists/"+vid+"?v=2&alt=json-in-script&callback=parsePL&fields=id,title,entry";loadSC(joU)}else{setST(pl,"height:"+pH+"px;width:"+pW+"px;background:url('"+sch+"://img.youtube.com/vi/"+vid+"/0.jpg') no-repeat scroll center "+bgA+" rgb(0, 0, 0);background-size:cover;");pl.innerHTML='<img src="'+bU+'play.png" alt="Click to play this video" style="margin-top:'+(pH/2-30)+'px;opacity:0.7;" onmouseover="this.style.opacity=1;" onmouseout="this.style.opacity=0.8;"/><img src="'+bU+"controls-"+pW+'.png" width="100%" class="ctrl" alt="" style="max-width:'+pW+'px;"/>';if(cN.indexOf("widget")===-1&&qsa.indexOf("showinfo=0")===-1){joU=sch+"://gdata.youtube.com/feeds/api/videos/"+vid+"?fields=id,title&alt=json-in-script&callback=parseV";loadSC(joU)}}}}var a=""}var d=document;sch="http";if(bU.indexOf("https")!=-1){sch+="s"}var getElementsByClassName=function(a,b,c){if(d.getElementsByClassName){getElementsByClassName=function(a,b,c){c=c||d;var e=c.getElementsByClassName(a),f=b?new RegExp("\\b"+b+"\\b","i"):null,g=[],h;for(var i=0,j=e.length;i<j;i+=1){h=e[i];if(!f||f.test(h.nodeName)){g.push(h)}}return g}}else if(d.evaluate){getElementsByClassName=function(a,b,c){b=b||"*";c=c||d;var e=a.split(" "),f="",g="http://www.w3.org/1999/xhtml",h=d.documentElement.namespaceURI===g?g:null,i=[],j,k;for(var l=0,m=e.length;l<m;l+=1){f+="[contains(concat(' ', @class, ' '), ' "+e[l]+" ')]"}try{j=d.evaluate(".//"+b+f,c,h,0,null)}catch(n){j=d.evaluate(".//"+b+f,c,null,0,null)}while(k=j.iterateNext()){i.push(k)}return i}}else{getElementsByClassName=function(a,b,c){b=b||"*";c=c||d;var e=a.split(" "),f=[],g=b==="*"&&c.all?c.all:c.getElementsByTagName(b),h,i=[],j;for(var k=0,l=e.length;k<l;k+=1){f.push(new RegExp("(^|\\s)"+e[k]+"(\\s|$)"))}for(var m=0,n=g.length;m<n;m+=1){h=g[m];j=false;for(var o=0,p=f.length;o<p;o+=1){j=f[o].test(h.className);if(!j){break}}if(j){i.push(h)}}return i}}return getElementsByClassName(a,b,c)};lyte()
|
lyte/lyte.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.lyte img {border:0px;padding:0px;spacing:0px;margin:0px;display:inline;background-color:transparent;} .lL {margin:0px 0px 10px 0px;} .lyte {margin:5px 0px;} .lP {background-color:#fff;} .pL {cursor:pointer;text-align:center;overflow:hidden;position:relative;margin:0px;} .tC {position:
|
1 |
+
.lyte img {border:0px !important;padding:0px;spacing:0px;margin:0px;display:inline;background-color:transparent;} .lL {margin:0px 0px 10px 0px;} .lyte {margin:5px 0px;} .lP {background-color:#fff;} .pL {cursor:pointer;text-align:center;overflow:hidden;position:relative;margin:0px;} .tC {left:0;top:0;position:absolute;width:100%;background-color:rgba(0,0,0,0.6);} .tT {padding:5px 10px;font-weight:bold;font-size:16px;color:#ffffff;font-family:sans-serif;text-align:left;} .ctrl {position:absolute;left:0px;bottom:0px;}
|
lyte/lyte.js
CHANGED
@@ -1,62 +1,54 @@
|
|
1 |
var d = document;
|
2 |
-
var cI = 'lcss';
|
3 |
-
var w = window;
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
var bU = myUrl.substring(0,myUrl.lastIndexOf('/')+1);
|
8 |
-
|
9 |
-
scheme="http";
|
10 |
-
if (myUrl.indexOf('https')!=-1) {scheme+="s";}
|
11 |
-
|
12 |
-
if (!d.getElementById(cI)) {
|
13 |
-
lk = d.createElement('link');
|
14 |
-
lk.id = cI;
|
15 |
-
lk.rel = 'stylesheet';
|
16 |
-
lk.type = 'text/css';
|
17 |
-
lk.href = bU + 'lyte.css';
|
18 |
-
d.getElementsByTagName('head')[0].appendChild(lk);
|
19 |
-
}
|
20 |
|
21 |
function lyte() {
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
|
|
55 |
}
|
56 |
|
57 |
-
function getQ(
|
58 |
qsa="";
|
59 |
-
if (
|
60 |
return qsa;
|
61 |
}
|
62 |
|
@@ -72,14 +64,18 @@ function plaYT() {
|
|
72 |
}
|
73 |
|
74 |
if (tH.className.indexOf("playlist") === -1) {
|
75 |
-
eU=
|
76 |
} else {
|
77 |
-
eU=
|
78 |
}
|
79 |
|
80 |
-
qsa=getQ(
|
|
|
|
|
81 |
|
82 |
-
tH.innerHTML="<iframe
|
|
|
|
|
83 |
}
|
84 |
|
85 |
function parseV(r) {
|
@@ -98,22 +94,22 @@ function parsePL(r) {
|
|
98 |
pH=pl.style.height;
|
99 |
pW=pl.style.width;
|
100 |
|
101 |
-
if ((
|
102 |
|
103 |
-
setST(pl, "height:" + pH + ";width:" + pW + ";background:url('" + thumb + "') no-repeat scroll center -
|
104 |
drawT(id,title)
|
105 |
}
|
106 |
|
|
|
107 |
function drawT(id,tI) {
|
108 |
p = d.getElementById(id);
|
109 |
c = d.createElement('div');
|
110 |
c.className = "tC";
|
111 |
-
p.appendChild(c);
|
112 |
-
setST(c, "margin:-" + ((p.clientHeight / 2) + 15) + "px 5px;");
|
113 |
t = d.createElement('div');
|
114 |
t.className = "tT";
|
115 |
c.appendChild(t);
|
116 |
t.innerHTML = tI;
|
|
|
117 |
}
|
118 |
|
119 |
function setST(e, s) {
|
@@ -127,7 +123,6 @@ function loadSC(url) {
|
|
127 |
scr.type = 'text/javascript';
|
128 |
d.getElementsByTagName('head')[0].appendChild(scr)
|
129 |
}
|
130 |
-
|
131 |
var getElementsByClassName = function (className, tag, elm) {
|
132 |
if (d.getElementsByClassName) {
|
133 |
getElementsByClassName = function (className, tag, elm) {
|
@@ -197,4 +192,5 @@ var getElementsByClassName = function (className, tag, elm) {
|
|
197 |
}
|
198 |
return getElementsByClassName(className, tag, elm)
|
199 |
};
|
|
|
200 |
lyte();
|
1 |
var d = document;
|
|
|
|
|
2 |
|
3 |
+
sch="http";
|
4 |
+
if (bU.indexOf('https')!=-1) {sch+="s"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
function lyte() {
|
7 |
+
if (!rn) {
|
8 |
+
var rn=1;
|
9 |
+
lts = getElementsByClassName("lyte", "div");
|
10 |
+
for (var i = 0, lln = lts.length; i < lln; i += 1) {
|
11 |
+
p = lts[i];
|
12 |
+
vid = p.id.substring(4);
|
13 |
+
cN = p.className.replace(/lyte/, "")+ " lP";
|
14 |
+
p.className=cN;
|
15 |
+
pW = p.clientWidth;
|
16 |
+
pH = p.clientHeight;
|
17 |
+
pl = d.createElement('div');
|
18 |
+
p.appendChild(pl);
|
19 |
+
p.onclick = plaYT;
|
20 |
+
pl.id = "lyte_" + vid;
|
21 |
+
pl.className = "pL";
|
22 |
+
|
23 |
+
bgA="-60px";
|
24 |
+
if ((cN.indexOf('widget') !== -1)||(pW/pH<1.7)) bgA="-10px";
|
25 |
+
|
26 |
+
qsa=getQ(p);
|
27 |
+
|
28 |
+
if (cN.indexOf('audio') !== -1) {
|
29 |
+
setST(pl, 'height:' + pH + 'px;width:' + pW);
|
30 |
+
pl.innerHTML = "<img src=\"" + bU + "controls-" + pW + ".png\" class=\"ctrl\" alt=\"\" style=\"max-width:" + pW + "px;\"/>";
|
31 |
+
} else if (cN.indexOf('playlist') !== -1) {
|
32 |
+
setST(pl, 'height:' + pH + 'px;width:' + pW + 'px;');
|
33 |
+
pl.innerHTML = "<img src=\"" + bU + "play.png\" alt=\"Click to play this playlist\" style=\"margin-top:" + ((pH / 2) - 30) + "px;opacity:0.7;\" onmouseover=\"this.style.opacity=1;\" onmouseout=\"this.style.opacity=0.8;\"/><img src=\"" + bU + "controls-" + pW + ".png\" width=\"100%\" class=\"ctrl\" alt=\"\" style=\"max-width:" + pW + "px;\"/>";
|
34 |
+
joU = sch+"://gdata.youtube.com/feeds/api/playlists/"+ vid +"?v=2&alt=json-in-script&callback=parsePL&fields=id,title,entry";
|
35 |
+
loadSC(joU);
|
36 |
+
} else {
|
37 |
+
setST(pl, "height:" + pH + "px;width:" + pW + "px;background:url('" + sch + "://img.youtube.com/vi/" + vid + "/0.jpg') no-repeat scroll center " + bgA + " rgb(0, 0, 0);background-size:cover;");
|
38 |
+
pl.innerHTML = "<img src=\"" + bU + "play.png\" alt=\"Click to play this video\" style=\"margin-top:" + ((pH / 2) - 30) + "px;opacity:0.7;\" onmouseover=\"this.style.opacity=1;\" onmouseout=\"this.style.opacity=0.8;\"/><img src=\"" + bU + "controls-" + pW + ".png\" width=\"100%\" class=\"ctrl\" alt=\"\" style=\"max-width:" + pW + "px;\"/>";
|
39 |
+
if ((cN.indexOf('widget') === -1) && (qsa.indexOf('showinfo=0') === -1)) {
|
40 |
+
joU = sch+"://gdata.youtube.com/feeds/api/videos/" + vid + "?fields=id,title&alt=json-in-script&callback=parseV";
|
41 |
+
loadSC(joU)
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
45 |
}
|
46 |
+
var rn="";
|
47 |
}
|
48 |
|
49 |
+
function getQ(nD) {
|
50 |
qsa="";
|
51 |
+
if (rqs=nD.className.match(/qsa_(.*)\s/,"$1")) qsa=rqs[1].replace(/\\([\&\=\?])/g, "$1");
|
52 |
return qsa;
|
53 |
}
|
54 |
|
64 |
}
|
65 |
|
66 |
if (tH.className.indexOf("playlist") === -1) {
|
67 |
+
eU=sch+"://www.youtube.com/embed/" + vid
|
68 |
} else {
|
69 |
+
eU=sch+"://www.youtube.com/embed/p/" + vid
|
70 |
}
|
71 |
|
72 |
+
qsa=getQ(tH);
|
73 |
+
|
74 |
+
if (tH.className.indexOf("audio") !== -1) { qsa+="&autohide=0"; }
|
75 |
|
76 |
+
tH.innerHTML="<iframe id=\"iF_" + vid + "\" width=\"" + tH.clientWidth + "\" height=\"" + tH.clientHeight + "\" src=\""+eU+"?autoplay=1&wmode=opaque&rel=0&egm=0&iv_load_policy=3&hd="+hidef+qsa+"\" frameborder=\"0\"></iframe>"
|
77 |
+
|
78 |
+
if(typeof tH.firstChild.getAttribute('kabl')=="string") tH.innerHTML="Please check Karma Blocker's config.";
|
79 |
}
|
80 |
|
81 |
function parseV(r) {
|
94 |
pH=pl.style.height;
|
95 |
pW=pl.style.width;
|
96 |
|
97 |
+
if ((sch=="https")&&(thumb.indexOf('https'==-1))) {thumb=thumb.replace("http://","https://");}
|
98 |
|
99 |
+
setST(pl, "height:" + pH + ";width:" + pW + ";background:url('" + thumb + "') no-repeat scroll center -50px rgb(0, 0, 0); background-size:cover;")
|
100 |
drawT(id,title)
|
101 |
}
|
102 |
|
103 |
+
|
104 |
function drawT(id,tI) {
|
105 |
p = d.getElementById(id);
|
106 |
c = d.createElement('div');
|
107 |
c.className = "tC";
|
|
|
|
|
108 |
t = d.createElement('div');
|
109 |
t.className = "tT";
|
110 |
c.appendChild(t);
|
111 |
t.innerHTML = tI;
|
112 |
+
p.appendChild(c);
|
113 |
}
|
114 |
|
115 |
function setST(e, s) {
|
123 |
scr.type = 'text/javascript';
|
124 |
d.getElementsByTagName('head')[0].appendChild(scr)
|
125 |
}
|
|
|
126 |
var getElementsByClassName = function (className, tag, elm) {
|
127 |
if (d.getElementsByClassName) {
|
128 |
getElementsByClassName = function (className, tag, elm) {
|
192 |
}
|
193 |
return getElementsByClassName(className, tag, elm)
|
194 |
};
|
195 |
+
|
196 |
lyte();
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: futtta
|
|
3 |
Tags: youtube, video, lyte, lite youtube embeds, html5 video, html5, widget, youtube audio, audio, playlist, youtube playlist, hd, performance, accessibility, sidebar, lazy load
|
4 |
Requires at least: 2.9
|
5 |
Tested up to: 3.3
|
6 |
-
Stable tag: 1.
|
7 |
|
8 |
-
|
9 |
|
10 |
== Description ==
|
11 |
|
@@ -18,8 +18,9 @@ Just add a YouTube-link for a video or [an entire playlist](http://blog.futtta.b
|
|
18 |
* httpa://www.youtube.com/watch?v=_SQkWbRublY (audio only embed)
|
19 |
* httpv://www.youtube.com/playlist?list=PLA486E741B25F8E00 (playlist embed)
|
20 |
* httpv://www.youtube.com/watch?v=_SQkWbRublY#stepSize=-1 (video player, one size smaller than what's configured as default)
|
|
|
21 |
|
22 |
-
WP YouTube Lyte has been written with optimal performance as primary goal, but has been tested for maximum browser-compatibility (iPad included) while keeping an eye on accessibility. The plugin is fully multi-language, with support for Catalan, Dutch, English, French, German, Hebrew, Spanish and Slovene.
|
23 |
|
24 |
Feedback is welcome; see [info in the faq](http://wordpress.org/extend/plugins/wp-youtube-lyte/faq/) for bug reports/ feature requests and feel free to [rate and/or report on compatibility on wordpress.org](http://wordpress.org/extend/plugins/wp-youtube-lyte/).
|
25 |
|
@@ -54,26 +55,41 @@ As tested and confirmed by [rumultik.ru's Dimitri](http://rumultik.ru) (thanks f
|
|
54 |
`if(function_exists('lyte_parse')) { echo lyte_parse($video); }`
|
55 |
and you're good to go!
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
= Any bugs/ issues should I know about? =
|
58 |
* The playlist-player currently does not work on iPad or iPhone, this is a known limitation of Youtube's playlist player and [is on the todo-list to get fixed](http://groups.google.com/group/youtube-api-gdata/browse_frm/thread/adbec924f43688e5#)
|
59 |
* The new YouTube embed-code doesn't look great when using WP YouTube Lyte widgets in your sidebar. This is because YouTube's embedded player doesn't scale well for small sizes, this is something that YouTube should (and hopefully will) fix at a later stage.
|
60 |
* Having the same YouTube-video on one page can cause WP YouTube Lyte to malfunction (as the YouTube id is used as the div's id in the DOM, and DOM id's are supposed to be unique)
|
61 |
* As youtube-nocookie.com does not serve the HTML5-player, WP YouTube Lyte uses the youtube.com domain (which provides less privacy), but as soon as youtube-nocookie.com serves HTML5-video, this will become the default domain for WP YouTube Lyte again.
|
|
|
62 |
|
63 |
= I found a bug/ I would like a feature to be added! =
|
64 |
-
|
65 |
|
66 |
= How you can help =
|
67 |
* Tell me about bugs you think you've found and if you can't find any, [confirm it works with your version of WP on wordpress.org](http://wordpress.org/extend/plugins/wp-youtube-lyte/)
|
68 |
* Ask me for a feature you would like to see added
|
69 |
* [Rate my plugin on wordpress.org](http://wordpress.org/extend/plugins/wp-youtube-lyte/), even if you think it stinks ;-)
|
70 |
|
71 |
-
== Screenshots ==
|
72 |
-
|
73 |
-
1. This is the administration-page of WP YouTube Lyte.
|
74 |
-
|
75 |
== Changelog ==
|
76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
= 1.0.0 =
|
78 |
* new: also works on (manual) excerpts; just add a httpv link to the "excerpt" field on the post/page admin (based on feedback from [Ruben@tuttingegneri](http://www.tuttingegneri.com))
|
79 |
* new: if youtube-url contains "start" or "showinfo" parameters, these are used when playing the actual video. This means that you can now jump to a specific time in the YouTube video or stop the title/ author from being displayed (based on feedback from a.o. Miguel and Josh D)
|
@@ -173,7 +189,7 @@ and you're good to go!
|
|
173 |
|
174 |
= 0.6.0 =
|
175 |
* There now is a WP-YouTube-Lyte widget which you can add to your sidebar (see under "Appearance"->"Widgets"), as requested by the fabulous [fruityoaty](http://fruityoaty.com/)
|
176 |
-
* The thumbnail is now stretched to use as much of the player as possible (thanks to css3's background-size:contain directive, which works in [all bleeding edge browsers](
|
177 |
* Updated the "play"-button to fit the new YouTube style
|
178 |
|
179 |
= 0.5.3 =
|
@@ -250,8 +266,3 @@ Accessibility enhancements (hat tip: Ricky Buchanan):
|
|
250 |
|
251 |
= 0.1 =
|
252 |
* Initial version
|
253 |
-
|
254 |
-
== Upgrade Notice ==
|
255 |
-
|
256 |
-
= 0.9.3 =
|
257 |
-
Bugfix release, especially important if you've activated DoNotTrack or if you use widgets.
|
3 |
Tags: youtube, video, lyte, lite youtube embeds, html5 video, html5, widget, youtube audio, audio, playlist, youtube playlist, hd, performance, accessibility, sidebar, lazy load
|
4 |
Requires at least: 2.9
|
5 |
Tested up to: 3.3
|
6 |
+
Stable tag: 1.1.0
|
7 |
|
8 |
+
High performance YouTube video, playlist and audio-only embeds which don't slow down your blog and offer optimal accessibility.
|
9 |
|
10 |
== Description ==
|
11 |
|
18 |
* httpa://www.youtube.com/watch?v=_SQkWbRublY (audio only embed)
|
19 |
* httpv://www.youtube.com/playlist?list=PLA486E741B25F8E00 (playlist embed)
|
20 |
* httpv://www.youtube.com/watch?v=_SQkWbRublY#stepSize=-1 (video player, one size smaller than what's configured as default)
|
21 |
+
* httpv://www.youtube.com/watch?v=_SQkWbRublY?start=20&showinfo=0 (video player, start playing at 20 seconds and don't show title)
|
22 |
|
23 |
+
WP YouTube Lyte has been written with optimal performance as primary goal, but has been tested for maximum browser-compatibility (iPad included) while keeping an eye on accessibility. The plugin is fully multi-language, with support for Catalan, Dutch, English, French, German, Hebrew, Romanian, Spanish and Slovene.
|
24 |
|
25 |
Feedback is welcome; see [info in the faq](http://wordpress.org/extend/plugins/wp-youtube-lyte/faq/) for bug reports/ feature requests and feel free to [rate and/or report on compatibility on wordpress.org](http://wordpress.org/extend/plugins/wp-youtube-lyte/).
|
26 |
|
55 |
`if(function_exists('lyte_parse')) { echo lyte_parse($video); }`
|
56 |
and you're good to go!
|
57 |
|
58 |
+
= Does WP YouTube Lyte work with Infinite Scroll? =
|
59 |
+
Starting from version 1.1.0 it does; in [Infinite Scroll](http://wordpress.org/extend/plugins/infinite-scroll/)'s configuration you just have to add "lyte()" in the "Javascript to be called after the next posts are fetched"-box.
|
60 |
+
|
61 |
+
= Can I still integrate with YouTube's JS API? =
|
62 |
+
This was added as a beta feature in version 1.1.0; add ?enablejsapi=1 to the httpv URL. WP YouTube Lyte will pick this up, and add ?enablejsapi=1&origin=<hostname-of-blog> to the URL of the iFrame with the iFrame id being set to iF_<youtube-video-id>. As soon as your visitors plays the video, you should be able to hook up with the video.
|
63 |
+
|
64 |
= Any bugs/ issues should I know about? =
|
65 |
* The playlist-player currently does not work on iPad or iPhone, this is a known limitation of Youtube's playlist player and [is on the todo-list to get fixed](http://groups.google.com/group/youtube-api-gdata/browse_frm/thread/adbec924f43688e5#)
|
66 |
* The new YouTube embed-code doesn't look great when using WP YouTube Lyte widgets in your sidebar. This is because YouTube's embedded player doesn't scale well for small sizes, this is something that YouTube should (and hopefully will) fix at a later stage.
|
67 |
* Having the same YouTube-video on one page can cause WP YouTube Lyte to malfunction (as the YouTube id is used as the div's id in the DOM, and DOM id's are supposed to be unique)
|
68 |
* As youtube-nocookie.com does not serve the HTML5-player, WP YouTube Lyte uses the youtube.com domain (which provides less privacy), but as soon as youtube-nocookie.com serves HTML5-video, this will become the default domain for WP YouTube Lyte again.
|
69 |
+
* When using the Firefox plugin Karma Blocker, the [video isn't visible when clicking "play", with a warning message being shown instead](http://blog.futtta.be/?p=7584). This is expected behavior and should be solved by tweaking Karma Blocker's configuration.
|
70 |
|
71 |
= I found a bug/ I would like a feature to be added! =
|
72 |
+
Just tell me, I like the feedback! Use the [Contact-page on my blog](http://blog.futtta.be/contact/), [leave a comment in a post about wp-youtube-lyte](http://blog.futtta.be/tag/wp-youtube-lyte/) or [create a new topic on the wordpress.org forum](http://wordpress.org/tags/wp-youtube-lyte?forum_id=10#postform).
|
73 |
|
74 |
= How you can help =
|
75 |
* Tell me about bugs you think you've found and if you can't find any, [confirm it works with your version of WP on wordpress.org](http://wordpress.org/extend/plugins/wp-youtube-lyte/)
|
76 |
* Ask me for a feature you would like to see added
|
77 |
* [Rate my plugin on wordpress.org](http://wordpress.org/extend/plugins/wp-youtube-lyte/), even if you think it stinks ;-)
|
78 |
|
|
|
|
|
|
|
|
|
79 |
== Changelog ==
|
80 |
|
81 |
+
= 1.1.0 =
|
82 |
+
* updated LYTE-player UI: larger display of preview image, changed look of title placeholder, updated controls image
|
83 |
+
* new: added support for "Infinite Scroll" as proposed by ["der Tuxman"](http://tuxproject.de/blog) and [Olivier](http://www.wwebsolution.com/hemisphere)
|
84 |
+
* new: added beta-support for YouTube's JS API as requested by Yun
|
85 |
+
* performance: remove double DOM-lookups in javascript, hat tip Yun
|
86 |
+
* annoyance-avoidance: check for "Karma Blocker" addon and warn, based on feedback from [Leona](http://www.tinuum.net/)
|
87 |
+
* translation: added Romanian, thanks to Alexander and [Web Hosting Geeks](http://webhostinggeeks.com/)
|
88 |
+
* bugfix: 2nd video with start or showinfo parameters inherited the ones from the 1st one as well as reported by Josh D
|
89 |
+
* bugfix: marked lyte img border css as !important
|
90 |
+
* bugfix: moved inline javascript (for each lyte-div) to the footer of the page to solve conflict with some jQuery plugins in MSIE as reported by Yun
|
91 |
+
* bugfix: set autohide to false for audio-only embeds
|
92 |
+
|
93 |
= 1.0.0 =
|
94 |
* new: also works on (manual) excerpts; just add a httpv link to the "excerpt" field on the post/page admin (based on feedback from [Ruben@tuttingegneri](http://www.tuttingegneri.com))
|
95 |
* new: if youtube-url contains "start" or "showinfo" parameters, these are used when playing the actual video. This means that you can now jump to a specific time in the YouTube video or stop the title/ author from being displayed (based on feedback from a.o. Miguel and Josh D)
|
189 |
|
190 |
= 0.6.0 =
|
191 |
* There now is a WP-YouTube-Lyte widget which you can add to your sidebar (see under "Appearance"->"Widgets"), as requested by the fabulous [fruityoaty](http://fruityoaty.com/)
|
192 |
+
* The thumbnail is now stretched to use as much of the player as possible (thanks to css3's background-size:contain directive, which works in [all bleeding edge browsers](https://developer.mozilla.org/en/CSS/background-size#Browser_compatibility))
|
193 |
* Updated the "play"-button to fit the new YouTube style
|
194 |
|
195 |
= 0.5.3 =
|
266 |
|
267 |
= 0.1 =
|
268 |
* Initial version
|
|
|
|
|
|
|
|
|
|
widget.php
CHANGED
@@ -8,7 +8,7 @@ class WYLWidget extends WP_Widget {
|
|
8 |
|
9 |
function widget($args, $instance) {
|
10 |
extract( $args );
|
11 |
-
global $wSize, $wyl_version, $wp_lyte_plugin_url;
|
12 |
$qsa="";
|
13 |
|
14 |
$WYLtitle = apply_filters('widget_title', $instance['WYLtitle']);
|
@@ -31,14 +31,19 @@ class WYLWidget extends WP_Widget {
|
|
31 |
$WYLid=$WYLarr['v'];
|
32 |
}
|
33 |
|
34 |
-
if (isset($WYLarr['
|
35 |
-
if (isset($WYLarr['
|
|
|
|
|
|
|
|
|
36 |
|
37 |
if (!empty($qsa)) {
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
42 |
|
43 |
$WYLid="YLW_".$WYLid;
|
44 |
|
@@ -47,12 +52,11 @@ class WYLWidget extends WP_Widget {
|
|
47 |
|
48 |
<?php echo $before_widget; ?>
|
49 |
<?php if ( $WYLtitle ) echo $before_title . $WYLtitle . $after_title; ?>
|
50 |
-
<div class="lyte widget <?php echo $WYLaudio; ?>" id="<?php echo $WYLid; ?>" style="width:<?php echo $wSize[$WYLsize]['w']; ?>px;height:<?php if($WYLaudio==="audio") {echo "25";} else {echo $wSize[$WYLsize]['h'];} ?>px;"><noscript><a href="http://youtu.be/<?php echo $WYLid;?>"><img src="http://img.youtube.com/vi/<?php echo $WYLid; ?>/default.jpg" alt="" /></a></noscript
|
51 |
-
(function(){ var w=window;d=document;if(d.addEventListener){d.addEventListener('DOMContentLoaded', insert, false)}else{w.onload=insert} function insert(){if(!d.getElementById('lytescr')){lytescr=d.createElement('script');lytescr.async=true;lytescr.id='lytescr';lytescr.src='<?php echo $lyteSettings['path']."lyte-min.js?wylver=".$wyl_version;?>';h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(lytescr, h)}<?php echo $qsa_init; ?>}; }())
|
52 |
-
--></script></div>
|
53 |
<div><?php echo $WYLtext ?></div>
|
54 |
<?php echo $after_widget; ?>
|
55 |
<?php
|
|
|
56 |
}
|
57 |
|
58 |
function update($new_instance, $old_instance) {
|
8 |
|
9 |
function widget($args, $instance) {
|
10 |
extract( $args );
|
11 |
+
global $wSize, $wyl_version, $wp_lyte_plugin_url, $lyteSettings;
|
12 |
$qsa="";
|
13 |
|
14 |
$WYLtitle = apply_filters('widget_title', $instance['WYLtitle']);
|
31 |
$WYLid=$WYLarr['v'];
|
32 |
}
|
33 |
|
34 |
+
if (isset($WYLarr['start'])) $qsa="&start=".$WYLarr['start'];
|
35 |
+
if (isset($WYLarr['enablejsapi'])) {
|
36 |
+
$urlArr=parse_url($lyteSettings['path']);
|
37 |
+
$origin=$urlArr[scheme]."://".$urlArr[host]."/";
|
38 |
+
$qsa.="&enablejsapi=".$WYLarr['enablejsapi']."&origin=".$origin;
|
39 |
+
}
|
40 |
|
41 |
if (!empty($qsa)) {
|
42 |
+
$esc_arr=array("&" => "\&", "?" => "\?", "=" => "\=");
|
43 |
+
$qsaClass=" qsa_".strtr($qsa,$esc_arr);
|
44 |
+
} else {
|
45 |
+
$qsaClass="";
|
46 |
+
}
|
47 |
|
48 |
$WYLid="YLW_".$WYLid;
|
49 |
|
52 |
|
53 |
<?php echo $before_widget; ?>
|
54 |
<?php if ( $WYLtitle ) echo $before_title . $WYLtitle . $after_title; ?>
|
55 |
+
<div class="lyte widget <?php echo $WYLaudio; ?> <?php echo $qsaClass; ?>" id="<?php echo $WYLid; ?>" style="width:<?php echo $wSize[$WYLsize]['w']; ?>px;height:<?php if($WYLaudio==="audio") {echo "25";} else {echo $wSize[$WYLsize]['h'];} ?>px;"><noscript><a href="http://youtu.be/<?php echo $WYLid;?>"><img src="http://img.youtube.com/vi/<?php echo $WYLid; ?>/default.jpg" alt="" /></a></noscript></div>
|
|
|
|
|
56 |
<div><?php echo $WYLtext ?></div>
|
57 |
<?php echo $after_widget; ?>
|
58 |
<?php
|
59 |
+
lyte_initer();
|
60 |
}
|
61 |
|
62 |
function update($new_instance, $old_instance) {
|
wp-youtube-lyte.php
CHANGED
@@ -4,13 +4,13 @@ Plugin Name: WP YouTube Lyte
|
|
4 |
Plugin URI: http://blog.futtta.be/wp-youtube-lyte/
|
5 |
Description: Lite and accessible YouTube audio and video embedding.
|
6 |
Author: Frank Goossens (futtta)
|
7 |
-
Version: 1.
|
8 |
Author URI: http://blog.futtta.be/
|
9 |
Text Domain: wp-youtube-lyte
|
10 |
Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
-
$wyl_version="1.
|
14 |
|
15 |
$plugin_dir = basename(dirname(__FILE__)).'/languages';
|
16 |
load_plugin_textdomain( 'wp-youtube-lyte', null, $plugin_dir );
|
@@ -41,6 +41,9 @@ $lyteSettings['version']=$wyl_version;
|
|
41 |
function lyte_parse($the_content) {
|
42 |
global $lyteSettings;
|
43 |
|
|
|
|
|
|
|
44 |
if((strpos($the_content, "httpv")!==FALSE)||(strpos($the_content, "httpa")!==FALSE)) {
|
45 |
$char_codes = array('×','–');
|
46 |
$replacements = array("x", "--");
|
@@ -64,9 +67,19 @@ function lyte_parse($the_content) {
|
|
64 |
preg_match("/stepSize\=([\+\-0-9]{2})/",$match[12],$sMatch);
|
65 |
preg_match("/showinfo\=([0-1]{1})/",$match[12],$showinfo);
|
66 |
preg_match("/start\=([0-9]*)/",$match[12],$start);
|
|
|
67 |
|
|
|
68 |
if ($showinfo[0]) $qsa="&".$showinfo[0];
|
69 |
if ($start[0]) $qsa.="&".$start[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
if (!empty($sMatch)) {
|
72 |
$newSize=(int) $sMatch[1];
|
@@ -88,7 +101,7 @@ function lyte_parse($the_content) {
|
|
88 |
$audioClass="";
|
89 |
} else {
|
90 |
$audioClass=" audio";
|
91 |
-
$divHeight=
|
92 |
}
|
93 |
|
94 |
$NSimgHeight=$divHeight-20;
|
@@ -127,19 +140,28 @@ function lyte_parse($the_content) {
|
|
127 |
$noscript="<noscript><a href=\"".$scheme."://youtu.be/".$vid."\"><img src=\"".$scheme."://img.youtube.com/vi/".$vid."/0.jpg\" alt=\"\" width=\"".$lyteSettings[2]."\" height=\"".$NSimgHeight."\" />".$noscript_post."</a> ".$NSbanner."</noscript>";
|
128 |
}
|
129 |
|
130 |
-
|
131 |
-
$qsa_init="w.lst=w.lst||{};w.lst[\"".$vid."\"]=\"".$qsa."\"";
|
132 |
-
} else {
|
133 |
-
$qsa_init="";
|
134 |
-
}
|
135 |
-
|
136 |
-
$lytetemplate = "<div class=\"lyte".$audioClass.$hidefClass.$plClass."\" id=\"WYL_".$vid."\" style=\"width:".$lyteSettings[2]."px;height:".$divHeight."px;\">".$noscript."<script type=\"text/javascript\"><!-- \n (function(){var d=document;var w=window;if(w.addEventListener){w.addEventListener('load', insert, false)}else{w.onload=insert};setTimeout(insert, 1000);function insert(){if(!d.getElementById('lytescr')){lytescr=d.createElement('script');lytescr.async=true;lytescr.id='lytescr';lytescr.src='".$lyteSettings['path']."lyte-min.js?wylver=".$lyteSettings['version']."';h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(lytescr, h)}};".$qsa_init."}()) \n --></script></div>".$lytelinks_txt;
|
137 |
$the_content = preg_replace("/(<p>)?http(v|a):\/\/([a-zA-Z0-9\-\_]+\.|)(youtube|youtu)(\.com|\.be)\/(((watch(\?v\=|\/v\/)|)([a-zA-Z0-9\-\_]{11}))|(playlist\?list\=PL([a-zA-Z0-9\-\_]{16})))([^\s<]*)(<\/p>)?/", $lytetemplate, $the_content, 1);
|
138 |
}
|
139 |
-
|
|
|
140 |
return $the_content;
|
141 |
}
|
142 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
if ( is_admin() ) {
|
144 |
require_once(dirname(__FILE__).'/options.php');
|
145 |
} else {
|
4 |
Plugin URI: http://blog.futtta.be/wp-youtube-lyte/
|
5 |
Description: Lite and accessible YouTube audio and video embedding.
|
6 |
Author: Frank Goossens (futtta)
|
7 |
+
Version: 1.1.0
|
8 |
Author URI: http://blog.futtta.be/
|
9 |
Text Domain: wp-youtube-lyte
|
10 |
Domain Path: /languages
|
11 |
*/
|
12 |
|
13 |
+
$wyl_version="1.1.0";
|
14 |
|
15 |
$plugin_dir = basename(dirname(__FILE__)).'/languages';
|
16 |
load_plugin_textdomain( 'wp-youtube-lyte', null, $plugin_dir );
|
41 |
function lyte_parse($the_content) {
|
42 |
global $lyteSettings;
|
43 |
|
44 |
+
$urlArr=parse_url($lyteSettings['path']);
|
45 |
+
$origin=$urlArr[scheme]."://".$urlArr[host]."/";
|
46 |
+
|
47 |
if((strpos($the_content, "httpv")!==FALSE)||(strpos($the_content, "httpa")!==FALSE)) {
|
48 |
$char_codes = array('×','–');
|
49 |
$replacements = array("x", "--");
|
67 |
preg_match("/stepSize\=([\+\-0-9]{2})/",$match[12],$sMatch);
|
68 |
preg_match("/showinfo\=([0-1]{1})/",$match[12],$showinfo);
|
69 |
preg_match("/start\=([0-9]*)/",$match[12],$start);
|
70 |
+
preg_match("/enablejsapi\=([0-1]{1})/",$match[12],$jsapi);
|
71 |
|
72 |
+
$qsa="";
|
73 |
if ($showinfo[0]) $qsa="&".$showinfo[0];
|
74 |
if ($start[0]) $qsa.="&".$start[0];
|
75 |
+
if ($jsapi[0]) $qsa.="&".$jsapi[0]."&origin=".$origin;
|
76 |
+
|
77 |
+
if (!empty($qsa)) {
|
78 |
+
$esc_arr=array("&" => "\&", "?" => "\?", "=" => "\=");
|
79 |
+
$qsaClass=" qsa_".strtr($qsa,$esc_arr);
|
80 |
+
} else {
|
81 |
+
$qsaClass="";
|
82 |
+
}
|
83 |
|
84 |
if (!empty($sMatch)) {
|
85 |
$newSize=(int) $sMatch[1];
|
101 |
$audioClass="";
|
102 |
} else {
|
103 |
$audioClass=" audio";
|
104 |
+
$divHeight=38;
|
105 |
}
|
106 |
|
107 |
$NSimgHeight=$divHeight-20;
|
140 |
$noscript="<noscript><a href=\"".$scheme."://youtu.be/".$vid."\"><img src=\"".$scheme."://img.youtube.com/vi/".$vid."/0.jpg\" alt=\"\" width=\"".$lyteSettings[2]."\" height=\"".$NSimgHeight."\" />".$noscript_post."</a> ".$NSbanner."</noscript>";
|
141 |
}
|
142 |
|
143 |
+
$lytetemplate = "<div class=\"lyte".$audioClass.$hidefClass.$plClass.$qsaClass."\" id=\"WYL_".$vid."\" style=\"width:".$lyteSettings[2]."px;height:".$divHeight."px;\">".$noscript."</div>".$lytelinks_txt;
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
$the_content = preg_replace("/(<p>)?http(v|a):\/\/([a-zA-Z0-9\-\_]+\.|)(youtube|youtu)(\.com|\.be)\/(((watch(\?v\=|\/v\/)|)([a-zA-Z0-9\-\_]{11}))|(playlist\?list\=PL([a-zA-Z0-9\-\_]{16})))([^\s<]*)(<\/p>)?/", $lytetemplate, $the_content, 1);
|
145 |
}
|
146 |
+
lyte_initer();
|
147 |
+
}
|
148 |
return $the_content;
|
149 |
}
|
150 |
|
151 |
+
function lyte_initer() {
|
152 |
+
if (!$lynited) {
|
153 |
+
$lynited=true;
|
154 |
+
add_action('wp_footer', 'lyte_init');
|
155 |
+
}
|
156 |
+
}
|
157 |
+
|
158 |
+
function lyte_init() {
|
159 |
+
global $lyteSettings;
|
160 |
+
echo "<link rel=\"stylesheet\" href=\"".$lyteSettings['path']."lyte.css?wylver=".$lyteSettings['version']."\" type=\"text/css\" />";
|
161 |
+
echo "<script type=\"text/javascript\">var bU='".$lyteSettings['path']."';</script>";
|
162 |
+
echo "<script type=\"text/javascript\" src=\"".$lyteSettings['path']."lyte-min.js?wylver=".$lyteSettings['version']."\"></script>";
|
163 |
+
}
|
164 |
+
|
165 |
if ( is_admin() ) {
|
166 |
require_once(dirname(__FILE__).'/options.php');
|
167 |
} else {
|