YouTube Embed - Version 4.1

Version Description

  • Enhancement: Added 'Plays inline' option for iOS devices.
  • Enhancement: Added extra Closed Caption option to better reflect how YouTube works - either on, off, or user default.
  • Enhancement: Added new option to force HTML5 playback (if available). This is an undocumented feature and, as such, may not actually work, depending on YouTube's current mood. If YouTube aren't going to support it then I'm certainly not going to so please don't shout if it doesn't work.
  • Enhancement: Lovely new icons for the lists page.
  • Enhancement: Improved the layout of the demo video on the profiles page.
  • Enhancement: Added a count to the profiles and lists screen to indicate how many are set up. Also showed on drop-down which of the profiles/lists are not defined.
  • Enhancement: Changes made to add compatibility with a3 lazy load.
  • Enhancement: Removed the caching - it created the output up to 3 times quicker but when that's 0.005 seconds it's not worth the hassle that comes with it. I started making performance improvements to compensate then realised it was such a big change that it would be best spun off as it's own seperate update - version 4.2. Look out for it.
  • Enhancement: Removed limitation of only being able to display up to 30 lists or profiles.
  • Enhancement: When you can select a profile from another screen (e.g. defining a profile to an alternative shortcode) then only defined profiles will be listed.
  • Enhancement: Added general option to specify the YouTube interface language as well as to suppress debug output in the resulting code.
  • Enhancement: Fixed validation errors against thumbnails.
  • Enhancement: Changed the "Frameborder" option to a more general "Improve Validation" which does, well, just that. It improves the generated markup so that it will validate better (if that's your bag).
  • Enhancement: Added option to use a third party script to handle content resizing. Implemented iFrame Resizer v3.5.1 and FitVids.js 1.1.
  • Enhancement: If another plugin is using the same shortcode as this I now output a prompt in the admin area. Also added a setting to turn off this prompt just in case you're using the secondary shortcode and are happy for this.
  • Enhancement: Re-written code for help screens, including adding more information and additional tabs.
  • Maintenance: Moved the settings page to, well, the Settings menu option. It makes sense.
  • Maintenence: Removed the enable of the JS API, which is now deprecated.
  • Maintenance: Improved the admin screen output code - had made it more WordPress standard in version 4 but got some of the code wrong.
Download this release

Release Info

Developer dartiss
Plugin Icon 128x128 YouTube Embed
Version 4.1
Comparing to
See all releases

Code changes from version 4.0.2 to 4.1

images/cross.png CHANGED
Binary file
images/tick.png CHANGED
Binary file
includes/add-scripts.php CHANGED
@@ -17,7 +17,7 @@ if ( !is_admin() ) {
17
  /**
18
  * Plugin initialisation
19
  *
20
- * Loads the plugin's translated strings and the plugins' JavaScript
21
  *
22
  * @since 2.5.5
23
  */
@@ -117,4 +117,113 @@ function vye_admin_bar_render( $meta = TRUE ) {
117
  }
118
 
119
  add_action( 'admin_bar_menu', 'vye_admin_bar_render', 99 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  ?>
17
  /**
18
  * Plugin initialisation
19
  *
20
+ * Loads the plugin's translated strings
21
  *
22
  * @since 2.5.5
23
  */
117
  }
118
 
119
  add_action( 'admin_bar_menu', 'vye_admin_bar_render', 99 );
120
+
121
+ /**
122
+ * Add to site header
123
+ *
124
+ * Perform main site head processing
125
+ *
126
+ * @uses youtube_embed_head_checks Perform the actual checks
127
+ *
128
+ * @since 4.1
129
+ */
130
+
131
+ function youtube_embed_add_to_head() {
132
+
133
+ youtube_embed_shortcode_checks( 'site' );
134
+
135
+ $options = vye_set_general_defaults();
136
+
137
+ if ( $options[ 'script' ] == 'f' ) {
138
+
139
+ $tab = "\t";
140
+ $newline = "\n";
141
+
142
+ echo '<script type="text/javascript" src="' . plugins_url() . '/youtube-embed/js/jquery.fitvids.js"></script>' . $newline;
143
+ echo '<script>' . $newline;
144
+ echo $tab . '$(".youtube-embed").fitVids();' . $newline;
145
+ echo '</script>' . $newline;
146
+
147
+ }
148
+
149
+ if ( $options[ 'script' ] == 'i' ) {
150
+ wp_enqueue_script( 'youtube-embed-iframe-resizer', plugins_url() . '/youtube-embed/js/iframeResizer.min.js' );
151
+ }
152
+ }
153
+
154
+ add_action( 'wp_head', 'youtube_embed_add_to_head' );
155
+
156
+ /**
157
+ * Admin Head Checks
158
+ *
159
+ * Perform admin head processing
160
+ *
161
+ * @uses youtube_embed_head_checks Perform the actual checks
162
+ *
163
+ * @since 4.1
164
+ */
165
+
166
+ function youtube_embed_admin_head_checks() {
167
+
168
+ youtube_embed_shortcode_checks( 'admin' );
169
+
170
+ }
171
+
172
+
173
+ add_action( 'admin_head', 'youtube_embed_admin_head_checks' );
174
+
175
+ /**
176
+ * Shortcode Checking
177
+ *
178
+ * Check if the shortcode is in use by another plugin. If so, note it
179
+ * in the options.
180
+ *
181
+ * @param string $source Where the checks are coming from
182
+ *
183
+ * @since 4.1
184
+ */
185
+
186
+ function youtube_embed_shortcode_checks( $source ) {
187
+
188
+ global $shortcode_tags;
189
+ if ( isset( $shortcode_tags[ 'youtube' ] ) ) {
190
+ $shortcode_usage = $shortcode_tags[ 'youtube' ];
191
+ } else {
192
+ $shortcode_usage = '';
193
+ }
194
+
195
+ $shortcode = 1;
196
+
197
+ // All is fine
198
+
199
+ if ( substr( $shortcode_usage, 0, 20 ) == 'vye_video_shortcode_' ) {
200
+
201
+ $shortcode = 0;
202
+
203
+ } else {
204
+
205
+ // Jetpack is overriding
206
+
207
+ if ( $shortcode_usage == 'youtube_shortcode' ) {
208
+
209
+ $shortcode = 2;
210
+
211
+ } else {
212
+
213
+ // If the shortcode is empty, it's fine in admin but elsewhere
214
+ // is another fail.
215
+
216
+ if ( $shortcode_usage == '' ) {
217
+
218
+ if ( $source == 'admin' ) {
219
+ $shortcode = 0;
220
+ } else {
221
+ $shortcode = 3;
222
+ }
223
+ }
224
+ }
225
+ }
226
+
227
+ update_option( 'youtube_embed_shortcode_' . $source, $shortcode );
228
+ }
229
  ?>
includes/admin-config.php CHANGED
@@ -83,21 +83,13 @@ function vye_menu_initialise() {
83
 
84
  $menu_icon = 'dashicons-video-alt3';
85
 
86
- add_menu_page( __( 'About YouTube Embed', 'youtube-embed' ), __( 'YouTube', 'youtube-embed' ), $menu_access, 'ye-general-options', 'vye_general_options', $menu_icon, 12 );
87
-
88
- // Add options sub-menu
89
-
90
- global $vye_options_hook;
91
-
92
- $vye_options_hook = add_submenu_page( 'ye-general-options', __( 'YouTube Embed Options', 'youtube-embed' ), __( 'Options', 'youtube-embed' ), $menu_access, 'ye-general-options', 'vye_general_options' );
93
-
94
- add_action( 'load-' . $vye_options_hook, 'vye_add_options_help' );
95
 
96
  // Add profiles sub-menu
97
 
98
  global $vye_profiles_hook;
99
 
100
- $vye_profiles_hook = add_submenu_page( 'ye-general-options', __( 'YouTube Embed Profiles', 'youtube-embed' ), __( 'Profiles', 'youtube-embed' ), $menu_access, 'ye-profile-options', 'vye_profile_options' );
101
 
102
  add_action( 'load-' . $vye_profiles_hook, 'vye_add_profiles_help' );
103
 
@@ -105,10 +97,18 @@ function vye_menu_initialise() {
105
 
106
  global $vye_lists_hook;
107
 
108
- $vye_lists_hook = add_submenu_page( 'ye-general-options', __( 'YouTube Embed Lists', 'youtube-embed' ), __( 'Lists', 'youtube-embed' ), $menu_access, 'ye-list-options', 'vye_list_options' );
109
 
110
  add_action( 'load-' . $vye_lists_hook, 'vye_add_lists_help' );
111
 
 
 
 
 
 
 
 
 
112
  }
113
 
114
  add_action( 'admin_menu', 'vye_menu_initialise' );
@@ -172,28 +172,9 @@ function vye_add_options_help() {
172
 
173
  if ( $screen->id != $vye_options_hook ) { return; }
174
 
175
- $screen -> add_help_tab( array( 'id' => 'options-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => vye_options_help() ) );
176
- }
177
 
178
- /**
179
- * Options Help
180
- *
181
- * Return help text for options screen
182
- *
183
- * @since 2.5
184
- *
185
- * @return string Help Text
186
- */
187
-
188
- function vye_options_help() {
189
-
190
- $help_text = '<p>' . __( 'This screen allows you to select non-specific options for the YouTube Embed plugin. For the default embedding settings, please select the <a href="admin.php?page=ye-profile-options">Profiles</a> administration option.', 'youtube-embed' ) . '</p>';
191
- $help_text .= '<p>' . __( 'Remember to click the Save Changes button at the bottom of the screen for new settings to take effect.', 'youtube-embed' ) . '</p>';
192
- $help_text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
193
- $help_text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
194
- $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
195
-
196
- return $help_text;
197
  }
198
 
199
  /**
@@ -213,31 +194,9 @@ function vye_add_profiles_help() {
213
 
214
  if ( $screen->id != $vye_profiles_hook ) { return; }
215
 
216
- $screen -> add_help_tab( array( 'id' => 'profiles-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => vye_profiles_help() ) );
217
- }
218
 
219
- /**
220
- * Profiles Help
221
- *
222
- * Return help text for profiles screen
223
- *
224
- * @since 2.5
225
- *
226
- * @return string Help Text
227
- */
228
-
229
- function vye_profiles_help() {
230
-
231
- $help_text = '<p>' . __( 'This screen allows you to set the options for the default and additional profiles. If you don\'t specify a specific parameter when displaying your YouTube video then the default profile option will be used instead. Additional profiles, which you may name, can be used as well and used as required.', 'youtube-embed' ) . '</p>';
232
- $help_text .= '<p>' . __( 'All settings will work whether the Flash or HTML5 player is used, unless one of the following icons is shown, indicating which format the option works with...', 'youtube-embed' ) . '</p>';
233
- $help_text .= "<p><img src='" . plugins_url() . "/youtube-embed/images/flash.png' width='10px'> - " . __( 'Flash player', 'youtube-embed' ) . '</br>';
234
- $help_text .= "<img src='" . plugins_url() . "/youtube-embed/images/html5.png' width='10px'> - " . __( 'HTML5 player', 'youtube-embed' ) . '</br>';
235
- $help_text .= '<p>' . __( 'Remember to click the Save Changes button at the bottom of the screen for new settings to take effect.', 'youtube-embed' ) . '</p>';
236
- $help_text .= '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
237
- $help_text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
238
- $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
239
-
240
- return $help_text;
241
  }
242
 
243
  /**
@@ -257,28 +216,66 @@ function vye_add_lists_help() {
257
 
258
  if ( $screen->id != $vye_lists_hook ) { return; }
259
 
260
- $screen -> add_help_tab( array( 'id' => 'lists-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => vye_lists_help() ) );
 
 
261
  }
262
 
263
  /**
264
- * List Help
265
  *
266
- * Return help text for lists screen
267
  *
268
- * @since 2.5
269
  *
270
- * @return string Help Text
 
 
271
  */
272
 
273
- function vye_lists_help() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
 
275
- $help_text = '<p>' . __( 'This screen allows you to create lists of YouTube videos, which may be named. These lists can then be used in preference to a single video ID.', 'youtube-embed' ) . '</p>';
276
- $help_text .= '<p>' . __( 'Remember to click the Save Changes button at the bottom of the screen for new settings to take effect.', 'youtube-embed' ) . '</p>';
277
- $help_text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
278
- $help_text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
279
- $help_text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
280
 
281
- return $help_text;
 
 
 
 
 
 
 
 
 
 
 
282
  }
283
 
284
  /**
@@ -344,4 +341,47 @@ function add_youtube_embed_mce_plugin( $plugin_array ) {
344
 
345
  return $plugin_array;
346
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
  ?>
83
 
84
  $menu_icon = 'dashicons-video-alt3';
85
 
86
+ add_menu_page( __( 'About YouTube Embed', 'youtube-embed' ), __( 'YouTube', 'youtube-embed' ), $menu_access, 'ye-profile-options', 'vye_profile_options', $menu_icon, 12 );
 
 
 
 
 
 
 
 
87
 
88
  // Add profiles sub-menu
89
 
90
  global $vye_profiles_hook;
91
 
92
+ $vye_profiles_hook = add_submenu_page( 'ye-profile-options', __( 'YouTube Embed Profiles', 'youtube-embed' ), __( 'Profiles', 'youtube-embed' ), $menu_access, 'ye-profile-options', 'vye_profile_options' );
93
 
94
  add_action( 'load-' . $vye_profiles_hook, 'vye_add_profiles_help' );
95
 
97
 
98
  global $vye_lists_hook;
99
 
100
+ $vye_lists_hook = add_submenu_page( 'ye-profile-options', __( 'YouTube Embed Lists', 'youtube-embed' ), __( 'Lists', 'youtube-embed' ), $menu_access, 'ye-list-options', 'vye_list_options' );
101
 
102
  add_action( 'load-' . $vye_lists_hook, 'vye_add_lists_help' );
103
 
104
+ // Add options sub-menu
105
+
106
+ global $vye_options_hook;
107
+
108
+ $vye_options_hook = add_submenu_page( 'options-general.php', __( 'YouTube Embed Options', 'youtube-embed' ), __( 'YouTube Embed', 'youtube-embed' ), $menu_access, 'ye-general-options', 'vye_general_options' );
109
+
110
+ add_action( 'load-' . $vye_options_hook, 'vye_add_options_help' );
111
+
112
  }
113
 
114
  add_action( 'admin_menu', 'vye_menu_initialise' );
172
 
173
  if ( $screen->id != $vye_options_hook ) { return; }
174
 
175
+ $screen -> add_help_tab( array( 'id' => 'options-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => youtube_embed_help( 'options' ) ) );
 
176
 
177
+ $screen -> add_help_tab( array( 'id' => 'options-links-tab', 'title' => __( 'Links', 'youtube-embed' ), 'content' => youtube_embed_help( 'options', 'links' ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  }
179
 
180
  /**
194
 
195
  if ( $screen->id != $vye_profiles_hook ) { return; }
196
 
197
+ $screen -> add_help_tab( array( 'id' => 'profiles-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => youtube_embed_help( 'profiles' ) ) );
 
198
 
199
+ $screen -> add_help_tab( array( 'id' => 'profiles-links-tab', 'title' => __( 'Links', 'youtube-embed' ), 'content' => youtube_embed_help( 'profiles', 'links' ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  }
201
 
202
  /**
216
 
217
  if ( $screen->id != $vye_lists_hook ) { return; }
218
 
219
+ $screen -> add_help_tab( array( 'id' => 'lists-help-tab', 'title' => __( 'Help', 'youtube-embed' ), 'content' => youtube_embed_help( 'lists' ) ) );
220
+
221
+ $screen -> add_help_tab( array( 'id' => 'lists-links-tab', 'title' => __( 'Links', 'youtube-embed' ), 'content' => youtube_embed_help( 'lists', 'links' ) ) );
222
  }
223
 
224
  /**
225
+ * Help Screens
226
  *
227
+ * Generate help screen text
228
  *
229
+ * @since 4.1
230
  *
231
+ * @param string $screen Which help screen to return text for
232
+ * @param string $tab Which tab of the help this is for
233
+ * @return string Help Text
234
  */
235
 
236
+ function youtube_embed_help( $screen, $tab = 'help' ) {
237
+
238
+ $text = '';
239
+
240
+ if ( ( $screen == 'options' ) && ( $tab == 'help' ) ) {
241
+
242
+ $text .= '<p>' . __( 'This screen allows you to select non-specific options for the YouTube Embed plugin. For the default embedding settings, please select the <a href="admin.php?page=ye-profile-options">Profiles</a> administration option.', 'youtube-embed' ) . '</p>';
243
+ }
244
+
245
+ if ( ( $screen == 'profiles' ) && ( $tab == 'help' ) ) {
246
+
247
+ $text .= '<p>' . __( 'This screen allows you to set the options for the default and additional profiles. If you don\'t specify a specific parameter when displaying your YouTube video then the default profile option will be used instead. Additional profiles, which you may name, can be used as well and used as required.', 'youtube-embed' ) . '</p>';
248
+ $text .= '<p>' . __( 'All settings will work whether the Flash or HTML5 player is used, unless one of the following icons is shown, indicating which format the option works with...', 'youtube-embed' ) . '</p>';
249
+ $text .= "<p><img src='" . plugins_url() . "/youtube-embed/images/flash.png' width='10px'/> - " . __( 'Flash player', 'youtube-embed' ) . '</br>';
250
+ $text .= "<img src='" . plugins_url() . "/youtube-embed/images/html5.png' width='10px'/> - " . __( 'HTML5 player', 'youtube-embed' ) . '</br>';
251
+ }
252
+
253
+ if ( ( $screen == 'lists' ) && ( $tab == 'help' ) ) {
254
+
255
+ $text .= '<p>' . __( 'This screen allows you to create lists of YouTube videos, which may be named. These lists can then be used in preference to a single video ID.', 'youtube-embed' ) . '</p>';
256
+ }
257
+
258
+ if ( $tab == 'help' ) {
259
+ $text .= '<p>' . __( 'Remember to click the Save Changes button at the bottom of the screen for any changes to take effect.', 'youtube-embed' ) . '</p>';
260
+ }
261
+
262
+ if ( $tab == 'links' ) {
263
 
264
+ $text .= '<p><strong>' . __( 'For more information:', 'youtube-embed' ) . '</strong></p>';
265
+ $text .= '<p><a href="https://wordpress.org/plugins/youtube-embed/">' . __( 'YouTube Embed Plugin Documentation', 'youtube-embed' ) . '</a></p>';
 
 
 
266
 
267
+ if ( $screen != 'lists' ) {
268
+ $text .= '<p><a href="http://code.google.com/apis/youtube/player_parameters.html">' . __( 'YouTube Player Documentation', 'youtube-embed' ) . '</a></p>';
269
+ }
270
+
271
+ if ( $screen == 'options' ) {
272
+
273
+ $text .= '<p><a href="https://github.com/davatron5000/FitVids.js">FitVids.js</a></p>';
274
+ $text .= '<p><a href="https://github.com/davidjbradshaw/iframe-resizer">iFrame Resizer</a></p>';
275
+ }
276
+ }
277
+
278
+ return $text;
279
  }
280
 
281
  /**
341
 
342
  return $plugin_array;
343
  }
344
+
345
+ /**
346
+ * Show Admin Messages
347
+ *
348
+ * Display messages on the administration screen
349
+ *
350
+ * @since 4.1
351
+ *
352
+ */
353
+
354
+ function youtube_embed_admin_messages() {
355
+
356
+ $shortcode_site = get_option( 'youtube_embed_shortcode_site' );
357
+
358
+ $shortcode_admin = get_option( 'youtube_embed_shortcode_admin' );
359
+
360
+ if ( ( $shortcode_admin != 0 ) or ( $shortcode_site != 0 ) ) {
361
+
362
+ $options = vye_set_general_defaults();
363
+
364
+ if ( $options[ 'prompt' ] == 1 ) {
365
+
366
+ if ( $shortcode_site == 3 ) {
367
+ $message = __( 'For some reason the shortcode <strong>[youtube]</strong> is not working on the main site' );
368
+ }
369
+
370
+ $alternative = __( 'An alternative plugin is using the <strong>[youtube]</strong> shortcode' );
371
+
372
+ if ( ( $shortcode_admin == 1 ) or ( $shortcode_site == 1 ) ) {
373
+ $message = $alternative;
374
+ }
375
+
376
+ if ( ( $shortcode_admin == 2 ) or ( $shortcode_site == 2 ) ) {
377
+ $message = __( $alternative . ', possibly the <a href="admin.php?page=jetpack_modules&activated=true">Shortcode Embeds module</a> in Jetpack' );
378
+ }
379
+
380
+ echo '<div class="error notice"><p>YouTube Embed: ' . $message . '.</p></div>';
381
+ }
382
+ }
383
+
384
+ }
385
+
386
+ add_action( 'admin_notices', 'youtube_embed_admin_messages' );
387
  ?>
includes/generate-embed-code.php CHANGED
@@ -50,10 +50,14 @@
50
  * @param string $search Perform a search
51
  * @param string $user Look up user videos
52
  * @param string $modest Modest browsing
 
 
53
  * @return string Code output
54
  */
55
 
56
- function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullscreen = '', $related = '', $autoplay = '', $loop = '', $start = '', $info = '', $annotation = '', $cc = '', $style = '', $stop = '', $disablekb = '', $ratio = '', $autohide = '', $controls = '', $profile = '', $list_style = '', $template = '', $color = '', $theme = '', $https = '', $dynamic = '', $search = '', $user = '', $modest = '' ) {
 
 
57
 
58
  // Ensure an ID is passed
59
 
@@ -143,24 +147,10 @@ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullsc
143
  }
144
  }
145
 
146
- // Generate a cache key for the above passed parameters
147
-
148
- $hash_key = $id . $width . $height . $fullscreen . $related . $autoplay . $loop . $start . $info . $annotation . $cc . $style . $stop . $disablekb . $ratio . $autohide . $controls . $profile . $list_style . $template . $color . $theme . $https . $dynamic . $search . $user . serialize( $general ) . serialize( $options );
149
- if ( isset( $list ) ) { $hash_key .= serialize( $list ); }
150
- if ( isset( $return ) ) { $hash_key .= serialize( $return ); }
151
-
152
- $cache_key = 'vye_video_' . md5( $hash_key );
153
-
154
- // Try and get the output from cache. If it exists, return the code
155
-
156
- if ( ( $general[ 'embed_cache' ] != 0 ) && ( !is_feed() ) && ( $list_style != 'random' ) ) {
157
- $result = get_transient( $cache_key );
158
- if ( $result !== false) { return $result; }
159
- }
160
-
161
  $metadata = $general[ 'metadata' ];
162
 
163
  // Correct the ID if a playlist
 
164
  if ( strtolower( substr( $id, 0, 2 ) ) == 'pl') {
165
  $id = substr( $id, 2 );
166
  }
@@ -225,7 +215,11 @@ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullsc
225
  if ( $color == '' ) { $color = $options[ 'color' ]; }
226
  if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
227
  if ( $modest == '' ) { $modest = $options[ 'modest' ]; }
 
 
228
 
 
 
229
  $wmode = $options[ 'wmode' ];
230
 
231
  if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
@@ -274,65 +268,71 @@ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullsc
274
  // Set Frameborder output
275
 
276
  $frameborder = '';
277
- if ( isset( $general[ 'frameborder' ] ) ) { if ( $general[ 'frameborder' ] == 1 ) { $frameborder = 'frameborder="0" '; } }
 
 
 
 
 
 
 
278
 
279
  // Set up embed types
280
 
281
  $class = 'youtube-player';
282
- $paras = '?enablejsapi=1';
283
 
284
  // Generate parameters to add to URL
285
 
286
- if ( $modest == 1 ) { $paras .= '&modestbranding=1'; }
287
- if ( $fullscreen != 1 ) { $paras .= '&fs=0'; }
288
- if ( $related != 1 ) { $paras .= '&rel=0'; }
289
- if ( $autoplay == 1 ) { $paras .= '&autoplay=1'; }
290
- if ( $loop == 1 ) { $paras .= '&loop=1'; }
291
- if ( $info != 1 ) { $paras .= '&showinfo=0'; }
292
- if ( $annotation != 1 ) { $paras .= '&iv_load_policy=3'; }
293
- $paras .= '&cc_load_policy=';
294
- if ( $cc == 1 ) { $paras .= '1'; } else { $paras .= '0'; }
295
- if ( $disablekb == 1 ) { $paras .= '&disablekb=1'; }
296
- if ( $autohide != 2 ) { $paras .= '&autohide=' . $autohide; }
297
- if ( $controls != 1 ) { $paras .= '&controls=' . $controls; }
298
- if ( strtolower( $color ) != 'red' ) { $paras .= '&color=' . strtolower( $color ); }
299
- if ( strtolower( $theme ) != 'dark' ) { $paras .= '&theme=' . strtolower( $theme ); }
300
- if ( $wmode != 'window' ) { $paras .= '&wmode=' . $wmode; }
 
 
301
 
302
  // If not a playlist, add the playlist parameter
303
 
304
- if ( ( $playlist_ids != '' ) && ( $playlist_ids != $id ) ) { $paras .= '&playlist=' . $playlist_ids; }
305
 
306
  // Add start & stop parameters
307
 
308
- if ( $start != 0 ) { $paras .= '&start=' . $start; }
309
- if ( $stop != 0 ) { $paras .= '&end=' . $stop; }
310
 
311
  // Generate DIVs to wrap around video
312
 
313
- if ( ( $dynamic == 1) or ( $metadata != 0 ) ) {
314
-
315
- $ttab = $tab;
316
- $result = '<div';
317
- if ( $dynamic == 1 ) { $result .= ' class="ye-container"'; }
318
- if ( $metadata != 0 ) { $result .= ' itemprop="video" itemscope itemtype="http://schema.org/VideoObject"'; }
319
- $result .= '>' . $newline;
320
- if ( ( $dynamic == 1 ) && ( $fixed == 1) ) {
321
- $result = '<div style="width: ' . $width . 'px; max-width: 100%">' . $newline . $tab . $result;
322
- $ttab .= $tab;
323
- }
324
- } else {
325
- $ttab = '';
326
- $result = '';
327
  }
328
 
329
  // Add Metadata
330
 
331
  if ( $metadata != 0 ) {
332
 
 
 
333
  $result .= $ttab . '<meta itemprop="url" content="http' . $https . '://www.youtube.com/' . $embed_type . '/' . $id . '" />' . $newline;
334
- $result .= $ttab . '<meta itemprop="name" content="' . get_the_title() . '" />' . $newline;
335
- $result .= $ttab . '<meta itemprop="description" content="' . get_the_title() . '" />' . $newline;
336
  $result .= $ttab . '<meta itemprop="uploadDate" content="' . get_the_date( 'c' ) . '" />' . $newline;
337
  $result .= $ttab . '<meta itemprop="thumbnailUrl" content="http://i.ytimg.com/vi/' . $id . '/hqdefault.jpg" />' . $newline;
338
  $result .= $ttab . '<meta itemprop="embedUrl" content="http' . $https . '://www.youtube.com/embed/' . $id . '" />' . $newline;
@@ -373,7 +373,7 @@ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullsc
373
  // Combine URL parts together
374
 
375
  $embed_url .= $id_paras;
376
- if ( strpos( $embed_url, '?' ) > 0 ) { $paras = '&' . substr( $paras, 1 ); }
377
  $embed_url .= $paras;
378
 
379
  // Check length of URL to ensure it doesn't exceed 2000 characters
@@ -384,35 +384,34 @@ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullsc
384
 
385
  if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
386
  $result .= $ttab . '<iframe ' . $frameborder . 'style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="' . $embed_url . '"';
387
- if ( $fullscreen == 1 ) { $result .= ' allowfullscreen="allowfullscreen"'; }
388
  $result .= ' ></iframe>' . $newline;
389
 
390
  // Now apply the template to the result
391
 
392
  $end_tag = '';
393
- if ( ( $dynamic == 1 ) or ( $metadata != 0 ) ) {
394
- if ( ( $dynamic == 1 ) && ( $fixed == 1 ) ) {
395
- $end_tag .= $tab . '</div>' . $newline . '</div>' . $newline;
396
- } else {
397
- $end_tag .= '</div>' . $newline;
398
- }
399
  }
400
  $result = str_replace( '%video%', $result . $end_tag, $template );
401
 
402
  // Add the download link, if required
403
 
404
- if ( $options[ 'download' ] == 1 ) { $result .= '<div style="' . $options[ 'download_style' ] . '" class="aye_download">' . $newline . $tab . '<a href="' . vye_generate_download_code( $id ) . "\">" . $options[ 'download_text' ] . '</a>' . $newline . '</div>' . $newline; }
 
 
405
 
406
  // Now add a commented header and trailer
407
 
408
- $result = $newline . '<!-- YouTube Embed v' . youtube_embed_version . ' -->' . $newline . $result;
409
- $result .= '<!-- End of YouTube Embed code -->';
410
-
411
- // Cache the output
412
-
413
- if ( $general[ 'embed_cache' ] != 0 ) { set_transient( $cache_key, $result, 3600 * $general[ 'embed_cache' ] ); }
414
 
415
- return $result;
416
  }
417
 
418
  /**
50
  * @param string $search Perform a search
51
  * @param string $user Look up user videos
52
  * @param string $modest Modest browsing
53
+ * @param string $playsinline Playsinline on iOS
54
+ * @param string $html5 Force HTML5
55
  * @return string Code output
56
  */
57
 
58
+ function vye_generate_youtube_code( $id = '', $width = '', $height = '', $fullscreen = '', $related = '', $autoplay = '', $loop = '', $start = '', $info = '', $annotation = '', $cc = '', $style = '', $stop = '', $disablekb = '', $ratio = '', $autohide = '', $controls = '', $profile = '', $list_style = '', $template = '', $color = '', $theme = '', $https = '', $dynamic = '', $search = '', $user = '', $modest = '', $playsinline = '', $html5 = '' ) {
59
+
60
+ $start_time = microtime( true );
61
 
62
  // Ensure an ID is passed
63
 
147
  }
148
  }
149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  $metadata = $general[ 'metadata' ];
151
 
152
  // Correct the ID if a playlist
153
+
154
  if ( strtolower( substr( $id, 0, 2 ) ) == 'pl') {
155
  $id = substr( $id, 2 );
156
  }
215
  if ( $color == '' ) { $color = $options[ 'color' ]; }
216
  if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
217
  if ( $modest == '' ) { $modest = $options[ 'modest' ]; }
218
+ if ( $playsinline == '' ) { $playsinline = $options[ 'playsinline' ]; }
219
+ if ( $html5 == '' ) { $html5 = $options[ 'html5' ]; }
220
 
221
+ $language = $general[ 'language'];
222
+ $debug = $general[ 'debug' ];
223
  $wmode = $options[ 'wmode' ];
224
 
225
  if ( $theme == '' ) { $theme = $options[ 'theme' ]; }
268
  // Set Frameborder output
269
 
270
  $frameborder = '';
271
+ $amp = '&';
272
+ if ( isset( $general[ 'frameborder' ] ) ) {
273
+ if ( $general[ 'frameborder' ] != 1 ) {
274
+ $frameborder = 'frameborder="0" ';
275
+ } else {
276
+ $amp = '&amp;';
277
+ }
278
+ }
279
 
280
  // Set up embed types
281
 
282
  $class = 'youtube-player';
283
+ $paras = '';
284
 
285
  // Generate parameters to add to URL
286
 
287
+ if ( $modest == 1 ) { $paras .= $amp . 'modestbranding=1'; }
288
+ if ( $fullscreen != 1 ) { $paras .= $amp . 'fs=0'; }
289
+ if ( $related != 1 ) { $paras .= $amp . 'rel=0'; }
290
+ if ( $autoplay == 1 ) { $paras .= $amp . 'autoplay=1'; }
291
+ if ( $loop == 1 ) { $paras .= $amp . 'loop=1'; }
292
+ if ( $info != 1 ) { $paras .= $amp . 'showinfo=0'; }
293
+ if ( $annotation != 1 ) { $paras .= $amp . 'iv_load_policy=3'; }
294
+ if ( $cc != '' ) { $paras .= $amp . 'cc_load_policy=' . $cc; }
295
+ if ( $disablekb == 1 ) { $paras .= $amp . 'disablekb=1'; }
296
+ if ( $autohide != 2 ) { $paras .= $amp . 'autohide=' . $autohide; }
297
+ if ( $controls != 1 ) { $paras .= $amp . 'controls=' . $controls; }
298
+ if ( strtolower( $color ) != 'red' ) { $paras .= $amp . 'color=' . strtolower( $color ); }
299
+ if ( strtolower( $theme ) != 'dark' ) { $paras .= $amp . 'theme=' . strtolower( $theme ); }
300
+ if ( $wmode != 'window' ) { $paras .= $amp . 'wmode=' . $wmode; }
301
+ if ( $playsinline == 1 ) { $paras .= $amp . 'playsinline=1'; }
302
+ if ( $html5 == 1 ) { $paras .= $amp . 'html5=1'; }
303
+ if ( $language != '' ) { $paras .= $amp . 'hl=' . $language; }
304
 
305
  // If not a playlist, add the playlist parameter
306
 
307
+ if ( ( $playlist_ids != '' ) && ( $playlist_ids != $id ) ) { $paras .= $amp . 'playlist=' . $playlist_ids; }
308
 
309
  // Add start & stop parameters
310
 
311
+ if ( $start != 0 ) { $paras .= $amp . 'start=' . $start; }
312
+ if ( $stop != 0 ) { $paras .= $amp . 'end=' . $stop; }
313
 
314
  // Generate DIVs to wrap around video
315
 
316
+ $ttab = $tab;
317
+ $result = '<div class="youtube-embed';
318
+ if ( $dynamic == 1 ) { $result .= ' ye-container'; }
319
+ $result .= '"';
320
+ if ( $metadata != 0 ) { $result .= ' itemprop="video" itemscope itemtype="http://schema.org/VideoObject"'; }
321
+ $result .= '>' . $newline;
322
+ if ( ( $dynamic == 1 ) && ( $fixed == 1) ) {
323
+ $result = '<div style="width: ' . $width . 'px; max-width: 100%">' . $newline . $tab . $result;
324
+ $ttab .= $tab;
 
 
 
 
 
325
  }
326
 
327
  // Add Metadata
328
 
329
  if ( $metadata != 0 ) {
330
 
331
+ $title = get_the_title();
332
+
333
  $result .= $ttab . '<meta itemprop="url" content="http' . $https . '://www.youtube.com/' . $embed_type . '/' . $id . '" />' . $newline;
334
+ $result .= $ttab . '<meta itemprop="name" content="' . $title . '" />' . $newline;
335
+ $result .= $ttab . '<meta itemprop="description" content="' . $title . '" />' . $newline;
336
  $result .= $ttab . '<meta itemprop="uploadDate" content="' . get_the_date( 'c' ) . '" />' . $newline;
337
  $result .= $ttab . '<meta itemprop="thumbnailUrl" content="http://i.ytimg.com/vi/' . $id . '/hqdefault.jpg" />' . $newline;
338
  $result .= $ttab . '<meta itemprop="embedUrl" content="http' . $https . '://www.youtube.com/embed/' . $id . '" />' . $newline;
373
  // Combine URL parts together
374
 
375
  $embed_url .= $id_paras;
376
+ if ( ( !strpos( $embed_url, '?' ) ) && ( $paras != '' ) ) { $paras = '?' . substr( $paras, 1 ); }
377
  $embed_url .= $paras;
378
 
379
  // Check length of URL to ensure it doesn't exceed 2000 characters
384
 
385
  if ( $embed_type == "p" ) { $playlist_para = "p/"; } else { $playlist_para = ''; }
386
  $result .= $ttab . '<iframe ' . $frameborder . 'style="border: 0;' . $style . '" class="' . $class . '" width="' . $width . '" height="' . $height . '" src="' . $embed_url . '"';
387
+ if ( $fullscreen == 1 ) { $result .= ' allowfullscreen'; }
388
  $result .= ' ></iframe>' . $newline;
389
 
390
  // Now apply the template to the result
391
 
392
  $end_tag = '';
393
+ if ( ( $dynamic == 1 ) && ( $fixed == 1 ) ) {
394
+ $end_tag .= $tab . '</div>' . $newline . '</div>' . $newline;
395
+ } else {
396
+ $end_tag .= '</div>' . $newline;
 
 
397
  }
398
  $result = str_replace( '%video%', $result . $end_tag, $template );
399
 
400
  // Add the download link, if required
401
 
402
+ if ( ( $options[ 'download' ] == 1 ) && ( $embed_type == 'v' ) ) {
403
+ $result .= '<div style="' . $options[ 'download_style' ] . '" class="aye_download">' . $newline . $tab . '<a href="' . vye_generate_download_code( $id ) . "\">" . $options[ 'download_text' ] . '</a>' . $newline . '</div>' . $newline;
404
+ }
405
 
406
  // Now add a commented header and trailer
407
 
408
+ if ( $debug == 1 ) {
409
+ $result = '<!-- YouTube Embed v' . youtube_embed_version . ' -->' . $newline . $result;
410
+ $runtime = round( microtime( true ) - $start_time, 5 );
411
+ $result .= '<!-- End of YouTube Embed code. Generated in ' . $runtime . ' seconds -->' . $newline;
412
+ }
 
413
 
414
+ return $newline . $result;
415
  }
416
 
417
  /**
includes/generate-other-code.php CHANGED
@@ -17,26 +17,7 @@
17
 
18
  function vye_generate_download_code( $id ) {
19
 
20
- if ( $id == '' ) { return vye_error( __ ( 'No YouTube ID was found.', 'youtube-embed' ) ); }
21
-
22
- // Extract the ID if a full URL has been specified
23
-
24
- $id = vye_extract_id( $id );
25
-
26
- // Check what type of video it is and whether it's valid
27
-
28
- $embed_type = vye_validate_id( $id );
29
- if ( $embed_type != 'v' ) {
30
- if ( strlen( $embed_type ) > 1 ) {
31
- return vye_error( $embed_type );
32
- } else {
33
- return vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) );
34
- }
35
- }
36
-
37
- // Create the link
38
-
39
- return 'http://keepvid.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D' . $id;
40
 
41
  }
42
 
@@ -139,8 +120,8 @@ function vye_generate_thumbnail_code( $id, $style, $class, $rel, $target, $width
139
  $youtube_code .= '>';
140
  }
141
  $youtube_code .= '<img src="http://img.youtube.com/vi/' . $id . '/' . $version . '.jpg"';
142
- if ( $width != '' ) { $youtube_code .= ' width="' . $width . 'px"'; }
143
- if ( $height != '' ) { $youtube_code .= ' height="' . $height . 'px"'; }
144
  $youtube_code .= ' alt="' . $alt . '"/>';
145
  if ( !$nolink ) { $youtube_code .= '</a>'; }
146
 
17
 
18
  function vye_generate_download_code( $id ) {
19
 
20
+ return 'http://keepvid.com/?url=https://www.youtube.com/watch?v=' . $id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  }
23
 
120
  $youtube_code .= '>';
121
  }
122
  $youtube_code .= '<img src="http://img.youtube.com/vi/' . $id . '/' . $version . '.jpg"';
123
+ if ( $width != '' ) { $youtube_code .= ' width="' . $width . '"'; }
124
+ if ( $height != '' ) { $youtube_code .= ' height="' . $height . '"'; }
125
  $youtube_code .= ' alt="' . $alt . '"/>';
126
  if ( !$nolink ) { $youtube_code .= '</a>'; }
127
 
includes/generate-widgets.php CHANGED
@@ -58,7 +58,9 @@ class YouTubeEmbedWidget extends WP_Widget {
58
  if ( $instance[ 'id_type' ] == 'u' ) { $user = 1; } else { $user = ''; }
59
 
60
  // Generate the video and output it
61
- echo vye_generate_youtube_code ( $instance[ 'id' ],
 
 
62
  '',
63
  '',
64
  '',
@@ -85,7 +87,7 @@ class YouTubeEmbedWidget extends WP_Widget {
85
  '',
86
  $search,
87
  $user,
88
- '' );
89
 
90
  // Output the trailer
91
  echo $after_widget;
58
  if ( $instance[ 'id_type' ] == 'u' ) { $user = 1; } else { $user = ''; }
59
 
60
  // Generate the video and output it
61
+
62
+ echo apply_filters( 'a3_lazy_load_html',
63
+ vye_generate_youtube_code ( $instance[ 'id' ],
64
  '',
65
  '',
66
  '',
87
  '',
88
  $search,
89
  $user,
90
+ '' ) );
91
 
92
  // Output the trailer
93
  echo $after_widget;
includes/options-general.php CHANGED
@@ -23,23 +23,27 @@ if ( ( !empty( $_POST ) ) && ( check_admin_referer( 'youtube-embed-general', 'yo
23
 
24
  if ( isset( $_POST[ 'youtube_embed_editor_button' ] ) ) { $options[ 'editor_button' ] = $_POST[ 'youtube_embed_editor_button' ]; } else { $options[ 'editor_button' ] = ''; }
25
  if ( isset( $_POST[ 'youtube_embed_admin_bar' ] ) ) { $options[ 'admin_bar' ] = $_POST[ 'youtube_embed_admin_bar' ]; } else { $options[ 'admin_bar' ] = ''; }
 
26
  $options[ 'profile_no' ] = $_POST[ 'youtube_embed_profile_no' ];
27
  $options[ 'list_no' ] = $_POST[ 'youtube_embed_list_no' ];
28
-
29
- // If the number of profiles or lists is less than zero, put it to 0
30
-
31
- if ( $options[ 'profile_no' ] < 0 ) { $options[ 'profile_no' ] = 0; }
32
- if ( $options[ 'list_no' ] < 0 ) { $options[ 'list_no' ] = 0; }
33
-
34
- $options[ 'embed_cache' ] = $_POST[ 'youtube_embed_embed_cache' ];
35
  $options[ 'alt_profile' ] = $_POST[ 'youtube_embed_alt_profile' ];
36
- if ( isset( $_POST[ 'youtube_embed_metadata' ] ) ) { $options[ 'metadata' ] = $_POST[ 'youtube_embed_metadata' ]; } else { $options[ 'metadata' ] = ''; }
37
  $options[ 'feed' ] = $_POST[ 'youtube_embed_feed' ];
38
  $options[ 'thumbnail' ] = $_POST[ 'youtube_embed_thumbnail' ];
39
  $options[ 'privacy' ] = $_POST[ 'youtube_embed_privacy' ];
40
- if ( isset( $_POST[ 'youtube_embed_frameborder' ] ) ) { $options[ 'frameborder' ] = $_POST[ 'youtube_embed_frameborder' ]; } else { $options[ 'frameborder' ] = ''; }
41
- if ( isset( $_POST[ 'widgets' ] ) ) { $options[ 'widgets' ] = $_POST[ 'youtube_embed_widgets' ]; } else { $options[ 'widgets' ] = ''; }
42
  $options[ 'menu_access' ] = $_POST[ 'youtube_embed_menu_access' ];
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  // Update the options
45
 
@@ -80,42 +84,54 @@ $shortcode = vye_set_shortcode_option();
80
 
81
  <tr>
82
  <th scope="row"><label for="youtube_embed_metadata"><?php _e( 'Add Metadata', 'youtube-embed' ); ?></label></th>
83
- <td><label for="youtube_embed_metadata"><input type="checkbox" name="youtube_embed_metadata" value="1"<?php if ( $options[ 'metadata' ] == "1" ) { echo ' checked="checked"'; } ?>/>
84
- <?php _e( 'Allow rich metadata to be added to code', 'youtube-embed' ); ?></label></td>
85
  </tr>
86
 
87
  <!-- Feed -->
88
 
89
  <tr>
90
- <th scope="row"><label for="youtube_embed_feed"><?php _e( 'Feed', 'youtube-embed' ); ?></label></th>
91
- <td><select name="youtube_embed_feed">
92
  <option value="t"<?php if ( $options[ 'feed' ] == "t" ) { echo " selected='selected'"; } ?>><?php _e ( 'Text link', 'youtube-embed' ); ?></option>
93
  <option value="v"<?php if ( $options[ 'feed' ] == "v" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail', 'youtube-embed' ); ?></option>
94
  <option value="b"<?php if ( $options[ 'feed' ] == "b" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail &amp; Text Link', 'youtube-embed' ); ?></option>
95
- </select>
96
  <p class="description"><?php _e( 'Videos cannot be embedded in feeds. Select how you wish them to be shown instead.', 'youtube-embed' ); ?></p></td>
97
  </tr>
98
 
99
  <!-- Feed Thumbnail -->
100
 
101
  <tr>
102
- <th scope="row"><label for="youtube_embed_thumbnail">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Thumbnail to use', 'youtube-embed' ); ?></label></th>
103
- <td><select name="youtube_embed_thumbnail">
104
  <option value="default"<?php if ( $options[ 'thumbnail' ] == "default" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default', 'youtube-embed' ); ?></option>
105
  <option value="hqdefault"<?php if ( $options[ 'thumbnail' ] == "hqdefault" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default (HQ)', 'youtube-embed' ); ?></option>
106
  <option value="1"<?php if ( $options[ 'thumbnail' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Start', 'youtube-embed' ); ?></option>
107
  <option value="2"<?php if ( $options[ 'thumbnail' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'Middle', 'youtube-embed' ); ?></option>
108
  <option value="3"<?php if ( $options[ 'thumbnail' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'End', 'youtube-embed' ); ?></option>
109
- </select>
110
  <p class="description"><?php _e( 'Choose which thumbnail to use.', 'youtube-embed' ); ?></p></td>
111
  </tr>
112
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  </table><hr><h3 class="title"><?php _e( 'Shortcodes', 'youtube-embed' ); ?></h3><table class="form-table">
114
 
115
  <!-- Shortcodes in Widgets -->
116
 
117
  <tr>
118
- <th scope="row"><label for="youtube_embed_widgets"><?php _e( 'Allow shortcodes in widgets', 'youtube-embed' ); ?></label></th>
119
  <td><label for="youtube_embed_widgets"><input type="checkbox" name="youtube_embed_widgets" value="1"<?php if ( $options[ 'widgets' ] == "1" ) { echo ' checked="checked"'; } ?>/>
120
  <?php _e( 'Allow shortcodes to be used in widgets', 'youtube-embed' ); ?></label>
121
  <p class="description"><?php _e( 'This will apply to <strong>all</strong> widgets.', 'youtube-embed' ); ?></p></td>
@@ -124,18 +140,26 @@ $shortcode = vye_set_shortcode_option();
124
  <!-- Alternative Shortcode -->
125
 
126
  <tr>
127
- <th scope="row"><label for="youtube_embed_shortcode"><?php _e( 'Alternative Shortcode', 'youtube-embed' ); ?></label></th>
128
- <td><input type="text" size="30" name="youtube_embed_shortcode" value="<?php echo $shortcode; ?>"/>
129
  <p class="description"><?php _e( 'An alternative shortcode to use.', 'youtube-embed' ); ?></p></td>
130
  </tr>
131
 
132
  <!-- Alternative Shortcode Profile -->
133
 
134
  <tr>
135
- <th scope="row"><label for="youtube_embed_alt_profile">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use', 'youtube-embed' ); ?></label></th>
136
- <td><select name="youtube_embed_alt_profile">
137
  <?php vye_generate_profile_list( $options[ 'alt_profile' ], $options[ 'profile_no' ] ) ?>
138
- </select></td>
 
 
 
 
 
 
 
 
139
  </tr>
140
 
141
  </table><hr><h3 class="title"><?php _e( 'Administration Options', 'youtube-embed' ); ?></h3><table class="form-table">
@@ -143,7 +167,7 @@ $shortcode = vye_set_shortcode_option();
143
  <!-- Editor Button -->
144
 
145
  <tr>
146
- <th scope="row"><label for="youtube_embed_editor_button"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></label></th>
147
  <td><label for="youtube_embed_editor_button"><input type="checkbox" name="youtube_embed_editor_button" value="1"<?php if ( $options[ 'editor_button' ] == "1" ) { echo ' checked="checked"'; } ?>/>
148
  <?php _e( 'Show the YouTube button on the post editor', 'youtube-embed' ); ?></label></td>
149
  </tr>
@@ -151,7 +175,7 @@ $shortcode = vye_set_shortcode_option();
151
  <!-- Admin Bar -->
152
 
153
  <tr>
154
- <th scope="row"><label for="youtube_embed_admin_bar"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></label></th>
155
  <td><label for="youtube_embed_admin_bar"><input type="checkbox" name="youtube_embed_admin_bar" value="1"<?php if ( $options[ 'admin_bar' ] == "1" ) { echo ' checked="checked"'; } ?>/>
156
  <?php _e( 'Add link to options screen to Admin Bar', 'youtube-embed' ); ?></label></td>
157
  </tr>
@@ -159,13 +183,13 @@ $shortcode = vye_set_shortcode_option();
159
  <!-- Menu Screen Access -->
160
 
161
  <tr>
162
- <th scope="row"><label for="youtube_embed_menu_access"><?php _e( 'Menu Screen Access', 'youtube-embed' ); ?></label></th>
163
- <td><select name="youtube_embed_menu_access">
164
  <option value="list_users"<?php if ( $options[ 'menu_access' ] == "list_users" ) { echo " selected='selected'"; } ?>><?php _e ( 'Administrator', 'youtube-embed' ); ?></option>
165
  <option value="edit_pages"<?php if ( $options[ 'menu_access' ] == "edit_pages" ) { echo " selected='selected'"; } ?>><?php _e ( 'Editor', 'youtube-embed' ); ?></option>
166
  <option value="publish_posts"<?php if ( $options[ 'menu_access' ] == "publish_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Author', 'youtube-embed' ); ?></option>
167
  <option value="edit_posts"<?php if ( $options[ 'menu_access' ] == "edit_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Contributor', 'youtube-embed' ); ?></option>
168
- </select>
169
  <p class="description"><?php _e( 'Specify the user access required for the menu screens.', 'youtube-embed' ); ?></p></td>
170
  </tr>
171
 
@@ -174,71 +198,58 @@ $shortcode = vye_set_shortcode_option();
174
  <!-- Number of Profiles -->
175
 
176
  <tr>
177
- <th scope="row"><label for="youtube_embed_profile_no"><?php _e( 'Number of Profiles', 'youtube-embed' ); ?></label></th>
178
- <td><input type="text" size="2" maxlength="2" name="youtube_embed_profile_no" value="<?php echo $options[ 'profile_no' ]; ?>"/>
179
  <p class="description"><?php _e( 'Maximum number of profiles.', 'youtube-embed' ); ?></p></td>
180
  </tr>
181
 
182
  <!-- Number of Lists -->
183
 
184
  <tr>
185
- <th scope="row"><label for="youtube_embed_list_no"><?php _e( 'Number of Lists', 'youtube-embed' ); ?></label></th>
186
- <td><input type="text" size="2" maxlength="2" name="youtube_embed_list_no" value="<?php echo $options[ 'list_no' ]; ?>"/>
187
  <p class="description"><?php _e( 'Maximum number of lists.', 'youtube-embed' ); ?></p></td>
188
  </tr>
189
 
190
- </table><hr><h3 class="title"><?php _e( 'Performance', 'youtube-embed' ); ?></h3>
191
-
192
- <!-- Show Cache Stats -->
193
-
194
- <?php
195
- global $wpdb;
196
- $video_cache = $wpdb -> get_var( "SELECT COUNT(*) FROM $wpdb->options WHERE option_name LIKE '_transient_timeout_%ye_video_%'" );
197
-
198
- echo '<p>' . __( 'You currently have cache for', 'youtube_embed' ) . ' ' . number_format( $video_cache ) . ' video' . ( $video_cache <> 1 ? 's' : '' ) . ".</p>\n";
199
- ?>
200
-
201
- <table class="form-table">
202
 
203
- <!-- Embed Cache -->
204
 
205
  <tr>
206
- <th scope="row"><label for="youtube_embed_embed_cache"><?php _e( 'Embed Cache', 'youtube-embed' ); ?></label></th>
207
- <td><input type="text" size="3" maxlength="3" name="youtube_embed_embed_cache" value="<?php echo $options[ 'embed_cache' ]; ?>"/>
208
- <p class="description"><?php _e( 'How many hours to retain embed output. 0 to switch off.', 'youtube-embed' ); ?></p></td>
 
 
 
 
209
  </tr>
210
 
211
- <!-- Clear Cache -->
212
 
213
  <tr>
214
- <th scope="row"><label for="youtube_embed_clear_cache"><?php _e( 'Clear Cache', 'youtube-embed' ); ?></label></th>
215
- <td><label for="youtube_embed_clear_cache"><input type="checkbox" name="youtube_embed_clear_cache" value="1">
216
- <?php _e( 'Select this option to remove all YouTube Embed cache', 'youtube-embed' ); ?></label></td>
217
  </tr>
218
 
219
- </table><hr><h3 class="title"><?php _e( 'Security', 'youtube-embed' ); ?></h3><table class="form-table">
220
 
221
- <!-- Privacy-Enhanced Mode -->
222
 
223
  <tr>
224
- <th scope="row"><label for="youtube_embed_menu_access"><?php _e( 'Privacy-Enhanced Mode', 'youtube-embed' ); ?></label></th>
225
- <td><select name="youtube_embed_privacy">
226
- <option value="0"<?php if ( $options[ 'privacy' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should always be stored', 'youtube-embed' ); ?></option>
227
- <option value="1"<?php if ( $options[ 'privacy' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should never be stored', 'youtube-embed' ); ?></option>
228
- <option value="2"<?php if ( $options[ 'privacy' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( "Cookies should be stored based on user's Do Not Track setting", 'youtube-embed' ); ?></option>
229
- </select>
230
- <p class="description"><?php _e( 'Read more about <a href="http://donottrack.us/">Do Not Track</a>.', 'youtube-embed' ); ?></p></td>
231
  </tr>
232
 
233
- </table><hr><h3 class="title"><?php _e( 'Compatibility', 'youtube-embed' ); ?></h3><table class="form-table">
234
-
235
- <!-- Frame Border -->
236
 
237
  <tr>
238
- <th scope="row"><label for="youtube_embed_frameborder"><?php _e( 'Frame Border', 'youtube-embed' ); ?></label></th>
239
- <td><label for="youtube_embed_frameborder"><input type="checkbox" name="youtube_embed_frameborder" value="1"<?php if ( $options[ 'frameborder' ] == '1' ) { echo ' checked="checked"'; } ?>/>
240
- <?php _e( 'Allow Frame Border on IFRAME', 'youtube-embed' ); ?></label>
241
- <p class="description"><?php _e( 'FRAMEBORDER is not HTML5 compliant.', 'youtube-embed' ); ?></p></td>
242
  </tr>
243
 
244
  </table>
23
 
24
  if ( isset( $_POST[ 'youtube_embed_editor_button' ] ) ) { $options[ 'editor_button' ] = $_POST[ 'youtube_embed_editor_button' ]; } else { $options[ 'editor_button' ] = ''; }
25
  if ( isset( $_POST[ 'youtube_embed_admin_bar' ] ) ) { $options[ 'admin_bar' ] = $_POST[ 'youtube_embed_admin_bar' ]; } else { $options[ 'admin_bar' ] = ''; }
26
+
27
  $options[ 'profile_no' ] = $_POST[ 'youtube_embed_profile_no' ];
28
  $options[ 'list_no' ] = $_POST[ 'youtube_embed_list_no' ];
 
 
 
 
 
 
 
29
  $options[ 'alt_profile' ] = $_POST[ 'youtube_embed_alt_profile' ];
 
30
  $options[ 'feed' ] = $_POST[ 'youtube_embed_feed' ];
31
  $options[ 'thumbnail' ] = $_POST[ 'youtube_embed_thumbnail' ];
32
  $options[ 'privacy' ] = $_POST[ 'youtube_embed_privacy' ];
 
 
33
  $options[ 'menu_access' ] = $_POST[ 'youtube_embed_menu_access' ];
34
+ $options[ 'language' ] = $_POST[ 'youtube_embed_language' ];
35
+ $options[ 'script' ] = $_POST[ 'youtube_embed_script' ];
36
+
37
+ if ( isset( $_POST[ 'youtube_embed_metadata' ] ) ) { $options[ 'metadata' ] = $_POST[ 'youtube_embed_metadata' ]; } else { $options[ 'metadata' ] = ''; }
38
+ if ( isset( $_POST[ 'youtube_embed_frameborder' ] ) ) { $options[ 'frameborder' ] = $_POST[ 'youtube_embed_frameborder' ]; } else { $options[ 'frameborder' ] = ''; }
39
+ if ( isset( $_POST[ 'youtube_embed_widgets' ] ) ) { $options[ 'widgets' ] = $_POST[ 'youtube_embed_widgets' ]; } else { $options[ 'widgets' ] = ''; }
40
+ if ( isset( $_POST[ 'youtube_embed_debug' ] ) ) { $options[ 'debug' ] = $_POST[ 'youtube_embed_debug' ]; } else { $options[ 'debug' ] = ''; }
41
+ if ( isset( $_POST[ 'youtube_embed_prompt' ] ) ) { $options[ 'prompt' ] = $_POST[ 'youtube_embed_prompt' ]; } else { $options[ 'prompt' ] = ''; }
42
+
43
+ // If the number of profiles or lists is less than zero, put it to 0
44
+
45
+ if ( $options[ 'profile_no' ] < 0 ) { $options[ 'profile_no' ] = 0; }
46
+ if ( $options[ 'list_no' ] < 0 ) { $options[ 'list_no' ] = 0; }
47
 
48
  // Update the options
49
 
84
 
85
  <tr>
86
  <th scope="row"><label for="youtube_embed_metadata"><?php _e( 'Add Metadata', 'youtube-embed' ); ?></label></th>
87
+ <td><input type="checkbox" name="youtube_embed_metadata" value="1"<?php if ( $options[ 'metadata' ] == "1" ) { echo ' checked="checked"'; } ?>/>
88
+ <?php _e( 'Allow rich metadata to be added to code', 'youtube-embed' ); ?></td>
89
  </tr>
90
 
91
  <!-- Feed -->
92
 
93
  <tr>
94
+ <th scope="row"><?php _e( 'Feed', 'youtube-embed' ); ?></th>
95
+ <td><label for="youtube_embed_feed"><select name="youtube_embed_feed">
96
  <option value="t"<?php if ( $options[ 'feed' ] == "t" ) { echo " selected='selected'"; } ?>><?php _e ( 'Text link', 'youtube-embed' ); ?></option>
97
  <option value="v"<?php if ( $options[ 'feed' ] == "v" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail', 'youtube-embed' ); ?></option>
98
  <option value="b"<?php if ( $options[ 'feed' ] == "b" ) { echo " selected='selected'"; } ?>><?php _e ( 'Thumbnail &amp; Text Link', 'youtube-embed' ); ?></option>
99
+ </select></label>
100
  <p class="description"><?php _e( 'Videos cannot be embedded in feeds. Select how you wish them to be shown instead.', 'youtube-embed' ); ?></p></td>
101
  </tr>
102
 
103
  <!-- Feed Thumbnail -->
104
 
105
  <tr>
106
+ <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Thumbnail to use', 'youtube-embed' ); ?></th>
107
+ <td><label for="youtube_embed_thumbnail"><select name="youtube_embed_thumbnail">
108
  <option value="default"<?php if ( $options[ 'thumbnail' ] == "default" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default', 'youtube-embed' ); ?></option>
109
  <option value="hqdefault"<?php if ( $options[ 'thumbnail' ] == "hqdefault" ) { echo " selected='selected'"; } ?>><?php _e ( 'Default (HQ)', 'youtube-embed' ); ?></option>
110
  <option value="1"<?php if ( $options[ 'thumbnail' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Start', 'youtube-embed' ); ?></option>
111
  <option value="2"<?php if ( $options[ 'thumbnail' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( 'Middle', 'youtube-embed' ); ?></option>
112
  <option value="3"<?php if ( $options[ 'thumbnail' ] == "3" ) { echo " selected='selected'"; } ?>><?php _e ( 'End', 'youtube-embed' ); ?></option>
113
+ </select></label>
114
  <p class="description"><?php _e( 'Choose which thumbnail to use.', 'youtube-embed' ); ?></p></td>
115
  </tr>
116
 
117
+ <!-- Content Resizing Scripts -->
118
+
119
+ <tr>
120
+ <th scope="row"><?php _e( 'Content Resizing Script', 'youtube-embed' ); ?></th>
121
+ <td><label for="youtube_embed_script"><select name="youtube_embed_script">
122
+ <option value=""<?php if ( $options[ 'script' ] == "" ) { echo " selected='selected'"; } ?>><?php _e ( 'None', 'youtube-embed' ); ?></option>
123
+ <option value="f"<?php if ( $options[ 'script' ] == "f" ) { echo " selected='selected'"; } ?>><?php _e ( 'FitVids.js', 'youtube-embed' ); ?></option>
124
+ <option value="i"<?php if ( $options[ 'script' ] == "i" ) { echo " selected='selected'"; } ?>><?php _e ( 'iFrame Resizer', 'youtube-embed' ); ?></option>
125
+ </select></label>
126
+ <p class="description"><?php _e( 'Use a third party content resizing script?', 'youtube-embed' ); ?></p></td>
127
+ </tr>
128
+
129
  </table><hr><h3 class="title"><?php _e( 'Shortcodes', 'youtube-embed' ); ?></h3><table class="form-table">
130
 
131
  <!-- Shortcodes in Widgets -->
132
 
133
  <tr>
134
+ <th scope="row"><?php _e( 'Allow shortcodes in widgets', 'youtube-embed' ); ?></th>
135
  <td><label for="youtube_embed_widgets"><input type="checkbox" name="youtube_embed_widgets" value="1"<?php if ( $options[ 'widgets' ] == "1" ) { echo ' checked="checked"'; } ?>/>
136
  <?php _e( 'Allow shortcodes to be used in widgets', 'youtube-embed' ); ?></label>
137
  <p class="description"><?php _e( 'This will apply to <strong>all</strong> widgets.', 'youtube-embed' ); ?></p></td>
140
  <!-- Alternative Shortcode -->
141
 
142
  <tr>
143
+ <th scope="row"><?php _e( 'Alternative Shortcode', 'youtube-embed' ); ?></th>
144
+ <td><label for="youtube_embed_shortcode"><input type="text" size="30" name="youtube_embed_shortcode" value="<?php echo $shortcode; ?>"/></label>
145
  <p class="description"><?php _e( 'An alternative shortcode to use.', 'youtube-embed' ); ?></p></td>
146
  </tr>
147
 
148
  <!-- Alternative Shortcode Profile -->
149
 
150
  <tr>
151
+ <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Profile to use', 'youtube-embed' ); ?></th>
152
+ <td><label for="youtube_embed_alt_profile"><select name="youtube_embed_alt_profile">
153
  <?php vye_generate_profile_list( $options[ 'alt_profile' ], $options[ 'profile_no' ] ) ?>
154
+ </select></label></td>
155
+ </tr>
156
+
157
+ <!-- Shortcode Re-Use Prompt -->
158
+
159
+ <tr>
160
+ <th scope="row"><?php _e( 'Show Shortcode Re-use Prompt', 'youtube-embed' ); ?></th>
161
+ <td><label for="youtube_embed_prompt"><input type="checkbox" name="youtube_embed_prompt" value="1"<?php if ( $options[ 'prompt' ] == "1" ) { echo ' checked="checked"'; } ?>/>
162
+ <?php _e( 'Show a prompt if the main shortcode is being re-used by another plugin', 'youtube-embed' ); ?></label></td>
163
  </tr>
164
 
165
  </table><hr><h3 class="title"><?php _e( 'Administration Options', 'youtube-embed' ); ?></h3><table class="form-table">
167
  <!-- Editor Button -->
168
 
169
  <tr>
170
+ <th scope="row"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></th>
171
  <td><label for="youtube_embed_editor_button"><input type="checkbox" name="youtube_embed_editor_button" value="1"<?php if ( $options[ 'editor_button' ] == "1" ) { echo ' checked="checked"'; } ?>/>
172
  <?php _e( 'Show the YouTube button on the post editor', 'youtube-embed' ); ?></label></td>
173
  </tr>
175
  <!-- Admin Bar -->
176
 
177
  <tr>
178
+ <th scope="row"><?php _e( 'Show Editor Button', 'youtube-embed' ); ?></th>
179
  <td><label for="youtube_embed_admin_bar"><input type="checkbox" name="youtube_embed_admin_bar" value="1"<?php if ( $options[ 'admin_bar' ] == "1" ) { echo ' checked="checked"'; } ?>/>
180
  <?php _e( 'Add link to options screen to Admin Bar', 'youtube-embed' ); ?></label></td>
181
  </tr>
183
  <!-- Menu Screen Access -->
184
 
185
  <tr>
186
+ <th scope="row"><?php _e( 'Menu Screen Access', 'youtube-embed' ); ?></th>
187
+ <td><label for="youtube_embed_menu_access"><select name="youtube_embed_menu_access">
188
  <option value="list_users"<?php if ( $options[ 'menu_access' ] == "list_users" ) { echo " selected='selected'"; } ?>><?php _e ( 'Administrator', 'youtube-embed' ); ?></option>
189
  <option value="edit_pages"<?php if ( $options[ 'menu_access' ] == "edit_pages" ) { echo " selected='selected'"; } ?>><?php _e ( 'Editor', 'youtube-embed' ); ?></option>
190
  <option value="publish_posts"<?php if ( $options[ 'menu_access' ] == "publish_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Author', 'youtube-embed' ); ?></option>
191
  <option value="edit_posts"<?php if ( $options[ 'menu_access' ] == "edit_posts" ) { echo " selected='selected'"; } ?>><?php _e ( 'Contributor', 'youtube-embed' ); ?></option>
192
+ </select></label>
193
  <p class="description"><?php _e( 'Specify the user access required for the menu screens.', 'youtube-embed' ); ?></p></td>
194
  </tr>
195
 
198
  <!-- Number of Profiles -->
199
 
200
  <tr>
201
+ <th scope="row"><?php _e( 'Number of Profiles', 'youtube-embed' ); ?></th>
202
+ <td><label for="youtube_embed_profile_no"><input type="text" size="2" maxlength="2" name="youtube_embed_profile_no" value="<?php echo $options[ 'profile_no' ]; ?>"/></label>
203
  <p class="description"><?php _e( 'Maximum number of profiles.', 'youtube-embed' ); ?></p></td>
204
  </tr>
205
 
206
  <!-- Number of Lists -->
207
 
208
  <tr>
209
+ <th scope="row"><?php _e( 'Number of Lists', 'youtube-embed' ); ?></th>
210
+ <td><label for="youtube_embed_list_no"><input type="text" size="2" maxlength="2" name="youtube_embed_list_no" value="<?php echo $options[ 'list_no' ]; ?>"/></label>
211
  <p class="description"><?php _e( 'Maximum number of lists.', 'youtube-embed' ); ?></p></td>
212
  </tr>
213
 
214
+ </table><hr><h3 class="title"><?php _e( 'Security', 'youtube-embed' ); ?></h3><table class="form-table">
 
 
 
 
 
 
 
 
 
 
 
215
 
216
+ <!-- Privacy-Enhanced Mode -->
217
 
218
  <tr>
219
+ <th scope="row"><?php _e( 'Privacy-Enhanced Mode', 'youtube-embed' ); ?></th>
220
+ <td><label for="youtube_embed_menu_access"><select name="youtube_embed_privacy">
221
+ <option value="0"<?php if ( $options[ 'privacy' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should always be stored', 'youtube-embed' ); ?></option>
222
+ <option value="1"<?php if ( $options[ 'privacy' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e ( 'Cookies should never be stored', 'youtube-embed' ); ?></option>
223
+ <option value="2"<?php if ( $options[ 'privacy' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e ( "Cookies should be stored based on user's Do Not Track setting", 'youtube-embed' ); ?></option>
224
+ </select></label>
225
+ <p class="description"><?php _e( 'Read more about <a href="http://donottrack.us/">Do Not Track</a>.', 'youtube-embed' ); ?></p></td>
226
  </tr>
227
 
228
+ <!-- Show debug output -->
229
 
230
  <tr>
231
+ <th scope="row"><?php _e( 'Show debug output', 'youtube-embed' ); ?></th>
232
+ <td><label for="youtube_embed_debug"><input type="checkbox" name="youtube_embed_debug" value="1"<?php if ( $options[ 'debug' ] == "1" ) { echo ' checked="checked"'; } ?>/>
233
+ <?php _e( 'Show debug output as HTML comments', 'youtube-embed' ); ?></label></td>
234
  </tr>
235
 
236
+ </table><hr><h3 class="title"><?php _e( 'Miscellaneous', 'youtube-embed' ); ?></h3><table class="form-table">
237
 
238
+ <!-- Validation -->
239
 
240
  <tr>
241
+ <th scope="row"><?php _e( 'Improve Validation', 'youtube-embed' ); ?></th>
242
+ <td><label for="youtube_embed_frameborder"><input type="checkbox" name="youtube_embed_frameborder" value="1"<?php if ( $options[ 'frameborder' ] == '1' ) { echo ' checked="checked"'; } ?>/>
243
+ <?php _e( 'Improve the validity of the generated markup', 'youtube-embed' ); ?></label>
244
+ <p class="description"><?php _e( 'Will extend the length of the URL, limiting the number of videos in a manual playlist. Switch off metadata for even better validation results.', 'youtube-embed' ); ?></p></td>
 
 
 
245
  </tr>
246
 
247
+ <!-- Interface language -->
 
 
248
 
249
  <tr>
250
+ <th scope="row"><?php _e( 'Interface language', 'youtube-embed' ); ?></th>
251
+ <td><label for="youtube_embed_language"><input type="text" size="5" maxlength="5" name="youtube_embed_language" value="<?php echo $options[ 'language' ]; ?>"/><?php _e( 'The player\'s interface language', 'youtube-embed' ); ?></label>
252
+ <p class="description"><?php echo __( 'The parameter value is an <a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">ISO 639-1 two-letter language code</a> or a fully specified locale. For example, the current locale is ', 'youtube-embed' ) . strtolower( str_replace( '_', '-', get_locale() ) ) . '.'; ?></p></td>
 
253
  </tr>
254
 
255
  </table>
includes/options-lists.php CHANGED
@@ -7,20 +7,15 @@
7
  * @package YouTube-Embed
8
  * @since 2.0
9
  */
10
- ?>
11
- <div class="wrap" style="width: 1010px;">
12
- <?php
13
- global $wp_version;
14
- if ( ( float ) $wp_version >= 4.3 ) { $heading = '1'; } else { $heading = '2'; }
15
- ?>
16
- <h<?php echo $heading; ?>><?php _e( 'YouTube Embed Lists', 'youtube-embed' ); ?></h<?php echo $heading; ?>>
17
 
18
- <?php
19
  // Set current list number
 
20
  if ( isset( $_POST[ 'youtube_embed_list_no' ] ) ) { $list_no = $_POST[ 'youtube_embed_list_no' ]; } else { $list_no = 0; }
21
  if ( $list_no == '' ) { $list_no = 1; }
22
 
23
  // If options have been updated on screen, update the database
 
 
24
  if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
25
 
26
  $class = 'updated fade';
@@ -36,10 +31,15 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
36
  $valid = true;
37
 
38
  // Loop through the video IDs
 
39
  while ( $loop < count( $id_array ) ) {
 
40
  // Extract the ID from the provided data
 
41
  $id = trim( vye_extract_id( $id_array[ $loop ] ) );
 
42
  // Now check its validity
 
43
  if ( $id != '' ) {
44
  $type = vye_validate_id( $id );
45
  if ( $type != 'v' ) { $valid = false; }
@@ -49,6 +49,7 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
49
  }
50
 
51
  // If one or more IDs weren't valid, output an error
 
52
  if (!$valid) {
53
  $class = 'error';
54
  $message = __( 'Errors were found with your video list. See the list below for details.', 'youtube-embed' );
@@ -56,6 +57,7 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
56
  }
57
 
58
  // Update the options
 
59
  $options[ 'name' ] = $_POST[ 'youtube_embed_name' ];
60
 
61
  if ( $new_id_list == '' ) {
@@ -65,14 +67,46 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-g
65
  }
66
 
67
  if ( substr( $class, 0, 7 ) == 'updated' ) { update_option( 'youtube_embed_list' . $list_no, $options ); }
68
- echo '<div class="' . $class . '"><p><strong>' . $message . "</strong></p></div>\n";
69
  } else {
70
  $class = '';
71
  }
72
 
73
  // Fetch options into an array
 
74
  if ( $class != "error" ) { $options = vye_set_list_defaults( $list_no ); }
75
  $general = vye_set_general_defaults();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  ?>
77
 
78
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=ye-list-options'; ?>">
@@ -85,12 +119,14 @@ while ( $loop <= $general[ 'list_no' ] ) {
85
 
86
  $listfiles = get_option( 'youtube_embed_list' . $loop );
87
  $listname = $listfiles[ 'name' ];
 
88
 
89
- if ( $listname == '' ) { $listname = __( 'List', 'youtube-embed' ) . ' ' . $loop; }
90
- if ( strlen( $listname ) > 30 ) { $listname = substr( $listname, 0, 30 ) . '&#8230;'; }
91
  echo '<option value="' . $loop . '"';
92
  if ( $list_no == $loop ) { echo " selected='selected'"; }
93
- echo '>' . $listname . "</option>\n";
 
 
94
 
95
  $loop ++;
96
  }
@@ -106,7 +142,7 @@ while ( $loop <= $general[ 'list_no' ] ) {
106
  <!-- List Name -->
107
 
108
  <tr>
109
- <th scope="row"><label for="youtube_embed_name"><?php _e( 'List Name', 'youtube-embed' ); ?></label></th>
110
  <td><label for="youtube_embed_name"><input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"/>
111
  <?php _e( 'The name you wish to give this list', 'youtube-embed' ); ?></label></td>
112
  </tr>
@@ -114,8 +150,8 @@ while ( $loop <= $general[ 'list_no' ] ) {
114
  <!-- Video IDs -->
115
 
116
  <tr>
117
- <th scope="row"><label for="youtube_embed_video_list"><?php _e( 'Video IDs (one per line)', 'youtube-embed' ); ?></label></th>
118
- <td><textarea name="youtube_embed_video_list" rows="10" cols="12" class="large-text code"><?php echo $options[ 'list' ]; ?></textarea></td>
119
  </tr>
120
 
121
  </table>
7
  * @package YouTube-Embed
8
  * @since 2.0
9
  */
 
 
 
 
 
 
 
10
 
 
11
  // Set current list number
12
+
13
  if ( isset( $_POST[ 'youtube_embed_list_no' ] ) ) { $list_no = $_POST[ 'youtube_embed_list_no' ]; } else { $list_no = 0; }
14
  if ( $list_no == '' ) { $list_no = 1; }
15
 
16
  // If options have been updated on screen, update the database
17
+
18
+ $message = '';
19
  if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-general', 'youtube_embed_general_nonce' ) ) ) {
20
 
21
  $class = 'updated fade';
31
  $valid = true;
32
 
33
  // Loop through the video IDs
34
+
35
  while ( $loop < count( $id_array ) ) {
36
+
37
  // Extract the ID from the provided data
38
+
39
  $id = trim( vye_extract_id( $id_array[ $loop ] ) );
40
+
41
  // Now check its validity
42
+
43
  if ( $id != '' ) {
44
  $type = vye_validate_id( $id );
45
  if ( $type != 'v' ) { $valid = false; }
49
  }
50
 
51
  // If one or more IDs weren't valid, output an error
52
+
53
  if (!$valid) {
54
  $class = 'error';
55
  $message = __( 'Errors were found with your video list. See the list below for details.', 'youtube-embed' );
57
  }
58
 
59
  // Update the options
60
+
61
  $options[ 'name' ] = $_POST[ 'youtube_embed_name' ];
62
 
63
  if ( $new_id_list == '' ) {
67
  }
68
 
69
  if ( substr( $class, 0, 7 ) == 'updated' ) { update_option( 'youtube_embed_list' . $list_no, $options ); }
70
+
71
  } else {
72
  $class = '';
73
  }
74
 
75
  // Fetch options into an array
76
+
77
  if ( $class != "error" ) { $options = vye_set_list_defaults( $list_no ); }
78
  $general = vye_set_general_defaults();
79
+
80
+ // Get number of lists in use
81
+
82
+ $loop = 1;
83
+ $max_list = 0;
84
+ while ( $loop <= $general[ 'list_no' ] ) {
85
+
86
+ $list = get_option( 'youtube_embed_list' . $loop );
87
+
88
+ if ( $list == '' ) {
89
+ $max_list = $loop - 1;
90
+ $loop = $general[ 'list_no' ];
91
+ }
92
+ $loop ++;
93
+ }
94
+
95
+ // Display any screen headings
96
+
97
+ ?>
98
+ <div class="wrap" style="width: 1010px;">
99
+ <?php
100
+ global $wp_version;
101
+ if ( ( float ) $wp_version >= 4.3 ) { $heading = '1'; } else { $heading = '2'; }
102
+ ?>
103
+ <h<?php echo $heading; ?>><?php _e( 'YouTube Embed Lists', 'youtube-embed' ); ?><span class="title-count"><?php echo $max_list; ?></span></h<?php echo $heading; ?>>
104
+
105
+ <?php
106
+
107
+ // Output any messages
108
+
109
+ if ( $message != '' ) { echo '<div class="' . $class . '"><p><strong>' . $message . "</strong></p></div>\n"; }
110
  ?>
111
 
112
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=ye-list-options'; ?>">
119
 
120
  $listfiles = get_option( 'youtube_embed_list' . $loop );
121
  $listname = $listfiles[ 'name' ];
122
+ $list_found = true;
123
 
124
+ if ( $listname == '' ) { $listname = __( 'List', 'youtube-embed' ) . ' ' . $loop; $list_found = false; }
 
125
  echo '<option value="' . $loop . '"';
126
  if ( $list_no == $loop ) { echo " selected='selected'"; }
127
+ echo '>' . $listname;
128
+ if ( !$list_found ) { echo ' [undefined]'; }
129
+ echo "</option>\n";
130
 
131
  $loop ++;
132
  }
142
  <!-- List Name -->
143
 
144
  <tr>
145
+ <th scope="row"><?php _e( 'List Name', 'youtube-embed' ); ?></th>
146
  <td><label for="youtube_embed_name"><input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"/>
147
  <?php _e( 'The name you wish to give this list', 'youtube-embed' ); ?></label></td>
148
  </tr>
150
  <!-- Video IDs -->
151
 
152
  <tr>
153
+ <th scope="row"><?php _e( 'Video IDs (one per line)', 'youtube-embed' ); ?></th>
154
+ <td><label for="youtube_embed_list"><textarea name="youtube_embed_video_list" rows="10" cols="12" class="large-text code"><?php echo $options[ 'list' ]; ?></textarea></label></td>
155
  </tr>
156
 
157
  </table>
includes/options-profiles.php CHANGED
@@ -7,19 +7,8 @@
7
  * @package YouTube-Embed
8
  * @since 2.0
9
  */
10
- ?>
11
-
12
- <?php $demo_video = 'Wc7cvpQS-xQ'; ?>
13
-
14
- <div class="wrap">
15
-
16
- <?php
17
- global $wp_version;
18
- if ( ( float ) $wp_version >= 4.3 ) { $heading = '1'; } else { $heading = '2'; }
19
- ?>
20
- <h<?php echo $heading; ?>><?php _e( 'YouTube Embed Profiles', 'youtube-embed' ); ?></h<?php echo $heading; ?>>
21
 
22
- <?php
23
 
24
  // Set current profile number
25
 
@@ -38,6 +27,16 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-p
38
  if ( strpos( $options[ 'template' ], '%video%' ) === false ) { $options[ 'template' ] = '%video%'; }
39
 
40
  $options[ 'style' ] = $_POST[ 'youtube_embed_style' ];
 
 
 
 
 
 
 
 
 
 
41
  if ( isset( $_POST[ 'youtube_embed_fullscreen' ] ) ) { $options[ 'fullscreen' ] = $_POST[ 'youtube_embed_fullscreen' ]; } else { $options[ 'fullscreen' ] = ''; }
42
  if ( isset( $_POST[ 'youtube_embed_autoplay' ] ) ) { $options[ 'autoplay'] = $_POST[ 'youtube_embed_autoplay' ]; } else { $options[ 'autoplay' ] = ''; }
43
  if ( isset( $_POST[ 'youtube_embed_loop' ] ) ) { $options[ 'loop'] = $_POST[ 'youtube_embed_loop' ]; } else { $options[ 'loop' ] = ''; }
@@ -46,18 +45,12 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-p
46
  if ( isset( $_POST[ 'youtube_embed_related' ] ) ) { $options[ 'related'] = $_POST[ 'youtube_embed_related' ]; } else { $options[ 'related' ] = ''; }
47
  if ( isset( $_POST[ 'youtube_embed_info' ] ) ) { $options[ 'info'] = $_POST[ 'youtube_embed_info' ]; } else { $options[ 'info' ] = ''; }
48
  if ( isset( $_POST[ 'youtube_embed_disablekb' ] ) ) { $options[ 'disablekb'] = $_POST[ 'youtube_embed_disablekb' ]; } else { $options[ 'disablekb' ] = ''; }
49
- $options[ 'autohide'] = $_POST[ 'youtube_embed_autohide' ];
50
- $options[ 'controls'] = $_POST[ 'youtube_embed_controls' ];
51
- $options[ 'wmode'] = $_POST[ 'youtube_embed_wmode' ];
52
- $options[ 'color' ] = $_POST[ 'youtube_embed_color' ];
53
- $options[ 'theme' ] = $_POST[ 'youtube_embed_theme' ];
54
  if ( isset( $_POST[ 'youtube_embed_https' ] ) ) { $options[ 'https' ] = $_POST[ 'youtube_embed_https' ]; } else { $options[ 'https' ] = ''; }
55
  if ( isset( $_POST[ 'youtube_embed_modest' ] ) ) { $options[ 'modest' ] = $_POST[ 'youtube_embed_modest' ]; } else { $options[ 'modest' ] = ''; }
56
  if ( isset( $_POST[ 'youtube_embed_dynamic' ] ) ) { $options[ 'dynamic' ] = $_POST[ 'youtube_embed_dynamic' ]; } else { $options[ 'dynamic' ] = ''; }
57
  if ( isset( $_POST[ 'youtube_embed_fixed' ] ) ) { $options[ 'fixed' ] = $_POST[ 'youtube_embed_fixed' ]; } else { $options[ 'fixed' ] = ''; }
58
  if ( isset( $_POST[ 'youtube_embed_download' ] ) ) { $options[ 'download' ] = $_POST[ 'youtube_embed_download' ]; } else { $options[ 'download' ] = ''; }
59
- $options[ 'download_style' ] = $_POST[ 'youtube_embed_download_style' ];
60
- $options[ 'download_text' ] = str_replace( '\"', '"', str_replace( "\'", "'", $_POST[ 'youtube_embed_download_text' ] ) );
61
 
62
  $default_size = $_POST[ 'youtube_embed_size' ];
63
 
@@ -84,31 +77,70 @@ if ( ( !empty( $_POST[ 'Submit' ] ) ) && ( check_admin_referer( 'youtube-embed-p
84
  }
85
 
86
  update_option( 'youtube_embed_profile' . $profile_no, $options );
87
- echo '<div class="updated fade"><p><strong>' . __( $options[ 'name' ].' Profile Saved.' ) . "</strong></p></div>\n";
 
88
  } else {
 
89
  $default_size = '';
 
90
  }
91
 
92
- // Video option button has been pressed
93
-
94
- if ( !empty( $_POST[ 'Video' ] ) ) { $video_type = $_POST[ 'youtube_embed_video_type' ]; } else { $video_type = 'd'; }
95
-
96
  // Fetch options into an array
97
 
98
  $options = vye_set_profile_defaults( $profile_no );
99
  $general = vye_set_general_defaults();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  ?>
 
 
 
 
 
 
 
 
 
 
 
101
 
 
 
102
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=ye-profile-options' ?>">
103
 
104
  <span class="alignright">
105
  <select name="youtube_embed_profile_no">
106
- <?php vye_generate_profile_list( $profile_no, $general[ 'profile_no' ] ) ?>
107
  </select>
108
  <input type="submit" name="Profile" class="button-secondary" value="<?php _e( 'Change profile', 'youtube-embed' ); ?>"/>
109
  </span><br/>
110
 
111
  <?php
 
 
 
112
  if ( $profile_no == '0' ) {
113
  _e( 'These are the options for the default profile.', 'youtube-embed' );
114
  } else {
@@ -122,7 +154,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
122
  <!-- Profile Name -->
123
 
124
  <tr>
125
- <th scope="row"><label for="youtube_embed_name"><?php _e( 'Profile Name', 'youtube-embed' ); ?></label></th>
126
  <td><label for="youtube_embed_name"><input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"<?php if ( $profile_no == 0 ) { echo ' readonly="readonly"'; } ?>/>
127
  <?php if ( $profile_no != 0 ) { _e( 'The name you wish to give this profile', 'youtube-embed' ); } ?></label></td>
128
  </tr>
@@ -130,23 +162,23 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
130
  <!-- Template -->
131
 
132
  <tr>
133
- <th scope="row"><label for="youtube_embed_template"><?php _e( 'Template', 'youtube-embed' ); ?></label></th>
134
- <td><textarea name="youtube_embed_template" rows="4" cols="50" class="large-text code"><?php echo htmlspecialchars( $options[ 'template' ] ); ?></textarea>
135
- <p class="description"><?php _e( 'Wrapper for video output. Must include <code>%video%</code> tag to show video position.', 'youtube-embed' ); ?></p></td>
136
  </tr>
137
 
138
  <!-- Style -->
139
 
140
  <tr>
141
- <th scope="row"><label for="youtube_embed_style"><?php _e( 'Style', 'youtube-embed' ); ?></label></th>
142
- <td><input type="text" name="youtube_embed_style" class="large-text code" value="<?php echo htmlspecialchars( $options[ 'style' ] ); ?>"/>
143
- <p class="description"><?php _e( 'CSS elements to apply to video.', 'youtube-embed' ); ?></p></td>
144
  </tr>
145
 
146
  <!-- SSL -->
147
 
148
  <tr>
149
- <th scope="row"><label for="youtube_embed_https"><?php _e( 'SSL', 'youtube-embed' ); ?></label></th>
150
  <td><label for="youtube_embed_https"><input type="checkbox" name="youtube_embed_https" value="1"<?php if ( $options[ 'https' ] == "1" ) { echo ' checked="checked"'; } ?>/>
151
  <?php _e( 'Use SSL? <a href="http://www.google.com/support/youtube/bin/answer.py?answer=171780&expand=UseHTTPS#HTTPS">Read more</a>', 'youtube-embed' ); ?></label></td>
152
  </tr>
@@ -154,12 +186,12 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
154
  <!-- Window Mode -->
155
 
156
  <tr>
157
- <th scope="row"><label for="youtube_embed_wmode"><?php _e( 'Window Mode', 'youtube-embed' ); ?>&nbsp;<img src='<?php echo plugins_url() ; ?>/youtube-embed/images/flash.png' width='10px' align='top'></label></th>
158
- <td><select name="youtube_embed_wmode">
159
  <option value="opaque"<?php if ( $options[ 'wmode' ] == "opaque" ) { echo " selected='selected'"; } ?>><?php _e( 'Opaque', 'youtube-embed' ); ?></option>
160
  <option value="transparent"<?php if ( $options[ 'wmode' ] == "transparent" ) { echo " selected='selected'"; } ?>><?php _e( 'Transparent', 'youtube-embed' ); ?></option>
161
  <option value="window"<?php if ( $options[ 'wmode' ] == "window" ) { echo " selected='selected'"; } ?>><?php _e( 'Window', 'youtube-embed' ); ?></option>
162
- </select>
163
  <p class="description"><?php _e( 'Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. <a href="http://www.communitymx.com/content/article.cfm?cid=e5141">Learn more</a>.', 'youtube-embed' ); ?></p></td>
164
  </tr>
165
 
@@ -168,7 +200,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
168
  <!-- Video Size -->
169
 
170
  <tr>
171
- <th scope="row"><label for="youtube_embed_https"><?php _e( 'Video Size', 'youtube-embed' ); ?></label></th>
172
  <td><label for="youtube_embed_height"><input type="text" size="3" maxlength="3" name="youtube_embed_width" value="<?php echo $options[ 'width' ]; ?>"/>&nbsp;x&nbsp;<input type="text" size="3" maxlength="3" name="youtube_embed_height" value="<?php echo $options[ 'height' ]; ?>"/>
173
  <?php _e( 'The width x height of the video, in pixels', 'youtube-embed' ); ?></label></td>
174
  </tr>
@@ -176,21 +208,21 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
176
  <!-- Default Sizes -->
177
 
178
  <tr>
179
- <th scope="row"><label for="youtube_embed_size"><?php _e( 'Default Sizes', 'youtube-embed' ); ?></label></th>
180
- <td><select name="youtube_embed_size">
181
  <option value=""<?php if ( $default_size == '' ) { echo " selected='selected'"; } ?>><?php _e( 'Use above sizes', 'youtube-embed' ); ?></option>
182
  <option value="04800385"<?php if ( $default_size == "04800385" ) { echo " selected='selected'"; } ?>><?php echo '480x385 4:3'; ?></option>
183
  <option value="05600340"<?php if ( $default_size == "05600340" ) { echo " selected='selected'"; } ?>><?php echo '560x340 16:9'; ?></option>
184
  <option value="06400385"<?php if ( $default_size == "06400385" ) { echo " selected='selected'"; } ?>><?php echo '640x385 16:9'; ?></option>
185
  <option value="08530505"<?php if ( $default_size == "08530505" ) { echo " selected='selected'"; } ?>><?php echo '853x505 16:9'; ?></option>
186
  <option value="12800745"<?php if ( $default_size == "12800745" ) { echo " selected='selected'"; } ?>><?php echo '1280x745 16:9'; ?></option>
187
- </select><p class="description"><?php _e( 'Select one of these default sizes to override the above video sizes.', 'youtube-embed' ); ?></p></td>
188
  </tr>
189
 
190
  <!-- Dynamically Resize -->
191
 
192
  <tr>
193
- <th scope="row"><label for="youtube_embed_dynamic"><?php _e( 'Dynamically Resize', 'youtube-embed' ); ?></label></th>
194
  <td><label for="youtube_embed_dynamic"><input type="checkbox" name="youtube_embed_dynamic" value="1"<?php if ( $options[ 'dynamic' ] == "1" ) { echo ' checked="checked"'; } ?>/>
195
  <?php _e( 'Show full width and resize with the browser', 'youtube-embed' ); ?></label></td>
196
  </tr>
@@ -198,17 +230,25 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
198
  <!-- Maximum Size -->
199
 
200
  <tr>
201
- <th scope="row"><label for="youtube_embed_fixed">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Set Maximum Size', 'youtube-embed' ); ?></label></th>
202
  <td><label for="youtube_embed_fixed"><input type="checkbox" name="youtube_embed_fixed" value="1"<?php if ( $options[ 'fixed' ] == "1" ) { echo ' checked="checked"'; } ?>/>
203
  <?php _e( 'Use above width to define maximum size', 'youtube-embed' ); ?></label></td>
204
  </tr>
205
 
 
 
 
 
 
 
 
 
206
  </table><hr><h3 class="title"><?php _e( 'Playback', 'youtube-embed' ); ?></h3><table class="form-table">
207
 
208
  <!-- Autoplay -->
209
 
210
  <tr>
211
- <th scope="row"><label for="youtube_embed_autoplay"><?php _e( 'Autoplay', 'youtube-embed' ); ?></label></th>
212
  <td><label for="youtube_embed_autoplay"><input type="checkbox" name="youtube_embed_autoplay" value="1"<?php if ( $options[ 'autoplay' ] == "1" ) { echo ' checked="checked"'; } ?>/>
213
  <?php _e( 'Choose whether the initial video will automatically start to play when the player loads', 'youtube-embed' ); ?></label></td>
214
  </tr>
@@ -216,7 +256,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
216
  <!-- Loop Video -->
217
 
218
  <tr>
219
- <th scope="row"><label for="youtube_embed_loop"><?php _e( 'Loop Video', 'youtube-embed' ); ?></label></th>
220
  <td><label for="youtube_embed_loop"><input type="checkbox" name="youtube_embed_loop" value="1"<?php if ( $options[ 'loop' ] == "1" ) { echo ' checked="checked"'; } ?>/>
221
  <?php _e( 'Play the initial video again and again', 'youtube-embed' ); ?></label>
222
  <p class="description"><?php _e( 'In the case of a playlist, this will play the entire playlist and then start again at the first video.', 'youtube-embed' ); ?></p></td>
@@ -225,7 +265,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
225
  <!-- Annotations -->
226
 
227
  <tr>
228
- <th scope="row"><label for="youtube_embed_annotation"><?php _e( 'Annotations', 'youtube-embed' ); ?></label></th>
229
  <td><label for="youtube_embed_annotation"><input type="checkbox" name="youtube_embed_annotation" value="1"<?php if ( $options[ 'annotation' ] == "1" ) { echo ' checked="checked"'; } ?>/>
230
  <?php _e( 'Video annotations are shown by default', 'youtube-embed' ); ?></label></td>
231
  </tr>
@@ -233,10 +273,22 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
233
  <!-- Closed Captions -->
234
 
235
  <tr>
236
- <th scope="row"><label for="youtube_embed_cc"><?php _e( 'Closed Captions', 'youtube-embed' ); ?></label></th>
237
- <td><label for="youtube_embed_cc"><input type="checkbox" name="youtube_embed_cc" value="1"<?php if ( $options[ 'cc' ] == "1" ) { echo ' checked="checked"'; } ?>/>
238
- <?php _e( 'Show closed captions (subtitles)', 'youtube-embed' ); ?></label>
239
- <p class="description"><?php _e( 'This will even override even the user\'s choice.', 'youtube-embed' ); ?></p></td>
 
 
 
 
 
 
 
 
 
 
 
 
240
  </tr>
241
 
242
  </table><hr><h3 class="title"><?php _e( 'Information', 'youtube-embed' ); ?></h3><table class="form-table">
@@ -244,7 +296,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
244
  <!-- Info -->
245
 
246
  <tr>
247
- <th scope="row"><label for="youtube_embed_info"><?php _e( 'Information', 'youtube-embed' ); ?></label></th>
248
  <td><label for="youtube_embed_info"><input type="checkbox" name="youtube_embed_info" value="1"<?php if ( $options[ 'info' ] == "1" ) { echo ' checked="checked"'; } ?>/>
249
  <?php _e( 'Display the video title and uploader before the video starts', 'youtube-embed' ); ?></label>
250
  <p class="description"><?php _e( 'If displaying a playlist this will show video thumbnails.', 'youtube-embed' ); ?></p></td>
@@ -253,7 +305,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
253
  <!-- Related -->
254
 
255
  <tr>
256
- <th scope="row"><label for="youtube_embed_related"><?php _e( 'Related Videos', 'youtube-embed' ); ?></label></th>
257
  <td><label for="youtube_embed_related"><input type="checkbox" name="youtube_embed_related" value="1"<?php if ( $options[ 'related' ] == "1" ) { echo ' checked="checked"'; } ?>/>
258
  <?php _e( 'Load related videos once playback starts', 'youtube-embed' ); ?></label>
259
  <p class="description"><?php _e( 'Also toggles the search option.', 'youtube-embed' ); ?></p></td>
@@ -262,7 +314,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
262
  <!-- Modest Branding -->
263
 
264
  <tr>
265
- <th scope="row"><label for="youtube_embed_modest"><?php _e( 'Modest Branding', 'youtube-embed' ); ?></label></th>
266
  <td><label for="youtube_embed_modest"><input type="checkbox" name="youtube_embed_modest" value="1"<?php if ( $options[ 'modest' ] == "1" ) { echo ' checked="checked"'; } ?>/>
267
  <?php _e( 'Reduce branding on video', 'youtube-embed' ); ?></label></td>
268
  </tr>
@@ -272,31 +324,31 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
272
  <!-- Auto Hide -->
273
 
274
  <tr>
275
- <th scope="row"><label for="youtube_embed_autohide"><?php _e( 'Auto hide', 'youtube-embed' ); ?>&nbsp;<img src='<?php echo plugins_url() ; ?>/youtube-embed/images/flash.png' width='10px' align='top'></label></th>
276
- <td><select name="youtube_embed_autohide">
277
  <option value="0"<?php if ( $options[ 'autohide' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls &amp; progress bar remain visible', 'youtube-embed' ); ?></option>
278
  <option value="1"<?php if ( $options[ 'autohide' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls &amp; progress bar fade out', 'youtube-embed' ); ?></option>
279
  <option value="2"<?php if ( $options[ 'autohide' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Progress bar fades', 'youtube-embed' ); ?></option>
280
- </select>
281
  <p class="description"><?php _e( 'Whether the video controls will automatically hide after a video begins playing.', 'youtube-embed' ); ?></p></td>
282
  </tr>
283
 
284
  <!-- Controls -->
285
 
286
  <tr>
287
- <th scope="row"><label for="youtube_embed_controls"><?php _e( 'Controls', 'youtube-embed' ); ?></label></th>
288
- <td><select name="youtube_embed_controls">
289
  <option value="0"<?php if ( $options[ 'controls' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls do not display &amp; Flash player loads immediately', 'youtube-embed' ); ?></option>
290
  <option value="1"<?php if ( $options[ 'controls' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display &amp; Flash player loads immediately', 'youtube-embed' ); ?></option>
291
  <option value="2"<?php if ( $options[ 'controls' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display &amp; Flash player loads once video starts', 'youtube-embed' ); ?></option>
292
- </select>
293
  <p class="description"><?php _e( 'Whether the video player controls are displayed. For Flash it also defines when the controls display in the player as well as when the player will load.', 'youtube-embed' ); ?></p></td>
294
  </tr>
295
 
296
  <!-- Disable Keyboard -->
297
 
298
  <tr>
299
- <th scope="row"><label for="youtube_embed_disablekb"><?php _e( 'Disable Keyboard', 'youtube-embed' ); ?></label></th>
300
  <td><label for="youtube_embed_disablekb"><input type="checkbox" name="youtube_embed_disablekb" value="1"<?php if ( $options[ 'disablekb' ] == "1" ) { echo ' checked="checked"'; } ?>/>
301
  <?php _e( 'Disable the player keyboard controls', 'youtube-embed' ); ?></label></td>
302
  </tr>
@@ -304,7 +356,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
304
  <!-- Fullscreen -->
305
 
306
  <tr>
307
- <th scope="row"><label for="youtube_embed_fullscreen"><?php _e( 'Fullscreen', 'youtube-embed' ); ?></label></th>
308
  <td><label for="youtube_embed_fullscreen"><input type="checkbox" name="youtube_embed_fullscreen" value="1"<?php if ( $options[ 'fullscreen' ] == "1" ) { echo ' checked="checked"'; } ?>/>
309
  <?php _e( 'A button will allow the viewer to watch the video fullscreen', 'youtube-embed' ); ?></label></td>
310
  </tr>
@@ -312,22 +364,22 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
312
  <!-- Theme -->
313
 
314
  <tr>
315
- <th scope="row"><label for="youtube_embed_theme"><?php _e( 'Theme', 'youtube-embed' ); ?>&nbsp;<img src='<?php echo plugins_url() ; ?>/youtube-embed/images/flash.png' width='10px' align='top'></label></th>
316
- <td><select name="youtube_embed_theme">
317
  <option value="dark"<?php if ( $options[ 'theme' ] == "dark" ) { echo " selected='selected'"; } ?>><?php _e( 'Dark', 'youtube-embed' ); ?></option>
318
  <option value="light"<?php if ( $options[ 'theme' ] == "light" ) { echo " selected='selected'"; } ?>><?php _e( 'Light', 'youtube-embed' ); ?></option>
319
- </select>
320
  <p class="description"><?php _e( 'Display player controls within a dark or light control bar.', 'youtube-embed' ); ?></p></td>
321
  </tr>
322
 
323
  <!-- Color -->
324
 
325
  <tr>
326
- <th scope="row"><label for="youtube_embed_color"><?php _e( 'Progress Bar Color', 'youtube-embed' ); ?></label></th>
327
- <td><select name="youtube_embed_color">
328
  <option value="red"<?php if ( $options[ 'color' ] == "red" ) { echo " selected='selected'"; } ?>><?php _e( 'Red', 'youtube-embed' ); ?></option>
329
  <option value="white"<?php if ( $options[ 'color' ] == "white" ) { echo " selected='selected'"; } ?>><?php _e( 'White (desaturated)', 'youtube-embed' ); ?></option>
330
- </select>
331
  <p class="description"><?php _e( 'The color that will be used in the player\'s video progress bar to highlight the amount of the video that\'s already been seen.', 'youtube-embed' ); ?></p></td>
332
  </tr>
333
 
@@ -336,7 +388,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
336
  <!-- Download Link -->
337
 
338
  <tr>
339
- <th scope="row"><label for="youtube_embed_download"><?php _e( 'Show Download Link', 'youtube-embed' ); ?></label></th>
340
  <td><label for="youtube_embed_download"><input type="checkbox" name="youtube_embed_download" value="1"<?php if ( $options[ 'download' ] == "1" ) { echo ' checked="checked"'; } ?>/>
341
  <?php echo sprintf( __( 'Show a link to %s under the video', 'youtube-embed' ), '<a href="http://keepvid.com/" rel="nofollow">KeepVid</a>' ); ?></label></td>
342
  </tr>
@@ -344,17 +396,17 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
344
  <!-- Download Text -->
345
 
346
  <tr>
347
- <th scope="row"><label for="youtube_embed_download_text"><?php _e( 'Download Text', 'youtube-embed' ); ?></label></th>
348
- <td><input type="text" name="youtube_embed_download_text" class="large-text" value="<?php echo htmlspecialchars( $options[ 'download_text' ] ); ?>"/>
349
- <p class="description"><?php _e( 'Text or HTML to display to prompt download.', 'youtube-embed' ); ?></p></td>
350
  </tr>
351
 
352
  <!-- Download Style -->
353
 
354
  <tr>
355
- <th scope="row"><label for="youtube_embed_download_style"><?php _e( 'Download Style', 'youtube-embed' ); ?></label></th>
356
- <td><input type="text" name="youtube_embed_download_style" class="large-text code" value="<?php echo htmlspecialchars( $options[ 'download_style' ] ); ?>"/>
357
- <p class="description"><?php _e( 'CSS elements to apply to video download link.', 'youtube-embed' ); ?></p></td>
358
  </tr>
359
 
360
  </table>
@@ -366,6 +418,7 @@ echo ' ' . __( 'Use the drop-down on the right hand side to swap between profile
366
  </form>
367
 
368
  <a href="#" name="video"></a>
 
369
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=ye-profile-options#video' ?>">
370
  <h3><?php _e( 'YouTube Video Sample', 'youtube-embed' ); ?></h3>
371
  <p><?php _e( 'The video below uses the above, saved profile settings. Use the drop-down below to change which parameters the video uses - press the Change Video button to update it.', 'youtube-embed' ); ?></p>
@@ -384,6 +437,6 @@ if ( $video_type == "l" ) { $id = '095393D5B42B2266'; }
384
  echo vye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $profile_no );
385
  ?></p>
386
 
387
- </form>
388
 
389
  </div>
7
  * @package YouTube-Embed
8
  * @since 2.0
9
  */
 
 
 
 
 
 
 
 
 
 
 
10
 
11
+ $demo_video = 'Wc7cvpQS-xQ';
12
 
13
  // Set current profile number
14
 
27
  if ( strpos( $options[ 'template' ], '%video%' ) === false ) { $options[ 'template' ] = '%video%'; }
28
 
29
  $options[ 'style' ] = $_POST[ 'youtube_embed_style' ];
30
+ $options[ 'autohide'] = $_POST[ 'youtube_embed_autohide' ];
31
+ $options[ 'controls'] = $_POST[ 'youtube_embed_controls' ];
32
+ $options[ 'wmode'] = $_POST[ 'youtube_embed_wmode' ];
33
+ $options[ 'color' ] = $_POST[ 'youtube_embed_color' ];
34
+ $options[ 'theme' ] = $_POST[ 'youtube_embed_theme' ];
35
+ $options[ 'download_style' ] = $_POST[ 'youtube_embed_download_style' ];
36
+
37
+ $options[ 'download_text' ] = str_replace( '\"', '"', str_replace( "\'", "'", $_POST[ 'youtube_embed_download_text' ] ) );
38
+
39
+ if ( isset( $_POST[ 'youtube_embed_playsinline' ] ) ) { $options[ 'playsinline' ] = $_POST[ 'youtube_embed_playsinline' ]; } else { $options[ 'playsinline' ] = ''; }
40
  if ( isset( $_POST[ 'youtube_embed_fullscreen' ] ) ) { $options[ 'fullscreen' ] = $_POST[ 'youtube_embed_fullscreen' ]; } else { $options[ 'fullscreen' ] = ''; }
41
  if ( isset( $_POST[ 'youtube_embed_autoplay' ] ) ) { $options[ 'autoplay'] = $_POST[ 'youtube_embed_autoplay' ]; } else { $options[ 'autoplay' ] = ''; }
42
  if ( isset( $_POST[ 'youtube_embed_loop' ] ) ) { $options[ 'loop'] = $_POST[ 'youtube_embed_loop' ]; } else { $options[ 'loop' ] = ''; }
45
  if ( isset( $_POST[ 'youtube_embed_related' ] ) ) { $options[ 'related'] = $_POST[ 'youtube_embed_related' ]; } else { $options[ 'related' ] = ''; }
46
  if ( isset( $_POST[ 'youtube_embed_info' ] ) ) { $options[ 'info'] = $_POST[ 'youtube_embed_info' ]; } else { $options[ 'info' ] = ''; }
47
  if ( isset( $_POST[ 'youtube_embed_disablekb' ] ) ) { $options[ 'disablekb'] = $_POST[ 'youtube_embed_disablekb' ]; } else { $options[ 'disablekb' ] = ''; }
48
+ if ( isset( $_POST[ 'youtube_embed_html5' ] ) ) { $options[ 'html5'] = $_POST[ 'youtube_embed_html5' ]; } else { $options[ 'html5' ] = ''; }
 
 
 
 
49
  if ( isset( $_POST[ 'youtube_embed_https' ] ) ) { $options[ 'https' ] = $_POST[ 'youtube_embed_https' ]; } else { $options[ 'https' ] = ''; }
50
  if ( isset( $_POST[ 'youtube_embed_modest' ] ) ) { $options[ 'modest' ] = $_POST[ 'youtube_embed_modest' ]; } else { $options[ 'modest' ] = ''; }
51
  if ( isset( $_POST[ 'youtube_embed_dynamic' ] ) ) { $options[ 'dynamic' ] = $_POST[ 'youtube_embed_dynamic' ]; } else { $options[ 'dynamic' ] = ''; }
52
  if ( isset( $_POST[ 'youtube_embed_fixed' ] ) ) { $options[ 'fixed' ] = $_POST[ 'youtube_embed_fixed' ]; } else { $options[ 'fixed' ] = ''; }
53
  if ( isset( $_POST[ 'youtube_embed_download' ] ) ) { $options[ 'download' ] = $_POST[ 'youtube_embed_download' ]; } else { $options[ 'download' ] = ''; }
 
 
54
 
55
  $default_size = $_POST[ 'youtube_embed_size' ];
56
 
77
  }
78
 
79
  update_option( 'youtube_embed_profile' . $profile_no, $options );
80
+ $updated = true;
81
+
82
  } else {
83
+
84
  $default_size = '';
85
+ $updated = false;
86
  }
87
 
 
 
 
 
88
  // Fetch options into an array
89
 
90
  $options = vye_set_profile_defaults( $profile_no );
91
  $general = vye_set_general_defaults();
92
+
93
+ // Get number of lists in use
94
+
95
+ $loop = 1;
96
+ $max_list = 1;
97
+ while ( $loop <= $general[ 'list_no' ] ) {
98
+
99
+ $list = get_option( 'youtube_embed_profile' . $loop );
100
+
101
+ if ( $list == '' ) {
102
+ $max_list = $loop;
103
+ $loop = $general[ 'list_no' ];
104
+ }
105
+ $loop ++;
106
+ }
107
+
108
+ // Output headings
109
+ ?>
110
+
111
+ <div class="wrap">
112
+
113
+ <?php
114
+ global $wp_version;
115
+ if ( ( float ) $wp_version >= 4.3 ) { $heading = '1'; } else { $heading = '2'; }
116
  ?>
117
+ <h<?php echo $heading; ?>><?php _e( 'YouTube Embed Profiles', 'youtube-embed' ); ?><span class="title-count"><?php echo $max_list; ?></span></h<?php echo $heading; ?>>
118
+
119
+ <?php
120
+
121
+ // Output message text
122
+
123
+ if ( $updated ) { echo '<div class="updated fade"><p><strong>' . __( $options[ 'name' ].' Profile Saved.' ) . "</strong></p></div>\n"; }
124
+
125
+ // Video option button has been pressed
126
+
127
+ if ( !empty( $_POST[ 'Video' ] ) ) { $video_type = $_POST[ 'youtube_embed_video_type' ]; } else { $video_type = 'd'; }
128
 
129
+ // Generate Profile list
130
+ ?>
131
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ) . '/wp-admin/admin.php?page=ye-profile-options' ?>">
132
 
133
  <span class="alignright">
134
  <select name="youtube_embed_profile_no">
135
+ <?php vye_generate_profile_list( $profile_no, $general[ 'profile_no' ], true ) ?>
136
  </select>
137
  <input type="submit" name="Profile" class="button-secondary" value="<?php _e( 'Change profile', 'youtube-embed' ); ?>"/>
138
  </span><br/>
139
 
140
  <?php
141
+
142
+ // Show explanatory message at top of screen
143
+
144
  if ( $profile_no == '0' ) {
145
  _e( 'These are the options for the default profile.', 'youtube-embed' );
146
  } else {
154
  <!-- Profile Name -->
155
 
156
  <tr>
157
+ <th scope="row"><?php _e( 'Profile Name', 'youtube-embed' ); ?></th>
158
  <td><label for="youtube_embed_name"><input type="text" size="20" name="youtube_embed_name" value="<?php echo $options[ 'name' ]; ?>"<?php if ( $profile_no == 0 ) { echo ' readonly="readonly"'; } ?>/>
159
  <?php if ( $profile_no != 0 ) { _e( 'The name you wish to give this profile', 'youtube-embed' ); } ?></label></td>
160
  </tr>
162
  <!-- Template -->
163
 
164
  <tr>
165
+ <th scope="row"><?php _e( 'Template', 'youtube-embed' ); ?></th>
166
+ <td><label for="youtube_embed_template"><textarea name="youtube_embed_template" rows="4" cols="50" class="large-text code"><?php echo htmlspecialchars( $options[ 'template' ] ); ?></textarea>
167
+ <p class="description"><?php _e( 'Wrapper for video output. Must include <code>%video%</code> tag to show video position.', 'youtube-embed' ); ?></p></label></td>
168
  </tr>
169
 
170
  <!-- Style -->
171
 
172
  <tr>
173
+ <th scope="row"><?php _e( 'Style', 'youtube-embed' ); ?></th>
174
+ <td><label for="youtube_embed_style"><input type="text" name="youtube_embed_style" class="large-text code" value="<?php echo htmlspecialchars( $options[ 'style' ] ); ?>"/>
175
+ <p class="description"><?php _e( 'CSS elements to apply to video.', 'youtube-embed' ); ?></p></label></td>
176
  </tr>
177
 
178
  <!-- SSL -->
179
 
180
  <tr>
181
+ <th scope="row"><?php _e( 'SSL', 'youtube-embed' ); ?></th>
182
  <td><label for="youtube_embed_https"><input type="checkbox" name="youtube_embed_https" value="1"<?php if ( $options[ 'https' ] == "1" ) { echo ' checked="checked"'; } ?>/>
183
  <?php _e( 'Use SSL? <a href="http://www.google.com/support/youtube/bin/answer.py?answer=171780&expand=UseHTTPS#HTTPS">Read more</a>', 'youtube-embed' ); ?></label></td>
184
  </tr>
186
  <!-- Window Mode -->
187
 
188
  <tr>
189
+ <th scope="row"><?php _e( 'Window Mode', 'youtube-embed' ); ?>&nbsp;<img src='<?php echo plugins_url() ; ?>/youtube-embed/images/flash.png' width='10px' align='top'></th>
190
+ <td><label for="youtube_embed_wmode"><select name="youtube_embed_wmode">
191
  <option value="opaque"<?php if ( $options[ 'wmode' ] == "opaque" ) { echo " selected='selected'"; } ?>><?php _e( 'Opaque', 'youtube-embed' ); ?></option>
192
  <option value="transparent"<?php if ( $options[ 'wmode' ] == "transparent" ) { echo " selected='selected'"; } ?>><?php _e( 'Transparent', 'youtube-embed' ); ?></option>
193
  <option value="window"<?php if ( $options[ 'wmode' ] == "window" ) { echo " selected='selected'"; } ?>><?php _e( 'Window', 'youtube-embed' ); ?></option>
194
+ </select></label>
195
  <p class="description"><?php _e( 'Sets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser. <a href="http://www.communitymx.com/content/article.cfm?cid=e5141">Learn more</a>.', 'youtube-embed' ); ?></p></td>
196
  </tr>
197
 
200
  <!-- Video Size -->
201
 
202
  <tr>
203
+ <th scope="row"><?php _e( 'Video Size', 'youtube-embed' ); ?></th>
204
  <td><label for="youtube_embed_height"><input type="text" size="3" maxlength="3" name="youtube_embed_width" value="<?php echo $options[ 'width' ]; ?>"/>&nbsp;x&nbsp;<input type="text" size="3" maxlength="3" name="youtube_embed_height" value="<?php echo $options[ 'height' ]; ?>"/>
205
  <?php _e( 'The width x height of the video, in pixels', 'youtube-embed' ); ?></label></td>
206
  </tr>
208
  <!-- Default Sizes -->
209
 
210
  <tr>
211
+ <th scope="row"><?php _e( 'Default Sizes', 'youtube-embed' ); ?></th>
212
+ <td><label for="youtube_embed_size"><select name="youtube_embed_size">
213
  <option value=""<?php if ( $default_size == '' ) { echo " selected='selected'"; } ?>><?php _e( 'Use above sizes', 'youtube-embed' ); ?></option>
214
  <option value="04800385"<?php if ( $default_size == "04800385" ) { echo " selected='selected'"; } ?>><?php echo '480x385 4:3'; ?></option>
215
  <option value="05600340"<?php if ( $default_size == "05600340" ) { echo " selected='selected'"; } ?>><?php echo '560x340 16:9'; ?></option>
216
  <option value="06400385"<?php if ( $default_size == "06400385" ) { echo " selected='selected'"; } ?>><?php echo '640x385 16:9'; ?></option>
217
  <option value="08530505"<?php if ( $default_size == "08530505" ) { echo " selected='selected'"; } ?>><?php echo '853x505 16:9'; ?></option>
218
  <option value="12800745"<?php if ( $default_size == "12800745" ) { echo " selected='selected'"; } ?>><?php echo '1280x745 16:9'; ?></option>
219
+ </select></label><p class="description"><?php _e( 'Select one of these default sizes to override the above video sizes.', 'youtube-embed' ); ?></p></td>
220
  </tr>
221
 
222
  <!-- Dynamically Resize -->
223
 
224
  <tr>
225
+ <th scope="row"><?php _e( 'Dynamically Resize', 'youtube-embed' ); ?></th>
226
  <td><label for="youtube_embed_dynamic"><input type="checkbox" name="youtube_embed_dynamic" value="1"<?php if ( $options[ 'dynamic' ] == "1" ) { echo ' checked="checked"'; } ?>/>
227
  <?php _e( 'Show full width and resize with the browser', 'youtube-embed' ); ?></label></td>
228
  </tr>
230
  <!-- Maximum Size -->
231
 
232
  <tr>
233
+ <th scope="row">&nbsp;&nbsp;&nbsp;&nbsp;<?php _e( 'Set Maximum Size', 'youtube-embed' ); ?></th>
234
  <td><label for="youtube_embed_fixed"><input type="checkbox" name="youtube_embed_fixed" value="1"<?php if ( $options[ 'fixed' ] == "1" ) { echo ' checked="checked"'; } ?>/>
235
  <?php _e( 'Use above width to define maximum size', 'youtube-embed' ); ?></label></td>
236
  </tr>
237
 
238
+ <!-- Playsinline -->
239
+
240
+ <tr>
241
+ <th scope="row"><?php _e( 'Plays Inline', 'youtube-embed' ); ?>&nbsp;<img src='<?php echo plugins_url() ; ?>/youtube-embed/images/html5.png' width='10px' align='top'></th>
242
+ <td><label for="youtube_embed_playsinline"><input type="checkbox" name="youtube_embed_playsinline" value="1"<?php if ( $options[ 'playsinline' ] == "1" ) { echo ' checked="checked"'; } ?>/>
243
+ <?php _e( 'Whether videos play inline or fullscreen in an HTML5 player on iOS. ', 'youtube-embed' ); ?></label></td>
244
+ </tr>
245
+
246
  </table><hr><h3 class="title"><?php _e( 'Playback', 'youtube-embed' ); ?></h3><table class="form-table">
247
 
248
  <!-- Autoplay -->
249
 
250
  <tr>
251
+ <th scope="row"><?php _e( 'Autoplay', 'youtube-embed' ); ?></th>
252
  <td><label for="youtube_embed_autoplay"><input type="checkbox" name="youtube_embed_autoplay" value="1"<?php if ( $options[ 'autoplay' ] == "1" ) { echo ' checked="checked"'; } ?>/>
253
  <?php _e( 'Choose whether the initial video will automatically start to play when the player loads', 'youtube-embed' ); ?></label></td>
254
  </tr>
256
  <!-- Loop Video -->
257
 
258
  <tr>
259
+ <th scope="row"><?php _e( 'Loop Video', 'youtube-embed' ); ?></th>
260
  <td><label for="youtube_embed_loop"><input type="checkbox" name="youtube_embed_loop" value="1"<?php if ( $options[ 'loop' ] == "1" ) { echo ' checked="checked"'; } ?>/>
261
  <?php _e( 'Play the initial video again and again', 'youtube-embed' ); ?></label>
262
  <p class="description"><?php _e( 'In the case of a playlist, this will play the entire playlist and then start again at the first video.', 'youtube-embed' ); ?></p></td>
265
  <!-- Annotations -->
266
 
267
  <tr>
268
+ <th scope="row"><?php _e( 'Annotations', 'youtube-embed' ); ?></th>
269
  <td><label for="youtube_embed_annotation"><input type="checkbox" name="youtube_embed_annotation" value="1"<?php if ( $options[ 'annotation' ] == "1" ) { echo ' checked="checked"'; } ?>/>
270
  <?php _e( 'Video annotations are shown by default', 'youtube-embed' ); ?></label></td>
271
  </tr>
273
  <!-- Closed Captions -->
274
 
275
  <tr>
276
+ <th scope="row"><?php _e( 'Closed Captions', 'youtube-embed' ); ?></th>
277
+ <td><label for="youtube_embed_cc"><select name="youtube_embed_cc">
278
+ <option value="0"<?php if ( $options[ 'cc' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Don\'t show closed captions', 'youtube-embed' ); ?></option>
279
+ <option value="1"<?php if ( $options[ 'cc' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Show closed captions', 'youtube-embed' ); ?></option>
280
+ <option value=""<?php if ( $options[ 'cc' ] == "" ) { echo " selected='selected'"; } ?>><?php _e( 'User default', 'youtube-embed' ); ?></option>
281
+ </select></label>
282
+ <p class="description"><?php _e( 'Show closed captions (subtitles).', 'youtube-embed' ); ?></p></td>
283
+ </tr>
284
+
285
+ <!-- HTML5 -->
286
+
287
+ <tr>
288
+ <th scope="row"><?php _e( 'Default to HTML5', 'youtube-embed' ); ?></th>
289
+ <td><label for="youtube_embed_html5"><input type="checkbox" name="youtube_embed_html5" value="1"<?php if ( $options[ 'html5' ] == "1" ) { echo ' checked="checked"'; } ?>/>
290
+ <?php _e( 'Default to the HTML5 player (if available)', 'youtube-embed' ); ?></label>
291
+ <p class="description"><?php _e( 'This is an undocumented feature and may not work.', 'youtube-embed' ); ?></p></td>
292
  </tr>
293
 
294
  </table><hr><h3 class="title"><?php _e( 'Information', 'youtube-embed' ); ?></h3><table class="form-table">
296
  <!-- Info -->
297
 
298
  <tr>
299
+ <th scope="row"><?php _e( 'Information', 'youtube-embed' ); ?></th>
300
  <td><label for="youtube_embed_info"><input type="checkbox" name="youtube_embed_info" value="1"<?php if ( $options[ 'info' ] == "1" ) { echo ' checked="checked"'; } ?>/>
301
  <?php _e( 'Display the video title and uploader before the video starts', 'youtube-embed' ); ?></label>
302
  <p class="description"><?php _e( 'If displaying a playlist this will show video thumbnails.', 'youtube-embed' ); ?></p></td>
305
  <!-- Related -->
306
 
307
  <tr>
308
+ <th scope="row"><?php _e( 'Related Videos', 'youtube-embed' ); ?></th>
309
  <td><label for="youtube_embed_related"><input type="checkbox" name="youtube_embed_related" value="1"<?php if ( $options[ 'related' ] == "1" ) { echo ' checked="checked"'; } ?>/>
310
  <?php _e( 'Load related videos once playback starts', 'youtube-embed' ); ?></label>
311
  <p class="description"><?php _e( 'Also toggles the search option.', 'youtube-embed' ); ?></p></td>
314
  <!-- Modest Branding -->
315
 
316
  <tr>
317
+ <th scope="row"><?php _e( 'Modest Branding', 'youtube-embed' ); ?></th>
318
  <td><label for="youtube_embed_modest"><input type="checkbox" name="youtube_embed_modest" value="1"<?php if ( $options[ 'modest' ] == "1" ) { echo ' checked="checked"'; } ?>/>
319
  <?php _e( 'Reduce branding on video', 'youtube-embed' ); ?></label></td>
320
  </tr>
324
  <!-- Auto Hide -->
325
 
326
  <tr>
327
+ <th scope="row"><?php _e( 'Auto hide', 'youtube-embed' ); ?>&nbsp;<img src='<?php echo plugins_url() ; ?>/youtube-embed/images/flash.png' width='10px' align='top'></th>
328
+ <td><label for="youtube_embed_autohide"><select name="youtube_embed_autohide">
329
  <option value="0"<?php if ( $options[ 'autohide' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls &amp; progress bar remain visible', 'youtube-embed' ); ?></option>
330
  <option value="1"<?php if ( $options[ 'autohide' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls &amp; progress bar fade out', 'youtube-embed' ); ?></option>
331
  <option value="2"<?php if ( $options[ 'autohide' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Progress bar fades', 'youtube-embed' ); ?></option>
332
+ </select></label>
333
  <p class="description"><?php _e( 'Whether the video controls will automatically hide after a video begins playing.', 'youtube-embed' ); ?></p></td>
334
  </tr>
335
 
336
  <!-- Controls -->
337
 
338
  <tr>
339
+ <th scope="row"><?php _e( 'Controls', 'youtube-embed' ); ?></th>
340
+ <td><label for="youtube_embed_controls"><select name="youtube_embed_controls">
341
  <option value="0"<?php if ( $options[ 'controls' ] == "0" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls do not display &amp; Flash player loads immediately', 'youtube-embed' ); ?></option>
342
  <option value="1"<?php if ( $options[ 'controls' ] == "1" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display &amp; Flash player loads immediately', 'youtube-embed' ); ?></option>
343
  <option value="2"<?php if ( $options[ 'controls' ] == "2" ) { echo " selected='selected'"; } ?>><?php _e( 'Controls display &amp; Flash player loads once video starts', 'youtube-embed' ); ?></option>
344
+ </select></label>
345
  <p class="description"><?php _e( 'Whether the video player controls are displayed. For Flash it also defines when the controls display in the player as well as when the player will load.', 'youtube-embed' ); ?></p></td>
346
  </tr>
347
 
348
  <!-- Disable Keyboard -->
349
 
350
  <tr>
351
+ <th scope="row"><?php _e( 'Disable Keyboard', 'youtube-embed' ); ?></th>
352
  <td><label for="youtube_embed_disablekb"><input type="checkbox" name="youtube_embed_disablekb" value="1"<?php if ( $options[ 'disablekb' ] == "1" ) { echo ' checked="checked"'; } ?>/>
353
  <?php _e( 'Disable the player keyboard controls', 'youtube-embed' ); ?></label></td>
354
  </tr>
356
  <!-- Fullscreen -->
357
 
358
  <tr>
359
+ <th scope="row"><?php _e( 'Fullscreen', 'youtube-embed' ); ?></th>
360
  <td><label for="youtube_embed_fullscreen"><input type="checkbox" name="youtube_embed_fullscreen" value="1"<?php if ( $options[ 'fullscreen' ] == "1" ) { echo ' checked="checked"'; } ?>/>
361
  <?php _e( 'A button will allow the viewer to watch the video fullscreen', 'youtube-embed' ); ?></label></td>
362
  </tr>
364
  <!-- Theme -->
365
 
366
  <tr>
367
+ <th scope="row"><?php _e( 'Theme', 'youtube-embed' ); ?>&nbsp;<img src='<?php echo plugins_url() ; ?>/youtube-embed/images/flash.png' width='10px' align='top'></th>
368
+ <td><label for="youtube_embed_theme"><select name="youtube_embed_theme">
369
  <option value="dark"<?php if ( $options[ 'theme' ] == "dark" ) { echo " selected='selected'"; } ?>><?php _e( 'Dark', 'youtube-embed' ); ?></option>
370
  <option value="light"<?php if ( $options[ 'theme' ] == "light" ) { echo " selected='selected'"; } ?>><?php _e( 'Light', 'youtube-embed' ); ?></option>
371
+ </select></label>
372
  <p class="description"><?php _e( 'Display player controls within a dark or light control bar.', 'youtube-embed' ); ?></p></td>
373
  </tr>
374
 
375
  <!-- Color -->
376
 
377
  <tr>
378
+ <th scope="row"><?php _e( 'Progress Bar Color', 'youtube-embed' ); ?></th>
379
+ <td><label for="youtube_embed_color"><select name="youtube_embed_color">
380
  <option value="red"<?php if ( $options[ 'color' ] == "red" ) { echo " selected='selected'"; } ?>><?php _e( 'Red', 'youtube-embed' ); ?></option>
381
  <option value="white"<?php if ( $options[ 'color' ] == "white" ) { echo " selected='selected'"; } ?>><?php _e( 'White (desaturated)', 'youtube-embed' ); ?></option>
382
+ </select></label>
383
  <p class="description"><?php _e( 'The color that will be used in the player\'s video progress bar to highlight the amount of the video that\'s already been seen.', 'youtube-embed' ); ?></p></td>
384
  </tr>
385
 
388
  <!-- Download Link -->
389
 
390
  <tr>
391
+ <th scope="row"><?php _e( 'Show Download Link', 'youtube-embed' ); ?></th>
392
  <td><label for="youtube_embed_download"><input type="checkbox" name="youtube_embed_download" value="1"<?php if ( $options[ 'download' ] == "1" ) { echo ' checked="checked"'; } ?>/>
393
  <?php echo sprintf( __( 'Show a link to %s under the video', 'youtube-embed' ), '<a href="http://keepvid.com/" rel="nofollow">KeepVid</a>' ); ?></label></td>
394
  </tr>
396
  <!-- Download Text -->
397
 
398
  <tr>
399
+ <th scope="row"><?php _e( 'Download Text', 'youtube-embed' ); ?></th>
400
+ <td><label for="youtube_embed_download_txt"><input type="text" name="youtube_embed_download_text" class="large-text" value="<?php echo htmlspecialchars( $options[ 'download_text' ] ); ?>"/>
401
+ <p class="description"><?php _e( 'Text or HTML to display to prompt download.', 'youtube-embed' ); ?></p></label></td>
402
  </tr>
403
 
404
  <!-- Download Style -->
405
 
406
  <tr>
407
+ <th scope="row"><?php _e( 'Download Style', 'youtube-embed' ); ?></th>
408
+ <td><label for="youtube_embed_download_style"><input type="text" name="youtube_embed_download_style" class="large-text code" value="<?php echo htmlspecialchars( $options[ 'download_style' ] ); ?>"/>
409
+ <p class="description"><?php _e( 'CSS elements to apply to video download link.', 'youtube-embed' ); ?></p></label></td>
410
  </tr>
411
 
412
  </table>
418
  </form>
419
 
420
  <a href="#" name="video"></a>
421
+ <div style="max-width: <?php echo $options[ 'width' ]; ?>px">
422
  <form method="post" action="<?php echo get_bloginfo( 'wpurl' ).'/wp-admin/admin.php?page=ye-profile-options#video' ?>">
423
  <h3><?php _e( 'YouTube Video Sample', 'youtube-embed' ); ?></h3>
424
  <p><?php _e( 'The video below uses the above, saved profile settings. Use the drop-down below to change which parameters the video uses - press the Change Video button to update it.', 'youtube-embed' ); ?></p>
437
  echo vye_generate_youtube_code( $id, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', $profile_no );
438
  ?></p>
439
 
440
+ </form></div>
441
 
442
  </div>
includes/shared-functions.php CHANGED
@@ -350,9 +350,10 @@ function vye_set_autohide( $autohide ) {
350
  *
351
  * @param string $current The current profile number
352
  * @param string $total The total number of profiles
 
353
  */
354
 
355
- function vye_generate_profile_list( $current, $total ) {
356
 
357
  echo '<option value="0"';
358
  if ( $current == "0" ) { echo " selected='selected'"; }
@@ -360,15 +361,27 @@ function vye_generate_profile_list( $current, $total ) {
360
  $loop = 1;
361
  while ( $loop <= $total ) {
362
 
 
 
363
  $profiles = get_option( 'youtube_embed_profile' . $loop );
364
  $profname = $profiles[ 'name' ];
 
 
 
 
 
 
 
365
 
366
- if ( $profname == '' ) { $profname = __( 'Profile' ) . ' ' . $loop; }
367
- if ( strlen( $profname ) > 30 ) { $profname = substr( $profname, 0, 30 ) . '&#8230;'; }
368
- echo '<option value="' . $loop . '"';
369
 
370
- if ( $current == $loop ) { echo " selected='selected'"; }
371
- echo '>' . __( $profname ) . "</option>\n";
 
 
 
 
 
372
 
373
  $loop ++;
374
  }
@@ -462,42 +475,35 @@ function vye_set_shortcode_option() {
462
  function vye_set_general_defaults() {
463
 
464
  $options = get_option( 'youtube_embed_general' );
465
- $changed = false;
466
- $default_error = '<p>' . __( 'The video cannot be shown at the moment. Please try again later.', 'youtube-embed' ) . '</p>';
467
-
468
- // If the old options exist, import them and then delete them
469
-
470
- if ( !is_array( $options ) ) {
471
- if ( get_option( 'youtube_embed_editor' ) ) {
472
- $old_opts = get_option( 'youtube_embed_editor' );
473
- $options[ 'editor_button' ] = $old_opts[ 'youtube' ];
474
- delete_option( 'youtube_embed_editor' );
475
- $changed = true;
476
- } else {
477
- $options = array();
478
- }
479
- }
480
 
481
  // Because of upgrading, check each option - if not set, apply default
482
 
483
- if ( !array_key_exists( 'editor_button', $options ) ) { $options[ 'editor_button' ] = 1; $changed = true; }
484
- if ( !array_key_exists( 'admin_bar', $options ) ) { $options[ 'admin_bar' ] = 1; $changed = true; }
485
- if ( !array_key_exists( 'profile_no', $options ) ) { $options[ 'profile_no' ] = 5; $changed = true; }
486
- if ( !array_key_exists( 'list_no', $options ) ) { $options[ 'list_no' ] = 5; $changed = true; }
487
- if ( !array_key_exists( 'embed_cache', $options ) ) { $options[ 'embed_cache' ] = 24; $changed = true; }
488
- if ( !array_key_exists( 'alt_profile', $options ) ) { $options[ 'alt_profile' ] = 0; $changed = true; }
489
- if ( !array_key_exists( 'metadata', $options ) ) { $options[ 'metadata' ] = 1; $changed = true; }
490
- if ( !array_key_exists( 'feed', $options ) ) { $options[ 'feed' ] = 'b'; $changed = true; }
491
- if ( !array_key_exists( 'thumbnail', $options ) ) { $options[ 'thumbnail' ] = 2; $changed = true; }
492
- if ( !array_key_exists( 'privacy', $options ) ) { $options[ 'privacy' ] = 0; $changed = true; }
493
- if ( !array_key_exists( 'frameborder', $options ) ) { $options[ 'frameborder' ] = 1; $changed = true; }
494
- if ( !array_key_exists( 'widgets', $options ) ) { $options[ 'widgets' ] = 0; $changed = true; }
495
- if ( !array_key_exists( 'menu_access', $options ) ) { $options[ 'menu_access' ] = 'list_users'; $changed = true; }
 
 
 
 
 
 
 
496
 
497
  // Update the options, if changed, and return the result
498
 
499
- if ( $changed ) { update_option( 'youtube_embed_general', $options ); }
500
- return $options;
 
501
  }
502
 
503
  /**
@@ -578,6 +584,8 @@ function vye_set_profile_defaults( $profile ) {
578
  if ( !array_key_exists( 'download', $options ) ) { $options[ 'download' ] = ''; $changed = true; }
579
  if ( !array_key_exists( 'download_style', $options ) ) { $options[ 'download_style' ] = ''; $changed = true; }
580
  if ( !array_key_exists( 'download_text', $options ) ) { $options[ 'download_text' ] = 'Click here to download the video'; $changed = true; }
 
 
581
 
582
  // Update the options, if changed, and return the result
583
 
@@ -603,6 +611,7 @@ function vye_set_profile_defaults( $profile ) {
603
  */
604
 
605
  function vye_set_list_defaults( $list ) {
 
606
  $options = get_option( 'youtube_embed_list' . $list );
607
  $changed = false;
608
 
@@ -620,4 +629,26 @@ function vye_set_list_defaults( $list ) {
620
  if ( $changed ) { update_option( 'youtube_embed_list' . $list, $options ); }
621
  return $options;
622
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
623
  ?>
350
  *
351
  * @param string $current The current profile number
352
  * @param string $total The total number of profiles
353
+ * @param string $full_list Show the full list or just those defined?
354
  */
355
 
356
+ function vye_generate_profile_list( $current, $total, $full_list = false ) {
357
 
358
  echo '<option value="0"';
359
  if ( $current == "0" ) { echo " selected='selected'"; }
361
  $loop = 1;
362
  while ( $loop <= $total ) {
363
 
364
+ // Attempt to get profile
365
+
366
  $profiles = get_option( 'youtube_embed_profile' . $loop );
367
  $profname = $profiles[ 'name' ];
368
+ $list_found = true;
369
+
370
+ // If list is undefined, give it a default name
371
+
372
+ if ( $profname == '' ) { $profname = __( 'Profile' ) . ' ' . $loop; $list_found = false; }
373
+
374
+ // Output profile information
375
 
376
+ if ( ( $list_found ) or ( $full_list ) ) {
 
 
377
 
378
+ echo '<option value="' . $loop . '"';
379
+ if ( $current == $loop ) { echo " selected='selected'"; }
380
+ echo '>' . __( $profname );
381
+ if ( !$list_found ) { echo ' [undefined]'; }
382
+ echo "</option>\n";
383
+
384
+ }
385
 
386
  $loop ++;
387
  }
475
  function vye_set_general_defaults() {
476
 
477
  $options = get_option( 'youtube_embed_general' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
 
479
  // Because of upgrading, check each option - if not set, apply default
480
 
481
+ $default_array = array(
482
+ 'editor_button' => 1,
483
+ 'admin_bar' => 1,
484
+ 'profile_no' => 5,
485
+ 'list_no' => 5,
486
+ 'alt_profile' => 0,
487
+ 'metadata' => 1,
488
+ 'feed' => 'b',
489
+ 'thumbnail' => 2,
490
+ 'privacy' => 0,
491
+ 'frameborder' => 1,
492
+ 'widgets' => 0,
493
+ 'menu_access' => 'list_users',
494
+ 'language' => '',
495
+ 'debug' => 1,
496
+ 'script' => '',
497
+ 'prompt' => 1
498
+ );
499
+
500
+ $new_options = array_merge( $default_array, $options );
501
 
502
  // Update the options, if changed, and return the result
503
 
504
+ if ( $options != $new_options ) { update_option( 'youtube_embed_general', $new_options ); }
505
+
506
+ return $new_options;
507
  }
508
 
509
  /**
584
  if ( !array_key_exists( 'download', $options ) ) { $options[ 'download' ] = ''; $changed = true; }
585
  if ( !array_key_exists( 'download_style', $options ) ) { $options[ 'download_style' ] = ''; $changed = true; }
586
  if ( !array_key_exists( 'download_text', $options ) ) { $options[ 'download_text' ] = 'Click here to download the video'; $changed = true; }
587
+ if ( !array_key_exists( 'playsinline', $options ) ) { $options[ 'playsinline' ] = ''; $changed = true; }
588
+ if ( !array_key_exists( 'html5', $options ) ) { $options[ 'html5' ] = ''; $changed = true; }
589
 
590
  // Update the options, if changed, and return the result
591
 
611
  */
612
 
613
  function vye_set_list_defaults( $list ) {
614
+
615
  $options = get_option( 'youtube_embed_list' . $list );
616
  $changed = false;
617
 
629
  if ( $changed ) { update_option( 'youtube_embed_list' . $list, $options ); }
630
  return $options;
631
  }
632
+
633
+ /**
634
+ * Output timing
635
+ *
636
+ * Used by the author for testing purposes
637
+ *
638
+ * @since 2.1
639
+ *
640
+ * @param string $checkpoint The last time
641
+ * @param string $name The name of the checkpoint
642
+ * @return string New checkpoint
643
+ */
644
+
645
+ function ye_timer( $checkpoint, $name ) {
646
+
647
+ $timing = ( microtime( true ) - $checkpoint );
648
+
649
+ echo '<p>' . $name . ': ' . ( $timing * 1000000 ) . ' microseconds.</p>';
650
+
651
+ return microtime( true );
652
+
653
+ }
654
  ?>
includes/shortcodes.php CHANGED
@@ -23,7 +23,9 @@
23
  */
24
 
25
  function vye_video_shortcode_default( $paras = '', $content = '' ) {
 
26
  return do_shortcode( vye_video_shortcode( $paras, $content ) );
 
27
  }
28
 
29
  add_shortcode( 'youtube', 'vye_video_shortcode_default' );
@@ -43,9 +45,13 @@ add_shortcode( 'youtube', 'vye_video_shortcode_default' );
43
  */
44
 
45
  function vye_video_shortcode_alt( $paras = '', $content = '' ) {
 
46
  return do_shortcode( vye_video_shortcode( $paras, $content, '', true ) );
 
47
  }
 
48
  $shortcode = vye_set_shortcode_option();
 
49
  if ( isset( $shortcode ) && $shortcode != '' ) { add_shortcode( $shortcode, 'vye_video_shortcode_alt' ); }
50
 
51
  /**
@@ -68,7 +74,7 @@ if ( isset( $shortcode ) && $shortcode != '' ) { add_shortcode( $shortcode, 'vye
68
 
69
  function vye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode = false ) {
70
 
71
- extract( shortcode_atts( array( 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'info' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'stop' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'id' => '', 'url' => '', 'rel' => '', 'fs' => '', 'cc_load_policy' => '', 'iv_load_policy' => '', 'showinfo' => '', 'youtubeurl' => '', 'template' => '', 'list' => '', 'color' => '', 'theme' => '', 'ssl' => '', 'height' => '', 'width' => '', 'dynamic' => '', 'h' => '', 'w' => '', 'search' => '', 'user' => '', 'modest' => '' ), $paras ) );
72
 
73
  // If no profile specified and an alternative shortcode used, get that shortcodes default profile
74
 
@@ -115,9 +121,9 @@ function vye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_s
115
 
116
  // Create YouTube code
117
 
118
- $youtube_code = vye_generate_youtube_code( $content, $width, $height, vye_convert( $fullscreen ), vye_convert( $related ), vye_convert( $autoplay ), vye_convert( $loop ), $start, vye_convert( $info ), vye_convert_3( $annotation ), vye_convert( $cc ), $style, $stop, vye_convert( $disablekb ), $ratio, $autohide, $controls, $profile, $list, $template, $color, $theme, vye_convert( $ssl ), vye_convert( $dynamic ), vye_convert( $search ), vye_convert( $user ), vye_convert( $modest ) );
119
 
120
- return do_shortcode( $youtube_code );
121
  }
122
 
123
  /**
@@ -135,8 +141,11 @@ function vye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_s
135
  */
136
 
137
  function vye_thumbnail_sc( $paras = '', $content = '' ) {
 
138
  extract( shortcode_atts( array( 'style' => '', 'class' => '', 'rel' => '', 'target' => '', 'width' => '', 'height' => '', 'alt' => '', 'version' => '', 'nolink' => '' ), $paras ) );
 
139
  return do_shortcode( vye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version, $nolink ) );
 
140
  }
141
 
142
  add_shortcode( 'youtube_thumb', 'vye_thumbnail_sc' );
@@ -156,8 +165,11 @@ add_shortcode( 'youtube_thumb', 'vye_thumbnail_sc' );
156
  */
157
 
158
  function vye_shorturl_sc( $paras = '', $content = '' ) {
 
159
  extract( shortcode_atts( array( 'id' => '' ), $paras ) );
 
160
  return do_shortcode( vye_generate_shorturl_code( $id ) );
 
161
  }
162
 
163
  add_shortcode( 'youtube_url', 'vye_shorturl_sc' );
@@ -180,6 +192,26 @@ function vye_video_download( $paras = '', $content = '' ) {
180
 
181
  extract( shortcode_atts( array( 'id' => '' ), $paras ) );
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  // Get the download code
184
 
185
  $link = vye_generate_download_code( $id );
23
  */
24
 
25
  function vye_video_shortcode_default( $paras = '', $content = '' ) {
26
+
27
  return do_shortcode( vye_video_shortcode( $paras, $content ) );
28
+
29
  }
30
 
31
  add_shortcode( 'youtube', 'vye_video_shortcode_default' );
45
  */
46
 
47
  function vye_video_shortcode_alt( $paras = '', $content = '' ) {
48
+
49
  return do_shortcode( vye_video_shortcode( $paras, $content, '', true ) );
50
+
51
  }
52
+
53
  $shortcode = vye_set_shortcode_option();
54
+
55
  if ( isset( $shortcode ) && $shortcode != '' ) { add_shortcode( $shortcode, 'vye_video_shortcode_alt' ); }
56
 
57
  /**
74
 
75
  function vye_video_shortcode( $paras = '', $content = '', $callback = '', $alt_shortcode = false ) {
76
 
77
+ extract( shortcode_atts( array( 'width' => '', 'height' => '', 'fullscreen' => '', 'related' => '', 'autoplay' => '', 'loop' => '', 'start' => '', 'info' => '', 'annotation' => '', 'cc' => '', 'style' => '', 'stop' => '', 'disablekb' => '', 'ratio' => '', 'autohide' => '', 'controls' => '', 'profile' => '', 'id' => '', 'url' => '', 'rel' => '', 'fs' => '', 'cc_load_policy' => '', 'iv_load_policy' => '', 'showinfo' => '', 'youtubeurl' => '', 'template' => '', 'list' => '', 'color' => '', 'theme' => '', 'ssl' => '', 'height' => '', 'width' => '', 'dynamic' => '', 'h' => '', 'w' => '', 'search' => '', 'user' => '', 'modest' => '', 'playsinline' => '', 'html5' => '' ), $paras ) );
78
 
79
  // If no profile specified and an alternative shortcode used, get that shortcodes default profile
80
 
121
 
122
  // Create YouTube code
123
 
124
+ $youtube_code = vye_generate_youtube_code( $content, $width, $height, vye_convert( $fullscreen ), vye_convert( $related ), vye_convert( $autoplay ), vye_convert( $loop ), $start, vye_convert( $info ), vye_convert_3( $annotation ), vye_convert( $cc ), $style, $stop, vye_convert( $disablekb ), $ratio, $autohide, $controls, $profile, $list, $template, $color, $theme, vye_convert( $ssl ), vye_convert( $dynamic ), vye_convert( $search ), vye_convert( $user ), vye_convert( $modest ), vye_convert( $playsinline ), vye_convert( $html5 ) );
125
 
126
+ return apply_filters( 'a3_lazy_load_html', do_shortcode( $youtube_code ) );
127
  }
128
 
129
  /**
141
  */
142
 
143
  function vye_thumbnail_sc( $paras = '', $content = '' ) {
144
+
145
  extract( shortcode_atts( array( 'style' => '', 'class' => '', 'rel' => '', 'target' => '', 'width' => '', 'height' => '', 'alt' => '', 'version' => '', 'nolink' => '' ), $paras ) );
146
+
147
  return do_shortcode( vye_generate_thumbnail_code( $content, $style, $class, $rel, $target, $width, $height, $alt, $version, $nolink ) );
148
+
149
  }
150
 
151
  add_shortcode( 'youtube_thumb', 'vye_thumbnail_sc' );
165
  */
166
 
167
  function vye_shorturl_sc( $paras = '', $content = '' ) {
168
+
169
  extract( shortcode_atts( array( 'id' => '' ), $paras ) );
170
+
171
  return do_shortcode( vye_generate_shorturl_code( $id ) );
172
+
173
  }
174
 
175
  add_shortcode( 'youtube_url', 'vye_shorturl_sc' );
192
 
193
  extract( shortcode_atts( array( 'id' => '' ), $paras ) );
194
 
195
+ if ( $id == '' ) { return do_shortcode( vye_error( __ ( 'No YouTube ID was found.', 'youtube-embed' ) ) ); }
196
+
197
+ // Extract the ID if a full URL has been specified
198
+
199
+ $id = vye_extract_id( $id );
200
+
201
+ // Check what type of video it is and whether it's valid
202
+
203
+ $embed_type = vye_validate_id( $id );
204
+
205
+ if ( $embed_type != 'v' ) {
206
+
207
+ if ( strlen( $embed_type ) > 1 ) {
208
+ return do_shortcode( vye_error( $embed_type ) );
209
+ } else {
210
+ return do_shortcode( vye_error( sprintf( __( 'The YouTube ID of %s is invalid.', 'youtube-embed' ), $id ) ) );
211
+ }
212
+
213
+ }
214
+
215
  // Get the download code
216
 
217
  $link = vye_generate_download_code( $id );
js/iframeResizer.js ADDED
@@ -0,0 +1,994 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * File: iframeResizer.js
3
+ * Desc: Force iframes to size to content.
4
+ * Requires: iframeResizer.contentWindow.js to be loaded into the target frame.
5
+ * Doc: https://github.com/davidjbradshaw/iframe-resizer
6
+ * Author: David J. Bradshaw - dave@bradshaw.net
7
+ * Contributor: Jure Mav - jure.mav@gmail.com
8
+ * Contributor: Reed Dadoune - reed@dadoune.com
9
+ */
10
+
11
+
12
+ ;(function(window) {
13
+ 'use strict';
14
+
15
+ var
16
+ count = 0,
17
+ logEnabled = false,
18
+ hiddenCheckEnabled = false,
19
+ msgHeader = 'message',
20
+ msgHeaderLen = msgHeader.length,
21
+ msgId = '[iFrameSizer]', //Must match iframe msg ID
22
+ msgIdLen = msgId.length,
23
+ pagePosition = null,
24
+ requestAnimationFrame = window.requestAnimationFrame,
25
+ resetRequiredMethods = {max:1,scroll:1,bodyScroll:1,documentElementScroll:1},
26
+ settings = {},
27
+ timer = null,
28
+ logId = 'Host Page',
29
+
30
+ defaults = {
31
+ autoResize : true,
32
+ bodyBackground : null,
33
+ bodyMargin : null,
34
+ bodyMarginV1 : 8,
35
+ bodyPadding : null,
36
+ checkOrigin : true,
37
+ inPageLinks : false,
38
+ enablePublicMethods : true,
39
+ heightCalculationMethod : 'bodyOffset',
40
+ id : 'iFrameResizer',
41
+ interval : 32,
42
+ log : false,
43
+ maxHeight : Infinity,
44
+ maxWidth : Infinity,
45
+ minHeight : 0,
46
+ minWidth : 0,
47
+ resizeFrom : 'parent',
48
+ scrolling : false,
49
+ sizeHeight : true,
50
+ sizeWidth : false,
51
+ tolerance : 0,
52
+ widthCalculationMethod : 'scroll',
53
+ closedCallback : function(){},
54
+ initCallback : function(){},
55
+ messageCallback : function(){warn('MessageCallback function not defined');},
56
+ resizedCallback : function(){},
57
+ scrollCallback : function(){return true;}
58
+ };
59
+
60
+ function addEventListener(obj,evt,func){
61
+ /* istanbul ignore else */ // Not testable in PhantonJS
62
+ if ('addEventListener' in window){
63
+ obj.addEventListener(evt,func, false);
64
+ } else if ('attachEvent' in window){//IE
65
+ obj.attachEvent('on'+evt,func);
66
+ }
67
+ }
68
+
69
+ function removeEventListener(el,evt,func){
70
+ /* istanbul ignore else */ // Not testable in phantonJS
71
+ if ('removeEventListener' in window){
72
+ el.removeEventListener(evt,func, false);
73
+ } else if ('detachEvent' in window){ //IE
74
+ el.detachEvent('on'+evt,func);
75
+ }
76
+ }
77
+
78
+ function setupRequestAnimationFrame(){
79
+ var
80
+ vendors = ['moz', 'webkit', 'o', 'ms'],
81
+ x;
82
+
83
+ // Remove vendor prefixing if prefixed and break early if not
84
+ for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {
85
+ requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
86
+ }
87
+
88
+ if (!(requestAnimationFrame)){
89
+ log('setup','RequestAnimationFrame not supported');
90
+ }
91
+ }
92
+
93
+ function getMyID(iframeId){
94
+ var retStr = 'Host page: '+iframeId;
95
+
96
+ if (window.top!==window.self){
97
+ if (window.parentIFrame && window.parentIFrame.getId){
98
+ retStr = window.parentIFrame.getId()+': '+iframeId;
99
+ } else {
100
+ retStr = 'Nested host page: '+iframeId;
101
+ }
102
+ }
103
+
104
+ return retStr;
105
+ }
106
+
107
+ function formatLogHeader(iframeId){
108
+ return msgId + '[' + getMyID(iframeId) + ']';
109
+ }
110
+
111
+ function isLogEnabled(iframeId){
112
+ return settings[iframeId] ? settings[iframeId].log : logEnabled;
113
+ }
114
+
115
+ function log(iframeId,msg){
116
+ output('log',iframeId,msg,isLogEnabled(iframeId));
117
+ }
118
+
119
+ function info(iframeId,msg){
120
+ output('info',iframeId,msg,isLogEnabled(iframeId));
121
+ }
122
+
123
+ function warn(iframeId,msg){
124
+ output('warn',iframeId,msg,true);
125
+ }
126
+
127
+ function output(type,iframeId,msg,enabled){
128
+ if (true === enabled && 'object' === typeof window.console){
129
+ console[type](formatLogHeader(iframeId),msg);
130
+ }
131
+ }
132
+
133
+ function iFrameListener(event){
134
+ function resizeIFrame(){
135
+ function resize(){
136
+ setSize(messageData);
137
+ setPagePosition(iframeId);
138
+ }
139
+
140
+ ensureInRange('Height');
141
+ ensureInRange('Width');
142
+
143
+ syncResize(resize,messageData,'init');
144
+ }
145
+
146
+ function processMsg(){
147
+ var data = msg.substr(msgIdLen).split(':');
148
+
149
+ return {
150
+ iframe: settings[data[0]].iframe,
151
+ id: data[0],
152
+ height: data[1],
153
+ width: data[2],
154
+ type: data[3]
155
+ };
156
+ }
157
+
158
+ function ensureInRange(Dimension){
159
+ var
160
+ max = Number(settings[iframeId]['max' + Dimension]),
161
+ min = Number(settings[iframeId]['min' + Dimension]),
162
+ dimension = Dimension.toLowerCase(),
163
+ size = Number(messageData[dimension]);
164
+
165
+ log(iframeId,'Checking ' + dimension + ' is in range ' + min + '-' + max);
166
+
167
+ if (size<min) {
168
+ size=min;
169
+ log(iframeId,'Set ' + dimension + ' to min value');
170
+ }
171
+
172
+ if (size>max) {
173
+ size=max;
174
+ log(iframeId,'Set ' + dimension + ' to max value');
175
+ }
176
+
177
+ messageData[dimension] = '' + size;
178
+ }
179
+
180
+
181
+ function isMessageFromIFrame(){
182
+ function checkAllowedOrigin(){
183
+ function checkList(){
184
+ var
185
+ i = 0,
186
+ retCode = false;
187
+
188
+ log(iframeId,'Checking connection is from allowed list of origins: ' + checkOrigin);
189
+
190
+ for (; i < checkOrigin.length; i++) {
191
+ if (checkOrigin[i] === origin) {
192
+ retCode = true;
193
+ break;
194
+ }
195
+ }
196
+ return retCode;
197
+ }
198
+
199
+ function checkSingle(){
200
+ var remoteHost = settings[iframeId].remoteHost;
201
+ log(iframeId,'Checking connection is from: '+remoteHost);
202
+ return origin === remoteHost;
203
+ }
204
+
205
+ return checkOrigin.constructor === Array ? checkList() : checkSingle();
206
+ }
207
+
208
+ var
209
+ origin = event.origin,
210
+ checkOrigin = settings[iframeId].checkOrigin;
211
+
212
+ if (checkOrigin && (''+origin !== 'null') && !checkAllowedOrigin()) {
213
+ throw new Error(
214
+ 'Unexpected message received from: ' + origin +
215
+ ' for ' + messageData.iframe.id +
216
+ '. Message was: ' + event.data +
217
+ '. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'
218
+ );
219
+ }
220
+
221
+ return true;
222
+ }
223
+
224
+ function isMessageForUs(){
225
+ return msgId === (('' + msg).substr(0,msgIdLen)) && (msg.substr(msgIdLen).split(':')[0] in settings); //''+Protects against non-string msg
226
+ }
227
+
228
+ function isMessageFromMetaParent(){
229
+ //Test if this message is from a parent above us. This is an ugly test, however, updating
230
+ //the message format would break backwards compatibity.
231
+ var retCode = messageData.type in {'true':1,'false':1,'undefined':1};
232
+
233
+ if (retCode){
234
+ log(iframeId,'Ignoring init message from meta parent page');
235
+ }
236
+
237
+ return retCode;
238
+ }
239
+
240
+ function getMsgBody(offset){
241
+ return msg.substr(msg.indexOf(':')+msgHeaderLen+offset);
242
+ }
243
+
244
+ function forwardMsgFromIFrame(msgBody){
245
+ log(iframeId,'MessageCallback passed: {iframe: '+ messageData.iframe.id + ', message: ' + msgBody + '}');
246
+ callback('messageCallback',{
247
+ iframe: messageData.iframe,
248
+ message: JSON.parse(msgBody)
249
+ });
250
+ log(iframeId,'--');
251
+ }
252
+
253
+ function getPageInfo(){
254
+ var
255
+ bodyPosition = document.body.getBoundingClientRect(),
256
+ iFramePosition = messageData.iframe.getBoundingClientRect();
257
+
258
+ return JSON.stringify({
259
+ clientHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
260
+ clientWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0),
261
+ offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
262
+ offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
263
+ scrollTop: window.pageYOffset,
264
+ scrollLeft: window.pageXOffset
265
+ });
266
+ }
267
+
268
+ function sendPageInfoToIframe(iframe,iframeId){
269
+ function debouncedTrigger(){
270
+ trigger(
271
+ 'Send Page Info',
272
+ 'pageInfo:' + getPageInfo(),
273
+ iframe,
274
+ iframeId
275
+ );
276
+ }
277
+
278
+ debouce(debouncedTrigger,32);
279
+ }
280
+
281
+
282
+ function startPageInfoMonitor(){
283
+ function setListener(type,func){
284
+ function sendPageInfo(){
285
+ if (settings[id]){
286
+ sendPageInfoToIframe(settings[id].iframe,id);
287
+ } else {
288
+ stop();
289
+ }
290
+ }
291
+
292
+ ['scroll','resize'].forEach(function(evt){
293
+ log(id, type + evt + ' listener for sendPageInfo');
294
+ func(window,evt,sendPageInfo);
295
+ });
296
+ }
297
+
298
+ function stop(){
299
+ setListener('Remove ', removeEventListener);
300
+ }
301
+
302
+ function start(){
303
+ setListener('Add ', addEventListener);
304
+ }
305
+
306
+ var id = iframeId; //Create locally scoped copy of iFrame ID
307
+
308
+ start();
309
+
310
+ settings[id].stopPageInfo = stop;
311
+ }
312
+
313
+ function stopPageInfoMonitor(){
314
+ if (settings[iframeId] && settings[iframeId].stopPageInfo){
315
+ settings[iframeId].stopPageInfo();
316
+ delete settings[iframeId].stopPageInfo;
317
+ }
318
+ }
319
+
320
+ function checkIFrameExists(){
321
+ var retBool = true;
322
+
323
+ if (null === messageData.iframe) {
324
+ warn(iframeId,'IFrame ('+messageData.id+') not found');
325
+ retBool = false;
326
+ }
327
+ return retBool;
328
+ }
329
+
330
+ function getElementPosition(target){
331
+ var iFramePosition = target.getBoundingClientRect();
332
+
333
+ getPagePosition(iframeId);
334
+
335
+ return {
336
+ x: Math.floor( Number(iFramePosition.left) + Number(pagePosition.x) ),
337
+ y: Math.floor( Number(iFramePosition.top) + Number(pagePosition.y) )
338
+ };
339
+ }
340
+
341
+ function scrollRequestFromChild(addOffset){
342
+ /* istanbul ignore next */ //Not testable in Karma
343
+ function reposition(){
344
+ pagePosition = newPosition;
345
+ scrollTo();
346
+ log(iframeId,'--');
347
+ }
348
+
349
+ function calcOffset(){
350
+ return {
351
+ x: Number(messageData.width) + offset.x,
352
+ y: Number(messageData.height) + offset.y
353
+ };
354
+ }
355
+
356
+ function scrollParent(){
357
+ if (window.parentIFrame){
358
+ window.parentIFrame['scrollTo'+(addOffset?'Offset':'')](newPosition.x,newPosition.y);
359
+ } else {
360
+ warn(iframeId,'Unable to scroll to requested position, window.parentIFrame not found');
361
+ }
362
+ }
363
+
364
+ var
365
+ offset = addOffset ? getElementPosition(messageData.iframe) : {x:0,y:0},
366
+ newPosition = calcOffset();
367
+
368
+ log(iframeId,'Reposition requested from iFrame (offset x:'+offset.x+' y:'+offset.y+')');
369
+
370
+ if(window.top!==window.self){
371
+ scrollParent();
372
+ } else {
373
+ reposition();
374
+ }
375
+ }
376
+
377
+ function scrollTo(){
378
+ if (false !== callback('scrollCallback',pagePosition)){
379
+ setPagePosition(iframeId);
380
+ } else {
381
+ unsetPagePosition();
382
+ }
383
+ }
384
+
385
+ function findTarget(location){
386
+ function jumpToTarget(){
387
+ var jumpPosition = getElementPosition(target);
388
+
389
+ log(iframeId,'Moving to in page link (#'+hash+') at x: '+jumpPosition.x+' y: '+jumpPosition.y);
390
+ pagePosition = {
391
+ x: jumpPosition.x,
392
+ y: jumpPosition.y
393
+ };
394
+
395
+ scrollTo();
396
+ log(iframeId,'--');
397
+ }
398
+
399
+ function jumpToParent(){
400
+ if (window.parentIFrame){
401
+ window.parentIFrame.moveToAnchor(hash);
402
+ } else {
403
+ log(iframeId,'In page link #'+hash+' not found and window.parentIFrame not found');
404
+ }
405
+ }
406
+
407
+ var
408
+ hash = location.split('#')[1] || '',
409
+ hashData = decodeURIComponent(hash),
410
+ target = document.getElementById(hashData) || document.getElementsByName(hashData)[0];
411
+
412
+ if (target){
413
+ jumpToTarget();
414
+ } else if(window.top!==window.self){
415
+ jumpToParent();
416
+ } else {
417
+ log(iframeId,'In page link #'+hash+' not found');
418
+ }
419
+ }
420
+
421
+ function callback(funcName,val){
422
+ return chkCallback(iframeId,funcName,val);
423
+ }
424
+
425
+ function actionMsg(){
426
+
427
+ if(settings[iframeId].firstRun) firstRun();
428
+
429
+ switch(messageData.type){
430
+ case 'close':
431
+ closeIFrame(messageData.iframe);
432
+ break;
433
+ case 'message':
434
+ forwardMsgFromIFrame(getMsgBody(6));
435
+ break;
436
+ case 'scrollTo':
437
+ scrollRequestFromChild(false);
438
+ break;
439
+ case 'scrollToOffset':
440
+ scrollRequestFromChild(true);
441
+ break;
442
+ case 'pageInfo':
443
+ sendPageInfoToIframe(settings[iframeId].iframe,iframeId);
444
+ startPageInfoMonitor();
445
+ break;
446
+ case 'pageInfoStop':
447
+ stopPageInfoMonitor();
448
+ break;
449
+ case 'inPageLink':
450
+ findTarget(getMsgBody(9));
451
+ break;
452
+ case 'reset':
453
+ resetIFrame(messageData);
454
+ break;
455
+ case 'init':
456
+ resizeIFrame();
457
+ callback('initCallback',messageData.iframe);
458
+ callback('resizedCallback',messageData);
459
+ break;
460
+ default:
461
+ resizeIFrame();
462
+ callback('resizedCallback',messageData);
463
+ }
464
+ }
465
+
466
+ function hasSettings(iframeId){
467
+ var retBool = true;
468
+
469
+ if (!settings[iframeId]){
470
+ retBool = false;
471
+ warn(messageData.type + ' No settings for ' + iframeId + '. Message was: ' + msg);
472
+ }
473
+
474
+ return retBool;
475
+ }
476
+
477
+ function iFrameReadyMsgReceived(){
478
+ for (var iframeId in settings){
479
+ trigger('iFrame requested init',createOutgoingMsg(iframeId),document.getElementById(iframeId),iframeId);
480
+ }
481
+ }
482
+
483
+ function firstRun() {
484
+ settings[iframeId].firstRun = false;
485
+ }
486
+
487
+ var
488
+ msg = event.data,
489
+ messageData = {},
490
+ iframeId = null;
491
+
492
+ if('[iFrameResizerChild]Ready' === msg){
493
+ iFrameReadyMsgReceived();
494
+ } else if (isMessageForUs()){
495
+ messageData = processMsg();
496
+ iframeId = logId = messageData.id;
497
+
498
+ if (!isMessageFromMetaParent() && hasSettings(iframeId)){
499
+ log(iframeId,'Received: '+msg);
500
+
501
+ if ( checkIFrameExists() && isMessageFromIFrame() ){
502
+ actionMsg();
503
+ }
504
+ }
505
+ } else {
506
+ info(iframeId,'Ignored: '+msg);
507
+ }
508
+
509
+ }
510
+
511
+
512
+ function chkCallback(iframeId,funcName,val){
513
+ var
514
+ func = null,
515
+ retVal = null;
516
+
517
+ if(settings[iframeId]){
518
+ func = settings[iframeId][funcName];
519
+
520
+ if( 'function' === typeof func){
521
+ retVal = func(val);
522
+ } else {
523
+ throw new TypeError(funcName+' on iFrame['+iframeId+'] is not a function');
524
+ }
525
+ }
526
+
527
+ return retVal;
528
+ }
529
+
530
+ function closeIFrame(iframe){
531
+ var iframeId = iframe.id;
532
+
533
+ log(iframeId,'Removing iFrame: '+iframeId);
534
+ iframe.parentNode.removeChild(iframe);
535
+ chkCallback(iframeId,'closedCallback',iframeId);
536
+ log(iframeId,'--');
537
+ delete settings[iframeId];
538
+ }
539
+
540
+ function getPagePosition(iframeId){
541
+ if(null === pagePosition){
542
+ pagePosition = {
543
+ x: (window.pageXOffset !== undefined) ? window.pageXOffset : document.documentElement.scrollLeft,
544
+ y: (window.pageYOffset !== undefined) ? window.pageYOffset : document.documentElement.scrollTop
545
+ };
546
+ log(iframeId,'Get page position: '+pagePosition.x+','+pagePosition.y);
547
+ }
548
+ }
549
+
550
+ function setPagePosition(iframeId){
551
+ if(null !== pagePosition){
552
+ window.scrollTo(pagePosition.x,pagePosition.y);
553
+ log(iframeId,'Set page position: '+pagePosition.x+','+pagePosition.y);
554
+ unsetPagePosition();
555
+ }
556
+ }
557
+
558
+ function unsetPagePosition(){
559
+ pagePosition = null;
560
+ }
561
+
562
+ function resetIFrame(messageData){
563
+ function reset(){
564
+ setSize(messageData);
565
+ trigger('reset','reset',messageData.iframe,messageData.id);
566
+ }
567
+
568
+ log(messageData.id,'Size reset requested by '+('init'===messageData.type?'host page':'iFrame'));
569
+ getPagePosition(messageData.id);
570
+ syncResize(reset,messageData,'reset');
571
+ }
572
+
573
+ function setSize(messageData){
574
+ function setDimension(dimension){
575
+ messageData.iframe.style[dimension] = messageData[dimension] + 'px';
576
+ log(
577
+ messageData.id,
578
+ 'IFrame (' + iframeId +
579
+ ') ' + dimension +
580
+ ' set to ' + messageData[dimension] + 'px'
581
+ );
582
+ }
583
+
584
+ function chkZero(dimension){
585
+ //FireFox sets dimension of hidden iFrames to zero.
586
+ //So if we detect that set up an event to check for
587
+ //when iFrame becomes visible.
588
+
589
+ /* istanbul ignore next */ //Not testable in PhantomJS
590
+ if (!hiddenCheckEnabled && '0' === messageData[dimension]){
591
+ hiddenCheckEnabled = true;
592
+ log(iframeId,'Hidden iFrame detected, creating visibility listener');
593
+ fixHiddenIFrames();
594
+ }
595
+ }
596
+
597
+ function processDimension(dimension){
598
+ setDimension(dimension);
599
+ chkZero(dimension);
600
+ }
601
+
602
+ var iframeId = messageData.iframe.id;
603
+
604
+ if(settings[iframeId]){
605
+ if( settings[iframeId].sizeHeight) { processDimension('height'); }
606
+ if( settings[iframeId].sizeWidth ) { processDimension('width'); }
607
+ }
608
+ }
609
+
610
+ function syncResize(func,messageData,doNotSync){
611
+ /* istanbul ignore if */ //Not testable in PhantomJS
612
+ if(doNotSync!==messageData.type && requestAnimationFrame){
613
+ log(messageData.id,'Requesting animation frame');
614
+ requestAnimationFrame(func);
615
+ } else {
616
+ func();
617
+ }
618
+ }
619
+
620
+ function trigger(calleeMsg,msg,iframe,id){
621
+ function postMessageToIFrame(){
622
+ var target = settings[id].targetOrigin;
623
+ log(id,'[' + calleeMsg + '] Sending msg to iframe['+id+'] ('+msg+') targetOrigin: '+target);
624
+ iframe.contentWindow.postMessage( msgId + msg, target );
625
+ }
626
+
627
+ function iFrameNotFound(){
628
+ info(id,'[' + calleeMsg + '] IFrame('+id+') not found');
629
+ if(settings[id]) {
630
+ delete settings[id];
631
+ }
632
+ }
633
+
634
+ function chkAndSend(){
635
+ if(iframe && 'contentWindow' in iframe && (null !== iframe.contentWindow)){ //Null test for PhantomJS
636
+ postMessageToIFrame();
637
+ } else {
638
+ iFrameNotFound();
639
+ }
640
+ }
641
+
642
+ id = id || iframe.id;
643
+
644
+ if(settings[id]) {
645
+ chkAndSend();
646
+ }
647
+
648
+ }
649
+
650
+ function createOutgoingMsg(iframeId){
651
+ return iframeId +
652
+ ':' + settings[iframeId].bodyMarginV1 +
653
+ ':' + settings[iframeId].sizeWidth +
654
+ ':' + settings[iframeId].log +
655
+ ':' + settings[iframeId].interval +
656
+ ':' + settings[iframeId].enablePublicMethods +
657
+ ':' + settings[iframeId].autoResize +
658
+ ':' + settings[iframeId].bodyMargin +
659
+ ':' + settings[iframeId].heightCalculationMethod +
660
+ ':' + settings[iframeId].bodyBackground +
661
+ ':' + settings[iframeId].bodyPadding +
662
+ ':' + settings[iframeId].tolerance +
663
+ ':' + settings[iframeId].inPageLinks +
664
+ ':' + settings[iframeId].resizeFrom +
665
+ ':' + settings[iframeId].widthCalculationMethod;
666
+ }
667
+
668
+ function setupIFrame(iframe,options){
669
+ function setLimits(){
670
+ function addStyle(style){
671
+ if ((Infinity !== settings[iframeId][style]) && (0 !== settings[iframeId][style])){
672
+ iframe.style[style] = settings[iframeId][style] + 'px';
673
+ log(iframeId,'Set '+style+' = '+settings[iframeId][style]+'px');
674
+ }
675
+ }
676
+
677
+ function chkMinMax(dimension){
678
+ if (settings[iframeId]['min'+dimension]>settings[iframeId]['max'+dimension]){
679
+ throw new Error('Value for min'+dimension+' can not be greater than max'+dimension);
680
+ }
681
+ }
682
+
683
+ chkMinMax('Height');
684
+ chkMinMax('Width');
685
+
686
+ addStyle('maxHeight');
687
+ addStyle('minHeight');
688
+ addStyle('maxWidth');
689
+ addStyle('minWidth');
690
+ }
691
+
692
+ function newId(){
693
+ var id = ((options && options.id) || defaults.id + count++);
694
+ if (null!==document.getElementById(id)){
695
+ id = id + count++;
696
+ }
697
+ return id;
698
+ }
699
+
700
+ function ensureHasId(iframeId){
701
+ logId=iframeId;
702
+ if (''===iframeId){
703
+ iframe.id = iframeId = newId();
704
+ logEnabled = (options || {}).log;
705
+ logId=iframeId;
706
+ log(iframeId,'Added missing iframe ID: '+ iframeId +' (' + iframe.src + ')');
707
+ }
708
+
709
+
710
+ return iframeId;
711
+ }
712
+
713
+ function setScrolling(){
714
+ log(iframeId,'IFrame scrolling ' + (settings[iframeId].scrolling ? 'enabled' : 'disabled') + ' for ' + iframeId);
715
+ iframe.style.overflow = false === settings[iframeId].scrolling ? 'hidden' : 'auto';
716
+ iframe.scrolling = false === settings[iframeId].scrolling ? 'no' : 'yes';
717
+ }
718
+
719
+ //The V1 iFrame script expects an int, where as in V2 expects a CSS
720
+ //string value such as '1px 3em', so if we have an int for V2, set V1=V2
721
+ //and then convert V2 to a string PX value.
722
+ function setupBodyMarginValues(){
723
+ if (('number'===typeof(settings[iframeId].bodyMargin)) || ('0'===settings[iframeId].bodyMargin)){
724
+ settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
725
+ settings[iframeId].bodyMargin = '' + settings[iframeId].bodyMargin + 'px';
726
+ }
727
+ }
728
+
729
+ function checkReset(){
730
+ // Reduce scope of firstRun to function, because IE8's JS execution
731
+ // context stack is borked and this value gets externally
732
+ // changed midway through running this function!!!
733
+ var
734
+ firstRun = settings[iframeId].firstRun,
735
+ resetRequertMethod = settings[iframeId].heightCalculationMethod in resetRequiredMethods;
736
+
737
+ if (!firstRun && resetRequertMethod){
738
+ resetIFrame({iframe:iframe, height:0, width:0, type:'init'});
739
+ }
740
+ }
741
+
742
+ function setupIFrameObject(){
743
+ if(Function.prototype.bind){ //Ignore unpolyfilled IE8.
744
+ settings[iframeId].iframe.iFrameResizer = {
745
+
746
+ close : closeIFrame.bind(null,settings[iframeId].iframe),
747
+
748
+ resize : trigger.bind(null,'Window resize', 'resize', settings[iframeId].iframe),
749
+
750
+ moveToAnchor : function(anchor){
751
+ trigger('Move to anchor','inPageLink:'+anchor, settings[iframeId].iframe,iframeId);
752
+ },
753
+
754
+ sendMessage : function(message){
755
+ message = JSON.stringify(message);
756
+ trigger('Send Message','message:'+message, settings[iframeId].iframe,iframeId);
757
+ }
758
+ };
759
+ }
760
+ }
761
+
762
+ //We have to call trigger twice, as we can not be sure if all
763
+ //iframes have completed loading when this code runs. The
764
+ //event listener also catches the page changing in the iFrame.
765
+ function init(msg){
766
+ function iFrameLoaded(){
767
+ trigger('iFrame.onload',msg,iframe);
768
+ checkReset();
769
+ }
770
+
771
+ addEventListener(iframe,'load',iFrameLoaded);
772
+ trigger('init',msg,iframe);
773
+ }
774
+
775
+ function checkOptions(options){
776
+ if ('object' !== typeof options){
777
+ throw new TypeError('Options is not an object');
778
+ }
779
+ }
780
+
781
+ function copyOptions(options){
782
+ for (var option in defaults) {
783
+ if (defaults.hasOwnProperty(option)){
784
+ settings[iframeId][option] = options.hasOwnProperty(option) ? options[option] : defaults[option];
785
+ }
786
+ }
787
+ }
788
+
789
+ function getTargetOrigin (remoteHost){
790
+ return ('' === remoteHost || 'file://' === remoteHost) ? '*' : remoteHost;
791
+ }
792
+
793
+ function processOptions(options){
794
+ options = options || {};
795
+ settings[iframeId] = {
796
+ firstRun : true,
797
+ iframe : iframe,
798
+ remoteHost : iframe.src.split('/').slice(0,3).join('/')
799
+ };
800
+
801
+ checkOptions(options);
802
+ copyOptions(options);
803
+
804
+ settings[iframeId].targetOrigin = true === settings[iframeId].checkOrigin ? getTargetOrigin(settings[iframeId].remoteHost) : '*';
805
+ }
806
+
807
+ function beenHere(){
808
+ return (iframeId in settings && 'iFrameResizer' in iframe);
809
+ }
810
+
811
+ var iframeId = ensureHasId(iframe.id);
812
+
813
+ if (!beenHere()){
814
+ processOptions(options);
815
+ setScrolling();
816
+ setLimits();
817
+ setupBodyMarginValues();
818
+ init(createOutgoingMsg(iframeId));
819
+ setupIFrameObject();
820
+ } else {
821
+ warn(iframeId,'Ignored iFrame, already setup.');
822
+ }
823
+ }
824
+
825
+ function debouce(fn,time){
826
+ if (null === timer){
827
+ timer = setTimeout(function(){
828
+ timer = null;
829
+ fn();
830
+ }, time);
831
+ }
832
+ }
833
+
834
+ /* istanbul ignore next */ //Not testable in PhantomJS
835
+ function fixHiddenIFrames(){
836
+ function checkIFrames(){
837
+ function checkIFrame(settingId){
838
+ function chkDimension(dimension){
839
+ return '0px' === settings[settingId].iframe.style[dimension];
840
+ }
841
+
842
+ function isVisible(el) {
843
+ return (null !== el.offsetParent);
844
+ }
845
+
846
+ if (isVisible(settings[settingId].iframe) && (chkDimension('height') || chkDimension('width'))){
847
+ trigger('Visibility change', 'resize', settings[settingId].iframe,settingId);
848
+ }
849
+ }
850
+
851
+ for (var settingId in settings){
852
+ checkIFrame(settingId);
853
+ }
854
+ }
855
+
856
+ function mutationObserved(mutations){
857
+ log('window','Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type);
858
+ debouce(checkIFrames,16);
859
+ }
860
+
861
+ function createMutationObserver(){
862
+ var
863
+ target = document.querySelector('body'),
864
+
865
+ config = {
866
+ attributes : true,
867
+ attributeOldValue : false,
868
+ characterData : true,
869
+ characterDataOldValue : false,
870
+ childList : true,
871
+ subtree : true
872
+ },
873
+
874
+ observer = new MutationObserver(mutationObserved);
875
+
876
+ observer.observe(target, config);
877
+ }
878
+
879
+ var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
880
+
881
+ if (MutationObserver) createMutationObserver();
882
+ }
883
+
884
+
885
+ function resizeIFrames(event){
886
+ function resize(){
887
+ sendTriggerMsg('Window '+event,'resize');
888
+ }
889
+
890
+ log('window','Trigger event: '+event);
891
+ debouce(resize,16);
892
+ }
893
+
894
+ /* istanbul ignore next */ //Not testable in PhantomJS
895
+ function tabVisible() {
896
+ function resize(){
897
+ sendTriggerMsg('Tab Visable','resize');
898
+ }
899
+
900
+ if('hidden' !== document.visibilityState) {
901
+ log('document','Trigger event: Visiblity change');
902
+ debouce(resize,16);
903
+ }
904
+ }
905
+
906
+ function sendTriggerMsg(eventName,event){
907
+ function isIFrameResizeEnabled(iframeId) {
908
+ return 'parent' === settings[iframeId].resizeFrom &&
909
+ settings[iframeId].autoResize &&
910
+ !settings[iframeId].firstRun;
911
+ }
912
+
913
+ for (var iframeId in settings){
914
+ if(isIFrameResizeEnabled(iframeId)){
915
+ trigger(eventName,event,document.getElementById(iframeId),iframeId);
916
+ }
917
+ }
918
+ }
919
+
920
+ function setupEventListeners(){
921
+ addEventListener(window,'message',iFrameListener);
922
+
923
+ addEventListener(window,'resize', function(){resizeIFrames('resize');});
924
+
925
+ addEventListener(document,'visibilitychange',tabVisible);
926
+ addEventListener(document,'-webkit-visibilitychange',tabVisible); //Andriod 4.4
927
+ addEventListener(window,'focusin',function(){resizeIFrames('focus');}); //IE8-9
928
+ addEventListener(window,'focus',function(){resizeIFrames('focus');});
929
+ }
930
+
931
+
932
+ function factory(){
933
+ function init(options,element){
934
+ function chkType(){
935
+ if(!element.tagName) {
936
+ throw new TypeError('Object is not a valid DOM element');
937
+ } else if ('IFRAME' !== element.tagName.toUpperCase()) {
938
+ throw new TypeError('Expected <IFRAME> tag, found <'+element.tagName+'>');
939
+ }
940
+ }
941
+
942
+ if(element) {
943
+ chkType();
944
+ setupIFrame(element, options);
945
+ iFrames.push(element);
946
+ }
947
+ }
948
+
949
+ var iFrames;
950
+
951
+ setupRequestAnimationFrame();
952
+ setupEventListeners();
953
+
954
+ return function iFrameResizeF(options,target){
955
+ iFrames = []; //Only return iFrames past in on this call
956
+
957
+ switch (typeof(target)){
958
+ case 'undefined':
959
+ case 'string':
960
+ Array.prototype.forEach.call(
961
+ document.querySelectorAll( target || 'iframe' ),
962
+ init.bind(undefined, options)
963
+ );
964
+ break;
965
+ case 'object':
966
+ init(options,target);
967
+ break;
968
+ default:
969
+ throw new TypeError('Unexpected data type ('+typeof(target)+')');
970
+ }
971
+
972
+ return iFrames;
973
+ };
974
+ }
975
+
976
+ function createJQueryPublicMethod($){
977
+ $.fn.iFrameResize = function $iFrameResizeF(options) {
978
+ return this.filter('iframe').each(function (index, element) {
979
+ setupIFrame(element, options);
980
+ }).end();
981
+ };
982
+ }
983
+
984
+ if (window.jQuery) { createJQueryPublicMethod(jQuery); }
985
+
986
+ if (typeof define === 'function' && define.amd) {
987
+ define([],factory);
988
+ } else if (typeof module === 'object' && typeof module.exports === 'object') { //Node for browserfy
989
+ module.exports = factory();
990
+ } else {
991
+ window.iFrameResize = window.iFrameResize || factory();
992
+ }
993
+
994
+ })(window || {});
js/iframeResizer.min.js ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ /*! iFrame Resizer (iframeSizer.min.js ) - v3.5.1 - 2015-11-04
2
+ * Desc: Force cross domain iframes to size to content.
3
+ * Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame.
4
+ * Copyright: (c) 2015 David J. Bradshaw - dave@bradshaw.net
5
+ * License: MIT
6
+ */
7
+
8
+ !function(a){"use strict";function b(b,c,d){"addEventListener"in a?b.addEventListener(c,d,!1):"attachEvent"in a&&b.attachEvent("on"+c,d)}function c(b,c,d){"removeEventListener"in a?b.removeEventListener(c,d,!1):"detachEvent"in a&&b.detachEvent("on"+c,d)}function d(){var b,c=["moz","webkit","o","ms"];for(b=0;b<c.length&&!N;b+=1)N=a[c[b]+"RequestAnimationFrame"];N||h("setup","RequestAnimationFrame not supported")}function e(b){var c="Host page: "+b;return a.top!==a.self&&(c=a.parentIFrame&&a.parentIFrame.getId?a.parentIFrame.getId()+": "+b:"Nested host page: "+b),c}function f(a){return K+"["+e(a)+"]"}function g(a){return P[a]?P[a].log:G}function h(a,b){k("log",a,b,g(a))}function i(a,b){k("info",a,b,g(a))}function j(a,b){k("warn",a,b,!0)}function k(b,c,d,e){!0===e&&"object"==typeof a.console&&console[b](f(c),d)}function l(d){function e(){function a(){s(V),p(W)}g("Height"),g("Width"),t(a,V,"init")}function f(){var a=U.substr(L).split(":");return{iframe:P[a[0]].iframe,id:a[0],height:a[1],width:a[2],type:a[3]}}function g(a){var b=Number(P[W]["max"+a]),c=Number(P[W]["min"+a]),d=a.toLowerCase(),e=Number(V[d]);h(W,"Checking "+d+" is in range "+c+"-"+b),c>e&&(e=c,h(W,"Set "+d+" to min value")),e>b&&(e=b,h(W,"Set "+d+" to max value")),V[d]=""+e}function k(){function a(){function a(){var a=0,d=!1;for(h(W,"Checking connection is from allowed list of origins: "+c);a<c.length;a++)if(c[a]===b){d=!0;break}return d}function d(){var a=P[W].remoteHost;return h(W,"Checking connection is from: "+a),b===a}return c.constructor===Array?a():d()}var b=d.origin,c=P[W].checkOrigin;if(c&&""+b!="null"&&!a())throw new Error("Unexpected message received from: "+b+" for "+V.iframe.id+". Message was: "+d.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function l(){return K===(""+U).substr(0,L)&&U.substr(L).split(":")[0]in P}function w(){var a=V.type in{"true":1,"false":1,undefined:1};return a&&h(W,"Ignoring init message from meta parent page"),a}function y(a){return U.substr(U.indexOf(":")+J+a)}function z(a){h(W,"MessageCallback passed: {iframe: "+V.iframe.id+", message: "+a+"}"),N("messageCallback",{iframe:V.iframe,message:JSON.parse(a)}),h(W,"--")}function A(){var b=document.body.getBoundingClientRect(),c=V.iframe.getBoundingClientRect();return JSON.stringify({clientHeight:Math.max(document.documentElement.clientHeight,a.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,a.innerWidth||0),offsetTop:parseInt(c.top-b.top,10),offsetLeft:parseInt(c.left-b.left,10),scrollTop:a.pageYOffset,scrollLeft:a.pageXOffset})}function B(a,b){function c(){u("Send Page Info","pageInfo:"+A(),a,b)}x(c,32)}function C(){function d(b,c){function d(){P[g]?B(P[g].iframe,g):e()}["scroll","resize"].forEach(function(e){h(g,b+e+" listener for sendPageInfo"),c(a,e,d)})}function e(){d("Remove ",c)}function f(){d("Add ",b)}var g=W;f(),P[g].stopPageInfo=e}function D(){P[W]&&P[W].stopPageInfo&&(P[W].stopPageInfo(),delete P[W].stopPageInfo)}function E(){var a=!0;return null===V.iframe&&(j(W,"IFrame ("+V.id+") not found"),a=!1),a}function F(a){var b=a.getBoundingClientRect();return o(W),{x:Math.floor(Number(b.left)+Number(M.x)),y:Math.floor(Number(b.top)+Number(M.y))}}function G(b){function c(){M=g,H(),h(W,"--")}function d(){return{x:Number(V.width)+f.x,y:Number(V.height)+f.y}}function e(){a.parentIFrame?a.parentIFrame["scrollTo"+(b?"Offset":"")](g.x,g.y):j(W,"Unable to scroll to requested position, window.parentIFrame not found")}var f=b?F(V.iframe):{x:0,y:0},g=d();h(W,"Reposition requested from iFrame (offset x:"+f.x+" y:"+f.y+")"),a.top!==a.self?e():c()}function H(){!1!==N("scrollCallback",M)?p(W):q()}function I(b){function c(){var a=F(g);h(W,"Moving to in page link (#"+e+") at x: "+a.x+" y: "+a.y),M={x:a.x,y:a.y},H(),h(W,"--")}function d(){a.parentIFrame?a.parentIFrame.moveToAnchor(e):h(W,"In page link #"+e+" not found and window.parentIFrame not found")}var e=b.split("#")[1]||"",f=decodeURIComponent(e),g=document.getElementById(f)||document.getElementsByName(f)[0];g?c():a.top!==a.self?d():h(W,"In page link #"+e+" not found")}function N(a,b){return m(W,a,b)}function O(){switch(P[W].firstRun&&T(),V.type){case"close":n(V.iframe);break;case"message":z(y(6));break;case"scrollTo":G(!1);break;case"scrollToOffset":G(!0);break;case"pageInfo":B(P[W].iframe,W),C();break;case"pageInfoStop":D();break;case"inPageLink":I(y(9));break;case"reset":r(V);break;case"init":e(),N("initCallback",V.iframe),N("resizedCallback",V);break;default:e(),N("resizedCallback",V)}}function Q(a){var b=!0;return P[a]||(b=!1,j(V.type+" No settings for "+a+". Message was: "+U)),b}function S(){for(var a in P)u("iFrame requested init",v(a),document.getElementById(a),a)}function T(){P[W].firstRun=!1}var U=d.data,V={},W=null;"[iFrameResizerChild]Ready"===U?S():l()?(V=f(),W=R=V.id,!w()&&Q(W)&&(h(W,"Received: "+U),E()&&k()&&O())):i(W,"Ignored: "+U)}function m(a,b,c){var d=null,e=null;if(P[a]){if(d=P[a][b],"function"!=typeof d)throw new TypeError(b+" on iFrame["+a+"] is not a function");e=d(c)}return e}function n(a){var b=a.id;h(b,"Removing iFrame: "+b),a.parentNode.removeChild(a),m(b,"closedCallback",b),h(b,"--"),delete P[b]}function o(b){null===M&&(M={x:void 0!==a.pageXOffset?a.pageXOffset:document.documentElement.scrollLeft,y:void 0!==a.pageYOffset?a.pageYOffset:document.documentElement.scrollTop},h(b,"Get page position: "+M.x+","+M.y))}function p(b){null!==M&&(a.scrollTo(M.x,M.y),h(b,"Set page position: "+M.x+","+M.y),q())}function q(){M=null}function r(a){function b(){s(a),u("reset","reset",a.iframe,a.id)}h(a.id,"Size reset requested by "+("init"===a.type?"host page":"iFrame")),o(a.id),t(b,a,"reset")}function s(a){function b(b){a.iframe.style[b]=a[b]+"px",h(a.id,"IFrame ("+e+") "+b+" set to "+a[b]+"px")}function c(b){H||"0"!==a[b]||(H=!0,h(e,"Hidden iFrame detected, creating visibility listener"),y())}function d(a){b(a),c(a)}var e=a.iframe.id;P[e]&&(P[e].sizeHeight&&d("height"),P[e].sizeWidth&&d("width"))}function t(a,b,c){c!==b.type&&N?(h(b.id,"Requesting animation frame"),N(a)):a()}function u(a,b,c,d){function e(){var e=P[d].targetOrigin;h(d,"["+a+"] Sending msg to iframe["+d+"] ("+b+") targetOrigin: "+e),c.contentWindow.postMessage(K+b,e)}function f(){i(d,"["+a+"] IFrame("+d+") not found"),P[d]&&delete P[d]}function g(){c&&"contentWindow"in c&&null!==c.contentWindow?e():f()}d=d||c.id,P[d]&&g()}function v(a){return a+":"+P[a].bodyMarginV1+":"+P[a].sizeWidth+":"+P[a].log+":"+P[a].interval+":"+P[a].enablePublicMethods+":"+P[a].autoResize+":"+P[a].bodyMargin+":"+P[a].heightCalculationMethod+":"+P[a].bodyBackground+":"+P[a].bodyPadding+":"+P[a].tolerance+":"+P[a].inPageLinks+":"+P[a].resizeFrom+":"+P[a].widthCalculationMethod}function w(a,c){function d(){function b(b){1/0!==P[w][b]&&0!==P[w][b]&&(a.style[b]=P[w][b]+"px",h(w,"Set "+b+" = "+P[w][b]+"px"))}function c(a){if(P[w]["min"+a]>P[w]["max"+a])throw new Error("Value for min"+a+" can not be greater than max"+a)}c("Height"),c("Width"),b("maxHeight"),b("minHeight"),b("maxWidth"),b("minWidth")}function e(){var a=c&&c.id||S.id+F++;return null!==document.getElementById(a)&&(a+=F++),a}function f(b){return R=b,""===b&&(a.id=b=e(),G=(c||{}).log,R=b,h(b,"Added missing iframe ID: "+b+" ("+a.src+")")),b}function g(){h(w,"IFrame scrolling "+(P[w].scrolling?"enabled":"disabled")+" for "+w),a.style.overflow=!1===P[w].scrolling?"hidden":"auto",a.scrolling=!1===P[w].scrolling?"no":"yes"}function i(){("number"==typeof P[w].bodyMargin||"0"===P[w].bodyMargin)&&(P[w].bodyMarginV1=P[w].bodyMargin,P[w].bodyMargin=""+P[w].bodyMargin+"px")}function k(){var b=P[w].firstRun,c=P[w].heightCalculationMethod in O;!b&&c&&r({iframe:a,height:0,width:0,type:"init"})}function l(){Function.prototype.bind&&(P[w].iframe.iFrameResizer={close:n.bind(null,P[w].iframe),resize:u.bind(null,"Window resize","resize",P[w].iframe),moveToAnchor:function(a){u("Move to anchor","inPageLink:"+a,P[w].iframe,w)},sendMessage:function(a){a=JSON.stringify(a),u("Send Message","message:"+a,P[w].iframe,w)}})}function m(c){function d(){u("iFrame.onload",c,a),k()}b(a,"load",d),u("init",c,a)}function o(a){if("object"!=typeof a)throw new TypeError("Options is not an object")}function p(a){for(var b in S)S.hasOwnProperty(b)&&(P[w][b]=a.hasOwnProperty(b)?a[b]:S[b])}function q(a){return""===a||"file://"===a?"*":a}function s(b){b=b||{},P[w]={firstRun:!0,iframe:a,remoteHost:a.src.split("/").slice(0,3).join("/")},o(b),p(b),P[w].targetOrigin=!0===P[w].checkOrigin?q(P[w].remoteHost):"*"}function t(){return w in P&&"iFrameResizer"in a}var w=f(a.id);t()?j(w,"Ignored iFrame, already setup."):(s(c),g(),d(),i(),m(v(w)),l())}function x(a,b){null===Q&&(Q=setTimeout(function(){Q=null,a()},b))}function y(){function b(){function a(a){function b(b){return"0px"===P[a].iframe.style[b]}function c(a){return null!==a.offsetParent}c(P[a].iframe)&&(b("height")||b("width"))&&u("Visibility change","resize",P[a].iframe,a)}for(var b in P)a(b)}function c(a){h("window","Mutation observed: "+a[0].target+" "+a[0].type),x(b,16)}function d(){var a=document.querySelector("body"),b={attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0},d=new e(c);d.observe(a,b)}var e=a.MutationObserver||a.WebKitMutationObserver;e&&d()}function z(a){function b(){B("Window "+a,"resize")}h("window","Trigger event: "+a),x(b,16)}function A(){function a(){B("Tab Visable","resize")}"hidden"!==document.visibilityState&&(h("document","Trigger event: Visiblity change"),x(a,16))}function B(a,b){function c(a){return"parent"===P[a].resizeFrom&&P[a].autoResize&&!P[a].firstRun}for(var d in P)c(d)&&u(a,b,document.getElementById(d),d)}function C(){b(a,"message",l),b(a,"resize",function(){z("resize")}),b(document,"visibilitychange",A),b(document,"-webkit-visibilitychange",A),b(a,"focusin",function(){z("focus")}),b(a,"focus",function(){z("focus")})}function D(){function a(a,c){function d(){if(!c.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==c.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+c.tagName+">")}c&&(d(),w(c,a),b.push(c))}var b;return d(),C(),function(c,d){switch(b=[],typeof d){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(d||"iframe"),a.bind(void 0,c));break;case"object":a(c,d);break;default:throw new TypeError("Unexpected data type ("+typeof d+")")}return b}}function E(a){a.fn.iFrameResize=function(a){return this.filter("iframe").each(function(b,c){w(c,a)}).end()}}var F=0,G=!1,H=!1,I="message",J=I.length,K="[iFrameSizer]",L=K.length,M=null,N=a.requestAnimationFrame,O={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},P={},Q=null,R="Host Page",S={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,tolerance:0,widthCalculationMethod:"scroll",closedCallback:function(){},initCallback:function(){},messageCallback:function(){j("MessageCallback function not defined")},resizedCallback:function(){},scrollCallback:function(){return!0}};a.jQuery&&E(jQuery),"function"==typeof define&&define.amd?define([],D):"object"==typeof module&&"object"==typeof module.exports?module.exports=D():a.iFrameResize=a.iFrameResize||D()}(window||{});
9
+ //# sourceMappingURL=iframeResizer.map
js/jquery.fitvids.js ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*jshint browser:true */
2
+ /*!
3
+ * FitVids 1.1
4
+ *
5
+ * Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
6
+ * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
7
+ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
8
+ *
9
+ */
10
+
11
+ ;(function( $ ){
12
+
13
+ 'use strict';
14
+
15
+ $.fn.fitVids = function( options ) {
16
+ var settings = {
17
+ customSelector: null,
18
+ ignore: null
19
+ };
20
+
21
+ if(!document.getElementById('fit-vids-style')) {
22
+ // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
23
+ var head = document.head || document.getElementsByTagName('head')[0];
24
+ var css = '.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';
25
+ var div = document.createElement("div");
26
+ div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
27
+ head.appendChild(div.childNodes[1]);
28
+ }
29
+
30
+ if ( options ) {
31
+ $.extend( settings, options );
32
+ }
33
+
34
+ return this.each(function(){
35
+ var selectors = [
36
+ 'iframe[src*="player.vimeo.com"]',
37
+ 'iframe[src*="youtube.com"]',
38
+ 'iframe[src*="youtube-nocookie.com"]',
39
+ 'iframe[src*="kickstarter.com"][src*="video.html"]',
40
+ 'object',
41
+ 'embed'
42
+ ];
43
+
44
+ if (settings.customSelector) {
45
+ selectors.push(settings.customSelector);
46
+ }
47
+
48
+ var ignoreList = '.fitvidsignore';
49
+
50
+ if(settings.ignore) {
51
+ ignoreList = ignoreList + ', ' + settings.ignore;
52
+ }
53
+
54
+ var $allVideos = $(this).find(selectors.join(','));
55
+ $allVideos = $allVideos.not('object object'); // SwfObj conflict patch
56
+ $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
57
+
58
+ $allVideos.each(function(count){
59
+ var $this = $(this);
60
+ if($this.parents(ignoreList).length > 0) {
61
+ return; // Disable FitVids on this video.
62
+ }
63
+ if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
64
+ if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
65
+ {
66
+ $this.attr('height', 9);
67
+ $this.attr('width', 16);
68
+ }
69
+ var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
70
+ width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
71
+ aspectRatio = height / width;
72
+ if(!$this.attr('id')){
73
+ var videoID = 'fitvid' + count;
74
+ $this.attr('id', videoID);
75
+ }
76
+ $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');
77
+ $this.removeAttr('height').removeAttr('width');
78
+ });
79
+ });
80
+ };
81
+ // Works with either jQuery or Zepto
82
+ })( window.jQuery || window.Zepto );
languages/youtube-embed.mo CHANGED
Binary file
languages/youtube-embed.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Vixy YouTube Embed\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2015-11-09 14:20-0000\n"
6
- "PO-Revision-Date: 2015-11-09 14:20-0000\n"
7
  "Last-Translator: David Artiss <david.artiss@artiss.co.uk>\n"
8
  "Language-Team: \n"
9
  "Language: en_GB\n"
@@ -17,19 +17,20 @@ msgstr ""
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
 
20
- #: includes/add-scripts.php:94 includes/generate-widgets.php:25
 
21
  msgid "YouTube Embed"
22
  msgstr ""
23
 
24
- #: includes/add-scripts.php:99 includes/admin-config.php:92
25
  msgid "Options"
26
  msgstr ""
27
 
28
- #: includes/add-scripts.php:106 includes/admin-config.php:100
29
  msgid "Profiles"
30
  msgstr ""
31
 
32
- #: includes/add-scripts.php:113 includes/admin-config.php:108
33
  msgid "Lists"
34
  msgstr ""
35
 
@@ -53,53 +54,36 @@ msgstr ""
53
  msgid "YouTube"
54
  msgstr ""
55
 
56
- #: includes/admin-config.php:92 includes/options-general.php:16
57
- msgid "YouTube Embed Options"
58
- msgstr ""
59
-
60
- #: includes/admin-config.php:100 includes/options-profiles.php:20
61
  msgid "YouTube Embed Profiles"
62
  msgstr ""
63
 
64
- #: includes/admin-config.php:108 includes/options-lists.php:16
65
  msgid "YouTube Embed Lists"
66
  msgstr ""
67
 
68
- #: includes/admin-config.php:175 includes/admin-config.php:216
69
- #: includes/admin-config.php:260
 
 
 
 
70
  msgid "Help"
71
  msgstr ""
72
 
73
- #: includes/admin-config.php:190
 
 
 
 
 
74
  msgid ""
75
  "This screen allows you to select non-specific options for the YouTube Embed "
76
  "plugin. For the default embedding settings, please select the <a href="
77
  "\"admin.php?page=ye-profile-options\">Profiles</a> administration option."
78
  msgstr ""
79
 
80
- #: includes/admin-config.php:191 includes/admin-config.php:235
81
- #: includes/admin-config.php:276
82
- msgid ""
83
- "Remember to click the Save Changes button at the bottom of the screen for "
84
- "new settings to take effect."
85
- msgstr ""
86
-
87
- #: includes/admin-config.php:192 includes/admin-config.php:236
88
- #: includes/admin-config.php:277
89
- msgid "For more information:"
90
- msgstr ""
91
-
92
- #: includes/admin-config.php:193 includes/admin-config.php:237
93
- #: includes/admin-config.php:278
94
- msgid "YouTube Embed Plugin Documentation"
95
- msgstr ""
96
-
97
- #: includes/admin-config.php:194 includes/admin-config.php:238
98
- #: includes/admin-config.php:279
99
- msgid "YouTube Player Documentation"
100
- msgstr ""
101
-
102
- #: includes/admin-config.php:231
103
  msgid ""
104
  "This screen allows you to set the options for the default and additional "
105
  "profiles. If you don't specify a specific parameter when displaying your "
@@ -108,62 +92,92 @@ msgid ""
108
  "required."
109
  msgstr ""
110
 
111
- #: includes/admin-config.php:232
112
  msgid ""
113
  "All settings will work whether the Flash or HTML5 player is used, unless one "
114
  "of the following icons is shown, indicating which format the option works "
115
  "with..."
116
  msgstr ""
117
 
118
- #: includes/admin-config.php:233
119
  msgid "Flash player"
120
  msgstr ""
121
 
122
- #: includes/admin-config.php:234
123
  msgid "HTML5 player"
124
  msgstr ""
125
 
126
- #: includes/admin-config.php:275
127
  msgid ""
128
  "This screen allows you to create lists of YouTube videos, which may be "
129
  "named. These lists can then be used in preference to a single video ID."
130
  msgstr ""
131
 
132
- #: includes/generate-embed-code.php:60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  msgid "No video/playlist ID has been supplied"
134
  msgstr ""
135
 
136
- #: includes/generate-embed-code.php:107 includes/generate-other-code.php:33
137
- #: includes/generate-other-code.php:75 includes/generate-other-code.php:120
138
  #, php-format
139
  msgid "The YouTube ID of %s is invalid."
140
  msgstr ""
141
 
142
- #: includes/generate-embed-code.php:179
143
  msgid ""
144
  "A video list cannot be viewed within this feed - please view the original "
145
  "content"
146
  msgstr ""
147
 
148
- #: includes/generate-embed-code.php:183
149
  msgid "Click here to view the video on YouTube"
150
  msgstr ""
151
 
152
- #: includes/generate-embed-code.php:380
153
  msgid ""
154
  "The maximum URL length has been exceeded. Please reduce your parameter and/"
155
  "or playlist."
156
  msgstr ""
157
 
158
- #: includes/generate-other-code.php:20
159
- msgid "No YouTube ID was found."
160
- msgstr ""
161
-
162
- #: includes/generate-other-code.php:63
163
  msgid "No video ID has been supplied"
164
  msgstr ""
165
 
166
- #: includes/generate-other-code.php:132
167
  #, php-format
168
  msgid "YouTube Video %s"
169
  msgstr ""
@@ -172,713 +186,770 @@ msgstr ""
172
  msgid "Embed YouTube Widget."
173
  msgstr ""
174
 
175
- #: includes/generate-widgets.php:142
176
  msgid "Widget Title"
177
  msgstr ""
178
 
179
- #: includes/generate-widgets.php:148 includes/options-lists.php:136
180
  msgid "Video ID"
181
  msgstr ""
182
 
183
- #: includes/generate-widgets.php:156
184
  msgid "ID Type"
185
  msgstr ""
186
 
187
- #: includes/generate-widgets.php:158
188
  msgid "Video or Playlist"
189
  msgstr ""
190
 
191
- #: includes/generate-widgets.php:160
192
  msgid "Search"
193
  msgstr ""
194
 
195
- #: includes/generate-widgets.php:162
196
  msgid "User"
197
  msgstr ""
198
 
199
- #: includes/generate-widgets.php:170 includes/shared-functions.php:366
200
  msgid "Profile"
201
  msgstr ""
202
 
203
- #: includes/generate-widgets.php:180
204
  msgid "Start (seconds)"
205
  msgstr ""
206
 
207
- #: includes/generate-widgets.php:186
208
  msgid "Stop (seconds)"
209
  msgstr ""
210
 
211
- #: includes/generate-widgets.php:194
212
  msgid "List Playback"
213
  msgstr ""
214
 
215
- #: includes/generate-widgets.php:196
216
  msgid "Profile default"
217
  msgstr ""
218
 
219
- #: includes/generate-widgets.php:198
220
  msgid "Play each video in order"
221
  msgstr ""
222
 
223
- #: includes/generate-widgets.php:200
224
  msgid "Play videos randomly"
225
  msgstr ""
226
 
227
- #: includes/generate-widgets.php:202
228
  msgid "Play one random video"
229
  msgstr ""
230
 
231
- #: includes/options-general.php:47 includes/options-lists.php:27
232
  msgid "Settings Saved."
233
  msgstr ""
234
 
235
- #: includes/options-general.php:61
236
  msgid "Cache cleared."
237
  msgstr ""
238
 
239
- #: includes/options-general.php:73
240
  msgid ""
241
  "These are the general settings for YouTube Embed. Please select <a href="
242
  "\"admin.php?page=ye-profile-options\">Profiles</a> for default embedding "
243
  "settings."
244
  msgstr ""
245
 
246
- #: includes/options-general.php:77
247
  msgid "Embedding"
248
  msgstr ""
249
 
250
- #: includes/options-general.php:82
251
  msgid "Add Metadata"
252
  msgstr ""
253
 
254
- #: includes/options-general.php:84
255
  msgid "Allow rich metadata to be added to code"
256
  msgstr ""
257
 
258
- #: includes/options-general.php:90
259
  msgid "Feed"
260
  msgstr ""
261
 
262
- #: includes/options-general.php:92
263
  msgid "Text link"
264
  msgstr ""
265
 
266
- #: includes/options-general.php:93
267
  msgid "Thumbnail"
268
  msgstr ""
269
 
270
- #: includes/options-general.php:94
271
  msgid "Thumbnail &amp; Text Link"
272
  msgstr ""
273
 
274
- #: includes/options-general.php:96
275
  msgid ""
276
  "Videos cannot be embedded in feeds. Select how you wish them to be shown "
277
  "instead."
278
  msgstr ""
279
 
280
- #: includes/options-general.php:102
281
  msgid "Thumbnail to use"
282
  msgstr ""
283
 
284
- #: includes/options-general.php:104 includes/shared-functions.php:359
285
  msgid "Default"
286
  msgstr ""
287
 
288
- #: includes/options-general.php:105
289
  msgid "Default (HQ)"
290
  msgstr ""
291
 
292
- #: includes/options-general.php:106
293
  msgid "Start"
294
  msgstr ""
295
 
296
- #: includes/options-general.php:107
297
  msgid "Middle"
298
  msgstr ""
299
 
300
- #: includes/options-general.php:108
301
  msgid "End"
302
  msgstr ""
303
 
304
- #: includes/options-general.php:110
305
  msgid "Choose which thumbnail to use."
306
  msgstr ""
307
 
308
- #: includes/options-general.php:113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  msgid "Shortcodes"
310
  msgstr ""
311
 
312
- #: includes/options-general.php:118
313
  msgid "Allow shortcodes in widgets"
314
  msgstr ""
315
 
316
- #: includes/options-general.php:120
317
  msgid "Allow shortcodes to be used in widgets"
318
  msgstr ""
319
 
320
- #: includes/options-general.php:121
321
  msgid "This will apply to <strong>all</strong> widgets."
322
  msgstr ""
323
 
324
- #: includes/options-general.php:127
325
  msgid "Alternative Shortcode"
326
  msgstr ""
327
 
328
- #: includes/options-general.php:129
329
  msgid "An alternative shortcode to use."
330
  msgstr ""
331
 
332
- #: includes/options-general.php:135
333
  msgid "Profile to use"
334
  msgstr ""
335
 
336
- #: includes/options-general.php:141
 
 
 
 
 
 
 
 
337
  msgid "Administration Options"
338
  msgstr ""
339
 
340
- #: includes/options-general.php:146 includes/options-general.php:154
341
  msgid "Show Editor Button"
342
  msgstr ""
343
 
344
- #: includes/options-general.php:148
345
  msgid "Show the YouTube button on the post editor"
346
  msgstr ""
347
 
348
- #: includes/options-general.php:156
349
  msgid "Add link to options screen to Admin Bar"
350
  msgstr ""
351
 
352
- #: includes/options-general.php:162
353
  msgid "Menu Screen Access"
354
  msgstr ""
355
 
356
- #: includes/options-general.php:164
357
  msgid "Administrator"
358
  msgstr ""
359
 
360
- #: includes/options-general.php:165
361
  msgid "Editor"
362
  msgstr ""
363
 
364
- #: includes/options-general.php:166
365
  msgid "Author"
366
  msgstr ""
367
 
368
- #: includes/options-general.php:167
369
  msgid "Contributor"
370
  msgstr ""
371
 
372
- #: includes/options-general.php:169
373
  msgid "Specify the user access required for the menu screens."
374
  msgstr ""
375
 
376
- #: includes/options-general.php:172
377
  msgid "Profile &amp; List Sizes"
378
  msgstr ""
379
 
380
- #: includes/options-general.php:177
381
  msgid "Number of Profiles"
382
  msgstr ""
383
 
384
- #: includes/options-general.php:179
385
  msgid "Maximum number of profiles."
386
  msgstr ""
387
 
388
- #: includes/options-general.php:185
389
  msgid "Number of Lists"
390
  msgstr ""
391
 
392
- #: includes/options-general.php:187
393
  msgid "Maximum number of lists."
394
  msgstr ""
395
 
396
- #: includes/options-general.php:190
397
- msgid "Performance"
398
- msgstr ""
399
-
400
- #: includes/options-general.php:198
401
- msgid "You currently have cache for"
402
  msgstr ""
403
 
404
- #: includes/options-general.php:206
405
- msgid "Embed Cache"
406
  msgstr ""
407
 
408
- #: includes/options-general.php:208
409
- msgid "How many hours to retain embed output. 0 to switch off."
410
  msgstr ""
411
 
412
- #: includes/options-general.php:214
413
- msgid "Clear Cache"
414
  msgstr ""
415
 
416
- #: includes/options-general.php:216
417
- msgid "Select this option to remove all YouTube Embed cache"
418
  msgstr ""
419
 
420
- #: includes/options-general.php:219
421
- msgid "Security"
422
  msgstr ""
423
 
424
- #: includes/options-general.php:224
425
- msgid "Privacy-Enhanced Mode"
426
  msgstr ""
427
 
428
- #: includes/options-general.php:226
429
- msgid "Cookies should always be stored"
430
  msgstr ""
431
 
432
- #: includes/options-general.php:227
433
- msgid "Cookies should never be stored"
434
  msgstr ""
435
 
436
- #: includes/options-general.php:228
437
- msgid "Cookies should be stored based on user's Do Not Track setting"
438
  msgstr ""
439
 
440
- #: includes/options-general.php:230
441
- msgid "Read more about <a href=\"http://donottrack.us/\">Do Not Track</a>."
442
  msgstr ""
443
 
444
- #: includes/options-general.php:233
445
- msgid "Compatibility"
 
 
446
  msgstr ""
447
 
448
- #: includes/options-general.php:238
449
- msgid "Frame Border"
450
  msgstr ""
451
 
452
- #: includes/options-general.php:240
453
- msgid "Allow Frame Border on IFRAME"
454
  msgstr ""
455
 
456
- #: includes/options-general.php:241
457
- msgid "FRAMEBORDER is not HTML5 compliant."
 
 
 
458
  msgstr ""
459
 
460
- #: includes/options-general.php:248 includes/options-lists.php:125
461
- #: includes/options-profiles.php:364
462
  msgid "Save Changes"
463
  msgstr ""
464
 
465
- #: includes/options-lists.php:32
466
  msgid "All fields must be completed."
467
  msgstr ""
468
 
469
- #: includes/options-lists.php:54
470
  msgid "Errors were found with your video list. See the list below for details."
471
  msgstr ""
472
 
473
- #: includes/options-lists.php:89
474
  msgid "List"
475
  msgstr ""
476
 
477
- #: includes/options-lists.php:99
478
  msgid "Change list"
479
  msgstr ""
480
 
481
- #: includes/options-lists.php:102
482
  #, php-format
483
  msgid "These are the options for list %s."
484
  msgstr ""
485
 
486
- #: includes/options-lists.php:102
487
  msgid ""
488
  "Update the name, if required, and specify a list of YouTube video IDs. Use "
489
  "the drop-down on the right hand side to swap between lists."
490
  msgstr ""
491
 
492
- #: includes/options-lists.php:109
493
  msgid "List Name"
494
  msgstr ""
495
 
496
- #: includes/options-lists.php:111
497
  msgid "The name you wish to give this list"
498
  msgstr ""
499
 
500
- #: includes/options-lists.php:117
501
  msgid "Video IDs (one per line)"
502
  msgstr ""
503
 
504
- #: includes/options-lists.php:136
505
  msgid "Video Title"
506
  msgstr ""
507
 
508
- #: includes/options-lists.php:136
509
  msgid "Status"
510
  msgstr ""
511
 
512
- #: includes/options-lists.php:151
513
  msgid "This is a playlist"
514
  msgstr ""
515
 
516
- #: includes/options-lists.php:155
517
  msgid "Invalid video ID"
518
  msgstr ""
519
 
520
- #: includes/options-lists.php:159
521
  msgid "YouTube API error"
522
  msgstr ""
523
 
524
- #: includes/options-lists.php:162
525
  msgid "Valid video"
526
  msgstr ""
527
 
528
- #: includes/options-lists.php:179
529
  msgid "The video ID is valid"
530
  msgstr ""
531
 
532
- #: includes/options-lists.php:182
533
  msgid "The video ID is invalid"
534
  msgstr ""
535
 
536
- #: includes/options-profiles.php:87
537
  msgid " Profile Saved."
538
  msgstr ""
539
 
540
- #: includes/options-profiles.php:108
541
  msgid "Change profile"
542
  msgstr ""
543
 
544
- #: includes/options-profiles.php:113
545
  msgid "These are the options for the default profile."
546
  msgstr ""
547
 
548
- #: includes/options-profiles.php:115
549
  #, php-format
550
  msgid "These are the options for profile %s."
551
  msgstr ""
552
 
553
- #: includes/options-profiles.php:117
554
  msgid "Use the drop-down on the right hand side to swap between profiles."
555
  msgstr ""
556
 
557
- #: includes/options-profiles.php:125
558
  msgid "Profile Name"
559
  msgstr ""
560
 
561
- #: includes/options-profiles.php:127
562
  msgid "The name you wish to give this profile"
563
  msgstr ""
564
 
565
- #: includes/options-profiles.php:133
566
  msgid "Template"
567
  msgstr ""
568
 
569
- #: includes/options-profiles.php:135
570
  msgid ""
571
  "Wrapper for video output. Must include <code>%video%</code> tag to show "
572
  "video position."
573
  msgstr ""
574
 
575
- #: includes/options-profiles.php:141
576
  msgid "Style"
577
  msgstr ""
578
 
579
- #: includes/options-profiles.php:143
580
  msgid "CSS elements to apply to video."
581
  msgstr ""
582
 
583
- #: includes/options-profiles.php:149
584
  msgid "SSL"
585
  msgstr ""
586
 
587
- #: includes/options-profiles.php:151
588
  msgid ""
589
  "Use SSL? <a href=\"http://www.google.com/support/youtube/bin/answer.py?"
590
  "answer=171780&expand=UseHTTPS#HTTPS\">Read more</a>"
591
  msgstr ""
592
 
593
- #: includes/options-profiles.php:157
594
  msgid "Window Mode"
595
  msgstr ""
596
 
597
- #: includes/options-profiles.php:159
598
  msgid "Opaque"
599
  msgstr ""
600
 
601
- #: includes/options-profiles.php:160
602
  msgid "Transparent"
603
  msgstr ""
604
 
605
- #: includes/options-profiles.php:161
606
  msgid "Window"
607
  msgstr ""
608
 
609
- #: includes/options-profiles.php:163
610
  msgid ""
611
  "Sets the Window Mode property of the Flash movie for transparency, layering, "
612
  "and positioning in the browser. <a href=\"http://www.communitymx.com/content/"
613
  "article.cfm?cid=e5141\">Learn more</a>."
614
  msgstr ""
615
 
616
- #: includes/options-profiles.php:166 includes/options-profiles.php:171
617
  msgid "Video Size"
618
  msgstr ""
619
 
620
- #: includes/options-profiles.php:173
621
  msgid "The width x height of the video, in pixels"
622
  msgstr ""
623
 
624
- #: includes/options-profiles.php:179
625
  msgid "Default Sizes"
626
  msgstr ""
627
 
628
- #: includes/options-profiles.php:181
629
  msgid "Use above sizes"
630
  msgstr ""
631
 
632
- #: includes/options-profiles.php:187
633
  msgid "Select one of these default sizes to override the above video sizes."
634
  msgstr ""
635
 
636
- #: includes/options-profiles.php:193
637
  msgid "Dynamically Resize"
638
  msgstr ""
639
 
640
- #: includes/options-profiles.php:195
641
  msgid "Show full width and resize with the browser"
642
  msgstr ""
643
 
644
- #: includes/options-profiles.php:201
645
  msgid "Set Maximum Size"
646
  msgstr ""
647
 
648
- #: includes/options-profiles.php:203
649
  msgid "Use above width to define maximum size"
650
  msgstr ""
651
 
652
- #: includes/options-profiles.php:206
 
 
 
 
 
 
 
 
653
  msgid "Playback"
654
  msgstr ""
655
 
656
- #: includes/options-profiles.php:211
657
  msgid "Autoplay"
658
  msgstr ""
659
 
660
- #: includes/options-profiles.php:213
661
  msgid ""
662
  "Choose whether the initial video will automatically start to play when the "
663
  "player loads"
664
  msgstr ""
665
 
666
- #: includes/options-profiles.php:219
667
  msgid "Loop Video"
668
  msgstr ""
669
 
670
- #: includes/options-profiles.php:221
671
  msgid "Play the initial video again and again"
672
  msgstr ""
673
 
674
- #: includes/options-profiles.php:222
675
  msgid ""
676
  "In the case of a playlist, this will play the entire playlist and then start "
677
  "again at the first video."
678
  msgstr ""
679
 
680
- #: includes/options-profiles.php:228
681
  msgid "Annotations"
682
  msgstr ""
683
 
684
- #: includes/options-profiles.php:230
685
  msgid "Video annotations are shown by default"
686
  msgstr ""
687
 
688
- #: includes/options-profiles.php:236
689
  msgid "Closed Captions"
690
  msgstr ""
691
 
692
- #: includes/options-profiles.php:238
693
- msgid "Show closed captions (subtitles)"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
694
  msgstr ""
695
 
696
- #: includes/options-profiles.php:239
697
- msgid "This will even override even the user's choice."
698
  msgstr ""
699
 
700
- #: includes/options-profiles.php:242 includes/options-profiles.php:247
701
  msgid "Information"
702
  msgstr ""
703
 
704
- #: includes/options-profiles.php:249
705
  msgid "Display the video title and uploader before the video starts"
706
  msgstr ""
707
 
708
- #: includes/options-profiles.php:250
709
  msgid "If displaying a playlist this will show video thumbnails."
710
  msgstr ""
711
 
712
- #: includes/options-profiles.php:256
713
  msgid "Related Videos"
714
  msgstr ""
715
 
716
- #: includes/options-profiles.php:258
717
  msgid "Load related videos once playback starts"
718
  msgstr ""
719
 
720
- #: includes/options-profiles.php:259
721
  msgid "Also toggles the search option."
722
  msgstr ""
723
 
724
- #: includes/options-profiles.php:265
725
  msgid "Modest Branding"
726
  msgstr ""
727
 
728
- #: includes/options-profiles.php:267
729
  msgid "Reduce branding on video"
730
  msgstr ""
731
 
732
- #: includes/options-profiles.php:270 includes/options-profiles.php:287
733
  msgid "Controls"
734
  msgstr ""
735
 
736
- #: includes/options-profiles.php:275
737
  msgid "Auto hide"
738
  msgstr ""
739
 
740
- #: includes/options-profiles.php:277
741
  msgid "Controls &amp; progress bar remain visible"
742
  msgstr ""
743
 
744
- #: includes/options-profiles.php:278
745
  msgid "Controls &amp; progress bar fade out"
746
  msgstr ""
747
 
748
- #: includes/options-profiles.php:279
749
  msgid "Progress bar fades"
750
  msgstr ""
751
 
752
- #: includes/options-profiles.php:281
753
  msgid ""
754
  "Whether the video controls will automatically hide after a video begins "
755
  "playing."
756
  msgstr ""
757
 
758
- #: includes/options-profiles.php:289
759
  msgid "Controls do not display &amp; Flash player loads immediately"
760
  msgstr ""
761
 
762
- #: includes/options-profiles.php:290
763
  msgid "Controls display &amp; Flash player loads immediately"
764
  msgstr ""
765
 
766
- #: includes/options-profiles.php:291
767
  msgid "Controls display &amp; Flash player loads once video starts"
768
  msgstr ""
769
 
770
- #: includes/options-profiles.php:293
771
  msgid ""
772
  "Whether the video player controls are displayed. For Flash it also defines "
773
  "when the controls display in the player as well as when the player will load."
774
  msgstr ""
775
 
776
- #: includes/options-profiles.php:299
777
  msgid "Disable Keyboard"
778
  msgstr ""
779
 
780
- #: includes/options-profiles.php:301
781
  msgid "Disable the player keyboard controls"
782
  msgstr ""
783
 
784
- #: includes/options-profiles.php:307
785
  msgid "Fullscreen"
786
  msgstr ""
787
 
788
- #: includes/options-profiles.php:309
789
  msgid "A button will allow the viewer to watch the video fullscreen"
790
  msgstr ""
791
 
792
- #: includes/options-profiles.php:315
793
  msgid "Theme"
794
  msgstr ""
795
 
796
- #: includes/options-profiles.php:317
797
  msgid "Dark"
798
  msgstr ""
799
 
800
- #: includes/options-profiles.php:318
801
  msgid "Light"
802
  msgstr ""
803
 
804
- #: includes/options-profiles.php:320
805
  msgid "Display player controls within a dark or light control bar."
806
  msgstr ""
807
 
808
- #: includes/options-profiles.php:326
809
  msgid "Progress Bar Color"
810
  msgstr ""
811
 
812
- #: includes/options-profiles.php:328
813
  msgid "Red"
814
  msgstr ""
815
 
816
- #: includes/options-profiles.php:329
817
  msgid "White (desaturated)"
818
  msgstr ""
819
 
820
- #: includes/options-profiles.php:331
821
  msgid ""
822
  "The color that will be used in the player's video progress bar to highlight "
823
  "the amount of the video that's already been seen."
824
  msgstr ""
825
 
826
- #: includes/options-profiles.php:334
827
  msgid "Download Link"
828
  msgstr ""
829
 
830
- #: includes/options-profiles.php:339
831
  msgid "Show Download Link"
832
  msgstr ""
833
 
834
- #: includes/options-profiles.php:341
835
  #, php-format
836
  msgid "Show a link to %s under the video"
837
  msgstr ""
838
 
839
- #: includes/options-profiles.php:347
840
  msgid "Download Text"
841
  msgstr ""
842
 
843
- #: includes/options-profiles.php:349
844
  msgid "Text or HTML to display to prompt download."
845
  msgstr ""
846
 
847
- #: includes/options-profiles.php:355
848
  msgid "Download Style"
849
  msgstr ""
850
 
851
- #: includes/options-profiles.php:357
852
  msgid "CSS elements to apply to video download link."
853
  msgstr ""
854
 
855
- #: includes/options-profiles.php:370
856
  msgid "YouTube Video Sample"
857
  msgstr ""
858
 
859
- #: includes/options-profiles.php:371
860
  msgid ""
861
  "The video below uses the above, saved profile settings. Use the drop-down "
862
  "below to change which parameters the video uses - press the Change Video "
863
  "button to update it."
864
  msgstr ""
865
 
866
- #: includes/options-profiles.php:373
867
  msgid "Standard"
868
  msgstr ""
869
 
870
- #: includes/options-profiles.php:374
871
  msgid "3D"
872
  msgstr ""
873
 
874
- #: includes/options-profiles.php:375
875
  msgid "Playlist"
876
  msgstr ""
877
 
878
- #: includes/options-profiles.php:378
879
  msgid "Change video"
880
  msgstr ""
881
 
882
- #: includes/shared-functions.php:466
883
- msgid "The video cannot be shown at the moment. Please try again later."
884
  msgstr ""
2
  msgstr ""
3
  "Project-Id-Version: Vixy YouTube Embed\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2015-12-02 13:49-0000\n"
6
+ "PO-Revision-Date: 2015-12-02 13:49-0000\n"
7
  "Last-Translator: David Artiss <david.artiss@artiss.co.uk>\n"
8
  "Language-Team: \n"
9
  "Language: en_GB\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
  "X-Poedit-SearchPath-0: .\n"
19
 
20
+ #: includes/add-scripts.php:94 includes/admin-config.php:108
21
+ #: includes/generate-widgets.php:25
22
  msgid "YouTube Embed"
23
  msgstr ""
24
 
25
+ #: includes/add-scripts.php:99
26
  msgid "Options"
27
  msgstr ""
28
 
29
+ #: includes/add-scripts.php:106 includes/admin-config.php:92
30
  msgid "Profiles"
31
  msgstr ""
32
 
33
+ #: includes/add-scripts.php:113 includes/admin-config.php:100
34
  msgid "Lists"
35
  msgstr ""
36
 
54
  msgid "YouTube"
55
  msgstr ""
56
 
57
+ #: includes/admin-config.php:92 includes/options-profiles.php:117
 
 
 
 
58
  msgid "YouTube Embed Profiles"
59
  msgstr ""
60
 
61
+ #: includes/admin-config.php:100 includes/options-lists.php:103
62
  msgid "YouTube Embed Lists"
63
  msgstr ""
64
 
65
+ #: includes/admin-config.php:108 includes/options-general.php:16
66
+ msgid "YouTube Embed Options"
67
+ msgstr ""
68
+
69
+ #: includes/admin-config.php:175 includes/admin-config.php:197
70
+ #: includes/admin-config.php:219
71
  msgid "Help"
72
  msgstr ""
73
 
74
+ #: includes/admin-config.php:177 includes/admin-config.php:199
75
+ #: includes/admin-config.php:221
76
+ msgid "Links"
77
+ msgstr ""
78
+
79
+ #: includes/admin-config.php:242
80
  msgid ""
81
  "This screen allows you to select non-specific options for the YouTube Embed "
82
  "plugin. For the default embedding settings, please select the <a href="
83
  "\"admin.php?page=ye-profile-options\">Profiles</a> administration option."
84
  msgstr ""
85
 
86
+ #: includes/admin-config.php:247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  msgid ""
88
  "This screen allows you to set the options for the default and additional "
89
  "profiles. If you don't specify a specific parameter when displaying your "
92
  "required."
93
  msgstr ""
94
 
95
+ #: includes/admin-config.php:248
96
  msgid ""
97
  "All settings will work whether the Flash or HTML5 player is used, unless one "
98
  "of the following icons is shown, indicating which format the option works "
99
  "with..."
100
  msgstr ""
101
 
102
+ #: includes/admin-config.php:249
103
  msgid "Flash player"
104
  msgstr ""
105
 
106
+ #: includes/admin-config.php:250
107
  msgid "HTML5 player"
108
  msgstr ""
109
 
110
+ #: includes/admin-config.php:255
111
  msgid ""
112
  "This screen allows you to create lists of YouTube videos, which may be "
113
  "named. These lists can then be used in preference to a single video ID."
114
  msgstr ""
115
 
116
+ #: includes/admin-config.php:259
117
+ msgid ""
118
+ "Remember to click the Save Changes button at the bottom of the screen for "
119
+ "any changes to take effect."
120
+ msgstr ""
121
+
122
+ #: includes/admin-config.php:264
123
+ msgid "For more information:"
124
+ msgstr ""
125
+
126
+ #: includes/admin-config.php:265
127
+ msgid "YouTube Embed Plugin Documentation"
128
+ msgstr ""
129
+
130
+ #: includes/admin-config.php:268
131
+ msgid "YouTube Player Documentation"
132
+ msgstr ""
133
+
134
+ #: includes/admin-config.php:367
135
+ msgid ""
136
+ "For some reason the shortcode <strong>[youtube]</strong> is not working on "
137
+ "the main site"
138
+ msgstr ""
139
+
140
+ #: includes/admin-config.php:370
141
+ msgid "An alternative plugin is using the <strong>[youtube]</strong> shortcode"
142
+ msgstr ""
143
+
144
+ #: includes/admin-config.php:377
145
+ msgid ""
146
+ ", possibly the <a href=\"admin.php?page=jetpack_modules&activated=true"
147
+ "\">Shortcode Embeds module</a> in Jetpack"
148
+ msgstr ""
149
+
150
+ #: includes/generate-embed-code.php:64
151
  msgid "No video/playlist ID has been supplied"
152
  msgstr ""
153
 
154
+ #: includes/generate-embed-code.php:111 includes/generate-other-code.php:56
155
+ #: includes/generate-other-code.php:101 includes/shortcodes.php:210
156
  #, php-format
157
  msgid "The YouTube ID of %s is invalid."
158
  msgstr ""
159
 
160
+ #: includes/generate-embed-code.php:168
161
  msgid ""
162
  "A video list cannot be viewed within this feed - please view the original "
163
  "content"
164
  msgstr ""
165
 
166
+ #: includes/generate-embed-code.php:172
167
  msgid "Click here to view the video on YouTube"
168
  msgstr ""
169
 
170
+ #: includes/generate-embed-code.php:381
171
  msgid ""
172
  "The maximum URL length has been exceeded. Please reduce your parameter and/"
173
  "or playlist."
174
  msgstr ""
175
 
176
+ #: includes/generate-other-code.php:44
 
 
 
 
177
  msgid "No video ID has been supplied"
178
  msgstr ""
179
 
180
+ #: includes/generate-other-code.php:113
181
  #, php-format
182
  msgid "YouTube Video %s"
183
  msgstr ""
186
  msgid "Embed YouTube Widget."
187
  msgstr ""
188
 
189
+ #: includes/generate-widgets.php:144
190
  msgid "Widget Title"
191
  msgstr ""
192
 
193
+ #: includes/generate-widgets.php:150 includes/options-lists.php:172
194
  msgid "Video ID"
195
  msgstr ""
196
 
197
+ #: includes/generate-widgets.php:158
198
  msgid "ID Type"
199
  msgstr ""
200
 
201
+ #: includes/generate-widgets.php:160
202
  msgid "Video or Playlist"
203
  msgstr ""
204
 
205
+ #: includes/generate-widgets.php:162
206
  msgid "Search"
207
  msgstr ""
208
 
209
+ #: includes/generate-widgets.php:164
210
  msgid "User"
211
  msgstr ""
212
 
213
+ #: includes/generate-widgets.php:172 includes/shared-functions.php:372
214
  msgid "Profile"
215
  msgstr ""
216
 
217
+ #: includes/generate-widgets.php:182
218
  msgid "Start (seconds)"
219
  msgstr ""
220
 
221
+ #: includes/generate-widgets.php:188
222
  msgid "Stop (seconds)"
223
  msgstr ""
224
 
225
+ #: includes/generate-widgets.php:196
226
  msgid "List Playback"
227
  msgstr ""
228
 
229
+ #: includes/generate-widgets.php:198
230
  msgid "Profile default"
231
  msgstr ""
232
 
233
+ #: includes/generate-widgets.php:200
234
  msgid "Play each video in order"
235
  msgstr ""
236
 
237
+ #: includes/generate-widgets.php:202
238
  msgid "Play videos randomly"
239
  msgstr ""
240
 
241
+ #: includes/generate-widgets.php:204
242
  msgid "Play one random video"
243
  msgstr ""
244
 
245
+ #: includes/options-general.php:51 includes/options-lists.php:22
246
  msgid "Settings Saved."
247
  msgstr ""
248
 
249
+ #: includes/options-general.php:65
250
  msgid "Cache cleared."
251
  msgstr ""
252
 
253
+ #: includes/options-general.php:77
254
  msgid ""
255
  "These are the general settings for YouTube Embed. Please select <a href="
256
  "\"admin.php?page=ye-profile-options\">Profiles</a> for default embedding "
257
  "settings."
258
  msgstr ""
259
 
260
+ #: includes/options-general.php:81
261
  msgid "Embedding"
262
  msgstr ""
263
 
264
+ #: includes/options-general.php:86
265
  msgid "Add Metadata"
266
  msgstr ""
267
 
268
+ #: includes/options-general.php:88
269
  msgid "Allow rich metadata to be added to code"
270
  msgstr ""
271
 
272
+ #: includes/options-general.php:94
273
  msgid "Feed"
274
  msgstr ""
275
 
276
+ #: includes/options-general.php:96
277
  msgid "Text link"
278
  msgstr ""
279
 
280
+ #: includes/options-general.php:97
281
  msgid "Thumbnail"
282
  msgstr ""
283
 
284
+ #: includes/options-general.php:98
285
  msgid "Thumbnail &amp; Text Link"
286
  msgstr ""
287
 
288
+ #: includes/options-general.php:100
289
  msgid ""
290
  "Videos cannot be embedded in feeds. Select how you wish them to be shown "
291
  "instead."
292
  msgstr ""
293
 
294
+ #: includes/options-general.php:106
295
  msgid "Thumbnail to use"
296
  msgstr ""
297
 
298
+ #: includes/options-general.php:108 includes/shared-functions.php:360
299
  msgid "Default"
300
  msgstr ""
301
 
302
+ #: includes/options-general.php:109
303
  msgid "Default (HQ)"
304
  msgstr ""
305
 
306
+ #: includes/options-general.php:110
307
  msgid "Start"
308
  msgstr ""
309
 
310
+ #: includes/options-general.php:111
311
  msgid "Middle"
312
  msgstr ""
313
 
314
+ #: includes/options-general.php:112
315
  msgid "End"
316
  msgstr ""
317
 
318
+ #: includes/options-general.php:114
319
  msgid "Choose which thumbnail to use."
320
  msgstr ""
321
 
322
+ #: includes/options-general.php:120
323
+ msgid "Content Resizing Script"
324
+ msgstr ""
325
+
326
+ #: includes/options-general.php:122
327
+ msgid "None"
328
+ msgstr ""
329
+
330
+ #: includes/options-general.php:123
331
+ msgid "FitVids.js"
332
+ msgstr ""
333
+
334
+ #: includes/options-general.php:124
335
+ msgid "iFrame Resizer"
336
+ msgstr ""
337
+
338
+ #: includes/options-general.php:126
339
+ msgid "Use a third party content resizing script?"
340
+ msgstr ""
341
+
342
+ #: includes/options-general.php:129
343
  msgid "Shortcodes"
344
  msgstr ""
345
 
346
+ #: includes/options-general.php:134
347
  msgid "Allow shortcodes in widgets"
348
  msgstr ""
349
 
350
+ #: includes/options-general.php:136
351
  msgid "Allow shortcodes to be used in widgets"
352
  msgstr ""
353
 
354
+ #: includes/options-general.php:137
355
  msgid "This will apply to <strong>all</strong> widgets."
356
  msgstr ""
357
 
358
+ #: includes/options-general.php:143
359
  msgid "Alternative Shortcode"
360
  msgstr ""
361
 
362
+ #: includes/options-general.php:145
363
  msgid "An alternative shortcode to use."
364
  msgstr ""
365
 
366
+ #: includes/options-general.php:151
367
  msgid "Profile to use"
368
  msgstr ""
369
 
370
+ #: includes/options-general.php:160
371
+ msgid "Show Shortcode Re-use Prompt"
372
+ msgstr ""
373
+
374
+ #: includes/options-general.php:162
375
+ msgid "Show a prompt if the main shortcode is being re-used by another plugin"
376
+ msgstr ""
377
+
378
+ #: includes/options-general.php:165
379
  msgid "Administration Options"
380
  msgstr ""
381
 
382
+ #: includes/options-general.php:170 includes/options-general.php:178
383
  msgid "Show Editor Button"
384
  msgstr ""
385
 
386
+ #: includes/options-general.php:172
387
  msgid "Show the YouTube button on the post editor"
388
  msgstr ""
389
 
390
+ #: includes/options-general.php:180
391
  msgid "Add link to options screen to Admin Bar"
392
  msgstr ""
393
 
394
+ #: includes/options-general.php:186
395
  msgid "Menu Screen Access"
396
  msgstr ""
397
 
398
+ #: includes/options-general.php:188
399
  msgid "Administrator"
400
  msgstr ""
401
 
402
+ #: includes/options-general.php:189
403
  msgid "Editor"
404
  msgstr ""
405
 
406
+ #: includes/options-general.php:190
407
  msgid "Author"
408
  msgstr ""
409
 
410
+ #: includes/options-general.php:191
411
  msgid "Contributor"
412
  msgstr ""
413
 
414
+ #: includes/options-general.php:193
415
  msgid "Specify the user access required for the menu screens."
416
  msgstr ""
417
 
418
+ #: includes/options-general.php:196
419
  msgid "Profile &amp; List Sizes"
420
  msgstr ""
421
 
422
+ #: includes/options-general.php:201
423
  msgid "Number of Profiles"
424
  msgstr ""
425
 
426
+ #: includes/options-general.php:203
427
  msgid "Maximum number of profiles."
428
  msgstr ""
429
 
430
+ #: includes/options-general.php:209
431
  msgid "Number of Lists"
432
  msgstr ""
433
 
434
+ #: includes/options-general.php:211
435
  msgid "Maximum number of lists."
436
  msgstr ""
437
 
438
+ #: includes/options-general.php:214
439
+ msgid "Security"
 
 
 
 
440
  msgstr ""
441
 
442
+ #: includes/options-general.php:219
443
+ msgid "Privacy-Enhanced Mode"
444
  msgstr ""
445
 
446
+ #: includes/options-general.php:221
447
+ msgid "Cookies should always be stored"
448
  msgstr ""
449
 
450
+ #: includes/options-general.php:222
451
+ msgid "Cookies should never be stored"
452
  msgstr ""
453
 
454
+ #: includes/options-general.php:223
455
+ msgid "Cookies should be stored based on user's Do Not Track setting"
456
  msgstr ""
457
 
458
+ #: includes/options-general.php:225
459
+ msgid "Read more about <a href=\"http://donottrack.us/\">Do Not Track</a>."
460
  msgstr ""
461
 
462
+ #: includes/options-general.php:231
463
+ msgid "Show debug output"
464
  msgstr ""
465
 
466
+ #: includes/options-general.php:233
467
+ msgid "Show debug output as HTML comments"
468
  msgstr ""
469
 
470
+ #: includes/options-general.php:236
471
+ msgid "Miscellaneous"
472
  msgstr ""
473
 
474
+ #: includes/options-general.php:241
475
+ msgid "Improve Validation"
476
  msgstr ""
477
 
478
+ #: includes/options-general.php:243
479
+ msgid "Improve the validity of the generated markup"
480
  msgstr ""
481
 
482
+ #: includes/options-general.php:244
483
+ msgid ""
484
+ "Will extend the length of the URL, limiting the number of videos in a manual "
485
+ "playlist. Switch off metadata for even better validation results."
486
  msgstr ""
487
 
488
+ #: includes/options-general.php:250
489
+ msgid "Interface language"
490
  msgstr ""
491
 
492
+ #: includes/options-general.php:251
493
+ msgid "The player's interface language"
494
  msgstr ""
495
 
496
+ #: includes/options-general.php:252
497
+ msgid ""
498
+ "The parameter value is an <a href=\"http://www.loc.gov/standards/iso639-2/"
499
+ "php/code_list.php\">ISO 639-1 two-letter language code</a> or a fully "
500
+ "specified locale. For example, the current locale is "
501
  msgstr ""
502
 
503
+ #: includes/options-general.php:259 includes/options-lists.php:161
504
+ #: includes/options-profiles.php:416
505
  msgid "Save Changes"
506
  msgstr ""
507
 
508
+ #: includes/options-lists.php:27
509
  msgid "All fields must be completed."
510
  msgstr ""
511
 
512
+ #: includes/options-lists.php:55
513
  msgid "Errors were found with your video list. See the list below for details."
514
  msgstr ""
515
 
516
+ #: includes/options-lists.php:124
517
  msgid "List"
518
  msgstr ""
519
 
520
+ #: includes/options-lists.php:135
521
  msgid "Change list"
522
  msgstr ""
523
 
524
+ #: includes/options-lists.php:138
525
  #, php-format
526
  msgid "These are the options for list %s."
527
  msgstr ""
528
 
529
+ #: includes/options-lists.php:138
530
  msgid ""
531
  "Update the name, if required, and specify a list of YouTube video IDs. Use "
532
  "the drop-down on the right hand side to swap between lists."
533
  msgstr ""
534
 
535
+ #: includes/options-lists.php:145
536
  msgid "List Name"
537
  msgstr ""
538
 
539
+ #: includes/options-lists.php:147
540
  msgid "The name you wish to give this list"
541
  msgstr ""
542
 
543
+ #: includes/options-lists.php:153
544
  msgid "Video IDs (one per line)"
545
  msgstr ""
546
 
547
+ #: includes/options-lists.php:172
548
  msgid "Video Title"
549
  msgstr ""
550
 
551
+ #: includes/options-lists.php:172
552
  msgid "Status"
553
  msgstr ""
554
 
555
+ #: includes/options-lists.php:187
556
  msgid "This is a playlist"
557
  msgstr ""
558
 
559
+ #: includes/options-lists.php:191
560
  msgid "Invalid video ID"
561
  msgstr ""
562
 
563
+ #: includes/options-lists.php:195
564
  msgid "YouTube API error"
565
  msgstr ""
566
 
567
+ #: includes/options-lists.php:198
568
  msgid "Valid video"
569
  msgstr ""
570
 
571
+ #: includes/options-lists.php:215
572
  msgid "The video ID is valid"
573
  msgstr ""
574
 
575
+ #: includes/options-lists.php:218
576
  msgid "The video ID is invalid"
577
  msgstr ""
578
 
579
+ #: includes/options-profiles.php:123
580
  msgid " Profile Saved."
581
  msgstr ""
582
 
583
+ #: includes/options-profiles.php:137
584
  msgid "Change profile"
585
  msgstr ""
586
 
587
+ #: includes/options-profiles.php:145
588
  msgid "These are the options for the default profile."
589
  msgstr ""
590
 
591
+ #: includes/options-profiles.php:147
592
  #, php-format
593
  msgid "These are the options for profile %s."
594
  msgstr ""
595
 
596
+ #: includes/options-profiles.php:149
597
  msgid "Use the drop-down on the right hand side to swap between profiles."
598
  msgstr ""
599
 
600
+ #: includes/options-profiles.php:157
601
  msgid "Profile Name"
602
  msgstr ""
603
 
604
+ #: includes/options-profiles.php:159
605
  msgid "The name you wish to give this profile"
606
  msgstr ""
607
 
608
+ #: includes/options-profiles.php:165
609
  msgid "Template"
610
  msgstr ""
611
 
612
+ #: includes/options-profiles.php:167
613
  msgid ""
614
  "Wrapper for video output. Must include <code>%video%</code> tag to show "
615
  "video position."
616
  msgstr ""
617
 
618
+ #: includes/options-profiles.php:173
619
  msgid "Style"
620
  msgstr ""
621
 
622
+ #: includes/options-profiles.php:175
623
  msgid "CSS elements to apply to video."
624
  msgstr ""
625
 
626
+ #: includes/options-profiles.php:181
627
  msgid "SSL"
628
  msgstr ""
629
 
630
+ #: includes/options-profiles.php:183
631
  msgid ""
632
  "Use SSL? <a href=\"http://www.google.com/support/youtube/bin/answer.py?"
633
  "answer=171780&expand=UseHTTPS#HTTPS\">Read more</a>"
634
  msgstr ""
635
 
636
+ #: includes/options-profiles.php:189
637
  msgid "Window Mode"
638
  msgstr ""
639
 
640
+ #: includes/options-profiles.php:191
641
  msgid "Opaque"
642
  msgstr ""
643
 
644
+ #: includes/options-profiles.php:192
645
  msgid "Transparent"
646
  msgstr ""
647
 
648
+ #: includes/options-profiles.php:193
649
  msgid "Window"
650
  msgstr ""
651
 
652
+ #: includes/options-profiles.php:195
653
  msgid ""
654
  "Sets the Window Mode property of the Flash movie for transparency, layering, "
655
  "and positioning in the browser. <a href=\"http://www.communitymx.com/content/"
656
  "article.cfm?cid=e5141\">Learn more</a>."
657
  msgstr ""
658
 
659
+ #: includes/options-profiles.php:198 includes/options-profiles.php:203
660
  msgid "Video Size"
661
  msgstr ""
662
 
663
+ #: includes/options-profiles.php:205
664
  msgid "The width x height of the video, in pixels"
665
  msgstr ""
666
 
667
+ #: includes/options-profiles.php:211
668
  msgid "Default Sizes"
669
  msgstr ""
670
 
671
+ #: includes/options-profiles.php:213
672
  msgid "Use above sizes"
673
  msgstr ""
674
 
675
+ #: includes/options-profiles.php:219
676
  msgid "Select one of these default sizes to override the above video sizes."
677
  msgstr ""
678
 
679
+ #: includes/options-profiles.php:225
680
  msgid "Dynamically Resize"
681
  msgstr ""
682
 
683
+ #: includes/options-profiles.php:227
684
  msgid "Show full width and resize with the browser"
685
  msgstr ""
686
 
687
+ #: includes/options-profiles.php:233
688
  msgid "Set Maximum Size"
689
  msgstr ""
690
 
691
+ #: includes/options-profiles.php:235
692
  msgid "Use above width to define maximum size"
693
  msgstr ""
694
 
695
+ #: includes/options-profiles.php:241
696
+ msgid "Plays Inline"
697
+ msgstr ""
698
+
699
+ #: includes/options-profiles.php:243
700
+ msgid "Whether videos play inline or fullscreen in an HTML5 player on iOS. "
701
+ msgstr ""
702
+
703
+ #: includes/options-profiles.php:246
704
  msgid "Playback"
705
  msgstr ""
706
 
707
+ #: includes/options-profiles.php:251
708
  msgid "Autoplay"
709
  msgstr ""
710
 
711
+ #: includes/options-profiles.php:253
712
  msgid ""
713
  "Choose whether the initial video will automatically start to play when the "
714
  "player loads"
715
  msgstr ""
716
 
717
+ #: includes/options-profiles.php:259
718
  msgid "Loop Video"
719
  msgstr ""
720
 
721
+ #: includes/options-profiles.php:261
722
  msgid "Play the initial video again and again"
723
  msgstr ""
724
 
725
+ #: includes/options-profiles.php:262
726
  msgid ""
727
  "In the case of a playlist, this will play the entire playlist and then start "
728
  "again at the first video."
729
  msgstr ""
730
 
731
+ #: includes/options-profiles.php:268
732
  msgid "Annotations"
733
  msgstr ""
734
 
735
+ #: includes/options-profiles.php:270
736
  msgid "Video annotations are shown by default"
737
  msgstr ""
738
 
739
+ #: includes/options-profiles.php:276
740
  msgid "Closed Captions"
741
  msgstr ""
742
 
743
+ #: includes/options-profiles.php:278
744
+ msgid "Don't show closed captions"
745
+ msgstr ""
746
+
747
+ #: includes/options-profiles.php:279
748
+ msgid "Show closed captions"
749
+ msgstr ""
750
+
751
+ #: includes/options-profiles.php:280
752
+ msgid "User default"
753
+ msgstr ""
754
+
755
+ #: includes/options-profiles.php:282
756
+ msgid "Show closed captions (subtitles)."
757
+ msgstr ""
758
+
759
+ #: includes/options-profiles.php:288
760
+ msgid "Default to HTML5"
761
+ msgstr ""
762
+
763
+ #: includes/options-profiles.php:290
764
+ msgid "Default to the HTML5 player (if available)"
765
  msgstr ""
766
 
767
+ #: includes/options-profiles.php:291
768
+ msgid "This is an undocumented feature and may not work."
769
  msgstr ""
770
 
771
+ #: includes/options-profiles.php:294 includes/options-profiles.php:299
772
  msgid "Information"
773
  msgstr ""
774
 
775
+ #: includes/options-profiles.php:301
776
  msgid "Display the video title and uploader before the video starts"
777
  msgstr ""
778
 
779
+ #: includes/options-profiles.php:302
780
  msgid "If displaying a playlist this will show video thumbnails."
781
  msgstr ""
782
 
783
+ #: includes/options-profiles.php:308
784
  msgid "Related Videos"
785
  msgstr ""
786
 
787
+ #: includes/options-profiles.php:310
788
  msgid "Load related videos once playback starts"
789
  msgstr ""
790
 
791
+ #: includes/options-profiles.php:311
792
  msgid "Also toggles the search option."
793
  msgstr ""
794
 
795
+ #: includes/options-profiles.php:317
796
  msgid "Modest Branding"
797
  msgstr ""
798
 
799
+ #: includes/options-profiles.php:319
800
  msgid "Reduce branding on video"
801
  msgstr ""
802
 
803
+ #: includes/options-profiles.php:322 includes/options-profiles.php:339
804
  msgid "Controls"
805
  msgstr ""
806
 
807
+ #: includes/options-profiles.php:327
808
  msgid "Auto hide"
809
  msgstr ""
810
 
811
+ #: includes/options-profiles.php:329
812
  msgid "Controls &amp; progress bar remain visible"
813
  msgstr ""
814
 
815
+ #: includes/options-profiles.php:330
816
  msgid "Controls &amp; progress bar fade out"
817
  msgstr ""
818
 
819
+ #: includes/options-profiles.php:331
820
  msgid "Progress bar fades"
821
  msgstr ""
822
 
823
+ #: includes/options-profiles.php:333
824
  msgid ""
825
  "Whether the video controls will automatically hide after a video begins "
826
  "playing."
827
  msgstr ""
828
 
829
+ #: includes/options-profiles.php:341
830
  msgid "Controls do not display &amp; Flash player loads immediately"
831
  msgstr ""
832
 
833
+ #: includes/options-profiles.php:342
834
  msgid "Controls display &amp; Flash player loads immediately"
835
  msgstr ""
836
 
837
+ #: includes/options-profiles.php:343
838
  msgid "Controls display &amp; Flash player loads once video starts"
839
  msgstr ""
840
 
841
+ #: includes/options-profiles.php:345
842
  msgid ""
843
  "Whether the video player controls are displayed. For Flash it also defines "
844
  "when the controls display in the player as well as when the player will load."
845
  msgstr ""
846
 
847
+ #: includes/options-profiles.php:351
848
  msgid "Disable Keyboard"
849
  msgstr ""
850
 
851
+ #: includes/options-profiles.php:353
852
  msgid "Disable the player keyboard controls"
853
  msgstr ""
854
 
855
+ #: includes/options-profiles.php:359
856
  msgid "Fullscreen"
857
  msgstr ""
858
 
859
+ #: includes/options-profiles.php:361
860
  msgid "A button will allow the viewer to watch the video fullscreen"
861
  msgstr ""
862
 
863
+ #: includes/options-profiles.php:367
864
  msgid "Theme"
865
  msgstr ""
866
 
867
+ #: includes/options-profiles.php:369
868
  msgid "Dark"
869
  msgstr ""
870
 
871
+ #: includes/options-profiles.php:370
872
  msgid "Light"
873
  msgstr ""
874
 
875
+ #: includes/options-profiles.php:372
876
  msgid "Display player controls within a dark or light control bar."
877
  msgstr ""
878
 
879
+ #: includes/options-profiles.php:378
880
  msgid "Progress Bar Color"
881
  msgstr ""
882
 
883
+ #: includes/options-profiles.php:380
884
  msgid "Red"
885
  msgstr ""
886
 
887
+ #: includes/options-profiles.php:381
888
  msgid "White (desaturated)"
889
  msgstr ""
890
 
891
+ #: includes/options-profiles.php:383
892
  msgid ""
893
  "The color that will be used in the player's video progress bar to highlight "
894
  "the amount of the video that's already been seen."
895
  msgstr ""
896
 
897
+ #: includes/options-profiles.php:386
898
  msgid "Download Link"
899
  msgstr ""
900
 
901
+ #: includes/options-profiles.php:391
902
  msgid "Show Download Link"
903
  msgstr ""
904
 
905
+ #: includes/options-profiles.php:393
906
  #, php-format
907
  msgid "Show a link to %s under the video"
908
  msgstr ""
909
 
910
+ #: includes/options-profiles.php:399
911
  msgid "Download Text"
912
  msgstr ""
913
 
914
+ #: includes/options-profiles.php:401
915
  msgid "Text or HTML to display to prompt download."
916
  msgstr ""
917
 
918
+ #: includes/options-profiles.php:407
919
  msgid "Download Style"
920
  msgstr ""
921
 
922
+ #: includes/options-profiles.php:409
923
  msgid "CSS elements to apply to video download link."
924
  msgstr ""
925
 
926
+ #: includes/options-profiles.php:423
927
  msgid "YouTube Video Sample"
928
  msgstr ""
929
 
930
+ #: includes/options-profiles.php:424
931
  msgid ""
932
  "The video below uses the above, saved profile settings. Use the drop-down "
933
  "below to change which parameters the video uses - press the Change Video "
934
  "button to update it."
935
  msgstr ""
936
 
937
+ #: includes/options-profiles.php:426
938
  msgid "Standard"
939
  msgstr ""
940
 
941
+ #: includes/options-profiles.php:427
942
  msgid "3D"
943
  msgstr ""
944
 
945
+ #: includes/options-profiles.php:428
946
  msgid "Playlist"
947
  msgstr ""
948
 
949
+ #: includes/options-profiles.php:431
950
  msgid "Change video"
951
  msgstr ""
952
 
953
+ #: includes/shortcodes.php:195
954
+ msgid "No YouTube ID was found."
955
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://artiss.co.uk/donate
4
  Tags: annotations, artiss, chromecast, comments, download, embed, embedding, embedplus, flash, flv, hd, iframe, media, play, playlist, profile, responsive, seo, url, video, widget, youtube, youtuber
5
  Requires at least: 3.9
6
  Tested up to: 4.3.1
7
- Stable tag: 4.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -24,8 +24,9 @@ YouTube Embed is an incredibly simple, yet powerful, method of embedding YouTube
24
  * Google compatible metadata is added to the video output - great for SEO!
25
  * Fully internationalized ready for translations. **If you would like to add a translation to his plugin then please [contact me](http://www.artiss.co.uk/plugin-contact "Contact")**
26
  * Support for Do Not Track
27
- * Compatible with [Video SEO for WordPress](http://yoast.com/wordpress/video-seo/ "Video SEO for WordPress")
28
  * Use [Turn Off The Lights](https://www.turnoffthelights.com/ "Turn Off The Lights")? This plugin works with it beautifully.
 
29
  * Works "out of the box" with 4K, 60FPS and Chromecast - stream your embedded videos to your TV!
30
  * And much, much more!
31
 
@@ -37,7 +38,7 @@ https://www.youtube.com/watch?v=Wc7cvpQS-xQ
37
 
38
  To add a video to a post or page simply use the shortcode `[youtube]video[/youtube]`, where `video` is the ID or URL of the video. Alternatively, you can add one (or more) widgets to your sidebar.
39
 
40
- Within the administration area of your blog you will find a new menu named `YouTube` (see screenshot 1). Click on the `Options` sub-menu to set a number of general options. Alternatively click on the `Profiles` sub-menu to set the default options which define the output of your videos - any videos you display (unless overridden by parameters - more on that later) will use the settings from the Profiles screen.
41
 
42
  Although this document contains a lot of information more is available from a series of linked pages, plus as much information as possible is provided on the various administration pages. Whilst on the administration pages, click on the "Help" button in the top right for some useful tips and links. If anything isn't covered and you're unsure of what it does please ask [on the forum](https://wordpress.org/support/plugin/youtube-embed "WordPress Plugins Forum").
43
 
@@ -52,18 +53,20 @@ Which options are available depends upon the embedding type you're using as well
52
  * **annotation** - yes or no, this determines if annotations are shown
53
  * **autohide** - 0, 1 or 2, this parameter indicates whether the video controls will automatically hide after a video begins playing. The default behaviour, a value of 2, is for the video progress bar to fade out while the player controls (play button, volume control, etc.) remain visible. If this parameter is set to 0, the video progress bar and the video player controls will be visible throughout the video. If this parameter is set to 1, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a key on her keyboard.
54
  * **autoplay** - yes or no, should the video automatically start playing?
55
- * **cc** - yes or no, decided whether closed captions (subtitles) are displayed
56
  * **color** - white or red, the colour of the progress bar (see the FAQ about having a white progress bar with the light theme)
57
  * **controls** - 0, 1 or 2, this decides whether the controls should display and when the Flash will load. A value of 0 will not show the controls but 1 or 2 will. A value of 2 will load Flash once the user initiates playback - otherwise it's loaded straight away.
58
  * **disablekb** - yes or no, disable keyboard controls
59
  * **dynamic** - whether to use dynamic sizing or not. When switched on the video will resize when your site does (i.e. responsive). If a video width is supplied this will be the maximum width, otherwise full width will be assumed. Height is ignored and will be worked out automatically.
60
  * **fullscreen** - yes or no, this will add the fullscreen button to the toolbar. This also works with EmbedPlus.
61
  * **height** - the video height, in pixels
 
62
  * **https** - yes or no, whether to use HTTPS for the video
63
  * **info** - yes or no, show video information. If displaying a playlist this will show video thumbnails
64
  * **list** - if you've specified your own list, use this to select the way the videos should be output. Should be `random` (display videos in a random order), `single` (show just one video, randomly picked from the list) or `order` (show each video in the original order - this is the default)
65
  * **loop** - yes or no, whether to start the video again once it ends
66
  * **modest** - reduce the branding on the video
 
67
  * **profile** - specify a different default profile (see section on Profiles for further details)
68
  * **ratio** - allows you to define a window ratio - specify just a height or width and the ratio will calculate the missing dimension. Uses the format x:x, e.g. 4:3, 16:9
69
  * **related** - yes or no, show related videos
@@ -79,7 +82,7 @@ Which options are available depends upon the embedding type you're using as well
79
 
80
  == Alternative Shortcodes ==
81
 
82
- Within administration, selecting `Options` from the `YouTube` menu will provide a list of general options. One option is named `Alternative Shortcode` and allows you to specify another shortcode that will work exactly the same as the standard shortcode of `[youtube]`.
83
 
84
  There are 2 reasons why you might want to do this...
85
 
@@ -132,7 +135,7 @@ To use this profile, simply use the parameter `profile=` followed by the profile
132
 
133
  This could be useful, for instance, for having a separate profile for different parts of your site - posts, sidebar, etc - or for different video types (e.g. widescreen).
134
 
135
- By default you have 5 extra profiles - if you wish to have more (or less) this number can be changed from the `Options` sub-menu.
136
 
137
  == Lists ==
138
 
@@ -154,6 +157,12 @@ YouTube now includes options to automatically generate playlists based upon a us
154
 
155
  To use, simply use the `user` or `search` parameter to switch the appropriate option on. Then, instead of a video ID or URL, you should specify either the user name or search word(s).
156
 
 
 
 
 
 
 
157
  == Thumbnails ==
158
 
159
  YouTube embed also has the ability to return a thumbnail of a video (sorry, this doesn't work with playlists). There are two methods you can use for this - a shortcode or a function call.
@@ -216,12 +225,6 @@ Alternatively, you can use the shortcode `download_video`. The content to link i
216
 
217
  e.g. `[download_video id="Z_sCoHGIpU0" target="_blank"]Download the video[/download_video]`
218
 
219
- == Caching ==
220
-
221
- Caches are used to improve plugin performance.
222
-
223
- Under the `YouTube` administration menu is a sub-menu named `Options`. Select this and find the section named `Performance`, under which is the 'Embed Cache' option. This is how long to store the resulting cache code. It will update if you change any parameters so, theoretically, shouldn't need to change. It defaults to 24 hours. In all cases putting the cache to 0 will switch off caching for that option.
224
-
225
  == Further Embedding Options ==
226
 
227
  Under the `YouTube` administration menu is a sub-menu named `Options`. Select this and find the section named `Embedding`. There are 2 options here...
@@ -267,29 +270,12 @@ The video ID is the list of letters and numbers after `v=`, in this case `L5Y4qz
267
 
268
  If you go into the Profile screen in Administration there is a "Window Mode" option. This defines how Flash output interacts with any other around it. "Window" is the default and gives good performance but may cause overlapping. If overlapping is causing an issue try "Opaque".
269
 
270
- = No video is showing =
271
-
272
- If you find no video is showing but there's no error either check the source code of the page. Can you find the text "<!--YouTube Error: bad URL entered-->" in the page? If so, you have Jetpack installed and that is displaying the video instead.
273
-
274
- There are two ways around this.
275
-
276
- First, you could disable all the shortcodes in Jetpack - Jetpack allows you to deactivate certain "modules" of the plugin and, if you can live without the other extra shortcodes, deactivating the shortcodes part will restore functionality back to YouTube Embed
277
-
278
- Alternatively, you can use a secondary shortcode - [youtube_video]. Use this instead of [youtube] and YouTube Embed will render the results without a problem
279
-
280
- This second suggestion will work for any plugin that may use the same shortcode.
281
-
282
- = My OPTIONS table seems to be full of cache entries for YouTube Embed =
283
 
284
- Due to a housekeeping limitation in WordPress cache entries, which are stored in the OPTIONS table, may get left behind. There are 2 solutions to clearing this.
285
 
286
- First of all, in the Options menu in YouTube Embed administration, there is an option in the performance section named "Clear Cache". Simply tick this box and click on the "Save Settings" button to clear out any cache.
287
-
288
- However, the best option is to install the plugin [Transient Cleaner](http://wordpress.org/extend/plugins/artiss-transient-cleaner/ "Transient Cleaner"), which will housekeep the OPTIONS table automatically.
289
-
290
- = Is this plugin compatible with Turn Off The Lights? =
291
-
292
- Yes, it works beautifully with [Turn Off The Lights](https://www.turnoffthelights.com/ "Turn Off The Lights"), thanks to the very kind Develop
293
 
294
  = The "autostart" feature is not working in iOS =
295
 
@@ -307,6 +293,18 @@ This is usually due to using a different ratio than the video was designed for.
307
 
308
  This is a bug in Firefox. Short term, switch on SSL in the Profiles screen and it will work. Longer term, I've [raised a bug report with Mozilla](https://bugzilla.mozilla.org/show_bug.cgi?id=1223515 "Bug 1223515 - Broken images in YouTube embedded player when not using SSL").
309
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  = I have another issue or a request =
311
 
312
  Before reporting it please bear in mind that this plugin uses the standard YouTube API. Adding extra functionality to the player itself is not possible and there are [known issues](https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube "YouTube API Known Issues") with it. I would also recommend performing a Google search for your issue too first, as this will often resolve a lot of queries.
@@ -322,6 +320,27 @@ Before reporting it please bear in mind that this plugin uses the standard YouTu
322
 
323
  == Changelog ==
324
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
325
  = 4.0.2 =
326
  * Maintenance: Not really a bug, but in some circumstances I wasn't initialising a variable used when generating the embed code. It worked fine but wasn't best practise so fixed. Sloppy.
327
  * Maintenance: Modified the default parameters so new user videos should appear with the same options as on YouTube itself. Consistent.
@@ -646,6 +665,9 @@ Before reporting it please bear in mind that this plugin uses the standard YouTu
646
 
647
  == Upgrade Notice ==
648
 
 
 
 
649
  = 4.0.2 =
650
  * Minor bug fixes
651
 
4
  Tags: annotations, artiss, chromecast, comments, download, embed, embedding, embedplus, flash, flv, hd, iframe, media, play, playlist, profile, responsive, seo, url, video, widget, youtube, youtuber
5
  Requires at least: 3.9
6
  Tested up to: 4.3.1
7
+ Stable tag: 4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
24
  * Google compatible metadata is added to the video output - great for SEO!
25
  * Fully internationalized ready for translations. **If you would like to add a translation to his plugin then please [contact me](http://www.artiss.co.uk/plugin-contact "Contact")**
26
  * Support for Do Not Track
27
+ * Compatible with [Video SEO for WordPress](http://yoast.com/wordpress/video-seo/ "Video SEO for WordPress") and [a3 lazy load](https://wordpress.org/plugins/a3-lazy-load/ "a3 lazy load")
28
  * Use [Turn Off The Lights](https://www.turnoffthelights.com/ "Turn Off The Lights")? This plugin works with it beautifully.
29
+ * [iFrame Resizer](https://github.com/davidjbradshaw/iframe-resizer "iFrame Resizer") and [FitVids.js](https://github.com/davatron5000/FitVids.js "FitVids.js") supported to improve content resizing
30
  * Works "out of the box" with 4K, 60FPS and Chromecast - stream your embedded videos to your TV!
31
  * And much, much more!
32
 
38
 
39
  To add a video to a post or page simply use the shortcode `[youtube]video[/youtube]`, where `video` is the ID or URL of the video. Alternatively, you can add one (or more) widgets to your sidebar.
40
 
41
+ Within the adminstration area, click on Settings and then YouTube Embed to view and edit default generic settings for the plugin. You will also find a new admin menu named `YouTube` (see screenshot 1) - click on the `Profiles` sub-menu to set the default options which define the output of your videos. Any videos you display (unless overridden by parameters - more on that later) will use the settings from the Profiles screen.
42
 
43
  Although this document contains a lot of information more is available from a series of linked pages, plus as much information as possible is provided on the various administration pages. Whilst on the administration pages, click on the "Help" button in the top right for some useful tips and links. If anything isn't covered and you're unsure of what it does please ask [on the forum](https://wordpress.org/support/plugin/youtube-embed "WordPress Plugins Forum").
44
 
53
  * **annotation** - yes or no, this determines if annotations are shown
54
  * **autohide** - 0, 1 or 2, this parameter indicates whether the video controls will automatically hide after a video begins playing. The default behaviour, a value of 2, is for the video progress bar to fade out while the player controls (play button, volume control, etc.) remain visible. If this parameter is set to 0, the video progress bar and the video player controls will be visible throughout the video. If this parameter is set to 1, then the video progress bar and the player controls will slide out of view a couple of seconds after the video starts playing. They will only reappear if the user moves her mouse over the video player or presses a key on her keyboard.
55
  * **autoplay** - yes or no, should the video automatically start playing?
56
+ * **cc** - yes or no, decided whether closed captions (subtitles) are displayed. If you don't specify anything then the user's default will be used.
57
  * **color** - white or red, the colour of the progress bar (see the FAQ about having a white progress bar with the light theme)
58
  * **controls** - 0, 1 or 2, this decides whether the controls should display and when the Flash will load. A value of 0 will not show the controls but 1 or 2 will. A value of 2 will load Flash once the user initiates playback - otherwise it's loaded straight away.
59
  * **disablekb** - yes or no, disable keyboard controls
60
  * **dynamic** - whether to use dynamic sizing or not. When switched on the video will resize when your site does (i.e. responsive). If a video width is supplied this will be the maximum width, otherwise full width will be assumed. Height is ignored and will be worked out automatically.
61
  * **fullscreen** - yes or no, this will add the fullscreen button to the toolbar. This also works with EmbedPlus.
62
  * **height** - the video height, in pixels
63
+ * **html5** - yes or no, whether to force HTML5 as the default player or not (if available). NB: This is an undocumented feature and, as such, may not work
64
  * **https** - yes or no, whether to use HTTPS for the video
65
  * **info** - yes or no, show video information. If displaying a playlist this will show video thumbnails
66
  * **list** - if you've specified your own list, use this to select the way the videos should be output. Should be `random` (display videos in a random order), `single` (show just one video, randomly picked from the list) or `order` (show each video in the original order - this is the default)
67
  * **loop** - yes or no, whether to start the video again once it ends
68
  * **modest** - reduce the branding on the video
69
+ * **playsinline** - whether videos play inline or fullscreen in an HTML5 player on iOS.
70
  * **profile** - specify a different default profile (see section on Profiles for further details)
71
  * **ratio** - allows you to define a window ratio - specify just a height or width and the ratio will calculate the missing dimension. Uses the format x:x, e.g. 4:3, 16:9
72
  * **related** - yes or no, show related videos
82
 
83
  == Alternative Shortcodes ==
84
 
85
+ Within administration, selecting `YouTube Embed` from the `Settings` menu will provide a list of general options. One option is named `Alternative Shortcode` and allows you to specify another shortcode that will work exactly the same as the standard shortcode of `[youtube]`.
86
 
87
  There are 2 reasons why you might want to do this...
88
 
135
 
136
  This could be useful, for instance, for having a separate profile for different parts of your site - posts, sidebar, etc - or for different video types (e.g. widescreen).
137
 
138
+ By default you have 5 extra profiles - if you wish to have more (or less) this number can be changed from the YouTube Embed settings screen.
139
 
140
  == Lists ==
141
 
157
 
158
  To use, simply use the `user` or `search` parameter to switch the appropriate option on. Then, instead of a video ID or URL, you should specify either the user name or search word(s).
159
 
160
+ == Third Party Resizing Scripts ==
161
+
162
+ Within the YouTube Embed settings screen there is an option to set a third party resizing script - either [iFrame Resizer](https://github.com/davidjbradshaw/iframe-resizer "iFrame Resizer") or [FitVids.js](https://github.com/davatron5000/FitVids.js "FitVids.js"). These work alongside the existing IFRAME but try and improve the output, particularly with regard to how the output is sized.
163
+
164
+ There are no guarantees with these and no support of their specific functionality is provided. However, if the video output is wrong then it's worth trying these.
165
+
166
  == Thumbnails ==
167
 
168
  YouTube embed also has the ability to return a thumbnail of a video (sorry, this doesn't work with playlists). There are two methods you can use for this - a shortcode or a function call.
225
 
226
  e.g. `[download_video id="Z_sCoHGIpU0" target="_blank"]Download the video[/download_video]`
227
 
 
 
 
 
 
 
228
  == Further Embedding Options ==
229
 
230
  Under the `YouTube` administration menu is a sub-menu named `Options`. Select this and find the section named `Embedding`. There are 2 options here...
270
 
271
  If you go into the Profile screen in Administration there is a "Window Mode" option. This defines how Flash output interacts with any other around it. "Window" is the default and gives good performance but may cause overlapping. If overlapping is causing an issue try "Opaque".
272
 
273
+ = I'm getting an error saying that "an alternative plugin is using the [youtube] shortcode" =
 
 
 
 
 
 
 
 
 
 
 
 
274
 
275
+ As this suggests another plugin that you have installed is using the same shortcode as YouTube Embed. That means that use of the `youtube` shortcode won't work. You have 2 possible actions to take...
276
 
277
+ 1. Disable the conflicting plugin. If it's Jetpack then you can disable the Shortcode Embeds module.
278
+ 2. Leave it as it is and use the option to use a second shortcode with this plugin. Head to the YouTube Embed settings screen and you can set up a secondary shortcode. You can also switch off the nag message too from here.
 
 
 
 
 
279
 
280
  = The "autostart" feature is not working in iOS =
281
 
293
 
294
  This is a bug in Firefox. Short term, switch on SSL in the Profiles screen and it will work. Longer term, I've [raised a bug report with Mozilla](https://bugzilla.mozilla.org/show_bug.cgi?id=1223515 "Bug 1223515 - Broken images in YouTube embedded player when not using SSL").
295
 
296
+ = The generated code does not cleanly validate =
297
+
298
+ No, by default it doesn't but it works absolutely fine as it. However, if you really must cleanly validate against HTML5 or transitional XHTML then head into the YouTube Embed settings screen and you'll find an option to "Improve Validation". Tick this and Save and it should validate.... UNLESS you have the metadata option switched on, in which case it won't validate still (sorry, I'm a slave to Google on this one!). Switch that off though and you're 100%.
299
+
300
+ One thing to note - by switching on "Improve Validation" you'll extend the length of the URL line that's passed to YouTube. Please see the next FAQ to understand this better.
301
+
302
+ = I'm getting the error "The maximum URL length has been exceeded" when trying to view a video =
303
+
304
+ When embedding a video a URL for YouTube is generated - this contains all the non-default parameters that you've specified and, if you've created a manual playlist, all of the video IDs. Unfortunately, URLs can only be 2000 characters in size. If this is exceeded you'll get the above error message when you try and view the video.
305
+
306
+ The solution is to reduce this down by reducing down your playlist or, if you have the "Improve Validation" settings switched on, switching that back off.
307
+
308
  = I have another issue or a request =
309
 
310
  Before reporting it please bear in mind that this plugin uses the standard YouTube API. Adding extra functionality to the player itself is not possible and there are [known issues](https://code.google.com/p/gdata-issues/issues/list?q=label:API-YouTube "YouTube API Known Issues") with it. I would also recommend performing a Google search for your issue too first, as this will often resolve a lot of queries.
320
 
321
  == Changelog ==
322
 
323
+ = 4.1 =
324
+ * Enhancement: Added 'Plays inline' option for iOS devices.
325
+ * Enhancement: Added extra Closed Caption option to better reflect how YouTube works - either on, off, or user default.
326
+ * Enhancement: Added new option to force HTML5 playback (if available). This is an undocumented feature and, as such, may not actually work, depending on YouTube's current mood. If YouTube aren't going to support it then I'm certainly not going to so please don't shout if it doesn't work.
327
+ * Enhancement: Lovely new icons for the lists page.
328
+ * Enhancement: Improved the layout of the demo video on the profiles page.
329
+ * Enhancement: Added a count to the profiles and lists screen to indicate how many are set up. Also showed on drop-down which of the profiles/lists are not defined.
330
+ * Enhancement: Changes made to add compatibility with a3 lazy load.
331
+ * Enhancement: Removed the caching - it created the output up to 3 times quicker but when that's 0.005 seconds it's not worth the hassle that comes with it. I started making performance improvements to compensate then realised it was such a big change that it would be best spun off as it's own seperate update - version 4.2. Look out for it.
332
+ * Enhancement: Removed limitation of only being able to display up to 30 lists or profiles.
333
+ * Enhancement: When you can select a profile from another screen (e.g. defining a profile to an alternative shortcode) then only defined profiles will be listed.
334
+ * Enhancement: Added general option to specify the YouTube interface language as well as to suppress debug output in the resulting code.
335
+ * Enhancement: Fixed validation errors against thumbnails.
336
+ * Enhancement: Changed the "Frameborder" option to a more general "Improve Validation" which does, well, just that. It improves the generated markup so that it will validate better (if that's your bag).
337
+ * Enhancement: Added option to use a third party script to handle content resizing. Implemented [iFrame Resizer](https://github.com/davidjbradshaw/iframe-resizer "iFrame Resizer") v3.5.1 and [FitVids.js](https://github.com/davatron5000/FitVids.js "FitVids.js") 1.1.
338
+ * Enhancement: If another plugin is using the same shortcode as this I now output a prompt in the admin area. Also added a setting to turn off this prompt just in case you're using the secondary shortcode and are happy for this.
339
+ * Enhancement: Re-written code for help screens, including adding more information and additional tabs.
340
+ * Maintenance: Moved the settings page to, well, the Settings menu option. It makes sense.
341
+ * Maintenence: Removed the enable of the JS API, which is now deprecated.
342
+ * Maintenance: Improved the admin screen output code - had made it more WordPress standard in version 4 but got some of the code wrong.
343
+
344
  = 4.0.2 =
345
  * Maintenance: Not really a bug, but in some circumstances I wasn't initialising a variable used when generating the embed code. It worked fine but wasn't best practise so fixed. Sloppy.
346
  * Maintenance: Modified the default parameters so new user videos should appear with the same options as on YouTube itself. Consistent.
665
 
666
  == Upgrade Notice ==
667
 
668
+ = 4.1 =
669
+ * Loads and loads of new features. Because I love you all.
670
+
671
  = 4.0.2 =
672
  * Minor bug fixes
673
 
uninstall.php CHANGED
@@ -46,4 +46,6 @@ if ( is_array( $options ) ) {
46
 
47
  delete_option( 'youtube_embed_general' );
48
  delete_option( 'youtube_embed_shortcode' );
 
 
49
  ?>
46
 
47
  delete_option( 'youtube_embed_general' );
48
  delete_option( 'youtube_embed_shortcode' );
49
+ delete_option( 'youtube_embed_shortcode_admin' );
50
+ delete_option( 'youtube_embed_shortcode_site' );
51
  ?>
youtube-embed.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: YouTube Embed
4
  Plugin URI: https://wordpress.org/plugins/youtube-embed/
5
  Description: Embed YouTube Videos in WordPress
6
- Version: 4.0.2
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  Text Domain: youtube-embed
@@ -19,7 +19,7 @@ Domain Path: /languages
19
  * @since 2.0
20
  */
21
 
22
- define( 'youtube_embed_version', '4.0.2' );
23
 
24
  $functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
25
 
3
  Plugin Name: YouTube Embed
4
  Plugin URI: https://wordpress.org/plugins/youtube-embed/
5
  Description: Embed YouTube Videos in WordPress
6
+ Version: 4.1
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  Text Domain: youtube-embed
19
  * @since 2.0
20
  */
21
 
22
+ define( 'youtube_embed_version', '4.1' );
23
 
24
  $functions_dir = WP_PLUGIN_DIR . '/youtube-embed/includes/';
25