* Adds event listeners to change active stylesheet and restore previously * activated stylesheet on reload. * * @example * * This link: * Foo * Will active this existing link: * <link rel="stylesheet alternate" title="
()
| 23 | */ |
| 24 | |
| 25 | function imgAdd2() { |
| 26 | var imgs = document.querySelectorAll('.content img'); |
| 27 | // var imgs = document.getElementsByTagName('medium-zoom-image'); |
| 28 | for (let j = 0; j < imgs.length; j++) { |
| 29 | // console.log('zheshi') |
| 30 | let img = imgs[j]; |
| 31 | // console.log(img); |
| 32 | if (img.src) { |
| 33 | console.log(img.src); |
| 34 | if (!img.getAttribute('hadassets')) { |
| 35 | let hasharr = window.location.hash.split('/'); |
| 36 | // console.log(hasharr); |
| 37 | let origin = window.location.origin; |
| 38 | img.setAttribute('hadassets', 1); |
| 39 | var hasharrPath = ""; |
| 40 | for(var i = 1; i < hasharr.length - 1 ; i++){ |
| 41 | hasharrPath += hasharr[i] + "/"; |
| 42 | } |
| 43 | img.src = origin + '/' + hasharrPath + img.src.substring(origin.length + 1); |
| 44 | // img.src = origin + '/' + hasharrPath + img.src; |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | function imgAdd() { |
| 51 | var imgs = document.querySelectorAll('.markdown-section img'); |
nothing calls this directly
no outgoing calls
no test coverage detected