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
29c3e6dd
Commit
29c3e6dd
authored
May 22, 2012
by
Tristan Cavelier
Committed by
Sebastien Robin
Jun 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding spinning job icons to show what is on going.
parent
68c01140
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
8 deletions
+54
-8
OfficeJS/img/icons/loading_spin_16.gif
OfficeJS/img/icons/loading_spin_16.gif
+0
-0
OfficeJS/img/icons/loading_spin_32.gif
OfficeJS/img/icons/loading_spin_32.gif
+0
-0
OfficeJS/img/icons/loading_spin_64.gif
OfficeJS/img/icons/loading_spin_64.gif
+0
-0
OfficeJS/index.html
OfficeJS/index.html
+8
-1
OfficeJS/js/officejs.js
OfficeJS/js/officejs.js
+46
-7
No files found.
OfficeJS/img/icons/loading_spin_16.gif
0 → 100644
View file @
29c3e6dd
4.84 KB
OfficeJS/img/icons/loading_spin_32.gif
0 → 100644
View file @
29c3e6dd
11.2 KB
OfficeJS/img/icons/loading_spin_64.gif
0 → 100644
View file @
29c3e6dd
28.5 KB
OfficeJS/index.html
View file @
29c3e6dd
...
...
@@ -123,7 +123,14 @@
</head>
<body>
<div
id=
"loading"
style=
"position: absolute; right: 20px; top: 20px;"
></div>
<div
id=
"loading"
style=
"position:absolute;right:10px;top:10px;width:100px;height:40px;"
>
<div
id=
"loading_spin"
style=
"background-image:url('img/icons/loading_spin_16.gif');width:16px;height:16px;float:right;display:none;"
></div>
<div
id=
"loading_spin"
style=
"width:16px;height:16px;float:right;"
></div>
<div
id=
"loading_getlist"
style=
"float:right;display:none;"
><i
class=
"icon-refresh icon-white"
></i></div>
<div
id=
"loading_save"
style=
"float:right;display:none;"
><i
class=
"icon-download-alt icon-white"
></i></div>
<div
id=
"loading_load"
style=
"float:right;display:none;"
><i
class=
"icon-upload icon-white"
></i></div>
<div
id=
"loading_remove"
style=
"float:right;display:none;"
><i
class=
"icon-remove icon-white"
></i></div>
</div>
<div
class=
"navbar"
>
<div
class=
"navbar-inner"
>
<div
class=
"container-fluid"
>
...
...
OfficeJS/js/officejs.js
View file @
29c3e6dd
...
...
@@ -136,9 +136,41 @@ require(['OfficeJS'],function (OJS) {
default
:
return
null
;
}
}
;
}
,
// end get the current editor
////////////////////////////////////////////////////////////////////////////
// loading function
loading_object
=
{
spinstate
:
0
,
savestate
:
0
,
loadstate
:
0
,
getliststate
:
0
,
removestate
:
0
,
main
:
function
(
string
){
if
(
this
[
string
+
'
state
'
]
===
0
){
document
.
querySelector
(
'
#loading_
'
+
string
).
style
.
display
=
'
block
'
;
}
this
[
string
+
'
state
'
]
++
;
},
end_main
:
function
(
string
){
if
(
this
[
string
+
'
state
'
]
>
0
)
{
this
[
string
+
'
state
'
]
--
;
}
if
(
this
[
string
+
'
state
'
]
===
0
){
document
.
querySelector
(
'
#loading_
'
+
string
).
style
.
display
=
'
none
'
;
}
},
spin
:
function
(){
this
.
main
(
'
spin
'
);},
save
:
function
(){
this
.
main
(
'
save
'
);
this
.
spin
();},
load
:
function
(){
this
.
main
(
'
load
'
);
this
.
spin
();},
getlist
:
function
(){
this
.
main
(
'
getlist
'
);
this
.
spin
();},
remove
:
function
(){
this
.
main
(
'
remove
'
);
this
.
spin
();},
end_spin
:
function
(){
this
.
end_main
(
'
spin
'
);},
end_save
:
function
(){
this
.
end_main
(
'
save
'
);
this
.
end_spin
();},
end_load
:
function
(){
this
.
end_main
(
'
load
'
);
this
.
end_spin
();},
end_getlist
:
function
(){
this
.
end_main
(
'
getlist
'
);
this
.
end_spin
();},
end_remove
:
function
(){
this
.
end_main
(
'
remove
'
);
this
.
end_spin
();}
}
// end loading function
////////////////////////////////////////////////////////////////////////////
// repaint the page
hrefClicked
();
...
...
@@ -167,14 +199,17 @@ require(['OfficeJS'],function (OJS) {
alert
(
'
No Jio set yet.
'
);
return
;
}
loading_object
.
save
();
filename
=
$
(
'
#input_fileName
'
).
attr
(
'
value
'
);
filecontent
=
getCurrentEditor
().
getHTML
();
priv
.
jio
.
saveDocument
({
'
fileName
'
:
filename
,
'
fileContent
'
:
filecontent
,
'
callback
'
:
function
(
result
){
alert
(
result
.
isSaved
?
'
Document Saved.
'
:
'
Error:
'
+
result
.
message
);
if
(
result
.
status
===
'
fail
'
)
{
console
.
error
(
'
Error:
'
+
result
.
message
);
}
loading_object
.
end_save
();
publ
.
getlist
();
}
});
...
...
@@ -193,9 +228,8 @@ require(['OfficeJS'],function (OJS) {
if
(
result
.
document
.
fileName
)
{
getCurrentEditor
().
setHTML
(
result
.
document
.
fileContent
);
alert
(
'
Document loaded
'
);
}
else
{
alert
(
'
Error:
'
+
result
.
message
);
console
.
error
(
'
Error:
'
+
result
.
message
);
}
loading_object
.
end_load
();
}
...
...
@@ -207,12 +241,15 @@ require(['OfficeJS'],function (OJS) {
alert
(
'
No Jio set yet.
'
);
return
;
}
loading_object
.
remove
();
filename
=
$
(
'
#input_fileName
'
).
attr
(
'
value
'
);
priv
.
jio
.
removeDocument
({
'
fileName
'
:
filename
,
'
callback
'
:
function
(
result
)
{
alert
(
result
.
isRemoved
?
'
Document Removed.
'
:
'
Error:
'
+
result
.
message
);
if
(
result
.
status
===
'
fail
'
)
{
console
.
error
(
'
Error:
'
+
result
.
message
);
}
loading_object
.
end_remove
();
publ
.
getlist
();
}
});
...
...
@@ -222,6 +259,7 @@ require(['OfficeJS'],function (OJS) {
alert
(
'
No Jio set yet.
'
);
return
;
}
loading_object
.
getlist
();
priv
.
jio
.
getDocumentList
({
'
maxtries
'
:
3
,
'
callback
'
:
function
(
result
)
{
...
...
@@ -245,6 +283,7 @@ require(['OfficeJS'],function (OJS) {
ich_object
.
DocumentList
=
document_array
;
document
.
querySelector
(
'
#document_list
'
).
innerHTML
=
htmlString
;
loading_object
.
end_getlist
();
}
});
};
...
...
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