update components
This commit is contained in:
parent
8843f08890
commit
56c121afff
5 changed files with 132 additions and 28 deletions
|
@ -16,12 +16,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.0.19",
|
||||
"_release": "1.0.19",
|
||||
"version": "1.0.20",
|
||||
"_release": "1.0.20",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.0.19",
|
||||
"commit": "09f50cd4f4b126b0ea9a0a26c1b425b4a1e25f5b"
|
||||
"tag": "1.0.20",
|
||||
"commit": "55cf67710a438d3eea15f58587b2c2fcd731bf29"
|
||||
},
|
||||
"_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
|
||||
"_target": "~1.0.3",
|
||||
|
|
|
@ -850,9 +850,7 @@
|
|||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require(['serverdiscovery'], function (serverDiscovery) {
|
||||
serverDiscovery.findServers(1000).then(function (foundServers) {
|
||||
|
||||
var onFinish = function (foundServers) {
|
||||
var servers = foundServers.map(function (foundServer) {
|
||||
|
||||
var info = {
|
||||
|
@ -868,6 +866,11 @@
|
|||
return info;
|
||||
});
|
||||
resolve(servers);
|
||||
};
|
||||
|
||||
require(['serverdiscovery'], function (serverDiscovery) {
|
||||
serverDiscovery.findServers(1000).then(onFinish, function () {
|
||||
onFinish([]);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.0.5",
|
||||
"_release": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"_release": "1.0.6",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.0.5",
|
||||
"commit": "ff6d4ba01de70b907dfa51b36aee6c63f64685c9"
|
||||
"tag": "1.0.6",
|
||||
"commit": "4d04f0ed205e94c00160c48dc131b9d8dbed995f"
|
||||
},
|
||||
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "~1.0.0",
|
||||
|
|
101
dashboard-ui/bower_components/emby-webcomponents/datetime.js
vendored
Normal file
101
dashboard-ui/bower_components/emby-webcomponents/datetime.js
vendored
Normal file
|
@ -0,0 +1,101 @@
|
|||
define([], function () {
|
||||
|
||||
function parseISO8601Date(s, toLocal) {
|
||||
|
||||
// parenthese matches:
|
||||
// year month day hours minutes seconds
|
||||
// dotmilliseconds
|
||||
// tzstring plusminus hours minutes
|
||||
var re = /(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(\.\d+)?(Z|([+-])(\d{2}):(\d{2}))?/;
|
||||
|
||||
var d = s.match(re);
|
||||
|
||||
// "2010-12-07T11:00:00.000-09:00" parses to:
|
||||
// ["2010-12-07T11:00:00.000-09:00", "2010", "12", "07", "11",
|
||||
// "00", "00", ".000", "-09:00", "-", "09", "00"]
|
||||
// "2010-12-07T11:00:00.000Z" parses to:
|
||||
// ["2010-12-07T11:00:00.000Z", "2010", "12", "07", "11",
|
||||
// "00", "00", ".000", "Z", undefined, undefined, undefined]
|
||||
|
||||
if (!d) {
|
||||
|
||||
throw "Couldn't parse ISO 8601 date string '" + s + "'";
|
||||
}
|
||||
|
||||
// parse strings, leading zeros into proper ints
|
||||
var a = [1, 2, 3, 4, 5, 6, 10, 11];
|
||||
for (var i in a) {
|
||||
d[a[i]] = parseInt(d[a[i]], 10);
|
||||
}
|
||||
d[7] = parseFloat(d[7]);
|
||||
|
||||
// Date.UTC(year, month[, date[, hrs[, min[, sec[, ms]]]]])
|
||||
// note that month is 0-11, not 1-12
|
||||
// see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/UTC
|
||||
var ms = Date.UTC(d[1], d[2] - 1, d[3], d[4], d[5], d[6]);
|
||||
|
||||
// if there are milliseconds, add them
|
||||
if (d[7] > 0) {
|
||||
ms += Math.round(d[7] * 1000);
|
||||
}
|
||||
|
||||
// if there's a timezone, calculate it
|
||||
if (d[8] != "Z" && d[10]) {
|
||||
var offset = d[10] * 60 * 60 * 1000;
|
||||
if (d[11]) {
|
||||
offset += d[11] * 60 * 1000;
|
||||
}
|
||||
if (d[9] == "-") {
|
||||
ms -= offset;
|
||||
} else {
|
||||
ms += offset;
|
||||
}
|
||||
} else if (toLocal === false) {
|
||||
ms += new Date().getTimezoneOffset() * 60000;
|
||||
}
|
||||
|
||||
return new Date(ms);
|
||||
}
|
||||
|
||||
function getDisplayRunningTime(ticks) {
|
||||
var ticksPerHour = 36000000000;
|
||||
var ticksPerMinute = 600000000;
|
||||
var ticksPerSecond = 10000000;
|
||||
|
||||
var parts = [];
|
||||
|
||||
var hours = ticks / ticksPerHour;
|
||||
hours = Math.floor(hours);
|
||||
|
||||
if (hours) {
|
||||
parts.push(hours);
|
||||
}
|
||||
|
||||
ticks -= (hours * ticksPerHour);
|
||||
|
||||
var minutes = ticks / ticksPerMinute;
|
||||
minutes = Math.floor(minutes);
|
||||
|
||||
ticks -= (minutes * ticksPerMinute);
|
||||
|
||||
if (minutes < 10 && hours) {
|
||||
minutes = '0' + minutes;
|
||||
}
|
||||
parts.push(minutes);
|
||||
|
||||
var seconds = ticks / ticksPerSecond;
|
||||
seconds = Math.floor(seconds);
|
||||
|
||||
if (seconds < 10) {
|
||||
seconds = '0' + seconds;
|
||||
}
|
||||
parts.push(seconds);
|
||||
|
||||
return parts.join(':');
|
||||
}
|
||||
|
||||
return {
|
||||
parseISO8601Date: parseISO8601Date,
|
||||
getDisplayRunningTime: getDisplayRunningTime
|
||||
};
|
||||
});
|
|
@ -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.12",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.12",
|
||||
"commit": "657f526a2382a659cdf4e13be87ecc89261588a3"
|
||||
},
|
||||
"_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"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue