PageSourceSearch

https://www.tromso.kommune.no/modules/contrib/gutenberg/js/url.js?tlu16d

js tromso.kommune.no collected 2026-09-24 18:30:43 UTC 992 bytes, 36 lines download raw bytes

1// eslint-disable-next-line func-names
2(function(Drupal, drupalSettings) {
3  function addQueryArgs(url, args) {
4    const esc = encodeURIComponent;
5    const qs = Object.keys(args)
6      .map(key => `${esc(key)}=${esc(args[key])}`)
7      .join('&');
8
9    if (url === 'edit.php') {
10      // 'Manage All Reusable Blocks'
11      if (args && args.post_type === 'wp_block') {
12        return Drupal.url('admin/content/reusable-blocks');
13      }
14    } else if (url === 'post.php') {
15      if (args.post && args.action === 'edit') {
16        // The post's edit url.
17        return Drupal.url(drupalSettings.path.currentPath);
18      }
19    }
20
21    // Always add language code
22    url = `${url}?langcode=${drupalSettings.path.currentLanguage}`;
23
24    if (qs) {
25      if (url.indexOf('?') === -1) {
26        return `${url}?${qs}`;
27      }
28      return `${url}&${qs}`;
29    }
30
31    return url;
32  }
33
34  window.wp = window.wp || {};
35  window.wp.url = { ...window.wp.url, addQueryArgs };
36})(Drupal, drupalSettings);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.