+window.Events = new EventManager();
+Vue.prototype.$events = window.Events;
+
+// Load in angular specific items
+const Services = require('./services');
+const Directives = require('./directives');
+const Controllers = require('./controllers');
+Services(ngApp, window.Events);
+Directives(ngApp, window.Events);
+Controllers(ngApp, window.Events);
+
+//Global jQuery Config & Extensions
+
+// Smooth scrolling
+jQuery.fn.smoothScrollTo = function () {
+ if (this.length === 0) return;
+ $('html, body').animate({
+ scrollTop: this.offset().top - 60 // Adjust to change final scroll position top margin
+ }, 300); // Adjust to change animations speed (ms)
+ return this;
+};
+
+// Making contains text expression not worry about casing
+jQuery.expr[":"].contains = $.expr.createPseudo(function (arg) {
+ return function (elem) {
+ return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
+ };
+});
+
+// Global jQuery Elements
+let notifications = $('.notification');
+let successNotification = notifications.filter('.pos');
+let errorNotification = notifications.filter('.neg');
+let warningNotification = notifications.filter('.warning');
+// Notification Events
+window.Events.listen('success', function (text) {
+ successNotification.hide();
+ successNotification.find('span').text(text);
+ setTimeout(() => {
+ successNotification.show();
+ }, 1);
+});
+window.Events.listen('warning', function (text) {
+ warningNotification.find('span').text(text);
+ warningNotification.show();
+});
+window.Events.listen('error', function (text) {
+ errorNotification.find('span').text(text);
+ errorNotification.show();
+});
+
+// Notification hiding
+notifications.click(function () {
+ $(this).fadeOut(100);
+});
+
+// Chapter page list toggles
+$('.chapter-toggle').click(function (e) {
+ e.preventDefault();
+ $(this).toggleClass('open');
+ $(this).closest('.chapter').find('.inset-list').slideToggle(180);
+});