Loading core/misc/dialog/dialog.position.js +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ // jQuery UI does not support percentages on heights, convert to pixels. if ( typeof optionValue === 'string' && /%$/.test(optionValue) && optionValue.endsWith('%') && /height/i.test(option) ) { // Take offsets in account. Loading core/misc/drupal.js +2 −2 Original line number Diff line number Diff line Loading @@ -448,7 +448,7 @@ window.Drupal = { behaviors: {}, locale: {} }; // Consider URLs that match this site's base URL but use HTTPS instead of HTTP // as local as well. if (protocol === 'http:' && absoluteUrl.indexOf('https:') === 0) { if (protocol === 'http:' && absoluteUrl.startsWith('https:')) { protocol = 'https:'; } let baseUrl = `${protocol}//${ Loading @@ -469,7 +469,7 @@ window.Drupal = { behaviors: {}, locale: {} }; // The given URL matches the site's base URL, or has a path under the site's // base URL. return absoluteUrl === baseUrl || absoluteUrl.indexOf(`${baseUrl}/`) === 0; return absoluteUrl === baseUrl || absoluteUrl.startsWith(`${baseUrl}/`); }; /** Loading core/misc/position.js +6 −3 Original line number Diff line number Diff line Loading @@ -29,15 +29,18 @@ const regexVertical = /top|center|bottom/; const regexOffset = /[+-]\d+(\.[\d]+)?%?/; const regexPosition = /^\w+/; const regexPercent = /%$/; const _position = $.fn.position; function getOffsets(offsets, width, height) { return [ parseFloat(offsets[0]) * (regexPercent.test(offsets[0]) ? width / 100 : 1), (typeof offsets[0] === 'string' && offsets[0].endsWith('%') ? width / 100 : 1), parseFloat(offsets[1]) * (regexPercent.test(offsets[1]) ? height / 100 : 1), (typeof offsets[1] === 'string' && offsets[1].endsWith('%') ? height / 100 : 1), ]; } Loading core/modules/contextual/js/contextual.js +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ _.chain(storage) .keys() .each((key) => { if (key.substring(0, 18) === 'Drupal.contextual.') { if (key.startsWith('Drupal.contextual.')) { storage.removeItem(key); } }); Loading core/modules/views/js/base.js +4 −4 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ drupalSettings.path.baseUrl.length, ); // Ensure we have a correct path. if (viewHref && path.substring(0, viewHref.length + 1) === `${viewHref}/`) { if (viewHref && path.startsWith(`${viewHref}/`)) { returnObj.view_args = decodeURIComponent( path.substring(viewHref.length + 1, path.length), ); Loading @@ -80,7 +80,7 @@ Drupal.Views.pathPortion = function (href) { // Remove e.g. http://example.com if present. const protocol = window.location.protocol; if (href.substring(0, protocol.length) === protocol) { if (href.startsWith(protocol)) { // 2 is the length of the '//' that normally follows the protocol. href = href.substring(href.indexOf('/', protocol.length + 2)); } Loading @@ -99,8 +99,8 @@ Drupal.Views.getPath = function (href) { href = Drupal.Views.pathPortion(href); href = href.substring(drupalSettings.path.baseUrl.length, href.length); if (href.startsWith('?q=')) { // 3 is the length of the '?q=' added to the URL without clean URLs. if (href.substring(0, 3) === '?q=') { href = href.substring(3, href.length); } const chars = ['#', '?', '&']; Loading Loading
core/misc/dialog/dialog.position.js +1 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,7 @@ // jQuery UI does not support percentages on heights, convert to pixels. if ( typeof optionValue === 'string' && /%$/.test(optionValue) && optionValue.endsWith('%') && /height/i.test(option) ) { // Take offsets in account. Loading
core/misc/drupal.js +2 −2 Original line number Diff line number Diff line Loading @@ -448,7 +448,7 @@ window.Drupal = { behaviors: {}, locale: {} }; // Consider URLs that match this site's base URL but use HTTPS instead of HTTP // as local as well. if (protocol === 'http:' && absoluteUrl.indexOf('https:') === 0) { if (protocol === 'http:' && absoluteUrl.startsWith('https:')) { protocol = 'https:'; } let baseUrl = `${protocol}//${ Loading @@ -469,7 +469,7 @@ window.Drupal = { behaviors: {}, locale: {} }; // The given URL matches the site's base URL, or has a path under the site's // base URL. return absoluteUrl === baseUrl || absoluteUrl.indexOf(`${baseUrl}/`) === 0; return absoluteUrl === baseUrl || absoluteUrl.startsWith(`${baseUrl}/`); }; /** Loading
core/misc/position.js +6 −3 Original line number Diff line number Diff line Loading @@ -29,15 +29,18 @@ const regexVertical = /top|center|bottom/; const regexOffset = /[+-]\d+(\.[\d]+)?%?/; const regexPosition = /^\w+/; const regexPercent = /%$/; const _position = $.fn.position; function getOffsets(offsets, width, height) { return [ parseFloat(offsets[0]) * (regexPercent.test(offsets[0]) ? width / 100 : 1), (typeof offsets[0] === 'string' && offsets[0].endsWith('%') ? width / 100 : 1), parseFloat(offsets[1]) * (regexPercent.test(offsets[1]) ? height / 100 : 1), (typeof offsets[1] === 'string' && offsets[1].endsWith('%') ? height / 100 : 1), ]; } Loading
core/modules/contextual/js/contextual.js +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ _.chain(storage) .keys() .each((key) => { if (key.substring(0, 18) === 'Drupal.contextual.') { if (key.startsWith('Drupal.contextual.')) { storage.removeItem(key); } }); Loading
core/modules/views/js/base.js +4 −4 Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ drupalSettings.path.baseUrl.length, ); // Ensure we have a correct path. if (viewHref && path.substring(0, viewHref.length + 1) === `${viewHref}/`) { if (viewHref && path.startsWith(`${viewHref}/`)) { returnObj.view_args = decodeURIComponent( path.substring(viewHref.length + 1, path.length), ); Loading @@ -80,7 +80,7 @@ Drupal.Views.pathPortion = function (href) { // Remove e.g. http://example.com if present. const protocol = window.location.protocol; if (href.substring(0, protocol.length) === protocol) { if (href.startsWith(protocol)) { // 2 is the length of the '//' that normally follows the protocol. href = href.substring(href.indexOf('/', protocol.length + 2)); } Loading @@ -99,8 +99,8 @@ Drupal.Views.getPath = function (href) { href = Drupal.Views.pathPortion(href); href = href.substring(drupalSettings.path.baseUrl.length, href.length); if (href.startsWith('?q=')) { // 3 is the length of the '?q=' added to the URL without clean URLs. if (href.substring(0, 3) === '?q=') { href = href.substring(3, href.length); } const chars = ['#', '?', '&']; Loading