├── .gitattributes ├── .gitignore ├── .vscode ├── launch.json └── settings.json ├── Data to Import into DocumentDB ├── ninja1.json ├── ninja2.json ├── ninja3.json ├── ninja4.json └── ninja5.json ├── ReadMe.md ├── app.js ├── aurelia.protractor.js ├── config.js ├── gulpfile.js ├── models ├── docDbDao.js ├── docdbUtils.js └── ninjas.js ├── package.json ├── protractor.conf.js ├── public └── app │ ├── .editorconfig │ ├── .gitignore │ ├── .jshintrc │ ├── .npmignore │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── aurelia.protractor.js │ ├── build │ ├── args.js │ ├── babel-options.js │ ├── paths.js │ └── tasks │ │ ├── build.js │ │ ├── clean.js │ │ ├── dev.js │ │ ├── doc.js │ │ ├── e2e.js │ │ ├── lint.js │ │ ├── prepare-release.js │ │ ├── serve.js │ │ ├── test.js │ │ └── watch.js │ ├── config.js │ ├── doc │ ├── CHANGELOG.md │ └── api.json │ ├── favicon.ico │ ├── gulpfile.js │ ├── index.html │ ├── jsconfig.json │ ├── karma.conf.js │ ├── package.json │ ├── protractor.conf.js │ ├── src │ ├── app.html │ ├── app.js │ ├── blur-image.js │ ├── child-router.html │ ├── child-router.js │ ├── clans.js │ ├── edit.html │ ├── edit.js │ ├── main.js │ ├── nav-bar.html │ ├── nav-bar.js │ ├── ninjaList.html │ ├── ninjaList.js │ ├── resources │ │ ├── date-format.js │ │ ├── index.js │ │ └── jsconfig.json │ ├── templates │ │ ├── dropdown.html │ │ ├── dropdown.html.rej │ │ ├── dropdown.js │ │ └── jsconfig.json │ ├── users.html │ ├── users.js │ ├── welcome.html │ └── welcome.js │ └── styles │ └── styles.css └── routes ├── api.js └── jsconfig.json /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Compiled binary addons (http://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directories 27 | node_modules 28 | jspm_packages 29 | 30 | # Optional npm cache directory 31 | .npm 32 | 33 | # Optional REPL history 34 | .node_repl_history 35 | # Windows image file caches 36 | Thumbs.db 37 | ehthumbs.db 38 | 39 | # Folder config file 40 | Desktop.ini 41 | 42 | # Recycle Bin used on file shares 43 | $RECYCLE.BIN/ 44 | 45 | # Windows Installer files 46 | *.cab 47 | *.msi 48 | *.msm 49 | *.msp 50 | 51 | # Windows shortcuts 52 | *.lnk 53 | 54 | # ========================= 55 | # Operating System Files 56 | # ========================= 57 | 58 | # OSX 59 | # ========================= 60 | 61 | .DS_Store 62 | .AppleDouble 63 | .LSOverride 64 | 65 | # Thumbnails 66 | ._* 67 | 68 | # Files that might appear on external disk 69 | .Spotlight-V100 70 | .Trashes 71 | 72 | # Directories potentially created on remote AFP share 73 | .AppleDB 74 | .AppleDesktop 75 | Network Trash Folder 76 | Temporary Items 77 | .apdisk 78 | 79 | # Logs 80 | logs 81 | *.log 82 | npm-debug.log* 83 | 84 | # Runtime data 85 | pids 86 | *.pid 87 | *.seed 88 | 89 | # Directory for instrumented libs generated by jscoverage/JSCover 90 | lib-cov 91 | 92 | # Coverage directory used by tools like istanbul 93 | coverage 94 | 95 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 96 | .grunt 97 | 98 | # node-waf configuration 99 | .lock-wscript 100 | 101 | # Compiled binary addons (http://nodejs.org/api/addons.html) 102 | build/Release 103 | 104 | # Dependency directories 105 | node_modules 106 | jspm_packages 107 | 108 | # Optional npm cache directory 109 | .npm 110 | 111 | # Optional REPL history 112 | .node_repl_history -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | // List of configurations. Add new configurations or edit existing ones. 4 | // ONLY "node" and "mono" are supported, change "type" to switch. 5 | "configurations": [ 6 | { 7 | // Name of configuration; appears in the launch configuration drop down menu. 8 | "name": "Launch app.js", 9 | // Type of configuration. Possible values: "node", "mono". 10 | "type": "node", 11 | // Workspace relative or absolute path to the program. 12 | "program": "${workspaceRoot}/app.js", 13 | // Automatically stop program after launch. 14 | "stopOnEntry": false, 15 | // Command line arguments passed to the program. 16 | "args": [], 17 | // Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace. 18 | "cwd": "${workspaceRoot}/.", 19 | // Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH. 20 | "runtimeExecutable": null, 21 | // Optional arguments passed to the runtime executable. 22 | "runtimeArgs": ["--nolazy"], 23 | // Environment variables passed to the program. 24 | "env": { }, 25 | // Use JavaScript source maps (if they exist). 26 | "sourceMaps": false, 27 | // If JavaScript source maps are enabled, the generated code is expected in this directory. 28 | "outDir": null 29 | }, 30 | { 31 | "name": "Attach", 32 | "type": "node", 33 | // TCP/IP address. Default is "localhost". 34 | "address": "localhost", 35 | // Port to attach to. 36 | "port": 5858, 37 | "sourceMaps": false 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | {"compilerOptions":{ 3 | "target": "ES6", 4 | "module": "system" 5 | } 6 | } -------------------------------------------------------------------------------- /Data to Import into DocumentDB/ninja1.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "1", 3 | "Name": "Kacy Catanzaro", 4 | "ServedInOniwaban": false, 5 | "Clan": "American Ninja Warriors", 6 | "Equipment": [ 7 | { 8 | "EquipmentName": "Muscles", 9 | "EquipmentType": "Tool" 10 | }, 11 | { 12 | "EquipmentName": "Spunk", 13 | "EquipmentType": "Tool" 14 | } 15 | ], 16 | "DateOfBirth": "1/14/1990", 17 | "DateCreated": "2015-08-10T20:35:09.7600000", 18 | "DateModified": "2015-08-10T20:35:09.7600000" 19 | } -------------------------------------------------------------------------------- /Data to Import into DocumentDB/ninja2.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "2", 3 | "Name": "JulieSan", 4 | "ServedInOniwaban": true, 5 | "Clan": "Turtles", 6 | "DateOfBirth": "1/1/1983", 7 | "DateCreated": "2015-08-10T20:35:09.7600000", 8 | "DateModified": "2015-08-10T20:35:09.7600000" 9 | } -------------------------------------------------------------------------------- /Data to Import into DocumentDB/ninja3.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3", 3 | "Name": "SampsonSan", 4 | "ServedInOniwaban": false, 5 | "Clan": "Vermont Clan", 6 | "DateOfBirth": "2008-01-28T00:00:00.0000000", 7 | "DateCreated": "2015-08-10T20:35:09.7600000", 8 | "DateModified": "2015-08-10T20:35:09.7600000" 9 | } -------------------------------------------------------------------------------- /Data to Import into DocumentDB/ninja4.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "4", 3 | "Name": "Leonardo", 4 | "ServedInOniwaban": true, 5 | "Clan": "Turtles", 6 | "DateOfBirth": "1984-01-01T00:00:00.0000000", 7 | "DateCreated": "2015-08-10T20:35:09.7600000", 8 | "DateModified": "2015-08-10T20:35:09.7600000" 9 | } -------------------------------------------------------------------------------- /Data to Import into DocumentDB/ninja5.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "5", 3 | "Name": "Raphael", 4 | "ServedInOniwaban": false, 5 | "Clan": "Turtles", 6 | "DateOfBirth": "1985-01-01T00:00:00.0000000", 7 | "DateCreated": "2015-08-10T20:35:09.7600000", 8 | "DateModified": "2015-08-10T20:35:09.7600000" 9 | } -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | Sample Solution to Accompany: 2 | __Aurelia Meets DocumentDB: A Matchmaker’s Journey Part 2__ 3 | April 2016: 4 | I've updated the various packages and SDKs for node, Aurelia and DocumentDB. Major changes to the app include replacing all callbacks with promises (using the Q promises wrapper for DocumentDb (https://github.com/Azure/azure-documentdb-node-q) and leveraging newer features of DocumentDB such as parameterized queries, upsert and not needing to retrieve a self-linking ID in order to do other commands on the database. 5 | 6 | December 2015 MSDN Magazine Data Points Column 7 | http://msdn.microsoft.com/en-us/magazine/mt595750 8 | by Julie Lerman 9 | Thanks to Patrick Walters (http://github.com/pwkad) for help with tech review of article and tech support with my sample! 10 | The base of this was forked from https://github.com/zewa666/aurelia-node. Another Aurelia team member who had worked out combining aurelia and node. 11 | You'll find other refs within the article. 12 | 13 | This solution needs some TLC before you can use it. It will run on Windows and OSX. I have not tested it out on Linux. 14 | 15 | Part is to create the Azure DocumentDB sample database in your Azure account. 16 | Another of the setup is to get the Aurelia & Node solution set up to run. 17 | 18 | __Creating the Azure DocumentDB account:__ 19 | You will need an Azure account. If you don't have one, there is a free monthly allotment that comes with an MSDN Subscription. If you don't have an MSDN subscription, you can get a one month trial here: https://azure.microsoft.com/en-us/pricing/free-trial/. 20 | 21 | Follow the documentation to 22 | 1) Create a Database Account (https://azure.microsoft.com/en-us/documentation/articles/documentdb-create-account/) 23 | 2) Create a Database (https://azure.microsoft.com/en-us/documentation/articles/documentdb-create-database/) 24 | 3) Create a Collection (https://azure.microsoft.com/en-us/documentation/articles/documentdb-create-collection/) 25 | 26 | __Modify the code to use the Azure DocumentDB__ 27 | My configuration expects a database named Ninjas and a collection named Ninjas. But you can modify the config to reflect the names you chose. 28 | 29 | 4) Modify the config.js file in the root folder of the sample solution (shown below). 30 | 5) Replace YOURDOCUMENTDBACCOUNTNAME with the name of your account. 31 | 6) Replace THE MASTER KEY FOR YOUR DOCUMENTDB ACCOUNT with your key which can be found under "All Settings" and then "Keys" in the Azure portal info for your DocumentDB. You'll want the Primary key. 32 | 33 | __config.js file contents__ 34 | var config = {} 35 | config.host = process.env.HOST || "https://YOURDOCUMENTDBACCOUNTNAME.documents.azure.com:443/"; 36 | config.authKey = process.env.AUTH_KEY || "THE MASTER KEY FOR YOUR DOCUMENTDB ACCOUNT"; 37 | config.databaseId = "Ninjas"; 38 | config.collectionId = "Ninjas"; 39 | module.exports = config; 40 | 41 | 42 | 7) Import the five json documents found in this download. Simple steps for this can be found in the documentation ("Document Explorer navigation options and advanced settings"), under the section "Bulk add documents with Document Explorer". 43 | 44 | __Requirements to run the Aurelia sample:__ 45 | 1) This requires that Node.JS is installed on your computer. Find that at nodejs.org. 46 | 2) It also requires Git to be installed on your computer. Find that at git-scm.com. 47 | 48 | The zip file contains most of what you need but you will need to reinstall some APIs. Here is how: 49 | 50 | In the root folder, run: 51 | 3) npm install 52 | Note: If you see a lot of WARN and ERR! statements along the way, but the bulk of logging is normal, don't worry about them (like I used to). 53 | 54 | In the public/app folder run these commands one at a time: 55 | 4) npm install -g 56 | 5) npm install -g gulp 57 | 6) npm install -g jspm 58 | 7) jspm install 59 | 60 | Note: jspm install may ask if you want to set up GitHub credentials. Here is why: 61 | jspm queries GitHub to install semver packages, but GitHub has a rate limit on anonymous API requests. 62 | It is advised that you configure jspm with your GitHub credentials in order to avoid problems. 63 | You can do this by executing jspm registry config github and following the prompts. 64 | If you choose to authorize jspm by an access token instead of giving your password 65 | (see GitHub Settings > Personal Access Tokens), public_repo access for the token is required. 66 | I have pre-installed many of the jspm packages however and this should prevent you from reaching the limit. 67 | I did this so that you didn't feel forced to create your own github account. 68 | 69 | __Running the app:__ 70 | 71 | Once all of the installs are done, go to the root folder of the solution in CMD and type 72 | __gulp watch__ 73 | 74 | This will build and deploy the source and it will also open up the browser to the default page of the site which is localhost:7000/app. It will be on the Welcome page. Welcome, Github Users and Child Router are part of the skeleton app. The Ninjas option on the menu is what I added. 75 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | /* global process */ 2 | var express = require('express'); 3 | var path = require('path'); 4 | var cookieParser = require('cookie-parser'); 5 | var bodyParser = require('body-parser'); 6 | var swig = require('swig'); 7 | 8 | var app = express(); 9 | 10 | var allowCrossDomain = function(req, res, next) { 11 | res.header('Access-Control-Allow-Origin', '*'); 12 | res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); 13 | res.header('Access-Control-Allow-Headers', 'Content-Type'); 14 | 15 | next(); 16 | }; 17 | 18 | // view engine setup 19 | app.engine('html', swig.renderFile); 20 | app.set('view engine', 'html'); 21 | app.set('views', path.join(__dirname, 'views')); 22 | 23 | app.use(bodyParser.json()); 24 | app.use(bodyParser.urlencoded({ extended: false })); 25 | app.use(allowCrossDomain); 26 | app.use(cookieParser()); 27 | app.use(express.static(path.join(__dirname, 'public'))); 28 | 29 | var api = require('./routes/api'); 30 | app.use('/', api); 31 | 32 | var debug = require('debug')('aurelia-node'); 33 | 34 | app.set('port', process.env.PORT || 9000); 35 | 36 | var server = app.listen(app.get('port'), function() { 37 | debug('Express server listening on port ' + server.address().port); 38 | }); 39 | 40 | 41 | module.exports = app; 42 | -------------------------------------------------------------------------------- /aurelia.protractor.js: -------------------------------------------------------------------------------- 1 | /* Aurelia Protractor Plugin */ 2 | function addValueBindLocator() { 3 | by.addLocator('valueBind', function (bindingModel, opt_parentElement) { 4 | var using = opt_parentElement || document; 5 | var matches = using.querySelectorAll('*[value\\.bind="' + bindingModel +'"]'); 6 | var result; 7 | 8 | if (matches.length === 0) { 9 | result = null; 10 | } else if (matches.length === 1) { 11 | result = matches[0]; 12 | } else { 13 | result = matches; 14 | } 15 | 16 | return result; 17 | }); 18 | } 19 | 20 | function loadAndWaitForAureliaPage(pageUrl) { 21 | browser.get(pageUrl); 22 | return browser.executeAsyncScript( 23 | 'var cb = arguments[arguments.length - 1];' + 24 | 'document.addEventListener("aurelia-composed", function (e) {' + 25 | ' cb("Aurelia App composed")' + 26 | '}, false);' 27 | ).then(function(result){ 28 | console.log(result); 29 | return result; 30 | }); 31 | } 32 | 33 | function waitForHttpDone() { 34 | return browser.executeAsyncScript( 35 | 'var cb = arguments[arguments.length - 1];' + 36 | 'document.addEventListener("aurelia-http-client-requests-drained", function (e) {' + 37 | ' cb(true)' + 38 | '}, false);' 39 | ).then(function(result){ 40 | return result; 41 | }); 42 | } 43 | 44 | /* Plugin hooks */ 45 | exports.setup = function(config) { 46 | // Ignore the default Angular synchronization helpers 47 | browser.ignoreSynchronization = true; 48 | 49 | // add the aurelia specific valueBind locator 50 | addValueBindLocator(); 51 | 52 | // attach a new way to browser.get a page and wait for Aurelia to complete loading 53 | browser.loadAndWaitForAureliaPage = loadAndWaitForAureliaPage; 54 | 55 | // wait for all http requests to finish 56 | browser.waitForHttpDone = waitForHttpDone; 57 | }; 58 | 59 | exports.teardown = function(config) {}; 60 | exports.postResults = function(config) {}; -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | var config = {} 2 | 3 | config.host = process.env.HOST || "https://msdndatapoints.documents.azure.com:443/"; 4 | //I will be changing my personal auth keys after pushing this to git. sorry 5 | config.authKey = process.env.AUTH_KEY || "XN288CuHCsGn/wghvQMSUdSGGg2bu9vYhqJOopOnwa9Fj+fqSmofSzt7xR8C35jEeeEe3HaGCvSNLdo24e5BjQ=="; 6 | config.databaseId = "Ninjas"; 7 | config.collectionId = "Ninjas"; 8 | 9 | module.exports = config; -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var runSequence = require('run-sequence'); 3 | var del = require('del'); 4 | var vinylPaths = require('vinyl-paths'); 5 | var babel = require('gulp-babel'); 6 | var jshint = require('gulp-jshint'); 7 | var stylish = require('jshint-stylish'); 8 | var yuidoc = require("gulp-yuidoc"); 9 | // var changelog = require('conventional-changelog'); 10 | var assign = Object.assign || require('object-assign'); 11 | var fs = require('fs'); 12 | var bump = require('gulp-bump'); 13 | var browserSync = require('browser-sync'); 14 | var changed = require('gulp-changed'); 15 | var plumber = require('gulp-plumber'); 16 | var tools = require('aurelia-tools'); 17 | var nodemon = require('gulp-nodemon'); 18 | 19 | var path = { 20 | source:'public/app/src/**/*.js', 21 | html:'public/app/src/**/*.html', 22 | style:'public/app/styles/**/*.css', 23 | output:'public/app/dist/', 24 | doc:'public/app/doc' 25 | }; 26 | 27 | var compilerOptions = { 28 | modules: 'system', 29 | moduleIds: false, 30 | comments: false, 31 | compact: false, 32 | stage:2, 33 | optional: [ 34 | "es7.decorators", 35 | "es7.classProperties" 36 | ] 37 | }; 38 | 39 | var jshintConfig = {esnext:true}; 40 | 41 | gulp.task('default', ['watch']); 42 | 43 | gulp.task('clean', function() { 44 | return gulp.src([path.output]) 45 | .pipe(vinylPaths(del)); 46 | }); 47 | 48 | gulp.task('build-system', function () { 49 | return gulp.src(path.source) 50 | .pipe(plumber()) 51 | .pipe(changed(path.output, {extension: '.js'})) 52 | .pipe(babel(assign({}, compilerOptions, {modules:'system'}))) 53 | .pipe(gulp.dest(path.output)); 54 | }); 55 | 56 | gulp.task('build-html', function () { 57 | return gulp.src(path.html) 58 | .pipe(changed(path.output, {extension: '.html'})) 59 | .pipe(gulp.dest(path.output)); 60 | }); 61 | 62 | gulp.task('lint', function() { 63 | return gulp.src(path.source) 64 | .pipe(jshint(jshintConfig)) 65 | .pipe(jshint.reporter(stylish)); 66 | }); 67 | 68 | gulp.task('doc-generate', function(){ 69 | return gulp.src(path.source) 70 | .pipe(yuidoc.parser(null, 'api.json')) 71 | .pipe(gulp.dest(path.doc)); 72 | }); 73 | 74 | gulp.task('doc', ['doc-generate'], function(){ 75 | tools.transformAPIModel(path.doc); 76 | }); 77 | 78 | gulp.task('bump-version', function(){ 79 | return gulp.src(['./package.json']) 80 | .pipe(bump({type:'patch'})) //major|minor|patch|prerelease 81 | .pipe(gulp.dest('./')); 82 | }); 83 | 84 | // gulp.task('changelog', function(callback) { 85 | // var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); 86 | // 87 | // return changelog({ 88 | // repository: pkg.repository.url, 89 | // version: pkg.version, 90 | // file: path.doc + '/CHANGELOG.md' 91 | // }, function(err, log) { 92 | // fs.writeFileSync(path.doc + '/CHANGELOG.md', log); 93 | // }); 94 | // }); 95 | 96 | gulp.task('build', function(callback) { 97 | return runSequence( 98 | 'clean', 99 | ['build-system', 'build-html'], 100 | callback 101 | ); 102 | }); 103 | 104 | gulp.task('update-own-deps', function(){ 105 | tools.updateOwnDependenciesFromLocalRepositories(); 106 | }); 107 | 108 | gulp.task('browser-sync', ['build', 'nodemon'], function() { 109 | browserSync.init({ 110 | files: ['public/**/*.*'], 111 | proxy: 'http://localhost:9000', 112 | port: 7000, 113 | browser: ['google chrome'] 114 | }); 115 | }); 116 | 117 | function reportChange(event){ 118 | console.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); 119 | } 120 | 121 | gulp.task('nodemon', function (cb) { 122 | var called = false; 123 | return nodemon({ 124 | script: 'app.js' 125 | }) 126 | .on('start', function onStart() { 127 | if (!called) { 128 | cb(); 129 | } 130 | called = true; 131 | }) 132 | .on('restart', function onRestart() { 133 | 134 | setTimeout(function reload() { 135 | browserSync.reload({ 136 | stream: false 137 | }); 138 | }, 500); 139 | }); 140 | }); 141 | 142 | gulp.task('watch', ['nodemon', 'browser-sync'], function() { 143 | gulp.watch(path.source, ['build-system', browserSync.reload]).on('change', reportChange); 144 | gulp.watch(path.html, ['build-html', browserSync.reload]).on('change', reportChange); 145 | gulp.watch(path.style, browserSync.reload).on('change', reportChange); 146 | }); 147 | 148 | gulp.task('prepare-release', function(callback){ 149 | return runSequence( 150 | 'build', 151 | 'lint', 152 | 'bump-version', 153 | 'doc', 154 | // 'changelog', 155 | callback 156 | ); 157 | }); 158 | -------------------------------------------------------------------------------- /models/docDbDao.js: -------------------------------------------------------------------------------- 1 | var DocumentDBClient = require('documentdb-q-promises').DocumentClientWrapper; 2 | 3 | var docdbUtils = require('./docdbUtils'); 4 | 5 | function docDbDao(documentDBClient, databaseId, collectionId) { 6 | this.client = documentDBClient; 7 | this.databaseId = databaseId; 8 | this.collectionId = collectionId; 9 | 10 | this.database = null; 11 | this.collection = null; 12 | 13 | 14 | } 15 | 16 | module.exports = docDbDao; 17 | 18 | docDbDao.prototype = { 19 | 20 | init: function () { 21 | var self = this; 22 | 23 | docdbUtils.getOrCreateDatabase(self.client, self.databaseId) 24 | .then(function (db) { 25 | self.database = db; 26 | docdbUtils.getOrCreateCollection(self.client, self.database._self, self.collectionId) 27 | .then(function (coll) { 28 | self.collection = coll; 29 | }, function (err) { 30 | return err; 31 | }); 32 | }, 33 | function (err) { 34 | return err; 35 | }); 36 | 37 | ; 38 | } 39 | , 40 | 41 | find: function (querySpec) { 42 | var self = this; 43 | 44 | return self.client.queryDocuments(self.collection._self, querySpec).toArrayAsync() 45 | .then(function (results) { 46 | return results.feed; 47 | }, 48 | function (err) { 49 | return err; 50 | } 51 | ) 52 | } 53 | , 54 | 55 | addItem: function (item, callback) { 56 | var self = this; 57 | 58 | item.date = Date.now(); 59 | item.completed = false; 60 | 61 | self.client.createDocument(self.collection._self, item, function (err, doc) { 62 | if (err) { 63 | callback(err); 64 | 65 | } else { 66 | callback(null, doc); 67 | } 68 | }); 69 | }, 70 | 71 | updateItem: function (item) { 72 | var self = this; 73 | //replaceDocument was repleced with upsert feature for Node (& other) DocDB SDKs 74 | //no longer need to get doc first in order to use _self 75 | var docLink = "dbs/Ninjas/colls/Ninjas"; 76 | 77 | item.DateModified = Date.now(); 78 | 79 | //upsert takes ID from item. be sure property name is same as db (even casing) 80 | return self.client.upsertDocumentAsync(docLink, item).then(function (replaced) { 81 | return replaced; 82 | }, 83 | function (err) { 84 | return err; 85 | } 86 | ); 87 | }, 88 | 89 | 90 | getItem: function (itemId) { 91 | var self = this; 92 | 93 | var querySpec = { 94 | query: 'SELECT * FROM root r WHERE r.id=@id', 95 | parameters: [{ 96 | name: '@id', 97 | value: itemId 98 | }] 99 | }; 100 | 101 | return self.client.queryDocuments(self.collection._self, querySpec).toArrayAsync() 102 | .then(function (results) { 103 | return results.feed[0]; 104 | }, 105 | function (err) { 106 | return err; 107 | } 108 | ); 109 | } 110 | }; -------------------------------------------------------------------------------- /models/docdbUtils.js: -------------------------------------------------------------------------------- 1 | var DocumentClient = require('documentdb-q-promises').DocumentClientWrapper 2 | , Q = require("q"); 3 | 4 | var DocDBUtils = { 5 | 6 | getOrCreateDatabase: function (client, databaseId) { 7 | 8 | var querySpec = { 9 | query: 'SELECT * FROM root r WHERE r.id=@id', 10 | parameters: [{ 11 | name: '@id', 12 | value: databaseId 13 | }] 14 | }; 15 | 16 | return client.queryDatabases(querySpec).toArrayAsync().then(function (results) { 17 | if (results.length === 0) { 18 | var databaseSpec = { 19 | id: databaseId 20 | }; 21 | 22 | client.createDatabaseAsync(databaseDefinition) 23 | .then(function (databaseResponse) { 24 | database = databaseResponse.resource; 25 | return client.createCollectionAsync(database._self, collectionDefinition); 26 | }) 27 | .then(function (collectionResponse) { 28 | collection = collectionResponse.resource; 29 | 30 | return client.createDocumentAsync(collection._self, documentDefinition); 31 | }) 32 | .then(function (documentResponse) { 33 | var document = documentResponse.resource; 34 | console.log('Created Document with content: ', document.content); 35 | }) 36 | .fail(function (error) { 37 | console.log("An error occured", error); 38 | }) 39 | } 40 | return results.feed[0]; 41 | }, 42 | function (err) { return err; } 43 | ); 44 | 45 | }, 46 | 47 | getOrCreateCollection: function (client, databaseLink, collectionId) { 48 | 49 | var querySpec = { 50 | query: 'SELECT * FROM root r WHERE r.id=@id', 51 | parameters: [{ 52 | name: '@id', 53 | value: collectionId 54 | }] 55 | }; 56 | 57 | return client.queryCollections(databaseLink, querySpec).toArrayAsync().then(function (results) { 58 | 59 | if (results.length === 0) { 60 | var collectionSpec = { 61 | id: collectionId 62 | }; 63 | 64 | var requestOptions = { 65 | offerType: 'S1' 66 | }; 67 | 68 | client.createCollection(databaseLink, collectionSpec, requestOptions, function (err, created) { 69 | return created; 70 | }); 71 | 72 | } else { 73 | return results.feed[0]; 74 | } 75 | }, 76 | function (err) { return err; } 77 | ); 78 | } 79 | }; 80 | 81 | module.exports = DocDBUtils; -------------------------------------------------------------------------------- /models/ninjas.js: -------------------------------------------------------------------------------- 1 | var DocumentDBClient = require('documentdb-q-promises').DocumentClientWrapper; 2 | 3 | var async = require('async'); 4 | 5 | function Ninjas(docDbDao) { 6 | this.docDbDao = docDbDao; 7 | this.List = ''; 8 | 9 | } 10 | 11 | module.exports = Ninjas; 12 | 13 | Ninjas.prototype = { 14 | 15 | 16 | getNinjas: function (req, res) { 17 | var self = this; 18 | var q = ''; 19 | var querySpec = { 20 | query: 21 | 'SELECT ninja.id, ninja.Name,ninja.ServedInOniwaban,ninja.DateOfBirth FROM ninja' 22 | }; 23 | 24 | if (req.query.q != "undefined" && req.query.q > "") { 25 | querySpec.query += " WHERE CONTAINS(ninja.Name, @namepart)"; 26 | querySpec.parameters = [{ 27 | name: '@namepart', 28 | value: req.query.q 29 | }] 30 | } 31 | 32 | self.docDbDao.find(querySpec) 33 | .then(function (items) { 34 | return res.json(items); 35 | }, 36 | function (err) { return err; } 37 | ) 38 | } 39 | , 40 | 41 | 42 | getNinja: function (req, res) { 43 | var self = this; 44 | self.docDbDao.getItem(req.params.id) 45 | .then(function (items) { 46 | return res.json(items); 47 | }, 48 | function (err) { return err; } 49 | ) 50 | 51 | }, 52 | 53 | 54 | 55 | updateDetails: function (req, res) { 56 | var self = this; 57 | var ninja = req.body; 58 | self.docDbDao.updateItem(ninja).then(function () { 59 | 60 | //deprecated: res.send(200); 61 | res.status(200).end(); 62 | }, 63 | function (err) { 64 | return err; 65 | } 66 | ) 67 | }, 68 | 69 | 70 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aurelia-node", 3 | "version": "0.2.1", 4 | "description": "Example of using Aurelia within a NodeJS Express App", 5 | "scripts": { 6 | "start": "gulp watch" 7 | }, 8 | "repository": { 9 | "type": "git", 10 | "url": "git://github.com/zewa666/aurelia-node.git" 11 | }, 12 | "dependencies": { 13 | "async": "^1.4.2", 14 | "body-parser": "~1.8.1", 15 | "cookie-parser": "~1.3.3", 16 | "debug": "~2.0.0", 17 | "documentdb": "^1.2.1", 18 | "documentdb-q-promises": "~1.6.0", 19 | "express": "~4.9.0", 20 | "github": "^0.2.4", 21 | "github-download": "*", 22 | "nodemon": "^1.9.2", 23 | "swig": "^1.4.2" 24 | }, 25 | "devDependencies": { 26 | "aurelia-tools": "git://github.com/aurelia/tools.git", 27 | "browser-sync": "^1.8.1", 28 | "conventional-changelog": "0.0.11", 29 | "del": "^1.1.0", 30 | "gulp": "^3.8.10", 31 | "gulp-babel": "^5.1.0", 32 | "gulp-bump": "^0.3.1", 33 | "gulp-changed": "^1.1.0", 34 | "gulp-jshint": "^1.9.0", 35 | "gulp-nodemon": "^1.0.4", 36 | "gulp-plumber": "^0.6.6", 37 | "gulp-yuidoc": "^0.1.2", 38 | "jasmine-core": "^2.1.3", 39 | "jshint-stylish": "^1.0.0", 40 | "jspm": "^0.16.0-beta.7", 41 | "karma": "^0.12.28", 42 | "karma-babel-preprocessor": "^5.2.1", 43 | "karma-chrome-launcher": "^0.1.7", 44 | "karma-jasmine": "^0.3.5", 45 | "karma-jspm": "^1.1.5", 46 | "object-assign": "^2.0.0", 47 | "run-sequence": "^1.0.3", 48 | "vinyl-paths": "^1.0.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // An example configuration file. 2 | exports.config = { 3 | directConnect: true, 4 | 5 | // Capabilities to be passed to the webdriver instance. 6 | capabilities: { 7 | 'browserName': 'chrome' 8 | }, 9 | 10 | // Spec patterns are relative to the current working directly when 11 | // protractor is called. 12 | seleniumAddress: 'http://0.0.0.0:4444', 13 | specs: ['specs/e2e/*.js'], 14 | 15 | plugins: [{ 16 | path: 'aurelia.protractor.js' 17 | }], 18 | 19 | // Options to be passed to Jasmine-node. 20 | jasmineNodeOpts: { 21 | showColors: true, 22 | defaultTimeoutInterval: 30000 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /public/app/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # 2 space indentation 12 | [**.*] 13 | indent_style = space 14 | indent_size = 2 -------------------------------------------------------------------------------- /public/app/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | jspm_packages 3 | bower_components 4 | .idea 5 | .DS_STORE 6 | /dist 7 | build/reports 8 | -------------------------------------------------------------------------------- /public/app/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esnext": true 3 | } 4 | -------------------------------------------------------------------------------- /public/app/.npmignore: -------------------------------------------------------------------------------- 1 | jspm_packages 2 | bower_components 3 | .idea -------------------------------------------------------------------------------- /public/app/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We'd love for you to contribute and to make this project even better than it is today! If this interests you, please begin by reading [our contributing guidelines](https://github.com/DurandalProject/about/blob/master/CONTRIBUTING.md). The contributing document will provide you with all the information you need to get started. Once you have read that, you will need to also [sign our CLA](http://goo.gl/forms/dI8QDDSyKR) before we can accept a Pull Request from you. More information on the process is included in the [contributor's guide](https://github.com/DurandalProject/about/blob/master/CONTRIBUTING.md). 4 | -------------------------------------------------------------------------------- /public/app/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Durandal Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /public/app/README.md: -------------------------------------------------------------------------------- 1 | # aurelia-skeleton-navigation 2 | 3 | [![ZenHub](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.io) 4 | [![Join the chat at https://gitter.im/aurelia/discuss](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aurelia/discuss?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 5 | 6 | This skeleton is part of the [Aurelia](http://www.aurelia.io/) platform. It sets up a standard navigation-style app using gulp to build your ES6 code with the Babel compiler. Karma/Protractor/Jasmine testing is also configured. 7 | 8 | > To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/). If you have questions, we invite you to [join us on Gitter](https://gitter.im/aurelia/discuss). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting [the framework board](https://github.com/aurelia/framework#boards). 9 | 10 | ## Running The App 11 | 12 | To run the app, follow these steps. 13 | 14 | 1. Ensure that [NodeJS](http://nodejs.org/) is installed. This provides the platform on which the build tooling runs. 15 | 2. From the project folder, execute the following command: 16 | 17 | ```shell 18 | npm install 19 | ``` 20 | 3. Ensure that [Gulp](http://gulpjs.com/) is installed. If you need to install it, use the following command: 21 | 22 | ```shell 23 | npm install -g gulp 24 | ``` 25 | 4. Ensure that [jspm](http://jspm.io/) is installed. If you need to install it, use the following command: 26 | 27 | ```shell 28 | npm install -g jspm 29 | ``` 30 | > **Note:** jspm queries GitHub to install semver packages, but GitHub has a rate limit on anonymous API requests. It is advised that you configure jspm with your GitHub credentials in order to avoid problems. You can do this by executing `jspm registry config github` and following the prompts. 31 | 5. Install the client-side dependencies with jspm: 32 | 33 | ```shell 34 | jspm install -y 35 | ``` 36 | >**Note:** Windows users, if you experience an error of "unknown command unzip" you can solve this problem by doing `npm install -g unzip` and then re-running `jspm install`. 37 | 6. To run the app, execute the following command: 38 | 39 | ```shell 40 | gulp watch 41 | ``` 42 | 7. Browse to [http://localhost:9000](http://localhost:9000) to see the app. You can make changes in the code found under `src` and the browser should auto-refresh itself as you save files. 43 | 44 | > Note: At present there is a bug in the HTMLImports polyfill which only occurs on IE. We have submitted a pull request to the team with the fix. In the mean time, if you want to test on IE, you can work around the issue by explicitly adding a script tag before you load system.js. The script tag should look something like this (be sure to confirm the version number): 45 | 46 | ```html 47 | 48 | ``` 49 | 50 | ## Running The Unit Tests 51 | 52 | To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps: 53 | 54 | 1. Ensure that the [Karma](http://karma-runner.github.io/) CLI is installed. If you need to install it, use the following command: 55 | 56 | ```shell 57 | npm install -g karma-cli 58 | ``` 59 | 2. Install Aurelia libs for test visibility: 60 | 61 | ```shell 62 | jspm install aurelia-framework 63 | jspm install aurelia-http-client 64 | jspm install aurelia-router 65 | ``` 66 | 3. You can now run the tests with this command: 67 | 68 | ```shell 69 | karma start 70 | ``` 71 | 72 | ## Running The E2E Tests 73 | Integration tests are performed with [Protractor](http://angular.github.io/protractor/#/). 74 | 75 | 1. Place your E2E-Tests into the folder ```test/e2e/src``` 76 | 2. Install the necessary webdriver 77 | 78 | ```shell 79 | gulp webdriver_update 80 | ``` 81 | 82 | 3. Configure the path to the webdriver by opening the file ```protractor.conf.js``` and adjusting the ```seleniumServerJar``` property. Typically its only needed to adjust the version number. 83 | 84 | 4. Make sure your app runs and is accessible 85 | 86 | ```shell 87 | gulp watch 88 | ``` 89 | 90 | 5. In another console run the E2E-Tests 91 | 92 | ```shell 93 | gulp e2e 94 | ``` 95 | -------------------------------------------------------------------------------- /public/app/aurelia.protractor.js: -------------------------------------------------------------------------------- 1 | /* Aurelia Protractor Plugin */ 2 | function addValueBindLocator() { 3 | by.addLocator('valueBind', function (bindingModel, opt_parentElement) { 4 | var using = opt_parentElement || document; 5 | var matches = using.querySelectorAll('*[value\\.bind="' + bindingModel +'"]'); 6 | var result; 7 | 8 | if (matches.length === 0) { 9 | result = null; 10 | } else if (matches.length === 1) { 11 | result = matches[0]; 12 | } else { 13 | result = matches; 14 | } 15 | 16 | return result; 17 | }); 18 | } 19 | 20 | function loadAndWaitForAureliaPage(pageUrl) { 21 | browser.get(pageUrl); 22 | return browser.executeAsyncScript( 23 | 'var cb = arguments[arguments.length - 1];' + 24 | 'document.addEventListener("aurelia-composed", function (e) {' + 25 | ' cb("Aurelia App composed")' + 26 | '}, false);' 27 | ).then(function(result){ 28 | console.log(result); 29 | return result; 30 | }); 31 | } 32 | 33 | function waitForHttpDone() { 34 | return browser.executeAsyncScript( 35 | 'var cb = arguments[arguments.length - 1];' + 36 | 'document.addEventListener("aurelia-http-client-requests-drained", function (e) {' + 37 | ' cb(true)' + 38 | '}, false);' 39 | ).then(function(result){ 40 | return result; 41 | }); 42 | } 43 | 44 | /* Plugin hooks */ 45 | exports.setup = function(config) { 46 | // Ignore the default Angular synchronization helpers 47 | browser.ignoreSynchronization = true; 48 | 49 | // add the aurelia specific valueBind locator 50 | addValueBindLocator(); 51 | 52 | // attach a new way to browser.get a page and wait for Aurelia to complete loading 53 | browser.loadAndWaitForAureliaPage = loadAndWaitForAureliaPage; 54 | 55 | // wait for all http requests to finish 56 | browser.waitForHttpDone = waitForHttpDone; 57 | }; 58 | 59 | exports.teardown = function(config) {}; 60 | exports.postResults = function(config) {}; 61 | -------------------------------------------------------------------------------- /public/app/build/args.js: -------------------------------------------------------------------------------- 1 | var yargs = require('yargs'); 2 | 3 | var argv = yargs.argv, 4 | validBumpTypes = "major|minor|patch|prerelease".split("|"), 5 | bump = (argv.bump || 'patch').toLowerCase(); 6 | 7 | if(validBumpTypes.indexOf(bump) === -1) { 8 | throw new Error('Unrecognized bump "' + bump + '".'); 9 | } 10 | 11 | module.exports = { 12 | bump: bump 13 | }; 14 | -------------------------------------------------------------------------------- /public/app/build/babel-options.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | modules: 'system', 3 | moduleIds: false, 4 | comments: false, 5 | compact: false, 6 | stage:2, 7 | optional: [ 8 | "es7.decorators", 9 | "es7.classProperties" 10 | ] 11 | }; 12 | -------------------------------------------------------------------------------- /public/app/build/paths.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | 3 | var appRoot = 'src/'; 4 | var outputRoot = 'dist/'; 5 | 6 | module.exports = { 7 | root: appRoot, 8 | source: appRoot + '**/*.js', 9 | html: appRoot + '**/*.html', 10 | style: 'styles/**/*.css', 11 | output: outputRoot, 12 | doc:'./doc', 13 | e2eSpecsSrc: 'test/e2e/src/*.js', 14 | e2eSpecsDist: 'test/e2e/dist/' 15 | }; 16 | -------------------------------------------------------------------------------- /public/app/build/tasks/build.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var runSequence = require('run-sequence'); 3 | var changed = require('gulp-changed'); 4 | var plumber = require('gulp-plumber'); 5 | var to5 = require('gulp-babel'); 6 | var sourcemaps = require('gulp-sourcemaps'); 7 | var paths = require('../paths'); 8 | var compilerOptions = require('../babel-options'); 9 | var assign = Object.assign || require('object.assign'); 10 | 11 | // transpiles changed es6 files to SystemJS format 12 | // the plumber() call prevents 'pipe breaking' caused 13 | // by errors from other gulp plugins 14 | // https://www.npmjs.com/package/gulp-plumber 15 | gulp.task('build-system', function () { 16 | return gulp.src(paths.source) 17 | .pipe(plumber()) 18 | .pipe(changed(paths.output, {extension: '.js'})) 19 | .pipe(sourcemaps.init({loadMaps: true})) 20 | .pipe(to5(assign({}, compilerOptions, {modules:'system'}))) 21 | .pipe(sourcemaps.write({includeContent: true})) 22 | .pipe(gulp.dest(paths.output)); 23 | }); 24 | 25 | // copies changed html files to the output directory 26 | gulp.task('build-html', function () { 27 | return gulp.src(paths.html) 28 | .pipe(changed(paths.output, {extension: '.html'})) 29 | .pipe(gulp.dest(paths.output)); 30 | }); 31 | 32 | // this task calls the clean task (located 33 | // in ./clean.js), then runs the build-system 34 | // and build-html tasks in parallel 35 | // https://www.npmjs.com/package/gulp-run-sequence 36 | gulp.task('build', function(callback) { 37 | return runSequence( 38 | 'clean', 39 | ['build-system', 'build-html'], 40 | callback 41 | ); 42 | }); 43 | -------------------------------------------------------------------------------- /public/app/build/tasks/clean.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var paths = require('../paths'); 3 | var del = require('del'); 4 | var vinylPaths = require('vinyl-paths'); 5 | 6 | // deletes all files in the output path 7 | gulp.task('clean', function() { 8 | return gulp.src([paths.output]) 9 | .pipe(vinylPaths(del)); 10 | }); 11 | -------------------------------------------------------------------------------- /public/app/build/tasks/dev.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var tools = require('aurelia-tools'); 3 | 4 | // source code for the tasks called in this file 5 | // is located at: https://github.com/aurelia/tools/blob/master/src/dev.js 6 | 7 | // updates dependencies in this folder 8 | // from folders in the parent directory 9 | gulp.task('update-own-deps', function(){ 10 | tools.updateOwnDependenciesFromLocalRepositories(); 11 | }); 12 | 13 | // quickly pulls in all of the aurelia 14 | // github repos, placing them up one directory 15 | // from where the command is executed, 16 | // then runs `npm install` 17 | // and `gulp build` for each repo 18 | gulp.task('build-dev-env', function () { 19 | tools.buildDevEnv(); 20 | }); 21 | -------------------------------------------------------------------------------- /public/app/build/tasks/doc.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var tools = require('aurelia-tools'); 3 | var paths = require('../paths'); 4 | var yuidoc = require('gulp-yuidoc'); 5 | 6 | // uses yui to generate documentation to doc/api.json 7 | gulp.task('doc-generate', function(){ 8 | return gulp.src(paths.source) 9 | .pipe(yuidoc.parser(null, 'api.json')) 10 | .pipe(gulp.dest(paths.doc)); 11 | }); 12 | 13 | // takes output of doc-generate task 14 | // and cleans it up for use with aurelia 15 | // documentation app 16 | gulp.task('doc', ['doc-generate'], function(){ 17 | tools.transformAPIModel(paths.doc); 18 | }); 19 | -------------------------------------------------------------------------------- /public/app/build/tasks/e2e.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var paths = require('../paths'); 3 | var to5 = require('gulp-babel'); 4 | var plumber = require('gulp-plumber'); 5 | var gulp = require('gulp'); 6 | var webdriver_update = require('gulp-protractor').webdriver_update; 7 | var protractor = require("gulp-protractor").protractor; 8 | 9 | // for full documentation of gulp-protractor, 10 | // please check https://github.com/mllrsohn/gulp-protractor 11 | gulp.task('webdriver_update', webdriver_update); 12 | 13 | // transpiles files in 14 | // /test/e2e/src/ from es6 to es5 15 | // then copies them to test/e2e/dist/ 16 | gulp.task('build-e2e', function () { 17 | return gulp.src(paths.e2eSpecsSrc) 18 | .pipe(plumber()) 19 | .pipe(to5()) 20 | .pipe(gulp.dest(paths.e2eSpecsDist)); 21 | }); 22 | 23 | // runs build-e2e task 24 | // then runs end to end tasks 25 | // using Protractor: http://angular.github.io/protractor/ 26 | gulp.task('e2e', ['webdriver_update', 'build-e2e'], function(cb) { 27 | return gulp.src(paths.e2eSpecsDist + "/*.js") 28 | .pipe(protractor({ 29 | configFile: "protractor.conf.js", 30 | args: ['--baseUrl', 'http://127.0.0.1:9000'] 31 | })) 32 | .on('error', function(e) { throw e; }); 33 | }); 34 | -------------------------------------------------------------------------------- /public/app/build/tasks/lint.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var paths = require('../paths'); 3 | var jshint = require('gulp-jshint'); 4 | var stylish = require('jshint-stylish'); 5 | 6 | // runs jshint on all .js files 7 | gulp.task('lint', function() { 8 | return gulp.src(paths.source) 9 | .pipe(jshint()) 10 | .pipe(jshint.reporter(stylish)); 11 | }); 12 | -------------------------------------------------------------------------------- /public/app/build/tasks/prepare-release.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var runSequence = require('run-sequence'); 3 | var paths = require('../paths'); 4 | var changelog = require('conventional-changelog'); 5 | var fs = require('fs'); 6 | var bump = require('gulp-bump'); 7 | var args = require('../args'); 8 | 9 | // utilizes the bump plugin to bump the 10 | // semver for the repo 11 | gulp.task('bump-version', function(){ 12 | return gulp.src(['./package.json']) 13 | .pipe(bump({type:args.bump })) //major|minor|patch|prerelease 14 | .pipe(gulp.dest('./')); 15 | }); 16 | 17 | // generates the CHANGELOG.md file based on commit 18 | // from git commit messages 19 | gulp.task('changelog', function(callback) { 20 | var pkg = JSON.parse(fs.readFileSync('./package.json', 'utf-8')); 21 | 22 | return changelog({ 23 | repository: pkg.repository.url, 24 | version: pkg.version, 25 | file: paths.doc + '/CHANGELOG.md' 26 | }, function(err, log) { 27 | fs.writeFileSync(paths.doc + '/CHANGELOG.md', log); 28 | }); 29 | }); 30 | 31 | // calls the listed sequence of tasks in order 32 | gulp.task('prepare-release', function(callback){ 33 | return runSequence( 34 | 'build', 35 | 'lint', 36 | 'bump-version', 37 | 'doc', 38 | 'changelog', 39 | callback 40 | ); 41 | }); 42 | -------------------------------------------------------------------------------- /public/app/build/tasks/serve.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var browserSync = require('browser-sync'); 3 | 4 | // this task utilizes the browsersync plugin 5 | // to create a dev server instance 6 | // at http://localhost:9000 7 | gulp.task('serve', ['build'], function(done) { 8 | browserSync({ 9 | open: false, 10 | port: 7000, 11 | server: { 12 | baseDir: ['.'], 13 | middleware: function (req, res, next) { 14 | res.setHeader('Access-Control-Allow-Origin', '*'); 15 | next(); 16 | } 17 | } 18 | }, done); 19 | }); 20 | -------------------------------------------------------------------------------- /public/app/build/tasks/test.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var karma = require('karma').server; 3 | 4 | /** 5 | * Run test once and exit 6 | */ 7 | gulp.task('test', function (done) { 8 | karma.start({ 9 | configFile: __dirname + '/../../karma.conf.js', 10 | singleRun: true 11 | }, function(e) { 12 | done(); 13 | }); 14 | }); 15 | 16 | /** 17 | * Watch for file changes and re-run tests on each change 18 | */ 19 | gulp.task('tdd', function (done) { 20 | karma.start({ 21 | configFile: __dirname + '/../../karma.conf.js' 22 | }, function(e) { 23 | done(); 24 | }); 25 | }); 26 | 27 | /** 28 | * Run test once with code coverage and exit 29 | */ 30 | gulp.task('cover', function (done) { 31 | karma.start({ 32 | configFile: __dirname + '/../../karma.conf.js', 33 | singleRun: true, 34 | reporters: ['coverage'], 35 | preprocessors: { 36 | 'test/**/*.js': ['babel'], 37 | 'src/**/*.js': ['babel', 'coverage'] 38 | }, 39 | coverageReporter: { 40 | type: 'html', 41 | dir: 'build/reports/coverage' 42 | } 43 | }, function (e) { 44 | done(); 45 | }); 46 | }); 47 | -------------------------------------------------------------------------------- /public/app/build/tasks/watch.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var paths = require('../paths'); 3 | var browserSync = require('browser-sync'); 4 | 5 | // outputs changes to files to the console 6 | function reportChange(event){ 7 | console.log('File ' + event.path + ' was ' + event.type + ', running tasks...'); 8 | } 9 | 10 | // this task wil watch for changes 11 | // to js, html, and css files and call the 12 | // reportChange method. Also, by depending on the 13 | // serve task, it will instantiate a browserSync session 14 | gulp.task('watch', ['serve'], function() { 15 | gulp.watch(paths.source, ['build-system', browserSync.reload]).on('change', reportChange); 16 | gulp.watch(paths.html, ['build-html', browserSync.reload]).on('change', reportChange); 17 | gulp.watch(paths.style, browserSync.reload).on('change', reportChange); 18 | }); 19 | -------------------------------------------------------------------------------- /public/app/config.js: -------------------------------------------------------------------------------- 1 | System.config({ 2 | defaultJSExtensions: true, 3 | transpiler: "babel", 4 | babelOptions: { 5 | "optional": [ 6 | "es7.decorators", 7 | "es7.classProperties", 8 | "runtime" 9 | ] 10 | }, 11 | paths: { 12 | "*": "dist/*", 13 | "github:*": "jspm_packages/github/*", 14 | "npm:*": "jspm_packages/npm/*", 15 | "resources/*": "dist/resources/*.js" 16 | }, 17 | 18 | map: { 19 | "aurelia-animator-css": "npm:aurelia-animator-css@1.0.0-beta.1.2.0", 20 | "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.2", 21 | "aurelia-bootstrapper": "npm:aurelia-bootstrapper@1.0.0-beta.1.2.0", 22 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0", 23 | "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-beta.1.2.0", 24 | "aurelia-fetch-client": "npm:aurelia-fetch-client@1.0.0-beta.1.2.1", 25 | "aurelia-framework": "npm:aurelia-framework@1.0.0-beta.1.2.2", 26 | "aurelia-history": "npm:aurelia-history@1.0.0-beta.1.2.0", 27 | "aurelia-history-browser": "npm:aurelia-history-browser@1.0.0-beta.1.2.0", 28 | "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.2.0", 29 | "aurelia-loader-default": "npm:aurelia-loader-default@1.0.0-beta.1.2.1", 30 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0", 31 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 32 | "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.2.1", 33 | "aurelia-route-recognizer": "npm:aurelia-route-recognizer@1.0.0-beta.1.2.0", 34 | "aurelia-router": "npm:aurelia-router@1.0.0-beta.1.2.1", 35 | "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.2.0", 36 | "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.2", 37 | "aurelia-templating-binding": "npm:aurelia-templating-binding@1.0.0-beta.1.2.1", 38 | "aurelia-templating-resources": "npm:aurelia-templating-resources@1.0.0-beta.1.2.2", 39 | "aurelia-templating-router": "npm:aurelia-templating-router@1.0.0-beta.1.2.0", 40 | "aurelia/fetch-client": "github:aurelia/fetch-client@0.1.1", 41 | "babel": "npm:babel-core@5.8.38", 42 | "babel-runtime": "npm:babel-runtime@5.8.38", 43 | "bootstrap": "github:twbs/bootstrap@3.3.6", 44 | "core-js": "npm:core-js@0.9.18", 45 | "css": "github:systemjs/plugin-css@0.1.21", 46 | "fetch": "github:github/fetch@0.9.0", 47 | "font-awesome": "npm:font-awesome@4.6.1", 48 | "moment": "github:moment/moment@2.13.0", 49 | "github:aurelia/fetch-client@0.1.1": { 50 | "core-js": "npm:core-js@0.9.18" 51 | }, 52 | "github:jspm/nodelibs-assert@0.1.0": { 53 | "assert": "npm:assert@1.3.0" 54 | }, 55 | "github:jspm/nodelibs-process@0.1.2": { 56 | "process": "npm:process@0.11.2" 57 | }, 58 | "github:jspm/nodelibs-util@0.1.0": { 59 | "util": "npm:util@0.10.3" 60 | }, 61 | "github:twbs/bootstrap@3.3.6": { 62 | "jquery": "npm:jquery@2.2.3" 63 | }, 64 | "npm:assert@1.3.0": { 65 | "util": "npm:util@0.10.3" 66 | }, 67 | "npm:aurelia-animator-css@1.0.0-beta.1.2.0": { 68 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 69 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0", 70 | "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.2" 71 | }, 72 | "npm:aurelia-binding@1.0.0-beta.1.3.2": { 73 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 74 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0", 75 | "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.2.0" 76 | }, 77 | "npm:aurelia-bootstrapper@1.0.0-beta.1.2.0": { 78 | "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-beta.1.2.0", 79 | "aurelia-framework": "npm:aurelia-framework@1.0.0-beta.1.2.2", 80 | "aurelia-history": "npm:aurelia-history@1.0.0-beta.1.2.0", 81 | "aurelia-history-browser": "npm:aurelia-history-browser@1.0.0-beta.1.2.0", 82 | "aurelia-loader-default": "npm:aurelia-loader-default@1.0.0-beta.1.2.1", 83 | "aurelia-logging-console": "npm:aurelia-logging-console@1.0.0-beta.1.2.0", 84 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0", 85 | "aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-beta.1.2.0", 86 | "aurelia-polyfills": "npm:aurelia-polyfills@1.0.0-beta.1.1.2", 87 | "aurelia-router": "npm:aurelia-router@1.0.0-beta.1.2.1", 88 | "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.2", 89 | "aurelia-templating-binding": "npm:aurelia-templating-binding@1.0.0-beta.1.2.1", 90 | "aurelia-templating-resources": "npm:aurelia-templating-resources@1.0.0-beta.1.2.2", 91 | "aurelia-templating-router": "npm:aurelia-templating-router@1.0.0-beta.1.2.0" 92 | }, 93 | "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0": { 94 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0", 95 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 96 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0" 97 | }, 98 | "npm:aurelia-event-aggregator@1.0.0-beta.1.2.0": { 99 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0" 100 | }, 101 | "npm:aurelia-framework@1.0.0-beta.1.2.2": { 102 | "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.2", 103 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0", 104 | "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.2.0", 105 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0", 106 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 107 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0", 108 | "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.2.1", 109 | "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.2.0", 110 | "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.2" 111 | }, 112 | "npm:aurelia-history-browser@1.0.0-beta.1.2.0": { 113 | "aurelia-history": "npm:aurelia-history@1.0.0-beta.1.2.0", 114 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0" 115 | }, 116 | "npm:aurelia-loader-default@1.0.0-beta.1.2.1": { 117 | "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.2.0", 118 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 119 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0" 120 | }, 121 | "npm:aurelia-loader@1.0.0-beta.1.2.0": { 122 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 123 | "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.2.1" 124 | }, 125 | "npm:aurelia-logging-console@1.0.0-beta.1.2.0": { 126 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0", 127 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0" 128 | }, 129 | "npm:aurelia-metadata@1.0.0-beta.1.2.0": { 130 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0" 131 | }, 132 | "npm:aurelia-pal-browser@1.0.0-beta.1.2.0": { 133 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0" 134 | }, 135 | "npm:aurelia-polyfills@1.0.0-beta.1.1.2": { 136 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0" 137 | }, 138 | "npm:aurelia-route-recognizer@1.0.0-beta.1.2.0": { 139 | "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.2.1" 140 | }, 141 | "npm:aurelia-router@1.0.0-beta.1.2.1": { 142 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0", 143 | "aurelia-event-aggregator": "npm:aurelia-event-aggregator@1.0.0-beta.1.2.0", 144 | "aurelia-history": "npm:aurelia-history@1.0.0-beta.1.2.0", 145 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0", 146 | "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.2.1", 147 | "aurelia-route-recognizer": "npm:aurelia-route-recognizer@1.0.0-beta.1.2.0" 148 | }, 149 | "npm:aurelia-task-queue@1.0.0-beta.1.2.0": { 150 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0" 151 | }, 152 | "npm:aurelia-templating-binding@1.0.0-beta.1.2.1": { 153 | "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.2", 154 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0", 155 | "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.2" 156 | }, 157 | "npm:aurelia-templating-resources@1.0.0-beta.1.2.2": { 158 | "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.2", 159 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0", 160 | "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.2.0", 161 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0", 162 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 163 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0", 164 | "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.2.1", 165 | "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.2.0", 166 | "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.2" 167 | }, 168 | "npm:aurelia-templating-router@1.0.0-beta.1.2.0": { 169 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0", 170 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0", 171 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 172 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0", 173 | "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.2.1", 174 | "aurelia-router": "npm:aurelia-router@1.0.0-beta.1.2.1", 175 | "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1.2.2" 176 | }, 177 | "npm:aurelia-templating@1.0.0-beta.1.2.2": { 178 | "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.3.2", 179 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1.2.0", 180 | "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1.2.0", 181 | "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1.2.0", 182 | "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1.2.0", 183 | "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1.2.0", 184 | "aurelia-path": "npm:aurelia-path@1.0.0-beta.1.2.1", 185 | "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1.2.0" 186 | }, 187 | "npm:babel-runtime@5.8.38": { 188 | "process": "github:jspm/nodelibs-process@0.1.2" 189 | }, 190 | "npm:core-js@0.9.18": { 191 | "fs": "github:jspm/nodelibs-fs@0.1.2", 192 | "process": "github:jspm/nodelibs-process@0.1.2", 193 | "systemjs-json": "github:systemjs/plugin-json@0.1.0" 194 | }, 195 | "npm:font-awesome@4.6.1": { 196 | "css": "github:systemjs/plugin-css@0.1.21" 197 | }, 198 | "npm:inherits@2.0.1": { 199 | "util": "github:jspm/nodelibs-util@0.1.0" 200 | }, 201 | "npm:process@0.11.2": { 202 | "assert": "github:jspm/nodelibs-assert@0.1.0" 203 | }, 204 | "npm:util@0.10.3": { 205 | "inherits": "npm:inherits@2.0.1", 206 | "process": "github:jspm/nodelibs-process@0.1.2" 207 | } 208 | } 209 | }); 210 | -------------------------------------------------------------------------------- /public/app/doc/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ### 0.16.2 (2015-08-05) 2 | 3 | 4 | #### Bug Fixes 5 | 6 | * **package:** remove old framework version ([a2bec337](http://github.com/aurelia/skeleton-navigation/commit/a2bec3373bee7a65f642ba358e178e5cc7270805)) 7 | 8 | 9 | ### 0.16.1 (2015-08-05) 10 | 11 | 12 | #### Bug Fixes 13 | 14 | * **config:** correct start path by removing the js extension ([d2149e4e](http://github.com/aurelia/skeleton-navigation/commit/d2149e4e0acf8f3ce3013b6c4ca5f97a88138948)) 15 | 16 | 17 | ## 0.16.0 (2015-08-05) 18 | 19 | 20 | #### Bug Fixes 21 | 22 | * **all:** update source to work with jspm beta ([53f5cf1a](http://github.com/aurelia/skeleton-navigation/commit/53f5cf1ad0d07d8a1f1087e17a93ecb8718fca62)) 23 | * **css:** fix print styles ([dfcf28a8](http://github.com/aurelia/skeleton-navigation/commit/dfcf28a84e07a7ee62635513d836cfa8b3523a87)) 24 | * **index:** update font awesome reference ([686b337c](http://github.com/aurelia/skeleton-navigation/commit/686b337c188855bc4fc255872f09528beed20a10)) 25 | * **styles:** correct some class names ([eeed0111](http://github.com/aurelia/skeleton-navigation/commit/eeed01119b85ea000528eaff89c93d55ca5102e4)) 26 | * **users:** move the fetch polyfil load to users so the main.js isn't required ([53a3e2be](http://github.com/aurelia/skeleton-navigation/commit/53a3e2be259a68dad77d1e7976abd5efaaf82869)) 27 | 28 | 29 | #### Features 30 | 31 | * **all:** switch over to github users in place of flickr ([6fd31066](http://github.com/aurelia/skeleton-navigation/commit/6fd310664a4056f6984915b35ba245c0cf3c0b82)) 32 | 33 | 34 | ### 0.15.1 (2015-07-02) 35 | 36 | 37 | ## 0.15.0 (2015-07-02) 38 | 39 | 40 | #### Bug Fixes 41 | 42 | * **build:** include source in source maps. resolve #111 ([e6accba4](http://github.com/aurelia/skeleton-navigation/commit/e6accba4a533100f56a7040ff4010390bd9f0bad)) 43 | * **package:** reduce debug requests using core-js override ([cede89f6](http://github.com/aurelia/skeleton-navigation/commit/cede89f6768017b238aac0e73e9bf41d9a502220)) 44 | * **tests:** Fix unit tests ([8abc7741](http://github.com/aurelia/skeleton-navigation/commit/8abc7741c7b64ad0b54d7ef1f14d93bb5c0599cf)) 45 | 46 | 47 | #### Features 48 | 49 | * **routes:** name all routes ([a3cb19ce](http://github.com/aurelia/skeleton-navigation/commit/a3cb19ce63f9a53c58c36244f9cca20ead54fb32)) 50 | 51 | 52 | ## 0.14.0 (2015-06-09) 53 | 54 | 55 | #### Bug Fixes 56 | 57 | * **all:** update route config to match changes in router ([5f272a41](http://github.com/aurelia/skeleton-navigation/commit/5f272a41e8df271f4b2437472bbc0673cd2ef62d)) 58 | * **config:** 59 | * add mappings that reflect the EA deps for pre-release testing ([d7cebc67](http://github.com/aurelia/skeleton-navigation/commit/d7cebc67c0b8af43570993d4ab127d97641962c1)) 60 | * revert path config after tool change ([a1c4524b](http://github.com/aurelia/skeleton-navigation/commit/a1c4524b9f84178b70787da4d8642ed8573a0491)) 61 | * **karma:** 62 | * Fixed tests to adhere to new flickr route ([caf4838c](http://github.com/aurelia/skeleton-navigation/commit/caf4838cb44885826e6eaf7455332581f8ad8cb1)) 63 | * properly set jspm paths for karma ([75584889](http://github.com/aurelia/skeleton-navigation/commit/7558488953b860336a6b4ab3a1c8a2fb7501c122)) 64 | * **package:** update deps to latest versions ([4fa8356c](http://github.com/aurelia/skeleton-navigation/commit/4fa8356c689d3be8086ab6063dda7af3cfbdca3f)) 65 | * **styles:** change the image animation ([009f4e28](http://github.com/aurelia/skeleton-navigation/commit/009f4e2875cb1c8aea50269577ab28906b6d58bf)) 66 | * **tests:** Fix unit tests for new release ([89b75782](http://github.com/aurelia/skeleton-navigation/commit/89b75782eb1a28771475c49b29be157e4eda8e63)) 67 | * **welcome:** rename the welcome method to submit ([5e4894f3](http://github.com/aurelia/skeleton-navigation/commit/5e4894f354306f1da0e525a214a6edb3563aecba)) 68 | 69 | 70 | #### Features 71 | 72 | * **anim:** adds staggering animations ([5324e133](http://github.com/aurelia/skeleton-navigation/commit/5324e133e8ccfc64655d8362b8830ce32a56470d)) 73 | * **flickr:** move canDeactivate prompt into Welcome ([834b83a8](http://github.com/aurelia/skeleton-navigation/commit/834b83a85f2e36d978482b0ce8c61f45f68841bc)) 74 | 75 | 76 | ## 0.13.0 (2015-05-01) 77 | 78 | 79 | #### Bug Fixes 80 | 81 | * **all:** update to latest router usage ([1bb373f7](http://github.com/aurelia/skeleton-navigation/commit/1bb373f73e224f084ac8b3bc330aeffb5d9bf5f0)) 82 | * **anim:** Remove welcome class animation ([a68fc9d4](http://github.com/aurelia/skeleton-navigation/commit/a68fc9d41f866aacccb1cc1b567b18af58141d1b)) 83 | * **build:** use relative path for source maps. resolve #66 ([aaf3cc9a](http://github.com/aurelia/skeleton-navigation/commit/aaf3cc9a67f86275a94666ab328f2ca74a7f7c52)) 84 | * **flickr:** remove inline styles ([612e0ea6](http://github.com/aurelia/skeleton-navigation/commit/612e0ea67e4bf13685644ff5055f5e36ffc7ad07)) 85 | * **index:** add the viewport meta tag to ensure proper rendering and touch zooming ([0ecf0b9e](http://github.com/aurelia/skeleton-navigation/commit/0ecf0b9ea97245492bd9224dfb8cc9b940f254d1)) 86 | * **navbar:** automatically collapse the navigation menu on click ([28f3c6fa](http://github.com/aurelia/skeleton-navigation/commit/28f3c6faf1fa3d1533f6470b273bacea7ed76eb7)) 87 | * **package:** update dependencies ([dfe57813](http://github.com/aurelia/skeleton-navigation/commit/dfe57813459d012c05affa6c09acb568854c07e3)) 88 | 89 | 90 | #### Features 91 | 92 | * **anim:** Add animation example ([675d15a1](http://github.com/aurelia/skeleton-navigation/commit/675d15a153c399f524070e7cb468caae3230febe)) 93 | 94 | 95 | ## 0.12.0 (2015-04-09) 96 | 97 | 98 | #### Bug Fixes 99 | 100 | * **readme:** More info about E2E workflow ([f9b360ee](http://github.com/aurelia/skeleton-navigation/commit/f9b360ee3211b896b5b9970520bcd37dc79c2918)) 101 | * **test:** workaround for issue with jspm karma plugin ([7bf90b7e](http://github.com/aurelia/skeleton-navigation/commit/7bf90b7ef78b4375760e94c394a8f2ec0870e43e)) 102 | * **tests:** Update routes in unit tests ([fb2c02b6](http://github.com/aurelia/skeleton-navigation/commit/fb2c02b6e3dd5ba219b307bedd5be9b999c21116)) 103 | 104 | 105 | #### Features 106 | 107 | * **all:** new decorators and behavior model implemented ([e5445795](http://github.com/aurelia/skeleton-navigation/commit/e54457951a17b3f29d47555a299f9aaa06e59349)) 108 | 109 | 110 | ## 0.11.0 (2015-03-25) 111 | 112 | 113 | #### Bug Fixes 114 | 115 | * **all:** update to latest framework versions ([86378200](http://github.com/aurelia/skeleton-navigation/commit/8637820009f7bf4f4b2a08b2abaf2fae9bb2811d)) 116 | 117 | 118 | ### 0.10.2 (2015-02-28) 119 | 120 | 121 | #### Bug Fixes 122 | 123 | * **package:** update dependencies ([3a8cfc33](http://github.com/aurelia/skeleton-navigation/commit/3a8cfc33cb41e29d4199a94b43198cf62a3a1ceb)) 124 | 125 | 126 | ### 0.10.1 (2015-02-28) 127 | 128 | 129 | #### Bug Fixes 130 | 131 | * **child-router:** correct class name ([93f9bfc9](http://github.com/aurelia/skeleton-navigation/commit/93f9bfc9076a7e950d667d50c9ac75e9efb3e1f5)) 132 | * **e2e:** 133 | * remove iit in dist ([dd644b1f](http://github.com/aurelia/skeleton-navigation/commit/dd644b1f926fca5c0a59cf1a662fb246456aa9ae)) 134 | * remove iit ([340fc90d](http://github.com/aurelia/skeleton-navigation/commit/340fc90d3a558e6a5f1aed83f7d2c1080447bc33)) 135 | * **package:** update dependencies ([42b6ebbd](http://github.com/aurelia/skeleton-navigation/commit/42b6ebbd571f61d82ef7334b518dba4259559f2a)) 136 | 137 | 138 | #### Features 139 | 140 | * **e2e:** add protractor plugin, add waitMethods ([d24c5a0d](http://github.com/aurelia/skeleton-navigation/commit/d24c5a0d606c6da1c30cf54a56ca5d3e086749cb)) 141 | 142 | 143 | ## 0.10.0 (2015-02-12) 144 | 145 | 146 | #### Bug Fixes 147 | 148 | * **index:** properly load bootstrap ([c1735fdb](http://github.com/aurelia/skeleton-navigation/commit/c1735fdbd064e69567b90358dfcc5eff0fdeab37)) 149 | 150 | 151 | ### 0.9.5 (2015-02-06) 152 | 153 | 154 | #### Bug Fixes 155 | 156 | * **build:** 157 | * include root attribute on path for source maps ([e3fc2d5a](http://github.com/aurelia/skeleton-navigation/commit/e3fc2d5a26f354c2afbd2c1e1e45b96fe5d92657), closes [#26](http://github.com/aurelia/skeleton-navigation/issues/26)) 158 | * add source maps; remove sourceFileName from compiler options ([1733c4ad](http://github.com/aurelia/skeleton-navigation/commit/1733c4ad032747ecb868b420a5d6f23e9dab12ae)) 159 | * **package:** update dependencies ([025154f3](http://github.com/aurelia/skeleton-navigation/commit/025154f3c9fc9d99b6ca00bfd94d9ffc8249df5c)) 160 | * **test:** removing single it execution ([31866dc3](http://github.com/aurelia/skeleton-navigation/commit/31866dc3038fe2c1b51531620a13b88c8e3ff766)) 161 | 162 | 163 | #### Features 164 | 165 | * **e2e:** add protractor locator and e2e PO test ([2509836e](http://github.com/aurelia/skeleton-navigation/commit/2509836e8406745e55c8d3d897f8a2b7f1bb1c56)) 166 | 167 | 168 | ### 0.9.4 (2015-02-03) 169 | 170 | 171 | #### Bug Fixes 172 | 173 | * **index:** per systemjs recommendation, remove error binding ([e30cefac](http://github.com/aurelia/skeleton-navigation/commit/e30cefac419f88911a4c18085ffd59d05047e254)) 174 | * **package:** add missing depdency ([c3718827](http://github.com/aurelia/skeleton-navigation/commit/c37188278816f1c540e8b038a8dfed60dfeb0d9c)) 175 | 176 | 177 | #### Features 178 | 179 | * **gulpfile:** adds protractor configuration and gulpfile tasks for E2E-Testing ([821f4868](http://github.com/aurelia/skeleton-navigation/commit/821f4868a5d4b4ba62cc12cece943cd55ed3142f)) 180 | * **tools:** Added build-dev-env task to skeleton-navigation ([4c145095](http://github.com/aurelia/skeleton-navigation/commit/4c1450956cf1e8804ddd660beeba77546e14287f)) 181 | 182 | 183 | ### 0.9.3 (2015-01-25) 184 | 185 | 186 | #### Bug Fixes 187 | 188 | * **package:** update dependencies ([0f221d2d](http://github.com/aurelia/skeleton-navigation/commit/0f221d2d8cb79ba40b745c92d0fa64d27bfd0dbf)) 189 | 190 | 191 | ### 0.9.2 (2015-01-25) 192 | 193 | 194 | #### Bug Fixes 195 | 196 | * **gulpfile:** bug in browser sync for style content ([342a2612](http://github.com/aurelia/skeleton-navigation/commit/342a26121cf5988d73847ed02d022d13e325d5f2)) 197 | 198 | 199 | ### 0.9.1 (2015-01-24) 200 | 201 | 202 | #### Bug Fixes 203 | 204 | * **package:** 205 | * update dependencies ([d05fb6c9](http://github.com/aurelia/skeleton-navigation/commit/d05fb6c9a4148e85165e8b8594b3de9e344e85d6)) 206 | * update dependencies ([da130f4f](http://github.com/aurelia/skeleton-navigation/commit/da130f4f2919c8330f455e1b9f175d693aacf43c)) 207 | * update dependencies ([ab85bc86](http://github.com/aurelia/skeleton-navigation/commit/ab85bc865cb1607f13cb7d5b3a55f37903e61785)) 208 | 209 | 210 | #### Features 211 | 212 | * **package:** update dependencies ([86b1dd90](http://github.com/aurelia/skeleton-navigation/commit/86b1dd908206abfdca2a8f89cc246f54e761bdbd)) 213 | * **welcome:** add sample local value converter ([9a2c2aa6](http://github.com/aurelia/skeleton-navigation/commit/9a2c2aa6f7fa9f5a5666aa0c19163bf49cbcc5fc)) 214 | 215 | 216 | ## 0.9.0 (2015-01-22) 217 | 218 | 219 | #### Bug Fixes 220 | 221 | * **all:** 222 | * update dependencies and links to latest ([8863e7b7](http://github.com/aurelia/skeleton-navigation/commit/8863e7b7d07e87430b0f495cd25923e401698bc9)) 223 | * update to latest version of metadata and view import ([2467e6c8](http://github.com/aurelia/skeleton-navigation/commit/2467e6c8361fc848b45ab6d92b180edf4d4bcdb5)) 224 | * **build:** improve watch functionality ([8496a78d](http://github.com/aurelia/skeleton-navigation/commit/8496a78def478bd2c53217c9e70db1d272a935ea)) 225 | * **package:** update dependencies ([2957e94d](http://github.com/aurelia/skeleton-navigation/commit/2957e94d84988207c2553395e8e0a1c943a65a16)) 226 | 227 | 228 | #### Features 229 | 230 | * **all:** update to new fluent metadata ([18382913](http://github.com/aurelia/skeleton-navigation/commit/183829132bce3f754377bf2d720a288b71ef4b64)) 231 | * **index:** add splash screen ([88e3e6f9](http://github.com/aurelia/skeleton-navigation/commit/88e3e6f956575c18fb37e72cd51e7bfac33f6941)) 232 | 233 | 234 | ## 0.8.0 (2015-01-12) 235 | 236 | 237 | #### Bug Fixes 238 | 239 | * **package:** update Aurelia dependencies ([44083541](http://github.com/aurelia/skeleton-navigation/commit/440835418d78b5d99278ec4f2fbc04beb79ff98f)) 240 | 241 | 242 | #### Features 243 | 244 | * **build:** update watch task to include style files ([ddf6c789](http://github.com/aurelia/skeleton-navigation/commit/ddf6c789c84ac267bdf4865f19a3339d7ee66253)) 245 | 246 | 247 | ### 0.7.2 (2015-01-07) 248 | 249 | 250 | #### Bug Fixes 251 | 252 | * **welcome:** typo in the last name label ([05e72aaa](http://github.com/aurelia/skeleton-navigation/commit/05e72aaaee2a8c58943f7b9e85eb59307a85f35d)) 253 | 254 | 255 | ### 0.7.1 (2015-01-07) 256 | 257 | * updates to the readme to help clarify issues around authentication and usage on windows 258 | 259 | ## 0.7.0 (2015-01-07) 260 | 261 | 262 | #### Bug Fixes 263 | 264 | * **package:** update dependencies to latest ([c11ffa0d](http://github.com/aurelia/skeleton-navigation/commit/c11ffa0d980c6058dbff6d0a16fadd27040f7214)) 265 | 266 | 267 | ## 0.6.0 (2015-01-06) 268 | 269 | 270 | #### Features 271 | 272 | * **build:** update compiler and switch to register module format ([921d6ab8](http://github.com/aurelia/skeleton-navigation/commit/921d6ab8a523fce6a410f7333650eef9dc5e8abc)) 273 | 274 | 275 | ## 0.5.0 (2014-12-22) 276 | 277 | 278 | #### Bug Fixes 279 | 280 | * **config:** update the jspm config ([9ceaa0c2](http://github.com/aurelia/skeleton-navigation/commit/9ceaa0c2af5374461d183993036984cf048261d8)) 281 | * **package:** update dependencies to latest versions ([b5cff606](http://github.com/aurelia/skeleton-navigation/commit/b5cff606059dff0ad47e78cc6ba4325d646015a5)) 282 | 283 | 284 | #### Features 285 | 286 | * **build:** add browser sync ([fe2d2fa7](http://github.com/aurelia/skeleton-navigation/commit/fe2d2fa7c10a4748cab6c86e326465e6a8327ef4)) 287 | 288 | 289 | ### 0.4.2 (2014-12-18) 290 | 291 | 292 | #### Bug Fixes 293 | 294 | * **package:** update bootstrapper to latest version ([e1d00037](http://github.com/aurelia/skeleton-navigation/commit/e1d000377c782b1bfc9c8fce0d247afb0b8702d1)) 295 | 296 | 297 | ### 0.4.1 (2014-12-18) 298 | 299 | 300 | #### Bug Fixes 301 | 302 | * **package:** update dependencies to latest versions ([275a693d](http://github.com/aurelia/skeleton-navigation/commit/275a693dcbbeec189847f97881b40d25e3b693d4)) 303 | 304 | 305 | ## 0.4.0 (2014-12-17) 306 | 307 | 308 | #### Bug Fixes 309 | 310 | * **package:** update dependencies to latest versions ([77986163](http://github.com/aurelia/skeleton-navigation/commit/779861632b7e48152ce7bed9d0316e90fda2482d)) 311 | * **package:** update dependencies to latest versions ([4f1661dc](http://github.com/aurelia/skeleton-navigation/commit/4f1661dceafe93c8c117133bd07b9edb243b913e)) 312 | 313 | -------------------------------------------------------------------------------- /public/app/doc/api.json: -------------------------------------------------------------------------------- 1 | {"classes":[],"methods":[],"properties":[],"events":[]} -------------------------------------------------------------------------------- /public/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/AureliaDocDB/e01e5df107e4d54ae1a572f136d858fd4cf40e3d/public/app/favicon.ico -------------------------------------------------------------------------------- /public/app/gulpfile.js: -------------------------------------------------------------------------------- 1 | // all gulp tasks are located in the ./build/tasks directory 2 | // gulp configuration is in files in ./build directory 3 | require('require-dir')('build/tasks'); 4 | -------------------------------------------------------------------------------- /public/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Aurelia 5 | 6 | 7 | 8 | 9 | 10 |
11 |
Aurelia Navigation Skeleton With Node
12 | 13 |
14 | 15 | 16 | 17 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /public/app/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions":{ 3 | "target": "ES6", 4 | "module": "system", 5 | "experimentalDecorators": true 6 | } 7 | 8 | } -------------------------------------------------------------------------------- /public/app/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | // Generated on Fri Dec 05 2014 16:49:29 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: ['jspm', 'jasmine'], 14 | 15 | jspm: { 16 | // Edit this to your needs 17 | loadFiles: ['src/**/*.js', 'test/unit/**/*.js'], 18 | paths: { 19 | '*': '*.js' 20 | } 21 | }, 22 | 23 | 24 | // list of files / patterns to load in the browser 25 | files: [], 26 | 27 | 28 | // list of files to exclude 29 | exclude: [ 30 | ], 31 | 32 | 33 | // preprocess matching files before serving them to the browser 34 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor 35 | preprocessors: { 36 | 'test/**/*.js': ['babel'], 37 | 'src/**/*.js': ['babel'] 38 | }, 39 | 'babelPreprocessor': { 40 | options: { 41 | sourceMap: 'inline', 42 | modules: 'system', 43 | moduleIds: false, 44 | optional: [ 45 | "es7.decorators", 46 | "es7.classProperties" 47 | ] 48 | } 49 | }, 50 | 51 | // test results reporter to use 52 | // possible values: 'dots', 'progress' 53 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter 54 | reporters: ['progress'], 55 | 56 | 57 | // web server port 58 | port: 9876, 59 | 60 | 61 | // enable / disable colors in the output (reporters and logs) 62 | colors: true, 63 | 64 | 65 | // level of logging 66 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 67 | logLevel: config.LOG_INFO, 68 | 69 | 70 | // enable / disable watching file and executing tests whenever any file changes 71 | autoWatch: true, 72 | 73 | 74 | // start these browsers 75 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher 76 | browsers: ['Chrome'], 77 | 78 | 79 | // Continuous Integration mode 80 | // if true, Karma captures browsers, runs the tests and exits 81 | singleRun: false 82 | }); 83 | }; 84 | -------------------------------------------------------------------------------- /public/app/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "aurelia-skeleton-navigation", 3 | "version": "0.16.2", 4 | "description": "A starter kit for building a standard navigation-style app with Aurelia.", 5 | "keywords": [ 6 | "aurelia", 7 | "navigation", 8 | "skeleton" 9 | ], 10 | "homepage": "http://aurelia.io", 11 | "bugs": { 12 | "url": "https://github.com/aurelia/skeleton-navigation/issues" 13 | }, 14 | "license": "MIT", 15 | "author": "Rob Eisenberg (http://robeisenberg.com/)", 16 | "main": "dist/commonjs/index.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "http://github.com/aurelia/skeleton-navigation" 20 | }, 21 | "devDependencies": { 22 | "aurelia-tools": "^0.1.3", 23 | "browser-sync": "^1.8.1", 24 | "conventional-changelog": "0.0.11", 25 | "del": "^1.1.0", 26 | "gulp": "^3.8.10", 27 | "gulp-babel": "^5.1.0", 28 | "gulp-bump": "^0.3.1", 29 | "gulp-changed": "^1.1.0", 30 | "gulp-jshint": "^1.9.0", 31 | "gulp-plumber": "^0.6.6", 32 | "gulp-protractor": "^0.0.12", 33 | "gulp-sourcemaps": "^1.3.0", 34 | "gulp-yuidoc": "^0.1.2", 35 | "jasmine-core": "^2.1.3", 36 | "jshint-stylish": "^1.0.0", 37 | "jspm": "^0.16.0-beta.7", 38 | "karma": "^0.12.28", 39 | "karma-babel-preprocessor": "^5.2.1", 40 | "karma-chrome-launcher": "^0.1.7", 41 | "karma-coverage": "^0.3.1", 42 | "karma-jasmine": "^0.3.5", 43 | "karma-jspm": "^1.1.5", 44 | "object.assign": "^1.0.3", 45 | "require-dir": "^0.1.0", 46 | "run-sequence": "^1.0.2", 47 | "vinyl-paths": "^1.0.0", 48 | "yargs": "^2.1.1" 49 | }, 50 | "jspm": { 51 | "dependencies": { 52 | "aurelia-animator-css": "npm:aurelia-animator-css@^1.0.0-beta.1.2.0", 53 | "aurelia-binding": "npm:aurelia-binding@^1.0.0-beta.1.3.2", 54 | "aurelia-bootstrapper": "npm:aurelia-bootstrapper@^1.0.0-beta.1.2.0", 55 | "aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.0.0-beta.1.2.0", 56 | "aurelia-event-aggregator": "npm:aurelia-event-aggregator@^1.0.0-beta.1.2.0", 57 | "aurelia-fetch-client": "npm:aurelia-fetch-client@^1.0.0-beta.1.2.1", 58 | "aurelia-framework": "npm:aurelia-framework@^1.0.0-beta.1.2.2", 59 | "aurelia-history": "npm:aurelia-history@^1.0.0-beta.1.2.0", 60 | "aurelia-history-browser": "npm:aurelia-history-browser@^1.0.0-beta.1.2.0", 61 | "aurelia-loader": "npm:aurelia-loader@^1.0.0-beta.1.2.0", 62 | "aurelia-loader-default": "npm:aurelia-loader-default@^1.0.0-beta.1.2.1", 63 | "aurelia-logging": "npm:aurelia-logging@^1.0.0-beta.1.2.0", 64 | "aurelia-metadata": "npm:aurelia-metadata@^1.0.0-beta.1.2.0", 65 | "aurelia-path": "npm:aurelia-path@^1.0.0-beta.1.2.1", 66 | "aurelia-route-recognizer": "npm:aurelia-route-recognizer@^1.0.0-beta.1.2.0", 67 | "aurelia-router": "npm:aurelia-router@^1.0.0-beta.1.2.1", 68 | "aurelia-task-queue": "npm:aurelia-task-queue@^1.0.0-beta.1.2.0", 69 | "aurelia-templating": "npm:aurelia-templating@^1.0.0-beta.1.2.2", 70 | "aurelia-templating-binding": "npm:aurelia-templating-binding@^1.0.0-beta.1.2.1", 71 | "aurelia-templating-resources": "npm:aurelia-templating-resources@^1.0.0-beta.1.2.2", 72 | "aurelia-templating-router": "npm:aurelia-templating-router@^1.0.0-beta.1.2.0", 73 | "bootstrap": "github:twbs/bootstrap@^3.3.4", 74 | "core-js": "npm:core-js@^0.9.4", 75 | "css": "github:systemjs/plugin-css@^0.1.11", 76 | "fetch": "github:github/fetch@^0.9.0", 77 | "font-awesome": "npm:font-awesome@^4.3.0", 78 | "moment": "github:moment/moment@^2.10.6" 79 | }, 80 | "devDependencies": { 81 | "babel": "npm:babel-core@^5.1.13", 82 | "babel-runtime": "npm:babel-runtime@^5.1.13", 83 | "core-js": "npm:core-js@^0.9.4" 84 | }, 85 | "overrides": { 86 | "npm:core-js@0.9.18": { 87 | "main": "client/shim.min" 88 | } 89 | } 90 | }, 91 | "dependencies": { 92 | "async": "^1.4.2", 93 | "documentdb": "^1.2.1" 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /public/app/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // An example configuration file. 2 | exports.config = { 3 | directConnect: true, 4 | 5 | // Capabilities to be passed to the webdriver instance. 6 | capabilities: { 7 | 'browserName': 'chrome' 8 | }, 9 | 10 | //seleniumAddress: 'http://0.0.0.0:4444', 11 | // add proper version number 12 | seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.44.0.jar', 13 | specs: ['specs/e2e/dist/*.js'], 14 | 15 | plugins: [{ 16 | path: 'aurelia.protractor.js' 17 | }], 18 | 19 | 20 | // Options to be passed to Jasmine-node. 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 30000 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /public/app/src/app.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /public/app/src/app.js: -------------------------------------------------------------------------------- 1 | import 'bootstrap'; 2 | import 'bootstrap/css/bootstrap.css!'; 3 | 4 | export class App { 5 | configureRouter(config, router){ 6 | config.title = 'Aurelia'; 7 | config.map([ 8 | { route: ['','welcome'], name: 'welcome', moduleId: 'welcome', nav: true, title:'Welcome' }, 9 | { route: 'users', name: 'users', moduleId: 'users', nav: true, title:'Github Users' }, 10 | { route: 'ninjaList', name: 'ninjaList' , moduleId:'ninjaList', nav: true, title:'Ninjas'}, 11 | { route: 'ninjas/*Id', moduleId: 'edit', title:'Edit Ninja' }, 12 | { route: 'child-router', name: 'child-router', moduleId: 'child-router', nav: true, title:'Child Router' } 13 | ]); 14 | 15 | 16 | this.router = router; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /public/app/src/blur-image.js: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-framework'; 2 | 3 | @inject(Element) 4 | export class BlurImageCustomAttribute { 5 | constructor(element){ 6 | this.element = element; 7 | } 8 | 9 | valueChanged(newImage){ 10 | if(newImage.complete){ 11 | drawBlur(this.element, newImage); 12 | } else{ 13 | newImage.onload = () => drawBlur(this.element, newImage); 14 | } 15 | } 16 | } 17 | 18 | /* 19 | This Snippet is using a modified Stack Blur js lib for blurring the header images. 20 | */ 21 | 22 | /* 23 | 24 | StackBlur - a fast almost Gaussian Blur For Canvas 25 | 26 | Version: 0.5 27 | Author: Mario Klingemann 28 | Contact: mario@quasimondo.com 29 | Website: http://www.quasimondo.com/StackBlurForCanvas 30 | Twitter: @quasimondo 31 | 32 | In case you find this class useful - especially in commercial projects - 33 | I am not totally unhappy for a small donation to my PayPal account 34 | mario@quasimondo.de 35 | 36 | Or support me on flattr: 37 | https://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript 38 | 39 | Copyright (c) 2010 Mario Klingemann 40 | 41 | Permission is hereby granted, free of charge, to any person 42 | obtaining a copy of this software and associated documentation 43 | files (the "Software"), to deal in the Software without 44 | restriction, including without limitation the rights to use, 45 | copy, modify, merge, publish, distribute, sublicense, and/or sell 46 | copies of the Software, and to permit persons to whom the 47 | Software is furnished to do so, subject to the following 48 | conditions: 49 | 50 | The above copyright notice and this permission notice shall be 51 | included in all copies or substantial portions of the Software. 52 | 53 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 54 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 55 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 56 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 57 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 58 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 59 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 60 | OTHER DEALINGS IN THE SOFTWARE. 61 | */ 62 | 63 | var mul_table = [ 64 | 512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512, 65 | 454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512, 66 | 482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456, 67 | 437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512, 68 | 497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328, 69 | 320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456, 70 | 446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335, 71 | 329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512, 72 | 505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405, 73 | 399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328, 74 | 324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271, 75 | 268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456, 76 | 451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388, 77 | 385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335, 78 | 332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292, 79 | 289,287,285,282,280,278,275,273,271,269,267,265,263,261,259]; 80 | 81 | 82 | var shg_table = [ 83 | 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, 84 | 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 85 | 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 86 | 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 87 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 88 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 89 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 90 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 91 | 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 92 | 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 93 | 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 94 | 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 95 | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 96 | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 97 | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 98 | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 ]; 99 | 100 | var BLUR_RADIUS = 40; 101 | 102 | function stackBlurCanvasRGBA( canvas, top_x, top_y, width, height, radius ) 103 | { 104 | if ( isNaN(radius) || radius < 1 ) return; 105 | radius |= 0; 106 | 107 | var context = canvas.getContext("2d"); 108 | var imageData; 109 | 110 | try { 111 | imageData = context.getImageData( top_x, top_y, width, height ); 112 | } catch(e) { 113 | throw new Error("unable to access image data: " + e); 114 | } 115 | 116 | var pixels = imageData.data; 117 | 118 | var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, 119 | r_out_sum, g_out_sum, b_out_sum, a_out_sum, 120 | r_in_sum, g_in_sum, b_in_sum, a_in_sum, 121 | pr, pg, pb, pa, rbs; 122 | 123 | var div = radius + radius + 1; 124 | var w4 = width << 2; 125 | var widthMinus1 = width - 1; 126 | var heightMinus1 = height - 1; 127 | var radiusPlus1 = radius + 1; 128 | var sumFactor = radiusPlus1 * ( radiusPlus1 + 1 ) / 2; 129 | 130 | var stackStart = new BlurStack(); 131 | var stack = stackStart; 132 | for ( i = 1; i < div; i++ ) 133 | { 134 | stack = stack.next = new BlurStack(); 135 | if ( i == radiusPlus1 ) var stackEnd = stack; 136 | } 137 | stack.next = stackStart; 138 | var stackIn = null; 139 | var stackOut = null; 140 | 141 | yw = yi = 0; 142 | 143 | var mul_sum = mul_table[radius]; 144 | var shg_sum = shg_table[radius]; 145 | 146 | for ( y = 0; y < height; y++ ) 147 | { 148 | r_in_sum = g_in_sum = b_in_sum = a_in_sum = r_sum = g_sum = b_sum = a_sum = 0; 149 | 150 | r_out_sum = radiusPlus1 * ( pr = pixels[yi] ); 151 | g_out_sum = radiusPlus1 * ( pg = pixels[yi+1] ); 152 | b_out_sum = radiusPlus1 * ( pb = pixels[yi+2] ); 153 | a_out_sum = radiusPlus1 * ( pa = pixels[yi+3] ); 154 | 155 | r_sum += sumFactor * pr; 156 | g_sum += sumFactor * pg; 157 | b_sum += sumFactor * pb; 158 | a_sum += sumFactor * pa; 159 | 160 | stack = stackStart; 161 | 162 | for( i = 0; i < radiusPlus1; i++ ) 163 | { 164 | stack.r = pr; 165 | stack.g = pg; 166 | stack.b = pb; 167 | stack.a = pa; 168 | stack = stack.next; 169 | } 170 | 171 | for( i = 1; i < radiusPlus1; i++ ) 172 | { 173 | p = yi + (( widthMinus1 < i ? widthMinus1 : i ) << 2 ); 174 | r_sum += ( stack.r = ( pr = pixels[p])) * ( rbs = radiusPlus1 - i ); 175 | g_sum += ( stack.g = ( pg = pixels[p+1])) * rbs; 176 | b_sum += ( stack.b = ( pb = pixels[p+2])) * rbs; 177 | a_sum += ( stack.a = ( pa = pixels[p+3])) * rbs; 178 | 179 | r_in_sum += pr; 180 | g_in_sum += pg; 181 | b_in_sum += pb; 182 | a_in_sum += pa; 183 | 184 | stack = stack.next; 185 | } 186 | 187 | 188 | stackIn = stackStart; 189 | stackOut = stackEnd; 190 | for ( x = 0; x < width; x++ ) 191 | { 192 | pixels[yi+3] = pa = (a_sum * mul_sum) >> shg_sum; 193 | if ( pa != 0 ) 194 | { 195 | pa = 255 / pa; 196 | pixels[yi] = ((r_sum * mul_sum) >> shg_sum) * pa; 197 | pixels[yi+1] = ((g_sum * mul_sum) >> shg_sum) * pa; 198 | pixels[yi+2] = ((b_sum * mul_sum) >> shg_sum) * pa; 199 | } else { 200 | pixels[yi] = pixels[yi+1] = pixels[yi+2] = 0; 201 | } 202 | 203 | r_sum -= r_out_sum; 204 | g_sum -= g_out_sum; 205 | b_sum -= b_out_sum; 206 | a_sum -= a_out_sum; 207 | 208 | r_out_sum -= stackIn.r; 209 | g_out_sum -= stackIn.g; 210 | b_out_sum -= stackIn.b; 211 | a_out_sum -= stackIn.a; 212 | 213 | p = ( yw + ( ( p = x + radius + 1 ) < widthMinus1 ? p : widthMinus1 ) ) << 2; 214 | 215 | r_in_sum += ( stackIn.r = pixels[p]); 216 | g_in_sum += ( stackIn.g = pixels[p+1]); 217 | b_in_sum += ( stackIn.b = pixels[p+2]); 218 | a_in_sum += ( stackIn.a = pixels[p+3]); 219 | 220 | r_sum += r_in_sum; 221 | g_sum += g_in_sum; 222 | b_sum += b_in_sum; 223 | a_sum += a_in_sum; 224 | 225 | stackIn = stackIn.next; 226 | 227 | r_out_sum += ( pr = stackOut.r ); 228 | g_out_sum += ( pg = stackOut.g ); 229 | b_out_sum += ( pb = stackOut.b ); 230 | a_out_sum += ( pa = stackOut.a ); 231 | 232 | r_in_sum -= pr; 233 | g_in_sum -= pg; 234 | b_in_sum -= pb; 235 | a_in_sum -= pa; 236 | 237 | stackOut = stackOut.next; 238 | 239 | yi += 4; 240 | } 241 | yw += width; 242 | } 243 | 244 | 245 | for ( x = 0; x < width; x++ ) 246 | { 247 | g_in_sum = b_in_sum = a_in_sum = r_in_sum = g_sum = b_sum = a_sum = r_sum = 0; 248 | 249 | yi = x << 2; 250 | r_out_sum = radiusPlus1 * ( pr = pixels[yi]); 251 | g_out_sum = radiusPlus1 * ( pg = pixels[yi+1]); 252 | b_out_sum = radiusPlus1 * ( pb = pixels[yi+2]); 253 | a_out_sum = radiusPlus1 * ( pa = pixels[yi+3]); 254 | 255 | r_sum += sumFactor * pr; 256 | g_sum += sumFactor * pg; 257 | b_sum += sumFactor * pb; 258 | a_sum += sumFactor * pa; 259 | 260 | stack = stackStart; 261 | 262 | for( i = 0; i < radiusPlus1; i++ ) 263 | { 264 | stack.r = pr; 265 | stack.g = pg; 266 | stack.b = pb; 267 | stack.a = pa; 268 | stack = stack.next; 269 | } 270 | 271 | yp = width; 272 | 273 | for( i = 1; i <= radius; i++ ) 274 | { 275 | yi = ( yp + x ) << 2; 276 | 277 | r_sum += ( stack.r = ( pr = pixels[yi])) * ( rbs = radiusPlus1 - i ); 278 | g_sum += ( stack.g = ( pg = pixels[yi+1])) * rbs; 279 | b_sum += ( stack.b = ( pb = pixels[yi+2])) * rbs; 280 | a_sum += ( stack.a = ( pa = pixels[yi+3])) * rbs; 281 | 282 | r_in_sum += pr; 283 | g_in_sum += pg; 284 | b_in_sum += pb; 285 | a_in_sum += pa; 286 | 287 | stack = stack.next; 288 | 289 | if( i < heightMinus1 ) 290 | { 291 | yp += width; 292 | } 293 | } 294 | 295 | yi = x; 296 | stackIn = stackStart; 297 | stackOut = stackEnd; 298 | for ( y = 0; y < height; y++ ) 299 | { 300 | p = yi << 2; 301 | pixels[p+3] = pa = (a_sum * mul_sum) >> shg_sum; 302 | if ( pa > 0 ) 303 | { 304 | pa = 255 / pa; 305 | pixels[p] = ((r_sum * mul_sum) >> shg_sum ) * pa; 306 | pixels[p+1] = ((g_sum * mul_sum) >> shg_sum ) * pa; 307 | pixels[p+2] = ((b_sum * mul_sum) >> shg_sum ) * pa; 308 | } else { 309 | pixels[p] = pixels[p+1] = pixels[p+2] = 0; 310 | } 311 | 312 | r_sum -= r_out_sum; 313 | g_sum -= g_out_sum; 314 | b_sum -= b_out_sum; 315 | a_sum -= a_out_sum; 316 | 317 | r_out_sum -= stackIn.r; 318 | g_out_sum -= stackIn.g; 319 | b_out_sum -= stackIn.b; 320 | a_out_sum -= stackIn.a; 321 | 322 | p = ( x + (( ( p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1 ) * width )) << 2; 323 | 324 | r_sum += ( r_in_sum += ( stackIn.r = pixels[p])); 325 | g_sum += ( g_in_sum += ( stackIn.g = pixels[p+1])); 326 | b_sum += ( b_in_sum += ( stackIn.b = pixels[p+2])); 327 | a_sum += ( a_in_sum += ( stackIn.a = pixels[p+3])); 328 | 329 | stackIn = stackIn.next; 330 | 331 | r_out_sum += ( pr = stackOut.r ); 332 | g_out_sum += ( pg = stackOut.g ); 333 | b_out_sum += ( pb = stackOut.b ); 334 | a_out_sum += ( pa = stackOut.a ); 335 | 336 | r_in_sum -= pr; 337 | g_in_sum -= pg; 338 | b_in_sum -= pb; 339 | a_in_sum -= pa; 340 | 341 | stackOut = stackOut.next; 342 | 343 | yi += width; 344 | } 345 | } 346 | 347 | context.putImageData( imageData, top_x, top_y ); 348 | 349 | } 350 | 351 | function BlurStack() 352 | { 353 | this.r = 0; 354 | this.g = 0; 355 | this.b = 0; 356 | this.a = 0; 357 | this.next = null; 358 | } 359 | 360 | function drawBlur(canvas, image) { 361 | var w = canvas.width; 362 | var h = canvas.height; 363 | var canvasContext = canvas.getContext('2d'); 364 | canvasContext.drawImage(image, 0, 0, w, h); 365 | stackBlurCanvasRGBA(canvas, 0, 0, w, h, BLUR_RADIUS); 366 | }; 367 | -------------------------------------------------------------------------------- /public/app/src/child-router.html: -------------------------------------------------------------------------------- 1 | 18 | -------------------------------------------------------------------------------- /public/app/src/child-router.js: -------------------------------------------------------------------------------- 1 | export class ChildRouter{ 2 | heading = 'Child Router'; 3 | 4 | configureRouter(config, router){ 5 | config.map([ 6 | { route: ['','welcome'], name: 'welcome', moduleId: 'welcome', nav: true, title:'Welcome' }, 7 | { route: 'users', name: 'users', moduleId: 'users', nav: true, title:'Github Users' }, 8 | { route: 'child-router', name: 'child-router', moduleId: 'child-router', nav: true, title:'Child Router' } 9 | ]); 10 | 11 | this.router = router; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /public/app/src/clans.js: -------------------------------------------------------------------------------- 1 | export function getClans(){ 2 | var clans = [], propertyName; 3 | for(propertyName in clansObject) { 4 | if (clansObject.hasOwnProperty(propertyName)) { 5 | clans.push({ code: clansObject[propertyName], name: propertyName }); 6 | } 7 | } 8 | return clans; 9 | } 10 | 11 | var clansObject = { 12 | "American Ninja Warriors": "anj", 13 | "Vermont Clan": "vc", 14 | "Turtles": "t" 15 | }; -------------------------------------------------------------------------------- /public/app/src/edit.html: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /public/app/src/edit.js: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-framework'; 2 | import {HttpClient, json} from 'aurelia-fetch-client'; 3 | import 'fetch'; 4 | 5 | 6 | import {Router} from 'aurelia-router'; 7 | 8 | @inject(HttpClient, Router) 9 | 10 | export class Edit { 11 | searchEntry = ''; 12 | ninjas = []; 13 | ninjaId = ''; 14 | ninja = ''; 15 | ninjaRoot = ''; 16 | currentPage = 1; 17 | textShowAll = 'Show All'; 18 | myRouter = ''; 19 | 20 | constructor(httpClient,router) { 21 | httpClient.configure(config => { 22 | config 23 | .useStandardConfiguration().withBaseUrl('/api'); 24 | }); 25 | this.httpClient = httpClient; 26 | this.router=router; 27 | } 28 | 29 | retrieveNinja(id) { 30 | return this.httpClient.fetch('/ninjas/' + id) 31 | .then(response => response.json()) 32 | .then(ninja => this.ninja = ninja); 33 | 34 | } 35 | 36 | save() { 37 | this.ninjaRoot = { 38 | id: this.ninja.id, 39 | ServedInOniwaban: this.ninja.ServedInOniwaban, 40 | Clan: this.ninja.Clan, 41 | Name: this.ninja.Name, 42 | DateOfBirth: this.ninja.DateOfBirth 43 | }; 44 | return this.httpClient.fetch('/updateDetails', { 45 | method: 'post', 46 | 47 | body: json(this.ninjaRoot) 48 | }).then(response => {this.router.navigate('ninjaList'); 49 | }); 50 | } 51 | 52 | 53 | 54 | get canSearch() { 55 | return (this.searchEntry != '' ? true : false); 56 | } 57 | 58 | activate(params) { 59 | var result = this.retrieveNinja(params.Id); 60 | return result; 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /public/app/src/main.js: -------------------------------------------------------------------------------- 1 | export function configure(aurelia) { 2 | aurelia.use 3 | .standardConfiguration() 4 | .developmentLogging() 5 | .plugin('resources/index') 6 | .plugin('aurelia-animator-css'); 7 | 8 | aurelia.start().then(a => a.setRoot()); 9 | } 10 | -------------------------------------------------------------------------------- /public/app/src/nav-bar.html: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /public/app/src/nav-bar.js: -------------------------------------------------------------------------------- 1 | import {bindable} from 'aurelia-framework'; 2 | 3 | export class NavBar { 4 | @bindable router = null; 5 | } 6 | -------------------------------------------------------------------------------- /public/app/src/ninjaList.html: -------------------------------------------------------------------------------- 1 |  2 | 39 | -------------------------------------------------------------------------------- /public/app/src/ninjaList.js: -------------------------------------------------------------------------------- 1 | import {inject} from 'aurelia-framework'; 2 | import {HttpClient, json} from 'aurelia-fetch-client'; 3 | import 'fetch'; 4 | 5 | @inject(HttpClient) 6 | export class NinjaList { 7 | ninjaId = ''; 8 | ninja = ''; 9 | currentPage = 1; 10 | textShowAll = 'Show All'; 11 | 12 | 13 | constructor(httpClient){ 14 | httpClient.configure(config => { 15 | config 16 | .useStandardConfiguration().withBaseUrl('/api'); 17 | }); 18 | this.httpClient = httpClient; 19 | } 20 | 21 | get canSearch() { 22 | return (this.searchEntry != '' ? true : false); 23 | } 24 | 25 | activate(params) { 26 | // Fetch the ninjas from the server and set them to the ninjas array 27 | return this.httpClient.fetch('/ninjas') 28 | .then(response => response.json()) 29 | .then(ninjas => this.ninjas = ninjas); 30 | } 31 | 32 | getNinjas(params){ 33 | return this.httpClient.fetch('/ninjas?q=' + params) 34 | .then(response => response.json()) 35 | .then(ninjas => this.ninjas = ninjas); 36 | } 37 | 38 | getFilteredNinjas(){ 39 | this.getNinjas(this.searchEntry); 40 | } 41 | 42 | getAllNinjas() { 43 | this.searchEntry = ''; 44 | this.getNinjas(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /public/app/src/resources/date-format.js: -------------------------------------------------------------------------------- 1 | import moment from 'moment'; 2 | 3 | // Always conventionally name classes in PascalCase 4 | export class DateFormatValueConverter { 5 | toView(value) { 6 | return moment(value).format('M/D/YYYY'); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /public/app/src/resources/index.js: -------------------------------------------------------------------------------- 1 | export function configure(aurelia) { 2 | // The API changed to globalResources instead of globalizeResources 3 | //aurelia.globalResources('../date-format'); 4 | aurelia.globalResources('resources/date-format'); 5 | } 6 | -------------------------------------------------------------------------------- /public/app/src/resources/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions":{ 3 | "target": "ES6", 4 | "module": "system", 5 | "experimentalDecorators": true 6 | } 7 | 8 | } -------------------------------------------------------------------------------- /public/app/src/templates/dropdown.html: -------------------------------------------------------------------------------- 1 | 8 | 9 | -------------------------------------------------------------------------------- /public/app/src/templates/dropdown.html.rej: -------------------------------------------------------------------------------- 1 | diff a/public/app/src/templates/dropdown.html b/public/app/src/templates/dropdown.html (rejected hunks) 2 | @@ -1,6 +1,6 @@ 3 |