Travis GCC option + UI enhancements

This commit is contained in:
NGPixel 2016-08-28 11:27:05 -04:00
parent 49020b0410
commit c8256c9422
13 changed files with 226 additions and 43 deletions

View File

@ -3,9 +3,14 @@ node_js:
- '6' - '6'
- '5' - '5'
- '4.4' - '4.4'
services: env:
- redis-server - CXX=g++-6.2
- mongodb addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6.2
env: env:
global: global:
- secure: VCgscCCKhvHu0tW8e3jo6wydckE6jDkEfC2Zd5aSZytYAex05qahU45cmksqMIT1uBCcC4CKRK4caoKac/+818EyKBTV+vAL74cMMc8NeLNVY2m50+ohu8GYu+ByIffttK7cnXN7xIzyuK4csI7qz84jxLW0KYgYQ+6SPbUG3Hy6gr0P0CztNmAFfyhTam4OKSIiXyvQZW0fZoSruOpUYS5pxvCBi4AxpRY8+6IxCL8xYqF49P0l28nn0C/NYUklwag6l4JF32PrcLAU5S+NIXXgJX499cZO4C2m2GljJeolbvGue3ZEtadv5NkmQuFQ1WGb5aURHPkll0hXsWKxT0bH9P1a4Gt1h/J885acWG4U6QZA1Zds/Z4ymNeLA0MzzoAaDK1q8sRglhDJnZYb4Zm5jy7ZA3vFwb+zcGaOT//pCVpcsZINRnd0Qu9LC5NKPrfmyFAAMAXDdo78BEnwryUviWP5976JZmQAfDIWvmGGTs5i1yjiTRi+NVgH0YpfxtI9MTEJo++r5/zNH/jewxj1D8esaamphp6mQvxvpl388veQDw3REUZQ49muzrdK2YYmVRkzLfH2uMsHInN3WqEl3/mTpH76u0nlxMF6HlrVdgB2UNPjlXbSooWXLfdAw98NpCZ7BAFcCcT8Oa9cYw+40rJrdfem5J2EimG5ltw= - secure: VCgscCCKhvHu0tW8e3jo6wydckE6jDkEfC2Zd5aSZytYAex05qahU45cmksqMIT1uBCcC4CKRK4caoKac/+818EyKBTV+vAL74cMMc8NeLNVY2m50+ohu8GYu+ByIffttK7cnXN7xIzyuK4csI7qz84jxLW0KYgYQ+6SPbUG3Hy6gr0P0CztNmAFfyhTam4OKSIiXyvQZW0fZoSruOpUYS5pxvCBi4AxpRY8+6IxCL8xYqF49P0l28nn0C/NYUklwag6l4JF32PrcLAU5S+NIXXgJX499cZO4C2m2GljJeolbvGue3ZEtadv5NkmQuFQ1WGb5aURHPkll0hXsWKxT0bH9P1a4Gt1h/J885acWG4U6QZA1Zds/Z4ymNeLA0MzzoAaDK1q8sRglhDJnZYb4Zm5jy7ZA3vFwb+zcGaOT//pCVpcsZINRnd0Qu9LC5NKPrfmyFAAMAXDdo78BEnwryUviWP5976JZmQAfDIWvmGGTs5i1yjiTRi+NVgH0YpfxtI9MTEJo++r5/zNH/jewxj1D8esaamphp6mQvxvpl388veQDw3REUZQ49muzrdK2YYmVRkzLfH2uMsHInN3WqEl3/mTpH76u0nlxMF6HlrVdgB2UNPjlXbSooWXLfdAw98NpCZ7BAFcCcT8Oa9cYw+40rJrdfem5J2EimG5ltw=

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}(),Alerts=function(){function e(){_classCallCheck(this,e);var t=this;t.mdl=new Vue({el:"#alerts",data:{children:[]},methods:{acknowledge:function(e){t.close(e)}}}),t.uidNext=1}return _createClass(e,[{key:"push",value:function(e){var t=this,n=_.defaults(e,{_uid:t.uidNext,class:"is-info",message:"---",sticky:!1,title:"---"});t.mdl.children.push(n),n.sticky||_.delay(function(){t.close(n._uid)},5e3),t.uidNext++}},{key:"pushError",value:function(e,t){this.push({class:"is-danger",message:t,sticky:!1,title:e})}},{key:"pushSuccess",value:function(e,t){this.push({class:"is-success",message:t,sticky:!1,title:e})}},{key:"close",value:function(e){var t=this,n=_.findIndex(t.mdl.children,["_uid",e]),s=_.nth(t.mdl.children,n);n>=0&&s&&(s.class+=" exit",t.mdl.children.$set(n,s),_.delay(function(){t.mdl.children.$remove(s)},500))}}]),e}();jQuery(document).ready(function(e){e("a").smoothScroll({speed:400,offset:-20});var t=(new Sticky(".stickyscroll"),new Alerts);if(alertsData&&_.forEach(alertsData,function(e){t.push(e)}),1===e("#mk-editor").length){new SimpleMDE({autofocus:!0,element:e("#mk-editor").get(0),autoDownloadFontAwesome:!1,placeholder:"Enter Markdown formatted content here...",hideIcons:["heading","quote"],showIcons:["strikethrough","heading-1","heading-2","heading-3","code","table","horizontal-rule"],spellChecker:!1})}}); "use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),Alerts=function(){function e(){_classCallCheck(this,e);var t=this;t.mdl=new Vue({el:"#alerts",data:{children:[]},methods:{acknowledge:function(e){t.close(e)}}}),t.uidNext=1}return _createClass(e,[{key:"push",value:function(e){var t=this,n=_.defaults(e,{_uid:t.uidNext,class:"is-info",message:"---",sticky:!1,title:"---"});t.mdl.children.push(n),n.sticky||_.delay(function(){t.close(n._uid)},5e3),t.uidNext++}},{key:"pushError",value:function(e,t){this.push({class:"is-danger",message:t,sticky:!1,title:e})}},{key:"pushSuccess",value:function(e,t){this.push({class:"is-success",message:t,sticky:!1,title:e})}},{key:"close",value:function(e){var t=this,n=_.findIndex(t.mdl.children,["_uid",e]),a=_.nth(t.mdl.children,n);n>=0&&a&&(a.class+=" exit",t.mdl.children.$set(n,a),_.delay(function(){t.mdl.children.$remove(a)},500))}}]),e}();jQuery(document).ready(function(e){e("a").smoothScroll({speed:400,offset:-20});new Sticky(".stickyscroll");e(window).bind("beforeunload",function(){e("#notifload").addClass("active")}),e(document).ajaxSend(function(){e("#notifload").addClass("active")}).ajaxComplete(function(){e("#notifload").removeClass("active")});var t=new Alerts;if(alertsData&&_.forEach(alertsData,function(e){t.push(e)}),1===e("#mk-editor").length){new SimpleMDE({autofocus:!0,autoDownloadFontAwesome:!1,element:e("#mk-editor").get(0),hideIcons:["heading","quote"],placeholder:"Enter Markdown formatted content here...",showIcons:["strikethrough","heading-1","heading-2","heading-3","code","table","horizontal-rule"],spellChecker:!1,status:!1})}e("#page-type-edit").length&&(e(".btn-edit-discard").on("click",function(t){e("#modal-edit-discard").toggleClass("is-active")}),e(".btn-edit-save").on("click",function(e){}))});

