- aggiornato la guida per installare la App

- aggiornato la Guida Completa e Breve di RISO.
- pagina per ricevere i RIS.
- sistemato problema creazione nuovi Circuiti (admin non corretti).
- corretto giro delle email, invitante, invitato e ricezione msg su telegram.
This commit is contained in:
Surya Paolo
2025-11-23 01:13:27 +01:00
parent 8ab7594f16
commit 9faaa1a4c3
39 changed files with 929 additions and 1064 deletions

View File

@@ -1,10 +1,9 @@
import { tools } from '@tools';
import { CTitleBanner } from '../CTitleBanner';
import { tools } from '@tools'
import { CTitleBanner } from '../CTitleBanner'
import { defineComponent, onMounted, ref, toRef, watch } from 'vue'
import { useQuasar } from 'quasar'
import { useI18n } from 'vue-i18n'
import { defineComponent, onMounted, ref, toRef, watch } from 'vue';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
export default defineComponent({
name: 'CMyEditor',
@@ -44,19 +43,24 @@ export default defineComponent({
type: Number,
required: false,
default: 0,
}
},
startInCodeMode: {
type: Boolean,
required: false,
default: false,
},
},
setup(props, { emit }) {
const $q = useQuasar()
const $q = useQuasar();
const { t } = useI18n();
const editorRef = ref(<any>null)
const editor = ref('')
const characterCount = ref(0)
const editorRef = ref(<any>null);
const editor = ref('');
const characterCount = ref(0);
//const myvalue = toRef(props, 'value')
const myvalue = ref('')
const mycolor = ref('')
const myvalue = ref('');
const mycolor = ref('');
const myfonts = ref({
arial: 'Arial',
@@ -68,9 +72,9 @@ export default defineComponent({
lucida_grande: 'Lucida Grande',
times_new_roman: 'Times New Roman',
verdana: 'Verdana',
})
});
const showtools = ref(false)
const showtools = ref(false);
const toolbarcomp = ref([
['left', 'center', 'right', 'justify'],
@@ -81,13 +85,7 @@ export default defineComponent({
label: $q.lang.editor.formatting,
icon: $q.iconSet.editor.formatting,
list: 'no-icons',
options: [
'p',
'h4',
'h5',
'h6',
'code'
]
options: ['p', 'h4', 'h5', 'h6', 'code'],
},
{
label: $q.lang.editor.fontSize,
@@ -95,15 +93,7 @@ export default defineComponent({
fixedLabel: true,
fixedIcon: true,
list: 'no-icons',
options: [
'size-1',
'size-2',
'size-3',
'size-4',
'size-5',
'size-6',
'size-7'
]
options: ['size-1', 'size-2', 'size-3', 'size-4', 'size-5', 'size-6', 'size-7'],
},
{
label: $q.lang.editor.defaultFont,
@@ -119,23 +109,23 @@ export default defineComponent({
'impact',
'lucida_grande',
'times_new_roman',
'verdana'
]
'verdana',
],
},
'removeFormat'
'removeFormat',
],
['quote', 'unordered', 'ordered', 'outdent', 'indent'],
['undo', 'redo', 'viewsource'],
])
]);
watch(() => props.value, (newval, oldval) => {
if (props.value === undefined)
myvalue.value = ''
else
myvalue.value = props.value
})
watch(
() => props.value,
(newval, oldval) => {
if (props.value === undefined) myvalue.value = '';
else myvalue.value = props.value;
}
);
function getTextLength(html: string) {
// Crea un elemento temporaneo per convertire HTML in testo
@@ -146,26 +136,28 @@ export default defineComponent({
function changeval(newval: any) {
// console.log('myEditor: changeval', newval)
characterCount.value = getTextLength(newval)
emit('update:value', newval)
characterCount.value = getTextLength(newval);
// newval = newval.replace(/&nbsp;/g, ' ')
emit('update:value', newval);
}
function annulla() {
emit('annulla', true)
emit('annulla', true);
}
function saveval() {
// Converti i <b> in <strong>
myvalue.value = tools.convertinbspInSpazi(myvalue.value);
myvalue.value = tools.convertiTagHTMLPerBOT(myvalue.value)
// myvalue.value = tools.convertiTagHTMLPerBOT(myvalue.value)
console.log('saveval', myvalue.value)
emit('showandsave', myvalue.value)
console.log('saveval', myvalue.value);
emit('showandsave', myvalue.value);
// emit('update:value', myvalue)
}
function setcolor() {
document.execCommand('foreColor', false, mycolor.value)
document.execCommand('foreColor', false, mycolor.value);
}
/**
@@ -198,29 +190,35 @@ export default defineComponent({
}
function mounted() {
if (props.value === undefined)
myvalue.value = ''
else
myvalue.value = props.value
if (props.value === undefined) myvalue.value = '';
else myvalue.value = props.value;
showtools.value = tools.getCookie('showtools', '0') === '1'
showtools.value = tools.getCookie('showtools', '0') === '1';
characterCount.value = getTextLength(myvalue.value)
characterCount.value = getTextLength(myvalue.value);
if (props.startInCodeMode) {
// Attiva modalità codice di default
setTimeout(() => {
if (editorRef.value) {
editorRef.value.runCmd('viewsource');
}
}, 100);
}
}
function onPaste(evt: any) {
// Let inputs do their thing, so we don't break pasting of links.
if (evt.target.nodeName === 'INPUT') return
let text, onPasteStripFormattingIEPaste
evt.preventDefault()
evt.stopPropagation()
if (evt.target.nodeName === 'INPUT') return;
let text, onPasteStripFormattingIEPaste;
evt.preventDefault();
evt.stopPropagation();
if (evt.originalEvent && evt.originalEvent.clipboardData.getData) {
text = evt.originalEvent.clipboardData.getData('text/plain')
editorRef.value.runCmd('insertText', text)
}
else if (evt.clipboardData && evt.clipboardData.getData) {
text = evt.clipboardData.getData('text/plain')
editorRef.value.runCmd('insertText', text)
text = evt.originalEvent.clipboardData.getData('text/plain');
editorRef.value.runCmd('insertText', text);
} else if (evt.clipboardData && evt.clipboardData.getData) {
text = evt.clipboardData.getData('text/plain');
editorRef.value.runCmd('insertText', text);
}
/*else if (ClipboardEvent.clipboardData && ClipboardEvent.clipboardData.getData) {
if (!onPasteStripFormattingIEPaste) {
@@ -231,7 +229,7 @@ export default defineComponent({
}*/
}
onMounted(mounted)
onMounted(mounted);
return {
myfonts,
@@ -250,6 +248,6 @@ export default defineComponent({
showtools,
characterCount,
t,
}
}
})
};
},
});