Fix editors insert + Error pages styling

This commit is contained in:
NGPixel 2017-04-02 19:36:43 -04:00
parent fec3eff3e7
commit 67bd4acdeb
9 changed files with 67728 additions and 32 deletions

67695
assets/js/bundle.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,9 @@
let logic = document.documentElement.dataset.logic
switch (logic) {
case 'error':
require('./scss/error.scss')
break
case 'login':
require('./scss/login.scss')
require('./js/login.js')

View File

@ -54,7 +54,7 @@ $(() => {
// ====================================
require('./pages/view.js')(alerts)
// require('./pages/create.js')
require('./pages/create.js')(alerts, socket)
require('./pages/edit.js')(alerts, socket)
require('./pages/source.js')(alerts)
require('./pages/admin.js')(alerts)

View File

@ -51,6 +51,7 @@ module.exports = (alerts, mde, mdeModalOpenState, socket) => {
vueImage.currentImage = imageId
},
insertImage: (ev) => {
console.log(mde)
if (mde.codemirror.doc.somethingSelected()) {
mde.codemirror.execCommand('singleSelection')
}

View File

@ -16,14 +16,13 @@ module.exports = (alerts, pageEntryPath, socket) => {
return _.toUpper(filesize(v))
})
let mde
let mdeModalOpenState = false
let vueImage = require('./editor-image.js')(alerts, mde, mdeModalOpenState, socket)
let vueFile = require('./editor-file.js')(alerts, mde, mdeModalOpenState, socket)
let vueVideo = require('./editor-video.js')(mde, mdeModalOpenState)
let vueCodeBlock = require('./editor-codeblock.js')(mde, mdeModalOpenState)
let vueImage
let vueFile
let vueVideo
let vueCodeBlock
mde = new SimpleMDE({
let mde = new SimpleMDE({
autofocus: true,
autoDownloadFontAwesome: false,
element: $('#mk-editor').get(0),
@ -185,6 +184,11 @@ module.exports = (alerts, pageEntryPath, socket) => {
}
})
vueImage = require('./editor-image.js')(alerts, mde, mdeModalOpenState, socket)
vueFile = require('./editor-file.js')(alerts, mde, mdeModalOpenState, socket)
vueVideo = require('./editor-video.js')(mde, mdeModalOpenState)
vueCodeBlock = require('./editor-codeblock.js')(mde, mdeModalOpenState)
// -> Save
let saveCurrentDocument = (ev) => {

View File

@ -1,15 +1,17 @@
/* global $ */
'use strict'
if ($('#page-type-create').length) {
let pageEntryPath = $('#page-type-create').data('entrypath') // eslint-disable-line no-unused-vars
import $ from 'jquery'
// -> Discard
module.exports = (alerts, socket) => {
if ($('#page-type-create').length) {
let pageEntryPath = $('#page-type-create').data('entrypath')
$('.btn-create-discard').on('click', (ev) => {
$('#modal-create-discard').toggleClass('is-active')
})
// -> Discard
/* eslint-disable spaced-comment */
//=include ../components/editor.js
/* eslint-enable spaced-comment */
$('.btn-create-discard').on('click', (ev) => {
$('#modal-create-discard').toggleClass('is-active')
})
require('../components/editor.js')(alerts, pageEntryPath, socket)
}
}

View File

@ -1,5 +1,5 @@
doctype html
html
html(data-logic='error')
head
meta(http-equiv='X-UA-Compatible', content='IE=edge')
meta(charset='UTF-8')
@ -17,9 +17,8 @@ html
link(rel='icon', type='image/png', sizes=favsize + 'x' + favsize, href='/favicons/favicon-' + favsize + 'x' + favsize + '.png')
link(rel='manifest', href='/manifest.json')
// CSS
link(type='text/css', rel='stylesheet', href='/css/libs.css')
link(type='text/css', rel='stylesheet', href='/css/error.css')
// JS / CSS
script(type='text/javascript', src='/js/bundle.min.js')
body(class='is-forbidden')
.container

View File

@ -1,5 +1,5 @@
doctype html
html
html(data-logic='error')
head
meta(http-equiv='X-UA-Compatible', content='IE=edge')
meta(charset='UTF-8')
@ -17,9 +17,8 @@ html
link(rel='icon', type='image/png', sizes=favsize + 'x' + favsize, href='/favicons/favicon-' + favsize + 'x' + favsize + '.png')
link(rel='manifest', href='/manifest.json')
// CSS
link(type='text/css', rel='stylesheet', href='/css/libs.css')
link(type='text/css', rel='stylesheet', href='/css/error.css')
// JS / CSS
script(type='text/javascript', src='/js/bundle.min.js')
body(class='is-notexist')
.container

View File

@ -1,5 +1,5 @@
doctype html
html
html(data-logic='error')
head
meta(http-equiv='X-UA-Compatible', content='IE=edge')
meta(charset='UTF-8')
@ -17,9 +17,8 @@ html
link(rel='icon', type='image/png', sizes=favsize + 'x' + favsize, href='/favicons/favicon-' + favsize + 'x' + favsize + '.png')
link(rel='manifest', href='/manifest.json')
// CSS
link(type='text/css', rel='stylesheet', href='/css/libs.css')
link(type='text/css', rel='stylesheet', href='/css/error.css')
// JS / CSS
script(type='text/javascript', src='/js/bundle.min.js')
body(class='is-error')
.container