1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-30 19:00:12 +02:00

Make tomahawk.js more portable

This commit is contained in:
Uwe L. Korn
2013-07-17 18:21:37 +02:00
parent fc45207ba7
commit c0b54f0410
2 changed files with 5 additions and 5 deletions

View File

@@ -18,7 +18,7 @@
*/
// if run in phantomjs add fake Tomahawk environment
if (window.Tomahawk === undefined) {
if ((typeof Tomahawk === "undefined") || (Tomahawk === null)) {
var Tomahawk = {
fakeEnv: function () {
return true;
@@ -302,8 +302,8 @@ Tomahawk.asyncRequest = function (url, callback, extraHeaders, options) {
xmlHttpRequest.send(null);
};
Tomahawk.sha256 = CryptoJS.SHA256;
Tomahawk.sha256 = Tomahawk.sha256 || CryptoJS.SHA256;
// some aliases
Tomahawk.setTimeout = window.setTimeout;
Tomahawk.setInterval = window.setInterval;
Tomahawk.setTimeout = Tomahawk.setTimeout || window.setTimeout;
Tomahawk.setInterval = Tomahawk.setInterval || window.setInterval;