Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
9dcdf517
Commit
9dcdf517
authored
13 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
fix deleting/renaming albums with a ' in the name
parent
735fcf8b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
apps/gallery/css/styles.css
+9
-8
9 additions, 8 deletions
apps/gallery/css/styles.css
apps/gallery/js/album_cover.js
+3
-3
3 additions, 3 deletions
apps/gallery/js/album_cover.js
apps/gallery/js/albums.js
+18
-12
18 additions, 12 deletions
apps/gallery/js/albums.js
with
30 additions
and
23 deletions
apps/gallery/css/styles.css
+
9
−
8
View file @
9dcdf517
div
#gallery_list
{
margin
:
90pt
20pt
;
}
div
#gallery_list
.leftcontent
{
padding-top
:
15pt
;
margin
:
0
;
position
:
absolute
;
bottom
:
0px
;
text-align
:
center
;
overflow
:
scroll
;
}
div
#gallery_album_box
{
width
:
200px
;
text-align
:
center
;
border
:
0
;
display
:
inline-block
;
margin
:
5pt
;
vertical-align
:
top
;
padding
:
10px
;
position
:
relative
;
overflow
:
hidden
;
color
:
#999
;
}
div
#gallery_album_box
:hover
{
color
:
black
;
}
.leftcontent
div
#gallery_album_box
{
margin
:
5px
;
}
div
#gallery_album_box
h1
{
font-size
:
9pt
;
font-family
:
Verdana
;
}
div
#gallery_album_cover
{
width
:
199px
;
height
:
199px
;
border
:
solid
1pt
#999
;
padding
:
0
;
}
div
#gallery_control_overlay
{
border
:
0
;
position
:
absolute
;
right
:
10pt
;
background-color
:
#333
;
opacity
:
0.5
;
visibility
:
hidden
;
padding
:
0
5pt
;
}
div
#gallery_control_overlay
a
{
color
:
white
;
}
div
.gallery_list.leftcontent
{
padding-top
:
15pt
;
margin
:
0
;
position
:
absolute
;
bottom
:
0px
;
text-align
:
center
;
overflow
:
scroll
;
}
div
.gallery_album_box
{
width
:
200px
;
text-align
:
center
;
border
:
0
;
display
:
inline-block
;
margin
:
5pt
;
vertical-align
:
top
;
padding
:
10px
;
position
:
relative
;
overflow
:
hidden
;
color
:
#999
;
}
div
.gallery_album_box
:hover
{
color
:
black
;
}
.leftcontent
div
.gallery_album_box
{
margin
:
5px
;
}
div
.gallery_album_box
h1
{
font-size
:
9pt
;
font-family
:
Verdana
;
}
div
.gallery_album_cover
{
width
:
199px
;
height
:
199px
;
border
:
solid
1pt
#999
;
padding
:
0
;
}
div
.gallery_control_overlay
{
border
:
0
;
position
:
absolute
;
right
:
10pt
;
background-color
:
#333
;
opacity
:
0
;
padding
:
0
5pt
;
}
div
.gallery_album_box
:hover
div
.gallery_control_overlay
{
opacity
:
0.5
}
div
.gallery_control_overlay
a
{
color
:
white
;
}
#gallery_images
.rightcontent
{
padding
:
10px
5px
;
position
:
absolute
;
bottom
:
0px
;
overflow
:
scroll
;
}
This diff is collapsed.
Click to expand it.
apps/gallery/js/album_cover.js
+
3
−
3
View file @
9dcdf517
...
...
@@ -77,8 +77,8 @@ function galleryRemove(albumName) {
if
(
confirm
(
t
(
'
gallery
'
,
"
Do you wan't to remove album
"
)
+
'
'
+
albumName
+
"
?
"
))
{
$
.
getJSON
(
"
ajax/galleryOp.php
"
,
{
operation
:
"
remove
"
,
name
:
albumName
},
function
(
r
)
{
if
(
r
.
status
==
"
success
"
)
{
$
(
"
#
gallery_album_box
[title='
"
+
albumName
+
"
']
"
).
remove
();
Albums
.
remove
(
albumName
);
$
(
"
.
gallery_album_box
"
).
filterAttr
(
'
data-album
'
,
albumName
).
remove
();
Albums
.
remove
(
albumName
);
}
else
{
alert
(
"
Error:
"
+
r
.
cause
);
}
...
...
@@ -95,7 +95,7 @@ function galleryRename(name) {
}
$
.
getJSON
(
"
ajax/galleryOp.php
"
,
{
operation
:
"
rename
"
,
oldname
:
name
,
newname
:
result
},
function
(
r
)
{
if
(
r
.
status
==
"
success
"
)
{
Albums
.
rename
(
$
(
"
#
gallery_album_box
[title='
"
+
name
+
"
']
"
),
result
);
Albums
.
rename
(
$
(
"
.
gallery_album_box
"
).
filterAttr
(
'
data-album
'
,
albumName
),
result
);
}
else
{
alert
(
"
Error:
"
+
r
.
cause
);
}
...
...
This diff is collapsed.
Click to expand it.
apps/gallery/js/albums.js
+
18
−
12
View file @
9dcdf517
...
...
@@ -41,20 +41,26 @@ Albums={
// displays gallery in linear representation
// on given element, and apply default styles for gallery
display
:
function
(
element
)
{
var
displayTemplate
=
'
<div
id
="gallery_album_box"
title="*NAME*"
><div
id
="gallery_control_overlay"><a href="#"
onclick="galleryRename(
\'
*NAME*
\'
);return false;">rename</a> | <a href="#" onclick="galleryRemove(
\'
*NAME*
\'
);
">remove</a></div><a
href
="
?
view
=*NAME*
"><div
id
="gallery_album_cover"
title="*NAME*"
></div></a><h1>
*NAME*
</h1></div></div>
'
;
var
displayTemplate
=
'
<div
class
="gallery_album_box"><div
class
="gallery_control_overlay"><a href="#"
class="rename">rename</a> | <a href="#" class="remove
">remove</a></div><a
class
="view"><div
class
="gallery_album_cover"></div></a><h1></h1></div></div>
'
;
for
(
var
i
in
Albums
.
albums
)
{
var
a
=
Albums
.
albums
[
i
];
var
local
=
$
(
displayTemplate
.
replace
(
/
\*
NAME
\*
/g
,
a
.
name
));
$
(
"
#gallery_album_cover
"
,
local
).
css
(
'
background-repeat
'
,
'
no-repeat
'
);
$
(
"
#gallery_album_cover
"
,
local
).
css
(
'
background-position
'
,
'
0
'
);
$
(
"
#gallery_album_cover
"
,
local
).
css
(
'
background-image
'
,
'
url("ajax/galleryOp.php?operation=get_covers&albumname=
'
+
a
.
name
+
'
")
'
);
local
.
mouseover
(
function
(
e
)
{
$
(
"
#gallery_control_overlay
"
,
this
).
css
(
'
visibility
'
,
'
visible
'
);
});
local
.
mouseout
(
function
(
e
)
{
$
(
"
#gallery_control_overlay
"
,
this
).
css
(
'
visibility
'
,
'
hidden
'
);
});
$
(
"
#gallery_album_cover
"
,
local
).
mousemove
(
function
(
e
)
{
var
local
=
$
(
displayTemplate
);
local
.
attr
(
'
data-album
'
,
a
.
name
);
$
(
"
.gallery_control_overlay a.rename
"
,
local
).
click
(
function
(
name
,
event
){
event
.
preventDefault
();
galleryRename
(
name
);
}.
bind
(
null
,
a
.
name
));
$
(
"
.gallery_control_overlay a.remove
"
,
local
).
click
(
function
(
name
,
event
){
event
.
preventDefault
();
galleryRemove
(
name
);
}.
bind
(
null
,
a
.
name
));
$
(
"
a.view
"
,
local
).
attr
(
'
href
'
,
'
?view=
'
+
a
.
name
);
$
(
'
h1
'
,
local
).
text
(
a
.
name
);
$
(
"
.gallery_album_cover
"
,
local
).
attr
(
'
title
'
,
a
.
name
);
$
(
"
.gallery_album_cover
"
,
local
).
css
(
'
background-repeat
'
,
'
no-repeat
'
);
$
(
"
.gallery_album_cover
"
,
local
).
css
(
'
background-position
'
,
'
0
'
);
$
(
"
.gallery_album_cover
"
,
local
).
css
(
'
background-image
'
,
'
url("ajax/galleryOp.php?operation=get_covers&albumname=
'
+
a
.
name
+
'
")
'
);
$
(
"
.gallery_album_cover
"
,
local
).
mousemove
(
function
(
e
)
{
var
albumMetadata
=
Albums
.
find
(
this
.
title
);
if
(
albumMetadata
==
undefined
)
{
...
...
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