css lint
This commit is contained in:
parent
537fe27f2e
commit
3c0383d500
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
$(document).ready(function(){$(document).pjax("a","#main")}),$(document).on("ready pjax:success",function(){$(".scroll").perfectScrollbar(),$("#logout").click(function(a){return a.preventDefault(),$.ajax({type:"GET",url:"/admin",async:!1,username:"username",password:"password",headers:{Authorization:"Basic xxx"}}).fail(function(){window.location="/"}),!1}),$(".editor")[0]&&(editor=!1,preview=$("#preview-area"),textarea=$("#content-area"),textarea[0]&&(options={mode:textarea.data("mode"),theme:"mdn-like",lineWrapping:!0,lineNumbers:!0,scrollbarStyle:null},"markdown"==textarea.data("mode")&&(options.lineNumbers=!1),editor=CodeMirror.fromTextArea(textarea[0],options),codemirror=$(".CodeMirror"),$("#preview").click(function(a){if(a.preventDefault(),"true"==$(this).data("previewing"))preview.hide(),codemirror.fadeIn(),$(this).data("previewing","false"),notification({text:"Think, relax and do the better you can!",type:"information",timeout:2e3});else{editor.save();var b=new showdown.Converter,c=textarea.val(),d=b.makeHtml(c);codemirror.hide(),preview.html(d).fadeIn(),$(this).data("previewing","true"),notification({text:"This is how your post looks like.",type:"information",timeout:2e3})}return!1})),$("form").submit(function(a){a.preventDefault();var b=JSON.stringify($(this).serializeJSON()),c=$(this).find("input[type=submit]:focus");$.ajax({type:"POST",url:window.location,data:b,headers:{"X-Regenerate":c.data("regenerate"),"X-Content-Type":c.data("type")},dataType:"json",encode:!0}).done(function(a){notification({text:c.data("message"),type:"success",timeout:5e3})}).fail(function(a){notification({text:"Something went wrong.",type:"error"}),console.log(a)})}),$(".add").click(function(a){return a.preventDefault(),$("#new").length?!1:(title=$(this).parent().parent(),fieldset=title.parent(),type=fieldset.data("type"),name=fieldset.data("name"),title.is("h1")&&(fieldset=$(".sidebar .content"),fieldset.prepend('<div id="ghost"></div>'),title=$("#ghost"),type="object"),"object"==type&&(title.after('<input id="new" placeholder="Write the field name and press enter..."></input>'),element=$("#new"),$(element).keypress(function(a){return 13==a.which?(a.preventDefault(),value=element.val(),element.remove(),""==value?!1:("undefined"==name?name=value:name=name+"["+value+"]",title.after('<input name="'+name+':auto" id="'+name+'"></input><br>'),title.after('<label for="'+name+'">'+value+' <span class="actions"><button class="delete"><i class="fa fa-minus"></i></button></span></label>'),!1)):void 0})),"array"==type&&(name+="[]",title.after('<input name="'+name+':auto" id="'+name+'"></input><br>')),!1)}),$(".delete").click(function(a){a.preventDefault(),name=$(this).parent().parent().attr("for")||$(this).parent().parent().parent().attr("id"),console.log(name),$("#"+name).fadeOut().remove(),$('label[for="'+name+'"]').fadeOut().remove()}),$("body").on("keypress","input",function(a){return 13==a.keyCode?(a.preventDefault(),$('input[value="Save"]').focus().click(),!1):void 0}))}),$(document).on("pjax:send",function(){$("#loading").fadeIn()}),$(document).on("pjax:complete",function(){$("#loading").fadeOut()}),$.noty.themes.admin={name:"admin",helpers:{},modal:{css:{position:"fixed",width:"100%",height:"100%",backgroundColor:"#000",zIndex:1e4,opacity:.6,display:"none",left:0,top:0}}},$.noty.defaults={layout:"topRight",theme:"admin",dismissQueue:!0,animation:{open:"animated bounceInRight",close:"animated fadeOut",easing:"swing",speed:500},timeout:!1,force:!1,modal:!1,maxVisible:5,killer:!1,closeWith:["click"],callback:{onShow:function(){},afterShow:function(){},onClose:function(){},afterClose:function(){},onCloseClick:function(){}},buttons:!1},notification=function(a){var b;switch(a.type){case"success":b='<i class="fa fa-check"></i>';break;case"error":b='<i class="fa fa-times"></i>';break;case"warning":b='<i class="fa fa-exclamation"></i>';break;case"information":b='<i class="fa fa-info"></i>';break;default:b='<i class="fa fa-bell"></i>'}var c={template:'<div class="noty_message"><span class="noty_icon">'+b+'</span><span class="noty_text"></span></div>'};a=$.extend({},c,a),noty(a)};
|
$(document).ready(function(){$(document).pjax("a","#content")}),$(document).on("ready pjax:success",function(){$(".scroll").perfectScrollbar(),$("#logout").click(function(a){return a.preventDefault(),$.ajax({type:"GET",url:"/admin",async:!1,username:"username",password:"password",headers:{Authorization:"Basic xxx"}}).fail(function(){window.location="/"}),!1}),$(".editor")[0]&&(editor=!1,preview=$("#preview-area"),textarea=$("#content-area"),textarea[0]&&(options={mode:textarea.data("mode"),theme:"mdn-like",lineWrapping:!0,lineNumbers:!0,scrollbarStyle:null},"markdown"==textarea.data("mode")&&(options.lineNumbers=!1),editor=CodeMirror.fromTextArea(textarea[0],options),codemirror=$(".CodeMirror"),$("#preview").click(function(a){if(a.preventDefault(),"true"==$(this).data("previewing"))preview.hide(),codemirror.fadeIn(),$(this).data("previewing","false"),notification({text:"Think, relax and do the better you can!",type:"information",timeout:2e3});else{editor.save();var b=new showdown.Converter,c=textarea.val(),d=b.makeHtml(c);codemirror.hide(),preview.html(d).fadeIn(),$(this).data("previewing","true"),notification({text:"This is how your post looks like.",type:"information",timeout:2e3})}return!1})),$("form").submit(function(a){a.preventDefault();var b=JSON.stringify($(this).serializeJSON()),c=$(this).find("input[type=submit]:focus");$.ajax({type:"POST",url:window.location,data:b,headers:{"X-Regenerate":c.data("regenerate"),"X-Content-Type":c.data("type")},dataType:"json",encode:!0}).done(function(a){notification({text:c.data("message"),type:"success",timeout:5e3})}).fail(function(a){notification({text:"Something went wrong.",type:"error"}),console.log(a)})}),$(".add").click(function(a){return a.preventDefault(),$("#new").length?!1:(title=$(this).parent().parent(),fieldset=title.parent(),type=fieldset.data("type"),name=fieldset.data("name"),title.is("h1")&&(fieldset=$(".sidebar .content"),fieldset.prepend('<div id="ghost"></div>'),title=$("#ghost"),type="object"),"object"==type&&(title.after('<input id="new" placeholder="Write the field name and press enter..."></input>'),element=$("#new"),$(element).keypress(function(a){return 13==a.which?(a.preventDefault(),value=element.val(),element.remove(),""==value?!1:("undefined"==name?name=value:name=name+"["+value+"]",title.after('<input name="'+name+':auto" id="'+name+'"></input><br>'),title.after('<label for="'+name+'">'+value+' <span class="actions"><button class="delete"><i class="fa fa-minus"></i></button></span></label>'),!1)):void 0})),"array"==type&&(name+="[]",title.after('<input name="'+name+':auto" id="'+name+'"></input><br>')),!1)}),$(".delete").click(function(a){a.preventDefault(),name=$(this).parent().parent().attr("for")||$(this).parent().parent().parent().attr("id"),console.log(name),$("#"+name).fadeOut().remove(),$('label[for="'+name+'"]').fadeOut().remove()}),$("body").on("keypress","input",function(a){return 13==a.keyCode?(a.preventDefault(),$('input[value="Save"]').focus().click(),!1):void 0}))}),$(document).on("pjax:send",function(){$("#loading").fadeIn()}),$(document).on("pjax:complete",function(){$("#loading").fadeOut()}),$.noty.themes.admin={name:"admin",helpers:{},modal:{css:{position:"fixed",width:"100%",height:"100%",backgroundColor:"#000",zIndex:1e4,opacity:.6,display:"none",left:0,top:0}}},$.noty.defaults={layout:"topRight",theme:"admin",dismissQueue:!0,animation:{open:"animated bounceInRight",close:"animated fadeOut",easing:"swing",speed:500},timeout:!1,force:!1,modal:!1,maxVisible:5,killer:!1,closeWith:["click"],callback:{onShow:function(){},afterShow:function(){},onClose:function(){},afterClose:function(){},onCloseClick:function(){}},buttons:!1},notification=function(a){var b;switch(a.type){case"success":b='<i class="fa fa-check"></i>';break;case"error":b='<i class="fa fa-times"></i>';break;case"warning":b='<i class="fa fa-exclamation"></i>';break;case"information":b='<i class="fa fa-info"></i>';break;default:b='<i class="fa fa-bell"></i>'}var c={template:'<div class="noty_message"><span class="noty_icon">'+b+'</span><span class="noty_text"></span></div>'};a=$.extend({},c,a),noty(a)};
|
|
@ -1,5 +1,5 @@
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(document).pjax('a', '#main');
|
$(document).pjax('a', '#content');
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('ready pjax:success', function() {
|
$(document).on('ready pjax:success', function() {
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
.browse a {
|
||||||
|
color : inherit;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.browse table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.browse .actions {
|
||||||
|
background-color: #455a64;
|
||||||
|
color : #fff;
|
||||||
|
padding : 1.5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.browse .actions .container {
|
||||||
|
margin : 0 auto;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.browse .actions .fa {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.browse .actions .go-right {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.browse tr {
|
||||||
|
line-height : 2em;
|
||||||
|
border-bottom: 1px solid rgba(0,0,0,0.03);
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
/* EDITOR GENERAL STYLES */
|
/* EDITOR GENERAL STYLES */
|
||||||
.editor .sidebar {
|
.editor .frontmatter {
|
||||||
overflow-y : auto;
|
overflow-y : auto;
|
||||||
overflow-x : hidden;
|
overflow-x : hidden;
|
||||||
color : #37474f;
|
color : #37474f;
|
||||||
|
@ -7,27 +7,16 @@
|
||||||
background-color: #ddd;
|
background-color: #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor .container {
|
.editor .frontmatter h2 {
|
||||||
overflow : hidden;
|
|
||||||
width : 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.full .container {
|
|
||||||
position: fixed;
|
|
||||||
top : 3em;
|
|
||||||
right : 0;
|
|
||||||
width : 75%;
|
|
||||||
height : calc(100% - 6em);
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor .sidebar h2 {
|
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editor #content-area {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.editor #preview-area,
|
.editor #preview-area,
|
||||||
.editor textarea,
|
.editor .CodeMirror {
|
||||||
.CodeMirror {
|
|
||||||
position : relative;
|
position : relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height : 100%;
|
height : 100%;
|
||||||
|
@ -37,40 +26,16 @@
|
||||||
font-size : 1.05em;
|
font-size : 1.05em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror {
|
.editor .CodeMirror {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cm-s-mdn-like.CodeMirror {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor #preview-area *:first-child {
|
.editor #preview-area *:first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor textarea {
|
.editor .cm-s-mdn-like.CodeMirror {
|
||||||
resize : none;
|
background: none;
|
||||||
font-family: monospace;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor textarea:focus {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor input {
|
|
||||||
width : 100%;
|
|
||||||
background-color: rgba(0, 0, 0, 0.25);
|
|
||||||
color : rgba(255, 255, 255, 0.3);
|
|
||||||
border : 0;
|
|
||||||
border-radius : 5px;
|
|
||||||
padding : .5em 1em;
|
|
||||||
box-sizing : border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editor input:focus {
|
|
||||||
color : rgba(255, 255, 255, 0.7);
|
|
||||||
border: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor h3 {
|
.editor h3 {
|
||||||
|
@ -79,7 +44,7 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-bar {
|
.toolbar {
|
||||||
position : fixed;
|
position : fixed;
|
||||||
bottom : 0;
|
bottom : 0;
|
||||||
right : 0;
|
right : 0;
|
||||||
|
@ -92,11 +57,11 @@
|
||||||
z-index : 999;
|
z-index : 999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-bar .left {
|
.toolbar .left {
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-bar *:last-child {
|
.toolbar *:last-child {
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +71,7 @@
|
||||||
height: calc(100% - 6em);
|
height: calc(100% - 6em);
|
||||||
}
|
}
|
||||||
|
|
||||||
.frontmatter-only .sidebar {
|
.frontmatter-only .frontmatter {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,8 +88,8 @@
|
||||||
color: #555;
|
color: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
.frontmatter-only .action-bar input,
|
.frontmatter-only .toolbar input,
|
||||||
.frontmatter-only .action-bar input:focus {
|
.frontmatter-only .toolbar input:focus {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,13 +115,13 @@ input:-ms-input-placeholder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EDITOR CONTENT ONLY STYLES */
|
/* EDITOR CONTENT ONLY STYLES */
|
||||||
.content-only #content-area,
|
.editor.content-only #content-area,
|
||||||
.content-only #preview-area {
|
.editor.content-only #preview-area {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* EDITOR FULL STYLES */
|
/* EDITOR FULL STYLES */
|
||||||
.full .sidebar {
|
.editor.complete .frontmatter {
|
||||||
position : fixed;
|
position : fixed;
|
||||||
left : 0;
|
left : 0;
|
||||||
top : 3em;
|
top : 3em;
|
||||||
|
@ -167,12 +132,22 @@ input:-ms-input-placeholder {
|
||||||
height : calc(100% - 3em);
|
height : calc(100% - 3em);
|
||||||
}
|
}
|
||||||
|
|
||||||
.full .action-bar {
|
.editor.complete .container {
|
||||||
|
position : fixed;
|
||||||
|
top : 3em;
|
||||||
|
right : 0;
|
||||||
|
width : 75%;
|
||||||
|
max-width: none;
|
||||||
|
height : calc(100% - 6em);
|
||||||
|
margin : 1.5em auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editor.complete .toolbar {
|
||||||
width: 75%;
|
width: 75%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.full .cm-s-mdn-like.CodeMirror {
|
.editor.complete .cm-s-mdn-like.CodeMirror {
|
||||||
width : auto;
|
width : auto;
|
||||||
margin: 3em 10%;
|
margin: 0 10%;
|
||||||
height: calc(100% - 6em);
|
height: calc(100% - 3em);
|
||||||
}
|
}
|
|
@ -1,18 +1,21 @@
|
||||||
/* FORMS ELEMENTS */
|
/* FORMS ELEMENTS */
|
||||||
form input {
|
form input {
|
||||||
color : rgba(0, 0, 0, 0.41);
|
width : 100%;
|
||||||
width : 15em;
|
background-color: rgba(0, 0, 0, 0.25);
|
||||||
line-height : 1.25em;
|
color : rgba(255, 255, 255, 0.3);
|
||||||
|
border : 0;
|
||||||
|
border-radius : 5px;
|
||||||
|
padding : .5em 1em;
|
||||||
|
box-sizing : border-box;
|
||||||
margin : .5em 0;
|
margin : .5em 0;
|
||||||
border : 1px solid #fff;
|
line-height : 1.25em;
|
||||||
transition : .5s ease-out all;
|
transition : .5s ease-out all;
|
||||||
background-color: transparent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
form input:focus {
|
form input:focus {
|
||||||
color : inherit;
|
color : rgba(255, 255, 255, 0.7);
|
||||||
outline : 0;
|
border : 0;
|
||||||
border-bottom: 1px solid #2196f3;
|
outline: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
form label {
|
form label {
|
||||||
|
@ -28,10 +31,6 @@ form fieldset {
|
||||||
border-top: 1px solid rgba(255, 255, 255, 0.25);
|
border-top: 1px solid rgba(255, 255, 255, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
form legend {
|
|
||||||
font-size: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
input[type="file"] {
|
input[type="file"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
nav {
|
||||||
|
position : fixed;
|
||||||
|
top : 0;
|
||||||
|
left : 0;
|
||||||
|
height : 3em;
|
||||||
|
width : 100%;
|
||||||
|
background-color: #263238;
|
||||||
|
padding : 0 1em;
|
||||||
|
box-sizing : border-box;
|
||||||
|
z-index : 999;
|
||||||
|
color : #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul {
|
||||||
|
margin : 0;
|
||||||
|
padding: 0;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -moz-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul li {
|
||||||
|
list-style-type: none;
|
||||||
|
display : inline-block;
|
||||||
|
vertical-align : middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul li:last-child {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav img {
|
||||||
|
height: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul li a {
|
||||||
|
padding : .5em;
|
||||||
|
line-height : 2em;
|
||||||
|
display : block;
|
||||||
|
text-decoration: none;
|
||||||
|
color : inherit;
|
||||||
|
transition : .5s ease background-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav ul li a:hover {
|
||||||
|
background-color: rgba(255, 255, 255, 0.57);
|
||||||
|
}
|
|
@ -1,69 +1,20 @@
|
||||||
|
@import "navigation";
|
||||||
|
@import "scrollbar";
|
||||||
|
@import "notifications";
|
||||||
|
@import "animations";
|
||||||
|
@import 'editor';
|
||||||
|
@import 'forms';
|
||||||
|
@import "browse";
|
||||||
|
|
||||||
body {
|
body {
|
||||||
font-family: 'Roboto', sans-serif;
|
font-family : 'Roboto', sans-serif;
|
||||||
color : #212121;
|
color : #212121;
|
||||||
height : 100%;
|
background-color: #ddd;
|
||||||
width : 100%;
|
height : 100%;
|
||||||
}
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
margin: .83em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav {
|
|
||||||
position : fixed;
|
|
||||||
top : 0;
|
|
||||||
left : 0;
|
|
||||||
height : 3em;
|
|
||||||
width : 100%;
|
width : 100%;
|
||||||
background-color: #263238;
|
|
||||||
padding : 0 1em;
|
|
||||||
box-sizing : border-box;
|
|
||||||
z-index : 999;
|
|
||||||
color : #eee;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nav ul {
|
#content {
|
||||||
margin : 0;
|
|
||||||
padding: 0;
|
|
||||||
display: -webkit-box;
|
|
||||||
/* OLD - iOS 6-, Safari 3.1-6 */
|
|
||||||
display: -moz-box;
|
|
||||||
/* OLD - Firefox 19- (buggy but mostly works) */
|
|
||||||
display: -ms-flexbox;
|
|
||||||
/* TWEENER - IE 10 */
|
|
||||||
display: -webkit-flex;
|
|
||||||
/* NEW - Chrome */
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav ul li {
|
|
||||||
list-style-type: none;
|
|
||||||
display : inline-block;
|
|
||||||
vertical-align : middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav ul li:last-child {
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav img {
|
|
||||||
height: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav ul li a {
|
|
||||||
padding : .5em;
|
|
||||||
line-height : 2em;
|
|
||||||
display : block;
|
|
||||||
text-decoration: none;
|
|
||||||
color : inherit;
|
|
||||||
transition : .5s ease background-color;
|
|
||||||
}
|
|
||||||
|
|
||||||
nav ul li a:hover {
|
|
||||||
background-color: rgba(255, 255, 255, 0.57);
|
|
||||||
}
|
|
||||||
|
|
||||||
.box {
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top : 3em;
|
top : 3em;
|
||||||
left : 0;
|
left : 0;
|
||||||
|
@ -72,6 +23,16 @@ nav ul li a:hover {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.full {
|
||||||
|
position: fixed;
|
||||||
|
height : calc(100% - 3em);
|
||||||
|
width : 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
margin: .83em 0;
|
||||||
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
color : #fff;
|
color : #fff;
|
||||||
background-color: #37474f;
|
background-color: #37474f;
|
||||||
|
@ -82,27 +43,7 @@ header h1 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
.container {
|
||||||
background-color: #ddd;
|
|
||||||
padding : 1.5em 0;
|
|
||||||
text-align : center;
|
|
||||||
color : rgba(0,0,0,0.5);
|
|
||||||
}
|
|
||||||
|
|
||||||
footer a {
|
|
||||||
text-decoration: none;
|
|
||||||
color : inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer p {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
main {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
margin : 1.5em auto;
|
margin : 1.5em auto;
|
||||||
width : 80%;
|
width : 80%;
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
|
@ -111,10 +52,7 @@ main {
|
||||||
.hidden {
|
.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@import 'editor';
|
|
||||||
@import 'forms';
|
|
||||||
|
|
||||||
/* BROWSE */
|
|
||||||
.left {
|
.left {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
@ -122,39 +60,3 @@ main {
|
||||||
.right {
|
.right {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.browse a {
|
|
||||||
color : inherit;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.browse table {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.browse .actions {
|
|
||||||
background-color: #455a64;
|
|
||||||
color : #fff;
|
|
||||||
padding : 1.5em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions .content {
|
|
||||||
margin : 0 auto;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions .fa {
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.actions .go-right {
|
|
||||||
margin-left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.browse tr {
|
|
||||||
line-height : 2em;
|
|
||||||
border-bottom: 1px solid rgba(0,0,0,0.03);
|
|
||||||
}
|
|
||||||
@import "scrollbar";
|
|
||||||
@import "notifications";
|
|
||||||
@import "animations";
|
|
|
@ -110,7 +110,7 @@ func post(w http.ResponseWriter, r *http.Request, filename string) (int, error)
|
||||||
mainContent = "\n\n" + strings.TrimSpace(mainContent)
|
mainContent = "\n\n" + strings.TrimSpace(mainContent)
|
||||||
|
|
||||||
file = []byte(mainContent)
|
file = []byte(mainContent)
|
||||||
case "full":
|
case "complete":
|
||||||
// The main content of the file
|
// The main content of the file
|
||||||
mainContent := rawFile["content"].(string)
|
mainContent := rawFile["content"].(string)
|
||||||
mainContent = "\n\n" + strings.TrimSpace(mainContent)
|
mainContent = "\n\n" + strings.TrimSpace(mainContent)
|
||||||
|
@ -195,7 +195,7 @@ func get(w http.ResponseWriter, r *http.Request, filename string) (int, error) {
|
||||||
// Parses the page content and the frontmatter
|
// Parses the page content and the frontmatter
|
||||||
page.Content = strings.TrimSpace(string(file.Content()))
|
page.Content = strings.TrimSpace(string(file.Content()))
|
||||||
page.FrontMatter, err = frontmatter.Pretty(file.FrontMatter())
|
page.FrontMatter, err = frontmatter.Pretty(file.FrontMatter())
|
||||||
page.Class = "full"
|
page.Class = "complete"
|
||||||
} else {
|
} else {
|
||||||
// The editor will handle only content
|
// The editor will handle only content
|
||||||
page.Class = "content-only"
|
page.Class = "content-only"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html class="no-js" lang="en">
|
<html class="no-js" lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
@ -23,15 +24,16 @@
|
||||||
<li><a id="logout" href="#logout"><i class="fa fa-sign-out"></i> Logout</a></li>
|
<li><a id="logout" href="#logout"><i class="fa fa-sign-out"></i> Logout</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<div id="main">
|
<div id="content">
|
||||||
{{ template "content" . }}
|
{{ template "content" . }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="loading">
|
<div id="loading">
|
||||||
<div class="double-bounce">
|
<div class="double-bounce">
|
||||||
<div class="child double-bounce1"></div>
|
<div class="child double-bounce1"></div>
|
||||||
<div class="child double-bounce2"></div>
|
<div class="child double-bounce2"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,71 +1,61 @@
|
||||||
{{ define "content" }}{{ $path := .Path }}
|
{{ define "content" }}{{ $path := .Path }}
|
||||||
|
|
||||||
<div class="box scroll">
|
<div class="full scroll">
|
||||||
<header>
|
<header>
|
||||||
<div class="content">
|
<div class="container">
|
||||||
<h1>{{ $path }}</h1>
|
<h1>{{ $path }}</h1>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="browse">
|
<main class="browse">
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<div class="content">
|
<div class="container">
|
||||||
{{if .CanGoUp}}<a href=".." class="up" title="Up one level"><i class="fa fa-arrow-left fa-lg"></i></a>{{end}}
|
{{if .CanGoUp}}<a href=".." class="up" title="Up one level"><i class="fa fa-arrow-left fa-lg"></i></a>{{end}}
|
||||||
<div class="go-right"><input type="file" value="Upload">
|
<div class="go-right">
|
||||||
<button id="upload">Upload <i class="fa fa-cloud-upload"></i></button>
|
<input type="file" value="Upload">
|
||||||
<button class="default">New <i class="fa fa-plus"></i></button></div>
|
<button id="upload">Upload <i class="fa fa-cloud-upload"></i></button>
|
||||||
</div>
|
<button class="default">New <i class="fa fa-plus"></i></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="container">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="left">
|
<th class="left">
|
||||||
{{if and (eq .Sort "name") (ne .Order "desc")}}
|
{{if and (eq .Sort "name") (ne .Order "desc")}}
|
||||||
<a href="?sort=name&order=desc">Name <i class="fa fa-arrow-up"></i></a>
|
<a href="?sort=name&order=desc">Name <i class="fa fa-arrow-up"></i></a> {{else if and (eq .Sort "name") (ne .Order "asc")}}
|
||||||
{{else if and (eq .Sort "name") (ne .Order "asc")}}
|
<a href="?sort=name&order=asc">Name <i class="fa fa-arrow-down"></i></a> {{else}}
|
||||||
<a href="?sort=name&order=asc">Name <i class="fa fa-arrow-down"></i></a>
|
<a href="?sort=name&order=asc">Name</a> {{end}}
|
||||||
{{else}}
|
</th>
|
||||||
<a href="?sort=name&order=asc">Name</a>
|
<th class="right hideable">
|
||||||
{{end}}
|
{{if and (eq .Sort "size") (ne .Order "desc")}}
|
||||||
</th>
|
<a href="?sort=size&order=desc">Size <i class="fa fa-arrow-up"></i></a> {{else if and (eq .Sort "size") (ne .Order "asc")}}
|
||||||
<th class="right">
|
<a href="?sort=size&order=asc">Size <i class="fa fa-arrow-down"></i></a> {{else}}
|
||||||
{{if and (eq .Sort "size") (ne .Order "desc")}}
|
<a href="?sort=size&order=asc">Size</a> {{end}}
|
||||||
<a href="?sort=size&order=desc">Size <i class="fa fa-arrow-up"></i></a>
|
</th>
|
||||||
{{else if and (eq .Sort "size") (ne .Order "asc")}}
|
<th class="hideable right">
|
||||||
<a href="?sort=size&order=asc">Size <i class="fa fa-arrow-down"></i></a>
|
{{if and (eq .Sort "time") (ne .Order "desc")}}
|
||||||
{{else}}
|
<a href="?sort=time&order=desc">Modified <i class="fa fa-arrow-up"></i></a> {{else if and (eq .Sort "time") (ne .Order "asc")}}
|
||||||
<a href="?sort=size&order=asc">Size</a>
|
<a href="?sort=time&order=asc">Modified <i class="fa fa-arrow-down"></i></a> {{else}}
|
||||||
{{end}}
|
<a href="?sort=time&order=asc">Modified</a> {{end}}
|
||||||
</th>
|
</th>
|
||||||
<th class="hideable right">
|
<th class="right"></th>
|
||||||
{{if and (eq .Sort "time") (ne .Order "desc")}}
|
</tr>
|
||||||
<a href="?sort=time&order=desc">Modified <i class="fa fa-arrow-up"></i></a>
|
{{range .Items}}
|
||||||
{{else if and (eq .Sort "time") (ne .Order "asc")}}
|
<tr>
|
||||||
<a href="?sort=time&order=asc">Modified <i class="fa fa-arrow-down"></i></a>
|
<td>
|
||||||
{{else}}
|
{{if .IsDir}}
|
||||||
<a href="?sort=time&order=asc">Modified</a>
|
<i class="fa fa-folder"></i> <a href="{{.URL}}">{{.Name}}</a> {{else}} {{ if canBeEdited .URL }}
|
||||||
{{end}}
|
<i class="fa fa-file"></i> <a class="file" href="/admin/edit{{ $path }}{{.URL}}">{{.Name}}</a> {{ else }}
|
||||||
</th>
|
<i class="fa fa-file"></i> {{.Name}} {{ end }} {{ end }}
|
||||||
</tr>
|
</td>
|
||||||
{{range .Items}}
|
<td class="right hideable">{{.HumanSize}}</td>
|
||||||
<tr>
|
<td class="right hideable">{{.HumanModTime "01/02/2006 3:04:05 PM -0700"}}</td>
|
||||||
<td>
|
<td class="right"><button class="delete"><i class="fa fa-times"></i></button></td>
|
||||||
{{if .IsDir}}
|
</tr>
|
||||||
<i class="fa fa-folder"></i> <a href="{{.URL}}">{{.Name}}</a>
|
{{end}}
|
||||||
{{else}}
|
</table>
|
||||||
{{ if canBeEdited .URL }}
|
|
||||||
<i class="fa fa-file"></i> <a class="file" href="/admin/edit{{ $path }}{{.URL}}">{{.Name}}</a>
|
|
||||||
{{ else }}
|
|
||||||
<i class="fa fa-file"></i> {{.Name}}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
</td>
|
|
||||||
<td class="right">{{.HumanSize}}</td>
|
|
||||||
<td class="right hideable">{{.HumanModTime "01/02/2006 3:04:05 PM -0700"}}</td>
|
|
||||||
</tr>
|
|
||||||
{{end}}
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,35 +2,35 @@
|
||||||
|
|
||||||
<div class="editor {{ .Class }}">
|
<div class="editor {{ .Class }}">
|
||||||
<form method="POST" action="">
|
<form method="POST" action="">
|
||||||
<div class="box scroll">
|
<div class="full box scroll">
|
||||||
<main>
|
<main>
|
||||||
{{ if not (eq .Class "full") }}
|
{{ if not (eq .Class "complete") }}
|
||||||
<header>
|
<header>
|
||||||
<div class="content">
|
<div class="container">
|
||||||
<h1>{{ .Name }} <span class="actions"><button class="add"><i class="fa fa-plus"></i></button></span></h1>
|
<h1>{{ .Name }}{{ if eq .Class "frontmatter-only" }}
|
||||||
|
<span class="actions">
|
||||||
|
<button class="add"><i class="fa fa-plus"></i></button>
|
||||||
|
</span>{{ end }}
|
||||||
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
{{ end }}
|
{{ end }} {{ if eq .Class "frontmatter-only" }}
|
||||||
|
<div class="frontmatter">
|
||||||
{{ if eq .Class "frontmatter-only" }}
|
<div class="container">
|
||||||
<div class="sidebar">
|
{{ template "frontmatter" .FrontMatter }}
|
||||||
<div class="content">
|
|
||||||
{{ template "frontmatter" .FrontMatter }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ else if eq .Class "content-only" }}
|
{{ else if eq .Class "content-only" }}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="content">
|
<textarea id="content-area" name="content" class="scroll" data-mode="{{ .Mode }}">{{ .Content }}</textarea>
|
||||||
<textarea id="content-area" name="content" class="scroll" data-mode="{{ .Mode }}">{{ .Content }}</textarea>
|
<div id="preview-area" class="scroll hidden"></div>
|
||||||
<div id="preview-area" class="scroll hidden"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<textarea id="content-area" name="content" class="scroll" data-mode="{{ .Mode }}">{{ .Content }}</textarea>
|
<textarea id="content-area" name="content" class="scroll" data-mode="{{ .Mode }}">{{ .Content }}</textarea>
|
||||||
<div id="preview-area" class="scroll hidden"></div>
|
<div id="preview-area" class="scroll hidden"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sidebar scroll">
|
<div class="frontmatter scroll">
|
||||||
<h2>Metadata</h2>
|
<h2>Metadata</h2>
|
||||||
{{ template "frontmatter" .FrontMatter }}
|
{{ template "frontmatter" .FrontMatter }}
|
||||||
</div>
|
</div>
|
||||||
|
@ -38,14 +38,16 @@
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="action-bar">
|
<div class="toolbar">
|
||||||
{{ if or (eq .Mode "markdown") (eq .Class "full") }}
|
{{ if or (eq .Mode "markdown") (eq .Class "full") }}
|
||||||
<button id="preview" class="left">Preview</button>
|
<button id="preview" class="left">Preview</button>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<span class="left"></span>
|
<span class="left"></span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<input type="submit" data-type="{{ .Class }}" data-message="{{ if eq .Class "frontmatter-only" }}The fields were put on their way.{{ else if eq .Class "content-only" }}Every byte was saved.{{ else }}Post saved with pomp and circumstance.{{ end }}" data-regenerate="false" value="Save">
|
<input type="submit" data-type="{{ .Class }}" data-message="{{ if eq .Class " frontmatter-only " }}The fields were put on their way.{{ else if eq .Class "content-only " }}Every byte was saved.{{ else }}Post saved with pomp and circumstance.{{ end }}"
|
||||||
<input type="submit" data-type="{{ .Class }}" data-message="{{ if eq .Class "frontmatter-only" }}Saved and regenerated.{{ else if eq .Class "content-only" }}Done. What do you want more?{{ else }}Post published. Go and share it!{{ end }}" data-regenerate="true" class="default" value="Publish">
|
data-regenerate="false" value="Save">
|
||||||
|
<input type="submit" data-type="{{ .Class }}" data-message="{{ if eq .Class " frontmatter-only " }}Saved and regenerated.{{ else if eq .Class "content-only " }}Done. What do you want more?{{ else }}Post published. Go and share it!{{ end }}" data-regenerate="true"
|
||||||
|
class="default" value="Publish">
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
{{ define "frontmatter" }}
|
{{ define "frontmatter" }} {{ range $key, $value := . }} {{ if or (eq $value.Type "object") (eq $value.Type "array") }}
|
||||||
{{ range $key, $value := . }}
|
<fieldset id="{{ $value.Name }}" data-name="{{ $value.Name }}" data-type="{{ $value.Type }}">
|
||||||
{{ if or (eq $value.Type "object") (eq $value.Type "array") }}
|
<h3>{{ splitCapitalize $value.Title }}
|
||||||
<fieldset id="{{ $value.Name }}" data-name="{{ $value.Name }}" data-type="{{ $value.Type }}">
|
<span class="actions">
|
||||||
<h3>{{ splitCapitalize $value.Title }} <span class="actions"><button class="delete"><i class="fa fa-minus"></i></button> <button class="add"><i class="fa fa-plus"></i></button></span></h3>
|
<button class="delete"><i class="fa fa-minus"></i></button>
|
||||||
{{ template "frontmatter" $value.Content }}
|
<button class="add"><i class="fa fa-plus"></i></button>
|
||||||
</fieldset>
|
</span>
|
||||||
{{ else }}
|
</h3>
|
||||||
{{ if not (eq $value.Parent.Type "array") }}
|
{{ template "frontmatter" $value.Content }}
|
||||||
<label for="{{ $value.Name }}">{{ splitCapitalize $value.Title }} <span class="actions"><button class="delete"><i class="fa fa-minus"></i></button></span></label>
|
</fieldset>
|
||||||
{{ end }}
|
{{ else }} {{ if not (eq $value.Parent.Type "array") }}
|
||||||
<input name="{{ $value.Name }}:auto" id="{{ $value.Name }}" value="{{ $value.Content }}"></input>
|
<label for="{{ $value.Name }}">{{ splitCapitalize $value.Title }}
|
||||||
{{ end }}
|
<span class="actions">
|
||||||
{{ end }}
|
<button class="delete"><i class="fa fa-minus"></i></button>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
<input name="{{ $value.Name }}:{{ $value.Type }}" id="{{ $value.Name }}" value="{{ $value.Content }}"></input>
|
||||||
|
{{ end }} {{ end }} {{ end }}
|
||||||
|
|
Loading…
Reference in New Issue