Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio-main
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
jio-main
Commits
00ad6db5
Commit
00ad6db5
authored
Aug 07, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s3storage.js amd compatible now
parent
3865c36d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
914 additions
and
901 deletions
+914
-901
src/jio.storage/s3storage.js
src/jio.storage/s3storage.js
+914
-901
No files found.
src/jio.storage/s3storage.js
View file @
00ad6db5
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*jslint indent: 2, maxlen: 80, sloppy: true, nomen: true */
/*global
jIO: true, btoa: true, b64_hmac_sha1: true */
/*global
define, jIO, btoa, b64_hmac_sha1, jQuery, XMLHttpRequest, XHRwrapper,
/*global XMLHttpRequest: true, XHRwrapper: true, FormData: true, $: true
*/
FormData
*/
/**
/**
* JIO S3 Storage. Type = "s3".
* JIO S3 Storage. Type = "s3".
* Amazon S3 "database" storage.
* Amazon S3 "database" storage.
*/
*/
jIO
.
addStorageType
(
"
s3
"
,
function
(
spec
,
my
)
{
// define([module_name], [dependencies], module);
(
function
(
dependencies
,
module
)
{
"
use strict
"
;
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
return
define
(
dependencies
,
module
);
}
module
(
jIO
,
jQuery
,
{
b64_hmac_sha1
:
b64_hmac_sha1
});
}([
'
jio
'
,
'
jquery
'
,
'
sha1
'
],
function
(
jIO
,
$
,
sha1
)
{
var
b64_hmac_sha1
=
sha1
.
b64_hmac_sha1
;
jIO
.
addStorageType
(
"
s3
"
,
function
(
spec
,
my
)
{
var
evt
,
that
,
priv
=
{};
var
evt
,
that
,
priv
=
{};
spec
=
spec
||
{};
spec
=
spec
||
{};
that
=
my
.
basicStorage
(
spec
,
my
);
that
=
my
.
basicStorage
(
spec
,
my
);
...
@@ -288,7 +298,8 @@ jIO.addStorageType("s3", function (spec, my) {
...
@@ -288,7 +298,8 @@ jIO.addStorageType("s3", function (spec, my) {
obj
.
onreadystatechange
=
function
()
{
obj
.
onreadystatechange
=
function
()
{
var
response
,
err
=
''
;
var
response
,
err
=
''
;
if
(
obj
.
readyState
===
4
)
{
if
(
obj
.
readyState
===
4
)
{
if
(
this
.
status
===
204
||
this
.
status
===
201
||
this
.
status
===
200
)
{
if
(
this
.
status
===
204
||
this
.
status
===
201
||
this
.
status
===
200
)
{
switch
(
http
)
{
switch
(
http
)
{
case
"
POST
"
:
case
"
POST
"
:
that
.
success
({
that
.
success
({
...
@@ -809,8 +820,8 @@ jIO.addStorageType("s3", function (spec, my) {
...
@@ -809,8 +820,8 @@ jIO.addStorageType("s3", function (spec, my) {
attachment_length
=
command
.
getAttachmentLength
();
attachment_length
=
command
.
getAttachmentLength
();
function
removeAttachment
()
{
function
removeAttachment
()
{
that
.
XHRwrapper
(
command
,
docId
,
attachId
,
'
DELETE
'
,
mime
,
''
,
true
,
true
,
that
.
XHRwrapper
(
command
,
docId
,
attachId
,
'
DELETE
'
,
mime
,
''
,
true
,
function
(
reponse
)
{
true
,
function
(
reponse
)
{
}
}
);
);
}
}
...
@@ -988,4 +999,6 @@ jIO.addStorageType("s3", function (spec, my) {
...
@@ -988,4 +999,6 @@ jIO.addStorageType("s3", function (spec, my) {
//fin alldocs
//fin alldocs
};
};
return
that
;
return
that
;
});
});
}));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment