%PDF- %PDF-
Direktori : /home/nailstv/public_html/de.nails.tv/js/ |
Current File : /home/nailstv/public_html/de.nails.tv/js/script.js |
$(document).ready(function () { /*================================== Video social bar ====================================*/ // review $('.review a').click(function(e){ e.preventDefault(); var url = $(this).attr("href"); var video_id = $(this).attr('data-video-id'); var thumbs = ($(this).attr('class') == 'thumbs-up') ? 'p' : 'm' ; $.magnificPopup.open({ items: {src:url}, type: 'ajax', ajax: { settings: { type: 'POST', data: 'video='+video_id+'&irany='+thumbs, cache:false, async:false }, cursor: 'mfp-ajax-cur', tError: '<a href="%url%">A tartalom</a> nem tölthető be.' } }); }); // favorite $('.favorite a').click(function(e){ e.preventDefault(); var url = $(this).attr("href"); var video_id = $(this).attr('data-video-id'); $.magnificPopup.open({ items: {src:url}, type: 'ajax', ajax: { settings: { type: 'POST', data: 'video='+video_id, cache:false, async:false }, cursor: 'mfp-ajax-cur', tError: '<a href="%url%">A tartalom</a> nem tölthető be.' } }); }); // send $('.send a').magnificPopup({ type: 'iframe', iframe: { markup: '<div class="mfp-iframe-scaler white-iframe-popup"><div class="mfp-close"></div><iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe></div>', srcAction: 'iframe_src' } }); // popup window for facebook share, addthis, google plus share (same-origin policy) $('.js-win').click(function (event) { event.preventDefault(); var $this = $(this); var url = $this.attr("href"); var title = "popUp"; var w = $this.data("popup-w"); var h = $this.data("popup-h"); var left = (screen.width/2)-(w/2); var top = (screen.height/2)-(h/2); return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); }); /* used products autoscrolled */ $(function () { if($('.used-products .products .row').height() >= 635) { $('.used-products .products .row').addClass('autoscrolled'); } }); /*================================== Video thumbnail rotator ====================================*/ var timer, count = 0, cycle = function (el) { var s = el.attr('src'), root = s.substring(0, s.lastIndexOf('/') + 1); count = (count + 1) % 6; el.attr('src', root + ((count == 0) ? '6' : count) + '.jpg'); }; $('.video-mb img').hover(function () { var $this = $(this); def = $this.attr('src').substring($this.attr('src').lastIndexOf('/') + 1); cycle($this); timer = setInterval(function () { cycle($this); }, 800); }, function () { clearInterval(timer); var root = $(this).attr('src').substring(0, $(this).attr('src').lastIndexOf('/') + 1); $(this).attr('src', root + def); }); /*================================== Video js ====================================*/ // video js init $('body').hover(function () { $(window).resize(); }); videojs.options.flash.swf = "flash/video-js.swf"; if ($('#video_1')[0]) { videojs('video_1', {aspectRatio: '16:9'}); } // aspect ratio modify for video js if ($('.video-js')[0]) { $(window).resize(function () { var newVideoWidth = $('.embed-responsive').width(); $(".embed-responsive .video-js").each(function () { var videoWidth = $(this).width(); var videoHeight = $(this).height(); var newVideoHeight = (videoHeight / videoWidth) * newVideoWidth; $(this).css({'width': newVideoWidth + 'px', 'height': newVideoHeight + 'px'}); }); }).resize(); } // rewind video after ended & exit fullscreen if ($('#video_1')[0]) { var video = videojs('video_1').ready(function () { var player = this; player.on('ended', function () { player.exitFullscreen(); player.load(); }); }); } /*================================== Navbar & devices ====================================*/ if (/IEMobile/i.test(navigator.userAgent)) { $(".navbar-brand").addClass('windowsphone'); } ; var smartphones = function () { return /(iphone|ipod|ipad|android|blackberry|windows ce|palm|symbian)/i.test(navigator.userAgent); }; if (smartphones()) { $('.used-products .products .row').removeClass('autoscrolled'); } else { $(function () { var i = 0; $(window).scroll(function (evt) { var t = $(this).scrollTop(); if (t > i) { $(".navbar").addClass('stuck'); } else { $(".navbar").removeClass('stuck'); } i = t; }); }); } if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { $(".navbar-header").addClass('isios'); } ; /* dropdown parent hover */ $(function () { var scrres = $(window).width(); if (scrres < 768) { $('.navbar-collapse').find('.dropdown-toggle').attr({ "data-toggle":"dropdown", "role":"button", "aria-expanded":"false" }); $('.navbar-collapse').find('.dropdown-menu').slideToggle('slow'); } else { $('.dropdown').hover(function () { $(this).toggleClass('open'); }); } }); /* equalheight */ $('.xsResponse').imagesLoaded(function () { if (/iphone|ipod|ipad|android|blackberry|windows ce|IEMobile|palm|symbian/i.test(navigator.userAgent)) { } else { $(".product.egualheight").responsiveEqualHeightGrid(); } }); /* scroll up pill */ $.scrollUp({ scrollName: 'scrollUp', // Element ID topDistance: '300', // Distance from top before showing element (px) topSpeed: 300, // Speed back to top (ms) animation: 'fade', // Fade, slide, none animationInSpeed: 200, // Animation in speed (ms) animationOutSpeed: 200, // Animation out speed (ms) scrollText: '<i class="fa fa-chevron-up"></i>', // Text for element activeOverlay: false, // Set CSS color to display scrollUp active point, e.g '#00FFFF' }); /* reminder */ /* var originaltitle = document.title; window.onblur = function () { document.title = "Don't forget to watch it! :)" } window.onfocus = function () { document.title = originaltitle; }; */ }); // end docu ready /*! * imagesLoaded PACKAGED v3.1.4 * JavaScript is all like "You images are done yet or what?" * MIT License */ (function () { function e() { } function t(e, t) { for (var n = e.length; n--;)if (e[n].listener === t)return n; return -1 } function n(e) { return function () { return this[e].apply(this, arguments) } } var i = e.prototype, r = this, o = r.EventEmitter; i.getListeners = function (e) { var t, n, i = this._getEvents(); if ("object" == typeof e) { t = {}; for (n in i)i.hasOwnProperty(n) && e.test(n) && (t[n] = i[n]) } else t = i[e] || (i[e] = []); return t }, i.flattenListeners = function (e) { var t, n = []; for (t = 0; e.length > t; t += 1)n.push(e[t].listener); return n }, i.getListenersAsObject = function (e) { var t, n = this.getListeners(e); return n instanceof Array && (t = {}, t[e] = n), t || n }, i.addListener = function (e, n) { var i, r = this.getListenersAsObject(e), o = "object" == typeof n; for (i in r)r.hasOwnProperty(i) && -1 === t(r[i], n) && r[i].push(o ? n : {listener: n, once: !1}); return this }, i.on = n("addListener"), i.addOnceListener = function (e, t) { return this.addListener(e, {listener: t, once: !0}) }, i.once = n("addOnceListener"), i.defineEvent = function (e) { return this.getListeners(e), this }, i.defineEvents = function (e) { for (var t = 0; e.length > t; t += 1)this.defineEvent(e[t]); return this }, i.removeListener = function (e, n) { var i, r, o = this.getListenersAsObject(e); for (r in o)o.hasOwnProperty(r) && (i = t(o[r], n), -1 !== i && o[r].splice(i, 1)); return this }, i.off = n("removeListener"), i.addListeners = function (e, t) { return this.manipulateListeners(!1, e, t) }, i.removeListeners = function (e, t) { return this.manipulateListeners(!0, e, t) }, i.manipulateListeners = function (e, t, n) { var i, r, o = e ? this.removeListener : this.addListener, s = e ? this.removeListeners : this.addListeners; if ("object" != typeof t || t instanceof RegExp)for (i = n.length; i--;)o.call(this, t, n[i]); else for (i in t)t.hasOwnProperty(i) && (r = t[i]) && ("function" == typeof r ? o.call(this, i, r) : s.call(this, i, r)); return this }, i.removeEvent = function (e) { var t, n = typeof e, i = this._getEvents(); if ("string" === n)delete i[e]; else if ("object" === n)for (t in i)i.hasOwnProperty(t) && e.test(t) && delete i[t]; else delete this._events; return this }, i.removeAllListeners = n("removeEvent"), i.emitEvent = function (e, t) { var n, i, r, o, s = this.getListenersAsObject(e); for (r in s)if (s.hasOwnProperty(r))for (i = s[r].length; i--;)n = s[r][i], n.once === !0 && this.removeListener(e, n.listener), o = n.listener.apply(this, t || []), o === this._getOnceReturnValue() && this.removeListener(e, n.listener); return this }, i.trigger = n("emitEvent"), i.emit = function (e) { var t = Array.prototype.slice.call(arguments, 1); return this.emitEvent(e, t) }, i.setOnceReturnValue = function (e) { return this._onceReturnValue = e, this }, i._getOnceReturnValue = function () { return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0 }, i._getEvents = function () { return this._events || (this._events = {}) }, e.noConflict = function () { return r.EventEmitter = o, e }, "function" == typeof define && define.amd ? define("eventEmitter/EventEmitter", [], function () { return e }) : "object" == typeof module && module.exports ? module.exports = e : this.EventEmitter = e }).call(this), function (e) { function t(t) { var n = e.event; return n.target = n.target || n.srcElement || t, n } var n = document.documentElement, i = function () { }; n.addEventListener ? i = function (e, t, n) { e.addEventListener(t, n, !1) } : n.attachEvent && (i = function (e, n, i) { e[n + i] = i.handleEvent ? function () { var n = t(e); i.handleEvent.call(i, n) } : function () { var n = t(e); i.call(e, n) }, e.attachEvent("on" + n, e[n + i]) }); var r = function () { }; n.removeEventListener ? r = function (e, t, n) { e.removeEventListener(t, n, !1) } : n.detachEvent && (r = function (e, t, n) { e.detachEvent("on" + t, e[t + n]); try { delete e[t + n] } catch (i) { e[t + n] = void 0 } }); var o = {bind: i, unbind: r}; "function" == typeof define && define.amd ? define("eventie/eventie", o) : e.eventie = o }(this), function (e, t) { "function" == typeof define && define.amd ? define(["eventEmitter/EventEmitter", "eventie/eventie"], function (n, i) { return t(e, n, i) }) : "object" == typeof exports ? module.exports = t(e, require("eventEmitter"), require("eventie")) : e.imagesLoaded = t(e, e.EventEmitter, e.eventie) }(this, function (e, t, n) { function i(e, t) { for (var n in t)e[n] = t[n]; return e } function r(e) { return "[object Array]" === d.call(e) } function o(e) { var t = []; if (r(e))t = e; else if ("number" == typeof e.length)for (var n = 0, i = e.length; i > n; n++)t.push(e[n]); else t.push(e); return t } function s(e, t, n) { if (!(this instanceof s))return new s(e, t); "string" == typeof e && (e = document.querySelectorAll(e)), this.elements = o(e), this.options = i({}, this.options), "function" == typeof t ? n = t : i(this.options, t), n && this.on("always", n), this.getImages(), a && (this.jqDeferred = new a.Deferred); var r = this; setTimeout(function () { r.check() }) } function c(e) { this.img = e } function f(e) { this.src = e, v[e] = this } var a = e.jQuery, u = e.console, h = u !== void 0, d = Object.prototype.toString; s.prototype = new t, s.prototype.options = {}, s.prototype.getImages = function () { this.images = []; for (var e = 0, t = this.elements.length; t > e; e++) { var n = this.elements[e]; "IMG" === n.nodeName && this.addImage(n); for (var i = n.querySelectorAll("img"), r = 0, o = i.length; o > r; r++) { var s = i[r]; this.addImage(s) } } }, s.prototype.addImage = function (e) { var t = new c(e); this.images.push(t) }, s.prototype.check = function () { function e(e, r) { return t.options.debug && h && u.log("confirm", e, r), t.progress(e), n++, n === i && t.complete(), !0 } var t = this, n = 0, i = this.images.length; if (this.hasAnyBroken = !1, !i)return this.complete(), void 0; for (var r = 0; i > r; r++) { var o = this.images[r]; o.on("confirm", e), o.check() } }, s.prototype.progress = function (e) { this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded; var t = this; setTimeout(function () { t.emit("progress", t, e), t.jqDeferred && t.jqDeferred.notify && t.jqDeferred.notify(t, e) }) }, s.prototype.complete = function () { var e = this.hasAnyBroken ? "fail" : "done"; this.isComplete = !0; var t = this; setTimeout(function () { if (t.emit(e, t), t.emit("always", t), t.jqDeferred) { var n = t.hasAnyBroken ? "reject" : "resolve"; t.jqDeferred[n](t) } }) }, a && (a.fn.imagesLoaded = function (e, t) { var n = new s(this, e, t); return n.jqDeferred.promise(a(this)) }), c.prototype = new t, c.prototype.check = function () { var e = v[this.img.src] || new f(this.img.src); if (e.isConfirmed)return this.confirm(e.isLoaded, "cached was confirmed"), void 0; if (this.img.complete && void 0 !== this.img.naturalWidth)return this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), void 0; var t = this; e.on("confirm", function (e, n) { return t.confirm(e.isLoaded, n), !0 }), e.check() }, c.prototype.confirm = function (e, t) { this.isLoaded = e, this.emit("confirm", this, t) }; var v = {}; return f.prototype = new t, f.prototype.check = function () { if (!this.isChecked) { var e = new Image; n.bind(e, "load", this), n.bind(e, "error", this), e.src = this.src, this.isChecked = !0 } }, f.prototype.handleEvent = function (e) { var t = "on" + e.type; this[t] && this[t](e) }, f.prototype.onload = function (e) { this.confirm(!0, "onload"), this.unbindProxyEvents(e) }, f.prototype.onerror = function (e) { this.confirm(!1, "onerror"), this.unbindProxyEvents(e) }, f.prototype.confirm = function (e, t) { this.isConfirmed = !0, this.isLoaded = e, this.emit("confirm", this, t) }, f.prototype.unbindProxyEvents = function (e) { n.unbind(e.target, "load", this), n.unbind(e.target, "error", this) }, s }); /*! * scrollup v2.4.0 * Url: http://markgoodyear.com/labs/scrollup/ * Copyright (c) Mark Goodyear — @markgdyr — http://markgoodyear.com * License: MIT */ !function (l, o, e) { "use strict"; l.fn.scrollUp = function (o) { l.data(e.body, "scrollUp") || (l.data(e.body, "scrollUp", !0), l.fn.scrollUp.init(o)) }, l.fn.scrollUp.init = function (r) { var s, t, c, i, n, a, d, p = l.fn.scrollUp.settings = l.extend({}, l.fn.scrollUp.defaults, r), f = !1; switch (d = p.scrollTrigger ? l(p.scrollTrigger) : l("<a/>", { id: p.scrollName, href: "#top" }), p.scrollTitle && d.attr("title", p.scrollTitle), d.appendTo("body"), p.scrollImg || p.scrollTrigger || d.html(p.scrollText), d.css({ display: "none", position: "fixed", zIndex: p.zIndex }), p.activeOverlay && l("<div/>", {id: p.scrollName + "-active"}).css({ position: "absolute", top: p.scrollDistance + "px", width: "100%", borderTop: "1px dotted" + p.activeOverlay, zIndex: p.zIndex }).appendTo("body"), p.animation) { case"fade": s = "fadeIn", t = "fadeOut", c = p.animationSpeed; break; case"slide": s = "slideDown", t = "slideUp", c = p.animationSpeed; break; default: s = "show", t = "hide", c = 0 } i = "top" === p.scrollFrom ? p.scrollDistance : l(e).height() - l(o).height() - p.scrollDistance, n = l(o).scroll(function () { l(o).scrollTop() > i ? f || (d[s](c), f = !0) : f && (d[t](c), f = !1) }), p.scrollTarget ? "number" == typeof p.scrollTarget ? a = p.scrollTarget : "string" == typeof p.scrollTarget && (a = Math.floor(l(p.scrollTarget).offset().top)) : a = 0, d.click(function (o) { o.preventDefault(), l("html, body").animate({scrollTop: a}, p.scrollSpeed, p.easingType) }) }, l.fn.scrollUp.defaults = { scrollName: "scrollUp", scrollDistance: 300, scrollFrom: "top", scrollSpeed: 300, easingType: "linear", animation: "fade", animationSpeed: 200, scrollTrigger: !1, scrollTarget: !1, scrollText: "Scroll to top", scrollTitle: !1, scrollImg: !1, activeOverlay: !1, zIndex: 2147483647 }, l.fn.scrollUp.destroy = function (r) { l.removeData(e.body, "scrollUp"), l("#" + l.fn.scrollUp.settings.scrollName).remove(), l("#" + l.fn.scrollUp.settings.scrollName + "-active").remove(), l.fn.jquery.split(".")[1] >= 7 ? l(o).off("scroll", r) : l(o).unbind("scroll", r) }, l.scrollUp = l.fn.scrollUp }(jQuery, window, document);