aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-12 19:59:33 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-03-12 19:59:33 +0100
commit8c562972062fbf3d750bd62893de248022850c23 (patch)
tree64481a823845b6998da671b98550a96e512bb061
parent3d3618d97c7ef1fbfe2a45218237ccdcd4396d7d (diff)
thème spécifique pour les grandes images
-rw-r--r--app/views/javascript/main.phtml18
-rw-r--r--public/theme/base.css7
2 files changed, 19 insertions, 6 deletions
diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml
index 7ea16737b..d8e15bca7 100644
--- a/app/views/javascript/main.phtml
+++ b/app/views/javascript/main.phtml
@@ -103,11 +103,21 @@ function mark_favorite (active) {
});
}
+function init_img () {
+ var imgs = $(".post.flux .content img").each (function () {
+ if ($(this).width () > ($("#stream").width()) / 2) {
+ $(this).addClass("big");
+ }
+ });
+}
+
function init_posts () {
+ init_img ();
+
if (hide_posts) {
$(".post.flux:not(.active) .content").slideUp ();
}
-
+
$(".post.flux").click (function () {
old_active = $(".post.flux.active");
new_active = $(this);
@@ -116,21 +126,21 @@ function init_posts () {
slide (new_active, old_active);
}
});
-
-
+
$(".post.flux a.read").click (function () {
active = $(this).parents (".post.flux");
mark_read (active);
return false;
});
+
$(".post.flux a.bookmark").click (function () {
active = $(this).parents (".post.flux");
mark_favorite (active);
return false;
});
-
+
$(".post.flux .content a").click (function () {
$(this).attr ('target', '_blank');
});
diff --git a/public/theme/base.css b/public/theme/base.css
index af2744c6e..b3e462353 100644
--- a/public/theme/base.css
+++ b/public/theme/base.css
@@ -268,8 +268,11 @@ form {
.post.flux .content p {
margin: 10px 0;
}
- .post.flux .content img {
- margin: 0;
+ .post.flux .content img.big {
+ display: block;
+ margin: 10px 0;
+ width: 100%;
+ box-shadow: 0 0 5px #000;
border-radius: 5px;
}
.post.flux .content pre {