diff --git a/client/components/common/page-convert.vue b/client/components/common/page-convert.vue index 94db317c..51dc94b7 100644 --- a/client/components/common/page-convert.vue +++ b/client/components/common/page-convert.vue @@ -100,9 +100,7 @@ export default { }) if (_.get(resp, 'data.pages.convert.responseResult.succeeded', false)) { this.isShown = false - _.delay(() => { - window.location.assign(`/e/${this.pageLocale}/${this.pagePath}`) - }, 400) + window.location.assign(`/e/${this.pageLocale}/${this.pagePath}`) } else { throw new Error(_.get(resp, 'data.pages.convert.responseResult.message', this.$t('common:error.unexpected'))) } diff --git a/client/components/editor/editor-modal-editorselect.vue b/client/components/editor/editor-modal-editorselect.vue index edb2ab24..b5ce35f5 100644 --- a/client/components/editor/editor-modal-editorselect.vue +++ b/client/components/editor/editor-modal-editorselect.vue @@ -96,7 +96,7 @@ img(src='/_assets/svg/editor-icon-ckeditor.svg', alt='Visual Editor', style='width: 36px;') .body-2.mt-2.primary--text Visual Editor .caption.grey--text Rich-text WYSIWYG - .caption.blue--text.text--lighten-2 {{$t('editor:select.cannotChange')}} + //- .caption.blue--text.text--lighten-2 {{$t('editor:select.cannotChange')}} v-card.radius-7.mt-2(color='teal darken-3', dark) v-card-text.text-center.py-4 diff --git a/server/models/pages.js b/server/models/pages.js index 681bba08..084577a3 100644 --- a/server/models/pages.js +++ b/server/models/pages.js @@ -488,6 +488,10 @@ module.exports = class Page extends Model { throw new Error('Invalid Page Id') } + if (ogPage.editorKey === opts.editor) { + throw new Error('Page is already using this editor. Nothing to convert.') + } + // -> Check for page access if (!WIKI.auth.checkAccess(opts.user, ['write:pages'], { locale: ogPage.localeCode, @@ -561,6 +565,15 @@ module.exports = class Page extends Model { replacement: c => `_${c}_` }) + td.addRule('taskList', { + filter: (n, o) => { + return n.nodeName === 'INPUT' && n.getAttribute('type') === 'checkbox' + }, + replacement: (c, n) => { + return n.getAttribute('checked') ? '[x] ' : '[ ] ' + } + }) + td.addRule('removeTocAnchors', { filter: (n, o) => { return n.nodeName === 'A' && n.classList.contains('toc-anchor')