Skip to content

Commit

Permalink
Merge branch 'master' of github.com:t-minus-ten/apollo
Browse files Browse the repository at this point in the history
  • Loading branch information
emaildano committed Feb 6, 2018
2 parents 8bfee2d + 1fb126b commit 102b48e
Show file tree
Hide file tree
Showing 35 changed files with 14,101 additions and 720 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016 J2made
Copyright for portions of project Apollo are held by J2made, 2016. All other copyright for project Apollo are held by Shaun M. Baer, 2018.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 20 additions & 0 deletions app/themes/mission-control/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"env": {
"browser": true,
"jquery": true,
"es6": true
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"semi": 2
},
"globals": {
"jQuery": true,
"$": true
}
}
17 changes: 0 additions & 17 deletions app/themes/mission-control/.jshintrc

This file was deleted.

38 changes: 38 additions & 0 deletions app/themes/mission-control/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import Router from './modules/DomBasedRouter';
import { commonInit, commonFinalize } from './modules/commonScripts';
import { frontPageInit } from './modules/frontPageScripts';

/**
* ES6 module implementation of Paul Irish's DOM based routing
* @link https://gist.github.com/nathanaelnsmith/efc1ce2dd0b78db11632d47727361319
*
* Javascript in `common` will fire on every page. The init() functions of each
* route, starting with `common`, will fire first. Once the init() functions of
* all routes have fired, the finalize() functions will fire.
*
* To add a page specific js, add the classname for a page, replacing all hyphens
* with underscores (ex: 'front-page' should be 'front_page').
*
* See: assets/js/modules/DomBasedRouter.js
*
*/
let routes = {
'common': {
init() {
commonInit();
},
finalize() {
commonFinalize();
}
},
'front_page': {
init() {
frontPageInit();
}
}
};

let router = new Router(routes);

router.load();

60 changes: 0 additions & 60 deletions app/themes/mission-control/assets/js/main.js

This file was deleted.

30 changes: 30 additions & 0 deletions app/themes/mission-control/assets/js/modules/DomBasedRouter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* ES6 module implementation of Paul Irish's DOM based routing
* @link https://gist.github.com/nathanaelnsmith/efc1ce2dd0b78db11632d47727361319
*
*/

export default (routes) => {
return {
fire (func,funcname, args){
funcname = (funcname === undefined) ? 'init' : funcname;
if (func !== '' && routes[func] && typeof routes[func][funcname] == 'function'){
routes[func][funcname](args);
}
},
load() {
var bodyId = document.body.id;
let Router = this;
// hit up common first.
Router.fire('common');

// do all the classes too.
$.each(document.body.className.replace(/-/g, '_').split(/\s+/),function(i,classnm){
Router.fire(classnm);
Router.fire(classnm,bodyId);
});

Router.fire('common','finalize');
}
};
};
27 changes: 22 additions & 5 deletions app/themes/mission-control/assets/js/modules/commonScripts.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
/**
* Module for js that fires on all pages.
* This is an example of how you could break down a js file into parts
* with es6. Here the `commonInit()` function will fire on all pages
* because that function is called in the `init()` function of `common`
* in app.js.
*
* `commonFinalize()` will fire on all pages once the `init()` functions
* of each route in app.js have been fired. It is called in the
* `finalize()` function of `common` in app.js.
*
*/
import { sampleMessage, sampleAddModule } from './sampleModule';

module.exports = function() {
// This function will fire on init() in app.js
export function commonInit() {
console.log('See commonInit() in commonScripts.js \n' +
'--- \n' +
sampleMessage() + '\n' +
sampleAddModule(3,3)
);
}

console.log('We have liftoff.');

};
// This function will fire on finalize() in app.js
export function commonFinalize() {
console.log('See commonFinalize() in commonScripts.js');
}
12 changes: 12 additions & 0 deletions app/themes/mission-control/assets/js/modules/frontPageScripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* This is an example of how you could break down parts of js with es6.
*
* Here the `frontPageInit()` function will fire only on pages with a
* body class of `front_page`.
*
*/
export function frontPageInit() {

console.log( 'See frontPageInit() in frontPageScripts.js' );

}
8 changes: 8 additions & 0 deletions app/themes/mission-control/assets/js/modules/sampleModule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Export a message
export const sampleMessage = () => 'This is the sampleMessage const from sampleModule.js';

// Export a basic addition function
export function sampleAddModule(a, b = 2) {
let val = a + b;
return `The value of the sampleAddModule() is ${val}`;
}
2 changes: 1 addition & 1 deletion app/themes/mission-control/assets/sass/main/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// =============================================================================

@charset 'UTF-8';
@import '../../../node_modules/sanitize.css/sanitize.css'; // Sanitize
@import '../partials/utilities/reset'; // Eric Meyer Reset
@import '../../../node_modules/partsandlabor/partsandlabor.scss'; // Parts and Labor

// THEME STYLES
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Eric Meyer CSS reset
// @link https://meyerweb.com/eric/tools/css/reset/


html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
8 changes: 4 additions & 4 deletions app/themes/mission-control/base.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace Apollo\Base;
use Apollo\Admin\Structure;
use Apollo\Config\Condition;
use Apollo\Theme\Structure;
use Apollo\Config\Conditionals;

get_header();

// Conditionally get the page header
if ( Condition\get_page_header() ) {
if ( Conditionals\get_page_header() ) {
get_template_part( 'templates/page-header/_page-header-main' );
}

Expand All @@ -29,7 +29,7 @@
<?php

// Conditionally get the page header
if ( Condition\get_page_footer() ) {
if ( Conditionals\get_page_footer() ) {
get_template_part( 'templates/page-footer/_page-footer-main' );
}

Expand Down
33 changes: 18 additions & 15 deletions app/themes/mission-control/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,22 @@
* @since 1.0.0
*/
$function_includes = [
'config-settings', // Variables and Theme Support
'config-conditionals', // Config Conditionals
'theme-structure', // Build Theme Layouts
'theme-wrapper', // Theme wrapper class
'theme-assets', // Scripts and stylesheets
'theme-modules', // Modular HTML Components
'theme-utilities', // Custom Functions for Practical Purposes

/* Uncomment as needed */
// 'misc/extend-post-types', // Custom Post Types
// 'misc/extend-taxonomy', // Custom Taxonomies
// 'misc/extend-admin', // Customize WP Admin
// 'misc/extend-queries', // Alterations to queries via hooks
'Config/Definitions', // Setup Definitions for Config/Settings
'Config/Settings', // Theme Setup, contol WordPress `<head>` output
'Config/Conditionals', // Conditionals for layout, display, etc.

'Theme/Wrapper', // @scribu WordPress Theme Wrapper
'Theme/Structure', // Determine the base html structure based on settings
'Theme/Assets', // Load css, js, and other assets
'Theme/Utilities', // Theme based utility functions
'Theme/Modules', // Create modular, reusable HTML components

'Extend/Queries', // Change how queries operate
'Extend/Images', // Add new Image sizes
'Extend/Post_Types', // Add Custom Post Types
'Extend/Taxonomy', // Add Custom Taxonomies
'Extend/WP_Admin', // Change aspects of WP Admin
'Extend/WP_Output', // Change output of default WP HTML, i.e. nav items, oembeds, and body classes
];


Expand All @@ -42,8 +45,8 @@
*/
foreach ( $function_includes as $filename ) {

$filepath = 'lib/' . $filename . '.php';
require_once locate_template($filepath);
$filepath = '/lib/' . $filename . '.php';
require_once get_template_directory() . $filepath;

}

Expand Down
Loading

0 comments on commit 102b48e

Please sign in to comment.