123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- global.wagtailConfig = {
- ADMIN_API: {
- DOCUMENTS: '/admin/api/main/documents/',
- IMAGES: '/admin/api/main/images/',
- PAGES: '/admin/api/main/pages/',
- EXTRA_CHILDREN_PARAMETERS: '',
- },
- ADMIN_URLS: {
- PAGES: '/admin/pages/',
- },
- DATE_FORMATTING: {
- DATE_FORMAT: 'MMM. D, YYYY',
- SHORT_DATE_FORMAT: 'DD/MM/YYYY',
- },
- WAGTAIL_I18N_ENABLED: true,
- LOCALES: [
- {
- code: 'en',
- display_name: 'English',
- },
- {
- code: 'fr',
- display_name: 'French',
- },
- ],
- ACTIVE_LOCALE: 'en',
- };
- const script = document.createElement('script');
- script.type = 'application/json';
- script.id = 'wagtail-config';
- script.textContent = JSON.stringify({
- CSRF_HEADER_NAME: 'x-xsrf-token',
- CSRF_TOKEN: 'potato',
- });
- document.body.appendChild(script);
- global.wagtailVersion = '1.6a1';
- global.wagtail = {};
- global.IMAGE_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'image' };
- global.PAGE_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'page' };
- global.EMBED_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'embed' };
- global.DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'document' };
- class PageChooserModal {}
- global.PageChooserModal = PageChooserModal;
- window.scrollTo = () => {};
- const consoleWarnOriginal = console.warn;
- console.warn = function filterWarnings(...args) {
-
- const [warning, component] = args;
- const legacyReactWarnings = [
- 'Warning: componentWillMount has been renamed, and is not recommended for use.',
- 'Warning: componentWillReceiveProps has been renamed, and is not recommended for use.',
- 'Warning: componentWillUpdate has been renamed, and is not recommended for use.',
- ];
- const ignoredComponents = ['DraftEditor', 'PluginEditor'];
- if (
- legacyReactWarnings.some((_) => warning.includes(_)) &&
- ignoredComponents.includes(component)
- ) {
- return;
- }
- consoleWarnOriginal.apply(console, args);
- };
|