mirror of https://github.com/Requarks/wiki.git
NGPixel
7 years ago
10 changed files with 338 additions and 178 deletions
Unified View
Diff Options
-
3.gitignore
-
3.vscode/settings.json
-
59client/js/app.js
-
51client/js/components/editor-codeblock.vue
-
345client/js/components/editor.component.js
-
17client/js/helpers/pages.js
-
2client/js/store/index.js
-
4client/js/store/modules/alert.js
-
16client/js/store/modules/editor-codeblock.js
-
16fuse.js
@ -0,0 +1,51 @@ |
|||||
|
<template lang="pug"> |
||||
|
transition(:duration="400") |
||||
|
.modal(v-show='isShown', v-cloak) |
||||
|
transition(name='modal-background') |
||||
|
.modal-background(v-show='isShown') |
||||
|
.modal-container |
||||
|
transition(name='modal-content') |
||||
|
.modal-content.is-expanded(v-show='isShown') |
||||
|
header.is-green |
||||
|
span Insert Code Block |
||||
|
section.is-gapless |
||||
|
.columns.is-stretched |
||||
|
.column.is-one-quarter.modal-sidebar.is-green(style={'max-width':'350px'}) |
||||
|
.model-sidebar-header Language |
||||
|
.model-sidebar-content |
||||
|
p.control.is-fullwidth |
||||
|
select(v-model='modeSelected') |
||||
|
option(v-for='mode in modes', v-bind:value='mode.name') {{ mode.caption }} |
||||
|
.column.ace-container |
||||
|
#codeblock-editor |
||||
|
footer |
||||
|
a.button.is-grey.is-outlined(v-on:click='cancel') Discard |
||||
|
a.button.is-green(v-on:click='insertCode') Insert Code Block |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
name: 'editor-codeblock', |
||||
|
data () { |
||||
|
return {} |
||||
|
}, |
||||
|
computed: { |
||||
|
isShown () { |
||||
|
return this.$store.state.editorCodeblock.shown |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
cancel () { |
||||
|
this.$store.dispatch('editorCodeBlock/close') |
||||
|
}, |
||||
|
insertCode () { |
||||
|
this.$store.dispatch('alert', { |
||||
|
style: 'pink', |
||||
|
icon: 'inbox', |
||||
|
msg: 'Your code block has been inserted.' |
||||
|
}) |
||||
|
this.cancel() |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
@ -0,0 +1,16 @@ |
|||||
|
'use strict' |
||||
|
|
||||
|
export default { |
||||
|
namespaced: true, |
||||
|
state: { |
||||
|
shown: false |
||||
|
}, |
||||
|
getters: {}, |
||||
|
mutations: { |
||||
|
shownChange: (state, shownState) => { state.shown = shownState } |
||||
|
}, |
||||
|
actions: { |
||||
|
open({ commit }) { commit('shownChange', true) }, |
||||
|
close({ commit }) { commit('shownChange', false) } |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save