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
d6b0bdef
Commit
d6b0bdef
authored
Jul 04, 2012
by
Lingnan Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the jio for the save and load ,also load list from jio (didn't clean code)
parent
8558e5c1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
14 deletions
+32
-14
OfficeJS-Mobile/index.html
OfficeJS-Mobile/index.html
+1
-1
OfficeJS-Mobile/js/list-page.js
OfficeJS-Mobile/js/list-page.js
+2
-2
OfficeJS-Mobile/js/officejs-mobile.js
OfficeJS-Mobile/js/officejs-mobile.js
+28
-11
OfficeJS/js/officejs.js
OfficeJS/js/officejs.js
+1
-0
No files found.
OfficeJS-Mobile/index.html
View file @
d6b0bdef
...
...
@@ -62,7 +62,7 @@ $('#input_json_applicant').attr('value'));">
Tools
</li>
<li
data-theme=
"c"
>
<a
href=
"#list"
data-transition=
"slide"
onclick=
"
CreateLists
();"
>
<a
href=
"#list"
data-transition=
"slide"
onclick=
"
OfficeJS.getList
();"
>
Document list
</a>
</li>
...
...
OfficeJS-Mobile/js/list-page.js
View file @
d6b0bdef
...
...
@@ -24,10 +24,10 @@ NewList = function (listnumber,listname,listcontent){
newFirstdiv
.
appendChild
(
newSeconddiv
);
//set a tag
newa
=
document
.
createElement
(
"
a
"
);
newa
.
setAttribute
(
"
id
"
,
listn
umber
);
newa
.
setAttribute
(
"
id
"
,
listn
ame
);
newa
.
setAttribute
(
"
class
"
,
"
ui-link-inherit
"
);
newa
.
setAttribute
(
"
href
"
,
"
#text
"
);
newa
.
setAttribute
(
"
onclick
"
,
"
setTextEditorInformation(OfficeJS.list[this.id].title,OfficeJS.list[this.id].text
);
"
);
newa
.
setAttribute
(
"
onclick
"
,
"
OfficeJS.load(this.id
);
"
);
newSeconddiv
.
appendChild
(
newa
);
//set head
newhead
=
document
.
createElement
(
"
h3
"
);
...
...
OfficeJS-Mobile/js/officejs-mobile.js
View file @
d6b0bdef
...
...
@@ -20,7 +20,7 @@
var
that
=
{},
priv
=
{};
// Attributes //
that
.
list
=
new
Array
();
//List for ListPage
that
.
currentContent
=
""
;
priv
.
preference_object
=
{
document_lister
:
'
slickgrid
'
,
...
...
@@ -463,7 +463,7 @@
console
.
error
(
'
No Jio set yet.
'
);
return
;
}
priv
.
loading_object
.
getlist
();
//
priv.loading_object.getlist();
priv
.
jio
.
getDocumentList
({
'
sort
'
:{
'
last_modified
'
:
'
descending
'
,
'
name
'
:
'
ascending
'
},
...
...
@@ -473,11 +473,16 @@
'
onResponse
'
:
function
(
result
)
{
if
(
result
.
status
===
'
done
'
)
{
priv
.
data_object
.
documentList
=
result
.
return_value
;
priv
.
showDocumentListInsideLeftNavBar
();
console
.
log
(
result
.
return_value
.
length
);
console
.
log
(
result
.
return_value
[
0
]);
for
(
var
i
=
0
;
i
<
result
.
return_value
.
length
;
i
++
){
NewList
(
i
,
result
.
return_value
[
i
].
name
,
"
text-Editor
"
);
}
// priv.showDocumentListInsideLeftNavBar();
}
else
{
console
.
error
(
result
.
message
);
}
priv
.
loading_object
.
end_getlist
();
//
priv.loading_object.end_getlist();
if
(
typeof
callback
!==
'
undefined
'
)
{
callback
();
}
...
...
@@ -527,6 +532,15 @@
newlist
.
number
=
that
.
list
.
length
;
that
.
list
.
push
(
newlist
);
//save in the list
}
if
(
!
priv
.
isJioSet
())
{
console
.
error
(
'
No Jio set yet.
'
);
return
;
}
priv
.
jio
.
saveDocument
({
'
name
'
:
basename
,
'
content
'
:
content
});
};
/**
...
...
@@ -535,25 +549,28 @@
* @param {string} basename The document name without ext.
*/
that
.
load
=
function
(
basename
)
{
var
current_editor
=
priv
.
data_object
.
currentEditor
;
// var current_editor = priv.data_object.currentEditor;
if
(
!
priv
.
isJioSet
())
{
console
.
error
(
'
No Jio set yet.
'
);
return
;
}
priv
.
loading_object
.
load
();
//
priv.loading_object.load();
priv
.
jio
.
loadDocument
({
'
name
'
:
basename
+
'
.
'
+
current_editor
.
ext
,
'
name
'
:
basename
,
'
maxtries
'
:
3
,
'
onResponse
'
:
function
(
result
)
{
if
(
result
.
status
===
'
fail
'
)
{
console
.
error
(
result
.
message
);
}
else
{
current_editor
.
setContent
(
result
.
return_value
.
content
);
}
else
{
console
.
log
(
"
content is :
"
+
result
.
return_value
.
content
);
setTextEditorInformation
(
basename
,
result
.
return_value
.
content
);
// current_editor.setContent(
// result.return_value.content);
}
priv
.
loading_object
.
end_load
();
//
priv.loading_object.end_load();
}
});
};
/**
...
...
OfficeJS/js/officejs.js
View file @
d6b0bdef
...
...
@@ -465,6 +465,7 @@
'
onResponse
'
:
function
(
result
)
{
if
(
result
.
status
===
'
done
'
)
{
priv
.
data_object
.
documentList
=
result
.
return_value
;
console
.
log
(
result
.
return_value
);
priv
.
showDocumentListInsideLeftNavBar
();
}
else
{
console
.
error
(
result
.
message
);
...
...
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