Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
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
nexedi
officejs
Commits
5367e7fe
Commit
5367e7fe
authored
Jun 22, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete old saving/loading methods
parent
e50d7ab5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
67 deletions
+0
-67
UNGProject/js/jio.js
UNGProject/js/jio.js
+0
-67
No files found.
UNGProject/js/jio.js
View file @
5367e7fe
// save
saveXHR
=
function
(
address
)
{
//create request
var
xhr
=
null
;
try
{
xhr
=
new
XMLHttpRequest
();
}
catch
(
e
)
{
try
{
xhr
=
new
ActiveXObject
(
"
Msxml2.XMLHTTP
"
);}
catch
(
e2
)
{
try
{
xhr
=
new
ActiveXObject
(
"
Microsoft.XMLHTTP
"
);}
catch
(
e
)
{
alert
(
"
Please install a more recent browser
"
)}
}
}
//xhr.open("PUT", keyToUrl(key, wallet), true, wallet.userAddress, wallet.davToken);
//HACK:
xhr
.
open
(
"
PUT
"
,
address
,
true
);
xhr
.
setRequestHeader
(
"
Authorization
"
,
"
Basic
"
+
"
nom:test
"
);
//END HACK.
xhr
.
onreadystatechange
=
function
()
{
if
(
xhr
.
readyState
==
4
)
{
if
(
xhr
.
status
!=
200
&&
xhr
.
status
!=
201
&&
xhr
.
status
!=
204
)
{
alert
(
"
error: got status
"
+
xhr
.
status
+
"
when doing basic auth PUT on url
"
+
Base64
.
encode
(
"
nom:test
"
)
+
"
"
+
xhr
.
statusText
);
}
}
}
xhr
.
withCredentials
=
"
true
"
;
xhr
.
send
(
JSON
.
stringify
(
getCurrentDocument
()));
}
// load
loadXHR
=
function
(
address
)
{
//create request
var
xhr
=
null
;
try
{
xhr
=
new
XMLHttpRequest
();
}
catch
(
e
)
{
try
{
xhr
=
new
ActiveXObject
(
"
Msxml2.XMLHTTP
"
);}
catch
(
e2
)
{
try
{
xhr
=
new
ActiveXObject
(
"
Microsoft.XMLHTTP
"
);}
catch
(
e
)
{}
}
}
xhr
.
open
(
"
GET
"
,
address
,
false
);
xhr
.
onreadystatechange
=
function
()
{
if
(
xhr
.
readyState
==
4
)
{
var
cDoc
=
getCurrentDocument
();
if
(
xhr
.
status
==
200
)
{
cDoc
.
load
(
JSON
.
parse
(
xhr
.
responseText
));
}
else
{
alert
(
"
error: got status
"
+
xhr
.
status
+
"
when doing basic auth GET on url
"
+
"
nom:test
"
+
"
"
+
xhr
.
statusText
);
}
cDoc
.
setAsCurrentDocument
();
}
}
xhr
.
send
();
}
\ No newline at end of file
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