/*! UIkit 1.1.0 | http://www.getuikit.com | (c) 2013 YOOtheme | MIT License */ (function($, doc) { "use strict"; var UI = $.UIkit || {}; if (UI.fn) { return; } UI.fn = function(command, options) { var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2]; if (!UI[component]) { $.error("UIkit component [" + component + "] does not exist."); return this; } return this.each(function() { var $this = $(this), data = $this.data(component); if (!data) $this.data(component, (data = new UI[component](this, method ? undefined : options))); if (method) data[method].apply(data, Array.prototype.slice.call(args, 1)); }); }; UI.support = {}; UI.support.transition = (function() { var transitionEnd = (function() { var element = doc.body || doc.documentElement, transEndEventNames = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend', transition: 'transitionend' }, name; for (name in transEndEventNames) { if (element.style[name] !== undefined) { return transEndEventNames[name]; } } }()); return transitionEnd && { end: transitionEnd }; })(); UI.support.touch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch); UI.Utils = {}; UI.Utils.debounce = function(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; UI.Utils.options = function(string) { if ($.isPlainObject(string)) return string; var start = string.indexOf("{"), options = {}; if (start != -1) { try { options = (new Function("", "var json = " + string.substr(start) + "; return JSON.parse(JSON.stringify(json));"))(); } catch (e) {} } return options; }; $.UIkit = UI; $.fn.uk = UI.fn; $.UIkit.langdirection = $("html").attr("dir") == "rtl" ? "right" : "left"; })(jQuery, document); ;(function($){ var touch = {}, touchTimeout, tapTimeout, swipeTimeout, longTapDelay = 750, longTapTimeout; function parentIfText(node) { return 'tagName' in node ? node : node.parentNode; } function swipeDirection(x1, x2, y1, y2) { var xDelta = Math.abs(x1 - x2), yDelta = Math.abs(y1 - y2); return xDelta >= yDelta ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down'); } function longTap() { longTapTimeout = null; if (touch.last) { touch.el.trigger('longTap'); touch = {}; } } function cancelLongTap() { if (longTapTimeout) clearTimeout(longTapTimeout); longTapTimeout = null; } function cancelAll() { if (touchTimeout) clearTimeout(touchTimeout); if (tapTimeout) clearTimeout(tapTimeout); if (swipeTimeout) clearTimeout(swipeTimeout); if (longTapTimeout) clearTimeout(longTapTimeout); touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null; touch = {}; } $(document).ready(function(){ var now, delta; $(document.body) .bind('touchstart', function(e){ now = Date.now(); delta = now - (touch.last || now); touch.el = $(parentIfText(e.originalEvent.touches[0].target)); if(touchTimeout) clearTimeout(touchTimeout); touch.x1 = e.originalEvent.touches[0].pageX; touch.y1 = e.originalEvent.touches[0].pageY; if (delta > 0 && delta <= 250) touch.isDoubleTap = true; touch.last = now; longTapTimeout = setTimeout(longTap, longTapDelay); }) .bind('touchmove', function(e){ cancelLongTap(); touch.x2 = e.originalEvent.touches[0].pageX; touch.y2 = e.originalEvent.touches[0].pageY; }) .bind('touchend', function(e){ cancelLongTap(); // swipe if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)) swipeTimeout = setTimeout(function() { touch.el.trigger('swipe'); touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2))); touch = {}; }, 0); // normal tap else if ('last' in touch) // delay by one tick so we can cancel the 'tap' event if 'scroll' fires // ('tap' fires before 'scroll') tapTimeout = setTimeout(function() { // trigger universal 'tap' with the option to cancelTouch() // (cancelTouch cancels processing of single vs double taps for faster 'tap' response) var event = $.Event('tap'); event.cancelTouch = cancelAll; touch.el.trigger(event); // trigger double tap immediately if (touch.isDoubleTap) { touch.el.trigger('doubleTap'); touch = {}; } // trigger single tap after 250ms of inactivity else { touchTimeout = setTimeout(function(){ touchTimeout = null; touch.el.trigger('singleTap'); touch = {}; }, 250); } }, 0); }) .bind('touchcancel', cancelAll); $(window).bind('scroll', cancelAll); }); ['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(m){ $.fn[m] = function(callback){ return this.bind(m, callback); }; }); })(jQuery); (function($, UI) { "use strict"; var Alert = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element).on("click", this.options.trigger, function(e) { e.preventDefault(); $this.close(); }); }; $.extend(Alert.prototype, { options: { "fade": true, "duration": 200, "trigger": ".uk-alert-close" }, close: function() { var element = this.element.trigger("close"); if (this.options.fade) { element.css("overflow", "hidden").css("max-height", element.height()).animate({ "height": 0, "opacity": 0, "padding-top": 0, "padding-bottom": 0, "margin-top": 0, "margin-bottom": 0 }, this.options.duration, removeElement); } else { removeElement(); } function removeElement() { element.trigger("closed").remove(); } } }); UI["alert"] = Alert; // init code $(document).on("click.alert.uikit", "[data-uk-alert]", function(e) { var ele = $(this); if (!ele.data("alert")) { ele.data("alert", new Alert(ele, UI.Utils.options(ele.data("uk-alert")))); if ($(e.target).is(ele.data("alert").options.trigger)) { e.preventDefault(); ele.data("alert").close(); } } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var ButtonRadio = function(element, options) { var $this = this, $element = $(element); this.options = $.extend({}, this.options, options); this.element = $element.on("click", this.options.target, function(e) { e.preventDefault(); $element.find($this.options.target).not(this).removeClass("uk-active").blur(); $element.trigger("change", [$(this).addClass("uk-active")]); }); }; $.extend(ButtonRadio.prototype, { options: { "target": ".uk-button" }, getSelected: function() { this.element.find(".uk-active"); } }); var ButtonCheckbox = function(element, options) { var $element = $(element); this.options = $.extend({}, this.options, options); this.element = $element.on("click", this.options.target, function(e) { e.preventDefault(); $element.trigger("change", [$(this).toggleClass("uk-active").blur()]); }); }; $.extend(ButtonCheckbox.prototype, { options: { "target": ".uk-button" }, getSelected: function() { this.element.find(".uk-active"); } }); var Button = function(element) { var $this = this; this.element = $(element).on("click", function(e) { e.preventDefault(); $this.toggle(); $this.element.blur(); }); }; $.extend(Button.prototype, { toggle: function() { this.element.toggleClass("uk-active"); } }); UI["button"] = Button; UI["button-checkbox"] = ButtonCheckbox; UI["button-radio"] = ButtonRadio; // init code $(document).on("click.button-radio.uikit", "[data-uk-button-radio]", function(e) { var ele = $(this); if (!ele.data("button-radio")) { ele.data("button-radio", new ButtonRadio(ele, UI.Utils.options(ele.data("uk-button-radio")))); if ($(e.target).is(ele.data("button-radio").options.target)) { $(e.target).trigger("click"); } } }); $(document).on("click.button-checkbox.uikit", "[data-uk-button-checkbox]", function(e) { var ele = $(this); if (!ele.data("button-checkbox")) { ele.data("button-checkbox", new ButtonCheckbox(ele, UI.Utils.options(ele.data("uk-button-checkbox")))); if ($(e.target).is(ele.data("button-checkbox").options.target)) { $(e.target).trigger("click"); } } }); $(document).on("click.button.uikit", "[data-uk-button]", function(e) { var ele = $(this); if (!ele.data("button")) { ele.data("button", new Button(ele, ele.data("uk-button"))).trigger("click"); } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var active = false, Dropdown = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element); this.dropdown = this.element.find(".uk-dropdown"); this.centered = this.dropdown.hasClass("uk-dropdown-center"); this.justified = this.options.justify ? $(this.options.justify) : false; this.boundary = $(this.options.boundary); if(!this.boundary.length) { this.boundary = $(window); } if (this.options.mode == "click") { this.element.on("click", function(e) { if (!$(e.target).parents(".uk-dropdown").length) { e.preventDefault(); } if (active && active[0] != $this.element[0]) { active.removeClass("uk-open"); } if (!$this.element.hasClass("uk-open")) { $this.checkDimensions(); $this.element.addClass("uk-open"); active = $this.element; $(document).off("click.outer.dropdown"); setTimeout(function() { $(document).on("click.outer.dropdown", function(e) { if (active && active[0] == $this.element[0] && ($(e.target).is("a") || !$this.element.find(".uk-dropdown").find(e.target).length)) { active.removeClass("uk-open"); $(document).off("click.outer.dropdown"); } }); }, 10); } else { if ($(e.target).is("a") || !$this.element.find(".uk-dropdown").find(e.target).length) { $this.element.removeClass("uk-open"); active = false; } } }); } else { this.element.on("mouseenter", function(e) { if ($this.remainIdle) { clearTimeout($this.remainIdle); } if (active && active[0] != $this.element[0]) { active.removeClass("uk-open"); } $this.checkDimensions(); $this.element.addClass("uk-open"); active = $this.element; }).on("mouseleave", function() { $this.remainIdle = setTimeout(function() { $this.element.removeClass("uk-open"); $this.remainIdle = false; if (active && active[0] == $this.element[0]) active = false; }, $this.options.remaintime); }); } }; $.extend(Dropdown.prototype, { remainIdle: false, options: { "mode": "hover", "remaintime": 800, "justify": false, "boundary": $(window) }, checkDimensions: function() { if(!this.dropdown.length) return; var dropdown = this.dropdown.css("margin-" + $.UIkit.langdirection, "").css("min-width", ""), offset = dropdown.show().offset(), width = dropdown.outerWidth(), boundarywidth = this.boundary.width(), boundaryoffset = this.boundary.offset() ? this.boundary.offset().left:0; // centered dropdown if (this.centered) { dropdown.css("margin-" + $.UIkit.langdirection, (parseFloat(width) / 2 - dropdown.parent().width() / 2) * -1); offset = dropdown.offset(); // reset dropdown if ((width + offset.left) > boundarywidth || offset.left < 0) { dropdown.css("margin-" + $.UIkit.langdirection, ""); offset = dropdown.offset(); } } // justify dropdown if (this.justified && this.justified.length) { var jwidth = this.justified.outerWidth(); dropdown.css("min-width", jwidth); if ($.UIkit.langdirection == 'right') { var right1 = boundarywidth - (this.justified.offset().left + jwidth), right2 = boundarywidth - (dropdown.offset().left + dropdown.outerWidth()); dropdown.css("margin-right", right1 - right2); } else { dropdown.css("margin-left", this.justified.offset().left - offset.left); } offset = dropdown.offset(); } if ((width + (offset.left-boundaryoffset)) > boundarywidth) { dropdown.addClass("uk-dropdown-flip"); offset = dropdown.offset(); } if (offset.left < 0) { dropdown.addClass("uk-dropdown-stack"); } dropdown.css("display", ""); } }); UI["dropdown"] = Dropdown; // init code $(document).on("mouseenter.dropdown.uikit", "[data-uk-dropdown]", function(e) { var ele = $(this); if (!ele.data("dropdown")) { ele.data("dropdown", new Dropdown(ele, UI.Utils.options(ele.data("uk-dropdown")))); if (ele.data("dropdown").options.mode == "hover") { ele.trigger("mouseenter"); } } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var win = $(window), event = 'resize orientationchange', GridMatchHeight = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element); this.columns = this.element.children(); this.elements = this.options.target ? this.element.find(this.options.target) : this.columns; if (!this.columns.length) return; win.on(event, (function() { var fn = function() { $this.match(); }; $(function() { fn(); win.on("load", fn); }); return UI.Utils.debounce(fn, 150); })()); }; $.extend(GridMatchHeight.prototype, { options: { "target": false }, match: function() { this.revert(); var firstvisible = this.columns.filter(":visible:first"); if (!firstvisible.length) return; var stacked = Math.ceil(100 * parseFloat(firstvisible.css('width')) / parseFloat(firstvisible.parent().css('width'))) >= 100 ? true : false, max = 0, $this = this; if (stacked) return; this.elements.each(function() { max = Math.max(max, $(this).outerHeight()); }).each(function(i) { var element = $(this), boxheight = element.css("box-sizing") == "border-box" ? "outerHeight" : "height", box = $this.columns.eq(i), height = (element.height() + (max - box[boxheight]())); element.css('min-height', height + 'px'); }); return this; }, revert: function() { this.elements.css('min-height', ''); return this; } }); var GridMargin = function(element) { var $this = this; this.element = $(element); this.columns = this.element.children(); if (!this.columns.length) return; win.on(event, (function() { var fn = function() { $this.process(); }; $(function() { fn(); win.on("load", fn); }); return UI.Utils.debounce(fn, 150); })()); }; $.extend(GridMargin.prototype, { process: function() { this.revert(); var skip = false, firstvisible = this.columns.filter(":visible:first"), offset = firstvisible.length ? firstvisible.offset().top : false; if (offset === false) return; this.columns.each(function() { var column = $(this); if (column.is(":visible")) { if (skip) { column.addClass("uk-grid-margin"); } else { if (column.offset().top != offset) { column.addClass("uk-grid-margin"); skip = true; } } } }); return this; }, revert: function() { this.columns.removeClass('uk-grid-margin'); return this; } }); UI["grid-match"] = GridMatchHeight; UI["grid-margin"] = GridMargin; // init code $(function() { $("[data-uk-grid-match],[data-uk-grid-margin]").each(function() { var grid = $(this); if (grid.is("[data-uk-grid-match]") && !grid.data("grid-match")) { grid.data("grid-match", new GridMatchHeight(grid, UI.Utils.options(grid.data("uk-grid-match")))); } if (grid.is("[data-uk-grid-margin]") && !grid.data("grid-margin")) { grid.data("grid-margin", new GridMargin(grid, UI.Utils.options(grid.data("uk-grid-margin")))); } }); }); })(jQuery, jQuery.UIkit); (function($, UI, $win) { "use strict"; var active = false, html = $("html"), Modal = function(element, options) { var $this = this; this.element = $(element); this.options = $.extend({ keyboard: true, show: false, bgclose: true }, options); this.transition = UI.support.transition; this.dialog = this.element.find(".uk-modal-dialog"); this.element.on("click", ".uk-modal-close", function(e) { e.preventDefault(); $this.hide(); }).on("click", function(e) { var target = $(e.target); if (target[0] == $this.element[0] && $this.options.bgclose) { $this.hide(); } }); if (this.options.keyboard) { $(document).on('keyup.ui.modal.escape', function(e) { if (active && e.which == 27 && $this.isActive()) $this.hide(); }); } }; $.extend(Modal.prototype, { transition: false, toggle: function() { this[this.isActive() ? "hide" : "show"](); }, show: function() { var $this = this; if (this.isActive()) return; if (active) active.hide(true); this.resize(); this.element.removeClass("uk-open").show(); active = this; html.addClass("uk-modal-page").height(); // force browser engine redraw this.element.addClass("uk-open").trigger("uk.modal.show"); }, hide: function(force) { if (!this.isActive()) return; if (!force && UI.support.transition) { var $this = this; this.element.one(UI.support.transition.end, function() { $this._hide(); }).removeClass("uk-open"); } else { this._hide(); } }, resize: function() { this.dialog.css("margin-left", ""); var modalwidth = parseInt(this.dialog.css("width"), 10), inview = (modalwidth + parseInt(this.dialog.css("margin-left"),10) + parseInt(this.dialog.css("margin-right"),10)) < $win.width(); this.dialog.css("margin-left", modalwidth && inview ? -1*Math.ceil(modalwidth/2) : ""); }, _hide: function() { this.element.hide().removeClass("uk-open"); html.removeClass("uk-modal-page"); if(active===this) active = false; this.element.trigger("uk.modal.hide"); }, isActive: function() { return (active == this); } }); var ModalTrigger = function(element, options) { var $this = this, $element = $(element); this.options = $.extend({ "target": $element.is("a") ? $element.attr("href") : false }, options); this.element = $element; this.modal = new Modal(this.options.target, options); $element.on("click", function(e) { e.preventDefault(); $this.show(); }); //methods $.each(["show", "hide", "isActive"], function(index, method) { $this[method] = function() { return $this.modal[method](); }; }); }; ModalTrigger.Modal = Modal; UI["modal"] = ModalTrigger; // init code $(document).on("click.modal.uikit", "[data-uk-modal]", function(e) { var ele = $(this); if (!ele.data("modal")) { ele.data("modal", new ModalTrigger(ele, UI.Utils.options(ele.data("uk-modal")))); ele.data("modal").show(); } }); $win.on("resize orientationchange", UI.Utils.debounce(function(){ if(active) active.resize(); }, 150)); })(jQuery, jQuery.UIkit, jQuery(window)); (function($, UI) { "use strict"; if (UI.support.touch) { $("html").addClass("uk-touch"); } var $win = $(window), $doc = $(document), Offcanvas = { show: function(element) { element = $(element); if (!element.length) return; var doc = $("html"), bar = element.find(".uk-offcanvas-bar:first"), dir = bar.hasClass("uk-offcanvas-bar-flip") ? -1 : 1, scrollbar = dir == -1 && $win.width() < window.innerWidth ? (window.innerWidth - $win.width()) : 0; scrollpos = {x: window.scrollX, y: window.scrollY}; element.addClass("uk-active"); doc.css({"width": window.innerWidth, "height": window.innerHeight}).addClass("uk-offcanvas-page"); doc.css("margin-left", ((bar.outerWidth() - scrollbar) * dir)).width(); // .width() - force redraw bar.addClass("uk-offcanvas-bar-show").width(); element.off(".ukoffcanvas").on("click.ukoffcanvas swipeRight.ukoffcanvas swipeLeft.ukoffcanvas", function(e) { var target = $(e.target); if (!e.type.match(/swipe/)) { if (target.hasClass("uk-offcanvas-bar")) return; if (target.parents(".uk-offcanvas-bar:first").length) return; } e.stopImmediatePropagation(); Offcanvas.hide(); }); $doc.on('keydown.offcanvas', function(e) { if (e.keyCode === 27) { // ESC Offcanvas.hide(); } }); }, hide: function(force) { var doc = $("html"), panel = $(".uk-offcanvas.uk-active"), bar = panel.find(".uk-offcanvas-bar:first"); if (!panel.length) return; if ($.UIkit.support.transition && !force) { doc.one($.UIkit.support.transition.end, function() { doc.removeClass("uk-offcanvas-page").attr("style", ""); panel.removeClass("uk-active"); window.scrollTo(scrollpos.x, scrollpos.y); }).css("margin-left", ""); setTimeout(function(){ bar.removeClass("uk-offcanvas-bar-show"); }, 50); } else { doc.removeClass("uk-offcanvas-page").attr("style", ""); panel.removeClass("uk-active"); bar.removeClass("uk-offcanvas-bar-show"); window.scrollTo(scrollpos.x, scrollpos.y); } panel.off(".ukoffcanvas"); $doc.off(".ukoffcanvas"); } }, scrollpos; var OffcanvasTrigger = function(element, options) { var $this = this, $element = $(element); this.options = $.extend({ "target": $element.is("a") ? $element.attr("href") : false }, options); this.element = $element; $element.on("click", function(e) { e.preventDefault(); Offcanvas.show($this.options.target); }); }; OffcanvasTrigger.offcanvas = Offcanvas; UI["offcanvas"] = OffcanvasTrigger; // init code $doc.on("click.offcanvas.uikit", "[data-uk-offcanvas]", function(e) { e.preventDefault(); var ele = $(this); if (!ele.data("offcanvas")) { ele.data("offcanvas", new OffcanvasTrigger(ele, UI.Utils.options(ele.data("uk-offcanvas")))); ele.trigger("click"); } }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var Nav = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element).on("click", this.options.toggler, function(e) { e.preventDefault(); var ele = $(this); $this.open(ele.parent()[0] == $this.element[0] ? ele : ele.parent("li")); }); this.element.find(this.options.lists).each(function() { var $ele = $(this), parent = $ele.parent(), active = parent.hasClass("uk-active"); $ele.wrap('
'); parent.data("list-container", $ele.parent()); if (active) $this.open(parent, true); }); }; $.extend(Nav.prototype, { options: { "toggler": ">li.uk-parent > a[href='#']", "lists": ">li.uk-parent > ul", "multiple": false }, open: function(li, noanimation) { var element = this.element, $li = $(li); if (!this.options.multiple) { element.children(".uk-open").not(li).each(function() { if ($(this).data("list-container")) { $(this).data("list-container").stop().animate({height: 0}, function() { $(this).parent().removeClass("uk-open"); }); } }); } $li.toggleClass("uk-open"); if ($li.data("list-container")) { if (noanimation) { $li.data('list-container').stop().height($li.hasClass("uk-open") ? "auto" : 0); } else { $li.data('list-container').stop().animate({ height: ($li.hasClass("uk-open") ? getHeight($li.data('list-container').find('ul:first')) : 0) }); } } } }); UI["nav"] = Nav; // helper function getHeight(ele) { var $ele = $(ele), height = "auto"; if ($ele.is(":visible")) { height = $ele.outerHeight(); } else { var tmp = { position: $ele.css("position"), visibility: $ele.css("visibility"), display: $ele.css("display") }; height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight(); $ele.css(tmp); // reset element } return height; } // init code $(function() { $("[data-uk-nav]").each(function() { var nav = $(this); if (!nav.data("nav")) { nav.data("nav", new Nav(nav, UI.Utils.options(nav.data("uk-nav")))); } }); }); })(jQuery, jQuery.UIkit); (function($, UI) { "use strict"; var $tooltip; // tooltip container var Tooltip = function(element, options) { var $this = this; this.options = $.extend({}, this.options, options); this.element = $(element).on({ "focus" : function(e) { $this.show(); }, "blur" : function(e) { $this.hide(); }, "mouseenter": function(e) { $this.show(); }, "mouseleave": function(e) { $this.hide(); } }); this.tip = typeof(this.options.src) === "function" ? this.options.src.call(this.element) : this.options.src; // disable title attribute this.element.attr("data-cached-title", this.element.attr("title")).attr("title", ""); }; $.extend(Tooltip.prototype, { tip: "", options: { "offset": 5, "pos": "top", "src": function() { return this.attr("title"); } }, show: function() { if (!this.tip.length) return; $tooltip.css({"top": -2000, "visibility": "hidden"}).show(); $tooltip.html('