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
89fe5ca8
Commit
89fe5ca8
authored
Jul 05, 2012
by
Lingnan Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a new button in list page to remove all the lists
parent
1c7b82ab
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
11 deletions
+81
-11
OfficeJS-Mobile/css/simpledialog.min.css
OfficeJS-Mobile/css/simpledialog.min.css
+8
-0
OfficeJS-Mobile/index.html
OfficeJS-Mobile/index.html
+6
-0
OfficeJS-Mobile/js/list-page.js
OfficeJS-Mobile/js/list-page.js
+52
-1
OfficeJS-Mobile/js/officejs-mobile.js
OfficeJS-Mobile/js/officejs-mobile.js
+7
-10
OfficeJS-Mobile/js/simpledialog2.min.js
OfficeJS-Mobile/js/simpledialog2.min.js
+8
-0
No files found.
OfficeJS-Mobile/css/simpledialog.min.css
0 → 100644
View file @
89fe5ca8
/*
* jQuery Mobile Framework : plugin to provide a simple Dialog widget.
* Copyright (c) JTSage
* CC 3.0 Attribution. May be relicensed without permission/notifcation.
* https://github.com/jtsage/jquery-mobile-simpledialog
*/
.ui-simpledialog-header
h4
{
margin-top
:
5px
;
margin-bottom
:
5px
;
text-align
:
center
}
.ui-simpledialog-container
{
border
:
5px
solid
#111
!important
;
width
:
85%
;
max-width
:
500px
}
.ui-simpledialog-screen
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
}
.ui-simpledialog-hidden
{
display
:
none
}
.ui-simpledialog-input
{
width
:
85%
!important
;
display
:
block
!important
;
margin-left
:
auto
;
margin-right
:
auto
}
.ui-simpledialog-screen-modal
{
background-color
:
black
;
-moz-opacity
:
.8
;
opacity
:
.80
;
filter
:
alpha
(
opacity
=
80
)}
.ui-simpledialog-subtitle
{
text-align
:
center
}
.ui-simpledialog-controls
.buttons-separator
{
min-height
:
.6em
}
.ui-simpledialog-controls
.button-hidden
{
display
:
none
}
.ui-dialog
.ui-simpledialog-container
{
border
:
none
!important
}
.ui-dialog-simpledialog
.ui-content
{
padding
:
5px
!important
}
OfficeJS-Mobile/index.html
View file @
89fe5ca8
...
...
@@ -3,6 +3,7 @@
<head>
<title>
OfficeJS-Mobile
</title>
<link
rel=
"stylesheet"
href=
"css/themes/default/jquery.mobile-1.1.0.css"
/>
<link
rel=
"stylesheet"
href=
"css/simpledialog.min.css"
/>
<script
src=
"js/jquery.js"
></script>
<script
src=
"js/jquery.mobile-1.1.0.js"
></script>
<script
type=
"text/javascript"
src=
"lib/jstorage/jstorage.js"
></script>
...
...
@@ -11,6 +12,8 @@
<script
type=
"text/javascript"
src=
"lib/base64/base64.js"
></script>
<script
type=
"text/javascript"
src=
"lib/sjcl/sjcl.min.js"
></script>
<script
type=
"text/javascript"
src=
"src/jio.storage.js"
></script>
<script
type=
"text/javascript"
src=
"js/simpledialog2.min.js"
></script>
<script
type=
"text/javascript"
src=
"js/officejs-mobile.js"
></script>
<script
type=
"text/javascript"
src=
"js/list-page.js"
></script>
<script
type=
"text/javascript"
src=
"js/text-editor.js"
></script>
...
...
@@ -104,6 +107,9 @@ $('#input_json_applicant').attr('value'));">
<div
data-role=
"content"
style=
"padding: 15px"
>
<ul
class=
"ui-listview"
data-role=
"listview"
id=
"textlist"
>
</ul>
<div>
<a
href=
"#"
id=
"removeall"
data-role=
"button"
data-theme=
"a"
>
Remove All
</a>
</div>
</div>
</div>
...
...
OfficeJS-Mobile/js/list-page.js
View file @
89fe5ca8
...
...
@@ -25,7 +25,7 @@ NewList = function (listnumber,listname,listcontent){
//set a tag
newa
=
document
.
createElement
(
"
a
"
);
newa
.
setAttribute
(
"
id
"
,
listname
);
newa
.
setAttribute
(
"
class
"
,
"
ui-link-inherit
"
);
newa
.
setAttribute
(
"
class
"
,
"
listcontent
ui-link-inherit
"
);
newa
.
setAttribute
(
"
href
"
,
"
#text
"
);
newa
.
setAttribute
(
"
onclick
"
,
"
OfficeJS.load(this.id);
"
);
newSeconddiv
.
appendChild
(
newa
);
...
...
@@ -47,3 +47,54 @@ NewList = function (listnumber,listname,listcontent){
newFirstdiv
.
appendChild
(
newshadow
);
}
//set the List
setList
=
function
(
result_return_value
){
removeLists
();
//set all the list
for
(
var
i
=
0
;
i
<
result_return_value
.
length
;
i
++
){
NewList
(
i
,
result_return_value
[
i
].
name
,
"
text-Editor
"
);
}
}
//remove all lists
removeLists
=
function
(){
var
n
=
document
.
getElementById
(
'
textlist
'
).
childNodes
.
length
;
for
(
var
i
=
0
;
i
<
n
;
i
++
)
{
document
.
getElementById
(
'
textlist
'
).
removeChild
(
document
.
getElementById
(
'
textlist
'
).
firstChild
);
}
}
//set the popup dialog for remove all button
$
(
document
).
delegate
(
'
#removeall
'
,
'
click
'
,
function
()
{
$
(
'
<div>
'
).
simpledialog2
({
mode
:
'
button
'
,
headerText
:
'
Are you sure?
'
,
headerClose
:
true
,
buttonPrompt
:
'
Can not be retrieved
'
,
buttons
:
{
'
OK
'
:
{
click
:
function
()
{
RemoveAllDocument
();
removeLists
();
}
},
'
Cancel
'
:
{
click
:
function
()
{
},
icon
:
"
delete
"
,
theme
:
"
c
"
}
}
})
})
//remove all
RemoveAllDocument
=
function
(){
var
document_name_array
=
[];
var
document_list
=
document
.
getElementsByClassName
(
'
listcontent
'
);
for
(
var
i
=
0
;
i
<
document_list
.
length
;
i
++
)
{
document_name_array
.
push
(
document_list
[
i
].
id
);
}
OfficeJS
.
removeSeveralFromArray
(
document_name_array
);
}
OfficeJS-Mobile/js/officejs-mobile.js
View file @
89fe5ca8
...
...
@@ -471,10 +471,7 @@
'
onResponse
'
:
function
(
result
)
{
if
(
result
.
status
===
'
done
'
)
{
priv
.
data_object
.
documentList
=
result
.
return_value
;
//set the List
for
(
var
i
=
0
;
i
<
result
.
return_value
.
length
;
i
++
){
NewList
(
i
,
result
.
return_value
[
i
].
name
,
"
text-Editor
"
);
}
setList
(
result
.
return_value
);
//priv.showDocumentListInsideLeftNavBar();
}
else
{
console
.
error
(
result
.
message
);
...
...
@@ -587,23 +584,23 @@
* @param {array} documentarray Contains all file names ({string}).
*/
that
.
removeSeveralFromArray
=
function
(
documentarray
)
{
var
i
,
l
,
cpt
=
0
,
current_editor
=
priv
.
data_object
.
currentEditor
;
var
i
,
l
,
cpt
=
0
;
//
current_editor = priv.data_object.currentEditor;
if
(
!
priv
.
isJioSet
())
{
console
.
error
(
'
No Jio set yet.
'
);
return
;
}
for
(
i
=
0
,
l
=
documentarray
.
length
;
i
<
l
;
i
+=
1
)
{
priv
.
loading_object
.
remove
();
//
priv.loading_object.remove();
priv
.
jio
.
removeDocument
({
name
:
documentarray
[
i
],
onResponse
:
function
(
result
)
{
cpt
+=
1
;
if
(
cpt
===
l
)
{
if
(
typeof
current_editor
.
update
!==
'
undefined
'
)
{
that
.
getList
(
current_editor
.
update
);
}
//
if (typeof current_editor.update !== 'undefined') {
//
that.getList(current_editor.update);
//
}
}
priv
.
loading_object
.
end_remove
();
//
priv.loading_object.end_remove();
}});
}
};
...
...
OfficeJS-Mobile/js/simpledialog2.min.js
0 → 100644
View file @
89fe5ca8
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