stubs.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * Test stubs to mirror available global variables.
  3. * Those variables usually come from the back-end via templates.
  4. * See /wagtailadmin/templates/wagtailadmin/admin_base.html.
  5. */
  6. import 'element-closest';
  7. global.wagtailConfig = {
  8. ADMIN_API: {
  9. DOCUMENTS: '/admin/api/main/documents/',
  10. IMAGES: '/admin/api/main/images/',
  11. PAGES: '/admin/api/main/pages/',
  12. EXTRA_CHILDREN_PARAMETERS: '',
  13. },
  14. ADMIN_URLS: {
  15. PAGES: '/admin/pages/',
  16. },
  17. DATE_FORMATTING: {
  18. DATE_FORMAT: 'MMM. D, YYYY',
  19. SHORT_DATE_FORMAT: 'DD/MM/YYYY',
  20. },
  21. STRINGS: {
  22. DELETE: 'Delete',
  23. EDIT: 'Edit',
  24. PAGE: 'Page',
  25. PAGES: 'Pages',
  26. LOADING: 'Loading…',
  27. NO_RESULTS: 'No results',
  28. SERVER_ERROR: 'Server Error',
  29. SEE_ALL: 'See all',
  30. CLOSE_EXPLORER: 'Close explorer',
  31. ALT_TEXT: 'Alt text',
  32. DECORATIVE_IMAGE: 'Decorative image',
  33. WRITE_HERE: 'Write here…',
  34. HORIZONTAL_LINE: 'Horizontal line',
  35. LINE_BREAK: 'Line break',
  36. UNDO: 'Undo',
  37. REDO: 'Redo',
  38. RELOAD_PAGE: 'Reload the page',
  39. RELOAD_EDITOR: 'Reload saved content',
  40. SHOW_LATEST_CONTENT: 'Show latest content',
  41. SHOW_ERROR: 'Show error',
  42. EDITOR_CRASH: 'The editor just crashed. Content has been reset to the last saved version.',
  43. BROKEN_LINK: 'Broken link',
  44. MISSING_DOCUMENT: 'Missing document',
  45. CLOSE: 'Close',
  46. EDIT_PAGE: 'Edit \'{title}\'',
  47. VIEW_CHILD_PAGES_OF_PAGE: 'View child pages of \'{title}\'',
  48. PAGE_EXPLORER: 'Page explorer',
  49. SAVE: 'Save',
  50. SAVING: 'Saving...',
  51. CANCEL: 'Cancel',
  52. DELETING: 'Deleting...',
  53. ADD_A_COMMENT: 'Add a comment',
  54. SHOW_COMMENTS: 'Show comments',
  55. REPLY: 'Reply',
  56. RESOLVE: 'Resolve',
  57. RETRY: 'Retry',
  58. DELETE_ERROR: 'Delete error',
  59. CONFIRM_DELETE_COMMENT: 'Are you sure?',
  60. SAVE_ERROR: 'Save error',
  61. SAVE_COMMENT_WARNING: 'This will be saved when the page is saved',
  62. FOCUS_COMMENT: 'Focus comment',
  63. UNFOCUS_COMMENT: 'Unfocus comment',
  64. SAVE_PAGE_TO_ADD_COMMENT: 'Save the page to add this comment',
  65. SAVE_PAGE_TO_SAVE_COMMENT_CHANGES: 'Save the page to save this comment',
  66. SAVE_PAGE_TO_SAVE_REPLY: 'Save the page to save this reply',
  67. },
  68. WAGTAIL_I18N_ENABLED: true,
  69. LOCALES: [
  70. {
  71. code: 'en',
  72. display_name: 'English'
  73. },
  74. {
  75. code: 'fr',
  76. display_nam: 'French'
  77. }
  78. ],
  79. ACTIVE_LOCALE: 'en'
  80. };
  81. global.wagtailVersion = '1.6a1';
  82. global.wagtail = {};
  83. global.chooserUrls = {
  84. documentChooser: '/admin/documents/chooser/',
  85. emailLinkChooser: '/admin/choose-email-link/',
  86. anchorLinkChooser: '/admin/choose-anchor-link',
  87. embedsChooser: '/admin/embeds/chooser/',
  88. externalLinkChooser: '/admin/choose-external-link/',
  89. imageChooser: '/admin/images/chooser/',
  90. pageChooser: '/admin/choose-page/',
  91. };
  92. /* use dummy content for onload handlers just so that we can verify that we've chosen the right one */
  93. global.IMAGE_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'image' };
  94. global.PAGE_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'page' };
  95. global.EMBED_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'embed' };
  96. global.DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'document' };