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
c2112947
Commit
c2112947
authored
Sep 19, 2011
by
François Billioud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrects bugs with the load of document list
parent
275cb9a4
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
513 additions
and
328 deletions
+513
-328
UNGProject/js/image-editor.js
UNGProject/js/image-editor.js
+1
-5
UNGProject/js/login.js
UNGProject/js/login.js
+25
-2
UNGProject/js/text-editor.js
UNGProject/js/text-editor.js
+1
-4
UNGProject/js/theme.js
UNGProject/js/theme.js
+90
-198
UNGProject/js/tools.js
UNGProject/js/tools.js
+25
-0
UNGProject/js/ung.js
UNGProject/js/ung.js
+5
-2
UNGProject/xml/table-editor.xml
UNGProject/xml/table-editor.xml
+366
-117
No files found.
UNGProject/js/image-editor.js
View file @
c2112947
...
...
@@ -33,14 +33,10 @@ SVGEditor = function() {
* setAsCurrentDocument : set the document as currentDocument in the local storage and display its properties in the current page
*/
JSONDocument
.
prototype
.
type
=
"
text
"
;
JSONDocument
.
prototype
.
type
=
"
image
"
;
JSONDocument
.
prototype
.
saveEdition
=
function
(
content
)
{
this
.
setLastUser
(
getCurrentUser
().
getName
());
this
.
setContent
(
content
);
this
.
setLastModification
(
getCurrentTime
());
this
.
setAsCurrentDocument
();
}
JSONDocument
.
prototype
.
setAsCurrentDocument
=
function
()
{
getCurrentPage
().
displayDocumentInformation
(
this
);
setCurrentDocument
(
this
);
}
UNGProject/js/login.js
View file @
c2112947
...
...
@@ -21,9 +21,32 @@ function logIntoDav(wallet) {
function
initStorage
(
wallet
)
{
if
(
!
wallet
.
provider
)
{
//local storage
Storage
.
currentStorage
=
new
LocalStorage
(
wallet
.
userName
);
/**
* load JIO file from a DAV and create and return the JIO object
* This function will be replaced. The aim is to load JIO in more various ways, and use JIO.initialize after
* @param userName : name of the user
* @param location : server location
* @param applicant : (optional) information about the person/application needing this JIO object (allow limited access)
* @return JIO object
*/
(
function
initializeFromDav
(
userName
,
location
,
applicant
)
{
//get the user personal JIO file
$
.
ajax
({
url
:
location
+
"
/dav/
"
+
userName
+
"
/
"
+
applicant
.
ID
+
"
/
"
+
"
jio.json
"
,
//we could use userAdress instead...
type
:
"
GET
"
,
async
:
false
,
dataType
:
"
text
"
,
headers
:
{
Authorization
:
"
Basic
"
+
Base64
.
encode
(
userName
+
"
:
"
+
applicant
.
password
)},
fields
:
{
withCredentials
:
"
true
"
},
success
:
function
(
jioContent
){
Storage
.
create
(
jioContent
);
},
error
:
function
(
type
)
{
alert
(
"
Error
"
+
type
.
status
+
"
: fail while trying to load jio.json
"
);}
});
return
JIO
;
})(
wallet
.
userName
,
wallet
.
storageLocation
,
{
"
ID
"
:
"
www.ungproject.com
"
,
"
password
"
:
wallet
.
applicationPassword
});
}
else
{
Storage
.
c
urrentStorage
=
new
JIOStorage
(
wallet
);
Storage
.
c
reate
(
'
{"type":"local","userName":"
'
+
wallet
.
userName
+
'
"}
'
);
}
}
...
...
UNGProject/js/text-editor.js
View file @
c2112947
...
...
@@ -129,9 +129,6 @@ JSONDocument.prototype.saveEdition = function(content) {
this
.
setLastUser
(
getCurrentUser
().
getName
());
this
.
setContent
(
content
);
this
.
setLastModification
(
getCurrentTime
());
this
.
setAsCurrentDocument
();
}
JSONDocument
.
prototype
.
setAsCurrentDocument
=
function
()
{
getCurrentPage
().
displayDocumentInformation
(
this
);
setCurrentDocument
(
this
);
}
UNGProject/js/theme.js
View file @
c2112947
This diff is collapsed.
Click to expand it.
UNGProject/js/tools.js
View file @
c2112947
...
...
@@ -54,6 +54,31 @@ UngObject.prototype.copy = function() {
return
copied
;
}
/*
* add an event handler executed when the fireEvent function is called
* @param handler : function to execute when the event occures
* @param event : the event to consider
* @param once : if set to true, the handler is executed only once
*/
UngObject
.
prototype
.
addEventHandler
=
function
(
handler
,
event
,
once
)
{
if
(
!
this
.
listenerList
.
length
)
{
this
.
listnerList
=
[]
}
this
.
listernerList
.
push
({
handler
:
handler
,
event
:
event
,
once
:
once
});
}
/* fire an event through all the listeners of the object */
UngObject
.
prototype
.
fireEvent
=
function
(
event
)
{
for
(
var
i
=
0
;
i
<
this
.
listenerList
.
length
;
i
++
)
{
var
listener
=
this
.
listenerList
[
i
];
if
(
listener
.
event
==
event
)
{
listener
.
handler
(
event
);
if
(
listener
.
once
)
{
// remove the listener if supposed to been executed only once
this
.
listenerList
.
splice
(
i
,
1
);
i
--
;
}
}
}
}
/**
* convert an object into an array easier to manipulate
* @param object : the object to convert
...
...
UNGProject/js/ung.js
View file @
c2112947
...
...
@@ -14,7 +14,10 @@ setCurrentDocumentID = function(ID) {return localStorage.setItem("currentDocumen
* the detailedList object is the synchronized list containing more detailed information about documents
* @param documentList : documents information loaded from the storage
*/
var
DocumentList
=
function
(
documentList
)
{
var
DocumentList
=
{
inititalize
:
function
()
{
var
data
=
lo
},
this
.
detailedList
=
{}
if
(
documentList
)
{
for
(
var
doc
in
documentList
)
{
...
...
@@ -193,7 +196,7 @@ DocumentList.prototype.load({
}
});
getDocumentList
=
function
()
{
return
getCurrent
User
().
getDocumentList
();
return
getCurrent
Storage
().
getDocumentList
();
}
...
...
UNGProject/xml/table-editor.xml
View file @
c2112947
This diff is collapsed.
Click to expand it.
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