View File

@ -2,7 +2,9 @@
jQuery( document ).ready(function( $ ) { jQuery( document ).ready(function( $ ) {
// ====================================
// Scroll // Scroll
// ====================================
$('a').smoothScroll({ $('a').smoothScroll({
speed: 400, speed: 400,
@ -11,7 +13,18 @@ jQuery( document ).ready(function( $ ) {
var sticky = new Sticky('.stickyscroll'); var sticky = new Sticky('.stickyscroll');
// Alerts // ====================================
// Notifications
// ====================================
$(window).bind('beforeunload', () => {
$('#notifload').addClass('active');
});
$(document).ajaxSend(() => {
$('#notifload').addClass('active');
}).ajaxComplete(() => {
$('#notifload').removeClass('active');
});
var alerts = new Alerts(); var alerts = new Alerts();
if(alertsData) { if(alertsData) {
@ -20,20 +33,29 @@ jQuery( document ).ready(function( $ ) {
}); });
} }
// Editor // ====================================
// Markdown Editor
// ====================================
if($('#mk-editor').length === 1) { if($('#mk-editor').length === 1) {
let mde = new SimpleMDE({ let mde = new SimpleMDE({
autofocus: true, autofocus: true,
element: $("#mk-editor").get(0),
autoDownloadFontAwesome: false, autoDownloadFontAwesome: false,
placeholder: 'Enter Markdown formatted content here...', element: $("#mk-editor").get(0),
hideIcons: ['heading', 'quote'], hideIcons: ['heading', 'quote'],
placeholder: 'Enter Markdown formatted content here...',
showIcons: ['strikethrough', 'heading-1', 'heading-2', 'heading-3', 'code', 'table', 'horizontal-rule'], showIcons: ['strikethrough', 'heading-1', 'heading-2', 'heading-3', 'code', 'table', 'horizontal-rule'],
spellChecker: false spellChecker: false,
status: false
}); });
} }
// ====================================
// Pages logic
// ====================================
//=include pages/edit.js
}); });

18
client/js/pages/edit.js Normal file
View File

@ -0,0 +1,18 @@
if($('#page-type-edit').length) {
//-> Discard
$('.btn-edit-discard').on('click', (ev) => {
$('#modal-edit-discard').toggleClass('is-active');
});
//-> Save
$('.btn-edit-save').on('click', (ev) => {
});
}

View File

@ -1,5 +1,6 @@
//@import './layout/_fonts'; //@import './layout/_fonts';
@import './layout/_base'; @import './layout/_base';
@import './layout/_mixins';
$red: #E53935; $red: #E53935;
$orange: #FB8C00; $orange: #FB8C00;

View File

@ -110,6 +110,15 @@ p code {
.card-header { .card-header {
background-color: $turquoise; background-color: $turquoise;
&.is-warning {
background-color: $orange;
}
&.is-danger {
background-color: $red;
}
} }
.card-header-title { .card-header-title {
@ -121,4 +130,8 @@ p code {
.modal-content .card-footer-item { .modal-content .card-footer-item {
font-weight: 500; font-weight: 500;
}
.modal-content .card-footer-item.featured {
animation: flash 4s ease 0 infinite;
} }

View File

@ -2,4 +2,23 @@
h2.nav-item { h2.nav-item {
font-size: 150%; font-size: 150%;
color: $orange; color: $orange;
}
#notifload {
width: 42px;
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
transition: opacity .5s ease;
&::before {
content: " ";
@include spinner($orange,0.5s,24px);
}
&.active {
opacity: 1;
}
} }

View File

@ -0,0 +1,85 @@
/**
* Clearfix
*
* @return {string} Clearfix attribute
*/
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
/**
* Placeholder attribute for inputs
*
* @return {string} Placeholder attributes
*/
@mixin placeholder {
&::-webkit-input-placeholder {@content};
&::-moz-placeholder {@content}
&:-ms-input-placeholder {@content}
&:placeholder-shown {@content};
}
/**
* Spinner element
*
* @param {string} $color - Color
* @param {string} $dur - Animation Duration
* @param {int} $width - Width
* @param {int} $height [$width] - height
*
* @return {string} Spinner element
*/
@mixin spinner($color,$dur,$width,$height:$width) {
width: $width;
height: $height;
border-radius: 50%;
box-shadow:0 0 0 1px rgba(0,0,0,0.1), 2px 1px 0 $color;
@include prefix(animation, spin $dur linear infinite);
@include keyframes(spin) {
100%{
@include prefix(transform, rotate(360deg));
}
};
}
/**
* Prefixes for keyframes
*
* @param {string} $animation-name - The animation name
*
* @return {string} Prefixed keyframes attributes
*/
@mixin keyframes($animation-name) {
@-webkit-keyframes #{$animation-name} {
@content;
}
@-moz-keyframes #{$animation-name} {
@content;
}
@-o-keyframes #{$animation-name} {
@content;
}
@keyframes #{$animation-name} {
@content;
}
}
/**
* Prefix function for browser compatibility
*
* @param {string} $property - Property name
* @param {any} $value - Property value
*
* @return {string} Prefixed attributes
*/
@mixin prefix($property, $value) {
-webkit-#{$property}: #{$value};
-moz-#{$property}: #{$value};
-ms-#{$property}: #{$value};
-o-#{$property}: #{$value};
#{$property}: #{$value};
}

View File

@ -101,6 +101,7 @@ gulp.task("scripts-app", function () {
return gulp.src(paths.scriptapps) return gulp.src(paths.scriptapps)
.pipe(plumber()) .pipe(plumber())
.pipe(concat('app.js')) .pipe(concat('app.js'))
.pipe(include({ extensions: "js" }))
.pipe(babel()) .pipe(babel())
.pipe(uglify()) .pipe(uglify())
.pipe(plumber.stop()) .pipe(plumber.stop())

View File

@ -16,6 +16,7 @@ nav.nav.has-shadow.stickyscroll
span span
.nav-right.nav-menu .nav-right.nav-menu
block rootNavRight block rootNavRight
i.nav-item#notifload
a.nav-item(href='#') a.nav-item(href='#')
| History | History
a.nav-item(href='#') a.nav-item(href='#')

View File

@ -4,21 +4,37 @@ block rootNavCenter
h2.nav-item= pageData.meta.title h2.nav-item= pageData.meta.title
block rootNavRight block rootNavRight
i.nav-item#notifload
a.nav-item(href='#') a.nav-item(href='#')
| History | History
a.nav-item(href='#') a.nav-item(href='#')
| Source | Source
span.nav-item span.nav-item
a.button.is-danger(href='/' + pageData.meta.path) a.button.is-warning.btn-edit-discard
span.icon span.icon
i.fa.fa-times i.fa.fa-times
span Discard span Discard
a.button.is-success(href='#', onclick='$(".modal").addClass("is-active");') a.button.is-success.btn-edit-save
span.icon span.icon
i.fa.fa-check i.fa.fa-check
span Save Changes span Save Changes
block content block content
section.section.is-small #page-type-edit
textarea#mk-editor= pageData.markdown section.section.is-small
textarea#mk-editor= pageData.markdown
.modal#modal-edit-discard
.modal-background
.modal-container
.modal-content
.card.is-fullwidth
header.card-header.is-warning
p.card-header-title Discard?
.card-content
.content
| Are you sure you want to leave this page and loose any modifications?
footer.card-footer
a.card-footer-item.btn-edit-discard Stay on page
a.card-footer-item(href='/' + pageData.meta.path) Discard

View File

@ -9,6 +9,7 @@ mixin tocMenu(ti)
+tocMenu(node.nodes) +tocMenu(node.nodes)
block rootNavRight block rootNavRight
i.nav-item#notifload
a.nav-item(href='#') a.nav-item(href='#')
| History | History
a.nav-item(href='#') a.nav-item(href='#')
@ -25,39 +26,40 @@ block rootNavRight
block content block content
section.section #page-type-view
.container.is-fluid section.section
.columns .container.is-fluid
.columns
.column.is-narrow.sd-menus.is-hidden-touch .column.is-narrow.sd-menus.is-hidden-touch
.box .box
aside.menu(style= { 'min-width': '200px' }) aside.menu(style= { 'min-width': '200px' })
p.menu-label p.menu-label
| Navigation | Navigation
ul.menu-list ul.menu-list
li
a(href='/') Home
if pageData.parent
li li
a(href='/' + pageData.parent.path)= pageData.parent.title a(href='/') Home
li if pageData.parent
a(href='/account') Account li
.box.stickyscroll(data-margin-top=70) a(href='/' + pageData.parent.path)= pageData.parent.title
aside.menu(style= { 'min-width': '200px' }) li
p.menu-label a(href='/account') Account
| Contents .box.stickyscroll(data-margin-top=70)
ul.menu-list aside.menu(style= { 'min-width': '200px' })
a(href='#root', title='Start') Start p.menu-label
+tocMenu(pageData.tree) | Contents
ul.menu-list
a(href='#root', title='Start') Start
+tocMenu(pageData.tree)
.column .column
h1.title#title= pageData.meta.title h1.title#title= pageData.meta.title
if pageData.meta.subtitle if pageData.meta.subtitle
h2.subtitle= pageData.meta.subtitle h2.subtitle= pageData.meta.subtitle
.content.mkcontent .content.mkcontent
!= pageData.html != pageData.html
.modal .modal
.modal-background .modal-background
@ -73,4 +75,4 @@ block content
input.input(type='text', placeholder='/path', value='/storage/new-page') input.input(type='text', placeholder='/path', value='/storage/new-page')
footer.card-footer footer.card-footer
a.card-footer-item(onclick='$(".modal").removeClass("is-active");') Discard a.card-footer-item(onclick='$(".modal").removeClass("is-active");') Discard
a.card-footer-item Create a.card-footer-item.featured Create