How to use the urijs.decode function in urijs

To help you get started, we’ve selected a few urijs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TerriaJS / terriajs / lib / ReactViewModels / ViewState.js View on Github external
.subscribe(matchFromExplorer => {
        if (
          matchFromExplorer &&
          matchFromExplorer.params &&
          matchFromExplorer.params.catalogMemberId
        ) {
          // viewCatalogMember handles which tab to activate
          const idToFind = URI.decode(matchFromExplorer.params.catalogMemberId);
          const catalogMember = terria.catalog.shareKeyIndex[idToFind];

          if (defined(catalogMember)) {
            this.viewCatalogMember(catalogMember);
          }
        }
      });
github shoutem / extensions / shoutem.rss / server / src / rssPage / reducer.js View on Github external
export function loadFeed(feedUrl) {
  // decode url in case someone encoded it in a way incompatible with legacy server
  const decodedFeedUrl = URI.decode(feedUrl);
  const endpoint = new URI(`//${url.legacy}/v1/apps/${appId}/proxy/resources/${FEED_ITEMS}`)
  .setQuery({
    'filter[url]': decodedFeedUrl,
  })
  .toString();

  const config = {
    schema: FEED_ITEMS,
    request: {
      endpoint,
      headers: {
        Accept: 'application/vnd.api+json',
      },
    },
  };
github nicolas-van / sonant-x-live / gui.js View on Github external
document.getElementById("fx_pan_freq").sliderProps = { min: 0, max: 16 };

    // Create audio element, and always play the audio as soon as it's ready
    try
    {
      mAudio = new Audio();
      mAudio.addEventListener("canplay", function () { this.play(); }, true);
    }
    catch (err)
    {
      mAudio = null;
    }

    var fragment = new URI().fragment() || "";
    if (fragment) {
      var json = LZString.decompressFromBase64(URI.decode(fragment));
      var song = JSON.parse(json);
      newSong(song);
    } else {
      newSong();
    }

    // Set up event handlers for the sequencer
    for (i = 0; i < 8; ++i)
    {
      for (j = 0; j < 48; ++j)
      {
        o = document.getElementById("sc" + i + "r" + j);
        o.onmousedown = sequencerMouseDown;
        o.onmouseover = sequencerMouseOver;
        o.onmouseup = sequencerMouseUp;
      }
github LotusTM / Kotsu / modules / urljoin.js View on Github external
const hasProtocol = uri.protocol()

  if (hasProtocol) {
    // @todo Something has to be done with the fact that URI.js force-encodes urls
    //       https://github.com/LotusTM/Kotsu/issues/322
    return URI.decode(URI.joinPaths(...restUrls).absoluteTo(uri).valueOf())
  }

  let path = URI.joinPaths(...urls).valueOf()

  // @todo Workaround for https://github.com/medialize/URI.js/issues/341
  if (!path.startsWith('/') && firstUrl === '/') {
    path = `/${path}`
  }

  return URI.decode(path)
}
github TerriaJS / terriajs / test / ReactViews / Map / Panels / SharePanel / BuildShareLinkSpec.js View on Github external
const decodeAndParseStartHash = url =>
  JSON.parse(URI.decode(URI.parse(url).fragment.replace(/start=/, "")));
github divio / django-cms / cms / static / cms / js / modules / cms.base.js View on Github external
makeURL: function makeURL(url, params = []) {
        let newUrl = new URL(URL.decode(url.replace(/&/g, '&')));

        params.forEach(pair => {
            const [key, value] = pair;

            newUrl.removeSearch(key);
            newUrl.addSearch(key, value);
        });

        return newUrl
            .toString()
            .split('#')
            .map((part, i) => {
                return i === 0 ? part.replace(/&/g, '&') : part;
            })
            .join('#');
    },
github sky-uk / api-explorer / packages / apiexplorer / src / components / widgets / TryOutWidgetTab.js View on Github external
getUrl (path) {
    let scheme = this.props.apis.schemes ? this.props.apis.schemes[0] : this.props.config.defaultScheme
    let uri = new URI(`${scheme}://${this.props.apis.host}${this.props.apis.basePath}${path}`)

    uri.normalizePath()
    uri = URI.decode(uri)

    return uri.toString()
  }
github sky-uk / api-explorer / packages / apiexplorer / src / components / widgets / TryOutWidgetTab.js View on Github external
getUrl (path) {
    let scheme = this.props.apis.schemes ? this.props.apis.schemes[0] : this.props.config.defaultScheme
    let uri = new URI(`${scheme}://${this.props.apis.host}${this.props.apis.basePath}${path}`)

    uri.normalizePath()
    uri = URI.decode(uri)

    return uri.toString()
  }