Explorar o código

thème spécifique pour les grandes images

Marien Fressinaud %!s(int64=13) %!d(string=hai) anos
pai
achega
8c56297206
Modificáronse 2 ficheiros con 19 adicións e 6 borrados
  1. 14 4
      app/views/javascript/main.phtml
  2. 5 2
      public/theme/base.css

+ 14 - 4
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');
 	});

+ 5 - 2
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 {