SOP

SOP oleh JDIH Banjarbaru

SOP Pengelolaan JDIH Kota Banjarbaru

-

' + '
' + ' ' + ' ' + ' ' + ''; document.body.appendChild(wrapper.firstChild); if (window.jQuery && window.jQuery.fn && window.jQuery.fn.modal) { window.jQuery('#' + modalId).on('hidden.bs.modal', function() { var frame = document.getElementById(iframeId); if (frame) { frame.src = 'about:blank'; } }); } } function isPdf(urlPart) { return /\.pdf($|[?#])/i.test(urlPart || ''); } function toViewerUrl(href) { try { var parsed = new URL(href, window.location.origin); if (parsed.origin !== window.location.origin) { return null; } if (!/^\/(upload|storage)\//.test(parsed.pathname)) { return null; } if (!isPdf(parsed.pathname + parsed.search + parsed.hash)) { return null; } return viewerBase + '?file=' + encodeURIComponent(parsed.pathname); } catch (e) { return null; } } function openInModal(viewerUrl) { ensureModal(); var frame = document.getElementById(iframeId); var newTabButton = document.getElementById(newTabId); if (!frame || !newTabButton) { window.open(viewerUrl, '_blank'); return; } var iframeUrl = viewerUrl + '#view=FitH'; frame.src = iframeUrl; newTabButton.href = viewerUrl; if (window.jQuery && window.jQuery.fn && window.jQuery.fn.modal) { window.jQuery('#' + modalId).modal('show'); } else { window.open(viewerUrl, '_blank'); } } document.addEventListener('click', function(event) { var anchor = event.target.closest('a[href]'); if (!anchor) { return; } if (anchor.getAttribute('data-pdf-view') !== '1') { return; } if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey || event.button === 1) { return; } var viewerUrl = toViewerUrl(anchor.getAttribute('href')); if (!viewerUrl) { return; } event.preventDefault(); anchor.removeAttribute('download'); openInModal(viewerUrl); }, true); })();