Repository: incubator-senssoft-useralejs Updated Branches: refs/heads/master 7c5b2be32 -> f2c421900
SENSSOFT-250 Create README for UserALE.js examples directory Project: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/commit/fb3d2f56 Tree: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/tree/fb3d2f56 Diff: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/diff/fb3d2f56 Branch: refs/heads/master Commit: fb3d2f568bb4db467febf17f987a84be6a1c6197 Parents: d68bb04 Author: Lewis John McGibbney <lewis.mcgibb...@gmail.com> Authored: Fri Sep 1 10:53:14 2017 -0700 Committer: Lewis John McGibbney <lewis.mcgibb...@gmail.com> Committed: Fri Sep 1 10:53:14 2017 -0700 ---------------------------------------------------------------------- README.md | 24 ++++++++++++++--- example/README.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ example/index.html | 5 ++-- example/server.js | 2 +- 4 files changed, 92 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/fb3d2f56/README.md ---------------------------------------------------------------------- diff --git a/README.md b/README.md index 56f109b..59b69e0 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,28 @@ -# UserALE.js +# Apache SensSoft UserALE.js (Incubating) [![Build Status](https://builds.apache.org/job/useralejs-ci/badge/icon?style=plastic)](https://builds.apache.org/job/useralejs-ci?) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0) -The official JavaScript client for UserAle. +The official JavaScript client for [Apache SensSoft UserALE](https://github.com/apache/incubator-senssoft-userale). Additional documentation can be found at http://senssoft.incubator.apache.org/userale/ +## Prerequsites + +``` +npm install gulp +npm install del +npm install gulp-eslint +npm install rollup +npm install rollup-plugin-json +npm install gulp-uglify +npm install gulp-rename +npm install gulp-mocha +npm install babel-register +npm install express +npm install body-parser +``` + ## Build To build UserALE.js: @@ -54,8 +70,8 @@ Our top priority is to improve the testing system and to complete test coverage. ## Contributing -Contributions are welcome! Simply submit an issue report for problems you encounter or a pull request for your feature or bug fix. The core team will review it and work with you to incorporate it into UserALE.js. +Contributions are welcome! Simply [submit an issue report](https://issues.apache.org/jira/browse/senssoft) for problems you encounter or a pull request for your feature or bug fix. The core team will review it and work with you to incorporate it into UserALE.js. ## License -Copyright © 2017 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Software as a Sensor is a trademark of the Charles Stark Draper Laboratory, Inc. \ No newline at end of file +Copyright © 2017 The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Software as a Sensor is a trademark of the Charles Stark Draper Laboratory, Inc. http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/fb3d2f56/example/README.md ---------------------------------------------------------------------- diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..fcc9b81 --- /dev/null +++ b/example/README.md @@ -0,0 +1,68 @@ +# UserALE.js Example + +This directory provides + * example usage for UserALE.js within a simple HTML Webpage, + * how users can expect to log UserALE events, and + * what log events looks like within a simple UserALE logging server. + +## Prerequisites + +Please see the [Prerequsites](https://github.com/apache/incubator-senssoft-useralejs#prerequsites) + +## Running the Logging Server + +Assuming you have [node.js](https://nodejs.org/) installed, simply run + +``` +node server.js +``` + +## Running the Example + +Simply open index.html in your browser... you will see a very simply HTML Webpage with a button. + +When you click the button, the events will be logged to the server (in memory), logs looks similar to the following + +``` + +[ { target: 'body', + path: [ 'body', 'html' ], + clientTime: 1504287557492, + location: { x: 0, y: 0 }, + type: 'keydown', + userAction: true, + details: null, + userId: 'example-user', + toolVersion: '1.0.0', + toolName: 'Apache UserALE.js Example', + useraleVersion: '1.0.0' }, + { target: '#document', + path: [ '#document' ], + clientTime: 1504287558304, + location: { x: 0, y: 0 }, + type: 'blur', + userAction: true, + details: { window: true }, + userId: 'example-user', + toolVersion: '1.0.0', + toolName: 'Apache UserALE.js Example', + useraleVersion: '1.0.0' }, + { target: '#document', + path: [ '#document' ], + clientTime: 1504287558304, + location: { x: 0, y: 0 }, + type: 'blur', + userAction: true, + details: null, + userId: 'example-user', + toolVersion: '1.0.0', + toolName: 'Apache UserALE.js Example', + useraleVersion: '1.0.0' }, + ... +] + +``` + +## Contributing + +Contributions are welcome! Simply [submit an issue report](https://issues.apache.org/jira/browse/senssoft) for problems you encounter or a pull request for your feature or bug fix. The core team will review it and work with you to incorporate it into UserALE.js. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/fb3d2f56/example/index.html ---------------------------------------------------------------------- diff --git a/example/index.html b/example/index.html index d7cd66a..d293675 100644 --- a/example/index.html +++ b/example/index.html @@ -18,10 +18,11 @@ limitations under the License. <head> <title>UserAleJS - Example Page</title> <script - src="build/userale-0.2.1.min.js" + src="../build/userale-1.0.0.min.js" data-url="http://localhost:8000/" data-user="example-user" data-version="1.0.0" + data-tool="Apache UserALE.js Example" ></script> </head> <body> @@ -29,4 +30,4 @@ limitations under the License. <button id="test_button">Click me!</button> </div> </body> -</html> \ No newline at end of file +</html> http://git-wip-us.apache.org/repos/asf/incubator-senssoft-useralejs/blob/fb3d2f56/example/server.js ---------------------------------------------------------------------- diff --git a/example/server.js b/example/server.js index 354219e..8362123 100644 --- a/example/server.js +++ b/example/server.js @@ -45,7 +45,7 @@ app.use(function (req, res, next) { // intercept OPTIONS method if ('OPTIONS' == req.method) { - res.send(200); + res.sendStatus(200); } else { next();