Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Nextcloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Nextcloud
Commits
8d4039b6
Commit
8d4039b6
authored
13 years ago
by
Brice Maron
Browse files
Options
Downloads
Patches
Plain Diff
Add loading message to image lightbox and tweak events
parent
f29dc0c0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/files_imageviewer/css/lightbox.css
+10
-1
10 additions, 1 deletion
apps/files_imageviewer/css/lightbox.css
apps/files_imageviewer/js/lightbox.js
+12
-5
12 additions, 5 deletions
apps/files_imageviewer/js/lightbox.js
core/img/loading-dark.gif
+0
-0
0 additions, 0 deletions
core/img/loading-dark.gif
with
22 additions
and
6 deletions
apps/files_imageviewer/css/lightbox.css
+
10
−
1
View file @
8d4039b6
...
@@ -20,4 +20,13 @@
...
@@ -20,4 +20,13 @@
margin-left
:
auto
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-right
:
auto
;
z-index
:
9999
;
z-index
:
9999
;
}
}
\ No newline at end of file
#lightbox_loader
{
text-align
:
center
;
position
:
fixed
;
top
:
40%
;
left
:
50%
;
color
:
white
;
}
#lightbox_loader
img
{
margin-right
:
1em
;}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
apps/files_imageviewer/js/lightbox.js
+
12
−
5
View file @
8d4039b6
...
@@ -2,11 +2,17 @@
...
@@ -2,11 +2,17 @@
var
lightBoxShown
=
false
;
var
lightBoxShown
=
false
;
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
images
=
{};
//image cache
images
=
{};
//image cache
var
overlay
=
$
(
'
<div id="lightbox_overlay"/>
'
);
loading_str
=
t
(
'
files_imageviewer
'
,
'
Loading
'
);
var
overlay
=
$
(
'
<div id="lightbox_overlay"><div id="lightbox_loader"><img /></div></div>
'
);
overlay
.
find
(
'
#lightbox_loader img
'
)
.
attr
(
'
src
'
,
OC
.
imagePath
(
'
core
'
,
'
loading-dark.gif
'
))
.
attr
(
'
alt
'
,
loading_str
)
.
after
(
loading_str
);
$
(
'
body
'
).
append
(
overlay
);
$
(
'
body
'
).
append
(
overlay
);
var
container
=
$
(
'
<div id="lightbox"/>
'
);
var
container
=
$
(
'
<div id="lightbox"/>
'
);
$
(
'
body
'
).
append
(
container
);
$
(
'
body
'
).
append
(
container
);
$
(
'
body
'
).
click
(
hideLightbox
);
$
(
'
#lightbox_overlay
'
).
click
(
hideLightbox
);
$
(
'
#lightbox
'
).
click
(
hideLightbox
);
if
(
typeof
FileActions
!==
'
undefined
'
){
if
(
typeof
FileActions
!==
'
undefined
'
){
FileActions
.
register
(
'
image
'
,
'
View
'
,
''
,
function
(
filename
){
FileActions
.
register
(
'
image
'
,
'
View
'
,
''
,
function
(
filename
){
viewImage
(
$
(
'
#dir
'
).
val
(),
filename
);
viewImage
(
$
(
'
#dir
'
).
val
(),
filename
);
...
@@ -35,7 +41,8 @@ function viewImage(dir,file){
...
@@ -35,7 +41,8 @@ function viewImage(dir,file){
var
img
=
new
Image
();
var
img
=
new
Image
();
img
.
onload
=
function
(){
img
.
onload
=
function
(){
images
[
location
]
=
img
;
images
[
location
]
=
img
;
showLightbox
(
container
,
img
);
if
(
$
(
'
#lightbox_overlay
'
).
is
(
'
:visible
'
))
showLightbox
(
container
,
img
);
}
}
img
.
src
=
location
;
img
.
src
=
location
;
}
else
{
}
else
{
...
@@ -67,10 +74,10 @@ function showLightbox(container,img){
...
@@ -67,10 +74,10 @@ function showLightbox(container,img){
}
}
function
hideLightbox
(
event
){
function
hideLightbox
(
event
){
if
(
lightBoxShown
){
if
(
event
){
event
.
stopPropagation
();
event
.
stopPropagation
();
$
(
'
#lightbox_overlay
'
).
hide
();
$
(
'
#lightbox_overlay
'
).
hide
();
$
(
'
#lightbox
'
).
hide
();
$
(
'
#lightbox
'
).
hide
();
lightBoxShown
=
false
;
lightBoxShown
=
false
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
core/img/loading-dark.gif
0 → 100644
+
0
−
0
View file @
8d4039b6
673 B
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment