update to latest js api client

This commit is contained in:
Luke Pulverenti 2013-03-25 15:20:43 -04:00
parent f6445be37d
commit 9b916a84f0
2 changed files with 98 additions and 8 deletions

View File

@ -1,4 +1,54 @@
if (!window.MediaBrowser) {
(function (jQuery, window, undefined) {
"use strict";
var matched, browser;
jQuery.uaMatch = function (ua) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
[];
var platform_match = /(ipad)/.exec(ua) ||
/(iphone)/.exec(ua) ||
/(android)/.exec(ua) ||
[];
return {
browser: match[1] || "",
version: match[2] || "0",
platform: platform_match[0] || ""
};
};
matched = jQuery.uaMatch(window.navigator.userAgent);
browser = {};
if (matched.browser) {
browser[matched.browser] = true;
browser.version = matched.version;
}
if (matched.platform) {
browser[matched.platform] = true
}
// Chrome is Webkit, but Webkit is also Safari.
if (browser.chrome) {
browser.webkit = true;
} else if (browser.webkit) {
browser.safari = true;
}
jQuery.browser = browser;
})(jQuery, window);
if (!window.MediaBrowser) {
window.MediaBrowser = {};
}
@ -47,6 +97,47 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
}
};
deviceName = (function () {
var name = "";
if ($.browser.chrome) {
name = "Chrome";
}
else if ($.browser.safari) {
name = "Safari";
}
else if ($.browser.webkit) {
name = "WebKit";
}
else if ($.browser.msie) {
name = "Internet Explorer";
}
else if ($.browser.firefox) {
name = "Firefox";
}
else if ($.browser.mozilla) {
name = "Firefox";
}
else if ($.browser.opera) {
name = "Opera";
}
else {
name = "Web Browser";
}
if ($.browser.ipad) {
name += " Ipad";
}
else if ($.browser.iphone) {
name += " Iphone";
}
else if ($.browser.android) {
name += " Android";
}
return name;
}());
/**
* Wraps around jQuery ajax methods to add additional info to the request.
*/
@ -1683,7 +1774,7 @@ MediaBrowser.SHA1 = function (msg) {
function rotate_left(n, s) {
var t4 = (n << s) | (n >>> (32 - s));
return t4;
};
}
function lsb_hex(val) {
var str = "";
@ -1697,7 +1788,7 @@ MediaBrowser.SHA1 = function (msg) {
str += vh.toString(16) + vl.toString(16);
}
return str;
};
}
function cvt_hex(val) {
var str = "";
@ -1709,8 +1800,7 @@ MediaBrowser.SHA1 = function (msg) {
str += v.toString(16);
}
return str;
};
}
function Utf8Encode(string) {
string = string.replace(/\r\n/g, "\n");
@ -1736,7 +1826,7 @@ MediaBrowser.SHA1 = function (msg) {
}
return utftext;
};
}
var blockstart;
var i, j;
@ -1843,4 +1933,4 @@ MediaBrowser.SHA1 = function (msg) {
var temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4);
return temp.toLowerCase();
}
};

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.60" targetFramework="net45" />
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.65" targetFramework="net45" />
<package id="ServiceStack.Common" version="3.9.42" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.42" targetFramework="net45" />
</packages>