Skip to content
This repository has been archived by the owner on Oct 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #112 from paxtonhare/102-rename-sample
Browse files Browse the repository at this point in the history
#102 - renamed sample to app
  • Loading branch information
ryanjdew committed Aug 13, 2015
2 parents bdc41ad + e5e5832 commit e719346
Show file tree
Hide file tree
Showing 23 changed files with 135 additions and 140 deletions.
27 changes: 12 additions & 15 deletions app/templates/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@
"name": "ml-node-seed",
"version": "0.0.0",
"dependencies": {
"angular": "1.4.1",
"angular-bootstrap": "~0.11.0",
"angular-cookies": "1.4.1",
"angular-highlightjs": "0.3.0",
"angular": "~1.4.3",
"angular-bootstrap": "~0.13.3",
"angular-cookies": "~1.4.3",
"angular-highlightjs": "~0.4.3",
"angular-ui-router": "~0.2.15",
"angular-ui-tinymce": "~0.0.9",
"bootstrap": "~3.3.5",
"font-awesome": "~4.3.0",
"highlightjs": "8.0.0",
"font-awesome": "~4.4.0",
"highlightjs": "~8.7.0",
"jquery": "~2.1.4",
"lodash": "3.9.3",
"lodash": "~3.10.1",
"ml-search-ng": "0.1.0",
"ml-utils": "withjam/ml-utils",
"ng-json-explorer": "8c2a0f9104"
"ng-json-explorer": "8c2a0f9104",
"angular-mocks": "~1.4.3"
},
"devDependencies": {
"angular-mocks": "1.4.1",
"sinon": "http://sinonjs.org/releases/sinon-1.12.1.js",
"bardjs": "~0.1.0"
},
"resolutions": {
"lodash": "3.9.3",
"angular": "1.4.1"
"angular-mocks": "1.4.3",
"sinon": "http://sinonjs.org/releases/sinon-1.15.4.js",
"bardjs": "~0.1.5"
}
}
9 changes: 4 additions & 5 deletions app/templates/gulp.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module.exports = function() {
'**/*.module.js',
'**/*.js'
],
less: client + 'styles/main.less',
less: client + 'styles/**/*.less',
report: report,
root: root,
server: server,
Expand Down Expand Up @@ -103,9 +103,8 @@ module.exports = function() {
templateCache: {
file: 'templates.js',
options: {
module: 'sample.templates',
root: 'app/',
standalone: true
module: 'app',
root: 'app/'
}
},

Expand Down Expand Up @@ -147,7 +146,7 @@ module.exports = function() {
/**
* Node settings
*/
nodeServer: './node-server/app.js',
nodeServer: './node-server/node-app.js',
defaultPort: '9070'
};

Expand Down
4 changes: 1 addition & 3 deletions app/templates/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,9 @@ gulp.task('wiredep', function() {
gulp.task('inject', ['wiredep', 'styles', 'templatecache'], function() {
log('Wire up css into the html, after files are ready');

var templateCache = config.temp + config.templateCache.file;
return gulp
.src(config.index)
.pipe(inject(config.css))
.pipe(inject(templateCache, 'templates'))
.pipe(gulp.dest(config.client));
});

Expand Down Expand Up @@ -508,7 +506,7 @@ function startBrowserSync(isDev, specRunner) {
if (isDev) {
gulp.watch([config.less], ['styles'])
.on('change', changeEvent);
gulp.watch([config.html], ['styles', 'inject'])
gulp.watch([config.js], ['wiredep'])
.on('change', changeEvent);
} else {
gulp.watch([config.less, config.js, config.html], ['optimize', browserSync.reload])
Expand Down
File renamed without changes.
107 changes: 7 additions & 100 deletions app/templates/ui/app/app.js
Original file line number Diff line number Diff line change
@@ -1,113 +1,20 @@
(function () {
'use strict';

angular.module('sample', [
angular.module('app', [
'ml.common',
'ml.search',
'ml.search.tpls',
'ml.utils',
'ngJsonExplorer',
'sample.create',
'sample.detail',
'sample.esriMap',
'sample.search',
'sample.templates',
'sample.user',
'app.create',
'app.detail',
'app.esriMap',
'app.search',
'app.user',
'ui.bootstrap',
'ui.router',
'ui.tinymce'
])
.config(Config);
]);

Config.$inject = [
'$stateProvider',
'$urlMatcherFactoryProvider',
'$urlRouterProvider',
'$locationProvider'
];

function Config(
$stateProvider,
$urlMatcherFactoryProvider,
$urlRouterProvider,
$locationProvider) {

$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode(true);

function valToFromString(val) {
return val !== null ? val.toString() : val;
}

function regexpMatches(val) { // jshint validthis:true
return this.pattern.test(val);
}

$urlMatcherFactoryProvider.type('path', {
encode: valToFromString,
decode: valToFromString,
is: regexpMatches,
pattern: /.+/
});

$stateProvider
.state('root', {
url: '',
// abstract: true,
templateUrl: 'app/root/root.html',
resolve: {
user: function(userService) {
return userService.getUser();
}
}
})
.state('root.landing', {
url: '/',
templateUrl: 'app/landing/landing.html'
})
.state('root.search', {
url: '/search',
templateUrl: 'app/search/search.html',
controller: 'SearchCtrl',
controllerAs: 'ctrl'
})
.state('root.create', {
url: '/create',
templateUrl: 'app/create/create.html',
controller: 'CreateCtrl',
controllerAs: 'ctrl',
resolve: {
stuff: function() {
console.log('root.create');
return null;
}
}
})
.state('root.view', {
url: '/detail{uri:path}',
params: {
uri: {
squash: true,
value: null
}
},
templateUrl: 'app/detail/detail.html',
controller: 'DetailCtrl',
controllerAs: 'ctrl',
resolve: {
doc: function(MLRest, $stateParams) {
var uri = $stateParams.uri;
return MLRest.getDocument(uri, { format: 'json' }).then(function(response) {
return response.data;
});
}
}
})
.state('root.profile', {
url: '/profile',
templateUrl: 'app/user/profile.html',
controller: 'ProfileCtrl',
controllerAs: 'ctrl'
});
}
}());
2 changes: 1 addition & 1 deletion app/templates/ui/app/create/create.controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function () {
'use strict';

angular.module('sample.create')
angular.module('app.create')
.controller('CreateCtrl', CreateCtrl);

CreateCtrl.$inject = ['$scope', 'MLRest', '$state', 'userService'];
Expand Down
2 changes: 1 addition & 1 deletion app/templates/ui/app/create/create.controller.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
var nextState;

beforeEach(function() {
bard.appModule('sample.create');
bard.appModule('app.create');
bard.inject('$controller', '$q', '$rootScope', 'MLRest', '$state', 'userService');

bard.mockService(MLRest, {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/ui/app/create/create.module.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function () {
'use strict';

angular.module('sample.create', ['ml.common', 'sample.user']);
angular.module('app.create', ['ml.common', 'app.user']);
}());
2 changes: 1 addition & 1 deletion app/templates/ui/app/detail/detail.controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function () {
'use strict';

angular.module('sample.detail')
angular.module('app.detail')
.controller('DetailCtrl', DetailCtrl);

DetailCtrl.$inject = ['doc'];
Expand Down
2 changes: 1 addition & 1 deletion app/templates/ui/app/detail/detail.controller.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
var doc;

beforeEach(function() {
bard.appModule('sample.detail');
bard.appModule('app.detail');
bard.inject('$controller', '$rootScope');
});

Expand Down
2 changes: 1 addition & 1 deletion app/templates/ui/app/detail/detail.module.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function () {
'use strict';

angular.module('sample.detail', []);
angular.module('app.detail', []);
}());
2 changes: 1 addition & 1 deletion app/templates/ui/app/esri-map/esri-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict';

angular.module('sample.esriMap', [])
angular.module('app.esriMap', [])
.directive('esriMap', EsriMapDirective)
.controller('EsriDetailMapController', EsriDetailMapController);

Expand Down
94 changes: 94 additions & 0 deletions app/templates/ui/app/route/routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
(function () {
'use strict';

angular.module('app')
.config(Config);

Config.$inject = ['$stateProvider', '$urlMatcherFactoryProvider',
'$urlRouterProvider', '$locationProvider'
];

function Config(
$stateProvider,
$urlMatcherFactoryProvider,
$urlRouterProvider,
$locationProvider) {

$urlRouterProvider.otherwise('/');
$locationProvider.html5Mode(true);

function valToFromString(val) {
return val !== null ? val.toString() : val;
}

function regexpMatches(val) { // jshint validthis:true
return this.pattern.test(val);
}

$urlMatcherFactoryProvider.type('path', {
encode: valToFromString,
decode: valToFromString,
is: regexpMatches,
pattern: /.+/
});

$stateProvider
.state('root', {
url: '',
// abstract: true,
templateUrl: 'app/root/root.html',
resolve: {
user: function(userService) {
return userService.getUser();
}
}
})
.state('root.landing', {
url: '/',
templateUrl: 'app/landing/landing.html'
})
.state('root.search', {
url: '/search',
templateUrl: 'app/search/search.html',
controller: 'SearchCtrl',
controllerAs: 'ctrl'
})
.state('root.create', {
url: '/create',
templateUrl: 'app/create/create.html',
controller: 'CreateCtrl',
controllerAs: 'ctrl',
resolve: {
stuff: function() {
return null;
}
}
})
.state('root.view', {
url: '/detail{uri:path}',
params: {
uri: {
squash: true,
value: null
}
},
templateUrl: 'app/detail/detail.html',
controller: 'DetailCtrl',
controllerAs: 'ctrl',
resolve: {
doc: function(MLRest, $stateParams) {
var uri = $stateParams.uri;
return MLRest.getDocument(uri, { format: 'json' }).then(function(response) {
return response.data;
});
}
}
})
.state('root.profile', {
url: '/profile',
templateUrl: 'app/user/profile.html',
controller: 'ProfileCtrl',
controllerAs: 'ctrl'
});
}
}());
2 changes: 1 addition & 1 deletion app/templates/ui/app/search/search.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(function () {
'use strict';

angular.module('sample.search')
angular.module('app.search')
.controller('SearchCtrl', SearchCtrl);

SearchCtrl.$inject = ['$scope', '$location', 'userService', 'MLSearchFactory'];
Expand Down
2 changes: 1 addition & 1 deletion app/templates/ui/app/search/search.controller.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
];

beforeEach(function() {
bard.appModule('sample.search');
bard.appModule('app.search');
bard.inject('$controller', '$q', '$rootScope', '$location',
'userService', 'MLSearchFactory', 'MLRest');

Expand Down
2 changes: 1 addition & 1 deletion app/templates/ui/app/search/search.module.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function () {
'use strict';

angular.module('sample.search', ['ml.search', 'sample.user']);
angular.module('app.search', ['ml.search', 'app.user']);
}());
Loading

0 comments on commit e719346

Please sign in to comment.