Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: RusticiSoftware/TinCanJS
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.32.0
Choose a base ref
...
head repository: RusticiSoftware/TinCanJS
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 18,209 additions and 814 deletions.
  1. +15 −0 .github/PULL_REQUEST_TEMPLATE.md
  2. +5 −0 .travis.yml
  3. +28 −8 Gruntfile.js
  4. +22 −5 README.md
  5. +5 −5 bower.json
  6. +4 −3 build/tincan-min.js
  7. +1 −1 build/tincan-min.map
  8. +1,570 −197 build/tincan-node.js
  9. +6,035 −289 build/tincan.js
  10. +12 −7 package.json
  11. +214 −0 src/Attachment.js
  12. +138 −22 src/Environment/Browser.js
  13. +139 −2 src/Environment/Node.js
  14. +868 −111 src/LRS.js
  15. +53 −0 src/Statement.js
  16. +10 −3 src/TinCan.js
  17. +151 −25 src/Utils.js
  18. +3 −0 test/complete.html
  19. BIN test/files/image.jpg
  20. +55 −36 test/index.html
  21. +28 −0 test/js/BrowserPrep.js
  22. +36 −6 test/js/NodePrep.js
  23. +149 −0 test/js/unit/Activity.js
  24. +184 −0 test/js/unit/Attachment.js
  25. +1 −1 test/js/unit/Context.js
  26. +3 −6 test/js/unit/LRS-browser.js
  27. +708 −12 test/js/unit/LRS.js
  28. +42 −3 test/js/unit/Statement.js
  29. +299 −1 test/js/unit/TinCan-async.js
  30. +21 −40 test/js/unit/TinCan-sync.js
  31. +1 −1 test/js/unit/TinCan.js
  32. +279 −5 test/js/unit/Utils.js
  33. +50 −25 test/node-runner.js
  34. +36 −0 test/single/Attachment.html
  35. +122 −0 test/single/Manual-Image.html
  36. +10 −0 vendor/cryptojs-v3.1.2/components/aes-min.js
  37. +213 −0 vendor/cryptojs-v3.1.2/components/aes.js
  38. +14 −0 vendor/cryptojs-v3.1.2/components/cipher-core-min.js
  39. +863 −0 vendor/cryptojs-v3.1.2/components/cipher-core.js
  40. +13 −0 vendor/cryptojs-v3.1.2/components/core-min.js
  41. +712 −0 vendor/cryptojs-v3.1.2/components/core.js
  42. +8 −0 vendor/cryptojs-v3.1.2/components/enc-base64-min.js
  43. +109 −0 vendor/cryptojs-v3.1.2/components/enc-base64.js
  44. +8 −0 vendor/cryptojs-v3.1.2/components/enc-utf16-min.js
  45. +135 −0 vendor/cryptojs-v3.1.2/components/enc-utf16.js
  46. +8 −0 vendor/cryptojs-v3.1.2/components/evpkdf-min.js
  47. +118 −0 vendor/cryptojs-v3.1.2/components/evpkdf.js
  48. +7 −0 vendor/cryptojs-v3.1.2/components/format-hex-min.js
  49. +52 −0 vendor/cryptojs-v3.1.2/components/format-hex.js
  50. +8 −0 vendor/cryptojs-v3.1.2/components/hmac-min.js
  51. +131 −0 vendor/cryptojs-v3.1.2/components/hmac.js
  52. +8 −0 vendor/cryptojs-v3.1.2/components/lib-typedarrays-min.js
  53. +62 −0 vendor/cryptojs-v3.1.2/components/lib-typedarrays.js
  54. +12 −0 vendor/cryptojs-v3.1.2/components/md5-min.js
  55. +254 −0 vendor/cryptojs-v3.1.2/components/md5.js
  56. +7 −0 vendor/cryptojs-v3.1.2/components/mode-cfb-min.js
  57. +64 −0 vendor/cryptojs-v3.1.2/components/mode-cfb.js
  58. +14 −0 vendor/cryptojs-v3.1.2/components/mode-ctr-gladman-min.js
  59. +102 −0 vendor/cryptojs-v3.1.2/components/mode-ctr-gladman.js
  60. +7 −0 vendor/cryptojs-v3.1.2/components/mode-ctr-min.js
  61. +44 −0 vendor/cryptojs-v3.1.2/components/mode-ctr.js
  62. +7 −0 vendor/cryptojs-v3.1.2/components/mode-ecb-min.js
  63. +26 −0 vendor/cryptojs-v3.1.2/components/mode-ecb.js
  64. +7 −0 vendor/cryptojs-v3.1.2/components/mode-ofb-min.js
  65. +40 −0 vendor/cryptojs-v3.1.2/components/mode-ofb.js
  66. +7 −0 vendor/cryptojs-v3.1.2/components/pad-ansix923-min.js
  67. +35 −0 vendor/cryptojs-v3.1.2/components/pad-ansix923.js
  68. +7 −0 vendor/cryptojs-v3.1.2/components/pad-iso10126-min.js
  69. +30 −0 vendor/cryptojs-v3.1.2/components/pad-iso10126.js
  70. +7 −0 vendor/cryptojs-v3.1.2/components/pad-iso97971-min.js
  71. +26 −0 vendor/cryptojs-v3.1.2/components/pad-iso97971.js
  72. +7 −0 vendor/cryptojs-v3.1.2/components/pad-nopadding-min.js
  73. +16 −0 vendor/cryptojs-v3.1.2/components/pad-nopadding.js
  74. +7 −0 vendor/cryptojs-v3.1.2/components/pad-zeropadding-min.js
  75. +31 −0 vendor/cryptojs-v3.1.2/components/pad-zeropadding.js
  76. +8 −0 vendor/cryptojs-v3.1.2/components/pbkdf2-min.js
  77. +131 −0 vendor/cryptojs-v3.1.2/components/pbkdf2.js
  78. +11 −0 vendor/cryptojs-v3.1.2/components/rabbit-legacy-min.js
  79. +176 −0 vendor/cryptojs-v3.1.2/components/rabbit-legacy.js
  80. +11 −0 vendor/cryptojs-v3.1.2/components/rabbit-min.js
  81. +178 −0 vendor/cryptojs-v3.1.2/components/rabbit.js
  82. +8 −0 vendor/cryptojs-v3.1.2/components/rc4-min.js
  83. +125 −0 vendor/cryptojs-v3.1.2/components/rc4.js
  84. +22 −0 vendor/cryptojs-v3.1.2/components/ripemd160-min.js
  85. +253 −0 vendor/cryptojs-v3.1.2/components/ripemd160.js
  86. +8 −0 vendor/cryptojs-v3.1.2/components/sha1-min.js
  87. +136 −0 vendor/cryptojs-v3.1.2/components/sha1.js
  88. +7 −0 vendor/cryptojs-v3.1.2/components/sha224-min.js
  89. +66 −0 vendor/cryptojs-v3.1.2/components/sha224.js
  90. +9 −0 vendor/cryptojs-v3.1.2/components/sha256-min.js
  91. +185 −0 vendor/cryptojs-v3.1.2/components/sha256.js
  92. +11 −0 vendor/cryptojs-v3.1.2/components/sha3-min.js
  93. +309 −0 vendor/cryptojs-v3.1.2/components/sha3.js
  94. +8 −0 vendor/cryptojs-v3.1.2/components/sha384-min.js
  95. +69 −0 vendor/cryptojs-v3.1.2/components/sha384.js
  96. +15 −0 vendor/cryptojs-v3.1.2/components/sha512-min.js
  97. +309 −0 vendor/cryptojs-v3.1.2/components/sha512.js
  98. +26 −0 vendor/cryptojs-v3.1.2/components/tripledes-min.js
  99. +756 −0 vendor/cryptojs-v3.1.2/components/tripledes.js
  100. +7 −0 vendor/cryptojs-v3.1.2/components/x64-core-min.js
  101. +290 −0 vendor/cryptojs-v3.1.2/components/x64-core.js
  102. +35 −0 vendor/cryptojs-v3.1.2/rollups/aes.js
  103. +21 −0 vendor/cryptojs-v3.1.2/rollups/hmac-md5.js
  104. +31 −0 vendor/cryptojs-v3.1.2/rollups/hmac-ripemd160.js
  105. +17 −0 vendor/cryptojs-v3.1.2/rollups/hmac-sha1.js
  106. +19 −0 vendor/cryptojs-v3.1.2/rollups/hmac-sha224.js
  107. +18 −0 vendor/cryptojs-v3.1.2/rollups/hmac-sha256.js
  108. +21 −0 vendor/cryptojs-v3.1.2/rollups/hmac-sha3.js
  109. +27 −0 vendor/cryptojs-v3.1.2/rollups/hmac-sha384.js
  110. +25 −0 vendor/cryptojs-v3.1.2/rollups/hmac-sha512.js
  111. +19 −0 vendor/cryptojs-v3.1.2/rollups/md5.js
  112. +19 −0 vendor/cryptojs-v3.1.2/rollups/pbkdf2.js
  113. +36 −0 vendor/cryptojs-v3.1.2/rollups/rabbit-legacy.js
  114. +36 −0 vendor/cryptojs-v3.1.2/rollups/rabbit.js
  115. +33 −0 vendor/cryptojs-v3.1.2/rollups/rc4.js
  116. +29 −0 vendor/cryptojs-v3.1.2/rollups/ripemd160.js
  117. +15 −0 vendor/cryptojs-v3.1.2/rollups/sha1.js
  118. +17 −0 vendor/cryptojs-v3.1.2/rollups/sha224.js
  119. +16 −0 vendor/cryptojs-v3.1.2/rollups/sha256.js
  120. +19 −0 vendor/cryptojs-v3.1.2/rollups/sha3.js
  121. +25 −0 vendor/cryptojs-v3.1.2/rollups/sha384.js
  122. +23 −0 vendor/cryptojs-v3.1.2/rollups/sha512.js
  123. +51 −0 vendor/cryptojs-v3.1.2/rollups/tripledes.js
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


