use vue for cms for link correction

This commit is contained in:
cgfhtw
2022-12-16 13:41:16 +01:00
parent 00c52e4880
commit c5b996f35e
5 changed files with 28 additions and 2 deletions
@@ -1,6 +1,7 @@
<?php
$includesArray = array(
'title' => 'FH-Complete',
'customJSModules' => ['public/js/apps/Cis/Cms.js'],
'customCSSs' => [
'public/css/Cis4/Cms.css',
#'skin/style.css.php'
@@ -1,5 +1,6 @@
<?php
$includesArray = array(
'customJSModules' => ['public/js/apps/Cis/Cms.js'],
'customCSSs' => [
'public/css/Cis4/Cms.css',
#'skin/style.css.php'
+1
View File
@@ -1,5 +1,6 @@
<?php
$includesArray = array(
'customJSModules' => ['public/js/apps/Cis/Cms.js'],
'customCSSs' => [
'public/css/Cis4/Cms.css',
#'skin/style.css.php'
+23
View File
@@ -0,0 +1,23 @@
import BsConfirm from "../../components/Bootstrap/Confirm.js";
Vue.createApp({
components: {
BsConfirm
},
mounted() {
document.querySelectorAll('#cms [data-confirm]').forEach(el => {
el.addEventListener('click', evt => {
evt.preventDefault();
BsConfirm.popup(el.dataset.confirm).then(() => {
Axios.get(el.href).then(res => {
// TODO(chris): check for success then show message and/or reload
location = location;
}).catch(err => console.error('ERROR:', err));
}).catch(()=>{});
});
});
document.querySelectorAll('#cms [data-href]').forEach(el => {
el.href = el.dataset.href.replace(/^ROOT\//, FHC_JS_DATA_STORAGE_OBJECT.app_root);
});
}
}).mount('#cms');
File diff suppressed because one or more lines are too long