tinymce auto save

This commit is contained in:
Eudes Inácio
2023-07-21 08:42:59 +01:00
parent 451b38f18d
commit eb4cc12d90
4 changed files with 34 additions and 13 deletions
+7 -4
View File
@@ -9,9 +9,9 @@
{{Document.Assunto}}
</div>
<div class="right cursor-pointer" (click)="openOptions()">
<!-- <div class="right cursor-pointer" (click)="openOptions()">
<fa-icon icon="ellipsis-v" class="menu-icon font-awesome-1"></fa-icon>
</div>
</div> -->
</div>
</ion-toolbar>
@@ -26,13 +26,16 @@ apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p"
plugins: [
'advlist autolink lists link image charmap print preview anchor',
'searchreplace visualblocks code fullscreen',
'insertdatetime media table paste code help wordcount print'
'insertdatetime media table paste code help wordcount print autosave'
],
autosave_ask_before_unload: false,
autosave_interval: '30s',
toolbar:
'undo redo | formatselect | bold italic backcolor | \
alignleft aligncenter alignright alignjustify | \
bullist numlist outdent indent | removeformat | print | help' }"
initialValue='{{content}}'
[(ngModel)]="content"
(onSaveContent)="somefunction()"
(onSaveContent)="saveDraft()"
></editor>
+21 -3
View File
@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
import { NavParams } from '@ionic/angular';
import { EventDetailsDocumentsOptionsPage } from '../shared/popover/event-details-documents-options/event-details-documents-options.page';
import { AlertController, ModalController } from '@ionic/angular';
import { ProcessesService } from '../services/processes.service';
import { HttpErrorHandle } from '../services/http-error-handle.service';
@Component({
selector: 'app-tiny-mce',
templateUrl: './tiny-mce.page.html',
@@ -22,6 +24,8 @@ export class TinyMCEPage implements OnInit {
constructor(
private navParams: NavParams,
private modalController: ModalController,
private processService: ProcessesService,
private erroHandler: HttpErrorHandle
) {
this.Document = this.navParams.get('Document')
@@ -36,9 +40,23 @@ export class TinyMCEPage implements OnInit {
this.modalController.dismiss()
}
somefunction() {
console.log(this.content)
}
saveDraft() {
console.log(document)
let objectDraft = {
"status": false,
"description": this.Document.Assunto,
"content": this.content,
"path": this.Document.path,
"ownerId": this.Document.ownerId
}
this.processService.SaveDraftByID(this.Document.DocId, objectDraft).subscribe((res) => [
this.erroHandler.httpsSucessMessagge('Draft Save'),
this.modalController.dismiss()
],(error) => {
this.erroHandler.httpStatusHandle(error)
})
}
async openOptions() {
const modal = await this.modalController.create({
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = {
"shortSHA": "59928bd49",
"SHA": "59928bd49f0fafaa6a515fc0f33001b0160a5083",
"shortSHA": "451b38f18",
"SHA": "451b38f18d50434a76982f87291ee761607505b2",
"branch": "developer-catch-merge",
"lastCommitAuthor": "'Eudes Inácio'",
"lastCommitTime": "'Sun Jul 16 22:17:23 2023 +0100'",
"lastCommitMessage": "pull made",
"lastCommitNumber": "5085",
"lastCommitTime": "'Mon Jul 17 10:52:44 2023 +0100'",
"lastCommitMessage": "Git verson update",
"lastCommitNumber": "5087",
"change": "",
"changeStatus": "On branch developer-catch-merge\nYour branch and 'origin/developer-catch-merge' have diverged,\nand have 3 and 1 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)",
"changeStatus": "On branch developer-catch-merge\nYour branch and 'origin/developer-catch-merge' have diverged,\nand have 4 and 3 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/tiny-mce/tiny-mce.page.html\n\tmodified: src/app/tiny-mce/tiny-mce.page.ts\n\tnew file: src/assets/images/error_circle_warning.png",
"changeAuthor": "eudes.inacio"
}