switch to doneEach and cache #main dom

This commit is contained in:
Leopoldthecoder
2017-03-07 11:30:09 +08:00
parent 1aa6636ba8
commit 9c54bafae4
8 changed files with 27 additions and 33 deletions

View File

@@ -1 +1 @@
this.D=this.D||{},function(){"use strict";function t(t){var i=t.match(c);if(i&&i.length>1){var r=document.createElement("script");r.src=i[1],e.test(i[0])&&r.setAttribute("async",""),s.test(i[0])&&r.setAttribute("defer","");var n=document.querySelector("#main");n.appendChild(r)}}var c=/<script[^>]*src=["|'](.*)["|']>[^\w]*<\/script>/,e=/<script[^>]*\s+async/,s=/<script[^>]*\s+defer/,i=function(c){c.afterEach(t)};window.$docsify.plugins=[].concat(i,window.$docsify.plugins)}();
this.D=this.D||{},function(){"use strict";function i(){var i=Docsify.dom.getNode("#main"),n=Docsify.dom.find(i,"script");if(n && n.src){var c=document.createElement("script");["src","async","defer"].forEach(function(i){c[i]=n[i]}),n.parentNode.removeChild(n),i.appendChild(c)}}var n=function(n){n.doneEach(i)};window.$docsify.plugins=[].concat(n,window.$docsify.plugins)}();