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
Nicolas Wavrant
jio
Commits
8f7bb38d
Commit
8f7bb38d
authored
Aug 12, 2014
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add _start&__end support for davstorage
parent
86dd0f68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
8 deletions
+49
-8
src/jio.storage/davstorage.js
src/jio.storage/davstorage.js
+49
-8
No files found.
src/jio.storage/davstorage.js
View file @
8f7bb38d
...
@@ -184,8 +184,15 @@
...
@@ -184,8 +184,15 @@
* An ajax object to do the good request according to the auth type
* An ajax object to do the good request according to the auth type
*/
*/
var
ajax
=
{
var
ajax
=
{
"
none
"
:
function
(
method
,
type
,
url
,
data
)
{
"
none
"
:
function
(
method
,
type
,
url
,
data
,
start
,
end
)
{
var
headers
=
{};
var
headers
=
{};
if
(
start
!==
undefined
)
{
if
(
end
!==
undefined
)
{
headers
=
{
"
Range
"
:
"
bytes=
"
+
start
+
"
-
"
+
end
};
}
else
{
headers
=
{
"
Range
"
:
"
bytes=
"
+
start
+
"
-
"
};
}
}
if
(
method
===
"
PROPFIND
"
)
{
if
(
method
===
"
PROPFIND
"
)
{
headers
.
Depth
=
"
1
"
;
headers
.
Depth
=
"
1
"
;
}
}
...
@@ -197,8 +204,15 @@
...
@@ -197,8 +204,15 @@
"
headers
"
:
headers
"
headers
"
:
headers
});
});
},
},
"
basic
"
:
function
(
method
,
type
,
url
,
data
,
login
)
{
"
basic
"
:
function
(
method
,
type
,
url
,
data
,
start
,
end
,
login
)
{
var
headers
=
{
"
Authorization
"
:
"
Basic
"
+
login
};
var
headers
=
{
"
Authorization
"
:
"
Basic
"
+
login
};
if
(
start
!==
undefined
)
{
if
(
end
!==
undefined
)
{
headers
.
Range
=
"
bytes=
"
+
start
+
"
-
"
+
end
;
}
else
{
headers
.
Range
=
"
bytes=
"
+
start
+
"
-
"
;
}
}
if
(
method
===
"
PROPFIND
"
)
{
if
(
method
===
"
PROPFIND
"
)
{
headers
.
Depth
=
"
1
"
;
headers
.
Depth
=
"
1
"
;
}
}
...
@@ -253,6 +267,8 @@
...
@@ -253,6 +267,8 @@
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
,
param
.
_attachment
)
+
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
,
param
.
_attachment
)
+
"
?_=
"
+
Date
.
now
(),
"
?_=
"
+
Date
.
now
(),
param
.
_blob
,
param
.
_blob
,
undefined
,
undefined
,
this
.
_login
this
.
_login
);
);
};
};
...
@@ -263,6 +279,8 @@
...
@@ -263,6 +279,8 @@
"
text
"
,
"
text
"
,
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
),
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
),
null
,
null
,
undefined
,
undefined
,
this
.
_login
this
.
_login
).
then
(
function
(
e
)
{
).
then
(
function
(
e
)
{
try
{
try
{
...
@@ -286,6 +304,8 @@
...
@@ -286,6 +304,8 @@
"
blob
"
,
"
blob
"
,
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
,
param
.
_attachment
),
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
,
param
.
_attachment
),
null
,
null
,
param
.
_start
,
param
.
_end
-
1
,
this
.
_login
this
.
_login
);
);
};
};
...
@@ -296,6 +316,8 @@
...
@@ -296,6 +316,8 @@
null
,
null
,
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
)
+
"
?_=
"
+
Date
.
now
(),
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
)
+
"
?_=
"
+
Date
.
now
(),
null
,
null
,
undefined
,
undefined
,
this
.
_login
this
.
_login
);
);
};
};
...
@@ -307,6 +329,8 @@
...
@@ -307,6 +329,8 @@
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
,
param
.
_attachment
)
+
this
.
_url
+
'
/
'
+
idsToFileName
(
param
.
_id
,
param
.
_attachment
)
+
"
?_=
"
+
Date
.
now
(),
"
?_=
"
+
Date
.
now
(),
null
,
null
,
undefined
,
undefined
,
this
.
_login
this
.
_login
);
);
};
};
...
@@ -317,6 +341,8 @@
...
@@ -317,6 +341,8 @@
"
text
"
,
"
text
"
,
this
.
_url
+
'
/
'
,
this
.
_url
+
'
/
'
,
null
,
null
,
undefined
,
undefined
,
this
.
_login
this
.
_login
).
then
(
function
(
e
)
{
).
then
(
function
(
e
)
{
var
i
,
rows
=
[],
row
,
responses
=
new
DOMParser
().
parseFromString
(
var
i
,
rows
=
[],
row
,
responses
=
new
DOMParser
().
parseFromString
(
...
@@ -346,9 +372,11 @@
...
@@ -346,9 +372,11 @@
row
.
id
=
row
.
id
[
0
];
row
.
id
=
row
.
id
[
0
];
}
}
if
(
row
!==
undefined
)
{
if
(
row
!==
undefined
)
{
if
(
row
.
id
!==
""
)
{
rows
[
rows
.
length
]
=
row
;
rows
[
rows
.
length
]
=
row
;
}
}
}
}
}
return
{
"
target
"
:
{
"
response
"
:
{
return
{
"
target
"
:
{
"
response
"
:
{
"
total_rows
"
:
rows
.
length
,
"
total_rows
"
:
rows
.
length
,
"
rows
"
:
rows
"
rows
"
:
rows
...
@@ -631,7 +659,18 @@
...
@@ -631,7 +659,18 @@
);
);
}
}
};
};
if
(
param
.
_start
<
0
||
param
.
_end
<
0
)
{
command
.
reject
(
405
,
"
invalide _start,_end
"
,
"
_start and _end must be positive
"
);
return
;
}
if
(
param
.
_start
>
param
.
_end
)
{
command
.
reject
(
405
,
"
invalide _start,_end
"
,
"
start is great then end
"
);
return
;
}
this
.
_get
(
param
).
this
.
_get
(
param
).
then
(
o
.
getAttachment
).
then
(
o
.
getAttachment
).
then
(
o
.
success
,
o
.
reject
,
o
.
notifyProgress
);
then
(
o
.
success
,
o
.
reject
,
o
.
notifyProgress
);
...
@@ -833,10 +872,12 @@
...
@@ -833,10 +872,12 @@
}
}
e
.
target
.
response
.
rows
.
forEach
(
function
(
row
)
{
e
.
target
.
response
.
rows
.
forEach
(
function
(
row
)
{
if
(
row
.
id
!==
""
)
{
requests
[
requests
.
length
]
=
that
.
_get
({
"
_id
"
:
row
.
id
}).
requests
[
requests
.
length
]
=
that
.
_get
({
"
_id
"
:
row
.
id
}).
then
(
function
(
e
)
{
then
(
function
(
e
)
{
row
.
doc
=
e
.
target
.
response
;
row
.
doc
=
e
.
target
.
response
;
});
});
}
});
});
o
.
count
=
0
;
o
.
count
=
0
;
...
...
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