Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(module => module.login), false)
let settingsViewResolver = createViewResolver(() => _asyncImport("src/settings/SettingsView.js")
.then(module => new module.SettingsView()))
let searchViewResolver = createViewResolver(() => _asyncImport("src/search/SearchView.js")
.then(module => new module.SearchView()))
let contactFormViewResolver = createViewResolver(() => _asyncImport("src/login/ContactFormView.js")
.then(module => module.contactFormView), false)
const calendarViewResolver = createViewResolver(() => _asyncImport("src/calendar/CalendarView.js")
.then(module => new module.CalendarView()), true)
let start = "/"
if (!state.prefix) {
state.prefix = location.pathname[location.pathname.length - 1] !== '/'
? location.pathname : location.pathname.substring(0, location.pathname.length - 1)
let query = m.parseQueryString(location.search)
let redirectTo = query['r'] // redirection triggered by the server (e.g. the user reloads /mail/id by pressing F5)
if (redirectTo) {
delete query['r']
} else {
redirectTo = ""
}
let newQueryString = m.buildQueryString(query)
if (newQueryString.length > 0) {
newQueryString = "?" + newQueryString
}
let target = redirectTo + newQueryString + location.hash
if (target === "" || target[0] !== "/") target = "/" + target
history.replaceState(null, "", neverNull(state.prefix) + target)
start = target
}
m.route.prefix = neverNull(state.prefix)
function queryObject() {
return m.parseQueryString(window.location.search);
}
function queryObject() {
return m.parseQueryString(window.location.search);
}
oninit: function(vnode) {
var queryString = m.parseQueryString(window.location.search.replace(/^[?]/, ''))
var start = new Date(), end = new Date();
if (queryString.start) {
start = new Date(queryString.start)
}
if (queryString.end) {
end = new Date(queryString.end)
}
var data = {
series: [],
query: {
time_range: {
start: new Date(),
end: new Date()
}
}
setAndResetMultParamsArray = (/** @type {{[key : string] : string | number}} */ setParams, /** @type {string[]}*/ removeQuery = []) => {
/** @type {Object} */
const query = m.parseQueryString(window.location.search);
removeQuery.forEach(param => {
if (param in query) {
delete query[param];
}
});
const queryString = objectToSearchString(Object.assign(query, setParams));
const newurl = window.location.protocol + '//' + window.location.host + window.location.pathname + queryString + (window.location.hash === '#' ? '' : window.location.hash);
m.route.set(newurl);
},
removeParamByName = (name) => {
vnode.state.updateURL = function() {
var queryString = m.parseQueryString(window.location.search.replace(/^[?]/, ''))
queryString.start = this.start.toJSON()
queryString.end = this.end.toJSON()
queryString.query = this.query
queryString.collection = this.collection
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?' + m.buildQueryString(queryString);
window.history.pushState({path: newurl}, '', newurl);
}.bind(this)
function queryObject() {
return m.parseQueryString(window.location.search);
}
static param(key: string) {
const hash = window.location.hash;
const paramStart = hash.indexOf('?');
if (paramStart === -1) return undefined;
return m.parseQueryString(hash.substring(paramStart))[key];
}
}