fixed palette import bug

This commit is contained in:
juliandescottes
2014-09-24 21:50:16 +02:00
parent 258d13371d
commit b5465ca066
2 changed files with 25 additions and 3 deletions

View File

@@ -0,0 +1,17 @@
(function () {
var ns = $.namespace('pskl.utils');
var workers = {};
ns.WorkerUtils = {
createWorker : function (worker, workerId) {
if (!workers[workerId]) {
var typedArray = [(worker+"").replace(/function \(\)\s?\{/,"").replace(/\}[^}]*$/, "")];
var blob = new Blob(typedArray, {type: "application/javascript"}); // pass a useful mime type here
workers[workerId] = window.URL.createObjectURL(blob);
}
return new Worker(workers[workerId]);
}
};
})();