first commit
This commit is contained in:
1
wp-content/plugins/kingcomposer/assets/frontend/js/counter.up.min.js
vendored
Normal file
1
wp-content/plugins/kingcomposer/assets/frontend/js/counter.up.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){"L Q";$.M.z=7(n){4 o=$.W({\'s\':T,\'8\':10},n);H y.I(7(){4 k=$(y);4 l=o;4 m=7(){4 a=[];4 b=l.s/l.8;4 c=k.u();4 d=/[0-9]+,[0-9]+/.r(c);c=c.w(/,/g,\'\');4 e=/^[0-9]+$/.r(c);4 g=/^[0-9]+\\.[0-9]+$/.r(c);4 h=g?(c.K(\'.\')[1]||[]).x:0;P(4 i=b;i>=1;i--){4 j=Z(c/b*i);t(g){j=E(c/b*i).F(h)}t(d){G(/(\\d+)(\\d{3})/.r(j.v())){j=j.v().w(/(\\d+)(\\d{3})/,\'$1\'+\',\'+\'$2\')}}a.J(j)}k.6(\'5-p\',a);k.u(\'0\');4 f=7(){k.u(k.6(\'5-p\').O());t(k.6(\'5-p\').x){A(k.6(\'5-q\'),l.8)}R{S k.6(\'5-p\');k.6(\'5-p\',B);k.6(\'5-q\',B)}};k.6(\'5-q\',f);A(k.6(\'5-q\'),l.8)};k.U(m,{V:\'C%\',X:Y})})}})(D);D(11).12(7($){$(\'.5\').z({8:C,s:N})});',62,65,'||||var|counterup|data|function|delay|||||||||||||||||nums|func|test|time|if|text|toString|replace|length|this|counterUp|setTimeout|null|100|jQuery|parseFloat|toFixed|while|return|each|unshift|split|use|fn|2000|shift|for|strict|else|delete|400|waypoint|offset|extend|triggerOnce|true|parseInt||document|ready'.split('|'),0,{}))
|
||||
@@ -0,0 +1,364 @@
|
||||
/**!
|
||||
* easy-pie-chart
|
||||
* Lightweight plugin to render simple, animated and retina optimized pie charts
|
||||
*
|
||||
* @license
|
||||
* @author Robert Fleischmann <rendro87@gmail.com> (http://robert-fleischmann.de)
|
||||
* @version 2.1.7
|
||||
**/
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define(["jquery"], function (a0) {
|
||||
return (factory(a0));
|
||||
});
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require("jquery"));
|
||||
} else {
|
||||
factory(jQuery);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
/**
|
||||
* Renderer to render the chart on a canvas object
|
||||
* @param {DOMElement} el DOM element to host the canvas (root of the plugin)
|
||||
* @param {object} options options object of the plugin
|
||||
*/
|
||||
var CanvasRenderer = function(el, options) {
|
||||
var cachedBackground;
|
||||
var canvas = document.createElement('canvas');
|
||||
|
||||
el.appendChild(canvas);
|
||||
|
||||
if (typeof(G_vmlCanvasManager) === 'object') {
|
||||
G_vmlCanvasManager.initElement(canvas);
|
||||
}
|
||||
|
||||
var ctx = canvas.getContext('2d');
|
||||
|
||||
canvas.width = canvas.height = options.size;
|
||||
|
||||
// canvas on retina devices
|
||||
var scaleBy = 1;
|
||||
if (window.devicePixelRatio > 1) {
|
||||
scaleBy = window.devicePixelRatio;
|
||||
canvas.style.width = canvas.style.height = [options.size, 'px'].join('');
|
||||
canvas.width = canvas.height = options.size * scaleBy;
|
||||
ctx.scale(scaleBy, scaleBy);
|
||||
}
|
||||
|
||||
// move 0,0 coordinates to the center
|
||||
ctx.translate(options.size / 2, options.size / 2);
|
||||
|
||||
// rotate canvas -90deg
|
||||
ctx.rotate((-1 / 2 + options.rotate / 180) * Math.PI);
|
||||
|
||||
var radius = (options.size - options.lineWidth) / 2;
|
||||
if (options.scaleColor && options.scaleLength) {
|
||||
radius -= options.scaleLength + 2; // 2 is the distance between scale and bar
|
||||
}
|
||||
|
||||
// IE polyfill for Date
|
||||
Date.now = Date.now || function() {
|
||||
return +(new Date());
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw a circle around the center of the canvas
|
||||
* @param {strong} color Valid CSS color string
|
||||
* @param {number} lineWidth Width of the line in px
|
||||
* @param {number} percent Percentage to draw (float between -1 and 1)
|
||||
*/
|
||||
var drawCircle = function(color, lineWidth, percent) {
|
||||
percent = Math.min(Math.max(-1, percent || 0), 1);
|
||||
var isNegative = percent <= 0 ? true : false;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(0, 0, radius, 0, Math.PI * 2 * percent, isNegative);
|
||||
|
||||
ctx.strokeStyle = color;
|
||||
ctx.lineWidth = lineWidth;
|
||||
|
||||
ctx.stroke();
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the scale of the chart
|
||||
*/
|
||||
var drawScale = function() {
|
||||
var offset;
|
||||
var length;
|
||||
|
||||
ctx.lineWidth = 1;
|
||||
ctx.fillStyle = options.scaleColor;
|
||||
|
||||
ctx.save();
|
||||
for (var i = 24; i > 0; --i) {
|
||||
if (i % 6 === 0) {
|
||||
length = options.scaleLength;
|
||||
offset = 0;
|
||||
} else {
|
||||
length = options.scaleLength * 0.6;
|
||||
offset = options.scaleLength - length;
|
||||
}
|
||||
ctx.fillRect(-options.size/2 + offset, 0, length, 1);
|
||||
ctx.rotate(Math.PI / 12);
|
||||
}
|
||||
ctx.restore();
|
||||
};
|
||||
|
||||
/**
|
||||
* Request animation frame wrapper with polyfill
|
||||
* @return {function} Request animation frame method or timeout fallback
|
||||
*/
|
||||
var reqAnimationFrame = (function() {
|
||||
return window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
window.setTimeout(callback, 1000 / 60);
|
||||
};
|
||||
}());
|
||||
|
||||
/**
|
||||
* Draw the background of the plugin including the scale and the track
|
||||
*/
|
||||
var drawBackground = function() {
|
||||
if(options.scaleColor) drawScale();
|
||||
if(options.trackColor) drawCircle(options.trackColor, options.trackWidth || options.lineWidth, 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Canvas accessor
|
||||
*/
|
||||
this.getCanvas = function() {
|
||||
return canvas;
|
||||
};
|
||||
|
||||
/**
|
||||
* Canvas 2D context 'ctx' accessor
|
||||
*/
|
||||
this.getCtx = function() {
|
||||
return ctx;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear the complete canvas
|
||||
*/
|
||||
this.clear = function() {
|
||||
ctx.clearRect(options.size / -2, options.size / -2, options.size, options.size);
|
||||
};
|
||||
|
||||
/**
|
||||
* Draw the complete chart
|
||||
* @param {number} percent Percent shown by the chart between -100 and 100
|
||||
*/
|
||||
this.draw = function(percent) {
|
||||
// do we need to render a background
|
||||
if (!!options.scaleColor || !!options.trackColor) {
|
||||
// getImageData and putImageData are supported
|
||||
if (ctx.getImageData && ctx.putImageData) {
|
||||
if (!cachedBackground) {
|
||||
drawBackground();
|
||||
cachedBackground = ctx.getImageData(0, 0, options.size * scaleBy, options.size * scaleBy);
|
||||
} else {
|
||||
ctx.putImageData(cachedBackground, 0, 0);
|
||||
}
|
||||
} else {
|
||||
this.clear();
|
||||
drawBackground();
|
||||
}
|
||||
} else {
|
||||
this.clear();
|
||||
}
|
||||
|
||||
ctx.lineCap = options.lineCap;
|
||||
|
||||
// if barcolor is a function execute it and pass the percent as a value
|
||||
var color;
|
||||
if (typeof(options.barColor) === 'function') {
|
||||
color = options.barColor(percent);
|
||||
} else {
|
||||
color = options.barColor;
|
||||
}
|
||||
|
||||
// draw bar
|
||||
drawCircle(color, options.lineWidth, percent / 100);
|
||||
}.bind(this);
|
||||
|
||||
/**
|
||||
* Animate from some percent to some other percentage
|
||||
* @param {number} from Starting percentage
|
||||
* @param {number} to Final percentage
|
||||
*/
|
||||
this.animate = function(from, to) {
|
||||
var startTime = Date.now();
|
||||
options.onStart(from, to);
|
||||
var animation = function() {
|
||||
var process = Math.min(Date.now() - startTime, options.animate.duration);
|
||||
var currentValue = options.easing(this, process, from, to - from, options.animate.duration);
|
||||
this.draw(currentValue);
|
||||
options.onStep(from, to, currentValue);
|
||||
if (process >= options.animate.duration) {
|
||||
options.onStop(from, to);
|
||||
} else {
|
||||
reqAnimationFrame(animation);
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
reqAnimationFrame(animation);
|
||||
}.bind(this);
|
||||
};
|
||||
|
||||
var EasyPieChart = function(el, opts) {
|
||||
var defaultOptions = {
|
||||
barColor: '#CA4FBD',
|
||||
trackColor: '#003D72',
|
||||
scaleColor: '#dfe0e0',
|
||||
scaleLength: 1,
|
||||
lineCap: 'round',
|
||||
lineWidth: 10,
|
||||
trackWidth: undefined,
|
||||
size: 110,
|
||||
rotate: 0,
|
||||
animate: {
|
||||
duration: 1000,
|
||||
enabled: true
|
||||
},
|
||||
easing: function (x, t, b, c, d) { // more can be found here: http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
t = t / (d/2);
|
||||
if (t < 1) {
|
||||
return c / 2 * t * t + b;
|
||||
}
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
onStart: function(from, to) {
|
||||
return;
|
||||
},
|
||||
onStep: function(from, to, currentValue) {
|
||||
return;
|
||||
},
|
||||
onStop: function(from, to) {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
// detect present renderer
|
||||
if (typeof(CanvasRenderer) !== 'undefined') {
|
||||
defaultOptions.renderer = CanvasRenderer;
|
||||
} else if (typeof(SVGRenderer) !== 'undefined') {
|
||||
defaultOptions.renderer = SVGRenderer;
|
||||
} else {
|
||||
throw new Error('Please load either the SVG- or the CanvasRenderer');
|
||||
}
|
||||
|
||||
var options = {};
|
||||
var currentValue = 0;
|
||||
|
||||
/**
|
||||
* Initialize the plugin by creating the options object and initialize rendering
|
||||
*/
|
||||
var init = function() {
|
||||
this.el = el;
|
||||
this.options = options;
|
||||
|
||||
// merge user options into default options
|
||||
for (var i in defaultOptions) {
|
||||
if (defaultOptions.hasOwnProperty(i)) {
|
||||
options[i] = opts && typeof(opts[i]) !== 'undefined' ? opts[i] : defaultOptions[i];
|
||||
if (typeof(options[i]) === 'function') {
|
||||
options[i] = options[i].bind(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check for jQuery easing
|
||||
if (typeof(options.easing) === 'string' && typeof(jQuery) !== 'undefined' && jQuery.isFunction(jQuery.easing[options.easing])) {
|
||||
options.easing = jQuery.easing[options.easing];
|
||||
} else {
|
||||
options.easing = defaultOptions.easing;
|
||||
}
|
||||
|
||||
// process earlier animate option to avoid bc breaks
|
||||
if (typeof(options.animate) === 'number') {
|
||||
options.animate = {
|
||||
duration: options.animate,
|
||||
enabled: true
|
||||
};
|
||||
}
|
||||
|
||||
if (typeof(options.animate) === 'boolean' && !options.animate) {
|
||||
options.animate = {
|
||||
duration: 1000,
|
||||
enabled: options.animate
|
||||
};
|
||||
}
|
||||
|
||||
// create renderer
|
||||
this.renderer = new options.renderer(el, options);
|
||||
|
||||
// initial draw
|
||||
this.renderer.draw(currentValue);
|
||||
|
||||
// initial update
|
||||
if (el.dataset && el.dataset.percent) {
|
||||
this.update(parseFloat(el.dataset.percent));
|
||||
} else if (el.getAttribute && el.getAttribute('data-percent')) {
|
||||
this.update(parseFloat(el.getAttribute('data-percent')));
|
||||
}
|
||||
}.bind(this);
|
||||
|
||||
/**
|
||||
* Update the value of the chart
|
||||
* @param {number} newValue Number between 0 and 100
|
||||
* @return {object} Instance of the plugin for method chaining
|
||||
*/
|
||||
this.update = function(newValue) {
|
||||
newValue = parseFloat(newValue);
|
||||
if (options.animate.enabled) {
|
||||
this.renderer.animate(currentValue, newValue);
|
||||
} else {
|
||||
this.renderer.draw(newValue);
|
||||
}
|
||||
currentValue = newValue;
|
||||
return this;
|
||||
}.bind(this);
|
||||
|
||||
/**
|
||||
* Disable animation
|
||||
* @return {object} Instance of the plugin for method chaining
|
||||
*/
|
||||
this.disableAnimation = function() {
|
||||
options.animate.enabled = false;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Enable animation
|
||||
* @return {object} Instance of the plugin for method chaining
|
||||
*/
|
||||
this.enableAnimation = function() {
|
||||
options.animate.enabled = true;
|
||||
return this;
|
||||
};
|
||||
|
||||
init();
|
||||
};
|
||||
|
||||
$.fn.easyPieChart = function(options) {
|
||||
return this.each(function() {
|
||||
var instanceOptions;
|
||||
|
||||
if (!$.data(this, 'easyPieChart')) {
|
||||
instanceOptions = $.extend({}, options, $(this).data());
|
||||
$.data(this, 'easyPieChart', new EasyPieChart(this, instanceOptions));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
}));
|
||||
1
wp-content/plugins/kingcomposer/assets/frontend/js/easypie.chart.min.js
vendored
Normal file
1
wp-content/plugins/kingcomposer/assets/frontend/js/easypie.chart.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(4(b,c){7(y W===\'4\'&&W.1A){W(["1n"],4(a){9(c(a))})}w 7(y 1o===\'1k\'){1K.1o=c(1Q("1n"))}w{c(J)}}(3,4($){5 s=4(g,h){5 j;5 k=1R.1Y(\'2g\');g.2l(k);7(y(1p)===\'1k\'){1p.1r(k)}5 l=k.1C(\'2d\');k.Z=k.14=h.v;5 m=1;7(H.1c>1){m=H.1c;k.1b.Z=k.1b.14=[h.v,\'1u\'].1w(\'\');k.Z=k.14=h.v*m;l.1y(m,m)}l.1z(h.v/2,h.v/2);l.T((-1/2+h.T/1H)*B.17);5 n=(h.v-h.E)/2;7(h.I&&h.F){n-=h.F+2}K.N=K.N||4(){9+(O K())};5 o=4(a,b,c){c=B.19(B.1x(-1,c||0),1);5 d=c<=0?P:1m;l.1D();l.1E(0,0,n,0,B.17*2*c,d);l.1F=a;l.E=b;l.1G()};5 p=4(){5 a;5 b;l.E=1;l.1I=h.I;l.1J();1l(5 i=24;i>0;--i){7(i%6===0){b=h.F;a=0}w{b=h.F*0.6;a=h.F-b}l.2n(-h.v/2+a,0,b,1);l.T(B.17/12)}l.1S()};5 q=(4(){9 H.2b||H.2c||H.2e||4(a){H.2f(a,X/2h)}}());5 r=4(){7(h.I)p();7(h.R)o(h.R,h.1g||h.E,1)};3.1s=4(){9 k};3.1t=4(){9 l};3.11=4(){l.1v(h.v/-2,h.v/-2,h.v,h.v)};3.S=4(a){7(!!h.I||!!h.R){7(l.1f&&l.1a){7(!j){r();j=l.1f(0,0,h.v*m,h.v*m)}w{l.1a(j,0,0)}}w{3.11();r()}}w{3.11()}l.16=h.16;5 b;7(y(h.U)===\'4\'){b=h.U(a)}w{b=h.U}o(b,h.E,a/1B)}.G(3);3.8=4(c,d){5 e=K.N();h.1h(c,d);5 f=4(){5 a=B.19(K.N()-e,h.8.D);5 b=h.z(3,a,c,d-c,h.8.D);3.S(b);h.1d(c,d,b);7(a>=h.8.D){h.1e(c,d)}w{q(f)}}.G(3);q(f)}.G(3)};5 u=4(e,f){5 g={U:\'#1L\',R:\'#1M\',I:\'#1N\',F:1,16:\'1O\',E:10,1g:M,v:1P,T:0,8:{D:X,C:P},z:4(x,t,b,c,d){t=t/(d/2);7(t<1){9 c/2*t*t+b}9-c/2*((--t)*(t-2)-1)+b},1h:4(a,b){9},1d:4(a,b,c){9},1e:4(a,b){9}};7(y(s)!==\'M\'){g.A=s}w 7(y(1i)!==\'M\'){g.A=1i}w{1T O 1U(\'1V 1W 1X 1j 1Z- 20 1j 21\');}5 h={};5 j=0;5 k=4(){3.22=e;3.23=h;1l(5 i 25 g){7(g.26(i)){h[i]=f&&y(f[i])!==\'M\'?f[i]:g[i];7(y(h[i])===\'4\'){h[i]=h[i].G(3)}}}7(y(h.z)===\'27\'&&y(J)!==\'M\'&&J.28(J.z[h.z])){h.z=J.z[h.z]}w{h.z=g.z}7(y(h.8)===\'29\'){h.8={D:h.8,C:P}}7(y(h.8)===\'2a\'&&!h.8){h.8={D:X,C:h.8}}3.A=O h.A(e,h);3.A.S(j);7(e.V&&e.V.Q){3.15(13(e.V.Q))}w 7(e.Y&&e.Y(\'L-Q\')){3.15(13(e.Y(\'L-Q\')))}}.G(3);3.15=4(a){a=13(a);7(h.8.C){3.A.8(j,a)}w{3.A.S(a)}j=a;9 3}.G(3);3.2i=4(){h.8.C=1m;9 3};3.2j=4(){h.8.C=P;9 3};k()};$.2k.18=4(b){9 3.2m(4(){5 a;7(!$.L(3,\'18\')){a=$.1q({},b,$(3).L());$.L(3,\'18\',O u(3,a))}})}}));',62,148,'|||this|function|var||if|animate|return||||||||||||||||||||||size|else||typeof|easing|renderer|Math|enabled|duration|lineWidth|scaleLength|bind|window|scaleColor|jQuery|Date|data|undefined|now|new|true|percent|trackColor|draw|rotate|barColor|dataset|define|1000|getAttribute|width||clear||parseFloat|height|update|lineCap|PI|easyPieChart|min|putImageData|style|devicePixelRatio|onStep|onStop|getImageData|trackWidth|onStart|SVGRenderer|the|object|for|false|jquery|exports|G_vmlCanvasManager|extend|initElement|getCanvas|getCtx|px|clearRect|join|max|scale|translate|amd|100|getContext|beginPath|arc|strokeStyle|stroke|180|fillStyle|save|module|CA4FBD|003D72|dfe0e0|round|110|require|document|restore|throw|Error|Please|load|either|createElement|SVG|or|CanvasRenderer|el|options||in|hasOwnProperty|string|isFunction|number|boolean|requestAnimationFrame|webkitRequestAnimationFrame||mozRequestAnimationFrame|setTimeout|canvas|60|disableAnimation|enableAnimation|fn|appendChild|each|fillRect'.split('|'),0,{}));
|
||||
1473
wp-content/plugins/kingcomposer/assets/frontend/js/kingcomposer.js
Normal file
1473
wp-content/plugins/kingcomposer/assets/frontend/js/kingcomposer.js
Normal file
File diff suppressed because it is too large
Load Diff
1
wp-content/plugins/kingcomposer/assets/frontend/js/kingcomposer.min.js
vendored
Normal file
1
wp-content/plugins/kingcomposer/assets/frontend/js/kingcomposer.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
185
wp-content/plugins/kingcomposer/assets/frontend/js/video.play.js
Normal file
185
wp-content/plugins/kingcomposer/assets/frontend/js/video.play.js
Normal file
@@ -0,0 +1,185 @@
|
||||
/***
|
||||
* Video play JS
|
||||
* (c) king-theme.Com
|
||||
***/
|
||||
|
||||
var kc_video_play = ( function($){
|
||||
return {
|
||||
init: function(){
|
||||
$( '.kc_video_wrapper' ).each( function () {
|
||||
if( kc_video_play.youtube.url_valid( $(this).data('video') ) )
|
||||
{
|
||||
kc_video_play.youtube.add( $( this ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( kc_video_play.vimeo.getID( $(this).data('video') ) )
|
||||
{
|
||||
kc_video_play.vimeo.add( $( this ) );
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
youtube: {
|
||||
url_valid : function( url )
|
||||
{
|
||||
if( url === undefined )
|
||||
return false;
|
||||
|
||||
var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/;
|
||||
return (url.match(p)) ? RegExp.$1 : false;
|
||||
},
|
||||
|
||||
getID: function ( url )
|
||||
{
|
||||
if ( 'undefined' === typeof(url) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var id = url.match( /(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/ );
|
||||
if ( null !== id ) {
|
||||
return id[ 1 ];
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
add: function( $obj, counter ) {
|
||||
|
||||
var youtubeUrl,
|
||||
youtubeId,
|
||||
autoplay = ('yes' === $obj.data('autoplay')) ? 1: 0,
|
||||
related = ('yes' === $obj.data('related')) ? 1: 0,
|
||||
loop = ('yes' === $obj.data('loop')) ? 1: 0,
|
||||
ctl = ('yes' === $obj.data('control')) ? 1: 0,
|
||||
showinfo = ('yes' === $obj.data('showinfo')) ? 1: 0,
|
||||
_vd_width = $obj.data('width'),
|
||||
_vd_height = $obj.data('height');
|
||||
|
||||
if('yes' === $obj.data('fullwidth')){
|
||||
_vd_width = '100%';
|
||||
}
|
||||
|
||||
youtubeUrl = $obj.data( 'video' );
|
||||
youtubeId = kc_video_play.youtube.getID( youtubeUrl );
|
||||
|
||||
if( YT === undefined )
|
||||
return;
|
||||
|
||||
if ( 'undefined' === typeof( YT.Player ) ) {
|
||||
|
||||
counter = 'undefined' === typeof( counter ) ? 0 : counter;
|
||||
if ( counter > 100 ) {
|
||||
console.warn( 'Too many attempts to load YouTube api' );
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout( function () {
|
||||
kc_video_play.youtube.add( $obj, youtubeId, counter++ );
|
||||
}, 100 );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var player,
|
||||
ratio = 1.77,
|
||||
youtubeId_pl = '',
|
||||
$container = $obj.prepend( '<div class="kc-video-inner"><div class="ifr_inner"></div></div>' ).find( '.ifr_inner' );
|
||||
if(loop == 1) youtubeId_pl = youtubeId;
|
||||
|
||||
player = new YT.Player( $container[0], {
|
||||
width: _vd_width,
|
||||
height: _vd_height,
|
||||
videoId: youtubeId,
|
||||
playerVars: {
|
||||
iv_load_policy: 3,
|
||||
playlist: youtubeId_pl,
|
||||
enablejsapi: 1,
|
||||
disablekb: 1,
|
||||
autoplay: autoplay,
|
||||
controls: ctl,
|
||||
showinfo: showinfo,
|
||||
rel: related,
|
||||
loop: loop
|
||||
},
|
||||
events: {
|
||||
onReady: function ( e ) {
|
||||
if($obj.data('kc-video-mute') == 'yes')
|
||||
e.target.mute().setLoop( true );
|
||||
if(autoplay)
|
||||
e.target.playVideo();
|
||||
var w = $($obj).find('.ifr_inner').width();
|
||||
$($obj).find('.ifr_inner').height( w/ratio );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
vimeo: {
|
||||
getID: function( url )
|
||||
{
|
||||
if( url === undefined )
|
||||
return false;
|
||||
|
||||
var regExp = /http(s)?:\/\/(www\.)?vimeo.com\/(\d+)(\/)?(#.*)?/;
|
||||
|
||||
var match = url.match(regExp);
|
||||
|
||||
if (match)
|
||||
return match[3];
|
||||
},
|
||||
|
||||
add: function( $obj ){
|
||||
var vimeoUrl,
|
||||
vimeoId,
|
||||
autoplay = ('yes' === $obj.data('autoplay')) ? 1: 0,
|
||||
_vd_width = $obj.data('width'),
|
||||
_vd_height = $obj.data('height');
|
||||
|
||||
vimeoUrl = $obj.data( 'video' );
|
||||
vimeoId = kc_video_play.vimeo.getID( vimeoUrl );
|
||||
|
||||
if('yes' === $obj.data('fullwidth')){
|
||||
_vd_width = '100%';
|
||||
}
|
||||
|
||||
var player,
|
||||
iframe,
|
||||
player_iframe,
|
||||
ratio = 1.77,
|
||||
$container = $obj.prepend( '<div class="kc-video-inner"><div class="ifr_inner"></div></div>' ).find( '.ifr_inner' );
|
||||
|
||||
player_iframe = '<iframe id="player_'+ vimeoId +'" src="https://player.vimeo.com/video/'+ vimeoId +'?api=1&player_id=player_'+ vimeoId +'" width="'+ _vd_width +'" height="'+ _vd_height +'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
|
||||
|
||||
$($container[0]).html( player_iframe );
|
||||
|
||||
iframe = $('#player_'+vimeoId)[0];
|
||||
player = $f(iframe);
|
||||
|
||||
player.addEvent('ready', function() {
|
||||
if(autoplay === 1){
|
||||
player.api('play');
|
||||
}
|
||||
|
||||
var w = $($obj).find('iframe').width();
|
||||
$($obj).find('iframe').height( w/ratio );
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
refresh: function( el ){
|
||||
var ratio = 1.77,
|
||||
w = el.find('.ifr_inner').width();
|
||||
|
||||
el.find('.ifr_inner').height( w/ratio );
|
||||
el.find('.ifr_inner>iframe').height( w/ratio );
|
||||
}
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
|
||||
jQuery( document ).ready(function($){ kc_video_play.init($); });
|
||||
1
wp-content/plugins/kingcomposer/assets/frontend/js/video.play.min.js
vendored
Normal file
1
wp-content/plugins/kingcomposer/assets/frontend/js/video.play.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 9=(6($){8{13:6(){$(\'.1h\').1i(6(){5(9.q.12($(E).4(\'j\'))){9.q.C($(E))}1g{5(9.x.y($(E).4(\'j\'))){9.x.C($(E))}}})},q:{12:6(a){5(a===t)8 B;7 p=/^(?:X?:\\/\\/)?(?:16\\.)?(?:15\\.V\\/|q\\.J\\/(?:1f\\/|v\\/|U\\?v=|U\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;8(a.L(p))?1e.$1:B},y:6(a){5(\'t\'===O(a)){8 B}7 b=a.L(/(?:X?:\\/{2})?(?:w{3}\\.)?15(?:V)?\\.(?:J|V)(?:\\/U\\?v=|\\/)([^\\s&]+)/);5(1c!==b){8 b[1]}8 B},C:6(a,b){7 c,z,n=(\'g\'===a.4(\'n\'))?1:0,T=(\'g\'===a.4(\'T\'))?1:0,A=(\'g\'===a.4(\'A\'))?1:0,10=(\'g\'===a.4(\'1G\'))?1:0,D=(\'g\'===a.4(\'D\'))?1:0,r=a.4(\'o\'),H=a.4(\'k\');5(\'g\'===a.4(\'19\')){r=\'K%\'}c=a.4(\'j\');z=9.q.y(c);5(N===t)8;5(\'t\'===O(N.18)){b=\'t\'===O(b)?0:b;5(b>K){1T.1j(\'1k 1w 1x 1C 1D 1E P\');8}1Q(6(){9.q.C(a,z,b++)},K);8}7 d,G=1.Q,R=\'\',$F=a.Z(\'<m I="W-j-14"><m I="i"></m></m>\').h(\'.i\');5(A==1)R=z;d=1l N.18($F[0],{o:r,k:H,1m:z,1n:{1o:3,1p:R,1q:1,1r:1,n:n,1s:10,D:D,1t:T,A:A},1u:{1v:6(e){5(a.4(\'W-j-17\')==\'g\')e.1y.17().1z(1A);7 w=$(a).h(\'.i\').o();$(a).h(\'.i\').k(w/G)}}})}},x:{y:6(a){5(a===t)8 B;7 b=/1B(s)?:\\/\\/(16\\.)?x.J\\/(\\d+)(\\/)?(#.*)?/;7 c=a.L(b);5(c)8 c[3]},C:6(a){7 b,u,n=(\'g\'===a.4(\'n\'))?1:0,r=a.4(\'o\'),H=a.4(\'k\');b=a.4(\'j\');u=9.x.y(b);5(\'g\'===a.4(\'19\')){r=\'K%\'}7 c,l,Y,G=1.Q,$F=a.Z(\'<m I="W-j-14"><m I="i"></m></m>\').h(\'.i\');Y=\'<l 1F="M\'+u+\'" 1H="X://1I.x.J/j/\'+u+\'?P=1&1J=M\'+u+\'" o="\'+r+\'" k="\'+H+\'" 1K="0" 1L 1M 1N></l>\';$($F[0]).1O(Y);l=$(\'#M\'+u)[0];c=$f(l);c.1P(\'1a\',6(){5(n===1){c.P(\'1R\')}7 w=$(a).h(\'l\').o();$(a).h(\'l\').k(w/G)})}},1S:6(a){7 b=1.Q,w=a.h(\'.i\').o();a.h(\'.i\').k(w/b);a.h(\'.i>l\').k(w/b)}}}(1b));1b(1d).1a(6($){9.13($)});',62,118,'||||data|if|function|var|return|kc_video_play|||||||yes|find|ifr_inner|video|height|iframe|div|autoplay|width||youtube|_vd_width||undefined|vimeoId|||vimeo|getID|youtubeId|loop|false|add|showinfo|this|container|ratio|_vd_height|class|com|100|match|player_|YT|typeof|api|77|youtubeId_pl||related|watch|be|kc|https|player_iframe|prepend|ctl||url_valid|init|inner|youtu|www|mute|Player|fullwidth|ready|jQuery|null|document|RegExp|embed|else|kc_video_wrapper|each|warn|Too|new|videoId|playerVars|iv_load_policy|playlist|enablejsapi|disablekb|controls|rel|events|onReady|many|attempts|target|setLoop|true|http|to|load|YouTube|id|control|src|player|player_id|frameborder|webkitallowfullscreen|mozallowfullscreen|allowfullscreen|html|addEvent|setTimeout|play|refresh|console'.split('|'),0,{}))
|
||||
Reference in New Issue
Block a user