function getOriginUrl() { return ( window.location.protocol + '//' + window.location.hostname + ( window.location.port ? ':' + window.location.port : '' ) ); }
function intersectionHandler ({ intersectionRatio, target }) { if (process.isClient) { if (intersectionRatio > 0) { observer.unobserve(target) if (document.location.hostname === target.hostname) { if (isPreloaded[target.pathname]) return else isPreloaded[target.pathname] = true const path = stripPathPrefix(target.pathname) const { route } = router.resolve({ path }) setTimeout(() => fetch(route, { shouldPrefetch: true }), 250) } } } }
// The Util Function to hack URLs of intercepted requests const getFixedUrl = (req) => { var now = Date.now() var url = new URL(req.url) // 1. fixed http URL // Just keep syncing with location.protocol // fetch(httpURL) belongs to active mixed content. // And fetch(httpRequest) is not supported yet. url.protocol = self.location.protocol // 2. add query for caching-busting. // Github Pages served with Cache-Control: max-age=600 // max-age on mutable content is error-prone, with SW life of bugs can even extend. // Until cache mode of Fetch API landed, we have to workaround cache-busting with query string. // Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190 if (url.hostname === self.location.hostname) { url.search += (url.search ? '&' : '?') + 'cache-bust=' + now } return url.href }
if ( hostname === window.location.hostname ) {
); const devServerUrl = `http://${window.location.hostname}:${dashboardPort}`; return ( <div
// Because IE scrolls the whole window to hash links, we need our own // method of scrolling the iframe to an ID from clicking a hash self.previewerIframeDocument.addEventListener('click', function (e) { var el = e.target , body = self.previewerIframeDocument.body; if (el.nodeName == 'A') { // Make sure the link is a hash and the link is local to the iframe if (el.hash && el.hostname == window.location.hostname) { // Prevent the whole window from scrolling e.preventDefault(); // Prevent opening a new window el.target = '_self'; // Scroll to the matching element, if an element exists if (body.querySelector(el.hash)) { body.scrollTop = body.querySelector(el.hash).offsetTop; } } } });
(function($) { "use strict"; // Start of use strict // Smooth scrolling using jQuery easing $('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { $('html, body').animate({ scrollTop: (target.offset().top - 54) }, 1000, "easeInOutExpo"); return false; } } }); // Closes responsive menu when a scroll trigger link is clicked $('.js-scroll-trigger').click(function() { $('.navbar-collapse').collapse('hide'); }); // Activate scrollspy to add active class to navbar items on scroll $('body').scrollspy({ target: '#mainNav', offset: 54 }); })(jQuery);
function () { 'use strict'; var isOnGitHub = window.location.hostname === 'blueimp.github.io', url = isOnGitHub ? '//jquery-file-upload.appspot.com/' : 'server/php/';
if (window.location.hostname === 'blueimp.github.io') {
originUrl() { return ( window.location.protocol + '//' + window.location.hostname + ( window.location.port ? ':' + window.location.port : '' ) ); }
function intersectionHandler ({ intersectionRatio, target }) { if (process.isClient) { if (intersectionRatio > 0) { observer.unobserve(target) if (document.location.hostname === target.hostname) { if (isPreloaded[target.pathname]) return else isPreloaded[target.pathname] = true const path = stripPathPrefix(target.pathname) const { route } = router.resolve({ path }) setTimeout(() => fetch(route, { shouldPrefetch: true }), 250) } } } }
// The Util Function to hack URLs of intercepted requests const getFixedUrl = (req) => { var now = Date.now() var url = new URL(req.url) // 1. fixed http URL // Just keep syncing with location.protocol // fetch(httpURL) belongs to active mixed content. // And fetch(httpRequest) is not supported yet. url.protocol = self.location.protocol // 2. add query for caching-busting. // Github Pages served with Cache-Control: max-age=600 // max-age on mutable content is error-prone, with SW life of bugs can even extend. // Until cache mode of Fetch API landed, we have to workaround cache-busting with query string. // Cache-Control-Bug: https://bugs.chromium.org/p/chromium/issues/detail?id=453190 if (url.hostname === self.location.hostname) { url.search += (url.search ? '&' : '?') + 'cache-bust=' + now } return url.href }