1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-30 19:00:32 +02:00

Blox editor: Warn if unsafed content

This commit is contained in:
trendschau
2023-09-05 20:18:59 +02:00
parent 980284108d
commit d25c000bb6
4 changed files with 61 additions and 20 deletions

View File

@@ -0,0 +1 @@
["# ToDos Version 2","[TOC]","## System settings","* DONE: Migrate from backend to frontend with vue and api\n* DONE: Redesign\n* DONE: License feature\n* DONE: Enhance with plugins","## Visual Editor","* DONE: Refactor and redesign\n* DONE: Fix toc component in new block\n* DONE: Fix hr component in new block\n* DONE: finish shortcode component\n* DONE: Fix inline formats\n* DONE: fix lenght of page\n* DONE: Fix design of new block at the end (background color)\n* DONE: Move Block\n* DONE: Fix headline design\n* DONE: Fix save on two enter\n* DONE: fix quote design\n* DONE: Fix toc preview\n* DONE: disable enable \n* DONE: Add load sign (from navigation)\n* DONE: File is not published from tmp to media\/files if you save the block.","## Raw Editor","* DONE: Refactor and redesign\n* DONE: Integrate highlighting","## Navigation","* DONE: Refactor and redesign\n* DONE: fix status in navigation\n* DONE: refresh navigation after changes","## Publish Controller","* DONE: Refactor and redesign\n* DONE: Create \n* DONE: publish\n* DONE: unpublish\n* DONE: discard\n* DONE: delete\n* DONE: save draft\n* DONE: switch to raw","## Meta Tabs","* DONE: Refactor and redesign\n* DONE: Enhance with plugins","## Medialib","* DONE: Refactor and redesign","## Posts","* DONE: Refactor and redesign","## Plugins","* Asset Class in progress","## Frontend","* DONE: Refactor\n* DONE: Test restrictions","## Other big tasks","* DONE: System setup\n* DONE: Recover Password","## Medium tasks","* DONE: Merge processAssets modell\n* DONE: Table of content duplicated for published pages\n* DONE: Session handling: csrf fail and session start error if restrictions are active\n* DONE: Image and files for meta","## Open tasks","* DONE: Sitemap and ping\n* DONE: Version check\n* DONE: Proxy support\n* DONE: SVG checker: https:\/\/github.com\/TribalSystems\/SVG-Sanitizer\n* DONE: Backend form builder\n* DONE: Image generation on the fly\n* DONE: Delete folder in base level\n* DONE: Make folder delete easier with glob or scandir\n* DONE: fix error messages (check models)\n* DONE: error status codes (check middleware)\n* DONE: Warn if open another block\n* Customfields not styled yet\n* Responsive design\n* Fix error api systemnavi\n* Captcha integration\n* Reference feature\n* Typemill Utilities\n* Clear cache\n* Show security Log\n* User search only for +10 users\n* Handle formdata centrally ???\n* Markdown secure rendering\n* Wrong frontend navigation if unpublished pages\n* finish youtube component\n* Solution for logo and favicon\n* For api translations should be done completely in backoffice","## Cleanups:","* DONE: Events\n* DONE: Error messages\n* Translations\n* https:\/\/stackoverflow.com\/questions\/15041608\/searching-all-files-in-folder-for-strings\n* https:\/\/github.com\/skfaisal93\/AnyWhereInFiles\/blob\/master\/anywhereinfiles-1.4.php\n* https:\/\/github.com\/stephenhodgkiss\/extract-translation-text-from-php-js","## Info: Select userroles","* Userroles for file restriction: in vue-blox-components loaded via api\n* Userroles for userfields: in php model user getUserFields()\n* Userroles for meta: in php controller apiAuthorMeta getMeta()\n* Plugins and themes: in php model extension getThemeDefinitions()","## Info: License Check","* On activation in apiControllerExtension. It checks the license in yaml.\n* In plugin php code with setPremiumLicense\n* In static plugins, it checks manual premium list and method setPremiumLicense and more ","## Plugins","* MAKER: Rebuild search\n* MAKER: Rebuild contactform with shortcode","## Status codes","| Status code | Description | \n|---|---|\n| 200 ok | cell | \n| 400 bad request | The request was unacceptable due to missing or invalid parameter. | \n| 401 unauthorized | The request requires an authorization. | \n| (402 request failed) | The parameters where there but the request failed for other reasons. | \n| 403 forbidden | The user is authenticated but he has not enough rights. | \n| 404 not found | new | \n| 500 internal server error | new |"]

