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 = {
...
@@ -29,7 +29,7 @@ var Page = {
this
.
loadXML
(
"
xml/
"
+
page
+
"
.xml
"
);
this
.
loadXML
(
"
xml/
"
+
page
+
"
.xml
"
);
}
else
{
}
else
{
//display user information when the storage is ready
//display user information when the storage is ready
if
(
Storage
[
Storage
.
USER_READY
]
)
{
if
(
Storage
.
user
)
{
Page
.
displayUserInformation
(
getCurrentUser
());
Page
.
displayUserInformation
(
getCurrentUser
());
DocumentList
.
initialize
();
DocumentList
.
initialize
();
}
else
{
}
else
{
...
@@ -40,11 +40,16 @@ var Page = {
...
@@ -40,11 +40,16 @@ var Page = {
}
}
//display the document list when the line factory is ready
//display the document list when the line factory is ready
Line
.
loadHTML
(
function
()
{
Line
.
loadHTML
(
function
()
{
if
(
Storage
[
Storage
.
LIST_READY
])
{
var
list
=
getCurrentDocumentList
();
getCurrentDocumentList
().
display
();
if
(
list
&&
list
.
detailedList
)
{
list
.
display
();
list
.
resetSelectionList
();
resize
();
}
else
{
}
else
{
Storage
.
addEventHandler
(
function
()
{
Storage
.
addEventHandler
(
function
()
{
getCurrentDocumentList
().
display
();
list
.
display
();
list
.
resetSelectionList
();
resize
();
},
Storage
.
LIST_READY
);
},
Storage
.
LIST_READY
);
}
}
});
});
...
@@ -227,7 +232,7 @@ Storage.load({
...
@@ -227,7 +232,7 @@ Storage.load({
user
.
setName
(
jioFileContent
.
userName
);
user
.
setName
(
jioFileContent
.
userName
);
storage
.
user
=
user
;
storage
.
user
=
user
;
storage
.
userName
=
storage
.
user
.
getName
();
storage
.
userName
=
storage
.
user
.
getName
();
storage
.
user
.
storageLocation
=
jioFileContent
.
location
;
debugger
;
storage
.
user
.
storageLocation
=
jioFileContent
.
location
;
storage
.
save
(
function
()
{
storage
.
fireEvent
(
Storage
.
STORAGE_CREATED
);});
storage
.
save
(
function
()
{
storage
.
fireEvent
(
Storage
.
STORAGE_CREATED
);});
}
}
},
},
...
@@ -243,10 +248,12 @@ Storage.load({
...
@@ -243,10 +248,12 @@ Storage.load({
var
dataStorage
=
JSON
.
parse
(
localStorage
.
getItem
(
"
currentStorage
"
));
var
dataStorage
=
JSON
.
parse
(
localStorage
.
getItem
(
"
currentStorage
"
));
if
(
!
dataStorage
)
{
window
.
location
.
href
=
"
login.html
"
;}
//if it's the first connexion
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
;
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
USER_READY
:
"
userReady
"
,
// value of the USER_READY event
LIST_READY
:
"
listReady
"
,
// value of the LIST_READY event
LIST_READY
:
"
listReady
"
,
// value of the LIST_READY event
...
@@ -304,7 +311,6 @@ Storage.load({
...
@@ -304,7 +311,6 @@ Storage.load({
user
:
Storage
.
user
,
user
:
Storage
.
user
,
userName
:
Storage
.
userName
userName
:
Storage
.
userName
}
}
debugger
;
localStorage
.
currentStorage
=
JSON
.
stringify
(
storage
);
localStorage
.
currentStorage
=
JSON
.
stringify
(
storage
);
if
(
instruction
)
{
instruction
();}
if
(
instruction
)
{
instruction
();}
});
});
...
...
UNGProject/js/ung.js
View file @
01496da5
...
@@ -271,7 +271,7 @@ Line.getOriginalHTML = function() {return Line.originalHTML;}
...
@@ -271,7 +271,7 @@ Line.getOriginalHTML = function() {return Line.originalHTML;}
var
createNewDocument
=
function
(
type
)
{
var
createNewDocument
=
function
(
type
)
{
var
newDocument
=
new
JSONDocument
();
var
newDocument
=
new
JSONDocument
();
newDocument
.
setType
(
type
);
newDocument
.
setType
(
type
);
var
fileName
=
D
O
cument
.
getAddress
(
newDocument
);
var
fileName
=
D
o
cument
.
getAddress
(
newDocument
);
newDocument
.
save
(
function
()
{
newDocument
.
save
(
function
()
{
getDocumentList
()[
fileName
]
=
newDocument
;
getDocumentList
()[
fileName
]
=
newDocument
;
...
...
UNGProject/ung.html
View file @
01496da5
...
@@ -43,13 +43,8 @@
...
@@ -43,13 +43,8 @@
delete
localStorage
.
currentDocumentID
;
delete
localStorage
.
currentDocumentID
;
getCurrentStorage
().
save
();
getCurrentStorage
().
save
();
}
}
Line
.
loadHTML
(
//display the list of documents
resize
();
function
()
{
getDocumentList
().
resetSelectionList
();
getDocumentList
().
display
();
resize
();
}
);
}
}
$
(
window
).
resize
(
resize
);
$
(
window
).
resize
(
resize
);
$
(
document
).
ready
(
init
);
$
(
document
).
ready
(
init
);
...
...
UNGProject/unhosted/jio.js
View file @
01496da5
...
@@ -39,6 +39,7 @@
...
@@ -39,6 +39,7 @@
default
:
alert
(
"
Error while getting jio.json content
"
);
break
;
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
.
storage
=
createStorage
(
JSON
.
parse
(
this
.
jioFileContent
),
applicant
);
//create the object allowing IO in storages
this
.
ready
();
}
}
},
},
...
@@ -48,6 +49,8 @@
...
@@ -48,6 +49,8 @@
*/
*/
isReady
:
function
()
{
return
this
.
jioFileContent
&&
this
.
storage
},
isReady
:
function
()
{
return
this
.
jioFileContent
&&
this
.
storage
},
ready
:
function
(
instruction
)
{
this
.
ready
=
instruction
},
//IO functions
//IO functions
getLocation
:
function
()
{
return
this
.
location
},
getLocation
:
function
()
{
return
this
.
location
},
userNameAvailable
:
function
(
name
,
option
)
{
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