Fix editors insert + Error pages styling

pull/73/head
NGPixel 8 years ago
parent fec3eff3e7
commit 67bd4acdeb

67695
assets/js/bundle.min.js vendored

File diff suppressed because one or more lines are too long

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

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

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

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

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

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

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

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

Loading…
Cancel
Save