/** * Checks if this instance is being used to print a PDF. */ function isPrintingPDF() { return ( /print-pdf/gi ).test( window.location.search ); }
function getUrlParameter( name: string ): string { if ( typeof window === 'undefined' ) { return ''; } name = name.replace( /[[]/g, '\\[' ).replace( /[\]]/g, '\\]' ); const regex = new RegExp( '[\\?&]' + name + '=([^&#]*)' ); const results = regex.exec( window.location.search ); return results === null ? '' : decodeURIComponent( results[ 1 ].replace( /\+/g, ' ' ) ); }
/** * Deletes the old ticket and sets the new one from a `guest_ticket` querystring parameter. */ const initialize = () => { if ( typeof window === 'undefined' ) { return; } deleteOldTicket(); const queryObject = parse( window.location.search.replace( '?', '' ) ); if ( queryObject.guest_ticket ) { store.set( GUEST_TICKET_LOCALFORAGE_KEY, { createdDate: Date.now(), value: queryObject.guest_ticket, } ); } }
const clippedContentResponse = (title, html, imageSizes, anchorNames, stylesheets) => { return { name: shouldSendToJoplin ? 'sendContentToJoplin' : 'clippedContent', title: title, html: html, base_url: baseUrl(), url: pageLocationOrigin() + location.pathname + location.search, parent_id: command.parent_id, tags: command.tags || '', image_sizes: imageSizes, anchor_names: anchorNames, source_command: Object.assign({}, command), convert_to: convertToMarkup, stylesheets: stylesheets, }; }
static login(data) { ApiActions.post( '/api/login', data, LoginStore, Constants.LOGIN, Constants.LOGIN_RESPONSE, (err, response) => { if (!err) { const query = Qs.parse(window.location.search.substring(1)); if (query.returnUrl) { window.location.href = query.returnUrl; } else if (response && response.user) { if (response.user.roles.admin) { window.location.href = '/admin'; } else { window.location.href = '/account'; } } } } ); }
location.search.replace( /[A-Z0-9]+?=([\w\.%-]*)/gi, function(a) { query[ a.split( '=' ).shift() ] = a.split( '=' ).pop(); } );
/** * Makes a URL, preserving querystring ("search") parameters. * * @param {string} s * @returns {string} A new URL. */ function makeUrl( s ) { var search = window.location.search; // Remove previous grep query parameter if present if ( search ) { search = search.replace( /[?&]grep=[^&\s]*/g, '' ).replace( /^&/, '?' ); } return ( window.location.pathname + ( search ? search + '&' : '?' ) + 'grep=' + encodeURIComponent( escapeRe( s ) ) ); }
title: pageTitle(), crop_rect: selectionArea, url: pageLocationOrigin() + location.pathname + location.search, parent_id: command.parent_id, tags: command.tags,
const query = Qs.parse(window.location.search.substring(1));
window.addEventListener('WebComponentsReady', () => { let url = new URL(window.location) let room = url.searchParams.get('room') let force = url.searchParams.get('force') if (window.location.search && getChromeVersion(force) && room) { require('./components') container.innerHTML = `${help}<roll-call call="${room}"></roll-call>` dragDrop('body', files => { document.querySelector('roll-call').serveFiles(files) }) } else { container.innerHTML = welcome if (!getChromeVersion(force)) { document.querySelector('span.start-text').innerHTML = onlyChrome } each(document.querySelectorAll('welcome-message span'), elem => { elem.onclick = () => { let room if (elem.id === 'start-party') room = 'party' else room = random() window.location = window.location.pathname + '?room=' + room } }) } })
function() { if ( window.location.search.match( /receiver/gi ) ) { return; }
function() { if( window.location.search.match( /receiver/gi ) ) { return; }
location.search.replace(/([^\?=]+)=([^&]*)/ ,function(all, key, value){ mapParams[key] = value; });
/** * Checks if this presentation is running inside of the * speaker notes window. */ function isSpeakerNotes() { return !!window.location.search.match( /receiver/gi ); }