began ui work

This commit is contained in:
AJ ONeal 2015-01-10 00:23:15 -07:00
parent 21d2139c30
commit c753a66794
21 changed files with 1176 additions and 535 deletions

16
.jshintrc Normal file
View File

@ -0,0 +1,16 @@
{ "node": true
, "browser": true
, "jquery": true
, "indent": 2
, "onevar": true
, "laxcomma": true
, "laxbreak": true
, "eqeqeq": true
, "immed": true
, "undef": true
, "unused": true
, "latedef": true
, "globals": { "angular": true }
}

12
app.js Normal file
View File

@ -0,0 +1,12 @@
'use strict';
// Declare app level module which depends on views, and components
angular.module('myApp', [
'ngRoute',
'myApp.about',
'myApp.build',
'myApp.version'
]).
config(['$routeProvider', function ($routeProvider) {
$routeProvider.otherwise({redirectTo: '/about'});
}]);

View File

@ -30,14 +30,18 @@
],
"dependencies": {
"mustache": "~0.8.2",
"bluebird": "~2.5.2",
"bluebird": "~2.6.2",
"rsvp": "~3.0.16",
"escape-string-regexp": "~1.0.2",
"js-yaml": "~3.2.5",
"path": "~3.46.1",
"forEachAsync": "~5.0.5",
"node-uuid": "~1.4.2",
"markdown-it": "~3.0.2"
"markdown-it": "~3.0.2",
"angular": "~1.3.8",
"angular-route": "~1.3.8",
"html5-boilerplate": "~4.3.0",
"bootstrap": "~3.3.1"
},
"resolutions": {
"bluebird": "~2.6.2"

View File

@ -0,0 +1,9 @@
angular.module('myApp.services', []).
factory('MyService', function($http) {
var MyService = {};
$http.get('resources/data.json').success(function(response) {
MyService.data = response;
});
return MyService;
}
);

View File

@ -0,0 +1,9 @@
'use strict';
angular.module('myApp.version.interpolate-filter', [])
.filter('interpolate', ['version', function(version) {
return function(text) {
return String(text).replace(/\%VERSION\%/mg, version);
};
}]);

View File

@ -0,0 +1,15 @@
'use strict';
describe('myApp.version module', function() {
beforeEach(module('myApp.version'));
describe('interpolate filter', function() {
beforeEach(module(function($provide) {
$provide.value('version', 'TEST_VER');
}));
it('should replace VERSION', inject(function(interpolateFilter) {
expect(interpolateFilter('before %VERSION% after')).toEqual('before TEST_VER after');
}));
});
});

View File

@ -0,0 +1,9 @@
'use strict';
angular.module('myApp.version.version-directive', [])
.directive('appVersion', ['version', function(version) {
return function(scope, elm, attrs) {
elm.text(version);
};
}]);

View File

@ -0,0 +1,17 @@
'use strict';
describe('myApp.version module', function() {
beforeEach(module('myApp.version'));
describe('app-version directive', function() {
it('should print current version', function() {
module(function($provide) {
$provide.value('version', 'TEST_VER');
});
inject(function($compile, $rootScope) {
var element = $compile('<span app-version></span>')($rootScope);
expect(element.text()).toEqual('TEST_VER');
});
});
});
});

View File

@ -0,0 +1,8 @@
'use strict';
angular.module('myApp.version', [
'myApp.version.interpolate-filter',
'myApp.version.version-directive'
])
.value('version', '0.8.0');

View File

@ -0,0 +1,11 @@
'use strict';
describe('myApp.version module', function() {
beforeEach(module('myApp.version'));
describe('version service', function() {
it('should return current version', inject(function(version) {
expect(version).toEqual('0.1');
}));
});
});

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,113 @@
<!DOCTYPE html>
<!--[if lt IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html lang="en" ng-app="myApp" class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html lang="en" ng-app="myApp" class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en" ng-app="myApp" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<html>
<head>
<title>Dear Desi</title>
<!-- Deps -->
<script src="./bower_components/bluebird/js/browser/bluebird.js"></script>
<script src="./bower_components/mustache/mustache.js"></script>
<script src="./bower_components/markdown-it/dist/markdown-it.js"></script>
<script src="./bower_components/js-yaml/dist/js-yaml.js"></script>
<script src="./bower_components/path/path.js"></script>
<script src="./bower_components/node-uuid/uuid.js"></script>
<script src="./bower_components/forEachAsync/forEachAsync.js"></script>
<title>Dear Desi - Static Blog Generator</title>
<meta name="description" content="Desirae is a static blog generator that is built for the browser and also works in node.js">
<!-- Libs -->
<script src="./lib/deardesi-utils.js"></script>
<script src="./lib/verify-config.js"></script>
<script src="./lib/deardesi-browser.js"></script>
<script src="./lib/frontmatter.js"></script>
<!-- Style -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bower_components/html5-boilerplate/css/normalize.css">
<link rel="stylesheet" href="bower_components/html5-boilerplate/css/main.css">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css"><!-- just as a fallback -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.1/spacelab/bootstrap.min.css">
<!-- Desi -->
<script src="./deardesi.js"></script>
</head>
<body>
<p>Open up the console, fool!</p>
</body>
<script src="bower_components/html5-boilerplate/js/vendor/modernizr-2.6.2.min.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<!--.navbar.navbar-default.navbar-fixed-top-->
<div style="margin-bottom: 0; border-top-width: 0;" class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<div style="padding-top: 9px; padding-left: 9px; padding-bottom: 9px;" class="pull-left"><img ng-src="http://dropsha.re/files/VY15+v8/desirae-parker-crop.jpg" style="border: 1px solid grey; height: 54px; width: 54px;" class="navbar-logo"/></div><a href="#/" style="padding-top: 23px; padding-left: 25px;" class="navbar-brand">Desirae</a>
<div style="padding-top: 9px;">
<button type="button" ng-init="navCollapsed = true" ng-click="navCollapsed = !navCollapsed" class="navbar-toggle"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>
</div>
</div>
<div id="navbar-main" ng-class="!navCollapsed &amp;&amp; 'in'" class="navbar-collapse collapse">
<ul style="padding-top: 9px;" class="nav navbar-nav">
<li><a href="#/build">Configure</a></li>
<li><a href="#/post">Create Post</a></li>
</ul>
</div>
</div>
</div>
<div ng-view></div>
<footer>
<center>
<p>
<!-- http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html -->
<!-- also needs updating at http://plus.google.com/me/about/edit/co -->
<a href="mailto:develop@dear.deis" rel="me">develop@dear.desi</a>
|
<a href="https://twitter.com/dearbesiblog?rel=author" rel="me">Twitter</a>
<!--a href="https://www.facebook.com/coolaj86?rel=author" rel="me">Facebook</a-->
|
<a href="https://github.com/coolaj86/desirae?rel=author" rel="me">Github</a> (v<span app-version></span>)
<!--a href="https://plus.google.com/111222501744950155474?rel=author" data-user="AJ ONeal" rel="me">Google+</a -->
|
<a href="#screencast" rel="me">YouTube</a>
|
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2 License</a>
|
<a href="http://opensource.org/licenses/MIT">MIT License</a>
</p>
<p>© AJ ONeal Tech LLC 2015
with help from
<a href="http://angularjs.org" target="_blank" title="Superheroic JavaScript MVW Framework">AngularJS</a>,
<a href="http://nodejs.org" target="_blank"
title="Open source, cross-platform server-side JavaScript runtime environment">node.js</a>,
and <a href="http://twitter.github.com/bootstrap/" target="_blank">Twitter Bootstrap</a>
</p>
</center>
</footer>
<!-- fork me on github sticker -->
<a href="https://github.com/coolaj86/desirae"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
<!-- Deps -->
<script src="./bower_components/bluebird/js/browser/bluebird.js"></script>
<script src="./bower_components/mustache/mustache.js"></script>
<script src="./bower_components/markdown-it/dist/markdown-it.js"></script>
<script src="./bower_components/js-yaml/dist/js-yaml.js"></script>
<script src="./bower_components/path/path.js"></script>
<script src="./bower_components/node-uuid/uuid.js"></script>
<script src="./bower_components/forEachAsync/forEachAsync.js"></script>
<!-- Libs -->
<script src="./lib/deardesi-utils.js"></script>
<script src="./lib/verify-config.js"></script>
<script src="./lib/deardesi-browser.js"></script>
<script src="./lib/frontmatter.js"></script>
<!-- Desi -->
<script src="./deardesi.js"></script>
<!-- UX Using Angular, but not getting fancy -->
<script src="./bower_components/angular/angular.js"></script>
<script src="./bower_components/angular-route/angular-route.js"></script>
<script src="./app.js"></script>
<script src="./views/build/build.js"></script>
<script src="./views/about/about.js"></script>
<script src="components/version/version.js"></script>
<script src="components/version/version-directive.js"></script>
<script src="components/version/interpolate-filter.js"></script>
</body>
</html>

45
views/about/about.html Normal file
View File

@ -0,0 +1,45 @@
<div ui-view="content" autocroll="false">
<div style="margin-bottom: 0;" class="jumbotron">
<div class="row">
<div class="container">
<div class="row">
<div class="col-xs-12">
<p>Dear Desi, ...</p><br/>
</div>
</div>
<div style="text-align: center;" class="col-md-6"><img ng-src="http://dropsha.re/files/fly6+.8/desi-parker-2.jpg" style="border: 5px solid white; width: 260px; height: 260px;" class="img-circle"/>
<h1>Desirae</h1>
<h3>The in-browser static blog generator
<small ng-bind="'(v%VERSION%)' | interpolate"></small>
</h3>
</div>
<div style="text-align: left;" class="col-md-6">
<div>
<legend>
<h2><span>Features</span></h2>
</legend>
<div class="row">
<div class="col-lg-12">
<ul>
<li>Builds in the Browser
<ul>
<li>Write content in Markdown, Jade, or HTML</li>
<li>Mustache Templates</li>
</ul>
</li>
<li>Git, Dropbox, or regular Folders for management</li>
<li>Go headless with Node.js support</li>
<li>Dual Licensed Apache2 and MIT</li>
<li>No Ruby version Hell - it'll still work in 6 months! :-D</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

14
views/about/about.js Normal file
View File

@ -0,0 +1,14 @@
'use strict';
angular.module('myApp.about', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/about', {
templateUrl: 'views/about/about.html',
controller: 'AboutCtrl'
});
}])
.controller('AboutCtrl', [function() {
}]);

16
views/about/view2_test.js Normal file
View File

@ -0,0 +1,16 @@
'use strict';
describe('myApp.view2 module', function() {
beforeEach(module('myApp.view2'));
describe('view2 controller', function(){
it('should ....', inject(function($controller) {
//spec body
var view2Ctrl = $controller('View2Ctrl');
expect(view2Ctrl).toBeDefined();
}));
});
});

29
views/build/build.js Normal file
View File

@ -0,0 +1,29 @@
'use strict';
angular.module('myApp.build', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/build', {
templateUrl: 'views/build/build.html',
controller: 'BuildCtrl as Build'
});
}])
.controller('BuildCtrl', [function() {
var Desi = window.Desi || require('./deardesi').Desi
, scope = this
, desi = {}
;
Desi.init(desi).then(function () {
scope.run = function () {
return Desi.runDesi(desi).then(function () { Desi.otherStuff(); })
.catch(function (e) {
console.error('A great and uncatchable error has befallen the land. Read ye here for das detalles..');
console.error(e.message);
console.error(e);
throw e;
});
};
});
}]);

View File

@ -0,0 +1,178 @@
<div class="container">
<div class="row">
<div class="page-header">
<h1>Blog Configuration</h1>
</div>
</div>
<form class="form-horizontal">
<div class="row">
<div class="col-lg-12">
<div class="well bs-component">
<fieldset>
<legend>General</legend>
<div class="form-group">
<label for="inputBlogTitle" class="col-lg-2 control-label">Title</label>
<div class="col-lg-10">
<input type="text" class="form-control" id="inputBlogTitle" placeholder="My Awesome Blog">
</div>
</div>
<div class="form-group">
<label for="inputBlogTagline" class="col-lg-2 control-label">Tagline</label>
<div class="col-lg-10">
<input type="text" class="form-control" id="inputBlogTagline" placeholder="For try-hard ethical master cleanse, 3 wolf moon Tumblr, disrupt lo-fi, narwhals and kale chips. YOLO.">
</div>
</div>
<div class="form-group">
<label for="inputBlogRoot" class="col-lg-2 control-label">Blog Root</label>
<div class="col-lg-10">
<input type="text" class="form-control" id="inputBlogRoot" disabled placeholder="./blog">
</div>
</div>
<div class="form-group">
<label for="inputBlogTheme" class="col-lg-2 control-label">Default Theme</label>
<div class="col-lg-10">
<select class="form-control" id="inputBlogTheme"
ng-options="item as item for item in ['twitter', 'sunburst']"
ng-model="themes.default"></select>
</div>
</div>
<div class="form-group">
<label for="inputBlogNav" class="col-lg-2 control-label">Navigation</label>
<div class="col-lg-10">
<div ng-repeat="nav in ['index', 'portfolio', 'archive']" class="checkbox">
<label>
<input type="checkbox" ng-model="nav.selected"> <span ng-bind="nav"></span>
</label>
</div>
<!--input type="text" class="form-control" id="inputBlogNav" disabled placeholder=""-->
</div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="well bs-component">
<fieldset>
<legend>Production</legend>
<div class="form-group">
<label for="inputProdHost" class="col-lg-3 control-label">Host</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="inputProdHost" placeholder="http://dear.desi">
</div>
</div>
<div class="form-group">
<label for="inputProdBase" class="col-lg-3 control-label">Base Path</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="inputProdBase" placeholder="/blog">
</div>
</div>
<div class="form-group">
<label for="inputProdOutput" class="col-lg-3 control-label">Output Path</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="inputProdOutput" disabled placeholder="./compiled">
</div>
</div>
</fieldset>
</div>
</div>
<div class="col-lg-6">
<div class="well bs-component">
<fieldset>
<legend>Development</legend>
<div class="form-group">
<label for="inputDevHost" class="col-lg-3 control-label">Host</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="inputDevHost" disabled placeholder="http://local.dear.desi:8080">
</div>
</div>
<div class="form-group">
<label for="inputDevBase" class="col-lg-3 control-label">Base Path</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="inputDevBase" disabled placeholder="/compiled_dev">
</div>
</div>
<div class="form-group">
<label for="inputDevOutput" class="col-lg-3 control-label">Output Path</label>
<div class="col-lg-9">
<input type="text" class="form-control" id="inputDevOutput" disabled placeholder="./compiled_dev">
</div>
</div>
</fieldset>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="well bs-component">
<fieldset>
<legend>Advanced</legend>
<div class="form-group">
<label for="inputRootConf" class="col-lg-2 control-label">Root Pages</label>
<div class="col-lg-8">
<input type="text" class="form-control" id="inputRootConf" placeholder="i.e. images">
</div>
<div class="col-lg-2">
<button class="btn" type="button">Add</button>
</div>
</div>
<div class="form-group">
<label for="inputThemesConf" class="col-lg-2 control-label">Themes</label>
<div class="col-lg-8">
<input type="text" class="form-control" id="inputThemesConf" placeholder="i.e. images">
</div>
<div class="col-lg-2">
<button class="btn" type="button">Add</button>
</div>
</div>
<div class="form-group">
<label for="inputCollectionsConf" class="col-lg-2 control-label">Collections</label>
<div class="col-lg-8">
<input type="text" class="form-control" id="inputCollectionsConf" placeholder="i.e. images">
</div>
<div class="col-lg-2">
<button class="btn" type="button">Add</button>
</div>
</div>
<div class="form-group">
<label for="inputAssetsConf" class="col-lg-2 control-label">Assets</label>
<div class="col-lg-8">
<input type="text" class="form-control" id="inputAssetsConf" placeholder="i.e. images">
</div>
<div class="col-lg-2">
<button class="btn" type="button">Add</button>
</div>
</div>
<div class="form-group">
<label for="inputWidgetsConf" class="col-lg-2 control-label">Widgets</label>
<div class="col-lg-8">
<input type="text" class="form-control" id="inputWidgetsConf" placeholder="i.e. images">
</div>
<div class="col-lg-2">
<button class="btn" type="button">Add</button>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,29 @@
'use strict';
angular.module('myApp.configure', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/configure', {
templateUrl: 'views/configure/configure.html',
controller: 'ConfigureCtrl as Configure'
});
}])
.controller('ConfigureCtrl', [function() {
var Desi = window.Desi || require('./deardesi').Desi
, scope = this
, desi = {}
;
Desi.init(desi).then(function () {
scope.run = function () {
return Desi.runDesi(desi).then(function () { Desi.otherStuff(); })
.catch(function (e) {
console.error('A great and uncatchable error has befallen the land. Read ye here for das detalles..');
console.error(e.message);
console.error(e);
throw e;
});
};
});
}]);

