From 44d7257691db8b036317d9e43a572f6de348a6df Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Mon, 13 Feb 2017 23:07:54 +0800 Subject: [PATCH] bump: 2.4.0 --- lib/docsify.js | 6 ++++++ lib/docsify.min.js | 4 ++-- lib/plugins/search.js | 2 +- lib/plugins/search.min.js | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/docsify.js b/lib/docsify.js index cacdf375e..dd41db405 100644 --- a/lib/docsify.js +++ b/lib/docsify.js @@ -2818,6 +2818,7 @@ var Hook = function Hook () { this.afterHooks = []; this.initHooks = []; this.readyHooks = []; + this.doneEachHooks = []; }; Hook.prototype.beforeEach = function beforeEach (fn) { @@ -2828,6 +2829,10 @@ Hook.prototype.afterEach = function afterEach (fn) { this.afterHooks.push(fn); }; +Hook.prototype.doneEach = function doneEach (fn) { + this.doneEachHooks.push(fn); +}; + Hook.prototype.init = function init (fn) { this.initHooks.push(fn); }; @@ -2991,6 +2996,7 @@ var Docsify = function () { mainRender(function (_) { scrollIntoView(); activeLink('nav'); + window.Docsify.hook.emit('doneEach'); }); }; diff --git a/lib/docsify.min.js b/lib/docsify.min.js index 01d5c580b..821df19da 100644 --- a/lib/docsify.min.js +++ b/lib/docsify.min.js @@ -1,2 +1,2 @@ -var D=function(){"use strict";function e(e,t,n){void 0===t&&(t="GET");var r=new XMLHttpRequest;return r.open(t,e),r.send(),{then:function(e,t){if(void 0===t&&(t=function(){}),n){var i=setInterval(function(e){return n({step:Math.floor(5*Math.random()+1)})},500);r.addEventListener("progress",n),r.addEventListener("loadend",function(e){n(e),clearInterval(i)})}r.addEventListener("error",t),r.addEventListener("load",function(n){var r=n.target;r.status>=400?t(r):e(r.response)})},abort:function(){return 4!==r.readyState&&r.abort()}}}function t(e,t){var n=[],r={};return e.forEach(function(e){var i=e.level||1,o=i-1;i>t||(r[o]?(r[o].children=r[o].children||[],r[o].children.push(e)):n.push(e),r[i]=e)}),n}function n(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}function r(e){return null===e||void 0===e}function i(){var e=window.location;if(M===e.hash&&!r(j))return j;var t=e.hash.replace(/%23/g,"#").match(/^#\/([^#]+)/);return t=t&&2===t.length?t[1]:/^#\//.test(e.hash)?"":e.pathname,j=t,M=e.hash,t}function o(){return document.body.clientWidth<=600}function a(e){var t=/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g,n=!1,r="-";if(a.occurrences=a.occurrences||{},"string"!=typeof e)return"";n||(e=e.toLowerCase());var i=e.trim().replace(/<[^>\d]+>/g,"").replace(t,"").replace(/\s/g,r).replace(/-+/g,r).replace(/^(\d)/,"_$1"),o=a.occurrences[i];return a.occurrences.hasOwnProperty(i)?o++:o=0,a.occurrences[i]=o,o&&(i=i+"-"+o),i}function s(e){return e.replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g,function(e){return e.replace(/:/g,"__colon__")}).replace(/:(\w*?):/gi,'$1').replace(/__colon__/g,":")}function l(){function e(){for(var e,o=document.body.scrollTop,l=0,u=n.length;lo){e||(e=d);break}e=d}if(e){var p=s[e.getAttribute("data-id")];if(p&&p!==c&&(c&&c.classList.remove("active"),p.classList.add("active"),c=p,!t&&!h.noSticky)){var g=0,f=c.offsetTop+c.clientHeight+40,m=c.offsetTop>=i.scrollTop&&f<=i.scrollTop+a,y=f-g=e||h.dom.classList.contains("hidden")?(document.body.classList.add("sticky"),h.noSticky=!1):(document.body.classList.remove("sticky"),h.noSticky=!0)}()}function g(e,t){return t={exports:{}},e(t,t.exports),t.exports}function f(e){return e?(/\/\//.test(e)||(e="https://github.com/"+e),e=e.replace(/^git\+/,""),'\n \n \n '):""}function m(){var e=b()+'';return(o()?e+"
":"
"+e)+'
\n
\n
\n
'}function y(){var e=", 100%, 85%",t="linear-gradient(to left bottom, hsl("+(Math.floor(255*Math.random())+e)+") 0%, hsl("+(Math.floor(255*Math.random())+e)+") 100%)";return'
\n
\n
\n
'}function b(){return''}function v(e,t){return void 0===t&&(t=""),e&&e.length?(e.forEach(function(e){t+='
  • '+e.title+"
  • ",e.children&&(t+='
    • '+v(e.children)+"
    ")}),t):""}function k(e,t){return'

    '+t.slice(5).trim()+"

    "}function w(e){return""}function x(e){e.innerHTML=e.innerHTML.replace(/var\(\s*--theme-color.*?\)/g,$docsify.themeColor)}function L(){if(!(window.CSS&&window.CSS.supports&&window.CSS.supports("(--foo: red)"))){var t=document.querySelectorAll("style:not(.inserted),link");[].forEach.call(t,function(t){if("STYLE"===t.nodeName)x(t);else if("LINK"===t.nodeName){var n=t.getAttribute("href");if(!/\.css$/.test(n))return;e(n).then(function(e){var t=document.createElement("style");t.innerHTML=e,document.head.appendChild(t),x(t)})}})}}function S(){var e=new F.Renderer;e.heading=function(e,t){var n=a(e),r="";return r="#/"+i(),D.push({level:t,slug:r+"#"+encodeURIComponent(n),title:e}),"'+e+""},e.code=function(e,t){void 0===t&&(t="");var n=W.highlight(e,W.languages[t]||W.languages.markup);return'
    '+n+"
    "},e.link=function(e,t,n){return/:|(\/{2})/.test(e)||(e=("#/"+e).replace(/\/+/g,"/")),''+n+""},e.paragraph=function(e){return/^!>/.test(e)?k("tip",e):/^\?>/.test(e)?k("warn",e):"

    "+e+"

    "},e.image=function(e,t,n){var r=/:|(\/{2})/.test(e)?e:($docsify.basePath+e).replace(/\/+/g,"/"),i=t?' title="'+t+'"':"";return''+n+'"},"function"==typeof $docsify.markdown?z=$docsify.markdown.call(this,z,e):($docsify.markdown&&$docsify.markdown.renderer&&($docsify.markdown.renderer=O(e,$docsify.markdown.renderer)),z.setOptions(O({renderer:e},$docsify.markdown)));var t=z;z=function(e){return s(t(e))},window.Docsify.utils.marked=function(e){var t=z(e);return D=[],t}}function $(e,t){var n=document.querySelector("nav")||document.createElement("nav"),r=document.body,i=document.head;if($docsify.repo||n.classList.add("no-badge"),e[t?"outerHTML":"innerHTML"]=f($docsify.repo)+($docsify.coverpage?y():"")+m(),r.insertBefore(n,r.children[0]),$docsify.themeColor&&(i.innerHTML+=w($docsify.themeColor),L()),$docsify.name){var a=document.querySelector(".sidebar");a.innerHTML='

    '+$docsify.name+"

    "+a.innerHTML}d("button.sidebar-toggle"),$docsify.coverpage?!o()&&window.addEventListener("scroll",h):r.classList.add("sticky")}function _(e){var t=window.Docsify.hook,n=function(e){if(G("article",e),$docsify.loadSidebar||E(),e&&"undefined"!=typeof Vue){R.vm&&R.vm.$destroy();var t=[].slice.call(document.body.querySelectorAll("article>script")).filter(function(e){return!/template/.test(e.type)})[0],n=t?t.innerText.trim():null;t&&t.remove(),R.vm=n?new Function("return "+n)():new Vue({el:"main"}),R.vm&&R.vm.$nextTick(function(e){return l()})}$docsify.auto2top&&setTimeout(function(){return p($docsify.auto2top)},0)};t.emit("before",e,function(e){var r=e?z(e):"";t.emit("after",r,function(e){return n(e||"not found")})})}function C(e){R.navbar&&R.navbar===e||(R.navbar=e,e&&G("nav",z(e)),u("nav"))}function E(e){var n;e?(n=z(e),n=n.match(/]*>([\s\S]+)<\/ul>/g)[0]):n=v(t(D,$docsify.maxLevel),"