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
01496da5
Commit
01496da5
authored
Oct 04, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start fixing DocumentList initialization
parent
b05705a5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
17 deletions
+21
-17
UNGProject/js/theme.js
UNGProject/js/theme.js
+15
-9
UNGProject/js/ung.js
UNGProject/js/ung.js
+1
-1
UNGProject/ung.html
UNGProject/ung.html
+2
-7
UNGProject/unhosted/jio.js
UNGProject/unhosted/jio.js
+3
-0
No files found.
UNGProject/js/theme.js
View file @
01496da5
...
...
@@ -29,7 +29,7 @@ var Page = {
this
.
loadXML
(
"
xml/
"
+
page
+
"
.xml
"
);
}
else
{
//display user information when the storage is ready
if
(
Storage
[
Storage
.
USER_READY
]
)
{
if
(
Storage
.
user
)
{
Page
.
displayUserInformation
(
getCurrentUser
());
DocumentList
.
initialize
();
}
else
{
...
...
@@ -40,11 +40,16 @@ var Page = {
}
//display the document list when the line factory is ready
Line
.
loadHTML
(
function
()
{
if
(
Storage
[
Storage
.
LIST_READY
])
{
getCurrentDocumentList
().
display
();
var
list
=
getCurrentDocumentList
();
if
(
list
&&
list
.
detailedList
)
{
list
.
display
();
list
.
resetSelectionList
();
resize
();
}
else
{
Storage
.
addEventHandler
(
function
()
{
getCurrentDocumentList
().
display
();
list
.
display
();
list
.
resetSelectionList
();
resize
();
},
Storage
.
LIST_READY
);
}
});
...
...
@@ -227,7 +232,7 @@ Storage.load({
user
.
setName
(
jioFileContent
.
userName
);
storage
.
user
=
user
;
storage
.
userName
=
storage
.
user
.
getName
();
storage
.
user
.
storageLocation
=
jioFileContent
.
location
;
debugger
;
storage
.
user
.
storageLocation
=
jioFileContent
.
location
;
storage
.
save
(
function
()
{
storage
.
fireEvent
(
Storage
.
STORAGE_CREATED
);});
}
},
...
...
@@ -243,10 +248,12 @@ Storage.load({
var
dataStorage
=
JSON
.
parse
(
localStorage
.
getItem
(
"
currentStorage
"
));
if
(
!
dataStorage
)
{
window
.
location
.
href
=
"
login.html
"
;}
//if it's the first connexion
this
.
jio
=
JIO
.
initialize
(
dataStorage
.
jio
.
jioFileContent
,
{
"
ID
"
:
"
www.ungproject.com
"
});
this
.
jio
=
dataStorage
.
jio
;
JIO
.
initialize
(
dataStorage
.
jio
,
{
"
ID
"
:
"
www.ungproject.com
"
});
Storage
.
currentStorage
=
this
;
this
.
setUser
(
new
User
(
dataStorage
.
user
));
//wait for JIO being ready
JIO
.
ready
(
function
(){
Storage
.
setUser
(
new
User
(
dataStorage
.
user
))});
},
USER_READY
:
"
userReady
"
,
// value of the USER_READY event
LIST_READY
:
"
listReady
"
,
// value of the LIST_READY event
...
...
@@ -304,7 +311,6 @@ Storage.load({
user
:
Storage
.
user
,
userName
:
Storage
.
userName
}
debugger
;
localStorage
.
currentStorage
=
JSON
.
stringify
(
storage
);
if
(
instruction
)
{
instruction
();}
});
...
...
UNGProject/js/ung.js
View file @
01496da5
...
...
@@ -271,7 +271,7 @@ Line.getOriginalHTML = function() {return Line.originalHTML;}
var
createNewDocument
=
function
(
type
)
{
var
newDocument
=
new
JSONDocument
();
newDocument
.
setType
(
type
);
var
fileName
=
D
O
cument
.
getAddress
(
newDocument
);
var
fileName
=
D
o
cument
.
getAddress
(
newDocument
);
newDocument
.
save
(
function
()
{
getDocumentList
()[
fileName
]
=
newDocument
;
...
...
UNGProject/ung.html
View file @
01496da5
...
...
@@ -43,13 +43,8 @@
delete
localStorage
.
currentDocumentID
;
getCurrentStorage
().
save
();
}
Line
.
loadHTML
(
//display the list of documents
function
()
{
getDocumentList
().
resetSelectionList
();
getDocumentList
().
display
();
resize
();
}
);
resize
();
}
$
(
window
).
resize
(
resize
);
$
(
document
).
ready
(
init
);
...
...
UNGProject/unhosted/jio.js
View file @
01496da5
...
...
@@ -39,6 +39,7 @@
default
:
alert
(
"
Error while getting jio.json content
"
);
break
;
}
this
.
storage
=
createStorage
(
JSON
.
parse
(
this
.
jioFileContent
),
applicant
);
//create the object allowing IO in storages
this
.
ready
();
}
},
...
...
@@ -48,6 +49,8 @@
*/
isReady
:
function
()
{
return
this
.
jioFileContent
&&
this
.
storage
},
ready
:
function
(
instruction
)
{
this
.
ready
=
instruction
},
//IO functions
getLocation
:
function
()
{
return
this
.
location
},
userNameAvailable
:
function
(
name
,
option
)
{
...
...
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