-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move jszlib dependency to util directory (#1580)
* Move jszlib code into util * Eliminate jszlib references
- Loading branch information
Showing
7 changed files
with
4,248 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,44 @@ | ||
const { findPlugins } = require("./plugin-util"); | ||
|
||
const {findPlugins} = require('./plugin-util') | ||
|
||
module.exports = function(env) { | ||
|
||
module.exports = function (env) { | ||
dojoConfig = { | ||
baseUrl: '.', | ||
baseUrl: ".", | ||
packages: [ | ||
{ | ||
name: 'dojo', | ||
location: env.dojoRoot + 'dojo', | ||
name: "dojo", | ||
location: env.dojoRoot + "dojo", | ||
}, | ||
{ | ||
name: 'dijit', | ||
location: env.dojoRoot + 'dijit', | ||
name: "dijit", | ||
location: env.dojoRoot + "dijit", | ||
}, | ||
{ | ||
name: 'dojox', | ||
location: env.dojoRoot + 'dojox', | ||
name: "dojox", | ||
location: env.dojoRoot + "dojox", | ||
}, | ||
{ | ||
name: 'JBrowse', | ||
location: 'src/JBrowse', | ||
lib: '.' | ||
name: "JBrowse", | ||
location: "src/JBrowse", | ||
lib: ".", | ||
}, | ||
{ | ||
name: 'dgrid', | ||
location: env.dojoRoot + 'dgrid', | ||
lib: '.' | ||
name: "dgrid", | ||
location: env.dojoRoot + "dgrid", | ||
lib: ".", | ||
}, | ||
{ | ||
name: 'dstore', | ||
location: env.dojoRoot + 'dojo-dstore', | ||
lib: '.' | ||
name: "dstore", | ||
location: env.dojoRoot + "dojo-dstore", | ||
lib: ".", | ||
}, | ||
{ | ||
name: 'jszlib', | ||
location: env.dojoRoot + 'jszlib', | ||
lib: '.' | ||
name: "FileSaver", | ||
location: env.dojoRoot + "filesaver.js", | ||
lib: ".", | ||
}, | ||
{ | ||
name: 'FileSaver', | ||
location: env.dojoRoot + 'filesaver.js', | ||
lib: '.' | ||
} | ||
] | ||
.concat( | ||
findPlugins('.') | ||
) | ||
, | ||
|
||
async: true | ||
} | ||
].concat(findPlugins(".")), | ||
async: true, | ||
}; | ||
|
||
return dojoConfig | ||
return dojoConfig; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
define([], function () { | ||
var testArray; | ||
try { | ||
testArray = new Uint8Array(1); | ||
} catch (x) {} | ||
var hasSlice = false; /* (typeof testArray.slice === 'function'); */ // Chrome slice performance is so dire that we're currently not using it... | ||
|
||
function arrayCopy(src, srcOffset, dest, destOffset, count) { | ||
if (count == 0) { | ||
return; | ||
} | ||
if (!src) { | ||
throw "Undef src"; | ||
} else if (!dest) { | ||
throw "Undef dest"; | ||
} | ||
|
||
if (srcOffset == 0 && count == src.length) { | ||
arrayCopy_fast(src, dest, destOffset); | ||
} else if (src.subarray) { | ||
arrayCopy_fast( | ||
src.subarray(srcOffset, srcOffset + count), | ||
dest, | ||
destOffset | ||
); | ||
} else if (src.BYTES_PER_ELEMENT == 1 && count > 100) { | ||
arrayCopy_fast( | ||
new Uint8Array(src.buffer, src.byteOffset + srcOffset, count), | ||
dest, | ||
destOffset | ||
); | ||
} else { | ||
arrayCopy_slow(src, srcOffset, dest, destOffset, count); | ||
} | ||
} | ||
|
||
function arrayCopy_slow(src, srcOffset, dest, destOffset, count) { | ||
// dlog('_slow call: srcOffset=' + srcOffset + '; destOffset=' + destOffset + '; count=' + count); | ||
|
||
for (var i = 0; i < count; ++i) { | ||
dest[destOffset + i] = src[srcOffset + i]; | ||
} | ||
} | ||
|
||
function arrayCopy_fast(src, dest, destOffset) { | ||
dest.set(src, destOffset); | ||
} | ||
|
||
return arrayCopy; | ||
}); |
Oops, something went wrong.