-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathapplication.js
More file actions
104 lines (93 loc) · 3.82 KB
/
application.js
File metadata and controls
104 lines (93 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* eslint no-console:0 */
// This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
//
// To reference this file, add <%= javascript_include_tag 'application' %> to the appropriate
// layout file, like app/views/layouts/application.html.erb
import 'core-js/stable';
import 'regenerator-runtime/runtime';
// Pull in Bootstrap JS functionality
import 'bootstrap';
import 'bootstrap-select';
// Uncomment to copy all static images under ../images to the output folder and reference
// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)
// or the `imagePath` JavaScript helper below.
//
// const images = require.context('../images', true)
// const imagePath = (name) => images(name, true)
// Utilities
import './src/utils/accordion';
import './src/utils/autoComplete';
import './src/utils/externalLink';
import './src/utils/modalSearch';
import './src/utils/outOfFocus';
import './src/utils/paginable';
import './src/utils/panelHeading';
import './src/utils/requiredField';
import './src/utils/tabHelper';
// Specific functions from the Utilities files that will be made available to
// the js.erb templates in the `window.x` statements below
import { renderAlert, renderNotice } from './src/utils/notificationHelper';
import toggleSpinner from './src/utils/spinner';
// View specific JS
import './src/answers/conditions';
import './src/answers/edit';
import './src/answers/rdaMetadata';
import './src/contributors/form';
import './src/devise/invitations/edit';
import './src/devise/passwords/edit';
import './src/devise/registrations/edit';
import './src/devise/registrations/new';
import './src/guidances/newEdit';
import './src/notes/index';
import './src/orgs/adminEdit';
import './src/orgs/shibbolethDs';
import './src/plans/download';
import './src/plans/editDetails';
import './src/plans/index.js.erb';
import './src/plans/new';
import './src/plans/share';
import './src/publicTemplates/show';
import './src/researchOutputs/form';
import './src/roles/edit';
import './src/shared/createAccountForm';
import './src/shared/signInForm';
import './src/usage/index';
import './src/users/adminGrantPermissions';
import './src/users/notificationPreferences';
// OrgAdmin view specific JS
import './src/orgAdmin/conditions/updateConditions';
import './src/orgAdmin/phases/newEdit';
import './src/orgAdmin/phases/preview';
import './src/orgAdmin/phases/show';
import './src/orgAdmin/questionOptions/index';
import './src/orgAdmin/questions/sharedEventHandlers';
import './src/orgAdmin/sections/index';
import './src/orgAdmin/templates/edit';
import './src/orgAdmin/templates/index';
import './src/orgAdmin/templates/new';
// SuperAdmin view specific JS
import './src/superAdmin/apiClients/form';
import './src/superAdmin/notifications/edit';
import './src/superAdmin/themes/newEdit';
import './src/superAdmin/users/edit';
// We need to startup Rails' Unobtrusive JS and Turbo.
// ActiveStorage and ActionCable would also need
// to be in here if we decide to implement either.
import Rails from "@rails/ujs";
Rails.start();
// TODO: Disabled turbo for the time being because our custom JS is not
// properly setup to work with it. We should review the docs:
// https://github.com/hotwired/turbo-rails
// import "@hotwired/turbo-rails".
// require("@rails/activestorage").start()
// require("@rails/actioncable").start()
// Setup JS functions/libraries so that they're available within the js.erb templates
window.$ = jQuery;
window.jQuery = jQuery;
// Allow js.erb files to access the notificationHelper functions
window.renderAlert = renderAlert;
window.renderNotice = renderNotice;
window.toggleSpinner = toggleSpinner;