#2 JavaScript::Eval (size: 19982, repeated: 1) /* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */
(function(e) {
function k(a) {
return $widgetkit.css3(a)
}
var o = $widgetkit.support,
j = function() {};
j.prototype = e.extend(j.prototype, {
name: "slideshow",
options: {
index: 0,
width: "auto",
height: "auto",
autoplay: !0,
interval: 5E3,
navbar_items: 4,
caption_animation_duration: 500,
kenburns_animation_duration: null,
slices: 20,
duration: 500,
animated: "random",
easing: "swing"
},
nav: null,
navbar: null,
captions: null,
caption: null,
kbi: 0,
initialize: function(a, c) {
var b = this;
this.options = e.extend({}, this.options, c);
this.element = this.wrapper = a;
this.ul = this.wrapper.find("ul.slides:first").css({
width: "100%",
overflow: "hidden"
});
this.wrapper.css({
position: "relative"
});
this.slides = this.ul.css({
position: "relative"
}).children().css({
top: "0px",
left: "0px",
position: "absolute"
}).hide();
this.index = this.slides[this.options.index] ? this.options.index : 0;
e(".next", this.wrapper).bind("click", function() {
b.stop();
b.nextSlide()
});
e(".prev", this.wrapper).bind("click", function() {
b.stop();
b.prevSlide()
});
if (this.wrapper.find(".nav:first").length) {
this.nav = this.wrapper.find(".nav:first");
var d = this.nav.children();
d.each(function(a) {
e(this).bind("click", function() {
b.stop();
b.slides[a] && b.show(a)
})
});
a.bind("slideshow-show", function(a, b, c) {
e(d.removeClass("active").get(c)).addClass("active")
})
}
this.wrapper.find(".captions:first").length && this.wrapper.find(".caption:first").length && (this.captions = this.wrapper.find(".captions:first").hide().children(), this.caption = this.wrapper.find(".caption:first").hide());
this.nav && e(this.nav.children().get(this.index)).addClass("active");
this.navbar && e(this.navbar.children().get(this.index)).addClass("active");
this.showCaption(this.index);
this.timer = null;
this.hover = !1;
this.wrapper.hover(function() {
b.hover = true
}, function() {
b.hover = false
});
"ontouchend" in document && (a.bind("touchstart", function(b) {
function c(a) {
if (g) {
var b = a.originalEvent.touches ? a.originalEvent.touches[0] : a;
i = {
time: (new Date).getTime(),
coords: [b.pageX, b.pageY]
};
Math.abs(g.coords[0] - i.coords[0]) > 10 && a.preventDefault()
}
}
var d = b.originalEvent.touches ? b.originalEvent.touches[0] : b,
g = {
time: (new Date).getTime(),
coords: [d.pageX, d.pageY],
origin: e(b.target)
},
i;
a.bind("touchmove", c).one("touchend", function() {
a.unbind("touchmove", c);
g && i && i.time - g.time < 1E3 && (Math.abs(g.coords[0] - i.coords[0]) > 30 && Math.abs(g.coords[1] - i.coords[1]) < 75) && g.origin.trigger("swipe").trigger(g.coords[0] > i.coords[0] ? "swipeleft" : "swiperight");
g = i = void 0
})
}), this.wrapper.bind("swipeleft", function() {
b.stop();
b.nextSlide()
}).bind("swiperight", function() {
b.stop();
b.prevSlide()
}));
e(window).bind("resize", function() {
b.resize()
});
b.resize();
b.slides.eq(b.index).css("z-index", 2).show();
"kenburns" == b.options.animated && o.canvas && b.show(this.index, !0);
b.options.autoplay && b.start()
},
resize: function() {
this.fx && (this.slicer && this.slicer.remove(), this.slides.filter(":animated").stop(!0, !0), this.next.css({
top: 0,
left: 0,
"z-index": 2
}).show(), "kenburns" == this.options.animated && o.canvas && (this.element.find("img:animated").stop().css({
width: "",
height: "",
top: "",
left: ""
}).fadeIn("fast"), this.element.find("canvas.tmp").remove()), this.current.css({
top: 0,
left: 0,
"z-index": 1
}).hide());
this.fx = !1;
var a = this.options.width,
c = this.options.height;
this.slides.css("width", "");
this.slides.css("height", "");
this.ul.css("height", "");
this.wrapper.css("width", "");
"auto" != a && this.wrapper.width() < a && (c = a = "auto");
this.wrapper.css({
width: "auto" == a ? this.wrapper.width() : a
});
var a = this.ul.width(),
b = c;
"auto" == b && (b = 0, this.slides.css("width", a).show().each(function() {
b = Math.max(b, e(this).height())
}).hide().eq(this.index).show());
this.slides.css({
height: b,
width: this.ul.width()
});
this.ul.css("height", b)
},
nextSlide: function() {
this.show(this.slides[this.index + 1] ? this.index + 1 : 0)
},
prevSlide: function() {
this.show(-1 < this.index - 1 ? this.index - 1 : this.slides.length - 1)
},
show: function(a, c) {
this.index == a && !c || this.fx && "kenburns" != this.options.animated || (this.current = e(this.slides.get(this.index)), this.next = e(this.slides.get(a)), this.animated = this.options.animated, this.duration = this.options.duration, this.easing = this.options.easing, this.dir = a > this.index ? "right" : "left", this.init = c, this.showCaption(a), this.element.trigger("slideshow-show", [this.index, a]), this.index = a, this[this.animated] ? (this.fx = !0, this[this.animated]()) : (this.current.hide(), this.next.show()))
},
showCaption: function(a) {
if (this.caption && this.captions[a]) {
var c = e(this.captions.get(a)).html();
this.caption.is(":animated") && this.caption.stop();
if ("" == e.trim(c)) this.caption.is(":visible") && this.caption.fadeOut(this.options.caption_animation_duration);
else if (this.caption.is(":visible")) {
var b = this;
this.caption.fadeOut(this.options.caption_animation_duration, function() {
e(this).html(c).delay(200).css("opacity", "").fadeIn(b.options.caption_animation_duration)
})
} else this.caption.html(c).fadeIn(this.options.caption_animation_duration)
}
},
start: function() {
if (!this.timer) {
var a = this;
this.timer = setInterval(function() {
("kenburns" == a.options.animated || !a.hover && !a.fx) && a.nextSlide()
}, this.options.interval)
}
},
stop: function() {
if (this.timer) {
clearInterval(this.timer);
this.tmptimer && clearTimeout(this.tmptimer);
var a = this;
this.tmptimer = setTimeout(function() {
a.start();
this.tmptimer = !1
}, 3E4);
this.timer = !1
}
},
bindTransitionEnd: function(a) {
var c = this;
e(a).bind("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd", function() {
c.fx = null;
c.next.css({
"z-index": "2",
left: 0,
top: 0
}).show();
c.current.hide();
c.slicer && c.slicer.remove()
})
},
randomSimple: function() {
var a = "top bottom fade slide scroll swipe".split(" ");
this.animated = a[Math.floor(Math.random() * a.length)];
this[this.animated]()
},
randomFx: function() {
var a = "sliceUp sliceDown sliceUpDown fold puzzle boxes boxesReverse".split(" ");
this.animated = a[Math.floor(Math.random() * a.length)];
this[this.animated]()
},
top: function() {
var a = this;
this.current.css({
"z-index": 1
});
this.next.css({
"z-index": 2,
display: "block",
left: 0,
top: this.wrapper.height() * ("bottom" == this.animated ? 2 : -1)
}).animate({
top: 0
}, {
duration: a.duration,
easing: a.easing,
complete: function() {
a.fx = null;
a.current.hide()
}
})
},
bottom: function() {
this.top.apply(this)
},
left: function() {
var a = this;
this.current.css({
"z-index": 1
});
this.next.css({
"z-index": 2,
display: "block",
left: this.current.width() * ("right" == this.animated ? 2 : -1)
}).animate({
left: 0
}, {
duration: a.duration,
easing: this.easing,
complete: function() {
a.fx = null;
a.current.hide()
}
})
},
right: function() {
this.left()
},
slide: function() {
var a = this;
this.current.css({
"z-index": 1
});
this.next.css({
"z-index": 2,
display: "block",
left: this.current.width() * ("right" == this.dir ? 2 : -1)
}).animate({
left: 0
}, {
duration: a.duration,
easing: this.easing,
complete: function() {
a.fx = null;
a.current.hide()
}
})
},
fade: function() {
var a = this;
this.next.css({
top: 0,
left: 0,
"z-index": 1
}).fadeIn(a.duration);
this.current.css({
"z-index": 2
}).fadeOut(this.duration, function() {
a.fx = null;
a.current.hide().css({
opacity: 1
})
})
},
scrollLeft: function() {
var a = this;
this.current.css({
"z-index": 1
});
this.next.css({
"z-index": 2,
display: "block",
left: this.current.width() * ("scrollRight" == this.animated ? 1 : -1)
}).animate({
left: 0
}, {
duration: a.duration,
easing: this.easing,
complete: function() {
a.fx = null;
a.current.hide()
},
step: function(c, b) {
a.current.css("left", (Math.abs(b.start) - Math.abs(c)) * ("scrollRight" == a.animated ? -1 : 1))
}
})
},
scrollRight: function() {
this.scrollLeft(this)
},
scroll: function() {
var a = this;
this.current.css({
"z-index": 1
});
this.next.css({
"z-index": 2,
display: "block",
left: this.current.width() * ("right" == this.dir ? 1 : -1)
}).animate({
left: 0
}, {
duration: a.duration,
easing: this.easing,
complete: function() {
a.fx = null;
a.current.hide()
},
step: function(c, b) {
a.current.css("left", (Math.abs(b.start) - Math.abs(c)) * ("right" == a.dir ? -1 : 1))
}
})
},
swipe: function() {
var a = this;
this.current.css({
"z-index": 2
});
this.next.css({
"z-index": 1,
top: 0,
left: this.next.width() / 3 * ("right" == a.dir ? 1 : -1)
}).show();
var c = e("<div></div>").css({
position: "absolute",
top: 0,
left: 0,
width: this.current.outerWidth(),
height: this.current.outerHeight(),
opacity: 0,
"background-color": "#000"
}).appendTo(this.current),
b = e("<div></div>").css({
position: "absolute",
top: 0,
left: 0,
width: this.current.outerWidth(),
height: this.current.outerHeight(),
opacity: 0.6,
"background-color": "#000"
}).appendTo(this.next);
c.animate({
opacity: 0.6
}, {
duration: a.duration
});
b.animate({
opacity: 0
}, {
duration: a.duration
});
this.current.animate({
left: ("right" == a.dir ? -1 : 1) * this.current.width()
}, {
duration: a.duration,
easing: "easeOutCubic",
complete: function() {
a.fx = null;
a.current.hide();
c.remove();
b.remove()
}
});
this.next.animate({
left: 0
}, {
duration: a.duration,
easing: "easeOutCubic"
})
},
slice: function() {
var a = this,
c = this.next.find("img:first"),
b = "sliceUp" == this.animated ? "bottom" : "top";
if (c.length) {
var d = this.current.find("img:first").position(),
h = a.next.width(),
l = a.next.height();
p(this, d.top, d.left);
for (var d = Math.round(this.slicer.width() / this.options.slices), f = 0; f < this.options.slices; f++) {
var g = f == this.options.slices - 1 ? this.slicer.width() - d * f : d;
"sliceUpDown" == this.animated && (b = 0 == (f % 2 + 2) % 2 ? "top" : "bottom");
this.slicer.append(e("<div />").css(b, 0).css(k({
position: "absolute",
left: d * f + "px",
width: g + "px",
height: 0,
background: "url(" + c.attr("src") + ") no-repeat -" + (d + f * d - d) + "px " + b,
"background-size": h + "px " + l + "px",
opacity: 0,
transition: "all " + a.duration + "ms ease-in " + 60 * f + "ms"
})))
}
this.slices = this.slicer.children();
this.bindTransitionEnd.apply(this, [this.slices.get(this.slices.length - 1)]);
this.current.css({
"z-index": 1
});
this.slicer.show();
var i = this.wrapper.height();
if (o.transition) this.slices.css(k({
height: i,
opacity: 1
}));
else {
var n = 0;
this.slices.each(function(b) {
var c = e(this);
setTimeout(function() {
c.animate({
height: i,
opacity: 1
}, a.duration, function() {
b == a.slices.length - 1 && e(this).trigger("transitionend")
})
}, n);
n += 60
})
}
} else this.next.css({
"z-index": "2",
left: 0,
top: 0
}).show(), this.current.hide(), this.fx = null
},
sliceUp: function() {
this.slice.apply(this)
},
sliceDown: function() {
this.slice.apply(this)
},
sliceUpDown: function() {
this.slice.apply(this)
},
fold: function() {
var a = this,
c = this.next.find("img:first");
if (c.length) {
var b = this.current.find("img:first").position(),
d = a.next.width(),
h = a.next.height();
p(this, b.top, b.left);
for (var l = Math.round(this.slicer.width() / this.options.slices) + 2, b = this.current.height(), f = 0; f < this.options.slices + 1; f++) {
var g = f == a.options.slices ? a.slicer.width() - l * f : l;
this.slicer.append(e("<div />").css(k({
position: "absolute",
left: l * f + "px",
width: g,
top: "0px",
height: b,
background: "url(" + c.attr("src") + ") no-repeat -" + (l + f * l - l) + "px 0%",
"background-size": d + "px " + h + "px",
opacity: 0,
transform: "scalex(0.0001)",
transition: "all " + a.duration + "ms ease-in " + (100 + 60 * f) + "ms"
})))
}
this.slices = this.slicer.children();
this.bindTransitionEnd.apply(this, [this.slices.get(this.slices.length - 1)]);
this.current.css({
"z-index": 1
});
this.slicer.show();
if (o.transition) this.slices.css(k({
opacity: 1,
transform: "scalex(1)"
}));
else {
var i = 0;
this.slices.width(0).each(function(b) {
var c = b == a.options.slices - 1 ? a.slicer.width() - l * b : l,
d = e(this);
setTimeout(function() {
d.animate({
opacity: 1,
width: c
}, a.duration, function() {
b == a.slices.length - 1 && e(this).trigger("transitionend")
})
}, i + 100);
i += 50
})
}
} else this.next.css({
"z-index": "2",
left: 0,
top: 0
}).show(), this.current.hide(), this.fx = null
},
puzzle: function() {
var a = this,
c = Math.round(this.options.slices / 2),
b = Math.round(this.wrapper.width() / c),
d = Math.round(this.wrapper.height() / b),
h = Math.round(this.wrapper.height() / d) + 1,
l = this.next.find("img:first");
if (l.length) {
var f = this.current.find("img:first").position(),
g = a.next.width(),
i = a.next.height();
p(this, f.top, f.left);
for (var f = this.wrapper.width(), n = 0; n < d; n++) for (var m = 0; m < c; m++) this.slicer.append(e("<div />").css(k({
position: "absolute",
left: b * m + "px",
width: m == c - 1 ? f - b * m + "px" : b + "px",
top: h * n + "px",
height: h + "px",
background: "url(" + l.attr("src") + ") no-repeat -" + (b + m * b - b) + "px -" + (h + n * h - h) + "px",
"background-size": g + "px " + i + "px",
opacity: 0,
"-webkit-transform": "translateZ(0)",
"-moz-transform": "rotate(0)",
transition: "all " + a.duration + "ms ease-in 0ms"
})));
this.slices = s(this.slicer.children());
this.bindTransitionEnd.apply(this, [this.slices.get(this.slices.length - 1)]);
this.current.css({
"z-index": 1
});
this.slicer.show();
this.slices.each(function(b) {
var c = e(this);
setTimeout(function() {
o.transition ? c.css(k({
opacity: 1
})) : c.animate({
opacity: 1
}, a.duration, function() {
b == a.slices.length - 1 && e(this).trigger("transitionend")
})
}, 100 + 50 * b)
})
} else this.next.css({
"z-index": "2",
left: 0,
top: 0
}).show(), this.current.hide(), this.fx = null
},
boxes: function() {
var a = this,
c = Math.round(this.options.slices / 2),
b = Math.round(this.wrapper.width() / c),
d = Math.round(this.wrapper.height() / b),
h = Math.round(this.wrapper.height() / d) + 1,
l = 0,
f = this.next.find("img:first");
if (f.length) {
var g = this.current.find("img:first").position(),
i = a.next.width(),
n = a.next.height();
p(this, g.top, g.left);
for (g = 0; g < d; g++) for (var m = 0; m < c; m++) this.slicer.append(e("<div />").css(k({
position: "absolute",
left: b * m + "px",
width: 0,
top: h * g + "px",
height: 0,
background: "url(" + f.attr("src") + ") no-repeat -" + (b + m * b - b) + "px -" + (h + g * h - h) + "px",
"background-size": i + "px " + n + "px",
opacity: 0,
transition: "all " + (100 + a.duration) + "ms ease-in 0ms"
})).data("base", {
width: m == c - 1 ? this.wrapper.width() - b * m : b,
height: h
}));
this.slices = this.slicer.children();
this.current.css({
"z-index": 1
});
this.slicer.show();
var j = 0,
q = 0,
r = [];
r[j] = [];
b = "boxesReverse" == this.animated ? this.slices._reverse() : this.slices;
this.bindTransitionEnd.apply(this, [b.get(b.length - 1)]);
b.each(function() {
r[j][q] = e(this);
q++;
q == c && (j++, q = 0, r[j] = [])
});
for (m = h = 0; m < c * d; m++) {
f = m;
for (g = 0; g < d; g++) 0 <= f && f < c && (function(b, c, d, t) {
var f = r[b][c];
setTimeout(function() {
o.transition ? f.css({
opacity: "1",
width: f.data("base").width,
height: f.data("base").height
}) : f.animate({
opacity: "1",
width: f.data("base").width,
height: f.data("base").height
}, a.duration, function() {
t == a.slices.length - 1 && e(this).trigger("transitionend")
})
}, 100 + d)
}(g, f, l, h, b.length), h++), f--;
l += 100
}
} else this.next.css({
"z-index": "2",
left: 0,
top: 0
}).show(), this.current.hide(), this.fx = null
},
boxesReverse: function() {
this.boxes.apply(this)
},
kenburns: function() {
var a = this,
c = this.next.find("img:first"),
b = a.options.kenburns_animation_duration || 2 * a.options.interval;
if (c.length) if (o.canvas) {
c.stop(!1, !0).css({
width: "",
height: ""
});
this.slides.not(this.current).not(this.next).hide();
this.current.css({
"z-index": 1
});
this.next.css({
"z-index": 2,
visibility: "hidden",
opacity: 1
}).show();
this.next.find("canvas.tmp").remove();
c.position();
var d = c.attr("width"),
h = c.attr("height"),
l = [{
start: ["c-l", 1],
stop: ["c-r", 1.2]
}, {
start: ["t-r", 1],
stop: ["b-l", 1.2]
}, {
start: ["b-l", 1],
stop: ["t-r", 1.2]
}, {
start: ["t-c", 1],
stop: ["b-c", 1.2]
}, {
start: ["c-c", 1],
stop: ["c-c", 1.2]
}, {
start: ["b-r", 1],
stop: ["t-l", 1.2]
}, {
start: ["c-l", 1],
stop: ["c-r", 1.2]
}],
f = l[this.kbi ? this.kbi : 0],
g = e('<canvas class="tmp"></canvas>'),
i = function(a, b) {
var b = b || 1,
c = {
top: 0,
left: 0,
width: d * b,
height: h * b
};
switch (a) {
case "t-l":
c.top = c.left = 0;
break;
case "t-c":
c.top = 0;
c.left = -1 * ((c.width - d) / 2);
break;
case "t-r":
c.top = 0;
c.left = -1 * (c.width - d);
break;
case "c-l":
c.top = -1 * ((c.height - h) / 2);
c.left = 0;
break;
case "c-c":
c.top = -1 * ((c.height - h) / 2);
c.left = -1 * ((c.width - d) / 2);
break;
case "c-r":
c.top = -1 * ((c.height - h) / 2);
c.left = -1 * (c.width - d);
break;
case "b-l":
c.top = -1 * (c.height - h);
c.left = 0;
break;
case "b-c":
c.top = -1 * (c.height - h);
c.left = -1 * ((c.width - d) / 2);
break;
case "b-r":
c.top = -1 * (c.height - h), c.left = -1 * (c.width - d)
}
return c
};
if (d > this.ul.width()) {
var k = d / this.ul.width(),
d = this.ul.width(),
h = h / k;
this.ul.height(h).css("overflow", "hidden").css("z-index", "4")
}
g.attr({
width: d,
height: h
}).css({
width: d,
height: h,
opacity: 0
});
c.css({
width: "",
height: "",
top: "",
left: ""
}).after(g).hide();
var m = g.get(0).getContext("2d");
this.next.css({
visibility: "visible"
});
g.animate({
opacity: 1
}, a.duration);
var j = !1,
q = !1,
r = !1,
p = !1;
c.css(i.apply(this, f.start)).animate(i.apply(this, f.stop), {
step: function(a, b) {
!1 !== j && (!1 !== q && !1 !== r && !1 !== p) && (m.drawImage(c.get(0), j, q, r, p), p = r = q = j = !1);
"width" == b.prop && (r = a);
"height" == b.prop && (p = a);
"left" == b.prop && (j = a);
"top" == b.prop && (q = a)
},
complete: function() {
e(this).css({
width: "",
height: "",
top: "",
left: ""
});
a.fx = null
},
easing: "swing",
duration: b
});
a.kbi = l[a.kbi + 1] ? a.kbi + 1 : 0
} else this.fade(this);
else this.next.css({
"z-index": "2",
left: 0,
top: 0
}).show(), this.current.hide(), this.fx = null
},
scale: function() {
var a = this;
o.transition ? (this.fx = null, this.ul.css({
"-webkit-transform": "translateZ(0)"
}), this.slides.css(k({
transition: "none",
transform: "none",
opacity: 1
})), this.slides.not(this.current).hide(), this.current.one("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd", function() {
a.next.css({
"z-index": "2",
left: 0,
top: 0,
opacity: 1
}).show();
e(this).hide().css(k({
transition: "none",
transform: "none",
opacity: 1
}))
}).css(k({
"z-index": 2,
opacity: 1,
transform: "scale(1)",
transition: "all " + a.duration + "ms ease-in-out 0ms"
})), this.next.css(k({
"z-index": 1,
opacity: 1,
transform: "none"
})).show(), a.current.css({
"z-index": 2
}).css(k({
opacity: 0,
transform: "scale(1.5)"
}))) : this.fade(this)
},
rotate: function() {
if (o.transition) {
this.fx = null;
var a = this,
c = this.current,
b = [
["rotate(90deg) translate(200%, -10%) scale(0.2)", "rotate(-90deg) translate(-200%, -10%) scale(0.2)"],
["rotate(-90deg) translate(-200%, -10%) scale(0.2)", "rotate(90deg) translate(200%, -10%) scale(0.2)"],
["rotate(-90deg) translate(200%, -90%) scale(0.2)", "rotate(90deg) translate(-200%, -90%) scale(0.2)"],
["rotate(90deg) translate(-200%, -90%) scale(0.2)", "rotate(-90deg) translate(200%, -90%) scale(0.2)"],
["rotate(90deg) translate(200%, -10%) scale(0.2)", "rotate(90deg) translate(-200%, -90%) scale(0.2)"],
["rotate(-90deg) translate(-200%, -10%) scale(0.2)", "rotate(-90deg) translate(200%, -90%) scale(0.2)"],
["rotate(90deg) translate(-200%, -90%) scale(0.2)", "rotate(90deg) translate(200%, -10%) scale(0.2)"],
["rotate(-90deg) translate(200%, -90%) scale(0.2)", "rotate(-90deg) translate(-200%, -10%) scale(0.2)"],
["rotate(10deg) translate(200%, 20%) scale(0.2)", "rotate(10deg) translate(-200%, -20%) scale(0.2)"],
["rotate(10deg) translate(-200%, -20%) scale(0.2)", "rotate(10deg) translate(200%, 20%) scale(0.2)"],
["rotate(-10deg) translate(200%, -20%) scale(0.2)", "rotate(-10deg) translate(-200%, 20%) scale(0.2)"],
["rotate(-10deg) translate(-200%, 20%) scale(0.2)", "rotate(-10deg) translate(200%, -20%) scale(0.2)"],
["translate(50%, 200%) scale(0.2)", "translate(-50%, -200%) scale(0.2)"],
["translate(-50%, -200%) scale(0.2)", "translate(50%, 200%) scale(0.2)"],
["translate(50%, -200%) scale(0.2)", "translate(-50%, 200%) scale(0.2)"],
["translate(-50%, 200%) scale(0.2)", "translate(50%, -200%) scale(0.2)"]
],
d = parseInt(Math.random() * b.length);
this.slides.not(this.current).hide();
this.current.css({
"z-index": 1
}).css(k({
opacity: 1,
transform: "rotate(0deg) translate(0, 0) scale(1)",
transition: "all " + this.duration + "ms ease-in-out 0ms"
}));
this.next.css(k({
"z-index": "2",
left: 0,
top: 0,
opacity: 0,
transform: b[d][0],
transition: "all " + this.duration + "ms ease-in-out 0ms"
})).show();
this.next.one("webkitTransitionEnd transitionend oTransitionEnd msTransitionEnd", function() {
a.slides.filter(":visible").css(k({
transition: "",
transform: ""
}));
c.css(k({
transition: "",
transform: ""
})).hide()
});
setTimeout(function() {
a.next.css(k({
opacity: 1,
transform: "rotate(0deg) translate(0, 0) scale(1)"
}));
a.current.css(k({
opacity: 0,
transform: b[d][1]
}))
}, 10)
} else this.fade(this)
}
});
e.fn._reverse = [].reverse;
var s = function(a) {
for (var c, b, d = a.length; d; c = parseInt(Math.random() * d), b = a[--d], a[d] = a[c], a[c] = b);
return a
},
p = function(a, c, b) {
c = c || 0;
b = b || 0;
a.slicer = e("<li />").addClass("slices").css({
top: c,
left: b,
position: "absolute",
width: a.wrapper.width(),
height: a.ul.height(),
"z-index": 3
}).hide().appendTo(a.ul)
};
e.fn[j.prototype.name] = function() {
var a = arguments,
c = a[0] ? a[0] : null;
return this.each(function() {
var b = e(this);
if (j.prototype[c] && b.data(j.prototype.name) && "initialize" != c) b.data(j.prototype.name)[c].apply(b.data(j.prototype.name), Array.prototype.slice.call(a, 1));
else if (!c || e.isPlainObject(c)) {
var d = new j;
j.prototype.initialize && d.initialize.apply(d, e.merge([b], a));
b.data(j.prototype.name, d)
} else e.error("Method " + c + " does not exist on jQuery." + j.name)
})
}
})(jQuery); |
#3 JavaScript::Eval (size: 16548, repeated: 1) /* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */
/*
Lightbox Plugin is based on Fancybox (http://fancybox.net, Janis Skarnelis, MIT License)
*/
(function(b) {
var i, m, s, q, e, C, k, B, j, y, z, D, r = 0,
c = {},
o = [],
p = 0,
a = {},
g = [],
A = null,
t = new Image,
E, F = 1,
G = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,
K = /[^\.]\.(swf)\s*$/i,
H = /(\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)&?(.*)/,
L = /youtu\.be\/(.*)/,
I = /(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/,
M = /\.(mp4|ogv|webm|flv)(.*)?$/i,
u = 0,
v = "",
n, f, h = !1,
w = b.extend(b("<div/>")[0], {
prop: 0
});
_abort = function() {
s.hide();
t.onerror = t.onload = null;
A && A.abort();
m.empty()
};
_error = function() {
!1 === c.onError(o, r, c) ? (s.hide(), h = !1) : (c.titleShow = !1, c.width = "auto", c.height = "auto", m.html('<p id="lightbox-error">The requested content cannot be loaded.<br />Please try again later.</p>'), _process_inline())
};
_start = function() {
var d = o[r],
a, l, e, f, j, g;
_abort();
c = b.extend({}, i.defaults, "undefined" == typeof b(d).data(i.name) ? c : b(d).data(i.name));
b(d).attr("data-lightbox") && b.each(b(d).attr("data-lightbox").split(";"), function(a, d) {
var b = d.match(/\s*([A-Z_]*?)\s*:\s*(.+)\s*/i);
if (b && (c[b[1]] = b[2], "true" === c[b[1]] || "false" === c[b[1]])) c[b[1]] = eval(b[2])
});
g = c.onStart(o, r, c);
if (!1 === g) h = !1;
else {
"object" == typeof g && (c = b.extend(c, g));
e = c.title || (d.nodeName ? b(d).attr("title") : d.title) || "";
d.nodeName && !c.orig && (c.orig = b(d).children("img:first").length ? b(d).children("img:first") : b(d));
"" === e && (c.orig && c.titleFromAlt) && (e = c.orig.attr("alt"));
a = c.href || (d.nodeName ? b(d).attr("href") : d.href) || null;
if (/^(?:javascript)/i.test(a) || "#" == a) a = null;
c.type ? (l = c.type, a || (a = c.content)) : c.content ? l = "html" : a && (a.match(G) ? l = "image" : a.match(K) ? l = "swf" : a.match(M) ? l = "video" : a.match(H) ? (a = a.replace(H, "$1/embed/$2?$3").replace("/(.*)?$/", ""), l = "iframe") : a.match(L) ? (l = a.split("/"), a = "//www.youtube.com/embed/" + l[l.length - 1], l = "iframe") : a.match(I) ? (a = a.replace(I, "$1player.vimeo.com/video/$2"), l = "iframe") : l = -1 != a.indexOf("http://") && -1 == a.indexOf(location.hostname.toLowerCase()) ? "iframe" : 0 === a.indexOf("#wk-") ? window.wk_ajax_render_url ? "widget" : !1 : 0 === a.indexOf("#") ? "inline" : "ajax");
if (l) switch ("inline" == l && (d = a.substr(a.indexOf("#")), l = 0 < b(d).length ? "inline" : "ajax"), c.type = l, c.href = a, c.title = e, c.autoDimensions && ("iframe" !== c.type && "swf" !== c.type && "video" !== c.type && "widget" !== c.type) && (c.width = "auto", c.height = "auto"), c.modal && (c.overlayShow = !0, c.hideOnOverlayClick = !1, c.hideOnContentClick = !1, c.enableEscapeButton = !1, c.showCloseButton = !1), c.padding = parseInt(c.padding, 10), c.margin = parseInt(c.margin, 10), m.css("padding", c.padding + c.margin), b(".lightbox-inline-tmp").unbind("lightbox-cancel").bind("lightbox-change", function() {
b(this).replaceWith(k.children())
}), l) {
case "html":
m.html(c.content);
_process_inline();
break;
case "video":
h = !1;
c.scrolling = "no";
var n = "auto" == c.width ? 320 : c.width,
d = "auto" == c.height ? 240 : c.height;
e = [];
e.push('src="' + a + '"');
e.push('width="' + n + '"');
e.push('height="' + d + '"');
e.push('preload="none"');
"undefined" != b.type(c.autoplay) && e.push('autoplay="' + c.autoplay + '"');
"undefined" != b.type(c.controls) && e.push('controls="' + c.controls + '"');
"undefined" != b.type(c.loop) && e.push('loop="' + c.loop + '"');
"undefined" != b.type(c.poster) && e.push('poster="' + c.poster + '"');
m.html("<video " + e.join(" ") + " /></video>");
b.fn.mediaelementplayer && b("video", m).each(function() {
var a = new mejs.MediaElementPlayer(this);
n > b(window).width() && a.setPlayerSize("100%", "100%")
});
c.width = "auto";
c.height = "auto";
_process_inline();
break;
case "inline":
if (!0 === b(d).parent().is("#lightbox-content")) {
h = !1;
break
}
b('<div class="lightbox-inline-tmp" />').hide().insertBefore(b(d)).bind("lightbox-cleanup", function() {
b(this).replaceWith(k.children())
}).bind("lightbox-cancel", function() {
b(this).replaceWith(m.children())
});
b(d).appendTo(m);
_process_inline();
break;
case "image":
h = !1;
i.showActivity();
t = new Image;
t.onerror = function() {
_error()
};
t.onload = function() {
h = true;
t.onerror = t.onload = null;
_process_image()
};
t.src = a;
break;
case "swf":
c.scrolling = "no";
c.autoDimensions = !1;
f = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + c.width + '" height="' + c.height + '"><param name="movie" value="' + a + '"></param>';
j = "";
b.each(c.swf, function(a, d) {
f = f + ('<param name="' + a + '" value="' + d + '"></param>');
j = j + (" " + a + '="' + d + '"')
});
f += '<embed src="' + a + '" type="application/x-shockwave-flash" width="' + c.width + '" height="' + c.height + '"' + j + "></embed></object>";
m.html(f);
_process_inline();
break;
case "ajax":
h = !1;
i.showActivity();
c.ajax.win = c.ajax.success;
A = b.ajax(b.extend({}, c.ajax, {
url: a,
data: c.ajax.data || {},
error: function(a) {
a.status > 0 && _error()
},
success: function(d, b, e) {
if ((typeof e == "object" ? e : A).status == 200) {
if (typeof c.ajax.win == "function") {
g = c.ajax.win(a, d, b, e);
if (g === false) {
s.hide();
return
}
if (typeof g == "string" || typeof g == "object") d = g
}
m.html(d);
_process_inline()
}
}
}));
break;
case "widget":
h = !1;
c.autoDimensions = !1;
i.showActivity();
c.ajax.win = c.ajax.success;
A = b.ajax(b.extend({}, c.ajax, {
url: wk_ajax_render_url(a.split("-")[1]),
data: c.ajax.data || {},
error: function(a) {
a.status > 0 && _error()
},
success: function(d, e, l) {
if ((typeof l == "object" ? l : A).status == 200) {
if (typeof c.ajax.win == "function") {
g = c.ajax.win(a, d, e, l);
if (g === false) {
s.hide();
return
}
if (typeof g == "string" || typeof g == "object") d = g
}
m.html(d);
_process_inline();
$widgetkit.lazyload(b("#lightbox-content"))
}
}
}));
break;
case "iframe":
c.autoDimensions = !1, _show()
} else _error()
}
};
_process_inline = function() {
m.wrapInner('<div style="width:' + ("auto" == c.width ? "auto" : c.width + "px") + ";height:" + ("auto" == c.height ? "auto" : c.height + "px") + ";overflow: " + ("auto" == c.scrolling ? "auto" : "yes" == c.scrolling ? "scroll" : "hidden") + '"></div>');
c.width = m.width();
c.height = m.height();
_show()
};
_process_image = function() {
c.width = t.width;
c.height = t.height;
b("<img />").attr({
id: "lightbox-img",
src: t.src,
alt: c.title
}).appendTo(m);
_show()
};
_show = function() {
var d, J;
s.hide();
e.is(":visible") && !1 === a.onCleanup(g, p, a) ? (b.event.trigger("lightbox-cancel"), h = !1) : (h = !0, b(k.add(q)).unbind(), b(window).unbind("resize.fb scroll.fb"), b(document).unbind("keydown.fb"), e.is(":visible") && "outside" !== a.titlePosition && e.css("height", e.height()), g = o, p = r, a = c, a.overlayShow ? (q.css({
"background-color": a.overlayColor,
opacity: a.overlayOpacity,
cursor: a.hideOnOverlayClick ? "pointer" : "auto",
height: b(document).height()
}), q.is(":visible") || q.show()) : q.hide(), f = _get_zoom_to(), _process_title(), e.is(":visible")) ? (b(B.add(y).add(z)).hide(), d = e.position(), n = {
top: d.top,
left: d.left,
width: e.width(),
height: e.height()
}, J = n.width == f.width && n.height == f.height, k.fadeTo(a.changeFade, 0.3, function() {
var d = function() {
k.html(m.contents()).fadeTo(a.changeFade, 1, _finish)
};
b.event.trigger("lightbox-change");
k.empty().removeAttr("filter").css({
"border-width": a.padding,
width: f.width - a.padding * 2,
height: a.type == "image" || a.type == "swf" || a.type == "iframe" ? f.height - u - a.padding * 2 : "auto"
});
if (J) d();
else {
w.prop = 0;
b(w).animate({
prop: 1
}, {
duration: a.changeSpeed,
easing: a.easingChange,
step: _draw,
complete: d
})
}
})) : (e.removeAttr("style"), k.css("border-width", a.padding), k.css("-webkit-transform", "translateZ(0)"), "elastic" == a.transitionIn ? (n = _get_zoom_from(), k.html(m.contents()), e.show(), a.opacity && (f.opacity = 0), w.prop = 0, b(w).animate({
prop: 1
}, {
duration: a.speedIn,
easing: a.easingIn,
step: _draw,
complete: _finish
})) : ("inside" == a.titlePosition && 0 < u && j.show(), k.css({
width: f.width - 2 * a.padding,
height: "image" == a.type || "swf" == a.type || "iframe" == a.type ? f.height - u - 2 * a.padding : "auto"
}).html(m.contents()), e.css(f).fadeIn("none" == a.transitionIn ? 0 : a.speedIn, _finish)))
};
_format_title = function(d) {
return d && d.length ? '<div id="lightbox-title-' + a.titlePosition + '">' + d + "</div>" : !1
};
_process_title = function() {
v = a.title || "";
u = 0;
j.empty().removeAttr("style").removeClass();
if (!1 !== a.titleShow && (v = b.isFunction(a.titleFormat) ? a.titleFormat(v, g, p, a) : _format_title(v)) && "" !== v) switch (j.addClass("lightbox-title-" + a.titlePosition).html(v).appendTo("body").show(), a.titlePosition) {
case "inside":
j.css({
width: f.width - 2 * a.padding,
marginLeft: a.padding,
marginRight: a.padding
});
u = j.outerHeight(!0);
j.appendTo(C);
f.height += u;
break;
case "over":
j.css({
marginLeft: a.padding,
width: f.width - 2 * a.padding,
bottom: a.padding
}).appendTo(C);
break;
case "float":
j.css("left", -1 * parseInt((j.width() - f.width - 40) / 2, 10)).appendTo(e);
break;
default:
j.css({
width: f.width - 2 * a.padding,
paddingLeft: a.padding,
paddingRight: a.padding
}).appendTo(e)
}
j.hide()
};
_set_navigation = function() {
(a.enableEscapeButton || a.enableKeyboardNav) && b(document).bind("keydown.fb", function(d) {
if (27 == d.keyCode && a.enableEscapeButton) d.preventDefault(), i.close();
else if ((37 == d.keyCode || 39 == d.keyCode) && a.enableKeyboardNav && "INPUT" !== d.target.tagName && "TEXTAREA" !== d.target.tagName && "SELECT" !== d.target.tagName) d.preventDefault(), i[37 == d.keyCode ? "prev" : "next"]()
});
a.showNavArrows ? ((a.cyclic && 1 < g.length || 0 !== p) && y.show(), (a.cyclic && 1 < g.length || p != g.length - 1) && z.show()) : (y.hide(), z.hide())
};
_finish = function() {
b.support.opacity || (k.get(0).style.removeAttribute("filter"), e.get(0).style.removeAttribute("filter"));
e.css("height", "auto");
"image" !== a.type && ("swf" !== a.type && "iframe" !== a.type) && k.css("height", "auto");
v && v.length && j.show();
a.showCloseButton && B.show();
_set_navigation();
a.hideOnContentClick && k.bind("click", i.close);
a.hideOnOverlayClick && q.bind("click", i.close);
b(window).bind("resize.fb", i.resize);
a.centerOnScroll && b(window).bind("scroll.fb", i.center);
"iframe" == a.type && b('<iframe id="lightbox-frame" name="lightbox-frame' + (new Date).getTime() + '" frameborder="0" hspace="0" ' + (!b.support.opacity ? 'allowtransparency="true""' : "") + ' scrolling="' + c.scrolling + '" src="' + a.href + '"></iframe>').appendTo(k);
e.show();
h = !1;
i.center();
a.onComplete(g, p, a);
_preload_images()
};
_preload_images = function() {
var a, b;
g.length - 1 > p && (a = g[p + 1].href, "undefined" !== typeof a && a.match(G) && (b = new Image, b.src = a));
0 < p && (a = g[p - 1].href, "undefined" !== typeof a && a.match(G) && (b = new Image, b.src = a))
};
_draw = function(d) {
var b = {
width: parseInt(n.width + (f.width - n.width) * d, 10),
height: parseInt(n.height + (f.height - n.height) * d, 10),
top: parseInt(n.top + (f.top - n.top) * d, 10),
left: parseInt(n.left + (f.left - n.left) * d, 10)
};
"undefined" !== typeof f.opacity && (b.opacity = 0.5 > d ? 0.5 : d);
e.css(b);
k.css({
width: b.width - 2 * a.padding,
height: b.height - u * d - 2 * a.padding
})
};
_get_viewport = function() {
return [b(window).width() - 2 * a.margin, b(window).height() - 2 * a.margin, b(document).scrollLeft() + a.margin, b(document).scrollTop() + a.margin]
};
_get_zoom_to = function() {
var d = _get_viewport(),
b = {},
e = a.autoScale,
f = 2 * a.padding;
b.width = -1 < a.width.toString().indexOf("%") ? parseInt(d[0] * parseFloat(a.width) / 100, 10) : parseInt(a.width) + f;
b.height = -1 < a.height.toString().indexOf("%") ? parseInt(d[1] * parseFloat(a.height) / 100, 10) : parseInt(a.height) + f;
if (e && (b.width > d[0] || b.height > d[1])) if ("image" == c.type || "swf" == c.type) {
if (e = a.width / a.height, b.width > d[0] && (b.width = d[0], b.height = parseInt((b.width - f) / e + f, 10)), b.height > d[1]) b.height = d[1], b.width = parseInt((b.height - f) * e + f, 10)
} else b.width = Math.min(b.width, d[0]), b.height = Math.min(b.height, d[1]);
b.top = parseInt(Math.max(d[3] - 20, d[3] + 0.5 * (d[1] - b.height - 40)), 10);
b.left = parseInt(Math.max(d[2] - 20, d[2] + 0.5 * (d[0] - b.width - 40)), 10);
return b
};
_get_obj_pos = function(a) {
var b = a.offset();
b.top += parseInt(a.css("paddingTop"), 10) || 0;
b.left += parseInt(a.css("paddingLeft"), 10) || 0;
b.top += parseInt(a.css("border-top-width"), 10) || 0;
b.left += parseInt(a.css("border-left-width"), 10) || 0;
b.width = a.width();
b.height = a.height();
return b
};
_get_zoom_from = function() {
var d = c.orig ? b(c.orig) : !1,
e = {};
d && d.length ? (d = _get_obj_pos(d), e = {
width: d.width + 2 * a.padding,
height: d.height + 2 * a.padding,
top: d.top - a.padding - 20,
left: d.left - a.padding - 20
}) : (d = _get_viewport(), e = {
width: 2 * a.padding,
height: 2 * a.padding,
top: parseInt(d[3] + 0.5 * d[1], 10),
left: parseInt(d[2] + 0.5 * d[0], 10)
});
return e
};
_animate_loading = function() {
s.is(":visible") ? (b("div", s).css("top", -40 * F + "px"), F = (F + 1) % 12) : clearInterval(E)
};
var x = function() {};
x.prototype = b.extend(x.prototype, {
name: "lightbox",
defaults: {
padding: 10,
margin: 40,
opacity: !1,
modal: !1,
cyclic: !1,
scrolling: "auto",
width: 560,
height: 340,
autoScale: !0,
autoDimensions: !0,
centerOnScroll: !1,
ajax: {},
swf: {
wmode: "transparent"
},
hideOnOverlayClick: !0,
hideOnContentClick: !1,
overlayShow: !0,
overlayOpacity: 0.7,
overlayColor: "#777",
titleShow: !0,
titlePosition: "float",
titleFormat: null,
titleFromAlt: !1,
transitionIn: "fade",
transitionOut: "fade",
speedIn: 300,
speedOut: 300,
changeSpeed: 300,
changeFade: "fast",
easingIn: "swing",
easingOut: "swing",
showCloseButton: !0,
showNavArrows: !0,
enableEscapeButton: !0,
enableKeyboardNav: !0,
onStart: function() {},
onCancel: function() {},
onComplete: function() {},
onCleanup: function() {},
onClosed: function() {},
onError: function() {}
},
init: function() {
var d = this;
b("#lightbox-wrap").length || (b("body").append(m = b('<div id="lightbox-tmp"></div>'), s = b('<div id="lightbox-loading"><div></div></div>'), q = b('<div id="lightbox-overlay"></div>'), e = b('<div id="lightbox-wrap"></div>')), D = q.show().position(), q.hide(), 0 != D.top && q.css("top", -1 * D.top), C = b('<div id="lightbox-outer"></div>').appendTo(e), C.append(k = b('<div id="lightbox-content"></div>'), B = b('<a id="lightbox-close"></a>'), j = b('<div id="lightbox-title"></div>'), y = b('<a href="javascript:;" id="lightbox-left"><span id="lightbox-left-ico"></span></a>'), z = b('<a href="javascript:;" id="lightbox-right"><span id="lightbox-right-ico"></span></a>')), B.bind("click", this.close), s.bind("click", this.cancel), y.bind("click", function(a) {
a.preventDefault();
d.prev()
}), z.bind("click", function(a) {
a.preventDefault();
d.next()
}), b.fn.mousewheel && e.bind("mousewheel.fb", function(b, c) {
(h || "image" == a.type) && b.preventDefault();
d[0 < c ? "prev" : "next"]()
}))
},
open: function(a, c) {
var e;
if (!h) {
h = !0;
e = "undefined" !== typeof c ? c : {};
o = [];
r = parseInt(e.index, 10) || 0;
if (b.isArray(a)) {
for (var f = 0, g = a.length; f < g; f++)"object" == typeof a[f] ? b(a[f]).data(i.name, b.extend({}, e, a[f])) : a[f] = b({}).data(i.name, b.extend({
content: a[f]
}, e));
o = b.merge(o, a)
} else "object" == typeof a ? b(a).data(i.name, b.extend({}, e, a)) : a = b({}).data(i.name, b.extend({
content: a
}, e)), o.push(a);
if (r > o.length || 0 > r) r = 0;
_start()
}
},
showActivity: function() {
clearInterval(E);
s.show();
E = setInterval(_animate_loading, 66)
},
hideActivity: function() {
s.hide()
},
next: function() {
return this.pos(p + 1)
},
prev: function() {
return this.pos(p - 1)
},
pos: function(b) {
h || (b = parseInt(b), o = g, -1 < b && b < g.length ? (r = b, _start()) : a.cyclic && 1 < g.length && (r = b >= g.length ? 0 : g.length - 1, _start()))
},
cancel: function() {
h || (h = !0, b.event.trigger("lightbox-cancel"), _abort(), c.onCancel(o, r, c), h = !1)
},
close: function() {
function d() {
q.fadeOut("fast");
j.empty().hide();
e.hide();
b.event.trigger("lightbox-cleanup");
k.empty();
a.onClosed(g, p, a);
g = c = [];
p = r = 0;
a = c = {};
h = !1
}
if (!h && !e.is(":hidden")) if (h = !0, a && !1 === a.onCleanup(g, p, a)) h = !1;
else if (_abort(), b(B.add(y).add(z)).hide(), b(k.add(q)).unbind(), b(window).unbind("resize.fb scroll.fb"), b(document).unbind("keydown.fb"), k.find("iframe").attr("src", "about:blank"), "inside" !== a.titlePosition && j.empty(), e.stop(), "elastic" == a.transitionOut) {
n = _get_zoom_from();
var i = e.position();
f = {
top: i.top,
left: i.left,
width: e.width(),
height: e.height()
};
a.opacity && (f.opacity = 1);
j.empty().hide();
w.prop = 1;
b(w).animate({
prop: 0
}, {
duration: a.speedOut,
easing: a.easingOut,
step: _draw,
complete: d
})
} else e.fadeOut("none" == a.transitionOut ? 0 : a.speedOut, d)
},
resize: function() {
q.is(":visible") && q.css("height", b(document).height());
if ("image" == a.type) {
f = _get_zoom_to();
switch (a.titlePosition) {
case "float":
j.css("left", -1 * parseInt((j.width() - f.width - 40) / 2, 10));
break;
default:
j.css("width", f.width - 2 * a.padding)
}
e.is(":visible") && (pos = e.position(), n = {
top: pos.top,
left: pos.left,
width: e.width(),
height: e.height()
}, equal = n.width == f.width && n.height == f.height, k.css({
width: f.width - 2 * a.padding,
height: "image" == a.type || "swf" == a.type || "iframe" == a.type ? f.height - u - 2 * a.padding : "auto"
}), equal || (w.prop = 0, b(w).animate({
prop: 1
}, {
duration: a.changeSpeed,
easing: a.easingChange,
step: _draw
})))
}
i.center(!0)
},
center: function(b) {
var c, f;
if (!h && (f = !0 === b ? 1 : 0, c = _get_viewport(), f || !(e.width() > c[0] || e.height() > c[1]))) e.stop().animate({
top: parseInt(Math.max(c[3] - 20, c[3] + 0.5 * (c[1] - k.height() - 40) - a.padding)),
left: parseInt(Math.max(c[2] - 20, c[2] + 0.5 * (c[0] - k.width() - 40) - a.padding))
}, "number" == typeof b ? b : 200)
}
});
b.fn[x.prototype.name] = function() {
var a = arguments,
c = a[0] ? a[0] : {};
return this.each(function() {
b(this).data(x.prototype.name, c).unbind("click." + x.prototype.name).bind("click." + x.prototype.name, function(a) {
a.preventDefault();
h || (h = !0, b(this).blur(), o = [], r = 0, (a = b(this).attr("data-lightbox") || "") && (a = a.match(/group:([^;]+)/i)) ? (o = b('a[data-lightbox*="' + a[0] + '"], area[data-lightbox*="' + a[0] + '"]'), r = o.index(this)) : o.push(this), _start())
})
})
};
b(document).ready(function() {
i = new x;
i.init();
b[x.prototype.name] = i
})
})(jQuery); |
#4 JavaScript::Eval (size: 61396, repeated: 1) var mejs = mejs || {};
mejs.version = "2.9.5";
mejs.meIndex = 0;
mejs.plugins = {
silverlight: [{
version: [3, 0],
types: "video/mp4 video/m4v video/mov video/wmv audio/wma audio/m4a audio/mp3 audio/wav audio/mpeg".split(" ")
}],
flash: [{
version: [9, 0, 124],
types: "video/mp4 video/m4v video/mov video/flv video/rtmp video/x-flv audio/flv audio/x-flv audio/mp3 audio/m4a audio/mpeg video/youtube video/x-youtube".split(" ")
}],
youtube: [{
version: null,
types: ["video/youtube", "video/x-youtube"]
}],
vimeo: [{
version: null,
types: ["video/vimeo"]
}]
};
mejs.Utility = {
encodeUrl: function(b) {
return encodeURIComponent(b)
},
escapeHTML: function(b) {
return b.toString().split("&").join("&").split("<").join("<").split('"').join(""")
},
absolutizeUrl: function(b) {
var a = document.createElement("div");
a.innerHTML = '<a href="' + this.escapeHTML(b) + '">x</a>';
return a.firstChild.href
},
getScriptPath: function(b) {
for (var a = 0, c, d = "", e = "", f, g = document.getElementsByTagName("script"), j = g.length, h = b.length; a < j; a++) {
f = g[a].src;
for (c = 0; c < h; c++) if (e = b[c], -1 < f.indexOf(e)) {
d = f.substring(0, f.indexOf(e));
break
}
if ("" !== d) break
}
return d
},
secondsToTimeCode: function(b, a, c, d) {
"undefined" == typeof c ? c = !1 : "undefined" == typeof d && (d = 25);
var e = Math.floor(b / 3600) % 24,
f = Math.floor(b / 60) % 60,
g = Math.floor(b % 60),
b = Math.floor((b % 1 * d).toFixed(3));
return (a || 0 < e ? (10 > e ? "0" + e : e) + ":" : "") + (10 > f ? "0" + f : f) + ":" + (10 > g ? "0" + g : g) + (c ? ":" + (10 > b ? "0" + b : b) : "")
},
timeCodeToSeconds: function(b, a, c, d) {
"undefined" == typeof c ? c = !1 : "undefined" == typeof d && (d = 25);
var b = b.split(":"),
a = parseInt(b[0], 10),
e = parseInt(b[1], 10),
f = parseInt(b[2], 10),
g = 0;
c && (g = parseInt(b[3]) / d);
return 3600 * a + 60 * e + f + g
},
convertSMPTEtoSeconds: function(b) {
if ("string" != typeof b) return !1;
for (var b = b.replace(",", "."), a = 0, c = -1 != b.indexOf(".") ? b.split(".")[1].length : 0, d = 1, b = b.split(":").reverse(), e = 0; e < b.length; e++) d = 1, 0 < e && (d = Math.pow(60, e)), a += Number(b[e]) * d;
return Number(a.toFixed(c))
},
removeSwf: function(b) {
var a = document.getElementById(b);
a && "OBJECT" == a.nodeName && (mejs.MediaFeatures.isIE ? (a.style.display = "none", function() {
4 == a.readyState ? mejs.Utility.removeObjectInIE(b) : setTimeout(arguments.callee, 10)
}()) : a.parentNode.removeChild(a))
},
removeObjectInIE: function(b) {
if (b = document.getElementById(b)) {
for (var a in b)"function" == typeof b[a] && (b[a] = null);
b.parentNode.removeChild(b)
}
}
};
mejs.PluginDetector = {
hasPluginVersion: function(b, a) {
var c = this.plugins[b];
a[1] = a[1] || 0;
a[2] = a[2] || 0;
return c[0] > a[0] || c[0] == a[0] && c[1] > a[1] || c[0] == a[0] && c[1] == a[1] && c[2] >= a[2] ? !0 : !1
},
nav: window.navigator,
ua: window.navigator.userAgent.toLowerCase(),
plugins: [],
addPlugin: function(b, a, c, d, e) {
this.plugins[b] = this.detectPlugin(a, c, d, e)
},
detectPlugin: function(b, a, c, d) {
var e = [0, 0, 0],
f;
if ("undefined" != typeof this.nav.plugins && "object" == typeof this.nav.plugins[b]) {
if ((c = this.nav.plugins[b].description) && !("undefined" != typeof this.nav.mimeTypes && this.nav.mimeTypes[a] && !this.nav.mimeTypes[a].enabledPlugin)) {
e = c.replace(b, "").replace(/^\s+/, "").replace(/\sr/gi, ".").split(".");
for (b = 0; b < e.length; b++) e[b] = parseInt(e[b].match(/\d+/), 10)
}
} else if ("undefined" != typeof window.ActiveXObject) try {
(f = new ActiveXObject(c)) && (e = d(f))
} catch (g) {}
return e
}
};
mejs.PluginDetector.addPlugin("flash", "Shockwave Flash", "application/x-shockwave-flash", "ShockwaveFlash.ShockwaveFlash", function(b) {
var a = [];
if (b = b.GetVariable("$version")) b = b.split(" ")[1].split(","), a = [parseInt(b[0], 10), parseInt(b[1], 10), parseInt(b[2], 10)];
return a
});
mejs.PluginDetector.addPlugin("silverlight", "Silverlight Plug-In", "application/x-silverlight-2", "AgControl.AgControl", function(b) {
var a = [0, 0, 0, 0],
c = function(a, c, b, g) {
for (; a.isVersionSupported(c[0] + "." + c[1] + "." + c[2] + "." + c[3]);) c[b] += g;
c[b] -= g
};
c(b, a, 0, 1);
c(b, a, 1, 1);
c(b, a, 2, 1E4);
c(b, a, 2, 1E3);
c(b, a, 2, 100);
c(b, a, 2, 10);
c(b, a, 2, 1);
c(b, a, 3, 1);
return a
});
mejs.MediaFeatures = {
init: function() {
var b = this,
a = document,
c = mejs.PluginDetector.nav,
d = mejs.PluginDetector.ua.toLowerCase(),
e, f = ["source", "track", "audio", "video"];
b.isiPad = null !== d.match(/ipad/i);
b.isiPhone = null !== d.match(/iphone/i);
b.isiOS = b.isiPhone || b.isiPad;
b.isAndroid = null !== d.match(/android/i);
b.isBustedAndroid = null !== d.match(/android 2\.[12]/);
b.isIE = -1 != c.appName.toLowerCase().indexOf("microsoft");
b.isChrome = null !== d.match(/chrome/gi);
b.isFirefox = null !== d.match(/firefox/gi);
b.isWebkit = null !== d.match(/webkit/gi);
b.isGecko = null !== d.match(/gecko/gi) && !b.isWebkit;
b.isOpera = null !== d.match(/opera/gi);
b.hasTouch = "ontouchstart" in window;
for (c = 0; c < f.length; c++) e = document.createElement(f[c]);
b.supportsMediaTag = "undefined" !== typeof e.canPlayType || b.isBustedAndroid;
b.hasSemiNativeFullScreen = "undefined" !== typeof e.webkitEnterFullscreen;
b.hasWebkitNativeFullScreen = "undefined" !== typeof e.webkitRequestFullScreen;
b.hasMozNativeFullScreen = "undefined" !== typeof e.mozRequestFullScreen;
b.hasTrueNativeFullScreen = b.hasWebkitNativeFullScreen || b.hasMozNativeFullScreen;
b.nativeFullScreenEnabled = b.hasTrueNativeFullScreen;
b.hasMozNativeFullScreen && (b.nativeFullScreenEnabled = e.mozFullScreenEnabled);
this.isChrome && (b.hasSemiNativeFullScreen = !1);
b.hasTrueNativeFullScreen && (b.fullScreenEventName = b.hasWebkitNativeFullScreen ? "webkitfullscreenchange" : "mozfullscreenchange", b.isFullScreen = function() {
if (e.mozRequestFullScreen) return a.mozFullScreen;
if (e.webkitRequestFullScreen) return a.webkitIsFullScreen
}, b.requestFullScreen = function(a) {
b.hasWebkitNativeFullScreen ? a.webkitRequestFullScreen() : b.hasMozNativeFullScreen && a.mozRequestFullScreen()
}, b.cancelFullScreen = function() {
b.hasWebkitNativeFullScreen ? document.webkitCancelFullScreen() : b.hasMozNativeFullScreen && document.mozCancelFullScreen()
});
b.hasSemiNativeFullScreen && d.match(/mac os x 10_5/i) && (b.hasNativeFullScreen = !1, b.hasSemiNativeFullScreen = !1)
}
};
mejs.MediaFeatures.init();
mejs.HtmlMediaElement = {
pluginType: "native",
isFullScreen: !1,
setCurrentTime: function(b) {
this.currentTime = b
},
setMuted: function(b) {
this.muted = b
},
setVolume: function(b) {
this.volume = b
},
stop: function() {
this.pause()
},
setSrc: function(b) {
for (var a = this.getElementsByTagName("source"); 0 < a.length;) this.removeChild(a[0]);
if ("string" == typeof b) this.src = b;
else for (var c, a = 0; a < b.length; a++) c = b[a], this.canPlayType(c.type) && (this.src = c.src)
},
setVideoSize: function(b, a) {
this.width = b;
this.height = a
}
};
mejs.PluginMediaElement = function(b, a, c) {
this.id = b;
this.pluginType = a;
this.src = c;
this.events = {}
};
mejs.PluginMediaElement.prototype = {
pluginElement: null,
pluginType: "",
isFullScreen: !1,
playbackRate: -1,
defaultPlaybackRate: -1,
seekable: [],
played: [],
paused: !0,
ended: !1,
seeking: !1,
duration: 0,
error: null,
tagName: "",
muted: !1,
volume: 1,
currentTime: 0,
play: function() {
null != this.pluginApi && ("youtube" == this.pluginType ? this.pluginApi.playVideo() : this.pluginApi.playMedia(), this.paused = !1)
},
load: function() {
null != this.pluginApi && ("youtube" != this.pluginType && this.pluginApi.loadMedia(), this.paused = !1)
},
pause: function() {
null != this.pluginApi && ("youtube" == this.pluginType ? this.pluginApi.pauseVideo() : this.pluginApi.pauseMedia(), this.paused = !0)
},
stop: function() {
null != this.pluginApi && ("youtube" == this.pluginType ? this.pluginApi.stopVideo() : this.pluginApi.stopMedia(), this.paused = !0)
},
canPlayType: function(b) {
var a, c, d, e = mejs.plugins[this.pluginType];
for (a = 0; a < e.length; a++) if (d = e[a], mejs.PluginDetector.hasPluginVersion(this.pluginType, d.version)) for (c = 0; c < d.types.length; c++) if (b == d.types[c]) return !0;
return !1
},
positionFullscreenButton: function(b, a, c) {
null != this.pluginApi && this.pluginApi.positionFullscreenButton && this.pluginApi.positionFullscreenButton(b, a, c)
},
hideFullscreenButton: function() {
null != this.pluginApi && this.pluginApi.hideFullscreenButton && this.pluginApi.hideFullscreenButton()
},
setSrc: function(b) {
if ("string" == typeof b) this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(b)), this.src = mejs.Utility.absolutizeUrl(b);
else {
var a, c;
for (a = 0; a < b.length; a++) c = b[a], this.canPlayType(c.type) && (this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src)), this.src = mejs.Utility.absolutizeUrl(b))
}
},
setCurrentTime: function(b) {
null != this.pluginApi && ("youtube" == this.pluginType ? this.pluginApi.seekTo(b) : this.pluginApi.setCurrentTime(b), this.currentTime = b)
},
setVolume: function(b) {
null != this.pluginApi && ("youtube" == this.pluginType ? this.pluginApi.setVolume(100 * b) : this.pluginApi.setVolume(b), this.volume = b)
},
setMuted: function(b) {
null != this.pluginApi && ("youtube" == this.pluginType ? (b ? this.pluginApi.mute() : this.pluginApi.unMute(), this.muted = b, this.dispatchEvent("volumechange")) : this.pluginApi.setMuted(b), this.muted = b)
},
setVideoSize: function(b, a) {
this.pluginElement.style && (this.pluginElement.style.width = b + "px", this.pluginElement.style.height = a + "px");
null != this.pluginApi && this.pluginApi.setVideoSize && this.pluginApi.setVideoSize(b, a)
},
setFullscreen: function(b) {
null != this.pluginApi && this.pluginApi.setFullscreen && this.pluginApi.setFullscreen(b)
},
enterFullScreen: function() {
null != this.pluginApi && this.pluginApi.setFullscreen && this.setFullscreen(!0)
},
exitFullScreen: function() {
null != this.pluginApi && this.pluginApi.setFullscreen && this.setFullscreen(!1)
},
addEventListener: function(b, a) {
this.events[b] = this.events[b] || [];
this.events[b].push(a)
},
removeEventListener: function(b, a) {
if (!b) return this.events = {}, !0;
var c = this.events[b];
if (!c) return !0;
if (!a) return this.events[b] = [], !0;
for (i = 0; i < c.length; i++) if (c[i] === a) return this.events[b].splice(i, 1), !0;
return !1
},
dispatchEvent: function(b) {
var a, c, d = this.events[b];
if (d) {
c = Array.prototype.slice.call(arguments, 1);
for (a = 0; a < d.length; a++) d[a].apply(null, c)
}
},
attributes: {},
hasAttribute: function(b) {
return b in this.attributes
},
removeAttribute: function(b) {
delete this.attributes[b]
},
getAttribute: function(b) {
return this.hasAttribute(b) ? this.attributes[b] : ""
},
setAttribute: function(b, a) {
this.attributes[b] = a
},
remove: function() {
mejs.Utility.removeSwf(this.pluginElement.id)
}
};
mejs.MediaPluginBridge = {
pluginMediaElements: {},
htmlMediaElements: {},
registerPluginElement: function(b, a, c) {
this.pluginMediaElements[b] = a;
this.htmlMediaElements[b] = c
},
initPlugin: function(b) {
var a = this.pluginMediaElements[b],
c = this.htmlMediaElements[b];
if (a) {
switch (a.pluginType) {
case "flash":
a.pluginElement = a.pluginApi = document.getElementById(b);
break;
case "silverlight":
a.pluginElement = document.getElementById(a.id), a.pluginApi = a.pluginElement.Content.MediaElementJS
}
null != a.pluginApi && a.success && a.success(a, c)
}
},
fireEvent: function(b, a, c) {
var d, e, b = this.pluginMediaElements[b];
b.ended = !1;
b.paused = !0;
a = {
type: a,
target: b
};
for (d in c) b[d] = c[d], a[d] = c[d];
e = c.bufferedTime || 0;
a.target.buffered = a.buffered = {
start: function() {
return 0
},
end: function() {
return e
},
length: 1
};
b.dispatchEvent(a.type, a)
}
};
mejs.MediaElementDefaults = {
mode: "auto",
plugins: ["flash", "silverlight", "youtube", "vimeo"],
enablePluginDebug: !1,
type: "",
pluginPath: mejs.Utility.getScriptPath(["mediaelement.js", "mediaelement.min.js", "mediaelement-and-player.js", "mediaelement-and-player.min.js"]),
flashName: "flashmediaelement.swf",
flashStreamer: "",
enablePluginSmoothing: !1,
silverlightName: "silverlightmediaelement.xap",
defaultVideoWidth: 480,
defaultVideoHeight: 270,
pluginWidth: -1,
pluginHeight: -1,
pluginVars: [],
timerRate: 250,
startVolume: 0.8,
success: function() {},
error: function() {}
};
mejs.MediaElement = function(b, a) {
return mejs.HtmlMediaElementShim.create(b, a)
};
mejs.HtmlMediaElementShim = {
create: function(b, a) {
var c = mejs.MediaElementDefaults,
d = "string" == typeof b ? document.getElementById(b) : b,
e = d.tagName.toLowerCase(),
f = "audio" === e || "video" === e,
g = f ? d.getAttribute("src") : d.getAttribute("href"),
e = d.getAttribute("poster"),
j = d.getAttribute("autoplay"),
h = d.getAttribute("preload"),
l = d.getAttribute("controls"),
k;
for (k in a) c[k] = a[k];
e = "undefined" == typeof e || null === e ? "" : e;
h = "undefined" == typeof h || null === h || "false" === h ? "none" : h;
j = !("undefined" == typeof j || null === j || "false" === j);
l = !("undefined" == typeof l || null === l || "false" === l);
k = this.determinePlayback(d, c, mejs.MediaFeatures.supportsMediaTag, f, "undefined" == typeof g || null === g || "" == g ? null : g);
k.url = null !== k.url ? mejs.Utility.absolutizeUrl(k.url) : "";
if ("native" == k.method) return mejs.MediaFeatures.isBustedAndroid && (d.src = k.url, d.addEventListener("click", function() {
d.play()
}, !1)), this.updateNative(k, c, j, h);
if ("" !== k.method) return this.createPlugin(k, c, e, j, h, l);
this.createErrorMessage(k, c, e);
return this
},
determinePlayback: function(b, a, c, d, e) {
var f = [],
g, j, h = {
method: "",
url: "",
htmlMediaElement: b,
isVideo: "audio" != b.tagName.toLowerCase()
},
l, k;
if ("undefined" != typeof a.type && "" !== a.type) if ("string" == typeof a.type) f.push({
type: a.type,
url: e
});
else for (g = 0; g < a.type.length; g++) f.push({
type: a.type[g],
url: e
});
else if (null !== e) j = this.formatType(e, b.getAttribute("type")), f.push({
type: j,
url: e
});
else for (g = 0; g < b.childNodes.length; g++) j = b.childNodes[g], 1 == j.nodeType && "source" == j.tagName.toLowerCase() && (e = j.getAttribute("src"), j = this.formatType(e, j.getAttribute("type")), f.push({
type: j,
url: e
}));
!d && (0 < f.length && null !== f[0].url && -1 < this.getTypeFromFile(f[0].url).indexOf("audio")) && (h.isVideo = !1);
mejs.MediaFeatures.isBustedAndroid && (b.canPlayType = function(a) {
return a.match(/video\/(mp4|m4v)/gi) !== null ? "maybe" : ""
});
if (c && ("auto" === a.mode || "auto_plugin" === a.mode || "native" === a.mode)) {
d || (g = document.createElement(h.isVideo ? "video" : "audio"), b.parentNode.insertBefore(g, b), b.style.display = "none", h.htmlMediaElement = b = g);
for (g = 0; g < f.length; g++) if ("" !== b.canPlayType(f[g].type).replace(/no/, "") || "" !== b.canPlayType(f[g].type.replace(/mp3/, "mpeg")).replace(/no/, "")) {
h.method = "native";
h.url = f[g].url;
break
}
if ("native" === h.method && (null !== h.url && (b.src = h.url), "auto_plugin" !== a.mode)) return h
}
if ("auto" === a.mode || "auto_plugin" === a.mode || "shim" === a.mode) for (g = 0; g < f.length; g++) {
j = f[g].type;
for (b = 0; b < a.plugins.length; b++) {
e = a.plugins[b];
l = mejs.plugins[e];
for (c = 0; c < l.length; c++) if (k = l[c], null == k.version || mejs.PluginDetector.hasPluginVersion(e, k.version)) for (d = 0; d < k.types.length; d++) if (j == k.types[d]) return h.method = e, h.url = f[g].url, h
}
}
if ("auto_plugin" === a.mode && "native" === h.method) return h;
"" === h.method && 0 < f.length && (h.url = f[0].url);
return h
},
formatType: function(b, a) {
return b && !a ? this.getTypeFromFile(b) : a && ~a.indexOf(";") ? a.substr(0, a.indexOf(";")) : a
},
getTypeFromFile: function(b) {
b = b.substring(b.lastIndexOf(".") + 1);
return (/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(b) ? "video" : "audio") + "/" + this.getTypeFromExtension(b)
},
getTypeFromExtension: function(b) {
switch (b) {
case "mp4":
case "m4v":
return "mp4";
case "webm":
case "webma":
case "webmv":
return "webm";
case "ogg":
case "oga":
case "ogv":
return "ogg";
default:
return b
}
},
createErrorMessage: function(b, a, c) {
var d = b.htmlMediaElement,
e = document.createElement("div");
e.className = "me-cannotplay";
try {
e.style.width = d.width + "px", e.style.height = d.height + "px"
} catch (f) {}
e.innerHTML = "" !== c ? '<a href="' + b.url + '"><img src="' + c + '" width="100%" height="100%" /></a>' : '<a href="' + b.url + '"><span>Download File</span></a>';
d.parentNode.insertBefore(e, d);
d.style.display = "none";
a.error(d)
},
createPlugin: function(b, a, c, d, e, f) {
var c = b.htmlMediaElement,
g = 1,
j = 1,
h = "me_" + b.method + "_" + mejs.meIndex++,
l = new mejs.PluginMediaElement(h, b.method, b.url),
k = document.createElement("div"),
m;
l.tagName = c.tagName;
for (m = 0; m < c.attributes.length; m++) {
var n = c.attributes[m];
!0 == n.specified && l.setAttribute(n.name, n.value)
}
for (m = c.parentNode; null !== m && "body" != m.tagName.toLowerCase();) {
if ("p" == m.parentNode.tagName.toLowerCase()) {
m.parentNode.parentNode.insertBefore(m, m.parentNode);
break
}
m = m.parentNode
}
b.isVideo ? (g = 0 < a.videoWidth ? a.videoWidth : null !== c.getAttribute("width") ? c.getAttribute("width") : a.defaultVideoWidth, j = 0 < a.videoHeight ? a.videoHeight : null !== c.getAttribute("height") ? c.getAttribute("height") : a.defaultVideoHeight, g = mejs.Utility.encodeUrl(g), j = mejs.Utility.encodeUrl(j)) : a.enablePluginDebug && (g = 320, j = 240);
l.success = a.success;
mejs.MediaPluginBridge.registerPluginElement(h, l, c);
k.className = "me-plugin";
k.id = h + "_container";
b.isVideo ? c.parentNode.insertBefore(k, c) : document.body.insertBefore(k, document.body.childNodes[0]);
d = ["id=" + h, "isvideo=" + (b.isVideo ? "true" : "false"), "autoplay=" + (d ? "true" : "false"), "preload=" + e, "width=" + g, "startvolume=" + a.startVolume, "timerrate=" + a.timerRate, "flashstreamer=" + a.flashStreamer, "height=" + j];
null !== b.url && ("flash" == b.method ? d.push("file=" + mejs.Utility.encodeUrl(b.url)) : d.push("file=" + b.url));
a.enablePluginDebug && d.push("debug=true");
a.enablePluginSmoothing && d.push("smoothing=true");
f && d.push("controls=true");
a.pluginVars && (d = d.concat(a.pluginVars));
switch (b.method) {
case "silverlight":
k.innerHTML = '<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="' + h + '" name="' + h + '" width="' + g + '" height="' + j + '"><param name="initParams" value="' + d.join(",") + '" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="' + a.pluginPath + a.silverlightName + '" /></object>';
break;
case "flash":
mejs.MediaFeatures.isIE ? (b = document.createElement("div"), k.appendChild(b), b.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="' + h + '" width="' + g + '" height="' + j + '"><param name="movie" value="' + a.pluginPath + a.flashName + "?x=" + new Date + '" /><param name="flashvars" value="' + d.join("&") + '" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>') : k.innerHTML = '<embed id="' + h + '" name="' + h + '" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="' + a.pluginPath + a.flashName + '" flashvars="' + d.join("&") + '" width="' + g + '" height="' + j + '"></embed>';
break;
case "youtube":
a = b.url.substr(b.url.lastIndexOf("=") + 1);
youtubeSettings = {
container: k,
containerId: k.id,
pluginMediaElement: l,
pluginId: h,
videoId: a,
height: j,
width: g
};
mejs.PluginDetector.hasPluginVersion("flash", [10, 0, 0]) ? mejs.YouTubeApi.createFlash(youtubeSettings) : mejs.YouTubeApi.enqueueIframe(youtubeSettings);
break;
case "vimeo":
l.vimeoid = b.url.substr(b.url.lastIndexOf("/") + 1), k.innerHTML = '<object width="' + g + '" height="' + j + '"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="api=1" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=' + l.vimeoid + '&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" /><embed src="//vimeo.com/moogaloop.swf?api=1&clip_id=' + l.vimeoid + '&server=vimeo.com&show_title=0&show_byline=0&show_portrait=0&color=00adef&fullscreen=1&autoplay=0&loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="' + g + '" height="' + j + '"></embed></object>'
}
c.style.display = "none";
return l
},
updateNative: function(b, a) {
var c = b.htmlMediaElement,
d;
for (d in mejs.HtmlMediaElement) c[d] = mejs.HtmlMediaElement[d];
a.success(c, c);
return c
}
};
mejs.YouTubeApi = {
isIframeStarted: !1,
isIframeLoaded: !1,
loadIframeApi: function() {
if (!this.isIframeStarted) {
var b = document.createElement("script");
b.src = "http://www.youtube.com/player_api";
var a = document.getElementsByTagName("script")[0];
a.parentNode.insertBefore(b, a);
this.isIframeStarted = !0
}
},
iframeQueue: [],
enqueueIframe: function(b) {
this.isLoaded ? this.createIframe(b) : (this.loadIframeApi(), this.iframeQueue.push(b))
},
createIframe: function(b) {
var a = b.pluginMediaElement,
c = new YT.Player(b.containerId, {
height: b.height,
width: b.width,
videoId: b.videoId,
playerVars: {
controls: 0
},
events: {
onReady: function() {
b.pluginMediaElement.pluginApi = c;
mejs.MediaPluginBridge.initPlugin(b.pluginId);
setInterval(function() {
mejs.YouTubeApi.createEvent(c, a, "timeupdate")
}, 250)
},
onStateChange: function(b) {
mejs.YouTubeApi.handleStateChange(b.data, c, a)
}
}
})
},
createEvent: function(b, a, c) {
c = {
type: c,
target: a
};
if (b && b.getDuration) {
a.currentTime = c.currentTime = b.getCurrentTime();
a.duration = c.duration = b.getDuration();
c.paused = a.paused;
c.ended = a.ended;
c.muted = b.isMuted();
c.volume = b.getVolume() / 100;
c.bytesTotal = b.getVideoBytesTotal();
c.bufferedBytes = b.getVideoBytesLoaded();
var d = c.bufferedBytes / c.bytesTotal * c.duration;
c.target.buffered = c.buffered = {
start: function() {
return 0
},
end: function() {
return d
},
length: 1
}
}
a.dispatchEvent(c.type, c)
},
iFrameReady: function() {
for (this.isIframeLoaded = this.isLoaded = !0; 0 < this.iframeQueue.length;) this.createIframe(this.iframeQueue.pop())
},
flashPlayers: {},
createFlash: function(b) {
this.flashPlayers[b.pluginId] = b;
var a, c = "http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=" + b.pluginId + "&version=3&autoplay=0&controls=0&modestbranding=1&loop=0";
mejs.MediaFeatures.isIE ? (a = document.createElement("div"), b.container.appendChild(a), a.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="' + b.pluginId + '" width="' + b.width + '" height="' + b.height + '"><param name="movie" value="' + c + '" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>') : b.container.innerHTML = '<object type="application/x-shockwave-flash" id="' + b.pluginId + '" data="' + c + '" width="' + b.width + '" height="' + b.height + '" style="visibility: visible; "><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'
},
flashReady: function(b) {
var a = this.flashPlayers[b],
c = document.getElementById(b),
d = a.pluginMediaElement;
d.pluginApi = d.pluginElement = c;
mejs.MediaPluginBridge.initPlugin(b);
c.cueVideoById(a.videoId);
b = a.containerId + "_callback";
window[b] = function(a) {
mejs.YouTubeApi.handleStateChange(a, c, d)
};
c.addEventListener("onStateChange", b);
setInterval(function() {
mejs.YouTubeApi.createEvent(c, d, "timeupdate")
}, 250)
},
handleStateChange: function(b, a, c) {
switch (b) {
case -1:
c.paused = !0;
c.ended = !0;
mejs.YouTubeApi.createEvent(a, c, "loadedmetadata");
break;
case 0:
c.paused = !1;
c.ended = !0;
mejs.YouTubeApi.createEvent(a, c, "ended");
break;
case 1:
c.paused = !1;
c.ended = !1;
mejs.YouTubeApi.createEvent(a, c, "play");
mejs.YouTubeApi.createEvent(a, c, "playing");
break;
case 2:
c.paused = !0;
c.ended = !1;
mejs.YouTubeApi.createEvent(a, c, "pause");
break;
case 3:
mejs.YouTubeApi.createEvent(a, c, "progress")
}
}
};
function onYouTubePlayerAPIReady() {
mejs.YouTubeApi.iFrameReady()
}
function onYouTubePlayerReady(b) {
mejs.YouTubeApi.flashReady(b)
}
window.mejs = mejs;
window.MediaElement = mejs.MediaElement;
"undefined" != typeof jQuery ? mejs.$ = jQuery : "undefined" != typeof ender && (mejs.$ = ender);
(function(b) {
mejs.MepDefaults = {
poster: "",
defaultVideoWidth: 480,
defaultVideoHeight: 270,
videoWidth: -1,
videoHeight: -1,
defaultAudioWidth: 400,
defaultAudioHeight: 30,
defaultSeekBackwardInterval: function(a) {
return a.duration * 0.05
},
defaultSeekForwardInterval: function(a) {
return a.duration * 0.05
},
audioWidth: -1,
audioHeight: -1,
startVolume: 0.8,
loop: false,
enableAutosize: true,
alwaysShowHours: false,
showTimecodeFrameCount: false,
framesPerSecond: 25,
autosizeProgress: true,
alwaysShowControls: false,
iPadUseNativeControls: false,
iPhoneUseNativeControls: false,
AndroidUseNativeControls: false,
features: ["playpause", "current", "progress", "duration", "tracks", "volume", "fullscreen"],
isVideo: true,
enableKeyboard: true,
pauseOtherPlayers: true,
keyActions: [{
keys: [32, 179],
action: function(a, c) {
c.paused || c.ended ? c.play() : c.pause()
}
}, {
keys: [38],
action: function(a, c) {
var b = Math.min(c.volume + 0.1, 1);
c.setVolume(b)
}
}, {
keys: [40],
action: function(a, c) {
var b = Math.max(c.volume - 0.1, 0);
c.setVolume(b)
}
}, {
keys: [37, 227],
action: function(a, b) {
if (!isNaN(b.duration) && b.duration > 0) {
if (a.isVideo) {
a.showControls();
a.startControlsTimer()
}
var d = Math.max(b.currentTime - a.options.defaultSeekBackwardInterval(b), 0);
b.setCurrentTime(d)
}
}
}, {
keys: [39, 228],
action: function(a, b) {
if (!isNaN(b.duration) && b.duration > 0) {
if (a.isVideo) {
a.showControls();
a.startControlsTimer()
}
var d = Math.min(b.currentTime + a.options.defaultSeekForwardInterval(b), b.duration);
b.setCurrentTime(d)
}
}
}, {
keys: [70],
action: function(a) {
typeof a.enterFullScreen != "undefined" && (a.isFullScreen ? a.exitFullScreen() : a.enterFullScreen())
}
}]
};
mejs.mepIndex = 0;
mejs.players = [];
mejs.MediaElementPlayer = function(a, c) {
if (!(this instanceof mejs.MediaElementPlayer)) return new mejs.MediaElementPlayer(a, c);
this.$media = this.$node = b(a);
this.node = this.media = this.$media[0];
if (typeof this.node.player != "undefined") return this.node.player;
this.node.player = this;
typeof c == "undefined" && (c = this.$node.data("mejsoptions"));
this.options = b.extend({}, mejs.MepDefaults, c);
mejs.players.push(this);
this.init();
return this
};
mejs.MediaElementPlayer.prototype = {
hasFocus: false,
controlsAreVisible: true,
init: function() {
var a = this,
c = mejs.MediaFeatures,
d = b.extend(true, {}, a.options, {
success: function(b, c) {
a.meReady(b, c)
},
error: function(b) {
a.handleError(b)
}
}),
e = a.media.tagName.toLowerCase();
a.isDynamic = e !== "audio" && e !== "video";
a.isVideo = a.isDynamic ? a.options.isVideo : e !== "audio" && a.options.isVideo;
if (c.isiPad && a.options.iPadUseNativeControls || c.isiPhone && a.options.iPhoneUseNativeControls) {
a.$media.attr("controls", "controls");
if (c.isiPad && a.media.getAttribute("autoplay") !== null) {
a.media.load();
a.media.play()
}
} else if (!c.isAndroid || !a.AndroidUseNativeControls) {
a.$media.removeAttr("controls");
a.id = "mep_" + mejs.mepIndex++;
a.container = b('<div id="' + a.id + '" class="mejs-container"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media);
a.container.addClass((c.isAndroid ? "mejs-android " : "") + (c.isiOS ? "mejs-ios " : "") + (c.isiPad ? "mejs-ipad " : "") + (c.isiPhone ? "mejs-iphone " : "") + (a.isVideo ? "mejs-video " : "mejs-audio "));
if (c.isiOS) {
c = a.$media.clone();
a.container.find(".mejs-mediaelement").append(c);
a.$media.remove();
a.$node = a.$media = c;
a.node = a.media = c[0]
} else a.container.find(".mejs-mediaelement").append(a.$media);
a.controls = a.container.find(".mejs-controls");
a.layers = a.container.find(".mejs-layers");
c = a.isVideo ? "video" : "audio";
e = c.substring(0, 1).toUpperCase() + c.substring(1);
a.width = a.options[c + "Width"] > 0 || a.options[c + "Width"].toString().indexOf("%") > -1 ? a.options[c + "Width"] : a.media.style.width !== "" && a.media.style.width !== null ? a.media.style.width : a.media.getAttribute("width") !== null ? a.$media.attr("width") : a.options["default" + e + "Width"];
a.height = a.options[c + "Height"] > 0 || a.options[c + "Height"].toString().indexOf("%") > -1 ? a.options[c + "Height"] : a.media.style.height !== "" && a.media.style.height !== null ? a.media.style.height : a.$media[0].getAttribute("height") !== null ? a.$media.attr("height") : a.options["default" + e + "Height"];
a.setPlayerSize(a.width, a.height);
d.pluginWidth = a.height;
d.pluginHeight = a.width
}
mejs.MediaElement(a.$media[0], d)
},
showControls: function(a) {
var b = this;
if (!b.controlsAreVisible) {
if (typeof a == "undefined" || a) {
b.controls.css("visibility", "visible").stop(true, true).fadeIn(200, function() {
b.controlsAreVisible = true
});
b.container.find(".mejs-control").css("visibility", "visible").stop(true, true).fadeIn(200, function() {
b.controlsAreVisible = true
})
} else {
b.controls.css("visibility", "visible").css("display", "block");
b.container.find(".mejs-control").css("visibility", "visible").css("display", "block");
b.controlsAreVisible = true
}
b.setControlsSize()
}
},
hideControls: function(a) {
var c = this;
if (c.controlsAreVisible) if (typeof a == "undefined" || a) {
c.controls.stop(true, true).fadeOut(200, function() {
b(this).css("visibility", "hidden").css("display", "block");
c.controlsAreVisible = false
});
c.container.find(".mejs-control").stop(true, true).fadeOut(200, function() {
b(this).css("visibility", "hidden").css("display", "block")
})
} else {
c.controls.css("visibility", "hidden").css("display", "block");
c.container.find(".mejs-control").css("visibility", "hidden").css("display", "block");
c.controlsAreVisible = false
}
},
controlsTimer: null,
startControlsTimer: function(a) {
var b = this,
a = typeof a != "undefined" ? a : 1500;
b.killControlsTimer("start");
b.controlsTimer = setTimeout(function() {
b.hideControls();
b.killControlsTimer("hide")
}, a)
},
killControlsTimer: function() {
if (this.controlsTimer !== null) {
clearTimeout(this.controlsTimer);
delete this.controlsTimer;
this.controlsTimer = null
}
},
controlsEnabled: true,
disableControls: function() {
this.killControlsTimer();
this.hideControls(false);
this.controlsEnabled = false
},
enableControls: function() {
this.showControls(false);
this.controlsEnabled = true
},
meReady: function(a, c) {
var d = this,
e = mejs.MediaFeatures,
f = c.getAttribute("autoplay"),
f = !(typeof f == "undefined" || f === null || f === "false"),
g;
if (!d.created) {
d.created = true;
d.media = a;
d.domNode = c;
if ((!e.isAndroid || !d.options.AndroidUseNativeControls) && (!e.isiPad || !d.options.iPadUseNativeControls) && (!e.isiPhone || !d.options.iPhoneUseNativeControls)) {
d.buildposter(d, d.controls, d.layers, d.media);
d.buildkeyboard(d, d.controls, d.layers, d.media);
d.buildoverlays(d, d.controls, d.layers, d.media);
d.findTracks();
for (g in d.options.features) {
e = d.options.features[g];
if (d["build" + e]) try {
d["build" + e](d, d.controls, d.layers, d.media)
} catch (j) {}
}
d.container.trigger("controlsready");
d.setPlayerSize(d.width, d.height);
d.setControlsSize();
if (d.isVideo) {
if (mejs.MediaFeatures.hasTouch) d.$media.bind("touchstart", function() {
d.controlsAreVisible ? d.hideControls(false) : d.controlsEnabled && d.showControls(false)
});
else {
(d.media.pluginType == "native" ? d.$media : b(d.media.pluginElement)).click(function() {
a.paused ? a.play() : a.pause()
});
d.container.bind("mouseenter mouseover", function() {
if (d.controlsEnabled && !d.options.alwaysShowControls) {
d.killControlsTimer("enter");
d.showControls();
d.startControlsTimer(2500)
}
}).bind("mousemove", function() {
if (d.controlsEnabled) {
d.controlsAreVisible || d.showControls();
d.options.alwaysShowControls || d.startControlsTimer(2500)
}
}).bind("mouseleave", function() {
d.controlsEnabled && !d.media.paused && !d.options.alwaysShowControls && d.startControlsTimer(1E3)
})
}
f && !d.options.alwaysShowControls && d.hideControls();
d.options.enableAutosize && d.media.addEventListener("loadedmetadata", function(a) {
if (d.options.videoHeight <= 0 && d.domNode.getAttribute("height") === null && !isNaN(a.target.videoHeight)) {
d.setPlayerSize(a.target.videoWidth, a.target.videoHeight);
d.setControlsSize();
d.media.setVideoSize(a.target.videoWidth, a.target.videoHeight)
}
}, false)
}
a.addEventListener("play", function() {
for (var a = 0, b = mejs.players.length; a < b; a++) {
var c = mejs.players[a];
c.id != d.id && (d.options.pauseOtherPlayers && !c.paused && !c.ended) && c.pause();
c.hasFocus = false
}
d.hasFocus = true
}, false);
d.media.addEventListener("ended", function() {
try {
d.media.setCurrentTime(0)
} catch (a) {}
d.media.pause();
d.setProgressRail && d.setProgressRail();
d.setCurrentRail && d.setCurrentRail();
d.options.loop ? d.media.play() : !d.options.alwaysShowControls && d.controlsEnabled && d.showControls()
}, false);
d.media.addEventListener("loadedmetadata", function() {
d.updateDuration && d.updateDuration();
d.updateCurrent && d.updateCurrent();
if (!d.isFullScreen) {
d.setPlayerSize(d.width, d.height);
d.setControlsSize()
}
}, false);
setTimeout(function() {
d.setPlayerSize(d.width, d.height);
d.setControlsSize()
}, 50);
b(window).resize(function() {
d.isFullScreen || mejs.MediaFeatures.hasTrueNativeFullScreen && document.webkitIsFullScreen || d.setPlayerSize(d.width, d.height);
d.setControlsSize()
});
d.media.pluginType == "youtube" && d.container.find(".mejs-overlay-play").hide()
}
if (f && a.pluginType == "native") {
a.load();
a.play()
}
if (d.options.success) if (typeof d.options.success == "string") window[d.options.success](d.media, d.domNode, d);
else d.options.success(d.media, d.domNode, d)
}
},
handleError: function(a) {
this.controls.hide();
this.options.error && this.options.error(a)
},
setPlayerSize: function(a, c) {
if (typeof a != "undefined") this.width = a;
if (typeof c != "undefined") this.height = c;
if (this.height.toString().indexOf("%") > 0 || this.$node.css("max-width") === "100%") {
var d = this.media.videoWidth && this.media.videoWidth > 0 ? this.media.videoWidth : this.options.defaultVideoWidth,
e = this.media.videoHeight && this.media.videoHeight > 0 ? this.media.videoHeight : this.options.defaultVideoHeight,
f = this.container.parent().width(),
d = parseInt(f * e / d, 10);
if (this.container.parent()[0].tagName.toLowerCase() === "body") {
f = b(window).width();
d = b(window).height()
}
if (d != 0) {
this.container.width(f).height(d);
this.$media.width("100%").height("100%");
this.container.find("object, embed, iframe").width("100%").height("100%");
this.isVideo && this.media.setVideoSize && this.media.setVideoSize(f, d);
this.layers.children(".mejs-layer").width("100%").height("100%")
}
} else {
this.container.width(this.width).height(this.height);
this.layers.children(".mejs-layer").width(this.width).height(this.height)
}
},
setControlsSize: function() {
var a = 0,
c = 0,
d = this.controls.find(".mejs-time-rail"),
e = this.controls.find(".mejs-time-total");
this.controls.find(".mejs-time-current");
this.controls.find(".mejs-time-loaded");
var f = d.siblings();
this.options && !this.options.autosizeProgress && (c = parseInt(d.css("width")));
if (c === 0 || !c) {
f.each(function() {
b(this).css("position") != "absolute" && (a = a + b(this).outerWidth(true))
});
c = this.controls.width() - a - (d.outerWidth(true) - d.width())
}
d.width(c);
e.width(c - (e.outerWidth(true) - e.width()));
this.setProgressRail && this.setProgressRail();
this.setCurrentRail && this.setCurrentRail()
},
buildposter: function(a, c, d, e) {
var f = b('<div class="mejs-poster mejs-layer"></div>').appendTo(d),
c = a.$media.attr("poster");
if (a.options.poster !== "") c = a.options.poster;
c !== "" && c != null ? this.setPoster(c) : f.hide();
e.addEventListener("play", function() {
f.hide()
}, false)
},
setPoster: function(a) {
var c = this.container.find(".mejs-poster"),
d = c.find("img");
d.length == 0 && (d = b('<img width="100%" height="100%" />').appendTo(c));
d.attr("src", a)
},
buildoverlays: function(a, c, d, e) {
if (a.isVideo) {
var f = b('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(d),
g = b('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(d),
j = b('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(d).click(function() {
e.paused ? e.play() : e.pause()
});
e.addEventListener("play", function() {
j.hide();
f.hide();
c.find(".mejs-time-buffering").hide();
g.hide()
}, false);
e.addEventListener("playing", function() {
j.hide();
f.hide();
c.find(".mejs-time-buffering").hide();
g.hide()
}, false);
e.addEventListener("seeking", function() {
f.show();
c.find(".mejs-time-buffering").show()
}, false);
e.addEventListener("seeked", function() {
f.hide();
c.find(".mejs-time-buffering").hide()
}, false);
e.addEventListener("pause", function() {
mejs.MediaFeatures.isiPhone || j.show()
}, false);
e.addEventListener("waiting", function() {
f.show();
c.find(".mejs-time-buffering").show()
}, false);
e.addEventListener("loadeddata", function() {
f.show();
c.find(".mejs-time-buffering").show()
}, false);
e.addEventListener("canplay", function() {
f.hide();
c.find(".mejs-time-buffering").hide()
}, false);
e.addEventListener("error", function() {
f.hide();
c.find(".mejs-time-buffering").hide();
g.show();
g.find("mejs-overlay-error").html("Error loading this resource")
}, false)
}
},
buildkeyboard: function(a, c, d, e) {
b(document).keydown(function(b) {
if (a.hasFocus && a.options.enableKeyboard) for (var c = 0, d = a.options.keyActions.length; c < d; c++) for (var h = a.options.keyActions[c], l = 0, k = h.keys.length; l < k; l++) if (b.keyCode == h.keys[l]) {
b.preventDefault();
h.action(a, e, b.keyCode);
return false
}
return true
});
b(document).click(function(c) {
if (b(c.target).closest(".mejs-container").length == 0) a.hasFocus = false
})
},
findTracks: function() {
var a = this,
c = a.$media.find("track");
a.tracks = [];
c.each(function(c, e) {
e = b(e);
a.tracks.push({
srclang: e.attr("srclang").toLowerCase(),
src: e.attr("src"),
kind: e.attr("kind"),
label: e.attr("label") || "",
entries: [],
isLoaded: false
})
})
},
changeSkin: function(a) {
this.container[0].className = "mejs-container " + a;
this.setPlayerSize(this.width, this.height);
this.setControlsSize()
},
play: function() {
this.media.play()
},
pause: function() {
this.media.pause()
},
load: function() {
this.media.load()
},
setMuted: function(a) {
this.media.setMuted(a)
},
setCurrentTime: function(a) {
this.media.setCurrentTime(a)
},
getCurrentTime: function() {
return this.media.currentTime
},
setVolume: function(a) {
this.media.setVolume(a)
},
getVolume: function() {
return this.media.volume
},
setSrc: function(a) {
this.media.setSrc(a)
},
remove: function() {
this.media.pluginType === "flash" ? this.media.remove() : this.media.pluginType === "native" && this.$media.prop("controls", true);
this.isDynamic || this.$node.insertBefore(this.container);
this.container.remove()
}
};
if (typeof jQuery != "undefined") jQuery.fn.mediaelementplayer = function(a) {
return this.each(function() {
new mejs.MediaElementPlayer(this, a)
})
};
b(document).ready(function() {
b(".mejs-player").mediaelementplayer()
});
window.MediaElementPlayer = mejs.MediaElementPlayer
})(mejs.$);
(function(b) {
b.extend(mejs.MepDefaults, {
playpauseText: "Play/Pause"
});
b.extend(MediaElementPlayer.prototype, {
buildplaypause: function(a, c, d, e) {
var f = b('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="' + this.id + '" title="' + this.options.playpauseText + '"></button></div>').appendTo(c).click(function(a) {
a.preventDefault();
e.paused ? e.play() : e.pause();
return false
});
e.addEventListener("play", function() {
f.removeClass("mejs-play").addClass("mejs-pause")
}, false);
e.addEventListener("playing", function() {
f.removeClass("mejs-play").addClass("mejs-pause")
}, false);
e.addEventListener("pause", function() {
f.removeClass("mejs-pause").addClass("mejs-play")
}, false);
e.addEventListener("paused", function() {
f.removeClass("mejs-pause").addClass("mejs-play")
}, false)
}
})
})(mejs.$);
(function(b) {
b.extend(mejs.MepDefaults, {
stopText: "Stop"
});
b.extend(MediaElementPlayer.prototype, {
buildstop: function(a, c, d, e) {
b('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="' + this.id + '" title="' + this.options.stopText + '"></button></div>').appendTo(c).click(function() {
e.paused || e.pause();
if (e.currentTime > 0) {
e.setCurrentTime(0);
c.find(".mejs-time-current").width("0px");
c.find(".mejs-time-handle").css("left", "0px");
c.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0));
c.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));
d.find(".mejs-poster").show()
}
})
}
})
})(mejs.$);
(function(b) {
b.extend(MediaElementPlayer.prototype, {
buildprogress: function(a, c, d, e) {
b('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-buffering"></span><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(c);
c.find(".mejs-time-buffering").hide();
var f = c.find(".mejs-time-total"),
d = c.find(".mejs-time-loaded"),
g = c.find(".mejs-time-current"),
j = c.find(".mejs-time-handle"),
h = c.find(".mejs-time-float"),
l = c.find(".mejs-time-float-current"),
k = function(a) {
var a = a.pageX,
b = f.offset(),
c = f.outerWidth(),
d = 0,
d = 0,
g = a - b.left;
if (a > b.left && a <= c + b.left && e.duration) {
d = (a - b.left) / c;
d = d <= 0.02 ? 0 : d * e.duration;
m && e.setCurrentTime(d);
if (!mejs.MediaFeatures.hasTouch) {
h.css("left", g);
l.html(mejs.Utility.secondsToTimeCode(d));
h.show()
}
}
},
m = false;
f.bind("mousedown", function(a) {
if (a.which === 1) {
m = true;
k(a);
b(document).bind("mousemove.dur", function(a) {
k(a)
}).bind("mouseup.dur", function() {
m = false;
h.hide();
b(document).unbind(".dur")
});
return false
}
}).bind("mouseenter", function() {
b(document).bind("mousemove.dur", function(a) {
k(a)
});
mejs.MediaFeatures.hasTouch || h.show()
}).bind("mouseleave", function() {
if (!m) {
b(document).unbind(".dur");
h.hide()
}
});
e.addEventListener("progress", function(b) {
a.setProgressRail(b);
a.setCurrentRail(b)
}, false);
e.addEventListener("timeupdate", function(b) {
a.setProgressRail(b);
a.setCurrentRail(b)
}, false);
this.loaded = d;
this.total = f;
this.current = g;
this.handle = j
},
setProgressRail: function(a) {
var b = a != void 0 ? a.target : this.media,
d = null;
b && b.buffered && b.buffered.length > 0 && b.buffered.end && b.duration ? d = b.buffered.end(0) / b.duration : b && b.bytesTotal != void 0 && b.bytesTotal > 0 && b.bufferedBytes != void 0 ? d = b.bufferedBytes / b.bytesTotal : a && (a.lengthComputable && a.total != 0) && (d = a.loaded / a.total);
if (d !== null) {
d = Math.min(1, Math.max(0, d));
this.loaded && this.total && this.loaded.width(this.total.width() * d)
}
},
setCurrentRail: function() {
if (this.media.currentTime != void 0 && this.media.duration && this.total && this.handle) {
var a = this.total.width() * this.media.currentTime / this.media.duration,
b = a - this.handle.outerWidth(true) / 2;
this.current.width(a);
this.handle.css("left", b)
}
}
})
})(mejs.$);
(function(b) {
b.extend(mejs.MepDefaults, {
duration: -1,
timeAndDurationSeparator: " <span> | </span> "
});
b.extend(MediaElementPlayer.prototype, {
buildcurrent: function(a, c, d, e) {
b('<div class="mejs-time"><span class="mejs-currenttime">' + (a.options.alwaysShowHours ? "00:" : "") + (a.options.showTimecodeFrameCount ? "00:00:00" : "00:00") + "</span></div>").appendTo(c);
this.currenttime = this.controls.find(".mejs-currenttime");
e.addEventListener("timeupdate", function() {
a.updateCurrent()
}, false)
},
buildduration: function(a, c, d, e) {
if (c.children().last().find(".mejs-currenttime").length > 0) b(this.options.timeAndDurationSeparator + '<span class="mejs-duration">' + (this.options.duration > 0 ? mejs.Utility.secondsToTimeCode(this.options.duration, this.options.alwaysShowHours || this.media.duration > 3600, this.options.showTimecodeFrameCount, this.options.framesPerSecond || 25) : (a.options.alwaysShowHours ? "00:" : "") + (a.options.showTimecodeFrameCount ? "00:00:00" : "00:00")) + "</span>").appendTo(c.find(".mejs-time"));
else {
c.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");
b('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">' + (this.options.duration > 0 ? mejs.Utility.secondsToTimeCode(this.options.duration, this.options.alwaysShowHours || this.media.duration > 3600, this.options.showTimecodeFrameCount, this.options.framesPerSecond || 25) : (a.options.alwaysShowHours ? "00:" : "") + (a.options.showTimecodeFrameCount ? "00:00:00" : "00:00")) + "</span></div>").appendTo(c)
}
this.durationD = this.controls.find(".mejs-duration");
e.addEventListener("timeupdate", function() {
a.updateDuration()
}, false)
},
updateCurrent: function() {
this.currenttime && this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime, this.options.alwaysShowHours || this.media.duration > 3600, this.options.showTimecodeFrameCount, this.options.framesPerSecond || 25))
},
updateDuration: function() {
this.media.duration && this.durationD && this.durationD.html(mejs.Utility.secondsToTimeCode(this.media.duration, this.options.alwaysShowHours, this.options.showTimecodeFrameCount, this.options.framesPerSecond || 25))
}
})
})(mejs.$);
(function(b) {
b.extend(mejs.MepDefaults, {
muteText: "Mute Toggle",
hideVolumeOnTouchDevices: true,
audioVolume: "horizontal",
videoVolume: "vertical"
});
b.extend(MediaElementPlayer.prototype, {
buildvolume: function(a, c, d, e) {
if (!mejs.MediaFeatures.hasTouch || !this.options.hideVolumeOnTouchDevices) {
var f = this.isVideo ? this.options.videoVolume : this.options.audioVolume,
g = f == "horizontal" ? b('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="' + this.id + '" title="' + this.options.muteText + '"></button></div><div class="mejs-horizontal-volume-slider"><div class="mejs-horizontal-volume-total"></div><div class="mejs-horizontal-volume-current"></div><div class="mejs-horizontal-volume-handle"></div></div>').appendTo(c) : b('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="' + this.id + '" title="' + this.options.muteText + '"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(c),
j = this.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),
h = this.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),
l = this.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),
k = this.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),
m = function(a, b) {
if (!j.is(":visible") && typeof b != "undefined") {
j.show();
m(a, true);
j.hide()
} else {
a = Math.max(0, a);
a = Math.min(a, 1);
a == 0 ? g.removeClass("mejs-mute").addClass("mejs-unmute") : g.removeClass("mejs-unmute").addClass("mejs-mute");
if (f == "vertical") {
var c = h.height(),
d = h.position(),
e = c - c * a;
k.css("top", d.top + e - k.height() / 2);
l.height(c - e);
l.css("top", d.top + e)
} else {
c = h.width();
d = h.position();
c = c * a;
k.css("left", d.left + c - k.width() / 2);
l.width(c)
}
}
},
n = function(a) {
var b = null,
c = h.offset();
if (f == "vertical") {
b = h.height();
parseInt(h.css("top").replace(/px/, ""), 10);
b = (b - (a.pageY - c.top)) / b;
if (c.top == 0 || c.left == 0) return
} else {
b = h.width();
b = (a.pageX - c.left) / b
}
b = Math.max(0, b);
b = Math.min(b, 1);
m(b);
b == 0 ? e.setMuted(true) : e.setMuted(false);
e.setVolume(b)
},
o = false,
p = false;
g.hover(function() {
j.show();
p = true
}, function() {
p = false;
!o && f == "vertical" && j.hide()
});
j.bind("mouseover", function() {
p = true
}).bind("mousedown", function(a) {
n(a);
b(document).bind("mousemove.vol", function(a) {
n(a)
}).bind("mouseup.vol", function() {
o = false;
b(document).unbind(".vol");
!p && f == "vertical" && j.hide()
});
o = true;
return false
});
g.find("button").click(function() {
e.setMuted(!e.muted)
});
e.addEventListener("volumechange", function() {
if (!o) if (e.muted) {
m(0);
g.removeClass("mejs-mute").addClass("mejs-unmute")
} else {
m(e.volume);
g.removeClass("mejs-unmute").addClass("mejs-mute")
}
}, false);
if (this.container.is(":visible")) {
m(a.options.startVolume);
e.pluginType === "native" && e.setVolume(a.options.startVolume)
}
}
}
})
})(mejs.$);
(function(b) {
b.extend(mejs.MepDefaults, {
usePluginFullScreen: true,
newWindowCallback: function() {
return ""
},
fullscreenText: "Fullscreen"
});
b.extend(MediaElementPlayer.prototype, {
isFullScreen: false,
isNativeFullScreen: false,
docStyleOverflow: null,
isInIframe: false,
buildfullscreen: function(a, c, d, e) {
if (a.isVideo) {
a.isInIframe = window.location != window.parent.location;
if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
d = null;
d = mejs.MediaFeatures.hasMozNativeFullScreen ? b(document) : a.container;
d.bind(mejs.MediaFeatures.fullScreenEventName, function() {
if (mejs.MediaFeatures.isFullScreen()) {
a.isNativeFullScreen = true;
a.setControlsSize()
} else {
a.isNativeFullScreen = false;
a.exitFullScreen()
}
})
}
var f = this,
g = b('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="' + f.id + '" title="' + f.options.fullscreenText + '"></button></div>').appendTo(c);
if (f.media.pluginType === "native" || !f.options.usePluginFullScreen && !mejs.MediaFeatures.isFirefox) g.click(function() {
mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen() || a.isFullScreen ? a.exitFullScreen() : a.enterFullScreen()
});
else {
var j = null;
if (function() {
var a = document.createElement("x"),
b = document.documentElement,
c = window.getComputedStyle;
if (!("pointerEvents" in a.style)) return false;
a.style.pointerEvents = "auto";
a.style.pointerEvents = "x";
b.appendChild(a);
c = c && c(a, "").pointerEvents === "auto";
b.removeChild(a);
return !!c
}() && !mejs.MediaFeatures.isOpera) {
var h = false,
l = function() {
if (h) {
k.hide();
m.hide();
n.hide();
g.css("pointer-events", "");
f.controls.css("pointer-events", "");
h = false
}
},
k = b('<div class="mejs-fullscreen-hover" />').appendTo(f.container).mouseover(l),
m = b('<div class="mejs-fullscreen-hover" />').appendTo(f.container).mouseover(l),
n = b('<div class="mejs-fullscreen-hover" />').appendTo(f.container).mouseover(l),
o = function() {
var a = {
position: "absolute",
top: 0,
left: 0
};
k.css(a);
m.css(a);
n.css(a);
k.width(f.container.width()).height(f.container.height() - f.controls.height());
a = g.offset().left - f.container.offset().left;
fullScreenBtnWidth = g.outerWidth(true);
m.width(a).height(f.controls.height()).css({
top: f.container.height() - f.controls.height()
});
n.width(f.container.width() - a - fullScreenBtnWidth).height(f.controls.height()).css({
top: f.container.height() - f.controls.height(),
left: a + fullScreenBtnWidth
})
};
b(document).resize(function() {
o()
});
g.mouseover(function() {
if (!f.isFullScreen) {
var b = g.offset(),
c = a.container.offset();
e.positionFullscreenButton(b.left - c.left, b.top - c.top, false);
g.css("pointer-events", "none");
f.controls.css("pointer-events", "none");
k.show();
n.show();
m.show();
o();
h = true
}
});
e.addEventListener("fullscreenchange", function() {
l()
})
} else g.mouseover(function() {
if (j !== null) {
clearTimeout(j);
delete j
}
var b = g.offset(),
c = a.container.offset();
e.positionFullscreenButton(b.left - c.left, b.top - c.top, true)
}).mouseout(function() {
if (j !== null) {
clearTimeout(j);
delete j
}
j = setTimeout(function() {
e.hideFullscreenButton()
}, 1500)
})
}
a.fullscreenBtn = g;
b(document).bind("keydown", function(b) {
(mejs.MediaFeatures.hasTrueNativeFullScreen && mejs.MediaFeatures.isFullScreen() || f.isFullScreen) && b.keyCode == 27 && a.exitFullScreen()
})
}
},
enterFullScreen: function() {
var a = this;
if (!(a.media.pluginType !== "native" && (mejs.MediaFeatures.isFirefox || a.options.usePluginFullScreen))) {
docStyleOverflow = document.documentElement.style.overflow;
document.documentElement.style.overflow = "hidden";
normalHeight = a.container.height();
normalWidth = a.container.width();
if (a.media.pluginType === "native") if (mejs.MediaFeatures.hasTrueNativeFullScreen) {
mejs.MediaFeatures.requestFullScreen(a.container[0]);
a.isInIframe && setTimeout(function e() {
a.isNativeFullScreen && (b(window).width() !== screen.width ? a.exitFullScreen() : setTimeout(e, 500))
}, 500)
} else if (mejs.MediaFeatures.hasSemiNativeFullScreen) {
a.media.webkitEnterFullscreen();
return
}
if (a.isInIframe) {
var c = a.options.newWindowCallback(this);
if (c !== "") if (mejs.MediaFeatures.hasTrueNativeFullScreen) setTimeout(function() {
if (!a.isNativeFullScreen) {
a.pause();
window.open(c, a.id, "top=0,left=0,width=" + screen.availWidth + ",height=" + screen.availHeight + ",resizable=yes,scrollbars=no,status=no,toolbar=no")
}
}, 250);
else {
a.pause();
window.open(c, a.id, "top=0,left=0,width=" + screen.availWidth + ",height=" + screen.availHeight + ",resizable=yes,scrollbars=no,status=no,toolbar=no");
return
}
}
a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");
setTimeout(function() {
a.container.css({
width: "100%",
height: "100%"
});
a.setControlsSize()
}, 500);
if (a.pluginType === "native") a.$media.width("100%").height("100%");
else {
a.container.find("object, embed, iframe").width("100%").height("100%");
a.media.setVideoSize(b(window).width(), b(window).height())
}
a.layers.children("div").width("100%").height("100%");
a.fullscreenBtn && a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");
a.setControlsSize();
a.isFullScreen = true
}
},
exitFullScreen: function() {
if (this.media.pluginType !== "native" && mejs.MediaFeatures.isFirefox) this.media.setFullscreen(false);
else {
mejs.MediaFeatures.hasTrueNativeFullScreen && (mejs.MediaFeatures.isFullScreen() || this.isFullScreen) && mejs.MediaFeatures.cancelFullScreen();
document.documentElement.style.overflow = docStyleOverflow;
this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);
if (this.pluginType === "native") this.$media.width(normalWidth).height(normalHeight);
else {
this.container.find("object embed").width(normalWidth).height(normalHeight);
this.media.setVideoSize(normalWidth, normalHeight)
}
this.layers.children("div").width(normalWidth).height(normalHeight);
this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");
this.setControlsSize();
this.isFullScreen = false
}
}
})
})(mejs.$);
(function(b) {
b.extend(mejs.MepDefaults, {
startLanguage: "",
tracksText: "Captions/Subtitles"
});
b.extend(MediaElementPlayer.prototype, {
hasChapters: false,
buildtracks: function(a, c, d, e) {
if (a.isVideo && a.tracks.length != 0) {
var f;
a.chapters = b('<div class="mejs-chapters mejs-layer"></div>').prependTo(d).hide();
a.captions = b('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position"><span class="mejs-captions-text"></span></div></div>').prependTo(d).hide();
a.captionsText = a.captions.find(".mejs-captions-text");
a.captionsButton = b('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="' + this.id + '" title="' + this.options.tracksText + '"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="' + a.id + '_captions" id="' + a.id + '_captions_none" value="none" checked="checked" /><label for="' + a.id + '_captions_none">None</label></li></ul></div></div>').appendTo(c).hover(function() {
b(this).find(".mejs-captions-selector").css("visibility", "visible")
}, function() {
b(this).find(".mejs-captions-selector").css("visibility", "hidden")
}).delegate("input[type=radio]", "click", function() {
lang = this.value;
if (lang == "none") a.selectedTrack = null;
else for (f = 0; f < a.tracks.length; f++) if (a.tracks[f].srclang == lang) {
a.selectedTrack = a.tracks[f];
a.captions.attr("lang", a.selectedTrack.srclang);
a.displayCaptions();
break
}
});
a.options.alwaysShowControls ? a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover") : a.container.bind("mouseenter", function() {
a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")
}).bind("mouseleave", function() {
e.paused || a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")
});
a.trackToLoad = -1;
a.selectedTrack = null;
a.isLoadingTrack = false;
for (f = 0; f < a.tracks.length; f++) a.tracks[f].kind == "subtitles" && a.addTrackButton(a.tracks[f].srclang, a.tracks[f].label);
a.loadNextTrack();
e.addEventListener("timeupdate", function() {
a.displayCaptions()
}, false);
e.addEventListener("loadedmetadata", function() {
a.displayChapters()
}, false);
a.container.hover(function() {
if (a.hasChapters) {
a.chapters.css("visibility", "visible");
a.chapters.fadeIn(200).height(a.chapters.find(".mejs-chapter").outerHeight())
}
}, function() {
a.hasChapters && !e.paused && a.chapters.fadeOut(200, function() {
b(this).css("visibility", "hidden");
b(this).css("display", "block")
})
});
a.node.getAttribute("autoplay") !== null && a.chapters.css("visibility", "hidden")
}
},
loadNextTrack: function() {
this.trackToLoad++;
if (this.trackToLoad < this.tracks.length) {
this.isLoadingTrack = true;
this.loadTrack(this.trackToLoad)
} else this.isLoadingTrack = false
},
loadTrack: function(a) {
var c = this,
d = c.tracks[a];
b.ajax({
url: d.src,
dataType: "text",
success: function(a) {
d.entries = typeof a == "string" && /<tt\s+xml/ig.exec(a) ? mejs.TrackFormatParser.dfxp.parse(a) : mejs.TrackFormatParser.webvvt.parse(a);
d.isLoaded = true;
c.enableTrackButton(d.srclang, d.label);
c.loadNextTrack();
d.kind == "chapters" && c.media.duration > 0 && c.drawChapters(d)
},
error: function() {
c.loadNextTrack()
}
})
},
enableTrackButton: function(a, c) {
c === "" && (c = mejs.language.codes[a] || a);
this.captionsButton.find("input[value=" + a + "]").prop("disabled", false).siblings("label").html(c);
this.options.startLanguage == a && b("#" + this.id + "_captions_" + a).click();
this.adjustLanguageBox()
},
addTrackButton: function(a, c) {
c === "" && (c = mejs.language.codes[a] || a);
this.captionsButton.find("ul").append(b('<li><input type="radio" name="' + this.id + '_captions" id="' + this.id + "_captions_" + a + '" value="' + a + '" disabled="disabled" /><label for="' + this.id + "_captions_" + a + '">' + c + " (loading)</label></li>"));
this.adjustLanguageBox();
this.container.find(".mejs-captions-translations option[value=" + a + "]").remove()
},
adjustLanguageBox: function() {
this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true) + this.captionsButton.find(".mejs-captions-translations").outerHeight(true))
},
displayCaptions: function() {
if (typeof this.tracks != "undefined") {
var a, b = this.selectedTrack;
if (b != null && b.isLoaded) for (a = 0; a < b.entries.times.length; a++) if (this.media.currentTime >= b.entries.times[a].start && this.media.currentTime <= b.entries.times[a].stop) {
this.captionsText.html(b.entries.text[a]);
this.captions.show().height(0);
return
}
this.captions.hide()
}
},
displayChapters: function() {
var a;
for (a = 0; a < this.tracks.length; a++) if (this.tracks[a].kind == "chapters" && this.tracks[a].isLoaded) {
this.drawChapters(this.tracks[a]);
this.hasChapters = true;
break
}
},
drawChapters: function(a) {
var c = this,
d, e, f = e = 0;
c.chapters.empty();
for (d = 0; d < a.entries.times.length; d++) {
e = a.entries.times[d].stop - a.entries.times[d].start;
e = Math.floor(e / c.media.duration * 100);
if (e + f > 100 || d == a.entries.times.length - 1 && e + f < 100) e = 100 - f;
c.chapters.append(b('<div class="mejs-chapter" rel="' + a.entries.times[d].start + '" style="left: ' + f.toString() + "%;width: " + e.toString() + '%;"><div class="mejs-chapter-block' + (d == a.entries.times.length - 1 ? " mejs-chapter-block-last" : "") + '"><span class="ch-title">' + a.entries.text[d] + '</span><span class="ch-time">' + mejs.Utility.secondsToTimeCode(a.entries.times[d].start) + "–" + mejs.Utility.secondsToTimeCode(a.entries.times[d].stop) + "</span></div></div>"));
f = f + e
}
c.chapters.find("div.mejs-chapter").click(function() {
c.media.setCurrentTime(parseFloat(b(this).attr("rel")));
c.media.paused && c.media.play()
});
c.chapters.show()
}
});
mejs.language = {
codes: {
af: "Afrikaans",
sq: "Albanian",
ar: "Arabic",
be: "Belarusian",
bg: "Bulgarian",
ca: "Catalan",
zh: "Chinese",
"zh-cn": "Chinese Simplified",
"zh-tw": "Chinese Traditional",
hr: "Croatian",
cs: "Czech",
da: "Danish",
nl: "Dutch",
en: "English",
et: "Estonian",
tl: "Filipino",
fi: "Finnish",
fr: "French",
gl: "Galician",
de: "German",
el: "Greek",
ht: "Haitian Creole",
iw: "Hebrew",
hi: "Hindi",
hu: "Hungarian",
is: "Icelandic",
id: "Indonesian",
ga: "Irish",
it: "Italian",
ja: "Japanese",
ko: "Korean",
lv: "Latvian",
lt: "Lithuanian",
mk: "Macedonian",
ms: "Malay",
mt: "Maltese",
no: "Norwegian",
fa: "Persian",
pl: "Polish",
pt: "Portuguese",
ro: "Romanian",
ru: "Russian",
sr: "Serbian",
sk: "Slovak",
sl: "Slovenian",
es: "Spanish",
sw: "Swahili",
sv: "Swedish",
tl: "Tagalog",
th: "Thai",
tr: "Turkish",
uk: "Ukrainian",
vi: "Vietnamese",
cy: "Welsh",
yi: "Yiddish"
}
};
mejs.TrackFormatParser = {
webvvt: {
pattern_identifier: /^([a-zA-z]+-)?[0-9]+$/,
pattern_timecode: /^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,
parse: function(a) {
for (var c = 0, a = mejs.TrackFormatParser.split2(a, /\r?\n/), d = {
text: [],
times: []
}, e, f; c < a.length; c++) if (this.pattern_identifier.exec(a[c])) {
c++;
if ((e = this.pattern_timecode.exec(a[c])) && c < a.length) {
c++;
f = a[c];
for (c++; a[c] !== "" && c < a.length;) {
f = f + "\n" + a[c];
c++
}
f = b.trim(f).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>");
d.text.push(f);
d.times.push({
start: mejs.Utility.convertSMPTEtoSeconds(e[1]) == 0 ? 0.2 : mejs.Utility.convertSMPTEtoSeconds(e[1]),
stop: mejs.Utility.convertSMPTEtoSeconds(e[3]),
settings: e[5]
})
}
}
return d
}
},
dfxp: {
parse: function(a) {
var a = b(a).filter("tt"),
c = 0,
c = a.children("div").eq(0),
d = c.find("p"),
c = a.find("#" + c.attr("style")),
e, f, a = {
text: [],
times: []
};
if (c.length) {
f = c.removeAttr("id").get(0).attributes;
if (f.length) {
e = {};
for (c = 0; c < f.length; c++) e[f[c].name.split(":")[1]] = f[c].value
}
}
for (c = 0; c < d.length; c++) {
var g;
f = {
start: null,
stop: null,
style: null
};
if (d.eq(c).attr("begin")) f.start = mejs.Utility.convertSMPTEtoSeconds(d.eq(c).attr("begin"));
if (!f.start && d.eq(c - 1).attr("end")) f.start = mejs.Utility.convertSMPTEtoSeconds(d.eq(c - 1).attr("end"));
if (d.eq(c).attr("end")) f.stop = mejs.Utility.convertSMPTEtoSeconds(d.eq(c).attr("end"));
if (!f.stop && d.eq(c + 1).attr("begin")) f.stop = mejs.Utility.convertSMPTEtoSeconds(d.eq(c + 1).attr("begin"));
if (e) {
g = "";
for (var j in e) g = g + (j + ":" + e[j] + ";")
}
if (g) f.style = g;
if (f.start == 0) f.start = 0.2;
a.times.push(f);
f = b.trim(d.eq(c).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>");
a.text.push(f);
if (a.times.start == 0) a.times.start = 2
}
return a
}
},
split2: function(a, b) {
return a.split(b)
}
};
if ("x\n\ny".split(/\n/gi).length != 3) mejs.TrackFormatParser.split2 = function(a, b) {
var d = [],
e = "",
f;
for (f = 0; f < a.length; f++) {
e = e + a.substring(f, f + 1);
if (b.test(e)) {
d.push(e.replace(b, ""));
e = ""
}
}
d.push(e);
return d
}
})(mejs.$);
(function(b) {
b.extend(mejs.MepDefaults, {
contextMenuItems: [{
render: function(a) {
return typeof a.enterFullScreen == "undefined" ? null : a.isFullScreen ? "Turn off Fullscreen" : "Go Fullscreen"
},
click: function(a) {
a.isFullScreen ? a.exitFullScreen() : a.enterFullScreen()
}
}, {
render: function(a) {
return a.media.muted ? "Unmute" : "Mute"
},
click: function(a) {
a.media.muted ? a.setMuted(false) : a.setMuted(true)
}
}, {
isSeparator: true
}, {
render: function() {
return "Download Video"
},
click: function(a) {
window.location.href = a.media.currentSrc
}
}]
});
b.extend(MediaElementPlayer.prototype, {
buildcontextmenu: function(a) {
a.contextMenu = b('<div class="mejs-contextmenu"></div>').appendTo(b("body")).hide();
a.container.bind("contextmenu", function(b) {
if (a.isContextMenuEnabled) {
b.preventDefault();
a.renderContextMenu(b.clientX - 1, b.clientY - 1);
return false
}
});
a.container.bind("click", function() {
a.contextMenu.hide()
});
a.contextMenu.bind("mouseleave", function() {
a.startContextMenuTimer()
})
},
isContextMenuEnabled: true,
enableContextMenu: function() {
this.isContextMenuEnabled = true
},
disableContextMenu: function() {
this.isContextMenuEnabled = false
},
contextMenuTimeout: null,
startContextMenuTimer: function() {
var a = this;
a.killContextMenuTimer();
a.contextMenuTimer = setTimeout(function() {
a.hideContextMenu();
a.killContextMenuTimer()
}, 750)
},
killContextMenuTimer: function() {
var a = this.contextMenuTimer;
if (a != null) {
clearTimeout(a);
delete a
}
},
hideContextMenu: function() {
this.contextMenu.hide()
},
renderContextMenu: function(a, c) {
for (var d = this, e = "", f = d.options.contextMenuItems, g = 0, j = f.length; g < j; g++) if (f[g].isSeparator) e = e + '<div class="mejs-contextmenu-separator"></div>';
else {
var h = f[g].render(d);
h != null && (e = e + ('<div class="mejs-contextmenu-item" data-itemindex="' + g + '" id="element-' + Math.random() * 1E6 + '">' + h + "</div>"))
}
d.contextMenu.empty().append(b(e)).css({
top: c,
left: a
}).show();
d.contextMenu.find(".mejs-contextmenu-item").each(function() {
var a = b(this),
c = parseInt(a.data("itemindex"), 10),
e = d.options.contextMenuItems[c];
typeof e.show != "undefined" && e.show(a, d);
a.click(function() {
typeof e.click != "undefined" && e.click(d);
d.contextMenu.hide()
})
});
setTimeout(function() {
d.killControlsTimer("rev3")
}, 100)
}
})
})(mejs.$); |