...
 
Commits (4)
......@@ -150,7 +150,8 @@ ${JIOVERSION}: ${EXTERNALDIR}/URI.js \
${SRCDIR}/jio.storage/cryptstorage.js \
${SRCDIR}/jio.storage/websqlstorage.js \
${SRCDIR}/jio.storage/fbstorage.js \
${SRCDIR}/jio.storage/cloudooostorage.js
${SRCDIR}/jio.storage/cloudooostorage.js \
${SRCDIR}/jio.storage/mappingstorage.js
@mkdir -p $(@D)
cat $^ > $@
......@@ -162,13 +163,7 @@ ${JIONODELATEST}: ${JIONODEVERSION}
cp $< $@
${JIONODEVERSION}: ${SRCDIR}/node/jio-start.js \
${EXTERNALDIR}/rsvp-2.0.4.js \
${EXTERNALDIR}/moment.js \
${EXTERNALDIR}/URI.js \
${EXTERNALDIR}/uritemplate.js \
${EXTERNALDIR}/rusha.js \
${SRCDIR}/node/jio-external.js \
${EXTERNALDIR}/xhr2.js \
${SRCDIR}/queries/parser-begin.js \
${SRCDIR}/queries/build/parser.js \
${SRCDIR}/queries/parser-end.js \
......@@ -189,6 +184,7 @@ ${JIONODEVERSION}: ${SRCDIR}/node/jio-start.js \
${SRCDIR}/jio.storage/drivetojiomapping.js \
${SRCDIR}/jio.storage/documentstorage.js \
${SRCDIR}/jio.storage/fbstorage.js \
${SRCDIR}/jio.storage/mappingstorage.js \
${SRCDIR}/node/jio-end.js
@mkdir -p $(@D)
cat $^ > $@
......
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
......@@ -20,6 +20,15 @@
"output",
"cloud"
],
"dependencies": {
"form-data": "^2.3.2",
"moment": "^2.21.0",
"rsvp": "git+https://lab.nexedi.com/nexedi/rsvp.js.git",
"rusha": "0.8.2",
"urijs": "^1.19.1",
"uritemplate": "git+https://lab.nexedi.com/nexedi/uritemplate-js.git",
"xhr2": "git+https://github.com/clearroad/node-xhr2.git"
},
"engines": {
"npm": ">=1.3"
}
......
......@@ -42,6 +42,7 @@
if (options.headers === undefined) {
options.headers = {};
}
options.headers.Accept = "*/*";
options.headers['X-ACCESS-TOKEN'] = storage._access_token;
options.xhrFields.withCredentials = false;
} else {
......
......@@ -128,7 +128,7 @@
});
};
window.Blob = Blob;//window.Blob || Blob;
window.Blob = window.Blob || Blob;
function FileReader() {
EventTarget.call(this);
......@@ -220,8 +220,7 @@
}(window, WeakMap, ArrayBuffer, Uint8Array));
var XMLHttpRequest = global.XMLHttpRequest || module.exports,
Blob = window.Blob,
var Blob = window.Blob,
atob = window.atob,
btoa = window.btoa,
FileReader = window.FileReader,
......
module = node_module;
jIO.node_env = window;
module.exports = jIO;
} ({}));
\ No newline at end of file
module.exports = window;
}({}));
var RSVP = window.RSVP,
moment = global.moment,
UriTemplate = window.UriTemplate,
Rusha = window.Rusha;
var RSVP = require('rsvp'),
moment = require('moment'),
Rusha = require('rusha'),
XMLHttpRequest = require('xhr2'),
FormData = require('form-data'),
URI = require('urijs'),
UriTemplate = require('uritemplate'),
process = require('process');
// Allow xhr2 to export XMLHttpRequest
module = {};
window.moment = moment;
window.FormData = window.FormData || FormData;
window.XMLHttpRequest = window.XMLHttpRequest || XMLHttpRequest;
(function (define, exports) {
var navigator = null,
window = {},
node_module = module;
module = undefined;
(function (window) {
var navigator = {};
......@@ -19,12 +19,9 @@
*/
/*global window, ArrayBuffer */
(function (window, jIO, Blob, ArrayBuffer) {
(function (jIO, Blob, FormData, ArrayBuffer) {
"use strict";
var FormData,
originalAjax;
function convertToBlob(evt, convert) {
if (convert && evt.target.response instanceof ArrayBuffer) {
evt.target.response = new Blob([evt.target.response]);
......@@ -32,23 +29,7 @@
return evt;
}
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/
// Using_XMLHttpRequest#Submitting_forms_and_uploading_files
FormData = function FormData() {
this.boundary = "---------------------------" + Date.now().toString(16);
this.body = '';
};
FormData.prototype.append = function (name, value, filename) {
this.body += '--' + this.boundary +
'\r\nContent-Disposition: form-data; name="' + name;
if (filename !== undefined) {
this.body += '"; filename="' + filename;
}
this.body += '"\r\n\r\n' + value + '\r\n';
};
window.FormData = FormData;
originalAjax = jIO.util.ajax;
var originalAjax = jIO.util.ajax;
jIO.util.ajax = function ajax(param) {
var convertToArrayBuffer = param.dataType === 'blob';
if (convertToArrayBuffer) {
......@@ -81,9 +62,8 @@
});
};
}(window, window.jIO, window.Blob, ArrayBuffer));
}(window.jIO, window.Blob, window.FormData, ArrayBuffer));
// Define a global variable to allow storages to access jIO
var jIO = window.jIO,
FormData = window.FormData,
jiodate = window.jiodate;