├── robots.txt ├── bower_components ├── es5-shim │ ├── .gitignore │ ├── tests │ │ ├── helpers │ │ │ ├── h.js │ │ │ ├── h-matchers.js │ │ │ └── h-kill.js │ │ ├── lib │ │ │ ├── jasmine_favicon.png │ │ │ ├── jasmine.css │ │ │ ├── jasmine-html.js │ │ │ └── json2.js │ │ ├── spec │ │ │ ├── s-number.js │ │ │ ├── s-string.js │ │ │ ├── s-function.js │ │ │ ├── s-object.js │ │ │ └── s-date.js │ │ ├── index.min.html │ │ └── index.html │ ├── .bower.json │ ├── LICENSE │ ├── package.json │ ├── CONTRIBUTORS.md │ ├── CHANGES │ ├── es5-sham.map │ ├── README.md │ ├── es5-sham.min.js │ ├── es5-shim.min.js │ ├── es5-shim.map │ └── es5-sham.js ├── angular-mocks │ ├── README.md │ ├── bower.json │ └── .bower.json ├── angular-cookies │ ├── README.md │ ├── bower.json │ ├── .bower.json │ ├── angular-cookies.min.js │ └── angular-cookies.js ├── angular-resource │ ├── README.md │ ├── bower.json │ ├── .bower.json │ ├── angular-resource.min.js │ └── angular-resource.js ├── angular-sanitize │ ├── README.md │ ├── bower.json │ ├── .bower.json │ └── angular-sanitize.min.js ├── angular-scenario │ ├── README.md │ ├── jstd-scenario-adapter-config.js │ ├── bower.json │ ├── .bower.json │ └── jstd-scenario-adapter.js ├── angular │ ├── bower.json │ └── .bower.json ├── json3 │ ├── bower.json │ ├── .bower.json │ ├── LICENSE │ ├── lib │ │ └── json3.min.js │ └── README.md └── threejs │ └── .bower.json ├── favicon.ico ├── models ├── wall.jpg ├── image1.jpg ├── image2.jpg └── jeep1.jpg ├── README.md ├── views └── main.html ├── scripts ├── app.js ├── controllers │ └── main.js ├── directives │ └── tjsModelViewer.js └── libraries │ └── threejs │ └── AssimpJSONLoader.js ├── styles └── main.css ├── LICENSE ├── index.html └── 404.html /robots.txt: -------------------------------------------------------------------------------- 1 | # robotstxt.org 2 | 3 | User-agent: * 4 | -------------------------------------------------------------------------------- /bower_components/es5-shim/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2fdevs/angular-threejs/HEAD/favicon.ico -------------------------------------------------------------------------------- /models/wall.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2fdevs/angular-threejs/HEAD/models/wall.jpg -------------------------------------------------------------------------------- /models/image1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2fdevs/angular-threejs/HEAD/models/image1.jpg -------------------------------------------------------------------------------- /models/image2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2fdevs/angular-threejs/HEAD/models/image2.jpg -------------------------------------------------------------------------------- /models/jeep1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2fdevs/angular-threejs/HEAD/models/jeep1.jpg -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/helpers/h.js: -------------------------------------------------------------------------------- 1 | function implement() { 2 | throw 'Not implemented'; 3 | } -------------------------------------------------------------------------------- /bower_components/angular-mocks/README.md: -------------------------------------------------------------------------------- 1 | bower-angular-mocks 2 | =================== 3 | 4 | angular-mocks.js bower repo -------------------------------------------------------------------------------- /bower_components/angular-cookies/README.md: -------------------------------------------------------------------------------- 1 | bower-angular-cookies 2 | ===================== 3 | 4 | angular-cookies bower repo -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # angular-threejs 2 | An AngularJS + ThreeJS example: http://twofuckingdevelopers.com/2014/02/mixing-angularjs-threejs/ 3 | -------------------------------------------------------------------------------- /bower_components/angular-resource/README.md: -------------------------------------------------------------------------------- 1 | bower-angular-resource 2 | ====================== 3 | 4 | angular-resource bower repo -------------------------------------------------------------------------------- /bower_components/angular-sanitize/README.md: -------------------------------------------------------------------------------- 1 | bower-angular-sanitize 2 | ====================== 3 | 4 | angular-sanitize bower repo -------------------------------------------------------------------------------- /bower_components/angular-scenario/README.md: -------------------------------------------------------------------------------- 1 | bower-angular-scenario 2 | ====================== 3 | 4 | bower repo for angular-scenario.js -------------------------------------------------------------------------------- /bower_components/angular/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.0.8", 4 | "main": "./angular.js", 5 | "dependencies": { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/lib/jasmine_favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2fdevs/angular-threejs/HEAD/bower_components/es5-shim/tests/lib/jasmine_favicon.png -------------------------------------------------------------------------------- /bower_components/angular-mocks/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-mocks", 3 | "version": "1.0.8", 4 | "main": "./angular-mocks.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /bower_components/angular-scenario/jstd-scenario-adapter-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration for jstd scenario adapter 3 | */ 4 | var jstdScenarioAdapter = { 5 | relativeUrlPrefix: '/build/docs/' 6 | }; 7 | -------------------------------------------------------------------------------- /bower_components/angular-cookies/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-cookies", 3 | "version": "1.0.8", 4 | "main": "./angular-cookies.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /bower_components/angular-resource/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-resource", 3 | "version": "1.0.8", 4 | "main": "./angular-resource.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /bower_components/angular-sanitize/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-sanitize", 3 | "version": "1.0.8", 4 | "main": "./angular-sanitize.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /bower_components/angular-scenario/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-scenario", 3 | "version": "1.0.8", 4 | "main": "./angular-scenario.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /views/main.html: -------------------------------------------------------------------------------- 1 |
2 |

AngularJS + ThreeJS

3 | 4 |

Loading WebGL content with AngularJS

