Featured Video Plus - Version 2.2.3

Version Description

Download this release

Release Info

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

Code changes from version 2.2.2 to 2.2.3

.gitignore ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ node_modules
2
+ build
3
+ *.min.js
4
+ *.css
.jshintrc ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "boss": true,
3
+ "curly": true,
4
+ "eqeqeq": true,
5
+ "eqnull": true,
6
+ "es3": true,
7
+ "expr": true,
8
+ "immed": true,
9
+ "noarg": true,
10
+ "onevar": true,
11
+ "quotmark": "single",
12
+ "trailing": true,
13
+ "undef": true,
14
+ "unused": true,
15
+
16
+ "browser": true,
17
+
18
+ "globals": {
19
+ "_": false,
20
+ "Backbone": false,
21
+ "jQuery": false,
22
+ "JSON": false,
23
+ "wp": false
24
+ }
25
+ }
CHANGELOG.md CHANGED
@@ -1,7 +1,11 @@
1
  # Changelog #
2
 
 
 
 
 
3
  ## 2.2.2: 2015-09-15 ##
4
- * Fix for not correctly hidden preload images. ([*](https://wordpress.org/support/topic/your-aplication-is-not-working-right-on-wordpress-43–es_es), [*](https://wordpress.org/support/topic/play-and-load-images-appended-to-body-since-update-to-221))
5
  * Replace features videos more reliably on AJAX requests. ([*](https://wordpress.org/support/topic/video-embedding-issue-when-using-infinite-scroll))
6
 
7
  ## 2.2.1: 2015-09-08 ##
1
  # Changelog #
2
 
3
+ ## 2.2.3: 2016-07-19 ##
4
+ * Fix for bad iframe src attributes. ([*](https://wordpress.org/support/topic/fix-for-wordpress-442-for-youtube-video-error))
5
+ * Fix a problem with image type detection. ([*](https://wordpress.org/support/topic/warning-and-no-featured-image-generated?replies=3), [*](https://wordpress.org/support/topic/plugin-is-not-supporting-by-wordpress-44))
6
+
7
  ## 2.2.2: 2015-09-15 ##
8
+ * Fix for not correctly hidden preload images. ([*](https://wordpress.org/support/topic/your-aplication-is-not-working-right-on-wordpress-43–es_es), [*](https://wordpress.org/support/topic/play-and-load-images-appended-to-body-since-update-to-221), [*](https://wordpress.org/support/topic/big-black-play-triangle-under-video))
9
  * Replace features videos more reliably on AJAX requests. ([*](https://wordpress.org/support/topic/video-embedding-issue-when-using-infinite-scroll))
10
 
11
  ## 2.2.1: 2015-09-08 ##
featured-video-plus.php CHANGED
@@ -3,14 +3,14 @@
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.2.2
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,
@@ -32,7 +32,7 @@ License: GPL2
32
  // ********************
33
  // CONSTANTS
34
  if ( ! defined( 'FVP_VERSION' ) ) {
35
- define( 'FVP_VERSION', '2.2.2' );
36
  }
37
 
38
  $pathinfo = pathinfo( dirname( plugin_basename( __FILE__ ) ) );
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.2.3
7
  Author: Alexander Höreth
8
  Author URI: http://yrnxt.com
9
  Text Domain: featured-video-plus
10
  Domain Path: /lng
11
+ License: GPL-2.0
12
 
13
+ Copyright 2009-2016 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,
32
  // ********************
33
  // CONSTANTS
34
  if ( ! defined( 'FVP_VERSION' ) ) {
35
+ define( 'FVP_VERSION', '2.2.3' );
36
  }
37
 
38
  $pathinfo = pathinfo( dirname( plugin_basename( __FILE__ ) ) );
gulpfile.js ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global require */
2
+
3
+ var gulp = require('gulp');
4
+ var less = require('gulp-less');
5
+ var uglify = require('gulp-uglify');
6
+ var rename = require('gulp-rename');
7
+ var readme = require('gulp-readme-to-markdown');
8
+ var del = require('del');
9
+ var path = require('path');
10
+ var merge = require('merge-stream');
11
+
12
+
13
+ // Return the foldername of a given file path.
14
+ function getSubdir(file) {
15
+ var dir = path.dirname(path.normalize(file));
16
+ return ('.' === dir) ? '' : dir;
17
+ }
18
+
19
+
20
+ // Run less, js and readme task and watch them for changes afterwards.
21
+ gulp.task('default', ['less', 'js', 'readme'], function() {
22
+ gulp.watch(['./js/*.js', '!./js/*.min.js'], ['js']);
23
+ gulp.watch('./styles/*.less', ['less']);
24
+ gulp.watch('./readme.txt', ['readme']);
25
+ });
26
+
27
+
28
+ // Compile and minify all *.less files in ./styles as *.css
29
+ gulp.task('less', function () {
30
+ return gulp.src(['./styles/*.less', '!**/_*.less'])
31
+ .pipe(less({
32
+ cleancss: true
33
+ }))
34
+ .pipe(gulp.dest('./styles/'));
35
+ });
36
+
37
+
38
+ // Minify all *.js files in ./js as *.min.js
39
+ gulp.task('js', function() {
40
+ return gulp.src([ './js/*.js', '!./js/*.min.js' ])
41
+ .pipe(uglify())
42
+ .pipe(rename({
43
+ suffix: '.min'
44
+ }))
45
+ .pipe(gulp.dest('./js'));
46
+ });
47
+
48
+
49
+ // Generate README.md etc from the WordPress readme.txt
50
+ gulp.task('readme', function() {
51
+ return gulp.src([ 'readme.txt' ])
52
+ .pipe(readme({
53
+ details: false,
54
+ screenshot_ext: 'jpg',
55
+ extract: {
56
+ 'Changelog': 'CHANGELOG',
57
+ 'Frequently Asked Questions': 'FAQ',
58
+ 'Screenshots': null
59
+ }
60
+ }))
61
+ .pipe(gulp.dest('.'));
62
+ });
63
+
64
+
65
+ // Copy everything needed for a SVN release to the /build directory.
66
+ gulp.task('build', ['js', 'less', 'readme'], function() {
67
+ function copy() {
68
+ var sources = [
69
+ 'img/*',
70
+ 'js/*',
71
+ 'lng/*',
72
+ 'php/*',
73
+ 'styles/*.css',
74
+ '*.php',
75
+ '*.txt',
76
+ '*.md'
77
+ ];
78
+
79
+ var streams = [], stream;
80
+ sources.forEach(function(source) {
81
+ var dir = getSubdir(source);
82
+
83
+ stream = gulp.src(source).pipe(gulp.dest('./build/' + dir));
84
+ streams.push(stream);
85
+ });
86
+
87
+ return merge(streams);
88
+ }
89
+
90
+ return del('./build', copy);
91
+ });
js/frontend.min.js CHANGED
@@ -1 +1 @@
1
- var initFeaturedVideoPlus;!function(t){"use strict";function a(){t(".has-post-video a>.featured-video-plus,.has-post-video a>.fvp-dynamic,.has-post-video a>.fvp-overlay,.has-post-video a>.wp-video,.has-post-video a>.wp-video-shortcode").unwrap(),t(".has-post-video .post-thumbnail>.post-thumbnail").removeClass("post-thumbnail"),t("a.post-thumbnail:empty").not(".fvp-dynamic, .fvp-overlay").remove()}function e(){fvpdata.fitvids&&t(".featured-video-plus.fvp-responsive").fitVids({customSelector:["iframe","object","embed"]})}function o(){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 i(a){var e=t(a),o=e.children(".fvp-actionicon");return o.css({height:e.height(),width:e.width(),margin:e.css("margin")}),o}function d(a){var e=t(a.currentTarget).children("img"),o=i(a.currentTarget);o.toggleClass("play"),e.animate(o.hasClass("play")?{opacity:fvpdata.opacity}:{opacity:1})}function n(o){o.preventDefault();var d=t(o.currentTarget),n=parseInt(d.attr("data-id"),10),r=i(o.currentTarget);r.addClass("load "+fvpdata.color),t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:n},function(t){if(t.success){var o=d.parent();d.replaceWith(t.data),o.find(".wp-audio-shortcode, .wp-video-shortcode").mediaelementplayer(),e(),a()}r.removeClass("load "+fvpdata.color)})}function r(a){a.preventDefault();var e=t(a.currentTarget),i=parseInt(e.attr("data-id"),10);e.openDOMWindow({eventType:null,windowPadding:0,borderSize:0,windowBGColor:"transparent",overlayOpacity:100*fvpdata.opacity,width:"100%",height:"100%"}),s[i]?(t("#DOMWindow").html(s[i]),o(),t(window).trigger("scroll")):t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:i},function(a){a.success&&(s[i]=a.data,t("#DOMWindow").html(a.data),o(),t(window).trigger("scroll"))})}function c(){var i=t(".featured-video-plus, .fvp-overlay, .fvp-dynamic");return i.is(p)?!1:(p=i,a(),setTimeout(a,1e3),e(),o(),t(".fvp-overlay, .fvp-dynamic").off("mouseenter").on("mouseenter",d).off("mouseleave").on("mouseleave",d),t(".fvp-dynamic").off("click").on("click",n),void t(".fvp-overlay").off("click").on("click",r))}var p,s={},v=0;initFeaturedVideoPlus=function(){0===v?(c(),v=setTimeout(function(){},100)):(clearTimeout(v),v=setTimeout(c,100))},t(document).ready(function(){window.chrome&&t(".featured-video-plus iframe").each(function(){this.src=this.src}),[fvpdata.playicon,fvpdata.loadicon].forEach(function(a){t("body").append(t("<img/>",{src:a,alt:"preload image"}).hide())})})}(jQuery);
1
+ var initFeaturedVideoPlus;!function(t){"use strict";function a(){t(".has-post-video a>.featured-video-plus,.has-post-video a>.fvp-dynamic,.has-post-video a>.fvp-overlay,.has-post-video a>.wp-video,.has-post-video a>.wp-video-shortcode").unwrap(),t(".has-post-video .post-thumbnail>.post-thumbnail").removeClass("post-thumbnail"),t("a.post-thumbnail:empty").not(".fvp-dynamic, .fvp-overlay").remove()}function e(){fvpdata.fitvids&&t(".featured-video-plus.fvp-responsive").fitVids({customSelector:["iframe","object","embed"]})}function o(){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 i(a){var e=t(a),o=e.children(".fvp-actionicon");return o.css({height:e.height(),width:e.width(),margin:e.css("margin")}),o}function d(a){var e=t(a.currentTarget).children("img"),o=i(a.currentTarget);o.toggleClass("play"),o.hasClass("play")?e.animate({opacity:fvpdata.opacity}):e.animate({opacity:1})}function n(o){o.preventDefault();var d=t(o.currentTarget),n=parseInt(d.attr("data-id"),10),r=i(o.currentTarget);r.addClass("load "+fvpdata.color),t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:n},function(t){if(t.success){var o=d.parent();d.replaceWith(t.data),o.find(".wp-audio-shortcode, .wp-video-shortcode").mediaelementplayer(),e(),a()}r.removeClass("load "+fvpdata.color)})}function r(a){a.preventDefault();var e=t(a.currentTarget),i=parseInt(e.attr("data-id"),10);e.openDOMWindow({eventType:null,windowPadding:0,borderSize:0,windowBGColor:"transparent",overlayOpacity:100*fvpdata.opacity,width:"100%",height:"100%"}),s[i]?(t("#DOMWindow").html(s[i]),o(),t(window).trigger("scroll")):t.post(fvpdata.ajaxurl,{action:"fvp_get_embed",fvp_nonce:fvpdata.nonce,id:i},function(a){a.success&&(s[i]=a.data,t("#DOMWindow").html(a.data),o(),t(window).trigger("scroll"))})}function c(){var i=t(".featured-video-plus, .fvp-overlay, .fvp-dynamic");return!i.is(p)&&(p=i,a(),setTimeout(a,1e3),e(),o(),t(".fvp-overlay, .fvp-dynamic").off("mouseenter").on("mouseenter",d).off("mouseleave").on("mouseleave",d),t(".fvp-dynamic").off("click").on("click",n),void t(".fvp-overlay").off("click").on("click",r))}var p,s={},v=0;initFeaturedVideoPlus=function(){0===v?(c(),v=setTimeout(function(){},100)):(clearTimeout(v),v=setTimeout(c,100))},t(document).ready(function(){window.chrome&&t(".featured-video-plus iframe").each(function(){this.src=this.src}),[fvpdata.playicon,fvpdata.loadicon].forEach(function(a){t("body").append(t("<img/>",{src:a,alt:"preload image"}).hide())})})}(jQuery);
js/html.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){"use strict";var i=function(){var i=t(this),e=i.siblings("[data-hook='"+i.data("hook")+"']");i.hasClass("active")&&e.hasClass("active")||(i.siblings(fvphtml.prefix+"tab-title").removeClass("active"),i.siblings(fvphtml.prefix+"tab-body").slideUp(),i.addClass("active"),e.addClass("active").slideDown())};t(document).ready(function(){for(var e=t(fvphtml.prefix+"tabs"),r=e.length-1;r>=0;r--){var n=t(e[r]),a=n.children(fvphtml.prefix+"tab-title"),s=n.children(fvphtml.prefix+"tab-body");a.first().addClass("active"),s.first().addClass("active"),n.prepend(a),s.filter(":not(.active)").hide(),n.children(fvphtml.prefix+"tab-title").click(i)}})}(jQuery),function(t){"use strict";var i={},e=function(){for(var e=t(this),r=i[e.attr("name")],n=0;n<r.length;n++){var a=t(r[n]),s=a.data("names").split("|"),l=(""+a.data("values")).split("|"),o=t.inArray(e.attr("name"),s);if(-1!==o){var c=!0,f=l[o],h="checkbox"!==e.attr("type")||e.prop("checked")?e.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")}}};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("|"),l=0;l<s.length;l++){var o=s[l];i.hasOwnProperty(o)||(i[o]=[]),i[o].push(a)}for(var c in i){var f=t("[name='"+c+"']");f.change(e)}})}(jQuery),function(t){"use strict";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}var r,n=function(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()},a=function(){var i=t(this);r.not(i).iris("hide"),i.iris("show")},s=function(i){i&&i.preventDefault();var e=t(this);""===e.val()&&e.siblings(fvphtml.prefix+"reset").hide()},l=function(i){i&&i.preventDefault(),r.iris("hide"),t(this).siblings(fvphtml.prefix+"colorpicker").val("").each(n)};t(document).ready(function(){r=t(fvphtml.prefix+"colorpicker"),r.iris({change:n}),r.bind("input",n),r.click(a),r.blur(s),r.siblings(fvphtml.prefix+"reset").click(l),r.each(n)})}(jQuery),function(t){"use strict";function i(i){var r=i.title||"",n=i.content||"",a=i.position||{edge:"right",align:"middle"};t(i.target).pointer({pointer_id:i.identifier,content:"<h3>"+r+"</h3><p>"+n+"</p>",position:a,close:e}).pointer("open")}var e=function(){var i=t(this).data("wpPointer").options.pointer_id;t.post(ajaxurl,{pointer:i,action:"dismiss-wp-pointer"})};t(document).ready(function(){for(var t=fvphtml.pointers||[],e=0;e<t.length;e++)i(fvphtml.pointers[e])})}(jQuery),jQuery(document).ready(function(t){"use strict";t(fvphtml.prefix+"help-link, .help-link").click(function(){t("#contextual-help-link").trigger("click")})});
1
+ !function(t){"use strict";var i=function(){var i=t(this),e=i.siblings("[data-hook='"+i.data("hook")+"']");i.hasClass("active")&&e.hasClass("active")||(i.siblings(fvphtml.prefix+"tab-title").removeClass("active"),i.siblings(fvphtml.prefix+"tab-body").slideUp(),i.addClass("active"),e.addClass("active").slideDown())};t(document).ready(function(){for(var e=t(fvphtml.prefix+"tabs"),r=e.length-1;r>=0;r--){var n=t(e[r]),a=n.children(fvphtml.prefix+"tab-title"),s=n.children(fvphtml.prefix+"tab-body");a.first().addClass("active"),s.first().addClass("active"),n.prepend(a),s.filter(":not(.active)").hide(),n.children(fvphtml.prefix+"tab-title").click(i)}})}(jQuery),function(t){"use strict";var i={},e=function(){for(var e=t(this),r=i[e.attr("name")],n=0;n<r.length;n++){var a=t(r[n]),s=a.data("names").split("|"),l=(""+a.data("values")).split("|"),o=t.inArray(e.attr("name"),s);if(-1!==o){var c=!0,f=l[o],h="checkbox"!==e.attr("type")||e.prop("checked")?e.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")}}};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("|"),l=0;l<s.length;l++){var o=s[l];i.hasOwnProperty(o)||(i[o]=[]),i[o].push(a)}for(var c in i){var f=t("[name='"+c+"']");f.change(e)}})}(jQuery),function(t){"use strict";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}var r,n=function(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()},a=function(){var i=t(this);r.not(i).iris("hide"),i.iris("show")},s=function(i){i&&i.preventDefault();var e=t(this);""===e.val()&&e.siblings(fvphtml.prefix+"reset").hide()},l=function(i){i&&i.preventDefault(),r.iris("hide"),t(this).siblings(fvphtml.prefix+"colorpicker").val("").each(n)};t(document).ready(function(){r=t(fvphtml.prefix+"colorpicker"),r.iris({change:n}),r.bind("input",n),r.click(a),r.blur(s),r.siblings(fvphtml.prefix+"reset").click(l),r.each(n)})}(jQuery),function(t){"use strict";function i(i){var r=i.title||"",n=i.content||"",a=i.position||{edge:"right",align:"middle"};t(i.target).pointer({pointer_id:i.identifier,content:"<h3>"+r+"</h3><p>"+n+"</p>",position:a,close:e}).pointer("open")}var e=function(){var i=t(this).data("wpPointer").options.pointer_id;t.post(ajaxurl,{pointer:i,action:"dismiss-wp-pointer"})};t(document).ready(function(){for(var t=fvphtml.pointers||[],e=0;e<t.length;e++)i(fvphtml.pointers[e])})}(jQuery),jQuery(document).ready(function(t){"use strict";t(fvphtml.prefix+"help-link, .help-link").click(function(){t("#contextual-help-link").trigger("click")})});
js/jquery.autosize.min.js CHANGED
@@ -1 +1 @@
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);
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"):e<p&&(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.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){e.fn.closeDOMWindow=function(o){o||(o={});var n=function(n){if(o.anchoredClassName){var i=e("."+o.anchoredClassName);i.fadeOut("fast",function(){e.fn.draggable?i.draggable("destory").trigger("unload").remove():i.trigger("unload").remove()}),o.functionCallOnClose&&o.functionCallAfterClose()}else{var t=e("#DOMWindowOverlay"),d=e("#DOMWindow");t.fadeOut("fast",function(){t.trigger("unload").unbind().remove()}),d.fadeOut("fast",function(){e.fn.draggable?d.draggable("destroy").trigger("unload").remove():d.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(i){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(o){e(this).bind(i.eventType,function(){return f(this),!1})}):void f()},e.openDOMWindow=function(o){e.fn.openDOMWindow(o)}}(jQuery);
1
+ !function(e){e.fn.closeDOMWindow=function(o){o||(o={});var n=function(n){if(o.anchoredClassName){var i=e("."+o.anchoredClassName);i.fadeOut("fast",function(){e.fn.draggable?i.draggable("destory").trigger("unload").remove():i.trigger("unload").remove()}),o.functionCallOnClose&&o.functionCallAfterClose()}else{var t=e("#DOMWindowOverlay"),d=e("#DOMWindow");t.fadeOut("fast",function(){t.trigger("unload").unbind().remove()}),d.fadeOut("fast",function(){e.fn.draggable?d.draggable("destroy").trigger("unload").remove():d.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(i){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?(i.windowSourceURL.indexOf("?")!==-1?(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)})):(i.windowSourceURL.indexOf("?")==-1&&(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?(i.windowSourceURL.indexOf("?")!==-1?(f=i.windowSourceURL.substr(0,i.windowSourceURL.indexOf("?")),w=s(i.windowSourceURL)):(f=i.windowSourceURL,w={}),g.load(f,w,function(){c()})):(i.windowSourceURL.indexOf("?")==-1&&(i.windowSourceURL+="?"),g.load(i.windowSourceURL+"&random="+(new Date).getTime(),function(){c()}))}}};return i.eventType?this.each(function(o){e(this).bind(i.eventType,function(){return f(this),!1})}):void f()},e.openDOMWindow=function(o){e.fn.openDOMWindow(o)}}(jQuery);
package.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "featured-video-plus",
3
+ "version": "2.2.3",
4
+ "description": "A WordPress plugin adding featured image like functionality for videos.",
5
+ "homepage": "http://yrnxt.com/wordpress/featured-video-plus",
6
+ "main": "featured-video-plus.php",
7
+ "author": "Alexander Höreth",
8
+ "license": "GPL-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/ahoereth/featured-video-plus.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/ahoereth/featured-video-plus/issues"
15
+ },
16
+ "scripts": {
17
+ "start": "gulp",
18
+ "build": "gulp build"
19
+ },
20
+ "devDependencies": {
21
+ "del": "2.2.x",
22
+ "gulp": "3.9.x",
23
+ "gulp-less": "3.1.x",
24
+ "gulp-readme-to-markdown": "0.2.x",
25
+ "gulp-rename": "1.2.x",
26
+ "gulp-uglify": "1.5.x",
27
+ "merge-stream": "1.0.x"
28
+ }
29
+ }
php/class-backend.php CHANGED
@@ -772,14 +772,13 @@ class FVP_Backend extends Featured_Video_Plus {
772
  */
773
  private static function get_image_type( $filename ) {
774
  if ( function_exists( 'exif_imagetype' ) ) {
775
- return exif_imagetype( $filename );
776
  } else {
777
  $img = getimagesize( $filename );
778
- if ( !empty( $img[2] ) ) {
779
- return image_type_to_mime_type( $img[2] );
780
- }
781
  }
782
- return false;
 
783
  }
784
 
785
 
772
  */
773
  private static function get_image_type( $filename ) {
774
  if ( function_exists( 'exif_imagetype' ) ) {
775
+ $type = exif_imagetype( $filename );
776
  } else {
777
  $img = getimagesize( $filename );
778
+ $type = $img[2];
 
 
779
  }
780
+
781
+ return ! empty( $type ) ? $type : false;
782
  }
783
 
784
 
php/class-oembed.php CHANGED
@@ -97,7 +97,7 @@ class FVP_oEmbed {
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
  }
@@ -118,7 +118,8 @@ class FVP_oEmbed {
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
  }
@@ -127,6 +128,21 @@ class FVP_oEmbed {
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.
@@ -224,6 +240,8 @@ class FVP_oEmbed {
224
  return $this->oembed->get_provider( $url, $args );
225
  }
226
 
 
 
227
  $provider = false;
228
  if ( ! isset( $args['discover'] ) ) {
229
  $args['discover'] = true;
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
  }
118
  $pattern = "/src=([\"'])([^\"']*)[\"']/";
119
  preg_match( $pattern, $html, $match );
120
  if ( ! empty( $match[1] ) && ! empty( $match[2] ) ) {
121
+ $code = $this->clean_url( $match[2] );
122
+ $replace = sprintf( 'src=$1%s$1', add_query_arg( $args, $code ) );
123
  $html = preg_replace( $pattern, $replace, $html );
124
  }
125
  }
128
  }
129
 
130
 
131
+ /**
132
+ * Cleans up ? and & in urls such that before all & there is a single ?
133
+ * with none following.
134
+ *
135
+ * @see wordpress.org/support/topic/fix-for-wordpress-442-for-youtube-video-error
136
+ *
137
+ * @param {string} $urls
138
+ * @return {string}
139
+ */
140
+ public function clean_url($url) {
141
+ $url = preg_replace( '/\?/', '&', $url, 1);
142
+ return preg_replace( '/&/', '?', $url, 1);
143
+ }
144
+
145
+
146
  /**
147
  * Enable additional parameters for oEmbed requests from inside the plugin.
148
  * The plugin only allows a limited set of parameters.
240
  return $this->oembed->get_provider( $url, $args );
241
  }
242
 
243
+ $args = wp_parse_args( $args );
244
+
245
  $provider = false;
246
  if ( ! isset( $args['discover'] ) ) {
247
  $args['discover'] = true;
readme.txt CHANGED
@@ -6,11 +6,11 @@ Tags: featured, post, video, videos, image, thumbnail, html5, flash, lazy, overl
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.3
13
- Stable tag: 2.2.2
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
 
@@ -107,8 +107,12 @@ Yes, please! Check out the public [Featured Video Plus Translation Project](http
107
 
108
  == Changelog ==
109
 
 
 
 
 
110
  = 2.2.2: 2015-09-15 =
111
- * Fix for not correctly hidden preload images. ([*](https://wordpress.org/support/topic/your-aplication-is-not-working-right-on-wordpress-43–es_es), [*](https://wordpress.org/support/topic/play-and-load-images-appended-to-body-since-update-to-221))
112
  * Replace features videos more reliably on AJAX requests. ([*](https://wordpress.org/support/topic/video-embedding-issue-when-using-infinite-scroll))
113
 
114
  = 2.2.1: 2015-09-08 =
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: GPL-2.0
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  Requires at least: 3.7
12
+ Tested up to: 4.5
13
+ Stable tag: 2.2.3
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
 
107
 
108
  == Changelog ==
109
 
110
+ = 2.2.3: 2016-07-19 =
111
+ * Fix for bad iframe src attributes. ([*](https://wordpress.org/support/topic/fix-for-wordpress-442-for-youtube-video-error))
112
+ * Fix a problem with image type detection. ([*](https://wordpress.org/support/topic/warning-and-no-featured-image-generated?replies=3), [*](https://wordpress.org/support/topic/plugin-is-not-supporting-by-wordpress-44))
113
+
114
  = 2.2.2: 2015-09-15 =
115
+ * Fix for not correctly hidden preload images. ([*](https://wordpress.org/support/topic/your-aplication-is-not-working-right-on-wordpress-43–es_es), [*](https://wordpress.org/support/topic/play-and-load-images-appended-to-body-since-update-to-221), [*](https://wordpress.org/support/topic/big-black-play-triangle-under-video))
116
  * Replace features videos more reliably on AJAX requests. ([*](https://wordpress.org/support/topic/video-embedding-issue-when-using-infinite-scroll))
117
 
118
  = 2.2.1: 2015-09-08 =
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.less ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ .fvp-current-video iframe,
10
+ .fvp-current-video video {
11
+ width: 256px;
12
+ height: auto;
13
+ margin-bottom: 5px;
14
+ }
15
+
16
+ .fvp-hidden {
17
+ display: none;
18
+ }
19
+
20
+ .fvp-notice {
21
+ .border-radius(3px);
22
+ margin: .5em 0;
23
+ padding: .4em .6em .2em;
24
+ border: 1px solid #808080;
25
+ background-color: #fff;
26
+ }
27
+
28
+ .fvp-warning {
29
+ .fvp-notice();
30
+ border: 1px solid #E6DB55;
31
+ background-color: #FFFFE0; // lightYellow
32
+ }
33
+
34
+ textarea {
35
+ resize: none;
36
+ width: 100%;
37
+ height: 1.1em;
38
+ line-height: 1.1em;
39
+ font-size: 1em;
40
+ min-height: 23px;
41
+ }
42
+
43
+ .fvp-input-wrapper {
44
+ position: relative;
45
+ }
46
+
47
+ .fvp-video {
48
+ padding-right: 21px;
49
+ }
50
+
51
+ .fvp-media-icon {
52
+ background: transparent no-repeat top left;
53
+ display: block;
54
+ width: 15px;
55
+ height: 15px;
56
+ position: absolute;
57
+ top: 4px;
58
+ right: 4px;
59
+ }
60
+ }
styles/frontend.less ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // *****************************************************************************
2
+ // Responsive videos.
3
+ .featured-video-plus.fvp-responsive {
4
+ .wp-video {
5
+ width: auto !important;
6
+ height: auto !important;
7
+
8
+ video {
9
+ width: 100% !important;
10
+ height: auto !important;
11
+ }
12
+ }
13
+
14
+ // Backcompat-Code
15
+ .mejs-container {
16
+ width: 100% !important;
17
+ height: auto !important;
18
+ padding-top: 57%;
19
+ }
20
+ .mejs-overlay, .mejs-poster {
21
+ width: 100% !important;
22
+ height: 100% !important;
23
+ }
24
+
25
+ .mejs-mediaelement video {
26
+ position: absolute;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ bottom: 0;
31
+ width: 100% !important;
32
+ height: 100% !important;
33
+ }
34
+ // End Backcompat-Code.
35
+
36
+ audio {
37
+ width: 100%;
38
+ }
39
+ }
40
+
41
+ // *****************************************************************************
42
+ // Alignment
43
+ .featured-video-plus.fvp-center {
44
+ text-align: center;
45
+ .wp-video { margin: 0 auto; }
46
+ }
47
+
48
+ .featured-video-plus.fvp-right {
49
+ text-align: right;
50
+ .wp-video { margin: 0 0 auto auto; }
51
+ }
52
+
53
+ .featured-video-plus.fvp-left {
54
+ text-align: left;
55
+ .wp-video { margin: 0 auto auto 0; }
56
+ }
57
+
58
+ // *****************************************************************************
59
+ // Lazy mode overlay button and DOM Window
60
+ .fvp-overlay,
61
+ .fvp-dynamic {
62
+ position: relative;
63
+ display: block;
64
+ height: auto;
65
+ width: auto;
66
+
67
+ .fvp-actionicon {
68
+ background: transparent no-repeat scroll center center;
69
+ position: absolute;
70
+ top: 0;
71
+ left: 0;
72
+ z-index: 999;
73
+ pointer-events: none;
74
+ display: none;
75
+
76
+ &.play {
77
+ display: block;
78
+ background-image: url('../img/playicon.png');
79
+ }
80
+
81
+ &.load {
82
+ display: block;
83
+ &.w { background-image: url('../img/loadicon_w.gif'); }
84
+ &.b { background-image: url('../img/loadicon_b.gif'); }
85
+ }
86
+ }
87
+ }
88
+
89
+ #DOMWindow {
90
+ background: transparent center center no-repeat;
91
+ width: auto;
92
+ height: auto;
93
+ margin: auto auto;
94
+ overflow: hidden;
95
+ background-image: url('../img/loadicon_w.gif');
96
+ }
97
+
98
+ .fvp-onload {
99
+ display: none !important;
100
+ height: 0;
101
+ width: 0;
102
+ visibility: hidden;
103
+ }
104
+
105
+
106
+ // *****************************************************************************
107
+ // Hacks
108
+
109
+ // Hides the link displayed below local videos as generated using
110
+ // wp_mediaelement_fallback
111
+ // @see http://codex.wordpress.org/Function_Reference/wp_mediaelement_fallback
112
+ // @see https://core.trac.wordpress.org/browser/tags/4.2.2/src/wp-includes/media.php#L1917
113
+ .featured-video-plus .wp-video a:not(.post-thumbnail) {
114
+ display: none;
115
+ }
116
+
117
+ .no-js .featured-video-plus .wp-video a:not(.post-thumbnail) {
118
+ display: inline;
119
+ }
120
+
121
+ // Spotify fitvids fix.
122
+ // TODO.
123
+ .featured-video-plus.fvp-responsive.fvp-spotify .fluid-width-video-wrapper {
124
+ padding-top: 100% !important;
125
+ }
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
+ }