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
d1d0521a
Commit
d1d0521a
authored
Jun 20, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewriting JSONSheetDocument class
parent
4ae73e5a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
31 deletions
+39
-31
UNGProject/js/table.js
UNGProject/js/table.js
+23
-19
UNGProject/js/theme.js
UNGProject/js/theme.js
+15
-12
UNGProject/theme.html
UNGProject/theme.html
+1
-0
No files found.
UNGProject/js/table.js
View file @
d1d0521a
...
...
@@ -10,25 +10,29 @@ var JSONSheetDocument = function() {
JSONSheetDocument
.
prototype
=
new
JSONDocument
();
//inheritance
//accessors
JSONSheetDocument
.
prototype
.
getWidth
=
function
()
{
return
this
.
width
;}
JSONSheetDocument
.
prototype
.
setWidth
=
function
(
newWidth
)
{
this
.
width
=
newWidth
;}
JSONSheetDocument
.
prototype
.
getHeight
=
function
()
{
return
this
.
height
;}
JSONSheetDocument
.
prototype
.
setHeight
=
function
(
newHeight
)
{
this
.
height
=
newHeight
;}
//save process
JSONSheetDocument
.
prototype
.
saveEdition
=
function
(
content
)
{
JSONSheetDocument
.
prototype
.
load
({
getWidth
:
function
()
{
return
this
.
width
;},
setWidth
:
function
(
newWidth
)
{
this
.
width
=
newWidth
;},
getHeight
:
function
()
{
return
this
.
height
;},
setHeight
:
function
(
newHeight
)
{
this
.
height
=
newHeight
;},
//save process
saveEdition
:
function
(
content
)
{
this
.
setContent
(
content
);
this
.
setLastModification
(
currentTime
());
this
.
setAsCurrentDocument
();
}
//display document information
JSONSheetDocument
.
prototype
.
setAsCurrentDocument
=
function
()
{
},
//display document information
setAsCurrentDocument
:
function
()
{
getCurrentPage
().
displayDocumentTitle
(
this
);
getCurrentPage
().
displayDocumentState
(
this
);
getCurrentPage
().
displayAuthorName
(
this
);
getCurrentPage
().
displayLastModification
(
this
);
setCurrentDocument
(
this
);
}
}
});
getCurrentDocument
=
function
()
{
var
doc
=
new
JSONTextDocument
();
doc
.
load
(
JSON
.
parse
(
localStorage
.
getItem
(
"
currentDocument
"
)));
...
...
UNGProject/js/theme.js
View file @
d1d0521a
...
...
@@ -51,8 +51,8 @@ Page.prototype = {
this
.
displayPageTitle
();
this
.
displayPageContent
();
var
dependencies
=
this
.
getDependencies
();
$
(
dependencies
).
find
(
"
scriptfile
"
).
each
(
function
()
{
currentPage
.
include
(
$
(
this
).
text
(),
"
script
"
);});
//includes js
$
(
dependencies
).
find
(
"
linkfile
"
).
each
(
function
()
{
currentPage
.
include
(
$
(
this
).
text
(),
"
link
"
);});
//includes css
$
(
dependencies
).
find
(
"
scriptfile
"
).
each
(
function
()
{
currentPage
.
include
(
$
(
this
).
text
(),
"
script
"
);});
//includes js
switch
(
this
.
name
)
{
case
"
editor
"
:
this
.
editor
=
new
Xinha
();
...
...
@@ -77,8 +77,7 @@ Page.prototype = {
break
;
}
var
head
=
this
.
getHTML
().
getElementsByTagName
(
"
head
"
);
$
(
head
[
0
]).
append
(
object
);
var
head
=
$
(
this
.
getHTML
()).
find
(
"
head
"
).
append
(
object
);
},
//printers
...
...
@@ -132,7 +131,8 @@ var User = function() {
this
.
storage
=
"
http://www.unhosted-dav.com
"
;
this
.
identityProvider
=
"
http://www.webfinger.com
"
;
}
User
.
prototype
=
{
User
.
prototype
=
new
UngObject
();
User
.
prototype
.
load
({
getName
:
function
()
{
return
this
.
name
;},
setName
:
function
(
newName
)
{
this
.
name
=
newName
;},
getLanguage
:
function
()
{
return
this
.
language
;},
...
...
@@ -147,7 +147,7 @@ User.prototype = {
getCurrentPage
().
displayLanguages
(
this
);
setCurrentUser
(
this
);
}
}
}
);
getCurrentUser
=
function
()
{
var
user
=
new
User
();
...
...
@@ -175,7 +175,9 @@ var JSONDocument = function() {
this
.
lastModification
=
currentTime
();
this
.
state
=
Document
.
states
.
draft
;
}
JSONDocument
.
prototype
=
{
JSONDocument
.
prototype
=
new
UngObject
();
JSONDocument
.
prototype
.
load
({
//type
getType
:
function
()
{
return
this
.
type
;},
...
...
@@ -213,7 +215,7 @@ JSONDocument.prototype = {
},
save
:
function
()
{}
}
}
);
Document
.
states
=
{
draft
:{
"
fr
"
:
"
Brouillon
"
,
"
en
"
:
"
Draft
"
},
saved
:{
"
fr
"
:
"
Enregistré
"
,
"
en
"
:
"
Saved
"
},
...
...
@@ -231,13 +233,14 @@ setCurrentDocument = function(doc) {localStorage.setItem("currentDocument",JSON.
* actions
*/
editDocumentSettings
=
function
()
{
$
(
"
#edit_document
"
).
dialog
({
autoOpen
:
fals
e
,
autoOpen
:
tru
e
,
height
:
131
,
width
:
389
,
modal
:
true
,
buttons
:
{
"
Save
"
:
function
(){
'
Save
'
:
function
(){
/*getCurrentDocument().setTitle($(getCurrentDocument()).find("#name").attr("value"));
//var new_short_title = $("input#short_title.short_title").attr("value");
getCurrentDocument().setLanguage($(getCurrentDocument()).find("#language").attr("value"));
...
...
@@ -246,10 +249,10 @@ editDocumentSettings = function() {
//var new_subject_list = $("textarea#keyword_list").attr("value").replace(/\n+/g, ",");
getCurrentDocument().setAsCurrentDocument();//diplay modifications
//save_button.click();*/
$
(
this
).
dialog
(
"
close
"
);
$
(
this
).
dialog
(
'
close
'
);
},
Cancel
:
function
()
{
$
(
this
).
dialog
(
"
close
"
);
'
Cancel
'
:
function
()
{
$
(
this
).
dialog
(
'
close
'
);
}
}
});
...
...
UNGProject/theme.html
View file @
d1d0521a
...
...
@@ -30,6 +30,7 @@
<script
type=
"text/javascript"
>
// initialize
init
=
function
()
{
setCurrentPage
(
"
editor
"
);
...
...
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