Skip to content

Commit

Permalink
updated files
Browse files Browse the repository at this point in the history
  • Loading branch information
Spratley, Jonnie committed Dec 19, 2014
1 parent e6d387f commit 66f429d
Show file tree
Hide file tree
Showing 20 changed files with 598 additions and 921 deletions.
18 changes: 10 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* jshint camelcase:false */
var fs = require('fs');
var express = require('express');
var cmsRouter = require('./routes/cms-router.js');
'use strict';

// # Globbing
Expand All @@ -11,13 +13,18 @@ var fs = require('fs');
* @TODO - Externalize configuration for server and proxy, mongodb
*/

var startNodeServer = function(options, app){
var app = express();
var config = JSON.parse(fs.readFileSync('./config/config.json'));
var server = new cmsRouter.mount(config, app);
};

var serverEndpoint = 'http://localhost:8181';
var proxyConfig = {
proxy: {
forward: {
'/socket.io/*': serverEndpoint,
'/socket.io': serverEndpoint,
'/cms-content': serverEndpoint,
'/api': serverEndpoint
}
}
Expand Down Expand Up @@ -60,7 +67,7 @@ module.exports = function (grunt) {
tasks: ['newer:copy:styles', 'autoprefixer']
},
scripts: {
files: ['<%= yeoman.app %>/scripts/{,**/}*.js'],
files: ['<%= yeoman.app %>/scripts/{,** /}*.js'],
tasks: ['jshint:app']
},
gruntfile: {
Expand Down Expand Up @@ -96,12 +103,7 @@ module.exports = function (grunt) {
open: true,
base: ['.tmp', '<%= yeoman.app %>'],
middleware: function (connect, options) {
var express = require('express');
var fs = require('fs');
var cmsRouter = require('./routes/cms-router.js');
var app = express();
var config = JSON.parse(fs.readFileSync('./config/config.json'));
var server = new cmsRouter.mount(config, app);
startNodeServer(options, connect);
return [
require('json-proxy').initialize(proxyConfig),
mountFolder(connect, '.grunt'),
Expand Down
28 changes: 16 additions & 12 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@
<!-- build:js({.tmp,app}) scripts/scripts.js -->
<script src="scripts/config.js"></script>
<script src="scripts/app.js"></script>
<!--script src="scripts/templates.js"></script-->

<script src="scripts/templates.js"></script>
<script src="scripts/controllers/main.js"></script>
<script src="scripts/controllers/docs.js"></script>
<script src="scripts/controllers/admin.js"></script>
Expand All @@ -138,19 +139,22 @@
<script src="scripts/controllers/help.js"></script>
<script src="scripts/controllers/app.js"></script>
<script src="scripts/filters/gravatar.js"></script>
<script src="scripts/directives/cmsformgroup.js"></script>
<script src="scripts/directives/cmswidgets.js"></script>
<script src="scripts/directives/cmswidget.js"></script>
<script src="scripts/directives/cmsuploader.js"></script>
<script src="scripts/directives/cmsheader.js"></script>
<script src="scripts/directives/cmsgravatar.js"></script>

<script src="scripts/directives/cms-formgroup.js"></script>
<script src="scripts/directives/cms-widgets.js"></script>
<script src="scripts/directives/cms-widget.js"></script>
<script src="scripts/directives/cms-uploader.js"></script>
<script src="scripts/directives/cms-header.js"></script>
<script src="scripts/directives/cms-gravatar.js"></script>
<script src="scripts/services/dataservice.js"></script>

<!--script src="scripts/services/cmsdataserviceprovider.js"></script-->
<script src="scripts/services/cmsdataservicefactory.js"></script>
<script src="scripts/services/cmsusersfactory.js"></script>
<script src="scripts/services/cmsauthservice.js"></script>
<script src="scripts/services/cmssessionservice.js"></script>
<script src="scripts/services/cmsnotify.js"></script>
<script src="scripts/services/cms-dataservicefactory.js"></script>
<script src="scripts/services/cms-usersfactory.js"></script>
<script src="scripts/services/cms-authservice.js"></script>
<script src="scripts/services/cms-sessionservice.js"></script>
<script src="scripts/services/cms-socketservice.js"></script>
<script src="scripts/services/cms-notify.js"></script>

<!-- endbuild -->
</body>
Expand Down
157 changes: 77 additions & 80 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,86 +10,83 @@
* Resize textarea automatically to the size of its text content.
*
* @example
<example module='rfx'>
<file name='index.html'>
<textarea ng-model='text' r-autogrow class='input-block-level'></textarea>
<pre>{{text}}</pre>
</file>
</example>
<example module='rfx'>
<file name='index.html'>
<textarea ng-model='text' r-autogrow class='input-block-level'></textarea>
<pre>{{text}}</pre>
</file>
</example>
*/
var app;

Parse.initialize('fYHs4Flnj7vgVHm9vaFiFTSKt5Mj2Bxf9e93mTOB', 'QPFGBNHs0QQHFS54atV71oKppd3gTgaFfQIHP2VW');

app = angular.module('angularCmsApp', ['ngCookies', 'ngResource', 'ngSanitize', 'ngRoute', 'ngAnimate', 'mgcrea.ngStrap', 'fg']).config(function($routeProvider) {
var routeResolver;
routeResolver = {
delay: function($q, $timeout) {
var delay;
delay = $q.defer();
$timeout(delay.resolve, 1000);
return delay.promise;
}
};
return $routeProvider.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
}).when('/docs', {
templateUrl: 'views/docs.html',
controller: 'DocsCtrl'
}).when('/admin', {
templateUrl: 'views/admin.html',
controller: 'AdminCtrl'
}).when('/plugins', {
templateUrl: 'views/plugins.html',
controller: 'PluginsCtrl'
}).when('/themes', {
templateUrl: 'views/themes.html',
controller: 'ThemesCtrl'
}).when('/widgets', {
templateUrl: 'views/widgets.html',
controller: 'WidgetsCtrl'
}).when('/media', {
templateUrl: 'views/media.html',
controller: 'MediaCtrl'
}).when('/settings', {
templateUrl: 'views/settings.html',
controller: 'SettingsCtrl'
}).when('/users', {
templateUrl: 'views/users.html',
controller: 'UsersCtrl'
}).when('/login', {
templateUrl: 'views/login.html',
controller: 'LoginCtrl'
}).when('/register', {
templateUrl: 'views/register.html',
controller: 'RegisterCtrl'
}).when('/dashboard', {
templateUrl: 'views/dashboard.html',
controller: 'DashboardCtrl'
}).when('/profile', {
templateUrl: 'views/profile.html',
controller: 'ProfileCtrl'
}).when('/pages', {
templateUrl: 'views/pages.html',
controller: 'PagesCtrl',
resolve: {
pages: function(DataService) {
return DataService.fetch('pages').then(function(res) {
return res.data;
});
}
}
}).when('/help', {
templateUrl: 'views/help.html',
controller: 'HelpCtrl'
}).when('/forgot-password', {
templateUrl: 'views/forgot-password.html',
controller: 'ForgotPasswordCtrl'
}).when('/register', {
templateUrl: 'views/register.html',
controller: 'RegisterCtrl'
}).otherwise({
redirectTo: '/'
});
var app = angular.module('angularCmsApp', ['ngCookies', 'ngResource', 'ngSanitize', 'ngRoute', 'ngAnimate', 'mgcrea.ngStrap', 'fg']).config(function ($routeProvider) {
var routeResolver;
routeResolver = {
delay: function ($q, $timeout) {
var delay;
delay = $q.defer();
$timeout(delay.resolve, 1000);
delay.promise;
}
};
$routeProvider.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
}).when('/docs', {
templateUrl: 'views/docs.html',
controller: 'DocsCtrl'
}).when('/admin', {
templateUrl: 'views/admin.html',
controller: 'AdminCtrl'
}).when('/plugins', {
templateUrl: 'views/plugins.html',
controller: 'PluginsCtrl'
}).when('/themes', {
templateUrl: 'views/themes.html',
controller: 'ThemesCtrl'
}).when('/widgets', {
templateUrl: 'views/widgets.html',
controller: 'WidgetsCtrl'
}).when('/media', {
templateUrl: 'views/media.html',
controller: 'MediaCtrl'
}).when('/settings', {
templateUrl: 'views/settings.html',
controller: 'SettingsCtrl'
}).when('/users', {
templateUrl: 'views/users.html',
controller: 'UsersCtrl'
}).when('/login', {
templateUrl: 'views/login.html',
controller: 'LoginCtrl'
}).when('/register', {
templateUrl: 'views/register.html',
controller: 'RegisterCtrl'
}).when('/dashboard', {
templateUrl: 'views/dashboard.html',
controller: 'DashboardCtrl'
}).when('/profile', {
templateUrl: 'views/profile.html',
controller: 'ProfileCtrl'
}).when('/pages', {
templateUrl: 'views/pages.html',
controller: 'PagesCtrl',
resolve: {
pages: function (DataService) {
return DataService.fetch('pages').then(function (res) {
return res.data;
});
}
}
}).when('/help', {
templateUrl: 'views/help.html',
controller: 'HelpCtrl'
}).when('/forgot-password', {
templateUrl: 'views/forgot-password.html',
controller: 'ForgotPasswordCtrl'
}).when('/register', {
templateUrl: 'views/register.html',
controller: 'RegisterCtrl'
}).otherwise({
redirectTo: '/'
});
});
44 changes: 26 additions & 18 deletions app/scripts/controllers/app.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
'use strict';
angular.module('angularCmsApp').controller('AppCtrl', function($scope, $rootScope, $http, $log, $route, $location, $routeParams, $cookieStore, cmsSessionService, DataService) {
var App;
App = Config;
App.ds = DataService;
App.route = $routeParams;
App.session = cmsSessionService.getSession();
App.theme = $cookieStore.get('App.theme');
App.route = $route;
App.location = $location;
App.routeParams = $routeParams;
App.roles = ['guest', 'user', 'admin'];
$scope.name = 'AppCtrl';
window.App = $scope.App = $rootScope.App = App;
return angular.element(document).ready(function() {
return angular.element('.nav').bind('click', 'a', function(e) {
return $log.info(e);
});
});
angular.module('angularCmsApp').controller('AppCtrl', function ($scope, $rootScope, $http, $log, $route, $location, $routeParams, $cookieStore, cmsSessionService, DataService, cmsSocketService) {
var App;
App = angular.copy(Config);
App.ds = DataService;
App.socket = cmsSocketService;


App.route = $routeParams;
App.session = cmsSessionService.getSession();
App.theme = $cookieStore.get('App.theme');
App.route = $route;
App.location = $location;
App.routeParams = $routeParams;
App.roles = ['guest', 'user', 'admin'];


$scope.name = 'AppCtrl';

window.App = $scope.App = $rootScope.App = App;


angular.element(document).ready(function () {
angular.element('.nav').bind('click', 'a', function (e) {
$log.info(e);
});
});
});
21 changes: 11 additions & 10 deletions app/scripts/filters/markdown.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@

/**
@ngdoc filter
@name angularCmsApp.filter:markdown
@function
@description
@ngdoc filter
@name angularCmsApp.filter:markdown
@function
@description
This is a Markdown to HTML filter.
*/
'use strict';
angular.module('angularCmsApp').filter('markdown', function() {
return function(input) {
return markdown.toHTML(input);
};
angular.module('angularCmsApp').filter('markdown', function () {
return function (input) {
if(input){
return markdown.toHTML(input);
}
};
});
Loading

0 comments on commit 66f429d

Please sign in to comment.