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
64c7226d
Commit
64c7226d
authored
Jun 23, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.erp5.org/repos/ung
Conflicts: UNGProject/js/tools.js UNGProject/theme.html
parents
cf0bbd3c
a3308dcc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
34 deletions
+14
-34
UNGProject/js/tools.js
UNGProject/js/tools.js
+13
-33
UNGProject/theme.html
UNGProject/theme.html
+1
-1
No files found.
UNGProject/js/tools.js
View file @
64c7226d
...
...
@@ -42,38 +42,16 @@ currentTime = function() {return (new Date()).toUTCString();}
// 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
()));
}
$
.
ajax
({
url
:
address
,
type
:
"
PUT
"
,
username
:
"
smik
"
,
password
:
"
asdf
"
,
data
:
JSON
.
stringify
(
getCurrentDocument
()),
success
:
function
(){
alert
(
"
saved
"
);},
error
:
function
(
xhr
)
{
alert
(
"
error while saving
"
);}
});
};
// load
loadXHR
=
function
(
address
)
{
$
.
ajax
({
...
...
@@ -83,6 +61,8 @@ loadXHR = function(address) {
cache
:
false
,
username
:
"
nom
"
,
password
:
"
test
"
,
/* username: "smik", No need to specify credential while GETTING
password: "asdf",*/
success
:
function
(
data
){
var
cDoc
=
getCurrentDocument
();
cDoc
.
load
(
data
);
...
...
@@ -117,4 +97,4 @@ tryUntilSucceed = function(func) {
nb
*=
nb
;
}
execute
();
}
\ No newline at end of file
}
UNGProject/theme.html
View file @
64c7226d
...
...
@@ -31,7 +31,7 @@
<script
type=
"text/javascript"
>
// initialize
addressOfTestDocument
=
"
http://sidunhosted.com/ungdav/test.json
"
;
var
initPage
=
function
()
{
var
pageIWantToTest
=
"
illustration
"
;
addressOfTestDocument
=
"
dav/temp2.json
"
;
...
...
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