Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function initialize(/* container, application */) {
if (typeof FastBoot === 'undefined' && typeof L !== 'undefined') {
let prefix = '';
if (!isNone(config.rootURL)) {
prefix = config.rootURL;
} else if (!isNone(config.baseURL)) {
prefix = config.baseURL;
}
L.Icon.Default.imagePath = `${prefix}assets/images/`;
}
}
export function initialize(/* container, application */) {
if (typeof FastBoot === 'undefined') {
let prefix = '';
if (!isNone(config.rootURL)) {
prefix = config.rootURL;
} else if (!isNone(config.baseURL)) {
prefix = config.baseURL;
}
L.Icon.Default.imagePath = `${prefix}assets/images/`;
}
}
export function initialize(/* container, application */) {
if (typeof FastBoot === 'undefined') {
let prefix = '';
if (!isNone(config.rootURL)) {
prefix = config.rootURL;
} else if (!isNone(config.baseURL)) {
prefix = config.baseURL;
}
L.Icon.Default.imagePath = `${prefix}assets/images/`;
}
}
export function initialize(/* container, application */) {
if (typeof FastBoot === 'undefined' && typeof L !== 'undefined') {
let prefix = '';
if (!isNone(config.rootURL)) {
prefix = config.rootURL;
} else if (!isNone(config.baseURL)) {
prefix = config.baseURL;
}
L.Icon.Default.imagePath = `${prefix}assets/images/`;
}
}
import { inject as service } from '@ember/service';
import { run } from '@ember/runloop';
import EmberRouter from '@ember/routing/router';
import { getOwner } from '@ember/application';
import config from 'ember-get-config';
const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL,
metrics: service(),
theme: service(),
session: service(),
didTransition() {
this._super(...arguments);
this._trackPage();
},
_trackPage() {
run.scheduleOnce('afterRender', this, () => {
// Tracks page with custom parameters
// authenticated => if the user is logged in or not
// isPublic => if the resource the user is viewing is public or private.
// n/a is used for pages like discover and index
// page => the name of the current page
import DS from 'ember-data';
import config from 'ember-get-config';
import { inject as service } from '@ember/service';
export default DS.Adapter.extend({
defaultSerializer: '-addon-docs',
namespace: `${config.rootURL.replace(/\/$/, '')}/docs`,
docsFetch: service(),
shouldBackgroundReloadAll() {
return false;
},
shouldBackgroundReloadRecord() {
return false;
},
findRecord(store, modelClass, id, snapshot) {
if (modelClass.modelName === 'project') {
return this.get('docsFetch').fetch({ url: `${this.namespace}/${id}.json` }).json();
} else {
return store.peekRecord(modelClass.modelName, id);
}
registries,
},
featureFlagNames: {
routes: routeFlags,
},
} = config;
const Router = EmberRouter.extend({
currentUser: service('current-user'),
features: service('features'),
statusMessages: service('status-messages'),
ready: service('ready'),
readyBlocker: null as Blocker | null,
location: config.locationType,
rootURL: config.rootURL,
shouldScrollTop: true,
willTransition(oldInfo: any, newInfo: any, transition: { targetName: string }) {
if (!this.readyBlocker || this.readyBlocker.isDone()) {
this.readyBlocker = this.get('ready').getBlocker();
}
this._super(oldInfo, newInfo, transition);
},
didTransition(...args: any[]) {
this._super(...args);
this.get('currentUser').checkShowTosConsentBanner();
this.get('statusMessages').updateMessages();