diff --git a/dashboard-ui/bower_components/get-style-property/.bower.json b/dashboard-ui/bower_components/get-style-property/.bower.json index d943fa3b04..973f1966c0 100644 --- a/dashboard-ui/bower_components/get-style-property/.bower.json +++ b/dashboard-ui/bower_components/get-style-property/.bower.json @@ -31,6 +31,6 @@ "commit": "34fc5e4a0f252964ed2790138b8d7d30d04b55c1" }, "_source": "git://github.com/desandro/get-style-property.git", - "_target": "~1.0.4", + "_target": "1.x", "_originalSource": "get-style-property" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-behaviors/.bower.json b/dashboard-ui/bower_components/iron-behaviors/.bower.json index 5d74fa6525..b5f528b092 100644 --- a/dashboard-ui/bower_components/iron-behaviors/.bower.json +++ b/dashboard-ui/bower_components/iron-behaviors/.bower.json @@ -29,14 +29,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "ignore": [], - "homepage": "https://github.com/polymerelements/iron-behaviors", + "homepage": "https://github.com/PolymerElements/iron-behaviors", "_release": "1.0.11", "_resolution": { "type": "version", "tag": "v1.0.11", "commit": "084fbc7f60343d717bb2208f350774f4c9899777" }, - "_source": "git://github.com/polymerelements/iron-behaviors.git", + "_source": "git://github.com/PolymerElements/iron-behaviors.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-behaviors" + "_originalSource": "PolymerElements/iron-behaviors" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json index 781650cdba..3911d5458a 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json @@ -33,14 +33,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "ignore": [], - "homepage": "https://github.com/polymerelements/iron-overlay-behavior", + "homepage": "https://github.com/PolymerElements/iron-overlay-behavior", "_release": "1.1.1", "_resolution": { "type": "version", "tag": "v1.1.1", "commit": "1ed1603ce820456feab3f62ae86f8f3ec801d131" }, - "_source": "git://github.com/polymerelements/iron-overlay-behavior.git", + "_source": "git://github.com/PolymerElements/iron-overlay-behavior.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-overlay-behavior" + "_originalSource": "PolymerElements/iron-overlay-behavior" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json b/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json index 1f0548f3d7..9ae5e84c7e 100644 --- a/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json @@ -27,14 +27,14 @@ "web-component-tester": "*", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "homepage": "https://github.com/polymerelements/iron-resizable-behavior", + "homepage": "https://github.com/PolymerElements/iron-resizable-behavior", "_release": "1.0.2", "_resolution": { "type": "version", "tag": "v1.0.2", "commit": "85de8ba28be2bf17c81d6436ef1119022b003674" }, - "_source": "git://github.com/polymerelements/iron-resizable-behavior.git", + "_source": "git://github.com/PolymerElements/iron-resizable-behavior.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-resizable-behavior" + "_originalSource": "PolymerElements/iron-resizable-behavior" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-selector/.bower.json b/dashboard-ui/bower_components/iron-selector/.bower.json index ebb18c5b7b..52d44c1907 100644 --- a/dashboard-ui/bower_components/iron-selector/.bower.json +++ b/dashboard-ui/bower_components/iron-selector/.bower.json @@ -36,7 +36,7 @@ "tag": "v1.0.8", "commit": "e9a66727f3da0446f04956d4e4f1dcd51cdec2ff" }, - "_source": "git://github.com/polymerelements/iron-selector.git", + "_source": "git://github.com/PolymerElements/iron-selector.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-selector" + "_originalSource": "PolymerElements/iron-selector" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/native-promise-only/.bower.json b/dashboard-ui/bower_components/native-promise-only/.bower.json new file mode 100644 index 0000000000..95b80b4a0d --- /dev/null +++ b/dashboard-ui/bower_components/native-promise-only/.bower.json @@ -0,0 +1,15 @@ +{ + "name": "native-promise-only", + "homepage": "https://github.com/getify/native-promise-only", + "version": "0.8.0-a", + "_release": "0.8.0-a", + "_resolution": { + "type": "version", + "tag": "0.8.0-a", + "commit": "d40a2d0197feea4f9b0bf5f8bf3079465ced3758" + }, + "_source": "git://github.com/getify/native-promise-only.git", + "_target": "~0.8.0-a", + "_originalSource": "native-promise-only", + "_direct": true +} \ No newline at end of file diff --git a/dashboard-ui/bower_components/native-promise-only/.gitignore b/dashboard-ui/bower_components/native-promise-only/.gitignore new file mode 100644 index 0000000000..f11ac4368a --- /dev/null +++ b/dashboard-ui/bower_components/native-promise-only/.gitignore @@ -0,0 +1,2 @@ +node_modules +npo.js diff --git a/dashboard-ui/bower_components/native-promise-only/.npmignore b/dashboard-ui/bower_components/native-promise-only/.npmignore new file mode 100644 index 0000000000..859204df5e --- /dev/null +++ b/dashboard-ui/bower_components/native-promise-only/.npmignore @@ -0,0 +1,2 @@ +node_modules +.gitignore diff --git a/dashboard-ui/bower_components/native-promise-only/build.js b/dashboard-ui/bower_components/native-promise-only/build.js new file mode 100644 index 0000000000..7cf2ad9e3e --- /dev/null +++ b/dashboard-ui/bower_components/native-promise-only/build.js @@ -0,0 +1,34 @@ +#!/usr/bin/env node + +var fs = require("fs"), + path = require("path"), + exec = require("child_process").exec, + ugly = require("uglify-js"), + + result +; + +console.log("*** Building ***"); +console.log("Minifying to npo.js."); + +try { + result = ugly.minify(path.join(__dirname,"lib","npo.src.js"),{ + mangle: true, + compress: true, + output: { + comments: /^!/ + } + }); + + fs.writeFileSync( + path.join(__dirname,"npo.js"), + result.code + "\n", + { encoding: "utf8" } + ); + + console.log("Complete."); +} +catch (err) { + console.error(err); + process.exit(1); +} diff --git a/dashboard-ui/bower_components/native-promise-only/lib/npo.src.js b/dashboard-ui/bower_components/native-promise-only/lib/npo.src.js new file mode 100644 index 0000000000..bc82fdff38 --- /dev/null +++ b/dashboard-ui/bower_components/native-promise-only/lib/npo.src.js @@ -0,0 +1,373 @@ +/*! Native Promise Only + v0.8.0-a (c) Kyle Simpson + MIT License: http://getify.mit-license.org +*/ + +(function UMD(name,context,definition){ + // special form of UMD for polyfilling across evironments + context[name] = context[name] || definition(); + if (typeof module != "undefined" && module.exports) { module.exports = context[name]; } + else if (typeof define == "function" && define.amd) { define(function $AMD$(){ return context[name]; }); } +})("Promise",typeof global != "undefined" ? global : this,function DEF(){ + /*jshint validthis:true */ + "use strict"; + + var builtInProp, cycle, scheduling_queue, + ToString = Object.prototype.toString, + timer = (typeof setImmediate != "undefined") ? + function timer(fn) { return setImmediate(fn); } : + setTimeout + ; + + // dammit, IE8. + try { + Object.defineProperty({},"x",{}); + builtInProp = function builtInProp(obj,name,val,config) { + return Object.defineProperty(obj,name,{ + value: val, + writable: true, + configurable: config !== false + }); + }; + } + catch (err) { + builtInProp = function builtInProp(obj,name,val) { + obj[name] = val; + return obj; + }; + } + + // Note: using a queue instead of array for efficiency + scheduling_queue = (function Queue() { + var first, last, item; + + function Item(fn,self) { + this.fn = fn; + this.self = self; + this.next = void 0; + } + + return { + add: function add(fn,self) { + item = new Item(fn,self); + if (last) { + last.next = item; + } + else { + first = item; + } + last = item; + item = void 0; + }, + drain: function drain() { + var f = first; + first = last = cycle = void 0; + + while (f) { + f.fn.call(f.self); + f = f.next; + } + } + }; + })(); + + function schedule(fn,self) { + scheduling_queue.add(fn,self); + if (!cycle) { + cycle = timer(scheduling_queue.drain); + } + } + + // promise duck typing + function isThenable(o) { + var _then, o_type = typeof o; + + if (o != null && + ( + o_type == "object" || o_type == "function" + ) + ) { + _then = o.then; + } + return typeof _then == "function" ? _then : false; + } + + function notify() { + for (var i=0; i 0) { + schedule(notify,self); + } + } + } + catch (err) { + reject.call(new MakeDefWrapper(self),err); + } + } + + function reject(msg) { + var self = this; + + // already triggered? + if (self.triggered) { return; } + + self.triggered = true; + + // unwrap + if (self.def) { + self = self.def; + } + + self.msg = msg; + self.state = 2; + if (self.chain.length > 0) { + schedule(notify,self); + } + } + + function iteratePromises(Constructor,arr,resolver,rejecter) { + for (var idx=0; idx", + "license": "MIT" +} diff --git a/dashboard-ui/bower_components/native-promise-only/test_adapter.js b/dashboard-ui/bower_components/native-promise-only/test_adapter.js new file mode 100644 index 0000000000..ece6b8e3ea --- /dev/null +++ b/dashboard-ui/bower_components/native-promise-only/test_adapter.js @@ -0,0 +1,21 @@ +// Adapter for "promises-aplus-tests" test runner + +var path = require("path"); +var Promise = require(path.join(__dirname,"lib","npo.src.js")); + +module.exports.deferred = function __deferred__() { + var o = {}; + o.promise = new Promise(function __Promise__(resolve,reject){ + o.resolve = resolve; + o.reject = reject; + }); + return o; +}; + +module.exports.resolved = function __resolved__(val) { + return Promise.resolve(val); +}; + +module.exports.rejected = function __rejected__(reason) { + return Promise.reject(reason); +}; diff --git a/dashboard-ui/bower_components/neon-animation/.bower.json b/dashboard-ui/bower_components/neon-animation/.bower.json index 67f935cf9f..fa31ad184d 100644 --- a/dashboard-ui/bower_components/neon-animation/.bower.json +++ b/dashboard-ui/bower_components/neon-animation/.bower.json @@ -54,7 +54,7 @@ "tag": "v1.0.8", "commit": "36656916b75a4715b025a03473620002c2650ee8" }, - "_source": "git://github.com/polymerelements/neon-animation.git", + "_source": "git://github.com/PolymerElements/neon-animation.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/neon-animation" + "_originalSource": "PolymerElements/neon-animation" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/paper-behaviors/.bower.json b/dashboard-ui/bower_components/paper-behaviors/.bower.json index 713d584e4f..a76af97568 100644 --- a/dashboard-ui/bower_components/paper-behaviors/.bower.json +++ b/dashboard-ui/bower_components/paper-behaviors/.bower.json @@ -45,7 +45,7 @@ "tag": "v1.0.10", "commit": "4b244a542af2c6c271498dfb98b00ed284df1d6a" }, - "_source": "git://github.com/PolymerElements/paper-behaviors.git", + "_source": "git://github.com/polymerelements/paper-behaviors.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/paper-behaviors" + "_originalSource": "polymerelements/paper-behaviors" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/paper-input/.bower.json b/dashboard-ui/bower_components/paper-input/.bower.json index 91b2f2300d..d0ff753f59 100644 --- a/dashboard-ui/bower_components/paper-input/.bower.json +++ b/dashboard-ui/bower_components/paper-input/.bower.json @@ -50,7 +50,7 @@ "tag": "v1.1.1", "commit": "1bbce220b027dc030b294163f7da6f3e9052ab13" }, - "_source": "git://github.com/polymerelements/paper-input.git", - "_target": "^1.0.9", - "_originalSource": "polymerelements/paper-input" + "_source": "git://github.com/PolymerElements/paper-input.git", + "_target": "^1.0.0", + "_originalSource": "PolymerElements/paper-input" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/promise-polyfill/.bower.json b/dashboard-ui/bower_components/promise-polyfill/.bower.json deleted file mode 100644 index 63cbef81d1..0000000000 --- a/dashboard-ui/bower_components/promise-polyfill/.bower.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "promise-polyfill", - "version": "2.1.0", - "homepage": "https://github.com/taylorhakes/promise-polyfill", - "authors": [ - "Taylor Hakes" - ], - "description": "Lightweight promise polyfill for the browser and node. A+ Compliant.", - "main": "Promise.js", - "moduleType": [ - "globals", - "node" - ], - "keywords": [ - "promise", - "es6", - "polyfill", - "html5" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "_release": "2.1.0", - "_resolution": { - "type": "version", - "tag": "2.1.0", - "commit": "7ee8e28671e2e7ff0304ea37c3d1fb1288645362" - }, - "_source": "git://github.com/taylorhakes/promise-polyfill.git", - "_target": "~2.1.0", - "_originalSource": "promise-polyfill", - "_direct": true -} \ No newline at end of file diff --git a/dashboard-ui/bower_components/promise-polyfill/Gruntfile.js b/dashboard-ui/bower_components/promise-polyfill/Gruntfile.js deleted file mode 100644 index ef1cbfaa06..0000000000 --- a/dashboard-ui/bower_components/promise-polyfill/Gruntfile.js +++ /dev/null @@ -1,23 +0,0 @@ -module.exports = function(grunt) { - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - - uglify: { - options: { - banner: '/*! <%= pkg.name %> <%= pkg.version %> */\n' - }, - dist: { - files: { - 'Promise.min.js': ['Promise.js'] - } - } - } - - }); - - grunt.loadNpmTasks('grunt-contrib-uglify'); - - grunt.registerTask('build', ['uglify']); - -}; diff --git a/dashboard-ui/bower_components/promise-polyfill/LICENSE b/dashboard-ui/bower_components/promise-polyfill/LICENSE deleted file mode 100644 index 94b9dac3f5..0000000000 --- a/dashboard-ui/bower_components/promise-polyfill/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2014 Taylor Hakes -Copyright (c) 2014 Forbes Lindesay - -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. \ No newline at end of file diff --git a/dashboard-ui/bower_components/promise-polyfill/Promise.js b/dashboard-ui/bower_components/promise-polyfill/Promise.js deleted file mode 100644 index 47453e5053..0000000000 --- a/dashboard-ui/bower_components/promise-polyfill/Promise.js +++ /dev/null @@ -1,190 +0,0 @@ -(function(root) { - - // Use polyfill for setImmediate for performance gains - var asap = (typeof setImmediate === 'function' && setImmediate) || - function(fn) { setTimeout(fn, 1); }; - - // Polyfill for Function.prototype.bind - function bind(fn, thisArg) { - return function() { - fn.apply(thisArg, arguments); - } - } - - var isArray = Array.isArray || function(value) { return Object.prototype.toString.call(value) === "[object Array]" }; - - function Promise(fn) { - if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new'); - if (typeof fn !== 'function') throw new TypeError('not a function'); - this._state = null; - this._value = null; - this._deferreds = [] - - doResolve(fn, bind(resolve, this), bind(reject, this)) - } - - function handle(deferred) { - var me = this; - if (this._state === null) { - this._deferreds.push(deferred); - return - } - asap(function() { - var cb = me._state ? deferred.onFulfilled : deferred.onRejected - if (cb === null) { - (me._state ? deferred.resolve : deferred.reject)(me._value); - return; - } - var ret; - try { - ret = cb(me._value); - } - catch (e) { - deferred.reject(e); - return; - } - deferred.resolve(ret); - }) - } - - function resolve(newValue) { - try { //Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure - if (newValue === this) throw new TypeError('A promise cannot be resolved with itself.'); - if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { - var then = newValue.then; - if (typeof then === 'function') { - doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this)); - return; - } - } - this._state = true; - this._value = newValue; - finale.call(this); - } catch (e) { reject.call(this, e); } - } - - function reject(newValue) { - this._state = false; - this._value = newValue; - finale.call(this); - } - - function finale() { - for (var i = 0, len = this._deferreds.length; i < len; i++) { - handle.call(this, this._deferreds[i]); - } - this._deferreds = null; - } - - function Handler(onFulfilled, onRejected, resolve, reject){ - this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; - this.onRejected = typeof onRejected === 'function' ? onRejected : null; - this.resolve = resolve; - this.reject = reject; - } - - /** - * Take a potentially misbehaving resolver function and make sure - * onFulfilled and onRejected are only called once. - * - * Makes no guarantees about asynchrony. - */ - function doResolve(fn, onFulfilled, onRejected) { - var done = false; - try { - fn(function (value) { - if (done) return; - done = true; - onFulfilled(value); - }, function (reason) { - if (done) return; - done = true; - onRejected(reason); - }) - } catch (ex) { - if (done) return; - done = true; - onRejected(ex); - } - } - - Promise.prototype['catch'] = function (onRejected) { - return this.then(null, onRejected); - }; - - Promise.prototype.then = function(onFulfilled, onRejected) { - var me = this; - return new Promise(function(resolve, reject) { - handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject)); - }) - }; - - Promise.all = function () { - var args = Array.prototype.slice.call(arguments.length === 1 && isArray(arguments[0]) ? arguments[0] : arguments); - - return new Promise(function (resolve, reject) { - if (args.length === 0) return resolve([]); - var remaining = args.length; - function res(i, val) { - try { - if (val && (typeof val === 'object' || typeof val === 'function')) { - var then = val.then; - if (typeof then === 'function') { - then.call(val, function (val) { res(i, val) }, reject); - return; - } - } - args[i] = val; - if (--remaining === 0) { - resolve(args); - } - } catch (ex) { - reject(ex); - } - } - for (var i = 0; i < args.length; i++) { - res(i, args[i]); - } - }); - }; - - Promise.resolve = function (value) { - if (value && typeof value === 'object' && value.constructor === Promise) { - return value; - } - - return new Promise(function (resolve) { - resolve(value); - }); - }; - - Promise.reject = function (value) { - return new Promise(function (resolve, reject) { - reject(value); - }); - }; - - Promise.race = function (values) { - return new Promise(function (resolve, reject) { - for(var i = 0, len = values.length; i < len; i++) { - values[i].then(resolve, reject); - } - }); - }; - - /** - * Set the immediate function to execute callbacks - * @param fn {function} Function to execute - * @private - */ - Promise._setImmediateFn = function _setImmediateFn(fn) { - asap = fn; - }; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = Promise; - } else if (!root.Promise) { - root.Promise = Promise; - } - -})(this); \ No newline at end of file diff --git a/dashboard-ui/bower_components/promise-polyfill/Promise.min.js b/dashboard-ui/bower_components/promise-polyfill/Promise.min.js deleted file mode 100644 index fe61cac641..0000000000 --- a/dashboard-ui/bower_components/promise-polyfill/Promise.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! promise-polyfill 2.1.0 */ -!function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof a)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void j(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError("A promise cannot be resolved with itself.");if(a&&("object"==typeof a||"function"==typeof a)){var c=a.then;if("function"==typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled="function"==typeof a?a:null,this.onRejected="function"==typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j="function"==typeof setImmediate&&setImmediate||function(a){setTimeout(a,1)},k=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};c.prototype["catch"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&k(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&("object"==typeof g||"function"==typeof g)){var h=g.then;if("function"==typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){j=a},"undefined"!=typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this); \ No newline at end of file diff --git a/dashboard-ui/bower_components/promise-polyfill/bower.json b/dashboard-ui/bower_components/promise-polyfill/bower.json deleted file mode 100644 index d7c12b6c4f..0000000000 --- a/dashboard-ui/bower_components/promise-polyfill/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "promise-polyfill", - "version": "2.1.0", - "homepage": "https://github.com/taylorhakes/promise-polyfill", - "authors": [ - "Taylor Hakes" - ], - "description": "Lightweight promise polyfill for the browser and node. A+ Compliant.", - "main": "Promise.js", - "moduleType": [ - "globals", - "node" - ], - "keywords": [ - "promise", - "es6", - "polyfill", - "html5" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/dashboard-ui/bower_components/promise-polyfill/jasmine.json b/dashboard-ui/bower_components/promise-polyfill/jasmine.json deleted file mode 100644 index 9f4542e6b4..0000000000 --- a/dashboard-ui/bower_components/promise-polyfill/jasmine.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "spec_dir": "tests", - "spec_files": [ - "**/*.spec.js" - ], - "helpers": [] -} \ No newline at end of file diff --git a/dashboard-ui/bower_components/promise-polyfill/package.json b/dashboard-ui/bower_components/promise-polyfill/package.json deleted file mode 100644 index 8817f83d14..0000000000 --- a/dashboard-ui/bower_components/promise-polyfill/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "promise-polyfill", - "version": "2.1.0", - "description": "Lightweight promise polyfill. A+ compliant", - "main": "Promise.js", - "scripts": { - "test": "./node_modules/.bin/promises-aplus-tests tests/adapter.js && JASMINE_CONFIG_PATH=jasmine.json ./node_modules/jasmine/bin/jasmine.js;" - }, - "repository": { - "type": "git", - "url": "https://taylorhakes@github.com/taylorhakes/promise-polyfill.git" - }, - "author": "Taylor Hakes", - "license": "MIT", - "bugs": { - "url": "https://github.com/taylorhakes/promise-polyfill/issues" - }, - "homepage": "https://github.com/taylorhakes/promise-polyfill", - "devDependencies": { - "grunt": "^0.4.4", - "grunt-contrib-uglify": "^0.4.0", - "jasmine": "^2.3.1", - "promises-aplus-tests": "*" - }, - "keywords": [ - "promise", - "promise-polyfill", - "ES6", - "promises-aplus" - ], - "dependencies": {} -} diff --git a/dashboard-ui/components/imagestore.js b/dashboard-ui/components/imagestore.js new file mode 100644 index 0000000000..25a9299d8c --- /dev/null +++ b/dashboard-ui/components/imagestore.js @@ -0,0 +1,170 @@ +(function () { + + function setImageIntoElement(elem, url) { + + if (elem.tagName !== "IMG") { + + elem.style.backgroundImage = "url('" + url + "')"; + + } else { + elem.setAttribute("src", url); + } + } + + // Request Quota (only for File System API) + var requestedBytes = 1024 * 1024 * 200; // 200MB + var imageCacheDirectoryEntry; + var imageCacheFolder = 'images'; + + function createDir(rootDirEntry, folders, callback, errorCallback) { + // Throw out './' or '/' and move on to prevent something like '/foo/.//bar'. + if (folders[0] == '.' || folders[0] == '') { + folders = folders.slice(1); + } + rootDirEntry.getDirectory(folders[0], { create: true }, function (dirEntry) { + // Recursively add the new subfolder (if we still have another to create). + if (folders.length > 1) { + createDir(dirEntry, folders.slice(1), callback, errorCallback); + } else { + callback(dirEntry); + } + }, errorCallback); + } + + navigator.webkitPersistentStorage.requestQuota( + requestedBytes, function (grantedBytes) { + + var requestMethod = window.webkitRequestFileSystem || window.requestFileSystem; + + requestMethod(PERSISTENT, grantedBytes, function (fs) { + + fileSystem = fs; + + createDir(fileSystem.root, imageCacheFolder.split('/'), function (dirEntry) { + + imageCacheDirectoryEntry = dirEntry; + + }); + + }); + + }); + + var fileSystem; + + function imageFileStore() { + + var self = this; + + function getCacheKey(url) { + + // Try to strip off the domain to share the cache between local and remote connections + var index = url.indexOf('://'); + + if (index != -1) { + url = url.substring(index + 3); + + index = url.indexOf('/'); + + if (index != -1) { + url = url.substring(index + 1); + } + + } + + return CryptoJS.MD5(url).toString(); + } + + function downloadToFile(url, dir, filename, callback, errorCallback) { + + Logger.log('Downloading ' + url); + + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = "arraybuffer"; + + xhr.onload = function (e) { + if (this.status == 200) { + writeData(dir, filename, this.getResponseHeader('Content-Type'), this.response, callback, errorCallback); + } else { + errorCallback(); + } + } + + xhr.send(); + } + + function writeData(dir, filename, fileType, data, callback, errorCallback) { + + dir.getFile(filename, { create: true }, function (fileEntry) { + + // Create a FileWriter object for our FileEntry (log.txt). + fileEntry.createWriter(function (fileWriter) { + + fileWriter.onwriteend = function (e) { + callback(fileEntry); + }; + + fileWriter.onerror = errorCallback; + + // Create a new Blob and write it to log.txt. + var blob = new Blob([data], { type: fileType }); + + fileWriter.write(blob); + + }, errorCallback); + + }, errorCallback); + } + + self.getImageUrl = function (originalUrl) { + + return new Promise(function (resolve, reject) { + + if (originalUrl.indexOf('tag=') != -1) { + originalUrl += "&accept=webp"; + } + + var deferred = DeferredBuilder.Deferred(); + var key = getCacheKey(originalUrl); + + var fileEntryCallback = function (fileEntry) { + resolve(fileEntry.toURL()); + }; + + var errorCallback = function (e) { + Logger.log('Imagestore error: ' + e.name); + reject(); + }; + + if (!fileSystem || !imageCacheDirectoryEntry) { + errorCallback(''); + return; + } + + var path = '/' + imageCacheFolder + "/" + key; + + fileSystem.root.getFile(path, { create: false }, fileEntryCallback, function () { + + downloadToFile(originalUrl, imageCacheDirectoryEntry, key, fileEntryCallback, errorCallback); + }); + }); + }; + + self.setImageInto = function (elem, url) { + + self.getImageUrl(url).then(function (localUrl) { + + setImageIntoElement(elem, localUrl); + + }, function () { + setImageIntoElement(elem, url); + }); + }; + + window.ImageStore = self; + } + + new imageFileStore(); + +})(); \ No newline at end of file diff --git a/dashboard-ui/cordova/android/iap.js b/dashboard-ui/cordova/android/iap.js index d609380721..9bbb2b2179 100644 --- a/dashboard-ui/cordova/android/iap.js +++ b/dashboard-ui/cordova/android/iap.js @@ -56,9 +56,27 @@ function onPurchaseComplete(result) { - if (result) { + if (result === true) { + refreshPurchases(); } + else if (result) { + + ApiClient.ajax({ + type: "POST", + url: ApiClient.getUrl("Appstore/Register"), + data: { + Parameters: JSON.stringify(result) + } + }).done(function () { + + refreshPurchases(); + + }).fail(function (e) { + + refreshPurchases(); + }); + } } function refreshPurchases() { diff --git a/dashboard-ui/manifest.json b/dashboard-ui/manifest.json new file mode 100644 index 0000000000..bf7328395c --- /dev/null +++ b/dashboard-ui/manifest.json @@ -0,0 +1,28 @@ +{ + "name": "Emby Mobile", + "short_name": "Emby", + "start_url": "index.html", + "related_applications": [ + { + "platform": "android", + "location": "https://play.google.com/store/apps/details?id=com.mb.android", + }, + { + "platform": "ios", + "location": "https://itunes.apple.com/us/app/emby/id992180193?ls=1&mt=8", + }, + { + "platform": "web" + } + ], + "icons": [ { + "src": "images/icon-144x144.png", + "sizes": "144x144", + "type": "image/png", + "density": "3.0" + }], + "display": "standalone", + "display": "standalone", + "theme_color": "#52B54B", + "start_image": "images/start-image.png" +} \ No newline at end of file diff --git a/dashboard-ui/scripts/backdrops.js b/dashboard-ui/scripts/backdrops.js index f52733bd33..cdec4d457c 100644 --- a/dashboard-ui/scripts/backdrops.js +++ b/dashboard-ui/scripts/backdrops.js @@ -99,7 +99,7 @@ return; } - getBackdropItemIds(apiClient, Dashboard.getCurrentUserId(), type, parentId).done(function (images) { + getBackdropItemIds(apiClient, Dashboard.getCurrentUserId(), type, parentId).then(function (images) { if (images.length) { diff --git a/dashboard-ui/scripts/extensions.js b/dashboard-ui/scripts/extensions.js index 33228956f6..d6bef2ca02 100644 --- a/dashboard-ui/scripts/extensions.js +++ b/dashboard-ui/scripts/extensions.js @@ -94,30 +94,7 @@ var WebNotifications = { show: function (data) { - // Seeing crashes in android - if (window.cordova && window.cordova.plugins && window.cordova.plugins.notification) { - - if (!WebNotifications.lastId) { - // Cordova plugin will crash on android with long. need an int - WebNotifications.lastId = new Date().getDate() + new Date().getMilliseconds(); - } - - WebNotifications.lastId++; - - window.cordova.plugins.notification.local.schedule({ - - id: WebNotifications.lastId, - - title: data.title, - text: data.body, - //firstAt: monday_9_am, - //every: "week", - //sound: "file://sounds/reminder.mp3", - //data: { meetingId: "123#fg8" }, - icon: data.icon - }); - } - else if (window.Notification) { + if (window.Notification) { var level = Notification.permissionLevel ? Notification.permissionLevel() : Notification.permission; diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 08115748a7..715bfaa592 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -2261,7 +2261,13 @@ var AppInfo = {}; deps.push('cryptojs-sha1'); } + if (!window.Promise) { + deps.push('bower_components/native-promise-only/lib/npo.src'); + } + require(deps, function () { + + loadImageCache(); $.extend(AppInfo, Dashboard.getAppInfo(appName, appVersion, deviceId, deviceName)); initAfterDependencies(deferred, capabilities); @@ -2395,9 +2401,17 @@ var AppInfo = {}; //require(['localsync']); } - function initCordovaWithDeviceId(deferred, deviceId) { + function loadImageCache() { - require(['cordova/imagestore']); + if (navigator.webkitPersistentStorage) { + require(['components/imagestore']); + } + else if (Dashboard.isRunningInCordova()) { + require(['cordova/imagestore']); + } + } + + function initCordovaWithDeviceId(deferred, deviceId) { cordova.getAppVersion.getVersionNumber(function (appVersion) { var capablities = Dashboard.capabilities(); @@ -2434,6 +2448,7 @@ var AppInfo = {}; setDocumentClasses(); $(document).on('WebComponentsReady', function () { + if (Dashboard.isRunningInCordova()) { initCordova(initDeferred); } else {