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
f089c138
Commit
f089c138
authored
Jun 04, 2012
by
Tristan Cavelier
Committed by
Sebastien Robin
Jun 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug: user was never added to the user array list (Jio localStorage).
parent
fe765144
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
OfficeJS/src/jio.storage.js
OfficeJS/src/jio.storage.js
+20
-8
No files found.
OfficeJS/src/jio.storage.js
View file @
f089c138
...
@@ -59,6 +59,22 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
...
@@ -59,6 +59,22 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
userarray
);
userarray
);
};
};
/**
* checks if a user exists in the user array.
* @method userExists
* @param {string} username The user name
* @return {boolean} true if exist, else false
*/
priv
.
userExists
=
function
(
username
)
{
var
userarray
=
priv
.
getUserArray
(),
i
,
l
;
for
(
i
=
0
,
l
=
userarray
.
length
;
i
<
l
;
i
+=
1
)
{
if
(
userarray
[
i
]
===
username
)
{
return
true
;
}
}
return
false
;
};
/**
/**
* Returns the file names of all existing files owned by the user.
* Returns the file names of all existing files owned by the user.
* @method getFileNameArray
* @method getFileNameArray
...
@@ -104,14 +120,7 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
...
@@ -104,14 +120,7 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
*/
*/
that
.
checkNameAvailability
=
function
()
{
that
.
checkNameAvailability
=
function
()
{
setTimeout
(
function
()
{
setTimeout
(
function
()
{
var
i
,
l
,
array
=
priv
.
getUserArray
();
that
.
done
(
!
priv
.
userExists
(
that
.
getUserName
()));
for
(
i
=
0
,
l
=
array
.
length
;
i
<
l
;
i
+=
1
)
{
if
(
array
[
i
]
===
that
.
getUserName
())
{
that
.
done
(
false
);
return
;
}
}
that
.
done
(
true
);
},
100
);
},
100
);
};
// end checkNameAvailability
};
// end checkNameAvailability
...
@@ -138,6 +147,9 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
...
@@ -138,6 +147,9 @@ var jio_storage_loader = function ( LocalOrCookieStorage, Base64, Jio, $) {
'
creationDate
'
:
Date
.
now
(),
'
creationDate
'
:
Date
.
now
(),
'
lastModified
'
:
Date
.
now
()
'
lastModified
'
:
Date
.
now
()
};
};
if
(
!
priv
.
userExists
()){
priv
.
addUser
(
that
.
getStorageUserName
());
}
priv
.
addFileName
(
that
.
getFileName
());
priv
.
addFileName
(
that
.
getFileName
());
}
else
{
}
else
{
// overwriting
// overwriting
...
...
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