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
3e76914b
Commit
3e76914b
authored
Jun 17, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix user and document initialization
parent
d5b5c39e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
UNGProject/js/theme.js
UNGProject/js/theme.js
+2
-5
UNGProject/theme.html
UNGProject/theme.html
+6
-4
No files found.
UNGProject/js/theme.js
View file @
3e76914b
...
...
@@ -2,7 +2,7 @@
* global variables
*/
languages
=
[
"
fr
"
,
"
en
"
];
var
availableLanguages
=
window
.
document
.
getElementById
(
"
available_languages
"
);
var
availableLanguages
=
$
(
"
#
available_languages
"
);
currentPage
=
null
;
...
...
@@ -131,8 +131,6 @@ var User = function() {
this
.
language
=
"
en
"
;
this
.
storage
=
"
http://www.unhosted-dav.com
"
;
this
.
identityProvider
=
"
http://www.webfinger.com
"
;
this
.
setAsCurrentUser
();
}
User
.
prototype
=
{
getName
:
function
()
{
return
this
.
name
;},
...
...
@@ -176,8 +174,6 @@ var JSONDocument = function() {
this
.
creation
=
currentTime
();
this
.
lastModification
=
currentTime
();
this
.
state
=
Document
.
states
.
draft
;
this
.
setAsCurrentDocument
();
//temp
}
JSONDocument
.
prototype
=
{
//type
...
...
@@ -264,6 +260,7 @@ changeLanguage = function(language) {
user
.
setLanguage
(
language
);
setCurrentUser
(
user
);
getCurrentPage
().
displayLanguages
(
user
);
window
.
location
.
reload
();
}
cancel_sharing
=
function
()
{
alert
(
"
cancel
"
);}
translate
=
function
()
{
alert
(
"
translate
"
);}
...
...
UNGProject/theme.html
View file @
3e76914b
...
...
@@ -33,10 +33,12 @@
// initialize
init
=
function
()
{
setCurrentPage
(
"
editor
"
);
alert
(
getCurrentUser
());
if
(
getCurrentUser
()
==
null
)
{
new
User
();}
doc
=
new
JSONTextDocument
();
//load the document (it's just for testing)
doc
.
setAsCurrentDocument
();
var
user
=
getCurrentUser
();
(
user
==
null
)
?
(
new
User
()).
setAsCurrentDocument
()
:
user
.
setAsCurrentUser
();
var
doc
=
getCurrentDocument
();
(
doc
==
null
)
?
(
new
JSONTextDocument
()).
setAsCurrentDocument
()
:
doc
.
setAsCurrentDocument
();
}
$
(
document
).
ready
(
init
);
</script>
...
...
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