-// Vue Components
-Vue.component('image-manager', require('./components/image-manager.vue'));
-Vue.component('image-picker', require('./components/image-picker.vue'));
-Vue.component('toggle-switch', require('./components/toggle-switch.vue'));
+// Translation setup
+// Creates a global function with name 'trans' to be used in the same way as Laravel's translation system
+const Translations = require("./translations");
+let translator = new Translations(window.translations);
+window.trans = translator.get.bind(translator);
+
+
+require("./vues/vues");
+require("./components");
+
+// Load in angular specific items
+const Directives = require('./directives');
+const Controllers = require('./controllers');
+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;
+ };
+});