Skip to content
This repository was archived by the owner on Aug 29, 2021. It is now read-only.

Commit be2a004

Browse files
committed
Moved example hosting to heroku
1 parent b5cdfd7 commit be2a004

File tree

10 files changed

+73
-20
lines changed

10 files changed

+73
-20
lines changed

Readme.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ Keyboard behavior for AngularJS Webapps.
1212

1313
## Demos
1414

15-
* [kbList modes demo](http://bfanger.github.io/angular-keyboard/Examples/modes.html)
16-
* [Scroll and orientation demo](http://bfanger.github.io/angular-keyboard/Examples/orientation.html)
17-
* [kbFocus demo](http://bfanger.github.io/angular-keyboard/Examples/focus.html)
15+
* [kbList & kbSelect demo](http://angular-keyboard.herokuapp.com/example-modes.html)
16+
* [Scroll and orientation demo](http://angular-keyboard.herokuapp.com/example-orientation.html)
17+
* [kbFocus demo](angular-keyboard.herokuapp.com/example-focus.html)
18+
* [kbInvoke demo](angular-keyboard.herokuapp.com/example-menu.html)
1819

1920
## Installation
2021

gulpfile.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@ var gulp = require('gulp');
33
var noprotocol = require('gulp-noprotocol');
44
var livereload = require('gulp-livereload');
55

6+
/**
7+
* Create the angular-keyboard.js and angular-keyboard.min.js files.
8+
*/
69
gulp.task('build', function () {
710
return gulp
811
.src(['src/keyboard.module.js', 'src/**/*.js']) // All *.js files, but keyboard.module.js first.
912
.pipe(noprotocol.angular({
1013
output: 'keyboard.js'
1114
})).pipe(gulp.dest('bower-angular-keyboard/'));
1215
});
16+
/**
17+
* Watch for file-changes, start a livereload server and rebuild on every change.
18+
*/
1319
gulp.task('watch', ['build'], function () {
1420
livereload.listen();
1521
gulp.watch('src/**/*.js', ['build']);
16-
gulp.watch(['bower-angular-keyboard/*.js', 'Examples/*.html']).on('change', livereload.changed);
22+
gulp.watch(['bower-angular-keyboard/*.js', 'minisite/**/*.html']).on('change', livereload.changed);
1723
});
1824

1925
gulp.task('default', ['build']);

minisite/app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
var express = require('express');
3+
4+
var app = express();
5+
app.use(express.static(__dirname + '/public'));
6+
7+
app.use('/js/angular-keyboard/', express.static(__dirname + '/../bower-angular-keyboard'));
8+
app.use('/js/angular/', express.static(__dirname + '/../node_modules/angular'));
9+
app.use('/js/jquery/', express.static(__dirname + '/../node_modules/jquery/dist'));
10+
app.use('/js/faker/', express.static(__dirname + '/../node_modules/faker/build/build'));
11+
12+
var port = process.env.PORT || 3000;
13+
app.listen(port, function () {
14+
console.log('minisite started on port', port);
15+
});

Examples/focus.html renamed to minisite/public/example-focus.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ <h1>Angular Keyboard: kbFocus</h1>
4545
Thanks to <a href="https://github.com/goodeggs/ng-focus-on" target="_blank">ng-focus-on</a> for inspiration and <a href="http://bootswatch.com/" target="_blank">bootswatch.com</a> for the 'spacelab' bootstrap theme.
4646
</div>
4747

48-
<script src="../node_modules/angular/angular.min.js"></script>
49-
<script src="../bower-angular-keyboard/keyboard.js"></script>
48+
<script src="js/angular/angular.min.js"></script>
49+
<script src="js/angular-keyboard/keyboard.js"></script>
5050
<script>
5151
var demo = angular.module('demo', ['keyboard']);
5252
demo.run(function ($rootScope, kbFocus) {

Examples/menu.html renamed to minisite/public/example-menu.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ <h2>Log</h2>
5050
</div>
5151
</div>
5252

53-
<script src="../node_modules/angular/angular.min.js"></script>
54-
<script src="../bower-angular-keyboard/keyboard.js"></script>
53+
<script src="js/angular/angular.min.js"></script>
54+
<script src="js/angular-keyboard/keyboard.js"></script>
5555
<script>
5656
var demo = angular.module('demo', ['keyboard']);
5757
demo.run(function ($rootScope, kbFocus) {

Examples/modes.html renamed to minisite/public/example-modes.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ <h1>Angular Keyboard: kbList modes</h1>
8484
Thanks to <a href="https://github.com/marak/faker.js/" target="_blank">Faker.js</a> for the generated names and <a href="http://bootswatch.com/" target="_blank">bootswatch.com</a> for the 'readable' bootstrap theme.
8585
</div>
8686

87-
<script src="../node_modules/faker/build/build/faker.min.js"></script>
88-
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
89-
<script src="../node_modules/angular/angular.min.js"></script>
90-
<script src="../bower-angular-keyboard/keyboard.js"></script>
87+
<script src="js/faker/faker.min.js"></script>
88+
<script src="js/jquery/jquery.min.js"></script>
89+
<script src="js/angular/angular.min.js"></script>
90+
<script src="js/angular-keyboard/keyboard.js"></script>
9191
<script>
9292
var demo = angular.module('demo', ['keyboard']);
9393
demo.run(function ($rootScope, $timeout, $interval, $log) {

Examples/orientation.html renamed to minisite/public/example-orientation.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ <h4>{{item.name}}</h4>
8888
Thanks to <a href="https://github.com/marak/faker.js/" target="_blank">Faker.js</a> for the generated names and <a href="http://try.buildwinjs.com/" target="_blank">WinJS</a> for the ui-dark theme.
8989
</p>
9090

91-
<script src="../node_modules/faker/build/build/faker.min.js"></script>
92-
<script src="../node_modules/jquery/dist/jquery.min.js"></script>
93-
<script src="../node_modules/angular/angular.min.js"></script>
94-
<script src="../bower-angular-keyboard/keyboard.js"></script>
91+
<script src="js/faker.min.js"></script>
92+
<script src="js/jquery.min.js"></script>
93+
<script src="js/angular.min.js"></script>
94+
<script src="js/keyboard.js"></script>
9595
<script>
9696
var demo = angular.module('demo', ['keyboard']);
9797
demo.run(function ($rootScope, $timeout) {

minisite/public/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Angular Keyboard</title>
5+
<style>
6+
body {
7+
font-family: sans-serif;
8+
}
9+
</style>
10+
</head>
11+
<body>
12+
<h1>Examples</h1>
13+
<ul>
14+
<li><a href="example-modes.html">modes (kb-list, kb-select)</a></li>
15+
<li><a href="example-orientation.html">orientation</a></li>
16+
<li><a href="example-focus.html">focus (kb-focus, kb-autofocus)</a></li>
17+
<li><a href="example-menu.html">menu (kb-invoke)</a></li>
18+
</ul>
19+
</body>
20+
</html>

minisite/public/js/Readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
The javascript files are served from other directories.
3+
See the minisite/app.js for details.

package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"name": "angular-keyboard",
33
"description": "Keyboard behavior for AngularJS Webapps",
4-
"devDependencies": {
5-
"angular": "^1.3.0",
6-
"faker": "^2.0.1",
4+
"dependencies": {
75
"gulp": "^3.8.9",
86
"gulp-livereload": "^2.1.1",
97
"gulp-noprotocol": "^0.2.1",
8+
"angular": "^1.3.0",
9+
"express": "^4.10.0",
10+
"faker": "^2.0.1",
1011
"jquery": "^2.1.1"
1112
},
1213
"repository": {
@@ -25,5 +26,12 @@
2526
"bugs": {
2627
"url": "https://github.com/bfanger/angular-keyboard/issues"
2728
},
28-
"homepage": "https://github.com/bfanger/angular-keyboard"
29+
"homepage": "https://github.com/bfanger/angular-keyboard",
30+
"scripts": {
31+
"start": "node minisite/app.js",
32+
"postinstall": "node node_modules/.bin/gulp build"
33+
},
34+
"engines": {
35+
"node": "0.10.x"
36+
}
2937
}

0 commit comments

Comments
 (0)