| AxLoader | |
| Functions | |
| startLoading | Begin loading a folder. |
| fromBuffers | Gets the archive from the cached buffer and the patch/base buffer. |
| getVersion | Takes an archive and returns the version number. |
| isUpdateNeeded | Reads the cached version and determines if it is up to date. |
| setCached | Sets the cached data for a folder. |
| getCached | Gets the cached data for a folder. |
| clearCached | Removes items from the cache. |
| postProcess | Runs all the functions in the tasks array against all the properties on files. |
| fileLoadCallback | The callback for when a file is extracted out of the archive. |
| getAvalibleFileList | Gets a list of the avalible files for download. |
| getMostAppropriateFile | Gets the file that should be downloaded. |
| Variables | |
| POST_TASKS | A collection of postprocessing functions for passing to startLoading’s postTasks parameter. |
| Functions | |
| EVAL_AS_JS | Evaluates a script files in a special way that plays nicely with the debugger. |
| STRINGIFY | Decode files into strings if they match the passed extionstion. |
| PARSE_AS_JSON | Decode files into strings if they match the passed extionstion. |
| USE_AS_CSS | Decode files into strings if they match the passed extionstion. |
| BASE64IFY | Decode files into base64strings if they match the passed extionstion. |
| BASE64IFY_FILES_WITH_EXT | Decode files into base64strings if they match the passed extionstion. |
| REMOVE_FILE_EXTS | Removes file extentions. |
| EXPAND_FOLDERS | Expands the folder structure of the files in the archive. |
| Variables | |
| FILTER | Contains post processing tasks that filter out files for other post tasks. |
| Functions | |
| WITH_EXT | A filter that calls the passed function if the name matches the passed file extention. |
| WITH_FILE | A filter than calls the passed function if the names match. |
| WITH_FILE | A filter than calls the passed function if the names match. |
| WITHOUT | A filter than calls the passed function if the names don’t match. |
| decodeString | Returns a string from a UTF8 encoded arraybuffer. |
| decodeBase64 | https://developer.mozilla.org |
| encodeBase64 | https://developer.mozilla.org |
| checkForUpdates | Passes true to the callback if there are updates. |
function fromBuffers( cached, uptodate, folder, events, postTasks )
Gets the archive from the cached buffer and the patch/base buffer. Calls the onComplete event when done.
| cached | The cached version of the file. |
| uptodate | The up to date base version or patch to an up to date version from the cached version. |
| folder | The name of the origin folder. |
| events | The events object passed to startLoading. |
| postTasks | A list of functions to call on each of the files. |
function getMostAppropriateFile( folder, cachedVersion, callback )
Gets the file that should be downloaded. Always picks the file with the highest version number, non-numeric values have a version value of -1. If a patch exists from the cached version to the highest version, that will be picked over the base version.
| folder | (String) The data being requested |
| callback | (Function) On done. Takes one parameter, the picked file name. |
function decodeString ( buffer )
Returns a string from a UTF8 encoded arraybuffer. Comes from: https://gist.github.com/boushley/5471599
| buffer | (ArrayBuffer) The buffer with the encoded string data. |
(String) The string representation of buffer.
function decodeBase64( sBase64, nBlocksSize )
https://developer.mozilla.org
function encodeBase64 ( aBytes )
https://developer.mozilla.org
Begin loading a folder.
function startLoading( folder, events, postTasks )
Gets the archive from the cached buffer and the patch/base buffer.
function fromBuffers( cached, uptodate, folder, events, postTasks )
Takes an archive and returns the version number.
function getVersion( ar )
Reads the cached version and determines if it is up to date.
function isUpdateNeeded( filename, cachedArchive )
Sets the cached data for a folder.
function setCached( folder, buffer )
Gets the cached data for a folder.
function getCached( folder )
Removes items from the cache.
var clearCached = function ( rest )
Runs all the functions in the tasks array against all the properties on files.
function postProcess( files, tasks )
Gets a list of the avalible files for download.
function getAvalibleFileList( callback )
Gets the file that should be downloaded.
function getMostAppropriateFile( folder, cachedVersion, callback )
Evaluates a script files in a special way that plays nicely with the debugger.
EVAL_AS_JS: function ( name, data, output )
Decode files into strings if they match the passed extionstion.
STRINGIFY: function ( name, data, output )
Decode files into strings if they match the passed extionstion.
PARSE_AS_JSON: function ( name, data, output )
Decode files into strings if they match the passed extionstion.
USE_AS_CSS: function ( name, data, output )
Decode files into base64strings if they match the passed extionstion.
BASE64IFY: function ( name, data, output )
Removes file extentions.
REMOVE_FILE_EXTS: function ( name, data, output )
Expands the folder structure of the files in the archive.
EXPAND_FOLDERS: function ( name, data, output )
Contains post processing tasks that filter out files for other post tasks.
var FILTER
A filter that calls the passed function if the name matches the passed file extention.
WITH_EXT: function ( ext, f )
A filter than calls the passed function if the names match.
WITH_FILE: function ( n, f )
A filter than calls the passed function if the names don’t match.
WITHOUT: function ( re, f )
Returns a string from a UTF8 encoded arraybuffer.
function decodeString ( buffer )
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding
function decodeBase64( sBase64, nBlocksSize )
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Base64_encoding_and_decoding
function encodeBase64 ( aBytes )
Passes true to the callback if there are updates.
var checkForUpdates = function ( callback )