Skip to content

Commit afb0fb2

Browse files
committed
Sample Repo
1 parent 6d15e1a commit afb0fb2

13 files changed

+1937
-0
lines changed

.gitignore

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
2+
# Created by https://www.gitignore.io/api/windows,macos,node,bower
3+
4+
### Bower ###
5+
bower_components
6+
.bower-cache
7+
.bower-registry
8+
.bower-tmp
9+
10+
### macOS ###
11+
*.DS_Store
12+
.AppleDouble
13+
.LSOverride
14+
15+
# Icon must end with two \r
16+
Icon
17+
18+
19+
# Thumbnails
20+
._*
21+
22+
# Files that might appear in the root of a volume
23+
.DocumentRevisions-V100
24+
.fseventsd
25+
.Spotlight-V100
26+
.TemporaryItems
27+
.Trashes
28+
.VolumeIcon.icns
29+
.com.apple.timemachine.donotpresent
30+
31+
# Directories potentially created on remote AFP share
32+
.AppleDB
33+
.AppleDesktop
34+
Network Trash Folder
35+
Temporary Items
36+
.apdisk
37+
38+
### Node ###
39+
# Logs
40+
logs
41+
*.log
42+
npm-debug.log*
43+
44+
# Runtime data
45+
pids
46+
*.pid
47+
*.seed
48+
*.pid.lock
49+
50+
# Directory for instrumented libs generated by jscoverage/JSCover
51+
lib-cov
52+
53+
# Coverage directory used by tools like istanbul
54+
coverage
55+
56+
# nyc test coverage
57+
.nyc_output
58+
59+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
60+
.grunt
61+
62+
# Bower dependency directory (https://bower.io/)
63+
64+
# node-waf configuration
65+
.lock-wscript
66+
67+
# Compiled binary addons (http://nodejs.org/api/addons.html)
68+
build/Release
69+
70+
# Dependency directories
71+
node_modules
72+
jspm_packages
73+
74+
# Optional npm cache directory
75+
.npm
76+
77+
# Optional eslint cache
78+
.eslintcache
79+
80+
# Optional REPL history
81+
.node_repl_history
82+
83+
# Output of 'npm pack'
84+
*.tgz
85+
86+
# Yarn Integrity file
87+
.yarn-integrity
88+
89+
# dotenv environment variables file
90+
.env
91+
92+
93+
### Windows ###
94+
# Windows thumbnail cache files
95+
Thumbs.db
96+
ehthumbs.db
97+
ehthumbs_vista.db
98+
99+
# Folder config file
100+
Desktop.ini
101+
102+
# Recycle Bin used on file shares
103+
$RECYCLE.BIN/
104+
105+
# Windows Installer files
106+
*.cab
107+
*.msi
108+
*.msm
109+
*.msp
110+
111+
# Windows shortcuts
112+
*.lnk
113+
114+
# End of https://www.gitignore.io/api/windows,macos,node,bower

.shippable.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
language: node_js
2+
3+
node_js:
4+
- 0.10.25
5+
install:
6+
- npm install -g karma karma-cli bower gulp
7+
- npm install
8+
#- bower install
9+
# Make folders for the reports, and create the SQL db
10+
before_script:
11+
12+
13+
script:
14+
- npm test
15+
#- mv shippable/codecoverage/*/coverage.xml shippable/codecoverage
16+
after_script:
17+
18+
after_success :
19+
- if [ "$BRANCH" == "master" ] ; then DEPLOY_SERVER="prod" ; else DEPLOY_SERVER="staging" ; fi
20+
- echo $DEPLOY_SERVER
21+
#- git push [email protected]:avi-hot-static.git $COMMIT:master --force
22+
#- git push [email protected]:avi-hot-static.git master --force
23+
- echo $BRANCH
24+
- echo $BRANCH
25+
- echo $BUILD_NUMBER
26+
- echo $BUILD_URL
27+
- echo $COMMIT
28+
- echo $DEBIAN_FRONTEND
29+
- echo $JOB_ID
30+
- echo $PULL_REQUEST
31+
#- gulp

