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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user