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
1c7b82ab
Commit
1c7b82ab
authored
Jul 05, 2012
by
Lingnan Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean code
parent
d6b0bdef
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
55 deletions
+20
-55
OfficeJS-Mobile/js/list-page.js
OfficeJS-Mobile/js/list-page.js
+0
-20
OfficeJS-Mobile/js/officejs-mobile.js
OfficeJS-Mobile/js/officejs-mobile.js
+20
-35
No files found.
OfficeJS-Mobile/js/list-page.js
View file @
1c7b82ab
...
@@ -47,23 +47,3 @@ NewList = function (listnumber,listname,listcontent){
...
@@ -47,23 +47,3 @@ NewList = function (listnumber,listname,listcontent){
newFirstdiv
.
appendChild
(
newshadow
);
newFirstdiv
.
appendChild
(
newshadow
);
}
}
function
CreateLists
(){
//clean all the lists
var
n
=
document
.
getElementById
(
'
textlist
'
).
childNodes
.
length
;
for
(
var
i
=
0
;
i
<
n
;
i
++
)
{
document
.
getElementById
(
'
textlist
'
).
removeChild
(
document
.
getElementById
(
'
textlist
'
).
firstChild
);
}
//set the new lists
for
(
i
=
0
;
i
<
OfficeJS
.
list
.
length
;
i
++
){
NewList
(
i
,
OfficeJS
.
list
[
i
].
title
,
OfficeJS
.
list
[
i
].
text
);
}
}
function
get_list_value
(
element
){
tr
=
document
.
all
.
para
.
value
;
document
.
all
.
para
.
value
=
element
.
value
;
var
trid
=
element
.
value
;
alert
(
trid
);
}
OfficeJS-Mobile/js/officejs-mobile.js
View file @
1c7b82ab
...
@@ -19,8 +19,6 @@
...
@@ -19,8 +19,6 @@
var
that
=
{},
priv
=
{};
var
that
=
{},
priv
=
{};
// Attributes //
// Attributes //
that
.
list
=
new
Array
();
//List for ListPage
that
.
currentContent
=
""
;
priv
.
preference_object
=
{
priv
.
preference_object
=
{
document_lister
:
'
slickgrid
'
,
document_lister
:
'
slickgrid
'
,
...
@@ -444,12 +442,12 @@ that.currentContent="";
...
@@ -444,12 +442,12 @@ that.currentContent="";
// if there is not any jio created
// if there is not any jio created
priv
.
jio
=
JIO
.
newJio
(
storage
,
applicant
);
priv
.
jio
=
JIO
.
newJio
(
storage
,
applicant
);
// update left nav bar
// update left nav bar
/*
leftnavbar = priv.getRealApplication ('leftnavbar');
/*
leftnavbar = priv.getRealApplication ('leftnavbar');
if (typeof leftnavbar.update !== 'undefined') {
if (typeof leftnavbar.update !== 'undefined') {
leftnavbar.update();
leftnavbar.update();
}*/
}*/
//Forbid the list to avoid error
//Forbid the list to avoid error
//
that.getList();
//
that.getList();
};
};
/**
/**
...
@@ -463,7 +461,7 @@ that.currentContent="";
...
@@ -463,7 +461,7 @@ that.currentContent="";
console
.
error
(
'
No Jio set yet.
'
);
console
.
error
(
'
No Jio set yet.
'
);
return
;
return
;
}
}
//
priv.loading_object.getlist();
//
priv.loading_object.getlist();
priv
.
jio
.
getDocumentList
({
priv
.
jio
.
getDocumentList
({
'
sort
'
:{
'
last_modified
'
:
'
descending
'
,
'
sort
'
:{
'
last_modified
'
:
'
descending
'
,
'
name
'
:
'
ascending
'
},
'
name
'
:
'
ascending
'
},
...
@@ -473,16 +471,15 @@ that.currentContent="";
...
@@ -473,16 +471,15 @@ that.currentContent="";
'
onResponse
'
:
function
(
result
)
{
'
onResponse
'
:
function
(
result
)
{
if
(
result
.
status
===
'
done
'
)
{
if
(
result
.
status
===
'
done
'
)
{
priv
.
data_object
.
documentList
=
result
.
return_value
;
priv
.
data_object
.
documentList
=
result
.
return_value
;
console
.
log
(
result
.
return_value
.
length
);
//set the List
console
.
log
(
result
.
return_value
[
0
]);
for
(
var
i
=
0
;
i
<
result
.
return_value
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
result
.
return_value
.
length
;
i
++
){
NewList
(
i
,
result
.
return_value
[
i
].
name
,
"
text-Editor
"
);
NewList
(
i
,
result
.
return_value
[
i
].
name
,
"
text-Editor
"
);
}
}
//
priv.showDocumentListInsideLeftNavBar();
//
priv.showDocumentListInsideLeftNavBar();
}
else
{
}
else
{
console
.
error
(
result
.
message
);
console
.
error
(
result
.
message
);
}
}
//
priv.loading_object.end_getlist();
//
priv.loading_object.end_getlist();
if
(
typeof
callback
!==
'
undefined
'
)
{
if
(
typeof
callback
!==
'
undefined
'
)
{
callback
();
callback
();
}
}
...
@@ -518,20 +515,7 @@ for(var i=0;i<result.return_value.length;i++){
...
@@ -518,20 +515,7 @@ for(var i=0;i<result.return_value.length;i++){
that.getList();
that.getList();
}
}
});*/
});*/
var
newone
=
true
;
for
(
var
i
=
0
;
i
<
that
.
list
.
length
;
i
++
){
if
(
basename
==
that
.
list
[
i
].
title
){
newone
=
false
;
that
.
list
[
i
].
text
=
content
;
}
}
if
(
newone
){
var
newlist
=
new
Object
();
//new object
newlist
.
title
=
basename
;
//object title and text
newlist
.
text
=
content
;
newlist
.
number
=
that
.
list
.
length
;
that
.
list
.
push
(
newlist
);
//save in the list
}
if
(
!
priv
.
isJioSet
())
{
if
(
!
priv
.
isJioSet
())
{
console
.
error
(
'
No Jio set yet.
'
);
console
.
error
(
'
No Jio set yet.
'
);
return
;
return
;
...
@@ -549,25 +533,26 @@ for(var i=0;i<result.return_value.length;i++){
...
@@ -549,25 +533,26 @@ for(var i=0;i<result.return_value.length;i++){
* @param {string} basename The document name without ext.
* @param {string} basename The document name without ext.
*/
*/
that
.
load
=
function
(
basename
)
{
that
.
load
=
function
(
basename
)
{
//
var current_editor = priv.data_object.currentEditor;
//
var current_editor = priv.data_object.currentEditor;
if
(
!
priv
.
isJioSet
())
{
if
(
!
priv
.
isJioSet
())
{
console
.
error
(
'
No Jio set yet.
'
);
console
.
error
(
'
No Jio set yet.
'
);
return
;
return
;
}
}
//
priv.loading_object.load();
//
priv.loading_object.load();
priv
.
jio
.
loadDocument
({
priv
.
jio
.
loadDocument
({
'
name
'
:
basename
,
'
name
'
:
basename
,
'
maxtries
'
:
3
,
'
maxtries
'
:
3
,
'
onResponse
'
:
function
(
result
)
{
'
onResponse
'
:
function
(
result
)
{
if
(
result
.
status
===
'
fail
'
)
{
if
(
result
.
status
===
'
fail
'
)
{
console
.
error
(
result
.
message
);
console
.
error
(
result
.
message
);
}
else
{
console
.
log
(
"
content is :
"
+
result
.
return_value
.
content
);
}
else
{
//set the content for the editor
setTextEditorInformation
(
basename
,
result
.
return_value
.
content
);
setTextEditorInformation
(
basename
,
result
.
return_value
.
content
);
//
current_editor.setContent(
//
current_editor.setContent(
//
result.return_value.content);
//
result.return_value.content);
}
}
//
priv.loading_object.end_load();
//
priv.loading_object.end_load();
}
}
});
});
...
...
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