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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
jio
Commits
441320d8
Commit
441320d8
authored
Aug 06, 2013
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
davstorage.js amd compatible now
parent
f2df0cdd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
828 additions
and
812 deletions
+828
-812
src/jio.storage/davstorage.js
src/jio.storage/davstorage.js
+828
-812
No files found.
src/jio.storage/davstorage.js
View file @
441320d8
/*
/*
* Copyright 2013, Nexedi SA
* Copyright 2013, Nexedi SA
* Released under the LGPL license.
* Released under the LGPL license.
* http://www.gnu.org/licenses/lgpl.html
* http://www.gnu.org/licenses/lgpl.html
*/
*/
/*jslint indent: 2, maxlen: 80, nomen: true */
/*jslint indent: 2, maxlen: 80, nomen: true */
/*global
jIO: true, $: true, btoa: true
*/
/*global
define, jIO, jQuery, btoa
*/
// JIO Dav Storage Description :
// JIO Dav Storage Description :
// {
// {
...
@@ -57,8 +57,16 @@
...
@@ -57,8 +57,16 @@
// ('%', '%25')
// ('%', '%25')
// The file will be saved as http:%2F%2F100%25_.json
// The file will be saved as http:%2F%2F100%25_.json
jIO
.
addStorageType
(
"
dav
"
,
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
);
}([
'
jio
'
,
'
jquery
'
],
function
(
jIO
,
$
)
{
"
use strict
"
;
"
use strict
"
;
jIO
.
addStorageType
(
"
dav
"
,
function
(
spec
,
my
)
{
var
priv
=
{},
that
=
my
.
basicStorage
(
spec
,
my
),
dav
=
{};
var
priv
=
{},
that
=
my
.
basicStorage
(
spec
,
my
),
dav
=
{};
// ATTRIBUTES //
// ATTRIBUTES //
...
@@ -95,7 +103,8 @@ jIO.addStorageType("dav", function (spec, my) {
...
@@ -95,7 +103,8 @@ jIO.addStorageType("dav", function (spec, my) {
// OVERRIDES //
// OVERRIDES //
that
.
specToStore
=
function
()
{
that
.
specToStore
=
function
()
{
// TODO: secured password
// TODO: secured password
// The encoded_login can be seen by anyone, we must find a way to secure it!
// The encoded_login can be seen by anyone,
// we must find a way to secure it!
// secured_login = encrypt(encoded_login)
// secured_login = encrypt(encoded_login)
// encoded_login = decrypt(secured_login)
// encoded_login = decrypt(secured_login)
return
{
return
{
...
@@ -274,7 +283,8 @@ jIO.addStorageType("dav", function (spec, my) {
...
@@ -274,7 +283,8 @@ jIO.addStorageType("dav", function (spec, my) {
ajax_object
.
url
=
priv
.
url
+
"
/
"
+
priv
.
secureName
(
file_name
)
+
ajax_object
.
url
=
priv
.
url
+
"
/
"
+
priv
.
secureName
(
file_name
)
+
"
?_=
"
+
Date
.
now
();
"
?_=
"
+
Date
.
now
();
ajax_object
.
async
=
ajax_object
.
async
===
false
?
false
:
true
;
ajax_object
.
async
=
ajax_object
.
async
===
false
?
false
:
true
;
ajax_object
.
crossdomain
=
ajax_object
.
crossdomain
===
false
?
false
:
true
;
ajax_object
.
crossdomain
=
ajax_object
.
crossdomain
===
false
?
false
:
true
;
ajax_object
.
headers
=
ajax_object
.
headers
||
{};
ajax_object
.
headers
=
ajax_object
.
headers
||
{};
ajax_object
.
headers
.
Authorization
=
ajax_object
.
headers
.
Authorization
||
ajax_object
.
headers
.
Authorization
=
ajax_object
.
headers
.
Authorization
||
priv
.
encoded_login
;
priv
.
encoded_login
;
...
@@ -872,7 +882,11 @@ jIO.addStorageType("dav", function (spec, my) {
...
@@ -872,7 +882,11 @@ jIO.addStorageType("dav", function (spec, my) {
doc_id
,
doc_id
,
attachment_id
attachment_id
).
always
(
function
(
err
,
response
)
{
).
always
(
function
(
err
,
response
)
{
that
.
success
({
"
ok
"
:
true
,
"
id
"
:
doc_id
,
"
attachment
"
:
attachment_id
});
that
.
success
({
"
ok
"
:
true
,
"
id
"
:
doc_id
,
"
attachment
"
:
attachment_id
});
});
});
});
});
});
});
...
@@ -924,4 +938,6 @@ jIO.addStorageType("dav", function (spec, my) {
...
@@ -924,4 +938,6 @@ jIO.addStorageType("dav", function (spec, my) {
priv
.
__init__
(
spec
);
priv
.
__init__
(
spec
);
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