(page)
| 6 | declare let GM_getResourceURL: any; |
| 7 | |
| 8 | function createIframe(page) { |
| 9 | const iframe = document.createElement('iframe'); |
| 10 | iframe.setAttribute('id', 'info-iframe'); |
| 11 | iframe.setAttribute('style', 'height:100%;width:100%;border:0;display:block;'); |
| 12 | iframe.onload = function () { |
| 13 | const head = j.$('#info-iframe').contents().find('head'); |
| 14 | |
| 15 | importAssets(head); |
| 16 | |
| 17 | setTimeout(function () { |
| 18 | minimalObj = new Minimal( |
| 19 | j.$('#info-iframe').contents().find('html'), |
| 20 | () => { |
| 21 | document.getElementById('info-popup')!.style.display = 'none'; |
| 22 | j.$('.floatbutton').fadeIn(); |
| 23 | }, |
| 24 | () => { |
| 25 | if (j.$('.modal-content-kal.fullscreen').length) { |
| 26 | j.$('.modal-content-kal').removeClass('fullscreen'); |
| 27 | // @ts-ignore |
| 28 | j.$(this).find('i').text('fullscreen'); |
| 29 | } else { |
| 30 | j.$('.modal-content-kal').addClass('fullscreen'); |
| 31 | // @ts-ignore |
| 32 | j.$(this).find('i').text('fullscreen_exit'); |
| 33 | } |
| 34 | }, |
| 35 | ); |
| 36 | if (typeof page !== 'undefined') { |
| 37 | if (typeof page.singleObj !== 'undefined') { |
| 38 | minimalObj.fill({ url: page.singleObj.getUrl() }, true); |
| 39 | } |
| 40 | } |
| 41 | }, 200); |
| 42 | }; |
| 43 | document.getElementById('modal-content')!.appendChild(iframe); |
| 44 | j.$('#modal-content').append( |
| 45 | j.html( |
| 46 | '<div class="kal-tempHeader" style="position: absolute; width: 100%; height: 103px; background-color: rgb(63,81,181); "></div>', |
| 47 | ), |
| 48 | ); |
| 49 | |
| 50 | if (!j.$('#info-iframe').length || j.$('#info-iframe').css('display') !== 'block') { |
| 51 | j.$('#info-popup').remove(); |
| 52 | alert('The miniMAL iframe could not be loaded.\nThis could be caused by an AdBlocker.'); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | export function floatClick(page) { |
| 57 | if (api.settings.get('floatButtonCorrection')) { |
no test coverage detected