[build] 4.2.1
This commit is contained in:
parent
437737cc5a
commit
efa8d25912
21 changed files with 17 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
|||

|
||||
|
||||
# docsify <small>4.2.0</small>
|
||||
# docsify <small>4.2.1</small>
|
||||
|
||||
> A magical documentation site generator.
|
||||
|
||||
|
|
|
|||
|
|
@ -3800,7 +3800,7 @@ initGlobalAPI();
|
|||
/**
|
||||
* Version
|
||||
*/
|
||||
Docsify.version = '4.2.0';
|
||||
Docsify.version = '4.2.1';
|
||||
|
||||
/**
|
||||
* Run Docsify
|
||||
|
|
|
|||
4
lib/docsify.min.js
vendored
4
lib/docsify.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,3 @@
|
|||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
|
|
|
|||
2
lib/plugins/emoji.min.js
vendored
2
lib/plugins/emoji.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,3 @@
|
|||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
|
|
|
|||
2
lib/plugins/external-script.min.js
vendored
2
lib/plugins/external-script.min.js
vendored
|
|
@ -1 +1 @@
|
|||
this.D=this.D||{},function(){"use strict";function e(){for(var e=Docsify.dom.getNode("#main"),i=Docsify.dom.findAll(e,"script"),o=i.length;o--;){var t=i[o];if(t&&t.src){var n=document.createElement("script");Array.prototype.slice.call(t.attributes).forEach(function(e){n[e.name]=e.value}),t.parentNode.insertBefore(n,t),t.parentNode.removeChild(t)}}}var i=function(i){i.doneEach(e)};window.$docsify.plugins=[].concat(i,window.$docsify.plugins)}();
|
||||
!function(){"use strict";function e(){for(var e=Docsify.dom.getNode("#main"),o=Docsify.dom.findAll(e,"script"),n=o.length;n--;){var i=o[n];if(i&&i.src){var t=document.createElement("script");Array.prototype.slice.call(i.attributes).forEach(function(e){t[e.name]=e.value}),i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i)}}}var o=function(o){o.doneEach(e)};window.$docsify.plugins=[].concat(o,window.$docsify.plugins)}();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
|
|
|
|||
2
lib/plugins/front-matter.min.js
vendored
2
lib/plugins/front-matter.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,3 @@
|
|||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
|
|
|
|||
2
lib/plugins/ga.min.js
vendored
2
lib/plugins/ga.min.js
vendored
|
|
@ -1 +1 @@
|
|||
this.D=this.D||{},function(){"use strict";function n(){var n=document.createElement("script");n.async=!0,n.src="https://www.google-analytics.com/analytics.js",document.body.appendChild(n)}function i(i){n(),window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=Number(new Date),window.ga("create",i,"auto")}function o(){window.ga||i($docsify.ga),window.ga("set","page",location.hash),window.ga("send","pageview")}var a=function(n){if(!$docsify.ga)return void console.error("[Docsify] ga is required.");n.beforeEach(o)};$docsify.plugins=[].concat(a,$docsify.plugins)}();
|
||||
!function(){"use strict";function n(){var n=document.createElement("script");n.async=!0,n.src="https://www.google-analytics.com/analytics.js",document.body.appendChild(n)}function o(o){n(),window.ga=window.ga||function(){(window.ga.q=window.ga.q||[]).push(arguments)},window.ga.l=Number(new Date),window.ga("create",o,"auto")}function i(){window.ga||o($docsify.ga),window.ga("set","page",location.hash),window.ga("send","pageview")}var a=function(n){if(!$docsify.ga)return void console.error("[Docsify] ga is required.");n.beforeEach(i)};$docsify.plugins=[].concat(a,$docsify.plugins)}();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
|
|
|
|||
2
lib/plugins/search.min.js
vendored
2
lib/plugins/search.min.js
vendored
|
|
@ -1 +1 @@
|
|||
this.D=this.D||{},function(){"use strict";function e(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'\/]/g,function(e){return n[e]})}function n(e){var n=[];return h.dom.findAll("a:not([data-nosearch])").map(function(t){var o=t.href,i=t.getAttribute("href"),r=e.parse(o).path;r&&-1===n.indexOf(r)&&!Docsify.util.isAbsolutePath(i)&&n.push(r)}),n}function t(e){localStorage.setItem("docsify.search.expires",Date.now()+e),localStorage.setItem("docsify.search.index",JSON.stringify(y))}function o(e,n,t){void 0===n&&(n="");var o,i=window.marked.lexer(n),r=window.Docsify.slugify,a={};return i.forEach(function(n){if("heading"===n.type&&n.depth<=2)o=t.toURL(e,{id:r(n.text)}),a[o]={slug:o,title:n.text,body:""};else{if(!o)return;a[o]?a[o].body?a[o].body+="\n"+(n.text||""):a[o].body=n.text:a[o]={slug:o,title:"",body:""}}}),r.clear(),a}function i(n){var t=[],o=[];Object.keys(y).forEach(function(e){o=o.concat(Object.keys(y[e]).map(function(n){return y[e][n]}))}),n=[].concat(n,n.trim().split(/[\s\-\,\\\/]+/));for(var i=0;i<o.length;i++)!function(i){var r=o[i],a=!1,s="",c=r.title&&r.title.trim(),f=r.body&&r.body.trim(),l=r.slug||"";if(c&&f&&(n.forEach(function(n,t){var o=new RegExp(n,"gi"),i=-1,r=-1;if(i=c&&c.search(o),r=f&&f.search(o),i<0&&r<0)a=!1;else{a=!0,r<0&&(r=0);var l=0,d=0;l=r<11?0:r-10,d=0===l?70:r+n.length+60,d>f.length&&(d=f.length);var u="..."+e(f).substring(l,d).replace(o,'<em class="search-keyword">'+n+"</em>")+"...";s+=u}}),a)){var d={title:e(c),content:s,url:l};t.push(d)}}(i);return t}function r(e,i){h=Docsify;var r="auto"===e.paths,a=localStorage.getItem("docsify.search.expires")<Date.now();if(y=JSON.parse(localStorage.getItem("docsify.search.index")),a)y={};else if(!r)return;var s=r?n(i.router):e.paths,c=s.length,f=0;s.forEach(function(n){if(y[n])return f++;h.get(i.router.getFile(n)).then(function(r){y[n]=o(n,r,i.router),c===++f&&t(e.maxAge)})})}function a(){var e=Docsify.dom.create("style","\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 7px;\n line-height: 22px;\n font-size: 14px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}");Docsify.dom.appendTo(Docsify.dom.head,e)}function s(e,n){void 0===n&&(n="");var t='<input type="search" value="'+n+'" /><div class="results-panel"></div></div>',o=Docsify.dom.create("div",t),i=Docsify.dom.find("aside");Docsify.dom.toggleClass(o,"search"),Docsify.dom.before(i,o)}function c(e){var n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,".results-panel");if(!e)return t.classList.remove("show"),void(t.innerHTML="");var o=i(e),r="";o.forEach(function(e){r+='<div class="matching-post">\n<h2><a href="'+e.url+'">'+e.title+"</a></h2>\n<p>"+e.content+"</p>\n</div>"}),t.classList.add("show"),t.innerHTML=r||'<p class="empty">'+m+"</p>"}function f(){var e,n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,"input");Docsify.dom.on(n,"click",function(e){return"A"!==e.target.tagName&&e.stopPropagation()}),Docsify.dom.on(t,"input",function(n){clearTimeout(e),e=setTimeout(function(e){return c(n.target.value.trim())},100)})}function l(e,n){var t=Docsify.dom.getNode('.search input[type="search"]');if(t)if("string"==typeof e)t.placeholder=e;else{var o=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];t.placeholder=e[o]}}function d(e,n){if("string"==typeof e)m=e;else{var t=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];m=e[t]}}function u(e,n){var t=n.router.parse().query.s;a(),s(e,t),f(),t&&setTimeout(function(e){return c(t)},500)}function p(e,n){l(e.placeholder,n.route.path),d(e.noData,n.route.path)}var h,y={},m="",g={placeholder:"Type to search",noData:"No Results!",paths:"auto",maxAge:864e5},v=function(e,n){var t=Docsify.util,o=n.config.search||g;Array.isArray(o)?g.paths=o:"object"==typeof o&&(g.paths=Array.isArray(o.paths)?o.paths:"auto",g.maxAge=t.isPrimitive(o.maxAge)?o.maxAge:g.maxAge,g.placeholder=o.placeholder||g.placeholder,g.noData=o.noData||g.noData);var i="auto"===g.paths;e.mounted(function(e){u(g,n),!i&&r(g,n)}),e.doneEach(function(e){p(g,n),i&&r(g,n)})};$docsify.plugins=[].concat(v,$docsify.plugins)}();
|
||||
!function(){"use strict";function e(e){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return String(e).replace(/[&<>"'\/]/g,function(e){return n[e]})}function n(e){var n=[];return h.dom.findAll("a:not([data-nosearch])").map(function(t){var o=t.href,i=t.getAttribute("href"),r=e.parse(o).path;r&&-1===n.indexOf(r)&&!Docsify.util.isAbsolutePath(i)&&n.push(r)}),n}function t(e){localStorage.setItem("docsify.search.expires",Date.now()+e),localStorage.setItem("docsify.search.index",JSON.stringify(y))}function o(e,n,t){void 0===n&&(n="");var o,i=window.marked.lexer(n),r=window.Docsify.slugify,a={};return i.forEach(function(n){if("heading"===n.type&&n.depth<=2)o=t.toURL(e,{id:r(n.text)}),a[o]={slug:o,title:n.text,body:""};else{if(!o)return;a[o]?a[o].body?a[o].body+="\n"+(n.text||""):a[o].body=n.text:a[o]={slug:o,title:"",body:""}}}),r.clear(),a}function i(n){var t=[],o=[];Object.keys(y).forEach(function(e){o=o.concat(Object.keys(y[e]).map(function(n){return y[e][n]}))}),n=[].concat(n,n.trim().split(/[\s\-\,\\\/]+/));for(var i=0;i<o.length;i++)!function(i){var r=o[i],a=!1,s="",c=r.title&&r.title.trim(),f=r.body&&r.body.trim(),l=r.slug||"";if(c&&f&&(n.forEach(function(n,t){var o=new RegExp(n,"gi"),i=-1,r=-1;if(i=c&&c.search(o),r=f&&f.search(o),i<0&&r<0)a=!1;else{a=!0,r<0&&(r=0);var l=0,d=0;l=r<11?0:r-10,d=0===l?70:r+n.length+60,d>f.length&&(d=f.length);var u="..."+e(f).substring(l,d).replace(o,'<em class="search-keyword">'+n+"</em>")+"...";s+=u}}),a)){var d={title:e(c),content:s,url:l};t.push(d)}}(i);return t}function r(e,i){h=Docsify;var r="auto"===e.paths,a=localStorage.getItem("docsify.search.expires")<Date.now();if(y=JSON.parse(localStorage.getItem("docsify.search.index")),a)y={};else if(!r)return;var s=r?n(i.router):e.paths,c=s.length,f=0;s.forEach(function(n){if(y[n])return f++;h.get(i.router.getFile(n)).then(function(r){y[n]=o(n,r,i.router),c===++f&&t(e.maxAge)})})}function a(){var e=Docsify.dom.create("style","\n.sidebar {\n padding-top: 0;\n}\n\n.search {\n margin-bottom: 20px;\n padding: 6px;\n border-bottom: 1px solid #eee;\n}\n\n.search .results-panel {\n display: none;\n}\n\n.search .results-panel.show {\n display: block;\n}\n\n.search input {\n outline: none;\n border: none;\n width: 100%;\n padding: 7px;\n line-height: 22px;\n font-size: 14px;\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n}\n\n.search h2 {\n font-size: 17px;\n margin: 10px 0;\n}\n\n.search a {\n text-decoration: none;\n color: inherit;\n}\n\n.search .matching-post {\n border-bottom: 1px solid #eee;\n}\n\n.search .matching-post:last-child {\n border-bottom: 0;\n}\n\n.search p {\n font-size: 14px;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.search p.empty {\n text-align: center;\n}");Docsify.dom.appendTo(Docsify.dom.head,e)}function s(e,n){void 0===n&&(n="");var t='<input type="search" value="'+n+'" /><div class="results-panel"></div></div>',o=Docsify.dom.create("div",t),i=Docsify.dom.find("aside");Docsify.dom.toggleClass(o,"search"),Docsify.dom.before(i,o)}function c(e){var n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,".results-panel");if(!e)return t.classList.remove("show"),void(t.innerHTML="");var o=i(e),r="";o.forEach(function(e){r+='<div class="matching-post">\n<h2><a href="'+e.url+'">'+e.title+"</a></h2>\n<p>"+e.content+"</p>\n</div>"}),t.classList.add("show"),t.innerHTML=r||'<p class="empty">'+m+"</p>"}function f(){var e,n=Docsify.dom.find("div.search"),t=Docsify.dom.find(n,"input");Docsify.dom.on(n,"click",function(e){return"A"!==e.target.tagName&&e.stopPropagation()}),Docsify.dom.on(t,"input",function(n){clearTimeout(e),e=setTimeout(function(e){return c(n.target.value.trim())},100)})}function l(e,n){var t=Docsify.dom.getNode('.search input[type="search"]');if(t)if("string"==typeof e)t.placeholder=e;else{var o=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];t.placeholder=e[o]}}function d(e,n){if("string"==typeof e)m=e;else{var t=Object.keys(e).filter(function(e){return n.indexOf(e)>-1})[0];m=e[t]}}function u(e,n){var t=n.router.parse().query.s;a(),s(e,t),f(),t&&setTimeout(function(e){return c(t)},500)}function p(e,n){l(e.placeholder,n.route.path),d(e.noData,n.route.path)}var h,y={},m="",g={placeholder:"Type to search",noData:"No Results!",paths:"auto",maxAge:864e5},v=function(e,n){var t=Docsify.util,o=n.config.search||g;Array.isArray(o)?g.paths=o:"object"==typeof o&&(g.paths=Array.isArray(o.paths)?o.paths:"auto",g.maxAge=t.isPrimitive(o.maxAge)?o.maxAge:g.maxAge,g.placeholder=o.placeholder||g.placeholder,g.noData=o.noData||g.noData);var i="auto"===g.paths;e.mounted(function(e){u(g,n),!i&&r(g,n)}),e.doneEach(function(e){p(g,n),i&&r(g,n)})};$docsify.plugins=[].concat(v,$docsify.plugins)}();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
this.D = this.D || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
|
|
|
|||
2
lib/plugins/zoom-image.min.js
vendored
2
lib/plugins/zoom-image.min.js
vendored
|
|
@ -1 +1 @@
|
|||
this.D=this.D||{},function(){"use strict";function t(t){var o,i=Docsify.dom;i.appendTo(i.head,i.create("style",n)),t.doneEach(function(t){var n=i.findAll("img:not(.emoji)");Array.isArray(o)&&o.length&&(o.forEach(function(t){return t()}),o=[]),o=n.map(e)})}var e=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,function(t,e){return e={exports:{}},t(e,e.exports),e.exports}(function(t,e){!function(e,n){t.exports=function(){function t(){-1===g&&(g=window.pageYOffset),Math.abs(g-window.pageYOffset)>=40&&a()}function e(t){27===t.keyCode&&a()}function n(t){var e=t.touches[0];null!==e&&(y=e.pageY,t.target.addEventListener("touchmove",o))}function o(t){var e=t.touches[0];null!==e&&Math.abs(e.pageY-y)>10&&(a(),t.target.removeEventListener("touchmove",o))}function i(){a()}function r(){document.addEventListener("scroll",t),document.addEventListener("keyup",e),document.addEventListener("touchstart",n),document.addEventListener("click",i,!0)}function s(){document.removeEventListener("scroll",t),document.removeEventListener("keyup",e),document.removeEventListener("touchstart",n),document.removeEventListener("click",i,!0)}function a(t){null!==h&&(t?h.dispose():h.close(),s(),h=null)}function c(t){if(!document.body.classList.contains("zoom-overlay-open"))return t.metaKey||t.ctrlKey?void window.open(t.target.getAttribute("data-original")||t.target.src,"_blank"):void(t.target.width>=m()-v||(a(!0),h=new p(t.target,v),h.zoom(),r()))}var m=function(){return document.documentElement.clientWidth},u=function(){return document.documentElement.clientHeight},d=function(t){var e=t.getBoundingClientRect(),n=document.documentElement,o=window;return{top:e.top+o.pageYOffset-n.clientTop,left:e.left+o.pageXOffset-n.clientLeft}},l=function(t,e,n){var o=function(t){t.target.removeEventListener(e,o),n()};t.addEventListener(e,o)},f=function(t,e){this.w=t,this.h=e},p=function(t,e){this.img=t,this.preservedTransform=t.style.transform,this.wrap=null,this.overlay=null,this.offset=e};p.prototype.forceRepaint=function(){this.img.offsetWidth},p.prototype.zoom=function(){var t=new f(this.img.naturalWidth,this.img.naturalHeight);this.wrap=document.createElement("div"),this.wrap.classList.add("zoom-img-wrap"),this.img.parentNode.insertBefore(this.wrap,this.img),this.wrap.appendChild(this.img),this.img.classList.add("zoom-img"),this.img.setAttribute("data-action","zoom-out"),this.overlay=document.createElement("div"),this.overlay.classList.add("zoom-overlay"),document.body.appendChild(this.overlay),this.forceRepaint();var e=this.calculateScale(t);this.forceRepaint(),this.animate(e),document.body.classList.add("zoom-overlay-open")},p.prototype.calculateScale=function(t){var e=t.w/this.img.width,n=m()-this.offset,o=u()-this.offset,i=t.w/t.h,r=n/o;return t.w<n&&t.h<o?e:i<r?o/t.h*e:n/t.w*e},p.prototype.animate=function(t){var e=d(this.img),n=window.pageYOffset,o=m()/2,i=n+u()/2,r=e.left+this.img.width/2,s=e.top+this.img.height/2,a=o-r,c=i-s,l="scale("+t+")",f="translate3d("+a+"px, "+c+"px, 0px)";this.img.style.transform=l,this.wrap.style.transform=f},p.prototype.dispose=function(){null!==this.wrap&&null!==this.wrap.parentNode&&(this.img.classList.remove("zoom-img"),this.img.setAttribute("data-action","zoom"),this.wrap.parentNode.insertBefore(this.img,this.wrap),this.wrap.parentNode.removeChild(this.wrap),document.body.removeChild(this.overlay),document.body.classList.remove("zoom-overlay-transitioning"))},p.prototype.close=function(){var t=this;document.body.classList.add("zoom-overlay-transitioning"),this.img.style.transform=this.preservedTransform,0===this.img.style.length&&this.img.removeAttribute("style"),this.wrap.style.transform="none",l(this.img,"transitionend",function(){t.dispose(),document.body.classList.remove("zoom-overlay-open")})};var h=null,v=80,g=-1,y=-1;return function(t){return t.setAttribute("data-action","zoom"),t.addEventListener("click",c),function(){return t.removeEventListener("click",c)}}}()}()})),n='img[data-action="zoom"] {\n cursor: pointer;\n cursor: -webkit-zoom-in;\n cursor: zoom-in;\n}\n.zoom-img,\n.zoom-img-wrap {\n position: relative;\n z-index: 666;\n transition: -webkit-transform 300ms cubic-bezier(.2,0,.2,1);\n transition: transform 300ms cubic-bezier(.2,0,.2,1);\n transition: transform 300ms cubic-bezier(.2,0,.2,1), -webkit-transform 300ms cubic-bezier(.2,0,.2,1);\n}\n.zoom-overlay {\n z-index: 420;\n background: #fff;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity 300ms;\n}\n.zoom-overlay-open .zoom-overlay {\n opacity: 1;\n}\n.zoom-overlay-open {\n cursor: pointer;\n cursor: -webkit-zoom-out;\n cursor: zoom-out;\n}\n.zoom-overlay-transitioning {\n cursor: default;\n}\n.zoom-overlay-open.zoom-overlay-transitioning .zoom-overlay{\n opacity: 0;\n}\n';$docsify.plugins=[].concat(t,$docsify.plugins)}();
|
||||
!function(){"use strict";function t(t){var o,i=Docsify.dom;i.appendTo(i.head,i.create("style",n)),t.doneEach(function(t){var n=i.findAll("img:not(.emoji)");Array.isArray(o)&&o.length&&(o.forEach(function(t){return t()}),o=[]),o=n.map(e)})}var e=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,function(t,e){return e={exports:{}},t(e,e.exports),e.exports}(function(t,e){!function(e,n){t.exports=function(){function t(){-1===g&&(g=window.pageYOffset),Math.abs(g-window.pageYOffset)>=40&&a()}function e(t){27===t.keyCode&&a()}function n(t){var e=t.touches[0];null!==e&&(y=e.pageY,t.target.addEventListener("touchmove",o))}function o(t){var e=t.touches[0];null!==e&&Math.abs(e.pageY-y)>10&&(a(),t.target.removeEventListener("touchmove",o))}function i(){a()}function r(){document.addEventListener("scroll",t),document.addEventListener("keyup",e),document.addEventListener("touchstart",n),document.addEventListener("click",i,!0)}function s(){document.removeEventListener("scroll",t),document.removeEventListener("keyup",e),document.removeEventListener("touchstart",n),document.removeEventListener("click",i,!0)}function a(t){null!==h&&(t?h.dispose():h.close(),s(),h=null)}function c(t){if(!document.body.classList.contains("zoom-overlay-open"))return t.metaKey||t.ctrlKey?void window.open(t.target.getAttribute("data-original")||t.target.src,"_blank"):void(t.target.width>=m()-v||(a(!0),h=new p(t.target,v),h.zoom(),r()))}var m=function(){return document.documentElement.clientWidth},u=function(){return document.documentElement.clientHeight},d=function(t){var e=t.getBoundingClientRect(),n=document.documentElement,o=window;return{top:e.top+o.pageYOffset-n.clientTop,left:e.left+o.pageXOffset-n.clientLeft}},l=function(t,e,n){var o=function(t){t.target.removeEventListener(e,o),n()};t.addEventListener(e,o)},f=function(t,e){this.w=t,this.h=e},p=function(t,e){this.img=t,this.preservedTransform=t.style.transform,this.wrap=null,this.overlay=null,this.offset=e};p.prototype.forceRepaint=function(){this.img.offsetWidth},p.prototype.zoom=function(){var t=new f(this.img.naturalWidth,this.img.naturalHeight);this.wrap=document.createElement("div"),this.wrap.classList.add("zoom-img-wrap"),this.img.parentNode.insertBefore(this.wrap,this.img),this.wrap.appendChild(this.img),this.img.classList.add("zoom-img"),this.img.setAttribute("data-action","zoom-out"),this.overlay=document.createElement("div"),this.overlay.classList.add("zoom-overlay"),document.body.appendChild(this.overlay),this.forceRepaint();var e=this.calculateScale(t);this.forceRepaint(),this.animate(e),document.body.classList.add("zoom-overlay-open")},p.prototype.calculateScale=function(t){var e=t.w/this.img.width,n=m()-this.offset,o=u()-this.offset,i=t.w/t.h,r=n/o;return t.w<n&&t.h<o?e:i<r?o/t.h*e:n/t.w*e},p.prototype.animate=function(t){var e=d(this.img),n=window.pageYOffset,o=m()/2,i=n+u()/2,r=e.left+this.img.width/2,s=e.top+this.img.height/2,a=o-r,c=i-s,l="scale("+t+")",f="translate3d("+a+"px, "+c+"px, 0px)";this.img.style.transform=l,this.wrap.style.transform=f},p.prototype.dispose=function(){null!==this.wrap&&null!==this.wrap.parentNode&&(this.img.classList.remove("zoom-img"),this.img.setAttribute("data-action","zoom"),this.wrap.parentNode.insertBefore(this.img,this.wrap),this.wrap.parentNode.removeChild(this.wrap),document.body.removeChild(this.overlay),document.body.classList.remove("zoom-overlay-transitioning"))},p.prototype.close=function(){var t=this;document.body.classList.add("zoom-overlay-transitioning"),this.img.style.transform=this.preservedTransform,0===this.img.style.length&&this.img.removeAttribute("style"),this.wrap.style.transform="none",l(this.img,"transitionend",function(){t.dispose(),document.body.classList.remove("zoom-overlay-open")})};var h=null,v=80,g=-1,y=-1;return function(t){return t.setAttribute("data-action","zoom"),t.addEventListener("click",c),function(){return t.removeEventListener("click",c)}}}()}()})),n='img[data-action="zoom"] {\n cursor: pointer;\n cursor: -webkit-zoom-in;\n cursor: zoom-in;\n}\n.zoom-img,\n.zoom-img-wrap {\n position: relative;\n z-index: 666;\n transition: -webkit-transform 300ms cubic-bezier(.2,0,.2,1);\n transition: transform 300ms cubic-bezier(.2,0,.2,1);\n transition: transform 300ms cubic-bezier(.2,0,.2,1), -webkit-transform 300ms cubic-bezier(.2,0,.2,1);\n}\n.zoom-overlay {\n z-index: 420;\n background: #fff;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n pointer-events: none;\n opacity: 0;\n transition: opacity 300ms;\n}\n.zoom-overlay-open .zoom-overlay {\n opacity: 1;\n}\n.zoom-overlay-open {\n cursor: pointer;\n cursor: -webkit-zoom-out;\n cursor: zoom-out;\n}\n.zoom-overlay-transitioning {\n cursor: default;\n}\n.zoom-overlay-open.zoom-overlay-transitioning .zoom-overlay{\n opacity: 0;\n}\n';$docsify.plugins=[].concat(t,$docsify.plugins)}();
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -36,5 +36,6 @@
|
|||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-2.1.0.tgz",
|
||||
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
|
||||
}
|
||||
}
|
||||
},
|
||||
"version": "4.2.1"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docsify-server-renderer",
|
||||
"version": "4.2.0",
|
||||
"version": "4.2.1",
|
||||
"description": "docsify server renderer",
|
||||
"author": {
|
||||
"name": "qingwei-li",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue