http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/1bd00e9a/_static/js/bootstrap-docbird.js ---------------------------------------------------------------------- diff --git a/_static/js/bootstrap-docbird.js b/_static/js/bootstrap-docbird.js deleted file mode 100644 index d884899..0000000 --- a/_static/js/bootstrap-docbird.js +++ /dev/null @@ -1,64 +0,0 @@ -(function ($) { - /** - * Patch all tables to remove ``docutils`` class and add Bootstrap base - * ``table`` class. - */ - patchTables = function () { - $("table.docutils") - .removeClass("docutils") - .addClass("table") - .attr("border", 0); - }; - - $(window).load(function () { - /* - * Scroll the window to avoid the topnav bar - * https://github.com/twitter/bootstrap/issues/1768 - */ - if ($("#navbar.navbar-fixed-top").length > 0) { - var navHeight = $("#navbar").height(), - shiftWindow = function() { scrollBy(0, -navHeight - 10); }; - - if (location.hash) { - setTimeout(shiftWindow, 1); - } - - window.addEventListener("hashchange", shiftWindow); - } - }); - - $(document).ready(function () { - // Add styling, structure to TOC's. - $(".dropdown-menu").each(function () { - $(this).find("ul").each(function (index, item){ - var $item = $(item); - $item.addClass('unstyled'); - }); - }); - - // Patch tables. - patchTables(); - - // Add Note, Warning styles. (BS v2,3 compatible). - $('.admonition').addClass('alert alert-info') - .filter('.warning, .caution') - .removeClass('alert-info') - .addClass('alert-warning').end() - .filter('.error, .danger') - .removeClass('alert-info') - .addClass('alert-danger alert-error').end(); - - // Inline code styles to Bootstrap style. - $('tt.docutils.literal').not(".xref").each(function (i, e) { - // ignore references - if (!$(e).parent().hasClass("reference")) { - $(e).replaceWith(function () { - return $("<code />").html($(this).html()); - }); - }}); - - // Update sourcelink to remove outerdiv (fixes appearance in navbar). - var $srcLink = $(".nav #sourcelink"); - $srcLink.parent().html($srcLink.html()); - }); -}(window.$jqTheme || window.jQuery));
http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/1bd00e9a/_static/js/docbird.js ---------------------------------------------------------------------- diff --git a/_static/js/docbird.js b/_static/js/docbird.js deleted file mode 100644 index 6fc2dc1..0000000 --- a/_static/js/docbird.js +++ /dev/null @@ -1,61 +0,0 @@ -function makeDraftDocument() { - var path = window.location.pathname; - if (path.startsWith('/docbird/staging')) { - var projectHeaders = $('.db-header-projectname h1'); - projectHeaders.append(' <span>(draft)</span>'); - - $('#rateYo').hide(); - - $.ajax({ - type: "GET", - url: path, - success: function(res, status, xhr) { - var projectTitle = $('.db-project-info .db-code-link'); - var expires = xhr.getResponseHeader('x-ton-expires'); - var draftAdmonition = '<div class="admonition important alert alert-info">' + - '<p class="last">The document that you\'re viewing is a draft. ' + - 'It expires on ' + expires + '.</p>' + - '</div>'; - projectTitle.after(draftAdmonition); - } - }); - } -} - -$(function() { - makeDraftDocument(); - - // Adjust header height on scroll - var showing = true; - var scroll_handler = function() { - var pos = $(window).scrollTop(); - var large_doc = $(window).height() + 180 < $(document).height(); - // Only hide the header for longer pages else header gets small, scroll pos drops to zero, header gets big... - if (showing && pos > 60 && large_doc) { - // hide the header - showing = false; - $("body").addClass('db-header-small'); - if (pos > 150) { - $(window).scrollTop(pos - 75); - } else { - $(window).scrollTop(75); - } - } - - if (!showing && pos < 60) { - showing = true; - $("body").removeClass('db-header-small'); - $(window).scrollTop(0); - } - }; - $(window).scroll(scroll_handler); -}); - -$(function() { - $('.graphviz').each(function() { - var $img = $(this).find("img:last"); - $(this).prepend($("<img class='mag' src='_static/mag.png'>")); - $(this).wrapInner($('<a>', {'href': $img.attr("src"), 'data-featherlight': 'image'})); - }); - $.featherlight(); -}); http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/1bd00e9a/_static/js/featherlight.min.js ---------------------------------------------------------------------- diff --git a/_static/js/featherlight.min.js b/_static/js/featherlight.min.js deleted file mode 100644 index 4497f00..0000000 --- a/_static/js/featherlight.min.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Featherlight - ultra slim jQuery lightbox - * Version 0.4.1 - http://noelboss.github.io/featherlight/ - * - * Copyright 2014, Noël Raoul Bossart (http://www.noelboss.com) - * MIT Licensed. -**/ -!function(a){"use strict";if("undefined"==typeof a)return void("console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery."));var b=a.featherlight=function(c,d){if(this.constructor===b)this.id=b.id++;else{if("string"==typeof c||!1!=c instanceof a){var e=(new b).setup(c,d);return e.config.open.call(e),e}d=a.extend({},b.defaults,c||{}),a(d.selector,d.context).featherlight()}},c=function(a){if(27===a.keyCode&&!a.isDefaultPrevented()){var c=b.current();c&&c.config.closeOnEsc&&(c.$instance.find("."+c.config.namespace+"-close:first").click(),a.preventDefault())}};a.extend(b,{id:0,defaults:{autostart:!0,namespace:"featherlight",selector:"[data-featherlight]",context:"body",type:{image:!1,ajax:!1},targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"✕",beforeOpen:a.noop,beforeClose:a.noop,afterOpen:a.noop,afterClose:a. noop,contentFilters:["jquery","image","html","ajax"],open:function(a){var b=this.config.beforeOpen.call(this,a);return!1!==b&&(b=this.open(a)),!1!==b&&this.config.afterOpen.call(this,a),b},close:function(a){var b=this.config.beforeClose.call(this,a);!1!==b&&(this.close(a),this.config.afterClose.call(this,a))}},methods:{setup:function(c,d){"object"!=typeof c||c instanceof a!=!1||d||(d=c,c=void 0),d=a.extend({},b.defaults,d);var e=d.resetCss?d.namespace+"-reset":d.namespace,f=a(d.background||'<div class="'+e+'"><div class="'+e+'-content"><span class="'+e+"-close-icon "+d.namespace+'-close">'+d.closeIcon+"</span></div></div>"),g=this;return a.extend(g,{config:d,target:c,$instance:f.clone().addClass(d.variant)}),g.$instance.on(d.closeTrigger+"."+d.namespace,function(b){var c=a(b.target);("background"===d.closeOnClick&&c.is("."+d.namespace)||"anywhere"===d.closeOnClick||c.is("."+d.namespace+"-close"))&&(b.preventDefault(),d.close.call(g))}),g.$instance.on("featherlightGetCurrent",functio n(a){g.$instance.closest("body").length>0&&(a.currentFeatherlight=g)}),this},attach:function(b,c,d){var e={};return a.each(b[0].attributes,function(){var b=this.name.match(/^data-featherlight-(.*)/);if(b){var c=this.value;try{c=a.parseJSON(c)}catch(d){}e[a.camelCase(b[1])]=c}}),this.$elm=b,this.setup(c,a.extend(e,d)),b.on(this.config.openTrigger+"."+this.config.namespace,a.proxy(this.config.open,this)),this},getContent:function(){var c,d=this,e=d.target||d.$elm.attr(d.config.targetAttr)||"";for(var f in d.config.type)d.config.type[f]===!0&&(c=b.contentFilters[f]);if(!c&&e in b.contentFilters&&(c=b.contentFilters[e],e=d.target&&d.$elm.attr(d.config.targetAttr)),e=e||d.$elm.attr("href")||"",!c){var g=e;if(e=null,a.each(d.config.contentFilters,function(){return c=b.contentFilters[this],c.test&&(e=c.test(g)),!e&&c.regex&&g.match&&g.match(c.regex)&&(e=g),!e}),!e)return"console"in window&&window.console.error("Featherlight: no content filter found "+(g?' for "'+g+'"':" (no target specifie d)")),!1}return c.process.call(d,e)},setContent:function(b){var c=this;(b.is("iframe")||a("iframe",b).length>0)&&c.$instance.addClass(c.config.namespace+"-iframe"),c.$content=b.clone().addClass(c.config.namespace+"-inner"),c.$instance.find("."+c.config.namespace+"-inner").remove(),c.$instance.find("."+c.config.namespace+"-content").append(c.$content)},open:function(d){d&&d.preventDefault();var e=this.getContent();return e?(this.config.closeOnEsc&&c&&(a(document).bind("keyup."+b.defaults.namespace,c),c=null),this.setContent(e),this.$instance.appendTo("body").fadeIn(this.config.openSpeed),void 0):!1},close:function(){var a=this;a.$instance.fadeOut(a.config.closeSpeed,function(){a.$instance.detach()})}},contentFilters:{jquery:{regex:/^[#.]\w/,test:function(b){return b instanceof a&&b},process:function(b){return a(b)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp)(\?\S*)?$/i,process:function(b){return a('<img src="'+b+'" alt="" class="'+this.config.namespace+'-image" />')}},html:{regex:/^ \s*<[\w!][^<]*>/,process:function(b){return a(b)}},ajax:{regex:/./,process:function(b){var c=this,d=a("<div></div>").load(b,function(b,e){"error"!==e&&a.featherlight(d.html(),a.extend(c.config,{type:{html:!0}}))})}}},current:function(){var b=new a.Event("featherlightGetCurrent");return a.event.trigger(b),b.currentFeatherlight},close:function(){var a=b.current();a&&a.config.close.call(a)}}),b.prototype=a.extend(b.methods,{constructor:b}),a.fn.featherlight=function(c,d){return this.each(function(){(new b).attach(a(this),d,c)}),this},a(document).ready(function(){var c=b.defaults;c.autostart&&a(c.selector,c.context).featherlight()})}(jQuery); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-distributedlog/blob/1bd00e9a/_static/js/ifvisible.js ---------------------------------------------------------------------- diff --git a/_static/js/ifvisible.js b/_static/js/ifvisible.js deleted file mode 100644 index ed396db..0000000 --- a/_static/js/ifvisible.js +++ /dev/null @@ -1,304 +0,0 @@ -(function() { - (function(root, factory) { - if (typeof define === 'function' && define.amd) { - return define(function() { - return factory(); - }); - } else if (typeof exports === 'object') { - return module.exports = factory(); - } else { - return root.ifvisible = factory(); - } - })(this, function() { - var addEvent, customEvent, doc, fireEvent, hidden, idleStartedTime, idleTime, ie, ifvisible, init, initialized, status, trackIdleStatus, visibilityChange; - ifvisible = {}; - doc = document; - initialized = false; - status = "active"; - idleTime = 60000; - idleStartedTime = false; - customEvent = (function() { - var S4, addCustomEvent, cgid, fireCustomEvent, guid, listeners, removeCustomEvent; - S4 = function() { - return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); - }; - guid = function() { - return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4(); - }; - listeners = {}; - cgid = '__ceGUID'; - addCustomEvent = function(obj, event, callback) { - obj[cgid] = undefined; - if (!obj[cgid]) { - obj[cgid] = "ifvisible.object.event.identifier"; - } - if (!listeners[obj[cgid]]) { - listeners[obj[cgid]] = {}; - } - if (!listeners[obj[cgid]][event]) { - listeners[obj[cgid]][event] = []; - } - return listeners[obj[cgid]][event].push(callback); - }; - fireCustomEvent = function(obj, event, memo) { - var ev, j, len, ref, results; - if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { - ref = listeners[obj[cgid]][event]; - results = []; - for (j = 0, len = ref.length; j < len; j++) { - ev = ref[j]; - results.push(ev(memo || {})); - } - return results; - } - }; - removeCustomEvent = function(obj, event, callback) { - var cl, i, j, len, ref; - if (callback) { - if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { - ref = listeners[obj[cgid]][event]; - for (i = j = 0, len = ref.length; j < len; i = ++j) { - cl = ref[i]; - if (cl === callback) { - listeners[obj[cgid]][event].splice(i, 1); - return cl; - } - } - } - } else { - if (obj[cgid] && listeners[obj[cgid]] && listeners[obj[cgid]][event]) { - return delete listeners[obj[cgid]][event]; - } - } - }; - return { - add: addCustomEvent, - remove: removeCustomEvent, - fire: fireCustomEvent - }; - })(); - addEvent = (function() { - var setListener; - setListener = false; - return function(el, ev, fn) { - if (!setListener) { - if (el.addEventListener) { - setListener = function(el, ev, fn) { - return el.addEventListener(ev, fn, false); - }; - } else if (el.attachEvent) { - setListener = function(el, ev, fn) { - return el.attachEvent('on' + ev, fn, false); - }; - } else { - setListener = function(el, ev, fn) { - return el['on' + ev] = fn; - }; - } - } - return setListener(el, ev, fn); - }; - })(); - fireEvent = function(element, event) { - var evt; - if (doc.createEventObject) { - return element.fireEvent('on' + event, evt); - } else { - evt = doc.createEvent('HTMLEvents'); - evt.initEvent(event, true, true); - return !element.dispatchEvent(evt); - } - }; - ie = (function() { - var all, check, div, undef, v; - undef = void 0; - v = 3; - div = doc.createElement("div"); - all = div.getElementsByTagName("i"); - check = function() { - return (div.innerHTML = "<!--[if gt IE " + (++v) + "]><i></i><![endif]-->", all[0]); - }; - while (check()) { - continue; - } - if (v > 4) { - return v; - } else { - return undef; - } - })(); - hidden = false; - visibilityChange = void 0; - if (typeof doc.hidden !== "undefined") { - hidden = "hidden"; - visibilityChange = "visibilitychange"; - } else if (typeof doc.mozHidden !== "undefined") { - hidden = "mozHidden"; - visibilityChange = "mozvisibilitychange"; - } else if (typeof doc.msHidden !== "undefined") { - hidden = "msHidden"; - visibilityChange = "msvisibilitychange"; - } else if (typeof doc.webkitHidden !== "undefined") { - hidden = "webkitHidden"; - visibilityChange = "webkitvisibilitychange"; - } - trackIdleStatus = function() { - var timer, wakeUp; - timer = false; - wakeUp = function() { - clearTimeout(timer); - if (status !== "active") { - ifvisible.wakeup(); - } - idleStartedTime = +(new Date()); - return timer = setTimeout(function() { - if (status === "active") { - return ifvisible.idle(); - } - }, idleTime); - }; - wakeUp(); - addEvent(doc, "mousemove", wakeUp); - addEvent(doc, "keyup", wakeUp); - addEvent(window, "scroll", wakeUp); - ifvisible.focus(wakeUp); - return ifvisible.wakeup(wakeUp); - }; - init = function() { - var blur; - if (initialized) { - return true; - } - if (hidden === false) { - blur = "blur"; - if (ie < 9) { - blur = "focusout"; - } - addEvent(window, blur, function() { - return ifvisible.blur(); - }); - addEvent(window, "focus", function() { - return ifvisible.focus(); - }); - } else { - addEvent(doc, visibilityChange, function() { - if (doc[hidden]) { - return ifvisible.blur(); - } else { - return ifvisible.focus(); - } - }, false); - } - initialized = true; - return trackIdleStatus(); - }; - ifvisible = { - setIdleDuration: function(seconds) { - return idleTime = seconds * 1000; - }, - getIdleDuration: function() { - return idleTime; - }, - getIdleInfo: function() { - var now, res; - now = +(new Date()); - res = {}; - if (status === "idle") { - res.isIdle = true; - res.idleFor = now - idleStartedTime; - res.timeLeft = 0; - res.timeLeftPer = 100; - } else { - res.isIdle = false; - res.idleFor = now - idleStartedTime; - res.timeLeft = (idleStartedTime + idleTime) - now; - res.timeLeftPer = (100 - (res.timeLeft * 100 / idleTime)).toFixed(2); - } - return res; - }, - focus: function(callback) { - if (typeof callback === "function") { - return this.on("focus", callback); - } - status = "active"; - customEvent.fire(this, "focus"); - customEvent.fire(this, "wakeup"); - return customEvent.fire(this, "statusChanged", { - status: status - }); - }, - blur: function(callback) { - if (typeof callback === "function") { - return this.on("blur", callback); - } - status = "hidden"; - customEvent.fire(this, "blur"); - customEvent.fire(this, "idle"); - return customEvent.fire(this, "statusChanged", { - status: status - }); - }, - idle: function(callback) { - if (typeof callback === "function") { - return this.on("idle", callback); - } - status = "idle"; - customEvent.fire(this, "idle"); - return customEvent.fire(this, "statusChanged", { - status: status - }); - }, - wakeup: function(callback) { - if (typeof callback === "function") { - return this.on("wakeup", callback); - } - status = "active"; - customEvent.fire(this, "wakeup"); - return customEvent.fire(this, "statusChanged", { - status: status - }); - }, - on: function(name, callback) { - init(); - return customEvent.add(this, name, callback); - }, - off: function(name, callback) { - init(); - return customEvent.remove(this, name, callback); - }, - onEvery: function(seconds, callback) { - var paused, t; - init(); - paused = false; - if (callback) { - t = setInterval(function() { - if (status === "active" && paused === false) { - return callback(); - } - }, seconds * 1000); - } - return { - stop: function() { - return clearInterval(t); - }, - pause: function() { - return paused = true; - }, - resume: function() { - return paused = false; - }, - code: t, - callback: callback - }; - }, - now: function(check) { - init(); - return status === (check || "active"); - } - }; - return ifvisible; - }); - -}).call(this); - -//# sourceMappingURL=ifvisible.js.map
