fix: code linting
This commit is contained in:
@@ -41,13 +41,17 @@
|
||||
v-list-item-title.body-2 {{$t('common:header.edit')}}
|
||||
v-list-item.pl-4(@click='pageHistory', v-if='mode !== `history`')
|
||||
v-list-item-avatar(size='24'): v-icon(color='grey lighten-2') mdi-history
|
||||
v-list-item-title.body-2.grey--text.text--ligten-2 {{$t('common:header.history')}}
|
||||
v-list-item-content
|
||||
v-list-item-title.body-2.grey--text.text--ligten-2 {{$t('common:header.history')}}
|
||||
v-list-item-subtitle.overline.grey--text.text--lighten-2 Coming soon
|
||||
v-list-item.pl-4(@click='pageSource', v-if='mode !== `source`')
|
||||
v-list-item-avatar(size='24'): v-icon(color='indigo') mdi-code-tags
|
||||
v-list-item-title.body-2 {{$t('common:header.viewSource')}}
|
||||
v-list-item.pl-4(@click='pageMove', v-if='isAuthenticated')
|
||||
v-list-item-avatar(size='24'): v-icon(color='grey lighten-2') mdi-content-save-move-outline
|
||||
v-list-item-title.body-2.grey--text.text--ligten-2 {{$t('common:header.move')}}
|
||||
v-list-item-content
|
||||
v-list-item-title.body-2.grey--text.text--ligten-2 {{$t('common:header.move')}}
|
||||
v-list-item-subtitle.overline.grey--text.text--lighten-2 Coming soon
|
||||
v-list-item.pl-4(@click='pageDelete', v-if='isAuthenticated')
|
||||
v-list-item-avatar(size='24'): v-icon(color='red darken-2') mdi-trash-can-outline
|
||||
v-list-item-title.body-2 {{$t('common:header.delete')}}
|
||||
@@ -55,7 +59,9 @@
|
||||
.overline.pa-4.grey--text {{$t('common:header.assets')}}
|
||||
v-list-item.pl-4(@click='assets')
|
||||
v-list-item-avatar(size='24'): v-icon(color='grey lighten-2') mdi-folder-multiple-image
|
||||
v-list-item-title.body-2.grey--text.text--ligten-2 {{$t('common:header.imagesFiles')}}
|
||||
v-list-item-content
|
||||
v-list-item-title.body-2.grey--text.text--ligten-2 {{$t('common:header.imagesFiles')}}
|
||||
v-list-item-subtitle.overline.grey--text.text--lighten-2 Coming soon
|
||||
v-toolbar-title(:class='{ "mx-2": $vuetify.breakpoint.mdAndUp, "mx-0": $vuetify.breakpoint.smAndDown }')
|
||||
span.subheading {{title}}
|
||||
v-flex(md4, v-if='$vuetify.breakpoint.mdAndUp')
|
||||
@@ -150,12 +156,11 @@
|
||||
v-btn(icon, v-on='{ ...menu, ...tooltip }', :class='$vuetify.rtl ? `ml-3` : ``')
|
||||
v-icon(color='grey') mdi-web
|
||||
span {{$t('common:header.language')}}
|
||||
v-list.py-0
|
||||
v-list(nav)
|
||||
template(v-for='(lc, idx) of locales')
|
||||
v-list-item(@click='changeLocale(lc)')
|
||||
v-list-item-action: v-chip(:color='lc.code === locale ? `blue` : `grey`', small, label, dark) {{lc.code.toUpperCase()}}
|
||||
v-list-item-title {{lc.name}}
|
||||
v-divider.my-0(v-if='idx < locales.length - 1')
|
||||
v-tooltip(bottom, v-if='isAuthenticated && isAdmin')
|
||||
template(v-slot:activator='{ on }')
|
||||
v-btn.btn-animate-rotate(icon, href='/a', v-on='on', :class='$vuetify.rtl ? `ml-3` : ``')
|
||||
@@ -170,7 +175,7 @@
|
||||
v-avatar(v-else-if='picture.kind === `image`', :size='34')
|
||||
v-img(:src='picture.url')
|
||||
span {{$t('common:header.account')}}
|
||||
v-list.py-0
|
||||
v-list(nav)
|
||||
v-list-item.py-3.grey(:class='$vuetify.theme.dark ? `darken-4-l5` : `lighten-5`')
|
||||
v-list-item-avatar
|
||||
v-avatar.blue(v-if='picture.kind === `initials`', :size='40')
|
||||
@@ -180,18 +185,19 @@
|
||||
v-list-item-content
|
||||
v-list-item-title {{name}}
|
||||
v-list-item-subtitle {{email}}
|
||||
v-divider.my-0
|
||||
v-list-item(href='/w', disabled)
|
||||
v-list-item-action: v-icon(color='blue') mdi-view-compact-outline
|
||||
v-list-item-title {{$t('common:header.myWiki')}}
|
||||
v-divider.my-0
|
||||
v-list-item-content
|
||||
v-list-item-title {{$t('common:header.myWiki')}}
|
||||
v-list-item-subtitle.overline Coming soon
|
||||
v-list-item(href='/p', disabled)
|
||||
v-list-item-action: v-icon(color='blue') mdi-face-profile
|
||||
v-list-item-title {{$t('common:header.profile')}}
|
||||
v-divider.my-0
|
||||
v-list-item-content
|
||||
v-list-item-title {{$t('common:header.profile')}}
|
||||
v-list-item-subtitle.overline Coming soon
|
||||
v-list-item(@click='logout')
|
||||
v-list-item-action: v-icon(color='red') mdi-logout
|
||||
v-list-item-title {{$t('common:header.logout')}}
|
||||
v-list-item-title.red--text {{$t('common:header.logout')}}
|
||||
|
||||
v-tooltip(v-else, left)
|
||||
template(v-slot:activator='{ on }')
|
||||
|
@@ -319,21 +319,21 @@ export default {
|
||||
})
|
||||
}, 500),
|
||||
onCmPaste (cm, ev) {
|
||||
const clipItems = (ev.clipboardData || ev.originalEvent.clipboardData).items
|
||||
for (let clipItem of clipItems) {
|
||||
if (_.startsWith(clipItem.type, 'image/')) {
|
||||
const file = clipItem.getAsFile()
|
||||
const reader = new FileReader()
|
||||
reader.onload = evt => {
|
||||
this.$store.commit(`loadingStart`, 'editor-paste-image')
|
||||
this.insertAfter({
|
||||
content: ``,
|
||||
newLine: true
|
||||
})
|
||||
}
|
||||
reader.readAsDataURL(file)
|
||||
}
|
||||
}
|
||||
// const clipItems = (ev.clipboardData || ev.originalEvent.clipboardData).items
|
||||
// for (let clipItem of clipItems) {
|
||||
// if (_.startsWith(clipItem.type, 'image/')) {
|
||||
// const file = clipItem.getAsFile()
|
||||
// const reader = new FileReader()
|
||||
// reader.onload = evt => {
|
||||
// this.$store.commit(`loadingStart`, 'editor-paste-image')
|
||||
// this.insertAfter({
|
||||
// content: ``,
|
||||
// newLine: true
|
||||
// })
|
||||
// }
|
||||
// reader.readAsDataURL(file)
|
||||
// }
|
||||
// }
|
||||
},
|
||||
/**
|
||||
* Update cursor state
|
||||
|
@@ -1,79 +1,79 @@
|
||||
/**
|
||||
* Placeholder attribute for inputs
|
||||
*
|
||||
* @return {string} Placeholder attributes
|
||||
*/
|
||||
* Placeholder attribute for inputs
|
||||
*
|
||||
* @return {string} Placeholder attributes
|
||||
*/
|
||||
@mixin placeholder {
|
||||
&::-webkit-input-placeholder {@content};
|
||||
&::-moz-placeholder {@content}
|
||||
&:-ms-input-placeholder {@content}
|
||||
&:placeholder-shown {@content};
|
||||
&::-webkit-input-placeholder {@content;}
|
||||
&::-moz-placeholder {@content;}
|
||||
&:-ms-input-placeholder {@content;}
|
||||
&:placeholder-shown {@content;}
|
||||
}
|
||||
|
||||
/**
|
||||
* Spinner element
|
||||
*
|
||||
* @param {string} $color - Color
|
||||
* @param {string} $dur - Animation Duration
|
||||
* @param {int} $width - Width
|
||||
* @param {int} $height [$width] - height
|
||||
*
|
||||
* @return {string} Spinner element
|
||||
*/
|
||||
* Spinner element
|
||||
*
|
||||
* @param {string} $color - Color
|
||||
* @param {string} $dur - Animation Duration
|
||||
* @param {int} $width - Width
|
||||
* @param {int} $height [$width] - height
|
||||
*
|
||||
* @return {string} Spinner element
|
||||
*/
|
||||
@mixin spinner($color,$dur,$width,$height:$width) {
|
||||
width: $width;
|
||||
height: $height;
|
||||
border-radius: 50%;
|
||||
box-shadow:0 0 0 1px rgba(0,0,0,0.1), 2px 1px 0 $color;
|
||||
@include prefix(animation, spin $dur linear infinite);
|
||||
@include keyframes(spin) {
|
||||
100%{
|
||||
@include prefix(transform, rotate(360deg));
|
||||
}
|
||||
};
|
||||
width: $width;
|
||||
height: $height;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 0 0 1px rgba(0,0,0,0.1), 2px 1px 0 $color;
|
||||
@include prefix(animation, spin $dur linear infinite);
|
||||
@include keyframes(spin) {
|
||||
100%{
|
||||
@include prefix(transform, rotate(360deg));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefixes for keyframes
|
||||
*
|
||||
* @param {string} $animation-name - The animation name
|
||||
*
|
||||
* @return {string} Prefixed keyframes attributes
|
||||
*/
|
||||
* Prefixes for keyframes
|
||||
*
|
||||
* @param {string} $animation-name - The animation name
|
||||
*
|
||||
* @return {string} Prefixed keyframes attributes
|
||||
*/
|
||||
@mixin keyframes($animation-name) {
|
||||
@-webkit-keyframes #{$animation-name} {
|
||||
@content;
|
||||
}
|
||||
@-moz-keyframes #{$animation-name} {
|
||||
@content;
|
||||
}
|
||||
@-o-keyframes #{$animation-name} {
|
||||
@content;
|
||||
}
|
||||
@keyframes #{$animation-name} {
|
||||
@content;
|
||||
}
|
||||
@-webkit-keyframes #{$animation-name} {
|
||||
@content;
|
||||
}
|
||||
@-moz-keyframes #{$animation-name} {
|
||||
@content;
|
||||
}
|
||||
@-o-keyframes #{$animation-name} {
|
||||
@content;
|
||||
}
|
||||
@keyframes #{$animation-name} {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prefix function for browser compatibility
|
||||
*
|
||||
* @param {string} $property - Property name
|
||||
* @param {any} $value - Property value
|
||||
*
|
||||
* @return {string} Prefixed attributes
|
||||
*/
|
||||
* Prefix function for browser compatibility
|
||||
*
|
||||
* @param {string} $property - Property name
|
||||
* @param {any} $value - Property value
|
||||
*
|
||||
* @return {string} Prefixed attributes
|
||||
*/
|
||||
@mixin prefix($property, $value) {
|
||||
-webkit-#{$property}: #{$value};
|
||||
-moz-#{$property}: #{$value};
|
||||
-ms-#{$property}: #{$value};
|
||||
-o-#{$property}: #{$value};
|
||||
#{$property}: #{$value};
|
||||
-webkit-#{$property}: #{$value};
|
||||
-moz-#{$property}: #{$value};
|
||||
-ms-#{$property}: #{$value};
|
||||
-o-#{$property}: #{$value};
|
||||
#{$property}: #{$value};
|
||||
}
|
||||
|
||||
/**
|
||||
* Layout Mixins
|
||||
*/
|
||||
* Layout Mixins
|
||||
*/
|
||||
@mixin from($device) {
|
||||
@media screen and (min-width: $device) {
|
||||
@content;
|
||||
|
@@ -18,11 +18,11 @@ export default {
|
||||
state,
|
||||
mutations: {
|
||||
...make.mutations(state),
|
||||
pushMediaFolderTree: (state, folder) => {
|
||||
state.media.folderTree = state.media.folderTree.concat(folder)
|
||||
pushMediaFolderTree: (st, folder) => {
|
||||
st.media.folderTree = st.media.folderTree.concat(folder)
|
||||
},
|
||||
popMediaFolderTree: (state) => {
|
||||
state.media.folderTree = state.media.folderTree.slice(0, -1)
|
||||
popMediaFolderTree: (st) => {
|
||||
st.media.folderTree = st.media.folderTree.slice(0, -1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -33,24 +33,24 @@ export default new Vuex.Store({
|
||||
},
|
||||
mutations: {
|
||||
...make.mutations(state),
|
||||
loadingStart (state, stackName) {
|
||||
state.loadingStack = _.union(state.loadingStack, [stackName])
|
||||
loadingStart (st, stackName) {
|
||||
st.loadingStack = _.union(st.loadingStack, [stackName])
|
||||
},
|
||||
loadingStop (state, stackName) {
|
||||
state.loadingStack = _.without(state.loadingStack, stackName)
|
||||
loadingStop (st, stackName) {
|
||||
st.loadingStack = _.without(st.loadingStack, stackName)
|
||||
},
|
||||
showNotification (state, opts) {
|
||||
state.notification = _.defaults(opts, {
|
||||
showNotification (st, opts) {
|
||||
st.notification = _.defaults(opts, {
|
||||
message: '',
|
||||
style: 'primary',
|
||||
icon: 'cached',
|
||||
isActive: true
|
||||
})
|
||||
},
|
||||
updateNotificationState (state, newState) {
|
||||
state.notification.isActive = newState
|
||||
updateNotificationState (st, newState) {
|
||||
st.notification.isActive = newState
|
||||
},
|
||||
pushGraphError (state, err) {
|
||||
pushGraphError (st, err) {
|
||||
WIKI.$store.commit('showNotification', {
|
||||
style: 'red',
|
||||
message: _.get(err, 'graphQLErrors[0].message', err.message),
|
||||
|
@@ -20,21 +20,21 @@ export default {
|
||||
state,
|
||||
mutations: {
|
||||
...make.mutations(state),
|
||||
REFRESH_AUTH(state) {
|
||||
REFRESH_AUTH(st) {
|
||||
const jwtCookie = Cookies.get('jwt')
|
||||
if (jwtCookie) {
|
||||
try {
|
||||
const jwtData = jwt.decode(jwtCookie)
|
||||
state.id = jwtData.id
|
||||
state.email = jwtData.email
|
||||
state.name = jwtData.name
|
||||
state.pictureUrl = jwtData.pictureUrl
|
||||
state.localeCode = jwtData.localeCode
|
||||
state.defaultEditor = jwtData.defaultEditor
|
||||
state.permissions = jwtData.permissions
|
||||
state.iat = jwtData.iat
|
||||
state.exp = jwtData.exp
|
||||
state.authenticated = true
|
||||
st.id = jwtData.id
|
||||
st.email = jwtData.email
|
||||
st.name = jwtData.name
|
||||
st.pictureUrl = jwtData.pictureUrl
|
||||
st.localeCode = jwtData.localeCode
|
||||
st.defaultEditor = jwtData.defaultEditor
|
||||
st.permissions = jwtData.permissions
|
||||
st.iat = jwtData.iat
|
||||
st.exp = jwtData.exp
|
||||
st.authenticated = true
|
||||
} catch (err) {
|
||||
console.debug('Invalid JWT. Silent authentication skipped.')
|
||||
}
|
||||
|
@@ -78,21 +78,27 @@
|
||||
color='teal lighten-5'
|
||||
v-for='(tag, idx) in tags'
|
||||
:href='`/t/` + tag.tag'
|
||||
:key='tag.tag'
|
||||
:key='`tag-` + tag.tag'
|
||||
)
|
||||
v-icon(color='teal', left, small) mdi-label
|
||||
v-icon(color='teal', left, small) mdi-tag
|
||||
span.teal--text.text--darken-2 {{tag.title}}
|
||||
v-chip.mr-1(
|
||||
label
|
||||
color='teal lighten-5'
|
||||
:href='`/t/` + tags.map(t => t.tag).join(`/`)'
|
||||
)
|
||||
v-icon(color='teal', size='20') mdi-tag-multiple
|
||||
|
||||
v-card.mb-5
|
||||
.pa-5
|
||||
.overline.indigo--text.d-flex.align-center(:class='$vuetify.theme.dark ? `text--lighten-3` : ``')
|
||||
span {{$t('common:page.lastEditedBy')}}
|
||||
v-spacer
|
||||
v-tooltip(top, v-if='isAuthenticated')
|
||||
template(v-slot:activator='{ on }')
|
||||
v-btn.btn-animate-edit(icon, :href='"/h/" + locale + "/" + path', v-on='on', x-small)
|
||||
v-icon(color='grey', dense) mdi-history
|
||||
span History
|
||||
//- v-spacer
|
||||
//- v-tooltip(top, v-if='isAuthenticated')
|
||||
//- template(v-slot:activator='{ on }')
|
||||
//- v-btn.btn-animate-edit(icon, :href='"/h/" + locale + "/" + path', v-on='on', x-small)
|
||||
//- v-icon(color='grey', dense) mdi-history
|
||||
//- span History
|
||||
.body-2.grey--text(:class='darkMode ? `` : `text--darken-3`') {{ authorName }}
|
||||
.caption.grey--text.text--darken-1 {{ updatedAt | moment('calendar') }}
|
||||
|
||||
|
Reference in New Issue
Block a user