Tested in:

- [ ] Chrome xx
- [ ] FireFox xx
- [ ] Safari xx
- [ ] Brave xx
- [ ] IE Edge
- [ ] IE 11
- [ ] IE 10
- [ ] IE 9
- [ ] IE 8
- [ ] IE 7
- [ ] IE 6
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
sudo: false
language: node_js
node_js:
- "6"
- "5"
- "4"
- "0.12"
- "0.10"
before_install: npm install -g grunt-cli
install: npm install
36 changes: 28 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -2,8 +2,10 @@
module.exports = function(grunt) {
"use strict";
var coreFileList = [
"vendor/cryptojs-v3.0.2/rollups/sha1.js",
"vendor/cryptojs-v3.0.2/components/enc-base64.js",
"vendor/cryptojs-v3.1.2/rollups/sha1.js",
"vendor/cryptojs-v3.1.2/rollups/sha256.js",
"vendor/cryptojs-v3.1.2/components/enc-base64.js",
"vendor/cryptojs-v3.1.2/components/lib-typedarrays.js",
"src/TinCan.js",
"src/Utils.js",
"src/LRS.js",
@@ -25,21 +27,38 @@ module.exports = function(grunt) {
"src/State.js",
"src/ActivityProfile.js",
"src/AgentProfile.js",
"src/About.js"
"src/About.js",
"src/Attachment.js"
],
browserFileList = coreFileList.slice(),
nodeFileList = coreFileList.slice();
nodeFileList = coreFileList.slice(),
pkg,
bower;

browserFileList.push(
"src/Environment/Browser.js"
"src/Environment/Browser.js",
// needed because IE10 doesn't support Uint8ClampedArray
// which is required by CryptoJS for typedarray support
"node_modules/js-polyfills/typedarray.js",
// needed because IE10 doesn't have ArrayBuffer slice
"node_modules/arraybuffer-slice/index.js",
// needed for IE and Safari for TextDecoder/TextEncoder
"node_modules/text-encoding/lib/encoding.js"
);
nodeFileList.push(
"src/Environment/Node.js"
);

pkg = grunt.file.readJSON("package.json");
bower = grunt.file.readJSON("bower.json");

if (pkg.version !== bower.version) {
grunt.fail.fatal("package.json and bower.json versions do not match");
}

// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
pkg: pkg,

watch: {
files: ["src/**/*.js"],
@@ -75,7 +94,8 @@ module.exports = function(grunt) {
onevar: true,
strict: true,
globals: {
TinCan: true
TinCan: true,
JSON: true
}
}
},
@@ -108,7 +128,7 @@ module.exports = function(grunt) {
compile: {
version: "<%= pkg.version %>",
name: "TinCanJS",
description: "Library for working with Tin Can API in JavaScript",
description: "Library for working with the Experience API (Tin Can API) in JavaScript",
url: "http://rusticisoftware.github.com/TinCanJS/",
options: {
paths: "src/",
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
A JavaScript library for implementing Tin Can API.
A JavaScript library for implementing the Experience API (Tin Can API).

[![Build Status](https://travis-ci.org/RusticiSoftware/TinCanJS.png)](https://travis-ci.org/RusticiSoftware/TinCanJS)
[![GitHub release](https://img.shields.io/github/release/RusticiSoftware/TinCanJS.svg?maxAge=2592000)](https://github.com/RusticiSoftware/TinCanJS/releases)
[![npm](https://img.shields.io/npm/v/tincanjs.svg?maxAge=2592000)](https://www.npmjs.com/package/tincanjs)
[![license](https://img.shields.io/github/license/RUsticiSoftware/TinCanJS.svg?maxAge=2592000)]()

For hosted API documentation, basic usage instructions, supported version listing, etc. visit the main project website at:

http://rusticisoftware.github.io/TinCanJS/

For more information about the Tin Can API visit:
For more information about the Experience API visit:

http://tincanapi.com/
http://experienceapi.com/

Browser Usage
-------------

TinCanJS is available via Bower.
TinCanJS is available via `npm` and Bower.

The browser environment is well tested and supports two kinds of Cross Origin requests which
is sufficient to cover most versions of Chrome, FireFox, Safari as well as IE 8+. IE 6+ are
@@ -45,5 +48,19 @@ Environments
------------

Implementing a new Environment should be straightforward and requires overloading a couple
of methods on the `TinCan.LRS` prototype. There are currently two examples, `Environment/Browser`
of methods in the library. There are currently two examples, `Environment/Browser`
and `Environment/Node`.

Attachment Support
------------------

Sending and retrieving statements with attachments via the multipart/mixed request/response
cycle works end to end with binary attachments in Node.js 4+ and in the typical modern browsers:
Chrome 53+, Firefox 48+, Safari 9+, IE 10+ (current versions at time of implementation, older versions
may work without changes but have not been tested). Attachments without included content (those using
only the `fileUrl` property) should be supported in all environments supported by the library.

Several polyfills (TypedArrays, ArrayBuffer w/ slice, Blob, TextDecoder/TextEncoder) are needed
to support various browser versions, if you are targeting a recent enough set of browsers you
can reduce the overall size of the built library by commenting out those polyfills in the
`Gruntfile.js` file and building yourself.
10 changes: 5 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "tincan",
"version": "0.32.0",
"version": "0.50.0",
"homepage": "http://rusticisoftware.github.com/TinCanJS/",
"authors": [
"Brian J. Miller <brian.miller@scorm.com>"
"Brian J. Miller <brian.miller@rusticisoftware.com>"
],
"description": "A JavaScript library for talking Tin Can to the world.",
"keywords": [
@@ -14,7 +14,8 @@
"lrs",
"experienceapi",
"experience api",
"xapi"
"xapi",
"cmi5"
],
"license": "Apache 2.0",
"main": [
@@ -29,7 +30,6 @@
"doc",
"src",
"test",
"vendor",
"yuidoc.json"
"vendor"
]
}
Loading