YouTube - Version 11.8

Version Description

Download this release

Release Info

Developer embedplus
Plugin Icon 128x128 YouTube
Version 11.8
Comparing to
See all releases

Code changes from version 11.7.1 to 11.8

Files changed (4) hide show
  1. readme.txt +7 -3
  2. scripts/ytprefs.js +155 -138
  3. scripts/ytprefs.min.js +1 -1
  4. youtube.php +135 -117
readme.txt CHANGED
@@ -4,10 +4,10 @@ Plugin Name: YouTube Embed
4
  Tags: youtube gallery, video gallery, youtube channel, youtube live, live stream
5
  Requires at least: 3.6.1
6
  Tested up to: 4.7
7
- Stable tag: 11.7.1
8
  License: GPLv3 or later
9
 
10
- YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
11
 
12
  == Description ==
13
 
@@ -145,11 +145,15 @@ You can also start and end each individual video at particular times. Like the a
145
 
146
  == Changelog ==
147
 
 
 
 
 
 
148
  = WordPress YouTube Embed 11.7.1 =
149
  * Remove gallery thumbnail translucency
150
  * Various bug fixes for galleries and the wizard
151
 
152
-
153
  = WordPress YouTube Embed 11.7 =
154
  * Separate Free and Pro codebases
155
  * Remove deprecated features
4
  Tags: youtube gallery, video gallery, youtube channel, youtube live, live stream
5
  Requires at least: 3.6.1
6
  Tested up to: 4.7
7
+ Stable tag: 11.8
8
  License: GPLv3 or later
9
 
10
+ YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, or YouTube.com live stream
11
 
12
  == Description ==
13
 
145
 
146
  == Changelog ==
147
 
148
+ = WordPress YouTube Embed 11.8 =
149
+ * Improved AJAX theme compatability
150
+ * Ability to choose which roles can use the editor wizard
151
+ * Volume + autoplay fix
152
+
153
  = WordPress YouTube Embed 11.7.1 =
154
  * Remove gallery thumbnail translucency
155
  * Various bug fixes for galleries and the wizard
156
 
 
157
  = WordPress YouTube Embed 11.7 =
158
  * Separate Free and Pro codebases
159
  * Remove deprecated features
scripts/ytprefs.js CHANGED
@@ -9,6 +9,7 @@
9
  epdovol: true,
10
  evselector: 'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',
11
  stopMobileBuffer: true,
 
12
  usingdefault: true
13
  };
14
 
@@ -53,8 +54,7 @@
53
  if (vol === 0)
54
  {
55
  event.target.mute();
56
- }
57
- else
58
  {
59
  if (event.target.isMuted())
60
  {
@@ -64,8 +64,14 @@
64
  }
65
  }
66
  }
67
- }
68
- catch (err) {
 
 
 
 
 
 
69
  }
70
 
71
  },
@@ -97,8 +103,7 @@
97
  if ($nextvid.length)
98
  {
99
  $nextvid.click();
100
- }
101
- else
102
  {
103
  $gallery.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click();
104
 
@@ -117,18 +122,20 @@
117
  if (typeof (window.YT) !== 'undefined' && window.YT !== null && window.YT.loaded)
118
  {
119
  var thisvid = document.getElementById(iframeid);
120
- thisvid.epytsetupdone = true;
121
- return new window.YT.Player(iframeid, {
122
- events: {
123
- "onReady": window._EPADashboard_.onPlayerReady,
124
- "onStateChange": window._EPADashboard_.onPlayerStateChange
125
- }
126
- });
 
 
 
 
127
  }
128
  },
129
  apiInit: function () {
130
- //setTimeout(function ()
131
- //{
132
  if (typeof (window.YT) !== 'undefined')
133
  {
134
  window._EPADashboard_.initStarted = true;
@@ -142,14 +149,12 @@
142
  window._EPADashboard_.setupevents(__allytifr[i].id);
143
  }
144
  }
145
- //}, 300);
146
  },
147
  log: function (msg) {
148
  try
149
  {
150
  console.log(msg);
151
- }
152
- catch (err) {
153
  }
154
  },
155
  doubleCheck: function () {
@@ -157,10 +162,9 @@
157
  window._EPADashboard_.checkCount++;
158
  if (window._EPADashboard_.checkCount >= 5 || window._EPADashboard_.initStarted) {
159
  clearInterval(window._EPADashboard_.checkInterval);
160
- }
161
- else {
162
  window._EPADashboard_.apiInit();
163
- window._EPADashboard_.log('YT API init');
164
  }
165
 
166
  }, 1000);
@@ -175,6 +179,119 @@
175
  range.selectNode(ele);
176
  window.getSelection().addRange(range);
177
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  }
179
  };
180
  }
@@ -185,8 +302,7 @@
185
  {
186
  window._EPADashboard_.apiInit();
187
  window._EPADashboard_.log('YT API ready');
188
- }
189
- else
190
  {
191
  $(window).on('load._EPYT_', function () {
192
  window._EPADashboard_.apiInit();
@@ -201,19 +317,17 @@
201
  iapi.src = "//www.youtube.com/iframe_api";
202
  iapi.type = "text/javascript";
203
  document.getElementsByTagName('head')[0].appendChild(iapi);
204
- }
205
- else if (window.YT.loaded)
206
  {
207
  if (window._EPYT_.pageLoaded)
208
  {
209
- window._EPADashboard_.log('YT API available');
210
  window._EPADashboard_.apiInit();
211
- }
212
- else
213
  {
214
  $(window).on('load._EPYT_', function () {
215
- window._EPADashboard_.log('YT API available 2');
216
  window._EPADashboard_.apiInit();
 
217
  });
218
  }
219
  }
@@ -221,8 +335,7 @@
221
  if (window._EPYT_.pageLoaded)
222
  {
223
  window._EPADashboard_.doubleCheck();
224
- }
225
- else
226
  {
227
  $(window).on('load._EPYT_', function () {
228
  window._EPADashboard_.doubleCheck();
@@ -231,117 +344,21 @@
231
 
232
 
233
  $(document).ready(function () {
234
- $('.epyt-gallery').each(function () {
235
- var $container = $(this);
236
- var $iframe = $(this).find('iframe').first();
237
-
238
- var initSrc = $iframe.attr('src');
239
- if (!initSrc)
240
- {
241
- initSrc = $iframe.data('ep-src');
242
- }
243
- var firstId = $(this).find('.epyt-gallery-list .epyt-gallery-thumb').first().data('videoid');
244
- initSrc = initSrc.replace(firstId, 'GALLERYVIDEOID');
245
- $iframe.data('ep-gallerysrc', initSrc);
246
-
247
- var $listgallery = $container.find('.epyt-gallery-list');
248
-
249
- $container.on('click', '.epyt-gallery-list .epyt-gallery-thumb', function () {
250
- $container.find('.epyt-gallery-list .epyt-gallery-thumb').removeClass('epyt-current-video');
251
- $(this).addClass('epyt-current-video');
252
- var vid = $(this).data('videoid');
253
- $container.data('currvid', vid);
254
- var vidSrc = $iframe.data('ep-gallerysrc').replace('GALLERYVIDEOID', vid);
255
-
256
- var thumbplay = $container.find('.epyt-pagebutton').first().data('thumbplay');
257
- if (thumbplay !== '0' && thumbplay !== 0)
258
- {
259
- if (vidSrc.indexOf('autoplay') > 0)
260
- {
261
- vidSrc = vidSrc.replace('autoplay=0', 'autoplay=1');
262
- }
263
- else
264
- {
265
- vidSrc += '&autoplay=1';
266
- }
267
-
268
- $iframe.addClass('epyt-thumbplay');
269
- }
270
-
271
- // https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js
272
- $('html, body').animate({
273
- scrollTop: $iframe.offset().top - parseInt(_EPYT_.gallery_scrolloffset)
274
- }, 500, function () {
275
- $iframe.attr('src', vidSrc);
276
- window._EPADashboard_.setupevents($iframe.attr('id'));
277
- });
278
 
279
-
280
- }).on('keydown', '.epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton', function (e) {
281
- var code = e.which;
282
- if ((code === 13) || (code === 32)) {
283
- e.preventDefault();
284
- $(this).click();
285
-
286
- }
287
- });
288
-
289
- $container.on('mouseenter', '.epyt-gallery-list .epyt-gallery-thumb', function () {
290
- $(this).addClass('hover');
291
- });
292
-
293
- $container.on('mouseleave', '.epyt-gallery-list .epyt-gallery-thumb', function () {
294
- $(this).removeClass('hover');
295
- });
296
-
297
- $container.on('click', '.epyt-pagebutton', function () {
298
- var pageData = {
299
- action: 'my_embedplus_gallery_page',
300
- security: _EPYT_.security,
301
- options: {
302
- playlistId: $(this).data('playlistid'),
303
- pageToken: $(this).data('pagetoken'),
304
- pageSize: $(this).data('pagesize'),
305
- columns: $(this).data('columns'),
306
- showTitle: $(this).data('showtitle'),
307
- showPaging: $(this).data('showpaging'),
308
- autonext: $(this).data('autonext'),
309
- thumbplay: $(this).data('thumbplay')
310
- }
311
- };
312
-
313
- var forward = $(this).hasClass('epyt-next');
314
- var currpage = parseInt($container.data('currpage') + "");
315
- currpage += forward ? 1 : -1;
316
- $container.data('currpage', currpage);
317
- $container.find('.epyt-gallery-list').addClass('epyt-loading');
318
-
319
- $.post(_EPYT_.ajaxurl, pageData, function (response) {
320
- $container.find('.epyt-gallery-list').html(response);
321
- $container.find('.epyt-current').each(function () {
322
- $(this).text($container.data('currpage'));
323
- });
324
- $container.find('.epyt-gallery-thumb[data-videoid="' + $container.data('currvid') + '"]').addClass('epyt-current-video');
325
-
326
- if ($container.find('.epyt-pagebutton').first().data('autonext') == '1')
327
  {
328
- $container.find('.epyt-gallery-thumb').first().click();
 
 
329
  }
330
-
331
- })
332
- .fail(function () {
333
- alert('Sorry, there was an error loading the next page.');
334
- })
335
- .always(function () {
336
- $container.find('.epyt-gallery-list').removeClass('epyt-loading');
337
- // https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js
338
- $('html, body').animate({
339
- scrollTop: $container.find('.epyt-gallery-list').offset().top - parseInt(_EPYT_.gallery_scrolloffset)
340
- }, 500);
341
- });
342
-
343
  });
 
344
 
345
- });
346
  });
347
  })(window, jQuery);
9
  epdovol: true,
10
  evselector: 'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',
11
  stopMobileBuffer: true,
12
+ ajax_compat: false,
13
  usingdefault: true
14
  };
15
 
54
  if (vol === 0)
55
  {
56
  event.target.mute();
57
+ } else
 
58
  {
59
  if (event.target.isMuted())
60
  {
64
  }
65
  }
66
  }
67
+
68
+ var epautoplay = parseInt(event.target.getIframe().getAttribute("data-epautoplay"));
69
+ if (!isNaN(epautoplay) && epautoplay === 1)
70
+ {
71
+ event.target.playVideo();
72
+ }
73
+
74
+ } catch (err) {
75
  }