View File

@ -0,0 +1,16 @@
'use strict';
describe('myApp.view1 module', function() {
beforeEach(module('myApp.view1'));
describe('view1 controller', function(){
it('should ....', inject(function($controller) {
//spec body
var view1Ctrl = $controller('View1Ctrl');
expect(view1Ctrl).toBeDefined();
}));
});
});

83
views/create/create.html Normal file
View File

@ -0,0 +1,83 @@
<div class="container">
<div class="row">
<div class="page-header">
<h1>Blog Configuration</h1>
</div>
</div>
<form class="form-horizontal">
<div class="row">
<div class="col-lg-12">
<div class="well bs-component">
<fieldset>
<div class="form-group">
<label for="inputEmail" class="col-lg-2 control-label">Email</label>
<div class="col-lg-10">
<input type="text" class="form-control" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="col-lg-2 control-label">Password</label>
<div class="col-lg-10">
<input type="password" class="form-control" id="inputPassword" placeholder="Password">
<div class="checkbox">
<label>
<input type="checkbox"> Checkbox
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="textArea" class="col-lg-2 control-label">Textarea</label>
<div class="col-lg-10">
<textarea class="form-control" rows="3" id="textArea"></textarea>
<span class="help-block">A longer block of help text that breaks onto a new line and may extend beyond one line.</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Radios</label>
<div class="col-lg-10">
<div class="radio">
<label>
<input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked="">
Option one is this
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
Option two can be something else
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="select" class="col-lg-2 control-label">Selects</label>
<div class="col-lg-10">
<select class="form-control" id="select">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<br>
<select multiple="" class="form-control">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-lg-10 col-lg-offset-2">
<button class="btn btn-default">Cancel</button>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</fieldset>
<div id="source-button" class="btn btn-primary btn-xs" style="display: none;">&lt; &gt;</div></div>
</div>

29
views/create/create.js Normal file
View File

@ -0,0 +1,29 @@
'use strict';
angular.module('myApp.create', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/create', {
templateUrl: 'views/create/create.html',
controller: 'CreateCtrl as Create'
});
}])
.controller('CreateCtrl', [function() {
var Desi = window.Desi || require('./deardesi').Desi
, scope = this
, desi = {}
;
Desi.init(desi).then(function () {
scope.run = function () {
return Desi.runDesi(desi).then(function () { Desi.otherStuff(); })
.catch(function (e) {
console.error('A great and uncatchable error has befallen the land. Read ye here for das detalles..');
console.error(e.message);
console.error(e);
throw e;
});
};
});
}]);