Featured Video Plus - Version 2.0.0

Version Description

Only upgrade when using WordPress 3.7 or higher! Big refactor with support for more video providers.

=

Download this release

Release Info

Developer a.hoereth
Plugin Icon 128x128 Featured Video Plus
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.9.1 to 2.0.0

Files changed (61) hide show
  1. CHANGELOG.md +87 -0
  2. FAQ.md +19 -0
  3. README.md +86 -0
  4. css/backend.css +0 -118
  5. css/backend.min.css +0 -1
  6. css/frontend.css +0 -8
  7. css/loading_b.gif +0 -0
  8. css/loading_w.gif +0 -0
  9. featured-video-plus.php +50 -87
  10. img/loadicon_b.gif +0 -0
  11. img/loadicon_w.gif +0 -0
  12. img/placeholder.png +0 -0
  13. img/playicon.png +0 -0
  14. js/backend.js +0 -230
  15. js/backend.min.js +0 -1
  16. js/backend_35.js +0 -45
  17. js/backend_pre35.js +0 -16
  18. js/frontend.js +195 -97
  19. js/frontend.min.js +1 -1
  20. js/html.js +305 -0
  21. js/html.min.js +1 -0
  22. js/jquery.autosize.js +184 -184
  23. js/jquery.autosize.min.js +1 -7
  24. js/jquery.domwindow.js +369 -369
  25. js/jquery.domwindow.min.js +1 -18
  26. js/jquery.fitvids.js +83 -80
  27. js/jquery.fitvids.min.js +1 -1
  28. js/post.js +199 -0
  29. js/post.min.js +1 -0
  30. js/settings.js +0 -24
  31. license.txt +280 -280
  32. lng/featured-video-plus-de_DE.mo +0 -0
  33. lng/featured-video-plus-de_DE.po +299 -651
  34. lng/featured-video-plus-es_ES.mo +0 -0
  35. lng/featured-video-plus-es_ES.po +299 -667
  36. lng/featured-video-plus.pot +341 -392
  37. php/backend.php +0 -763
  38. php/class-backend.php +697 -0
  39. php/class-frontend.php +212 -0
  40. php/class-help.php +176 -0
  41. php/class-html.php +545 -0
  42. php/class-main.php +304 -0
  43. php/class-oembed.php +481 -0
  44. php/class-settings.php +551 -0
  45. php/frontend.php +0 -117
  46. php/functions.php +125 -108
  47. php/general.php +0 -226
  48. php/inc-install.php +21 -0
  49. php/inc-upgrade.php +207 -0
  50. php/settings.php +0 -449
  51. php/somatic_attach_external_image.php +0 -82
  52. php/upgrade.php +0 -158
  53. readme.txt +78 -82
  54. styles/_variables.less +5 -0
  55. styles/backend.css +1 -0
  56. styles/backend.less +59 -0
  57. styles/frontend.css +1 -0
  58. styles/frontend.less +96 -0
  59. styles/html.css +1 -0
  60. styles/html.less +66 -0
  61. uninstall.php +34 -24
CHANGELOG.md ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog #
2
+
3
+ ## 2.0.0: 2015-06-01 ##
4
+ * __Requires WordPress 3.7 or higher now!__ This reflects versions of WordPress which are "officially" [supported](https://codex.wordpress.org/Supported_Versions). The plugin will from now on try to stick to supporting all versions listed there.
5
+ * Major code refactor which results in many bugs scrubbed.
6
+ * Support for raw embed codes and [all WordPress core media providers](https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F).
7
+ * Updated wp.org icon and cover.
8
+
9
+
10
+ ## 1.9.1: 2014-09-06 ##
11
+ * __Last update compatible all the way back to WordPress 3.2!__
12
+ * You can now specify the '[end](https://developers.google.com/youtube/player_parameters#end)' parameter for YouTube embeds ([*](http://wordpress.org/support/topic/how-to-specify-start-and-end-for-youtube-videos))
13
+ * Added option for only displaying videos on single posts/pages ([*](http://wordpress.org/support/topic/i-need-to-only-change-the-featured-images-not-the-thumbnails),[*](http://wordpress.org/support/topic/video-thumbnails-with-link-to-post),[*](http://wordpress.org/support/topic/want-everything-of-fvp-other-than-feature-video-thumb))
14
+ * Removed hardcoded http protocol for embeds [*](http://wordpress.org/support/topic/fix-for-videos-over-ssl)
15
+
16
+ ## 1.9: 2014-01-02 ##
17
+ * Replaced Video.js with MediaElement.js (ships with WordPress since 3.6 - __breaks local videos partially if you use an older WordPress version!__)
18
+ * Added Spanish translations! Translation by [WebHostingHub.com](http://webhostinghub.com)
19
+ * Updated FitVids.js to 1.0.3
20
+
21
+ ## 1.8: 2013-05-16 ##
22
+ * Video.js [4.0](http://blog.videojs.com/post/50021214078/video-js-4-0-now-available)
23
+ * Customize the local video player
24
+ * Better autoplay handling
25
+ * Remove anchors wrapping videos
26
+ * General bug fixes
27
+
28
+ ## 1.7.1: 2013-04-30 ##
29
+ * Fixed manual usage option ([*](http://wordpress.org/support/topic/lightbox-video-on-featured-image-click))
30
+ * Added featured image mouse over effect for featured video AJAX usage
31
+
32
+ ## 1.7: 2013-04-30 ##
33
+ * Added functionality to display featured video in an lightbox using AJAX on featured image click ([*](http://www.web2feel.com/garvan/))
34
+ * Added functionality to replace featured image with featured video on demand when image is clicked using AJAX ([*](http://wordpress.org/support/topic/lightbox-video-on-featured-image-click))
35
+ * `get_the_post_video_url` has a new second parameter (boolean) to get the fallback video's URL ([*](http://wordpress.org/support/topic/fallback-video-url))
36
+ * Tested with WordPress 3.6
37
+
38
+ ## 1.6.1: 2013-04-18 ##
39
+ * Fixed removing featured image when no featured video is specified ([*](http://wordpress.org/support/topic/featured-image-doesnt-save))
40
+
41
+ ## 1.6: 2013-04-16 ##
42
+ * Added `get_the_post_video_url($post_id)` PHP-Function
43
+ * Added YouTube `enablejsapi` parameter with `playerapiid` (`fvpid + $post_id`) and iframe id ([*](http://wordpress.org/support/topic/need-filter-for-iframe-and-embed-code-manipulation))
44
+ * Added a filter for `get_the_post_video`: `get_the_post_video_filter` ([*](http://wordpress.org/support/topic/need-filter-for-iframe-and-embed-code-manipulation))
45
+ * Added option for using the featured image as video thumbnail for local videos
46
+ * Fixed local videoJS ([*](http://wordpress.org/support/topic/how-to-style-the-player-play-button-pause-button-etc))
47
+ * Fixed auto width and height for the Dailymotion and videoJS players
48
+ * Fixed YouTube videos for which the plugin cannot access the YouTube API ([*](http://wordpress.org/support/topic/link-appearing-red-in-featured-video-section))
49
+
50
+ ## 1.5.1: 2013-03-27 ##
51
+ * Fixed Featured Video box on new-post.php
52
+ * Enhanced Featured Image ajax behavior
53
+
54
+ ## 1.5: 2013-03-22 ##
55
+ * __AJAXified__ the Featured Video box - just like Featured Images
56
+ * Added options for a) disabling VideoJS JS/CSS, b) enabling VideoJS CDN and c) YouTube `wmode`
57
+ * Plugin no longer breaks WP image editor ([*](http://wordpress.org/support/topic/breaks-image-scaling-shows-nan))
58
+
59
+ ## 1.4: 2013-03-15 ##
60
+ * __WP 3.5 Media Manager__ seamless integrated
61
+ * Time-links now available for YouTube and Dailymotion (append #t=1m2s)
62
+ * New `autoplay` setting
63
+ * Specify your Dailymotion Syndication Key
64
+ * Added `get_the_post_video_image` & `get_the_post_video_image_url`
65
+ * Local videos no longer break when domain changes or attachment is edited
66
+ * Better Featured Image handling
67
+
68
+ ## 1.3: 2013-01-16 ##
69
+ * __Internationalization__: Added German translations
70
+ * Added customizations for YouTube and Dailymotion
71
+ * Revamped video sizing
72
+ * Better error handling
73
+ * Contextual help on media settings and post edit screen
74
+ * LiveLeak (very experimental, they have no API)
75
+
76
+ ## 1.2: 2013-01-09 ##
77
+ * __Local Videos__: mp4, webm, ogg
78
+ * More dynamic user interface
79
+ * Minimized JS and CSS
80
+
81
+ ## 1.1: 2012-12-16 ##
82
+ * __Dailymotion__
83
+ * Fixed YouTube time-links
84
+ * Enhanced interaction of Featured Videos & Featured Images
85
+
86
+ ## 1.0: 2012-12-13 ##
87
+ * Release
FAQ.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Frequently Asked Questions #
2
+
3
+ ## Why do I just get text back after adding an URL to the Featured Video input? ##
4
+ If the plugin just displays the URL back as text it probably does not recognize that it comes from a video provider. Try inserting the raw embed code instead and [check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported.
5
+
6
+ ## How do I use my local videos? ##
7
+ Click the small media icon in the Featured Video input box on the post edit screen and upload your video or choose it from the media library. WordPress does not support all formats tho, [check this table](http://www.mediaelementjs.com/#devices) for details.
8
+
9
+ ## Why do I not see a featuerd video or image on the frontend at all? ##
10
+ For the videos to be automatically displayed you need to define a Featured Image. This image will never be shown if a video is available. If your theme does not support featured images the plugin also has no chance of working out of the box.
11
+
12
+ ## Why does the frontend still display the featured image although I added a featured video to the post? ##
13
+ Sadly not all themes work out of the box. Themes need to make use of WordPress' native [Post Thumbnail](http://codex.wordpress.org/Post_Thumbnails) functionality (specifically `get_the_post_thumbnail()` and/or `the_post_thumbnail()`) - these functions are where the plugin can hook into the theme and modify what is displayed. Consider contacting the theme's creator or modifying the theme's sourcecode in order to add the plugin's [PHP-functions](https://wordpress.org/plugins/featured-video-plus/installation/).
14
+
15
+ ## How can I make the videos fit into their designated space in my theme? ##
16
+ Take a look at your media settings and try using a fixed width instead of responsive sizing.
17
+
18
+ ## Can I help translating the plugin? ##
19
+ Yes, please! Check out the public [Featured Video Plus Translation Project](https://poeditor.com/join/project?hash=WlyLh0cFO3).
README.md ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Featured Video Plus #
2
+
3
+ Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo and many more.
4
+
5
+
6
+
7
+ ## Description ##
8
+ > A picture is worth a thousand words. How many words is a video worth?
9
+
10
+ Featured Videos work like Featured Images, just smoother: Paste a video URL into the designated new box on the post edit screen and the video will be displayed in place of a post image.
11
+
12
+ There are three ways to get the videos onto your page:
13
+
14
+ 1. **Automagically!** If your theme makes use of WordPress' native [featured image functionality](http://codex.wordpress.org/Post_Thumbnails) you are set: Automatic insertion, lazy loading or lightbox overlays, its your choice. If this does not work you can either
15
+ 2. insert the `[featured-video-plus]`-__Shortcode__ in your posts or
16
+ 3. manually make use of the __PHP-functions__ in your theme's source files.
17
+
18
+ > Sadly many themes do not follow the WordPress standards and implement their own fancy functions for displaying featured images - check out the [FAQ](https://wordpress.org/plugins/featured-video-plus/faq/). Another common problem are sliders - in general: Videos do not like sliders at all.
19
+
20
+ See the plugin in action on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus/). There is a button in the sidebar to switch between the different featured video display modes: [Automatic](http://yrnxt.com/wordpress/featured-video-plus/?setfvpmode=replace), [lazy](http://yrnxt.com/wordpress/featured-video-plus/?setfvpmode=dynamic) and [overlay](http://yrnxt.com/wordpress/featured-video-plus/?setfvpmode=overlay).
21
+
22
+ Besides **Local Videos** you can use videos from a whole lot of external providers like **YouTube**, **Vimeo** and **Dailymotion**. **SoundCloud** and **Spotify** (including playlists) are supported as well. Check the [WordPress Codex](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) for a complete list. If some provider is not listed you can always just use an embed code or whatever HTML you like.
23
+
24
+ After installing the plugin check your site's *Media Settings* (`Settings -> Media` in the administration interface): The plugin adds quite some little helper options there. Change to lazy or overlay mode, tweak video sizing, individualize the look of the most prominent providers' video players and turn on autoplay or video looping. By default videos try to dynamically fit their parent containers width and adjust their size responsively.
25
+
26
+ ### Support ###
27
+ I do read all support questions in the [forums](https://wordpress.org/support/plugin/featured-video-plus) but cannot reply to all of them. The plugin is an unpaid side project and full support would require more time than I can invest for free for over 10k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements.
28
+
29
+
30
+
31
+ ## Installation ##
32
+
33
+ ### Installation ###
34
+
35
+ 1. Visit your WordPress Administration interface and go to `Plugins -> Add New`
36
+ 2. Search for `Featured Video Plus`, and click `Install Now` below the plugin's name
37
+ 3. When the installation finished, click `Activate Plugin`
38
+
39
+ The plugin is ready to go. Now edit your posts and add video links to the `Featured Video` box on the right! Plugin specific settings can be found under `Settings -> Media`.
40
+
41
+ ### Theme integration ###
42
+
43
+ If the automatic integration fails you can always fallback to either using the shortcode or adjusting your themes sourcecode manually:
44
+
45
+ **Shortcode**
46
+
47
+ [featured-video-plus]
48
+ [featured-video-plus width=300]
49
+
50
+ **PHP-functions**
51
+
52
+ the_post_video( $size )
53
+ has_post_video( $post_id )
54
+ get_the_post_video( $post_id, $size )
55
+ get_the_post_video_url( $post_id )
56
+ get_the_post_video_image( $post_id )
57
+ get_the_post_video_image_url( $post_id )
58
+
59
+ All parameters are optional. If no `$post_id` is given the current post's ID will be used. `$size` is either a string keyword (`thumbnail`, `medium`, `large` or `full`) or a 2-item array representing width and height in pixels, e.g. `array(560,320)`.
60
+
61
+ When editing your theme's sourcecode keep in mind that a future update through WordPress.org might overwrite your changes. Consider creating a child theme to prevent that.
62
+
63
+
64
+
65
+ ## Screenshots ##
66
+
67
+ 1. A Featured Video in the Twenty Fifteen theme on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus).
68
+ ![1. A Featured Video in the Twenty Fifteen theme on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus).](https://ps.w.org/featured-video-plus/assets/screenshot-1.jpg)
69
+
70
+ 2. Featured Video and Featured Image boxes on the post edit screen.
71
+ ![2. Featured Video and Featured Image boxes on the post edit screen.](https://ps.w.org/featured-video-plus/assets/screenshot-2.jpg)
72
+
73
+ 3. Featured Video settings on the `Settings -> Media` administration screen.
74
+ ![3. Featured Video settings on the `Settings -> Media` administration screen.](https://ps.w.org/featured-video-plus/assets/screenshot-3.jpg)
75
+
76
+
77
+
78
+
79
+
80
+ ## Upgrade Notice ##
81
+
82
+ ### 2.0.0 ###
83
+ Only upgrade when using WordPress 3.7 or higher! Big refactor with support for more video providers.
84
+
85
+
86
+
css/backend.css DELETED
@@ -1,118 +0,0 @@
1
- .wp-picker-holder {
2
- position: absolute; bottom: 2.5em; left: -1em;
3
- z-index: 1;
4
- -webkit-box-shadow: 3px 3px 5px #ddd;
5
- -moz-box-shadow: 3px 3px 5px #ddd;
6
- box-shadow: 3px 3px 5px #ddd;
7
- -webkit-box-sizing: border-box;
8
- -moz-box-sizing: border-box;
9
- box-sizing: border-box;
10
- }
11
-
12
- .fvp_colorpicker {
13
- position: absolute;
14
- bottom: 0; right: -197px;
15
- background-color: #fff;
16
- z-index: 100;
17
- border: 1px solid #ccc;
18
- }
19
-
20
- .defaultTextActive {
21
- color: #a1a1a1;
22
- font-style: italic;
23
- }
24
-
25
- #fvp_activation_notification {
26
- border-color: #00adef !important;
27
- background-color: whiteSmoke !important;
28
- }
29
- .fvp_hidden {
30
- display: none;
31
- }
32
- .fvp_notice {
33
- -webkit-border-radius: 3px;
34
- border-radius: 3px;
35
- border-width: 1px;
36
- border-style: solid;
37
- background-color: white;
38
- border-color: gray;
39
- margin: .5em 0;
40
- padding: .4em .6em .2em;
41
- }
42
-
43
- .fvp_warning {
44
- -webkit-border-radius: 3px;
45
- border-radius: 3px;
46
- border-width: 1px;
47
- border-style: solid;
48
- background-color: lightYellow;
49
- border-color: #E6DB55;
50
- margin: .5em 0;
51
- padding: .4em .6em .2em;
52
- }
53
-
54
- #featured_video_plus-box textarea {
55
- resize: none;
56
- width: 100%;
57
- height: 1.1em;
58
- line-height: 1.1em;
59
- font-size: 1em;
60
- }
61
-
62
- .fvp_grouplable {
63
- width: 100px;
64
- float: left;
65
- padding-top: 2px;
66
- }
67
- .fvp_grouppart1 {
68
- width: 200px;
69
- float: left;
70
- padding-top: 2px;
71
- }
72
- .fvp_readonly {
73
- color: gray !important;
74
- }
75
- .fvp_invalid {
76
- background-color: #FA8072;
77
- }
78
-
79
- .fvp_radio_bumper {
80
- float: left;
81
- width: 100px;
82
- }
83
-
84
- .fvp_input_wrapper {
85
- position: relative;
86
- }
87
- #featured_video_plus-box .fvp_input {
88
- padding-right: 21px;
89
- }
90
- .fvp_media_icon {
91
- background: transparent no-repeat top left;
92
- display: block;
93
- width: 15px;
94
- height: 15px;
95
- position: absolute; top: 4px; right: 4px;
96
- }
97
-
98
- .fvp_code_list li {
99
- margin-bottom: 0;
100
- }
101
-
102
- .box_topright {
103
- float: right;
104
- width: 20px;
105
- height: 30px;
106
- line-height: 30px;
107
- text-align: center;
108
- }
109
- .box_topright #fvp_remove {
110
- display: block;
111
- height: 10px;
112
- width: 10px;
113
- margin-top: 10px;
114
- background: url('/wordpress/wp-admin/images/xit.gif') no-repeat center left;
115
- }
116
- .box_topright #fvp_remove:hover {
117
- background: url('/wordpress/wp-admin/images/xit.gif') no-repeat center right;
118
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/backend.min.css DELETED
@@ -1 +0,0 @@
1
- .wp-picker-holder{position:absolute;bottom:2.5em;left:-1em;z-index:1;-webkit-box-shadow:3px 3px 5px #ddd;-moz-box-shadow:3px 3px 5px #ddd;box-shadow:3px 3px 5px #ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.fvp_colorpicker{position:absolute;bottom:0;right:-197px;background-color:#fff;z-index:100;border:1px solid #ccc}.defaultTextActive{color:#a1a1a1;font-style:italic}#fvp_activation_notification{border-color:#00adef!important;background-color:#f5f5f5!important}.fvp_hidden{display:none}.fvp_notice{-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;background-color:#fff;border-color:gray;margin:.5em 0;padding:.4em .6em .2em}.fvp_warning{-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;background-color:#ffffe0;border-color:#E6DB55;margin:.5em 0;padding:.4em .6em .2em}#featured_video_plus-box textarea{resize:none;width:100%;height:1.1em;line-height:1.1em;font-size:1em}.fvp_grouplable{width:100px;float:left;padding-top:2px}.fvp_grouppart1{width:200px;float:left;padding-top:2px}.fvp_readonly{color:gray!important}.fvp_invalid{background-color:salmon}.fvp_radio_bumper{float:left;width:100px}.fvp_input_wrapper{position:relative}#featured_video_plus-box .fvp_input{padding-right:21px}.fvp_media_icon{background:transparent no-repeat top left;display:block;width:15px;height:15px;position:absolute;top:4px;right:4px}.fvp_code_list li{margin-bottom:0}.box_topright{float:right;width:20px;height:30px;line-height:30px;text-align:center}.box_topright #fvp_remove{display:block;height:10px;width:10px;margin-top:10px;background:url(/wordpress/wp-admin/images/xit.gif) no-repeat center left}.box_topright #fvp_remove:hover{background:url(/wordpress/wp-admin/images/xit.gif) no-repeat center right}
 
css/frontend.css DELETED
@@ -1,8 +0,0 @@
1
- .featured_video_plus.responsive .wp-video,
2
- .featured_video_plus.responsive .wp-video video {
3
- width: 100% !important;
4
- height: auto !important;
5
- }
6
- .featured_video_plus.responsive .wp-video .mejs-poster {
7
- background-size: cover !important;
8
- }
 
 
 
 
 
 
 
 
css/loading_b.gif DELETED
Binary file
css/loading_w.gif DELETED
Binary file
featured-video-plus.php CHANGED
@@ -1,114 +1,77 @@
1
  <?php
2
- /**
3
  Plugin Name: Featured Video Plus
4
  Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/
5
  Description: Add Featured Videos to your posts and pages.
 
6
  Author: Alexander Höreth
7
- Version: 1.9.1
8
  Author URI: http://yrnxt.com
 
 
9
  License: GPL2
10
 
11
- Copyright 2009-2014 Alexander Höreth (email: a.hoereth@gmail.com)
12
 
13
- This program is free software; you can redistribute it and/or modify
14
- it under the terms of the GNU General Public License version 2,
15
- as published by the Free Software Foundation.
16
 
17
- You may NOT assume that you can use any other version of the GPL.
18
 
19
- This program is distributed in the hope that it will be useful,
20
- but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- GNU General Public License for more details.
23
 
24
- The license for this software can likely be found here:
25
- http://www.gnu.org/licenses/gpl-2.0.html
26
 
27
  */
28
 
29
- if (!defined('FVP_VERSION'))
30
- define('FVP_VERSION', '1.9.1');
31
 
32
- // symlink proof
33
- $pathinfo = pathinfo(dirname(plugin_basename(__FILE__)));
34
- if (!defined('FVP_NAME'))
35
- define('FVP_NAME', $pathinfo['filename']);
36
- if (!defined('FVP_DIR'))
37
- define('FVP_DIR', plugin_dir_path(__FILE__));
38
- if (!defined('FVP_URL'))
39
- define('FVP_URL', plugins_url(FVP_NAME) . '/');
40
-
41
- // init general class, located in php/general.php
42
- include_once( FVP_DIR . 'php/general.php' );
43
- $featured_video_plus = new featured_video_plus();
44
-
45
- // include api functions which are intended to be used by developers
46
- include_once( FVP_DIR . 'php/functions.php' );
47
-
48
- // init translations
49
- add_action( 'plugins_loaded', array( &$featured_video_plus, 'language' ) );
50
-
51
-
52
- // only on backend / administration interface
53
- if( is_admin() ) {
54
- // init backend class, located in php/backend.php
55
- include_once( FVP_DIR . 'php/backend.php' );
56
- $featured_video_plus_backend = new featured_video_plus_backend($featured_video_plus);
57
-
58
- // plugin upgrade/setup
59
- include_once( FVP_DIR . '/php/upgrade.php' );
60
- add_action( 'admin_init', 'featured_video_plus_upgrade' );
61
-
62
- // admin meta box
63
- add_action('admin_menu', array( &$featured_video_plus_backend, 'metabox_register' ) );
64
- add_action('save_post', array( &$featured_video_plus_backend, 'metabox_save' ) );
65
 
66
- // enqueue admin scripts and styles
67
- add_action('admin_enqueue_scripts', array( &$featured_video_plus_backend, 'enqueue' ) );
 
 
68
 
69
- // link to media settings on plugins overview
70
- add_filter('plugin_action_links', array( &$featured_video_plus_backend, 'plugin_action_link' ), 10, 2);
 
71
 
72
- // add upload mime types for HTML5 videos
73
- add_filter('upload_mimes', array( &$featured_video_plus_backend, 'add_upload_mimes' ) );
 
74
 
75
- // post edit help
76
- add_action('admin_init', array( &$featured_video_plus_backend, 'help' ) );
77
- add_action( 'load-post.php', array( &$featured_video_plus_backend, 'tabs' ), 20 ); // $GLOBALS['pagenow']
78
- if( get_bloginfo('version') < 3.3 )
79
- add_filter( 'contextual_help', array( &$featured_video_plus_backend, 'help_pre_33' ), 10, 3 );
80
 
81
- // admin settings
82
- include_once( FVP_DIR . 'php/settings.php' );
83
- $featured_video_plus_settings = new featured_video_plus_settings();
84
- add_action( 'admin_init', array( &$featured_video_plus_settings, 'settings_init' ) );
 
85
 
86
- // media settings help
87
- add_action('admin_init', array( &$featured_video_plus_settings, 'help' ) );
88
- add_action( 'load-options-media.php', array( &$featured_video_plus_settings, 'tabs' ), 20 ); // $GLOBALS['pagenow']
89
- if( get_bloginfo('version') < 3.3 )
90
- add_filter( 'contextual_help', array( &$featured_video_plus_settings, 'help_pre_33' ), 10, 3 );
91
 
92
- if (defined('DOING_AJAX')&&DOING_AJAX){
93
- add_action( 'wp_ajax_fvp_ajax', array( &$featured_video_plus_backend, 'ajax' ) );
94
- add_action( 'wp_ajax_fvp_get_embed', array( &$featured_video_plus_backend, 'ajax_get_embed' ));
95
- add_action( 'wp_ajax_nopriv_fvp_get_embed', array( &$featured_video_plus_backend, 'ajax_get_embed' ));
96
- }
97
  }
98
 
99
 
100
- // only on frontend / page
101
- if( !is_admin() ) {
102
- // init frontend class, located in php/frontend.php
103
- include_once( FVP_DIR . 'php/frontend.php' );
104
- $featured_video_plus_frontend = new featured_video_plus_frontend($featured_video_plus);
105
-
106
- // enqueue scripts and styles
107
- add_action( 'wp_enqueue_scripts', array( &$featured_video_plus_frontend, 'enqueue' ) );
108
-
109
- // filter get_post_thumbnail output
110
- add_filter( 'post_thumbnail_html', array( &$featured_video_plus_frontend, 'filter_post_thumbnail'), 99, 5);
111
-
112
- // shortcode
113
- add_shortcode( 'featured-video-plus', array( &$featured_video_plus_frontend, 'shortcode' ) );
114
  }
 
 
 
 
1
  <?php
2
+ /*
3
  Plugin Name: Featured Video Plus
4
  Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/
5
  Description: Add Featured Videos to your posts and pages.
6
+ Version: 2.0.0
7
  Author: Alexander Höreth
 
8
  Author URI: http://yrnxt.com
9
+ Text Domain: featured-video-plus
10
+ Domain Path: /lng
11
  License: GPL2
12
 
13
+ Copyright 2009-2015 Alexander Höreth (email: a.hoereth@gmail.com)
14
 
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License version 2,
17
+ as published by the Free Software Foundation.
18
 
19
+ You may NOT assume that you can use any other version of the GPL.
20
 
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
 
26
+ The license for this software can likely be found here:
27
+ http://www.gnu.org/licenses/gpl-2.0.html
28
 
29
  */
30
 
 
 
31
 
32
+ // ********************
33
+ // CONSTANTS
34
+ if ( ! defined( 'FVP_VERSION' ) ) {
35
+ define( 'FVP_VERSION', '1.9.2' );
36
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
+ $pathinfo = pathinfo( dirname( plugin_basename( __FILE__ ) ) );
39
+ if ( ! defined( 'FVP_NAME' ) ) {
40
+ define( 'FVP_NAME', $pathinfo['filename'] );
41
+ }
42
 
43
+ if ( ! defined( 'FVP_DIR' ) ) {
44
+ define( 'FVP_DIR', plugin_dir_path( __FILE__ ) );
45
+ }
46
 
47
+ if ( ! defined( 'FVP_URL' ) ) {
48
+ define( 'FVP_URL', plugins_url( FVP_NAME ) . '/' );
49
+ }
50
 
 
 
 
 
 
51
 
52
+ // ********************
53
+ // BACKEND
54
+ if ( is_admin() ) {
55
+ require_once( FVP_DIR . 'php/class-backend.php' );
56
+ $featured_video_plus = new FVP_Backend();
57
 
58
+ // SETTINGS
59
+ require_once( FVP_DIR . 'php/class-settings.php' );
60
+ new FVP_Settings();
 
 
61
 
62
+ // HELP TABS
63
+ require_once( FVP_DIR . 'php/class-help.php' );
64
+ new FVP_Help();
 
 
65
  }
66
 
67
 
68
+ // ********************
69
+ // FRONTEND
70
+ if ( ! is_admin() ) {
71
+ require_once( FVP_DIR . 'php/class-frontend.php' );
72
+ $featured_video_plus = new FVP_Frontend();
 
 
 
 
 
 
 
 
 
73
  }
74
+
75
+ // ********************
76
+ // PUBLIC API
77
+ include_once( FVP_DIR . 'php/functions.php' );
img/loadicon_b.gif ADDED
Binary file
img/loadicon_w.gif ADDED
Binary file
img/placeholder.png ADDED
Binary file
img/playicon.png ADDED
Binary file
js/backend.js DELETED
@@ -1,230 +0,0 @@
1
- jQuery(document).ready(function($){
2
-
3
- /**
4
- * Set input field values to default on blur if empty and ajax submit if changed
5
- * @since 1.0
6
- */
7
- $('#fvp_video').blur(function() {
8
- t = $(this); // required to make use of it in ajax callback
9
-
10
- t.val( $.trim( t.val()) );
11
-
12
- value = t.val();
13
- if((value.length === 0) ||
14
- (value == fvp_backend_data.default_value ) ){
15
- t.addClass("defaultTextActive");
16
- t.val( fvp_backend_data.default_value );
17
- }
18
- t.trigger('autosize');
19
-
20
- if( t.val() != t.siblings('.fvp_mirror').val() ) {
21
- bg = t.siblings('.fvp_video_choose').children('.fvp_media_icon').css('backgroundImage');
22
- t.siblings('.fvp_video_choose').children('.fvp_media_icon').css('backgroundImage', "url('"+fvp_backend_data.loading_gif+"')");
23
- $('#fvp_current_video').css({'backgroundImage':"url('"+fvp_backend_data.loading_gif+"')",'width':'256px'}).animate({'height':'144px'})
24
- .children().animate({'opacity':0});
25
- $.post( ajaxurl,
26
- {
27
- 'action' : 'fvp_ajax',
28
- 'id' : $('#post_ID').val(),
29
- 'fvp_nonce' : $('#fvp_nonce').val(),
30
- 'fvp_video' : $('#fvp_video').val()
31
- },
32
- function(data) {
33
- t.siblings('.fvp_mirror').val( t.val() );
34
- t.siblings('.fvp_video_choose').children('.fvp_media_icon').css('backgroundImage', bg);
35
- if(data.typ == 'removed'){
36
- $('#fvp_current_video').css({'backgroundImage':''}).animate({'height':'0px'});
37
- if( data.img != '' )
38
- $('#postimagediv .inside').html(data.img);
39
- } else {
40
- $('#fvp_current_video').html(data.video).animate({'height':'144px'});
41
- $("#fvp_help_notice").slideUp('fast');
42
- if (data.valid) {
43
- $('#postimagediv .inside').html(data.img);
44
- $("#fvp_set_featimg_link, #fvp_featimg_warning").slideUp().addClass("fvp_hidden");
45
- t.css('backgroundColor','#00FF00').animate({'backgroundColor':'white'}, 500, function() { t.css('backgroundColor',''); });
46
- if (data.prov == 'local' && fvp_backend_data.videojs)
47
- vjs = videojs('videojs'+data.id,{},function(){});
48
- } else
49
- t.addClass('fvp_invalid');
50
- }
51
- }, "json"
52
- );
53
- }
54
- });
55
-
56
- /**
57
- * Remove default values of input fields on focus
58
- * @since 1.0
59
- */
60
- $(".fvp_input").focus(function() {
61
- value = $(this).val();
62
- if( value == fvp_backend_data.default_value ){
63
- $(this).removeClass("defaultTextActive");
64
- $(this).val("");
65
- }
66
- });
67
-
68
- /**
69
- * Blur both input fields on page load, autosize them and prevent enter-keypress
70
- * @see http://www.jacklmoore.com/autosize
71
- * @since 1.0
72
- */
73
- $(".fvp_input").autosize().trigger("blur").keypress(function(event) {
74
- if (event.keyCode == 13) // enter
75
- event.preventDefault();
76
- });
77
-
78
- /**
79
- * Select whole input field content on click
80
- * @since 1.2
81
- */
82
- $(".fvp_input").click(function() {
83
- $(this).select();
84
- });
85
-
86
- /**
87
- * Called when a change on the primary video input occurred
88
- * @since 1.2
89
- */
90
- function handleVideoInput( obj ) {
91
- var value = $.trim(obj.val());
92
- $("#fvp_help_notice").slideDown('fast');
93
-
94
- if ( value.length === 0 || value == fvp_backend_data.default_value ) {
95
- $("#fvp_video").removeClass('fvp_invalid'); //css('backgroundColor', 'white');
96
- $("#fvp_localvideo_format_warning").slideUp('fast');
97
- }
98
-
99
- if ( value.match( fvp_backend_data.wp_upload_dir.replace(/\//g, "\\\/") ) ) {
100
- var file_extension = /^.*\/(.*)\.(.*)/g;
101
- var match = file_extension.exec(value);
102
- if ( match[2] == 'webm' || match[2] == 'mp4' || match[2] == 'ogg' || match[2] == 'ogv' ) {
103
- $("#fvp_video").removeClass('fvp_invalid'); //.css('backgroundColor', 'white');
104
- $("#fvp_localvideo_format_warning").slideUp('fast');
105
- } else {
106
- $("#fvp_video").addClass('fvp_invalid'); //css('backgroundColor', 'lightYellow');
107
- $("#fvp_localvideo_format_warning").slideDown('fast', 'linear');
108
- }
109
- } else {
110
- $("#fvp_video").removeClass('fvp_invalid'); //.css('backgroundColor', 'white');
111
- $("#fvp_localvideo_format_warning").slideUp('fast');
112
- }
113
- }
114
-
115
- /**
116
- * recognize change on the primary video input
117
- * @since 1.2
118
- */
119
- $("#fvp_video").bind("change paste keyup", function() {
120
- setTimeout(handleVideoInput($(this)), 200);
121
- });
122
-
123
- /**
124
- * set featured image link and featured image requirement warning
125
- * @since 1.1
126
- */
127
- $("#fvp_set_featimg_link").removeClass('fvp_hidden');
128
- $("#fvp_set_featimg_input").addClass('fvp_hidden');
129
-
130
- $("#fvp_set_featimg_link, #fvp_warning_set_featimg").click(function() {
131
- $("#fvp_set_featimg").attr('checked', true);
132
- //$("#fvp_set_featimg").closest("form").submit();
133
- $.post( ajaxurl,
134
- {
135
- 'action' : 'fvp_ajax',
136
- 'id' : $('#post_ID').val(),
137
- 'fvp_nonce' : $('#fvp_nonce').val(),
138
- 'fvp_video' : $('#fvp_video').val()
139
- },
140
- function (data) {
141
- $('#postimagediv .inside').html(data.img);
142
- $("#fvp_set_featimg_link, #fvp_featimg_warning").slideUp().addClass("fvp_hidden");
143
- }, "json"
144
- );
145
- return false;
146
- });
147
-
148
- $("#remove-post-thumbnail").click(function() {
149
- $("#fvp_set_featimg_link, #fvp_featimg_warning").slideDown().removeClass("fvp_hidden");
150
- });
151
-
152
- $("#set-post-thumbnail").click(function() {
153
- $("#fvp_featimg_box_warning").addClass("fvp_hidden");
154
- });
155
-
156
- /**
157
- * Toggle for opening the contextual help
158
- * @since 1.3
159
- */
160
- $('#fvp_help_toggle').bind( 'click', function() {
161
- $('#contextual-help-link').trigger('click');
162
- });
163
-
164
- /**
165
- * Making use of the WordPress 3.5 Media Manager
166
- *
167
- * @see http://www.blazersix.com/blog/wordpress-image-widget/
168
- * @see https://github.com/blazersix/simple-image-widget/blob/master/js/simple-image-widget.js
169
- */
170
- var $control, $controlTarget, mediaControl;
171
-
172
- mediaControl = {
173
- // Initializes a new media manager or returns an existing frame.
174
- // @see wp.media.featuredImage.frame()
175
- frame: function() {
176
- if ( this._frame )
177
- return this._frame;
178
-
179
- this._frame = wp.media({
180
- title: $control.data('title'),
181
- library: {
182
- type: 'document'
183
- },
184
- button: {
185
- text: $control.data('button')
186
- },
187
- multiple: false
188
- });
189
-
190
- this._frame.on( 'open', this.updateFrame ).state('library').on( 'select', this.select );
191
-
192
- return this._frame;
193
- },
194
-
195
- select: function() {
196
- var selection = this.get('selection'),
197
- returnProperty = 'url';
198
-
199
- $( $control.data('target') ).val( selection.pluck( returnProperty ) ).trigger('autosize').change().removeClass("defaultTextActive");
200
- $('#fvp_video').blur();
201
- },
202
-
203
- updateFrame: function() {
204
- // Do something when the media frame is opened.
205
- },
206
-
207
- init: function() {
208
- $('#wpbody').on('click', '.fvp_video_choose', function(e) {
209
- e.preventDefault();
210
-
211
- $control = $(this).closest('.fvp_input_wrapper');
212
-
213
- mediaControl.frame().open();
214
- });
215
- }
216
- };
217
-
218
- // Media Manager was implemented in WordPress 3.5
219
- if(fvp_backend_data.wp_35 == 1)
220
- mediaControl.init();
221
-
222
-
223
- /**
224
- * Button in the top right of the Featured Video box. Planned for a feature release.
225
- *
226
- * @since 1.#
227
- */
228
- //$('#featured_video_plus-box .handlediv').after('<div class="box_topright"><a href="#" id="fvp_remove" title="Remove Featured Video"><br /></div></div>');
229
-
230
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/backend.min.js DELETED
@@ -1 +0,0 @@
1
- jQuery(document).ready(function(a){function b(b){var c=a.trim(b.val());if(a("#fvp_help_notice").slideDown("fast"),(0===c.length||c==fvp_backend_data.default_value)&&(a("#fvp_video").removeClass("fvp_invalid"),a("#fvp_localvideo_format_warning").slideUp("fast")),c.match(fvp_backend_data.wp_upload_dir.replace(/\//g,"\\/"))){var d=/^.*\/(.*)\.(.*)/g,e=d.exec(c);"webm"==e[2]||"mp4"==e[2]||"ogg"==e[2]||"ogv"==e[2]?(a("#fvp_video").removeClass("fvp_invalid"),a("#fvp_localvideo_format_warning").slideUp("fast")):(a("#fvp_video").addClass("fvp_invalid"),a("#fvp_localvideo_format_warning").slideDown("fast","linear"))}else a("#fvp_video").removeClass("fvp_invalid"),a("#fvp_localvideo_format_warning").slideUp("fast")}a("#fvp_video").blur(function(){t=a(this),t.val(a.trim(t.val())),value=t.val(),(0===value.length||value==fvp_backend_data.default_value)&&(t.addClass("defaultTextActive"),t.val(fvp_backend_data.default_value)),t.trigger("autosize"),t.val()!=t.siblings(".fvp_mirror").val()&&(bg=t.siblings(".fvp_video_choose").children(".fvp_media_icon").css("backgroundImage"),t.siblings(".fvp_video_choose").children(".fvp_media_icon").css("backgroundImage","url('"+fvp_backend_data.loading_gif+"')"),a("#fvp_current_video").css({backgroundImage:"url('"+fvp_backend_data.loading_gif+"')",width:"256px"}).animate({height:"144px"}).children().animate({opacity:0}),a.post(ajaxurl,{action:"fvp_ajax",id:a("#post_ID").val(),fvp_nonce:a("#fvp_nonce").val(),fvp_video:a("#fvp_video").val()},function(b){t.siblings(".fvp_mirror").val(t.val()),t.siblings(".fvp_video_choose").children(".fvp_media_icon").css("backgroundImage",bg),"removed"==b.typ?(a("#fvp_current_video").css({backgroundImage:""}).animate({height:"0px"}),""!=b.img&&a("#postimagediv .inside").html(b.img)):(a("#fvp_current_video").html(b.video).animate({height:"144px"}),a("#fvp_help_notice").slideUp("fast"),b.valid?(a("#postimagediv .inside").html(b.img),a("#fvp_set_featimg_link, #fvp_featimg_warning").slideUp().addClass("fvp_hidden"),t.css("backgroundColor","#00FF00").animate({backgroundColor:"white"},500,function(){t.css("backgroundColor","")}),"local"==b.prov&&fvp_backend_data.videojs&&(vjs=videojs("videojs"+b.id,{},function(){}))):t.addClass("fvp_invalid"))},"json"))}),a(".fvp_input").focus(function(){value=a(this).val(),value==fvp_backend_data.default_value&&(a(this).removeClass("defaultTextActive"),a(this).val(""))}),a(".fvp_input").autosize().trigger("blur").keypress(function(a){13==a.keyCode&&a.preventDefault()}),a(".fvp_input").click(function(){a(this).select()}),a("#fvp_video").bind("change paste keyup",function(){setTimeout(b(a(this)),200)}),a("#fvp_set_featimg_link").removeClass("fvp_hidden"),a("#fvp_set_featimg_input").addClass("fvp_hidden"),a("#fvp_set_featimg_link, #fvp_warning_set_featimg").click(function(){return a("#fvp_set_featimg").attr("checked",!0),a.post(ajaxurl,{action:"fvp_ajax",id:a("#post_ID").val(),fvp_nonce:a("#fvp_nonce").val(),fvp_video:a("#fvp_video").val()},function(b){a("#postimagediv .inside").html(b.img),a("#fvp_set_featimg_link, #fvp_featimg_warning").slideUp().addClass("fvp_hidden")},"json"),!1}),a("#remove-post-thumbnail").click(function(){a("#fvp_set_featimg_link, #fvp_featimg_warning").slideDown().removeClass("fvp_hidden")}),a("#set-post-thumbnail").click(function(){a("#fvp_featimg_box_warning").addClass("fvp_hidden")}),a("#fvp_help_toggle").bind("click",function(){a("#contextual-help-link").trigger("click")});var c,e;e={frame:function(){return this._frame?this._frame:(this._frame=wp.media({title:c.data("title"),library:{type:"video"},button:{text:c.data("button")},multiple:!1}),this._frame.on("open",this.updateFrame).state("library").on("select",this.select),this._frame)},select:function(){var b=this.get("selection"),d="url";a(c.data("target")).val(b.pluck(d)).trigger("autosize").change().removeClass("defaultTextActive"),a("#fvp_video").blur()},updateFrame:function(){},init:function(){a("#wpbody").on("click",".fvp_video_choose",function(b){b.preventDefault(),c=a(this).closest(".fvp_input_wrapper"),e.frame().open()})}},1==fvp_backend_data.wp_35&&e.init()});
 
js/backend_35.js DELETED
@@ -1,45 +0,0 @@
1
- // >=WordPress 3.5
2
- jQuery(document).ready(function($){
3
- $('#fvp-settings-vimeo-color').wpColorPicker({
4
- defaultColor: '#00adef',
5
- hide: true,
6
- palettes: new Array('#00adef', '#ff9933', '#c9ff23', '#ff0179', '#ffffff')
7
- });
8
-
9
- $('#fvp-settings-dailymotion-foreground').wpColorPicker({
10
- defaultColor: '#f7fffd',
11
- hide: true,
12
- palettes: new Array('#E02C72', '#92ADE0', '#E8D9AC', '#C2E165', '#FF0099', '#CFCFCF')
13
- });
14
-
15
- $('#fvp-settings-dailymotion-highlight').wpColorPicker({
16
- defaultColor: '#ffc300',
17
- hide: true,
18
- palettes: new Array('#BF4B78', '#A2ACBF', '#FFF6D9', '#809443', '#C9A1FF', '#834596')
19
- });
20
-
21
- $('#fvp-settings-dailymotion-background').wpColorPicker({
22
- defaultColor: '#171d1b',
23
- hide: true,
24
- palettes: new Array('#260F18', '#202226', '#493D27', '#232912', '#052880', '#000000')
25
- });
26
-
27
-
28
- $('#fvp-settings-local-foreground').wpColorPicker({
29
- defaultColor: '#cccccc',
30
- hide: true,
31
- palettes: new Array('#E02C72', '#92ADE0', '#E8D9AC', '#C2E165', '#FF0099', '#CFCFCF')
32
- });
33
-
34
- $('#fvp-settings-local-highlight').wpColorPicker({
35
- defaultColor: '#66a8cc',
36
- hide: true,
37
- palettes: new Array('#BF4B78', '#A2ACBF', '#FFF6D9', '#809443', '#C9A1FF', '#834596')
38
- });
39
-
40
- $('#fvp-settings-local-background').wpColorPicker({
41
- defaultColor: '#000000',
42
- hide: true,
43
- palettes: new Array('#260F18', '#202226', '#493D27', '#232912', '#052880', '#000000')
44
- });
45
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/backend_pre35.js DELETED
@@ -1,16 +0,0 @@
1
- // <WordPress 3.5
2
- jQuery(document).ready(function($){
3
- $('.fvp_colorpicker').hide().each(function() {
4
- $(this).farbtastic($(this).siblings('.fvp_colorpicker_input'));
5
- });
6
- $(document).mousedown(function() {
7
- $('.fvp_colorpicker').each(function() {
8
- var display = $(this).css('display');
9
- if ( display == 'block' )
10
- $(this).fadeOut();
11
- });
12
- });
13
- $('.fvp_colorpicker_input').click(function() {
14
- $(this).siblings('.fvp_colorpicker').fadeIn();
15
- });
16
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/frontend.js CHANGED
@@ -1,97 +1,195 @@
1
- /**
2
- * Used for removing anchors surrounding featured videos
3
- *
4
- * @since 1.8
5
- */
6
- function fvp_unwrap() {
7
- jQuery('.featured_video_plus, a.fvp_overlay, a.fvp_dynamic').each(function() {
8
- if( jQuery(this).parent().is('a') )
9
- jQuery(this).unwrap();
10
- });
11
- }
12
-
13
- /**
14
- * Replace featured image with the featured video on click
15
- *
16
- * @since 1.7
17
- */
18
- function fvp_dynamic(id){
19
- var t = jQuery('#fvp_'+id);
20
- t.css({'position':'relative'})
21
- .prepend(jQuery('<div />', {
22
- 'class':'fvp_loader',
23
- 'style':'background:transparent url(\''+fvpdata.loadingb+'\') no-repeat center center;'+
24
- 'position: absolute; margin: '+t.children('img').css('margin')+';'+
25
- 'height:'+t.children('img').css('height')+';width:'+t.children('img').css('width')+'; z-index:1000;'
26
- }));
27
- jQuery.post( fvpdata.ajaxurl,
28
- {
29
- 'action': 'fvp_get_embed',
30
- 'nonce' : fvpdata.nonce,
31
- 'id' : id
32
- },
33
- function(data){
34
- if (data.success){
35
- t.replaceWith(data.html);
36
- fvp_unwrap();
37
- if ( fvpdata.fitvids && fvpdata.overlay )
38
- jQuery(".featured_video_plus").fitVids({customSelector: "iframe[src*='dailymotion.com']"});
39
- }
40
- });
41
- }
42
-
43
- jQuery(document).ready(function($){
44
- // remove wrapping anchors
45
- fvp_unwrap();
46
-
47
- // add hover effect
48
- if( fvpdata.overlay || fvpdata.dynamic ){
49
- $('.fvp_overlay,.fvp_dynamic').hover(
50
- function(){ $(this).children('img').animate({opacity:0.65}); },
51
- function(){ $(this).children('img').animate({opacity:1 }); }
52
- );
53
- }
54
-
55
- // overlay click handler
56
- if(fvpdata.overlay){
57
- $('.fvp_overlay').click(function(){
58
- $(this).openDOMWindow({
59
- eventType:null,
60
- windowPadding:0,
61
- borderSize:0,
62
- windowBGColor:'transparent',
63
- overlayOpacity:fvpdata.opacity
64
- });
65
- $('#DOMWindow').css({'background':"transparent url('"+fvpdata.loadingw+"') center center no-repeat"});
66
- var id = new RegExp('[\\?&amp;\\#]fvp_([0-9]+)').exec($(this).attr('href'));
67
- if ($('#fvp_'+id[1]).html().length === 0){
68
- jQuery.post( fvpdata.ajaxurl,
69
- {
70
- 'action': 'fvp_get_embed',
71
- 'nonce' : fvpdata.nonce,
72
- 'id' : id[1]
73
- },
74
- function(data){
75
- if (data.success){
76
- // save the data to not reload when opened again
77
- //$('#fvp_'+id[1]).html(data.html); // removed due to bugs with Video.js
78
-
79
- $('#DOMWindow').html(data.html).css({'width':'auto','height':'auto','margin':'auto auto','overflow':'hidden'});
80
- $(window).trigger('scroll');
81
-
82
- if ( fvpdata.videojs )
83
- videojs('videojs'+data.id,{'autoplay':true},function(){});
84
- }
85
- });//.fail(function() { alert("failed here"); });;
86
- }else{
87
- $('#DOMWindow').html( $('#fvp_'+id[1]).html() ).css({'width':'auto','height':'auto','margin':'auto auto','overflow':'hidden'});
88
- $(window).trigger('scroll');
89
- }
90
- });
91
- }
92
-
93
- // fitvids
94
- if ( fvpdata.fitvids && ! fvpdata.dynamic && ! fvpdata.overlay )
95
- $(".featured_video_plus").fitVids( { customSelector: ["iframe", "object", "embed", ".video-js"] } );
96
-
97
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+ 'use strict';
3
+ /* global fvpdata */
4
+
5
+
6
+ var $loader = $('<div />').addClass('fvp-loader');
7
+ var playBg = 'url(\'' + fvpdata.playicon + '\')';
8
+ var loadBg = 'url(\'' + fvpdata.loadicon + '\')';
9
+ var bgState;
10
+
11
+
12
+ /**
13
+ * Remove the link wrapping featured images on index pages
14
+ */
15
+ function unwrap() {
16
+ $('.has-post-video a.post-thumbnail>.featured-video-plus,' +
17
+ '.has-post-video a.post-thumbnail>.fvp-dynamic,' +
18
+ '.has-post-video a.post-thumbnail>.fvp-overlay,' +
19
+ '.has-post-video a.post-thumbnail>.mejs-video,' +
20
+ '.has-post-video a.post-thumbnail>.wp-video'
21
+ ).unwrap();
22
+ }
23
+
24
+
25
+ /**
26
+ * Autosize videos using fitvids for responsive videos
27
+ */
28
+ function fitVids() {
29
+ if (fvpdata.fitvids) {
30
+ $('.featured-video-plus.fvp-responsive').fitVids({
31
+ customSelector: ['iframe', 'object', 'embed']
32
+ });
33
+ }
34
+ }
35
+
36
+
37
+ /**
38
+ * WordPress forces a maximum size of the global $contentwidth onto local
39
+ * videos - overwrite it.
40
+ */
41
+ function sizeLocal() {
42
+ if (fvpdata.width && ! fvpdata.fitvids) {
43
+ $('.fvp-local .wp-video').css({width: fvpdata.width, height: 'auto'});
44
+ var video = $('.fvp-local .wp-video .wp-video-shortcode');
45
+ video.attr({
46
+ width: fvpdata.width,
47
+ height: (fvpdata.width / video.attr('width') ) * video.attr('heigth')
48
+ });
49
+ }
50
+ }
51
+
52
+
53
+ /**
54
+ * Trigger the play / load icon (and preload them).
55
+ */
56
+ function triggerPlayLoad() {
57
+ // preload images
58
+ if (bgState === undefined) {
59
+ [fvpdata.playicon, fvpdata.loadicon].forEach(function(val) {
60
+ $('body').append( $('<img/>', { src: val }).hide() );
61
+ });
62
+ }
63
+
64
+ // trigger image
65
+ bgState = bgState === playBg ? loadBg : playBg;
66
+ $loader.css({ backgroundImage: bgState });
67
+ }
68
+
69
+
70
+ /**
71
+ * Handle mouseover and mouseout events.
72
+ */
73
+ function hover(event) {
74
+ var $elem = $(event.currentTarget);
75
+ var $img = $elem.children('img');
76
+
77
+ if (0 === $elem.find('.fvp-loader').length) {
78
+ $img.animate({ opacity: fvpdata.opacity });
79
+ $elem
80
+ .css({ position: 'relative' })
81
+ .prepend(
82
+ $loader
83
+ .css({
84
+ height : $img.height(),
85
+ width : $img.width(),
86
+ marginTop : -$img.height()/2,
87
+ marginLeft: -$img.width()/2
88
+ })
89
+ );
90
+ } else if (bgState !== loadBg) {
91
+ $img.animate({ opacity: 1 });
92
+ $loader.remove();
93
+ }
94
+ }
95
+
96
+
97
+ /**
98
+ * Replace a featured image with its featured video on-click.
99
+ */
100
+ function dynamicTrigger(event) {
101
+ event.preventDefault();
102
+ var $self = $(event.currentTarget);
103
+ var id = parseInt($self.attr('data-id'), 10);
104
+
105
+ triggerPlayLoad();
106
+
107
+ $.post(fvpdata.ajaxurl, {
108
+ 'action': 'fvp_get_embed',
109
+ 'nonce' : fvpdata.nonce,
110
+ 'id' : id
111
+ }, function(data){
112
+ if (data.success) {
113
+ $self.replaceWith(data.html);
114
+
115
+ // Initialize mediaelement.js player for the new videos.
116
+ $('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer();
117
+
118
+ // Autosize them if required.
119
+ fitVids();
120
+ }
121
+
122
+ triggerPlayLoad();
123
+ });
124
+ }
125
+
126
+
127
+ /**
128
+ * Show the overlay on-click.
129
+ */
130
+ function overlayTrigger(event) {
131
+ event.preventDefault();
132
+ var $self = $(event.currentTarget);
133
+ var id = parseInt($self.attr('data-id'), 10);
134
+
135
+ $self.openDOMWindow({
136
+ eventType : null,
137
+ windowPadding : 0,
138
+ borderSize : 0,
139
+ windowBGColor : 'transparent',
140
+ overlayOpacity: fvpdata.opacity * 100,
141
+ width : '100%',
142
+ height: '100%'
143
+ });
144
+
145
+ $('#DOMWindow').css({ backgroundImage: loadBg });
146
+
147
+ var $cache = $('#fvp-cache-' + id);
148
+
149
+ // Check if the result is already cached
150
+ if (0 === $cache.html().length) {
151
+ $.post(fvpdata.ajaxurl, {
152
+ 'action': 'fvp_get_embed',
153
+ 'nonce' : fvpdata.nonce,
154
+ 'id' : id
155
+ }, function(data) {
156
+ if (data.success) {
157
+ // cache the result to not reload when opened again
158
+ $cache.html(data.html);
159
+
160
+ $('#DOMWindow').html(data.html);
161
+ sizeLocal();
162
+ $(window).trigger('scroll');
163
+ }
164
+ });
165
+ } else {
166
+ // From cache
167
+ $('#DOMWindow').html( $cache.html() );
168
+ $(window).trigger('scroll');
169
+ }
170
+ }
171
+
172
+
173
+ // Initialization after DOM is completly loaded.
174
+ $(document).ready(function() {
175
+ // remove wrapping anchors
176
+ // doing this twice with a 1 second delay to fix wrapped local video posters
177
+ unwrap();
178
+ setTimeout(unwrap, 1000);
179
+
180
+ // initialize fitvids if available
181
+ fitVids();
182
+
183
+ sizeLocal();
184
+
185
+ // add hover effect and preload icons
186
+ $('.fvp-overlay, .fvp-dynamic').hover(hover, hover);
187
+ triggerPlayLoad();
188
+
189
+ // on-demand video insertion click handler
190
+ $('.fvp-dynamic').click(dynamicTrigger);
191
+
192
+ // overlay click handler
193
+ $('.fvp-overlay').click(overlayTrigger);
194
+ });
195
+ })(jQuery);
js/frontend.min.js CHANGED
@@ -1 +1 @@
1
- function fvp_unwrap(){jQuery(".featured_video_plus, a.fvp_overlay, a.fvp_dynamic").each(function(){jQuery(this).parent().is("a")&&jQuery(this).unwrap()})}function fvp_dynamic(a){var b=jQuery("#fvp_"+a);b.css({position:"relative"}).prepend(jQuery("<div />",{"class":"fvp_loader",style:"background:transparent url('"+fvpdata.loadingb+"') no-repeat center center;"+"position: absolute; margin: "+b.children("img").css("margin")+";"+"height:"+b.children("img").css("height")+";width:"+b.children("img").css("width")+"; z-index:1000;"})),jQuery.post(fvpdata.ajaxurl,{action:"fvp_get_embed",nonce:fvpdata.nonce,id:a},function(a){a.success&&(b.replaceWith(a.html),fvp_unwrap(),fvpdata.fitvids&&fvpdata.overlay&&jQuery(".featured_video_plus").fitVids({customSelector:"iframe[src*='dailymotion.com']"}))})}jQuery(document).ready(function(a){fvp_unwrap(),(fvpdata.overlay||fvpdata.dynamic)&&a(".fvp_overlay,.fvp_dynamic").hover(function(){a(this).children("img").animate({opacity:.65})},function(){a(this).children("img").animate({opacity:1})}),fvpdata.overlay&&a(".fvp_overlay").click(function(){a(this).openDOMWindow({eventType:null,windowPadding:0,borderSize:0,windowBGColor:"transparent",overlayOpacity:fvpdata.opacity}),a("#DOMWindow").css({background:"transparent url('"+fvpdata.loadingw+"') center center no-repeat"});var b=new RegExp("[\\?&amp;\\#]fvp_([0-9]+)").exec(a(this).attr("href"));0===a("#fvp_"+b[1]).html().length?jQuery.post(fvpdata.ajaxurl,{action:"fvp_get_embed",nonce:fvpdata.nonce,id:b[1]},function(b){b.success&&(a("#DOMWindow").html(b.html).css({width:"auto",height:"auto",margin:"auto auto",overflow:"hidden"}),a(window).trigger("scroll"),fvpdata.videojs&&videojs("videojs"+b.id,{autoplay:!0},function(){}))}):(a("#DOMWindow").html(a("#fvp_"+b[1]).html()).css({width:"auto",height:"auto",margin:"auto auto",overflow:"hidden"}),a(window).trigger("scroll"))}),!fvpdata.fitvids||fvpdata.dynamic||fvpdata.overlay||a(".featured_video_plus").fitVids({customSelector:["iframe","object","embed",".video-js"]})});
1
+ !function(t){"use strict";function a(){t(".has-post-video a.post-thumbnail>.featured-video-plus,.has-post-video a.post-thumbnail>.fvp-dynamic,.has-post-video a.post-thumbnail>.fvp-overlay,.has-post-video a.post-thumbnail>.mejs-video,.has-post-video a.post-thumbnail>.wp-video").unwrap()}function e(){fvpdata.fitvids&&t(".featured-video-plus.fvp-responsive").fitVids({customSelector:["iframe","object","embed"]})}function i(){if(fvpdata.width&&!fvpdata.fitvids){t(".fvp-local .wp-video").css({width:fvpdata.width,height:"auto"});var a=t(".fvp-local .wp-video .wp-video-shortcode");a.attr({width:fvpdata.width,height:fvpdata.width/a.attr("width")*a.attr("heigth")})}}function o(){void 0===r&&[fvpdata.playicon,fvpdata.loadicon].forEach(function(a){t("body").append(t("<img/>",{src:a}).hide())}),r=r===v?s:v,c.css({backgroundImage:r})}function d(a){var e=t(a.currentTarget),i=e.children("img");0===e.find(".fvp-loader").length?(i.animate({opacity:fvpdata.opacity}),e.css({position:"relative"}).prepend(c.css({height:i.height(),width:i.width(),marginTop:-i.height()/2,marginLeft:-i.width()/2}))):r!==s&&(i.animate({opacity:1}),c.remove())}function n(a){a.preventDefault();var i=t(a.currentTarget),d=parseInt(i.attr("data-id"),10);o(),t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",nonce:fvpdata.nonce,id:d},function(a){a.success&&(i.replaceWith(a.html),t(".wp-audio-shortcode, .wp-video-shortcode").mediaelementplayer(),e()),o()})}function p(a){a.preventDefault();var e=t(a.currentTarget),o=parseInt(e.attr("data-id"),10);e.openDOMWindow({eventType:null,windowPadding:0,borderSize:0,windowBGColor:"transparent",overlayOpacity:100*fvpdata.opacity,width:"100%",height:"100%"}),t("#DOMWindow").css({backgroundImage:s});var d=t("#fvp-cache-"+o);0===d.html().length?t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",nonce:fvpdata.nonce,id:o},function(a){a.success&&(d.html(a.html),t("#DOMWindow").html(a.html),i(),t(window).trigger("scroll"))}):(t("#DOMWindow").html(d.html()),t(window).trigger("scroll"))}var r,c=t("<div />").addClass("fvp-loader"),v="url('"+fvpdata.playicon+"')",s="url('"+fvpdata.loadicon+"')";t(document).ready(function(){a(),setTimeout(a,1e3),e(),i(),t(".fvp-overlay, .fvp-dynamic").hover(d,d),o(),t(".fvp-dynamic").click(n),t(".fvp-overlay").click(p)})}(jQuery);
js/html.js ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // *****************************************************************************
2
+ // TABBED OPTIONS
3
+ jQuery(document).ready(function($) {
4
+ /* global fvphtml */
5
+
6
+ // get tabs
7
+ var $tabs = $(fvphtml.prefix + '-tabs');
8
+
9
+ // initialize every instance's functionality
10
+ for ( var i = $tabs.length - 1; i >= 0; i-- ) {
11
+ var $tab = $( $tabs[i] );
12
+
13
+ // get titles and bodys
14
+ var $titles = $tab.children(fvphtml.prefix + '-tab-title');
15
+ var $bodys = $tab.children(fvphtml.prefix + '-tab-body');
16
+
17
+ // first title/body pair is active on initiation
18
+ $titles.first().addClass('active');
19
+ $bodys.first().addClass('active');
20
+
21
+ // pull titles to top
22
+ $tab.prepend( $titles );
23
+
24
+ // hide all but the initially active content
25
+ $bodys.filter(':not(.active)').hide();
26
+
27
+ // initialize title click event
28
+ $tab.children(fvphtml.prefix + '-tab-title').click(function() {
29
+ var $title = $(this);
30
+ var $body = $bodys.filter('[data-hook=\'' + $title.data('hook') + '\']');
31
+
32
+ // current active title is not clickable
33
+ if ($title.hasClass('active') && $body.hasClass('active')) {
34
+ return;
35
+ }
36
+
37
+ // no longer active
38
+ $titles.removeClass('active');
39
+ $bodys.removeClass('active').slideUp();
40
+
41
+ // newly active
42
+ $title.addClass('active');
43
+ $body.addClass('active').slideDown();
44
+ });
45
+ }
46
+ });
47
+
48
+
49
+
50
+
51
+ // *****************************************************************************
52
+ // CONDITIONALS
53
+ (function($) {
54
+ /* global fvphtml */
55
+
56
+ var triggers = {};
57
+ function conditionalTriggered() {
58
+ var $trigger = $(this);
59
+ var targets = triggers[ $trigger.attr('name') ];
60
+ for (var i = 0; i < targets.length; i++) {
61
+ var $target = $( targets[i] );
62
+
63
+ var targetNames = $target.data('names').split('|');
64
+ var targetValues = $target.data('values').split('|');
65
+
66
+ var index = $.inArray($trigger.attr('name'), targetNames);
67
+ if (-1 === index) {
68
+ continue;
69
+ }
70
+
71
+ var operator = true;
72
+ var desiredValue = targetValues[ index ];
73
+ var newValue = $trigger.attr('type') === 'checkbox' &&
74
+ ! $trigger.prop('checked') ? null : $trigger.val();
75
+
76
+ if (
77
+ typeof desiredValue === 'string' &&
78
+ desiredValue.charAt(0) === '!'
79
+ ) {
80
+ operator = false;
81
+ desiredValue = desiredValue.substr(1);
82
+ }
83
+
84
+ if (( operator && newValue !== desiredValue) ||
85
+ (! operator && newValue === desiredValue)) {
86
+ $target.addClass('hidden');
87
+ } else {
88
+ $target.removeClass('hidden');
89
+ }
90
+ }
91
+ }
92
+
93
+ $(document).ready(function() {
94
+ var $conditionals = $(fvphtml.prefix + '-conditional');
95
+ for (var i = 0; i < $conditionals.length; i++) {
96
+ var $target = $( $conditionals[i] );
97
+ var names = $target.data('names').split('|');
98
+ for (var j = 0; j < names.length; j++) {
99
+ var name = names[j];
100
+ if (! triggers.hasOwnProperty(name)) {
101
+ triggers[ name ] = [];
102
+ }
103
+ triggers[ name ].push($target);
104
+ }
105
+ }
106
+
107
+ for (var trigger in triggers) {
108
+ var $trigger = $('[name=\'' + trigger + '\']');
109
+ $trigger.change(conditionalTriggered);
110
+ }
111
+ });
112
+ })(jQuery);
113
+
114
+
115
+
116
+
117
+ // *****************************************************************************
118
+ // COLORPICKERS / IRIS
119
+ // See http://automattic.github.io/Iris/
120
+ (function($) {
121
+ var $colorpickers;
122
+
123
+
124
+ /**
125
+ * Returns either white (#ffffff) or black (#000000) depending on the
126
+ * contrast to the given background color.
127
+ *
128
+ * @param {string} color
129
+ * @return {string}
130
+ */
131
+ function getContrastColor(color) {
132
+ color = ! color ? '#fffff' : color;
133
+ color = ('#' === color.charAt(0)) ? color.substr(1) : color;
134
+
135
+ var r = parseInt(color.substr(0, 2), 16),
136
+ g = parseInt(color.substr(2, 2), 16),
137
+ b = parseInt(color.substr(4, 2), 16);
138
+
139
+ var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
140
+
141
+ return ( yiq >= 128 ) ? '#000' : '#fff';
142
+ }
143
+
144
+
145
+ /**
146
+ * Converts a 3 digit hex to a 6 digit hex including #.
147
+ * @param {string} hex
148
+ * @return {string}
149
+ */
150
+ function cleanHex(hex) {
151
+ if (hex.length === 3 && '#' !== hex.charAt(0)) {
152
+ hex = '#' + hex;
153
+ }
154
+
155
+ if (hex.length === 4 && '#' === hex.charAt(0)) {
156
+ hex = '#' + hex.charAt(1) + hex.charAt(1) +
157
+ hex.charAt(2) + hex.charAt(2) +
158
+ hex.charAt(3) + hex.charAt(3);
159
+ }
160
+
161
+ return 7 === hex.length ? hex : false;
162
+ }
163
+
164
+
165
+ /**
166
+ * Adjust colorpicker input background and foreground color depending
167
+ * on its value.
168
+ */
169
+ function colorpickerChange(event, ui) {
170
+ var $this = $(this);
171
+ var color = ui && ui.color ? ui.color.toString() : $this.val();
172
+ color = cleanHex(color);
173
+
174
+ $this.css({
175
+ backgroundColor: color ? color : '#ffffff',
176
+ color: getContrastColor(color)
177
+ });
178
+
179
+ if (! color) { $this.siblings(fvphtml.prefix + '-reset').hide(); }
180
+ else { $this.siblings(fvphtml.prefix + '-reset').show(); }
181
+ }
182
+
183
+
184
+ /**
185
+ * Hide all colorpickers upon opening a new one.
186
+ */
187
+ function colorpickerClick() {
188
+ var $this = $(this);
189
+ $colorpickers.not( $this ).iris('hide');
190
+ $this.iris('show');
191
+ }
192
+
193
+
194
+ /**
195
+ * Hide colorpicker reset button on blur.
196
+ */
197
+ function colorpickerBlur(event) {
198
+ if (event) { event.preventDefault(); }
199
+ var $this = $(this);
200
+ if ('' === $this.val()) {
201
+ $this.siblings(fvphtml.prefix + '-reset').hide();
202
+ }
203
+ }
204
+
205
+
206
+ /**
207
+ * Clear colorpicker input and hide colorpickers on reset click.
208
+ */
209
+ function colorpickerResetClick(event) {
210
+ if (event) { event.preventDefault(); }
211
+ $colorpickers.iris('hide');
212
+ $(this).siblings(fvphtml.prefix + '-colorpicker')
213
+ .val('')
214
+ .each(colorpickerChange);
215
+ }
216
+
217
+
218
+ // DOM is ready..
219
+ $(document).ready(function() {
220
+ // Get colorpickers.
221
+ $colorpickers = $(fvphtml.prefix + '-colorpicker');
222
+
223
+ // Change handlers.
224
+ $colorpickers.iris({ change: colorpickerChange });
225
+ $colorpickers.bind('input', colorpickerChange); // live change binding
226
+
227
+ // Click handler.
228
+ $colorpickers.click(colorpickerClick);
229
+
230
+ // Blur handler.
231
+ $colorpickers.blur(colorpickerBlur);
232
+
233
+ // Reset click handler.
234
+ $colorpickers.siblings(fvphtml.prefix + '-reset').click(colorpickerResetClick);
235
+
236
+ // Initial input coloring.
237
+ $colorpickers.each(colorpickerChange);
238
+ });
239
+ })(jQuery);
240
+
241
+
242
+
243
+
244
+ // *****************************************************************************
245
+ // TUTORIAL POINTERS
246
+ (function($) {
247
+ /* global fvphtml, ajaxurl */
248
+
249
+ /**
250
+ * Used when dissmissing a pointer to fire an AJAX request to save the
251
+ * closed state to the database.
252
+ */
253
+ function closePointer() {
254
+ var identifier = $(this).data('wpPointer').options.pointer_id;
255
+ $.post(ajaxurl, {
256
+ pointer: identifier,
257
+ action: 'dismiss-wp-pointer'
258
+ });
259
+ }
260
+
261
+
262
+ /**
263
+ * Initializes and opens a pointer given the required pointer data.
264
+ *
265
+ * @param {object} pointer
266
+ * {
267
+ * target: {string} jQuery selector,
268
+ * identifier: {string},
269
+ * title: {string},
270
+ * content: {string}
271
+ * position: {edge: {string}, align: {string}},
272
+ * }
273
+ */
274
+ function openPointer(pointer) {
275
+ var title = pointer.title || '';
276
+ var content = pointer.content || '';
277
+ var position = pointer.position || {edge: 'right', align: 'middle'};
278
+
279
+ $(pointer.target).pointer({
280
+ pointer_id: pointer.identifier,
281
+ content: '<h3>' + title + '</h3><p>' + content + '</p>',
282
+ position: position,
283
+ close: closePointer
284
+ }).pointer('open');
285
+ }
286
+
287
+
288
+ $(document).ready(function() {
289
+ var pointers = fvphtml.pointers || [];
290
+ for (var i = 0; i < pointers.length; i++) {
291
+ openPointer(fvphtml.pointers[i]);
292
+ }
293
+ });
294
+ })(jQuery);
295
+
296
+
297
+
298
+
299
+ // *****************************************************************************
300
+ // Contextual Help Links
301
+ jQuery(document).ready(function($) {
302
+ $(fvphtml.prefix + '-help-link, .help-link').click(function() {
303
+ $('#contextual-help-link').trigger('click');
304
+ });
305
+ });
js/html.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(t){for(var i=t(fvphtml.prefix+"-tabs"),e=i.length-1;e>=0;e--){var r=t(i[e]),n=r.children(fvphtml.prefix+"-tab-title"),a=r.children(fvphtml.prefix+"-tab-body");n.first().addClass("active"),a.first().addClass("active"),r.prepend(n),a.filter(":not(.active)").hide(),r.children(fvphtml.prefix+"-tab-title").click(function(){var i=t(this),e=a.filter("[data-hook='"+i.data("hook")+"']");i.hasClass("active")&&e.hasClass("active")||(n.removeClass("active"),a.removeClass("active").slideUp(),i.addClass("active"),e.addClass("active").slideDown())})}}),function(t){function i(){for(var i=t(this),r=e[i.attr("name")],n=0;n<r.length;n++){var a=t(r[n]),s=a.data("names").split("|"),o=a.data("values").split("|"),l=t.inArray(i.attr("name"),s);if(-1!==l){var c=!0,f=o[l],h="checkbox"!==i.attr("type")||i.prop("checked")?i.val():null;"string"==typeof f&&"!"===f.charAt(0)&&(c=!1,f=f.substr(1)),c&&h!==f||!c&&h===f?a.addClass("hidden"):a.removeClass("hidden")}}}var e={};t(document).ready(function(){for(var r=t(fvphtml.prefix+"-conditional"),n=0;n<r.length;n++)for(var a=t(r[n]),s=a.data("names").split("|"),o=0;o<s.length;o++){var l=s[o];e.hasOwnProperty(l)||(e[l]=[]),e[l].push(a)}for(var c in e){var f=t("[name='"+c+"']");f.change(i)}})}(jQuery),function(t){function i(t){t=t?t:"#fffff",t="#"===t.charAt(0)?t.substr(1):t;var i=parseInt(t.substr(0,2),16),e=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16),n=(299*i+587*e+114*r)/1e3;return n>=128?"#000":"#fff"}function e(t){return 3===t.length&&"#"!==t.charAt(0)&&(t="#"+t),4===t.length&&"#"===t.charAt(0)&&(t="#"+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)+t.charAt(3)+t.charAt(3)),7===t.length?t:!1}function r(r,n){var a=t(this),s=n&&n.color?n.color.toString():a.val();s=e(s),a.css({backgroundColor:s?s:"#ffffff",color:i(s)}),s?a.siblings(fvphtml.prefix+"-reset").show():a.siblings(fvphtml.prefix+"-reset").hide()}function n(){var i=t(this);o.not(i).iris("hide"),i.iris("show")}function a(i){i&&i.preventDefault();var e=t(this);""===e.val()&&e.siblings(fvphtml.prefix+"-reset").hide()}function s(i){i&&i.preventDefault(),o.iris("hide"),t(this).siblings(fvphtml.prefix+"-colorpicker").val("").each(r)}var o;t(document).ready(function(){o=t(fvphtml.prefix+"-colorpicker"),o.iris({change:r}),o.bind("input",r),o.click(n),o.blur(a),o.siblings(fvphtml.prefix+"-reset").click(s),o.each(r)})}(jQuery),function(t){function i(){var i=t(this).data("wpPointer").options.pointer_id;t.post(ajaxurl,{pointer:i,action:"dismiss-wp-pointer"})}function e(e){var r=e.title||"",n=e.content||"",a=e.position||{edge:"right",align:"middle"};t(e.target).pointer({pointer_id:e.identifier,content:"<h3>"+r+"</h3><p>"+n+"</p>",position:a,close:i}).pointer("open")}t(document).ready(function(){for(var t=fvphtml.pointers||[],i=0;i<t.length;i++)e(fvphtml.pointers[i])})}(jQuery),jQuery(document).ready(function(t){t(fvphtml.prefix+"-help-link, .help-link").click(function(){t("#contextual-help-link").trigger("click")})});
js/jquery.autosize.js CHANGED
@@ -1,184 +1,184 @@
1
- /*
2
- jQuery Autosize v1.16.5
3
- (c) 2013 Jack Moore - jacklmoore.com
4
- updated: 2013-02-11
5
- license: http://www.opensource.org/licenses/mit-license.php
6
- */
7
-
8
-
9
- (function ($) {
10
- var
11
- defaults = {
12
- className: 'autosizejs',
13
- append: '',
14
- callback: false
15
- },
16
- hidden = 'hidden',
17
- borderBox = 'border-box',
18
- lineHeight = 'lineHeight',
19
-
20
- // border:0 is unnecessary, but avoids a bug in FireFox on OSX (http://www.jacklmoore.com/autosize#comment-851)
21
- copy = '<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden;"/>',
22
-
23
- // line-height is conditionally included because IE7/IE8/old Opera do not return the correct value.
24
- copyStyle = [
25
- 'fontFamily',
26
- 'fontSize',
27
- 'fontWeight',
28
- 'fontStyle',
29
- 'letterSpacing',
30
- 'textTransform',
31
- 'wordSpacing',
32
- 'textIndent'
33
- ],
34
- oninput = 'oninput',
35
- onpropertychange = 'onpropertychange',
36
-
37
- // to keep track which textarea is being mirrored when adjust() is called.
38
- mirrored,
39
-
40
- // the mirror element, which is used to calculate what size the mirrored element should be.
41
- mirror = $(copy).data('autosize', true)[0];
42
-
43
- // test that line-height can be accurately copied.
44
- mirror.style.lineHeight = '99px';
45
- if ($(mirror).css(lineHeight) === '99px') {
46
- copyStyle.push(lineHeight);
47
- }
48
- mirror.style.lineHeight = '';
49
-
50
- $.fn.autosize = function (options) {
51
- options = $.extend({}, defaults, options || {});
52
-
53
- if (mirror.parentNode !== document.body) {
54
- $(document.body).append(mirror);
55
- }
56
-
57
- return this.each(function () {
58
- var
59
- ta = this,
60
- $ta = $(ta),
61
- minHeight,
62
- active,
63
- resize,
64
- boxOffset = 0,
65
- callback = $.isFunction(options.callback);
66
-
67
- if ($ta.data('autosize')) {
68
- // exit if autosize has already been applied, or if the textarea is the mirror element.
69
- return;
70
- }
71
-
72
- if ($ta.css('box-sizing') === borderBox || $ta.css('-moz-box-sizing') === borderBox || $ta.css('-webkit-box-sizing') === borderBox){
73
- boxOffset = $ta.outerHeight() - $ta.height();
74
- }
75
-
76
- minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset, $ta.height());
77
-
78
- resize = ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal';
79
-
80
- $ta.css({
81
- overflow: hidden,
82
- overflowY: hidden,
83
- wordWrap: 'break-word',
84
- resize: resize
85
- }).data('autosize', true);
86
-
87
- function initMirror() {
88
- mirrored = ta;
89
- mirror.className = options.className;
90
-
91
- // mirror is a duplicate textarea located off-screen that
92
- // is automatically updated to contain the same text as the
93
- // original textarea. mirror always has a height of 0.
94
- // This gives a cross-browser supported way getting the actual
95
- // height of the text, through the scrollTop property.
96
- $.each(copyStyle, function(i, val){
97
- mirror.style[val] = $ta.css(val);
98
- });
99
- }
100
-
101
- // Using mainly bare JS in this function because it is going
102
- // to fire very often while typing, and needs to very efficient.
103
- function adjust() {
104
- var height, overflow, original;
105
-
106
- if (mirrored !== ta) {
107
- initMirror();
108
- }
109
-
110
- // the active flag keeps IE from tripping all over itself. Otherwise
111
- // actions in the adjust function will cause IE to call adjust again.
112
- if (!active) {
113
- active = true;
114
- mirror.value = ta.value + options.append;
115
- mirror.style.overflowY = ta.style.overflowY;
116
- original = parseInt(ta.style.height,10);
117
-
118
- // Update the width in case the original textarea width has changed
119
- // A floor of 0 is needed because IE8 returns a negative value for hidden textareas, raising an error.
120
- mirror.style.width = Math.max($ta.width(), 0) + 'px';
121
-
122
- // The following three lines can be replaced with `height = mirror.scrollHeight` when dropping IE7 support.
123
- mirror.scrollTop = 0;
124
- mirror.scrollTop = 9e4;
125
- height = mirror.scrollTop;
126
-
127
- var maxHeight = parseInt($ta.css('maxHeight'), 10);
128
- // Opera returns '-1px' when max-height is set to 'none'.
129
- maxHeight = maxHeight && maxHeight > 0 ? maxHeight : 9e4;
130
- if (height > maxHeight) {
131
- height = maxHeight;
132
- overflow = 'scroll';
133
- } else if (height < minHeight) {
134
- height = minHeight;
135
- }
136
- height += boxOffset;
137
- ta.style.overflowY = overflow || hidden;
138
-
139
- if (original !== height) {
140
- ta.style.height = height + 'px';
141
- if (callback) {
142
- options.callback.call(ta);
143
- }
144
- }
145
-
146
- // This small timeout gives IE a chance to draw it's scrollbar
147
- // before adjust can be run again (prevents an infinite loop).
148
- setTimeout(function () {
149
- active = false;
150
- }, 1);
151
- }
152
- }
153
-
154
- if (onpropertychange in ta) {
155
- if (oninput in ta) {
156
- // Detects IE9. IE9 does not fire onpropertychange or oninput for deletions,
157
- // so binding to onkeyup to catch most of those occassions. There is no way that I
158
- // know of to detect something like 'cut' in IE9.
159
- ta[oninput] = ta.onkeyup = adjust;
160
- } else {
161
- // IE7 / IE8
162
- ta[onpropertychange] = adjust;
163
- }
164
- } else {
165
- // Modern Browsers
166
- ta[oninput] = adjust;
167
- }
168
-
169
- $(window).resize(function(){
170
- active = false;
171
- adjust();
172
- });
173
-
174
- // Allow for manual triggering if needed.
175
- $ta.bind('autosize', function(){
176
- active = false;
177
- adjust();
178
- });
179
-
180
- // Call adjust in case the textarea already contains text.
181
- adjust();
182
- });
183
- };
184
- }(window.jQuery || window.Zepto));
1
+ /*
2
+ jQuery Autosize v1.16.5
3
+ (c) 2013 Jack Moore - jacklmoore.com
4
+ updated: 2013-02-11
5
+ license: http://www.opensource.org/licenses/mit-license.php
6
+ */
7
+
8
+
9
+ (function ($) {
10
+ var
11
+ defaults = {
12
+ className: 'autosizejs',
13
+ append: '',
14
+ callback: false
15
+ },
16
+ hidden = 'hidden',
17
+ borderBox = 'border-box',
18
+ lineHeight = 'lineHeight',
19
+
20
+ // border:0 is unnecessary, but avoids a bug in FireFox on OSX (http://www.jacklmoore.com/autosize#comment-851)
21
+ copy = '<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden;"/>',
22
+
23
+ // line-height is conditionally included because IE7/IE8/old Opera do not return the correct value.
24
+ copyStyle = [
25
+ 'fontFamily',
26
+ 'fontSize',
27
+ 'fontWeight',
28
+ 'fontStyle',
29
+ 'letterSpacing',
30
+ 'textTransform',
31
+ 'wordSpacing',
32
+ 'textIndent'
33
+ ],
34
+ oninput = 'oninput',
35
+ onpropertychange = 'onpropertychange',
36
+
37
+ // to keep track which textarea is being mirrored when adjust() is called.
38
+ mirrored,
39
+
40
+ // the mirror element, which is used to calculate what size the mirrored element should be.
41
+ mirror = $(copy).data('autosize', true)[0];
42
+
43
+ // test that line-height can be accurately copied.
44
+ mirror.style.lineHeight = '99px';
45
+ if ($(mirror).css(lineHeight) === '99px') {
46
+ copyStyle.push(lineHeight);
47
+ }
48
+ mirror.style.lineHeight = '';
49
+
50
+ $.fn.autosize = function (options) {
51
+ options = $.extend({}, defaults, options || {});
52
+
53
+ if (mirror.parentNode !== document.body) {
54
+ $(document.body).append(mirror);
55
+ }
56
+
57
+ return this.each(function () {
58
+ var
59
+ ta = this,
60
+ $ta = $(ta),
61
+ minHeight,
62
+ active,
63
+ resize,
64
+ boxOffset = 0,
65
+ callback = $.isFunction(options.callback);
66
+
67
+ if ($ta.data('autosize')) {
68
+ // exit if autosize has already been applied, or if the textarea is the mirror element.
69
+ return;
70
+ }
71
+
72
+ if ($ta.css('box-sizing') === borderBox || $ta.css('-moz-box-sizing') === borderBox || $ta.css('-webkit-box-sizing') === borderBox){
73
+ boxOffset = $ta.outerHeight() - $ta.height();
74
+ }
75
+
76
+ minHeight = Math.max(parseInt($ta.css('minHeight'), 10) - boxOffset, $ta.height());
77
+
78
+ resize = ($ta.css('resize') === 'none' || $ta.css('resize') === 'vertical') ? 'none' : 'horizontal';
79
+
80
+ $ta.css({
81
+ overflow: hidden,
82
+ overflowY: hidden,
83
+ wordWrap: 'break-word',
84
+ resize: resize
85
+ }).data('autosize', true);
86
+
87
+ function initMirror() {
88
+ mirrored = ta;
89
+ mirror.className = options.className;
90
+
91
+ // mirror is a duplicate textarea located off-screen that
92
+ // is automatically updated to contain the same text as the
93
+ // original textarea. mirror always has a height of 0.
94
+ // This gives a cross-browser supported way getting the actual
95
+ // height of the text, through the scrollTop property.
96
+ $.each(copyStyle, function(i, val){
97
+ mirror.style[val] = $ta.css(val);
98
+ });
99
+ }
100
+
101
+ // Using mainly bare JS in this function because it is going
102
+ // to fire very often while typing, and needs to very efficient.
103
+ function adjust() {
104
+ var height, overflow, original;
105
+
106
+ if (mirrored !== ta) {
107
+ initMirror();
108
+ }
109
+
110
+ // the active flag keeps IE from tripping all over itself. Otherwise
111
+ // actions in the adjust function will cause IE to call adjust again.
112
+ if (!active) {
113
+ active = true;
114
+ mirror.value = ta.value + options.append;
115
+ mirror.style.overflowY = ta.style.overflowY;
116
+ original = parseInt(ta.style.height,10);
117
+
118
+ // Update the width in case the original textarea width has changed
119
+ // A floor of 0 is needed because IE8 returns a negative value for hidden textareas, raising an error.
120
+ mirror.style.width = Math.max($ta.width(), 0) + 'px';
121
+
122
+ // The following three lines can be replaced with `height = mirror.scrollHeight` when dropping IE7 support.
123
+ mirror.scrollTop = 0;
124
+ mirror.scrollTop = 9e4;
125
+ height = mirror.scrollTop;
126
+
127
+ var maxHeight = parseInt($ta.css('maxHeight'), 10);
128
+ // Opera returns '-1px' when max-height is set to 'none'.
129
+ maxHeight = maxHeight && maxHeight > 0 ? maxHeight : 9e4;
130
+ if (height > maxHeight) {
131
+ height = maxHeight;
132
+ overflow = 'scroll';
133
+ } else if (height < minHeight) {
134
+ height = minHeight;
135
+ }
136
+ height += boxOffset;
137
+ ta.style.overflowY = overflow || hidden;
138
+
139
+ if (original !== height) {
140
+ ta.style.height = height + 'px';
141
+ if (callback) {
142
+ options.callback.call(ta);
143
+ }
144
+ }
145
+
146
+ // This small timeout gives IE a chance to draw it's scrollbar
147
+ // before adjust can be run again (prevents an infinite loop).
148
+ setTimeout(function () {
149
+ active = false;
150
+ }, 1);
151
+ }
152
+ }
153
+
154
+ if (onpropertychange in ta) {
155
+ if (oninput in ta) {
156
+ // Detects IE9. IE9 does not fire onpropertychange or oninput for deletions,
157
+ // so binding to onkeyup to catch most of those occassions. There is no way that I
158
+ // know of to detect something like 'cut' in IE9.
159
+ ta[oninput] = ta.onkeyup = adjust;
160
+ } else {
161
+ // IE7 / IE8
162
+ ta[onpropertychange] = adjust;
163
+ }
164
+ } else {
165
+ // Modern Browsers
166
+ ta[oninput] = adjust;
167
+ }
168
+
169
+ $(window).resize(function(){
170
+ active = false;
171
+ adjust();
172
+ });
173
+
174
+ // Allow for manual triggering if needed.
175
+ $ta.bind('autosize', function(){
176
+ active = false;
177
+ adjust();
178
+ });
179
+
180
+ // Call adjust in case the textarea already contains text.
181
+ adjust();
182
+ });
183
+ };
184
+ }(window.jQuery || window.Zepto));
js/jquery.autosize.min.js CHANGED
@@ -1,7 +1 @@
1
- /*
2
- jQuery Autosize v1.16.5
3
- (c) 2013 Jack Moore - jacklmoore.com
4
- updated: 2013-02-11
5
- license: http://www.opensource.org/licenses/mit-license.php
6
- */
7
- (function(e){var t,o={className:"autosizejs",append:"",callback:!1},i="hidden",n="border-box",s="lineHeight",a='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden;"/>',r=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],l="oninput",c="onpropertychange",h=e(a).data("autosize",!0)[0];h.style.lineHeight="99px","99px"===e(h).css(s)&&r.push(s),h.style.lineHeight="",e.fn.autosize=function(s){return s=e.extend({},o,s||{}),h.parentNode!==document.body&&e(document.body).append(h),this.each(function(){function o(){t=b,h.className=s.className,e.each(r,function(e,t){h.style[t]=f.css(t)})}function a(){var e,n,a;if(t!==b&&o(),!d){d=!0,h.value=b.value+s.append,h.style.overflowY=b.style.overflowY,a=parseInt(b.style.height,10),h.style.width=Math.max(f.width(),0)+"px",h.scrollTop=0,h.scrollTop=9e4,e=h.scrollTop;var r=parseInt(f.css("maxHeight"),10);r=r&&r>0?r:9e4,e>r?(e=r,n="scroll"):p>e&&(e=p),e+=g,b.style.overflowY=n||i,a!==e&&(b.style.height=e+"px",x&&s.callback.call(b)),setTimeout(function(){d=!1},1)}}var p,d,u,b=this,f=e(b),g=0,x=e.isFunction(s.callback);f.data("autosize")||((f.css("box-sizing")===n||f.css("-moz-box-sizing")===n||f.css("-webkit-box-sizing")===n)&&(g=f.outerHeight()-f.height()),p=Math.max(parseInt(f.css("minHeight"),10)-g,f.height()),u="none"===f.css("resize")||"vertical"===f.css("resize")?"none":"horizontal",f.css({overflow:i,overflowY:i,wordWrap:"break-word",resize:u}).data("autosize",!0),c in b?l in b?b[l]=b.onkeyup=a:b[c]=a:b[l]=a,e(window).resize(function(){d=!1,a()}),f.bind("autosize",function(){d=!1,a()}),a())})}})(window.jQuery||window.Zepto);
1
+ !function(e){var t,o={className:"autosizejs",append:"",callback:!1},i="hidden",n="border-box",s="lineHeight",a='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden;"/>',r=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],l="oninput",c="onpropertychange",h=e(a).data("autosize",!0)[0];h.style.lineHeight="99px","99px"===e(h).css(s)&&r.push(s),h.style.lineHeight="",e.fn.autosize=function(s){return s=e.extend({},o,s||{}),h.parentNode!==document.body&&e(document.body).append(h),this.each(function(){function o(){t=b,h.className=s.className,e.each(r,function(e,t){h.style[t]=f.css(t)})}function a(){var e,n,a;if(t!==b&&o(),!d){d=!0,h.value=b.value+s.append,h.style.overflowY=b.style.overflowY,a=parseInt(b.style.height,10),h.style.width=Math.max(f.width(),0)+"px",h.scrollTop=0,h.scrollTop=9e4,e=h.scrollTop;var r=parseInt(f.css("maxHeight"),10);r=r&&r>0?r:9e4,e>r?(e=r,n="scroll"):p>e&&(e=p),e+=g,b.style.overflowY=n||i,a!==e&&(b.style.height=e+"px",x&&s.callback.call(b)),setTimeout(function(){d=!1},1)}}var p,d,u,b=this,f=e(b),g=0,x=e.isFunction(s.callback);f.data("autosize")||((f.css("box-sizing")===n||f.css("-moz-box-sizing")===n||f.css("-webkit-box-sizing")===n)&&(g=f.outerHeight()-f.height()),p=Math.max(parseInt(f.css("minHeight"),10)-g,f.height()),u="none"===f.css("resize")||"vertical"===f.css("resize")?"none":"horizontal",f.css({overflow:i,overflowY:i,wordWrap:"break-word",resize:u}).data("autosize",!0),c in b?l in b?b[l]=b.onkeyup=a:b[c]=a:b[l]=a,e(window).resize(function(){d=!1,a()}),f.bind("autosize",function(){d=!1,a()}),a())})}}(window.jQuery||window.Zepto);
 
 
 
 
 
 
js/jquery.domwindow.js CHANGED
@@ -1,369 +1,369 @@
1
- (function($){
2
-
3
- //closeDOMWindow
4
- $.fn.closeDOMWindow = function(settings){
5
-
6
- if(!settings){settings={};}
7
-
8
- var run = function(passingThis){
9
-
10
- if(settings.anchoredClassName){
11
- var $anchorClassName = $('.'+settings.anchoredClassName);
12
- $anchorClassName.fadeOut('fast',function(){
13
- if($.fn.draggable){
14
- $anchorClassName.draggable('destory').trigger("unload").remove();
15
- }else{
16
- $anchorClassName.trigger("unload").remove();
17
- }
18
- });
19
- if(settings.functionCallOnClose){settings.functionCallAfterClose();}
20
- }else{
21
- var $DOMWindowOverlay = $('#DOMWindowOverlay');
22
- var $DOMWindow = $('#DOMWindow');
23
- $DOMWindowOverlay.fadeOut('fast',function(){
24
- $DOMWindowOverlay.trigger('unload').unbind().remove();
25
- });
26
- $DOMWindow.fadeOut('fast',function(){
27
- if($.fn.draggable){
28
- $DOMWindow.draggable("destroy").trigger("unload").remove();
29
- }else{
30
- $DOMWindow.trigger("unload").remove();
31
- }
32
- });
33
-
34
- $(window).unbind('scroll.DOMWindow');
35
- $(window).unbind('resize.DOMWindow');
36
-
37
- if($.fn.openDOMWindow.isIE6){$('#DOMWindowIE6FixIframe').remove();}
38
- if(settings.functionCallOnClose){settings.functionCallAfterClose();}
39
- }
40
- };
41
-
42
- if(settings.eventType){//if used with $().
43
- return this.each(function(index){
44
- $(this).bind(settings.eventType, function(){
45
- run(this);
46
- return false;
47
- });
48
- });
49
- }else{//else called as $.function
50
- run();
51
- }
52
-
53
- };
54
-
55
- //allow for public call, pass settings
56
- $.closeDOMWindow = function(s){$.fn.closeDOMWindow(s);};
57
-
58
- //openDOMWindow
59
- $.fn.openDOMWindow = function(instanceSettings){
60
-
61
- var shortcut = $.fn.openDOMWindow;
62
-
63
- //default settings combined with callerSettings////////////////////////////////////////////////////////////////////////
64
-
65
- shortcut.defaultsSettings = {
66
- anchoredClassName:'',
67
- anchoredSelector:'',
68
- borderColor:'#ccc',
69
- borderSize:'4',
70
- draggable:0,
71
- eventType:null, //click, blur, change, dblclick, error, focus, load, mousedown, mouseout, mouseup etc...
72
- fixedWindowY:100,
73
- functionCallOnOpen:null,
74
- functionCallOnClose:null,
75
- height:500,
76
- loader:0,
77
- loaderHeight:0,
78
- loaderImagePath:'',
79
- loaderWidth:0,
80
- modal:0,
81
- overlay:1,
82
- overlayColor:'#000',
83
- overlayOpacity:'85',
84
- positionLeft:0,
85
- positionTop:0,
86
- positionType:'centered', // centered, anchored, absolute, fixed
87
- width:500,
88
- windowBGColor:'#fff',
89
- windowBGImage:null, // http path
90
- windowHTTPType:'get',
91
- windowPadding:10,
92
- windowSource:'inline', //inline, ajax, iframe
93
- windowSourceID:'',
94
- windowSourceURL:'',
95
- windowSourceAttrURL:'href'
96
- };
97
-
98
- var settings = $.extend({}, $.fn.openDOMWindow.defaultsSettings , instanceSettings || {});
99
-
100
- //Public functions
101
-
102
- shortcut.viewPortHeight = function(){ return self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;};
103
- shortcut.viewPortWidth = function(){ return self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;};
104
- shortcut.scrollOffsetHeight = function(){ return self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;};
105
- shortcut.scrollOffsetWidth = function(){ return self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft;};
106
- shortcut.isIE6 = typeof document.body.style.maxHeight === "undefined";
107
-
108
- //Private Functions/////////////////////////////////////////////////////////////////////////////////////////////////////////
109
-
110
- var sizeOverlay = function(){
111
- var $DOMWindowOverlay = $('#DOMWindowOverlay');
112
- if(shortcut.isIE6){//if IE 6
113
- var overlayViewportHeight = document.documentElement.offsetHeight + document.documentElement.scrollTop - 4;
114
- var overlayViewportWidth = document.documentElement.offsetWidth - 21;
115
- $DOMWindowOverlay.css({'height':overlayViewportHeight +'px','width':overlayViewportWidth+'px'});
116
- }else{//else Firefox, safari, opera, IE 7+
117
- $DOMWindowOverlay.css({'height':'100%','width':'100%','position':'fixed'});
118
- }
119
- };
120
-
121
- var sizeIE6Iframe = function(){
122
- var overlayViewportHeight = document.documentElement.offsetHeight + document.documentElement.scrollTop - 4;
123
- var overlayViewportWidth = document.documentElement.offsetWidth - 21;
124
- $('#DOMWindowIE6FixIframe').css({'height':overlayViewportHeight +'px','width':overlayViewportWidth+'px'});
125
- };
126
-
127
- var centerDOMWindow = function() {
128
- var $DOMWindow = $('#DOMWindow');
129
- if(settings.height + 50 > shortcut.viewPortHeight()){//added 50 to be safe
130
- $DOMWindow.css('left',Math.round(shortcut.viewPortWidth()/2) + shortcut.scrollOffsetWidth() - Math.round(($DOMWindow.outerWidth())/2));
131
- }else{
132
- $DOMWindow.css('left',Math.round(shortcut.viewPortWidth()/2) + shortcut.scrollOffsetWidth() - Math.round(($DOMWindow.outerWidth())/2));
133
- $DOMWindow.css('top',Math.round(shortcut.viewPortHeight()/2) + shortcut.scrollOffsetHeight() - Math.round(($DOMWindow.outerHeight())/2));
134
- }
135
- };
136
-
137
- var centerLoader = function() {
138
- var $DOMWindowLoader = $('#DOMWindowLoader');
139
- if(shortcut.isIE6){//if IE 6
140
- $DOMWindowLoader.css({'left':Math.round(shortcut.viewPortWidth()/2) + shortcut.scrollOffsetWidth() - Math.round(($DOMWindowLoader.innerWidth())/2),'position':'absolute'});
141
- $DOMWindowLoader.css({'top':Math.round(shortcut.viewPortHeight()/2) + shortcut.scrollOffsetHeight() - Math.round(($DOMWindowLoader.innerHeight())/2),'position':'absolute'});
142
- }else{
143
- $DOMWindowLoader.css({'left':'50%','top':'50%','position':'fixed'});
144
- }
145
-
146
- };
147
-
148
- var fixedDOMWindow = function(){
149
- var $DOMWindow = $('#DOMWindow');
150
- $DOMWindow.css('left', settings.positionLeft + shortcut.scrollOffsetWidth());
151
- $DOMWindow.css('top', + settings.positionTop + shortcut.scrollOffsetHeight());
152
- };
153
-
154
- var showDOMWindow = function(instance){
155
- if(arguments[0]){
156
- $('.'+instance+' #DOMWindowLoader').remove();
157
- $('.'+instance+' #DOMWindowContent').fadeIn('fast',function(){if(settings.functionCallOnOpen){settings.functionCallOnOpen();}});
158
- $('.'+instance+ '.closeDOMWindow').click(function(){
159
- $.closeDOMWindow();
160
- return false;
161
- });
162
- }else{
163
- $('#DOMWindowLoader').remove();
164
- $('#DOMWindow').fadeIn('fast',function(){if(settings.functionCallOnOpen){settings.functionCallOnOpen();}});
165
- $('#DOMWindow .closeDOMWindow').click(function(){
166
- $.closeDOMWindow();
167
- return false;
168
- });
169
- }
170
-
171
- };
172
-
173
- var urlQueryToObject = function(s){
174
- var query = {};
175
- s.replace(/b([^&=]*)=([^&=]*)b/g, function (m, a, d) {
176
- if (typeof query[a] != 'undefined') {
177
- query[a] += ',' + d;
178
- } else {
179
- query[a] = d;
180
- }
181
- });
182
- return query;
183
- };
184
-
185
- //Run Routine ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
186
- var run = function(passingThis){
187
-
188
- //get values from element clicked, or assume its passed as an option
189
- settings.windowSourceID = $(passingThis).attr('href') || settings.windowSourceID;
190
- settings.windowSourceURL = $(passingThis).attr(settings.windowSourceAttrURL) || settings.windowSourceURL;
191
- settings.windowBGImage = settings.windowBGImage ? 'background-image:url('+settings.windowBGImage+')' : '';
192
- var urlOnly, urlQueryObject;
193
-
194
- if(settings.positionType == 'anchored'){//anchored DOM window
195
-
196
- var anchoredPositions = $(settings.anchoredSelector).position();
197
- var anchoredPositionX = anchoredPositions.left + settings.positionLeft;
198
- var anchoredPositionY = anchoredPositions.top + settings.positionTop;
199
-
200
- $('body').append('<div class="'+settings.anchoredClassName+'" style="'+settings.windowBGImage+';background-repeat:no-repeat;padding:'+settings.windowPadding+'px;overflow:auto;position:absolute;top:'+anchoredPositionY+'px;left:'+anchoredPositionX+'px;height:'+settings.height+'px;width:'+settings.width+'px;background-color:'+settings.windowBGColor+';border:'+settings.borderSize+'px solid '+settings.borderColor+';z-index:10001"><div id="DOMWindowContent" style="display:none"></div></div>');
201
- //loader
202
- if(settings.loader && settings.loaderImagePath !== ''){
203
- $('.'+settings.anchoredClassName).append('<div id="DOMWindowLoader" style="width:'+settings.loaderWidth+'px;height:'+settings.loaderHeight+'px;"><img src="'+settings.loaderImagePath+'" /></div>');
204
-
205
- }
206
-
207
- if($.fn.draggable){
208
- if(settings.draggable){$('.' + settings.anchoredClassName).draggable({cursor:'move'});}
209
- }
210
-
211
- switch(settings.windowSource){
212
- case 'inline'://////////////////////////////// inline //////////////////////////////////////////
213
- $('.' + settings.anchoredClassName+" #DOMWindowContent").append($(settings.windowSourceID).children());
214
- $('.' + settings.anchoredClassName).unload(function(){// move elements back when you're finished
215
- $('.' + settings.windowSourceID).append( $('.' + settings.anchoredClassName+" #DOMWindowContent").children());
216
- });
217
- showDOMWindow(settings.anchoredClassName);
218
- break;
219
- case 'iframe'://////////////////////////////// iframe //////////////////////////////////////////
220
- $('.' + settings.anchoredClassName+" #DOMWindowContent").append('<iframe frameborder="0" hspace="0" wspace="0" src="'+settings.windowSourceURL+'" name="DOMWindowIframe'+Math.round(Math.random()*1000)+'" style="width:100%;height:100%;border:none;background-color:#fff;" class="'+settings.anchoredClassName+'Iframe" ></iframe>');
221
- $('.'+settings.anchoredClassName+'Iframe').load(showDOMWindow(settings.anchoredClassName));
222
- break;
223
- case 'ajax'://////////////////////////////// ajax //////////////////////////////////////////
224
- if(settings.windowHTTPType == 'post'){
225
-
226
- if(settings.windowSourceURL.indexOf("?") !== -1){//has a query string
227
- urlOnly = settings.windowSourceURL.substr(0, settings.windowSourceURL.indexOf("?"));
228
- urlQueryObject = urlQueryToObject(settings.windowSourceURL);
229
- }else{
230
- urlOnly = settings.windowSourceURL;
231
- urlQueryObject = {};
232
- }
233
- $('.' + settings.anchoredClassName+" #DOMWindowContent").load(urlOnly,urlQueryObject,function(){
234
- showDOMWindow(settings.anchoredClassName);
235
- });
236
- }else{
237
- if(settings.windowSourceURL.indexOf("?") == -1){ //no query string, so add one
238
- settings.windowSourceURL += '?';
239
- }
240
- $('.' + settings.anchoredClassName+" #DOMWindowContent").load(
241
- settings.windowSourceURL + '&random=' + (new Date().getTime()),function(){
242
- showDOMWindow(settings.anchoredClassName);
243
- });
244
- }
245
- break;
246
- }
247
-
248
- }else{//centered, fixed, absolute DOM window
249
-
250
- //overlay & modal
251
- if(settings.overlay){
252
- $('body').append('<div id="DOMWindowOverlay" style="z-index:10000;display:none;position:absolute;top:0;left:0;background-color:'+settings.overlayColor+';filter:alpha(opacity='+settings.overlayOpacity+');-moz-opacity: 0.'+settings.overlayOpacity+';opacity: 0.'+settings.overlayOpacity+';"></div>');
253
- if(shortcut.isIE6){//if IE 6
254
- $('body').append('<iframe id="DOMWindowIE6FixIframe" src="blank.html" style="width:100%;height:100%;z-index:9999;position:absolute;top:0;left:0;filter:alpha(opacity=0);"></iframe>');
255
- sizeIE6Iframe();
256
- }
257
- sizeOverlay();
258
- var $DOMWindowOverlay = $('#DOMWindowOverlay');
259
- $DOMWindowOverlay.fadeIn('fast');
260
- if(!settings.modal){$DOMWindowOverlay.click(function(){$.closeDOMWindow();});}
261
- }
262
-
263
- //loader
264
- if(settings.loader && settings.loaderImagePath !== ''){
265
- $('body').append('<div id="DOMWindowLoader" style="z-index:10002;width:'+settings.loaderWidth+'px;height:'+settings.loaderHeight+'px;"><img src="'+settings.loaderImagePath+'" /></div>');
266
- centerLoader();
267
- }
268
-
269
- //add DOMwindow
270
- $('body').append('<div id="DOMWindow" style="background-repeat:no-repeat;'+settings.windowBGImage+';overflow:auto;padding:'+settings.windowPadding+'px;display:none;height:'+settings.height+'px;width:'+settings.width+'px;background-color:'+settings.windowBGColor+';border:'+settings.borderSize+'px solid '+settings.borderColor+'; position:absolute;z-index:10001"></div>');
271
-
272
- var $DOMWindow = $('#DOMWindow');
273
- //centered, absolute, or fixed
274
- switch(settings.positionType){
275
- case 'centered':
276
- centerDOMWindow();
277
- if(settings.height + 50 > shortcut.viewPortHeight()){//added 50 to be safe
278
- $DOMWindow.css('top', (settings.fixedWindowY + shortcut.scrollOffsetHeight()) + 'px');
279
- }
280
- break;
281
- case 'absolute':
282
- $DOMWindow.css({'top':(settings.positionTop+shortcut.scrollOffsetHeight())+'px','left':(settings.positionLeft+shortcut.scrollOffsetWidth())+'px'});
283
- if($.fn.draggable){
284
- if(settings.draggable){$DOMWindow.draggable({cursor:'move'});}
285
- }
286
- break;
287
- case 'fixed':
288
- fixedDOMWindow();
289
- break;
290
- case 'anchoredSingleWindow':
291
- var anchoredPositions = $(settings.anchoredSelector).position();
292
- var anchoredPositionX = anchoredPositions.left + settings.positionLeft;
293
- var anchoredPositionY = anchoredPositions.top + settings.positionTop;
294
- $DOMWindow.css({'top':anchoredPositionY + 'px','left':anchoredPositionX+'px'});
295
-
296
- break;
297
- }
298
-
299
- $(window).bind('scroll.DOMWindow',function(){
300
- if(settings.overlay){sizeOverlay();}
301
- if(shortcut.isIE6){sizeIE6Iframe();}
302
- if(settings.positionType == 'centered'){centerDOMWindow();}
303
- if(settings.positionType == 'fixed'){fixedDOMWindow();}
304
- });
305
-
306
- $(window).bind('resize.DOMWindow',function(){
307
- if(shortcut.isIE6){sizeIE6Iframe();}
308
- if(settings.overlay){sizeOverlay();}
309
- if(settings.positionType == 'centered'){centerDOMWindow();}
310
- });
311
-
312
- switch(settings.windowSource){
313
- case 'inline'://////////////////////////////// inline //////////////////////////////////////////
314
- $DOMWindow.append($(settings.windowSourceID).children());
315
- $DOMWindow.unload(function(){// move elements back when you're finished
316
- $(settings.windowSourceID).append($DOMWindow.children());
317
- });
318
- showDOMWindow();
319
- break;
320
- case 'iframe'://////////////////////////////// iframe //////////////////////////////////////////
321
- $DOMWindow.append('<iframe frameborder="0" hspace="0" wspace="0" src="'+settings.windowSourceURL+'" name="DOMWindowIframe'+Math.round(Math.random()*1000)+'" style="width:100%;height:100%;border:none;background-color:#fff;" id="DOMWindowIframe" ></iframe>');
322
- $('#DOMWindowIframe').load(showDOMWindow());
323
- break;
324
- case 'ajax'://////////////////////////////// ajax //////////////////////////////////////////
325
- if(settings.windowHTTPType == 'post'){
326
-
327
- if(settings.windowSourceURL.indexOf("?") !== -1){//has a query string
328
- urlOnly = settings.windowSourceURL.substr(0, settings.windowSourceURL.indexOf("?"));
329
- urlQueryObject = urlQueryToObject(settings.windowSourceURL);
330
- }else{
331
- urlOnly = settings.windowSourceURL;
332
- urlQueryObject = {};
333
- }
334
- $DOMWindow.load(urlOnly,urlQueryObject,function(){
335
- showDOMWindow();
336
- });
337
- }else{
338
- if(settings.windowSourceURL.indexOf("?") == -1){ //no query string, so add one
339
- settings.windowSourceURL += '?';
340
- }
341
- $DOMWindow.load(
342
- settings.windowSourceURL + '&random=' + (new Date().getTime()),function(){
343
- showDOMWindow();
344
- });
345
- }
346
- break;
347
- }
348
-
349
- }//end if anchored, or absolute, fixed, centered
350
-
351
- };//end run()
352
-
353
- if(settings.eventType){//if used with $().
354
- return this.each(function(index){
355
- $(this).bind(settings.eventType,function(){
356
- run(this);
357
- return false;
358
- });
359
- });
360
- }else{//else called as $.function
361
- run();
362
- }
363
-
364
- };//end function openDOMWindow
365
-
366
- //allow for public call, pass settings
367
- $.openDOMWindow = function(s){$.fn.openDOMWindow(s);};
368
-
369
- })(jQuery);
1
+ (function($){
2
+
3
+ //closeDOMWindow
4
+ $.fn.closeDOMWindow = function(settings){
5
+
6
+ if(!settings){settings={};}
7
+
8
+ var run = function(passingThis){
9
+
10
+ if(settings.anchoredClassName){
11
+ var $anchorClassName = $('.'+settings.anchoredClassName);
12
+ $anchorClassName.fadeOut('fast',function(){
13
+ if($.fn.draggable){
14
+ $anchorClassName.draggable('destory').trigger("unload").remove();
15
+ }else{
16
+ $anchorClassName.trigger("unload").remove();
17
+ }
18
+ });
19
+ if(settings.functionCallOnClose){settings.functionCallAfterClose();}
20
+ }else{
21
+ var $DOMWindowOverlay = $('#DOMWindowOverlay');
22
+ var $DOMWindow = $('#DOMWindow');
23
+ $DOMWindowOverlay.fadeOut('fast',function(){
24
+ $DOMWindowOverlay.trigger('unload').unbind().remove();
25
+ });
26
+ $DOMWindow.fadeOut('fast',function(){
27
+ if($.fn.draggable){
28
+ $DOMWindow.draggable("destroy").trigger("unload").remove();
29
+ }else{
30
+ $DOMWindow.trigger("unload").remove();
31
+ }
32
+ });
33
+
34
+ $(window).unbind('scroll.DOMWindow');
35
+ $(window).unbind('resize.DOMWindow');
36
+
37
+ if($.fn.openDOMWindow.isIE6){$('#DOMWindowIE6FixIframe').remove();}
38
+ if(settings.functionCallOnClose){settings.functionCallAfterClose();}
39
+ }
40
+ };
41
+
42
+ if(settings.eventType){//if used with $().
43
+ return this.each(function(index){
44
+ $(this).bind(settings.eventType, function(){
45
+ run(this);
46
+ return false;
47
+ });
48
+ });
49
+ }else{//else called as $.function
50
+ run();
51
+ }
52
+
53
+ };
54
+
55
+ //allow for public call, pass settings
56
+ $.closeDOMWindow = function(s){$.fn.closeDOMWindow(s);};
57
+
58
+ //openDOMWindow
59
+ $.fn.openDOMWindow = function(instanceSettings){
60
+
61
+ var shortcut = $.fn.openDOMWindow;
62
+
63
+ //default settings combined with callerSettings////////////////////////////////////////////////////////////////////////
64
+
65
+ shortcut.defaultsSettings = {
66
+ anchoredClassName:'',
67
+ anchoredSelector:'',
68
+ borderColor:'#ccc',
69
+ borderSize:'4',
70
+ draggable:0,
71
+ eventType:null, //click, blur, change, dblclick, error, focus, load, mousedown, mouseout, mouseup etc...
72
+ fixedWindowY:100,
73
+ functionCallOnOpen:null,
74
+ functionCallOnClose:null,
75
+ height:500,
76
+ loader:0,
77
+ loaderHeight:0,
78
+ loaderImagePath:'',
79
+ loaderWidth:0,
80
+ modal:0,
81
+ overlay:1,
82
+ overlayColor:'#000',
83
+ overlayOpacity:'85',
84
+ positionLeft:0,
85
+ positionTop:0,
86
+ positionType:'centered', // centered, anchored, absolute, fixed
87
+ width:500,
88
+ windowBGColor:'#fff',
89
+ windowBGImage:null, // http path
90
+ windowHTTPType:'get',
91
+ windowPadding:10,
92
+ windowSource:'inline', //inline, ajax, iframe
93
+ windowSourceID:'',
94
+ windowSourceURL:'',
95
+ windowSourceAttrURL:'href'
96
+ };
97
+
98
+ var settings = $.extend({}, $.fn.openDOMWindow.defaultsSettings , instanceSettings || {});
99
+
100
+ //Public functions
101
+
102
+ shortcut.viewPortHeight = function(){ return self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;};
103
+ shortcut.viewPortWidth = function(){ return self.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;};
104
+ shortcut.scrollOffsetHeight = function(){ return self.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;};
105
+ shortcut.scrollOffsetWidth = function(){ return self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft;};
106
+ shortcut.isIE6 = typeof document.body.style.maxHeight === "undefined";
107
+
108
+ //Private Functions/////////////////////////////////////////////////////////////////////////////////////////////////////////
109
+
110
+ var sizeOverlay = function(){
111
+ var $DOMWindowOverlay = $('#DOMWindowOverlay');
112
+ if(shortcut.isIE6){//if IE 6
113
+ var overlayViewportHeight = document.documentElement.offsetHeight + document.documentElement.scrollTop - 4;
114
+ var overlayViewportWidth = document.documentElement.offsetWidth - 21;
115
+ $DOMWindowOverlay.css({'height':overlayViewportHeight +'px','width':overlayViewportWidth+'px'});
116
+ }else{//else Firefox, safari, opera, IE 7+
117
+ $DOMWindowOverlay.css({'height':'100%','width':'100%','position':'fixed'});
118
+ }
119
+ };
120
+
121
+ var sizeIE6Iframe = function(){
122
+ var overlayViewportHeight = document.documentElement.offsetHeight + document.documentElement.scrollTop - 4;
123
+ var overlayViewportWidth = document.documentElement.offsetWidth - 21;
124
+ $('#DOMWindowIE6FixIframe').css({'height':overlayViewportHeight +'px','width':overlayViewportWidth+'px'});
125
+ };
126
+
127
+ var centerDOMWindow = function() {
128
+ var $DOMWindow = $('#DOMWindow');
129
+ if(settings.height + 50 > shortcut.viewPortHeight()){//added 50 to be safe
130
+ $DOMWindow.css('left',Math.round(shortcut.viewPortWidth()/2) + shortcut.scrollOffsetWidth() - Math.round(($DOMWindow.outerWidth())/2));
131
+ }else{
132
+ $DOMWindow.css('left',Math.round(shortcut.viewPortWidth()/2) + shortcut.scrollOffsetWidth() - Math.round(($DOMWindow.outerWidth())/2));
133
+ $DOMWindow.css('top',Math.round(shortcut.viewPortHeight()/2) + shortcut.scrollOffsetHeight() - Math.round(($DOMWindow.outerHeight())/2));
134
+ }
135
+ };
136
+
137
+ var centerLoader = function() {
138
+ var $DOMWindowLoader = $('#DOMWindowLoader');
139
+ if(shortcut.isIE6){//if IE 6
140
+ $DOMWindowLoader.css({'left':Math.round(shortcut.viewPortWidth()/2) + shortcut.scrollOffsetWidth() - Math.round(($DOMWindowLoader.innerWidth())/2),'position':'absolute'});
141
+ $DOMWindowLoader.css({'top':Math.round(shortcut.viewPortHeight()/2) + shortcut.scrollOffsetHeight() - Math.round(($DOMWindowLoader.innerHeight())/2),'position':'absolute'});
142
+ }else{
143
+ $DOMWindowLoader.css({'left':'50%','top':'50%','position':'fixed'});
144
+ }
145
+
146
+ };
147
+
148
+ var fixedDOMWindow = function(){
149
+ var $DOMWindow = $('#DOMWindow');
150
+ $DOMWindow.css('left', settings.positionLeft + shortcut.scrollOffsetWidth());
151
+ $DOMWindow.css('top', + settings.positionTop + shortcut.scrollOffsetHeight());
152
+ };
153
+
154
+ var showDOMWindow = function(instance){
155
+ if(arguments[0]){
156
+ $('.'+instance+' #DOMWindowLoader').remove();
157
+ $('.'+instance+' #DOMWindowContent').fadeIn('fast',function(){if(settings.functionCallOnOpen){settings.functionCallOnOpen();}});
158
+ $('.'+instance+ '.closeDOMWindow').click(function(){
159
+ $.closeDOMWindow();
160
+ return false;
161
+ });
162
+ }else{
163
+ $('#DOMWindowLoader').remove();
164
+ $('#DOMWindow').fadeIn('fast',function(){if(settings.functionCallOnOpen){settings.functionCallOnOpen();}});
165
+ $('#DOMWindow .closeDOMWindow').click(function(){
166
+ $.closeDOMWindow();
167
+ return false;
168
+ });
169
+ }
170
+
171
+ };
172
+
173
+ var urlQueryToObject = function(s){
174
+ var query = {};
175
+ s.replace(/b([^&=]*)=([^&=]*)b/g, function (m, a, d) {
176
+ if (typeof query[a] != 'undefined') {
177
+ query[a] += ',' + d;
178
+ } else {
179
+ query[a] = d;
180
+ }
181
+ });
182
+ return query;
183
+ };
184
+
185
+ //Run Routine ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
186
+ var run = function(passingThis){
187
+
188
+ //get values from element clicked, or assume its passed as an option
189
+ settings.windowSourceID = $(passingThis).attr('href') || settings.windowSourceID;
190
+ settings.windowSourceURL = $(passingThis).attr(settings.windowSourceAttrURL) || settings.windowSourceURL;
191
+ settings.windowBGImage = settings.windowBGImage ? 'background-image:url('+settings.windowBGImage+')' : '';
192
+ var urlOnly, urlQueryObject;
193
+
194
+ if(settings.positionType == 'anchored'){//anchored DOM window
195
+
196
+ var anchoredPositions = $(settings.anchoredSelector).position();
197
+ var anchoredPositionX = anchoredPositions.left + settings.positionLeft;
198
+ var anchoredPositionY = anchoredPositions.top + settings.positionTop;
199
+
200
+ $('body').append('<div class="'+settings.anchoredClassName+'" style="'+settings.windowBGImage+';background-repeat:no-repeat;padding:'+settings.windowPadding+'px;overflow:auto;position:absolute;top:'+anchoredPositionY+'px;left:'+anchoredPositionX+'px;height:'+settings.height+'px;width:'+settings.width+'px;background-color:'+settings.windowBGColor+';border:'+settings.borderSize+'px solid '+settings.borderColor+';z-index:10001"><div id="DOMWindowContent" style="display:none"></div></div>');
201
+ //loader
202
+ if(settings.loader && settings.loaderImagePath !== ''){
203
+ $('.'+settings.anchoredClassName).append('<div id="DOMWindowLoader" style="width:'+settings.loaderWidth+'px;height:'+settings.loaderHeight+'px;"><img src="'+settings.loaderImagePath+'" /></div>');
204
+
205
+ }
206
+
207
+ if($.fn.draggable){
208
+ if(settings.draggable){$('.' + settings.anchoredClassName).draggable({cursor:'move'});}
209
+ }
210
+
211
+ switch(settings.windowSource){
212
+ case 'inline'://////////////////////////////// inline //////////////////////////////////////////
213
+ $('.' + settings.anchoredClassName+" #DOMWindowContent").append($(settings.windowSourceID).children());
214
+ $('.' + settings.anchoredClassName).unload(function(){// move elements back when you're finished
215
+ $('.' + settings.windowSourceID).append( $('.' + settings.anchoredClassName+" #DOMWindowContent").children());
216
+ });
217
+ showDOMWindow(settings.anchoredClassName);
218
+ break;
219
+ case 'iframe'://////////////////////////////// iframe //////////////////////////////////////////
220
+ $('.' + settings.anchoredClassName+" #DOMWindowContent").append('<iframe frameborder="0" hspace="0" wspace="0" src="'+settings.windowSourceURL+'" name="DOMWindowIframe'+Math.round(Math.random()*1000)+'" style="width:100%;height:100%;border:none;background-color:#fff;" class="'+settings.anchoredClassName+'Iframe" ></iframe>');
221
+ $('.'+settings.anchoredClassName+'Iframe').load(showDOMWindow(settings.anchoredClassName));
222
+ break;
223
+ case 'ajax'://////////////////////////////// ajax //////////////////////////////////////////
224
+ if(settings.windowHTTPType == 'post'){
225
+
226
+ if(settings.windowSourceURL.indexOf("?") !== -1){//has a query string
227
+ urlOnly = settings.windowSourceURL.substr(0, settings.windowSourceURL.indexOf("?"));
228
+ urlQueryObject = urlQueryToObject(settings.windowSourceURL);
229
+ }else{
230
+ urlOnly = settings.windowSourceURL;
231
+ urlQueryObject = {};
232
+ }
233
+ $('.' + settings.anchoredClassName+" #DOMWindowContent").load(urlOnly,urlQueryObject,function(){
234
+ showDOMWindow(settings.anchoredClassName);
235
+ });
236
+ }else{
237
+ if(settings.windowSourceURL.indexOf("?") == -1){ //no query string, so add one
238
+ settings.windowSourceURL += '?';
239
+ }
240
+ $('.' + settings.anchoredClassName+" #DOMWindowContent").load(
241
+ settings.windowSourceURL + '&random=' + (new Date().getTime()),function(){
242
+ showDOMWindow(settings.anchoredClassName);
243
+ });
244
+ }
245
+ break;
246
+ }
247
+
248
+ }else{//centered, fixed, absolute DOM window
249
+
250
+ //overlay & modal
251
+ if(settings.overlay){
252
+ $('body').append('<div id="DOMWindowOverlay" style="z-index:10000;display:none;position:absolute;top:0;left:0;background-color:'+settings.overlayColor+';filter:alpha(opacity='+settings.overlayOpacity+');-moz-opacity: 0.'+settings.overlayOpacity+';opacity: 0.'+settings.overlayOpacity+';"></div>');
253
+ if(shortcut.isIE6){//if IE 6
254
+ $('body').append('<iframe id="DOMWindowIE6FixIframe" src="blank.html" style="width:100%;height:100%;z-index:9999;position:absolute;top:0;left:0;filter:alpha(opacity=0);"></iframe>');
255
+ sizeIE6Iframe();
256
+ }
257
+ sizeOverlay();
258
+ var $DOMWindowOverlay = $('#DOMWindowOverlay');
259
+ $DOMWindowOverlay.fadeIn('fast');
260
+ if(!settings.modal){$DOMWindowOverlay.click(function(){$.closeDOMWindow();});}
261
+ }
262
+
263
+ //loader
264
+ if(settings.loader && settings.loaderImagePath !== ''){
265
+ $('body').append('<div id="DOMWindowLoader" style="z-index:10002;width:'+settings.loaderWidth+'px;height:'+settings.loaderHeight+'px;"><img src="'+settings.loaderImagePath+'" /></div>');
266
+ centerLoader();
267
+ }
268
+
269
+ //add DOMwindow
270
+ $('body').append('<div id="DOMWindow" style="background-repeat:no-repeat;'+settings.windowBGImage+';overflow:auto;padding:'+settings.windowPadding+'px;display:none;height:'+settings.height+'px;width:'+settings.width+'px;background-color:'+settings.windowBGColor+';border:'+settings.borderSize+'px solid '+settings.borderColor+'; position:absolute;z-index:10001"></div>');
271
+
272
+ var $DOMWindow = $('#DOMWindow');
273
+ //centered, absolute, or fixed
274
+ switch(settings.positionType){
275
+ case 'centered':
276
+ centerDOMWindow();
277
+ if(settings.height + 50 > shortcut.viewPortHeight()){//added 50 to be safe
278
+ $DOMWindow.css('top', (settings.fixedWindowY + shortcut.scrollOffsetHeight()) + 'px');
279
+ }
280
+ break;
281
+ case 'absolute':
282
+ $DOMWindow.css({'top':(settings.positionTop+shortcut.scrollOffsetHeight())+'px','left':(settings.positionLeft+shortcut.scrollOffsetWidth())+'px'});
283
+ if($.fn.draggable){
284
+ if(settings.draggable){$DOMWindow.draggable({cursor:'move'});}
285
+ }
286
+ break;
287
+ case 'fixed':
288
+ fixedDOMWindow();
289
+ break;
290
+ case 'anchoredSingleWindow':
291
+ var anchoredPositions = $(settings.anchoredSelector).position();
292
+ var anchoredPositionX = anchoredPositions.left + settings.positionLeft;
293
+ var anchoredPositionY = anchoredPositions.top + settings.positionTop;
294
+ $DOMWindow.css({'top':anchoredPositionY + 'px','left':anchoredPositionX+'px'});
295
+
296
+ break;
297
+ }
298
+
299
+ $(window).bind('scroll.DOMWindow',function(){
300
+ if(settings.overlay){sizeOverlay();}
301
+ if(shortcut.isIE6){sizeIE6Iframe();}
302
+ if(settings.positionType == 'centered'){centerDOMWindow();}
303
+ if(settings.positionType == 'fixed'){fixedDOMWindow();}
304
+ });
305
+
306
+ $(window).bind('resize.DOMWindow',function(){
307
+ if(shortcut.isIE6){sizeIE6Iframe();}
308
+ if(settings.overlay){sizeOverlay();}
309
+ if(settings.positionType == 'centered'){centerDOMWindow();}
310
+ });
311
+
312
+ switch(settings.windowSource){
313
+ case 'inline'://////////////////////////////// inline //////////////////////////////////////////
314
+ $DOMWindow.append($(settings.windowSourceID).children());
315
+ $DOMWindow.unload(function(){// move elements back when you're finished
316
+ $(settings.windowSourceID).append($DOMWindow.children());
317
+ });
318
+ showDOMWindow();
319
+ break;
320
+ case 'iframe'://////////////////////////////// iframe //////////////////////////////////////////
321
+ $DOMWindow.append('<iframe frameborder="0" hspace="0" wspace="0" src="'+settings.windowSourceURL+'" name="DOMWindowIframe'+Math.round(Math.random()*1000)+'" style="width:100%;height:100%;border:none;background-color:#fff;" id="DOMWindowIframe" ></iframe>');
322
+ $('#DOMWindowIframe').load(showDOMWindow());
323
+ break;
324
+ case 'ajax'://////////////////////////////// ajax //////////////////////////////////////////
325
+ if(settings.windowHTTPType == 'post'){
326
+
327
+ if(settings.windowSourceURL.indexOf("?") !== -1){//has a query string
328
+ urlOnly = settings.windowSourceURL.substr(0, settings.windowSourceURL.indexOf("?"));
329
+ urlQueryObject = urlQueryToObject(settings.windowSourceURL);
330
+ }else{
331
+ urlOnly = settings.windowSourceURL;
332
+ urlQueryObject = {};
333
+ }
334
+ $DOMWindow.load(urlOnly,urlQueryObject,function(){
335
+ showDOMWindow();
336
+ });
337
+ }else{
338
+ if(settings.windowSourceURL.indexOf("?") == -1){ //no query string, so add one
339
+ settings.windowSourceURL += '?';
340
+ }
341
+ $DOMWindow.load(
342
+ settings.windowSourceURL + '&random=' + (new Date().getTime()),function(){
343
+ showDOMWindow();
344
+ });
345
+ }
346
+ break;
347
+ }
348
+
349
+ }//end if anchored, or absolute, fixed, centered
350
+
351
+ };//end run()
352
+
353
+ if(settings.eventType){//if used with $().
354
+ return this.each(function(index){
355
+ $(this).bind(settings.eventType,function(){
356
+ run(this);
357
+ return false;
358
+ });
359
+ });
360
+ }else{//else called as $.function
361
+ run();
362
+ }
363
+
364
+ };//end function openDOMWindow
365
+
366
+ //allow for public call, pass settings
367
+ $.openDOMWindow = function(s){$.fn.openDOMWindow(s);};
368
+
369
+ })(jQuery);
js/jquery.domwindow.min.js CHANGED
@@ -1,18 +1 @@
1
- (function(b){b.fn.closeDOMWindow=function(e){e||(e={});var c=function(){if(e.anchoredClassName){var a=b("."+e.anchoredClassName);a.fadeOut("fast",function(){b.fn.draggable?a.draggable("destory").trigger("unload").remove():a.trigger("unload").remove()})}else{var c=b("#DOMWindowOverlay"),h=b("#DOMWindow");c.fadeOut("fast",function(){c.trigger("unload").unbind().remove()});h.fadeOut("fast",function(){b.fn.draggable?h.draggable("destroy").trigger("unload").remove():h.trigger("unload").remove()});b(window).unbind("scroll.DOMWindow");
2
- b(window).unbind("resize.DOMWindow");b.fn.openDOMWindow.isIE6&&b("#DOMWindowIE6FixIframe").remove()}e.functionCallOnClose&&e.functionCallAfterClose()};if(e.eventType)return this.each(function(){b(this).bind(e.eventType,function(){c(this);return!1})});c()};b.closeDOMWindow=function(e){b.fn.closeDOMWindow(e)};b.fn.openDOMWindow=function(e){var c=b.fn.openDOMWindow;c.defaultsSettings={anchoredClassName:"",anchoredSelector:"",borderColor:"#ccc",borderSize:"4",draggable:0,eventType:null,fixedWindowY:100,
3
- functionCallOnOpen:null,functionCallOnClose:null,height:500,loader:0,loaderHeight:0,loaderImagePath:"",loaderWidth:0,modal:0,overlay:1,overlayColor:"#000",overlayOpacity:"85",positionLeft:0,positionTop:0,positionType:"centered",width:500,windowBGColor:"#fff",windowBGImage:null,windowHTTPType:"get",windowPadding:10,windowSource:"inline",windowSourceID:"",windowSourceURL:"",windowSourceAttrURL:"href"};var a=b.extend({},b.fn.openDOMWindow.defaultsSettings,e||{});c.viewPortHeight=function(){return self.innerHeight||
4
- document.documentElement.clientHeight||document.body.clientHeight};c.viewPortWidth=function(){return self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth};c.scrollOffsetHeight=function(){return self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop};c.scrollOffsetWidth=function(){return self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft};c.isIE6="undefined"===typeof document.body.style.maxHeight;var j=function(){var a=
5
- b("#DOMWindowOverlay");c.isIE6?a.css({height:document.documentElement.offsetHeight+document.documentElement.scrollTop-4+"px",width:document.documentElement.offsetWidth-21+"px"}):a.css({height:"100%",width:"100%",position:"fixed"})},h=function(){var a=document.documentElement.offsetHeight+document.documentElement.scrollTop-4,c=document.documentElement.offsetWidth-21;b("#DOMWindowIE6FixIframe").css({height:a+"px",width:c+"px"})},k=function(){var d=b("#DOMWindow");a.height+50>c.viewPortHeight()?d.css("left",
6
- Math.round(c.viewPortWidth()/2)+c.scrollOffsetWidth()-Math.round(d.outerWidth()/2)):(d.css("left",Math.round(c.viewPortWidth()/2)+c.scrollOffsetWidth()-Math.round(d.outerWidth()/2)),d.css("top",Math.round(c.viewPortHeight()/2)+c.scrollOffsetHeight()-Math.round(d.outerHeight()/2)))},l=function(){var d=b("#DOMWindow");d.css("left",a.positionLeft+c.scrollOffsetWidth());d.css("top",+a.positionTop+c.scrollOffsetHeight())},g=function(d){d?(b("."+d+" #DOMWindowLoader").remove(),b("."+d+" #DOMWindowContent").fadeIn("fast",
7
- function(){a.functionCallOnOpen&&a.functionCallOnOpen()}),b("."+d+".closeDOMWindow").click(function(){b.closeDOMWindow();return!1})):(b("#DOMWindowLoader").remove(),b("#DOMWindow").fadeIn("fast",function(){a.functionCallOnOpen&&a.functionCallOnOpen()}),b("#DOMWindow .closeDOMWindow").click(function(){b.closeDOMWindow();return!1}))},m=function(a){var b={};a.replace(/b([^&=]*)=([^&=]*)b/g,function(a,c,d){b[c]="undefined"!=typeof b[c]?b[c]+(","+d):d});return b},n=function(d){a.windowSourceID=b(d).attr("href")||
8
- a.windowSourceID;a.windowSourceURL=b(d).attr(a.windowSourceAttrURL)||a.windowSourceURL;a.windowBGImage=a.windowBGImage?"background-image:url("+a.windowBGImage+")":"";var f;if("anchored"==a.positionType)switch(f=b(a.anchoredSelector).position(),d=f.left+a.positionLeft,f=f.top+a.positionTop,b("body").append('<div class="'+a.anchoredClassName+'" style="'+a.windowBGImage+";background-repeat:no-repeat;padding:"+a.windowPadding+"px;overflow:auto;position:absolute;top:"+f+"px;left:"+d+"px;height:"+a.height+
9
- "px;width:"+a.width+"px;background-color:"+a.windowBGColor+";border:"+a.borderSize+"px solid "+a.borderColor+';z-index:10001"><div id="DOMWindowContent" style="display:none"></div></div>'),a.loader&&""!==a.loaderImagePath&&b("."+a.anchoredClassName).append('<div id="DOMWindowLoader" style="width:'+a.loaderWidth+"px;height:"+a.loaderHeight+'px;"><img src="'+a.loaderImagePath+'" /></div>'),b.fn.draggable&&a.draggable&&b("."+a.anchoredClassName).draggable({cursor:"move"}),a.windowSource){case "inline":b("."+
10
- a.anchoredClassName+" #DOMWindowContent").append(b(a.windowSourceID).children());b("."+a.anchoredClassName).unload(function(){b("."+a.windowSourceID).append(b("."+a.anchoredClassName+" #DOMWindowContent").children())});g(a.anchoredClassName);break;case "iframe":b("."+a.anchoredClassName+" #DOMWindowContent").append('<iframe frameborder="0" hspace="0" wspace="0" src="'+a.windowSourceURL+'" name="DOMWindowIframe'+Math.round(1E3*Math.random())+'" style="width:100%;height:100%;border:none;background-color:#fff;" class="'+
11
- a.anchoredClassName+'Iframe" ></iframe>');b("."+a.anchoredClassName+"Iframe").load(g(a.anchoredClassName));break;case "ajax":"post"==a.windowHTTPType?(-1!==a.windowSourceURL.indexOf("?")?(d=a.windowSourceURL.substr(0,a.windowSourceURL.indexOf("?")),f=m(a.windowSourceURL)):(d=a.windowSourceURL,f={}),b("."+a.anchoredClassName+" #DOMWindowContent").load(d,f,function(){g(a.anchoredClassName)})):(-1==a.windowSourceURL.indexOf("?")&&(a.windowSourceURL+="?"),b("."+a.anchoredClassName+" #DOMWindowContent").load(a.windowSourceURL+
12
- "&random="+(new Date).getTime(),function(){g(a.anchoredClassName)}))}else{a.overlay&&(b("body").append('<div id="DOMWindowOverlay" style="z-index:10000;display:none;position:absolute;top:0;left:0;background-color:'+a.overlayColor+";filter:alpha(opacity="+a.overlayOpacity+");-moz-opacity: 0."+a.overlayOpacity+";opacity: 0."+a.overlayOpacity+';"></div>'),c.isIE6&&(b("body").append('<iframe id="DOMWindowIE6FixIframe" src="blank.html" style="width:100%;height:100%;z-index:9999;position:absolute;top:0;left:0;filter:alpha(opacity=0);"></iframe>'),
13
- h()),j(),d=b("#DOMWindowOverlay"),d.fadeIn("fast"),a.modal||d.click(function(){b.closeDOMWindow()}));a.loader&&""!==a.loaderImagePath&&(b("body").append('<div id="DOMWindowLoader" style="z-index:10002;width:'+a.loaderWidth+"px;height:"+a.loaderHeight+'px;"><img src="'+a.loaderImagePath+'" /></div>'),d=b("#DOMWindowLoader"),c.isIE6?(d.css({left:Math.round(c.viewPortWidth()/2)+c.scrollOffsetWidth()-Math.round(d.innerWidth()/2),position:"absolute"}),d.css({top:Math.round(c.viewPortHeight()/2)+c.scrollOffsetHeight()-
14
- Math.round(d.innerHeight()/2),position:"absolute"})):d.css({left:"50%",top:"50%",position:"fixed"}));b("body").append('<div id="DOMWindow" style="background-repeat:no-repeat;'+a.windowBGImage+";overflow:auto;padding:"+a.windowPadding+"px;display:none;height:"+a.height+"px;width:"+a.width+"px;background-color:"+a.windowBGColor+";border:"+a.borderSize+"px solid "+a.borderColor+'; position:absolute;z-index:10001"></div>');var e=b("#DOMWindow");switch(a.positionType){case "centered":k();a.height+50>c.viewPortHeight()&&
15
- e.css("top",a.fixedWindowY+c.scrollOffsetHeight()+"px");break;case "absolute":e.css({top:a.positionTop+c.scrollOffsetHeight()+"px",left:a.positionLeft+c.scrollOffsetWidth()+"px"});b.fn.draggable&&a.draggable&&e.draggable({cursor:"move"});break;case "fixed":l();break;case "anchoredSingleWindow":f=b(a.anchoredSelector).position(),d=f.left+a.positionLeft,f=f.top+a.positionTop,e.css({top:f+"px",left:d+"px"})}b(window).bind("scroll.DOMWindow",function(){a.overlay&&j();c.isIE6&&h();"centered"==a.positionType&&
16
- k();"fixed"==a.positionType&&l()});b(window).bind("resize.DOMWindow",function(){c.isIE6&&h();a.overlay&&j();"centered"==a.positionType&&k()});switch(a.windowSource){case "inline":e.append(b(a.windowSourceID).children());e.unload(function(){b(a.windowSourceID).append(e.children())});g();break;case "iframe":e.append('<iframe frameborder="0" hspace="0" wspace="0" src="'+a.windowSourceURL+'" name="DOMWindowIframe'+Math.round(1E3*Math.random())+'" style="width:100%;height:100%;border:none;background-color:#fff;" id="DOMWindowIframe" ></iframe>');
17
- b("#DOMWindowIframe").load(g());break;case "ajax":"post"==a.windowHTTPType?(-1!==a.windowSourceURL.indexOf("?")?(d=a.windowSourceURL.substr(0,a.windowSourceURL.indexOf("?")),f=m(a.windowSourceURL)):(d=a.windowSourceURL,f={}),e.load(d,f,function(){g()})):(-1==a.windowSourceURL.indexOf("?")&&(a.windowSourceURL+="?"),e.load(a.windowSourceURL+"&random="+(new Date).getTime(),function(){g()}))}}};if(a.eventType)return this.each(function(){b(this).bind(a.eventType,function(){n(this);return!1})});n()};b.openDOMWindow=
18
- function(e){b.fn.openDOMWindow(e)}})(jQuery);
1
+ !function(e){e.fn.closeDOMWindow=function(o){o||(o={});var n=function(){if(o.anchoredClassName){var n=e("."+o.anchoredClassName);n.fadeOut("fast",function(){e.fn.draggable?n.draggable("destory").trigger("unload").remove():n.trigger("unload").remove()}),o.functionCallOnClose&&o.functionCallAfterClose()}else{var i=e("#DOMWindowOverlay"),t=e("#DOMWindow");i.fadeOut("fast",function(){i.trigger("unload").unbind().remove()}),t.fadeOut("fast",function(){e.fn.draggable?t.draggable("destroy").trigger("unload").remove():t.trigger("unload").remove()}),e(window).unbind("scroll.DOMWindow"),e(window).unbind("resize.DOMWindow"),e.fn.openDOMWindow.isIE6&&e("#DOMWindowIE6FixIframe").remove(),o.functionCallOnClose&&o.functionCallAfterClose()}};return o.eventType?this.each(function(){e(this).bind(o.eventType,function(){return n(this),!1})}):void n()},e.closeDOMWindow=function(o){e.fn.closeDOMWindow(o)},e.fn.openDOMWindow=function(o){var n=e.fn.openDOMWindow;n.defaultsSettings={anchoredClassName:"",anchoredSelector:"",borderColor:"#ccc",borderSize:"4",draggable:0,eventType:null,fixedWindowY:100,functionCallOnOpen:null,functionCallOnClose:null,height:500,loader:0,loaderHeight:0,loaderImagePath:"",loaderWidth:0,modal:0,overlay:1,overlayColor:"#000",overlayOpacity:"85",positionLeft:0,positionTop:0,positionType:"centered",width:500,windowBGColor:"#fff",windowBGImage:null,windowHTTPType:"get",windowPadding:10,windowSource:"inline",windowSourceID:"",windowSourceURL:"",windowSourceAttrURL:"href"};var i=e.extend({},e.fn.openDOMWindow.defaultsSettings,o||{});n.viewPortHeight=function(){return self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},n.viewPortWidth=function(){return self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth},n.scrollOffsetHeight=function(){return self.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop},n.scrollOffsetWidth=function(){return self.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft},n.isIE6="undefined"==typeof document.body.style.maxHeight;var t=function(){var o=e("#DOMWindowOverlay");if(n.isIE6){var i=document.documentElement.offsetHeight+document.documentElement.scrollTop-4,t=document.documentElement.offsetWidth-21;o.css({height:i+"px",width:t+"px"})}else o.css({height:"100%",width:"100%",position:"fixed"})},d=function(){var o=document.documentElement.offsetHeight+document.documentElement.scrollTop-4,n=document.documentElement.offsetWidth-21;e("#DOMWindowIE6FixIframe").css({height:o+"px",width:n+"px"})},r=function(){var o=e("#DOMWindow");i.height+50>n.viewPortHeight()?o.css("left",Math.round(n.viewPortWidth()/2)+n.scrollOffsetWidth()-Math.round(o.outerWidth()/2)):(o.css("left",Math.round(n.viewPortWidth()/2)+n.scrollOffsetWidth()-Math.round(o.outerWidth()/2)),o.css("top",Math.round(n.viewPortHeight()/2)+n.scrollOffsetHeight()-Math.round(o.outerHeight()/2)))},a=function(){var o=e("#DOMWindowLoader");n.isIE6?(o.css({left:Math.round(n.viewPortWidth()/2)+n.scrollOffsetWidth()-Math.round(o.innerWidth()/2),position:"absolute"}),o.css({top:Math.round(n.viewPortHeight()/2)+n.scrollOffsetHeight()-Math.round(o.innerHeight()/2),position:"absolute"})):o.css({left:"50%",top:"50%",position:"fixed"})},l=function(){var o=e("#DOMWindow");o.css("left",i.positionLeft+n.scrollOffsetWidth()),o.css("top",+i.positionTop+n.scrollOffsetHeight())},c=function(o){arguments[0]?(e("."+o+" #DOMWindowLoader").remove(),e("."+o+" #DOMWindowContent").fadeIn("fast",function(){i.functionCallOnOpen&&i.functionCallOnOpen()}),e("."+o+".closeDOMWindow").click(function(){return e.closeDOMWindow(),!1})):(e("#DOMWindowLoader").remove(),e("#DOMWindow").fadeIn("fast",function(){i.functionCallOnOpen&&i.functionCallOnOpen()}),e("#DOMWindow .closeDOMWindow").click(function(){return e.closeDOMWindow(),!1}))},s=function(e){var o={};return e.replace(/b([^&=]*)=([^&=]*)b/g,function(e,n,i){"undefined"!=typeof o[n]?o[n]+=","+i:o[n]=i}),o},f=function(o){i.windowSourceID=e(o).attr("href")||i.windowSourceID,i.windowSourceURL=e(o).attr(i.windowSourceAttrURL)||i.windowSourceURL,i.windowBGImage=i.windowBGImage?"background-image:url("+i.windowBGImage+")":"";var f,w;if("anchored"==i.positionType){var u=e(i.anchoredSelector).position(),h=u.left+i.positionLeft,p=u.top+i.positionTop;switch(e("body").append('<div class="'+i.anchoredClassName+'" style="'+i.windowBGImage+";background-repeat:no-repeat;padding:"+i.windowPadding+"px;overflow:auto;position:absolute;top:"+p+"px;left:"+h+"px;height:"+i.height+"px;width:"+i.width+"px;background-color:"+i.windowBGColor+";border:"+i.borderSize+"px solid "+i.borderColor+';z-index:10001"><div id="DOMWindowContent" style="display:none"></div></div>'),i.loader&&""!==i.loaderImagePath&&e("."+i.anchoredClassName).append('<div id="DOMWindowLoader" style="width:'+i.loaderWidth+"px;height:"+i.loaderHeight+'px;"><img src="'+i.loaderImagePath+'" /></div>'),e.fn.draggable&&i.draggable&&e("."+i.anchoredClassName).draggable({cursor:"move"}),i.windowSource){case"inline":e("."+i.anchoredClassName+" #DOMWindowContent").append(e(i.windowSourceID).children()),e("."+i.anchoredClassName).unload(function(){e("."+i.windowSourceID).append(e("."+i.anchoredClassName+" #DOMWindowContent").children())}),c(i.anchoredClassName);break;case"iframe":e("."+i.anchoredClassName+" #DOMWindowContent").append('<iframe frameborder="0" hspace="0" wspace="0" src="'+i.windowSourceURL+'" name="DOMWindowIframe'+Math.round(1e3*Math.random())+'" style="width:100%;height:100%;border:none;background-color:#fff;" class="'+i.anchoredClassName+'Iframe" ></iframe>'),e("."+i.anchoredClassName+"Iframe").load(c(i.anchoredClassName));break;case"ajax":"post"==i.windowHTTPType?(-1!==i.windowSourceURL.indexOf("?")?(f=i.windowSourceURL.substr(0,i.windowSourceURL.indexOf("?")),w=s(i.windowSourceURL)):(f=i.windowSourceURL,w={}),e("."+i.anchoredClassName+" #DOMWindowContent").load(f,w,function(){c(i.anchoredClassName)})):(-1==i.windowSourceURL.indexOf("?")&&(i.windowSourceURL+="?"),e("."+i.anchoredClassName+" #DOMWindowContent").load(i.windowSourceURL+"&random="+(new Date).getTime(),function(){c(i.anchoredClassName)}))}}else{if(i.overlay){e("body").append('<div id="DOMWindowOverlay" style="z-index:10000;display:none;position:absolute;top:0;left:0;background-color:'+i.overlayColor+";filter:alpha(opacity="+i.overlayOpacity+");-moz-opacity: 0."+i.overlayOpacity+";opacity: 0."+i.overlayOpacity+';"></div>'),n.isIE6&&(e("body").append('<iframe id="DOMWindowIE6FixIframe" src="blank.html" style="width:100%;height:100%;z-index:9999;position:absolute;top:0;left:0;filter:alpha(opacity=0);"></iframe>'),d()),t();var m=e("#DOMWindowOverlay");m.fadeIn("fast"),i.modal||m.click(function(){e.closeDOMWindow()})}i.loader&&""!==i.loaderImagePath&&(e("body").append('<div id="DOMWindowLoader" style="z-index:10002;width:'+i.loaderWidth+"px;height:"+i.loaderHeight+'px;"><img src="'+i.loaderImagePath+'" /></div>'),a()),e("body").append('<div id="DOMWindow" style="background-repeat:no-repeat;'+i.windowBGImage+";overflow:auto;padding:"+i.windowPadding+"px;display:none;height:"+i.height+"px;width:"+i.width+"px;background-color:"+i.windowBGColor+";border:"+i.borderSize+"px solid "+i.borderColor+'; position:absolute;z-index:10001"></div>');var g=e("#DOMWindow");switch(i.positionType){case"centered":r(),i.height+50>n.viewPortHeight()&&g.css("top",i.fixedWindowY+n.scrollOffsetHeight()+"px");break;case"absolute":g.css({top:i.positionTop+n.scrollOffsetHeight()+"px",left:i.positionLeft+n.scrollOffsetWidth()+"px"}),e.fn.draggable&&i.draggable&&g.draggable({cursor:"move"});break;case"fixed":l();break;case"anchoredSingleWindow":var u=e(i.anchoredSelector).position(),h=u.left+i.positionLeft,p=u.top+i.positionTop;g.css({top:p+"px",left:h+"px"})}switch(e(window).bind("scroll.DOMWindow",function(){i.overlay&&t(),n.isIE6&&d(),"centered"==i.positionType&&r(),"fixed"==i.positionType&&l()}),e(window).bind("resize.DOMWindow",function(){n.isIE6&&d(),i.overlay&&t(),"centered"==i.positionType&&r()}),i.windowSource){case"inline":g.append(e(i.windowSourceID).children()),g.unload(function(){e(i.windowSourceID).append(g.children())}),c();break;case"iframe":g.append('<iframe frameborder="0" hspace="0" wspace="0" src="'+i.windowSourceURL+'" name="DOMWindowIframe'+Math.round(1e3*Math.random())+'" style="width:100%;height:100%;border:none;background-color:#fff;" id="DOMWindowIframe" ></iframe>'),e("#DOMWindowIframe").load(c());break;case"ajax":"post"==i.windowHTTPType?(-1!==i.windowSourceURL.indexOf("?")?(f=i.windowSourceURL.substr(0,i.windowSourceURL.indexOf("?")),w=s(i.windowSourceURL)):(f=i.windowSourceURL,w={}),g.load(f,w,function(){c()})):(-1==i.windowSourceURL.indexOf("?")&&(i.windowSourceURL+="?"),g.load(i.windowSourceURL+"&random="+(new Date).getTime(),function(){c()}))}}};return i.eventType?this.each(function(){e(this).bind(i.eventType,function(){return f(this),!1})}):void f()},e.openDOMWindow=function(o){e.fn.openDOMWindow(o)}}(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/jquery.fitvids.js CHANGED
@@ -1,80 +1,83 @@
1
- /*global jQuery */
2
- /*jshint multistr:true browser:true */
3
- /*!
4
- * FitVids 1.0.3
5
- *
6
- * Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
7
- * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
8
- * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
9
- *
10
- * Date: Thu Sept 01 18:00:00 2011 -0500
11
- */
12
-
13
- (function( $ ){
14
-
15
- "use strict";
16
-
17
- $.fn.fitVids = function( options ) {
18
- var settings = {
19
- customSelector: null
20
- };
21
-
22
- if(!document.getElementById('fit-vids-style')) {
23
-
24
- var div = document.createElement('div'),
25
- ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0],
26
- cssStyles = '&shy;<style>.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%;}</style>';
27
-
28
- div.className = 'fit-vids-style';
29
- div.id = 'fit-vids-style';
30
- div.style.display = 'none';
31
- div.innerHTML = cssStyles;
32
-
33
- ref.parentNode.insertBefore(div,ref);
34
-
35
- }
36
-
37
- if ( options ) {
38
- $.extend( settings, options );
39
- }
40
-
41
- return this.each(function(){
42
- var selectors = [
43
- "iframe[src*='player.vimeo.com']",
44
- "iframe[src*='youtube.com']",
45
- "iframe[src*='youtube-nocookie.com']",
46
- "iframe[src*='kickstarter.com'][src*='video.html']",
47
- "object",
48
- "embed"
49
- ];
50
-
51
- if (settings.customSelector) {
52
- selectors.push(settings.customSelector);
53
- }
54
-
55
- var $allVideos = $(this).find(selectors.join(','));
56
- $allVideos = $allVideos.not("object object"); // SwfObj conflict patch
57
-
58
- $allVideos.each(function(){
59
- var $this = $(this);
60
- if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
61
- var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
62
- width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
63
- aspectRatio = height / width;
64
- if(!$this.attr('id')){
65
- var videoID = 'fitvid' + Math.floor(Math.random()*999999);
66
- $this.attr('id', videoID);
67
- }
68
- $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
69
- $this.removeAttr('height').removeAttr('width');
70
- });
71
- });
72
- };
73
- // Works with either jQuery or Zepto
74
- })( window.jQuery || window.Zepto );
75
-
76
- jQuery(document).ready(function($){
77
- $(".featured_video_plus").fitVids( {
78
- customSelector: "iframe[src*='dailymotion.com']"
79
- });
80
- });
 
 
 
1
+ /*global jQuery */
2
+ /*jshint browser:true */
3
+ /*!
4
+ * FitVids 1.1
5
+ *
6
+ * Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com
7
+ * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
8
+ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/
9
+ *
10
+ */
11
+
12
+ (function( $ ){
13
+
14
+ "use strict";
15
+
16
+ $.fn.fitVids = function( options ) {
17
+ var settings = {
18
+ customSelector: null,
19
+ ignore: null
20
+ };
21
+
22
+ if(!document.getElementById('fit-vids-style')) {
23
+ // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js
24
+ var head = document.head || document.getElementsByTagName('head')[0];
25
+ 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%;}';
26
+ var div = document.createElement('div');
27
+ div.innerHTML = '<p>x</p><style id="fit-vids-style">' + css + '</style>';
28
+ head.appendChild(div.childNodes[1]);
29
+ }
30
+
31
+ if ( options ) {
32
+ $.extend( settings, options );
33
+ }
34
+
35
+ return this.each(function(){
36
+ var selectors = [
37
+ "iframe[src*='player.vimeo.com']",
38
+ "iframe[src*='youtube.com']",
39
+ "iframe[src*='youtube-nocookie.com']",
40
+ "iframe[src*='kickstarter.com'][src*='video.html']",
41
+ "object",
42
+ "embed"
43
+ ];
44
+
45
+ if (settings.customSelector) {
46
+ selectors.push(settings.customSelector);
47
+ }
48
+
49
+ var ignoreList = '.fitvidsignore';
50
+
51
+ if(settings.ignore) {
52
+ ignoreList = ignoreList + ', ' + settings.ignore;
53
+ }
54
+
55
+ var $allVideos = $(this).find(selectors.join(','));
56
+ $allVideos = $allVideos.not("object object"); // SwfObj conflict patch
57
+ $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.
58
+
59
+ $allVideos.each(function(){
60
+ var $this = $(this);
61
+ if($this.parents(ignoreList).length > 0) {
62
+ return; // Disable FitVids on this video.
63
+ }
64
+ if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }
65
+ if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))
66
+ {
67
+ $this.attr('height', 9);
68
+ $this.attr('width', 16);
69
+ }
70
+ var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),
71
+ width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
72
+ aspectRatio = height / width;
73
+ if(!$this.attr('id')){
74
+ var videoID = 'fitvid' + Math.floor(Math.random()*999999);
75
+ $this.attr('id', videoID);
76
+ }
77
+ $this.wrap('<div class="fluid-width-video-wrapper"></div>').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+"%");
78
+ $this.removeAttr('height').removeAttr('width');
79
+ });
80
+ });
81
+ };
82
+ // Works with either jQuery or Zepto
83
+ })( window.jQuery || window.Zepto );
js/jquery.fitvids.min.js CHANGED
@@ -1 +1 @@
1
- !function(a){"use strict";a.fn.fitVids=function(b){var c={customSelector:null};if(!document.getElementById("fit-vids-style")){var d=document.createElement("div"),e=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0],f="&shy;<style>.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%;}</style>";d.className="fit-vids-style",d.id="fit-vids-style",d.style.display="none",d.innerHTML=f,e.parentNode.insertBefore(d,e)}return b&&a.extend(c,b),this.each(function(){var b=["iframe[src*='player.vimeo.com']","iframe[src*='youtube.com']","iframe[src*='youtube-nocookie.com']","iframe[src*='kickstarter.com'][src*='video.html']","object","embed"];c.customSelector&&b.push(c.customSelector);var d=a(this).find(b.join(","));d=d.not("object object"),d.each(function(){var b=a(this);if(!("embed"===this.tagName.toLowerCase()&&b.parent("object").length||b.parent(".fluid-width-video-wrapper").length)){var c="object"===this.tagName.toLowerCase()||b.attr("height")&&!isNaN(parseInt(b.attr("height"),10))?parseInt(b.attr("height"),10):b.height(),d=isNaN(parseInt(b.attr("width"),10))?b.width():parseInt(b.attr("width"),10),e=c/d;if(!b.attr("id")){var f="fitvid"+Math.floor(999999*Math.random());b.attr("id",f)}b.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*e+"%"),b.removeAttr("height").removeAttr("width")}})})}}(window.jQuery||window.Zepto),jQuery(document).ready(function(a){a(".featured_video_plus").fitVids({customSelector:"iframe[src*='dailymotion.com']"})});
1
+ !function(t){"use strict";t.fn.fitVids=function(e){var i={customSelector:null,ignore:null};if(!document.getElementById("fit-vids-style")){var r=document.head||document.getElementsByTagName("head")[0],a=".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%;}",d=document.createElement("div");d.innerHTML='<p>x</p><style id="fit-vids-style">'+a+"</style>",r.appendChild(d.childNodes[1])}return e&&t.extend(i,e),this.each(function(){var e=["iframe[src*='player.vimeo.com']","iframe[src*='youtube.com']","iframe[src*='youtube-nocookie.com']","iframe[src*='kickstarter.com'][src*='video.html']","object","embed"];i.customSelector&&e.push(i.customSelector);var r=".fitvidsignore";i.ignore&&(r=r+", "+i.ignore);var a=t(this).find(e.join(","));a=a.not("object object"),a=a.not(r),a.each(function(){var e=t(this);if(!(e.parents(r).length>0||"embed"===this.tagName.toLowerCase()&&e.parent("object").length||e.parent(".fluid-width-video-wrapper").length)){e.css("height")||e.css("width")||!isNaN(e.attr("height"))&&!isNaN(e.attr("width"))||(e.attr("height",9),e.attr("width",16));var i="object"===this.tagName.toLowerCase()||e.attr("height")&&!isNaN(parseInt(e.attr("height"),10))?parseInt(e.attr("height"),10):e.height(),a=isNaN(parseInt(e.attr("width"),10))?e.width():parseInt(e.attr("width"),10),d=i/a;if(!e.attr("id")){var o="fitvid"+Math.floor(999999*Math.random());e.attr("id",o)}e.wrap('<div class="fluid-width-video-wrapper"></div>').parent(".fluid-width-video-wrapper").css("padding-top",100*d+"%"),e.removeAttr("height").removeAttr("width")}})})}}(window.jQuery||window.Zepto);
js/post.js ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($) {
2
+ 'use strict';
3
+ /* global fvp_post, ajaxurl */
4
+
5
+ var context = fvp_post;
6
+ var $input;
7
+ var $media;
8
+ var mediaicon;
9
+
10
+
11
+ /**
12
+ * Set the featured video with 'setfeatimg' parameter in order to force set
13
+ * the featured image to the video thumbnail if possible.
14
+ *
15
+ * @param {event} event jQuery click event.
16
+ */
17
+ function setFeatimg(event) {
18
+ event.preventDefault();
19
+ submitVideo(true);
20
+ }
21
+
22
+
23
+ /**
24
+ *
25
+ * When the featured image is removed it might take some time for the HTTP
26
+ * request to return before we can enable the 'quick set featimg' link. It
27
+ * is not too bad if the link is not available (won't be displayed), but its
28
+ * nice to have.
29
+ */
30
+ function removeFeatimg() {
31
+ setTimeout(refreshHandlers, 2000); // Arbritrarily wait 2 seconds.
32
+ }
33
+
34
+
35
+ /**
36
+ * Submit video to server via ajax.
37
+ *
38
+ * @param {bool} setFeatimg
39
+ */
40
+ function submitVideo(setFeatimg) {
41
+ setFeatimg = setFeatimg || false;
42
+
43
+ $.post(ajaxurl, {
44
+ 'action' : 'fvp_save',
45
+ 'id' : $('#post_ID').val(),
46
+ 'fvp_nonce' : $('#fvp_nonce').val(),
47
+ 'fvp_video' : $input.val(),
48
+ 'fvp_set_featimg': setFeatimg
49
+ }, function(data) {
50
+ var $container = $('.fvp-current-video');
51
+
52
+ // reset loading icon
53
+ $media.css({ backgroundImage: mediaicon });
54
+
55
+ // removed video
56
+ if('remove' === data.task) {
57
+ $container
58
+ .css({height: $container.height() })
59
+ .html('')
60
+ .animate({height: 0});
61
+
62
+ // new video data
63
+ } else {
64
+ $container
65
+ .css({height: 'auto'})
66
+ .html(data.video);
67
+ }
68
+
69
+ // update featured image
70
+ $('#postimagediv .inside').html(data.img);
71
+ refreshHandlers();
72
+ }, 'json' );
73
+ }
74
+
75
+
76
+ /**
77
+ * Sets the set and remove featured image handlers.
78
+ * @return {[type]} [description]
79
+ */
80
+ function refreshHandlers() {
81
+ // Button for quickly setting a featured image if none is set.
82
+ $('.fvp-set-featimg').show().click(setFeatimg);
83
+
84
+ // Show setFeatimg link after removing a featured image.
85
+ $('#remove-post-thumbnail').click(removeFeatimg);
86
+ }
87
+
88
+
89
+ $(document).ready(function() {
90
+ // elements
91
+ $input = $('.fvp-video');
92
+ $media = $input.siblings('.fvp-video-choose').children('.fvp-media-icon');
93
+ mediaicon = $media.css( 'backgroundImage' );
94
+
95
+ var loadingicon = 'url(\'' + context.loading_gif + '\')';
96
+ var currentUrl = $input.val();
97
+
98
+ // Automatically submit the video URL using AJAX when the input is blurred.
99
+ // Update video and featured image with the returned data.
100
+ $input.blur(function() {
101
+ $input.val( $.trim( $input.val() ) );
102
+
103
+ // don't do anything if input didn't change
104
+ if (currentUrl === $input.val()) {
105
+ return;
106
+ }
107
+
108
+ // remember new url
109
+ currentUrl = $input.val();
110
+
111
+ // autosize input field
112
+ $input.trigger('autosize');
113
+
114
+ // display loading gif in input
115
+ $media.css({ backgroundImage: loadingicon });
116
+
117
+ submitVideo();
118
+ });
119
+
120
+ // Initialize autosizing the url input field, disable enter key and
121
+ // auto select content on click.
122
+ // @see http://www.jacklmoore.com/autosize
123
+ $input
124
+ .autosize()
125
+ .trigger('blur')
126
+ .keypress(function(event) {
127
+ if (13 === event.keyCode) { // enter key
128
+ event.preventDefault();
129
+ $(this).trigger('blur');
130
+ }
131
+ })
132
+ .click(function() {
133
+ $(this).select();
134
+ });
135
+
136
+
137
+ // Initialize set & remove featured image handlers.
138
+ refreshHandlers();
139
+
140
+
141
+ // WordPress 3.5 Media Manager
142
+ // @see http://www.blazersix.com/blog/wordpress-image-widget/
143
+ // @see https://github.com/blazersix/simple-image-widget/blob/master/js/simple-image-widget.js
144
+ var $control;
145
+ var mediaControl = {
146
+ // Initializes a new media manager or returns an existing frame.
147
+ // @see wp.media.featuredImage.frame()
148
+ frame: function() {
149
+ if (this._frame) {
150
+ return this._frame;
151
+ }
152
+
153
+ this._frame = wp.media({
154
+ title: $control.data('title'),
155
+ library: {
156
+ type: 'video'
157
+ },
158
+ button: {
159
+ text: $control.data('button')
160
+ },
161
+ multiple: false
162
+ });
163
+
164
+ this
165
+ ._frame.on('open', this.updateFrame)
166
+ .state('library').on('select', this.select);
167
+
168
+ return this._frame;
169
+ },
170
+
171
+ select: function() {
172
+ var selection = this.get('selection'),
173
+ returnProperty = 'url';
174
+
175
+ var target = $control.data('target');
176
+ $(target)
177
+ .val( selection.pluck( returnProperty ) )
178
+ .change()
179
+ .trigger('blur');
180
+ },
181
+
182
+ updateFrame: function() {
183
+ // Do something when the media frame is opened.
184
+ },
185
+
186
+ init: function() {
187
+ $('#wpbody').on('click', '.fvp-video-choose', function(e) {
188
+ e.preventDefault();
189
+
190
+ $control = $(this).closest('.fvp-input-wrapper');
191
+
192
+ mediaControl.frame().open();
193
+ });
194
+ }
195
+ };
196
+
197
+ mediaControl.init();
198
+ });
199
+ })(jQuery);
js/post.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){"use strict";function e(t){t.preventDefault(),a(!0)}function i(){setTimeout(n,2e3)}function a(e){e=e||!1,t.post(ajaxurl,{action:"fvp_save",id:t("#post_ID").val(),fvp_nonce:t("#fvp_nonce").val(),fvp_video:o.val(),fvp_set_featimg:e},function(e){var i=t(".fvp-current-video");r.css({backgroundImage:s}),"remove"===e.task?i.css({height:i.height()}).html("").animate({height:0}):i.css({height:"auto"}).html(e.video),t("#postimagediv .inside").html(e.img),n()},"json")}function n(){t(".fvp-set-featimg").show().click(e),t("#remove-post-thumbnail").click(i)}var o,r,s,c=fvp_post;t(document).ready(function(){o=t(".fvp-video"),r=o.siblings(".fvp-video-choose").children(".fvp-media-icon"),s=r.css("backgroundImage");var e="url('"+c.loading_gif+"')",i=o.val();o.blur(function(){o.val(t.trim(o.val())),i!==o.val()&&(i=o.val(),o.trigger("autosize"),r.css({backgroundImage:e}),a())}),o.autosize().trigger("blur").keypress(function(e){13===e.keyCode&&(e.preventDefault(),t(this).trigger("blur"))}).click(function(){t(this).select()}),n();var u,l={frame:function(){return this._frame?this._frame:(this._frame=wp.media({title:u.data("title"),library:{type:"video"},button:{text:u.data("button")},multiple:!1}),this._frame.on("open",this.updateFrame).state("library").on("select",this.select),this._frame)},select:function(){var e=this.get("selection"),i="url",a=u.data("target");t(a).val(e.pluck(i)).change().trigger("blur")},updateFrame:function(){},init:function(){t("#wpbody").on("click",".fvp-video-choose",function(e){e.preventDefault(),u=t(this).closest(".fvp-input-wrapper"),l.frame().open()})}};l.init()})}(jQuery);
js/settings.js DELETED
@@ -1,24 +0,0 @@
1
- jQuery(document).ready(function($){
2
- $('.fvp_toggle_input .fvp_toggle').bind('click change', function() {
3
- var input = $(this).closest('.fvp_toggle_input').children('.fvp_input');
4
- if ($(this).attr('checked'))
5
- input.attr('readonly', 'true').addClass('fvp_readonly');
6
- else
7
- input.removeAttr('readonly').removeClass('fvp_readonly');
8
- });
9
-
10
- $('#fvp-settings-youtube-color').click(function() {
11
- if($('#fvp-settings-youtube-color:checked').length == 1)
12
- $('#youtube_logoinput_wrapper').fadeOut('slow', function() { $(this).addClass( 'fvp_hidden'); } );
13
- else
14
- $('#youtube_logoinput_wrapper').fadeIn( 'slow', function() { $(this).removeClass('fvp_hidden'); } );
15
- });
16
-
17
- $('#fvp_help_toggle').bind( 'click', function() {
18
- $('#contextual-help-link').trigger('click');
19
- });
20
-
21
- if( $('#fvp-settings-width-auto:checked').length == 1 )
22
- $('#fvp-settings-align-1').closest('tr').hide();
23
-
24
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
license.txt CHANGED
@@ -1,280 +1,280 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 2, June 1991
3
-
4
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
- Everyone is permitted to copy and distribute verbatim copies
7
- of this license document, but changing it is not allowed.
8
-
9
- Preamble
10
-
11
- The licenses for most software are designed to take away your
12
- freedom to share and change it. By contrast, the GNU General Public
13
- License is intended to guarantee your freedom to share and change free
14
- software--to make sure the software is free for all its users. This
15
- General Public License applies to most of the Free Software
16
- Foundation's software and to any other program whose authors commit to
17
- using it. (Some other Free Software Foundation software is covered by
18
- the GNU Lesser General Public License instead.) You can apply it to
19
- your programs, too.
20
-
21
- When we speak of free software, we are referring to freedom, not
22
- price. Our General Public Licenses are designed to make sure that you
23
- have the freedom to distribute copies of free software (and charge for
24
- this service if you wish), that you receive source code or can get it
25
- if you want it, that you can change the software or use pieces of it
26
- in new free programs; and that you know you can do these things.
27
-
28
- To protect your rights, we need to make restrictions that forbid
29
- anyone to deny you these rights or to ask you to surrender the rights.
30
- These restrictions translate to certain responsibilities for you if you
31
- distribute copies of the software, or if you modify it.
32
-
33
- For example, if you distribute copies of such a program, whether
34
- gratis or for a fee, you must give the recipients all the rights that
35
- you have. You must make sure that they, too, receive or can get the
36
- source code. And you must show them these terms so they know their
37
- rights.
38
-
39
- We protect your rights with two steps: (1) copyright the software, and
40
- (2) offer you this license which gives you legal permission to copy,
41
- distribute and/or modify the software.
42
-
43
- Also, for each author's protection and ours, we want to make certain
44
- that everyone understands that there is no warranty for this free
45
- software. If the software is modified by someone else and passed on, we
46
- want its recipients to know that what they have is not the original, so
47
- that any problems introduced by others will not reflect on the original
48
- authors' reputations.
49
-
50
- Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
- program will individually obtain patent licenses, in effect making the
53
- program proprietary. To prevent this, we have made it clear that any
54
- patent must be licensed for everyone's free use or not licensed at all.
55
-
56
- The precise terms and conditions for copying, distribution and
57
- modification follow.
58
-
59
- GNU GENERAL PUBLIC LICENSE
60
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
-
62
- 0. This License applies to any program or other work which contains
63
- a notice placed by the copyright holder saying it may be distributed
64
- under the terms of this General Public License. The "Program", below,
65
- refers to any such program or work, and a "work based on the Program"
66
- means either the Program or any derivative work under copyright law:
67
- that is to say, a work containing the Program or a portion of it,
68
- either verbatim or with modifications and/or translated into another
69
- language. (Hereinafter, translation is included without limitation in
70
- the term "modification".) Each licensee is addressed as "you".
71
-
72
- Activities other than copying, distribution and modification are not
73
- covered by this License; they are outside its scope. The act of
74
- running the Program is not restricted, and the output from the Program
75
- is covered only if its contents constitute a work based on the
76
- Program (independent of having been made by running the Program).
77
- Whether that is true depends on what the Program does.
78
-
79
- 1. You may copy and distribute verbatim copies of the Program's
80
- source code as you receive it, in any medium, provided that you
81
- conspicuously and appropriately publish on each copy an appropriate
82
- copyright notice and disclaimer of warranty; keep intact all the
83
- notices that refer to this License and to the absence of any warranty;
84
- and give any other recipients of the Program a copy of this License
85
- along with the Program.
86
-
87
- You may charge a fee for the physical act of transferring a copy, and
88
- you may at your option offer warranty protection in exchange for a fee.
89
-
90
- 2. You may modify your copy or copies of the Program or any portion
91
- of it, thus forming a work based on the Program, and copy and
92
- distribute such modifications or work under the terms of Section 1
93
- above, provided that you also meet all of these conditions:
94
-
95
- a) You must cause the modified files to carry prominent notices
96
- stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in
99
- whole or in part contains or is derived from the Program or any
100
- part thereof, to be licensed as a whole at no charge to all third
101
- parties under the terms of this License.
102
-
103
- c) If the modified program normally reads commands interactively
104
- when run, you must cause it, when started running for such
105
- interactive use in the most ordinary way, to print or display an
106
- announcement including an appropriate copyright notice and a
107
- notice that there is no warranty (or else, saying that you provide
108
- a warranty) and that users may redistribute the program under
109
- these conditions, and telling the user how to view a copy of this
110
- License. (Exception: if the Program itself is interactive but
111
- does not normally print such an announcement, your work based on
112
- the Program is not required to print an announcement.)
113
-
114
- These requirements apply to the modified work as a whole. If
115
- identifiable sections of that work are not derived from the Program,
116
- and can be reasonably considered independent and separate works in
117
- themselves, then this License, and its terms, do not apply to those
118
- sections when you distribute them as separate works. But when you
119
- distribute the same sections as part of a whole which is a work based
120
- on the Program, the distribution of the whole must be on the terms of
121
- this License, whose permissions for other licensees extend to the
122
- entire whole, and thus to each and every part regardless of who wrote it.
123
-
124
- Thus, it is not the intent of this section to claim rights or contest
125
- your rights to work written entirely by you; rather, the intent is to
126
- exercise the right to control the distribution of derivative or
127
- collective works based on the Program.
128
-
129
- In addition, mere aggregation of another work not based on the Program
130
- with the Program (or with a work based on the Program) on a volume of
131
- a storage or distribution medium does not bring the other work under
132
- the scope of this License.
133
-
134
- 3. You may copy and distribute the Program (or a work based on it,
135
- under Section 2) in object code or executable form under the terms of
136
- Sections 1 and 2 above provided that you also do one of the following:
137
-
138
- a) Accompany it with the complete corresponding machine-readable
139
- source code, which must be distributed under the terms of Sections
140
- 1 and 2 above on a medium customarily used for software interchange; or,
141
-
142
- b) Accompany it with a written offer, valid for at least three
143
- years, to give any third party, for a charge no more than your
144
- cost of physically performing source distribution, a complete
145
- machine-readable copy of the corresponding source code, to be
146
- distributed under the terms of Sections 1 and 2 above on a medium
147
- customarily used for software interchange; or,
148
-
149
- c) Accompany it with the information you received as to the offer
150
- to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
- received the program in object code or executable form with such
153
- an offer, in accord with Subsection b above.)
154
-
155
- The source code for a work means the preferred form of the work for
156
- making modifications to it. For an executable work, complete source
157
- code means all the source code for all modules it contains, plus any
158
- associated interface definition files, plus the scripts used to
159
- control compilation and installation of the executable. However, as a
160
- special exception, the source code distributed need not include
161
- anything that is normally distributed (in either source or binary
162
- form) with the major components (compiler, kernel, and so on) of the
163
- operating system on which the executable runs, unless that component
164
- itself accompanies the executable.
165
-
166
- If distribution of executable or object code is made by offering
167
- access to copy from a designated place, then offering equivalent
168
- access to copy the source code from the same place counts as
169
- distribution of the source code, even though third parties are not
170
- compelled to copy the source along with the object code.
171
-
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
- except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
- void, and will automatically terminate your rights under this License.
176
- However, parties who have received copies, or rights, from you under
177
- this License will not have their licenses terminated so long as such
178
- parties remain in full compliance.
179
-
180
- 5. You are not required to accept this License, since you have not
181
- signed it. However, nothing else grants you permission to modify or
182
- distribute the Program or its derivative works. These actions are
183
- prohibited by law if you do not accept this License. Therefore, by
184
- modifying or distributing the Program (or any work based on the
185
- Program), you indicate your acceptance of this License to do so, and
186
- all its terms and conditions for copying, distributing or modifying
187
- the Program or works based on it.
188
-
189
- 6. Each time you redistribute the Program (or any work based on the
190
- Program), the recipient automatically receives a license from the
191
- original licensor to copy, distribute or modify the Program subject to
192
- these terms and conditions. You may not impose any further
193
- restrictions on the recipients' exercise of the rights granted herein.
194
- You are not responsible for enforcing compliance by third parties to
195
- this License.
196
-
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
- infringement or for any other reason (not limited to patent issues),
199
- conditions are imposed on you (whether by court order, agreement or
200
- otherwise) that contradict the conditions of this License, they do not
201
- excuse you from the conditions of this License. If you cannot
202
- distribute so as to satisfy simultaneously your obligations under this
203
- License and any other pertinent obligations, then as a consequence you
204
- may not distribute the Program at all. For example, if a patent
205
- license would not permit royalty-free redistribution of the Program by
206
- all those who receive copies directly or indirectly through you, then
207
- the only way you could satisfy both it and this License would be to
208
- refrain entirely from distribution of the Program.
209
-
210
- If any portion of this section is held invalid or unenforceable under
211
- any particular circumstance, the balance of the section is intended to
212
- apply and the section as a whole is intended to apply in other
213
- circumstances.
214
-
215
- It is not the purpose of this section to induce you to infringe any
216
- patents or other property right claims or to contest validity of any
217
- such claims; this section has the sole purpose of protecting the
218
- integrity of the free software distribution system, which is
219
- implemented by public license practices. Many people have made
220
- generous contributions to the wide range of software distributed
221
- through that system in reliance on consistent application of that
222
- system; it is up to the author/donor to decide if he or she is willing
223
- to distribute software through any other system and a licensee cannot
224
- impose that choice.
225
-
226
- This section is intended to make thoroughly clear what is believed to
227
- be a consequence of the rest of this License.
228
-
229
- 8. If the distribution and/or use of the Program is restricted in
230
- certain countries either by patents or by copyrighted interfaces, the
231
- original copyright holder who places the Program under this License
232
- may add an explicit geographical distribution limitation excluding
233
- those countries, so that distribution is permitted only in or among
234
- countries not thus excluded. In such case, this License incorporates
235
- the limitation as if written in the body of this License.
236
-
237
- 9. The Free Software Foundation may publish revised and/or new versions
238
- of the General Public License from time to time. Such new versions will
239
- be similar in spirit to the present version, but may differ in detail to
240
- address new problems or concerns.
241
-
242
- Each version is given a distinguishing version number. If the Program
243
- specifies a version number of this License which applies to it and "any
244
- later version", you have the option of following the terms and conditions
245
- either of that version or of any later version published by the Free
246
- Software Foundation. If the Program does not specify a version number of
247
- this License, you may choose any version ever published by the Free Software
248
- Foundation.
249
-
250
- 10. If you wish to incorporate parts of the Program into other free
251
- programs whose distribution conditions are different, write to the author
252
- to ask for permission. For software which is copyrighted by the Free
253
- Software Foundation, write to the Free Software Foundation; we sometimes
254
- make exceptions for this. Our decision will be guided by the two goals
255
- of preserving the free status of all derivatives of our free software and
256
- of promoting the sharing and reuse of software generally.
257
-
258
- NO WARRANTY
259
-
260
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
- REPAIR OR CORRECTION.
269
-
270
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
- POSSIBILITY OF SUCH DAMAGES.
279
-
280
- END OF TERMS AND CONDITIONS
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
lng/featured-video-plus-de_DE.mo CHANGED
Binary file
lng/featured-video-plus-de_DE.po CHANGED
@@ -1,651 +1,299 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: featured-video-plus 1.3 de_DE\n"
4
- "POT-Creation-Date: 2014-01-02 19:58+0100\n"
5
- "PO-Revision-Date: 2014-01-02 19:59+0100\n"
6
- "Last-Translator: Alexander Höreth <hello@yrnxt.com>\n"
7
- "Language-Team: a.hoereth <a.hoereth@gmail.com>\n"
8
- "Language: de_DE\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.3\n"
13
- "X-Poedit-KeywordsList: __;_e\n"
14
- "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-SearchPath-0: php\n"
17
-
18
- #: php/backend.php:31
19
- msgid "Video URL"
20
- msgstr "Video URL"
21
-
22
- #: php/backend.php:32
23
- msgid "Fallback: same video, different format"
24
- msgstr "Fallback: gleiche Video, anderes Format"
25
-
26
- #: php/backend.php:93 php/backend.php:683 php/backend.php:690
27
- #: php/backend.php:707 php/backend.php:709
28
- msgid "Featured Video"
29
- msgstr "Beitragsvideo"
30
-
31
- #: php/backend.php:124
32
- msgid "Outdated WordPress Version"
33
- msgstr "Veraltete WordPress Version"
34
-
35
- #: php/backend.php:124
36
- #, php-format
37
- msgid ""
38
- "There is WordPress 3.5 out there! The plugin supports older versions way "
39
- "back to 3.1 - but %s is defenitly to old!"
40
- msgstr ""
41
- "Es gibt schon WordPress 3.5! Das Plugin unterstützt alle Versionen ab 3.1 - "
42
- "aber %s ist wirklich zu alt!"
43
-
44
- #: php/backend.php:136
45
- msgid "Set Featured Video"
46
- msgstr "Beitragsvideo festlegen"
47
-
48
- #: php/backend.php:136
49
- msgid "Set featured video"
50
- msgstr "Beitragsvideo festlegen"
51
-
52
- #: php/backend.php:146 php/backend.php:640
53
- msgid "Supported Video Formats"
54
- msgstr "Unterstützte Videoformate"
55
-
56
- #: php/backend.php:146
57
- msgid "or"
58
- msgstr "oder"
59
-
60
- #: php/backend.php:146
61
- msgid "More information"
62
- msgstr "Mehr Informationen"
63
-
64
- #: php/backend.php:153
65
- msgid "Hint"
66
- msgstr "Hinweis"
67
-
68
- #: php/backend.php:153
69
- #, php-format
70
- msgid "Take a look into the %sContextual Help%s."
71
- msgstr "Wirf einen Blick in die %sHilfe%s."
72
-
73
- #: php/backend.php:159 php/settings.php:390
74
- msgid "Featured Image"
75
- msgstr "Beitragsbild"
76
-
77
- #: php/backend.php:159
78
- msgid ""
79
- "For automatically displaying the Featured Video a Featured Image is required."
80
- msgstr ""
81
- "Um das Artikelvideo automatisch im Theme anzeigen zu können, muss ein "
82
- "Artikelbild festgelegt werden."
83
-
84
- #: php/backend.php:164
85
- msgid "Set as Featured Image"
86
- msgstr "Als Beitragsbild festlegen"
87
-
88
- #: php/backend.php:168
89
- msgid "The current theme does not support Featured Images"
90
- msgstr "Das aktuelle Theme nutzt keine Beitragsbilder."
91
-
92
- #: php/backend.php:168
93
- #, php-format
94
- msgid ""
95
- "To display Featured Videos you need to use the <code>Shortcode</code> or "
96
- "<code>PHP functions</code>. To hide this notice deactivate &quot;<em>Replace "
97
- "Featured Images</em>&quot; in the %sMedia Settings%s."
98
- msgstr ""
99
- "Damit Beitragsvideos in deinem Theme angezeigt werden, musst du den "
100
- "<code>Shortcode</code> oder die <code>PHP-Funktionen</code> verwenden. Um "
101
- "diese Warnung zu verstecken, deaktiviere &quot;<em>Artikelbilder ersetzen</"
102
- "em>&quot; in deinen %sMedien Einstellungen%s."
103
-
104
- #: php/backend.php:634
105
- #, php-format
106
- msgid ""
107
- "To use local videos, copy the <code>Link To Media File</code> from your "
108
- "%sMedia Library%s and paste it into the text field."
109
- msgstr ""
110
- "Um lokale Videos zu nutzen, kopiere den <code>Link zur Medien-Datei</code> "
111
- "aus deiner %sMediathek%s und füge ihn in das Textfeld ein."
112
-
113
- #: php/backend.php:635
114
- msgid ""
115
- "To use local videos as Featured Videos WordPress 3.6 or higher is required."
116
- msgstr ""
117
- "Um lokale Videos als Beitragsvideos zu nutzen wird WordPress 3.6 oder höher "
118
- "benötigt."
119
-
120
- #: php/backend.php:642
121
- msgid "Converting your videos"
122
- msgstr "Videos konvertieren"
123
-
124
- #: php/backend.php:643
125
- #, php-format
126
- msgid ""
127
- "Take a look at the %sMiro Video Converter%s. It is open source, lightweight "
128
- "and compatible with Windows, Mac and Linux."
129
- msgstr ""
130
- "Schau dir den %sMiro Video Converter%s an. Er is Open Source, klein, einfach "
131
- "zu verwenden und mit Windows, Mac und Linux kompatibel."
132
-
133
- #: php/backend.php:644
134
- msgid "Fixing upload errors"
135
- msgstr "Videoupload Fehler beheben"
136
-
137
- #: php/backend.php:646
138
- #, php-format
139
- msgid ""
140
- "Read %sthis%s on how to increase the <strong>maximum file upload size</"
141
- "strong>."
142
- msgstr ""
143
- "Lies %sdas hier%s, um zu erfahren, wie man das <strong>Dateigrößenlimit</"
144
- "strong> erhöht."
145
-
146
- #: php/backend.php:651
147
- msgid ""
148
- "These are some of the tested URL formats. Everything in bold is required, "
149
- "everything in brackets is optional."
150
- msgstr ""
151
- "Das hier sind einige getestete URL Formate. Alles fettgedruckte ist "
152
- "notwendig, alles in Klammern optional."
153
-
154
- #: php/backend.php:683 php/backend.php:707
155
- msgid "Local Media"
156
- msgstr "Lokale Medien"
157
-
158
- #: php/backend.php:690 php/backend.php:709
159
- msgid "Valid URLs"
160
- msgstr "Video URLs"
161
-
162
- #: php/settings.php:21
163
- msgid "Featured Videos"
164
- msgstr "Beitragsvideos"
165
-
166
- #: php/settings.php:23
167
- msgid "Usage"
168
- msgstr "Anwendung"
169
-
170
- #: php/settings.php:24
171
- msgid "Autoplay"
172
- msgstr ""
173
-
174
- #: php/settings.php:25
175
- msgid "Video Sizing"
176
- msgstr "Videogröße"
177
-
178
- #: php/settings.php:26
179
- msgid "Video Align"
180
- msgstr "Video-Ausrichtung"
181
-
182
- #: php/settings.php:27
183
- msgid "Local Video Options"
184
- msgstr "Lokale Videos"
185
-
186
- #: php/settings.php:28
187
- msgid "YouTube Options"
188
- msgstr "YouTube Optionen"
189
-
190
- #: php/settings.php:29
191
- msgid "Vimeo Options"
192
- msgstr "Vimeo Optionen"
193
-
194
- #: php/settings.php:30
195
- msgid "Dailymotion Options"
196
- msgstr "Dailymotion Optionen"
197
-
198
- #: php/settings.php:31
199
- msgid "Support"
200
- msgstr "Support"
201
-
202
- #: php/settings.php:45
203
- #, php-format
204
- msgid ""
205
- "To display your featured videos you can either make use of the automatic "
206
- "replacement, use the %s or manually edit your theme's source files to make "
207
- "use of the plugins PHP-functions."
208
- msgstr ""
209
- "Um die Artikelvideos anzuzeigen kannst du entweder das automatische Ersetzen "
210
- "der Artikelbilder nutzen, auf den %s zurückgreifen oder manuel die PHP-"
211
- "Funktionen in deine Theme Dateien integrieren."
212
-
213
- #: php/settings.php:46
214
- #, php-format
215
- msgid ""
216
- "For more information about Shortcode and PHP functions see the %sContextual "
217
- "Help%s."
218
- msgstr ""
219
- "Für mehr Informationen über den Shortcode und die PHP-Funktionen schaue in "
220
- "die %sHilfe%s."
221
-
222
- #: php/settings.php:62
223
- msgid "Replace featured image automatically if possible"
224
- msgstr "Ersetze Artikelvideos wenn möglich"
225
-
226
- #: php/settings.php:62 php/settings.php:90 php/settings.php:112
227
- #: php/settings.php:122 php/settings.php:143
228
- msgid "default"
229
- msgstr "default"
230
-
231
- #: php/settings.php:63
232
- msgid "Open video overlay when featured image is clicked. Define width below!"
233
- msgstr ""
234
- "Öffne eine video lightbox wenn das Artikelbild angeklickt wird. Gib unten "
235
- "eine Breite an!"
236
-
237
- #: php/settings.php:64
238
- msgid "Replace featured image with video on click and auto play if possible"
239
- msgstr ""
240
- "Ersetze das Artikelbild mit dem Video wenn es angeklickt wird und spiele es "
241
- "wenn möglich sofort ab"
242
-
243
- #: php/settings.php:65
244
- msgid "None of the above: Manually use PHP-functions or shortcodes"
245
- msgstr ""
246
- "Nichts von den obenstehenden: Nutze die PHP-Funktionen oder den Shortcode"
247
-
248
- #: php/settings.php:66
249
- #, php-format
250
- msgid ""
251
- "The first three options require your theme to make use of WordPress' "
252
- "%sfeatured image%s capabilities."
253
- msgstr ""
254
- "Die ersten drei Optionen setzen voraus, dass dein Theme die WordPress' "
255
- "%sArtikelbild%s funktionen nutzt."
256
-
257
- #: php/settings.php:70
258
- msgid "The current theme does not support featured images"
259
- msgstr "Das aktuelle Theme nutzt keine Beitragsbilder"
260
-
261
- #: php/settings.php:70
262
- msgid ""
263
- "To display Featured Videos you need to use the <code>Shortcode</code> or "
264
- "<code>PHP functions</code>."
265
- msgstr ""
266
- "Um Artikelvideos anzuzeigen musst du den <code>Shortcode</code> oder die "
267
- "<code>PHP-Funktionen</code> nutzen."
268
-
269
- #: php/settings.php:86
270
- msgid "yes"
271
- msgstr "ja"
272
-
273
- #: php/settings.php:88
274
- msgid "auto"
275
- msgstr ""
276
-
277
- #: php/settings.php:90
278
- msgid "no"
279
- msgstr "nein"
280
-
281
- #: php/settings.php:109
282
- msgid "Width"
283
- msgstr "Breite"
284
-
285
- #: php/settings.php:119
286
- msgid "Height"
287
- msgstr "Höhe"
288
-
289
- #: php/settings.php:128
290
- msgid ""
291
- "When using <code>auto</code> the video will be adjusted to fit it's parent "
292
- "element while sticking to it's ratio. Using a <code>fixed</code> height and "
293
- "width might result in <em>not so pretty</em> black bars."
294
- msgstr ""
295
- "Wenn <code>auto</code> gesetzt ist, wird das jeweilige Video automatisch an "
296
- "das Elternelement angepasst. Dabei wird versucht, die Seitenverhältnisse "
297
- "beizubehalten. Feste Breite und/oder Höhe kann zu <em>nicht so schönen</em> "
298
- "schwarzen Balken führen."
299
-
300
- #: php/settings.php:142
301
- msgid "left"
302
- msgstr "links"
303
-
304
- #: php/settings.php:143
305
- msgid "center"
306
- msgstr "zentriert"
307
-
308
- #: php/settings.php:144
309
- msgid "right"
310
- msgstr "rechts"
311
-
312
- #: php/settings.php:157
313
- msgid "Use featured image as video thumbnail"
314
- msgstr "Artikelbild als video thumbnail nutzen"
315
-
316
- #: php/settings.php:158
317
- msgid "Loop videos"
318
- msgstr "Videoschleife"
319
-
320
- #: php/settings.php:179
321
- msgid "Light Theme"
322
- msgstr "Helles Design"
323
-
324
- #: php/settings.php:180
325
- msgid "Fullscreen Button"
326
- msgstr "Vollbildschalter"
327
-
328
- #: php/settings.php:188
329
- msgid "Info"
330
- msgstr "Info"
331
-
332
- #: php/settings.php:190
333
- msgid "Related Videos"
334
- msgstr "Verwandte Videos"
335
-
336
- #: php/settings.php:191
337
- msgid "Javascript API"
338
- msgstr ""
339
-
340
- #: php/settings.php:192
341
- msgid "White Progressbar"
342
- msgstr "Weißer Fortschrittsbalken"
343
-
344
- #: php/settings.php:194 php/settings.php:247
345
- msgid "Logo"
346
- msgstr "Logo"
347
-
348
- #: php/settings.php:216
349
- msgid "Portrait"
350
- msgstr "Portrait"
351
-
352
- #: php/settings.php:217
353
- msgid "Title"
354
- msgstr "Titel"
355
-
356
- #: php/settings.php:218
357
- msgid "Byline"
358
- msgstr "Author"
359
-
360
- #: php/settings.php:221
361
- msgid "Color"
362
- msgstr "Farbe"
363
-
364
- #: php/settings.php:225
365
- msgid "Vimeo Plus Videos might ignore these settings."
366
- msgstr "Vimeo Plus Videos können diese Einstellungen ignorieren."
367
-
368
- #: php/settings.php:248
369
- msgid "Videoinfo"
370
- msgstr "Videoinfo"
371
-
372
- #: php/settings.php:249
373
- msgid "Syndication Key"
374
- msgstr "Syndication Schlüssel"
375
-
376
- #: php/settings.php:253
377
- msgid "Foreground"
378
- msgstr "Vordergrund"
379
-
380
- #: php/settings.php:258
381
- msgid "Highlight"
382
- msgstr "Hervorhebung"
383
-
384
- #: php/settings.php:263
385
- msgid "Background"
386
- msgstr "Hintergrund"
387
-
388
- #: php/settings.php:280
389
- #, php-format
390
- msgid ""
391
- "If you have found a bug or are missing a specific video service, please "
392
- "%slet me know%s in the support forum. Elsewise, if you like the plugin: "
393
- "Please %srate it!%s"
394
- msgstr ""
395
- "Wenn du einen Fehler gefunden hast oder einen bestimmten Video-Anbieter "
396
- "vermisst, %ssag bescheid%s; Ansonsten, wenn dir das Plugin gefällt, bitte "
397
- "%sbewerte es!%s"
398
-
399
- #: php/settings.php:365
400
- msgid "Displays the video in its default size."
401
- msgstr "Stellt das Video in seiner Standardgröße dar."
402
-
403
- #: php/settings.php:369
404
- msgid ""
405
- "Displays the video with an width of 300 pixel. Height will be fitted to the "
406
- "aspect ratio."
407
- msgstr ""
408
- "Stellt das Video mit einer breite von 300 Pixeln dar. Die Höhe wird "
409
- "automatisch angepasst, so dass das Seitenverhältniss erhalten bleibt."
410
-
411
- #: php/settings.php:373
412
- msgid "Displays the video with an fixed width and height."
413
- msgstr "Stellt das Video mit fester Breite und Höhe dar."
414
-
415
- #: php/settings.php:387
416
- #, php-format
417
- msgid ""
418
- "All parameters are optional. If %s the current post's id will be used. %s is "
419
- "either a string keyword (thumbnail, medium, large or full) or a 2-item array "
420
- "representing width and height in pixels, e.g. array(32,32)."
421
- msgstr ""
422
- "Alle Parameter sind optional. Wenn %s gilt, wird die ID des aktuellen "
423
- "Beitrags genutzt. %s ist entweder ein String (thumbnail, medium, large oder "
424
- "full) oder ein Array mit zwei Stellen (Breite und Höhe); Zum Beispiel "
425
- "array(32,32)."
426
-
427
- #: php/settings.php:390
428
- #, php-format
429
- msgid ""
430
- "The functions are implemented corresponding to the original %sfunctions%s: "
431
- "They are intended to be used and to act the same way. Take a look into the "
432
- "WordPress Codex for further guidance:"
433
- msgstr ""
434
- "Die Funktionen sind nach den original %sFunktionen%s implementiert. Sie "
435
- "sollten genauso genutzt werden können und sich genauso verhalten. Schau dir "
436
- "für mehr Informationen den WordPress Codex an:"
437
-
438
- #: php/settings.php:413 php/settings.php:436
439
- msgid "PHP-Functions"
440
- msgstr "PHP-Funktionen"
441
-
442
- #~ msgid "Set Featured Video Fallback"
443
- #~ msgstr "Beitragsvideo-Ersatz festlegen"
444
-
445
- #~ msgid "Set featured video fallback"
446
- #~ msgstr "Beitragsvideo Fallback festlegen"
447
-
448
- #~ msgid "Fallback Video"
449
- #~ msgstr "Fallback Video"
450
-
451
- #~ msgid ""
452
- #~ "The two input fields should contain the same video but in distinct "
453
- #~ "formats."
454
- #~ msgstr ""
455
- #~ "Die zwei Eingabefelder sollen das gleiche Video in unterschiedlichen "
456
- #~ "Formaten enthalten."
457
-
458
- #~ msgid ""
459
- #~ "To use local videos, copy the <code>File URL</code> from your %sMedia "
460
- #~ "Library%s and paste it into the text field."
461
- #~ msgstr ""
462
- #~ "Um lokale Videos zu nutzen, kopiere die <code>Datei-URL</code> aus deiner "
463
- #~ "%sMediathek%s und füge sie in das Textfeld ein."
464
-
465
- #~ msgid ""
466
- #~ "The second text field is intended to hold the URL to the same video in a "
467
- #~ "different format. It will be used as fallback if the primary file can not "
468
- #~ "be played."
469
- #~ msgstr ""
470
- #~ "Das zweite Textfeld ist für eine URL zu dem gleichen Video in einem "
471
- #~ "anderen Videoformat gedacht. Dieses zweite Video wird dann als Fallback "
472
- #~ "benutzt, falls das erste Video nicht kompatibel ist."
473
-
474
- #~ msgid ""
475
- #~ "WordPress by default does not support <code>webM</code>. The plugin "
476
- #~ "activates it, but under some conditions this might not be enough. %sHere"
477
- #~ "%s you can get more information on this."
478
- #~ msgstr ""
479
- #~ "Normalerweise unterstützt WordPress kein <code>webM</code>. Das Plugin "
480
- #~ "aktiviert die unterstützung, aber manchmal reicht das noch nicht. %sHier"
481
- #~ "%s gibt es mehr Informationen."
482
-
483
- #~ msgid "Flash Fallback"
484
- #~ msgstr "Flash Fallback"
485
-
486
- #~ msgid ""
487
- #~ "The video player, %sVIDEOJS%s, features an Adobe Flash fallback. All you "
488
- #~ "need to do is provide an <code>mp4</code>-video."
489
- #~ msgstr ""
490
- #~ "Der Video Player, %sVIDEOJS%s, bietet einen Adobe Flash Fallback. Du "
491
- #~ "musst einfach nur ein <code>mp4</code>-Video einbinden."
492
-
493
- #~ msgid ""
494
- #~ "YouTube, Vimeo and Dailymotion videos can autoplay when a single post/"
495
- #~ "page is being viewed."
496
- #~ msgstr ""
497
- #~ "Wenn gesetzt, starten YouTube, Vimeo und Dailymotion Videos automatisch "
498
- #~ "wenn sie auf der Seite eines einzelnen Beitrags angezeigt werden."
499
-
500
- #~ msgid "Use CDN"
501
- #~ msgstr "Nutze CDN"
502
-
503
- #~ msgid "Include JS"
504
- #~ msgstr "JS einbinden"
505
-
506
- #~ msgid "Include CSS"
507
- #~ msgstr "CSS einbinden"
508
-
509
- #~ msgid ""
510
- #~ "Disabling JS and/or CSS will break the local video player. Disable only "
511
- #~ "when you want to replace VideoJS with a different script and know what "
512
- #~ "you are doing."
513
- #~ msgstr ""
514
- #~ "JS und/oder CSS einbindung ist für die richtige Darstellung von lokalen "
515
- #~ "Videos notwendig. Nutze diese funktionen nur wenn du VideoJS durch ein "
516
- #~ "anderes Skript austauschen willst und weißt was du tust."
517
-
518
- #~ msgid "Featured Video Plus was <strong>upgraded</strong>."
519
- #~ msgstr "Featured Video Plus wurde <strong>aktualisiert</strong>."
520
-
521
- #~ msgid ""
522
- #~ "%s brings new options for YouTube and local videos, fixes a whole bunch "
523
- #~ "of glitches and introduces a new PHP-function."
524
- #~ msgstr ""
525
- #~ "%s bringt neue Einstellungsmöglichkeiten für YouTube und lokale Videos, "
526
- #~ "behebt einige Fehler und baut eine neue PHP-Funktion ein."
527
-
528
- #~ msgid "If you like the plugin, please %srate it%s."
529
- #~ msgstr "Wenn dir das Plugin gefällt, bitte %sbewerte es%s."
530
-
531
- #~ msgid ""
532
- #~ "%s <strong>ajax</strong>ifies the Featured Video box, introduces new "
533
- #~ "options for YouTube and local videos and a new PHP-function."
534
- #~ msgstr ""
535
- #~ "In %s wurde die Featured Video box überarbeitet und unterstützt nun AJAX. "
536
- #~ "Außerdem gibt es neue Optionen in den Medieneinstellungen, besonders für "
537
- #~ "YouTube und lokale Videos."
538
-
539
- #~ msgid ""
540
- #~ "%s features a seamless <strong>WP3.5 Media Manager</strong> integration, "
541
- #~ "an all new <strong>ajax</strong>ified metabox, time-links (#t=4m2s) for "
542
- #~ "YouTube and Dailymotion, new PHP functions for developers and more."
543
- #~ msgstr ""
544
- #~ "%s integriert den <strong>WP3.5 Media Manager</strong> nahtlos, "
545
- #~ "unterstützt nun AJAX, bietet time-links für YouTube und "
546
- #~ "Dailymotion(#t=4m2s), einige neue Einstellungen und neue PHP Funktionen "
547
- #~ "für Entwickler."
548
-
549
- #~ msgid ""
550
- #~ "%s features a seamless WP3.5 Media Manager integration, an ajaxified "
551
- #~ "metabox, time-links (#t=4m2s) for YouTube and Dailymotion, more "
552
- #~ "customization settings and internationalization."
553
- #~ msgstr ""
554
- #~ "%s integriert den <strong>WP3.5 Media Manager</strong> nahtlos, bringt "
555
- #~ "AJAX, bietet time-links für YouTube und Dailymotion(#t=4m2s), mehr "
556
- #~ "Einstellungen und Internationalisierung."
557
-
558
- #~ msgid ""
559
- #~ "%s features support for <strong>Local Videos</strong>, a seamless WP3.5 "
560
- #~ "Media Manager integration, an ajaxified metabox, time-links (#t=4m2s) for "
561
- #~ "YouTube and Dailymotion and many more customization settings."
562
- #~ msgstr ""
563
- #~ "%s integriert unterstützung für <strong>lokale Videos</strong>, den neuen "
564
- #~ "WP3.5 Media Manager, eine überarbeitete AJAX-Metabox, time-links "
565
- #~ "(#t=4m2s) für YouTube und Dailymotion und viele neue "
566
- #~ "Einstellungsmöglichkeiten."
567
-
568
- #~ msgid ""
569
- #~ "Featured Video Plus is <strong>ready to use</strong>. There is a new box "
570
- #~ "on post & page edit screens for you to add videos. <strong>Take a look at "
571
- #~ "your new %sMedia Settings%s</strong>."
572
- #~ msgstr ""
573
- #~ "Featured Video Plus wurde <strong>aktiviert</strong>. Beim bearbeiten "
574
- #~ "deiner Einträge gibt es eine neue Box um Artikelvideos hinzuzufügen. "
575
- #~ "Außerdem: <strong>Schau in deine %sMedien Einstellungen%s</strong>."
576
-
577
- #~ msgid "Replace Featured Images"
578
- #~ msgstr "Beitragsbilder ersetzen"
579
-
580
- #~ msgid ""
581
- #~ "If a Featured Video is available it can be displayed in place of the "
582
- #~ "Featured Image. Still, a Featured Image is required."
583
- #~ msgstr ""
584
- #~ "Wenn ein Artikelvideo vorhanden ist kann es anstelle des Artikelbildes "
585
- #~ "angezeigt werden. Dafür muss trotzdem ein Artikelbild gesetzt sein!"
586
-
587
- #~ msgid ""
588
- #~ "The plugin logs it's version, the WordPress version and WordPress "
589
- #~ "language for internal statistics. Those help for future plugin "
590
- #~ "development."
591
- #~ msgstr ""
592
- #~ "Das Plugin speichert seine Version, die WordPress Version und WordPress "
593
- #~ "Spracheinstellung für eigene Statistiken."
594
-
595
- #~ msgid ""
596
- #~ "No personal user information is being collected. Still, you can easily "
597
- #~ "Opt-Out and have the data deleted:"
598
- #~ msgstr ""
599
- #~ "Es werden keine persönlichen Nutzerinformationen gespeichert. Wenn du "
600
- #~ "willst kannst du dich abmelden und deine Daten werden gelöscht:"
601
-
602
- #~ msgid "VIDEOJS Player Options"
603
- #~ msgstr "VIDEOJS Player Optionen"
604
-
605
- #~ msgid ""
606
- #~ "%s features more customization settings, internationalization, better "
607
- #~ "error handling and experimental LiveLeak integration."
608
- #~ msgstr ""
609
- #~ "%s integriert mehr Einstellungsmöglichkeiten, Internationalisierung, "
610
- #~ "bessere Fehlerbehandlung und experimentelle LiveLeak Integration."
611
-
612
- #~ msgid "Align"
613
- #~ msgstr "Ausrichtung"
614
-
615
- #~ msgid "Found a bug or <strong>missing a specific video service</strong>?"
616
- #~ msgstr ""
617
- #~ "Hast du einen Fehler gefunden oder <strong>fehlt dir eine bestimmte Video "
618
- #~ "Plattform</strong>?"
619
-
620
- #~ msgid "Do you like the plugin?"
621
- #~ msgstr "Gefällt dir das Plugin?"
622
-
623
- #~ msgid "rate it"
624
- #~ msgstr "bewerte es"
625
-
626
- #~ msgid ""
627
- #~ "All parameters are optional. If %s the current post's id will be used."
628
- #~ msgstr ""
629
- #~ "Alle Parameter sind optional. Wenn %s gilt, wird die ID vom aktuellen "
630
- #~ "Eintrag verwendet."
631
-
632
- #~ msgid ""
633
- #~ "Featured Video Plus was <strong>upgraded</strong>. Version <strong>%s</"
634
- #~ "strong> features more customization settings and a more dynamic admin "
635
- #~ "interface."
636
- #~ msgstr ""
637
- #~ "Version %s integriert mehr Einstellungsmöglichkeiten, "
638
- #~ "Internationalisierung, besseres Fehlerbehandlung und LiveLeak Videos "
639
- #~ "(experimentell)."
640
-
641
- #~ msgid ""
642
- #~ "Featured Video Plus was <strong>upgraded</strong>. Version <strong>%s</"
643
- #~ "strong> now supports <strong>local videos</strong> and many more "
644
- #~ "customization settings."
645
- #~ msgstr ""
646
- #~ "Version %s integriert <strong>lokale Videos</strong>, LiveLeak Videos "
647
- #~ "(experimentell), mehr Einstellungsmöglichkeiten, Internationalisierung "
648
- #~ "und besseres Fehlerbehandlung."
649
-
650
- #~ msgid "YouTube, Vimeo, Dailymotion; Local Media"
651
- #~ msgstr "Video Formate"
1
+ msgid ""
2
+ msgstr ""
3
+ "MIME-Version: 1.0\n"
4
+ "Content-Type: text/plain; charset=UTF-8\n"
5
+ "Content-Transfer-Encoding: 8bit\n"
6
+ "X-Generator: POEditor.com\n"
7
+ "Project-Id-Version: Featured Video Plus\n"
8
+ "Language: de\n"
9
+
10
+ #: php/class-backend.php:123
11
+ msgid "Featured Video"
12
+ msgstr "Beitragsvideo"
13
+
14
+ #: php/class-backend.php:165
15
+ msgid "Set Featured Video"
16
+ msgstr "Beitragsvideo festlegen"
17
+
18
+ #: php/class-backend.php:171
19
+ msgid "Video URL"
20
+ msgstr "Video URL"
21
+
22
+ #: php/class-backend.php:199
23
+ msgid "The current theme does not support Featured Images"
24
+ msgstr "Das aktuelle Theme nutzt keine Beitragsbilder."
25
+
26
+ #: php/class-backend.php:206
27
+ msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s. To hide this notice deactivate %3$sReplace Featured Images%4$s in the %5$sMedia Settings%6$s."
28
+ msgstr "Um Beitragsvideos darzustellen musst du den %1$sShortcode%2§s oder %1$sPHP-Funktionen%2$s nutzen. Um diese Warnung zu deaktivieren stell %3$sBeitragsbilder ersetzen%4$s in den %5$sMedieneinstellungen%6$s aus."
29
+
30
+ #. #-#-#-#-# featured-video-plus.pot (Featured Video Plus 1.9.2) #-#-#-#-#
31
+ #. Plugin Name of the plugin/theme
32
+ #: php/class-backend.php:568 php/class-backend.php:608
33
+ msgid "Featured Video Plus"
34
+ msgstr "Featured Video Plus"
35
+
36
+ #: php/class-backend.php:573
37
+ msgid "Take a video url from one of the %ssupported oembed providers%s and paste it into the Featured Video input field."
38
+ msgstr "Kopiere einen Video-Link von einem der %sunterstützten Anbieter%s in das Beitragsvideo-Eingabefeld."
39
+
40
+ #: php/class-backend.php:580
41
+ msgid "Alternatively you can select one of the videos from your media library using the small media icon to the right in the URL input vield. The plugin makes use of %sWordPress' native functionality%s - no gurantee for compatibility with all formats."
42
+ msgstr "Alternativ kannst du ein Video aus deiner Mediengallerie auswählen. Das Plugin nutzt die %soriginale WordPress Funktionsweise%s - keine Garantie für Kombatibilität mit allen Formaten & Geräten."
43
+
44
+ #: php/class-backend.php:588
45
+ msgid "Converting your videos"
46
+ msgstr "Videos konvertieren"
47
+
48
+ #: php/class-backend.php:592
49
+ msgid "Take a look at the %sMiro Video Converter%s. It is open source, lightweight and compatible with Windows, Mac and Linux."
50
+ msgstr "Schau dir den %sMiro Video Converter%s an. Er is Open Source, klein, einfach zu verwenden und mit Windows, Mac und Linux kompatibel."
51
+
52
+ #: php/class-backend.php:598
53
+ msgid "Fixing upload errors"
54
+ msgstr "Videoupload Fehler beheben"
55
+
56
+ #: php/class-backend.php:600
57
+ msgid "Read %sthis%s on how to increase the maximum file upload size."
58
+ msgstr "Schau dir %sdiesen Link%s an um zu erfahren wie man die maximale Upload größe erhöht."
59
+
60
+ #: php/class-backend.php:629 php/class-settings.php:39
61
+ msgid "Featured Videos"
62
+ msgstr "Beitragsvideos"
63
+
64
+ #: php/class-backend.php:631
65
+ msgid "Simply paste a URL into this input to add a bit extra life to your posts. %sTry an example%s."
66
+ msgstr "Kopier einfach eine URL in das Eingabefeld um deinen Videos ein wenig extra Leben einzuhauchen. %sProbier ein Beispiel%s."
67
+
68
+ #: php/class-backend.php:638
69
+ msgid "To adjust how featured videos are displayed on the frontend checkout the %smedia settings%s."
70
+ msgstr "Wirf einen Blick in die %sMedien-Einstellungen%s um anzupassen wie Beitragsvideos dargestellt werden."
71
+
72
+ #: php/class-backend.php:690
73
+ msgid "Featured Videos require a Featured Image for automatic replacement."
74
+ msgstr "Beitragsvideos benötigen ein Beitragsbild um automatisch dargestellt werden zu können."
75
+
76
+ #: php/class-backend.php:694
77
+ msgid "Auto set"
78
+ msgstr "Automatisch erstellen"
79
+
80
+ #: php/class-settings.php:50
81
+ msgid "Display mode"
82
+ msgstr "Modus"
83
+
84
+ #: php/class-settings.php:58
85
+ msgid "Display Conditions"
86
+ msgstr "Konditionen"
87
+
88
+ #: php/class-settings.php:68
89
+ msgid "Video Sizing"
90
+ msgstr "Videogröße"
91
+
92
+ #: php/class-settings.php:77
93
+ msgid "Video Align"
94
+ msgstr "Positionierung"
95
+
96
+ #: php/class-settings.php:86
97
+ msgid "Default Arguments"
98
+ msgstr "Parameter"
99
+
100
+ #: php/class-settings.php:95
101
+ msgid "Support"
102
+ msgstr "Support"
103
+
104
+ #: php/class-settings.php:116
105
+ msgid "To display your featured videos you can either make use of the automatic replacement, use the %s or manually edit your theme's source files to make use of the plugins PHP-functions."
106
+ msgstr "Um die Artikelvideos anzuzeigen kannst du entweder das automatische Ersetzen der Artikelbilder nutzen, auf den %s zurückgreifen oder manuel die PHP-Funktionen in deine Theme Dateien integrieren."
107
+
108
+ #: php/class-settings.php:117
109
+ msgid "For more information about Shortcode and PHP functions see the %sContextual Help%s."
110
+ msgstr "Für mehr Informationen über den Shortcode und die PHP-Funktionen schaue in die %sHilfe%s."
111
+
112
+ #: php/class-settings.php:125
113
+ msgid "The current theme does not support featured images."
114
+ msgstr "Das aktuelle Theme unterstützt keine Beitragsbilder."
115
+
116
+ #: php/class-settings.php:128
117
+ msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s."
118
+ msgstr "Um Beitragsvideos darzustellen musst du leider den %1$sShortcode%2$s oder die %1$sPHP-Funktionen%2$s nutzen."
119
+
120
+ #: php/class-settings.php:151
121
+ msgid "Replace featured image automatically."
122
+ msgstr "Beitragsbild automatisch ersetzen."
123
+
124
+ #: php/class-settings.php:152
125
+ msgid "Replace featured image on click."
126
+ msgstr "Beitragsbild bei anklicken ersetzen."
127
+
128
+ #: php/class-settings.php:153
129
+ msgid "Open video overlay when featured image is clicked."
130
+ msgstr "Video in Overlay darstellen."
131
+
132
+ #: php/class-settings.php:154
133
+ msgid "Manual: PHP-functions or shortcodes."
134
+ msgstr "Manuell: PHP-Funktionen oder Shortcode."
135
+
136
+ #: php/class-settings.php:160
137
+ msgid "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality."
138
+ msgstr "Automatische Integration (Optionen 1 bis 3) benötigen ein Theme das die nativen WordPress %sBeitragsbild%s Funktionen nutzt."
139
+
140
+ #: php/class-settings.php:177
141
+ msgid "View options are not available in manual mode."
142
+ msgstr "Darstellungsoptionen sind im manuellen Modus nicht verfügbar."
143
+
144
+ #: php/class-settings.php:190
145
+ msgid "Only when viewing %ssingle%s posts and pages."
146
+ msgstr "Nur wenn %seinzelne%s Beiträge oder Seiten gezeigt wird."
147
+
148
+ #: php/class-settings.php:195
149
+ msgid "Only on the %spost index page%s."
150
+ msgstr "Nur auf der %sBeitrags-Indexseite%s."
151
+
152
+ #: php/class-settings.php:200
153
+ msgid "Only inside the %smain query%s of each page."
154
+ msgstr "Nur im %sprimären Query%s einer jeden Seite."
155
+
156
+ #: php/class-settings.php:205
157
+ msgid "Only for %ssticky%s posts."
158
+ msgstr "Nur für %sangeheftete%s Beiträge."
159
+
160
+ #: php/class-settings.php:234
161
+ msgid "Responsive"
162
+ msgstr "Dynamisch"
163
+
164
+ #: php/class-settings.php:241
165
+ msgid "Width in pixels:"
166
+ msgstr "Breite in Pixeln:"
167
+
168
+ #: php/class-settings.php:259
169
+ msgid "The %1$sresponsive%2$s setting does not work when using the %1$soverlay%2$s display mode and might break completly in some themes - in such cases you should use a fixed width instead."
170
+ msgstr "Die %1$dynamisch%2$s Einstellung funktioniert nicht in allen Themes und speziell auch nicht im %1$sOverlay%2$s-Modus. In dem Fall muss eine absolute Breite angegeben werden."
171
+
172
+ #: php/class-settings.php:280
173
+ msgid "left"
174
+ msgstr "links"
175
+
176
+ #: php/class-settings.php:281
177
+ msgid "center"
178
+ msgstr "zentriert"
179
+
180
+ #: php/class-settings.php:282
181
+ msgid "right"
182
+ msgstr "rechts"
183
+
184
+ #: php/class-settings.php:305
185
+ msgid "Not all of the following options might be supported by all providers."
186
+ msgstr "Nicht alle der folgenden Einstellungen werden von allen Providern unterstützt."
187
+
188
+ #: php/class-settings.php:313
189
+ msgid "Autoplay"
190
+ msgstr "Automatisch Abspielen"
191
+
192
+ #: php/class-settings.php:314
193
+ msgid "Loop"
194
+ msgstr "Dauerschleife"
195
+
196
+ #: php/class-settings.php:322
197
+ msgid "If the owner of a video is a Plus member, some of these settings may be overridden by their preferences."
198
+ msgstr "Wenn der Videoeigentümer Vimeo-Plus Mitglied ist, kann er die folgenden Einstellungen für sein Video überschreiben."
199
+
200
+ #: php/class-settings.php:337
201
+ msgid "Hide user's portrait"
202
+ msgstr "Nutzerbild verbergen."
203
+
204
+ #: php/class-settings.php:341
205
+ msgid "Hide video title"
206
+ msgstr "Videotitel verbergen."
207
+
208
+ #: php/class-settings.php:345
209
+ msgid "Hide video byline"
210
+ msgstr "Erstellerzeile verbergen."
211
+
212
+ #: php/class-settings.php:358
213
+ msgid "Light theme"
214
+ msgstr "Helles Theme."
215
+
216
+ #: php/class-settings.php:362
217
+ msgid "White highlight color"
218
+ msgstr "Weiße Betonungsfarbe."
219
+
220
+ #: php/class-settings.php:364
221
+ msgid "Hide YouTube logo"
222
+ msgstr "YouTube Logo verbergen."
223
+
224
+ #: php/class-settings.php:367 php/class-settings.php:417
225
+ msgid "Hide related videos"
226
+ msgstr "Verwandte Videos verbergen."
227
+
228
+ #: php/class-settings.php:371
229
+ msgid "Disallow fullscreen"
230
+ msgstr "Vollbildmodus unterdrücken."
231
+
232
+ #: php/class-settings.php:375 php/class-settings.php:413
233
+ msgid "Hide video info"
234
+ msgstr "Videoinfo verbergen."
235
+
236
+ #: php/class-settings.php:377
237
+ msgid "Enable JavaScript API"
238
+ msgstr "JavaScript API aktivieren."
239
+
240
+ #: php/class-settings.php:409
241
+ msgid "Hide DailyMotion logo"
242
+ msgstr "DailyMotion Logo verbergen."
243
+
244
+ #: php/class-settings.php:421
245
+ msgid "Turn HD on by default"
246
+ msgstr "HD automatisch einschalten."
247
+
248
+ #: php/class-settings.php:440
249
+ msgid "If you have found a bug or think a specific feature is missing, %slet me know%s in the support forum. Like this plugin? %sRate it%s or %sbuy me a cookie%s!"
250
+ msgstr "Wenn du einen Fehler gefunden hast oder eine bestimmte Funktion vermisst, %ssag im Support-Forum Bescheid%s. Dir gefällt das Plugin? %sHinterlasse eine Bewertung%s oder %sspende für die Entwicklung%s!"
251
+
252
+ #: php/class-settings.php:570
253
+ msgid "PHP-Functions"
254
+ msgstr "PHP-Funktionen"
255
+
256
+ #: php/class-settings.php:583
257
+ msgid "All parameters are optional. If %s the current post's id will be used. %s is either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32)."
258
+ msgstr "Alle Parameter sind optional. Wenn %s gilt, wird die ID des aktuellen Beitrags genutzt. %s ist entweder ein String (thumbnail, medium, large oder full) oder ein Array mit zwei Stellen (Breite und Höhe); Zum Beispiel array(32,32)."
259
+
260
+ #: php/class-settings.php:594
261
+ msgid "The functions are implemented corresponding to the original %sfunctions%s: They are intended to be used and to act the same way. Take a look into the WordPress Codex for further guidance:"
262
+ msgstr "Die Funktionen sind nach den original %sFunktionen%s implementiert. Sie sollten genauso genutzt werden können und sich genauso verhalten. Schau dir für mehr Informationen den WordPress Codex an:"
263
+
264
+ #: php/class-settings.php:598
265
+ msgid "Featured Image"
266
+ msgstr "Beitragsbild"
267
+
268
+ #: php/class-settings.php:616
269
+ msgid "Displays the video in its default size."
270
+ msgstr "Stellt das Video in seiner Standardgröße dar."
271
+
272
+ #: php/class-settings.php:620
273
+ msgid "Displays the video with an width of 300 pixel. Height will be fitted to the aspect ratio."
274
+ msgstr "Stellt das Video mit einer Breite von 300 Pixeln dar. Die Höhe wird automatisch angepasst, so dass das Seitenverhältniss erhalten bleibt."
275
+
276
+ #: php/class-settings.php:624
277
+ msgid "Displays the video with an fixed width and height."
278
+ msgstr "Stellt das Video mit fester Breite und Höhe dar."
279
+
280
+ #. Plugin URI of the plugin/theme
281
+ #:
282
+ msgid "http://yrnxt.com/wordpress/featured-video-plus/"
283
+ msgstr "http://yrnxt.com/wordpress/featured-video-plus/"
284
+
285
+ #. Description of the plugin/theme
286
+ #:
287
+ msgid "Add Featured Videos to your posts and pages."
288
+ msgstr "Füge deinen Beiträgen und Seiten Beitragsvideos hinzu."
289
+
290
+ #. Author of the plugin/theme
291
+ #:
292
+ msgid "Alexander Höreth"
293
+ msgstr "Alexander Höreth"
294
+
295
+ #. Author URI of the plugin/theme
296
+ #:
297
+ msgid "http://yrnxt.com"
298
+ msgstr "http://yrnxt.com"
299
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lng/featured-video-plus-es_ES.mo CHANGED
Binary file
lng/featured-video-plus-es_ES.po CHANGED
@@ -1,667 +1,299 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: featured-video-plus 1.3 de_DE\n"
4
- "POT-Creation-Date: 2013-04-30 00:01+0100\n"
5
- "PO-Revision-Date: 2013-12-19 13:02+0100\n"
6
- "Last-Translator: jelena kovacevic <jecajeca260@gmail.com>\n"
7
- "Language-Team: a.hoereth <a.hoereth@gmail.com>\n"
8
- "Language: de_DE\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.3\n"
13
- "X-Poedit-KeywordsList: __;_e\n"
14
- "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-SearchPath-0: php\n"
17
-
18
- #: php/backend.php:32
19
- msgid "Video URL"
20
- msgstr "URL del vídeo"
21
-
22
- #: php/backend.php:33
23
- msgid "Fallback: same video, different format"
24
- msgstr "Fallback: Mismo video, diferente formato"
25
-
26
- #: php/backend.php:92 php/backend.php:707 php/backend.php:714
27
- #: php/backend.php:731 php/backend.php:733
28
- msgid "Featured Video"
29
- msgstr "Video destacado"
30
-
31
- #: php/backend.php:123
32
- msgid "Outdated WordPress Version"
33
- msgstr "Versión de WordPress fuera de fecha"
34
-
35
- #: php/backend.php:123
36
- #, php-format
37
- msgid ""
38
- "There is WordPress 3.5 out there! The plugin supports older versions way "
39
- "back to 3.1 - but %s is defenitly to old!"
40
- msgstr ""
41
- "¡Ya está afuera el WordPress 3.5! El plugin soporta versiones anteriores "
42
- "hasta el 3.1 - ¡pero %s es definitivamente muy viejo!"
43
-
44
- #: php/backend.php:134
45
- msgid "Set Featured Video"
46
- msgstr "Asignar Video Destacado"
47
-
48
- #: php/backend.php:134
49
- msgid "Set featured video"
50
- msgstr "Asignar video destacado"
51
-
52
- #: php/backend.php:143
53
- msgid "Set Featured Video Fallback"
54
- msgstr "Asignar Fallback de Video Destacado "
55
-
56
- #: php/backend.php:143
57
- msgid "Set featured video fallback"
58
- msgstr "Asignar fallback de video destacado "
59
-
60
- #: php/backend.php:152 php/backend.php:659
61
- msgid "Supported Video Formats"
62
- msgstr "Formatos de Video Soportados"
63
-
64
- #: php/backend.php:152
65
- msgid "or"
66
- msgstr "o"
67
-
68
- #: php/backend.php:152 php/backend.php:658
69
- msgid "More information"
70
- msgstr "Más información"
71
-
72
- #: php/backend.php:157
73
- msgid "Fallback Video"
74
- msgstr "Video de Fallback"
75
-
76
- #: php/backend.php:157
77
- msgid ""
78
- "The two input fields should contain the same video but in distinct formats."
79
- msgstr ""
80
- "Los dos campos de entrada deben contener el mismo video pero en formatos "
81
- "diferentes."
82
-
83
- #: php/backend.php:164
84
- msgid "Hint"
85
- msgstr "Pista"
86
-
87
- #: php/backend.php:164
88
- #, php-format
89
- msgid "Take a look into the %sContextual Help%s."
90
- msgstr "Eche un vistazo a la %sAyuda Contextual%s."
91
-
92
- #: php/backend.php:170 php/settings.php:401
93
- msgid "Featured Image"
94
- msgstr "Foto principal"
95
-
96
- #: php/backend.php:170
97
- msgid ""
98
- "For automatically displaying the Featured Video a Featured Image is required."
99
- msgstr ""
100
- "Para mostrar de manera automática el Video Principal una Imagen Principal es "
101
- "requerida."
102
-
103
- #: php/backend.php:175
104
- msgid "Set as Featured Image"
105
- msgstr "Establecer como imagen Principal"
106
-
107
- #: php/backend.php:179
108
- msgid "The current theme does not support Featured Images"
109
- msgstr "El tema actual no soporta Imágenes Destacadas"
110
-
111
- #: php/backend.php:179
112
- #, php-format
113
- msgid ""
114
- "To display Featured Videos you need to use the <code>Shortcode</code> or "
115
- "<code>PHP functions</code>. To hide this notice deactivate &quot;<em>Replace "
116
- "Featured Images</em>&quot; in the %sMedia Settings%s."
117
- msgstr ""
118
- "Para mostrar Videos Destacados usted necesita usar el <code>Código corto</"
119
- "code> o las <code>funciones PHP</code>. Para ocultar este mensaje desactive "
120
- "&quot;<em>Reemplazar Imágenes Destacadas</em>&quot; en %sAjustes de Media%s."
121
-
122
- #: php/backend.php:653
123
- #, php-format
124
- msgid ""
125
- "To use local videos, copy the <code>Link To Media File</code> from your "
126
- "%sMedia Library%s and paste it into the text field."
127
- msgstr ""
128
- "Para usar los videos locales, copie el <code>Link To Media File</code> desde "
129
- "su %sMedia Library%s y péguelo en el campo de texto."
130
-
131
- #: php/backend.php:654
132
- #, php-format
133
- msgid ""
134
- "To use local videos, copy the <code>File URL</code> from your %sMedia Library"
135
- "%s and paste it into the text field."
136
- msgstr ""
137
- "Para usar los videos locales, copie lal <code>File URL</code> de su %sMedia "
138
- "Library%s y péguelo en el campo de texto."
139
-
140
- #: php/backend.php:658
141
- msgid ""
142
- "The second text field is intended to hold the URL to the same video in a "
143
- "different format. It will be used as fallback if the primary file can not be "
144
- "played."
145
- msgstr ""
146
- "El segundo campo de texto está pensado para tener la URL para el mismo video "
147
- "en un formato diferente. Será usado como fallback si el archivo primario no "
148
- "puede ser reproducido."
149
-
150
- #: php/backend.php:661
151
- msgid "Converting your videos"
152
- msgstr "Convirtiendo sus videos"
153
-
154
- #: php/backend.php:662
155
- #, php-format
156
- msgid ""
157
- "Take a look at the %sMiro Video Converter%s. It is open source, lightweight "
158
- "and compatible with Windows, Mac and Linux."
159
- msgstr ""
160
- "Échele un vistazo al %sMiro Video Converter%s. Es de código abierto, de poco "
161
- "tamaño y compatible con Windows, Mac y Linux."
162
-
163
- #: php/backend.php:663
164
- msgid "Fixing upload errors"
165
- msgstr "Arreglando errores de subida"
166
-
167
- #: php/backend.php:665
168
- #, php-format
169
- msgid ""
170
- "Read %sthis%s on how to increase the <strong>maximum file upload size</"
171
- "strong>."
172
- msgstr ""
173
- "Lea %sesto%s sobre la forma de aumentar <strong>el tamaño máximo de los "
174
- "archivos subidos</strong>."
175
-
176
- #: php/backend.php:666
177
- #, php-format
178
- msgid ""
179
- "WordPress by default does not support <code>webM</code>. The plugin "
180
- "activates it, but under some conditions this might not be enough. %sHere%s "
181
- "you can get more information on this."
182
- msgstr ""
183
- "WordPress en los ajustes por defecto no soporta <code>webM</code>. El plugin "
184
- "lo activa, pero en algunas condiciones puede no ser suficiente. %sAquí%s "
185
- "usted puede ver más al respecto."
186
-
187
- #: php/backend.php:668
188
- msgid "Flash Fallback"
189
- msgstr "Fallback del Flash "
190
-
191
- #: php/backend.php:669
192
- #, php-format
193
- msgid ""
194
- "The video player, %sVIDEOJS%s, features an Adobe Flash fallback. All you "
195
- "need to do is provide an <code>mp4</code>-video."
196
- msgstr ""
197
- "El reproductor de video, %sVIDEOJS%s, tiene un fallback de Adobe Flash. Todo "
198
- "lo que usted necesita es proveer un video <code>mp4</code>."
199
-
200
- #: php/backend.php:673
201
- msgid ""
202
- "These are some of the tested URL formats. Everything in bold is required, "
203
- "everything in brackets is optional."
204
- msgstr ""
205
- "Hay algunos de los formatos de URL probados. Todo lo que está en negrita es "
206
- "obligatorio, todo lo que está en corchete es opcional."
207
-
208
- #: php/backend.php:707 php/backend.php:731
209
- msgid "Local Media"
210
- msgstr "Media local"
211
-
212
- #: php/backend.php:714 php/backend.php:733
213
- msgid "Valid URLs"
214
- msgstr "URLs válidos"
215
-
216
- #: php/settings.php:21
217
- msgid "Featured Videos"
218
- msgstr "Videos Principales"
219
-
220
- #: php/settings.php:23
221
- msgid "Usage"
222
- msgstr "Uso"
223
-
224
- #: php/settings.php:24
225
- msgid "Autoplay"
226
- msgstr "Autoplay"
227
-
228
- #: php/settings.php:25
229
- msgid "Video Sizing"
230
- msgstr "Tamaño del video"
231
-
232
- #: php/settings.php:26
233
- msgid "Video Align"
234
- msgstr "Alineación de Video"
235
-
236
- #: php/settings.php:27
237
- msgid "Local Video Options"
238
- msgstr "Opciones de video local"
239
-
240
- #: php/settings.php:28
241
- msgid "YouTube Options"
242
- msgstr "Opciones de YouTube"
243
-
244
- #: php/settings.php:29
245
- msgid "Vimeo Options"
246
- msgstr "Opciones de Video"
247
-
248
- #: php/settings.php:30
249
- msgid "Dailymotion Options"
250
- msgstr "Opciones de movimiento diario"
251
-
252
- #: php/settings.php:31
253
- msgid "Support"
254
- msgstr "Soporte"
255
-
256
- #: php/settings.php:45
257
- #, php-format
258
- msgid ""
259
- "To display your featured videos you can either make use of the automatic "
260
- "replacement, use the %s or manually edit your theme's source files to make "
261
- "use of the plugins PHP-functions."
262
- msgstr ""
263
- "Para visualizar tus videos destacados puede hacer uso de la sustitución "
264
- "automática, utilice el %s o edite manualmente los archivos de origen de su "
265
- "tema para hacer uso de los plugins de funciones de PHP."
266
-
267
- #: php/settings.php:46
268
- #, php-format
269
- msgid ""
270
- "For more information about Shortcode and PHP functions see the %sContextual "
271
- "Help%s."
272
- msgstr ""
273
- "Para más información acerca del código corto y de las funciones de PHP vea "
274
- "la %s Ayuda Contextual%s."
275
-
276
- #: php/settings.php:62
277
- msgid "Replace featured image automatically if possible"
278
- msgstr "Reemplazar la imagen principal automáticamente si es posible"
279
-
280
- #: php/settings.php:62 php/settings.php:89 php/settings.php:112
281
- #: php/settings.php:122 php/settings.php:143
282
- msgid "default"
283
- msgstr "por defecto"
284
-
285
- #: php/settings.php:63
286
- msgid "Open video overlay when featured image is clicked. Define width below!"
287
- msgstr ""
288
- "Abrir la superposición de video cuando a la imagen destacada se le hace "
289
- "clic. ¡Defina el ancho debajo!"
290
-
291
- #: php/settings.php:64
292
- msgid "Replace featured image with video on click and auto play if possible"
293
- msgstr ""
294
- "Reemplazar la imagen destacada con el video al hacer clic y con auto "
295
- "ejecución si es posible"
296
-
297
- #: php/settings.php:65
298
- msgid "None of the above: Manually use PHP-functions or shortcodes"
299
- msgstr ""
300
- "Ninguna de las anteriores: Utilice manualmente las funciones de PHP o los "
301
- "códigos cortos"
302
-
303
- #: php/settings.php:66
304
- #, php-format
305
- msgid ""
306
- "The first three options require your theme to make use of WordPress' "
307
- "%sfeatured image%s capabilities."
308
- msgstr ""
309
- "Las tres primeras opciones requieren de su tema para hacer uso de las "
310
- "capacidades de '%simagen estacada%s de WordPress."
311
-
312
- #: php/settings.php:71
313
- msgid "The current theme does not support featured images"
314
- msgstr "El tema actual no soporta imágenes principales"
315
-
316
- #: php/settings.php:71
317
- msgid ""
318
- "To display Featured Videos you need to use the <code>Shortcode</code> or "
319
- "<code>PHP functions</code>."
320
- msgstr ""
321
- "Para visualizar Videos Destacados usted necesita usar el <code>Código corto "
322
- "</code> o las <code> funciones de PHP </code>."
323
-
324
- #: php/settings.php:87
325
- msgid "yes"
326
- msgstr "sí"
327
-
328
- #: php/settings.php:89
329
- msgid "no"
330
- msgstr "no"
331
-
332
- #: php/settings.php:90
333
- msgid ""
334
- "YouTube, Vimeo and Dailymotion videos can autoplay when a single post/page "
335
- "is being viewed."
336
- msgstr ""
337
- "Los videos de YouTube, Vimeo y Dailymotion se reproducirán automáticamente "
338
- "cuando se esté viendo un post/página simple."
339
-
340
- #: php/settings.php:109
341
- msgid "Width"
342
- msgstr "Ancho"
343
-
344
- #: php/settings.php:119
345
- msgid "Height"
346
- msgstr "Largo"
347
-
348
- #: php/settings.php:128
349
- msgid ""
350
- "When using <code>auto</code> the video will be adjusted to fit it's parent "
351
- "element while sticking to it's ratio. Using a <code>fixed</code> height and "
352
- "width might result in <em>not so pretty</em> black bars."
353
- msgstr ""
354
- "Cuando se usa <code>auto</code> el video será ajustado para encajar su "
355
- "elemento padre mientras se mantiene con su radio. Usar un largo y ancho "
356
- "<code>fijo</code> puede resultar en bandas negras <em>no muy bonitas</em>."
357
-
358
- #: php/settings.php:142
359
- msgid "left"
360
- msgstr "izquierda"
361
-
362
- #: php/settings.php:143
363
- msgid "center"
364
- msgstr "centro"
365
-
366
- #: php/settings.php:144
367
- msgid "right"
368
- msgstr "derecha"
369
-
370
- #: php/settings.php:163
371
- msgid "Use CDN"
372
- msgstr "Utilice CDN"
373
-
374
- #: php/settings.php:164
375
- msgid "Include JS"
376
- msgstr "Incluir JS"
377
-
378
- #: php/settings.php:165
379
- msgid "Include CSS"
380
- msgstr "Incluir CSS"
381
-
382
- #: php/settings.php:166
383
- msgid ""
384
- "Disabling JS and/or CSS will break the local video player. Disable only when "
385
- "you want to replace VideoJS with a different script and know what you are "
386
- "doing."
387
- msgstr ""
388
- "Deshabilitar JS y CSS presentará problemas en su reproductor de video. "
389
- "Deshabilitar sólo cuando se desea reemplazar VideoJS con un script diferente "
390
- "y se sabe lo que se está haciendo."
391
-
392
- #: php/settings.php:167
393
- msgid "Use featured image as video thumbnail"
394
- msgstr "Utilice la imagen en miniatura en el video"
395
-
396
- #: php/settings.php:188
397
- msgid "Light Theme"
398
- msgstr "Tema Light"
399
-
400
- #: php/settings.php:189
401
- msgid "Fullscreen Button"
402
- msgstr "Botón de Pantalla Completa"
403
-
404
- #: php/settings.php:197
405
- msgid "Info"
406
- msgstr "Información"
407
-
408
- #: php/settings.php:199
409
- msgid "Related Videos"
410
- msgstr "Videos relacionados"
411
-
412
- #: php/settings.php:200
413
- msgid "Javascript API"
414
- msgstr "API de Javascript "
415
-
416
- #: php/settings.php:201
417
- msgid "White Progressbar"
418
- msgstr "Barra de Progreso Blanca"
419
-
420
- #: php/settings.php:203 php/settings.php:256
421
- msgid "Logo"
422
- msgstr "Logo"
423
-
424
- #: php/settings.php:225
425
- msgid "Portrait"
426
- msgstr "Retrato"
427
-
428
- #: php/settings.php:226
429
- msgid "Title"
430
- msgstr "Título"
431
-
432
- #: php/settings.php:227
433
- msgid "Byline"
434
- msgstr "Esquinado"
435
-
436
- #: php/settings.php:230
437
- msgid "Color"
438
- msgstr "Color"
439
-
440
- #: php/settings.php:234
441
- msgid "Vimeo Plus Videos might ignore these settings."
442
- msgstr "Vimeo Plus Videos puede ignorar estos ajustes."
443
-
444
- #: php/settings.php:257
445
- msgid "Videoinfo"
446
- msgstr "Información del video"
447
-
448
- #: php/settings.php:258
449
- msgid "Syndication Key"
450
- msgstr "Llave de Sindicación"
451
-
452
- #: php/settings.php:262
453
- msgid "Foreground"
454
- msgstr "Primer Plano"
455
-
456
- #: php/settings.php:267
457
- msgid "Highlight"
458
- msgstr "Destacar"
459
-
460
- #: php/settings.php:272
461
- msgid "Background"
462
- msgstr "Fondo"
463
-
464
- #: php/settings.php:289
465
- #, php-format
466
- msgid ""
467
- "If you have found a bug or are missing a specific video service, please "
468
- "%slet me know%s in the support forum. Elsewise, if you like the plugin: "
469
- "Please %srate it!%s"
470
- msgstr ""
471
- "Si usted a encontrado algún error o le falta un servicio de vídeo "
472
- "específico, por favor %shágamelo saber%s en el foro de soporte. Dígame si el "
473
- "plugin le gusta: Por favor %sevalúelo%s"
474
-
475
- #: php/settings.php:376
476
- msgid "Displays the video in its default size."
477
- msgstr "Visualizar el video en su tamaño por defecto."
478
-
479
- #: php/settings.php:380
480
- msgid ""
481
- "Displays the video with an width of 300 pixel. Height will be fitted to the "
482
- "aspect ratio."
483
- msgstr ""
484
- "Visualizar el video con un ancho de 300 pixeles. El largo puede ser definido "
485
- "en el aspect ratio."
486
-
487
- #: php/settings.php:384
488
- msgid "Displays the video with an fixed width and height."
489
- msgstr "Visualizar el video con un ancho y una altura fijos."
490
-
491
- #: php/settings.php:398
492
- #, php-format
493
- msgid ""
494
- "All parameters are optional. If %s the current post's id will be used. %s is "
495
- "either a string keyword (thumbnail, medium, large or full) or a 2-item array "
496
- "representing width and height in pixels, e.g. array(32,32)."
497
- msgstr ""
498
- "Todos los parámetros son opcionales. Si%s se utiliza el id del mensaje "
499
- "actual. %s o es una palabra clave de cadena (miniatura, medio, largo o "
500
- "completo) o una matriz de 2 elementos que representa el ancho y la altura en "
501
- "píxeles, e.j. array(32,32)."
502
-
503
- #: php/settings.php:401
504
- #, php-format
505
- msgid ""
506
- "The functions are implemented corresponding to the original %sfunctions%s: "
507
- "They are intended to be used and to act the same way. Take a look into the "
508
- "WordPress Codex for further guidance:"
509
- msgstr ""
510
- "Las funciones están implementadas correspondiendo con las %sfunciones%s "
511
- "originales: Ellas están destinadas a ser utilizadas y actuar de la misma "
512
- "manera. Eche un vistazo en el Codex de WordPress para obtener más ayuda:"
513
-
514
- #: php/settings.php:424 php/settings.php:447
515
- msgid "PHP-Functions"
516
- msgstr "Funciones de PHP"
517
-
518
- #: php/upgrade.php:164 php/upgrade.php:175 php/upgrade.php:186
519
- #: php/upgrade.php:197 php/upgrade.php:208
520
- msgid "Featured Video Plus was <strong>upgraded</strong>."
521
- msgstr "Featured Video Plus fue <strong>actualizado</strong>."
522
-
523
- #: php/upgrade.php:164
524
- #, php-format
525
- msgid ""
526
- "%s brings new options for YouTube and local videos, fixes a whole bunch of "
527
- "glitches and introduces a new PHP-function."
528
- msgstr ""
529
- "%s trae nuevas opciones para YouTube y vídeos locales, corrige un montón de "
530
- "problemas técnicos e introduce una nueva función de PHP."
531
-
532
- #: php/upgrade.php:164 php/upgrade.php:175 php/upgrade.php:186
533
- #: php/upgrade.php:197 php/upgrade.php:208
534
- #, php-format
535
- msgid "If you like the plugin, please %srate it%s."
536
- msgstr "Si le gusta este plugin, por favor %sevalúelo%s."
537
-
538
- #: php/upgrade.php:175
539
- #, php-format
540
- msgid ""
541
- "%s <strong>ajax</strong>ifies the Featured Video box, introduces new options "
542
- "for YouTube and local videos and a new PHP-function."
543
- msgstr ""
544
- "%s <strong>ajax</strong>ifies el cuadro de Video Principal, introduce nuevas "
545
- "opciones para YouTube y videos locales y una nueva función PHP."
546
-
547
- #: php/upgrade.php:186
548
- #, php-format
549
- msgid ""
550
- "%s features a seamless <strong>WP3.5 Media Manager</strong> integration, an "
551
- "all new <strong>ajax</strong>ified metabox, time-links (#t=4m2s) for YouTube "
552
- "and Dailymotion, new PHP functions for developers and more."
553
- msgstr ""
554
- "%s tiene una integración transparente con <strong>WP3.5 Media Manager</"
555
- "strong>, y una nueva meta caja <strong>ajax</strong>ified, enlaces-tiempo "
556
- "(#t=4m2s) para YouTube y Dailymotion, nuevas funciones PHP para "
557
- "desarrolladores y más."
558
-
559
- #: php/upgrade.php:197
560
- #, php-format
561
- msgid ""
562
- "%s features a seamless WP3.5 Media Manager integration, an ajaxified "
563
- "metabox, time-links (#t=4m2s) for YouTube and Dailymotion, more "
564
- "customization settings and internationalization."
565
- msgstr ""
566
- "%s tiene una integración transparente con WP3.5 Media Manager, y una nueva "
567
- "meta caja <strong>ajax</strong>ified, enlaces-tiempo (#t=4m2s) para YouTube "
568
- "y Dailymotion, más ajustes de personalización e internacionalización."
569
-
570
- #: php/upgrade.php:208
571
- #, php-format
572
- msgid ""
573
- "%s features support for <strong>Local Videos</strong>, a seamless WP3.5 "
574
- "Media Manager integration, an ajaxified metabox, time-links (#t=4m2s) for "
575
- "YouTube and Dailymotion and many more customization settings."
576
- msgstr ""
577
- "%s incluye soporte para <strong>Videos Locales</strong>, una perfecta "
578
- "integración con WP3.5 Media Manager, una meta caja ajaxified, enlaces-tiempo "
579
- "(#t=4m2s) para YouTube y Dailymotion, y muchos más ajustes de "
580
- "personalización."
581
-
582
- #: php/upgrade.php:220
583
- #, php-format
584
- msgid ""
585
- "Featured Video Plus is <strong>ready to use</strong>. There is a new box on "
586
- "post & page edit screens for you to add videos. <strong>Take a look at your "
587
- "new %sMedia Settings%s</strong>."
588
- msgstr ""
589
- "Featured Video Plus está <strong>listo para usarse</strong>. Hay un nuevo "
590
- "cuadro en sus pantallas de edición de posts y páginas para adicionar videos. "
591
- "<strong>Mire su nuevos %sAjustes de Media%s</strong>."
592
-
593
- #~ msgid "Replace Featured Images"
594
- #~ msgstr "Beitragsbilder ersetzen"
595
-
596
- #~ msgid ""
597
- #~ "If a Featured Video is available it can be displayed in place of the "
598
- #~ "Featured Image. Still, a Featured Image is required."
599
- #~ msgstr ""
600
- #~ "Wenn ein Artikelvideo vorhanden ist kann es anstelle des Artikelbildes "
601
- #~ "angezeigt werden. Dafür muss trotzdem ein Artikelbild gesetzt sein!"
602
-
603
- #~ msgid ""
604
- #~ "The plugin logs it's version, the WordPress version and WordPress "
605
- #~ "language for internal statistics. Those help for future plugin "
606
- #~ "development."
607
- #~ msgstr ""
608
- #~ "Das Plugin speichert seine Version, die WordPress Version und WordPress "
609
- #~ "Spracheinstellung für eigene Statistiken."
610
-
611
- #~ msgid ""
612
- #~ "No personal user information is being collected. Still, you can easily "
613
- #~ "Opt-Out and have the data deleted:"
614
- #~ msgstr ""
615
- #~ "Es werden keine persönlichen Nutzerinformationen gespeichert. Wenn du "
616
- #~ "willst kannst du dich abmelden und deine Daten werden gelöscht:"
617
-
618
- #~ msgid "VIDEOJS Player Options"
619
- #~ msgstr "VIDEOJS Player Optionen"
620
-
621
- #~ msgid ""
622
- #~ "%s features more customization settings, internationalization, better "
623
- #~ "error handling and experimental LiveLeak integration."
624
- #~ msgstr ""
625
- #~ "%s integriert mehr Einstellungsmöglichkeiten, Internationalisierung, "
626
- #~ "bessere Fehlerbehandlung und experimentelle LiveLeak Integration."
627
-
628
- #~ msgid "Align"
629
- #~ msgstr "Ausrichtung"
630
-
631
- #~ msgid "Found a bug or <strong>missing a specific video service</strong>?"
632
- #~ msgstr ""
633
- #~ "Hast du einen Fehler gefunden oder <strong>fehlt dir eine bestimmte Video "
634
- #~ "Plattform</strong>?"
635
-
636
- #~ msgid "Do you like the plugin?"
637
- #~ msgstr "Gefällt dir das Plugin?"
638
-
639
- #~ msgid "rate it"
640
- #~ msgstr "bewerte es"
641
-
642
- #~ msgid ""
643
- #~ "All parameters are optional. If %s the current post's id will be used."
644
- #~ msgstr ""
645
- #~ "Alle Parameter sind optional. Wenn %s gilt, wird die ID vom aktuellen "
646
- #~ "Eintrag verwendet."
647
-
648
- #~ msgid ""
649
- #~ "Featured Video Plus was <strong>upgraded</strong>. Version <strong>%s</"
650
- #~ "strong> features more customization settings and a more dynamic admin "
651
- #~ "interface."
652
- #~ msgstr ""
653
- #~ "Version %s integriert mehr Einstellungsmöglichkeiten, "
654
- #~ "Internationalisierung, besseres Fehlerbehandlung und LiveLeak Videos "
655
- #~ "(experimentell)."
656
-
657
- #~ msgid ""
658
- #~ "Featured Video Plus was <strong>upgraded</strong>. Version <strong>%s</"
659
- #~ "strong> now supports <strong>local videos</strong> and many more "
660
- #~ "customization settings."
661
- #~ msgstr ""
662
- #~ "Version %s integriert <strong>lokale Videos</strong>, LiveLeak Videos "
663
- #~ "(experimentell), mehr Einstellungsmöglichkeiten, Internationalisierung "
664
- #~ "und besseres Fehlerbehandlung."
665
-
666
- #~ msgid "YouTube, Vimeo, Dailymotion; Local Media"
667
- #~ msgstr "Video Formate"
1
+ msgid ""
2
+ msgstr ""
3
+ "MIME-Version: 1.0\n"
4
+ "Content-Type: text/plain; charset=UTF-8\n"
5
+ "Content-Transfer-Encoding: 8bit\n"
6
+ "X-Generator: POEditor.com\n"
7
+ "Project-Id-Version: Featured Video Plus\n"
8
+ "Language: es\n"
9
+
10
+ #: php/class-backend.php:123
11
+ msgid "Featured Video"
12
+ msgstr "Video destacado"
13
+
14
+ #: php/class-backend.php:165
15
+ msgid "Set Featured Video"
16
+ msgstr "Asignar Video Destacado"
17
+
18
+ #: php/class-backend.php:171
19
+ msgid "Video URL"
20
+ msgstr "URL del vídeo"
21
+
22
+ #: php/class-backend.php:199
23
+ msgid "The current theme does not support Featured Images"
24
+ msgstr "El tema actual no soporta Imágenes Destacadas"
25
+
26
+ #: php/class-backend.php:206
27
+ msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s. To hide this notice deactivate %3$sReplace Featured Images%4$s in the %5$sMedia Settings%6$s."
28
+ msgstr ""
29
+
30
+ #. #-#-#-#-# featured-video-plus.pot (Featured Video Plus 1.9.2) #-#-#-#-#
31
+ #. Plugin Name of the plugin/theme
32
+ #: php/class-backend.php:568 php/class-backend.php:608
33
+ msgid "Featured Video Plus"
34
+ msgstr ""
35
+
36
+ #: php/class-backend.php:573
37
+ msgid "Take a video url from one of the %ssupported oembed providers%s and paste it into the Featured Video input field."
38
+ msgstr ""
39
+
40
+ #: php/class-backend.php:580
41
+ msgid "Alternatively you can select one of the videos from your media library using the small media icon to the right in the URL input vield. The plugin makes use of %sWordPress' native functionality%s - no gurantee for compatibility with all formats."
42
+ msgstr ""
43
+
44
+ #: php/class-backend.php:588
45
+ msgid "Converting your videos"
46
+ msgstr "Convirtiendo sus videos"
47
+
48
+ #: php/class-backend.php:592
49
+ msgid "Take a look at the %sMiro Video Converter%s. It is open source, lightweight and compatible with Windows, Mac and Linux."
50
+ msgstr "Échele un vistazo al %sMiro Video Converter%s. Es de código abierto, de poco tamaño y compatible con Windows, Mac y Linux."
51
+
52
+ #: php/class-backend.php:598
53
+ msgid "Fixing upload errors"
54
+ msgstr "Arreglando errores de subida"
55
+
56
+ #: php/class-backend.php:600
57
+ msgid "Read %sthis%s on how to increase the maximum file upload size."
58
+ msgstr ""
59
+
60
+ #: php/class-backend.php:629 php/class-settings.php:39
61
+ msgid "Featured Videos"
62
+ msgstr "Videos Principales"
63
+
64
+ #: php/class-backend.php:631
65
+ msgid "Simply paste a URL into this input to add a bit extra life to your posts. %sTry an example%s."
66
+ msgstr ""
67
+
68
+ #: php/class-backend.php:638
69
+ msgid "To adjust how featured videos are displayed on the frontend checkout the %smedia settings%s."
70
+ msgstr ""
71
+
72
+ #: php/class-backend.php:690
73
+ msgid "Featured Videos require a Featured Image for automatic replacement."
74
+ msgstr ""
75
+
76
+ #: php/class-backend.php:694
77
+ msgid "Auto set"
78
+ msgstr ""
79
+
80
+ #: php/class-settings.php:50
81
+ msgid "Display mode"
82
+ msgstr ""
83
+
84
+ #: php/class-settings.php:58
85
+ msgid "Display Conditions"
86
+ msgstr ""
87
+
88
+ #: php/class-settings.php:68
89
+ msgid "Video Sizing"
90
+ msgstr "Tamaño del video"
91
+
92
+ #: php/class-settings.php:77
93
+ msgid "Video Align"
94
+ msgstr "Alineación de Video"
95
+
96
+ #: php/class-settings.php:86
97
+ msgid "Default Arguments"
98
+ msgstr ""
99
+
100
+ #: php/class-settings.php:95
101
+ msgid "Support"
102
+ msgstr "Soporte"
103
+
104
+ #: php/class-settings.php:116
105
+ msgid "To display your featured videos you can either make use of the automatic replacement, use the %s or manually edit your theme's source files to make use of the plugins PHP-functions."
106
+ msgstr "Para visualizar tus videos destacados puede hacer uso de la sustitución automática, utilice el %s o edite manualmente los archivos de origen de su tema para hacer uso de los plugins de funciones de PHP."
107
+
108
+ #: php/class-settings.php:117
109
+ msgid "For more information about Shortcode and PHP functions see the %sContextual Help%s."
110
+ msgstr "Para más información acerca del código corto y de las funciones de PHP vea la %s Ayuda Contextual%s."
111
+
112
+ #: php/class-settings.php:125
113
+ msgid "The current theme does not support featured images."
114
+ msgstr ""
115
+
116
+ #: php/class-settings.php:128
117
+ msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s."
118
+ msgstr ""
119
+
120
+ #: php/class-settings.php:151
121
+ msgid "Replace featured image automatically."
122
+ msgstr ""
123
+
124
+ #: php/class-settings.php:152
125
+ msgid "Replace featured image on click."
126
+ msgstr ""
127
+
128
+ #: php/class-settings.php:153
129
+ msgid "Open video overlay when featured image is clicked."
130
+ msgstr ""
131
+
132
+ #: php/class-settings.php:154
133
+ msgid "Manual: PHP-functions or shortcodes."
134
+ msgstr ""
135
+
136
+ #: php/class-settings.php:160
137
+ msgid "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality."
138
+ msgstr ""
139
+
140
+ #: php/class-settings.php:177
141
+ msgid "View options are not available in manual mode."
142
+ msgstr ""
143
+
144
+ #: php/class-settings.php:190
145
+ msgid "Only when viewing %ssingle%s posts and pages."
146
+ msgstr ""
147
+
148
+ #: php/class-settings.php:195
149
+ msgid "Only on the %spost index page%s."
150
+ msgstr ""
151
+
152
+ #: php/class-settings.php:200
153
+ msgid "Only inside the %smain query%s of each page."
154
+ msgstr ""
155
+
156
+ #: php/class-settings.php:205
157
+ msgid "Only for %ssticky%s posts."
158
+ msgstr ""
159
+
160
+ #: php/class-settings.php:234
161
+ msgid "Responsive"
162
+ msgstr ""
163
+
164
+ #: php/class-settings.php:241
165
+ msgid "Width in pixels:"
166
+ msgstr ""
167
+
168
+ #: php/class-settings.php:259
169
+ msgid "The %1$sresponsive%2$s setting does not work when using the %1$soverlay%2$s display mode and might break completly in some themes - in such cases you should use a fixed width instead."
170
+ msgstr ""
171
+
172
+ #: php/class-settings.php:280
173
+ msgid "left"
174
+ msgstr "izquierda"
175
+
176
+ #: php/class-settings.php:281
177
+ msgid "center"
178
+ msgstr "centro"
179
+
180
+ #: php/class-settings.php:282
181
+ msgid "right"
182
+ msgstr "derecha"
183
+
184
+ #: php/class-settings.php:305
185
+ msgid "Not all of the following options might be supported by all providers."
186
+ msgstr ""
187
+
188
+ #: php/class-settings.php:313
189
+ msgid "Autoplay"
190
+ msgstr "Autoplay"
191
+
192
+ #: php/class-settings.php:314
193
+ msgid "Loop"
194
+ msgstr ""
195
+
196
+ #: php/class-settings.php:322
197
+ msgid "If the owner of a video is a Plus member, some of these settings may be overridden by their preferences."
198
+ msgstr ""
199
+
200
+ #: php/class-settings.php:337
201
+ msgid "Hide user's portrait"
202
+ msgstr ""
203
+
204
+ #: php/class-settings.php:341
205
+ msgid "Hide video title"
206
+ msgstr ""
207
+
208
+ #: php/class-settings.php:345
209
+ msgid "Hide video byline"
210
+ msgstr ""
211
+
212
+ #: php/class-settings.php:358
213
+ msgid "Light theme"
214
+ msgstr ""
215
+
216
+ #: php/class-settings.php:362
217
+ msgid "White highlight color"
218
+ msgstr ""
219
+
220
+ #: php/class-settings.php:364
221
+ msgid "Hide YouTube logo"
222
+ msgstr ""
223
+
224
+ #: php/class-settings.php:367 php/class-settings.php:417
225
+ msgid "Hide related videos"
226
+ msgstr ""
227
+
228
+ #: php/class-settings.php:371
229
+ msgid "Disallow fullscreen"
230
+ msgstr ""
231
+
232
+ #: php/class-settings.php:375 php/class-settings.php:413
233
+ msgid "Hide video info"
234
+ msgstr ""
235
+
236
+ #: php/class-settings.php:377
237
+ msgid "Enable JavaScript API"
238
+ msgstr ""
239
+
240
+ #: php/class-settings.php:409
241
+ msgid "Hide DailyMotion logo"
242
+ msgstr ""
243
+
244
+ #: php/class-settings.php:421
245
+ msgid "Turn HD on by default"
246
+ msgstr ""
247
+
248
+ #: php/class-settings.php:440
249
+ msgid "If you have found a bug or think a specific feature is missing, %slet me know%s in the support forum. Like this plugin? %sRate it%s or %sbuy me a cookie%s!"
250
+ msgstr ""
251
+
252
+ #: php/class-settings.php:570
253
+ msgid "PHP-Functions"
254
+ msgstr "Funciones de PHP"
255
+
256
+ #: php/class-settings.php:583
257
+ msgid "All parameters are optional. If %s the current post's id will be used. %s is either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32)."
258
+ msgstr "Todos los parámetros son opcionales. Si%s se utiliza el id del mensaje actual. %s o es una palabra clave de cadena (miniatura, medio, largo o completo) o una matriz de 2 elementos que representa el ancho y la altura en píxeles, e.j. array(32,32)."
259
+
260
+ #: php/class-settings.php:594
261
+ msgid "The functions are implemented corresponding to the original %sfunctions%s: They are intended to be used and to act the same way. Take a look into the WordPress Codex for further guidance:"
262
+ msgstr "Las funciones están implementadas correspondiendo con las %sfunciones%s originales: Ellas están destinadas a ser utilizadas y actuar de la misma manera. Eche un vistazo en el Codex de WordPress para obtener más ayuda:"
263
+
264
+ #: php/class-settings.php:598
265
+ msgid "Featured Image"
266
+ msgstr "Foto principal"
267
+
268
+ #: php/class-settings.php:616
269
+ msgid "Displays the video in its default size."
270
+ msgstr "Visualizar el video en su tamaño por defecto."
271
+
272
+ #: php/class-settings.php:620
273
+ msgid "Displays the video with an width of 300 pixel. Height will be fitted to the aspect ratio."
274
+ msgstr "Visualizar el video con un ancho de 300 pixeles. El largo puede ser definido en el aspect ratio."
275
+
276
+ #: php/class-settings.php:624
277
+ msgid "Displays the video with an fixed width and height."
278
+ msgstr "Visualizar el video con un ancho y una altura fijos."
279
+
280
+ #. Plugin URI of the plugin/theme
281
+ #:
282
+ msgid "http://yrnxt.com/wordpress/featured-video-plus/"
283
+ msgstr ""
284
+
285
+ #. Description of the plugin/theme
286
+ #:
287
+ msgid "Add Featured Videos to your posts and pages."
288
+ msgstr ""
289
+
290
+ #. Author of the plugin/theme
291
+ #:
292
+ msgid "Alexander Höreth"
293
+ msgstr ""
294
+
295
+ #. Author URI of the plugin/theme
296
+ #:
297
+ msgid "http://yrnxt.com"
298
+ msgstr ""
299
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lng/featured-video-plus.pot CHANGED
@@ -1,392 +1,341 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: featured-video-plus 1.3\n"
4
- "POT-Creation-Date: 2014-01-02 20:31+0100\n"
5
- "PO-Revision-Date: 2014-01-02 20:31+0100\n"
6
- "Last-Translator: Alexander Höreth <hello@yrnxt.com>\n"
7
- "Language-Team: a.hoereth <a.hoereth@gmail.com>\n"
8
- "Language: en\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.3\n"
13
- "X-Poedit-KeywordsList: __;_e\n"
14
- "X-Poedit-Basepath: ..\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-SearchPath-0: php\n"
17
-
18
- #: php/backend.php:31
19
- msgid "Video URL"
20
- msgstr ""
21
-
22
- #: php/backend.php:32
23
- msgid "Fallback: same video, different format"
24
- msgstr ""
25
-
26
- #: php/backend.php:93 php/backend.php:683 php/backend.php:690
27
- #: php/backend.php:707 php/backend.php:709
28
- msgid "Featured Video"
29
- msgstr ""
30
-
31
- #: php/backend.php:124
32
- msgid "Outdated WordPress Version"
33
- msgstr ""
34
-
35
- #: php/backend.php:124
36
- #, php-format
37
- msgid ""
38
- "There is WordPress 3.5 out there! The plugin supports older versions way "
39
- "back to 3.1 - but %s is defenitly to old!"
40
- msgstr ""
41
-
42
- #: php/backend.php:136
43
- msgid "Set Featured Video"
44
- msgstr ""
45
-
46
- #: php/backend.php:136
47
- msgid "Set featured video"
48
- msgstr ""
49
-
50
- #: php/backend.php:146 php/backend.php:640
51
- msgid "Supported Video Formats"
52
- msgstr ""
53
-
54
- #: php/backend.php:146
55
- msgid "or"
56
- msgstr ""
57
-
58
- #: php/backend.php:146
59
- msgid "More information"
60
- msgstr ""
61
-
62
- #: php/backend.php:153
63
- msgid "Hint"
64
- msgstr ""
65
-
66
- #: php/backend.php:153
67
- #, php-format
68
- msgid "Take a look into the %sContextual Help%s."
69
- msgstr ""
70
-
71
- #: php/backend.php:159 php/settings.php:390
72
- msgid "Featured Image"
73
- msgstr ""
74
-
75
- #: php/backend.php:159
76
- msgid ""
77
- "For automatically displaying the Featured Video a Featured Image is required."
78
- msgstr ""
79
-
80
- #: php/backend.php:164
81
- msgid "Set as Featured Image"
82
- msgstr ""
83
-
84
- #: php/backend.php:168
85
- msgid "The current theme does not support Featured Images"
86
- msgstr ""
87
-
88
- #: php/backend.php:168
89
- #, php-format
90
- msgid ""
91
- "To display Featured Videos you need to use the <code>Shortcode</code> or "
92
- "<code>PHP functions</code>. To hide this notice deactivate &quot;<em>Replace "
93
- "Featured Images</em>&quot; in the %sMedia Settings%s."
94
- msgstr ""
95
-
96
- #: php/backend.php:634
97
- #, php-format
98
- msgid ""
99
- "To use local videos, copy the <code>Link To Media File</code> from your "
100
- "%sMedia Library%s and paste it into the text field."
101
- msgstr ""
102
-
103
- #: php/backend.php:635
104
- msgid ""
105
- "To use local videos as Featured Videos WordPress 3.6 or higher is required."
106
- msgstr ""
107
-
108
- #: php/backend.php:642
109
- msgid "Converting your videos"
110
- msgstr ""
111
-
112
- #: php/backend.php:643
113
- #, php-format
114
- msgid ""
115
- "Take a look at the %sMiro Video Converter%s. It is open source, lightweight "
116
- "and compatible with Windows, Mac and Linux."
117
- msgstr ""
118
-
119
- #: php/backend.php:644
120
- msgid "Fixing upload errors"
121
- msgstr ""
122
-
123
- #: php/backend.php:646
124
- #, php-format
125
- msgid ""
126
- "Read %sthis%s on how to increase the <strong>maximum file upload size</"
127
- "strong>."
128
- msgstr ""
129
-
130
- #: php/backend.php:651
131
- msgid ""
132
- "These are some of the tested URL formats. Everything in bold is required, "
133
- "everything in brackets is optional."
134
- msgstr ""
135
-
136
- #: php/backend.php:683 php/backend.php:707
137
- msgid "Local Media"
138
- msgstr ""
139
-
140
- #: php/backend.php:690 php/backend.php:709
141
- msgid "Valid URLs"
142
- msgstr ""
143
-
144
- #: php/settings.php:21
145
- msgid "Featured Videos"
146
- msgstr ""
147
-
148
- #: php/settings.php:23
149
- msgid "Usage"
150
- msgstr ""
151
-
152
- #: php/settings.php:24
153
- msgid "Autoplay"
154
- msgstr ""
155
-
156
- #: php/settings.php:25
157
- msgid "Video Sizing"
158
- msgstr ""
159
-
160
- #: php/settings.php:26
161
- msgid "Video Align"
162
- msgstr ""
163
-
164
- #: php/settings.php:27
165
- msgid "Local Video Options"
166
- msgstr ""
167
-
168
- #: php/settings.php:28
169
- msgid "YouTube Options"
170
- msgstr ""
171
-
172
- #: php/settings.php:29
173
- msgid "Vimeo Options"
174
- msgstr ""
175
-
176
- #: php/settings.php:30
177
- msgid "Dailymotion Options"
178
- msgstr ""
179
-
180
- #: php/settings.php:31
181
- msgid "Support"
182
- msgstr ""
183
-
184
- #: php/settings.php:45
185
- #, php-format
186
- msgid ""
187
- "To display your featured videos you can either make use of the automatic "
188
- "replacement, use the %s or manually edit your theme's source files to make "
189
- "use of the plugins PHP-functions."
190
- msgstr ""
191
-
192
- #: php/settings.php:46
193
- #, php-format
194
- msgid ""
195
- "For more information about Shortcode and PHP functions see the %sContextual "
196
- "Help%s."
197
- msgstr ""
198
-
199
- #: php/settings.php:62
200
- msgid "Replace featured image automatically if possible"
201
- msgstr ""
202
-
203
- #: php/settings.php:62 php/settings.php:90 php/settings.php:112
204
- #: php/settings.php:122 php/settings.php:143
205
- msgid "default"
206
- msgstr ""
207
-
208
- #: php/settings.php:63
209
- msgid "Open video overlay when featured image is clicked. Define width below!"
210
- msgstr ""
211
-
212
- #: php/settings.php:64
213
- msgid "Replace featured image with video on click and auto play if possible"
214
- msgstr ""
215
-
216
- #: php/settings.php:65
217
- msgid "None of the above: Manually use PHP-functions or shortcodes"
218
- msgstr ""
219
-
220
- #: php/settings.php:66
221
- #, php-format
222
- msgid ""
223
- "The first three options require your theme to make use of WordPress' "
224
- "%sfeatured image%s capabilities."
225
- msgstr ""
226
-
227
- #: php/settings.php:70
228
- msgid "The current theme does not support featured images"
229
- msgstr ""
230
-
231
- #: php/settings.php:70
232
- msgid ""
233
- "To display Featured Videos you need to use the <code>Shortcode</code> or "
234
- "<code>PHP functions</code>."
235
- msgstr ""
236
-
237
- #: php/settings.php:86
238
- msgid "yes"
239
- msgstr ""
240
-
241
- #: php/settings.php:88
242
- msgid "auto"
243
- msgstr ""
244
-
245
- #: php/settings.php:90
246
- msgid "no"
247
- msgstr ""
248
-
249
- #: php/settings.php:109
250
- msgid "Width"
251
- msgstr ""
252
-
253
- #: php/settings.php:119
254
- msgid "Height"
255
- msgstr ""
256
-
257
- #: php/settings.php:128
258
- msgid ""
259
- "When using <code>auto</code> the video will be adjusted to fit it's parent "
260
- "element while sticking to it's ratio. Using a <code>fixed</code> height and "
261
- "width might result in <em>not so pretty</em> black bars."
262
- msgstr ""
263
-
264
- #: php/settings.php:142
265
- msgid "left"
266
- msgstr ""
267
-
268
- #: php/settings.php:143
269
- msgid "center"
270
- msgstr ""
271
-
272
- #: php/settings.php:144
273
- msgid "right"
274
- msgstr ""
275
-
276
- #: php/settings.php:157
277
- msgid "Use featured image as video thumbnail"
278
- msgstr ""
279
-
280
- #: php/settings.php:158
281
- msgid "Loop videos"
282
- msgstr ""
283
-
284
- #: php/settings.php:179
285
- msgid "Light Theme"
286
- msgstr ""
287
-
288
- #: php/settings.php:180
289
- msgid "Fullscreen Button"
290
- msgstr ""
291
-
292
- #: php/settings.php:188
293
- msgid "Info"
294
- msgstr ""
295
-
296
- #: php/settings.php:190
297
- msgid "Related Videos"
298
- msgstr ""
299
-
300
- #: php/settings.php:191
301
- msgid "Javascript API"
302
- msgstr ""
303
-
304
- #: php/settings.php:192
305
- msgid "White Progressbar"
306
- msgstr ""
307
-
308
- #: php/settings.php:194 php/settings.php:247
309
- msgid "Logo"
310
- msgstr ""
311
-
312
- #: php/settings.php:216
313
- msgid "Portrait"
314
- msgstr ""
315
-
316
- #: php/settings.php:217
317
- msgid "Title"
318
- msgstr ""
319
-
320
- #: php/settings.php:218
321
- msgid "Byline"
322
- msgstr ""
323
-
324
- #: php/settings.php:221
325
- msgid "Color"
326
- msgstr ""
327
-
328
- #: php/settings.php:225
329
- msgid "Vimeo Plus Videos might ignore these settings."
330
- msgstr ""
331
-
332
- #: php/settings.php:248
333
- msgid "Videoinfo"
334
- msgstr ""
335
-
336
- #: php/settings.php:249
337
- msgid "Syndication Key"
338
- msgstr ""
339
-
340
- #: php/settings.php:253
341
- msgid "Foreground"
342
- msgstr ""
343
-
344
- #: php/settings.php:258
345
- msgid "Highlight"
346
- msgstr ""
347
-
348
- #: php/settings.php:263
349
- msgid "Background"
350
- msgstr ""
351
-
352
- #: php/settings.php:280
353
- #, php-format
354
- msgid ""
355
- "If you have found a bug or are missing a specific video service, please "
356
- "%slet me know%s in the support forum. Elsewise, if you like the plugin: "
357
- "Please %srate it!%s"
358
- msgstr ""
359
-
360
- #: php/settings.php:365
361
- msgid "Displays the video in its default size."
362
- msgstr ""
363
-
364
- #: php/settings.php:369
365
- msgid ""
366
- "Displays the video with an width of 300 pixel. Height will be fitted to the "
367
- "aspect ratio."
368
- msgstr ""
369
-
370
- #: php/settings.php:373
371
- msgid "Displays the video with an fixed width and height."
372
- msgstr ""
373
-
374
- #: php/settings.php:387
375
- #, php-format
376
- msgid ""
377
- "All parameters are optional. If %s the current post's id will be used. %s is "
378
- "either a string keyword (thumbnail, medium, large or full) or a 2-item array "
379
- "representing width and height in pixels, e.g. array(32,32)."
380
- msgstr ""
381
-
382
- #: php/settings.php:390
383
- #, php-format
384
- msgid ""
385
- "The functions are implemented corresponding to the original %sfunctions%s: "
386
- "They are intended to be used and to act the same way. Take a look into the "
387
- "WordPress Codex for further guidance:"
388
- msgstr ""
389
-
390
- #: php/settings.php:413 php/settings.php:436
391
- msgid "PHP-Functions"
392
- msgstr ""
1
+ # Copyright (C) 2015 Featured Video Plus
2
+ # This file is distributed under the same license as the Featured Video Plus package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Featured Video Plus 2.0.0\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/featured-video-"
7
+ "plus-n\n"
8
+ "POT-Creation-Date: 2015-06-01 14:09:17+00:00\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+
16
+ #: php/class-backend.php:120
17
+ msgid "Featured Video"
18
+ msgstr ""
19
+
20
+ #: php/class-backend.php:162
21
+ msgid "Set Featured Video"
22
+ msgstr ""
23
+
24
+ #: php/class-backend.php:168
25
+ msgid "Video URL"
26
+ msgstr ""
27
+
28
+ #: php/class-backend.php:196
29
+ msgid "The current theme does not support Featured Images"
30
+ msgstr ""
31
+
32
+ #: php/class-backend.php:203
33
+ msgid ""
34
+ "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP "
35
+ "functions%2$s. To hide this notice deactivate %3$sReplace Featured Images"
36
+ "%4$s in the %5$sMedia Settings%6$s."
37
+ msgstr ""
38
+
39
+ #: php/class-backend.php:564 php/class-settings.php:38
40
+ msgid "Featured Videos"
41
+ msgstr ""
42
+
43
+ #: php/class-backend.php:566
44
+ msgid ""
45
+ "Simply paste a URL into this input to add a bit extra life to your posts. "
46
+ "%sTry an example%s."
47
+ msgstr ""
48
+
49
+ #: php/class-backend.php:573
50
+ msgid ""
51
+ "To adjust how featured videos are displayed on the frontend checkout the "
52
+ "%smedia settings%s."
53
+ msgstr ""
54
+
55
+ #: php/class-backend.php:625
56
+ msgid "Featured Videos require a Featured Image for automatic replacement."
57
+ msgstr ""
58
+
59
+ #: php/class-backend.php:629
60
+ msgid "Auto set"
61
+ msgstr ""
62
+
63
+ #. #-#-#-#-# featured-video-plus.pot (Featured Video Plus 2.0.0) #-#-#-#-#
64
+ #. Plugin Name of the plugin/theme
65
+ #: php/class-help.php:23
66
+ msgid "Featured Video Plus"
67
+ msgstr ""
68
+
69
+ #: php/class-help.php:31
70
+ msgid ""
71
+ "Take a video url from one of the %ssupported oembed providers%s and paste it "
72
+ "into the Featured Video input field."
73
+ msgstr ""
74
+
75
+ #: php/class-help.php:41
76
+ msgid ""
77
+ "Alternatively you can select one of the videos from your media library using "
78
+ "the small media icon to the right in the URL input field. The plugin makes "
79
+ "use of %sWordPress' native HTML5 video functionality%s - no gurantee for "
80
+ "compatibility with all formats."
81
+ msgstr ""
82
+
83
+ #: php/class-help.php:52
84
+ msgid "Fixing upload errors"
85
+ msgstr ""
86
+
87
+ #: php/class-help.php:58
88
+ msgid "Read %sthis%s on how to increase the maximum file upload size."
89
+ msgstr ""
90
+
91
+ #: php/class-help.php:82
92
+ msgid "PHP-Functions"
93
+ msgstr ""
94
+
95
+ #: php/class-help.php:104
96
+ msgctxt ""
97
+ "%1$s is a boolean condition, \\\"post_id == null\\\", %2$s is a PHP "
98
+ "variable, %2$s is a list of strings in paranthesis."
99
+ msgid ""
100
+ "All parameters are optional. If %1$s the current post's id will be used. "
101
+ "%2$s is either a string %2$s or a 2-item array representing width and height "
102
+ "in pixels, e.g. array(32,32)."
103
+ msgstr ""
104
+
105
+ #: php/class-help.php:111
106
+ msgid "or"
107
+ msgstr ""
108
+
109
+ #: php/class-help.php:115
110
+ msgid ""
111
+ "The functions are implemented corresponding to the original %sfunctions%s: "
112
+ "They are intended to be used and to act the same way. Take a look into the "
113
+ "WordPress Codex for further guidance:"
114
+ msgstr ""
115
+
116
+ #: php/class-help.php:119
117
+ msgid "Featured Image"
118
+ msgstr ""
119
+
120
+ #: php/class-help.php:143
121
+ msgid "Featured Video Plus: Shortcode"
122
+ msgstr ""
123
+
124
+ #: php/class-help.php:156
125
+ msgid "Displays the video in its default size."
126
+ msgstr ""
127
+
128
+ #: php/class-help.php:160
129
+ msgid ""
130
+ "Displays the video with a width of 300 pixel. Height will be fitted such "
131
+ "that the aspect ratio is preserved."
132
+ msgstr ""
133
+
134
+ #: php/class-help.php:164
135
+ msgid "Displays the video with a fixed width and height."
136
+ msgstr ""
137
+
138
+ #: php/class-settings.php:49
139
+ msgid "Display mode"
140
+ msgstr ""
141
+
142
+ #: php/class-settings.php:57
143
+ msgid "Display Conditions"
144
+ msgstr ""
145
+
146
+ #: php/class-settings.php:67
147
+ msgid "Video Sizing"
148
+ msgstr ""
149
+
150
+ #: php/class-settings.php:76
151
+ msgid "Video Align"
152
+ msgstr ""
153
+
154
+ #: php/class-settings.php:85
155
+ msgid "Default Arguments"
156
+ msgstr ""
157
+
158
+ #: php/class-settings.php:94
159
+ msgid "Support"
160
+ msgstr ""
161
+
162
+ #: php/class-settings.php:115
163
+ msgid ""
164
+ "To display your featured videos you can either make use of the automatic "
165
+ "replacement, use the %s or manually edit your theme's source files to make "
166
+ "use of the plugins PHP-functions."
167
+ msgstr ""
168
+
169
+ #: php/class-settings.php:116
170
+ msgid ""
171
+ "For more information about Shortcode and PHP functions see the %sContextual "
172
+ "Help%s."
173
+ msgstr ""
174
+
175
+ #: php/class-settings.php:124
176
+ msgid "The current theme does not support featured images."
177
+ msgstr ""
178
+
179
+ #: php/class-settings.php:127
180
+ msgid ""
181
+ "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP "
182
+ "functions%2$s."
183
+ msgstr ""
184
+
185
+ #: php/class-settings.php:150
186
+ msgid "Replace featured image automatically."
187
+ msgstr ""
188
+
189
+ #: php/class-settings.php:151
190
+ msgid "Replace featured image on click."
191
+ msgstr ""
192
+
193
+ #: php/class-settings.php:152
194
+ msgid "Open video overlay when featured image is clicked."
195
+ msgstr ""
196
+
197
+ #: php/class-settings.php:153
198
+ msgid "Manual: PHP-functions or shortcodes."
199
+ msgstr ""
200
+
201
+ #: php/class-settings.php:159
202
+ msgid ""
203
+ "Automatic integration (options 1-3) requires your theme to make use of "
204
+ "WordPress' native %sfeatured image%s functionality."
205
+ msgstr ""
206
+
207
+ #: php/class-settings.php:176
208
+ msgid "View options are not available in manual mode."
209
+ msgstr ""
210
+
211
+ #: php/class-settings.php:189
212
+ msgid "Only when viewing %ssingle%s posts and pages."
213
+ msgstr ""
214
+
215
+ #: php/class-settings.php:194
216
+ msgid "Only on the %spost index page%s."
217
+ msgstr ""
218
+
219
+ #: php/class-settings.php:199
220
+ msgid "Only inside the %smain query%s of each page."
221
+ msgstr ""
222
+
223
+ #: php/class-settings.php:204
224
+ msgid "Only for %ssticky%s posts."
225
+ msgstr ""
226
+
227
+ #: php/class-settings.php:232
228
+ msgid "Responsive"
229
+ msgstr ""
230
+
231
+ #: php/class-settings.php:239
232
+ msgid "Width in pixels:"
233
+ msgstr ""
234
+
235
+ #: php/class-settings.php:256
236
+ msgid ""
237
+ "The %1$sresponsive%2$s setting does not work when using the %1$soverlay%2$s "
238
+ "display mode and might break completly in some themes - in such cases you "
239
+ "should use a fixed width instead."
240
+ msgstr ""
241
+
242
+ #: php/class-settings.php:277
243
+ msgid "left"
244
+ msgstr ""
245
+
246
+ #: php/class-settings.php:278
247
+ msgid "center"
248
+ msgstr ""
249
+
250
+ #: php/class-settings.php:279
251
+ msgid "right"
252
+ msgstr ""
253
+
254
+ #: php/class-settings.php:302
255
+ msgid "Not all of the following options might be supported by all providers."
256
+ msgstr ""
257
+
258
+ #: php/class-settings.php:310
259
+ msgid "Autoplay"
260
+ msgstr ""
261
+
262
+ #: php/class-settings.php:311
263
+ msgid "Loop"
264
+ msgstr ""
265
+
266
+ #: php/class-settings.php:319
267
+ msgid ""
268
+ "If the owner of a video is a Plus member, some of these settings may be "
269
+ "overridden by their preferences."
270
+ msgstr ""
271
+
272
+ #: php/class-settings.php:334
273
+ msgid "Hide user's portrait"
274
+ msgstr ""
275
+
276
+ #: php/class-settings.php:338
277
+ msgid "Hide video title"
278
+ msgstr ""
279
+
280
+ #: php/class-settings.php:342
281
+ msgid "Hide video byline"
282
+ msgstr ""
283
+
284
+ #: php/class-settings.php:355
285
+ msgid "Light theme"
286
+ msgstr ""
287
+
288
+ #: php/class-settings.php:359
289
+ msgid "White highlight color"
290
+ msgstr ""
291
+
292
+ #: php/class-settings.php:361
293
+ msgid "Hide YouTube logo"
294
+ msgstr ""
295
+
296
+ #: php/class-settings.php:364 php/class-settings.php:414
297
+ msgid "Hide related videos"
298
+ msgstr ""
299
+
300
+ #: php/class-settings.php:368
301
+ msgid "Disallow fullscreen"
302
+ msgstr ""
303
+
304
+ #: php/class-settings.php:372 php/class-settings.php:410
305
+ msgid "Hide video info"
306
+ msgstr ""
307
+
308
+ #: php/class-settings.php:374
309
+ msgid "Enable JavaScript API"
310
+ msgstr ""
311
+
312
+ #: php/class-settings.php:406
313
+ msgid "Hide DailyMotion logo"
314
+ msgstr ""
315
+
316
+ #: php/class-settings.php:418
317
+ msgid "Turn HD on by default"
318
+ msgstr ""
319
+
320
+ #: php/class-settings.php:437
321
+ msgid ""
322
+ "If you have found a bug or think a specific feature is missing, %slet me know"
323
+ "%s in the support forum. Like this plugin? %sRate it%s or %sbuy me a cookie"
324
+ "%s!"
325
+ msgstr ""
326
+
327
+ #. Plugin URI of the plugin/theme
328
+ msgid "http://yrnxt.com/wordpress/featured-video-plus/"
329
+ msgstr ""
330
+
331
+ #. Description of the plugin/theme
332
+ msgid "Add Featured Videos to your posts and pages."
333
+ msgstr ""
334
+
335
+ #. Author of the plugin/theme
336
+ msgid "Alexander Höreth"
337
+ msgstr ""
338
+
339
+ #. Author URI of the plugin/theme
340
+ msgid "http://yrnxt.com"
341
+ msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
php/backend.php DELETED
@@ -1,763 +0,0 @@
1
- <?php
2
- /**
3
- * Class containing functions required WordPress administration panels. Metabox on post/page edit views and options section under settings->media.
4
- *
5
- * @author ahoereth
6
- * @see ../featured_video_plus.php
7
- * @see featured_video_plus in general.php
8
- * @since 1.0
9
- *
10
- * @param featured_video_plus instance
11
- */
12
- class featured_video_plus_backend {
13
- private $featured_video_plus;
14
- private $default_value;
15
- private $default_value_sec;
16
- private $help_localmedia;
17
- private $help_urls;
18
-
19
- /**
20
- * Creates a new instance of this class, saves the featured_video_instance and default value for the meta box input.
21
- *
22
- * @since 1.0
23
- *
24
- * @param featured_video_plus_instance required, dies without
25
- */
26
- function __construct( $featured_video_plus_instance ){
27
- if ( !isset($featured_video_plus_instance) )
28
- wp_die( 'featured_video_plus general instance required!', 'Error!' );
29
-
30
- $this->featured_video_plus = $featured_video_plus_instance;
31
- $this->default_value = __('Video URL', 'featured-video-plus');
32
- $this->default_value_sec = __('Fallback: same video, different format', 'featured-video-plus');
33
- }
34
-
35
- /**
36
- * Enqueue all scripts and styles needed when viewing the backend.
37
- *
38
- * @see http://codex.wordpress.org/Function_Reference/wp_style_is
39
- * @see http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
40
- * @see http://ottopress.com/2010/passing-parameters-from-php-to-javascripts-in-plugins/
41
- * @see http://codex.wordpress.org/Function_Reference/wp_localize_script
42
- * @since 1.0
43
- */
44
- public function enqueue($hook_suffix) {
45
- $min = SCRIPT_DEBUG ? '' : '.min';
46
- // just required on options-media.php and would produce errors pre WordPress 3.1
47
- if( ($hook_suffix == 'options-media.php') && (get_bloginfo('version') >= 3.1) ) {
48
- if( wp_style_is( 'wp-color-picker', 'registered' ) ) {
49
- // >=WP3.5
50
- wp_enqueue_style( 'wp-color-picker' );
51
- wp_enqueue_script( 'fvp_backend_35', FVP_URL . 'js/backend_35.js', array( 'wp-color-picker', 'jquery' ), FVP_VERSION );
52
- } else {
53
- // <WP3.5, fallback for the new WordPress Color Picker which was added in 3.5
54
- wp_enqueue_style( 'farbtastic' );
55
- wp_enqueue_script( 'farbtastic' );
56
- wp_enqueue_script( 'fvp_backend_pre35', FVP_URL . 'js/backend_pre35.js', array( 'jquery' ), FVP_VERSION );
57
- }
58
- wp_enqueue_script( 'fvp_settings', FVP_URL . 'js/settings.js', array( 'jquery' ), FVP_VERSION );
59
- }
60
-
61
- // just required on post.php and post-new.php
62
- if( ($hook_suffix == 'post.php' && isset($_GET['post'])) || $hook_suffix == 'post-new.php' ) {
63
- wp_enqueue_script( 'jquery.autosize', FVP_URL . "js/jquery.autosize$min.js", array( 'jquery' ), FVP_VERSION );
64
- wp_enqueue_script( 'fvp_backend', FVP_URL . "js/backend$min.js", array( 'jquery','jquery.autosize' ), FVP_VERSION );
65
-
66
- wp_enqueue_style( 'wp-mediaelement' );
67
- wp_enqueue_script( 'wp-mediaelement' );
68
-
69
- $options = get_option('fvp-settings');
70
- $upload_dir = wp_upload_dir();
71
- wp_localize_script( 'fvp_backend', 'fvp_backend_data', array(
72
- 'wp_upload_dir' => $upload_dir['baseurl'],
73
- 'loading_gif' => get_admin_url(null,'images/loading.gif'),
74
- 'default_value' => $this->default_value,
75
- 'default_value_sec' => $this->default_value_sec,
76
- 'wp_35' => get_bloginfo('version') >= 3.5
77
- ) );
78
- }
79
-
80
- if( $hook_suffix == 'options-media.php' || (($hook_suffix == 'post.php' && isset($_GET['post'])) || $hook_suffix == 'post-new.php') )
81
- wp_enqueue_style( 'fvp_backend', FVP_URL . "css/backend$min.css", array(), FVP_VERSION );
82
- }
83
-
84
- /**
85
- * Registers the metabox on post/page edit views.
86
- *
87
- * @since 1.0
88
- */
89
- function metabox_register() {
90
- $post_types = get_post_types(array("public" => true));
91
- foreach ($post_types as $post_type) {
92
- if($post_type != 'attachment')
93
- add_meta_box("featured_video_plus-box", __('Featured Video', 'featured-video-plus'), array( &$this, 'metabox_content' ), $post_type, 'side', 'core');
94
- }
95
- }
96
-
97
- /**
98
- * Callback function of the metabox; generates the HTML content.
99
- *
100
- * @since 1.0
101
- */
102
- function metabox_content() {
103
- wp_nonce_field( FVP_NAME, 'fvp_nonce');
104
-
105
- if( isset($_GET['post']) )
106
- $post_id = $_GET['post'];
107
- else
108
- $post_id = $GLOBALS['post']->ID;
109
-
110
- // required for conditionals
111
- $tmp1 = get_post_thumbnail_id($post_id);
112
- $tmp2 = get_post_meta( $tmp1, '_fvp_image', true);
113
- $has_featimg = empty($tmp1) ? false : true;
114
- $featimg_is_fvp = empty($tmp2) ? false : true;
115
- $has_post_video = has_post_video($post_id);
116
-
117
- $options = get_option( 'fvp-settings' );
118
- $meta = get_post_meta($post_id, '_fvp_video', true);
119
-
120
- echo "\n\n\n<!-- Featured Video Plus Metabox -->\n";
121
-
122
- // WordPress Version not supported error
123
- if( get_bloginfo('version') < 3.1 )
124
- printf ('<div class="fvp_warning"><p class="description"><strong>'.__('Outdated WordPress Version', 'featured-video-plus').':</strong>&nbsp'.__('There is WordPress 3.5 out there! The plugin supports older versions way back to 3.1 - but %s is defenitly to old!', 'featured-video-plus').'</p></div>', get_bloginfo('version') );
125
-
126
- // current featured video
127
- $hide = $has_post_video ? '' : ' height:0px;';
128
- echo '<div id="fvp_current_video" style="background: no-repeat center center;'.$hide.'">'; //url(\''.get_admin_url(null,'images/loading.gif').'\')
129
- if( $has_post_video )
130
- echo get_the_post_video( $post_id, array(256,144) );
131
- echo '</div>'."\n\n";
132
-
133
- // input box containing the featured video URL
134
- $legal= isset($meta['valid']) && !$meta['valid'] && isset($meta['full']) && !empty($meta['full']) ? ' fvp_invalid' : '';
135
- $full = isset($meta['prov']) && $meta['prov'] == 'local' ? wp_get_attachment_url($meta['id']) : isset($meta['full']) ? $meta['full'] : $this->default_value;
136
- echo '<div class="fvp_input_wrapper" data-title="'.__('Set Featured Video', 'featured-video-plus').'" data-button="'.__('Set featured video', 'featured-video-plus').'" data-target="#fvp_video">'."\n\t";
137
- echo '<textarea class="fvp_input'.$legal.'" id="fvp_video" name="fvp_video" type="text">' . $full . '</textarea>' . "\n\t";
138
- echo '<input type="hidden" class="fvp_mirror" value="'.$full."\" />\n\t";
139
-
140
- $style = get_bloginfo('version') >= 3.5 ? 'style="background-image: url(\''.get_bloginfo('wpurl').'/wp-admin/images/media-button.png\');"': '';
141
- echo '<a href="#" class="fvp_video_choose"><span class="fvp_media_icon"'.$style.'></span></a>'."\n";
142
- echo "</div>\n";
143
-
144
- // local video format warning
145
- echo '<div id="fvp_localvideo_format_warning" class="fvp_warning fvp_hidden">'."\n\t".'<p class="description">'."\n\t\t";
146
- echo '<span style="font-weight: bold;">'.__('Supported Video Formats', 'featured-video-plus').':</span> <code>mp4</code>, <code>webM</code>, <code>m4v</code>, <code>wmv</code>, <code>flv</code> '.__('or', 'featured-video-plus').' <code>ogv</code>. <a href="http://wordpress.org/extend/plugins/featured-video-plus/faq/">'.__('More information', 'featured-video-plus').'</a>.';
147
- echo "\n\t</p>\n</div>\n";
148
-
149
- // how to use a local videos notice
150
- $wrap = get_bloginfo('version') >= 3.3 ? '-wrap' : '';
151
- $class = isset($meta['full']) && !empty($meta['full']) && isset($meta['valid']) && $meta['valid'] ? ' fvp_hidden' : '';
152
- echo "<div id=\"fvp_help_notice\" class=\"fvp_notice".$class."\">\n\t<p class=\"description\">\n\t\t";
153
- echo '<span style="font-weight: bold;">'.__('Hint', 'featured-video-plus').':</span>&nbsp;'.sprintf(__('Take a look into the %sContextual Help%s.', 'featured-video-plus'), '<a href="#contextual-help'.$wrap.'" id="fvp_help_toggle">', '</a>');
154
- echo "\n\t</p>\n</div>\n";
155
-
156
- // no featured image warning
157
- $class = $has_featimg || !$has_post_video || (isset($options['usage']) && $options['usage'] == 'manual') ? ' fvp_hidden' : '';
158
- echo '<div id="fvp_featimg_warning" class="fvp_notice'.$class.'">'."\n\t".'<p class="description">';
159
- echo '<span style="font-weight: bold;">'.__('Featured Image').':</span>&nbsp;'.__('For automatically displaying the Featured Video a Featured Image is required.', 'featured-video-plus');
160
- echo "</p>\n</div>\n";
161
-
162
- // set as featured image
163
- $class = isset($meta['prov']) && $meta['prov'] == 'local' || !$has_post_video || ($has_featimg && $featimg_is_fvp) ? ' class="fvp_hidden"' : '';
164
- printf('<p id="fvp_set_featimg_box"'.$class.'>'."\n\t".'<span id="fvp_set_featimg_input">'."\n\t\t".'<input id="fvp_set_featimg" name="fvp_set_featimg" type="checkbox" value="set_featimg" />'."\n\t\t".'<label for="fvp_set_featimg">&nbsp;%s</label>'."\n\t".'</span>'."\n\t".'<a class="fvp_hidden" id="fvp_set_featimg_link" href="#">%s</a>'."\n".'</p>'."\n", __('Set as Featured Image', 'featured-video-plus'), __('Set as Featured Image', 'featured-video-plus') );
165
-
166
- // current theme does not support Featured Images
167
- if( !current_theme_supports('post-thumbnails') && $options['usage'] != 'manual' )
168
- echo '<p class="fvp_warning description"><span style="font-weight: bold;">'.__('The current theme does not support Featured Images', 'featured-video-plus').':</span>&nbsp;'.sprintf(__('To display Featured Videos you need to use the <code>Shortcode</code> or <code>PHP functions</code>. To hide this notice deactivate &quot;<em>Replace Featured Images</em>&quot; in the %sMedia Settings%s.', 'featured-video-plus'), '<a href="'.get_admin_url(null, '/options-media.php').'">', '</a>' )."</p>\n\n";
169
-
170
- echo "<!-- Featured Video Plus Metabox End-->\n\n\n";
171
- }
172
-
173
- /**
174
- * Saves the changes made in the metabox: Splits URL in its parts, saves provider and id, pulls the screen capture, adds it to the gallery and as featured image.
175
- *
176
- * @since 1.0
177
- *
178
- * @param int $post_id
179
- */
180
- public function metabox_save($post_id){
181
-
182
- if (( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || // Autosave, do nothing
183
- ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || // AJAX? Not used here
184
- ( !current_user_can( 'edit_post', $post_id ) ) || // Check user permissions
185
- ( false !== wp_is_post_revision( $post_id ) ) // Return if it's a post revision
186
- ) return;
187
-
188
- $post = array(
189
- 'id' => $post_id,
190
- 'fvp_nonce' => isset($_POST['fvp_nonce']) ? $_POST['fvp_nonce'] : '',
191
- 'fvp_set_featimg' => isset($_POST['fvp_set_featimg']) ? $_POST['fvp_set_featimg'] : '',
192
- 'fvp_video' => isset($_POST['fvp_video']) ? $_POST['fvp_video'] : '',
193
- 'fvp_sec' => isset($_POST['fvp_sec']) ? $_POST['fvp_sec'] : ''
194
- );
195
- $this->save($post);
196
-
197
- return;
198
- }
199
-
200
- public function ajax() {
201
- $post = array(
202
- 'id' => $_POST['id'],
203
- 'fvp_nonce' => isset($_POST['fvp_nonce']) ? $_POST['fvp_nonce'] : '',
204
- 'fvp_set_featimg' => isset($_POST['fvp_set_featimg']) ? $_POST['fvp_set_featimg'] : '',
205
- 'fvp_video' => isset($_POST['fvp_video']) ? $_POST['fvp_video'] : '',
206
- 'fvp_sec' => isset($_POST['fvp_sec']) ? $_POST['fvp_sec'] : ''
207
- );
208
- $meta = $this->save($post);
209
-
210
- $img = _wp_post_thumbnail_html( get_post_thumbnail_id($post['id']), $post['id'] );
211
-
212
- if (has_post_video($post['id'])){
213
- $video = get_the_post_video( $post['id'], array(256,144) );
214
- echo json_encode(array( 'typ' => 'updated', 'valid' => $meta['valid'], 'video' => $video, 'img' => $img, 'prov' => $meta['prov'], 'id' => $meta['id'] ));
215
- } else
216
- echo json_encode(array( 'typ' => 'removed', 'valid' => $meta['valid'], 'img' => $img ));
217
- die();
218
- }
219
-
220
- /**
221
- * Used for processing an (AJAX) save request.
222
- *
223
- * @since 1.5
224
- *
225
- * @see http://codex.wordpress.org/Function_Reference/update_post_meta
226
- */
227
- function save($post) {
228
- if( ( isset($post['fvp_nonce']) && // WP Form submitted..
229
- !wp_verify_nonce( $post['fvp_nonce'], FVP_NAME ) ) )
230
- return false;
231
-
232
- // get fvp_video post meta data
233
- $meta = get_post_meta($post['id'], '_fvp_video', true);
234
-
235
- // video is empty or default value
236
- if( !isset($post['fvp_video']) || empty($post['fvp_video']) || $post['fvp_video'] == $this->default_value )
237
- $url = '';
238
- else $url = trim($post['fvp_video']);
239
-
240
- // fallback video is empty or default value
241
- if( !isset($post['fvp_sec']) || empty($post['fvp_sec']) || $post['fvp_sec'] == $this->default_value_sec )
242
- $sec = '';
243
- else $sec = trim($post['fvp_sec']);
244
-
245
- // neither primary nor fallback did change OR primary is and was empty
246
- // AND we do not want to set
247
- if( ( ( isset($meta['full']) && $url == $meta['full'] && $sec == $meta['sec'] ) ||
248
- ( !isset($meta['full']) && empty($url) ) ) &&
249
- ( isset($post['fvp_set_featimg']) && !empty($post['fvp_set_featimg']) ) )
250
- return false;
251
-
252
- // there was a video and we want to delete it
253
- if( isset($meta['full']) && empty($url) ) {
254
- delete_post_meta( $post['id'], '_fvp_video' );
255
- $this->delete_featured_video_image($post['id'], $meta);
256
- return false;
257
- }
258
-
259
- $data = $this->get_video_data($url, $sec);
260
-
261
- $url = isset($data['url']) && !empty($data['url']) ? $data['url'] : $url;
262
- // Do we have a screen capture to pull?
263
- if( isset($data['img']) && !empty($data['img']) ) {
264
- $this->delete_featured_video_image( $post['id'], $meta );
265
- $img = $this->set_featured_video_image( $post['id'], $data );
266
- }
267
-
268
- $meta = array(
269
- 'full' => $url,
270
- 'id' => isset($data['id']) ? $data['id'] : '',
271
- 'sec' => isset($data['sec']) ? $data['sec'] : '',
272
- 'img' => isset($img) ? $img : '',
273
- 'prov' => isset($data['provider']) ? $data['provider'] : '',
274
- 'time' => isset($data['time']) ? $data['time'] : '',
275
- 'end_time' => isset($data['end_time']) ? $data['end_time'] : '',
276
- 'valid' => isset($data['valid']) ? $data['valid'] : true
277
- );
278
-
279
- update_post_meta($post['id'], '_fvp_video', $meta);
280
- return $meta;
281
- }
282
-
283
- /**
284
- * Returns an array containing video information like id provider imgurl etc
285
- * Code existing since 1.0, got it own function in 1.5
286
- *
287
- * @since 1.5
288
- *
289
- * @param string video a video url
290
- */
291
- function get_video_data($url, $sec = '') {
292
- $local = wp_upload_dir();
293
- preg_match('/(vimeo|youtu|dailymotion|liveleak|blip|hulu|'.preg_quote($local['baseurl'], '/').')/i', $url, $prov_data);
294
- if( isset($prov_data[1]) )
295
- $provider = $prov_data[1];
296
- else return false;
297
-
298
- switch ($provider) {
299
-
300
- // local video
301
- case $local['baseurl']:
302
- $ext_legal = array( 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv' );
303
-
304
- $ext = pathinfo( $url, PATHINFO_EXTENSION );
305
- if( empty( $ext ) || ! in_array( $ext, $ext_legal ) ) return; // wrong extension
306
-
307
- $data['id'] = $this->get_post_by_url($url);
308
- $data['provider'] = 'local';
309
- break;
310
-
311
- // youtube.com
312
- case 'youtu':
313
- $provider = 'youtube';
314
- case 'youtube':
315
- $pattern = '#(?:https?\:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/watch\?.+&v=))([\w-]{11})#x';
316
- preg_match($pattern, $url, $url_data);
317
- if( !isset($url_data[1]) )
318
- break;
319
-
320
- $video_id = $url_data[1];
321
-
322
- // access API
323
- $response = wp_remote_get( 'http://youtube.com/get_video_info?video_id=' . $video_id );
324
- if( is_wp_error( $response ) )
325
- break;
326
- parse_str( $response['body'], $result );
327
- if (isset($result['status']) && $result['status'] == 'fail'){
328
- $data = array(
329
- 'id' => $video_id,
330
- 'provider' => $provider,
331
- 'url' => $url,
332
- 'api' => false
333
- );
334
- break;
335
- }
336
-
337
- // extract info of a time-link
338
- preg_match('/t=(?:(\d+)m)?(?:(\d+)s)?/', $url, $attr);
339
- if( !empty($attr[1] ) || !empty($attr[2]) ) {
340
- $min = !empty($attr[1]) ? $attr[1]*60 : 0;
341
- $sek = !empty($attr[2]) ? $attr[2] : 0;
342
- $start_time = $min + $sek;
343
- } else {
344
- preg_match('/start=(\d+)/', $url, $attr);
345
- if( !empty($attr[1] ) ) $start_time = $attr[1];
346
- else $start_time = 0;
347
-
348
- preg_match('/end=(\d+)/', $url, $attr);
349
- if( !empty($attr[1] ) ) $end_time = $attr[1];
350
- else $end_time = 0;
351
- }
352
-
353
- // generate video metadata
354
- $data = array(
355
- 'id' => $video_id,
356
- 'provider' => $provider,
357
- 'time' => $start_time,
358
- 'end_time' => $end_time,
359
- 'title' => $result['title'],
360
- 'description' => $result['keywords'],
361
- 'filename' => sanitize_file_name($result['title']),
362
- 'timestamp' => $result['timestamp'],
363
- 'author' => $result['author'],
364
- 'tags' => $result['keywords'],
365
- 'img' => ( isset($result['iurlmaxres']) && !empty($result['iurlmaxres']) ) ? $result['iurlmaxres'] : 'http://img.youtube.com/vi/' . $video_id . '/0.jpg',
366
- 'url' => ( $start_time > 0 ) ? $url : 'http://youtu.be/'.$video_id
367
- );
368
-
369
- break;
370
-
371
- // vimeo.com
372
- case 'vimeo':
373
- // domain video ID
374
- $pattern = '#(?:https?://)?(?:\w+.)?vimeo.com/(?:video/|moogaloop\.swf\?clip_id=)?(\w+)#x';
375
- preg_match($pattern, $url, $url_data);
376
- $video_id = $url_data[1];
377
-
378
- // access API: http://developer.vimeo.com/apis/simple
379
- $response = wp_remote_get( 'http://vimeo.com/api/v2/video/' . $video_id . '.php' );
380
- if( is_wp_error( $response ) || (isset($response['response']['code']) && $response['response']['code'] == '404') )
381
- break;
382
- // title, description, upload_date, thumbnail_large, user_name, tags
383
- $result = unserialize( $response['body'] );
384
-
385
- // extract info of a time-link
386
- /*preg_match('/#t=((?:\d+m)?(?:\d+s)?)/', $video, $attr);
387
- if( !empty($attr[1] ) )
388
- $video_attr = $attr[1];*/
389
-
390
- // generate video metadata
391
- $data = array(
392
- 'id' => $video_id,
393
- 'provider' => $provider,
394
- 'title' => $result[0]['title'],
395
- 'description' => $result[0]['description'],
396
- 'filename' => sanitize_file_name( $result[0]['title'] ),
397
- 'timestamp' => strtotime( $result[0]['upload_date'] ),
398
- 'author' => $result[0]['user_name'],
399
- 'tags' => $result[0]['tags'],
400
- 'img' => $result[0]['thumbnail_large'],
401
- 'url' => $result[0]['url']
402
- );
403
-
404
- break;
405
-
406
- // dailymotion.com
407
- case 'dailymotion':
408
- // domain video ID
409
- preg_match('/dailymotion.com\/(?:embed\/)?video\/([^_#\?]+)/', $url, $url_data);
410
- if( !isset($url_data[1]) )
411
- break;
412
-
413
- $video_id = $url_data[1];
414
-
415
- // access API: http://www.dailymotion.com/doc/api/obj-video.html
416
- $url = 'https://api.dailymotion.com/video/'.$video_id.'?fields=title,description,created_time,owner.screenname,tags,thumbnail_url,thumbnail_large_url,url,aspect_ratio';
417
- $request = new WP_Http;
418
- $response = $request->request( $url, array( 'method' => 'GET', 'sslverify' => false) );
419
- if( is_wp_error($response) )
420
- break;
421
- $result = json_decode($response['body'], true);
422
- if( !isset($result) || (isset($result['error']['code']) && ($result['error']['code'] == 501 || $result['error']['code'] == 400) ) )
423
- break;
424
-
425
- // extract info of a time-link
426
- preg_match('/t=(?:(\d+)m)?(?:(\d+)s)?/', $url, $attr);
427
- if( !empty($attr[1] ) || !empty($attr[2]) ) {
428
- $min = !empty($attr[1]) ? $attr[1]*60 : 0;
429
- $sek = !empty($attr[2]) ? $attr[2] : 0;
430
- $video_time = $min + $sek;
431
- } else {
432
- preg_match('/start=(\d+)/', $url, $attr);
433
- if( !empty($attr[1] ) )
434
- $video_time = $attr[1];
435
- else
436
- $video_time = 0;
437
- }
438
-
439
- // generate video metadata
440
- $data = array(
441
- 'id' => $video_id,
442
- 'provider' => $provider,
443
- 'time' => $video_time,
444
- 'title' => $result['title'],
445
- 'description' => $result['description'],
446
- 'filename' => sanitize_file_name($result['title']),
447
- 'timestamp' => $result['created_time'],
448
- 'author' => $result['owner.screenname'],
449
- 'tags' => implode(', ', $result['tags']),
450
- 'img' => ( isset($result['thumbnail_url']) && !empty($result['thumbnail_url']) ) ? $result['thumbnail_url'] : $result['thumbnail_large_url'],
451
- 'url' => 'http://dailymotion.com/video/'.$video_id. ( $video_time>0 ? '#t='.floor($video_time/60).'m'.($video_time%60).'s' : '')
452
- );
453
-
454
- break;
455
-
456
- /* case 'blip':
457
- case 'hulu':
458
- $valid = true;
459
- if (!wp_oembed_get( $url ))
460
- $valid = false;
461
-
462
- $data = array(
463
- 'url' => $url,
464
- 'valid' => $valid
465
- );
466
- break;*/
467
-
468
- // liveleak.com
469
- // no API provided, the plugin pulls the website and gets the video
470
- // source url and other metadata from the source code.
471
- case 'liveleak': // view-source:http://www.liveleak.com/view?i=45f_1358105976&ajax=1
472
- // domain video ID
473
- preg_match('/(?:http:\/\/)?(?:www\.)?liveleak.com\/view\?i=([\d\w]{3}_\d{10})/', $url, $url_data);
474
- if( !isset($url_data[1]) )
475
- break;
476
-
477
- // no API, get stripped down version of the full website
478
- $response = wp_remote_get( 'http://liveleak.com/view?i='.$url_data[1].'&ajax=1');
479
- if( is_wp_error( $response ) )
480
- break;
481
-
482
- // run dirty regex on the websites source code to get the actual video URL
483
- preg_match('#jwplayer\("(?:(?:file)|(?:player))_([\d\w]{10,14})"\)\.setup\({([^}}\))]+)#', $response['body'], $llmeta);
484
- if( isset($llmeta[1]) || isset($llmeta[2]) ) {
485
- $video_id = $llmeta[1];
486
-
487
- $llmeta = explode(',', $llmeta[2]);
488
- foreach( $llmeta as $line ) {
489
- $thisline = explode(': ', $line);
490
- $result[trim($thisline[0])] = trim($thisline[1]);
491
- }
492
-
493
- preg_match('#class="section_title".*>([\s\w]+)</span>#', $response['body'], $title);
494
- preg_match('#id="body_text".*><p>(.*)<\/p><\/#', $response['body'], $desc);
495
- $result['title'] = isset($title[1]) ? $title[1] : '';
496
-
497
- $data = array(
498
- 'id' => $video_id,
499
- 'provider' => $provider,
500
- 'title' => $result['title'],
501
- 'description' => isset($desc[1]) ? $desc[1] : '',
502
- 'filename' => sanitize_file_name($result['title']),
503
- 'timestamp' => time(),
504
- //'author' => '', // <strong>By:</strong> <a href="http://www.liveleak.com/c/k-doe">k-doe</a>
505
- //'tags' => '', // <strong>Tags:</strong> <a href="browse?q=Drive By">Drive By</a>, <a href="browse?q=Fire Extinguisher">Fire Extinguisher</a><br />
506
- 'img' => isset($result['image']) ? trim($result['image'],"\"") : '',
507
- 'url' => 'http://liveleak.com/view?i='.$video_data[1]
508
- );
509
- break;
510
- }
511
-
512
- // if the regex fails the video is provided by prochan, not LL
513
- $provider = 'prochan';
514
- $type = 'iframe';
515
-
516
- // prochan.com (only implemented as used by liveleak
517
- case 'prochan':
518
- if($type == 'iframe') {
519
- preg_match('#<iframe.*src="(?:http://)?(?:www\.)?prochan.com/embed\?f=([\d\w]{3}_\d{10})".*></iframe>#', $response['body'], $proframe);
520
- if( !isset($proframe[1]) )
521
- break;
522
- $data = array(
523
- 'id' => $proframe[1],
524
- 'provider' => $provider
525
- );
526
- }
527
- break;
528
-
529
- default:
530
- break;
531
- }
532
- return isset($data) ? $data : false;
533
- }
534
-
535
- /**
536
- * Pulls the new featured image picture to local and sets it as featured image.
537
- * Since 1.0, got it own function in 1.5
538
- *
539
- * @since 1.5
540
- */
541
- function set_featured_video_image($post_id, $data) {
542
- // Is this screen capture already existing in our media library?
543
- $img = $this->featured_video_plus->get_post_by_custom_meta('_fvp_image', $data['provider'] . '?' . $data['id']);
544
- if( !isset($img) ) {
545
-
546
- // Generate attachment post metadata
547
- $img_data = array(
548
- 'post_content' => $data['description'],
549
- 'post_title' => $data['title'],
550
- 'post_name' => $data['filename']
551
- );
552
-
553
- // pull external img to local server and add to media library
554
- include_once( FVP_DIR . 'php/somatic_attach_external_image.php' );
555
- $img = somatic_attach_external_image($data['img'], $post_id, false, $data['filename'], $img_data);
556
-
557
- // generate picture metadata
558
- $img_meta = wp_get_attachment_metadata( $img );
559
- $img_meta['image_meta'] = array(
560
- 'aperture' => 0,
561
- 'credit' => $data['id'],
562
- 'camera' => $data['provider'],
563
- 'caption' => $data['description'],
564
- 'created_timestamp' => $data['timestamp'],
565
- 'copyright' => $data['author'],
566
- 'focal_length' => 0,
567
- 'iso' => 0,
568
- 'shutter_speed' => 0,
569
- 'title' => $data['title']
570
- );
571
-
572
- // save picture metadata
573
- wp_update_attachment_metadata($img, $img_meta);
574
- update_post_meta( $img, '_fvp_image', $data['provider'] . '?' . $data['id'] );
575
- }
576
-
577
- if( (get_bloginfo('version') >= 3.1) && // set_post_thumbnail was added in 3.1
578
- ( (!has_post_thumbnail( $post_id )) ||
579
- ($set_featimg) ) )
580
- set_post_thumbnail( $post_id, $img );
581
-
582
- return $img;
583
- }
584
-
585
- /**
586
- * Removes the old featured image
587
- * Used since 1.0, got it own function in 1.4
588
- *
589
- * @since 1.4
590
- */
591
- function delete_featured_video_image($post_id, $meta) {
592
- if( !isset($meta['img']) || empty($meta['img']) )
593
- return false;
594
-
595
- // Unset featured image if it is from this video
596
- delete_post_meta( $post_id, '_thumbnail_id', $meta['img'] );
597
-
598
- // Check if other posts use the image, if not we can delete it completely
599
- $other = $this->featured_video_plus->get_post_by_custom_meta( '_thumbnail_id', $meta['img'] );
600
- if( empty( $other ) ) {
601
- wp_delete_attachment( $meta['img'] );
602
- delete_post_meta( $meta['img'], '_fvp_image', $meta['prov'] . '?' . $meta['id'] );
603
- }
604
- }
605
-
606
- /**
607
- *
608
- * @since 1.7
609
- */
610
- public function ajax_get_embed(){
611
- header( "Content-Type: application/json" );
612
-
613
- if ( !isset($_POST['nonce']) || !wp_verify_nonce($_POST['nonce'], 'featured-video-plus-nonce') ){
614
- echo json_encode(array('success' => false, 'html' => 'invalid nonce'));
615
- exit();
616
- }
617
-
618
- if (has_post_video($_POST['id'])){
619
- $meta = get_post_meta($_POST['id'], '_fvp_video', true);
620
-
621
- $video = get_the_post_video( $_POST['id'] );
622
- echo json_encode(array('success' => 'true', 'html' => $video, 'id' => $meta['id']));
623
- } else{
624
- $image = get_the_post_thumbnail($_POST['id']);
625
- echo json_encode(array('success' => 'false','html' => $image));
626
- }
627
- exit;
628
- }
629
-
630
- /*
631
- * Initializes the help texts.
632
- *
633
- * @since 1.3
634
- */
635
- public function help() {
636
- $mediahref = (get_bloginfo('version') >= 3.5) ? '<a href="#" class="insert-media" title="Add Media">' : '<a href="media-upload.php?post_id=4&amp;type=video&amp;TB_iframe=1&amp;width=640&amp;height=207" id="add_video" class="thickbox" title="Add Video">';
637
- $general = (get_bloginfo('version') >= 3.6) ? sprintf( __('To use local videos, copy the <code>Link To Media File</code> from your %sMedia Library%s and paste it into the text field.', 'featured-video-plus'), $mediahref, '</a>' ) :
638
- sprintf( __('To use local videos as Featured Videos WordPress 3.6 or higher is required.', 'featured-video-plus'), $mediahref, '</a>' );
639
-
640
- $this->help_localmedia = '
641
- <h4 style="margin-bottom: 0;"></h4>
642
- <p>'.$general.'</p>
643
- <h4 style="margin-bottom: 0;">'.__('Supported Video Formats','featured-video-plus').':</h4>
644
- <p style="margin-top: 0;"><code>webM</code>, <code>mp4</code>, <code>ogv</code>, <code>m4v</code>, <code>wmv</code>, <code>flv</code></p>
645
- <h4 style="margin-bottom: 0;">'.__('Converting your videos','featured-video-plus').':</h4>
646
- <p style="margin-top: 0;">'.sprintf(__('Take a look at the %sMiro Video Converter%s. It is open source, lightweight and compatible with Windows, Mac and Linux.','featured-video-plus'),'<a href="http://www.mirovideoconverter.com/" target="_blank">','</a>').'</p>
647
- <h4 style="margin-bottom: 0;">'.__('Fixing upload errors','featured-video-plus').':</h4>
648
- <ul style="margin-top: 0;">
649
- <li>'.sprintf(__('Read %sthis%s on how to increase the <strong>maximum file upload size</strong>.','featured-video-plus'),'<a href="http://www.wpbeginner.com/wp-tutorials/how-to-increase-the-maximum-file-upload-size-in-wordpress/" target="_blank">','</a>').'</li>
650
- </ul>'."\n";
651
-
652
- $dir = wp_upload_dir();
653
- $this->help_urls = '
654
- <p>'.__('These are some of the tested URL formats. Everything in bold is required, everything in brackets is optional.','featured-video-plus').'</p>
655
- <ul>
656
- <li>Local Videos:
657
- <ul><li><code><strong>'.$dir['baseurl'].'/<em>FOLDER/FILENAME.webm|mp4|ogg|ogv</em></strong></code></li></ul></li>
658
- <li>YouTube:
659
- <ul><li><code>[http(s)://](www.)<strong>youtu.be/<em>ELEVENCHARS</em></strong>(?random=13)(?t=1m3s)</code></li>
660
- <li><code>[http(s)://](www.)<strong>youtube.com/watch?v=<em>ELEVENCHARS</em></strong>(?random=13)(?t=1m3s)</code></li>
661
- <li><code>[http(s)://](www.)<strong>youtube.com/v/<em>ELEVENCHARS</em></strong>(?random=13)(?t=1m3s)</code></li></ul></li>
662
- <li>Vimeo:
663
- <ul><li><code>(http(s)://)(www.)<strong>vimeo.com/<em>UNIQUEID</em></strong>(#stuff)</code></li></ul></li>
664
- <li>Dailymotion:
665
- <ul><li><code>(http(s)://)(www.)<strong>dailymotion.com/video/<em>UNIQUEID</em></strong>(_video_title)(#stuff)</code></li></ul></li>
666
- </ul>'."\n";
667
-
668
- }
669
-
670
- /**
671
- * Adds help tabs to contextual help. WordPress 3.3+
672
- *
673
- * @see http://codex.wordpress.org/Function_Reference/add_help_tab
674
- *
675
- * @since 1.3
676
- */
677
- public function tabs() {
678
- $screen = get_current_screen();
679
- if( $screen->id != 'post' )
680
- return;
681
-
682
- if( get_bloginfo('version') >= 3.3 ) {
683
- // LOCALVIDEOS HELP TAB
684
- $screen->add_help_tab( array(
685
- 'id' => 'fvp_help_localvideos',
686
- 'title' => __('Featured Video','featured-video-plus').':&nbsp;'.__('Local Media', 'featured-video-plus'),
687
- 'content' => $this->help_localmedia
688
- ));
689
-
690
- // LEGAL URLs HELP TAB
691
- $screen->add_help_tab( array(
692
- 'id' => 'fvp_help_urls',
693
- 'title' => __('Featured Video','featured-video-plus').':&nbsp;'.__('Valid URLs', 'featured-video-plus'),
694
- 'content' => $this->help_urls
695
- ));
696
- }
697
- }
698
-
699
- /**
700
- * Adds help text to contextual help. WordPress 3.3-
701
- *
702
- * @see http://wordpress.stackexchange.com/a/35164
703
- *
704
- * @since 1.3
705
- */
706
- public function help_pre_33( $contextual_help, $screen_id, $screen ) {
707
- if( $screen->id != 'post' )
708
- return $contextual_help;
709
-
710
- $contextual_help .= '<hr /><h3>'.__('Featured Video','featured-video-plus').':&nbsp;'.__('Local Media', 'featured-video-plus').'</h3>';
711
- $contextual_help .= $this->help_localmedia;
712
- $contextual_help .= '<h3>'.__('Featured Video','featured-video-plus').':&nbsp;'.__('Valid URLs', 'featured-video-plus').'</h3>';
713
- $contextual_help .= $this->help_urls;
714
-
715
- return $contextual_help;
716
- }
717
-
718
- /**
719
- * Function to allow more upload mime types.
720
- *
721
- * @see http://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes
722
- * @since 1.2
723
- */
724
- function add_upload_mimes( $mimes=array() ) {
725
- $mimes['webm'] = 'video/webm';
726
-
727
- return $mimes;
728
- }
729
-
730
- /**
731
- * Adds a media settings link to the plugin info
732
- *
733
- * @since 1.2
734
- */
735
- function plugin_action_link($links, $file) {
736
- if ($file == FVP_NAME . '/' . FVP_NAME . '.php') {
737
- $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/options-media.php">Media Settings</a>';
738
- array_unshift($links, $settings_link);
739
- }
740
-
741
- return $links;
742
- }
743
-
744
- /**
745
- * Gets post id by it's url / guid.
746
- *
747
- * @see http://codex.wordpress.org/Class_Reference/wpdb
748
- * @since 1.0
749
- *
750
- * @param string $url which url to look for
751
- */
752
- function get_post_by_url($url) {
753
- global $wpdb;
754
- $id = $wpdb->get_var(
755
- $wpdb->prepare(
756
- "SELECT ID FROM {$wpdb->posts} WHERE guid=%s;",
757
- $url
758
- )
759
- );
760
- return $id;
761
- }
762
-
763
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
php/class-backend.php ADDED
@@ -0,0 +1,697 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // dependencies
4
+ require_once( FVP_DIR . 'php/class-html.php' );
5
+ require_once( FVP_DIR . 'php/class-main.php' );
6
+
7
+ /**
8
+ * Class containing plugin specific WordPress administration panels
9
+ * functionality.
10
+ *
11
+ * Specifically the metabox on post/page edit views.
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class FVP_Backend extends Featured_Video_Plus {
16
+
17
+ /**
18
+ * Register actions and filters.
19
+ */
20
+ public function __construct() {
21
+ parent::__construct();
22
+ FVP_HTML::add_screens( array( 'post.php', 'post-new.php' ) );
23
+
24
+ add_action( 'admin_init', array( $this, 'upgrade' ) );
25
+
26
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
27
+ add_action( 'admin_menu', array( $this, 'metabox_register' ) );
28
+ add_action( 'save_post', array( $this, 'metabox_save' ) );
29
+
30
+ add_filter( 'fvphtml_pointers', array( $this, 'pointers' ), 10, 2 );
31
+ add_filter( 'plugin_action_links',
32
+ array( $this, 'plugin_action_link' ),
33
+ 10, 2 );
34
+ add_filter( 'admin_post_thumbnail_html',
35
+ array( $this, 'featured_image_notice' ),
36
+ 10, 2 );
37
+
38
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
39
+ add_action( 'wp_ajax_fvp_save', array( $this, 'metabox_save_ajax' ) );
40
+ add_action( 'wp_ajax_fvp_get_embed', array( $this, 'ajax_get_embed' ) );
41
+ add_action( 'wp_ajax_nopriv_fvp_get_embed',
42
+ array( $this, 'ajax_get_embed' ) );
43
+ }
44
+ }
45
+
46
+
47
+ /**
48
+ * Enqueue all scripts and styles needed when viewing the backend.
49
+ *
50
+ * @since 1.0.0
51
+ *
52
+ * @param {string} $hook Current view hook.
53
+ */
54
+ public function enqueue( $hook ) {
55
+ if ( 'post.php' !== $hook && 'post-new.php' !== $hook ) {
56
+ return;
57
+ }
58
+
59
+ $min = defined( SCRIPT_DEBUG ) && SCRIPT_DEBUG ? '' : '.min';
60
+
61
+ // jQuery script for automatically resizing <textarea>s.
62
+ wp_register_script(
63
+ 'jquery.autosize',
64
+ FVP_URL . "js/jquery.autosize$min.js",
65
+ array( 'jquery' ),
66
+ FVP_VERSION,
67
+ false
68
+ );
69
+
70
+ // Script handling featured video form interactions with ajax requests etc.
71
+ wp_enqueue_script(
72
+ 'fvp-post',
73
+ FVP_URL . "js/post$min.js",
74
+ array(
75
+ 'jquery',
76
+ 'jquery.autosize',
77
+ 'wp-mediaelement',
78
+ ),
79
+ FVP_VERSION
80
+ );
81
+
82
+ // Some variables required in JS context.
83
+ $upload_dir = wp_upload_dir();
84
+ wp_localize_script( 'fvp-post', 'fvp_post', array(
85
+ 'wp_upload_dir' => $upload_dir['baseurl'],
86
+ 'loading_gif' => get_admin_url( null, 'images/loading.gif' )
87
+ ));
88
+
89
+ // General backend style.
90
+ wp_enqueue_style(
91
+ 'fvp-backend',
92
+ FVP_URL . 'styles/backend.css',
93
+ array(
94
+ 'wp-mediaelement',
95
+ ),
96
+ FVP_VERSION,
97
+ 'all'
98
+ );
99
+ }
100
+
101
+
102
+ /**
103
+ * Register the metabox on post/page edit views.
104
+ *
105
+ * @since 1.0.0
106
+ */
107
+ public function metabox_register() {
108
+ $post_types = get_post_types( array( 'public' => true ) );
109
+
110
+ // Cycle through all post types.
111
+ foreach ( $post_types AS $post_type ) {
112
+ // Ignore attachment post type.
113
+ if ( 'attachment' === $post_type ) {
114
+ continue;
115
+ }
116
+
117
+ // Register metabox.
118
+ add_meta_box(
119
+ 'featured-video-plus-box',
120
+ __( 'Featured Video', 'featured-video-plus' ),
121
+ array( $this, 'metabox_content' ),
122
+ $post_type,
123
+ 'side',
124
+ 'high'
125
+ );
126
+ }
127
+ }
128
+
129
+
130
+ /**
131
+ * Callback function of the metabox; generates the HTML content.
132
+ *
133
+ * @since 1.0.0
134
+ */
135
+ public function metabox_content() {
136
+ wp_nonce_field( FVP_NAME . FVP_VERSION, 'fvp_nonce' );
137
+
138
+ // Get current post's id.
139
+ $post_id = isset( $_GET['post'] ) ? $_GET['post'] : $GLOBALS['post']->ID;
140
+
141
+ $options = get_option( 'fvp-settings' );
142
+ $meta = get_post_meta( $post_id, '_fvp_video', true );
143
+ $has_post_video = has_post_video( $post_id );
144
+
145
+ $content = '';
146
+
147
+ // Current featured video.
148
+ $content .= sprintf(
149
+ '<div class="fvp-current-video"%s>%s</div>',
150
+ $this->inline_styles( array(
151
+ 'height: 0px' => ! $has_post_video,
152
+ ), true, true ),
153
+ get_the_post_video( $post_id, array( 256, 144 ) )
154
+ );
155
+
156
+ // Input box containing the featured video URL input.
157
+ $full = $has_post_video ? get_the_post_video_url( $post_id ) : '';
158
+
159
+ // Media gallery wrapper.
160
+ $content .= sprintf(
161
+ '<div class="fvp-input-wrapper" data-target=".fvp-video" data-title="%1$s" data-button="%1$s">',
162
+ esc_attr__( 'Set Featured Video', 'featured-video-plus' )
163
+ );
164
+
165
+ // Video input.
166
+ $content .= sprintf(
167
+ '<textarea class="fvp-video" name="fvp_video" type="text" placeholder="%s">%s</textarea>',
168
+ esc_attr__( 'Video URL', 'featured-video-plus' ),
169
+ $full
170
+ );
171
+
172
+ // Media gallery button.
173
+ $content .= sprintf(
174
+ '<a href="#" class="fvp-video-choose">' .
175
+ '<span class="fvp-media-icon"%s></span>' .
176
+ '</a>',
177
+ $this->inline_styles(array(
178
+ 'background-image' => sprintf(
179
+ 'url(%s/wp-admin/images/media-button.png)',
180
+ get_bloginfo( 'wpurl' )
181
+ )
182
+ ), true, true)
183
+ );
184
+
185
+ // Close media gallery wrapper.
186
+ $content .= '</div>';
187
+
188
+ // 'Current theme does not support Featured Images' warning.
189
+ if (
190
+ ! current_theme_supports( 'post-thumbnails' ) &&
191
+ 'manual' !== $options['mode']
192
+ ) {
193
+ $content .= '<p class="fvp-warning description">';
194
+ $content .= sprintf(
195
+ '<span style="font-weight: bold;">%s</span>&nbsp;',
196
+ esc_html__(
197
+ 'The current theme does not support Featured Images',
198
+ 'featured-video-plus'
199
+ )
200
+ );
201
+
202
+ $content .= sprintf(
203
+ esc_html__(
204
+ 'To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s. To hide this notice deactivate %3$sReplace Featured Images%4$s in the %5$sMedia Settings%6$s.',
205
+ 'featured-video-plus'
206
+ ),
207
+ '<code>', '</code>',
208
+ '&quot;<em>', '</em>&quot;',
209
+ '<a href="' . esc_attr( get_admin_url( null, '/options-media.php' ) ) . '">',
210
+ '</a>'
211
+ );
212
+ '</p>';
213
+ }
214
+
215
+ echo "\n\n\n<!-- Featured Video Plus Metabox -->\n";
216
+ echo $content;
217
+ echo "<!-- Featured Video Plus Metabox End-->\n\n\n";
218
+ }
219
+
220
+
221
+ /**
222
+ * Saves metabox changes - NON AJAX.
223
+ *
224
+ * @since 1.0.0
225
+ * @uses $this->save()
226
+ *
227
+ * @param {int} $post_id
228
+ */
229
+ public function metabox_save( $post_id ){
230
+ if ( ! self::has_valid_nonce( $_POST ) ) {
231
+ return false;
232
+ }
233
+
234
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ||
235
+ ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ||
236
+ ( ! current_user_can( 'edit_post', $post_id ) ) ||
237
+ ( false !== wp_is_post_revision( $post_id ) )
238
+ ) {
239
+ return;
240
+ }
241
+
242
+ $post = array(
243
+ 'id' => $post_id,
244
+ 'fvp_nonce' => ! empty( $_POST['fvp_nonce'] ) ? $_POST['fvp_nonce'] : '',
245
+ 'fvp_video' => ! empty( $_POST['fvp_video'] ) ? $_POST['fvp_video'] : ''
246
+ );
247
+
248
+ $this->save( $post );
249
+
250
+ return;
251
+ }
252
+
253
+
254
+ /**
255
+ * Saves metabox changes - AJAX.
256
+ *
257
+ * @since 1.5.0
258
+ * @uses $this->save()
259
+ */
260
+ public function metabox_save_ajax() {
261
+ if ( ! self::has_valid_nonce( $_POST ) ) {
262
+ return false;
263
+ }
264
+
265
+ $post = array(
266
+ 'id' => $_POST['id'],
267
+ 'fvp_nonce' => ! empty( $_POST['fvp_nonce'] ) ? $_POST['fvp_nonce'] : '',
268
+ 'fvp_video' => ! empty( $_POST['fvp_video'] ) ? $_POST['fvp_video'] : '',
269
+ 'fvp_set_featimg' =>
270
+ ! empty( $_POST['fvp_set_featimg'] ) ? $_POST['fvp_set_featimg'] : '',
271
+ );
272
+
273
+ // this also verifies the nonce
274
+ $meta = $this->save( $post );
275
+
276
+ $img = _wp_post_thumbnail_html(
277
+ get_post_thumbnail_id( $post['id'] ),
278
+ $post['id']
279
+ );
280
+
281
+ if ( has_post_video( $post['id'] ) ) {
282
+ $video = get_the_post_video( $post['id'], array( 256, 144 ) );
283
+ $response = json_encode( array(
284
+ 'type' => 'update',
285
+ 'valid' => isset( $meta['valid'] ) ? $meta['valid'] : null,
286
+ 'video' => $video,
287
+ 'img' => $img,
288
+ 'provider' => isset( $meta['provider'] ) ? $meta['provider'] : null
289
+ ) );
290
+ } else {
291
+ $response = json_encode( array(
292
+ 'task' => 'remove',
293
+ 'valid' => isset( $meta['valid'] ) ? $meta['valid'] : null,
294
+ 'img' => $img,
295
+ ) );
296
+ }
297
+
298
+ exit( $response );
299
+ }
300
+
301
+
302
+ /**
303
+ * Used for processing a save request.
304
+ *
305
+ * @since 1.5.0
306
+ *
307
+ * @param {assoc} $post
308
+ * @return {assoc/bool} video meta data on success, false on failure
309
+ */
310
+ private function save( $post ) {
311
+ // get fvp_video post meta data
312
+ $meta = get_post_meta( $post['id'], '_fvp_video', true );
313
+
314
+ // parse video url
315
+ $url = ! empty( $post['fvp_video'] ) ? trim( $post['fvp_video'] ) : '';
316
+
317
+ // has featured image AND url did not change or is and was empty
318
+ if (
319
+ ! $post['fvp_set_featimg'] && (
320
+ ( ! empty( $meta['full'] ) && $url == $meta['full'] ) ||
321
+ ( empty( $meta['full'] ) && empty( $url ) )
322
+ )
323
+ ) {
324
+ return false;
325
+ }
326
+
327
+ // there was a video and we want to delete it
328
+ if ( ! empty( $meta['full'] ) && empty( $url ) ) {
329
+ delete_post_meta( $post['id'], '_fvp_video' );
330
+ $this->delete_featured_image( $post['id'], $meta );
331
+ return false;
332
+ }
333
+
334
+ $data = $this->get_video_data( $url );
335
+
336
+ // Do we have a screen capture to pull?
337
+ if ( empty( $data['img_url'] ) ) {
338
+ $data['img_url'] = FVP_URL . 'img/placeholder.png';
339
+ $data['filename'] = 'Featured Video Plus Placeholder';
340
+ }
341
+
342
+ $img = $this->set_featured_image( $post['id'], $data );
343
+
344
+ $meta = array_merge(
345
+ array(
346
+ 'full' => $url,
347
+ 'img' => ! empty( $img ) ? $img : null,
348
+ 'valid' => 1, // can be overwritten by $data
349
+ 'provider' => 'raw', // "
350
+ ),
351
+ $data
352
+ );
353
+
354
+ update_post_meta( $post['id'], '_fvp_video', $meta );
355
+ return $meta;
356
+ }
357
+
358
+
359
+ /**
360
+ * Returns an array containing video information like id provider imgurl etc.
361
+ *
362
+ * @since 1.5.0
363
+ *
364
+ * @param {string} $url The video URL
365
+ * @return {assoc} Associative array containing the video information data
366
+ */
367
+ private function get_video_data( $url ) {
368
+ $data = array();
369
+
370
+ $local = wp_upload_dir();
371
+ $islocal = strpos( $url, $local['baseurl'] );
372
+
373
+ // handle local videos
374
+ if ( false !== $islocal ) {
375
+ $provider = 'local';
376
+
377
+ // handle external videos
378
+ } else {
379
+ $raw = $this->oembed->request( $url );
380
+
381
+ // If no provider is returned the URL is invalid
382
+ if ( empty( $raw ) || empty( $raw->provider_name ) ) {
383
+ return array( 'valid' => false );
384
+ }
385
+
386
+ $provider = strtolower( $raw->provider_name );
387
+
388
+ $data = array(
389
+ 'id' => null,
390
+ 'provider' => $provider,
391
+ 'title' => ! empty( $raw->title ) ? $raw->title : null,
392
+ 'author' => ! empty( $raw->author_name ) ? $raw->author_name : null,
393
+ 'description' => ! empty( $raw->description ) ? $raw->description : null,
394
+ 'img_url' => ! empty( $raw->thumbnail_url ) ? $raw->thumbnail_url : null,
395
+ 'filename' => ! empty( $raw->title ) ? sanitize_file_name( $raw->title ) : null,
396
+ );
397
+ }
398
+
399
+ $data['parameters'] = $this->oembed->get_args( $url, $provider );
400
+
401
+ // provider specific handling
402
+ switch ( $provider ) {
403
+
404
+ // local video
405
+ case 'local':
406
+ $ext_legal = array( 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv' );
407
+ $ext = pathinfo( $url, PATHINFO_EXTENSION );
408
+
409
+ // check if extension is legal
410
+ if ( empty( $ext ) || ! in_array( $ext, $ext_legal ) ) {
411
+ return array( 'valid' => false );
412
+ }
413
+
414
+ $data = array(
415
+ 'provider' => 'local',
416
+ 'id' => self::get_post_by_url( $url ),
417
+ 'url' => $url,
418
+ );
419
+ break;
420
+ }
421
+
422
+ return ! empty( $data ) ? $data : false;
423
+ }
424
+
425
+
426
+ /**
427
+ * Sets a remote image as featured image for the given post.
428
+ *
429
+ * @since 1.5.0
430
+ *
431
+ * @param {int} $post_id
432
+ * @param {assoc} $data Video information data containing img_url
433
+ * @return {int} ID of the inserted attachment
434
+ */
435
+ private function set_featured_image( $post_id, $data ) {
436
+ // Is this screen capture already existing in our media library?
437
+ $img = self::get_post_by_custom_meta( '_fvp_image_url', $data['img_url'] );
438
+
439
+ if ( empty( $img ) ) {
440
+ $file = array(
441
+ 'name' => basename( $data['img_url'] ),
442
+ );
443
+
444
+ // Get external image
445
+ $file['tmp_name'] = download_url( $data['img_url'] );
446
+ if ( is_wp_error( $file['tmp_name'] ) ) {
447
+ return false;
448
+ }
449
+
450
+ // Insert into media library
451
+ $url_type = image_type_to_extension(
452
+ exif_imagetype( $file['tmp_name'] ),
453
+ false
454
+ );
455
+ $file['name'] = basename( $data['img_url'] . '.' . $url_type );
456
+ $img = media_handle_sideload( $file, $post_id );
457
+
458
+ // save picture source url in post meta
459
+ update_post_meta( $img, '_fvp_image_url', $data['img_url'] );
460
+ }
461
+
462
+ // set featured image
463
+ if ( ! has_post_thumbnail( $post_id ) ) {
464
+ set_post_thumbnail( $post_id, $img );
465
+ }
466
+
467
+ return $img;
468
+ }
469
+
470
+
471
+ /**
472
+ * Removes the old featured image.
473
+ *
474
+ * @since 1.4.0
475
+ *
476
+ * @param {int} $post_id
477
+ * @param {assoc} $meta FVP video meta data containing 'img' with
478
+ * the FVP image attachment ID.
479
+ */
480
+ private function delete_featured_image( $post_id, $meta ) {
481
+ if ( empty( $meta['img'] ) ) {
482
+ return false;
483
+ }
484
+
485
+ // Unset featured image if it is from this video
486
+ delete_post_meta( $post_id, '_thumbnail_id', $meta['img'] );
487
+
488
+ // Check if other posts use the image, if not we can delete it completely
489
+ $other = self::get_post_by_custom_meta( '_thumbnail_id', $meta['img'] );
490
+ if ( empty( $other ) && ! empty( $meta['img_url'] ) ) {
491
+ wp_delete_attachment( $meta['img'] );
492
+ delete_post_meta( $meta['img'], '_fvp_image_url', $meta['img_url'] );
493
+
494
+ // pre 2.0.0
495
+ delete_post_meta(
496
+ $meta['img'],
497
+ '_fvp_image',
498
+ $meta['provider'] . '?' . $meta['id']
499
+ );
500
+ }
501
+ }
502
+
503
+
504
+ /**
505
+ * Return video embed code.
506
+ *
507
+ * Located in backend class because all AJAX requests are handled on the
508
+ * admin side of WordPress - WordPress only distinguishes between
509
+ * priv and nopriv requests. This function is only called by the frontend
510
+ * JavaScript.
511
+ *
512
+ * @since 1.7.0
513
+ */
514
+ public function ajax_get_embed() {
515
+ header( 'Content-Type: application/json' );
516
+
517
+ // bad request
518
+ if ( ! wp_verify_nonce( $_POST['nonce'], 'featured-video-plus-nonce' ) ) {
519
+ $response = json_encode( array(
520
+ 'success' => false,
521
+ 'html' => 'invalid nonce',
522
+ ) );
523
+
524
+ // return featured video as requested
525
+ } elseif ( has_post_video( $_POST['id'] ) ) {
526
+ $meta = get_post_meta( $_POST['id'], '_fvp_video', true );
527
+ $video = get_the_post_video( $_POST['id'] );
528
+
529
+ $response = json_encode( array(
530
+ 'success' => 'true',
531
+ 'html' => $video,
532
+ 'id' => ! empty( $meta['id'] ) ? $meta['id'] : null,
533
+ ) );
534
+
535
+ // no video, return featured image
536
+ } else {
537
+ $image = get_the_post_thumbnail( $_POST['id'] );
538
+
539
+ $response = json_encode(array(
540
+ 'success' => 'false',
541
+ 'html' => $image,
542
+ ));
543
+ }
544
+
545
+ exit( $response );
546
+ }
547
+
548
+
549
+ /**
550
+ * Add a pointer to the Featured Video Plus box on the post edit screen for
551
+ * initial explanation.
552
+ *
553
+ * @param {array} $pointers
554
+ * @param {string} $hook
555
+ * @return {array}
556
+ */
557
+ public function pointers( $pointers, $hook ) {
558
+ if ( 'post.php' !== $hook && 'post-new.php' !== $hook ) {
559
+ return $pointers;
560
+ }
561
+
562
+ $pointers['fvp-post-box'] = array(
563
+ 'target' => '#featured-video-plus-box',
564
+ 'title' => esc_html__( 'Featured Videos', 'featured-video-plus' ),
565
+ 'content' => sprintf(
566
+ esc_html__(
567
+ 'Simply paste a URL into this input to add a bit extra life to your posts. %sTry an example%s.',
568
+ 'featured-video-plus'
569
+ ),
570
+ '<a href="#" onclick="jQuery(\'.fvp-video\').val(\'http://youtu.be/CfNHleTEpTI\').trigger(\'blur\'); return false;">',
571
+ '</a>'
572
+ ) . '</p><p>' . sprintf(
573
+ esc_html__(
574
+ 'To adjust how featured videos are displayed on the frontend checkout the %smedia settings%s.',
575
+ 'featured-video-plus'
576
+ ),
577
+ sprintf(
578
+ '<a href="%s/wp-admin/options-media.php#fvp-section">',
579
+ esc_attr( get_bloginfo( 'wpurl' ) )
580
+ ),
581
+ '</a>'
582
+ ),
583
+ 'position' => array(
584
+ 'align' => 'middle',
585
+ 'edge' => 'right'
586
+ )
587
+ );
588
+
589
+ return $pointers;
590
+ }
591
+
592
+
593
+ /**
594
+ * Adds a media settings link to the plugin info
595
+ *
596
+ * @since 1.2
597
+ */
598
+ public function plugin_action_link( $links, $file ) {
599
+ if ( $file == FVP_NAME . '/' . FVP_NAME . '.php' ) {
600
+ $settings_link = sprintf(
601
+ '<a href="%s/wp-admin/options-media.php">Media Settings</a>',
602
+ esc_attr( get_bloginfo( 'wpurl' ) )
603
+ );
604
+ array_unshift( $links, $settings_link );
605
+ }
606
+
607
+ return $links;
608
+ }
609
+
610
+
611
+ /**
612
+ * Add a notice about the requirement of a featured image to the
613
+ * featured image meta box.
614
+ *
615
+ * @param {string} $content
616
+ * @param {int} $post_id
617
+ * @return {string}
618
+ */
619
+ public function featured_image_notice( $content, $post_id ) {
620
+ if ( has_post_thumbnail( $post_id ) || ! has_post_video( $post_id ) ) {
621
+ return $content;
622
+ }
623
+
624
+ $notice = '<span class="fvp-notice">';
625
+ $notice .= __(
626
+ 'Featured Videos require a Featured Image for automatic replacement.',
627
+ 'featured-video-plus'
628
+ );
629
+ $notice .= '&nbsp;<a href="#" class="fvp-set-featimg hidden">' . __(
630
+ 'Auto set',
631
+ 'featured-video-plus'
632
+ ) . '</a>';
633
+ $notice .= '</span>';
634
+
635
+ return $notice . $content;
636
+ }
637
+
638
+
639
+ /**
640
+ * Initiates the upgrade (plugin installation or update) logic.
641
+ *
642
+ * @since 2.0.0
643
+ */
644
+ public function upgrade() {
645
+ $version = get_option( 'fvp-version' );
646
+ $options = $options_org = get_option( 'fvp-settings' );
647
+
648
+ // either execute install or upgrade logic
649
+ if ( empty( $version ) || empty( $options ) ) {
650
+ include_once( FVP_DIR . 'php/inc-install.php' );
651
+ } elseif ( $version !== FVP_VERSION ) {
652
+ include_once( FVP_DIR . 'php/inc-upgrade.php' );
653
+ }
654
+ }
655
+
656
+
657
+ /**
658
+ * Gets post id by it's url / guid.
659
+ *
660
+ * @see http://codex.wordpress.org/Class_Reference/wpdb
661
+ * @since 1.0
662
+ *
663
+ * @param {string} $url which url to look for
664
+ * @return {int} retrieved post ID
665
+ */
666
+ protected static function get_post_by_url( $url ) {
667
+ global $wpdb;
668
+
669
+ $id = $wpdb->get_var( $wpdb->prepare(
670
+ "SELECT ID FROM {$wpdb->posts} WHERE guid=%s;",
671
+ $url
672
+ ) );
673
+
674
+ return $id;
675
+ }
676
+
677
+
678
+ /**
679
+ * Check the given assoc array for a 'fvp_nonce' field and check if this
680
+ * field contains a valid nonce.
681
+ *
682
+ * @param {assoc} $post_data
683
+ * @return boolean
684
+ */
685
+ private static function has_valid_nonce( $post_data ) {
686
+ if (
687
+ ! isset( $post_data['fvp_nonce'] ) ||
688
+ ! wp_verify_nonce( $post_data['fvp_nonce'], FVP_NAME . FVP_VERSION )
689
+ ) {
690
+ return false;
691
+ }
692
+
693
+ return true;
694
+ }
695
+
696
+
697
+ }
php/class-frontend.php ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // dependencies
4
+ require_once( FVP_DIR . 'php/class-main.php' );
5
+
6
+ /**
7
+ * Class containing frontend functionality.
8
+ *
9
+ * Enqueue scripts/styles, replace featured images by featured videos or
10
+ * insert the ajax request handlers, add 'has-post-video' class and
11
+ * register the [featured-video-plus] shortcode.
12
+ *
13
+ * @since 1.0.0
14
+ */
15
+ class FVP_Frontend extends Featured_Video_Plus {
16
+
17
+ /**
18
+ * Creates a new instace of this class, saves the featured_video_instance.
19
+ *
20
+ * @since 1.0.0
21
+ */
22
+ public function __construct() {
23
+ parent::__construct();
24
+
25
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue' ) );
26
+
27
+ add_filter( 'post_thumbnail_html', array( $this, 'filter_post_thumbnail' ), 99, 5 );
28
+ add_filter( 'post_class', array( $this, 'has_post_video_class' ) );
29
+
30
+ add_shortcode( 'featured-video-plus', array( $this, 'shortcode' ) );
31
+ }
32
+
33
+
34
+ /**
35
+ * Enqueue all scripts and styles needed when viewing the frontend.
36
+ *
37
+ * @since 1.0.0
38
+ */
39
+ public function enqueue() {
40
+ $min = SCRIPT_DEBUG ? '' : '.min';
41
+
42
+ $options = get_option( 'fvp-settings' );
43
+ $mode = ! empty( $options['mode'] ) ? $options['mode'] : null;
44
+
45
+ wp_register_script(
46
+ 'jquery.fitvids',
47
+ FVP_URL . "js/jquery.fitvids$min.js",
48
+ array( 'jquery' ),
49
+ '1.1',
50
+ false
51
+ );
52
+
53
+ wp_register_script(
54
+ 'jquery.domwindow',
55
+ FVP_URL . "js/jquery.domwindow$min.js",
56
+ array( 'jquery' ),
57
+ FVP_VERSION
58
+ );
59
+
60
+ // Basic dependencies. Is extended in the following.
61
+ $jsdeps = array( 'jquery' );
62
+ $cssdeps = array();
63
+
64
+ // If the video loading is performed in a lazy fashion we cannot know onload
65
+ // if there is a local (html5) video - we need to require mediaelement.js
66
+ // just for the possibility that one will be loaded.
67
+ if ( 'overlay' === $mode || 'dynamic' === $mode ) {
68
+ $jsdeps[] = 'wp-mediaelement';
69
+ $cssdeps[] = 'wp-mediaelement';
70
+ }
71
+
72
+ // Is responsive video functionality required? Only when width is set to
73
+ // 'auto' and display mode is not set to overlay.
74
+ if (
75
+ ! empty($options['sizing']['responsive']) &&
76
+ $options['sizing']['responsive']
77
+ ) {
78
+ $jsdeps[] = 'jquery.fitvids';
79
+ }
80
+
81
+ // Is modal functionality required?
82
+ if ( 'overlay' === $options['mode'] ) {
83
+ $jsdeps[] = 'jquery.domwindow';
84
+ }
85
+
86
+ // general frontend script
87
+ wp_enqueue_script(
88
+ 'fvp-frontend',
89
+ FVP_URL . "js/frontend$min.js",
90
+ $jsdeps,
91
+ FVP_VERSION
92
+ );
93
+
94
+ // some context for JS
95
+ wp_localize_script( 'fvp-frontend', 'fvpdata', array(
96
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
97
+ 'nonce' => wp_create_nonce( 'featured-video-plus-nonce' ),
98
+ 'fitvids' => ! empty( $options['sizing']['responsive'] ) &&
99
+ $options['sizing']['responsive'],
100
+ 'dynamic' => 'dynamic' === $mode,
101
+ 'overlay' => 'overlay' === $mode,
102
+ 'opacity' => 0.75,
103
+ 'loadicon' => 'overlay' === $mode ? FVP_URL . 'img/loadicon_w.gif' :
104
+ FVP_URL . 'img/loadicon_b.gif',
105
+ 'playicon' => FVP_URL . 'img/playicon.png',
106
+ 'width' => ! empty( $options['sizing']['width'] ) ?
107
+ $options['sizing']['width'] : null
108
+ ));
109
+
110
+ // general frontend styles
111
+ wp_enqueue_style(
112
+ 'fvp-frontend',
113
+ FVP_URL . 'styles/frontend.css',
114
+ $cssdeps,
115
+ FVP_VERSION
116
+ );
117
+ }
118
+
119
+
120
+ /**
121
+ * Display featured videos in place of featured images if a featured video is available and only if so desired by user.
122
+ *
123
+ * @see http://wordpress.stackexchange.com/a/41858
124
+ * @since 1.0.0
125
+ *
126
+ * @param string $html featured image html, ready to echo
127
+ * @param int $post_id id of target post
128
+ * @param int $post_thumbnail_id id of featured image
129
+ * @param string|array $size desired size of featured image / video
130
+ * @param array $attr
131
+ */
132
+ public function filter_post_thumbnail(
133
+ $html,
134
+ $post_id,
135
+ $post_thumbnail_id,
136
+ $size,
137
+ $attr
138
+ ) {
139
+ $size = $this->get_size();
140
+
141
+ $options = get_option( 'fvp-settings' );
142
+ $mode = ! empty( $options['mode'] ) ? $options['mode'] : null;
143
+ $conditions = ! empty( $options['conditions'] ) ?
144
+ $options['conditions'] : array();
145
+
146
+ $conditions_hold = true;
147
+ foreach ( $conditions AS $fun => $value ) {
148
+ if ( $value && function_exists( 'is_' . $fun ) ) {
149
+ $conditions_hold = $conditions_hold && call_user_func( 'is_' . $fun );
150
+ }
151
+ }
152
+
153
+ if ( ( 'manual' === $mode ) ||
154
+ ( ! $conditions_hold ) ||
155
+ ( ! has_post_video( $post_id ) )
156
+ ) {
157
+ return $html;
158
+
159
+ } elseif ( 'dynamic' === $options['mode'] && ! is_single() ) {
160
+ return sprintf(
161
+ '<a href="#" data-id="%1$s" class="fvp-dynamic post-thumbnail">%2$s</a>',
162
+ $post_id,
163
+ $html
164
+ );
165
+
166
+ } elseif ( 'overlay' === $options['mode'] && ! is_single() ) {
167
+ return sprintf(
168
+ '<a href="#" data-id="%1$s" class="fvp-overlay post-thumbnail">%2$s</a>' .
169
+ '<div id="fvp-cache-%1$s" style="display: none;"></div>',
170
+ $post_id,
171
+ $html
172
+ );
173
+ }
174
+
175
+ return get_the_post_video( $post_id, $size );
176
+ }
177
+
178
+
179
+ /**
180
+ * Add a 'has-post-video' class to posts if appropriate.
181
+ *
182
+ * @since 2.0.0
183
+ *
184
+ * @param {array} $classes Existing classes
185
+ * @return {array} Updated classes
186
+ */
187
+ public function has_post_video_class( $classes ) {
188
+ global $post;
189
+
190
+ if ( has_post_video( $post->ID ) ) {
191
+ $classes[] = 'has-post-video';
192
+ }
193
+ return $classes;
194
+ }
195
+
196
+
197
+ /**
198
+ * Shortcode for usage in post or page entries. Echos the post's featured video.
199
+ *
200
+ * @since 1.0.0
201
+ *
202
+ * @param array $atts can contain the width and/or height how the featured video should be displayed in px, optional
203
+ */
204
+ public function shortcode($atts){
205
+ $w = isset($atts['width']) ? $atts['width'] : '';
206
+ $h = isset($atts['height']) ? $atts['height'] : '';
207
+
208
+ if ( has_post_video() ) {
209
+ return get_the_post_video( null, array( $w, $h ) );
210
+ }
211
+ }
212
+ }
php/class-help.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // dependencies
4
+ require_once( FVP_DIR . 'php/class-html.php' );
5
+
6
+ /**
7
+ * Class for handling help tabs.
8
+ */
9
+ class FVP_Help {
10
+
11
+ public function __construct() {
12
+ add_action( 'load-options-media.php', array( $this, 'functions' ) );
13
+ add_action( 'load-options-media.php', array( $this, 'shortcode' ) );
14
+ add_action( 'load-post.php', array( $this, 'post' ), 20 );
15
+ }
16
+
17
+
18
+ /**
19
+ * FVP post edit screen help tab.
20
+ */
21
+ public function post() {
22
+ $screen = get_current_screen();
23
+ $title = esc_html__( 'Featured Video Plus', 'featured-video-plus' );
24
+ $content = array();
25
+
26
+ // Tab Headline
27
+ $content[] = FVP_HTML::html( 'h3', $title );
28
+
29
+ // oEmbed
30
+ $content[] = FVP_HTML::html( 'p', sprintf(
31
+ esc_html__(
32
+ 'Take a video url from one of the %ssupported oembed providers%s and paste it into the Featured Video input field.',
33
+ 'featured-video-plus'
34
+ ),
35
+ '<a href="https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F" target="_blank">',
36
+ '</a>'
37
+ ) );
38
+
39
+ // Local
40
+ $content[] = FVP_HTML::html( 'p', sprintf(
41
+ esc_html__(
42
+ 'Alternatively you can select one of the videos from your media library using the small media icon to the right in the URL input field. The plugin makes use of %sWordPress\' native HTML5 video functionality%s - no gurantee for compatibility with all formats.',
43
+ 'featured-video-plus'
44
+ ),
45
+ '<a href="http://mediaelementjs.com/#browsers">',
46
+ '</a>'
47
+ ) );
48
+
49
+ // Uploading
50
+ $content[] = FVP_HTML::html( 'h4',
51
+ array( 'style' => 'margin-bottom: 0;' ),
52
+ esc_html__( 'Fixing upload errors', 'featured-video-plus' ) . ':'
53
+ );
54
+
55
+ $content[] = FVP_HTML::html( 'p',
56
+ array( 'style' => 'margin-bottom: 0;' ),
57
+ sprintf(
58
+ esc_html__(
59
+ 'Read %sthis%s on how to increase the maximum file upload size.',
60
+ 'featured-video-plus'
61
+ ),
62
+ '<a href="http://goo.gl/yxov27" target="_blank">',
63
+ '</a>'
64
+ )
65
+ );
66
+
67
+ // Register tab.
68
+ $screen->add_help_tab( array(
69
+ 'id' => 'featured-video-plus',
70
+ 'title' => $title,
71
+ 'content' => implode( '', $content ),
72
+ ) );
73
+ }
74
+
75
+
76
+ /**
77
+ * FVP PHP-Functions help tab.
78
+ */
79
+ public function functions() {
80
+ $screen = get_current_screen();
81
+
82
+ $title = 'Featured Video Plus: '. esc_html__(
83
+ 'PHP-Functions',
84
+ 'featured-video-plus'
85
+ );
86
+
87
+ $content = array();
88
+
89
+ // Tab Headline
90
+ $content[] = FVP_HTML::html( 'h3', $title );
91
+
92
+ // PHP functions
93
+ $content[] = FVP_HTML::unordered_list( array(
94
+ '<code>the_post_video( $size )</code>',
95
+ '<code>has_post_video( $post_id )</code>',
96
+ '<code>get_the_post_video( $post_id, $size )</code>',
97
+ '<code>get_the_post_video_url( $post_id )</code>',
98
+ '<code>get_the_post_video_image_url( $post_id )</code>',
99
+ '<code>get_the_post_video_image( $post_id )</code>',
100
+ ) );
101
+
102
+ // PHP function explanations
103
+ $content[] = FVP_HTML::html( 'p', sprintf(
104
+ esc_html_x(
105
+ 'All parameters are optional. If %1$s the current post\'s id will be used. %2$s is either a string %2$s or a 2-item array representing width and height in pixels, e.g. array(32,32).',
106
+ '%1$s is a boolean condition, \"post_id == null\", %2$s is a PHP variable, %2$s is a list of strings in paranthesis.',
107
+ 'featured-video-plus'
108
+ ),
109
+ '<code>post_id == null</code>',
110
+ '<code>$size</code>',
111
+ '(<code>thumbnail</code>, <code>medium</code>, <code>large</code> ' . esc_html__( 'or', 'featured-video-plus' ) . ' <code>full</code>)'
112
+ ) );
113
+
114
+ $content[] = FVP_HTML::html( 'p', sprintf(
115
+ esc_html__(
116
+ 'The functions are implemented corresponding to the original %sfunctions%s: They are intended to be used and to act the same way. Take a look into the WordPress Codex for further guidance:',
117
+ 'featured-video-plus'
118
+ ),
119
+ '<a href="http://codex.wordpress.org/Post_Thumbnails#Function_Reference" target="_blank">' . esc_html__( 'Featured Image' ) . '&nbsp;',
120
+ '</a>'
121
+ ) );
122
+
123
+ // WordPress Featured Image functions
124
+ $content[] = FVP_HTML::unordered_list( array(
125
+ '<code><a href="https://developer.wordpress.org/reference/functions/the_post_thumbnail/" target="_blank">get_the_post_thumbnail</a></code>',
126
+ '<code><a href="https://developer.wordpress.org/reference/functions/wp_get_attachment_image/" target="_blank">wp_get_attachment_image</a></code>',
127
+ ) );
128
+
129
+ // Register tab.
130
+ $screen->add_help_tab( array(
131
+ 'id' => 'fvp_help_functions',
132
+ 'title' => $title,
133
+ 'content' => implode( '', $content )
134
+ ) );
135
+ }
136
+
137
+
138
+ /**
139
+ * FVP Shortcode help tab.
140
+ */
141
+ public function shortcode() {
142
+ $screen = get_current_screen();
143
+ $title = esc_html__(
144
+ 'Featured Video Plus: Shortcode',
145
+ 'featured-video-plus'
146
+ );
147
+
148
+ $content = array();
149
+
150
+ // Tab Headline
151
+ $content[] = FVP_HTML::html( 'h3', $title );
152
+
153
+ $content[] = FVP_HTML::unordered_list( array(
154
+ '<code>[featured-video-plus]</code><br />' .
155
+ '<span>' .
156
+ esc_html__( 'Displays the video in its default size.', 'featured-video-plus' ) .
157
+ '</span>',
158
+ '<code>[featured-video-plus width=560]</code><br />' .
159
+ '<span>' .
160
+ esc_html__( 'Displays the video with a width of 300 pixel. Height will be fitted such that the aspect ratio is preserved.', 'featured-video-plus' ) .
161
+ '</span>',
162
+ '<code>[featured-video-plus width=560 height=315]</code><br />' .
163
+ '<span>' .
164
+ esc_html__( 'Displays the video with a fixed width and height.', 'featured-video-plus' ) .
165
+ '</span>',
166
+ ) );
167
+
168
+ // Register tab.
169
+ $screen->add_help_tab( array(
170
+ 'id' => 'fvp_help_shortcode',
171
+ 'title' => $title,
172
+ 'content' => implode( '', $content ),
173
+ ) );
174
+ }
175
+
176
+ }
php/class-html.php ADDED
@@ -0,0 +1,545 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FVP_HTML {
4
+
5
+ private static $name = 'fvphtml';
6
+
7
+
8
+ public static $screens;
9
+
10
+
11
+ public static function static_init() {
12
+ static $initiated;
13
+ if ( $initiated ) {
14
+ return;
15
+ }
16
+
17
+ add_action( 'admin_enqueue_scripts', array( get_class(), 'enqueue' ) );
18
+
19
+ $initiated = true;
20
+ }
21
+
22
+
23
+ public static function add_screens( $screens = array() ) {
24
+ self::$screens = array_merge( (array) self::$screens, (array) $screens );
25
+ }
26
+
27
+
28
+ public static function enqueue( $hook ) {
29
+ // only enqueue scripts/styles on the specified screens - if specified
30
+ if ( empty( self::$screens ) || ! in_array( $hook, self::$screens ) ) {
31
+ return;
32
+ }
33
+
34
+ // development or production?
35
+ $min = SCRIPT_DEBUG ? '' : '.min';
36
+
37
+ wp_enqueue_style(
38
+ 'fvphtml',
39
+ FVP_URL . 'styles/html.css',
40
+ array(
41
+ 'wp-pointer',
42
+ ),
43
+ FVP_VERSION
44
+ );
45
+
46
+ // - colorpicker
47
+ // - tabbed options
48
+ // - conditional showing/hiding options
49
+ wp_enqueue_script(
50
+ 'fvphtml',
51
+ FVP_URL . "js/html$min.js",
52
+ array(
53
+ 'jquery',
54
+ 'iris',
55
+ 'wp-pointer',
56
+ ),
57
+ FVP_VERSION
58
+ );
59
+
60
+
61
+ wp_localize_script(
62
+ 'fvphtml', // hook
63
+ 'fvphtml', // variable name
64
+ array(
65
+ 'prefix' => '.fvphtml',
66
+ 'pointers' => self::get_pointers( $hook ),
67
+ )
68
+ );
69
+ }
70
+
71
+ /**
72
+ * Generate an HTML tag. Atributes are escaped. Content is NOT escaped.
73
+ *
74
+ * @see https://github.com/scribu/wp-scb-framework/blob/r60/Util.php#L228
75
+ *
76
+ * @param {string} $tag tag name
77
+ * @param {array} $attributes attributes
78
+ * @param {string} $content tag content
79
+ * @return {string} composed HTML
80
+ */
81
+ public static function html( $tag ) {
82
+ static $SELF_CLOSING_TAGS = array(
83
+ 'area',
84
+ 'base',
85
+ 'basefont',
86
+ 'br',
87
+ 'hr',
88
+ 'input',
89
+ 'img',
90
+ 'link',
91
+ 'meta',
92
+ );
93
+
94
+ $args = func_get_args();
95
+
96
+ $tag = array_shift( $args );
97
+
98
+ if ( isset( $args[0] ) && is_array( $args[0] ) ) {
99
+ $closing = $tag;
100
+ $attributes = array_shift( $args );
101
+ foreach ( $attributes as $key => $value ) {
102
+ if ( false === $value ) {
103
+ continue;
104
+ }
105
+
106
+ if ( true === $value ) {
107
+ $value = $key;
108
+ }
109
+
110
+ $tag .= ' ' . $key . '="' . esc_attr( $value ) . '"';
111
+ }
112
+ } else {
113
+ list( $closing ) = explode( ' ', $tag, 2 );
114
+ }
115
+
116
+ if ( in_array( $closing, $SELF_CLOSING_TAGS ) ) {
117
+ return "<{$tag} />";
118
+ }
119
+
120
+ $content = implode( '', $args );
121
+
122
+ return "<{$tag}>{$content}</{$closing}>";
123
+ }
124
+
125
+
126
+ /**
127
+ * input
128
+ *
129
+ * @param {string} $name
130
+ * @param {string} $type
131
+ * @param {array} $attributes
132
+ * @return {string}
133
+ */
134
+ public static function input( $name, $type = 'text', $attributes = array() ) {
135
+ $legal_types = array(
136
+ 'text',
137
+ 'password',
138
+ 'checkbox',
139
+ 'radio',
140
+ 'color',
141
+ 'data',
142
+ 'datetime',
143
+ 'datetime-local',
144
+ 'email',
145
+ 'month',
146
+ 'number',
147
+ 'range',
148
+ 'search',
149
+ 'tel',
150
+ 'time',
151
+ 'url',
152
+ 'week',
153
+ );
154
+
155
+ if ( ! in_array( $type, $legal_types ) ) {
156
+ return '';
157
+ }
158
+
159
+ if ( is_string( $attributes ) ) {
160
+ $attributes = array(
161
+ 'value' => $attributes,
162
+ );
163
+ }
164
+
165
+ $input = self::html(
166
+ 'input',
167
+ array_merge( (array) $attributes, array(
168
+ 'name' => $name,
169
+ 'type' => $type,
170
+ ))
171
+ );
172
+
173
+ return $input;
174
+ }
175
+
176
+
177
+ /**
178
+ * label + input
179
+ *
180
+ * @param {string} $label
181
+ * @param {string} $name
182
+ * @param {array} $attributes (optional)
183
+ * @param {string} $type (optional)
184
+ * @return {string}
185
+ */
186
+ public static function labeled_input( $label, $name, $attributes = array(), $type = 'text' ) {
187
+ $input = self::input(
188
+ $name,
189
+ $type,
190
+ $attributes
191
+ );
192
+
193
+ $span = self::html(
194
+ 'span',
195
+ array( 'class' => self::$name . '-innerlabel' ),
196
+ $label
197
+ );
198
+
199
+ $label = self::html(
200
+ 'label',
201
+ array( 'class' => self::$name . '-label' ),
202
+ $span . $input
203
+ );
204
+
205
+ return $label;
206
+ }
207
+
208
+
209
+ /**
210
+ * checkbox/radio
211
+ *
212
+ * @param {string} $name Input name
213
+ * @param {string} $label Label for the input field, optional
214
+ * @param {string} $type Input type (checkbox/radio)
215
+ * @param {string/bool/int} $checked
216
+ * @return {string}
217
+ */
218
+ public static function tickable( $name, $label = null, $type = 'checkbox', $value = '1', $checked = null ) {
219
+ $legal_types = array( 'checkbox', 'radio' );
220
+
221
+ if ( ! in_array( $type, $legal_types ) ) {
222
+ return '';
223
+ }
224
+
225
+ $html = self::input(
226
+ $name,
227
+ $type,
228
+ array(
229
+ // there should be an option to force check the tickable using a boolean
230
+ 'checked' => $checked == $value,
231
+ 'value' => $value,
232
+ )
233
+ );
234
+
235
+ if ( ! empty( $label ) ) {
236
+ $html = self::html(
237
+ 'label',
238
+ array( 'class' => self::$name . '-label' ),
239
+ $html . ' ' . $label
240
+ );
241
+ }
242
+
243
+ return $html;
244
+ }
245
+
246
+
247
+ /**
248
+ * checkbox
249
+ *
250
+ * @param {string} $name
251
+ * @param {string} $label
252
+ * @param {boolean} $value
253
+ * @param {string/bool/int} $checked
254
+ * @param {boolean} $br
255
+ * @return {string}
256
+ */
257
+ public static function checkbox( $name, $label = null, $value = '1', $checked = null ) {
258
+ $html = self::tickable(
259
+ $name,
260
+ $label,
261
+ 'checkbox',
262
+ $value,
263
+ $checked
264
+ );
265
+
266
+ return $html;
267
+ }
268
+
269
+
270
+ /**
271
+ * Multiple checkboxes wrapped in a div.
272
+ *
273
+ * @param {string} $wrapper
274
+ * @param {assoc} $options Associative array containing all checkboxes to
275
+ * print in the following manner:
276
+ * name => [ label => 'LABEL', value => 'VALUE' ]
277
+ * Alternatively only name => label pairs, value
278
+ * default is true
279
+ * @param {assoc} $checked Associative array with the option names as keys
280
+ * and their checked conditions as value
281
+ * @return {string}
282
+ */
283
+ public static function checkboxes( $wrapper, $options, $checked ) {
284
+ $checkboxes = '';
285
+
286
+ foreach ( $options as $name => $data ) {
287
+ $label = is_array( $data ) ? $data['label'] : $data;
288
+ $value = is_array( $data ) ? $data['value'] : '1';
289
+
290
+ $checkboxes .= self::checkbox(
291
+ "{$wrapper}[{$name}]",
292
+ $label,
293
+ $value,
294
+ isset( $checked[ $name ] ) ? $checked[ $name ] : null
295
+ );
296
+ }
297
+
298
+ return $checkboxes;
299
+ }
300
+
301
+
302
+ /**
303
+ * radio
304
+ *
305
+ * @param {string} $name
306
+ * @param {string} $label
307
+ * @param {boolean} $value
308
+ * @param {string/bool/int} $checked
309
+ * @return {string}
310
+ */
311
+ public static function radio( $name, $label = null, $value = '1', $checked = null ) {
312
+ $radio = self::tickable(
313
+ $name,
314
+ $label,
315
+ 'radio',
316
+ $value,
317
+ $checked
318
+ );
319
+
320
+ return $radio;
321
+ }
322
+
323
+
324
+ /**
325
+ * Multiple radios wrapped in a div.
326
+ *
327
+ * @param {string} $name
328
+ * @param {assoc} $options Associative array containing value =>
329
+ * label pairs for all the individual radios.
330
+ * @param {string/bool/int} $checked
331
+ * @return {string}
332
+ */
333
+ public static function radios( $name, $options, $checked = null ) {
334
+ $radios = '';
335
+
336
+ foreach ( $options as $value => $label ) {
337
+ $radios .= self::radio( $name, $label, $value, $checked );
338
+ }
339
+
340
+ $wrapped = self::html(
341
+ 'div',
342
+ array(
343
+ 'class' => implode( ' ', array(
344
+ self::$name . '-radios',
345
+ )),
346
+ 'data-name' => $name,
347
+ ),
348
+ $radios
349
+ );
350
+
351
+ return $wrapped;
352
+ }
353
+
354
+
355
+ /**
356
+ *
357
+ * @see http://automattic.github.io/Iris/
358
+ * @since 1.0.0
359
+ *
360
+ * @param {string} $title input label content
361
+ * @param {string} $name input name
362
+ * @param {string} $default default HEX color
363
+ * @return {string} Rendered HTML
364
+ */
365
+ public static function colorpicker( $title, $name, $default = null ) {
366
+ $title = self::html(
367
+ 'span',
368
+ array( 'class' => self::$name . '-innerlabel' ),
369
+ $title
370
+ );
371
+
372
+ $input = self::input(
373
+ $name,
374
+ 'text',
375
+ array(
376
+ 'value' => $default,
377
+ 'data-default' => $default,
378
+ 'class' => self::$name . '-colorpicker',
379
+ )
380
+ );
381
+
382
+ $reset = self::html(
383
+ 'span',
384
+ array( 'class' => self::$name . '-reset' ),
385
+ '&times;'
386
+ );
387
+
388
+ $html = self::html(
389
+ 'label',
390
+ array( 'class' => self::$name . '-label' ),
391
+ $title . $input . $reset
392
+ );
393
+
394
+ return $html;
395
+ }
396
+
397
+
398
+ public static function tabbed( $tabs ) {
399
+ // render each tab
400
+ $rendered = [];
401
+ foreach ( $tabs as $title => $content ) {
402
+ $hook = sanitize_file_name( $title );
403
+
404
+ // use array unshift to have the titles at the front in the html source
405
+ $rendered[] = self::html(
406
+ 'span',
407
+ array(
408
+ 'class' => 'fvphtml-tab-title',
409
+ 'data-hook' => $hook,
410
+ ),
411
+ $title
412
+ );
413
+
414
+ $rendered[] = self::html(
415
+ 'div',
416
+ array(
417
+ 'class' => 'fvphtml-tab-body',
418
+ 'data-hook' => $hook,
419
+ ),
420
+ implode( '', (array) $content )
421
+ );
422
+ }
423
+
424
+ // wrap all tabs in a parent container
425
+ $html = self::html(
426
+ 'div',
427
+ array( 'class' => 'fvphtml-tabs' ),
428
+ implode( '', $rendered )
429
+ );
430
+
431
+ return $html;
432
+ }
433
+
434
+
435
+ public static function description( $content, $additional_classes = array() ) {
436
+ $html = self::html(
437
+ 'p',
438
+ array(
439
+ 'class' => implode( ' ', array_merge(
440
+ array( 'description' ),
441
+ (array) $additional_classes
442
+ ) )
443
+ ),
444
+ $content
445
+ );
446
+
447
+ return $html;
448
+ }
449
+
450
+
451
+ public static function unordered_list( $items, $classes = array() ) {
452
+ $html = '';
453
+ foreach ( $items as $item ) {
454
+ $html .= self::html(
455
+ 'li',
456
+ $item
457
+ );
458
+ }
459
+
460
+ $html = self::html(
461
+ 'ul',
462
+ array( 'class' => implode( ' ', (array) $classes ) ),
463
+ $html
464
+ );
465
+
466
+ return $html;
467
+ }
468
+
469
+
470
+ public static function conditional( $object, $args ) {
471
+ $hidden = ! empty( $args['hidden'] ) ? $args['hidden'] : null;
472
+ unset( $args['hidden'] );
473
+
474
+ $name = implode( '|', array_keys( $args ) );
475
+ $value = implode( '|', array_values( $args ) );
476
+
477
+ $html = self::html(
478
+ 'div',
479
+ array(
480
+ 'class' => implode( ' ', array(
481
+ self::$name . '-conditional',
482
+ $hidden ? 'hidden' : '',
483
+ )),
484
+ 'data-names' => $name,
485
+ 'data-values' => $value,
486
+ ),
487
+ $object
488
+ );
489
+
490
+ return $html;
491
+ }
492
+
493
+
494
+ /**
495
+ * Generates the list of pointers using the 'fvphtml_pointers' filter.
496
+ *
497
+ * @param {string} $hook Current page hook for prefiltering pointers using
498
+ * the filter.
499
+ * @return {array} Array of pointers ready to throw into wp_localize_script.
500
+ */
501
+ public static function get_pointers( $hook = null ) {
502
+ /**
503
+ * 'fvphtml_pointers' filter
504
+ *
505
+ * Expects:
506
+ * array(
507
+ * 'identifier' {string} => assoc(
508
+ * 'target' => {string} (jQuery selector) [required],
509
+ * 'title' => {string} [optional, default: ''],
510
+ * 'content' => {string} [optional, default: ''],
511
+ * 'position' => array(
512
+ * 'edge' => {string} [optional, default: 'right'],
513
+ * 'align' => {string} [optional, default: 'middle'],
514
+ * )
515
+ * )
516
+ * )
517
+ */
518
+ $unfiltered_pointers = apply_filters( 'fvphtml_pointers', array(), $hook );
519
+
520
+ // Get already dismissed pointers from database.
521
+ $dismissed_pointers = explode(',', (string) get_user_meta(
522
+ get_current_user_id(),
523
+ 'dismissed_wp_pointers',
524
+ true
525
+ ));
526
+
527
+ // Filter out already dismissed pointers.
528
+ $filtered_pointers = array_diff(
529
+ array_keys( $unfiltered_pointers ),
530
+ $dismissed_pointers
531
+ );
532
+
533
+ // Create nice array of not yet dismissed pointers.
534
+ $pointers = array();
535
+ foreach ( $filtered_pointers AS $pointer ) {
536
+ $unfiltered_pointers[ $pointer ][ 'identifier' ] = $pointer;
537
+ $pointers[] = $unfiltered_pointers[ $pointer ];
538
+ }
539
+
540
+ return $pointers;
541
+ }
542
+
543
+ }
544
+
545
+ FVP_HTML::static_init();
php/class-main.php ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class containing all functions needed on front- AND backend. Functions only needed on one of those are found in distinct classes.
4
+ *
5
+ * @since 1.0.0
6
+ */
7
+ class Featured_Video_Plus {
8
+ protected $oembed;
9
+
10
+ public function __construct() {
11
+ require_once( FVP_DIR . 'php/class-oembed.php' );
12
+ $this->oembed = new FVP_oEmbed();
13
+
14
+ add_action( 'plugins_loaded', array( $this, 'language' ) );
15
+ }
16
+
17
+
18
+ /**
19
+ * Returns the featured video html, ready to echo.
20
+ *
21
+ * @since 1.0.0
22
+ *
23
+ * @param int $post_id
24
+ * @param string|array $size
25
+ */
26
+ public function get_the_post_video( $post_id = null, $size = null ) {
27
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
28
+
29
+ if ( ! has_post_video( $post_id ) ) {
30
+ return '';
31
+ }
32
+
33
+ $meta = get_post_meta( $post_id, '_fvp_video', true );
34
+ $options = get_option( 'fvp-settings' );
35
+
36
+ // Extract default and default->general options for easy access.
37
+ $defaults = ! empty( $options['default_args'] ) ?
38
+ $options['default_args'] : array();
39
+ $general = ! empty( $defaults['general'] ) ? $defaults['general'] : array();
40
+
41
+ // Autoplay option. Suppressed when viewing admin.
42
+ $general['autoplay'] =
43
+ ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ! is_admin() ) &&
44
+ ! empty( $general['autoplay'] ) && $general['autoplay'] ? '1' : null;
45
+
46
+ // Responsive scaling option. Not used when viewing the admin screen.
47
+ $responsive =
48
+ ! empty($options['sizing']['responsive']) &&
49
+ $options['sizing']['responsive'] &&
50
+ ( ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || ! is_admin() );
51
+
52
+ // Alignment option
53
+ $align = ! empty($options['alignment']) ? $options['alignment'] : 'center';
54
+
55
+ $args = array(
56
+ 'id' => ! empty( $meta['id'] ) ? $meta['id'] : null,
57
+ 'provider' => ! empty( $meta['provider'] ) ? $meta['provider'] : null,
58
+ );
59
+
60
+ $provider = $args['provider'];
61
+ switch ( $provider ) {
62
+ case 'local':
63
+ $img_meta = wp_get_attachment_metadata( $meta['id'] );
64
+ $size = $this->get_size( $size, array(
65
+ 'width' => ! empty($img_meta['width'] ) ? $img_meta['width'] : null,
66
+ 'height' => ! empty($img_meta['height']) ? $img_meta['height'] : null,
67
+ ) );
68
+
69
+ $atts = array(
70
+ 'src' => wp_get_attachment_url( $meta['id'] ),
71
+ 'autoplay' => $general['autoplay'] ? 'on' : null,
72
+ 'loop' => ! empty( $general['loop'] ) ? 'on' : null,
73
+ // use massive video size/height for responsive videos because
74
+ // fitvids does not upscale videos
75
+ 'width' => $responsive ? $size['width'] * 8 : $size['width'],
76
+ 'height' => $responsive ? $size['height'] * 8 : $size['height'],
77
+ );
78
+
79
+ $args = array_merge( $args, $atts );
80
+ $embed = wp_video_shortcode( $atts );
81
+ $embed = apply_filters( 'fvp-local', $embed, $args );
82
+ break;
83
+
84
+ case 'raw':
85
+ $embed = $meta['full'];
86
+ break;
87
+
88
+ default:
89
+ $atts = array_merge(
90
+ $general,
91
+ $this->get_size( $size ),
92
+ ! empty( $defaults[ $provider ] ) ? $defaults[ $provider ] : array(),
93
+ isset( $meta['parameters'] ) ? $meta['parameters'] : array()
94
+ );
95
+
96
+ $args = array_merge( $args, $atts );
97
+ $embed = $this->oembed->get_html( $meta['full'], $atts, $provider );
98
+ $embed = apply_filters( 'fvp-oembed', $embed, $args );
99
+ break;
100
+ }
101
+
102
+ if ( empty( $embed ) ) {
103
+ return '';
104
+ }
105
+
106
+ $classnames = array(
107
+ 'featured-video-plus' => true,
108
+ 'post-thumbnail' => true,
109
+ 'fvp-responsive' => $responsive,
110
+ );
111
+ $classnames[ 'fvp-' . $provider ] = ! empty( $provider );
112
+ $classnames[ 'fvp-' . $align ] = ! empty( $align );
113
+
114
+ $embed = sprintf(
115
+ "<!-- Featured Video Plus v%s -->\n<div%s>%s</div>\n\n",
116
+ FVP_VERSION,
117
+ $this->class_names($classnames, true, true),
118
+ $embed
119
+ );
120
+
121
+ return $embed;
122
+ }
123
+
124
+
125
+ /**
126
+ * Determine featured video size
127
+ *
128
+ * @since 1.4.0
129
+ *
130
+ * @param {array|string} Either a array containing a fixed width and height
131
+ * at key 0 and 1 respectively or a string specifying
132
+ * a predefined size:
133
+ * thumbnail | thumb | medium | large
134
+ * @return {array} The desired video size also taking the options set
135
+ * in the media settings into consideration.
136
+ */
137
+ protected function get_size( $size = null, $original = null ) {
138
+ $options = get_option( 'fvp-settings' );
139
+
140
+ // fixed size requested as array( width => #, height => # ) or array( #, # )
141
+ if ( is_array( $size ) ) {
142
+ $width = isset( $size['width'] ) && is_numeric( $size['width'] ) ?
143
+ $size['width'] :
144
+ ( isset( $size[0] ) && is_numeric( $size[0] ) ? $size[0] : null );
145
+ $height = isset( $size['height'] ) &&is_numeric( $size['height'] ) ?
146
+ $size['height'] :
147
+ ( isset( $size[1] ) && is_numeric( $size[1] ) ? $size[1] : null );
148
+
149
+ // size requested using a string pointing to a WordPress preset
150
+ } elseif ( is_string( $size ) ) {
151
+ global $_wp_additional_image_sizes;
152
+ $presets = get_intermediate_image_sizes();
153
+ foreach ( $presets as $preset ) {
154
+ if ( $preset == $size ) {
155
+ if ( in_array( $preset, array( 'thumbnail', 'medium', 'large' ) ) ) {
156
+ $width = get_option( $preset . '_size_w' );
157
+ $height = get_option( $preset . '_size_h' );
158
+ } elseif ( isset( $_wp_additional_image_sizes[ $preset ] ) ) {
159
+ $width = $_wp_additional_image_sizes[ $preset ]['width'];
160
+ $height = $_wp_additional_image_sizes[ $preset ]['height'];
161
+ }
162
+ }
163
+ }
164
+
165
+ // single number provided - use it for the width
166
+ } elseif ( is_numeric( $size ) ) {
167
+ $width = $size;
168
+ }
169
+
170
+ if ( empty( $width ) ) {
171
+ $width = ! empty( $options['sizing']['width'] ) ?
172
+ $options['sizing']['width'] : 1280;
173
+ }
174
+
175
+ if ( empty( $height ) ) {
176
+ // calculate height relative to width
177
+ $height = ! empty( $original ) ?
178
+ round( $original['height'] * ($width / $original['width']) ) :
179
+ $height = $width / 16 * 9;
180
+ }
181
+
182
+ return array(
183
+ 'width' => $width,
184
+ 'height' => $height,
185
+ );
186
+ }
187
+
188
+
189
+ /**
190
+ * Gets a post by an meta_key meta_value pair. Returns it's post_id.
191
+ *
192
+ * @see http://codex.wordpress.org/Class_Reference/wpdb
193
+ * @see http://dev.mysql.com/doc/refman/5.0/en/regexp.html#operator_regexp
194
+ * @since 1.0.0
195
+ *
196
+ * @param string $meta_key which meta_key to look for
197
+ * @param string $meta_value which meta_value to look for
198
+ */
199
+ protected static function get_post_by_custom_meta(
200
+ $meta_key,
201
+ $meta_value = null
202
+ ) {
203
+ global $wpdb;
204
+ if ( $meta_value !== null ) {
205
+ $prepared = $wpdb->prepare(
206
+ "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key=%s AND meta_value=%s LIMIT 1",
207
+ $meta_key,
208
+ $meta_value
209
+ );
210
+ return $wpdb->get_var( $prepared );
211
+ } else {
212
+ $prepared = $wpdb->prepare(
213
+ "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key=%s",
214
+ $meta_key
215
+ );
216
+ return $wpdb->get_col( $prepared );
217
+ }
218
+ }
219
+
220
+
221
+ /**
222
+ * Initializes i18n
223
+ *
224
+ * @since 1.3.0
225
+ */
226
+ public function language() {
227
+ load_plugin_textdomain(
228
+ 'featured-video-plus',
229
+ FVP_DIR . 'lng/',
230
+ FVP_NAME . '/lng/'
231
+ );
232
+ }
233
+
234
+
235
+ /**
236
+ *
237
+ * @param {assoc} $assoc
238
+ * @param {boolean} $attribute
239
+ * @param {boolean} $leadingspace
240
+ * @param {boolean} $trailingspace
241
+ * @return {string}
242
+ */
243
+ protected function class_names(
244
+ $assoc,
245
+ $attribute = false,
246
+ $leadingspace = false,
247
+ $trailingspace = false
248
+ ) {
249
+ // Attribute opening and leading space.
250
+ $string = $leadingspace ? ' ' : '';
251
+ $string .= $attribute ? 'class="' : '';
252
+
253
+ // Class list.
254
+ $classes = array();
255
+ foreach ( $assoc AS $key => $val ) {
256
+ if ( $val ) {
257
+ $classes[] = $key;
258
+ }
259
+ }
260
+ $string .= implode( ' ', $classes );
261
+
262
+ // Closing the attribute and trailing space.
263
+ $string .= $attribute ? '"' : '';
264
+ $string .= $trailingspace ? ' ' : '';
265
+
266
+ return $string;
267
+ }
268
+
269
+ /**
270
+ *
271
+ * @param {assoc} $assoc
272
+ * @param {boolean} $attribute
273
+ * @param {boolean} $leadingspace
274
+ * @param {boolean} $trailingspace
275
+ * @return {string}
276
+ */
277
+ protected function inline_styles(
278
+ $assoc,
279
+ $attribute = false,
280
+ $leadingspace = false,
281
+ $trailingspace = false
282
+ ) {
283
+ // Attribute opening and leading space.
284
+ $string = $leadingspace ? ' ' : '';
285
+ $string .= $attribute ? 'style="' : '';
286
+
287
+ // Style body.
288
+ foreach ( $assoc AS $key => $val ) {
289
+ if ( is_bool( $val ) && true === $val ) {
290
+ // $key is a property: value pair and $val a boolean condition
291
+ $string .= esc_attr( $key ) . '; ';
292
+ } else {
293
+ // $key is a property and $val a value
294
+ $string .= sprintf( '%s: %s; ', esc_attr( $key ), esc_attr( $val ) );
295
+ }
296
+ }
297
+
298
+ // Closing the attribute and trailing space.
299
+ $string .= $attribute ? '"' : '';
300
+ $string .= $trailingspace ? ' ' : '';
301
+
302
+ return $string;
303
+ }
304
+ }
php/class-oembed.php ADDED
@@ -0,0 +1,481 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class providing additional functionality to WordPress' native oEmbed
4
+ * functionality.
5
+ *
6
+ * @link http://codex.wordpress.org/oEmbed
7
+ * @link http://oembed.com/ oEmbed Homepage
8
+ * @link https://github.com/WordPress/WordPress/tree/master/wp-includes/class-oembed.php
9
+ *
10
+ * @package Featured Video Plus
11
+ * @subpackage oEmbed
12
+ * @since 2.0.0
13
+ */
14
+ class FVP_oEmbed {
15
+ private $oembed;
16
+
17
+ public function __construct() {
18
+ // Does not extend oEmbed in order to not initialize it a second time.
19
+ require_once( ABSPATH . '/' . WPINC . '/class-oembed.php' );
20
+ $this->oembed = _wp_oembed_get_object();
21
+
22
+ add_filter(
23
+ 'oembed_fetch_url', array( $this, 'additional_arguments' ), 10, 3
24
+ );
25
+ }
26
+
27
+
28
+ /**
29
+ * Call methods from 'oembed' class if they don't exist here.
30
+ *
31
+ * @param {string} $method
32
+ * @param {array} $args
33
+ * @return {} Whatever the other method returns.
34
+ */
35
+ public function __call( $method, $args ) {
36
+ return call_user_func_array( array( $this->oembed, $method ), $args );
37
+ }
38
+
39
+
40
+ /**
41
+ * Utilizes the WordPress oembed class for fetching the oembed info object.
42
+ *
43
+ * @see http://oembed.com/
44
+ * @since 2.0.0
45
+ */
46
+ public function request( $url ) {
47
+ // fetch the oEmbed data with some arbitrary big size to get the biggest
48
+ // thumbnail possible.
49
+ $raw = $this->oembed->fetch(
50
+ $this->get_provider( $url ),
51
+ $url,
52
+ array(
53
+ 'width' => 4096,
54
+ 'height' => 4096,
55
+ )
56
+ );
57
+
58
+ return ! empty( $raw ) ? $raw : false;
59
+ }
60
+
61
+
62
+ /**
63
+ * The do-it-all function that takes a URL and attempts to return the HTML.
64
+ *
65
+ * @see WP_oEmbed::get_html()
66
+ *
67
+ * @param {string} $url The URL to the content that should be embedded.
68
+ * @param {array} $args Optional arguments. Usually passed from a shortcode.
69
+ * @return {false/string} False on failure, other the embed HTML.
70
+ */
71
+ public function get_html( $url, $args = array(), $provider = null ) {
72
+ if ( $provider ) {
73
+ $args = $this->filter_legal_args( $provider, $args );
74
+ }
75
+
76
+ $html = $this->oembed->get_html( $url, $args );
77
+
78
+ if ( empty( $provider ) ) {
79
+ return $html;
80
+ }
81
+
82
+ // Some providers do not provide it's player API to oEmbed requests,
83
+ // therefore the plugin needs to manually interfere with their iframe's
84
+ // source URL..
85
+ switch ( $provider ) {
86
+
87
+ // YouTube.com
88
+ case 'youtube':
89
+ // Add `origin` paramter.
90
+ $args['origin'] = urlencode( get_bloginfo( 'url' ) );
91
+
92
+ // The loop parameter does not work with single videos if there is no
93
+ // playlist defined. Workaround: Set playlist to video itself.
94
+ // @see https://developers.google.com/youtube/player_parameters#loop-supported-players
95
+ if ( ! empty( $args['loop'] ) && $args['loop'] ) {
96
+ $args['playlist'] = $this->get_youtube_video_id( $url );
97
+ }
98
+
99
+ // Remove fullscreen button manually because the YouTube API
100
+ // does not care about `&fs=0`.
101
+ if ( array_key_exists( 'fs', $args ) && $args['fs'] == 0 ) {
102
+ $html = str_replace( 'allowfullscreen', '', $html );
103
+ }
104
+
105
+ // We strip the 'feature=oembed' from the parameters because it breaks
106
+ // some parameters.
107
+ $hook = '?feature=oembed';
108
+ $html = str_replace( $hook, '', $html );
109
+ break;
110
+
111
+ // DailyMotion.com
112
+ case 'dailymotion':
113
+ $args = $this->translate_time_arg( $args );
114
+ break;
115
+ }
116
+
117
+ if ( ! empty( $args ) ) {
118
+ $pattern = "/src=([\"'])([^\"']*)[\"']/";
119
+ preg_match( $pattern, $html, $match );
120
+ if ( ! empty( $match[1] ) && ! empty( $match[2] ) ) {
121
+ $replace = sprintf('src=$1%s$1', add_query_arg( $args, $match[2] ) );
122
+ $html = preg_replace( $pattern, $replace, $html );
123
+ }
124
+ }
125
+
126
+ return $html;
127
+ }
128
+
129
+
130
+ /**
131
+ * Enable additional parameters for oEmbed requests from inside the plugin.
132
+ * The plugin only allows a limited set of parameters.
133
+ *
134
+ * @see https://core.trac.wordpress.org/ticket/16996#comment:18
135
+ * @param {string} $provider The oEmbed provider (as URL)
136
+ * @param {string} $url The oEmbed request URL
137
+ * @param {assoc} $args The additional parameters for the provider
138
+ * @return {string} $provider with added parameters.
139
+ */
140
+ public function additional_arguments( $provider, $url, $args ) {
141
+ unset(
142
+ $args['width'],
143
+ $args['height'],
144
+ $args['discover']
145
+ );
146
+
147
+ return add_query_arg( $args, $provider );;
148
+ }
149
+
150
+
151
+ /**
152
+ * Extracts the arguments (query and fragment) from a given URL and filters
153
+ * them to only contain arguments legal for the given provider.
154
+ *
155
+ * @since 2.0.0
156
+ *
157
+ * @param {string} $url oEmbed request URL
158
+ * @param {string} $provider Provider name (optional)
159
+ * @param {bool} $filter_legals If the retrieved arguments should be
160
+ * filtered to only contain legals
161
+ * @return {assoc} Associative array containing the arguments as key value
162
+ * pairs
163
+ */
164
+ public function get_args( $url, $provider = null, $filter_legals = true ) {
165
+ $args = $this->parse_url_args( $url );
166
+
167
+ if ( $filter_legals ) {
168
+ $provider = empty( $provider ) ?
169
+ $this->get_provider_name( $url ) :
170
+ $provider;
171
+
172
+ $args = $this->filter_legal_args( $provider, $args );
173
+ }
174
+
175
+ return $args;
176
+ }
177
+
178
+
179
+ /**
180
+ * Extracts the provider name in lowercase from a given URL.
181
+ *
182
+ * @since 2.0.0
183
+ * @param {string} $url oEmbed request URL
184
+ * @return {string} Provider name
185
+ */
186
+ public function get_provider_name( $url ) {
187
+ $host = parse_url( $url, PHP_URL_HOST );
188
+
189
+ $tlds_set = array(
190
+ 'com',
191
+ 'net',
192
+ 'tv',
193
+ );
194
+
195
+ $tlds = '(?:' . implode( ')|(?:', $tlds_set ) . ')';
196
+ $pattern = '/(?:www\.)?(.*)\.' . $tlds . '/';
197
+
198
+ preg_match( $pattern , $host, $match );
199
+
200
+ if ( ! empty( $match[1] ) ) {
201
+ return strtolower( $match[1] );
202
+ }
203
+
204
+ return false;
205
+ }
206
+
207
+
208
+ /**
209
+ * Takes a URL and returns the corresponding oEmbed provider's URL, if there
210
+ * is one.
211
+ *
212
+ * Backport from WordPress 4.0.0 to make this method available for earlier
213
+ * WordPress releases.
214
+ * @see https://github.com/WordPress/WordPress/blob/ed4aafa6929b36dc1d06708831a7cef258c16b54/wp-includes/class-oembed.php#L188-L226
215
+ *
216
+ * @param string $url The URL to the content.
217
+ * @param string|array $args Optional provider arguments.
218
+ * @return false|string False on failure, otherwise the oEmbed provider URL.
219
+ */
220
+ public function get_provider( $url, $args = '' ) {
221
+ // If the WordPress native oembed class has the get_provider function,
222
+ // use that one.
223
+ if ( method_exists( $this->oembed, 'get_provider' ) ) {
224
+ return $this->oembed->get_provider( $url, $args );
225
+ }
226
+
227
+ $provider = false;
228
+ if ( ! isset( $args['discover'] ) ) {
229
+ $args['discover'] = true;
230
+ }
231
+
232
+ foreach ( $this->oembed->providers AS $matchmask => $data ) {
233
+ list( $providerurl, $regex ) = $data;
234
+
235
+ // Turn the asterisk-type provider URLs into regex
236
+ if ( ! $regex ) {
237
+ $matchmask = '#' . str_replace(
238
+ '___wildcard___',
239
+ '(.+)',
240
+ preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' )
241
+ ) . '#i';
242
+ $matchmask = preg_replace(
243
+ '|^#http\\\://|', '#https?\://', $matchmask
244
+ );
245
+ }
246
+
247
+ if ( preg_match( $matchmask, $url ) ) {
248
+ // JSON is easier to deal with than XML
249
+ $provider = str_replace( '{format}', 'json', $providerurl );
250
+ break;
251
+ }
252
+ }
253
+
254
+ if ( ! $provider && $args['discover'] ) {
255
+ $provider = $this->oembed->discover( $url );
256
+ }
257
+
258
+ return $provider;
259
+ }
260
+
261
+
262
+ /**
263
+ * Only keeps key value pairs of the source $array if their keys are listed
264
+ * in the $filter array.
265
+ *
266
+ * @since 2.0.0
267
+ *
268
+ * @param {assoc} $array Associative array to filter
269
+ * @param {array} $filter Enumerated array containing the legal keys to keep
270
+ * @return {assoc} Filtered array
271
+ */
272
+ private function filter_legal_args( $provider, $args ) {
273
+ $legals = array(
274
+
275
+ // YouTube.com
276
+ // https://developers.google.com/youtube/player_parameters
277
+ 'youtube' => array(
278
+ 'autohide',
279
+ 'autoplay',
280
+ 'cc_load_policy',
281
+ 'color',
282
+ 'controls',
283
+ 'disablekb',
284
+ 'enablejsapi',
285
+ 'end',
286
+ 'fs',
287
+ 'hl',
288
+ 'iv_load_policy',
289
+ 'list',
290
+ 'listType',
291
+ 'loop',
292
+ 'modestbranding',
293
+ 'origin',
294
+ 'playerapiid',
295
+ 'playlist',
296
+ 'playsinline',
297
+ 'rel',
298
+ 'showinfo',
299
+ 'start',
300
+ 'theme',
301
+ ),
302
+
303
+ // Vimeo.com
304
+ // http://developer.vimeo.com/apis/oembed
305
+ 'vimeo' => array(
306
+ 'byline',
307
+ 'title',
308
+ 'portrait',
309
+ 'color',
310
+ 'autoplay',
311
+ 'autopause',
312
+ 'loop',
313
+ 'api',
314
+ 'player_id',
315
+ ),
316
+
317
+ // DailyMotion.com
318
+ // http://www.dailymotion.com/doc/api/player.html
319
+ 'dailymotion' => array(
320
+ 'wmode',
321
+ 'autoplay',
322
+ 'api',
323
+ 'background',
324
+ 'chromeless',
325
+ 'controls',
326
+ 'foreground',
327
+ 'highlight',
328
+ 'html',
329
+ 'id',
330
+ 'info',
331
+ 'logo',
332
+ 'network',
333
+ 'quality',
334
+ 'related',
335
+ 'startscreen',
336
+ 'start',
337
+ 't',
338
+ 'syndication',
339
+ ),
340
+
341
+ // SoundCloud.com
342
+ // https://developers.soundcloud.com/docs/oembed
343
+ 'soundcloud' => array(
344
+ 'auto_play',
345
+ 'auto_play' => 'autoplay', // map autoplay to auto_play
346
+ 'color',
347
+ 'show_comments',
348
+ ),
349
+ );
350
+
351
+ $result = array();
352
+
353
+ if ( ! empty( $legals[ $provider ] ) ) {
354
+ foreach ( $legals[ $provider ] AS $key => $value ) {
355
+ if ( array_key_exists( $value, $args ) &&
356
+ ! is_null( $args[ $value ] )
357
+ ) {
358
+ $key = is_numeric( $key ) ? $value : $key;
359
+ $result[ $key ] = urlencode( $args[ $value ] );
360
+ }
361
+ }
362
+ }
363
+
364
+ return $result;
365
+ }
366
+
367
+
368
+ /**
369
+ * Function used for retrieving query (?..&..) and fragment (#..) arguments
370
+ * of a given URL.
371
+ *
372
+ * @see http://php.net/manual/en/function.parse-url.php
373
+ * @see http://php.net/manual/en/function.parse-str.php
374
+ * @since 2.0.0
375
+ *
376
+ * @param {string} $url the URL to parse for arguments
377
+ * @return array containing query and fragment arguments
378
+ */
379
+ private function parse_url_args( $url ) {
380
+ // parse query
381
+ $query = parse_url( $url, PHP_URL_QUERY );
382
+ $query_args = array();
383
+ parse_str( $query, $query_args );
384
+
385
+ // parse fragment
386
+ $fragment = parse_url( $url, PHP_URL_FRAGMENT );
387
+ $fragment_args = array();
388
+ parse_str( $fragment, $fragment_args );
389
+
390
+ // merge query and fragment args
391
+ $args = array_merge(
392
+ $query_args,
393
+ $fragment_args
394
+ );
395
+
396
+ return $args;
397
+ }
398
+
399
+
400
+ /**
401
+ * Calculates the amount of seconds depicted by a string structured like one
402
+ * of the following possibilities:
403
+ * ##m##s
404
+ * ##m
405
+ * ##s
406
+ * ##
407
+ *
408
+ * @since 2.0.0
409
+ *
410
+ * @param {string} $t
411
+ * @return {int} seconds
412
+ */
413
+ private function handle_m_s_string( $t ) {
414
+ $seconds = 0;
415
+
416
+ preg_match( '/(\d+)m/', $t, $m );
417
+ if ( ! empty( $m[1] ) ) {
418
+ $seconds += $m[1] * 60;
419
+ }
420
+
421
+ preg_match( '/(\d+)s/', $t, $s );
422
+ if ( ! empty( $s[1] ) ) {
423
+ $seconds += $s[1];
424
+ }
425
+
426
+ if ( empty( $m[1] ) && empty( $s[1] ) ) {
427
+ $seconds += intval( $t );
428
+ }
429
+
430
+ return $seconds;
431
+ }
432
+
433
+
434
+ /**
435
+ * Translates a source time parameter (mostly given as 't' in the
436
+ * fragment (#..) of an URL in seconds to a destination parameter.
437
+ *
438
+ * Note: The source parameter overwrites the destination parameter!
439
+ *
440
+ * @since 2.0.0
441
+ *
442
+ * @param {array} $parameters Array of parameters, containing $src
443
+ * @param {string} $src Key of the source parameter
444
+ * @param {string} $dst Key of the destination parameter
445
+ * @return {array} Updated $parameters array
446
+ */
447
+ private function translate_time_arg( $args, $src = 't', $dst = 'start' ) {
448
+ if ( ! empty( $args[ $src ] ) ) {
449
+ $t = $this->handle_m_s_string( $args[ $src ] );
450
+
451
+ unset( $args[ $src ] );
452
+
453
+ if ( $t ) {
454
+ $args[ $dst ] = $t;
455
+ }
456
+ }
457
+
458
+ return $args;
459
+ }
460
+
461
+
462
+ /**
463
+ * Extract the YouTube Video ID from an URL.
464
+ *
465
+ * @see http://stackoverflow.com/a/6382259/1447384
466
+ *
467
+ * @param {string} $url
468
+ * @return {string} YouTube ID
469
+ */
470
+ private function get_youtube_video_id( $url ) {
471
+ $pattern =
472
+ '/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)'.
473
+ '|youtu\.be\/)([^"&?\/ ]{11})/i';
474
+
475
+ if ( preg_match( $pattern, $url, $match ) ) {
476
+ return $match[1];
477
+ }
478
+
479
+ return false;
480
+ }
481
+ }
php/class-settings.php ADDED
@@ -0,0 +1,551 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // dependencies
4
+ require_once( FVP_DIR . 'php/class-html.php' );
5
+
6
+ /**
7
+ * Class containing everything regarding the plugin's settings.
8
+ *
9
+ * @since 1.3
10
+ */
11
+ class FVP_Settings {
12
+ private static $hook = 'options-media.php';
13
+
14
+ private static $section = 'fvp-section';
15
+
16
+ private static $page = 'media';
17
+
18
+ public function __construct() {
19
+ FVP_HTML::add_screens( self::$hook );
20
+
21
+ add_action( 'admin_init', array( $this, 'settings_init' ) );
22
+ }
23
+
24
+
25
+ /**
26
+ * Initializes the plugin settings section, the settings fields and registers the options field and save function.
27
+ *
28
+ * @see http://codex.wordpress.org/Settings_API
29
+ * @since 1.0
30
+ */
31
+ public function settings_init() {
32
+ // the featured video settings section on the media settings page
33
+ add_settings_section(
34
+ self::$section,
35
+ sprintf(
36
+ '<span id="%s">%s</span>',
37
+ self::$section,
38
+ esc_html__( 'Featured Videos', 'featured-video-plus' )
39
+ ),
40
+ array( $this, 'section' ),
41
+ self::$page
42
+ );
43
+
44
+ // settings fields for auto integration of featured videos - only available
45
+ // in themes with enabled post-thumbnails / featured images
46
+ if ( current_theme_supports( 'post-thumbnails' ) ) {
47
+ add_settings_field(
48
+ 'fvp-mode',
49
+ esc_html__( 'Display mode', 'featured-video-plus' ),
50
+ array( $this, 'mode' ),
51
+ self::$page,
52
+ self::$section
53
+ );
54
+
55
+ add_settings_field(
56
+ 'fvp-conditions',
57
+ esc_html__( 'Display Conditions', 'featured-video-plus' ),
58
+ array( $this, 'conditions' ),
59
+ self::$page,
60
+ self::$section
61
+ );
62
+ }
63
+
64
+ // video sizing options
65
+ add_settings_field(
66
+ 'fvp-sizing',
67
+ esc_html__( 'Video Sizing', 'featured-video-plus' ),
68
+ array( $this, 'sizing' ),
69
+ self::$page,
70
+ self::$section
71
+ );
72
+
73
+ // video align options
74
+ add_settings_field(
75
+ 'fvp-align',
76
+ esc_html__( 'Video Align', 'featured-video-plus' ),
77
+ array( $this, 'alignment' ),
78
+ self::$page,
79
+ self::$section
80
+ );
81
+
82
+ // video default url argument options
83
+ add_settings_field(
84
+ 'fvp-defaults',
85
+ esc_html__( 'Default Arguments', 'featured-video-plus' ),
86
+ array( $this, 'arguments' ),
87
+ self::$page,
88
+ self::$section
89
+ );
90
+
91
+ // donation and support notice
92
+ add_settings_field(
93
+ 'fvp-message',
94
+ esc_html__( 'Support', 'featured-video-plus' ),
95
+ array( $this, 'message' ),
96
+ self::$page,
97
+ self::$section
98
+ );
99
+
100
+ // registering the call to the fvp settings validation handler
101
+ register_setting( 'media', 'fvp-settings', array( $this, 'save' ) );
102
+ }
103
+
104
+
105
+ /**
106
+ * The settings section content.
107
+ * Describes the plugin settings, the PHP functions and the shortcode.
108
+ *
109
+ * @since 1.0
110
+ */
111
+ public function section() {
112
+ echo FVP_HTML::html(
113
+ 'p',
114
+ array( 'class' => 'fvp-settings-section' ),
115
+ sprintf( esc_html__( 'To display your featured videos you can either make use of the automatic replacement, use the %s or manually edit your theme\'s source files to make use of the plugins PHP-functions.', 'featured-video-plus' ), '<code>[featured-video-plus]</code>-Shortcode' ) .
116
+ sprintf( esc_html__( 'For more information about Shortcode and PHP functions see the %sContextual Help%s.', 'featured-video-plus' ), '<a href="#contextual-help" class="help-link">', '</a>' )
117
+ );
118
+
119
+ if ( ! current_theme_supports( 'post-thumbnails' ) ) {
120
+ echo FVP_HTML::description(
121
+ FVP_HTML::html(
122
+ 'span',
123
+ array( 'class' => 'bold' ),
124
+ esc_html__( 'The current theme does not support featured images.', 'featured-video-plus' )
125
+ ) .
126
+ sprintf(
127
+ esc_html__(
128
+ 'To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s.',
129
+ 'featured-video-plus'
130
+ ),
131
+ '<code>', '</code>'
132
+ ),
133
+ array( 'fvp_warning' )
134
+ );
135
+ }
136
+ }
137
+
138
+
139
+ /**
140
+ * Displays the different usage options of the plugin
141
+ *
142
+ * @since 1.7
143
+ */
144
+ public function mode() {
145
+ $options = get_option( 'fvp-settings' );
146
+
147
+ echo FVP_HTML::radios(
148
+ 'fvp-settings[mode]',
149
+ array(
150
+ 'replace' => esc_html__( 'Replace featured image automatically.', 'featured-video-plus' ),
151
+ 'dynamic' => esc_html__( 'Replace featured image on click.', 'featured-video-plus' ),
152
+ 'overlay' => esc_html__( 'Open video overlay when featured image is clicked.', 'featured-video-plus' ),
153
+ 'manual' => esc_html__( 'Manual: PHP-functions or shortcodes.', 'featured-video-plus' ),
154
+ ),
155
+ ! empty( $options['mode'] ) ? $options['mode'] : 'replace'
156
+ );
157
+
158
+ echo FVP_HTML::description(
159
+ sprintf( esc_html__( "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality.", 'featured-video-plus' ), '<a href="http://codex.wordpress.org/Post_Thumbnails" target="_blank">', '</a>' )
160
+ );
161
+ }
162
+
163
+
164
+ /**
165
+ * Video replace condition option like is_single or is_home.
166
+ *
167
+ * @since 2.0.0
168
+ */
169
+ public function conditions() {
170
+ $options = get_option( 'fvp-settings' );
171
+
172
+ $auto = ! empty( $options['mode'] ) && 'manual' !== $options['mode'];
173
+
174
+ echo FVP_HTML::conditional(
175
+ FVP_HTML::description(
176
+ esc_html__( 'View options are not available in manual mode.', 'featured-video-plus' )
177
+ ),
178
+ array(
179
+ 'fvp-settings[mode]' => 'manual',
180
+ 'hidden' => $auto,
181
+ )
182
+ );
183
+
184
+ echo FVP_HTML::conditional(
185
+ FVP_HTML::checkboxes(
186
+ 'fvp-settings[conditions]',
187
+ array(
188
+ 'single' => sprintf(
189
+ esc_html__( 'Only when viewing %ssingle%s posts and pages.', 'featured-video-plus' ),
190
+ '<a href="http://codex.wordpress.org/Function_Reference/is_single" target="_blank">',
191
+ '</a>'
192
+ ),
193
+ 'home' => sprintf(
194
+ esc_html__( 'Only on the %spost index page%s.', 'featured-video-plus' ),
195
+ '<a href="http://codex.wordpress.org/Function_Reference/is_home" target="_blank">',
196
+ '</a>'
197
+ ),
198
+ 'main_query' => sprintf(
199
+ esc_html__( 'Only inside the %smain query%s of each page.', 'featured-video-plus' ),
200
+ '<a href="https://developer.wordpress.org/reference/functions/is_main_query/" target="_blank">',
201
+ '</a>'
202
+ ),
203
+ 'sticky' => sprintf(
204
+ esc_html__( 'Only for %ssticky%s posts.', 'featured-video-plus' ),
205
+ '<a href="http://codex.wordpress.org/Function_Reference/is_sticky" target="_blank">',
206
+ '</a>'
207
+ )
208
+ ),
209
+ ! empty( $options['conditions'] ) ? $options['conditions'] : array()
210
+ ),
211
+ array(
212
+ 'fvp-settings[mode]' => '!manual',
213
+ 'hidden' => ! $auto,
214
+ )
215
+ );
216
+ }
217
+
218
+
219
+ /**
220
+ * Video width and height settings.
221
+ *
222
+ * @since 1.3
223
+ */
224
+ public function sizing() {
225
+ $options = get_option( 'fvp-settings' );
226
+ $responsive =
227
+ ! empty( $options['sizing']['responsive'] ) &&
228
+ $options['sizing']['responsive'];
229
+
230
+ echo FVP_HTML::checkbox(
231
+ 'fvp-settings[sizing][responsive]',
232
+ esc_html__( 'Responsive', 'featured-video-plus' ),
233
+ '1',
234
+ $responsive
235
+ );
236
+
237
+ echo FVP_HTML::conditional(
238
+ FVP_HTML::labeled_input(
239
+ esc_html__( 'Width in pixels:', 'featured-video-plus' ),
240
+ 'fvp-settings[sizing][width]',
241
+ array(
242
+ 'type' => 'number',
243
+ 'size' => 4,
244
+ 'value' => ! empty( $options['sizing']['width'] ) ?
245
+ $options['sizing']['width'] : 640,
246
+ )
247
+ ),
248
+ array(
249
+ 'fvp-settings[sizing][responsive]' => '!1',
250
+ 'hidden' => $responsive,
251
+ )
252
+ );
253
+
254
+ echo FVP_HTML::description(
255
+ sprintf(
256
+ esc_html__( 'The %1$sresponsive%2$s setting does not work when using the %1$soverlay%2$s display mode and might break completly in some themes - in such cases you should use a fixed width instead.', 'featured-video-plus' ),
257
+ '<code>', '</code>'
258
+ ),
259
+ array( 'fvp_warning' )
260
+ );
261
+
262
+ }
263
+
264
+
265
+ /**
266
+ * How should the videos be aligned?
267
+ * Only interesting when a fixed size is used.
268
+ *
269
+ * @since 1.4
270
+ */
271
+ public function alignment() {
272
+ $options = get_option( 'fvp-settings' );
273
+
274
+ echo FVP_HTML::radios(
275
+ 'fvp-settings[alignment]',
276
+ array(
277
+ 'left' => esc_html__( 'left', 'featured-video-plus' ),
278
+ 'center' => esc_html__( 'center', 'featured-video-plus' ),
279
+ 'right' => esc_html__( 'right', 'featured-video-plus' ),
280
+ ),
281
+ ! empty( $options['alignment'] ) ? $options['alignment'] : 'center'
282
+ );
283
+ }
284
+
285
+
286
+ /**
287
+ * Default settings for video embeds. Can be altered on a per video basis
288
+ * using video embed URL arguments.
289
+ *
290
+ * @since 1.4
291
+ */
292
+ public function arguments() {
293
+ $options = get_option( 'fvp-settings' );
294
+ $args = ! empty( $options['default_args'] ) ? $options['default_args'] : array();
295
+ $vimeo = ! empty( $args['vimeo'] ) ? $args['vimeo'] : array();
296
+ $youtube = ! empty( $args['youtube'] ) ? $args['youtube'] : array();
297
+ $dailymotion = ! empty( $args['dailymotion'] ) ? $args['dailymotion'] : array();
298
+
299
+ echo FVP_HTML::tabbed( array(
300
+ 'general' => array(
301
+ FVP_HTML::description(
302
+ esc_html__(
303
+ 'Not all of the following options might be supported by all providers.',
304
+ 'featured-video-plus'
305
+ )
306
+ ),
307
+ FVP_HTML::checkboxes(
308
+ 'fvp-settings[default_args][general]',
309
+ array(
310
+ 'autoplay' => esc_html__( 'Autoplay', 'featured-video-plus' ),
311
+ 'loop' => esc_html__( 'Loop', 'featured-video-plus' )
312
+ ),
313
+ ! empty( $args['general'] ) ? $args['general'] : array()
314
+ ),
315
+ ),
316
+
317
+ 'vimeo' => array(
318
+ FVP_HTML::description(
319
+ esc_html__(
320
+ 'If the owner of a video is a Plus member, some of these settings may be overridden by their preferences.',
321
+ 'featured-video-plus'
322
+ )
323
+ ),
324
+ FVP_HTML::colorpicker(
325
+ 'Color',
326
+ 'fvp-settings[default_args][vimeo][color]',
327
+ ! empty( $vimeo['color'] ) ? $vimeo['color'] : null
328
+ ),
329
+ FVP_HTML::checkboxes(
330
+ 'fvp-settings[default_args][vimeo]',
331
+ array(
332
+ 'portrait' => array(
333
+ 'value' => '0',
334
+ 'label' => esc_html__( "Hide user's portrait", 'featured-video-plus' )
335
+ ),
336
+ 'title' => array(
337
+ 'value' => '0',
338
+ 'label' => esc_html__( 'Hide video title', 'featured-video-plus' )
339
+ ),
340
+ 'byline' => array(
341
+ 'value' => '0',
342
+ 'label' => esc_html__( 'Hide video byline', 'featured-video-plus' )
343
+ ),
344
+ ),
345
+ $vimeo
346
+ ),
347
+ ),
348
+
349
+ 'youtube' => array(
350
+ FVP_HTML::checkboxes(
351
+ 'fvp-settings[default_args][youtube]',
352
+ array(
353
+ 'theme' => array(
354
+ 'value' => 'light',
355
+ 'label' => esc_html__( 'Light theme', 'featured-video-plus' )
356
+ ),
357
+ 'color' => array(
358
+ 'value' => 'white',
359
+ 'label' => esc_html__( 'White highlight color', 'featured-video-plus' )
360
+ ),
361
+ 'modestbranding' => esc_html__( 'Hide YouTube logo', 'featured-video-plus' ),
362
+ 'rel' => array(
363
+ 'value' => '0',
364
+ 'label' => esc_html__( 'Hide related videos', 'featured-video-plus' )
365
+ ),
366
+ 'fs' => array(
367
+ 'value' => '0',
368
+ 'label' => esc_html__( 'Disallow fullscreen', 'featured-video-plus' )
369
+ ),
370
+ 'showinfo' => array(
371
+ 'value' => '0',
372
+ 'label' => esc_html__( 'Hide video info', 'featured-video-plus' )
373
+ ),
374
+ 'enablejsapi' => esc_html__( 'Enable JavaScript API', 'featured-video-plus' ),
375
+ ),
376
+ $youtube
377
+ ),
378
+ ),
379
+
380
+ 'dailymotion' => array(
381
+ FVP_HTML::colorpicker(
382
+ 'Foreground color',
383
+ 'fvp-settings[default_args][dailymotion][foreground]',
384
+ ! empty( $dailymotion['foreground'] ) ? $dailymotion['foreground'] : null
385
+ ),
386
+ FVP_HTML::colorpicker(
387
+ 'Background color',
388
+ 'fvp-settings[default_args][dailymotion][background]',
389
+ ! empty( $dailymotion['background'] ) ? $dailymotion['background'] : null
390
+ ),
391
+ FVP_HTML::colorpicker(
392
+ 'Highlight color',
393
+ 'fvp-settings[default_args][dailymotion][highlight]',
394
+ ! empty( $dailymotion['highlight'] ) ? $dailymotion['highlight'] : null
395
+ ),
396
+ FVP_HTML::labeled_input(
397
+ 'Syndication-Key',
398
+ 'fvp-settings[default_args][dailymotion][syndication]',
399
+ ! empty( $dailymotion['syndication'] ) ? $dailymotion['syndication'] : null
400
+ ),
401
+ FVP_HTML::checkboxes(
402
+ 'fvp-settings[default_args][dailymotion]',
403
+ array(
404
+ 'logo' => array(
405
+ 'value' => '0',
406
+ 'label' => esc_html__( 'Hide DailyMotion logo', 'featured-video-plus' )
407
+ ),
408
+ 'info' => array(
409
+ 'value' => '0',
410
+ 'label' => esc_html__( 'Hide video info', 'featured-video-plus' )
411
+ ),
412
+ 'related' => array(
413
+ 'value' => '0',
414
+ 'label' => esc_html__( 'Hide related videos', 'featured-video-plus' )
415
+ ),
416
+ 'quality' => array(
417
+ 'value' => 1080,
418
+ 'label' => esc_html__( 'Turn HD on by default', 'featured-video-plus' )
419
+ ),
420
+ ),
421
+ $dailymotion
422
+ ),
423
+ ),
424
+ ) );
425
+ }
426
+
427
+
428
+ /**
429
+ * Message about support forums, rating and donating.
430
+ *
431
+ * @since 1.0
432
+ */
433
+ public function message() {
434
+ echo FVP_HTML::html(
435
+ 'p',
436
+ sprintf(
437
+ esc_html__(
438
+ 'If you have found a bug or think a specific feature is missing, %slet me know%s in the support forum. Like this plugin? %sRate it%s or %sbuy me a cookie%s!',
439
+ 'featured-video-plus'
440
+ ),
441
+ '<a href="https://wordpress.org/support/plugin/featured-video-plus#plugin-title" title="Featured Video Plus Support Forum on WordPress.org" target="_blank" style="font-weight: bold;">',
442
+ '</a>',
443
+ '<a href="https://wordpress.org/support/view/plugin-reviews/featured-video-plus#plugin-title" title="Rate Featured Video Plus on WordPress.org" target="_blank" style="font-weight: bold;">',
444
+ '</a>',
445
+ '<a href="https://paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6" title="Gift to the developer!" target="_blank" style="font-weight: bold;">',
446
+ '</a>'
447
+ )
448
+ );
449
+ }
450
+
451
+
452
+ /**
453
+ * Function through which all settings are passed before they are saved. Validate the data.
454
+ *
455
+ * @since 1.0
456
+ */
457
+ public function save( $input ) {
458
+ $options = $this->validate( $input );
459
+ return $options;
460
+ }
461
+
462
+
463
+ private function validate( $src, $tovalidate = null ) {
464
+ $patterns = array(
465
+ 'number' => '(\d*)',
466
+ 'digit' => '([0-9])',
467
+ 'word' => '([a-z]*)',
468
+ 'string' => '(\w*)',
469
+ 'hex' => '#?([0-9a-f]{3}[0-9a-f]{0,3})',
470
+ );
471
+
472
+ $datatypes = array(
473
+ 'mode' => '(replace|dynamic|overlay|manual)',
474
+ 'conditions' => array(
475
+ 'single' => $patterns['digit'],
476
+ 'home' => $patterns['digit'],
477
+ 'main_query' => $patterns['digit'],
478
+ 'sticky' => $patterns['digit'],
479
+ ),
480
+ 'alignment' => '(left|center|right)',
481
+ 'sizing' => array(
482
+ 'responsive' => 'BOOLEAN',
483
+ 'width' => $patterns['number'],
484
+ ),
485
+ 'default_args' => array(
486
+ 'general' => array(
487
+ 'autoplay' => $patterns['digit'],
488
+ 'loop' => $patterns['digit'],
489
+ ),
490
+ 'vimeo' => array(
491
+ 'portrait' => $patterns['digit'],
492
+ 'title' => $patterns['digit'],
493
+ 'byline' => $patterns['digit'],
494
+ 'color' => $patterns['hex'],
495
+ ),
496
+ 'youtube' => array(
497
+ 'theme' => $patterns['word'],
498
+ 'color' => $patterns['word'],
499
+ 'modestbranding' => $patterns['digit'],
500
+ 'fs' => $patterns['digit'],
501
+ 'rel' => $patterns['digit'],
502
+ 'showinfo' => $patterns['digit'],
503
+ 'enablejsapi' => $patterns['digit'],
504
+ ),
505
+ 'dailymotion' => array(
506
+ 'syndication' => $patterns['number'],
507
+ 'logo' => $patterns['digit'],
508
+ 'info' => $patterns['digit'],
509
+ 'related' => $patterns['digit'],
510
+ 'quality' => $patterns['number'],
511
+ 'background' => $patterns['hex'],
512
+ 'foreground' => $patterns['hex'],
513
+ 'highlight' => $patterns['hex'],
514
+ ),
515
+ )
516
+ );
517
+
518
+ if ( is_null( $tovalidate ) ) {
519
+ $tovalidate = $datatypes;
520
+ }
521
+
522
+ $validated = array();
523
+
524
+ foreach ( $tovalidate as $key => $value ) {
525
+ if ( ! isset( $src[ $key ] ) ) {
526
+ continue;
527
+ }
528
+
529
+ if ( is_array( $value ) ) {
530
+ $nextleaf = $this->validate( $src[ $key ], $value );
531
+ if ( ! empty( $nextleaf ) ) {
532
+ $validated[ $key ] = $nextleaf;
533
+ }
534
+ } elseif ( 'BOOLEAN' == $value ) {
535
+ $validated[ $key ] = (bool) $src[ $key ];
536
+ } else {
537
+ preg_match( '/' . $value . '/i', $src[ $key ], $match );
538
+ if (
539
+ ! empty( $match[1] ) ||
540
+ ( isset( $match[1] ) && '0' === $match[1] )
541
+ ) {
542
+ $validated[ $key ] = $match[1];
543
+ }
544
+ }
545
+ }
546
+
547
+ return $validated;
548
+ }
549
+
550
+
551
+ }
php/frontend.php DELETED
@@ -1,117 +0,0 @@
1
- <?php
2
- /**
3
- * Class containing functions required on frontend. Enqueue scripts/styles, replace featured images by featured videos.
4
- *
5
- * @author ahoereth
6
- * @version 2013/04/16
7
- * @see ../featured_video_plus.php
8
- * @see featured_video_plus in general.php
9
- * @since 1.0
10
- *
11
- * @param featured_video_plus instance
12
- */
13
- class featured_video_plus_frontend {
14
- private $featured_video_plus = null;
15
-
16
- /**
17
- * Creates a new instace of this class, saves the featured_video_instance.
18
- *
19
- * @since 1.0
20
- *
21
- * @param featured_video_plus_instance required, dies without
22
- */
23
- function __construct( $featured_video_plus_instance ) {
24
- if ( !isset($featured_video_plus_instance) )
25
- wp_die( 'featured_video_plus general instance required!', 'Error!' );
26
-
27
- $this->featured_video_plus = $featured_video_plus_instance;
28
- }
29
-
30
- /**
31
- * Enqueue all scripts and styles needed when viewing the frontend.
32
- *
33
- * @since 1.0
34
- */
35
- public function enqueue() {
36
- $min = SCRIPT_DEBUG ? '' : '.min';
37
- $options = get_option('fvp-settings');
38
-
39
- $deps = array('jquery');
40
-
41
- wp_enqueue_script('jquery');
42
-
43
- if ($options['sizing']['wmode'] == 'auto' && $options['usage']!='overlay') {
44
- wp_enqueue_script('jquery.fitvids', FVP_URL . "js/jquery.fitvids$min.js", array( 'jquery' ), FVP_VERSION, false );
45
- $deps[] = 'jquery.fitvids';
46
- }
47
-
48
- if ($options['usage']=='overlay') {
49
- wp_enqueue_script( 'jquery.domwindow', FVP_URL . "js/jquery.domwindow$min.js", array( 'jquery' ), FVP_VERSION );
50
- $deps[] = 'jquery.domwindow';
51
- }
52
-
53
- wp_enqueue_script( 'fvp_frontend', FVP_URL . "js/frontend$min.js", $deps, FVP_VERSION );
54
-
55
- wp_localize_script( 'fvp_frontend', 'fvpdata', array(
56
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
57
- 'nonce' => wp_create_nonce( 'featured-video-plus-nonce' ),
58
- 'fitvids' => isset($options['sizing']['wmode']) && $options['sizing']['wmode']=='auto',
59
- 'dynamic' => isset($options['usage']) && $options['usage']=='dynamic',
60
- 'overlay' => isset($options['usage']) && $options['usage']=='overlay',
61
- 'opacity' => '75',
62
- 'loadingw'=> FVP_URL . 'css/loading_w.gif',
63
- 'loadingb'=> FVP_URL . 'css/loading_b.gif'
64
- ) );
65
-
66
- wp_enqueue_style('fvp_frontend', FVP_URL . 'css/frontend.css', array(), FVP_VERSION );
67
- }
68
-
69
- /**
70
- * Display featured videos in place of featured images if a featured video is available and only if so desired by user.
71
- *
72
- * @see http://wordpress.stackexchange.com/a/41858
73
- * @since 1.0
74
- *
75
- * @param string $html featured image html, ready to echo
76
- * @param int $post_id id of target post
77
- * @param int $post_thumbnail_id id of featured image
78
- * @param string|array $size desired size of featured image / video
79
- * @param array $attr
80
- */
81
- public function filter_post_thumbnail($html, $post_id, $post_thumbnail_id, $size, $attr) {
82
- global $_wp_additional_image_sizes;
83
-
84
- $size = $this->featured_video_plus->get_size();
85
-
86
- $options = get_option( 'fvp-settings' );
87
-
88
- if ( ( isset($options['issingle']) && $options['issingle'] && ! is_single()) ||
89
- ( $options['usage']=='manual' || !has_post_video($post_id) ) )
90
- return $html;
91
-
92
- elseif ($options['usage']=='replace')
93
- return get_the_post_video($post_id, $size);
94
-
95
- elseif ($options['usage']=='overlay')
96
- return '<a href="#fvp_'.$post_id.'" class="fvp_overlay" onclick="return false;">'.$html.'</a><div id="fvp_'.$post_id.'" style="display: none;"></div>';
97
-
98
- else//if ($options['usage']=='dynamic')
99
- return '<a href="#fvp_'.$post_id.'" id="fvp_'.$post_id.'" class="fvp_dynamic" onclick="fvp_dynamic('.$post_id.');return false;">'.$html.'</a>';
100
-
101
- }
102
-
103
- /**
104
- * Shortcode for usage in post or page entries. Echos the post's featured video.
105
- *
106
- * @since 1.0
107
- *
108
- * @param array $atts can contain the width and/or height how the featured video should be displayed in px, optional
109
- */
110
- function shortcode($atts){
111
- $w = isset($atts['width']) ? $atts['width'] : '';
112
- $h = isset($atts['height']) ? $atts['height'] : '';
113
-
114
- if(has_post_video())
115
- return get_the_post_video(null, array($w, $h));
116
- }
117
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
php/functions.php CHANGED
@@ -1,108 +1,125 @@
1
- <?php
2
-
3
- /**
4
- * Checks if post has a featured video
5
- *
6
- * @since 1.0
7
- *
8
- * @param post_id
9
- */
10
- function has_post_video($post_id = null){
11
- $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
12
-
13
- $meta = get_post_meta( $post_id, '_fvp_video', true );
14
- if( !isset($meta) || empty($meta['full']) )
15
- return false;
16
-
17
- return true;
18
- }
19
-
20
- /**
21
- * Returns the posts featured video
22
- *
23
- * @since 1.0
24
- *
25
- * @param post_id
26
- * @param size
27
- */
28
- function get_the_post_video($post_id = null, $size = null) {
29
- global $featured_video_plus;
30
- return apply_filters( 'get_the_post_video_filter', $featured_video_plus->get_the_post_video($post_id, $size) );
31
- }
32
-
33
- /**
34
- * Echos the current posts featured video
35
- *
36
- * @since 1.0
37
- *
38
- * @param size
39
- */
40
- function the_post_video($size = null) {
41
- echo get_the_post_video(null, $size);
42
- }
43
-
44
- /**
45
- * Returns the post video image's url
46
- *
47
- * @since 1.4
48
- *
49
- * @param post_id
50
- */
51
- function get_the_post_video_image_url($post_id = null) {
52
- $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
53
-
54
- $meta = get_post_meta( $post_id, '_fvp_video', true );
55
- if( !isset($meta) || empty($meta['full']) )
56
- return false;
57
-
58
- global $featured_video_plus;
59
- $video_img = $featured_video_plus->get_post_by_custom_meta('_fvp_image', $meta['prov'].'?'.$meta['id']);
60
-
61
- return wp_get_attachment_url( $video_img );
62
- }
63
-
64
- /**
65
- * Returns the post video image img tag including size.
66
- *
67
- * @since 1.4
68
- *
69
- * @param post_id
70
- * @param size
71
- */
72
- function get_the_post_video_image($post_id = null, $size = null) {
73
- $meta = get_post_meta( $post_id, '_fvp_video', true );
74
- if( !isset($meta) || empty($meta['full']) )
75
- return false;
76
-
77
- global $featured_video_plus;
78
- $id = $featured_video_plus->get_post_by_custom_meta('_fvp_image', $meta['prov'] . '?' . $meta['id']);
79
- $size = $featured_video_plus->get_size($size);
80
-
81
- return wp_get_attachment_image($id, $size);
82
- }
83
-
84
- /**
85
- * Retruns the post video url.
86
- *
87
- * @since 1.6
88
- *
89
- * @param int $post_id
90
- * @return mixed boolean (false) when no url/ string with url
91
- */
92
- function get_the_post_video_url($post_id, $fallback = false){
93
- $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
94
-
95
- $meta = get_post_meta($post_id, '_fvp_video', true );
96
- if (!isset($meta) || empty($meta['full']))
97
- return false;
98
-
99
- if (isset($meta['prov']) && $meta['prov'] == 'local')
100
- if (!$fallback)
101
- return wp_get_attachment_url($meta['id']);
102
- else
103
- return wp_get_attachment_url($meta['sec_id']);
104
- else if (isset($meta['full']))
105
- return $meta['full'];
106
- else
107
- return false;
108
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Checks if post has a featured video
5
+ *
6
+ * @since 1.0
7
+ *
8
+ * @param {int} post_id
9
+ * @return {boolean}
10
+ */
11
+ function has_post_video( $post_id = null ) {
12
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
13
+
14
+ $meta = get_post_meta( $post_id, '_fvp_video', true );
15
+ if ( ! isset( $meta ) || empty( $meta['full'] ) ) {
16
+ return false;
17
+ }
18
+
19
+ return true;
20
+ }
21
+
22
+
23
+ /**
24
+ * Returns the posts featured video
25
+ *
26
+ * @since 1.0
27
+ *
28
+ * @param {int} post_id
29
+ * @param {mixed} size
30
+ * @return {string/boolean} html string or false on failure
31
+ */
32
+ function get_the_post_video( $post_id = null, $size = null ) {
33
+ global $featured_video_plus;
34
+ return apply_filters(
35
+ 'get_the_post_video_filter',
36
+ $featured_video_plus->get_the_post_video( $post_id, $size )
37
+ );
38
+ }
39
+
40
+
41
+ /**
42
+ * Echos the current posts featured video
43
+ *
44
+ * @since 1.0
45
+ *
46
+ * @param {mixed} size
47
+ */
48
+ function the_post_video( $size = null ) {
49
+ echo get_the_post_video( null, $size );
50
+ }
51
+
52
+
53
+ /**
54
+ * Returns the attachment id of the video image.
55
+ *
56
+ * @since 2.0.0
57
+ *
58
+ * @param {int} $post_id
59
+ * @return {int}
60
+ */
61
+ function get_the_post_video_image_id( $post_id = null ) {
62
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
63
+
64
+ $meta = get_post_meta( $post_id, '_fvp_video', true );
65
+ if ( ! empty( $meta['img'] ) ) {
66
+ return $meta['img'];
67
+ }
68
+
69
+ return false;
70
+ }
71
+
72
+
73
+ /**
74
+ * Returns the post video image's url
75
+ *
76
+ * @since 1.4
77
+ *
78
+ * @param {int} post_id
79
+ * @return {string/boolean} url or false on failure
80
+ */
81
+ function get_the_post_video_image_url( $post_id = null ) {
82
+ $img_id = get_the_post_video_image_id( $post_id );
83
+ return wp_get_attachment_url( $img_id );
84
+ }
85
+
86
+
87
+ /**
88
+ * Returns the post video image img tag including size.
89
+ *
90
+ * @since 1.4
91
+ *
92
+ * @param {int} post_id
93
+ * @param {mixed} size
94
+ * @return {string/boolean} html string or false on failure
95
+ */
96
+ function get_the_post_video_image( $post_id = null, $size = null ) {
97
+ $img_id = get_the_post_video_image_id( $post_id );
98
+ return wp_get_attachment_image( $img_id, $size );
99
+ }
100
+
101
+
102
+ /**
103
+ * Returns the post video url.
104
+ *
105
+ * @since 1.6
106
+ *
107
+ * @param {int} $post_id
108
+ * @return {string/boolean} url or false
109
+ */
110
+ function get_the_post_video_url( $post_id ) {
111
+ $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
112
+
113
+ $meta = get_post_meta( $post_id, '_fvp_video', true );
114
+ if ( ! isset( $meta ) || empty( $meta['full'] ) ) {
115
+ return false;
116
+ }
117
+
118
+ if ( isset( $meta['provider'] ) && 'local' === $meta['provider'] ) {
119
+ return wp_get_attachment_url( $meta['id'] );
120
+ } else if ( isset( $meta['full'] ) ) {
121
+ return $meta['full'];
122
+ }
123
+
124
+ return false;
125
+ }
php/general.php DELETED
@@ -1,226 +0,0 @@
1
- <?php
2
- /**
3
- * Class containing all functions needed on front- AND backend. Functions only needed on one of those are found in distinct classes.
4
- *
5
- * @author ahoereth
6
- * @see ../featured_video_plus.php
7
- * @see featured_video_plus_backend in backend.php
8
- * @see featured_video_plus_frontend in frontend.php
9
- * @since 1.0
10
- */
11
- class featured_video_plus {
12
-
13
- /**
14
- * Returns the featured video html, ready to echo.
15
- *
16
- * @since 1.0
17
- *
18
- * @param int $post_id
19
- * @param string|array $size
20
- * @param bool $allowfullscreen
21
- * @param bool $container
22
- */
23
- public function get_the_post_video($post_id = null, $size = null) {
24
- $post_id = ( null === $post_id ) ? get_the_ID() : $post_id;
25
-
26
- if( !has_post_video($post_id) )
27
- return false;
28
-
29
- $meta = get_post_meta($post_id, '_fvp_video', true);
30
- $options = get_option( 'fvp-settings' );
31
-
32
- $size = $this->get_size($size);
33
- $size = array( 'width' => $size[0], 'height' => $size[1] );
34
-
35
- if( ! is_admin() ) {
36
- switch ( $options['autoplay'] ) {
37
- case 'yes':
38
- $autoplay = '1';
39
- break;
40
- case 'auto':
41
- if (( is_single() ) ||
42
- ( defined('DOING_AJAX') && DOING_AJAX &&
43
- ( $options['usage'] == 'dynamic' || $options['usage'] == 'overlay')))
44
- $autoplay = '1';
45
- case 'no':
46
- default:
47
- $autoplay = '0';
48
- break;
49
- }
50
- } else
51
- $autoplay = '0';
52
-
53
- $valid = $meta['valid'];
54
-
55
- switch ( $meta['prov'] ) {
56
- case 'local':
57
- // mediaelement.js is only available in WordPress 3.6 and higher.
58
- if( get_bloginfo('version') < 3.6 ) break;
59
-
60
- $videourl = wp_get_attachment_url( $meta['id'] );
61
-
62
- $ext = pathinfo( $videourl, PATHINFO_EXTENSION );
63
- if( $ext != 'mp4' && $ext != 'ogv' && $ext != 'webm' && $ext != 'ogg' )
64
- break;
65
-
66
- $videometa = wp_get_attachment_metadata( $meta['id'] );
67
-
68
- $atts = array(
69
- 'src' => $videourl,
70
- 'poster' => ! empty( $options['local']['poster'] ) && $options['local']['poster'] && has_post_thumbnail( $post_id ) ? wp_get_attachment_url( get_post_thumbnail_id( $post_id ) ) : '',
71
- 'loop' => ! empty( $options['local']['loop'] ) && $options['local']['loop'] ? 'on' : 'off',
72
- 'autoplay' => $autoplay == '1' ? 'on' : null,
73
- 'preload' => null, // $size['height'], //$size['width'], //
74
- 'height' => $options['sizing']['hmode' ] == 'auto' && ! is_admin() ? ( $options['sizing']['wmode' ] == 'auto' ? $videometa['height'] * 8 : $videometa['height'] / $videometa['width'] * $videometa['height'] ) : $size['height'],
75
- 'width' => $options['sizing']['wmode' ] == 'auto' && ! is_admin() ? $videometa['width'] * 8 : $size['width'],
76
- );
77
-
78
- $embed = wp_video_shortcode( $atts );
79
- break;
80
-
81
- case 'vimeo':
82
- $option = $options['vimeo'];
83
- $params = array(
84
- 'badge' => 0,
85
- 'portrait' => $option['portrait'],
86
- 'title' => $option['title'],
87
- 'byline' => $option['byline'],
88
- 'color' => $option['color'],
89
- 'autoplay' => $autoplay
90
- );
91
-
92
- $src = '//player.vimeo.com/video/'.$meta['id'].'?'.http_build_query($params);
93
- $embed = "\n\t" . '<iframe src="'.$src.'" width="'.$size['width'].'" height="'.$size['height'].'" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>' . "\n";
94
- break;
95
-
96
- case 'youtube':
97
- $option = $options['youtube'];
98
- $params = array(
99
- 'origin' => esc_attr(home_url()),
100
- 'theme' => isset($option['theme']) ? $option['theme'] : 'dark',
101
- 'color' => isset($option['color']) ? $option['color'] : 'red',
102
- 'enablejsapi' => isset($option['jsapi']) ? $option['jsapi'] : null,
103
- 'showinfo' => isset($option['info']) ? $option['info'] : 1,
104
- 'modestbranding' => isset($option['logo']) ? $option['logo'] : 1,
105
- 'rel' => isset($option['rel']) ? $option['rel'] : 1,
106
- 'fs' => isset($option['fs']) ? $option['fs'] : 1,
107
- 'start' => isset($meta['time']) ? $meta['time'] : null,
108
- 'end' => isset($meta['end_time']) ? $meta['end_time'] : null,
109
- 'autoplay' => $autoplay,
110
- 'wmode' => isset($option['wmode']) && $option['wmode'] != 'auto' ? $option['wmode'] : null,
111
- 'playerapiid' => isset($option['jsapi']) && $option['jsapi'] == 1 ? 'fvpyt'.$post_id : null,
112
- );
113
-
114
- $src = '//www.youtube.com/embed/'.$meta['id'].'?'.http_build_query($params);
115
- $embed = "\n\t" . '<iframe width="'.$size['width'].'" height="'.$size['height'].'" src="'.$src.'" type="text/html" frameborder="0" id="fvpyt'.$post_id.'"></iframe>' . "\n";
116
- break;
117
-
118
- case 'dailymotion':
119
- $option = $options['dailymotion'];
120
- $params = array(
121
- 'foreground' => isset($option['foreground']) ? $option['foreground'] : null,
122
- 'highlight' => isset($option['highlight']) ? $option['highlight'] : null,
123
- 'background' => isset($option['background']) ? $option['background'] : null,
124
- 'logo' => isset($option['logo']) ? $option['logo'] : 1,
125
- 'hideInfos' => isset($option['info']) ? 1-$option['info'] : 0,
126
- 'syndication' => empty($option['syndication']) ? null : $option['syndication'],
127
- 'start' => $meta['time']
128
- );
129
- $src = '//www.dailymotion.com/embed/video/'.$meta['id'].'?'.http_build_query($params);
130
- $embed = "\n" . '<iframe width="'.$size['width'].'" height="'.$size['height'].'" src="'.$src.'" frameborder="0"></iframe>' . "\n";
131
- break;
132
-
133
- case 'liveleak':
134
- $embed = "\n" . '<iframe width="'.$size['width'].'" height="'.$size['height'].'" src="//www.liveleak.com/ll_embed?f='.$meta['id'].'" frameborder="0" allowfullscreen></iframe>';
135
- break;
136
-
137
- case 'prochan':
138
- $embed = "\n" . '<iframe width="'.$size['width'].'" height="'.$size['height'].'" src="//www.prochan.com/embed?f='.$meta['id'].'" frameborder="0" allowfullscreen></iframe>';
139
- break;
140
-
141
- default:
142
- $embed = wp_oembed_get($meta['full'], $size);
143
- break;
144
- }
145
-
146
- if ( ! $embed ) return '';
147
-
148
- $class = $options['sizing']['wmode' ] == 'auto' ? ' responsive' : '';
149
- $containerstyle = isset($options['sizing']['align']) ? ' style="text-align: '.$options['sizing']['align'].'"' : '';
150
- $embed = "<div class=\"featured_video_plus{$class}\"{$containerstyle}>{$embed}</div>\n\n";
151
- $embed = "\n\n<!-- Featured Video Plus v".FVP_VERSION."-->\n" . $embed;
152
-
153
- return $embed;
154
- }
155
-
156
- /**
157
- * Determine featured video size
158
- */
159
- function get_size($size = null) {
160
- $options = get_option( 'fvp-settings' );
161
-
162
- if( !is_array($size) ) {
163
- if( isset($_wp_additional_image_sizes[$size]) )
164
- $width = $_wp_additional_image_sizes[$size]['width'];
165
- elseif( $size == 'thumbnail' || $size == 'thumb' )
166
- $width = get_option( 'thumbnail_size_w' );
167
- else if( $size == 'medium' )
168
- $width = get_option( 'medium_size_w' );
169
- else if( $size == 'large' )
170
- $width = get_option( 'large_size_w' );
171
- elseif( isset($options['sizing']['wmode']) && $options['sizing']['wmode'] == 'fixed' )
172
- $width = $options['sizing']['width']; // auto width is applied by fitvids JS
173
- else
174
- $width = 560;
175
-
176
- } elseif( !empty( $size[0] ) && is_numeric( $size[0] ) )
177
- $width = $size[0];
178
- elseif( isset($options['sizing']['wmode']) && $options['sizing']['wmode'] == 'fixed' )
179
- $width = $options['sizing']['width']; // auto width is applied by fitvids JS
180
- else
181
- $width = 560;
182
-
183
- if( isset($size[1]) && !empty( $size[1] ) && is_numeric( $size[1] ) )
184
- $height = $size[1];
185
- else
186
- $height = $options['sizing']['hmode'] == 'auto' ? round($width / 16 * 9) : $options['sizing']['height'];
187
-
188
- return array( $width, $height );
189
- }
190
-
191
- /**
192
- * Gets a post by an meta_key meta_value pair. Returns it's post_id.
193
- *
194
- * @see http://codex.wordpress.org/Class_Reference/wpdb
195
- * @see http://dev.mysql.com/doc/refman/5.0/en/regexp.html#operator_regexp
196
- * @since 1.0
197
- *
198
- * @param string $meta_key which meta_key to look for
199
- * @param string $meta_value which meta_value to look for
200
- */
201
- function get_post_by_custom_meta($meta_key, $meta_value = null) {
202
- global $wpdb;
203
- if( $meta_value !== null ) {
204
- $prepared = $wpdb->prepare(
205
- "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key=%s AND meta_value=%s LIMIT 1",
206
- $meta_key, $meta_value
207
- );
208
- return $wpdb->get_var( $prepared );
209
- } else {
210
- $prepared = $wpdb->prepare(
211
- "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key=%s",
212
- $meta_key
213
- );
214
- return $wpdb->get_col( $prepared );
215
- }
216
- }
217
-
218
- /**
219
- * Initializes i18n
220
- *
221
- * @since 1.3
222
- */
223
- function language() {
224
- load_plugin_textdomain('featured-video-plus', FVP_DIR . 'lng/', FVP_NAME . '/lng/' );
225
- }
226
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
php/inc-install.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $options = array(
3
+ 'mode' => 'replace',
4
+ 'alignment' => 'center',
5
+ 'conditions' => array(),
6
+
7
+ 'sizing' => array(
8
+ 'responsive' => true,
9
+ 'width' => 640,
10
+ ),
11
+
12
+ 'default_args' => array(
13
+ 'general' => array(),
14
+ 'vimeo' => array(),
15
+ 'youtube' => array(),
16
+ 'dailymotion' => array(),
17
+ ),
18
+ );
19
+
20
+ update_option( 'fvp-settings', $options );
21
+ update_option( 'fvp-version', FVP_VERSION );
php/inc-upgrade.php ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( empty( $version ) || empty( $options ) || empty( $options_org ) ) {
3
+ exit('Featured Video Plus Error:
4
+ Upgrade can not be executed directly!
5
+ Must be called through FVP_Backend->upgrade().');
6
+ }
7
+
8
+ switch ( $version ) {
9
+ case '1.0':
10
+ case '1.1':
11
+ $users = array_merge(
12
+ get_users( array( 'role' => 'Administrator' ) ),
13
+ get_users( array( 'role' => 'Super Admin' ) )
14
+ );
15
+
16
+ foreach ( $users AS $user ) {
17
+ delete_user_meta( $user->ID, 'fvp_activation_notification_ignore' );
18
+ }
19
+
20
+
21
+ case '1.2':
22
+ $options['videojs'] = array(
23
+ 'skin' => 'videojs', //videojs,moonfy,tubejs
24
+ );
25
+ $options['youtube'] = array(
26
+ 'theme' => 'dark',
27
+ 'color' => 'red',
28
+ 'info' => 1,
29
+ 'rel' => 1,
30
+ 'fs' => 1,
31
+ );
32
+ $options['dailymotion'] = array(
33
+ 'foreground' => 'F7FFFD',
34
+ 'highlight' => 'FFC300',
35
+ 'background' => '171D1B',
36
+ 'logo' => 1,
37
+ 'info' => 1,
38
+ );
39
+ $options['sizing'] = array(
40
+ 'wmode' => $options['width'],
41
+ 'hmode' => $options['height'],
42
+ 'width' => 560,
43
+ 'height' => 315,
44
+ 'align' => 'left',
45
+ );
46
+ unset( $options['width'], $options['height'] );
47
+
48
+
49
+ case '1.3':
50
+ $options['out'] = 0;
51
+ $options['autoplay'] = 0;
52
+ $options['youtube']['logo'] = 1;
53
+ $options['dailymotion']['syndication'] = '';
54
+ $options['align'] = $options['sizing']['wmode'] == 'auto' ? 'center' : $options['sizing']['align'];
55
+ unset( $options['sizing']['align'] );
56
+
57
+
58
+ case '1.4':
59
+ $options['youtube']['wmode'] = 'auto';
60
+ $options['local']['videojs']['js'] = true;
61
+ $options['local']['videojs']['css'] = true;
62
+ $options['local']['videojs']['cdn'] = false;
63
+ unset( $options['videojs'] );
64
+
65
+
66
+ case '1.5':
67
+ case '1.5.1':
68
+ $options['youtube']['jsapi'] = 0;
69
+ $options['local']['videojs']['poster'] = false;
70
+ unset( $options['reged'], $options['out'] );
71
+
72
+
73
+ case '1.6':
74
+ case '1.6.1':
75
+ $options['usage'] = $options['overwrite'] ? 'replace' : 'manual'; // replace;manual;overlay
76
+ unset( $options['overwrite'] );
77
+
78
+
79
+ case '1.7':
80
+ case '1.7.1':
81
+ $options['local']['cdn'] = $options['local']['videojs']['cdn'];
82
+ $options['local']['enabled'] = $options['local']['videojs']['js'];
83
+ $options['local']['poster'] = $options['local']['videojs']['poster'];
84
+ unset( $options['local']['videojs'] );
85
+
86
+ $options['local']['foreground'] = 'cccccc';
87
+ $options['local']['highlight'] = '66a8cc';
88
+ $options['local']['background'] = '000000';
89
+ $options['local']['controls'] = true;
90
+ $options['local']['loop'] = false;
91
+ $options['autoplay'] = $options['autoplay'] ? 'yes' : 'no'; //yes/auto/no
92
+
93
+
94
+ case '1.8':
95
+ unset(
96
+ $options['local']['cdn'],
97
+ $options['local']['enabled'],
98
+ $options['local']['foreground'],
99
+ $options['local']['background'],
100
+ $options['local']['controls']
101
+ );
102
+
103
+
104
+ case '1.9':
105
+ case '1.9.1':
106
+ $sizing = array(
107
+ 'responsive' => ! empty( $options['sizing']['wmode'] ) ?
108
+ (bool) $options['sizing']['wmode'] : true,
109
+ 'width' => ! empty( $options['sizing']['width'] ) ?
110
+ intval( $options['sizing']['width'] ) : 640,
111
+ );
112
+ unset( $options['sizing'] );
113
+ $options['sizing'] = $sizing;
114
+
115
+ $options['conditions'] = array(
116
+ 'home' => ! empty( $options['ishome'] ) && $options['ishome'],
117
+ 'single' => ! empty( $options['issingle'] ) && $options['issingle'],
118
+ );
119
+ $options['mode'] = $options['usage'];
120
+ $options['alignment'] = $options['align'];
121
+ $options['youtube']['showinfo'] = $options['youtube']['info'];
122
+ $options['youtube']['enablejsapi'] = $options['youtube']['jsapi'];
123
+ $options['youtube']['modestbranding'] =
124
+ ( $options['youtube']['logo'] + 1 ) % 2;
125
+
126
+ unset(
127
+ $options['ishome'],
128
+ $options['issingle'],
129
+ $options['usage'],
130
+ $options['align'],
131
+ $options['youtube']['info'],
132
+ $options['youtube']['jsapi'],
133
+ $options['youtube']['logo'],
134
+ $options['version'] // now saved in its own field
135
+ );
136
+
137
+ // remove all previous defaults
138
+ $options['default_args'] = array(
139
+ 'general' => array_diff_assoc(
140
+ array(
141
+ 'autoplay' => $options['autoplay'] == 'true' ? true : false,
142
+ 'loop' => $options['local']['loop'],
143
+ ),
144
+ array(
145
+ 'autoplay' => false,
146
+ 'loop' => false,
147
+ )
148
+ ),
149
+ 'vimeo' => array_diff_assoc(
150
+ ! empty( $options['vimeo'] ) ? $options['vimeo'] : array(),
151
+ array(
152
+ 'portrait' => 0,
153
+ 'title' => 1,
154
+ 'byline' => 1,
155
+ 'color' => '00adef',
156
+ )
157
+ ),
158
+ 'youtube' => array_diff_assoc(
159
+ ! empty( $options['youtube'] ) ? $options['youtube'] : array(),
160
+ array(
161
+ 'theme' => 'dark',
162
+ 'color' => 'red',
163
+ 'info' => 1,
164
+ 'rel' => 1,
165
+ 'fs' => 1,
166
+ 'logo' => 1,
167
+ 'jsapi' => 0,
168
+ 'showinfo' => 1,
169
+ 'enablejsapi' => 0,
170
+ 'modestbranding' => 0,
171
+ )
172
+ ),
173
+ 'dailymotion' => array_diff_assoc(
174
+ ! empty( $options['dailymotion'] ) ? $options['dailymotion'] : array(),
175
+ array(
176
+ 'foreground' => 'F7FFFD',
177
+ 'highlight' => 'FFC300',
178
+ 'background' => '171D1B',
179
+ 'logo' => 1,
180
+ 'info' => 1,
181
+ 'syndication' => '',
182
+ )
183
+ ),
184
+ );
185
+ unset(
186
+ $options['autoplay'],
187
+ $options['vimeo'],
188
+ $options['youtube'],
189
+ $options['dailymotion'],
190
+ $options['local']
191
+ );
192
+
193
+ // check all featured video post metas
194
+ $ids = self::get_post_by_custom_meta( '_fvp_video' );
195
+ foreach ( $ids as $id ) {
196
+ $meta = maybe_unserialize( get_post_meta( $id, '_fvp_video', true ) );
197
+
198
+ // Remove and re-add video.
199
+ $this->save( array( 'id' => $id, 'fvp_video' => '' ) );
200
+ $this->save( array( 'id' => $id, 'fvp_video' => $meta['full'] ) );
201
+ }
202
+
203
+ default:
204
+ update_option( 'fvp-settings', $options );
205
+ update_option( 'fvp-version', FVP_VERSION );
206
+ break;
207
+ }
php/settings.php DELETED
@@ -1,449 +0,0 @@
1
- <?php
2
- /**
3
- * Class containing everything regarding plugin settings on media-settings.php
4
- *
5
- * @author ahoereth
6
- * @version 2013/04/16
7
- * @see ../featured_video_plus.php
8
- * @since 1.3
9
- */
10
- class featured_video_plus_settings {
11
- private $help_shortcode;
12
- private $help_functions;
13
-
14
- /**
15
- * Initialises the plugin settings section, the settings fields and registers the options field and save function.
16
- *
17
- * @see http://codex.wordpress.org/Settings_API
18
- * @since 1.0
19
- */
20
- function settings_init() {
21
- add_settings_section('fvp-settings-section', __('Featured Videos', 'featured-video-plus'), array( &$this, 'settings_content' ), 'media');
22
-
23
- add_settings_field('fvp-settings-usage', __('Usage', 'featured-video-plus'), array( &$this, 'settings_usage' ), 'media', 'fvp-settings-section');
24
- add_settings_field('fvp-settings-autoplay', __('Autoplay', 'featured-video-plus'), array( &$this, 'settings_autoplay' ), 'media', 'fvp-settings-section');
25
- add_settings_field('fvp-settings-sizing', __('Video Sizing', 'featured-video-plus'), array( &$this, 'settings_sizing' ), 'media', 'fvp-settings-section');
26
- add_settings_field('fvp-settings-align', __('Video Align', 'featured-video-plus'), array( &$this, 'settings_align' ), 'media', 'fvp-settings-section');
27
- add_settings_field('fvp-settings-local', __('Local Video Options', 'featured-video-plus'),array( &$this, 'settings_local' ), 'media', 'fvp-settings-section');
28
- add_settings_field('fvp-settings-youtube', __('YouTube Options', 'featured-video-plus'), array( &$this, 'settings_youtube' ), 'media', 'fvp-settings-section');
29
- add_settings_field('fvp-settings-vimeo', __('Vimeo Options', 'featured-video-plus'), array( &$this, 'settings_vimeo' ), 'media', 'fvp-settings-section');
30
- add_settings_field('fvp-settings-dailymotion',__('Dailymotion Options', 'featured-video-plus'),array( &$this, 'settings_dailymotion' ),'media', 'fvp-settings-section');
31
- add_settings_field('fvp-settings-rate', __('Support', 'featured-video-plus'), array( &$this, 'settings_rate' ), 'media', 'fvp-settings-section');
32
-
33
- register_setting('media', 'fvp-settings', array( &$this, 'settings_save' ));
34
- }
35
-
36
- /**
37
- * The settings section content. Describes the plugin settings, the php functions and the WordPress shortcode.
38
- *
39
- * @since 1.0
40
- */
41
- function settings_content() {
42
- $wrap = get_bloginfo('version') >= 3.3 ? '-wrap' : ''; ?>
43
-
44
- <p>
45
- <?php printf(__('To display your featured videos you can either make use of the automatic replacement, use the %s or manually edit your theme\'s source files to make use of the plugins PHP-functions.', 'featured-video-plus'), '<code>[featured-video-plus]</code>-Shortcode'); ?>
46
- <?php printf(__('For more information about Shortcode and PHP functions see the %sContextual Help%s.', 'featured-video-plus'), '<a href="#contextual-help'.$wrap.'" id="fvp_help_toggle">', '</a>'); ?>
47
- </p>
48
-
49
- <?php }
50
-
51
- /**
52
- * Displays the different usage options of the plugin
53
- *
54
- * @since 1.7
55
- */
56
- function settings_usage() {
57
- $options = get_option( 'fvp-settings' );
58
- $usage = isset($options['usage']) ? $options['usage'] : 'replace';
59
- $issingle = isset($options['issingle']) ? $options['issingle'] : false;
60
- ?>
61
-
62
- <input type="checkbox" name="fvp-settings[issingle]" id="fvp-settings-issingle" value="true" <?php checked(true, $issingle) ?>/>
63
- <label for="fvp-settings-issingle"><?php _e('Only show video when viewing single post/page, otherwise show post thumbnail.', 'featured-video-plus') ?></label>
64
- <br /><br />
65
-
66
- <input type="radio" name="fvp-settings[usage]" id="fvp-settings-usage-1" value="replace" <?php checked( 'replace', $usage ) ?>/><label for="fvp-settings-usage-1">&nbsp;<?php _e('Replace featured image automatically if possible', 'featured-video-plus'); ?>&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label><br />
67
- <input type="radio" name="fvp-settings[usage]" id="fvp-settings-usage-2" value="overlay" <?php checked( 'overlay', $usage ) ?>/><label for="fvp-settings-usage-2">&nbsp;<?php _e('Open video overlay when featured image is clicked. Define width below!', 'featured-video-plus'); ?></label><br />
68
- <input type="radio" name="fvp-settings[usage]" id="fvp-settings-usage-3" value="dynamic" <?php checked( 'dynamic', $usage ) ?>/><label for="fvp-settings-usage-3">&nbsp;<?php _e('Replace featured image with video on click and auto play if possible','featured-video-plus'); ?></label><br />
69
- <input type="radio" name="fvp-settings[usage]" id="fvp-settings-usage-4" value="manual" <?php checked( 'manual', $usage ) ?>/><label for="fvp-settings-usage-4">&nbsp;<?php _e('None of the above: Manually use PHP-functions or shortcodes','featured-video-plus'); ?></label>
70
- <p class="description"><?php printf(__('The first three options require your theme to make use of WordPress\' %sfeatured image%s capabilities.', 'featured-video-plus'),'<a href="http://codex.wordpress.org/Post_Thumbnails" target="_blank">','</a>'); ?></p>
71
-
72
- <?php
73
- if( !current_theme_supports('post-thumbnails') )
74
- echo '<p class="fvp_warning description"><span style="font-weight: bold;">'.__('The current theme does not support featured images', 'featured-video-plus').':</span>&nbsp;'.__('To display Featured Videos you need to use the <code>Shortcode</code> or <code>PHP functions</code>.', 'featured-video-plus').'</p>'."\n";
75
-
76
- }
77
-
78
-
79
- /**
80
- * Displays the setting if videos should autoplay when a single post/page is being viewed.
81
- *
82
- * @since 1.4
83
- */
84
- function settings_autoplay() {
85
- $options = get_option( 'fvp-settings' );
86
- $autoplay = isset($options['autoplay']) ? $options['autoplay'] : 'no';
87
- ?>
88
-
89
- <input type="radio" name="fvp-settings[autoplay]" id="fvp-settings-autoplay-1" value="yes" <?php checked('yes', $autoplay) ?>/>
90
- <label for="fvp-settings-autoplay-1">&nbsp;<?php _e('yes', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
91
- <input type="radio" name="fvp-settings[autoplay]" id="fvp-settings-autoplay-2" value="auto" <?php checked('auto', $autoplay) ?>/>
92
- <label for="fvp-settings-autoplay-2">&nbsp;<?php _e('auto', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
93
- <input type="radio" name="fvp-settings[autoplay]" id="fvp-settings-autoplay-3" value="no" <?php checked('no', $autoplay) ?>/>
94
- <label for="fvp-settings-autoplay-2">&nbsp;<?php _e('no', 'featured-video-plus'); ?>&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>
95
-
96
- <?php }
97
-
98
- /**
99
- * Displays the setting if the plugin should fit the width of the videos automatically or use fixed widths.
100
- *
101
- * @since 1.3
102
- */
103
- function settings_sizing() {
104
- $options = get_option( 'fvp-settings' );
105
- $wmode = isset($options['sizing']['wmode']) && $options['sizing']['wmode'] == 'auto' ? 'auto' : 'fixed';
106
- $hmode = isset($options['sizing']['hmode']) && $options['sizing']['hmode'] == 'auto' ? 'auto' : 'fixed';
107
- $width = isset($options['sizing']['width' ]) ? $options['sizing']['width' ] : 560;
108
- $height= isset($options['sizing']['height']) ? $options['sizing']['height'] : 315;
109
- $wclass= $wmode == 'auto' ? ' fvp_readonly' : '';
110
- $hclass= $hmode == 'auto' ? ' fvp_readonly' : ''; ?>
111
-
112
- <span class="fvp_toggle_input">
113
- <label class="fvp_grouplable"><?php _e('Width', 'featured-video-plus'); ?>:</label>
114
- <span class="fvp_grouppart1">
115
- <input class="fvp_toggle" type="checkbox" name="fvp-settings[sizing][width][auto]" id="fvp-settings-width-auto" value="auto" <?php checked( 'auto', $wmode, true ) ?>/>
116
- <label for="fvp-settings-width-auto">&nbsp;auto&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>
117
- </span>
118
- <input class="fvp_input<?php echo $wclass; ?>" type="text" name="fvp-settings[sizing][width][fixed]" id="fvp-settings-width-fixed" value="<?php echo $width; ?>" size="4" maxlength="4" style="text-align: right; width: 3em;" <?php if('auto'==$wmode) echo 'readonly="readonly"'; ?>/>
119
- <label for="fvp-settings-width-fixed">&nbsp;px</label>
120
- </span>
121
- <br />
122
- <span class="fvp_toggle_input">
123
- <label class="fvp_grouplable"><?php _e('Height', 'featured-video-plus'); ?>:</label>
124
- <span class="fvp_grouppart1">
125
- <input class="fvp_toggle" type="checkbox" name="fvp-settings[sizing][height][auto]" id="fvp-settings-height-auto" value="auto" <?php checked( 'auto', $hmode, true ) ?>/>
126
- <label for="fvp-settings-height-auto">&nbsp;auto&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>
127
- </span>
128
- <input class="fvp_input<?php echo $hclass; ?>" type="text" name="fvp-settings[sizing][height][fixed]" id="fvp-settings-height-fixed" value="<?php echo $height; ?>" size="4" maxlength="4" style="text-align: right; width: 3em;" <?php if('auto'==$hmode) echo 'readonly="readonly"'; ?>/>
129
- <label for="fvp-settings-height-fixed">&nbsp;px</label>
130
- </span>
131
- <p class="description">
132
- <?php _e('When using <code>auto</code> the video will be adjusted to fit it\'s parent element while sticking to it\'s ratio. Using a <code>fixed</code> height and width might result in <em>not so pretty</em> black bars.', 'featured-video-plus'); ?>
133
- </p>
134
-
135
- <?php }
136
-
137
- /**
138
- * How should the videos be aligned? Only interesting when wmode is set to fixed.
139
- * Feature integrated in 1.3, got it own function in 1.4
140
- *
141
- * @since 1.4
142
- */
143
- function settings_align() {
144
- $align = isset($options['align']) ? $options['align'] : 'center'; ?>
145
-
146
- <input type="radio" name="fvp-settings[align]" id="fvp-settings-align-1" value="left" <?php checked('left', $align, true) ?>/><label for="fvp-settings-align-1">&nbsp;<?php _e('left', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
147
- <input type="radio" name="fvp-settings[align]" id="fvp-settings-align-2" value="center" <?php checked('center',$align, true) ?>/><label for="fvp-settings-align-2">&nbsp;<?php _e('center', 'featured-video-plus'); ?>&nbsp;<span style="font-style: italic;">(<?php _e('default', 'featured-video-plus'); ?>)</span></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
148
- <input type="radio" name="fvp-settings[align]" id="fvp-settings-align-3" value="right" <?php checked('right', $align, true) ?>/><label for="fvp-settings-align-3">&nbsp;<?php _e('right', 'featured-video-plus'); ?></label>
149
-
150
- <?php }
151
- /**
152
- * Displays the settings for local videos
153
- *
154
- * @since 1.5
155
- */
156
- function settings_local() {
157
- $options = get_option( 'fvp-settings' );
158
- $local['poster'] = isset($options['local']['poster']) ? $options['local']['poster'] : false;
159
- $local['loop'] = isset($options['local']['loop']) ? $options['local']['loop'] : false; ?>
160
-
161
- <input type="checkbox" name="fvp-settings[local][poster]" id="fvp-settings-local-poster" value="true" <?php checked(true, $local['poster'], 1) ?>/><label for="fvp-settings-local-poster">&nbsp;<?php _e('Use featured image as video thumbnail', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
162
- <input type="checkbox" name="fvp-settings[local][loop]" id="fvp-settings-local-loop" value="true" <?php checked(true, $local['loop'], 1) ?>/><label for="fvp-settings-local-loop">&nbsp;<?php _e('Loop videos', 'featured-video-plus'); ?></label>
163
-
164
- <?php }
165
-
166
- /**
167
- * Displays the settings to style the YouTube video player.
168
- *
169
- * @see https://developers.google.com/youtube/player_parameters
170
- * @since 1.3
171
- */
172
- function settings_youtube() {
173
- $options = get_option( 'fvp-settings' );
174
- $youtube['theme'] = isset($options['youtube']['theme']) ? $options['youtube']['theme'] : 'dark';
175
- $youtube['color'] = isset($options['youtube']['color']) ? $options['youtube']['color'] : 'red';
176
- $youtube['wmode'] = isset($options['youtube']['wmode']) ? $options['youtube']['wmode'] : 'auto';
177
- $youtube['jsapi'] = isset($options['youtube']['jsapi']) ? $options['youtube']['jsapi'] : 0;
178
- $youtube['info'] = isset($options['youtube']['info']) ? $options['youtube']['info'] : 1;
179
- $youtube['logo'] = isset($options['youtube']['logo']) ? $options['youtube']['logo'] : 1;
180
- $youtube['rel'] = isset($options['youtube']['rel']) ? $options['youtube']['rel'] : 1;
181
- $youtube['fs'] = isset($options['youtube']['fs']) ? $options['youtube']['fs'] : 1; ?>
182
-
183
- <input type="checkbox" name="fvp-settings[youtube][theme]" id="fvp-settings-youtube-theme" value="light" <?php checked('light', $youtube['theme'], 1) ?>/><label for="fvp-settings-youtube-theme">&nbsp;<?php _e('Light Theme', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
184
- <input type="checkbox" name="fvp-settings[youtube][fs]" id="fvp-settings-youtube-fs" value="true" <?php checked(1, $youtube['fs'], 1) ?>/><label for="fvp-settings-youtube-fs">&nbsp;<?php _e('Fullscreen Button', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
185
- <select name="fvp-settings[youtube][wmode]" id="fvp-settings-youtube-wmode" size="1">
186
- <option<?php selected($youtube['wmode'],'auto'); ?>>auto</option>
187
- <option<?php selected($youtube['wmode'],'transparent'); ?>>transparent</option>
188
- <option<?php selected($youtube['wmode'],'opaque'); ?>>opaque</option>
189
- </select>
190
- <label for="fvp-settings-youtube-wmode">&quot;wmode&quot;</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
191
- <br />
192
- <input type="checkbox" name="fvp-settings[youtube][info]" id="fvp-settings-youtube-info" value="true" <?php checked(1, $youtube['info'], 1) ?>/><label for="fvp-settings-youtube-info">&nbsp;<?php _e('Info', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
193
-
194
- <input type="checkbox" name="fvp-settings[youtube][rel]" id="fvp-settings-youtube-rel" value="true" <?php checked(1, $youtube['rel'], 1) ?>/><label for="fvp-settings-youtube-rel">&nbsp;<?php _e('Related Videos', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
195
- <input type="checkbox" name="fvp-settings[youtube][jsapi]" id="fvp-settings-youtube-jsapi" value="true" <?php checked(1, $youtube['jsapi'], 1) ?>/><label for="fvp-settings-youtube-jsapi">&nbsp;<?php _e('Javascript API', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
196
- <input type="checkbox" name="fvp-settings[youtube][color]" id="fvp-settings-youtube-color" value="white" <?php checked('white',$youtube['color'], 1) ?>/><label for="fvp-settings-youtube-color">&nbsp;<?php _e('White Progressbar', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
197
- <span id="youtube_logoinput_wrapper"<?php if($youtube['color'] != 'red') echo ' class="fvp_hidden"'; ?>>
198
- <input type="checkbox" name="fvp-settings[youtube][logo]" id="fvp-settings-youtube-logo" value="true" <?php checked(1, $youtube['logo'], 1) ?>/><label for="fvp-settings-youtube-logo">&nbsp;<?php _e('Logo', 'featured-video-plus'); ?></label>
199
- </span>
200
-
201
- <?php
202
- }
203
-
204
- /**
205
- * Displays the settings to style the vimeo video player. Default: &amp;title=1&amp;portrait=0&amp;byline=1&amp;color=00adef
206
- *
207
- * @see http://developer.vimeo.com/player/embedding
208
- * @see http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
209
- * @see http://codex.wordpress.org/Function_Reference/wp_style_is
210
- * @since 1.0
211
- */
212
- function settings_vimeo() {
213
- $options = get_option( 'fvp-settings' );
214
- $vimeo['portrait'] = isset($options['vimeo']['portrait']) ? $options['vimeo']['portrait'] : 0;
215
- $vimeo['title' ] = isset($options['vimeo']['title' ]) ? $options['vimeo']['title' ] : 1;
216
- $vimeo['byline'] = isset($options['vimeo']['byline']) ? $options['vimeo']['byline'] : 1;
217
- $vimeo['color' ] = isset($options['vimeo']['color' ]) ? $options['vimeo']['color' ] : '00adef'; ?>
218
-
219
- <div style="position: relative; bottom: .6em;">
220
- <input type="checkbox" name="fvp-settings[vimeo][portrait]" id="fvp-settings-vimeo-1" value="display" <?php checked(1, $vimeo['portrait'], 1) ?>/><label for="fvp-settings-vimeo-1">&nbsp;<?php _e('Portrait', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
221
- <input type="checkbox" name="fvp-settings[vimeo][title]" id="fvp-settings-vimeo-2" value="display" <?php checked(1, $vimeo['title'], 1) ?>/><label for="fvp-settings-vimeo-2">&nbsp;<?php _e('Title', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
222
- <input type="checkbox" name="fvp-settings[vimeo][byline]" id="fvp-settings-vimeo-3" value="display" <?php checked(1, $vimeo['byline'], 1) ?>/><label for="fvp-settings-vimeo-3">&nbsp;<?php _e('Byline', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
223
- <span class="color-picker" style="position: relative;<?php if( wp_style_is('wp-color-picker', 'done') ) echo ' top: .6em;'; ?>" >
224
- <input type="text" name="fvp-settings[vimeo][color]" id="fvp-settings-vimeo-color" class="fvp_colorpicker_input" value="#<?php echo $vimeo['color'] ?>" data-default-color="#00adef" />
225
- <label for="fvp-settings-vimeo-color" style="display: none;">&nbsp;<?php _e('Color', 'featured-video-plus'); ?></label>
226
- <?php if( ! wp_style_is('wp-color-picker', 'registered') ) { ?><div class="fvp_colorpicker" id="fvp-settings-vimeo-colorpicker"></div><?php } ?>
227
- </span>
228
- </div>
229
- <p class="description"><?php _e('Vimeo Plus Videos might ignore these settings.', 'featured-video-plus'); ?></p>
230
-
231
- <?php
232
- }
233
-
234
- /**
235
- * Displays the settings to style the Dailymotion video player.
236
- *
237
- * @see https://developers.google.com/youtube/player_parameters
238
- * @see http://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
239
- * @see http://codex.wordpress.org/Function_Reference/wp_style_is
240
- * @since 1.3
241
- */
242
- function settings_dailymotion() {
243
- $options = get_option( 'fvp-settings' );
244
- $dailymotion['logo'] = isset($options['dailymotion']['logo']) ? $options['dailymotion']['logo'] : 1;
245
- $dailymotion['info'] = isset($options['dailymotion']['info']) ? $options['dailymotion']['info'] : 1;
246
- $dailymotion['synd'] = isset($options['dailymotion']['synd']) ? $options['dailymotion']['syndication']: '';
247
- $dailymotion['foreground'] = isset($options['dailymotion']['foreground'])? $options['dailymotion']['foreground'] : 'f7fffd';
248
- $dailymotion['highlight' ] = isset($options['dailymotion']['highlight' ])? $options['dailymotion']['highlight' ] : 'ffc300';
249
- $dailymotion['background'] = isset($options['dailymotion']['background'])? $options['dailymotion']['background'] : '171d1b'; ?>
250
-
251
- <input type="checkbox" name="fvp-settings[dailymotion][logo]" id="fvp-settings-dailymotion-logo" value="display" <?php checked( 1, $dailymotion['logo'], 1 ) ?>/><label for="fvp-settings-dailymotion-logo">&nbsp;<?php _e('Logo', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
252
- <input type="checkbox" name="fvp-settings[dailymotion][info]" id="fvp-settings-dailymotion-info" value="display" <?php checked( 1, $dailymotion['info'], 1 ) ?>/><label for="fvp-settings-dailymotion-info">&nbsp;<?php _e('Videoinfo', 'featured-video-plus'); ?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
253
- <input type="text" name="fvp-settings[dailymotion][synd]" id="fvp-settings-dailymotion-synd" value="<?php echo $dailymotion['synd']; ?>" size="6" /><label for="fvp-settings-dailymotion-synd">&nbsp;<?php _e('Syndication Key', 'featured-video-plus'); ?></label>
254
- <br />
255
- <span class="color-picker" style="position: relative;<?php if( wp_style_is('wp-color-picker', 'done') ) echo ' top: .6em;'; ?>" >
256
- <input type="text" name="fvp-settings[dailymotion][foreground]" id="fvp-settings-dailymotion-foreground" class="fvp_colorpicker_input" value="#<?php echo $dailymotion['foreground'] ?>" data-default-color="#f7fffd" />
257
- <label for="fvp-settings-dailymotion-foreground" style="display: none;">&nbsp;<?php _e('Foreground', 'featured-video-plus'); ?></label>
258
- <?php if( !wp_style_is('wp-color-picker', 'registered' ) ) { ?><div class="fvp_colorpicker" id="fvp-settings-dailymotion-foreground-colorpicker"></div><?php } ?>
259
- </span>
260
- <span class="color-picker" style="position: relative;<?php if( wp_style_is('wp-color-picker', 'done') ) echo ' top: .6em;'; ?>" >
261
- <input type="text" name="fvp-settings[dailymotion][highlight]" id="fvp-settings-dailymotion-highlight" class="fvp_colorpicker_input" value="#<?php echo $dailymotion['highlight'] ?>" data-default-color="#ffc300" />
262
- <label for="fvp-settings-dailymotion-highlight" style="display: none;">&nbsp;<?php _e('Highlight', 'featured-video-plus'); ?></label>
263
- <?php if( !wp_style_is('wp-color-picker', 'registered' ) ) { ?><div class="fvp_colorpicker" id="fvp-settings-dailymotion-highlight-colorpicker"></div><?php } ?>
264
- </span>
265
- <span class="color-picker" style="position: relative;<?php if( wp_style_is('wp-color-picker', 'done') ) echo ' top: .6em;'; ?>" >
266
- <input type="text" name="fvp-settings[dailymotion][background]" id="fvp-settings-dailymotion-background" class="fvp_colorpicker_input" value="#<?php echo $dailymotion['background'] ?>" data-default-color="#171d1b" />
267
- <label for="fvp-settings-dailymotion-background" style="display: none;">&nbsp;<?php _e('Background', 'featured-video-plus'); ?></label>
268
- <?php if( !wp_style_is('wp-color-picker', 'registered' ) ) { ?><div class="fvp_colorpicker" id="fvp-settings-dailymotion-background-colorpicker"></div><?php } ?>
269
- </span>
270
- <br />
271
- <?php
272
- }
273
-
274
- /**
275
- * Displays info about rating the plugin, giving feedback and requesting new features
276
- *
277
- * @since 1.0
278
- */
279
- function settings_rate() {
280
- $options = get_option( 'fvp-settings' );
281
- $optout = isset($options['out']) ? $options['out'] : false;
282
- echo '<p>';
283
- printf(
284
- __('If you have found a bug or are missing a specific video service, please %slet me know%s in the support forum. Elsewise, if you like the plugin: Please %srate it!%s', 'featured-video-plus'),
285
- '<a href="http://wordpress.org/support/plugin/featured-video-plus#plugin-title" title="Featured Video Plus Support Forum on WordPress.org" target="_blank" style="font-weight: bold;">', '</a>',
286
- '<a href="http://wordpress.org/support/view/plugin-reviews/featured-video-plus#plugin-title" title="Rate Featured Video Plus on WordPress.org" target="_blank" style="font-weight: bold;">', '</a>'
287
- );
288
- echo '</p>';
289
- }
290
-
291
- /**
292
- * Function through which all settings are passed before they are saved. Validate the data.
293
- *
294
- * @since 1.0
295
- */
296
- function settings_save($input) {
297
- $hexcolor = '/#?([0123456789abcdef]{3}[0123456789abcdef]{0,3})/i';
298
- $numbers = '#[0-9]{1,4}#';
299
- $options = get_option( 'fvp-settings' );
300
-
301
- // Usage
302
- $options['usage'] = isset($input['usage']) ? $input['usage'] : 'replace';
303
- $options['issingle'] = ! empty($input['issingle']) ? true : false;
304
-
305
- // Sizing
306
- if(isset($input['sizing']['width' ]['fixed'])) {
307
- preg_match($numbers, $input['sizing']['width']['fixed'], $width);
308
- $options['sizing']['width' ] = isset($width[0]) ? $width[ 0] : 560;
309
- }
310
- if(isset($input['sizing']['height' ]['fixed'])) {
311
- preg_match($numbers, $input['sizing']['height']['fixed'], $height);
312
- $options['sizing']['height'] = isset($height[0]) ? $height[0] : 315;
313
- }
314
- $options['sizing']['wmode' ] = isset($input['sizing']['width' ]['auto']) ? 'auto' : 'fixed';
315
- $options['sizing']['hmode' ] = isset($input['sizing']['height']['auto']) ? 'auto' : 'fixed';
316
-
317
- // Align
318
- $options['align' ] = isset($input['align']) ? $input['align'] : 'center';
319
-
320
- // Autoplay
321
- $options['autoplay'] = isset( $input['autoplay'] ) ? $input['autoplay'] : 'no'; //yes/auto/no
322
-
323
- // Local
324
- $options['local']['poster'] = isset( $input['local']['poster'] ) ? true : false;
325
- $options['local']['loop'] = isset( $input['local']['loop' ] ) ? true : false;
326
-
327
- // YouTube
328
- $options['youtube']['wmode'] = isset($input['youtube']['wmode']) ? $input['youtube']['wmode'] : 'auto';
329
- $options['youtube']['theme'] = isset($input['youtube']['theme']) && ( $input['youtube']['theme'] == 'light') ? 'light' : 'dark';
330
- $options['youtube']['color'] = isset($input['youtube']['color']) && ( $input['youtube']['color'] == 'white') ? 'white' : 'red';
331
- $options['youtube']['jsapi'] = isset($input['youtube']['jsapi']) && ( $input['youtube']['jsapi'] == 'true' ) ? 1 : 0;
332
- $options['youtube']['info'] = isset($input['youtube']['info']) && ( $input['youtube']['info'] == 'true' ) ? 1 : 0;
333
- $options['youtube']['logo'] = isset($input['youtube']['logo']) && ( $input['youtube']['logo'] == 'true' ) ? 1 : 0;
334
- $options['youtube']['rel'] = isset($input['youtube']['rel']) && ( $input['youtube']['rel'] == 'true' ) ? 1 : 0;
335
- $options['youtube']['fs'] = isset($input['youtube']['fs']) && ( $input['youtube']['fs'] == 'true' ) ? 1 : 0;
336
-
337
- // Vimeo
338
- $options['vimeo']['portrait'] = isset($input['vimeo']['portrait']) && ( $input['vimeo']['portrait'] == 'display' ) ? 1 : 0;
339
- $options['vimeo']['title'] = isset($input['vimeo']['title']) && ( $input['vimeo']['title'] == 'display' ) ? 1 : 0;
340
- $options['vimeo']['byline'] = isset($input['vimeo']['byline']) && ( $input['vimeo']['byline'] == 'display' ) ? 1 : 0;
341
-
342
- if( isset($options['vimeo']['color']) ) preg_match($hexcolor, $input['vimeo']['color'], $vimeocolor);
343
- $options['vimeo']['color'] = isset($vimeocolor[1]) && !empty($vimeocolor[1]) ? $vimeocolor[1] : '00adef';
344
-
345
- // Dailymotion
346
- $options['dailymotion']['logo'] = isset($input['dailymotion']['logo']) && ( $input['dailymotion']['logo'] == 'display' ) ? 1 : 0;
347
- $options['dailymotion']['info'] = isset($input['dailymotion']['info']) && ( $input['dailymotion']['info'] == 'display' ) ? 1 : 0;
348
- $options['dailymotion']['syndication'] = isset($input['dailymotion']['synd']) && !empty($input['dailymotion']['synd']) ? $input['dailymotion']['synd'] : '';
349
-
350
- if( isset($options['dailymotion']['foreground']) ) preg_match($hexcolor, $input['dailymotion']['foreground'], $dm_foreground);
351
- if( isset($options['dailymotion']['highlight']) ) preg_match($hexcolor, $input['dailymotion']['highlight'], $dm_highlight);
352
- if( isset($options['dailymotion']['background']) ) preg_match($hexcolor, $input['dailymotion']['background'], $dm_background);
353
- $options['dailymotion']['foreground'] = isset($dm_foreground[1]) && !empty($dm_foreground[1])? $dm_foreground[1] : 'f7fffd';
354
- $options['dailymotion']['highlight'] = isset($dm_highlight[ 1]) && !empty($dm_highlight[ 1])? $dm_highlight[ 1] : 'ffc300';
355
- $options['dailymotion']['background'] = isset($dm_background[1]) && !empty($dm_background[1])? $dm_background[1] : '171d1b';
356
-
357
- return $options;
358
- }
359
-
360
- /**
361
- * Initializes the help texts.
362
- *
363
- * @since 1.3
364
- */
365
- public function help() {
366
- $this->help_shortcode = '
367
- <ul>
368
- <li>
369
- <code>[featured-video-plus]</code><br />
370
- <span style="padding-left: 5px;">'.__('Displays the video in its default size.', 'featured-video-plus').'</span>
371
- </li>
372
- <li>
373
- <code>[featured-video-plus width=560]</code><br />
374
- <span style="padding-left: 5px;">'.__('Displays the video with an width of 300 pixel. Height will be fitted to the aspect ratio.', 'featured-video-plus').'</span>
375
- </li>
376
- <li>
377
- <code>[featured-video-plus width=560 height=315]</code><br />
378
- <span style="padding-left: 5px;">'.__('Displays the video with an fixed width and height.', 'featured-video-plus').'</span>
379
- </li>
380
- </ul>'."\n";
381
-
382
- $this->help_functions ='
383
- <ul class="fvp_code_list">
384
- <li><code>the_post_video( $size )</code></li>
385
- <li><code>has_post_video( $post_id )</code></li>
386
- <li><code>get_the_post_video( $post_id, $size )</code></li>
387
- <li><code>get_the_post_video_url( $post_id )</code></li>
388
- <li><code>get_the_post_video_image_url( $post_id )</code></li>
389
- <li><code>get_the_post_video_image( $post_id )</code></li>
390
- </ul>
391
- <p>
392
- '.sprintf(__('All parameters are optional. If %s the current post\'s id will be used. %s is either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32).', 'featured-video-plus'), '<code>post_id == null</code>', '<code>$size</code>').'<br />
393
- </p>
394
- <p style="margin-bottom: 0;">
395
- '.sprintf(__('The functions are implemented corresponding to the original %sfunctions%s: They are intended to be used and to act the same way. Take a look into the WordPress Codex for further guidance:', 'featured-video-plus'), '<a href="http://codex.wordpress.org/Post_Thumbnails#Function_Reference" target="_blank">'.__('Featured Image').'&nbsp;', '</a>').'
396
- </p>
397
- <ul class="fvp_code_list" style="margin-top: 0;">
398
- <li><code><a href="http://codex.wordpress.org/Function_Reference/the_post_thumbnail" target="_blank">get_the_post_thumbnail</a></code></li>
399
- <li><code><a href="http://codex.wordpress.org/Function_Reference/wp_get_attachment_image" target="_blank">wp_get_attachment_image</a></code></li>
400
- </ul>'."\n";
401
- }
402
-
403
- /**
404
- * Adds help tabs to contextual help. WordPress 3.3+
405
- *
406
- * @see http://codex.wordpress.org/Function_Reference/add_help_tab
407
- *
408
- * @since 1.3
409
- */
410
- public function tabs() {
411
- $screen = get_current_screen();
412
- if( ($screen->id != 'options-media') || (get_bloginfo('version') < 3.3) )
413
- return;
414
-
415
- // PHP FUNCTIONS HELP TAB
416
- $screen->add_help_tab( array(
417
- 'id' => 'fvp_help_functions',
418
- 'title' => 'Featured Video Plus: '.__('PHP-Functions','featured-video-plus'),
419
- 'content' => $this->help_functions
420
- ));
421
-
422
- // SHORTCODE HELP TAB
423
- $screen->add_help_tab( array(
424
- 'id' => 'fvp_help_shortcode',
425
- 'title' => 'Featured Video Plus: Shortcode',
426
- 'content' => $this->help_shortcode
427
- ));
428
- }
429
-
430
- /**
431
- * Adds help text to contextual help. WordPress 3.3-
432
- *
433
- * @see http://wordpress.stackexchange.com/a/35164
434
- *
435
- * @since 1.3
436
- */
437
- public function help_pre_33( $contextual_help, $screen_id, $screen ) {
438
- if( $screen->id != 'options-media' )
439
- return $contextual_help;
440
-
441
- $contextual_help .= '<hr /><h3>Featured Video Plus: '.__('PHP-Functions','featured-video-plus').'</h3>';
442
- $contextual_help .= $this->help_functions;
443
- $contextual_help .= '<h3>Featured Video Plus: Shortcode</h3>';
444
- $contextual_help .= $this->help_shortcode;
445
-
446
- return $contextual_help;
447
- }
448
-
449
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
php/somatic_attach_external_image.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
- /**
3
- * Download an image from the specified URL and attach it to a post.
4
- * Modified version of core function media_sideload_image() in /wp-admin/includes/media.php (which returns an html img tag instead of attachment ID)
5
- * Additional functionality: ability override actual filename, and to pass $post_data to override values in wp_insert_attachment (original only allowed $desc)
6
- *
7
- * @since 1.4 Somatic Framework
8
- *
9
- * @param string $url (required) The URL of the image to download
10
- * @param int $post_id (required) The post ID the media is to be associated with
11
- * @param bool $thumb (optional) Whether to make this attachment the Featured Image for the post (post_thumbnail)
12
- * @param string $filename (optional) Replacement filename for the URL filename (do not include extension)
13
- * @param array $post_data (optional) Array of key => values for wp_posts table (ex: 'post_title' => 'foobar', 'post_status' => 'draft')
14
- * @return int|object The ID of the attachment or a WP_Error on failure
15
- */
16
- function somatic_attach_external_image( $url = null, $post_id = null, $thumb = null, $filename = null, $post_data = array() ) {
17
- if ( !$url || !$post_id ) return new WP_Error('missing', "Need a valid URL and post ID...");
18
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
19
- // Download file to temp location, returns full server path to temp file, ex; /home/user/public_html/mysite/wp-content/26192277_640.tmp
20
- $tmp = download_url( $url );
21
-
22
- // If error storing temporarily, unlink
23
- if ( is_wp_error( $tmp ) ) {
24
- @unlink($file_array['tmp_name']); // clean up
25
- $file_array['tmp_name'] = '';
26
- return $tmp; // output wp_error
27
- }
28
-
29
- preg_match('/[^\?]+\.(jpg|JPG|jpe|JPE|jpeg|JPEG|gif|GIF|png|PNG)/', $url, $matches); // fix file filename for query strings
30
- $url_filename = basename($matches[0]); // extract filename from url for title
31
- $url_type = wp_check_filetype($url_filename); // determine file type (ext and mime/type)
32
-
33
- // override filename if given, reconstruct server path
34
- if ( !empty( $filename ) ) {
35
- $filename = sanitize_file_name($filename);
36
- $tmppath = pathinfo( $tmp ); // extract path parts
37
- $new = $tmppath['dirname'] . "/". $filename . "." . $tmppath['extension']; // build new path
38
- rename($tmp, $new); // renames temp file on server
39
- $tmp = $new; // push new filename (in path) to be used in file array later
40
- }
41
-
42
- // assemble file data (should be built like $_FILES since wp_handle_sideload() will be using)
43
- $file_array['tmp_name'] = $tmp; // full server path to temp file
44
-
45
- if ( !empty( $filename ) ) {
46
- $file_array['name'] = $filename . "." . $url_type['ext']; // user given filename for title, add original URL extension
47
- } else {
48
- $file_array['name'] = $url_filename; // just use original URL filename
49
- }
50
-
51
- // set additional wp_posts columns
52
- if ( empty( $post_data['post_title'] ) ) {
53
- $post_data['post_title'] = basename($url_filename, "." . $url_type['ext']); // just use the original filename (no extension)
54
- }
55
-
56
- // make sure gets tied to parent
57
- if ( empty( $post_data['post_parent'] ) ) {
58
- $post_data['post_parent'] = $post_id;
59
- }
60
-
61
- // required libraries for media_handle_sideload
62
- require_once(ABSPATH . 'wp-admin/includes/file.php');
63
- require_once(ABSPATH . 'wp-admin/includes/media.php');
64
- require_once(ABSPATH . 'wp-admin/includes/image.php');
65
-
66
- // do the validation and storage stuff
67
- $att_id = media_handle_sideload( $file_array, $post_id, null, $post_data ); // $post_data can override the items saved to wp_posts table, like post_mime_type, guid, post_parent, post_title, post_content, post_status
68
-
69
- // If error storing permanently, unlink
70
- if ( is_wp_error($att_id) ) {
71
- @unlink($file_array['tmp_name']); // clean up
72
- return $att_id; // output wp_error
73
- }
74
-
75
- // set as post thumbnail if desired
76
- if ($thumb) {
77
- set_post_thumbnail($post_id, $att_id);
78
- }
79
-
80
- return $att_id;
81
- }
82
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
php/upgrade.php DELETED
@@ -1,158 +0,0 @@
1
- <?php
2
- /**
3
- * Is used on plugin upgrade and on first activation. Initializes and upgrades options, places notice etc.
4
- *
5
- * @since 1.2
6
- */
7
- function featured_video_plus_upgrade() {
8
- $options = $options_org = get_option( 'fvp-settings' );
9
-
10
- if (!isset($options['overwrite'])&&!isset($options['usage']))
11
- $version = '0';
12
- elseif( !isset($options['version']) )
13
- $version = '1.1';
14
- else
15
- $version = $options['version'];
16
-
17
- if( $version != FVP_VERSION ) {
18
- switch( $version ) {
19
- case '0':
20
- $options = array(
21
- 'overwrite' => true,
22
- 'width' => 'auto',
23
- 'height' => 'auto',
24
- 'vimeo' => array(
25
- 'portrait' => 0,
26
- 'title' => 1,
27
- 'byline' => 1,
28
- 'color' => '00adef'
29
- )
30
- );
31
-
32
-
33
- case '1.0':
34
- case '1.1':
35
- if( $version == '1.0' || $version == '1.1' ) {
36
- // removed this user meta in 1.2
37
- $users = array_merge( get_users( array( 'role' => 'Administrator' ) ),
38
- get_users( array( 'role' => 'Super Admin' ) ) );
39
- foreach( $users as $user )
40
- delete_user_meta( $user->ID, 'fvp_activation_notification_ignore' );
41
- }
42
-
43
-
44
- case '1.2':
45
- $options['videojs'] = array(
46
- 'skin' => 'videojs' //videojs,moonfy,tubejs
47
- );
48
- $options['youtube'] = array(
49
- 'theme' => 'dark',
50
- 'color' => 'red',
51
- 'info' => 1,
52
- 'rel' => 1,
53
- 'fs' => 1
54
- );
55
- $options['dailymotion'] = array(
56
- 'foreground' => 'F7FFFD',
57
- 'highlight' => 'FFC300',
58
- 'background' => '171D1B',
59
- 'logo' => 1,
60
- 'info' => 1
61
- );
62
- $options['sizing'] = array(
63
- 'wmode' => $options['width'],
64
- 'hmode' => $options['height'],
65
- 'width' => 560,
66
- 'height' => 315,
67
- 'align' => 'left'
68
- );
69
- unset( $options['width'], $options['height'] );
70
-
71
-
72
- case '1.3':
73
- $options['out'] = 0;
74
- $options['autoplay'] = 0;
75
- $options['youtube']['logo'] = 1;
76
- $options['dailymotion']['syndication'] = '';
77
-
78
- $options['align'] = $options['sizing']['wmode'] == 'auto' ? 'center' : $options['sizing']['align'];
79
- unset( $options['sizing']['align'] );
80
-
81
-
82
- case '1.4':
83
- $options['youtube']['wmode'] = 'auto';
84
- $options['local']['videojs']['js'] = true;
85
- $options['local']['videojs']['css'] = true;
86
- $options['local']['videojs']['cdn'] = false;
87
- unset($options['videojs']);
88
-
89
-
90
- case '1.5':
91
- case '1.5.1':
92
- $options['youtube']['jsapi'] = 0;
93
- $options['local']['videojs']['poster'] = false;
94
- unset($options['reged'], $options['out']);
95
-
96
-
97
- case '1.6':
98
- case '1.6.1':
99
- $options['usage'] = $options['overwrite'] ? 'replace' : 'manual'; // replace;manual;overlay
100
- unset($options['overwrite']);
101
-
102
-
103
- case '1.7':
104
- case '1.7.1':
105
- $options['local']['cdn'] = $options['local']['videojs']['cdn'];
106
- $options['local']['enabled'] = $options['local']['videojs']['js'];
107
- $options['local']['poster'] = $options['local']['videojs']['poster'];
108
- unset($options['local']['videojs']);
109
-
110
- $options['local']['foreground'] = "cccccc";
111
- $options['local']['highlight'] = "66a8cc";
112
- $options['local']['background'] = "000000";
113
- $options['local']['controls'] = true;
114
- $options['local']['loop'] = false;
115
- $options['autoplay'] = $options['autoplay'] ? 'yes' : 'no'; //yes/auto/no
116
-
117
-
118
- case '1.8':
119
- unset(
120
- $options['local']['cdn'],
121
- $options['local']['enabled'],
122
- $options['local']['foreground'],
123
- $options['local']['background'],
124
- $options['local']['controls']
125
- );
126
-
127
- // check all featured video post metas
128
- $ids = $GLOBALS['featured_video_plus']->get_post_by_custom_meta('_fvp_video');
129
- foreach( $ids as $id ) {
130
- $meta = $meta_old = maybe_unserialize(get_post_meta( $id, '_fvp_video', true ));
131
- // update video data ('attr' to 'time') and fix serialization, was in case '1.4'
132
- if( isset( $meta['attr'] ) ) {
133
- $meta['time'] = $meta['attr'];
134
- unset($meta['attr']);
135
- }
136
-
137
- // remove 'sec_id', only one local video file is used now.
138
- if( isset( $meta['sec_id'] ) )
139
- unset($meta['sec_id']);
140
- if ( $meta != $meta_old )
141
- update_post_meta($id, '_fvp_video', $meta);
142
- }
143
-
144
- case '1.9':
145
- $options['issingle'] = false;
146
-
147
-
148
- // *************************************************************
149
- default:
150
- $options['version'] = FVP_VERSION;
151
- break;
152
- }
153
- }
154
-
155
- if( $options != $options_org )
156
- update_option( 'fvp-settings', $options );
157
-
158
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,68 +2,123 @@
2
  Contributors: a.hoereth
3
  Plugin Name: Featured Video Plus
4
  Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/
5
- Tags: featured, post, video, image, thumbnail, html5, flash, youtube, vimeo, dailymotion, mp4, webm, ogg, embed, ajax
6
  Author: Alexander Höreth
7
  Author URI: http://yrnxt.com/
8
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
- Requires at least: 3.2
12
- Tested up to: 4.0
13
- Stable tag: 1.9.1
 
 
 
14
 
15
- Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo, Dailymotion.
16
 
17
  == Description ==
18
- *A picture is worth a thousand words. How many words is a video worth?*
19
 
20
- This plugin enables you to define Featured Videos, which can automatically be displayed instead of Featured Images. There are three ways to get the videos onto your page:
21
 
22
- 1. If your theme already makes use of [Featured Images](http://codex.wordpress.org/Post_Thumbnails), these will in most themes __automatically__ be replaced by your Featured Videos if available. Alternatively you can
 
 
23
  2. insert the `[featured-video-plus]`-__Shortcode__ in your posts or
24
- 3. manually make use of the __PHP functions__ in your theme's source files.
 
 
 
 
 
 
 
 
25
 
26
- Instead of option 1 the plugin can also request the videos using an AJAX request when the Featured Image is clicked. This reduces load times and gives you the flexibility to display videos in a lightbox to ensure your theme does not break.
 
27
 
28
- See the theme in action on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus/). Also take a look at the [Garvan](http://www.web2feel.com/garvan/) video blogging theme which makes optimal use of this plugin.
29
 
30
- Beside your __Local Videos__ (WordPress 3.6+ required) you can use videos from __YouTube__, __Vimeo__ and __Dailymotion__. If you miss a certain video platform: [Leave me a note](http://wordpress.org/support/plugin/featured-video-plus). For YouTube and Dailymotion the plugin also features [time-links](http://support.google.com/youtube/bin/answer.py?hl=en&answer=116618).
31
 
32
- The plugin adds customization options to your Media Settings. Beside aesthetic individualizations for each video platform's player you can turn off automatic featured image replacement, turn on autoplay, define your Dailymotion Syndication Key and tweak video sizing. By default videos try to dynamically fit their parent containers width. Take a look at *Settings -> Media*.
 
 
 
 
 
 
 
 
33
 
34
- = Shortcode =
 
 
 
 
35
 
36
  [featured-video-plus]
37
  [featured-video-plus width=300]
38
 
39
- = PHP functions =
40
 
41
  the_post_video( $size )
42
  has_post_video( $post_id )
43
  get_the_post_video( $post_id, $size )
44
  get_the_post_video_url( $post_id )
45
- get_the_post_video_image_url( $post_id, $fallback )
46
  get_the_post_video_image( $post_id )
 
 
 
47
 
48
- All parameters are optional. If no `$post_id` is given the current post's ID will be used. `$size` is either a string keyword (`thumbnail`, `medium`, `large` or `full`) or a 2-item array representing width and height in pixels, e.g. array(560,320). $fallback by default is false, when set to true this will return the fallback URL for local videos.
49
 
50
 
51
 
 
52
 
53
- *This plugin was created with the original [Featured Video](http://wordpress.org/extend/plugins/featured-video/) plugin in mind. __Featured Video Plus__ was freshly coded from ground up to bring you more features and to integrate more seamlessly into WordPress.*
 
 
54
 
55
 
56
- == Installation ==
57
 
58
- 1. Visit your WordPress Administration interface and go to Plugins -> Add New
59
- 2. Search for "*Featured Video Plus*", and click "*Install Now*" below the plugin's name
60
- 3. When the installation finished, click "*Activate Plugin*"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
- The plugin is ready to go. Now edit your posts and add video links to the "Featured Video" box on the right! Plugin specific settings can be found under *Settings -> Media*.
63
 
64
 
65
  == Changelog ==
66
 
 
 
 
 
 
 
67
 
68
  = 1.9.1: 2014-09-06 =
69
  * __Last update compatible all the way back to WordPress 3.2!__
@@ -143,62 +198,3 @@ The plugin is ready to go. Now edit your posts and add video links to the "Featu
143
 
144
  = 1.0: 2012-12-13 =
145
  * Release
146
-
147
-
148
- == Upgrade Notice ==
149
-
150
- = 1.6 =
151
- Smoothness
152
-
153
- = 1.5 =
154
- AJAX!
155
-
156
- = 1.4 =
157
- WP3.5 Media Manager, time-links...
158
-
159
- = 1.3 =
160
- Internationalization! More user friendly, more customizations.
161
-
162
- = 1.2 =
163
- Now featuring your local videos!
164
-
165
- = 1.1 =
166
- Feature Dailymotion Videos on your posts!
167
-
168
-
169
- == Screenshots ==
170
-
171
- 1. Featured Video and Featured Image boxes on the post edit screen.
172
- 2. A Featured Video in the Twenty Twelve theme.
173
- 3. Settings -> Media screen
174
-
175
-
176
- == Frequently Asked Questions ==
177
-
178
- = After adding the URL and saving the post I do not get any video? =
179
- Maybe the plugin does not recognize the URL. Take a look into the contextual help (button on the top right of the post edit screen). There is a list what the URLs should look like. If this does not help leave a note in the support forum.
180
-
181
- = The input box has a red background - but the video works just fine. Whats going on? =
182
- With every video you insert into the meta box the plugin tries to access the API of the
183
- according video provider to grab information about the video and pull an image. When this API
184
- access fails the input box gets a red background. When for example the server you are using is
185
- located in Germany it cannot access the YouTube API for videos blocked in this country - still
186
- you and your visitors might be able to watch the videos as normal. The plugin cannot test for this.
187
-
188
- = How do I use my local videos? =
189
- Take a look into the contextual help (button on the top right of the post edit screen).
190
-
191
- = My theme uses Featured Images. Why are my videos not being displayed in place? =
192
- For the videos to be automatically displayed you need to define a Featured Image. This image will never be shown if a video is available.
193
- Beside this your theme needs to feature [Post Thumbnails](http://codex.wordpress.org/Post_Thumbnails) and make use of `get_the_post_thumbnail()` or `the_post_thumbnail()`, because these are the core functions the plugin hooks into.
194
-
195
- If the automatic integration does not work, you can tell me in the [Support Forum](http://wordpress.org/support/plugin/featured-video-plus) which theme you are using and I will take a look at it and might be able to develop a workaround.
196
-
197
- = How can I make the videos fit the theme? =
198
- Take a look at your media settings and try different fixed sizes. If tweaking those does not help: [Tell me](http://wordpress.org/support/plugin/featured-video-plus) which theme you are using.
199
-
200
- = What about other video providers? =
201
- Leave me a note in the support forums which video platforms you would like to see in a feature release!
202
-
203
- = How can I translate the plugin? =
204
- Grab the [featured-video-plus.pot](https://github.com/ahoereth/featured-video-plus/blob/master/lng/featured-video-plus.pot) file, [translate it](http://urbangiraffe.com/articles/translating-wordpress-themes-and-plugins/) and post it in the [Support Forum](http://wordpress.org/support/plugin/featured-video-plus). It will very likely be shipped with the next version.
2
  Contributors: a.hoereth
3
  Plugin Name: Featured Video Plus
4
  Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/
5
+ Tags: featured, post, video, videos, image, thumbnail, html5, flash, lazy, overlay, youtube, vimeo, dailymotion, soundcloud, spotify
6
  Author: Alexander Höreth
7
  Author URI: http://yrnxt.com/
8
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+ Requires at least: 3.7
12
+ Tested up to: 4.2.2
13
+ Stable tag: 2.0.0
14
+
15
+ Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo and many more.
16
+
17
 
 
18
 
19
  == Description ==
20
+ > A picture is worth a thousand words. How many words is a video worth?
21
 
22
+ Featured Videos work like Featured Images, just smoother: Paste a video URL into the designated new box on the post edit screen and the video will be displayed in place of a post image.
23
 
24
+ There are three ways to get the videos onto your page:
25
+
26
+ 1. **Automagically!** If your theme makes use of WordPress' native [featured image functionality](http://codex.wordpress.org/Post_Thumbnails) you are set: Automatic insertion, lazy loading or lightbox overlays, its your choice. If this does not work you can either
27
  2. insert the `[featured-video-plus]`-__Shortcode__ in your posts or
28
+ 3. manually make use of the __PHP-functions__ in your theme's source files.
29
+
30
+ > Sadly many themes do not follow the WordPress standards and implement their own fancy functions for displaying featured images - check out the [FAQ](https://wordpress.org/plugins/featured-video-plus/faq/). Another common problem are sliders - in general: Videos do not like sliders at all.
31
+
32
+ See the plugin in action on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus/). There is a button in the sidebar to switch between the different featured video display modes: [Automatic](http://yrnxt.com/wordpress/featured-video-plus/?setfvpmode=replace), [lazy](http://yrnxt.com/wordpress/featured-video-plus/?setfvpmode=dynamic) and [overlay](http://yrnxt.com/wordpress/featured-video-plus/?setfvpmode=overlay).
33
+
34
+ Besides **Local Videos** you can use videos from a whole lot of external providers like **YouTube**, **Vimeo** and **Dailymotion**. **SoundCloud** and **Spotify** (including playlists) are supported as well. Check the [WordPress Codex](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) for a complete list. If some provider is not listed you can always just use an embed code or whatever HTML you like.
35
+
36
+ After installing the plugin check your site's *Media Settings* (`Settings -> Media` in the administration interface): The plugin adds quite some little helper options there. Change to lazy or overlay mode, tweak video sizing, individualize the look of the most prominent providers' video players and turn on autoplay or video looping. By default videos try to dynamically fit their parent containers width and adjust their size responsively.
37
 
38
+ = Support =
39
+ I do read all support questions in the [forums](https://wordpress.org/support/plugin/featured-video-plus) but cannot reply to all of them. The plugin is an unpaid side project and full support would require more time than I can invest for free for over 10k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements.
40
 
 
41
 
 
42
 
43
+ == Installation ==
44
+
45
+ = Installation =
46
+
47
+ 1. Visit your WordPress Administration interface and go to `Plugins -> Add New`
48
+ 2. Search for `Featured Video Plus`, and click `Install Now` below the plugin's name
49
+ 3. When the installation finished, click `Activate Plugin`
50
+
51
+ The plugin is ready to go. Now edit your posts and add video links to the `Featured Video` box on the right! Plugin specific settings can be found under `Settings -> Media`.
52
 
53
+ = Theme integration =
54
+
55
+ If the automatic integration fails you can always fallback to either using the shortcode or adjusting your themes sourcecode manually:
56
+
57
+ **Shortcode**
58
 
59
  [featured-video-plus]
60
  [featured-video-plus width=300]
61
 
62
+ **PHP-functions**
63
 
64
  the_post_video( $size )
65
  has_post_video( $post_id )
66
  get_the_post_video( $post_id, $size )
67
  get_the_post_video_url( $post_id )
 
68
  get_the_post_video_image( $post_id )
69
+ get_the_post_video_image_url( $post_id )
70
+
71
+ All parameters are optional. If no `$post_id` is given the current post's ID will be used. `$size` is either a string keyword (`thumbnail`, `medium`, `large` or `full`) or a 2-item array representing width and height in pixels, e.g. `array(560,320)`.
72
 
73
+ When editing your theme's sourcecode keep in mind that a future update through WordPress.org might overwrite your changes. Consider creating a child theme to prevent that.
74
 
75
 
76
 
77
+ == Screenshots ==
78
 
79
+ 1. A Featured Video in the Twenty Fifteen theme on [yrnxt.com](http://yrnxt.com/wordpress/featured-video-plus).
80
+ 2. Featured Video and Featured Image boxes on the post edit screen.
81
+ 3. Featured Video settings on the `Settings -> Media` administration screen.
82
 
83
 
 
84
 
85
+ == Frequently Asked Questions ==
86
+
87
+ = Why do I just get text back after adding an URL to the Featured Video input? =
88
+ If the plugin just displays the URL back as text it probably does not recognize that it comes from a video provider. Try inserting the raw embed code instead and [check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported.
89
+
90
+ = How do I use my local videos? =
91
+ Click the small media icon in the Featured Video input box on the post edit screen and upload your video or choose it from the media library. WordPress does not support all formats tho, [check this table](http://www.mediaelementjs.com/#devices) for details.
92
+
93
+ = Why do I not see a featuerd video or image on the frontend at all? =
94
+ For the videos to be automatically displayed you need to define a Featured Image. This image will never be shown if a video is available. If your theme does not support featured images the plugin also has no chance of working out of the box.
95
+
96
+ = Why does the frontend still display the featured image although I added a featured video to the post? =
97
+ Sadly not all themes work out of the box. Themes need to make use of WordPress' native [Post Thumbnail](http://codex.wordpress.org/Post_Thumbnails) functionality (specifically `get_the_post_thumbnail()` and/or `the_post_thumbnail()`) - these functions are where the plugin can hook into the theme and modify what is displayed. Consider contacting the theme's creator or modifying the theme's sourcecode in order to add the plugin's [PHP-functions](https://wordpress.org/plugins/featured-video-plus/installation/).
98
+
99
+ = How can I make the videos fit into their designated space in my theme? =
100
+ Take a look at your media settings and try using a fixed width instead of responsive sizing.
101
+
102
+ = Can I help translating the plugin? =
103
+ Yes, please! Check out the public [Featured Video Plus Translation Project](https://poeditor.com/join/project?hash=WlyLh0cFO3).
104
+
105
+
106
+
107
+ == Upgrade Notice ==
108
+
109
+ = 2.0.0 =
110
+ Only upgrade when using WordPress 3.7 or higher! Big refactor with support for more video providers.
111
 
 
112
 
113
 
114
  == Changelog ==
115
 
116
+ = 2.0.0: 2015-06-01 =
117
+ * __Requires WordPress 3.7 or higher now!__ This reflects versions of WordPress which are "officially" [supported](https://codex.wordpress.org/Supported_Versions). The plugin will from now on try to stick to supporting all versions listed there.
118
+ * Major code refactor which results in many bugs scrubbed.
119
+ * Support for raw embed codes and [all WordPress core media providers](https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F).
120
+ * Updated wp.org icon and cover.
121
+
122
 
123
  = 1.9.1: 2014-09-06 =
124
  * __Last update compatible all the way back to WordPress 3.2!__
198
 
199
  = 1.0: 2012-12-13 =
200
  * Release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
styles/_variables.less ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ .border-radius( @radius ) {
2
+ -webkit-border-radius: @radius;
3
+ -moz-border-radius: @radius;
4
+ border-radius: @radius;
5
+ }
styles/backend.css ADDED
@@ -0,0 +1 @@
 
1
+ #featured-video-plus-box .fvp-current-video{background:transparent fixed no-repeat center center}#featured-video-plus-box .fvp-current-video,#featured-video-plus-box iframe{width:256px;height:auto;margin-bottom:5px}#featured-video-plus-box .fvp-hidden{display:none}#featured-video-plus-box .fvp-notice{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;margin:.5em 0;padding:.4em .6em .2em;border:1px solid gray;background-color:#fff}#featured-video-plus-box .fvp-warning{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;margin:.5em 0;padding:.4em .6em .2em;border:1px solid gray;background-color:#fff;border:1px solid #E6DB55;background-color:#FFFFE0}#featured-video-plus-box textarea{resize:none;width:100%;height:1.1em;line-height:1.1em;font-size:1em;min-height:23px}#featured-video-plus-box .fvp-input-wrapper{position:relative}#featured-video-plus-box .fvp-video{padding-right:21px}#featured-video-plus-box .fvp-media-icon{background:transparent no-repeat top left;display:block;width:15px;height:15px;position:absolute;top:4px;right:4px}
styles/backend.less ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import '_variables.less';
2
+
3
+ #featured-video-plus-box {
4
+ .fvp-current-video {
5
+ background: transparent fixed no-repeat center center;
6
+ }
7
+
8
+ .fvp-current-video,
9
+ iframe {
10
+ width: 256px;
11
+ height: auto;
12
+ margin-bottom: 5px;
13
+ }
14
+
15
+ .fvp-hidden {
16
+ display: none;
17
+ }
18
+
19
+ .fvp-notice {
20
+ .border-radius(3px);
21
+ margin: .5em 0;
22
+ padding: .4em .6em .2em;
23
+ border: 1px solid #808080;
24
+ background-color: #fff;
25
+ }
26
+
27
+ .fvp-warning {
28
+ .fvp-notice();
29
+ border: 1px solid #E6DB55;
30
+ background-color: #FFFFE0; // lightYellow
31
+ }
32
+
33
+ textarea {
34
+ resize: none;
35
+ width: 100%;
36
+ height: 1.1em;
37
+ line-height: 1.1em;
38
+ font-size: 1em;
39
+ min-height: 23px;
40
+ }
41
+
42
+ .fvp-input-wrapper {
43
+ position: relative;
44
+ }
45
+
46
+ .fvp-video {
47
+ padding-right: 21px;
48
+ }
49
+
50
+ .fvp-media-icon {
51
+ background: transparent no-repeat top left;
52
+ display: block;
53
+ width: 15px;
54
+ height: 15px;
55
+ position: absolute;
56
+ top: 4px;
57
+ right: 4px;
58
+ }
59
+ }
styles/frontend.css ADDED
@@ -0,0 +1 @@
 
1
+ .featured-video-plus.fvp-responsive .wp-video{width:auto!important;height:auto!important}.featured-video-plus.fvp-responsive .mejs-container{width:100%!important;height:auto!important;padding-top:57%}.featured-video-plus.fvp-responsive .mejs-overlay,.featured-video-plus.fvp-responsive .mejs-poster{width:100%!important;height:100%!important}.featured-video-plus.fvp-responsive .mejs-mediaelement video{position:absolute;top:0;left:0;right:0;bottom:0;width:100%!important;height:100%!important}.featured-video-plus.fvp-responsive audio{width:100%}.featured-video-plus.fvp-center{text-align:center}.featured-video-plus.fvp-center .wp-video{margin:0 auto}.featured-video-plus.fvp-right{text-align:right}.featured-video-plus.fvp-right .wp-video{margin:0 0 auto auto}.featured-video-plus.fvp-left{text-align:left}.featured-video-plus.fvp-left .wp-video{margin:0 auto auto 0}.fvp-overlay,.fvp-dynamic{position:relative;height:auto;width:auto}.fvp-overlay .fvp-loader,.fvp-dynamic .fvp-loader{background:transparent no-repeat scroll center center;position:absolute;left:50%;top:50%;z-index:10}#DOMWindow{background:transparent center center no-repeat;width:auto;height:auto;margin:auto auto;overflow:hidden}.featured-video-plus .wp-video a:not(.post-thumbnail){display:none}.no-js .featured-video-plus .wp-video a:not(.post-thumbnail){display:inline}.featured-video-plus.fvp-responsive.fvp-spotify .fluid-width-video-wrapper{padding-top:100%!important}
styles/frontend.less ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // *****************************************************************************
2
+ // Responsive videos.
3
+ .featured-video-plus.fvp-responsive {
4
+ .wp-video {
5
+ width: auto !important;
6
+ height: auto !important;
7
+ }
8
+
9
+ .mejs-container {
10
+ width: 100% !important;
11
+ height: auto !important;
12
+ padding-top: 57%;
13
+ }
14
+
15
+ .mejs-overlay, .mejs-poster {
16
+ width: 100% !important;
17
+ height: 100% !important;
18
+ }
19
+
20
+ .mejs-mediaelement video {
21
+ position: absolute;
22
+ top: 0;
23
+ left: 0;
24
+ right: 0;
25
+ bottom: 0;
26
+ width: 100% !important;
27
+ height: 100% !important;
28
+ }
29
+
30
+ audio {
31
+ width: 100%;
32
+ }
33
+ }
34
+
35
+ // *****************************************************************************
36
+ // Alignment
37
+ .featured-video-plus.fvp-center {
38
+ text-align: center;
39
+ .wp-video { margin: 0 auto; }
40
+ }
41
+
42
+ .featured-video-plus.fvp-right {
43
+ text-align: right;
44
+ .wp-video { margin: 0 0 auto auto; }
45
+ }
46
+
47
+ .featured-video-plus.fvp-left {
48
+ text-align: left;
49
+ .wp-video { margin: 0 auto auto 0; }
50
+ }
51
+
52
+ // *****************************************************************************
53
+ // Lazy mode overlay button and DOM Window
54
+ .fvp-overlay,
55
+ .fvp-dynamic {
56
+ position: relative;
57
+ height: auto;
58
+ width: auto;
59
+
60
+ .fvp-loader {
61
+ background: transparent no-repeat scroll center center;
62
+ position: absolute;
63
+ left: 50%;
64
+ top: 50%;
65
+ z-index: 10;
66
+ }
67
+ }
68
+
69
+ #DOMWindow {
70
+ background: transparent center center no-repeat;
71
+ width: auto;
72
+ height: auto;
73
+ margin: auto auto;
74
+ overflow: hidden;
75
+ }
76
+
77
+ // *****************************************************************************
78
+ // Hacks
79
+
80
+ // Hides the link displayed below local videos as generated using
81
+ // wp_mediaelement_fallback
82
+ // @see http://codex.wordpress.org/Function_Reference/wp_mediaelement_fallback
83
+ // @see https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-includes/media.php#L1917
84
+ .featured-video-plus .wp-video a:not(.post-thumbnail) {
85
+ display: none;
86
+ }
87
+
88
+ .no-js .featured-video-plus .wp-video a:not(.post-thumbnail) {
89
+ display: inline;
90
+ }
91
+
92
+ // Spotify fitvids fix.
93
+ // TODO.
94
+ .featured-video-plus.fvp-responsive.fvp-spotify .fluid-width-video-wrapper {
95
+ padding-top: 100% !important;
96
+ }
styles/html.css ADDED
@@ -0,0 +1 @@
 
1
+ body.no-js .fvphtml-tab-title{font-weight:700;display:block}body.js .fvphtml-tab-title{float:left;padding:1px 10px 2px;cursor:pointer;border-style:solid;border-color:#ccc;border-width:0;border-right-width:1px;border-bottom-width:1px}body.js .fvphtml-tab-title:hover{text-decoration:underline}body.js .fvphtml-tab-title.active{cursor:default;font-weight:700;border-bottom-width:0;padding-top:0;border-top-width:1px}body.js .fvphtml-tab-title.active:hover{text-decoration:none}.fvphtml-tab-body{clear:both;padding-top:5px}.fvphtml-label{position:relative;clear:both;display:block}.fvphtml-label .fvphtml-innerlabel{display:block;float:left;width:10em;line-height:27px}.fvphtml-label .fvphtml-reset{position:absolute;top:0;left:9em;z-index:1;line-height:27px}.fvphtml-pointer-input{width:100%}
styles/html.less ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body.no-js {
2
+ .fvphtml-tab-title {
3
+ font-weight: bold;
4
+ display: block;
5
+ }
6
+ }
7
+
8
+ body.js {
9
+ .fvphtml-tab-title {
10
+ float: left;
11
+ padding: 1px 10px 2px;
12
+ cursor: pointer;
13
+ border-style: solid;
14
+ border-color: #ccc;
15
+ border-width: 0;
16
+ border-right-width: 1px;
17
+ border-bottom-width: 1px;
18
+
19
+ &:hover {
20
+ text-decoration: underline;
21
+ }
22
+ }
23
+
24
+ .fvphtml-tab-title.active {
25
+ font-weight: bold;
26
+ cursor: default;
27
+ font-weight: bold;
28
+ border-bottom-width: 0;
29
+ padding-top: 0;
30
+ border-top-width: 1px;
31
+
32
+ &:hover {
33
+ text-decoration: none;
34
+ }
35
+ }
36
+ }
37
+
38
+ .fvphtml-tab-body {
39
+ clear: both;
40
+ padding-top: 5px;
41
+ }
42
+
43
+ .fvphtml-label {
44
+ position: relative;
45
+ clear: both;
46
+ display: block;
47
+
48
+ .fvphtml-innerlabel {
49
+ display: block;
50
+ float: left;
51
+ width: 10em;
52
+ line-height: 27px;
53
+ }
54
+
55
+ .fvphtml-reset {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 9em;
59
+ z-index: 1;
60
+ line-height: 27px;
61
+ }
62
+ }
63
+
64
+ .fvphtml-pointer-input {
65
+ width: 100%;
66
+ }
uninstall.php CHANGED
@@ -1,24 +1,34 @@
1
- <?php
2
-
3
- /**
4
- * Runs on uninstallation, deletes all data including post metadata, video screen captures and options.
5
- *
6
- * @since 1.2
7
- */
8
- if( !defined('WP_UNINSTALL_PLUGIN') ) exit();
9
-
10
- delete_option( 'fvp-settings' );
11
-
12
- $post_types = get_post_types( array("public" => true) );
13
- foreach( $post_types as $post_type )
14
- if( $post_type != 'attachment' ) {
15
- $allposts = get_posts('numberposts=-1&post_type=' . $post_type . '&post_status=any');
16
- foreach( $allposts as $post ) {
17
- $meta = get_post_meta( $post->ID, '_fvp_video', true );
18
- wp_delete_attachment( $meta['img'] );
19
- delete_post_meta($meta['img'], '_fvp_image');
20
- delete_post_meta($post->ID, '_fvp_video');
21
- }
22
- }
23
-
24
- ?>
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Runs on uninstallation, deletes all data including post metadata,
5
+ * video screen captures and options.
6
+ */
7
+ function featured_video_plus_uninstall() {
8
+ global $wpdb;
9
+
10
+ // Get posts with featured videos.
11
+ $ids = $wpdb->get_col( $wpdb->prepare(
12
+ "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key=%s",
13
+ '_fvp_video'
14
+ ) );
15
+
16
+ // For each post remove FVP data.
17
+ foreach ( $ids AS $id ) {
18
+ $meta = get_post_meta( $id, '_fvp_video', true );
19
+
20
+ if ( ! empty( $meta ) ) {
21
+ wp_delete_attachment( $meta['img'] );
22
+ delete_post_meta( $meta['img'], '_fvp_image' );
23
+ delete_post_meta( $id, '_fvp_video' );
24
+ }
25
+ }
26
+
27
+ // Delete options row.
28
+ delete_option( 'fvp-settings' );
29
+ }
30
+
31
+ // Run uninstall.
32
+ if ( defined( 'WP_UNINSTALL_PLUGIN' ) ) {
33
+ featured_video_plus_uninstall();
34
+ }