76
 
77
  },
103
  if ($nextvid.length)
104
  {
105
  $nextvid.click();
106
+ } else
 
107
  {
108
  $gallery.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click();
109
 
122
  if (typeof (window.YT) !== 'undefined' && window.YT !== null && window.YT.loaded)
123
  {
124
  var thisvid = document.getElementById(iframeid);
125
+
126
+ if (!thisvid.epytsetupdone)
127
+ {
128
+ thisvid.epytsetupdone = true;
129
+ return new window.YT.Player(iframeid, {
130
+ events: {
131
+ "onReady": window._EPADashboard_.onPlayerReady,
132
+ "onStateChange": window._EPADashboard_.onPlayerStateChange
133
+ }
134
+ });
135
+ }
136
  }
137
  },
138
  apiInit: function () {
 
 
139
  if (typeof (window.YT) !== 'undefined')
140
  {
141
  window._EPADashboard_.initStarted = true;
149
  window._EPADashboard_.setupevents(__allytifr[i].id);
150
  }
151
  }
 
152
  },
153
  log: function (msg) {
154
  try
155
  {
156
  console.log(msg);
157
+ } catch (err) {
 
158
  }
159
  },
160
  doubleCheck: function () {
162
  window._EPADashboard_.checkCount++;
163
  if (window._EPADashboard_.checkCount >= 5 || window._EPADashboard_.initStarted) {
164
  clearInterval(window._EPADashboard_.checkInterval);
165
+ } else {
 
166
  window._EPADashboard_.apiInit();
167
+ window._EPADashboard_.log('YT API init check');
168
  }
169
 
170
  }, 1000);
179
  range.selectNode(ele);
180
  window.getSelection().addRange(range);
181
  }
182
+ },
183
+ pageReady: function () {
184
+ $('.epyt-gallery').each(function () {
185
+ var $container = $(this);
186
+ var $iframe = $(this).find('iframe').first();
187
+
188
+ var initSrc = $iframe.attr('src');
189
+ if (!initSrc)
190
+ {
191
+ initSrc = $iframe.data('ep-src');
192
+ }
193
+ var firstId = $(this).find('.epyt-gallery-list .epyt-gallery-thumb').first().data('videoid');
194
+ initSrc = initSrc.replace(firstId, 'GALLERYVIDEOID');
195
+ $iframe.data('ep-gallerysrc', initSrc);
196
+
197
+ var $listgallery = $container.find('.epyt-gallery-list');
198
+
199
+ $container.on('click', '.epyt-gallery-list .epyt-gallery-thumb', function () {
200
+ $container.find('.epyt-gallery-list .epyt-gallery-thumb').removeClass('epyt-current-video');
201
+ $(this).addClass('epyt-current-video');
202
+ var vid = $(this).data('videoid');
203
+ $container.data('currvid', vid);
204
+ var vidSrc = $iframe.data('ep-gallerysrc').replace('GALLERYVIDEOID', vid);
205
+
206
+ var thumbplay = $container.find('.epyt-pagebutton').first().data('thumbplay');
207
+ if (thumbplay !== '0' && thumbplay !== 0)
208
+ {
209
+ if (vidSrc.indexOf('autoplay') > 0)
210
+ {
211
+ vidSrc = vidSrc.replace('autoplay=0', 'autoplay=1');
212
+ } else
213
+ {
214
+ vidSrc += '&autoplay=1';
215
+ }
216
+
217
+ $iframe.addClass('epyt-thumbplay');
218
+ }
219
+
220
+ // https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js
221
+ $('html, body').animate({
222
+ scrollTop: $iframe.offset().top - parseInt(_EPYT_.gallery_scrolloffset)
223
+ }, 500, function () {
224
+ $iframe.attr('src', vidSrc);
225
+ window._EPADashboard_.setupevents($iframe.attr('id'));
226
+ });
227
+
228
+
229
+ }).on('keydown', '.epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton', function (e) {
230
+ var code = e.which;
231
+ if ((code === 13) || (code === 32)) {
232
+ e.preventDefault();
233
+ $(this).click();
234
+
235
+ }
236
+ });
237
+
238
+ $container.on('mouseenter', '.epyt-gallery-list .epyt-gallery-thumb', function () {
239
+ $(this).addClass('hover');
240
+ });
241
+
242
+ $container.on('mouseleave', '.epyt-gallery-list .epyt-gallery-thumb', function () {
243
+ $(this).removeClass('hover');
244
+ });
245
+
246
+ $container.on('click', '.epyt-pagebutton', function () {
247
+ var pageData = {
248
+ action: 'my_embedplus_gallery_page',
249
+ security: _EPYT_.security,
250
+ options: {
251
+ playlistId: $(this).data('playlistid'),
252
+ pageToken: $(this).data('pagetoken'),
253
+ pageSize: $(this).data('pagesize'),
254
+ columns: $(this).data('columns'),
255
+ showTitle: $(this).data('showtitle'),
256
+ showPaging: $(this).data('showpaging'),
257
+ autonext: $(this).data('autonext'),
258
+ thumbplay: $(this).data('thumbplay')
259
+ }
260
+ };
261
+
262
+ var forward = $(this).hasClass('epyt-next');
263
+ var currpage = parseInt($container.data('currpage') + "");
264
+ currpage += forward ? 1 : -1;
265
+ $container.data('currpage', currpage);
266
+ $container.find('.epyt-gallery-list').addClass('epyt-loading');
267
+
268
+ $.post(_EPYT_.ajaxurl, pageData, function (response) {
269
+ $container.find('.epyt-gallery-list').html(response);
270
+ $container.find('.epyt-current').each(function () {
271
+ $(this).text($container.data('currpage'));
272
+ });
273
+ $container.find('.epyt-gallery-thumb[data-videoid="' + $container.data('currvid') + '"]').addClass('epyt-current-video');
274
+
275
+ if ($container.find('.epyt-pagebutton').first().data('autonext') == '1')
276
+ {
277
+ $container.find('.epyt-gallery-thumb').first().click();
278
+ }
279
+
280
+ })
281
+ .fail(function () {
282
+ alert('Sorry, there was an error loading the next page.');
283
+ })
284
+ .always(function () {
285
+ $container.find('.epyt-gallery-list').removeClass('epyt-loading');
286
+ // https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js
287
+ $('html, body').animate({
288
+ scrollTop: $container.find('.epyt-gallery-list').offset().top - parseInt(_EPYT_.gallery_scrolloffset)
289
+ }, 500);
290
+ });
291
+
292
+ });
293
+
294
+ });
295
  }
296
  };
297
  }
302
  {
303
  window._EPADashboard_.apiInit();
304
  window._EPADashboard_.log('YT API ready');
305
+ } else
 