.travis.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
language: node_js
2+
3+
node_js:
4+
- 0.10.25
5+
install:
6+
- npm install -g karma karma-cli bower gulp
7+
- npm install
8+
#- bower install
9+
# Make folders for the reports, and create the SQL db
10+
before_script:
11+
12+
13+
script:
14+
- npm test
15+
#- mv shippable/codecoverage/*/coverage.xml shippable/codecoverage
16+
after_script:
17+
18+
after_success :
19+
- if [ "$BRANCH" == "master" ] ; then DEPLOY_SERVER="prod" ; else DEPLOY_SERVER="staging" ; fi
20+
- echo $DEPLOY_SERVER
21+
#- git push [email protected]:avi-hot-static.git $COMMIT:master --force
22+
#- git push [email protected]:avi-hot-static.git master --force
23+
- echo $BRANCH
24+
- echo $BRANCH
25+
- echo $BUILD_NUMBER
26+
- echo $BUILD_URL
27+
- echo $COMMIT
28+
- echo $DEBIAN_FRONTEND
29+
- echo $JOB_ID
30+
- echo $PULL_REQUEST
31+
#- gulp

js/book.controller.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
angular.module('playlistModule')
2+
3+
.controller('BookController', function($scope, $routeParams) {
4+
$scope.name = 'BookController';
5+
$scope.params = $routeParams;
6+
});

js/book.controller.spec.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
describe('Book controller', function() {
2+
beforeEach(module('playlistModule'));
3+
4+
var $controller;
5+
6+
beforeEach(inject(function(_$controller_){
7+
// The injector unwraps the underscores (_) from around the parameter names when matching
8+
$controller = _$controller_;
9+
}));
10+
11+
it('has a dummy spec to test 2 + 2', function() {
12+
// An intentionally failing test. No code within expect() will never equal 4.
13+
expect(2+2).toEqual(4);
14+
});
15+
it('has a dummy spec to test 3 + 2', function() {
16+
// An intentionally failing test. No code within expect() will never equal 4.
17+
expect(3+2).toEqual(5);
18+
});
19+
20+
describe('$scope.name', function() {
21+
it('names the controller', function() {
22+
var $scope = {};
23+
var $routeParams = {};
24+
var controller = $controller('BookController', { $scope: $scope, $routeParams: $routeParams });
25+
expect($scope.name).toEqual('BookController');
26+
});
27+
});
28+
});

js/chapter.controller.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
angular.module('playlistModule')
2+
3+
.controller('ChapterController', function($scope, $routeParams) {
4+
$scope.name = 'ChapterController';
5+
$scope.params = $routeParams;
6+
});

js/main.controller.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
angular.module('playlistModule')
2+
3+
.controller('MainController', function($scope, $route, $routeParams, $location) {
4+
$scope.$route = $route;
5+
$scope.$location = $location;
6+
$scope.$routeParams = $routeParams;
7+
});

js/playlist.controller.js

Whitespace-only changes.