5 | 6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /scripts/app.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | angular.module('angularjsThreejsApp', ["tjsModelViewer"]) 4 | .config(function ($routeProvider) { 5 | $routeProvider 6 | .when('/', { 7 | templateUrl: 'views/main.html', 8 | controller: 'MainCtrl' 9 | }) 10 | .otherwise({ 11 | redirectTo: '/' 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /bower_components/es5-shim/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es5-shim", 3 | "homepage": "https://github.com/es-shims/es5-shim", 4 | "version": "2.0.12", 5 | "_release": "2.0.12", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v2.0.12", 9 | "commit": "892efc8ed2184d8bf1432d175ba36ec863fb0edc" 10 | }, 11 | "_source": "git://github.com/es-shims/es5-shim.git", 12 | "_target": "~2.0.8", 13 | "_originalSource": "es5-shim" 14 | } -------------------------------------------------------------------------------- /bower_components/json3/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "json3", 3 | "version": "3.2.6", 4 | "main": "lib/json3.min.js", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/bestiejs/json3.git" 8 | }, 9 | "ignore": [ 10 | ".*", 11 | "build.js", 12 | "index.html", 13 | "index.js", 14 | "component.json", 15 | "package.json", 16 | "benchmark", 17 | "page", 18 | "test", 19 | "vendor" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /scripts/controllers/main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | angular.module('angularjsThreejsApp') 4 | .controller('MainCtrl', function ($scope) { 5 | $scope.assimpModelUrl = "models/jeep1.ms3d.json"; 6 | 7 | $scope.changeModel = function() { 8 | if ($scope.assimpModelUrl == "models/interior.3ds.json") { 9 | $scope.assimpModelUrl = "models/jeep1.ms3d.json"; 10 | } 11 | else { 12 | $scope.assimpModelUrl = "models/interior.3ds.json"; 13 | } 14 | }; 15 | }); 16 | -------------------------------------------------------------------------------- /bower_components/angular/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.0.8", 4 | "main": "./angular.js", 5 | "dependencies": {}, 6 | "homepage": "https://github.com/angular/bower-angular", 7 | "_release": "1.0.8", 8 | "_resolution": { 9 | "type": "version", 10 | "tag": "v1.0.8", 11 | "commit": "b2006330eef656b8e89a883feff7d7d2f3e5afed" 12 | }, 13 | "_source": "git://github.com/angular/bower-angular.git", 14 | "_target": "~1.0.7", 15 | "_originalSource": "angular" 16 | } -------------------------------------------------------------------------------- /bower_components/angular-mocks/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-mocks", 3 | "version": "1.0.8", 4 | "main": "./angular-mocks.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | }, 8 | "homepage": "https://github.com/angular/bower-angular-mocks", 9 | "_release": "1.0.8", 10 | "_resolution": { 11 | "type": "version", 12 | "tag": "v1.0.8", 13 | "commit": "559ca65ea28cd1a34dd47b7cec3a2e5842153d37" 14 | }, 15 | "_source": "git://github.com/angular/bower-angular-mocks.git", 16 | "_target": "~1.0.7", 17 | "_originalSource": "angular-mocks" 18 | } -------------------------------------------------------------------------------- /styles/main.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #fafafa; 3 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 4 | color: #333; 5 | } 6 | 7 | .hero-unit { 8 | margin: 50px auto 0 auto; 9 | width: 600px; 10 | font-size: 18px; 11 | font-weight: 200; 12 | line-height: 30px; 13 | background-color: #eee; 14 | border-radius: 6px; 15 | padding: 60px; 16 | } 17 | 18 | .hero-unit h1 { 19 | font-size: 60px; 20 | line-height: 1; 21 | letter-spacing: -1px; 22 | } 23 | 24 | canvas { 25 | width: 100%; 26 | height: 100% 27 | } 28 | -------------------------------------------------------------------------------- /bower_components/angular-cookies/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-cookies", 3 | "version": "1.0.8", 4 | "main": "./angular-cookies.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | }, 8 | "homepage": "https://github.com/angular/bower-angular-cookies", 9 | "_release": "1.0.8", 10 | "_resolution": { 11 | "type": "version", 12 | "tag": "v1.0.8", 13 | "commit": "656426cc1d2bff688ae8d2dd0761dc165be84014" 14 | }, 15 | "_source": "git://github.com/angular/bower-angular-cookies.git", 16 | "_target": "~1.0.7", 17 | "_originalSource": "angular-cookies" 18 | } -------------------------------------------------------------------------------- /bower_components/angular-resource/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-resource", 3 | "version": "1.0.8", 4 | "main": "./angular-resource.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | }, 8 | "homepage": "https://github.com/angular/bower-angular-resource", 9 | "_release": "1.0.8", 10 | "_resolution": { 11 | "type": "version", 12 | "tag": "v1.0.8", 13 | "commit": "57119c33a79e9343daf0f50e58f8b73cf234bffb" 14 | }, 15 | "_source": "git://github.com/angular/bower-angular-resource.git", 16 | "_target": "~1.0.7", 17 | "_originalSource": "angular-resource" 18 | } -------------------------------------------------------------------------------- /bower_components/angular-sanitize/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-sanitize", 3 | "version": "1.0.8", 4 | "main": "./angular-sanitize.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | }, 8 | "homepage": "https://github.com/angular/bower-angular-sanitize", 9 | "_release": "1.0.8", 10 | "_resolution": { 11 | "type": "version", 12 | "tag": "v1.0.8", 13 | "commit": "99e5d0b21030ab92a1a9bda044a883d23d764b1b" 14 | }, 15 | "_source": "git://github.com/angular/bower-angular-sanitize.git", 16 | "_target": "~1.0.7", 17 | "_originalSource": "angular-sanitize" 18 | } -------------------------------------------------------------------------------- /bower_components/angular-scenario/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-scenario", 3 | "version": "1.0.8", 4 | "main": "./angular-scenario.js", 5 | "dependencies": { 6 | "angular": "1.0.8" 7 | }, 8 | "homepage": "https://github.com/angular/bower-angular-scenario", 9 | "_release": "1.0.8", 10 | "_resolution": { 11 | "type": "version", 12 | "tag": "v1.0.8", 13 | "commit": "ee9a627b4030cb976b22e107abfa55ac6bd8ba55" 14 | }, 15 | "_source": "git://github.com/angular/bower-angular-scenario.git", 16 | "_target": "~1.0.7", 17 | "_originalSource": "angular-scenario" 18 | } -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/spec/s-number.js: -------------------------------------------------------------------------------- 1 | describe('Number', function () { 2 | 'use strict'; 3 | 4 | describe('toFixed', function () { 5 | it('should convert numbers correctly', function () { 6 | expect((0.00008).toFixed(3)).toBe('0.000'); 7 | expect((0.9).toFixed(0)).toBe('1'); 8 | expect((1.255).toFixed(2)).toBe('1.25'); 9 | expect((1843654265.0774949).toFixed(5)).toBe('1843654265.07749'); 10 | expect((1000000000000000128).toFixed(0)).toBe('1000000000000000128'); 11 | }); 12 | }); 13 | 14 | }); 15 | -------------------------------------------------------------------------------- /bower_components/json3/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "json3", 3 | "version": "3.2.6", 4 | "main": "lib/json3.min.js", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/bestiejs/json3.git" 8 | }, 9 | "ignore": [ 10 | ".*", 11 | "build.js", 12 | "index.html", 13 | "index.js", 14 | "component.json", 15 | "package.json", 16 | "benchmark", 17 | "page", 18 | "test", 19 | "vendor" 20 | ], 21 | "homepage": "https://github.com/bestiejs/json3", 22 | "_release": "3.2.6", 23 | "_resolution": { 24 | "type": "version", 25 | "tag": "v3.2.6", 26 | "commit": "7b89fd94939f970f316420e157a836cc68aa2207" 27 | }, 28 | "_source": "git://github.com/bestiejs/json3.git", 29 | "_target": "~3.2.4", 30 | "_originalSource": "json3" 31 | } -------------------------------------------------------------------------------- /bower_components/angular-cookies/angular-cookies.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.0.8 3 | (c) 2010-2012 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(m,f,l){'use strict';f.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(d,b){var c={},g={},h,i=!1,j=f.copy,k=f.isUndefined;b.addPollFn(function(){var a=b.cookies();h!=a&&(h=a,j(a,g),j(a,c),i&&d.$apply())})();i=!0;d.$watch(function(){var a,e,d;for(a in g)k(c[a])&&b.cookies(a,l);for(a in c)e=c[a],f.isString(e)?e!==g[a]&&(b.cookies(a,e),d=!0):f.isDefined(g[a])?c[a]=g[a]:delete c[a];if(d)for(a in e=b.cookies(),c)c[a]!==e[a]&&(k(e[a])?delete c[a]:c[a]=e[a])});return c}]).factory("$cookieStore", 7 | ["$cookies",function(d){return{get:function(b){return(b=d[b])?f.fromJson(b):b},put:function(b,c){d[b]=f.toJson(c)},remove:function(b){delete d[b]}}}])})(window,window.angular); 8 | -------------------------------------------------------------------------------- /bower_components/threejs/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "three.js", 3 | "homepage": "http://threejs.org/", 4 | "description": "JavaScript 3D library", 5 | "main": "build/three.js", 6 | "keywords": [ 7 | "three", 8 | "threejs", 9 | "three.js", 10 | "3D", 11 | "webgl" 12 | ], 13 | "license": "MIT", 14 | "ignore": [ 15 | "**/.*", 16 | "*.md", 17 | "bower.json", 18 | "docs", 19 | "editor", 20 | "examples", 21 | "src", 22 | "test", 23 | "utils", 24 | "LICENSE" 25 | ], 26 | "_release": "4862f5f111", 27 | "_resolution": { 28 | "type": "branch", 29 | "branch": "master", 30 | "commit": "4862f5f1111346a957ac3e0cb0858be1568d0e03" 31 | }, 32 | "_source": "git://github.com/mrdoob/three.js.git", 33 | "_target": "*", 34 | "_originalSource": "threejs", 35 | "_direct": true 36 | } -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/helpers/h-matchers.js: -------------------------------------------------------------------------------- 1 | beforeEach(function() { 2 | this.addMatchers({ 3 | toExactlyMatch: function(expected) { 4 | var a1, a2, 5 | l, i, 6 | key, 7 | actual = this.actual; 8 | 9 | var getKeys = function(o) { 10 | var a = []; 11 | for(key in o) { 12 | if(o.hasOwnProperty(key)) { 13 | a.push(key); 14 | } 15 | } 16 | return a; 17 | } 18 | a1 = getKeys(actual); 19 | a2 = getKeys(expected); 20 | 21 | l = a1.length; 22 | if(l !== a2.length) { 23 | return false; 24 | } 25 | for(i = 0; i < l; i++) { 26 | key = a1[i]; 27 | expect(key).toEqual(a2[i]); 28 | expect(actual[key]).toEqual(expected[key]); 29 | } 30 | 31 | return true; 32 | } 33 | }) 34 | }); 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Two Fucking Developers 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. 22 | 23 | -------------------------------------------------------------------------------- /bower_components/json3/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013 Kit Cambridge. 2 | http://kitcambridge.be/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/spec/s-string.js: -------------------------------------------------------------------------------- 1 | describe('String', function() { 2 | "use strict"; 3 | describe("trim", function() { 4 | var test = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFFHello, World!\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF"; 5 | 6 | it('trims all ES5 whitespace', function() { 7 | expect(test.trim()).toEqual("Hello, World!"); 8 | expect(test.trim().length).toEqual(13); 9 | }); 10 | }); 11 | 12 | describe("split", function() { 13 | var test = "ab"; 14 | 15 | it('If "separator" is undefined must return Array with one String - "this" string', function() { 16 | expect(test.split()).toEqual([test]); 17 | expect(test.split(void 0)).toEqual([test]); 18 | }); 19 | 20 | it('If "separator" is undefined and "limit" set to 0 must return Array[]', function() { 21 | expect(test.split(void 0, 0)).toEqual([]); 22 | }); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /bower_components/es5-shim/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright 2009, 2010 Kristopher Michael Kowal. All rights reserved. 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /bower_components/es5-shim/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es5-shim", 3 | "version": "2.0.12", 4 | "description": "ES5 as implementable on previous engines", 5 | "homepage": "http://github.com/kriskowal/es5-shim/", 6 | "contributors": [ 7 | "Kris Kowal (http://github.com/kriskowal/)", 8 | "Sami Samhuri (http://samhuri.net/)", 9 | "Florian Schäfer (http://github.com/fschaefer)", 10 | "Irakli Gozalishvili (http://jeditoolkit.com)", 11 | "Kit Cambridge (http://kitcambridge.github.com)" 12 | ], 13 | "bugs": { 14 | "mail": "kris@cixar.com", 15 | "url": "http://github.com/kriskowal/es5-shim/issues" 16 | }, 17 | "licenses": [ 18 | { 19 | "type": "MIT", 20 | "url": "http://github.com/kriskowal/es5-shim/raw/master/LICENSE" 21 | } 22 | ], 23 | "main": "es5-shim.js", 24 | "repository": { 25 | "type": "git", 26 | "url": "http://github.com/kriskowal/es5-shim.git" 27 | }, 28 | "scripts": { 29 | "minify": "uglifyjs es5-shim.js --source-map=es5-shim.map -b ascii_only=true,beautify=false > es5-shim.min.js; uglifyjs es5-sham.js --source-map=es5-sham.map -b ascii_only=true,beautify=false > es5-sham.min.js" 30 | }, 31 | "engines": { 32 | "node": ">=0.2.0" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bower_components/es5-shim/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | 2 | - kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License 3 | - tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal 4 | Project) 5 | - dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA 6 | - fschaefer Florian Schäfer Copyright (C) 2010 MIT License 7 | - Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License 8 | - kitcambridge Kit Cambridge Copyright (C) 2011 MIT License 9 | - kossnocorp Sasha Koss XXX TODO License or CLA 10 | - bryanforbes Bryan Forbes XXX TODO License or CLA 11 | - killdream Quildreen Motta Copyright (C) 2011 MIT Licence 12 | - michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD 13 | License 14 | - sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License 15 | - bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain) 16 | - iwyg XXX TODO License or CLA 17 | - DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License 18 | - xavierm02 Montillet Xavier Copyright (C) 2011 MIT License 19 | - Raynos Jake Verbaten Copyright (C) 2011 MIT Licence 20 | - samsonjs Sami Samhuri Copyright (C) 2010 MIT License 21 | - rwldrn Rick Waldron Copyright (C) 2011 MIT License 22 | - lexer Alexey Zakharov XXX TODO License or CLA 23 | - 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.) 24 | Copyright (C) 2009 MIT License 25 | 26 | -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/helpers/h-kill.js: -------------------------------------------------------------------------------- 1 | // This methods allows the killing of built-in functions, 2 | // so the shim can take over with that implementation 3 | var HLP = (function() { 4 | "use strict"; 5 | var kill; 6 | 7 | kill = function(_class, methods) { 8 | /*if(!Array.isArray(methods)) 9 | return;*/ 10 | if(!_class.originals) 11 | _class.originals = {}; 12 | 13 | for (var i = 0, len = methods.length; i < len; i++) { 14 | var obj = methods[i]; 15 | _class.originals[obj] = _class[obj]; 16 | delete _class[obj]; 17 | if (obj in _class) { 18 | // try something more aggressive since V8 at least 19 | // appears to ignore the delete. 20 | _class[obj] = null; 21 | if (_class[obj]) { 22 | console.log("Couln't overwrite", obj, "of", _class); 23 | } 24 | } 25 | } 26 | }; 27 | return { kill: kill }; 28 | }()); 29 | 30 | HLP.kill(Function.prototype, [ 31 | 'bind' 32 | ]); 33 | 34 | HLP.kill(Array, [ 35 | 'isArray' 36 | ]); 37 | 38 | HLP.kill(String.prototype, [ 39 | "trim" 40 | ]); 41 | 42 | HLP.kill(Object, [ 43 | 'keys' 44 | ]); 45 | 46 | HLP.kill(Number.prototype, [ 47 | 'toFixed' 48 | ]); 49 | 50 | HLP.kill(Date, [ 51 | 'now', 'parse' 52 | ]); 53 | 54 | HLP.kill(Date.prototype, [ 55 | "toJSON", "toISOString" 56 | ]); 57 | 58 | HLP.kill(Array.prototype, [ 59 | 'forEach', 'some', 'every', 60 | 'indexOf', 'lastIndexOf', 61 | 'map', 'filter', 62 | 'reduce', 'reduceRight' 63 | ]); 64 | -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/index.min.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Spec Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Jasmine Spec Runner 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /bower_components/angular-resource/angular-resource.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.0.8 3 | (c) 2010-2012 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(C,d,w){'use strict';d.module("ngResource",["ng"]).factory("$resource",["$http","$parse",function(x,y){function s(b,e){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,e?"%20":"+")}function t(b,e){this.template=b+="#";this.defaults=e||{};var a=this.urlParams={};h(b.split(/\W/),function(f){f&&RegExp("(^|[^\\\\]):"+f+"\\W").test(b)&&(a[f]=!0)});this.template=b.replace(/\\:/g,":")}function u(b,e,a){function f(m,a){var b= 7 | {},a=o({},e,a);h(a,function(a,z){var c;a.charAt&&a.charAt(0)=="@"?(c=a.substr(1),c=y(c)(m)):c=a;b[z]=c});return b}function g(a){v(a||{},this)}var k=new t(b),a=o({},A,a);h(a,function(a,b){a.method=d.uppercase(a.method);var e=a.method=="POST"||a.method=="PUT"||a.method=="PATCH";g[b]=function(b,c,d,B){var j={},i,l=p,q=null;switch(arguments.length){case 4:q=B,l=d;case 3:case 2:if(r(c)){if(r(b)){l=b;q=c;break}l=c;q=d}else{j=b;i=c;l=d;break}case 1:r(b)?l=b:e?i=b:j=b;break;case 0:break;default:throw"Expected between 0-4 arguments [params, data, success, error], got "+ 8 | arguments.length+" arguments.";}var n=this instanceof g?this:a.isArray?[]:new g(i);x({method:a.method,url:k.url(o({},f(i,a.params||{}),j)),data:i}).then(function(b){var c=b.data;if(c)a.isArray?(n.length=0,h(c,function(a){n.push(new g(a))})):v(c,n);(l||p)(n,b.headers)},q);return n};g.prototype["$"+b]=function(a,d,h){var m=f(this),j=p,i;switch(arguments.length){case 3:m=a;j=d;i=h;break;case 2:case 1:r(a)?(j=a,i=d):(m=a,j=d||p);case 0:break;default:throw"Expected between 1-3 arguments [params, success, error], got "+ 9 | arguments.length+" arguments.";}g[b].call(this,m,e?this:w,j,i)}});g.bind=function(d){return u(b,o({},e,d),a)};return g}var A={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},p=d.noop,h=d.forEach,o=d.extend,v=d.copy,r=d.isFunction;t.prototype={url:function(b){var e=this,a=this.template,f,g,b=b||{};h(this.urlParams,function(h,c){f=b.hasOwnProperty(c)?b[c]:e.defaults[c];d.isDefined(f)&&f!==null?(g=s(f,!0).replace(/%26/gi,"&").replace(/%3D/gi, 10 | "=").replace(/%2B/gi,"+"),a=a.replace(RegExp(":"+c+"(\\W)","g"),g+"$1")):a=a.replace(RegExp("(/?):"+c+"(\\W)","g"),function(a,b,c){return c.charAt(0)=="/"?c:b+c})});var a=a.replace(/\/?#$/,""),k=[];h(b,function(a,b){e.urlParams[b]||k.push(s(b)+"="+s(a))});k.sort();a=a.replace(/\/*$/,"");return a+(k.length?"?"+k.join("&"):"")}};return u}])})(window,window.angular); 11 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 23 | 24 | 28 | 29 | 30 |
31 | 32 | 33 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /scripts/directives/tjsModelViewer.js: -------------------------------------------------------------------------------- 1 | angular.module("tjsModelViewer", []) 2 | .directive( 3 | "tjsModelViewer", 4 | [function () { 5 | return { 6 | restrict: "E", 7 | scope: { 8 | assimpUrl: "=assimpUrl" 9 | }, 10 | link: function (scope, elem, attr) { 11 | var camera; 12 | var scene; 13 | var renderer; 14 | var previous; 15 | 16 | // init scene 17 | init(); 18 | 19 | // Load jeep model using the AssimpJSONLoader 20 | var loader1 = new THREE.AssimpJSONLoader(); 21 | 22 | scope.$watch("assimpUrl", function(newValue, oldValue) { 23 | if (newValue != oldValue) loadModel(newValue); 24 | }); 25 | 26 | function loadModel(modelUrl) { 27 | loader1.load(modelUrl, function (assimpjson) { 28 | assimpjson.scale.x = assimpjson.scale.y = assimpjson.scale.z = 0.2; 29 | assimpjson.updateMatrix(); 30 | if (previous) scene.remove(previous); 31 | scene.add(assimpjson); 32 | 33 | previous = assimpjson; 34 | }); 35 | } 36 | 37 | loadModel(scope.assimpUrl); 38 | animate(); 39 | 40 | function init() { 41 | camera = new THREE.PerspectiveCamera(50, window.innerWidth / window.innerHeight, 1, 2000); 42 | camera.position.set(2, 4, 5); 43 | scene = new THREE.Scene(); 44 | scene.fog = new THREE.FogExp2(0x000000, 0.035); 45 | // Lights 46 | scene.add(new THREE.AmbientLight(0xcccccc)); 47 | var directionalLight = new THREE.DirectionalLight(/*Math.random() * 0xffffff*/0xeeeeee); 48 | directionalLight.position.x = Math.random() - 0.5; 49 | directionalLight.position.y = Math.random() - 0.5; 50 | directionalLight.position.z = Math.random() - 0.5; 51 | directionalLight.position.normalize(); 52 | scene.add(directionalLight); 53 | 54 | // Renderer 55 | renderer = new THREE.WebGLRenderer(); 56 | renderer.setSize(window.innerWidth, window.innerHeight); 57 | elem[0].appendChild(renderer.domElement); 58 | 59 | // Events 60 | window.addEventListener('resize', onWindowResize, false); 61 | } 62 | 63 | // 64 | function onWindowResize(event) { 65 | renderer.setSize(window.innerWidth, window.innerHeight); 66 | camera.aspect = window.innerWidth / window.innerHeight; 67 | camera.updateProjectionMatrix(); 68 | } 69 | 70 | // 71 | var t = 0; 72 | 73 | function animate() { 74 | requestAnimationFrame(animate); 75 | render(); 76 | } 77 | 78 | // 79 | function render() { 80 | var timer = Date.now() * 0.0005; 81 | camera.position.x = Math.cos(timer) * 10; 82 | camera.position.y = 4; 83 | camera.position.z = Math.sin(timer) * 10; 84 | camera.lookAt(scene.position); 85 | renderer.render(scene, camera); 86 | } 87 | } 88 | } 89 | } 90 | ]); 91 | -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/lib/jasmine.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; 3 | } 4 | 5 | 6 | .jasmine_reporter a:visited, .jasmine_reporter a { 7 | color: #303; 8 | } 9 | 10 | .jasmine_reporter a:hover, .jasmine_reporter a:active { 11 | color: blue; 12 | } 13 | 14 | .run_spec { 15 | float:right; 16 | padding-right: 5px; 17 | font-size: .8em; 18 | text-decoration: none; 19 | } 20 | 21 | .jasmine_reporter { 22 | margin: 0 5px; 23 | } 24 | 25 | .banner { 26 | color: #303; 27 | background-color: #fef; 28 | padding: 5px; 29 | } 30 | 31 | .logo { 32 | float: left; 33 | font-size: 1.1em; 34 | padding-left: 5px; 35 | } 36 | 37 | .logo .version { 38 | font-size: .6em; 39 | padding-left: 1em; 40 | } 41 | 42 | .runner.running { 43 | background-color: yellow; 44 | } 45 | 46 | 47 | .options { 48 | text-align: right; 49 | font-size: .8em; 50 | } 51 | 52 | 53 | 54 | 55 | .suite { 56 | border: 1px outset gray; 57 | margin: 5px 0; 58 | padding-left: 1em; 59 | } 60 | 61 | .suite .suite { 62 | margin: 5px; 63 | } 64 | 65 | .suite.passed { 66 | background-color: #dfd; 67 | } 68 | 69 | .suite.failed { 70 | background-color: #fdd; 71 | } 72 | 73 | .spec { 74 | margin: 5px; 75 | padding-left: 1em; 76 | clear: both; 77 | } 78 | 79 | .spec.failed, .spec.passed, .spec.skipped { 80 | padding-bottom: 5px; 81 | border: 1px solid gray; 82 | } 83 | 84 | .spec.failed { 85 | background-color: #fbb; 86 | border-color: red; 87 | } 88 | 89 | .spec.passed { 90 | background-color: #bfb; 91 | border-color: green; 92 | } 93 | 94 | .spec.skipped { 95 | background-color: #bbb; 96 | } 97 | 98 | .messages { 99 | border-left: 1px dashed gray; 100 | padding-left: 1em; 101 | padding-right: 1em; 102 | } 103 | 104 | .passed { 105 | background-color: #cfc; 106 | display: none; 107 | } 108 | 109 | .failed { 110 | background-color: #fbb; 111 | } 112 | 113 | .skipped { 114 | color: #777; 115 | background-color: #eee; 116 | display: none; 117 | } 118 | 119 | 120 | /*.resultMessage {*/ 121 | /*white-space: pre;*/ 122 | /*}*/ 123 | 124 | .resultMessage span.result { 125 | display: block; 126 | line-height: 2em; 127 | color: black; 128 | } 129 | 130 | .resultMessage .mismatch { 131 | color: black; 132 | } 133 | 134 | .stackTrace { 135 | white-space: pre; 136 | font-size: .8em; 137 | margin-left: 10px; 138 | max-height: 5em; 139 | overflow: auto; 140 | border: 1px inset red; 141 | padding: 1em; 142 | background: #eef; 143 | } 144 | 145 | .finished-at { 146 | padding-left: 1em; 147 | font-size: .6em; 148 | } 149 | 150 | .show-passed .passed, 151 | .show-skipped .skipped { 152 | display: block; 153 | } 154 | 155 | 156 | #jasmine_content { 157 | position:fixed; 158 | right: 100%; 159 | } 160 | 161 | .runner { 162 | border: 1px solid gray; 163 | display: block; 164 | margin: 5px 0; 165 | padding: 2px 0 2px 10px; 166 | } 167 | -------------------------------------------------------------------------------- /bower_components/es5-shim/CHANGES: -------------------------------------------------------------------------------- 1 | 2 | 2.0.0 3 | - Separate reliable shims from dubious shims (shams). 4 | 5 | 1.2.10 6 | - Group-effort Style Cleanup 7 | - Took a stab at fixing Object.defineProperty on IE8 without 8 | bad side-effects. (@hax) 9 | - Object.isExtensible no longer fakes it. (@xavierm) 10 | - Date.prototype.toISOString no longer deals with partial 11 | ISO dates, per spec (@kitcambridge) 12 | - More (mostly from @bryanforbes) 13 | 14 | 1.2.9 15 | - Corrections to toISOString by @kitcambridge 16 | - Fixed three bugs in array methods revealed by Jasmine tests. 17 | - Cleaned up Function.prototype.bind with more fixes and tests from 18 | @bryanforbes. 19 | 20 | 1.2.8 21 | - Actually fixed problems with Function.prototype.bind, and regressions 22 | from 1.2.7 (@bryanforbes, @jdalton #36) 23 | 24 | 1.2.7 - REGRESSED 25 | - Fixed problems with Function.prototype.bind when called as a constructor. 26 | (@jdalton #36) 27 | 28 | 1.2.6 29 | - Revised Date.parse to match ES 5.1 (kitcambridge) 30 | 31 | 1.2.5 32 | - Fixed a bug for padding it Date..toISOString (tadfisher issue #33) 33 | 34 | 1.2.4 35 | - Fixed a descriptor bug in Object.defineProperty (raynos) 36 | 37 | 1.2.3 38 | - Cleaned up RequireJS and 154 | 155 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /bower_components/es5-shim/es5-sham.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["es5-sham.js"],"names":["definition","define","YUI","add","call","Function","prototype","prototypeOfObject","Object","owns","bind","hasOwnProperty","defineGetter","defineSetter","lookupGetter","lookupSetter","supportsAccessors","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","getPrototypeOf","object","__proto__","constructor","doesGetOwnPropertyDescriptorWork","sentinel","getOwnPropertyDescriptor","value","exception","defineProperty","getOwnPropertyDescriptorWorksOnObject","getOwnPropertyDescriptorWorksOnDom","document","createElement","getOwnPropertyDescriptorFallback","ERR_NON_OBJECT","property","TypeError","descriptor","enumerable","configurable","getter","setter","get","set","writable","getOwnPropertyNames","keys","create","createEmpty","supportsProto","iframe","parent","body","documentElement","style","display","appendChild","src","empty","contentWindow","removeChild","propertyIsEnumerable","isPrototypeOf","toLocaleString","toString","valueOf","Empty","properties","Type","defineProperties","doesDefinePropertyWork","definePropertyWorksOnObject","definePropertyWorksOnDom","definePropertyFallback","definePropertiesFallback","ERR_NON_OBJECT_DESCRIPTOR","ERR_NON_OBJECT_TARGET","ERR_ACCESSORS_NOT_SUPPORTED","seal","freeze","freezeObject","preventExtensions","isSealed","isFrozen","isExtensible","name","returnValue"],"mappings":"CAIA,SAAWA,YAEP,SAAWC,SAAU,WAAY,CAC7BA,OAAOD,gBAEJ,UAAWE,MAAO,WAAY,CACjCA,IAAIC,IAAI,WAAYH,gBAEjB,CACHA,gBAEL,WAGH,GAAII,MAAOC,SAASC,UAAUF,IAC9B,IAAIG,mBAAoBC,OAAOF,SAC/B,IAAIG,MAAOL,KAAKM,KAAKH,kBAAkBI,eAGvC,IAAIC,aACJ,IAAIC,aACJ,IAAIC,aACJ,IAAIC,aACJ,IAAIC,kBACJ,IAAKA,kBAAoBP,KAAKF,kBAAmB,oBAAsB,CACnEK,aAAeR,KAAKM,KAAKH,kBAAkBU,iBAC3CJ,cAAeT,KAAKM,KAAKH,kBAAkBW,iBAC3CJ,cAAeV,KAAKM,KAAKH,kBAAkBY,iBAC3CJ,cAAeX,KAAKM,KAAKH,kBAAkBa,kBAK/C,IAAKZ,OAAOa,eAAgB,CAIxBb,OAAOa,eAAiB,QAASA,gBAAeC,QAC5C,MAAOA,QAAOC,YACVD,OAAOE,YACDF,OAAOE,YAAYlB,UACnBC,oBAQlB,QAASkB,kCAAiCH,QACtC,IACIA,OAAOI,SAAW,CAClB,OAAOlB,QAAOmB,yBACNL,OACA,YACNM,QAAU,EACd,MAAOC,aAOb,GAAIrB,OAAOsB,eAAgB,CACvB,GAAIC,uCACAN,oCACJ,IAAIO,0CAA4CC,WAAY,aAC5DR,iCAAiCQ,SAASC,cAA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B,MAAO,SAASD,QAAO3D,QACnB,SAAWA,SAAU,WAAY,CAC7B,MAAOA,YACJ,CACH,MAAO4D,cAAa5D,WAG7Bd,OAAOyE,QAKd,IAAKzE,OAAO2E,kBAAmB,CAC3B3E,OAAO2E,kBAAoB,QAASA,mBAAkB7D,QAIlD,MAAOA,SAMf,IAAKd,OAAO4E,SAAU,CAClB5E,OAAO4E,SAAW,QAASA,UAAS9D,QAChC,MAAO,QAMf,IAAKd,OAAO6E,SAAU,CAClB7E,OAAO6E,SAAW,QAASA,UAAS/D,QAChC,MAAO,QAMf,IAAKd,OAAO8E,aAAc,CACtB9E,OAAO8E,aAAe,QAASA,cAAahE,QAExC,GAAId,OAAOc,UAAYA,OAAQ,CAC3B,KAAM,IAAIgB,WAGd,GAAIiD,MAAO,EACX,OAAO9E,KAAKa,OAAQiE,MAAO,CACvBA,MAAQ,IAEZjE,OAAOiE,MAAQ,IACf,IAAIC,aAAc/E,KAAKa,OAAQiE,YACxBjE,QAAOiE,KACd,OAAOC"} -------------------------------------------------------------------------------- /bower_components/es5-shim/README.md: -------------------------------------------------------------------------------- 1 | 2 | `es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to 3 | contain all EcmaScript 5 methods that can be faithfully emulated with a 4 | legacy JavaScript engine. 5 | 6 | `es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as 7 | closely as possible. For these methods, as closely as possible to ES5 8 | is not very close. Many of these shams are intended only to allow code 9 | to be written to ES5 without causing run-time errors in older engines. 10 | In many cases, this means that these shams cause many ES5 methods to 11 | silently fail. Decide carefully whether this is what you want. 12 | 13 | 14 | ## Tests 15 | 16 | The tests are written with the Jasmine BDD test framework. 17 | To run the tests, navigate to /tests/. 18 | 19 | In order to run against the shim-code, the tests attempt to kill the current 20 | implementation of the missing methods. This happens in /tests/helpers/h-kill.js. 21 | So in order to run the tests against the built-in methods, invalidate that file somehow 22 | (comment-out, delete the file, delete the script-tag, etc.). 23 | 24 | ## Shims 25 | 26 | ### Complete tests ### 27 | 28 | * Array.prototype.every 29 | * Array.prototype.filter 30 | * Array.prototype.forEach 31 | * Array.prototype.indexOf 32 | * Array.prototype.lastIndexOf 33 | * Array.prototype.map 34 | * Array.prototype.some 35 | * Array.prototype.reduce 36 | * Array.prototype.reduceRight 37 | * Array.isArray 38 | * Date.now 39 | * Date.prototype.toJSON 40 | * Function.prototype.bind 41 | * /!\ Caveat: the bound function's length is always 0. 42 | * /!\ Caveat: the bound function has a prototype property. 43 | * /!\ Caveat: bound functions do not try too hard to keep you 44 | from manipulating their ``arguments`` and ``caller`` properties. 45 | * /!\ Caveat: bound functions don't have checks in ``call`` and 46 | ``apply`` to avoid executing as a constructor. 47 | * Object.keys 48 | * String.prototype.trim 49 | 50 | ### Untested ### 51 | 52 | * Date.parse (for ISO parsing) 53 | * Date.prototype.toISOString 54 | 55 | ## Shams 56 | 57 | * /?\ Object.create 58 | 59 | For the case of simply "begetting" an object that 60 | inherits prototypically from another, this should work 61 | fine across legacy engines. 62 | 63 | /!\ Object.create(null) will work only in browsers that 64 | support prototype assignment. This creates an object 65 | that does not have any properties inherited from 66 | Object.prototype. It will silently fail otherwise. 67 | 68 | /!\ The second argument is passed to 69 | Object.defineProperties which will probably fail 70 | silently. 71 | 72 | * /?\ Object.getPrototypeOf 73 | 74 | This will return "undefined" in some cases. It uses 75 | __proto__ if it's available. Failing that, it uses 76 | constructor.prototype, which depends on the constructor 77 | property of the object's prototype having not been 78 | replaced. If your object was created like this, it 79 | won't work: 80 | 81 | function Foo() { 82 | } 83 | Foo.prototype = {}; 84 | 85 | Because the prototype reassignment destroys the 86 | constructor property. 87 | 88 | This will work for all objects that were created using 89 | `Object.create` implemented with this library. 90 | 91 | * /!\ Object.getOwnPropertyNames 92 | 93 | This method uses Object.keys, so it will not be accurate 94 | on legacy engines. 95 | 96 | * Object.isSealed 97 | 98 | Returns "false" in all legacy engines for all objects, 99 | which is conveniently guaranteed to be accurate. 100 | 101 | * Object.isFrozen 102 | 103 | Returns "false" in all legacy engines for all objects, 104 | which is conveniently guaranteed to be accurate. 105 | 106 | * Object.isExtensible 107 | 108 | Works like a charm, by trying very hard to extend the 109 | object then redacting the extension. 110 | 111 | ### Fail silently 112 | 113 | * /!\ Object.getOwnPropertyDescriptor 114 | 115 | The behavior of this shim does not conform to ES5. It 116 | should probably not be used at this time, until its 117 | behavior has been reviewed and been confirmed to be 118 | useful in legacy engines. 119 | 120 | * /!\ Object.defineProperty 121 | 122 | This method will silently fail to set "writable", 123 | "enumerable", and "configurable" properties. 124 | 125 | Providing a getter or setter with "get" or "set" on a 126 | descriptor will silently fail on engines that lack 127 | "__defineGetter__" and "__defineSetter__", which include 128 | all versions of IE up to version 8 so far. 129 | 130 | IE 8 provides a version of this method but it only works 131 | on DOM objects. Thus, the shim will not get installed 132 | and attempts to set "value" properties will fail 133 | silently on non-DOM objects. 134 | 135 | https://github.com/kriskowal/es5-shim/issues#issue/5 136 | 137 | * /!\ Object.defineProperties 138 | 139 | This uses the Object.defineProperty shim 140 | 141 | * Object.seal 142 | 143 | Silently fails on all legacy engines. This should be 144 | fine unless you are depending on the safety and security 145 | provisions of this method, which you cannot possibly 146 | obtain in legacy engines. 147 | 148 | * Object.freeze 149 | 150 | Silently fails on all legacy engines. This should be 151 | fine unless you are depending on the safety and security 152 | provisions of this method, which you cannot possibly 153 | obtain in legacy engines. 154 | 155 | * Object.preventExtensions 156 | 157 | Silently fails on all legacy engines. This should be 158 | fine unless you are depending on the safety and security 159 | provisions of this method, which you cannot possibly 160 | obtain in legacy engines. 161 | 162 | -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/spec/s-function.js: -------------------------------------------------------------------------------- 1 | 2 | describe('Function', function() { 3 | "use strict"; 4 | describe('bind', function() { 5 | var actual, expected, 6 | testSubject; 7 | 8 | testSubject = { 9 | push: function(o) { 10 | this.a.push(o); 11 | } 12 | }; 13 | 14 | function func() { 15 | Array.prototype.forEach.call(arguments, function(a) { 16 | this.push(a); 17 | }, this); 18 | return this; 19 | }; 20 | 21 | beforeEach(function() { 22 | actual = []; 23 | testSubject.a = []; 24 | }); 25 | 26 | it('binds properly without a context', function() { 27 | var context; 28 | testSubject.func = function() { 29 | context = this; 30 | }.bind(); 31 | testSubject.func(); 32 | expect(context).toBe(function() {return this}.call()); 33 | }); 34 | it('binds properly without a context, and still supplies bound arguments', function() { 35 | var a, context; 36 | testSubject.func = function() { 37 | a = Array.prototype.slice.call(arguments); 38 | context = this; 39 | }.bind(undefined, 1,2,3); 40 | testSubject.func(1,2,3); 41 | expect(a).toEqual([1,2,3,1,2,3]); 42 | expect(context).toBe(function() {return this}.call()); 43 | }); 44 | it('binds a context properly', function() { 45 | testSubject.func = func.bind(actual); 46 | testSubject.func(1,2,3); 47 | expect(actual).toEqual([1,2,3]); 48 | expect(testSubject.a).toEqual([]); 49 | }); 50 | it('binds a context and supplies bound arguments', function() { 51 | testSubject.func = func.bind(actual, 1,2,3); 52 | testSubject.func(4,5,6); 53 | expect(actual).toEqual([1,2,3,4,5,6]); 54 | expect(testSubject.a).toEqual([]); 55 | }); 56 | 57 | it('returns properly without binding a context', function() { 58 | testSubject.func = function() { 59 | return this; 60 | }.bind(); 61 | var context = testSubject.func(); 62 | expect(context).toBe(function() {return this}.call()); 63 | }); 64 | it('returns properly without binding a context, and still supplies bound arguments', function() { 65 | var context; 66 | testSubject.func = function() { 67 | context = this; 68 | return Array.prototype.slice.call(arguments); 69 | }.bind(undefined, 1,2,3); 70 | actual = testSubject.func(1,2,3); 71 | expect(context).toBe(function() {return this}.call()); 72 | expect(actual).toEqual([1,2,3,1,2,3]); 73 | }); 74 | it('returns properly while binding a context properly', function() { 75 | var ret; 76 | testSubject.func = func.bind(actual); 77 | ret = testSubject.func(1,2,3); 78 | expect(ret).toBe(actual); 79 | expect(ret).not.toBe(testSubject); 80 | }); 81 | it('returns properly while binding a context and supplies bound arguments', function() { 82 | var ret; 83 | testSubject.func = func.bind(actual, 1,2,3); 84 | ret = testSubject.func(4,5,6); 85 | expect(ret).toBe(actual); 86 | expect(ret).not.toBe(testSubject); 87 | }); 88 | it('passes the correct arguments as a constructor', function() { 89 | var ret, expected = { name: "Correct" }; 90 | testSubject.func = function(arg) { 91 | return arg; 92 | }.bind({ name: "Incorrect" }); 93 | ret = new testSubject.func(expected); 94 | expect(ret).toBe(expected); 95 | }); 96 | it('returns the return value of the bound function when called as a constructor', function () { 97 | var oracle = [1, 2, 3]; 98 | var subject = function () { 99 | return oracle; 100 | }.bind(null); 101 | var result = new subject; 102 | expect(result).toBe(oracle); 103 | }); 104 | it('returns the correct value if constructor returns primitive', function() { 105 | var oracle = [1, 2, 3]; 106 | var subject = function () { 107 | return oracle; 108 | }.bind(null); 109 | var result = new subject; 110 | expect(result).toBe(oracle); 111 | 112 | oracle = {}; 113 | result = new subject; 114 | expect(result).toBe(oracle); 115 | 116 | oracle = function(){}; 117 | result = new subject; 118 | expect(result).toBe(oracle); 119 | 120 | oracle = "asdf"; 121 | result = new subject; 122 | expect(result).not.toBe(oracle); 123 | 124 | oracle = null; 125 | result = new subject; 126 | expect(result).not.toBe(oracle); 127 | 128 | oracle = true; 129 | result = new subject; 130 | expect(result).not.toBe(oracle); 131 | 132 | oracle = 1; 133 | result = new subject; 134 | expect(result).not.toBe(oracle); 135 | }); 136 | it('returns the value that instance of original "class" when called as a constructor', function() { 137 | var classA = function(x) { 138 | this.name = x || "A"; 139 | } 140 | var classB = classA.bind(null, "B"); 141 | 142 | var result = new classB; 143 | expect(result instanceof classA).toBe(true); 144 | expect(result instanceof classB).toBe(true); 145 | }); 146 | }); 147 | }); 148 | -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/spec/s-object.js: -------------------------------------------------------------------------------- 1 | describe('Object', function () { 2 | "use strict"; 3 | 4 | describe("Object.keys", function () { 5 | var obj = { 6 | "str": "boz", 7 | "obj": { }, 8 | "arr": [], 9 | "bool": true, 10 | "num": 42, 11 | "null": null, 12 | "undefined": undefined 13 | }; 14 | 15 | var loopedValues = []; 16 | for (var k in obj) { 17 | loopedValues.push(k); 18 | } 19 | 20 | var keys = Object.keys(obj); 21 | it('should have correct length', function () { 22 | expect(keys.length).toBe(7); 23 | }); 24 | 25 | it('should return an Array', function () { 26 | expect(Array.isArray(keys)).toBe(true); 27 | }); 28 | 29 | it('should return names which are own properties', function () { 30 | keys.forEach(function (name) { 31 | expect(obj.hasOwnProperty(name)).toBe(true); 32 | }); 33 | }); 34 | 35 | it('should return names which are enumerable', function () { 36 | keys.forEach(function (name) { 37 | expect(loopedValues.indexOf(name)).toNotBe(-1); 38 | }) 39 | }); 40 | 41 | it('should throw error for non object', function () { 42 | var e = {}; 43 | expect(function () { 44 | try { 45 | Object.keys(42) 46 | } catch (err) { 47 | throw e; 48 | } 49 | }).toThrow(e); 50 | }); 51 | }); 52 | 53 | describe("Object.isExtensible", function () { 54 | var obj = { }; 55 | 56 | it('should return true if object is extensible', function () { 57 | expect(Object.isExtensible(obj)).toBe(true); 58 | }); 59 | 60 | it('should return false if object is not extensible', function () { 61 | expect(Object.isExtensible(Object.preventExtensions(obj))).toBe(false); 62 | }); 63 | 64 | it('should return false if object is seal', function () { 65 | expect(Object.isExtensible(Object.seal(obj))).toBe(false); 66 | }); 67 | 68 | it('should return false if object is freeze', function () { 69 | expect(Object.isExtensible(Object.freeze(obj))).toBe(false); 70 | }); 71 | 72 | it('should throw error for non object', function () { 73 | var e1 = {}; 74 | expect(function () { 75 | try { 76 | Object.isExtensible(42) 77 | } catch (err) { 78 | throw e1; 79 | } 80 | }).toThrow(e1); 81 | }); 82 | }); 83 | 84 | describe("Object.defineProperty", function () { 85 | var obj; 86 | 87 | beforeEach(function() { 88 | obj = {}; 89 | 90 | Object.defineProperty(obj, 'name', { 91 | value : 'Testing', 92 | configurable: true, 93 | enumerable: true, 94 | writable: true 95 | }); 96 | }); 97 | 98 | it('should return the initial value', function () { 99 | expect(obj.hasOwnProperty('name')).toBeTruthy(); 100 | expect(obj.name).toBe('Testing'); 101 | }); 102 | 103 | it('should be setable', function () { 104 | obj.name = 'Other'; 105 | expect(obj.name).toBe('Other'); 106 | }); 107 | 108 | it('should return the parent initial value', function () { 109 | var child = Object.create(obj, {}); 110 | 111 | expect(child.name).toBe('Testing'); 112 | expect(child.hasOwnProperty('name')).toBeFalsy(); 113 | }); 114 | 115 | it('should not override the parent value', function () { 116 | var child = Object.create(obj, {}); 117 | 118 | Object.defineProperty(child, 'name', { 119 | value : 'Other' 120 | }); 121 | 122 | expect(obj.name).toBe('Testing'); 123 | expect(child.name).toBe('Other'); 124 | }); 125 | 126 | it('should throw error for non object', function () { 127 | expect(function () { 128 | Object.defineProperty(42, 'name', {}); 129 | }).toThrow(); 130 | }); 131 | }); 132 | 133 | describe("Object.getOwnPropertyDescriptor", function () { 134 | it('should return undefined because the object does not own the property', function () { 135 | var descr = Object.getOwnPropertyDescriptor({}, 'name'); 136 | 137 | expect(descr).toBeUndefined() 138 | }); 139 | 140 | it('should return a data descriptor', function () { 141 | var descr = Object.getOwnPropertyDescriptor({name: 'Testing'}, 'name'); 142 | 143 | expect(descr).not.toBeUndefined(); 144 | expect(descr.value).toBe('Testing'); 145 | expect(descr.writable).toBe(true); 146 | expect(descr.enumerable).toBe(true); 147 | expect(descr.configurable).toBe(true); 148 | }); 149 | 150 | it('should return undefined because the object does not own the property', function () { 151 | var descr = Object.getOwnPropertyDescriptor(Object.create({name: 'Testing'}, {}), 'name'); 152 | 153 | expect(descr).toBeUndefined() 154 | }); 155 | 156 | it('should return a data descriptor', function () { 157 | var obj = Object.create({}, { 158 | name: { 159 | value : 'Testing', 160 | configurable: true, 161 | enumerable: true, 162 | writable: true 163 | } 164 | }); 165 | 166 | var descr = Object.getOwnPropertyDescriptor(obj, 'name'); 167 | 168 | expect(descr).not.toBeUndefined(); 169 | expect(descr.value).toBe('Testing'); 170 | expect(descr.writable).toBe(true); 171 | expect(descr.enumerable).toBe(true); 172 | expect(descr.configurable).toBe(true); 173 | }); 174 | 175 | it('should throw error for non object', function () { 176 | expect(function () { 177 | Object.getOwnPropertyDescriptor(42, 'name'); 178 | }).toThrow(); 179 | }); 180 | }); 181 | }); 182 | -------------------------------------------------------------------------------- /bower_components/es5-shim/es5-sham.min.js: -------------------------------------------------------------------------------- 1 | (function(definition){if(typeof define=="function"){define(definition)}else if(typeof YUI=="function"){YUI.add("es5-sham",definition)}else{definition()}})(function(){var call=Function.prototype.call;var prototypeOfObject=Object.prototype;var owns=call.bind(prototypeOfObject.hasOwnProperty);var defineGetter;var defineSetter;var lookupGetter;var lookupSetter;var supportsAccessors;if(supportsAccessors=owns(prototypeOfObject,"__defineGetter__")){defineGetter=call.bind(prototypeOfObject.__defineGetter__);defineSetter=call.bind(prototypeOfObject.__defineSetter__);lookupGetter=call.bind(prototypeOfObject.__lookupGetter__);lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)}if(!Object.getPrototypeOf){Object.getPrototypeOf=function getPrototypeOf(object){return object.__proto__||(object.constructor?object.constructor.prototype:prototypeOfObject)}}function doesGetOwnPropertyDescriptorWork(object){try{object.sentinel=0;return Object.getOwnPropertyDescriptor(object,"sentinel").value===0}catch(exception){}}if(Object.defineProperty){var getOwnPropertyDescriptorWorksOnObject=doesGetOwnPropertyDescriptorWork({});var getOwnPropertyDescriptorWorksOnDom=typeof document=="undefined"||doesGetOwnPropertyDescriptorWork(document.createElement("div"));if(!getOwnPropertyDescriptorWorksOnDom||!getOwnPropertyDescriptorWorksOnObject){var getOwnPropertyDescriptorFallback=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||getOwnPropertyDescriptorFallback){var ERR_NON_OBJECT="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function getOwnPropertyDescriptor(object,property){if(typeof object!="object"&&typeof object!="function"||object===null){throw new TypeError(ERR_NON_OBJECT+object)}if(getOwnPropertyDescriptorFallback){try{return getOwnPropertyDescriptorFallback.call(Object,object,property)}catch(exception){}}if(!owns(object,property)){return}var descriptor={enumerable:true,configurable:true};if(supportsAccessors){var prototype=object.__proto__;object.__proto__=prototypeOfObject;var getter=lookupGetter(object,property);var setter=lookupSetter(object,property);object.__proto__=prototype;if(getter||setter){if(getter){descriptor.get=getter}if(setter){descriptor.set=setter}return descriptor}}descriptor.value=object[property];descriptor.writable=true;return descriptor}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function getOwnPropertyNames(object){return Object.keys(object)}}if(!Object.create){var createEmpty;var supportsProto=Object.prototype.__proto__===null;if(supportsProto||typeof document=="undefined"){createEmpty=function(){return{__proto__:null}}}else{createEmpty=function(){var iframe=document.createElement("iframe");var parent=document.body||document.documentElement;iframe.style.display="none";parent.appendChild(iframe);iframe.src="javascript:";var empty=iframe.contentWindow.Object.prototype;parent.removeChild(iframe);iframe=null;delete empty.constructor;delete empty.hasOwnProperty;delete empty.propertyIsEnumerable;delete empty.isPrototypeOf;delete empty.toLocaleString;delete empty.toString;delete empty.valueOf;empty.__proto__=null;function Empty(){}Empty.prototype=empty;createEmpty=function(){return new Empty};return new Empty}}Object.create=function create(prototype,properties){var object;function Type(){}if(prototype===null){object=createEmpty()}else{if(typeof prototype!=="object"&&typeof prototype!=="function"){throw new TypeError("Object prototype may only be an Object or null")}Type.prototype=prototype;object=new Type;object.__proto__=prototype}if(properties!==void 0){Object.defineProperties(object,properties)}return object}}function doesDefinePropertyWork(object){try{Object.defineProperty(object,"sentinel",{});return"sentinel"in object}catch(exception){}}if(Object.defineProperty){var definePropertyWorksOnObject=doesDefinePropertyWork({});var definePropertyWorksOnDom=typeof document=="undefined"||doesDefinePropertyWork(document.createElement("div"));if(!definePropertyWorksOnObject||!definePropertyWorksOnDom){var definePropertyFallback=Object.defineProperty,definePropertiesFallback=Object.defineProperties}}if(!Object.defineProperty||definePropertyFallback){var ERR_NON_OBJECT_DESCRIPTOR="Property description must be an object: ";var ERR_NON_OBJECT_TARGET="Object.defineProperty called on non-object: ";var ERR_ACCESSORS_NOT_SUPPORTED="getters & setters can not be defined "+"on this javascript engine";Object.defineProperty=function defineProperty(object,property,descriptor){if(typeof object!="object"&&typeof object!="function"||object===null){throw new TypeError(ERR_NON_OBJECT_TARGET+object)}if(typeof descriptor!="object"&&typeof descriptor!="function"||descriptor===null){throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR+descriptor)}if(definePropertyFallback){try{return definePropertyFallback.call(Object,object,property,descriptor)}catch(exception){}}if(owns(descriptor,"value")){if(supportsAccessors&&(lookupGetter(object,property)||lookupSetter(object,property))){var prototype=object.__proto__;object.__proto__=prototypeOfObject;delete object[property];object[property]=descriptor.value;object.__proto__=prototype}else{object[property]=descriptor.value}}else{if(!supportsAccessors){throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED)}if(owns(descriptor,"get")){defineGetter(object,property,descriptor.get)}if(owns(descriptor,"set")){defineSetter(object,property,descriptor.set)}}return object}}if(!Object.defineProperties||definePropertiesFallback){Object.defineProperties=function defineProperties(object,properties){if(definePropertiesFallback){try{return definePropertiesFallback.call(Object,object,properties)}catch(exception){}}for(var property in properties){if(owns(properties,property)&&property!="__proto__"){Object.defineProperty(object,property,properties[property])}}return object}}if(!Object.seal){Object.seal=function seal(object){return object}}if(!Object.freeze){Object.freeze=function freeze(object){return object}}try{Object.freeze(function(){})}catch(exception){Object.freeze=function freeze(freezeObject){return function freeze(object){if(typeof object=="function"){return object}else{return freezeObject(object)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function preventExtensions(object){return object}}if(!Object.isSealed){Object.isSealed=function isSealed(object){return false}}if(!Object.isFrozen){Object.isFrozen=function isFrozen(object){return false}}if(!Object.isExtensible){Object.isExtensible=function isExtensible(object){if(Object(object)!==object){throw new TypeError}var name="";while(owns(object,name)){name+="?"}object[name]=true;var returnValue=owns(object,name);delete object[name];return returnValue}}}); 2 | /* 3 | //@ sourceMappingURL=es5-sham.map 4 | */ -------------------------------------------------------------------------------- /bower_components/angular-cookies/angular-cookies.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v1.0.8 3 | * (c) 2010-2012 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | (function(window, angular, undefined) { 7 | 'use strict'; 8 | 9 | /** 10 | * @ngdoc overview 11 | * @name ngCookies 12 | */ 13 | 14 | 15 | angular.module('ngCookies', ['ng']). 16 | /** 17 | * @ngdoc object 18 | * @name ngCookies.$cookies 19 | * @requires $browser 20 | * 21 | * @description 22 | * Provides read/write access to browser's cookies. 23 | * 24 | * Only a simple Object is exposed and by adding or removing properties to/from 25 | * this object, new cookies are created/deleted at the end of current $eval. 26 | * 27 | * # Installation 28 | * To use $cookies make sure you have included the `angular-cookies.js` that comes in Angular 29 | * package. You can also find this file on Google CDN, bower as well as at 30 | * {@link http://code.angularjs.org/ code.angularjs.org}. 31 | * 32 | * Finally load the module in your application: 33 | * 34 | * angular.module('app', ['ngCookies']); 35 | * 36 | * and you are ready to get started! 37 | * 38 | * @example 39 | 40 | 41 | 49 | 50 | 51 | */ 52 | factory('$cookies', ['$rootScope', '$browser', function ($rootScope, $browser) { 53 | var cookies = {}, 54 | lastCookies = {}, 55 | lastBrowserCookies, 56 | runEval = false, 57 | copy = angular.copy, 58 | isUndefined = angular.isUndefined; 59 | 60 | //creates a poller fn that copies all cookies from the $browser to service & inits the service 61 | $browser.addPollFn(function() { 62 | var currentCookies = $browser.cookies(); 63 | if (lastBrowserCookies != currentCookies) { //relies on browser.cookies() impl 64 | lastBrowserCookies = currentCookies; 65 | copy(currentCookies, lastCookies); 66 | copy(currentCookies, cookies); 67 | if (runEval) $rootScope.$apply(); 68 | } 69 | })(); 70 | 71 | runEval = true; 72 | 73 | //at the end of each eval, push cookies 74 | //TODO: this should happen before the "delayed" watches fire, because if some cookies are not 75 | // strings or browser refuses to store some cookies, we update the model in the push fn. 76 | $rootScope.$watch(push); 77 | 78 | return cookies; 79 | 80 | 81 | /** 82 | * Pushes all the cookies from the service to the browser and verifies if all cookies were stored. 83 | */ 84 | function push() { 85 | var name, 86 | value, 87 | browserCookies, 88 | updated; 89 | 90 | //delete any cookies deleted in $cookies 91 | for (name in lastCookies) { 92 | if (isUndefined(cookies[name])) { 93 | $browser.cookies(name, undefined); 94 | } 95 | } 96 | 97 | //update all cookies updated in $cookies 98 | for(name in cookies) { 99 | value = cookies[name]; 100 | if (!angular.isString(value)) { 101 | if (angular.isDefined(lastCookies[name])) { 102 | cookies[name] = lastCookies[name]; 103 | } else { 104 | delete cookies[name]; 105 | } 106 | } else if (value !== lastCookies[name]) { 107 | $browser.cookies(name, value); 108 | updated = true; 109 | } 110 | } 111 | 112 | //verify what was actually stored 113 | if (updated){ 114 | updated = false; 115 | browserCookies = $browser.cookies(); 116 | 117 | for (name in cookies) { 118 | if (cookies[name] !== browserCookies[name]) { 119 | //delete or reset all cookies that the browser dropped from $cookies 120 | if (isUndefined(browserCookies[name])) { 121 | delete cookies[name]; 122 | } else { 123 | cookies[name] = browserCookies[name]; 124 | } 125 | updated = true; 126 | } 127 | } 128 | } 129 | } 130 | }]). 131 | 132 | 133 | /** 134 | * @ngdoc object 135 | * @name ngCookies.$cookieStore 136 | * @requires $cookies 137 | * 138 | * @description 139 | * Provides a key-value (string-object) storage, that is backed by session cookies. 140 | * Objects put or retrieved from this storage are automatically serialized or 141 | * deserialized by angular's toJson/fromJson. 142 | * @example 143 | */ 144 | factory('$cookieStore', ['$cookies', function($cookies) { 145 | 146 | return { 147 | /** 148 | * @ngdoc method 149 | * @name ngCookies.$cookieStore#get 150 | * @methodOf ngCookies.$cookieStore 151 | * 152 | * @description 153 | * Returns the value of given cookie key 154 | * 155 | * @param {string} key Id to use for lookup. 156 | * @returns {Object} Deserialized cookie value. 157 | */ 158 | get: function(key) { 159 | var value = $cookies[key]; 160 | return value ? angular.fromJson(value) : value; 161 | }, 162 | 163 | /** 164 | * @ngdoc method 165 | * @name ngCookies.$cookieStore#put 166 | * @methodOf ngCookies.$cookieStore 167 | * 168 | * @description 169 | * Sets a value for given cookie key 170 | * 171 | * @param {string} key Id for the `value`. 172 | * @param {Object} value Value to be stored. 173 | */ 174 | put: function(key, value) { 175 | $cookies[key] = angular.toJson(value); 176 | }, 177 | 178 | /** 179 | * @ngdoc method 180 | * @name ngCookies.$cookieStore#remove 181 | * @methodOf ngCookies.$cookieStore 182 | * 183 | * @description 184 | * Remove given cookie 185 | * 186 | * @param {string} key Id of the key-value pair to delete. 187 | */ 188 | remove: function(key) { 189 | delete $cookies[key]; 190 | } 191 | }; 192 | 193 | }]); 194 | 195 | 196 | })(window, window.angular); 197 | -------------------------------------------------------------------------------- /bower_components/angular-scenario/jstd-scenario-adapter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license AngularJS v1.0.4 3 | * (c) 2010-2012 Google, Inc. http://angularjs.org 4 | * License: MIT 5 | */ 6 | (function(window) { 7 | 'use strict'; 8 | 9 | /** 10 | * JSTestDriver adapter for angular scenario tests 11 | * 12 | * Example of jsTestDriver.conf for running scenario tests with JSTD: 13 |
 14 |     server: http://localhost:9877
 15 | 
 16 |     load:
 17 |       - lib/angular-scenario.js
 18 |       - lib/jstd-scenario-adapter-config.js
 19 |       - lib/jstd-scenario-adapter.js
 20 |       # your test files go here #
 21 | 
 22 |     proxy:
 23 |      - {matcher: "/your-prefix/*", server: "http://localhost:8000/"}
 24 |   
25 | * 26 | * For more information on how to configure jstd proxy, see {@link http://code.google.com/p/js-test-driver/wiki/Proxy} 27 | * Note the order of files - it's important ! 28 | * 29 | * Example of jstd-scenario-adapter-config.js 30 |
 31 |     var jstdScenarioAdapter = {
 32 |       relativeUrlPrefix: '/your-prefix/'
 33 |     };
 34 |   
35 | * 36 | * Whenever you use browser().navigateTo('relativeUrl') in your scenario test, the relativeUrlPrefix will be prepended. 37 | * You have to configure this to work together with JSTD proxy. 38 | * 39 | * Let's assume you are using the above configuration (jsTestDriver.conf and jstd-scenario-adapter-config.js): 40 | * Now, when you call browser().navigateTo('index.html') in your scenario test, the browser will open /your-prefix/index.html. 41 | * That matches the proxy, so JSTD will proxy this request to http://localhost:8000/index.html. 42 | */ 43 | 44 | /** 45 | * Custom type of test case 46 | * 47 | * @const 48 | * @see jstestdriver.TestCaseInfo 49 | */ 50 | var SCENARIO_TYPE = 'scenario'; 51 | 52 | /** 53 | * Plugin for JSTestDriver 54 | * Connection point between scenario's jstd output and jstestdriver. 55 | * 56 | * @see jstestdriver.PluginRegistrar 57 | */ 58 | function JstdPlugin() { 59 | var nop = function() {}; 60 | 61 | this.reportResult = nop; 62 | this.reportEnd = nop; 63 | this.runScenario = nop; 64 | 65 | this.name = 'Angular Scenario Adapter'; 66 | 67 | /** 68 | * Called for each JSTD TestCase 69 | * 70 | * Handles only SCENARIO_TYPE test cases. There should be only one fake TestCase. 71 | * Runs all scenario tests (under one fake TestCase) and report all results to JSTD. 72 | * 73 | * @param {jstestdriver.TestRunConfiguration} configuration 74 | * @param {Function} onTestDone 75 | * @param {Function} onAllTestsComplete 76 | * @returns {boolean} True if this type of test is handled by this plugin, false otherwise 77 | */ 78 | this.runTestConfiguration = function(configuration, onTestDone, onAllTestsComplete) { 79 | if (configuration.getTestCaseInfo().getType() != SCENARIO_TYPE) return false; 80 | 81 | this.reportResult = onTestDone; 82 | this.reportEnd = onAllTestsComplete; 83 | this.runScenario(); 84 | 85 | return true; 86 | }; 87 | 88 | this.getTestRunsConfigurationFor = function(testCaseInfos, expressions, testRunsConfiguration) { 89 | testRunsConfiguration.push( 90 | new jstestdriver.TestRunConfiguration( 91 | new jstestdriver.TestCaseInfo( 92 | 'Angular Scenario Tests', function() {}, SCENARIO_TYPE), [])); 93 | 94 | return true; 95 | }; 96 | } 97 | 98 | /** 99 | * Singleton instance of the plugin 100 | * Accessed using closure by: 101 | * - jstd output (reports to this plugin) 102 | * - initScenarioAdapter (register the plugin to jstd) 103 | */ 104 | var plugin = new JstdPlugin(); 105 | 106 | /** 107 | * Initialise scenario jstd-adapter 108 | * (only if jstestdriver is defined) 109 | * 110 | * @param {Object} jstestdriver Undefined when run from browser (without jstd) 111 | * @param {Function} initScenarioAndRun Function that inits scenario and runs all the tests 112 | * @param {Object=} config Configuration object, supported properties: 113 | * - relativeUrlPrefix: prefix for all relative links when navigateTo() 114 | */ 115 | function initScenarioAdapter(jstestdriver, initScenarioAndRun, config) { 116 | if (jstestdriver) { 117 | // create and register ScenarioPlugin 118 | jstestdriver.pluginRegistrar.register(plugin); 119 | plugin.runScenario = initScenarioAndRun; 120 | 121 | /** 122 | * HACK (angular.scenario.Application.navigateTo) 123 | * 124 | * We need to navigate to relative urls when running from browser (without JSTD), 125 | * because we want to allow running scenario tests without creating its own virtual host. 126 | * For example: http://angular.local/build/docs/docs-scenario.html 127 | * 128 | * On the other hand, when running with JSTD, we need to navigate to absolute urls, 129 | * because of JSTD proxy. (proxy, because of same domain policy) 130 | * 131 | * So this hack is applied only if running with JSTD and change all relative urls to absolute. 132 | */ 133 | var appProto = angular.scenario.Application.prototype, 134 | navigateTo = appProto.navigateTo, 135 | relativeUrlPrefix = config && config.relativeUrlPrefix || '/'; 136 | 137 | appProto.navigateTo = function(url, loadFn, errorFn) { 138 | if (url.charAt(0) != '/' && url.charAt(0) != '#' && 139 | url != 'about:blank' && !url.match(/^https?/)) { 140 | url = relativeUrlPrefix + url; 141 | } 142 | 143 | return navigateTo.call(this, url, loadFn, errorFn); 144 | }; 145 | } 146 | } 147 | 148 | /** 149 | * Builds proper TestResult object from given model spec 150 | * 151 | * TODO(vojta) report error details 152 | * 153 | * @param {angular.scenario.ObjectModel.Spec} spec 154 | * @returns {jstestdriver.TestResult} 155 | */ 156 | function createTestResultFromSpec(spec) { 157 | var map = { 158 | success: 'PASSED', 159 | error: 'ERROR', 160 | failure: 'FAILED' 161 | }; 162 | 163 | return new jstestdriver.TestResult( 164 | spec.fullDefinitionName, 165 | spec.name, 166 | jstestdriver.TestResult.RESULT[map[spec.status]], 167 | spec.error || '', 168 | spec.line || '', 169 | spec.duration); 170 | } 171 | 172 | /** 173 | * Generates JSTD output (jstestdriver.TestResult) 174 | */ 175 | angular.scenario.output('jstd', function(context, runner, model) { 176 | model.on('SpecEnd', function(spec) { 177 | plugin.reportResult(createTestResultFromSpec(spec)); 178 | }); 179 | 180 | model.on('RunnerEnd', function() { 181 | plugin.reportEnd(); 182 | }); 183 | }); 184 | initScenarioAdapter(window.jstestdriver, angular.scenario.setUpAndRun, window.jstdScenarioAdapter); 185 | })(window); 186 | -------------------------------------------------------------------------------- /bower_components/json3/lib/json3.min.js: -------------------------------------------------------------------------------- 1 | /*! JSON v3.2.6 | http://bestiejs.github.io/json3 | Copyright 2012-2013, Kit Cambridge | http://kit.mit-license.org */ 2 | ;(function(){var n=null; 3 | (function(G){function m(a){if(m[a]!==s)return m[a];var c;if("bug-string-char-index"==a)c="a"!="a"[0];else if("json"==a)c=m("json-stringify")&&m("json-parse");else{var e;if("json-stringify"==a){c=o.stringify;var b="function"==typeof c&&l;if(b){(e=function(){return 1}).toJSON=e;try{b="0"===c(0)&&"0"===c(new Number)&&'""'==c(new String)&&c(p)===s&&c(s)===s&&c()===s&&"1"===c(e)&&"[1]"==c([e])&&"[null]"==c([s])&&"null"==c(n)&&"[null,null,null]"==c([s,p,n])&&'{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}'==c({a:[e, 4 | !0,!1,n,"\x00\u0008\n\u000c\r\t"]})&&"1"===c(n,e)&&"[\n 1,\n 2\n]"==c([1,2],n,1)&&'"-271821-04-20T00:00:00.000Z"'==c(new Date(-864E13))&&'"+275760-09-13T00:00:00.000Z"'==c(new Date(864E13))&&'"-000001-01-01T00:00:00.000Z"'==c(new Date(-621987552E5))&&'"1969-12-31T23:59:59.999Z"'==c(new Date(-1))}catch(f){b=!1}}c=b}if("json-parse"==a){c=o.parse;if("function"==typeof c)try{if(0===c("0")&&!c(!1)){e=c('{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}');var j=5==e.a.length&&1===e.a[0];if(j){try{j=!c('"\t"')}catch(d){}if(j)try{j= 5 | 1!==c("01")}catch(h){}if(j)try{j=1!==c("1.")}catch(k){}}}}catch(N){j=!1}c=j}}return m[a]=!!c}var p={}.toString,q,x,s,H=typeof define==="function"&&define.amd,y="object"==typeof JSON&&JSON,o="object"==typeof exports&&exports&&!exports.nodeType&&exports;o&&y?(o.stringify=y.stringify,o.parse=y.parse):o=G.JSON=y||{};var l=new Date(-3509827334573292);try{l=-109252==l.getUTCFullYear()&&0===l.getUTCMonth()&&1===l.getUTCDate()&&10==l.getUTCHours()&&37==l.getUTCMinutes()&&6==l.getUTCSeconds()&&708==l.getUTCMilliseconds()}catch(O){}if(!m("json")){var t= 6 | m("bug-string-char-index");if(!l)var u=Math.floor,I=[0,31,59,90,120,151,181,212,243,273,304,334],z=function(a,c){return I[c]+365*(a-1970)+u((a-1969+(c=+(c>1)))/4)-u((a-1901+c)/100)+u((a-1601+c)/400)};if(!(q={}.hasOwnProperty))q=function(a){var c={},e;if((c.__proto__=n,c.__proto__={toString:1},c).toString!=p)q=function(a){var c=this.__proto__,a=a in(this.__proto__=n,this);this.__proto__=c;return a};else{e=c.constructor;q=function(a){var c=(this.constructor||e).prototype;return a in this&&!(a in c&& 7 | this[a]===c[a])}}c=n;return q.call(this,a)};var J={"boolean":1,number:1,string:1,undefined:1};x=function(a,c){var e=0,b,f,j;(b=function(){this.valueOf=0}).prototype.valueOf=0;f=new b;for(j in f)q.call(f,j)&&e++;b=f=n;if(e)x=e==2?function(a,c){var e={},b=p.call(a)=="[object Function]",f;for(f in a)!(b&&f=="prototype")&&!q.call(e,f)&&(e[f]=1)&&q.call(a,f)&&c(f)}:function(a,c){var e=p.call(a)=="[object Function]",b,f;for(b in a)!(e&&b=="prototype")&&q.call(a,b)&&!(f=b==="constructor")&&c(b);(f||q.call(a, 8 | b="constructor"))&&c(b)};else{f=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];x=function(a,c){var e=p.call(a)=="[object Function]",b,g;if(g=!e)if(g=typeof a.constructor!="function"){g=typeof a.hasOwnProperty;g=g=="object"?!!a.hasOwnProperty:!J[g]}g=g?a.hasOwnProperty:q;for(b in a)!(e&&b=="prototype")&&g.call(a,b)&&c(b);for(e=f.length;b=f[--e];g.call(a,b)&&c(b));}}return x(a,c)};if(!m("json-stringify")){var K={92:"\\\\",34:'\\"',8:"\\b", 9 | 12:"\\f",10:"\\n",13:"\\r",9:"\\t"},v=function(a,c){return("000000"+(c||0)).slice(-a)},D=function(a){var c='"',b=0,g=a.length,f=g>10&&t,j;for(f&&(j=a.split(""));b-1/0&&h<1/0){if(z){l=u(h/864E5);for(k=u(l/365.2425)+1970-1;z(k+1,0)<=l;k++);for(i=u((l-z(k,0))/30.42);z(k,i+1)<=l;i++);l=1+l-z(k,i);m=(h%864E5+864E5)%864E5;o=u(m/36E5)%24;r=u(m/6E4)%60;t=u(m/1E3)%60;m=m%1E3}else{k=h.getUTCFullYear();i=h.getUTCMonth();l=h.getUTCDate();o=h.getUTCHours();r=h.getUTCMinutes();t=h.getUTCSeconds();m=h.getUTCMilliseconds()}h=(k<=0||k>=1E4?(k<0?"-":"+")+v(6,k<0?-k:k):v(4,k))+"-"+v(2,i+1)+"-"+v(2,l)+"T"+v(2,o)+":"+v(2,r)+":"+v(2,t)+"."+v(3,m)+"Z"}else h= 11 | n;else if(typeof h.toJSON=="function"&&(k!="[object Number]"&&k!="[object String]"&&k!="[object Array]"||q.call(h,"toJSON")))h=h.toJSON(a)}b&&(h=b.call(c,a,h));if(h===n)return"null";k=p.call(h);if(k=="[object Boolean]")return""+h;if(k=="[object Number]")return h>-1/0&&h<1/0?""+h:"null";if(k=="[object String]")return D(""+h);if(typeof h=="object"){for(a=d.length;a--;)if(d[a]===h)throw TypeError();d.push(h);w=[];c=j;j=j+f;if(k=="[object Array]"){i=0;for(a=h.length;i0){g="";for(b>10&&(b=10);g.length=48&&d<=57||d>=97&&d<=102||d>=65&&d<=70||i()}e=e+L("0x"+a.slice(g,b));break;default:i()}}else{if(d==34)break;d=a.charCodeAt(b);for(g=b;d>=32&&d!=92&&d!=34;)d=a.charCodeAt(++b); 15 | e=e+a.slice(g,b)}}if(a.charCodeAt(b)==34){b++;return e}i();default:g=b;if(d==45){j=true;d=a.charCodeAt(++b)}if(d>=48&&d<=57){for(d==48&&(d=a.charCodeAt(b+1),d>=48&&d<=57)&&i();b=48&&d<=57);b++);if(a.charCodeAt(b)==46){for(f=++b;f=48&&d<=57);f++);f==b&&i();b=f}d=a.charCodeAt(b);if(d==101||d==69){d=a.charCodeAt(++b);(d==43||d==45)&&b++;for(f=b;f=48&&d<=57);f++);f==b&&i();b=f}return+a.slice(g,b)}j&&i();if(a.slice(b,b+4)=="true"){b= 16 | b+4;return true}if(a.slice(b,b+5)=="false"){b=b+5;return false}if(a.slice(b,b+4)=="null"){b=b+4;return n}i()}}return"$"},C=function(a){var c,b;a=="$"&&i();if(typeof a=="string"){if((t?a.charAt(0):a[0])=="@")return a.slice(1);if(a=="["){for(c=[];;b||(b=true)){a=r();if(a=="]")break;if(b)if(a==","){a=r();a=="]"&&i()}else i();a==","&&i();c.push(C(a))}return c}if(a=="{"){for(c={};;b||(b=true)){a=r();if(a=="}")break;if(b)if(a==","){a=r();a=="}"&&i()}else i();(a==","||typeof a!="string"||(t?a.charAt(0): 17 | a[0])!="@"||r()!=":")&&i();c[a.slice(1)]=C(r())}return c}i()}return a},F=function(a,b,e){e=E(a,b,e);e===s?delete a[b]:a[b]=e},E=function(a,b,e){var g=a[b],f;if(typeof g=="object"&&g)if(p.call(g)=="[object Array]")for(f=g.length;f--;)F(g,f,e);else x(g,function(a){F(g,a,e)});return e.call(a,b,g)};o.parse=function(a,c){var e,g;b=0;A=""+a;e=C(r());r()!="$"&&i();b=A=n;return c&&p.call(c)=="[object Function]"?E((g={},g[""]=e,g),"",c):e}}}H&&define(function(){return o})})(this); 18 | }()); -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/lib/jasmine-html.js: -------------------------------------------------------------------------------- 1 | jasmine.TrivialReporter = function(doc) { 2 | this.document = doc || document; 3 | this.suiteDivs = {}; 4 | this.logRunningSpecs = false; 5 | }; 6 | 7 | jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) { 8 | var el = document.createElement(type); 9 | 10 | for (var i = 2; i < arguments.length; i++) { 11 | var child = arguments[i]; 12 | 13 | if (typeof child === 'string') { 14 | el.appendChild(document.createTextNode(child)); 15 | } else { 16 | if (child) { el.appendChild(child); } 17 | } 18 | } 19 | 20 | for (var attr in attrs) { 21 | if (attr == "className") { 22 | el[attr] = attrs[attr]; 23 | } else { 24 | el.setAttribute(attr, attrs[attr]); 25 | } 26 | } 27 | 28 | return el; 29 | }; 30 | 31 | jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) { 32 | var showPassed, showSkipped; 33 | 34 | this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' }, 35 | this.createDom('div', { className: 'banner' }, 36 | this.createDom('div', { className: 'logo' }, 37 | this.createDom('span', { className: 'title' }, "Jasmine"), 38 | this.createDom('span', { className: 'version' }, runner.env.versionString())), 39 | this.createDom('div', { className: 'options' }, 40 | "Show ", 41 | showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }), 42 | this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "), 43 | showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }), 44 | this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped") 45 | ) 46 | ), 47 | 48 | this.runnerDiv = this.createDom('div', { className: 'runner running' }, 49 | this.createDom('a', { className: 'run_spec', href: '?' }, "run all"), 50 | this.runnerMessageSpan = this.createDom('span', {}, "Running..."), 51 | this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, "")) 52 | ); 53 | 54 | this.document.body.appendChild(this.outerDiv); 55 | 56 | var suites = runner.suites(); 57 | for (var i = 0; i < suites.length; i++) { 58 | var suite = suites[i]; 59 | var suiteDiv = this.createDom('div', { className: 'suite' }, 60 | this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"), 61 | this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description)); 62 | this.suiteDivs[suite.id] = suiteDiv; 63 | var parentDiv = this.outerDiv; 64 | if (suite.parentSuite) { 65 | parentDiv = this.suiteDivs[suite.parentSuite.id]; 66 | } 67 | parentDiv.appendChild(suiteDiv); 68 | } 69 | 70 | this.startedAt = new Date(); 71 | 72 | var self = this; 73 | showPassed.onclick = function(evt) { 74 | if (showPassed.checked) { 75 | self.outerDiv.className += ' show-passed'; 76 | } else { 77 | self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, ''); 78 | } 79 | }; 80 | 81 | showSkipped.onclick = function(evt) { 82 | if (showSkipped.checked) { 83 | self.outerDiv.className += ' show-skipped'; 84 | } else { 85 | self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, ''); 86 | } 87 | }; 88 | }; 89 | 90 | jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) { 91 | var results = runner.results(); 92 | var className = (results.failedCount > 0) ? "runner failed" : "runner passed"; 93 | this.runnerDiv.setAttribute("class", className); 94 | //do it twice for IE 95 | this.runnerDiv.setAttribute("className", className); 96 | var specs = runner.specs(); 97 | var specCount = 0; 98 | for (var i = 0; i < specs.length; i++) { 99 | if (this.specFilter(specs[i])) { 100 | specCount++; 101 | } 102 | } 103 | var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s"); 104 | message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"; 105 | this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild); 106 | 107 | this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString())); 108 | }; 109 | 110 | jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) { 111 | var results = suite.results(); 112 | var status = results.passed() ? 'passed' : 'failed'; 113 | if (results.totalCount === 0) { // todo: change this to check results.skipped 114 | status = 'skipped'; 115 | } 116 | this.suiteDivs[suite.id].className += " " + status; 117 | }; 118 | 119 | jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) { 120 | if (this.logRunningSpecs) { 121 | this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...'); 122 | } 123 | }; 124 | 125 | jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) { 126 | var results = spec.results(); 127 | var status = results.passed() ? 'passed' : 'failed'; 128 | if (results.skipped) { 129 | status = 'skipped'; 130 | } 131 | var specDiv = this.createDom('div', { className: 'spec ' + status }, 132 | this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"), 133 | this.createDom('a', { 134 | className: 'description', 135 | href: '?spec=' + encodeURIComponent(spec.getFullName()), 136 | title: spec.getFullName() 137 | }, spec.description)); 138 | 139 | 140 | var resultItems = results.getItems(); 141 | var messagesDiv = this.createDom('div', { className: 'messages' }); 142 | for (var i = 0; i < resultItems.length; i++) { 143 | var result = resultItems[i]; 144 | 145 | if (result.type == 'log') { 146 | messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString())); 147 | } else if (result.type == 'expect' && result.passed && !result.passed()) { 148 | messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message)); 149 | 150 | if (result.trace.stack) { 151 | messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack)); 152 | } 153 | } 154 | } 155 | 156 | if (messagesDiv.childNodes.length > 0) { 157 | specDiv.appendChild(messagesDiv); 158 | } 159 | 160 | this.suiteDivs[spec.suite.id].appendChild(specDiv); 161 | }; 162 | 163 | jasmine.TrivialReporter.prototype.log = function() { 164 | var console = jasmine.getGlobal().console; 165 | if (console && console.log) { 166 | if (console.log.apply) { 167 | console.log.apply(console, arguments); 168 | } else { 169 | console.log(arguments); // ie fix: console.log.apply doesn't exist on ie 170 | } 171 | } 172 | }; 173 | 174 | jasmine.TrivialReporter.prototype.getLocation = function() { 175 | return this.document.location; 176 | }; 177 | 178 | jasmine.TrivialReporter.prototype.specFilter = function(spec) { 179 | var paramMap = {}; 180 | var params = this.getLocation().search.substring(1).split('&'); 181 | for (var i = 0; i < params.length; i++) { 182 | var p = params[i].split('='); 183 | paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]); 184 | } 185 | 186 | if (!paramMap.spec) { 187 | return true; 188 | } 189 | return spec.getFullName().indexOf(paramMap.spec) === 0; 190 | }; 191 | -------------------------------------------------------------------------------- /bower_components/json3/README.md: -------------------------------------------------------------------------------- 1 | # JSON 3 # 2 | 3 | ![JSON 3 Logo](http://bestiejs.github.io/json3/page/logo.png) 4 | 5 | **JSON 3** is a modern JSON implementation compatible with a variety of JavaScript platforms, including Internet Explorer 6, Opera 7, Safari 2, and Netscape 6. The current version is **3.2.6**. 6 | 7 | - [Development Version](https://raw.github.com/bestiejs/json3/v3.2.6/lib/json3.js) *(40 KB; uncompressed with comments)* 8 | - [Production Version](https://raw.github.com/bestiejs/json3/v3.2.6/lib/json3.min.js) *(3.3 KB; compressed and `gzip`-ped)* 9 | 10 | CDN copies are also available at [cdnjs](http://cdnjs.com/libraries/json3/) & [jsDelivr](http://www.jsdelivr.com/#!json3). 11 | 12 | [JSON](http://json.org/) is a language-independent data interchange format based on a loose subset of the JavaScript grammar. Originally popularized by [Douglas Crockford](http://www.crockford.com/), the format was standardized in the [fifth edition](http://es5.github.com/) of the ECMAScript specification. The 5.1 edition, ratified in June 2011, incorporates several modifications to the grammar pertaining to the serialization of dates. 13 | 14 | JSON 3 exposes two functions: `stringify()` for [serializing](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/JSON/stringify) a JavaScript value to JSON, and `parse()` for [producing](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/JSON/parse) a JavaScript value from a JSON source string. It is a **drop-in replacement** for [JSON 2](http://json.org/js). The functions behave exactly as described in the ECMAScript spec, **except** for the date serialization discrepancy noted below. 15 | 16 | The JSON 3 parser does **not** use `eval` or regular expressions. This provides security and performance benefits in obsolete and mobile environments, where the margin is particularly significant. The complete [benchmark suite](http://jsperf.com/json3) is available on [jsPerf](http://jsperf.com/). 17 | 18 | The project is [hosted on GitHub](http://git.io/json3), along with the [unit tests](http://bestiejs.github.io/json3/test/test_browser.html). It is part of the [BestieJS](https://github.com/bestiejs) family, a collection of best-in-class JavaScript libraries that promote cross-platform support, specification precedents, unit testing, and plenty of documentation. 19 | 20 | # Changes from JSON 2 # 21 | 22 | JSON 3... 23 | 24 | * Correctly serializes primitive wrapper objects. 25 | * Throws a `TypeError` when serializing cyclic structures (JSON 2 recurses until the call stack overflows). 26 | * Utilizes **feature tests** to detect broken or incomplete *native* JSON implementations (JSON 2 only checks for the presence of the native functions). The tests are only executed once at runtime, so there is no additional performance cost when parsing or serializing values. 27 | 28 | **As of v3.2.3**, JSON 3 is compatible with [Prototype](http://prototypejs.org) 1.6.1 and older. 29 | 30 | In contrast to JSON 2, JSON 3 **does not**... 31 | 32 | * Add `toJSON()` methods to the `Boolean`, `Number`, and `String` prototypes. These are not part of any standard, and are made redundant by the design of the `stringify()` implementation. 33 | * Add `toJSON()` or `toISOString()` methods to `Date.prototype`. See the note about date serialization below. 34 | 35 | ## Date Serialization 36 | 37 | **JSON 3 deviates from the specification in one important way**: it does not define `Date#toISOString()` or `Date#toJSON()`. This preserves CommonJS compatibility and avoids polluting native prototypes. Instead, date serialization is performed internally by the `stringify()` implementation: if a date object does not define a custom `toJSON()` method, it is serialized as a [simplified ISO 8601 date-time string](http://es5.github.com/#x15.9.1.15). 38 | 39 | **Several native `Date#toJSON()` implementations produce date time strings that do *not* conform to the grammar outlined in the spec**. For instance, all versions of Safari 4, as well as JSON 2, fail to serialize extended years correctly. Furthermore, JSON 2 and older implementations omit the milliseconds from the date-time string (optional in ES 5, but required in 5.1). Finally, in all versions of Safari 4 and 5, serializing an invalid date will produce the string `"Invalid Date"`, rather than `null`. Because these environments exhibit other serialization bugs, however, JSON 3 will override the native `stringify()` implementation. 40 | 41 | Portions of the date serialization code are adapted from the [`date-shim`](https://github.com/Yaffle/date-shim) project. 42 | 43 | # Usage # 44 | 45 | ## Web Browsers 46 | 47 | 48 | 59 | 60 | ## CommonJS Environments 61 | 62 | var JSON3 = require("./path/to/json3"); 63 | JSON3.parse("[1, 2, 3]"); 64 | // => [1, 2, 3] 65 | 66 | ## JavaScript Engines 67 | 68 | load("path/to/json3.js"); 69 | JSON.stringify({"Hello": 123, "Good-bye": 456}, ["Hello"], "\t"); 70 | // => '{\n\t"Hello": 123\n}' 71 | 72 | # Compatibility # 73 | 74 | JSON 3 has been **tested** with the following web browsers, CommonJS environments, and JavaScript engines. 75 | 76 | ## Web Browsers 77 | 78 | - Windows [Internet Explorer](http://www.microsoft.com/windows/internet-explorer), version 6.0 and higher 79 | - Mozilla [Firefox](http://www.mozilla.com/firefox), version 1.0 and higher 80 | - Apple [Safari](http://www.apple.com/safari), version 2.0 and higher 81 | - [Opera](http://www.opera.com) 7.02 and higher 82 | - [Mozilla](http://sillydog.org/narchive/gecko.php) 1.0, [Netscape](http://sillydog.org/narchive/) 6.2.3, and [SeaMonkey](http://www.seamonkey-project.org/) 1.0 and higher 83 | 84 | ## CommonJS Environments 85 | 86 | - [Node](http://nodejs.org/) 0.2.6 and higher 87 | - [RingoJS](http://ringojs.org/) 0.4 and higher 88 | - [Narwhal](http://narwhaljs.org/) 0.3.2 and higher 89 | 90 | ## JavaScript Engines 91 | 92 | - Mozilla [Rhino](http://www.mozilla.org/rhino) 1.5R5 and higher 93 | - WebKit [JSC](https://trac.webkit.org/wiki/JSC) 94 | - Google [V8](http://code.google.com/p/v8) 95 | 96 | ## Known Incompatibilities 97 | 98 | * Attempting to serialize the `arguments` object may produce inconsistent results across environments due to specification version differences. As a workaround, please convert the `arguments` object to an array first: `JSON.stringify([].slice.call(arguments, 0))`. 99 | 100 | ## Required Native Methods 101 | 102 | JSON 3 assumes that the following methods exist and function as described in the ECMAScript specification: 103 | 104 | - The `Number`, `String`, `Array`, `Object`, `Date`, `SyntaxError`, and `TypeError` constructors. 105 | - `String.fromCharCode` 106 | - `Object#toString` 107 | - `Function#call` 108 | - `Math.floor` 109 | - `Number#toString` 110 | - `Date#valueOf` 111 | - `String.prototype`: `indexOf`, `charCodeAt`, `charAt`, `slice`. 112 | - `Array.prototype`: `push`, `pop`, `join`. 113 | 114 | # Contribute # 115 | 116 | Check out a working copy of the JSON 3 source code with [Git](http://git-scm.com/): 117 | 118 | $ git clone git://github.com/bestiejs/json3.git 119 | $ cd json3 120 | $ git submodule update --init 121 | 122 | If you'd like to contribute a feature or bug fix, you can [fork](http://help.github.com/fork-a-repo/) JSON 3, commit your changes, and [send a pull request](http://help.github.com/send-pull-requests/). Please make sure to update the unit tests in the `test` directory as well. 123 | 124 | Alternatively, you can use the [GitHub issue tracker](https://github.com/bestiejs/json3/issues) to submit bug reports, feature requests, and questions, or send tweets to [@kitcambridge](http://twitter.com/kitcambridge). 125 | 126 | JSON 3 is released under the [MIT License](http://kit.mit-license.org/). -------------------------------------------------------------------------------- /scripts/libraries/threejs/AssimpJSONLoader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Alexander Gessler / http://www.greentoken.de/ 3 | * https://github.com/acgessler 4 | * 5 | * Loader for models imported with Open Asset Import Library (http://assimp.sf.net) 6 | * through assimp2json (https://github.com/acgessler/assimp2json). 7 | * 8 | * Supports any input format that assimp supports, including 3ds, obj, dae, blend, 9 | * fbx, x, ms3d, lwo (and many more). 10 | * 11 | * See webgl_loader_assimp2json example. 12 | */ 13 | 14 | THREE.AssimpJSONLoader = function ( manager ) { 15 | 16 | this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager; 17 | }; 18 | 19 | THREE.AssimpJSONLoader.prototype = { 20 | 21 | constructor: THREE.AssimpJSONLoader, 22 | 23 | texturePath : '', 24 | 25 | load: function ( url, onLoad, onProgress, onError, texturePath ) { 26 | 27 | var scope = this; 28 | 29 | this.texturePath = texturePath && ( typeof texturePath === "string" ) ? texturePath : this.extractUrlBase( url ); 30 | 31 | var loader = new THREE.XHRLoader( this.manager ); 32 | loader.setCrossOrigin( this.crossOrigin ); 33 | loader.load( url, function ( text ) { 34 | var scene = scope.parse( JSON.parse( text ) ); 35 | onLoad( scene ); 36 | } ); 37 | }, 38 | 39 | setCrossOrigin: function ( value ) { 40 | this.crossOrigin = value; 41 | }, 42 | 43 | extractUrlBase: function ( url ) { // from three/src/loaders/Loader.js 44 | var parts = url.split( '/' ); 45 | parts.pop(); 46 | return ( parts.length < 1 ? '.' : parts.join( '/' ) ) + '/'; 47 | }, 48 | 49 | parse: function ( json ) { 50 | var meshes = this.parseList ( json.meshes, this.parseMesh ); 51 | var materials = this.parseList ( json.materials, this.parseMaterial ); 52 | return this.parseObject( json, json.rootnode, meshes, materials ); 53 | }, 54 | 55 | parseList : function(json, handler) { 56 | var meshes = new Array(json.length); 57 | for(var i = 0; i < json.length; ++i) { 58 | meshes[i] = handler.call(this, json[i]); 59 | } 60 | return meshes; 61 | }, 62 | 63 | parseMesh : function(json) { 64 | var vertex, geometry, i, e, in_data, src; 65 | 66 | 67 | geometry = new THREE.Geometry(); 68 | 69 | // read vertex positions 70 | for(in_data = json.vertices, i = 0, e = in_data.length; i < e; ) { 71 | geometry.vertices.push( new THREE.Vector3( in_data[ i++ ], in_data[ i++ ], in_data[ i++ ] ) ); 72 | } 73 | 74 | // read faces 75 | var cnt = 0; 76 | for(in_data = json.faces, i = 0, e = in_data.length; i < e; ++i) { 77 | face = new THREE.Face3(); 78 | src = in_data[i]; 79 | face.a = src[0]; 80 | face.b = src[1]; 81 | face.c = src[2]; 82 | 83 | face.materialIndex = 0; //json.materialindex; 84 | geometry.faces.push(face); 85 | } 86 | 87 | // read texture coordinates - three.js attaches them to its faces 88 | for(i = 0, e = json.texturecoords.length; i < e; ++i) { 89 | 90 | function convertTextureCoords(in_uv, out_faces, out_vertex_uvs) { 91 | var i, e, face, a, b, c; 92 | 93 | for(i = 0, e = out_faces.length; i < e; ++i) { 94 | face = out_faces[i]; 95 | a = face.a * 2; 96 | b = face.b * 2; 97 | c = face.c * 2; 98 | out_vertex_uvs.push([ 99 | new THREE.Vector2( in_uv[ a ], in_uv[ a + 1 ] ), 100 | new THREE.Vector2( in_uv[ b ], in_uv[ b + 1 ] ), 101 | new THREE.Vector2( in_uv[ c ], in_uv[ c + 1 ] ) 102 | ]); 103 | } 104 | } 105 | 106 | convertTextureCoords(json.texturecoords[i], geometry.faces, geometry.faceVertexUvs[i]); 107 | } 108 | 109 | // read normals - three.js also attaches them to its faces 110 | if(json.normals) { 111 | 112 | function convertNormals(in_nor, out_faces) { 113 | var i, e, face, a, b, c; 114 | 115 | for(i = 0, e = out_faces.length; i < e; ++i) { 116 | face = out_faces[i]; 117 | a = face.a * 3; 118 | b = face.b * 3; 119 | c = face.c * 3; 120 | face.vertexNormals = [ 121 | new THREE.Vector3( in_nor[ a ], in_nor[ a + 1 ], in_nor[ a + 2 ] ), 122 | new THREE.Vector3( in_nor[ b ], in_nor[ b + 1 ], in_nor[ b + 2 ] ), 123 | new THREE.Vector3( in_nor[ c ], in_nor[ c + 1 ], in_nor[ c + 2 ] ) 124 | ]; 125 | } 126 | } 127 | 128 | convertNormals(json.normals, geometry.faces); 129 | } 130 | 131 | // read vertex colors - three.js also attaches them to its faces 132 | if(json.colors && json.colors[0]) { 133 | 134 | function convertColors(in_color, out_faces) { 135 | var i, e, face, a, b, c; 136 | 137 | function makeColor(start) { 138 | var col = new THREE.Color( ); 139 | col.setRGB( arr[0], arr[1], arr[2] ); 140 | // TODO: what about alpha? 141 | return col; 142 | } 143 | 144 | for(i = 0, e = out_faces.length; i < e; ++i) { 145 | face = out_faces[i]; 146 | a = face.a * 4; 147 | b = face.b * 4; 148 | c = face.c * 4; 149 | face.vertexColors = [ 150 | makeColor( a ), 151 | makeColor( b ), 152 | makeColor( c ) 153 | ]; 154 | } 155 | } 156 | 157 | convertColors(json.colors[0], geometry.faces); 158 | } 159 | 160 | 161 | geometry.computeCentroids(); 162 | //geometry.computeFaceNormals(); 163 | //geometry.computeVertexNormals(); 164 | //geometry.computeTangents(); 165 | geometry.computeBoundingSphere(); 166 | 167 | // TODO: tangents 168 | return geometry; 169 | }, 170 | 171 | parseMaterial : function(json) { 172 | var mat = null, 173 | scope = this, i, prop, has_textures = [], 174 | 175 | init_props = { 176 | shading : THREE.SmoothShading 177 | }; 178 | 179 | function toColor(value_arr) { 180 | var col = new THREE.Color(); 181 | col.setRGB(value_arr[0],value_arr[1],value_arr[2]); 182 | return col; 183 | } 184 | 185 | function defaultTexture() { 186 | var im = new Image(); 187 | im.width = 1; 188 | im.height = 1; 189 | return new THREE.Texture(im); 190 | } 191 | 192 | for (var i in json.properties) { 193 | prop = json.properties[i]; 194 | 195 | if(prop.key === '$tex.file') { 196 | // prop.semantic gives the type of the texture 197 | // 1: diffuse 198 | // 2: specular mao 199 | // 5: height map (bumps) 200 | // 6: normal map 201 | // more values (i.e. emissive, environment) are known by assimp and may be relevant 202 | if(prop.semantic === 1 || prop.semantic === 5 || prop.semantic === 6 || prop.semantic === 2) { 203 | (function(semantic) { 204 | var loader = new THREE.TextureLoader(scope.manager), 205 | keyname; 206 | 207 | if(semantic === 1) { 208 | keyname = 'map'; 209 | } 210 | else if(semantic === 5) { 211 | keyname = 'bumpMap'; 212 | } 213 | else if(semantic === 6) { 214 | keyname = 'normalMap'; 215 | } 216 | else if(semantic === 2) { 217 | keyname = 'specularMap'; 218 | } 219 | 220 | has_textures.push(keyname); 221 | 222 | loader.setCrossOrigin(this.crossOrigin); 223 | loader.load(scope.texturePath + '/' + prop.value, function(tex) { 224 | if(tex) { 225 | // TODO: read texture settings from assimp. 226 | // Wrapping is the default, though. 227 | tex.wrapS = tex.wrapT = THREE.RepeatWrapping; 228 | 229 | mat[keyname] = tex; 230 | mat.needsUpdate = true; 231 | } 232 | }); 233 | })(prop.semantic); 234 | } 235 | } 236 | else if(prop.key === '?mat.name') { 237 | init_props.name = prop.value; 238 | } 239 | else if(prop.key === '$clr.diffuse') { 240 | init_props.color = toColor(prop.value); 241 | } 242 | else if(prop.key === '$clr.specular') { 243 | init_props.specular = toColor(prop.value); 244 | } 245 | else if(prop.key === '$clr.ambient') { 246 | init_props.ambient = toColor(prop.value); 247 | } 248 | else if(prop.key === '$clr.emissive') { 249 | init_props.emissive = toColor(prop.value); 250 | } 251 | else if(prop.key === '$mat.shadingm') { 252 | // aiShadingMode_Flat 253 | if (prop.value === 1) { 254 | init_props.shading = THREE.FlatShading; 255 | } 256 | } 257 | else if (prop.key === '$mat.shininess') { 258 | init_props.shininess = prop.value; 259 | } 260 | } 261 | 262 | if(!init_props.ambient) { 263 | init_props.ambient = init_props.color; 264 | } 265 | 266 | // note: three.js does not like it when a texture is added after the geometry 267 | // has been rendered once, see http://stackoverflow.com/questions/16531759/. 268 | // for this reason we fill all slots upfront with default textures 269 | if(has_textures.length) { 270 | for(i = has_textures.length-1; i >= 0; --i) { 271 | init_props[has_textures[i]] = defaultTexture(); 272 | } 273 | } 274 | 275 | mat = new THREE.MeshPhongMaterial( init_props ); 276 | return mat; 277 | }, 278 | 279 | parseObject : function(json, node, meshes, materials) { 280 | var obj = new THREE.Object3D() 281 | , i 282 | , idx 283 | ; 284 | 285 | obj.name = node.name || ""; 286 | obj.matrix = new THREE.Matrix4().fromArray(node.transformation).transpose(); 287 | obj.matrix.decompose( obj.position, obj.quaternion, obj.scale ); 288 | 289 | for(i = 0; node.meshes && i < node.meshes.length; ++i) { 290 | idx = node.meshes[i]; 291 | obj.add(new THREE.Mesh( meshes[idx], materials[json.meshes[idx].materialindex] )); 292 | } 293 | 294 | for(i = 0; node.children && i < node.children.length; ++i) { 295 | obj.add(this.parseObject(json, node.children[i], meshes, materials)); 296 | } 297 | 298 | return obj; 299 | }, 300 | }; 301 | 302 | 303 | -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/spec/s-date.js: -------------------------------------------------------------------------------- 1 | describe('Date', function () { 2 | 3 | describe('now', function () { 4 | it('should be the current time', function () { 5 | expect(Date.now() === new Date().getTime()).toBe(true); 6 | }); 7 | }); 8 | 9 | describe("parse", function () { 10 | // TODO: Write the rest of the test. 11 | 12 | it('should support extended years', function () { 13 | 14 | expect(Date.parse('0001-01-01T00:00:00Z')).toBe(-62135596800000); 15 | expect(Date.parse('+275760-09-13T00:00:00.000Z')).toBe(8.64e15); 16 | expect(Date.parse('+033658-09-27T01:46:40.000Z')).toBe(1e15); 17 | expect(Date.parse('-000001-01-01T00:00:00Z')).toBe(-62198755200000); 18 | expect(Date.parse('+002009-12-15T00:00:00Z')).toBe(1260835200000); 19 | 20 | }); 21 | 22 | it('should work', function () { 23 | //Chrome 19 Opera 12 Firefox 11 IE 9 Safari 5.1.1 24 | expect(Date.parse("2012-11-31T23:59:59.000Z")).toBeFalsy(); //1354406399000 NaN NaN 1354406399000 NaN 25 | expect(Date.parse("2012-12-31T23:59:59.000Z")).toBe(1356998399000); //1356998399000 1356998399000 1356998399000 1356998399000 1356998399000 26 | expect(Date.parse("2012-12-31T23:59:60.000Z")).toBeFalsy(); //NaN NaN NaN NaN 1356998400000 27 | expect(Date.parse("2012-04-04T05:02:02.170Z")).toBe(1333515722170); //1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 28 | expect(Date.parse("2012-04-04T05:02:02.170999Z")).toBe(1333515722170); //1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 29 | expect(Date.parse("2012-04-04T05:02:02.17Z")).toBe(1333515722170); //1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 30 | expect(Date.parse("2012-04-04T05:02:02.1Z")).toBe(1333515722100); //1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 31 | expect(Date.parse("2012-04-04T24:00:00.000Z")).toBe(1333584000000); //NaN 1333584000000 1333584000000 1333584000000 1333584000000 32 | expect(Date.parse("2012-04-04T24:00:00.500Z")).toBeFalsy(); //NaN NaN 1333584000500 1333584000500 NaN 33 | expect(Date.parse("2012-12-31T10:08:60.000Z")).toBeFalsy(); //NaN NaN NaN NaN 1356948540000 34 | expect(Date.parse("2012-13-01T12:00:00.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN 35 | expect(Date.parse("2012-12-32T12:00:00.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN 36 | expect(Date.parse("2012-12-31T25:00:00.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN 37 | expect(Date.parse("2012-12-31T24:01:00.000Z")).toBeFalsy(); //NaN NaN NaN 1356998460000 NaN 38 | expect(Date.parse("2012-12-31T12:60:00.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN 39 | expect(Date.parse("2012-12-31T12:00:60.000Z")).toBeFalsy(); //NaN NaN NaN NaN 1356955260000 40 | expect(Date.parse("2012-00-31T23:59:59.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN 41 | expect(Date.parse("2012-12-00T23:59:59.000Z")).toBeFalsy(); //NaN NaN NaN NaN NaN 42 | expect(Date.parse("2012-02-29T12:00:00.000Z")).toBe(1330516800000); //1330516800000 1330516800000 1330516800000 1330516800000 1330516800000 43 | expect(Date.parse("2011-02-29T12:00:00.000Z")).toBeFalsy(); //1298980800000 NaN NaN 1298980800000 NaN 44 | expect(Date.parse("2011-03-01T12:00:00.000Z")).toBe(1298980800000); //1298980800000 1298980800000 1298980800000 1298980800000 1298980800000 45 | 46 | // extended years: 47 | expect(Date.parse("0000-01-01T00:00:00.000Z")).toBe(-621672192e5); //-621672192e5 -621672192e5 -621672192e5 -621672192e5 -621672192e5 48 | expect(Date.parse("+275760-09-13T00:00:00.000Z")).toBe(8.64e15); //8.64e15 NaN 8.64e15 8.64e15 8.64e15 49 | expect(Date.parse("-271821-04-20T00:00:00.000Z")).toBe(-8.64e15); //-8.64e15 NaN -8.64e15 -8.64e15 -8.6400000864e15 50 | expect(Date.parse("+275760-09-13T00:00:00.001Z")).toBeFalsy(); //NaN NaN NaN 8.64e15 + 1 8.64e15 + 1 51 | expect(Date.parse("-271821-04-19T23:59:59.999Z")).toBeFalsy(); //NaN NaN NaN -8.64e15 - 1 -8.6400000864e15 - 1 52 | 53 | // https://github.com/kriskowal/es5-shim/issues/80 Safari bug with leap day 54 | expect(Date.parse("2034-03-01T00:00:00.000Z") - 55 | Date.parse("2034-02-27T23:59:59.999Z")).toBe(86400001); //86400001 86400001 86400001 86400001 1 56 | 57 | // Time Zone Offset 58 | expect(Date.parse("2012-01-29T12:00:00.000+01:00")).toBe(132783480e4);//132783480e4 132783480e4 132783480e4 132783480e4 132783480e4 59 | expect(Date.parse("2012-01-29T12:00:00.000-00:00")).toBe(132783840e4);//132783840e4 132783840e4 132783840e4 132783840e4 132783840e4 60 | expect(Date.parse("2012-01-29T12:00:00.000+00:00")).toBe(132783840e4);//132783840e4 132783840e4 132783840e4 132783840e4 132783840e4 61 | expect(Date.parse("2012-01-29T12:00:00.000+23:59")).toBe(132775206e4);//132775206e4 132775206e4 132775206e4 132775206e4 132775206e4 62 | expect(Date.parse("2012-01-29T12:00:00.000-23:59")).toBe(132792474e4);//132792474e4 132792474e4 132792474e4 132792474e4 132792474e4 63 | expect(Date.parse("2012-01-29T12:00:00.000+24:00")).toBeFalsy(); //NaN 1327752e6 NaN 1327752000000 1327752000000 64 | expect(Date.parse("2012-01-29T12:00:00.000+24:01")).toBeFalsy(); //NaN NaN NaN 1327751940000 1327751940000 65 | expect(Date.parse("2012-01-29T12:00:00.000+24:59")).toBeFalsy(); //NaN NaN NaN 1327748460000 1327748460000 66 | expect(Date.parse("2012-01-29T12:00:00.000+25:00")).toBeFalsy(); //NaN NaN NaN NaN NaN 67 | expect(Date.parse("2012-01-29T12:00:00.000+00:60")).toBeFalsy(); //NaN NaN NaN NaN NaN 68 | expect(Date.parse("-271821-04-20T00:00:00.000+00:01")).toBeFalsy(); //NaN NaN NaN -864000000006e4 -864000008646e4 69 | expect(Date.parse("-271821-04-20T00:01:00.000+00:01")).toBe(-8.64e15);//-8.64e15 NaN -8.64e15 -8.64e15 -864000008640e4 70 | 71 | // When time zone is missed, local offset should be used (ES 5.1 bug) 72 | // see https://bugs.ecmascript.org/show_bug.cgi?id=112 73 | var tzOffset = Number(new Date(1970, 0)); 74 | // same as (new Date().getTimezoneOffset() * 60000) 75 | expect(Date.parse('1970-01-01T00:00:00')).toBe(tzOffset); //tzOffset 0 0 0 NaN 76 | }); 77 | 78 | it("should be able to coerce to a number", function(){ 79 | var actual = Number(new Date(1970, 0)); 80 | var expected = parseInt(actual, 10); 81 | expect(actual).toBeDefined(); 82 | expect(actual).toEqual(expected); 83 | expect(isNaN(actual)).toBeFalsy(); 84 | }); 85 | 86 | }); 87 | 88 | describe("toString", function(){ 89 | var actual = (new Date(1970, 0)).toString(); 90 | beforeEach(function(){ 91 | actual = (new Date(1970, 0)).toString(); 92 | }); 93 | it("should show correct date info for "+actual, function(){ 94 | expect(actual).toMatch(/1970/); 95 | expect(actual).toMatch(/jan/i); 96 | expect(actual).toMatch(/thu/i); 97 | expect(actual).toMatch(/00:00:00/); 98 | }); 99 | }); 100 | 101 | describe("valueOf", function(){ 102 | var actual = (new Date(1970, 0)); 103 | beforeEach(function(){ 104 | actual = (new Date(1970, 0)).valueOf(); 105 | }); 106 | it("should give an int value", function(){ 107 | expect(parseInt(actual, 10)).toBeTruthy(); 108 | }); 109 | }); 110 | 111 | describe("toISOString", function () { 112 | // TODO: write the rest of the test. 113 | 114 | it('should support extended years', function () { 115 | expect(new Date(-62198755200000).toISOString().indexOf('-000001-01-01')).toBe(0); 116 | expect(new Date(8.64e15).toISOString().indexOf('+275760-09-13')).toBe(0); 117 | }); 118 | 119 | it('should return correct dates', function () { 120 | expect(new Date(-1).toISOString()).toBe('1969-12-31T23:59:59.999Z');// Safari 5.1.5 "1969-12-31T23:59:59.-01Z" 121 | expect(new Date(-3509827334573292).toISOString()).toBe('-109252-01-01T10:37:06.708Z'); // Opera 11.61/Opera 12 bug with Date#getUTCMonth 122 | }); 123 | 124 | }); 125 | 126 | describe("toJSON", function () { 127 | 128 | // Opera 11.6x/12 bug 129 | it('should call toISOString', function () { 130 | var date = new Date(0); 131 | date.toISOString = function () { 132 | return 1; 133 | }; 134 | expect(date.toJSON()).toBe(1); 135 | }); 136 | 137 | it('should return null for not finite dates', function () { 138 | var date = new Date(NaN), 139 | json; 140 | try { 141 | json = date.toJSON(); 142 | } catch (e) {} 143 | expect(json).toBe(null); 144 | }); 145 | 146 | it('should return the isoString when stringified', function () { 147 | var date = new Date(); 148 | expect(JSON.stringify(date.toISOString())).toBe(JSON.stringify(date)); 149 | }) 150 | }); 151 | 152 | }); -------------------------------------------------------------------------------- /bower_components/es5-shim/es5-shim.min.js: -------------------------------------------------------------------------------- 1 | (function(definition){if(typeof define=="function"){define(definition)}else if(typeof YUI=="function"){YUI.add("es5",definition)}else{definition()}})(function(){function Empty(){}if(!Function.prototype.bind){Function.prototype.bind=function bind(that){var target=this;if(typeof target!="function"){throw new TypeError("Function.prototype.bind called on incompatible "+target)}var args=_Array_slice_.call(arguments,1);var bound=function(){if(this instanceof bound){var result=target.apply(this,args.concat(_Array_slice_.call(arguments)));if(Object(result)===result){return result}return this}else{return target.apply(that,args.concat(_Array_slice_.call(arguments)))}};if(target.prototype){Empty.prototype=target.prototype;bound.prototype=new Empty;Empty.prototype=null}return bound}}var call=Function.prototype.call;var prototypeOfArray=Array.prototype;var prototypeOfObject=Object.prototype;var _Array_slice_=prototypeOfArray.slice;var _toString=call.bind(prototypeOfObject.toString);var owns=call.bind(prototypeOfObject.hasOwnProperty);var defineGetter;var defineSetter;var lookupGetter;var lookupSetter;var supportsAccessors;if(supportsAccessors=owns(prototypeOfObject,"__defineGetter__")){defineGetter=call.bind(prototypeOfObject.__defineGetter__);defineSetter=call.bind(prototypeOfObject.__defineSetter__);lookupGetter=call.bind(prototypeOfObject.__lookupGetter__);lookupSetter=call.bind(prototypeOfObject.__lookupSetter__)}if([1,2].splice(0).length!=2){var array_splice=Array.prototype.splice;if(function(){function makeArray(l){var a=[];while(l--){a.unshift(l)}return a}var array=[],lengthBefore;array.splice.bind(array,0,0).apply(null,makeArray(20));array.splice.bind(array,0,0).apply(null,makeArray(26));lengthBefore=array.length;array.splice(5,0,"XXX");if(lengthBefore+1==array.length){return true}}()){Array.prototype.splice=function(start,deleteCount){if(!arguments.length){return[]}else{return array_splice.apply(this,[start===void 0?0:start,deleteCount===void 0?this.length-start:deleteCount].concat(_Array_slice_.call(arguments,2)))}}}else{Array.prototype.splice=function(start,deleteCount){var result,args=_Array_slice_.call(arguments,2),addElementsCount=args.length;if(!arguments.length){return[]}if(start===void 0){start=0}if(deleteCount===void 0){deleteCount=this.length-start}if(addElementsCount>0){if(deleteCount<=0){if(start==this.length){this.push.apply(this,args);return[]}if(start==0){this.unshift.apply(this,args);return[]}}result=_Array_slice_.call(this,start,start+deleteCount);args.push.apply(args,_Array_slice_.call(this,start+deleteCount,this.length));args.unshift.apply(args,_Array_slice_.call(this,0,start));args.unshift(0,this.length);array_splice.apply(this,args);return result}return array_splice.call(this,start,deleteCount)}}}if([].unshift(0)!=1){var array_unshift=Array.prototype.unshift;Array.prototype.unshift=function(){array_unshift.apply(this,arguments);return this.length}}if(!Array.isArray){Array.isArray=function isArray(obj){return _toString(obj)=="[object Array]"}}var boxedString=Object("a"),splitString=boxedString[0]!="a"||!(0 in boxedString);if(!Array.prototype.forEach){Array.prototype.forEach=function forEach(fun){var object=toObject(this),self=splitString&&_toString(this)=="[object String]"?this.split(""):object,thisp=arguments[1],i=-1,length=self.length>>>0;if(_toString(fun)!="[object Function]"){throw new TypeError}while(++i>>0,result=Array(length),thisp=arguments[1];if(_toString(fun)!="[object Function]"){throw new TypeError(fun+" is not a function")}for(var i=0;i>>0,result=[],value,thisp=arguments[1];if(_toString(fun)!="[object Function]"){throw new TypeError(fun+" is not a function")}for(var i=0;i>>0,thisp=arguments[1];if(_toString(fun)!="[object Function]"){throw new TypeError(fun+" is not a function")}for(var i=0;i>>0,thisp=arguments[1];if(_toString(fun)!="[object Function]"){throw new TypeError(fun+" is not a function")}for(var i=0;i>>0;if(_toString(fun)!="[object Function]"){throw new TypeError(fun+" is not a function")}if(!length&&arguments.length==1){throw new TypeError("reduce of empty array with no initial value")}var i=0;var result;if(arguments.length>=2){result=arguments[1]}else{do{if(i in self){result=self[i++];break}if(++i>=length){throw new TypeError("reduce of empty array with no initial value")}}while(true)}for(;i>>0;if(_toString(fun)!="[object Function]"){throw new TypeError(fun+" is not a function")}if(!length&&arguments.length==1){throw new TypeError("reduceRight of empty array with no initial value")}var result,i=length-1;if(arguments.length>=2){result=arguments[1]}else{do{if(i in self){result=self[i--];break}if(--i<0){throw new TypeError("reduceRight of empty array with no initial value")}}while(true)}do{if(i in this){result=fun.call(void 0,result,self[i],i,object)}}while(i--);return result}}if(!Array.prototype.indexOf||[0,1].indexOf(1,2)!=-1){Array.prototype.indexOf=function indexOf(sought){var self=splitString&&_toString(this)=="[object String]"?this.split(""):toObject(this),length=self.length>>>0;if(!length){return-1}var i=0;if(arguments.length>1){i=toInteger(arguments[1])}i=i>=0?i:Math.max(0,length+i);for(;i>>0;if(!length){return-1}var i=length-1;if(arguments.length>1){i=Math.min(i,toInteger(arguments[1]))}i=i>=0?i:length-Math.abs(i);for(;i>=0;i--){if(i in self&&sought===self[i]){return i}}return-1}}if(!Object.keys){var hasDontEnumBug=true,dontEnums=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],dontEnumsLength=dontEnums.length;for(var key in{toString:null}){hasDontEnumBug=false}Object.keys=function keys(object){if(typeof object!="object"&&typeof object!="function"||object===null){throw new TypeError("Object.keys called on a non-object")}var keys=[];for(var name in object){if(owns(object,name)){keys.push(name)}}if(hasDontEnumBug){for(var i=0,ii=dontEnumsLength;i9999?"+":"")+("00000"+Math.abs(year)).slice(0<=year&&year<=9999?-4:-6);length=result.length;while(length--){value=result[length];if(value<10){result[length]="0"+value}}return year+"-"+result.slice(0,2).join("-")+"T"+result.slice(2).join(":")+"."+("000"+this.getUTCMilliseconds()).slice(-3)+"Z"}}var dateToJSONIsSupported=false;try{dateToJSONIsSupported=Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(negativeDate).toJSON().indexOf(negativeYearString)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(e){}if(!dateToJSONIsSupported){Date.prototype.toJSON=function toJSON(key){var o=Object(this),tv=toPrimitive(o),toISO;if(typeof tv==="number"&&!isFinite(tv)){return null}toISO=o.toISOString;if(typeof toISO!="function"){throw new TypeError("toISOString property is not callable")}return toISO.call(o)}}if(!Date.parse||"Date.parse is buggy"){Date=function(NativeDate){function Date(Y,M,D,h,m,s,ms){var length=arguments.length;if(this instanceof NativeDate){var date=length==1&&String(Y)===Y?new NativeDate(Date.parse(Y)):length>=7?new NativeDate(Y,M,D,h,m,s,ms):length>=6?new NativeDate(Y,M,D,h,m,s):length>=5?new NativeDate(Y,M,D,h,m):length>=4?new NativeDate(Y,M,D,h):length>=3?new NativeDate(Y,M,D):length>=2?new NativeDate(Y,M):length>=1?new NativeDate(Y):new NativeDate;date.constructor=Date;return date}return NativeDate.apply(this,arguments)}var isoDateExpression=new RegExp("^"+"(\\d{4}|[+-]\\d{6})"+"(?:-(\\d{2})"+"(?:-(\\d{2})"+"(?:"+"T(\\d{2})"+":(\\d{2})"+"(?:"+":(\\d{2})"+"(?:(\\.\\d{1,}))?"+")?"+"("+"Z|"+"(?:"+"([-+])"+"(\\d{2})"+":(\\d{2})"+")"+")?)?)?)?"+"$");var months=[0,31,59,90,120,151,181,212,243,273,304,334,365];function dayFromMonth(year,month){var t=month>1?1:0;return months[month]+Math.floor((year-1969+t)/4)-Math.floor((year-1901+t)/100)+Math.floor((year-1601+t)/400)+365*(year-1970)}for(var key in NativeDate){Date[key]=NativeDate[key]}Date.now=NativeDate.now;Date.UTC=NativeDate.UTC;Date.prototype=NativeDate.prototype;Date.prototype.constructor=Date;Date.parse=function parse(string){var match=isoDateExpression.exec(string);if(match){var year=Number(match[1]),month=Number(match[2]||1)-1,day=Number(match[3]||1)-1,hour=Number(match[4]||0),minute=Number(match[5]||0),second=Number(match[6]||0),millisecond=Math.floor(Number(match[7]||0)*1e3),offset=!match[4]||match[8]?0:Number(new NativeDate(1970,0)),signOffset=match[9]==="-"?1:-1,hourOffset=Number(match[10]||0),minuteOffset=Number(match[11]||0),result;if(hour<(minute>0||second>0||millisecond>0?24:25)&&minute<60&&second<60&&millisecond<1e3&&month>-1&&month<12&&hourOffset<24&&minuteOffset<60&&day>-1&&day=0){c+=data[i];data[i]=Math.floor(c/n);c=c%n*base}}function toString(){var i=size;var s="";while(--i>=0){if(s!==""||i===0||data[i]!==0){var t=String(data[i]);if(s===""){s=t}else{s+="0000000".slice(0,7-t.length)+t}}}return s}function pow(x,n,acc){return n===0?acc:n%2===1?pow(x,n-1,acc*x):pow(x*x,n/2,acc)}function log(x){var n=0;while(x>=4096){n+=12;x/=4096}while(x>=2){n+=1;x/=2}return n}Number.prototype.toFixed=function(fractionDigits){var f,x,s,m,e,z,j,k;f=Number(fractionDigits);f=f!==f?0:Math.floor(f);if(f<0||f>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}x=Number(this);if(x!==x){return"NaN"}if(x<=-1e21||x>=1e21){return String(x)}s="";if(x<0){s="-";x=-x}m="0";if(x>1e-21){e=log(x*pow(2,69,1))-69;z=e<0?x*pow(2,-e,1):x/pow(2,e,1);z*=4503599627370496;e=52-e;if(e>0){multiply(0,z);j=f;while(j>=7){multiply(1e7,0);j-=7}multiply(pow(10,j,1),0);j=e-1;while(j>=23){divide(1<<23);j-=23}divide(1<0){k=m.length;if(k<=f){m=s+"0.0000000000000000000".slice(0,f-k+2)+m}else{m=s+m.slice(0,k-f)+"."+m.slice(k-f)}}else{m=s+m}return m}})()}if("0".split(void 0,0).length){var string_split=String.prototype.split;String.prototype.split=function(separator,limit){if(separator===void 0&&limit===0)return[];return string_split.apply(this,arguments)}}if("".substr&&"0b".substr(-1)!=="b"){var string_substr=String.prototype.substr;String.prototype.substr=function(start,length){return string_substr.call(this,start<0?(start=this.length+start)<0?0:start:start,length)}}var ws=" \n \f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";if(!String.prototype.trim||ws.trim()){ws="["+ws+"]";var trimBeginRegexp=new RegExp("^"+ws+ws+"*"),trimEndRegexp=new RegExp(ws+ws+"*$");String.prototype.trim=function trim(){if(this===undefined||this===null){throw new TypeError("can't convert "+this+" to object")}return String(this).replace(trimBeginRegexp,"").replace(trimEndRegexp,"")}}function toInteger(n){n=+n;if(n!==n){n=0}else if(n!==0&&n!==1/0&&n!==-(1/0)){n=(n>0||-1)*Math.floor(Math.abs(n))}return n}function isPrimitive(input){var type=typeof input;return input===null||type==="undefined"||type==="boolean"||type==="number"||type==="string"}function toPrimitive(input){var val,valueOf,toString;if(isPrimitive(input)){return input}valueOf=input.valueOf;if(typeof valueOf==="function"){val=valueOf.call(input);if(isPrimitive(val)){return val}}toString=input.toString;if(typeof toString==="function"){val=toString.call(input);if(isPrimitive(val)){return val}}throw new TypeError}var toObject=function(o){if(o==null){throw new TypeError("can't convert "+o+" to object")}return Object(o)}}); 2 | /* 3 | //@ sourceMappingURL=es5-shim.map 4 | */ -------------------------------------------------------------------------------- /bower_components/es5-shim/es5-shim.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["es5-shim.js"],"names":["definition","define","YUI","add","Empty","Function","prototype","bind","that","target","this","TypeError","args","_Array_slice_","call","arguments","bound","result","apply","concat","Object","prototypeOfArray","Array","prototypeOfObject","slice","_toString","toString","owns","hasOwnProperty","defineGetter","defineSetter","lookupGetter","lookupSetter","supportsAccessors","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","splice","length","array_splice","makeArray","l","a","unshift","array","lengthBefore","start","deleteCount","addElementsCount","push","array_unshift","isArray","obj","boxedString","splitString","forEach","fun","object","toObject","self","split","thisp","i","map","filter","value","every","some","reduce","reduceRight","indexOf","sought","toInteger","Math","max","lastIndexOf","min","abs","keys","hasDontEnumBug","dontEnums","dontEnumsLength","key","name","ii","dontEnum","negativeDate","negativeYearString","Date","toISOString","year","month","isFinite","RangeError","getUTCFullYear","getUTCMonth","floor","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","join","getUTCMilliseconds","dateToJSONIsSupported","toJSON","NaN","e","o","tv","toPrimitive","toISO","parse","NativeDate","Y","M","D","h","m","s","ms","date","String","constructor","isoDateExpression","RegExp","months","dayFromMonth","t","now","UTC","string","match","exec","Number","day","hour","minute","second","millisecond","offset","signOffset","hourOffset","minuteOffset","getTime","toFixed","base","size","data","multiply","n","c","divide","pow","x","acc","log","fractionDigits","f","z","j","k","string_split","separator","limit","substr","string_substr","ws","trim","trimBeginRegexp","trimEndRegexp","undefined","replace","isPrimitive","input","type","val","valueOf"],"mappings":"CAIA,SAAWA,YAEP,SAAWC,SAAU,WAAY,CAC7BA,OAAOD,gBAEJ,UAAWE,MAAO,WAAY,CACjCA,IAAIC,IAAI,MAAOH,gBAEZ,CACHA,gBAEL,WAmBH,QAASI,UAET,IAAKC,SAASC,UAAUC,KAAM,CAC1BF,SAASC,UAAUC,KAAO,QAASA,MAAKC,MAEpC,GAAIC,QAASC,IAEb,UAAWD,SAAU,WAAY,CAC7B,KAAM,IAAIE,WAAU,kDAAoDF,QAK5E,GAAIG,MAAOC,cAAcC,KAAKC,UAAW,EAUzC,IAAIC,OAAQ,WAER,GAAIN,eAAgBM,OAAO,CAiBvB,GAAIC,QAASR,OAAOS,MAChBR,KACAE,KAAKO,OAAON,cAAcC,KAAKC,YAEnC,IAAIK,OAAOH,UAAYA,OAAQ,CAC3B,MAAOA,QAEX,MAAOP,UAEJ,CAoBH,MAAOD,QAAOS,MACVV,KACAI,KAAKO,OAAON,cAAcC,KAAKC,cAM3C,IAAGN,OAAOH,UAAW,CACjBF,MAAME,UAAYG,OAAOH,SACzBU,OAAMV,UAAY,GAAIF,MAEtBA,OAAME,UAAY,KAiCtB,MAAOU,QAQf,GAAIF,MAA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EAAE,cAE3C,MAAOxF,QAAOwF"} -------------------------------------------------------------------------------- /bower_components/es5-shim/es5-sham.js: -------------------------------------------------------------------------------- 1 | // Copyright 2009-2012 by contributors, MIT License 2 | // vim: ts=4 sts=4 sw=4 expandtab 3 | 4 | // Module systems magic dance 5 | (function (definition) { 6 | // RequireJS 7 | if (typeof define == "function") { 8 | define(definition); 9 | // YUI3 10 | } else if (typeof YUI == "function") { 11 | YUI.add("es5-sham", definition); 12 | // CommonJS and 205 | 206 |
207 | 208 | 209 |
210 |
211 |

212 | 213 | {{item.actor.name}} 214 | Expand replies: {{item.links.replies[0].count}} 215 |

216 | {{item.object.content | html}} 217 |
218 | 219 | {{reply.actor.name}}: {{reply.content | html}} 220 |
221 |
222 |
223 | 224 | 225 | 226 | 227 | */ 228 | angular.module('ngResource', ['ng']). 229 | factory('$resource', ['$http', '$parse', function($http, $parse) { 230 | var DEFAULT_ACTIONS = { 231 | 'get': {method:'GET'}, 232 | 'save': {method:'POST'}, 233 | 'query': {method:'GET', isArray:true}, 234 | 'remove': {method:'DELETE'}, 235 | 'delete': {method:'DELETE'} 236 | }; 237 | var noop = angular.noop, 238 | forEach = angular.forEach, 239 | extend = angular.extend, 240 | copy = angular.copy, 241 | isFunction = angular.isFunction, 242 | getter = function(obj, path) { 243 | return $parse(path)(obj); 244 | }; 245 | 246 | /** 247 | * We need our custom method because encodeURIComponent is too aggressive and doesn't follow 248 | * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path 249 | * segments: 250 | * segment = *pchar 251 | * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" 252 | * pct-encoded = "%" HEXDIG HEXDIG 253 | * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" 254 | * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" 255 | * / "*" / "+" / "," / ";" / "=" 256 | */ 257 | function encodeUriSegment(val) { 258 | return encodeUriQuery(val, true). 259 | replace(/%26/gi, '&'). 260 | replace(/%3D/gi, '='). 261 | replace(/%2B/gi, '+'); 262 | } 263 | 264 | 265 | /** 266 | * This method is intended for encoding *key* or *value* parts of query component. We need a custom 267 | * method becuase encodeURIComponent is too agressive and encodes stuff that doesn't have to be 268 | * encoded per http://tools.ietf.org/html/rfc3986: 269 | * query = *( pchar / "/" / "?" ) 270 | * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" 271 | * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" 272 | * pct-encoded = "%" HEXDIG HEXDIG 273 | * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" 274 | * / "*" / "+" / "," / ";" / "=" 275 | */ 276 | function encodeUriQuery(val, pctEncodeSpaces) { 277 | return encodeURIComponent(val). 278 | replace(/%40/gi, '@'). 279 | replace(/%3A/gi, ':'). 280 | replace(/%24/g, '$'). 281 | replace(/%2C/gi, ','). 282 | replace(/%20/g, (pctEncodeSpaces ? '%20' : '+')); 283 | } 284 | 285 | function Route(template, defaults) { 286 | this.template = template = template + '#'; 287 | this.defaults = defaults || {}; 288 | var urlParams = this.urlParams = {}; 289 | forEach(template.split(/\W/), function(param){ 290 | if (param && (new RegExp("(^|[^\\\\]):" + param + "\\W").test(template))) { 291 | urlParams[param] = true; 292 | } 293 | }); 294 | this.template = template.replace(/\\:/g, ':'); 295 | } 296 | 297 | Route.prototype = { 298 | url: function(params) { 299 | var self = this, 300 | url = this.template, 301 | val, 302 | encodedVal; 303 | 304 | params = params || {}; 305 | forEach(this.urlParams, function(_, urlParam){ 306 | val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam]; 307 | if (angular.isDefined(val) && val !== null) { 308 | encodedVal = encodeUriSegment(val); 309 | url = url.replace(new RegExp(":" + urlParam + "(\\W)", "g"), encodedVal + "$1"); 310 | } else { 311 | url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W)", "g"), function(match, 312 | leadingSlashes, tail) { 313 | if (tail.charAt(0) == '/') { 314 | return tail; 315 | } else { 316 | return leadingSlashes + tail; 317 | } 318 | }); 319 | } 320 | }); 321 | url = url.replace(/\/?#$/, ''); 322 | var query = []; 323 | forEach(params, function(value, key){ 324 | if (!self.urlParams[key]) { 325 | query.push(encodeUriQuery(key) + '=' + encodeUriQuery(value)); 326 | } 327 | }); 328 | query.sort(); 329 | url = url.replace(/\/*$/, ''); 330 | return url + (query.length ? '?' + query.join('&') : ''); 331 | } 332 | }; 333 | 334 | 335 | function ResourceFactory(url, paramDefaults, actions) { 336 | var route = new Route(url); 337 | 338 | actions = extend({}, DEFAULT_ACTIONS, actions); 339 | 340 | function extractParams(data, actionParams){ 341 | var ids = {}; 342 | actionParams = extend({}, paramDefaults, actionParams); 343 | forEach(actionParams, function(value, key){ 344 | ids[key] = value.charAt && value.charAt(0) == '@' ? getter(data, value.substr(1)) : value; 345 | }); 346 | return ids; 347 | } 348 | 349 | function Resource(value){ 350 | copy(value || {}, this); 351 | } 352 | 353 | forEach(actions, function(action, name) { 354 | action.method = angular.uppercase(action.method); 355 | var hasBody = action.method == 'POST' || action.method == 'PUT' || action.method == 'PATCH'; 356 | Resource[name] = function(a1, a2, a3, a4) { 357 | var params = {}; 358 | var data; 359 | var success = noop; 360 | var error = null; 361 | switch(arguments.length) { 362 | case 4: 363 | error = a4; 364 | success = a3; 365 | //fallthrough 366 | case 3: 367 | case 2: 368 | if (isFunction(a2)) { 369 | if (isFunction(a1)) { 370 | success = a1; 371 | error = a2; 372 | break; 373 | } 374 | 375 | success = a2; 376 | error = a3; 377 | //fallthrough 378 | } else { 379 | params = a1; 380 | data = a2; 381 | success = a3; 382 | break; 383 | } 384 | case 1: 385 | if (isFunction(a1)) success = a1; 386 | else if (hasBody) data = a1; 387 | else params = a1; 388 | break; 389 | case 0: break; 390 | default: 391 | throw "Expected between 0-4 arguments [params, data, success, error], got " + 392 | arguments.length + " arguments."; 393 | } 394 | 395 | var value = this instanceof Resource ? this : (action.isArray ? [] : new Resource(data)); 396 | $http({ 397 | method: action.method, 398 | url: route.url(extend({}, extractParams(data, action.params || {}), params)), 399 | data: data 400 | }).then(function(response) { 401 | var data = response.data; 402 | 403 | if (data) { 404 | if (action.isArray) { 405 | value.length = 0; 406 | forEach(data, function(item) { 407 | value.push(new Resource(item)); 408 | }); 409 | } else { 410 | copy(data, value); 411 | } 412 | } 413 | (success||noop)(value, response.headers); 414 | }, error); 415 | 416 | return value; 417 | }; 418 | 419 | 420 | Resource.prototype['$' + name] = function(a1, a2, a3) { 421 | var params = extractParams(this), 422 | success = noop, 423 | error; 424 | 425 | switch(arguments.length) { 426 | case 3: params = a1; success = a2; error = a3; break; 427 | case 2: 428 | case 1: 429 | if (isFunction(a1)) { 430 | success = a1; 431 | error = a2; 432 | } else { 433 | params = a1; 434 | success = a2 || noop; 435 | } 436 | case 0: break; 437 | default: 438 | throw "Expected between 1-3 arguments [params, success, error], got " + 439 | arguments.length + " arguments."; 440 | } 441 | var data = hasBody ? this : undefined; 442 | Resource[name].call(this, params, data, success, error); 443 | }; 444 | }); 445 | 446 | Resource.bind = function(additionalParamDefaults){ 447 | return ResourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions); 448 | }; 449 | 450 | return Resource; 451 | } 452 | 453 | return ResourceFactory; 454 | }]); 455 | 456 | 457 | })(window, window.angular); 458 | -------------------------------------------------------------------------------- /bower_components/es5-shim/tests/lib/json2.js: -------------------------------------------------------------------------------- 1 | /* 2 | http://www.JSON.org/json2.js 3 | 2009-08-17 4 | 5 | Public Domain. 6 | 7 | NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. 8 | 9 | See http://www.JSON.org/js.html 10 | 11 | This file creates a global JSON object containing two methods: stringify 12 | and parse. 13 | 14 | JSON.stringify(value, replacer, space) 15 | value any JavaScript value, usually an object or array. 16 | 17 | replacer an optional parameter that determines how object 18 | values are stringified for objects. It can be a 19 | function or an array of strings. 20 | 21 | space an optional parameter that specifies the indentation 22 | of nested structures. If it is omitted, the text will 23 | be packed without extra whitespace. If it is a number, 24 | it will specify the number of spaces to indent at each 25 | level. If it is a string (such as '\t' or ' '), 26 | it contains the characters used to indent at each level. 27 | 28 | This method produces a JSON text from a JavaScript value. 29 | 30 | When an object value is found, if the object contains a toJSON 31 | method, its toJSON method will be called and the result will be 32 | stringified. A toJSON method does not serialize: it returns the 33 | value represented by the name/value pair that should be serialized, 34 | or undefined if nothing should be serialized. The toJSON method 35 | will be passed the key associated with the value, and this will be 36 | bound to the value 37 | 38 | For example, this would serialize Dates as ISO strings. 39 | 40 | Date.prototype.toJSON = function (key) { 41 | function f(n) { 42 | // Format integers to have at least two digits. 43 | return n < 10 ? '0' + n : n; 44 | } 45 | 46 | return this.getUTCFullYear() + '-' + 47 | f(this.getUTCMonth() + 1) + '-' + 48 | f(this.getUTCDate()) + 'T' + 49 | f(this.getUTCHours()) + ':' + 50 | f(this.getUTCMinutes()) + ':' + 51 | f(this.getUTCSeconds()) + 'Z'; 52 | }; 53 | 54 | You can provide an optional replacer method. It will be passed the 55 | key and value of each member, with this bound to the containing 56 | object. The value that is returned from your method will be 57 | serialized. If your method returns undefined, then the member will 58 | be excluded from the serialization. 59 | 60 | If the replacer parameter is an array of strings, then it will be 61 | used to select the members to be serialized. It filters the results 62 | such that only members with keys listed in the replacer array are 63 | stringified. 64 | 65 | Values that do not have JSON representations, such as undefined or 66 | functions, will not be serialized. Such values in objects will be 67 | dropped; in arrays they will be replaced with null. You can use 68 | a replacer function to replace those with JSON values. 69 | JSON.stringify(undefined) returns undefined. 70 | 71 | The optional space parameter produces a stringification of the 72 | value that is filled with line breaks and indentation to make it 73 | easier to read. 74 | 75 | If the space parameter is a non-empty string, then that string will 76 | be used for indentation. If the space parameter is a number, then 77 | the indentation will be that many spaces. 78 | 79 | Example: 80 | 81 | text = JSON.stringify(['e', {pluribus: 'unum'}]); 82 | // text is '["e",{"pluribus":"unum"}]' 83 | 84 | 85 | text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); 86 | // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' 87 | 88 | text = JSON.stringify([new Date()], function (key, value) { 89 | return this[key] instanceof Date ? 90 | 'Date(' + this[key] + ')' : value; 91 | }); 92 | // text is '["Date(---current time---)"]' 93 | 94 | 95 | JSON.parse(text, reviver) 96 | This method parses a JSON text to produce an object or array. 97 | It can throw a SyntaxError exception. 98 | 99 | The optional reviver parameter is a function that can filter and 100 | transform the results. It receives each of the keys and values, 101 | and its return value is used instead of the original value. 102 | If it returns what it received, then the structure is not modified. 103 | If it returns undefined then the member is deleted. 104 | 105 | Example: 106 | 107 | // Parse the text. Values that look like ISO date strings will 108 | // be converted to Date objects. 109 | 110 | myData = JSON.parse(text, function (key, value) { 111 | var a; 112 | if (typeof value === 'string') { 113 | a = 114 | /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); 115 | if (a) { 116 | return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], 117 | +a[5], +a[6])); 118 | } 119 | } 120 | return value; 121 | }); 122 | 123 | myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { 124 | var d; 125 | if (typeof value === 'string' && 126 | value.slice(0, 5) === 'Date(' && 127 | value.slice(-1) === ')') { 128 | d = new Date(value.slice(5, -1)); 129 | if (d) { 130 | return d; 131 | } 132 | } 133 | return value; 134 | }); 135 | 136 | 137 | This is a reference implementation. You are free to copy, modify, or 138 | redistribute. 139 | 140 | This code should be minified before deployment. 141 | See http://javascript.crockford.com/jsmin.html 142 | 143 | USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO 144 | NOT CONTROL. 145 | */ 146 | 147 | /*jslint evil: true */ 148 | 149 | /*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, 150 | call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, 151 | getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, 152 | lastIndex, length, parse, prototype, push, replace, slice, stringify, 153 | test, toJSON, toString, valueOf 154 | */ 155 | 156 | "use strict"; 157 | 158 | // Create a JSON object only if one does not already exist. We create the 159 | // methods in a closure to avoid creating global variables. 160 | 161 | if (!this.JSON) { 162 | this.JSON = {}; 163 | } 164 | 165 | (function () { 166 | 167 | function f(n) { 168 | // Format integers to have at least two digits. 169 | return n < 10 ? '0' + n : n; 170 | } 171 | 172 | if (typeof Date.prototype.toJSON !== 'function') { 173 | 174 | Date.prototype.toJSON = function (key) { 175 | 176 | return isFinite(this.valueOf()) ? 177 | this.getUTCFullYear() + '-' + 178 | f(this.getUTCMonth() + 1) + '-' + 179 | f(this.getUTCDate()) + 'T' + 180 | f(this.getUTCHours()) + ':' + 181 | f(this.getUTCMinutes()) + ':' + 182 | f(this.getUTCSeconds()) + 'Z' : null; 183 | }; 184 | 185 | String.prototype.toJSON = 186 | Number.prototype.toJSON = 187 | Boolean.prototype.toJSON = function (key) { 188 | return this.valueOf(); 189 | }; 190 | } 191 | 192 | var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 193 | escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, 194 | gap, 195 | indent, 196 | meta = { // table of character substitutions 197 | '\b': '\\b', 198 | '\t': '\\t', 199 | '\n': '\\n', 200 | '\f': '\\f', 201 | '\r': '\\r', 202 | '"' : '\\"', 203 | '\\': '\\\\' 204 | }, 205 | rep; 206 | 207 | 208 | function quote(string) { 209 | 210 | // If the string contains no control characters, no quote characters, and no 211 | // backslash characters, then we can safely slap some quotes around it. 212 | // Otherwise we must also replace the offending characters with safe escape 213 | // sequences. 214 | 215 | escapable.lastIndex = 0; 216 | return escapable.test(string) ? 217 | '"' + string.replace(escapable, function (a) { 218 | var c = meta[a]; 219 | return typeof c === 'string' ? c : 220 | '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); 221 | }) + '"' : 222 | '"' + string + '"'; 223 | } 224 | 225 | 226 | function str(key, holder) { 227 | // Produce a string from holder[key]. 228 | 229 | var i, // The loop counter. 230 | k, // The member key. 231 | v, // The member value. 232 | length, 233 | mind = gap, 234 | partial, 235 | value = holder[key]; 236 | 237 | // If the value has a toJSON method, call it to obtain a replacement value. 238 | 239 | if (value && typeof value === 'object' && 240 | typeof value.toJSON === 'function') { 241 | value = value.toJSON(key); 242 | } 243 | 244 | // If we were called with a replacer function, then call the replacer to 245 | // obtain a replacement value. 246 | 247 | if (typeof rep === 'function') { 248 | value = rep.call(holder, key, value); 249 | } 250 | 251 | // What happens next depends on the value's type. 252 | 253 | switch (typeof value) { 254 | case 'string': 255 | return quote(value); 256 | 257 | case 'number': 258 | 259 | // JSON numbers must be finite. Encode non-finite numbers as null. 260 | 261 | return isFinite(value) ? String(value) : 'null'; 262 | 263 | case 'boolean': 264 | case 'null': 265 | 266 | // If the value is a boolean or null, convert it to a string. Note: 267 | // typeof null does not produce 'null'. The case is included here in 268 | // the remote chance that this gets fixed someday. 269 | 270 | return String(value); 271 | 272 | // If the type is 'object', we might be dealing with an object or an array or 273 | // null. 274 | 275 | case 'object': 276 | 277 | // Due to a specification blunder in ECMAScript, typeof null is 'object', 278 | // so watch out for that case. 279 | 280 | if (!value) { 281 | return 'null'; 282 | } 283 | 284 | // Make an array to hold the partial results of stringifying this object value. 285 | 286 | gap += indent; 287 | partial = []; 288 | 289 | // Is the value an array? 290 | 291 | if (Object.prototype.toString.apply(value) === '[object Array]') { 292 | 293 | // The value is an array. Stringify every element. Use null as a placeholder 294 | // for non-JSON values. 295 | 296 | length = value.length; 297 | for (i = 0; i < length; i += 1) { 298 | partial[i] = str(i, value) || 'null'; 299 | } 300 | 301 | // Join all of the elements together, separated with commas, and wrap them in 302 | // brackets. 303 | 304 | v = partial.length === 0 ? '[]' : 305 | gap ? '[\n' + gap + 306 | partial.join(',\n' + gap) + '\n' + 307 | mind + ']' : 308 | '[' + partial.join(',') + ']'; 309 | gap = mind; 310 | return v; 311 | } 312 | 313 | // If the replacer is an array, use it to select the members to be stringified. 314 | 315 | if (rep && typeof rep === 'object') { 316 | length = rep.length; 317 | for (i = 0; i < length; i += 1) { 318 | k = rep[i]; 319 | if (typeof k === 'string') { 320 | v = str(k, value); 321 | if (v) { 322 | partial.push(quote(k) + (gap ? ': ' : ':') + v); 323 | } 324 | } 325 | } 326 | } else { 327 | 328 | // Otherwise, iterate through all of the keys in the object. 329 | 330 | for (k in value) { 331 | if (Object.hasOwnProperty.call(value, k)) { 332 | v = str(k, value); 333 | if (v) { 334 | partial.push(quote(k) + (gap ? ': ' : ':') + v); 335 | } 336 | } 337 | } 338 | } 339 | 340 | // Join all of the member texts together, separated with commas, 341 | // and wrap them in braces. 342 | 343 | v = partial.length === 0 ? '{}' : 344 | gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + 345 | mind + '}' : '{' + partial.join(',') + '}'; 346 | gap = mind; 347 | return v; 348 | } 349 | } 350 | 351 | // If the JSON object does not yet have a stringify method, give it one. 352 | 353 | if (typeof JSON.stringify !== 'function') { 354 | JSON.stringify = function (value, replacer, space) { 355 | // The stringify method takes a value and an optional replacer, and an optional 356 | // space parameter, and returns a JSON text. The replacer can be a function 357 | // that can replace values, or an array of strings that will select the keys. 358 | // A default replacer method can be provided. Use of the space parameter can 359 | // produce text that is more easily readable. 360 | 361 | var i; 362 | gap = ''; 363 | indent = ''; 364 | 365 | // If the space parameter is a number, make an indent string containing that 366 | // many spaces. 367 | 368 | if (typeof space === 'number') { 369 | for (i = 0; i < space; i += 1) { 370 | indent += ' '; 371 | } 372 | 373 | // If the space parameter is a string, it will be used as the indent string. 374 | 375 | } else if (typeof space === 'string') { 376 | indent = space; 377 | } 378 | 379 | // If there is a replacer, it must be a function or an array. 380 | // Otherwise, throw an error. 381 | 382 | rep = replacer; 383 | if (replacer && typeof replacer !== 'function' && 384 | (typeof replacer !== 'object' || 385 | typeof replacer.length !== 'number')) { 386 | throw new Error('JSON.stringify'); 387 | } 388 | 389 | // Make a fake root object containing our value under the key of ''. 390 | // Return the result of stringifying the value. 391 | 392 | return str('', {'': value}); 393 | }; 394 | } 395 | 396 | 397 | // If the JSON object does not yet have a parse method, give it one. 398 | 399 | if (typeof JSON.parse !== 'function') { 400 | JSON.parse = function (text, reviver) { 401 | 402 | // The parse method takes a text and an optional reviver function, and returns 403 | // a JavaScript value if the text is a valid JSON text. 404 | 405 | var j; 406 | 407 | function walk(holder, key) { 408 | 409 | // The walk method is used to recursively walk the resulting structure so 410 | // that modifications can be made. 411 | 412 | var k, v, value = holder[key]; 413 | if (value && typeof value === 'object') { 414 | for (k in value) { 415 | if (Object.hasOwnProperty.call(value, k)) { 416 | v = walk(value, k); 417 | if (v !== undefined) { 418 | value[k] = v; 419 | } else { 420 | delete value[k]; 421 | } 422 | } 423 | } 424 | } 425 | return reviver.call(holder, key, value); 426 | } 427 | 428 | 429 | // Parsing happens in four stages. In the first stage, we replace certain 430 | // Unicode characters with escape sequences. JavaScript handles many characters 431 | // incorrectly, either silently deleting them, or treating them as line endings. 432 | 433 | cx.lastIndex = 0; 434 | if (cx.test(text)) { 435 | text = text.replace(cx, function (a) { 436 | return '\\u' + 437 | ('0000' + a.charCodeAt(0).toString(16)).slice(-4); 438 | }); 439 | } 440 | 441 | // In the second stage, we run the text against regular expressions that look 442 | // for non-JSON patterns. We are especially concerned with '()' and 'new' 443 | // because they can cause invocation, and '=' because it can cause mutation. 444 | // But just to be safe, we want to reject all unexpected forms. 445 | 446 | // We split the second stage into 4 regexp operations in order to work around 447 | // crippling inefficiencies in IE's and Safari's regexp engines. First we 448 | // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we 449 | // replace all simple value tokens with ']' characters. Third, we delete all 450 | // open brackets that follow a colon or comma or that begin the text. Finally, 451 | // we look to see that the remaining characters are only whitespace or ']' or 452 | // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. 453 | 454 | if (/^[\],:{}\s]*$/. 455 | test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@'). 456 | replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']'). 457 | replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { 458 | 459 | // In the third stage we use the eval function to compile the text into a 460 | // JavaScript structure. The '{' operator is subject to a syntactic ambiguity 461 | // in JavaScript: it can begin a block or an object literal. We wrap the text 462 | // in parens to eliminate the ambiguity. 463 | 464 | j = eval('(' + text + ')'); 465 | 466 | // In the optional fourth stage, we recursively walk the new structure, passing 467 | // each name/value pair to a reviver function for possible transformation. 468 | 469 | return typeof reviver === 'function' ? 470 | walk({'': j}, '') : j; 471 | } 472 | 473 | // If the text is not JSON parseable, then a SyntaxError is thrown. 474 | 475 | throw new SyntaxError('JSON.parse'); 476 | }; 477 | } 478 | }()); 479 | --------------------------------------------------------------------------------