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
d275a48c
Commit
d275a48c
authored
Oct 04, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct storage saving in localStorage
parent
a87133ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
10 deletions
+18
-10
UNGProject/js/theme.js
UNGProject/js/theme.js
+18
-10
No files found.
UNGProject/js/theme.js
View file @
d275a48c
...
...
@@ -210,24 +210,25 @@ var Storage = new UngObject();
Storage
.
load
({
/* create the storage from storage. Used in the login page */
create
:
function
(
jioFileContent
)
{
this
.
jio
=
JIO
.
initialize
(
jioFileContent
,{
"
ID
"
:
"
www.ungproject.com
"
});
this
.
jio
=
jioFileContent
;
JIO
.
initialize
(
jioFileContent
,{
"
ID
"
:
"
www.ungproject.com
"
});
Storage
.
currentStorage
=
this
;
//try to load user parameters
var
storage
=
this
;
var
option
=
{
success
:
function
(
data
)
{
//success
storage
.
setUser
(
new
User
(
JSON
.
parse
(
data
)
));
storage
.
sav
e
();
storage
.
fireEvent
(
Storage
.
STORAGE_CREATED
);
storage
.
user
=
new
User
(
JSON
.
parse
(
data
));
storage
.
userName
=
storage
.
user
.
getNam
e
();
storage
.
save
(
function
()
{
storage
.
fireEvent
(
Storage
.
STORAGE_CREATED
);}
);
},
errorHandler
:
function
(
errorEvent
)
{
//fail
if
(
errorEvent
.
status
==
404
){
//create a new user if there was no such one
var
user
=
new
User
();
user
.
setName
(
jioFileContent
.
userName
);
storage
.
setUser
(
user
)
;
storage
.
user
.
storageLocation
=
jioFileContent
.
location
;
storage
.
save
()
;
storage
.
fireEvent
(
Storage
.
STORAGE_CREATED
);
storage
.
user
=
user
;
storage
.
user
Name
=
storage
.
user
.
getName
()
;
storage
.
user
.
storageLocation
=
jioFileContent
.
location
;
debugger
;
storage
.
save
(
function
()
{
storage
.
fireEvent
(
Storage
.
STORAGE_CREATED
);}
);
}
},
asynchronous
:
false
...
...
@@ -295,10 +296,17 @@ Storage.load({
}
JIO
.
getDocumentList
(
option
);
},
save
:
function
()
{
// update and save user information in the localStorage
save
:
function
(
instruction
)
{
// update and save user information in the localStorage
this
.
updateUser
();
this
.
saveDocument
(
this
.
user
,
this
.
user
.
getName
()
+
"
.profile
"
,
function
()
{
localStorage
.
setItem
(
"
currentStorage
"
,
JSON
.
stringify
(
this
));
var
storage
=
{
jio
:
Storage
.
jio
,
user
:
Storage
.
user
,
userName
:
Storage
.
userName
}
debugger
;
localStorage
.
currentStorage
=
JSON
.
stringify
(
storage
);
if
(
instruction
)
{
instruction
();}
});
},
...
...
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