js/playlist.module.js

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Parts of code: https://docs.angularjs.org/api/ngRoute/service/$route
2+
angular.module('playlistModule', ['ngRoute'])
3+
4+
.config(function($routeProvider, $locationProvider) {
5+
$routeProvider
6+
// Loren Routes Below Here (these comments prevent git from getting confused)
7+
.when('/Book/:bookId', {
8+
templateUrl: './templates/book.html',
9+
controller: 'BookController',
10+
resolve: {
11+
// I will cause a 1 second delay
12+
delay: function($q, $timeout) {
13+
var delay = $q.defer();
14+
$timeout(delay.resolve, 1000);
15+
return delay.promise;
16+
}
17+
}
18+
})
19+
// Ashfaq Dawood Below Here
20+
21+
// Shaobo Zhang Below Here
22+
23+
// Chunlin Wang Below Here
24+
25+
// Final route here (to get the semicolon)
26+
27+
.when('/Book/:bookId/ch/:chapterId', {
28+
templateUrl: './templates/chapter.html',
29+
controller: 'ChapterController'
30+
});
31+
32+
33+
34+
// configure html5 to get links working on jsfiddle
35+
$locationProvider.html5Mode(true);
36+
}).run(function($rootScope) {
37+
$rootScope.baseURL = 'http://test.com';
38+
// instance-injector
39+
// This is an example of a run block.
40+
// You can have as many of these as you want.
41+
// You can only inject instances (not Providers)
42+
// into run blocks
43+
}).factory('Entry', function($resource) {
44+
// https://www.sitepoint.com/creating-crud-app-minutes-angulars-resource/
45+
return $resource('/api/entries/:id'); // Note the full endpoint address
46+
});

karma.conf.js

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Karma configuration
2+
// Generated on Mon Feb 27 2017 15:19:23 GMT-0500 (EST)
3+
4+
module.exports = function(config) {
5+
config.set({
6+
7+
// base path that will be used to resolve all patterns (eg. files, exclude)
8+
basePath: '',
9+
10+
11+
// frameworks to use
12+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
13+
frameworks: ['jasmine'],
14+
15+
16+
// list of files / patterns to load in the browser
17+
files: [
18+
'./node_modules/angular/angular.js',
19+
'./node_modules/angular-route/angular-route.js',
20+
'./node_modules/angular-mocks/angular-mocks.js',
21+
'./js/playlist.module.js',
22+
'./js/*.controller.js',
23+
'./js/*.controller.spec.js'
24+
],
25+
26+
27+
// list of files to exclude
28+
exclude: [
29+
],
30+
31+
32+
// preprocess matching files before serving them to the browser
33+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
34+
preprocessors: {
35+
},
36+
37+
38+
// test results reporter to use
39+
// possible values: 'dots', 'progress'
40+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
41+
reporters: ['progress'],
42+
43+
44+
// web server port
45+
port: 9876,
46+
47+
48+
// enable / disable colors in the output (reporters and logs)
49+
colors: true,
50+
51+
52+
// level of logging
53+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
54+
logLevel: config.LOG_INFO,
55+
56+
// enable / disable watching file and executing tests whenever any file changes
57+
autoWatch: false,
58+
59+
// start these browsers
60+
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
61+
browsers: ['PhantomJS'],
62+
63+
// Continuous Integration mode
64+
// if true, Karma captures browsers, runs the tests and exits
65+
singleRun: true,
66+
67+
coverageReporter: {
68+
reporters: [{
69+
type: 'html',
70+
dir: 'shippable/codecoverage/'
71+
}, {
72+
type: 'cobertura',
73+
dir: 'shippable/codecoverage/',
74+
file: 'coverage.xml'
75+
}]
76+
},
77+
junitReporter: {
78+
outputFile: 'shippable/testresults/unit.xml',
79+
suite: ''
80+
},
81+
82+
})
83+
}

package.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "webfrontend",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.html",
6+
"directories": {
7+
"test": "test"
8+
},
9+
"dependencies": {
10+
"angular-http-server": "^1.0.7"
11+
},
12+
"devDependencies": {
13+
"angular": "^1.6.2",
14+
"angular-mocks": "^1.6.2",
15+
"angular-route": "^1.6.2",
16+
"jasmine-core": "^2.5.2",
17+
"karma": "^1.5.0",
18+
"karma-chrome-launcher": "^2.0.0",
19+
"karma-jasmine": "^1.1.0",
20+
"karma-phantomjs-launcher": "^1.0.2"
21+
},
22+
"scripts": {
23+
"test": "./node_modules/karma/bin/karma start karma.conf.js"
24+
},
25+
"author": "",
26+
"license": "ISC"
27+
}

0 commit comments

Comments
 (0)