"+d+"\n
",A(d)+e}),a=a.replace(/~0/,""),a},z=function(a){return a+="~0",a=a.replace(/(?:^|\n)```(.*)\n([\s\S]*?)\n```/g,function(a,b,c){var d=b,e=c;return e=C(e),e=M(e),e=e.replace(/^\n+/g,""),e=e.replace(/\n+$/g,""),e=""+e+"\n
",A(e)}),a=a.replace(/~0/,""),a},A=function(a){return a=a.replace(/(^\n+|\n+$)/g,""),"\n\n~K"+(d.push(a)-1)+"K\n\n"},B=function(a){return a=a.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(a,b,c,d,e){var f=d;return f=f.replace(/^([ \t]*)/g,""),f=f.replace(/[ \t]*$/g,""),f=C(f),b+""+f+"
"}),a},C=function(a){return a=a.replace(/&/g,"&"),a=a.replace(//g,">"),a=N(a,"*_{}[]\\",!1),a},D=function(a){return a=a.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,"$2"),a=a.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,"$2"),a},E=function(a){return a=a.replace(/((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm,function(a,b){var c=b;return c=c.replace(/^[ \t]*>[ \t]?/gm,"~0"),c=c.replace(/~0/g,""),c=c.replace(/^[ \t]+$/gm,""),c=o(c),c=c.replace(/(^|\n)/g,"$1 "),c=c.replace(/(\s*[^\r]+?<\/pre>)/gm,function(a,b){var c=b;return c=c.replace(/^ /mg,"~0"),c=c.replace(/~0/g,""),c}),A("\n"+c+"\n")}),a},F=function(a){a=a.replace(/^\n+/g,""),a=a.replace(/\n+$/g,"");var b=a.split(/\n{2,}/g),c=[],e=b.length;for(var f=0;f=0?c.push(g):g.search(/\S/)>=0&&(g=p(g),g=g.replace(/^([ \t]*)/g," "),g+="
",c.push(g))}e=c.length;for(var f=0;f=0){var h=d[RegExp.$1];h=h.replace(/\$/g,"$$$$"),c[f]=c[f].replace(/~K\d+K/,h)}return c.join("\n\n")},G=function(a){return a=a.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&"),a=a.replace(/<(?![a-z\/?\$!])/gi,"<"),a},H=function(a){return a=a.replace(/\\(\\)/g,O),a=a.replace(/\\([`*_{}\[\]()>#+-.!])/g,O),a},I=function(a){return a=a.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,'$1'),a=a.replace(/<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,function(a,b){return J(K(b))}),a},J=function(a){var b=[function(a){return""+a.charCodeAt(0)+";"},function(a){return""+a.charCodeAt(0).toString(16)+";"},function(a){return a}];return a="mailto:"+a,a=a.replace(/./g,function(a){if(a=="@")a=b[Math.floor(Math.random()*2)](a);else if(a!=":"){var c=Math.random();a=c>.9?b[2](a):c>.45?b[1](a):b[0](a)}return a}),a=''+a+"",a=a.replace(/">.+:/g,'">'),a},K=function(a){return a=a.replace(/~E(\d+)E/g,function(a,b){var c=parseInt(b);return String.fromCharCode(c)}),a},L=function(a){return a=a.replace(/^(\t|[ ]{1,4})/gm,"~0"),a=a.replace(/~0/g,""),a},M=function(a){return a=a.replace(/\t(?=\t)/g," "),a=a.replace(/\t/g,"~A~B"),a=a.replace(/~B(.+?)~A/g,function(a,b,c){var d=b,e=4-d.length%4;for(var f=0;f 10) { + $('.entry-markdown').addClass('scrolling'); + } else { + $('.entry-markdown').removeClass('scrolling'); + } + }); + // Shadow on Preview if scrolled + $('.entry-preview-content').scroll(function() { + if ($('.entry-preview-content').scrollTop() > 10) { + $('.entry-preview').addClass('scrolling'); + } else { + $('.entry-preview').removeClass('scrolling'); + } + }); + + }); + }); +}(jQuery, Showdown, CodeMirror)); diff --git a/public/scripts/jquery.ghostdown.js b/public/scripts/jquery.ghostdown.js new file mode 100755 index 0000000..291d4d9 --- /dev/null +++ b/public/scripts/jquery.ghostdown.js @@ -0,0 +1,85 @@ +(function ($, ShowDown, CodeMirror) { + "use strict"; + + $.widget( "b4m.ghostDown", { + editor: null, + markdown: null, + html: null, + converter: null, + _create: function() { + this.converter = new ShowDown.converter(); + this.editor = CodeMirror.fromTextArea(this.element.find('textarea')[0], { + mode: 'markdown', + tabMode: 'indent', + lineWrapping: true + }); + + this.editor.on("change", $.proxy(function () { + this._updatePreview(); + }, this)); + + $('.entry-markdown header, .entry-preview header', this.element).click(function (e) { + $('.entry-markdown, .entry-preview', this.element).removeClass('active'); + $(e.target, this.element).closest('section').addClass('active'); + }); + + $('.CodeMirror-scroll', this.element).on('scroll', $.proxy(function (e) { + this._syncScroll(e); + }, this)); + + // Shadow on Markdown if scrolled + $('.CodeMirror-scroll', this.element).scroll(function(e) { + if ($(e.target).scrollTop() > 10) { + $('.entry-markdown', this.element).addClass('scrolling'); + } else { + $('.entry-markdown', this.element).removeClass('scrolling'); + } + }); + // Shadow on Preview if scrolled + $('.entry-preview-content', this.element).scroll(function(e) { + if ($('.entry-preview-content', $(e.target).scrollTop()).scrollTop() > 10) { + $('.entry-preview', this.element).addClass('scrolling'); + } else { + $('.entry-preview', this.element).removeClass('scrolling'); + } + }); + + this._updatePreview(); + }, + _updatePreview: function() { + var preview = this.element.find('.rendered-markdown'); + this.markdown = this.editor.getValue(); + this.html = this.converter.makeHtml(this.markdown); + preview.html(this.html); + this._updateWordCount(); + }, + getHtml: function () { + return this.html; + }, + getMarkdown: function () { + return this.markdown; + }, + _syncScroll: function (e) { + // vars + var $codeViewport = $(e.target), + $previewViewport = $('.entry-preview-content'), + $codeContent = $('.CodeMirror-sizer'), + $previewContent = $('.rendered-markdown'), + // calc position + codeHeight = $codeContent.height() - $codeViewport.height(), + previewHeight = $previewContent.height() - $previewViewport.height(), + ratio = previewHeight / codeHeight, + previewPostition = $codeViewport.scrollTop() * ratio; + + // apply new scroll + $previewViewport.scrollTop(previewPostition); + }, + _updateWordCount: function() { + var wordCount = this.element.find('.entry-word-count'), + editorValue = this.markdown; + if (editorValue.length) { + wordCount.html(editorValue.match(/\S+/g).length + ' words'); + } + } + }); +}(jQuery, Showdown, CodeMirror)); diff --git a/public/scripts/login.js b/public/scripts/login.js new file mode 100755 index 0000000..72d86fe --- /dev/null +++ b/public/scripts/login.js @@ -0,0 +1,39 @@ + +jQuery(document).ready(function() { + /* + Form validation + */ + $('.login-form input[type="text"], .login-form input[type="password"], .login-form textarea').on('focus', function() { + $(this).removeClass('input-error'); + }); + + $('.login-form').on('submit', function(e) { + e.preventDefault(); + $(this).find('input[type="text"], input[type="password"], textarea').each(function(){ + if( $(this).val() == "" ) { + e.preventDefault(); + $(this).addClass('input-error'); + } + else { + $(this).removeClass('input-error'); + + } + }); + if($(".input-error").length == 0){ + $.post("/rn-login", $(this).serialize(), function(data){ + swal({ + type: data.status ? "success" : "warning", + title: data.message, + timer: data.status ? 2000 : null, + showConfirmButton: true + }); + if(data.status){ + window.setTimeout(function(){ + window.location = "/"; + }, 1500); + } + }); + } + }); + +}); diff --git a/public/scripts/raneto.js b/public/scripts/raneto.js new file mode 100755 index 0000000..da3bd76 --- /dev/null +++ b/public/scripts/raneto.js @@ -0,0 +1,136 @@ + +;(function ($, hljs) { + + "use strict"; + + var current_category; + + $(document).ready(function () { + + // Enable Highlighting and other + // things when there is content + if ($(".content").length) { + + // Syntax highlighting + hljs.initHighlightingOnLoad(); + + // Add Bootstrap styling to tables + $(".content table").addClass("table"); + + // FitVids + fitvids(".content"); + } + + // Deal with Home Categories + if ($(".home-categories").length) { + $(".home-categories").masonry({ + columnWidth : ".col", + itemSelector : ".col", + transitionDuration : 0 + }); + } + + // Edit Page + $(".goto-edit").click(function () { + window.location.href = window.location.href + "/edit"; + }); + + // Modal: Add Page Confirm + $("#add-page-confirm").click(function () { + $("#addModal").modal("hide"); + var name = $("#page-name").val().replace(/\s+/g, "-"); + $.post("/rn-add-page", { + name : name, + category : current_category + }, function (data) { + switch (data.status) { + case 0: + window.location = [current_category, name, "edit"].join("/"); + break; + } + }); + }); + + // Modal: Delete Page Confirm + $("#delete-page-confirm").click(function () { + $("#deleteModal").modal("hide"); + $.post("/rn-delete", { + file : decodeURI(window.location.pathname) + }, function (data) { + switch (data.status) { + case 0: + window.location = "/"; + break; + } + }); + }); + + // Add Page + $(".add-page").click(function () { + var text = $(this).closest("h5") + .clone() + .children() + .remove() + .end() + .text() + .trim() + .toLowerCase() + .replace(/\s+/g, "-"); + current_category = text != "main-articles" ? text : ""; + }); + + // New Category + $("#newCategory").keypress(function (e) { + if (e.which === 13) { + $.post("/rn-add-category", { + category : $(this).val() + .trim() + .toLowerCase() + .replace(/\s+/g, "-") + }, function (data) { + location.reload(); + }); + } + }); + + // Close Edit + $(".close-edit").click(function () { + // Remove the trailing "/edit" + var the_arr = window.location.href.split("/"); + the_arr.pop(); + window.location = the_arr.join("/"); + }); + + // Save Page + $(".save-page").click(function () { + var file_arr = window.location.pathname.split("/"); + file_arr.pop(); + $("#entry-markdown").next(".CodeMirror")[0].CodeMirror.save(); + $.post("/rn-edit", { + file : decodeURI(file_arr.join("/")), + content : $("#entry-markdown").val() + }, function (data) { + switch (data.status) { + case 0: + $("#edit-status").slideUp(function () { + $("#edit-status").text("Page Successfully Saved"); + $("#edit-status").removeClass(); + $("#edit-status").addClass("alert alert-success"); + $("#edit-status").slideDown(); + }); + break; + case 1: + $("#edit-status").slideUp(function () { + $("#edit-status").text("Error Saving Page"); + $("#edit-status").removeClass(); + $("#edit-status").addClass("alert alert-warning"); + $("#edit-status").slideDown(); + }); + break; + } + }); + }); + + }); + +})(jQuery, hljs); diff --git a/public/styles/ghostdown.css b/public/styles/ghostdown.css new file mode 100755 index 0000000..19b3529 --- /dev/null +++ b/public/styles/ghostdown.css @@ -0,0 +1,575 @@ +html { + font: 62.5%/1.65 "Open Sans", sans-serif +} +body { + font-size: 1.3rem +} +.CodeMirror { + font-family: monospace; + height: 300px +} +.CodeMirror-scroll { + overflow: auto +} +.CodeMirror-lines { + padding: 4px 0 +} +.CodeMirror pre { + padding: 0 4px +} +.CodeMirror-scrollbar-filler { + background-color: white +} +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7 +} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999 +} +.CodeMirror div.CodeMirror-cursor { + border-left: 1px solid black +} +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver +} +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { + width: auto; + border: 0; + background: transparent; + background: rgba(0,200,0,0.4); +filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#6600c800, endColorstr=#4c00c800) +} +.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor:not(#nonsense_id) { +filter:progid:DXImageTransform.Microsoft.gradient(enabled=false) +} +.cm-s-default .cm-keyword { + color: #708 +} +.cm-s-default .cm-atom { + color: #219 +} +.cm-s-default .cm-number { + color: #164 +} +.cm-s-default .cm-def { + color: #00f +} +.cm-s-default .cm-variable { + color: black +} +.cm-s-default .cm-variable-2 { + color: #05a +} +.cm-s-default .cm-variable-3 { + color: #085 +} +.cm-s-default .cm-property { + color: black +} +.cm-s-default .cm-operator { + color: black +} +.cm-s-default .cm-comment { + color: #a50 +} +.cm-s-default .cm-string { + color: #a11 +} +.cm-s-default .cm-string-2 { + color: #f50 +} +.cm-s-default .cm-meta { + color: #555 +} +.cm-s-default .cm-error { + color: #f00 +} +.cm-s-default .cm-qualifier { + color: #555 +} +.cm-s-default .cm-builtin { + color: #30a +} +.cm-s-default .cm-bracket { + color: #997 +} +.cm-s-default .cm-tag { + color: #170 +} +.cm-s-default .cm-attribute { + color: #00c +} +.cm-s-default .cm-header { + color: blue +} +.cm-s-default .cm-quote { + color: #090 +} +.cm-s-default .cm-hr { + color: #999 +} +.cm-s-default .cm-link { + color: #00c +} +.cm-negative { + color: #d44 +} +.cm-positive { + color: #292 +} +.cm-header, .cm-strong { + font-weight: bold +} +.cm-em { + font-style: italic +} +.cm-emstrong { + font-style: italic; + font-weight: bold +} +.cm-link { + text-decoration: underline +} +.cm-invalidchar { + color: #f00 +} +div.CodeMirror span.CodeMirror-matchingbracket { + color: #0f0 +} +div.CodeMirror span.CodeMirror-nonmatchingbracket { + color: #f22 +} +.CodeMirror { + line-height: 1; + position: relative; + overflow: hidden +} +.CodeMirror-scroll { + margin-bottom: -30px; + margin-right: -30px; + padding-bottom: 30px; + padding-right: 30px; + height: 100%; + outline: none; + position: relative +} +.CodeMirror-sizer { + position: relative +} +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler { + position: absolute; + z-index: 6; + display: none +} +.CodeMirror-vscrollbar { + right: 0; + top: 0; + overflow-x: hidden; + overflow-y: scroll +} +.CodeMirror-hscrollbar { + bottom: 0; + left: 0; + overflow-y: hidden; + overflow-x: scroll +} +.CodeMirror-scrollbar-filler { + right: 0; + bottom: 0; + z-index: 6 +} +.CodeMirror-gutters { + position: absolute; + left: 0; + top: 0; + height: 100%; + padding-bottom: 30px; + z-index: 3 +} +.CodeMirror-gutter { + height: 100%; + display: inline-block; +*zoom:1; +*display:inline +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4 +} +.CodeMirror-lines { + cursor: text +} +.CodeMirror pre { + -moz-border-radius: 0; + -webkit-border-radius: 0; + -o-border-radius: 0; + border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible +} +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal +} +.CodeMirror-linebackground { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 0 +} +.CodeMirror-linewidget { + position: relative; + z-index: 2; + overflow: auto +} +.CodeMirror-widget { + display: inline-block +} +.CodeMirror-wrap .CodeMirror-scroll { + overflow-x: hidden +} +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0px; + overflow: hidden; + visibility: hidden +} +.CodeMirror-measure pre { + position: static +} +.CodeMirror div.CodeMirror-cursor { + position: absolute; + visibility: hidden; + border-right: none; + width: 0 +} +.CodeMirror-focused div.CodeMirror-cursor { + visibility: visible +} +.CodeMirror-selected { + background: #d9d9d9 +} +.CodeMirror-focused .CodeMirror-selected { + background: #d7d4f0 +} +.cm-searching { + background: #ffa; + background: rgba(255,255,0,0.4) +} +.CodeMirror span { +*vertical-align:text-bottom +} +@media print { +.CodeMirror div.CodeMirror-cursor { + visibility: hidden +} +} + + +@media (max-width: 860px), (max-width: 860px) { +.features .editor .outer { + padding: 0 40px +} +} +@media (max-width: 800px), (max-width: 800px) { +.features .editor .outer { + padding: 0 30px +} +} +@media (max-width: 400px), (max-width: 400px) { +.features .editor .outer { + padding: 0 15px +} +} +.features .editor .editorwrap { + max-width: 1180px; + padding: 40px 0; + margin: 0 auto; + position: relative; + height: 450px +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .editorwrap { + height: 400px +} +} +@media (max-width: 600px), (max-width: 600px) { +.features .editor .editorwrap { + height: 480px +} +} +@media (max-width: 400px), (max-width: 400px) { +.features .editor .editorwrap { + height: 530px +} +} +.features .editor .entry-markdown { + left: 0; + padding-left: 40px +} +.features .editor .entry-preview { + right: 0; + border-left: #fff 20px solid; + box-shadow: #edece4 -1px 0 0 +} +.features .editor .entry-markdown, .features .editor .entry-preview { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 50%; + position: absolute; + bottom: 0; + top: 0; + background: #fff +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .entry-markdown, .features .editor .entry-preview { + bottom: 40px +} +} +@media (max-width: 400px), (max-width: 400px) { +.features .editor .entry-markdown, .features .editor .entry-preview { + box-shadow: none +} +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .entry-markdown, .features .editor .entry-preview { + top: 0; + left: 0; + right: 0; + width: 100%; + border: none; + z-index: 100; + box-shadow: #edece4 1px 0 0 inset, #edece4 -1px 0 0 inset, #edece4 0 -1px 0 inset +} +.features .editor .entry-markdown .markdown, .features .editor .entry-markdown .entry-preview-content, .features .editor .entry-preview .markdown, .features .editor .entry-preview .entry-preview-content { + height: 50px; + overflow: hidden +} +} +@media (min-width: 860px) and (min-width: 860px), (min-width: 860px) and (min-width: 860px) { +.features .editor .entry-markdown .floatingheader, .features .editor .entry-preview .floatingheader { + padding-left: 0; + padding-right: 18px; + margin-right: 1px +} +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .entry-markdown .floatingheader, .features .editor .entry-preview .floatingheader { + cursor: pointer; + width: 50%; + border: none; + color: #fff; + background: #aaa9a2; + position: absolute; + top: -40px; + left: 0; + box-shadow: rgba(0,0,0,0.1) 0 -2px 3px inset; + padding: 10px 0; +} +.features .editor .entry-markdown .floatingheader a, .features .editor .entry-preview .floatingheader a { + color: #fff +} +} +.features .editor .entry-markdown .floatingheader a, .features .editor .entry-preview .floatingheader a { + color: #aaa9a2 +} +.features .editor .entry-markdown.active, .features .editor .entry-preview.active { + z-index: 200 +} +.features .editor .entry-markdown.active .markdown, .features .editor .entry-markdown.active .entry-preview-content, .features .editor .entry-preview.active .markdown, .features .editor .entry-preview.active .entry-preview-content { + height: auto; + overflow: auto +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .entry-markdown.active header, .features .editor .entry-preview.active header { + cursor: auto; + color: #aaa9a2; + background: #fff; + box-shadow: #edece4 0 1px 0 inset, #edece4 1px 0 0 inset, #edece4 -1px 0 0 inset +} +.features .editor .entry-markdown.active header a, .features .editor .entry-preview.active header a { + color: #aaa9a2 +} +} +@media (max-width: 400px), (max-width: 400px) { +.features .editor .entry-markdown .markdown-help, .features .editor .entry-markdown .entry-word-count, .features .editor .entry-preview .markdown-help, .features .editor .entry-preview .entry-word-count { + display: none +} +} +.features .editor .markdown-help { + float: right +} +.features .editor .markdown-help:before { + font-family: "Icons"; + font-weight: normal; + font-style: normal; + vertical-align: -7%; + text-transform: none; + speak: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + content: "\e01b"; + color: #cfceca +} +.features .editor .markdown-help:hover { + text-decoration: none +} +.features .editor .markdown-help:hover:before { + font-family: "Icons"; + font-weight: normal; + font-style: normal; + vertical-align: -7%; + text-transform: none; + speak: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + content: "\e01b"; + color: #aaa9a2 +} +.features .editor .markdown-help:hover:hover { + text-decoration: none +} +.features .editor .entry-word-count { + float: right; + padding-right: 22px +} +@media (min-width: 860px) and (min-width: 860px), (min-width: 860px) and (min-width: 860px) { +.features .editor .entry-markdown .floatingheader { + padding-left: 40px +} +} +.features .editor .entry-markdown-content textarea { + border: 0; + width: 100%; + height: 100%; + max-width: 100%; + margin: 0; + padding: 0; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0 +} +.features .editor .entry-markdown-content textarea:focus { + outline: 0 +} +.features .editor .CodeMirror { + height: auto; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + font-family: Inconsolata, monospace; + font-size: 1.4rem; + line-height: 1.3em; + color: #6c7379 +} +.features .editor .CodeMirror .CodeMirror-focused, .features .editor .CodeMirror .CodeMirror-selected { + color: #242628; + background: #b3d5f3; + text-shadow: none +} +.features .editor .CodeMirror ::selection { + color: #242628; + background: #b3d5f3; + text-shadow: none +} +.features .editor .CodeMirror-lines { + padding: 65px 0 40px 0 +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .CodeMirror-lines { + padding: 25px 0 30px 0 +} +} +@media (max-width: 400px), (max-width: 400px) { +.features .editor .CodeMirror-lines { + padding: 15px 0 +} +} +.features .editor .CodeMirror pre { + padding: 0 40px 0 40px +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .CodeMirror pre { + padding: 0 30px +} +} +@media (max-width: 400px), (max-width: 400px) { +.features .editor .CodeMirror pre { + padding: 0 15px +} +} +.features .editor .cm-header { + color: #000; + font-size: 2rem; + line-height: 1.4em +} +.features .editor .cm-string, .features .editor .cm-link, .features .editor .cm-comment, .features .editor .cm-quote { + color: #000 +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .entry-preview .floatingheader { + right: 0; + left: auto; + border: none +} +} +.features .editor .entry-preview-content { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: 60px 40px 40px 30px; + overflow: auto; + font-size: 0.95em +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .entry-preview-content { + padding: 30px +} +} +@media (max-width: 400px), (max-width: 400px) { +.features .editor .entry-preview-content { + padding: 15px 15px 10px 15px +} +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .scrolling .floatingheader { + height: 39px; + box-shadow: none +} +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .scrolling .floatingheader::before, .features .editor .scrolling .floatingheader::after { + display: none +} +} +@media (max-width: 860px), (max-width: 860px) { +.features .editor .scrolling .CodeMirror-scroll, .features .editor .scrolling .entry-preview-content { + box-shadow: 0 3px 5px rgba(0,0,0,0.05) inset +} +} diff --git a/public/styles/login-form.css b/public/styles/login-form.css new file mode 100755 index 0000000..dfa8d05 --- /dev/null +++ b/public/styles/login-form.css @@ -0,0 +1,74 @@ + +input[type="text"], +input[type="password"], +textarea, +textarea.form-control { + height: 50px; + margin: 0; + padding: 0 20px; + vertical-align: middle; + background: #f8f8f8; + border: 3px solid #ddd; + font-family: 'Roboto', sans-serif; + font-size: 16px; + font-weight: 300; + line-height: 50px; + color: #888; + -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; + -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; + -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; +} + +textarea, +textarea.form-control { + padding-top: 10px; + padding-bottom: 10px; + line-height: 30px; +} + +input[type="text"]:focus, +input[type="password"]:focus, +textarea:focus, +textarea.form-control:focus { + outline: 0; + background: #fff; + border: 3px solid #ccc; + -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; +} + +input[type="text"]:-moz-placeholder, input[type="password"]:-moz-placeholder, +textarea:-moz-placeholder, textarea.form-control:-moz-placeholder { color: #888; } + +input[type="text"]:-ms-input-placeholder, input[type="password"]:-ms-input-placeholder, +textarea:-ms-input-placeholder, textarea.form-control:-ms-input-placeholder { color: #888; } + +input[type="text"]::-webkit-input-placeholder, input[type="password"]::-webkit-input-placeholder, +textarea::-webkit-input-placeholder, textarea.form-control::-webkit-input-placeholder { color: #888; } + + + +button.btn { + height: 50px; + margin: 0; + padding: 0 20px; + vertical-align: middle; + background: #2C323D; + border: 0; + font-family: 'Roboto', sans-serif; + font-size: 16px; + font-weight: 300; + line-height: 50px; + color: #fff; + -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; + text-shadow: none; + -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; + -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; +} + +button.btn:hover { opacity: 0.6; color: #fff; } + +button.btn:active { outline: 0; opacity: 0.6; color: #fff; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } + +button.btn:focus { outline: 0; opacity: 0.6; background: #2C323D; color: #fff; } + +button.btn:active:focus, button.btn.active:focus { outline: 0; opacity: 0.6; background: #de995e; color: #fff; } diff --git a/public/styles/login-style.css b/public/styles/login-style.css new file mode 100755 index 0000000..0700369 --- /dev/null +++ b/public/styles/login-style.css @@ -0,0 +1,185 @@ + +body { + font-family: 'Roboto', sans-serif; + font-size: 16px; + font-weight: 300; + color: #888; + line-height: 30px; + text-align: center; +} + +strong { font-weight: 500; } + +a, a:hover, a:focus { + color: #2C323D; + text-decoration: none; + -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; +} + +h1, h2 { + margin-top: 10px; + font-size: 38px; + font-weight: 100; + color: #555; + line-height: 50px; +} + +h3 { + font-size: 22px; + font-weight: 300; + color: #555; + line-height: 30px; +} + +img { max-width: 100%; } + +::-moz-selection { background: #2C323D; color: #fff; text-shadow: none; } +::selection { background: #2C323D; color: #fff; text-shadow: none; } + + +.btn-link-1 { + display: inline-block; + height: 50px; + margin: 5px; + padding: 16px 20px 0 20px; + background: #2C323D; + font-size: 16px; + font-weight: 300; + line-height: 16px; + color: #fff; + -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; +} +.btn-link-1:hover, .btn-link-1:focus, .btn-link-1:active { outline: 0; opacity: 0.6; color: #fff; } + +.btn-link-1.btn-link-1-facebook { background: #4862a3; } +.btn-link-1.btn-link-1-twitter { background: #55acee; } +.btn-link-1.btn-link-1-google-plus { background: #dd4b39; } + +.btn-link-1 i { + padding-right: 5px; + vertical-align: middle; + font-size: 20px; + line-height: 20px; +} + +.btn-link-2 { + display: inline-block; + height: 50px; + margin: 5px; + padding: 15px 20px 0 20px; + background: rgba(0, 0, 0, 0.3); + border: 1px solid #fff; + font-size: 16px; + font-weight: 300; + line-height: 16px; + color: #fff; + -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; +} +.btn-link-2:hover, .btn-link-2:focus, +.btn-link-2:active, .btn-link-2:active:focus { outline: 0; opacity: 0.6; background: rgba(0, 0, 0, 0.3); color: #fff; } + + +/***** Top content *****/ + +.inner-bg { + padding: 100px 0 170px 0; +} + +.top-content .text { + color: #fff; +} + +.top-content .text h1 { color: #fff; } + +.top-content .description { + margin: 20px 0 10px 0; +} + +.top-content .description p { opacity: 0.8; } + +.top-content .description a { + color: #fff; +} +.top-content .description a:hover, +.top-content .description a:focus { border-bottom: 1px dotted #fff; } + +.form-box { + margin-top: 35px; +} + +.form-top { + overflow: hidden; + padding: 0 25px 15px 25px; + background: #fff; + -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; + text-align: left; +} + +.form-top-left { + float: left; + width: 75%; + padding-top: 25px; +} + +.form-top-left h3 { margin-top: 0; } + +.form-top-right { + float: left; + width: 25%; + padding-top: 5px; + font-size: 66px; + color: #ddd; + line-height: 100px; + text-align: right; +} + +.form-bottom { + padding: 25px 25px 30px 25px; + background: #eee; + -moz-border-radius: 0 0 4px 4px; -webkit-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; + text-align: left; +} + +.form-bottom form textarea { + height: 100px; +} + +.form-bottom form button.btn { + width: 100%; +} + +.form-bottom form .input-error { + border-color: #2C323D; +} + +.social-login { + margin-top: 35px; +} + +.social-login h3 { + color: #fff; +} + +.social-login-buttons { + margin-top: 25px; +} + + +/***** Media queries *****/ + +@media (min-width: 992px) and (max-width: 1199px) {} + +@media (min-width: 768px) and (max-width: 991px) {} + +@media (max-width: 767px) { + + .inner-bg { padding: 60px 0 110px 0; } + +} + +@media (max-width: 415px) { + + h1, h2 { font-size: 32px; } + +} + diff --git a/public/styles/raneto.css b/public/styles/raneto.css new file mode 100755 index 0000000..62fb808 --- /dev/null +++ b/public/styles/raneto.css @@ -0,0 +1,186 @@ + +.header { + color: #CCC; + background: #2C323D; +} + +.header .container-fluid { + padding-top: 20px; + padding-bottom: 20px; +} + +.header a { + color: #DDD; +} + +.header a:hover { + color: #FFF; + text-decoration: none; +} + +.header .logo { + margin-left: 20px; + font-size: 20px; + line-height: 34px; +} + +.header .search-form { + margin-right: 20px; +} + +.menu { + padding: 0; + margin: 40px 20px; + list-style: none; +} + +.menu .pages { + padding: 0; + margin: 0; + list-style: none; +} + +.menu li { + line-height: 30px; +} + +.menu .category-title { + margin: 25px 0 10px 0; + font-size: 12px; + text-transform: uppercase; +} + +.menu a { + display: inline-block; + line-height: 20px; + color: #888; +} + +.menu a:hover { + color: #444; + text-decoration: none; +} + +.menu .active a { + font-weight: bold; + color: #444; +} + +.page-home .header .search-form { + display: none; +} + +.home-search { + text-align: center; +} + +.home-categories { + margin: 0 10px; +} + +.home-categories .panel-heading { + margin: 0; + font-size: 100%; + font-weight: normal; +} + +.home-categories .panel-heading, +.home-categories .panel .page { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.content { + padding: 40px; + margin: 40px 20px; + color: #555; + border: 1px solid #E9E9E9; + -webkit-box-shadow: 0 1px 50px rgba(0,0,0,0.1); + box-shadow: 0 1px 50px rgba(0,0,0,0.1); +} + +.content .title { + margin: 0 0 30px 0; +} + +.content h1, +.content h2, +.content h3, +.content h4, +.content h5, +.content h6 { + color: #222; +} + +.content p, +.content ul, +.content ol, +.content pre, +.content blockquote, +.content table, +.content iframe { + margin-bottom: 1em; +} + +.content img { + display: block; + height: auto; + max-width: 100%; + padding: 4px; + margin: 0 auto; + background: #FFF; + border: 1px solid #D6D6D6; + border-radius: 4px; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + + +.content pre { + border: 0; + padding: 0 0 0 0; +} + +.content .page-meta { + margin-top: 50px; + font-size: 85%; + color: #999; +} + +.content .page-meta a { + color: #999; + border-bottom: 1px dotted #999; +} + +.content .page-meta a:hover { + color: #428BCA; + text-decoration: none; +} + +.footer .copyright { + margin: 0 20px 40px 0; + font-size: 85%; + color: #999; +} + +.page-excerpt .search-query { + background: #FFFDDC; +} + +.error { + padding: 0 20px; +} + +@media only screen and (max-width: 767px) { + + .home-search .form-group { + margin-bottom: 0; + } + + #home-search { + margin-bottom: 10px; + } + +} diff --git a/server.js b/server.js new file mode 100755 index 0000000..f0355c3 --- /dev/null +++ b/server.js @@ -0,0 +1,23 @@ +#!/usr/bin/env node + +'use strict'; + +// Modules +var debug = require('debug')('raneto'); + +// For development purposes, we load it this way in this example: +var raneto = require('raneto'); + +// Then, we load our configuration file +// This can be done inline, with a JSON file, +// or with a Node.js module as we do below. +var config = require('./config.default.js'); + +// Finally, we initialize Raneto +// with our configuration object +var app = raneto(config); + +// Load the HTTP Server +var server = app.listen(app.get('port'), function () { + debug('Express HTTP server listening on port ' + server.address().port); +}); diff --git a/themes/default/templates/edit.html b/themes/default/templates/edit.html new file mode 100755 index 0000000..4eac54f --- /dev/null +++ b/themes/default/templates/edit.html @@ -0,0 +1,44 @@ + + ++ ++ {{#meta.title}}+{{meta.title}}
{{/meta.title}} ++diff --git a/themes/default/templates/error.html b/themes/default/templates/error.html new file mode 100755 index 0000000..70bb23c --- /dev/null +++ b/themes/default/templates/error.html @@ -0,0 +1,5 @@ + ++ +++ + + + ++ + ++Editor
+ + + ++ + +++ +++ + +Preview
++ ++ ++diff --git a/themes/default/templates/home.html b/themes/default/templates/home.html new file mode 100755 index 0000000..06acc52 --- /dev/null +++ b/themes/default/templates/home.html @@ -0,0 +1,41 @@ + +{{status}}
+{{message}}
++ ++ ++ {{#pages}} + {{#is_index}} + {{#files.length}} +diff --git a/themes/default/templates/layout.html b/themes/default/templates/layout.html new file mode 100755 index 0000000..44f5b4a --- /dev/null +++ b/themes/default/templates/layout.html @@ -0,0 +1,113 @@ + + + + + + +++ {{/files.length}} + {{/is_index}} + {{^is_index}} +++Main Articles
++ {{#files}} +
+- {{title}}
+ {{/files}} +++ {{/is_index}} + {{/pages}} +++{{title}}
++ {{#files}} +
+- {{title}}
+ {{/files}} +Codestin Search App + {{#meta.description}}{{/meta.description}} + + + + + + + + + {{{config.analytics}}} + + + + + ++ + + ++++ +++ + +++ {{{yield}}} ++ + + + + {{#config.allow_editing}} + + +++ + +++ +++ + {{/config.allow_editing}} + + + + + + + + + + + + diff --git a/themes/default/templates/login.html b/themes/default/templates/login.html new file mode 100755 index 0000000..16df368 --- /dev/null +++ b/themes/default/templates/login.html @@ -0,0 +1,76 @@ + + + + + + +++ +Codestin Search App + {{#meta.description}}{{/meta.description}} + + + + + + + + + + {{{config.analytics}}} + + + + + +++ + + + + + + + + + + + + + + diff --git a/themes/default/templates/page.html b/themes/default/templates/page.html new file mode 100755 index 0000000..0d28a45 --- /dev/null +++ b/themes/default/templates/page.html @@ -0,0 +1,61 @@ + +++ +++++++Raneto
++++
+ +++diff --git a/themes/default/templates/search.html b/themes/default/templates/search.html new file mode 100755 index 0000000..651b807 --- /dev/null +++ b/themes/default/templates/search.html @@ -0,0 +1,44 @@ + ++ ++ + ++ +++ + {{#config.allow_editing}} + + ++ ++ {{/config.allow_editing}} + + {{#meta.title}} +{{meta.title}}
{{/meta.title}} + + {{{content}}} + + + +++ ++ + ++ +++ + +Search results for: {{search}}
+ {{#searchResults.length}} + {{#searchResults}} +++ {{/searchResults}} + {{/searchResults.length}} + {{^searchResults.length}} +{{title}}
+{{{excerpt}}}+Nothing found for "{{search}}"
+ {{/searchResults.length}} +