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
Show 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'));">
...
@@ -62,7 +62,7 @@ $('#input_json_applicant').attr('value'));">
Tools
Tools
</li>
</li>
<li
data-theme=
"c"
>
<li
data-theme=
"c"
>
<a
href=
"#list"
data-transition=
"slide"
onclick=
"
CreateLists
();"
>
<a
href=
"#list"
data-transition=
"slide"
onclick=
"
OfficeJS.getList
();"
>
Document list
Document list
</a>
</a>
</li>
</li>
...
...
OfficeJS-Mobile/js/list-page.js
View file @
d6b0bdef
...
@@ -24,10 +24,10 @@ NewList = function (listnumber,listname,listcontent){
...
@@ -24,10 +24,10 @@ NewList = function (listnumber,listname,listcontent){
newFirstdiv
.
appendChild
(
newSeconddiv
);
newFirstdiv
.
appendChild
(
newSeconddiv
);
//set a tag
//set a tag
newa
=
document
.
createElement
(
"
a
"
);
newa
=
document
.
createElement
(
"
a
"
);
newa
.
setAttribute
(
"
id
"
,
listn
umber
);
newa
.
setAttribute
(
"
id
"
,
listn
ame
);
newa
.
setAttribute
(
"
class
"
,
"
ui-link-inherit
"
);
newa
.
setAttribute
(
"
class
"
,
"
ui-link-inherit
"
);
newa
.
setAttribute
(
"
href
"
,
"
#text
"
);
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
);
newSeconddiv
.
appendChild
(
newa
);
//set head
//set head
newhead
=
document
.
createElement
(
"
h3
"
);
newhead
=
document
.
createElement
(
"
h3
"
);
...
...
OfficeJS-Mobile/js/officejs-mobile.js
View file @
d6b0bdef
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
var
that
=
{},
priv
=
{};
var
that
=
{},
priv
=
{};
// Attributes //
// Attributes //
that
.
list
=
new
Array
();
//List for ListPage
that
.
list
=
new
Array
();
//List for ListPage
that
.
currentContent
=
""
;
priv
.
preference_object
=
{
priv
.
preference_object
=
{
document_lister
:
'
slickgrid
'
,
document_lister
:
'
slickgrid
'
,
...
@@ -463,7 +463,7 @@
...
@@ -463,7 +463,7 @@
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,11 +473,16 @@
...
@@ -473,11 +473,16 @@
'
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
;
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
{
}
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
();
}
}
...
@@ -527,6 +532,15 @@
...
@@ -527,6 +532,15 @@
newlist
.
number
=
that
.
list
.
length
;
newlist
.
number
=
that
.
list
.
length
;
that
.
list
.
push
(
newlist
);
//save in the list
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 @@
...
@@ -535,25 +549,28 @@
* @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
+
'
.
'
+
current_editor
.
ext
,
'
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
{
}
else
{
console
.
log
(
"
content is :
"
+
result
.
return_value
.
content
);
current_editor
.
setContent
(
setTextEditorInformation
(
basename
,
result
.
return_value
.
content
);
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 @@
...
@@ -465,6 +465,7 @@
'
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
);
priv
.
showDocumentListInsideLeftNavBar
();
priv
.
showDocumentListInsideLeftNavBar
();
}
else
{
}
else
{
console
.
error
(
result
.
message
);
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