Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.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);
}
}
});
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',
},
},
};
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;
}
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)
}
const decodeAndParseStartHash = url =>
JSON.parse(URI.decode(URI.parse(url).fragment.replace(/start=/, "")));
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('#');
},
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()
}
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()
}