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
2e404066
Commit
2e404066
authored
Jul 18, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prepare JIOStorage for tests
parent
ba8bed00
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
UNGProject/js/theme.js
UNGProject/js/theme.js
+7
-6
UNGProject/js/tools.js
UNGProject/js/tools.js
+0
-2
No files found.
UNGProject/js/theme.js
View file @
2e404066
...
...
@@ -171,6 +171,8 @@ User.prototype.load({//add methods thanks to the UngObject.load method
getDocumentList
:
function
()
{
return
this
.
documentList
;},
setDocumentList
:
function
(
list
)
{
this
.
documentList
=
list
;},
getIDProvider
:
function
()
{
return
this
.
IDProvider
;},
setAsCurrentUser
:
function
()
{
getCurrentPage
().
displayUserName
(
this
);
getCurrentPage
().
displayLanguages
(
this
);
...
...
@@ -222,10 +224,6 @@ Storage.prototype.load({
*/
var
LocalStorage
=
function
(
userName
)
{
Storage
.
call
(
this
,
"
local
"
,
userName
);
if
(
this
.
user
)
{
//this.user.documents = {}
//this.updateUser();
}
}
LocalStorage
.
prototype
=
new
Storage
();
LocalStorage
.
prototype
.
load
({
...
...
@@ -277,8 +275,9 @@ LocalStorage.prototype.load({
* Class JIOStorage
* this class provides usual API to save/load/delete documents on a remote storage
*/
var
JIOStorage
=
function
(
userName
)
{
var
JIOStorage
=
function
(
userName
,
IDProvider
)
{
Storage
.
call
(
this
,
"
JIO
"
,
userName
);
if
(
this
.
user
)
this
.
user
.
IDProvider
=
IDProvider
;
}
JIOStorage
.
prototype
=
new
Storage
();
JIOStorage
.
prototype
.
load
({
...
...
@@ -290,6 +289,8 @@ JIOStorage.prototype.load({
url
:
address
,
type
:
"
GET
"
,
dataType
:
type
,
headers
:
{
Authorization
:
"
Basic
"
+
btoa
(
"
smik:asdf
"
)},
fields
:
{
withCredentials
:
"
true
"
},
success
:
instruction
,
error
:
function
(
type
)
{
alert
(
"
Error
"
+
type
.
status
+
"
: fail while trying to load
"
+
address
);}
});
...
...
@@ -450,7 +451,7 @@ supportedDocuments = {"text":{editorPage:"text-editor",icon:"images/icons/docume
undefined
:{
editorPage
:
null
,
icon
:
"
images/icons/other.gif
"
}
}
getDocumentAddress
=
function
(
doc
)
{
return
getCurrentStorage
().
getType
()
==
"
local
"
?
doc
.
getCreation
()
:
"
http://
sidunhosted.com
/ungdav/
"
+
doc
.
getCreation
();
return
getCurrentStorage
().
getType
()
==
"
local
"
?
doc
.
getCreation
()
:
"
http://
"
+
getCurrentUser
().
getIDProvider
()
+
"
/ungdav/
"
+
doc
.
getCreation
();
}
/*************************************************
...
...
UNGProject/js/tools.js
View file @
2e404066
...
...
@@ -166,8 +166,6 @@ loadFile = function(address, type, instruction) {
url
:
address
,
type
:
"
GET
"
,
dataType
:
type
,
headers
:
{
Authorization
:
"
Basic
"
+
btoa
(
"
smik:asdf
"
)},
fields
:
{
withCredentials
:
"
true
"
},
success
:
instruction
,
error
:
function
(
type
)
{
alert
(
"
Error
"
+
type
.
status
+
"
: fail while trying to load
"
+
address
);}
...
...
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