mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 21:52:19 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
7
web/node_modules/raf/LICENSE
generated
vendored
Normal file
7
web/node_modules/raf/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
Copyright 2013 Chris Dickinson <chris@neversaw.us>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
83
web/node_modules/raf/README.md
generated
vendored
Normal file
83
web/node_modules/raf/README.md
generated
vendored
Normal file
|
@ -0,0 +1,83 @@
|
|||
# raf
|
||||
|
||||
[](http://ci.testling.com/chrisdickinson/raf)
|
||||
|
||||
requestAnimationFrame polyfill for node and the browser.
|
||||
|
||||
```js
|
||||
var raf = require('raf')
|
||||
|
||||
raf(function tick() {
|
||||
// Animation logic
|
||||
raf(tick)
|
||||
})
|
||||
```
|
||||
|
||||
**Note:** The stream/event emitter logic found in versions prior to 1.0.0 can be found in [raf-stream](https://www.npmjs.org/package/raf-stream).
|
||||
|
||||
## Getting started
|
||||
|
||||
### CommonJS (Node, Browserify, Webpack, etc.)
|
||||
|
||||
Install `raf` from npm:
|
||||
|
||||
```bash
|
||||
npm install --save raf
|
||||
```
|
||||
|
||||
Require it like you would any other module:
|
||||
|
||||
```js
|
||||
const raf = require('raf')
|
||||
```
|
||||
|
||||
### AMD (require.js, etc)
|
||||
|
||||
Download the UMD-bundle from [wzrd.in](https://wzrd.in/standalone/raf@latest) (remember to include the current version number in the filename).
|
||||
|
||||
Add it to your AMD module loader config and require it like you would any other module:
|
||||
|
||||
```html
|
||||
define(['raf'], raf => {...})
|
||||
```
|
||||
|
||||
### `<script>`
|
||||
|
||||
Download the UMD-bundle from [wzrd.in](https://wzrd.in/standalone/raf@latest) (remember to include the current version number in the filename).
|
||||
|
||||
Then include it via a script tag:
|
||||
|
||||
```html
|
||||
<script src="raf-x.x.x.js"></script>
|
||||
```
|
||||
|
||||
The API will be available on `window.raf`.
|
||||
|
||||
## API
|
||||
|
||||
[Documentation at Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame), [W3 Specification](http://www.w3.org/TR/animation-timing/#requestAnimationFrame)
|
||||
|
||||
### var handle = raf(callback)
|
||||
|
||||
`callback` is the function to invoke in the next frame. `handle` is a long integer value that uniquely identifies the entry in the callback list. This is a non-zero value, but you may not make any other assumptions about its value.
|
||||
|
||||
### raf.cancel(handle)
|
||||
|
||||
`handle` is the entry identifier returned by `raf()`. Removes the queued animation frame callback (other queued callbacks will still be invoked unless cancelled).
|
||||
|
||||
### raf.polyfill([object])
|
||||
|
||||
Shorthand to polyfill `window.requestAnimationFrame` and `window.cancelAnimationFrame` if necessary (Polyfills `global` in node).
|
||||
|
||||
Alternatively you can require `raf/polyfill` which will act the same as `require('raf').polyfill()`.
|
||||
|
||||
If you provide `object` the polyfills are attached to that given object, instead of the inferred global.
|
||||
Useful if you have an instance of a fake `window` object, and want to add `raf` and `caf` to it.
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
Based on work by Erik Möller, Paul Irish, and Tino Zijdel (https://gist.github.com/paulirish/1579671)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
75
web/node_modules/raf/index.js
generated
vendored
Normal file
75
web/node_modules/raf/index.js
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
var now = require('performance-now')
|
||||
, root = typeof window === 'undefined' ? global : window
|
||||
, vendors = ['moz', 'webkit']
|
||||
, suffix = 'AnimationFrame'
|
||||
, raf = root['request' + suffix]
|
||||
, caf = root['cancel' + suffix] || root['cancelRequest' + suffix]
|
||||
|
||||
for(var i = 0; !raf && i < vendors.length; i++) {
|
||||
raf = root[vendors[i] + 'Request' + suffix]
|
||||
caf = root[vendors[i] + 'Cancel' + suffix]
|
||||
|| root[vendors[i] + 'CancelRequest' + suffix]
|
||||
}
|
||||
|
||||
// Some versions of FF have rAF but not cAF
|
||||
if(!raf || !caf) {
|
||||
var last = 0
|
||||
, id = 0
|
||||
, queue = []
|
||||
, frameDuration = 1000 / 60
|
||||
|
||||
raf = function(callback) {
|
||||
if(queue.length === 0) {
|
||||
var _now = now()
|
||||
, next = Math.max(0, frameDuration - (_now - last))
|
||||
last = next + _now
|
||||
setTimeout(function() {
|
||||
var cp = queue.slice(0)
|
||||
// Clear queue here to prevent
|
||||
// callbacks from appending listeners
|
||||
// to the current frame's queue
|
||||
queue.length = 0
|
||||
for(var i = 0; i < cp.length; i++) {
|
||||
if(!cp[i].cancelled) {
|
||||
try{
|
||||
cp[i].callback(last)
|
||||
} catch(e) {
|
||||
setTimeout(function() { throw e }, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
}, Math.round(next))
|
||||
}
|
||||
queue.push({
|
||||
handle: ++id,
|
||||
callback: callback,
|
||||
cancelled: false
|
||||
})
|
||||
return id
|
||||
}
|
||||
|
||||
caf = function(handle) {
|
||||
for(var i = 0; i < queue.length; i++) {
|
||||
if(queue[i].handle === handle) {
|
||||
queue[i].cancelled = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function(fn) {
|
||||
// Wrap in a new function to prevent
|
||||
// `cancel` potentially being assigned
|
||||
// to the native rAF function
|
||||
return raf.call(root, fn)
|
||||
}
|
||||
module.exports.cancel = function() {
|
||||
caf.apply(root, arguments)
|
||||
}
|
||||
module.exports.polyfill = function(object) {
|
||||
if (!object) {
|
||||
object = root;
|
||||
}
|
||||
object.requestAnimationFrame = raf
|
||||
object.cancelAnimationFrame = caf
|
||||
}
|
48
web/node_modules/raf/package.json
generated
vendored
Normal file
48
web/node_modules/raf/package.json
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "raf",
|
||||
"version": "3.4.1",
|
||||
"description": "requestAnimationFrame polyfill for node and the browser",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"testling": "browserify test.js | testling",
|
||||
"test": "node test.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/chrisdickinson/raf.git"
|
||||
},
|
||||
"keywords": [
|
||||
"requestAnimationFrame",
|
||||
"polyfill"
|
||||
],
|
||||
"author": "Chris Dickinson <chris@neversaw.us>",
|
||||
"contributors": [
|
||||
"Christian Maughan Tegnér <christian.tegner@gmail.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"testling": "~1.6.1",
|
||||
"browserify": "~4.1.2",
|
||||
"tape": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"performance-now": "^2.1.0"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test.js",
|
||||
"browsers": [
|
||||
"iexplore/6.0..latest",
|
||||
"firefox/3.0..6.0",
|
||||
"firefox/15.0..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/4.0..10.0",
|
||||
"chrome/20.0..latest",
|
||||
"chrome/canary",
|
||||
"opera/10.0..latest",
|
||||
"opera/next",
|
||||
"safari/4.0..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest"
|
||||
]
|
||||
}
|
||||
}
|
1
web/node_modules/raf/polyfill.js
generated
vendored
Normal file
1
web/node_modules/raf/polyfill.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
require('./').polyfill()
|
62
web/node_modules/raf/test.js
generated
vendored
Normal file
62
web/node_modules/raf/test.js
generated
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
var test = require('tape')
|
||||
, raf = require('./index.js')
|
||||
|
||||
test('continues to emit events', function(t) {
|
||||
t.plan(11)
|
||||
|
||||
var start = new Date().getTime()
|
||||
, times = 0
|
||||
|
||||
raf(function tick(dt) {
|
||||
t.ok(dt >= 0, 'time has passed: ' + dt)
|
||||
if(++times == 10) {
|
||||
var elapsed = (new Date().getTime() - start)
|
||||
t.ok(elapsed >= 150, 'should take at least 9 frames worth of wall time: ' + elapsed)
|
||||
t.end()
|
||||
} else {
|
||||
raf(tick)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
test('cancel removes callbacks from queue', function(t) {
|
||||
t.plan(6)
|
||||
|
||||
function cb1() { cb1.called = true }
|
||||
function cb2() { cb2.called = true }
|
||||
function cb3() { cb3.called = true }
|
||||
|
||||
var handle1 = raf(cb1)
|
||||
t.ok(handle1, 'returns a handle')
|
||||
var handle2 = raf(cb2)
|
||||
t.ok(handle2, 'returns a handle')
|
||||
var handle3 = raf(cb3)
|
||||
t.ok(handle3, 'returns a handle')
|
||||
|
||||
raf.cancel(handle2)
|
||||
|
||||
raf(function() {
|
||||
t.ok(cb1.called, 'callback was invoked')
|
||||
t.notOk(cb2.called, 'callback was cancelled')
|
||||
t.ok(cb3.called, 'callback was invoked')
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
|
||||
test('raf should throw on errors', function(t) {
|
||||
t.plan(1)
|
||||
|
||||
var onError = function() {
|
||||
t.pass('error bubbled up to event loop')
|
||||
}
|
||||
|
||||
if(typeof window !== 'undefined') {
|
||||
window.onerror = onError
|
||||
} else if(typeof process !== 'undefined') {
|
||||
process.on('uncaughtException', onError)
|
||||
}
|
||||
|
||||
raf(function() {
|
||||
throw new Error('foo')
|
||||
})
|
||||
})
|
5
web/node_modules/raf/window.js
generated
vendored
Normal file
5
web/node_modules/raf/window.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
try {
|
||||
module.exports = window
|
||||
} catch(e) {
|
||||
module.exports = {}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue