]> _ Git - pmi.git/commitdiff
done #2983 @0:10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 28 Aug 2019 13:56:19 +0000 (15:56 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 28 Aug 2019 13:56:19 +0000 (15:56 +0200)
app/Http/Kernel.php
resources/js/app.js

index aa92b73936b3f668825800d0c3039b45aa78e45f..bb45c5ff931b161e87fc551cc177213992d75ee6 100644 (file)
@@ -21,6 +21,7 @@ class Kernel extends HttpKernel
         \App\Http\Middleware\TrustProxies::class,
         \Spatie\MissingPageRedirector\RedirectsMissingPages::class,
         \Spatie\Honeypot\ProtectAgainstSpam::class,
+        \Cubist\Backpack\app\Middleware\EmailObfuscate::class,
     ];
 
     /**
index 96de17ea053c187304309813fbe373cf41088de4..d4402db50895d121cb5f6f6b3c107d9e288991d0 100644 (file)
@@ -1,4 +1,3 @@
-
 /**
  * First we will load all of this project's JavaScript dependencies which
  * includes Vue and other libraries. It is a great starting point when
@@ -7,11 +6,13 @@
 
 require('./bootstrap');
 require('./menu');
+require('../../vendor/cubist/cms-back/src/public/emailobfuscator/emailobfuscator');
 
 window.Vue = require('vue');
 window.eventBus = new Vue();
 
 import PortalVue from 'portal-vue';
+
 Vue.use(PortalVue);
 
 /**
@@ -35,11 +36,11 @@ const app = new Vue({
     el: '#app',
 
     data: {
-      items: {}, // Populated from data attribute on root element so we can pass data from PHP
+        items: {}, // Populated from data attribute on root element so we can pass data from PHP
     },
 
     beforeMount() {
-      this.items = JSON.parse(this.$el.dataset.cartItems);
+        this.items = JSON.parse(this.$el.dataset.cartItems);
     },
 
     mounted() {
@@ -63,42 +64,40 @@ const app = new Vue({
     },
 
     computed: {
-      cartItemCount() {
-        // Todo: See if this should count just number of items or make a sum of all quantities? What is more useful? The sum of quantities can be found using map/reduce functions but this needs to be adapted for the object structure using Object.keys as the source.
-        return Object.keys(this.items).length;
-      },
-
-      cartData() {
-          return JSON.stringify(this.items.reduce((obj, item) => Object.assign(obj, { [item.id]: item.quantity }), {}));
-      }
+        cartItemCount() {
+            // Todo: See if this should count just number of items or make a sum of all quantities? What is more useful? The sum of quantities can be found using map/reduce functions but this needs to be adapted for the object structure using Object.keys as the source.
+            return Object.keys(this.items).length;
+        },
+
+        cartData() {
+            return JSON.stringify(this.items.reduce((obj, item) => Object.assign(obj, {[item.id]: item.quantity}), {}));
+        }
     },
 
     methods: {
 
-      saveCart(data) {
-          let root = this;
-
-          axios.post('/ajax/cart', data)
-              .then(function(response) {
-                  //console.log('Cart updated');
-                  //console.table(response.data);
-                  root.items = response.data;
-              })
-              .catch(function(error) {
-                  console.error('Error saving cart!', error);
-              });
-      },
-
-      openCart() {
-        document.body.classList.add('cart-open');
-      },
-      closeCart() {
-        document.body.classList.remove('cart-open');
-      },
+        saveCart(data) {
+            let root = this;
+
+            axios.post('/ajax/cart', data)
+                .then(function (response) {
+                    //console.log('Cart updated');
+                    //console.table(response.data);
+                    root.items = response.data;
+                })
+                .catch(function (error) {
+                    console.error('Error saving cart!', error);
+                });
+        },
+
+        openCart() {
+            document.body.classList.add('cart-open');
+        },
+        closeCart() {
+            document.body.classList.remove('cart-open');
+        },
 
     }
 
 
-
 });
-