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
f7ce81e8
Commit
f7ce81e8
authored
Dec 03, 2016
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Editor - Codeblock UI
parent
f7ba9ad1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
75 additions
and
30 deletions
+75
-30
app.css
assets/css/app.css
+0
-0
app.js
assets/js/app.js
+0
-0
editor-codeblock.js
client/js/components/editor-codeblock.js
+12
-1
editor-image.js
client/js/components/editor-image.js
+2
-2
editor.js
client/js/components/editor.js
+1
-4
_editor.scss
client/scss/components/_editor.scss
+34
-1
editor-codeblock.pug
views/modals/editor-codeblock.pug
+22
-20
editor-image.pug
views/modals/editor-image.pug
+4
-2
No files found.
assets/css/app.css
View file @
f7ce81e8
This source diff could not be displayed because it is too large. You can
view the blob
instead.
assets/js/app.js
View file @
f7ce81e8
This diff is collapsed.
Click to expand it.
client/js/components/editor-codeblock.js
View file @
f7ce81e8
...
...
@@ -44,9 +44,20 @@ let vueCodeBlock = new Vue({
}
},
methods
:
{
open
:
(
ev
)
=>
{
$
(
'#modal-editor-codeblock'
).
addClass
(
'is-active'
);
_
.
delay
(()
=>
{
codeEditor
.
resize
();
codeEditor
.
focus
();
codeEditor
.
setAutoScrollEditorIntoView
(
true
);
codeEditor
.
renderer
.
updateFull
();
},
1000
);
},
cancel
:
(
ev
)
=>
{
mdeModalOpenState
=
false
;
$
(
'#modal-editor-codeblock'
).
slideUp
(
);
$
(
'#modal-editor-codeblock'
).
removeClass
(
'is-active'
);
},
insertCode
:
(
ev
)
=>
{
...
...
client/js/components/editor-image.js
View file @
f7ce81e8
...
...
@@ -27,12 +27,12 @@ let vueImage = new Vue({
open
:
()
=>
{
mdeModalOpenState
=
true
;
$
(
'#modal-editor-image'
).
slideDown
(
);
$
(
'#modal-editor-image'
).
addClass
(
'is-active'
);
vueImage
.
refreshFolders
();
},
cancel
:
(
ev
)
=>
{
mdeModalOpenState
=
false
;
$
(
'#modal-editor-image'
).
slideUp
(
);
$
(
'#modal-editor-image'
).
removeClass
(
'is-active'
);
},
// -------------------------------------------
...
...
client/js/components/editor.js
View file @
f7ce81e8
...
...
@@ -138,10 +138,7 @@ if($('#mk-editor').length === 1) {
codeEditor
.
setValue
(
''
);
}
$
(
'#modal-editor-codeblock'
).
slideDown
(
400
,
()
=>
{
codeEditor
.
resize
();
codeEditor
.
focus
();
});
vueCodeBlock
.
open
();
}
},
...
...
client/scss/components/_editor.scss
View file @
f7ce81e8
...
...
@@ -102,6 +102,20 @@
overflow
:
auto
;
overflow-x
:
hidden
;
>
em
{
display
:
flex
;
align-items
:
center
;
padding
:
25px
;
color
:
mc
(
'grey'
,
'500'
);
>
i
{
font-size
:
32px
;
margin-right
:
10px
;
color
:
mc
(
'grey'
,
'300'
);
}
}
>
figure
{
display
:
flex
;
flex-direction
:
column
;
...
...
@@ -235,12 +249,31 @@
position
:
relative
;
}
.ace_scroller
{
width
:
100%
;
}
.ace_content
{
height
:
100%
;
}
#page-type-source
.ace-container
{
min-height
:
95vh
;
}
#modal-editor-codeblock
.ace-container
{
height
:
400px
;
display
:
flex
;
align-items
:
stretch
;
padding
:
0
;
position
:
relative
;
width
:
100%
;
height
:
100%
;
#codeblock-editor
{
width
:
100%
;
height
:
100%
;
min-height
:
500px
;
}
}
#source-display
,
#codeblock-editor
{
...
...
views/modals/editor-codeblock.pug
View file @
f7ce81e8
.modallayer#modal-editor-codeblock
.modallayer-content
.columns
.column
h3 Code Block
.column.is-narrow
p.control
span.select
select(style={width: '300px'}, v-model='modeSelected')
option(v-for="mode in modes" v-bind:value='mode.name') {{ mode.caption }}
.column.is-narrow
.control.is-grouped
p.control
a.button.is-warning.is-outlined(v-on:click="cancel") Cancel
p.control
a.button.is-primary.is-outlined(v-on:click="insertCode") Insert Code Block
.modal#modal-editor-codeblock
.modal-background
.modal-container
.modal-content.is-expanded
header.is-green
span Insert Code Block
.ace-container(style={'border-radius':'5px'})
#codeblock-editor
\ No newline at end of file
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
\ No newline at end of file
views/modals/editor-image.pug
View file @
f7ce81e8
...
...
@@ -29,7 +29,7 @@
li(v-for="fld in folders")
a(v-on:click="selectFolder(fld)", v-bind:class="{ 'is-active': currentFolder === fld }")
i.icon-folder2
span /{{ fld }}
span /
{{ fld }}
.model-sidebar-header Alignment
.model-sidebar-content
p.control.is-fullwidth
...
...
@@ -43,7 +43,9 @@
img(v-bind:src="'/uploads/t/' + img._id + '.png'")
span: strong {{ img.basename }}
span {{ img.filesize | filesize }}
em(v-show="images.length < 1") This folder is empty.
em(v-show="images.length < 1")
i.icon-marquee-minus
| This folder is empty.
footer
a.button.is-grey.is-outlined(v-on:click="cancel") Discard
a.button.is-green(v-on:click="insertImage") Insert Image
...
...
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