Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
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
Vincent Bechu
jio
Commits
13aa9c7b
Commit
13aa9c7b
authored
Aug 20, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lint: do not redefine the same variable
parent
82ac0448
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
13 deletions
+14
-13
src/jio.storage/cryptstorage.js
src/jio.storage/cryptstorage.js
+3
-2
src/jio.storage/davstorage.js
src/jio.storage/davstorage.js
+4
-4
src/jio.storage/dropboxstorage.js
src/jio.storage/dropboxstorage.js
+3
-3
test/jio.storage/memorystorage.tests.js
test/jio.storage/memorystorage.tests.js
+4
-4
No files found.
src/jio.storage/cryptstorage.js
View file @
13aa9c7b
...
...
@@ -140,8 +140,9 @@
that
.
_key
,
buf
);
})
.
push
(
function
(
coded
)
{
var
blob
=
new
Blob
([
initializaton_vector
,
coded
],
{
type
:
MIME_TYPE
});
return
that
.
_sub_storage
.
putAttachment
(
id
,
name
,
blob
);
var
final_blob
=
new
Blob
([
initializaton_vector
,
coded
],
{
type
:
MIME_TYPE
});
return
that
.
_sub_storage
.
putAttachment
(
id
,
name
,
final_blob
);
});
};
...
...
src/jio.storage/davstorage.js
View file @
13aa9c7b
...
...
@@ -185,7 +185,7 @@
var
i
,
attachment
=
{},
id
,
new_
id
,
attachment_list
=
new
DOMParser
().
parseFromString
(
response
.
target
.
responseText
,
"
text/xml
"
...
...
@@ -196,11 +196,11 @@
// exclude parent folder and browse
for
(
i
=
1
;
i
<
attachment_list
.
length
;
i
+=
1
)
{
// XXX Only get files for now
id
=
attachment_list
[
i
].
querySelector
(
"
D
\\
:href, href
"
).
new_
id
=
attachment_list
[
i
].
querySelector
(
"
D
\\
:href, href
"
).
textContent
.
split
(
'
/
'
).
slice
(
-
1
)[
0
];
// XXX Ugly
if
((
id
!==
undefined
)
&&
(
id
!==
""
))
{
attachment
[
id
]
=
{};
if
((
new_id
!==
undefined
)
&&
(
new_
id
!==
""
))
{
attachment
[
new_
id
]
=
{};
}
}
return
attachment
;
...
...
src/jio.storage/dropboxstorage.js
View file @
13aa9c7b
...
...
@@ -292,9 +292,9 @@
return
jIO
.
util
.
readBlobAsText
(
error
.
target
.
response
);
})
.
push
(
function
(
evt
)
{
var
err_content
=
JSON
.
parse
(
evt
.
target
.
result
);
if
((
err_content
.
error
[
'
.tag
'
]
===
'
path
'
)
&&
(
err_content
.
error
.
path
[
'
.tag
'
]
===
'
not_found
'
))
{
var
err_content
2
=
JSON
.
parse
(
evt
.
target
.
result
);
if
((
err_content
2
.
error
[
'
.tag
'
]
===
'
path
'
)
&&
(
err_content
2
.
error
.
path
[
'
.tag
'
]
===
'
not_found
'
))
{
throw
new
jIO
.
util
.
jIOError
(
"
Cannot find attachment:
"
+
id
+
"
/,
"
+
name
,
404
);
}
...
...
test/jio.storage/memorystorage.tests.js
View file @
13aa9c7b
...
...
@@ -70,12 +70,12 @@
expect
(
2
);
stop
();
var
t
es
t
=
this
;
var
t
ha
t
=
this
;
this
.
jio
.
put
(
"
put1
"
,
{
"
title
"
:
"
myPut1
"
})
.
then
(
function
(
uuid
)
{
equal
(
uuid
,
"
put1
"
);
deepEqual
(
t
es
t
.
jio
.
__storage
.
_database
.
put1
,
{
deepEqual
(
t
ha
t
.
jio
.
__storage
.
_database
.
put1
,
{
attachments
:
{},
doc
:
"
{
\"
title
\"
:
\"
myPut1
\"
}
"
});
...
...
@@ -90,7 +90,7 @@
test
(
"
put when document already exists
"
,
function
()
{
var
id
=
"
put1
"
,
t
es
t
=
this
;
t
ha
t
=
this
;
this
.
jio
.
__storage
.
_database
[
id
]
=
{
"
foo
"
:
"
bar
"
,
"
attachments
"
:
{
"
foo
"
:
"
bar
"
},
...
...
@@ -102,7 +102,7 @@
this
.
jio
.
put
(
id
,
{
"
title
"
:
"
myPut2
"
})
.
then
(
function
(
uuid
)
{
equal
(
uuid
,
"
put1
"
);
deepEqual
(
t
es
t
.
jio
.
__storage
.
_database
.
put1
,
{
deepEqual
(
t
ha
t
.
jio
.
__storage
.
_database
.
put1
,
{
"
foo
"
:
"
bar
"
,
"
attachments
"
:
{
"
foo
"
:
"
bar
"
},
doc
:
"
{
\"
title
\"
:
\"
myPut2
\"
}
"
...
...
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