-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
v3.1.0
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"index.css": { | ||
"file": "index.css", | ||
"src": "index.css" | ||
}, | ||
"index.html": { | ||
"css": [ | ||
"index.css" | ||
], | ||
"file": "index.js", | ||
"isEntry": true, | ||
"src": "index.html" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.astroid-list { | ||
.as-list-desc { | ||
p:last-child { | ||
margin-bottom: 0; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
@import "grid"; | ||
@import "video_button"; | ||
@import "articles"; | ||
@import "slideshow"; | ||
@import "slideshow"; | ||
@import "list"; |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"status": "success", | ||
"code": 200, | ||
"data": { | ||
"title": "Ok image", | ||
"desc": "", | ||
"thumbnail": "ok-image-666bf9ef19ae9.jpeg", | ||
"data": "{\"sections\":[{\"id\":\"61ad514af3b09062224585\",\"type\":\"section\",\"rows\":[{\"id\":\"61ad514af3b09035396904\",\"type\":\"row\",\"cols\":[{\"id\":\"61ad514af3b09028454803\",\"type\":\"column\",\"size\":{\"xxl\":6,\"xl\":12,\"lg\":6,\"md\":6,\"sm\":12,\"xs\":12},\"elements\":[{\"id\":\"61ad514d3caae458990356\",\"type\":\"testimonials\",\"state\":1,\"params\":[{\"name\":\"general\",\"value\":\"\"},{\"name\":\"title\",\"value\":\"Testimonials\"},{\"name\":\"customclass\",\"value\":\"\"},{\"name\":\"customid\",\"value\":\"\"},{\"name\":\"grid_options\",\"value\":\"\"},{\"name\":\"card_options\",\"value\":\"\"},{\"name\":\"slider_options\",\"value\":\"\"},{\"name\":\"avatar_options\",\"value\":\"\"},{\"name\":\"name_options\",\"value\":\"\"},{\"name\":\"designation_options\",\"value\":\"\"},{\"name\":\"content_options\",\"value\":\"\"},{\"name\":\"testimonials\",\"value\":\"\"},{\"name\":\"overlay_text_color\",\"value\":\"\"},{\"name\":\"column_responsive\",\"value\":\"lg\"},{\"name\":\"xxl_column\",\"value\":\"\"},{\"name\":\"xl_column\",\"value\":\"\"},{\"name\":\"lg_column\",\"value\":\"1\"},{\"name\":\"md_column\",\"value\":\"1\"},{\"name\":\"sm_column\",\"value\":\"1\"},{\"name\":\"xs_column\",\"value\":\"1\"},{\"name\":\"row_gutter_xxl\",\"value\":\"\"},{\"name\":\"row_gutter_xl\",\"value\":\"\"},{\"name\":\"row_gutter_lg\",\"value\":\"4\"},{\"name\":\"row_gutter_md\",\"value\":\"3\"},{\"name\":\"row_gutter_sm\",\"value\":\"3\"},{\"name\":\"row_gutter\",\"value\":\"3\"},{\"name\":\"column_gutter_xxl\",\"value\":\"\"},{\"name\":\"column_gutter_xl\",\"value\":\"\"},{\"name\":\"column_gutter_lg\",\"value\":\"4\"},{\"name\":\"column_gutter_md\",\"value\":\"3\"},{\"name\":\"column_gutter_sm\",\"value\":\"3\"},{\"name\":\"column_gutter\",\"value\":\"3\"},{\"name\":\"card_style\",\"value\":\"\"},{\"name\":\"card_size\",\"value\":\"\"},{\"name\":\"card_padding\",\"value\":\"\"},{\"name\":\"card_border_radius\",\"value\":\"\"},{\"name\":\"card_rounded_size\",\"value\":\"3\"},{\"name\":\"avatar_column_responsive\",\"value\":\"lg\"},{\"name\":\"xxl_column_avatar\",\"value\":\"\"},{\"name\":\"xl_column_avatar\",\"value\":\"\"},{\"name\":\"lg_column_avatar\",\"value\":\"4\"},{\"name\":\"md_column_avatar\",\"value\":\"12\"},{\"name\":\"sm_column_avatar\",\"value\":\"12\"},{\"name\":\"xs_column_avatar\",\"value\":\"12\"},{\"name\":\"enable_grid_match\",\"value\":\"0\"},{\"name\":\"card_hover_transition\",\"value\":\"\"},{\"name\":\"card_box_shadow\",\"value\":\"\"},{\"name\":\"card_box_shadow_hover\",\"value\":\"\"},{\"name\":\"enable_slider\",\"value\":\"0\"},{\"name\":\"slider_autoplay\",\"value\":\"0\"},{\"name\":\"interval\",\"value\":\"3\"},{\"name\":\"slider_nav\",\"value\":1},{\"name\":\"slider_dotnav\",\"value\":\"0\"},{\"name\":\"avatar_position\",\"value\":\"top\"},{\"name\":\"image_max_width\",\"value\":\"200\"},{\"name\":\"image_border\",\"value\":\"\"},{\"name\":\"image_border_radius\",\"value\":\"0\"},{\"name\":\"image_rounded_size\",\"value\":\"3\"},{\"name\":\"hover_effect\",\"value\":\"\"},{\"name\":\"hover_transition\",\"value\":\"\"},{\"name\":\"title_html_element\",\"value\":\"h3\"},{\"name\":\"title_font_style\",\"value\":{\"font_face\":\"\",\"alt_font_face\":\"\",\"font_size\":{\"desktop\":\"\",\"mobile\":\"\",\"tablet\":\"\"},\"font_size_unit\":{\"desktop\":\"em\",\"mobile\":\"em\",\"tablet\":\"em\"},\"font_color\":\"{\\\"light\\\":\\\"\\\",\\\"dark\\\":\\\"\\\"}\",\"letter_spacing\":{\"desktop\":\"\",\"mobile\":\"\",\"tablet\":\"\"},\"letter_spacing_unit\":{\"desktop\":\"em\",\"mobile\":\"em\",\"tablet\":\"em\"},\"line_height\":{\"desktop\":\"\",\"mobile\":\"\",\"tablet\":\"\"},\"line_height_unit\":{\"desktop\":\"em\",\"mobile\":\"em\",\"tablet\":\"em\"},\"font_style\":[],\"font_weight\":\"\",\"text_transform\":\"\"}},{\"name\":\"title_heading_margin\",\"value\":\"\"},{\"name\":\"designation_font_style\",\"value\":{\"font_face\":\"\",\"alt_font_face\":\"\",\"font_size\":{\"desktop\":\"\",\"mobile\":\"\",\"tablet\":\"\"},\"font_size_unit\":{\"desktop\":\"em\",\"mobile\":\"em\",\"tablet\":\"em\"},\"font_color\":\"{\\\"light\\\":\\\"\\\",\\\"dark\\\":\\\"\\\"}\",\"letter_spacing\":{\"desktop\":\"\",\"mobile\":\"\",\"tablet\":\"\"},\"letter_spacing_unit\":{\"desktop\":\"em\",\"mobile\":\"em\",\"tablet\":\"em\"},\"line_height\":{\"desktop\":\"\",\"mobile\":\"\",\"tablet\":\"\"},\"line_height_unit\":{\"desktop\":\"em\",\"mobile\":\"em\",\"tablet\":\"em\"},\"font_style\":[],\"font_weight\":\"\",\"text_transform\":\"\"}},{\"name\":\"designation_heading_margin\",\"value\":\"\"},{\"name\":\"designation_position\",\"value\":\"after\"},{\"name\":\"content_font_style\",\"value\":{\"font_face\":\"\",\"alt_font_face\":\"\",\"font_size\":{\"desktop\":\"\",\"mobile\":\"\",\"tablet\":\"\"},\"font_size_unit\":{\"desktop\":\"em\",\"mobile\":\"em\",\"tablet\":\"em\"},\"font_color\":\"{\\\"light\\\":\\\"\\\",\\\"dark\\\":\\\"\\\"}\",\"letter_spacing\":{\"desktop\":\"\",\"mobile\":\"\",\"tablet\":\"\"},\"letter_spacing_unit\":{\"desktop\":\"em\",\"mobile\":\"em\",\"tablet\":\"em\"},\"line_height\":{\"desktop\":\"\",\"mobile\":\"\",\"tablet\":\"\"},\"line_height_unit\":{\"desktop\":\"em\",\"mobile\":\"em\",\"tablet\":\"em\"},\"font_style\":[],\"font_weight\":\"\",\"text_transform\":\"\"}},{\"name\":\"content_margin\",\"value\":\"\"},{\"name\":\"spacing_settings\",\"value\":\"\"},{\"name\":\"astroid_element_visibility\",\"value\":\"allPage\"},{\"name\":\"animation\",\"value\":\"\"},{\"name\":\"animation_delay\",\"value\":\"500\"},{\"name\":\"animation_duration\",\"value\":\"500\"},{\"name\":\"max_width\",\"value\":\"\"},{\"name\":\"max_width_breakpoint\",\"value\":\"\"},{\"name\":\"block_align\",\"value\":\"\"},{\"name\":\"block_align_breakpoint\",\"value\":\"\"},{\"name\":\"block_align_fallback\",\"value\":\"\"},{\"name\":\"text_alignment\",\"value\":\"\"},{\"name\":\"text_alignment_breakpoint\",\"value\":\"\"},{\"name\":\"text_alignment_fallback\",\"value\":\"\"},{\"name\":\"background_setting\",\"value\":\"0\"},{\"name\":\"background_color\",\"value\":\"\"},{\"name\":\"img_background_color\",\"value\":\"\"},{\"name\":\"background_image\",\"value\":\"\"},{\"name\":\"background_repeat\",\"value\":\"\"},{\"name\":\"background_size\",\"value\":\"\"},{\"name\":\"background_attchment\",\"value\":\"\"},{\"name\":\"background_position\",\"value\":\"\"},{\"name\":\"background_video\",\"value\":\"\"},{\"name\":\"background_image_overlay\",\"value\":\"0\"},{\"name\":\"background_image_overlay_color\",\"value\":\"\"},{\"name\":\"background_image_overlay_gradient\",\"value\":\"{\\\"type\\\":\\\"linear\\\",\\\"start\\\":\\\"\\\",\\\"stop\\\":\\\"\\\",\\\"start_pos\\\":0,\\\"stop_pos\\\":100,\\\"angle\\\":0,\\\"position\\\":\\\"at center center\\\"}\"},{\"name\":\"background_image_overlay_pattern\",\"value\":\"\"},{\"name\":\"background_gradient\",\"value\":\"{\\\"type\\\":\\\"linear\\\",\\\"start\\\":\\\"\\\",\\\"stop\\\":\\\"\\\",\\\"start_pos\\\":0,\\\"stop_pos\\\":100,\\\"angle\\\":0,\\\"position\\\":\\\"at center center\\\"}\"},{\"name\":\"custom_colors\",\"value\":\"0\"},{\"name\":\"text_color\",\"value\":\"\"},{\"name\":\"link_color\",\"value\":\"\"},{\"name\":\"link_hover_color\",\"value\":\"\"},{\"name\":\"margin\",\"value\":\"\"},{\"name\":\"padding\",\"value\":\"\"},{\"name\":\"device_settings\",\"value\":\"\"},{\"name\":\"hideonxs\",\"value\":\"0\"},{\"name\":\"hideonsm\",\"value\":\"0\"},{\"name\":\"hideonmd\",\"value\":\"0\"},{\"name\":\"hideonlg\",\"value\":\"0\"},{\"name\":\"hideonxl\",\"value\":\"0\"},{\"name\":\"hideonxxl\",\"value\":\"0\"},{\"name\":\"assignment_type\",\"value\":\"1\"},{\"name\":\"assignment\",\"value\":\"{\\\"101\\\":true,\\\"102\\\":true}\"}]},{\"id\":\"61ad5151f5e32815625391\",\"type\":\"image\",\"state\":1,\"params\":[{\"name\":\"general\",\"value\":\"\"},{\"name\":\"title\",\"value\":\"Image\"},{\"name\":\"customclass\",\"value\":\"\"},{\"name\":\"customid\",\"value\":\"\"},{\"name\":\"widget_styles\",\"value\":\"\"},{\"name\":\"image\",\"value\":\"brooke-cagle-g1Kr4Ozfoac-unsplash.jpg\"},{\"name\":\"use_link\",\"value\":\"0\"},{\"name\":\"link\",\"value\":\"\"},{\"name\":\"target\",\"value\":\"\"},{\"name\":\"max_width\",\"value\":\"\"},{\"name\":\"border_radius\",\"value\":\"\"},{\"name\":\"image_rounded_size\",\"value\":\"3\"},{\"name\":\"box_shadow\",\"value\":\"\"},{\"name\":\"hover_effect\",\"value\":\"\"},{\"name\":\"hover_transition\",\"value\":\"\"},{\"name\":\"spacing_settings\",\"value\":\"\"},{\"name\":\"astroid_element_visibility\",\"value\":\"allPage\"},{\"name\":\"animation\",\"value\":\"\"},{\"name\":\"animation_delay\",\"value\":\"500\"},{\"name\":\"animation_duration\",\"value\":\"500\"},{\"name\":\"max_width_breakpoint\",\"value\":\"\"},{\"name\":\"block_align\",\"value\":\"\"},{\"name\":\"block_align_breakpoint\",\"value\":\"\"},{\"name\":\"block_align_fallback\",\"value\":\"\"},{\"name\":\"text_alignment\",\"value\":\"\"},{\"name\":\"text_alignment_breakpoint\",\"value\":\"\"},{\"name\":\"text_alignment_fallback\",\"value\":\"\"},{\"name\":\"background_setting\",\"value\":\"0\"},{\"name\":\"background_color\",\"value\":\"\"},{\"name\":\"img_background_color\",\"value\":\"\"},{\"name\":\"background_image\",\"value\":\"\"},{\"name\":\"background_repeat\",\"value\":\"\"},{\"name\":\"background_size\",\"value\":\"\"},{\"name\":\"background_attchment\",\"value\":\"\"},{\"name\":\"background_position\",\"value\":\"\"},{\"name\":\"background_video\",\"value\":\"\"},{\"name\":\"background_image_overlay\",\"value\":\"0\"},{\"name\":\"background_image_overlay_color\",\"value\":\"\"},{\"name\":\"background_image_overlay_gradient\",\"value\":\"{\\\"type\\\":\\\"linear\\\",\\\"start\\\":\\\"\\\",\\\"stop\\\":\\\"\\\",\\\"start_pos\\\":0,\\\"stop_pos\\\":100,\\\"angle\\\":0,\\\"position\\\":\\\"at center center\\\"}\"},{\"name\":\"background_image_overlay_pattern\",\"value\":\"\"},{\"name\":\"background_gradient\",\"value\":\"{\\\"type\\\":\\\"linear\\\",\\\"start\\\":\\\"\\\",\\\"stop\\\":\\\"\\\",\\\"start_pos\\\":0,\\\"stop_pos\\\":100,\\\"angle\\\":0,\\\"position\\\":\\\"at center center\\\"}\"},{\"name\":\"custom_colors\",\"value\":\"0\"},{\"name\":\"text_color\",\"value\":\"\"},{\"name\":\"link_color\",\"value\":\"\"},{\"name\":\"link_hover_color\",\"value\":\"\"},{\"name\":\"margin\",\"value\":\"\"},{\"name\":\"padding\",\"value\":\"\"},{\"name\":\"device_settings\",\"value\":\"\"},{\"name\":\"hideonxs\",\"value\":\"0\"},{\"name\":\"hideonsm\",\"value\":\"0\"},{\"name\":\"hideonmd\",\"value\":\"0\"},{\"name\":\"hideonlg\",\"value\":\"0\"},{\"name\":\"hideonxl\",\"value\":\"0\"},{\"name\":\"hideonxxl\",\"value\":\"0\"},{\"name\":\"assignment_type\",\"value\":\"1\"},{\"name\":\"assignment\",\"value\":\"{\\\"101\\\":true,\\\"102\\\":true}\"}]}],\"state\":1}],\"fill\":true,\"state\":1}],\"params\":[{\"name\":\"title\",\"value\":\"Astroid Section\"}],\"state\":1}],\"devices\":[{\"code\":\"xl\",\"icon\":\"fa-solid fa-desktop\",\"title\":\"Extra Large\"},{\"code\":\"lg\",\"icon\":\"fa-solid fa-computer\",\"title\":\"Large Device\"},{\"code\":\"md\",\"icon\":\"fa-solid fa-laptop\",\"title\":\"Medium Device\"},{\"code\":\"sm\",\"icon\":\"fa-solid fa-tablet-screen-button\",\"title\":\"On Tablet\"},{\"code\":\"xs\",\"icon\":\"fa-solid fa-mobile-screen\",\"title\":\"On Mobile\"}]}" | ||
} | ||
} |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"status":"success","code":200,"data":[]} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<script setup> | ||
import { onBeforeMount, ref, provide } from 'vue'; | ||
import axios from "axios"; | ||
import { faCircle, faArrowsLeftRight, faTrash, faDownload } from "@fortawesome/free-solid-svg-icons"; | ||
import { library } from '@fortawesome/fontawesome-svg-core' | ||
import Modal from "./components/helpers/Modal.vue"; | ||
library.add(faCircle, faArrowsLeftRight, faTrash, faDownload); | ||
const props = defineProps(['widget_json_id']); | ||
const data = JSON.parse(document.getElementById(props.widget_json_id+'_json').innerHTML); | ||
provide('constant', data.constant); | ||
const widgets = ref(); | ||
const save_disabled = ref(false); | ||
onBeforeMount(()=>{ | ||
widgets.value = data.widgets; | ||
}) | ||
const _showModal = ref(false); | ||
const element = ref({}); | ||
function editElement(el) { | ||
element.value = el; | ||
_showModal.value = true; | ||
} | ||
function closeElement() { | ||
_showModal.value = false; | ||
} | ||
function saveElement(params) { | ||
const action_link = 'index.php?option=com_ajax&astroid=saveArticleElement&ts='+Date.now(); | ||
const formData = new FormData(); | ||
widgets.value.every(widget => { | ||
if (element.value.type === widget.type && element.value.id === widget.id) { | ||
widget.params = params; | ||
formData.append(data.constant.astroid_admin_token, 1); | ||
formData.append('article_id', data.article_id); | ||
formData.append('template', data.template); | ||
formData.append('data', JSON.stringify(widget)); | ||
save_disabled.value = true; | ||
axios.post(action_link, formData, { | ||
headers: { | ||
"Content-Type": "multipart/form-data", | ||
}, | ||
}) | ||
.then((response) => { | ||
if (response.data.status === 'success') { | ||
save_disabled.value = false; | ||
} | ||
}) | ||
.catch((err) => { | ||
console.error(err); | ||
}); | ||
element.value = {}; | ||
return false; | ||
} | ||
return true; | ||
}); | ||
} | ||
</script> | ||
<template> | ||
<div class="article-layout-data row row-cols-xl-4 row-cols-lg-3 row-cols-md-2 row-cols-sm-1 row-cols-2"> | ||
<div v-for="widget in widgets"> | ||
<div class="article-widget card card-body border"> | ||
<div class="d-flex justify-content-between"> | ||
<div class="widget-name"> | ||
<div><i class="text-body-tertiary me-2" :class="data.constant.form_template[widget.type].info.icon"></i>{{ widget.params.find((param) => param.name === 'title').value }}</div> | ||
<div class="text-body-tertiary form-text">{{ widget.type }}</div> | ||
</div> | ||
<div class="widget-toolbar"> | ||
<ul class="nav"> | ||
<li class="nav-item"> | ||
<a v-if="!save_disabled" class="nav-link py-0 px-1" href="#" @click.prevent="editElement(widget)"><i class="fas fa-pencil-alt"></i> Edit</a> | ||
<i v-else class="fa-solid fa-spinner fa-spin-pulse"></i> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<Transition name="fade"> | ||
<Modal v-if="_showModal" :element="element" :form="data.constant.form_template[element.type]" @update:saveElement="saveElement" @update:close-element="closeElement" /> | ||
</Transition> | ||
</template> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { createApp } from 'vue' | ||
import Article from './Article.vue' | ||
import { FontAwesomeIcon, FontAwesomeLayers, FontAwesomeLayersText } from '@fortawesome/vue-fontawesome' | ||
import { install as VueMonacoEditorPlugin } from '@guolao/vue-monaco-editor' | ||
import "vue-search-select/dist/VueSearchSelect.css" | ||
import 'vue-color-kit/dist/vue-color-kit.css' | ||
import 'quill/dist/quill.snow.css' | ||
import './assets/article_data.scss' | ||
let as_widgets = document.querySelectorAll('.as-article-widget-data'); | ||
as_widgets.forEach(as_widget => { | ||
let app = createApp(Article, { | ||
widget_json_id : as_widget.id | ||
}); | ||
app.use(VueMonacoEditorPlugin, { | ||
paths: { | ||
// The default CDN config | ||
vs: 'https://cdn.jsdelivr.net/npm/[email protected]/min/vs' | ||
}, | ||
}); | ||
app.component('font-awesome-icon', FontAwesomeIcon); | ||
app.component('font-awesome-layers', FontAwesomeLayers); | ||
app.component('font-awesome-layers-text', FontAwesomeLayersText); | ||
app.mount('#'+as_widget.id); | ||
}); |