mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
add translations
This commit is contained in:
@ -39,6 +39,11 @@ return [
|
||||
'need_editor_to_save' => 'Need to be in edit mode to save the content.',
|
||||
'no_content' => 'Page is empty',
|
||||
'dropdown_roles' => 'Roles that can see this section',
|
||||
'save_content' => 'Save contents',
|
||||
'delete_section' => 'Delete section',
|
||||
'roles' => 'Roles',
|
||||
'multiple_select_role' => 'Select one or multiple roles'
|
||||
|
||||
|
||||
|
||||
];
|
||||
@ -45,6 +45,10 @@ return [
|
||||
'need_editor_to_save' => 'Tienes que estar en modo editar para guardar.',
|
||||
'no_content' => 'No hay contenido en la página',
|
||||
'dropdown_roles' => 'Roles que pueden ver la sección',
|
||||
|
||||
'save_content' => 'Guardar contenido',
|
||||
'delete_section' => 'Eliminar sección',
|
||||
'roles' => 'Roles',
|
||||
'multiple_select_role' => 'Selecciona uno o varios roles',
|
||||
'select_icon' => 'Selecciona un icono',
|
||||
|
||||
];
|
||||
|
||||
@ -17,7 +17,7 @@ import WikiSectionForm from '../forms/WikiSectionForm.js'
|
||||
|
||||
|
||||
|
||||
class WikiEditor extends TranslationHelper{
|
||||
class WikiEditor extends TranslationHelper {
|
||||
constructor() {
|
||||
super();
|
||||
this.sectionId = $("#wiki-section-id").val();
|
||||
@ -25,8 +25,7 @@ class WikiEditor extends TranslationHelper{
|
||||
this.wikiFormSection = new WikiSectionForm()
|
||||
this.wikiFormSection.setId(this.sectionId)
|
||||
}
|
||||
async initEditor()
|
||||
{
|
||||
async initEditor() {
|
||||
this.wikiFormSection.init()
|
||||
|
||||
await this.get_translations("Wiki")
|
||||
@ -107,46 +106,48 @@ class WikiEditor extends TranslationHelper{
|
||||
},
|
||||
})
|
||||
}
|
||||
async initViewOnly()
|
||||
{
|
||||
async initViewOnly() {
|
||||
try {
|
||||
await this.initEditor()
|
||||
await this.editor.isReady;
|
||||
this.handleGetDataPublished();
|
||||
} catch (reason) {
|
||||
console.log(`Editor.js initialization failed because of ${reason}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
async init() {
|
||||
try {
|
||||
await this.initEditor()
|
||||
$('#release-editor').attr('disabled', 'disabled')
|
||||
$('#save-editor').attr('disabled', 'disabled')
|
||||
await this.editor.isReady;
|
||||
new DragDrop(this.editor);
|
||||
/** Do anything you need after editor initialization */
|
||||
$('#save-editor').on('click', () => {
|
||||
this.editor.save().then(outputData => {
|
||||
alertConfirmAction(this.get_lang('save_content')).then(result => {
|
||||
if (result.isConfirmed) {
|
||||
this.handleSaveContent(outputData)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
this.editor.save().then(outputData => {
|
||||
alertConfirmAction(this.get_lang('save_content')).then(result => {
|
||||
if (result.isConfirmed) {
|
||||
this.handleSaveContent(outputData)
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
})
|
||||
$('#release-editor').on('click', () => {
|
||||
|
||||
this.editor.save().then(outputData => {
|
||||
alertConfirmAction('Publicar contenido').then(result => {
|
||||
if (result.isConfirmed) {
|
||||
this.handlePublishContent(outputData)
|
||||
}
|
||||
console.log(result)
|
||||
});
|
||||
}).catch((error) => {
|
||||
alertError(this.get_lang('need_editor_to_save')).fire()
|
||||
})
|
||||
|
||||
this.editor.save().then(outputData => {
|
||||
alertConfirmAction('Publicar contenido').then(result => {
|
||||
if (result.isConfirmed) {
|
||||
this.handlePublishContent(outputData)
|
||||
}
|
||||
console.log(result)
|
||||
});
|
||||
}).catch((error) => {
|
||||
alertError(this.get_lang('need_editor_to_save')).fire()
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
$('#preview-editor').on('click', () => {
|
||||
this.editor.readOnly.toggle()
|
||||
$('#edit-editor').removeClass('d-none')
|
||||
@ -155,12 +156,12 @@ class WikiEditor extends TranslationHelper{
|
||||
$('#save-editor').attr('disabled', 'disabled')
|
||||
})
|
||||
$('#edit-editor').on('click', () => {
|
||||
this.editor.readOnly.toggle()
|
||||
$('#edit-editor').addClass('d-none')
|
||||
$('#preview-editor').removeClass('d-none')
|
||||
|
||||
$('#release-editor').attr('disabled', null)
|
||||
$('#save-editor').attr('disabled', null)
|
||||
this.editor.readOnly.toggle()
|
||||
})
|
||||
this.handleGetData();
|
||||
} catch (reason) {
|
||||
@ -242,13 +243,13 @@ class WikiEditor extends TranslationHelper{
|
||||
this.handleGetData()
|
||||
}
|
||||
handleSaveContentError(response) { }
|
||||
centerImages(){
|
||||
centerImages() {
|
||||
setInterval(() => {
|
||||
|
||||
$(".image-tool img").css('margin','0 auto')
|
||||
$(".image-tool__caption").css('margin','0 auto').css('border','none').css('text-align','center').css('box-shadow','none')
|
||||
$(".image-tool img").css('margin', '0 auto')
|
||||
$(".image-tool__caption").css('margin', '0 auto').css('border', 'none').css('text-align', 'center').css('box-shadow', 'none')
|
||||
|
||||
},500)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user