306
  {
307
  $(window).on('load._EPYT_', function () {
308
  window._EPADashboard_.apiInit();
317
  iapi.src = "//www.youtube.com/iframe_api";
318
  iapi.type = "text/javascript";
319
  document.getElementsByTagName('head')[0].appendChild(iapi);
320
+ } else if (window.YT.loaded)
 
321
  {
322
  if (window._EPYT_.pageLoaded)
323
  {
 
324
  window._EPADashboard_.apiInit();
325
+ window._EPADashboard_.log('YT API available');
326
+ } else
327
  {
328
  $(window).on('load._EPYT_', function () {
 
329
  window._EPADashboard_.apiInit();
330
+ window._EPADashboard_.log('YT API available 2');
331
  });
332
  }
333
  }
335
  if (window._EPYT_.pageLoaded)
336
  {
337
  window._EPADashboard_.doubleCheck();
338
+ } else
 
339
  {
340
  $(window).on('load._EPYT_', function () {
341
  window._EPADashboard_.doubleCheck();
344
 
345
 
346
  $(document).ready(function () {
347
+ window._EPADashboard_.pageReady();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
348
 
349
+ if (window._EPYT_.ajax_compat)
350
+ {
351
+ $(window).on('load._EPYT_', function () {
352
+ $(document).ajaxSuccess(function (e, xhr, settings) {
353
+ if (xhr && xhr.responseText && xhr.responseText.indexOf('<iframe ') !== -1)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  {
355
+ window._EPADashboard_.apiInit();
356
+ window._EPADashboard_.log('YT API AJAX');
357
+ window._EPADashboard_.pageReady();
358
  }
359
+ });
 
 
 
 
 
 
 
 
 
 
 
 
360
  });
361
+ }
362
 
 
363
  });
364
  })(window, jQuery);
scripts/ytprefs.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- (function(a,b){a._EPYT_=a._EPYT_||{ajaxurl:"/wp-admin/admin-ajax.php",security:"",gallery_scrolloffset:100,eppathtoscripts:"/wp-content/plugins/youtube-embed-plus/scripts/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:true,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',stopMobileBuffer:true,usingdefault:true};if(a.location.toString().indexOf("https://")===0){a._EPYT_.ajaxurl=a._EPYT_.ajaxurl.replace("http://","https://")}a._EPYT_.pageLoaded=false;b(a).on("load._EPYT_",function(){a._EPYT_.pageLoaded=true});if(!document.querySelectorAll){document.querySelectorAll=function(e){var g=document,f=g.documentElement.firstChild,d=g.createElement("STYLE");f.appendChild(d);g.__qsaels=[];d.styleSheet.cssText=e+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return g.__qsaels}}if(typeof a._EPADashboard_==="undefined"){a._EPADashboard_={initStarted:false,checkCount:0,onPlayerReady:function(f){try{if(typeof _EPYT_.epdovol!=="undefined"&&_EPYT_.epdovol){var d=parseInt(f.target.getIframe().getAttribute("data-vol"));if(!isNaN(d)){if(d===0){f.target.mute()}else{if(f.target.isMuted()){f.target.unMute()}f.target.setVolume(d)}}}}catch(e){}},onPlayerStateChange:function(g){var f=g.target.getIframe();if(g.data===a.YT.PlayerState.PLAYING&&g.target.ponce!==true&&f.src.indexOf("autoplay=1")===-1){g.target.ponce=true}var d=b(f).closest(".epyt-gallery");if(!d.length){d=b("#"+b(f).data("epytgalleryid"))}if(d.length){var e=d.find(".epyt-pagebutton").first().data("autonext")=="1";if(e&&g.data===a.YT.PlayerState.ENDED){var h=d.find(".epyt-current-video");if(!h.length){h=d.find(".epyt-gallery-thumb").first()}var i=h.find(" ~ .epyt-gallery-thumb").first();if(i.length){i.click()}else{d.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()}}}},justid:function(d){return new RegExp("[\\?&]v=([^&#]*)").exec(d)[1]},setupevents:function(e){a._EPADashboard_.log("Setting up YT API events: "+e);if(typeof(a.YT)!=="undefined"&&a.YT!==null&&a.YT.loaded){var d=document.getElementById(e);d.epytsetupdone=true;return new a.YT.Player(e,{events:{onReady:a._EPADashboard_.onPlayerReady,onStateChange:a._EPADashboard_.onPlayerStateChange}})}},apiInit:function(){if(typeof(a.YT)!=="undefined"){a._EPADashboard_.initStarted=true;var d=document.querySelectorAll(_EPYT_.evselector);for(var e=0;e<d.length;e++){if(!d[e].hasAttribute("id")){d[e].id="_dytid_"+Math.round(Math.random()*8999+1000)}a._EPADashboard_.setupevents(d[e].id)}}},log:function(e){try{console.log(e)}catch(d){}},doubleCheck:function(){a._EPADashboard_.checkInterval=setInterval(function(){a._EPADashboard_.checkCount++;if(a._EPADashboard_.checkCount>=5||a._EPADashboard_.initStarted){clearInterval(a._EPADashboard_.checkInterval)}else{a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API init")}},1000)},selectText:function(e){if(document.selection){var d=document.body.createTextRange();d.moveToElementText(e);d.select()}else{if(a.getSelection){var d=document.createRange();d.selectNode(e);a.getSelection().addRange(d)}}}}}a.onYouTubeIframeAPIReady=typeof a.onYouTubeIframeAPIReady!=="undefined"?a.onYouTubeIframeAPIReady:function(){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready 2")})}};if(typeof a.YT==="undefined"){var c=document.createElement("script");c.src="//www.youtube.com/iframe_api";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}else{if(a.YT.loaded){if(a._EPYT_.pageLoaded){a._EPADashboard_.log("YT API available");a._EPADashboard_.apiInit()}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.log("YT API available 2");a._EPADashboard_.apiInit()})}}}if(a._EPYT_.pageLoaded){a._EPADashboard_.doubleCheck()}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.doubleCheck()})}b(document).ready(function(){b(".epyt-gallery").each(function(){var h=b(this);var g=b(this).find("iframe").first();var e=g.attr("src");if(!e){e=g.data("ep-src")}var f=b(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");e=e.replace(f,"GALLERYVIDEOID");g.data("ep-gallerysrc",e);var d=h.find(".epyt-gallery-list");h.on("click",".epyt-gallery-list .epyt-gallery-thumb",function(){h.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");b(this).addClass("epyt-current-video");var i=b(this).data("videoid");h.data("currvid",i);var k=g.data("ep-gallerysrc").replace("GALLERYVIDEOID",i);var j=h.find(".epyt-pagebutton").first().data("thumbplay");if(j!=="0"&&j!==0){if(k.indexOf("autoplay")>0){k=k.replace("autoplay=0","autoplay=1")}else{k+="&autoplay=1"}g.addClass("epyt-thumbplay")}b("html, body").animate({scrollTop:g.offset().top-parseInt(_EPYT_.gallery_scrolloffset)},500,function(){g.attr("src",k);a._EPADashboard_.setupevents(g.attr("id"))})}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(j){var i=j.which;if((i===13)||(i===32)){j.preventDefault();b(this).click()}});h.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).addClass("hover")});h.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).removeClass("hover")});h.on("click",".epyt-pagebutton",function(){var k={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:b(this).data("playlistid"),pageToken:b(this).data("pagetoken"),pageSize:b(this).data("pagesize"),columns:b(this).data("columns"),showTitle:b(this).data("showtitle"),showPaging:b(this).data("showpaging"),autonext:b(this).data("autonext"),thumbplay:b(this).data("thumbplay")}};var i=b(this).hasClass("epyt-next");var j=parseInt(h.data("currpage")+"");j+=i?1:-1;h.data("currpage",j);h.find(".epyt-gallery-list").addClass("epyt-loading");b.post(_EPYT_.ajaxurl,k,function(l){h.find(".epyt-gallery-list").html(l);h.find(".epyt-current").each(function(){b(this).text(h.data("currpage"))});h.find('.epyt-gallery-thumb[data-videoid="'+h.data("currvid")+'"]').addClass("epyt-current-video");if(h.find(".epyt-pagebutton").first().data("autonext")=="1"){h.find(".epyt-gallery-thumb").first().click()}}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){h.find(".epyt-gallery-list").removeClass("epyt-loading");b("html, body").animate({scrollTop:h.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset)},500)})})})})})(window,jQuery);
1
 
2
+ (function(a,b){a._EPYT_=a._EPYT_||{ajaxurl:"/wp-admin/admin-ajax.php",security:"",gallery_scrolloffset:100,eppathtoscripts:"/wp-content/plugins/youtube-embed-plus/scripts/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:true,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',stopMobileBuffer:true,ajax_compat:false,usingdefault:true};if(a.location.toString().indexOf("https://")===0){a._EPYT_.ajaxurl=a._EPYT_.ajaxurl.replace("http://","https://")}a._EPYT_.pageLoaded=false;b(a).on("load._EPYT_",function(){a._EPYT_.pageLoaded=true});if(!document.querySelectorAll){document.querySelectorAll=function(e){var g=document,f=g.documentElement.firstChild,d=g.createElement("STYLE");f.appendChild(d);g.__qsaels=[];d.styleSheet.cssText=e+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return g.__qsaels}}if(typeof a._EPADashboard_==="undefined"){a._EPADashboard_={initStarted:false,checkCount:0,onPlayerReady:function(g){try{if(typeof _EPYT_.epdovol!=="undefined"&&_EPYT_.epdovol){var e=parseInt(g.target.getIframe().getAttribute("data-vol"));if(!isNaN(e)){if(e===0){g.target.mute()}else{if(g.target.isMuted()){g.target.unMute()}g.target.setVolume(e)}}}var d=parseInt(g.target.getIframe().getAttribute("data-epautoplay"));if(!isNaN(d)&&d===1){g.target.playVideo()}}catch(f){}},onPlayerStateChange:function(g){var f=g.target.getIframe();if(g.data===a.YT.PlayerState.PLAYING&&g.target.ponce!==true&&f.src.indexOf("autoplay=1")===-1){g.target.ponce=true}var d=b(f).closest(".epyt-gallery");if(!d.length){d=b("#"+b(f).data("epytgalleryid"))}if(d.length){var e=d.find(".epyt-pagebutton").first().data("autonext")=="1";if(e&&g.data===a.YT.PlayerState.ENDED){var h=d.find(".epyt-current-video");if(!h.length){h=d.find(".epyt-gallery-thumb").first()}var i=h.find(" ~ .epyt-gallery-thumb").first();if(i.length){i.click()}else{d.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()}}}},justid:function(d){return new RegExp("[\\?&]v=([^&#]*)").exec(d)[1]},setupevents:function(e){a._EPADashboard_.log("Setting up YT API events: "+e);if(typeof(a.YT)!=="undefined"&&a.YT!==null&&a.YT.loaded){var d=document.getElementById(e);if(!d.epytsetupdone){d.epytsetupdone=true;return new a.YT.Player(e,{events:{onReady:a._EPADashboard_.onPlayerReady,onStateChange:a._EPADashboard_.onPlayerStateChange}})}}},apiInit:function(){if(typeof(a.YT)!=="undefined"){a._EPADashboard_.initStarted=true;var d=document.querySelectorAll(_EPYT_.evselector);for(var e=0;e<d.length;e++){if(!d[e].hasAttribute("id")){d[e].id="_dytid_"+Math.round(Math.random()*8999+1000)}a._EPADashboard_.setupevents(d[e].id)}}},log:function(e){try{console.log(e)}catch(d){}},doubleCheck:function(){a._EPADashboard_.checkInterval=setInterval(function(){a._EPADashboard_.checkCount++;if(a._EPADashboard_.checkCount>=5||a._EPADashboard_.initStarted){clearInterval(a._EPADashboard_.checkInterval)}else{a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API init check")}},1000)},selectText:function(e){if(document.selection){var d=document.body.createTextRange();d.moveToElementText(e);d.select()}else{if(a.getSelection){var d=document.createRange();d.selectNode(e);a.getSelection().addRange(d)}}},pageReady:function(){b(".epyt-gallery").each(function(){var h=b(this);var g=b(this).find("iframe").first();var e=g.attr("src");if(!e){e=g.data("ep-src")}var f=b(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");e=e.replace(f,"GALLERYVIDEOID");g.data("ep-gallerysrc",e);var d=h.find(".epyt-gallery-list");h.on("click",".epyt-gallery-list .epyt-gallery-thumb",function(){h.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");b(this).addClass("epyt-current-video");var i=b(this).data("videoid");h.data("currvid",i);var k=g.data("ep-gallerysrc").replace("GALLERYVIDEOID",i);var j=h.find(".epyt-pagebutton").first().data("thumbplay");if(j!=="0"&&j!==0){if(k.indexOf("autoplay")>0){k=k.replace("autoplay=0","autoplay=1")}else{k+="&autoplay=1"}g.addClass("epyt-thumbplay")}b("html, body").animate({scrollTop:g.offset().top-parseInt(_EPYT_.gallery_scrolloffset)},500,function(){g.attr("src",k);a._EPADashboard_.setupevents(g.attr("id"))})}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(j){var i=j.which;if((i===13)||(i===32)){j.preventDefault();b(this).click()}});h.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).addClass("hover")});h.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).removeClass("hover")});h.on("click",".epyt-pagebutton",function(){var k={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:b(this).data("playlistid"),pageToken:b(this).data("pagetoken"),pageSize:b(this).data("pagesize"),columns:b(this).data("columns"),showTitle:b(this).data("showtitle"),showPaging:b(this).data("showpaging"),autonext:b(this).data("autonext"),thumbplay:b(this).data("thumbplay")}};var i=b(this).hasClass("epyt-next");var j=parseInt(h.data("currpage")+"");j+=i?1:-1;h.data("currpage",j);h.find(".epyt-gallery-list").addClass("epyt-loading");b.post(_EPYT_.ajaxurl,k,function(l){h.find(".epyt-gallery-list").html(l);h.find(".epyt-current").each(function(){b(this).text(h.data("currpage"))});h.find('.epyt-gallery-thumb[data-videoid="'+h.data("currvid")+'"]').addClass("epyt-current-video");if(h.find(".epyt-pagebutton").first().data("autonext")=="1"){h.find(".epyt-gallery-thumb").first().click()}}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){h.find(".epyt-gallery-list").removeClass("epyt-loading");b("html, body").animate({scrollTop:h.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset)},500)})})})}}}a.onYouTubeIframeAPIReady=typeof a.onYouTubeIframeAPIReady!=="undefined"?a.onYouTubeIframeAPIReady:function(){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready 2")})}};if(typeof a.YT==="undefined"){var c=document.createElement("script");c.src="//www.youtube.com/iframe_api";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}else{if(a.YT.loaded){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available 2")})}}}if(a._EPYT_.pageLoaded){a._EPADashboard_.doubleCheck()}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.doubleCheck()})}b(document).ready(function(){a._EPADashboard_.pageReady();if(a._EPYT_.ajax_compat){b(a).on("load._EPYT_",function(){b(document).ajaxSuccess(function(f,g,d){if(g&&g.responseText&&g.responseText.indexOf("<iframe ")!==-1){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API AJAX");a._EPADashboard_.pageReady()}})})}})})(window,jQuery);
youtube.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: YouTube
4
  Plugin URI: http://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx
5
  Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
6
- Version: 11.7.1
7
  Author: EmbedPlus Team
8
  Author URI: http://www.embedplus.com
9
  */
@@ -33,7 +33,7 @@ class YouTubePrefs
33
  {
34
 
35
  public static $curltimeout = 20;
36
- public static $version = '11.7.1';
37
  public static $opt_version = 'version';
38
  public static $optembedwidth = null;
39
  public static $optembedheight = null;
@@ -70,6 +70,9 @@ class YouTubePrefs
70
  public static $opt_widgetfit = 'widgetfit';
71
  public static $opt_evselector_light = 'evselector_light';
72
  public static $opt_stop_mobile_buffer = 'stop_mobile_buffer';
 
 
 
73
  public static $opt_defaultdims = 'defaultdims';
74
  public static $opt_defaultwidth = 'width';
75
  public static $opt_defaultheight = 'height';
@@ -101,6 +104,7 @@ class YouTubePrefs
101
  public static $alloptions = null;
102
  public static $yt_options = array();
103
  public static $dft_bpts = array(array('bp' => array('min' => 0, 'max' => 767), 'cols' => 1));
 
104
  //public static $epbase = 'http://localhost:2346';
105
  public static $epbase = '//www.embedplus.com';
106
  public static $double_plugin = false;
@@ -656,7 +660,12 @@ class YouTubePrefs
656
  <?php
657
  }
658
  ?>
659
-
 
 
 
 
 
660
  </div>
661
  <?php
662
  }
@@ -791,7 +800,7 @@ class YouTubePrefs
791
  </div>
792
  <h3 id="h3_live"><a href="#">Embed a live stream. <sup class="orange">NEW</sup> </a></h3>
793
  <div>
794
- <h4 class="center">Live stream directions</h4>
795
  <?php
796
  if (!self::has_api_key())
797
  {
@@ -807,7 +816,7 @@ class YouTubePrefs
807
  <li><small>(If you do not know the exact channel URL, enter in the URL to any single video that belongs to that channel, to automatically retrieve the channel URL. Example: https://www.youtube.com/watch?v=fIW8Vvfbojc )</small></li>
808
  </ul>
809
  </li>
810
- <li>On the YouTube settings page, enter in the "Default Not Live Content" field what content should display while your channel is <em>not</em> currently streaming.
811
  </li>
812
  </ol>
813
  <form name="wizform_live" method="post" action="" class="wizform" id="wizform_live">
@@ -1142,8 +1151,7 @@ class YouTubePrefs
1142
  if (response.type === "success") {
1143
  $accbox.html(response.data),
1144
  $accbox.show(400);
1145
- }
1146
- else {
1147
  }
1148
  },
1149
  error: function (xhr, ajaxOptions, thrownError) {
@@ -1262,7 +1270,7 @@ class YouTubePrefs
1262
  else
1263
  {
1264
  $thehtml .= '<p class="center bold orange">This <a target="_blank" href="' . $postlink . '">post/page</a> contains a video that has been removed from YouTube.';
1265
- $thehtml .='<br><a target="_blank" href="https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx">Activate delete video tracking to catch these cases &raquo;</a>';
1266
  $thehtml .= '</strong>';
1267
  }
1268
  }
@@ -1294,7 +1302,7 @@ class YouTubePrefs
1294
  else
1295
  {
1296
  $thehtml .= '<p class="center bold orange">This <a target="_blank" href="' . $postlink . '">post/page</a> contains a video that has been removed from YouTube.';
1297
- $thehtml .='<br><a target="_blank" href="https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx">Activate delete video tracking to catch these cases &raquo;</a>';
1298
  $thehtml .= '</strong>';
1299
  }
1300
  }
@@ -1364,8 +1372,30 @@ class YouTubePrefs
1364
  die();
1365
  }
1366
 
 
 
 
 
 
 
 
 
 
 
 
 
1367
  public static function media_button_wizard()
1368
  {
 
 
 
 
 
 
 
 
 
 
1369
  add_thickbox();
1370
 
1371
  $wizhref = admin_url('admin.php?page=youtube-ep-wizard') .
@@ -1480,6 +1510,7 @@ class YouTubePrefs
1480
  version: "<?php echo self::$alloptions[self::$opt_version] ?>",
1481
  epdovol: true,
1482
  evselector: '<?php echo self::get_evselector(); ?>',
 
1483
  stopMobileBuffer: <?php echo self::$alloptions[self::$opt_stop_mobile_buffer] == '1' ? 'true' : 'false' ?>
1484
  };</script>
1485
  <?php
@@ -1537,6 +1568,9 @@ class YouTubePrefs
1537
  $_widgetfit = 1;
1538
  $_evselector_light = 0;
1539
  $_stop_mobile_buffer = 1;
 
 
 
1540
  $_defaultdims = 0;
1541
  $_defaultwidth = '';
1542
  $_defaultheight = '';
@@ -1596,6 +1630,9 @@ class YouTubePrefs
1596
  $_widgetfit = self::tryget($arroptions, self::$opt_widgetfit, 1);
1597
  $_evselector_light = self::tryget($arroptions, self::$opt_evselector_light, 0);
1598
  $_stop_mobile_buffer = self::tryget($arroptions, self::$opt_stop_mobile_buffer, 1);
 
 
 
1599
  $_defaultdims = self::tryget($arroptions, self::$opt_defaultdims, 0);
1600
  $_defaultwidth = self::tryget($arroptions, self::$opt_defaultwidth, '');
1601
  $_defaultheight = self::tryget($arroptions, self::$opt_defaultheight, '');
@@ -1659,6 +1696,9 @@ class YouTubePrefs
1659
  self::$opt_widgetfit => $_widgetfit,
1660
  self::$opt_evselector_light => $_evselector_light,
1661
  self::$opt_stop_mobile_buffer => $_stop_mobile_buffer,
 
 
 
1662
  self::$opt_defaultdims => $_defaultdims,
1663
  self::$opt_defaultwidth => $_defaultwidth,
1664
  self::$opt_defaultheight => $_defaultheight,
@@ -1907,6 +1947,9 @@ class YouTubePrefs
1907
 
1908
  if (isset($jsonResult->items) && $jsonResult->items != null && is_array($jsonResult->items))
1909
  {
 
 
 
1910
  foreach ($jsonResult->items as $item)
1911
  {
1912
 
@@ -2006,6 +2049,15 @@ class YouTubePrefs
2006
  return $gallobj;
2007
  }
2008
 
 
 
 
 
 
 
 
 
 
2009
  public static function get_thumbnail_html($thumb, $options)
2010
  {
2011
  $escId = esc_attr($thumb->id);
@@ -2233,6 +2285,11 @@ class YouTubePrefs
2233
  $videoidoutput = isset($gallery_page_obj->init_id) ? $gallery_page_obj->init_id : '';
2234
  }
2235
 
 
 
 
 
 
2236
 
2237
  $code1 = '<iframe ' . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
2238
  '" src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
@@ -2483,8 +2540,7 @@ class YouTubePrefs
2483
  {
2484
  //ep_do_pointers($j);
2485
  }
2486
- }
2487
- else {
2488
  }
2489
  },
2490
  error: function (xhr, ajaxOptions, thrownError) {
@@ -2548,11 +2604,11 @@ class YouTubePrefs
2548
  $new_pointer_content .= '<p>'; // ooopointer
2549
  if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
2550
  {
2551
- $new_pointer_content .= __("This update includes some bug fixes for galleries and the wizard for the Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions &raquo;</a>");
2552
  }
2553
  else
2554
  {
2555
- $new_pointer_content .= __("This update includes some bug fixes for galleries and the wizard for the Free and Pro versions. " . '<strong>Important message to YouTube Pro users</strong>: From version 11.7 onward, you must <a href="https://www.embedplus.com/youtube-pro/download/?prokey=' . esc_attr(self::$alloptions[self::$opt_pro]) . '" target="_blank">download the separate plugin here</a> to regain your Pro features. All your settings will automatically migrate after installing the separate Pro download. Thank you for your support and patience during this transition.');
2556
  }
2557
  $new_pointer_content .= '</p>';
2558
 
@@ -2572,92 +2628,8 @@ class YouTubePrefs
2572
  return isset($_POST[$idx]) && $_POST[$idx] == (true || 'on');
2573
  }
2574
 
2575
- public static function output_scriptvars() // deprecated
2576
- {
2577
- self::$scriptsprinted++;
2578
- if (self::$scriptsprinted == 1)
2579
- {
2580
- $blogwidth = self::get_blogwidth();
2581
- $epprokey = self::$alloptions[self::$opt_pro];
2582
- $myytdefaults = http_build_query(self::$alloptions);
2583
- ?>
2584
- <script type="text/javascript">
2585
- var wpajaxurl = "<?php echo admin_url('admin-ajax.php') ?>";
2586
- if (window.location.toString().indexOf('https://') === 0)
2587
- {
2588
- wpajaxurl = wpajaxurl.replace("http://", "https://");
2589
- }
2590
-
2591
- var epblogwidth = <?php echo $blogwidth; ?>;
2592
- var epprokey = '<?php echo $epprokey; ?>';
2593
- var epbasesite = '<?php echo self::$epbase; ?>';
2594
- var epversion = '<?php echo self::$version; ?>';
2595
- var myytdefaults = '<?php echo $myytdefaults; ?>';
2596
- var eppluginadminurl = '<?php echo admin_url('admin.php?page=youtube-my-preferences'); ?>';
2597
- //////////////////BEGIN SCRIPT HERE///////////////////////
2598
-
2599
- // Create IE + others compatible event handler
2600
- var epeventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
2601
- var epeventer = window[epeventMethod];
2602
- var epmessageEvent = epeventMethod === "attachEvent" ? "onmessage" : "message";
2603
- // Listen to message from child window
2604
- epeventer(epmessageEvent, function (e)
2605
- {
2606
- var embedcode = "";
2607
- try
2608
- {
2609
- if (e.data.indexOf("youtubeembedplus") === 0)
2610
- {
2611
- embedcode = e.data.split("|")[1];
2612
- if (embedcode.indexOf("[") !== 0)
2613
- {
2614
- embedcode = "<p>" + embedcode + "</p>";
2615
- }
2616
-
2617
- if (window.tinyMCE !== null && window.tinyMCE.activeEditor !== null && !window.tinyMCE.activeEditor.isHidden())
2618
- {
2619
- if (typeof window.tinyMCE.execInstanceCommand !== 'undefined')
2620
- {
2621
- window.tinyMCE.execInstanceCommand(
2622
- window.tinyMCE.activeEditor.id,
2623
- 'mceInsertContent',
2624
- false,
2625
- embedcode);
2626
- }
2627
- else
2628
- {
2629
- send_to_editor(embedcode);
2630
- }
2631
- }
2632
- else
2633
- {
2634
- embedcode = embedcode.replace('<p>', '\n').replace('</p>', '\n');
2635
- if (typeof QTags.insertContent === 'function')
2636
- {
2637
- QTags.insertContent(embedcode);
2638
- }
2639
- else
2640
- {
2641
- send_to_editor(embedcode);
2642
- }
2643
- }
2644
- tb_remove();
2645
- }
2646
- }
2647
- catch (err)
2648
- {
2649
-
2650
- }
2651
-
2652
-
2653
- }, false);</script>
2654
- <?php
2655
- }
2656
- }
2657
-
2658
  public static function ytprefs_show_options()
2659
  {
2660
-
2661
  if (!current_user_can('manage_options'))
2662
  {
2663
  wp_die(__('You do not have sufficient permissions to access this page.'));
@@ -2710,6 +2682,8 @@ class YouTubePrefs
2710
  $new_options[self::$opt_widgetfit] = self::postchecked(self::$opt_widgetfit) ? 1 : 0;
2711
  $new_options[self::$opt_evselector_light] = self::postchecked(self::$opt_evselector_light) ? 1 : 0;
2712
  $new_options[self::$opt_stop_mobile_buffer] = self::postchecked(self::$opt_stop_mobile_buffer) ? 1 : 0;
 
 
2713
  $new_options[self::$opt_defaultdims] = self::postchecked(self::$opt_defaultdims) ? 1 : 0;
2714
  $new_options[self::$opt_defaultvol] = self::postchecked(self::$opt_defaultvol) ? 1 : 0;
2715
  $new_options[self::$opt_dohl] = self::postchecked(self::$opt_dohl) ? 1 : 0;
@@ -2721,6 +2695,19 @@ class YouTubePrefs
2721
  $new_options[self::$opt_gallery_customarrows] = self::postchecked(self::$opt_gallery_customarrows) ? 1 : 0;
2722
  $new_options[self::$opt_gallery_collapse_grid] = self::postchecked(self::$opt_gallery_collapse_grid) ? 1 : 0;
2723
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2724
  $_defaultwidth = '';
2725
  try
2726
  {
@@ -2956,6 +2943,8 @@ class YouTubePrefs
2956
  #boxcustomarrows {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_gallery_customarrows] ? 'display: block;' : 'display: none;' ?>}
2957
  #boxchannelsub {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_gallery_channelsub] ? 'display: block;' : 'display: none;' ?>}
2958
  #box_collapse_grid {font-weight: bold; padding: 0px 10px; <?php echo isset($all[self::$opt_gallery_collapse_grid]) && $all[self::$opt_gallery_collapse_grid] ? 'display: block;' : 'display: none;' ?>}
 
 
2959
  .textinput {border-width: 2px !important;}
2960
  h3.sect {border-radius: 10px; background-color: #D9E9F7; padding: 5px 5px 5px 10px; position: relative; font-weight: bold;}
2961
  h3.sect a {text-decoration: none; color: #E20000;}
@@ -3045,6 +3034,26 @@ class YouTubePrefs
3045
  </p>
3046
 
3047
  <div class="ytindent chx">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3048
  <p>
3049
  <input name="<?php echo self::$opt_glance; ?>" id="<?php echo self::$opt_glance; ?>" <?php checked($all[self::$opt_glance], 1); ?> type="checkbox" class="checkbox">
3050
  <label for="<?php echo self::$opt_glance; ?>"><?php _e('<b class="chktitle">At a glance:</b> Show "At a Glance" Embed Links on the dashboard homepage.') ?></label>
@@ -3375,6 +3384,13 @@ class YouTubePrefs
3375
  Autoplay works for desktop, but mobile devices don't allow autoplay due to network carrier data charges. For mobile devices, this option may help the player to properly display the video for the visitor to click on.
3376
  </label>
3377
  </p>
 
 
 
 
 
 
 
3378
  <p>
3379
  <input name="<?php echo self::$opt_debugmode; ?>" id="<?php echo self::$opt_debugmode; ?>" <?php checked($all[self::$opt_debugmode], 1); ?> type="checkbox" class="checkbox">
3380
  <label for="<?php echo self::$opt_debugmode; ?>">
@@ -3425,7 +3441,7 @@ class YouTubePrefs
3425
  <p>
3426
  <input name="<?php echo self::$opt_gallery_collapse_grid; ?>" id="<?php echo self::$opt_gallery_collapse_grid; ?>" <?php checked($all[self::$opt_gallery_collapse_grid], 1); ?> type="checkbox" class="checkbox">
3427
  <label for="<?php echo self::$opt_gallery_collapse_grid; ?>">
3428
- <b class="chktitle">Stack Thumbnails for Mobile:</b> <sup class="orange">NEW</sup> Check this option to responsively stack thumbnails on smaller screens, for the grid layout.
3429
  </label>
3430
  <span id="box_collapse_grid">
3431
  <?php
@@ -3777,8 +3793,7 @@ class YouTubePrefs
3777
  if (jQuery(this).is(":checked"))
3778
  {
3779
  jQuery("#boxdefaultdims").show(500);
3780
- }
3781
- else
3782
  {
3783
  jQuery("#boxdefaultdims").hide(500);
3784
  }
@@ -3789,8 +3804,7 @@ class YouTubePrefs
3789
  if (jQuery(this).is(":checked"))
3790
  {
3791
  jQuery("#boxcustomarrows").show(500);
3792
- }
3793
- else
3794
  {
3795
  jQuery("#boxcustomarrows").hide(500);
3796
  }
@@ -3801,19 +3815,28 @@ class YouTubePrefs
3801
  if (jQuery(this).is(":checked"))
3802
  {
3803
  jQuery("#box_collapse_grid").show(500);
3804
- }
3805
- else
3806
  {
3807
  jQuery("#box_collapse_grid").hide(500);
3808
  }
3809
  });
 
 
 
 
 
 
 
 
 
 
 
3810
  jQuery('#<?php echo self::$opt_gallery_channelsub; ?>').change(function ()
3811
  {
3812
  if (jQuery(this).is(":checked"))
3813
  {
3814
  jQuery("#boxchannelsub").show(500);
3815
- }
3816
- else
3817
  {
3818
  jQuery("#boxchannelsub").hide(500);
3819
  }
@@ -3824,8 +3847,7 @@ class YouTubePrefs
3824
  if (jQuery(this).is(":checked"))
3825
  {
3826
  jQuery("#boxresponsive_all").show(500);
3827
- }
3828
- else
3829
  {
3830
  jQuery("#boxresponsive_all").hide(500);
3831
  }
@@ -3835,8 +3857,7 @@ class YouTubePrefs
3835
  if (jQuery(this).is(":checked"))
3836
  {
3837
  jQuery("#boxmigratelist").show(500);
3838
- }
3839
- else
3840
  {
3841
  jQuery("#boxmigratelist").hide(500);
3842
  }
@@ -3846,8 +3867,7 @@ class YouTubePrefs
3846
  if (jQuery(this).is(":checked"))
3847
  {
3848
  jQuery("#boxnocookie").show(500);
3849
- }
3850
- else
3851
  {
3852
  jQuery("#boxnocookie").hide(500);
3853
  }
@@ -3858,8 +3878,7 @@ class YouTubePrefs
3858
  if (jQuery(this).is(":checked"))
3859
  {
3860
  jQuery("#boxdefaultvol").show(500);
3861
- }
3862
- else
3863
  {
3864
  jQuery("#boxdefaultvol").hide(500);
3865
  }
@@ -3877,8 +3896,7 @@ class YouTubePrefs
3877
  $('.vol-output').css("display", "inline-block").text($("input#vol").val() > 0 ? $("input#vol").val() + '%' : 'Mute');
3878
  $('.vol-seeslider').show();
3879
  $('.vol-seetextbox').hide();
3880
- }
3881
- else
3882
  {
3883
  $("input#vol").width(40);
3884
  }
@@ -3965,6 +3983,7 @@ class YouTubePrefs
3965
  'epdovol' => true,
3966
  'version' => self::$alloptions[self::$opt_version],
3967
  'evselector' => self::get_evselector(),
 
3968
  'stopMobileBuffer' => self::$alloptions[self::$opt_stop_mobile_buffer] == '1' ? true : false
3969
  );
3970
 
@@ -4021,7 +4040,6 @@ class YouTubePrefs
4021
  public static function admin_enqueue_scripts($hook)
4022
  {
4023
  wp_enqueue_style('embedplusyoutube', plugins_url() . '/youtube-embed-plus/scripts/embedplus_mce' . self::$min . '.css');
4024
- ////////////////// add_action('wp_print_scripts', array(get_class(), 'output_scriptvars'));
4025
  wp_enqueue_script('__ytprefs_admin__', plugins_url('scripts/ytprefs-admin' . self::$min . '.js', __FILE__), array('jquery'), self::$version, false);
4026
  $admin_script_vars = array(
4027
  'wpajaxurl' => admin_url('admin-ajax.php')
3
  Plugin Name: YouTube
4
  Plugin URI: http://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx
5
  Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
6
+ Version: 11.8
7
  Author: EmbedPlus Team
8
  Author URI: http://www.embedplus.com
9
  */
33
  {
34
 
35
  public static $curltimeout = 20;
36
+ public static $version = '11.8';
37
  public static $opt_version = 'version';
38
  public static $optembedwidth = null;
39
  public static $optembedheight = null;
70
  public static $opt_widgetfit = 'widgetfit';
71
  public static $opt_evselector_light = 'evselector_light';
72
  public static $opt_stop_mobile_buffer = 'stop_mobile_buffer';
73
+ public static $opt_restrict_wizard = 'restrict_wizard';
74
+ public static $opt_restrict_wizard_roles = 'restrict_wizard_roles';
75
+ public static $opt_ajax_compat = 'ajax_compat';
76
  public static $opt_defaultdims = 'defaultdims';
77
  public static $opt_defaultwidth = 'width';
78
  public static $opt_defaultheight = 'height';
104
  public static $alloptions = null;
105
  public static $yt_options = array();
106
  public static $dft_bpts = array(array('bp' => array('min' => 0, 'max' => 767), 'cols' => 1));
107
+ public static $dft_roles = array('administrator', 'editor', 'author', 'contributor', 'subscriber');
108
  //public static $epbase = 'http://localhost:2346';
109
  public static $epbase = '//www.embedplus.com';
110
  public static $double_plugin = false;
660
  <?php
661
  }
662
  ?>
663
+ <p>
664
+ <strong>Is your live stream not working?</strong> According to Google/YouTube rules, there must be an active AdSense account that's connected to the live
665
+ stream's channel (for monetization) in order embed the stream. If you own the channel, we suggest that you attach an AdSense account. Otherwise, you will
666
+ likely just see a blank screen when you embed your stream, even if it is visible on YouTube.com.
667
+ Read more here: <a href="https://support.google.com/youtube/answer/2474026?hl=en" target="_blank">https://support.google.com/youtube/answer/2474026?hl=en</a>
668
+ </p>
669
  </div>
670
  <?php
671
  }
800
  </div>
801
  <h3 id="h3_live"><a href="#">Embed a live stream. <sup class="orange">NEW</sup> </a></h3>
802
  <div>
803
+ <h4 class="center">Live stream directions (<a href="https://www.youtube.com/watch?v=dEQMTUke48E" target="_blank">Video tutorial here &raquo;</a>)</h4>
804
  <?php
805
  if (!self::has_api_key())
806
  {
816
  <li><small>(If you do not know the exact channel URL, enter in the URL to any single video that belongs to that channel, to automatically retrieve the channel URL. Example: https://www.youtube.com/watch?v=fIW8Vvfbojc )</small></li>
817
  </ul>
818
  </li>
819
+ <li>On the YouTube plugin admin settings page, enter in the "Default Not Live Content" field what content should display while your channel is <em>not</em> currently streaming.
820
  </li>
821
  </ol>
822
  <form name="wizform_live" method="post" action="" class="wizform" id="wizform_live">
1151
  if (response.type === "success") {
1152
  $accbox.html(response.data),
1153
  $accbox.show(400);
1154
+ } else {
 
1155
  }
1156
  },
1157
  error: function (xhr, ajaxOptions, thrownError) {
1270
  else
1271
  {
1272
  $thehtml .= '<p class="center bold orange">This <a target="_blank" href="' . $postlink . '">post/page</a> contains a video that has been removed from YouTube.';
1273
+ $thehtml .= '<br><a target="_blank" href="https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx">Activate delete video tracking to catch these cases &raquo;</a>';
1274
  $thehtml .= '</strong>';
1275
  }
1276
  }
1302
  else
1303
  {
1304
  $thehtml .= '<p class="center bold orange">This <a target="_blank" href="' . $postlink . '">post/page</a> contains a video that has been removed from YouTube.';
1305
+ $thehtml .= '<br><a target="_blank" href="https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx">Activate delete video tracking to catch these cases &raquo;</a>';
1306
  $thehtml .= '</strong>';
1307
  }
1308
  }
1372
  die();
1373
  }
1374
 
1375
+ public static function user_in_roles_any($user, $roles)
1376
+ {
1377
+ foreach ($user->roles as $idx => $r)
1378
+ {
1379
+ if (in_array($r, $roles))
1380
+ {
1381
+ return true;
1382
+ }
1383
+ }
1384
+ return false;
1385
+ }
1386
+
1387
  public static function media_button_wizard()
1388
  {
1389
+ $curr_user = wp_get_current_user();
1390
+ if (
1391
+ $curr_user->ID // logged in
1392
+ && isset(self::$alloptions[self::$opt_restrict_wizard]) && self::$alloptions[self::$opt_restrict_wizard] == 1 // restricting
1393
+ && is_array(self::$alloptions[self::$opt_restrict_wizard_roles]) && !self::user_in_roles_any($curr_user, self::$alloptions[self::$opt_restrict_wizard_roles])
1394
+ )
1395
+ {
1396
+ return;
1397
+ }
1398
+
1399
  add_thickbox();
1400
 
1401
  $wizhref = admin_url('admin.php?page=youtube-ep-wizard') .
1510
  version: "<?php echo self::$alloptions[self::$opt_version] ?>",
1511
  epdovol: true,
1512
  evselector: '<?php echo self::get_evselector(); ?>',
1513
+ ajax_compat: <?php echo self::$alloptions[self::$opt_ajax_compat] == '1' ? 'true' : 'false' ?>,
1514
  stopMobileBuffer: <?php echo self::$alloptions[self::$opt_stop_mobile_buffer] == '1' ? 'true' : 'false' ?>
1515
  };</script>
1516
  <?php
1568
  $_widgetfit = 1;
1569
  $_evselector_light = 0;
1570
  $_stop_mobile_buffer = 1;
1571
+ $_restrict_wizard = 0;
1572
+ $_restrict_wizard_roles = self::$dft_roles;
1573
+ $_ajax_compat = 0;
1574
  $_defaultdims = 0;
1575
  $_defaultwidth = '';
1576
  $_defaultheight = '';
1630
  $_widgetfit = self::tryget($arroptions, self::$opt_widgetfit, 1);
1631
  $_evselector_light = self::tryget($arroptions, self::$opt_evselector_light, 0);
1632
  $_stop_mobile_buffer = self::tryget($arroptions, self::$opt_stop_mobile_buffer, 1);
1633
+ $_restrict_wizard = self::tryget($arroptions, self::$opt_restrict_wizard, 0);
1634
+ $_restrict_wizard_roles = self::tryget($arroptions, self::$opt_restrict_wizard_roles, self::$dft_roles);
1635
+ $_ajax_compat = self::tryget($arroptions, self::$opt_ajax_compat, 0);
1636
  $_defaultdims = self::tryget($arroptions, self::$opt_defaultdims, 0);
1637
  $_defaultwidth = self::tryget($arroptions, self::$opt_defaultwidth, '');
1638
  $_defaultheight = self::tryget($arroptions, self::$opt_defaultheight, '');
1696
  self::$opt_widgetfit => $_widgetfit,
1697
  self::$opt_evselector_light => $_evselector_light,
1698
  self::$opt_stop_mobile_buffer => $_stop_mobile_buffer,
1699
+ self::$opt_restrict_wizard => $_restrict_wizard,
1700
+ self::$opt_restrict_wizard_roles => $_restrict_wizard_roles,
1701
+ self::$opt_ajax_compat => $_ajax_compat,
1702
  self::$opt_defaultdims => $_defaultdims,
1703
  self::$opt_defaultwidth => $_defaultwidth,
1704
  self::$opt_defaultheight => $_defaultheight,
1947
 
1948
  if (isset($jsonResult->items) && $jsonResult->items != null && is_array($jsonResult->items))
1949
  {
1950
+ // sort items
1951
+ usort($jsonResult->items, array(get_class(), 'compare_vid_date')); // sorts in place
1952
+
1953
  foreach ($jsonResult->items as $item)
1954
  {
1955
 
2049
  return $gallobj;
2050
  }
2051
 
2052
+ public static function compare_vid_date($a, $b)
2053
+ {
2054
+ if ($a->snippet->publishedAt == $b->snippet->publishedAt)
2055
+ {
2056
+ return 0;
2057
+ }
2058
+ return ($a->snippet->publishedAt > $b->snippet->publishedAt) ? -1 : 1;
2059
+ }
2060
+
2061
  public static function get_thumbnail_html($thumb, $options)
2062
  {
2063
  $escId = esc_attr($thumb->id);
2285
  $videoidoutput = isset($gallery_page_obj->init_id) ? $gallery_page_obj->init_id : '';
2286
  }
2287
 
2288
+ if (!empty($voloutput) && isset($finalparams['autoplay']) && $finalparams['autoplay'] == 1)
2289
+ {
2290
+ $voloutput .= ' data-epautoplay="1" ';
2291
+ $finalparams['autoplay'] = 0;
2292
+ }
2293
 
2294
  $code1 = '<iframe ' . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight .
2295
  '" src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
2540
  {
2541
  //ep_do_pointers($j);
2542
  }
2543
+ } else {
 
2544
  }
2545
  },
2546
  error: function (xhr, ajaxOptions, thrownError) {
2604
  $new_pointer_content .= '<p>'; // ooopointer
2605
  if (!(self::$alloptions[self::$opt_pro] && strlen(trim(self::$alloptions[self::$opt_pro])) > 0))
2606
  {
2607
+ $new_pointer_content .= __("This update includes role settings for the wizard, improved AJAX theme compatibility, and many more bug fixes for the Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions &raquo;</a>");
2608
  }
2609
  else
2610
  {
2611
+ $new_pointer_content .= __("This update includes role settings for the wizard, improved AJAX theme compatibility, and many more bug fixes for the Free and Pro versions. " . '<strong>Important message to YouTube Pro users</strong>: From version 11.7 onward, you must <a href="https://www.embedplus.com/youtube-pro/download/?prokey=' . esc_attr(self::$alloptions[self::$opt_pro]) . '" target="_blank">download the separate plugin here</a> to regain your Pro features. All your settings will automatically migrate after installing the separate Pro download. Thank you for your support and patience during this transition.');
2612
  }
2613
  $new_pointer_content .= '</p>';
2614
 
2628
  return isset($_POST[$idx]) && $_POST[$idx] == (true || 'on');
2629
  }
2630
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2631
  public static function ytprefs_show_options()
2632
  {
 
2633
  if (!current_user_can('manage_options'))
2634
  {
2635
  wp_die(__('You do not have sufficient permissions to access this page.'));
2682
  $new_options[self::$opt_widgetfit] = self::postchecked(self::$opt_widgetfit) ? 1 : 0;
2683
  $new_options[self::$opt_evselector_light] = self::postchecked(self::$opt_evselector_light) ? 1 : 0;
2684
  $new_options[self::$opt_stop_mobile_buffer] = self::postchecked(self::$opt_stop_mobile_buffer) ? 1 : 0;
2685
+ $new_options[self::$opt_restrict_wizard] = self::postchecked(self::$opt_restrict_wizard) ? 1 : 0;
2686
+ $new_options[self::$opt_ajax_compat] = self::postchecked(self::$opt_ajax_compat) ? 1 : 0;
2687
  $new_options[self::$opt_defaultdims] = self::postchecked(self::$opt_defaultdims) ? 1 : 0;
2688
  $new_options[self::$opt_defaultvol] = self::postchecked(self::$opt_defaultvol) ? 1 : 0;
2689
  $new_options[self::$opt_dohl] = self::postchecked(self::$opt_dohl) ? 1 : 0;
2695
  $new_options[self::$opt_gallery_customarrows] = self::postchecked(self::$opt_gallery_customarrows) ? 1 : 0;
2696
  $new_options[self::$opt_gallery_collapse_grid] = self::postchecked(self::$opt_gallery_collapse_grid) ? 1 : 0;
2697
 
2698
+
2699
+ $_restrict_wizard_roles = self::$dft_roles;
2700
+ try
2701
+ {
2702
+ $_restrict_wizard_roles = is_array($_POST[self::$opt_restrict_wizard_roles]) ? $_POST[self::$opt_restrict_wizard_roles] : $_restrict_wizard_roles;
2703
+ }
2704
+ catch (Exception $ex)
2705
+ {
2706
+
2707
+ }
2708
+ $new_options[self::$opt_restrict_wizard_roles] = $_restrict_wizard_roles;
2709
+
2710
+
2711
  $_defaultwidth = '';
2712
  try
2713
  {
2943
  #boxcustomarrows {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_gallery_customarrows] ? 'display: block;' : 'display: none;' ?>}
2944
  #boxchannelsub {font-weight: bold; padding: 0px 10px; <?php echo $all[self::$opt_gallery_channelsub] ? 'display: block;' : 'display: none;' ?>}
2945
  #box_collapse_grid {font-weight: bold; padding: 0px 10px; <?php echo isset($all[self::$opt_gallery_collapse_grid]) && $all[self::$opt_gallery_collapse_grid] ? 'display: block;' : 'display: none;' ?>}
2946
+ #box_restrict_wizard {padding: 0px 10px; <?php echo isset($all[self::$opt_restrict_wizard]) && $all[self::$opt_restrict_wizard] ? 'display: block;' : 'display: none;' ?>}
2947
+ #box_restrict_wizard label {display: block; margin: 5px 10px;}
2948
  .textinput {border-width: 2px !important;}
2949
  h3.sect {border-radius: 10px; background-color: #D9E9F7; padding: 5px 5px 5px 10px; position: relative; font-weight: bold;}
2950
  h3.sect a {text-decoration: none; color: #E20000;}
3034
  </p>
3035
 
3036
  <div class="ytindent chx">
3037
+ <p>
3038
+ <input name="<?php echo self::$opt_restrict_wizard; ?>" id="<?php echo self::$opt_restrict_wizard; ?>" <?php checked($all[self::$opt_restrict_wizard], 1); ?> type="checkbox" class="checkbox">
3039
+ <label for="<?php echo self::$opt_restrict_wizard; ?>">
3040
+ <b class="chktitle">Restrict Wizard Button:</b> <sup class="orange">NEW</sup> Select which roles can use the YouTube wizard button. For example, you may wish to hide the button from contributors submitting content on the front end.
3041
+ </label>
3042
+ <br>
3043
+ <span id="box_restrict_wizard" class="chx">
3044
+ <?php
3045
+ foreach (self::$dft_roles as $idx => $role)
3046
+ {
3047
+ ?>
3048
+ <label>
3049
+ <input type="checkbox" name="<?php echo self::$opt_restrict_wizard_roles . '[]' ?>" value="<?php echo esc_attr($role) ?>" <?php echo in_array($role, $all[self::$opt_restrict_wizard_roles]) ? 'checked' : '' ?>>
3050
+ <?php echo esc_html(ucfirst($role)); ?>s
3051
+ </label>
3052
+ <?php
3053
+ }
3054
+ ?>
3055
+ </span>
3056
+ </p>
3057
  <p>
3058
  <input name="<?php echo self::$opt_glance; ?>" id="<?php echo self::$opt_glance; ?>" <?php checked($all[self::$opt_glance], 1); ?> type="checkbox" class="checkbox">
3059
  <label for="<?php echo self::$opt_glance; ?>"><?php _e('<b class="chktitle">At a glance:</b> Show "At a Glance" Embed Links on the dashboard homepage.') ?></label>
3384
  Autoplay works for desktop, but mobile devices don't allow autoplay due to network carrier data charges. For mobile devices, this option may help the player to properly display the video for the visitor to click on.
3385
  </label>
3386
  </p>
3387
+ <p>
3388
+ <input name="<?php echo self::$opt_ajax_compat; ?>" id="<?php echo self::$opt_ajax_compat; ?>" <?php checked($all[self::$opt_ajax_compat], 1); ?> type="checkbox" class="checkbox">
3389
+ <label for="<?php echo self::$opt_ajax_compat; ?>">
3390
+ <b class="chktitle">Ajax Theme:</b> <sup class="orange">BETA</sup>
3391
+ If you have a theme that loads pages with AJAX transitions, try checking this option.
3392
+ </label>
3393
+ </p>
3394
  <p>
3395
  <input name="<?php echo self::$opt_debugmode; ?>" id="<?php echo self::$opt_debugmode; ?>" <?php checked($all[self::$opt_debugmode], 1); ?> type="checkbox" class="checkbox">
3396
  <label for="<?php echo self::$opt_debugmode; ?>">
3441
  <p>
3442
  <input name="<?php echo self::$opt_gallery_collapse_grid; ?>" id="<?php echo self::$opt_gallery_collapse_grid; ?>" <?php checked($all[self::$opt_gallery_collapse_grid], 1); ?> type="checkbox" class="checkbox">
3443
  <label for="<?php echo self::$opt_gallery_collapse_grid; ?>">
3444
+ <b class="chktitle">Stack Thumbnails for Mobile:</b> Check this option to responsively stack thumbnails on smaller screens, for the grid layout.
3445
  </label>
3446
  <span id="box_collapse_grid">
3447
  <?php
3793
  if (jQuery(this).is(":checked"))
3794
  {
3795
  jQuery("#boxdefaultdims").show(500);
3796
+ } else
 
3797
  {
3798
  jQuery("#boxdefaultdims").hide(500);
3799
  }
3804
  if (jQuery(this).is(":checked"))
3805
  {
3806
  jQuery("#boxcustomarrows").show(500);
3807
+ } else
 
3808
  {
3809
  jQuery("#boxcustomarrows").hide(500);
3810
  }
3815
  if (jQuery(this).is(":checked"))
3816
  {
3817
  jQuery("#box_collapse_grid").show(500);
3818
+ } else
 
3819
  {
3820
  jQuery("#box_collapse_grid").hide(500);
3821
  }
3822
  });
3823
+ jQuery('#<?php echo self::$opt_restrict_wizard; ?>').change(function ()
3824
+ {
3825
+ if (jQuery(this).is(":checked"))
3826
+ {
3827
+ jQuery("#box_restrict_wizard").show(500);
3828
+ } else
3829
+ {
3830
+ jQuery("#box_restrict_wizard").hide(500);
3831
+ }
3832
+ });
3833
+
3834
  jQuery('#<?php echo self::$opt_gallery_channelsub; ?>').change(function ()
3835
  {
3836
  if (jQuery(this).is(":checked"))
3837
  {
3838
  jQuery("#boxchannelsub").show(500);
3839
+ } else
 
3840
  {
3841
  jQuery("#boxchannelsub").hide(500);
3842
  }
3847
  if (jQuery(this).is(":checked"))
3848
  {
3849
  jQuery("#boxresponsive_all").show(500);
3850
+ } else
 
3851
  {
3852
  jQuery("#boxresponsive_all").hide(500);
3853
  }
3857
  if (jQuery(this).is(":checked"))
3858
  {
3859
  jQuery("#boxmigratelist").show(500);
3860
+ } else
 
3861
  {
3862
  jQuery("#boxmigratelist").hide(500);
3863
  }
3867
  if (jQuery(this).is(":checked"))
3868
  {
3869
  jQuery("#boxnocookie").show(500);
3870
+ } else
 
3871
  {
3872
  jQuery("#boxnocookie").hide(500);
3873
  }
3878
  if (jQuery(this).is(":checked"))
3879
  {
3880
  jQuery("#boxdefaultvol").show(500);
3881
+ } else
 
3882
  {
3883
  jQuery("#boxdefaultvol").hide(500);
3884
  }
3896
  $('.vol-output').css("display", "inline-block").text($("input#vol").val() > 0 ? $("input#vol").val() + '%' : 'Mute');
3897
  $('.vol-seeslider').show();
3898
  $('.vol-seetextbox').hide();
3899
+ } else
 
3900
  {
3901
  $("input#vol").width(40);
3902
  }
3983
  'epdovol' => true,
3984
  'version' => self::$alloptions[self::$opt_version],
3985
  'evselector' => self::get_evselector(),
3986
+ 'ajax_compat' => self::$alloptions[self::$opt_ajax_compat] == '1' ? true : false,
3987
  'stopMobileBuffer' => self::$alloptions[self::$opt_stop_mobile_buffer] == '1' ? true : false
3988
  );
3989
 
4040
  public static function admin_enqueue_scripts($hook)
4041
  {
4042
  wp_enqueue_style('embedplusyoutube', plugins_url() . '/youtube-embed-plus/scripts/embedplus_mce' . self::$min . '.css');
 
4043
  wp_enqueue_script('__ytprefs_admin__', plugins_url('scripts/ytprefs-admin' . self::$min . '.js', __FILE__), array('jquery'), self::$version, false);
4044
  $admin_script_vars = array(
4045
  'wpajaxurl' => admin_url('admin-ajax.php')