From f082b929a8142b024ac52f627b5898ed5f4c3ae8 Mon Sep 17 00:00:00 2001 From: Tushar Gugnani Date: Fri, 27 Jan 2023 22:53:27 +0530 Subject: [PATCH] fixes --- resources/dist/js/smart-banner.js | 11 ++++++++++- resources/views/smart-ad-manager/edit.blade.php | 17 ++++++++++++----- .../Controllers/SmartAdManagerController.php | 2 +- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/resources/dist/js/smart-banner.js b/resources/dist/js/smart-banner.js index fa9ebd3..7779009 100644 --- a/resources/dist/js/smart-banner.js +++ b/resources/dist/js/smart-banner.js @@ -8,7 +8,16 @@ fetch('/smart-banner-auto-placements') if(placement.selector){ var adSelector = document.querySelector(placement.selector); if(adSelector){ - let adBody = "
"+ad.body+"
" + let adBody = ''; + if(ad.adType == 'HTML'){ + adBody = "
"+ad.body+"
" + }else if(ad.adType == 'IMAGE'){ + adBody = "
\ + \ + \""+ad.imageAlt+"\"\ + \ +
" + } adSelector.insertAdjacentHTML(placement.position, adBody); } } diff --git a/resources/views/smart-ad-manager/edit.blade.php b/resources/views/smart-ad-manager/edit.blade.php index b02c809..536c7e9 100644 --- a/resources/views/smart-ad-manager/edit.blade.php +++ b/resources/views/smart-ad-manager/edit.blade.php @@ -130,12 +130,19 @@ class="block w-full mt-1 text-sm dark:border-gray-600 dark:bg-gray-700 focus:bor
id}")->with(['message' => 'Ad Created', 'color' => 'green']); }