File diff suppressed because one or more lines are too long

View File

@@ -38,7 +38,7 @@
navtitle: 'To Dos'
hide: false
noindex: false
path: /00-welcome/05-todos.md
path: /00-welcome/05-todos.txtmd
keyPath: '0.5'
/cyanine-theme:
navtitle: 'cyanine theme'

View File

@@ -122,7 +122,8 @@ bloxeditor.component('new-block',{
formats: bloxFormats,
componentType: false,
disabled: false,
newblockmarkdown: ''
newblockmarkdown: '',
unsafedcontent: false,
}
},
mounted: function()
@@ -132,20 +133,39 @@ bloxeditor.component('new-block',{
eventBus.$on('inlineFormat', content => {
this.newblockmarkdown = content;
});
eventBus.$on('lockcontent', content => {
this.unsafedcontent = true;
});
eventBus.$on('unlockcontent', content => {
this.unsafedcontent = false;
});
},
methods: {
setComponentType(event, componenttype)
{
this.componentType = componenttype;
if(this.unsafedcontent)
{
eventBus.$emit('publishermessage', 'Save or cancel your changes first.');
}
else
{
eventBus.$emit('freezeblocks');
this.componentType = componenttype;
}
},
closeComponent()
{
this.componentType = false;
this.newblockmarkdown = '';
eventBus.$emit('unlockcontent');
eventBus.$emit('publisherclear');
},
updateMarkdownFunction(value)
{
eventBus.$emit('lockcontent');
this.newblockmarkdown = value;
},
beforeSaveNew()
@@ -248,6 +268,7 @@ bloxeditor.component('content-block', {
newblock: false,
formats: bloxFormats,
load: false,
unsafedcontent: false,
}
},
mounted: function()
@@ -259,17 +280,33 @@ bloxeditor.component('content-block', {
eventBus.$on('inlineFormat', content => {
this.updatedmarkdown = content;
});
eventBus.$on('lockcontent', content => {
this.unsafedcontent = true;
});
eventBus.$on('unlockcontent', content => {
this.unsafedcontent = false;
});
},
methods: {
openNewBlock()
{
eventBus.$emit('freeze');
if(this.unsafedcontent)
{
eventBus.$emit('publishermessage', 'Save or cancel your changes first.');
}
else
{
eventBus.$emit('freeze');
this.newblock = true;
this.edit = false;
this.newblock = true;
this.edit = false;
}
},
closeNewBlock()
{
eventBus.$emit('unlockcontent');
eventBus.$emit('unfreeze');
eventBus.$emit('publisherclear');
@@ -277,6 +314,7 @@ bloxeditor.component('content-block', {
},
closeEditor()
{
eventBus.$emit('unlockcontent');
eventBus.$emit('closeEditor');
eventBus.$emit('unfreeze');
eventBus.$emit('publisherclear');
@@ -288,14 +326,21 @@ bloxeditor.component('content-block', {
},
showEditor()
{
eventBus.$emit('closeComponents');
eventBus.$emit('freeze');
if(this.unsafedcontent)
{
eventBus.$emit('publishermessage', 'Save or cancel your changes first.');
}
else
{
eventBus.$emit('closeComponents');
eventBus.$emit('freeze');
this.edit = true;
this.edit = true;
this.componentType = this.determineBlockType();
this.componentType = this.determineBlockType();
this.updatedmarkdown = this.element.markdown;
this.updatedmarkdown = this.element.markdown;
}
},
determineBlockType()
{
@@ -322,6 +367,7 @@ bloxeditor.component('content-block', {
},
updateMarkdownFunction(value)
{
eventBus.$emit('lockcontent');
this.updatedmarkdown = value;
},
disableSort()
@@ -344,6 +390,7 @@ bloxeditor.component('content-block', {
})
.then(function (response)
{
eventBus.$emit('unlockcontent');
self.load = false;
self.$root.$data.content = response.data.content;
if(response.data.navigation)
@@ -389,14 +436,6 @@ bloxeditor.component('content-block', {
return;
}
/*
if(typeof this.$refs.activeComponent.saveBlock === "function")
{
this.$refs.activeComponent.saveBlock(this.updatedmarkdown);
return;
}
*/
var self = this;
this.load = true;
@@ -409,6 +448,7 @@ bloxeditor.component('content-block', {
})
.then(function (response)
{
eventBus.$emit('unlockcontent');
self.load = false;
self.$root.$data.content = response.data.content;
if(response.data.navigation)