Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
84b92791
Commit
84b92791
authored
Apr 02, 2021
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: convert page - task list + UI fixes
parent
26f1c0f3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
page-convert.vue
client/components/common/page-convert.vue
+1
-3
editor-modal-editorselect.vue
client/components/editor/editor-modal-editorselect.vue
+1
-1
pages.js
server/models/pages.js
+13
-0
No files found.
client/components/common/page-convert.vue
View file @
84b92791
...
...
@@ -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'
)))
}
...
...
client/components/editor/editor-modal-editorselect.vue
View file @
84b92791
...
...
@@ -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
...
...
server/models/pages.js
View file @
84b92791
...
...
@@ -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'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment