/*! http://mths.be/placeholder v2.0.7 by @mathias */ ; (function (h, j, e) { var a = "placeholder" in j.createElement("input"); var f = "placeholder" in j.createElement("textarea"); var k = e.fn; var d = e.valHooks; var b = e.propHooks; var m; var l; if (a && f) { l = k.placeholder = function () { return this }; l.input = l.textarea = true } else { l = k.placeholder = function () { var n = this; n.filter((a ? "textarea" : ":input") + "[placeholder]").not(".placeholder").bind({ "focus.placeholder": c, "blur.placeholder": g }).data("placeholder-enabled", true).trigger("blur.placeholder"); return n }; l.input = a; l.textarea = f; m = { get: function (o) { var n = e(o); var p = n.data("placeholder-password"); if (p) { return p[0].value } return n.data("placeholder-enabled") && n.hasClass("placeholder") ? "" : o.value }, set: function (o, q) { var n = e(o); var p = n.data("placeholder-password"); if (p) { return p[0].value = q } if (!n.data("placeholder-enabled")) { return o.value = q } if (q == "") { o.value = q; if (o != j.activeElement) { g.call(o) } } else { if (n.hasClass("placeholder")) { c.call(o, true, q) || (o.value = q) } else { o.value = q } } return n } }; if (!a) { d.input = m; b.value = m } if (!f) { d.textarea = m; b.value = m } e(function () { e(j).delegate("form", "submit.placeholder", function () { var n = e(".placeholder", this).each(c); setTimeout(function () { n.each(g) }, 10) }) }); e(h).bind("beforeunload.placeholder", function () { e(".placeholder").each(function () { this.value = "" }) }) } function i(o) { var n = {}; var p = /^jQuery\d+$/; e.each(o.attributes, function (r, q) { if (q.specified && !p.test(q.name)) { n[q.name] = q.value } }); return n } function c(o, p) { var n = this; var q = e(n); if (n.value == q.attr("placeholder") && q.hasClass("placeholder")) { if (q.data("placeholder-password")) { q = q.hide().next().show().attr("id", q.removeAttr("id").data("placeholder-id")); if (o === true) { return q[0].value = p } q.focus() } else { n.value = ""; q.removeClass("placeholder"); n == j.activeElement && n.select() } } } function g() { var r; var n = this; var q = e(n); var p = this.id; if (n.value == "") { if (n.type == "password") { if (!q.data("placeholder-textinput")) { try { r = q.clone().attr({ type: "text" }) } catch (o) { r = e("").attr(e.extend(i(this), { type: "text" })) } r.removeAttr("name").data({ "placeholder-password": q, "placeholder-id": p }).bind("focus.placeholder", c); q.data({ "placeholder-textinput": r, "placeholder-id": p }).before(r) } q = q.removeAttr("id").hide().prev().attr("id", p).show() } q.addClass("placeholder"); q[0].value = q.attr("placeholder") } else { q.removeClass("placeholder") } } }(this, document, jQuery)); /* Modernizr 2.6.2 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-touch-cssclasses-teststyles-prefixes */ ; window.Modernizr = function (a, b, c) { function w(a) { j.cssText = a } function x(a, b) { return w(m.join(a + ";") + (b || "")) } function y(a, b) { return typeof a === b } function z(a, b) { return !!~("" + a).indexOf(b) } function A(a, b, d) { for (var e in a) { var f = b[a[e]]; if (f !== c) return d === !1 ? a[e] : y(f, "function") ? f.bind(d || b) : f } return !1 } var d = "2.6.2", e = {}, f = !0, g = b.documentElement, h = "modernizr", i = b.createElement(h), j = i.style, k, l = {}.toString, m = " -webkit- -moz- -o- -ms- ".split(" "), n = {}, o = {}, p = {}, q = [], r = q.slice, s, t = function (a, c, d, e) { var f, i, j, k, l = b.createElement("div"), m = b.body, n = m || b.createElement("body"); if (parseInt(d, 10)) while (d--) j = b.createElement("div"), j.id = e ? e[d] : h + (d + 1), l.appendChild(j); return f = ["", '"].join(""), l.id = h, (m ? l : n).innerHTML += f, n.appendChild(l), m || (n.style.background = "", n.style.overflow = "hidden", k = g.style.overflow, g.style.overflow = "hidden", g.appendChild(n)), i = c(l, a), m ? l.parentNode.removeChild(l) : (n.parentNode.removeChild(n), g.style.overflow = k), !!i }, u = {}.hasOwnProperty, v; !y(u, "undefined") && !y(u.call, "undefined") ? v = function (a, b) { return u.call(a, b) } : v = function (a, b) { return b in a && y(a.constructor.prototype[b], "undefined") }, Function.prototype.bind || (Function.prototype.bind = function (b) { var c = this; if (typeof c != "function") throw new TypeError; var d = r.call(arguments, 1), e = function () { if (this instanceof e) { var a = function () { }; a.prototype = c.prototype; var f = new a, g = c.apply(f, d.concat(r.call(arguments))); return Object(g) === g ? g : f } return c.apply(b, d.concat(r.call(arguments))) }; return e }), n.touch = function () { var c; return "ontouchstart" in a || a.DocumentTouch && b instanceof DocumentTouch ? c = !0 : t(["@media (", m.join("touch-enabled),("), h, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function (a) { c = a.offsetTop === 9 }), c }; for (var B in n) v(n, B) && (s = B.toLowerCase(), e[s] = n[B](), q.push((e[s] ? "" : "no-") + s)); return e.addTest = function (a, b) { if (typeof a == "object") for (var d in a) v(a, d) && e.addTest(d, a[d]); else { a = a.toLowerCase(); if (e[a] !== c) return e; b = typeof b == "function" ? b() : b, typeof f != "undefined" && f && (g.className += " " + (b ? "" : "no-") + a), e[a] = b } return e }, w(""), i = k = null, e._version = d, e._prefixes = m, e.testStyles = t, g.className = g.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + q.join(" ") : ""), e }(this, this.document); Modernizr.addTest('android', function () { return !!navigator.userAgent.match(/Android/i) }); Modernizr.addTest('chrome', function () { return !!navigator.userAgent.match(/Chrome/i) }); Modernizr.addTest('firefox', function () { return !!navigator.userAgent.match(/Firefox/i) }); Modernizr.addTest('iemobile', function () { return !!navigator.userAgent.match(/IEMobile/i) }); Modernizr.addTest('ie', function () { return !!navigator.userAgent.match(/MSIE/i) }); Modernizr.addTest('ie8', function () { return !!navigator.userAgent.match(/MSIE 8/i) }); Modernizr.addTest('ie10', function () { return !!navigator.userAgent.match(/MSIE 10/i) }); Modernizr.addTest('ie11', function () { return !!navigator.userAgent.match(/Trident.*rv:11\./) }); Modernizr.addTest('ios', function () { return !!navigator.userAgent.match(/iPhone|iPad|iPod/i) }); Modernizr.addTest('ios7 ipad', function () { return !!navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i) }); /*! * screenfull * v1.0.4 - 2013-05-26 * https://github.com/sindresorhus/screenfull.js * (c) Sindre Sorhus; MIT License */ (function (a, b) { "use strict"; var c = "undefined" != typeof Element && "ALLOW_KEYBOARD_INPUT" in Element, d = function () { for (var a, c, d = [["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror"], ["webkitRequestFullScreen", "webkitCancelFullScreen", "webkitCurrentFullScreenElement", "webkitCancelFullScreen", "webkitfullscreenchange", "webkitfullscreenerror"], ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror"]], e = 0, f = d.length, g = {}; f > e; e++)if (a = d[e], a && a[1] in b) { for (e = 0, c = a.length; c > e; e++)g[d[0][e]] = a[e]; return g } return !1 }(), e = { request: function (a) { var e = d.requestFullscreen; a = a || b.documentElement, /5\.1[\.\d]* Safari/.test(navigator.userAgent) ? a[e]() : a[e](c && Element.ALLOW_KEYBOARD_INPUT) }, exit: function () { b[d.exitFullscreen]() }, toggle: function (a) { this.isFullscreen ? this.exit() : this.request(a) }, onchange: function () { }, onerror: function () { }, raw: d }; return d ? (Object.defineProperties(e, { isFullscreen: { get: function () { return !!b[d.fullscreenElement] } }, element: { enumerable: !0, get: function () { return b[d.fullscreenElement] } }, enabled: { enumerable: !0, get: function () { return !!b[d.fullscreenEnabled] } } }), b.addEventListener(d.fullscreenchange, function (a) { e.onchange.call(e, a) }), b.addEventListener(d.fullscreenerror, function (a) { e.onerror.call(e, a) }), a.screenfull = e, void 0) : a.screenfull = !1 })(window, document); // data-shift api +function ($) { "use strict"; /* SHIFT CLASS DEFINITION * ====================== */ var Shift = function (element) { this.$element = $(element) this.$prev = this.$element.prev() !this.$prev.length && (this.$parent = this.$element.parent()) } Shift.prototype = { constructor: Shift , init: function () { var $el = this.$element , method = $el.data()['toggle'].split(':')[1] , $target = $el.data('target') $el.hasClass('in') || $el[method]($target).addClass('in') } , reset: function () { this.$parent && this.$parent['prepend'](this.$element) !this.$parent && this.$element['insertAfter'](this.$prev) this.$element.removeClass('in') } } /* SHIFT PLUGIN DEFINITION * ======================= */ $.fn.shift = function (option) { return this.each(function () { var $this = $(this) , data = $this.data('shift') if (!data) $this.data('shift', (data = new Shift(this))) if (typeof option == 'string') data[option]() }) } $.fn.shift.Constructor = Shift }(jQuery); // data-bjax api // data-bjax api +function ($) { "use strict"; var Bjax = function (element, options) { this.options = options this.$element = $(this.options.target || 'html'); this.start() } Bjax.DEFAULTS = { backdrop: true , url: '' } Bjax.prototype.start = function () { var that = this; this.backdrop(); $.ajax(this.options.url).done(function (r) { that.$content = r; that.complete(); }); } Bjax.prototype.complete = function () { var that = this; if (this.$element.is('html') || (this.options.replace)) { try { window.history.pushState({}, '', this.options.url); } catch (e) { window.location.replace(this.options.url) } } this.updateBar(100); } Bjax.prototype.backdrop = function () { this.$element.css('position', 'relative') this.$backdrop = $('
') .appendTo(this.$element); if (!this.options.backdrop) this.$backdrop.css('height', '2'); this.$backdrop[0].offsetWidth; // force reflow this.$backdrop.addClass('in'); this.$bar = $('') .width(0) .appendTo(this.$backdrop); } Bjax.prototype.update = function () { this.$element.css('position', ''); if (!this.$element.is('html')) { if (this.options.el) { this.$content = $(this.$content).find(this.options.el); } this.$element.html(this.$content); } if (this.$element.is('html')) { if ($('.ie').length) { location.reload(); return; } document.open(); document.write(this.$content); document.close(); } } Bjax.prototype.updateBar = function (per) { var that = this; this.$bar.stop().animate({ width: per + '%' }, 500, 'linear', function () { if (per == 100) that.update(); }); } Bjax.prototype.enable = function (e) { var link = e.currentTarget; if (location.protocol !== link.protocol || location.hostname !== link.hostname) return false if (link.hash && link.href.replace(link.hash, '') === location.href.replace(location.hash, '')) return false if (link.href === location.href + '#' || link.href === location.href) return false if (link.protocol.indexOf('http') == -1) return false return true; } $.fn.bjax = function (option) { return this.each(function () { var $this = $(this); var data = $this.data('app.bjax'); var options = $.extend({}, Bjax.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data) $this.data('app.bjax', (data = new Bjax(this, options))) if (data) data['start']() if (typeof option == 'string') data[option]() }) } $.fn.bjax.Constructor = Bjax $(window).on("popstate", function (e) { if (e.originalEvent.state !== null) { window.location.reload(true); } e.preventDefault(); }); $(document).on('click.app.bjax.data-api', '[data-bjax], .nav-primary a', function (e) { if (!Bjax.prototype.enable(e)) return; $(this).bjax({ url: $(this).attr('href') || $(this).attr('data-url') }); e.preventDefault(); }) }(jQuery); Date.now = Date.now || function () { return +new Date; }; +function ($) { $(function () { // toogle fullscreen $(document).on('click', "[data-toggle=fullscreen]", function (e) { e.preventDefault(); if (screenfull.enabled) { screenfull.request(); } }); // placeholder $('input[placeholder], textarea[placeholder]').placeholder(); // popover $("[data-toggle=popover]").popover(); $(document).on('click', '.popover-title .close', function (e) { var $target = $(e.target), $popover = $target.closest('.popover').prev(); $popover && $popover.popover('hide'); }); // $(document).on('click', '[data-toggle="ajaxModal"]', // function(e) { // $('#ajaxModal').remove(); // e.preventDefault(); // var $this = $(this) // , $remote = $this.data('remote') || $this.attr('href') // , $modal = $('